@bastani/atomic 0.9.85-alpha.1 → 0.9.86-alpha.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.
Files changed (125) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +25 -0
  3. package/dist/builtin/intercom/README.md +10 -9
  4. package/dist/builtin/intercom/broker/away-asks.ts +260 -0
  5. package/dist/builtin/intercom/broker/broker.ts +170 -9
  6. package/dist/builtin/intercom/broker/client.ts +5 -3
  7. package/dist/builtin/intercom/broker/held-reply-targets.ts +5 -0
  8. package/dist/builtin/intercom/broker/multinode-router.ts +16 -7
  9. package/dist/builtin/intercom/broker/paths.ts +5 -0
  10. package/dist/builtin/intercom/broker/pending-question-index.ts +119 -0
  11. package/dist/builtin/intercom/broker/released-asker-replies.ts +39 -0
  12. package/dist/builtin/intercom/broker/send-handler.ts +44 -3
  13. package/dist/builtin/intercom/broker/terminal-questions.ts +2 -0
  14. package/dist/builtin/intercom/index.bundle.mjs +799 -177
  15. package/dist/builtin/intercom/package.json +1 -1
  16. package/dist/builtin/intercom/retry-policy.ts +1 -1
  17. package/dist/builtin/intercom/skills/intercom/SKILL.md +29 -35
  18. package/dist/builtin/intercom/types.ts +7 -2
  19. package/dist/builtin/mcp/package.json +1 -1
  20. package/dist/builtin/subagents/CHANGELOG.md +20 -0
  21. package/dist/builtin/subagents/package.json +1 -1
  22. package/dist/builtin/subagents/skills/subagent/SKILL.md +1 -1
  23. package/dist/builtin/subagents/src/extension/index.bundle.mjs +2765 -2719
  24. package/dist/builtin/web-access/package.json +1 -1
  25. package/dist/builtin/workflows/CHANGELOG.md +22 -0
  26. package/dist/builtin/workflows/package.json +1 -1
  27. package/dist/builtin/workflows/src/authoring.d.ts +1 -1
  28. package/dist/builtin/workflows/src/extension/index.bundle.mjs +371 -193
  29. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +358 -181
  30. package/dist/builtin/workflows/src/index.js +356 -183
  31. package/dist/builtin/workflows/src/local-worker-entry.mjs +358 -181
  32. package/dist/builtin/workflows/src/shared/worktree-restore-outcome.d.ts +16 -0
  33. package/dist/builtin/workflows/src/workers/workspace-binding.d.ts +13 -2
  34. package/dist/core/agent-session-methods.d.ts +1 -0
  35. package/dist/core/agent-session-methods.d.ts.map +1 -1
  36. package/dist/core/agent-session-methods.js.map +1 -1
  37. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  38. package/dist/core/agent-session-prompt.js +2 -35
  39. package/dist/core/agent-session-prompt.js.map +1 -1
  40. package/dist/core/agent-session-runtime.d.ts +3 -1
  41. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  42. package/dist/core/agent-session-runtime.js +12 -5
  43. package/dist/core/agent-session-runtime.js.map +1 -1
  44. package/dist/core/agent-session-state.d.ts.map +1 -1
  45. package/dist/core/agent-session-state.js +14 -1
  46. package/dist/core/agent-session-state.js.map +1 -1
  47. package/dist/core/agent-session.d.ts +2 -0
  48. package/dist/core/agent-session.d.ts.map +1 -1
  49. package/dist/core/agent-session.js +3 -1
  50. package/dist/core/agent-session.js.map +1 -1
  51. package/dist/core/resume/index.d.ts +1 -1
  52. package/dist/core/resume/index.d.ts.map +1 -1
  53. package/dist/core/resume/index.js +1 -1
  54. package/dist/core/resume/index.js.map +1 -1
  55. package/dist/core/resume/path-mapping.d.ts +10 -0
  56. package/dist/core/resume/path-mapping.d.ts.map +1 -1
  57. package/dist/core/resume/path-mapping.js +20 -0
  58. package/dist/core/resume/path-mapping.js.map +1 -1
  59. package/dist/core/resume/session-resume.d.ts +5 -0
  60. package/dist/core/resume/session-resume.d.ts.map +1 -1
  61. package/dist/core/resume/session-resume.js +24 -9
  62. package/dist/core/resume/session-resume.js.map +1 -1
  63. package/dist/core/session-worktree-snapshots.d.ts +5 -8
  64. package/dist/core/session-worktree-snapshots.d.ts.map +1 -1
  65. package/dist/core/session-worktree-snapshots.js +34 -99
  66. package/dist/core/session-worktree-snapshots.js.map +1 -1
  67. package/dist/core/skill-catalog.d.ts +11 -0
  68. package/dist/core/skill-catalog.d.ts.map +1 -1
  69. package/dist/core/skill-catalog.js +31 -0
  70. package/dist/core/skill-catalog.js.map +1 -1
  71. package/dist/core/tasks/agent-adapter.d.ts +2 -0
  72. package/dist/core/tasks/agent-adapter.d.ts.map +1 -1
  73. package/dist/core/tasks/agent-adapter.js +5 -1
  74. package/dist/core/tasks/agent-adapter.js.map +1 -1
  75. package/dist/core/tasks/supervisor.d.ts +17 -0
  76. package/dist/core/tasks/supervisor.d.ts.map +1 -1
  77. package/dist/core/tasks/supervisor.js +12 -6
  78. package/dist/core/tasks/supervisor.js.map +1 -1
  79. package/dist/core/tasks/task-view-source.d.ts +10 -0
  80. package/dist/core/tasks/task-view-source.d.ts.map +1 -1
  81. package/dist/core/tasks/task-view-source.js +24 -1
  82. package/dist/core/tasks/task-view-source.js.map +1 -1
  83. package/dist/core/worktree-snapshot/best-restore.d.ts +45 -0
  84. package/dist/core/worktree-snapshot/best-restore.d.ts.map +1 -0
  85. package/dist/core/worktree-snapshot/best-restore.js +92 -0
  86. package/dist/core/worktree-snapshot/best-restore.js.map +1 -0
  87. package/dist/core/worktree-snapshot/git.d.ts +2 -2
  88. package/dist/core/worktree-snapshot/git.d.ts.map +1 -1
  89. package/dist/core/worktree-snapshot/git.js +2 -5
  90. package/dist/core/worktree-snapshot/git.js.map +1 -1
  91. package/dist/core/worktree-snapshot/index.d.ts +1 -0
  92. package/dist/core/worktree-snapshot/index.d.ts.map +1 -1
  93. package/dist/core/worktree-snapshot/index.js +1 -0
  94. package/dist/core/worktree-snapshot/index.js.map +1 -1
  95. package/dist/core/worktree-snapshot/restore.d.ts.map +1 -1
  96. package/dist/core/worktree-snapshot/restore.js +18 -2
  97. package/dist/core/worktree-snapshot/restore.js.map +1 -1
  98. package/dist/index.d.ts +3 -2
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +1 -0
  101. package/dist/index.js.map +1 -1
  102. package/dist/modes/interactive/chat-autocomplete.d.ts +7 -0
  103. package/dist/modes/interactive/chat-autocomplete.d.ts.map +1 -0
  104. package/dist/modes/interactive/chat-autocomplete.js +85 -0
  105. package/dist/modes/interactive/chat-autocomplete.js.map +1 -0
  106. package/dist/modes/interactive/components/task-transcript-page.d.ts.map +1 -1
  107. package/dist/modes/interactive/components/task-transcript-page.js +8 -0
  108. package/dist/modes/interactive/components/task-transcript-page.js.map +1 -1
  109. package/dist/modes/interactive/interactive-autocomplete.js +3 -79
  110. package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  111. package/dist/modes/interactive/skill-command-autocomplete.d.ts +6 -0
  112. package/dist/modes/interactive/skill-command-autocomplete.d.ts.map +1 -1
  113. package/dist/modes/interactive/skill-command-autocomplete.js +18 -2
  114. package/dist/modes/interactive/skill-command-autocomplete.js.map +1 -1
  115. package/docs/background-tasks.md +1 -1
  116. package/docs/intercom/operations.md +4 -4
  117. package/docs/intercom/reference.md +39 -8
  118. package/docs/intercom.md +26 -9
  119. package/docs/skills.md +3 -1
  120. package/docs/subagents.md +2 -0
  121. package/docs/workflows/api-reference.md +3 -3
  122. package/docs/workflows/operations.md +2 -2
  123. package/docs/worktree-snapshots.md +10 -4
  124. package/npm-shrinkwrap.json +32 -32
  125. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session.d.ts","sourceRoot":"","sources":["../../src/core/agent-session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAGnG,OAAO,EAEN,2BAA2B,EAE3B,MAAM,0CAA0C,CAAC;AAUlD,OAAO,KAAK,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEzG,OAAO,KAAK,EAA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;IACD,6FAA6F;IAC7F,IAAI,SAAS,IAAI,OAAO,wBAAwB,EAAE,cAAc,GAAG,SAAS,CAE3E;IACD,mBAAmB,CAAC,IAAI,EAAE,OAAO,uBAAuB,EAAE,gBAAgB,GAAG,IAAI,CAGhF;IAED,YAAY,MAAM,EAAE,kBAAkB,EA2KrC;CACD;AAgBD,MAAM,WAAW,YAAa,SAAQ,gBAAgB,EAAE,yBAAyB;CAAG;AAEpF,eAAO,MAAM,YAAY,EAAkC;IAC1D,KAAK,MAAM,EAAE,kBAAkB,GAAG,YAAY,CAAC;IAC/C,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;CACjC,CAAC"}
@@ -30,7 +30,7 @@ import { agentSessionTaskMethods, isSubagentChildSession } from "./agent-session
30
30
  import { agentSessionToolHooksMethods } from "./agent-session-tool-hooks.js";
31
31
  import { agentSessionToolRegistryMethods } from "./agent-session-tool-registry.js";
32
32
  import { agentSessionTreeMethods } from "./agent-session-tree.js";
33
- import { currentWorktreeRootMappings } from "./resume/path-mapping.js";
33
+ import { currentWorktreeRestoreNotices, currentWorktreeRootMappings } from "./resume/path-mapping.js";
34
34
  import { SessionWorktreeSnapshotRecorder } from "./session-worktree-snapshots.js";
35
35
  import { applyToolModifiers } from "./settings-merge.js";
36
36
  import { ChildTaskWaits } from "./tasks/child-command-owner.js";
