@agentrouter/agentrouter 0.2.1 → 0.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAYX,KAAK,GAAG,EAET,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,oFAAoF;AACpF,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,4EAA4E;AAC5E,eAAO,MAAM,IAAI;;;;;;;;;;;CAWP,CAAC;AAEX,MAAM,WAAW,KAAK;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAyFD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,KAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAyc5E"}
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,WAAW,EAYX,KAAK,GAAG,EAET,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,oFAAoF;AACpF,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,4EAA4E;AAC5E,eAAO,MAAM,IAAI;;;;;;;;;;;CAWP,CAAC;AAEX,MAAM,WAAW,KAAK;IACpB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAyFD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,KAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CA4c5E"}
package/dist/core.js CHANGED
@@ -220,10 +220,14 @@ export async function runCli(argv, io = {}) {
220
220
  }
221
221
  }
222
222
  function describeRun(run) {
223
+ const maxCost = run.billing.max_cost_usd;
224
+ const ceiling = maxCost == null ? "no per-call limit" : `max $${maxCost}`;
223
225
  const lines = [
224
226
  `${run.run_id} ${run.status} ${run.tool_id}`,
225
- ` charge $${run.billing.customer_charge_usd} (${run.billing.reason ?? "pending"}), multiplier ${run.billing.price_multiplier}, max $${run.billing.max_cost_usd}`
227
+ ` charge $${run.billing.customer_charge_usd} (${run.billing.reason ?? "pending"}), multiplier ${run.billing.price_multiplier}, ${ceiling}`
226
228
  ];
229
+ if (run.queue)
230
+ lines.push(` queued: ${run.queue.reason}, waited ${Math.floor(run.queue.waited_ms / 1000)}s, reserved $${run.billing.reserved_usd}`);
227
231
  if (run.error)
228
232
  lines.push(` error ${run.error.code}: ${run.error.message}`);
229
233
  if (run.provider_response?.request_id)
@@ -458,7 +462,7 @@ export async function runCli(argv, io = {}) {
458
462
  fail(result);
459
463
  }
460
464
  let final = result;
461
- if (result.json?.run_id && ["RUNNING", "READY"].includes(result.json.status) && flags.wait) {
465
+ if (result.json?.run_id && ["READY", "RUNNING", "STOPPING"].includes(result.json.status) && flags.wait) {
462
466
  final = await waitForRun(result.json.run_id, Number(flags["timeout-ms"]) || 10 * 60000);
463
467
  }
464
468
  const run = final.json?.run_id ? final.json : final.json?.run;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentrouter/agentrouter",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "AgentRouter CLI: find, describe and invoke provider tools with one wallet.",
5
5
  "type": "module",
6
6
  "bin": {