@ast-ai-model-router/cli 2.0.1 → 2.0.3
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 +2 -1
- package/bin/ast-ai-model-router.js +11 -0
- package/lib/config.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ Run without installing:
|
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
31
|
npx --yes --package @ast-ai-model-router/cli ast-ai-model-router --help
|
|
32
|
+
npx --yes @ast-ai-model-router/cli --version
|
|
32
33
|
```
|
|
33
34
|
|
|
34
35
|
## Quick Start
|
|
@@ -159,7 +160,7 @@ Examples:
|
|
|
159
160
|
|
|
160
161
|
- Claude alias `haiku` maps to `claude-haiku-4-5`.
|
|
161
162
|
- Claude alias `sonnet` maps to `claude-sonnet-4-6`.
|
|
162
|
-
- Codex `gpt-5.4-mini`
|
|
163
|
+
- Codex `gpt-5.4-mini`, `gpt-5.4`, and `gpt-5.5` map to the matching Tokenometer model IDs.
|
|
163
164
|
|
|
164
165
|
If a model cannot be mapped, routing still works and the decision includes a warning:
|
|
165
166
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
3
|
import { access, writeFile } from "node:fs/promises";
|
|
4
|
+
import { readFileSync } from "node:fs";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import { parseArgs } from "node:util";
|
|
6
7
|
import { CONFIG_TEMPLATE, loadConfig, validateTier } from "../lib/config.js";
|
|
@@ -35,12 +36,22 @@ Options:
|
|
|
35
36
|
const EXIT_INVALID = 2;
|
|
36
37
|
const EXIT_POLICY = 3;
|
|
37
38
|
|
|
39
|
+
function readPackageVersion() {
|
|
40
|
+
const packageJsonUrl = new URL("../package.json", import.meta.url);
|
|
41
|
+
const packageJson = JSON.parse(readFileSync(packageJsonUrl, "utf8"));
|
|
42
|
+
return packageJson.version ?? "0.0.0";
|
|
43
|
+
}
|
|
44
|
+
|
|
38
45
|
async function main() {
|
|
39
46
|
const [command, maybeAgent, ...rest] = process.argv.slice(2);
|
|
40
47
|
if (!command || command === "--help" || command === "-h") {
|
|
41
48
|
process.stdout.write(HELP);
|
|
42
49
|
return;
|
|
43
50
|
}
|
|
51
|
+
if (command === "version" || command === "--version" || command === "-v") {
|
|
52
|
+
process.stdout.write(`${readPackageVersion()}\n`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
44
55
|
|
|
45
56
|
if (command === "init") {
|
|
46
57
|
const { values } = parseArgs({
|
package/lib/config.js
CHANGED
|
@@ -31,9 +31,9 @@ export const DEFAULT_CONFIG = {
|
|
|
31
31
|
opusplan: "claude-opus-4-7"
|
|
32
32
|
},
|
|
33
33
|
codex: {
|
|
34
|
-
"gpt-5.4-mini": "gpt-5-mini",
|
|
35
|
-
"gpt-5.4": "gpt-5",
|
|
36
|
-
"gpt-5.5": "gpt-5",
|
|
34
|
+
"gpt-5.4-mini": "gpt-5.4-mini",
|
|
35
|
+
"gpt-5.4": "gpt-5.4",
|
|
36
|
+
"gpt-5.5": "gpt-5.5",
|
|
37
37
|
"codex-mini-latest": "codex-mini-latest"
|
|
38
38
|
}
|
|
39
39
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ast-ai-model-router/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "AST-based Claude Code and Codex model router with token-cost estimates, CI policy checks, and explainable AI coding-agent model selection.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@babel/parser": "^7.28.5",
|
|
63
|
-
"@tokenometer/core": "^
|
|
63
|
+
"@tokenometer/core": "^2.1.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@changesets/cli": "^2.31.0"
|