@hasna/todos 0.9.73 → 0.9.74
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/index.js +176 -17
- package/dist/db/database.d.ts.map +1 -1
- package/dist/db/tasks.d.ts +9 -0
- package/dist/db/tasks.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -9
- package/dist/mcp/index.js +79 -13
- package/dist/server/index.js +46 -9
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2260,6 +2260,9 @@ function ensureSchema(db) {
|
|
|
2260
2260
|
ensureColumn("tasks", "approved_at", "TEXT");
|
|
2261
2261
|
ensureColumn("tasks", "recurrence_rule", "TEXT");
|
|
2262
2262
|
ensureColumn("tasks", "recurrence_parent_id", "TEXT REFERENCES tasks(id) ON DELETE SET NULL");
|
|
2263
|
+
ensureColumn("tasks", "confidence", "REAL");
|
|
2264
|
+
ensureColumn("tasks", "reason", "TEXT");
|
|
2265
|
+
ensureColumn("tasks", "spawned_from_session", "TEXT");
|
|
2263
2266
|
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
2264
2267
|
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
2265
2268
|
ensureColumn("agents", "reports_to", "TEXT");
|
|
@@ -2656,6 +2659,15 @@ var init_database = __esm(() => {
|
|
|
2656
2659
|
ALTER TABLE agents ADD COLUMN session_id TEXT;
|
|
2657
2660
|
ALTER TABLE agents ADD COLUMN working_dir TEXT;
|
|
2658
2661
|
INSERT OR IGNORE INTO _migrations (id) VALUES (17);
|
|
2662
|
+
`,
|
|
2663
|
+
`
|
|
2664
|
+
ALTER TABLE tasks ADD COLUMN confidence REAL;
|
|
2665
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (18);
|
|
2666
|
+
`,
|
|
2667
|
+
`
|
|
2668
|
+
ALTER TABLE tasks ADD COLUMN reason TEXT;
|
|
2669
|
+
ALTER TABLE tasks ADD COLUMN spawned_from_session TEXT;
|
|
2670
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (19);
|
|
2659
2671
|
`
|
|
2660
2672
|
];
|
|
2661
2673
|
});
|
|
@@ -3317,6 +3329,7 @@ __export(exports_tasks, {
|
|
|
3317
3329
|
setTaskStatus: () => setTaskStatus,
|
|
3318
3330
|
setTaskPriority: () => setTaskPriority,
|
|
3319
3331
|
removeDependency: () => removeDependency,
|
|
3332
|
+
redistributeStaleTasks: () => redistributeStaleTasks,
|
|
3320
3333
|
moveTask: () => moveTask,
|
|
3321
3334
|
lockTask: () => lockTask,
|
|
3322
3335
|
listTasks: () => listTasks,
|
|
@@ -3374,8 +3387,8 @@ function createTask(input, db) {
|
|
|
3374
3387
|
const tags = input.tags || [];
|
|
3375
3388
|
const shortId = input.project_id ? nextTaskShortId(input.project_id, d) : null;
|
|
3376
3389
|
const title = shortId ? `${shortId}: ${input.title}` : input.title;
|
|
3377
|
-
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id, spawns_template_id)
|
|
3378
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
3390
|
+
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id, spawns_template_id, reason, spawned_from_session)
|
|
3391
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
3379
3392
|
id,
|
|
3380
3393
|
shortId,
|
|
3381
3394
|
input.project_id || null,
|
|
@@ -3401,7 +3414,9 @@ function createTask(input, db) {
|
|
|
3401
3414
|
null,
|
|
3402
3415
|
input.recurrence_rule || null,
|
|
3403
3416
|
input.recurrence_parent_id || null,
|
|
3404
|
-
input.spawns_template_id || null
|
|
3417
|
+
input.spawns_template_id || null,
|
|
3418
|
+
input.reason || null,
|
|
3419
|
+
input.spawned_from_session || null
|
|
3405
3420
|
]);
|
|
3406
3421
|
if (tags.length > 0) {
|
|
3407
3422
|
insertTaskTags(id, tags, d);
|
|
@@ -3758,13 +3773,21 @@ function completeTask(id, agentId, db, options) {
|
|
|
3758
3773
|
checkCompletionGuard(task, agentId || null, d);
|
|
3759
3774
|
const evidence = options ? { files_changed: options.files_changed, test_results: options.test_results, commit_hash: options.commit_hash, notes: options.notes, attachment_ids: options.attachment_ids } : undefined;
|
|
3760
3775
|
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes || evidence.attachment_ids);
|
|
3761
|
-
|
|
3762
|
-
|
|
3776
|
+
const completionMeta = {};
|
|
3777
|
+
if (hasEvidence)
|
|
3778
|
+
completionMeta._evidence = evidence;
|
|
3779
|
+
if (options?.confidence !== undefined) {
|
|
3780
|
+
completionMeta._completion = { confidence: options.confidence };
|
|
3781
|
+
}
|
|
3782
|
+
const hasMeta = Object.keys(completionMeta).length > 0;
|
|
3783
|
+
if (hasMeta) {
|
|
3784
|
+
const meta2 = { ...task.metadata, ...completionMeta };
|
|
3763
3785
|
d.run("UPDATE tasks SET metadata = ? WHERE id = ?", [JSON.stringify(meta2), id]);
|
|
3764
3786
|
}
|
|
3765
3787
|
const timestamp = now();
|
|
3766
|
-
|
|
3767
|
-
|
|
3788
|
+
const confidence = options?.confidence !== undefined ? options.confidence : null;
|
|
3789
|
+
d.run(`UPDATE tasks SET status = 'completed', locked_by = NULL, locked_at = NULL, completed_at = ?, confidence = ?, version = version + 1, updated_at = ?
|
|
3790
|
+
WHERE id = ?`, [timestamp, confidence, timestamp, id]);
|
|
3768
3791
|
logTaskChange(id, "complete", "status", task.status, "completed", agentId || null, d);
|
|
3769
3792
|
dispatchWebhook("task.completed", { id, agent_id: agentId, title: task.title, completed_at: timestamp }, d).catch(() => {});
|
|
3770
3793
|
let spawnedTask = null;
|
|
@@ -3783,14 +3806,14 @@ function completeTask(id, agentId, db, options) {
|
|
|
3783
3806
|
spawnedFromTemplate = createTask(input, d);
|
|
3784
3807
|
} catch {}
|
|
3785
3808
|
}
|
|
3786
|
-
const meta =
|
|
3809
|
+
const meta = hasMeta ? { ...task.metadata, ...completionMeta } : task.metadata;
|
|
3787
3810
|
if (spawnedTask) {
|
|
3788
3811
|
meta._next_recurrence = { id: spawnedTask.id, short_id: spawnedTask.short_id, due_at: spawnedTask.due_at };
|
|
3789
3812
|
}
|
|
3790
3813
|
if (spawnedFromTemplate) {
|
|
3791
3814
|
meta._spawned_task = { id: spawnedFromTemplate.id, short_id: spawnedFromTemplate.short_id, title: spawnedFromTemplate.title };
|
|
3792
3815
|
}
|
|
3793
|
-
return { ...task, status: "completed", locked_by: null, locked_at: null, completed_at: timestamp, version: task.version + 1, updated_at: timestamp, metadata: meta };
|
|
3816
|
+
return { ...task, status: "completed", locked_by: null, locked_at: null, completed_at: timestamp, confidence, version: task.version + 1, updated_at: timestamp, metadata: meta };
|
|
3794
3817
|
}
|
|
3795
3818
|
function lockTask(id, agentId, db) {
|
|
3796
3819
|
const d = db || getDatabase();
|
|
@@ -4241,6 +4264,20 @@ function setTaskPriority(id, priority, _agentId, db) {
|
|
|
4241
4264
|
}
|
|
4242
4265
|
throw new Error(`Failed to set priority after 3 attempts`);
|
|
4243
4266
|
}
|
|
4267
|
+
function redistributeStaleTasks(agentId, options, db) {
|
|
4268
|
+
const d = db || getDatabase();
|
|
4269
|
+
const maxAge = options?.max_age_minutes ?? 60;
|
|
4270
|
+
const stale = getStaleTasks(maxAge, options?.project_id ? { project_id: options.project_id } : undefined, d);
|
|
4271
|
+
const limited = options?.limit ? stale.slice(0, options.limit) : stale;
|
|
4272
|
+
const timestamp = now();
|
|
4273
|
+
const released = [];
|
|
4274
|
+
for (const t of limited) {
|
|
4275
|
+
d.run(`UPDATE tasks SET locked_by = NULL, locked_at = NULL, status = 'pending', version = version + 1, updated_at = ? WHERE id = ?`, [timestamp, t.id]);
|
|
4276
|
+
released.push({ ...t, locked_by: null, locked_at: null, status: "pending" });
|
|
4277
|
+
}
|
|
4278
|
+
const claimed = released.length > 0 ? claimNextTask(agentId, options?.project_id ? { project_id: options.project_id } : undefined, d) : null;
|
|
4279
|
+
return { released, claimed };
|
|
4280
|
+
}
|
|
4244
4281
|
function wouldCreateCycle(taskId, dependsOn, db) {
|
|
4245
4282
|
const visited = new Set;
|
|
4246
4283
|
const queue = [dependsOn];
|
|
@@ -9517,7 +9554,9 @@ var init_mcp = __esm(() => {
|
|
|
9517
9554
|
estimated_minutes: exports_external.number().optional(),
|
|
9518
9555
|
requires_approval: exports_external.boolean().optional(),
|
|
9519
9556
|
recurrence_rule: exports_external.string().optional(),
|
|
9520
|
-
spawns_template_id: exports_external.string().optional().describe("Template ID to auto-create as next task when this task is completed (pipeline/handoff chains)")
|
|
9557
|
+
spawns_template_id: exports_external.string().optional().describe("Template ID to auto-create as next task when this task is completed (pipeline/handoff chains)"),
|
|
9558
|
+
reason: exports_external.string().optional().describe("Why this task exists \u2014 context for agents picking it up"),
|
|
9559
|
+
spawned_from_session: exports_external.string().optional().describe("Session ID that created this task (for tracing task lineage)")
|
|
9521
9560
|
}, async (params) => {
|
|
9522
9561
|
try {
|
|
9523
9562
|
const resolved = { ...params };
|
|
@@ -9732,12 +9771,13 @@ Parent: ${task.parent.id.slice(0, 8)} | ${task.parent.title}`);
|
|
|
9732
9771
|
test_results: exports_external.string().optional().describe("Summary of test results"),
|
|
9733
9772
|
commit_hash: exports_external.string().optional().describe("Git commit hash associated with this completion"),
|
|
9734
9773
|
notes: exports_external.string().optional().describe("Notes about the completion"),
|
|
9735
|
-
attachment_ids: exports_external.array(exports_external.string()).optional().describe("IDs of attachments uploaded via @hasna/attachments to link as evidence")
|
|
9736
|
-
|
|
9774
|
+
attachment_ids: exports_external.array(exports_external.string()).optional().describe("IDs of attachments uploaded via @hasna/attachments to link as evidence"),
|
|
9775
|
+
confidence: exports_external.number().min(0).max(1).optional().describe("Agent's confidence 0.0-1.0 that the task is fully complete. Default: 1.0. Low confidence (<0.7) is flagged as a signal for review.")
|
|
9776
|
+
}, async ({ id, agent_id, skip_recurrence, files_changed, test_results, commit_hash, notes, attachment_ids, confidence }) => {
|
|
9737
9777
|
try {
|
|
9738
9778
|
const resolvedId = resolveId(id);
|
|
9739
9779
|
const evidence = files_changed || test_results || commit_hash || notes || attachment_ids ? { files_changed, test_results, commit_hash, notes, attachment_ids } : undefined;
|
|
9740
|
-
const task = completeTask(resolvedId, agent_id, undefined, { skip_recurrence, ...evidence });
|
|
9780
|
+
const task = completeTask(resolvedId, agent_id, undefined, { skip_recurrence, confidence, ...evidence });
|
|
9741
9781
|
let text = `completed: ${formatTask(task)}`;
|
|
9742
9782
|
if (task.metadata._next_recurrence) {
|
|
9743
9783
|
const next = task.metadata._next_recurrence;
|
|
@@ -11206,6 +11246,29 @@ ${checks.map((c) => ` ${c.status === "ok" ? "\u2713" : "\u26A0"} ${c.name}: ${c
|
|
|
11206
11246
|
}
|
|
11207
11247
|
}
|
|
11208
11248
|
return { content: [{ type: "text", text: lines.join(`
|
|
11249
|
+
`) }] };
|
|
11250
|
+
} catch (e) {
|
|
11251
|
+
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
11252
|
+
}
|
|
11253
|
+
});
|
|
11254
|
+
}
|
|
11255
|
+
if (shouldRegisterTool("redistribute_stale_tasks")) {
|
|
11256
|
+
server.tool("redistribute_stale_tasks", "Release stale in-progress tasks and optionally claim the best one. Work-stealing for multi-agent.", {
|
|
11257
|
+
agent_id: exports_external.string().describe("Agent ID claiming the next task after releasing stale ones"),
|
|
11258
|
+
max_age_minutes: exports_external.number().optional().describe("Tasks idle longer than this (default: 60) are released"),
|
|
11259
|
+
project_id: exports_external.string().optional().describe("Limit to a specific project"),
|
|
11260
|
+
limit: exports_external.number().optional().describe("Max number of stale tasks to release")
|
|
11261
|
+
}, async ({ agent_id, max_age_minutes, project_id, limit }) => {
|
|
11262
|
+
try {
|
|
11263
|
+
const resolvedProjectId = project_id ? resolveId(project_id, "projects") : undefined;
|
|
11264
|
+
const result = redistributeStaleTasks(agent_id, { max_age_minutes, project_id: resolvedProjectId, limit });
|
|
11265
|
+
const lines = [`Released ${result.released.length} stale task(s).`];
|
|
11266
|
+
for (const t of result.released)
|
|
11267
|
+
lines.push(` ${formatTask(t)}`);
|
|
11268
|
+
if (result.claimed)
|
|
11269
|
+
lines.push(`
|
|
11270
|
+
Claimed: ${formatTask(result.claimed)}`);
|
|
11271
|
+
return { content: [{ type: "text", text: lines.join(`
|
|
11209
11272
|
`) }] };
|
|
11210
11273
|
} catch (e) {
|
|
11211
11274
|
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
@@ -11279,6 +11342,7 @@ ${checks.map((c) => ` ${c.status === "ok" ? "\u2713" : "\u26A0"} ${c.name}: ${c
|
|
|
11279
11342
|
"decompose_task",
|
|
11280
11343
|
"set_task_status",
|
|
11281
11344
|
"set_task_priority",
|
|
11345
|
+
"redistribute_stale_tasks",
|
|
11282
11346
|
"search_tools",
|
|
11283
11347
|
"describe_tools"
|
|
11284
11348
|
].filter((name) => shouldRegisterTool(name));
|
|
@@ -11466,6 +11530,9 @@ ${checks.map((c) => ` ${c.status === "ok" ? "\u2713" : "\u26A0"} ${c.name}: ${c
|
|
|
11466
11530
|
set_task_priority: `Set task priority without needing version. Auto-retries on conflict (up to 3 attempts). Use instead of update_task when you only need to change priority.
|
|
11467
11531
|
Params: id(string, req), priority(low|medium|high|critical, req)
|
|
11468
11532
|
Example: {id: 'a1b2c3d4', priority: 'high'}`,
|
|
11533
|
+
redistribute_stale_tasks: `Release stale in-progress tasks and optionally claim the best one. Multi-agent work-stealing.
|
|
11534
|
+
Params: agent_id(string, req), max_age_minutes(number, default:60), project_id(string, optional), limit(number, optional)
|
|
11535
|
+
Example: {agent_id: 'a1b2c3d4', max_age_minutes: 30}`,
|
|
11469
11536
|
search_tools: `List all tool names or filter by substring.
|
|
11470
11537
|
Params: query(string, optional)
|
|
11471
11538
|
Example: {query: 'task'}`,
|
|
@@ -13631,7 +13698,7 @@ function formatTaskLine(t) {
|
|
|
13631
13698
|
return `${chalk.dim(t.id.slice(0, 8))} ${statusFn(t.status.padEnd(11))} ${priorityFn(t.priority.padEnd(8))} ${t.title}${assigned}${lock}${tags}${plan}`;
|
|
13632
13699
|
}
|
|
13633
13700
|
program2.name("todos").description("Universal task management for AI coding agents").version(getPackageVersion()).option("--project <path>", "Project path").option("--json", "Output as JSON").option("--agent <name>", "Agent name").option("--session <id>", "Session ID");
|
|
13634
|
-
program2.command("add <title>").description("Create a new task").option("-d, --description <text>", "Task description").option("-p, --priority <level>", "Priority: low, medium, high, critical").option("--parent <id>", "Parent task ID").option("-t, --tags <tags>", "Comma-separated tags").option("--tag <tags>", "Comma-separated tags (alias for --tags)").option("--plan <id>", "Assign to a plan").option("--assign <agent>", "Assign to agent").option("--status <status>", "Initial status").option("--list <id>", "Task list ID").option("--task-list <id>", "Task list ID (alias for --list)").option("--estimated <minutes>", "Estimated time in minutes").option("--approval", "Require approval before completion").option("--recurrence <rule>", "Recurrence rule, e.g. 'every day', 'every weekday', 'every 2 weeks'").option("--due <date>", "Due date (ISO string or YYYY-MM-DD)").action((title, opts) => {
|
|
13701
|
+
program2.command("add <title>").description("Create a new task").option("-d, --description <text>", "Task description").option("-p, --priority <level>", "Priority: low, medium, high, critical").option("--parent <id>", "Parent task ID").option("-t, --tags <tags>", "Comma-separated tags").option("--tag <tags>", "Comma-separated tags (alias for --tags)").option("--plan <id>", "Assign to a plan").option("--assign <agent>", "Assign to agent").option("--status <status>", "Initial status").option("--list <id>", "Task list ID").option("--task-list <id>", "Task list ID (alias for --list)").option("--estimated <minutes>", "Estimated time in minutes").option("--approval", "Require approval before completion").option("--recurrence <rule>", "Recurrence rule, e.g. 'every day', 'every weekday', 'every 2 weeks'").option("--due <date>", "Due date (ISO string or YYYY-MM-DD)").option("--reason <text>", "Why this task exists").action((title, opts) => {
|
|
13635
13702
|
const globalOpts = program2.opts();
|
|
13636
13703
|
const projectId = autoProject(globalOpts);
|
|
13637
13704
|
opts.tags = opts.tags || opts.tag;
|
|
@@ -13670,7 +13737,8 @@ program2.command("add <title>").description("Create a new task").option("-d, --d
|
|
|
13670
13737
|
estimated_minutes: opts.estimated ? parseInt(opts.estimated, 10) : undefined,
|
|
13671
13738
|
requires_approval: opts.approval || false,
|
|
13672
13739
|
recurrence_rule: opts.recurrence,
|
|
13673
|
-
due_at: opts.due ? opts.due.length === 10 ? opts.due + "T00:00:00.000Z" : opts.due : undefined
|
|
13740
|
+
due_at: opts.due ? opts.due.length === 10 ? opts.due + "T00:00:00.000Z" : opts.due : undefined,
|
|
13741
|
+
reason: opts.reason
|
|
13674
13742
|
});
|
|
13675
13743
|
if (globalOpts.json) {
|
|
13676
13744
|
output(task, true);
|
|
@@ -13954,15 +14022,16 @@ program2.command("update <id>").description("Update a task").option("--title <te
|
|
|
13954
14022
|
console.log(formatTaskLine(task));
|
|
13955
14023
|
}
|
|
13956
14024
|
});
|
|
13957
|
-
program2.command("done <id>").description("Mark a task as completed").option("--attach-ids <ids>", "Comma-separated @hasna/attachments IDs to link as evidence").option("--files-changed <files>", "Comma-separated list of files changed").option("--test-results <results>", "Test results summary").option("--commit-hash <hash>", "Git commit hash").option("--notes <notes>", "Completion notes").action((id, opts) => {
|
|
14025
|
+
program2.command("done <id>").description("Mark a task as completed").option("--attach-ids <ids>", "Comma-separated @hasna/attachments IDs to link as evidence").option("--files-changed <files>", "Comma-separated list of files changed").option("--test-results <results>", "Test results summary").option("--commit-hash <hash>", "Git commit hash").option("--notes <notes>", "Completion notes").option("--confidence <0-1>", "Agent's confidence 0.0-1.0 that the task is fully complete (default: 1.0, <0.7 flagged for review)").action((id, opts) => {
|
|
13958
14026
|
const globalOpts = program2.opts();
|
|
13959
14027
|
const resolvedId = resolveTaskId(id);
|
|
13960
14028
|
const attachmentIds = opts.attachIds ? opts.attachIds.split(",").map((s) => s.trim()) : undefined;
|
|
13961
14029
|
const filesChanged = opts.filesChanged ? opts.filesChanged.split(",").map((s) => s.trim()) : undefined;
|
|
14030
|
+
const confidence = opts.confidence !== undefined ? parseFloat(opts.confidence) : undefined;
|
|
13962
14031
|
const evidence = attachmentIds || filesChanged || opts.testResults || opts.commitHash || opts.notes ? { attachment_ids: attachmentIds, files_changed: filesChanged, test_results: opts.testResults, commit_hash: opts.commitHash, notes: opts.notes } : undefined;
|
|
13963
14032
|
let task;
|
|
13964
14033
|
try {
|
|
13965
|
-
task = completeTask(resolvedId, globalOpts.agent, undefined, evidence);
|
|
14034
|
+
task = completeTask(resolvedId, globalOpts.agent, undefined, { ...evidence, confidence });
|
|
13966
14035
|
} catch (e) {
|
|
13967
14036
|
handleError(e);
|
|
13968
14037
|
}
|
|
@@ -15275,6 +15344,33 @@ program2.command("stale").description("Find tasks stuck in_progress with no rece
|
|
|
15275
15344
|
console.log(` ${chalk.cyan(id)} | ${t.locked_by || t.assigned_to || "?"} | ${t.title} ${chalk.dim(`(${staleMin}min stale)`)}`);
|
|
15276
15345
|
}
|
|
15277
15346
|
});
|
|
15347
|
+
program2.command("redistribute <agent>").description("Release stale in-progress tasks and claim the best one (work-stealing)").option("--max-age <minutes>", "Stale threshold in minutes", "60").option("--project <id>", "Limit to a specific project").option("--limit <n>", "Max stale tasks to release").option("--json", "Output as JSON").action(async (agent, opts) => {
|
|
15348
|
+
const globalOpts = program2.opts();
|
|
15349
|
+
const db = getDatabase();
|
|
15350
|
+
const projectId = opts.project ? resolveTaskId(opts.project) : autoProject(globalOpts) ?? undefined;
|
|
15351
|
+
const result = redistributeStaleTasks(agent, {
|
|
15352
|
+
max_age_minutes: parseInt(opts.maxAge, 10),
|
|
15353
|
+
project_id: projectId,
|
|
15354
|
+
limit: opts.limit ? parseInt(opts.limit, 10) : undefined
|
|
15355
|
+
}, db);
|
|
15356
|
+
if (opts.json) {
|
|
15357
|
+
console.log(JSON.stringify(result, null, 2));
|
|
15358
|
+
return;
|
|
15359
|
+
}
|
|
15360
|
+
console.log(chalk.bold(`Released ${result.released.length} stale task(s).`));
|
|
15361
|
+
for (const t of result.released) {
|
|
15362
|
+
const id = t.short_id || t.id.slice(0, 8);
|
|
15363
|
+
console.log(` ${chalk.yellow("released")} ${chalk.cyan(id)} ${t.title}`);
|
|
15364
|
+
}
|
|
15365
|
+
if (result.claimed) {
|
|
15366
|
+
const id = result.claimed.short_id || result.claimed.id.slice(0, 8);
|
|
15367
|
+
console.log(chalk.green(`
|
|
15368
|
+
Claimed: ${chalk.cyan(id)} ${result.claimed.title}`));
|
|
15369
|
+
} else {
|
|
15370
|
+
console.log(chalk.dim(`
|
|
15371
|
+
No task claimed (nothing available).`));
|
|
15372
|
+
}
|
|
15373
|
+
});
|
|
15278
15374
|
program2.command("assign <id> <agent>").description("Assign a task to an agent").option("--json", "Output as JSON").action((id, agent, opts) => {
|
|
15279
15375
|
const globalOpts = program2.opts();
|
|
15280
15376
|
const resolvedId = resolveTaskId(id);
|
|
@@ -15590,6 +15686,69 @@ program2.command("report").description("Analytics report: task activity, complet
|
|
|
15590
15686
|
console.log(lines.join(`
|
|
15591
15687
|
`));
|
|
15592
15688
|
});
|
|
15689
|
+
program2.command("today").description("Show task activity from today").option("--json", "Output as JSON").action(async (opts) => {
|
|
15690
|
+
const globalOpts = program2.opts();
|
|
15691
|
+
const db = getDatabase();
|
|
15692
|
+
const { getTasksChangedSince: getTasksChangedSince2 } = (init_tasks(), __toCommonJS(exports_tasks));
|
|
15693
|
+
const start = new Date;
|
|
15694
|
+
start.setHours(0, 0, 0, 0);
|
|
15695
|
+
const tasks = getTasksChangedSince2(start.toISOString(), undefined, db);
|
|
15696
|
+
const completed = tasks.filter((t) => t.status === "completed");
|
|
15697
|
+
const started = tasks.filter((t) => t.status === "in_progress");
|
|
15698
|
+
const other = tasks.filter((t) => t.status !== "completed" && t.status !== "in_progress");
|
|
15699
|
+
if (opts.json || globalOpts.json) {
|
|
15700
|
+
console.log(JSON.stringify({ date: start.toISOString().slice(0, 10), completed, started, changed: other }));
|
|
15701
|
+
return;
|
|
15702
|
+
}
|
|
15703
|
+
console.log(chalk.bold(`Today \u2014 ${start.toISOString().slice(0, 10)}
|
|
15704
|
+
`));
|
|
15705
|
+
if (completed.length > 0) {
|
|
15706
|
+
console.log(chalk.green(` \u2713 Completed (${completed.length}):`));
|
|
15707
|
+
for (const t of completed)
|
|
15708
|
+
console.log(` ${chalk.cyan(t.short_id || t.id.slice(0, 8))} ${t.title}${t.assigned_to ? chalk.dim(` \u2014 ${t.assigned_to}`) : ""}`);
|
|
15709
|
+
}
|
|
15710
|
+
if (started.length > 0) {
|
|
15711
|
+
console.log(chalk.blue(`
|
|
15712
|
+
\u25B6 Started (${started.length}):`));
|
|
15713
|
+
for (const t of started)
|
|
15714
|
+
console.log(` ${chalk.cyan(t.short_id || t.id.slice(0, 8))} ${t.title}${t.assigned_to ? chalk.dim(` \u2014 ${t.assigned_to}`) : ""}`);
|
|
15715
|
+
}
|
|
15716
|
+
if (completed.length === 0 && started.length === 0)
|
|
15717
|
+
console.log(chalk.dim(" No activity today."));
|
|
15718
|
+
});
|
|
15719
|
+
program2.command("yesterday").description("Show task activity from yesterday").option("--json", "Output as JSON").action(async (opts) => {
|
|
15720
|
+
const globalOpts = program2.opts();
|
|
15721
|
+
const db = getDatabase();
|
|
15722
|
+
const { getTasksChangedSince: getTasksChangedSince2 } = (init_tasks(), __toCommonJS(exports_tasks));
|
|
15723
|
+
const start = new Date;
|
|
15724
|
+
start.setDate(start.getDate() - 1);
|
|
15725
|
+
start.setHours(0, 0, 0, 0);
|
|
15726
|
+
const end = new Date(start);
|
|
15727
|
+
end.setHours(23, 59, 59, 999);
|
|
15728
|
+
const allChanged = getTasksChangedSince2(start.toISOString(), undefined, db);
|
|
15729
|
+
const tasks = allChanged.filter((t) => t.updated_at <= end.toISOString());
|
|
15730
|
+
const completed = tasks.filter((t) => t.status === "completed");
|
|
15731
|
+
const started = tasks.filter((t) => t.status === "in_progress");
|
|
15732
|
+
if (opts.json || globalOpts.json) {
|
|
15733
|
+
console.log(JSON.stringify({ date: start.toISOString().slice(0, 10), completed, started }));
|
|
15734
|
+
return;
|
|
15735
|
+
}
|
|
15736
|
+
console.log(chalk.bold(`Yesterday \u2014 ${start.toISOString().slice(0, 10)}
|
|
15737
|
+
`));
|
|
15738
|
+
if (completed.length > 0) {
|
|
15739
|
+
console.log(chalk.green(` \u2713 Completed (${completed.length}):`));
|
|
15740
|
+
for (const t of completed)
|
|
15741
|
+
console.log(` ${chalk.cyan(t.short_id || t.id.slice(0, 8))} ${t.title}${t.assigned_to ? chalk.dim(` \u2014 ${t.assigned_to}`) : ""}`);
|
|
15742
|
+
}
|
|
15743
|
+
if (started.length > 0) {
|
|
15744
|
+
console.log(chalk.blue(`
|
|
15745
|
+
\u25B6 Started (${started.length}):`));
|
|
15746
|
+
for (const t of started)
|
|
15747
|
+
console.log(` ${chalk.cyan(t.short_id || t.id.slice(0, 8))} ${t.title}`);
|
|
15748
|
+
}
|
|
15749
|
+
if (completed.length === 0 && started.length === 0)
|
|
15750
|
+
console.log(chalk.dim(" No activity yesterday."));
|
|
15751
|
+
});
|
|
15593
15752
|
program2.action(async () => {
|
|
15594
15753
|
if (process.stdout.isTTY) {
|
|
15595
15754
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,eAAO,MAAM,mBAAmB,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/db/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAqYtC,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAkBrD;AAqND,wBAAgB,aAAa,IAAI,IAAI,CAKpC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED,wBAAgB,GAAG,IAAI,MAAM,CAE5B;AAED,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAK9D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,SAAa,GAAG,MAAM,CAG3D;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAGpD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0B9F"}
|
package/dist/db/tasks.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare function completeTask(id: string, agentId?: string, db?: Database
|
|
|
16
16
|
notes?: string;
|
|
17
17
|
attachment_ids?: string[];
|
|
18
18
|
skip_recurrence?: boolean;
|
|
19
|
+
confidence?: number;
|
|
19
20
|
}): Task;
|
|
20
21
|
export declare function lockTask(id: string, agentId: string, db?: Database): LockResult;
|
|
21
22
|
export declare function unlockTask(id: string, agentId?: string, db?: Database): boolean;
|
|
@@ -128,6 +129,14 @@ export declare function decomposeTasks(parentId: string, subtasks: DecomposeSubt
|
|
|
128
129
|
};
|
|
129
130
|
export declare function setTaskStatus(id: string, status: TaskStatus, _agentId?: string, db?: Database): Task;
|
|
130
131
|
export declare function setTaskPriority(id: string, priority: TaskPriority, _agentId?: string, db?: Database): Task;
|
|
132
|
+
export declare function redistributeStaleTasks(agentId: string, options?: {
|
|
133
|
+
max_age_minutes?: number;
|
|
134
|
+
project_id?: string;
|
|
135
|
+
limit?: number;
|
|
136
|
+
}, db?: Database): {
|
|
137
|
+
released: Task[];
|
|
138
|
+
claimed: Task | null;
|
|
139
|
+
};
|
|
131
140
|
export declare function getTaskStats(filters?: {
|
|
132
141
|
project_id?: string;
|
|
133
142
|
task_list_id?: string;
|
package/dist/db/tasks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/db/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,cAAc,EACd,UAAU,EACV,YAAY,EAEZ,UAAU,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAuC3B,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/db/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AAC7D,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,cAAc,EACd,UAAU,EACV,YAAY,EAEZ,UAAU,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAuC3B,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAsDtE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,CAK9D;A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|
|
2
2
|
export type { TodosClientOptions } from "./sdk.js";
|
|
3
3
|
export { getDatabase, closeDatabase, resetDatabase, resolvePartialId, now, uuid } from "./db/database.js";
|
|
4
|
-
export { createTask, getTask, getTaskWithRelations, listTasks, countTasks, updateTask, deleteTask, startTask, completeTask, lockTask, unlockTask, addDependency, removeDependency, getTaskDependencies, getTaskDependents, getBlockingDeps, bulkUpdateTasks, bulkCreateTasks, cloneTask, getTaskStats, getTaskGraph, moveTask, getNextTask, claimNextTask, getActiveWork, failTask, getTasksChangedSince, getStaleTasks, getStatus, decomposeTasks, setTaskStatus, setTaskPriority, } from "./db/tasks.js";
|
|
4
|
+
export { createTask, getTask, getTaskWithRelations, listTasks, countTasks, updateTask, deleteTask, startTask, completeTask, lockTask, unlockTask, addDependency, removeDependency, getTaskDependencies, getTaskDependents, getBlockingDeps, bulkUpdateTasks, bulkCreateTasks, cloneTask, getTaskStats, getTaskGraph, moveTask, getNextTask, claimNextTask, getActiveWork, failTask, getTasksChangedSince, getStaleTasks, getStatus, decomposeTasks, setTaskStatus, setTaskPriority, redistributeStaleTasks, } from "./db/tasks.js";
|
|
5
5
|
export type { TaskGraphNode, TaskGraph, BulkCreateTaskInput, ActiveWorkItem, StatusSummary, DecomposeSubtaskInput } from "./db/tasks.js";
|
|
6
6
|
export { createProject, getProject, getProjectByPath, listProjects, updateProject, deleteProject, ensureProject, nextTaskShortId, slugify, } from "./db/projects.js";
|
|
7
7
|
export { createPlan, getPlan, listPlans, updatePlan, deletePlan, } from "./db/plans.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG1G,OAAO,EACL,UAAU,EACV,OAAO,EACP,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,aAAa,EACb,aAAa,EACb,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG1G,OAAO,EACL,UAAU,EACV,OAAO,EACP,oBAAoB,EACpB,SAAS,EACT,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,aAAa,EACb,aAAa,EACb,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,eAAe,EACf,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,cAAc,EAAE,aAA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ALTER TABLE agents ADD COLUMN session_id TEXT;
|
|
568
568
|
ALTER TABLE agents ADD COLUMN working_dir TEXT;
|
|
569
569
|
INSERT OR IGNORE INTO _migrations (id) VALUES (17);
|
|
570
|
+
`,
|
|
571
|
+
`
|
|
572
|
+
ALTER TABLE tasks ADD COLUMN confidence REAL;
|
|
573
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (18);
|
|
574
|
+
`,
|
|
575
|
+
`
|
|
576
|
+
ALTER TABLE tasks ADD COLUMN reason TEXT;
|
|
577
|
+
ALTER TABLE tasks ADD COLUMN spawned_from_session TEXT;
|
|
578
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (19);
|
|
570
579
|
`
|
|
571
580
|
];
|
|
572
581
|
var _db = null;
|
|
@@ -695,6 +704,9 @@ function ensureSchema(db) {
|
|
|
695
704
|
ensureColumn("tasks", "approved_at", "TEXT");
|
|
696
705
|
ensureColumn("tasks", "recurrence_rule", "TEXT");
|
|
697
706
|
ensureColumn("tasks", "recurrence_parent_id", "TEXT REFERENCES tasks(id) ON DELETE SET NULL");
|
|
707
|
+
ensureColumn("tasks", "confidence", "REAL");
|
|
708
|
+
ensureColumn("tasks", "reason", "TEXT");
|
|
709
|
+
ensureColumn("tasks", "spawned_from_session", "TEXT");
|
|
698
710
|
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
699
711
|
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
700
712
|
ensureColumn("agents", "reports_to", "TEXT");
|
|
@@ -1423,8 +1435,8 @@ function createTask(input, db) {
|
|
|
1423
1435
|
const tags = input.tags || [];
|
|
1424
1436
|
const shortId = input.project_id ? nextTaskShortId(input.project_id, d) : null;
|
|
1425
1437
|
const title = shortId ? `${shortId}: ${input.title}` : input.title;
|
|
1426
|
-
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id, spawns_template_id)
|
|
1427
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1438
|
+
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id, spawns_template_id, reason, spawned_from_session)
|
|
1439
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1428
1440
|
id,
|
|
1429
1441
|
shortId,
|
|
1430
1442
|
input.project_id || null,
|
|
@@ -1450,7 +1462,9 @@ function createTask(input, db) {
|
|
|
1450
1462
|
null,
|
|
1451
1463
|
input.recurrence_rule || null,
|
|
1452
1464
|
input.recurrence_parent_id || null,
|
|
1453
|
-
input.spawns_template_id || null
|
|
1465
|
+
input.spawns_template_id || null,
|
|
1466
|
+
input.reason || null,
|
|
1467
|
+
input.spawned_from_session || null
|
|
1454
1468
|
]);
|
|
1455
1469
|
if (tags.length > 0) {
|
|
1456
1470
|
insertTaskTags(id, tags, d);
|
|
@@ -1807,13 +1821,21 @@ function completeTask(id, agentId, db, options) {
|
|
|
1807
1821
|
checkCompletionGuard(task, agentId || null, d);
|
|
1808
1822
|
const evidence = options ? { files_changed: options.files_changed, test_results: options.test_results, commit_hash: options.commit_hash, notes: options.notes, attachment_ids: options.attachment_ids } : undefined;
|
|
1809
1823
|
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes || evidence.attachment_ids);
|
|
1810
|
-
|
|
1811
|
-
|
|
1824
|
+
const completionMeta = {};
|
|
1825
|
+
if (hasEvidence)
|
|
1826
|
+
completionMeta._evidence = evidence;
|
|
1827
|
+
if (options?.confidence !== undefined) {
|
|
1828
|
+
completionMeta._completion = { confidence: options.confidence };
|
|
1829
|
+
}
|
|
1830
|
+
const hasMeta = Object.keys(completionMeta).length > 0;
|
|
1831
|
+
if (hasMeta) {
|
|
1832
|
+
const meta2 = { ...task.metadata, ...completionMeta };
|
|
1812
1833
|
d.run("UPDATE tasks SET metadata = ? WHERE id = ?", [JSON.stringify(meta2), id]);
|
|
1813
1834
|
}
|
|
1814
1835
|
const timestamp = now();
|
|
1815
|
-
|
|
1816
|
-
|
|
1836
|
+
const confidence = options?.confidence !== undefined ? options.confidence : null;
|
|
1837
|
+
d.run(`UPDATE tasks SET status = 'completed', locked_by = NULL, locked_at = NULL, completed_at = ?, confidence = ?, version = version + 1, updated_at = ?
|
|
1838
|
+
WHERE id = ?`, [timestamp, confidence, timestamp, id]);
|
|
1817
1839
|
logTaskChange(id, "complete", "status", task.status, "completed", agentId || null, d);
|
|
1818
1840
|
dispatchWebhook("task.completed", { id, agent_id: agentId, title: task.title, completed_at: timestamp }, d).catch(() => {});
|
|
1819
1841
|
let spawnedTask = null;
|
|
@@ -1832,14 +1854,14 @@ function completeTask(id, agentId, db, options) {
|
|
|
1832
1854
|
spawnedFromTemplate = createTask(input, d);
|
|
1833
1855
|
} catch {}
|
|
1834
1856
|
}
|
|
1835
|
-
const meta =
|
|
1857
|
+
const meta = hasMeta ? { ...task.metadata, ...completionMeta } : task.metadata;
|
|
1836
1858
|
if (spawnedTask) {
|
|
1837
1859
|
meta._next_recurrence = { id: spawnedTask.id, short_id: spawnedTask.short_id, due_at: spawnedTask.due_at };
|
|
1838
1860
|
}
|
|
1839
1861
|
if (spawnedFromTemplate) {
|
|
1840
1862
|
meta._spawned_task = { id: spawnedFromTemplate.id, short_id: spawnedFromTemplate.short_id, title: spawnedFromTemplate.title };
|
|
1841
1863
|
}
|
|
1842
|
-
return { ...task, status: "completed", locked_by: null, locked_at: null, completed_at: timestamp, version: task.version + 1, updated_at: timestamp, metadata: meta };
|
|
1864
|
+
return { ...task, status: "completed", locked_by: null, locked_at: null, completed_at: timestamp, confidence, version: task.version + 1, updated_at: timestamp, metadata: meta };
|
|
1843
1865
|
}
|
|
1844
1866
|
function lockTask(id, agentId, db) {
|
|
1845
1867
|
const d = db || getDatabase();
|
|
@@ -2290,6 +2312,20 @@ function setTaskPriority(id, priority, _agentId, db) {
|
|
|
2290
2312
|
}
|
|
2291
2313
|
throw new Error(`Failed to set priority after 3 attempts`);
|
|
2292
2314
|
}
|
|
2315
|
+
function redistributeStaleTasks(agentId, options, db) {
|
|
2316
|
+
const d = db || getDatabase();
|
|
2317
|
+
const maxAge = options?.max_age_minutes ?? 60;
|
|
2318
|
+
const stale = getStaleTasks(maxAge, options?.project_id ? { project_id: options.project_id } : undefined, d);
|
|
2319
|
+
const limited = options?.limit ? stale.slice(0, options.limit) : stale;
|
|
2320
|
+
const timestamp = now();
|
|
2321
|
+
const released = [];
|
|
2322
|
+
for (const t of limited) {
|
|
2323
|
+
d.run(`UPDATE tasks SET locked_by = NULL, locked_at = NULL, status = 'pending', version = version + 1, updated_at = ? WHERE id = ?`, [timestamp, t.id]);
|
|
2324
|
+
released.push({ ...t, locked_by: null, locked_at: null, status: "pending" });
|
|
2325
|
+
}
|
|
2326
|
+
const claimed = released.length > 0 ? claimNextTask(agentId, options?.project_id ? { project_id: options.project_id } : undefined, d) : null;
|
|
2327
|
+
return { released, claimed };
|
|
2328
|
+
}
|
|
2293
2329
|
function wouldCreateCycle(taskId, dependsOn, db) {
|
|
2294
2330
|
const visited = new Set;
|
|
2295
2331
|
const queue = [dependsOn];
|
|
@@ -3476,6 +3512,7 @@ export {
|
|
|
3476
3512
|
resetDatabase,
|
|
3477
3513
|
removeDependency,
|
|
3478
3514
|
registerAgent,
|
|
3515
|
+
redistributeStaleTasks,
|
|
3479
3516
|
parseRecurrenceRule,
|
|
3480
3517
|
now,
|
|
3481
3518
|
nextTaskShortId,
|
package/dist/mcp/index.js
CHANGED
|
@@ -194,6 +194,9 @@ function ensureSchema(db) {
|
|
|
194
194
|
ensureColumn("tasks", "approved_at", "TEXT");
|
|
195
195
|
ensureColumn("tasks", "recurrence_rule", "TEXT");
|
|
196
196
|
ensureColumn("tasks", "recurrence_parent_id", "TEXT REFERENCES tasks(id) ON DELETE SET NULL");
|
|
197
|
+
ensureColumn("tasks", "confidence", "REAL");
|
|
198
|
+
ensureColumn("tasks", "reason", "TEXT");
|
|
199
|
+
ensureColumn("tasks", "spawned_from_session", "TEXT");
|
|
197
200
|
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
198
201
|
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
199
202
|
ensureColumn("agents", "reports_to", "TEXT");
|
|
@@ -590,6 +593,15 @@ var init_database = __esm(() => {
|
|
|
590
593
|
ALTER TABLE agents ADD COLUMN session_id TEXT;
|
|
591
594
|
ALTER TABLE agents ADD COLUMN working_dir TEXT;
|
|
592
595
|
INSERT OR IGNORE INTO _migrations (id) VALUES (17);
|
|
596
|
+
`,
|
|
597
|
+
`
|
|
598
|
+
ALTER TABLE tasks ADD COLUMN confidence REAL;
|
|
599
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (18);
|
|
600
|
+
`,
|
|
601
|
+
`
|
|
602
|
+
ALTER TABLE tasks ADD COLUMN reason TEXT;
|
|
603
|
+
ALTER TABLE tasks ADD COLUMN spawned_from_session TEXT;
|
|
604
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (19);
|
|
593
605
|
`
|
|
594
606
|
];
|
|
595
607
|
});
|
|
@@ -5349,8 +5361,8 @@ function createTask(input, db) {
|
|
|
5349
5361
|
const tags = input.tags || [];
|
|
5350
5362
|
const shortId = input.project_id ? nextTaskShortId(input.project_id, d) : null;
|
|
5351
5363
|
const title = shortId ? `${shortId}: ${input.title}` : input.title;
|
|
5352
|
-
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id, spawns_template_id)
|
|
5353
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
5364
|
+
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id, spawns_template_id, reason, spawned_from_session)
|
|
5365
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
5354
5366
|
id,
|
|
5355
5367
|
shortId,
|
|
5356
5368
|
input.project_id || null,
|
|
@@ -5376,7 +5388,9 @@ function createTask(input, db) {
|
|
|
5376
5388
|
null,
|
|
5377
5389
|
input.recurrence_rule || null,
|
|
5378
5390
|
input.recurrence_parent_id || null,
|
|
5379
|
-
input.spawns_template_id || null
|
|
5391
|
+
input.spawns_template_id || null,
|
|
5392
|
+
input.reason || null,
|
|
5393
|
+
input.spawned_from_session || null
|
|
5380
5394
|
]);
|
|
5381
5395
|
if (tags.length > 0) {
|
|
5382
5396
|
insertTaskTags(id, tags, d);
|
|
@@ -5733,13 +5747,21 @@ function completeTask(id, agentId, db, options) {
|
|
|
5733
5747
|
checkCompletionGuard(task, agentId || null, d);
|
|
5734
5748
|
const evidence = options ? { files_changed: options.files_changed, test_results: options.test_results, commit_hash: options.commit_hash, notes: options.notes, attachment_ids: options.attachment_ids } : undefined;
|
|
5735
5749
|
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes || evidence.attachment_ids);
|
|
5736
|
-
|
|
5737
|
-
|
|
5750
|
+
const completionMeta = {};
|
|
5751
|
+
if (hasEvidence)
|
|
5752
|
+
completionMeta._evidence = evidence;
|
|
5753
|
+
if (options?.confidence !== undefined) {
|
|
5754
|
+
completionMeta._completion = { confidence: options.confidence };
|
|
5755
|
+
}
|
|
5756
|
+
const hasMeta = Object.keys(completionMeta).length > 0;
|
|
5757
|
+
if (hasMeta) {
|
|
5758
|
+
const meta2 = { ...task.metadata, ...completionMeta };
|
|
5738
5759
|
d.run("UPDATE tasks SET metadata = ? WHERE id = ?", [JSON.stringify(meta2), id]);
|
|
5739
5760
|
}
|
|
5740
5761
|
const timestamp = now();
|
|
5741
|
-
|
|
5742
|
-
|
|
5762
|
+
const confidence = options?.confidence !== undefined ? options.confidence : null;
|
|
5763
|
+
d.run(`UPDATE tasks SET status = 'completed', locked_by = NULL, locked_at = NULL, completed_at = ?, confidence = ?, version = version + 1, updated_at = ?
|
|
5764
|
+
WHERE id = ?`, [timestamp, confidence, timestamp, id]);
|
|
5743
5765
|
logTaskChange(id, "complete", "status", task.status, "completed", agentId || null, d);
|
|
5744
5766
|
dispatchWebhook("task.completed", { id, agent_id: agentId, title: task.title, completed_at: timestamp }, d).catch(() => {});
|
|
5745
5767
|
let spawnedTask = null;
|
|
@@ -5758,14 +5780,14 @@ function completeTask(id, agentId, db, options) {
|
|
|
5758
5780
|
spawnedFromTemplate = createTask(input, d);
|
|
5759
5781
|
} catch {}
|
|
5760
5782
|
}
|
|
5761
|
-
const meta =
|
|
5783
|
+
const meta = hasMeta ? { ...task.metadata, ...completionMeta } : task.metadata;
|
|
5762
5784
|
if (spawnedTask) {
|
|
5763
5785
|
meta._next_recurrence = { id: spawnedTask.id, short_id: spawnedTask.short_id, due_at: spawnedTask.due_at };
|
|
5764
5786
|
}
|
|
5765
5787
|
if (spawnedFromTemplate) {
|
|
5766
5788
|
meta._spawned_task = { id: spawnedFromTemplate.id, short_id: spawnedFromTemplate.short_id, title: spawnedFromTemplate.title };
|
|
5767
5789
|
}
|
|
5768
|
-
return { ...task, status: "completed", locked_by: null, locked_at: null, completed_at: timestamp, version: task.version + 1, updated_at: timestamp, metadata: meta };
|
|
5790
|
+
return { ...task, status: "completed", locked_by: null, locked_at: null, completed_at: timestamp, confidence, version: task.version + 1, updated_at: timestamp, metadata: meta };
|
|
5769
5791
|
}
|
|
5770
5792
|
function lockTask(id, agentId, db) {
|
|
5771
5793
|
const d = db || getDatabase();
|
|
@@ -6212,6 +6234,20 @@ function setTaskPriority(id, priority, _agentId, db) {
|
|
|
6212
6234
|
}
|
|
6213
6235
|
throw new Error(`Failed to set priority after 3 attempts`);
|
|
6214
6236
|
}
|
|
6237
|
+
function redistributeStaleTasks(agentId, options, db) {
|
|
6238
|
+
const d = db || getDatabase();
|
|
6239
|
+
const maxAge = options?.max_age_minutes ?? 60;
|
|
6240
|
+
const stale = getStaleTasks(maxAge, options?.project_id ? { project_id: options.project_id } : undefined, d);
|
|
6241
|
+
const limited = options?.limit ? stale.slice(0, options.limit) : stale;
|
|
6242
|
+
const timestamp = now();
|
|
6243
|
+
const released = [];
|
|
6244
|
+
for (const t of limited) {
|
|
6245
|
+
d.run(`UPDATE tasks SET locked_by = NULL, locked_at = NULL, status = 'pending', version = version + 1, updated_at = ? WHERE id = ?`, [timestamp, t.id]);
|
|
6246
|
+
released.push({ ...t, locked_by: null, locked_at: null, status: "pending" });
|
|
6247
|
+
}
|
|
6248
|
+
const claimed = released.length > 0 ? claimNextTask(agentId, options?.project_id ? { project_id: options.project_id } : undefined, d) : null;
|
|
6249
|
+
return { released, claimed };
|
|
6250
|
+
}
|
|
6215
6251
|
function wouldCreateCycle(taskId, dependsOn, db) {
|
|
6216
6252
|
const visited = new Set;
|
|
6217
6253
|
const queue = [dependsOn];
|
|
@@ -7268,7 +7304,9 @@ if (shouldRegisterTool("create_task")) {
|
|
|
7268
7304
|
estimated_minutes: exports_external.number().optional(),
|
|
7269
7305
|
requires_approval: exports_external.boolean().optional(),
|
|
7270
7306
|
recurrence_rule: exports_external.string().optional(),
|
|
7271
|
-
spawns_template_id: exports_external.string().optional().describe("Template ID to auto-create as next task when this task is completed (pipeline/handoff chains)")
|
|
7307
|
+
spawns_template_id: exports_external.string().optional().describe("Template ID to auto-create as next task when this task is completed (pipeline/handoff chains)"),
|
|
7308
|
+
reason: exports_external.string().optional().describe("Why this task exists \u2014 context for agents picking it up"),
|
|
7309
|
+
spawned_from_session: exports_external.string().optional().describe("Session ID that created this task (for tracing task lineage)")
|
|
7272
7310
|
}, async (params) => {
|
|
7273
7311
|
try {
|
|
7274
7312
|
const resolved = { ...params };
|
|
@@ -7483,12 +7521,13 @@ if (shouldRegisterTool("complete_task")) {
|
|
|
7483
7521
|
test_results: exports_external.string().optional().describe("Summary of test results"),
|
|
7484
7522
|
commit_hash: exports_external.string().optional().describe("Git commit hash associated with this completion"),
|
|
7485
7523
|
notes: exports_external.string().optional().describe("Notes about the completion"),
|
|
7486
|
-
attachment_ids: exports_external.array(exports_external.string()).optional().describe("IDs of attachments uploaded via @hasna/attachments to link as evidence")
|
|
7487
|
-
|
|
7524
|
+
attachment_ids: exports_external.array(exports_external.string()).optional().describe("IDs of attachments uploaded via @hasna/attachments to link as evidence"),
|
|
7525
|
+
confidence: exports_external.number().min(0).max(1).optional().describe("Agent's confidence 0.0-1.0 that the task is fully complete. Default: 1.0. Low confidence (<0.7) is flagged as a signal for review.")
|
|
7526
|
+
}, async ({ id, agent_id, skip_recurrence, files_changed, test_results, commit_hash, notes, attachment_ids, confidence }) => {
|
|
7488
7527
|
try {
|
|
7489
7528
|
const resolvedId = resolveId(id);
|
|
7490
7529
|
const evidence = files_changed || test_results || commit_hash || notes || attachment_ids ? { files_changed, test_results, commit_hash, notes, attachment_ids } : undefined;
|
|
7491
|
-
const task = completeTask(resolvedId, agent_id, undefined, { skip_recurrence, ...evidence });
|
|
7530
|
+
const task = completeTask(resolvedId, agent_id, undefined, { skip_recurrence, confidence, ...evidence });
|
|
7492
7531
|
let text = `completed: ${formatTask(task)}`;
|
|
7493
7532
|
if (task.metadata._next_recurrence) {
|
|
7494
7533
|
const next = task.metadata._next_recurrence;
|
|
@@ -8963,6 +9002,29 @@ if (shouldRegisterTool("bootstrap")) {
|
|
|
8963
9002
|
}
|
|
8964
9003
|
});
|
|
8965
9004
|
}
|
|
9005
|
+
if (shouldRegisterTool("redistribute_stale_tasks")) {
|
|
9006
|
+
server.tool("redistribute_stale_tasks", "Release stale in-progress tasks and optionally claim the best one. Work-stealing for multi-agent.", {
|
|
9007
|
+
agent_id: exports_external.string().describe("Agent ID claiming the next task after releasing stale ones"),
|
|
9008
|
+
max_age_minutes: exports_external.number().optional().describe("Tasks idle longer than this (default: 60) are released"),
|
|
9009
|
+
project_id: exports_external.string().optional().describe("Limit to a specific project"),
|
|
9010
|
+
limit: exports_external.number().optional().describe("Max number of stale tasks to release")
|
|
9011
|
+
}, async ({ agent_id, max_age_minutes, project_id, limit }) => {
|
|
9012
|
+
try {
|
|
9013
|
+
const resolvedProjectId = project_id ? resolveId(project_id, "projects") : undefined;
|
|
9014
|
+
const result = redistributeStaleTasks(agent_id, { max_age_minutes, project_id: resolvedProjectId, limit });
|
|
9015
|
+
const lines = [`Released ${result.released.length} stale task(s).`];
|
|
9016
|
+
for (const t of result.released)
|
|
9017
|
+
lines.push(` ${formatTask(t)}`);
|
|
9018
|
+
if (result.claimed)
|
|
9019
|
+
lines.push(`
|
|
9020
|
+
Claimed: ${formatTask(result.claimed)}`);
|
|
9021
|
+
return { content: [{ type: "text", text: lines.join(`
|
|
9022
|
+
`) }] };
|
|
9023
|
+
} catch (e) {
|
|
9024
|
+
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
9025
|
+
}
|
|
9026
|
+
});
|
|
9027
|
+
}
|
|
8966
9028
|
if (shouldRegisterTool("search_tools")) {
|
|
8967
9029
|
server.tool("search_tools", "List all tool names, optionally filtered by substring.", { query: exports_external.string().optional() }, async ({ query }) => {
|
|
8968
9030
|
const all = [
|
|
@@ -9030,6 +9092,7 @@ if (shouldRegisterTool("search_tools")) {
|
|
|
9030
9092
|
"decompose_task",
|
|
9031
9093
|
"set_task_status",
|
|
9032
9094
|
"set_task_priority",
|
|
9095
|
+
"redistribute_stale_tasks",
|
|
9033
9096
|
"search_tools",
|
|
9034
9097
|
"describe_tools"
|
|
9035
9098
|
].filter((name) => shouldRegisterTool(name));
|
|
@@ -9217,6 +9280,9 @@ if (shouldRegisterTool("describe_tools")) {
|
|
|
9217
9280
|
set_task_priority: `Set task priority without needing version. Auto-retries on conflict (up to 3 attempts). Use instead of update_task when you only need to change priority.
|
|
9218
9281
|
Params: id(string, req), priority(low|medium|high|critical, req)
|
|
9219
9282
|
Example: {id: 'a1b2c3d4', priority: 'high'}`,
|
|
9283
|
+
redistribute_stale_tasks: `Release stale in-progress tasks and optionally claim the best one. Multi-agent work-stealing.
|
|
9284
|
+
Params: agent_id(string, req), max_age_minutes(number, default:60), project_id(string, optional), limit(number, optional)
|
|
9285
|
+
Example: {agent_id: 'a1b2c3d4', max_age_minutes: 30}`,
|
|
9220
9286
|
search_tools: `List all tool names or filter by substring.
|
|
9221
9287
|
Params: query(string, optional)
|
|
9222
9288
|
Example: {query: 'task'}`,
|
package/dist/server/index.js
CHANGED
|
@@ -295,6 +295,9 @@ function ensureSchema(db) {
|
|
|
295
295
|
ensureColumn("tasks", "approved_at", "TEXT");
|
|
296
296
|
ensureColumn("tasks", "recurrence_rule", "TEXT");
|
|
297
297
|
ensureColumn("tasks", "recurrence_parent_id", "TEXT REFERENCES tasks(id) ON DELETE SET NULL");
|
|
298
|
+
ensureColumn("tasks", "confidence", "REAL");
|
|
299
|
+
ensureColumn("tasks", "reason", "TEXT");
|
|
300
|
+
ensureColumn("tasks", "spawned_from_session", "TEXT");
|
|
298
301
|
ensureColumn("agents", "role", "TEXT DEFAULT 'agent'");
|
|
299
302
|
ensureColumn("agents", "permissions", `TEXT DEFAULT '["*"]'`);
|
|
300
303
|
ensureColumn("agents", "reports_to", "TEXT");
|
|
@@ -671,6 +674,15 @@ var init_database = __esm(() => {
|
|
|
671
674
|
ALTER TABLE agents ADD COLUMN session_id TEXT;
|
|
672
675
|
ALTER TABLE agents ADD COLUMN working_dir TEXT;
|
|
673
676
|
INSERT OR IGNORE INTO _migrations (id) VALUES (17);
|
|
677
|
+
`,
|
|
678
|
+
`
|
|
679
|
+
ALTER TABLE tasks ADD COLUMN confidence REAL;
|
|
680
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (18);
|
|
681
|
+
`,
|
|
682
|
+
`
|
|
683
|
+
ALTER TABLE tasks ADD COLUMN reason TEXT;
|
|
684
|
+
ALTER TABLE tasks ADD COLUMN spawned_from_session TEXT;
|
|
685
|
+
INSERT OR IGNORE INTO _migrations (id) VALUES (19);
|
|
674
686
|
`
|
|
675
687
|
];
|
|
676
688
|
});
|
|
@@ -1138,6 +1150,7 @@ __export(exports_tasks, {
|
|
|
1138
1150
|
setTaskStatus: () => setTaskStatus,
|
|
1139
1151
|
setTaskPriority: () => setTaskPriority,
|
|
1140
1152
|
removeDependency: () => removeDependency,
|
|
1153
|
+
redistributeStaleTasks: () => redistributeStaleTasks,
|
|
1141
1154
|
moveTask: () => moveTask,
|
|
1142
1155
|
lockTask: () => lockTask,
|
|
1143
1156
|
listTasks: () => listTasks,
|
|
@@ -1195,8 +1208,8 @@ function createTask(input, db) {
|
|
|
1195
1208
|
const tags = input.tags || [];
|
|
1196
1209
|
const shortId = input.project_id ? nextTaskShortId(input.project_id, d) : null;
|
|
1197
1210
|
const title = shortId ? `${shortId}: ${input.title}` : input.title;
|
|
1198
|
-
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id, spawns_template_id)
|
|
1199
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1211
|
+
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id, spawns_template_id, reason, spawned_from_session)
|
|
1212
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
1200
1213
|
id,
|
|
1201
1214
|
shortId,
|
|
1202
1215
|
input.project_id || null,
|
|
@@ -1222,7 +1235,9 @@ function createTask(input, db) {
|
|
|
1222
1235
|
null,
|
|
1223
1236
|
input.recurrence_rule || null,
|
|
1224
1237
|
input.recurrence_parent_id || null,
|
|
1225
|
-
input.spawns_template_id || null
|
|
1238
|
+
input.spawns_template_id || null,
|
|
1239
|
+
input.reason || null,
|
|
1240
|
+
input.spawned_from_session || null
|
|
1226
1241
|
]);
|
|
1227
1242
|
if (tags.length > 0) {
|
|
1228
1243
|
insertTaskTags(id, tags, d);
|
|
@@ -1579,13 +1594,21 @@ function completeTask(id, agentId, db, options) {
|
|
|
1579
1594
|
checkCompletionGuard(task, agentId || null, d);
|
|
1580
1595
|
const evidence = options ? { files_changed: options.files_changed, test_results: options.test_results, commit_hash: options.commit_hash, notes: options.notes, attachment_ids: options.attachment_ids } : undefined;
|
|
1581
1596
|
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes || evidence.attachment_ids);
|
|
1582
|
-
|
|
1583
|
-
|
|
1597
|
+
const completionMeta = {};
|
|
1598
|
+
if (hasEvidence)
|
|
1599
|
+
completionMeta._evidence = evidence;
|
|
1600
|
+
if (options?.confidence !== undefined) {
|
|
1601
|
+
completionMeta._completion = { confidence: options.confidence };
|
|
1602
|
+
}
|
|
1603
|
+
const hasMeta = Object.keys(completionMeta).length > 0;
|
|
1604
|
+
if (hasMeta) {
|
|
1605
|
+
const meta2 = { ...task.metadata, ...completionMeta };
|
|
1584
1606
|
d.run("UPDATE tasks SET metadata = ? WHERE id = ?", [JSON.stringify(meta2), id]);
|
|
1585
1607
|
}
|
|
1586
1608
|
const timestamp = now();
|
|
1587
|
-
|
|
1588
|
-
|
|
1609
|
+
const confidence = options?.confidence !== undefined ? options.confidence : null;
|
|
1610
|
+
d.run(`UPDATE tasks SET status = 'completed', locked_by = NULL, locked_at = NULL, completed_at = ?, confidence = ?, version = version + 1, updated_at = ?
|
|
1611
|
+
WHERE id = ?`, [timestamp, confidence, timestamp, id]);
|
|
1589
1612
|
logTaskChange(id, "complete", "status", task.status, "completed", agentId || null, d);
|
|
1590
1613
|
dispatchWebhook("task.completed", { id, agent_id: agentId, title: task.title, completed_at: timestamp }, d).catch(() => {});
|
|
1591
1614
|
let spawnedTask = null;
|
|
@@ -1604,14 +1627,14 @@ function completeTask(id, agentId, db, options) {
|
|
|
1604
1627
|
spawnedFromTemplate = createTask(input, d);
|
|
1605
1628
|
} catch {}
|
|
1606
1629
|
}
|
|
1607
|
-
const meta =
|
|
1630
|
+
const meta = hasMeta ? { ...task.metadata, ...completionMeta } : task.metadata;
|
|
1608
1631
|
if (spawnedTask) {
|
|
1609
1632
|
meta._next_recurrence = { id: spawnedTask.id, short_id: spawnedTask.short_id, due_at: spawnedTask.due_at };
|
|
1610
1633
|
}
|
|
1611
1634
|
if (spawnedFromTemplate) {
|
|
1612
1635
|
meta._spawned_task = { id: spawnedFromTemplate.id, short_id: spawnedFromTemplate.short_id, title: spawnedFromTemplate.title };
|
|
1613
1636
|
}
|
|
1614
|
-
return { ...task, status: "completed", locked_by: null, locked_at: null, completed_at: timestamp, version: task.version + 1, updated_at: timestamp, metadata: meta };
|
|
1637
|
+
return { ...task, status: "completed", locked_by: null, locked_at: null, completed_at: timestamp, confidence, version: task.version + 1, updated_at: timestamp, metadata: meta };
|
|
1615
1638
|
}
|
|
1616
1639
|
function lockTask(id, agentId, db) {
|
|
1617
1640
|
const d = db || getDatabase();
|
|
@@ -2062,6 +2085,20 @@ function setTaskPriority(id, priority, _agentId, db) {
|
|
|
2062
2085
|
}
|
|
2063
2086
|
throw new Error(`Failed to set priority after 3 attempts`);
|
|
2064
2087
|
}
|
|
2088
|
+
function redistributeStaleTasks(agentId, options, db) {
|
|
2089
|
+
const d = db || getDatabase();
|
|
2090
|
+
const maxAge = options?.max_age_minutes ?? 60;
|
|
2091
|
+
const stale = getStaleTasks(maxAge, options?.project_id ? { project_id: options.project_id } : undefined, d);
|
|
2092
|
+
const limited = options?.limit ? stale.slice(0, options.limit) : stale;
|
|
2093
|
+
const timestamp = now();
|
|
2094
|
+
const released = [];
|
|
2095
|
+
for (const t of limited) {
|
|
2096
|
+
d.run(`UPDATE tasks SET locked_by = NULL, locked_at = NULL, status = 'pending', version = version + 1, updated_at = ? WHERE id = ?`, [timestamp, t.id]);
|
|
2097
|
+
released.push({ ...t, locked_by: null, locked_at: null, status: "pending" });
|
|
2098
|
+
}
|
|
2099
|
+
const claimed = released.length > 0 ? claimNextTask(agentId, options?.project_id ? { project_id: options.project_id } : undefined, d) : null;
|
|
2100
|
+
return { released, claimed };
|
|
2101
|
+
}
|
|
2065
2102
|
function wouldCreateCycle(taskId, dependsOn, db) {
|
|
2066
2103
|
const visited = new Set;
|
|
2067
2104
|
const queue = [dependsOn];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -178,6 +178,9 @@ export interface Task {
|
|
|
178
178
|
recurrence_rule: string | null;
|
|
179
179
|
recurrence_parent_id: string | null;
|
|
180
180
|
spawns_template_id: string | null;
|
|
181
|
+
confidence: number | null;
|
|
182
|
+
reason: string | null;
|
|
183
|
+
spawned_from_session: string | null;
|
|
181
184
|
}
|
|
182
185
|
export interface TaskWithRelations extends Task {
|
|
183
186
|
subtasks: Task[];
|
|
@@ -207,6 +210,8 @@ export interface CreateTaskInput {
|
|
|
207
210
|
recurrence_rule?: string;
|
|
208
211
|
recurrence_parent_id?: string;
|
|
209
212
|
spawns_template_id?: string;
|
|
213
|
+
reason?: string;
|
|
214
|
+
spawned_from_session?: string;
|
|
210
215
|
}
|
|
211
216
|
export interface UpdateTaskInput {
|
|
212
217
|
title?: string;
|
|
@@ -311,6 +316,9 @@ export interface TaskRow {
|
|
|
311
316
|
recurrence_rule: string | null;
|
|
312
317
|
recurrence_parent_id: string | null;
|
|
313
318
|
spawns_template_id: string | null;
|
|
319
|
+
confidence: number | null;
|
|
320
|
+
reason: string | null;
|
|
321
|
+
spawned_from_session: string | null;
|
|
314
322
|
}
|
|
315
323
|
export interface SessionRow {
|
|
316
324
|
id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,yEAMhB,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAGxD,eAAO,MAAM,eAAe,gDAKlB,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAG5D,eAAO,MAAM,aAAa,8CAA+C,CAAC;AAC1E,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAGxD,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,C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