@atmorouter/helper 0.2.0 → 0.2.1
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 +10 -10
- package/lib/helper.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,14 +5,14 @@ Configure coding agents for AtmoRouter, get IDE setup instructions, discover mod
|
|
|
5
5
|
Requires Node.js 22 or newer. The public npm package uses the `yaml` runtime dependency to safely parse and preserve YAML configuration. No npm account or repository access is required.
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npx @atmorouter/helper@0.2.
|
|
9
|
-
npx @atmorouter/helper@0.2.
|
|
10
|
-
npx @atmorouter/helper@0.2.
|
|
11
|
-
npx @atmorouter/helper@0.2.
|
|
12
|
-
npx @atmorouter/helper@0.2.
|
|
8
|
+
npx @atmorouter/helper@0.2.1 --help
|
|
9
|
+
npx @atmorouter/helper@0.2.1 targets
|
|
10
|
+
npx @atmorouter/helper@0.2.1 models --search claude
|
|
11
|
+
npx @atmorouter/helper@0.2.1 configure --target opencode --model YOUR_MODEL_ID
|
|
12
|
+
npx @atmorouter/helper@0.2.1 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.
|
|
15
|
+
The same version is available as `https://atmorouter.dev/downloads/atmorouter-helper-0.2.1.tgz`, with a `.sha256` checksum alongside it. Run it with `npx https://atmorouter.dev/downloads/atmorouter-helper-0.2.1.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
|
|
|
@@ -42,7 +42,7 @@ The helper never saves or prints your API key. Set `ATMOROUTER_API_KEY` privatel
|
|
|
42
42
|
|
|
43
43
|
```sh
|
|
44
44
|
export ANTHROPIC_AUTH_TOKEN="$ATMOROUTER_API_KEY"
|
|
45
|
-
npx @atmorouter/helper@0.2.
|
|
45
|
+
npx @atmorouter/helper@0.2.1 check-key
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
`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. Requests have a 15-second timeout and refuse redirects. No custom upstream origin can receive your key.
|
|
@@ -53,13 +53,13 @@ The public gateway implements Chat Completions and Anthropic Messages, not `/v1/
|
|
|
53
53
|
|
|
54
54
|
```sh
|
|
55
55
|
# Prints instructions only; does not start a server or write Codex settings.
|
|
56
|
-
npx @atmorouter/helper@0.2.
|
|
56
|
+
npx @atmorouter/helper@0.2.1 configure --target codex --model YOUR_MODEL_ID
|
|
57
57
|
|
|
58
58
|
# Starts a temporary local bridge and launches your installed Codex CLI.
|
|
59
|
-
npx @atmorouter/helper@0.2.
|
|
59
|
+
npx @atmorouter/helper@0.2.1 codex --model YOUR_MODEL_ID
|
|
60
60
|
|
|
61
61
|
# Or run the bridge separately and follow its printed client instructions.
|
|
62
|
-
npx @atmorouter/helper@0.2.
|
|
62
|
+
npx @atmorouter/helper@0.2.1 bridge --port 43187
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
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.
|
package/lib/helper.mjs
CHANGED
|
@@ -16,7 +16,7 @@ export async function models(fetcher = fetch) {
|
|
|
16
16
|
if (!response.ok) throw Error('Catalog request failed: HTTP '+response.status);
|
|
17
17
|
const body = await response.json();
|
|
18
18
|
if (!Array.isArray(body.data)) throw Error('Unexpected catalog response.');
|
|
19
|
-
return body.data.filter(m => typeof m.id === 'string' && (!m.modality || ['text','chat','multimodal'].includes(
|
|
19
|
+
return body.data.filter(m => typeof m.id === 'string' && (!m.modality || (typeof m.modality==='string' && m.modality.toLowerCase().split(/[,\s+/]+/).some(part=>['text','chat','multimodal'].includes(part))))).map(m => ({...m,id:modelId(m.id)}));
|
|
20
20
|
}
|
|
21
21
|
export async function checkKey(key, fetcher = fetch) {
|
|
22
22
|
if (typeof key!=='string' || key.length!==51 || !/^ar-[a-f0-9]{48}$/.test(key)) throw Error('Set ATMOROUTER_API_KEY to your full ar- key. Do not pass secrets as command arguments.');
|
package/package.json
CHANGED