@atmorouter/helper 0.2.3 → 0.2.4

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/README.md CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  Configure coding agents for AtmoRouter, get IDE setup instructions, discover model IDs, and check a key without running inference. Changes are previewed first; automatic configuration merges existing settings and creates backups.
4
4
 
5
- Requires Node.js 22 or newer. The package uses the `yaml` runtime dependency to safely parse and preserve YAML configuration. No repository access is required. Version 0.2.3 adds post-setup budget, routing-wait, and retry guidance while keeping generated configuration and shell output clean. The commands below pin that version; the versioned website archive is an alternative installation channel.
5
+ Requires Node.js 22 or newer. The package uses the `yaml` runtime dependency to safely parse and preserve YAML configuration. No repository access is required. Version 0.2.4 adds capacity cooldown and bounded retry guidance. The commands below use the versioned website archive.
6
6
 
7
7
  ```sh
8
- npx @atmorouter/helper@0.2.3 --help
9
- npx @atmorouter/helper@0.2.3 targets
10
- npx @atmorouter/helper@0.2.3 models --search claude
11
- npx @atmorouter/helper@0.2.3 configure --target opencode --model YOUR_MODEL_ID
12
- npx @atmorouter/helper@0.2.3 configure --target claude --model YOUR_MODEL_ID --write
8
+ npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz --help
9
+ npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz targets
10
+ npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz models --search claude
11
+ npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz configure --target opencode --model YOUR_MODEL_ID
12
+ npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz configure --target claude --model YOUR_MODEL_ID --write
13
13
  ```
14
14
 
15
- The same version is available as `https://atmorouter.dev/downloads/atmorouter-helper-0.2.3.tgz`, with a `.sha256` checksum alongside it. Run it with `npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.3.tgz --help`.
15
+ The same version is available as `https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz`, with a `.sha256` checksum alongside it. Run it with `npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz --help`.
16
16
 
17
17
  With no command, the interactive wizard searches live text models and previews the selected setup. `configure` is preview-only unless `--write` is supplied. Non-interactive file writes additionally require `--yes`. Tests use temporary `--config-dir` folders, never real agent settings.
18
18
 
@@ -56,7 +56,7 @@ The helper never saves or prints your API key. Set `ATMOROUTER_API_KEY` privatel
56
56
 
57
57
  ```sh
58
58
  export ANTHROPIC_AUTH_TOKEN="$ATMOROUTER_API_KEY"
59
- npx @atmorouter/helper@0.2.3 check-key
59
+ npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz check-key
60
60
  ```
61
61
 
62
62
  `GET /v1/models` is public and **cannot validate a key**. The optional explicit key check sends an empty JSON body to `/v1/chat/completions`. Only HTTP 400 with `model is required` proves the gateway accepted the credential before rejecting the body. No model is selected, no inference is forwarded, and nothing is billed. The check consumes a rate-limit slot. HTTP 401 rejects the key; 429 and all other responses are inconclusive. The key-check request has a 15-second timeout and refuse redirects. Catalog discovery has a 30-second timeout. No custom upstream origin can receive your key.
@@ -67,13 +67,13 @@ The public gateway implements Chat Completions and Anthropic Messages, not `/v1/
67
67
 
68
68
  ```sh
69
69
  # Prints instructions only; does not start a server or write Codex settings.
70
- npx @atmorouter/helper@0.2.3 configure --target codex --model YOUR_MODEL_ID
70
+ npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz configure --target codex --model YOUR_MODEL_ID
71
71
 
72
72
  # Starts a temporary local bridge and launches your installed Codex CLI.
73
- npx @atmorouter/helper@0.2.3 codex --model YOUR_MODEL_ID
73
+ npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz codex --model YOUR_MODEL_ID
74
74
 
75
75
  # Or run the bridge separately and follow its printed client instructions.
