@e0ipso/ai-task-manager 1.33.0 → 1.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/exec.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * Claude Exec Command Module
3
3
  *
4
- * Validates and executes multiple plans sequentially using the Claude Agent SDK.
5
- * Performs pre-flight validation and auto-remediation before execution.
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.
6
7
  */
7
8
  import { CommandResult } from './types';
8
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA+FxC;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CA2H1E"}
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 CHANGED
@@ -2,8 +2,9 @@
2
2
  /**
3
3
  * Claude Exec Command Module
4
4
  *
5
- * Validates and executes multiple plans sequentially using the Claude Agent SDK.
6
- * Performs pre-flight validation and auto-remediation before execution.
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.
7
8
  */
8
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
10
  if (k2 === undefined) k2 = k;
@@ -43,6 +44,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
43
44
  };
44
45
  Object.defineProperty(exports, "__esModule", { value: true });
45
46
  exports.claudeExec = claudeExec;
47
+ const child_process_1 = require("child_process");
46
48
  const fs = __importStar(require("fs-extra"));
47
49
  const chalk_1 = __importDefault(require("chalk"));
48
50
  const plan_utils_1 = require("./plan-utils");
@@ -55,48 +57,94 @@ async function hasBlueprintSection(filePath) {
55
57
  return /^## Execution Blueprint/m.test(content);
56
58
  }
57
59
  /**
58
- * Run a Claude Code command using the Agent SDK query function
60
+ * Handle a single stream-json line from the claude CLI
59
61
  */
60
- async function runClaudeCommand(prompt, cwd) {
61
- const oauthToken = process.env.CLAUDE_CODE_OAUTH_TOKEN;
62
- if (!oauthToken) {
63
- throw new Error('CLAUDE_CODE_OAUTH_TOKEN environment variable is required');
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);
64
84
  }
65
- // Dynamic import for ESM module from CommonJS context
66
- const { query } = await Promise.resolve().then(() => __importStar(require('@anthropic-ai/claude-agent-sdk')));
67
- const output = [];
68
- for await (const message of query({
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',
69
94
  prompt,
70
- options: {
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, {
71
102
  cwd,
72
- permissionMode: 'bypassPermissions',
73
- allowDangerouslySkipPermissions: true,
74
- settingSources: ['project', 'user'],
75
- env: {
76
- ...process.env,
77
- CLAUDE_CODE_OAUTH_TOKEN: oauthToken,
78
- },
79
- },
80
- })) {
81
- if (message.type === 'assistant') {
82
- const assistantMsg = message;
83
- if (assistantMsg.message?.content) {
84
- for (const block of assistantMsg.message.content) {
85
- if (block.type === 'text' && block.text) {
86
- output.push(block.text);
87
- process.stdout.write(chalk_1.default.gray(block.text));
88
- }
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);
89
117
  }
118
+ idx = stdoutBuf.indexOf('\n');
90
119
  }
91
- }
92
- else if (message.type === 'result') {
93
- const resultMsg = message;
94
- if (resultMsg.result) {
95
- output.push(resultMsg.result);
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;
96
131
  }
97
- }
98
- }
99
- return output.join('\n');
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
+ });
100
148
  }
101
149
  /**
102
150
  * Validate a single plan
@@ -124,13 +172,6 @@ async function validatePlan(planId) {
124
172
  */
