@ordewell/core 0.12.0 → 0.12.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/dist/{ModeResolver-CHsaoV7M.d.ts → ModeResolver-B64aUZXJ.d.ts} +1 -1
- package/dist/{ModeResolver-b_7bPlBS.d.mts → ModeResolver-CA2fUU9h.d.mts} +1 -1
- package/dist/{Task-BTEH-ztX.d.mts → Task-CxGgN6I0.d.mts} +503 -16
- package/dist/{Task-BTEH-ztX.d.ts → Task-CxGgN6I0.d.ts} +503 -16
- package/dist/{chunk-BKTDYGIP.mjs → chunk-2IFKPYPO.mjs} +441 -17
- package/dist/chunk-2IFKPYPO.mjs.map +1 -0
- package/dist/{chunk-BFLVOYNR.mjs → chunk-FX33UKAD.mjs} +8 -6
- package/dist/chunk-FX33UKAD.mjs.map +1 -0
- package/dist/{chunk-F6WS3JLQ.mjs → chunk-PKJTN2PD.mjs} +20 -11
- package/dist/chunk-PKJTN2PD.mjs.map +1 -0
- package/dist/{chunk-HP2LNKST.mjs → chunk-RZ23BMVR.mjs} +345 -134
- package/dist/chunk-RZ23BMVR.mjs.map +1 -0
- package/dist/chunk-UDUATSCJ.mjs +48 -0
- package/dist/chunk-UDUATSCJ.mjs.map +1 -0
- package/dist/{IRunner-BwzyUVIL.d.mts → eventStore-CTCSKS9E.d.ts} +916 -129
- package/dist/{IRunner-DjJkYwko.d.ts → eventStore-CcB8yELZ.d.mts} +916 -129
- package/dist/index.d.mts +677 -97
- package/dist/index.d.ts +677 -97
- package/dist/index.js +8233 -2450
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6951 -1772
- package/dist/index.mjs.map +1 -1
- package/dist/parsing.d.mts +2 -2
- package/dist/parsing.d.ts +2 -2
- package/dist/parsing.js +277 -21
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -3
- package/dist/plan-utils.d.mts +8 -5
- package/dist/plan-utils.d.ts +8 -5
- package/dist/plan-utils.js +129 -16
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +17 -3
- package/dist/{runSettingsText-x-YML2ay.d.mts → runSettingsText-DFVpe6aU.d.mts} +1142 -934
- package/dist/{runSettingsText-CvZ40IPv.d.ts → runSettingsText-lKLDsyli.d.ts} +1142 -934
- package/dist/testing.d.mts +83 -4
- package/dist/testing.d.ts +83 -4
- package/dist/testing.js +142 -1
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +126 -2
- package/dist/testing.mjs.map +1 -1
- package/docker/task.Dockerfile +22 -0
- package/package.json +2 -1
- package/skills/diagnose/SKILL.md +2 -2
- package/skills/explore/SKILL.md +1 -1
- package/dist/chunk-BFLVOYNR.mjs.map +0 -1
- package/dist/chunk-BKTDYGIP.mjs.map +0 -1
- package/dist/chunk-F6WS3JLQ.mjs.map +0 -1
- package/dist/chunk-HP2LNKST.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ApprovalRecord, a as AttemptUsage, b as AwaitingReason, B as BUILTIN_SKILL_NAMES,
|
|
3
|
-
import {
|
|
4
|
-
export { A as
|
|
5
|
-
import {
|
|
6
|
-
export { A as
|
|
7
|
-
import { R as RunnerModeInfo } from './ModeResolver-
|
|
8
|
-
export { a as autonomyLevelLabel, p as parseAutonomyFlag, b as parseAutonomyLevel, r as runnerModesFrom } from './ModeResolver-
|
|
1
|
+
import { b3 as RunnerId, aX as ResearchProgress, bG as UsageRecord, aW as ResearchLogEntry, bp as Task, p as DiscoveredModel, S as IIsolationPreview, T as IWorktreeIsolation, a6 as IsolationRemoval, af as IsolationTaskStatus, ag as IsolationView, ax as PlanIsolation, aj as LegacyPlanState, b4 as RunnerSessionCost, I as HandoffCheck, bn as SubtreeReport, d as ChildTaskCounts, bJ as VerificationCheck, aV as ReportedWindow, aG as PlannerUsage, o as DelegatedRow, bz as TaskSkillSnapshot, bk as SkillsService, at as NodeAuthority, q as ExecutionActor, am as Mandate, aq as MandateRequest, bA as TaskSnapshot, ay as PlanState, bI as Verdict, bl as StoredHandoff, b7 as ScriptBody } from './Task-CxGgN6I0.mjs';
|
|
2
|
+
export { A as ApprovalRecord, a as AttemptUsage, b as AwaitingReason, B as BUILTIN_SKILL_NAMES, c as BelowPlan, e as CommandWords, f as ContextCheckpoint, g as ContextFill, h as ConversationMessage, i as CostProvenance, D as DEFAULT_LOOP_ROUNDS, j as DEFAULT_PLANNER_ALLOWLIST, k as DEFAULT_RUNNERS, l as DEFAULT_SCRIPT_TIMEOUT_MS, m as DEFAULT_SUPERVISOR_RETRY_LIMIT, n as DIGEST_FINDINGS, E as EffectRules, r as ExecutionCommandName, s as ExecutionRecord, F as FLOOR_GRANTS, t as FindingSeverity, G as GRANTS, u as Grant, v as GuardTarget, w as GuardTrip, H as HANDOFF_LIMITS, x as HANDOFF_PUSH_CHARS, y as Handoff, z as HandoffArtifact, J as HandoffCommit, K as HandoffDigest, L as HandoffEvidence, M as HandoffFinding, N as HandoffLogs, O as HandoffPatch, P as HandoffPins, Q as HandoffPreviewOptions, R as HandoffTaskName, U as IntegrationDisposal, V as InvalidSkill, W as IsolationAvailability, X as IsolationHandoff, Y as IsolationHandoffRepo, Z as IsolationInactiveReason, _ as IsolationLandedTask, $ as IsolationLanding, a0 as IsolationMergeBlock, a1 as IsolationMergeBlockReason, a2 as IsolationMergeResult, a3 as IsolationOutcome, a4 as IsolationPreview, a5 as IsolationPruneResult, a7 as IsolationRepo, a8 as IsolationRepoRevert, a9 as IsolationRevertResult, aa as IsolationRevertTask, ab as IsolationRun, ac as IsolationTaskRecord, ad as IsolationTaskRef, ae as IsolationTaskRepo, ah as LandedTask, ai as LandedWork, ak as LoopSubject, al as MAX_LOOP_ROUNDS, an as MandateExclusions, ao as MandateLimits, ap as MandateRefusal, ar as ModelUsage, as as Narrowed, au as PatchFlag, av as PatchView, az as PlanStatus, aA as PlanUsage, aB as PlannerAllowlist, aC as PlannerCompaction, aD as PlannerCompactionOutcome, aE as PlannerContextPause, aF as PlannerResendState, aH as PrepareIntent, aI as PreparedTask, aJ as PreservedWork, aK as PreviewRepo, aL as PreviousWork, aM as REPORT_MAX_CHARS, aN as ROOT_NODE, aO as RefusedRemoval, aP as RepairEvidence, aQ as RepairWait, aR as ReplyRun, aS as RepoGroupLayout, aT as RepoHead, aU as ReportItem, aY as ResearchStep, aZ as ResearchStepOutcome, a$ as RevertCommand, b0 as RevertWatch, b1 as RootSettings, b2 as RunSettings, b5 as SEVERITY_LABEL, b6 as SHAPE_LIMITS, b8 as ScriptConsent, b9 as ScriptResult, ba as SessionBilling, bb as SetupFailure, bc as ShadowedSkill, bd as SkillAppliesTo, be as SkillCatalog, bf as SkillInfo, bg as SkillLoad, bh as SkillLoadNotice, bi as SkillMetadata, bj as SkillSource, bo as SupervisorLevel, bs as TaskEvidence, bt as TaskIsolation, bu as TaskIsolationState, bv as TaskLoop, bw as TaskModelAssignment, bB as TaskStatus, bC as TaskType, bD as TaskUsageSummary, bE as TreeSnapshot, bF as UsageLine, bH as UsageTotals, bK as WrittenTaskRef, bL as actorAuthority, bM as addAttemptUsage, bN as addModelUsage, bO as addPlannerUsage, bP as addUsage, bQ as addUsageTotals, bR as artifactLines, bS as betweenRounds, bT as boundedHandoffLines, bU as byteSize, bV as checkHandoff, bW as checkOf, bX as commandAllowedBy, bY as commandLine, bZ as contextMeterText, b_ as contextMeterTitle, b$ as costText, c0 as countedSessionCost, c1 as createEmptyPlan, c2 as createSkillsService, c3 as createTask, c4 as effectRuleFor, c5 as endAttemptUsage, c6 as findingLines, c7 as findingRefText, c8 as flattenTasks, c9 as flattenTasksWithParents, ca as formatCost, cb as formatTokenCount, cc as handoffDigest, cd as handoffLines, ce as handoffPreviewLines, cf as handoffReferenceText, cg as handoffWakeLines, ch as heldHandoff, ci as heldMandate, cj as heldWords, ck as inLoop, cl as isAwaitingReason, cm as isMeasured, cn as isSupervisorLevel, co as isUserMessage, cp as loopRemovalRefusal, cq as loopRoundOf, cr as mandateRefusalText, cs as migratePlanState, ct as modelCostTitle, cu as namedHandoff, cv as narrow, cw as nodeText, cx as openingLines, cy as outOfRounds, cz as parseAllowlist, cA as parseEffectAllowlist, cB as parseFindingRef, cC as parsePlanPath, cD as partedPromptUsage, cE as patchChangesText, cF as patchFlagText, cG as patchLines, cH as patchLinesText, cI as patchText, cJ as patchView, cK as pausedOnLimit, cL as pinReference, cM as planUsage, cN as plannerContextFill, cO as readableTaskIds, cP as rejoinPlanTree, cQ as removedAttempt, cR as resolveWrittenRef, cS as resumedSessionWindow, cT as rootAuthority, cU as rootMandate, cV as savedPatchOf, cW as savedPatchView, cX as savedPatchViews, cY as scopeAllowed, cZ as scriptBodyOf, c_ as scriptBodyText, c$ as scriptTaskText, d0 as severityLabel, d1 as spentTokens, d2 as startAttemptUsage, d3 as storedHandoff, d4 as subagentCostTitle, d5 as taskUsageSummary, d6 as tasksTotalText, d7 as timeLimitText, d8 as toolAllowed, d9 as usageLine, da as usageText, db as waitsForApproval, dc as withPatch, dd as wordsFrom, de as worstSeverity } from './Task-CxGgN6I0.mjs';
|
|
3
|
+
import { V as IConfig, W as IFileSystem, aE as PlannerToolHandler, ay as PlannerModes, aB as PlannerShellSandbox, aP as ResearchShell, U as IApproval, aN as ReadFileOpts, bO as ToolOutcome, Q as GrepOptions, bn as ShellLaunch, P as GlobOptions, M as FindSymbolOptions, B as BashOptions, bJ as TaskShellSite, bI as TaskShell, Z as IRunner, ax as PlannerBackendId, aI as ProviderModelLists, f as AiProvider, n as ApprovalModeSetting, b6 as RunnerRegistry, a_ as RunnerEnv, aq as OrchestratorOption, d as AgentProcessDeps, bB as TaskModeAgentAdapter, e as AgentStartOptions, a as AgentAdapter, c as AgentEvent, aX as RunnerCommand$1, s as AttachState, k as ApprovalDecision, aG as ProjectMcpServer, _ as IRunnerSession, bs as StructuredTurnEnd, br as StructuredEvent, bA as TaskMessageFrom, aK as QueuedTaskMessage, by as TaskCompleteArgs, x as CheckpointAnswer, be as ScriptExit, af as McpToolReply, X as ILogger, Y as INotification, bG as TaskRunnerConfig, a1 as IsolationRunController, o as ApprovalPolicy, J as EventStore, j as ApprovalAnswer, ap as OpenLease, aF as PostArgs, aO as ReadTaskArgs, ar as OrdewellMcpServer, bK as TaskStartOptions, bL as TaskTokenScope, bN as TaskWebReads, i as ApplyPatchArgs, b5 as RunnerPlacement, b0 as RunnerManifest, bH as TaskRunnerFlags } from './eventStore-CcB8yELZ.mjs';
|
|
4
|
+
export { A as AUTO_COMMANDS, b as AgentAdapterFactory, g as AllProviderModels, h as AnswerApprovalArgs, l as ApprovalKind, m as ApprovalMode, p as ApprovalPolicyOptions, q as ApprovalRequest, r as ApprovalSource, C as CatalogModel, y as CheckpointArgs, z as ChildSessionPlace, D as CommandClassification, E as CommandTier, F as ConsoleLogger, G as DENY_ALL, H as DiscoveryCommand, I as EditPlanArgs, L as FetchAllProviderModelsOptions, N as GIT_READONLY_SUBCOMMANDS, O as GREP_DEFAULT_HEAD_LIMIT, R as GrepOutputMode, $ as InvokedCommand, a6 as LineBuffer, a7 as ListModelsArgs, a8 as ListRunnersArgs, a9 as LoadSkillArgs, aa as McpClientConfig, ab as McpCredential, ac as McpRefusal, ad as McpTool, ae as McpToolContext, ag as MessageTaskArgs, ah as ModelCatalog, ai as ModelShortcut, ak as NotificationAction, al as ORCHESTRATOR_SHORTCUTS, am as ORDEWELL_MCP_PATH, an as ORDEWELL_MCP_SERVER_NAME, ao as OneTaskArgs, as as OwnSealedRuns, at as OwnerOnlyFile, au as PLANNER_EXECUTION_TOOLS, av as PLANNER_SANDBOX_DOCS, aw as PLANNER_TOOLS, az as PlannerSandboxAvailability, aA as PlannerSandboxDeps, aC as PlannerStartOptions, aD as PlannerTokenScope, aH as ProviderCredentialSource, aJ as ProviderModelsResult, aL as READ_ONLY_TASK_TOOLS, aM as REFUSED_COMMANDS, aQ as ResearchShellDeps, aS as RetryTaskArgs, aT as RunCommandArgs, aU as RunPlanArgs, aV as RunnerAuthSpec, aW as RunnerAuthStatus, aY as RunnerCommandKind, aZ as RunnerEntry, a$ as RunnerFeatures, b1 as RunnerMcpServer, b2 as RunnerMode, b3 as RunnerModelDiscovery, b4 as RunnerModelRef, b7 as SEALED_LIMITS, b8 as SEARCH_EXCLUSIONS, b9 as SandboxBackend, ba as SandboxInvocation, bb as SandboxLaunch, bc as SandboxLimits, bd as SandboxProfile, bf as ScriptFullOutput, bg as ScriptRun, bh as ScriptStatus, bi as SealedAvailability, bj as SealedRunOptions, bk as SessionData, bl as SessionMeta, bm as ShellDialect, bp as SpawnFn, bq as StandingDecision, bt as SubmitPlanArgs, bu as TASK_COMPLETE_TOOL, bv as TASK_COMPLETION_CONTRACT, bw as TASK_SEALED_LIMITS, bx as TASK_TOOLS, bz as TaskDiffArgs, bC as TaskModeUnsupportedError, bD as TaskOutputArgs, bE as TaskQueryArgs, bF as TaskRunCommandArgs, bM as TaskToolHandler, bS as approvalScopes, bT as classifyCommand, bU as clearPlannerSandboxCache, bV as clearResearchShellCache, bW as collectProviderCredentials, bX as defaultLogger, bY as deleteSession, bZ as effectiveApprovalMode, b_ as enabledRunners, b$ as fetchAllProviderModels, c0 as findRunnerCommand, c1 as getLatestSession, c2 as idSegment, c3 as isGranted, c4 as isRunnerApproval, c5 as knownModelId, c6 as listChildSessions, c7 as listSessions, c8 as loadChildSession, c9 as loadSession, ca as loadSessionPlanState, cb as mcpClientConfig, cc as ownerOnlyConfigFile, cd as parseApprovalModeSetting, ce as plannerToolSet, cf as researchShellWarning, cg as researchToolsPath, ch as resolveModelShortcut, ci as resolvePlannerSandbox, cj as resolveProvider, ck as resolveResearchShell, cl as saveChildSession, cm as saveSession, cn as sessionDataDir, co as sharedMcpServer, cp as taskCompletionContract, cq as taskToolSet, cr as toApprovalDecision, cs as toOrchestratorOptions, ct as toolListing } from './eventStore-CcB8yELZ.mjs';
|
|
5
|
+
import { dw as TurnBudgets, be as PlanIntake, ay as IWebFetcher, X as ConversationTurn, bH as ResolveAll, dF as WebReadPolicy, dC as WebRead, dD as WebReadDecision, dE as WebReadOptions, ba as PendingApprovals, aw as IAiService, bk as PlannerContextDeps, bl as PlannerContextStatus, O as ContextCondenseRequest, V as ConversationRequest, bo as PlannerModelCandidate, bY as RunnerAuthExec, bX as RunnerAuth, b as AccountLimitBucket, c as AccountLimitSnapshot, u as AssignmentWriter, t as AssignmentScope, d7 as TaskQueryCatalog, r as AssignmentCatalog, b$ as RunnerCatalog, cj as SessionMessage, cc as SessionBroadcaster, ck as SessionNotice, bi as PlanStore, d1 as TaskOrchestrator, ac as Escalation, b5 as OrchestratorObserver, cS as TaskLogEvent, ce as SessionHeld, cs as SlotPool, a$ as NodeBudget, bG as ResearchTasks, ar as GlobalRunSettings, cg as SessionLease, bn as PlannerConversationHost, bm as PlannerConversation, cz as SubplannerBrief, al as ExecutionCommand, H as CommandOutcome, b9 as PendingApproval, du as TreeLedger, z as Carved, a_ as NodeBoard, cA as Subtree, R as ConversationCompaction, bN as RewindTarget, bW as RunView, da as TaskRevertPreview, bR as RunMergeView, bP as RunActivity, d4 as TaskOutputSource, aF as LeaseHost, d3 as TaskOrchestratorOptions, dz as UserSettings, aK as LiveTailOptions, aJ as LiveTail, bs as PlannerModelStore, br as PlannerModelRecall } from './runSettingsText-DFVpe6aU.mjs';
|
|
6
|
+
export { A as ACT_RISK, a as AUTORUN_RISK, d as AccountLimitStatus, e as AccountLimitWindow, f as AccountLimitsFrame, g as AccountLimitsMessage, h as AdoptSessionResponse, i as AnswerEscalationRequest, j as ApplyTaskOpsResult, k as ApprovalAnswerResponse, l as ApprovalBlock, m as ApprovalRequestMessage, n as ApprovalStatus, o as ApprovalsResponse, p as ApproveReviewResponse, q as AskOptions, s as AssignmentIssue, v as AutoMergeTrigger, B as BlockingSubject, C as CHAT_COMMANDS, w as CHECKPOINT_TRUNCATE_LENGTH, x as CancelPlanningResponse, y as CancelResumeResponse, D as CliAgentAiService, E as CliAgentAiServiceDeps, F as CommandBlock, G as CommandDescriptor, I as CommandPayload, J as CommandStatus, K as CommandsResponse, L as CompactionBlock, M as CompactionStatus, N as Consent, P as ConversationBusyError, Q as ConversationCompactResponse, S as ConversationEditError, T as ConversationForkResponse, U as ConversationInput, W as ConversationRewindResponse, Y as ConversationView, Z as DEFAULT_WEB_READ_BUDGET, _ as DELEGATION_OFFERED, $ as DELEGATION_RISK, a0 as DaemonErrorCode, a1 as DecideOptions, a2 as DiffRow, a3 as DiffRowKind, a4 as DiffStat, a5 as DisplayBlock, a6 as EMPTY_CONVERSATION, a7 as EMPTY_HOLD, a8 as EMPTY_RUN, a9 as EMPTY_TASK_LOG, aa as EMPTY_TASK_LOG_FOLLOW, ab as ErrorBody, ad as EscalationInput, ae as EscalationKind, af as EscalationOption, ag as EscalationOptionId, ah as EscalationRun, ai as EscalationsResponse, aj as ExecuteCommandResponse, ak as ExecuteResponse, am as ExecutionCommands, an as ExecutionHost, ao as ExecutionSummary, ap as GatedConversation, aq as GeneratePlanResponse, as as HEADLESS_CLI_COMMANDS, at as HandoffBlock, au as HandoffForkRepo, av as HandoffPeekSubject, ax as IDLE_ACTIVITY, az as IsolationDiffResponse, aA as IsolationMergeResponse, aB as IsolationPreviewNotice, aC as IsolationPreviewResponse, aD as LEASE_HEARTBEAT_MS, aE as LEASE_STALE_MS, aG as LeaseHostKind, aH as LeaseHostOptions, aI as LiveOutputLookup, aL as LocalEntry, aM as LoopCheckFacts, aN as LoopCheckState, aO as LoopGuard, aP as MappedTool, aQ as MarkdownToken, aR as MergeGateEntry, aS as MergeGateResponse, aT as MergeWordingHandoff, aU as MessageBlock, aV as MessageRole, aW as ModelsResponse, aX as NOT_STARTED, aY as NO_TURN, aZ as NewTaskFields, b0 as OUTPUT_LINES_DEFAULT, b1 as OUTPUT_LINES_MAX, b2 as OkResponse, b3 as OpRef, b4 as OpRefusal, b6 as OutputPreview, b7 as OverrideDirection, b8 as PLANNED_WITH_LABEL, bb as PendingApprovalsOptions, bc as PlanBlock, bd as PlanBlocks, bf as PlanMarkerStatus, bg as PlanResponse, bh as PlanSnapshot, bj as PlannerCommandSyntax, bp as PlannerModelChoice, bq as PlannerModelMemory, bt as PlannerNotReady, bu as PlannerNotReadyError, bv as PlannerReadinessConfig, bw as PlannerSubmission, bx as PlannerTurnDiscardedError, by as PlannerTurnStoppedError, bz as PlannerUsageLimitError, bA as PrdResponse, bB as PromptHold, bC as REPORT_PREVIEW_LINES, bD as RUN_SETTINGS_DEFAULTS, bE as ReadRunnerAuthOptions, bI as ResolveConflictResponse, bJ as RevertPreviewTask, bK as RevertRefusal, bL as RevertRefusalReason, bM as RevertScope, bO as RewindTargetsResponse, bQ as RunInput, bS as RunSettingsError, bT as RunSnapshotFrame, bU as RunTask, bV as RunTaskStatus, bZ as RunnerAuthExecOptions, b_ as RunnerAuthExecResult, c0 as RunnerLoadedBlock, c1 as RunnersResponse, c2 as STALLED_LABEL, c3 as STOPPED_BEFORE_START, c4 as STOPPING_LABEL, c5 as SUPERVISOR_LEVEL_LABEL, c6 as SerializedConversationMessage, c7 as SerializedPendingTurn, c8 as SerializedPlan, c9 as SerializedTask, ca as SerializedTaskStatus, cb as ServerInfoResponse, cd as SessionFrame, cf as SessionHeldError, ch as SessionLeaseRecord, ci as SessionListResponse, cl as SessionResponse, cm as SettingsResponse, cn as SettingsService, co as SettingsUpdateResponse, cp as SkillInvocation, cq as SkillLoadBlock, cr as SkillToken, ct as StartAdmission, cu as StopResponse, cv as StreamStamp, cw as SubagentBlock, cx as SubagentChild, cy as SubagentStatus, cB as SubtreeItemView, cC as SubtreeView, cD as SurfacePlan, cE as SurfacePlanState, cF as SurfaceTask, cG as TASK_QUERY_ANSWER_MAX_CHARS, cH as TASK_QUERY_ANSWER_OR_OPS, cI as TASK_QUERY_FIELDS, cJ as TASK_QUERY_PROTOCOL, cK as TASK_QUERY_REMINDER, cL as TERMINAL_UI_COMMANDS, cM as TakenPrompt, cN as TaskAction, cO as TaskActivity, cP as TaskAttemptSnapshot, cQ as TaskLogAttemptsResponse, cR as TaskLogBatch, cT as TaskLogFollow, cU as TaskLogFollowInput, cV as TaskLogHeaderKind, cW as TaskLogHeaderTask, cX as TaskLogHeaderUsage, cY as TaskLogHeaderView, cZ as TaskLogResponse, c_ as TaskLogView, c$ as TaskMessageResponse, d0 as TaskOp, d2 as TaskOrchestratorDeps, d5 as TaskPlacement, d6 as TaskQuery, d8 as TaskQueryField, d9 as TaskRef, db as TaskRevertPreviewResponse, dc as TaskRowAction, dd as TaskRowContext, de as TaskRowDelegated, df as TaskRowHandoff, dg as TaskRowIsolation, dh as TaskRowKind, di as TaskRowLoop, dj as TaskRowPlacement, dk as TaskRowSubject, dl as TaskRowUsage, dm as TaskRowView, dn as TaskRunFacts, dp as TaskStatusKind, dq as ThinkingDisplayBlock, dr as ToolBlock, ds as ToolHeadline, dt as ToolStatus, dv as TreeTask, dx as TurnGate, dy as UsageBlock, dA as WAITS_FOR_APPROVAL_LABEL, dB as WakeUpItem, dG as Worded, dH as WorkspacesResponse, dI as abbreviateHome, dJ as accountLimitPercentText, dK as accountLimitWindowLabel, dL as accountLimitsOf, dM as accountLimitsText, dN as accountLimitsTitle, dO as activityLabel, dP as aheadOfDraft, dQ as applyTaskOps, dR as approvalKindText, dS as approvalLabel, dT as approvalStatusText, dU as assignedRunnerOf, dV as assignmentIssue, dW as assignmentIssueText, dX as attachingLabel, dY as automergeSummary, dZ as autorunSummary, d_ as awaitingLabel, d$ as blockNotice, e0 as blockNotices, e1 as blockedByLabel, e2 as blockingFailures, e3 as canMergeTasks, e4 as canSetDependencies, e5 as canSplitTask, e6 as capConflictFiles, e7 as cardEditNeedsUnstarted, e8 as cardEditable, e9 as checkoutRule, ea as classifyOutcome, eb as closeTurn, ec as coalesceTaskLog, ed as compactionText, ee as confirmedOverride, ef as createAiService, eg as delegatedRowView, eh as delegationSummary, ei as dependencyCandidates, ej as dependentsNotice, ek as dependentsOf, el as describeHeld, em as describeHolder, en as describeIsolationPreview, eo as describeMergeResult, ep as describePlannerNotReady, eq as diffRows, er as diffStat, es as diffSummary, et as digestTaskLog, eu as drainNext, ev as editableWhileRunning, ew as elapsedSince, ex as escalations, ey as executionSummary, ez as followTaskLog, eA as followTurn, eB as formatElapsed, eC as fromTranscript, eD as getSettingsPath, eE as handoffBaseLine, eF as handoffBranchName, eG as handoffFindingsText, eH as handoffPeekParts, eI as hasAccountLimits, eJ as hasHiddenDetail, eK as hasLongReport, eL as holdLabel, eM as holdPrompt, eO as isRepoGroup, eP as isTaskRunning, eQ as lastServedModel, eR as loadedSkillTokens, eS as logContinues, eT as logResumes, eU as loopBodyLabel, eV as loopBodyRound, eW as loopCheckLabel, eX as loopCheckState, eY as loopLeaveNotice, eZ as loopRowParts, e_ as manualOverrideConfirmation, e$ as manualOverrideStopFirst, f0 as mapAgentTool, f1 as markAction, f2 as markdownHtml, f3 as markdownTokens, f4 as mergeOutcome, f5 as mergePastChecksConfirmation, f6 as mergeTarget, f7 as namedRepos, f8 as newTaskFields, f9 as noExecutorRefusal, fa as normalizeAgentArgs, fb as opRefusalText, fc as opsEditable, fd as outputLines, fe as outputPreview, ff as overrideNeedsConfirmation, fg as parseCount, fh as parseDelegation, fi as parseSwitch, fj as parseTaskOpsJson, fk as parseTaskQueryJson, fl as pastGateConfirmation, fm as planBlocks, fn as planMarkerParts, fo as plannerMessage, fp as plannerNotReady, fq as plannerNotReadyFor, fr as plannerTranscript, fs as processLeaseHost, ft as ranSealed, fu as readRunnerAuth, fv as receiptLabel, fw as reconcileApprovals, fx as recordRunnerAuth, fy as recordedRunnerAuth, fz as reduceConversation, fA as reduceRun, fB as reduceTaskLog, fC as renderTaskQueryAnswer, fD as repairWaitLabel, fE as repairedLanded, fF as repairedNotice, fG as repeatingChecks, fH as replayTaskLog, fI as repoBaseLine, fJ as repoResultLines, fK as reposWithWork, fL as resetRunnerAuth, fM as resolveSkillInvocation, fN as resolveTaskRef, fO as resolveUserTaskRef, fP as resumeLabel, fQ as resumeTime, fR as revertEffect, fS as revertListLine, fT as revertTaskRef, fU as runHoldsEditors, fV as runSettingsOf, fW as runnerToolSubject, fX as scriptExitText, fY as scriptRunText, fZ as secondsText, f_ as serializePlan, f$ as serializeTask, g0 as serializeTaskStatus, g1 as skillTokens, g2 as skippedLabel, g3 as stopTurn, g4 as subtreeIds, g5 as subtreeView, g6 as summarizeToolCall, g7 as supervisorSummary, g8 as surfacePlan, g9 as surfacePlanState, ga as takeAt, gb as taskActionCommand, gc as taskActivity, gd as taskChatAvailable, ge as taskLogCommands, gf as taskLogForSurface, gg as taskLogHeaderView, gh as taskOrderLabel, gi as taskPlacement, gj as taskQuerySignature, gk as taskRef, gl as taskRefOf, gm as taskRowActions, gn as taskRowView, go as taskStartedNotice, gp as taskStatusKind, gq as textHasTaskOps, gr as textHasTaskQuery, gs as titledRefs, gt as titledTaskRef, gu as titledTaskRefOf, gv as toTaskLogEvent, gw as toolHeadline, gx as trailerSummary, gy as trimToolOutput, gz as truncateCheckpointSummary, gA as unsendAll, gB as unsendLatest, gC as wakeUpItems, gD as walkPlan, gE as withoutSealedMark, gF as workspaceEnvOf } from './runSettingsText-DFVpe6aU.mjs';
|
|
7
|
+
import { R as RunnerModeInfo } from './ModeResolver-CA2fUU9h.mjs';
|
|
8
|
+
export { a as autonomyLevelLabel, p as parseAutonomyFlag, b as parseAutonomyLevel, r as runnerModesFrom } from './ModeResolver-CA2fUU9h.mjs';
|
|
9
9
|
import { WorkerOptions, Worker } from 'worker_threads';
|
|
10
10
|
import { ChildProcess } from 'child_process';
|
|
11
11
|
import { EventEmitter } from 'events';
|
|
@@ -14,6 +14,7 @@ import 'zod/v4';
|
|
|
14
14
|
type GitExecFn = (file: string, args: string[], opts: {
|
|
15
15
|
cwd?: string;
|
|
16
16
|
env: NodeJS.ProcessEnv;
|
|
17
|
+
input?: string;
|
|
17
18
|
}) => Promise<{
|
|
18
19
|
stdout: string;
|
|
19
20
|
stderr: string;
|
|
@@ -975,6 +976,8 @@ interface WorktreeIsolationDeps {
|
|
|
975
976
|
config: Pick<IConfig, 'worktreeIsolation' | 'worktreeSetupCommand' | 'workspaceRepos' | 'worktreeLinks'>;
|
|
976
977
|
/** Test seam: every git invocation goes through this. */
|
|
977
978
|
execFileImpl?: GitExecFn;
|
|
979
|
+
/** Every git call of this isolation runs with hooks off: what it lands came from a container (ADR-0059 L6). */
|
|
980
|
+
noHooks?: boolean;
|
|
978
981
|
resolvePath?: () => Promise<string>;
|
|
979
982
|
platform?: NodeJS.Platform;
|
|
980
983
|
mintRunId?: () => string;
|
|
@@ -985,6 +988,15 @@ interface WorktreeIsolationDeps {
|
|
|
985
988
|
declare function createIsolationPreview(deps: Pick<WorktreeIsolationDeps, 'config' | 'execFileImpl' | 'resolvePath'>): IIsolationPreview;
|
|
986
989
|
declare function createWorktreeIsolation(deps: WorktreeIsolationDeps): IWorktreeIsolation;
|
|
987
990
|
|
|
991
|
+
/**
|
|
992
|
+
* What deleting a root owes its children (ADR-0055 D11): `deleteSession` removes
|
|
993
|
+
* files and no worktree, and a child's run is named only by a file that goes
|
|
994
|
+
* with the root's, so each is discarded first as Session's `discardRun` does.
|
|
995
|
+
* Unlanded work is kept on a branch; what git could not let go is in `refused`,
|
|
996
|
+
* for the caller to stop on while the records still name it.
|
|
997
|
+
*/
|
|
998
|
+
declare function discardChildRuns(rootSessionId: string, baseDir: string, isolation: Pick<IWorktreeIsolation, 'discard'>): Promise<IsolationRemoval>;
|
|
999
|
+
|
|
988
1000
|
/** A task record as ADR-0013 persisted it, for one repository. */
|
|
989
1001
|
interface Adr0013TaskRecord {
|
|
990
1002
|
taskId: string;
|
|
@@ -1030,14 +1042,6 @@ declare function isolationViewOfPlan(plan: unknown, repairLimit?: number): Isola
|
|
|
1030
1042
|
/** Select runner configuration that can run code or redirect a launch from paths relative to the directory the runner starts in. */
|
|
1031
1043
|
declare function repositoryRunnerConfigPaths(paths: readonly string[]): string[];
|
|
1032
1044
|
|
|
1033
|
-
interface ILogger {
|
|
1034
|
-
warn(scope: string, message: string, err?: unknown): void;
|
|
1035
|
-
}
|
|
1036
|
-
declare class ConsoleLogger implements ILogger {
|
|
1037
|
-
warn(scope: string, message: string, err?: unknown): void;
|
|
1038
|
-
}
|
|
1039
|
-
declare const defaultLogger: ILogger;
|
|
1040
|
-
|
|
1041
1045
|
/** What a Gemini planner is built with beyond its config. */
|
|
1042
1046
|
interface GeminiServiceDeps extends PlannerContextDeps {
|
|
1043
1047
|
turnBudgets?: TurnBudgets;
|
|
@@ -1814,6 +1818,8 @@ interface RunnerCommand {
|
|
|
1814
1818
|
* workspace's, for a runner whose value merges into one of them.
|
|
1815
1819
|
*/
|
|
1816
1820
|
env?: (workspace: Record<string, string>) => Record<string, string>;
|
|
1821
|
+
/** Paths on this host, named in `args`, that the process reads, for a placement to bring along (ADR-0059 L5). */
|
|
1822
|
+
files?: readonly string[];
|
|
1817
1823
|
/**
|
|
1818
1824
|
* Names this launch must not inherit from the host or the workspace — the
|
|
1819
1825
|
* credentials a native-shell planner keeps out of its process (ADR-0036 N2.2).
|
|
@@ -1846,6 +1852,8 @@ declare class RunnerProcess {
|
|
|
1846
1852
|
private exitReported;
|
|
1847
1853
|
private stderrTail;
|
|
1848
1854
|
private spawnEnv;
|
|
1855
|
+
/** What a lease launched in this process's place, where one did (ADR-0059 L5). */
|
|
1856
|
+
private placed;
|
|
1849
1857
|
/** Stdout readers' end-of-stream flushes, for an end the pipe itself never reports. */
|
|
1850
1858
|
private readonly stdoutEnds;
|
|
1851
1859
|
constructor(deps: AgentProcessDeps);
|
|
@@ -1897,6 +1905,7 @@ declare class RunnerProcess {
|
|
|
1897
1905
|
*/
|
|
1898
1906
|
dispose(): void;
|
|
1899
1907
|
private end;
|
|
1908
|
+
private placedEnded;
|
|
1900
1909
|
private appendStderr;
|
|
1901
1910
|
}
|
|
1902
1911
|
|
|
@@ -2005,6 +2014,8 @@ interface SpawnSpec {
|
|
|
2005
2014
|
env?: Record<string, string>;
|
|
2006
2015
|
/** Names the launch must not inherit from the host or the workspace (ADR-0036 N2.2). */
|
|
2007
2016
|
envDrop?: (name: string) => boolean;
|
|
2017
|
+
/** Paths on this host, named in `args`, that the process reads. */
|
|
2018
|
+
files?: readonly string[];
|
|
2008
2019
|
}
|
|
2009
2020
|
/**
|
|
2010
2021
|
* Shared plumbing for the agents that speak newline-delimited JSON over stdio.
|
|
@@ -2187,6 +2198,8 @@ declare class ClaudeCodeAdapter extends StdioAgentAdapter implements TaskModeAge
|
|
|
2187
2198
|
private mainModel;
|
|
2188
2199
|
/** What the plan should say the task runs: its spawn's model, then each switch followed. */
|
|
2189
2200
|
private followedModel;
|
|
2201
|
+
/** The MCP configuration this process reads, on this host. */
|
|
2202
|
+
private configFile;
|
|
2190
2203
|
/**
|
|
2191
2204
|
* Model commands sent through the chat whose switch has not been seen yet,
|
|
2192
2205
|
* oldest first, each with the turns still to end before its own has. Several
|
|
@@ -3097,6 +3110,291 @@ declare class SessionCatalog {
|
|
|
3097
3110
|
}>;
|
|
3098
3111
|
}
|
|
3099
3112
|
|
|
3113
|
+
/** One source for the spawn options, so a runner built on this base cannot drift from the interface. */
|
|
3114
|
+
type RunnerSpawnOptions = Parameters<IRunner['spawn']>[0];
|
|
3115
|
+
declare abstract class AbstractRunnerSession implements IRunnerSession {
|
|
3116
|
+
id: string;
|
|
3117
|
+
taskId: string;
|
|
3118
|
+
protected exited: boolean;
|
|
3119
|
+
protected outputEmitter: EventEmitter<any>;
|
|
3120
|
+
protected exitEmitter: EventEmitter<any>;
|
|
3121
|
+
constructor(id: string, taskId: string);
|
|
3122
|
+
protected baseHandleExit(code: number): void;
|
|
3123
|
+
onOutput(callback: (text: string) => void): void;
|
|
3124
|
+
onExit(callback: (code: number) => void): void;
|
|
3125
|
+
abstract kill(): void;
|
|
3126
|
+
abstract stop(): Promise<void>;
|
|
3127
|
+
abstract getOutput(): string;
|
|
3128
|
+
abstract write(text: string): void;
|
|
3129
|
+
abstract turnState(): 'working' | 'idle';
|
|
3130
|
+
abstract onTurnEnd(listener: (reason: StructuredTurnEnd) => void): void;
|
|
3131
|
+
abstract onEvent(listener: (event: StructuredEvent) => void): void;
|
|
3132
|
+
abstract sendMessage(text: string, from?: TaskMessageFrom): string;
|
|
3133
|
+
abstract forceSend(text: string): string;
|
|
3134
|
+
abstract forceSendQueued(id: string): boolean;
|
|
3135
|
+
abstract removeQueued(id: string): boolean;
|
|
3136
|
+
abstract queued(): QueuedTaskMessage[];
|
|
3137
|
+
abstract interrupt(): Promise<void>;
|
|
3138
|
+
abstract nativeSessionId(): string | null;
|
|
3139
|
+
abstract commands(): RunnerCommand$1[];
|
|
3140
|
+
abstract invokeCommand(name: string, args?: string): string;
|
|
3141
|
+
abstract answerPermission(id: string, decision: ApprovalDecision): boolean | Promise<boolean>;
|
|
3142
|
+
abstract onTaskComplete(listener: (report: TaskCompleteArgs) => void): void;
|
|
3143
|
+
abstract onToolCheckpoint(handler: (question: string, signal: AbortSignal) => Promise<CheckpointAnswer>): void;
|
|
3144
|
+
abstract onScriptExit(listener: (exit: ScriptExit) => void): void;
|
|
3145
|
+
}
|
|
3146
|
+
declare abstract class AbstractRunner<S extends IRunnerSession> implements IRunner {
|
|
3147
|
+
protected sessions: Map<string, S>;
|
|
3148
|
+
get activeCount(): number;
|
|
3149
|
+
/** A session winding down stays registered until it exits, so a second stop gets the same wind-down. */
|
|
3150
|
+
stop(sessionId: string): Promise<void>;
|
|
3151
|
+
stopAll(): void;
|
|
3152
|
+
protected registerSession(id: string, session: S): void;
|
|
3153
|
+
abstract spawn(opts: RunnerSpawnOptions): Promise<IRunnerSession>;
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
/** Why a node may do nothing more, and the status that ends it with (ADR-0056 M5, M8). */
|
|
3157
|
+
interface NodeEnd {
|
|
3158
|
+
why: string;
|
|
3159
|
+
ends: 'blocked' | 'failed';
|
|
3160
|
+
}
|
|
3161
|
+
/** What a parent reads of a child (ADR-0055 D6), all of it read afresh from the child's plan and run. */
|
|
3162
|
+
interface NodeState {
|
|
3163
|
+
/** What keeps a `done` from being taken, in the words of a refusal; empty once the run has settled and landed. */
|
|
3164
|
+
unfinished: readonly string[];
|
|
3165
|
+
/** Tasks that finished with a pass. */
|
|
3166
|
+
completed: number;
|
|
3167
|
+
/** An attempt is live, or a run is opening or merging. */
|
|
3168
|
+
live: boolean;
|
|
3169
|
+
/** A planner turn holds the conversation, or waits for it. */
|
|
3170
|
+
plannerBusy: boolean;
|
|
3171
|
+
/** Something gathered for the subplanner will open a turn by itself. */
|
|
3172
|
+
wakeOwed: boolean;
|
|
3173
|
+
/** Why this node stops now, or null: what ends it with no call of its own. */
|
|
3174
|
+
stoppedFor: NodeEnd | null;
|
|
3175
|
+
/** Why nothing may start here though what is in flight may finish, or null (ADR-0056 M10). */
|
|
3176
|
+
withdrawn: string | null;
|
|
3177
|
+
/** Why what is ready cannot start, with nothing live to free room: its subplanner is told first, and it ends `blocked` if nothing comes of that (ADR-0056 M5). */
|
|
3178
|
+
startRefused: string | null;
|
|
3179
|
+
/** One line per task, as a derived report lists them. */
|
|
3180
|
+
tasks: readonly {
|
|
3181
|
+
label: string;
|
|
3182
|
+
status: Task['status'];
|
|
3183
|
+
}[];
|
|
3184
|
+
}
|
|
3185
|
+
/** A subplanner's report once Ordewell has read what it names (ADR-0057 R2). */
|
|
3186
|
+
type TakenReport = TaskCompleteArgs & {
|
|
3187
|
+
subtree?: SubtreeReport;
|
|
3188
|
+
};
|
|
3189
|
+
/** The child, as its attempt drives it: nothing of the Session it is, or of a surface. */
|
|
3190
|
+
interface ChildNode {
|
|
3191
|
+
readonly sessionId: string;
|
|
3192
|
+
/** Its protected paths, its ancestors' with them (ADR-0056 M4). */
|
|
3193
|
+
readonly protectedPaths: readonly string[];
|
|
3194
|
+
/** The time it has to run in (ADR-0056 M3). */
|
|
3195
|
+
readonly wallClockMs: number | null;
|
|
3196
|
+
/** How much of the time since `since` its tree is held on a usage limit, which is not on its clock (M3). */
|
|
3197
|
+
heldSince(since: number): number;
|
|
3198
|
+
startPlanning(goal: string): Promise<unknown>;
|
|
3199
|
+
continueConversation(text: string): Promise<unknown>;
|
|
3200
|
+
/** Reopened (ADR-0055 D17): acts as Execute there, and its subplanner goes on with `text`; one that never wrote a plan plans `goal`. */
|
|
3201
|
+
goOn(text: string, goal: string): Promise<unknown>;
|
|
3202
|
+
/** A line for the subplanner's next turn, which opens none (ADR-0057 R6): a landing is no reason to wake it. */
|
|
3203
|
+
hear(line: string): void;
|
|
3204
|
+
state(): NodeState;
|
|
3205
|
+
/** A report held to its plan and subtree, its references pinned and what crosses a level read verbatim (ADR-0057 R1, R2). */
|
|
3206
|
+
takeReport(report: TaskCompleteArgs): HandoffCheck<TakenReport>;
|
|
3207
|
+
/** End its subtree (D16). Resolves once nothing of it is left, however long that takes. */
|
|
3208
|
+
halt(): Promise<void>;
|
|
3209
|
+
/** Let its Session go, and what it did not spend return (ADR-0056 M5). */
|
|
3210
|
+
close(): Promise<void>;
|
|
3211
|
+
}
|
|
3212
|
+
/** What a subplanner's token calls and what its Session tells of itself, bound to one attempt (ADR-0055 D5). */
|
|
3213
|
+
interface SubplannerLink {
|
|
3214
|
+
taskComplete(report: TaskCompleteArgs): Promise<McpToolReply>;
|
|
3215
|
+
checkpoint(question: string): McpToolReply;
|
|
3216
|
+
/** Something changed that a verdict or the completion reminder may read. */
|
|
3217
|
+
changed(): void;
|
|
3218
|
+
/** A Stop stands over this node, its own or an ancestor's (ADR-0055 D16). */
|
|
3219
|
+
stopped(): boolean;
|
|
3220
|
+
/** What its planner or a task spent, as it arrives: charged where it was spent, and rolled up to each level for its row (ADR-0055 D20). */
|
|
3221
|
+
usage(record: UsageRecord): void;
|
|
3222
|
+
}
|
|
3223
|
+
/** The parent, as a child's attempt needs it. */
|
|
3224
|
+
interface ChildHost {
|
|
3225
|
+
/**
|
|
3226
|
+
* Carve the child's mandate and budget, and build it in `cwd` (ADR-0056 M4,
|
|
3227
|
+
* M5), or the child `reopening` from its saved file (ADR-0055 D17). Rejects,
|
|
3228
|
+
* naming the level, for what cannot be carved.
|
|
3229
|
+
*/
|
|
3230
|
+
openChild(task: Task, cwd: string, link: SubplannerLink, reopening?: string): Promise<ChildNode>;
|
|
3231
|
+
/** What the delegated task's branch changed since its base, relative to the workspace root. */
|
|
3232
|
+
changedPaths(taskId: string): Promise<string[]>;
|
|
3233
|
+
/** A Stop stands over this node: what its children read of their ancestors (D16). */
|
|
3234
|
+
stopped(): boolean;
|
|
3235
|
+
/** Usage on its way up the tree, past this level's row. */
|
|
3236
|
+
passUp(record: UsageRecord): void;
|
|
3237
|
+
/** A child's tasks moved, so the row of its delegated task is stale (ADR-0055 D20). */
|
|
3238
|
+
moved(): void;
|
|
3239
|
+
}
|
|
3240
|
+
interface ChildPlanSetup {
|
|
3241
|
+
task: Task;
|
|
3242
|
+
cwd: string;
|
|
3243
|
+
host: ChildHost;
|
|
3244
|
+
/** A Continue (ADR-0055 D17): the child it reopens, and what its parent says to it. */
|
|
3245
|
+
resume?: {
|
|
3246
|
+
sessionId: string;
|
|
3247
|
+
message: string;
|
|
3248
|
+
};
|
|
3249
|
+
}
|
|
3250
|
+
/**
|
|
3251
|
+
* One attempt of a delegated task (ADR-0055 D3): a child Session in its
|
|
3252
|
+
* worktree, behind the runner seam, so to its parent a subplanner is a runner.
|
|
3253
|
+
* The attempt has one turn, from its start to its verdict, whatever the
|
|
3254
|
+
* subplanner's own turns: `onTurnEnd` fires when the child ends, so ADR-0018's
|
|
3255
|
+
* waiting for input and completion reminder are not read off them. This reads
|
|
3256
|
+
* those turns itself, since nobody below the root waits for input (ADR-0056 M8).
|
|
3257
|
+
*
|
|
3258
|
+
* `task_complete` is the only way to a pass, and a subplanner saying done is
|
|
3259
|
+
* necessary and never sufficient: this holds it to D6 at the call.
|
|
3260
|
+
*/
|
|
3261
|
+
declare class ChildPlanSession extends AbstractRunnerSession {
|
|
3262
|
+
private readonly setup;
|
|
3263
|
+
private readonly events;
|
|
3264
|
+
private readonly turnEnds;
|
|
3265
|
+
private readonly completes;
|
|
3266
|
+
private node;
|
|
3267
|
+
private output;
|
|
3268
|
+
/** Turns this opened and has not seen end: until they do, a quiet child is one still opening. */
|
|
3269
|
+
private opening;
|
|
3270
|
+
private reminded;
|
|
3271
|
+
/** The accepted call, until it is published. */
|
|
3272
|
+
private accepted;
|
|
3273
|
+
/** How the attempt raises a question: as a runner's `checkpoint` does, so the parent's task waits as any task at one. */
|
|
3274
|
+
private ask;
|
|
3275
|
+
/** A question went up and has no answer: nothing is stuck, and only the wall clock ends the wait (ADR-0056 M8). */
|
|
3276
|
+
private asking;
|
|
3277
|
+
/** The attempt has its end: nothing after it counts. */
|
|
3278
|
+
private ended;
|
|
3279
|
+
private halting;
|
|
3280
|
+
/** The Stop, recorded before anything is ended (D16): it is this attempt's, so a later attempt starts clear of it. */
|
|
3281
|
+
private tombstone;
|
|
3282
|
+
/** The child opening, which a Stop waits for: it cannot end what it has not got. */
|
|
3283
|
+
private seating;
|
|
3284
|
+
private checkQueued;
|
|
3285
|
+
private graceTimer;
|
|
3286
|
+
private wallClock;
|
|
3287
|
+
private printed;
|
|
3288
|
+
/** Where the child's tasks stood when its row last heard of them. */
|
|
3289
|
+
private counts;
|
|
3290
|
+
private stopping;
|
|
3291
|
+
private markGone;
|
|
3292
|
+
private readonly gone;
|
|
3293
|
+
constructor(id: string, taskId: string, setup: ChildPlanSetup);
|
|
3294
|
+
/** Whoever spawned it attaches its listeners when the spawn resolves, so the child starts a macrotask later. */
|
|
3295
|
+
begin(): void;
|
|
3296
|
+
private run;
|
|
3297
|
+
/** Read again as it runs out, so a hold found meanwhile moves it on (ADR-0056 M3). */
|
|
3298
|
+
private watchClock;
|
|
3299
|
+
/** A turn this opened: its end is one a check reads, and a failure in it ends the attempt, since no person reads it (ADR-0056 M8). */
|
|
3300
|
+
private opened;
|
|
3301
|
+
private turnSettled;
|
|
3302
|
+
private queueCheck;
|
|
3303
|
+
/**
|
|
3304
|
+
* What the child's state owes its attempt. Read after every change, so no
|
|
3305
|
+
* state of a child can sit with nothing to end it (ADR-0056 M8).
|
|
3306
|
+
*/
|
|
3307
|
+
private check;
|
|
3308
|
+
/** The node stops as a Stop does, and the attempt ends once it has (ADR-0056 M3, M5). */
|
|
3309
|
+
private haltFor;
|
|
3310
|
+
/** A report nobody wrote, since no one is left to: only what the plan and run show, for the plan above to decide on. */
|
|
3311
|
+
private derived;
|
|
3312
|
+
/** The child's activity, as this attempt's log shows it (ADR-0055 D20): what a task became, not what its runner said. */
|
|
3313
|
+
private say;
|
|
3314
|
+
/** In its output and its log alike: what a person opens the task to read is this. */
|
|
3315
|
+
private print;
|
|
3316
|
+
/**
|
|
3317
|
+
* The subplanner's `task_complete`, on the token bound to this attempt. D6's
|
|
3318
|
+
* first two tests refuse at the call and leave the attempt open; a protected
|
|
3319
|
+
* path fails the verdict instead, since that work cannot be taken back here.
|
|
3320
|
+
* `blocked` and `failed` are taken at any time: that is how a subtree gives up.
|
|
3321
|
+
*/
|
|
3322
|
+
private taskComplete;
|
|
3323
|
+
/**
|
|
3324
|
+
* The subplanner's question: it goes up as a checkpoint of this attempt, and
|
|
3325
|
+
* the call answers at once. Its answer opens the next turn, and a question
|
|
3326
|
+
* withdrawn with the attempt opens none.
|
|
3327
|
+
*/
|
|
3328
|
+
private checkpoint;
|
|
3329
|
+
/** Why a `done` cannot be taken now, naming what is unfinished (D6: 1, 2). */
|
|
3330
|
+
private doneRefusal;
|
|
3331
|
+
/** The changes on the branch since its base, against every level's paths (D3, ADR-0056 M4): the one check of the work itself. */
|
|
3332
|
+
private protectedPathsTouched;
|
|
3333
|
+
/**
|
|
3334
|
+
* What its branch changed past the scope its parent declared (ADR-0056 M7),
|
|
3335
|
+
* for the parent to decide: scopes are advisory, so this goes in the report
|
|
3336
|
+
* and refuses nothing. A read-only task lands nothing to say this of.
|
|
3337
|
+
*/
|
|
3338
|
+
private outsideScope;
|
|
3339
|
+
private publish;
|
|
3340
|
+
/** An end no subplanner reported: its handoff is what the plan and run show, and the verdict comes from there. */
|
|
3341
|
+
private end;
|
|
3342
|
+
private emitEvent;
|
|
3343
|
+
/**
|
|
3344
|
+
* A tombstone first (ADR-0055 D16): every start under it reads this at once,
|
|
3345
|
+
* before anything has stopped. Then the child goes as an attempt's runner
|
|
3346
|
+
* does: its subtree ended, leaves first, then its Session let go, while its
|
|
3347
|
+
* parent can still read the lease it depends on (D13), and what it did not
|
|
3348
|
+
* spend returned (ADR-0056 M5). Resolves when all of that is done, with no
|
|
3349
|
+
* timeout of its own: a runner's grace is the runner's (ADR-0018).
|
|
3350
|
+
*/
|
|
3351
|
+
stop(): Promise<void>;
|
|
3352
|
+
private wind;
|
|
3353
|
+
kill(): void;
|
|
3354
|
+
/** Where its child's tasks stand, as last read; absent before the first read and once the child has gone. */
|
|
3355
|
+
progress(): ChildTaskCounts | undefined;
|
|
3356
|
+
getOutput(): string;
|
|
3357
|
+
/** Nothing reads a child's input but a message. */
|
|
3358
|
+
write(): void;
|
|
3359
|
+
/** One turn from its start to its verdict (D3). */
|
|
3360
|
+
turnState(): 'working' | 'idle';
|
|
3361
|
+
onTurnEnd(listener: (reason: StructuredTurnEnd) => void): void;
|
|
3362
|
+
onEvent(listener: (event: StructuredEvent) => void): void;
|
|
3363
|
+
/** A parent's message opens the subplanner's next turn (D3); Ordewell's own line waits for one. */
|
|
3364
|
+
sendMessage(text: string, from?: TaskMessageFrom): string;
|
|
3365
|
+
forceSend(text: string): string;
|
|
3366
|
+
forceSendQueued(): boolean;
|
|
3367
|
+
removeQueued(): boolean;
|
|
3368
|
+
queued(): QueuedTaskMessage[];
|
|
3369
|
+
/** A child has no one turn to interrupt: Stop ends it. */
|
|
3370
|
+
interrupt(): Promise<void>;
|
|
3371
|
+
/** What a restart names (D3): the child session, not a runner's. */
|
|
3372
|
+
nativeSessionId(): string | null;
|
|
3373
|
+
commands(): RunnerCommand$1[];
|
|
3374
|
+
invokeCommand(): string;
|
|
3375
|
+
answerPermission(): boolean;
|
|
3376
|
+
onTaskComplete(listener: (report: TaskCompleteArgs, refuted?: VerificationCheck) => void): void;
|
|
3377
|
+
/** A subplanner asks by its own token, not its attempt's, and this is how that question reaches the attempt. */
|
|
3378
|
+
onToolCheckpoint(handler: (question: string, signal: AbortSignal) => Promise<CheckpointAnswer>): void;
|
|
3379
|
+
onScriptExit(): void;
|
|
3380
|
+
}
|
|
3381
|
+
/**
|
|
3382
|
+
* Starts delegated tasks' attempts (ADR-0055 D3), as a runner starts a coding
|
|
3383
|
+
* agent's and the script runner a body, so the claim, the log, the verdict and
|
|
3384
|
+
* the landing meet one the way they meet any task. A separate process later is
|
|
3385
|
+
* a second `IRunner`, not a redesign.
|
|
3386
|
+
*/
|
|
3387
|
+
declare class ChildPlanRunner extends AbstractRunner<ChildPlanSession> {
|
|
3388
|
+
private readonly host;
|
|
3389
|
+
private spawned;
|
|
3390
|
+
constructor(host: ChildHost);
|
|
3391
|
+
/** Every child's stop, for a node that waits on its subtree. */
|
|
3392
|
+
stopEvery(): Promise<void>;
|
|
3393
|
+
/** Where the tasks of the child `taskId` runs stand, or nothing with no child live. */
|
|
3394
|
+
progressOf(taskId: string): ChildTaskCounts | undefined;
|
|
3395
|
+
spawn(opts: RunnerSpawnOptions): Promise<IRunnerSession>;
|
|
3396
|
+
}
|
|
3397
|
+
|
|
3100
3398
|
/**
|
|
3101
3399
|
* A model's context window from a catalog Ordewell already holds — a runner's
|
|
3102
3400
|
* own model listing or a provider's own models endpoint, never a table kept in
|
|
@@ -3174,10 +3472,14 @@ interface SessionEventRelayDeps {
|
|
|
3174
3472
|
orchestrator: Pick<TaskOrchestrator, 'judgingOnce' | 'getIdleSince' | 'getCompletionReceipt' | 'getToolsAttaching' | 'getQueuedTaskMessages' | 'getMergeGate' | 'holdReason' | 'loopStranded' | 'runMergeView' | 'activity' | 'taskIsolation'>;
|
|
3175
3473
|
/** Shared with the Session, which snapshots, restores and clears it. */
|
|
3176
3474
|
usage: PlannerUsageLedger;
|
|
3475
|
+
/** What a subplanner's budget hears of each planner call (ADR-0056 M5); absent at the root, which is charged nothing. */
|
|
3476
|
+
spent?: (record: UsageRecord) => void;
|
|
3177
3477
|
/** How many of a task's runner requests wait for an answer (ADR-0018, A1). */
|
|
3178
3478
|
awaitingApproval?: (taskId: string) => number;
|
|
3179
3479
|
/** What a task's waiting checkpoint asks, whole. */
|
|
3180
3480
|
checkpointQuestion?: (taskId: string) => string | undefined;
|
|
3481
|
+
/** A delegated task's row (ADR-0055 D20). */
|
|
3482
|
+
delegation?: (taskId: string) => DelegatedRow | undefined;
|
|
3181
3483
|
/** The task waits for the user's approval to start (ADR-0035). */
|
|
3182
3484
|
waitsForApproval?: (taskId: string) => boolean;
|
|
3183
3485
|
/** What waits on a person now (ADR-0053). */
|
|
@@ -3210,9 +3512,11 @@ declare class SessionEventRelay {
|
|
|
3210
3512
|
private readonly store;
|
|
3211
3513
|
private readonly orchestrator;
|
|
3212
3514
|
private readonly usage;
|
|
3515
|
+
private readonly spent;
|
|
3213
3516
|
private readonly awaitingApproval;
|
|
3214
3517
|
private readonly checkpointQuestion;
|
|
3215
3518
|
private readonly waitsForApproval;
|
|
3519
|
+
private readonly delegation;
|
|
3216
3520
|
private readonly escalations;
|
|
3217
3521
|
private readonly escalationsSent;
|
|
3218
3522
|
private statusHeld;
|
|
@@ -3239,6 +3543,8 @@ declare class SessionEventRelay {
|
|
|
3239
3543
|
constructor(deps: SessionEventRelayDeps);
|
|
3240
3544
|
/** `plan` is read per event: a Session with no plan (or mid-reset) announces nothing about tasks. */
|
|
3241
3545
|
observer(plan: () => LegacyPlanState | null): RelayObserver;
|
|
3546
|
+
/** A delegated task's row moved: it can wait for the window, as usage does. */
|
|
3547
|
+
rowsMoved(plan: LegacyPlanState | null): void;
|
|
3242
3548
|
/** Send every task's status now, whatever was sent a moment ago: for what a surface must not wait for. */
|
|
3243
3549
|
status(plan: LegacyPlanState | null): void;
|
|
3244
3550
|
/**
|
|
@@ -3307,10 +3613,14 @@ declare class SessionEventRelay {
|
|
|
3307
3613
|
progress(progress: ResearchProgress): void;
|
|
3308
3614
|
}
|
|
3309
3615
|
|
|
3310
|
-
/**
|
|
3616
|
+
/**
|
|
3617
|
+
* Which session's logs, under which state root. A child's says which root it
|
|
3618
|
+
* sits under: a session id alone finds a root's (ADR-0055 D11).
|
|
3619
|
+
*/
|
|
3311
3620
|
interface TaskLogLocation {
|
|
3312
3621
|
baseDir: string;
|
|
3313
3622
|
sessionId: string;
|
|
3623
|
+
rootSessionId?: string;
|
|
3314
3624
|
}
|
|
3315
3625
|
/** One attempt's file, open for appending. */
|
|
3316
3626
|
interface TaskLogFile {
|
|
@@ -3467,6 +3777,8 @@ interface SessionRuntimeSettings {
|
|
|
3467
3777
|
plannerAutoCompaction?: boolean;
|
|
3468
3778
|
/** What a task runner loads of the user's own setup; absent means all of it. */
|
|
3469
3779
|
taskRunnerConfig?: TaskRunnerConfig;
|
|
3780
|
+
/** The `containers` setting, as written; absent means local worktrees (ADR-0059 L4). */
|
|
3781
|
+
containers?: unknown;
|
|
3470
3782
|
}
|
|
3471
3783
|
declare function sessionRuntimeSettings(settings: UserSettings): SessionRuntimeSettings;
|
|
3472
3784
|
/** Where a fork landed: the new session's id, and what adopting it needs. */
|
|
@@ -3479,8 +3791,29 @@ interface ConversationFork {
|
|
|
3479
3791
|
interface ConversationRewind extends ConversationFork {
|
|
3480
3792
|
rewoundMessage: string;
|
|
3481
3793
|
}
|
|
3482
|
-
/** Writes one plan to the saved-session store: {@link saveSession}'s shape, injected so tests never touch disk. */
|
|
3794
|
+
/** Writes one plan to the saved-session store: {@link saveSession}'s shape, injected so tests never touch disk. `workspace` is the state root. */
|
|
3483
3795
|
type SaveSession = (plan: LegacyPlanState, goal: string, workspace: string, sessionId: string) => void;
|
|
3796
|
+
/**
|
|
3797
|
+
* Where a child session sits in its tree, handed out by the parent's
|
|
3798
|
+
* {@link Session.hostChild}. Its code root is its `workspaceRoot`, a delegated
|
|
3799
|
+
* task's worktree, which goes with that task; what must outlive that goes here.
|
|
3800
|
+
*/
|
|
3801
|
+
interface ChildPlacement {
|
|
3802
|
+
/** The id it saves under, which the parent's run record names. */
|
|
3803
|
+
sessionId: string;
|
|
3804
|
+
/** The root Session's workspace, at every depth (ADR-0055 D11). */
|
|
3805
|
+
stateRoot: string;
|
|
3806
|
+
/** The root Session's id: a child's state sits under that session's. */
|
|
3807
|
+
rootSessionId: string;
|
|
3808
|
+
/** Who holds the tree, as the root's lease says (D13). */
|
|
3809
|
+
held: () => SessionHeld | null;
|
|
3810
|
+
/** Its parent's, so one repository's worktree bookkeeping takes one lock across the tree (D11). */
|
|
3811
|
+
isolation: IWorktreeIsolation;
|
|
3812
|
+
/** The root's, so the tree shares one Parallel limit (D18). */
|
|
3813
|
+
pool: SlotPool;
|
|
3814
|
+
/** Its side of the tree's ledger, once a carve gave it one (ADR-0056 M5). */
|
|
3815
|
+
budget?: NodeBudget;
|
|
3816
|
+
}
|
|
3484
3817
|
/**
|
|
3485
3818
|
* Everything a delivery surface constructs to host a session. Structural config
|
|
3486
3819
|
* (orchestratorModel, providerModelLists) is snapshotted inside `config` at
|
|
@@ -3562,8 +3895,31 @@ interface SessionDeps {
|
|
|
3562
3895
|
};
|
|
3563
3896
|
/** What runs the user's notify command (ADR-0053); the real process unless a test supplies one. */
|
|
3564
3897
|
runNotifyCommand?: NotifyRun;
|
|
3898
|
+
/** Where its sessions run (ADR-0059), given the local worktrees: those, unless a test supplies another. */
|
|
3899
|
+
execution?: TaskOrchestratorOptions['execution'];
|
|
3565
3900
|
/** The node this session is, below the root (ADR-0056); absent, it is the root, whose mandate its settings hold. */
|
|
3566
3901
|
child?: NodeAuthority;
|
|
3902
|
+
/** Where this session sits below the root (ADR-0055 D11, D13); absent, its workspace is both its code root and its state root. */
|
|
3903
|
+
placement?: ChildPlacement;
|
|
3904
|
+
/** Where a root's tree keeps its log (ADR-0058 S3): a file in that root's directory, unless a test supplies another. */
|
|
3905
|
+
eventLog?: (rootSessionId: string, stateRoot: string) => EventStore;
|
|
3906
|
+
/** How this session answers to its parent's attempt, as a subplanner (ADR-0055 D5); absent at the root. */
|
|
3907
|
+
subplanner?: SubplannerLink;
|
|
3908
|
+
/** What this child was given to do, for its prompt. */
|
|
3909
|
+
brief?: SubplannerBrief;
|
|
3910
|
+
/** Whether a planner may write a delegated task here; the build's own switch (ADR-0055 D21) unless a test sets it. */
|
|
3911
|
+
delegationOffered?: boolean;
|
|
3912
|
+
/** What a test puts in a child's deps, in place of what a real child is built with. */
|
|
3913
|
+
childDeps?: (task: Task) => Partial<SessionDeps>;
|
|
3914
|
+
}
|
|
3915
|
+
/** A session built under a parent's attempt: what {@link Session.openChild} seats and carves, and what the parent hands it. */
|
|
3916
|
+
interface ChildSpec {
|
|
3917
|
+
task: Task;
|
|
3918
|
+
cwd: string;
|
|
3919
|
+
placement: ChildPlacement;
|
|
3920
|
+
authority: NodeAuthority;
|
|
3921
|
+
brief: SubplannerBrief;
|
|
3922
|
+
link: SubplannerLink;
|
|
3567
3923
|
}
|
|
3568
3924
|
/**
|
|
3569
3925
|
* The composition root: builds every collaborator a Session drives and wires
|
|
@@ -3608,6 +3964,15 @@ interface SessionParts {
|
|
|
3608
3964
|
conversation: (host: PlannerConversationHost) => PlannerConversation;
|
|
3609
3965
|
/** The node this session is, below the root. */
|
|
3610
3966
|
child?: NodeAuthority;
|
|
3967
|
+
/** Where it sits below the root. */
|
|
3968
|
+
placement?: ChildPlacement;
|
|
3969
|
+
eventLog: (rootSessionId: string, stateRoot: string) => EventStore;
|
|
3970
|
+
subplanner?: SubplannerLink;
|
|
3971
|
+
brief?: SubplannerBrief;
|
|
3972
|
+
runnerConfig: () => TaskRunnerConfig | undefined;
|
|
3973
|
+
delegationOffered: boolean;
|
|
3974
|
+
childPlans: Pick<ChildPlanRunner, 'stopEvery' | 'activeCount' | 'progressOf'>;
|
|
3975
|
+
childSession: (spec: ChildSpec) => Session;
|
|
3611
3976
|
}
|
|
3612
3977
|
/**
|
|
3613
3978
|
* The per-session execution stack — the lifecycle owner. Owns plan
|
|
@@ -3636,6 +4001,7 @@ declare class Session {
|
|
|
3636
4001
|
private readonly catalog;
|
|
3637
4002
|
private plan;
|
|
3638
4003
|
private goal;
|
|
4004
|
+
/** The code root: what its planner and runners read and git works in. See {@link stateRoot} for Ordewell's own files. */
|
|
3639
4005
|
private workspace;
|
|
3640
4006
|
private readonly broadcast;
|
|
3641
4007
|
/**
|
|
@@ -3685,16 +4051,44 @@ declare class Session {
|
|
|
3685
4051
|
private unsubObserver;
|
|
3686
4052
|
/** This session's node below the root; undefined at the root, where a person remains. */
|
|
3687
4053
|
private readonly child;
|
|
4054
|
+
private readonly placement;
|
|
3688
4055
|
private readonly authority;
|
|
4056
|
+
/** Opens the root's log; only a first carve, or a reopen of a tree, asks. */
|
|
4057
|
+
private readonly eventLog;
|
|
4058
|
+
/** How this session answers to its parent's attempt; undefined at the root (ADR-0055 D5). */
|
|
4059
|
+
private readonly subplanner;
|
|
4060
|
+
private readonly brief;
|
|
4061
|
+
private readonly runnerConfig;
|
|
4062
|
+
private readonly delegationOffered;
|
|
4063
|
+
private readonly childPlans;
|
|
4064
|
+
private readonly childSession;
|
|
4065
|
+
/** This node's side of the tree's ledger; undefined at the root, which is charged nothing (ADR-0056 M5). */
|
|
4066
|
+
private readonly budget;
|
|
4067
|
+
/** The tree's ledger, once something asked: a flat run never does, so it has none and writes no log (ADR-0058 S3). */
|
|
4068
|
+
private tree;
|
|
4069
|
+
/** The lines this plan's landings owe its running tasks (ADR-0057 R6). */
|
|
4070
|
+
private readonly scopeLines;
|
|
4071
|
+
/** The subplanner was told a start was refused; a raise makes it news again (ADR-0056 M5). */
|
|
4072
|
+
private toldStartRefused;
|
|
4073
|
+
/** The opening behind {@link tree}, and the session it opened for. */
|
|
4074
|
+
private treeOpening;
|
|
4075
|
+
/** The ledger let go, which the next opening reads after. */
|
|
4076
|
+
private treeClosing;
|
|
3689
4077
|
private readonly hostSessionId?;
|
|
3690
4078
|
private currentSessionId;
|
|
3691
4079
|
private readonly skillsService;
|
|
3692
4080
|
private readonly conversation;
|
|
3693
4081
|
private readonly turns;
|
|
4082
|
+
/** The planner turn's execution lease, while one runs. */
|
|
4083
|
+
private turnLease;
|
|
4084
|
+
/** An opening waiting for a slot: it takes one when the pool has it. True when there was one to tell. */
|
|
4085
|
+
private roomWaiter;
|
|
3694
4086
|
/** Destroyed: a turn that waited for the planner to be found must not open on it. */
|
|
3695
4087
|
private closed;
|
|
3696
4088
|
/** Destroyed and let go of its lease for good: whatever settles later neither saves nor holds the session. */
|
|
3697
4089
|
private leaseReleased;
|
|
4090
|
+
/** Settles once a destroyed Session's lease has gone. */
|
|
4091
|
+
private departed;
|
|
3698
4092
|
/**
|
|
3699
4093
|
* Turns PlanTurns does not open, waiting at the planner gate, each ended
|
|
3700
4094
|
* with why it must not open: a Stop, a newer goal, or its plan scope ending.
|
|
@@ -3723,8 +4117,10 @@ declare class Session {
|
|
|
3723
4117
|
/** What will not move without a person, derived afresh from the plan, the run and the pending approvals (ADR-0053). */
|
|
3724
4118
|
escalations(): Escalation[];
|
|
3725
4119
|
private judgedEscalations;
|
|
3726
|
-
/**
|
|
3727
|
-
|
|
4120
|
+
/** What holds a merge nobody asked for here, as a list or a refusal names it (ADR-0055 D9). */
|
|
4121
|
+
private mergeHold;
|
|
4122
|
+
/** The user's answer to an escalation; see {@link ExecutionCommands.answerEscalation}. `raiseTokens` goes with an Approve of a delegated task (ADR-0056 M5). */
|
|
4123
|
+
answerEscalation(id: string, option: string, note?: string, confirmed?: boolean, raiseTokens?: number): Promise<CommandOutcome>;
|
|
3728
4124
|
/** Run one planner turn with its own {@link TurnEffects}, which only a turn that lands hands back. */
|
|
3729
4125
|
private openTurn;
|
|
3730
4126
|
/** Each failed task, with the attempt that failed. */
|
|
@@ -3785,6 +4181,7 @@ declare class Session {
|
|
|
3785
4181
|
* oscillation guard.
|
|
3786
4182
|
*/
|
|
3787
4183
|
private changeScope;
|
|
4184
|
+
private get delegates();
|
|
3788
4185
|
/** A line from Ordewell itself, kept in the transcript where it happened. */
|
|
3789
4186
|
private systemNote;
|
|
3790
4187
|
/** A message to the user in the supervisor's voice, kept in the transcript where it happened. */
|
|
@@ -3803,6 +4200,8 @@ declare class Session {
|
|
|
3803
4200
|
private userRunSettings;
|
|
3804
4201
|
/** What this node may do without a person, as it stands now (ADR-0056 M1): derived at the root, and never saved. */
|
|
3805
4202
|
mandate(): Mandate;
|
|
4203
|
+
/** Why this child's script may not land what it does unsealed, as the rules stand now: an effect withdrawn since it landed goes with them (ADR-0056 M9). */
|
|
4204
|
+
unsealedRefusal(task: Readonly<Task>): string | null;
|
|
3806
4205
|
/** Each value where it lives today; the level is the caller's to name (ADR-0056 M1). */
|
|
3807
4206
|
private rootSettings;
|
|
3808
4207
|
private effectRules;
|
|
@@ -3850,10 +4249,160 @@ declare class Session {
|
|
|
3850
4249
|
* can re-probe it before a turn without keeping a second copy.
|
|
3851
4250
|
*/
|
|
3852
4251
|
get workspaceRoot(): string;
|
|
4252
|
+
/**
|
|
4253
|
+
* Where this session's own files live: its workspace, unless it is a child,
|
|
4254
|
+
* whose code root goes with a worktree (ADR-0055 D11). Git and the planner
|
|
4255
|
+
* read {@link workspaceRoot}; a save, a log and the lease read this.
|
|
4256
|
+
*/
|
|
4257
|
+
private get stateRoot();
|
|
3853
4258
|
/** The planner this session's own gate reads — not whatever the host's config says now. */
|
|
3854
4259
|
get plannerProvider(): PlannerBackendId;
|
|
3855
4260
|
/** Where this session's structured task logs are saved (ADR-0018, P1). */
|
|
3856
4261
|
get taskLogLocation(): TaskLogLocation;
|
|
4262
|
+
/**
|
|
4263
|
+
* Seat a child session in a task's worktree: what `createSession` builds it
|
|
4264
|
+
* with, its code root being that worktree. The task's record names it, so a
|
|
4265
|
+
* reopen does not prune the worktree from under it (ADR-0055 D17), and asking
|
|
4266
|
+
* again finds the same child. Every depth shares the root's state root,
|
|
4267
|
+
* lease and isolation (D11, D13). Throws for a task with no worktree (D12).
|
|
4268
|
+
*/
|
|
4269
|
+
hostChild(taskId: string): ChildPlacement;
|
|
4270
|
+
/** The root Session's id, under which a tree's state sits (ADR-0055 D11). */
|
|
4271
|
+
get rootSessionId(): string;
|
|
4272
|
+
/**
|
|
4273
|
+
* Take the planner turn's lease (ADR-0059 L1), kept from its admission to
|
|
4274
|
+
* its end, however many times it takes the conversation. False when the pool
|
|
4275
|
+
* has no slot for a subplanner's turn: it keeps this Session, and calls
|
|
4276
|
+
* {@link turnRoomFreed}.
|
|
4277
|
+
*/
|
|
4278
|
+
private turnRoom;
|
|
4279
|
+
private turnRefusal;
|
|
4280
|
+
/** The pool has a slot for the turn it refused: the opening waiting for one, or else the next of the queue. */
|
|
4281
|
+
turnRoomFreed(): void;
|
|
4282
|
+
/** Where a planner's process starts, opened around its adapter (ADR-0059 L1). No lease: nothing has a turn to start it for. */
|
|
4283
|
+
openTurnLease(signal: AbortSignal): Promise<OpenLease> | undefined;
|
|
4284
|
+
/**
|
|
4285
|
+
* The turn is over. A subplanner between turns holds no process: it is a
|
|
4286
|
+
* parked row, its adapter gone and its session id kept, so the next turn
|
|
4287
|
+
* resumes it (ADR-0055 D18). A turn's own corrective retries come before
|
|
4288
|
+
* this, in the one process, and its slot goes only once that process has.
|
|
4289
|
+
*/
|
|
4290
|
+
private endTurnLease;
|
|
4291
|
+
/**
|
|
4292
|
+
* A goal or a compaction refused after {@link plannerTurnMayOpen} let it in:
|
|
4293
|
+
* no turn opened, so nothing else would end it, and the slot it took would
|
|
4294
|
+
* stay out of the tree's pool (ADR-0055 D18). A turn holding the lease by
|
|
4295
|
+
* then is its own to end.
|
|
4296
|
+
*/
|
|
4297
|
+
private dropUnopenedTurn;
|
|
4298
|
+
/**
|
|
4299
|
+
* The tree's ledger, opened from the log if nothing has yet. A Continue asks
|
|
4300
|
+
* before {@link hostChild}, whose placement names a child's node only once
|
|
4301
|
+
* this has answered. A flat run has no reason to ask.
|
|
4302
|
+
*/
|
|
4303
|
+
ledger(): Promise<TreeLedger>;
|
|
4304
|
+
/** The root's ledger is let go with its session; a child's stays its root's. */
|
|
4305
|
+
private closeTree;
|
|
4306
|
+
/**
|
|
4307
|
+
* The tree as it stands, with the root's limit where the user keeps it. Read
|
|
4308
|
+
* as a carve or a raise is asked for, so a raised setting reaches them.
|
|
4309
|
+
*/
|
|
4310
|
+
private currentTree;
|
|
4311
|
+
/**
|
|
4312
|
+
* A child's mandate and budget, carved from what this node has left
|
|
4313
|
+
* (ADR-0056 M4, M5). At the root, what can never pass is refused before a
|
|
4314
|
+
* log is opened: the first carve is what makes a run a tree. A child's limit
|
|
4315
|
+
* is the ledger's, which a raise has moved past its saved mandate. The task's
|
|
4316
|
+
* record names the child only once the carve took, so a refused one leaves
|
|
4317
|
+
* no name of a child that never existed.
|
|
4318
|
+
*/
|
|
4319
|
+
carveChild(taskId: string, request: Omit<MandateRequest, 'level'>, reopening?: string): Promise<Carved>;
|
|
4320
|
+
/** This node's place in the tree's ledger. */
|
|
4321
|
+
private get nodePath();
|
|
4322
|
+
/** A raise for the child in `taskId`, applied from what this node has left (M5). Null when it took; otherwise why not. */
|
|
4323
|
+
raiseChild(taskId: string, tokens: number): Promise<string | null>;
|
|
4324
|
+
/** A delegated task's row (ADR-0055 D20), read afresh each time a status goes out: nothing of it is kept. */
|
|
4325
|
+
delegatedRow(taskId: string): DelegatedRow | undefined;
|
|
4326
|
+
/** The child in `taskId` confirmed closed: what it did not spend comes back here (M5). */
|
|
4327
|
+
closeChild(taskId: string): Promise<void>;
|
|
4328
|
+
/**
|
|
4329
|
+
* A child plan's start (ADR-0055 D3): its mandate and budget carved from what
|
|
4330
|
+
* its delegated task has left, then a Session built in `cwd`, the task's
|
|
4331
|
+
* worktree, that holds both. A Continue (D17) is the same carve for the child
|
|
4332
|
+
* it names, whose plan loads: nothing of that child's file is read before
|
|
4333
|
+
* this. Its node closed as it ended, or a crash left it open and this closes
|
|
4334
|
+
* it: either way it stays charged what it spent, so no attempt mints budget
|
|
4335
|
+
* (ADR-0056 M10). Rejects with the level that refused.
|
|
4336
|
+
*/
|
|
4337
|
+
openChild(task: Task, cwd: string, link: SubplannerLink, reopening?: string): Promise<ChildNode>;
|
|
4338
|
+
/** What is left of what the tree granted a delegated task, its budget and every raise, across every child it has had (ADR-0055 D15, ADR-0056 M5, M10). Throws once nothing is. */
|
|
4339
|
+
private budgetLeft;
|
|
4340
|
+
/** The child `sessionId` is gone: what it did not spend comes back here (ADR-0056 M5). */
|
|
4341
|
+
closeNode(sessionId: string): Promise<void>;
|
|
4342
|
+
/** A delegated task's next attempt is fresh: the child its last one left goes, whatever became of it (ADR-0055 D15). Its state stays under the root; what git could not let go throws, naming it, and the task still names the child. */
|
|
4343
|
+
discardChild({ id, runnerSessionId }: Readonly<Task>): Promise<void>;
|
|
4344
|
+
/** The run's own discard reaches no child: each is named only by what this run forgets (ADR-0055 D11). */
|
|
4345
|
+
private discardChildren;
|
|
4346
|
+
/** This session as its parent's attempt drives it, `pins` what it is told as it starts (ADR-0057 R10). */
|
|
4347
|
+
private asNode;
|
|
4348
|
+
/**
|
|
4349
|
+
* Reopened (ADR-0055 D17): as Execute, so what failed is retried, and then its
|
|
4350
|
+
* subplanner goes on. One whose plan never reached the disk plans its goal, and
|
|
4351
|
+
* one with nothing left to run goes straight to its turn: it may owe only its report.
|
|
4352
|
+
*/
|
|
4353
|
+
private goOn;
|
|
4354
|
+
private get taskLogReader();
|
|
4355
|
+
/** The plans below this one on `tree`, each read when asked for (ADR-0055 D17, ADR-0057 R1). */
|
|
4356
|
+
private subtreeOn;
|
|
4357
|
+
/** Whether this node has a board (ADR-0057 R8): a child always, and a root from its first delegated task. A flat plan never does, and never opens a ledger for one. */
|
|
4358
|
+
private get holdsBoard();
|
|
4359
|
+
/** This node's board, read through what its tree's log holds; null where it has none. */
|
|
4360
|
+
board(): Promise<NodeBoard | null>;
|
|
4361
|
+
/** A planner's `post`, in its own workspace. */
|
|
4362
|
+
postOnBoard(args: PostArgs): Promise<McpToolReply>;
|
|
4363
|
+
/**
|
|
4364
|
+
* What a landing owes the plan it landed in (ADR-0057 R6): a delegated task's
|
|
4365
|
+
* contracts rise to this board, then each running task that declared what it
|
|
4366
|
+
* touched gets its line. Undefined with no board, so a flat landing waits on
|
|
4367
|
+
* nothing. A failure here costs a line, and never the landing.
|
|
4368
|
+
*/
|
|
4369
|
+
taskLanded(task: Readonly<Task>): Promise<void> | undefined;
|
|
4370
|
+
private raiseAndAddress;
|
|
4371
|
+
/** What is below this plan; null with nothing delegated, so a flat run opens no ledger. */
|
|
4372
|
+
subtree(): Promise<Subtree | null>;
|
|
4373
|
+
/** A subplanner's report, read against its own plan and what is below it; a child's ledger is its root's, so nothing here waits. */
|
|
4374
|
+
private takeReport;
|
|
4375
|
+
/** A planner's `read`: its whole plan, and what is below it (ADR-0057 R11). */
|
|
4376
|
+
readBelow(args: ReadTaskArgs): Promise<McpToolReply>;
|
|
4377
|
+
/** What its parent reads of it, afresh (ADR-0055 D6). */
|
|
4378
|
+
private nodeState;
|
|
4379
|
+
/** Why this node stops now: a child has nobody else to wait for (ADR-0056 M5, M8). */
|
|
4380
|
+
private stoppedFor;
|
|
4381
|
+
/** Why nothing may start here, what is in flight finishing first (ADR-0056 M10). */
|
|
4382
|
+
private withdrawn;
|
|
4383
|
+
/** A Stop stands at this node or above it, or its budget has stopped it (ADR-0055 D16, ADR-0056 M5). */
|
|
4384
|
+
get underStop(): boolean;
|
|
4385
|
+
/** Why no claim and no planner turn may start at this node, read at every start as its own Stop generation is (ADR-0055 D16). */
|
|
4386
|
+
nodeRefusal(): string | null;
|
|
4387
|
+
/**
|
|
4388
|
+
* Everything under this node stops, leaves first, its planner turn and any
|
|
4389
|
+
* turn waiting included, and this resolves once it has all gone: with no
|
|
4390
|
+
* timeout of its own, since a runner's grace is the runner's (ADR-0055 D16).
|
|
4391
|
+
*/
|
|
4392
|
+
stopSubtree(): Promise<void>;
|
|
4393
|
+
/**
|
|
4394
|
+
* What is ready cannot start and nothing live will free room for it, so
|
|
4395
|
+
* nothing ticks this again (ADR-0056 M5). A subplanner is woken, once, so it
|
|
4396
|
+
* can ask; {@link ChildPlanSession} ends it if nothing comes of that. A node
|
|
4397
|
+
* with no planner to wake stops.
|
|
4398
|
+
*/
|
|
4399
|
+
startRefused(why: string): void;
|
|
4400
|
+
/** A raise only moves numbers: what its room lets start is this run's to start (ADR-0056 M5). */
|
|
4401
|
+
private budgetRaised;
|
|
4402
|
+
/** What a delegated task's branch changed since its base. */
|
|
4403
|
+
changedPaths(taskId: string): Promise<string[]>;
|
|
4404
|
+
/** Why this node stopped for its budget, or null: a parent's reason for ending it `blocked`. */
|
|
4405
|
+
get outOfBudget(): string | null;
|
|
3857
4406
|
/** The attempts of a task that have a saved log, oldest first. */
|
|
3858
4407
|
taskLogAttempts(taskId: string): number[];
|
|
3859
4408
|
/**
|
|
@@ -3912,6 +4461,8 @@ declare class Session {
|
|
|
3912
4461
|
* no live host holds it, as a new session's first save does.
|
|
3913
4462
|
*/
|
|
3914
4463
|
heldElsewhere(): SessionHeld | null;
|
|
4464
|
+
/** Work on the session this Session has open is refused while another host holds it (ADR-0049 L5). */
|
|
4465
|
+
private refuseHeld;
|
|
3915
4466
|
/**
|
|
3916
4467
|
* A new plan under the host's fixed id writes that session's file: refused
|
|
3917
4468
|
* before any planner turn while another host has it open (ADR-0049). A
|
|
@@ -3922,7 +4473,10 @@ declare class Session {
|
|
|
3922
4473
|
/**
|
|
3923
4474
|
* Another host took the session over, judging this one gone (ADR-0049). Its
|
|
3924
4475
|
* runners must not work on beside that host's, in the worktrees that host
|
|
3925
|
-
* now prepares, so the run here stops.
|
|
4476
|
+
* now prepares, so the run here stops. The planner turn is abandoned, not
|
|
4477
|
+
* only stopped: a backend can still answer past a stop, and that reply would
|
|
4478
|
+
* write a PRD into the checkout that host now holds. What waits behind it
|
|
4479
|
+
* stays, for the gate to refuse with the hold's own reason (L5).
|
|
3926
4480
|
*/
|
|
3927
4481
|
private leaseLost;
|
|
3928
4482
|
/** Something of the run would go on if left: work, a resume, a start on its way, or a loop a retry would carry on (ADR-0045 L5). */
|
|
@@ -3947,6 +4501,13 @@ declare class Session {
|
|
|
3947
4501
|
* them as its draft.
|
|
3948
4502
|
*/
|
|
3949
4503
|
private beginFreshPlan;
|
|
4504
|
+
/**
|
|
4505
|
+
* The fresh plan of a goal its gate let in. The slot that gate took stays
|
|
4506
|
+
* through the old scope's end: given back, the pool offers it on at once, and
|
|
4507
|
+
* a sibling's kept turn leaves this one none (ADR-0055 D18). That end takes
|
|
4508
|
+
* the process of any turn this one replaces, as {@link endTurnLease} would.
|
|
4509
|
+
*/
|
|
4510
|
+
private beginFreshPlanForTurn;
|
|
3950
4511
|
/**
|
|
3951
4512
|
* Return the Session to a blank slate — hosts call this on "new session".
|
|
3952
4513
|
* Everything scoped to the old session goes: the live AI conversation, plan,
|
|
@@ -3985,6 +4546,13 @@ declare class Session {
|
|
|
3985
4546
|
* the session.
|
|
3986
4547
|
*/
|
|
3987
4548
|
assertPlannerReady(): void;
|
|
4549
|
+
/**
|
|
4550
|
+
* What a turn on the session this Session has open passes. Not part of
|
|
4551
|
+
* {@link assertPlannerReady}, which a new goal passes too: under a minted id
|
|
4552
|
+
* that goal leaves a held session behind, and {@link claimHostSession} judges
|
|
4553
|
+
* a fixed one.
|
|
4554
|
+
*/
|
|
4555
|
+
private assertTurnMayRun;
|
|
3988
4556
|
/**
|
|
3989
4557
|
* The planner gate for a turn {@link PlanTurns} does not open — an opening,
|
|
3990
4558
|
* plan generation, a compaction — the same one its turns pass: wait for the
|
|
@@ -3998,6 +4566,9 @@ declare class Session {
|
|
|
3998
4566
|
* no longer be refused as one sent during it.
|
|
3999
4567
|
*/
|
|
4000
4568
|
private plannerTurnMayOpen;
|
|
4569
|
+
/** A subplanner's turn that {@link PlanTurns} does not open waits for a slot like one it does (ADR-0055 D18), ended as the gate's wait is. Null with one in hand. */
|
|
4570
|
+
private slotForTurn;
|
|
4571
|
+
private plannerGate;
|
|
4001
4572
|
/**
|
|
4002
4573
|
* The installed-planner probe, for a turn at the gate to wait on. No planner
|
|
4003
4574
|
* has heard of that turn, so the surfaces are told what it waits for, once
|
|
@@ -4125,6 +4696,10 @@ declare class Session {
|
|
|
4125
4696
|
/** The catalog over workspace `roots`; the workspace root alone is the session's own. */
|
|
4126
4697
|
private skillsAt;
|
|
4127
4698
|
private conversationOpening;
|
|
4699
|
+
/** A planner's tools, and for a subplanner the two its parent's attempt answers (ADR-0055 D5). */
|
|
4700
|
+
private offeredTools;
|
|
4701
|
+
/** What the prompt says of this node's limits, as it stands when the planner starts (ADR-0055 D19). */
|
|
4702
|
+
private delegationBrief;
|
|
4128
4703
|
/**
|
|
4129
4704
|
* Load planner-produced tasks, as the check they landed through resolved
|
|
4130
4705
|
* them against the catalog read live: it may have changed since planning
|
|
@@ -4372,6 +4947,9 @@ declare class Session {
|
|
|
4372
4947
|
*/
|
|
4373
4948
|
private adoptRun;
|
|
4374
4949
|
destroy(): void;
|
|
4950
|
+
private letLeaseGo;
|
|
4951
|
+
/** Destroyed, with everything under it gone and its lease let go. */
|
|
4952
|
+
get gone(): Promise<void>;
|
|
4375
4953
|
/**
|
|
4376
4954
|
* The planner's settings or credentials changed: its backend is let go and
|
|
4377
4955
|
* built afresh from them, once no planner turn is running on it (see
|
|
@@ -4380,6 +4958,46 @@ declare class Session {
|
|
|
4380
4958
|
plannerSettingsChanged(): void;
|
|
4381
4959
|
}
|
|
4382
4960
|
|
|
4961
|
+
/** How one `docker` command ended; `code` is -1 for a CLI that could not start. */
|
|
4962
|
+
interface DockerResult {
|
|
4963
|
+
code: number;
|
|
4964
|
+
stdout: string;
|
|
4965
|
+
stderr: string;
|
|
4966
|
+
/** Its stdout passed {@link DockerCall.stdoutTo}'s limit, and it was killed for it. */
|
|
4967
|
+
overflowed?: true;
|
|
4968
|
+
}
|
|
4969
|
+
interface DockerCall {
|
|
4970
|
+
input?: string | Buffer;
|
|
4971
|
+
/** Over this host's, for the CLI: what `-e NAME` hands over, so a secret never sits in an argument (ADR-0022 A5). */
|
|
4972
|
+
env?: Readonly<Record<string, string>>;
|
|
4973
|
+
timeoutMs?: number;
|
|
4974
|
+
/** Stdout to a file rather than to memory, for a bundle of any size up to `maxBytes`. */
|
|
4975
|
+
stdoutTo?: {
|
|
4976
|
+
file: string;
|
|
4977
|
+
maxBytes: number;
|
|
4978
|
+
};
|
|
4979
|
+
}
|
|
4980
|
+
/**
|
|
4981
|
+
* The Docker API through the docker CLI (ADR-0059 L5): one code path for any
|
|
4982
|
+
* engine that speaks it, which keeps whatever context the user chose.
|
|
4983
|
+
*/
|
|
4984
|
+
interface DockerCli {
|
|
4985
|
+
call(args: readonly string[], opts?: DockerCall): Promise<DockerResult>;
|
|
4986
|
+
/** A command that runs for as long as a container does, with its stdio left open. */
|
|
4987
|
+
entry(args: readonly string[]): Promise<ChildProcess>;
|
|
4988
|
+
}
|
|
4989
|
+
|
|
4990
|
+
/**
|
|
4991
|
+
* A session delete's half of it, which has no Session or backend to ask. Without
|
|
4992
|
+
* the setting nothing has been put in an engine, and Docker is not asked: a user
|
|
4993
|
+
* of local worktrees may have none (ADR-0059 L4). Under a setting it cannot use
|
|
4994
|
+
* it clears what it can find by label, and the pins wait for one it can.
|
|
4995
|
+
*/
|
|
4996
|
+
declare function reclaimContainers(tree: string, raw: unknown, { cli, tell }?: {
|
|
4997
|
+
cli?: DockerCli;
|
|
4998
|
+
tell?: (text: string) => void;
|
|
4999
|
+
}): Promise<void>;
|
|
5000
|
+
|
|
4383
5001
|
/**
|
|
4384
5002
|
* A request on the plan the session refused: a direct (non-planner) edit that
|
|
4385
5003
|
* is not valid, or an isolation action on a plan with no isolated run to act
|
|
@@ -4509,7 +5127,7 @@ declare class VerdictEngine {
|
|
|
4509
5127
|
private clearIdle;
|
|
4510
5128
|
/** What a task's waiting checkpoint asks, untruncated; undefined when none waits. */
|
|
4511
5129
|
getCheckpointQuestion(taskId: string): string | undefined;
|
|
4512
|
-
approveCheckpoint(taskId: string): void;
|
|
5130
|
+
approveCheckpoint(taskId: string, note?: string): void;
|
|
4513
5131
|
rejectCheckpoint(taskId: string, reason: string): void;
|
|
4514
5132
|
/**
|
|
4515
5133
|
* An attempt's runner is being started, with no session to watch yet. Its
|
|
@@ -4532,7 +5150,7 @@ declare class VerdictEngine {
|
|
|
4532
5150
|
* attempt, unless that attempt is no longer the task's current one or an
|
|
4533
5151
|
* earlier call already settled it.
|
|
4534
5152
|
*/
|
|
4535
|
-
signalComplete(taskId: string, generation: number, report: TaskCompleteArgs): void;
|
|
5153
|
+
signalComplete(taskId: string, generation: number, report: TaskCompleteArgs, refuted?: VerificationCheck): void;
|
|
4536
5154
|
/**
|
|
4537
5155
|
* A script task's exit status (ADR-0035): its one evidence, as a runner's
|
|
4538
5156
|
* `task_complete` call is a runner's. It settles the attempt unless that
|
|
@@ -4583,49 +5201,6 @@ declare class BufferedTaskOutputSource implements TaskOutputSource {
|
|
|
4583
5201
|
private append;
|
|
4584
5202
|
}
|
|
4585
5203
|
|
|
4586
|
-
/** One source for the spawn options, so a runner built on this base cannot drift from the interface. */
|
|
4587
|
-
type RunnerSpawnOptions = Parameters<IRunner['spawn']>[0];
|
|
4588
|
-
declare abstract class AbstractRunnerSession implements IRunnerSession {
|
|
4589
|
-
id: string;
|
|
4590
|
-
taskId: string;
|
|
4591
|
-
protected exited: boolean;
|
|
4592
|
-
protected outputEmitter: EventEmitter<any>;
|
|
4593
|
-
protected exitEmitter: EventEmitter<any>;
|
|
4594
|
-
constructor(id: string, taskId: string);
|
|
4595
|
-
protected baseHandleExit(code: number): void;
|
|
4596
|
-
onOutput(callback: (text: string) => void): void;
|
|
4597
|
-
onExit(callback: (code: number) => void): void;
|
|
4598
|
-
abstract kill(): void;
|
|
4599
|
-
abstract stop(): Promise<void>;
|
|
4600
|
-
abstract getOutput(): string;
|
|
4601
|
-
abstract write(text: string): void;
|
|
4602
|
-
abstract turnState(): 'working' | 'idle';
|
|
4603
|
-
abstract onTurnEnd(listener: (reason: StructuredTurnEnd) => void): void;
|
|
4604
|
-
abstract onEvent(listener: (event: StructuredEvent) => void): void;
|
|
4605
|
-
abstract sendMessage(text: string, from?: TaskMessageFrom): string;
|
|
4606
|
-
abstract forceSend(text: string): string;
|
|
4607
|
-
abstract forceSendQueued(id: string): boolean;
|
|
4608
|
-
abstract removeQueued(id: string): boolean;
|
|
4609
|
-
abstract queued(): QueuedTaskMessage[];
|
|
4610
|
-
abstract interrupt(): Promise<void>;
|
|
4611
|
-
abstract nativeSessionId(): string | null;
|
|
4612
|
-
abstract commands(): RunnerCommand$1[];
|
|
4613
|
-
abstract invokeCommand(name: string, args?: string): string;
|
|
4614
|
-
abstract answerPermission(id: string, decision: ApprovalDecision): boolean | Promise<boolean>;
|
|
4615
|
-
abstract onTaskComplete(listener: (report: TaskCompleteArgs) => void): void;
|
|
4616
|
-
abstract onToolCheckpoint(handler: (question: string, signal: AbortSignal) => Promise<CheckpointAnswer>): void;
|
|
4617
|
-
abstract onScriptExit(listener: (exit: ScriptExit) => void): void;
|
|
4618
|
-
}
|
|
4619
|
-
declare abstract class AbstractRunner<S extends IRunnerSession> implements IRunner {
|
|
4620
|
-
protected sessions: Map<string, S>;
|
|
4621
|
-
get activeCount(): number;
|
|
4622
|
-
/** A session winding down stays registered until it exits, so a second stop gets the same wind-down. */
|
|
4623
|
-
stop(sessionId: string): Promise<void>;
|
|
4624
|
-
stopAll(): void;
|
|
4625
|
-
protected registerSession(id: string, session: S): void;
|
|
4626
|
-
abstract spawn(opts: RunnerSpawnOptions): Promise<IRunnerSession>;
|
|
4627
|
-
}
|
|
4628
|
-
|
|
4629
5204
|
interface StructuredRunnerDeps {
|
|
4630
5205
|
/** The OS boundary the adapters spawn through. `workspaceEnv` is always the spawn's own `env`. */
|
|
4631
5206
|
process?: Partial<Omit<AgentProcessDeps, 'workspaceEnv'>>;
|
|
@@ -4649,8 +5224,9 @@ interface SessionLaunch {
|
|
|
4649
5224
|
savePatch?: (signal: AbortSignal) => Promise<McpToolReply>;
|
|
4650
5225
|
webReads?: TaskWebReads;
|
|
4651
5226
|
};
|
|
4652
|
-
checkHandoff: (completion: TaskCompleteArgs) => HandoffCheck<TaskCompleteArgs
|
|
4653
|
-
readTask?: (args: ReadTaskArgs) => McpToolReply
|
|
5227
|
+
checkHandoff: (completion: TaskCompleteArgs) => HandoffCheck<TaskCompleteArgs> | Promise<HandoffCheck<TaskCompleteArgs>>;
|
|
5228
|
+
readTask?: (args: ReadTaskArgs) => McpToolReply | Promise<McpToolReply>;
|
|
5229
|
+
post?: (args: PostArgs) => McpToolReply | Promise<McpToolReply>;
|
|
4654
5230
|
applyPatch?: (args: ApplyPatchArgs) => Promise<McpToolReply>;
|
|
4655
5231
|
onNotice?: (message: string) => void;
|
|
4656
5232
|
onAttaching?: (spawn: 1 | 2) => void;
|
|
@@ -5033,6 +5609,10 @@ interface ScriptSessionSetup {
|
|
|
5033
5609
|
file: string;
|
|
5034
5610
|
maxChars: number;
|
|
5035
5611
|
};
|
|
5612
|
+
/** A read-only script runs here, or not at all (ADR-0055 D8). */
|
|
5613
|
+
sealed?: TaskShell;
|
|
5614
|
+
/** The lease's container, which every step runs in (ADR-0059 L5). */
|
|
5615
|
+
placement?: RunnerPlacement;
|
|
5036
5616
|
}
|
|
5037
5617
|
/**
|
|
5038
5618
|
* One attempt of a script task (ADR-0035): its body run at the workspace root
|
|
@@ -5048,6 +5628,14 @@ interface ScriptSessionSetup {
|
|
|
5048
5628
|
* the group (`setsid`, `setpgrp`) is out of reach of a group signal, and once
|
|
5049
5629
|
* its parent exits nothing ties it to the step: holding it is the work of a
|
|
5050
5630
|
* boundary around the task, a container or a lease (#97, #99), not of a signal.
|
|
5631
|
+
*
|
|
5632
|
+
* A read-only script's steps run sealed instead (ADR-0055 D8), in the shell a
|
|
5633
|
+
* read-only task's commands use and in its throwaway worktree: Stop and the time
|
|
5634
|
+
* limit reach them through its signal, and what they print comes as each ends.
|
|
5635
|
+
*
|
|
5636
|
+
* Under a container lease every step runs there, by the lease's placement, in
|
|
5637
|
+
* place of all of that: the group this host signals is a client, and the
|
|
5638
|
+
* container is the boundary, whatever leaves a process group inside it.
|
|
5051
5639
|
*/
|
|
5052
5640
|
declare class ScriptSession extends AbstractRunnerSession {
|
|
5053
5641
|
private readonly setup;
|
|
@@ -5056,6 +5644,8 @@ declare class ScriptSession extends AbstractRunnerSession {
|
|
|
5056
5644
|
private readonly steps;
|
|
5057
5645
|
private readonly children;
|
|
5058
5646
|
private child;
|
|
5647
|
+
/** The step under way, where a lease runs it. */
|
|
5648
|
+
private placed;
|
|
5059
5649
|
private output;
|
|
5060
5650
|
private running;
|
|
5061
5651
|
private stopped;
|
|
@@ -5065,6 +5655,8 @@ declare class ScriptSession extends AbstractRunnerSession {
|
|
|
5065
5655
|
private logTail;
|
|
5066
5656
|
private omitted;
|
|
5067
5657
|
private full;
|
|
5658
|
+
/** Aborted to end a sealed step, which has no process of its own here to signal. */
|
|
5659
|
+
private readonly sealedEnd;
|
|
5068
5660
|
private markGone;
|
|
5069
5661
|
private readonly gone;
|
|
5070
5662
|
constructor(id: string, taskId: string, setup: ScriptSessionSetup);
|
|
@@ -5072,6 +5664,18 @@ declare class ScriptSession extends AbstractRunnerSession {
|
|
|
5072
5664
|
begin(): void;
|
|
5073
5665
|
private run;
|
|
5074
5666
|
private runStep;
|
|
5667
|
+
/**
|
|
5668
|
+
* A step through the sealed shell: from the worktree root it was cut at, the
|
|
5669
|
+
* only place a sealed run may start, and on into the task's folder. A refusal
|
|
5670
|
+
* ran nothing, so it says it could not start rather than that it failed.
|
|
5671
|
+
*/
|
|
5672
|
+
private sealedStep;
|
|
5673
|
+
/**
|
|
5674
|
+
* What a lease launches for a step. Nothing of this host's goes with it: a
|
|
5675
|
+
* script is the container's own `sh`, whatever shell this host would have
|
|
5676
|
+
* picked, and only what the lease hands over crosses.
|
|
5677
|
+
*/
|
|
5678
|
+
private placedLaunch;
|
|
5075
5679
|
/**
|
|
5076
5680
|
* An argument vector is never joined into a shell string: on POSIX it is
|
|
5077
5681
|
* exec'd as written, and on Windows the launch seam finds the program the
|
|
@@ -5081,6 +5685,8 @@ declare class ScriptSession extends AbstractRunnerSession {
|
|
|
5081
5685
|
private launchOf;
|
|
5082
5686
|
private spawnStep;
|
|
5083
5687
|
private expire;
|
|
5688
|
+
/** Ends the step under way, at each place it may be: a client killed here leaves what it started in a container running. */
|
|
5689
|
+
private endStep;
|
|
5084
5690
|
private print;
|
|
5085
5691
|
private printError;
|
|
5086
5692
|
private openFullOutput;
|
|
@@ -5146,7 +5752,8 @@ type Continuability = {
|
|
|
5146
5752
|
* The rule every surface offers Continue by and the orchestrator enforces: a
|
|
5147
5753
|
* completed, failed or skipped task, or one paused on a usage limit, whose last
|
|
5148
5754
|
* attempt left a session id behind. A conflict is resolved by its repair, not a
|
|
5149
|
-
* new turn — Retry covers it.
|
|
5755
|
+
* new turn — Retry covers it. A delegated task whose question a restart lost
|
|
5756
|
+
* still has its child, so Continue is what keeps that work (ADR-0055 D17).
|
|
5150
5757
|
*/
|
|
5151
5758
|
declare function continuability(task: Task): Continuability;
|
|
5152
5759
|
declare function canContinue(task: Task): boolean;
|
|
@@ -5383,33 +5990,6 @@ declare function loadState(baseDir?: string, logger?: ILogger): SavedState | nul
|
|
|
5383
5990
|
declare function clearState(baseDir?: string): void;
|
|
5384
5991
|
declare function stateExists(baseDir?: string): boolean;
|
|
5385
5992
|
|
|
5386
|
-
/**
|
|
5387
|
-
* A path segment for an id that came from outside — a session id from a URL,
|
|
5388
|
-
* a task id a planner wrote. A plain id is used as is; anything that could
|
|
5389
|
-
* climb out of its directory, or is not portable as a file name, is hex-encoded.
|
|
5390
|
-
*/
|
|
5391
|
-
declare function idSegment(id: string): string;
|
|
5392
|
-
/**
|
|
5393
|
-
* The directory beside a session's file for what it keeps outside that file —
|
|
5394
|
-
* its task logs (ADR-0018, P1). It goes when the session does.
|
|
5395
|
-
*/
|
|
5396
|
-
declare function sessionDataDir(sessionId: string, baseDir?: string): string;
|
|
5397
|
-
declare function saveSession(plan: LegacyPlanState, goal: string, baseDir?: string, id?: string): SessionMeta;
|
|
5398
|
-
declare function listSessions(baseDir?: string, logger?: ILogger): SessionMeta[];
|
|
5399
|
-
declare function loadSession(sessionId: string, baseDir?: string, logger?: ILogger): {
|
|
5400
|
-
meta: SessionMeta;
|
|
5401
|
-
plan: LegacyPlanState;
|
|
5402
|
-
} | null;
|
|
5403
|
-
declare function loadSessionPlanState(sessionId: string, baseDir?: string, logger?: ILogger): {
|
|
5404
|
-
meta: SessionMeta;
|
|
5405
|
-
plan: PlanState;
|
|
5406
|
-
} | null;
|
|
5407
|
-
declare function getLatestSession(baseDir?: string, logger?: ILogger): {
|
|
5408
|
-
meta: SessionMeta;
|
|
5409
|
-
plan: LegacyPlanState;
|
|
5410
|
-
} | null;
|
|
5411
|
-
declare function deleteSession(sessionId: string, baseDir?: string, logger?: ILogger): boolean;
|
|
5412
|
-
|
|
5413
5993
|
declare function mintSessionId(): string;
|
|
5414
5994
|
|
|
5415
5995
|
interface PrdBlock {
|
|
@@ -5474,4 +6054,4 @@ declare function parseVersion(version: string): number[] | null;
|
|
|
5474
6054
|
/** Negative, zero or positive as `a` is older than, the same as, or newer than `b`; an unreadable version sorts oldest. */
|
|
5475
6055
|
declare function compareVersions(a: string, b: string): number;
|
|
5476
6056
|
|
|
5477
|
-
export { ALL_PROVIDERS, AbstractRunner, AbstractRunnerSession, AccountLimitBucket, type AccountLimitCollector, type AccountLimitListener, AccountLimitMonitor, type AccountLimitMonitorOptions, type AccountLimitReading, AccountLimitSnapshot, type Adr0013IsolationRun, type Adr0013PlanIsolation, type Adr0013TaskRecord, AgentAdapter, AgentEvent, AgentProcessDeps, AgentStartOptions, AiProvider, AlreadyExecutingError, ApprovalAnswer, ApprovalDecision, ApprovalModeSetting, ApprovalPolicy, AssignmentScope, BaseAiService, BaseConfig, BaseFileSystem, BashOptions, BatchQuoteError, 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, type ClaudeAccountLimitOptions, ClaudeCodeAdapter, type CodexAccountLimitOptions, CodexAdapter, CodexSandboxAvailability, CommandLineTooLongError, CommandOutcome, type ConfiguredPlanner,
|
|
6057
|
+
export { ALL_PROVIDERS, AbstractRunner, AbstractRunnerSession, AccountLimitBucket, type AccountLimitCollector, type AccountLimitListener, AccountLimitMonitor, type AccountLimitMonitorOptions, type AccountLimitReading, AccountLimitSnapshot, type Adr0013IsolationRun, type Adr0013PlanIsolation, type Adr0013TaskRecord, AgentAdapter, AgentEvent, AgentProcessDeps, AgentStartOptions, AiProvider, AlreadyExecutingError, ApprovalAnswer, ApprovalDecision, ApprovalModeSetting, ApprovalPolicy, AssignmentScope, BaseAiService, BaseConfig, BaseFileSystem, BashOptions, BatchQuoteError, 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, type ChildPlacement, type ClaudeAccountLimitOptions, ClaudeCodeAdapter, type CodexAccountLimitOptions, CodexAdapter, CodexSandboxAvailability, CommandLineTooLongError, CommandOutcome, type ConfiguredPlanner, 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, Escalation, type ExecImpl, ExecutableNotFoundError, ExecutionActor, ExecutionCommand, FindSymbolOptions, GREP_PCRE_PROBE_ARGS, GeminiService, type GitExecFn, GlobOptions, GlobalRunSettings, type GrepInvocation, GrepOptions, type GrepRegex, HARNESS_PLANNER_REASON, HandoffCheck, type HasBinFn, HttpWebFetcher, type HttpWebFetcherOptions, IAiService, IApproval, IConfig, IFileSystem, IIsolationPreview, ILogger, INotification, IRunner, IRunnerSession, type ISearchProvider, IWorktreeIsolation, IsolationRemoval, IsolationTaskStatus, IsolationView, type KillTreeDeps, type LaunchDeps, type LaunchPlan, LeaseHost, LegacyPlanState, LiveTail, LiveTailOptions, Mandate, MandateRequest, McpToolReply, ModelResolver, type ModelResolverDeps, type NativeShellLauncher, type NativeShellOffer, NoPlanError, NodeAuthority, OPENCODE_MANIFEST, ORDEWELL_SETTABLE_ENV, OpenAiService, OpenCodeAdapter, type OpenCodeGoAccountLimitOptions, OrchestratorObserver, OrchestratorOption, OrdewellMcpServer, PROVIDER_CREDENTIAL_ENV, PROVIDER_DETECT_PRIORITY, PROVIDER_LABEL, PROVIDER_PRIORITY, PROVIDER_SHORT_LABEL, type ParsedCommand, PendingApproval, PendingApprovals, type PingFetch, 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, PlannerShellSandbox, PlannerToolHandler, type PlannerUsability, PlannerUsage, PostArgs, type PrdBlock, ProviderModelLists, type ProviderRegistration, QueuedTaskMessage, ReadFileOpts, ReadTaskArgs, ReportedWindow, type ResearchChat, ResearchLogEntry, ResearchShell, type ResearchTurn, type ResolvedChoice, type ResolvedPlanner, RewindTarget, RunActivity, RunMergeView, RunView, RunnerApprovals, RunnerAuth, RunnerAuthExec, RunnerCommand$1 as RunnerCommand, RunnerId, RunnerInstallation, type RunnerInstallationOptions, RunnerManifest, RunnerModeInfo, RunnerRegistry, RunnerSessionCost, type RunnerSpawnOptions, SCRIPT_RUNNER, SETTINGS_ENV_ALLOWLIST, SETTINGS_ENV_REFUSED, STATE_DIR, STATE_DIR_IGNORE, STOPPED_TOOL_RESULT, SYMBOL_LANGUAGES, type SaveSession, type SavedState, ScriptBody, ScriptExit, ScriptRunner, ScriptSession, type SearchHit, type SearchOutcome, type SearchPage, type SearchTransport, Session, SessionBroadcaster, type SessionDeps, SessionHeld, SessionLease, SessionMessage, SessionNotFoundError, SessionNotice, type SessionPlanner, type SessionRuntimeSettings, ShellLaunch, SkillsService, type SpawnSpec, StdioAgentAdapter, StoredHandoff, StructuredEvent, StructuredRunner, type StructuredRunnerDeps, StructuredSession, StructuredTurnEnd, SubtreeReport, Task, TaskCompleteArgs, TaskControlError, type TaskEditOptions, TaskLogEvent, type TaskLogFile, type TaskLogLocation, TaskLogRecorder, type TaskLogRecorderDeps, TaskMessageFrom, TaskModeAgentAdapter, TaskOrchestrator, TaskOrchestratorOptions, TaskOutputSource, TaskQueryCatalog, TaskRevertPreview, TaskRunnerConfig, TaskRunnerFlags, TaskShell, TaskShellSite, TaskStartOptions, TaskTokenScope, type TokenCarriers, type ToolCall, ToolOutcome, type ToolResult, UsageRecord, UserSettings, VERSION_CHECK_NOTICE, VERSION_CHECK_URL, VerdictEngine, type VerdictListener, VerificationCheck, type VersionCheck, type VersionCheckOptions, 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, claudeAccountLimitCollector, clearAugmentedPathCache, clearDaemonToken, clearState, clipboardCopyCommand, codexAccountLimitCollector, codexSandboxNotice, compareVersions, configuredProviders, continuability, createIsolationPreview, createNativeShellLauncher, createSession, createTaskAdapter, createWorktreeIsolation, daemonTokenPath, defaultEnabledRunners, definitionPattern, detectInstalledPlanner, discardChildRuns, discoverGeminiModels, ensureDir, ensurePrivateDir, ensureStateDirIgnored, extractPrdBlock, extractPresentedToken, filterFallbackByAnchoredInclude, findInstalledPlanner, formatSearchOutput, getProviderMeta, getStateDir, globalDataDir, grantScopeFor, grepRegexFromProbe, includeGlobFor, installedPlannerAnswered, installedPlannerDetected, isApiProvider, isCliProvider, isExecutableResolved, isOpenAiProvider, isPlannerBackend, isVendorModelFor, isolationViewOfPlan, killTree, languageForId, listTaskLogAttempts, listTree, loadState, looksLikeChallenge, migrateOldConfigDir, migratePlanIsolation, mintDaemonToken, mintSessionId, nativeShellInvocation, nativeShellOffer, normalizeGeminiModel, notifyCommandOf, openCodeGoAccountLimitCollector, openTaskLog, parseExecutionCommand, parseMaxParallel, parseSearchHits, parseVersion, planDirectLaunch, plannerBackendEntries, prefixModelId, prepareTaskOutputFile, providerForRunner, readDaemonToken, readTaskLog, readTaskPatch, reclaimContainers, recordInstalledPlanner, recordedInstalledPlanner, referencePattern, removedPluginNotice, repositoryRunnerConfigPaths, resetInstalledPlanner, resolveProviderFromPrefix, resolveTaskRunnerFlags, resolveWithin, runnerForProvider, sanitizeSlug, savePrdMarkdown, saveState, saveTaskPatch, selectPlanner, sessionRuntimeSettings, sharedSearchProvider, sharedWebResponseCache, shellQuoted, startVersionCheck, stateExists, stripAnsi, stripModelPrefix, supportsTaskMode, taskPatchFile, tokenSubprotocols, tokensMatch, wellKnownBinDirs, windowsCommandLine, withPath, writeFileAtomic, writePrivateFile };
|