@acnlabs/acn-cli 0.9.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 +35 -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) {
|
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",
|