bitspark-agw 0.7.0 → 0.8.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.
Files changed (3) hide show
  1. package/README.md +38 -38
  2. package/dist/main.js +10 -66
  3. package/package.json +33 -33
package/README.md CHANGED
@@ -1,38 +1,38 @@
1
- # `bitspark-agw` — Agent Gateway CLI
2
-
3
- `agw` sets up and manages your project's connection to a Claude Gateway: wire a project through the
4
- gateway, manage your projects and credentials, and read your usage — from one small binary.
5
-
6
- ## Install
7
-
8
- ```bash
9
- npm i -g bitspark-agw
10
- agw --version
11
- ```
12
-
13
- Requires **Node 24+**.
14
-
15
- ## Quick start
16
-
17
- ```bash
18
- # Point at your gateway (adminUrl = management API, compatUrl = the Anthropic-compatible proxy)
19
- agw target add local --admin-url http://127.0.0.1:3301 --compat-url http://127.0.0.1:3300
20
- agw target use local
21
-
22
- agw init # mint a project credential → write .claude/settings.local.json
23
- agw status # this project's wiring + today's spend
24
- agw runs # run history agw tail # live run events
25
- agw usage # today's spend + budget
26
-
27
- agw --help # full command list agw completion bash # shell completion (also zsh|fish|pwsh)
28
- ```
29
-
30
- For agents/CI, `agw init` wires a credential into `.claude/settings.local.json` — no login needed.
31
- Logging in with an account (`agw login`) resolves your role and adjusts the available surface
32
- automatically; the gateway server is always the enforcement boundary.
33
-
34
- ## Configuration
35
-
36
- `agw` stores named environments and your session under `~/.agw/`. Endpoint resolution precedence:
37
- `--base-url`/`--target` flags ▸ a per-project `.agw.json` ▸ `~/.agw/config.json` ▸ `AGW_*` env vars.
38
- Run `agw target show` to see what resolves for the current directory.
1
+ # `bitspark-agw` — Agent Gateway CLI
2
+
3
+ `agw` sets up and manages your project's connection to a Claude Gateway: wire a project through the
4
+ gateway, manage your projects and credentials, and read your usage — from one small binary.
5
+
6
+ ## Install
7
+
8
+ ```bash
9
+ npm i -g bitspark-agw
10
+ agw --version
11
+ ```
12
+
13
+ Requires **Node 24+**.
14
+
15
+ ## Quick start
16
+
17
+ ```bash
18
+ # Point at your gateway (adminUrl = management API, compatUrl = the Anthropic-compatible proxy)
19
+ agw target add local --admin-url http://127.0.0.1:3301 --compat-url http://127.0.0.1:3300
20
+ agw target use local
21
+
22
+ agw init # mint a project credential → write .claude/settings.local.json
23
+ agw status # this project's wiring + today's spend
24
+ agw runs # run history agw tail # live run events
25
+ agw usage # today's spend + budget
26
+
27
+ agw --help # full command list agw completion bash # shell completion (also zsh|fish|pwsh)
28
+ ```
29
+
30
+ For agents/CI, `agw init` wires a credential into `.claude/settings.local.json` — no login needed.
31
+ Logging in with an account (`agw login`) resolves your role and adjusts the available surface
32
+ automatically; the gateway server is always the enforcement boundary.
33
+
34
+ ## Configuration
35
+
36
+ `agw` stores named environments and your session under `~/.agw/`. Endpoint resolution precedence:
37
+ `--base-url`/`--target` flags ▸ a per-project `.agw.json` ▸ `~/.agw/config.json` ▸ `AGW_*` env vars.
38
+ Run `agw target show` to see what resolves for the current directory.
package/dist/main.js CHANGED
@@ -18981,7 +18981,13 @@ var init_api_contracts = __esm({
18981
18981
  run: RunSchema
18982
18982
  });
