@hasna/todos 0.9.38 → 0.9.39
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 +16 -7
- package/dist/db/tasks.d.ts +1 -0
- package/dist/db/tasks.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/mcp/index.js +11 -5
- package/dist/server/index.js +2 -2
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -3558,8 +3558,8 @@ function completeTask(id, agentId, db, options) {
|
|
|
3558
3558
|
throw new LockError(id, task.locked_by);
|
|
3559
3559
|
}
|
|
3560
3560
|
checkCompletionGuard(task, agentId || null, d);
|
|
3561
|
-
const evidence = options ? { files_changed: options.files_changed, test_results: options.test_results, commit_hash: options.commit_hash, notes: options.notes } : undefined;
|
|
3562
|
-
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes);
|
|
3561
|
+
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;
|
|
3562
|
+
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes || evidence.attachment_ids);
|
|
3563
3563
|
if (hasEvidence) {
|
|
3564
3564
|
const meta2 = { ...task.metadata, _evidence: evidence };
|
|
3565
3565
|
d.run("UPDATE tasks SET metadata = ? WHERE id = ?", [JSON.stringify(meta2), id]);
|
|
@@ -9298,11 +9298,17 @@ Parent: ${task.parent.id.slice(0, 8)} | ${task.parent.title}`);
|
|
|
9298
9298
|
server.tool("complete_task", "Complete a task. For recurring tasks, auto-spawns next instance.", {
|
|
9299
9299
|
id: exports_external.string(),
|
|
9300
9300
|
agent_id: exports_external.string().optional(),
|
|
9301
|
-
skip_recurrence: exports_external.boolean().optional()
|
|
9302
|
-
|
|
9301
|
+
skip_recurrence: exports_external.boolean().optional(),
|
|
9302
|
+
files_changed: exports_external.array(exports_external.string()).optional().describe("List of files changed as part of completing this task"),
|
|
9303
|
+
test_results: exports_external.string().optional().describe("Summary of test results"),
|
|
9304
|
+
commit_hash: exports_external.string().optional().describe("Git commit hash associated with this completion"),
|
|
9305
|
+
notes: exports_external.string().optional().describe("Notes about the completion"),
|
|
9306
|
+
attachment_ids: exports_external.array(exports_external.string()).optional().describe("IDs of attachments uploaded via @hasna/attachments to link as evidence")
|
|
9307
|
+
}, async ({ id, agent_id, skip_recurrence, files_changed, test_results, commit_hash, notes, attachment_ids }) => {
|
|
9303
9308
|
try {
|
|
9304
9309
|
const resolvedId = resolveId(id);
|
|
9305
|
-
const
|
|
9310
|
+
const evidence = files_changed || test_results || commit_hash || notes || attachment_ids ? { files_changed, test_results, commit_hash, notes, attachment_ids } : undefined;
|
|
9311
|
+
const task = completeTask(resolvedId, agent_id, undefined, { skip_recurrence, ...evidence });
|
|
9306
9312
|
let text = `completed: ${formatTask(task)}`;
|
|
9307
9313
|
if (task.metadata._next_recurrence) {
|
|
9308
9314
|
const next = task.metadata._next_recurrence;
|
|
@@ -12925,12 +12931,15 @@ program2.command("update <id>").description("Update a task").option("--title <te
|
|
|
12925
12931
|
console.log(formatTaskLine(task));
|
|
12926
12932
|
}
|
|
12927
12933
|
});
|
|
12928
|
-
program2.command("done <id>").description("Mark a task as completed").action((id) => {
|
|
12934
|
+
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) => {
|
|
12929
12935
|
const globalOpts = program2.opts();
|
|
12930
12936
|
const resolvedId = resolveTaskId(id);
|
|
12937
|
+
const attachmentIds = opts.attachIds ? opts.attachIds.split(",").map((s) => s.trim()) : undefined;
|
|
12938
|
+
const filesChanged = opts.filesChanged ? opts.filesChanged.split(",").map((s) => s.trim()) : undefined;
|
|
12939
|
+
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;
|
|
12931
12940
|
let task;
|
|
12932
12941
|
try {
|
|
12933
|
-
task = completeTask(resolvedId, globalOpts.agent);
|
|
12942
|
+
task = completeTask(resolvedId, globalOpts.agent, undefined, evidence);
|
|
12934
12943
|
} catch (e) {
|
|
12935
12944
|
handleError(e);
|
|
12936
12945
|
}
|
package/dist/db/tasks.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare function completeTask(id: string, agentId?: string, db?: Database
|
|
|
14
14
|
test_results?: string;
|
|
15
15
|
commit_hash?: string;
|
|
16
16
|
notes?: string;
|
|
17
|
+
attachment_ids?: string[];
|
|
17
18
|
skip_recurrence?: boolean;
|
|
18
19
|
}): Task;
|
|
19
20
|
export declare function lockTask(id: string, agentId: string, db?: Database): LockResult;
|
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,EAEV,iBAAiB,EACjB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAsC3B,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,CAmDtE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,CAK9D;AAED,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,MAAM,EACV,EAAE,CAAC,EAAE,QAAQ,GACZ,iBAAiB,GAAG,IAAI,CAiD1B;AAED,wBAAgB,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CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,mBAAmB,EAAE,EAC7B,EAAE,CAAC,EAAE,QAAQ,GACZ;IAAE,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CA+B/F;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,EAAE;IAAE,MAAM,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,EACxG,EAAE,CAAC,EAAE,QAAQ,GACZ;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAuB9D"}
|
package/dist/index.js
CHANGED
|
@@ -1461,8 +1461,8 @@ function completeTask(id, agentId, db, options) {
|
|
|
1461
1461
|
throw new LockError(id, task.locked_by);
|
|
1462
1462
|
}
|
|
1463
1463
|
checkCompletionGuard(task, agentId || null, d);
|
|
1464
|
-
const evidence = options ? { files_changed: options.files_changed, test_results: options.test_results, commit_hash: options.commit_hash, notes: options.notes } : undefined;
|
|
1465
|
-
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes);
|
|
1464
|
+
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;
|
|
1465
|
+
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes || evidence.attachment_ids);
|
|
1466
1466
|
if (hasEvidence) {
|
|
1467
1467
|
const meta2 = { ...task.metadata, _evidence: evidence };
|
|
1468
1468
|
d.run("UPDATE tasks SET metadata = ? WHERE id = ?", [JSON.stringify(meta2), id]);
|
package/dist/mcp/index.js
CHANGED
|
@@ -5618,8 +5618,8 @@ function completeTask(id, agentId, db, options) {
|
|
|
5618
5618
|
throw new LockError(id, task.locked_by);
|
|
5619
5619
|
}
|
|
5620
5620
|
checkCompletionGuard(task, agentId || null, d);
|
|
5621
|
-
const evidence = options ? { files_changed: options.files_changed, test_results: options.test_results, commit_hash: options.commit_hash, notes: options.notes } : undefined;
|
|
5622
|
-
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes);
|
|
5621
|
+
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;
|
|
5622
|
+
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes || evidence.attachment_ids);
|
|
5623
5623
|
if (hasEvidence) {
|
|
5624
5624
|
const meta2 = { ...task.metadata, _evidence: evidence };
|
|
5625
5625
|
d.run("UPDATE tasks SET metadata = ? WHERE id = ?", [JSON.stringify(meta2), id]);
|
|
@@ -7128,11 +7128,17 @@ server.tool("start_task", "Claim, lock, and set task to in_progress.", {
|
|
|
7128
7128
|
server.tool("complete_task", "Complete a task. For recurring tasks, auto-spawns next instance.", {
|
|
7129
7129
|
id: exports_external.string(),
|
|
7130
7130
|
agent_id: exports_external.string().optional(),
|
|
7131
|
-
skip_recurrence: exports_external.boolean().optional()
|
|
7132
|
-
|
|
7131
|
+
skip_recurrence: exports_external.boolean().optional(),
|
|
7132
|
+
files_changed: exports_external.array(exports_external.string()).optional().describe("List of files changed as part of completing this task"),
|
|
7133
|
+
test_results: exports_external.string().optional().describe("Summary of test results"),
|
|
7134
|
+
commit_hash: exports_external.string().optional().describe("Git commit hash associated with this completion"),
|
|
7135
|
+
notes: exports_external.string().optional().describe("Notes about the completion"),
|
|
7136
|
+
attachment_ids: exports_external.array(exports_external.string()).optional().describe("IDs of attachments uploaded via @hasna/attachments to link as evidence")
|
|
7137
|
+
}, async ({ id, agent_id, skip_recurrence, files_changed, test_results, commit_hash, notes, attachment_ids }) => {
|
|
7133
7138
|
try {
|
|
7134
7139
|
const resolvedId = resolveId(id);
|
|
7135
|
-
const
|
|
7140
|
+
const evidence = files_changed || test_results || commit_hash || notes || attachment_ids ? { files_changed, test_results, commit_hash, notes, attachment_ids } : undefined;
|
|
7141
|
+
const task = completeTask(resolvedId, agent_id, undefined, { skip_recurrence, ...evidence });
|
|
7136
7142
|
let text = `completed: ${formatTask(task)}`;
|
|
7137
7143
|
if (task.metadata._next_recurrence) {
|
|
7138
7144
|
const next = task.metadata._next_recurrence;
|
package/dist/server/index.js
CHANGED
|
@@ -1582,8 +1582,8 @@ function completeTask(id, agentId, db, options) {
|
|
|
1582
1582
|
throw new LockError(id, task.locked_by);
|
|
1583
1583
|
}
|
|
1584
1584
|
checkCompletionGuard(task, agentId || null, d);
|
|
1585
|
-
const evidence = options ? { files_changed: options.files_changed, test_results: options.test_results, commit_hash: options.commit_hash, notes: options.notes } : undefined;
|
|
1586
|
-
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes);
|
|
1585
|
+
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;
|
|
1586
|
+
const hasEvidence = evidence && (evidence.files_changed || evidence.test_results || evidence.commit_hash || evidence.notes || evidence.attachment_ids);
|
|
1587
1587
|
if (hasEvidence) {
|
|
1588
1588
|
const meta2 = { ...task.metadata, _evidence: evidence };
|
|
1589
1589
|
d.run("UPDATE tasks SET metadata = ? WHERE id = ?", [JSON.stringify(meta2), id]);
|