@ordewell/core 0.6.4 → 0.7.1
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/README.md +1 -1
- package/dist/{IFileSystem-Qj2MWHn_.d.mts → IFileSystem-BnLh-_SK.d.mts} +1 -1
- package/dist/{IFileSystem-DQEKyC6H.d.ts → IFileSystem-DofiRcCo.d.ts} +1 -1
- package/dist/{ModeResolver-rqaY_4Ex.d.mts → ModeResolver-DZzJSdIU.d.mts} +3 -3
- package/dist/{ModeResolver-ByNpC0EP.d.ts → ModeResolver-DkMYf4uS.d.ts} +3 -3
- package/dist/{Task-xqdxugt2.d.mts → Task-BnLxkVQF.d.mts} +414 -22
- package/dist/{Task-xqdxugt2.d.ts → Task-BnLxkVQF.d.ts} +414 -22
- package/dist/{chunk-JRZPSNRO.mjs → chunk-LGQNXPBX.mjs} +10 -2
- package/dist/chunk-LGQNXPBX.mjs.map +1 -0
- package/dist/{chunk-N66ZHFGN.mjs → chunk-OYUSADFM.mjs} +11 -1
- package/dist/chunk-OYUSADFM.mjs.map +1 -0
- package/dist/{chunk-HPNUFBIT.mjs → chunk-V3JHS7AX.mjs} +9 -1
- package/dist/chunk-V3JHS7AX.mjs.map +1 -0
- package/dist/{chunk-I6U3PVHL.mjs → chunk-Y36NIASW.mjs} +255 -32
- package/dist/chunk-Y36NIASW.mjs.map +1 -0
- package/dist/{chunk-M4KXBEFJ.mjs → chunk-ZV5LDNCO.mjs} +44 -43
- package/dist/chunk-ZV5LDNCO.mjs.map +1 -0
- package/dist/index.d.mts +518 -238
- package/dist/index.d.ts +518 -238
- package/dist/index.js +3925 -1568
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3525 -1393
- package/dist/index.mjs.map +1 -1
- package/dist/order-labels.d.mts +16 -2
- package/dist/order-labels.d.ts +16 -2
- package/dist/order-labels.js +12 -2
- package/dist/order-labels.js.map +1 -1
- package/dist/order-labels.mjs +7 -3
- package/dist/{parsing-DDZ1rUYa.d.mts → parsing-B6ctfF80.d.mts} +24 -3
- package/dist/{parsing-COPG8-Ep.d.ts → parsing-ddZXZFP4.d.ts} +24 -3
- package/dist/parsing.d.mts +4 -3
- package/dist/parsing.d.ts +4 -3
- package/dist/parsing.js +42 -41
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -3
- package/dist/{plan-utils-Br8UAoiu.d.ts → plan-utils--kQRzSE-.d.ts} +251 -7
- package/dist/{plan-utils-DMgajMvd.d.mts → plan-utils-CKgNtDwQ.d.mts} +251 -7
- package/dist/plan-utils.d.mts +5 -3
- package/dist/plan-utils.d.ts +5 -3
- package/dist/plan-utils.js +313 -61
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +46 -3
- package/dist/testing.d.mts +26 -5
- package/dist/testing.d.ts +26 -5
- package/dist/testing.js +62 -2
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +62 -4
- package/dist/testing.mjs.map +1 -1
- package/package.json +4 -2
- package/dist/chunk-HPNUFBIT.mjs.map +0 -1
- package/dist/chunk-I6U3PVHL.mjs.map +0 -1
- package/dist/chunk-JRZPSNRO.mjs.map +0 -1
- package/dist/chunk-M4KXBEFJ.mjs.map +0 -1
- package/dist/chunk-N66ZHFGN.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { d as AgentAdapterFactory, i as AllProviderModels, l as ApprovalKind, o as ApprovalPolicyOptions, q as ApprovalSource, B as BlockingPrompt, C as CMD_EXE_MAX_COMMAND_LINE, s as CatalogModel,
|
|
3
|
-
import {
|
|
4
|
-
export { a as ApprovalBlock, b as ApprovalStatus, C as CHECKPOINT_TRUNCATE_LENGTH, c as ConversationInput, d as ConversationView, D as DisplayBlock, E as EMPTY_CONVERSATION,
|
|
5
|
-
import { I as IFileSystem, R as ReadFileOpts, T as ToolOutcome, b as GrepOptions, a as GlobOptions, F as FindSymbolOptions } from './IFileSystem-
|
|
6
|
-
export { G as GREP_DEFAULT_HEAD_LIMIT, c as GrepOutputMode, S as SEARCH_EXCLUSIONS } from './IFileSystem-
|
|
7
|
-
import { R as RunnerModeInfo } from './ModeResolver-
|
|
8
|
-
export { M as ManifestLookup, a as autonomyLevelLabel, b as buildModeGuide, f as filteredBuildModes, p as parseAutonomyLevel, r as resolveDefaultMode, c as resolveTaskMode, d as runnerModesFrom } from './ModeResolver-
|
|
1
|
+
import { a$ as RunnerId, ax as PlanStatus, ab as LegacyPlanState, L as IApproval, k as ApprovalDecision, p as ApprovalRequest, j as ApprovalAnswer, O as ITerminalRunner, M as IConfig, h as AiProvider, aM as ProviderModelLists, m as ApprovalMode, _ as IsolationMergeResult, W as IsolationLandedTask, Q as IWorktreeIsolation, a7 as IsolationTaskStatus, au as PlanIsolation, b4 as RunnerTransport, aU as RepoGroupLayout, P as ITerminalSession, y as DiscoveredModel, bh as Task, f as AgentProcessDeps, c as AgentAdapter, ar as OrdewellMcpServer, aW as ResearchProgress, aV as ResearchLogEntry, w as ConversationMessage, aA as PlannerToolHandler, bE as UsageRecord, bt as TaskSnapshot, r as AwaitingReason, T as IsolationHandoff, a3 as IsolationRun, a4 as IsolationTaskRecord, bj as TaskIsolation, a8 as IsolationView, $ as IsolationOutcome, aT as RepairEvidence, bC as TreeSnapshot, bL as Verdict, b2 as RunnerRegistry, aR as QueuedTaskMessage, aQ as QueuedMessage, b as ActiveTaskSession, aq as OrchestratorOption, bm as TaskModeAgentAdapter, g as AgentStartOptions, e as AgentEvent, aZ as ResearchToolType, aB as PlannerUsage, n as ApprovalPolicy, aw as PlanState, bi as TaskCompleteArgs, t as CheckpointAnswer, b0 as RunnerInvocation, A as AbstractRunner, a as AbstractTerminalSession, b5 as RunnerVersionProbe, ba as StructuredSessionCapability, bu as TaskStartOptions, bw as TaskTokenScope, bb as StructuredTurnEnd, b9 as StructuredEvent, b3 as RunnerSpawnOptions, N as IPluginStore, b1 as RunnerPluginManifest, a_ as ResolveContext, bs as TaskRunnerFlags } from './Task-BnLxkVQF.js';
|
|
2
|
+
export { d as AgentAdapterFactory, i as AllProviderModels, l as ApprovalKind, o as ApprovalPolicyOptions, q as ApprovalSource, B as BlockingPrompt, C as CMD_EXE_MAX_COMMAND_LINE, s as CatalogModel, u as CheckpointArgs, v as CommandLineTooLongError, D as DENY_ALL, x as DiscoveredMode, z as DiscoveryCommand, E as EditPlanArgs, F as EmbeddedNewlineError, G as ExecutableNotFoundError, H as FetchAllProviderModelsOptions, I as HeadlessRunner, J as HeadlessRunnerDeps, K as HeadlessSession, R as IntegrationDisposal, S as IsolationAvailability, U as IsolationHandoffRepo, V as IsolationInactiveReason, X as IsolationLanding, Y as IsolationMergeBlock, Z as IsolationMergeBlockReason, a0 as IsolationPruneResult, a1 as IsolationRemoval, a2 as IsolationRepo, a5 as IsolationTaskRef, a6 as IsolationTaskRepo, a9 as LaunchDeps, aa as LaunchPlan, ac as LineBuffer, ad as ListModelsArgs, ae as ListRunnersArgs, af as McpClientConfig, ag as McpCredential, ah as McpTool, ai as McpToolContext, aj as McpToolReply, ak as Message, al as ModelCatalog, am as ModelShortcut, an as ORCHESTRATOR_SHORTCUTS, ao as ORDEWELL_MCP_PATH, ap as ORDEWELL_MCP_SERVER_NAME, as as OwnerOnlyFile, at as PLANNER_TOOLS, av as PlanModificationWarnings, ay as PlannerStartOptions, az as PlannerTokenScope, aC as PluginCloneFn, aD as PluginEntry, aE as PluginFeatures, aF as PluginMode, aG as PluginModelDiscovery, aH as PluginRunnerDef, aI as PreparedLaunch, aJ as PreparedTask, aK as PreservedWork, aL as ProviderCredentialSource, aN as ProviderModelsResult, aO as PtySize, aP as PtyWrapOptions, aS as RefusedRemoval, aX as ResearchStep, aY as ResearchStepOutcome, b6 as StreamEvent, b7 as StreamStepEvent, b8 as StreamThinkingEvent, bc as SubagentLogEntry, bd as SubagentOutcome, be as SubmitPlanArgs, bf as TASK_COMPLETE_TOOL, bg as TASK_TOOLS, bk as TaskIsolationState, bl as TaskMode, bn as TaskModeUnsupportedError, bo as TaskModelAssignment, bp as TaskOutputArgs, bq as TaskOutputSummary, br as TaskQueryArgs, bv as TaskStatus, bx as TaskToolHandler, by as TaskTransport, bz as TaskType, bA as TaskWithParent, bB as ThinkingBlock, bD as UsageLine, bF as UsageTotals, bG as UserPromptEntry, bH as UserStep, bI as ValidationCheck, bJ as ValidationContext, bK as ValidationResult, bM as VerificationCheck, bN as WINDOWS_MAX_COMMAND_LINE, bO as addPlannerUsage, bP as addTaskToPlan, bQ as addUsage, bR as approvalScopes, bS as buildShellInvocation, bT as collectProviderCredentials, bU as createEmptyPlan, bV as createTask, bW as emptyWarnings, bX as enabledRunners, bY as fetchAllProviderModels, bZ as flattenTasks, b_ as flattenTasksWithParents, b$ as inheritedOps, c0 as isAwaitingReason, c1 as isExecutableResolved, c2 as isGranted, c3 as isMeasured, c4 as isReservedRunnerName, c5 as isRunnerApproval, c6 as isRunnerTransport, c7 as isStructuredSession, c8 as keepExecutionState, c9 as knownModelId, ca as mcpClientConfig, cb as migrateLegacyPlan, cc as migratePlanState, cd as migrateTask, ce as opsFlag, cf as ownerOnlyConfigFile, cg as partedPromptUsage, ch as planDirectLaunch, ci as planShellLaunch, cj as plannerContextFill, ck as posixShellQuote, cl as removeTaskFromPlan, cm as renumberTasks, cn as resolveModelShortcut, co as resolveProvider, cp as sharedMcpServer, cq as stripAnsi, cr as toApprovalDecision, cs as toOrchestratorOptions, ct as updateTaskInPlan, cu as usageLine, cv as validateModifiedPlan, cw as warningsText, cx as windowsCommandLine, cy as wrapWithPty } from './Task-BnLxkVQF.js';
|
|
3
|
+
import { z as TaskOp, M as MergeGateView, r as SessionBroadcaster, A as ApplyTaskOpsResult, s as SessionMessage, t as SessionNotice, x as TaskLogEvent } from './plan-utils--kQRzSE-.js';
|
|
4
|
+
export { a as ApprovalBlock, b as ApprovalStatus, C as CHECKPOINT_TRUNCATE_LENGTH, c as ConversationInput, d as ConversationView, D as DiffRow, e as DiffRowKind, f as DiffStat, g as DisplayBlock, E as EMPTY_CONVERSATION, h as EMPTY_HOLD, i as EMPTY_TASK_LOG, G as GatedConversation, L as LocalEntry, j as MessageBlock, k as MessageRole, N as NOT_STARTED, l as NO_TURN, m as NewTaskFields, O as OutputPreview, P as PlanBlock, n as PlanMarkerStatus, o as PromptHold, S as SerializedPlan, p as SerializedTask, q as SerializedTaskStatus, u as SubagentBlock, v as SubagentChild, w as SubagentStatus, T as TakenPrompt, y as TaskLogView, B as TaskRef, F as TaskRowAction, H as TaskRowContext, I as TaskRowIsolation, J as TaskRowKind, K as TaskRowPlacement, Q as TaskRowSubject, R as TaskRowView, U as TaskStatusKind, V as ThinkingDisplayBlock, W as ToolBlock, X as ToolHeadline, Y as ToolStatus, Z as TurnGate, _ as UsageBlock, $ as aheadOfDraft, a0 as applyTaskOps, a1 as approvalLabel, a2 as awaitingLabel, a3 as canMergeTasks, a4 as canSetDependencies, a5 as canSplitTask, a6 as capConflictFiles, a7 as classifyOutcome, a8 as coalesceTaskLog, a9 as dependencyCandidates, aa as dependentsNotice, ab as dependentsOf, ac as diffRows, ad as diffStat, ae as diffSummary, af as digestTaskLog, ag as drainNext, ah as executionSummary, ai as followTurn, aj as fromTranscript, ak as hasHiddenDetail, al as holdPrompt, am as isTaskRunning, an as markAction, ao as markRequestFor, ap as namedRepos, aq as newTaskFields, ar as opsEditable, as as outputLines, at as outputPreview, au as parseTaskOpsJson, av as pastGateConfirmation, aw as reduceConversation, ax as reduceTaskLog, ay as replayTaskLog, az as runnerToolSubject, aA as serializePlan, aB as serializeTask, aC as serializeTaskStatus, aD as stopTurn, aE as summarizeToolCall, aF as taskRowActions, aG as taskRowView, aH as taskStartedNotice, aI as taskStatusKind, aJ as textHasTaskOps, aK as titledRefs, aL as toTaskLogEvent, aM as toolHeadline, aN as trimToolOutput, aO as truncateCheckpointSummary, aP as unsendAll, aQ as unsendLatest } from './plan-utils--kQRzSE-.js';
|
|
5
|
+
import { I as IFileSystem, R as ReadFileOpts, T as ToolOutcome, b as GrepOptions, a as GlobOptions, F as FindSymbolOptions } from './IFileSystem-DofiRcCo.js';
|
|
6
|
+
export { G as GREP_DEFAULT_HEAD_LIMIT, c as GrepOutputMode, S as SEARCH_EXCLUSIONS } from './IFileSystem-DofiRcCo.js';
|
|
7
|
+
import { R as RunnerModeInfo } from './ModeResolver-DkMYf4uS.js';
|
|
8
|
+
export { M as ManifestLookup, a as autonomyLevelLabel, b as buildModeGuide, f as filteredBuildModes, p as parseAutonomyLevel, r as resolveDefaultMode, c as resolveTaskMode, d as runnerModesFrom } from './ModeResolver-DkMYf4uS.js';
|
|
9
9
|
import { ChildProcess } from 'child_process';
|
|
10
|
-
import { b as PlanParseError } from './parsing-
|
|
11
|
-
export { P as PLAN_ENVELOPE_KEY, a as PartialPlanTask, T as TASK_OPS_ENVELOPE_KEY,
|
|
12
|
-
export { resolveOrderLabel, taskOrderLabel } from './order-labels.js';
|
|
10
|
+
import { b as PlanParseError } from './parsing-ddZXZFP4.js';
|
|
11
|
+
export { P as PLAN_ENVELOPE_KEY, a as PartialPlanTask, c as PlanTaskError, d as PlanTasksResult, T as TASK_OPS_ENVELOPE_KEY, e as TASK_QUERY_ENVELOPE_KEY, f as checkDepsResolve, g as checkImmutableLog, h as checkInProgress, i as checkNoCycles, j as checkUniqueIds, k as escapeControlCharsInStrings, l as extractJsonObject, m as extractObjectWithBalance, n as extractObjectsWithKey, o as looksLikePlanAttempt, p as opensWithJsonObject, q as parsePartialPlan, r as parsePlanJson, s as stripModelNoise, t as stripTrailingCommas, v as validatePlanModification, u as validatePlanTasks } from './parsing-ddZXZFP4.js';
|
|
12
|
+
export { resolveOrderLabel, taskOrderLabel, taskRef, titledTaskRef } from './order-labels.js';
|
|
13
13
|
import 'events';
|
|
14
|
+
import 'zod/v4';
|
|
14
15
|
|
|
15
16
|
interface SessionMeta {
|
|
16
17
|
id: string;
|
|
@@ -935,6 +936,8 @@ interface CliAgentAiServiceDeps extends Partial<AgentProcessDeps> {
|
|
|
935
936
|
createAdapter?: (runner: string, deps: AgentProcessDeps) => AgentAdapter | null;
|
|
936
937
|
/** Workspace root the agent explores. Defaults to the host process's cwd. */
|
|
937
938
|
workspaceRoot?: () => string;
|
|
939
|
+
/** Where a conversation's planner tools are served (ADR-0022). Absent: every planner gets the envelopes. */
|
|
940
|
+
mcpServer?: OrdewellMcpServer;
|
|
938
941
|
}
|
|
939
942
|
/**
|
|
940
943
|
* A coding agent driven as Ordewell's planner (ADR-0009).
|
|
@@ -963,6 +966,11 @@ declare class CliAgentAiService implements IAiService {
|
|
|
963
966
|
*/
|
|
964
967
|
private lastNativeSessionId;
|
|
965
968
|
private conversation;
|
|
969
|
+
private readonly mcpServer;
|
|
970
|
+
/** The planner token the running process was spawned with; revoked with the process (ADR-0022, A3). */
|
|
971
|
+
private plannerToken;
|
|
972
|
+
/** Whether the running planner was spawned with its tools and the CLI reported them connected. */
|
|
973
|
+
private toolsAttached;
|
|
966
974
|
private activeAbort;
|
|
967
975
|
/**
|
|
968
976
|
* Every subagent this conversation has reported starting, and finishing.
|
|
@@ -981,6 +989,8 @@ declare class CliAgentAiService implements IAiService {
|
|
|
981
989
|
* on the old model. No conversation yet is vacuously "current".
|
|
982
990
|
*/
|
|
983
991
|
conversationMatchesConfig(): boolean;
|
|
992
|
+
/** Whether this conversation's planner submits through the Ordewell MCP server rather than the envelopes. */
|
|
993
|
+
plannerToolsAttached(): boolean;
|
|
984
994
|
/** The agent's own session id, a resumption hint only — Ordewell's transcript is authoritative (T4). */
|
|
985
995
|
nativeSessionId(): string | null;
|
|
986
996
|
reset(): void;
|
|
@@ -1008,6 +1018,10 @@ declare class CliAgentAiService implements IAiService {
|
|
|
1008
1018
|
* mode from here without changing this signature.
|
|
1009
1019
|
*/
|
|
1010
1020
|
private startAdapter;
|
|
1021
|
+
/** Spawn with the Ordewell server injected. False, with nothing left running, when it did not connect. */
|
|
1022
|
+
private startWithTools;
|
|
1023
|
+
/** Kill the planner process, and with it the token it was spawned with. */
|
|
1024
|
+
private disposeAdapter;
|
|
1011
1025
|
/**
|
|
1012
1026
|
* The live agent process, restarted from its own session id if it died
|
|
1013
1027
|
* between turns. Resume is a hint: when it fails, the caller's next
|
|
@@ -1036,6 +1050,15 @@ declare class CliAgentAiService implements IAiService {
|
|
|
1036
1050
|
sendPlanningPrompt(prompt: string, runners: RunnerId[], runnerModes?: Record<RunnerId, RunnerModeInfo[]>, autonomousDefault?: boolean): Promise<Task[]>;
|
|
1037
1051
|
}
|
|
1038
1052
|
|
|
1053
|
+
/**
|
|
1054
|
+
* The planner tools a session offers its conversation (ADR-0022). A backend
|
|
1055
|
+
* that can inject the Ordewell MCP server into its planner issues a planner
|
|
1056
|
+
* token bound to `sessionId` and these handlers; any other ignores the offer.
|
|
1057
|
+
*/
|
|
1058
|
+
interface PlannerToolsOffer {
|
|
1059
|
+
sessionId: string;
|
|
1060
|
+
handler: PlannerToolHandler;
|
|
1061
|
+
}
|
|
1039
1062
|
/**
|
|
1040
1063
|
* Everything the conversation loop needs to start planning (ADR-0002).
|
|
1041
1064
|
* The AI service keeps the tool-use message history internally across turns;
|
|
@@ -1072,6 +1095,7 @@ interface ConversationRequest {
|
|
|
1072
1095
|
* carries the user's new message.
|
|
1073
1096
|
*/
|
|
1074
1097
|
initialMessage?: string;
|
|
1098
|
+
plannerTools?: PlannerToolsOffer;
|
|
1075
1099
|
}
|
|
1076
1100
|
/**
|
|
1077
1101
|
* One planner turn's outcome. The planner talks to the user (`message`),
|
|
@@ -1134,6 +1158,13 @@ interface IAiService {
|
|
|
1134
1158
|
* `continueConversation`, restart instead so the new model takes effect.
|
|
1135
1159
|
*/
|
|
1136
1160
|
conversationMatchesConfig?(): boolean;
|
|
1161
|
+
/**
|
|
1162
|
+
* Whether the planner reads the catalog and submits plans through Ordewell's
|
|
1163
|
+
* MCP tools (ADR-0022). Optional, and false when absent: only a harness
|
|
1164
|
+
* planner the server attached to has them, and every other planner keeps
|
|
1165
|
+
* the per-turn catalog and the envelopes.
|
|
1166
|
+
*/
|
|
1167
|
+
plannerToolsAttached?(): boolean;
|
|
1137
1168
|
/**
|
|
1138
1169
|
* Optional: prune bulky raw tool output out of the live conversation, in
|
|
1139
1170
|
* place, keeping subagent digests. Returns the characters removed. Absent
|
|
@@ -1486,6 +1517,12 @@ interface IsolationRunControllerDeps {
|
|
|
1486
1517
|
notifications: INotification;
|
|
1487
1518
|
workspaceRoot: () => string;
|
|
1488
1519
|
listener: IsolationRunListener;
|
|
1520
|
+
/**
|
|
1521
|
+
* The tasks no clean-up of the whole run may take a worktree from: an
|
|
1522
|
+
* attempt is running them, or the plan has them in progress or waiting on
|
|
1523
|
+
* the user mid-attempt.
|
|
1524
|
+
*/
|
|
1525
|
+
liveTasks: () => ReadonlySet<string>;
|
|
1489
1526
|
}
|
|
1490
1527
|
/**
|
|
1491
1528
|
* The lifecycle of a plan's isolation run (ADR-0013, ADR-0014, ADR-0020),
|
|
@@ -1502,6 +1539,7 @@ declare class IsolationRunController {
|
|
|
1502
1539
|
private readonly notifications;
|
|
1503
1540
|
private readonly workspaceRoot;
|
|
1504
1541
|
private readonly listener;
|
|
1542
|
+
private readonly liveTasks;
|
|
1505
1543
|
private run;
|
|
1506
1544
|
/** Copied paths already reported for the current run: every task gets the same copies. */
|
|
1507
1545
|
private reportedCopies;
|
|
@@ -1530,6 +1568,7 @@ declare class IsolationRunController {
|
|
|
1530
1568
|
get blocked(): boolean;
|
|
1531
1569
|
/** What the plan persists of isolated execution; null when no run ever isolated. */
|
|
1532
1570
|
get planIsolation(): PlanIsolation | null;
|
|
1571
|
+
/** The one guard of every action on the run: a plan that never isolated is a request refused, not a fault. */
|
|
1533
1572
|
requireRun(): IsolationRun;
|
|
1534
1573
|
/** A task's record in the open run, only while that run isolates. */
|
|
1535
1574
|
openRecord(taskId: string): IsolationTaskRecord | undefined;
|
|
@@ -1573,20 +1612,27 @@ declare class IsolationRunController {
|
|
|
1573
1612
|
*/
|
|
1574
1613
|
continueBlocked(how: 'stash' | 'shared'): Promise<(() => Promise<void>) | null>;
|
|
1575
1614
|
/**
|
|
1576
|
-
* The
|
|
1577
|
-
*
|
|
1578
|
-
*
|
|
1579
|
-
*
|
|
1580
|
-
*
|
|
1581
|
-
* is
|
|
1615
|
+
* The working directory of an attempt that may run in a worktree — which
|
|
1616
|
+
* attempts do is the attempt kind's to say (see `attemptKind.attemptCwd`):
|
|
1617
|
+
* the worktree prepared for it in an isolated run, the kept one for a
|
|
1618
|
+
* conflict repair, else the workspace root. `worktree` says which. Does not
|
|
1619
|
+
* itself report a worktree it creates as a change — the caller does once
|
|
1620
|
+
* the attempt is committed as running, so a spawn abandoned or failed after
|
|
1621
|
+
* this settles is not misreported as a change that stuck.
|
|
1582
1622
|
*/
|
|
1583
1623
|
attemptCwd(task: Task, opts: {
|
|
1584
1624
|
repair: boolean;
|
|
1585
|
-
ops?: boolean;
|
|
1586
1625
|
}): Promise<{
|
|
1587
1626
|
cwd: string;
|
|
1588
1627
|
worktree: boolean;
|
|
1589
1628
|
}>;
|
|
1629
|
+
/** The workspace root, for an attempt that runs outside any worktree. */
|
|
1630
|
+
workspaceCwd(task: Task): Promise<{
|
|
1631
|
+
cwd: string;
|
|
1632
|
+
worktree: boolean;
|
|
1633
|
+
}>;
|
|
1634
|
+
private reopenCwd;
|
|
1635
|
+
private prepareCwd;
|
|
1590
1636
|
/**
|
|
1591
1637
|
* Land a task's work on the run's integration branches. The record is
|
|
1592
1638
|
* reported changed once the landing is set and before the first merge, so
|
|
@@ -1623,10 +1669,11 @@ declare class IsolationRunController {
|
|
|
1623
1669
|
*/
|
|
1624
1670
|
refreshInHead(): Promise<boolean>;
|
|
1625
1671
|
/**
|
|
1626
|
-
* The tracked state of the workspace as an
|
|
1627
|
-
* {@link filesChangedSince}
|
|
1628
|
-
*
|
|
1629
|
-
* it, or a workspace git
|
|
1672
|
+
* The tracked state of the workspace as an attempt whose tree is checked
|
|
1673
|
+
* starts (see `attemptKind.checksTree`), for {@link filesChangedSince}
|
|
1674
|
+
* (ADR-0020). Null where the check does not run: a run that shares the
|
|
1675
|
+
* workspace root, where every task's edits land in it, or a workspace git
|
|
1676
|
+
* cannot isolate at all.
|
|
1630
1677
|
*/
|
|
1631
1678
|
snapshotWorkspace(): Promise<TreeSnapshot | null>;
|
|
1632
1679
|
/** Tracked files changed since `snapshot`; none when the run has since gone on in the workspace root. */
|
|
@@ -1641,7 +1688,9 @@ declare class IsolationRunController {
|
|
|
1641
1688
|
/**
|
|
1642
1689
|
* Mark which added task resolves which conflict. The resolver merges the
|
|
1643
1690
|
* conflicted task's branch by hand in its own worktree; once that lands, the
|
|
1644
|
-
* conflicted task can land in turn
|
|
1691
|
+
* conflicted task can land in turn — through the same merge, so a resolver
|
|
1692
|
+
* that did not really bring it along conflicts again instead of being taken
|
|
1693
|
+
* at its word.
|
|
1645
1694
|
*/
|
|
1646
1695
|
linkResolver(resolverId: string, conflictedId: string): void;
|
|
1647
1696
|
/** The conflicted task a landed resolver was added for, forgotten as it is returned. */
|
|
@@ -1656,11 +1705,28 @@ declare class IsolationRunController {
|
|
|
1656
1705
|
* HEAD somehow does not contain stays for the next run's sweep.
|
|
1657
1706
|
*/
|
|
1658
1707
|
merge(): Promise<IsolationMergeResult>;
|
|
1659
|
-
/**
|
|
1708
|
+
/**
|
|
1709
|
+
* Worktrees and task branches go; the integration branch and the record stay
|
|
1710
|
+
* for review and merge. Refused while a task of the run is still live.
|
|
1711
|
+
*/
|
|
1660
1712
|
cleanup(): Promise<void>;
|
|
1661
|
-
/**
|
|
1713
|
+
/**
|
|
1714
|
+
* The run and everything it made go, and the plan forgets it; the next run
|
|
1715
|
+
* starts afresh. Refused while a task of the run is still live.
|
|
1716
|
+
*/
|
|
1662
1717
|
discard(): Promise<void>;
|
|
1718
|
+
/** The records of tasks still live, whose worktrees no clean-up of the whole run may take. */
|
|
1719
|
+
private liveRecords;
|
|
1720
|
+
private refuseWhileLive;
|
|
1721
|
+
/**
|
|
1722
|
+
* Clear a settled run up once everything it landed is merged — and only
|
|
1723
|
+
* when nothing else is left in it: a live task, or a worktree holding work
|
|
1724
|
+
* that never landed, keeps the whole run, worktrees and branches, rather
|
|
1725
|
+
* than leaving that work to a deletion.
|
|
1726
|
+
*/
|
|
1663
1727
|
private clearMerged;
|
|
1728
|
+
/** Say what a removal kept back instead of deleting: where the work went, or which worktree stayed. */
|
|
1729
|
+
private report;
|
|
1664
1730
|
private forget;
|
|
1665
1731
|
private assess;
|
|
1666
1732
|
private activate;
|
|
@@ -1977,8 +2043,18 @@ declare class TaskOrchestrator {
|
|
|
1977
2043
|
* task whose spawn always throws.
|
|
1978
2044
|
*/
|
|
1979
2045
|
private onHold;
|
|
1980
|
-
/**
|
|
1981
|
-
|
|
2046
|
+
/**
|
|
2047
|
+
* Tasks Mark complete is landing after it ended their attempt: in progress
|
|
2048
|
+
* with no attempt for as long as that takes, and not orphans for it.
|
|
2049
|
+
*/
|
|
2050
|
+
private completing;
|
|
2051
|
+
/**
|
|
2052
|
+
* The plan's isolation run and the open run's lifecycle (ADR-0013); see
|
|
2053
|
+
* {@link IsolationRunController}. Read and acted on there directly, except
|
|
2054
|
+
* Merge all: that goes through {@link mergeRun}, which keeps it apart from
|
|
2055
|
+
* ops tasks and starts the tasks its merge lets through.
|
|
2056
|
+
*/
|
|
2057
|
+
readonly runs: IsolationRunController;
|
|
1982
2058
|
/** A passed attempt's work onto the integration branch, and the conflict repair a landing may need. */
|
|
1983
2059
|
private landing;
|
|
1984
2060
|
private registry;
|
|
@@ -2023,13 +2099,24 @@ declare class TaskOrchestrator {
|
|
|
2023
2099
|
private envForTask;
|
|
2024
2100
|
approveCheckpoint(taskId: string): void;
|
|
2025
2101
|
rejectCheckpoint(taskId: string, reason?: string): void;
|
|
2026
|
-
|
|
2102
|
+
/** What the task's waiting checkpoint asks, whole; undefined once it settles or when none waits. */
|
|
2103
|
+
getCheckpointQuestion(taskId: string): string | undefined;
|
|
2104
|
+
awaitsCheckpoint(taskId: string): boolean;
|
|
2027
2105
|
/**
|
|
2028
2106
|
* Send a structured task a user message (ADR-0018, M1). Mid-turn it queues
|
|
2029
2107
|
* behind the turn; a task waiting for input takes it at once and is back in
|
|
2030
2108
|
* progress. Returns the message's id, for {@link removeQueuedTaskMessage}.
|
|
2031
2109
|
*/
|
|
2032
2110
|
sendTaskMessage(taskId: string, text: string): string;
|
|
2111
|
+
/**
|
|
2112
|
+
* Force send (ADR-0023, F1–F3): interrupt the running turn and deliver the
|
|
2113
|
+
* message as the next one, ahead of anything queued, without the task
|
|
2114
|
+
* waiting for input in between. A task already waiting for input just takes it.
|
|
2115
|
+
*/
|
|
2116
|
+
forceSendTaskMessage(taskId: string, text: string): string;
|
|
2117
|
+
private messageTask;
|
|
2118
|
+
/** Force send a message still queued behind the running turn; false once the runner has it. */
|
|
2119
|
+
forceSendQueuedTaskMessage(taskId: string, id: string): boolean;
|
|
2033
2120
|
/** Take back a message still queued behind a turn; false once it was delivered. */
|
|
2034
2121
|
removeQueuedTaskMessage(taskId: string, id: string): boolean;
|
|
2035
2122
|
/** Stop a structured task's running turn; it then waits for input like any turn that ends without its marker. */
|
|
@@ -2064,30 +2151,13 @@ declare class TaskOrchestrator {
|
|
|
2064
2151
|
/** Task id → session id of every attempt whose runner is up; a spawn in flight has no session yet. */
|
|
2065
2152
|
get activeSessionMap(): Map<string, string>;
|
|
2066
2153
|
getAttempt(taskId: string): TaskAttemptSnapshot | undefined;
|
|
2067
|
-
/** Where a task's isolated work stands; null when the plan has no isolation run to speak of. */
|
|
2068
|
-
getTaskIsolation(taskId: string): TaskIsolation | null;
|
|
2069
|
-
/**
|
|
2070
|
-
* The plan's isolation as a surface shows it, for one with no stream to have
|
|
2071
|
-
* told it — a reconnected webview, a session just loaded. Null without a run.
|
|
2072
|
-
*/
|
|
2073
|
-
isolationView(): IsolationView | null;
|
|
2074
2154
|
getAttemptSession(taskId: string): ITerminalSession | undefined;
|
|
2075
2155
|
get queuedCount(): number;
|
|
2076
|
-
/** A run is waiting on the user to stash or to go on without isolation. */
|
|
2077
|
-
get awaitingIsolationChoice(): boolean;
|
|
2078
|
-
/**
|
|
2079
|
-
* Take over a plan's persisted isolation, or none for a plan that has not
|
|
2080
|
-
* isolated yet, pruning what a crashed process left behind. Silent on the
|
|
2081
|
-
* observer: adopting is not a change to persist.
|
|
2082
|
-
*/
|
|
2083
|
-
adoptIsolation(state: PlanIsolation | null): Promise<void>;
|
|
2084
|
-
reviewRunDiff(): Promise<string>;
|
|
2085
2156
|
/**
|
|
2086
2157
|
* "Merge all"; a settled run that merged everything is cleared up and
|
|
2087
2158
|
* forgotten. During a run it merges what has landed and the run goes on:
|
|
2088
2159
|
* the tasks waiting at a merge gate for that work then start (ADR-0020).
|
|
2089
|
-
* Never
|
|
2090
|
-
* one overlap the plan cannot order, because the merge is the user's.
|
|
2160
|
+
* Never alongside ops work, either way round ({@link mergeExcludes}).
|
|
2091
2161
|
*/
|
|
2092
2162
|
mergeRun(): Promise<IsolationMergeResult>;
|
|
2093
2163
|
/**
|
|
@@ -2102,13 +2172,7 @@ declare class TaskOrchestrator {
|
|
|
2102
2172
|
* the task has started, and for every other task.
|
|
2103
2173
|
*/
|
|
2104
2174
|
getMergeGate(taskId: string): string[];
|
|
2105
|
-
/** Worktrees and task branches go; the integration branch and the record stay for review and merge. */
|
|
2106
|
-
cleanupRun(): Promise<void>;
|
|
2107
|
-
/** The run and everything it made go, and the plan forgets it; the next run starts afresh. */
|
|
2108
|
-
discardRun(): Promise<void>;
|
|
2109
2175
|
private watchBlockingPrompts;
|
|
2110
|
-
/** What the plan persists of isolated execution; null when no run ever isolated. */
|
|
2111
|
-
get isolationRecord(): PlanIsolation | null;
|
|
2112
2176
|
/** The transport the plan's latest run copied from the setting; null before its first run. */
|
|
2113
2177
|
get runnerTransport(): RunnerTransport | null;
|
|
2114
2178
|
/** Take over a saved plan's copied transport. The next run copies the setting afresh. */
|
|
@@ -2136,6 +2200,30 @@ declare class TaskOrchestrator {
|
|
|
2136
2200
|
start(): Promise<void>;
|
|
2137
2201
|
private haltOnFailure;
|
|
2138
2202
|
stop(): void;
|
|
2203
|
+
/** Name the tasks a stop took down, so none is mistaken for one still at work. */
|
|
2204
|
+
private sayStopped;
|
|
2205
|
+
/**
|
|
2206
|
+
* A task in progress with no attempt has nothing running it: a stop, a plan
|
|
2207
|
+
* load or anything else that ended its attempt left its status behind. It
|
|
2208
|
+
* is put back to not started, and said, so it can be retried rather than
|
|
2209
|
+
* read as running — or, in an isolated run, count as live work forever.
|
|
2210
|
+
*/
|
|
2211
|
+
private recoverOrphans;
|
|
2212
|
+
/**
|
|
2213
|
+
* Task ids still live, whose worktrees no clean-up of the whole run may
|
|
2214
|
+
* take: an attempt is running them, or the plan has them in progress or
|
|
2215
|
+
* waiting on the user mid-attempt — at a checkpoint, or for input. One
|
|
2216
|
+
* waiting on the user's decision instead (a conflict, a usage limit, files
|
|
2217
|
+
* an ops task changed) is not: no runner is at work on it, and a clean-up
|
|
2218
|
+
* keeps what it holds on a branch before its worktree goes.
|
|
2219
|
+
*/
|
|
2220
|
+
private liveTaskIds;
|
|
2221
|
+
/**
|
|
2222
|
+
* Whether the run may close with its handoff: no task is live. A handoff
|
|
2223
|
+
* tells the user the run has finished, and a Merge all after it clears the
|
|
2224
|
+
* run up, so neither may happen under a task the plan still shows at work.
|
|
2225
|
+
*/
|
|
2226
|
+
private get settled();
|
|
2139
2227
|
onUserTaskComplete(taskId: string): Promise<void>;
|
|
2140
2228
|
private onVerdict;
|
|
2141
2229
|
private afterVerdict;
|
|
@@ -2161,24 +2249,17 @@ declare class TaskOrchestrator {
|
|
|
2161
2249
|
* the ending attempt freed and never one more than the run allows.
|
|
2162
2250
|
*/
|
|
2163
2251
|
private settleUnlanded;
|
|
2164
|
-
/**
|
|
2165
|
-
* Mark which added task resolves which conflict. The resolver merges the
|
|
2166
|
-
* conflicted task's branch by hand in its own worktree; once that lands, the
|
|
2167
|
-
* conflicted task's branch is already on the integration branch and it can
|
|
2168
|
-
* land in turn — through the same merge, so a resolver that did not really
|
|
2169
|
-
* bring it along conflicts again instead of being taken at its word.
|
|
2170
|
-
*/
|
|
2171
|
-
linkConflictResolver(resolverId: string, conflictedId: string): void;
|
|
2172
2252
|
private landResolved;
|
|
2173
2253
|
getReadyTasks(): Task[];
|
|
2174
2254
|
private readiness;
|
|
2175
2255
|
/**
|
|
2176
|
-
* Open the run a task starts in, and
|
|
2177
|
-
*
|
|
2178
|
-
*
|
|
2179
|
-
* their choice replays.
|
|
2256
|
+
* Open the run a task starts in, and decide whether it isolates if the
|
|
2257
|
+
* task's next attempt needs that ({@link decidesIsolation}). False while a
|
|
2258
|
+
* dirty tree waits on the user; `resume` is what their choice replays.
|
|
2180
2259
|
*/
|
|
2181
2260
|
private openFor;
|
|
2261
|
+
/** The kind a task's next attempt starts as, short of a repair or a continue: what is weighed before one exists. */
|
|
2262
|
+
private nextAttemptKind;
|
|
2182
2263
|
/**
|
|
2183
2264
|
* Cancel a running (or scheduled) task: kill its session and return it to
|
|
2184
2265
|
* 'pending' — "not executed". The task is put on hold so the scheduler
|
|
@@ -2290,11 +2371,6 @@ declare class TaskOrchestrator {
|
|
|
2290
2371
|
private abandonSpawn;
|
|
2291
2372
|
private tell;
|
|
2292
2373
|
private say;
|
|
2293
|
-
/**
|
|
2294
|
-
* Whether the run in force, or else the next one, gives each task its own
|
|
2295
|
-
* worktrees, and of which repo group — what the planner is told.
|
|
2296
|
-
*/
|
|
2297
|
-
plannerIsolation(): Promise<IsolatedExecution>;
|
|
2298
2374
|
/**
|
|
2299
2375
|
* Replay the start a dirty tree turned away. `stash` puts the user's tracked
|
|
2300
2376
|
* changes on the git stash first, so the run isolates; `shared` runs this one
|
|
@@ -2487,7 +2563,9 @@ declare class RunnerInstallation {
|
|
|
2487
2563
|
* typing a real goal is the failure this exists to prevent.
|
|
2488
2564
|
*
|
|
2489
2565
|
* "Usable" is deliberately shallow: the binary answers `--version`, and the
|
|
2490
|
-
* runner
|
|
2566
|
+
* runner has a connector to plan over. Plugin runners have none yet: a
|
|
2567
|
+
* manifest-level planner capability, so a plugin can declare itself
|
|
2568
|
+
* plannable, is a follow-up. Whether the user's subscription is
|
|
2491
2569
|
* live cannot be known without spending a turn on it, so an expired login
|
|
2492
2570
|
* surfaces where it actually bites — as the agent's own error text on the
|
|
2493
2571
|
* first turn.
|
|
@@ -2641,7 +2719,7 @@ interface EnvAdmission {
|
|
|
2641
2719
|
*/
|
|
2642
2720
|
declare function admitSettingsEnv(env: Record<string, unknown>): EnvAdmission;
|
|
2643
2721
|
|
|
2644
|
-
/** Whether a runner's tasks can run on the structured transport. */
|
|
2722
|
+
/** Whether a runner's tasks can run on the structured transport (ADR-0018, S3). */
|
|
2645
2723
|
declare function supportsTaskMode(runner: string): boolean;
|
|
2646
2724
|
/** The adapter that drives one task. Throws {@link TaskModeUnsupportedError} for a runner without a connector. */
|
|
2647
2725
|
declare function createTaskAdapter(runner: string, deps: AgentProcessDeps): TaskModeAgentAdapter;
|
|
@@ -2727,20 +2805,10 @@ declare abstract class StdioAgentAdapter implements AgentAdapter {
|
|
|
2727
2805
|
protected static parse<T>(line: string): T | null;
|
|
2728
2806
|
}
|
|
2729
2807
|
|
|
2730
|
-
/**
|
|
2731
|
-
* Claude Code as a planner, over its bidirectional streaming-JSON transport
|
|
2732
|
-
* (ADR-0009).
|
|
2733
|
-
*
|
|
2734
|
-
* `-p --input-format stream-json --output-format stream-json` keeps one process
|
|
2735
|
-
* alive across turns: user messages go in as JSON lines, and the session's
|
|
2736
|
-
* assistant blocks, tool uses, tool results and turn boundaries come back the
|
|
2737
|
-
* same way. It is the richest of the three streams — partial messages and
|
|
2738
|
-
* separate thinking blocks — which is why this agent went first.
|
|
2739
|
-
*/
|
|
2740
2808
|
declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAgentAdapter {
|
|
2741
2809
|
readonly agentId = "claude-code";
|
|
2742
|
-
private
|
|
2743
|
-
/**
|
|
2810
|
+
private controlCount;
|
|
2811
|
+
/** Control requests sent and not yet answered, by request id. */
|
|
2744
2812
|
private readonly pendingControl;
|
|
2745
2813
|
/** An interrupt was sent during the current turn, so an aborted result is that interrupt, not a failure. */
|
|
2746
2814
|
private interruptRequested;
|
|
@@ -2779,6 +2847,14 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
|
|
|
2779
2847
|
private requestedMode;
|
|
2780
2848
|
/** The session `--resume` asked for, until the CLI's `init` shows it was taken up. */
|
|
2781
2849
|
private pendingResume;
|
|
2850
|
+
/** The `--mcp-config` file of the running process, which holds its token; removed with the process. */
|
|
2851
|
+
private mcpConfig;
|
|
2852
|
+
/** Whether this process was given the server, so its tools' requests are Ordewell's own. */
|
|
2853
|
+
private givenOrdewell;
|
|
2854
|
+
/** Messages written into a running task turn, by the `uuid` their echo will carry, until it does (ADR-0023). */
|
|
2855
|
+
private readonly steers;
|
|
2856
|
+
/** The last turn's `result` ended it, so a steer's echo now opens a turn the CLI started for that message. */
|
|
2857
|
+
private turnClosed;
|
|
2782
2858
|
protected spawnSpec(opts: AgentStartOptions): SpawnSpec;
|
|
2783
2859
|
/**
|
|
2784
2860
|
* A task's run: the manifest decides what its mode and effort mean
|
|
@@ -2789,6 +2865,12 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
|
|
|
2789
2865
|
* without it `-p` refuses them silently and nothing can ever surface one.
|
|
2790
2866
|
*/
|
|
2791
2867
|
private taskSpawnSpec;
|
|
2868
|
+
/** The file holding the token lives exactly as long as the process that reads it. */
|
|
2869
|
+
private ordewellServerArgs;
|
|
2870
|
+
private removeMcpConfig;
|
|
2871
|
+
start(opts: AgentStartOptions): Promise<void>;
|
|
2872
|
+
/** Asks the CLI itself, which reports `pending` until its connection attempt settles. */
|
|
2873
|
+
mcpAttached(): Promise<boolean>;
|
|
2792
2874
|
/**
|
|
2793
2875
|
* Claude Code's soft interrupt: the turn stops, the process and its session
|
|
2794
2876
|
* stay. The CLI acknowledges on the control channel, then closes the turn
|
|
@@ -2796,6 +2878,17 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
|
|
|
2796
2878
|
* as an interrupted `turn_end`.
|
|
2797
2879
|
*/
|
|
2798
2880
|
interrupt(timeoutMs: number): Promise<boolean>;
|
|
2881
|
+
/**
|
|
2882
|
+
* A `user` line written mid-turn is Claude Code's own queue (ADR-0023): the
|
|
2883
|
+
* CLI attaches it to the next tool result, or runs it as a turn of its own
|
|
2884
|
+
* after `result` — an interrupted one included — so it never lets go of one,
|
|
2885
|
+
* and nothing is ever reported dropped. Refused while an interrupt is in
|
|
2886
|
+
* flight, and before a `--resume` is taken up: a refused resume closes stdin
|
|
2887
|
+
* with the message unread.
|
|
2888
|
+
*/
|
|
2889
|
+
steer(id: string, text: string): Promise<boolean>;
|
|
2890
|
+
/** Send a control request and wait for its answer; null when none came in time or the process ended. */
|
|
2891
|
+
private control;
|
|
2799
2892
|
/**
|
|
2800
2893
|
* A `--resume` the CLI cannot find is answered at once with an error result
|
|
2801
2894
|
* and no `init`, after which it waits on stdin for input it never reads — a
|
|
@@ -2813,6 +2906,13 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
|
|
|
2813
2906
|
dispose(): void;
|
|
2814
2907
|
private clearFollowOnTimer;
|
|
2815
2908
|
protected turnPayload(message: string): string;
|
|
2909
|
+
private openTurnState;
|
|
2910
|
+
/**
|
|
2911
|
+
* The echo of a steered message: the model has it. After a closed turn it
|
|
2912
|
+
* opens the CLI's own turn for the message, which then runs like one Ordewell
|
|
2913
|
+
* sent. The first prompt is echoed too, and is no steer.
|
|
2914
|
+
*/
|
|
2915
|
+
private steerDelivered;
|
|
2816
2916
|
protected handleLine(line: string, emit: (event: AgentEvent) => void): void;
|
|
2817
2917
|
/**
|
|
2818
2918
|
* `--permission-mode auto` on a model or account without auto mode is not
|
|
@@ -2880,10 +2980,7 @@ declare class CodexAdapter extends StdioAgentAdapter implements TaskModeAgentAda
|
|
|
2880
2980
|
private startOpts;
|
|
2881
2981
|
/** Whether this turn has already emitted prose — see the `agentMessage` case. */
|
|
2882
2982
|
private turnHasText;
|
|
2883
|
-
/**
|
|
2884
|
-
* The turn in flight. Its id arrives with `turn/started` or the `turn/start`
|
|
2885
|
-
* response, whichever lands first; `turn/interrupt` cannot be sent without it.
|
|
2886
|
-
*/
|
|
2983
|
+
/** The turn in flight. `turn/interrupt` and `turn/steer` cannot be sent before it has an id. */
|
|
2887
2984
|
private turn;
|
|
2888
2985
|
/** The JSON-RPC id of the `turn/start` that opened {@link turn}. */
|
|
2889
2986
|
private turnRequestId;
|
|
@@ -2891,6 +2988,12 @@ declare class CodexAdapter extends StdioAgentAdapter implements TaskModeAgentAda
|
|
|
2891
2988
|
private endedTurnId;
|
|
2892
2989
|
/** An interrupt was asked for during this turn, so however it ends, it was cut short. */
|
|
2893
2990
|
private interruptRequested;
|
|
2991
|
+
/**
|
|
2992
|
+
* Turns an interrupt cut short. Codex leaves their command running and
|
|
2993
|
+
* reports it when it ends, inside whatever turn is live by then — a report
|
|
2994
|
+
* that belongs to no turn of the agent's any more (ADR-0023, F4).
|
|
2995
|
+
*/
|
|
2996
|
+
private readonly interruptedTurnIds;
|
|
2894
2997
|
/** An interrupt asked for before Codex named the turn, sent once it does. */
|
|
2895
2998
|
private interruptOnStart;
|
|
2896
2999
|
/** A task's approval requests still waiting for an answer, by the request id as a string. */
|
|
@@ -2900,11 +3003,16 @@ declare class CodexAdapter extends StdioAgentAdapter implements TaskModeAgentAda
|
|
|
2900
3003
|
* names only the item, and a person deciding needs to see the files.
|
|
2901
3004
|
*/
|
|
2902
3005
|
private readonly fileChangePaths;
|
|
3006
|
+
/** The row each announced file of an in-flight `fileChange` item is shown under, by the file's shown path. */
|
|
3007
|
+
private readonly fileChangeRows;
|
|
2903
3008
|
/** Requests this adapter sent and awaits an answer to, by JSON-RPC id. */
|
|
2904
3009
|
private readonly pendingRequests;
|
|
2905
3010
|
private resumeAttempted;
|
|
2906
3011
|
private resumeFallbackSent;
|
|
2907
3012
|
private sandbox;
|
|
3013
|
+
/** The Ordewell server's startup state, as Codex last reported it for this thread. */
|
|
3014
|
+
private mcpStartup;
|
|
3015
|
+
private mcpStartupSettled;
|
|
2908
3016
|
/**
|
|
2909
3017
|
* Subagent threads this session has spawned, keyed by the child thread id.
|
|
2910
3018
|
* Codex runs a subagent in its own thread and replays both threads' events on
|
|
@@ -2931,6 +3039,12 @@ declare class CodexAdapter extends StdioAgentAdapter implements TaskModeAgentAda
|
|
|
2931
3039
|
*/
|
|
2932
3040
|
private startThread;
|
|
2933
3041
|
private threadParams;
|
|
3042
|
+
/**
|
|
3043
|
+
* Codex's own startup report for the server, which it sends once the thread
|
|
3044
|
+
* has tried to connect (ADR-0022, S4). A report that came before this was
|
|
3045
|
+
* asked is kept, so asking late still gets the answer.
|
|
3046
|
+
*/
|
|
3047
|
+
mcpAttached(): Promise<boolean>;
|
|
2934
3048
|
private effort;
|
|
2935
3049
|
/**
|
|
2936
3050
|
* `turn/interrupt` names the turn as well as the thread, so an interrupt
|
|
@@ -2938,6 +3052,17 @@ declare class CodexAdapter extends StdioAgentAdapter implements TaskModeAgentAda
|
|
|
2938
3052
|
* with an empty result, then ends the turn as `interrupted`.
|
|
2939
3053
|
*/
|
|
2940
3054
|
interrupt(timeoutMs: number): Promise<boolean>;
|
|
3055
|
+
/**
|
|
3056
|
+
* `turn/steer` into the running turn (ADR-0023). Codex answers with the
|
|
3057
|
+
* turn's id at once — acceptance, not delivery — and shows the input to the
|
|
3058
|
+
* model after the item in flight, as a `userMessage` item carrying the
|
|
3059
|
+
* `clientUserMessageId` sent; that item is the delivery. The request needs
|
|
3060
|
+
* the turn's id, so a steer asked for before Codex named the turn waits for
|
|
3061
|
+
* it, as an interrupt does. Refused when the turn has ended or is another one.
|
|
3062
|
+
*/
|
|
3063
|
+
steer(id: string, text: string): Promise<boolean>;
|
|
3064
|
+
/** The one way input reaches a running turn: a task message, or a deny note. */
|
|
3065
|
+
private requestSteer;
|
|
2941
3066
|
/**
|
|
2942
3067
|
* Answer an open approval in its own result schema. Codex's decline carries
|
|
2943
3068
|
* no message, so a deny note reaches the agent as input steered into the
|
|
@@ -2947,7 +3072,15 @@ declare class CodexAdapter extends StdioAgentAdapter implements TaskModeAgentAda
|
|
|
2947
3072
|
protected turnPayload(message: string): string;
|
|
2948
3073
|
protected handleLine(line: string, emit: (event: AgentEvent) => void): void;
|
|
2949
3074
|
private turnStarted;
|
|
3075
|
+
/**
|
|
3076
|
+
* Ahead of the event that ends the turn: a steer Codex accepted and the turn
|
|
3077
|
+
* never consumed is gone — Codex keeps no queue across turns — and one not
|
|
3078
|
+
* yet accepted never will be (ADR-0023, D4).
|
|
3079
|
+
*/
|
|
2950
3080
|
private closeTurn;
|
|
3081
|
+
private fromInterruptedTurn;
|
|
3082
|
+
/** The `userMessage` item a steer turns into once the item before it completes: the model has it. */
|
|
3083
|
+
private steerDelivered;
|
|
2951
3084
|
/**
|
|
2952
3085
|
* The child thread id when `threadId` names a subagent's thread, or undefined
|
|
2953
3086
|
* for the planner's own. Codex replays both threads on one stream and only
|
|
@@ -2987,6 +3120,16 @@ declare class CodexAdapter extends StdioAgentAdapter implements TaskModeAgentAda
|
|
|
2987
3120
|
/** A tool item entering `inProgress` — announce the call so the timeline moves. */
|
|
2988
3121
|
private emitItemStart;
|
|
2989
3122
|
private emitItemDone;
|
|
3123
|
+
/**
|
|
3124
|
+
* One row per changed file: a patch is several files, and one row naming
|
|
3125
|
+
* them all reads as a single cut-off path. The first file keeps the item's
|
|
3126
|
+
* id, which an approval for the patch points at. Announcing a file twice
|
|
3127
|
+
* returns the row it already has, so a change first seen completed still
|
|
3128
|
+
* gets its call.
|
|
3129
|
+
*/
|
|
3130
|
+
private announceFileChange;
|
|
3131
|
+
/** Relative to the task's worktree, where every path but a stray one lies; a move names both ends. */
|
|
3132
|
+
private shownChangePath;
|
|
2990
3133
|
/**
|
|
2991
3134
|
* A `collabAgentToolCall` — the planner spawning, waiting on or messaging a
|
|
2992
3135
|
* subagent. The call itself is planner-level tool activity; the lifecycle it
|
|
@@ -3034,17 +3177,18 @@ declare class OpenCodeAdapter implements TaskModeAgentAdapter {
|
|
|
3034
3177
|
private readonly processEnded;
|
|
3035
3178
|
private planner;
|
|
3036
3179
|
private task;
|
|
3037
|
-
/** Whether this turn has already emitted reply text — see {@link emitPart}. */
|
|
3038
|
-
private turnHasText;
|
|
3039
3180
|
/** The last assistant message already settled — the baseline {@link recoverReply} measures a new reply against. */
|
|
3040
3181
|
private lastAssistantId;
|
|
3041
3182
|
private taskTurn;
|
|
3042
3183
|
/** An abort was posted during the current task turn, so the idle that follows ends it as interrupted. */
|
|
3043
3184
|
private interruptRequested;
|
|
3044
|
-
|
|
3045
|
-
|
|
3185
|
+
private readonly permissions;
|
|
3186
|
+
/** Messages handed into the running task turn, until the model reads them (ADR-0023). Kept across turns: the server keeps the message too. */
|
|
3187
|
+
private readonly steers;
|
|
3046
3188
|
/** Set once the server turns out to speak the 2.x API, which then owns the session. */
|
|
3047
3189
|
private v2;
|
|
3190
|
+
/** The Ordewell server this process was configured with; null when none was given or its config could not be merged. */
|
|
3191
|
+
private ordewell;
|
|
3048
3192
|
constructor(deps: AgentProcessDeps);
|
|
3049
3193
|
start(opts: AgentStartOptions): Promise<void>;
|
|
3050
3194
|
send(message: string, onEvent: (event: AgentEvent) => void, signal?: AbortSignal, onActivity?: () => void): Promise<void>;
|
|
@@ -3058,6 +3202,20 @@ declare class OpenCodeAdapter implements TaskModeAgentAdapter {
|
|
|
3058
3202
|
* {@link recoverReply}, never applies.
|
|
3059
3203
|
*/
|
|
3060
3204
|
private sendTask;
|
|
3205
|
+
/**
|
|
3206
|
+
* The prompt that carries a task message: the mode as the agent, the task
|
|
3207
|
+
* model and effort, and only `question` withheld. A steer names its own
|
|
3208
|
+
* `messageID` so the frames can be told apart from the first prompt's.
|
|
3209
|
+
*/
|
|
3210
|
+
private taskPromptBody;
|
|
3211
|
+
/** Hand a message into the running task turn (ADR-0023, D2), naming it so its delivery is observable. */
|
|
3212
|
+
steer(id: string, text: string): Promise<boolean>;
|
|
3213
|
+
/**
|
|
3214
|
+
* Messages handed over but unread when the turn ended. Each is deleted from
|
|
3215
|
+
* the session — so the next turn's re-send is not a duplicate — and reported
|
|
3216
|
+
* dropped, which is what puts it back in Ordewell's queue.
|
|
3217
|
+
*/
|
|
3218
|
+
private dropUnreadSteers;
|
|
3061
3219
|
/**
|
|
3062
3220
|
* Whatever of the turn's own messages the stream missed. Each part is
|
|
3063
3221
|
* emitted once, so a turn the stream saw whole adds nothing here; one that
|
|
@@ -3145,52 +3303,21 @@ declare class OpenCodeAdapter implements TaskModeAgentAdapter {
|
|
|
3145
3303
|
* none of this turn's business.
|
|
3146
3304
|
*/
|
|
3147
3305
|
private onFrame;
|
|
3148
|
-
/**
|
|
3149
|
-
|
|
3150
|
-
* with its first visible delta, so the deltas add up to exactly the text the
|
|
3151
|
-
* completed part then re-sends; a part that is only whitespace so far is
|
|
3152
|
-
* held back, for the reason {@link emitPart} drops one.
|
|
3153
|
-
*/
|
|
3154
|
-
private onTextDelta;
|
|
3155
|
-
/**
|
|
3156
|
-
* Deny one permission request (T1). OpenCode blocks the turn until the
|
|
3157
|
-
* request is answered, so this must answer — `reject` rather than a silent
|
|
3158
|
-
* drop, which is the same "absent answer is a denial" invariant ADR-0008
|
|
3159
|
-
* states for Ordewell's own tools. The refusal is announced so the timeline
|
|
3160
|
-
* shows the planner reaching for something it may not have.
|
|
3161
|
-
*/
|
|
3162
|
-
private denyPermission;
|
|
3163
|
-
/**
|
|
3164
|
-
* A task's request. Under a mode whose manifest sets `approvals: auto` —
|
|
3165
|
-
* `build`, which the terminal transport runs with `--auto` — it is answered
|
|
3166
|
-
* at once with what `run --auto` answers, so the same plan behaves the same
|
|
3167
|
-
* on both transports (ADR-0001), and announced already decided so the log
|
|
3168
|
-
* still shows it. Any other mode leaves it open for an approval card.
|
|
3169
|
-
*/
|
|
3170
|
-
private askPermission;
|
|
3306
|
+
/** A planner's request is refused (T1); a task's is answered at once or left open for a card. */
|
|
3307
|
+
private onPermissionAsked;
|
|
3171
3308
|
/**
|
|
3172
3309
|
* `POST /permission/:id/reply` is the current answer. The per-session path
|
|
3173
3310
|
* it replaced is tried only when a server too old to know the new one 404s.
|
|
3174
3311
|
*/
|
|
3175
3312
|
private replyPermission;
|
|
3176
|
-
/**
|
|
3177
|
-
* Open `/event` for one turn and wait until it is connected. The stream
|
|
3178
|
-
* stopped being best-effort the moment permission answers moved onto it: a
|
|
3179
|
-
* request raised before we connect is one nobody answers, and the turn
|
|
3180
|
-
* hangs on it. Waiting is bounded so a server that never opens `/event`
|
|
3181
|
-
* still gets its turn.
|
|
3182
|
-
*/
|
|
3313
|
+
/** `/event` for one turn — see {@link openEventStream}. Load-bearing for {@link onPermissionAsked}. */
|
|
3183
3314
|
private openStream;
|
|
3184
|
-
/**
|
|
3185
|
-
* Server-sent events from `/event`: the turn's live text, reasoning, tool
|
|
3186
|
-
* activity and usage, and the only channel permission requests arrive on —
|
|
3187
|
-
* so the stream is load-bearing for {@link denyPermission}.
|
|
3188
|
-
*/
|
|
3189
|
-
private streamEvents;
|
|
3190
3315
|
private json;
|
|
3191
3316
|
private request;
|
|
3192
3317
|
private headers;
|
|
3193
3318
|
nativeSessionId(): string | null;
|
|
3319
|
+
/** Asks the server, which lists every MCP server it has with the state of its connection. */
|
|
3320
|
+
mcpAttached(): Promise<boolean>;
|
|
3194
3321
|
dispose(): void;
|
|
3195
3322
|
private exitMessage;
|
|
3196
3323
|
}
|
|
@@ -3219,6 +3346,22 @@ interface ForkedDialogue {
|
|
|
3219
3346
|
researchLog: ResearchLogEntry[];
|
|
3220
3347
|
}
|
|
3221
3348
|
|
|
3349
|
+
/** A read made through a planner tool: refused once the turn's budget is gone, else answered, told to land when the budget asks it to. */
|
|
3350
|
+
type ToolRead<T> = {
|
|
3351
|
+
status: 'refused';
|
|
3352
|
+
} | {
|
|
3353
|
+
status: 'answered';
|
|
3354
|
+
value: T;
|
|
3355
|
+
landNow: boolean;
|
|
3356
|
+
};
|
|
3357
|
+
/** A plan or task edit handed to the open turn over a channel other than its reply (ADR-0022). */
|
|
3358
|
+
type PlannerSubmission = {
|
|
3359
|
+
kind: 'plan';
|
|
3360
|
+
tasks: Task[];
|
|
3361
|
+
} | {
|
|
3362
|
+
kind: 'task_ops';
|
|
3363
|
+
ops: TaskOp[];
|
|
3364
|
+
};
|
|
3222
3365
|
/** Everything (re)opening a conversation needs besides the dialogue itself. */
|
|
3223
3366
|
type ConversationOpening = Omit<ConversationRequest, 'goal' | 'onProgress' | 'signal' | 'priorHistory' | 'initialMessage'>;
|
|
3224
3367
|
/**
|
|
@@ -3333,13 +3476,36 @@ declare class PlannerConversation {
|
|
|
3333
3476
|
private savedInBackground;
|
|
3334
3477
|
private turnsInFlight;
|
|
3335
3478
|
private compacting;
|
|
3336
|
-
private
|
|
3479
|
+
private openTurn;
|
|
3337
3480
|
constructor(host: PlannerConversationHost);
|
|
3338
3481
|
get transcript(): readonly ConversationMessage[];
|
|
3339
3482
|
/** Whether a user turn is between its transcript append and its settled outcome. */
|
|
3340
3483
|
get isTurnInFlight(): boolean;
|
|
3341
3484
|
/** The user turn being answered, for what the host raises during it — an approval the turn's research asks for. */
|
|
3342
3485
|
get currentTurnId(): string | undefined;
|
|
3486
|
+
/**
|
|
3487
|
+
* Hand the open turn a plan (already validated) or a task edit. The turn
|
|
3488
|
+
* settles with it exactly as with the same plan or ops parsed out of its
|
|
3489
|
+
* reply, and it wins over any envelope that reply carries. A later
|
|
3490
|
+
* submission replaces an earlier one. False when no user turn is open.
|
|
3491
|
+
*/
|
|
3492
|
+
submit(submission: PlannerSubmission): boolean;
|
|
3493
|
+
/**
|
|
3494
|
+
* The edit the open turn already holds, for a further edit in the same reply
|
|
3495
|
+
* to join rather than replace. Empty when it holds nothing; null when it holds
|
|
3496
|
+
* a whole plan, which an edit cannot be layered on.
|
|
3497
|
+
*/
|
|
3498
|
+
pendingOps(): TaskOp[] | null;
|
|
3499
|
+
/** Whether the turn would park this edit until a batch boundary instead of applying it as it settles. */
|
|
3500
|
+
editWouldQueue(ops: TaskOp[]): boolean;
|
|
3501
|
+
/**
|
|
3502
|
+
* A read the planner makes through a tool. It spends the same per-turn budget
|
|
3503
|
+
* as an envelope read, so a planner cannot read more by switching channels:
|
|
3504
|
+
* past the soft limit, or on a repeated question, the answer still comes but
|
|
3505
|
+
* is told to land the turn; at the hard limit it is refused. `signature`
|
|
3506
|
+
* names the question, for the repeat check.
|
|
3507
|
+
*/
|
|
3508
|
+
read<T>(signature: string, answer: () => Promise<T>): Promise<ToolRead<T>>;
|
|
3343
3509
|
/** Whether the model still holds this conversation in memory. */
|
|
3344
3510
|
get isActive(): boolean;
|
|
3345
3511
|
append(role: ConversationMessage['role'], content: string, opts?: {
|
|
@@ -3472,6 +3638,13 @@ declare class PlannerConversation {
|
|
|
3472
3638
|
* would cost it the chance to fix the edit.
|
|
3473
3639
|
*/
|
|
3474
3640
|
private drainTaskQueries;
|
|
3641
|
+
/**
|
|
3642
|
+
* The backend's answer, with what was handed in while it ran standing in
|
|
3643
|
+
* for whatever its reply carried. Taken once: a corrective re-send after a
|
|
3644
|
+
* rejected edit must not settle on the same submission again. A stopped
|
|
3645
|
+
* turn commits nothing, the same as a stopped reply with a plan in it.
|
|
3646
|
+
*/
|
|
3647
|
+
private claimSubmission;
|
|
3475
3648
|
/**
|
|
3476
3649
|
* Render one read out of live state. Never persisted to the transcript: the
|
|
3477
3650
|
* detail is context for the planner's next reply, and re-sending it on every
|
|
@@ -3498,7 +3671,8 @@ declare class PlannerConversation {
|
|
|
3498
3671
|
*
|
|
3499
3672
|
* The host's catalog is allowlist-filtered, so a restricted allowlist stays a
|
|
3500
3673
|
* hard bound on every turn, and reads the plan's runners live, so a runner
|
|
3501
|
-
* admitted mid-session by a retarget is shown like every other.
|
|
3674
|
+
* admitted mid-session by a retarget is shown like every other. A planner
|
|
3675
|
+
* with Ordewell's tools gets a reminder to read the catalog instead.
|
|
3502
3676
|
*/
|
|
3503
3677
|
private catalogBlock;
|
|
3504
3678
|
/**
|
|
@@ -3534,6 +3708,10 @@ declare class SkillsService {
|
|
|
3534
3708
|
constructor(workspaceRoot?: string | undefined);
|
|
3535
3709
|
private localDir;
|
|
3536
3710
|
private globalDir;
|
|
3711
|
+
private readSeedManifest;
|
|
3712
|
+
private recordSeed;
|
|
3713
|
+
/** A seed the user never edited: safe to replace with a newer built-in. */
|
|
3714
|
+
private isUntouchedSeed;
|
|
3537
3715
|
private seed;
|
|
3538
3716
|
seedBuiltinSkill(name: string): boolean;
|
|
3539
3717
|
/** Removes a retired built-in's seed from the global dir, but only if it's untouched by the user. */
|
|
@@ -3579,11 +3757,14 @@ interface SessionEventRelayDeps {
|
|
|
3579
3757
|
/** Where isolation notices go, for a host whose notifications are not seen by the user. */
|
|
3580
3758
|
onNotice?: (notice: SessionNotice) => void;
|
|
3581
3759
|
store: Pick<PlanStore, 'allTasks' | 'snapshot'>;
|
|
3582
|
-
orchestrator: Pick<TaskOrchestrator, 'getIdleSince' | '
|
|
3760
|
+
orchestrator: Pick<TaskOrchestrator, 'getIdleSince' | 'getQueuedTaskMessages' | 'getMergeGate' | 'mergeGateView'>;
|
|
3761
|
+
runs: Pick<IsolationRunController, 'taskIsolation'>;
|
|
3583
3762
|
/** Shared with the Session, which snapshots, restores and clears it. */
|
|
3584
3763
|
usage: PlannerUsageLedger;
|
|
3585
3764
|
/** How many of a task's runner requests wait for an answer (ADR-0018, A1). */
|
|
3586
3765
|
awaitingApproval?: (taskId: string) => number;
|
|
3766
|
+
/** What a task's waiting checkpoint asks, whole. */
|
|
3767
|
+
checkpointQuestion?: (taskId: string) => string | undefined;
|
|
3587
3768
|
}
|
|
3588
3769
|
/** Every orchestrator event the relay announces; `onTaskSettled` is persistence only, so it is the Session's. */
|
|
3589
3770
|
type RelayObserver = Required<Omit<OrchestratorObserver, 'onTaskSettled'>>;
|
|
@@ -3598,8 +3779,10 @@ declare class SessionEventRelay {
|
|
|
3598
3779
|
private readonly onNotice?;
|
|
3599
3780
|
private readonly store;
|
|
3600
3781
|
private readonly orchestrator;
|
|
3782
|
+
private readonly runs;
|
|
3601
3783
|
private readonly usage;
|
|
3602
3784
|
private readonly awaitingApproval;
|
|
3785
|
+
private readonly checkpointQuestion;
|
|
3603
3786
|
/**
|
|
3604
3787
|
* The in-flight turn's subagent activity, grouped one run per subagent so a
|
|
3605
3788
|
* replay nests each step under its own brief/result. Folded into the plan's
|
|
@@ -3665,16 +3848,6 @@ declare function openTaskLog(location: TaskLogLocation, taskId: string): TaskLog
|
|
|
3665
3848
|
*/
|
|
3666
3849
|
declare function readTaskLog(location: TaskLogLocation, taskId: string, attempt: number): TaskLogEvent[];
|
|
3667
3850
|
|
|
3668
|
-
/**
|
|
3669
|
-
* A direct (non-planner) plan edit the session refused. Distinct from a plain
|
|
3670
|
-
* Error so a surface can tell "you asked for something invalid" from "something
|
|
3671
|
-
* broke" and say which — the HTTP routes used to collapse both into 404/500,
|
|
3672
|
-
* which read to the TUI and VS Code as the edit silently doing nothing. Carries
|
|
3673
|
-
* no status code: core is transport-agnostic, the route maps it.
|
|
3674
|
-
*/
|
|
3675
|
-
declare class PlanEditError extends Error {
|
|
3676
|
-
constructor(message: string);
|
|
3677
|
-
}
|
|
3678
3851
|
/**
|
|
3679
3852
|
* Options for plan generation. Progress is not overridable: every planner
|
|
3680
3853
|
* progress event is translated to a SessionMessage inside the Session and
|
|
@@ -3692,6 +3865,8 @@ interface SessionRuntimeSettings {
|
|
|
3692
3865
|
modelAllowlist?: Record<string, string[]>;
|
|
3693
3866
|
/** Read once as a run starts, never per spawn (ADR-0018, S1). Absent means terminal. */
|
|
3694
3867
|
runnerTransport?: RunnerTransport;
|
|
3868
|
+
/** Absent means the user never chose, and `config.enabledRunners` (the host's defaults) decides. */
|
|
3869
|
+
enabledRunners?: RunnerId[];
|
|
3695
3870
|
}
|
|
3696
3871
|
declare function sessionRuntimeSettings(settings: UserSettings): SessionRuntimeSettings;
|
|
3697
3872
|
/**
|
|
@@ -3724,10 +3899,10 @@ interface ConversationRewind extends ConversationFork {
|
|
|
3724
3899
|
type SaveSession = (plan: LegacyPlanState, goal: string, workspace: string, sessionId: string) => void;
|
|
3725
3900
|
/**
|
|
3726
3901
|
* Everything a delivery surface constructs to host a session. Structural config
|
|
3727
|
-
* (
|
|
3728
|
-
*
|
|
3729
|
-
*
|
|
3730
|
-
* between
|
|
3902
|
+
* (orchestratorModel, providerModelLists) is snapshotted inside `config` at
|
|
3903
|
+
* construction and never re-read from the environment. Runtime settings (tdd,
|
|
3904
|
+
* verification, enabled runners) are read live via the `settings` callback so a
|
|
3905
|
+
* toggle between operations takes effect.
|
|
3731
3906
|
*/
|
|
3732
3907
|
interface SessionDeps {
|
|
3733
3908
|
config: IConfig;
|
|
@@ -3744,7 +3919,7 @@ interface SessionDeps {
|
|
|
3744
3919
|
onNotice?: (notice: SessionNotice) => void;
|
|
3745
3920
|
/** Shared across sessions — sole producer of model catalogs and routing lists. */
|
|
3746
3921
|
modelResolver: ModelResolver;
|
|
3747
|
-
/** Live runtime settings (tdd, verification). Read at each operation that needs them. */
|
|
3922
|
+
/** Live runtime settings (tdd, verification, enabled runners). Read at each operation that needs them. */
|
|
3748
3923
|
settings: () => SessionRuntimeSettings;
|
|
3749
3924
|
/**
|
|
3750
3925
|
* Host-assigned session id. When set, every persist writes under this id so
|
|
@@ -3780,6 +3955,8 @@ interface SessionDeps {
|
|
|
3780
3955
|
saveSession?: SaveSession;
|
|
3781
3956
|
/** Where a structured task's log is saved (ADR-0018, P1). Defaults to a file per attempt beside the session's. */
|
|
3782
3957
|
openTaskLog?: (location: TaskLogLocation, taskId: string) => TaskLogFile;
|
|
3958
|
+
/** The Ordewell MCP server a harness planner's tools are served from (ADR-0022). Defaults to the process's one. */
|
|
3959
|
+
mcpServer?: OrdewellMcpServer;
|
|
3783
3960
|
}
|
|
3784
3961
|
/**
|
|
3785
3962
|
* The composition root: builds every collaborator a Session drives and wires
|
|
@@ -3802,6 +3979,8 @@ interface SessionParts {
|
|
|
3802
3979
|
planner: SessionPlanner;
|
|
3803
3980
|
store: PlanStore;
|
|
3804
3981
|
orchestrator: TaskOrchestrator;
|
|
3982
|
+
/** The orchestrator's own: Session reads the run and acts on it there, Merge all aside. */
|
|
3983
|
+
runs: IsolationRunController;
|
|
3805
3984
|
events: SessionEventRelay;
|
|
3806
3985
|
usage: PlannerUsageLedger;
|
|
3807
3986
|
approvals: PendingApprovals;
|
|
@@ -3830,6 +4009,7 @@ declare class Session {
|
|
|
3830
4009
|
private readonly events;
|
|
3831
4010
|
private readonly planner;
|
|
3832
4011
|
private readonly orchestrator;
|
|
4012
|
+
private readonly runs;
|
|
3833
4013
|
private readonly store;
|
|
3834
4014
|
private readonly config;
|
|
3835
4015
|
private readonly registry;
|
|
@@ -3852,6 +4032,8 @@ declare class Session {
|
|
|
3852
4032
|
private currentSessionId;
|
|
3853
4033
|
private readonly skillsService;
|
|
3854
4034
|
private readonly conversation;
|
|
4035
|
+
private readonly editor;
|
|
4036
|
+
private readonly plannerTools;
|
|
3855
4037
|
constructor(parts: SessionParts);
|
|
3856
4038
|
/**
|
|
3857
4039
|
* Answer an outstanding approval. Every surface funnels here — the web
|
|
@@ -3912,6 +4094,14 @@ declare class Session {
|
|
|
3912
4094
|
* session.
|
|
3913
4095
|
*/
|
|
3914
4096
|
reset(): void;
|
|
4097
|
+
/**
|
|
4098
|
+
* What a planner may assign right now: every enabled runner, its modes, and
|
|
4099
|
+
* its allowlisted models — read as of this call, so a runner enabled or an
|
|
4100
|
+
* allowlist edited since planning started is in it (#69). Discovers a
|
|
4101
|
+
* runner's models the first time it is asked for.
|
|
4102
|
+
*/
|
|
4103
|
+
liveCatalog(): Promise<TaskQueryCatalog>;
|
|
4104
|
+
private catalogOf;
|
|
3915
4105
|
private runnerModesFor;
|
|
3916
4106
|
/**
|
|
3917
4107
|
* The catalog a model/task-mode edit is checked against — the same
|
|
@@ -3922,6 +4112,8 @@ declare class Session {
|
|
|
3922
4112
|
* allowlist itself, the same way `coerceAssignments` does.
|
|
3923
4113
|
*/
|
|
3924
4114
|
private editCatalog;
|
|
4115
|
+
/** The runners enabled right now — a toggle made since the session was built counts (#69). */
|
|
4116
|
+
private enabledRunners;
|
|
3925
4117
|
/**
|
|
3926
4118
|
* The allowlist in force right now. Unset means no restriction — falling
|
|
3927
4119
|
* back to the one planning started under would keep a restriction the user
|
|
@@ -3937,6 +4129,8 @@ declare class Session {
|
|
|
3937
4129
|
* variants, not as an id-only stub. Never triggers discovery itself.
|
|
3938
4130
|
*/
|
|
3939
4131
|
private models;
|
|
4132
|
+
/** What a runner offers, as `runnerAssignment` needs it. Spawns the runner's CLI to list models. */
|
|
4133
|
+
private catalogFor;
|
|
3940
4134
|
get planState(): LegacyPlanState | null;
|
|
3941
4135
|
/**
|
|
3942
4136
|
* The live plan in the shape a saved session is read back as. The disk
|
|
@@ -4008,6 +4202,26 @@ declare class Session {
|
|
|
4008
4202
|
*/
|
|
4009
4203
|
compactConversation(signal?: AbortSignal): Promise<ConversationCompaction>;
|
|
4010
4204
|
rewindTargets(): RewindTarget[];
|
|
4205
|
+
/**
|
|
4206
|
+
* Hand the planner turn in flight a validated plan or a task edit; the turn
|
|
4207
|
+
* commits it as it would the same JSON in the planner's reply. False when
|
|
4208
|
+
* no turn is open.
|
|
4209
|
+
*/
|
|
4210
|
+
submitToTurn(submission: PlannerSubmission): boolean;
|
|
4211
|
+
/**
|
|
4212
|
+
* A plan the planner submitted through its tool, already checked against the
|
|
4213
|
+
* live catalog. Its runners join `plan.runners` here, so a runner enabled
|
|
4214
|
+
* since planning started is not snapped back by the commit (#69).
|
|
4215
|
+
*/
|
|
4216
|
+
private submitPlanFromTool;
|
|
4217
|
+
/**
|
|
4218
|
+
* A task edit the planner made through its tool. Checked against the live
|
|
4219
|
+
* catalog, then handed to the open turn, which commits it as it would the
|
|
4220
|
+
* same ops in a taskOps reply — including parking it behind a running batch,
|
|
4221
|
+
* which the envelope does before any check, so a queued edit is not checked
|
|
4222
|
+
* here either. Edits made in one reply join one batch.
|
|
4223
|
+
*/
|
|
4224
|
+
private editPlanFromTool;
|
|
4011
4225
|
/** Whether the planner conversation is live (started and not yet committed to a plan). */
|
|
4012
4226
|
get isConversationActive(): boolean;
|
|
4013
4227
|
/**
|
|
@@ -4071,12 +4285,21 @@ declare class Session {
|
|
|
4071
4285
|
private finishedWork;
|
|
4072
4286
|
approveCheckpoint(taskId: string): void;
|
|
4073
4287
|
rejectCheckpoint(taskId: string, reason?: string): void;
|
|
4288
|
+
/** Whether an answer would reach the task: it waits at a checkpoint and a runner is left to hear it. */
|
|
4289
|
+
awaitsCheckpoint(taskId: string): boolean;
|
|
4074
4290
|
/**
|
|
4075
4291
|
* A user message to a structured task (ADR-0018, M1); throws
|
|
4076
4292
|
* `TaskControlError` for one that cannot take it. A task waiting for input
|
|
4077
4293
|
* is back in progress, and saved so before any surface is told.
|
|
4078
4294
|
*/
|
|
4079
4295
|
sendTaskMessage(taskId: string, text: string): string;
|
|
4296
|
+
/**
|
|
4297
|
+
* Force send (ADR-0023, F1): interrupt the task's running turn and deliver
|
|
4298
|
+
* this message next. Throws `TaskControlError` where a plain message would,
|
|
4299
|
+
* and for a task on the terminal transport.
|
|
4300
|
+
*/
|
|
4301
|
+
forceSendTaskMessage(taskId: string, text: string): string;
|
|
4302
|
+
forceSendQueuedTaskMessage(taskId: string, id: string): boolean;
|
|
4080
4303
|
removeQueuedTaskMessage(taskId: string, id: string): boolean;
|
|
4081
4304
|
interruptTask(taskId: string): Promise<void>;
|
|
4082
4305
|
getQueuedMessages(): QueuedMessage[];
|
|
@@ -4117,14 +4340,7 @@ declare class Session {
|
|
|
4117
4340
|
*/
|
|
4118
4341
|
discardRun(): Promise<void>;
|
|
4119
4342
|
private requireSettledRun;
|
|
4120
|
-
/**
|
|
4121
|
-
* The opt-in way through a merge conflict: add an AI task, on the conflicted
|
|
4122
|
-
* task's own runner and model, that merges its branch by hand in a worktree
|
|
4123
|
-
* of its own. When that task lands, the conflicted one lands through it (see
|
|
4124
|
-
* {@link TaskOrchestrator.linkConflictResolver}). The automatic answer to a
|
|
4125
|
-
* conflict is a repair, a new attempt of the same task (ADR-0015); a task is
|
|
4126
|
-
* only ever added to the plan by this call.
|
|
4127
|
-
*/
|
|
4343
|
+
/** Add the task that merges a conflicted task's branch by hand; see {@link PlanEditor.addConflictResolver}. */
|
|
4128
4344
|
resolveConflictAsTask(taskId: string): Promise<LegacyPlanState | null>;
|
|
4129
4345
|
stopExecution(): void;
|
|
4130
4346
|
/**
|
|
@@ -4133,88 +4349,19 @@ declare class Session {
|
|
|
4133
4349
|
* broadcast — in that order, once. A store op returning false aborts
|
|
4134
4350
|
* before anything is persisted. PlanStore is the single authority for
|
|
4135
4351
|
* task state; LegacyPlanState.tasks is populated only at persist time.
|
|
4352
|
+
* Direct edits reach it through the {@link PlanEditor}, which adds the
|
|
4353
|
+
* reschedule they owe.
|
|
4136
4354
|
*/
|
|
4137
4355
|
private mutatePlan;
|
|
4138
|
-
/**
|
|
4139
|
-
* The direct-edit seam: {@link mutatePlan} plus the reschedule every
|
|
4140
|
-
* structural edit owes an armed scheduler. Nothing else wakes one after a
|
|
4141
|
-
* hand edit — the queue-drain path never runs, because a direct edit never
|
|
4142
|
-
* queues — so a task the edit just unblocked would sit ready and never
|
|
4143
|
-
* start. `tick()` no-ops while the scheduler is idle, so this costs nothing
|
|
4144
|
-
* during plain planning. The planner-driven path re-ticks in
|
|
4145
|
-
* {@link PlannerConversation} instead (`afterEdit`); it must not tick twice.
|
|
4146
|
-
*/
|
|
4147
|
-
private editPlan;
|
|
4148
|
-
/**
|
|
4149
|
-
* Patch one task's fields. A hand-set dependency list, or a type flip
|
|
4150
|
-
* between AI and MAN, are the patches that can leave a task incoherent
|
|
4151
|
-
* (unschedulable, or carrying fields that mean nothing for its new type),
|
|
4152
|
-
* so both go through the same {@link validateTaskEdit} guard the planner's
|
|
4153
|
-
* task-ops applier uses (as the 'direct' actor, which skips the lock rule)
|
|
4154
|
-
* rather than a second copy of the rules — and throws, so the surface can
|
|
4155
|
-
* say why. Gated on the task existing so an edit to an unknown id still
|
|
4156
|
-
* falls through to the no-op `store.update` below instead of throwing.
|
|
4157
|
-
*/
|
|
4356
|
+
/** Patch one task's fields, checked as the planner's task ops are; see {@link PlanEditor.updateTask}. */
|
|
4158
4357
|
updateTask(taskId: string, changes: Partial<Task>): Promise<LegacyPlanState | null>;
|
|
4159
|
-
/**
|
|
4160
|
-
* Move one task onto a different runner. Distinct from {@link updateTask}
|
|
4161
|
-
* because a runner change is never a single-field edit: the task's model,
|
|
4162
|
-
* thinking effort and mode are all scoped to its runner, so they are
|
|
4163
|
-
* re-derived from the new runner's catalog (see {@link retargetTaskRunner}).
|
|
4164
|
-
* That needs discovery, which is why it is not a branch inside `updateTask`.
|
|
4165
|
-
*
|
|
4166
|
-
* The runner is also admitted into `plan.runners` — see {@link admitRunner}.
|
|
4167
|
-
*/
|
|
4358
|
+
/** Move one task onto a different runner, re-deriving what is scoped to it; see {@link PlanEditor.setTaskRunner}. */
|
|
4168
4359
|
setTaskRunner(taskId: string, runner: RunnerId): Promise<LegacyPlanState | null>;
|
|
4169
|
-
/**
|
|
4170
|
-
private catalogFor;
|
|
4171
|
-
/**
|
|
4172
|
-
* What a *derived* assignment may draw from: the runner's catalog narrowed to
|
|
4173
|
-
* the user's allowlist. Deriving from the full catalog would hand a task the
|
|
4174
|
-
* runner's first model regardless of a restriction the user set — the next
|
|
4175
|
-
* planner turn's `coerceAssignments` would snap it back anyway, so the user
|
|
4176
|
-
* would see their pick silently change instead of never being offered.
|
|
4177
|
-
*
|
|
4178
|
-
* `catalogFor` stays unnarrowed because {@link admitRunner} caches it as what
|
|
4179
|
-
* the runner really offers, which is what effort clamping needs.
|
|
4180
|
-
*/
|
|
4181
|
-
private allowedCatalog;
|
|
4182
|
-
/**
|
|
4183
|
-
* Make a runner a first-class member of this plan. Without this, the next
|
|
4184
|
-
* planner turn's `coerceAssignments` would treat it as disallowed and snap
|
|
4185
|
-
* every task on it back, silently undoing the user's choice; and that same
|
|
4186
|
-
* pass clamps efforts against `modelsCache`, so a catalog missing from there
|
|
4187
|
-
* makes the effort we just derived read as unverifiable.
|
|
4188
|
-
*/
|
|
4189
|
-
private admitRunner;
|
|
4190
|
-
/**
|
|
4191
|
-
* Replace one task's dependency list — the named entry point the surfaces'
|
|
4192
|
-
* dependency pickers call. The guard itself lives in {@link updateTask}, so
|
|
4193
|
-
* a dependency list arriving as a plain field patch is rejected by the same
|
|
4194
|
-
* rule instead of slipping past it.
|
|
4195
|
-
*/
|
|
4360
|
+
/** Replace one task's dependency list, under the same guard as a field patch; see {@link PlanEditor.setTaskDependencies}. */
|
|
4196
4361
|
setTaskDependencies(taskId: string, dependencies: string[]): Promise<LegacyPlanState | null>;
|
|
4197
|
-
/**
|
|
4198
|
-
* Delete one task. A running task is cancelled first: the plan can drop it
|
|
4199
|
-
* either way, but nothing can reach its runner afterwards — the tmux session
|
|
4200
|
-
* outlives the plan and the orchestrator keeps counting it as active. The
|
|
4201
|
-
* planner-driven path refuses instead (see {@link applyTaskOps}); a user
|
|
4202
|
-
* deleting their own task means it.
|
|
4203
|
-
*/
|
|
4362
|
+
/** Delete one task, cancelling its runner first if it runs; see {@link PlanEditor.removeTask}. */
|
|
4204
4363
|
removeTask(taskId: string): Promise<LegacyPlanState | null>;
|
|
4205
|
-
/**
|
|
4206
|
-
* Add one task, filling in whatever the caller left unset. A task with no
|
|
4207
|
-
* runnable assignment is not a lighter task but an unspawnable one, so the
|
|
4208
|
-
* runner falls back to the plan's first and the model, effort and mode are
|
|
4209
|
-
* derived from that runner's catalog — the same derivation a runner change
|
|
4210
|
-
* uses ({@link runnerAssignment}), which is why this is async like
|
|
4211
|
-
* {@link setTaskRunner}. Anything the caller did choose survives when the
|
|
4212
|
-
* runner offers it.
|
|
4213
|
-
*
|
|
4214
|
-
* Dependencies naming tasks that don't exist are dropped rather than rejected:
|
|
4215
|
-
* the caller is a picker over the current plan, so a stale id means the plan
|
|
4216
|
-
* moved on, not that the whole task should be refused.
|
|
4217
|
-
*/
|
|
4364
|
+
/** Add one task, deriving what the caller left unset; see {@link PlanEditor.addTask}. */
|
|
4218
4365
|
addTask(draft: Partial<Task>): Promise<LegacyPlanState | null>;
|
|
4219
4366
|
/**
|
|
4220
4367
|
* Planner-driven merge: validate compatibility up front, then ask the planner
|
|
@@ -4239,6 +4386,19 @@ declare class Session {
|
|
|
4239
4386
|
get aiServiceInstance(): IAiService;
|
|
4240
4387
|
}
|
|
4241
4388
|
|
|
4389
|
+
/**
|
|
4390
|
+
* A request on the plan the session refused: a direct (non-planner) edit that
|
|
4391
|
+
* is not valid, or an isolation action on a plan with no isolated run to act
|
|
4392
|
+
* on. Distinct from a plain Error so a surface can tell "you asked for
|
|
4393
|
+
* something invalid" from "something broke" and say which — the HTTP routes
|
|
4394
|
+
* used to collapse both into 404/500, which read to the TUI and VS Code as the
|
|
4395
|
+
* edit silently doing nothing. Carries no status code: core is
|
|
4396
|
+
* transport-agnostic, the route maps it.
|
|
4397
|
+
*/
|
|
4398
|
+
declare class PlanEditError extends Error {
|
|
4399
|
+
constructor(message: string);
|
|
4400
|
+
}
|
|
4401
|
+
|
|
4242
4402
|
/**
|
|
4243
4403
|
* Where Ordewell keeps machine-global data (settings, daemon tokens, caches,
|
|
4244
4404
|
* user plugins). A single home for everything not tied to a project directory,
|
|
@@ -4263,15 +4423,28 @@ declare function writePrivateFile(filePath: string, content: string): void;
|
|
|
4263
4423
|
|
|
4264
4424
|
type VerdictListener = (taskId: string, verdict: Verdict) => void;
|
|
4265
4425
|
type CheckpointListener = (taskId: string, summary: string) => void;
|
|
4426
|
+
/** A tool-raised checkpoint whose call went away while its attempt lives on, so nothing is left to answer it. */
|
|
4427
|
+
type CheckpointWithdrawnListener = (taskId: string) => void;
|
|
4266
4428
|
/** Fires on every idleSince transition (null→timestamp on silence, timestamp→null on resume/teardown). */
|
|
4267
4429
|
type IdleListener = (taskId: string, idleSince: string | null) => void;
|
|
4268
4430
|
declare class VerdictEngine {
|
|
4269
4431
|
private markerSeen;
|
|
4432
|
+
private pendingVerdicts;
|
|
4433
|
+
private structuredSessions;
|
|
4270
4434
|
private markerTails;
|
|
4271
4435
|
private checkpointCarry;
|
|
4272
4436
|
private pausedSessions;
|
|
4273
4437
|
private listeners;
|
|
4274
4438
|
private checkpointListeners;
|
|
4439
|
+
private withdrawnListeners;
|
|
4440
|
+
/**
|
|
4441
|
+
* The open `checkpoint` tool call per task (ADR-0022, V5): settling it is how
|
|
4442
|
+
* an answer reaches a runner that asked through the tool, where the marker's
|
|
4443
|
+
* answer is typed into the session instead.
|
|
4444
|
+
*/
|
|
4445
|
+
private toolCheckpoints;
|
|
4446
|
+
/** The question a task's checkpoint asks, whole, for as long as it waits — by either route. */
|
|
4447
|
+
private checkpointQuestions;
|
|
4275
4448
|
private idleListeners;
|
|
4276
4449
|
/**
|
|
4277
4450
|
* Per-task generation. Replaced on every watch(), clear() and verdict.
|
|
@@ -4298,6 +4471,7 @@ declare class VerdictEngine {
|
|
|
4298
4471
|
private openApprovals;
|
|
4299
4472
|
onVerdict(listener: VerdictListener): void;
|
|
4300
4473
|
onCheckpoint(listener: CheckpointListener): void;
|
|
4474
|
+
onCheckpointWithdrawn(listener: CheckpointWithdrawnListener): void;
|
|
4301
4475
|
onIdleChange(listener: IdleListener): void;
|
|
4302
4476
|
/** Advisory silence timestamp for a task, or null if it isn't idle. */
|
|
4303
4477
|
getIdleSince(taskId: string): string | null;
|
|
@@ -4319,15 +4493,40 @@ declare class VerdictEngine {
|
|
|
4319
4493
|
* `\n`-terminated line, and the leading newline flushes a partial line.
|
|
4320
4494
|
*/
|
|
4321
4495
|
private resumeToken;
|
|
4496
|
+
/** What a task's waiting checkpoint asks, untruncated; undefined when none waits. */
|
|
4497
|
+
getCheckpointQuestion(taskId: string): string | undefined;
|
|
4322
4498
|
approveCheckpoint(taskId: string): void;
|
|
4323
4499
|
rejectCheckpoint(taskId: string, reason: string): void;
|
|
4324
4500
|
/**
|
|
4325
4501
|
* Attach to a spawned session: scan the output tail for the task's completion
|
|
4326
4502
|
* marker (delivering a verdict immediately while leaving interactive sessions
|
|
4327
4503
|
* open), scan for checkpoint markers, and on exit produce a failed verdict
|
|
4328
|
-
* when the marker was never observed.
|
|
4504
|
+
* when the marker was never observed. A structured session's `task_complete`
|
|
4505
|
+
* call is evidence too (ADR-0022, V2): whichever signal comes first decides.
|
|
4506
|
+
*
|
|
4507
|
+
* Returns the attempt's generation, what {@link signalComplete} is checked against.
|
|
4508
|
+
*/
|
|
4509
|
+
watch(task: Task, session: ITerminalSession): number;
|
|
4510
|
+
/**
|
|
4511
|
+
* The runner's own `task_complete` call (ADR-0022, V1/V3): settles the
|
|
4512
|
+
* attempt exactly as the marker does, unless that attempt is no longer the
|
|
4513
|
+
* task's current one or another signal already settled it.
|
|
4329
4514
|
*/
|
|
4330
|
-
|
|
4515
|
+
signalComplete(taskId: string, generation: number, report: TaskCompleteArgs): void;
|
|
4516
|
+
/** The runner was told something after its evidence so far, so only what it reports from here counts. */
|
|
4517
|
+
private supersede;
|
|
4518
|
+
private acceptVerdict;
|
|
4519
|
+
private publishVerdict;
|
|
4520
|
+
/**
|
|
4521
|
+
* The runner's `checkpoint` call (ADR-0022, V5): raised through the same
|
|
4522
|
+
* listeners as the marker, so the task waits on the user the same way, and
|
|
4523
|
+
* settled by {@link approveCheckpoint} or {@link rejectCheckpoint}. It is
|
|
4524
|
+
* withdrawn, never left hanging, once the attempt is over or the call goes.
|
|
4525
|
+
*/
|
|
4526
|
+
raiseCheckpoint(taskId: string, generation: number, question: string, signal: AbortSignal): Promise<CheckpointAnswer>;
|
|
4527
|
+
/** The open `checkpoint` call can no longer be answered: refuse it, and let the task out of the wait. */
|
|
4528
|
+
private callWentAway;
|
|
4529
|
+
private withdrawToolCheckpoint;
|
|
4331
4530
|
private approvalOpened;
|
|
4332
4531
|
private approvalClosed;
|
|
4333
4532
|
/** Scan only the new text plus the unmatched carry, so a long run stays linear. */
|
|
@@ -4478,6 +4677,8 @@ declare function buildSubagentSystemPrompt(): string;
|
|
|
4478
4677
|
interface ConversationVariant {
|
|
4479
4678
|
/** Harness planner (ADR-0009): the agent owns its own tools and research budget. */
|
|
4480
4679
|
harness?: boolean;
|
|
4680
|
+
/** The planner reads the catalog and submits the plan through Ordewell's MCP tools (ADR-0022), not the JSON envelope. */
|
|
4681
|
+
plannerTools?: boolean;
|
|
4481
4682
|
/** Every AI task gets its own worktree (ADR-0013), so file overlap no longer forces an order; of every repo of a group (ADR-0014). */
|
|
4482
4683
|
isolatedExecution?: IsolatedExecution;
|
|
4483
4684
|
}
|
|
@@ -4497,13 +4698,13 @@ declare function buildModifyDuringExecutionPrompt(executionLog: TaskSnapshot[],
|
|
|
4497
4698
|
* task-ops protocol (with the "merge" op) is injected alongside it by
|
|
4498
4699
|
* `planContextBlock`. The model emits a single taskOps merge op.
|
|
4499
4700
|
*/
|
|
4500
|
-
declare function buildMergePrompt(taskIds: string[], tasks: readonly Task[]): string;
|
|
4701
|
+
declare function buildMergePrompt(taskIds: string[], tasks: readonly Task[], tools?: boolean): string;
|
|
4501
4702
|
/**
|
|
4502
4703
|
* User-message prompt for a planner-driven split: asks the model to decompose
|
|
4503
4704
|
* one task into a sequence of smaller tasks. The model decides the breakdown —
|
|
4504
4705
|
* the user does not hand-type the parts.
|
|
4505
4706
|
*/
|
|
4506
|
-
declare function buildSplitPrompt(taskId: string, tasks: readonly Task[]): string;
|
|
4707
|
+
declare function buildSplitPrompt(taskId: string, tasks: readonly Task[], tools?: boolean): string;
|
|
4507
4708
|
/**
|
|
4508
4709
|
* Runner prompt for the opt-in task that resolves an integration conflict
|
|
4509
4710
|
* (ADR-0013). The resolver's own worktree starts at the integration tip, so the
|
|
@@ -4682,6 +4883,18 @@ declare function summarizeOutput(reviewReason: string | undefined, output: strin
|
|
|
4682
4883
|
capturedAt: string;
|
|
4683
4884
|
};
|
|
4684
4885
|
declare function collectDirectDependencyOutputs(task: Task, allTasks: readonly Task[]): PriorOutput[];
|
|
4886
|
+
/**
|
|
4887
|
+
* Break marker tokens carried in a predecessor's captured output. Interactive
|
|
4888
|
+
* runners echo the prompt they are given, and the watcher scans that terminal
|
|
4889
|
+
* output — a quoted marker would settle this task on the previous one's
|
|
4890
|
+
* evidence. Hyphenated rather than spaced: the scanner also reads a
|
|
4891
|
+
* whitespace-flattened view of the terminal, which would rejoin a space.
|
|
4892
|
+
*
|
|
4893
|
+
* A completion marker also loses its id: transcripts are bound to a task by
|
|
4894
|
+
* that id, and a dependent's transcript quoting it would answer for the
|
|
4895
|
+
* predecessor the next time the predecessor runs.
|
|
4896
|
+
*/
|
|
4897
|
+
declare function defuseMarkers(text: string): string;
|
|
4685
4898
|
declare function renderPriorOutputs(outputs: PriorOutput[]): string;
|
|
4686
4899
|
declare function augmentPromptWithPriorOutputs(task: Task, allTasks: readonly Task[]): string;
|
|
4687
4900
|
/**
|
|
@@ -4699,6 +4912,8 @@ interface ComposeOptions {
|
|
|
4699
4912
|
tddEnabled?: boolean;
|
|
4700
4913
|
/** An ops task's last attempt, as its output ended (ADR-0020); absent on a first attempt. */
|
|
4701
4914
|
previousAttempt?: string;
|
|
4915
|
+
/** The runner is given the `task_complete` and `checkpoint` tools (ADR-0022); the markers stay as their fallback. */
|
|
4916
|
+
completionTool?: boolean;
|
|
4702
4917
|
}
|
|
4703
4918
|
declare function composeAugmentedPrompt(task: Task, allTasks: readonly Task[], opts?: ComposeOptions): string;
|
|
4704
4919
|
/**
|
|
@@ -4709,6 +4924,7 @@ declare function composeAugmentedPrompt(task: Task, allTasks: readonly Task[], o
|
|
|
4709
4924
|
*/
|
|
4710
4925
|
declare function composeContinuationPrompt(task: Task, message: string, opts?: {
|
|
4711
4926
|
ops?: boolean;
|
|
4927
|
+
completionTool?: boolean;
|
|
4712
4928
|
}): string;
|
|
4713
4929
|
|
|
4714
4930
|
type ExecFileFn = (command: string, args: string[]) => Promise<{
|
|
@@ -4853,6 +5069,8 @@ interface StructuredRunnerDeps {
|
|
|
4853
5069
|
/** Overrides adapter construction; production picks by runner id and refuses runners without a connector. */
|
|
4854
5070
|
createAdapter?: (runner: string, deps: AgentProcessDeps) => TaskModeAgentAdapter;
|
|
4855
5071
|
interruptGraceMs?: number;
|
|
5072
|
+
/** Serves the task tools of the runners that take them (ADR-0022). Defaults to the process's one server. */
|
|
5073
|
+
mcp?: OrdewellMcpServer;
|
|
4856
5074
|
}
|
|
4857
5075
|
interface SessionLaunch {
|
|
4858
5076
|
runner: string;
|
|
@@ -4860,14 +5078,20 @@ interface SessionLaunch {
|
|
|
4860
5078
|
createAdapter: (runner: string, deps: AgentProcessDeps) => TaskModeAgentAdapter;
|
|
4861
5079
|
startOptions: TaskStartOptions;
|
|
4862
5080
|
interruptGraceMs: number;
|
|
5081
|
+
/** Where this attempt's task tools are served, when its runner takes them (ADR-0022). */
|
|
5082
|
+
tools?: {
|
|
5083
|
+
server: OrdewellMcpServer;
|
|
5084
|
+
scope: TaskTokenScope;
|
|
5085
|
+
};
|
|
4863
5086
|
}
|
|
4864
5087
|
/**
|
|
4865
5088
|
* One task driven over its runner's programmatic protocol (ADR-0018). It *is*
|
|
4866
5089
|
* an `ITerminalSession`, so everything downstream of `onOutput` is unchanged;
|
|
4867
5090
|
* what a terminal cannot do sits on {@link StructuredSessionCapability}.
|
|
4868
5091
|
*
|
|
4869
|
-
* Ordewell owns the message queue (M1)
|
|
4870
|
-
*
|
|
5092
|
+
* Ordewell owns the message queue (M1). A message sent mid-turn is handed to a
|
|
5093
|
+
* runner that can take one at its next step (ADR-0023); otherwise it waits for
|
|
5094
|
+
* the turn to end rather than being typed into a runner that is busy.
|
|
4871
5095
|
*/
|
|
4872
5096
|
declare class StructuredSession extends AbstractTerminalSession implements StructuredSessionCapability {
|
|
4873
5097
|
private readonly launch;
|
|
@@ -4893,17 +5117,54 @@ declare class StructuredSession extends AbstractTerminalSession implements Struc
|
|
|
4893
5117
|
* requests — while an approval must be answerable by id across the session.
|
|
4894
5118
|
*/
|
|
4895
5119
|
private readonly permissions;
|
|
5120
|
+
/** The launch's start options, with this attempt's server once its token is issued. */
|
|
5121
|
+
private startOptions;
|
|
5122
|
+
/** This attempt's MCP token, until the session ends (ADR-0022, A2). */
|
|
5123
|
+
private toolToken;
|
|
5124
|
+
private checkpointHandler;
|
|
4896
5125
|
constructor(id: string, taskId: string, launch: SessionLaunch);
|
|
4897
5126
|
/** Start the runner and send the task's prompt as its first turn. */
|
|
4898
5127
|
start(prompt: string): Promise<void>;
|
|
4899
5128
|
getOutput(): string;
|
|
4900
|
-
|
|
5129
|
+
onTaskComplete(listener: (report: TaskCompleteArgs) => void): void;
|
|
5130
|
+
onToolCheckpoint(handler: (question: string, signal: AbortSignal) => Promise<CheckpointAnswer>): void;
|
|
5131
|
+
/**
|
|
5132
|
+
* A server that cannot start costs the task its tools, not its run: the
|
|
5133
|
+
* prompt still teaches the marker (ADR-0022, S2).
|
|
5134
|
+
*/
|
|
5135
|
+
private issueTools;
|
|
5136
|
+
private revokeTools;
|
|
5137
|
+
protected baseHandleExit(code: number): void;
|
|
5138
|
+
/**
|
|
5139
|
+
* A reply typed at the task — a checkpoint answer, most often — is a user
|
|
5140
|
+
* message like any other: into the running turn where the runner takes one,
|
|
5141
|
+
* else the next turn. A runner that stopped to ask reads it at once either way.
|
|
5142
|
+
*/
|
|
4901
5143
|
write(text: string): void;
|
|
4902
5144
|
kill(): void;
|
|
4903
5145
|
turnState(): 'working' | 'idle';
|
|
4904
5146
|
onTurnEnd(listener: (reason: StructuredTurnEnd) => void): void;
|
|
4905
5147
|
onEvent(listener: (event: StructuredEvent) => void): void;
|
|
4906
5148
|
sendMessage(text: string): string;
|
|
5149
|
+
/**
|
|
5150
|
+
* Force send (ADR-0023, F1–F3): interrupt the running turn — and the tool
|
|
5151
|
+
* call in flight — then deliver this message as the turn that replaces it,
|
|
5152
|
+
* ahead of everything still queued. With no turn to interrupt it is a plain
|
|
5153
|
+
* {@link sendMessage}.
|
|
5154
|
+
*/
|
|
5155
|
+
forceSend(text: string): string;
|
|
5156
|
+
/** Force send a message still waiting in the queue. False once the runner has it, or it is gone. */
|
|
5157
|
+
forceSendQueued(id: string): boolean;
|
|
5158
|
+
/**
|
|
5159
|
+
* Behind earlier forced messages and ahead of the rest, handed-over ones
|
|
5160
|
+
* included: what the runner already has is the runner's to order (F2). Held
|
|
5161
|
+
* back from steering while the interrupt runs, it opens the next turn — and
|
|
5162
|
+
* a queue that is not empty when the turn ends is what keeps the task out of
|
|
5163
|
+
* "waiting for input" between the two (F3).
|
|
5164
|
+
*/
|
|
5165
|
+
private force;
|
|
5166
|
+
private runningTurn;
|
|
5167
|
+
/** No runner can recall a message once offered to it, so only a queued one comes back. */
|
|
4907
5168
|
removeQueued(id: string): boolean;
|
|
4908
5169
|
queued(): QueuedTaskMessage[];
|
|
4909
5170
|
nativeSessionId(): string | null;
|
|
@@ -4921,6 +5182,16 @@ declare class StructuredSession extends AbstractTerminalSession implements Struc
|
|
|
4921
5182
|
private startAdapter;
|
|
4922
5183
|
private openTurn;
|
|
4923
5184
|
private deliver;
|
|
5185
|
+
/**
|
|
5186
|
+
* Offer the oldest queued message to the running turn (ADR-0023, D2), one at
|
|
5187
|
+
* a time so the runner takes them in the order they were sent. A refusal
|
|
5188
|
+
* leaves it, and everything behind it, for the turn's end.
|
|
5189
|
+
*/
|
|
5190
|
+
private offerNext;
|
|
5191
|
+
private steered;
|
|
5192
|
+
private delivered;
|
|
5193
|
+
/** Back to waiting in Ordewell's queue, removable again; the log hears of it only if it had shown as handed over. */
|
|
5194
|
+
private requeue;
|
|
4924
5195
|
private route;
|
|
4925
5196
|
/**
|
|
4926
5197
|
* The runner spoke with no message of ours in flight. When it is working — a
|
|
@@ -4935,9 +5206,17 @@ declare class StructuredSession extends AbstractTerminalSession implements Struc
|
|
|
4935
5206
|
/**
|
|
4936
5207
|
* A queued message goes out as the turn closes, and the state never passes
|
|
4937
5208
|
* through `idle` on the way, so a listener told the turn ended can already
|
|
4938
|
-
* see the task is not waiting.
|
|
5209
|
+
* see the task is not waiting. Nor does a message the runner owes, or one
|
|
5210
|
+
* still being offered: the runner is about to read it, or Ordewell to send
|
|
5211
|
+
* it (ADR-0023, D5).
|
|
4939
5212
|
*/
|
|
4940
5213
|
private endTurn;
|
|
5214
|
+
/**
|
|
5215
|
+
* Between turns the oldest message opens the next one — but only once it is
|
|
5216
|
+
* back in Ordewell's hands: while it is on offer or owed, nothing overtakes it.
|
|
5217
|
+
*/
|
|
5218
|
+
private deliverNext;
|
|
5219
|
+
private undeliverQueued;
|
|
4941
5220
|
private emitEvent;
|
|
4942
5221
|
}
|
|
4943
5222
|
/**
|
|
@@ -4951,6 +5230,7 @@ declare class StructuredRunner extends AbstractRunner<StructuredSession> {
|
|
|
4951
5230
|
private readonly processDeps;
|
|
4952
5231
|
private readonly createAdapter;
|
|
4953
5232
|
private readonly interruptGraceMs;
|
|
5233
|
+
private readonly mcp;
|
|
4954
5234
|
constructor(deps?: StructuredRunnerDeps);
|
|
4955
5235
|
spawn(opts: RunnerSpawnOptions): Promise<ITerminalSession>;
|
|
4956
5236
|
}
|
|
@@ -5445,4 +5725,4 @@ declare const DEFAULT_MAX_PARALLEL = 3;
|
|
|
5445
5725
|
*/
|
|
5446
5726
|
declare function parseMaxParallel(value: unknown): number | null;
|
|
5447
5727
|
|
|
5448
|
-
export { ALLOWED_PLUGIN_HOSTS, ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type Adr0013IsolationRun, type Adr0013PlanIsolation, type Adr0013TaskRecord, AgentAdapter, AgentEvent, AgentProcessDeps, AgentStartOptions, AiProvider, ApplyTaskOpsResult, ApprovalAnswer, ApprovalDecision, ApprovalMode, ApprovalPolicy, ApprovalRequest, type AskOptions, AwaitingReason, BUILTIN_SKILL_NAMES, BaseAiService, BaseConfig, BaseFileSystem, BufferedTaskOutputSource, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CORE_PLANNER_PROMPT, type CappedRows, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, type CommandTier, type ComposeOptions, ConsoleLogger, ContextCollector, type Continuability, ConversationBusyError, type ConversationCompaction, ConversationEditError, type ConversationFork, ConversationMessage, type ConversationRequest, type ConversationRewind, type ConversationTurn, type ConversationVariant, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DEFAULT_MAX_PARALLEL, DiscoveredModel, type EnvAdmission, EnvConfig, type ExecFileFn, type ExecImpl, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GREP_PCRE_PROBE_ARGS, GeminiService, type GitExecFn, GlobOptions, type GrepInvocation, GrepOptions, type GrepRegex, type HasBinFn, HomeTranscriptReader, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, IWorktreeIsolation, IsolationHandoff, IsolationLandedTask, IsolationMergeResult, IsolationOutcome, IsolationRun, IsolationTaskRecord, IsolationTaskStatus, IsolationView, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, LegacyPlanState, type LiveOutputLookup, type LiveTail, type LiveTailOptions, type MappedTool, MergeGateView, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OUTPUT_LINES_DEFAULT, OUTPUT_LINES_MAX, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, PLUGIN_NAME_PATTERN, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanEditError, PlanIsolation, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerModelCandidate, type PlannerModelChoice, PlannerModelMemory, type PlannerModelRecall, type PlannerModelStore, type PlannerReplyClassification, type PlannerRuntimeToggles, PlannerUsage, type PluginSource, type PrdBlock, type PriorOutput, type ProbeFn, ProviderModelLists, type ProviderRegistration, QueuedMessage, QueuedTaskMessage, REFUSED_COMMANDS, ReadFileOpts, RepairEvidence, type RepairLoopOpts, type RepairVerdict, RepoGroupLayout, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchToolType, type ResearchTurn, ResolveContext, type RewindTarget, RunnerApprovals, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, RunnerSpawnOptions, RunnerTransport, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STOPPED_TOOL_RESULT, SYMBOL_LANGUAGES, type SaveSession, Session, SessionBroadcaster, type SessionData, type SessionDeps, SessionMessage, type SessionMeta, SessionNotice, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SkillInfo, type SkillMetadata, SkillsService, type SpawnSpec, StdioAgentAdapter, StructuredEvent, StructuredRunner, type StructuredRunnerDeps, StructuredSession, StructuredSessionCapability, StructuredTurnEnd, TASK_QUERY_ANSWER_MAX_CHARS, TASK_QUERY_ANSWER_OR_OPS, TASK_QUERY_FIELDS, TASK_QUERY_PROTOCOL, TASK_QUERY_REMINDER, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, type TaskAttemptSnapshot, TaskControlError, TaskIsolation, TaskLogEvent, type TaskLogFile, type TaskLogLocation, TaskLogRecorder, type TaskLogRecorderDeps, TaskModeAgentAdapter, TaskOp, TaskOrchestrator, type TaskOrchestratorDeps, type TaskOrchestratorOptions, type TaskOutputAttempt, type TaskOutputSource, type TaskQuery, type TaskQueryCatalog, type TaskQueryField, TaskRunnerFlags, TaskSnapshot, TaskStartOptions, TmuxRunner, type TmuxRunnerDeps, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, type TranscriptQuery, type TranscriptReader, type TransportRoute, TransportRouter, TreeSnapshot, UsageRecord, type UserSettings, Verdict, VerdictEngine, type VerdictListener, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, type WorktreeIsolationDeps, admitSettingsEnv, applyHeadLimit, assertInstallablePluginUrl, assertPlainPluginName, assertWorkspaceExists, assertWorkspaceIsProject, augmentPromptWithPriorOutputs, augmentedPath, bearerHeaderValue, buildConflictRepairPrompt, buildConflictResolutionPrompt, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildSplitPrompt, buildSubagentSystemPrompt, canContinue, clampThinkingEffort, classifyCommand, classifyPlannerReply, classifyPluginSource, clearAugmentedPathCache, clearDaemonToken, clearResearchShellCache, clearState, clipboardCopyCommand, coerceAssignments, collectDirectDependencyOutputs, composeAugmentedPrompt, composeContinuationPrompt, configuredProviders, continuability, createAiService, createSession, createSkillsService, createTaskAdapter, createTaskOrchestrator, createWorktreeIsolation, daemonTokenPath, defaultLogger, definitionPattern, deleteSession, describeMergeResult, discoverGeminiModels, effectiveAllowlist, ensureDir, ensurePrivateDir, ensureStateDirIgnored, executionLogBlock, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, globalDataDir, grantScopeFor, grepRegexFromProbe, hasTmux, idSegment, includeGlobFor, isCliProvider, isOpenAiProvider, isPlainPluginName, isValidManifest, killTree, languageForId, listSessions, listTaskLogAttempts, loadSession, loadSessionPlanState, loadState, mapAgentTool, migrateOldConfigDir, migratePlanIsolation, mintDaemonToken, mintSessionId, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, openTaskLog, parseMaxParallel, parseTaskQueryJson, pendingEditRulesBlock, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, reEmitTaskQueryPrompt, readDaemonToken, readTaskLog, referencePattern, renderPlanMap, renderPriorOutputs, renderTaskQueryAnswer, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolvePluginInstallDir, resolveProviderFromPrefix, resolveResearchShell, resolveSkillInvocation, resolveTaskRunnerFlags, resolveWithin, retargetTaskRunner, routeTransport, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, sessionDataDir, sessionRuntimeSettings, stateExists, stripModelPrefix, summarizeOutput, supportsTaskMode, taskOpsRejectedPrompt, taskQuerySignature, textHasTaskQuery, tmuxSessionName, tmuxSocketName, tmuxWindowName, tokenSubprotocols, tokensMatch, truncatedPlanReEmitPrompt, wellKnownBinDirs, withPath, writePrivateFile };
|
|
5728
|
+
export { ALLOWED_PLUGIN_HOSTS, ALL_PROVIDERS, AUTO_COMMANDS, AbstractRunner, AbstractTerminalSession, ActiveTaskSession, type Adr0013IsolationRun, type Adr0013PlanIsolation, type Adr0013TaskRecord, AgentAdapter, AgentEvent, AgentProcessDeps, AgentStartOptions, AiProvider, ApplyTaskOpsResult, ApprovalAnswer, ApprovalDecision, ApprovalMode, ApprovalPolicy, ApprovalRequest, type AskOptions, AwaitingReason, BUILTIN_SKILL_NAMES, BaseAiService, BaseConfig, BaseFileSystem, BufferedTaskOutputSource, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CORE_PLANNER_PROMPT, type CappedRows, CheckpointAnswer, type CheckpointListener, ClaudeCodeAdapter, CliAgentAiService, type CliAgentAiServiceDeps, CodexAdapter, type CommandClassification, type CommandTier, type ComposeOptions, ConsoleLogger, ContextCollector, type Continuability, ConversationBusyError, type ConversationCompaction, ConversationEditError, type ConversationFork, ConversationMessage, type ConversationRequest, type ConversationRewind, type ConversationTurn, type ConversationVariant, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DEFAULT_MAX_PARALLEL, DiscoveredModel, type EnvAdmission, EnvConfig, type ExecFileFn, type ExecImpl, FindSymbolOptions, FsPluginStore, GIT_READONLY_SUBCOMMANDS, GREP_PCRE_PROBE_ARGS, GeminiService, type GitExecFn, GlobOptions, type GrepInvocation, GrepOptions, type GrepRegex, type HasBinFn, HomeTranscriptReader, type IAiService, IApproval, IConfig, IFileSystem, type ILogger, type INotification, IPluginStore, ITerminalRunner, ITerminalSession, IWorktreeIsolation, IsolationHandoff, IsolationLandedTask, IsolationMergeResult, IsolationOutcome, IsolationRun, IsolationTaskRecord, IsolationTaskStatus, IsolationView, JSON_REPAIR_INSTRUCTION, type KillTreeDeps, LegacyPlanState, type LiveOutputLookup, type LiveTail, type LiveTailOptions, type MappedTool, MergeGateView, ModelResolver, type ModelResolverDeps, type ModifyPlanRequest, type NotificationAction, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OUTPUT_LINES_DEFAULT, OUTPUT_LINES_MAX, OpenAiService, OpenCodeAdapter, type OrchestratorObserver, OrchestratorOption, OrdewellMcpServer, PLUGIN_NAME_PATTERN, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type PendingApproval, PendingApprovals, type PendingApprovalsOptions, PlanEditError, PlanIsolation, PlanParseError, type PlanRequest, PlanState, PlanStatus, PlanStore, Planner, type PlannerModelCandidate, type PlannerModelChoice, PlannerModelMemory, type PlannerModelRecall, type PlannerModelStore, type PlannerReplyClassification, type PlannerRuntimeToggles, type PlannerSubmission, PlannerToolHandler, PlannerUsage, type PluginSource, type PrdBlock, type PriorOutput, type ProbeFn, ProviderModelLists, type ProviderRegistration, QueuedMessage, QueuedTaskMessage, REFUSED_COMMANDS, ReadFileOpts, RepairEvidence, type RepairLoopOpts, type RepairVerdict, RepoGroupLayout, type ResearchChat, ResearchLogEntry, ResearchProgress, type ResearchShell, type ResearchShellDeps, ResearchToolType, type ResearchTurn, ResolveContext, type RewindTarget, RunnerApprovals, type RunnerCatalog, RunnerId, RunnerInstallation, RunnerInvocation, type RunnerMode, RunnerModeInfo, RunnerPluginManifest, RunnerRegistry, RunnerSpawnOptions, RunnerTransport, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STOPPED_TOOL_RESULT, SYMBOL_LANGUAGES, type SaveSession, Session, SessionBroadcaster, type SessionData, type SessionDeps, SessionMessage, type SessionMeta, SessionNotice, type SessionPlanner, type SessionRuntimeSettings, SettingsService, type ShellDialect, type SkillInfo, type SkillMetadata, SkillsService, type SpawnSpec, StdioAgentAdapter, StructuredEvent, StructuredRunner, type StructuredRunnerDeps, StructuredSession, StructuredSessionCapability, StructuredTurnEnd, TASK_QUERY_ANSWER_MAX_CHARS, TASK_QUERY_ANSWER_OR_OPS, TASK_QUERY_FIELDS, TASK_QUERY_PROTOCOL, TASK_QUERY_REMINDER, TRUNCATED_PLAN_REPAIR_INSTRUCTION, Task, type TaskAttemptSnapshot, TaskCompleteArgs, TaskControlError, TaskIsolation, TaskLogEvent, type TaskLogFile, type TaskLogLocation, TaskLogRecorder, type TaskLogRecorderDeps, TaskModeAgentAdapter, TaskOp, TaskOrchestrator, type TaskOrchestratorDeps, type TaskOrchestratorOptions, type TaskOutputAttempt, type TaskOutputSource, type TaskQuery, type TaskQueryCatalog, type TaskQueryField, TaskRunnerFlags, TaskSnapshot, TaskStartOptions, TaskTokenScope, TmuxRunner, type TmuxRunnerDeps, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, type TranscriptQuery, type TranscriptReader, type TransportRoute, TransportRouter, TreeSnapshot, UsageRecord, type UserSettings, Verdict, VerdictEngine, type VerdictListener, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, type WorktreeIsolationDeps, admitSettingsEnv, applyHeadLimit, assertInstallablePluginUrl, assertPlainPluginName, assertWorkspaceExists, assertWorkspaceIsProject, augmentPromptWithPriorOutputs, augmentedPath, bearerHeaderValue, buildConflictRepairPrompt, buildConflictResolutionPrompt, buildConversationSystemPrompt, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, buildMergePrompt, buildModifyDuringExecutionPrompt, buildModifyPlanPrompt, buildPlanWithResults, buildResearchPrompt, buildResearchToolsPrompt, buildRunnerInvocation, buildSplitPrompt, buildSubagentSystemPrompt, canContinue, clampThinkingEffort, classifyCommand, classifyPlannerReply, classifyPluginSource, clearAugmentedPathCache, clearDaemonToken, clearResearchShellCache, clearState, clipboardCopyCommand, coerceAssignments, collectDirectDependencyOutputs, composeAugmentedPrompt, composeContinuationPrompt, configuredProviders, continuability, createAiService, createSession, createSkillsService, createTaskAdapter, createTaskOrchestrator, createWorktreeIsolation, daemonTokenPath, defaultLogger, definitionPattern, defuseMarkers, deleteSession, describeMergeResult, discoverGeminiModels, effectiveAllowlist, ensureDir, ensurePrivateDir, ensureStateDirIgnored, executionLogBlock, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, filterModelsForPrompt, formatSearchOutput, generatePlanWithRepair, getLatestSession, getProviderMeta, getSettingsPath, getStateDir, globalDataDir, grantScopeFor, grepRegexFromProbe, hasTmux, idSegment, includeGlobFor, isCliProvider, isOpenAiProvider, isPlainPluginName, isValidManifest, killTree, languageForId, listSessions, listTaskLogAttempts, loadSession, loadSessionPlanState, loadState, mapAgentTool, migrateOldConfigDir, migratePlanIsolation, mintDaemonToken, mintSessionId, modelContextBlock, modifyValidationFeedback, normalizeAgentArgs, normalizeGeminiModel, openTaskLog, parseMaxParallel, parseTaskQueryJson, pendingEditRulesBlock, prefixModelId, providerForRunner, reEmitPlanPrompt, reEmitTaskOpsPrompt, reEmitTaskQueryPrompt, readDaemonToken, readTaskLog, referencePattern, renderPlanMap, renderPriorOutputs, renderTaskQueryAnswer, repairLoop, researchShellWarning, researchToolsPath, resolveArgs, resolvePluginInstallDir, resolveProviderFromPrefix, resolveResearchShell, resolveSkillInvocation, resolveTaskRunnerFlags, resolveWithin, retargetTaskRunner, routeTransport, runnerAssignment, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, sessionDataDir, sessionRuntimeSettings, stateExists, stripModelPrefix, summarizeOutput, supportsTaskMode, taskOpsRejectedPrompt, taskQuerySignature, textHasTaskQuery, tmuxSessionName, tmuxSocketName, tmuxWindowName, tokenSubprotocols, tokensMatch, truncatedPlanReEmitPrompt, wellKnownBinDirs, withPath, writePrivateFile };
|