npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

omp-kiro

v1.2.6

Published

Kiro OAuth, credits usage, model discovery, and streaming runtime for Oh My Pi.

Readme

omp-kiro

Kiro (AWS) provider plugin for Oh My Pi (omp), reusing the current kiro.dev runtime and management APIs. Built on the OMP extension interface: pi.registerProvider("kiro", config) with device-code OAuth (/login), profile-scoped model discovery (fetchDynamicModels), and a custom EventStream runtime (streamSimple).

Install

Directly from npm:

omp plugin install omp-kiro

Or through this repository's OMP marketplace:

omp plugin marketplace add fanbaoyu1024/omp-kiro
omp plugin install omp-kiro@fanbaoyu-kiro

OMP loads the entry declared in package.json#omp.extensions (./dist/extension.js). Then log in:

omp /login
# choose: Kiro (AWS Builder ID / IAM Identity Center plugin)

The login prompts for your IAM Identity Center start URL (leave blank for AWS Builder ID), opens the device-code verification URL, and polls until you authorize. Credentials refresh automatically; the resolved profile ARN routes requests to the right Kiro profile.

Kiro CLI and OMP keep separate OAuth credentials. Switching accounts with kiro-cli does not switch the OMP account; run /login, choose Kiro again, and refresh the model catalog in OMP after an account change.

Check the authenticated account's current Kiro credits from OMP's standard usage surfaces (OMP builds with extension usage-provider support):

omp usage --provider kiro

or the /usage panel in the OMP TUI. On OMP builds without extension usage support, the plugin's own command reports the same snapshot:

/kiro-usage

Both report the subscription, precise credits used and remaining, percentage used, and the next reset date. /kiro-usage is kept as the compatibility command and works on every supported OMP version.

Provider identity

The plugin registers the canonical Kiro surfaces:

  • provider id: kiro
  • stream API id: kiro-api
  • display name: Kiro (AWS Builder ID / IAM Identity Center plugin)

When enabled, this plugin replaces or extends OMP's built-in Kiro registration. Do not install another Kiro provider extension alongside it.

How it works

  • OAuth: OIDC device authorization flow (client/registerdevice_authorization → token polling) against oidc.<region>.amazonaws.com. oauth.getApiKey returns a structured JSON API key ({token, region, profileArn}) that the stream layer parses.
  • Dynamic catalog: only fetchDynamicModels is configured — never models (OMP's registry ignores fetchDynamicModels when models is non-empty). The function returns the Kiro CLI 2.19.2 bootstrap catalog when unauthenticated. Once authenticated, the profile-scoped List-Available-Models response is authoritative: models omitted for the current account are removed rather than restored from an older bootstrap list.
  • Runtime: streamSimple posts to https://runtime.<region>.kiro.dev/generateAssistantResponse and decodes AWS application/vnd.amazon.eventstream frames (CRC-checked prelude/message framing) into OMP assistant events. Kiro's V1 stream reports context percentage and credits but no output-token count, so the plugin estimates output tokens from the emitted UTF-8 content and records TTFT/duration; this enables OMP's standard ///⚡ tokens/s row. A transient fleet-only HTTP 400 Invalid tool use format. is retried exactly once with the identical payload and a fresh request ID; all other validation errors fail immediately.
  • Credits usage: each completed Kiro turn records the service's native {usage, unit: "credit"} event as Kiro <turn> credits · Σ <session total> and persists one hidden kiro-credit-metering session entry. On restart, resume, or branch switch, the total is rebuilt from the current branch only; malformed and abandoned-branch entries are ignored. OMP builds exposing ExtensionUIContext.setStatusLine render it inline in the main billing segment (replacing the bare (sub) marker); older OMP builds fall back to a separate hook-status row. The provider config also registers a standard OMP UsageProvider (usage field), so /usage and omp usage --provider kiro show the account-level used/limit/remaining balance and reset timestamp. /kiro-usage remains the compatibility command for hosts without extension usage-provider support.
  • Cache safety: only standard ProviderModelConfig fields are emitted. The region travels on the per-model baseUrl, the profile ARN in the standard x-amzn-kiro-profile-arn header, and the thinking surface in the standard thinking metadata — custom fields would be dropped by OMP's SQLite model cache.

Known limitations

  • OMP resolves the API key for fetchDynamicModels from the stored credential. When it is a plain bearer token (not the structured JSON this plugin's getApiKey produces for streaming), catalog discovery falls back to the default us-east-1 management region. Structured keys — including the one produced by oauth.getApiKey — carry the region and are honored when present.
  • The raw Kiro request-field schema cannot survive OMP's model cache; the wire effort vocabulary is approximated by the standard low→max ladder and the reasoning/output_config field choice is encoded in thinking.mode.
  • If the structured API key carries no profile ARN yet, the first stream resolves one via List-Available-Profiles; afterwards the resolved ARN is cached on the models' headers.

Development

bun install
bun run typecheck
bun run test
bun run build   # dist/ with bun + declaration files

License

MIT