@acnlabs/acn-cli 0.8.0 → 0.10.0
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/index.js +79 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -427,7 +427,7 @@ ${formatTask(t)}`).join("\n\n")
|
|
|
427
427
|
handleError(err);
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
|
-
cmd.command("create").description("Create a new task (as agent)").requiredOption("-t, --title <title>", "Task title (min 3 chars)").requiredOption("-d, --description <text>", "Task description (min 10 chars)").requiredOption("--tags <tags>", "Required skill tags, comma-separated (e.g. coding,review)").option("--deadline <hours>", "Deadline in hours (default: 48)", "48").option("--reward <amount>", "Reward amount (default: 0)", "0").option("--currency <currency>", "Reward currency (e.g. USD, USDC, ap_points)", "ap_points").option("--type <type>", "Task type (e.g. coding, general)", "general").option("--max-participants <n>", "Max participants (default: 1)", "1").action(
|
|
430
|
+
cmd.command("create").description("Create a new task (as agent)").requiredOption("-t, --title <title>", "Task title (min 3 chars)").requiredOption("-d, --description <text>", "Task description (min 10 chars)").requiredOption("--tags <tags>", "Required skill tags, comma-separated (e.g. coding,review)").option("--deadline <hours>", "Deadline in hours (default: 48)", "48").option("--reward <amount>", "Reward amount (default: 0)", "0").option("--currency <currency>", "Reward currency (e.g. USD, USDC, ap_points)", "ap_points").option("--type <type>", "Task type (e.g. coding, general)", "general").option("--max-participants <n>", "Max participants (default: 1)", "1").option("--max-resubmit <n>", "Max resubmit attempts per participant (default: unlimited)").action(
|
|
431
431
|
async (opts) => {
|
|
432
432
|
const config = loadConfig();
|
|
433
433
|
if (!config.api_key) {
|
|
@@ -446,6 +446,9 @@ ${formatTask(t)}`).join("\n\n")
|
|
|
446
446
|
task_type: opts.type ?? "general",
|
|
447
447
|
max_participants: parseInt(opts.maxParticipants ?? "1", 10)
|
|
448
448
|
};
|
|
449
|
+
if (opts.maxResubmit !== void 0) {
|
|
450
|
+
body.max_resubmit_attempts = parseInt(opts.maxResubmit, 10);
|
|
451
|
+
}
|
|
449
452
|
try {
|
|
450
453
|
const task = await acnPost("/tasks/agent/create", body);
|
|
451
454
|
output(task, [`Task created!
|
|
@@ -455,6 +458,37 @@ ${formatTask(t)}`).join("\n\n")
|
|
|
455
458
|
}
|
|
456
459
|
}
|
|
457
460
|
);
|
|
461
|
+
cmd.command("history <agent_id>").description("View an agent's task history (submissions, feedback, outcomes)").option("--limit <n>", "Max entries to return (default: 50)", "50").action(async (agentId, opts) => {
|
|
462
|
+
const config = loadConfig();
|
|
463
|
+
if (!config.api_key) {
|
|
464
|
+
console.error("No API key found. Run `acn join` first.");
|
|
465
|
+
process.exit(1);
|
|
466
|
+
}
|
|
467
|
+
try {
|
|
468
|
+
const res = await acnGet(
|
|
469
|
+
`/tasks/agent/${agentId}/history`,
|
|
470
|
+
{ limit: opts.limit ?? "50" }
|
|
471
|
+
);
|
|
472
|
+
const lines = res.items.map((item, i) => {
|
|
473
|
+
const parts = [
|
|
474
|
+
`
|
|
475
|
+
[${i + 1}] ${item.task_title} (${item.task_type}) \u2014 ${item.status}`,
|
|
476
|
+
` Role : ${item.role}`,
|
|
477
|
+
` Reward : ${item.reward} ${item.reward_currency}`
|
|
478
|
+
];
|
|
479
|
+
if (item.submitted_at) parts.push(` Submitted : ${item.submitted_at}`);
|
|
480
|
+
if (item.resubmit_count) parts.push(` Resubmits : ${item.resubmit_count}`);
|
|
481
|
+
if (item.review_notes) parts.push(` Feedback : ${item.review_notes}`);
|
|
482
|
+
if (item.rejection_reason) parts.push(` Rejected : ${item.rejection_reason}`);
|
|
483
|
+
if (item.submission) parts.push(` Submission : ${item.submission.slice(0, 80)}...`);
|
|
484
|
+
return parts.join("\n");
|
|
485
|
+
});
|
|
486
|
+
const summary = `Agent history for ${agentId} (${res.total} entries):`;
|
|
487
|
+
output(res, [summary, ...lines].join("\n"));
|
|
488
|
+
} catch (err) {
|
|
489
|
+
handleError(err);
|
|
490
|
+
}
|
|
491
|
+
});
|
|
458
492
|
cmd.command("cancel <task_id>").description("Cancel a task you created").action(async (taskId) => {
|
|
459
493
|
const config = loadConfig();
|
|
460
494
|
if (!config.api_key) {
|
|
@@ -1210,6 +1244,11 @@ function formatSubnet(s, index) {
|
|
|
1210
1244
|
if (s.owner) lines.push(` Owner : ${s.owner}`);
|
|
1211
1245
|
if (s.description) lines.push(` Desc : ${s.description}`);
|
|
1212
1246
|
if (s.created_at) lines.push(` Since : ${s.created_at}`);
|
|
1247
|
+
if (s.harness_registered) {
|
|
1248
|
+
lines.push(` Harness: ${s.harness_url ?? "(registered)"}`);
|
|
1249
|
+
} else {
|
|
1250
|
+
lines.push(` Harness: none`);
|
|
1251
|
+
}
|
|
1213
1252
|
return lines.join("\n");
|
|
1214
1253
|
}
|
|
1215
1254
|
function subnetCommand() {
|
|
@@ -1330,6 +1369,45 @@ ${JSON.stringify(res.agents, null, 2)}`);
|
|
|
1330
1369
|
handleError(err);
|
|
1331
1370
|
}
|
|
1332
1371
|
});
|
|
1372
|
+
const harness = new import_commander10.Command("harness").description("Manage Org Harness webhook for a subnet");
|
|
1373
|
+
harness.command("set <subnet_id>").description("Register an Org Harness webhook on a subnet you own").requiredOption("--url <url>", "Harness webhook URL (HTTPS)").option("--secret <secret>", "HMAC-SHA256 signing secret (recommended)").action(async (subnetId, opts) => {
|
|
1374
|
+
const config = loadConfig();
|
|
1375
|
+
if (!config.api_key) {
|
|
1376
|
+
console.error("No API key found. Run `acn join` first.");
|
|
1377
|
+
process.exit(1);
|
|
1378
|
+
}
|
|
1379
|
+
try {
|
|
1380
|
+
const res = await acnPatch(`/subnets/${subnetId}/harness`, {
|
|
1381
|
+
harness_url: opts.url,
|
|
1382
|
+
harness_secret: opts.secret ?? null
|
|
1383
|
+
});
|
|
1384
|
+
const lines = [
|
|
1385
|
+
`Harness registered on subnet ${res.subnet_id}`,
|
|
1386
|
+
` URL : ${res.harness_url}`,
|
|
1387
|
+
` Signed : ${opts.secret ? "yes (HMAC-SHA256)" : "no (unsigned)"}`
|
|
1388
|
+
];
|
|
1389
|
+
output(res, lines.join("\n"));
|
|
1390
|
+
} catch (err) {
|
|
1391
|
+
handleError(err);
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
harness.command("clear <subnet_id>").description("Unregister the Org Harness from a subnet you own").action(async (subnetId) => {
|
|
1395
|
+
const config = loadConfig();
|
|
1396
|
+
if (!config.api_key) {
|
|
1397
|
+
console.error("No API key found. Run `acn join` first.");
|
|
1398
|
+
process.exit(1);
|
|
1399
|
+
}
|
|
1400
|
+
try {
|
|
1401
|
+
const res = await acnPatch(`/subnets/${subnetId}/harness`, {
|
|
1402
|
+
harness_url: null,
|
|
1403
|
+
harness_secret: null
|
|
1404
|
+
});
|
|
1405
|
+
output(res, `Harness unregistered from subnet ${res.subnet_id}`);
|
|
1406
|
+
} catch (err) {
|
|
1407
|
+
handleError(err);
|
|
1408
|
+
}
|
|
1409
|
+
});
|
|
1410
|
+
cmd.addCommand(harness);
|
|
1333
1411
|
return cmd;
|
|
1334
1412
|
}
|
|
1335
1413
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acnlabs/acn-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Official CLI for ACN (Agent Collaboration Network) — zero-integration agent access",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"a2a"
|
|
26
26
|
],
|
|
27
27
|
"author": "acnlabs",
|
|
28
|
-
"license": "
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "https://github.com/acnlabs/ACN.git",
|