@hasna/todos 0.10.14 → 0.10.15
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 +94 -0
- package/dist/mcp/index.js +51 -0
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -13238,6 +13238,57 @@ Claimed: ${formatTask(result.claimed)}`);
|
|
|
13238
13238
|
}
|
|
13239
13239
|
});
|
|
13240
13240
|
}
|
|
13241
|
+
if (shouldRegisterTool("create_failure_task")) {
|
|
13242
|
+
server.tool("create_failure_task", "Create a task from a test/build/typecheck failure. Auto-assigns to the most likely agent based on file ownership and org chart.", {
|
|
13243
|
+
failure_type: exports_external.enum(["test", "build", "typecheck", "runtime", "other"]).describe("Type of failure"),
|
|
13244
|
+
title: exports_external.string().optional().describe("Task title (auto-generated from error if omitted)"),
|
|
13245
|
+
error_message: exports_external.string().describe("The error message or summary"),
|
|
13246
|
+
file_path: exports_external.string().optional().describe("File where the failure occurred"),
|
|
13247
|
+
stack_trace: exports_external.string().optional().describe("Stack trace or detailed output (truncated to 2000 chars)"),
|
|
13248
|
+
project_id: exports_external.string().optional().describe("Project to associate the task with"),
|
|
13249
|
+
priority: exports_external.enum(["low", "medium", "high", "critical"]).optional().describe("Default: high for build/typecheck, medium for test")
|
|
13250
|
+
}, async ({ failure_type, title, error_message, file_path, stack_trace, project_id, priority }) => {
|
|
13251
|
+
try {
|
|
13252
|
+
const { createTask: createTask2 } = (init_tasks(), __toCommonJS(exports_tasks));
|
|
13253
|
+
const { autoAssignTask: autoAssignTask2 } = await Promise.resolve().then(() => (init_auto_assign(), exports_auto_assign));
|
|
13254
|
+
const resolvedProjectId = project_id ? resolveId(project_id, "projects") : undefined;
|
|
13255
|
+
const defaultPriority = failure_type === "build" || failure_type === "typecheck" ? "high" : "medium";
|
|
13256
|
+
const taskPriority = priority ?? defaultPriority;
|
|
13257
|
+
const autoTitle = title || `${failure_type.toUpperCase()} failure${file_path ? ` in ${file_path.split("/").pop()}` : ""}: ${error_message.slice(0, 60)}`;
|
|
13258
|
+
const description = [
|
|
13259
|
+
`**Failure type:** ${failure_type}`,
|
|
13260
|
+
file_path ? `**File:** ${file_path}` : null,
|
|
13261
|
+
`**Error:**
|
|
13262
|
+
\`\`\`
|
|
13263
|
+
${error_message.slice(0, 500)}
|
|
13264
|
+
\`\`\``,
|
|
13265
|
+
stack_trace ? `**Stack trace:**
|
|
13266
|
+
\`\`\`
|
|
13267
|
+
${stack_trace.slice(0, 1500)}
|
|
13268
|
+
\`\`\`` : null
|
|
13269
|
+
].filter(Boolean).join(`
|
|
13270
|
+
|
|
13271
|
+
`);
|
|
13272
|
+
const task = createTask2({
|
|
13273
|
+
title: autoTitle,
|
|
13274
|
+
description,
|
|
13275
|
+
priority: taskPriority,
|
|
13276
|
+
project_id: resolvedProjectId,
|
|
13277
|
+
tags: ["failure", failure_type, "auto-created"],
|
|
13278
|
+
status: "pending"
|
|
13279
|
+
});
|
|
13280
|
+
const assignResult = await autoAssignTask2(task.id);
|
|
13281
|
+
return {
|
|
13282
|
+
content: [{
|
|
13283
|
+
type: "text",
|
|
13284
|
+
text: JSON.stringify({ task_id: task.id, short_id: task.short_id, title: task.title, assigned_to: assignResult.agent_name, assign_method: assignResult.method }, null, 2)
|
|
13285
|
+
}]
|
|
13286
|
+
};
|
|
13287
|
+
} catch (e) {
|
|
13288
|
+
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
13289
|
+
}
|
|
13290
|
+
});
|
|
13291
|
+
}
|
|
13241
13292
|
if (shouldRegisterTool("auto_assign_task")) {
|
|
13242
13293
|
server.tool("auto_assign_task", "Auto-assign a task to the best available agent. Uses Cerebras LLM (llama-3.3-70b) if CEREBRAS_API_KEY is set, otherwise falls back to capability-based matching.", {
|
|
13243
13294
|
task_id: exports_external.string().describe("Task to auto-assign")
|
|
@@ -18933,6 +18984,49 @@ program2.command("context").description("Session start context: status, latest h
|
|
|
18933
18984
|
console.log(chalk.dim(`
|
|
18934
18985
|
as_of: ${new Date().toISOString()}`));
|
|
18935
18986
|
});
|
|
18987
|
+
program2.command("report-failure").description("Create a task from a test/build/typecheck failure and auto-assign it").requiredOption("--error <message>", "Error message or summary").option("--type <type>", "Failure type: test, build, typecheck, runtime, other", "test").option("--file <path>", "File where failure occurred").option("--stack <trace>", "Stack trace or detailed output").option("--title <title>", "Custom task title (auto-generated if omitted)").option("--priority <p>", "Priority: low, medium, high, critical").option("--json", "Output as JSON").action(async (opts) => {
|
|
18988
|
+
const globalOpts = program2.opts();
|
|
18989
|
+
const { createTask: createTask2 } = (init_tasks(), __toCommonJS(exports_tasks));
|
|
18990
|
+
const { autoAssignTask: autoAssignTask2 } = await Promise.resolve().then(() => (init_auto_assign(), exports_auto_assign));
|
|
18991
|
+
const projectId = autoProject(globalOpts);
|
|
18992
|
+
const failureType = opts.type || "test";
|
|
18993
|
+
const defaultPriority = failureType === "build" || failureType === "typecheck" ? "high" : "medium";
|
|
18994
|
+
const taskPriority = opts.priority || defaultPriority;
|
|
18995
|
+
const autoTitle = opts.title || `${failureType.toUpperCase()} failure${opts.file ? ` in ${opts.file.split("/").pop()}` : ""}: ${opts.error.slice(0, 60)}`;
|
|
18996
|
+
const descParts = [
|
|
18997
|
+
`**Failure type:** ${failureType}`,
|
|
18998
|
+
opts.file ? `**File:** ${opts.file}` : null,
|
|
18999
|
+
`**Error:**
|
|
19000
|
+
\`\`\`
|
|
19001
|
+
${opts.error.slice(0, 500)}
|
|
19002
|
+
\`\`\``,
|
|
19003
|
+
opts.stack ? `**Stack trace:**
|
|
19004
|
+
\`\`\`
|
|
19005
|
+
${opts.stack.slice(0, 1500)}
|
|
19006
|
+
\`\`\`` : null
|
|
19007
|
+
].filter(Boolean).join(`
|
|
19008
|
+
|
|
19009
|
+
`);
|
|
19010
|
+
const task = createTask2({
|
|
19011
|
+
title: autoTitle,
|
|
19012
|
+
description: descParts,
|
|
19013
|
+
priority: taskPriority,
|
|
19014
|
+
project_id: projectId || undefined,
|
|
19015
|
+
tags: ["failure", failureType, "auto-created"],
|
|
19016
|
+
status: "pending"
|
|
19017
|
+
});
|
|
19018
|
+
const assignResult = await autoAssignTask2(task.id);
|
|
19019
|
+
if (opts.json || globalOpts.json) {
|
|
19020
|
+
console.log(JSON.stringify({ task_id: task.id, short_id: task.short_id, title: task.title, assigned_to: assignResult.agent_name, method: assignResult.method }));
|
|
19021
|
+
return;
|
|
19022
|
+
}
|
|
19023
|
+
console.log(chalk.green(`\u2713 Created task ${task.short_id || task.id.slice(0, 8)}: ${task.title}`));
|
|
19024
|
+
if (assignResult.agent_name) {
|
|
19025
|
+
console.log(chalk.cyan(` Assigned to: ${assignResult.agent_name} (via ${assignResult.method})`));
|
|
19026
|
+
if (assignResult.reason)
|
|
19027
|
+
console.log(chalk.dim(` Reason: ${assignResult.reason}`));
|
|
19028
|
+
}
|
|
19029
|
+
});
|
|
18936
19030
|
program2.action(async () => {
|
|
18937
19031
|
if (process.stdout.isTTY) {
|
|
18938
19032
|
try {
|
package/dist/mcp/index.js
CHANGED
|
@@ -11050,6 +11050,57 @@ Claimed: ${formatTask(result.claimed)}`);
|
|
|
11050
11050
|
}
|
|
11051
11051
|
});
|
|
11052
11052
|
}
|
|
11053
|
+
if (shouldRegisterTool("create_failure_task")) {
|
|
11054
|
+
server.tool("create_failure_task", "Create a task from a test/build/typecheck failure. Auto-assigns to the most likely agent based on file ownership and org chart.", {
|
|
11055
|
+
failure_type: exports_external.enum(["test", "build", "typecheck", "runtime", "other"]).describe("Type of failure"),
|
|
11056
|
+
title: exports_external.string().optional().describe("Task title (auto-generated from error if omitted)"),
|
|
11057
|
+
error_message: exports_external.string().describe("The error message or summary"),
|
|
11058
|
+
file_path: exports_external.string().optional().describe("File where the failure occurred"),
|
|
11059
|
+
stack_trace: exports_external.string().optional().describe("Stack trace or detailed output (truncated to 2000 chars)"),
|
|
11060
|
+
project_id: exports_external.string().optional().describe("Project to associate the task with"),
|
|
11061
|
+
priority: exports_external.enum(["low", "medium", "high", "critical"]).optional().describe("Default: high for build/typecheck, medium for test")
|
|
11062
|
+
}, async ({ failure_type, title, error_message, file_path, stack_trace, project_id, priority }) => {
|
|
11063
|
+
try {
|
|
11064
|
+
const { createTask: createTask2 } = (init_tasks(), __toCommonJS(exports_tasks));
|
|
11065
|
+
const { autoAssignTask: autoAssignTask2 } = await Promise.resolve().then(() => (init_auto_assign(), exports_auto_assign));
|
|
11066
|
+
const resolvedProjectId = project_id ? resolveId(project_id, "projects") : undefined;
|
|
11067
|
+
const defaultPriority = failure_type === "build" || failure_type === "typecheck" ? "high" : "medium";
|
|
11068
|
+
const taskPriority = priority ?? defaultPriority;
|
|
11069
|
+
const autoTitle = title || `${failure_type.toUpperCase()} failure${file_path ? ` in ${file_path.split("/").pop()}` : ""}: ${error_message.slice(0, 60)}`;
|
|
11070
|
+
const description = [
|
|
11071
|
+
`**Failure type:** ${failure_type}`,
|
|
11072
|
+
file_path ? `**File:** ${file_path}` : null,
|
|
11073
|
+
`**Error:**
|
|
11074
|
+
\`\`\`
|
|
11075
|
+
${error_message.slice(0, 500)}
|
|
11076
|
+
\`\`\``,
|
|
11077
|
+
stack_trace ? `**Stack trace:**
|
|
11078
|
+
\`\`\`
|
|
11079
|
+
${stack_trace.slice(0, 1500)}
|
|
11080
|
+
\`\`\`` : null
|
|
11081
|
+
].filter(Boolean).join(`
|
|
11082
|
+
|
|
11083
|
+
`);
|
|
11084
|
+
const task = createTask2({
|
|
11085
|
+
title: autoTitle,
|
|
11086
|
+
description,
|
|
11087
|
+
priority: taskPriority,
|
|
11088
|
+
project_id: resolvedProjectId,
|
|
11089
|
+
tags: ["failure", failure_type, "auto-created"],
|
|
11090
|
+
status: "pending"
|
|
11091
|
+
});
|
|
11092
|
+
const assignResult = await autoAssignTask2(task.id);
|
|
11093
|
+
return {
|
|
11094
|
+
content: [{
|
|
11095
|
+
type: "text",
|
|
11096
|
+
text: JSON.stringify({ task_id: task.id, short_id: task.short_id, title: task.title, assigned_to: assignResult.agent_name, assign_method: assignResult.method }, null, 2)
|
|
11097
|
+
}]
|
|
11098
|
+
};
|
|
11099
|
+
} catch (e) {
|
|
11100
|
+
return { content: [{ type: "text", text: formatError(e) }], isError: true };
|
|
11101
|
+
}
|
|
11102
|
+
});
|
|
11103
|
+
}
|
|
11053
11104
|
if (shouldRegisterTool("auto_assign_task")) {
|
|
11054
11105
|
server.tool("auto_assign_task", "Auto-assign a task to the best available agent. Uses Cerebras LLM (llama-3.3-70b) if CEREBRAS_API_KEY is set, otherwise falls back to capability-based matching.", {
|
|
11055
11106
|
task_id: exports_external.string().describe("Task to auto-assign")
|