@hcflabs/pi-subagent 0.0.0-stage → 27.10.8
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/CONTEXT.md +77 -0
- package/LICENSE +22 -0
- package/README.md +282 -2
- package/dist/composition.d.ts +11 -0
- package/dist/composition.js +104 -0
- package/dist/direct-herdr.d.ts +71 -0
- package/dist/direct-herdr.js +527 -0
- package/dist/discard.d.ts +51 -0
- package/dist/discard.js +218 -0
- package/dist/display-text.d.ts +5 -0
- package/dist/display-text.js +9 -0
- package/dist/ephemeral.d.ts +79 -0
- package/dist/ephemeral.js +916 -0
- package/dist/git-process.d.ts +8 -0
- package/dist/git-process.js +25 -0
- package/dist/git-runtime.d.ts +115 -0
- package/dist/git-runtime.js +489 -0
- package/dist/herdr-runtime.d.ts +147 -0
- package/dist/herdr-runtime.js +1366 -0
- package/dist/index.d.ts +170 -0
- package/dist/index.js +589 -0
- package/dist/integration-git.d.ts +63 -0
- package/dist/integration-git.js +504 -0
- package/dist/launch-runtime.d.ts +54 -0
- package/dist/launch-runtime.js +178 -0
- package/dist/mcp-role.d.ts +12 -0
- package/dist/mcp-role.js +152 -0
- package/dist/process-lease.d.ts +5 -0
- package/dist/process-lease.js +43 -0
- package/dist/process.d.ts +9 -0
- package/dist/process.js +11 -0
- package/dist/prune.d.ts +78 -0
- package/dist/prune.js +205 -0
- package/dist/review-evidence.d.ts +17 -0
- package/dist/review-evidence.js +221 -0
- package/dist/runner.d.ts +431 -0
- package/dist/runner.js +3380 -0
- package/dist/schema.d.ts +2560 -0
- package/dist/schema.js +1365 -0
- package/dist/store.d.ts +66 -0
- package/dist/store.js +394 -0
- package/dist/worktree.d.ts +65 -0
- package/dist/worktree.js +288 -0
- package/docs/orchestration-architecture.html +138 -0
- package/docs/orchestration-architecture.svg +135 -0
- package/docs/orchestration.md +577 -0
- package/docs/worker-lifecycle.html +97 -0
- package/docs/worker-lifecycle.svg +86 -0
- package/example.png +0 -0
- package/examples/roles/implementer.md +25 -0
- package/examples/roles/reviewer.md +25 -0
- package/examples/roles/scout.md +25 -0
- package/extensions/admission.ts +82 -0
- package/extensions/config.ts +19 -0
- package/extensions/git-read.ts +126 -0
- package/extensions/isolated.ts +945 -0
- package/extensions/model-class-policy.ts +1 -0
- package/extensions/result-transport.ts +236 -0
- package/extensions/role-mcp.ts +14 -0
- package/extensions/role-tools.ts +178 -0
- package/extensions/subagent-command.ts +699 -0
- package/extensions/subagent.ts +958 -0
- package/extensions/workflow.ts +336 -0
- package/package.json +84 -4
- package/prompts/review.md +20 -0
- package/skills/pi-subagent/SKILL.md +41 -0
package/dist/runner.d.ts
ADDED
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
import { type DiscardGuards, type DiscardPlan } from "./discard.ts";
|
|
2
|
+
import { type EphemeralSubagentExecutor } from "./ephemeral.ts";
|
|
3
|
+
import type { PruneOwnership } from "./prune.ts";
|
|
4
|
+
import { IntegrationGit } from "./integration-git.ts";
|
|
5
|
+
import { type AllocationKind, type CheckCommand, type ChangesetTaskRequest, type CleanupKind, type ExecuteRequest, type ExecutionPolicySnapshot, type HostAllocationIntent, type HostAllocationPlan, type ModelClass, type ReviewEvidence, type ResumeRequest, type RunState, type TaskAttempt, type TaskRequest, type TaskState, type WorktreeAllocationIntent, type WorktreeAllocationPlan, type WorkspaceIdentity } from "./schema.ts";
|
|
6
|
+
import { FileRunStore } from "./store.ts";
|
|
7
|
+
/** One durable follow-up per attempt; this instruction permits a worker commit, never discarded work. */
|
|
8
|
+
export declare const COMMIT_NUDGE_INSTRUCTION = "Your turn ended with uncommitted changes in your worktree. Commit the intended changes now so the worktree is clean, or explain in your reply why they must not be committed. Do not discard work.";
|
|
9
|
+
export declare const CLEANUP_SAFETY_BUDGET_MS = 30000;
|
|
10
|
+
export declare const TERMINATION_SAFETY_BUDGET_MS = 15000;
|
|
11
|
+
export declare const STATUS_INSPECTION_BUDGET_MS = 5000;
|
|
12
|
+
export interface OperationContext {
|
|
13
|
+
readonly signal: AbortSignal;
|
|
14
|
+
readonly timeoutMs?: number;
|
|
15
|
+
readonly deadline?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface CommandResult extends CheckCommand {
|
|
18
|
+
code: number;
|
|
19
|
+
killed?: boolean;
|
|
20
|
+
stdout: string;
|
|
21
|
+
stderr: string;
|
|
22
|
+
}
|
|
23
|
+
type AllocationFailureResult<Kind extends AllocationKind> = {
|
|
24
|
+
kind: Kind;
|
|
25
|
+
outcome: "absent";
|
|
26
|
+
failure: string;
|
|
27
|
+
} | {
|
|
28
|
+
kind: Kind;
|
|
29
|
+
outcome: "unknown";
|
|
30
|
+
failure: string;
|
|
31
|
+
possibleResources?: string[];
|
|
32
|
+
};
|
|
33
|
+
export type WorktreeAllocationResult = {
|
|
34
|
+
kind: "worktree";
|
|
35
|
+
outcome: "owned";
|
|
36
|
+
} | AllocationFailureResult<"worktree">;
|
|
37
|
+
export type WorkspaceAllocationResult = {
|
|
38
|
+
kind: "workspace";
|
|
39
|
+
outcome: "owned";
|
|
40
|
+
workspaceId: string;
|
|
41
|
+
rootTabId: string;
|
|
42
|
+
rootPaneId: string;
|
|
43
|
+
} | AllocationFailureResult<"workspace">;
|
|
44
|
+
export type WorkerTabAllocationResult = {
|
|
45
|
+
kind: "worker_tab";
|
|
46
|
+
outcome: "owned";
|
|
47
|
+
tabId: string;
|
|
48
|
+
paneId: string;
|
|
49
|
+
} | AllocationFailureResult<"worker_tab">;
|
|
50
|
+
export type AgentAllocationResult = {
|
|
51
|
+
kind: "agent";
|
|
52
|
+
outcome: "owned";
|
|
53
|
+
} | AllocationFailureResult<"agent">;
|
|
54
|
+
export type HostAllocationResult = WorkspaceAllocationResult | WorkerTabAllocationResult | AgentAllocationResult;
|
|
55
|
+
export type AllocationResult = WorktreeAllocationResult | HostAllocationResult;
|
|
56
|
+
export type AllocationReconciliation<Kind extends AllocationKind = AllocationKind> = {
|
|
57
|
+
kind: Kind;
|
|
58
|
+
outcome: "absent";
|
|
59
|
+
} | {
|
|
60
|
+
kind: Kind;
|
|
61
|
+
outcome: "possible";
|
|
62
|
+
failure: string;
|
|
63
|
+
possibleResources?: string[];
|
|
64
|
+
};
|
|
65
|
+
export type WorkerResult = {
|
|
66
|
+
outcome: "candidate";
|
|
67
|
+
candidate: WorkspaceIdentity;
|
|
68
|
+
diagnostic?: string;
|
|
69
|
+
} | {
|
|
70
|
+
outcome: "blocked" | "not_prompted";
|
|
71
|
+
diagnostic: string;
|
|
72
|
+
}
|
|
73
|
+
/** The exact turn finished in its valid owned worktree with tracked or untracked changes. */
|
|
74
|
+
| {
|
|
75
|
+
outcome: "uncommitted";
|
|
76
|
+
diagnostic: string;
|
|
77
|
+
} | {
|
|
78
|
+
outcome: "unknown" | "interrupted";
|
|
79
|
+
diagnostic: string;
|
|
80
|
+
};
|
|
81
|
+
export interface CheckRunResult {
|
|
82
|
+
results: CommandResult[];
|
|
83
|
+
identityAfter: WorkspaceIdentity;
|
|
84
|
+
}
|
|
85
|
+
export interface ReviewResult {
|
|
86
|
+
verdict: string;
|
|
87
|
+
identityAfter: WorkspaceIdentity;
|
|
88
|
+
}
|
|
89
|
+
/** A just-in-time launch whose argv contains only an ephemeral Role prompt path. */
|
|
90
|
+
export interface VerifiedLaunch {
|
|
91
|
+
readonly role: string;
|
|
92
|
+
readonly modelClass: ModelClass;
|
|
93
|
+
readonly model: string;
|
|
94
|
+
readonly thinkingLevel: string;
|
|
95
|
+
readonly args: readonly string[];
|
|
96
|
+
readonly env: Readonly<Record<string, string>>;
|
|
97
|
+
readonly tools: readonly string[];
|
|
98
|
+
}
|
|
99
|
+
export type ResolvedRoute = Pick<VerifiedLaunch, "role" | "modelClass" | "model" | "thinkingLevel">;
|
|
100
|
+
/** A dry-run result: the normalized request and the resolved routes; no state exists for it. */
|
|
101
|
+
export interface ExecutePlan {
|
|
102
|
+
request: ExecuteRequest;
|
|
103
|
+
root: string;
|
|
104
|
+
main: WorkspaceIdentity;
|
|
105
|
+
routes: readonly ResolvedRoute[];
|
|
106
|
+
}
|
|
107
|
+
export interface TransientLaunchHandle<Launch extends VerifiedLaunch = VerifiedLaunch> {
|
|
108
|
+
readonly launch: Launch;
|
|
109
|
+
cleanup(): Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
/** Run one launch action and surface cleanup failure, including after action failure or abort. */
|
|
112
|
+
export declare function withTransientLaunch<Launch extends VerifiedLaunch, Result>(handle: TransientLaunchHandle<Launch>, operation: (launch: Launch) => Promise<Result>): Promise<Result>;
|
|
113
|
+
/**
|
|
114
|
+
* Productive hooks may inspect or change implementation state. Every call receives
|
|
115
|
+
* the same request abort signal. Individual I/O operations keep their own caps.
|
|
116
|
+
*/
|
|
117
|
+
export interface CoordinatorRuntime {
|
|
118
|
+
now(): number;
|
|
119
|
+
randomToken(): string;
|
|
120
|
+
/** `dryRun` skips checks that call Herdr; every other check runs. */
|
|
121
|
+
preflight(input: {
|
|
122
|
+
request: ExecuteRequest;
|
|
123
|
+
cwd: string;
|
|
124
|
+
dryRun?: boolean;
|
|
125
|
+
}, context: OperationContext): Promise<{
|
|
126
|
+
root: string;
|
|
127
|
+
main: WorkspaceIdentity;
|
|
128
|
+
/** Resolved route of each distinct Role and model class, when the coordinator reports it. */
|
|
129
|
+
routes?: readonly ResolvedRoute[];
|
|
130
|
+
}>;
|
|
131
|
+
acquireLaunch(role: string, modelClass: ModelClass, context: OperationContext): Promise<TransientLaunchHandle<VerifiedLaunch>>;
|
|
132
|
+
}
|
|
133
|
+
export type HostAllocationKind = Exclude<AllocationKind, "worktree">;
|
|
134
|
+
export type HostCleanupKind = Extract<CleanupKind, "worker_tab" | "workspace">;
|
|
135
|
+
export interface HostRuntime {
|
|
136
|
+
planHostAllocation(input: {
|
|
137
|
+
readonly requestId: ExecuteRequest["id"];
|
|
138
|
+
readonly goal: ExecuteRequest["goal"];
|
|
139
|
+
kind: HostAllocationKind;
|
|
140
|
+
task: TaskRequest;
|
|
141
|
+
attempt: TaskAttempt;
|
|
142
|
+
}, context: OperationContext): Promise<HostAllocationPlan>;
|
|
143
|
+
allocateHost(input: {
|
|
144
|
+
requestId: ExecuteRequest["id"];
|
|
145
|
+
intent: HostAllocationIntent;
|
|
146
|
+
task: TaskRequest;
|
|
147
|
+
attempt: TaskAttempt;
|
|
148
|
+
/** Invoked only after pane, lease, and startability checks at the final agent-start boundary. */
|
|
149
|
+
acquireLaunch?: () => Promise<TransientLaunchHandle<VerifiedLaunch>>;
|
|
150
|
+
}, context: OperationContext): Promise<HostAllocationResult>;
|
|
151
|
+
reconcileHostAllocation(input: {
|
|
152
|
+
requestId: ExecuteRequest["id"];
|
|
153
|
+
intent: HostAllocationIntent;
|
|
154
|
+
task: TaskRequest;
|
|
155
|
+
attempt: TaskAttempt;
|
|
156
|
+
}, context: OperationContext): Promise<AllocationReconciliation<HostAllocationKind>>;
|
|
157
|
+
runWorker(input: {
|
|
158
|
+
readonly goal: ExecuteRequest["goal"];
|
|
159
|
+
readonly contexts: readonly TextTaskContext[];
|
|
160
|
+
task: TaskRequest;
|
|
161
|
+
attempt: TaskAttempt;
|
|
162
|
+
workerId: string;
|
|
163
|
+
kind: "initial" | "correction" | "followup";
|
|
164
|
+
preCandidate: WorkspaceIdentity;
|
|
165
|
+
failure?: string;
|
|
166
|
+
instruction?: string;
|
|
167
|
+
}, context: OperationContext): Promise<WorkerResult>;
|
|
168
|
+
terminateWorker(input: {
|
|
169
|
+
task: TaskRequest;
|
|
170
|
+
attempt: TaskAttempt;
|
|
171
|
+
workerId: string;
|
|
172
|
+
candidate: WorkspaceIdentity;
|
|
173
|
+
}, context: OperationContext): Promise<{
|
|
174
|
+
outcome: "terminated";
|
|
175
|
+
} | {
|
|
176
|
+
outcome: "unknown";
|
|
177
|
+
failure: string;
|
|
178
|
+
}>;
|
|
179
|
+
reconcileWorkerTermination(input: {
|
|
180
|
+
task: TaskRequest;
|
|
181
|
+
attempt: TaskAttempt;
|
|
182
|
+
workerId: string;
|
|
183
|
+
candidate: WorkspaceIdentity;
|
|
184
|
+
}, context: OperationContext): Promise<{
|
|
185
|
+
outcome: "terminated" | "active";
|
|
186
|
+
} | {
|
|
187
|
+
outcome: "unknown";
|
|
188
|
+
failure: string;
|
|
189
|
+
}>;
|
|
190
|
+
cleanupHost(input: {
|
|
191
|
+
requestId: ExecuteRequest["id"];
|
|
192
|
+
kind: HostCleanupKind;
|
|
193
|
+
task: TaskRequest;
|
|
194
|
+
attempt: TaskAttempt;
|
|
195
|
+
}, context: OperationContext): Promise<{
|
|
196
|
+
outcome: "completed" | "absent";
|
|
197
|
+
} | {
|
|
198
|
+
outcome: "blocked";
|
|
199
|
+
failure: string;
|
|
200
|
+
}>;
|
|
201
|
+
}
|
|
202
|
+
export interface InFlightTaskCandidateInspection {
|
|
203
|
+
candidate: WorkspaceIdentity;
|
|
204
|
+
clean: boolean;
|
|
205
|
+
valid: boolean;
|
|
206
|
+
}
|
|
207
|
+
export interface InFlightTaskCandidateInspector {
|
|
208
|
+
inspectInFlightTaskCandidate(input: {
|
|
209
|
+
root: string;
|
|
210
|
+
task: TaskRequest;
|
|
211
|
+
attempt: TaskAttempt;
|
|
212
|
+
}, context: OperationContext): Promise<InFlightTaskCandidateInspection>;
|
|
213
|
+
}
|
|
214
|
+
export interface GitRuntime {
|
|
215
|
+
inspectTaskCandidate(input: {
|
|
216
|
+
root: string;
|
|
217
|
+
task: TaskRequest;
|
|
218
|
+
attempt: TaskAttempt;
|
|
219
|
+
}, context: OperationContext): Promise<WorkspaceIdentity>;
|
|
220
|
+
inspectMain(input: {
|
|
221
|
+
root: string;
|
|
222
|
+
}, context: OperationContext): Promise<WorkspaceIdentity>;
|
|
223
|
+
inspectMainBase(input: {
|
|
224
|
+
root: string;
|
|
225
|
+
}, context: OperationContext): Promise<WorkspaceIdentity>;
|
|
226
|
+
allocateWorktree(input: {
|
|
227
|
+
requestId: string;
|
|
228
|
+
root: string;
|
|
229
|
+
baseRoot?: string;
|
|
230
|
+
intent: WorktreeAllocationIntent;
|
|
231
|
+
task: TaskRequest;
|
|
232
|
+
attempt: TaskAttempt;
|
|
233
|
+
onPrepared(worktree: WorktreeAllocationPlan): Promise<void>;
|
|
234
|
+
}, context: OperationContext): Promise<WorktreeAllocationResult>;
|
|
235
|
+
reconcileWorktreeAllocation(input: {
|
|
236
|
+
root: string;
|
|
237
|
+
intent: WorktreeAllocationIntent;
|
|
238
|
+
task: TaskRequest;
|
|
239
|
+
attempt: TaskAttempt;
|
|
240
|
+
}, context: OperationContext): Promise<AllocationReconciliation<"worktree">>;
|
|
241
|
+
runChecks(input: {
|
|
242
|
+
root: string;
|
|
243
|
+
scope: "task" | "final";
|
|
244
|
+
taskId?: string;
|
|
245
|
+
attempt?: TaskAttempt;
|
|
246
|
+
checks: CheckCommand[];
|
|
247
|
+
candidate: WorkspaceIdentity;
|
|
248
|
+
}, context: OperationContext): Promise<CheckRunResult>;
|
|
249
|
+
review(input: {
|
|
250
|
+
root: string;
|
|
251
|
+
scope: "task" | "final";
|
|
252
|
+
phase: ReviewEvidence["phase"];
|
|
253
|
+
taskId?: string;
|
|
254
|
+
attempt?: TaskAttempt;
|
|
255
|
+
criterion: string;
|
|
256
|
+
base: WorkspaceIdentity;
|
|
257
|
+
tip: WorkspaceIdentity;
|
|
258
|
+
acquireLaunch(): Promise<TransientLaunchHandle<VerifiedLaunch>>;
|
|
259
|
+
}, context: OperationContext): Promise<ReviewResult>;
|
|
260
|
+
inspectRetainedTask(input: {
|
|
261
|
+
root: string;
|
|
262
|
+
task: TaskRequest;
|
|
263
|
+
attempt: TaskAttempt;
|
|
264
|
+
}, context: OperationContext): Promise<WorkspaceIdentity>;
|
|
265
|
+
}
|
|
266
|
+
export type MainStatus = {
|
|
267
|
+
status: "current" | "drifted";
|
|
268
|
+
expected: WorkspaceIdentity;
|
|
269
|
+
actual: WorkspaceIdentity;
|
|
270
|
+
} | {
|
|
271
|
+
status: "unavailable";
|
|
272
|
+
expected: WorkspaceIdentity;
|
|
273
|
+
failure: string;
|
|
274
|
+
};
|
|
275
|
+
export interface RunResponse {
|
|
276
|
+
text: string;
|
|
277
|
+
state: RunState;
|
|
278
|
+
main?: MainStatus;
|
|
279
|
+
continuation?: ResumeRequest;
|
|
280
|
+
}
|
|
281
|
+
export type TextTaskContext = {
|
|
282
|
+
taskId: string;
|
|
283
|
+
text: string;
|
|
284
|
+
};
|
|
285
|
+
/** Build one bounded changeset assignment. Call this before acquiring its Role launch. */
|
|
286
|
+
export declare function buildChangesetTaskPrompt(input: {
|
|
287
|
+
readonly goal: ExecuteRequest["goal"];
|
|
288
|
+
readonly contexts: readonly TextTaskContext[];
|
|
289
|
+
task: ChangesetTaskRequest;
|
|
290
|
+
kind: "initial" | "correction" | "followup";
|
|
291
|
+
worktreeCwd: string;
|
|
292
|
+
failure?: string;
|
|
293
|
+
instruction?: string;
|
|
294
|
+
}): string;
|
|
295
|
+
/** Resolve completed text outputs in the consumer's declared context order. */
|
|
296
|
+
export declare function resolveTextTaskContexts(state: {
|
|
297
|
+
readonly tasks: readonly TaskState[];
|
|
298
|
+
}, task: Pick<TaskRequest, "id" | "contextFrom">): TextTaskContext[];
|
|
299
|
+
/** Format complete context blocks or fail; prompt data is never truncated. */
|
|
300
|
+
export declare function formatTextTaskContexts(contexts: readonly TextTaskContext[], maxBytes: number): string;
|
|
301
|
+
/** Build a bounded text-task assignment with upstream output marked as task data. */
|
|
302
|
+
export declare function buildTextTaskPrompt(goal: ExecuteRequest["goal"], task: Pick<TaskRequest, "id" | "requirements" | "deliverable">, contexts: readonly TextTaskContext[]): string;
|
|
303
|
+
export declare function readyPendingTasks(state: RunState): TaskState[];
|
|
304
|
+
/** Main's next integration step while the request waits only for Main; undefined when a task or the final gate needs attention. */
|
|
305
|
+
export declare function nextIntegrationAction(state: RunState): string | undefined;
|
|
306
|
+
export declare class IsolatedRunner {
|
|
307
|
+
private readonly coordinatorRuntime;
|
|
308
|
+
private readonly hostRuntime;
|
|
309
|
+
private readonly gitRuntime;
|
|
310
|
+
private readonly store;
|
|
311
|
+
private readonly integrationGit;
|
|
312
|
+
private readonly textExecutor;
|
|
313
|
+
private readonly currentPolicy;
|
|
314
|
+
private readonly productiveLifecycles;
|
|
315
|
+
private readonly followupControls;
|
|
316
|
+
constructor(coordinatorRuntime: CoordinatorRuntime, hostRuntime: HostRuntime, gitRuntime: GitRuntime, store: FileRunStore | undefined, textExecutor: EphemeralSubagentExecutor, policy?: ExecutionPolicySnapshot, currentPolicy?: () => ExecutionPolicySnapshot, integrationGit?: IntegrationGit);
|
|
317
|
+
listRequests(root: string): Promise<{
|
|
318
|
+
requests: Array<{
|
|
319
|
+
id: string;
|
|
320
|
+
name: string;
|
|
321
|
+
status: string;
|
|
322
|
+
directory: string;
|
|
323
|
+
root: string;
|
|
324
|
+
tasks: Array<{
|
|
325
|
+
id: string;
|
|
326
|
+
name: string;
|
|
327
|
+
status: string;
|
|
328
|
+
kind: string;
|
|
329
|
+
}>;
|
|
330
|
+
}>;
|
|
331
|
+
invalidIds: string[];
|
|
332
|
+
states: RunState[];
|
|
333
|
+
}>;
|
|
334
|
+
/** True while a live productive run holds this root's lease; the lease does not name its request. */
|
|
335
|
+
hasProductiveRunLease(root: string): Promise<boolean>;
|
|
336
|
+
/** Classify orphaned work under the same repository lease as productive execution.
|
|
337
|
+
* Status remains read-only; Main alone chooses any subsequent action. */
|
|
338
|
+
recoverRepository(root: string): Promise<{
|
|
339
|
+
requests: RunResponse[];
|
|
340
|
+
invalidIds: string[];
|
|
341
|
+
leaseBusy: boolean;
|
|
342
|
+
}>;
|
|
343
|
+
/** Prune evidence across checkouts, primary first, and orphaned requests whose parent checkout was removed.
|
|
344
|
+
* A non-terminal state owns every resource name its saved text mentions; an unreadable state owns every
|
|
345
|
+
* name its raw text mentions, or every name when unreadable. */
|
|
346
|
+
pruneOwnership(checkouts: readonly string[]): Promise<PruneOwnership>;
|
|
347
|
+
/** After pruning, reconcile aborted requests that recorded a removed resource through the guarded abort path. */
|
|
348
|
+
reconcilePrunedAborts(checkouts: readonly string[], names: readonly string[]): Promise<string[]>;
|
|
349
|
+
canFollowup(root: string, requestId: string, taskId: string): boolean;
|
|
350
|
+
drainFollowups(root: string, requestId: string, taskId: string): string[];
|
|
351
|
+
queueFollowup(root: string, requestId: string, taskId: string, instruction: string): string;
|
|
352
|
+
private withProductiveRun;
|
|
353
|
+
private withLifecycleLock;
|
|
354
|
+
private saveProductive;
|
|
355
|
+
private callProductive;
|
|
356
|
+
private rethrowStopped;
|
|
357
|
+
/** Every execute check before durable state; a dry run also skips the Herdr host preflight. */
|
|
358
|
+
private admitExecute;
|
|
359
|
+
/** Dry run of execute: no state, lock, lease, worktree, or Herdr call. */
|
|
360
|
+
plan(value: unknown, cwd: string, outerSignal?: AbortSignal): Promise<ExecutePlan>;
|
|
361
|
+
execute(value: unknown, cwd: string, outerSignal?: AbortSignal): Promise<RunResponse>;
|
|
362
|
+
resume(value: unknown, root: string, outerSignal?: AbortSignal): Promise<RunResponse>;
|
|
363
|
+
/** Main selects an exact retained candidate; only the owned integration checkout is writable. */
|
|
364
|
+
stage(value: unknown, root: string, outerSignal?: AbortSignal): Promise<RunResponse>;
|
|
365
|
+
private stageReceipts;
|
|
366
|
+
/** Only Main can validate/promote the exact selected, clean combined tip. */
|
|
367
|
+
integrate(value: unknown, root: string, outerSignal?: AbortSignal): Promise<RunResponse>;
|
|
368
|
+
private releaseRejected;
|
|
369
|
+
private releaseSuperseded;
|
|
370
|
+
private cleanupPromoted;
|
|
371
|
+
private cleanupPromotedStage;
|
|
372
|
+
private requireExactIntegration;
|
|
373
|
+
listOrphanRequests(cwd: string): Promise<{
|
|
374
|
+
invalidIds: string[];
|
|
375
|
+
requests: {
|
|
376
|
+
id: string;
|
|
377
|
+
name: string;
|
|
378
|
+
status: string;
|
|
379
|
+
directory: string;
|
|
380
|
+
root: string;
|
|
381
|
+
orphaned: boolean;
|
|
382
|
+
tasks: never[];
|
|
383
|
+
}[];
|
|
384
|
+
}>;
|
|
385
|
+
private discardGuards;
|
|
386
|
+
discardPlan(cwd: string, id: string, directory: string | undefined, guards: DiscardGuards): Promise<DiscardPlan>;
|
|
387
|
+
/** Command-only explicit discard. No tool calls this method. */
|
|
388
|
+
discard(cwd: string, plan: DiscardPlan, guards: DiscardGuards): Promise<import("./discard.ts").DiscardRemoval[]>;
|
|
389
|
+
private terminateAbortedAttempt;
|
|
390
|
+
private cleanupAbortedHost;
|
|
391
|
+
private closeDiscardResource;
|
|
392
|
+
abort(id: string, root: string, outerSignal?: AbortSignal): Promise<RunResponse>;
|
|
393
|
+
/** Read-only proof that every retained candidate checkout and staged integration checkout is already gone. */
|
|
394
|
+
private retainedWorkAbsent;
|
|
395
|
+
private cleanupAborted;
|
|
396
|
+
status(id: string, root: string, outerSignal?: AbortSignal): Promise<RunResponse>;
|
|
397
|
+
private run;
|
|
398
|
+
private dispatchTask;
|
|
399
|
+
private dispatchTextTask;
|
|
400
|
+
private correctionAllowed;
|
|
401
|
+
private driveWorkerSafely;
|
|
402
|
+
private driveWorker;
|
|
403
|
+
private terminationCandidate;
|
|
404
|
+
/**
|
|
405
|
+
* Proves exact worker termination without replay. Reconciliation records a worker that is already gone;
|
|
406
|
+
* only an observed live worker without saved termination intent is closed.
|
|
407
|
+
*/
|
|
408
|
+
private proveTermination;
|
|
409
|
+
private terminateWithSafety;
|
|
410
|
+
private runCheckBatch;
|
|
411
|
+
private runReview;
|
|
412
|
+
private retainCandidate;
|
|
413
|
+
private verifyRetainedTask;
|
|
414
|
+
private retry;
|
|
415
|
+
private finalize;
|
|
416
|
+
private runFinal;
|
|
417
|
+
private markFinalFailed;
|
|
418
|
+
private markSuperseded;
|
|
419
|
+
private recoverInterrupted;
|
|
420
|
+
private ensureFollowupControl;
|
|
421
|
+
private controlKey;
|
|
422
|
+
private activeControl;
|
|
423
|
+
private activeControls;
|
|
424
|
+
private hasActiveControl;
|
|
425
|
+
private hasAnyActiveControl;
|
|
426
|
+
private closeFollowupControl;
|
|
427
|
+
private closeRequestControls;
|
|
428
|
+
private attention;
|
|
429
|
+
private response;
|
|
430
|
+
}
|
|
431
|
+
export {};
|