125
173
  async function claudeExec(planIds) {
126
174
  const cwd = process.cwd();
127
- // Check for OAuth token early
128
- if (!process.env.CLAUDE_CODE_OAUTH_TOKEN) {
129
- return {
130
- success: false,
131
- message: 'CLAUDE_CODE_OAUTH_TOKEN environment variable is required. Set it before running claude-exec.',
132
- };
133
- }
134
175
  if (planIds.length === 0) {
135
176
  return {
136
177
  success: false,
package/dist/exec.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwGH,gCA2HC;AAjOD,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,KAAK,UAAU,gBAAgB,CAAC,MAAc,EAAE,GAAW;IACzD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IACvD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;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": "1.33.0",
3
+ "version": "1.35.0",
4
4
  "description": "Task management for AI coding assistants",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -53,7 +53,6 @@
53
53
  },
54
54
  "homepage": "https://github.com/e0ipso/ai-task-manager#readme",
55
55
  "dependencies": {
56
- "@anthropic-ai/claude-agent-sdk": "^0.2.70",
57
56
  "chalk": "^5.6.0",
58
57
  "commander": "^11.1.0",
59
58
  "diff": "^5.2.0",
@@ -1,7 +1,5 @@
1
1
  # POST_ERROR_DETECTION Hook
2
2
 
3
- This hook provides error handling procedures for task execution failures and validation gate failures.
4
-
5
3
  ## Task Execution Error Handling
6
4
 
7
5
  If task execution fails:
@@ -45,4 +43,4 @@ If validation gates fail:
45
43
  3. Generate remediation plan
46
44
  4. Re-execute affected tasks after fixes
47
45
  5. Re-run validation gates
48
- 6. If errors persist, escalate to the user
46
+ 6. If errors persist, escalate to the user
@@ -1,3 +1,5 @@
1
1
  # POST_PLAN Hook
2
2
 
3
- This hook provides validation and update procedures to execute after plan creation, ensuring comprehensive context analysis and proper plan document structuring with dependency visualization.
3
+ Ensure the plan includes a _Self Validation_ section describing the steps the LLM will take to validate that the plan was completed successfully.
4
+
5
+ Also, answer the question _Does this plan need to update the documentation, or the AGENTS.md_.
@@ -1,7 +1,5 @@
1
1
  # PRE_PHASE Hook
2
2
 
3
- This hook contains the phase preparation logic that should be executed before starting any phase execution.
4
-
5
3
  ## Phase Pre-Execution
6
4
 
7
5
  ### Feature Branch Creation
@@ -40,4 +38,4 @@ node $root/config/scripts/create-feature-branch.cjs $1
40
38
  done
41
39
  ```
42
40
  - Confirm no tasks are marked "needs-clarification"
43
- - If any phases are marked as completed, verify they are actually completed and continue from the next phase.
41
+ - If any phases are marked as completed, verify they are actually completed and continue from the next phase.
@@ -1,7 +1,5 @@
1
1
  # PRE_PLAN Hook
2
2
 
3
- This hook provides pre-planning guidance to ensure scope control, simplicity principles, and proper validation requirements are established before comprehensive plan creation.
4
-
5
3
  ## Scope Control Guidelines
6
4
 
7
5
  **Critical: Implement ONLY what is explicitly requested**
@@ -1,7 +1,5 @@
1
1
  # PRE_TASK_ASSIGNMENT Hook
2
2
 
3
- This hook executes before task assignment to determine the most appropriate agent for each task based on skill requirements and available sub-agents.
4
-
5
3
  ## Agent Selection and Task Assignment
6
4
 
7
5
  - For each task in the current phase:
@@ -0,0 +1 @@
1
+ # PRE_TASK_EXECUTION Hook
@@ -142,6 +142,9 @@ Read and execute $root/.ai/task-manager/config/hooks/PRE_TASK_ASSIGNMENT.md
142
142
 
143
143
  3. **Parallel Execution**
144
144
  - Deploy all selected agents simultaneously using your internal Task tool
145
+ - **Each agent MUST perform these steps in order:**
146
+ 1. Read and execute `$root/.ai/task-manager/config/hooks/PRE_TASK_EXECUTION.md` before starting any implementation work
147
+ 2. Execute the task according to its requirements
145
148
  - Monitor execution progress for each task
146
149
  - Capture outputs and artifacts from each agent
147
150
  - Update task status in real-time
@@ -53,7 +53,7 @@ Use your internal Todo task tool to track the execution of all parts of the task
53
53
 
54
54
  - [ ] Validate task: file, status (including needs-clarification), and dependencies.
55
55
  - [ ] Set task status to in-progress.
56
- - [ ] Execute the task.
56
+ - [ ] Execute the task (agent runs PRE_TASK_EXECUTION hook, then implements).
57
57
  - [ ] Update task status to completed or failed.
58
58
  - [ ] Document noteworthy events (if any).
59
59
  - [ ] Emit structured output for orchestrator.
@@ -253,10 +253,13 @@ Deploy the task using the Task tool with full context:
253
253
  - Required skills: `$task_skills`
254
254
  - Agent selection: Based on skills analysis or general-purpose agent
255
255
 
256
- Read the complete task file and execute according to its requirements. The task includes:
257
- - Objective and acceptance criteria
258
- - Technical requirements and implementation notes
259
- - Input dependencies and expected output artifacts
256
+ **The agent MUST perform these steps in order:**
257
+
258
+ 1. **Pre-flight validation**: Read and execute `$root/.ai/task-manager/config/hooks/PRE_TASK_EXECUTION.md` before starting any implementation work.
259
+ 2. **Execute the task**: Read the complete task file and implement according to its requirements, including:
260
+ - Objective and acceptance criteria
261
+ - Technical requirements and implementation notes
262
+ - Input dependencies and expected output artifacts
260
263
 
261
264
  ### 8. Post-Execution Status Management
262
265
 
@@ -83,6 +83,9 @@ Use your internal Todo task tool to track the workflow execution:
83
83
 
84
84
  Execute the following plan creation process:
85
85
 
86
+ For this step, think hard to create detailed, actionable plans based on the user input while
87
+ ensuring you have all necessary context before proceeding. Use the plan-creator sub-agent for this if it is available.
88
+
86
89
  Use tools for the planning. You are encouraged to write your own specialized tools to research, analyze, and debug
87
90
  any work order from the user. You are not restricted to the stack of the current project to create your own
88
91
  specialized tools.
@@ -747,6 +750,9 @@ Read and execute $root/.ai/task-manager/config/hooks/PRE_TASK_ASSIGNMENT.md
747
750
 
748
751
  3. **Parallel Execution**
749
752
  - Deploy all selected agents simultaneously using your internal Task tool
753
+ - **Each agent MUST perform these steps in order:**
754
+ 1. Read and execute `$root/.ai/task-manager/config/hooks/PRE_TASK_EXECUTION.md` before starting any implementation work
755
+ 2. Execute the task according to its requirements
750
756
  - Monitor execution progress for each task
751
757
  - Capture outputs and artifacts from each agent
752
758
  - Update task status in real-time