@@ -205,6 +205,8 @@ class AgentSessionBase {
205
205
  _toolExecutionScheduler = new ToolExecutionScheduler();
206
206
  /** The restores of the sessions and runs this session was opened in, which its tools follow before its own. */
207
207
  _outerWorktreeRootMappings = currentWorktreeRootMappings();
208
+ /** The notices of partly restored or unrestored checkouts of the runs this session was opened in (#4738). */
209
+ _worktreeRestoreNotices = currentWorktreeRestoreNotices();
208
210
  _toolDefinitions = new Map();
209
211
  _toolPromptSnippets = new Map();
210
212
  _toolPromptGuidelines = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"agent-session.js","sourceRoot":"","sources":["../../src/core/agent-session.ts"],"names":[],"mappings":"A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,uCAAuC,EACvC,oCAAoC,EACpC,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,EAC1B,+BAA+B,EAC/B,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,CACvB,CAAC","sourcesContent":["/**\n * AgentSession - Core abstraction for agent lifecycle and session management.\n *\n * The historical import path is preserved here as a facade. Responsibilities are\n * implemented in sibling modules by lifecycle area so each authored source file\n * stays focused.\n */\n\nimport { join } from \"node:path\";\nimport type { Api, AssistantMessage, Model } from \"@bastani/pi-ai/compat\";\nimport type { Agent, AgentMessage, AgentTool, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { installAgentSessionAccessors } from \"./agent-session-accessors.ts\";\nimport { agentSessionAutoCompactionMethods } from \"./agent-session-auto-compaction.ts\";\nimport {\n\tagentSessionBackgroundCompactionMethods,\n\tBackgroundCompactionRuntime,\n\tinstallBackgroundCompactionAccessors,\n} from \"./agent-session-background-compaction.ts\";\nimport { agentSessionBashMethods } from \"./agent-session-bash.ts\";\nimport { agentSessionBoundaryMethods } from \"./agent-session-boundaries.ts\";\nimport { agentSessionCompactionMethods } from \"./agent-session-compaction.ts\";\nimport { agentSessionCustomMessageCommitMethods } from \"./agent-session-custom-message-commit.ts\";\nimport { agentSessionDetachedToolMethods } from \"./agent-session-detached-tools.ts\";\nimport { agentSessionEventsMethods } from \"./agent-session-events.ts\";\nimport { agentSessionExportMethods } from \"./agent-session-export.ts\";\nimport { agentSessionExtensionBindingsMethods } from \"./agent-session-extension-bindings.ts\";\nimport { agentSessionMessageQueueMethods } from \"./agent-session-message-queue.ts\";\nimport type { AgentSessionInternalSurface, AgentSessionPublicSurface } from \"./agent-session-methods.ts\";\nimport { agentSessionModelsMethods } from \"./agent-session-models.ts\";\nimport type { PendingPostToolCompactionGuard } from \"./agent-session-post-tool-compaction.ts\";\nimport { agentSessionPostToolCompactionMethods } from \"./agent-session-post-tool-compaction.ts\";\nimport { agentSessionPromptMethods } from \"./agent-session-prompt.ts\";\nimport { agentSessionRecoveryMethods } from \"./agent-session-recovery.ts\";\nimport { agentSessionReleaseMethods } from \"./agent-session-release.ts\";\nimport { agentSessionRetryMethods } from \"./agent-session-retry.ts\";\nimport { agentSessionStateMethods } from \"./agent-session-state.ts\";\nimport { agentSessionSummaryMethods, type SessionSummaryRun } from \"./agent-session-summary.ts\";\nimport { agentSessionTaskMethods, isSubagentChildSession } from \"./agent-session-tasks.js\";\nimport { agentSessionToolHooksMethods } from \"./agent-session-tool-hooks.ts\";\nimport { agentSessionToolRegistryMethods } from \"./agent-session-tool-registry.ts\";\nimport { agentSessionTreeMethods } from \"./agent-session-tree.ts\";\nimport type {\n\tAgentSessionConfig,\n\tAgentSessionEventListener,\n\tInterruptQueueHold,\n\tToolDefinitionEntry,\n} from \"./agent-session-types.js\";\nimport type { VerbatimCompactionResult } from \"./compaction/index.ts\";\nimport type {\n\tAgentActivityOutcome,\n\tExtensionCommandContextActions,\n\tExtensionErrorListener,\n\tExtensionMode,\n\tExtensionRunner,\n\tExtensionUIContext,\n\tOrchestrationContext,\n\tSessionStartEvent,\n\tSubagentChildPolicy,\n\tToolDefinition,\n} from \"./extensions/index.js\";\nimport type { BashExecutionMessage, CustomMessage } from \"./messages.ts\";\nimport type { ModelRuntime } from \"./model-runtime.js\";\nimport type { ResourceLoader } from \"./resource-loader.ts\";\nimport { currentWorktreeRootMappings } from \"./resume/path-mapping.ts\";\nimport type { SessionManager } from \"./session-manager.ts\";\nimport { SessionWorktreeSnapshotRecorder } from \"./session-worktree-snapshots.ts\";\nimport type { SettingsManager } from \"./settings-manager.ts\";\nimport { applyToolModifiers } from \"./settings-merge.js\";\nimport type { NormalizedBuildSystemPromptOptions } from \"./system-prompt.ts\";\nimport { ChildTaskWaits } from \"./tasks/child-command-owner.js\";\nimport { createToolNameMatcher } from \"./tool-selection.ts\";\nimport { getDefaultToolNames } from \"./tools/index.js\";\nimport { scheduleSessionTempCleanup } from \"./tools/session-temp-cleanup.ts\";\nimport { acquireProtectedPaths, type ProtectedPathLease, setActiveSessionTempId } from \"./tools/session-temp-dir.ts\";\nimport { ToolExecutionScheduler } from \"./tools/tool-concurrency.ts\";\nimport { TOOL_RESULTS_SUBDIR } from \"./tools/tool-limits.js\";\nimport { WorkflowStageAdmissionBoundary } from \"./workflow-stage-admission.ts\";\nimport { serializeWorkspaceError } from \"./worktree-snapshot/errors.ts\";\n\nexport type { SessionCompactOptions } from \"./agent-session-methods.ts\";\nexport type { ParsedSkillBlock } from \"./agent-session-skill-block.ts\";\nexport { parseSkillBlock } from \"./agent-session-skill-block.ts\";\nexport type {\n\tAgentSessionConfig,\n\tAgentSessionEvent,\n\tAgentSessionEventListener,\n\tClearedQueue,\n\tCompactionReason,\n\tExtensionBindings,\n\tModelCycleResult,\n\tPromptDisposition,\n\tPromptOptions,\n\tQueuedInputDisposition,\n\tSessionRecoveryReport,\n\tSessionStats,\n} from \"./agent-session-types.js\";\n\nclass AgentSessionBase {\n\treadonly agent: Agent;\n\treadonly sessionManager: SessionManager;\n\treadonly settingsManager: SettingsManager;\n\n\tprotected _scopedModels: Array<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\t/** The chain the session was created with, or undefined to follow its settings' current `fallbackModels`. */\n\tprotected _configuredFallbackModels: string[] | undefined;\n\tprotected _isFallbackModelAllowed?: (model: Model<Api>, effort: string | undefined) => boolean;\n\tprotected _fallbackAttemptedKeys: Set<string> = new Set();\n\t/** Models condemned for this turn by a failure retrying them cannot repair. */\n\tprotected _fallbackBlockedModels: Array<Model<Api>> = [];\n\tprotected _fallbackOriginModel: Model<Api> | undefined;\n\tprotected _fallbackOriginThinkingLevel: ThinkingLevel | undefined;\n\tprotected _fallbackScopeGeneration = 0;\n\n\t/**\n\t * The session's fallback chain. Without one of its own it follows its settings' current `fallbackModels`, so a\n\t * project trusted after the session was created applies its list, as an interactive start asks after it (#4223).\n\t */\n\tprotected get _fallbackModels(): string[] {\n\t\treturn this._configuredFallbackModels ?? this.settingsManager.getFallbackModels();\n\t}\n\n\t/** Give the session a chain of its own; it no longer follows its settings. */\n\tprotected set _fallbackModels(models: string[]) {\n\t\tthis._configuredFallbackModels = models;\n\t}\n\tprotected _fallbackOriginGeneration: number | undefined;\n\tprotected _fallbackRestoreError: string | undefined;\n\tprotected _unsubscribeAgent?: () => void;\n\tprotected _eventListeners: AgentSessionEventListener[] = [];\n\tprotected _agentEventQueue: Promise<void> = Promise.resolve();\n\tprotected _steeringMessages: string[] = [];\n\tprotected _followUpMessages: string[] = [];\n\tprotected _interruptDeliveryQueue: Promise<void> = Promise.resolve();\n\tprotected _pendingInterruptDeliveries = 0;\n\tprotected _activeInterruptQueueHold: InterruptQueueHold | undefined = undefined;\n\tprotected _queuedMessagesPaused = false;\n\tprotected _queuedMessagesPauseAbortBoundary: Promise<void> | undefined = undefined;\n\t/**\n\t * Text of a queued steering/follow-up message the agent loop already admitted\n\t * into the transcript and that has not received an assistant reply yet. The\n\t * pause hold cannot reach such a message, so an interrupt would otherwise\n\t * strand it (issue #2362).\n\t */\n\tprotected _admittedQueuedMessageAwaitingReply: string | undefined = undefined;\n\t/**\n\t * Settlement boundary for the recovery turn that answers an already-admitted\n\t * queued message. It starts after the pause abort boundary resolves, so the\n\t * resume path must wait for it too or an ordinary submission made while it\n\t * streams is rejected by the streaming guard (issue #2362).\n\t */\n\tprotected _admittedRecoveryTurn: Promise<void> | undefined = undefined;\n\tprotected _workflowStageDeliveryForwardTarget: AgentSessionInternalSurface | undefined = undefined;\n\tprotected _activeInterruptAbortMessage: string | undefined = undefined;\n\t/** Priority input cancels the native operation, not the host-owned task. */\n\tprotected _priorityInterruptPending = false;\n\tprotected _activePromptCount = 0;\n\tprotected _isPreparingRun: false | \"user\" | \"custom\" = false;\n\t/** Prompts between their start and `_isPreparingRun`, so tree navigation cannot rebuild their context. */\n\tprotected _promptPreflightCount = 0;\n\tprotected _agentRunAbortRequested = false;\n\tprotected _pendingNextTurnMessages: CustomMessage[] = [];\n\t/** Context-only custom messages queued during a run, flushed after the current turn's tool results. */\n\tprotected _pendingCustomMessages: CustomMessage[] = [];\n\tprotected _protectedStreamingCustomMessages: Array<{\n\t\tmessage: CustomMessage;\n\t\tdelivery: \"steer\" | \"followUp\";\n\t\tphase: \"queued\" | \"consumed-unpersisted\" | \"persistence-failed\";\n\t}> = [];\n\tprotected _compactionAbortController: AbortController | undefined = undefined;\n\tprotected _compactionReason: import(\"./agent-session-types.js\").CompactionReason | undefined = undefined;\n\tprotected _manualCompactionPromise: Promise<VerbatimCompactionResult> | undefined = undefined;\n\tprotected _autoCompactionAbortController: AbortController | undefined = undefined;\n\t/** Resolves when the current automatic compaction has settled. */\n\tprotected _autoCompactionCompletion: Promise<void> | undefined = undefined;\n\tprotected _overflowRecoveryAttempted = false;\n\tprotected _recoverableLengthRecoveryAttempted = false;\n\t/** Set when compaction cannot recover a context overflow on the current model. */\n\tprotected _contextOverflowUnresolved = false;\n\tprotected _pendingPostCompactionContinuation: Promise<void> | undefined = undefined;\n\tprotected _postCompactionContinuationToken = 0;\n\tprotected _lengthContinuationAttempts = 0;\n\tprotected _outputBudgetErrorContinuationAttempts = 0;\n\tprotected _postToolCompactionPreflightError: string | undefined = undefined;\n\tprotected _pendingPostToolCompactionGuard: PendingPostToolCompactionGuard | undefined = undefined;\n\tprotected _backgroundCompaction: BackgroundCompactionRuntime;\n\tprotected _terminatingToolCallIds = new Set<string>();\n\t/** A positive stop callback keeps queued work pending until an explicit new run. */\n\tprotected _stopAfterTurnBlockedContinuation = false;\n\tprotected _disposed = false;\n\tprotected _branchSummaryAbortController: AbortController | undefined = undefined;\n\t/** Settles after the currently active branch-summary navigation finishes cleanup. */\n\tprotected _branchSummaryCompletion: Promise<void> | undefined = undefined;\n\tprotected _sessionSummaryAbortController: AbortController | undefined = undefined;\n\tprotected _sessionSummaryToken = 0;\n\t/** The summary request currently in flight, published so a later launch can join it. */\n\tprotected _sessionSummaryRun: SessionSummaryRun | undefined = undefined;\n\tprotected _lastSummarizedMessageId: string | undefined = undefined;\n\tprotected _retryAbortController: AbortController | undefined = undefined;\n\tprotected _retryAttempt = 0;\n\t/** Retries made after an attempt whose stream was cut after a long run, for the current model and turn. */\n\tprotected _longStreamCutRetries = 0;\n\tprotected _retryPromise: Promise<void> | undefined = undefined;\n\tprotected _retryResolve: (() => void) | undefined = undefined;\n\tprotected _bashAbortControllers = new Map<string | symbol, Set<AbortController>>();\n\tprotected _pendingBashMessages: BashExecutionMessage[] = [];\n\tprotected _extensionRunner!: ExtensionRunner;\n\tprotected _turnIndex = 0;\n\t/** Source entry IDs for projected messages, so boundaries and omissions resolve provenance. */\n\tprotected readonly _entryIdsByMessage = new WeakMap<object, string>();\n\t/** Assistant messages whose actionable turn_end already ran from finishTurn. */\n\tprotected readonly _boundaryDispatchedMessages = new WeakSet<object>();\n\t/** Messages whose message_end processing, including their save, has not settled yet. */\n\tprotected readonly _messagesAwaitingPersistence = new WeakMap<object, Promise<void>>();\n\tprotected readonly _messagesWithFailedPersistence = new WeakSet<object>();\n\t/** The reported cause once a message of the current run could not be saved; the run stops (#4226). */\n\tprotected _persistenceFailure: string | undefined = undefined;\n\t/** Interrupted tool calls recovery is running again; their results are pending, not interrupted. */\n\tprotected readonly _reissuedToolCallIds = new Set<string>();\n\tprotected _lastAssistantToolResults: AgentMessage[] = [];\n\tprotected _lastActivityOutcome: AgentActivityOutcome = \"completed\";\n\tprotected _isBeforeSettle = false;\n\tprotected _abortDuringBeforeSettle = false;\n\tprotected _isEmittingAgentSettled = false;\n\tprotected readonly _deferredSettledActions: Array<() => Promise<void>> = [];\n\t/** Set when a caller's prepareNextTurnWithContext replaced the next request's context. */\n\tprotected _callerReplacedNextRequestContext = false;\n\tprotected _resourceLoader: ResourceLoader;\n\tprotected _customTools: ToolDefinition[];\n\tprotected _baseToolDefinitions: Map<string, ToolDefinition> = new Map();\n\tprotected _cwd: string;\n\tprotected _extensionRunnerRef?: { current?: ExtensionRunner };\n\tprotected _initialActiveToolNames?: string[];\n\tprotected _pendingToolNames = new Set<string>();\n\tprotected _restoredToolNames = new Set<string>();\n\t/** Tools `setActiveToolsByName` deactivated whose removal no saved system message has declared yet (#4660). */\n\tprotected _explicitToolDeactivations = new Set<string>();\n\tprotected _usesDefaultTools: boolean;\n\tprotected _defaultToolModifiers: string[];\n\t/** Resolved defaults last applied here, independent of shared settings publication. */\n\tprotected _appliedDefaultTools: Set<string>;\n\tprotected _subagentPolicy?: SubagentChildPolicy;\n\tprotected _allowedToolNames?: Set<string>;\n\tprotected _excludedToolNames?: Set<string>;\n\tprotected _allowedTools?: (name: string) => boolean;\n\tprotected _excludedTools?: (name: string) => boolean;\n\tprotected _childSessionOptions?: import(\"./child-session-options.ts\").ChildSessionOptionsResolver;\n\tprotected _workflowJournal?: import(\"./storage/provider.js\").RunJournalOption;\n\tprotected _storageAgentDir?: string;\n\tprotected _baseToolsOverride?: Record<string, AgentTool>;\n\tprotected _sessionStartEvent: SessionStartEvent;\n\tprotected _orchestrationContext?: OrchestrationContext;\n\tprotected _workspace?: import(\"./workspace/resolve.ts\").BoundWorkspace;\n\tprotected _extensionUIContext?: ExtensionUIContext;\n\tprotected _extensionHumanInput?: import(\"./extensions/host-input.js\").HostInput | null;\n\tprotected _extensionDiagnosticListener?: (diagnostic: import(\"./extensions/host-input.js\").HostDiagnostic) => void;\n\tprotected _extensionMode: ExtensionMode = \"print\";\n\tprotected _extensionCommandContextActions?: ExtensionCommandContextActions;\n\tprotected _extensionShutdownHandler?: () => void;\n\tprotected _extensionErrorListener?: ExtensionErrorListener;\n\tprotected _extensionErrorUnsubscriber?: () => void;\n\tprotected _modelRuntime: ModelRuntime;\n\tprotected _extensionProviderIds = new Set<string>();\n\tprotected _toolRegistry: Map<string, AgentTool> = new Map();\n\tprotected readonly _toolExecutionScheduler = new ToolExecutionScheduler();\n\t/** The restores of the sessions and runs this session was opened in, which its tools follow before its own. */\n\tprotected readonly _outerWorktreeRootMappings = currentWorktreeRootMappings();\n\tprotected _toolDefinitions: Map<string, ToolDefinitionEntry> = new Map();\n\tprotected _toolPromptSnippets: Map<string, string> = new Map();\n\tprotected _toolPromptGuidelines: Map<string, string[]> = new Map();\n\tprotected _baseSystemPromptOptions!: NormalizedBuildSystemPromptOptions;\n\tprotected _systemPromptTransform?: (prompt: string) => string;\n\tprotected _contextProjectionTransform?: (messages: AgentMessage[]) => AgentMessage[];\n\tprotected _runSystemPromptOptions?: NormalizedBuildSystemPromptOptions;\n\tprotected _lastAssistantMessage: AssistantMessage | undefined = undefined;\n\t/** Protection claim on this session's temp tree and tool-results directory. */\n\tprotected _tempStorageLease: ProtectedPathLease | undefined;\n\tprotected _workflowStageAdmission: WorkflowStageAdmissionBoundary | undefined;\n\tprotected _subagentMessageAdmission: WorkflowStageAdmissionBoundary | undefined;\n\t/** A fresh workflow stage whose own prompt has not started its first run (#3919). */\n\tprotected _workflowStageAwaitingFirstPrompt = false;\n\tprotected _agentTaskHost: import(\"./tasks/agent-adapter.js\").AgentTaskHost | undefined;\n\tprotected _parentCommandTaskOwner: import(\"./tasks/child-command-owner.js\").ChildCommandTaskOwner | undefined;\n\tprotected _inheritedHistory: import(\"./tools/history-protocol.ts\").ProjectHistory | undefined;\n\tprotected _resourceAdmission: import(\"./sdk-types.ts\").ResourceAdmission | undefined;\n\tprotected _childTaskWaits = new ChildTaskWaits();\n\tprotected _taskCompletionOutbox: import(\"./tasks/completion.js\").TaskCompletionOutbox | undefined;\n\tprotected _taskAdmission: WorkflowStageAdmissionBoundary | undefined;\n\tprotected _cacheWarmer?: import(\"./cache-warmer.ts\").CacheWarmer;\n\tprotected _worktreeSnapshots: SessionWorktreeSnapshotRecorder;\n\tget cacheWarmingStatus(): import(\"./cache-warmer.ts\").CacheWarmingStatus | undefined {\n\t\treturn this._cacheWarmer?.status;\n\t}\n\t/** The resolved workspace this session is bound to, when it was created with `workspace`. */\n\tget workspace(): import(\"./workspace/resolve.ts\").BoundWorkspace | undefined {\n\t\treturn this._workspace;\n\t}\n\tsetCacheWarmingMode(mode: import(\"./settings-manager.ts\").CacheWarmingMode): void {\n\t\tthis.settingsManager.setCacheWarmingMode(mode);\n\t\tthis._cacheWarmer?.onModeChanged();\n\t}\n\n\tconstructor(config: AgentSessionConfig) {\n\t\tthis.agent = config.agent;\n\t\tthis.sessionManager = config.sessionManager;\n\t\tthis.settingsManager = config.settingsManager;\n\t\tthis._scopedModels = config.scopedModels ?? [];\n\t\tthis._configuredFallbackModels = config.fallbackModels;\n\t\tthis._isFallbackModelAllowed = config.isFallbackModelAllowed;\n\t\tthis._resourceLoader = config.resourceLoader;\n\t\tthis._customTools = config.customTools ?? [];\n\t\tthis._cwd = config.cwd;\n\t\tthis._modelRuntime = config.modelRuntime;\n\t\tconst snapshotSettings = config.worktreeSnapshots;\n\t\tthis._worktreeSnapshots = new SessionWorktreeSnapshotRecorder({\n\t\t\tsessionManager: this.sessionManager,\n\t\t\tcwd: () => this._cwd,\n\t\t\tsettings: () => snapshotSettings ?? this.settingsManager.getWorktreeSnapshotSettings(),\n\t\t\tdeclaresWrites: (name) => this._toolDefinitions.get(name)?.definition.writesFiles === true,\n\t\t\tonUnavailable: (reason) =>\n\t\t\t\t(this as unknown as import(\"./agent-session-methods.ts\").AgentSessionInternalSurface)._emit({\n\t\t\t\t\ttype: \"worktree_snapshot_unavailable\",\n\t\t\t\t\treason: serializeWorkspaceError(reason),\n\t\t\t\t}),\n\t\t});\n\t\tthis._cacheWarmer = config.cacheWarmer;\n\t\tthis._backgroundCompaction = new BackgroundCompactionRuntime(config.compactionWake);\n\t\tif (this._cacheWarmer)\n\t\t\tthis._cacheWarmer.onWarmed = (entry) =>\n\t\t\t\t(this as unknown as import(\"./agent-session-methods.ts\").AgentSessionInternalSurface)._emit({\n\t\t\t\t\ttype: \"entry_appended\",\n\t\t\t\t\tentry,\n\t\t\t\t});\n\t\tthis._extensionProviderIds = new Set(config.resourceLoader.getExtensions().runtime.extensionProviderIds);\n\t\tthis._extensionRunnerRef = config.extensionRunnerRef;\n\t\tthis._initialActiveToolNames = config.initialActiveToolNames;\n\t\tthis._usesDefaultTools = config.usesDefaultTools ?? false;\n\t\tthis._defaultToolModifiers = config.defaultToolModifiers ?? [];\n\t\tthis._appliedDefaultTools = new Set(\n\t\t\tthis._usesDefaultTools\n\t\t\t\t? applyToolModifiers(\n\t\t\t\t\t\tthis.settingsManager.getDefaultTools() ?? getDefaultToolNames(),\n\t\t\t\t\t\tthis._defaultToolModifiers,\n\t\t\t\t\t)\n\t\t\t\t: [],\n\t\t);\n\t\tthis._allowedToolNames = config.allowedToolNames ? new Set(config.allowedToolNames) : undefined;\n\t\tthis._excludedToolNames = config.excludedToolNames ? new Set(config.excludedToolNames) : undefined;\n\t\tthis._allowedTools = config.allowedToolNames ? createToolNameMatcher(config.allowedToolNames) : undefined;\n\t\tthis._excludedTools = config.excludedToolNames ? createToolNameMatcher(config.excludedToolNames) : undefined;\n\t\tthis._childSessionOptions = config.childSessionOptions;\n\t\tthis._workflowJournal = config.workflowJournal;\n\t\tthis._storageAgentDir = config.storageAgentDir;\n\t\tthis._baseToolsOverride = config.baseToolsOverride;\n\t\tthis._sessionStartEvent = config.sessionStartEvent ?? { type: \"session_start\", reason: \"startup\" };\n\t\tthis._orchestrationContext = config.orchestrationContext;\n\t\tthis._workspace = config.workspace;\n\t\tthis._subagentPolicy = config.subagentPolicy;\n\t\tthis._parentCommandTaskOwner = config.parentCommandTaskOwner;\n\t\tthis._inheritedHistory = config.inheritedHistory;\n\t\tthis._resourceAdmission = config.resourceAdmission;\n\t\tlet removeExecutionEndedListener: (() => void) | undefined;\n\t\ttry {\n\t\t\tif (config.subagentPolicy?.executionEnded !== undefined) {\n\t\t\t\t// Reuse the stable-key admission/drain primitive, not workflow identity or task ownership.\n\t\t\t\tconst admission = WorkflowStageAdmissionBoundary.restore(this.sessionManager.getBranch());\n\t\t\t\tthis._subagentMessageAdmission = admission;\n\t\t\t\tthis._subagentPolicy = {\n\t\t\t\t\t...config.subagentPolicy,\n\t\t\t\t\tmessageAdmission: {\n\t\t\t\t\t\tisOpen: () => admission.isOpen(),\n\t\t\t\t\t\trun: (deliver) =>\n\t\t\t\t\t\t\tadmission.runMessageDelivery(deliver, () => {\n\t\t\t\t\t\t\t\tthrow new Error(\"Subagent execution is terminal and cannot accept messages\");\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tconst ended = config.subagentPolicy.executionEnded;\n\t\t\t\tif (ended.aborted) admission.seal();\n\t\t\t\telse {\n\t\t\t\t\tconst seal = () => admission.seal();\n\t\t\t\t\tended.addEventListener(\"abort\", seal, { once: true });\n\t\t\t\t\tremoveExecutionEndedListener = () => ended.removeEventListener(\"abort\", seal);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._systemPromptTransform = config.systemPromptTransform;\n\t\t\tthis._contextProjectionTransform = config.contextProjectionTransform;\n\t\t\tconst stageContext =\n\t\t\t\tconfig.orchestrationContext?.kind === \"workflow-stage\" ? config.orchestrationContext : undefined;\n\t\t\t// A stage keeps its boundary for every session it opens; a session reopened after a release gives it back\n\t\t\t// the admission keys its transcript records.\n\t\t\tconst stageBoundary = stageContext?.messageAdmission?.boundary;\n\t\t\tstageBoundary?.restoreCompleted(this.sessionManager.getBranch());\n\t\t\tthis._workflowStageAdmission =\n\t\t\t\tstageBoundary ??\n\t\t\t\t(stageContext ? WorkflowStageAdmissionBoundary.restore(this.sessionManager.getBranch()) : undefined);\n\t\t\t// #3919: a fresh stage is live before its runner dispatches the stage prompt. Turn-starting\n\t\t\t// input that arrives in that gap is startup context for the prompt's turn, not a turn of its own.\n\t\t\tthis._workflowStageAwaitingFirstPrompt =\n\t\t\t\tstageContext !== undefined &&\n\t\t\t\t!this.sessionManager\n\t\t\t\t\t.getBranch()\n\t\t\t\t\t.some((entry) => entry.type === \"message\" || entry.type === \"custom_message\" || entry.type === \"custom\");\n\t\t\tif (stageContext) {\n\t\t\t\tthis._workflowStageAdmission?.bindTaskIdentity(\n\t\t\t\t\tthis.sessionManager.getSessionId(),\n\t\t\t\t\tstageContext.workflowRunId,\n\t\t\t\t\tstageContext.workflowStageId,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this._workflowStageAdmission && stageContext && stageContext.messageAdmission === undefined) {\n\t\t\t\t(stageContext as { messageAdmission?: StageMessageAdmission }).messageAdmission = stageMessageAdmission(\n\t\t\t\t\tthis._workflowStageAdmission,\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Claim this session's storage before any tool can spill into it, so the\n\t\t\t// sweeper below never reaps a directory this process is still writing to.\n\t\t\t// The claim is a lease, released in dispose(): a session that is gone must\n\t\t\t// stop protecting a tree the startup sweep exists to collect.\n\t\t\ttry {\n\t\t\t\tconst sessionId = this.sessionManager.getSessionId();\n\t\t\t\tconst sessionDir = this.sessionManager.getSessionDir() || undefined;\n\t\t\t\tthis._tempStorageLease = acquireProtectedPaths([\n\t\t\t\t\tsetActiveSessionTempId(sessionId),\n\t\t\t\t\t// A disk-backed session's results are read back by path, and a replayed\n\t\t\t\t\t// result reuses an old file without touching its mtime, so age alone\n\t\t\t\t\t// cannot keep it alive.\n\t\t\t\t\t...(sessionDir ? [join(sessionDir, TOOL_RESULTS_SUBDIR)] : []),\n\t\t\t\t]);\n\t\t\t\t// A custom `--session-dir` keeps its tool results directly under that\n\t\t\t\t// directory, outside the project-nested roots the default sweep walks,\n\t\t\t\t// so it has to be named as its own target.\n\t\t\t\tconst customSessionDir = this.sessionManager.usesDefaultSessionDir() ? undefined : sessionDir;\n\t\t\t\tscheduleSessionTempCleanup(customSessionDir ? { sessionDirs: [customSessionDir] } : {});\n\t\t\t} catch {\n\t\t\t\t// Temp-storage housekeeping must never block session construction.\n\t\t\t}\n\t\t\tconst internals = this as unknown as AgentSessionInternalSurface;\n\t\t\tinternals._handleAgentEvent = internals._handleAgentEvent.bind(this);\n\t\t\tthis._unsubscribeAgent = this.agent.subscribe(internals._handleAgentEvent);\n\t\t\tinternals._installAgentToolHooks();\n\t\t\tinternals._installAgentNextTurnRefresh();\n\t\t\tinternals._installAgentRequestProjection();\n\t\t\tinternals._installAgentBoundaryHooks();\n\t\t\tinternals._buildRuntime({\n\t\t\t\tactiveToolNames: this._initialActiveToolNames,\n\t\t\t\tincludeAllExtensionTools: true,\n\t\t\t});\n\t\t\tinternals._restoreToolsFromTranscript({ startup: true });\n\t\t\tif (this._workflowStageAdmission?.hasAgentTaskHost() && !isSubagentChildSession(internals))\n\t\t\t\tinternals.getAgentTaskHost();\n\t\t} catch (error) {\n\t\t\t// No session escapes a failed constructor to release these acquisitions later.\n\t\t\tconst failures: unknown[] = [];\n\t\t\tfor (const release of [\n\t\t\t\t() => removeExecutionEndedListener?.(),\n\t\t\t\t() => this._unsubscribeAgent?.(),\n\t\t\t\t() => this._tempStorageLease?.release(),\n\t\t\t\t() => this._extensionRunner?.invalidate(\"Session construction failed\"),\n\t\t\t]) {\n\t\t\t\ttry {\n\t\t\t\t\trelease();\n\t\t\t\t} catch (cause) {\n\t\t\t\t\tfailures.push(cause);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._extensionRunnerRef) this._extensionRunnerRef.current = undefined;\n\t\t\tif (failures.length)\n\t\t\t\tthrow Object.assign(new AggregateError([error, ...failures], \"Session construction cleanup failed\"), {\n\t\t\t\t\tcode: \"ShutdownFailed\",\n\t\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\ninterface StageMessageAdmission {\n\tboundary: WorkflowStageAdmissionBoundary;\n\textensionState: Map<string, object>;\n\tisOpen(): boolean;\n}\n\n/**\n * A workflow stage keeps this admission for every session it opens, so it is built outside the session's constructor:\n * a closure made there would keep the first session reachable for as long as the stage lives.\n */\nfunction stageMessageAdmission(boundary: WorkflowStageAdmissionBoundary): StageMessageAdmission {\n\treturn { boundary, extensionState: new Map(), isOpen: () => boundary.isOpen() };\n}\n\nexport interface AgentSession extends AgentSessionBase, AgentSessionPublicSurface {}\n\nexport const AgentSession = AgentSessionBase as unknown as {\n\tnew (config: AgentSessionConfig): AgentSession;\n\treadonly prototype: AgentSession;\n};\n\ninstallAgentSessionAccessors(AgentSession.prototype as unknown as AgentSessionInternalSurface);\ninstallBackgroundCompactionAccessors(AgentSession.prototype as unknown as AgentSessionInternalSurface);\nObject.assign(\n\tAgentSession.prototype,\n\tagentSessionToolHooksMethods,\n\tagentSessionBoundaryMethods,\n\tagentSessionEventsMethods,\n\tagentSessionStateMethods,\n\tagentSessionPromptMethods,\n\tagentSessionCustomMessageCommitMethods,\n\tagentSessionMessageQueueMethods,\n\tagentSessionModelsMethods,\n\tagentSessionCompactionMethods,\n\tagentSessionAutoCompactionMethods,\n\tagentSessionPostToolCompactionMethods,\n\tagentSessionBackgroundCompactionMethods,\n\tagentSessionExtensionBindingsMethods,\n\tagentSessionRecoveryMethods,\n\tagentSessionDetachedToolMethods,\n\tagentSessionReleaseMethods,\n\tagentSessionToolRegistryMethods,\n\tagentSessionRetryMethods,\n\tagentSessionBashMethods,\n\tagentSessionTreeMethods,\n\tagentSessionExportMethods,\n\tagentSessionSummaryMethods,\n\tagentSessionTaskMethods,\n);\n"]}
