@bastani/atomic 0.9.73-alpha.1 → 0.9.74-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 (194) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +10 -0
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/package.json +1 -1
  5. package/dist/builtin/subagents/package.json +1 -1
  6. package/dist/builtin/web-access/package.json +1 -1
  7. package/dist/builtin/workflows/CHANGELOG.md +16 -0
  8. package/dist/builtin/workflows/README.md +2 -2
  9. package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
  10. package/dist/builtin/workflows/builtin/{chunk-2377r57g.js → chunk-8kdrnrpa.js} +1 -1
  11. package/dist/builtin/workflows/builtin/{chunk-t8y25z1j.js → chunk-8ycbc76t.js} +1 -1
  12. package/dist/builtin/workflows/builtin/{chunk-vbrmytm5.js → chunk-a4fdm2cw.js} +1 -1
  13. package/dist/builtin/workflows/builtin/{chunk-9pjdp2td.js → chunk-d5cxskkp.js} +3 -3
  14. package/dist/builtin/workflows/builtin/{chunk-tpsw128z.js → chunk-d9pz64yp.js} +3 -3
  15. package/dist/builtin/workflows/builtin/{chunk-z0d03ktm.js → chunk-gp0s6m45.js} +1 -1
  16. package/dist/builtin/workflows/builtin/{chunk-4kygv34g.js → chunk-m8eg152f.js} +1 -1
  17. package/dist/builtin/workflows/builtin/{chunk-mswg7kc7.js → chunk-r39ypw6b.js} +1 -1
  18. package/dist/builtin/workflows/builtin/{chunk-q7dry6km.js → chunk-va2h64a6.js} +3 -3
  19. package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
  20. package/dist/builtin/workflows/builtin/goal.js +4 -4
  21. package/dist/builtin/workflows/builtin/index.js +9 -9
  22. package/dist/builtin/workflows/builtin/loop-until-done.js +2 -2
  23. package/dist/builtin/workflows/builtin/ralph.js +4 -4
  24. package/dist/builtin/workflows/builtin/tournament.js +2 -2
  25. package/dist/builtin/workflows/package.json +1 -1
  26. package/dist/builtin/workflows/src/authoring.d.ts +2 -0
  27. package/dist/builtin/workflows/src/extension/index.bundle.mjs +403 -76
  28. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +387 -60
  29. package/dist/builtin/workflows/src/index.js +393 -62
  30. package/dist/builtin/workflows/src/local-worker-entry.mjs +387 -60
  31. package/dist/builtin/workflows/src/shared/serializable-error-families.d.ts +1 -0
  32. package/dist/builtin/workflows/src/shared/structured-output-errors.d.ts +50 -0
  33. package/dist/config.d.ts +2 -0
  34. package/dist/config.d.ts.map +1 -1
  35. package/dist/config.js +4 -0
  36. package/dist/config.js.map +1 -1
  37. package/dist/core/agent-session-background-compaction.d.ts.map +1 -1
  38. package/dist/core/agent-session-background-compaction.js +2 -1
  39. package/dist/core/agent-session-background-compaction.js.map +1 -1
  40. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  41. package/dist/core/agent-session-compaction.js +98 -4
  42. package/dist/core/agent-session-compaction.js.map +1 -1
  43. package/dist/core/agent-session-detached-tools.d.ts +20 -5
  44. package/dist/core/agent-session-detached-tools.d.ts.map +1 -1
  45. package/dist/core/agent-session-detached-tools.js +97 -21
  46. package/dist/core/agent-session-detached-tools.js.map +1 -1
  47. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  48. package/dist/core/agent-session-message-queue.js +2 -1
  49. package/dist/core/agent-session-message-queue.js.map +1 -1
  50. package/dist/core/agent-session-methods.d.ts +3 -1
  51. package/dist/core/agent-session-methods.d.ts.map +1 -1
  52. package/dist/core/agent-session-methods.js.map +1 -1
  53. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
  54. package/dist/core/agent-session-persistent-custom-messages.js +12 -4
  55. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
  56. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  57. package/dist/core/agent-session-prompt.js +33 -0
  58. package/dist/core/agent-session-prompt.js.map +1 -1
  59. package/dist/core/compaction/background-compaction.d.ts +11 -5
  60. package/dist/core/compaction/background-compaction.d.ts.map +1 -1
  61. package/dist/core/compaction/background-compaction.js +19 -10
  62. package/dist/core/compaction/background-compaction.js.map +1 -1
  63. package/dist/core/compaction/compaction-boundary.d.ts +10 -0
  64. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  65. package/dist/core/compaction/compaction-boundary.js +30 -2
  66. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  67. package/dist/core/compaction/compaction-runner.d.ts +7 -0
  68. package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
  69. package/dist/core/compaction/compaction-runner.js +13 -5
  70. package/dist/core/compaction/compaction-runner.js.map +1 -1
  71. package/dist/core/compaction/compaction-types.d.ts +1 -1
  72. package/dist/core/compaction/compaction-types.js +1 -1
  73. package/dist/core/compaction/compaction-types.js.map +1 -1
  74. package/dist/core/compaction/deleted-ranges.d.ts +17 -2
  75. package/dist/core/compaction/deleted-ranges.d.ts.map +1 -1
  76. package/dist/core/compaction/deleted-ranges.js +44 -5
  77. package/dist/core/compaction/deleted-ranges.js.map +1 -1
  78. package/dist/core/compaction/history-recall.d.ts +32 -0
  79. package/dist/core/compaction/history-recall.d.ts.map +1 -0
  80. package/dist/core/compaction/history-recall.js +275 -0
  81. package/dist/core/compaction/history-recall.js.map +1 -0
  82. package/dist/core/compaction/index.d.ts +2 -0
  83. package/dist/core/compaction/index.d.ts.map +1 -1
  84. package/dist/core/compaction/index.js +2 -0
  85. package/dist/core/compaction/index.js.map +1 -1
  86. package/dist/core/compaction/pi-summary-fallback.d.ts.map +1 -1
  87. package/dist/core/compaction/pi-summary-fallback.js +1 -0
  88. package/dist/core/compaction/pi-summary-fallback.js.map +1 -1
  89. package/dist/core/compaction/planner-outcome.d.ts +14 -0
  90. package/dist/core/compaction/planner-outcome.d.ts.map +1 -1
  91. package/dist/core/compaction/planner-outcome.js +8 -0
  92. package/dist/core/compaction/planner-outcome.js.map +1 -1
  93. package/dist/core/compaction/range-planner-diagnostics.d.ts +35 -10
  94. package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -1
  95. package/dist/core/compaction/range-planner-diagnostics.js +67 -24
  96. package/dist/core/compaction/range-planner-diagnostics.js.map +1 -1
  97. package/dist/core/compaction/range-planner.d.ts +7 -4
  98. package/dist/core/compaction/range-planner.d.ts.map +1 -1
  99. package/dist/core/compaction/range-planner.js +43 -19
  100. package/dist/core/compaction/range-planner.js.map +1 -1
  101. package/dist/core/compaction/refusal-recovery.d.ts +27 -0
  102. package/dist/core/compaction/refusal-recovery.d.ts.map +1 -0
  103. package/dist/core/compaction/refusal-recovery.js +65 -0
  104. package/dist/core/compaction/refusal-recovery.js.map +1 -0
  105. package/dist/core/compaction/region-trimming.d.ts +23 -0
  106. package/dist/core/compaction/region-trimming.d.ts.map +1 -1
  107. package/dist/core/compaction/region-trimming.js +59 -15
  108. package/dist/core/compaction/region-trimming.js.map +1 -1
  109. package/dist/core/compaction/structured-compaction-input.d.ts +19 -1
  110. package/dist/core/compaction/structured-compaction-input.d.ts.map +1 -1
  111. package/dist/core/compaction/structured-compaction-input.js +30 -17
  112. package/dist/core/compaction/structured-compaction-input.js.map +1 -1
  113. package/dist/core/compaction/transcript-serialization.d.ts +9 -3
  114. package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
  115. package/dist/core/compaction/transcript-serialization.js +18 -10
  116. package/dist/core/compaction/transcript-serialization.js.map +1 -1
  117. package/dist/core/messages.d.ts +5 -1
  118. package/dist/core/messages.d.ts.map +1 -1
  119. package/dist/core/messages.js +21 -3
  120. package/dist/core/messages.js.map +1 -1
  121. package/dist/core/session-manager-core.js +1 -1
  122. package/dist/core/session-manager-core.js.map +1 -1
  123. package/dist/core/session-manager-history.d.ts +1 -1
  124. package/dist/core/session-manager-history.d.ts.map +1 -1
  125. package/dist/core/session-manager-history.js +2 -5
  126. package/dist/core/session-manager-history.js.map +1 -1
  127. package/dist/core/settings-defaults.d.ts +2 -0
  128. package/dist/core/settings-defaults.d.ts.map +1 -1
  129. package/dist/core/settings-defaults.js +2 -0
  130. package/dist/core/settings-defaults.js.map +1 -1
  131. package/dist/core/settings-manager-basic-accessors.d.ts +2 -0
  132. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  133. package/dist/core/settings-manager-basic-accessors.js +3 -0
  134. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  135. package/dist/core/settings-schema.d.ts +2 -0
  136. package/dist/core/settings-schema.d.ts.map +1 -1
  137. package/dist/core/settings-schema.js +4 -0
  138. package/dist/core/settings-schema.js.map +1 -1
  139. package/dist/core/storage/session/conformance.d.ts.map +1 -1
  140. package/dist/core/storage/session/conformance.js +12 -0
  141. package/dist/core/storage/session/conformance.js.map +1 -1
  142. package/dist/core/storage/session/jsonl-session-store.d.ts.map +1 -1
  143. package/dist/core/storage/session/jsonl-session-store.js +3 -0
  144. package/dist/core/storage/session/jsonl-session-store.js.map +1 -1
  145. package/dist/core/storage/session/legacy-session-store.d.ts.map +1 -1
  146. package/dist/core/storage/session/legacy-session-store.js +3 -0
  147. package/dist/core/storage/session/legacy-session-store.js.map +1 -1
  148. package/dist/core/storage/session/memory-session-store.d.ts.map +1 -1
  149. package/dist/core/storage/session/memory-session-store.js +3 -0
  150. package/dist/core/storage/session/memory-session-store.js.map +1 -1
  151. package/dist/core/storage/session/sql-session-store.d.ts.map +1 -1
  152. package/dist/core/storage/session/sql-session-store.js +12 -3
  153. package/dist/core/storage/session/sql-session-store.js.map +1 -1
  154. package/dist/core/storage/session/types.d.ts +3 -0
  155. package/dist/core/storage/session/types.d.ts.map +1 -1
  156. package/dist/core/storage/session/types.js +3 -0
  157. package/dist/core/storage/session/types.js.map +1 -1
  158. package/dist/core/tools/history-protocol.d.ts +3 -0
  159. package/dist/core/tools/history-protocol.d.ts.map +1 -1
  160. package/dist/core/tools/history-protocol.js +7 -87
  161. package/dist/core/tools/history-protocol.js.map +1 -1
  162. package/dist/core/tools/history-transcript.d.ts +24 -0
  163. package/dist/core/tools/history-transcript.d.ts.map +1 -0
  164. package/dist/core/tools/history-transcript.js +110 -0
  165. package/dist/core/tools/history-transcript.js.map +1 -0
  166. package/dist/index.d.ts +1 -1
  167. package/dist/index.d.ts.map +1 -1
  168. package/dist/index.js.map +1 -1
  169. package/dist/main-session.d.ts.map +1 -1
  170. package/dist/main-session.js +21 -5
  171. package/dist/main-session.js.map +1 -1
  172. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  173. package/dist/modes/interactive/components/compaction-boundary-message.js +7 -3
  174. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  175. package/dist/modes/interactive/interactive-render-chat.js +2 -2
  176. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  177. package/dist/session-id-target.d.ts +1 -0
  178. package/dist/session-id-target.d.ts.map +1 -1
  179. package/dist/session-id-target.js +3 -0
  180. package/dist/session-id-target.js.map +1 -1
  181. package/docs/compaction/reference.md +3 -2
  182. package/docs/compaction.md +35 -7
  183. package/docs/development.md +1 -1
  184. package/docs/sdk/reference.md +6 -5
  185. package/docs/sessions.md +3 -3
  186. package/docs/settings.md +3 -0
  187. package/docs/storage.md +2 -0
  188. package/docs/workflows/api-reference.md +15 -3
  189. package/docs/workflows/authoring.md +2 -2
  190. package/docs/workflows/operations.md +1 -0
  191. package/docs/workflows/reliable-design.md +1 -1
  192. package/npm-shrinkwrap.json +32 -32
  193. package/package.json +3 -3
  194. package/schemas/settings.schema.json +5 -0
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,WAAW,GAIX,MAAM,wBAAwB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AAWpD,OAAO,EAEN,6BAA6B,EAC7B,wCAAwC,GACxC,MAAM,qCAAqC,CAAC;AAW7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,cAAc,wBAAwB,CAA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,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACN,qBAAqB,EACrB,mBAAmB,EAGnB,uBAAuB,EAEvB,iBAAiB,EAMjB,wBAAwB,EAIxB,mBAAmB,EAGnB,yBAAyB,EACzB,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,4BAA4B,EAC5B,0BAA0B,GAE1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC3G,OAAO,EACN,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,EACzB,2BAA2B,EAE3B,wBAAwB,EAExB,gBAAgB,EAMhB,uBAAuB,GAEvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,oCAAoC,EAAE,MAAM,iBAAiB,CAAC;AACvE,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAGN,YAAY,EAIZ,UAAU,EACV,cAAc,GAEd,MAAM,0BAA0B,CAAC","sourcesContent":["export type { ExtensionBindings } from \"./core/agent-session-types.js\";\nexport {\n\tCacheWarmer,\n\ttype CacheWarmingDecisionEvent,\n\ttype CacheWarmingDecisionEventResult,\n\ttype CacheWarmingStatus,\n} from \"./core/cache-warmer.ts\";\nexport * from \"./core/event-subscriptions/index.js\";\nexport type { ExecuteToolOptions, ExtensionToolContext } from \"./core/extensions/context-types.ts\";\nexport type {\n\tHostDiagnostic,\n\tHostInput,\n\tHostInputOptions,\n\tQuestionAnswer,\n\tQuestionnaireError,\n\tQuestionnaireResult,\n\tQuestionParams,\n} from \"./core/extensions/host-input.js\";\nexport {\n\ttype ExtensionContextEffectPhase,\n\tpublishExtensionContextEffect,\n\tregisterExtensionContextRetirementEffect,\n} from \"./core/extensions/runner-context.ts\";\nexport type {\n\tDetachableCallPredicate,\n\tToolAnnotations,\n\tToolExposure,\n\tToolLoadout,\n\tToolLoadoutChanges,\n\tToolNamespace,\n\tToolRendererResolver,\n\tToolRenderers,\n} from \"./core/extensions/tool-types.ts\";\nexport { resolveRestoredModelReference } from \"./core/model-resolver-initial.ts\";\nexport * from \"./core/resume/index.ts\";\nexport type { UsageEntry } from \"./core/session-manager.ts\";\nexport { resolveSessionStore } from \"./core/session-storage.js\";\nexport {\n\tassertSessionBlobStore,\n\ttype BlobCopyOptions,\n\tcopySessionBlobs,\n\ttype MissingBlobReporter,\n\tsessionBlobHashes,\n\tTOOL_OUTPUT_ENTRY_TYPE,\n\ttype ToolOutputReference,\n\ttoolOutputUrl,\n} from \"./core/session-tool-output.ts\";\nexport { CACHE_WARMING_MODES, type CacheWarmingMode } from \"./core/settings-manager.ts\";\nexport * from \"./core/storage/index.js\";\n// Outside the storage barrel: workflow durability setup imports that barrel in every test worker.\nexport {\n\ttype ProcessStorageChoice,\n\tprocessSharedStorageSelection,\n\tprocessStorageEnvironment,\n\ttype StorageDomain,\n\tselectProcessStorage,\n} from \"./core/storage/process-selection.js\";\nexport { JsonlSessionStore } from \"./core/storage/session/jsonl-session-store.js\";\n// Internal trusted-host task integration (not model authority).\nexport { AgentTaskHost, type AgentTaskHostBinding, type AgentTaskRunnerFactory } from \"./core/tasks/agent-adapter.js\";\nexport {\n\tisRetryableTaskError,\n\tisTaskCleanupAdmissionTimeoutError,\n\tisTaskCleanupError,\n\trehydrateTaskCleanupError,\n\tTaskCleanupAdmissionTimeoutError,\n\ttype TaskCleanupAdmissionTiming,\n\tTaskCleanupError,\n\ttype TaskCleanupErrorCode,\n\ttype TaskCleanupFailure,\n\ttype TaskCleanupPhase,\n} from \"./core/tasks/cleanup-error.js\";\nexport { ranOnModelLine } from \"./core/tasks/completion.js\";\nexport type {\n\tAgentIntent,\n\tCleanup,\n\tOperationId,\n\tResourceFailure,\n\tTaskId,\n\tTaskRecord,\n\tTaskResult,\n\tWaitPolicy,\n} from \"./core/tasks/contracts.js\";\nexport {\n\tFINISHED_TASK_RETENTION,\n\tfindTaskEvictedError,\n\tisTaskEvictedError,\n\trehydrateTaskEvictedError,\n\tTaskEvictedError,\n\ttype TaskEvictedErrorCode,\n\ttype TaskEvictedErrorFields,\n} from \"./core/tasks/eviction-error.js\";\nexport { type AdmittedAgentTask, collectAgentTasks } from \"./core/tasks/execution-scope.js\";\nexport {\n\tDEFAULT_TASK_HEARTBEAT_MS,\n\tMIN_TASK_HEARTBEAT_MS,\n\tTASK_HEARTBEAT_MESSAGE_TYPE,\n\ttype TaskHeartbeatDetails,\n\tvalidateTaskHeartbeatMs,\n} from \"./core/tasks/heartbeat-notice.js\";\nexport {\n\tfindTaskMessageError,\n\tisRetryableTaskMessageError,\n\tisTaskMessageError,\n\tisTaskMessageTimeoutError,\n\trehydrateTaskMessageError,\n\ttype SerializedTaskMessageError,\n\tTaskMessageError,\n\ttype TaskMessageErrorCode,\n\ttype TaskMessageErrorFields,\n\tTaskMessageTimeoutError,\n\ttype TaskMessageTimeoutErrorFields,\n\ttype TaskMessageTimeoutPhase,\n} from \"./core/tasks/message-error.js\";\nexport {\n\tbindOwnerTaskStore,\n\tgetOwnerTaskStore,\n\tOwnerTaskStore,\n\ttype TaskActivity,\n\twatchOwnerTaskStoreBinding,\n} from \"./core/tasks/owner-store.js\";\nexport {\n\townerTaskViewSource,\n\ttype TaskDetailText,\n\ttype TaskOutputView,\n\ttype TaskTranscriptFollow,\n\ttype TaskTranscriptView,\n\ttype TaskViewResult,\n\ttype TaskViewSource,\n} from \"./core/tasks/task-view-source.js\";\nexport { formatReadLineRange, formatToolCallWithArgs } from \"./core/tools/render-utils.ts\";\nexport {\n\tcreateTranscript,\n\ttype Transcript,\n\ttype TranscriptOptions,\n\ttype TranscriptPart,\n\ttype TranscriptTextPart,\n\ttype TranscriptThinkingPart,\n\ttype TranscriptToolCallPart,\n\ttype TranscriptToolResult,\n\ttype TranscriptToolResultFormat,\n} from \"./core/transcript.js\";\nexport * from \"./core/worktree-snapshot/index.ts\";\nexport { type CodemodeExtensionOptions, createCodemodeExtension } from \"./extensions/codemode/index.js\";\nexport {\n\ttype CodemodeToolDetails,\n\ttype CodemodeToolOptions,\n\tcreateCodemodeDescription,\n\tcreateCodemodeTool,\n\tcreateCodemodeToolDefinition,\n} from \"./extensions/codemode/tool.js\";\nexport { createToolSearchExtension } from \"./extensions/tool-search/index.js\";\nexport { createToolSearchToolDefinition, type ToolSearchToolOptions } from \"./extensions/tool-search/tool.js\";\nexport { renderTaskFooter, TaskList, taskListSections } from \"./modes/interactive/components/task-list.js\";\nexport { TaskRow } from \"./modes/interactive/components/task-row.js\";\nexport {\n\tapplyAssistantMessageDelta,\n\tbeginStreamingAssistantMessage,\n} from \"./modes/interactive/streaming-assistant-message.ts\";\n\n// Core session management\n\n// GitHub Copilot request failures, typed at the provider; see docs/providers.md.\nexport {\n\tclassifyGitHubCopilotFailure,\n\tdescribeGitHubCopilotModel,\n\tdeserializeGitHubCopilotError,\n\tfindGitHubCopilotError,\n\tGITHUB_COPILOT_ERROR_DIAGNOSTIC,\n\tGitHubCopilotAuthenticationError,\n\tGitHubCopilotContentFilterError,\n\tGitHubCopilotEmptyResponseError,\n\tGitHubCopilotError,\n\ttype GitHubCopilotErrorCode,\n\ttype GitHubCopilotErrorContext,\n\ttype GitHubCopilotErrorFields,\n\ttype GitHubCopilotErrorName,\n\ttype GitHubCopilotFailureContext,\n\tGitHubCopilotInvalidRequestError,\n\ttype GitHubCopilotInvalidRequestReason,\n\ttype GitHubCopilotModelCapabilities,\n\tGitHubCopilotModelUnavailableError,\n\ttype GitHubCopilotModelUnavailableReason,\n\tGitHubCopilotPromptTooLargeError,\n\tGitHubCopilotQuotaExhaustedError,\n\tGitHubCopilotRateLimitError,\n\tGitHubCopilotServiceUnavailableError,\n\tGitHubCopilotStreamEndedEarlyError,\n\ttype GitHubCopilotUnrecognizedReason,\n\tGitHubCopilotUnrecognizedResponseError,\n\tgetGitHubCopilotError,\n\tisGitHubCopilotAuthenticationError,\n\tisGitHubCopilotContentFilterError,\n\tisGitHubCopilotEmptyResponseError,\n\tisGitHubCopilotError,\n\tisGitHubCopilotInvalidRequestError,\n\tisGitHubCopilotModelUnavailableError,\n\tisGitHubCopilotPromptTooLargeError,\n\tisGitHubCopilotQuotaExhaustedError,\n\tisGitHubCopilotRateLimitError,\n\tisGitHubCopilotServiceUnavailableError,\n\tisGitHubCopilotStreamEndedEarlyError,\n\tisGitHubCopilotUnrecognizedResponseError,\n\tisRetryableGitHubCopilotError,\n\ttype SerializedGitHubCopilotError,\n\tserializeGitHubCopilotError,\n} from \"@bastani/pi-ai\";\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport {\n\tAPP_NAME,\n\tAPP_TITLE,\n\tCONFIG_DIR_NAME,\n\tCONFIG_DIR_NAMES,\n\tgetAgentConfigPaths,\n\tgetAgentDir,\n\tgetAgentDirs,\n\tgetBundledInteractiveAssetPath,\n\tgetChangelogPath,\n\tgetDocsPath,\n\tgetEnvNames,\n\tgetEnvValue,\n\tgetExamplesPath,\n\tgetExportTemplateDir,\n\tgetInteractiveAssetsDir,\n\tgetLegacyAgentDir,\n\tgetPackageDir,\n\tgetPackageJsonPath,\n\tgetProjectConfigDirs,\n\tgetProjectConfigPaths,\n\tgetReadmePath,\n\tgetThemesDir,\n\tgetUserConfigDirs,\n\tgetUserConfigPaths,\n\thasEnvValue,\n\tisBunBinary,\n\tLEGACY_CONFIG_DIR_NAME,\n\tLEGACY_ENV_PREFIX,\n\tPACKAGE_NAME,\n\tsetEnvValue,\n\tVERSION,\n\tWORKFLOW_STAGE_SUBAGENT_GUARD_ENV,\n} from \"./config.js\";\nexport {\n\tAgentRehydrateError,\n\ttype AgentRehydrateErrorCode,\n\ttype AgentRehydrateErrorFields,\n\tAgentReleaseConfigError,\n\ttype AgentReleaseConfigSource,\n\ttype AgentSessionActivity,\n\tisAgentRehydrateError,\n\tisAgentReleaseConfigError,\n\tisLocalOnlySessionStorage,\n\tisRetryableAgentRehydrateError,\n\trehydrateAgentRehydrateError,\n\ttype SerializedAgentErrorCause,\n\ttype SerializedAgentRehydrateError,\n\tserializeAgentRehydrateError,\n\tTEAM_JOIN_COMMAND,\n} from \"./core/agent-rehydrate-errors.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype CompactionReason,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionCompactOptions,\n\ttype SessionRecoveryReport,\n\ttype SessionStats,\n} from \"./core/agent-session.js\";\nexport { AgentSessionBusyError, isAgentSessionBusyError } from \"./core/agent-session-busy-error.ts\";\nexport type {\n\tDetachedCallFailure,\n\tDetachedCallFailureCause,\n\tDetachedToolCall,\n\tDetachedToolResult,\n\tToolDetachmentPolicy,\n} from \"./core/agent-session-detached-tools.ts\";\nexport { markToolCallReadyForDetachment, toolCallNeedsDetachmentHandoff } from \"./core/agent-session-detached-tools.ts\";\nexport type { ReleasedAgentSession, ReleaseWhenIdleOptions } from \"./core/agent-session-release.ts\";\nexport {\n\ttype AgentWake,\n\ttype AgentWakeClock,\n\tAgentWakeDispatcher,\n\ttype AgentWakeDispatcherOptions,\n\ttype AgentWakeDispatcherStats,\n\ttype AgentWakeFailureListener,\n\ttype AgentWakeHandler,\n\ttype AgentWakeHandlerOptions,\n\ttype AgentWakeKind,\n\ttype AgentWakeTimer,\n\tagentWakeDispatcher,\n\twakeKeyNamespace,\n} from \"./core/agent-wake-dispatcher.ts\";\n// Auth and model runtime\nexport { AuthStorage, readStoredCredential } from \"./core/auth-storage.ts\";\nexport {\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n} from \"./core/auth-storage-backends.ts\";\nexport { type BashResult, executeBashWithOperations } from \"./core/bash-executor.ts\";\nexport { getBuiltinPackagePaths } from \"./core/builtin-packages.ts\";\nexport type { CompactionCacheMiss } from \"./core/cache-stats.ts\";\nexport {\n\ttype CallbackActivityDescriptor,\n\ttype CallbackActivityKind,\n\trunCallback,\n\trunSynchronousCallback,\n} from \"./core/callback-activity.ts\";\n// Cloudflare AI Gateway over the Workers AI binding (no API token; see docs/providers.md)\nexport {\n\ttype AiGatewayBinding,\n\ttype AiGatewayBindingGateway,\n\ttype AiGatewayUniversalRequestLike,\n\tCLOUDFLARE_GATEWAY_BINDING_AUTH_SENTINEL,\n\tcreateGatewayBindingFetch,\n\ttype GatewayBindingFetchOptions,\n} from \"./core/cloudflare-gateway-binding.ts\";\nexport {\n\tBACKGROUND_COMPACTION_RESULT_TYPE,\n\ttype BackgroundCompactionResultRecord,\n\ttype BackgroundCompactionState,\n\ttype BackgroundCompactionStatus,\n\ttype CompactionReadyWake,\n\ttype CompactionWakeDispatcher,\n\tDEFAULT_BACKGROUND_COMPACTION_THRESHOLD_PERCENT,\n\trehydrateBackgroundCompactionState,\n\ttype SerializedBackgroundCompactionState,\n\tserializeBackgroundCompactionState,\n} from \"./core/compaction/background-compaction.ts\";\nexport {\n\tBackgroundCompactionCommitError,\n\tBackgroundCompactionConfigError,\n\ttype BackgroundCompactionConfigReason,\n\ttype BackgroundCompactionConfigSource,\n\tBackgroundCompactionDiscardedError,\n\ttype BackgroundCompactionDiscardReason,\n\tBackgroundCompactionError,\n\ttype BackgroundCompactionErrorCode,\n\ttype BackgroundCompactionErrorFields,\n\tBackgroundCompactionNotCompactableError,\n\tBackgroundCompactionPersistError,\n\ttype BackgroundCompactionPhase,\n\tBackgroundCompactionPlanningError,\n\tisBackgroundCompactionCommitError,\n\tisBackgroundCompactionConfigError,\n\tisBackgroundCompactionDiscardedError,\n\tisBackgroundCompactionError,\n\tisBackgroundCompactionNotCompactableError,\n\tisBackgroundCompactionPersistError,\n\tisBackgroundCompactionPlanningError,\n\tisRetryableBackgroundCompactionError,\n\tisSerializedBackgroundCompactionError,\n\trehydrateBackgroundCompactionError,\n\ttype SerializedBackgroundCompactionError,\n\tserializeBackgroundCompactionError,\n} from \"./core/compaction/background-compaction-errors.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactedTranscript,\n\ttype CompactionPlannerModel,\n\ttype CompactionPlanOptions,\n\ttype CompactionRung,\n\ttype CompactionRungResult,\n\ttype CompactionRunRequest,\n\ttype CompactionUrgency,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgetLastAssistantUsage,\n\ttype LineRange,\n\ttype PlannerAuth,\n\ttype PlannerBudget,\n\ttype PlannerLimitClass,\n\ttype PlannerOutcome,\n\tprepareBranchEntries,\n\tprepareCompactionBoundary,\n\trunVerbatimCompaction,\n\tserializeConversation,\n\tserializeConversationForCompaction,\n\tshouldCompact,\n\tstartNewContextWindow,\n\ttype VerbatimCompactionDetails,\n\ttype VerbatimCompactionParameters,\n\ttype VerbatimCompactionPreparation,\n\ttype VerbatimCompactionResult,\n} from \"./core/compaction/index.ts\";\nexport {\n\tappendDebugRecord,\n\tDEBUG_AREA_VARIABLES,\n\ttype DebugArea,\n\ttype DebugFields,\n\ttype DebugValue,\n\tgetDebugLogFailure,\n\tisDebugEnabled,\n\treportDebug,\n} from \"./core/debug.ts\";\nexport {\n\tDebugConfigError,\n\ttype DebugConfigErrorFields,\n\tDebugError,\n\ttype DebugErrorCode,\n\tDebugLogUnwritableError,\n\ttype DebugSettingSource,\n\tisDebugConfigError,\n\tisDebugError,\n\tisDebugLogUnwritableError,\n\trehydrateDebugError,\n\ttype SerializedDebugError,\n\tserializeDebugError,\n} from \"./core/debug-errors.ts\";\nexport { onDebugSettingChange, setDebugSetting } from \"./core/debug-setting.ts\";\nexport * from \"./core/decision/index.js\";\nexport type {\n\tErrorFieldValue,\n\tSerializedErrorCause,\n\tSerializedTypedError,\n} from \"./core/error-contract.ts\";\nexport { redactUrlCredentials } from \"./core/error-contract.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.js\";\nexport {\n\tAutoRoutingInferenceError,\n\ttype ModelRoute,\n\ttype ModelRoutingContext,\n\ttype RoutingInferenceBounds,\n\trouteExecutionModel,\n} from \"./core/execution-model-router.js\";\nexport { areExperimentalFeaturesEnabled } from \"./core/experimental.ts\";\nexport { sessionScopedExtensionState } from \"./core/extension-session-state.ts\";\nexport {\n\tExtensionStartupError,\n\ttype ExtensionStartupFailure,\n\tisExtensionStartupFailure,\n\tisTransientExtensionStartupFailure,\n} from \"./core/extension-startup-failure.ts\";\n// Run modes for programmatic SDK usage\nexport { noOpUIContext } from \"./core/extensions/runner-ui.ts\";\nexport {\n\tgetModelFastRoute,\n\tresolveUpstreamModelId,\n\tusesChatGptCodexTransport,\n\tusesFirstPartyCodexRouting,\n\twithCodexFastRouteHeaders,\n\twithFastRouteStreamOptions,\n} from \"./core/fast-model-routing.ts\";\nexport {\n\tCODEX_FAST_ROUTE_HEADER,\n\tCODEX_FAST_ROUTE_ORIGINATOR,\n} from \"./core/fast-model-routing-transport.ts\";\nexport {\n\tANTHROPIC_FAST_MODE_MODEL_IDS,\n\tcopilotAdvertisedFastModelIds,\n\tderiveFastModelVariants,\n\tFAST_MODEL_ID_SUFFIX,\n\tFAST_MODEL_SERVICE_TIER,\n\tFAST_MODEL_SPEED,\n\ttype FastModelVariantDerivation,\n\ttype FastModelVariantDiagnostic,\n\ttype FastModelVariantsOptions,\n\tfastModelId,\n\tisNativeFastRouteApi,\n\tusesAnthropicFastMode,\n\tusesOpenAIFastServiceTier,\n\tusesXaiFastServiceTier,\n\twithFastModelVariants,\n} from \"./core/fast-model-variants.ts\";\nexport {\n\tparseFlattenedKeyPath,\n\treconstructFlattenedKeys,\n\tunflattenArgumentsWithSchema,\n} from \"./core/flattened-tool-arguments.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport {\n\tIntercomBrokerError,\n\ttype IntercomBrokerErrorCode,\n\ttype IntercomBrokerErrorFields,\n\ttype IntercomBrokerErrorFieldValue,\n\ttype IntercomBrokerErrorOptions,\n\ttype IntercomBrokerProtocolCode,\n\tIntercomBrokerProtocolError,\n\ttype IntercomBrokerProtocolFields,\n\ttype IntercomBrokerStopTimeoutCode,\n\tIntercomBrokerStopTimeoutError,\n\ttype IntercomBrokerStopTimeoutFields,\n\ttype IntercomBrokerStopTimeoutPhase,\n\ttype IntercomBrokerSuccessorTimeoutCode,\n\tIntercomBrokerSuccessorTimeoutError,\n\ttype IntercomBrokerSuccessorTimeoutFields,\n\ttype IntercomBrokerSuccessorTimeoutPhase,\n\ttype IntercomBrokerUpgradeCode,\n\tIntercomBrokerUpgradeError,\n\ttype IntercomBrokerUpgradeFields,\n\ttype IntercomBrokerUpgradePhase,\n\tisIntercomBrokerError,\n\tisIntercomBrokerProtocolError,\n\tisIntercomBrokerStopTimeoutError,\n\tisIntercomBrokerSuccessorTimeoutError,\n\tisIntercomBrokerUpgradeError,\n\tisRetryableIntercomBrokerError,\n\trehydrateIntercomBrokerError,\n\ttype SerializedIntercomBrokerError,\n\tserializeIntercomBrokerError,\n} from \"./core/intercom-broker-error.ts\";\nexport {\n\tisProjectGroupError,\n\tProjectGroupError,\n\ttype ProjectGroupErrorCode,\n} from \"./core/intercom-project-group-error.ts\";\nexport {\n\tIntercomRoutingChangedError,\n\tIntercomRoutingError,\n\ttype IntercomRoutingErrorCode,\n\tIntercomRoutingMismatchError,\n\ttype IntercomRoutingMismatchReason,\n\ttype IntercomRoutingPhase,\n\tIntercomRoutingTimeoutError,\n\tIntercomRoutingUnavailableError,\n\ttype IntercomRoutingUnavailableReason,\n\tisIntercomRoutingChangedError,\n\tisIntercomRoutingError,\n\tisIntercomRoutingMismatchError,\n\tisIntercomRoutingTimeoutError,\n\tisIntercomRoutingUnavailableError,\n\tisRetryableIntercomRoutingError,\n} from \"./core/intercom-routing-error.ts\";\nexport {\n\tRUNTIME_INTERCOM_GROUP_ENV,\n\treadRuntimeIntercomGroup,\n\truntimeIntercomGroupEnvKey,\n} from \"./core/intercom-runtime-group.ts\";\nexport { keybindingIdentity } from \"./core/keybinding-identity.js\";\nexport { matchesMcpDirectToolSelection } from \"./core/mcp-child-policy.ts\";\nexport {\n\ttype McpExposure,\n\ttype McpOAuthConfig,\n\ttype McpServerConfig,\n\ttype McpServerContribution,\n\tmcpNamespace,\n\tvalidateMcpServerConfig,\n} from \"./core/mcp-servers.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport type {\n\tModelFallbackFailureKind,\n\tModelFallbackFailureOptions,\n\tModelFallbackFailureSignal,\n\tModelFallbackFailureSource,\n} from \"./core/model-fallback-failures.ts\";\nexport {\n\terrorMessage,\n\tisRetryableModelFailure,\n\tisRetryableSameModelFailure,\n\tisUnrecognizedModelFailure,\n\tmodelFailureMessage,\n\tnormalizeModelFailureSignal,\n} from \"./core/model-fallback-failures.ts\";\nexport {\n\tformatModelLabel,\n\tformatModelReferenceLabel,\n\tMODEL_LABEL_SEPARATOR,\n\ttype ModelLabelOptions,\n\ttype ModelLabelSubject,\n} from \"./core/model-label.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\teligiblePair,\n\ttype ModelConstraints,\n\tModelConstraintsSchema,\n\ttype ModelRouterOutput,\n\tparseModelConstraints,\n\tsetsProviders,\n} from \"./core/model-routing-constraints.js\";\nexport { reportModelRoutingDebug } from \"./core/model-routing-debug.js\";\nexport {\n\tDIFFICULTY_LEVELS,\n\ttype Difficulty,\n\tMISTAKE_COST_LEVELS,\n\ttype MistakeCost,\n\tmergeTaskNeeds,\n\tparseTaskNeeds,\n\ttype TaskNeeds,\n\tTaskNeedsSchema,\n\tWORK_KINDS,\n\ttype WorkKind,\n} from \"./core/model-routing-needs.js\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.js\";\nexport type {\n\tPackageInstallFailure,\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedMcpServer,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport {\n\tapplyProviderRateLimitObservation,\n\tconfigureProviderRequestBudget,\n\tisProviderRateLimit,\n\tmodelIdForModel,\n\tobserveProviderRateLimits,\n\ttype ProviderRateLimitObservation,\n\ttype ProviderRateLimitSnapshot,\n\ttype ProviderRequestBudget,\n\tproviderCooldownMs,\n\tproviderIdForModel,\n\tproviderRateLimitObservations,\n\tproviderRateLimitSnapshot,\n\tproviderRetryHint,\n\tproviderUnavailableMs,\n\trecordProviderRateLimit,\n} from \"./core/provider-rate-limits.js\";\nexport type {\n\tDefaultResourceLoaderInheritanceSnapshot,\n\tResourceCollision,\n\tResourceDiagnostic,\n\tResourceLoader,\n\tSkillCandidate,\n\tSkillCatalog,\n\tSkillCatalogCommand,\n\tSkillResolution,\n} from \"./core/resource-loader.ts\";\nexport {\n\tbuildSkillCatalog,\n\tDefaultResourceLoader,\n\tgetSkillCatalog,\n\tloadProjectContextFiles,\n} from \"./core/resource-loader.ts\";\nexport { nextRetryDecision, type RetryDecision, type RetryPolicySettings } from \"./core/retry-policy.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype AtomicBuiltin,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateSearchTool,\n\tcreateStructuredOutputCapture,\n\tcreateStructuredOutputTool,\n\tcreateWriteTool,\n\ttype JsonObject,\n\ttype JsonPrimitive,\n\ttype JsonValue,\n\ttype MessageEndEvent,\n\ttype MessageStartEvent,\n\ttype MessageUpdateEvent,\n\ttype PromptTemplate,\n\ttype ResourceAdmission,\n\ttype ResourceAdmissionRequest,\n\ttype ResourcePermit,\n\ttype ResourceProcessIdentity,\n\ttype SessionStorageOption,\n\tSTRUCTURED_OUTPUT_TOOL_NAME,\n\ttype StructuredOutputCapture,\n\ttype StructuredOutputFileCapture,\n\ttype StructuredOutputToolOptions,\n\ttype ToolExecutionEndEvent,\n\ttype ToolExecutionStartEvent,\n\ttype ToolExecutionUpdateEvent,\n\twithResourceAdmission,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\tbuildSessionProjection,\n\ttype CompactionEntry,\n\ttype ContextEditableContent,\n\ttype ContextEditEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetDefaultSessionDirPath,\n\tgetLatestCompactionBoundaryEntry,\n\ttype ModelChangeEntry,\n\ttype ModelFallbackRecord,\n\ttype NewSessionOptions,\n\ttype ProjectedSessionEntry,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\tSessionEntryError,\n\ttype SessionHeader,\n\tSessionIdError,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionNameState,\n\ttype SessionProjection,\n\ttype SessionSummaryEntry,\n\ttype SessionTreeNode,\n\ttype SessionWorkflowMetadata,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n\ttype WorktreeRestoreHostWarning,\n\ttype WorktreeSnapshotEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\tWORKFLOW_SESSION_METADATA_ENV,\n\tworkflowSessionMetadataFromEnv,\n} from \"./core/session-manager-classification.ts\";\nexport {\n\tfindSessionStartError,\n\tisRetryableSessionStartError,\n\tisSessionStartConfigError,\n\tisSessionStartError,\n\tisSessionStartTimeoutError,\n\tMAX_SESSION_START_TIMEOUT_MS,\n\tparseSessionStartTimeoutMs,\n\trehydrateSessionStartError,\n\ttype SerializedSessionStartCause,\n\ttype SerializedSessionStartError,\n\tSessionStartConfigError,\n\ttype SessionStartConfigReason,\n\ttype SessionStartConfigSource,\n\tSessionStartError,\n\ttype SessionStartErrorCode,\n\ttype SessionStartEventLoopSample,\n\ttype SessionStartFailureCause,\n\ttype SessionStartFields,\n\ttype SessionStartFieldValue,\n\ttype SessionStartPhase,\n\ttype SessionStartStep,\n\ttype SessionStartStepTiming,\n\ttype SessionStartTimeoutDetails,\n\tSessionStartTimeoutError,\n\tserializeSessionStartError,\n} from \"./core/session-start-errors.ts\";\nexport {\n\tformatWorktreeRestoreNotice,\n\tformatWorktreeRestoreWarning,\n\tmapRestoredPath,\n\topenSessionInWorktree,\n\ttype ResumeSessionWorktreeOptions,\n\tresumeSessionWorktree,\n\ttype SessionWorktreeResume,\n} from \"./core/session-worktree-snapshots.ts\";\nexport type { DefaultProjectTrust, QuietStartup } from \"./core/settings-manager.ts\";\nexport {\n\ttype CompactionModelOverride,\n\ttype CompactionSettings,\n\ttype ImageSettings,\n\ttype ModelRoutingSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\ttype Settings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport {\n\tgenerateStructuredOutput,\n\ttype StructuredOutputRequest,\n\ttype StructuredOutputResult,\n} from \"./core/structured-output/index.js\";\nexport type { NormalizedBuildSystemPromptOptions } from \"./core/system-prompt.ts\";\nexport {\n\tdeserializeToolDetachmentError,\n\tfindToolDetachmentError,\n\tisToolDetachmentError,\n\tMAX_TOOL_DETACHMENT_AFTER_MS,\n\ttype SerializedToolDetachmentError,\n\ttype SerializedToolDetachmentErrorCause,\n\tToolDetachmentError,\n\ttype ToolDetachmentErrorCode,\n\ttype ToolDetachmentErrorFields,\n} from \"./core/tool-detachment-errors.ts\";\nexport {\n\tformatToolStatus,\n\ttype ToolSelectionSource,\n\ttype ToolSelectionStatus,\n\ttype ToolStatus,\n\ttype ToolStatusFormatStyle,\n\ttype ToolStatusReport,\n\ttype UnavailableToolStatus,\n} from \"./core/tool-status.js\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Builtin tool definitions reusable by first-party extensions (e.g. workflows\n// invoking the structured ask_user_question UI deterministically).\n// Tools\nexport {\n\tBASH_SHELL_PRESENTATION,\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tbashToolSystemPromptContribution,\n\tcreateAskUserQuestionToolDefinition,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateKillTool,\n\tcreateKillToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateSearchToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\tEditInputError,\n\ttype EditInputErrorCode,\n\tEditMatchError,\n\ttype EditMatchErrorCode,\n\ttype EditOperations,\n\tEditTargetError,\n\ttype EditTargetErrorCode,\n\ttype EditToolDetails,\n\tEditToolError,\n\ttype EditToolErrorCode,\n\ttype EditToolErrorFields,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\teditToolSystemPromptContribution,\n\tFileToolAbortedError,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tfindToolSystemPromptContribution,\n\tformatSize,\n\tisEditInputError,\n\tisEditMatchError,\n\tisEditTargetError,\n\tisEditToolError,\n\tisFileToolAbortedError,\n\tisWriteSelectorError,\n\ttype KillToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\tlsToolSystemPromptContribution,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\treadToolSystemPromptContribution,\n\trehydrateEditToolError,\n\trehydrateWriteSelectorError,\n\ttype SearchToolDetails,\n\ttype SearchToolInput,\n\ttype SearchToolOptions,\n\ttype SerializedFileToolError,\n\ttype ShellToolPresentation,\n\tsearchToolSystemPromptContribution,\n\tserializeFileToolError,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\tWriteSelectorError,\n\ttype WriteSelectorErrorCode,\n\ttype WriteSelectorErrorFields,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n\twriteToolSystemPromptContribution,\n} from \"./core/tools/index.js\";\nexport {\n\tisShellTimeoutError,\n\tisShellToolError,\n\trehydrateShellToolError,\n\ttype ShellExitBeforeTimeout,\n\tShellTimeoutError,\n\ttype ShellTimeoutPhase,\n\tShellToolError,\n\ttype ShellToolErrorCode,\n} from \"./core/tools/shell-errors.ts\";\nexport {\n\tisTaskToolError,\n\trehydrateTaskToolError,\n\ttype SerializedTaskToolError,\n\tTaskToolError,\n\ttype TaskToolErrorFields,\n\ttype TaskToolFailureCode,\n} from \"./core/tools/shell-task-status.ts\";\nexport {\n\thasProjectTrustInputs,\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n\tTRUST_REQUIRING_PROJECT_CONFIG_RESOURCES,\n} from \"./core/trust-manager.ts\";\nexport { StringEnum, type StringEnumOptions } from \"./core/typebox-compat.ts\";\nexport { parkWorkflowStageForRelease } from \"./core/workflow-stage-admission.ts\";\n// Workspace bindings (#3109)\nexport {\n\ttype AcquireWorkspaceWriterLeaseOptions,\n\tacquireWorkspaceWriterLease,\n\tassertWorkspace,\n\tattachCleanupCause,\n\ttype BoundWorkspace,\n\tbindSessionWorkspace,\n\tfindWorkspaceError,\n\tinheritWorkspace,\n\tisBoundWorkspace,\n\tisRetryableWorkspaceError,\n\tisWorkspace,\n\tisWorkspaceBindingError,\n\tisWorkspaceConfigError,\n\tisWorkspaceError,\n\tisWorkspacePublicationError,\n\tisWorkspaceRestoreError,\n\tisWorkspaceSandboxError,\n\tisWorkspaceTimeoutError,\n\ttype PublishedPullRequest,\n\ttype PublishPullRequestOptions,\n\tpublishPullRequest,\n\ttype ResolveWorkspaceOptions,\n\ttype RestoreWorkspaceOptions,\n\trehydrateWorkspaceError,\n\tresolveWorkspace,\n\trestoreWorkspace,\n\ttype SerializedWorkspaceError,\n\tserializeWorkspaceError,\n\tWORKSPACE_BINDING_ENTRY_TYPE,\n\ttype Workspace,\n\ttype WorkspaceBinding,\n\tWorkspaceBindingError,\n\ttype WorkspaceBindingErrorCode,\n\ttype WorkspaceBindingErrorReason,\n\ttype WorkspaceChangeSet,\n\ttype WorkspaceChangeSetOptions,\n\tWorkspaceConfigError,\n\ttype WorkspaceConfigErrorCode,\n\ttype WorkspaceConfigErrorReason,\n\ttype WorkspaceConfigSource,\n\ttype WorkspaceDiffStat,\n\tWorkspaceError,\n\ttype WorkspaceErrorCode,\n\ttype WorkspaceErrorFields,\n\ttype WorkspaceErrorFieldValue,\n\ttype WorkspaceGitPhase,\n\ttype WorkspaceOptions,\n\tWorkspacePublicationError,\n\ttype WorkspacePublicationErrorCode,\n\ttype WorkspacePublicationErrorReason,\n\tWorkspaceRestoreError,\n\ttype WorkspaceRestoreErrorCode,\n\ttype WorkspaceRestoreErrorReason,\n\ttype WorkspaceSandbox,\n\tWorkspaceSandboxError,\n\ttype WorkspaceSandboxErrorCode,\n\tWorkspaceTimeoutError,\n\ttype WorkspaceTimeoutErrorCode,\n\ttype WorkspaceWriterLease,\n\ttype WorkspaceWriterLeaseHolder,\n\ttype WorktreeBinding,\n\tworkspace,\n\tworkspaceChangeSet,\n\tworkspaceSessionCwd,\n} from \"./core/workspace/index.ts\";\nexport {\n\tfindLlamaServerError,\n\tisLlamaServerError,\n\tisLlamaServerRequestError,\n\tisLlamaServerUnreachableError,\n\tisRetryableLlamaServerError,\n\tLlamaServerError,\n\ttype LlamaServerErrorCode,\n\tLlamaServerRequestError,\n\tLlamaServerUnreachableError,\n\trehydrateLlamaServerError,\n} from \"./extensions/llama/errors.ts\";\nexport {\n\ttype LoadedMcpConfig,\n\ttype McpServerConfigPatch,\n\ttype McpServerEntry,\n\tupdateMcpServerConfig,\n} from \"./extensions/mcp/config.ts\";\nexport { createMcpExtension, type McpExtensionOptions } from \"./extensions/mcp/index.js\";\nexport { McpOAuthCredentialStore } from \"./extensions/mcp/oauth.ts\";\nexport * from \"./index-extensions.js\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\nexport {\n\tisStartupBenchmarkConfigError,\n\tisStartupBenchmarkError,\n\trehydrateStartupBenchmarkError,\n\tStartupBenchmarkConfigError,\n\tStartupBenchmarkError,\n\ttype StartupBenchmarkErrorCode,\n\ttype StartupBenchmarkUnsupportedMode,\n} from \"./main-startup-benchmark.js\";\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEvent,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\ttype ChatMessageEntry,\n\ttype ChatMessageRenderOptions,\n\t// Internal host seam for bundled workflow stage chat; not yet a stable extension API.\n\tChatSessionHost,\n\ttype ChatSessionHostBashRequest,\n\ttype ChatSessionHostCommands,\n\ttype ChatSessionHostEntry,\n\ttype ChatSessionHostOpts,\n\ttype ChatSessionHostStyle,\n\ttype ChatSessionSubmitMode,\n\ttype ChatSessionViewportSettings,\n\tChatTranscriptComponent,\n\ttype ChatTranscriptEntryLike,\n\ttype ChatTranscriptRenderer,\n\ttype ChatTranscriptRole,\n\tCustomEditor,\n\ttype CustomEditorOptions,\n\tCustomEntryComponent,\n\tCustomMessageComponent,\n\tchatEntriesFromAgentMessages,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyHintIfBound,\n\tkeyText,\n\tLiveChatEntriesController,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderChatMessageEntry,\n\trenderDiff,\n\tScrollableChatTranscriptComponent,\n\tScrollableComponentViewport,\n\ttype ScrollableComponentViewportOptions,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTRANSCRIPT_JUMP_TO_END_URL,\n\tTranscriptFollowIndicator,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUsageMeterComponent,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n\tWorkingStatusComponent,\n\ttype WorkingStatusComponentOptions,\n} from \"./modes/interactive/components/index.ts\";\nexport {\n\tclassifyChatCommand,\n\tcreateSessionSkillAutocompleteProvider,\n\tgetSessionCommandCatalog,\n\tgetSessionSkillCommands,\n\ttype PendingSessionCommandCatalog,\n\ttype SessionCommandCatalog,\n} from \"./modes/interactive/skill-command-autocomplete.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.js\";\nexport { pickWhimsicalWorkingMessage } from \"./modes/interactive/whimsical-messages.ts\";\nexport { createChildProcessEnvironment, spawnProcess } from \"./utils/child-process.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.js\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport {\n\tisSafeFsWatchPathError,\n\tisUnsafeWindowsShortPath,\n\tresolveNativeWatchPath,\n\tSAFE_FS_WATCH_CANONICALIZATION_FAILED,\n\tSAFE_FS_WATCH_UNSAFE_WINDOWS_SHORT_PATH,\n\ttype SafeFsWatchErrorCode,\n\ttype SafeFsWatchPathError,\n\twatchWithErrorHandler,\n} from \"./utils/fs-watch.ts\";\nexport { createGitEnvironment, GIT_LOCAL_ENV_VARS } from \"./utils/git-env.ts\";\nexport {\n\tfindGitProvisionError,\n\tGIT_MINIMUM_VERSION,\n\ttype GitInstallPhase,\n\ttype GitProvisionConfigCode,\n\tGitProvisionConfigError,\n\ttype GitProvisionConfigFields,\n\tGitProvisionError,\n\ttype GitProvisionErrorCode,\n\ttype GitProvisionFields,\n\ttype GitProvisionJsonValue,\n\ttype GitProvisionPhase,\n\ttype GitProvisionTimeoutCode,\n\tGitProvisionTimeoutError,\n\ttype GitProvisionTimeoutFields,\n\ttype GitRejectedSystemGit,\n\ttype GitUnavailableCode,\n\tGitUnavailableError,\n\ttype GitUnavailableFields,\n\ttype GitUnsupportedPlatformReason,\n\tisGitProvisionConfigError,\n\tisGitProvisionError,\n\tisGitProvisionTimeoutError,\n\tisGitUnavailableError,\n\tisRetryableGitProvisionError,\n\trehydrateGitProvisionError,\n\ttype SerializedGitProvisionError,\n} from \"./utils/git-errors.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\nexport { INTERACTIVE_ENGINE_ENV_VARS, scrubInteractiveEngineEnv } from \"./utils/interactive-engine-env.ts\";\nexport {\n\tisManagedToolDownloadError,\n\tisManagedToolError,\n\tisManagedToolTimeoutError,\n\tisRetryableManagedToolError,\n\ttype ManagedToolDownloadCode,\n\tManagedToolDownloadError,\n\ttype ManagedToolDownloadFields,\n\tManagedToolError,\n\ttype ManagedToolErrorCode,\n\ttype ManagedToolErrorFields,\n\ttype ManagedToolName,\n\ttype ManagedToolRequestPhase,\n\ttype ManagedToolTimeoutCode,\n\tManagedToolTimeoutError,\n\ttype ManagedToolTimeoutFields,\n} from \"./utils/managed-tool-errors.ts\";\nexport { detectSupportedImageMimeTypeFromFile } from \"./utils/mime.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\nexport {\n\ttype GitToolStatus,\n\ttype GitUpdateStatus,\n\tgetGitStatus,\n\ttype ResolvedGit,\n\ttype ResolvedGitSource,\n\ttype ResolveGitOptions,\n\tresolveGit,\n\tresolveGitSync,\n\ttype ToolStatus as ManagedToolStatus,\n} from \"./utils/tools-manager.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,WAAW,GAIX,MAAM,wBAAwB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AAWpD,OAAO,EAEN,6BAA6B,EAC7B,wCAAwC,GACxC,MAAM,qCAAqC,CAAC;AAW7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,cAAc,wBAAwB,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACN,sBAAsB,EAEtB,gBAAgB,EAEhB,iBAAiB,EACjB,sBAAsB,EAEtB,aAAa,GACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAyB,MAAM,4BAA4B,CAAC;AACxF,cAAc,yBAAyB,CAAC;AACxC,kGAAkG;AAClG,OAAO,EAEN,6BAA6B,EAC7B,yBAAyB,EAEzB,oBAAoB,GACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,gEAAgE;AAChE,OAAO,EAAE,aAAa,EAA0D,MAAM,+BAA+B,CAAC;AACtH,OAAO,EACN,oBAAoB,EACpB,kCAAkC,EAClC,kBAAkB,EAClB,yBAAyB,EACzB,gCAAgC,EAEhC,gBAAgB,GAIhB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,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gCAAgC,CAAC;AACxC,OAAO,EAAE,oCAAoC,EAAE,MAAM,iBAAiB,CAAC;AACvE,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAGN,YAAY,EAIZ,UAAU,EACV,cAAc,GAEd,MAAM,0BAA0B,CAAC","sourcesContent":["export type { ExtensionBindings } from \"./core/agent-session-types.js\";\nexport {\n\tCacheWarmer,\n\ttype CacheWarmingDecisionEvent,\n\ttype CacheWarmingDecisionEventResult,\n\ttype CacheWarmingStatus,\n} from \"./core/cache-warmer.ts\";\nexport * from \"./core/event-subscriptions/index.js\";\nexport type { ExecuteToolOptions, ExtensionToolContext } from \"./core/extensions/context-types.ts\";\nexport type {\n\tHostDiagnostic,\n\tHostInput,\n\tHostInputOptions,\n\tQuestionAnswer,\n\tQuestionnaireError,\n\tQuestionnaireResult,\n\tQuestionParams,\n} from \"./core/extensions/host-input.js\";\nexport {\n\ttype ExtensionContextEffectPhase,\n\tpublishExtensionContextEffect,\n\tregisterExtensionContextRetirementEffect,\n} from \"./core/extensions/runner-context.ts\";\nexport type {\n\tDetachableCallPredicate,\n\tToolAnnotations,\n\tToolExposure,\n\tToolLoadout,\n\tToolLoadoutChanges,\n\tToolNamespace,\n\tToolRendererResolver,\n\tToolRenderers,\n} from \"./core/extensions/tool-types.ts\";\nexport { resolveRestoredModelReference } from \"./core/model-resolver-initial.ts\";\nexport * from \"./core/resume/index.ts\";\nexport type { UsageEntry } from \"./core/session-manager.ts\";\nexport { resolveSessionStore } from \"./core/session-storage.js\";\nexport {\n\tassertSessionBlobStore,\n\ttype BlobCopyOptions,\n\tcopySessionBlobs,\n\ttype MissingBlobReporter,\n\tsessionBlobHashes,\n\tTOOL_OUTPUT_ENTRY_TYPE,\n\ttype ToolOutputReference,\n\ttoolOutputUrl,\n} from \"./core/session-tool-output.ts\";\nexport { CACHE_WARMING_MODES, type CacheWarmingMode } from \"./core/settings-manager.ts\";\nexport * from \"./core/storage/index.js\";\n// Outside the storage barrel: workflow durability setup imports that barrel in every test worker.\nexport {\n\ttype ProcessStorageChoice,\n\tprocessSharedStorageSelection,\n\tprocessStorageEnvironment,\n\ttype StorageDomain,\n\tselectProcessStorage,\n} from \"./core/storage/process-selection.js\";\nexport { JsonlSessionStore } from \"./core/storage/session/jsonl-session-store.js\";\n// Internal trusted-host task integration (not model authority).\nexport { AgentTaskHost, type AgentTaskHostBinding, type AgentTaskRunnerFactory } from \"./core/tasks/agent-adapter.js\";\nexport {\n\tisRetryableTaskError,\n\tisTaskCleanupAdmissionTimeoutError,\n\tisTaskCleanupError,\n\trehydrateTaskCleanupError,\n\tTaskCleanupAdmissionTimeoutError,\n\ttype TaskCleanupAdmissionTiming,\n\tTaskCleanupError,\n\ttype TaskCleanupErrorCode,\n\ttype TaskCleanupFailure,\n\ttype TaskCleanupPhase,\n} from \"./core/tasks/cleanup-error.js\";\nexport { ranOnModelLine } from \"./core/tasks/completion.js\";\nexport type {\n\tAgentIntent,\n\tCleanup,\n\tOperationId,\n\tResourceFailure,\n\tTaskId,\n\tTaskRecord,\n\tTaskResult,\n\tWaitPolicy,\n} from \"./core/tasks/contracts.js\";\nexport {\n\tFINISHED_TASK_RETENTION,\n\tfindTaskEvictedError,\n\tisTaskEvictedError,\n\trehydrateTaskEvictedError,\n\tTaskEvictedError,\n\ttype TaskEvictedErrorCode,\n\ttype TaskEvictedErrorFields,\n} from \"./core/tasks/eviction-error.js\";\nexport { type AdmittedAgentTask, collectAgentTasks } from \"./core/tasks/execution-scope.js\";\nexport {\n\tDEFAULT_TASK_HEARTBEAT_MS,\n\tMIN_TASK_HEARTBEAT_MS,\n\tTASK_HEARTBEAT_MESSAGE_TYPE,\n\ttype TaskHeartbeatDetails,\n\tvalidateTaskHeartbeatMs,\n} from \"./core/tasks/heartbeat-notice.js\";\nexport {\n\tfindTaskMessageError,\n\tisRetryableTaskMessageError,\n\tisTaskMessageError,\n\tisTaskMessageTimeoutError,\n\trehydrateTaskMessageError,\n\ttype SerializedTaskMessageError,\n\tTaskMessageError,\n\ttype TaskMessageErrorCode,\n\ttype TaskMessageErrorFields,\n\tTaskMessageTimeoutError,\n\ttype TaskMessageTimeoutErrorFields,\n\ttype TaskMessageTimeoutPhase,\n} from \"./core/tasks/message-error.js\";\nexport {\n\tbindOwnerTaskStore,\n\tgetOwnerTaskStore,\n\tOwnerTaskStore,\n\ttype TaskActivity,\n\twatchOwnerTaskStoreBinding,\n} from \"./core/tasks/owner-store.js\";\nexport {\n\townerTaskViewSource,\n\ttype TaskDetailText,\n\ttype TaskOutputView,\n\ttype TaskTranscriptFollow,\n\ttype TaskTranscriptView,\n\ttype TaskViewResult,\n\ttype TaskViewSource,\n} from \"./core/tasks/task-view-source.js\";\nexport { formatReadLineRange, formatToolCallWithArgs } from \"./core/tools/render-utils.ts\";\nexport {\n\tcreateTranscript,\n\ttype Transcript,\n\ttype TranscriptOptions,\n\ttype TranscriptPart,\n\ttype TranscriptTextPart,\n\ttype TranscriptThinkingPart,\n\ttype TranscriptToolCallPart,\n\ttype TranscriptToolResult,\n\ttype TranscriptToolResultFormat,\n} from \"./core/transcript.js\";\nexport * from \"./core/worktree-snapshot/index.ts\";\nexport { type CodemodeExtensionOptions, createCodemodeExtension } from \"./extensions/codemode/index.js\";\nexport {\n\ttype CodemodeToolDetails,\n\ttype CodemodeToolOptions,\n\tcreateCodemodeDescription,\n\tcreateCodemodeTool,\n\tcreateCodemodeToolDefinition,\n} from \"./extensions/codemode/tool.js\";\nexport { createToolSearchExtension } from \"./extensions/tool-search/index.js\";\nexport { createToolSearchToolDefinition, type ToolSearchToolOptions } from \"./extensions/tool-search/tool.js\";\nexport { renderTaskFooter, TaskList, taskListSections } from \"./modes/interactive/components/task-list.js\";\nexport { TaskRow } from \"./modes/interactive/components/task-row.js\";\nexport {\n\tapplyAssistantMessageDelta,\n\tbeginStreamingAssistantMessage,\n} from \"./modes/interactive/streaming-assistant-message.ts\";\n\n// Core session management\n\n// GitHub Copilot request failures, typed at the provider; see docs/providers.md.\nexport {\n\tclassifyGitHubCopilotFailure,\n\tdescribeGitHubCopilotModel,\n\tdeserializeGitHubCopilotError,\n\tfindGitHubCopilotError,\n\tGITHUB_COPILOT_ERROR_DIAGNOSTIC,\n\tGitHubCopilotAuthenticationError,\n\tGitHubCopilotContentFilterError,\n\tGitHubCopilotEmptyResponseError,\n\tGitHubCopilotError,\n\ttype GitHubCopilotErrorCode,\n\ttype GitHubCopilotErrorContext,\n\ttype GitHubCopilotErrorFields,\n\ttype GitHubCopilotErrorName,\n\ttype GitHubCopilotFailureContext,\n\tGitHubCopilotInvalidRequestError,\n\ttype GitHubCopilotInvalidRequestReason,\n\ttype GitHubCopilotModelCapabilities,\n\tGitHubCopilotModelUnavailableError,\n\ttype GitHubCopilotModelUnavailableReason,\n\tGitHubCopilotPromptTooLargeError,\n\tGitHubCopilotQuotaExhaustedError,\n\tGitHubCopilotRateLimitError,\n\tGitHubCopilotServiceUnavailableError,\n\tGitHubCopilotStreamEndedEarlyError,\n\ttype GitHubCopilotUnrecognizedReason,\n\tGitHubCopilotUnrecognizedResponseError,\n\tgetGitHubCopilotError,\n\tisGitHubCopilotAuthenticationError,\n\tisGitHubCopilotContentFilterError,\n\tisGitHubCopilotEmptyResponseError,\n\tisGitHubCopilotError,\n\tisGitHubCopilotInvalidRequestError,\n\tisGitHubCopilotModelUnavailableError,\n\tisGitHubCopilotPromptTooLargeError,\n\tisGitHubCopilotQuotaExhaustedError,\n\tisGitHubCopilotRateLimitError,\n\tisGitHubCopilotServiceUnavailableError,\n\tisGitHubCopilotStreamEndedEarlyError,\n\tisGitHubCopilotUnrecognizedResponseError,\n\tisRetryableGitHubCopilotError,\n\ttype SerializedGitHubCopilotError,\n\tserializeGitHubCopilotError,\n} from \"@bastani/pi-ai\";\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport {\n\tAPP_NAME,\n\tAPP_TITLE,\n\tCONFIG_DIR_NAME,\n\tCONFIG_DIR_NAMES,\n\tgetAgentConfigPaths,\n\tgetAgentDir,\n\tgetAgentDirs,\n\tgetBundledInteractiveAssetPath,\n\tgetChangelogPath,\n\tgetDocsPath,\n\tgetEnvNames,\n\tgetEnvValue,\n\tgetExamplesPath,\n\tgetExportTemplateDir,\n\tgetInteractiveAssetsDir,\n\tgetLegacyAgentDir,\n\tgetPackageDir,\n\tgetPackageJsonPath,\n\tgetProjectConfigDirs,\n\tgetProjectConfigPaths,\n\tgetReadmePath,\n\tgetThemesDir,\n\tgetUserConfigDirs,\n\tgetUserConfigPaths,\n\thasEnvValue,\n\tisBunBinary,\n\tLEGACY_CONFIG_DIR_NAME,\n\tLEGACY_ENV_PREFIX,\n\tPACKAGE_NAME,\n\tsetEnvValue,\n\tVERSION,\n\tWORKFLOW_STAGE_SUBAGENT_GUARD_ENV,\n} from \"./config.js\";\nexport {\n\tAgentRehydrateError,\n\ttype AgentRehydrateErrorCode,\n\ttype AgentRehydrateErrorFields,\n\tAgentReleaseConfigError,\n\ttype AgentReleaseConfigSource,\n\ttype AgentSessionActivity,\n\tisAgentRehydrateError,\n\tisAgentReleaseConfigError,\n\tisLocalOnlySessionStorage,\n\tisRetryableAgentRehydrateError,\n\trehydrateAgentRehydrateError,\n\ttype SerializedAgentErrorCause,\n\ttype SerializedAgentRehydrateError,\n\tserializeAgentRehydrateError,\n\tTEAM_JOIN_COMMAND,\n} from \"./core/agent-rehydrate-errors.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype CompactionReason,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionCompactOptions,\n\ttype SessionRecoveryReport,\n\ttype SessionStats,\n} from \"./core/agent-session.js\";\nexport { AgentSessionBusyError, isAgentSessionBusyError } from \"./core/agent-session-busy-error.ts\";\nexport type {\n\tDetachedCallFailure,\n\tDetachedCallFailureCause,\n\tDetachedToolCall,\n\tDetachedToolResult,\n\tToolDetachmentPolicy,\n} from \"./core/agent-session-detached-tools.ts\";\nexport { markToolCallReadyForDetachment, toolCallNeedsDetachmentHandoff } from \"./core/agent-session-detached-tools.ts\";\nexport type { ReleasedAgentSession, ReleaseWhenIdleOptions } from \"./core/agent-session-release.ts\";\nexport {\n\ttype AgentWake,\n\ttype AgentWakeClock,\n\tAgentWakeDispatcher,\n\ttype AgentWakeDispatcherOptions,\n\ttype AgentWakeDispatcherStats,\n\ttype AgentWakeFailureListener,\n\ttype AgentWakeHandler,\n\ttype AgentWakeHandlerOptions,\n\ttype AgentWakeKind,\n\ttype AgentWakeTimer,\n\tagentWakeDispatcher,\n\twakeKeyNamespace,\n} from \"./core/agent-wake-dispatcher.ts\";\n// Auth and model runtime\nexport { AuthStorage, readStoredCredential } from \"./core/auth-storage.ts\";\nexport {\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n} from \"./core/auth-storage-backends.ts\";\nexport { type BashResult, executeBashWithOperations } from \"./core/bash-executor.ts\";\nexport { getBuiltinPackagePaths } from \"./core/builtin-packages.ts\";\nexport type { CompactionCacheMiss } from \"./core/cache-stats.ts\";\nexport {\n\ttype CallbackActivityDescriptor,\n\ttype CallbackActivityKind,\n\trunCallback,\n\trunSynchronousCallback,\n} from \"./core/callback-activity.ts\";\n// Cloudflare AI Gateway over the Workers AI binding (no API token; see docs/providers.md)\nexport {\n\ttype AiGatewayBinding,\n\ttype AiGatewayBindingGateway,\n\ttype AiGatewayUniversalRequestLike,\n\tCLOUDFLARE_GATEWAY_BINDING_AUTH_SENTINEL,\n\tcreateGatewayBindingFetch,\n\ttype GatewayBindingFetchOptions,\n} from \"./core/cloudflare-gateway-binding.ts\";\nexport {\n\tBACKGROUND_COMPACTION_RESULT_TYPE,\n\ttype BackgroundCompactionResultRecord,\n\ttype BackgroundCompactionState,\n\ttype BackgroundCompactionStatus,\n\ttype CompactionReadyWake,\n\ttype CompactionWakeDispatcher,\n\tDEFAULT_BACKGROUND_COMPACTION_THRESHOLD_PERCENT,\n\trehydrateBackgroundCompactionState,\n\ttype SerializedBackgroundCompactionState,\n\tserializeBackgroundCompactionState,\n} from \"./core/compaction/background-compaction.ts\";\nexport {\n\tBackgroundCompactionCommitError,\n\tBackgroundCompactionConfigError,\n\ttype BackgroundCompactionConfigReason,\n\ttype BackgroundCompactionConfigSource,\n\tBackgroundCompactionDiscardedError,\n\ttype BackgroundCompactionDiscardReason,\n\tBackgroundCompactionError,\n\ttype BackgroundCompactionErrorCode,\n\ttype BackgroundCompactionErrorFields,\n\tBackgroundCompactionNotCompactableError,\n\tBackgroundCompactionPersistError,\n\ttype BackgroundCompactionPhase,\n\tBackgroundCompactionPlanningError,\n\tisBackgroundCompactionCommitError,\n\tisBackgroundCompactionConfigError,\n\tisBackgroundCompactionDiscardedError,\n\tisBackgroundCompactionError,\n\tisBackgroundCompactionNotCompactableError,\n\tisBackgroundCompactionPersistError,\n\tisBackgroundCompactionPlanningError,\n\tisRetryableBackgroundCompactionError,\n\tisSerializedBackgroundCompactionError,\n\trehydrateBackgroundCompactionError,\n\ttype SerializedBackgroundCompactionError,\n\tserializeBackgroundCompactionError,\n} from \"./core/compaction/background-compaction-errors.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactedTranscript,\n\ttype CompactionPlannerModel,\n\ttype CompactionPlanOptions,\n\ttype CompactionRung,\n\ttype CompactionRungResult,\n\ttype CompactionRunRequest,\n\ttype CompactionUrgency,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgetLastAssistantUsage,\n\ttype LineRange,\n\ttype PlannerAuth,\n\ttype PlannerBudget,\n\ttype PlannerLimitClass,\n\ttype PlannerOutcome,\n\ttype PolicyRefusalPhase,\n\tprepareBranchEntries,\n\tprepareCompactionBoundary,\n\trunVerbatimCompaction,\n\ttype SidecarDirectory,\n\tserializeConversation,\n\tserializeConversationForCompaction,\n\tshouldCompact,\n\tstartNewContextWindow,\n\ttype VerbatimCompactionDetails,\n\ttype VerbatimCompactionParameters,\n\ttype VerbatimCompactionPreparation,\n\ttype VerbatimCompactionResult,\n} from \"./core/compaction/index.ts\";\nexport {\n\tappendDebugRecord,\n\tDEBUG_AREA_VARIABLES,\n\ttype DebugArea,\n\ttype DebugFields,\n\ttype DebugValue,\n\tgetDebugLogFailure,\n\tisDebugEnabled,\n\treportDebug,\n} from \"./core/debug.ts\";\nexport {\n\tDebugConfigError,\n\ttype DebugConfigErrorFields,\n\tDebugError,\n\ttype DebugErrorCode,\n\tDebugLogUnwritableError,\n\ttype DebugSettingSource,\n\tisDebugConfigError,\n\tisDebugError,\n\tisDebugLogUnwritableError,\n\trehydrateDebugError,\n\ttype SerializedDebugError,\n\tserializeDebugError,\n} from \"./core/debug-errors.ts\";\nexport { onDebugSettingChange, setDebugSetting } from \"./core/debug-setting.ts\";\nexport * from \"./core/decision/index.js\";\nexport type {\n\tErrorFieldValue,\n\tSerializedErrorCause,\n\tSerializedTypedError,\n} from \"./core/error-contract.ts\";\nexport { redactUrlCredentials } from \"./core/error-contract.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.js\";\nexport {\n\tAutoRoutingInferenceError,\n\ttype ModelRoute,\n\ttype ModelRoutingContext,\n\ttype RoutingInferenceBounds,\n\trouteExecutionModel,\n} from \"./core/execution-model-router.js\";\nexport { areExperimentalFeaturesEnabled } from \"./core/experimental.ts\";\nexport { sessionScopedExtensionState } from \"./core/extension-session-state.ts\";\nexport {\n\tExtensionStartupError,\n\ttype ExtensionStartupFailure,\n\tisExtensionStartupFailure,\n\tisTransientExtensionStartupFailure,\n} from \"./core/extension-startup-failure.ts\";\n// Run modes for programmatic SDK usage\nexport { noOpUIContext } from \"./core/extensions/runner-ui.ts\";\nexport {\n\tgetModelFastRoute,\n\tresolveUpstreamModelId,\n\tusesChatGptCodexTransport,\n\tusesFirstPartyCodexRouting,\n\twithCodexFastRouteHeaders,\n\twithFastRouteStreamOptions,\n} from \"./core/fast-model-routing.ts\";\nexport {\n\tCODEX_FAST_ROUTE_HEADER,\n\tCODEX_FAST_ROUTE_ORIGINATOR,\n} from \"./core/fast-model-routing-transport.ts\";\nexport {\n\tANTHROPIC_FAST_MODE_MODEL_IDS,\n\tcopilotAdvertisedFastModelIds,\n\tderiveFastModelVariants,\n\tFAST_MODEL_ID_SUFFIX,\n\tFAST_MODEL_SERVICE_TIER,\n\tFAST_MODEL_SPEED,\n\ttype FastModelVariantDerivation,\n\ttype FastModelVariantDiagnostic,\n\ttype FastModelVariantsOptions,\n\tfastModelId,\n\tisNativeFastRouteApi,\n\tusesAnthropicFastMode,\n\tusesOpenAIFastServiceTier,\n\tusesXaiFastServiceTier,\n\twithFastModelVariants,\n} from \"./core/fast-model-variants.ts\";\nexport {\n\tparseFlattenedKeyPath,\n\treconstructFlattenedKeys,\n\tunflattenArgumentsWithSchema,\n} from \"./core/flattened-tool-arguments.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport {\n\tIntercomBrokerError,\n\ttype IntercomBrokerErrorCode,\n\ttype IntercomBrokerErrorFields,\n\ttype IntercomBrokerErrorFieldValue,\n\ttype IntercomBrokerErrorOptions,\n\ttype IntercomBrokerProtocolCode,\n\tIntercomBrokerProtocolError,\n\ttype IntercomBrokerProtocolFields,\n\ttype IntercomBrokerStopTimeoutCode,\n\tIntercomBrokerStopTimeoutError,\n\ttype IntercomBrokerStopTimeoutFields,\n\ttype IntercomBrokerStopTimeoutPhase,\n\ttype IntercomBrokerSuccessorTimeoutCode,\n\tIntercomBrokerSuccessorTimeoutError,\n\ttype IntercomBrokerSuccessorTimeoutFields,\n\ttype IntercomBrokerSuccessorTimeoutPhase,\n\ttype IntercomBrokerUpgradeCode,\n\tIntercomBrokerUpgradeError,\n\ttype IntercomBrokerUpgradeFields,\n\ttype IntercomBrokerUpgradePhase,\n\tisIntercomBrokerError,\n\tisIntercomBrokerProtocolError,\n\tisIntercomBrokerStopTimeoutError,\n\tisIntercomBrokerSuccessorTimeoutError,\n\tisIntercomBrokerUpgradeError,\n\tisRetryableIntercomBrokerError,\n\trehydrateIntercomBrokerError,\n\ttype SerializedIntercomBrokerError,\n\tserializeIntercomBrokerError,\n} from \"./core/intercom-broker-error.ts\";\nexport {\n\tisProjectGroupError,\n\tProjectGroupError,\n\ttype ProjectGroupErrorCode,\n} from \"./core/intercom-project-group-error.ts\";\nexport {\n\tIntercomRoutingChangedError,\n\tIntercomRoutingError,\n\ttype IntercomRoutingErrorCode,\n\tIntercomRoutingMismatchError,\n\ttype IntercomRoutingMismatchReason,\n\ttype IntercomRoutingPhase,\n\tIntercomRoutingTimeoutError,\n\tIntercomRoutingUnavailableError,\n\ttype IntercomRoutingUnavailableReason,\n\tisIntercomRoutingChangedError,\n\tisIntercomRoutingError,\n\tisIntercomRoutingMismatchError,\n\tisIntercomRoutingTimeoutError,\n\tisIntercomRoutingUnavailableError,\n\tisRetryableIntercomRoutingError,\n} from \"./core/intercom-routing-error.ts\";\nexport {\n\tRUNTIME_INTERCOM_GROUP_ENV,\n\treadRuntimeIntercomGroup,\n\truntimeIntercomGroupEnvKey,\n} from \"./core/intercom-runtime-group.ts\";\nexport { keybindingIdentity } from \"./core/keybinding-identity.js\";\nexport { matchesMcpDirectToolSelection } from \"./core/mcp-child-policy.ts\";\nexport {\n\ttype McpExposure,\n\ttype McpOAuthConfig,\n\ttype McpServerConfig,\n\ttype McpServerContribution,\n\tmcpNamespace,\n\tvalidateMcpServerConfig,\n} from \"./core/mcp-servers.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport type {\n\tModelFallbackFailureKind,\n\tModelFallbackFailureOptions,\n\tModelFallbackFailureSignal,\n\tModelFallbackFailureSource,\n} from \"./core/model-fallback-failures.ts\";\nexport {\n\terrorMessage,\n\tisRetryableModelFailure,\n\tisRetryableSameModelFailure,\n\tisUnrecognizedModelFailure,\n\tmodelFailureMessage,\n\tnormalizeModelFailureSignal,\n} from \"./core/model-fallback-failures.ts\";\nexport {\n\tformatModelLabel,\n\tformatModelReferenceLabel,\n\tMODEL_LABEL_SEPARATOR,\n\ttype ModelLabelOptions,\n\ttype ModelLabelSubject,\n} from \"./core/model-label.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\teligiblePair,\n\ttype ModelConstraints,\n\tModelConstraintsSchema,\n\ttype ModelRouterOutput,\n\tparseModelConstraints,\n\tsetsProviders,\n} from \"./core/model-routing-constraints.js\";\nexport { reportModelRoutingDebug } from \"./core/model-routing-debug.js\";\nexport {\n\tDIFFICULTY_LEVELS,\n\ttype Difficulty,\n\tMISTAKE_COST_LEVELS,\n\ttype MistakeCost,\n\tmergeTaskNeeds,\n\tparseTaskNeeds,\n\ttype TaskNeeds,\n\tTaskNeedsSchema,\n\tWORK_KINDS,\n\ttype WorkKind,\n} from \"./core/model-routing-needs.js\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.js\";\nexport type {\n\tPackageInstallFailure,\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedMcpServer,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport {\n\tapplyProviderRateLimitObservation,\n\tconfigureProviderRequestBudget,\n\tisProviderRateLimit,\n\tmodelIdForModel,\n\tobserveProviderRateLimits,\n\ttype ProviderRateLimitObservation,\n\ttype ProviderRateLimitSnapshot,\n\ttype ProviderRequestBudget,\n\tproviderCooldownMs,\n\tproviderIdForModel,\n\tproviderRateLimitObservations,\n\tproviderRateLimitSnapshot,\n\tproviderRetryHint,\n\tproviderUnavailableMs,\n\trecordProviderRateLimit,\n} from \"./core/provider-rate-limits.js\";\nexport type {\n\tDefaultResourceLoaderInheritanceSnapshot,\n\tResourceCollision,\n\tResourceDiagnostic,\n\tResourceLoader,\n\tSkillCandidate,\n\tSkillCatalog,\n\tSkillCatalogCommand,\n\tSkillResolution,\n} from \"./core/resource-loader.ts\";\nexport {\n\tbuildSkillCatalog,\n\tDefaultResourceLoader,\n\tgetSkillCatalog,\n\tloadProjectContextFiles,\n} from \"./core/resource-loader.ts\";\nexport { nextRetryDecision, type RetryDecision, type RetryPolicySettings } from \"./core/retry-policy.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype AtomicBuiltin,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateSearchTool,\n\tcreateStructuredOutputCapture,\n\tcreateStructuredOutputTool,\n\tcreateWriteTool,\n\ttype JsonObject,\n\ttype JsonPrimitive,\n\ttype JsonValue,\n\ttype MessageEndEvent,\n\ttype MessageStartEvent,\n\ttype MessageUpdateEvent,\n\ttype PromptTemplate,\n\ttype ResourceAdmission,\n\ttype ResourceAdmissionRequest,\n\ttype ResourcePermit,\n\ttype ResourceProcessIdentity,\n\ttype SessionStorageOption,\n\tSTRUCTURED_OUTPUT_TOOL_NAME,\n\ttype StructuredOutputCapture,\n\ttype StructuredOutputFileCapture,\n\ttype StructuredOutputToolOptions,\n\ttype ToolExecutionEndEvent,\n\ttype ToolExecutionStartEvent,\n\ttype ToolExecutionUpdateEvent,\n\twithResourceAdmission,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\tbuildSessionProjection,\n\ttype CompactionEntry,\n\ttype ContextEditableContent,\n\ttype ContextEditEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetDefaultSessionDirPath,\n\tgetLatestCompactionBoundaryEntry,\n\ttype ModelChangeEntry,\n\ttype ModelFallbackRecord,\n\ttype NewSessionOptions,\n\ttype ProjectedSessionEntry,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\tSessionEntryError,\n\ttype SessionHeader,\n\tSessionIdError,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionNameState,\n\ttype SessionProjection,\n\ttype SessionSummaryEntry,\n\ttype SessionTreeNode,\n\ttype SessionWorkflowMetadata,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n\ttype WorktreeRestoreHostWarning,\n\ttype WorktreeSnapshotEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\tWORKFLOW_SESSION_METADATA_ENV,\n\tworkflowSessionMetadataFromEnv,\n} from \"./core/session-manager-classification.ts\";\nexport {\n\tfindSessionStartError,\n\tisRetryableSessionStartError,\n\tisSessionStartConfigError,\n\tisSessionStartError,\n\tisSessionStartTimeoutError,\n\tMAX_SESSION_START_TIMEOUT_MS,\n\tparseSessionStartTimeoutMs,\n\trehydrateSessionStartError,\n\ttype SerializedSessionStartCause,\n\ttype SerializedSessionStartError,\n\tSessionStartConfigError,\n\ttype SessionStartConfigReason,\n\ttype SessionStartConfigSource,\n\tSessionStartError,\n\ttype SessionStartErrorCode,\n\ttype SessionStartEventLoopSample,\n\ttype SessionStartFailureCause,\n\ttype SessionStartFields,\n\ttype SessionStartFieldValue,\n\ttype SessionStartPhase,\n\ttype SessionStartStep,\n\ttype SessionStartStepTiming,\n\ttype SessionStartTimeoutDetails,\n\tSessionStartTimeoutError,\n\tserializeSessionStartError,\n} from \"./core/session-start-errors.ts\";\nexport {\n\tformatWorktreeRestoreNotice,\n\tformatWorktreeRestoreWarning,\n\tmapRestoredPath,\n\topenSessionInWorktree,\n\ttype ResumeSessionWorktreeOptions,\n\tresumeSessionWorktree,\n\ttype SessionWorktreeResume,\n} from \"./core/session-worktree-snapshots.ts\";\nexport type { DefaultProjectTrust, QuietStartup } from \"./core/settings-manager.ts\";\nexport {\n\ttype CompactionModelOverride,\n\ttype CompactionSettings,\n\ttype ImageSettings,\n\ttype ModelRoutingSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\ttype Settings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport {\n\tgenerateStructuredOutput,\n\ttype StructuredOutputRequest,\n\ttype StructuredOutputResult,\n} from \"./core/structured-output/index.js\";\nexport type { NormalizedBuildSystemPromptOptions } from \"./core/system-prompt.ts\";\nexport {\n\tdeserializeToolDetachmentError,\n\tfindToolDetachmentError,\n\tisToolDetachmentError,\n\tMAX_TOOL_DETACHMENT_AFTER_MS,\n\ttype SerializedToolDetachmentError,\n\ttype SerializedToolDetachmentErrorCause,\n\tToolDetachmentError,\n\ttype ToolDetachmentErrorCode,\n\ttype ToolDetachmentErrorFields,\n} from \"./core/tool-detachment-errors.ts\";\nexport {\n\tformatToolStatus,\n\ttype ToolSelectionSource,\n\ttype ToolSelectionStatus,\n\ttype ToolStatus,\n\ttype ToolStatusFormatStyle,\n\ttype ToolStatusReport,\n\ttype UnavailableToolStatus,\n} from \"./core/tool-status.js\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Builtin tool definitions reusable by first-party extensions (e.g. workflows\n// invoking the structured ask_user_question UI deterministically).\n// Tools\nexport {\n\tBASH_SHELL_PRESENTATION,\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tbashToolSystemPromptContribution,\n\tcreateAskUserQuestionToolDefinition,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateKillTool,\n\tcreateKillToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateSearchToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\tEditInputError,\n\ttype EditInputErrorCode,\n\tEditMatchError,\n\ttype EditMatchErrorCode,\n\ttype EditOperations,\n\tEditTargetError,\n\ttype EditTargetErrorCode,\n\ttype EditToolDetails,\n\tEditToolError,\n\ttype EditToolErrorCode,\n\ttype EditToolErrorFields,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\teditToolSystemPromptContribution,\n\tFileToolAbortedError,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tfindToolSystemPromptContribution,\n\tformatSize,\n\tisEditInputError,\n\tisEditMatchError,\n\tisEditTargetError,\n\tisEditToolError,\n\tisFileToolAbortedError,\n\tisWriteSelectorError,\n\ttype KillToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\tlsToolSystemPromptContribution,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\treadToolSystemPromptContribution,\n\trehydrateEditToolError,\n\trehydrateWriteSelectorError,\n\ttype SearchToolDetails,\n\ttype SearchToolInput,\n\ttype SearchToolOptions,\n\ttype SerializedFileToolError,\n\ttype ShellToolPresentation,\n\tsearchToolSystemPromptContribution,\n\tserializeFileToolError,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\tWriteSelectorError,\n\ttype WriteSelectorErrorCode,\n\ttype WriteSelectorErrorFields,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n\twriteToolSystemPromptContribution,\n} from \"./core/tools/index.js\";\nexport {\n\tisShellTimeoutError,\n\tisShellToolError,\n\trehydrateShellToolError,\n\ttype ShellExitBeforeTimeout,\n\tShellTimeoutError,\n\ttype ShellTimeoutPhase,\n\tShellToolError,\n\ttype ShellToolErrorCode,\n} from \"./core/tools/shell-errors.ts\";\nexport {\n\tisTaskToolError,\n\trehydrateTaskToolError,\n\ttype SerializedTaskToolError,\n\tTaskToolError,\n\ttype TaskToolErrorFields,\n\ttype TaskToolFailureCode,\n} from \"./core/tools/shell-task-status.ts\";\nexport {\n\thasProjectTrustInputs,\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n\tTRUST_REQUIRING_PROJECT_CONFIG_RESOURCES,\n} from \"./core/trust-manager.ts\";\nexport { StringEnum, type StringEnumOptions } from \"./core/typebox-compat.ts\";\nexport { parkWorkflowStageForRelease } from \"./core/workflow-stage-admission.ts\";\n// Workspace bindings (#3109)\nexport {\n\ttype AcquireWorkspaceWriterLeaseOptions,\n\tacquireWorkspaceWriterLease,\n\tassertWorkspace,\n\tattachCleanupCause,\n\ttype BoundWorkspace,\n\tbindSessionWorkspace,\n\tfindWorkspaceError,\n\tinheritWorkspace,\n\tisBoundWorkspace,\n\tisRetryableWorkspaceError,\n\tisWorkspace,\n\tisWorkspaceBindingError,\n\tisWorkspaceConfigError,\n\tisWorkspaceError,\n\tisWorkspacePublicationError,\n\tisWorkspaceRestoreError,\n\tisWorkspaceSandboxError,\n\tisWorkspaceTimeoutError,\n\ttype PublishedPullRequest,\n\ttype PublishPullRequestOptions,\n\tpublishPullRequest,\n\ttype ResolveWorkspaceOptions,\n\ttype RestoreWorkspaceOptions,\n\trehydrateWorkspaceError,\n\tresolveWorkspace,\n\trestoreWorkspace,\n\ttype SerializedWorkspaceError,\n\tserializeWorkspaceError,\n\tWORKSPACE_BINDING_ENTRY_TYPE,\n\ttype Workspace,\n\ttype WorkspaceBinding,\n\tWorkspaceBindingError,\n\ttype WorkspaceBindingErrorCode,\n\ttype WorkspaceBindingErrorReason,\n\ttype WorkspaceChangeSet,\n\ttype WorkspaceChangeSetOptions,\n\tWorkspaceConfigError,\n\ttype WorkspaceConfigErrorCode,\n\ttype WorkspaceConfigErrorReason,\n\ttype WorkspaceConfigSource,\n\ttype WorkspaceDiffStat,\n\tWorkspaceError,\n\ttype WorkspaceErrorCode,\n\ttype WorkspaceErrorFields,\n\ttype WorkspaceErrorFieldValue,\n\ttype WorkspaceGitPhase,\n\ttype WorkspaceOptions,\n\tWorkspacePublicationError,\n\ttype WorkspacePublicationErrorCode,\n\ttype WorkspacePublicationErrorReason,\n\tWorkspaceRestoreError,\n\ttype WorkspaceRestoreErrorCode,\n\ttype WorkspaceRestoreErrorReason,\n\ttype WorkspaceSandbox,\n\tWorkspaceSandboxError,\n\ttype WorkspaceSandboxErrorCode,\n\tWorkspaceTimeoutError,\n\ttype WorkspaceTimeoutErrorCode,\n\ttype WorkspaceWriterLease,\n\ttype WorkspaceWriterLeaseHolder,\n\ttype WorktreeBinding,\n\tworkspace,\n\tworkspaceChangeSet,\n\tworkspaceSessionCwd,\n} from \"./core/workspace/index.ts\";\nexport {\n\tfindLlamaServerError,\n\tisLlamaServerError,\n\tisLlamaServerRequestError,\n\tisLlamaServerUnreachableError,\n\tisRetryableLlamaServerError,\n\tLlamaServerError,\n\ttype LlamaServerErrorCode,\n\tLlamaServerRequestError,\n\tLlamaServerUnreachableError,\n\trehydrateLlamaServerError,\n} from \"./extensions/llama/errors.ts\";\nexport {\n\ttype LoadedMcpConfig,\n\ttype McpServerConfigPatch,\n\ttype McpServerEntry,\n\tupdateMcpServerConfig,\n} from \"./extensions/mcp/config.ts\";\nexport { createMcpExtension, type McpExtensionOptions } from \"./extensions/mcp/index.js\";\nexport { McpOAuthCredentialStore } from \"./extensions/mcp/oauth.ts\";\nexport * from \"./index-extensions.js\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\nexport {\n\tisStartupBenchmarkConfigError,\n\tisStartupBenchmarkError,\n\trehydrateStartupBenchmarkError,\n\tStartupBenchmarkConfigError,\n\tStartupBenchmarkError,\n\ttype StartupBenchmarkErrorCode,\n\ttype StartupBenchmarkUnsupportedMode,\n} from \"./main-startup-benchmark.js\";\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEvent,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\ttype ChatMessageEntry,\n\ttype ChatMessageRenderOptions,\n\t// Internal host seam for bundled workflow stage chat; not yet a stable extension API.\n\tChatSessionHost,\n\ttype ChatSessionHostBashRequest,\n\ttype ChatSessionHostCommands,\n\ttype ChatSessionHostEntry,\n\ttype ChatSessionHostOpts,\n\ttype ChatSessionHostStyle,\n\ttype ChatSessionSubmitMode,\n\ttype ChatSessionViewportSettings,\n\tChatTranscriptComponent,\n\ttype ChatTranscriptEntryLike,\n\ttype ChatTranscriptRenderer,\n\ttype ChatTranscriptRole,\n\tCustomEditor,\n\ttype CustomEditorOptions,\n\tCustomEntryComponent,\n\tCustomMessageComponent,\n\tchatEntriesFromAgentMessages,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyHintIfBound,\n\tkeyText,\n\tLiveChatEntriesController,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderChatMessageEntry,\n\trenderDiff,\n\tScrollableChatTranscriptComponent,\n\tScrollableComponentViewport,\n\ttype ScrollableComponentViewportOptions,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTRANSCRIPT_JUMP_TO_END_URL,\n\tTranscriptFollowIndicator,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUsageMeterComponent,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n\tWorkingStatusComponent,\n\ttype WorkingStatusComponentOptions,\n} from \"./modes/interactive/components/index.ts\";\nexport {\n\tclassifyChatCommand,\n\tcreateSessionSkillAutocompleteProvider,\n\tgetSessionCommandCatalog,\n\tgetSessionSkillCommands,\n\ttype PendingSessionCommandCatalog,\n\ttype SessionCommandCatalog,\n} from \"./modes/interactive/skill-command-autocomplete.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.js\";\nexport { pickWhimsicalWorkingMessage } from \"./modes/interactive/whimsical-messages.ts\";\nexport { createChildProcessEnvironment, spawnProcess } from \"./utils/child-process.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.js\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport {\n\tisSafeFsWatchPathError,\n\tisUnsafeWindowsShortPath,\n\tresolveNativeWatchPath,\n\tSAFE_FS_WATCH_CANONICALIZATION_FAILED,\n\tSAFE_FS_WATCH_UNSAFE_WINDOWS_SHORT_PATH,\n\ttype SafeFsWatchErrorCode,\n\ttype SafeFsWatchPathError,\n\twatchWithErrorHandler,\n} from \"./utils/fs-watch.ts\";\nexport { createGitEnvironment, GIT_LOCAL_ENV_VARS } from \"./utils/git-env.ts\";\nexport {\n\tfindGitProvisionError,\n\tGIT_MINIMUM_VERSION,\n\ttype GitInstallPhase,\n\ttype GitProvisionConfigCode,\n\tGitProvisionConfigError,\n\ttype GitProvisionConfigFields,\n\tGitProvisionError,\n\ttype GitProvisionErrorCode,\n\ttype GitProvisionFields,\n\ttype GitProvisionJsonValue,\n\ttype GitProvisionPhase,\n\ttype GitProvisionTimeoutCode,\n\tGitProvisionTimeoutError,\n\ttype GitProvisionTimeoutFields,\n\ttype GitRejectedSystemGit,\n\ttype GitUnavailableCode,\n\tGitUnavailableError,\n\ttype GitUnavailableFields,\n\ttype GitUnsupportedPlatformReason,\n\tisGitProvisionConfigError,\n\tisGitProvisionError,\n\tisGitProvisionTimeoutError,\n\tisGitUnavailableError,\n\tisRetryableGitProvisionError,\n\trehydrateGitProvisionError,\n\ttype SerializedGitProvisionError,\n} from \"./utils/git-errors.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\nexport { INTERACTIVE_ENGINE_ENV_VARS, scrubInteractiveEngineEnv } from \"./utils/interactive-engine-env.ts\";\nexport {\n\tisManagedToolDownloadError,\n\tisManagedToolError,\n\tisManagedToolTimeoutError,\n\tisRetryableManagedToolError,\n\ttype ManagedToolDownloadCode,\n\tManagedToolDownloadError,\n\ttype ManagedToolDownloadFields,\n\tManagedToolError,\n\ttype ManagedToolErrorCode,\n\ttype ManagedToolErrorFields,\n\ttype ManagedToolName,\n\ttype ManagedToolRequestPhase,\n\ttype ManagedToolTimeoutCode,\n\tManagedToolTimeoutError,\n\ttype ManagedToolTimeoutFields,\n} from \"./utils/managed-tool-errors.ts\";\nexport { detectSupportedImageMimeTypeFromFile } from \"./utils/mime.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\nexport {\n\ttype GitToolStatus,\n\ttype GitUpdateStatus,\n\tgetGitStatus,\n\ttype ResolvedGit,\n\ttype ResolvedGitSource,\n\ttype ResolveGitOptions,\n\tresolveGit,\n\tresolveGitSync,\n\ttype ToolStatus as ManagedToolStatus,\n} from \"./utils/tools-manager.ts\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"main-session.d.ts","sourceRoot":"","sources":["../src/main-session.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAU1C,OAAO,EAAmC,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrG,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAExB,KAAK,YAAY,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AAE,qBAAqB,GAC5B,OAAO,CAAC,gBAAgB,GAAG,WAAW,CAAC,CA0CzC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,YAAY,EAAE,CAEpH;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ1G;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,QAAQ,EAAE,OAAO,GAAG,SAAS,EAC7B,UAAU,EAAE,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,EAC1C,YAAY,EAAE,mBAAmB,GAC/B,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAE/B"}
@@ -17,7 +17,7 @@ import { sessionContinuesIn, sessionRunsInRecordedCheckout } from "./core/sessio
17
17
  import { storageSelectionKey } from "./core/storage/provider.js";
18
18
  import { ExtensionSelectorComponent } from "./modes/interactive/components/extension-selector.js";
19
19
  import { initTheme, stopThemeWatcher } from "./modes/interactive/theme/theme.js";
20
- import { resolveSessionIdTargetAcrossScopes } from "./session-id-target.js";
20
+ import { isSessionIdPrefix, resolveSessionIdTargetAcrossScopes } from "./session-id-target.js";
21
21
  import { createSessionCwdMatcher, resolvePath } from "./utils/paths.js";
22
22
  /** The `--resume` picker's delete: the id is checked before the store is touched (#4326). */
23
23
  export async function deleteSessionFromPicker(store, id) {
@@ -32,12 +32,28 @@ async function findLocalSessionByExactId(sessionId, cwd, store) {
32
32
  ? { id: header.id, cwd: header.cwd }
33
33
  : undefined;
34
34
  }
35
+ async function findSessionByExactId(sessionId, cwd, store) {
36
+ const header = await store.readHeader(sessionId).catch(() => undefined);
37
+ if (!header)
38
+ return undefined;
39
+ const inProject = createSessionCwdMatcher(resolvePath(cwd))(resolvePath(header.cwd));
40
+ return { type: inProject ? "local" : "global", id: header.id, cwd: header.cwd };
41
+ }
42
+ async function sessionsWithIdPrefix(idPrefix, store) {
43
+ const sessions = [];
44
+ for await (const summary of store.list({ idPrefix, includeInternal: true })) {
45
+ sessions.push({ id: summary.id, cwd: summary.cwd });
46
+ }
47
+ return sessions;
48
+ }
35
49
  async function resolveSessionId(sessionArg, cwd, store) {
36
- const exact = await findLocalSessionByExactId(sessionArg, cwd, store).catch(() => undefined);
50
+ const exact = await findSessionByExactId(sessionArg, cwd, store);
37
51
  if (exact)
38
- return { type: "local", id: exact.id, cwd: exact.cwd };
39
- const localSessions = await SessionManager.list(cwd, store, undefined, { includeInternal: true });
40
- const resolution = await resolveSessionIdTargetAcrossScopes(sessionArg, localSessions, () => SessionManager.listAll(store, undefined, { includeInternal: true }));
52
+ return exact;
53
+ const candidates = isSessionIdPrefix(sessionArg) ? await sessionsWithIdPrefix(sessionArg, store) : [];
54
+ const inProject = createSessionCwdMatcher(resolvePath(cwd));
55
+ const localSessions = candidates.filter((session) => inProject(resolvePath(session.cwd)));
56
+ const resolution = await resolveSessionIdTargetAcrossScopes(sessionArg, localSessions, async () => candidates);
41
57
  if (resolution.kind === "exact" || resolution.kind === "unique_prefix") {
42
58
  return {
43
59
  type: resolution.scope,
@@ -1 +1 @@
1
- {"version":3,"file":"main-session.js","sourceRoot":"","sources":["../src/main-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAChH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uB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OAAiB;IAC1F,IAAI,CAAC;QACJ,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAAC,OAAO,OAAO,EAAE,CAAC;QAClB,IAAI,OAAO,KAAK,SAAS;YAAE,MAAM,OAAO,CAAC;QACzC,IAAI,OAAO,YAAY,KAAK;YAC3B,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;IACxF,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC7B,QAA6B,EAC7B,UAA0C,EAC1C,YAAiC;IAEjC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,IAAI,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,YAAY,KAAK,QAAQ,CAAC;AACxF,CAAC","sourcesContent":["import { existsSync } from \"node:fs\";\nimport { createInterface } from \"node:readline\";\nimport { ProcessTerminal, setCapabilityOverrides, setKeybindings, TuiMainScreen } from \"@earendil-works/pi-tui\";\nimport chalk from \"chalk\";\nimport type { Args } from \"./cli/args.ts\";\nimport { selectSession } from \"./cli/session-picker.ts\";\nimport { getAgentDir } from \"./config.js\";\nimport { KeybindingsManager } from \"./core/keybindings.ts\";\nimport {\n\tRESUME_CATALOG_TIMEOUT_MS,\n\tresumeLookupError,\n\tresumeNotFoundError,\n\twithResumeLookupDeadline,\n} from \"./core/resume/not-found.ts\";\nimport { checkResumeStoragePreconditions, type ResumePreflightIo } from \"./core/resume/preflight.ts\";\nimport {\n\ttype DirtyCheckoutChoice,\n\ttype DirtyCheckoutPrompt,\n\tprepareSessionResume,\n\ttype ResumeNotice,\n\tsessionResumeOptions,\n} from \"./core/resume/session-resume.ts\";\nimport { formatMissingSessionCwdPrompt, type SessionCwdIssue } from \"./core/session-cwd.ts\";\nimport { ownedSessionManagerStores } from \"./core/session-lifecycle-work.ts\";\nimport { assertValidSessionId, SessionManager } from \"./core/session-manager.ts\";\nimport { classifiedWorkflowMetadata, workflowSessionMetadataFromEnv } from \"./core/session-manager-classification.ts\";\nimport { resolveSessionStore, selectSessionStorage } from \"./core/session-storage.js\";\nimport { sessionContinuesIn, sessionRunsInRecordedCheckout } from \"./core/session-worktree-snapshots.ts\";\nimport type { DefaultProjectTrust, SettingsManager } from \"./core/settings-manager.ts\";\nimport { type StorageSelection, storageSelectionKey } from \"./core/storage/provider.js\";\nimport type { SessionStore } from \"./core/storage/session/types.js\";\nimport type { ProjectTrustStore } from \"./core/trust-manager.ts\";\nimport type { AppMode } from \"./main-app-mode.ts\";\nimport { ExtensionSelectorComponent } from \"./modes/interactive/components/extension-selector.ts\";\nimport { initTheme, stopThemeWatcher } from \"./modes/interactive/theme/theme.js\";\nimport { resolveSessionIdTargetAcrossScopes } from \"./session-id-target.js\";\nimport { createSessionCwdMatcher, resolvePath } from \"./utils/paths.ts\";\n\ntype ResolvedSession =\n\t| { type: \"local\" | \"global\"; id: string; cwd: string }\n\t| { type: \"error\"; message: string }\n\t| { type: \"not_found\"; arg: string };\n\n/** The `--resume` picker's delete: the id is checked before the store is touched (#4326). */\nexport async function deleteSessionFromPicker(store: SessionStore, id: string): Promise<void> {\n\tassertValidSessionId(id);\n\tawait store.delete(id);\n}\n\nasync function findLocalSessionByExactId(sessionId: string, cwd: string, store: SessionStore) {\n\tconst header = await store.readHeader(sessionId);\n\treturn header &&\n\t\t!classifiedWorkflowMetadata(header) &&\n\t\tcreateSessionCwdMatcher(resolvePath(cwd))(resolvePath(header.cwd))\n\t\t? { id: header.id, cwd: header.cwd }\n\t\t: undefined;\n}\n\nasync function resolveSessionId(sessionArg: string, cwd: string, store: SessionStore): Promise<ResolvedSession> {\n\tconst exact = await findLocalSessionByExactId(sessionArg, cwd, store).catch(() => undefined);\n\tif (exact) return { type: \"local\", id: exact.id, cwd: exact.cwd };\n\tconst localSessions = await SessionManager.list(cwd, store, undefined, { includeInternal: true });\n\tconst resolution = await resolveSessionIdTargetAcrossScopes(sessionArg, localSessions, () =>\n\t\tSessionManager.listAll(store, undefined, { includeInternal: true }),\n\t);\n\tif (resolution.kind === \"exact\" || resolution.kind === \"unique_prefix\") {\n\t\treturn {\n\t\t\ttype: resolution.scope,\n\t\t\tid: resolution.session.id,\n\t\t\tcwd: resolution.session.cwd,\n\t\t};\n\t}\n\tif (resolution.kind === \"ambiguous\" || resolution.kind === \"malformed\") {\n\t\treturn { type: \"error\", message: resolution.message };\n\t}\n\treturn { type: \"not_found\", arg: sessionArg };\n}\n\n/** Prompt user for yes/no confirmation */\nasync function promptConfirm(message: string): Promise<boolean> {\n\treturn new Promise((resolve) => {\n\t\tconst rl = createInterface({\n\t\t\tinput: process.stdin,\n\t\t\toutput: process.stdout,\n\t\t});\n\t\trl.question(`${message} [y/N] `, (answer) => {\n\t\t\trl.close();\n\t\t\tresolve(answer.toLowerCase() === \"y\" || answer.toLowerCase() === \"yes\");\n\t\t});\n\t});\n}\n\nexport class SessionSelectorConflictError extends Error {\n\treadonly code = \"SessionSelectorConflict\";\n\treadonly conflictingFlags: readonly string[];\n\n\tconstructor(conflictingFlags: readonly string[]) {\n\t\tsuper(\n\t\t\t`--import cannot be combined with ${conflictingFlags.join(\", \")}. Use --import alone, optionally with --no-session or --session-dir.`,\n\t\t);\n\t\tthis.name = \"SessionSelectorConflictError\";\n\t\tthis.conflictingFlags = conflictingFlags;\n\t}\n}\n\nexport function validateImportFlags(parsed: Args): void {\n\tif (parsed.import === undefined) return;\n\tconst conflictingFlags = [\n\t\tparsed.session !== undefined ? \"--session\" : undefined,\n\t\tparsed.fork !== undefined ? \"--fork\" : undefined,\n\t\tparsed.sessionId !== undefined ? \"--session-id\" : undefined,\n\t\tparsed.continue ? \"--continue\" : undefined,\n\t\tparsed.resume ? \"--resume\" : undefined,\n\t].filter((flag): flag is string => flag !== undefined);\n\tif (conflictingFlags.length > 0) throw new SessionSelectorConflictError(conflictingFlags);\n}\n\nexport function validateForkFlags(parsed: Args): void {\n\tif (parsed.fork === undefined) return;\n\n\tconst conflictingFlags = [\n\t\tparsed.session !== undefined ? \"--session\" : undefined,\n\t\tparsed.continue ? \"--continue\" : undefined,\n\t\tparsed.resume ? \"--resume\" : undefined,\n\t\tparsed.noSession ? \"--no-session\" : undefined,\n\t].filter((flag): flag is string => flag !== undefined);\n\n\tif (conflictingFlags.length > 0) {\n\t\tconsole.error(chalk.red(`Error: --fork cannot be combined with ${conflictingFlags.join(\", \")}`));\n\t\tprocess.exit(1);\n\t}\n}\n\nexport function validateSessionIdFlags(parsed: Args): void {\n\tif (parsed.sessionId === undefined) return;\n\n\tconst conflictingFlags = [\n\t\tparsed.session !== undefined ? \"--session\" : undefined,\n\t\tparsed.continue ? \"--continue\" : undefined,\n\t\tparsed.resume ? \"--resume\" : undefined,\n\t].filter((flag): flag is string => flag !== undefined);\n\n\tif (conflictingFlags.length > 0) {\n\t\tconsole.error(chalk.red(`Error: --session-id cannot be combined with ${conflictingFlags.join(\", \")}`));\n\t\tprocess.exit(1);\n\t}\n\n\ttry {\n\t\tassertValidSessionId(parsed.sessionId);\n\t} catch (error: unknown) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exit(1);\n\t}\n}\nasync function forkSessionOrExit(\n\tsourceId: string,\n\tcwd: string,\n\tstore: SessionStore,\n\tsessionId?: string,\n): Promise<SessionManager> {\n\ttry {\n\t\tconst source = await SessionManager.open(store, sourceId);\n\t\treturn await source.forkTo(cwd, store, { id: sessionId });\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exit(1);\n\t}\n}\n\nasync function openSessionOrExit(sessionId: string, store: SessionStore): Promise<SessionManager> {\n\ttry {\n\t\treturn await SessionManager.open(store, sessionId);\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exit(1);\n\t}\n}\n\nexport async function applyInheritedWorkflowSessionClassification(\n\tsessionManager: SessionManager,\n\tenv: Record<string, string | undefined> = process.env,\n): Promise<SessionManager> {\n\tconst metadata = workflowSessionMetadataFromEnv(env);\n\tif (metadata) await sessionManager.markSessionInternal(metadata);\n\treturn sessionManager;\n}\n\nconst initialStorageKeys = new WeakMap<SessionManager, string>();\nconst provisionalSessions = new WeakSet<SessionManager>();\n\nasync function createProvisionalSession(store: SessionStore, cwd: string, id?: string): Promise<SessionManager> {\n\tconst manager = await SessionManager.create(store, cwd, { id });\n\tprovisionalSessions.add(manager);\n\treturn manager;\n}\n\n/** Finalize a CLI-owned provisional store after trusted settings become available. */\nexport async function refreshSessionStorage(\n\tmanager: SessionManager,\n\tparsed: Args,\n\tsettingsManager: SettingsManager,\n\tsessionStore?: SessionStore | StorageSelection,\n): Promise<SessionStore | undefined> {\n\t// An opened conversation belongs to the store that supplied it, even when its\n\t// project's newly trusted settings select a different store for new sessions.\n\tif (!provisionalSessions.has(manager) || manager.getEntries().length > 0) return undefined;\n\tconst options = {\n\t\tsessionStore,\n\t\tsettings: settingsManager.getSettings(),\n\t\tnoSession: parsed.noSession,\n\t\tsessionDir: parsed.sessionDir,\n\t\tsessionStorePath: parsed.sessionStorePath,\n\t\tsessionPrefix: parsed.sessionPrefix,\n\t};\n\tconst selection = selectSessionStorage(manager.getCwd(), options);\n\tif (\"load\" in selection) return undefined;\n\tconst key = storageSelectionKey(selection, getAgentDir());\n\tconst initialKey = initialStorageKeys.get(manager);\n\tif (initialKey === undefined || key === initialKey) return undefined;\n\tconst previous = manager.getSessionStore();\n\tconst next = await resolveSessionStore(manager.getCwd(), options);\n\ttry {\n\t\tawait manager.rebindStore(next, true);\n\t} catch (error) {\n\t\tawait next.close();\n\t\tthrow error;\n\t}\n\tinitialStorageKeys.set(manager, key);\n\townedSessionManagerStores.set(manager, next);\n\tawait previous.close();\n\treturn next;\n}\n\nexport async function createSessionManager(\n\tparsed: Args,\n\tcwd: string,\n\tsessionDir: string | undefined,\n\tsettingsManager: SettingsManager,\n\tsessionStore?: SessionStore | StorageSelection,\n): Promise<SessionManager> {\n\tvalidateImportFlags(parsed);\n\tconst store = await resolveSessionStore(cwd, {\n\t\tsessionStore,\n\t\tsettings: settingsManager.getSettings(),\n\t\tnoSession: parsed.noSession,\n\t\tsessionDir: parsed.sessionDir ?? sessionDir,\n\t\tsessionStorePath: parsed.sessionStorePath,\n\t\tsessionPrefix: parsed.sessionPrefix,\n\t});\n\ttry {\n\t\tconst manager = await createSessionManagerWithStore(parsed, cwd, settingsManager, store);\n\t\tif (store !== sessionStore) ownedSessionManagerStores.set(manager, store);\n\t\tconst selection = selectSessionStorage(cwd, {\n\t\t\tsessionStore,\n\t\t\tsettings: settingsManager.getSettings(),\n\t\t\tnoSession: parsed.noSession,\n\t\t\tsessionDir: parsed.sessionDir ?? sessionDir,\n\t\t\tsessionStorePath: parsed.sessionStorePath,\n\t\t\tsessionPrefix: parsed.sessionPrefix,\n\t\t});\n\t\tif (!(\"load\" in selection)) initialStorageKeys.set(manager, storageSelectionKey(selection, getAgentDir()));\n\t\treturn manager;\n\t} catch (error) {\n\t\tif (store !== sessionStore) await store.close();\n\t\tthrow error;\n\t}\n}\n\nasync function createSessionManagerWithStore(\n\tparsed: Args,\n\tcwd: string,\n\tsettingsManager: SettingsManager,\n\tstore: SessionStore,\n): Promise<SessionManager> {\n\tif (parsed.import !== undefined) return SessionManager.importFromJsonl(resolvePath(parsed.import, cwd), cwd, store);\n\tif (parsed.noSession) return createProvisionalSession(store, cwd, parsed.sessionId);\n\n\tif (parsed.fork !== undefined) {\n\t\tif (parsed.sessionId !== undefined) {\n\t\t\tconst existingTarget = await findLocalSessionByExactId(parsed.sessionId, cwd, store);\n\t\t\tif (existingTarget) {\n\t\t\t\tconsole.error(chalk.red(`Session already exists with id '${parsed.sessionId}'`));\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t}\n\n\t\tconst resolved = await resolveSessionId(parsed.fork, cwd, store);\n\n\t\tswitch (resolved.type) {\n\t\t\tcase \"local\":\n\t\t\tcase \"global\":\n\t\t\t\treturn forkSessionOrExit(resolved.id, cwd, store, parsed.sessionId);\n\t\t\tcase \"error\":\n\t\t\t\tconsole.error(chalk.red(`Error: ${resolved.message}`));\n\t\t\t\tprocess.exit(1);\n\t\t\t\tthrow new Error(\"unreachable\");\n\n\t\t\tcase \"not_found\":\n\t\t\t\tconsole.error(chalk.red(`Error: ${resumeNotFoundError(resolved.arg, store.descriptor).message}`));\n\t\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\tif (parsed.session !== undefined) {\n\t\tconst resolved = await resolveSessionId(parsed.session, cwd, store);\n\n\t\tswitch (resolved.type) {\n\t\t\tcase \"local\":\n\t\t\t\treturn openSessionOrExit(resolved.id, store);\n\n\t\t\tcase \"global\": {\n\t\t\t\tconst recordedOnAnotherNode = !existsSync(resolved.cwd);\n\t\t\t\tif (\n\t\t\t\t\trecordedOnAnotherNode ||\n\t\t\t\t\t(await sessionContinuesIn(store, resolved.id, cwd)) ||\n\t\t\t\t\t(settingsManager.getWorktreeSnapshotSettings().enabled &&\n\t\t\t\t\t\t(await sessionRunsInRecordedCheckout(store, resolved.id)))\n\t\t\t\t) {\n\t\t\t\t\treturn openSessionOrExit(resolved.id, store);\n\t\t\t\t}\n\t\t\t\tconsole.log(chalk.yellow(`Session found in different project: ${resolved.cwd}`));\n\t\t\t\tconst shouldFork = await promptConfirm(\"Fork this session into current directory?\");\n\t\t\t\tif (!shouldFork) {\n\t\t\t\t\tconsole.log(chalk.dim(\"Aborted.\"));\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t}\n\t\t\t\treturn forkSessionOrExit(resolved.id, cwd, store);\n\t\t\t}\n\t\t\tcase \"error\":\n\t\t\t\tconsole.error(chalk.red(`Error: ${resolved.message}`));\n\t\t\t\tprocess.exit(1);\n\t\t\t\tthrow new Error(\"unreachable\");\n\n\t\t\tcase \"not_found\":\n\t\t\t\tconsole.error(chalk.red(`Error: ${resumeNotFoundError(resolved.arg, store.descriptor).message}`));\n\t\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\tif (parsed.resume) {\n\t\tinitTheme(settingsManager.getTheme(), true);\n\t\ttry {\n\t\t\tconst selected = await selectSession(\n\t\t\t\t(onProgress) => SessionManager.list(cwd, store, onProgress),\n\t\t\t\t(onProgress) => SessionManager.listAll(store, onProgress),\n\t\t\t\tsettingsManager,\n\t\t\t\tstore.descriptor.adapter === \"jsonl\" ? undefined : (id) => deleteSessionFromPicker(store, id),\n\t\t\t);\n\t\t\tif (selected === null) {\n\t\t\t\tconsole.log(chalk.dim(\"No session selected\"));\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t\treturn openSessionOrExit(selected.id, store);\n\t\t} finally {\n\t\t\tstopThemeWatcher();\n\t\t}\n\t}\n\n\tif (parsed.continue) {\n\t\tconst recent = await store.findMostRecent({ cwd: resolvePath(cwd) });\n\t\treturn recent ? SessionManager.open(store, recent.id) : createProvisionalSession(store, cwd);\n\t}\n\n\tif (parsed.sessionId !== undefined) {\n\t\tconst existingSession = await findLocalSessionByExactId(parsed.sessionId, cwd, store);\n\t\tif (existingSession) {\n\t\t\treturn openSessionOrExit(existingSession.id, store);\n\t\t}\n\t\tconsole.error(chalk.yellow(`No session found with id '${parsed.sessionId}'; creating a new session.`));\n\t}\n\n\treturn createProvisionalSession(store, cwd, parsed.sessionId);\n}\n\nfunction promptStartupSelector(\n\ttitle: string,\n\toptions: readonly string[],\n\tsettingsManager: SettingsManager,\n): Promise<string | undefined> {\n\tsetCapabilityOverrides(settingsManager.getTerminalCapabilityOverrides());\n\tinitTheme(settingsManager.getTheme());\n\tsetKeybindings(KeybindingsManager.create());\n\n\treturn new Promise((resolve) => {\n\t\tconst ui = new TuiMainScreen(new ProcessTerminal(), settingsManager.getShowHardwareCursor(), getAgentDir());\n\t\tui.setClearOnShrink(settingsManager.getClearOnShrink());\n\n\t\tlet settled = false;\n\t\tconst finish = (result: string | undefined) => {\n\t\t\tif (settled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettled = true;\n\t\t\tui.stop();\n\t\t\tresolve(result);\n\t\t};\n\n\t\tconst selector = new ExtensionSelectorComponent(\n\t\t\ttitle,\n\t\t\t[...options],\n\t\t\t(option) => finish(option),\n\t\t\t() => finish(undefined),\n\t\t\t{ tui: ui },\n\t\t);\n\t\tui.addChild(selector);\n\t\tui.setFocus(selector);\n\t\tui.start();\n\t});\n}\n\nexport async function promptForMissingSessionCwd(\n\tissue: SessionCwdIssue,\n\tsettingsManager: SettingsManager,\n): Promise<string | undefined> {\n\tconst option = await promptStartupSelector(\n\t\tformatMissingSessionCwdPrompt(issue),\n\t\t[\"Continue\", \"Cancel\"],\n\t\tsettingsManager,\n\t);\n\treturn option === \"Continue\" ? issue.fallbackCwd : undefined;\n}\n\nconst DIRTY_CHECKOUT_OPTIONS: readonly (readonly [string, DirtyCheckoutChoice])[] = [\n\t[\"Restore the snapshot into a fresh worktree\", \"restore\"],\n\t[\"Continue in this checkout as it is\", \"use\"],\n\t[\"Cancel\", \"cancel\"],\n];\n\n/** Asks what to do when a resume started in a checkout of the session's repository that differs from its snapshot. */\nexport async function promptForDirtyCheckout(\n\tprompt: DirtyCheckoutPrompt,\n\tsettingsManager: SettingsManager,\n): Promise<DirtyCheckoutChoice> {\n\tconst option = await promptStartupSelector(\n\t\t`This checkout differs from the session's snapshot ${prompt.snapshotId.slice(0, 12)}\\n${prompt.checkout}\\n\\nrecorded in\\n${prompt.recordedRoot}`,\n\t\tDIRTY_CHECKOUT_OPTIONS.map(([label]) => label),\n\t\tsettingsManager,\n\t);\n\treturn DIRTY_CHECKOUT_OPTIONS.find(([label]) => label === option)?.[1] ?? \"cancel\";\n}\n\n/** The storage selection a CLI resume reads sessions from, or undefined when an SDK store instance was given. */\nexport function cliSessionStorageSelection(\n\tparsed: Args,\n\tcwd: string,\n\tsettingsManager: SettingsManager,\n\tsessionStore?: SessionStore | StorageSelection,\n): StorageSelection | undefined {\n\tconst selection = selectSessionStorage(cwd, {\n\t\tsessionStore,\n\t\tsettings: settingsManager.getSettings(),\n\t\tnoSession: parsed.noSession,\n\t\tsessionDir: parsed.sessionDir,\n\t\tsessionStorePath: parsed.sessionStorePath,\n\t\tsessionPrefix: parsed.sessionPrefix,\n\t});\n\treturn \"load\" in selection ? undefined : selection;\n}\n\n/** An id no session has, for probing storage when the resume names none. */\nconst PROBE_SESSION_ID = \"00000000-0000-7000-8000-000000000000\";\n\n/** One point read through `selection`, proving the shared storage answers before the real lookup starts. */\nasync function probeSessionStorage(\n\tcwd: string,\n\tselection: StorageSelection,\n\tagentDir: string,\n\tsessionId: string | undefined,\n): Promise<void> {\n\tconst store = await resolveSessionStore(cwd, { agentDir, sessionStore: selection });\n\ttry {\n\t\tawait store.readHeader(sessionId ?? PROBE_SESSION_ID);\n\t} finally {\n\t\tawait store.close();\n\t}\n}\n\nexport interface OpenCliSessionOptions {\n\treadonly agentDir: string;\n\t/** How long the lookup waits for shared storage to answer. Default {@link RESUME_CATALOG_TIMEOUT_MS}. */\n\treadonly catalogTimeoutMs?: number;\n\treadonly sessionStorage?: SessionStore | StorageSelection;\n\t/** Whether the project at a restored worktree is trusted, which its `.atomic/setup` hook requires. */\n\treadonly trusted: (worktree: string) => boolean;\n\treadonly chooseDirtyCheckout?: (prompt: DirtyCheckoutPrompt) => Promise<DirtyCheckoutChoice>;\n\treadonly io?: ResumePreflightIo;\n}\n\nexport interface OpenedCliSession {\n\treadonly sessionManager: SessionManager;\n\treadonly notices: readonly ResumeNotice[];\n}\n\n/**\n * Opens the session the CLI flags select and, for a resume, prepares its checkout on this machine. A resume\n * (`--session`, `--resume`, `--continue`) first checks its storage preconditions, and a lookup that cannot reach the\n * storage fails as {@link ResumeCatalogUnavailableError}. Returns \"cancelled\" when the user cancels at a prompt. When it\n * fails or is cancelled after opening the session store it selected, that store is closed again.\n */\nexport async function openCliSession(\n\tparsed: Args,\n\tcwd: string,\n\tsettingsManager: SettingsManager,\n\toptions: OpenCliSessionOptions,\n): Promise<OpenedCliSession | \"cancelled\"> {\n\tconst resuming = parsed.session !== undefined || parsed.resume === true || parsed.continue === true;\n\tconst selection = resuming\n\t\t? cliSessionStorageSelection(parsed, cwd, settingsManager, options.sessionStorage)\n\t\t: undefined;\n\tif (selection !== undefined) {\n\t\tawait checkResumeStoragePreconditions(\"cli\", [{ domain: \"sessions\", selection }], options.agentDir, options.io);\n\t}\n\tif (selection?.kind === \"adapter\") {\n\t\tawait withResumeLookupDeadline(\n\t\t\tprobeSessionStorage(cwd, selection, options.agentDir, parsed.session),\n\t\t\t{ subject: \"session\", id: parsed.session ?? null, storage: selection.module },\n\t\t\toptions.catalogTimeoutMs ?? RESUME_CATALOG_TIMEOUT_MS,\n\t\t).catch((error: unknown) => {\n\t\t\tthrow resumeLookupError(error, \"session\", parsed.session ?? null);\n\t\t});\n\t}\n\tconst sessionManager = await createSessionManager(\n\t\tparsed,\n\t\tcwd,\n\t\tundefined,\n\t\tsettingsManager,\n\t\toptions.sessionStorage,\n\t).catch((error: unknown) => {\n\t\tthrow resuming ? resumeLookupError(error, \"session\", parsed.session ?? null) : error;\n\t});\n\tconst owned = options.sessionStorage === undefined || !(\"load\" in options.sessionStorage);\n\tconst release = (failure?: unknown) =>\n\t\towned ? closeStoreAfter(sessionManager.getSessionStore(), failure) : undefined;\n\tconst prepared = await prepareSessionResume(sessionManager, {\n\t\t...sessionResumeOptions(\"cli\", cwd, options.agentDir, settingsManager, options.trusted),\n\t\tchooseDirtyCheckout: options.chooseDirtyCheckout,\n\t\tio: options.io,\n\t}).catch(async (error: unknown) => {\n\t\tawait release(error);\n\t\tthrow error;\n\t});\n\tif (prepared.status === \"cancelled\") {\n\t\tawait release();\n\t\treturn \"cancelled\";\n\t}\n\treturn { sessionManager: prepared.sessionManager, notices: prepared.notices };\n}\n\n/**\n * The resume notices print-like modes report with the startup diagnostics. Interactive mode shows them in the TUI\n * instead, so they are not reported twice.\n */\nexport function startupResumeDiagnostics(appMode: AppMode, notices: readonly ResumeNotice[]): readonly ResumeNotice[] {\n\treturn appMode === \"interactive\" ? [] : notices;\n}\n\n/**\n * Closes `store` once the work that opened it ended. After `failure`, a close failure is kept as the failure's\n * `cleanupCause` instead of replacing it; without one, it is thrown.\n */\nexport async function closeStoreAfter(store: Pick<SessionStore, \"close\">, failure?: unknown): Promise<void> {\n\ttry {\n\t\tawait store.close();\n\t} catch (cleanup) {\n\t\tif (failure === undefined) throw cleanup;\n\t\tif (failure instanceof Error)\n\t\t\tObject.defineProperty(failure, \"cleanupCause\", { value: cleanup, enumerable: false });\n\t}\n}\n\n/**\n * Whether the CLI trusts the project at a restored worktree, which its `.atomic/setup` hook requires: the\n * `--approve`/`--deny` override, else the saved decision for that path, else the default trust setting.\n */\nexport function cliResumeTrust(\n\toverride: boolean | undefined,\n\ttrustStore: Pick<ProjectTrustStore, \"get\">,\n\tdefaultTrust: DefaultProjectTrust,\n): (worktree: string) => boolean {\n\treturn (worktree) => override ?? trustStore.get(worktree) ?? defaultTrust === \"always\";\n}\n"]}
1
+ {"version":3,"file":"main-session.js","sourceRoot":"","sources":["../src/main-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAChH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACN,yBAAyB,EACzB,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO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7B,UAA0C,EAC1C,YAAiC;IAEjC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,IAAI,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,YAAY,KAAK,QAAQ,CAAC;AACxF,CAAC","sourcesContent":["import { existsSync } from \"node:fs\";\nimport { createInterface } from \"node:readline\";\nimport { ProcessTerminal, setCapabilityOverrides, setKeybindings, TuiMainScreen } from \"@earendil-works/pi-tui\";\nimport chalk from \"chalk\";\nimport type { Args } from \"./cli/args.ts\";\nimport { selectSession } from \"./cli/session-picker.ts\";\nimport { getAgentDir } from \"./config.js\";\nimport { KeybindingsManager } from \"./core/keybindings.ts\";\nimport {\n\tRESUME_CATALOG_TIMEOUT_MS,\n\tresumeLookupError,\n\tresumeNotFoundError,\n\twithResumeLookupDeadline,\n} from \"./core/resume/not-found.ts\";\nimport { checkResumeStoragePreconditions, type ResumePreflightIo } from \"./core/resume/preflight.ts\";\nimport {\n\ttype DirtyCheckoutChoice,\n\ttype DirtyCheckoutPrompt,\n\tprepareSessionResume,\n\ttype ResumeNotice,\n\tsessionResumeOptions,\n} from \"./core/resume/session-resume.ts\";\nimport { formatMissingSessionCwdPrompt, type SessionCwdIssue } from \"./core/session-cwd.ts\";\nimport { ownedSessionManagerStores } from \"./core/session-lifecycle-work.ts\";\nimport { assertValidSessionId, SessionManager } from \"./core/session-manager.ts\";\nimport { classifiedWorkflowMetadata, workflowSessionMetadataFromEnv } from \"./core/session-manager-classification.ts\";\nimport { resolveSessionStore, selectSessionStorage } from \"./core/session-storage.js\";\nimport { sessionContinuesIn, sessionRunsInRecordedCheckout } from \"./core/session-worktree-snapshots.ts\";\nimport type { DefaultProjectTrust, SettingsManager } from \"./core/settings-manager.ts\";\nimport { type StorageSelection, storageSelectionKey } from \"./core/storage/provider.js\";\nimport type { SessionStore } from \"./core/storage/session/types.js\";\nimport type { ProjectTrustStore } from \"./core/trust-manager.ts\";\nimport type { AppMode } from \"./main-app-mode.ts\";\nimport { ExtensionSelectorComponent } from \"./modes/interactive/components/extension-selector.ts\";\nimport { initTheme, stopThemeWatcher } from \"./modes/interactive/theme/theme.js\";\nimport { isSessionIdPrefix, resolveSessionIdTargetAcrossScopes } from \"./session-id-target.js\";\nimport { createSessionCwdMatcher, resolvePath } from \"./utils/paths.ts\";\n\ntype ResolvedSession =\n\t| { type: \"local\" | \"global\"; id: string; cwd: string }\n\t| { type: \"error\"; message: string }\n\t| { type: \"not_found\"; arg: string };\n\n/** The `--resume` picker's delete: the id is checked before the store is touched (#4326). */\nexport async function deleteSessionFromPicker(store: SessionStore, id: string): Promise<void> {\n\tassertValidSessionId(id);\n\tawait store.delete(id);\n}\n\nasync function findLocalSessionByExactId(sessionId: string, cwd: string, store: SessionStore) {\n\tconst header = await store.readHeader(sessionId);\n\treturn header &&\n\t\t!classifiedWorkflowMetadata(header) &&\n\t\tcreateSessionCwdMatcher(resolvePath(cwd))(resolvePath(header.cwd))\n\t\t? { id: header.id, cwd: header.cwd }\n\t\t: undefined;\n}\n\nasync function findSessionByExactId(\n\tsessionId: string,\n\tcwd: string,\n\tstore: SessionStore,\n): Promise<ResolvedSession | undefined> {\n\tconst header = await store.readHeader(sessionId).catch(() => undefined);\n\tif (!header) return undefined;\n\tconst inProject = createSessionCwdMatcher(resolvePath(cwd))(resolvePath(header.cwd));\n\treturn { type: inProject ? \"local\" : \"global\", id: header.id, cwd: header.cwd };\n}\n\nasync function sessionsWithIdPrefix(\n\tidPrefix: string,\n\tstore: SessionStore,\n): Promise<{ readonly id: string; readonly cwd: string }[]> {\n\tconst sessions: { readonly id: string; readonly cwd: string }[] = [];\n\tfor await (const summary of store.list({ idPrefix, includeInternal: true })) {\n\t\tsessions.push({ id: summary.id, cwd: summary.cwd });\n\t}\n\treturn sessions;\n}\n\nasync function resolveSessionId(sessionArg: string, cwd: string, store: SessionStore): Promise<ResolvedSession> {\n\tconst exact = await findSessionByExactId(sessionArg, cwd, store);\n\tif (exact) return exact;\n\tconst candidates = isSessionIdPrefix(sessionArg) ? await sessionsWithIdPrefix(sessionArg, store) : [];\n\tconst inProject = createSessionCwdMatcher(resolvePath(cwd));\n\tconst localSessions = candidates.filter((session) => inProject(resolvePath(session.cwd)));\n\tconst resolution = await resolveSessionIdTargetAcrossScopes(sessionArg, localSessions, async () => candidates);\n\tif (resolution.kind === \"exact\" || resolution.kind === \"unique_prefix\") {\n\t\treturn {\n\t\t\ttype: resolution.scope,\n\t\t\tid: resolution.session.id,\n\t\t\tcwd: resolution.session.cwd,\n\t\t};\n\t}\n\tif (resolution.kind === \"ambiguous\" || resolution.kind === \"malformed\") {\n\t\treturn { type: \"error\", message: resolution.message };\n\t}\n\treturn { type: \"not_found\", arg: sessionArg };\n}\n\n/** Prompt user for yes/no confirmation */\nasync function promptConfirm(message: string): Promise<boolean> {\n\treturn new Promise((resolve) => {\n\t\tconst rl = createInterface({\n\t\t\tinput: process.stdin,\n\t\t\toutput: process.stdout,\n\t\t});\n\t\trl.question(`${message} [y/N] `, (answer) => {\n\t\t\trl.close();\n\t\t\tresolve(answer.toLowerCase() === \"y\" || answer.toLowerCase() === \"yes\");\n\t\t});\n\t});\n}\n\nexport class SessionSelectorConflictError extends Error {\n\treadonly code = \"SessionSelectorConflict\";\n\treadonly conflictingFlags: readonly string[];\n\n\tconstructor(conflictingFlags: readonly string[]) {\n\t\tsuper(\n\t\t\t`--import cannot be combined with ${conflictingFlags.join(\", \")}. Use --import alone, optionally with --no-session or --session-dir.`,\n\t\t);\n\t\tthis.name = \"SessionSelectorConflictError\";\n\t\tthis.conflictingFlags = conflictingFlags;\n\t}\n}\n\nexport function validateImportFlags(parsed: Args): void {\n\tif (parsed.import === undefined) return;\n\tconst conflictingFlags = [\n\t\tparsed.session !== undefined ? \"--session\" : undefined,\n\t\tparsed.fork !== undefined ? \"--fork\" : undefined,\n\t\tparsed.sessionId !== undefined ? \"--session-id\" : undefined,\n\t\tparsed.continue ? \"--continue\" : undefined,\n\t\tparsed.resume ? \"--resume\" : undefined,\n\t].filter((flag): flag is string => flag !== undefined);\n\tif (conflictingFlags.length > 0) throw new SessionSelectorConflictError(conflictingFlags);\n}\n\nexport function validateForkFlags(parsed: Args): void {\n\tif (parsed.fork === undefined) return;\n\n\tconst conflictingFlags = [\n\t\tparsed.session !== undefined ? \"--session\" : undefined,\n\t\tparsed.continue ? \"--continue\" : undefined,\n\t\tparsed.resume ? \"--resume\" : undefined,\n\t\tparsed.noSession ? \"--no-session\" : undefined,\n\t].filter((flag): flag is string => flag !== undefined);\n\n\tif (conflictingFlags.length > 0) {\n\t\tconsole.error(chalk.red(`Error: --fork cannot be combined with ${conflictingFlags.join(\", \")}`));\n\t\tprocess.exit(1);\n\t}\n}\n\nexport function validateSessionIdFlags(parsed: Args): void {\n\tif (parsed.sessionId === undefined) return;\n\n\tconst conflictingFlags = [\n\t\tparsed.session !== undefined ? \"--session\" : undefined,\n\t\tparsed.continue ? \"--continue\" : undefined,\n\t\tparsed.resume ? \"--resume\" : undefined,\n\t].filter((flag): flag is string => flag !== undefined);\n\n\tif (conflictingFlags.length > 0) {\n\t\tconsole.error(chalk.red(`Error: --session-id cannot be combined with ${conflictingFlags.join(\", \")}`));\n\t\tprocess.exit(1);\n\t}\n\n\ttry {\n\t\tassertValidSessionId(parsed.sessionId);\n\t} catch (error: unknown) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exit(1);\n\t}\n}\nasync function forkSessionOrExit(\n\tsourceId: string,\n\tcwd: string,\n\tstore: SessionStore,\n\tsessionId?: string,\n): Promise<SessionManager> {\n\ttry {\n\t\tconst source = await SessionManager.open(store, sourceId);\n\t\treturn await source.forkTo(cwd, store, { id: sessionId });\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exit(1);\n\t}\n}\n\nasync function openSessionOrExit(sessionId: string, store: SessionStore): Promise<SessionManager> {\n\ttry {\n\t\treturn await SessionManager.open(store, sessionId);\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.error(chalk.red(`Error: ${message}`));\n\t\tprocess.exit(1);\n\t}\n}\n\nexport async function applyInheritedWorkflowSessionClassification(\n\tsessionManager: SessionManager,\n\tenv: Record<string, string | undefined> = process.env,\n): Promise<SessionManager> {\n\tconst metadata = workflowSessionMetadataFromEnv(env);\n\tif (metadata) await sessionManager.markSessionInternal(metadata);\n\treturn sessionManager;\n}\n\nconst initialStorageKeys = new WeakMap<SessionManager, string>();\nconst provisionalSessions = new WeakSet<SessionManager>();\n\nasync function createProvisionalSession(store: SessionStore, cwd: string, id?: string): Promise<SessionManager> {\n\tconst manager = await SessionManager.create(store, cwd, { id });\n\tprovisionalSessions.add(manager);\n\treturn manager;\n}\n\n/** Finalize a CLI-owned provisional store after trusted settings become available. */\nexport async function refreshSessionStorage(\n\tmanager: SessionManager,\n\tparsed: Args,\n\tsettingsManager: SettingsManager,\n\tsessionStore?: SessionStore | StorageSelection,\n): Promise<SessionStore | undefined> {\n\t// An opened conversation belongs to the store that supplied it, even when its\n\t// project's newly trusted settings select a different store for new sessions.\n\tif (!provisionalSessions.has(manager) || manager.getEntries().length > 0) return undefined;\n\tconst options = {\n\t\tsessionStore,\n\t\tsettings: settingsManager.getSettings(),\n\t\tnoSession: parsed.noSession,\n\t\tsessionDir: parsed.sessionDir,\n\t\tsessionStorePath: parsed.sessionStorePath,\n\t\tsessionPrefix: parsed.sessionPrefix,\n\t};\n\tconst selection = selectSessionStorage(manager.getCwd(), options);\n\tif (\"load\" in selection) return undefined;\n\tconst key = storageSelectionKey(selection, getAgentDir());\n\tconst initialKey = initialStorageKeys.get(manager);\n\tif (initialKey === undefined || key === initialKey) return undefined;\n\tconst previous = manager.getSessionStore();\n\tconst next = await resolveSessionStore(manager.getCwd(), options);\n\ttry {\n\t\tawait manager.rebindStore(next, true);\n\t} catch (error) {\n\t\tawait next.close();\n\t\tthrow error;\n\t}\n\tinitialStorageKeys.set(manager, key);\n\townedSessionManagerStores.set(manager, next);\n\tawait previous.close();\n\treturn next;\n}\n\nexport async function createSessionManager(\n\tparsed: Args,\n\tcwd: string,\n\tsessionDir: string | undefined,\n\tsettingsManager: SettingsManager,\n\tsessionStore?: SessionStore | StorageSelection,\n): Promise<SessionManager> {\n\tvalidateImportFlags(parsed);\n\tconst store = await resolveSessionStore(cwd, {\n\t\tsessionStore,\n\t\tsettings: settingsManager.getSettings(),\n\t\tnoSession: parsed.noSession,\n\t\tsessionDir: parsed.sessionDir ?? sessionDir,\n\t\tsessionStorePath: parsed.sessionStorePath,\n\t\tsessionPrefix: parsed.sessionPrefix,\n\t});\n\ttry {\n\t\tconst manager = await createSessionManagerWithStore(parsed, cwd, settingsManager, store);\n\t\tif (store !== sessionStore) ownedSessionManagerStores.set(manager, store);\n\t\tconst selection = selectSessionStorage(cwd, {\n\t\t\tsessionStore,\n\t\t\tsettings: settingsManager.getSettings(),\n\t\t\tnoSession: parsed.noSession,\n\t\t\tsessionDir: parsed.sessionDir ?? sessionDir,\n\t\t\tsessionStorePath: parsed.sessionStorePath,\n\t\t\tsessionPrefix: parsed.sessionPrefix,\n\t\t});\n\t\tif (!(\"load\" in selection)) initialStorageKeys.set(manager, storageSelectionKey(selection, getAgentDir()));\n\t\treturn manager;\n\t} catch (error) {\n\t\tif (store !== sessionStore) await store.close();\n\t\tthrow error;\n\t}\n}\n\nasync function createSessionManagerWithStore(\n\tparsed: Args,\n\tcwd: string,\n\tsettingsManager: SettingsManager,\n\tstore: SessionStore,\n): Promise<SessionManager> {\n\tif (parsed.import !== undefined) return SessionManager.importFromJsonl(resolvePath(parsed.import, cwd), cwd, store);\n\tif (parsed.noSession) return createProvisionalSession(store, cwd, parsed.sessionId);\n\n\tif (parsed.fork !== undefined) {\n\t\tif (parsed.sessionId !== undefined) {\n\t\t\tconst existingTarget = await findLocalSessionByExactId(parsed.sessionId, cwd, store);\n\t\t\tif (existingTarget) {\n\t\t\t\tconsole.error(chalk.red(`Session already exists with id '${parsed.sessionId}'`));\n\t\t\t\tprocess.exit(1);\n\t\t\t}\n\t\t}\n\n\t\tconst resolved = await resolveSessionId(parsed.fork, cwd, store);\n\n\t\tswitch (resolved.type) {\n\t\t\tcase \"local\":\n\t\t\tcase \"global\":\n\t\t\t\treturn forkSessionOrExit(resolved.id, cwd, store, parsed.sessionId);\n\t\t\tcase \"error\":\n\t\t\t\tconsole.error(chalk.red(`Error: ${resolved.message}`));\n\t\t\t\tprocess.exit(1);\n\t\t\t\tthrow new Error(\"unreachable\");\n\n\t\t\tcase \"not_found\":\n\t\t\t\tconsole.error(chalk.red(`Error: ${resumeNotFoundError(resolved.arg, store.descriptor).message}`));\n\t\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\tif (parsed.session !== undefined) {\n\t\tconst resolved = await resolveSessionId(parsed.session, cwd, store);\n\n\t\tswitch (resolved.type) {\n\t\t\tcase \"local\":\n\t\t\t\treturn openSessionOrExit(resolved.id, store);\n\n\t\t\tcase \"global\": {\n\t\t\t\tconst recordedOnAnotherNode = !existsSync(resolved.cwd);\n\t\t\t\tif (\n\t\t\t\t\trecordedOnAnotherNode ||\n\t\t\t\t\t(await sessionContinuesIn(store, resolved.id, cwd)) ||\n\t\t\t\t\t(settingsManager.getWorktreeSnapshotSettings().enabled &&\n\t\t\t\t\t\t(await sessionRunsInRecordedCheckout(store, resolved.id)))\n\t\t\t\t) {\n\t\t\t\t\treturn openSessionOrExit(resolved.id, store);\n\t\t\t\t}\n\t\t\t\tconsole.log(chalk.yellow(`Session found in different project: ${resolved.cwd}`));\n\t\t\t\tconst shouldFork = await promptConfirm(\"Fork this session into current directory?\");\n\t\t\t\tif (!shouldFork) {\n\t\t\t\t\tconsole.log(chalk.dim(\"Aborted.\"));\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t}\n\t\t\t\treturn forkSessionOrExit(resolved.id, cwd, store);\n\t\t\t}\n\t\t\tcase \"error\":\n\t\t\t\tconsole.error(chalk.red(`Error: ${resolved.message}`));\n\t\t\t\tprocess.exit(1);\n\t\t\t\tthrow new Error(\"unreachable\");\n\n\t\t\tcase \"not_found\":\n\t\t\t\tconsole.error(chalk.red(`Error: ${resumeNotFoundError(resolved.arg, store.descriptor).message}`));\n\t\t\t\tprocess.exit(1);\n\t\t}\n\t}\n\n\tif (parsed.resume) {\n\t\tinitTheme(settingsManager.getTheme(), true);\n\t\ttry {\n\t\t\tconst selected = await selectSession(\n\t\t\t\t(onProgress) => SessionManager.list(cwd, store, onProgress),\n\t\t\t\t(onProgress) => SessionManager.listAll(store, onProgress),\n\t\t\t\tsettingsManager,\n\t\t\t\tstore.descriptor.adapter === \"jsonl\" ? undefined : (id) => deleteSessionFromPicker(store, id),\n\t\t\t);\n\t\t\tif (selected === null) {\n\t\t\t\tconsole.log(chalk.dim(\"No session selected\"));\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t\treturn openSessionOrExit(selected.id, store);\n\t\t} finally {\n\t\t\tstopThemeWatcher();\n\t\t}\n\t}\n\n\tif (parsed.continue) {\n\t\tconst recent = await store.findMostRecent({ cwd: resolvePath(cwd) });\n\t\treturn recent ? SessionManager.open(store, recent.id) : createProvisionalSession(store, cwd);\n\t}\n\n\tif (parsed.sessionId !== undefined) {\n\t\tconst existingSession = await findLocalSessionByExactId(parsed.sessionId, cwd, store);\n\t\tif (existingSession) {\n\t\t\treturn openSessionOrExit(existingSession.id, store);\n\t\t}\n\t\tconsole.error(chalk.yellow(`No session found with id '${parsed.sessionId}'; creating a new session.`));\n\t}\n\n\treturn createProvisionalSession(store, cwd, parsed.sessionId);\n}\n\nfunction promptStartupSelector(\n\ttitle: string,\n\toptions: readonly string[],\n\tsettingsManager: SettingsManager,\n): Promise<string | undefined> {\n\tsetCapabilityOverrides(settingsManager.getTerminalCapabilityOverrides());\n\tinitTheme(settingsManager.getTheme());\n\tsetKeybindings(KeybindingsManager.create());\n\n\treturn new Promise((resolve) => {\n\t\tconst ui = new TuiMainScreen(new ProcessTerminal(), settingsManager.getShowHardwareCursor(), getAgentDir());\n\t\tui.setClearOnShrink(settingsManager.getClearOnShrink());\n\n\t\tlet settled = false;\n\t\tconst finish = (result: string | undefined) => {\n\t\t\tif (settled) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsettled = true;\n\t\t\tui.stop();\n\t\t\tresolve(result);\n\t\t};\n\n\t\tconst selector = new ExtensionSelectorComponent(\n\t\t\ttitle,\n\t\t\t[...options],\n\t\t\t(option) => finish(option),\n\t\t\t() => finish(undefined),\n\t\t\t{ tui: ui },\n\t\t);\n\t\tui.addChild(selector);\n\t\tui.setFocus(selector);\n\t\tui.start();\n\t});\n}\n\nexport async function promptForMissingSessionCwd(\n\tissue: SessionCwdIssue,\n\tsettingsManager: SettingsManager,\n): Promise<string | undefined> {\n\tconst option = await promptStartupSelector(\n\t\tformatMissingSessionCwdPrompt(issue),\n\t\t[\"Continue\", \"Cancel\"],\n\t\tsettingsManager,\n\t);\n\treturn option === \"Continue\" ? issue.fallbackCwd : undefined;\n}\n\nconst DIRTY_CHECKOUT_OPTIONS: readonly (readonly [string, DirtyCheckoutChoice])[] = [\n\t[\"Restore the snapshot into a fresh worktree\", \"restore\"],\n\t[\"Continue in this checkout as it is\", \"use\"],\n\t[\"Cancel\", \"cancel\"],\n];\n\n/** Asks what to do when a resume started in a checkout of the session's repository that differs from its snapshot. */\nexport async function promptForDirtyCheckout(\n\tprompt: DirtyCheckoutPrompt,\n\tsettingsManager: SettingsManager,\n): Promise<DirtyCheckoutChoice> {\n\tconst option = await promptStartupSelector(\n\t\t`This checkout differs from the session's snapshot ${prompt.snapshotId.slice(0, 12)}\\n${prompt.checkout}\\n\\nrecorded in\\n${prompt.recordedRoot}`,\n\t\tDIRTY_CHECKOUT_OPTIONS.map(([label]) => label),\n\t\tsettingsManager,\n\t);\n\treturn DIRTY_CHECKOUT_OPTIONS.find(([label]) => label === option)?.[1] ?? \"cancel\";\n}\n\n/** The storage selection a CLI resume reads sessions from, or undefined when an SDK store instance was given. */\nexport function cliSessionStorageSelection(\n\tparsed: Args,\n\tcwd: string,\n\tsettingsManager: SettingsManager,\n\tsessionStore?: SessionStore | StorageSelection,\n): StorageSelection | undefined {\n\tconst selection = selectSessionStorage(cwd, {\n\t\tsessionStore,\n\t\tsettings: settingsManager.getSettings(),\n\t\tnoSession: parsed.noSession,\n\t\tsessionDir: parsed.sessionDir,\n\t\tsessionStorePath: parsed.sessionStorePath,\n\t\tsessionPrefix: parsed.sessionPrefix,\n\t});\n\treturn \"load\" in selection ? undefined : selection;\n}\n\n/** An id no session has, for probing storage when the resume names none. */\nconst PROBE_SESSION_ID = \"00000000-0000-7000-8000-000000000000\";\n\n/** One point read through `selection`, proving the shared storage answers before the real lookup starts. */\nasync function probeSessionStorage(\n\tcwd: string,\n\tselection: StorageSelection,\n\tagentDir: string,\n\tsessionId: string | undefined,\n): Promise<void> {\n\tconst store = await resolveSessionStore(cwd, { agentDir, sessionStore: selection });\n\ttry {\n\t\tawait store.readHeader(sessionId ?? PROBE_SESSION_ID);\n\t} finally {\n\t\tawait store.close();\n\t}\n}\n\nexport interface OpenCliSessionOptions {\n\treadonly agentDir: string;\n\t/** How long the lookup waits for shared storage to answer. Default {@link RESUME_CATALOG_TIMEOUT_MS}. */\n\treadonly catalogTimeoutMs?: number;\n\treadonly sessionStorage?: SessionStore | StorageSelection;\n\t/** Whether the project at a restored worktree is trusted, which its `.atomic/setup` hook requires. */\n\treadonly trusted: (worktree: string) => boolean;\n\treadonly chooseDirtyCheckout?: (prompt: DirtyCheckoutPrompt) => Promise<DirtyCheckoutChoice>;\n\treadonly io?: ResumePreflightIo;\n}\n\nexport interface OpenedCliSession {\n\treadonly sessionManager: SessionManager;\n\treadonly notices: readonly ResumeNotice[];\n}\n\n/**\n * Opens the session the CLI flags select and, for a resume, prepares its checkout on this machine. A resume\n * (`--session`, `--resume`, `--continue`) first checks its storage preconditions, and a lookup that cannot reach the\n * storage fails as {@link ResumeCatalogUnavailableError}. Returns \"cancelled\" when the user cancels at a prompt. When it\n * fails or is cancelled after opening the session store it selected, that store is closed again.\n */\nexport async function openCliSession(\n\tparsed: Args,\n\tcwd: string,\n\tsettingsManager: SettingsManager,\n\toptions: OpenCliSessionOptions,\n): Promise<OpenedCliSession | \"cancelled\"> {\n\tconst resuming = parsed.session !== undefined || parsed.resume === true || parsed.continue === true;\n\tconst selection = resuming\n\t\t? cliSessionStorageSelection(parsed, cwd, settingsManager, options.sessionStorage)\n\t\t: undefined;\n\tif (selection !== undefined) {\n\t\tawait checkResumeStoragePreconditions(\"cli\", [{ domain: \"sessions\", selection }], options.agentDir, options.io);\n\t}\n\tif (selection?.kind === \"adapter\") {\n\t\tawait withResumeLookupDeadline(\n\t\t\tprobeSessionStorage(cwd, selection, options.agentDir, parsed.session),\n\t\t\t{ subject: \"session\", id: parsed.session ?? null, storage: selection.module },\n\t\t\toptions.catalogTimeoutMs ?? RESUME_CATALOG_TIMEOUT_MS,\n\t\t).catch((error: unknown) => {\n\t\t\tthrow resumeLookupError(error, \"session\", parsed.session ?? null);\n\t\t});\n\t}\n\tconst sessionManager = await createSessionManager(\n\t\tparsed,\n\t\tcwd,\n\t\tundefined,\n\t\tsettingsManager,\n\t\toptions.sessionStorage,\n\t).catch((error: unknown) => {\n\t\tthrow resuming ? resumeLookupError(error, \"session\", parsed.session ?? null) : error;\n\t});\n\tconst owned = options.sessionStorage === undefined || !(\"load\" in options.sessionStorage);\n\tconst release = (failure?: unknown) =>\n\t\towned ? closeStoreAfter(sessionManager.getSessionStore(), failure) : undefined;\n\tconst prepared = await prepareSessionResume(sessionManager, {\n\t\t...sessionResumeOptions(\"cli\", cwd, options.agentDir, settingsManager, options.trusted),\n\t\tchooseDirtyCheckout: options.chooseDirtyCheckout,\n\t\tio: options.io,\n\t}).catch(async (error: unknown) => {\n\t\tawait release(error);\n\t\tthrow error;\n\t});\n\tif (prepared.status === \"cancelled\") {\n\t\tawait release();\n\t\treturn \"cancelled\";\n\t}\n\treturn { sessionManager: prepared.sessionManager, notices: prepared.notices };\n}\n\n/**\n * The resume notices print-like modes report with the startup diagnostics. Interactive mode shows them in the TUI\n * instead, so they are not reported twice.\n */\nexport function startupResumeDiagnostics(appMode: AppMode, notices: readonly ResumeNotice[]): readonly ResumeNotice[] {\n\treturn appMode === \"interactive\" ? [] : notices;\n}\n\n/**\n * Closes `store` once the work that opened it ended. After `failure`, a close failure is kept as the failure's\n * `cleanupCause` instead of replacing it; without one, it is thrown.\n */\nexport async function closeStoreAfter(store: Pick<SessionStore, \"close\">, failure?: unknown): Promise<void> {\n\ttry {\n\t\tawait store.close();\n\t} catch (cleanup) {\n\t\tif (failure === undefined) throw cleanup;\n\t\tif (failure instanceof Error)\n\t\t\tObject.defineProperty(failure, \"cleanupCause\", { value: cleanup, enumerable: false });\n\t}\n}\n\n/**\n * Whether the CLI trusts the project at a restored worktree, which its `.atomic/setup` hook requires: the\n * `--approve`/`--deny` override, else the saved decision for that path, else the default trust setting.\n */\nexport function cliResumeTrust(\n\toverride: boolean | undefined,\n\ttrustStore: Pick<ProjectTrustStore, \"get\">,\n\tdefaultTrust: DefaultProjectTrust,\n): (worktree: string) => boolean {\n\treturn (worktree) => override ?? trustStore.get(worktree) ?? defaultTrust === \"always\";\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"compaction-boundary-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/compaction-boundary-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAwC,MAAM,wBAAwB,CAAC;AACnF,OAAO,KAAK,EACX,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,KAAK,aAAa,EAAyD,MAAM,2BAA2B,CAAC;AAItH,UAAU,YAAY;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,uBAAuB,CAAC;IAC/B,IAAI,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,yBAAyB,CAAC,SAAS,CAAC,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,gFAAgF;AAChF,qBAAa,kCAAmC,SAAQ,GAAG;IAC1D,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAe;IAEpC,YAAY,MAAM,EAAE,wBAAwB,GAAG,YAAY,EAAE,SAAS,SAAI,EAezE;IAED,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAGnC;IACD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpC;IAEQ,UAAU,IAAI,IAAI,CAG1B;IAED,OAAO,CAAC,aAAa;CA2DrB;AAED,wBAAgB,6BAA6B,CAC5C,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,OAAO,EACjB,SAAS,SAAI,GACX,kCAAkC,CAsBpC"}
1
+ {"version":3,"file":"compaction-boundary-message.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/compaction-boundary-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAwC,MAAM,wBAAwB,CAAC;AACnF,OAAO,KAAK,EACX,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,KAAK,aAAa,EAGlB,MAAM,2BAA2B,CAAC;AAInC,UAAU,YAAY;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,uBAAuB,CAAC;IAC/B,IAAI,EAAE,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,yBAAyB,CAAC,SAAS,CAAC,CAAC;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,gFAAgF;AAChF,qBAAa,kCAAmC,SAAQ,GAAG;IAC1D,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAe;IAEpC,YAAY,MAAM,EAAE,wBAAwB,GAAG,YAAY,EAAE,SAAS,SAAI,EAezE;IAED,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAGnC;IACD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAEpC;IAEQ,UAAU,IAAI,IAAI,CAG1B;IAED,OAAO,CAAC,aAAa;CA2DrB;AAED,wBAAgB,6BAA6B,CAC5C,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,OAAO,EACjB,SAAS,SAAI,GACX,kCAAkC,CA2BpC"}
@@ -1,5 +1,5 @@
1
1
  import { Box, Container, MouseRegion, Spacer, Text } from "@earendil-works/pi-tui";
2
- import { SUMMARY_COMPACTION_PREFIX, VERBATIM_COMPACTION_PREFIX } from "../../../core/messages.js";
2
+ import { SUMMARY_COMPACTION_PREFIX, stripVerbatimCompactionPrefix, } from "../../../core/messages.js";
3
3
  import { theme } from "../theme/theme.js";
4
4
  import { parenthesizedKeyHint } from "./keybinding-hints.js";
5
5
  /** Renders the durable verbatim compaction boundary without markdown reflow. */
@@ -78,9 +78,13 @@ export function compactionBoundaryFromMessage(message, expanded, outputPad = 1)
78
78
  .map((block) => block.text)
79
79
  .join("\n")
80
80
  : message.content;
81
- const prefix = details.backend === "summary" ? SUMMARY_COMPACTION_PREFIX : VERBATIM_COMPACTION_PREFIX;
81
+ const text = details.backend === "summary"
82
+ ? content.startsWith(SUMMARY_COMPACTION_PREFIX)
83
+ ? content.slice(SUMMARY_COMPACTION_PREFIX.length)
84
+ : content
85
+ : stripVerbatimCompactionPrefix(content);
82
86
  const component = new CompactionBoundaryMessageComponent({
83
- text: content.startsWith(prefix) ? content.slice(prefix.length) : content,
87
+ text,
84
88
  stats: details.stats,
85
89
  rung: details.rung,
86
90
  tokensBefore: details.tokensBefore ?? details.stats.tokensBefore,