@heyanon-arp/cli 0.0.29 → 0.0.30
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/cli.js +34 -3
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -337,6 +337,11 @@ var init_api = __esm({
|
|
|
337
337
|
if (query?.accountId !== void 0) params.set("accountId", query.accountId);
|
|
338
338
|
if (query?.accepts !== void 0) params.set("accepts", query.accepts);
|
|
339
339
|
if (query?.online) params.set("online", "true");
|
|
340
|
+
if (query?.trustedOnly) params.set("trustedOnly", "true");
|
|
341
|
+
if (query?.includeUnproven === false) params.set("includeUnproven", "false");
|
|
342
|
+
if (query?.minOnchainCycles !== void 0) params.set("minOnchainCycles", String(query.minOnchainCycles));
|
|
343
|
+
if (query?.minCompletedAsPayee !== void 0) params.set("minCompletedAsPayee", String(query.minCompletedAsPayee));
|
|
344
|
+
if (query?.minDistinctCounterparts !== void 0) params.set("minDistinctCounterparts", String(query.minDistinctCounterparts));
|
|
340
345
|
if (query?.sort !== void 0) params.set("sort", query.sort);
|
|
341
346
|
if (query?.page !== void 0) params.set("page", String(query.page));
|
|
342
347
|
if (query?.after !== void 0) params.set("after", query.after);
|
|
@@ -736,7 +741,7 @@ var import_commander = require("commander");
|
|
|
736
741
|
// package.json
|
|
737
742
|
var package_default = {
|
|
738
743
|
name: "@heyanon-arp/cli",
|
|
739
|
-
version: "0.0.
|
|
744
|
+
version: "0.0.30",
|
|
740
745
|
description: "Command-line client for the Agent Relationship Protocol \u2014 register agents, sign envelopes, run escrowed work cycles on Solana.",
|
|
741
746
|
license: "MIT",
|
|
742
747
|
keywords: ["arp", "agent-relationship-protocol", "did", "solana", "escrow", "ed25519", "agents", "a2a", "cli"],
|
|
@@ -1309,7 +1314,7 @@ ${verb}.`));
|
|
|
1309
1314
|
function registerAgentsCommand(root) {
|
|
1310
1315
|
const agents = root.command("agents").description(
|
|
1311
1316
|
"Search published agents (reputation-ranked) \u2014 ONLINE-only by default (seen within the liveness window); --all includes offline. Filter by tag / text / creator account / accepted asset."
|
|
1312
|
-
).option("--server <url>", "Override ARP server base URL").option("--tag <s>", "Filter by capability tag \u2014 repeatable; AND-semantics across tags", accumulate2, []).option("--query <s>", "Full-text search over name + description").option("--account-id <wallet>", "Filter to a creator account (owner wallet, base58)").option("--accepts <asset>", "Filter to agents that accept this asset \u2014 shorthand (SOL:solana-devnet) or CAIP-19. Matches accept-anything agents too.").option("--all", "Include offline agents too \u2014 by default only agents seen within the ~5-min liveness window are listed", false).option("--sort <mode>", "reputation (default) | recent | created", "reputation").option("--page <n>", "Zero-based page index (reputation/recent sorts)", "0").option("--after <id>", "Cursor for --sort created: the previous page's last `id`").option("--limit <n>", "Max rows to return (1..100)", "20").option(
|
|
1317
|
+
).option("--server <url>", "Override ARP server base URL").option("--tag <s>", "Filter by capability tag \u2014 repeatable; AND-semantics across tags", accumulate2, []).option("--query <s>", "Full-text search over name + description").option("--account-id <wallet>", "Filter to a creator account (owner wallet, base58)").option("--accepts <asset>", "Filter to agents that accept this asset \u2014 shorthand (SOL:solana-devnet) or CAIP-19. Matches accept-anything agents too.").option("--all", "Include offline agents too \u2014 by default only agents seen within the ~5-min liveness window are listed", false).option("--trusted-only", "Return only platform-trusted agents (the manual allow-list flag \u2014 NOT earned reputation)", false).option("--proven", "Only agents with real settled on-chain history \u2014 hard-excludes cold-start (unproven) agents", false).option("--min-cycles <n>", "Hard filter: minimum settled on-chain cycles").option("--min-completed <n>", "Hard filter: minimum completed delegations AS THE PAYEE (paid work delivered)").option("--min-counterparts <n>", "Hard filter: minimum distinct (owner-resolved) counterparts \u2014 anti-wash").option("--sort <mode>", "reputation (default) | recent | created", "reputation").option("--page <n>", "Zero-based page index (reputation/recent sorts)", "0").option("--after <id>", "Cursor for --sort created: the previous page's last `id`").option("--limit <n>", "Max rows to return (1..100)", "20").option(
|
|
1313
1318
|
"--verbose",
|
|
1314
1319
|
'After the one-line summaries, print a framed "Full agent payloads (N rows)" block containing the JSON array of all rows (with owner-string sanitisation for terminal safety)',
|
|
1315
1320
|
false
|
|
@@ -1347,6 +1352,11 @@ async function runAgents(opts) {
|
|
|
1347
1352
|
if (opts.accountId) query.accountId = opts.accountId;
|
|
1348
1353
|
if (opts.accepts) query.accepts = resolveAcceptsAsset(opts.accepts);
|
|
1349
1354
|
if (!opts.all) query.online = true;
|
|
1355
|
+
if (opts.trustedOnly) query.trustedOnly = true;
|
|
1356
|
+
if (opts.proven) query.includeUnproven = false;
|
|
1357
|
+
if (opts.minCycles !== void 0) query.minOnchainCycles = parseNonNegInt(opts.minCycles, "--min-cycles");
|
|
1358
|
+
if (opts.minCompleted !== void 0) query.minCompletedAsPayee = parseNonNegInt(opts.minCompleted, "--min-completed");
|
|
1359
|
+
if (opts.minCounterparts !== void 0) query.minDistinctCounterparts = parseNonNegInt(opts.minCounterparts, "--min-counterparts");
|
|
1350
1360
|
if (sort === import_sdk3.DiscoverySorts.CREATED) {
|
|
1351
1361
|
if (opts.after) query.after = opts.after;
|
|
1352
1362
|
} else {
|
|
@@ -1402,7 +1412,21 @@ function formatAgentLine(a, opts = {}) {
|
|
|
1402
1412
|
const description = a.description ? `\u2014 ${import_chalk3.default.dim(truncate(sanitizeForTerminal(a.description), 60))}` : "";
|
|
1403
1413
|
const rep = `${import_chalk3.default.cyan(`rep${a.reputation.composite.toFixed(0)}`)}${a.reputation.computed ? "" : import_chalk3.default.dim("*")}`;
|
|
1404
1414
|
const live = a.liveness.online ? import_chalk3.default.green("\u25CF") : import_chalk3.default.dim("\u25CB");
|
|
1405
|
-
|
|
1415
|
+
const badge = formatBadge(a.badge);
|
|
1416
|
+
const trust = a.trusted ? ` ${import_chalk3.default.blue("\u2713trusted")}` : "";
|
|
1417
|
+
return `${import_chalk3.default.dim(idDisplay)} ${import_chalk3.default.cyan(a.did)} ${rep} ${badge} ${live} ${import_chalk3.default.magenta(tags)} ${name}${trust} ${description}`.trim();
|
|
1418
|
+
}
|
|
1419
|
+
function formatBadge(badge) {
|
|
1420
|
+
switch (badge) {
|
|
1421
|
+
case "proven":
|
|
1422
|
+
return import_chalk3.default.green("proven");
|
|
1423
|
+
case "limited":
|
|
1424
|
+
return import_chalk3.default.yellow("limited");
|
|
1425
|
+
case "flagged":
|
|
1426
|
+
return import_chalk3.default.red("flagged");
|
|
1427
|
+
default:
|
|
1428
|
+
return import_chalk3.default.dim("new");
|
|
1429
|
+
}
|
|
1406
1430
|
}
|
|
1407
1431
|
function truncate(s, max) {
|
|
1408
1432
|
if (s.length <= max) return s;
|
|
@@ -1427,6 +1451,13 @@ function parsePage(raw) {
|
|
|
1427
1451
|
}
|
|
1428
1452
|
return n;
|
|
1429
1453
|
}
|
|
1454
|
+
function parseNonNegInt(raw, flag) {
|
|
1455
|
+
const n = Number(raw);
|
|
1456
|
+
if (!Number.isFinite(n) || !Number.isInteger(n) || n < 0) {
|
|
1457
|
+
throw new Error(`agents: ${flag} must be a non-negative integer (got '${raw}')`);
|
|
1458
|
+
}
|
|
1459
|
+
return n;
|
|
1460
|
+
}
|
|
1430
1461
|
function resolveAcceptsAsset(input) {
|
|
1431
1462
|
const resolved = (0, import_sdk3.resolveAsset)(input);
|
|
1432
1463
|
if (!resolved) {
|