@ordewell/core 0.10.8 → 0.10.10

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.
Files changed (40) hide show
  1. package/dist/{IFileSystem-C4_mpfze.d.ts → IFileSystem-1PqRCjhu.d.mts} +23 -3
  2. package/dist/{IFileSystem-DUgeWWQN.d.mts → IFileSystem-lTRL_G9Z.d.ts} +23 -3
  3. package/dist/{ModeResolver-4qNjxcDs.d.mts → ModeResolver-6TQXVsde.d.mts} +1 -1
  4. package/dist/{ModeResolver-DGK2rWHE.d.ts → ModeResolver-CoJAJD-f.d.ts} +1 -1
  5. package/dist/{Task-C0o4i3Nn.d.mts → Task-CfBM0wkV.d.mts} +100 -24
  6. package/dist/{Task-C0o4i3Nn.d.ts → Task-CfBM0wkV.d.ts} +100 -24
  7. package/dist/{chunk-H7QX32BH.mjs → chunk-24EL4Z2W.mjs} +2 -2
  8. package/dist/{chunk-DMG4ISUG.mjs → chunk-ESKK5I4F.mjs} +145 -21
  9. package/dist/chunk-ESKK5I4F.mjs.map +1 -0
  10. package/dist/{chunk-LTHKFBKM.mjs → chunk-KWS3VEER.mjs} +3 -3
  11. package/dist/{chunk-EEE2GBLG.mjs → chunk-PFH7WFIB.mjs} +1 -1
  12. package/dist/chunk-PFH7WFIB.mjs.map +1 -0
  13. package/dist/index.d.mts +145 -20
  14. package/dist/index.d.ts +145 -20
  15. package/dist/index.js +668 -112
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.mjs +537 -96
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/parsing.d.mts +2 -2
  20. package/dist/parsing.d.ts +2 -2
  21. package/dist/parsing.js.map +1 -1
  22. package/dist/parsing.mjs +3 -3
  23. package/dist/plan-utils.d.mts +4 -4
  24. package/dist/plan-utils.d.ts +4 -4
  25. package/dist/plan-utils.js +144 -18
  26. package/dist/plan-utils.js.map +1 -1
  27. package/dist/plan-utils.mjs +22 -4
  28. package/dist/{runSettingsText-BgOmLxdw.d.mts → runSettingsText-C1i9wBG1.d.mts} +61 -21
  29. package/dist/{runSettingsText-BgXvajj2.d.ts → runSettingsText-CWNrmF5U.d.ts} +61 -21
  30. package/dist/testing.d.mts +7 -2
  31. package/dist/testing.d.ts +7 -2
  32. package/dist/testing.js +11 -0
  33. package/dist/testing.js.map +1 -1
  34. package/dist/testing.mjs +12 -1
  35. package/dist/testing.mjs.map +1 -1
  36. package/package.json +1 -1
  37. package/dist/chunk-DMG4ISUG.mjs.map +0 -1
  38. package/dist/chunk-EEE2GBLG.mjs.map +0 -1
  39. /package/dist/{chunk-H7QX32BH.mjs.map → chunk-24EL4Z2W.mjs.map} +0 -0
  40. /package/dist/{chunk-LTHKFBKM.mjs.map → chunk-KWS3VEER.mjs.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { r as IsolationMergeResult, ai as Task, E as ExecutionActor, f as ExecutionRecord, g as GuardTrip, ah as SupervisorLevel, e as ExecutionCommandName, G as GuardTarget, n as IsolationLandedTask, I as IWorktreeIsolation, F as IsolationTaskStatus, J as PlanIsolation, a4 as RunnerId, $ as ResearchProgress, av as UsageRecord, _ as ResearchLogEntry, d as DiscoveredModel, L as LegacyPlanState, a5 as RunnerSessionCost, a2 as ResearchToolType, R as PlannerUsage, ap as TaskSkillSnapshot, af as SkillsService, aq as TaskSnapshot, K as PlanState, H as IsolationView, ax as Verdict } from './Task-C0o4i3Nn.js';
2
- export { A as ApprovalRecord, a as AttemptUsage, b as AwaitingReason, B as BUILTIN_SKILL_NAMES, C as ConversationMessage, D as DEFAULT_RUNNERS, c as DEFAULT_SUPERVISOR_RETRY_LIMIT, h as IntegrationDisposal, i as InvalidSkill, j as IsolationAvailability, k as IsolationHandoff, l as IsolationHandoffRepo, m as IsolationInactiveReason, o as IsolationLanding, p as IsolationMergeBlock, q as IsolationMergeBlockReason, s as IsolationOutcome, t as IsolationPruneResult, u as IsolationRemoval, v as IsolationRepo, w as IsolationRun, x as IsolationTaskRecord, y as IsolationTaskRef, z as IsolationTaskRepo, M as ModelUsage, N as PlanStatus, O as PlanUsage, Q as PlannerResendState, S as PrepareIntent, T as PreparedTask, U as PreservedWork, V as PreviousWork, W as RefusedRemoval, X as RepairEvidence, Y as ReplyRun, Z as RepoGroupLayout, a0 as ResearchStep, a1 as ResearchStepOutcome, a3 as RunSettings, a6 as SetupFailure, a7 as ShadowedSkill, a8 as SkillAppliesTo, a9 as SkillCatalog, aa as SkillInfo, ab as SkillLoad, ac as SkillLoadNotice, ad as SkillMetadata, ae as SkillSource, al as TaskIsolation, am as TaskIsolationState, an as TaskModelAssignment, ar as TaskStatus, as as TaskUsageSummary, at as TreeSnapshot, au as UsageLine, aw as UsageTotals, ay as VerificationCheck, az as addAttemptUsage, aA as addModelUsage, aB as addPlannerUsage, aC as addUsage, aD as addUsageTotals, aE as countedSessionCost, aF as createEmptyPlan, aG as createSkillsService, aH as createTask, aI as endAttemptUsage, aJ as flattenTasks, aK as flattenTasksWithParents, aL as isAwaitingReason, aM as isMeasured, aN as isSupervisorLevel, aO as isUserMessage, aP as migratePlanState, aQ as partedPromptUsage, aR as pausedOnLimit, aS as planUsage, aT as plannerContextFill, aU as rejoinPlanTree, aV as resumedSessionWindow, aW as startAttemptUsage, aX as taskUsageSummary, aY as usageLine, aZ as waitsForApproval } from './Task-C0o4i3Nn.js';
3
- import { bv as StartAdmission, bw as StartWait, aY as ResolveAll, a8 as IWebFetcher, cp as WebReadPolicy, cn as WebRead, co as WebReadDecision, aw as PendingApprovals, K as ConversationTurn, aL as PlannerModes, a6 as IAiService, I as ConversationRequest, n as AssignmentWriter, m as AssignmentScope, c1 as TaskQueryCatalog, k as AssignmentCatalog, b7 as RunnerCatalog, bl as SessionMessage, bh as SessionBroadcaster, bn as SessionNotice, aC as PlanStore, bX as TaskOrchestrator, ab as IsolationRunController, at as OrchestratorObserver, bQ as TaskLogEvent, a7 as INotification, a2 as GlobalRunSettings, aF as PlannerConversationHost, aE as PlannerConversation, av as PendingApproval, E as ConversationCompaction, a_ as RewindTarget, b6 as RunView, b1 as RunMergeView, b_ as TaskOutputSource, cl as UserSettings, ae as LiveTailOptions, ad as LiveTail, bm as SessionMeta, aK as PlannerModelStore, aJ as PlannerModelRecall, aG as PlannerModelCandidate } from './runSettingsText-BgXvajj2.js';
4
- export { A as ACT_RISK, a as AUTORUN_RISK, b as AdoptSessionResponse, c as ApplyTaskOpsResult, d as ApprovalAnswerResponse, e as ApprovalBlock, f as ApprovalRequestMessage, g as ApprovalStatus, h as ApprovalsResponse, i as ApproveReviewResponse, j as AskOptions, l as AssignmentIssue, o as AutoMergeTrigger, B as BlockingSubject, C as CHAT_COMMANDS, p as CHECKPOINT_TRUNCATE_LENGTH, q as CancelPlanningResponse, r as CancelResumeResponse, s as CliAgentAiService, t as CliAgentAiServiceDeps, u as CommandBlock, v as CommandDescriptor, w as CommandStatus, x as CommandsResponse, y as CompactionBlock, z as ConversationBusyError, D as ConversationCompactResponse, F as ConversationEditError, G as ConversationForkResponse, H as ConversationInput, J as ConversationRewindResponse, L as ConversationView, M as DEFAULT_WEB_READ_BUDGET, N as DaemonErrorCode, O as DecideOptions, P as DiffRow, Q as DiffRowKind, R as DiffStat, S as DisplayBlock, T as EMPTY_CONVERSATION, U as EMPTY_HOLD, V as EMPTY_RUN, W as EMPTY_TASK_LOG, X as EMPTY_TASK_LOG_FOLLOW, Y as ErrorBody, Z as ExecuteResponse, _ as ExecutionSummary, $ as ForceSendResponse, a0 as GatedConversation, a1 as GeneratePlanResponse, a3 as HEADLESS_CLI_COMMANDS, a4 as HeldEdit, a5 as HeldEditMark, a9 as IsolationDiffResponse, aa as IsolationMergeResponse, ac as LiveOutputLookup, af as LocalEntry, ag as MarkdownToken, ah as MergeGateEntry, ai as MergeGateResponse, aj as MessageBlock, ak as MessageRole, al as ModelsResponse, am as NOT_STARTED, an as NO_TURN, ao as NewTaskFields, ap as NotificationAction, aq as OUTPUT_LINES_DEFAULT, ar as OUTPUT_LINES_MAX, as as OkResponse, au as OutputPreview, ax as PendingApprovalsOptions, ay as PlanBlock, az as PlanMarkerStatus, aA as PlanResponse, aB as PlanSnapshot, aD as PlannerCommandSyntax, aH as PlannerModelChoice, aI as PlannerModelMemory, aM as PlannerNotReady, aN as PlannerNotReadyError, aO as PlannerReadinessConfig, aP as PlannerSubmission, aQ as PlannerTurnDiscardedError, aR as PlannerTurnStoppedError, aS as PlannerUsageLimitError, aT as PrdResponse, aU as PromptHold, aV as RUN_SETTINGS_DEFAULTS, aX as RemoveMessageResponse, aZ as ResolveConflictResponse, a$ as RewindTargetsResponse, b0 as RunInput, b2 as RunSettingsError, b3 as RunSnapshotFrame, b4 as RunTask, b5 as RunTaskStatus, b8 as RunnerLoadedBlock, b9 as RunnersResponse, ba as STOPPED_BEFORE_START, bb as SUPERVISOR_LEVEL_LABEL, bc as SerializedConversationMessage, bd as SerializedPendingTurn, be as SerializedPlan, bf as SerializedTask, bg as SerializedTaskStatus, bi as SessionData, bj as SessionFrame, bk as SessionListResponse, bo as SessionResponse, bp as SettingsResponse, bq as SettingsService, br as SettingsUpdateResponse, bs as SkillInvocation, bt as SkillLoadBlock, bu as SkillToken, bx as StopResponse, by as StreamStamp, bz as SubagentBlock, bA as SubagentChild, bB as SubagentStatus, bC as SurfacePlan, bD as SurfacePlanState, bE as SurfaceTask, bF as TASK_QUERY_ANSWER_MAX_CHARS, bG as TASK_QUERY_ANSWER_OR_OPS, bH as TASK_QUERY_FIELDS, bI as TASK_QUERY_PROTOCOL, bJ as TASK_QUERY_REMINDER, bK as TERMINAL_UI_COMMANDS, bL as TakenPrompt, bM as TaskAttemptSnapshot, bN as TaskControlError, bO as TaskLogAttemptsResponse, bP as TaskLogBatch, bR as TaskLogFollow, bS as TaskLogFollowInput, bT as TaskLogResponse, bU as TaskLogView, bV as TaskMessageResponse, bW as TaskOp, bY as TaskOrchestratorDeps, bZ as TaskOrchestratorOptions, b$ as TaskPlacement, c0 as TaskQuery, c2 as TaskQueryField, c3 as TaskRef, c4 as TaskRowAction, c5 as TaskRowContext, c6 as TaskRowIsolation, c7 as TaskRowKind, c8 as TaskRowPlacement, c9 as TaskRowSubject, ca as TaskRowUsage, cb as TaskRowView, cc as TaskStartResponse, cd as TaskStatusKind, ce as ThinkingDisplayBlock, cf as ToolBlock, cg as ToolHeadline, ch as ToolStatus, ci as TreeTask, cj as TurnGate, ck as UsageBlock, cm as WAITS_FOR_APPROVAL_LABEL, cq as Worded, cr as WorkspacesResponse, cs as abbreviateHome, ct as aheadOfDraft, cu as applyTaskOps, cv as approvalLabel, cw as assignmentIssue, cx as assignmentIssueText, cy as automergeSummary, cz as autorunSummary, cA as awaitingLabel, cB as blockedByLabel, cC as blockingFailures, cD as canMergeTasks, cE as canSetDependencies, cF as canSplitTask, cG as capConflictFiles, cH as classifyOutcome, cI as coalesceTaskLog, cJ as createAiService, cK as dependencyCandidates, cL as dependentsNotice, cM as dependentsOf, cN as describePlannerNotReady, cO as diffRows, cP as diffStat, cQ as diffSummary, cR as digestTaskLog, cS as drainNext, cT as executionSummary, cU as followTaskLog, cV as followTurn, cW as fromTranscript, cX as getSettingsPath, cY as hasHiddenDetail, cZ as holdPrompt, c_ as isTaskRunning, c$ as loadedSkillTokens, d0 as markAction, d1 as markRequestFor, d2 as markdownHtml, d3 as markdownTokens, d4 as namedRepos, d5 as newTaskFields, d6 as opsEditable, d7 as outputLines, d8 as outputPreview, d9 as parseCount, da as parseSwitch, db as parseTaskOpsJson, dc as parseTaskQueryJson, dd as pastGateConfirmation, de as plannerMessage, df as plannerNotReady, dg as plannerNotReadyFor, dh as plannerTranscript, di as reconcileApprovals, dj as reduceConversation, dk as reduceRun, dl as reduceTaskLog, dm as renderTaskQueryAnswer, dn as replayTaskLog, dp as resolveSkillInvocation, dq as resolveTaskRef, dr as resolveUserTaskRef, ds as resumeLabel, dt as resumeTime, du as runSettingsOf, dv as runnerToolSubject, dw as serializePlan, dx as serializeTask, dy as serializeTaskStatus, dz as skillTokens, dA as skippedLabel, dB as stopTurn, dC as subtreeIds, dD as summarizeToolCall, dE as supervisorSummary, dF as surfacePlan, dG as surfacePlanState, dH as takeAt, dI as taskLogForSurface, dJ as taskOrderLabel, dK as taskPlacement, dL as taskQuerySignature, dM as taskRef, dN as taskRefOf, dO as taskRowActions, dP as taskRowView, dQ as taskStartedNotice, dR as taskStatusKind, dS as textHasTaskOps, dT as textHasTaskQuery, dU as titledRefs, dV as titledTaskRef, dW as titledTaskRefOf, dX as toTaskLogEvent, dY as toolHeadline, dZ as trimToolOutput, d_ as truncateCheckpointSummary, d$ as unsendAll, e0 as unsendLatest, e1 as walkPlan } from './runSettingsText-BgXvajj2.js';
5
- import { j as ApprovalDecision, J as IApproval, L as IFileSystem, ak as ResearchShell, aj as ReadFileOpts, aU as ToolOutcome, H as GrepOptions, B as GlobOptions, y as FindSymbolOptions, M as IRunner, K as IConfig, a9 as PlannerBackendId, af as ProviderModelLists, f as AiProvider, m as ApprovalModeSetting, ac as PlannerToolHandler, ay as RunnerRegistry, a3 as OrchestratorOption, d as AgentProcessDeps, aM as TaskModeAgentAdapter, a as AgentAdapter, e as AgentStartOptions, c as AgentEvent, ap as RunnerCommand, ad as ProjectMcpServer, N as IRunnerSession, n as ApprovalPolicy, i as ApprovalAnswer, a4 as OrdewellMcpServer, aJ as TaskCompleteArgs, r as CheckpointAnswer, aE as StructuredTurnEnd, aD as StructuredEvent, aL as TaskMessageFrom, ah as QueuedTaskMessage, aR as TaskStartOptions, aS as TaskTokenScope, at as RunnerManifest, aQ as TaskRunnerFlags } from './IFileSystem-C4_mpfze.js';
6
- export { A as AUTO_COMMANDS, b as AgentAdapterFactory, g as AllProviderModels, h as AnswerApprovalArgs, k as ApprovalKind, l as ApprovalMode, o as ApprovalPolicyOptions, p as ApprovalRequest, q as ApprovalSource, C as CatalogModel, s as CheckpointArgs, t as CommandClassification, u as CommandTier, v as CommandWords, D as DEFAULT_PLANNER_ALLOWLIST, w as DENY_ALL, x as DiscoveryCommand, E as EditPlanArgs, F as FetchAllProviderModelsOptions, G as GIT_READONLY_SUBCOMMANDS, z as GREP_DEFAULT_HEAD_LIMIT, I as GrepOutputMode, O as InvokedCommand, P as LineBuffer, Q as ListModelsArgs, R as ListRunnersArgs, S as LoadSkillArgs, T as McpClientConfig, U as McpCredential, V as McpTool, W as McpToolContext, X as McpToolReply, Y as MessageTaskArgs, Z as ModelCatalog, _ as ModelShortcut, $ as ORCHESTRATOR_SHORTCUTS, a0 as ORDEWELL_MCP_PATH, a1 as ORDEWELL_MCP_SERVER_NAME, a2 as OneTaskArgs, a5 as OwnerOnlyFile, a6 as PLANNER_EXECUTION_TOOLS, a7 as PLANNER_TOOLS, a8 as PlannerAllowlist, aa as PlannerStartOptions, ab as PlannerTokenScope, ae as ProviderCredentialSource, ag as ProviderModelsResult, ai as REFUSED_COMMANDS, al as ResearchShellDeps, am as RetryTaskArgs, an as RunCommandArgs, ao as RunPlanArgs, aq as RunnerCommandKind, ar as RunnerEntry, as as RunnerFeatures, au as RunnerMcpServer, av as RunnerMode, aw as RunnerModelDiscovery, ax as RunnerModelRef, az as SEARCH_EXCLUSIONS, aA as ShellDialect, aB as SpawnFn, aC as StandingDecision, aF as SubmitPlanArgs, aG as TASK_COMPLETE_TOOL, aH as TASK_COMPLETION_CONTRACT, aI as TASK_TOOLS, aK as TaskDiffArgs, aN as TaskModeUnsupportedError, aO as TaskOutputArgs, aP as TaskQueryArgs, aT as TaskToolHandler, aW as approvalScopes, aX as classifyCommand, aY as clearResearchShellCache, aZ as collectProviderCredentials, a_ as commandAllowedBy, a$ as effectiveApprovalMode, b0 as enabledRunners, b1 as fetchAllProviderModels, b2 as findRunnerCommand, b3 as isGranted, b4 as isRunnerApproval, b5 as knownModelId, b6 as mcpClientConfig, b7 as ownerOnlyConfigFile, b8 as parseAllowlist, b9 as parseApprovalModeSetting, ba as researchShellWarning, bb as researchToolsPath, bc as resolveModelShortcut, bd as resolveProvider, be as resolveResearchShell, bf as scopeAllowed, bg as sharedMcpServer, bh as toApprovalDecision, bi as toOrchestratorOptions, bj as toolAllowed } from './IFileSystem-C4_mpfze.js';
7
- import { R as RunnerModeInfo } from './ModeResolver-DGK2rWHE.js';
8
- export { a as autonomyLevelLabel, p as parseAutonomyLevel, r as runnerModesFrom } from './ModeResolver-DGK2rWHE.js';
1
+ import { t as IsolationMergeResult, am as Task, E as ExecutionActor, h as ExecutionRecord, i as GuardTrip, al as SupervisorLevel, g as ExecutionCommandName, G as GuardTarget, p as IsolationLandedTask, I as IWorktreeIsolation, J as IsolationTaskStatus, N as PlanIsolation, a7 as RunnerId, a2 as ResearchProgress, az as UsageRecord, a1 as ResearchLogEntry, f as DiscoveredModel, L as LegacyPlanState, a8 as RunnerSessionCost, a5 as ResearchToolType, a0 as ReportedWindow, T as PlannerUsage, at as TaskSkillSnapshot, aj as SkillsService, au as TaskSnapshot, O as PlanState, K as IsolationView, aB as Verdict } from './Task-CfBM0wkV.js';
2
+ export { A as ApprovalRecord, a as AttemptUsage, b as AwaitingReason, B as BUILTIN_SKILL_NAMES, C as ContextFill, c as ConversationMessage, d as CostProvenance, D as DEFAULT_RUNNERS, e as DEFAULT_SUPERVISOR_RETRY_LIMIT, j as IntegrationDisposal, k as InvalidSkill, l as IsolationAvailability, m as IsolationHandoff, n as IsolationHandoffRepo, o as IsolationInactiveReason, q as IsolationLanding, r as IsolationMergeBlock, s as IsolationMergeBlockReason, u as IsolationOutcome, v as IsolationPruneResult, w as IsolationRemoval, x as IsolationRepo, y as IsolationRun, z as IsolationTaskRecord, F as IsolationTaskRef, H as IsolationTaskRepo, M as ModelUsage, Q as PlanStatus, R as PlanUsage, S as PlannerResendState, U as PrepareIntent, V as PreparedTask, W as PreservedWork, X as PreviousWork, Y as RefusedRemoval, Z as RepairEvidence, _ as ReplyRun, $ as RepoGroupLayout, a3 as ResearchStep, a4 as ResearchStepOutcome, a6 as RunSettings, a9 as SessionBilling, aa as SetupFailure, ab as ShadowedSkill, ac as SkillAppliesTo, ad as SkillCatalog, ae as SkillInfo, af as SkillLoad, ag as SkillLoadNotice, ah as SkillMetadata, ai as SkillSource, ap as TaskIsolation, aq as TaskIsolationState, ar as TaskModelAssignment, av as TaskStatus, aw as TaskUsageSummary, ax as TreeSnapshot, ay as UsageLine, aA as UsageTotals, aC as VerificationCheck, aD as addAttemptUsage, aE as addModelUsage, aF as addPlannerUsage, aG as addUsage, aH as addUsageTotals, aI as contextMeterText, aJ as contextMeterTitle, aK as costText, aL as countedSessionCost, aM as createEmptyPlan, aN as createSkillsService, aO as createTask, aP as endAttemptUsage, aQ as flattenTasks, aR as flattenTasksWithParents, aS as formatCost, aT as formatTokenCount, aU as isAwaitingReason, aV as isMeasured, aW as isSupervisorLevel, aX as isUserMessage, aY as migratePlanState, aZ as modelCostTitle, a_ as partedPromptUsage, a$ as pausedOnLimit, b0 as planUsage, b1 as plannerContextFill, b2 as rejoinPlanTree, b3 as resumedSessionWindow, b4 as startAttemptUsage, b5 as subagentCostTitle, b6 as taskUsageSummary, b7 as tasksTotalText, b8 as usageLine, b9 as usageText, ba as waitsForApproval } from './Task-CfBM0wkV.js';
3
+ import { bv as StartAdmission, bw as StartWait, aY as ResolveAll, a8 as IWebFetcher, cp as WebReadPolicy, cn as WebRead, co as WebReadDecision, aw as PendingApprovals, K as ConversationTurn, aL as PlannerModes, a6 as IAiService, I as ConversationRequest, n as AssignmentWriter, m as AssignmentScope, c1 as TaskQueryCatalog, k as AssignmentCatalog, b7 as RunnerCatalog, bl as SessionMessage, bh as SessionBroadcaster, bn as SessionNotice, aC as PlanStore, bX as TaskOrchestrator, ab as IsolationRunController, at as OrchestratorObserver, bQ as TaskLogEvent, a7 as INotification, a2 as GlobalRunSettings, aF as PlannerConversationHost, aE as PlannerConversation, av as PendingApproval, E as ConversationCompaction, a_ as RewindTarget, b6 as RunView, b1 as RunMergeView, b_ as TaskOutputSource, cl as UserSettings, ae as LiveTailOptions, ad as LiveTail, bm as SessionMeta, aK as PlannerModelStore, aJ as PlannerModelRecall, aG as PlannerModelCandidate } from './runSettingsText-CWNrmF5U.js';
4
+ export { A as ACT_RISK, a as AUTORUN_RISK, b as AdoptSessionResponse, c as ApplyTaskOpsResult, d as ApprovalAnswerResponse, e as ApprovalBlock, f as ApprovalRequestMessage, g as ApprovalStatus, h as ApprovalsResponse, i as ApproveReviewResponse, j as AskOptions, l as AssignmentIssue, o as AutoMergeTrigger, B as BlockingSubject, C as CHAT_COMMANDS, p as CHECKPOINT_TRUNCATE_LENGTH, q as CancelPlanningResponse, r as CancelResumeResponse, s as CliAgentAiService, t as CliAgentAiServiceDeps, u as CommandBlock, v as CommandDescriptor, w as CommandStatus, x as CommandsResponse, y as CompactionBlock, z as ConversationBusyError, D as ConversationCompactResponse, F as ConversationEditError, G as ConversationForkResponse, H as ConversationInput, J as ConversationRewindResponse, L as ConversationView, M as DEFAULT_WEB_READ_BUDGET, N as DaemonErrorCode, O as DecideOptions, P as DiffRow, Q as DiffRowKind, R as DiffStat, S as DisplayBlock, T as EMPTY_CONVERSATION, U as EMPTY_HOLD, V as EMPTY_RUN, W as EMPTY_TASK_LOG, X as EMPTY_TASK_LOG_FOLLOW, Y as ErrorBody, Z as ExecuteResponse, _ as ExecutionSummary, $ as ForceSendResponse, a0 as GatedConversation, a1 as GeneratePlanResponse, a3 as HEADLESS_CLI_COMMANDS, a4 as HeldEdit, a5 as HeldEditMark, a9 as IsolationDiffResponse, aa as IsolationMergeResponse, ac as LiveOutputLookup, af as LocalEntry, ag as MarkdownToken, ah as MergeGateEntry, ai as MergeGateResponse, aj as MessageBlock, ak as MessageRole, al as ModelsResponse, am as NOT_STARTED, an as NO_TURN, ao as NewTaskFields, ap as NotificationAction, aq as OUTPUT_LINES_DEFAULT, ar as OUTPUT_LINES_MAX, as as OkResponse, au as OutputPreview, ax as PendingApprovalsOptions, ay as PlanBlock, az as PlanMarkerStatus, aA as PlanResponse, aB as PlanSnapshot, aD as PlannerCommandSyntax, aH as PlannerModelChoice, aI as PlannerModelMemory, aM as PlannerNotReady, aN as PlannerNotReadyError, aO as PlannerReadinessConfig, aP as PlannerSubmission, aQ as PlannerTurnDiscardedError, aR as PlannerTurnStoppedError, aS as PlannerUsageLimitError, aT as PrdResponse, aU as PromptHold, aV as RUN_SETTINGS_DEFAULTS, aX as RemoveMessageResponse, aZ as ResolveConflictResponse, a$ as RewindTargetsResponse, b0 as RunInput, b2 as RunSettingsError, b3 as RunSnapshotFrame, b4 as RunTask, b5 as RunTaskStatus, b8 as RunnerLoadedBlock, b9 as RunnersResponse, ba as STOPPED_BEFORE_START, bb as SUPERVISOR_LEVEL_LABEL, bc as SerializedConversationMessage, bd as SerializedPendingTurn, be as SerializedPlan, bf as SerializedTask, bg as SerializedTaskStatus, bi as SessionData, bj as SessionFrame, bk as SessionListResponse, bo as SessionResponse, bp as SettingsResponse, bq as SettingsService, br as SettingsUpdateResponse, bs as SkillInvocation, bt as SkillLoadBlock, bu as SkillToken, bx as StopResponse, by as StreamStamp, bz as SubagentBlock, bA as SubagentChild, bB as SubagentStatus, bC as SurfacePlan, bD as SurfacePlanState, bE as SurfaceTask, bF as TASK_QUERY_ANSWER_MAX_CHARS, bG as TASK_QUERY_ANSWER_OR_OPS, bH as TASK_QUERY_FIELDS, bI as TASK_QUERY_PROTOCOL, bJ as TASK_QUERY_REMINDER, bK as TERMINAL_UI_COMMANDS, bL as TakenPrompt, bM as TaskAttemptSnapshot, bN as TaskControlError, bO as TaskLogAttemptsResponse, bP as TaskLogBatch, bR as TaskLogFollow, bS as TaskLogFollowInput, bT as TaskLogResponse, bU as TaskLogView, bV as TaskMessageResponse, bW as TaskOp, bY as TaskOrchestratorDeps, bZ as TaskOrchestratorOptions, b$ as TaskPlacement, c0 as TaskQuery, c2 as TaskQueryField, c3 as TaskRef, c4 as TaskRowAction, c5 as TaskRowContext, c6 as TaskRowIsolation, c7 as TaskRowKind, c8 as TaskRowPlacement, c9 as TaskRowSubject, ca as TaskRowUsage, cb as TaskRowView, cc as TaskStartResponse, cd as TaskStatusKind, ce as ThinkingDisplayBlock, cf as ToolBlock, cg as ToolHeadline, ch as ToolStatus, ci as TreeTask, cj as TurnGate, ck as UsageBlock, cm as WAITS_FOR_APPROVAL_LABEL, cq as Worded, cr as WorkspacesResponse, cs as abbreviateHome, ct as aheadOfDraft, cu as applyTaskOps, cv as approvalLabel, cw as assignmentIssue, cx as assignmentIssueText, cy as automergeSummary, cz as autorunSummary, cA as awaitingLabel, cB as blockedByLabel, cC as blockingFailures, cD as canMergeTasks, cE as canSetDependencies, cF as canSplitTask, cG as capConflictFiles, cH as classifyOutcome, cI as coalesceTaskLog, cJ as createAiService, cK as dependencyCandidates, cL as dependentsNotice, cM as dependentsOf, cN as describePlannerNotReady, cO as diffRows, cP as diffStat, cQ as diffSummary, cR as digestTaskLog, cS as drainNext, cT as executionSummary, cU as followTaskLog, cV as followTurn, cW as fromTranscript, cX as getSettingsPath, cY as hasHiddenDetail, cZ as holdPrompt, c_ as isTaskRunning, c$ as loadedSkillTokens, d0 as markAction, d1 as markRequestFor, d2 as markdownHtml, d3 as markdownTokens, d4 as namedRepos, d5 as newTaskFields, d6 as opsEditable, d7 as outputLines, d8 as outputPreview, d9 as parseCount, da as parseSwitch, db as parseTaskOpsJson, dc as parseTaskQueryJson, dd as pastGateConfirmation, de as plannerMessage, df as plannerNotReady, dg as plannerNotReadyFor, dh as plannerTranscript, di as reconcileApprovals, dj as reduceConversation, dk as reduceRun, dl as reduceTaskLog, dm as renderTaskQueryAnswer, dn as replayTaskLog, dp as resolveSkillInvocation, dq as resolveTaskRef, dr as resolveUserTaskRef, ds as resumeLabel, dt as resumeTime, du as runSettingsOf, dv as runnerToolSubject, dw as serializePlan, dx as serializeTask, dy as serializeTaskStatus, dz as skillTokens, dA as skippedLabel, dB as stopTurn, dC as subtreeIds, dD as summarizeToolCall, dE as supervisorSummary, dF as surfacePlan, dG as surfacePlanState, dH as takeAt, dI as taskLogForSurface, dJ as taskOrderLabel, dK as taskPlacement, dL as taskQuerySignature, dM as taskRef, dN as taskRefOf, dO as taskRowActions, dP as taskRowView, dQ as taskStartedNotice, dR as taskStatusKind, dS as textHasTaskOps, dT as textHasTaskQuery, dU as titledRefs, dV as titledTaskRef, dW as titledTaskRefOf, dX as toTaskLogEvent, dY as toolHeadline, dZ as trimToolOutput, d_ as truncateCheckpointSummary, d$ as unsendAll, e0 as unsendLatest, e1 as walkPlan } from './runSettingsText-CWNrmF5U.js';
5
+ import { j as ApprovalDecision, J as IApproval, L as IFileSystem, ak as ResearchShell, aj as ReadFileOpts, aU as ToolOutcome, H as GrepOptions, B as GlobOptions, y as FindSymbolOptions, M as IRunner, K as IConfig, a9 as PlannerBackendId, af as ProviderModelLists, f as AiProvider, m as ApprovalModeSetting, ac as PlannerToolHandler, ay as RunnerRegistry, a3 as OrchestratorOption, d as AgentProcessDeps, aM as TaskModeAgentAdapter, a as AgentAdapter, e as AgentStartOptions, c as AgentEvent, ap as RunnerCommand, ad as ProjectMcpServer, N as IRunnerSession, n as ApprovalPolicy, i as ApprovalAnswer, a4 as OrdewellMcpServer, aJ as TaskCompleteArgs, r as CheckpointAnswer, aE as StructuredTurnEnd, aD as StructuredEvent, aL as TaskMessageFrom, ah as QueuedTaskMessage, aR as TaskStartOptions, aS as TaskTokenScope, at as RunnerManifest, aQ as TaskRunnerFlags } from './IFileSystem-lTRL_G9Z.js';
6
+ export { A as AUTO_COMMANDS, b as AgentAdapterFactory, g as AllProviderModels, h as AnswerApprovalArgs, k as ApprovalKind, l as ApprovalMode, o as ApprovalPolicyOptions, p as ApprovalRequest, q as ApprovalSource, C as CatalogModel, s as CheckpointArgs, t as CommandClassification, u as CommandTier, v as CommandWords, D as DEFAULT_PLANNER_ALLOWLIST, w as DENY_ALL, x as DiscoveryCommand, E as EditPlanArgs, F as FetchAllProviderModelsOptions, G as GIT_READONLY_SUBCOMMANDS, z as GREP_DEFAULT_HEAD_LIMIT, I as GrepOutputMode, O as InvokedCommand, P as LineBuffer, Q as ListModelsArgs, R as ListRunnersArgs, S as LoadSkillArgs, T as McpClientConfig, U as McpCredential, V as McpTool, W as McpToolContext, X as McpToolReply, Y as MessageTaskArgs, Z as ModelCatalog, _ as ModelShortcut, $ as ORCHESTRATOR_SHORTCUTS, a0 as ORDEWELL_MCP_PATH, a1 as ORDEWELL_MCP_SERVER_NAME, a2 as OneTaskArgs, a5 as OwnerOnlyFile, a6 as PLANNER_EXECUTION_TOOLS, a7 as PLANNER_TOOLS, a8 as PlannerAllowlist, aa as PlannerStartOptions, ab as PlannerTokenScope, ae as ProviderCredentialSource, ag as ProviderModelsResult, ai as REFUSED_COMMANDS, al as ResearchShellDeps, am as RetryTaskArgs, an as RunCommandArgs, ao as RunPlanArgs, aq as RunnerCommandKind, ar as RunnerEntry, as as RunnerFeatures, au as RunnerMcpServer, av as RunnerMode, aw as RunnerModelDiscovery, ax as RunnerModelRef, az as SEARCH_EXCLUSIONS, aA as ShellDialect, aB as SpawnFn, aC as StandingDecision, aF as SubmitPlanArgs, aG as TASK_COMPLETE_TOOL, aH as TASK_COMPLETION_CONTRACT, aI as TASK_TOOLS, aK as TaskDiffArgs, aN as TaskModeUnsupportedError, aO as TaskOutputArgs, aP as TaskQueryArgs, aT as TaskToolHandler, aW as approvalScopes, aX as classifyCommand, aY as clearResearchShellCache, aZ as collectProviderCredentials, a_ as commandAllowedBy, a$ as effectiveApprovalMode, b0 as enabledRunners, b1 as fetchAllProviderModels, b2 as findRunnerCommand, b3 as isGranted, b4 as isRunnerApproval, b5 as knownModelId, b6 as mcpClientConfig, b7 as ownerOnlyConfigFile, b8 as parseAllowlist, b9 as parseApprovalModeSetting, ba as researchShellWarning, bb as researchToolsPath, bc as resolveModelShortcut, bd as resolveProvider, be as resolveResearchShell, bf as scopeAllowed, bg as sharedMcpServer, bh as toApprovalDecision, bi as toOrchestratorOptions, bj as toolAllowed } from './IFileSystem-lTRL_G9Z.js';
7
+ import { R as RunnerModeInfo } from './ModeResolver-CoJAJD-f.js';
8
+ export { a as autonomyLevelLabel, p as parseAutonomyLevel, r as runnerModesFrom } from './ModeResolver-CoJAJD-f.js';
9
9
  import { ChildProcess } from 'child_process';
10
10
  import { EventEmitter } from 'events';
11
11
  import 'zod/v4';
@@ -1814,6 +1814,7 @@ declare abstract class StdioAgentAdapter implements AgentAdapter {
1814
1814
  send(message: string, onEvent: (event: AgentEvent) => void, signal?: AbortSignal, onActivity?: () => void): Promise<void>;
1815
1815
  onOutOfTurn(listener: (event: AgentEvent) => void): void;
1816
1816
  nativeSessionId(): string | null;
1817
+ get exited(): boolean;
1817
1818
  onProcessExit(listener: (code: number, lastWords?: string) => void): void;
1818
1819
  dispose(): void;
1819
1820
  /** Write one raw protocol line to the agent. */
@@ -1836,16 +1837,27 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
1836
1837
  private replyRuns;
1837
1838
  /** The model answering the planner's current message, and the message's id, as its `message_start` named them. */
1838
1839
  private plannerModel;
1840
+ /**
1841
+ * The id the turn runs as, as `init` names it. A `[1m]` variant is the
1842
+ * selected id, while a message names the API's canonical id without it.
1843
+ */
1844
+ private sessionModel;
1845
+ private billing;
1839
1846
  private streamingMessage;
1840
1847
  /** The message the last `assistant` line was part of, and how many of its blocks the lines have carried. */
1841
1848
  private lineMessage;
1842
1849
  /**
1843
- * The session's `total_cost_usd` as last counted. A resume starts from what
1844
- * was counted of that session before, and is undefined without it: the CLI
1845
- * restores the session's running total, which holds turns counted earlier.
1850
+ * What has been counted of the session's running cost: a resume starts from
1851
+ * it, and it is undefined without a kept count — the next result then only
1852
+ * sets the baseline, since the CLI restores spend from turns before it. It
1853
+ * grows by what each result is counted for, never by a total that includes
1854
+ * cost the runner marked unknown, so that spend can be counted when its basis
1855
+ * is reported; and it never lowers, since counted dollars are not un-spent.
1846
1856
  */
1847
1857
  private reportedCostUsd;
1848
1858
  private reportedModelCostUsd;
1859
+ /** What this turn's streamed calls already reported, so its result only adds what did not stream. */
1860
+ private turnCallUsage;
1849
1861
  /**
1850
1862
  * Subagents started and not yet finished, keyed by the `Agent` call's id.
1851
1863
  * Kept across turns: a backgrounded one reports after its turn has ended.
@@ -1898,6 +1910,11 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
1898
1910
  private modelCommands;
1899
1911
  protected spawnSpec(opts: AgentStartOptions, workspace: Record<string, string>): SpawnSpec;
1900
1912
  sessionCost(): RunnerSessionCost | null;
1913
+ /**
1914
+ * A cleared conversation's totals start again from zero, so what follows is
1915
+ * all new spend, even for a resume that had no count kept.
1916
+ */
1917
+ private restartCount;
1901
1918
  /** A count kept for another session says nothing of this one's. */
1902
1919
  private countFrom;
1903
1920
  savedOutput(abs: string): boolean;
@@ -1942,6 +1959,13 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
1942
1959
  * as an interrupted `turn_end`.
1943
1960
  */
1944
1961
  interrupt(timeoutMs: number): Promise<boolean>;
1962
+ /**
1963
+ * On stdin's end the CLI exits by itself once its turn has closed, and only
1964
+ * an exit of its own saves the session's running totals for a `--resume` to
1965
+ * restore (checked on 2.1.303: about a second later, code 0, or 1 after an
1966
+ * interrupted turn).
1967
+ */
1968
+ endInput(): void;
1945
1969
  /**
1946
1970
  * A `user` line written mid-turn is Claude Code's own queue (ADR-0023): the
1947
1971
  * CLI attaches it to the next tool result, or runs it as a turn of its own
@@ -2050,6 +2074,22 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
2050
2074
  * {@link AgentEvent}), so nothing here has to reconcile with it.
2051
2075
  */
2052
2076
  private handleStreamEvent;
2077
+ /**
2078
+ * The id a reported model runs as. `init` names the selected value — a
2079
+ * `[1m]` variant included — while a message names the API's canonical id
2080
+ * without it. Keeping the variant is what lets the meter find the window
2081
+ * `modelUsage` keys it by, and keeps that window off the base model.
2082
+ */
2083
+ private modelId;
2084
+ private reportBilling;
2085
+ /**
2086
+ * A turn's `result` states its own token sum. Every call that streamed its
2087
+ * `message_delta` usage has already reported, so only the remainder is added:
2088
+ * all of it when nothing streamed (a recording without partial messages), or
2089
+ * a lost call's share. It is a sum across calls, marked `aggregate` so it
2090
+ * never moves the meter — only a call says what the context was left at.
2091
+ */
2092
+ private reportUnstreamedUsage;
2053
2093
  /**
2054
2094
  * What only the result line knows: the cost, which covers every call the
2055
2095
  * session made — subagents included, since none of their lines carries one —
@@ -2058,6 +2098,19 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
2058
2098
  * the session before; with no count kept, the first turn only sets the
2059
2099
  * baseline: its total includes turns counted before, and a turn's own share
2060
2100
  * cannot be told apart from them.
2101
+ *
2102
+ * The running total never lowers: money already reported and counted is not
2103
+ * un-spent because a later or resumed process remembers less of it, and
2104
+ * counting its return would count the same dollars twice. A zero is not a
2105
+ * measurement at all — a crash can end with one — and only `/clear` restarts
2106
+ * the count, through {@link restartCount}. Per-model baselines never lower
2107
+ * either, for the same reason.
2108
+ *
2109
+ * A report without a model breakdown is counted as a session total; one with
2110
+ * a breakdown is counted per model. A breakdown that would count more than
2111
+ * the session total's own growth (the count before it had no model split, or
2112
+ * a lossy report) is counted as that growth alone, so the two shapes
2113
+ * together still add each dollar once.
2061
2114
  */
2062
2115
  private reportSessionCost;
2063
2116
  }
@@ -2221,6 +2274,13 @@ declare class CodexAdapter extends StdioAgentAdapter implements TaskModeAgentAda
2221
2274
  * `last.outputTokens` already includes `reasoningOutputTokens` — the thread
2222
2275
  * total is `inputTokens + outputTokens`, not a sum of three — so reasoning is
2223
2276
  * not added a second time. Codex reports no price.
2277
+ *
2278
+ * The main thread's context is what Codex itself shows as in its window:
2279
+ * `TokenUsage::tokens_in_context_window`, which is `total_tokens` over
2280
+ * `last` as codex-rs defines it. `total_tokens` is input plus output, and
2281
+ * reasoning is part of output, so this is not `input + output − reasoning`
2282
+ * (checked against codex-rs and codex-cli 0.163.0's token_count events,
2283
+ * where `total_tokens` is `input_tokens + output_tokens`).
2224
2284
  */
2225
2285
  private emitUsage;
2226
2286
  /**
@@ -2371,7 +2431,7 @@ declare class OpenCodeAdapter implements TaskModeAgentAdapter {
2371
2431
  private ordewell;
2372
2432
  constructor(deps: AgentProcessDeps);
2373
2433
  private get processEnded();
2374
- private get exited();
2434
+ get exited(): boolean;
2375
2435
  start(opts: AgentStartOptions): Promise<void>;
2376
2436
  private launch;
2377
2437
  /**
@@ -2699,6 +2759,27 @@ declare class SessionCatalog {
2699
2759
  * Ordewell. `source` is the record's reporter: a runner id or a vendor id.
2700
2760
  */
2701
2761
  type CatalogWindow = (source: string, model: string) => number | undefined;
2762
+ /**
2763
+ * The windows runners and providers reported over one Ordewell session, by
2764
+ * reporter and exact model id, shared by every stream of it: the planner's,
2765
+ * each task attempt's and each continue's. Claude Code states a window only on
2766
+ * a turn's last line, and a task is often one long turn, so without the
2767
+ * planner's or an earlier attempt's report on the same model the task would
2768
+ * have none for its whole run. Saved with the plan, so a reload knows them too.
2769
+ *
2770
+ * Holds only what a reporter stated — never a catalog's window, which the
2771
+ * catalog serves again, and never a table kept in Ordewell (ADR-0017 U1).
2772
+ */
2773
+ declare class SessionWindows {
2774
+ readonly catalog: CatalogWindow;
2775
+ private readonly reported;
2776
+ constructor(catalog?: CatalogWindow);
2777
+ report(source: string, model: string, contextWindow: number): void;
2778
+ get(source: string, model: string): number | undefined;
2779
+ snapshot(): ReportedWindow[];
2780
+ restore(saved: readonly ReportedWindow[] | undefined): void;
2781
+ clear(): void;
2782
+ }
2702
2783
 
2703
2784
  /** The `planner_usage` member of the session broadcast union. */
2704
2785
  type PlannerUsageMessage = Extract<SessionMessage, {
@@ -2714,18 +2795,18 @@ type PlannerUsageMessage = Extract<SessionMessage, {
2714
2795
  * defined — this module just holds the state and the broadcast shape.
2715
2796
  */
2716
2797
  declare class PlannerUsageLedger {
2717
- private readonly catalogWindow;
2798
+ private readonly sessionWindows;
2718
2799
  private usage;
2719
2800
  private windows;
2720
- /** `catalogWindow` serves the window of a planner model whose backend reports none. */
2721
- constructor(catalogWindow?: CatalogWindow);
2801
+ /** `sessionWindows` serves the window of a planner model whose backend reports none. */
2802
+ constructor(sessionWindows?: SessionWindows);
2722
2803
  /** Fold one model call's record into the totals; returns the running ledger. */
2723
2804
  record(record: UsageRecord): PlannerUsage;
2724
2805
  /** Adopt a persisted ledger (a reopened session) or start from zero. */
2725
2806
  restore(usage: PlannerUsage | undefined): void;
2726
2807
  /** Start a fresh session's ledger from zero. */
2727
2808
  clear(): void;
2728
- /** Whether anything has been recorded — a plan with no usage says nothing. */
2809
+ /** Whether the ledger has measures or session billing facts to broadcast. */
2729
2810
  get hasUsage(): boolean;
2730
2811
  /** The value persisted onto the plan state. */
2731
2812
  snapshot(): PlannerUsage;
@@ -2988,6 +3069,8 @@ interface SessionParts {
2988
3069
  runs: IsolationRunController;
2989
3070
  events: SessionEventRelay;
2990
3071
  usage: PlannerUsageLedger;
3072
+ /** The windows every stream of the session reports, saved with the plan. */
3073
+ windows: SessionWindows;
2991
3074
  approvals: PendingApprovals;
2992
3075
  approvalPolicy: ApprovalPolicy;
2993
3076
  /** Where the Session writes what it made of a task's event into that attempt's log. */
@@ -3013,6 +3096,7 @@ interface SessionParts {
3013
3096
  declare class Session {
3014
3097
  private readonly backend;
3015
3098
  private readonly usage;
3099
+ private readonly windows;
3016
3100
  private readonly events;
3017
3101
  private readonly planner;
3018
3102
  private readonly orchestrator;
@@ -3579,6 +3663,18 @@ declare class Session {
3579
3663
  sessionId?: string;
3580
3664
  persist?: boolean;
3581
3665
  }): void;
3666
+ /**
3667
+ * Take the loaded plan's run over, then correct what the surfaces were told
3668
+ * by what git found: the saved record cannot know what the user merged
3669
+ * since, and its handoff would offer Merge all for work already in their
3670
+ * branch. The status update says what landed work is still unmerged, which
3671
+ * a handoff folds to (see `reduceRun`), and `run_closed` that the run was
3672
+ * cleared up. Saved only where the load itself may save (`persists`), so a
3673
+ * restore with no session file to write keeps the correction in memory for
3674
+ * its next save. A plan loaded meanwhile is not this one's to correct.
3675
+ * Starts nothing (ADR-0044).
3676
+ */
3677
+ private adoptRun;
3582
3678
  destroy(): void;
3583
3679
  /**
3584
3680
  * The planner's settings or credentials changed: its backend is let go and
@@ -3772,6 +3868,7 @@ declare abstract class AbstractRunnerSession implements IRunnerSession {
3772
3868
  onOutput(callback: (text: string) => void): void;
3773
3869
  onExit(callback: (code: number) => void): void;
3774
3870
  abstract kill(): void;
3871
+ abstract stop(): Promise<void>;
3775
3872
  abstract getOutput(): string;
3776
3873
  abstract write(text: string): void;
3777
3874
  abstract turnState(): 'working' | 'idle';
@@ -3793,7 +3890,8 @@ declare abstract class AbstractRunnerSession implements IRunnerSession {
3793
3890
  declare abstract class AbstractRunner<S extends IRunnerSession> implements IRunner {
3794
3891
  protected sessions: Map<string, S>;
3795
3892
  get activeCount(): number;
3796
- stop(sessionId: string): void;
3893
+ /** A session winding down stays registered until it exits, so a second stop gets the same wind-down. */
3894
+ stop(sessionId: string): Promise<void>;
3797
3895
  stopAll(): void;
3798
3896
  protected registerSession(id: string, session: S): void;
3799
3897
  abstract spawn(opts: RunnerSpawnOptions): Promise<IRunnerSession>;
@@ -3849,6 +3947,8 @@ declare class StructuredSession extends AbstractRunnerSession {
3849
3947
  private queue;
3850
3948
  private messageCount;
3851
3949
  private interrupting;
3950
+ /** The wind-down once {@link stop} was asked for: the same for every caller, and nothing new is sent meanwhile. */
3951
+ private stopping;
3852
3952
  private lastSessionId;
3853
3953
  private lastSessionCost;
3854
3954
  private readonly structuredEmitter;
@@ -3891,6 +3991,21 @@ declare class StructuredSession extends AbstractRunnerSession {
3891
3991
  */
3892
3992
  write(text: string): void;
3893
3993
  kill(): void;
3994
+ stop(): Promise<void>;
3995
+ /**
3996
+ * The attempt is over (ADR-0018, L1), so what is still owed goes undelivered
3997
+ * and every tool request unanswered at once. A turn still open is
3998
+ * interrupted, and its close — where Claude Code reports the turn's cost and
3999
+ * its model's window — is waited for; then the runner is told nothing more
4000
+ * is coming and left to exit by itself. All of it within the interrupt
4001
+ * grace: a runner still there once it runs out is killed.
4002
+ */
4003
+ private windDown;
4004
+ /** Whether `turn` closed within the deadline once interrupted. */
4005
+ private turnClosed;
4006
+ /** Whether `done` settled before the deadline, or the session ended meanwhile. */
4007
+ private within;
4008
+ private gone;
3894
4009
  turnState(): 'working' | 'idle';
3895
4010
  onTurnEnd(listener: (reason: StructuredTurnEnd) => void): void;
3896
4011
  onEvent(listener: (event: StructuredEvent) => void): void;
@@ -4334,8 +4449,18 @@ declare const STATE_DIR_IGNORE = "*\n!.gitignore\n!skills/\n!skills/**\n";
4334
4449
  */
4335
4450
  declare function ensureStateDirIgnored(baseDir?: string): void;
4336
4451
 
4337
- declare function saveState(plan: LegacyPlanState, baseDir?: string): void;
4338
- declare function loadState(baseDir?: string, logger?: ILogger): LegacyPlanState | null;
4452
+ /**
4453
+ * The restore state a surface reopens on start. The session id sits beside the
4454
+ * plan, not on it, so it never travels into a session file's `plan`; without
4455
+ * it a restore would persist under a freshly minted id and fork the session.
4456
+ */
4457
+ interface SavedState {
4458
+ plan: LegacyPlanState;
4459
+ /** Absent in a state file written before the id was kept. */
4460
+ sessionId?: string;
4461
+ }
4462
+ declare function saveState(plan: LegacyPlanState, baseDir?: string, sessionId?: string): void;
4463
+ declare function loadState(baseDir?: string, logger?: ILogger): SavedState | null;
4339
4464
  declare function clearState(baseDir?: string): void;
4340
4465
  declare function stateExists(baseDir?: string): boolean;
4341
4466
 
@@ -4425,4 +4550,4 @@ declare const DEFAULT_MAX_PARALLEL = 5;
4425
4550
  */
4426
4551
  declare function parseMaxParallel(value: unknown): number | null;
4427
4552
 
4428
- export { ALL_PROVIDERS, AbstractRunner, AbstractRunnerSession, type Adr0013IsolationRun, type Adr0013PlanIsolation, type Adr0013TaskRecord, AgentAdapter, AgentEvent, AgentProcessDeps, AgentStartOptions, AiProvider, AlreadyExecutingError, ApprovalAnswer, ApprovalDecision, ApprovalModeSetting, ApprovalPolicy, AssignmentScope, BaseAiService, BaseConfig, BaseFileSystem, BufferedTaskOutputSource, type ByPlannerBackend, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CODEX_SANDBOX_DOCS, CODEX_SANDBOX_OFF_LINE, type CachedPage, type CappedRows, CheckpointAnswer, type CheckpointListener, ClaudeCodeAdapter, CodexAdapter, CodexSandboxAvailability, CommandLineTooLongError, type CommandOutcome, type CommandPayload, type ConfiguredPlanner, type Consent, ConsoleLogger, ContextCollector, type Continuability, ConversationCompaction, type ConversationFork, ConversationRequest, type ConversationRewind, ConversationTurn, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DEFAULT_MAX_PARALLEL, type DirEntry, DiscoveredModel, DuckDuckGoSearchProvider, EmbeddedNewlineError, type EnvAdmission, EnvConfig, type ExecImpl, ExecutableNotFoundError, ExecutionActor, type ExecutionCommand, ExecutionCommandName, ExecutionCommands, type ExecutionHost, ExecutionRecord, FindSymbolOptions, GREP_PCRE_PROBE_ARGS, GeminiService, type GitExecFn, GlobOptions, GlobalRunSettings, type GrepInvocation, GrepOptions, type GrepRegex, GuardTarget, GuardTrip, HARNESS_PLANNER_REASON, type HasBinFn, HttpWebFetcher, type HttpWebFetcherOptions, IAiService, IApproval, IConfig, IFileSystem, type ILogger, INotification, IRunner, IRunnerSession, type ISearchProvider, IWorktreeIsolation, IsolationLandedTask, IsolationMergeResult, IsolationTaskStatus, IsolationView, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, LiveTail, LiveTailOptions, type LoopGuard, type MappedTool, type MergeWordingHandoff, ModelResolver, type ModelResolverDeps, NoPlanError, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OpenAiService, OpenCodeAdapter, OrchestratorObserver, OrchestratorOption, OrdewellMcpServer, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, PendingApproval, PendingApprovals, PlanEditError, PlanIsolation, type PlanRequest, PlanState, PlanStore, Planner, type PlannerBackendEntry, PlannerBackendId, type PlannerChoice, PlannerModelCandidate, type PlannerModelLookup, PlannerModelRecall, type PlannerModelSource, PlannerModelStore, type PlannerSelectionChange, type PlannerSelectionCurrent, type PlannerSelectionResult, type PlannerSelectionState, PlannerToolHandler, type PlannerUsability, PlannerUsage, type PrdBlock, ProviderModelLists, type ProviderRegistration, QueuedTaskMessage, ReadFileOpts, type ResearchChat, ResearchLogEntry, ResearchShell, type ResearchTurn, type ResolvedChoice, type ResolvedPlanner, RewindTarget, RunMergeView, RunView, RunnerApprovals, RunnerCommand, RunnerId, RunnerInstallation, RunnerManifest, RunnerModeInfo, RunnerRegistry, RunnerSessionCost, type RunnerSpawnOptions, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STATE_DIR_IGNORE, STOPPED_TOOL_RESULT, SUPERVISOR_LEVELS, SYMBOL_LANGUAGES, type SaveSession, type SearchHit, type SearchOutcome, type SearchPage, type SearchTransport, Session, SessionBroadcaster, type SessionDeps, SessionMessage, SessionMeta, SessionNotFoundError, SessionNotice, type SessionPlanner, type SessionRuntimeSettings, SkillsService, type SpawnSpec, StartAdmission, StdioAgentAdapter, StructuredEvent, StructuredRunner, type StructuredRunnerDeps, StructuredSession, StructuredTurnEnd, SupervisorLevel, type SupervisorPolicy, Task, TaskCompleteArgs, TaskLogEvent, type TaskLogFile, type TaskLogLocation, TaskLogRecorder, type TaskLogRecorderDeps, TaskMessageFrom, TaskModeAgentAdapter, TaskOrchestrator, TaskOutputSource, TaskQueryCatalog, TaskRunnerFlags, TaskStartOptions, TaskTokenScope, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, UsageRecord, UserSettings, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, WebRead, WebReadDecision, type WebResponse, WebResponseCache, type WebResponseCacheOptions, type WebTransport, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, type WorktreeIsolationDeps, admitSettingsEnv, applyHeadLimit, assertWorkspaceExists, assertWorkspaceIsProject, augmentedPath, bearerHeaderValue, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, canContinue, checkoutRule, clearAugmentedPathCache, clearDaemonToken, clearState, clipboardCopyCommand, codexSandboxNotice, configuredProviders, continuability, createSession, createTaskAdapter, createWorktreeIsolation, daemonTokenPath, defaultEnabledRunners, defaultLogger, definitionPattern, deleteSession, describeMergeResult, detectInstalledPlanner, discoverGeminiModels, ensureDir, ensurePrivateDir, ensureStateDirIgnored, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, findInstalledPlanner, formatSearchOutput, getLatestSession, getProviderMeta, getStateDir, globalDataDir, grantScopeFor, grepRegexFromProbe, idSegment, includeGlobFor, installedPlannerAnswered, installedPlannerDetected, isApiProvider, isCliProvider, isExecutableResolved, isOpenAiProvider, isPlannerBackend, isRepoGroup, isVendorModelFor, killTree, languageForId, listSessions, listTaskLogAttempts, listTree, loadSession, loadSessionPlanState, loadState, looksLikeChallenge, mapAgentTool, mergeTarget, migrateOldConfigDir, migratePlanIsolation, mintDaemonToken, mintSessionId, normalizeAgentArgs, normalizeGeminiModel, openTaskLog, parseMaxParallel, parseSearchHits, planDirectLaunch, plannerBackendEntries, prefixModelId, providerForRunner, readDaemonToken, readTaskLog, recordInstalledPlanner, recordedInstalledPlanner, referencePattern, removedPluginNotice, reposWithWork, resetInstalledPlanner, resolveProviderFromPrefix, resolveTaskRunnerFlags, resolveWithin, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, selectPlanner, sessionDataDir, sessionRuntimeSettings, sharedSearchProvider, sharedWebResponseCache, stateExists, stripAnsi, stripModelPrefix, supportsTaskMode, tokenSubprotocols, tokensMatch, wellKnownBinDirs, windowsCommandLine, withPath, writePrivateFile };
4553
+ export { ALL_PROVIDERS, AbstractRunner, AbstractRunnerSession, type Adr0013IsolationRun, type Adr0013PlanIsolation, type Adr0013TaskRecord, AgentAdapter, AgentEvent, AgentProcessDeps, AgentStartOptions, AiProvider, AlreadyExecutingError, ApprovalAnswer, ApprovalDecision, ApprovalModeSetting, ApprovalPolicy, AssignmentScope, BaseAiService, BaseConfig, BaseFileSystem, BufferedTaskOutputSource, type ByPlannerBackend, CLAUDE_CODE_MANIFEST, CLI_PROVIDERS, CMD_EXE_MAX_COMMAND_LINE, CODEX_SANDBOX_DOCS, CODEX_SANDBOX_OFF_LINE, type CachedPage, type CappedRows, CheckpointAnswer, type CheckpointListener, ClaudeCodeAdapter, CodexAdapter, CodexSandboxAvailability, CommandLineTooLongError, type CommandOutcome, type CommandPayload, type ConfiguredPlanner, type Consent, ConsoleLogger, ContextCollector, type Continuability, ConversationCompaction, type ConversationFork, ConversationRequest, type ConversationRewind, ConversationTurn, DAEMON_SUBPROTOCOL, DAEMON_TOKEN_SUBPROTOCOL_PREFIX, DEFAULT_MAX_PARALLEL, type DirEntry, DiscoveredModel, DuckDuckGoSearchProvider, EmbeddedNewlineError, type EnvAdmission, EnvConfig, type ExecImpl, ExecutableNotFoundError, ExecutionActor, type ExecutionCommand, ExecutionCommandName, ExecutionCommands, type ExecutionHost, ExecutionRecord, FindSymbolOptions, GREP_PCRE_PROBE_ARGS, GeminiService, type GitExecFn, GlobOptions, GlobalRunSettings, type GrepInvocation, GrepOptions, type GrepRegex, GuardTarget, GuardTrip, HARNESS_PLANNER_REASON, type HasBinFn, HttpWebFetcher, type HttpWebFetcherOptions, IAiService, IApproval, IConfig, IFileSystem, type ILogger, INotification, IRunner, IRunnerSession, type ISearchProvider, IWorktreeIsolation, IsolationLandedTask, IsolationMergeResult, IsolationTaskStatus, IsolationView, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LegacyPlanState, LiveTail, LiveTailOptions, type LoopGuard, type MappedTool, type MergeWordingHandoff, ModelResolver, type ModelResolverDeps, NoPlanError, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OpenAiService, OpenCodeAdapter, OrchestratorObserver, OrchestratorOption, OrdewellMcpServer, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, PendingApproval, PendingApprovals, PlanEditError, PlanIsolation, type PlanRequest, PlanState, PlanStore, Planner, type PlannerBackendEntry, PlannerBackendId, type PlannerChoice, PlannerModelCandidate, type PlannerModelLookup, PlannerModelRecall, type PlannerModelSource, PlannerModelStore, type PlannerSelectionChange, type PlannerSelectionCurrent, type PlannerSelectionResult, type PlannerSelectionState, PlannerToolHandler, type PlannerUsability, PlannerUsage, type PrdBlock, ProviderModelLists, type ProviderRegistration, QueuedTaskMessage, ReadFileOpts, ReportedWindow, type ResearchChat, ResearchLogEntry, ResearchShell, type ResearchTurn, type ResolvedChoice, type ResolvedPlanner, RewindTarget, RunMergeView, RunView, RunnerApprovals, RunnerCommand, RunnerId, RunnerInstallation, RunnerManifest, RunnerModeInfo, RunnerRegistry, RunnerSessionCost, type RunnerSpawnOptions, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STATE_DIR_IGNORE, STOPPED_TOOL_RESULT, SUPERVISOR_LEVELS, SYMBOL_LANGUAGES, type SaveSession, type SavedState, type SearchHit, type SearchOutcome, type SearchPage, type SearchTransport, Session, SessionBroadcaster, type SessionDeps, SessionMessage, SessionMeta, SessionNotFoundError, SessionNotice, type SessionPlanner, type SessionRuntimeSettings, SkillsService, type SpawnSpec, StartAdmission, StdioAgentAdapter, StructuredEvent, StructuredRunner, type StructuredRunnerDeps, StructuredSession, StructuredTurnEnd, SupervisorLevel, type SupervisorPolicy, Task, TaskCompleteArgs, TaskLogEvent, type TaskLogFile, type TaskLogLocation, TaskLogRecorder, type TaskLogRecorderDeps, TaskMessageFrom, TaskModeAgentAdapter, TaskOrchestrator, TaskOutputSource, TaskQueryCatalog, TaskRunnerFlags, TaskStartOptions, TaskTokenScope, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, UsageRecord, UserSettings, VerdictEngine, type VerdictListener, WINDOWS_MAX_COMMAND_LINE, WebRead, WebReadDecision, type WebResponse, WebResponseCache, type WebResponseCacheOptions, type WebTransport, type WorkspaceCheckDeps, WorkspaceNotAProjectError, WorkspaceNotFoundError, type WorkspaceProjectCheckDeps, type WorktreeIsolationDeps, admitSettingsEnv, applyHeadLimit, assertWorkspaceExists, assertWorkspaceIsProject, augmentedPath, bearerHeaderValue, buildFallbackGrepArgs, buildGlobArgs, buildGrepArgs, canContinue, checkoutRule, clearAugmentedPathCache, clearDaemonToken, clearState, clipboardCopyCommand, codexSandboxNotice, configuredProviders, continuability, createSession, createTaskAdapter, createWorktreeIsolation, daemonTokenPath, defaultEnabledRunners, defaultLogger, definitionPattern, deleteSession, describeMergeResult, detectInstalledPlanner, discoverGeminiModels, ensureDir, ensurePrivateDir, ensureStateDirIgnored, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, findInstalledPlanner, formatSearchOutput, getLatestSession, getProviderMeta, getStateDir, globalDataDir, grantScopeFor, grepRegexFromProbe, idSegment, includeGlobFor, installedPlannerAnswered, installedPlannerDetected, isApiProvider, isCliProvider, isExecutableResolved, isOpenAiProvider, isPlannerBackend, isRepoGroup, isVendorModelFor, killTree, languageForId, listSessions, listTaskLogAttempts, listTree, loadSession, loadSessionPlanState, loadState, looksLikeChallenge, mapAgentTool, mergeTarget, migrateOldConfigDir, migratePlanIsolation, mintDaemonToken, mintSessionId, normalizeAgentArgs, normalizeGeminiModel, openTaskLog, parseMaxParallel, parseSearchHits, planDirectLaunch, plannerBackendEntries, prefixModelId, providerForRunner, readDaemonToken, readTaskLog, recordInstalledPlanner, recordedInstalledPlanner, referencePattern, removedPluginNotice, reposWithWork, resetInstalledPlanner, resolveProviderFromPrefix, resolveTaskRunnerFlags, resolveWithin, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveSession, saveState, selectPlanner, sessionDataDir, sessionRuntimeSettings, sharedSearchProvider, sharedWebResponseCache, stateExists, stripAnsi, stripModelPrefix, supportsTaskMode, tokenSubprotocols, tokensMatch, wellKnownBinDirs, windowsCommandLine, withPath, writePrivateFile };