1
+ {"version":3,"file":"agent-session.js","sourceRoot":"","sources":["../../src/core/agent-session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AACvF,OAAO,EACN,uCAAuC,EACvC,2BAA2B,EAC3B,oCAAoC,GACpC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,sCAAsC,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAA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SAAS,CAAC;YAC3E,IAAI,QAAQ,CAAC,MAAM;gBAClB,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,cAAc,CAAC,CAAC,KAAK,EAAE,GAAG,QAAQ,CAAC,EAAE,qCAAqC,CAAC,EAAE;oBACpG,IAAI,EAAE,gBAAgB;iBACtB,CAAC,CAAC;YACJ,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;CACD;AAQD;;;GAGG;AACH,SAAS,qBAAqB,CAAC,QAAwC;IACtE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;AACjF,CAAC;AAID,MAAM,CAAC,MAAM,YAAY,GAAG,gBAG3B,CAAC;AAEF,4BAA4B,CAAC,YAAY,CAAC,SAAmD,CAAC,CAAC;AAC/F,oCAAoC,CAAC,YAAY,CAAC,SAAmD,CAAC,CAAC;AACvG,MAAM,CAAC,MAAM,CACZ,YAAY,CAAC,SAAS,EACtB,4BAA4B,EAC5B,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,sCAAsC,EACtC,+BAA+B,EAC/B,yBAAyB,EACzB,6BAA6B,EAC7B,iCAAiC,EACjC,qCAAqC,EACrC,uCAAuC,EACvC,oCAAoC,EACpC,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,EAC1B,+BAA+B,EAC/B,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,CACvB,CAAC","sourcesContent":["/**\n * AgentSession - Core abstraction for agent lifecycle and session management.\n *\n * The historical import path is preserved here as a facade. Responsibilities are\n * implemented in sibling modules by lifecycle area so each authored source file\n * stays focused.\n */\n\nimport { join } from \"node:path\";\nimport type { Api, AssistantMessage, Model } from \"@bastani/pi-ai/compat\";\nimport type { Agent, AgentMessage, AgentTool, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { installAgentSessionAccessors } from \"./agent-session-accessors.ts\";\nimport { agentSessionAutoCompactionMethods } from \"./agent-session-auto-compaction.ts\";\nimport {\n\tagentSessionBackgroundCompactionMethods,\n\tBackgroundCompactionRuntime,\n\tinstallBackgroundCompactionAccessors,\n} from \"./agent-session-background-compaction.ts\";\nimport { agentSessionBashMethods } from \"./agent-session-bash.ts\";\nimport { agentSessionBoundaryMethods } from \"./agent-session-boundaries.ts\";\nimport { agentSessionCompactionMethods } from \"./agent-session-compaction.ts\";\nimport { agentSessionCustomMessageCommitMethods } from \"./agent-session-custom-message-commit.ts\";\nimport { agentSessionDetachedToolMethods } from \"./agent-session-detached-tools.ts\";\nimport { agentSessionEventsMethods } from \"./agent-session-events.ts\";\nimport { agentSessionExportMethods } from \"./agent-session-export.ts\";\nimport { agentSessionExtensionBindingsMethods } from \"./agent-session-extension-bindings.ts\";\nimport { agentSessionMessageQueueMethods } from \"./agent-session-message-queue.ts\";\nimport type { AgentSessionInternalSurface, AgentSessionPublicSurface } from \"./agent-session-methods.ts\";\nimport { agentSessionModelsMethods } from \"./agent-session-models.ts\";\nimport type { PendingPostToolCompactionGuard } from \"./agent-session-post-tool-compaction.ts\";\nimport { agentSessionPostToolCompactionMethods } from \"./agent-session-post-tool-compaction.ts\";\nimport { agentSessionPromptMethods } from \"./agent-session-prompt.ts\";\nimport { agentSessionRecoveryMethods } from \"./agent-session-recovery.ts\";\nimport { agentSessionReleaseMethods } from \"./agent-session-release.ts\";\nimport { agentSessionRetryMethods } from \"./agent-session-retry.ts\";\nimport { agentSessionStateMethods } from \"./agent-session-state.ts\";\nimport { agentSessionSummaryMethods, type SessionSummaryRun } from \"./agent-session-summary.ts\";\nimport { agentSessionTaskMethods, isSubagentChildSession } from \"./agent-session-tasks.js\";\nimport { agentSessionToolHooksMethods } from \"./agent-session-tool-hooks.ts\";\nimport { agentSessionToolRegistryMethods } from \"./agent-session-tool-registry.ts\";\nimport { agentSessionTreeMethods } from \"./agent-session-tree.ts\";\nimport type {\n\tAgentSessionConfig,\n\tAgentSessionEventListener,\n\tInterruptQueueHold,\n\tToolDefinitionEntry,\n} from \"./agent-session-types.js\";\nimport type { VerbatimCompactionResult } from \"./compaction/index.ts\";\nimport type {\n\tAgentActivityOutcome,\n\tExtensionCommandContextActions,\n\tExtensionErrorListener,\n\tExtensionMode,\n\tExtensionRunner,\n\tExtensionUIContext,\n\tOrchestrationContext,\n\tSessionStartEvent,\n\tSubagentChildPolicy,\n\tToolDefinition,\n} from \"./extensions/index.js\";\nimport type { BashExecutionMessage, CustomMessage } from \"./messages.ts\";\nimport type { ModelRuntime } from \"./model-runtime.js\";\nimport type { ResourceLoader } from \"./resource-loader.ts\";\nimport { currentWorktreeRestoreNotices, currentWorktreeRootMappings } from \"./resume/path-mapping.ts\";\nimport type { SessionManager } from \"./session-manager.ts\";\nimport { SessionWorktreeSnapshotRecorder } from \"./session-worktree-snapshots.ts\";\nimport type { SettingsManager } from \"./settings-manager.ts\";\nimport { applyToolModifiers } from \"./settings-merge.js\";\nimport type { NormalizedBuildSystemPromptOptions } from \"./system-prompt.ts\";\nimport { ChildTaskWaits } from \"./tasks/child-command-owner.js\";\nimport { createToolNameMatcher } from \"./tool-selection.ts\";\nimport { getDefaultToolNames } from \"./tools/index.js\";\nimport { scheduleSessionTempCleanup } from \"./tools/session-temp-cleanup.ts\";\nimport { acquireProtectedPaths, type ProtectedPathLease, setActiveSessionTempId } from \"./tools/session-temp-dir.ts\";\nimport { ToolExecutionScheduler } from \"./tools/tool-concurrency.ts\";\nimport { TOOL_RESULTS_SUBDIR } from \"./tools/tool-limits.js\";\nimport { WorkflowStageAdmissionBoundary } from \"./workflow-stage-admission.ts\";\nimport { serializeWorkspaceError } from \"./worktree-snapshot/errors.ts\";\n\nexport type { SessionCompactOptions } from \"./agent-session-methods.ts\";\nexport type { ParsedSkillBlock } from \"./agent-session-skill-block.ts\";\nexport { parseSkillBlock } from \"./agent-session-skill-block.ts\";\nexport type {\n\tAgentSessionConfig,\n\tAgentSessionEvent,\n\tAgentSessionEventListener,\n\tClearedQueue,\n\tCompactionReason,\n\tExtensionBindings,\n\tModelCycleResult,\n\tPromptDisposition,\n\tPromptOptions,\n\tQueuedInputDisposition,\n\tSessionRecoveryReport,\n\tSessionStats,\n} from \"./agent-session-types.js\";\n\nclass AgentSessionBase {\n\treadonly agent: Agent;\n\treadonly sessionManager: SessionManager;\n\treadonly settingsManager: SettingsManager;\n\n\tprotected _scopedModels: Array<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\t/** The chain the session was created with, or undefined to follow its settings' current `fallbackModels`. */\n\tprotected _configuredFallbackModels: string[] | undefined;\n\tprotected _isFallbackModelAllowed?: (model: Model<Api>, effort: string | undefined) => boolean;\n\tprotected _fallbackAttemptedKeys: Set<string> = new Set();\n\t/** Models condemned for this turn by a failure retrying them cannot repair. */\n\tprotected _fallbackBlockedModels: Array<Model<Api>> = [];\n\tprotected _fallbackOriginModel: Model<Api> | undefined;\n\tprotected _fallbackOriginThinkingLevel: ThinkingLevel | undefined;\n\tprotected _fallbackScopeGeneration = 0;\n\n\t/**\n\t * The session's fallback chain. Without one of its own it follows its settings' current `fallbackModels`, so a\n\t * project trusted after the session was created applies its list, as an interactive start asks after it (#4223).\n\t */\n\tprotected get _fallbackModels(): string[] {\n\t\treturn this._configuredFallbackModels ?? this.settingsManager.getFallbackModels();\n\t}\n\n\t/** Give the session a chain of its own; it no longer follows its settings. */\n\tprotected set _fallbackModels(models: string[]) {\n\t\tthis._configuredFallbackModels = models;\n\t}\n\tprotected _fallbackOriginGeneration: number | undefined;\n\tprotected _fallbackRestoreError: string | undefined;\n\tprotected _unsubscribeAgent?: () => void;\n\tprotected _eventListeners: AgentSessionEventListener[] = [];\n\tprotected _agentEventQueue: Promise<void> = Promise.resolve();\n\tprotected _steeringMessages: string[] = [];\n\tprotected _followUpMessages: string[] = [];\n\tprotected _interruptDeliveryQueue: Promise<void> = Promise.resolve();\n\tprotected _pendingInterruptDeliveries = 0;\n\tprotected _activeInterruptQueueHold: InterruptQueueHold | undefined = undefined;\n\tprotected _queuedMessagesPaused = false;\n\tprotected _queuedMessagesPauseAbortBoundary: Promise<void> | undefined = undefined;\n\t/**\n\t * Text of a queued steering/follow-up message the agent loop already admitted\n\t * into the transcript and that has not received an assistant reply yet. The\n\t * pause hold cannot reach such a message, so an interrupt would otherwise\n\t * strand it (issue #2362).\n\t */\n\tprotected _admittedQueuedMessageAwaitingReply: string | undefined = undefined;\n\t/**\n\t * Settlement boundary for the recovery turn that answers an already-admitted\n\t * queued message. It starts after the pause abort boundary resolves, so the\n\t * resume path must wait for it too or an ordinary submission made while it\n\t * streams is rejected by the streaming guard (issue #2362).\n\t */\n\tprotected _admittedRecoveryTurn: Promise<void> | undefined = undefined;\n\tprotected _workflowStageDeliveryForwardTarget: AgentSessionInternalSurface | undefined = undefined;\n\tprotected _activeInterruptAbortMessage: string | undefined = undefined;\n\t/** Priority input cancels the native operation, not the host-owned task. */\n\tprotected _priorityInterruptPending = false;\n\tprotected _activePromptCount = 0;\n\tprotected _isPreparingRun: false | \"user\" | \"custom\" = false;\n\t/** Prompts between their start and `_isPreparingRun`, so tree navigation cannot rebuild their context. */\n\tprotected _promptPreflightCount = 0;\n\tprotected _agentRunAbortRequested = false;\n\tprotected _pendingNextTurnMessages: CustomMessage[] = [];\n\t/** Context-only custom messages queued during a run, flushed after the current turn's tool results. */\n\tprotected _pendingCustomMessages: CustomMessage[] = [];\n\tprotected _protectedStreamingCustomMessages: Array<{\n\t\tmessage: CustomMessage;\n\t\tdelivery: \"steer\" | \"followUp\";\n\t\tphase: \"queued\" | \"consumed-unpersisted\" | \"persistence-failed\";\n\t}> = [];\n\tprotected _compactionAbortController: AbortController | undefined = undefined;\n\tprotected _compactionReason: import(\"./agent-session-types.js\").CompactionReason | undefined = undefined;\n\tprotected _manualCompactionPromise: Promise<VerbatimCompactionResult> | undefined = undefined;\n\tprotected _autoCompactionAbortController: AbortController | undefined = undefined;\n\t/** Resolves when the current automatic compaction has settled. */\n\tprotected _autoCompactionCompletion: Promise<void> | undefined = undefined;\n\tprotected _overflowRecoveryAttempted = false;\n\tprotected _recoverableLengthRecoveryAttempted = false;\n\t/** Set when compaction cannot recover a context overflow on the current model. */\n\tprotected _contextOverflowUnresolved = false;\n\tprotected _pendingPostCompactionContinuation: Promise<void> | undefined = undefined;\n\tprotected _postCompactionContinuationToken = 0;\n\tprotected _lengthContinuationAttempts = 0;\n\tprotected _outputBudgetErrorContinuationAttempts = 0;\n\tprotected _postToolCompactionPreflightError: string | undefined = undefined;\n\tprotected _pendingPostToolCompactionGuard: PendingPostToolCompactionGuard | undefined = undefined;\n\tprotected _backgroundCompaction: BackgroundCompactionRuntime;\n\tprotected _terminatingToolCallIds = new Set<string>();\n\t/** A positive stop callback keeps queued work pending until an explicit new run. */\n\tprotected _stopAfterTurnBlockedContinuation = false;\n\tprotected _disposed = false;\n\tprotected _branchSummaryAbortController: AbortController | undefined = undefined;\n\t/** Settles after the currently active branch-summary navigation finishes cleanup. */\n\tprotected _branchSummaryCompletion: Promise<void> | undefined = undefined;\n\tprotected _sessionSummaryAbortController: AbortController | undefined = undefined;\n\tprotected _sessionSummaryToken = 0;\n\t/** The summary request currently in flight, published so a later launch can join it. */\n\tprotected _sessionSummaryRun: SessionSummaryRun | undefined = undefined;\n\tprotected _lastSummarizedMessageId: string | undefined = undefined;\n\tprotected _retryAbortController: AbortController | undefined = undefined;\n\tprotected _retryAttempt = 0;\n\t/** Retries made after an attempt whose stream was cut after a long run, for the current model and turn. */\n\tprotected _longStreamCutRetries = 0;\n\tprotected _retryPromise: Promise<void> | undefined = undefined;\n\tprotected _retryResolve: (() => void) | undefined = undefined;\n\tprotected _bashAbortControllers = new Map<string | symbol, Set<AbortController>>();\n\tprotected _pendingBashMessages: BashExecutionMessage[] = [];\n\tprotected _extensionRunner!: ExtensionRunner;\n\tprotected _turnIndex = 0;\n\t/** Source entry IDs for projected messages, so boundaries and omissions resolve provenance. */\n\tprotected readonly _entryIdsByMessage = new WeakMap<object, string>();\n\t/** Assistant messages whose actionable turn_end already ran from finishTurn. */\n\tprotected readonly _boundaryDispatchedMessages = new WeakSet<object>();\n\t/** Messages whose message_end processing, including their save, has not settled yet. */\n\tprotected readonly _messagesAwaitingPersistence = new WeakMap<object, Promise<void>>();\n\tprotected readonly _messagesWithFailedPersistence = new WeakSet<object>();\n\t/** The reported cause once a message of the current run could not be saved; the run stops (#4226). */\n\tprotected _persistenceFailure: string | undefined = undefined;\n\t/** Interrupted tool calls recovery is running again; their results are pending, not interrupted. */\n\tprotected readonly _reissuedToolCallIds = new Set<string>();\n\tprotected _lastAssistantToolResults: AgentMessage[] = [];\n\tprotected _lastActivityOutcome: AgentActivityOutcome = \"completed\";\n\tprotected _isBeforeSettle = false;\n\tprotected _abortDuringBeforeSettle = false;\n\tprotected _isEmittingAgentSettled = false;\n\tprotected readonly _deferredSettledActions: Array<() => Promise<void>> = [];\n\t/** Set when a caller's prepareNextTurnWithContext replaced the next request's context. */\n\tprotected _callerReplacedNextRequestContext = false;\n\tprotected _resourceLoader: ResourceLoader;\n\tprotected _customTools: ToolDefinition[];\n\tprotected _baseToolDefinitions: Map<string, ToolDefinition> = new Map();\n\tprotected _cwd: string;\n\tprotected _extensionRunnerRef?: { current?: ExtensionRunner };\n\tprotected _initialActiveToolNames?: string[];\n\tprotected _pendingToolNames = new Set<string>();\n\tprotected _restoredToolNames = new Set<string>();\n\t/** Tools `setActiveToolsByName` deactivated whose removal no saved system message has declared yet (#4660). */\n\tprotected _explicitToolDeactivations = new Set<string>();\n\tprotected _usesDefaultTools: boolean;\n\tprotected _defaultToolModifiers: string[];\n\t/** Resolved defaults last applied here, independent of shared settings publication. */\n\tprotected _appliedDefaultTools: Set<string>;\n\tprotected _subagentPolicy?: SubagentChildPolicy;\n\tprotected _allowedToolNames?: Set<string>;\n\tprotected _excludedToolNames?: Set<string>;\n\tprotected _allowedTools?: (name: string) => boolean;\n\tprotected _excludedTools?: (name: string) => boolean;\n\tprotected _childSessionOptions?: import(\"./child-session-options.ts\").ChildSessionOptionsResolver;\n\tprotected _workflowJournal?: import(\"./storage/provider.js\").RunJournalOption;\n\tprotected _storageAgentDir?: string;\n\tprotected _baseToolsOverride?: Record<string, AgentTool>;\n\tprotected _sessionStartEvent: SessionStartEvent;\n\tprotected _orchestrationContext?: OrchestrationContext;\n\tprotected _workspace?: import(\"./workspace/resolve.ts\").BoundWorkspace;\n\tprotected _extensionUIContext?: ExtensionUIContext;\n\tprotected _extensionHumanInput?: import(\"./extensions/host-input.js\").HostInput | null;\n\tprotected _extensionDiagnosticListener?: (diagnostic: import(\"./extensions/host-input.js\").HostDiagnostic) => void;\n\tprotected _extensionMode: ExtensionMode = \"print\";\n\tprotected _extensionCommandContextActions?: ExtensionCommandContextActions;\n\tprotected _extensionShutdownHandler?: () => void;\n\tprotected _extensionErrorListener?: ExtensionErrorListener;\n\tprotected _extensionErrorUnsubscriber?: () => void;\n\tprotected _modelRuntime: ModelRuntime;\n\tprotected _extensionProviderIds = new Set<string>();\n\tprotected _toolRegistry: Map<string, AgentTool> = new Map();\n\tprotected readonly _toolExecutionScheduler = new ToolExecutionScheduler();\n\t/** The restores of the sessions and runs this session was opened in, which its tools follow before its own. */\n\tprotected readonly _outerWorktreeRootMappings = currentWorktreeRootMappings();\n\t/** The notices of partly restored or unrestored checkouts of the runs this session was opened in (#4738). */\n\tprotected readonly _worktreeRestoreNotices = currentWorktreeRestoreNotices();\n\tprotected _toolDefinitions: Map<string, ToolDefinitionEntry> = new Map();\n\tprotected _toolPromptSnippets: Map<string, string> = new Map();\n\tprotected _toolPromptGuidelines: Map<string, string[]> = new Map();\n\tprotected _baseSystemPromptOptions!: NormalizedBuildSystemPromptOptions;\n\tprotected _systemPromptTransform?: (prompt: string) => string;\n\tprotected _contextProjectionTransform?: (messages: AgentMessage[]) => AgentMessage[];\n\tprotected _runSystemPromptOptions?: NormalizedBuildSystemPromptOptions;\n\tprotected _lastAssistantMessage: AssistantMessage | undefined = undefined;\n\t/** Protection claim on this session's temp tree and tool-results directory. */\n\tprotected _tempStorageLease: ProtectedPathLease | undefined;\n\tprotected _workflowStageAdmission: WorkflowStageAdmissionBoundary | undefined;\n\tprotected _subagentMessageAdmission: WorkflowStageAdmissionBoundary | undefined;\n\t/** A fresh workflow stage whose own prompt has not started its first run (#3919). */\n\tprotected _workflowStageAwaitingFirstPrompt = false;\n\tprotected _agentTaskHost: import(\"./tasks/agent-adapter.js\").AgentTaskHost | undefined;\n\tprotected _parentCommandTaskOwner: import(\"./tasks/child-command-owner.js\").ChildCommandTaskOwner | undefined;\n\tprotected _inheritedHistory: import(\"./tools/history-protocol.ts\").ProjectHistory | undefined;\n\tprotected _resourceAdmission: import(\"./sdk-types.ts\").ResourceAdmission | undefined;\n\tprotected _childTaskWaits = new ChildTaskWaits();\n\tprotected _taskCompletionOutbox: import(\"./tasks/completion.js\").TaskCompletionOutbox | undefined;\n\tprotected _taskAdmission: WorkflowStageAdmissionBoundary | undefined;\n\tprotected _cacheWarmer?: import(\"./cache-warmer.ts\").CacheWarmer;\n\tprotected _worktreeSnapshots: SessionWorktreeSnapshotRecorder;\n\tget cacheWarmingStatus(): import(\"./cache-warmer.ts\").CacheWarmingStatus | undefined {\n\t\treturn this._cacheWarmer?.status;\n\t}\n\t/** The resolved workspace this session is bound to, when it was created with `workspace`. */\n\tget workspace(): import(\"./workspace/resolve.ts\").BoundWorkspace | undefined {\n\t\treturn this._workspace;\n\t}\n\tsetCacheWarmingMode(mode: import(\"./settings-manager.ts\").CacheWarmingMode): void {\n\t\tthis.settingsManager.setCacheWarmingMode(mode);\n\t\tthis._cacheWarmer?.onModeChanged();\n\t}\n\n\tconstructor(config: AgentSessionConfig) {\n\t\tthis.agent = config.agent;\n\t\tthis.sessionManager = config.sessionManager;\n\t\tthis.settingsManager = config.settingsManager;\n\t\tthis._scopedModels = config.scopedModels ?? [];\n\t\tthis._configuredFallbackModels = config.fallbackModels;\n\t\tthis._isFallbackModelAllowed = config.isFallbackModelAllowed;\n\t\tthis._resourceLoader = config.resourceLoader;\n\t\tthis._customTools = config.customTools ?? [];\n\t\tthis._cwd = config.cwd;\n\t\tthis._modelRuntime = config.modelRuntime;\n\t\tconst snapshotSettings = config.worktreeSnapshots;\n\t\tthis._worktreeSnapshots = new SessionWorktreeSnapshotRecorder({\n\t\t\tsessionManager: this.sessionManager,\n\t\t\tcwd: () => this._cwd,\n\t\t\tsettings: () => snapshotSettings ?? this.settingsManager.getWorktreeSnapshotSettings(),\n\t\t\tdeclaresWrites: (name) => this._toolDefinitions.get(name)?.definition.writesFiles === true,\n\t\t\tonUnavailable: (reason) =>\n\t\t\t\t(this as unknown as import(\"./agent-session-methods.ts\").AgentSessionInternalSurface)._emit({\n\t\t\t\t\ttype: \"worktree_snapshot_unavailable\",\n\t\t\t\t\treason: serializeWorkspaceError(reason),\n\t\t\t\t}),\n\t\t});\n\t\tthis._cacheWarmer = config.cacheWarmer;\n\t\tthis._backgroundCompaction = new BackgroundCompactionRuntime(config.compactionWake);\n\t\tif (this._cacheWarmer)\n\t\t\tthis._cacheWarmer.onWarmed = (entry) =>\n\t\t\t\t(this as unknown as import(\"./agent-session-methods.ts\").AgentSessionInternalSurface)._emit({\n\t\t\t\t\ttype: \"entry_appended\",\n\t\t\t\t\tentry,\n\t\t\t\t});\n\t\tthis._extensionProviderIds = new Set(config.resourceLoader.getExtensions().runtime.extensionProviderIds);\n\t\tthis._extensionRunnerRef = config.extensionRunnerRef;\n\t\tthis._initialActiveToolNames = config.initialActiveToolNames;\n\t\tthis._usesDefaultTools = config.usesDefaultTools ?? false;\n\t\tthis._defaultToolModifiers = config.defaultToolModifiers ?? [];\n\t\tthis._appliedDefaultTools = new Set(\n\t\t\tthis._usesDefaultTools\n\t\t\t\t? applyToolModifiers(\n\t\t\t\t\t\tthis.settingsManager.getDefaultTools() ?? getDefaultToolNames(),\n\t\t\t\t\t\tthis._defaultToolModifiers,\n\t\t\t\t\t)\n\t\t\t\t: [],\n\t\t);\n\t\tthis._allowedToolNames = config.allowedToolNames ? new Set(config.allowedToolNames) : undefined;\n\t\tthis._excludedToolNames = config.excludedToolNames ? new Set(config.excludedToolNames) : undefined;\n\t\tthis._allowedTools = config.allowedToolNames ? createToolNameMatcher(config.allowedToolNames) : undefined;\n\t\tthis._excludedTools = config.excludedToolNames ? createToolNameMatcher(config.excludedToolNames) : undefined;\n\t\tthis._childSessionOptions = config.childSessionOptions;\n\t\tthis._workflowJournal = config.workflowJournal;\n\t\tthis._storageAgentDir = config.storageAgentDir;\n\t\tthis._baseToolsOverride = config.baseToolsOverride;\n\t\tthis._sessionStartEvent = config.sessionStartEvent ?? { type: \"session_start\", reason: \"startup\" };\n\t\tthis._orchestrationContext = config.orchestrationContext;\n\t\tthis._workspace = config.workspace;\n\t\tthis._subagentPolicy = config.subagentPolicy;\n\t\tthis._parentCommandTaskOwner = config.parentCommandTaskOwner;\n\t\tthis._inheritedHistory = config.inheritedHistory;\n\t\tthis._resourceAdmission = config.resourceAdmission;\n\t\tlet removeExecutionEndedListener: (() => void) | undefined;\n\t\ttry {\n\t\t\tif (config.subagentPolicy?.executionEnded !== undefined) {\n\t\t\t\t// Reuse the stable-key admission/drain primitive, not workflow identity or task ownership.\n\t\t\t\tconst admission = WorkflowStageAdmissionBoundary.restore(this.sessionManager.getBranch());\n\t\t\t\tthis._subagentMessageAdmission = admission;\n\t\t\t\tthis._subagentPolicy = {\n\t\t\t\t\t...config.subagentPolicy,\n\t\t\t\t\tmessageAdmission: {\n\t\t\t\t\t\tisOpen: () => admission.isOpen(),\n\t\t\t\t\t\trun: (deliver) =>\n\t\t\t\t\t\t\tadmission.runMessageDelivery(deliver, () => {\n\t\t\t\t\t\t\t\tthrow new Error(\"Subagent execution is terminal and cannot accept messages\");\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t\tconst ended = config.subagentPolicy.executionEnded;\n\t\t\t\tif (ended.aborted) admission.seal();\n\t\t\t\telse {\n\t\t\t\t\tconst seal = () => admission.seal();\n\t\t\t\t\tended.addEventListener(\"abort\", seal, { once: true });\n\t\t\t\t\tremoveExecutionEndedListener = () => ended.removeEventListener(\"abort\", seal);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._systemPromptTransform = config.systemPromptTransform;\n\t\t\tthis._contextProjectionTransform = config.contextProjectionTransform;\n\t\t\tconst stageContext =\n\t\t\t\tconfig.orchestrationContext?.kind === \"workflow-stage\" ? config.orchestrationContext : undefined;\n\t\t\t// A stage keeps its boundary for every session it opens; a session reopened after a release gives it back\n\t\t\t// the admission keys its transcript records.\n\t\t\tconst stageBoundary = stageContext?.messageAdmission?.boundary;\n\t\t\tstageBoundary?.restoreCompleted(this.sessionManager.getBranch());\n\t\t\tthis._workflowStageAdmission =\n\t\t\t\tstageBoundary ??\n\t\t\t\t(stageContext ? WorkflowStageAdmissionBoundary.restore(this.sessionManager.getBranch()) : undefined);\n\t\t\t// #3919: a fresh stage is live before its runner dispatches the stage prompt. Turn-starting\n\t\t\t// input that arrives in that gap is startup context for the prompt's turn, not a turn of its own.\n\t\t\tthis._workflowStageAwaitingFirstPrompt =\n\t\t\t\tstageContext !== undefined &&\n\t\t\t\t!this.sessionManager\n\t\t\t\t\t.getBranch()\n\t\t\t\t\t.some((entry) => entry.type === \"message\" || entry.type === \"custom_message\" || entry.type === \"custom\");\n\t\t\tif (stageContext) {\n\t\t\t\tthis._workflowStageAdmission?.bindTaskIdentity(\n\t\t\t\t\tthis.sessionManager.getSessionId(),\n\t\t\t\t\tstageContext.workflowRunId,\n\t\t\t\t\tstageContext.workflowStageId,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (this._workflowStageAdmission && stageContext && stageContext.messageAdmission === undefined) {\n\t\t\t\t(stageContext as { messageAdmission?: StageMessageAdmission }).messageAdmission = stageMessageAdmission(\n\t\t\t\t\tthis._workflowStageAdmission,\n\t\t\t\t);\n\t\t\t}\n\t\t\t// Claim this session's storage before any tool can spill into it, so the\n\t\t\t// sweeper below never reaps a directory this process is still writing to.\n\t\t\t// The claim is a lease, released in dispose(): a session that is gone must\n\t\t\t// stop protecting a tree the startup sweep exists to collect.\n\t\t\ttry {\n\t\t\t\tconst sessionId = this.sessionManager.getSessionId();\n\t\t\t\tconst sessionDir = this.sessionManager.getSessionDir() || undefined;\n\t\t\t\tthis._tempStorageLease = acquireProtectedPaths([\n\t\t\t\t\tsetActiveSessionTempId(sessionId),\n\t\t\t\t\t// A disk-backed session's results are read back by path, and a replayed\n\t\t\t\t\t// result reuses an old file without touching its mtime, so age alone\n\t\t\t\t\t// cannot keep it alive.\n\t\t\t\t\t...(sessionDir ? [join(sessionDir, TOOL_RESULTS_SUBDIR)] : []),\n\t\t\t\t]);\n\t\t\t\t// A custom `--session-dir` keeps its tool results directly under that\n\t\t\t\t// directory, outside the project-nested roots the default sweep walks,\n\t\t\t\t// so it has to be named as its own target.\n\t\t\t\tconst customSessionDir = this.sessionManager.usesDefaultSessionDir() ? undefined : sessionDir;\n\t\t\t\tscheduleSessionTempCleanup(customSessionDir ? { sessionDirs: [customSessionDir] } : {});\n\t\t\t} catch {\n\t\t\t\t// Temp-storage housekeeping must never block session construction.\n\t\t\t}\n\t\t\tconst internals = this as unknown as AgentSessionInternalSurface;\n\t\t\tinternals._handleAgentEvent = internals._handleAgentEvent.bind(this);\n\t\t\tthis._unsubscribeAgent = this.agent.subscribe(internals._handleAgentEvent);\n\t\t\tinternals._installAgentToolHooks();\n\t\t\tinternals._installAgentNextTurnRefresh();\n\t\t\tinternals._installAgentRequestProjection();\n\t\t\tinternals._installAgentBoundaryHooks();\n\t\t\tinternals._buildRuntime({\n\t\t\t\tactiveToolNames: this._initialActiveToolNames,\n\t\t\t\tincludeAllExtensionTools: true,\n\t\t\t});\n\t\t\tinternals._restoreToolsFromTranscript({ startup: true });\n\t\t\tif (this._workflowStageAdmission?.hasAgentTaskHost() && !isSubagentChildSession(internals))\n\t\t\t\tinternals.getAgentTaskHost();\n\t\t} catch (error) {\n\t\t\t// No session escapes a failed constructor to release these acquisitions later.\n\t\t\tconst failures: unknown[] = [];\n\t\t\tfor (const release of [\n\t\t\t\t() => removeExecutionEndedListener?.(),\n\t\t\t\t() => this._unsubscribeAgent?.(),\n\t\t\t\t() => this._tempStorageLease?.release(),\n\t\t\t\t() => this._extensionRunner?.invalidate(\"Session construction failed\"),\n\t\t\t]) {\n\t\t\t\ttry {\n\t\t\t\t\trelease();\n\t\t\t\t} catch (cause) {\n\t\t\t\t\tfailures.push(cause);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._extensionRunnerRef) this._extensionRunnerRef.current = undefined;\n\t\t\tif (failures.length)\n\t\t\t\tthrow Object.assign(new AggregateError([error, ...failures], \"Session construction cleanup failed\"), {\n\t\t\t\t\tcode: \"ShutdownFailed\",\n\t\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n\ninterface StageMessageAdmission {\n\tboundary: WorkflowStageAdmissionBoundary;\n\textensionState: Map<string, object>;\n\tisOpen(): boolean;\n}\n\n/**\n * A workflow stage keeps this admission for every session it opens, so it is built outside the session's constructor:\n * a closure made there would keep the first session reachable for as long as the stage lives.\n */\nfunction stageMessageAdmission(boundary: WorkflowStageAdmissionBoundary): StageMessageAdmission {\n\treturn { boundary, extensionState: new Map(), isOpen: () => boundary.isOpen() };\n}\n\nexport interface AgentSession extends AgentSessionBase, AgentSessionPublicSurface {}\n\nexport const AgentSession = AgentSessionBase as unknown as {\n\tnew (config: AgentSessionConfig): AgentSession;\n\treadonly prototype: AgentSession;\n};\n\ninstallAgentSessionAccessors(AgentSession.prototype as unknown as AgentSessionInternalSurface);\ninstallBackgroundCompactionAccessors(AgentSession.prototype as unknown as AgentSessionInternalSurface);\nObject.assign(\n\tAgentSession.prototype,\n\tagentSessionToolHooksMethods,\n\tagentSessionBoundaryMethods,\n\tagentSessionEventsMethods,\n\tagentSessionStateMethods,\n\tagentSessionPromptMethods,\n\tagentSessionCustomMessageCommitMethods,\n\tagentSessionMessageQueueMethods,\n\tagentSessionModelsMethods,\n\tagentSessionCompactionMethods,\n\tagentSessionAutoCompactionMethods,\n\tagentSessionPostToolCompactionMethods,\n\tagentSessionBackgroundCompactionMethods,\n\tagentSessionExtensionBindingsMethods,\n\tagentSessionRecoveryMethods,\n\tagentSessionDetachedToolMethods,\n\tagentSessionReleaseMethods,\n\tagentSessionToolRegistryMethods,\n\tagentSessionRetryMethods,\n\tagentSessionBashMethods,\n\tagentSessionTreeMethods,\n\tagentSessionExportMethods,\n\tagentSessionSummaryMethods,\n\tagentSessionTaskMethods,\n);\n"]}
@@ -10,7 +10,7 @@ export type { BlueprintDocument, BlueprintPlatform, BlueprintShell, BlueprintSte
10
10
  export { findResumeError, isResumeCatalogTimeoutError, isResumeCatalogUnavailableError, isResumeError, isResumeNotFoundError, isResumePreconditionError, isRetryableResumeError, ResumeCatalogTimeoutError, type ResumeCatalogTimeoutErrorCode, type ResumeCatalogTimeoutErrorFields, ResumeCatalogUnavailableError, type ResumeCatalogUnavailableErrorCode, type ResumeCatalogUnavailableErrorFields, type ResumeEntryPoint, ResumeError, type ResumeErrorCode, type ResumeErrorFields, type ResumeErrorFieldValue, type ResumeErrorName, ResumeNotFoundError, type ResumeNotFoundErrorCode, type ResumeNotFoundErrorFields, type ResumeNotFoundReason, ResumePreconditionError, type ResumePreconditionErrorCode, type ResumePreconditionErrorFields, type ResumePreconditionProblem, type ResumePreconditionProblemCode, type ResumeSubject, rehydrateResumeError, type SerializedResumeError, serializeResumeError, } from "./errors.ts";
11
11
  export { isResumeFailure, resumeFailureMessage } from "./failure.ts";
12
12
  export { RESUME_CATALOG_TIMEOUT_MS, type ResumeLookupTarget, resumeLookupError, resumeNotFoundError, withResumeLookupDeadline, } from "./not-found.ts";
13
- export { currentWorktreeRootMappings, mapPathForCwd, withWorktreeRootMappings } from "./path-mapping.ts";
13
+ export { currentWorktreeRestoreNotices, currentWorktreeRootMappings, mapPathForCwd, withWorktreeRestoreNotices, withWorktreeRootMappings, } from "./path-mapping.ts";
14
14
  export { checkResumeStoragePreconditions, type ResumePreflightIo, type ResumeStorageTarget, storagePreconditionProblems, } from "./preflight.ts";
15
15
  export { type RunRestoreHistory, type RunResumeSetupOptions, type RunWorktreeTarget, restoreRunWorktree, runRestorePreconditionError, setUpRestoredRunWorktrees, setUpResumedRunWorktrees, } from "./run-setup.ts";
16
16
  export { continueSessionWhereItWorked, type DirtyCheckoutChoice, type DirtyCheckoutPrompt, type PreparedSessionResume, type PrepareSessionResumeOptions, prepareSessionResume, type ResumeNotice, resumeStoreDir, savedProjectTrust, sessionResumeOptions, worktreeNeedsRestore, } from "./session-resume.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/resume/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,2BAA2B,EAC3B,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,SAAS,GACT,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,+BAA+B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EACN,yBAAyB,EACzB,KAAK,6BAA6B,EAClC,KAAK,+BAA+B,EACpC,KAAK,mBAAmB,EACxB,cAAc,EACd,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,qBAAqB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,c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AAW,EACX,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,EAClC,KAAK,aAAa,EAClB,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,oBAAoB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACN,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACzG,OAAO,EACN,+BAA+B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,2BAA2B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,4BAA4B,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,oBAAoB,EACpB,KAAK,YAAY,EACjB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/resume/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,2BAA2B,EAC3B,KAAK,aAAa,EAClB,KAAK,k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BAA2B,EAC3B,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,+BAA+B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,2BAA2B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,4BAA4B,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,oBAAoB,EACpB,KAAK,YAAY,EACjB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,qBAAqB,CAAC"}
@@ -9,7 +9,7 @@ export { BLUEPRINT_STEP_TIMEOUT_MS } from "./blueprint/steps.js";
9
9
  export { findResumeError, isResumeCatalogTimeoutError, isResumeCatalogUnavailableError, isResumeError, isResumeNotFoundError, isResumePreconditionError, isRetryableResumeError, ResumeCatalogTimeoutError, ResumeCatalogUnavailableError, ResumeError, ResumeNotFoundError, ResumePreconditionError, rehydrateResumeError, serializeResumeError, } from "./errors.js";
10
10
  export { isResumeFailure, resumeFailureMessage } from "./failure.js";
11
11
  export { RESUME_CATALOG_TIMEOUT_MS, resumeLookupError, resumeNotFoundError, withResumeLookupDeadline, } from "./not-found.js";
12
- export { currentWorktreeRootMappings, mapPathForCwd, withWorktreeRootMappings } from "./path-mapping.js";
12
+ export { currentWorktreeRestoreNotices, currentWorktreeRootMappings, mapPathForCwd, withWorktreeRestoreNotices, withWorktreeRootMappings, } from "./path-mapping.js";
13
13
  export { checkResumeStoragePreconditions, storagePreconditionProblems, } from "./preflight.js";
14
14
  export { restoreRunWorktree, runRestorePreconditionError, setUpRestoredRunWorktrees, setUpResumedRunWorktrees, } from "./run-setup.js";
15
15
  export { continueSessionWhereItWorked, prepareSessionResume, resumeStoreDir, savedProjectTrust, sessionResumeOptions, worktreeNeedsRestore, } from "./session-resume.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/resume/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,2BAA2B,EAG3B,oBAAoB,EAEpB,SAAS,GACT,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,+BAA+B,EAQ/B,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EACN,yBAAyB,EAIzB,cAAc,EAKd,qBAAqB,EAMrB,wBAAwB,EAIxB,0BAA0B,EAG1B,6BAA6B,EAI7B,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EAEvB,uBAAuB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAwB,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAEN,mBAAmB,EACnB,gBAAgB,EAGhB,sBAAsB,EACtB,6BAA6B,EAE7B,sBAAsB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAajE,OAAO,EACN,eAAe,EACf,2BAA2B,EAC3B,+BAA+B,EAC/B,aAAa,EACb,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,EAGzB,6BAA6B,EAI7B,WAAW,EAKX,mBAAmB,EAInB,uBAAuB,EAMvB,oBAAoB,EAEpB,oBAAoB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACN,yBAAyB,EAEzB,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACzG,OAAO,EACN,+BAA+B,EAG/B,2BAA2B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAIN,kBAAkB,EAClB,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,4BAA4B,EAK5B,oBAAoB,EAEpB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,qBAAqB,CAAC","sourcesContent":["export {\n\tACTIONS_GITHUB_BASE_URL_ENV,\n\ttype ActionFetcher,\n\ttype ActionFetchRequest,\n\tparseActionReference,\n\ttype RunActionOptions,\n\trunAction,\n} from \"./blueprint/actions.ts\";\nexport {\n\tBLUEPRINT_FULL_BUILD_MAX_AGE_MS,\n\ttype BlueprintBuildConfig,\n\ttype BlueprintBuildOutcome,\n\ttype BlueprintBuildStatus,\n\ttype BlueprintFailure,\n\ttype BlueprintLayer,\n\ttype BlueprintLayerState,\n\ttype BlueprintRepository,\n\tdescribeBlueprints,\n\tneedsRebuild,\n\trunBlueprintBuild,\n\tSETUP_COMMAND_ALIAS,\n} from \"./blueprint/build.ts\";\nexport { BLUEPRINT_CONTEXT_TYPE, renderBlueprintContext } from \"./blueprint/context.ts\";\nexport {\n\tBlueprintBuildFailedError,\n\ttype BlueprintBuildFailedErrorCode,\n\ttype BlueprintBuildFailedErrorFields,\n\ttype BlueprintBuildPhase,\n\tBlueprintError,\n\ttype BlueprintErrorCode,\n\ttype BlueprintErrorFields,\n\ttype BlueprintErrorFieldValue,\n\ttype BlueprintErrorName,\n\tBlueprintInvalidError,\n\ttype BlueprintInvalidErrorCode,\n\ttype BlueprintInvalidErrorFields,\n\ttype BlueprintInvalidReason,\n\ttype BlueprintScope,\n\ttype BlueprintSection,\n\tBlueprintStepFailedError,\n\ttype BlueprintStepFailedErrorCode,\n\ttype BlueprintStepFailedErrorFields,\n\ttype BlueprintStepLocation,\n\tBlueprintStepTimedOutError,\n\ttype BlueprintStepTimedOutErrorCode,\n\ttype BlueprintStepTimedOutErrorFields,\n\tBlueprintUsesUnsupportedError,\n\ttype BlueprintUsesUnsupportedErrorCode,\n\ttype BlueprintUsesUnsupportedErrorFields,\n\ttype BlueprintUsesUnsupportedReason,\n\tfindBlueprintError,\n\tisBlueprintBuildFailedError,\n\tisBlueprintError,\n\tisBlueprintInvalidError,\n\tisBlueprintStepFailedError,\n\tisBlueprintStepTimedOutError,\n\tisBlueprintUsesUnsupportedError,\n\trehydrateBlueprintError,\n\ttype SerializedBlueprintError,\n\tserializeBlueprintError,\n} from \"./blueprint/errors.ts\";\nexport { type BlueprintNotice, blueprintNotices } from \"./blueprint/notices.ts\";\nexport {\n\ttype BlueprintCheckout,\n\tblueprintRepository,\n\tinheritedRemotes,\n\ttype RestoreLink,\n\ttype ResumedBlueprints,\n\trecordBlueprintContext,\n\trecordRestoredWorktreeContext,\n\ttype SetUpBlueprintsOptions,\n\tsetUpResumedBlueprints,\n} from \"./blueprint/resume.ts\";\nexport { BLUEPRINT_RULES, hostPlatform, parseBlueprint, selectDocument } from \"./blueprint/schema.ts\";\nexport { BLUEPRINT_STEP_TIMEOUT_MS } from \"./blueprint/steps.ts\";\nexport type {\n\tBlueprintDocument,\n\tBlueprintPlatform,\n\tBlueprintShell,\n\tBlueprintStep,\n\tBlueprintWarning,\n\tIncludedWorkspace,\n\tKnowledgeItem,\n\tParsedBlueprint,\n\tRunStep,\n\tUsesStep,\n} from \"./blueprint/types.ts\";\nexport {\n\tfindResumeError,\n\tisResumeCatalogTimeoutError,\n\tisResumeCatalogUnavailableError,\n\tisResumeError,\n\tisResumeNotFoundError,\n\tisResumePreconditionError,\n\tisRetryableResumeError,\n\tResumeCatalogTimeoutError,\n\ttype ResumeCatalogTimeoutErrorCode,\n\ttype ResumeCatalogTimeoutErrorFields,\n\tResumeCatalogUnavailableError,\n\ttype ResumeCatalogUnavailableErrorCode,\n\ttype ResumeCatalogUnavailableErrorFields,\n\ttype ResumeEntryPoint,\n\tResumeError,\n\ttype ResumeErrorCode,\n\ttype ResumeErrorFields,\n\ttype ResumeErrorFieldValue,\n\ttype ResumeErrorName,\n\tResumeNotFoundError,\n\ttype ResumeNotFoundErrorCode,\n\ttype ResumeNotFoundErrorFields,\n\ttype ResumeNotFoundReason,\n\tResumePreconditionError,\n\ttype ResumePreconditionErrorCode,\n\ttype ResumePreconditionErrorFields,\n\ttype ResumePreconditionProblem,\n\ttype ResumePreconditionProblemCode,\n\ttype ResumeSubject,\n\trehydrateResumeError,\n\ttype SerializedResumeError,\n\tserializeResumeError,\n} from \"./errors.ts\";\nexport { isResumeFailure, resumeFailureMessage } from \"./failure.ts\";\nexport {\n\tRESUME_CATALOG_TIMEOUT_MS,\n\ttype ResumeLookupTarget,\n\tresumeLookupError,\n\tresumeNotFoundError,\n\twithResumeLookupDeadline,\n} from \"./not-found.ts\";\nexport { currentWorktreeRootMappings, mapPathForCwd, withWorktreeRootMappings } from \"./path-mapping.ts\";\nexport {\n\tcheckResumeStoragePreconditions,\n\ttype ResumePreflightIo,\n\ttype ResumeStorageTarget,\n\tstoragePreconditionProblems,\n} from \"./preflight.ts\";\nexport {\n\ttype RunRestoreHistory,\n\ttype RunResumeSetupOptions,\n\ttype RunWorktreeTarget,\n\trestoreRunWorktree,\n\trunRestorePreconditionError,\n\tsetUpRestoredRunWorktrees,\n\tsetUpResumedRunWorktrees,\n} from \"./run-setup.ts\";\nexport {\n\tcontinueSessionWhereItWorked,\n\ttype DirtyCheckoutChoice,\n\ttype DirtyCheckoutPrompt,\n\ttype PreparedSessionResume,\n\ttype PrepareSessionResumeOptions,\n\tprepareSessionResume,\n\ttype ResumeNotice,\n\tresumeStoreDir,\n\tsavedProjectTrust,\n\tsessionResumeOptions,\n\tworktreeNeedsRestore,\n} from \"./session-resume.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/resume/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,2BAA2B,EAG3B,oBAAoB,EAEpB,SAAS,GACT,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,+BAA+B,EAQ/B,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EACN,yBAAyB,EAIzB,cAAc,EAKd,qBAAqB,EAMrB,wBAAwB,EAIxB,0BAA0B,EAG1B,6BAA6B,EAI7B,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EAEvB,uBAAuB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAwB,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAEN,mBAAmB,EACnB,gBAAgB,EAGhB,sBAAsB,EACtB,6BAA6B,EAE7B,sBAAsB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtG,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAajE,OAAO,EACN,eAAe,EACf,2BAA2B,EAC3B,+BAA+B,EAC/B,aAAa,EACb,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,EAGzB,6BAA6B,EAI7B,WAAW,EAKX,mBAAmB,EAInB,uBAAuB,EAMvB,oBAAoB,EAEpB,oBAAoB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACN,yBAAyB,EAEzB,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,6BAA6B,EAC7B,2BAA2B,EAC3B,aAAa,EACb,0BAA0B,EAC1B,wBAAwB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,+BAA+B,EAG/B,2BAA2B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAIN,kBAAkB,EAClB,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,4BAA4B,EAK5B,oBAAoB,EAEpB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,GACpB,MAAM,qBAAqB,CAAC","sourcesContent":["export {\n\tACTIONS_GITHUB_BASE_URL_ENV,\n\ttype ActionFetcher,\n\ttype ActionFetchRequest,\n\tparseActionReference,\n\ttype RunActionOptions,\n\trunAction,\n} from \"./blueprint/actions.ts\";\nexport {\n\tBLUEPRINT_FULL_BUILD_MAX_AGE_MS,\n\ttype BlueprintBuildConfig,\n\ttype BlueprintBuildOutcome,\n\ttype BlueprintBuildStatus,\n\ttype BlueprintFailure,\n\ttype BlueprintLayer,\n\ttype BlueprintLayerState,\n\ttype BlueprintRepository,\n\tdescribeBlueprints,\n\tneedsRebuild,\n\trunBlueprintBuild,\n\tSETUP_COMMAND_ALIAS,\n} from \"./blueprint/build.ts\";\nexport { BLUEPRINT_CONTEXT_TYPE, renderBlueprintContext } from \"./blueprint/context.ts\";\nexport {\n\tBlueprintBuildFailedError,\n\ttype BlueprintBuildFailedErrorCode,\n\ttype BlueprintBuildFailedErrorFields,\n\ttype BlueprintBuildPhase,\n\tBlueprintError,\n\ttype BlueprintErrorCode,\n\ttype BlueprintErrorFields,\n\ttype BlueprintErrorFieldValue,\n\ttype BlueprintErrorName,\n\tBlueprintInvalidError,\n\ttype BlueprintInvalidErrorCode,\n\ttype BlueprintInvalidErrorFields,\n\ttype BlueprintInvalidReason,\n\ttype BlueprintScope,\n\ttype BlueprintSection,\n\tBlueprintStepFailedError,\n\ttype BlueprintStepFailedErrorCode,\n\ttype BlueprintStepFailedErrorFields,\n\ttype BlueprintStepLocation,\n\tBlueprintStepTimedOutError,\n\ttype BlueprintStepTimedOutErrorCode,\n\ttype BlueprintStepTimedOutErrorFields,\n\tBlueprintUsesUnsupportedError,\n\ttype BlueprintUsesUnsupportedErrorCode,\n\ttype BlueprintUsesUnsupportedErrorFields,\n\ttype BlueprintUsesUnsupportedReason,\n\tfindBlueprintError,\n\tisBlueprintBuildFailedError,\n\tisBlueprintError,\n\tisBlueprintInvalidError,\n\tisBlueprintStepFailedError,\n\tisBlueprintStepTimedOutError,\n\tisBlueprintUsesUnsupportedError,\n\trehydrateBlueprintError,\n\ttype SerializedBlueprintError,\n\tserializeBlueprintError,\n} from \"./blueprint/errors.ts\";\nexport { type BlueprintNotice, blueprintNotices } from \"./blueprint/notices.ts\";\nexport {\n\ttype BlueprintCheckout,\n\tblueprintRepository,\n\tinheritedRemotes,\n\ttype RestoreLink,\n\ttype ResumedBlueprints,\n\trecordBlueprintContext,\n\trecordRestoredWorktreeContext,\n\ttype SetUpBlueprintsOptions,\n\tsetUpResumedBlueprints,\n} from \"./blueprint/resume.ts\";\nexport { BLUEPRINT_RULES, hostPlatform, parseBlueprint, selectDocument } from \"./blueprint/schema.ts\";\nexport { BLUEPRINT_STEP_TIMEOUT_MS } from \"./blueprint/steps.ts\";\nexport type {\n\tBlueprintDocument,\n\tBlueprintPlatform,\n\tBlueprintShell,\n\tBlueprintStep,\n\tBlueprintWarning,\n\tIncludedWorkspace,\n\tKnowledgeItem,\n\tParsedBlueprint,\n\tRunStep,\n\tUsesStep,\n} from \"./blueprint/types.ts\";\nexport {\n\tfindResumeError,\n\tisResumeCatalogTimeoutError,\n\tisResumeCatalogUnavailableError,\n\tisResumeError,\n\tisResumeNotFoundError,\n\tisResumePreconditionError,\n\tisRetryableResumeError,\n\tResumeCatalogTimeoutError,\n\ttype ResumeCatalogTimeoutErrorCode,\n\ttype ResumeCatalogTimeoutErrorFields,\n\tResumeCatalogUnavailableError,\n\ttype ResumeCatalogUnavailableErrorCode,\n\ttype ResumeCatalogUnavailableErrorFields,\n\ttype ResumeEntryPoint,\n\tResumeError,\n\ttype ResumeErrorCode,\n\ttype ResumeErrorFields,\n\ttype ResumeErrorFieldValue,\n\ttype ResumeErrorName,\n\tResumeNotFoundError,\n\ttype ResumeNotFoundErrorCode,\n\ttype ResumeNotFoundErrorFields,\n\ttype ResumeNotFoundReason,\n\tResumePreconditionError,\n\ttype ResumePreconditionErrorCode,\n\ttype ResumePreconditionErrorFields,\n\ttype ResumePreconditionProblem,\n\ttype ResumePreconditionProblemCode,\n\ttype ResumeSubject,\n\trehydrateResumeError,\n\ttype SerializedResumeError,\n\tserializeResumeError,\n} from \"./errors.ts\";\nexport { isResumeFailure, resumeFailureMessage } from \"./failure.ts\";\nexport {\n\tRESUME_CATALOG_TIMEOUT_MS,\n\ttype ResumeLookupTarget,\n\tresumeLookupError,\n\tresumeNotFoundError,\n\twithResumeLookupDeadline,\n} from \"./not-found.ts\";\nexport {\n\tcurrentWorktreeRestoreNotices,\n\tcurrentWorktreeRootMappings,\n\tmapPathForCwd,\n\twithWorktreeRestoreNotices,\n\twithWorktreeRootMappings,\n} from \"./path-mapping.ts\";\nexport {\n\tcheckResumeStoragePreconditions,\n\ttype ResumePreflightIo,\n\ttype ResumeStorageTarget,\n\tstoragePreconditionProblems,\n} from \"./preflight.ts\";\nexport {\n\ttype RunRestoreHistory,\n\ttype RunResumeSetupOptions,\n\ttype RunWorktreeTarget,\n\trestoreRunWorktree,\n\trunRestorePreconditionError,\n\tsetUpRestoredRunWorktrees,\n\tsetUpResumedRunWorktrees,\n} from \"./run-setup.ts\";\nexport {\n\tcontinueSessionWhereItWorked,\n\ttype DirtyCheckoutChoice,\n\ttype DirtyCheckoutPrompt,\n\ttype PreparedSessionResume,\n\ttype PrepareSessionResumeOptions,\n\tprepareSessionResume,\n\ttype ResumeNotice,\n\tresumeStoreDir,\n\tsavedProjectTrust,\n\tsessionResumeOptions,\n\tworktreeNeedsRestore,\n} from \"./session-resume.ts\";\n"]}
@@ -10,6 +10,16 @@ export declare function currentWorktreeRootMappings(): readonly WorktreeRootMapp
10
10
  * runs never apply.
11
11
  */
12
12
  export declare function withWorktreeRootMappings<T>(mappings: readonly WorktreeRootMapping[], work: () => T, outer?: readonly WorktreeRootMapping[]): T;
13
+ /**
14
+ * The notices of the checkouts that the sessions and runs work started here runs in hold less of than their recorded
15
+ * snapshots, or continued without (#4738), outermost first. A session opened here tells its model about them.
16
+ */
17
+ export declare function currentWorktreeRestoreNotices(): readonly string[];
18
+ /**
19
+ * Runs `work` with `notices`, one per checkout restored with less than its snapshot or not at all, after the outer ones;
20
+ * a notice an outer run already gives is not repeated.
21
+ */
22
+ export declare function withWorktreeRestoreNotices<T>(notices: readonly string[], work: () => T): T;
13
23
  /**
14
24
  * `path` as it resolves for work in `cwd` under the restores of the current session or run: a path under a checkout it
15
25
  * recorded elsewhere (on another node, or a checkout it no longer uses here) moves to the same place in the worktree
@@ -1 +1 @@
1
- {"version":3,"file":"path-mapping.d.ts","sourceRoot":"","sources":["../../../src/core/resume/path-mapping.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAKzE,sDAAsD;AACtD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAG/D;AAED,gHAAgH;AAChH,wBAAgB,2BAA2B,IAAI,SAAS,mBAAmB,EAAE,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EACzC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,EACxC,IAAI,EAAE,MAAM,CAAC,EACb,KAAK,GAAE,SAAS,mBAAmB,EAAkC,GACnE,CAAC,CAMH;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAO/D"}
1
+ {"version":3,"file":"path-mapping.d.ts","sourceRoot":"","sources":["../../../src/core/resume/path-mapping.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAKzE,sDAAsD;AACtD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAG/D;AAED,gHAAgH;AAChH,wBAAgB,2BAA2B,IAAI,SAAS,mBAAmB,EAAE,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EACzC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,EACxC,IAAI,EAAE,MAAM,CAAC,EACb,KAAK,GAAE,SAAS,mBAAmB,EAAkC,GACnE,CAAC,CAMH;AAKD;;;GAGG;AACH,wBAAgB,6BAA6B,IAAI,SAAS,MAAM,EAAE,CAEjE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAK1F;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAO/D"}
@@ -22,6 +22,26 @@ export function withWorktreeRootMappings(mappings, work, outer = currentWorktree
22
22
  const restoredHere = new Set(mappings.map((mapping) => resolve(mapping.from)));
23
23
  return scopedMappings.run([...outer.filter((mapping) => !restoredHere.has(resolve(mapping.from))), ...mappings], work);
24
24
  }
25
+ /** The notices of checkouts the current work's sessions and runs hold only part of, or continued without (#4738). */
26
+ const scopedRestoreNotices = new AsyncLocalStorage();
27
+ /**
28
+ * The notices of the checkouts that the sessions and runs work started here runs in hold less of than their recorded
29
+ * snapshots, or continued without (#4738), outermost first. A session opened here tells its model about them.
30
+ */
31
+ export function currentWorktreeRestoreNotices() {
32
+ return scopedRestoreNotices.getStore() ?? [];
33
+ }
34
+ /**
35
+ * Runs `work` with `notices`, one per checkout restored with less than its snapshot or not at all, after the outer ones;
36
+ * a notice an outer run already gives is not repeated.
37
+ */
38
+ export function withWorktreeRestoreNotices(notices, work) {
39
+ const outer = currentWorktreeRestoreNotices();
40
+ const added = notices.filter((notice) => !outer.includes(notice));
41
+ if (added.length === 0)
42
+ return work();
43
+ return scopedRestoreNotices.run([...outer, ...added], work);
44
+ }
25
45
  /**
26
46
  * `path` as it resolves for work in `cwd` under the restores of the current session or run: a path under a checkout it
27
47
  * recorded elsewhere (on another node, or a checkout it no longer uses here) moves to the same place in the worktree
@@ -1 +1 @@
1
- {"version":3,"file":"path-mapping.js","sourceRoot":"","sources":["../../../src/core/resume/path-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,sHAAsH;AACtH,MAAM,cAAc,GAAG,IAAI,iBAAiB,EAAkC,CAAC;AAE/E,sDAAsD;AACtD,MAAM,UAAU,QAAQ,CAAC,MAAc,EAAE,KAAa;IACrD,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,EAAE,CAAC,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AAC3E,CAAC;AAED,gHAAgH;AAChH,MAAM,UAAU,2BAA2B;IAC1C,OAAO,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;AACxC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CACvC,QAAwC,EACxC,IAAa,EACb,KAAK,GAAmC,2BAA2B,EAAE;IAErE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC/E,OAAO,cAAc,CAAC,GAAG,CACxB,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,QAAQ,CAAC,EACrF,IAAI,CACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,GAAW;IACtD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,MAAM,GAAG,eAAe,CAC7B,IAAI,EACJ,2BAA2B,EAAE,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CACzF,CAAC;IACF,OAAO,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACjD,CAAC","sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport { isAbsolute, relative, resolve, sep } from \"node:path\";\nimport { mapRestoredPath } from \"../session-worktree-snapshots.ts\";\nimport type { WorktreeRootMapping } from \"../worktree-snapshot/types.ts\";\n\n/** The restores that apply to the paths resolved by the current work: its own, after those of any work it runs in. */\nconst scopedMappings = new AsyncLocalStorage<readonly WorktreeRootMapping[]>();\n\n/** Whether `child` is `parent` or a path below it. */\nexport function isInside(parent: string, child: string): boolean {\n\tconst path = relative(parent, child);\n\treturn !path.startsWith(`..${sep}`) && path !== \"..\" && !isAbsolute(path);\n}\n\n/** The restores that apply to work started here: those of the sessions and runs it runs in, outermost first. */\nexport function currentWorktreeRootMappings(): readonly WorktreeRootMapping[] {\n\treturn scopedMappings.getStore() ?? [];\n}\n\n/**\n * Runs `work` with `mappings` (one session's or run's restores, oldest first) applying to the paths its tools resolve,\n * after `outer`: the restores of the sessions and runs the work belongs to, by default those of the work it runs in. A\n * checkout that `mappings` restores follows its own restore, never an outer one. The restores of other sessions and\n * runs never apply.\n */\nexport function withWorktreeRootMappings<T>(\n\tmappings: readonly WorktreeRootMapping[],\n\twork: () => T,\n\touter: readonly WorktreeRootMapping[] = currentWorktreeRootMappings(),\n): T {\n\tconst restoredHere = new Set(mappings.map((mapping) => resolve(mapping.from)));\n\treturn scopedMappings.run(\n\t\t[...outer.filter((mapping) => !restoredHere.has(resolve(mapping.from))), ...mappings],\n\t\twork,\n\t);\n}\n\n/**\n * `path` as it resolves for work in `cwd` under the restores of the current session or run: a path under a checkout it\n * recorded elsewhere (on another node, or a checkout it no longer uses here) moves to the same place in the worktree\n * that checkout was restored into, whether or not the old path exists here. Paths in a recorded checkout that `cwd` is\n * in are never redirected. Outside a session's or run's work, every path is returned unchanged.\n */\nexport function mapPathForCwd(path: string, cwd: string): string {\n\tconst base = resolve(cwd);\n\tconst mapped = mapRestoredPath(\n\t\tpath,\n\t\tcurrentWorktreeRootMappings().filter((mapping) => !isInside(resolve(mapping.from), base)),\n\t);\n\treturn mapped === resolve(path) ? path : mapped;\n}\n"]}
1
+ {"version":3,"file":"path-mapping.js","sourceRoot":"","sources":["../../../src/core/resume/path-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAA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,CAAC;AAC9C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAI,OAA0B,EAAE,IAAa;IACtF,MAAM,KAAK,GAAG,6BAA6B,EAAE,CAAC;IAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAClE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,EAAE,CAAC;IACtC,OAAO,oBAAoB,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,GAAW;IACtD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,MAAM,GAAG,eAAe,CAC7B,IAAI,EACJ,2BAA2B,EAAE,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CACzF,CAAC;IACF,OAAO,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;AACjD,CAAC","sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport { isAbsolute, relative, resolve, sep } from \"node:path\";\nimport { mapRestoredPath } from \"../session-worktree-snapshots.ts\";\nimport type { WorktreeRootMapping } from \"../worktree-snapshot/types.ts\";\n\n/** The restores that apply to the paths resolved by the current work: its own, after those of any work it runs in. */\nconst scopedMappings = new AsyncLocalStorage<readonly WorktreeRootMapping[]>();\n\n/** Whether `child` is `parent` or a path below it. */\nexport function isInside(parent: string, child: string): boolean {\n\tconst path = relative(parent, child);\n\treturn !path.startsWith(`..${sep}`) && path !== \"..\" && !isAbsolute(path);\n}\n\n/** The restores that apply to work started here: those of the sessions and runs it runs in, outermost first. */\nexport function currentWorktreeRootMappings(): readonly WorktreeRootMapping[] {\n\treturn scopedMappings.getStore() ?? [];\n}\n\n/**\n * Runs `work` with `mappings` (one session's or run's restores, oldest first) applying to the paths its tools resolve,\n * after `outer`: the restores of the sessions and runs the work belongs to, by default those of the work it runs in. A\n * checkout that `mappings` restores follows its own restore, never an outer one. The restores of other sessions and\n * runs never apply.\n */\nexport function withWorktreeRootMappings<T>(\n\tmappings: readonly WorktreeRootMapping[],\n\twork: () => T,\n\touter: readonly WorktreeRootMapping[] = currentWorktreeRootMappings(),\n): T {\n\tconst restoredHere = new Set(mappings.map((mapping) => resolve(mapping.from)));\n\treturn scopedMappings.run(\n\t\t[...outer.filter((mapping) => !restoredHere.has(resolve(mapping.from))), ...mappings],\n\t\twork,\n\t);\n}\n\n/** The notices of checkouts the current work's sessions and runs hold only part of, or continued without (#4738). */\nconst scopedRestoreNotices = new AsyncLocalStorage<readonly string[]>();\n\n/**\n * The notices of the checkouts that the sessions and runs work started here runs in hold less of than their recorded\n * snapshots, or continued without (#4738), outermost first. A session opened here tells its model about them.\n */\nexport function currentWorktreeRestoreNotices(): readonly string[] {\n\treturn scopedRestoreNotices.getStore() ?? [];\n}\n\n/**\n * Runs `work` with `notices`, one per checkout restored with less than its snapshot or not at all, after the outer ones;\n * a notice an outer run already gives is not repeated.\n */\nexport function withWorktreeRestoreNotices<T>(notices: readonly string[], work: () => T): T {\n\tconst outer = currentWorktreeRestoreNotices();\n\tconst added = notices.filter((notice) => !outer.includes(notice));\n\tif (added.length === 0) return work();\n\treturn scopedRestoreNotices.run([...outer, ...added], work);\n}\n\n/**\n * `path` as it resolves for work in `cwd` under the restores of the current session or run: a path under a checkout it\n * recorded elsewhere (on another node, or a checkout it no longer uses here) moves to the same place in the worktree\n * that checkout was restored into, whether or not the old path exists here. Paths in a recorded checkout that `cwd` is\n * in are never redirected. Outside a session's or run's work, every path is returned unchanged.\n */\nexport function mapPathForCwd(path: string, cwd: string): string {\n\tconst base = resolve(cwd);\n\tconst mapped = mapRestoredPath(\n\t\tpath,\n\t\tcurrentWorktreeRootMappings().filter((mapping) => !isInside(resolve(mapping.from), base)),\n\t);\n\treturn mapped === resolve(path) ? path : mapped;\n}\n"]}
@@ -61,6 +61,11 @@ export type PreparedSessionResume = {
61
61
  readonly notices: readonly ResumeNotice[];
62
62
  /** The warnings of the blueprint builds this resume ran, also in `notices`. */
63
63
  readonly blueprintNotices: readonly ResumeNotice[];
64
+ /**
65
+ * The notices of checkouts whose snapshot record the session does not hold, also in `notices` (#4744). The
66
+ * session records nothing for them, so a caller that shows the notices its entries carry shows these too.
67
+ */
68
+ readonly missingRecordNotices?: readonly ResumeNotice[];
64
69
  /** The blueprint context the session's next turn carries, already recorded in it; undefined when none. */
65
70
  readonly blueprintContext: string | undefined;
66
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"session-resume.d.ts","sourceRoot":"","sources":["../../../src/core/resume/session-resume.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAU5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAU9D,OAAO,EAEN,KAAK,qBAAqB,EAE1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAEX,gBAAgB,EAChB,wBAAwB,EAExB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAUjE,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/E,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAElF,oHAAoH;AACpH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IACnC,6DAA6D;IAC7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,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED;;;;;;GAMG;AACH,wBAAsB,4BAA4B,CACjD,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,2BAA2B,EACpC,MAAM,GAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAA+D,GAC5G,OAAO,CAAC,cAAc,CAAC,CAmBzB;AAsDD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACzC,QAAQ,EAAE,gBAAgB,EAC1B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,qBAAqB,GAC5B,OAAO,CAAC,OAAO,CAAC,CASlB;AAuCD;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,wBAAwB,CAAC,GACvD,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAG/B;AAED,6GAA6G;AAC7G,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvD;AAMD;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,UAAU,EAAE,gBAAgB,EAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,6BAA6B,GAAG,uBAAuB,CAAC,EAC/F,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,GACpC,2BAA2B,CAQ7B"}
@@ -287,6 +287,7 @@ export async function prepareSessionResume(sessionManager, options) {
287
287
  sessionManager: opened.sessionManager,
288
288
  notices,
289
289
  blueprintNotices: blueprints.notices,
290
+ missingRecordNotices: resumed.missingNotices,
290
291
  blueprintContext: blueprints.context,
291
292
  };
292
293
  }
