opencode-navigator 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [0.21.0] - 2026-10-06
6
+
7
+ - Automatically verify Codex account identity from OpenCode 2's ChatGPT connection. When host identity is unavailable, confirm a private binding once per connection or provider and reuse it across models, projects, and sessions; preserve compatible older confirmations and isolate conflicting ones until relinked.
8
+ - Expand OpenCode 2 Limits with documented native subscription allowances, API rate-limit observations, configured capacities, account balances, and key budgets. Keep provider-native units, currencies, model associations, and active-account boundaries explicit.
9
+ - Add Provider sources to explain each provider's supported measurements, required permissions, and unavailable APIs without guessing remaining quota.
10
+ - Keep available account balances visible when a separate subscription read fails, and show exhausted NanoGPT subscription windows instead of hiding them.
11
+ - Keep stale quota guidance visible after failed refreshes, reject late results after credential changes, and recover from stalled provider reads without blocking model response streams.
12
+
5
13
  ## [0.20.0] - 2026-10-05
6
14
 
7
15
  - Add a default-visible Limits section for the selected model's provider-native quota windows, reset times, account identity, and freshness. Codex CLI support requires an explicit private account binding; unsupported providers show calm guidance.
@@ -70,6 +78,7 @@
70
78
 
71
79
  Earlier release notes are available on [GitHub Releases](https://github.com/St1ggy/opencode-navigator/releases).
72
80
 
81
+ [0.21.0]: https://github.com/St1ggy/opencode-navigator/compare/v0.20.0...v0.21.0
73
82
  [0.20.0]: https://github.com/St1ggy/opencode-navigator/compare/v0.19.3...v0.20.0
74
83
  [0.19.3]: https://github.com/St1ggy/opencode-navigator/compare/v0.19.2...v0.19.3
75
84
  [0.19.2]: https://github.com/St1ggy/opencode-navigator/compare/v0.19.1...v0.19.2
package/PROVIDERS.md ADDED
@@ -0,0 +1,92 @@
1
+ # Provider Quota Sources
2
+
3
+ Navigator follows the currently selected host model and active provider connection.
4
+ It never treats session token/cost totals as remaining provider quota. Subscription
5
+ windows, API rate limits, configured capacities, and monetary balances are different
6
+ measurements and are labelled separately.
7
+
8
+ The implemented contracts were rechecked on 2026-10-06. The runtime also includes providers from
9
+ the host catalog; an unrecognized provider gets an explicit unverified-source state
10
+ rather than fabricated quota values. Availability depends on the selected account,
11
+ permissions, region, transport, and supported host APIs.
12
+
13
+ ## Audited Read Sources
14
+
15
+ | Provider | Native source | Scope and prerequisites | Reference |
16
+ | --- | --- | --- | --- |
17
+ | OpenAI / Codex ChatGPT | Codex app-server account/rate-limit RPC and manual reset credits | Verified account identity; exact provider-reported model bucket | [Codex protocol](https://github.com/openai/codex/tree/main/codex-rs/app-server-protocol) |
18
+ | OpenAI API | HTTP request/token/project-token rate-limit headers | Actual response for the selected model/account; HTTP transport | [Rate limits](https://developers.openai.com/api/docs/guides/rate-limits) |
19
+ | Anthropic API | Native response headers and organization rate-limits API | Per-model headers; configured limits need an eligible org/admin credential and explicit model association | [Rate limits API](https://platform.claude.com/docs/en/manage-claude/rate-limits-api) |
20
+ | Azure OpenAI | Native remaining request/token headers | Actual deployment response; does not expose a ChatGPT subscription | [Quotas and limits](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/quotas-limits) |
21
+ | Groq | Native request/day and token/minute response headers | Actual response for the selected model/account | [Rate limits](https://console.groq.com/docs/rate-limits) |
22
+ | Fireworks | Model response throughput headers; account quotas API | Native token/second capacities; account lookup must be unambiguous, and GPU quotas are excluded from chat-model views | [Serverless limits](https://docs.fireworks.ai/serverless/rate-limits), [Quotas API](https://docs.fireworks.ai/api-reference/list-quotas) |
23
+ | OpenRouter | Current-key USD spending budget and free-model daily requests | Normal inference key; free-model counters apply only to documented free variants | [Key API](https://openrouter.ai/docs/api/api-reference/api-keys/get-current-api-key) |
24
+ | OpenRouter management | Account purchased/used credits in USD | Management key required; never substitute key budget for account balance | [Credits API](https://openrouter.ai/docs/api/api-reference/credits/get-remaining-credits) |
25
+ | DeepSeek | Current-user currency balances | Existing inference API key; API supplies USD/CNY and separates granted/top-up balances | [Balance API](https://api-docs.deepseek.com/api/get-user-balance) |
26
+ | Moonshot / Kimi API | Available, voucher, and cash balance | Region-specific API key; international USD and China CNY are not interchangeable | [International balance](https://platform.moonshot.ai/docs/api/balance), [China balance](https://platform.moonshot.cn/docs/api/balance) |
27
+ | MiniMax Token Plan | Documented token-plan remains endpoint and provider-owned response types | Subscription key; explicit model rows/percentages only, without guessing ambiguous legacy count direction | [Token Plan FAQ](https://platform.minimax.io/docs/token-plan/faq), [Official quota SDK](https://github.com/MiniMax-AI/cli/tree/main/src/sdk/quota) |
28
+ | GitHub Copilot | Official SDK account quota RPC with explicit host token | SDK runtime; token-scoped model lookup and quota read; no private REST endpoint calls | [Official SDK](https://github.com/github/copilot-sdk), [Authentication](https://github.com/github/copilot-sdk/blob/main/docs/auth/authenticate.md) |
29
+ | NanoGPT | USD/Nano balances and daily/weekly subscription input-token quotas | Existing inference key; only models in the same API host's subscription-only catalog; null/degraded counters remain unknown | [Balance](https://docs.nano-gpt.com/api-reference/endpoint/check-balance), [Usage](https://docs.nano-gpt.com/api-reference/endpoint/subscription-usage), [Models](https://docs.nano-gpt.com/api-reference/endpoint/models) |
30
+ | SiliconFlow / China | Current-user available, charged, and granted balances | Region-specific inference key; retain unknown currency when the response omits it | [User info](https://docs.siliconflow.com/en/api-reference/userinfo/get-user-info) |
31
+ | Novita | Available balance, cash balance, credit limit, pending charges, and outstanding invoices | Existing inference key; exact 1/10000 USD scaling | [Balance](https://novita.ai/docs/api-reference/basic-get-user-balance) |
32
+ | Poe | Current combined plan/add-on point balance | Existing API credential; points are not dollars or tokens | [Usage API](https://creator.poe.com/docs/resources/usage-api) |
33
+ | AIHubMix | Current-user USD balance | Manage Key required; quota units scale by 500000 per USD | [Current user](https://docs.aihubmix.com/en/api/CliEndpoints/get-self) |
34
+
35
+ ## Capability Constraints And Other Providers
36
+
37
+ | Provider / product | Constraint or additional capability required | Public reference |
38
+ | --- | --- | --- |
39
+ | Claude Pro/Max / Claude Code | Session-local `rate_limits` statusline exists; it does not provide a portable OpenCode cross-process subscription read API | [Statusline](https://code.claude.com/docs/en/statusline) |
40
+ | Google Gemini API | Project/model rate limits; AI Studio and cloud quota permissions are separate from a plain inference key | [Gemini limits](https://ai.google.dev/gemini-api/docs/rate-limits) |
41
+ | Google Vertex AI | Project/region quota and cloud authentication; shared/dynamic quotas are not a personal subscription balance | [Vertex quotas](https://cloud.google.com/vertex-ai/generative-ai/docs/quotas) |
42
+ | Amazon Bedrock | IAM/region Service Quotas and CloudWatch require additional cloud capabilities and exact model/quota mapping | [Bedrock quotas](https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html) |
43
+ | Azure AI / Microsoft Foundry | Resource/deployment quotas and cloud management permissions; no portable credit balance from an inference key alone | [Foundry quotas](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/quotas-limits) |
44
+ | Cerebras | Organization/project/model rate limits; parse only self-describing native counters actually present in the model response, never copy console tier examples | [Cerebras limits](https://inference-docs.cerebras.ai/support/rate-limits) |
45
+ | Mistral | Organization request/token limits and remaining headers; do not infer missing counter units or a subscription balance | [Known limitations](https://docs.mistral.ai/resources/known-limitations) |
46
+ | Together AI | Current serverless API exposes a retry interval on 429, not remaining counters; a portable remaining-credit API is not established by billing UI documentation | [Credits](https://docs.together.ai/docs/billing-credits), [Rate limits](https://docs.together.ai/docs/rate-limits) |
47
+ | xAI / Grok | API usage differs from consumer subscriptions; management billing needs separate team credentials | [Developer docs](https://docs.x.ai/) |
48
+ | Perplexity | API credits are separate from the consumer subscription and Computer credits; billing UI does not establish a remaining-credit read endpoint | [API billing](https://www.perplexity.ai/help-center/en/articles/10354847-api-payment-and-billing) |
49
+ | Kimi Code subscription | Keep separate from Moonshot pay-as-you-go balance; undocumented usage/browser endpoints are not adopted | [Kimi Code](https://www.kimi.com/code/docs/en/) |
50
+ | Z.ai / Zhipu GLM Coding Plan | Usage windows exist; monitor/dashboard endpoints require a documented external API contract before integration | [Coding Plan](https://docs.z.ai/devpack/overview) |
51
+ | Qwen / Alibaba Cloud / DashScope | Model/project/cloud quota and billing permissions; browser OAuth state is not a portable quota source | [Model Studio docs](https://www.alibabacloud.com/help/en/model-studio/) |
52
+ | Hugging Face Inference Providers | Hub request quotas are not automatically inference-model quotas or inference credits | [Hub limits](https://huggingface.co/docs/hub/rate-limits), [Inference pricing](https://huggingface.co/docs/inference-providers/pricing) |
53
+ | Cloudflare Workers AI | Account billing/analytics and model/resource limits; do not derive remaining free allowance from static daily examples | [Workers AI limits](https://developers.cloudflare.com/workers-ai/platform/limits/) |
54
+ | OpenCode Zen / Go | Host session statistics are not the provider's account balance; no undocumented billing endpoints are queried | [OpenCode Zen](https://opencode.ai/docs/zen/) |
55
+ | Cursor | Consumer account usage requires a supported external API; no browser cookies or local credential extraction | [Cursor docs](https://docs.cursor.com/) |
56
+ | Windsurf / Codeium | Consumer plan usage is separate from API response rate limits; no private account endpoints | [Windsurf docs](https://docs.windsurf.com/) |
57
+ | Amp | Product credits require a supported external account API; no credential-file or cookie integrations | [Amp manual](https://ampcode.com/manual) |
58
+ | OpenAI-compatible gateways | Protocol compatibility does not prove account identity, native quota units, or backend bucket/model mapping | [OpenCode providers](https://opencode.ai/docs/providers/) |
59
+ | Ollama / LM Studio / local models | Local inference generally has no provider subscription quota to read; cloud offerings are separate products | [Ollama API](https://docs.ollama.com/api), [LM Studio API](https://lmstudio.ai/docs/developer) |
60
+ | NVIDIA NIM / NGC | Cloud/trial and self-hosted limits differ; an inference endpoint does not identify an NGC credit balance | [NIM docs](https://docs.nvidia.com/nim/) |
61
+ | Cohere | Organization/API rate limits are distinct from subscription windows and account credit balances | [Cohere rate limits](https://docs.cohere.com/docs/rate-limits) |
62
+ | AI21 | Project/model rate limits; no independently verified subscription remaining-window API | [AI21 docs](https://docs.ai21.com/) |
63
+ | Replicate | Model execution billing is distinct from subscription quota; no inferred remaining credits from prediction cost | [Billing](https://replicate.com/docs/topics/billing) |
64
+ | Baseten / ModelScope / Nebius / Vultr / v0 | Additional billing permissions or an independently verified model/quota contract are required; protocol compatibility alone is insufficient | [OpenCode providers](https://opencode.ai/docs/providers/) |
65
+ | Chutes | Public current-user quota routes exist, but native units and model/allowance semantics have not been independently established | [Users API](https://chutes.ai/docs/api-reference/users) |
66
+ | Requesty | Management key/key ID and budget semantics are required; dated usage reports are not remaining quota | [Key management API](https://docs.requesty.ai/features/key-management-api) |
67
+
68
+ ## Authentication And Host Boundaries
69
+
70
+ - OpenCode 2 metadata matching uses public provider/credential APIs and the built-in
71
+ ChatGPT OAuth `metadata.accountID`. Account IDs are compared with Codex's own
72
+ reported identity; a provider name or model-name similarity is not proof.
73
+ - A confirmation is saved once per connection, or per provider when the host has
74
+ no connection API. Models do not need separate confirmations. Conflicting older
75
+ model-specific records remain isolated until an explicit relink.
76
+ - Additional read-only sources use Navigator's OpenCode 2 server plugin and public
77
+ integration/HTTP-response hooks. Secrets remain on the server and are never
78
+ returned by quota RPCs, written to Navigator preferences, or included in logs.
79
+ - Native response observations do not issue extra model requests. No quota read
80
+ triggers inference, a credit purchase, a reset, or an authorization flow.
81
+ - HTTP-only observations may be absent for WebSocket transports. Report that
82
+ limitation instead of changing the host transport or reading private frames.
83
+ - The native adapters are available through the OpenCode 2 server plugin. OpenCode
84
+ 1.x keeps Codex support and capability guidance without accessing host internals.
85
+ - REST credentials are not reused against a native provider origin when the host
86
+ explicitly configures a different gateway origin. Redirects are rejected.
87
+ - Contract fixtures cover endpoint selection, regions, units, pagination, account
88
+ ambiguity/rotation, malformed bodies, cancellation, and partial-data handling.
89
+ These are deterministic checks, not live billing-account probes.
90
+ - Documentation from reference implementations is used only to discover APIs;
91
+ browser cookies, credential-file readers, private endpoints, and organization-
92
+ specific stacks are excluded.
package/README.md CHANGED
@@ -358,7 +358,7 @@ OpenCode after changing `cli.json`.
358
358
  ## Limits: provider quotas and banked resets
359
359
 
360
360
  Navigator keeps subscription limits separate from OpenCode's session token and
361
- cost statistics. The first supported source is Codex's documented app-server
361
+ cost statistics. Codex subscription data comes from its documented app-server
362
362
  `account/rateLimits/read` RPC. It reports provider-owned usage windows, reset
363
363
  times, account identity, and any available banked reset credits. The installed
364
364
  Codex 0.160.0 protocol also exposes the separate
@@ -371,12 +371,30 @@ Switching provider, model, session, or account invalidates stale reads and credi
371
371
  CodexBar is useful for discovering providers, but its cookie, credential-file,
372
372
  and undocumented endpoint integrations are not Navigator data sources.
373
373
 
374
- | Source | Machine-readable subscription limits | Banked reset credits |
374
+ | Source | Native measurement | Banked reset credits |
375
375
  | --- | --- | --- |
376
376
  | Codex app-server | Rate-limit windows and account ID | Available count, optional details and expiry, confirmed manual consumption |
377
+ | MiniMax and NanoGPT | Explicit model-associated subscription windows; separate pay-as-you-go balances | Read-only |
378
+ | GitHub Copilot | Official SDK token-scoped premium allowance, checked against the selected model's billing metadata | Read-only |
379
+ | OpenRouter, DeepSeek, Moonshot, SiliconFlow, Novita, Poe, AIHubMix | Current-account balance or key spending budget, preserving provider-native currency/points and permission requirements | Read-only |
380
+ | OpenAI API, Anthropic, Azure OpenAI, Groq, Cerebras, Fireworks | Native model-response counters or explicitly labelled configured capacities | Read-only |
377
381
  | Claude Code (not integrated) | Session-local `rate_limits` statusline payload after a Claude Code response | No documented cross-process consumption API |
378
382
  | OpenCode session statistics | Token and cost statistics, not subscription quota | Not applicable |
379
- | Other providers | Not shown until a documented machine-readable quota API is verified | No action without a documented consume API |
383
+ | Other providers | Capability guidance until a documented source and model/account mapping are verified | No action without a documented consume API |
384
+
385
+ The additional native sources use the **OpenCode 2 Navigator server plugin** already
386
+ used for Todo. Configure it on the 2.x launch path as described in the installation
387
+ section. OpenCode 1.x retains Codex support; additional sources need the 2.x public
388
+ integration/HTTP APIs. Without the server plugin, Limits shows setup guidance.
389
+ **Provider sources** lists audited capabilities and unsupported-source reasons;
390
+ the [source inventory](PROVIDERS.md) includes public API references and prerequisites.
391
+
392
+ The server resolves the active host credential through OpenCode's public API.
393
+ Quota RPCs return measurements, never credentials. Response-header observations
394
+ use real model requests without issuing extra inference calls or consuming their
395
+ response bodies. HTTP-only observations may be absent on WebSocket transports.
396
+ REST reads use a short in-memory cache; Refresh bypasses it. Observed headers older
397
+ than two minutes are marked stale instead of presented as current remaining quota.
380
398
 
381
399
  Limits is visible and expanded by default, first below the session title. Change
382
400
  its visibility and order under **Settings → Sections** in Global or Current
@@ -386,20 +404,29 @@ available from the command palette.
386
404
 
387
405
  ![Model-specific Codex quota windows and reset times](screenshots/39-provider-limits.png)
388
406
 
407
+ ![Audited provider sources and required capabilities](screenshots/47-provider-sources.png)
408
+
389
409
  ### Link the intended Codex account
390
410
 
391
411
  Install a Codex CLI exposing the documented read and consume RPCs (verified with
392
412
  0.160.0), ensure `codex` is on the same machine's `PATH`, and sign in with a ChatGPT
393
- account. Navigator starts `codex app-server --stdio` lazily; it does not start a
394
- Codex subprocess for unsupported providers or before an explicit account link.
395
-
396
- OpenCode does not expose which Codex CLI account its selected model uses. Select
397
- **Link Codex CLI account** in Limits and confirm the reported account ID only if
398
- you know it matches this OpenCode provider. The binding is private, user-wide,
399
- and specific to the provider/model. **Unlink Codex account** removes it;
400
- **Relink Codex account** is available when the CLI account has changed.
401
-
402
- For a linked model, Limits shows only buckets with a provider-reported model
413
+ account. Navigator starts `codex app-server --stdio` lazily after the account is
414
+ associated with the selected ChatGPT connection.
415
+
416
+ OpenCode 2's built-in ChatGPT OAuth integration reports an account ID. Navigator
417
+ automatically associates that identity and verifies it against Codex's reported
418
+ account. API-key OpenAI connections use API measurements instead of a ChatGPT
419
+ subscription.
420
+
421
+ When the host does not provide a verifiable identity, select **Link Codex CLI
422
+ account** and confirm the reported account ID if it matches this host connection.
423
+ The private, user-wide binding is saved **once per connection**, or once per
424
+ provider on hosts without a connection API, and reused across models, projects,
425
+ and sessions. **Unlink Codex account** removes the manual association; **Relink
426
+ Codex account** is available after an account change. Compatible older model
427
+ bindings are reused; conflicting bindings remain isolated until a deliberate relink.
428
+
429
+ For an associated model, Limits shows only buckets with a provider-reported model
403
430
  association, their native usage units and window durations, reset times, and
404
431
  the last successful read time. It refreshes quietly every five seconds, even
405
432
  when hidden. **Refresh** requests a read immediately; a failed read preserves
@@ -720,11 +747,12 @@ session or workspace dismisses the entire search dialog chain.
720
747
  Development requires Bun 1.4.2 and Node.js 24.16 or newer. Install dependencies with
721
748
  `bun install --frozen-lockfile`.
722
749
 
723
- ESLint uses the Solid preset from
724
- [`@st1ggy/linter-config`](https://github.com/St1ggy/linter-config); Prettier uses its
725
- common preset. `eslint.config.js` documents project-specific adaptations for
726
- OpenTUI callbacks, SDK compatibility, and test fixtures. Type-aware linting covers
727
- application code, tests, build scripts, and JavaScript configuration files.
750
+ Oxlint uses the `solid-ox` preset from
751
+ [`@st1ggy/linter-config`](https://github.com/St1ggy/linter-config); Oxfmt uses its
752
+ `oxfmt-common` preset. `oxlint.config.ts` documents project-specific adaptations for
753
+ OpenTUI callbacks, SDK compatibility, and test fixtures. Type-aware analysis uses
754
+ `oxlint-tsgolint`; `tsconfig.lint.json` covers application code, tests, build scripts,
755
+ and configuration files. Formatter exclusions are maintained in `oxfmt.config.ts`.
728
756
 
729
757
  ```sh
730
758
  bun run test
@@ -742,7 +770,7 @@ bun run screenshots:verify
742
770
  bun run check
743
771
  ```
744
772
 
745
- `bun run check` runs the tests, TypeScript, ESLint, bundle-size guard, and formatting
773
+ `bun run check` runs the tests, TypeScript, Oxlint, bundle-size guard, and Oxfmt
746
774
  check. The unminified TUI bundle is limited to 360,000 bytes.
747
775
  Font generation is a separate development task: `bun run font:build` and
748
776
  `bun run font:check` use `uv` and the pinned FontTools dependency. Users install
@@ -753,7 +781,7 @@ CI checks that the bundled font matches its generator.
753
781
  through Ghostty on Xvfb. The image includes the bundled corner font and a pinned
754
782
  JetBrainsMono Nerd Font; every displayed task, session, workspace, path, skill,
755
783
  server, error, and preset is synthetic. `bun run screenshots:verify` renders the
756
- same 37 scenes to a temporary directory and fails if any PNG differs. Three scenes
784
+ same scenes to a temporary directory and fails if any PNG differs. Additional scenes
757
785
  keep the pinned Nerd Font but remove the Navigator corner font so the uninstalled-font
758
786
  experience remains reproducible beside the required-font captures. The harness
759
787
  requires Docker with Linux ARM64 support. These commands are available for harness