@agentrouter/agentrouter 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/dist/core.d.ts.map +1 -1
- package/dist/core.js +7 -5
- package/package.json +1 -1
package/dist/core.d.ts.map
CHANGED
|
@@ -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,
|
|
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"}
|
package/dist/core.js
CHANGED
|
@@ -28,7 +28,7 @@ class CliError extends Error {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
const API_KEY_FORMAT = /^ar_live_[0-9a-f]{16}_[A-Za-z0-9_-]{32,64}$/;
|
|
31
|
-
const BOOLEAN_FLAGS = new Set(["json", "wait", "help", "no-browser", "no-color", "open", "version"]);
|
|
31
|
+
const BOOLEAN_FLAGS = new Set(["json", "wait", "help", "no-browser", "no-color", "open", "version", "include-unavailable"]);
|
|
32
32
|
const REPEATABLE = new Set(["run", "scope"]);
|
|
33
33
|
function parseArgs(argv) {
|
|
34
34
|
const positional = [];
|
|
@@ -67,7 +67,7 @@ Sign in
|
|
|
67
67
|
agentrouter keys list | add <name> [--scope s]... | remove <key_id> | activate <key> | set | clear
|
|
68
68
|
|
|
69
69
|
Use tools
|
|
70
|
-
agentrouter find "<task>" [--limit n] [--provider id] [--category id,id] [--group id,id]
|
|
70
|
+
agentrouter find "<task>" [--limit n] [--provider id] [--category id,id] [--group id,id] [--include-unavailable]
|
|
71
71
|
agentrouter describe <tool_id>
|
|
72
72
|
agentrouter invoke <tool_id> --input <json|@file> [--max-cost-usd 0.05] [--session id]
|
|
73
73
|
[--idempotency-key k] [--wait] [--timeout-ms n] [--output file]
|
|
@@ -378,12 +378,13 @@ export async function runCli(argv, io = {}) {
|
|
|
378
378
|
const query = [sub, ...rest].filter(Boolean).join(" ");
|
|
379
379
|
if (!query)
|
|
380
380
|
throw new CliError('usage: agentrouter find "<task>"', EXIT.usage);
|
|
381
|
-
const result = await http("POST", "/v1/find", { query, limit: flags.limit ? Number(flags.limit) : undefined, provider: flags.provider, category_ids: typeof flags.category === "string" ? flags.category.split(",").map((id) => id.trim()) : undefined, group_ids: typeof flags.group === "string" ? flags.group.split(",").map((id) => id.trim()) : undefined }, {}, true);
|
|
381
|
+
const result = await http("POST", "/v1/find", { query, ...(flags["include-unavailable"] && { include_unavailable: true }), limit: flags.limit ? Number(flags.limit) : undefined, provider: flags.provider, category_ids: typeof flags.category === "string" ? flags.category.split(",").map((id) => id.trim()) : undefined, group_ids: typeof flags.group === "string" ? flags.group.split(",").map((id) => id.trim()) : undefined }, {}, true);
|
|
382
382
|
if (result.status !== 200)
|
|
383
383
|
fail(result);
|
|
384
384
|
const found = result.json;
|
|
385
|
-
const lines = found.tools.map((tool) => `${tool.tool_id.padEnd(34)} ${tool.fit.padEnd(7)} ${tool.price.summary} [
|
|
386
|
-
|
|
385
|
+
const lines = found.tools.map((tool) => `${tool.tool_id.padEnd(34)} ${tool.fit.padEnd(7)} ${tool.price.summary} [${tool.availability?.status === "temporarily_unavailable" ? "temporarily unavailable" : "health " + tool.health.status}]\n ${tool.summary}`);
|
|
386
|
+
const unavailable = found.hints?.find((hint) => hint.code === "TEMPORARILY_UNAVAILABLE");
|
|
387
|
+
print(found, unavailable ? unavailable.message : found.match === "none" ? "No matching tool. Request it: agentrouter tools request --capability \"…\" --note \"…\"" : `match: ${found.match}\n${lines.join("\n")}`);
|
|
387
388
|
return EXIT.ok;
|
|
388
389
|
}
|
|
389
390
|
case "describe": {
|
|
@@ -398,6 +399,7 @@ export async function runCli(argv, io = {}) {
|
|
|
398
399
|
print(tool, [
|
|
399
400
|
`${tool.tool_id} (${tool.tool_version}) — ${tool.title}`,
|
|
400
401
|
` ${tool.description}`,
|
|
402
|
+
...(tool.availability?.status === "temporarily_unavailable" ? [" Temporarily unavailable. Choose another tool or check back later."] : []),
|
|
401
403
|
` required input: ${required}`,
|
|
402
404
|
` price: ${tool.pricing.summary} [${tool.pricing.multiplier_label}] pricing_version ${tool.pricing.pricing_version}`,
|
|
403
405
|
` provider errors: ${tool.pricing.rules.provider_error}; empty results: ${tool.pricing.rules.empty_result}`,
|