@@ -310,17 +311,16 @@ async function continueWithoutGit(sessionManager, git, storeDir, options) {
310
311
  const cwd = resumed.status === "none" ? sessionManager.getCwd() : resumed.cwd;
311
312
  const opened = await openResumedSession(sessionManager, cwd, [], options.sessionDirectory, resumed.status === "none" ? [] : resumed.unrestored.map((checkout) => checkout.record));
312
313
  const context = await describeBlueprintsInPlace(opened.sessionManager, storeDir, options);
314
+ const missingRecordNotices = (resumed.missingRecords ?? []).map((missing) => ({
315
+ type: "warning",
316
+ message: formatMissingRecordNotice(missing),
317
+ }));
313
318
  return {
314
319
  status: "ready",
315
320
  sessionManager: opened.sessionManager,
316
- notices: [
317
- ...opened.notices,
318
- ...(resumed.missingRecords ?? []).map((missing) => ({
319
- type: "warning",
320
- message: formatMissingRecordNotice(missing),
321
- })),
322
- ],
321
+ notices: [...opened.notices, ...missingRecordNotices],
323
322
  blueprintNotices: [],
323
+ missingRecordNotices,
324
324
  blueprintContext: context,
325
325
  };
326
326
  }
@@ -334,11 +334,13 @@ async function continueWithoutRecords(sessionManager, missing, storeDir, options
334
334
  const cwd = existsSync(recorded) ? recorded : resolve(options.launchCwd);
335
335
  const opened = await openResumedSession(sessionManager, cwd, [], options.sessionDirectory);
336
336
  const context = await describeBlueprintsInPlace(opened.sessionManager, storeDir, options);
337
+ const notices = missing.map((record) => ({ type: "warning", message: formatMissingRecordNotice(record) }));
337
338
  return {
338
339
  status: "ready",
339
340
  sessionManager: opened.sessionManager,
340
- notices: missing.map((record) => ({ type: "warning", message: formatMissingRecordNotice(record) })),
341
+ notices,
341
342
  blueprintNotices: [],
343
+ missingRecordNotices: notices,
342
344
  blueprintContext: context,
343
345
  };
344
346
  }