18983
18983
  DecisionsListResponseSchema = WithEventSeqSchema.extend({
18984
- decisions: external_exports.array(RoutingDecisionSchema)
18984
+ decisions: external_exports.array(RoutingDecisionSchema),
18985
+ /**
18986
+ * Decision trace artifacts keyed by decisionId (parsed RouteDecisionTrace
18987
+ * JSON). Present only when the request asked for ?includeArtifacts=true;
18988
+ * decisions whose artifact row is missing are omitted from the map.
18989
+ */
18990
+ artifacts: external_exports.record(external_exports.string(), external_exports.record(external_exports.string(), external_exports.any())).optional()
18985
18991
  });
18986
18992
  SessionsListResponseSchema = WithEventSeqSchema.extend({
18987
18993
  sessions: external_exports.array(ConversationBindingSchema),
@@ -20712,8 +20718,7 @@ var init_projects = __esm({
20712
20718
  // src/commands/runs.ts
20713
20719
  var runs_exports = {};
20714
20720
  __export(runs_exports, {
20715
- run: () => run8,
20716
- runDecisions: () => runDecisions
20721
+ run: () => run8
20717
20722
  });
20718
20723
  function isOperator(client) {
20719
20724
  const caps = readCachedCaps(client.baseUrl, client.token, null);
@@ -20802,55 +20807,7 @@ async function developerList(client, ctx, args) {
20802
20807
  }
20803
20808
  printList(ctx, data.runs, DEVELOPER_RUN_COLUMNS);
20804
20809
  }
20805
- async function runDecisions(client, ctx, args) {
20806
- const action = args.action || "list";
20807
- switch (action) {
20808
- case "list": {
20809
- const query = {};
20810
- const limit = getFlag(args, "limit");
20811
- if (limit) query.limit = limit;
20812
- const data = await client.get("/api/decisions", query);
20813
- if (ctx.json) {
20814
- printResult(ctx, data.decisions);
20815
- return;
20816
- }
20817
- printList(ctx, data.decisions, DECISIONS_COLUMNS);
20818
- return;
20819
- }
20820
- case "get": {
20821
- const id = requirePositional(args, 0, "id");
20822
- const data = await client.get(`/api/decisions/${encodeURIComponent(id)}`);
20823
- if (ctx.json) {
20824
- printResult(ctx, data);
20825
- return;
20826
- }
20827
- const d = data.decision;
20828
- printRecord(ctx, {
20829
- decisionId: d.decisionId,
20830
- runId: d.runId ?? "-",
20831
- selectedProfile: d.selectedProfile ?? "-",
20832
- routeReason: d.routeReason ?? "-",
20833
- modelFamily: d.modelFamily ?? "-",
20834
- serviceClass: d.serviceClass ?? "-",
20835
- winnerScore: d.winnerScore !== null ? d.winnerScore.toFixed(3) : "-",
20836
- runnerUpScore: d.runnerUpScore !== null ? d.runnerUpScore.toFixed(3) : "-",
20837
- winnerMarginAbs: d.winnerMarginAbs !== null ? d.winnerMarginAbs.toFixed(3) : "-",
20838
- createdAt: formatTimestamp(d.createdAtMs)
20839
- });
20840
- if (data.candidates && data.candidates.length > 0) {
20841
- console.log();
20842
- console.log("Candidates:");
20843
- printList(ctx, data.candidates, CANDIDATES_COLUMNS);
20844
- }
20845
- return;
20846
- }
20847
- default:
20848
- throw new Error(`Unknown decisions action: ${action}
20849
-
20850
- Usage: agw decisions [list|get] [args]`);
20851
- }
20852
- }
20853
- var OPERATOR_RUN_COLUMNS, DEVELOPER_RUN_COLUMNS, DECISIONS_COLUMNS, CANDIDATES_COLUMNS;
20810
+ var OPERATOR_RUN_COLUMNS, DEVELOPER_RUN_COLUMNS;
20854
20811
  var init_runs = __esm({
20855
20812
  "src/commands/runs.ts"() {
20856
20813
  "use strict";
@@ -20878,19 +20835,6 @@ var init_runs = __esm({
20878
20835
  { key: "totalMs", label: "DURATION", align: "right", format: (v) => formatDuration(v) },
20879
20836
  { key: "actualCostMicrousd", label: "COST", align: "right", format: (v) => typeof v === "number" ? formatMicrousd(v) : "-" }
20880
20837
  ];
20881
- DECISIONS_COLUMNS = [
20882
- { key: "decisionId", label: "DECISION_ID", width: 8, format: (v) => typeof v === "string" ? v.slice(0, 8) : "-" },
20883
- { key: "selectedProfile", label: "PROFILE" },
20884
- { key: "routeReason", label: "REASON" },
20885
- { key: "modelFamily", label: "MODEL" },
20886
- { key: "winnerMarginAbs", label: "MARGIN", align: "right", format: (v) => typeof v === "number" ? v.toFixed(3) : "-" },
20887
- { key: "createdAtMs", label: "CREATED", format: (v) => formatTimestamp(v) }
20888
- ];
20889
- CANDIDATES_COLUMNS = [
20890
- { key: "rank", label: "RANK", align: "right" },
20891
- { key: "profile", label: "PROFILE" },
20892
- { key: "score", label: "SCORE", align: "right", format: (v) => typeof v === "number" ? v.toFixed(3) : "-" }
20893
- ];
20894
20838
  }
20895
20839
  });
20896
20840
 
@@ -25355,7 +25299,7 @@ function printUnknownCommand(resource) {
25355
25299
  // src/main.ts
25356
25300
  init_capabilities();
25357
25301
  init_registry();
25358
- var VERSION = true ? "0.7.0" : (() => {
25302
+ var VERSION = true ? "0.8.1" : (() => {
25359
25303
  try {
25360
25304
  const here = dirname(fileURLToPath(import.meta.url));
25361
25305
  return JSON.parse(readFileSync(join(here, "..", "package.json"), "utf-8")).version ?? "0.0.0";
package/package.json CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "name": "bitspark-agw",
3
- "version": "0.7.0",
4
- "description": "Agent Gateway CLI — set up and manage your project's connection to the Claude Gateway.",
5
- "type": "module",
6
- "bin": {
7
- "agw": "dist/main.js"
8
- },
9
- "files": [
10
- "dist/main.js"
11
- ],
12
- "engines": {
13
- "node": ">=24"
14
- },
15
- "repository": {
16
- "type": "git",
17
- "url": "git+https://github.com/Bitspark/claude-gateway.git",
18
- "directory": "packages/agw"
19
- },
20
- "publishConfig": {
21
- "registry": "https://registry.npmjs.org",
22
- "access": "public"
23
- },
24
- "scripts": {
25
- "prebuild": "node scripts/embed-ops-ui.mjs",
26
- "build": "node scripts/build.mjs",
27
- "build:public": "node scripts/build.mjs --public",
28
- "audit:bundle": "node scripts/audit-bundle.mjs",
29
- "typecheck": "tsc --noEmit",
30
- "dev": "tsx src/main.ts",
31
- "test": "node --import tsx --test \"test/**/*.test.ts\""
32
- }
33
- }
1
+ {
2
+ "name": "bitspark-agw",
3
+ "version": "0.8.1",
4
+ "description": "Agent Gateway CLI — set up and manage your project's connection to the Claude Gateway.",
5
+ "type": "module",
6
+ "bin": {
7
+ "agw": "dist/main.js"
8
+ },
9
+ "files": [
10
+ "dist/main.js"
11
+ ],
12
+ "engines": {
13
+ "node": ">=24"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/Bitspark/claude-gateway.git",
18
+ "directory": "packages/agw"
19
+ },
20
+ "publishConfig": {
21
+ "registry": "https://registry.npmjs.org",
22
+ "access": "public"
23
+ },
24
+ "scripts": {
25
+ "prebuild": "node scripts/embed-ops-ui.mjs",
26
+ "build": "node scripts/build.mjs",
27
+ "build:public": "node scripts/build.mjs --public",
28
+ "audit:bundle": "node scripts/audit-bundle.mjs",
29
+ "typecheck": "tsc --noEmit",
30
+ "dev": "tsx src/main.ts",
31
+ "test": "node --import tsx --test \"test/**/*.test.ts\""
32
+ }
33
+ }