pm-orchestrator-runner 1.0.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/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/cli/cli-interface.d.ts +150 -0
- package/dist/cli/cli-interface.d.ts.map +1 -0
- package/dist/cli/cli-interface.js +606 -0
- package/dist/cli/cli-interface.js.map +1 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +243 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/llm-sentinel.d.ts +15 -0
- package/dist/cli/llm-sentinel.d.ts.map +1 -0
- package/dist/cli/llm-sentinel.js +184 -0
- package/dist/cli/llm-sentinel.js.map +1 -0
- package/dist/config/configuration-manager.d.ts +149 -0
- package/dist/config/configuration-manager.d.ts.map +1 -0
- package/dist/config/configuration-manager.js +241 -0
- package/dist/config/configuration-manager.js.map +1 -0
- package/dist/continuation/continuation-control-manager.d.ts +154 -0
- package/dist/continuation/continuation-control-manager.d.ts.map +1 -0
- package/dist/continuation/continuation-control-manager.js +303 -0
- package/dist/continuation/continuation-control-manager.js.map +1 -0
- package/dist/core/runner-core.d.ts +474 -0
- package/dist/core/runner-core.d.ts.map +1 -0
- package/dist/core/runner-core.js +1311 -0
- package/dist/core/runner-core.js.map +1 -0
- package/dist/errors/error-codes.d.ts +105 -0
- package/dist/errors/error-codes.d.ts.map +1 -0
- package/dist/errors/error-codes.js +198 -0
- package/dist/errors/error-codes.js.map +1 -0
- package/dist/errors/runner-error.d.ts +14 -0
- package/dist/errors/runner-error.d.ts.map +1 -0
- package/dist/errors/runner-error.js +33 -0
- package/dist/errors/runner-error.js.map +1 -0
- package/dist/evidence/evidence-manager.d.ts +112 -0
- package/dist/evidence/evidence-manager.d.ts.map +1 -0
- package/dist/evidence/evidence-manager.js +337 -0
- package/dist/evidence/evidence-manager.js.map +1 -0
- package/dist/executor/claude-code-executor.d.ts +136 -0
- package/dist/executor/claude-code-executor.d.ts.map +1 -0
- package/dist/executor/claude-code-executor.js +643 -0
- package/dist/executor/claude-code-executor.js.map +1 -0
- package/dist/executor/deterministic-executor.d.ts +40 -0
- package/dist/executor/deterministic-executor.d.ts.map +1 -0
- package/dist/executor/deterministic-executor.js +269 -0
- package/dist/executor/deterministic-executor.js.map +1 -0
- package/dist/lifecycle/lifecycle-controller.d.ts +270 -0
- package/dist/lifecycle/lifecycle-controller.d.ts.map +1 -0
- package/dist/lifecycle/lifecycle-controller.js +596 -0
- package/dist/lifecycle/lifecycle-controller.js.map +1 -0
- package/dist/limits/resource-limit-manager.d.ts +200 -0
- package/dist/limits/resource-limit-manager.d.ts.map +1 -0
- package/dist/limits/resource-limit-manager.js +376 -0
- package/dist/limits/resource-limit-manager.js.map +1 -0
- package/dist/locks/lock-manager.d.ts +116 -0
- package/dist/locks/lock-manager.d.ts.map +1 -0
- package/dist/locks/lock-manager.js +306 -0
- package/dist/locks/lock-manager.js.map +1 -0
- package/dist/logging/index.d.ts +8 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +22 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/sensitive-data-masker.d.ts +90 -0
- package/dist/logging/sensitive-data-masker.d.ts.map +1 -0
- package/dist/logging/sensitive-data-masker.js +228 -0
- package/dist/logging/sensitive-data-masker.js.map +1 -0
- package/dist/logging/task-log-manager.d.ts +215 -0
- package/dist/logging/task-log-manager.d.ts.map +1 -0
- package/dist/logging/task-log-manager.js +743 -0
- package/dist/logging/task-log-manager.js.map +1 -0
- package/dist/mediation/fail-closed-runner.d.ts +131 -0
- package/dist/mediation/fail-closed-runner.d.ts.map +1 -0
- package/dist/mediation/fail-closed-runner.js +245 -0
- package/dist/mediation/fail-closed-runner.js.map +1 -0
- package/dist/mediation/llm-client-with-evidence.d.ts +123 -0
- package/dist/mediation/llm-client-with-evidence.d.ts.map +1 -0
- package/dist/mediation/llm-client-with-evidence.js +245 -0
- package/dist/mediation/llm-client-with-evidence.js.map +1 -0
- package/dist/mediation/llm-client.d.ts +102 -0
- package/dist/mediation/llm-client.d.ts.map +1 -0
- package/dist/mediation/llm-client.js +206 -0
- package/dist/mediation/llm-client.js.map +1 -0
- package/dist/mediation/llm-evidence-manager.d.ts +108 -0
- package/dist/mediation/llm-evidence-manager.d.ts.map +1 -0
- package/dist/mediation/llm-evidence-manager.js +230 -0
- package/dist/mediation/llm-evidence-manager.js.map +1 -0
- package/dist/mediation/llm-mediation-layer.d.ts +175 -0
- package/dist/mediation/llm-mediation-layer.d.ts.map +1 -0
- package/dist/mediation/llm-mediation-layer.js +315 -0
- package/dist/mediation/llm-mediation-layer.js.map +1 -0
- package/dist/mediation/llm-sentinel.d.ts +107 -0
- package/dist/mediation/llm-sentinel.d.ts.map +1 -0
- package/dist/mediation/llm-sentinel.js +187 -0
- package/dist/mediation/llm-sentinel.js.map +1 -0
- package/dist/mediation/real-llm-mediation-layer.d.ts +104 -0
- package/dist/mediation/real-llm-mediation-layer.d.ts.map +1 -0
- package/dist/mediation/real-llm-mediation-layer.js +322 -0
- package/dist/mediation/real-llm-mediation-layer.js.map +1 -0
- package/dist/mediation/verdict-reporter.d.ts +61 -0
- package/dist/mediation/verdict-reporter.d.ts.map +1 -0
- package/dist/mediation/verdict-reporter.js +178 -0
- package/dist/mediation/verdict-reporter.js.map +1 -0
- package/dist/models/enums.d.ts +133 -0
- package/dist/models/enums.d.ts.map +1 -0
- package/dist/models/enums.js +201 -0
- package/dist/models/enums.js.map +1 -0
- package/dist/models/evidence.d.ts +60 -0
- package/dist/models/evidence.d.ts.map +1 -0
- package/dist/models/evidence.js +135 -0
- package/dist/models/evidence.js.map +1 -0
- package/dist/models/execution-result.d.ts +89 -0
- package/dist/models/execution-result.d.ts.map +1 -0
- package/dist/models/execution-result.js +197 -0
- package/dist/models/execution-result.js.map +1 -0
- package/dist/models/file-lock.d.ts +62 -0
- package/dist/models/file-lock.d.ts.map +1 -0
- package/dist/models/file-lock.js +133 -0
- package/dist/models/file-lock.js.map +1 -0
- package/dist/models/index.d.ts +12 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +91 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/repl/index.d.ts +7 -0
- package/dist/models/repl/index.d.ts.map +1 -0
- package/dist/models/repl/index.js +32 -0
- package/dist/models/repl/index.js.map +1 -0
- package/dist/models/repl/model-registry.d.ts +73 -0
- package/dist/models/repl/model-registry.d.ts.map +1 -0
- package/dist/models/repl/model-registry.js +116 -0
- package/dist/models/repl/model-registry.js.map +1 -0
- package/dist/models/repl/repl-state.d.ts +86 -0
- package/dist/models/repl/repl-state.d.ts.map +1 -0
- package/dist/models/repl/repl-state.js +152 -0
- package/dist/models/repl/repl-state.js.map +1 -0
- package/dist/models/repl/task-log.d.ts +247 -0
- package/dist/models/repl/task-log.d.ts.map +1 -0
- package/dist/models/repl/task-log.js +178 -0
- package/dist/models/repl/task-log.js.map +1 -0
- package/dist/models/session.d.ts +71 -0
- package/dist/models/session.d.ts.map +1 -0
- package/dist/models/session.js +140 -0
- package/dist/models/session.js.map +1 -0
- package/dist/models/supporting.d.ts +97 -0
- package/dist/models/supporting.d.ts.map +1 -0
- package/dist/models/supporting.js +208 -0
- package/dist/models/supporting.js.map +1 -0
- package/dist/models/task.d.ts +77 -0
- package/dist/models/task.d.ts.map +1 -0
- package/dist/models/task.js +170 -0
- package/dist/models/task.js.map +1 -0
- package/dist/output/output-control-manager.d.ts +217 -0
- package/dist/output/output-control-manager.d.ts.map +1 -0
- package/dist/output/output-control-manager.js +378 -0
- package/dist/output/output-control-manager.js.map +1 -0
- package/dist/pool/agent-pool.d.ts +284 -0
- package/dist/pool/agent-pool.d.ts.map +1 -0
- package/dist/pool/agent-pool.js +451 -0
- package/dist/pool/agent-pool.js.map +1 -0
- package/dist/repl/commands/index.d.ts +12 -0
- package/dist/repl/commands/index.d.ts.map +1 -0
- package/dist/repl/commands/index.js +26 -0
- package/dist/repl/commands/index.js.map +1 -0
- package/dist/repl/commands/init.d.ts +31 -0
- package/dist/repl/commands/init.d.ts.map +1 -0
- package/dist/repl/commands/init.js +234 -0
- package/dist/repl/commands/init.js.map +1 -0
- package/dist/repl/commands/keys.d.ts +63 -0
- package/dist/repl/commands/keys.d.ts.map +1 -0
- package/dist/repl/commands/keys.js +114 -0
- package/dist/repl/commands/keys.js.map +1 -0
- package/dist/repl/commands/logs.d.ts +91 -0
- package/dist/repl/commands/logs.d.ts.map +1 -0
- package/dist/repl/commands/logs.js +200 -0
- package/dist/repl/commands/logs.js.map +1 -0
- package/dist/repl/commands/model.d.ts +85 -0
- package/dist/repl/commands/model.d.ts.map +1 -0
- package/dist/repl/commands/model.js +225 -0
- package/dist/repl/commands/model.js.map +1 -0
- package/dist/repl/commands/models.d.ts +50 -0
- package/dist/repl/commands/models.d.ts.map +1 -0
- package/dist/repl/commands/models.js +180 -0
- package/dist/repl/commands/models.js.map +1 -0
- package/dist/repl/commands/provider.d.ts +79 -0
- package/dist/repl/commands/provider.d.ts.map +1 -0
- package/dist/repl/commands/provider.js +291 -0
- package/dist/repl/commands/provider.js.map +1 -0
- package/dist/repl/commands/session.d.ts +50 -0
- package/dist/repl/commands/session.d.ts.map +1 -0
- package/dist/repl/commands/session.js +152 -0
- package/dist/repl/commands/session.js.map +1 -0
- package/dist/repl/commands/status.d.ts +55 -0
- package/dist/repl/commands/status.d.ts.map +1 -0
- package/dist/repl/commands/status.js +182 -0
- package/dist/repl/commands/status.js.map +1 -0
- package/dist/repl/index.d.ts +6 -0
- package/dist/repl/index.d.ts.map +1 -0
- package/dist/repl/index.js +25 -0
- package/dist/repl/index.js.map +1 -0
- package/dist/repl/repl-interface.d.ts +371 -0
- package/dist/repl/repl-interface.d.ts.map +1 -0
- package/dist/repl/repl-interface.js +1214 -0
- package/dist/repl/repl-interface.js.map +1 -0
- package/dist/session/session-manager.d.ts +85 -0
- package/dist/session/session-manager.d.ts.map +1 -0
- package/dist/session/session-manager.js +217 -0
- package/dist/session/session-manager.js.map +1 -0
- package/dist/supervisor/executor-supervisor.d.ts +90 -0
- package/dist/supervisor/executor-supervisor.d.ts.map +1 -0
- package/dist/supervisor/executor-supervisor.js +223 -0
- package/dist/supervisor/executor-supervisor.js.map +1 -0
- package/dist/supervisor/index.d.ts +5 -0
- package/dist/supervisor/index.d.ts.map +1 -0
- package/dist/supervisor/index.js +9 -0
- package/dist/supervisor/index.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Claude Code Executor
|
|
4
|
+
*
|
|
5
|
+
* Executes tasks via Claude Code CLI subprocess.
|
|
6
|
+
* Per spec 04_COMPONENTS.md: L2 Executor must use Claude Code CLI for task execution.
|
|
7
|
+
* Per spec 10_REPL_UX.md Section 10: Non-interactive mode guarantees (Property 34-36).
|
|
8
|
+
*
|
|
9
|
+
* This is NOT a simulation - it actually spawns the `claude` CLI process.
|
|
10
|
+
*
|
|
11
|
+
* Timeout Design (v2 - Production Ready):
|
|
12
|
+
* - SOFT_TIMEOUT: Warning only, continue execution
|
|
13
|
+
* - HARD_TIMEOUT: No output for extended period, terminate
|
|
14
|
+
* - OVERALL_TIMEOUT: Total execution time limit
|
|
15
|
+
* - Process state monitoring: Check if process is still alive
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
34
|
+
var ownKeys = function(o) {
|
|
35
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
36
|
+
var ar = [];
|
|
37
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
38
|
+
return ar;
|
|
39
|
+
};
|
|
40
|
+
return ownKeys(o);
|
|
41
|
+
};
|
|
42
|
+
return function (mod) {
|
|
43
|
+
if (mod && mod.__esModule) return mod;
|
|
44
|
+
var result = {};
|
|
45
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
46
|
+
__setModuleDefault(result, mod);
|
|
47
|
+
return result;
|
|
48
|
+
};
|
|
49
|
+
})();
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.ClaudeCodeExecutor = void 0;
|
|
52
|
+
const child_process_1 = require("child_process");
|
|
53
|
+
const path = __importStar(require("path"));
|
|
54
|
+
const fs = __importStar(require("fs"));
|
|
55
|
+
/**
|
|
56
|
+
* Interactive prompt patterns for blocking detection
|
|
57
|
+
* Per spec 10_REPL_UX.md Section 10.1.1: Property 34 detection patterns
|
|
58
|
+
*
|
|
59
|
+
* Extended patterns for Claude Code CLI (v2):
|
|
60
|
+
* - Question marks at end of line
|
|
61
|
+
* - Yes/No confirmations
|
|
62
|
+
* - Press enter prompts
|
|
63
|
+
* - Waiting for input indicators
|
|
64
|
+
* - Permission prompts
|
|
65
|
+
* - API key prompts
|
|
66
|
+
*/
|
|
67
|
+
const INTERACTIVE_PROMPT_PATTERNS = [
|
|
68
|
+
/\?\s*$/m, // "? " at end of line
|
|
69
|
+
/\[Y\/n\]/i, // [Y/n] confirmation
|
|
70
|
+
/\(yes\/no\)/i, // (yes/no) confirmation
|
|
71
|
+
/\[y\/N\]/i, // [y/N] confirmation
|
|
72
|
+
/continue\?\s*$/mi, // "continue?" prompt
|
|
73
|
+
/press enter/i, // Press enter prompt
|
|
74
|
+
/waiting for input/i, // Waiting for input
|
|
75
|
+
/\(y\/n\)/i, // (y/n) confirmation
|
|
76
|
+
/\[yes\/no\]/i, // [yes/no] confirmation
|
|
77
|
+
/enter your/i, // Enter your... prompt
|
|
78
|
+
/provide.*key/i, // API key prompts
|
|
79
|
+
/paste.*key/i, // Paste key prompts
|
|
80
|
+
/permission.*required/i, // Permission prompts
|
|
81
|
+
/authorize/i, // Authorization prompts
|
|
82
|
+
/approve\?/i, // Approval prompts
|
|
83
|
+
/confirm\?/i, // Confirmation prompts
|
|
84
|
+
/select.*option/i, // Selection prompts
|
|
85
|
+
/choose.*:/i, // Choice prompts
|
|
86
|
+
/which.*\?/i, // Which... prompts
|
|
87
|
+
/would you like/i, // "Would you like..." prompts
|
|
88
|
+
/do you want/i, // "Do you want..." prompts
|
|
89
|
+
];
|
|
90
|
+
/**
|
|
91
|
+
* Timeout configuration (v2 - Production Ready)
|
|
92
|
+
*
|
|
93
|
+
* SOFT_TIMEOUT: Log warning but continue (Claude might be thinking)
|
|
94
|
+
* HARD_TIMEOUT: No output for extended period - likely stuck
|
|
95
|
+
* OVERALL_TIMEOUT: Total execution time limit
|
|
96
|
+
*
|
|
97
|
+
* Design principle: "Production first, safety second"
|
|
98
|
+
* - Small tasks (README) should complete within soft timeout
|
|
99
|
+
* - Complex tasks may exceed soft timeout but should show progress
|
|
100
|
+
* - Only terminate if truly stuck (no output for hard timeout period)
|
|
101
|
+
*/
|
|
102
|
+
const DEFAULT_SOFT_TIMEOUT_MS = 60000; // 60s - warning only
|
|
103
|
+
const DEFAULT_HARD_TIMEOUT_MS = 120000; // 120s no output - terminate
|
|
104
|
+
const DEFAULT_OVERALL_TIMEOUT_MS = 300000; // 5 min total
|
|
105
|
+
/**
|
|
106
|
+
* Grace period before force kill after SIGTERM
|
|
107
|
+
*/
|
|
108
|
+
const SIGTERM_GRACE_MS = 5000;
|
|
109
|
+
/**
|
|
110
|
+
* Process state check interval
|
|
111
|
+
*/
|
|
112
|
+
const PROCESS_CHECK_INTERVAL_MS = 1000;
|
|
113
|
+
/**
|
|
114
|
+
* Check if output contains interactive prompt patterns
|
|
115
|
+
*/
|
|
116
|
+
function containsInteractivePrompt(output) {
|
|
117
|
+
return INTERACTIVE_PROMPT_PATTERNS.some(pattern => pattern.test(output));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Claude Code Executor class
|
|
121
|
+
*
|
|
122
|
+
* Spawns Claude Code CLI to execute natural language tasks.
|
|
123
|
+
* Fail-closed: If CLI is not available, returns error status.
|
|
124
|
+
* Property 34-36: Detects blocking in non-interactive mode and terminates.
|
|
125
|
+
*
|
|
126
|
+
* v2 Improvements:
|
|
127
|
+
* - Two-stage timeout (soft/hard)
|
|
128
|
+
* - Process state monitoring
|
|
129
|
+
* - Extended interactive prompt detection
|
|
130
|
+
* - Better error recovery
|
|
131
|
+
*/
|
|
132
|
+
class ClaudeCodeExecutor {
|
|
133
|
+
config;
|
|
134
|
+
cliPath;
|
|
135
|
+
softTimeoutMs;
|
|
136
|
+
hardTimeoutMs;
|
|
137
|
+
constructor(config) {
|
|
138
|
+
this.config = config;
|
|
139
|
+
this.cliPath = config.cliPath || 'claude';
|
|
140
|
+
// Allow environment variable override for testing
|
|
141
|
+
const envSoft = parseInt(process.env.SOFT_TIMEOUT_MS || '', 10);
|
|
142
|
+
const envHard = parseInt(process.env.HARD_TIMEOUT_MS || '', 10);
|
|
143
|
+
this.softTimeoutMs = envSoft || config.softTimeoutMs || DEFAULT_SOFT_TIMEOUT_MS;
|
|
144
|
+
this.hardTimeoutMs = envHard || config.hardTimeoutMs || DEFAULT_HARD_TIMEOUT_MS;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Check if Claude Code CLI is available
|
|
148
|
+
*
|
|
149
|
+
* @returns true if CLI is available, false otherwise
|
|
150
|
+
*/
|
|
151
|
+
async isClaudeCodeAvailable() {
|
|
152
|
+
return new Promise((resolve) => {
|
|
153
|
+
try {
|
|
154
|
+
const childProcess = (0, child_process_1.spawn)(this.cliPath, ['--version'], {
|
|
155
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
156
|
+
timeout: 5000,
|
|
157
|
+
});
|
|
158
|
+
childProcess.on('close', (code) => {
|
|
159
|
+
resolve(code === 0);
|
|
160
|
+
});
|
|
161
|
+
childProcess.on('error', () => {
|
|
162
|
+
resolve(false);
|
|
163
|
+
});
|
|
164
|
+
// Handle timeout
|
|
165
|
+
setTimeout(() => {
|
|
166
|
+
childProcess.kill();
|
|
167
|
+
resolve(false);
|
|
168
|
+
}, 5000);
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
resolve(false);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Execute a task via Claude Code CLI
|
|
177
|
+
*
|
|
178
|
+
* Fail-closed behavior:
|
|
179
|
+
* - If CLI not available → error status
|
|
180
|
+
* - If no files modified → INCOMPLETE status
|
|
181
|
+
* - If timeout → error status
|
|
182
|
+
*
|
|
183
|
+
* v2 Timeout behavior:
|
|
184
|
+
* - Soft timeout: Warning only, continue execution
|
|
185
|
+
* - Hard timeout: No output for extended period, terminate
|
|
186
|
+
* - Overall timeout: Total execution time limit
|
|
187
|
+
*
|
|
188
|
+
* @param task - Task to execute
|
|
189
|
+
* @returns Execution result
|
|
190
|
+
*/
|
|
191
|
+
async execute(task) {
|
|
192
|
+
const startTime = Date.now();
|
|
193
|
+
// Enforce cwd = projectPath (never use process.cwd())
|
|
194
|
+
const cwd = task.workingDir;
|
|
195
|
+
// Check CLI availability first (fail-closed)
|
|
196
|
+
const available = await this.isClaudeCodeAvailable();
|
|
197
|
+
if (!available) {
|
|
198
|
+
return {
|
|
199
|
+
executed: false,
|
|
200
|
+
output: '',
|
|
201
|
+
error: `Claude Code CLI not available or not found at: ${this.cliPath}`,
|
|
202
|
+
files_modified: [],
|
|
203
|
+
duration_ms: Date.now() - startTime,
|
|
204
|
+
status: 'ERROR',
|
|
205
|
+
cwd,
|
|
206
|
+
verified_files: [],
|
|
207
|
+
unverified_files: [],
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
// Get list of files before execution (for diff)
|
|
211
|
+
const filesBefore = await this.listFiles(task.workingDir);
|
|
212
|
+
return new Promise((resolve) => {
|
|
213
|
+
let output = '';
|
|
214
|
+
let errorOutput = '';
|
|
215
|
+
let timedOut = false;
|
|
216
|
+
let blocked = false;
|
|
217
|
+
let blockedReason;
|
|
218
|
+
let terminatedBy;
|
|
219
|
+
let lastOutputTime = Date.now();
|
|
220
|
+
let softTimeoutWarned = false;
|
|
221
|
+
let resolved = false;
|
|
222
|
+
// Placeholder for child process (assigned after spawn)
|
|
223
|
+
let childProcess;
|
|
224
|
+
// Timer handles
|
|
225
|
+
let hardTimeoutHandle = null;
|
|
226
|
+
let overallTimeoutHandle = null;
|
|
227
|
+
let processCheckHandle = null;
|
|
228
|
+
// Progress log slot tracking (slot 0 = 5-15s, slot 1 = 15-25s, etc.)
|
|
229
|
+
let lastProgressSlot = -1;
|
|
230
|
+
// Helper to safely resolve (prevent double resolution)
|
|
231
|
+
const safeResolve = (result) => {
|
|
232
|
+
if (resolved)
|
|
233
|
+
return;
|
|
234
|
+
resolved = true;
|
|
235
|
+
clearAllTimers();
|
|
236
|
+
resolve(result);
|
|
237
|
+
};
|
|
238
|
+
// Helper to clear all timers
|
|
239
|
+
const clearAllTimers = () => {
|
|
240
|
+
if (hardTimeoutHandle) {
|
|
241
|
+
clearTimeout(hardTimeoutHandle);
|
|
242
|
+
hardTimeoutHandle = null;
|
|
243
|
+
}
|
|
244
|
+
if (overallTimeoutHandle) {
|
|
245
|
+
clearTimeout(overallTimeoutHandle);
|
|
246
|
+
overallTimeoutHandle = null;
|
|
247
|
+
}
|
|
248
|
+
if (processCheckHandle) {
|
|
249
|
+
clearInterval(processCheckHandle);
|
|
250
|
+
processCheckHandle = null;
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
// Helper to terminate process with blocking status
|
|
254
|
+
const terminateWithBlocking = (reason, terminator) => {
|
|
255
|
+
if (blocked || resolved)
|
|
256
|
+
return; // Already blocked or resolved
|
|
257
|
+
blocked = true;
|
|
258
|
+
blockedReason = reason;
|
|
259
|
+
terminatedBy = terminator;
|
|
260
|
+
console.log(`[ClaudeCodeExecutor] Terminating: reason=${reason}, by=${terminator}`);
|
|
261
|
+
if (childProcess && !childProcess.killed) {
|
|
262
|
+
childProcess.kill('SIGTERM');
|
|
263
|
+
// Force kill after grace period
|
|
264
|
+
setTimeout(() => {
|
|
265
|
+
if (childProcess && !childProcess.killed) {
|
|
266
|
+
console.log('[ClaudeCodeExecutor] Force killing with SIGKILL');
|
|
267
|
+
childProcess.kill('SIGKILL');
|
|
268
|
+
}
|
|
269
|
+
}, SIGTERM_GRACE_MS);
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
// Reset hard timeout on output (v2: only reset hard timeout, not soft)
|
|
273
|
+
const resetHardTimeout = () => {
|
|
274
|
+
lastOutputTime = Date.now();
|
|
275
|
+
// Clear existing hard timeout
|
|
276
|
+
if (hardTimeoutHandle) {
|
|
277
|
+
clearTimeout(hardTimeoutHandle);
|
|
278
|
+
}
|
|
279
|
+
// Set new hard timeout
|
|
280
|
+
hardTimeoutHandle = setTimeout(() => {
|
|
281
|
+
if (!blocked && !timedOut && !resolved) {
|
|
282
|
+
const elapsed = Date.now() - startTime;
|
|
283
|
+
console.log(`[ClaudeCodeExecutor] Hard timeout - no output for ${this.hardTimeoutMs}ms (total elapsed: ${elapsed}ms)`);
|
|
284
|
+
terminateWithBlocking('TIMEOUT', 'REPL_FAIL_CLOSED');
|
|
285
|
+
}
|
|
286
|
+
}, this.hardTimeoutMs);
|
|
287
|
+
// Check for soft timeout warning (only once)
|
|
288
|
+
if (!softTimeoutWarned) {
|
|
289
|
+
const timeSinceStart = Date.now() - startTime;
|
|
290
|
+
if (timeSinceStart > this.softTimeoutMs) {
|
|
291
|
+
softTimeoutWarned = true;
|
|
292
|
+
console.log(`[ClaudeCodeExecutor] Soft timeout warning - execution taking longer than ${this.softTimeoutMs}ms`);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
// Spawn Claude Code CLI with the task prompt
|
|
297
|
+
// Using --print flag for non-interactive output
|
|
298
|
+
// --tools enables Write/Edit/Read/Bash for file operations
|
|
299
|
+
// --no-session-persistence avoids session issues in non-interactive mode
|
|
300
|
+
//
|
|
301
|
+
// IMPORTANT: User prompt is passed as-is. Runner performs fail-closed
|
|
302
|
+
// verification AFTER execution (Property 8: Runner is sole completion authority).
|
|
303
|
+
// Claude Code output is untrusted until Runner verifies files exist on disk.
|
|
304
|
+
const cliArgs = [
|
|
305
|
+
'--print',
|
|
306
|
+
'--dangerously-skip-permissions',
|
|
307
|
+
'--tools', 'Write,Edit,Read,Bash',
|
|
308
|
+
'--no-session-persistence',
|
|
309
|
+
];
|
|
310
|
+
// Per spec 10_REPL_UX.md L117-118: Model selection is REPL-local
|
|
311
|
+
// Pass model to Claude Code CLI if specified (thin wrapper: no validation)
|
|
312
|
+
if (task.selectedModel) {
|
|
313
|
+
cliArgs.push('--model', task.selectedModel);
|
|
314
|
+
}
|
|
315
|
+
// Add prompt last (positional argument)
|
|
316
|
+
cliArgs.push(task.prompt);
|
|
317
|
+
// DEBUG: Log prompt and model sent to Claude Code
|
|
318
|
+
console.log('[ClaudeCodeExecutor] prompt:', task.prompt);
|
|
319
|
+
if (task.selectedModel) {
|
|
320
|
+
console.log('[ClaudeCodeExecutor] model:', task.selectedModel);
|
|
321
|
+
}
|
|
322
|
+
console.log(`[ClaudeCodeExecutor] Timeout config: soft=${this.softTimeoutMs}ms, hard=${this.hardTimeoutMs}ms, overall=${this.config.timeout}ms`);
|
|
323
|
+
try {
|
|
324
|
+
childProcess = (0, child_process_1.spawn)(this.cliPath, cliArgs, {
|
|
325
|
+
cwd: task.workingDir,
|
|
326
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
327
|
+
env: {
|
|
328
|
+
...process.env,
|
|
329
|
+
// Ensure non-interactive mode
|
|
330
|
+
CI: 'true',
|
|
331
|
+
// Disable color output for cleaner parsing
|
|
332
|
+
NO_COLOR: '1',
|
|
333
|
+
FORCE_COLOR: '0',
|
|
334
|
+
},
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
catch (spawnError) {
|
|
338
|
+
const err = spawnError;
|
|
339
|
+
console.log(`[ClaudeCodeExecutor] Spawn failed: ${err.message}`);
|
|
340
|
+
safeResolve({
|
|
341
|
+
executed: false,
|
|
342
|
+
output: '',
|
|
343
|
+
error: `Failed to spawn Claude Code CLI: ${err.message}`,
|
|
344
|
+
files_modified: [],
|
|
345
|
+
duration_ms: Date.now() - startTime,
|
|
346
|
+
status: 'ERROR',
|
|
347
|
+
cwd,
|
|
348
|
+
verified_files: [],
|
|
349
|
+
unverified_files: [],
|
|
350
|
+
});
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
// Start hard timeout monitoring
|
|
354
|
+
resetHardTimeout();
|
|
355
|
+
// Start overall timeout
|
|
356
|
+
overallTimeoutHandle = setTimeout(() => {
|
|
357
|
+
if (!blocked && !timedOut && !resolved) {
|
|
358
|
+
console.log(`[ClaudeCodeExecutor] Overall timeout - execution exceeded ${this.config.timeout}ms`);
|
|
359
|
+
timedOut = true;
|
|
360
|
+
terminateWithBlocking('TIMEOUT', 'TIMEOUT');
|
|
361
|
+
}
|
|
362
|
+
}, this.config.timeout);
|
|
363
|
+
// Start process state monitoring
|
|
364
|
+
processCheckHandle = setInterval(() => {
|
|
365
|
+
if (resolved || blocked || timedOut) {
|
|
366
|
+
if (processCheckHandle) {
|
|
367
|
+
clearInterval(processCheckHandle);
|
|
368
|
+
processCheckHandle = null;
|
|
369
|
+
}
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
// Check if process is still alive
|
|
373
|
+
if (childProcess.killed || childProcess.exitCode !== null) {
|
|
374
|
+
// Process has exited, stop monitoring
|
|
375
|
+
if (processCheckHandle) {
|
|
376
|
+
clearInterval(processCheckHandle);
|
|
377
|
+
processCheckHandle = null;
|
|
378
|
+
}
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
// Check time since last output
|
|
382
|
+
const silentTime = Date.now() - lastOutputTime;
|
|
383
|
+
const totalTime = Date.now() - startTime;
|
|
384
|
+
// Slot-based progress log to stderr (5s, 15s, 25s, ...)
|
|
385
|
+
// slot 0 = 5-15s, slot 1 = 15-25s, etc.
|
|
386
|
+
const FIRST_WARN_MS = 5000;
|
|
387
|
+
const SLOT_INTERVAL_MS = 10000;
|
|
388
|
+
if (silentTime >= FIRST_WARN_MS) {
|
|
389
|
+
const currentSlot = Math.floor((silentTime - FIRST_WARN_MS) / SLOT_INTERVAL_MS);
|
|
390
|
+
if (currentSlot > lastProgressSlot) {
|
|
391
|
+
lastProgressSlot = currentSlot;
|
|
392
|
+
process.stderr.write(`[executor] silent=${Math.round(silentTime / 1000)}s total=${Math.round(totalTime / 1000)}s\n`);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}, PROCESS_CHECK_INTERVAL_MS);
|
|
396
|
+
// CRITICAL: Close stdin immediately to signal no more input
|
|
397
|
+
// Without this, Claude Code CLI may wait indefinitely for input
|
|
398
|
+
if (childProcess.stdin) {
|
|
399
|
+
childProcess.stdin.end();
|
|
400
|
+
}
|
|
401
|
+
// Collect stdout and check for interactive prompts (Property 34)
|
|
402
|
+
childProcess.stdout?.on('data', (data) => {
|
|
403
|
+
const chunk = data.toString();
|
|
404
|
+
output += chunk;
|
|
405
|
+
// Reset hard timeout on any output
|
|
406
|
+
resetHardTimeout();
|
|
407
|
+
// Check for interactive prompt patterns (Property 34)
|
|
408
|
+
if (!blocked && containsInteractivePrompt(chunk)) {
|
|
409
|
+
console.log('[ClaudeCodeExecutor] Interactive prompt detected in chunk - terminating');
|
|
410
|
+
console.log('[ClaudeCodeExecutor] Detected chunk:', chunk.substring(0, 200));
|
|
411
|
+
terminateWithBlocking('INTERACTIVE_PROMPT', 'REPL_FAIL_CLOSED');
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
// Collect stderr
|
|
415
|
+
childProcess.stderr?.on('data', (data) => {
|
|
416
|
+
const chunk = data.toString();
|
|
417
|
+
errorOutput += chunk;
|
|
418
|
+
// Also reset hard timeout on stderr output (CLI is still producing output)
|
|
419
|
+
resetHardTimeout();
|
|
420
|
+
// Also check stderr for interactive prompts
|
|
421
|
+
if (!blocked && containsInteractivePrompt(chunk)) {
|
|
422
|
+
console.log('[ClaudeCodeExecutor] Interactive prompt detected in stderr - terminating');
|
|
423
|
+
terminateWithBlocking('INTERACTIVE_PROMPT', 'REPL_FAIL_CLOSED');
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
// Handle completion
|
|
427
|
+
childProcess.on('close', async (code) => {
|
|
428
|
+
const duration_ms = Date.now() - startTime;
|
|
429
|
+
console.log(`[ClaudeCodeExecutor] Process closed: code=${code}, duration=${duration_ms}ms, blocked=${blocked}, timedOut=${timedOut}`);
|
|
430
|
+
// Handle blocked case (Property 34-36)
|
|
431
|
+
if (blocked) {
|
|
432
|
+
safeResolve({
|
|
433
|
+
executed: false,
|
|
434
|
+
output,
|
|
435
|
+
error: `Executor blocked: ${blockedReason}`,
|
|
436
|
+
files_modified: [],
|
|
437
|
+
duration_ms,
|
|
438
|
+
status: 'BLOCKED',
|
|
439
|
+
cwd,
|
|
440
|
+
verified_files: [],
|
|
441
|
+
unverified_files: [],
|
|
442
|
+
executor_blocked: true,
|
|
443
|
+
blocked_reason: blockedReason,
|
|
444
|
+
timeout_ms: duration_ms,
|
|
445
|
+
terminated_by: terminatedBy,
|
|
446
|
+
});
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
if (timedOut) {
|
|
450
|
+
safeResolve({
|
|
451
|
+
executed: false,
|
|
452
|
+
output,
|
|
453
|
+
error: `Execution timed out after ${this.config.timeout}ms`,
|
|
454
|
+
files_modified: [],
|
|
455
|
+
duration_ms,
|
|
456
|
+
status: 'BLOCKED',
|
|
457
|
+
cwd,
|
|
458
|
+
verified_files: [],
|
|
459
|
+
unverified_files: [],
|
|
460
|
+
executor_blocked: true,
|
|
461
|
+
blocked_reason: 'TIMEOUT',
|
|
462
|
+
timeout_ms: duration_ms,
|
|
463
|
+
terminated_by: 'TIMEOUT',
|
|
464
|
+
});
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
// Get files after execution
|
|
468
|
+
const filesAfter = await this.listFiles(task.workingDir);
|
|
469
|
+
// Detect modified/created files
|
|
470
|
+
const files_modified = this.detectModifiedFiles(filesBefore, filesAfter, task.workingDir);
|
|
471
|
+
// Verify files actually exist (fail-closed verification)
|
|
472
|
+
// Per Property 8: verified_files is sole completion authority
|
|
473
|
+
const verified_files = [];
|
|
474
|
+
const unverified_files = [];
|
|
475
|
+
// Helper function to add a file to verified_files
|
|
476
|
+
const addVerifiedFile = (relPath, fullPath) => {
|
|
477
|
+
// Skip if already in verified_files
|
|
478
|
+
if (verified_files.some(vf => vf.path === relPath)) {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
try {
|
|
482
|
+
if (fs.existsSync(fullPath)) {
|
|
483
|
+
const stat = fs.statSync(fullPath);
|
|
484
|
+
let content_preview;
|
|
485
|
+
// Get preview for text files (first 100 chars)
|
|
486
|
+
if (stat.size < 10000) {
|
|
487
|
+
try {
|
|
488
|
+
const content = fs.readFileSync(fullPath, 'utf-8');
|
|
489
|
+
content_preview = content.substring(0, 100);
|
|
490
|
+
}
|
|
491
|
+
catch {
|
|
492
|
+
// Binary file or encoding issue
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
verified_files.push({
|
|
496
|
+
path: relPath,
|
|
497
|
+
exists: true,
|
|
498
|
+
size: stat.size,
|
|
499
|
+
content_preview,
|
|
500
|
+
});
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
503
|
+
return false;
|
|
504
|
+
}
|
|
505
|
+
catch {
|
|
506
|
+
return false;
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
// Step 1: Verify files from diff detection (files_modified)
|
|
510
|
+
for (const relPath of files_modified) {
|
|
511
|
+
const fullPath = path.join(cwd, relPath);
|
|
512
|
+
if (!addVerifiedFile(relPath, fullPath)) {
|
|
513
|
+
// File was detected as modified but doesn't exist (fail-closed)
|
|
514
|
+
unverified_files.push(relPath);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
// Step 2: Independent disk verification (Property 8)
|
|
518
|
+
// Scan for NEW files that weren't in filesBefore
|
|
519
|
+
// This handles timing issues where diff detection misses files
|
|
520
|
+
for (const [filePath] of filesAfter) {
|
|
521
|
+
// Only check files that are NEW (not in filesBefore)
|
|
522
|
+
if (!filesBefore.has(filePath)) {
|
|
523
|
+
const relPath = path.relative(cwd, filePath);
|
|
524
|
+
addVerifiedFile(relPath, filePath);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
// Determine status based on outcome (fail-closed)
|
|
528
|
+
// Per Property 8: verified_files is the sole completion authority
|
|
529
|
+
let status;
|
|
530
|
+
if (code !== 0) {
|
|
531
|
+
// Non-zero exit code indicates error
|
|
532
|
+
status = 'ERROR';
|
|
533
|
+
}
|
|
534
|
+
else if (unverified_files.length > 0) {
|
|
535
|
+
// Fail-closed: Some files claimed but don't exist
|
|
536
|
+
status = 'NO_EVIDENCE';
|
|
537
|
+
}
|
|
538
|
+
else if (verified_files.some(vf => vf.exists)) {
|
|
539
|
+
// Property 8: Runner's disk verification (verified_files) is the final authority
|
|
540
|
+
// If any verified file exists on disk, task is COMPLETE
|
|
541
|
+
status = 'COMPLETE';
|
|
542
|
+
}
|
|
543
|
+
else {
|
|
544
|
+
// Fail-closed: No verified files with exists=true
|
|
545
|
+
// But if exit code is 0 and we have output, it might have done something
|
|
546
|
+
// Check output for success indicators
|
|
547
|
+
if (output.includes('Created') || output.includes('Updated') || output.includes('Modified')) {
|
|
548
|
+
status = 'INCOMPLETE'; // Claimed success but no file evidence
|
|
549
|
+
}
|
|
550
|
+
else {
|
|
551
|
+
status = 'NO_EVIDENCE';
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
console.log(`[ClaudeCodeExecutor] Result: status=${status}, verified=${verified_files.length}, unverified=${unverified_files.length}`);
|
|
555
|
+
safeResolve({
|
|
556
|
+
executed: code === 0,
|
|
557
|
+
output,
|
|
558
|
+
error: errorOutput || undefined,
|
|
559
|
+
files_modified,
|
|
560
|
+
duration_ms,
|
|
561
|
+
status,
|
|
562
|
+
cwd,
|
|
563
|
+
verified_files,
|
|
564
|
+
unverified_files,
|
|
565
|
+
});
|
|
566
|
+
});
|
|
567
|
+
// Handle spawn errors
|
|
568
|
+
childProcess.on('error', (err) => {
|
|
569
|
+
console.log(`[ClaudeCodeExecutor] Process error: ${err.message}`);
|
|
570
|
+
safeResolve({
|
|
571
|
+
executed: false,
|
|
572
|
+
output: output || '',
|
|
573
|
+
error: err.message,
|
|
574
|
+
files_modified: [],
|
|
575
|
+
duration_ms: Date.now() - startTime,
|
|
576
|
+
status: 'ERROR',
|
|
577
|
+
cwd,
|
|
578
|
+
verified_files: [],
|
|
579
|
+
unverified_files: [],
|
|
580
|
+
});
|
|
581
|
+
});
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* List all files in a directory (recursively)
|
|
586
|
+
*/
|
|
587
|
+
async listFiles(dir) {
|
|
588
|
+
const files = new Map();
|
|
589
|
+
try {
|
|
590
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
591
|
+
for (const entry of entries) {
|
|
592
|
+
const fullPath = path.join(dir, entry.name);
|
|
593
|
+
// Skip hidden files and node_modules
|
|
594
|
+
if (entry.name.startsWith('.') || entry.name === 'node_modules') {
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
if (entry.isFile()) {
|
|
598
|
+
try {
|
|
599
|
+
const stat = fs.statSync(fullPath);
|
|
600
|
+
files.set(fullPath, {
|
|
601
|
+
mtime: stat.mtimeMs,
|
|
602
|
+
size: stat.size,
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
catch {
|
|
606
|
+
// File may have been deleted during scan
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
else if (entry.isDirectory()) {
|
|
610
|
+
const subFiles = await this.listFiles(fullPath);
|
|
611
|
+
for (const [key, value] of subFiles) {
|
|
612
|
+
files.set(key, value);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
catch {
|
|
618
|
+
// Directory may not exist or be inaccessible
|
|
619
|
+
}
|
|
620
|
+
return files;
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* Detect files that were modified or created
|
|
624
|
+
*/
|
|
625
|
+
detectModifiedFiles(before, after, baseDir) {
|
|
626
|
+
const modified = [];
|
|
627
|
+
for (const [filePath, afterStat] of after) {
|
|
628
|
+
const beforeStat = before.get(filePath);
|
|
629
|
+
// New file
|
|
630
|
+
if (!beforeStat) {
|
|
631
|
+
modified.push(path.relative(baseDir, filePath));
|
|
632
|
+
continue;
|
|
633
|
+
}
|
|
634
|
+
// Modified file (mtime or size changed)
|
|
635
|
+
if (beforeStat.mtime !== afterStat.mtime || beforeStat.size !== afterStat.size) {
|
|
636
|
+
modified.push(path.relative(baseDir, filePath));
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
return modified;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
exports.ClaudeCodeExecutor = ClaudeCodeExecutor;
|
|
643
|
+
//# sourceMappingURL=claude-code-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-code-executor.js","sourceRoot":"","sources":["../../src/executor/claude-code-executor.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iDAAoD;AACpD,2CAA6B;AAC7B,uCAAyB;AA6EzB;;;;;;;;;;;GAWG;AACH,MAAM,2BAA2B,GAAG;IAClC,SAAS,EAAqB,sBAAsB;IACpD,WAAW,EAAmB,qBAAqB;IACnD,cAAc,EAAgB,wBAAwB;IACtD,WAAW,EAAmB,qBAAqB;IACnD,kBAAkB,EAAY,qBAAqB;IACnD,cAAc,EAAgB,qBAAqB;IACnD,oBAAoB,EAAU,oBAAoB;IAClD,WAAW,EAAmB,qBAAqB;IACnD,cAAc,EAAgB,wBAAwB;IACtD,aAAa,EAAiB,uBAAuB;IACrD,eAAe,EAAe,kBAAkB;IAChD,aAAa,EAAiB,oBAAoB;IAClD,uBAAuB,EAAO,qBAAqB;IACnD,YAAY,EAAkB,wBAAwB;IACtD,YAAY,EAAkB,mBAAmB;IACjD,YAAY,EAAkB,uBAAuB;IACrD,iBAAiB,EAAa,oBAAoB;IAClD,YAAY,EAAkB,iBAAiB;IAC/C,YAAY,EAAkB,mBAAmB;IACjD,iBAAiB,EAAa,8BAA8B;IAC5D,cAAc,EAAgB,2BAA2B;CAC1D,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,uBAAuB,GAAG,KAAK,CAAC,CAAG,qBAAqB;AAC9D,MAAM,uBAAuB,GAAG,MAAM,CAAC,CAAE,6BAA6B;AACtE,MAAM,0BAA0B,GAAG,MAAM,CAAC,CAAC,cAAc;AAEzD;;GAEG;AACH,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B;;GAEG;AACH,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAEvC;;GAEG;AACH,SAAS,yBAAyB,CAAC,MAAc;IAC/C,OAAO,2BAA2B,CAAC,IAAI,CAAC,OAAO,CAAC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