@@ -513,8 +515,11 @@ async function restorePlanned(sessionManager, plan, reused, storeDir, options) {
513
515
  unrestored: [],
514
516
  cwd: undefined,
515
517
  missing: new Set(),
518
+ missingNotices: [],
516
519
  };
520
+ let restored = false;
517
521
  const restore = async (targets, pending) => {
522
+ restored = true;
518
523
  const git = plan.git;
519
524
  for (const target of targets) {
520
525
  if (git === undefined) {
@@ -536,7 +541,9 @@ async function restorePlanned(sessionManager, plan, reused, storeDir, options) {
536
541
  if (outcome.missing.has(missing.root))
537
542
  continue;
538
543
  outcome.missing.add(missing.root);
539
- outcome.failed.push({ type: "warning", message: formatMissingRecordNotice(missing) });
544
+ const notice = { type: "warning", message: formatMissingRecordNotice(missing) };
545
+ outcome.failed.push(notice);
546
+ outcome.missingNotices.push(notice);
540
547
  }
541
548
  if (resumed.status === "none")
542
549
  return undefined;
@@ -557,6 +564,14 @@ async function restorePlanned(sessionManager, plan, reused, storeDir, options) {
557
564
  outcome.failed.push(notRestored(target.root, target.snapshot, `${absentOrChanged(target)}, and restoring it failed: ${describeFailure(error)}`));
558
565
  }
559
566
  }
567
+ // With nothing to restore, no restore listed the checkouts whose snapshot record is missing (#4744).
568
+ if (!restored) {
569
+ for (const missing of missingSnapshotRecords(sessionManager)) {
570
+ const notice = { type: "warning", message: formatMissingRecordNotice(missing) };
571
+ outcome.failed.push(notice);
572
+ outcome.missingNotices.push(notice);
573
+ }
574
+ }
560
575
  return outcome;
561
576
  }
562
577
  /**