@anyi61/codex-claude-delegate-mcp 0.1.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 +262 -0
- package/dist/claude-cli.d.ts +84 -0
- package/dist/claude-cli.js +3123 -0
- package/dist/claude-cli.js.map +1 -0
- package/dist/cli.d.ts +61 -0
- package/dist/cli.js +334 -0
- package/dist/cli.js.map +1 -0
- package/dist/codex-config.d.ts +104 -0
- package/dist/codex-config.js +446 -0
- package/dist/codex-config.js.map +1 -0
- package/dist/guard.d.ts +27 -0
- package/dist/guard.js +229 -0
- package/dist/guard.js.map +1 -0
- package/dist/job-runner.d.ts +13 -0
- package/dist/job-runner.js +75 -0
- package/dist/job-runner.js.map +1 -0
- package/dist/jobs.d.ts +46 -0
- package/dist/jobs.js +175 -0
- package/dist/jobs.js.map +1 -0
- package/dist/package-info.d.ts +4 -0
- package/dist/package-info.js +14 -0
- package/dist/package-info.js.map +1 -0
- package/dist/schema.d.ts +779 -0
- package/dist/schema.js +325 -0
- package/dist/schema.js.map +1 -0
- package/dist/server.d.ts +1142 -0
- package/dist/server.js +693 -0
- package/dist/server.js.map +1 -0
- package/dist/session.d.ts +35 -0
- package/dist/session.js +109 -0
- package/dist/session.js.map +1 -0
- package/package.json +49 -0
- package/plugins/codex-claude-delegate/.codex-plugin/plugin.json +36 -0
- package/plugins/codex-claude-delegate/.mcp.json +9 -0
- package/plugins/codex-claude-delegate/hooks/hooks.json +16 -0
- package/plugins/codex-claude-delegate/hooks/review-gate-stop.mjs +66 -0
- package/plugins/codex-claude-delegate/server/job-runner.js +16999 -0
- package/plugins/codex-claude-delegate/server/server.js +28048 -0
- package/plugins/codex-claude-delegate/skills/claude-delegate.md +30 -0
- package/plugins/codex-claude-delegate/skills/claude-rescue.md +52 -0
- package/plugins/codex-claude-delegate/skills/claude-review.md +25 -0
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export type EnvStatus = "set" | "set-redacted" | "present-in-parent-stripped" | "unset";
|
|
4
|
+
export interface ClaudeStatusInput {
|
|
5
|
+
cwd: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ClaudeQueryInput {
|
|
8
|
+
task: string;
|
|
9
|
+
cwd: string;
|
|
10
|
+
instruction_files?: string[];
|
|
11
|
+
timeout_sec?: number;
|
|
12
|
+
max_turns?: number;
|
|
13
|
+
fast?: boolean;
|
|
14
|
+
resume?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ClaudeReviewInput {
|
|
17
|
+
task: string;
|
|
18
|
+
cwd: string;
|
|
19
|
+
diff?: string;
|
|
20
|
+
instruction_files?: string[];
|
|
21
|
+
files?: string[];
|
|
22
|
+
timeout_sec?: number;
|
|
23
|
+
max_turns?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ClaudeImplementInput {
|
|
26
|
+
task: string;
|
|
27
|
+
cwd: string;
|
|
28
|
+
instruction_files?: string[];
|
|
29
|
+
files?: string[];
|
|
30
|
+
constraints?: string[];
|
|
31
|
+
timeout_sec?: number;
|
|
32
|
+
max_turns?: number;
|
|
33
|
+
session_key?: string;
|
|
34
|
+
fork_session?: boolean;
|
|
35
|
+
resume_latest?: boolean;
|
|
36
|
+
max_cost_usd?: number;
|
|
37
|
+
max_changed_files?: number;
|
|
38
|
+
worktreeName?: string;
|
|
39
|
+
dirty_policy?: "ask" | "committed" | "snapshot";
|
|
40
|
+
}
|
|
41
|
+
export type ClaudeTaskMode = "auto" | "read" | "review" | "write";
|
|
42
|
+
export interface ClaudeTaskInput {
|
|
43
|
+
cwd: string;
|
|
44
|
+
task: string;
|
|
45
|
+
mode?: ClaudeTaskMode;
|
|
46
|
+
background?: boolean;
|
|
47
|
+
resume_latest?: boolean;
|
|
48
|
+
instruction_files?: string[];
|
|
49
|
+
/** @deprecated claude_task treats files as instruction_files, not apply scope. */
|
|
50
|
+
files?: string[];
|
|
51
|
+
constraints?: string[];
|
|
52
|
+
diff?: string;
|
|
53
|
+
timeout_sec?: number;
|
|
54
|
+
dirty_policy?: "ask" | "committed" | "snapshot";
|
|
55
|
+
}
|
|
56
|
+
export type BackgroundJobType = "query" | "review" | "implement" | "apply" | "cleanup";
|
|
57
|
+
export type BackgroundJobStatus = "queued" | "running" | "succeeded" | "failed" | "cancelled";
|
|
58
|
+
export type BackgroundJobStaleState = "fresh" | "stale_candidate" | "stale";
|
|
59
|
+
export interface BackgroundJobSummary {
|
|
60
|
+
job_id: string;
|
|
61
|
+
type: BackgroundJobType;
|
|
62
|
+
status: BackgroundJobStatus;
|
|
63
|
+
result_status?: RunLogStatus;
|
|
64
|
+
cwd: string;
|
|
65
|
+
created_at: string;
|
|
66
|
+
updated_at: string;
|
|
67
|
+
heartbeat_at?: string;
|
|
68
|
+
last_wait_at?: string;
|
|
69
|
+
last_wait_recommended_delay_ms?: number;
|
|
70
|
+
fingerprint?: string;
|
|
71
|
+
pid?: number;
|
|
72
|
+
run_id?: string;
|
|
73
|
+
worktree_name?: string;
|
|
74
|
+
summary?: string;
|
|
75
|
+
error?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface BackgroundJobEnqueueResult {
|
|
78
|
+
job: BackgroundJobSummary;
|
|
79
|
+
deduped?: boolean;
|
|
80
|
+
do_not_start_duplicate_job?: boolean;
|
|
81
|
+
message?: string;
|
|
82
|
+
next_actions?: WorkflowNextAction[];
|
|
83
|
+
}
|
|
84
|
+
export interface ClaudeJobsInput {
|
|
85
|
+
cwd: string;
|
|
86
|
+
limit?: number;
|
|
87
|
+
status?: BackgroundJobStatus;
|
|
88
|
+
type?: BackgroundJobType;
|
|
89
|
+
}
|
|
90
|
+
export interface ClaudeJobsResult {
|
|
91
|
+
entries: BackgroundJobSummary[];
|
|
92
|
+
}
|
|
93
|
+
export interface ClaudeJobResultInput {
|
|
94
|
+
cwd: string;
|
|
95
|
+
job_id: string;
|
|
96
|
+
}
|
|
97
|
+
export type ClaudeResultPrefer = "latest-job" | "latest-run" | "latest-implement" | "latest-review";
|
|
98
|
+
export interface ClaudeResultInput {
|
|
99
|
+
cwd: string;
|
|
100
|
+
job_id?: string;
|
|
101
|
+
run_id?: string;
|
|
102
|
+
prefer?: ClaudeResultPrefer;
|
|
103
|
+
}
|
|
104
|
+
export interface ClaudeJobWaitInput {
|
|
105
|
+
cwd: string;
|
|
106
|
+
job_id: string;
|
|
107
|
+
not_before?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ClaudeJobWaitResult {
|
|
110
|
+
job: BackgroundJobSummary;
|
|
111
|
+
result?: Record<string, unknown>;
|
|
112
|
+
status: BackgroundJobStatus;
|
|
113
|
+
summary: string;
|
|
114
|
+
waiting: boolean;
|
|
115
|
+
timed_out: boolean;
|
|
116
|
+
do_not_start_duplicate_job: boolean;
|
|
117
|
+
poll_too_soon?: boolean;
|
|
118
|
+
recommended_delay_ms?: number;
|
|
119
|
+
remaining_delay_ms?: number;
|
|
120
|
+
next_allowed_poll_at?: string;
|
|
121
|
+
age_ms: number;
|
|
122
|
+
heartbeat_age_ms?: number;
|
|
123
|
+
stale_state: BackgroundJobStaleState;
|
|
124
|
+
next_actions: WorkflowNextAction[];
|
|
125
|
+
}
|
|
126
|
+
export interface ClaudeJobCancelInput {
|
|
127
|
+
cwd: string;
|
|
128
|
+
job_id: string;
|
|
129
|
+
}
|
|
130
|
+
export interface ClaudeJobCleanupInput {
|
|
131
|
+
cwd: string;
|
|
132
|
+
older_than_hours?: number;
|
|
133
|
+
dry_run?: boolean;
|
|
134
|
+
limit?: number;
|
|
135
|
+
}
|
|
136
|
+
export interface BackgroundJobCleanupEntry {
|
|
137
|
+
job_id: string;
|
|
138
|
+
type: BackgroundJobType;
|
|
139
|
+
status: BackgroundJobStatus;
|
|
140
|
+
updated_at: string;
|
|
141
|
+
removed: boolean;
|
|
142
|
+
summary?: string;
|
|
143
|
+
error?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface ClaudeJobCleanupResult {
|
|
146
|
+
dry_run: boolean;
|
|
147
|
+
matched_count: number;
|
|
148
|
+
removed_count: number;
|
|
149
|
+
failed_count: number;
|
|
150
|
+
entries: BackgroundJobCleanupEntry[];
|
|
151
|
+
}
|
|
152
|
+
export interface WorkflowSessionSummary {
|
|
153
|
+
session_id: string;
|
|
154
|
+
type: "query" | "review" | "implement";
|
|
155
|
+
repo_path?: string;
|
|
156
|
+
last_used?: string;
|
|
157
|
+
use_count?: number;
|
|
158
|
+
summary?: string;
|
|
159
|
+
requested_session_id?: string | null;
|
|
160
|
+
returned_session_id?: string | null;
|
|
161
|
+
resumed?: boolean;
|
|
162
|
+
forked?: boolean;
|
|
163
|
+
source: "run" | "store";
|
|
164
|
+
}
|
|
165
|
+
export interface WorkflowNextAction {
|
|
166
|
+
tool: string;
|
|
167
|
+
reason: string;
|
|
168
|
+
args?: Record<string, unknown>;
|
|
169
|
+
}
|
|
170
|
+
export interface ClaudeResultResult {
|
|
171
|
+
source_type: "job" | "run";
|
|
172
|
+
summary: string;
|
|
173
|
+
job?: BackgroundJobSummary;
|
|
174
|
+
run?: RunLogEntrySummary;
|
|
175
|
+
session?: WorkflowSessionSummary;
|
|
176
|
+
result?: Record<string, unknown>;
|
|
177
|
+
related_runs?: {
|
|
178
|
+
apply_run_id?: string;
|
|
179
|
+
cleanup_run_id?: string;
|
|
180
|
+
};
|
|
181
|
+
do_not_start_duplicate_job?: boolean;
|
|
182
|
+
next_actions: WorkflowNextAction[];
|
|
183
|
+
}
|
|
184
|
+
export interface ClaudeWorkspaceStatusInput {
|
|
185
|
+
cwd: string;
|
|
186
|
+
limit?: number;
|
|
187
|
+
include_terminal?: boolean;
|
|
188
|
+
}
|
|
189
|
+
export interface ClaudeSetupInput {
|
|
190
|
+
cwd: string;
|
|
191
|
+
configure_allow_root?: boolean;
|
|
192
|
+
}
|
|
193
|
+
export type ClaudeReviewGateAction = "status" | "enable" | "disable";
|
|
194
|
+
export interface ClaudeReviewGateInput {
|
|
195
|
+
cwd: string;
|
|
196
|
+
action?: ClaudeReviewGateAction;
|
|
197
|
+
}
|
|
198
|
+
export interface DelegatedWorktreeSummary {
|
|
199
|
+
worktree_name: string;
|
|
200
|
+
worktree_path: string;
|
|
201
|
+
updated_at?: string;
|
|
202
|
+
stale: boolean;
|
|
203
|
+
orphaned?: boolean;
|
|
204
|
+
}
|
|
205
|
+
export interface WorkspaceAttentionItem {
|
|
206
|
+
kind: "queued_job" | "apply_blocked" | "stale_worktree" | "orphan_worktree";
|
|
207
|
+
severity: "info" | "warning";
|
|
208
|
+
message: string;
|
|
209
|
+
}
|
|
210
|
+
export interface ClaudeWorkspaceStatusResult {
|
|
211
|
+
workspace_root: string;
|
|
212
|
+
running_jobs: BackgroundJobSummary[];
|
|
213
|
+
queued_jobs: BackgroundJobSummary[];
|
|
214
|
+
recent_terminal_jobs: BackgroundJobSummary[];
|
|
215
|
+
recent_runs: RunLogEntrySummary[];
|
|
216
|
+
latest_sessions: WorkflowSessionSummary[];
|
|
217
|
+
delegated_worktrees: DelegatedWorktreeSummary[];
|
|
218
|
+
counts: {
|
|
219
|
+
running_jobs: number;
|
|
220
|
+
queued_jobs: number;
|
|
221
|
+
terminal_jobs: number;
|
|
222
|
+
recent_runs: number;
|
|
223
|
+
delegated_worktrees: number;
|
|
224
|
+
stale_worktrees: number;
|
|
225
|
+
orphan_worktrees: number;
|
|
226
|
+
apply_blocked_runs: number;
|
|
227
|
+
};
|
|
228
|
+
do_not_start_duplicate_job?: boolean;
|
|
229
|
+
next_actions?: WorkflowNextAction[];
|
|
230
|
+
attention_items: WorkspaceAttentionItem[];
|
|
231
|
+
}
|
|
232
|
+
export interface ReviewGateState {
|
|
233
|
+
workspace_root: string;
|
|
234
|
+
config_path: string;
|
|
235
|
+
hook_manifest_path: string;
|
|
236
|
+
hook_script_path: string;
|
|
237
|
+
hook_installed: boolean;
|
|
238
|
+
enabled: boolean;
|
|
239
|
+
mode: "soft-stop";
|
|
240
|
+
pending_review: boolean;
|
|
241
|
+
updated_at?: string;
|
|
242
|
+
last_write_at?: string;
|
|
243
|
+
last_review_at?: string;
|
|
244
|
+
}
|
|
245
|
+
export interface ClaudeReviewGateResult extends ReviewGateState {
|
|
246
|
+
action: ClaudeReviewGateAction;
|
|
247
|
+
changed: boolean;
|
|
248
|
+
summary: string;
|
|
249
|
+
next_steps: string[];
|
|
250
|
+
}
|
|
251
|
+
export interface ClaudeSetupResult {
|
|
252
|
+
workspace_root: string;
|
|
253
|
+
allow_root_configuration?: Record<string, unknown>;
|
|
254
|
+
review_gate: ReviewGateState;
|
|
255
|
+
claude_available: boolean;
|
|
256
|
+
claude_version: string | null;
|
|
257
|
+
auth_status: "ok" | "missing" | "unknown";
|
|
258
|
+
git_available: boolean;
|
|
259
|
+
worktree_capable: boolean;
|
|
260
|
+
cwd_valid: boolean;
|
|
261
|
+
cwd_is_git_repo: boolean;
|
|
262
|
+
errors: string[];
|
|
263
|
+
next_steps: string[];
|
|
264
|
+
}
|
|
265
|
+
export interface ClaudeTaskResult {
|
|
266
|
+
delegated_mode: Exclude<ClaudeTaskMode, "auto">;
|
|
267
|
+
summary: string;
|
|
268
|
+
job?: BackgroundJobSummary;
|
|
269
|
+
result?: Record<string, unknown>;
|
|
270
|
+
session?: WorkflowSessionSummary;
|
|
271
|
+
deduped?: boolean;
|
|
272
|
+
do_not_start_duplicate_job?: boolean;
|
|
273
|
+
warnings?: string[];
|
|
274
|
+
next_actions: WorkflowNextAction[];
|
|
275
|
+
}
|
|
276
|
+
export interface TestResult {
|
|
277
|
+
ran: boolean;
|
|
278
|
+
command?: string;
|
|
279
|
+
passed?: boolean;
|
|
280
|
+
output_tail?: string;
|
|
281
|
+
}
|
|
282
|
+
export interface ClaudeReport {
|
|
283
|
+
status: "success" | "failed" | "partial" | "needs_user";
|
|
284
|
+
summary: string;
|
|
285
|
+
changed_files: string[];
|
|
286
|
+
commands_run: string[];
|
|
287
|
+
tests: TestResult;
|
|
288
|
+
risks: string[];
|
|
289
|
+
next_steps: string[];
|
|
290
|
+
}
|
|
291
|
+
export interface ResourceLimits {
|
|
292
|
+
max_cost_usd?: number;
|
|
293
|
+
max_changed_files?: number;
|
|
294
|
+
actual_changed_files: number;
|
|
295
|
+
changed_files_exceeded: boolean;
|
|
296
|
+
warnings: string[];
|
|
297
|
+
}
|
|
298
|
+
export interface ObserveScope {
|
|
299
|
+
requested_files?: string[];
|
|
300
|
+
out_of_scope_files: string[];
|
|
301
|
+
scope_exceeded: boolean;
|
|
302
|
+
warnings: string[];
|
|
303
|
+
}
|
|
304
|
+
export interface ServerObserved {
|
|
305
|
+
repo_root?: string;
|
|
306
|
+
worktree_name?: string;
|
|
307
|
+
changed_files: string[];
|
|
308
|
+
diff_stat: string;
|
|
309
|
+
diff_name_only: string;
|
|
310
|
+
base_commit?: string;
|
|
311
|
+
head_commit?: string;
|
|
312
|
+
git_status_short?: string;
|
|
313
|
+
worktree_path?: string;
|
|
314
|
+
resource_limits?: ResourceLimits;
|
|
315
|
+
scope?: ObserveScope;
|
|
316
|
+
}
|
|
317
|
+
export interface ExecutionMetadata {
|
|
318
|
+
exit_code: number | null;
|
|
319
|
+
duration_ms: number;
|
|
320
|
+
timed_out: boolean;
|
|
321
|
+
stdout_tail: string;
|
|
322
|
+
stderr_tail: string;
|
|
323
|
+
timings?: Record<string, number>;
|
|
324
|
+
}
|
|
325
|
+
export interface ToolEnvelope<T> {
|
|
326
|
+
status: "success" | "failed" | "partial" | "needs_user";
|
|
327
|
+
data?: T;
|
|
328
|
+
claude_report?: unknown;
|
|
329
|
+
server_observed?: unknown;
|
|
330
|
+
execution: ExecutionMetadata;
|
|
331
|
+
warnings: string[];
|
|
332
|
+
}
|
|
333
|
+
export declare function localExecution(startTime: number): ExecutionMetadata;
|
|
334
|
+
export type ClaudeResult = ToolEnvelope<undefined>;
|
|
335
|
+
export interface EnvironmentDiagnostics {
|
|
336
|
+
proxy_env_present: boolean;
|
|
337
|
+
http_proxy: EnvStatus;
|
|
338
|
+
https_proxy: EnvStatus;
|
|
339
|
+
no_proxy: EnvStatus;
|
|
340
|
+
anthropic_base_url: EnvStatus;
|
|
341
|
+
anthropic_auth_token: EnvStatus;
|
|
342
|
+
anthropic_api_key: EnvStatus;
|
|
343
|
+
local_proxy_host?: string;
|
|
344
|
+
local_proxy_port?: number;
|
|
345
|
+
local_proxy_reachable?: boolean;
|
|
346
|
+
local_proxy_error?: string;
|
|
347
|
+
likely_sandbox_blocked: boolean;
|
|
348
|
+
recommendation?: string;
|
|
349
|
+
}
|
|
350
|
+
export interface ClaudeStatusResult {
|
|
351
|
+
claude_available: boolean;
|
|
352
|
+
claude_version: string | null;
|
|
353
|
+
auth_status: string | null;
|
|
354
|
+
git_available: boolean;
|
|
355
|
+
worktree_capable: boolean;
|
|
356
|
+
cwd_valid: boolean;
|
|
357
|
+
cwd_is_git_repo: boolean;
|
|
358
|
+
delegated_worktrees_count: number;
|
|
359
|
+
delegated_worktrees: string[];
|
|
360
|
+
stale_worktrees_count: number;
|
|
361
|
+
errors: string[];
|
|
362
|
+
environment_diagnostics?: EnvironmentDiagnostics;
|
|
363
|
+
recent_runs?: RecentRunsSummary;
|
|
364
|
+
}
|
|
365
|
+
export interface SessionLog {
|
|
366
|
+
requested_session_id: string | null;
|
|
367
|
+
resumed: boolean;
|
|
368
|
+
forked: boolean;
|
|
369
|
+
returned_session_id: string | null;
|
|
370
|
+
}
|
|
371
|
+
export interface ClaudeApplyInput {
|
|
372
|
+
cwd: string;
|
|
373
|
+
worktree_path: string;
|
|
374
|
+
cleanup?: boolean;
|
|
375
|
+
preview?: boolean;
|
|
376
|
+
background?: boolean;
|
|
377
|
+
confirmed_by_user?: boolean;
|
|
378
|
+
}
|
|
379
|
+
export interface ApplyPlannedChange {
|
|
380
|
+
status: string;
|
|
381
|
+
file: string;
|
|
382
|
+
}
|
|
383
|
+
export interface ClaudeApplyResult {
|
|
384
|
+
applied_files: string[];
|
|
385
|
+
diff_stat: string;
|
|
386
|
+
cleanup_performed: boolean;
|
|
387
|
+
conflicts: string[];
|
|
388
|
+
error?: string;
|
|
389
|
+
preview?: boolean;
|
|
390
|
+
planned_changes?: ApplyPlannedChange[];
|
|
391
|
+
}
|
|
392
|
+
export interface ClaudeCleanupInput {
|
|
393
|
+
cwd: string;
|
|
394
|
+
older_than_hours?: number;
|
|
395
|
+
dry_run?: boolean;
|
|
396
|
+
background?: boolean;
|
|
397
|
+
}
|
|
398
|
+
export interface CleanupEntry {
|
|
399
|
+
worktree_name: string;
|
|
400
|
+
removed: boolean;
|
|
401
|
+
error?: string;
|
|
402
|
+
}
|
|
403
|
+
export interface ClaudeCleanupResult {
|
|
404
|
+
dry_run: boolean;
|
|
405
|
+
removed_count: number;
|
|
406
|
+
failed_count: number;
|
|
407
|
+
entries: CleanupEntry[];
|
|
408
|
+
}
|
|
409
|
+
export type RunLogType = "query" | "review" | "implement" | "apply" | "cleanup";
|
|
410
|
+
export type RunLogStatus = "success" | "failed" | "partial" | "needs_user" | "unknown";
|
|
411
|
+
export type RunLifecycle = "queued" | "running" | "success" | "partial" | "failed" | "apply_blocked" | "applied" | "cleaned" | "unknown";
|
|
412
|
+
export interface ClaudeRunsInput {
|
|
413
|
+
cwd: string;
|
|
414
|
+
limit?: number;
|
|
415
|
+
type?: RunLogType;
|
|
416
|
+
status?: RunLogStatus;
|
|
417
|
+
worktree_name?: string;
|
|
418
|
+
}
|
|
419
|
+
export interface ClaudeRunInspectInput {
|
|
420
|
+
cwd: string;
|
|
421
|
+
run_id: string;
|
|
422
|
+
}
|
|
423
|
+
export interface RunLogEntrySummary {
|
|
424
|
+
run_id: string;
|
|
425
|
+
type: string;
|
|
426
|
+
status: RunLogStatus;
|
|
427
|
+
lifecycle: RunLifecycle;
|
|
428
|
+
cwd?: string;
|
|
429
|
+
summary?: string;
|
|
430
|
+
error?: string;
|
|
431
|
+
worktree_path?: string;
|
|
432
|
+
worktree_name?: string;
|
|
433
|
+
requested_session_id?: string | null;
|
|
434
|
+
returned_session_id?: string | null;
|
|
435
|
+
retried_after_session_expired?: boolean;
|
|
436
|
+
started_at?: string;
|
|
437
|
+
updated_at?: string;
|
|
438
|
+
}
|
|
439
|
+
export interface ClaudeRunsResult {
|
|
440
|
+
entries: RunLogEntrySummary[];
|
|
441
|
+
total_entries: number;
|
|
442
|
+
}
|
|
443
|
+
export interface ClaudeRunInspectResult {
|
|
444
|
+
entry: RunLogEntrySummary;
|
|
445
|
+
raw: Record<string, unknown>;
|
|
446
|
+
related_runs?: {
|
|
447
|
+
apply_run_id?: string;
|
|
448
|
+
cleanup_run_id?: string;
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
export interface RunSummaryCounts {
|
|
452
|
+
[key: string]: number;
|
|
453
|
+
}
|
|
454
|
+
export interface RecentRunsSummary {
|
|
455
|
+
entries: RunLogEntrySummary[];
|
|
456
|
+
lifecycle_counts: RunSummaryCounts;
|
|
457
|
+
}
|
|
458
|
+
export declare const claudeStatusInputSchema: z.ZodObject<{
|
|
459
|
+
cwd: z.ZodString;
|
|
460
|
+
}, z.core.$strip>;
|
|
461
|
+
export declare const claudeSetupInputSchema: z.ZodObject<{
|
|
462
|
+
cwd: z.ZodString;
|
|
463
|
+
configure_allow_root: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
464
|
+
}, z.core.$strip>;
|
|
465
|
+
export declare const claudeQueryInputSchema: z.ZodObject<{
|
|
466
|
+
task: z.ZodString;
|
|
467
|
+
cwd: z.ZodString;
|
|
468
|
+
instruction_files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
469
|
+
timeout_sec: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
470
|
+
max_turns: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
471
|
+
fast: z.ZodOptional<z.ZodBoolean>;
|
|
472
|
+
resume: z.ZodOptional<z.ZodBoolean>;
|
|
473
|
+
}, z.core.$strip>;
|
|
474
|
+
export declare const claudeReviewInputSchema: z.ZodObject<{
|
|
475
|
+
task: z.ZodString;
|
|
476
|
+
cwd: z.ZodString;
|
|
477
|
+
diff: z.ZodOptional<z.ZodString>;
|
|
478
|
+
instruction_files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
479
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
480
|
+
timeout_sec: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
481
|
+
max_turns: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
482
|
+
}, z.core.$strip>;
|
|
483
|
+
export declare const claudeImplementInputSchema: z.ZodObject<{
|
|
484
|
+
task: z.ZodString;
|
|
485
|
+
cwd: z.ZodString;
|
|
486
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
487
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
488
|
+
timeout_sec: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
489
|
+
max_turns: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
490
|
+
session_key: z.ZodOptional<z.ZodString>;
|
|
491
|
+
fork_session: z.ZodOptional<z.ZodBoolean>;
|
|
492
|
+
resume_latest: z.ZodOptional<z.ZodBoolean>;
|
|
493
|
+
max_cost_usd: z.ZodOptional<z.ZodNumber>;
|
|
494
|
+
max_changed_files: z.ZodOptional<z.ZodNumber>;
|
|
495
|
+
worktreeName: z.ZodOptional<z.ZodString>;
|
|
496
|
+
dirty_policy: z.ZodOptional<z.ZodEnum<{
|
|
497
|
+
ask: "ask";
|
|
498
|
+
committed: "committed";
|
|
499
|
+
snapshot: "snapshot";
|
|
500
|
+
}>>;
|
|
501
|
+
}, z.core.$strip>;
|
|
502
|
+
export declare const claudeTaskInputSchema: z.ZodObject<{
|
|
503
|
+
cwd: z.ZodString;
|
|
504
|
+
task: z.ZodString;
|
|
505
|
+
mode: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
506
|
+
auto: "auto";
|
|
507
|
+
read: "read";
|
|
508
|
+
review: "review";
|
|
509
|
+
write: "write";
|
|
510
|
+
}>>>;
|
|
511
|
+
background: z.ZodOptional<z.ZodBoolean>;
|
|
512
|
+
resume_latest: z.ZodOptional<z.ZodBoolean>;
|
|
513
|
+
instruction_files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
514
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
515
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
516
|
+
diff: z.ZodOptional<z.ZodString>;
|
|
517
|
+
timeout_sec: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
518
|
+
dirty_policy: z.ZodOptional<z.ZodEnum<{
|
|
519
|
+
ask: "ask";
|
|
520
|
+
committed: "committed";
|
|
521
|
+
snapshot: "snapshot";
|
|
522
|
+
}>>;
|
|
523
|
+
}, z.core.$strip>;
|
|
524
|
+
export declare const claudeApplyInputSchema: z.ZodObject<{
|
|
525
|
+
cwd: z.ZodString;
|
|
526
|
+
worktree_path: z.ZodString;
|
|
527
|
+
cleanup: z.ZodOptional<z.ZodBoolean>;
|
|
528
|
+
preview: z.ZodOptional<z.ZodBoolean>;
|
|
529
|
+
background: z.ZodOptional<z.ZodBoolean>;
|
|
530
|
+
confirmed_by_user: z.ZodOptional<z.ZodBoolean>;
|
|
531
|
+
}, z.core.$strip>;
|
|
532
|
+
export declare const claudeCleanupInputSchema: z.ZodObject<{
|
|
533
|
+
cwd: z.ZodString;
|
|
534
|
+
older_than_hours: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
535
|
+
dry_run: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
536
|
+
background: z.ZodOptional<z.ZodBoolean>;
|
|
537
|
+
}, z.core.$strip>;
|
|
538
|
+
export declare const claudeRunsInputSchema: z.ZodObject<{
|
|
539
|
+
cwd: z.ZodString;
|
|
540
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
541
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
542
|
+
review: "review";
|
|
543
|
+
query: "query";
|
|
544
|
+
implement: "implement";
|
|
545
|
+
apply: "apply";
|
|
546
|
+
cleanup: "cleanup";
|
|
547
|
+
}>>;
|
|
548
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
549
|
+
failed: "failed";
|
|
550
|
+
success: "success";
|
|
551
|
+
partial: "partial";
|
|
552
|
+
needs_user: "needs_user";
|
|
553
|
+
unknown: "unknown";
|
|
554
|
+
}>>;
|
|
555
|
+
worktree_name: z.ZodOptional<z.ZodString>;
|
|
556
|
+
}, z.core.$strip>;
|
|
557
|
+
export declare const claudeRunInspectInputSchema: z.ZodObject<{
|
|
558
|
+
cwd: z.ZodString;
|
|
559
|
+
run_id: z.ZodString;
|
|
560
|
+
}, z.core.$strip>;
|
|
561
|
+
export declare const claudeJobsInputSchema: z.ZodObject<{
|
|
562
|
+
cwd: z.ZodString;
|
|
563
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
564
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
565
|
+
queued: "queued";
|
|
566
|
+
running: "running";
|
|
567
|
+
succeeded: "succeeded";
|
|
568
|
+
failed: "failed";
|
|
569
|
+
cancelled: "cancelled";
|
|
570
|
+
}>>;
|
|
571
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
572
|
+
review: "review";
|
|
573
|
+
query: "query";
|
|
574
|
+
implement: "implement";
|
|
575
|
+
apply: "apply";
|
|
576
|
+
cleanup: "cleanup";
|
|
577
|
+
}>>;
|
|
578
|
+
}, z.core.$strip>;
|
|
579
|
+
export declare const claudeJobResultInputSchema: z.ZodObject<{
|
|
580
|
+
cwd: z.ZodString;
|
|
581
|
+
job_id: z.ZodString;
|
|
582
|
+
}, z.core.$strip>;
|
|
583
|
+
export declare const claudeResultInputSchema: z.ZodObject<{
|
|
584
|
+
cwd: z.ZodString;
|
|
585
|
+
job_id: z.ZodOptional<z.ZodString>;
|
|
586
|
+
run_id: z.ZodOptional<z.ZodString>;
|
|
587
|
+
prefer: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
588
|
+
"latest-job": "latest-job";
|
|
589
|
+
"latest-run": "latest-run";
|
|
590
|
+
"latest-implement": "latest-implement";
|
|
591
|
+
"latest-review": "latest-review";
|
|
592
|
+
}>>>;
|
|
593
|
+
}, z.core.$strip>;
|
|
594
|
+
export declare const claudeJobWaitInputSchema: z.ZodObject<{
|
|
595
|
+
cwd: z.ZodString;
|
|
596
|
+
job_id: z.ZodString;
|
|
597
|
+
not_before: z.ZodOptional<z.ZodString>;
|
|
598
|
+
}, z.core.$strict>;
|
|
599
|
+
export declare const claudeJobCancelInputSchema: z.ZodObject<{
|
|
600
|
+
cwd: z.ZodString;
|
|
601
|
+
job_id: z.ZodString;
|
|
602
|
+
}, z.core.$strip>;
|
|
603
|
+
export declare const claudeJobCleanupInputSchema: z.ZodObject<{
|
|
604
|
+
cwd: z.ZodString;
|
|
605
|
+
older_than_hours: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
606
|
+
dry_run: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
607
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
608
|
+
}, z.core.$strip>;
|
|
609
|
+
export declare const claudeWorkspaceStatusInputSchema: z.ZodObject<{
|
|
610
|
+
cwd: z.ZodString;
|
|
611
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
612
|
+
include_terminal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
613
|
+
}, z.core.$strip>;
|
|
614
|
+
export declare const claudeReviewGateInputSchema: z.ZodObject<{
|
|
615
|
+
cwd: z.ZodString;
|
|
616
|
+
action: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
617
|
+
status: "status";
|
|
618
|
+
enable: "enable";
|
|
619
|
+
disable: "disable";
|
|
620
|
+
}>>>;
|
|
621
|
+
}, z.core.$strip>;
|
|
622
|
+
export declare function validationErrorMessage(err: unknown): string;
|
|
623
|
+
export declare const QUERY_SCHEMA: {
|
|
624
|
+
readonly type: "object";
|
|
625
|
+
readonly required: readonly ["answer"];
|
|
626
|
+
readonly properties: {
|
|
627
|
+
readonly answer: {
|
|
628
|
+
readonly type: "string";
|
|
629
|
+
readonly description: "The full, detailed answer to the question. Include all relevant information.";
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
};
|
|
633
|
+
export declare const REVIEW_SCHEMA: {
|
|
634
|
+
readonly type: "object";
|
|
635
|
+
readonly required: readonly ["findings", "recommendations", "severity"];
|
|
636
|
+
readonly properties: {
|
|
637
|
+
readonly findings: {
|
|
638
|
+
readonly type: "string";
|
|
639
|
+
readonly description: "Detailed review findings: bugs, design issues, security concerns, performance problems.";
|
|
640
|
+
};
|
|
641
|
+
readonly recommendations: {
|
|
642
|
+
readonly type: "string";
|
|
643
|
+
readonly description: "Specific, actionable recommendations for each finding.";
|
|
644
|
+
};
|
|
645
|
+
readonly severity: {
|
|
646
|
+
readonly type: "string";
|
|
647
|
+
readonly enum: readonly ["critical", "high", "medium", "low", "none"];
|
|
648
|
+
readonly description: "Overall severity of issues found.";
|
|
649
|
+
};
|
|
650
|
+
};
|
|
651
|
+
};
|
|
652
|
+
export declare const IMPLEMENT_SCHEMA: {
|
|
653
|
+
readonly type: "object";
|
|
654
|
+
readonly required: readonly ["status", "summary", "changed_files", "commands_run", "tests", "risks", "next_steps"];
|
|
655
|
+
readonly properties: {
|
|
656
|
+
readonly status: {
|
|
657
|
+
readonly type: "string";
|
|
658
|
+
readonly enum: readonly ["success", "failed", "partial", "needs_user"];
|
|
659
|
+
};
|
|
660
|
+
readonly summary: {
|
|
661
|
+
readonly type: "string";
|
|
662
|
+
};
|
|
663
|
+
readonly changed_files: {
|
|
664
|
+
readonly type: "array";
|
|
665
|
+
readonly items: {
|
|
666
|
+
readonly type: "string";
|
|
667
|
+
};
|
|
668
|
+
};
|
|
669
|
+
readonly commands_run: {
|
|
670
|
+
readonly type: "array";
|
|
671
|
+
readonly items: {
|
|
672
|
+
readonly type: "string";
|
|
673
|
+
};
|
|
674
|
+
};
|
|
675
|
+
readonly tests: {
|
|
676
|
+
readonly type: "object";
|
|
677
|
+
readonly required: readonly ["ran"];
|
|
678
|
+
readonly properties: {
|
|
679
|
+
readonly ran: {
|
|
680
|
+
readonly type: "boolean";
|
|
681
|
+
};
|
|
682
|
+
readonly command: {
|
|
683
|
+
readonly type: "string";
|
|
684
|
+
};
|
|
685
|
+
readonly passed: {
|
|
686
|
+
readonly type: "boolean";
|
|
687
|
+
};
|
|
688
|
+
readonly output_tail: {
|
|
689
|
+
readonly type: "string";
|
|
690
|
+
};
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
readonly risks: {
|
|
694
|
+
readonly type: "array";
|
|
695
|
+
readonly items: {
|
|
696
|
+
readonly type: "string";
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
readonly next_steps: {
|
|
700
|
+
readonly type: "array";
|
|
701
|
+
readonly items: {
|
|
702
|
+
readonly type: "string";
|
|
703
|
+
};
|
|
704
|
+
};
|
|
705
|
+
};
|
|
706
|
+
};
|
|
707
|
+
export declare const RESULT_SCHEMA: {
|
|
708
|
+
readonly type: "object";
|
|
709
|
+
readonly required: readonly ["status", "summary", "changed_files", "commands_run", "tests", "risks", "next_steps"];
|
|
710
|
+
readonly properties: {
|
|
711
|
+
readonly status: {
|
|
712
|
+
readonly type: "string";
|
|
713
|
+
readonly enum: readonly ["success", "failed", "partial", "needs_user"];
|
|
714
|
+
};
|
|
715
|
+
readonly summary: {
|
|
716
|
+
readonly type: "string";
|
|
717
|
+
};
|
|
718
|
+
readonly changed_files: {
|
|
719
|
+
readonly type: "array";
|
|
720
|
+
readonly items: {
|
|
721
|
+
readonly type: "string";
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
readonly commands_run: {
|
|
725
|
+
readonly type: "array";
|
|
726
|
+
readonly items: {
|
|
727
|
+
readonly type: "string";
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
readonly tests: {
|
|
731
|
+
readonly type: "object";
|
|
732
|
+
readonly required: readonly ["ran"];
|
|
733
|
+
readonly properties: {
|
|
734
|
+
readonly ran: {
|
|
735
|
+
readonly type: "boolean";
|
|
736
|
+
};
|
|
737
|
+
readonly command: {
|
|
738
|
+
readonly type: "string";
|
|
739
|
+
};
|
|
740
|
+
readonly passed: {
|
|
741
|
+
readonly type: "boolean";
|
|
742
|
+
};
|
|
743
|
+
readonly output_tail: {
|
|
744
|
+
readonly type: "string";
|
|
745
|
+
};
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
readonly risks: {
|
|
749
|
+
readonly type: "array";
|
|
750
|
+
readonly items: {
|
|
751
|
+
readonly type: "string";
|
|
752
|
+
};
|
|
753
|
+
};
|
|
754
|
+
readonly next_steps: {
|
|
755
|
+
readonly type: "array";
|
|
756
|
+
readonly items: {
|
|
757
|
+
readonly type: "string";
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
};
|
|
762
|
+
export declare function buildImplementPrompt(input: ClaudeImplementInput): string;
|
|
763
|
+
export declare function buildReviewPrompt(input: ClaudeReviewInput): string;
|
|
764
|
+
export declare function buildQueryPrompt(input: ClaudeQueryInput): string;
|
|
765
|
+
export declare function jsonResult(data: unknown): CallToolResult;
|
|
766
|
+
export declare class StructuredToolError extends Error {
|
|
767
|
+
payload: Record<string, unknown>;
|
|
768
|
+
constructor(message: string, payload: Record<string, unknown>);
|
|
769
|
+
}
|
|
770
|
+
export declare function errorResult(error: string | Record<string, unknown>): CallToolResult;
|
|
771
|
+
export declare function formatDuration(ms: number): string;
|
|
772
|
+
export interface InteractionBlock {
|
|
773
|
+
headline: string;
|
|
774
|
+
state: string;
|
|
775
|
+
next_step: string;
|
|
776
|
+
}
|
|
777
|
+
export declare function withInteraction<T extends object>(result: T, interaction: InteractionBlock): T & {
|
|
778
|
+
interaction: InteractionBlock;
|
|
779
|
+
};
|