76
- npx @atmorouter/helper@0.2.3 bridge --port 43187
76
+ npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.4.tgz bridge --port 43187
77
77
  ```
78
78
 
79
79
  Set `ATMOROUTER_API_KEY` in the process environment before starting the bridge. It listens on loopback only, authenticates local requests, and forwards inference to the official AtmoRouter endpoint. The launcher preserves Codex's permission defaults. It does not weaken approvals or sandbox settings.
@@ -101,3 +101,8 @@ npm run test:package
101
101
  The packed-install check uses an isolated npm cache and the public registry, without requiring account credentials. The archive contains only the package manifest, README, CLI, and three library modules; tests, scripts, local settings, and keys are excluded.
102
102
 
103
103
  Client references: [Claude Code](https://code.claude.com/docs/en/llm-gateway), [OpenCode](https://opencode.ai/docs/providers/), [Oh My Pi](https://github.com/can1357/oh-my-pi), [Continue secrets](https://docs.continue.dev/customize/deep-dives/secrets), [Cursor keys](https://cursor.com/help/models-and-usage/api-keys), [VS Code language models](https://code.visualstudio.com/docs/agent-customization/language-models), [Cline](https://docs.cline.bot/provider-config/openai-compatible), [Roo Code](https://docs.roocode.com/providers/openai-compatible), and [Codex custom providers](https://developers.openai.com/codex/config-reference/).
104
+
105
+
106
+ For explicit capacity refusals before any output, use `Retry-After` or `error.retry_after_seconds`, including errors carried inside HTTP 200 SSE streams. Wait at least that delay plus a small random jitter, with at most three automatic retries. Without a delay hint, wait 2, 4, then 8 seconds plus jitter. Review Usage and tool outcomes before resending a request that produced output or has an uncertain outcome.
107
+
108
+ Capacity pauses use the model, API protocol and effective input/output price ceilings. Customer-specific ceilings are isolated by account. Three capacity refusals within one minute start a 15-second pause. One request probes recovery, with pauses increasing to 30 and then 60 seconds if capacity remains unavailable. The helper prints this guidance during setup. Retry behavior is controlled by the harness.
package/lib/helper.mjs CHANGED
@@ -11,6 +11,7 @@ Market prices and tiers vary. A "From" price is a snapshot of the cheapest adver
11
11
  Select the actual API key used by this client and an all-model percentage rule for broad coverage. Illustrative examples only: 20% below official rates, or 50% below official rates; choose your own limit after reviewing the rates. Account and key rules both apply; the strictest input and output limits win. A rule for one model does not cover other models. The helper never saves or raises budget rules automatically.
12
12
  Routing can wait up to 30 seconds for capacity within your caps. This wait is fixed; generation time is additional. Allow both in your client timeout. The local bridge has a 120-second total timeout by default.
13
13
  For 429 or temporary availability failures, honor Retry-After when present; otherwise use bounded exponential backoff with jitter. Do not retry blindly or duplicate an in-flight request. After a timeout or interrupted stream, review the client outcome and usage before deciding to resend. Never raise price caps automatically.
14
+ Capacity refusals can pause the affected model, protocol and effective price ceilings for 15, 30, then up to 60 seconds. Customer-specific limits are isolated by account. One eligible request tests recovery. For an explicit capacity rejection before output, honor Retry-After or error.retry_after_seconds, including errors inside HTTP 200 SSE streams. Wait at least that delay plus a small random jitter; allow at most three automatic retries. Without a delay hint, wait 2, 4, then 8 seconds plus jitter. If output arrived, tools ran, or the outcome is uncertain, review Usage and the client outcome before resending.
14
15
  For invalid requests, correct the request; for authentication errors, check the key and account eligibility; for insufficient balance, review Billing. A price_limit_unavailable refusal needs capacity within your caps or a deliberate budget review; adding funds does not fix pricing availability. Client setup and key checks do not prove current availability within your limits.`;
15
16
  const isRecord = value => value !== null && typeof value === 'object' && !Array.isArray(value);
16
17
  export function modelId(value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atmorouter/helper",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Configure AtmoRouter coding agents, guide IDE setup, and run a local Codex bridge",
5
5
  "homepage": "https://atmorouter.dev/docs/helper",
6
6
  "keywords": [