@ordewell/core 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{IFileSystem-Bj6fy1cG.d.mts → IFileSystem-B8Nkgg4e.d.mts} +1 -1
- package/dist/{IFileSystem-BCJBHFwB.d.ts → IFileSystem-DCd-rkeH.d.ts} +1 -1
- package/dist/{IRunner-hWAJC4hg.d.mts → IRunner-CXdYyIZo.d.mts} +213 -202
- package/dist/{IRunner-C7_SSpzG.d.ts → IRunner-QBdYcatb.d.ts} +213 -202
- package/dist/{ModeResolver-m1d8Cb-j.d.mts → ModeResolver-BOU90Nn-.d.ts} +1 -1
- package/dist/{ModeResolver-u5ZhRC8x.d.ts → ModeResolver-geqjKkLY.d.mts} +1 -1
- package/dist/{Task-CxwnCJLi.d.mts → Task-CRVIqSfy.d.mts} +58 -11
- package/dist/{Task-CxwnCJLi.d.ts → Task-CRVIqSfy.d.ts} +58 -11
- package/dist/{chunk-DNFT4SQG.mjs → chunk-645FALZX.mjs} +5 -5
- package/dist/chunk-645FALZX.mjs.map +1 -0
- package/dist/{chunk-DJAPDO6E.mjs → chunk-A57ITQE7.mjs} +41 -21
- package/dist/chunk-A57ITQE7.mjs.map +1 -0
- package/dist/{chunk-CH5IGWFS.mjs → chunk-FH6M5QZG.mjs} +168 -122
- package/dist/chunk-FH6M5QZG.mjs.map +1 -0
- package/dist/{chunk-2IIRSBEQ.mjs → chunk-SM6BV6XS.mjs} +20 -4
- package/dist/chunk-SM6BV6XS.mjs.map +1 -0
- package/dist/index.d.mts +454 -63
- package/dist/index.d.ts +454 -63
- package/dist/index.js +19575 -18631
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17991 -17137
- package/dist/index.mjs.map +1 -1
- package/dist/parsing.d.mts +2 -2
- package/dist/parsing.d.ts +2 -2
- package/dist/parsing.js +15 -14
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -3
- package/dist/{plan-utils-CKXdD1AD.d.mts → plan-utils-KU1Rse82.d.mts} +1322 -1146
- package/dist/{plan-utils-B6yJdpgi.d.ts → plan-utils-oC8bO4pN.d.ts} +1322 -1146
- package/dist/plan-utils.d.mts +4 -4
- package/dist/plan-utils.d.ts +4 -4
- package/dist/plan-utils.js +60 -0
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +11 -3
- package/dist/testing.d.mts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.js +3 -1
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +4 -2
- package/dist/testing.mjs.map +1 -1
- package/package.json +5 -1
- package/dist/chunk-2IIRSBEQ.mjs.map +0 -1
- package/dist/chunk-CH5IGWFS.mjs.map +0 -1
- package/dist/chunk-DJAPDO6E.mjs.map +0 -1
- package/dist/chunk-DNFT4SQG.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as
|
|
3
|
-
import {
|
|
4
|
-
export { A as ACT_RISK, a as AUTORUN_RISK, c as ApprovalBlock, d as ApprovalStatus, e as AutoMergeTrigger, B as BlockingSubject, C as CHECKPOINT_TRUNCATE_LENGTH, f as CommandBlock, g as CommandStatus, h as CompactionBlock, i as ConversationInput, j as ConversationView, D as DiffRow, k as DiffRowKind, l as DiffStat, m as DisplayBlock, E as EMPTY_CONVERSATION, n as EMPTY_HOLD, o as EMPTY_RUN, p as EMPTY_TASK_LOG, r as ExecutionSummary, G as GatedConversation,
|
|
5
|
-
import { I as IApproval, y as IConfig, d as AgentProcessDeps, a as AgentAdapter, _ as OrdewellMcpServer,
|
|
6
|
-
export { A as AUTO_COMMANDS, b as AgentAdapterFactory, g as AllProviderModels, h as AnswerApprovalArgs, k as ApprovalKind, l as ApprovalMode, o as ApprovalPolicyOptions, q as ApprovalSource, C as CatalogModel, s as CheckpointArgs, t as CommandClassification, u as CommandTier, v as CommandWords, D as DEFAULT_PLANNER_ALLOWLIST, w as DENY_ALL, x as DiscoveryCommand, E as EditPlanArgs, F as FetchAllProviderModelsOptions, G as GIT_READONLY_SUBCOMMANDS, H as InvokedCommand, L as LineBuffer, J as ListModelsArgs, K as ListRunnersArgs, M as LoadSkillArgs, N as McpClientConfig, O as McpCredential, P as McpTool, Q as McpToolContext, R as McpToolReply, S as MessageTaskArgs, T as ModelCatalog, U as ModelShortcut, V as ORCHESTRATOR_SHORTCUTS, W as ORDEWELL_MCP_PATH, X as ORDEWELL_MCP_SERVER_NAME, Y as OneTaskArgs, $ as OwnerOnlyFile, a0 as PLANNER_EXECUTION_TOOLS, a1 as PLANNER_TOOLS, a2 as PlannerAllowlist,
|
|
7
|
-
import { T as ToolOutcome, I as IFileSystem, R as ReadFileOpts, b as GrepOptions, a as GlobOptions, F as FindSymbolOptions } from './IFileSystem-
|
|
8
|
-
export { G as GREP_DEFAULT_HEAD_LIMIT, c as GrepOutputMode, S as SEARCH_EXCLUSIONS } from './IFileSystem-
|
|
9
|
-
import { R as RunnerModeInfo } from './ModeResolver-
|
|
10
|
-
export { a as autonomyLevelLabel, p as parseAutonomyLevel, r as runnerModesFrom } from './ModeResolver-
|
|
1
|
+
import { af as Task, E as ExecutionActor, r as IsolationMergeResult, f as ExecutionRecord, g as GuardTrip, ae as SupervisorLevel, e as ExecutionCommandName, G as GuardTarget, a2 as RunnerId, d as DiscoveredModel, Z as ResearchProgress, Y as ResearchLogEntry, C as ConversationMessage, a7 as SkillInfo, a8 as SkillLoad, ac as SkillsService, L as LegacyPlanState, N as PlanStatus, n as IsolationLandedTask, I as IWorktreeIsolation, F as IsolationTaskStatus, J as PlanIsolation, ar as UsageRecord, a0 as ResearchToolType, Q as PlannerUsage, an as TaskSnapshot, K as PlanState, H as IsolationView, at as Verdict, am as TaskSkillSnapshot } from './Task-CRVIqSfy.mjs';
|
|
2
|
+
export { A as ApprovalRecord, a as AttemptUsage, b as AwaitingReason, B as BUILTIN_SKILL_NAMES, D as DEFAULT_RUNNERS, c as DEFAULT_SUPERVISOR_RETRY_LIMIT, h as IntegrationDisposal, i as InvalidSkill, j as IsolationAvailability, k as IsolationHandoff, l as IsolationHandoffRepo, m as IsolationInactiveReason, o as IsolationLanding, p as IsolationMergeBlock, q as IsolationMergeBlockReason, s as IsolationOutcome, t as IsolationPruneResult, u as IsolationRemoval, v as IsolationRepo, w as IsolationRun, x as IsolationTaskRecord, y as IsolationTaskRef, z as IsolationTaskRepo, M as ModelUsage, O as PlanUsage, R as PrepareIntent, S as PreparedTask, T as PreservedWork, U as PreviousWork, V as RefusedRemoval, W as RepairEvidence, X as RepoGroupLayout, _ as ResearchStep, $ as ResearchStepOutcome, a1 as RunSettings, a3 as SetupFailure, a4 as ShadowedSkill, a5 as SkillAppliesTo, a6 as SkillCatalog, a9 as SkillLoadNotice, aa as SkillMetadata, ab as SkillSource, ai as TaskIsolation, aj as TaskIsolationState, ak as TaskModelAssignment, ao as TaskStatus, ap as TreeSnapshot, aq as UsageLine, as as UsageTotals, au as VerificationCheck, av as addAttemptUsage, aw as addModelUsage, ax as addPlannerUsage, ay as addUsage, az as addUsageTotals, aA as createEmptyPlan, aB as createSkillsService, aC as createTask, aD as endAttemptUsage, aE as flattenTasks, aF as flattenTasksWithParents, aG as isAwaitingReason, aH as isMeasured, aI as isSupervisorLevel, aJ as isUserMessage, aK as migratePlanState, aL as partedPromptUsage, aM as pausedOnLimit, aN as planUsage, aO as plannerContextFill, aP as rejoinPlanTree, aQ as startAttemptUsage, aR as usageLine, aS as waitsForApproval } from './Task-CRVIqSfy.mjs';
|
|
3
|
+
import { ah as StartAdmission, w as LiveTailOptions, L as LiveTail, U as PlannerModes, at as TaskOp, u as IsolatedExecution, aa as SessionBroadcaster, b as ApplyTaskOpsResult, af as SkillLookup, ac as SessionNotice, q as EditCatalog, ab as SessionMessage, T as PlanStore, au as TaskOrchestrator, v as IsolationRunController, O as OrchestratorObserver, ar as TaskLogEvent, I as INotification, s as GlobalRunSettings, a1 as RunView, Z as RunMergeView, ax as TaskOutputSource, aO as UserSettings, al as SurfacePlan, am as SurfacePlanState } from './plan-utils-KU1Rse82.mjs';
|
|
4
|
+
export { A as ACT_RISK, a as AUTORUN_RISK, c as ApprovalBlock, d as ApprovalStatus, e as AutoMergeTrigger, B as BlockingSubject, C as CHECKPOINT_TRUNCATE_LENGTH, f as CommandBlock, g as CommandStatus, h as CompactionBlock, i as ConversationInput, j as ConversationView, D as DiffRow, k as DiffRowKind, l as DiffStat, m as DisplayBlock, E as EMPTY_CONVERSATION, n as EMPTY_HOLD, o as EMPTY_RUN, p as EMPTY_TASK_LOG, r as ExecutionSummary, G as GatedConversation, H as HeldEdit, t as HeldEditMark, x as LocalEntry, M as MarkdownToken, y as MessageBlock, z as MessageRole, N as NOT_STARTED, F as NO_TURN, J as NewTaskFields, K as NotificationAction, P as OutputPreview, Q as PlanBlock, R as PlanMarkerStatus, S as PlanSnapshot, V as PromptHold, W as RUN_SETTINGS_DEFAULTS, Y as RunInput, _ as RunSettingsError, $ as RunTask, a0 as RunTaskStatus, a2 as RunnerLoadedBlock, a3 as STOPPED_BEFORE_START, a4 as SUPERVISOR_LEVEL_LABEL, a5 as SerializedConversationMessage, a6 as SerializedPendingTurn, a7 as SerializedPlan, a8 as SerializedTask, a9 as SerializedTaskStatus, ad as SettingsService, ae as SkillLoadBlock, ag as SkillToken, ai as SubagentBlock, aj as SubagentChild, ak as SubagentStatus, an as SurfaceTask, ao as TakenPrompt, ap as TaskAttemptSnapshot, aq as TaskControlError, as as TaskLogView, av as TaskOrchestratorDeps, aw as TaskOrchestratorOptions, ay as TaskRef, az as TaskRowAction, aA as TaskRowContext, aB as TaskRowIsolation, aC as TaskRowKind, aD as TaskRowPlacement, aE as TaskRowSubject, aF as TaskRowUsage, aG as TaskRowView, aH as TaskStatusKind, aI as ThinkingDisplayBlock, aJ as ToolBlock, aK as ToolHeadline, aL as ToolStatus, aM as TurnGate, aN as UsageBlock, aP as WAITS_FOR_APPROVAL_LABEL, aQ as aheadOfDraft, aR as applyTaskOps, aS as approvalLabel, aT as automergeSummary, aU as autorunSummary, aV as awaitingLabel, aW as blockedByLabel, aX as blockingFailures, aY as canMergeTasks, aZ as canSetDependencies, a_ as canSplitTask, a$ as capConflictFiles, b0 as classifyOutcome, b1 as coalesceTaskLog, b2 as dependencyCandidates, b3 as dependentsNotice, b4 as dependentsOf, b5 as diffRows, b6 as diffStat, b7 as diffSummary, b8 as digestTaskLog, b9 as drainNext, ba as executionSummary, bb as followTurn, bc as fromTranscript, bd as getSettingsPath, be as hasHiddenDetail, bf as holdPrompt, bg as isTaskRunning, bh as loadedSkillTokens, bi as markAction, bj as markRequestFor, bk as markdownHtml, bl as markdownTokens, bm as namedRepos, bn as newTaskFields, bo as opsEditable, bp as outputLines, bq as outputPreview, br as parseCount, bs as parseSwitch, bt as parseTaskOpsJson, bu as pastGateConfirmation, bv as reconcileApprovals, bw as reduceConversation, bx as reduceRun, by as reduceTaskLog, bz as replayTaskLog, bA as resolveTaskRef, bB as resumeLabel, bC as resumeTime, bD as runSettingsOf, bE as runnerToolSubject, bF as serializePlan, bG as serializeTask, bH as serializeTaskStatus, bI as skillTokens, bJ as skippedLabel, bK as stopTurn, bL as summarizeToolCall, bM as supervisorSummary, bN as surfacePlan, bO as surfacePlanState, bP as takeAt, bQ as taskLogForSurface, bR as taskOrderLabel, bS as taskRef, bT as taskRefOf, bU as taskRowActions, bV as taskRowView, bW as taskStartedNotice, bX as taskStatusKind, bY as textHasTaskOps, bZ as titledRefs, b_ as titledTaskRef, b$ as titledTaskRefOf, c0 as toTaskLogEvent, c1 as toolHeadline, c2 as trimToolOutput, c3 as truncateCheckpointSummary, c4 as unsendAll, c5 as unsendLatest } from './plan-utils-KU1Rse82.mjs';
|
|
5
|
+
import { I as IApproval, y as IConfig, d as AgentProcessDeps, a as AgentAdapter, _ as OrdewellMcpServer, a6 as PlannerToolHandler, ad as ResearchShell, p as ApprovalRequest, j as ApprovalDecision, i as ApprovalAnswer, z as IRunner, a3 as PlannerBackendId, a9 as ProviderModelLists, f as AiProvider, m as ApprovalModeSetting, aq as RunnerRegistry, Z as OrchestratorOption, aD as TaskModeAgentAdapter, e as AgentStartOptions, c as AgentEvent, ai as RunnerCommand, a7 as ProjectMcpServer, n as ApprovalPolicy, B as IRunnerSession, aA as TaskCompleteArgs, r as CheckpointAnswer, av as StructuredTurnEnd, au as StructuredEvent, aC as TaskMessageFrom, ab as QueuedTaskMessage, aI as TaskStartOptions, aJ as TaskTokenScope, am as RunnerManifest, aH as TaskRunnerFlags } from './IRunner-CXdYyIZo.mjs';
|
|
6
|
+
export { A as AUTO_COMMANDS, b as AgentAdapterFactory, g as AllProviderModels, h as AnswerApprovalArgs, k as ApprovalKind, l as ApprovalMode, o as ApprovalPolicyOptions, q as ApprovalSource, C as CatalogModel, s as CheckpointArgs, t as CommandClassification, u as CommandTier, v as CommandWords, D as DEFAULT_PLANNER_ALLOWLIST, w as DENY_ALL, x as DiscoveryCommand, E as EditPlanArgs, F as FetchAllProviderModelsOptions, G as GIT_READONLY_SUBCOMMANDS, H as InvokedCommand, L as LineBuffer, J as ListModelsArgs, K as ListRunnersArgs, M as LoadSkillArgs, N as McpClientConfig, O as McpCredential, P as McpTool, Q as McpToolContext, R as McpToolReply, S as MessageTaskArgs, T as ModelCatalog, U as ModelShortcut, V as ORCHESTRATOR_SHORTCUTS, W as ORDEWELL_MCP_PATH, X as ORDEWELL_MCP_SERVER_NAME, Y as OneTaskArgs, $ as OwnerOnlyFile, a0 as PLANNER_EXECUTION_TOOLS, a1 as PLANNER_TOOLS, a2 as PlannerAllowlist, a4 as PlannerStartOptions, a5 as PlannerTokenScope, a8 as ProviderCredentialSource, aa as ProviderModelsResult, ac as REFUSED_COMMANDS, ae as ResearchShellDeps, af as RetryTaskArgs, ag as RunCommandArgs, ah as RunPlanArgs, aj as RunnerCommandKind, ak as RunnerEntry, al as RunnerFeatures, an as RunnerMcpServer, ao as RunnerMode, ap as RunnerModelDiscovery, ar as ShellDialect, as as SpawnFn, at as StandingDecision, aw as SubmitPlanArgs, ax as TASK_COMPLETE_TOOL, ay as TASK_COMPLETION_CONTRACT, az as TASK_TOOLS, aB as TaskDiffArgs, aE as TaskModeUnsupportedError, aF as TaskOutputArgs, aG as TaskQueryArgs, aK as TaskToolHandler, aL as approvalScopes, aM as classifyCommand, aN as clearResearchShellCache, aO as collectProviderCredentials, aP as commandAllowedBy, aQ as effectiveApprovalMode, aR as enabledRunners, aS as fetchAllProviderModels, aT as findRunnerCommand, aU as isGranted, aV as isRunnerApproval, aW as knownModelId, aX as mcpClientConfig, aY as ownerOnlyConfigFile, aZ as parseAllowlist, a_ as parseApprovalModeSetting, a$ as researchShellWarning, b0 as researchToolsPath, b1 as resolveModelShortcut, b2 as resolveProvider, b3 as resolveResearchShell, b4 as scopeAllowed, b5 as sharedMcpServer, b6 as toApprovalDecision, b7 as toOrchestratorOptions, b8 as toolAllowed } from './IRunner-CXdYyIZo.mjs';
|
|
7
|
+
import { T as ToolOutcome, I as IFileSystem, R as ReadFileOpts, b as GrepOptions, a as GlobOptions, F as FindSymbolOptions } from './IFileSystem-B8Nkgg4e.mjs';
|
|
8
|
+
export { G as GREP_DEFAULT_HEAD_LIMIT, c as GrepOutputMode, S as SEARCH_EXCLUSIONS } from './IFileSystem-B8Nkgg4e.mjs';
|
|
9
|
+
import { R as RunnerModeInfo } from './ModeResolver-geqjKkLY.mjs';
|
|
10
|
+
export { a as autonomyLevelLabel, p as parseAutonomyLevel, r as runnerModesFrom } from './ModeResolver-geqjKkLY.mjs';
|
|
11
11
|
import { ChildProcess } from 'child_process';
|
|
12
12
|
import { EventEmitter } from 'events';
|
|
13
13
|
import 'zod/v4';
|
|
@@ -59,7 +59,7 @@ type ExecutionCommand = {
|
|
|
59
59
|
| {
|
|
60
60
|
command: 'merge_all';
|
|
61
61
|
}
|
|
62
|
-
/** End a task as skipped: nothing it did lands, and its dependents go ahead without it. `reason` is required of anyone but the user. */
|
|
62
|
+
/** End a task as skipped: nothing it did lands, and its dependents go ahead without it once the work it waited on is done. `reason` is required of anyone but the user. */
|
|
63
63
|
| {
|
|
64
64
|
command: 'skip_task';
|
|
65
65
|
task: string;
|
|
@@ -125,7 +125,7 @@ interface ExecutionHost {
|
|
|
125
125
|
planApproved(): boolean;
|
|
126
126
|
/** The user approved this task: it was in the plan they executed, or they started it themselves. */
|
|
127
127
|
taskApproved(taskId: string): boolean;
|
|
128
|
-
/** A
|
|
128
|
+
/** A start the user consented to approves these tasks, before it acts. */
|
|
129
129
|
approve(taskIds: readonly string[]): void;
|
|
130
130
|
/** Full autonomy: starts follow plan approval without a question. */
|
|
131
131
|
autonomous(): boolean;
|
|
@@ -137,14 +137,18 @@ interface ExecutionHost {
|
|
|
137
137
|
startsHeld(): boolean;
|
|
138
138
|
/** Work is running right now. */
|
|
139
139
|
hasLiveWork(): boolean;
|
|
140
|
+
/** Something will start without being asked again: a start admitted and not yet claimed, or a scheduled resume. */
|
|
141
|
+
startsPending(): boolean;
|
|
142
|
+
/** Admit a start that waits before it claims; see {@link StartAdmission}. */
|
|
143
|
+
admitStart(): StartAdmission;
|
|
140
144
|
/** The task's attempt is live: starting, running or landing. */
|
|
141
145
|
running(taskId: string): boolean;
|
|
142
146
|
maxParallel(): number;
|
|
143
147
|
/** The run waits on the user to stash or skip isolation before anything starts. */
|
|
144
148
|
runBlocked(): boolean;
|
|
145
|
-
/**
|
|
146
|
-
|
|
147
|
-
/** The
|
|
149
|
+
/** The tasks a task's dependencies still hold it back for: unmet dependencies, or the unfinished work behind a skipped one. */
|
|
150
|
+
unmetDependencies(task: Readonly<Task>): string[];
|
|
151
|
+
/** The ancestors a task would wait on at its merge gate if it started now, whatever its status (ADR-0020). */
|
|
148
152
|
mergeGate(taskId: string): string[];
|
|
149
153
|
/** The failed tasks a task not started waits on through its dependencies (ADR-0034). */
|
|
150
154
|
blockedBy(taskId: string): string[];
|
|
@@ -174,10 +178,16 @@ interface ExecutionHost {
|
|
|
174
178
|
* named — that lands only when its reply ends.
|
|
175
179
|
*/
|
|
176
180
|
heldEdit(taskId?: string): boolean;
|
|
177
|
-
/** The task as the open turn's held edit leaves it
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
|
|
181
|
+
/** The plan's task tree as the open turn's held edit leaves it: as it is, when it holds none or one that would not apply. */
|
|
182
|
+
editedTasks(): readonly Task[];
|
|
183
|
+
/** The id of the task the open turn's held edit makes under this batch handle; undefined when it names none. */
|
|
184
|
+
heldHandle(name: string): string | undefined;
|
|
185
|
+
/**
|
|
186
|
+
* Run the command again, as the same actor, once the open turn's reply has
|
|
187
|
+
* landed its edit; `intent` names it if it never does. `admission` is
|
|
188
|
+
* released once it has run or been dropped.
|
|
189
|
+
*/
|
|
190
|
+
deferUntilLanded(command: ExecutionCommand, actor: ExecutionActor, intent: string, admission: StartAdmission): void;
|
|
181
191
|
/** A command deferred behind an edit did not run once the edit landed: the user is told, and so is the planner's next turn. */
|
|
182
192
|
queuedNotRun(text: string): void;
|
|
183
193
|
}
|
|
@@ -204,34 +214,62 @@ declare class ExecutionCommands {
|
|
|
204
214
|
private readonly guards;
|
|
205
215
|
private readonly now;
|
|
206
216
|
constructor(deps: ExecutionCommandsDeps);
|
|
207
|
-
|
|
217
|
+
/**
|
|
218
|
+
* `admitted`: a deferred start's admission, taken as it was queued, which
|
|
219
|
+
* its owner releases; a start asked for now takes its own.
|
|
220
|
+
*/
|
|
221
|
+
run(asked: ExecutionCommand, actor: ExecutionActor, admitted?: StartAdmission): Promise<CommandOutcome>;
|
|
222
|
+
/** A valid, consented call, from the user's answer where one is needed to the act and its record. */
|
|
223
|
+
private carryOut;
|
|
208
224
|
/**
|
|
209
225
|
* A command deferred behind the turn's edit, run now that the edit landed.
|
|
210
226
|
* Nobody reads its answer, so one that does not run is kept as refused and
|
|
211
227
|
* said, to the user and to the planner's next turn.
|
|
212
228
|
*/
|
|
213
|
-
replay(command: ExecutionCommand, actor: ExecutionActor): Promise<void>;
|
|
229
|
+
replay(command: ExecutionCommand, actor: ExecutionActor, admission: StartAdmission): Promise<void>;
|
|
214
230
|
/**
|
|
215
|
-
* A start that waits for the turn's edit is judged now, against
|
|
231
|
+
* A start that waits for the turn's edit is judged now, against the plan as
|
|
216
232
|
* that edit leaves it — the edit counts as the change a retry needs — so one
|
|
217
|
-
* that could never run is refused while the caller still reads the answer
|
|
233
|
+
* that could never run is refused while the caller still reads the answer,
|
|
234
|
+
* and one the user will be asked about says so. `located` is the task as the
|
|
235
|
+
* plan has it now, absent for a task the edit adds.
|
|
218
236
|
*/
|
|
219
237
|
private judgeAsEdited;
|
|
220
238
|
private tripped;
|
|
239
|
+
/** `approves` is null for a start that runs without asking, else what the user's yes would approve. */
|
|
221
240
|
private defer;
|
|
241
|
+
/**
|
|
242
|
+
* The tasks a start approves, read from the plan as it stands at the
|
|
243
|
+
* command's last check. Autorun starts a plan as the user's standing
|
|
244
|
+
* instruction, so its start approves what it runs as the user's does; so
|
|
245
|
+
* does a start under its exception for added tasks. A yes on the card
|
|
246
|
+
* approves the tasks the card named, and no others.
|
|
247
|
+
*/
|
|
248
|
+
private consented;
|
|
222
249
|
/**
|
|
223
250
|
* With autorun on and Full, a planner turn may start a task added after the
|
|
224
251
|
* user approved the plan (ADR-0030). Read at each start, so switching either
|
|
225
252
|
* off stops it at once; never on a plan the user has not approved.
|
|
226
253
|
*/
|
|
227
254
|
private addedMayStart;
|
|
255
|
+
/**
|
|
256
|
+
* Guarded means "ask the user first": a planner start in the user's own
|
|
257
|
+
* turn asks, so tasks they have not approved go into the question rather
|
|
258
|
+
* than refusing it. The supervisor's starts stay within what the user
|
|
259
|
+
* approved (ADR-0029).
|
|
260
|
+
*/
|
|
261
|
+
private asksToApprove;
|
|
228
262
|
/**
|
|
229
263
|
* Who may do what without the mandate (#23): the user's own call needs no
|
|
230
264
|
* consent; a planner turn may always end or steer work, and starts it only
|
|
231
265
|
* as the autonomy level says; the supervisor's level decides for it.
|
|
232
266
|
*/
|
|
233
267
|
private consent;
|
|
234
|
-
/**
|
|
268
|
+
/**
|
|
269
|
+
* Whether the command can run now, and how, judged against `tasks`: the
|
|
270
|
+
* plan, or the plan as the turn's held edit leaves it. Read afresh after a
|
|
271
|
+
* question, since answering takes time.
|
|
272
|
+
*/
|
|
235
273
|
private prepare;
|
|
236
274
|
private prepareRunPlan;
|
|
237
275
|
/** A start of one task: `run_task`, or a fresh `retry_task`, which also takes a task that failed or waits on the user. */
|
|
@@ -261,9 +299,16 @@ declare class ExecutionCommands {
|
|
|
261
299
|
* waiting for input.
|
|
262
300
|
*/
|
|
263
301
|
private prepareSkip;
|
|
264
|
-
/**
|
|
302
|
+
/**
|
|
303
|
+
* Why a start is not the user's to have made, or the task it asks them to
|
|
304
|
+
* approve, or null: the user's own call is its own approval.
|
|
305
|
+
*/
|
|
265
306
|
private unapproved;
|
|
266
|
-
/**
|
|
307
|
+
/**
|
|
308
|
+
* The Guarded question, on the card the user answers other planner requests
|
|
309
|
+
* on. It names every task a yes approves, since a yes is the user's
|
|
310
|
+
* approval of them as Execute plan would be.
|
|
311
|
+
*/
|
|
267
312
|
private question;
|
|
268
313
|
/** What was asked, as "start task #4 "Title"". */
|
|
269
314
|
private intent;
|
|
@@ -271,6 +316,8 @@ declare class ExecutionCommands {
|
|
|
271
316
|
private keep;
|
|
272
317
|
private all;
|
|
273
318
|
private located;
|
|
319
|
+
/** A reference read against the plan as the held edit leaves it, where the handles its batch gives come first. */
|
|
320
|
+
private locateAsEdited;
|
|
274
321
|
/** A reference as a caller writes one — see {@link resolveTaskRef}. */
|
|
275
322
|
private locate;
|
|
276
323
|
}
|
|
@@ -1077,6 +1124,14 @@ declare class PlannerConversation {
|
|
|
1077
1124
|
* submission replaces an earlier one. False when no user turn is open.
|
|
1078
1125
|
*/
|
|
1079
1126
|
submit(submission: PlannerSubmission): boolean;
|
|
1127
|
+
/**
|
|
1128
|
+
* Tell surfaces what the turn's edit would leave, from the same applier that
|
|
1129
|
+
* lands it, so an edit that would not apply shows nothing. It stays shown
|
|
1130
|
+
* from the moment it is handed in until it lands, is refused, or the turn
|
|
1131
|
+
* ends: the backend's reply claims it, but it has not landed by then.
|
|
1132
|
+
*/
|
|
1133
|
+
private showHeld;
|
|
1134
|
+
private clearHeld;
|
|
1080
1135
|
/**
|
|
1081
1136
|
* The edit the open turn already holds, for a further edit in the same reply
|
|
1082
1137
|
* to join rather than replace. Empty when it holds nothing; null when it holds
|
|
@@ -1284,6 +1339,8 @@ declare class PlannerConversation {
|
|
|
1284
1339
|
private warnSkills;
|
|
1285
1340
|
/** Validate + commit a task_ops turn atomically. Returns the errors on rejection (plan untouched). */
|
|
1286
1341
|
private applyTaskOps;
|
|
1342
|
+
/** The edit was refused as it landed: what it showed is not coming. */
|
|
1343
|
+
private refusedHeld;
|
|
1287
1344
|
/** Commit a settled (non-task_ops) turn through the host's mutation ritual. */
|
|
1288
1345
|
private commit;
|
|
1289
1346
|
/**
|
|
@@ -1847,8 +1904,48 @@ declare function formatSearchOutput(capped: CappedRows, root: string, opts: {
|
|
|
1847
1904
|
}): string;
|
|
1848
1905
|
|
|
1849
1906
|
declare function normalizeGeminiModel(id: string): string;
|
|
1907
|
+
/** A model and the effort it was chosen with; blank is the planner's own default. */
|
|
1908
|
+
interface PlannerChoice {
|
|
1909
|
+
model: string;
|
|
1910
|
+
effort: string;
|
|
1911
|
+
}
|
|
1912
|
+
/**
|
|
1913
|
+
* Where a resolved model and effort came from. `configured` is a planner the
|
|
1914
|
+
* user named, or a vendor, as configured; for an agent detection found,
|
|
1915
|
+
* `inherited` is a configured model it can run. A planner whose configured
|
|
1916
|
+
* model is not its own gets `remembered`, its last pick, or `none`, its own
|
|
1917
|
+
* default; `request` is one request's model. Only `configured` and
|
|
1918
|
+
* `remembered` are the user's own choice for that planner.
|
|
1919
|
+
*/
|
|
1920
|
+
type PlannerModelSource = 'configured' | 'inherited' | 'remembered' | 'request' | 'none';
|
|
1921
|
+
interface ResolvedChoice extends PlannerChoice {
|
|
1922
|
+
source: PlannerModelSource;
|
|
1923
|
+
}
|
|
1924
|
+
/** Who plans, and the model and effort it is spawned with. */
|
|
1925
|
+
interface ResolvedPlanner extends ResolvedChoice {
|
|
1926
|
+
provider: PlannerBackendId;
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* What a host is configured to plan with. The model and effort are inherited
|
|
1930
|
+
* (the environment or `.env` at startup, an editor setting) unless the planner
|
|
1931
|
+
* was named — `setting` (VS Code's `aiProvider`) or AI_PROVIDER — or the
|
|
1932
|
+
* model was picked in this session.
|
|
1933
|
+
*/
|
|
1934
|
+
interface ConfiguredPlanner extends PlannerChoice {
|
|
1935
|
+
setting?: string;
|
|
1936
|
+
/**
|
|
1937
|
+
* The planner a `/model` or `/planner` pick in this session made the model
|
|
1938
|
+
* for. A pick belongs to that planner alone: once routing moves (its key
|
|
1939
|
+
* removed), the model is configuration left for when it comes back, not a
|
|
1940
|
+
* choice the planner now in effect made.
|
|
1941
|
+
*/
|
|
1942
|
+
pickedFor?: PlannerBackendId;
|
|
1943
|
+
/** One request's own model: it wins for that request and is never saved. */
|
|
1944
|
+
override?: string;
|
|
1945
|
+
}
|
|
1850
1946
|
declare abstract class BaseConfig implements IConfig {
|
|
1851
|
-
|
|
1947
|
+
private _routed;
|
|
1948
|
+
abstract aiProvider: PlannerBackendId;
|
|
1852
1949
|
abstract apiKey: string;
|
|
1853
1950
|
abstract planningModel: string;
|
|
1854
1951
|
abstract enabledRunners: string[];
|
|
@@ -1864,6 +1961,7 @@ declare abstract class BaseConfig implements IConfig {
|
|
|
1864
1961
|
get researchSubagentModel(): string;
|
|
1865
1962
|
get geminiModel(): string;
|
|
1866
1963
|
get plannerThinkingEffort(): string | undefined;
|
|
1964
|
+
private environmentPlannerChoice;
|
|
1867
1965
|
get openaiBaseUrl(): string;
|
|
1868
1966
|
get openaiApiKey(): string;
|
|
1869
1967
|
get xaiBaseUrl(): string;
|
|
@@ -1928,8 +2026,69 @@ declare abstract class BaseConfig implements IConfig {
|
|
|
1928
2026
|
get webReadBudget(): number;
|
|
1929
2027
|
get approvalDefaults(): boolean;
|
|
1930
2028
|
get approvalPreApproved(): string[];
|
|
1931
|
-
|
|
2029
|
+
/**
|
|
2030
|
+
* Who plans when no surface setting names a planner: an explicit
|
|
2031
|
+
* AI_PROVIDER, then a vendor whose key is in the environment,
|
|
2032
|
+
* then an installed coding agent (ADR-0009), and openrouter only when there
|
|
2033
|
+
* is none of those. One answer for every host, so they cannot drift apart.
|
|
2034
|
+
*/
|
|
2035
|
+
protected detectProvider(): PlannerBackendId;
|
|
2036
|
+
/**
|
|
2037
|
+
* Who plans when no surface setting names a planner: an explicit
|
|
2038
|
+
* AI_PROVIDER, then the vendor whose catalog lists the model, else
|
|
2039
|
+
* `detectProvider`. The explicit choice comes first because a model id can
|
|
2040
|
+
* sit in another vendor's catalog (`openai/gpt-4o` is on OpenRouter too),
|
|
2041
|
+
* and the user named the planner, not the catalog. A vendor without a
|
|
2042
|
+
* credential yields to an installed coding agent, because the TUI and
|
|
2043
|
+
* `ordewell planner` persist ORCHESTRATOR_MODEL, and a model left over from
|
|
2044
|
+
* a removed key would otherwise route a keyless first run to a planner that
|
|
2045
|
+
* cannot plan. Without an agent the vendor still answers, so the preflight
|
|
2046
|
+
* names it.
|
|
2047
|
+
*/
|
|
2048
|
+
protected providerForModel(model: string | undefined, lists: ProviderModelLists | null | undefined): PlannerBackendId;
|
|
2049
|
+
/**
|
|
2050
|
+
* `providerForModel`, memoized against everything it reads rather than a
|
|
2051
|
+
* flag each writer must remember to reset. A host keeps one config for a
|
|
2052
|
+
* whole session or extension lifetime while keys, AI_PROVIDER, the model and
|
|
2053
|
+
* the installed agent all change underneath it, from writers (a secret-store
|
|
2054
|
+
* event, a settings route, the startup probe) that never see this instance;
|
|
2055
|
+
* the memo must answer what a fresh config would. The lists are compared by
|
|
2056
|
+
* identity because a host swaps the whole object on discovery.
|
|
2057
|
+
*/
|
|
2058
|
+
protected routedProvider(model: string | undefined, lists: ProviderModelLists | null | undefined): PlannerBackendId;
|
|
2059
|
+
/**
|
|
2060
|
+
* Who plans, with which model and effort: the one rule every host's
|
|
2061
|
+
* provider, model and effort getters read, so what a settings response
|
|
2062
|
+
* shows is what is spawned. Resolved on each read and never saved: a key or
|
|
2063
|
+
* a `/planner` pick added later must find the configured values as they were.
|
|
2064
|
+
*/
|
|
2065
|
+
protected resolvePlanner(configured: ConfiguredPlanner, lists: ProviderModelLists | null | undefined): ResolvedPlanner;
|
|
2066
|
+
/**
|
|
2067
|
+
* `resolvePlanner`'s model and effort, for a getter that reads its model
|
|
2068
|
+
* from other settings than the one `provider` was routed on
|
|
2069
|
+
* (`planningModel`): judged against the planner in effect rather than
|
|
2070
|
+
* routed again. A model picked in this session for this planner and a
|
|
2071
|
+
* vendor's configured model are kept; a model picked for another planner
|
|
2072
|
+
* is not this one's. A coding agent the user named keeps what is
|
|
2073
|
+
* configured unless it is plainly a vendor's: naming the agent did not
|
|
2074
|
+
* choose a slug left from an old setup. A request's own model wins.
|
|
2075
|
+
*/
|
|
2076
|
+
protected plannerChoiceFor(provider: PlannerBackendId, configured: ConfiguredPlanner): ResolvedChoice;
|
|
2077
|
+
/**
|
|
2078
|
+
* The model ids a coding agent was last discovered serving, empty while
|
|
2079
|
+
* discovery is cold. A host that holds a runner catalog supplies it: it is
|
|
2080
|
+
* the only evidence that tells OpenCode's `provider/model` ids from an
|
|
2081
|
+
* OpenRouter slug.
|
|
2082
|
+
*/
|
|
2083
|
+
protected agentCatalog(_provider: PlannerBackendId): readonly string[];
|
|
1932
2084
|
}
|
|
2085
|
+
/**
|
|
2086
|
+
* Plainly a vendor's model, which coding agent `agent` cannot run: every
|
|
2087
|
+
* vendor catalog id carries Ordewell's prefix (`openai:`) or is an OpenRouter
|
|
2088
|
+
* `org/model` slug, a shape an agent that names its own models that way
|
|
2089
|
+
* cannot rule out.
|
|
2090
|
+
*/
|
|
2091
|
+
declare function isVendorModelFor(agent: PlannerBackendId, model: string): boolean;
|
|
1933
2092
|
|
|
1934
2093
|
/**
|
|
1935
2094
|
* A fully `process.env`-backed IConfig for headless callers (e.g. the CLI's
|
|
@@ -1938,7 +2097,7 @@ declare abstract class BaseConfig implements IConfig {
|
|
|
1938
2097
|
* subclass only supplies the abstract members from the environment.
|
|
1939
2098
|
*/
|
|
1940
2099
|
declare class EnvConfig extends BaseConfig {
|
|
1941
|
-
get aiProvider():
|
|
2100
|
+
get aiProvider(): PlannerBackendId;
|
|
1942
2101
|
get apiKey(): string;
|
|
1943
2102
|
get planningModel(): string;
|
|
1944
2103
|
get enabledRunners(): string[];
|
|
@@ -2160,6 +2319,8 @@ declare class OpenAiService extends BaseAiService implements IAiService {
|
|
|
2160
2319
|
* key the user had already replaced.
|
|
2161
2320
|
*/
|
|
2162
2321
|
private getClient;
|
|
2322
|
+
/** The vendor this service talks to; `createAiService` routes every other planner elsewhere. */
|
|
2323
|
+
private vendor;
|
|
2163
2324
|
ensureInit(): void;
|
|
2164
2325
|
private requireModel;
|
|
2165
2326
|
reset(): void;
|
|
@@ -2338,16 +2499,44 @@ declare class RunnerInstallation {
|
|
|
2338
2499
|
clear(): void;
|
|
2339
2500
|
}
|
|
2340
2501
|
|
|
2341
|
-
|
|
2342
|
-
declare
|
|
2502
|
+
/** The first of {@link findInstalledAgents}; null when none is usable. */
|
|
2503
|
+
declare function findInstalledPlanner(installation: Pick<RunnerInstallation, 'plannerUsability'>): Promise<PlannerBackendId | null>;
|
|
2504
|
+
/**
|
|
2505
|
+
* Find the installed agent and record it, for a host to start at startup. A
|
|
2506
|
+
* goal can be typed before the probe answers, so every planner turn waits on
|
|
2507
|
+
* {@link installedPlannerDetected} rather than planning with openrouter.
|
|
2508
|
+
*/
|
|
2509
|
+
declare function detectInstalledPlanner(installation: Pick<RunnerInstallation, 'plannerUsability'>): Promise<PlannerBackendId | null>;
|
|
2510
|
+
/** Settles once the latest probe has recorded its answer; at once when none was started. */
|
|
2511
|
+
declare function installedPlannerDetected(): Promise<void>;
|
|
2512
|
+
/**
|
|
2513
|
+
* Whether the latest probe has recorded its answer, for a check that must run
|
|
2514
|
+
* at once when it can: a planner preflight read while the probe is out would
|
|
2515
|
+
* judge the openrouter fallback the answer may replace.
|
|
2516
|
+
*/
|
|
2517
|
+
declare function installedPlannerAnswered(): boolean;
|
|
2518
|
+
declare function recordInstalledPlanner(id: PlannerBackendId | null): void;
|
|
2519
|
+
declare function recordedInstalledPlanner(): PlannerBackendId | null;
|
|
2520
|
+
/**
|
|
2521
|
+
* The runners enabled while the user has never saved a choice: the agents the
|
|
2522
|
+
* latest probe found installed, so a Codex-only or OpenCode-only host can plan
|
|
2523
|
+
* and run on its first start; DEFAULT_RUNNERS while none was found or no probe
|
|
2524
|
+
* has answered. Read on each call and never saved, so an agent installed later
|
|
2525
|
+
* joins on the next probe and a saved choice — even an empty one — still wins.
|
|
2526
|
+
* Every host's config reads it here, so the daemon, CLI, TUI and VS Code agree.
|
|
2527
|
+
*/
|
|
2528
|
+
declare function defaultEnabledRunners(): RunnerId[];
|
|
2529
|
+
/** For tests: the recorded default is process-wide, so one case's must not decide the next's. */
|
|
2530
|
+
declare function resetInstalledPlanner(): void;
|
|
2531
|
+
|
|
2343
2532
|
interface ProviderRegistration {
|
|
2344
|
-
id:
|
|
2533
|
+
id: PlannerBackendId;
|
|
2345
2534
|
label: string;
|
|
2346
2535
|
shortLabel: string;
|
|
2347
2536
|
/** `cli` is a harness planner (ADR-0009): a local coding agent, not an HTTP vendor. */
|
|
2348
2537
|
serviceType: 'openai' | 'google' | 'cli';
|
|
2349
2538
|
/** Harness planners only: the runner id whose manifest, models and binary this provider drives. */
|
|
2350
|
-
runnerId?:
|
|
2539
|
+
runnerId?: RunnerId;
|
|
2351
2540
|
defaultBaseUrl: string;
|
|
2352
2541
|
apiKeyEnvVar: string;
|
|
2353
2542
|
detectEnvVars: string[];
|
|
@@ -2358,10 +2547,25 @@ interface ProviderRegistration {
|
|
|
2358
2547
|
discoversModels: boolean;
|
|
2359
2548
|
modelPrefix?: string;
|
|
2360
2549
|
}
|
|
2361
|
-
declare const
|
|
2550
|
+
declare const PROVIDER_PRIORITY: AiProvider[];
|
|
2551
|
+
declare const PROVIDER_DETECT_PRIORITY: AiProvider[];
|
|
2552
|
+
|
|
2553
|
+
/**
|
|
2554
|
+
* Keyed by planner backend: every vendor has an entry, and a runner id has one
|
|
2555
|
+
* only when that runner can plan, which the type cannot know.
|
|
2556
|
+
*/
|
|
2557
|
+
type ByPlannerBackend<T> = Readonly<Record<AiProvider, T>> & Readonly<Partial<Record<RunnerId, T>>>;
|
|
2558
|
+
declare const ALL_PROVIDERS: ByPlannerBackend<ProviderRegistration>;
|
|
2559
|
+
declare const PROVIDER_LABEL: ByPlannerBackend<string>;
|
|
2560
|
+
declare const PROVIDER_SHORT_LABEL: ByPlannerBackend<string>;
|
|
2362
2561
|
declare function getProviderMeta(id: AiProvider): ProviderRegistration;
|
|
2363
|
-
declare function
|
|
2364
|
-
|
|
2562
|
+
declare function getProviderMeta(id: PlannerBackendId): ProviderRegistration | undefined;
|
|
2563
|
+
/** Whether a planner backend id names an API vendor, the kind that takes a key and a base URL. */
|
|
2564
|
+
declare function isApiProvider(id: PlannerBackendId): id is AiProvider;
|
|
2565
|
+
/** Whether an id names a planner backend at all: a vendor, or a runner that can plan. */
|
|
2566
|
+
declare function isPlannerBackend(id: string): id is PlannerBackendId;
|
|
2567
|
+
declare function prefixModelId(provider: PlannerBackendId, modelId: string): string;
|
|
2568
|
+
declare function stripModelPrefix(id: string, provider: PlannerBackendId): string;
|
|
2365
2569
|
declare function resolveProviderFromPrefix(id: string): AiProvider | null;
|
|
2366
2570
|
/**
|
|
2367
2571
|
* The harness planners, in display order. Deliberately NOT part of
|
|
@@ -2371,10 +2575,8 @@ declare function resolveProviderFromPrefix(id: string): AiProvider | null;
|
|
|
2371
2575
|
* that offer a planner picker concatenate the two lists and gate these on
|
|
2372
2576
|
* `RunnerInstallation.plannerUsability`.
|
|
2373
2577
|
*/
|
|
2374
|
-
declare const CLI_PROVIDERS:
|
|
2375
|
-
declare
|
|
2376
|
-
declare const PROVIDER_DETECT_PRIORITY: AiProvider[];
|
|
2377
|
-
declare function isOpenAiProvider(id: AiProvider): boolean;
|
|
2578
|
+
declare const CLI_PROVIDERS: readonly RunnerId[];
|
|
2579
|
+
declare function isOpenAiProvider(id: PlannerBackendId): boolean;
|
|
2378
2580
|
/**
|
|
2379
2581
|
* The one guard that separates a harness planner from an LLM vendor (ADR-0009).
|
|
2380
2582
|
* Three places consult it: API-key resolution (skipped — the subscription is
|
|
@@ -2382,24 +2584,24 @@ declare function isOpenAiProvider(id: AiProvider): boolean;
|
|
|
2382
2584
|
* the planner-model picker (fed by per-runner discovery, not the vendor
|
|
2383
2585
|
* catalog).
|
|
2384
2586
|
*/
|
|
2385
|
-
declare function isCliProvider(id:
|
|
2386
|
-
/** The runner a harness planner drives, or null for a vendor provider. */
|
|
2387
|
-
declare function runnerForProvider(id:
|
|
2587
|
+
declare function isCliProvider(id: PlannerBackendId): boolean;
|
|
2588
|
+
/** The runner a harness planner drives, or null for a vendor provider or an unknown id. */
|
|
2589
|
+
declare function runnerForProvider(id: PlannerBackendId): RunnerId | null;
|
|
2388
2590
|
/** The harness planner that wraps a given runner, or null when none does. */
|
|
2389
|
-
declare function providerForRunner(runner:
|
|
2591
|
+
declare function providerForRunner(runner: RunnerId): PlannerBackendId | null;
|
|
2390
2592
|
/** One runner's planner usability, as `RunnerInstallation.plannerUsability` reports it. */
|
|
2391
2593
|
interface PlannerUsability {
|
|
2392
2594
|
usable: boolean;
|
|
2393
2595
|
reason?: string;
|
|
2394
2596
|
}
|
|
2395
2597
|
/**
|
|
2396
|
-
* One entry of the planner backend list (ADR-0009). `id` is the
|
|
2397
|
-
* either way; `runner` is set only for a harness planner, whose model catalog
|
|
2598
|
+
* One entry of the planner backend list (ADR-0009). `id` is the
|
|
2599
|
+
* `PlannerBackendId` either way; `runner` is set only for a harness planner, whose model catalog
|
|
2398
2600
|
* comes from that runner, and `reason` is the second line a surface renders —
|
|
2399
2601
|
* the block detail for a harness planner, the API-key variable for a vendor.
|
|
2400
2602
|
*/
|
|
2401
2603
|
interface PlannerBackendEntry {
|
|
2402
|
-
id:
|
|
2604
|
+
id: PlannerBackendId;
|
|
2403
2605
|
label: string;
|
|
2404
2606
|
kind: 'harness' | 'vendor';
|
|
2405
2607
|
runner?: string;
|
|
@@ -3270,7 +3472,7 @@ interface RunnerCatalog {
|
|
|
3270
3472
|
|
|
3271
3473
|
type ModelsByRunner = Partial<Record<RunnerId, DiscoveredModel[]>>;
|
|
3272
3474
|
interface SessionCatalogDeps {
|
|
3273
|
-
config: Pick<IConfig, 'enabledRunners' | 'autonomousMode'>;
|
|
3475
|
+
config: Pick<IConfig, 'enabledRunners' | 'autonomousMode' | 'aiProvider'>;
|
|
3274
3476
|
registry: Pick<RunnerRegistry, 'getManifest'>;
|
|
3275
3477
|
modelResolver: Pick<ModelResolver, 'modelsForRunners' | 'getCachedRunnerModels'>;
|
|
3276
3478
|
/** Read at each call: a toggle or allowlist edit made since the session was built counts (#69). */
|
|
@@ -3400,6 +3602,8 @@ interface SessionEventRelayDeps {
|
|
|
3400
3602
|
awaitingApproval?: (taskId: string) => number;
|
|
3401
3603
|
/** What a task's waiting checkpoint asks, whole. */
|
|
3402
3604
|
checkpointQuestion?: (taskId: string) => string | undefined;
|
|
3605
|
+
/** The task waits for the user's approval to start (ADR-0035). */
|
|
3606
|
+
waitsForApproval?: (taskId: string) => boolean;
|
|
3403
3607
|
}
|
|
3404
3608
|
/**
|
|
3405
3609
|
* Every orchestrator event the relay announces. `onTaskSettled` is persistence
|
|
@@ -3426,6 +3630,7 @@ declare class SessionEventRelay {
|
|
|
3426
3630
|
private readonly usage;
|
|
3427
3631
|
private readonly awaitingApproval;
|
|
3428
3632
|
private readonly checkpointQuestion;
|
|
3633
|
+
private readonly waitsForApproval;
|
|
3429
3634
|
/**
|
|
3430
3635
|
* The in-flight turn's subagent activity, grouped one run per subagent so a
|
|
3431
3636
|
* replay nests each step under its own brief/result. Folded into the plan's
|
|
@@ -3434,6 +3639,8 @@ declare class SessionEventRelay {
|
|
|
3434
3639
|
private pendingSubagents;
|
|
3435
3640
|
private statusHeld;
|
|
3436
3641
|
private statusOwed;
|
|
3642
|
+
/** The planner's requests announced and not yet settled, as they were announced: a surface joining now is owed them. */
|
|
3643
|
+
private readonly announced;
|
|
3437
3644
|
constructor(deps: SessionEventRelayDeps);
|
|
3438
3645
|
/** `plan` is read per event: a Session with no plan (or mid-reset) announces nothing about tasks. */
|
|
3439
3646
|
observer(plan: () => LegacyPlanState | null): RelayObserver;
|
|
@@ -3450,6 +3657,14 @@ declare class SessionEventRelay {
|
|
|
3450
3657
|
*/
|
|
3451
3658
|
holdStatus<T>(op: () => T): T;
|
|
3452
3659
|
releaseStatus(plan: LegacyPlanState | null): void;
|
|
3660
|
+
approvalRequested(request: Extract<SessionMessage, {
|
|
3661
|
+
type: 'approval_request';
|
|
3662
|
+
}>): void;
|
|
3663
|
+
approvalSettled(id: string, granted: boolean): void;
|
|
3664
|
+
/** The planner's approval requests still waiting, in the order they were asked. */
|
|
3665
|
+
announcedApprovals(): Extract<SessionMessage, {
|
|
3666
|
+
type: 'approval_request';
|
|
3667
|
+
}>[];
|
|
3453
3668
|
executionComplete(plan: LegacyPlanState | null): void;
|
|
3454
3669
|
/** `turnId`: the planner turn whose commit this is, when one is. */
|
|
3455
3670
|
planGenerated(plan: LegacyPlanState | null, goal: string, turnId?: string): void;
|
|
@@ -3650,6 +3865,8 @@ declare class Session {
|
|
|
3650
3865
|
* supervisor has first.
|
|
3651
3866
|
*/
|
|
3652
3867
|
private sentHandoff;
|
|
3868
|
+
/** The edit the open planner turn holds, as last announced: a surface that joins mid-turn is shown it. */
|
|
3869
|
+
private sentHeld;
|
|
3653
3870
|
private readonly notifications;
|
|
3654
3871
|
private readonly onNotice?;
|
|
3655
3872
|
private readonly modelResolver;
|
|
@@ -3667,6 +3884,15 @@ declare class Session {
|
|
|
3667
3884
|
private readonly skillsService;
|
|
3668
3885
|
private readonly conversation;
|
|
3669
3886
|
private readonly turns;
|
|
3887
|
+
/** Destroyed: a turn that waited for the planner to be found must not open on it. */
|
|
3888
|
+
private closed;
|
|
3889
|
+
/**
|
|
3890
|
+
* Turns PlanTurns does not open, waiting at the planner gate, each ended
|
|
3891
|
+
* with why it must not open: a Stop, a newer goal, or its plan scope ending.
|
|
3892
|
+
*/
|
|
3893
|
+
private readonly openingsWaiting;
|
|
3894
|
+
/** The conversation's opening, from admission until its turn settles; see {@link behindOpening}. */
|
|
3895
|
+
private opening;
|
|
3670
3896
|
private readonly editor;
|
|
3671
3897
|
private readonly commands;
|
|
3672
3898
|
private readonly supervision;
|
|
@@ -3711,7 +3937,11 @@ declare class Session {
|
|
|
3711
3937
|
* one: nothing it would start is approved until the user executes it.
|
|
3712
3938
|
*/
|
|
3713
3939
|
private heldEdit;
|
|
3714
|
-
/** The
|
|
3940
|
+
/** The plan's tasks as the open turn's held edit leaves them: as they are, when it holds none or one that would not apply. */
|
|
3941
|
+
private editedTasks;
|
|
3942
|
+
/** {@link editedTasks}, with the id each of the held batch's handles names in them. */
|
|
3943
|
+
private editedPlan;
|
|
3944
|
+
/** The task as the open turn's held edit leaves it; undefined when that edit removes it. */
|
|
3715
3945
|
private asEdited;
|
|
3716
3946
|
/** The open planner turn is the supervisor's, acting at Act: its edits and added tasks are its own (ADR-0029). */
|
|
3717
3947
|
private supervisorEditing;
|
|
@@ -3740,8 +3970,24 @@ declare class Session {
|
|
|
3740
3970
|
private userRunSettings;
|
|
3741
3971
|
/** A call at the seam, in the transcript where it happened and on every surface at once. */
|
|
3742
3972
|
private recordExecution;
|
|
3973
|
+
/**
|
|
3974
|
+
* Whether the user approved this task to run (ADR-0029, ADR-0035): it was in
|
|
3975
|
+
* the plan they executed, or they started it, added it or let it start since,
|
|
3976
|
+
* and it has been in the plan ever since. The one reading of the approval
|
|
3977
|
+
* record — the seam and the scheduler both ask it.
|
|
3978
|
+
*/
|
|
3979
|
+
isApproved(taskId: string): boolean;
|
|
3980
|
+
/** A task the scheduler leaves for the user to approve; see {@link waitsForApproval}. */
|
|
3981
|
+
waitsForApproval(taskId: string): boolean;
|
|
3743
3982
|
/** What the user approved to run (ADR-0029): a start of their own approves the task and its subtasks. */
|
|
3744
3983
|
private approve;
|
|
3984
|
+
/**
|
|
3985
|
+
* A task that leaves the plan takes its approval with it, whichever route
|
|
3986
|
+
* removed it: an edit, a merge or split, a whole plan that leaves it out.
|
|
3987
|
+
* Approval is of the task the user saw, and a planner may later write a new
|
|
3988
|
+
* task under the same id (ADR-0029).
|
|
3989
|
+
*/
|
|
3990
|
+
private keepApprovals;
|
|
3745
3991
|
private approveTask;
|
|
3746
3992
|
/**
|
|
3747
3993
|
* Answer an outstanding approval. Every surface funnels here — the web
|
|
@@ -3751,6 +3997,10 @@ declare class Session {
|
|
|
3751
3997
|
resolveApproval(id: string, answer: ApprovalAnswer): boolean;
|
|
3752
3998
|
/** Requests still waiting for an answer, replayed to a surface that connects mid-prompt. */
|
|
3753
3999
|
outstandingApprovals(): PendingApproval[];
|
|
4000
|
+
/** The planner's requests still waiting, as their cards were announced — what a surface (re)joining replays. */
|
|
4001
|
+
announcedApprovals(): Extract<SessionMessage, {
|
|
4002
|
+
type: 'approval_request';
|
|
4003
|
+
}>[];
|
|
3754
4004
|
/** Scopes the user granted this session — surfaced so a UI can show what is already allowed. */
|
|
3755
4005
|
approvedScopes(): string[];
|
|
3756
4006
|
/** The stable id this session persists under — matches the host's id when one was provided. */
|
|
@@ -3834,20 +4084,64 @@ declare class Session {
|
|
|
3834
4084
|
/** See {@link TaskOrchestrator.hasLiveWork} — a spawned runner, not merely an armed scheduler. */
|
|
3835
4085
|
get isExecuting(): boolean;
|
|
3836
4086
|
get status(): 'approved' | 'running' | 'completed';
|
|
3837
|
-
/**
|
|
4087
|
+
/**
|
|
4088
|
+
* Throws {@link PlannerNotReadyError} when the planner this session's config
|
|
4089
|
+
* selects cannot plan. Judged on the session's own config, so a model
|
|
4090
|
+
* override sent with the request is the one judged; every planner turn
|
|
4091
|
+
* passes it, and a host may call it first to refuse before it builds on
|
|
4092
|
+
* the session.
|
|
4093
|
+
*/
|
|
4094
|
+
assertPlannerReady(): void;
|
|
4095
|
+
/**
|
|
4096
|
+
* The planner gate for a turn {@link PlanTurns} does not open — an opening,
|
|
4097
|
+
* plan generation, a compaction — the same one its turns pass: wait for the
|
|
4098
|
+
* installed-planner probe, then judge the planner in use now. A wait is
|
|
4099
|
+
* ended at once, not when the probe answers, by its caller's abort, a Stop,
|
|
4100
|
+
* a newer goal or its plan scope ending ({@link endWaiting}): a turn that
|
|
4101
|
+
* only learnt of these afterwards would open on a session that moved on.
|
|
4102
|
+
*
|
|
4103
|
+
* Null when the turn may open at once: awaited regardless, the turn would
|
|
4104
|
+
* take the conversation a tick late, and a message sent alongside it would
|
|
4105
|
+
* no longer be refused as one sent during it.
|
|
4106
|
+
*/
|
|
4107
|
+
private plannerTurnMayOpen;
|
|
4108
|
+
/** End every turn waiting at the planner gate before it opens; false when none was. */
|
|
4109
|
+
private endWaiting;
|
|
4110
|
+
/**
|
|
4111
|
+
* Whether a planner turn — a reply, a compaction, plan generation — holds
|
|
4112
|
+
* the conversation, or one admitted waits at the planner gate to: a host
|
|
4113
|
+
* that read the wait as idle sent a follow-up as a new goal.
|
|
4114
|
+
*/
|
|
3838
4115
|
get isPlannerBusy(): boolean;
|
|
3839
4116
|
/**
|
|
3840
4117
|
* Stop the planner turn in flight. It still settles — a backend hands back
|
|
3841
|
-
* what it had — and ends as stopped.
|
|
4118
|
+
* what it had — and ends as stopped. A turn still waiting at the planner
|
|
4119
|
+
* gate is stopped too, before it opens, and so is every message sent behind
|
|
4120
|
+
* either: the user stopped the planner, not one turn of it. False when
|
|
4121
|
+
* there was neither.
|
|
3842
4122
|
*/
|
|
3843
4123
|
abortPlannerTurn(): boolean;
|
|
3844
|
-
|
|
4124
|
+
/**
|
|
4125
|
+
* The runners a first turn may plan for. None requested means every enabled
|
|
4126
|
+
* one, read here, after the planner gate: until the installed-agent probe
|
|
4127
|
+
* answers, the enabled default is a stale guess a request must not freeze.
|
|
4128
|
+
*/
|
|
4129
|
+
private chosenRunners;
|
|
4130
|
+
generatePlan(goal: string, runners?: RunnerId[], options?: GeneratePlanOptions): Promise<LegacyPlanState>;
|
|
3845
4131
|
/**
|
|
3846
4132
|
* Kick off the planner conversation (ADR-0002): research + the first planner
|
|
3847
4133
|
* message. The conversation itself — transcript, live model context, turn
|
|
3848
4134
|
* settlement — is {@link PlannerConversation}'s; the Session hosts it.
|
|
3849
4135
|
*/
|
|
3850
|
-
startPlanning(goal: string, runners
|
|
4136
|
+
startPlanning(goal: string, runners?: RunnerId[], options?: GeneratePlanOptions): Promise<LegacyPlanState>;
|
|
4137
|
+
/**
|
|
4138
|
+
* A message sent while the conversation's opening is pending answers it, so
|
|
4139
|
+
* it goes after it rather than replacing the goal or being refused: held
|
|
4140
|
+
* while the opening waits at the planner gate — there is no conversation
|
|
4141
|
+
* yet to queue it on — and queued behind it once it holds the conversation.
|
|
4142
|
+
* Null with no opening pending.
|
|
4143
|
+
*/
|
|
4144
|
+
private behindOpening;
|
|
3851
4145
|
/**
|
|
3852
4146
|
* Every subsequent user reply in the planning conversation — clarifying
|
|
3853
4147
|
* answers, outline confirm, a message during a run. One branch, no phase
|
|
@@ -4023,7 +4317,7 @@ declare class Session {
|
|
|
4023
4317
|
* last did is not kept, so it is not here.
|
|
4024
4318
|
*/
|
|
4025
4319
|
runSnapshot(): RunView;
|
|
4026
|
-
/** The
|
|
4320
|
+
/** The ancestors a task waits on at its merge gate (ADR-0020); empty when it waits for no Merge all. */
|
|
4027
4321
|
mergeGate(taskId: string): string[];
|
|
4028
4322
|
/** What Merge all would merge now; null once everything landed is merged. */
|
|
4029
4323
|
runMergeView(): RunMergeView | null;
|
|
@@ -4050,7 +4344,15 @@ declare class Session {
|
|
|
4050
4344
|
private requireSettledRun;
|
|
4051
4345
|
/** Add the task that merges a conflicted task's branch by hand; see {@link PlanEditor.addConflictResolver}. */
|
|
4052
4346
|
resolveConflictAsTask(taskId: string): Promise<LegacyPlanState | null>;
|
|
4347
|
+
/**
|
|
4348
|
+
* The user's Stop (ADR-0029): the run, and every start admitted before it —
|
|
4349
|
+
* one queued behind a planner turn's edit, one waiting on its card, one
|
|
4350
|
+
* still opening its run. A card still asking is cleared, so its start
|
|
4351
|
+
* answers as stopped rather than waiting on a question that no longer stands.
|
|
4352
|
+
*/
|
|
4053
4353
|
stopExecution(): void;
|
|
4354
|
+
/** Something will start without being asked again; see {@link TaskOrchestrator.startsPending}. */
|
|
4355
|
+
get startsPending(): boolean;
|
|
4054
4356
|
/**
|
|
4055
4357
|
* Run a user control and save what it changed before any surface hears of
|
|
4056
4358
|
* it. Not a status hold, as {@link saved} is: these await spawns and git, so
|
|
@@ -4122,6 +4424,66 @@ declare class PlanEditError extends Error {
|
|
|
4122
4424
|
constructor(message: string);
|
|
4123
4425
|
}
|
|
4124
4426
|
|
|
4427
|
+
/** What the preflight reads: the planner choice and whatever it needs to be reachable. */
|
|
4428
|
+
type PlannerReadinessConfig = Pick<IConfig, 'aiProvider' | 'planningModel' | 'openaiCompatibleBaseUrl' | 'getProviderApiKey'>;
|
|
4429
|
+
/**
|
|
4430
|
+
* Why the selected planner cannot plan yet, as data. Each surface words it with
|
|
4431
|
+
* its own command spelling (`describePlannerNotReady`), so a daemon, a chat and
|
|
4432
|
+
* a shell script can all say the same thing without sharing a syntax.
|
|
4433
|
+
*/
|
|
4434
|
+
type PlannerNotReady = {
|
|
4435
|
+
code: 'no_key';
|
|
4436
|
+
provider: AiProvider;
|
|
4437
|
+
label: string;
|
|
4438
|
+
keyEnvVar: string;
|
|
4439
|
+
} | {
|
|
4440
|
+
code: 'no_base_url';
|
|
4441
|
+
provider: AiProvider;
|
|
4442
|
+
label: string;
|
|
4443
|
+
baseUrlEnvVar: string;
|
|
4444
|
+
} | {
|
|
4445
|
+
code: 'no_model';
|
|
4446
|
+
provider: AiProvider;
|
|
4447
|
+
label: string;
|
|
4448
|
+
};
|
|
4449
|
+
/**
|
|
4450
|
+
* What the selected planner still needs before it can plan, or null when it is
|
|
4451
|
+
* ready. There are two ways in (ADR-0009), and only one of them involves a
|
|
4452
|
+
* credential: a harness planner drives a coding agent already installed on the
|
|
4453
|
+
* machine, authenticated by the user's own subscription, so demanding an API
|
|
4454
|
+
* key of it turns a working setup into a wall. Its model is optional too: an
|
|
4455
|
+
* unset id means "the agent's own default".
|
|
4456
|
+
*/
|
|
4457
|
+
declare function plannerNotReady(config: PlannerReadinessConfig): PlannerNotReady | null;
|
|
4458
|
+
/**
|
|
4459
|
+
* `plannerNotReady` judged on a host's own config — the one way every host
|
|
4460
|
+
* builds the preflight's input, so none can hand it a key the selected
|
|
4461
|
+
* planner's transport will not read (a stored OpenRouter key passing for an
|
|
4462
|
+
* OpenAI planner, which then failed inside the transport). Every planner turn
|
|
4463
|
+
* judges through this too, so none can let through what another refuses.
|
|
4464
|
+
*/
|
|
4465
|
+
declare function plannerNotReadyFor(config: Pick<IConfig, 'aiProvider' | 'orchestratorModel' | 'planningModel' | 'openaiCompatibleBaseUrl' | 'getProviderApiKey'>): PlannerNotReady | null;
|
|
4466
|
+
/** How one surface spells the commands a not-ready message points at. */
|
|
4467
|
+
interface PlannerCommandSyntax {
|
|
4468
|
+
pickPlanner: string;
|
|
4469
|
+
setKey(provider: AiProvider): string;
|
|
4470
|
+
setModel: string;
|
|
4471
|
+
}
|
|
4472
|
+
declare const TERMINAL_UI_COMMANDS: PlannerCommandSyntax;
|
|
4473
|
+
/** The VS Code chat shares the terminal's slash commands, except that its `/model` needs `set`. */
|
|
4474
|
+
declare const CHAT_COMMANDS: PlannerCommandSyntax;
|
|
4475
|
+
declare const HEADLESS_CLI_COMMANDS: PlannerCommandSyntax;
|
|
4476
|
+
declare function describePlannerNotReady(reason: PlannerNotReady, commands: PlannerCommandSyntax): string;
|
|
4477
|
+
/**
|
|
4478
|
+
* A planner turn refused before it began. Carries the reason as data so a
|
|
4479
|
+
* client that spells commands differently (the headless CLI) can re-word it;
|
|
4480
|
+
* the message is the terminal UI's spelling, which is what most clients show.
|
|
4481
|
+
*/
|
|
4482
|
+
declare class PlannerNotReadyError extends Error {
|
|
4483
|
+
readonly reason: PlannerNotReady;
|
|
4484
|
+
constructor(reason: PlannerNotReady);
|
|
4485
|
+
}
|
|
4486
|
+
|
|
4125
4487
|
/** What the user last picked for one planner backend. */
|
|
4126
4488
|
interface PlannerModelChoice {
|
|
4127
4489
|
model: string;
|
|
@@ -4197,6 +4559,8 @@ type DaemonErrorCode = 'session_not_found' | 'task_not_found' | 'no_plan' | 'alr
|
|
|
4197
4559
|
| 'planner_turn_stopped'
|
|
4198
4560
|
/** The planner turn settled after its plan was dropped; nothing it produced was kept. */
|
|
4199
4561
|
| 'planner_turn_discarded'
|
|
4562
|
+
/** The selected planner cannot plan yet (no key, no base URL, no model); `plannerNotReady` says which. */
|
|
4563
|
+
| 'planner_not_ready'
|
|
4200
4564
|
/** The request asked for something the plan, task or conversation does not allow. */
|
|
4201
4565
|
| 'refused' | 'checkpoint_not_waiting' | 'approval_not_outstanding';
|
|
4202
4566
|
/** The body of every non-2xx answer a route gives. */
|
|
@@ -4205,6 +4569,8 @@ interface ErrorBody {
|
|
|
4205
4569
|
code?: DaemonErrorCode;
|
|
4206
4570
|
/** Set with `workspace_not_a_project`: the directory the daemon refused, so a client can offer to initialize it. */
|
|
4207
4571
|
workspace?: string;
|
|
4572
|
+
/** Set with `planner_not_ready`: the reason as data, so a client can word it in its own commands. */
|
|
4573
|
+
plannerNotReady?: PlannerNotReady;
|
|
4208
4574
|
}
|
|
4209
4575
|
interface OkResponse {
|
|
4210
4576
|
ok: boolean;
|
|
@@ -4323,8 +4689,8 @@ interface TaskLogResponse {
|
|
|
4323
4689
|
type SessionListResponse = SessionMeta[];
|
|
4324
4690
|
interface SettingsResponse {
|
|
4325
4691
|
orchestratorModel: string;
|
|
4326
|
-
/** Who plans (ADR-0009) — a vendor id, or
|
|
4327
|
-
aiProvider:
|
|
4692
|
+
/** Who plans (ADR-0009) — a vendor id, or a runner serving as a harness planner. */
|
|
4693
|
+
aiProvider: PlannerBackendId;
|
|
4328
4694
|
plannerThinkingEffort: string;
|
|
4329
4695
|
maxParallel: number;
|
|
4330
4696
|
modelAllowlist: UserSettings['modelAllowlist'];
|
|
@@ -4361,15 +4727,36 @@ interface ApprovalAnswerResponse extends OkResponse {
|
|
|
4361
4727
|
granted: boolean;
|
|
4362
4728
|
decision: ApprovalDecision['decision'];
|
|
4363
4729
|
}
|
|
4730
|
+
/**
|
|
4731
|
+
* Where a frame stands in its session's broadcast stream. A client holding
|
|
4732
|
+
* several sockets on one session gets every broadcast on each, and a frame's
|
|
4733
|
+
* content is no identity: two clears of a held edit are the same JSON. `seq`
|
|
4734
|
+
* rises by one per broadcast of the session for as long as the daemon runs,
|
|
4735
|
+
* whichever Session object holds the id; `stream` names the daemon process,
|
|
4736
|
+
* so a restarted daemon's numbering is never compared with the last one's.
|
|
4737
|
+
*/
|
|
4738
|
+
interface StreamStamp {
|
|
4739
|
+
stream: string;
|
|
4740
|
+
seq: number;
|
|
4741
|
+
}
|
|
4742
|
+
/** A broadcast as the session's socket carries it. Unstamped from a daemon older than the stamp. */
|
|
4743
|
+
type SessionFrame = (SessionMessage | SessionNotice) & Partial<StreamStamp>;
|
|
4744
|
+
type ApprovalRequestMessage = Extract<SessionMessage, {
|
|
4745
|
+
type: 'approval_request';
|
|
4746
|
+
}>;
|
|
4364
4747
|
/**
|
|
4365
4748
|
* What a session's socket sends right after `connected`: its run as it stands,
|
|
4366
|
-
* so a client that joins mid-run has the run view before the next update
|
|
4367
|
-
*
|
|
4749
|
+
* so a client that joins mid-run has the run view before the next update —
|
|
4750
|
+
* the held edit's preview included — and the planner's approval requests
|
|
4751
|
+
* still waiting, which no later frame would announce again. `seq` is the last
|
|
4752
|
+
* broadcast it accounts for. Every frame after it is a {@link SessionFrame}.
|
|
4368
4753
|
*/
|
|
4369
|
-
interface RunSnapshotFrame {
|
|
4754
|
+
interface RunSnapshotFrame extends Partial<StreamStamp> {
|
|
4370
4755
|
type: 'run_snapshot';
|
|
4371
4756
|
sessionId: string;
|
|
4372
4757
|
view: RunView;
|
|
4758
|
+
/** Absent from a daemon older than the field: nothing is known, not "none waiting". */
|
|
4759
|
+
approvals?: ApprovalRequestMessage[];
|
|
4373
4760
|
}
|
|
4374
4761
|
|
|
4375
4762
|
/**
|
|
@@ -5180,13 +5567,17 @@ declare function savePrdMarkdown(workspace: string, slug: string, markdown: stri
|
|
|
5180
5567
|
|
|
5181
5568
|
/** Who plans, with which model and effort. Blank means unset. */
|
|
5182
5569
|
interface PlannerSelectionState {
|
|
5183
|
-
provider:
|
|
5570
|
+
provider: PlannerBackendId;
|
|
5184
5571
|
model: string;
|
|
5185
5572
|
effort: string;
|
|
5186
5573
|
}
|
|
5574
|
+
/** The state a change is judged against, and where its model came from; absent means the user's own. */
|
|
5575
|
+
interface PlannerSelectionCurrent extends PlannerSelectionState {
|
|
5576
|
+
source?: PlannerModelSource;
|
|
5577
|
+
}
|
|
5187
5578
|
/** What one user action asked for; an absent field leaves that part alone. */
|
|
5188
5579
|
interface PlannerSelectionChange {
|
|
5189
|
-
provider?:
|
|
5580
|
+
provider?: PlannerBackendId;
|
|
5190
5581
|
model?: string;
|
|
5191
5582
|
effort?: string;
|
|
5192
5583
|
}
|
|
@@ -5204,7 +5595,7 @@ type PlannerModelLookup = Pick<PlannerModelStore, 'getPlannerModel'>;
|
|
|
5204
5595
|
* effect after the change, and writes back what this returns. It never
|
|
5205
5596
|
* stores anything itself, so each surface keeps only its storage adapter.
|
|
5206
5597
|
*/
|
|
5207
|
-
declare function selectPlanner(current:
|
|
5598
|
+
declare function selectPlanner(current: PlannerSelectionCurrent, change: PlannerSelectionChange, memory: PlannerModelLookup, catalog: PlannerModelCandidate[]): PlannerSelectionResult;
|
|
5208
5599
|
|
|
5209
5600
|
/** How many AI tasks may run at once: `ORDEWELL_MAX_PARALLEL`, `/parallel`, `ordewell.maxParallelSessions`. */
|
|
5210
5601
|
declare const DEFAULT_MAX_PARALLEL = 5;
|
|
@@ -5216,4 +5607,4 @@ declare const DEFAULT_MAX_PARALLEL = 5;
|
|
|
5216
5607
|
*/
|
|
5217
5608
|
declare function parseMaxParallel(value: unknown): number | null;
|
|
5218
5609
|
|
|
5219
|
-
export { ALL_PROVIDERS, AbstractRunner, AbstractRunnerSession, type AdoptSessionResponse, type Adr0013IsolationRun, type Adr0013PlanIsolation, type Adr0013TaskRecord, AgentAdapter, AgentEvent, AgentProcessDeps, AgentStartOptions, AiProvider, AlreadyExecutingError, ApplyTaskOpsResult, ApprovalAnswer, type ApprovalAnswerResponse, ApprovalDecision, ApprovalModeSetting, ApprovalPolicy, ApprovalRequest, type ApprovalsResponse, type AskOptions, BaseAiService, BaseConfig, BaseFileSystem, BufferedTaskOutputSource, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CODEX_SANDBOX_DOCS, CODEX_SANDBOX_OFF_LINE, type CachedPage, type CancelPlanningResponse, type CancelResumeResponse, type CappedRows, CheckpointAnswer, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, CodexSandboxAvailability, type CommandDescriptor, CommandLineTooLongError, type CommandOutcome, type CommandsResponse, type Consent, ConsoleLogger, ContextCollector, type Continuability, ConversationBusyError, type ConversationCompactResponse, type ConversationCompaction, ConversationEditError, type ConversationFork, type ConversationForkResponse, ConversationMessage, type ConversationRequest, type ConversationRewind, type ConversationRewindResponse, type ConversationTurn, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DEFAULT_MAX_PARALLEL, DEFAULT_WEB_READ_BUDGET, type DaemonErrorCode, type DecideOptions, type DirEntry, DiscoveredModel, DuckDuckGoSearchProvider, EmbeddedNewlineError, type EnvAdmission, EnvConfig, type ErrorBody, type ExecImpl, ExecutableNotFoundError, type ExecuteResponse, ExecutionActor, type ExecutionCommand, ExecutionCommandName, ExecutionCommands, type ExecutionHost, ExecutionRecord, FindSymbolOptions, type ForceSendResponse, GREP_PCRE_PROBE_ARGS, GeminiService, type GeneratePlanResponse, type GitExecFn, GlobOptions, GlobalRunSettings, type GrepInvocation, GrepOptions, type GrepRegex, GuardTarget, GuardTrip, HARNESS_PLANNER_REASON, type HasBinFn, HttpWebFetcher, type HttpWebFetcherOptions, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, INotification, IRunner, IRunnerSession, type ISearchProvider, IWorktreeIsolation, type IsolationDiffResponse, IsolationLandedTask, type IsolationMergeResponse, IsolationMergeResult, IsolationTaskStatus, IsolationView, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, type LiveOutputLookup, LiveTail, LiveTailOptions, type LoopGuard, type MappedTool, type MergeGateEntry, type MergeGateResponse, ModelResolver, type ModelResolverDeps, type ModelsResponse, NoPlanError, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OUTPUT_LINES_DEFAULT, OUTPUT_LINES_MAX, type OkResponse, OpenAiService, OpenCodeAdapter, OrchestratorObserver, OrchestratorOption, OrdewellMcpServer, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanEditError, PlanIsolation, type PlanRequest, type PlanResponse, PlanState, PlanStore, Planner, type PlannerBackendEntry, type PlannerModelCandidate, type PlannerModelChoice, type PlannerModelLookup, PlannerModelMemory, type PlannerModelRecall, type PlannerModelStore, type PlannerSelectionChange, type PlannerSelectionResult, type PlannerSelectionState, type PlannerSubmission, PlannerToolHandler, PlannerTurnDiscardedError, PlannerTurnStoppedError, type PlannerUsability, PlannerUsage, type PrdBlock, type PrdResponse, ProviderModelLists, type ProviderRegistration, QueuedTaskMessage, ReadFileOpts, type RemoveMessageResponse, type ResearchChat, ResearchLogEntry, ResearchShell, type ResearchTurn, type ResolveConflictResponse, type RewindTarget, type RewindTargetsResponse, RunMergeView, type RunSnapshotFrame, RunView, RunnerApprovals, RunnerCommand, RunnerId, RunnerInstallation, RunnerManifest, RunnerModeInfo, RunnerRegistry, type RunnerSpawnOptions, type RunnersResponse, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STATE_DIR_IGNORE, STOPPED_TOOL_RESULT, SUPERVISOR_LEVELS, SYMBOL_LANGUAGES, type SaveSession, type SearchHit, type SearchOutcome, type SearchPage, type SearchTransport, Session, SessionBroadcaster, type SessionData, type SessionDeps, type SessionListResponse, SessionMessage, type SessionMeta, SessionNotFoundError, SessionNotice, type SessionPlanner, type SessionResponse, type SessionRuntimeSettings, type SettingsResponse, type SettingsUpdateResponse, SkillInfo, type SkillInvocation, SkillLoad, SkillsService, type SpawnSpec, StdioAgentAdapter, type StopResponse, StructuredEvent, StructuredRunner, type StructuredRunnerDeps, StructuredSession, StructuredTurnEnd, SupervisorLevel, type SupervisorPolicy, SurfacePlan, SurfacePlanState, TASK_QUERY_ANSWER_MAX_CHARS, TASK_QUERY_ANSWER_OR_OPS, TASK_QUERY_FIELDS, TASK_QUERY_PROTOCOL, TASK_QUERY_REMINDER, Task, TaskCompleteArgs, type TaskLogAttemptsResponse, TaskLogEvent, type TaskLogFile, type TaskLogLocation, TaskLogRecorder, type TaskLogRecorderDeps, type TaskLogResponse, TaskMessageFrom, type TaskMessageResponse, TaskModeAgentAdapter, TaskOp, TaskOrchestrator, TaskOutputSource, type TaskQuery, type TaskQueryCatalog, type TaskQueryField, TaskRunnerFlags, TaskStartOptions, TaskTokenScope, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, UsageRecord, UserSettings, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, type WebRead, type WebReadDecision, type WebResponse, WebResponseCache, type WebResponseCacheOptions, type WebTransport, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, type WorkspacesResponse, type WorktreeIsolationDeps, abbreviateHome, admitSettingsEnv, applyHeadLimit, assertWorkspaceExists, assertWorkspaceIsProject, augmentedPath, bearerHeaderValue, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, canContinue, clearAugmentedPathCache, clearDaemonToken, clearState, clipboardCopyCommand, codexSandboxNotice, configuredProviders, continuability, createAiService, createSession, createTaskAdapter, createWorktreeIsolation, daemonTokenPath, defaultLogger, definitionPattern, deleteSession, describeMergeResult, discoverGeminiModels, ensureDir, ensurePrivateDir, ensureStateDirIgnored, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, formatSearchOutput, getLatestSession, getProviderMeta, getStateDir, globalDataDir, grantScopeFor, grepRegexFromProbe, idSegment, includeGlobFor, isCliProvider, isExecutableResolved, isOpenAiProvider, killTree, languageForId, listSessions, listTaskLogAttempts, listTree, loadSession, loadSessionPlanState, loadState, looksLikeChallenge, mapAgentTool, migrateOldConfigDir, migratePlanIsolation, mintDaemonToken, mintSessionId, normalizeAgentArgs, normalizeGeminiModel, openTaskLog, parseMaxParallel, parseSearchHits, parseTaskQueryJson, planDirectLaunch, plannerBackendEntries, plannerMessage, plannerTranscript, prefixModelId, providerForRunner, readDaemonToken, readTaskLog, referencePattern, removedPluginNotice, renderTaskQueryAnswer, resolveProviderFromPrefix, resolveSkillInvocation, resolveTaskRunnerFlags, resolveWithin, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, selectPlanner, sessionDataDir, sessionRuntimeSettings, sharedSearchProvider, sharedWebResponseCache, stateExists, stripAnsi, stripModelPrefix, supportsTaskMode, taskQuerySignature, textHasTaskQuery, tokenSubprotocols, tokensMatch, wellKnownBinDirs, windowsCommandLine, withPath, writePrivateFile };
|
|
5610
|
+
export { ALL_PROVIDERS, AbstractRunner, AbstractRunnerSession, type AdoptSessionResponse, type Adr0013IsolationRun, type Adr0013PlanIsolation, type Adr0013TaskRecord, AgentAdapter, AgentEvent, AgentProcessDeps, AgentStartOptions, AiProvider, AlreadyExecutingError, ApplyTaskOpsResult, ApprovalAnswer, type ApprovalAnswerResponse, ApprovalDecision, ApprovalModeSetting, ApprovalPolicy, ApprovalRequest, type ApprovalRequestMessage, type ApprovalsResponse, type AskOptions, BaseAiService, BaseConfig, BaseFileSystem, BufferedTaskOutputSource, type ByPlannerBackend, CHAT_COMMANDS, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CODEX_SANDBOX_DOCS, CODEX_SANDBOX_OFF_LINE, type CachedPage, type CancelPlanningResponse, type CancelResumeResponse, type CappedRows, CheckpointAnswer, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, CodexSandboxAvailability, type CommandDescriptor, CommandLineTooLongError, type CommandOutcome, type CommandsResponse, type ConfiguredPlanner, type Consent, ConsoleLogger, ContextCollector, type Continuability, ConversationBusyError, type ConversationCompactResponse, type ConversationCompaction, ConversationEditError, type ConversationFork, type ConversationForkResponse, ConversationMessage, type ConversationRequest, type ConversationRewind, type ConversationRewindResponse, type ConversationTurn, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DEFAULT_MAX_PARALLEL, DEFAULT_WEB_READ_BUDGET, type DaemonErrorCode, type DecideOptions, type DirEntry, DiscoveredModel, DuckDuckGoSearchProvider, EmbeddedNewlineError, type EnvAdmission, EnvConfig, type ErrorBody, type ExecImpl, ExecutableNotFoundError, type ExecuteResponse, ExecutionActor, type ExecutionCommand, ExecutionCommandName, ExecutionCommands, type ExecutionHost, ExecutionRecord, FindSymbolOptions, type ForceSendResponse, GREP_PCRE_PROBE_ARGS, GeminiService, type GeneratePlanResponse, type GitExecFn, GlobOptions, GlobalRunSettings, type GrepInvocation, GrepOptions, type GrepRegex, GuardTarget, GuardTrip, HARNESS_PLANNER_REASON, HEADLESS_CLI_COMMANDS, type HasBinFn, HttpWebFetcher, type HttpWebFetcherOptions, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, INotification, IRunner, IRunnerSession, type ISearchProvider, IWorktreeIsolation, type IsolationDiffResponse, IsolationLandedTask, type IsolationMergeResponse, IsolationMergeResult, IsolationTaskStatus, IsolationView, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, type LiveOutputLookup, LiveTail, LiveTailOptions, type LoopGuard, type MappedTool, type MergeGateEntry, type MergeGateResponse, ModelResolver, type ModelResolverDeps, type ModelsResponse, NoPlanError, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OUTPUT_LINES_DEFAULT, OUTPUT_LINES_MAX, type OkResponse, OpenAiService, OpenCodeAdapter, OrchestratorObserver, OrchestratorOption, OrdewellMcpServer, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanEditError, PlanIsolation, type PlanRequest, type PlanResponse, PlanState, PlanStatus, PlanStore, Planner, type PlannerBackendEntry, PlannerBackendId, type PlannerChoice, type PlannerCommandSyntax, type PlannerModelCandidate, type PlannerModelChoice, type PlannerModelLookup, PlannerModelMemory, type PlannerModelRecall, type PlannerModelSource, type PlannerModelStore, type PlannerNotReady, PlannerNotReadyError, type PlannerReadinessConfig, type PlannerSelectionChange, type PlannerSelectionCurrent, type PlannerSelectionResult, type PlannerSelectionState, type PlannerSubmission, PlannerToolHandler, PlannerTurnDiscardedError, PlannerTurnStoppedError, type PlannerUsability, PlannerUsage, type PrdBlock, type PrdResponse, ProviderModelLists, type ProviderRegistration, QueuedTaskMessage, ReadFileOpts, type RemoveMessageResponse, type ResearchChat, ResearchLogEntry, ResearchShell, type ResearchTurn, type ResolveConflictResponse, type ResolvedChoice, type ResolvedPlanner, type RewindTarget, type RewindTargetsResponse, RunMergeView, type RunSnapshotFrame, RunView, RunnerApprovals, RunnerCommand, RunnerId, RunnerInstallation, RunnerManifest, RunnerModeInfo, RunnerRegistry, type RunnerSpawnOptions, type RunnersResponse, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STATE_DIR_IGNORE, STOPPED_TOOL_RESULT, SUPERVISOR_LEVELS, SYMBOL_LANGUAGES, type SaveSession, type SearchHit, type SearchOutcome, type SearchPage, type SearchTransport, Session, SessionBroadcaster, type SessionData, type SessionDeps, type SessionFrame, type SessionListResponse, SessionMessage, type SessionMeta, SessionNotFoundError, SessionNotice, type SessionPlanner, type SessionResponse, type SessionRuntimeSettings, type SettingsResponse, type SettingsUpdateResponse, SkillInfo, type SkillInvocation, SkillLoad, SkillsService, type SpawnSpec, StartAdmission, StdioAgentAdapter, type StopResponse, type StreamStamp, StructuredEvent, StructuredRunner, type StructuredRunnerDeps, StructuredSession, StructuredTurnEnd, SupervisorLevel, type SupervisorPolicy, SurfacePlan, SurfacePlanState, TASK_QUERY_ANSWER_MAX_CHARS, TASK_QUERY_ANSWER_OR_OPS, TASK_QUERY_FIELDS, TASK_QUERY_PROTOCOL, TASK_QUERY_REMINDER, TERMINAL_UI_COMMANDS, Task, TaskCompleteArgs, type TaskLogAttemptsResponse, TaskLogEvent, type TaskLogFile, type TaskLogLocation, TaskLogRecorder, type TaskLogRecorderDeps, type TaskLogResponse, TaskMessageFrom, type TaskMessageResponse, TaskModeAgentAdapter, TaskOp, TaskOrchestrator, TaskOutputSource, type TaskQuery, type TaskQueryCatalog, type TaskQueryField, TaskRunnerFlags, TaskStartOptions, TaskTokenScope, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, UsageRecord, UserSettings, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, type WebRead, type WebReadDecision, type WebResponse, WebResponseCache, type WebResponseCacheOptions, type WebTransport, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, type WorkspacesResponse, type WorktreeIsolationDeps, abbreviateHome, admitSettingsEnv, applyHeadLimit, assertWorkspaceExists, assertWorkspaceIsProject, augmentedPath, bearerHeaderValue, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, canContinue, clearAugmentedPathCache, clearDaemonToken, clearState, clipboardCopyCommand, codexSandboxNotice, configuredProviders, continuability, createAiService, createSession, createTaskAdapter, createWorktreeIsolation, daemonTokenPath, defaultEnabledRunners, defaultLogger, definitionPattern, deleteSession, describeMergeResult, describePlannerNotReady, detectInstalledPlanner, discoverGeminiModels, ensureDir, ensurePrivateDir, ensureStateDirIgnored, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, findInstalledPlanner, formatSearchOutput, getLatestSession, getProviderMeta, getStateDir, globalDataDir, grantScopeFor, grepRegexFromProbe, idSegment, includeGlobFor, installedPlannerAnswered, installedPlannerDetected, isApiProvider, isCliProvider, isExecutableResolved, isOpenAiProvider, isPlannerBackend, isVendorModelFor, killTree, languageForId, listSessions, listTaskLogAttempts, listTree, loadSession, loadSessionPlanState, loadState, looksLikeChallenge, mapAgentTool, migrateOldConfigDir, migratePlanIsolation, mintDaemonToken, mintSessionId, normalizeAgentArgs, normalizeGeminiModel, openTaskLog, parseMaxParallel, parseSearchHits, parseTaskQueryJson, planDirectLaunch, plannerBackendEntries, plannerMessage, plannerNotReady, plannerNotReadyFor, plannerTranscript, prefixModelId, providerForRunner, readDaemonToken, readTaskLog, recordInstalledPlanner, recordedInstalledPlanner, referencePattern, removedPluginNotice, renderTaskQueryAnswer, resetInstalledPlanner, resolveProviderFromPrefix, resolveSkillInvocation, resolveTaskRunnerFlags, resolveWithin, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, selectPlanner, sessionDataDir, sessionRuntimeSettings, sharedSearchProvider, sharedWebResponseCache, stateExists, stripAnsi, stripModelPrefix, supportsTaskMode, taskQuerySignature, textHasTaskQuery, tokenSubprotocols, tokensMatch, wellKnownBinDirs, windowsCommandLine, withPath, writePrivateFile };
|