@e0ipso/ai-task-manager 1.36.1 → 1.37.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/README.md +26 -21
- package/dist/cli.js +1 -32
- package/dist/cli.js.map +1 -1
- package/dist/conflict-detector.d.ts.map +1 -1
- package/dist/conflict-detector.js +0 -4
- package/dist/conflict-detector.js.map +1 -1
- package/dist/index.d.ts +3 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +50 -245
- package/dist/index.js.map +1 -1
- package/dist/metadata.d.ts +9 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +14 -0
- package/dist/metadata.js.map +1 -1
- package/dist/types.d.ts +18 -18
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +27 -58
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +93 -219
- package/dist/utils.js.map +1 -1
- package/package.json +4 -2
- package/templates/ai-task-manager/config/TASK_MANAGER.md +3 -3
- package/templates/ai-task-manager/config/hooks/PRE_PHASE.md +6 -26
- package/templates/ai-task-manager/config/hooks/PRE_TASK_ASSIGNMENT.md +6 -24
- package/templates/ai-task-manager/config/templates/PLAN_TEMPLATE.md +1 -1
- package/templates/{assistant → harness}/agents/plan-creator.md +2 -2
- package/templates/harness/skills/task-create-plan/SKILL.md +120 -0
- package/templates/harness/skills/task-create-plan/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-create-plan/scripts/get-next-plan-id.cjs +214 -0
- package/templates/harness/skills/task-execute-blueprint/SKILL.md +139 -0
- package/templates/harness/skills/task-execute-blueprint/scripts/create-feature-branch.cjs +376 -0
- package/templates/harness/skills/task-execute-blueprint/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-execute-blueprint/scripts/validate-plan-blueprint.cjs +375 -0
- package/templates/harness/skills/task-execute-task/SKILL.md +195 -0
- package/templates/harness/skills/task-execute-task/scripts/check-task-dependencies.cjs +437 -0
- package/templates/harness/skills/task-execute-task/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-execute-task/scripts/validate-plan-blueprint.cjs +375 -0
- package/templates/harness/skills/task-full-workflow/SKILL.md +378 -0
- package/templates/harness/skills/task-full-workflow/scripts/create-feature-branch.cjs +376 -0
- package/templates/harness/skills/task-full-workflow/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-full-workflow/scripts/get-next-plan-id.cjs +214 -0
- package/templates/harness/skills/task-full-workflow/scripts/get-next-task-id.cjs +312 -0
- package/templates/harness/skills/task-full-workflow/scripts/validate-plan-blueprint.cjs +375 -0
- package/templates/harness/skills/task-generate-tasks/SKILL.md +244 -0
- package/templates/harness/skills/task-generate-tasks/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-generate-tasks/scripts/get-next-task-id.cjs +312 -0
- package/templates/harness/skills/task-generate-tasks/scripts/validate-plan-blueprint.cjs +375 -0
- package/templates/harness/skills/task-refine-plan/SKILL.md +205 -0
- package/templates/harness/skills/task-refine-plan/scripts/find-task-manager-root.cjs +116 -0
- package/templates/harness/skills/task-refine-plan/scripts/validate-plan-blueprint.cjs +375 -0
- package/dist/exec.d.ts +0 -13
- package/dist/exec.d.ts.map +0 -1
- package/dist/exec.js +0 -261
- package/dist/exec.js.map +0 -1
- package/templates/ai-task-manager/config/scripts/check-task-dependencies.cjs +0 -240
- package/templates/ai-task-manager/config/scripts/compose-prompt.cjs +0 -234
- package/templates/ai-task-manager/config/scripts/create-feature-branch.cjs +0 -204
- package/templates/ai-task-manager/config/scripts/extract-task-skills.cjs +0 -84
- package/templates/ai-task-manager/config/scripts/find-root.cjs +0 -10
- package/templates/ai-task-manager/config/scripts/get-next-plan-id.cjs +0 -49
- package/templates/ai-task-manager/config/scripts/get-next-task-id.cjs +0 -81
- package/templates/ai-task-manager/config/scripts/shared-utils.cjs +0 -418
- package/templates/ai-task-manager/config/scripts/validate-plan-blueprint.cjs +0 -138
- package/templates/assistant/commands/tasks/create-plan-auto.md +0 -174
- package/templates/assistant/commands/tasks/create-plan.md +0 -175
- package/templates/assistant/commands/tasks/execute-blueprint.md +0 -233
- package/templates/assistant/commands/tasks/execute-task.md +0 -351
- package/templates/assistant/commands/tasks/fix-broken-tests.md +0 -44
- package/templates/assistant/commands/tasks/full-workflow.md +0 -849
- package/templates/assistant/commands/tasks/generate-tasks.md +0 -348
- package/templates/assistant/commands/tasks/refine-plan-auto.md +0 -172
- package/templates/assistant/commands/tasks/refine-plan.md +0 -163
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/skill-scripts/validate-plan-blueprint.ts
|
|
31
|
+
var validate_plan_blueprint_exports = {};
|
|
32
|
+
__export(validate_plan_blueprint_exports, {
|
|
33
|
+
main: () => main
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(validate_plan_blueprint_exports);
|
|
36
|
+
var fs4 = __toESM(require("fs"));
|
|
37
|
+
var path4 = __toESM(require("path"));
|
|
38
|
+
|
|
39
|
+
// src/skill-scripts/shared/root.ts
|
|
40
|
+
var fs = __toESM(require("fs"));
|
|
41
|
+
var path = __toESM(require("path"));
|
|
42
|
+
var EXPECTED_SCHEMA = true ? 1 : 1;
|
|
43
|
+
var isValidTaskManagerRoot = (taskManagerPath) => {
|
|
44
|
+
try {
|
|
45
|
+
if (!fs.existsSync(taskManagerPath)) return false;
|
|
46
|
+
if (!fs.lstatSync(taskManagerPath).isDirectory()) return false;
|
|
47
|
+
const metadataPath = path.join(taskManagerPath, ".init-metadata.json");
|
|
48
|
+
if (!fs.existsSync(metadataPath)) return false;
|
|
49
|
+
const metadata = JSON.parse(fs.readFileSync(metadataPath, "utf8"));
|
|
50
|
+
return metadata && typeof metadata === "object" && "version" in metadata;
|
|
51
|
+
} catch (_err) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var getTaskManagerAt = (directory) => {
|
|
56
|
+
const taskManagerPath = path.join(directory, ".ai", "task-manager");
|
|
57
|
+
return isValidTaskManagerRoot(taskManagerPath) ? taskManagerPath : null;
|
|
58
|
+
};
|
|
59
|
+
var getParentPaths = (currentPath, acc = []) => {
|
|
60
|
+
const absolutePath = path.resolve(currentPath);
|
|
61
|
+
const nextAcc = [...acc, absolutePath];
|
|
62
|
+
const parentPath = path.dirname(absolutePath);
|
|
63
|
+
if (parentPath === absolutePath) return nextAcc;
|
|
64
|
+
return getParentPaths(parentPath, nextAcc);
|
|
65
|
+
};
|
|
66
|
+
var checkWorkspaceSchema = (metadataPath) => {
|
|
67
|
+
let metadata;
|
|
68
|
+
try {
|
|
69
|
+
metadata = JSON.parse(fs.readFileSync(metadataPath, "utf8"));
|
|
70
|
+
} catch {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const actual = typeof metadata.workspaceSchemaVersion === "number" ? metadata.workspaceSchemaVersion : 1;
|
|
74
|
+
if (actual === EXPECTED_SCHEMA) return;
|
|
75
|
+
if (actual < EXPECTED_SCHEMA) {
|
|
76
|
+
process.stderr.write(
|
|
77
|
+
`Workspace schema v${actual} is older than this skill requires (v${EXPECTED_SCHEMA}). Re-run \`npx @e0ipso/ai-task-manager init\` with the latest CLI to update.
|
|
78
|
+
`
|
|
79
|
+
);
|
|
80
|
+
} else {
|
|
81
|
+
process.stderr.write(
|
|
82
|
+
`This skill (built for workspace schema v${EXPECTED_SCHEMA}) is older than the workspace (v${actual}). Re-run \`npx skills add e0ipso/ai-task-manager\` to update skills.
|
|
83
|
+
`
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
process.exit(1);
|
|
87
|
+
};
|
|
88
|
+
var findTaskManagerRoot = (startPath = process.cwd()) => {
|
|
89
|
+
const paths = getParentPaths(startPath);
|
|
90
|
+
const found = paths.find((p) => getTaskManagerAt(p));
|
|
91
|
+
if (!found) return null;
|
|
92
|
+
const root = getTaskManagerAt(found);
|
|
93
|
+
if (root) checkWorkspaceSchema(path.join(root, ".init-metadata.json"));
|
|
94
|
+
return root;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// src/skill-scripts/shared/plan-scan.ts
|
|
98
|
+
var fs2 = __toESM(require("fs"));
|
|
99
|
+
var path2 = __toESM(require("path"));
|
|
100
|
+
|
|
101
|
+
// src/skill-scripts/shared/frontmatter.ts
|
|
102
|
+
var ID_PATTERNS = [
|
|
103
|
+
/^\s*["']?id["']?\s*:\s*["']?([+-]?\d+)["']?\s*(?:#.*)?$/im,
|
|
104
|
+
/^\s*id\s*:\s*([+-]?\d+)\s*(?:#.*)?$/im,
|
|
105
|
+
/^\s*["']?id["']?\s*:\s*"([+-]?\d+)"\s*(?:#.*)?$/im,
|
|
106
|
+
/^\s*["']?id["']?\s*:\s*'([+-]?\d+)'\s*(?:#.*)?$/im,
|
|
107
|
+
/^\s*["']id["']\s*:\s*([+-]?\d+)\s*(?:#.*)?$/im,
|
|
108
|
+
/^\s*id\s*:\s*[|>]\s*([+-]?\d+)\s*$/im
|
|
109
|
+
];
|
|
110
|
+
var validateId = (rawId) => {
|
|
111
|
+
const id = parseInt(rawId, 10);
|
|
112
|
+
if (Number.isNaN(id) || id < 0 || id > Number.MAX_SAFE_INTEGER) return null;
|
|
113
|
+
return id;
|
|
114
|
+
};
|
|
115
|
+
var extractIdFromMarkdown = (content) => {
|
|
116
|
+
const frontmatterMatch = content.match(/^---\s*\r?\n([\s\S]*?)\r?\n---/);
|
|
117
|
+
if (!frontmatterMatch || !frontmatterMatch[1]) return null;
|
|
118
|
+
const block = frontmatterMatch[1];
|
|
119
|
+
for (const pattern of ID_PATTERNS) {
|
|
120
|
+
const match = block.match(pattern);
|
|
121
|
+
if (match && match[1]) {
|
|
122
|
+
const id = validateId(match[1]);
|
|
123
|
+
if (id !== null) return id;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
var extractIdFromHtml = (content) => {
|
|
129
|
+
const headMatch = content.match(/<head[^>]*>([\s\S]*?)<\/head>/i);
|
|
130
|
+
const scope = headMatch && headMatch[1] ? headMatch[1] : content;
|
|
131
|
+
const metaPatterns = [
|
|
132
|
+
/<meta\s+[^>]*name\s*=\s*["']id["'][^>]*content\s*=\s*["']([+-]?\d+)["'][^>]*\/?>/i,
|
|
133
|
+
/<meta\s+[^>]*content\s*=\s*["']([+-]?\d+)["'][^>]*name\s*=\s*["']id["'][^>]*\/?>/i
|
|
134
|
+
];
|
|
135
|
+
for (const pattern of metaPatterns) {
|
|
136
|
+
const match = scope.match(pattern);
|
|
137
|
+
if (match && match[1]) {
|
|
138
|
+
const id = validateId(match[1]);
|
|
139
|
+
if (id !== null) return id;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return null;
|
|
143
|
+
};
|
|
144
|
+
var extractPlanId = (content, filePath) => {
|
|
145
|
+
if (filePath.toLowerCase().endsWith(".html")) return extractIdFromHtml(content);
|
|
146
|
+
return extractIdFromMarkdown(content);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// src/skill-scripts/shared/plan-scan.ts
|
|
150
|
+
var PLAN_EXTENSIONS = [".md", ".html"];
|
|
151
|
+
var scanPlanDir = (planDirPath, dirName, isArchive) => {
|
|
152
|
+
let entries;
|
|
153
|
+
try {
|
|
154
|
+
entries = fs2.readdirSync(planDirPath, { withFileTypes: true });
|
|
155
|
+
} catch (_err) {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
return entries.filter((e) => e.isFile() && PLAN_EXTENSIONS.some((ext) => e.name.endsWith(ext))).flatMap((e) => {
|
|
159
|
+
const filePath = path2.join(planDirPath, e.name);
|
|
160
|
+
try {
|
|
161
|
+
const content = fs2.readFileSync(filePath, "utf8");
|
|
162
|
+
const id = extractPlanId(content, filePath);
|
|
163
|
+
if (id === null) return [];
|
|
164
|
+
return [{ id, file: filePath, dir: planDirPath, isArchive, name: dirName }];
|
|
165
|
+
} catch (_err) {
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
var getAllPlans = (taskManagerRoot) => {
|
|
171
|
+
const sources = [
|
|
172
|
+
{ dir: path2.join(taskManagerRoot, "plans"), isArchive: false },
|
|
173
|
+
{ dir: path2.join(taskManagerRoot, "archive"), isArchive: true }
|
|
174
|
+
];
|
|
175
|
+
return sources.flatMap(({ dir, isArchive }) => {
|
|
176
|
+
if (!fs2.existsSync(dir)) return [];
|
|
177
|
+
let entries;
|
|
178
|
+
try {
|
|
179
|
+
entries = fs2.readdirSync(dir, { withFileTypes: true });
|
|
180
|
+
} catch (_err) {
|
|
181
|
+
return [];
|
|
182
|
+
}
|
|
183
|
+
return entries.filter((e) => e.isDirectory()).flatMap((e) => scanPlanDir(path2.join(dir, e.name), e.name, isArchive));
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// src/skill-scripts/shared/plan-resolve.ts
|
|
188
|
+
var fs3 = __toESM(require("fs"));
|
|
189
|
+
var path3 = __toESM(require("path"));
|
|
190
|
+
var isValidRootDir = (taskManagerPath) => {
|
|
191
|
+
try {
|
|
192
|
+
if (!fs3.existsSync(taskManagerPath)) return false;
|
|
193
|
+
if (!fs3.lstatSync(taskManagerPath).isDirectory()) return false;
|
|
194
|
+
const metadataPath = path3.join(taskManagerPath, ".init-metadata.json");
|
|
195
|
+
if (!fs3.existsSync(metadataPath)) return false;
|
|
196
|
+
const metadata = JSON.parse(fs3.readFileSync(metadataPath, "utf8"));
|
|
197
|
+
return metadata && typeof metadata === "object" && "version" in metadata;
|
|
198
|
+
} catch (_err) {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
var checkStandardRootShortcut = (filePath) => {
|
|
203
|
+
const planDir = path3.dirname(filePath);
|
|
204
|
+
const parentDir = path3.dirname(planDir);
|
|
205
|
+
const possibleRoot = path3.dirname(parentDir);
|
|
206
|
+
const parentBase = path3.basename(parentDir);
|
|
207
|
+
if (parentBase !== "plans" && parentBase !== "archive") return null;
|
|
208
|
+
if (path3.basename(possibleRoot) !== "task-manager") return null;
|
|
209
|
+
const dotAiDir = path3.dirname(possibleRoot);
|
|
210
|
+
if (path3.basename(dotAiDir) !== ".ai") return null;
|
|
211
|
+
return isValidRootDir(possibleRoot) ? possibleRoot : null;
|
|
212
|
+
};
|
|
213
|
+
var resolveByPath = (absolutePath) => {
|
|
214
|
+
let content;
|
|
215
|
+
try {
|
|
216
|
+
content = fs3.readFileSync(absolutePath, "utf8");
|
|
217
|
+
} catch (_err) {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
const planId = extractPlanId(content, absolutePath);
|
|
221
|
+
if (planId === null) return null;
|
|
222
|
+
const tmRoot = checkStandardRootShortcut(absolutePath) || findTaskManagerRoot(path3.dirname(absolutePath));
|
|
223
|
+
if (!tmRoot) return null;
|
|
224
|
+
return {
|
|
225
|
+
planFile: absolutePath,
|
|
226
|
+
planDir: path3.dirname(absolutePath),
|
|
227
|
+
taskManagerRoot: tmRoot,
|
|
228
|
+
planId
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
var resolveByIdInAncestry = (planId, startPath, searched = /* @__PURE__ */ new Set()) => {
|
|
232
|
+
const tmRoot = findTaskManagerRoot(startPath);
|
|
233
|
+
if (!tmRoot) return null;
|
|
234
|
+
const normalized = path3.normalize(tmRoot);
|
|
235
|
+
if (searched.has(normalized)) return null;
|
|
236
|
+
searched.add(normalized);
|
|
237
|
+
const plans = getAllPlans(tmRoot);
|
|
238
|
+
const match = plans.find((p) => p.id === planId);
|
|
239
|
+
if (match) {
|
|
240
|
+
return {
|
|
241
|
+
planFile: match.file,
|
|
242
|
+
planDir: match.dir,
|
|
243
|
+
taskManagerRoot: tmRoot,
|
|
244
|
+
planId
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
const parentOfRoot = path3.dirname(path3.dirname(tmRoot));
|
|
248
|
+
if (parentOfRoot === tmRoot) return null;
|
|
249
|
+
return resolveByIdInAncestry(planId, parentOfRoot, searched);
|
|
250
|
+
};
|
|
251
|
+
var resolvePlan = (input, startPath = process.cwd()) => {
|
|
252
|
+
if (input === null || input === void 0 || input === "") return null;
|
|
253
|
+
const inputStr = String(input);
|
|
254
|
+
if (inputStr.startsWith("/")) {
|
|
255
|
+
return resolveByPath(inputStr);
|
|
256
|
+
}
|
|
257
|
+
const planId = parseInt(inputStr, 10);
|
|
258
|
+
if (Number.isNaN(planId)) return null;
|
|
259
|
+
return resolveByIdInAncestry(planId, startPath);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
// src/skill-scripts/validate-plan-blueprint.ts
|
|
263
|
+
var VALID_FIELDS = [
|
|
264
|
+
"planFile",
|
|
265
|
+
"planDir",
|
|
266
|
+
"taskCount",
|
|
267
|
+
"blueprintExists",
|
|
268
|
+
"taskManagerRoot",
|
|
269
|
+
"planId"
|
|
270
|
+
];
|
|
271
|
+
var countTasks = (planDir) => {
|
|
272
|
+
const tasksDir = path4.join(planDir, "tasks");
|
|
273
|
+
if (!fs4.existsSync(tasksDir)) return 0;
|
|
274
|
+
try {
|
|
275
|
+
const stat = fs4.lstatSync(tasksDir);
|
|
276
|
+
if (!stat.isDirectory()) return 0;
|
|
277
|
+
return fs4.readdirSync(tasksDir).filter((f) => f.endsWith(".md")).length;
|
|
278
|
+
} catch (_err) {
|
|
279
|
+
return 0;
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
var checkBlueprintExists = (planFile) => {
|
|
283
|
+
try {
|
|
284
|
+
const content = fs4.readFileSync(planFile, "utf8");
|
|
285
|
+
return /^## Execution Blueprint/m.test(content);
|
|
286
|
+
} catch (_err) {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
var usage = () => {
|
|
291
|
+
const lines = [
|
|
292
|
+
"Plan ID or absolute path is required",
|
|
293
|
+
"",
|
|
294
|
+
"Usage: node validate-plan-blueprint.cjs <plan-id-or-path> [field-name]",
|
|
295
|
+
"",
|
|
296
|
+
"Examples:",
|
|
297
|
+
" node validate-plan-blueprint.cjs 47",
|
|
298
|
+
" node validate-plan-blueprint.cjs /path/to/plan.md",
|
|
299
|
+
" node validate-plan-blueprint.cjs 47 planFile",
|
|
300
|
+
" node validate-plan-blueprint.cjs 47 blueprintExists"
|
|
301
|
+
];
|
|
302
|
+
lines.forEach((l) => process.stderr.write(`[ERROR] ${l}
|
|
303
|
+
`));
|
|
304
|
+
};
|
|
305
|
+
var listAvailablePlans = (startPath) => {
|
|
306
|
+
const tmRoot = findTaskManagerRoot(startPath);
|
|
307
|
+
if (!tmRoot) return [];
|
|
308
|
+
const plans = getAllPlans(tmRoot);
|
|
309
|
+
return plans.map((p) => p.name).sort((a, b) => {
|
|
310
|
+
const aMatch = a.match(/^(\d+)--/);
|
|
311
|
+
const bMatch = b.match(/^(\d+)--/);
|
|
312
|
+
if (!aMatch || !bMatch || !aMatch[1] || !bMatch[1]) return 0;
|
|
313
|
+
return parseInt(aMatch[1], 10) - parseInt(bMatch[1], 10);
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
var main = () => {
|
|
317
|
+
const inputId = process.argv[2];
|
|
318
|
+
const fieldName = process.argv[3];
|
|
319
|
+
if (!inputId) {
|
|
320
|
+
usage();
|
|
321
|
+
process.exit(1);
|
|
322
|
+
}
|
|
323
|
+
const numericInput = parseInt(inputId, 10);
|
|
324
|
+
const isNumeric = !Number.isNaN(numericInput);
|
|
325
|
+
const isAbsolutePath = inputId.startsWith("/");
|
|
326
|
+
if (!isNumeric && !isAbsolutePath) {
|
|
327
|
+
process.stderr.write(`[ERROR] Invalid plan ID: "${inputId}" is not a valid number
|
|
328
|
+
`);
|
|
329
|
+
process.exit(1);
|
|
330
|
+
}
|
|
331
|
+
const resolved = resolvePlan(inputId);
|
|
332
|
+
if (!resolved) {
|
|
333
|
+
process.stderr.write(`[ERROR] Plan ID ${inputId} not found or invalid
|
|
334
|
+
`);
|
|
335
|
+
process.stderr.write("[ERROR] \n");
|
|
336
|
+
const available = listAvailablePlans(process.cwd());
|
|
337
|
+
if (available.length > 0) {
|
|
338
|
+
process.stderr.write("[ERROR] Available plans:\n");
|
|
339
|
+
available.forEach((name) => process.stderr.write(`[ERROR] ${name}
|
|
340
|
+
`));
|
|
341
|
+
}
|
|
342
|
+
process.exit(1);
|
|
343
|
+
}
|
|
344
|
+
const result = {
|
|
345
|
+
planFile: resolved.planFile,
|
|
346
|
+
planDir: resolved.planDir,
|
|
347
|
+
taskManagerRoot: resolved.taskManagerRoot,
|
|
348
|
+
planId: resolved.planId,
|
|
349
|
+
taskCount: countTasks(resolved.planDir),
|
|
350
|
+
blueprintExists: checkBlueprintExists(resolved.planFile) ? "yes" : "no"
|
|
351
|
+
};
|
|
352
|
+
if (fieldName) {
|
|
353
|
+
if (!VALID_FIELDS.includes(fieldName)) {
|
|
354
|
+
process.stderr.write(`[ERROR] Invalid field name: ${fieldName}
|
|
355
|
+
`);
|
|
356
|
+
process.stderr.write(`[ERROR] Valid fields: ${VALID_FIELDS.join(", ")}
|
|
357
|
+
`);
|
|
358
|
+
process.exit(1);
|
|
359
|
+
}
|
|
360
|
+
const value = result[fieldName];
|
|
361
|
+
process.stdout.write(`${String(value)}
|
|
362
|
+
`);
|
|
363
|
+
} else {
|
|
364
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
365
|
+
`);
|
|
366
|
+
}
|
|
367
|
+
process.exit(0);
|
|
368
|
+
};
|
|
369
|
+
if (require.main === module) {
|
|
370
|
+
main();
|
|
371
|
+
}
|
|
372
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
373
|
+
0 && (module.exports = {
|
|
374
|
+
main
|
|
375
|
+
});
|
package/dist/exec.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Exec Command Module
|
|
3
|
-
*
|
|
4
|
-
* Validates and executes multiple plans sequentially by spawning the `claude`
|
|
5
|
-
* CLI with streaming output. Performs pre-flight validation and auto-remediation
|
|
6
|
-
* before execution.
|
|
7
|
-
*/
|
|
8
|
-
import { CommandResult } from './types';
|
|
9
|
-
/**
|
|
10
|
-
* Main exec command: validate and execute multiple plans sequentially
|
|
11
|
-
*/
|
|
12
|
-
export declare function claudeExec(planIds: number[]): Promise<CommandResult>;
|
|
13
|
-
//# sourceMappingURL=exec.d.ts.map
|
package/dist/exec.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAyJxC;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAkH1E"}
|
package/dist/exec.js
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Claude Exec Command Module
|
|
4
|
-
*
|
|
5
|
-
* Validates and executes multiple plans sequentially by spawning the `claude`
|
|
6
|
-
* CLI with streaming output. Performs pre-flight validation and auto-remediation
|
|
7
|
-
* before execution.
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
-
}
|
|
15
|
-
Object.defineProperty(o, k2, desc);
|
|
16
|
-
}) : (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
o[k2] = m[k];
|
|
19
|
-
}));
|
|
20
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
-
}) : function(o, v) {
|
|
23
|
-
o["default"] = v;
|
|
24
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
-
var ownKeys = function(o) {
|
|
27
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
-
var ar = [];
|
|
29
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
return ownKeys(o);
|
|
33
|
-
};
|
|
34
|
-
return function (mod) {
|
|
35
|
-
if (mod && mod.__esModule) return mod;
|
|
36
|
-
var result = {};
|
|
37
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
-
__setModuleDefault(result, mod);
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
})();
|
|
42
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
43
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
44
|
-
};
|
|
45
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.claudeExec = claudeExec;
|
|
47
|
-
const child_process_1 = require("child_process");
|
|
48
|
-
const fs = __importStar(require("fs-extra"));
|
|
49
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
50
|
-
const plan_utils_1 = require("./plan-utils");
|
|
51
|
-
const status_1 = require("./status");
|
|
52
|
-
/**
|
|
53
|
-
* Check if a plan file contains an Execution Blueprint section
|
|
54
|
-
*/
|
|
55
|
-
async function hasBlueprintSection(filePath) {
|
|
56
|
-
const content = await fs.readFile(filePath, 'utf-8');
|
|
57
|
-
return /^## Execution Blueprint/m.test(content);
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Handle a single stream-json line from the claude CLI
|
|
61
|
-
*/
|
|
62
|
-
function handleStreamJsonLine(line, output) {
|
|
63
|
-
let msg;
|
|
64
|
-
try {
|
|
65
|
-
msg = JSON.parse(line);
|
|
66
|
-
}
|
|
67
|
-
catch {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (!msg || typeof msg !== 'object') {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const m = msg;
|
|
74
|
-
if (m.type === 'assistant' && m.message?.content) {
|
|
75
|
-
for (const block of m.message.content) {
|
|
76
|
-
if (block.type === 'text' && block.text) {
|
|
77
|
-
output.push(block.text);
|
|
78
|
-
process.stdout.write(chalk_1.default.gray(block.text));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
else if (m.type === 'result' && m.result) {
|
|
83
|
-
output.push(m.result);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Run a Claude Code command by spawning the `claude` CLI and streaming its output.
|
|
88
|
-
* Authentication is delegated to the CLI itself (stored session, keychain, or any
|
|
89
|
-
* env var the user has configured) — we do not require any auth variable here.
|
|
90
|
-
*/
|
|
91
|
-
async function runClaudeCommand(prompt, cwd) {
|
|
92
|
-
const args = [
|
|
93
|
-
'-p',
|
|
94
|
-
prompt,
|
|
95
|
-
'--output-format',
|
|
96
|
-
'stream-json',
|
|
97
|
-
'--verbose',
|
|
98
|
-
'--dangerously-skip-permissions',
|
|
99
|
-
];
|
|
100
|
-
return new Promise((resolve, reject) => {
|
|
101
|
-
const child = (0, child_process_1.spawn)('claude', args, {
|
|
102
|
-
cwd,
|
|
103
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
104
|
-
});
|
|
105
|
-
const output = [];
|
|
106
|
-
let stdoutBuf = '';
|
|
107
|
-
let stderrBuf = '';
|
|
108
|
-
child.stdout?.setEncoding('utf-8');
|
|
109
|
-
child.stdout?.on('data', (chunk) => {
|
|
110
|
-
stdoutBuf += chunk;
|
|
111
|
-
let idx = stdoutBuf.indexOf('\n');
|
|
112
|
-
while (idx >= 0) {
|
|
113
|
-
const line = stdoutBuf.slice(0, idx).trim();
|
|
114
|
-
stdoutBuf = stdoutBuf.slice(idx + 1);
|
|
115
|
-
if (line) {
|
|
116
|
-
handleStreamJsonLine(line, output);
|
|
117
|
-
}
|
|
118
|
-
idx = stdoutBuf.indexOf('\n');
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
child.stderr?.setEncoding('utf-8');
|
|
122
|
-
child.stderr?.on('data', (chunk) => {
|
|
123
|
-
stderrBuf += chunk;
|
|
124
|
-
process.stderr.write(chalk_1.default.gray(chunk));
|
|
125
|
-
});
|
|
126
|
-
child.on('error', err => {
|
|
127
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
128
|
-
if (err.code === 'ENOENT') {
|
|
129
|
-
reject(new Error(`Failed to spawn 'claude' CLI: command not found. Install Claude Code and ensure 'claude' is on PATH.`));
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
reject(new Error(`Failed to spawn 'claude' CLI: ${msg}`));
|
|
133
|
-
});
|
|
134
|
-
child.on('close', (code, signal) => {
|
|
135
|
-
if (stdoutBuf.trim()) {
|
|
136
|
-
handleStreamJsonLine(stdoutBuf.trim(), output);
|
|
137
|
-
stdoutBuf = '';
|
|
138
|
-
}
|
|
139
|
-
if (code === 0) {
|
|
140
|
-
resolve(output.join('\n'));
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
const reason = signal ? `signal ${signal}` : `exit code ${code}`;
|
|
144
|
-
const detail = stderrBuf.trim() ? `: ${stderrBuf.trim()}` : '';
|
|
145
|
-
reject(new Error(`claude CLI terminated with ${reason}${detail}`));
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Validate a single plan
|
|
151
|
-
*/
|
|
152
|
-
async function validatePlan(planId) {
|
|
153
|
-
const location = await (0, plan_utils_1.findPlanById)(planId);
|
|
154
|
-
if (!location) {
|
|
155
|
-
throw new Error(`Plan ${planId} not found`);
|
|
156
|
-
}
|
|
157
|
-
if (location.isArchived) {
|
|
158
|
-
throw new Error(`Plan ${planId} is archived and cannot be executed`);
|
|
159
|
-
}
|
|
160
|
-
const tasks = await (0, status_1.parseTaskFiles)(location.directoryPath);
|
|
161
|
-
const hasBlueprint = await hasBlueprintSection(location.filePath);
|
|
162
|
-
return {
|
|
163
|
-
planId,
|
|
164
|
-
location,
|
|
165
|
-
taskCount: tasks.length,
|
|
166
|
-
hasBlueprintSection: hasBlueprint,
|
|
167
|
-
needsRemediation: tasks.length === 0 || !hasBlueprint,
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Main exec command: validate and execute multiple plans sequentially
|
|
172
|
-
*/
|
|
173
|
-
async function claudeExec(planIds) {
|
|
174
|
-
const cwd = process.cwd();
|
|
175
|
-
if (planIds.length === 0) {
|
|
176
|
-
return {
|
|
177
|
-
success: false,
|
|
178
|
-
message: 'No plan IDs provided.',
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
console.log(chalk_1.default.bold(`\nValidating ${planIds.length} plan(s): ${planIds.join(', ')}\n`));
|
|
182
|
-
// Phase 1: Initial validation
|
|
183
|
-
const validations = [];
|
|
184
|
-
for (const planId of planIds) {
|
|
185
|
-
try {
|
|
186
|
-
const validation = await validatePlan(planId);
|
|
187
|
-
validations.push(validation);
|
|
188
|
-
const status = validation.needsRemediation
|
|
189
|
-
? chalk_1.default.yellow('needs remediation')
|
|
190
|
-
: chalk_1.default.green('ready');
|
|
191
|
-
console.log(` Plan ${planId}: ${status}`);
|
|
192
|
-
}
|
|
193
|
-
catch (error) {
|
|
194
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
195
|
-
console.error(chalk_1.default.red(` Plan ${planId}: ${msg}`));
|
|
196
|
-
return {
|
|
197
|
-
success: false,
|
|
198
|
-
message: msg,
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
// Phase 2: Auto-remediation for plans needing tasks/blueprint
|
|
203
|
-
const needsRemediation = validations.filter(v => v.needsRemediation);
|
|
204
|
-
if (needsRemediation.length > 0) {
|
|
205
|
-
const batchSize = 3;
|
|
206
|
-
const totalBatches = Math.ceil(needsRemediation.length / batchSize);
|
|
207
|
-
console.log(chalk_1.default.bold(`\nRemediating ${needsRemediation.length} plan(s) in batches of ${batchSize}...\n`));
|
|
208
|
-
for (let b = 0; b < totalBatches; b++) {
|
|
209
|
-
const batch = needsRemediation.slice(b * batchSize, (b + 1) * batchSize);
|
|
210
|
-
console.log(chalk_1.default.bold(` Batch ${b + 1}/${totalBatches}: plans ${batch.map(v => v.planId).join(', ')}`));
|
|
211
|
-
const results = await Promise.allSettled(batch.map(async (validation) => {
|
|
212
|
-
console.log(chalk_1.default.cyan(` Generating tasks for plan ${validation.planId}...`));
|
|
213
|
-
await runClaudeCommand(`/tasks:generate-tasks ${validation.planId}`, cwd);
|
|
214
|
-
// Re-validate after remediation
|
|
215
|
-
const revalidation = await validatePlan(validation.planId);
|
|
216
|
-
if (revalidation.taskCount === 0) {
|
|
217
|
-
throw new Error(`Plan ${validation.planId}: still has no tasks after remediation`);
|
|
218
|
-
}
|
|
219
|
-
if (!revalidation.hasBlueprintSection) {
|
|
220
|
-
throw new Error(`Plan ${validation.planId}: still missing Execution Blueprint section after remediation`);
|
|
221
|
-
}
|
|
222
|
-
console.log(chalk_1.default.green(` Plan ${validation.planId}: remediation successful`));
|
|
223
|
-
}));
|
|
224
|
-
// Check for failures in this batch
|
|
225
|
-
for (const result of results) {
|
|
226
|
-
if (result.status === 'rejected') {
|
|
227
|
-
const msg = result.reason instanceof Error ? result.reason.message : String(result.reason);
|
|
228
|
-
return {
|
|
229
|
-
success: false,
|
|
230
|
-
message: `Remediation failed: ${msg}`,
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
// Phase 3: Sequential execution
|
|
237
|
-
console.log(chalk_1.default.bold(`\nExecuting ${planIds.length} plan(s)...\n`));
|
|
238
|
-
for (let i = 0; i < planIds.length; i++) {
|
|
239
|
-
const planId = planIds[i];
|
|
240
|
-
console.log(chalk_1.default.cyan.bold(`\n[${i + 1}/${planIds.length}] Executing blueprint for plan ${planId}...\n`));
|
|
241
|
-
try {
|
|
242
|
-
await runClaudeCommand(`/tasks:execute-blueprint ${planId}`, cwd);
|
|
243
|
-
console.log(chalk_1.default.green(`\nPlan ${planId}: execution completed successfully`));
|
|
244
|
-
}
|
|
245
|
-
catch (error) {
|
|
246
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
247
|
-
return {
|
|
248
|
-
success: false,
|
|
249
|
-
message: `Execution failed for plan ${planId} (${i + 1}/${planIds.length}): ${msg}`,
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
const summary = `Successfully executed ${planIds.length} plan(s): ${planIds.join(', ')}`;
|
|
254
|
-
console.log(chalk_1.default.green.bold(`\n${summary}\n`));
|
|
255
|
-
return {
|
|
256
|
-
success: true,
|
|
257
|
-
message: summary,
|
|
258
|
-
data: { planIds },
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
//# sourceMappingURL=exec.js.map
|
package/dist/exec.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmKH,gCAkHC;AAnRD,iDAAsC;AACtC,6CAA+B;AAC/B,kDAA0B;AAC1B,6CAA0D;AAC1D,qCAA0C;AAW1C;;GAEG;AACH,KAAK,UAAU,mBAAmB,CAAC,QAAgB;IACjD,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrD,OAAO,0BAA0B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAAC,IAAY,EAAE,MAAgB;IAC1D,IAAI,GAAY,CAAC;IACjB,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;IACT,CAAC;IAED,IAAI,CAAC,GAAG,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