@bastani/atomic 0.9.8 → 0.9.9-alpha.2

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 (814) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/builtin/cursor/CHANGELOG.md +12 -0
  3. package/dist/builtin/cursor/package.json +3 -3
  4. package/dist/builtin/intercom/CHANGELOG.md +13 -0
  5. package/dist/builtin/intercom/package.json +3 -3
  6. package/dist/builtin/mcp/CHANGELOG.md +13 -0
  7. package/dist/builtin/mcp/package.json +4 -4
  8. package/dist/builtin/subagents/CHANGELOG.md +13 -0
  9. package/dist/builtin/subagents/package.json +5 -5
  10. package/dist/builtin/subagents/src/runs/background/async-execution-chain.ts +2 -0
  11. package/dist/builtin/subagents/src/runs/background/async-execution-common.ts +7 -1
  12. package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +2 -0
  13. package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +8 -2
  14. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +2 -0
  15. package/dist/builtin/subagents/src/runs/foreground/chain-execution-sequential-step.ts +2 -0
  16. package/dist/builtin/subagents/src/runs/foreground/execution-attempt.ts +2 -1
  17. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +2 -0
  18. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +2 -0
  19. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-resume.ts +2 -0
  20. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +2 -0
  21. package/dist/builtin/subagents/src/runs/shared/pi-args.ts +6 -0
  22. package/dist/builtin/subagents/src/shared/types-config.ts +4 -0
  23. package/dist/builtin/subagents/src/shared/types-depth.ts +29 -2
  24. package/dist/builtin/web-access/CHANGELOG.md +13 -0
  25. package/dist/builtin/web-access/package.json +3 -3
  26. package/dist/builtin/web-access/web-search-tool.ts +1 -2
  27. package/dist/builtin/workflows/CHANGELOG.md +29 -0
  28. package/dist/builtin/workflows/README.md +17 -8
  29. package/dist/builtin/workflows/builtin/goal-prompts.ts +8 -2
  30. package/dist/builtin/workflows/builtin/open-claude-design-utils.ts +26 -9
  31. package/dist/builtin/workflows/builtin/ralph-forked-prompts.ts +1 -1
  32. package/dist/builtin/workflows/builtin/ralph-reviewer-prompt.ts +8 -3
  33. package/dist/builtin/workflows/builtin/ralph-runner.ts +2 -0
  34. package/dist/builtin/workflows/builtin/shared-prompts.ts +24 -1
  35. package/dist/builtin/workflows/package.json +3 -3
  36. package/dist/builtin/workflows/src/durable/backend.ts +53 -15
  37. package/dist/builtin/workflows/src/durable/completed-catalog.ts +245 -0
  38. package/dist/builtin/workflows/src/durable/completed-inspection.ts +213 -0
  39. package/dist/builtin/workflows/src/durable/dbos-backend.ts +120 -170
  40. package/dist/builtin/workflows/src/durable/dbos-envelope.ts +84 -8
  41. package/dist/builtin/workflows/src/durable/dbos-metadata.ts +98 -0
  42. package/dist/builtin/workflows/src/durable/dbos-tombstone.ts +27 -0
  43. package/dist/builtin/workflows/src/durable/factory.ts +1 -1
  44. package/dist/builtin/workflows/src/durable/file-backend.ts +247 -241
  45. package/dist/builtin/workflows/src/durable/file-lock.ts +153 -0
  46. package/dist/builtin/workflows/src/durable/file-state.ts +104 -0
  47. package/dist/builtin/workflows/src/durable/format-version.ts +12 -0
  48. package/dist/builtin/workflows/src/durable/index.ts +12 -0
  49. package/dist/builtin/workflows/src/durable/resume-catalog.ts +16 -27
  50. package/dist/builtin/workflows/src/durable/resume-eligibility.ts +20 -0
  51. package/dist/builtin/workflows/src/durable/resume-runtime.ts +29 -29
  52. package/dist/builtin/workflows/src/durable/scoped-backend.ts +20 -3
  53. package/dist/builtin/workflows/src/durable/stage-primitive.ts +29 -8
  54. package/dist/builtin/workflows/src/durable/types.ts +3 -0
  55. package/dist/builtin/workflows/src/engine/primitives/task.ts +1 -0
  56. package/dist/builtin/workflows/src/engine/run.ts +14 -14
  57. package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +39 -9
  58. package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +10 -0
  59. package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +133 -0
  60. package/dist/builtin/workflows/src/extension/runtime.ts +15 -40
  61. package/dist/builtin/workflows/src/extension/wiring.ts +9 -6
  62. package/dist/builtin/workflows/src/extension/workflow-durable-resume-command.ts +226 -0
  63. package/dist/builtin/workflows/src/extension/workflow-prompts.ts +1 -0
  64. package/dist/builtin/workflows/src/extension/workflow-run-control-command.ts +66 -112
  65. package/dist/builtin/workflows/src/extension/workflow-schema.ts +5 -5
  66. package/dist/builtin/workflows/src/extension/workflow-tool-control.ts +16 -1
  67. package/dist/builtin/workflows/src/runs/foreground/executor-direct-helpers.ts +50 -43
  68. package/dist/builtin/workflows/src/runs/foreground/executor-direct-output.ts +91 -0
  69. package/dist/builtin/workflows/src/runs/foreground/executor-direct.ts +95 -46
  70. package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +3 -1
  71. package/dist/builtin/workflows/src/runs/foreground/executor-task-prompts.ts +1 -1
  72. package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +3 -0
  73. package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +1 -1
  74. package/dist/builtin/workflows/src/runs/foreground/stage-runner-options.ts +36 -7
  75. package/dist/builtin/workflows/src/runs/shared/worktree-cache-lifecycle.ts +25 -0
  76. package/dist/builtin/workflows/src/runs/shared/worktree-cwd.ts +103 -0
  77. package/dist/builtin/workflows/src/runs/shared/worktree-generation.ts +57 -0
  78. package/dist/builtin/workflows/src/runs/shared/worktree-git.ts +134 -8
  79. package/dist/builtin/workflows/src/runs/shared/worktree.ts +2 -0
  80. package/dist/builtin/workflows/src/shared/resumable-workflow-notices.ts +43 -0
  81. package/dist/builtin/workflows/src/shared/serializable.ts +1 -1
  82. package/dist/builtin/workflows/src/shared/timing.ts +4 -0
  83. package/dist/builtin/workflows/src/shared/types.ts +5 -3
  84. package/dist/builtin/workflows/src/tui/graph-view-constants.ts +1 -0
  85. package/dist/builtin/workflows/src/tui/graph-view-input.ts +24 -14
  86. package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +43 -13
  87. package/dist/bun/cli.d.ts.map +1 -1
  88. package/dist/bun/internal-intercom-broker.d.ts.map +1 -1
  89. package/dist/bun/register-bedrock.d.ts.map +1 -1
  90. package/dist/bun/restore-sandbox-env.d.ts.map +1 -1
  91. package/dist/bun/split-loader.d.ts.map +1 -1
  92. package/dist/cli/args.d.ts.map +1 -1
  93. package/dist/cli/config-selector.d.ts.map +1 -1
  94. package/dist/cli/file-processor.d.ts.map +1 -1
  95. package/dist/cli/initial-message.d.ts.map +1 -1
  96. package/dist/cli/list-models.d.ts.map +1 -1
  97. package/dist/cli/project-trust.d.ts.map +1 -1
  98. package/dist/cli/session-picker.d.ts.map +1 -1
  99. package/dist/cli/startup-ui.d.ts.map +1 -1
  100. package/dist/cli.d.ts.map +1 -1
  101. package/dist/config-self-update.d.ts.map +1 -1
  102. package/dist/config.d.ts.map +1 -1
  103. package/dist/core/agent-session-accessors.d.ts.map +1 -1
  104. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  105. package/dist/core/agent-session-auto-compaction.js +5 -7
  106. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  107. package/dist/core/agent-session-bash.d.ts.map +1 -1
  108. package/dist/core/agent-session-compaction.d.ts +6 -34
  109. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  110. package/dist/core/agent-session-compaction.js +95 -233
  111. package/dist/core/agent-session-compaction.js.map +1 -1
  112. package/dist/core/agent-session-events.d.ts.map +1 -1
  113. package/dist/core/agent-session-export.d.ts.map +1 -1
  114. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  115. package/dist/core/agent-session-message-queue.d.ts +0 -4
  116. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  117. package/dist/core/agent-session-message-queue.js +1 -5
  118. package/dist/core/agent-session-message-queue.js.map +1 -1
  119. package/dist/core/agent-session-methods.d.ts +5 -6
  120. package/dist/core/agent-session-methods.d.ts.map +1 -1
  121. package/dist/core/agent-session-methods.js.map +1 -1
  122. package/dist/core/agent-session-models.d.ts.map +1 -1
  123. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  124. package/dist/core/agent-session-retry.d.ts.map +1 -1
  125. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  126. package/dist/core/agent-session-services.d.ts.map +1 -1
  127. package/dist/core/agent-session-skill-block.d.ts.map +1 -1
  128. package/dist/core/agent-session-state.d.ts.map +1 -1
  129. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  130. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  131. package/dist/core/agent-session-tree.d.ts.map +1 -1
  132. package/dist/core/agent-session-types.d.ts +2 -12
  133. package/dist/core/agent-session-types.d.ts.map +1 -1
  134. package/dist/core/agent-session-types.js.map +1 -1
  135. package/dist/core/agent-session.d.ts.map +1 -1
  136. package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
  137. package/dist/core/async/format.d.ts.map +1 -1
  138. package/dist/core/async/job-manager.d.ts.map +1 -1
  139. package/dist/core/async/session-manager.d.ts.map +1 -1
  140. package/dist/core/async/types.d.ts.map +1 -1
  141. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  142. package/dist/core/auth-guidance.d.ts.map +1 -1
  143. package/dist/core/auth-storage-backends.d.ts.map +1 -1
  144. package/dist/core/auth-storage.d.ts +4 -0
  145. package/dist/core/auth-storage.d.ts.map +1 -1
  146. package/dist/core/bash-executor.d.ts.map +1 -1
  147. package/dist/core/builtin-packages.d.ts.map +1 -1
  148. package/dist/core/codex-fast-mode.d.ts.map +1 -1
  149. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  150. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  151. package/dist/core/compaction/branch-summarization.js +1 -2
  152. package/dist/core/compaction/branch-summarization.js.map +1 -1
  153. package/dist/core/compaction/compaction-boundary.d.ts +9 -0
  154. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -0
  155. package/dist/core/compaction/compaction-boundary.js +115 -0
  156. package/dist/core/compaction/compaction-boundary.js.map +1 -0
  157. package/dist/core/compaction/compaction-parameters.d.ts +5 -0
  158. package/dist/core/compaction/compaction-parameters.d.ts.map +1 -0
  159. package/dist/core/compaction/compaction-parameters.js +27 -0
  160. package/dist/core/compaction/compaction-parameters.js.map +1 -0
  161. package/dist/core/compaction/compaction-runner.d.ts +14 -0
  162. package/dist/core/compaction/compaction-runner.d.ts.map +1 -0
  163. package/dist/core/compaction/compaction-runner.js +29 -0
  164. package/dist/core/compaction/compaction-runner.js.map +1 -0
  165. package/dist/core/compaction/compaction-types.d.ts +79 -0
  166. package/dist/core/compaction/compaction-types.d.ts.map +1 -0
  167. package/dist/core/compaction/compaction-types.js +6 -0
  168. package/dist/core/compaction/compaction-types.js.map +1 -0
  169. package/dist/core/compaction/compaction.d.ts.map +1 -1
  170. package/dist/core/compaction/deleted-ranges.d.ts +6 -0
  171. package/dist/core/compaction/deleted-ranges.d.ts.map +1 -0
  172. package/dist/core/compaction/deleted-ranges.js +134 -0
  173. package/dist/core/compaction/deleted-ranges.js.map +1 -0
  174. package/dist/core/compaction/index.d.ts +7 -1
  175. package/dist/core/compaction/index.d.ts.map +1 -1
  176. package/dist/core/compaction/index.js +7 -1
  177. package/dist/core/compaction/index.js.map +1 -1
  178. package/dist/core/compaction/range-planner.d.ts +21 -0
  179. package/dist/core/compaction/range-planner.d.ts.map +1 -0
  180. package/dist/core/compaction/range-planner.js +145 -0
  181. package/dist/core/compaction/range-planner.js.map +1 -0
  182. package/dist/core/compaction/transcript-serialization.d.ts +11 -0
  183. package/dist/core/compaction/transcript-serialization.d.ts.map +1 -0
  184. package/dist/core/compaction/transcript-serialization.js +104 -0
  185. package/dist/core/compaction/transcript-serialization.js.map +1 -0
  186. package/dist/core/compaction/utils.d.ts.map +1 -1
  187. package/dist/core/context-window.d.ts.map +1 -1
  188. package/dist/core/copilot-anthropic-sse-repair.d.ts.map +1 -1
  189. package/dist/core/copilot-errors.d.ts.map +1 -1
  190. package/dist/core/copilot-gemini-payload-sanitizer.d.ts.map +1 -1
  191. package/dist/core/copilot-gemini-reasoning.d.ts.map +1 -1
  192. package/dist/core/copilot-gemini-tool-arguments.d.ts.map +1 -1
  193. package/dist/core/copilot-hosts.d.ts.map +1 -1
  194. package/dist/core/copilot-model-catalog.d.ts.map +1 -1
  195. package/dist/core/copilot-model-static-fallbacks.d.ts.map +1 -1
  196. package/dist/core/copilot-model-synthesis.d.ts.map +1 -1
  197. package/dist/core/defaults.d.ts.map +1 -1
  198. package/dist/core/diagnostics.d.ts.map +1 -1
  199. package/dist/core/event-bus.d.ts.map +1 -1
  200. package/dist/core/exec.d.ts.map +1 -1
  201. package/dist/core/experimental.d.ts.map +1 -1
  202. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  203. package/dist/core/export-html/index.d.ts.map +1 -1
  204. package/dist/core/export-html/template-script.d.ts.map +1 -1
  205. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  206. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  207. package/dist/core/extensions/api-types.d.ts.map +1 -1
  208. package/dist/core/extensions/command-types.d.ts.map +1 -1
  209. package/dist/core/extensions/context-types.d.ts +2 -2
  210. package/dist/core/extensions/context-types.d.ts.map +1 -1
  211. package/dist/core/extensions/context-types.js.map +1 -1
  212. package/dist/core/extensions/event-results.d.ts +2 -2
  213. package/dist/core/extensions/event-results.d.ts.map +1 -1
  214. package/dist/core/extensions/event-results.js.map +1 -1
  215. package/dist/core/extensions/event-types.d.ts.map +1 -1
  216. package/dist/core/extensions/index.d.ts.map +1 -1
  217. package/dist/core/extensions/loader-api.d.ts.map +1 -1
  218. package/dist/core/extensions/loader-core.d.ts.map +1 -1
  219. package/dist/core/extensions/loader-discovery.d.ts.map +1 -1
  220. package/dist/core/extensions/loader-resources.d.ts.map +1 -1
  221. package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
  222. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  223. package/dist/core/extensions/loader.d.ts.map +1 -1
  224. package/dist/core/extensions/message-types.d.ts.map +1 -1
  225. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  226. package/dist/core/extensions/reactive-widget.d.ts.map +1 -1
  227. package/dist/core/extensions/runner-context.d.ts.map +1 -1
  228. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  229. package/dist/core/extensions/runner-handlers.d.ts.map +1 -1
  230. package/dist/core/extensions/runner-project-trust.d.ts.map +1 -1
  231. package/dist/core/extensions/runner-registries.d.ts.map +1 -1
  232. package/dist/core/extensions/runner-shortcuts.d.ts.map +1 -1
  233. package/dist/core/extensions/runner-ui.d.ts.map +1 -1
  234. package/dist/core/extensions/runner.d.ts.map +1 -1
  235. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  236. package/dist/core/extensions/session-events.d.ts +7 -7
  237. package/dist/core/extensions/session-events.d.ts.map +1 -1
  238. package/dist/core/extensions/session-events.js.map +1 -1
  239. package/dist/core/extensions/tool-events.d.ts.map +1 -1
  240. package/dist/core/extensions/tool-types.d.ts.map +1 -1
  241. package/dist/core/extensions/types.d.ts.map +1 -1
  242. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  243. package/dist/core/extensions/wrapper.d.ts.map +1 -1
  244. package/dist/core/flattened-tool-arguments.d.ts.map +1 -1
  245. package/dist/core/footer-data-provider.d.ts.map +1 -1
  246. package/dist/core/http-dispatcher.d.ts.map +1 -1
  247. package/dist/core/index.d.ts +1 -1
  248. package/dist/core/index.d.ts.map +1 -1
  249. package/dist/core/index.js.map +1 -1
  250. package/dist/core/keybindings.d.ts.map +1 -1
  251. package/dist/core/messages.d.ts +4 -0
  252. package/dist/core/messages.d.ts.map +1 -1
  253. package/dist/core/messages.js +11 -0
  254. package/dist/core/messages.js.map +1 -1
  255. package/dist/core/model-registry-auth.d.ts.map +1 -1
  256. package/dist/core/model-registry-builtins.d.ts.map +1 -1
  257. package/dist/core/model-registry-builtins.js.map +1 -1
  258. package/dist/core/model-registry-custom-loader.d.ts.map +1 -1
  259. package/dist/core/model-registry-custom-loader.js.map +1 -1
  260. package/dist/core/model-registry-dynamic.d.ts.map +1 -1
  261. package/dist/core/model-registry-loader.d.ts.map +1 -1
  262. package/dist/core/model-registry-schemas.d.ts +65 -13
  263. package/dist/core/model-registry-schemas.d.ts.map +1 -1
  264. package/dist/core/model-registry-schemas.js +5 -1
  265. package/dist/core/model-registry-schemas.js.map +1 -1
  266. package/dist/core/model-registry-types.d.ts.map +1 -1
  267. package/dist/core/model-registry.d.ts.map +1 -1
  268. package/dist/core/model-resolver-cli.d.ts.map +1 -1
  269. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  270. package/dist/core/model-resolver-initial.d.ts.map +1 -1
  271. package/dist/core/model-resolver-patterns.d.ts.map +1 -1
  272. package/dist/core/model-resolver-scope.d.ts.map +1 -1
  273. package/dist/core/model-resolver-types.d.ts.map +1 -1
  274. package/dist/core/model-resolver.d.ts.map +1 -1
  275. package/dist/core/openai-responses-payload-sanitizer.d.ts.map +1 -1
  276. package/dist/core/output-guard.d.ts.map +1 -1
  277. package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
  278. package/dist/core/package-manager-command.d.ts.map +1 -1
  279. package/dist/core/package-manager-constants.d.ts.map +1 -1
  280. package/dist/core/package-manager-env.d.ts.map +1 -1
  281. package/dist/core/package-manager-git.d.ts.map +1 -1
  282. package/dist/core/package-manager-manifest.d.ts.map +1 -1
  283. package/dist/core/package-manager-npm.d.ts.map +1 -1
  284. package/dist/core/package-manager-operations.d.ts.map +1 -1
  285. package/dist/core/package-manager-paths.d.ts.map +1 -1
  286. package/dist/core/package-manager-progress.d.ts.map +1 -1
  287. package/dist/core/package-manager-resolver.d.ts.map +1 -1
  288. package/dist/core/package-manager-resource-accumulator.d.ts.map +1 -1
  289. package/dist/core/package-manager-resource-collector.d.ts.map +1 -1
  290. package/dist/core/package-manager-resource-files.d.ts.map +1 -1
  291. package/dist/core/package-manager-resource-patterns.d.ts.map +1 -1
  292. package/dist/core/package-manager-settings.d.ts.map +1 -1
  293. package/dist/core/package-manager-source.d.ts.map +1 -1
  294. package/dist/core/package-manager-types.d.ts.map +1 -1
  295. package/dist/core/package-manager.d.ts.map +1 -1
  296. package/dist/core/project-trust.d.ts.map +1 -1
  297. package/dist/core/prompt-templates-async.d.ts.map +1 -1
  298. package/dist/core/prompt-templates.d.ts.map +1 -1
  299. package/dist/core/provider-attribution.d.ts.map +1 -1
  300. package/dist/core/provider-context-usage.d.ts.map +1 -1
  301. package/dist/core/provider-context-usage.js +1 -2
  302. package/dist/core/provider-context-usage.js.map +1 -1
  303. package/dist/core/provider-display-names.d.ts.map +1 -1
  304. package/dist/core/resolve-config-value.d.ts.map +1 -1
  305. package/dist/core/resource-loader-assets.d.ts.map +1 -1
  306. package/dist/core/resource-loader-context-files.d.ts.map +1 -1
  307. package/dist/core/resource-loader-core.d.ts.map +1 -1
  308. package/dist/core/resource-loader-discovery.d.ts.map +1 -1
  309. package/dist/core/resource-loader-extensions.d.ts.map +1 -1
  310. package/dist/core/resource-loader-helpers.d.ts.map +1 -1
  311. package/dist/core/resource-loader-internals.d.ts.map +1 -1
  312. package/dist/core/resource-loader-package-resources.d.ts.map +1 -1
  313. package/dist/core/resource-loader-paths.d.ts.map +1 -1
  314. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  315. package/dist/core/resource-loader-source-info.d.ts.map +1 -1
  316. package/dist/core/resource-loader-types.d.ts.map +1 -1
  317. package/dist/core/resource-loader.d.ts.map +1 -1
  318. package/dist/core/sdk-exports.d.ts.map +1 -1
  319. package/dist/core/sdk-types.d.ts.map +1 -1
  320. package/dist/core/sdk.d.ts.map +1 -1
  321. package/dist/core/session-cwd.d.ts.map +1 -1
  322. package/dist/core/session-entry-normalization.d.ts.map +1 -1
  323. package/dist/core/session-manager-archive.d.ts +2 -1
  324. package/dist/core/session-manager-archive.d.ts.map +1 -1
  325. package/dist/core/session-manager-archive.js +2 -2
  326. package/dist/core/session-manager-archive.js.map +1 -1
  327. package/dist/core/session-manager-classification.d.ts +9 -0
  328. package/dist/core/session-manager-classification.d.ts.map +1 -0
  329. package/dist/core/session-manager-classification.js +37 -0
  330. package/dist/core/session-manager-classification.js.map +1 -0
  331. package/dist/core/session-manager-core.d.ts +4 -4
  332. package/dist/core/session-manager-core.d.ts.map +1 -1
  333. package/dist/core/session-manager-core.js +13 -8
  334. package/dist/core/session-manager-core.js.map +1 -1
  335. package/dist/core/session-manager-entries.d.ts +4 -3
  336. package/dist/core/session-manager-entries.d.ts.map +1 -1
  337. package/dist/core/session-manager-entries.js +12 -10
  338. package/dist/core/session-manager-entries.js.map +1 -1
  339. package/dist/core/session-manager-history.d.ts +6 -23
  340. package/dist/core/session-manager-history.d.ts.map +1 -1
  341. package/dist/core/session-manager-history.js +23 -256
  342. package/dist/core/session-manager-history.js.map +1 -1
  343. package/dist/core/session-manager-list.d.ts.map +1 -1
  344. package/dist/core/session-manager-list.js +3 -3
  345. package/dist/core/session-manager-list.js.map +1 -1
  346. package/dist/core/session-manager-migrations.d.ts.map +1 -1
  347. package/dist/core/session-manager-paths.d.ts.map +1 -1
  348. package/dist/core/session-manager-storage.d.ts +1 -1
  349. package/dist/core/session-manager-storage.d.ts.map +1 -1
  350. package/dist/core/session-manager-storage.js +3 -2
  351. package/dist/core/session-manager-storage.js.map +1 -1
  352. package/dist/core/session-manager-types.d.ts +14 -15
  353. package/dist/core/session-manager-types.d.ts.map +1 -1
  354. package/dist/core/session-manager-types.js.map +1 -1
  355. package/dist/core/session-manager-validation.d.ts.map +1 -1
  356. package/dist/core/session-manager.d.ts +3 -2
  357. package/dist/core/session-manager.d.ts.map +1 -1
  358. package/dist/core/session-manager.js +1 -1
  359. package/dist/core/session-manager.js.map +1 -1
  360. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  361. package/dist/core/settings-manager-core.d.ts.map +1 -1
  362. package/dist/core/settings-manager-internals.d.ts.map +1 -1
  363. package/dist/core/settings-manager-resource-accessors.d.ts.map +1 -1
  364. package/dist/core/settings-manager-ui-accessors.d.ts.map +1 -1
  365. package/dist/core/settings-manager.d.ts.map +1 -1
  366. package/dist/core/settings-merge.d.ts.map +1 -1
  367. package/dist/core/settings-storage.d.ts.map +1 -1
  368. package/dist/core/settings-types.d.ts.map +1 -1
  369. package/dist/core/skills-async.d.ts.map +1 -1
  370. package/dist/core/skills.d.ts.map +1 -1
  371. package/dist/core/slash-commands.d.ts.map +1 -1
  372. package/dist/core/slash-commands.js +1 -1
  373. package/dist/core/slash-commands.js.map +1 -1
  374. package/dist/core/source-info.d.ts.map +1 -1
  375. package/dist/core/system-prompt.d.ts.map +1 -1
  376. package/dist/core/telemetry.d.ts.map +1 -1
  377. package/dist/core/thinking-blocks.d.ts.map +1 -1
  378. package/dist/core/timings.d.ts.map +1 -1
  379. package/dist/core/tools/artifact-protocol.d.ts.map +1 -1
  380. package/dist/core/tools/artifacts.d.ts.map +1 -1
  381. package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
  382. package/dist/core/tools/ask-user-question/config.d.ts.map +1 -1
  383. package/dist/core/tools/ask-user-question/index.d.ts.map +1 -1
  384. package/dist/core/tools/ask-user-question/state/build-questionnaire.d.ts.map +1 -1
  385. package/dist/core/tools/ask-user-question/state/inline-input.d.ts.map +1 -1
  386. package/dist/core/tools/ask-user-question/state/key-router.d.ts.map +1 -1
  387. package/dist/core/tools/ask-user-question/state/questionnaire-session.d.ts.map +1 -1
  388. package/dist/core/tools/ask-user-question/state/row-intent.d.ts.map +1 -1
  389. package/dist/core/tools/ask-user-question/state/selectors/contract.d.ts.map +1 -1
  390. package/dist/core/tools/ask-user-question/state/selectors/derivations.d.ts.map +1 -1
  391. package/dist/core/tools/ask-user-question/state/selectors/focus.d.ts.map +1 -1
  392. package/dist/core/tools/ask-user-question/state/selectors/projections.d.ts.map +1 -1
  393. package/dist/core/tools/ask-user-question/state/state-reducer.d.ts.map +1 -1
  394. package/dist/core/tools/ask-user-question/state/state.d.ts.map +1 -1
  395. package/dist/core/tools/ask-user-question/tool/format-answer.d.ts.map +1 -1
  396. package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts.map +1 -1
  397. package/dist/core/tools/ask-user-question/tool/types.d.ts.map +1 -1
  398. package/dist/core/tools/ask-user-question/tool/validate-questionnaire.d.ts.map +1 -1
  399. package/dist/core/tools/ask-user-question/view/body-residual-spacer.d.ts.map +1 -1
  400. package/dist/core/tools/ask-user-question/view/component-binding.d.ts.map +1 -1
  401. package/dist/core/tools/ask-user-question/view/components/chat-row-view.d.ts.map +1 -1
  402. package/dist/core/tools/ask-user-question/view/components/multi-select-view.d.ts.map +1 -1
  403. package/dist/core/tools/ask-user-question/view/components/option-list-view.d.ts.map +1 -1
  404. package/dist/core/tools/ask-user-question/view/components/preview/markdown-content-cache.d.ts.map +1 -1
  405. package/dist/core/tools/ask-user-question/view/components/preview/preview-block-renderer.d.ts.map +1 -1
  406. package/dist/core/tools/ask-user-question/view/components/preview/preview-box-renderer.d.ts.map +1 -1
  407. package/dist/core/tools/ask-user-question/view/components/preview/preview-layout-decider.d.ts.map +1 -1
  408. package/dist/core/tools/ask-user-question/view/components/preview/preview-pane.d.ts.map +1 -1
  409. package/dist/core/tools/ask-user-question/view/components/submit-picker.d.ts.map +1 -1
  410. package/dist/core/tools/ask-user-question/view/components/tab-bar.d.ts.map +1 -1
  411. package/dist/core/tools/ask-user-question/view/components/wrapping-select.d.ts.map +1 -1
  412. package/dist/core/tools/ask-user-question/view/dialog-builder.d.ts.map +1 -1
  413. package/dist/core/tools/ask-user-question/view/props-adapter.d.ts.map +1 -1
  414. package/dist/core/tools/ask-user-question/view/stateful-view.d.ts.map +1 -1
  415. package/dist/core/tools/ask-user-question/view/tab-components.d.ts.map +1 -1
  416. package/dist/core/tools/ask-user-question/view/tab-content-strategy.d.ts.map +1 -1
  417. package/dist/core/tools/bash-async-execution.d.ts.map +1 -1
  418. package/dist/core/tools/bash-async-jobs.d.ts.map +1 -1
  419. package/dist/core/tools/bash-async-output.d.ts.map +1 -1
  420. package/dist/core/tools/bash-interceptor.d.ts.map +1 -1
  421. package/dist/core/tools/bash-leading-cd.d.ts.map +1 -1
  422. package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
  423. package/dist/core/tools/bash.d.ts.map +1 -1
  424. package/dist/core/tools/block-resolver.d.ts.map +1 -1
  425. package/dist/core/tools/conflict-registry.d.ts.map +1 -1
  426. package/dist/core/tools/directory-tree.d.ts.map +1 -1
  427. package/dist/core/tools/edit-diff-preserve.d.ts.map +1 -1
  428. package/dist/core/tools/edit-diff.d.ts.map +1 -1
  429. package/dist/core/tools/edit.d.ts.map +1 -1
  430. package/dist/core/tools/fetch-url.d.ts.map +1 -1
  431. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  432. package/dist/core/tools/find.d.ts.map +1 -1
  433. package/dist/core/tools/glob-path-utils.d.ts.map +1 -1
  434. package/dist/core/tools/grep.d.ts.map +1 -1
  435. package/dist/core/tools/hashline-engine/apply.d.ts.map +1 -1
  436. package/dist/core/tools/hashline-engine/block.d.ts.map +1 -1
  437. package/dist/core/tools/hashline-engine/diff-preview.d.ts.map +1 -1
  438. package/dist/core/tools/hashline-engine/format.d.ts.map +1 -1
  439. package/dist/core/tools/hashline-engine/fs.d.ts.map +1 -1
  440. package/dist/core/tools/hashline-engine/index.d.ts.map +1 -1
  441. package/dist/core/tools/hashline-engine/input.d.ts.map +1 -1
  442. package/dist/core/tools/hashline-engine/messages.d.ts.map +1 -1
  443. package/dist/core/tools/hashline-engine/mismatch.d.ts.map +1 -1
  444. package/dist/core/tools/hashline-engine/normalize.d.ts.map +1 -1
  445. package/dist/core/tools/hashline-engine/parser.d.ts.map +1 -1
  446. package/dist/core/tools/hashline-engine/patcher.d.ts.map +1 -1
  447. package/dist/core/tools/hashline-engine/prefixes.d.ts.map +1 -1
  448. package/dist/core/tools/hashline-engine/recovery.d.ts.map +1 -1
  449. package/dist/core/tools/hashline-engine/snapshots.d.ts.map +1 -1
  450. package/dist/core/tools/hashline-engine/stream.d.ts.map +1 -1
  451. package/dist/core/tools/hashline-engine/tokenizer.d.ts.map +1 -1
  452. package/dist/core/tools/hashline-engine/types.d.ts.map +1 -1
  453. package/dist/core/tools/hashline.d.ts.map +1 -1
  454. package/dist/core/tools/index.d.ts.map +1 -1
  455. package/dist/core/tools/ls.d.ts.map +1 -1
  456. package/dist/core/tools/notebook.d.ts.map +1 -1
  457. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  458. package/dist/core/tools/oversized-tool-result.d.ts.map +1 -1
  459. package/dist/core/tools/path-utils.d.ts.map +1 -1
  460. package/dist/core/tools/read-document-extract.d.ts.map +1 -1
  461. package/dist/core/tools/read-selectors.d.ts.map +1 -1
  462. package/dist/core/tools/read-url.d.ts.map +1 -1
  463. package/dist/core/tools/read.d.ts.map +1 -1
  464. package/dist/core/tools/render-utils.d.ts.map +1 -1
  465. package/dist/core/tools/resource-selectors.d.ts.map +1 -1
  466. package/dist/core/tools/search-details.d.ts.map +1 -1
  467. package/dist/core/tools/search-line-ranges.d.ts.map +1 -1
  468. package/dist/core/tools/search-native.d.ts.map +1 -1
  469. package/dist/core/tools/search.d.ts.map +1 -1
  470. package/dist/core/tools/structured-output.d.ts.map +1 -1
  471. package/dist/core/tools/todos-execute.d.ts.map +1 -1
  472. package/dist/core/tools/todos-locks.d.ts.map +1 -1
  473. package/dist/core/tools/todos-model.d.ts.map +1 -1
  474. package/dist/core/tools/todos-mutations.d.ts.map +1 -1
  475. package/dist/core/tools/todos-paths.d.ts.map +1 -1
  476. package/dist/core/tools/todos-render.d.ts.map +1 -1
  477. package/dist/core/tools/todos-storage.d.ts.map +1 -1
  478. package/dist/core/tools/todos-types.d.ts.map +1 -1
  479. package/dist/core/tools/todos-types.js +1 -1
  480. package/dist/core/tools/todos-types.js.map +1 -1
  481. package/dist/core/tools/todos.d.ts.map +1 -1
  482. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  483. package/dist/core/tools/tool-definition-wrapper.js +6 -2
  484. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  485. package/dist/core/tools/tool-limits.d.ts.map +1 -1
  486. package/dist/core/tools/truncate.d.ts.map +1 -1
  487. package/dist/core/tools/url-ip-guards.d.ts.map +1 -1
  488. package/dist/core/tools/write.d.ts.map +1 -1
  489. package/dist/core/trust-manager.d.ts.map +1 -1
  490. package/dist/core/typebox-compat.d.ts +12 -0
  491. package/dist/core/typebox-compat.d.ts.map +1 -0
  492. package/dist/core/typebox-compat.js +10 -0
  493. package/dist/core/typebox-compat.js.map +1 -0
  494. package/dist/index-extensions.d.ts.map +1 -1
  495. package/dist/index.d.ts +4 -2
  496. package/dist/index.d.ts.map +1 -1
  497. package/dist/index.js +3 -1
  498. package/dist/index.js.map +1 -1
  499. package/dist/main-app-mode.d.ts.map +1 -1
  500. package/dist/main-deferred-startup.d.ts.map +1 -1
  501. package/dist/main-early-input.d.ts.map +1 -1
  502. package/dist/main-session-options.d.ts.map +1 -1
  503. package/dist/main-session.d.ts +1 -0
  504. package/dist/main-session.d.ts.map +1 -1
  505. package/dist/main-session.js +7 -0
  506. package/dist/main-session.js.map +1 -1
  507. package/dist/main-stdio.d.ts.map +1 -1
  508. package/dist/main.d.ts.map +1 -1
  509. package/dist/main.js +2 -2
  510. package/dist/main.js.map +1 -1
  511. package/dist/migrations-config-values.d.ts.map +1 -1
  512. package/dist/migrations.d.ts.map +1 -1
  513. package/dist/modes/index.d.ts.map +1 -1
  514. package/dist/modes/interactive/chat-input-actions.d.ts.map +1 -1
  515. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  516. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  517. package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
  518. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  519. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  520. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  521. package/dist/modes/interactive/components/chat-message-renderer.d.ts +4 -1
  522. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  523. package/dist/modes/interactive/components/chat-message-renderer.js +12 -22
  524. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  525. package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
  526. package/dist/modes/interactive/components/chat-session-host-editor.d.ts.map +1 -1
  527. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  528. package/dist/modes/interactive/components/chat-session-host-events.js +5 -11
  529. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  530. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  531. package/dist/modes/interactive/components/chat-session-host-rendering.js +3 -0
  532. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  533. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
  534. package/dist/modes/interactive/components/chat-session-host-state.d.ts +1 -0
  535. package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
  536. package/dist/modes/interactive/components/chat-session-host-state.js +1 -0
  537. package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
  538. package/dist/modes/interactive/components/chat-session-host-terminal-cleanup.d.ts.map +1 -1
  539. package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
  540. package/dist/modes/interactive/components/chat-session-host-utils.d.ts.map +1 -1
  541. package/dist/modes/interactive/components/chat-session-host-utils.js +1 -1
  542. package/dist/modes/interactive/components/chat-session-host-utils.js.map +1 -1
  543. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  544. package/dist/modes/interactive/components/chat-session-host.js +1 -0
  545. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  546. package/dist/modes/interactive/components/chat-transcript.d.ts.map +1 -1
  547. package/dist/modes/interactive/components/compaction-boundary-message.d.ts +20 -0
  548. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -0
  549. package/dist/modes/interactive/components/compaction-boundary-message.js +48 -0
  550. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -0
  551. package/dist/modes/interactive/components/config-selector-list.d.ts.map +1 -1
  552. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  553. package/dist/modes/interactive/components/context-window-selector.d.ts.map +1 -1
  554. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  555. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  556. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  557. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  558. package/dist/modes/interactive/components/diff.d.ts.map +1 -1
  559. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  560. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  561. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  562. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  563. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  564. package/dist/modes/interactive/components/fast-mode-selector.d.ts.map +1 -1
  565. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  566. package/dist/modes/interactive/components/index.d.ts +1 -1
  567. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  568. package/dist/modes/interactive/components/index.js +1 -1
  569. package/dist/modes/interactive/components/index.js.map +1 -1
  570. package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
  571. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  572. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  573. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  574. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  575. package/dist/modes/interactive/components/session-selector-delete.d.ts.map +1 -1
  576. package/dist/modes/interactive/components/session-selector-header.d.ts.map +1 -1
  577. package/dist/modes/interactive/components/session-selector-list.d.ts.map +1 -1
  578. package/dist/modes/interactive/components/session-selector-list.js +3 -0
  579. package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
  580. package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
  581. package/dist/modes/interactive/components/session-selector-tree.d.ts.map +1 -1
  582. package/dist/modes/interactive/components/session-selector-types.d.ts.map +1 -1
  583. package/dist/modes/interactive/components/session-selector-utils.d.ts.map +1 -1
  584. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  585. package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
  586. package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
  587. package/dist/modes/interactive/components/settings-selector-options.d.ts.map +1 -1
  588. package/dist/modes/interactive/components/settings-selector-submenus.d.ts.map +1 -1
  589. package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
  590. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  591. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  592. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  593. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  594. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  595. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  596. package/dist/modes/interactive/components/tree-selector-component.d.ts.map +1 -1
  597. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  598. package/dist/modes/interactive/components/tree-selector-help.d.ts.map +1 -1
  599. package/dist/modes/interactive/components/tree-selector-label-input.d.ts.map +1 -1
  600. package/dist/modes/interactive/components/tree-selector-list.d.ts.map +1 -1
  601. package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
  602. package/dist/modes/interactive/components/tree-selector-types.d.ts.map +1 -1
  603. package/dist/modes/interactive/components/tree-selector-viewport.d.ts.map +1 -1
  604. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  605. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  606. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  607. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  608. package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
  609. package/dist/modes/interactive/components/working-status.d.ts.map +1 -1
  610. package/dist/modes/interactive/interactive-agent-events.d.ts.map +1 -1
  611. package/dist/modes/interactive/interactive-agent-events.js +3 -47
  612. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  613. package/dist/modes/interactive/interactive-auth-login.d.ts.map +1 -1
  614. package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
  615. package/dist/modes/interactive/interactive-autocomplete.d.ts.map +1 -1
  616. package/dist/modes/interactive/interactive-bash-compact.d.ts.map +1 -1
  617. package/dist/modes/interactive/interactive-child-ordering.d.ts.map +1 -1
  618. package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
  619. package/dist/modes/interactive/interactive-editor-actions.d.ts.map +1 -1
  620. package/dist/modes/interactive/interactive-extension-context.d.ts.map +1 -1
  621. package/dist/modes/interactive/interactive-extension-custom-ui.d.ts.map +1 -1
  622. package/dist/modes/interactive/interactive-extension-dialogs.d.ts.map +1 -1
  623. package/dist/modes/interactive/interactive-extension-runtime.d.ts.map +1 -1
  624. package/dist/modes/interactive/interactive-extension-widgets.d.ts.map +1 -1
  625. package/dist/modes/interactive/interactive-hotkeys-debug.d.ts.map +1 -1
  626. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  627. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  628. package/dist/modes/interactive/interactive-mode-deps.d.ts +2 -2
  629. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  630. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  631. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  632. package/dist/modes/interactive/interactive-mode-helpers.d.ts.map +1 -1
  633. package/dist/modes/interactive/interactive-mode-surface.d.ts +5 -3
  634. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  635. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  636. package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
  637. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  638. package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
  639. package/dist/modes/interactive/interactive-onboarding.d.ts.map +1 -1
  640. package/dist/modes/interactive/interactive-process-lifecycle.d.ts.map +1 -1
  641. package/dist/modes/interactive/interactive-queueing.d.ts.map +1 -1
  642. package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
  643. package/dist/modes/interactive/interactive-render-chat.js +21 -12
  644. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  645. package/dist/modes/interactive/interactive-resource-disclosure.d.ts.map +1 -1
  646. package/dist/modes/interactive/interactive-resource-paths.d.ts.map +1 -1
  647. package/dist/modes/interactive/interactive-resource-rendering.d.ts.map +1 -1
  648. package/dist/modes/interactive/interactive-selectors.d.ts.map +1 -1
  649. package/dist/modes/interactive/interactive-session-routing.d.ts.map +1 -1
  650. package/dist/modes/interactive/interactive-session-runtime.d.ts.map +1 -1
  651. package/dist/modes/interactive/interactive-slash-commands.d.ts.map +1 -1
  652. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  653. package/dist/modes/interactive/model-search.d.ts.map +1 -1
  654. package/dist/modes/interactive/theme/color-utils.d.ts.map +1 -1
  655. package/dist/modes/interactive/theme/export-colors.d.ts.map +1 -1
  656. package/dist/modes/interactive/theme/global-theme.d.ts.map +1 -1
  657. package/dist/modes/interactive/theme/terminal-detection.d.ts.map +1 -1
  658. package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
  659. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  660. package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
  661. package/dist/modes/interactive/theme/theme-parse.d.ts.map +1 -1
  662. package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
  663. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  664. package/dist/modes/interactive/theme/tui-theme.d.ts.map +1 -1
  665. package/dist/modes/interactive/whimsical-messages.d.ts.map +1 -1
  666. package/dist/modes/print-mode.d.ts.map +1 -1
  667. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  668. package/dist/modes/rpc/rpc-client.d.ts +3 -5
  669. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  670. package/dist/modes/rpc/rpc-client.js +1 -6
  671. package/dist/modes/rpc/rpc-client.js.map +1 -1
  672. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  673. package/dist/modes/rpc/rpc-command-handler.js +0 -4
  674. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  675. package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
  676. package/dist/modes/rpc/rpc-input.d.ts.map +1 -1
  677. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  678. package/dist/modes/rpc/rpc-responses.d.ts.map +1 -1
  679. package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
  680. package/dist/modes/rpc/rpc-types.d.ts +2 -11
  681. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  682. package/dist/modes/rpc/rpc-types.js.map +1 -1
  683. package/dist/package-manager-cli-parser.d.ts.map +1 -1
  684. package/dist/package-manager-cli.d.ts.map +1 -1
  685. package/dist/rpc-entry.d.ts.map +1 -1
  686. package/dist/utils/ansi.d.ts.map +1 -1
  687. package/dist/utils/changelog.d.ts.map +1 -1
  688. package/dist/utils/child-process.d.ts.map +1 -1
  689. package/dist/utils/clipboard-image.d.ts.map +1 -1
  690. package/dist/utils/clipboard-native.d.ts.map +1 -1
  691. package/dist/utils/clipboard.d.ts.map +1 -1
  692. package/dist/utils/deprecation.d.ts.map +1 -1
  693. package/dist/utils/event-loop.d.ts.map +1 -1
  694. package/dist/utils/exif-orientation.d.ts.map +1 -1
  695. package/dist/utils/frontmatter.d.ts.map +1 -1
  696. package/dist/utils/fs-watch.d.ts.map +1 -1
  697. package/dist/utils/git-env.d.ts.map +1 -1
  698. package/dist/utils/git.d.ts.map +1 -1
  699. package/dist/utils/html.d.ts.map +1 -1
  700. package/dist/utils/image-convert.d.ts.map +1 -1
  701. package/dist/utils/image-process.d.ts.map +1 -1
  702. package/dist/utils/image-resize-core.d.ts.map +1 -1
  703. package/dist/utils/image-resize-worker.d.ts.map +1 -1
  704. package/dist/utils/image-resize.d.ts.map +1 -1
  705. package/dist/utils/json.d.ts.map +1 -1
  706. package/dist/utils/markit.d.ts.map +1 -1
  707. package/dist/utils/mime.d.ts.map +1 -1
  708. package/dist/utils/module-require.d.ts.map +1 -1
  709. package/dist/utils/open-browser.d.ts.map +1 -1
  710. package/dist/utils/paths.d.ts.map +1 -1
  711. package/dist/utils/photon.d.ts.map +1 -1
  712. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  713. package/dist/utils/shell.d.ts.map +1 -1
  714. package/dist/utils/sleep.d.ts.map +1 -1
  715. package/dist/utils/split-launcher.d.ts.map +1 -1
  716. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  717. package/dist/utils/tools-manager.d.ts.map +1 -1
  718. package/dist/utils/version-check.d.ts.map +1 -1
  719. package/dist/utils/windows-self-update.d.ts.map +1 -1
  720. package/docs/compaction.md +97 -772
  721. package/docs/custom-provider.md +7 -1
  722. package/docs/extensions.md +31 -33
  723. package/docs/json.md +2 -2
  724. package/docs/rpc.md +32 -24
  725. package/docs/sdk.md +3 -3
  726. package/docs/session-format.md +49 -30
  727. package/docs/sessions.md +5 -3
  728. package/docs/settings.md +14 -4
  729. package/docs/usage.md +1 -1
  730. package/docs/workflows.md +30 -15
  731. package/examples/extensions/README.md +3 -1
  732. package/examples/extensions/custom-compaction.ts +14 -58
  733. package/examples/extensions/handoff.ts +2 -3
  734. package/examples/extensions/subagent/schemas.ts +1 -1
  735. package/examples/extensions/tic-tac-toe.ts +1 -2
  736. package/examples/extensions/todo.ts +1 -2
  737. package/npm-shrinkwrap.json +214 -98
  738. package/package.json +12 -12
  739. package/dist/core/compaction/context-assistant-turns.d.ts +0 -42
  740. package/dist/core/compaction/context-assistant-turns.d.ts.map +0 -1
  741. package/dist/core/compaction/context-assistant-turns.js +0 -87
  742. package/dist/core/compaction/context-assistant-turns.js.map +0 -1
  743. package/dist/core/compaction/context-compaction-critical.d.ts +0 -15
  744. package/dist/core/compaction/context-compaction-critical.d.ts.map +0 -1
  745. package/dist/core/compaction/context-compaction-critical.js +0 -57
  746. package/dist/core/compaction/context-compaction-critical.js.map +0 -1
  747. package/dist/core/compaction/context-compaction-eviction-alternates.d.ts +0 -18
  748. package/dist/core/compaction/context-compaction-eviction-alternates.d.ts.map +0 -1
  749. package/dist/core/compaction/context-compaction-eviction-alternates.js +0 -186
  750. package/dist/core/compaction/context-compaction-eviction-alternates.js.map +0 -1
  751. package/dist/core/compaction/context-compaction-eviction.d.ts +0 -12
  752. package/dist/core/compaction/context-compaction-eviction.d.ts.map +0 -1
  753. package/dist/core/compaction/context-compaction-eviction.js +0 -222
  754. package/dist/core/compaction/context-compaction-eviction.js.map +0 -1
  755. package/dist/core/compaction/context-compaction-metrics.d.ts +0 -28
  756. package/dist/core/compaction/context-compaction-metrics.d.ts.map +0 -1
  757. package/dist/core/compaction/context-compaction-metrics.js +0 -107
  758. package/dist/core/compaction/context-compaction-metrics.js.map +0 -1
  759. package/dist/core/compaction/context-compaction-prompt.d.ts +0 -9
  760. package/dist/core/compaction/context-compaction-prompt.d.ts.map +0 -1
  761. package/dist/core/compaction/context-compaction-prompt.js +0 -163
  762. package/dist/core/compaction/context-compaction-prompt.js.map +0 -1
  763. package/dist/core/compaction/context-compaction-runner.d.ts +0 -11
  764. package/dist/core/compaction/context-compaction-runner.d.ts.map +0 -1
  765. package/dist/core/compaction/context-compaction-runner.js +0 -273
  766. package/dist/core/compaction/context-compaction-runner.js.map +0 -1
  767. package/dist/core/compaction/context-compaction-strategy.d.ts +0 -5
  768. package/dist/core/compaction/context-compaction-strategy.d.ts.map +0 -1
  769. package/dist/core/compaction/context-compaction-strategy.js +0 -27
  770. package/dist/core/compaction/context-compaction-strategy.js.map +0 -1
  771. package/dist/core/compaction/context-compaction-types.d.ts +0 -75
  772. package/dist/core/compaction/context-compaction-types.d.ts.map +0 -1
  773. package/dist/core/compaction/context-compaction-types.js +0 -6
  774. package/dist/core/compaction/context-compaction-types.js.map +0 -1
  775. package/dist/core/compaction/context-compaction.d.ts +0 -10
  776. package/dist/core/compaction/context-compaction.d.ts.map +0 -1
  777. package/dist/core/compaction/context-compaction.js +0 -8
  778. package/dist/core/compaction/context-compaction.js.map +0 -1
  779. package/dist/core/compaction/context-deletion-application.d.ts +0 -14
  780. package/dist/core/compaction/context-deletion-application.d.ts.map +0 -1
  781. package/dist/core/compaction/context-deletion-application.js +0 -261
  782. package/dist/core/compaction/context-deletion-application.js.map +0 -1
  783. package/dist/core/compaction/context-deletion-store.d.ts +0 -78
  784. package/dist/core/compaction/context-deletion-store.d.ts.map +0 -1
  785. package/dist/core/compaction/context-deletion-store.js +0 -162
  786. package/dist/core/compaction/context-deletion-store.js.map +0 -1
  787. package/dist/core/compaction/context-deletion-targets.d.ts +0 -43
  788. package/dist/core/compaction/context-deletion-targets.d.ts.map +0 -1
  789. package/dist/core/compaction/context-deletion-targets.js +0 -292
  790. package/dist/core/compaction/context-deletion-targets.js.map +0 -1
  791. package/dist/core/compaction/context-deletion-tool-definitions.d.ts +0 -193
  792. package/dist/core/compaction/context-deletion-tool-definitions.d.ts.map +0 -1
  793. package/dist/core/compaction/context-deletion-tool-definitions.js +0 -98
  794. package/dist/core/compaction/context-deletion-tool-definitions.js.map +0 -1
  795. package/dist/core/compaction/context-deletion-tool-helpers.d.ts +0 -19
  796. package/dist/core/compaction/context-deletion-tool-helpers.d.ts.map +0 -1
  797. package/dist/core/compaction/context-deletion-tool-helpers.js +0 -210
  798. package/dist/core/compaction/context-deletion-tool-helpers.js.map +0 -1
  799. package/dist/core/compaction/context-deletion-tools.d.ts +0 -4
  800. package/dist/core/compaction/context-deletion-tools.d.ts.map +0 -1
  801. package/dist/core/compaction/context-deletion-tools.js +0 -403
  802. package/dist/core/compaction/context-deletion-tools.js.map +0 -1
  803. package/dist/core/compaction/context-transcript-analysis.d.ts +0 -11
  804. package/dist/core/compaction/context-transcript-analysis.d.ts.map +0 -1
  805. package/dist/core/compaction/context-transcript-analysis.js +0 -228
  806. package/dist/core/compaction/context-transcript-analysis.js.map +0 -1
  807. package/dist/core/session-manager-tool-dependencies.d.ts +0 -10
  808. package/dist/core/session-manager-tool-dependencies.d.ts.map +0 -1
  809. package/dist/core/session-manager-tool-dependencies.js +0 -133
  810. package/dist/core/session-manager-tool-dependencies.js.map +0 -1
  811. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts +0 -17
  812. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts.map +0 -1
  813. package/dist/modes/interactive/components/context-compaction-summary-message.js +0 -83
  814. package/dist/modes/interactive/components/context-compaction-summary-message.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"settings-manager-resource-accessors.d.ts","sourceRoot":"","sources":["../../src/core/settings-manager-resource-accessors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEvG,UAAU,gCAAgC;IACzC,oBAAoB,IAAI,OAAO,CAAC;IAChC,wBAAwB,IAAI,MAAM,GAAG,SAAS,CAAC;IAC/C,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,YAAY,IAAI,MAAM,GAAG,SAAS,CAAC;IACnC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC7C,sBAAsB,IAAI,mBAAmB,CAAC;IAC9C,sBAAsB,CAAC,mBAAmB,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACvE,eAAe,IAAI,OAAO,CAAC;IAC3B,eA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,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACrD,aAAa,IAAI,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACrC,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5C,sBAAsB,IAAI,OAAO,CAAC;IAClC,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/C,kBAAkB,IAAI,uBAAuB,GAAG,SAAS,CAAC;CAC1D;AAED,OAAO,QAAQ,4BAA4B,CAAC,CAAC;IAC5C,UAAU,eAAgB,SAAQ,gCAAgC;KAAG;CACrE","sourcesContent":["import { SettingsManager } from \"./settings-manager-core.ts\";\nimport { settingsInternals } from \"./settings-manager-internals.ts\";\nimport type { DefaultProjectTrust, PackageSource, ThinkingBudgetsSettings } from \"./settings-types.ts\";\n\ninterface SettingsManagerResourceAccessors {\n\tgetHideThinkingBlock(): boolean;\n\tgetExternalEditorCommand(): string | undefined;\n\tsetHideThinkingBlock(hide: boolean): void;\n\tgetShellPath(): string | undefined;\n\tsetShellPath(path: string | undefined): void;\n\tgetDefaultProjectTrust(): DefaultProjectTrust;\n\tsetDefaultProjectTrust(defaultProjectTrust: DefaultProjectTrust): void;\n\tgetQuietStartup(): boolean;\n\tsetQuietStartup(quiet: boolean): void;\n\tgetShellCommandPrefix(): string | undefined;\n\tsetShellCommandPrefix(prefix: string | undefined): void;\n\tgetBashInterceptorEnabled(): boolean;\n\tsetBashInterceptorEnabled(enabled: boolean): void;\n\tgetSearchContextBefore(): number;\n\tgetSearchContextAfter(): number;\n\tgetNpmCommand(): string[] | undefined;\n\tsetNpmCommand(command: string[] | undefined): void;\n\tgetCollapseChangelog(): boolean;\n\tsetCollapseChangelog(collapse: boolean): void;\n\tgetEnableInstallTelemetry(): boolean;\n\tsetEnableInstallTelemetry(enabled: boolean): void;\n\tgetPackages(): PackageSource[];\n\tsetPackages(packages: PackageSource[]): void;\n\tsetProjectPackages(packages: PackageSource[]): void;\n\tgetExtensionPaths(): string[];\n\tsetExtensionPaths(paths: string[]): void;\n\tsetProjectExtensionPaths(paths: string[]): void;\n\tgetSkillPaths(): string[];\n\tsetSkillPaths(paths: string[]): void;\n\tsetProjectSkillPaths(paths: string[]): void;\n\tgetPromptTemplatePaths(): string[];\n\tsetPromptTemplatePaths(paths: string[]): void;\n\tsetProjectPromptTemplatePaths(paths: string[]): void;\n\tgetThemePaths(): string[];\n\tsetThemePaths(paths: string[]): void;\n\tsetProjectThemePaths(paths: string[]): void;\n\tgetEnableSkillCommands(): boolean;\n\tsetEnableSkillCommands(enabled: boolean): void;\n\tgetThinkingBudgets(): ThinkingBudgetsSettings | undefined;\n}\n\ndeclare module \"./settings-manager-core.ts\" {\n\tinterface SettingsManager extends SettingsManagerResourceAccessors {}\n}\n\nconst resourceAccessors: SettingsManagerResourceAccessors = {\n\tgetHideThinkingBlock() {\n\t\treturn settingsInternals(this).settings.hideThinkingBlock ?? false;\n\t},\n\n\tgetExternalEditorCommand() {\n\t\tconst configuredEditor = settingsInternals(this).settings.externalEditor;\n\t\tif (typeof configuredEditor === \"string\" && configuredEditor.trim() !== \"\") {\n\t\t\treturn configuredEditor;\n\t\t}\n\t\tconst environmentEditor = process.env.VISUAL || process.env.EDITOR;\n\t\tif (environmentEditor) {\n\t\t\treturn environmentEditor;\n\t\t}\n\t\treturn process.platform === \"win32\" ? \"notepad\" : \"nano\";\n\t},\n\n\tsetHideThinkingBlock(hide) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.hideThinkingBlock = hide;\n\t\tstate.markModified(\"hideThinkingBlock\");\n\t\tstate.save();\n\t},\n\n\tgetShellPath() {\n\t\treturn settingsInternals(this).settings.shellPath;\n\t},\n\n\tsetShellPath(path) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.shellPath = path;\n\t\tstate.markModified(\"shellPath\");\n\t\tstate.save();\n\t},\n\n\tgetDefaultProjectTrust() {\n\t\tconst value = settingsInternals(this).globalSettings.defaultProjectTrust;\n\t\treturn value === \"always\" || value === \"never\" ? value : \"ask\";\n\t},\n\n\tsetDefaultProjectTrust(defaultProjectTrust) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.defaultProjectTrust = defaultProjectTrust;\n\t\tstate.markModified(\"defaultProjectTrust\");\n\t\tstate.save();\n\t},\n\n\tgetQuietStartup() {\n\t\treturn settingsInternals(this).settings.quietStartup ?? false;\n\t},\n\n\tsetQuietStartup(quiet) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.quietStartup = quiet;\n\t\tstate.markModified(\"quietStartup\");\n\t\tstate.save();\n\t},\n\n\tgetShellCommandPrefix() {\n\t\treturn settingsInternals(this).settings.shellCommandPrefix;\n\t},\n\n\tsetShellCommandPrefix(prefix) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.shellCommandPrefix = prefix;\n\t\tstate.markModified(\"shellCommandPrefix\");\n\t\tstate.save();\n\t},\n\n\tgetBashInterceptorEnabled() {\n\t\treturn settingsInternals(this).settings.bashInterceptor?.enabled ?? false;\n\t},\n\n\tsetBashInterceptorEnabled(enabled) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.bashInterceptor = { ...(state.globalSettings.bashInterceptor ?? {}), enabled };\n\t\tstate.markModified(\"bashInterceptor\");\n\t\tstate.save();\n\t},\n\n\tgetSearchContextBefore() {\n\t\treturn settingsInternals(this).settings.search?.contextBefore ?? 1;\n\t},\n\n\tgetSearchContextAfter() {\n\t\treturn settingsInternals(this).settings.search?.contextAfter ?? 3;\n\t},\n\n\tgetNpmCommand() {\n\t\tconst command = settingsInternals(this).settings.npmCommand;\n\t\treturn command ? [...command] : undefined;\n\t},\n\n\tsetNpmCommand(command) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.npmCommand = command ? [...command] : undefined;\n\t\tstate.markModified(\"npmCommand\");\n\t\tstate.save();\n\t},\n\n\tgetCollapseChangelog() {\n\t\treturn settingsInternals(this).settings.collapseChangelog ?? false;\n\t},\n\n\tsetCollapseChangelog(collapse) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.collapseChangelog = collapse;\n\t\tstate.markModified(\"collapseChangelog\");\n\t\tstate.save();\n\t},\n\n\tgetEnableInstallTelemetry() {\n\t\treturn settingsInternals(this).settings.enableInstallTelemetry ?? true;\n\t},\n\n\tsetEnableInstallTelemetry(enabled) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.enableInstallTelemetry = enabled;\n\t\tstate.markModified(\"enableInstallTelemetry\");\n\t\tstate.save();\n\t},\n\n\tgetPackages() {\n\t\treturn [...(settingsInternals(this).settings.packages ?? [])];\n\t},\n\n\tsetPackages(packages) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.packages = packages;\n\t\tstate.markModified(\"packages\");\n\t\tstate.save();\n\t},\n\n\tsetProjectPackages(packages) {\n\t\tconst state = settingsInternals(this);\n\t\tconst projectSettings = structuredClone(state.projectSettings);\n\t\tprojectSettings.packages = packages;\n\t\tstate.markProjectModified(\"packages\");\n\t\tstate.saveProjectSettings(projectSettings);\n\t},\n\n\tgetExtensionPaths() {\n\t\treturn [...(settingsInternals(this).settings.extensions ?? [])];\n\t},\n\n\tsetExtensionPaths(paths) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.extensions = paths;\n\t\tstate.markModified(\"extensions\");\n\t\tstate.save();\n\t},\n\n\tsetProjectExtensionPaths(paths) {\n\t\tconst state = settingsInternals(this);\n\t\tconst projectSettings = structuredClone(state.projectSettings);\n\t\tprojectSettings.extensions = paths;\n\t\tstate.markProjectModified(\"extensions\");\n\t\tstate.saveProjectSettings(projectSettings);\n\t},\n\n\tgetSkillPaths() {\n\t\treturn [...(settingsInternals(this).settings.skills ?? [])];\n\t},\n\n\tsetSkillPaths(paths) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.skills = paths;\n\t\tstate.markModified(\"skills\");\n\t\tstate.save();\n\t},\n\n\tsetProjectSkillPaths(paths) {\n\t\tconst state = settingsInternals(this);\n\t\tconst projectSettings = structuredClone(state.projectSettings);\n\t\tprojectSettings.skills = paths;\n\t\tstate.markProjectModified(\"skills\");\n\t\tstate.saveProjectSettings(projectSettings);\n\t},\n\n\tgetPromptTemplatePaths() {\n\t\treturn [...(settingsInternals(this).settings.prompts ?? [])];\n\t},\n\n\tsetPromptTemplatePaths(paths) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.prompts = paths;\n\t\tstate.markModified(\"prompts\");\n\t\tstate.save();\n\t},\n\n\tsetProjectPromptTemplatePaths(paths) {\n\t\tconst state = settingsInternals(this);\n\t\tconst projectSettings = structuredClone(state.projectSettings);\n\t\tprojectSettings.prompts = paths;\n\t\tstate.markProjectModified(\"prompts\");\n\t\tstate.saveProjectSettings(projectSettings);\n\t},\n\n\tgetThemePaths() {\n\t\treturn [...(settingsInternals(this).settings.themes ?? [])];\n\t},\n\n\tsetThemePaths(paths) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.themes = paths;\n\t\tstate.markModified(\"themes\");\n\t\tstate.save();\n\t},\n\n\tsetProjectThemePaths(paths) {\n\t\tconst state = settingsInternals(this);\n\t\tconst projectSettings = structuredClone(state.projectSettings);\n\t\tprojectSettings.themes = paths;\n\t\tstate.markProjectModified(\"themes\");\n\t\tstate.saveProjectSettings(projectSettings);\n\t},\n\n\tgetEnableSkillCommands() {\n\t\treturn settingsInternals(this).settings.enableSkillCommands ?? true;\n\t},\n\n\tsetEnableSkillCommands(enabled) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.enableSkillCommands = enabled;\n\t\tstate.markModified(\"enableSkillCommands\");\n\t\tstate.save();\n\t},\n\n\tgetThinkingBudgets() {\n\t\treturn settingsInternals(this).settings.thinkingBudgets;\n\t},\n};\n\nObject.assign(SettingsManager.prototype, resourceAccessors);\n"]}
1
+ {"version":3,"file":"settings-manager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,MAAM,CAAC;IACpC,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,kBAAkB,IAAI,MAAM,CAAC;IAC7B,WAAW,IAAI,eAAe,CAAC;IAC/B,WAAW,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IAC7C,wBAAwB,IAAI;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACjE,wBAAwB,CAAC,QAAQ,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;CACxF;AAED,OAAO,QAAQ,4BAA4B,CAAC,CAAC;IAC5C,UAAU,eAAgB,SAAQ,0BAA0B;KAAG;CAC/D","sourcesContent":["import { ENV_CLEAR_ON_SHRINK, ENV_HARDWARE_CURSOR, getEnvValue } from \"../config.ts\";\nimport { SettingsManager } from \"./settings-manager-core.ts\";\nimport { settingsInternals } from \"./settings-manager-internals.ts\";\nimport type { WarningSettings } from \"./settings-types.ts\";\n\ninterface SettingsManagerUiAccessors {\n\tgetShowImages(): boolean;\n\tsetShowImages(show: boolean): void;\n\tgetImageWidthCells(): number;\n\tsetImageWidthCells(width: number): void;\n\tgetClearOnShrink(): boolean;\n\tsetClearOnShrink(enabled: boolean): void;\n\tgetShowTerminalProgress(): boolean;\n\tsetShowTerminalProgress(enabled: boolean): void;\n\tgetImageAutoResize(): boolean;\n\tsetImageAutoResize(enabled: boolean): void;\n\tgetBlockImages(): boolean;\n\tsetBlockImages(blocked: boolean): void;\n\tgetEnabledModels(): string[] | undefined;\n\tsetEnabledModels(patterns: string[] | undefined): void;\n\tgetDoubleEscapeAction(): \"fork\" | \"tree\" | \"none\";\n\tsetDoubleEscapeAction(action: \"fork\" | \"tree\" | \"none\"): void;\n\tgetTreeFilterMode(): \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\";\n\tsetTreeFilterMode(mode: \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\"): void;\n\tgetShowHardwareCursor(): boolean;\n\tsetShowHardwareCursor(enabled: boolean): void;\n\tgetEditorPaddingX(): number;\n\tsetEditorPaddingX(padding: number): void;\n\tgetOutputPad(): 0 | 1;\n\tsetOutputPad(padding: 0 | 1): void;\n\tgetAutocompleteMaxVisible(): number;\n\tsetAutocompleteMaxVisible(maxVisible: number): void;\n\tgetCodeBlockIndent(): string;\n\tgetWarnings(): WarningSettings;\n\tsetWarnings(warnings: WarningSettings): void;\n\tgetCodexFastModeSettings(): { chat: boolean; workflow: boolean };\n\tsetCodexFastModeSettings(settings: Partial<{ chat: boolean; workflow: boolean }>): void;\n}\n\ndeclare module \"./settings-manager-core.ts\" {\n\tinterface SettingsManager extends SettingsManagerUiAccessors {}\n}\n\nconst uiAccessors: SettingsManagerUiAccessors = {\n\tgetShowImages() {\n\t\treturn settingsInternals(this).settings.terminal?.showImages ?? true;\n\t},\n\n\tsetShowImages(show) {\n\t\tconst state = settingsInternals(this);\n\t\tif (!state.globalSettings.terminal) {\n\t\t\tstate.globalSettings.terminal = {};\n\t\t}\n\t\tstate.globalSettings.terminal.showImages = show;\n\t\tstate.markModified(\"terminal\", \"showImages\");\n\t\tstate.save();\n\t},\n\n\tgetImageWidthCells() {\n\t\tconst width = settingsInternals(this).settings.terminal?.imageWidthCells;\n\t\tif (typeof width !== \"number\" || !Number.isFinite(width)) {\n\t\t\treturn 60;\n\t\t}\n\t\treturn Math.max(1, Math.floor(width));\n\t},\n\n\tsetImageWidthCells(width) {\n\t\tconst state = settingsInternals(this);\n\t\tif (!state.globalSettings.terminal) {\n\t\t\tstate.globalSettings.terminal = {};\n\t\t}\n\t\tstate.globalSettings.terminal.imageWidthCells = Math.max(1, Math.floor(width));\n\t\tstate.markModified(\"terminal\", \"imageWidthCells\");\n\t\tstate.save();\n\t},\n\n\tgetClearOnShrink() {\n\t\t// Settings takes precedence, then env var, then default false\n\t\tconst terminal = settingsInternals(this).settings.terminal;\n\t\tif (terminal?.clearOnShrink !== undefined) {\n\t\t\treturn terminal.clearOnShrink;\n\t\t}\n\t\treturn getEnvValue(ENV_CLEAR_ON_SHRINK) === \"1\";\n\t},\n\n\tsetClearOnShrink(enabled) {\n\t\tconst state = settingsInternals(this);\n\t\tif (!state.globalSettings.terminal) {\n\t\t\tstate.globalSettings.terminal = {};\n\t\t}\n\t\tstate.globalSettings.terminal.clearOnShrink = enabled;\n\t\tstate.markModified(\"terminal\", \"clearOnShrink\");\n\t\tstate.save();\n\t},\n\n\tgetShowTerminalProgress() {\n\t\treturn settingsInternals(this).settings.terminal?.showTerminalProgress ?? false;\n\t},\n\n\tsetShowTerminalProgress(enabled) {\n\t\tconst state = settingsInternals(this);\n\t\tif (!state.globalSettings.terminal) {\n\t\t\tstate.globalSettings.terminal = {};\n\t\t}\n\t\tstate.globalSettings.terminal.showTerminalProgress = enabled;\n\t\tstate.markModified(\"terminal\", \"showTerminalProgress\");\n\t\tstate.save();\n\t},\n\n\tgetImageAutoResize() {\n\t\treturn settingsInternals(this).settings.images?.autoResize ?? true;\n\t},\n\n\tsetImageAutoResize(enabled) {\n\t\tconst state = settingsInternals(this);\n\t\tif (!state.globalSettings.images) {\n\t\t\tstate.globalSettings.images = {};\n\t\t}\n\t\tstate.globalSettings.images.autoResize = enabled;\n\t\tstate.markModified(\"images\", \"autoResize\");\n\t\tstate.save();\n\t},\n\n\tgetBlockImages() {\n\t\treturn settingsInternals(this).settings.images?.blockImages ?? false;\n\t},\n\n\tsetBlockImages(blocked) {\n\t\tconst state = settingsInternals(this);\n\t\tif (!state.globalSettings.images) {\n\t\t\tstate.globalSettings.images = {};\n\t\t}\n\t\tstate.globalSettings.images.blockImages = blocked;\n\t\tstate.markModified(\"images\", \"blockImages\");\n\t\tstate.save();\n\t},\n\n\tgetEnabledModels() {\n\t\treturn settingsInternals(this).settings.enabledModels;\n\t},\n\n\tsetEnabledModels(patterns) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.enabledModels = patterns;\n\t\tstate.markModified(\"enabledModels\");\n\t\tstate.save();\n\t},\n\n\tgetDoubleEscapeAction() {\n\t\treturn settingsInternals(this).settings.doubleEscapeAction ?? \"tree\";\n\t},\n\n\tsetDoubleEscapeAction(action) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.doubleEscapeAction = action;\n\t\tstate.markModified(\"doubleEscapeAction\");\n\t\tstate.save();\n\t},\n\n\tgetTreeFilterMode() {\n\t\tconst mode = settingsInternals(this).settings.treeFilterMode;\n\t\tconst valid = [\"default\", \"no-tools\", \"user-only\", \"labeled-only\", \"all\"];\n\t\treturn mode && valid.includes(mode) ? mode : \"default\";\n\t},\n\n\tsetTreeFilterMode(mode) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.treeFilterMode = mode;\n\t\tstate.markModified(\"treeFilterMode\");\n\t\tstate.save();\n\t},\n\n\tgetShowHardwareCursor() {\n\t\treturn settingsInternals(this).settings.showHardwareCursor ?? getEnvValue(ENV_HARDWARE_CURSOR) === \"1\";\n\t},\n\n\tsetShowHardwareCursor(enabled) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.showHardwareCursor = enabled;\n\t\tstate.markModified(\"showHardwareCursor\");\n\t\tstate.save();\n\t},\n\n\tgetEditorPaddingX() {\n\t\treturn settingsInternals(this).settings.editorPaddingX ?? 0;\n\t},\n\n\tsetEditorPaddingX(padding) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.editorPaddingX = Math.max(0, Math.min(3, Math.floor(padding)));\n\t\tstate.markModified(\"editorPaddingX\");\n\t\tstate.save();\n\t},\n\n\tgetOutputPad() {\n\t\treturn settingsInternals(this).settings.outputPad === 0 ? 0 : 1;\n\t},\n\n\tsetOutputPad(padding) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.outputPad = padding;\n\t\tstate.markModified(\"outputPad\");\n\t\tstate.save();\n\t},\n\n\tgetAutocompleteMaxVisible() {\n\t\treturn settingsInternals(this).settings.autocompleteMaxVisible ?? 5;\n\t},\n\n\tsetAutocompleteMaxVisible(maxVisible) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.autocompleteMaxVisible = Math.max(3, Math.min(20, Math.floor(maxVisible)));\n\t\tstate.markModified(\"autocompleteMaxVisible\");\n\t\tstate.save();\n\t},\n\n\tgetCodeBlockIndent() {\n\t\treturn settingsInternals(this).settings.markdown?.codeBlockIndent ?? \" \";\n\t},\n\n\tgetWarnings() {\n\t\treturn { ...(settingsInternals(this).settings.warnings ?? {}) };\n\t},\n\n\tsetWarnings(warnings) {\n\t\tconst state = settingsInternals(this);\n\t\tstate.globalSettings.warnings = { ...warnings };\n\t\tstate.markModified(\"warnings\");\n\t\tstate.save();\n\t},\n\n\tgetCodexFastModeSettings() {\n\t\tconst codexFastMode = settingsInternals(this).settings.codexFastMode;\n\t\treturn {\n\t\t\tchat: codexFastMode?.chat ?? false,\n\t\t\tworkflow: codexFastMode?.workflow ?? false,\n\t\t};\n\t},\n\n\tsetCodexFastModeSettings(settings) {\n\t\tif (settings.chat === undefined && settings.workflow === undefined) {\n\t\t\treturn;\n\t\t}\n\t\tconst state = settingsInternals(this);\n\t\tif (!state.globalSettings.codexFastMode) {\n\t\t\tstate.globalSettings.codexFastMode = {};\n\t\t}\n\t\tif (settings.chat !== undefined) {\n\t\t\tstate.globalSettings.codexFastMode.chat = settings.chat;\n\t\t\tstate.markModified(\"codexFastMode\", \"chat\");\n\t\t}\n\t\tif (settings.workflow !== undefined) {\n\t\t\tstate.globalSettings.codexFastMode.workflow = settings.workflow;\n\t\t\tstate.markModified(\"codexFastMode\", \"workflow\");\n\t\t}\n\n\t\tconst projectCodexFastMode = state.projectSettings.codexFastMode;\n\t\tconst projectOverridesChat = projectCodexFastMode?.chat !== undefined;\n\t\tconst projectOverridesWorkflow = projectCodexFastMode?.workflow !== undefined;\n\t\tlet projectModified = false;\n\t\tif ((settings.chat !== undefined && projectOverridesChat) || (settings.workflow !== undefined && projectOverridesWorkflow)) {\n\t\t\tstate.projectSettings.codexFastMode = { ...(projectCodexFastMode ?? {}) };\n\t\t\tif (settings.chat !== undefined && projectOverridesChat) {\n\t\t\t\tstate.projectSettings.codexFastMode.chat = settings.chat;\n\t\t\t\tstate.markProjectModified(\"codexFastMode\", \"chat\");\n\t\t\t\tprojectModified = true;\n\t\t\t}\n\t\t\tif (settings.workflow !== undefined && projectOverridesWorkflow) {\n\t\t\t\tstate.projectSettings.codexFastMode.workflow = settings.workflow;\n\t\t\t\tstate.markProjectModified(\"codexFastMode\", \"workflow\");\n\t\t\t\tprojectModified = true;\n\t\t\t}\n\t\t\tif (projectModified) {\n\t\t\t\tstate.saveProjectSettings(state.projectSettings);\n\t\t\t}\n\t\t}\n\n\t\tif (state.runtimeSettingsOverrides.codexFastMode) {\n\t\t\tstate.runtimeSettingsOverrides.codexFastMode = {\n\t\t\t\t...state.runtimeSettingsOverrides.codexFastMode,\n\t\t\t\t...(settings.chat !== undefined ? { chat: settings.chat } : {}),\n\t\t\t\t...(settings.workflow !== undefined ? { workflow: settings.workflow } : {}),\n\t\t\t};\n\t\t}\n\n\t\tstate.save();\n\t},\n};\n\nObject.assign(SettingsManager.prototype, uiAccessors);\n"]}
1
+ {"version":3,"file":"settings-manager-ui-accessors.d.ts","sourceRoot":"","sources":["../../src/core/settings-manager-ui-accessors.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,UAAU,0BAA0B;IACnC,aAAa,IAAI,OAAO,CAAC;IACzB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,kBAAkB,IAAI,MAAM,CAAC;IAC7B,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,gBAAgB,IAAI,OAAO,CAAC;IAC5B,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA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B,IAAI;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACjE,wBAAwB,CAAC,QAAQ,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;CACxF;AAED,OAAO,QAAQ,4BAA4B,CAAC;IAC3C,UAAU,eAAgB,SAAQ,0BAA0B;KAAG;CAC/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"settings-manager.d.ts","sourceRoot":"","sources":["../../src/core/settings-manager.ts"],"names":[],"mappings":"AAAA,OAAO,uCAAuC,CAAC;AAC/C,OAAO,0CAA0C,CAAC;AAClD,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrF,YAAY,EACX,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,0BAA0B,EAC1B,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,aAAa,EACb,4BAA4B,EAC5B,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,GACf,MAAM,qBAAqB,CAAC","sourcesContent":["import \"./settings-manager-basic-accessors.ts\";\nimport \"./settings-manager-resource-accessors.ts\";\nimport \"./settings-manager-ui-accessors.ts\";\n\nexport { SettingsManager } from \"./settings-manager-core.ts\";\nexport { FileSettingsStorage, InMemorySettingsStorage } from \"./settings-storage.ts\";\nexport type {\n\tBranchSummarySettings,\n\tCodexFastModeSettings,\n\tCompactionSettings,\n\tContextWindowSetting,\n\tDefaultProjectTrust,\n\tImageSettings,\n\tMarkdownSettings,\n\tModelContextWindowSettings,\n\tPackageSource,\n\tProviderRetrySettings,\n\tRetrySettings,\n\tSettings,\n\tSettingsError,\n\tSettingsManagerCreateOptions,\n\tSettingsScope,\n\tSettingsStorage,\n\tTerminalSettings,\n\tThinkingBudgetsSettings,\n\tTransportSetting,\n\tWarningSettings,\n} from \"./settings-types.ts\";\n"]}
1
+ {"version":3,"file":"settings-manager.d.ts","sourceRoot":"","sources":["../../src/core/settings-manager.ts"],"names":[],"mappings":"AAAA,OAAO,uCAAuC,CAAC;AAC/C,OAAO,0CAA0C,CAAC;AAClD,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrF,YAAY,EACX,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,0BAA0B,EAC1B,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,aAAa,EACb,4BAA4B,EAC5B,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,GACf,MAAM,qBAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"settings-merge.d.ts","sourceRoot":"","sources":["../../src/core/settings-merge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,GAAG,QAAQ,CA4B/E","sourcesContent":["import type { Settings } from \"./settings-types.ts\";\n\n/** Deep merge settings: project/overrides take precedence, nested objects merge recursively */\nexport function deepMergeSettings(base: Settings, overrides: Settings): Settings {\n\tconst result: Settings = { ...base };\n\n\tfor (const key of Object.keys(overrides) as (keyof Settings)[]) {\n\t\tconst overrideValue = overrides[key];\n\t\tconst baseValue = base[key];\n\n\t\tif (overrideValue === undefined) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// For nested objects, merge recursively\n\t\tif (\n\t\t\ttypeof overrideValue === \"object\" &&\n\t\t\toverrideValue !== null &&\n\t\t\t!Array.isArray(overrideValue) &&\n\t\t\ttypeof baseValue === \"object\" &&\n\t\t\tbaseValue !== null &&\n\t\t\t!Array.isArray(baseValue)\n\t\t) {\n\t\t\t(result as Record<string, unknown>)[key] = { ...baseValue, ...overrideValue };\n\t\t} else {\n\t\t\t// For primitives and arrays, override value wins\n\t\t\t(result as Record<string, unknown>)[key] = overrideValue;\n\t\t}\n\t}\n\n\treturn result;\n}\n"]}
1
+ {"version":3,"file":"settings-merge.d.ts","sourceRoot":"","sources":["../../src/core/settings-merge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,GAAG,QAAQ,CA4B/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"settings-storage.d.ts","sourceRoot":"","sources":["../../src/core/settings-storage.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAY,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpF,qBAAa,mBAAoB,YAAW,eAAe;IAC1D,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,mBAAmB,CAAS;IACpC,OAAO,CAAC,eAAe,CAAW;IAClC,OAAO,CAAC,gBAAgB,CAAW;IAEnC,YAAY,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAO/G;IAED,OAAO,CAAC,wBAAwB;IA2BhC,OAAO,CAAC,kBAAkB;IAa1B,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,GAAG,IAAI,CA+B5F;CACD;AAED,qBAAa,uBAAwB,YAAW,eAAe;IAC9D,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,OAAO,CAAqB;IAEpC,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,GAAG,IAAI,CAU5F;CACD","sourcesContent":["import { existsSync, mkdirSync, readFileSync, writeFileSync } from \"fs\";\nimport { dirname, join } from \"path\";\nimport lockfile from \"proper-lockfile\";\nimport { CONFIG_DIR_NAME } from \"../config.ts\";\nimport { normalizePath, resolvePath } from \"../utils/paths.ts\";\nimport { parseJsonFileContent } from \"../utils/json.ts\";\nimport { deepMergeSettings } from \"./settings-merge.ts\";\nimport type { Settings, SettingsScope, SettingsStorage } from \"./settings-types.ts\";\n\nexport class FileSettingsStorage implements SettingsStorage {\n\tprivate globalSettingsPath: string;\n\tprivate projectSettingsPath: string;\n\tprivate globalReadPaths: string[];\n\tprivate projectReadPaths: string[];\n\n\tconstructor(cwd: string, agentDir: string, options?: { globalReadPaths?: string[]; projectReadPaths?: string[] }) {\n\t\tconst resolvedCwd = resolvePath(cwd);\n\t\tconst resolvedAgentDir = resolvePath(agentDir);\n\t\tthis.globalSettingsPath = join(resolvedAgentDir, \"settings.json\");\n\t\tthis.projectSettingsPath = join(resolvedCwd, CONFIG_DIR_NAME, \"settings.json\");\n\t\tthis.globalReadPaths = (options?.globalReadPaths ?? [this.globalSettingsPath]).map((path) => normalizePath(path));\n\t\tthis.projectReadPaths = (options?.projectReadPaths ?? [this.projectSettingsPath]).map((path) => normalizePath(path));\n\t}\n\n\tprivate acquireLockSyncWithRetry(path: string): () => void {\n\t\tconst maxAttempts = 10;\n\t\tconst delayMs = 20;\n\t\tlet lastError: unknown;\n\n\t\tfor (let attempt = 1; attempt <= maxAttempts; attempt++) {\n\t\t\ttry {\n\t\t\t\treturn lockfile.lockSync(path, { realpath: false });\n\t\t\t} catch (error) {\n\t\t\t\tconst code =\n\t\t\t\t\ttypeof error === \"object\" && error !== null && \"code\" in error\n\t\t\t\t\t\t? String((error as { code?: unknown }).code)\n\t\t\t\t\t\t: undefined;\n\t\t\t\tif (code !== \"ELOCKED\" || attempt === maxAttempts) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tlastError = error;\n\t\t\t\tconst start = Date.now();\n\t\t\t\twhile (Date.now() - start < delayMs) {\n\t\t\t\t\t// Sleep synchronously to avoid changing callers to async.\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthrow (lastError as Error) ?? new Error(\"Failed to acquire settings lock\");\n\t}\n\n\tprivate readMergedSettings(readPaths: string[]): string | undefined {\n\t\tlet merged: Settings = {};\n\t\tlet found = false;\n\t\tfor (let i = readPaths.length - 1; i >= 0; i--) {\n\t\t\tconst readPath = readPaths[i]!;\n\t\t\tif (!existsSync(readPath)) continue;\n\t\t\tconst parsed = parseJsonFileContent(readFileSync(readPath, \"utf-8\")) as Settings;\n\t\t\tmerged = deepMergeSettings(merged, parsed);\n\t\t\tfound = true;\n\t\t}\n\t\treturn found ? JSON.stringify(merged, null, 2) : undefined;\n\t}\n\n\twithLock(scope: SettingsScope, fn: (current: string | undefined) => string | undefined): void {\n\t\tconst path = scope === \"global\" ? this.globalSettingsPath : this.projectSettingsPath;\n\t\tconst readPaths = scope === \"global\" ? this.globalReadPaths : this.projectReadPaths;\n\t\tconst dir = dirname(path);\n\n\t\tlet release: (() => void) | undefined;\n\t\ttry {\n\t\t\t// Only create directory and lock if the primary file exists or we need to write.\n\t\t\tconst fileExists = existsSync(path);\n\t\t\tif (fileExists) {\n\t\t\t\trelease = this.acquireLockSyncWithRetry(path);\n\t\t\t}\n\t\t\tconst current = this.readMergedSettings(readPaths);\n\t\t\tconst next = fn(current);\n\n\t\t\tif (next !== undefined) {\n\t\t\t\t// Only create directory when we actually need to write.\n\t\t\t\tif (!existsSync(dir)) {\n\t\t\t\t\tmkdirSync(dir, { recursive: true });\n\t\t\t\t}\n\t\t\t\tif (!release) {\n\t\t\t\t\tif (!existsSync(path)) writeFileSync(path, \"{}\", \"utf-8\");\n\t\t\t\t\trelease = this.acquireLockSyncWithRetry(path);\n\t\t\t\t}\n\t\t\t\twriteFileSync(path, next, \"utf-8\");\n\t\t\t}\n\t\t} finally {\n\t\t\tif (release) {\n\t\t\t\trelease();\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport class InMemorySettingsStorage implements SettingsStorage {\n\tprivate global: string | undefined;\n\tprivate project: string | undefined;\n\n\twithLock(scope: SettingsScope, fn: (current: string | undefined) => string | undefined): void {\n\t\tconst current = scope === \"global\" ? this.global : this.project;\n\t\tconst next = fn(current);\n\t\tif (next !== undefined) {\n\t\t\tif (scope === \"global\") {\n\t\t\t\tthis.global = next;\n\t\t\t} else {\n\t\t\t\tthis.project = next;\n\t\t\t}\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"settings-storage.d.ts","sourceRoot":"","sources":["../../src/core/settings-storage.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAY,aAAa,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpF,qBAAa,mBAAoB,YAAW,eAAe;IAC1D,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,mBAAmB,CAAS;IACpC,OAAO,CAAC,eAAe,CAAW;IAClC,OAAO,CAAC,gBAAgB,CAAW;IAEnC,YAAY,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAO/G;IAED,OAAO,CAAC,wBAAwB;IA2BhC,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,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;CAC9F;AAED,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;CACb","sourcesContent":["import type { Transport } from \"@earendil-works/pi-ai/compat\";\n\nexport interface CompactionSettings {\n\tenabled?: boolean; // default: true\n\treserveTokens?: number; // default: 16384\n\tcompression_ratio?: number; // default: 0.5 (fraction of compactable context to keep)\n\tpreserve_recent?: number; // default: 2 (recent context-eligible messages to keep)\n\tquery?: string; // default: auto-detected from session context\n}\n\nexport interface BranchSummarySettings {\n\treserveTokens?: number; // default: 16384 (tokens reserved for prompt + LLM response)\n\tskipPrompt?: boolean; // default: false - when true, skips \"Summarize branch?\" prompt and defaults to no summary\n}\n\nexport interface ProviderRetrySettings {\n\ttimeoutMs?: number; // SDK/provider request timeout in milliseconds\n\tmaxRetries?: number; // SDK/provider retry attempts\n\tmaxRetryDelayMs?: number; // default: 60000 (max server-requested delay before failing)\n}\n\nexport interface RetrySettings {\n\tenabled?: boolean; // default: true\n\tmaxRetries?: number; // default: 3\n\tbaseDelayMs?: number; // default: 2000 (exponential backoff: 2s, 4s, 8s)\n\tprovider?: ProviderRetrySettings;\n}\n\nexport interface TerminalSettings {\n\tshowImages?: boolean; // default: true (only relevant if terminal supports images)\n\timageWidthCells?: number; // default: 60 (preferred inline image width in terminal cells)\n\tclearOnShrink?: boolean; // default: false (clear empty rows when content shrinks)\n\tshowTerminalProgress?: boolean; // default: false (OSC 9;4 terminal progress indicators)\n}\n\nexport interface ImageSettings {\n\tautoResize?: boolean; // default: true (resize images to 2000x2000 max for better model compatibility)\n\tblockImages?: boolean; // default: false - when true, prevents all images from being sent to LLM providers\n}\n\nexport interface SearchSettings { contextBefore?: number; contextAfter?: number }\nexport interface ThinkingBudgetsSettings {\n\tminimal?: number;\n\tlow?: number;\n\tmedium?: number;\n\thigh?: number;\n}\n\nexport interface MarkdownSettings {\n\tcodeBlockIndent?: string; // default: \" \"\n}\n\nexport interface WarningSettings {\n\tanthropicExtraUsage?: boolean; // default: true\n}\n\nexport interface CodexFastModeSettings {\n\tchat?: boolean; // default: false\n\tworkflow?: boolean; // default: false\n}\n\nexport type DefaultProjectTrust = \"ask\" | \"always\" | \"never\";\n\nexport type TransportSetting = Transport;\n\nexport type ContextWindowSetting = number | string;\nexport type ModelContextWindowSettings = Record<string, ContextWindowSetting>;\n\n/**\n * Package source for npm/git packages.\n * - String form: load all resources from the package\n * - Object form: filter which resources to load\n */\nexport type PackageSource =\n\t| string\n\t| {\n\t\t\tsource: string;\n\t\t\textensions?: string[];\n\t\t\tskills?: string[];\n\t\t\tprompts?: string[];\n\t\t\tthemes?: string[];\n\t\t\tworkflows?: string[];\n\t };\n\nexport interface BashInterceptorSettings {\n\tenabled?: boolean; // default: false\n}\n\nexport interface Settings {\n\tlastChangelogVersion?: string;\n\tfirstRunOnboardingStartedVersion?: string;\n\tonboardedVersion?: string;\n\tdefaultProvider?: string;\n\tdefaultModel?: string;\n\tdefaultThinkingLevel?: \"off\" | \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\" | \"max\";\n\tfallbackModels?: string[]; // Ordered main-chat fallback models, optionally suffixed with :thinkingLevel\n\tdefaultContextWindow?: ContextWindowSetting; // Optional global fallback; model picker writes defaultContextWindows instead.\n\tdefaultContextWindows?: ModelContextWindowSettings; // Per-model defaults keyed as \"provider/modelId\".\n\ttransport?: TransportSetting; // default: \"auto\"\n\tsteeringMode?: \"all\" | \"one-at-a-time\";\n\tfollowUpMode?: \"all\" | \"one-at-a-time\";\n\ttheme?: string;\n\tcompaction?: CompactionSettings;\n\tbranchSummary?: BranchSummarySettings;\n\tretry?: RetrySettings;\n\thideThinkingBlock?: boolean;\n\texternalEditor?: string; // Command for Ctrl+G external editor; takes precedence over VISUAL/EDITOR\n\tshellPath?: string; // Custom shell path (e.g., for Cygwin users on Windows)\n\tquietStartup?: boolean;\n\tdefaultProjectTrust?: DefaultProjectTrust; // default: \"ask\"; global setting only\n\tshellCommandPrefix?: string; // Prefix prepended to every bash command (e.g., \"shopt -s expand_aliases\" for alias support)\n\tbashInterceptor?: BashInterceptorSettings; // default: disabled; when enabled, user_bash handlers can intercept bash tool execution\n\tsearch?: SearchSettings; // Context lines for search results; defaults: before=1, after=3\n\tnpmCommand?: string[]; // Command used for npm package lookup/install operations, argv-style (e.g., [\"mise\", \"exec\", \"node@20\", \"--\", \"npm\"])\n\tcollapseChangelog?: boolean; // Show condensed changelog after update (use /changelog for full)\n\tenableInstallTelemetry?: boolean; // default: true - anonymous version/update ping after changelog-detected updates\n\tpackages?: PackageSource[]; // Array of npm/git package sources (string or object with filtering)\n\textensions?: string[]; // Array of local extension file paths or directories\n\tskills?: string[]; // Array of local skill file paths or directories\n\tprompts?: string[]; // Array of local prompt template paths or directories\n\tthemes?: string[]; // Array of local theme file paths or directories\n\tworkflows?: string[]; // Array of local workflow file paths or directories\n\tenableSkillCommands?: boolean; // default: true - register skills as /skill:name commands\n\tterminal?: TerminalSettings;\n\timages?: ImageSettings;\n\tenabledModels?: string[]; // Model patterns for cycling (same format as --models CLI flag)\n\tdoubleEscapeAction?: \"fork\" | \"tree\" | \"none\"; // Action for double-escape with empty editor (default: \"tree\")\n\ttreeFilterMode?: \"default\" | \"no-tools\" | \"user-only\" | \"labeled-only\" | \"all\"; // Default filter when opening /tree\n\tthinkingBudgets?: ThinkingBudgetsSettings; // Custom token budgets for thinking levels\n\teditorPaddingX?: number; // Horizontal padding for input editor (default: 0)\n\toutputPad?: 0 | 1; // Horizontal padding for chat message output (default: 1)\n\tautocompleteMaxVisible?: number; // Max visible items in autocomplete dropdown (default: 5)\n\tshowHardwareCursor?: boolean; // Show terminal cursor while still positioning it for IME\n\tmarkdown?: MarkdownSettings;\n\twarnings?: WarningSettings;\n\tcodexFastMode?: CodexFastModeSettings; // OpenAI priority service tier toggles for chat/workflow\n\tsessionDir?: string; // Custom session storage directory (same format as --session-dir CLI flag)\n\thttpIdleTimeoutMs?: number; // HTTP header/body idle timeout in milliseconds; 0 disables it\n\twebsocketConnectTimeoutMs?: number; // WebSocket connect/open handshake timeout in milliseconds; 0 disables it\n}\n\nexport type SettingsScope = \"global\" | \"project\";\n\nexport interface SettingsManagerCreateOptions {\n\tprojectTrusted?: boolean;\n}\n\nexport interface SettingsStorage {\n\twithLock(scope: SettingsScope, fn: (current: string | undefined) => string | undefined): void;\n}\n\nexport interface SettingsError {\n\tscope: SettingsScope;\n\terror: Error;\n}\n"]}
1
+ {"version":3,"file":"settings-types.d.ts","sourceRoot":"","sources":["../../src/core/settings-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CACjC;AAED,MAAM,WAAW,gBAAgB;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC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AK,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;CAC9F;AAED,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;CACb"}
@@ -1 +1 @@
1
- {"version":3,"file":"skills-async.d.ts","sourceRoot":"","sources":["../../src/core/skills-async.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAA2B,MAAM,aAAa,CAAC;AAkKhG,wBAAsB,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsE3F","sourcesContent":["import { access, readdir, readFile, stat } from \"node:fs/promises\";\nimport ignore from \"ignore\";\nimport { basename, dirname, join, relative, resolve, sep } from \"node:path\";\nimport { CONFIG_DIR_NAME, getAgentDir } from \"../config.ts\";\nimport { parseFrontmatter } from \"../utils/frontmatter.ts\";\nimport { yieldToEventLoopIfSlow } from \"../utils/event-loop.ts\";\nimport { canonicalizePath, resolvePath } from \"../utils/paths.ts\";\nimport type { ResourceDiagnostic } from \"./diagnostics.ts\";\nimport { createSyntheticSourceInfo, type SourceInfo } from \"./source-info.ts\";\nimport type { LoadSkillsOptions, LoadSkillsResult, Skill, SkillFrontmatter } from \"./skills.ts\";\n\nconst MAX_NAME_LENGTH = 64;\nconst MAX_DESCRIPTION_LENGTH = 1024;\nconst IGNORE_FILE_NAMES = [\".gitignore\", \".ignore\", \".fdignore\"];\nconst YIELD_AFTER_MS = 8;\ntype IgnoreMatcher = ReturnType<typeof ignore>;\n\nasync function exists(path: string): Promise<boolean> {\n\ttry { await access(path); return true; } catch { return false; }\n}\n\nfunction toPosixPath(path: string): string {\n\treturn path.split(sep).join(\"/\");\n}\n\nfunction prefixIgnorePattern(line: string, prefix: string): string | null {\n\tconst trimmed = line.trim();\n\tif (!trimmed || (trimmed.startsWith(\"#\") && !trimmed.startsWith(\"\\\\#\"))) return null;\n\tlet pattern = line;\n\tlet negated = false;\n\tif (pattern.startsWith(\"!\")) {\n\t\tnegated = true;\n\t\tpattern = pattern.slice(1);\n\t} else if (pattern.startsWith(\"\\\\!\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\tif (pattern.startsWith(\"/\")) pattern = pattern.slice(1);\n\tconst prefixed = prefix ? `${prefix}${pattern}` : pattern;\n\treturn negated ? `!${prefixed}` : prefixed;\n}\n\nasync function addIgnoreRules(ig: IgnoreMatcher, dir: string, rootDir: string): Promise<void> {\n\tconst relativeDir = relative(rootDir, dir);\n\tconst prefix = relativeDir ? `${toPosixPath(relativeDir)}/` : \"\";\n\tfor (const filename of IGNORE_FILE_NAMES) {\n\t\tconst ignorePath = join(dir, filename);\n\t\ttry {\n\t\t\tconst content = await readFile(ignorePath, \"utf-8\");\n\t\t\tconst patterns = content\n\t\t\t\t.split(/\\r?\\n/)\n\t\t\t\t.map((line) => prefixIgnorePattern(line, prefix))\n\t\t\t\t.filter((line): line is string => Boolean(line));\n\t\t\tif (patterns.length > 0) ig.add(patterns);\n\t\t} catch {}\n\t}\n}\n\nfunction createSkillSourceInfo(filePath: string, baseDir: string, source: string): SourceInfo {\n\tswitch (source) {\n\t\tcase \"user\": return createSyntheticSourceInfo(filePath, { source: \"local\", scope: \"user\", baseDir });\n\t\tcase \"project\": return createSyntheticSourceInfo(filePath, { source: \"local\", scope: \"project\", baseDir });\n\t\tcase \"path\": return createSyntheticSourceInfo(filePath, { source: \"local\", baseDir });\n\t\tdefault: return createSyntheticSourceInfo(filePath, { source, baseDir });\n\t}\n}\n\nfunction validateName(name: string): string[] {\n\tconst errors: string[] = [];\n\tif (name.length > MAX_NAME_LENGTH) errors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);\n\tif (!/^[a-z0-9-]+$/.test(name)) errors.push(\"name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)\");\n\tif (name.startsWith(\"-\") || name.endsWith(\"-\")) errors.push(\"name must not start or end with a hyphen\");\n\tif (name.includes(\"--\")) errors.push(\"name must not contain consecutive hyphens\");\n\treturn errors;\n}\n\nfunction validateDescription(description: string | undefined): string[] {\n\tif (!description || description.trim() === \"\") return [\"description is required\"];\n\tif (description.length > MAX_DESCRIPTION_LENGTH) {\n\t\treturn [`description exceeds ${MAX_DESCRIPTION_LENGTH} characters (${description.length})`];\n\t}\n\treturn [];\n}\n\nasync function loadSkillFromFile(filePath: string, source: string): Promise<{ skill: Skill | null; diagnostics: ResourceDiagnostic[] }> {\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\ttry {\n\t\tconst rawContent = await readFile(filePath, \"utf-8\");\n\t\tconst { frontmatter } = parseFrontmatter<SkillFrontmatter>(rawContent);\n\t\tconst skillDir = dirname(filePath);\n\t\tfor (const error of validateDescription(frontmatter.description)) diagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\tconst name = frontmatter.name || basename(skillDir);\n\t\tfor (const error of validateName(name)) diagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\tif (!frontmatter.description || frontmatter.description.trim() === \"\") return { skill: null, diagnostics };\n\t\treturn {\n\t\t\tskill: {\n\t\t\t\tname,\n\t\t\t\tdescription: frontmatter.description,\n\t\t\t\tfilePath,\n\t\t\t\tbaseDir: skillDir,\n\t\t\t\tsourceInfo: createSkillSourceInfo(filePath, skillDir, source),\n\t\t\t\tdisableModelInvocation: frontmatter[\"disable-model-invocation\"] === true,\n\t\t\t},\n\t\t\tdiagnostics,\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"failed to parse skill file\";\n\t\tdiagnostics.push({ type: \"warning\", message, path: filePath });\n\t\treturn { skill: null, diagnostics };\n\t}\n}\n\nasync function loadSkillsFromDirInternal(\n\tdir: string,\n\tsource: string,\n\tincludeRootFiles: boolean,\n\tignoreMatcher?: IgnoreMatcher,\n\trootDir?: string,\n): Promise<LoadSkillsResult> {\n\tconst skills: Skill[] = [];\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\tif (!(await exists(dir))) return { skills, diagnostics };\n\tconst startedAt = Date.now();\n\tconst root = rootDir ?? dir;\n\tconst ig = ignoreMatcher ?? ignore();\n\tawait addIgnoreRules(ig, dir, root);\n\ttry {\n\t\tconst entries = await readdir(dir, { withFileTypes: true });\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name !== \"SKILL.md\") continue;\n\t\t\tconst fullPath = join(dir, entry.name);\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry { isFile = (await stat(fullPath)).isFile(); } catch { continue; }\n\t\t\t}\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tif (!isFile || ig.ignores(relPath)) continue;\n\t\t\tconst result = await loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) skills.push(result.skill);\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t\treturn { skills, diagnostics };\n\t\t}\n\t\tfor (const entry of entries) {\n\t\t\tawait yieldToEventLoopIfSlow(startedAt, YIELD_AFTER_MS);\n\t\t\tif (entry.name.startsWith(\".\") || entry.name === \"node_modules\") continue;\n\t\t\tconst fullPath = join(dir, entry.name);\n\t\t\tlet isDirectory = entry.isDirectory();\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry {\n\t\t\t\t\tconst stats = await stat(fullPath);\n\t\t\t\t\tisDirectory = stats.isDirectory();\n\t\t\t\t\tisFile = stats.isFile();\n\t\t\t\t} catch { continue; }\n\t\t\t}\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tif (ig.ignores(isDirectory ? `${relPath}/` : relPath)) continue;\n\t\t\tif (isDirectory) {\n\t\t\t\tconst subResult = await loadSkillsFromDirInternal(fullPath, source, false, ig, root);\n\t\t\t\tskills.push(...subResult.skills);\n\t\t\t\tdiagnostics.push(...subResult.diagnostics);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!isFile || !includeRootFiles || !entry.name.endsWith(\".md\")) continue;\n\t\t\tconst result = await loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) skills.push(result.skill);\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t}\n\t} catch {}\n\treturn { skills, diagnostics };\n}\n\nexport async function loadSkillsAsync(options: LoadSkillsOptions): Promise<LoadSkillsResult> {\n\tconst { agentDir, skillPaths, includeDefaults } = options;\n\tconst resolvedCwd = resolvePath(options.cwd);\n\tconst resolvedAgentDir = resolvePath(agentDir ?? getAgentDir());\n\tconst skillMap = new Map<string, Skill>();\n\tconst realPathSet = new Set<string>();\n\tconst allDiagnostics: ResourceDiagnostic[] = [];\n\tconst collisionDiagnostics: ResourceDiagnostic[] = [];\n\tconst userSkillsDir = join(resolvedAgentDir, \"skills\");\n\tconst projectSkillsDir = resolve(resolvedCwd, CONFIG_DIR_NAME, \"skills\");\n\tconst addSkills = (result: LoadSkillsResult) => {\n\t\tallDiagnostics.push(...result.diagnostics);\n\t\tfor (const skill of result.skills) {\n\t\t\tconst realPath = canonicalizePath(skill.filePath);\n\t\t\tif (realPathSet.has(realPath)) continue;\n\t\t\tconst existing = skillMap.get(skill.name);\n\t\t\tif (existing) {\n\t\t\t\tcollisionDiagnostics.push({\n\t\t\t\t\ttype: \"collision\",\n\t\t\t\t\tmessage: `name \"${skill.name}\" collision`,\n\t\t\t\t\tpath: skill.filePath,\n\t\t\t\t\tcollision: { resourceType: \"skill\", name: skill.name, winnerPath: existing.filePath, loserPath: skill.filePath },\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tskillMap.set(skill.name, skill);\n\t\t\t\trealPathSet.add(realPath);\n\t\t\t}\n\t\t}\n\t};\n\tif (includeDefaults) {\n\t\taddSkills(await loadSkillsFromDirInternal(userSkillsDir, \"user\", true));\n\t\taddSkills(await loadSkillsFromDirInternal(projectSkillsDir, \"project\", true));\n\t}\n\tconst isUnderPath = (target: string, root: string): boolean => {\n\t\tconst normalizedRoot = resolve(root);\n\t\treturn target === normalizedRoot || target.startsWith(normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`);\n\t};\n\tconst getSource = (resolvedPath: string): \"user\" | \"project\" | \"path\" => {\n\t\tif (!includeDefaults) {\n\t\t\tif (isUnderPath(resolvedPath, userSkillsDir)) return \"user\";\n\t\t\tif (isUnderPath(resolvedPath, projectSkillsDir)) return \"project\";\n\t\t}\n\t\treturn \"path\";\n\t};\n\tconst startedAt = Date.now();\n\tfor (const rawPath of skillPaths) {\n\t\tawait yieldToEventLoopIfSlow(startedAt, YIELD_AFTER_MS);\n\t\tconst resolvedPath = resolvePath(rawPath, resolvedCwd, { trim: true });\n\t\tif (!(await exists(resolvedPath))) {\n\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path does not exist\", path: resolvedPath });\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\tconst stats = await stat(resolvedPath);\n\t\t\tconst source = getSource(resolvedPath);\n\t\t\tif (stats.isDirectory()) {\n\t\t\t\taddSkills(await loadSkillsFromDirInternal(resolvedPath, source, true));\n\t\t\t} else if (stats.isFile() && resolvedPath.endsWith(\".md\")) {\n\t\t\t\tconst result = await loadSkillFromFile(resolvedPath, source);\n\t\t\t\tif (result.skill) addSkills({ skills: [result.skill], diagnostics: result.diagnostics });\n\t\t\t\telse allDiagnostics.push(...result.diagnostics);\n\t\t\t} else {\n\t\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path is not a markdown file\", path: resolvedPath });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : \"failed to read skill path\";\n\t\t\tallDiagnostics.push({ type: \"warning\", message, path: resolvedPath });\n\t\t}\n\t}\n\treturn { skills: Array.from(skillMap.values()), diagnostics: [...allDiagnostics, ...collisionDiagnostics] };\n}\n"]}
1
+ {"version":3,"file":"skills-async.d.ts","sourceRoot":"","sources":["../../src/core/skills-async.ts"],"names":[],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D,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,0CAA0C;IAC1C,eAAe,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAoGvE","sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from \"fs\";\nimport ignore from \"ignore\";\nimport { basename, dirname, join, relative, resolve, sep } from \"path\";\nimport { CONFIG_DIR_NAME, getAgentDir } from \"../config.ts\";\nimport { parseFrontmatter } from \"../utils/frontmatter.ts\";\nimport { canonicalizePath, resolvePath } from \"../utils/paths.ts\";\nimport type { ResourceDiagnostic } from \"./diagnostics.ts\";\nimport { createSyntheticSourceInfo, type SourceInfo } from \"./source-info.ts\";\n\n/** Max name length per spec */\nconst MAX_NAME_LENGTH = 64;\n\n/** Max description length per spec */\nconst MAX_DESCRIPTION_LENGTH = 1024;\n\nconst IGNORE_FILE_NAMES = [\".gitignore\", \".ignore\", \".fdignore\"];\n\ntype IgnoreMatcher = ReturnType<typeof ignore>;\n\nfunction toPosixPath(p: string): string {\n\treturn p.split(sep).join(\"/\");\n}\n\nfunction prefixIgnorePattern(line: string, prefix: string): string | null {\n\tconst trimmed = line.trim();\n\tif (!trimmed) return null;\n\tif (trimmed.startsWith(\"#\") && !trimmed.startsWith(\"\\\\#\")) return null;\n\n\tlet pattern = line;\n\tlet negated = false;\n\n\tif (pattern.startsWith(\"!\")) {\n\t\tnegated = true;\n\t\tpattern = pattern.slice(1);\n\t} else if (pattern.startsWith(\"\\\\!\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tif (pattern.startsWith(\"/\")) {\n\t\tpattern = pattern.slice(1);\n\t}\n\n\tconst prefixed = prefix ? `${prefix}${pattern}` : pattern;\n\treturn negated ? `!${prefixed}` : prefixed;\n}\n\nfunction addIgnoreRules(ig: IgnoreMatcher, dir: string, rootDir: string): void {\n\tconst relativeDir = relative(rootDir, dir);\n\tconst prefix = relativeDir ? `${toPosixPath(relativeDir)}/` : \"\";\n\n\tfor (const filename of IGNORE_FILE_NAMES) {\n\t\tconst ignorePath = join(dir, filename);\n\t\tif (!existsSync(ignorePath)) continue;\n\t\ttry {\n\t\t\tconst content = readFileSync(ignorePath, \"utf-8\");\n\t\t\tconst patterns = content\n\t\t\t\t.split(/\\r?\\n/)\n\t\t\t\t.map((line) => prefixIgnorePattern(line, prefix))\n\t\t\t\t.filter((line): line is string => Boolean(line));\n\t\t\tif (patterns.length > 0) {\n\t\t\t\tig.add(patterns);\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n\nexport interface SkillFrontmatter {\n\tname?: string;\n\tdescription?: string;\n\t\"disable-model-invocation\"?: boolean;\n\t[key: string]: unknown;\n}\n\nexport interface Skill {\n\tname: string;\n\tdescription: string;\n\tfilePath: string;\n\tbaseDir: string;\n\tsourceInfo: SourceInfo;\n\tdisableModelInvocation: boolean;\n}\n\nexport interface LoadSkillsResult {\n\tskills: Skill[];\n\tdiagnostics: ResourceDiagnostic[];\n}\n\n/**\n * Validate skill name per Agent Skills spec.\n * Returns array of validation error messages (empty if valid).\n */\nfunction validateName(name: string): string[] {\n\tconst errors: string[] = [];\n\n\tif (name.length > MAX_NAME_LENGTH) {\n\t\terrors.push(`name exceeds ${MAX_NAME_LENGTH} characters (${name.length})`);\n\t}\n\n\tif (!/^[a-z0-9-]+$/.test(name)) {\n\t\terrors.push(`name contains invalid characters (must be lowercase a-z, 0-9, hyphens only)`);\n\t}\n\n\tif (name.startsWith(\"-\") || name.endsWith(\"-\")) {\n\t\terrors.push(`name must not start or end with a hyphen`);\n\t}\n\n\tif (name.includes(\"--\")) {\n\t\terrors.push(`name must not contain consecutive hyphens`);\n\t}\n\n\treturn errors;\n}\n\n/**\n * Validate description per Agent Skills spec.\n */\nfunction validateDescription(description: string | undefined): string[] {\n\tconst errors: string[] = [];\n\n\tif (!description || description.trim() === \"\") {\n\t\terrors.push(\"description is required\");\n\t} else if (description.length > MAX_DESCRIPTION_LENGTH) {\n\t\terrors.push(`description exceeds ${MAX_DESCRIPTION_LENGTH} characters (${description.length})`);\n\t}\n\n\treturn errors;\n}\n\nexport interface LoadSkillsFromDirOptions {\n\t/** Directory to scan for skills */\n\tdir: string;\n\t/** Source identifier for these skills */\n\tsource: string;\n}\n\nfunction createSkillSourceInfo(filePath: string, baseDir: string, source: string): SourceInfo {\n\tswitch (source) {\n\t\tcase \"user\":\n\t\t\treturn createSyntheticSourceInfo(filePath, {\n\t\t\t\tsource: \"local\",\n\t\t\t\tscope: \"user\",\n\t\t\t\tbaseDir,\n\t\t\t});\n\t\tcase \"project\":\n\t\t\treturn createSyntheticSourceInfo(filePath, {\n\t\t\t\tsource: \"local\",\n\t\t\t\tscope: \"project\",\n\t\t\t\tbaseDir,\n\t\t\t});\n\t\tcase \"path\":\n\t\t\treturn createSyntheticSourceInfo(filePath, {\n\t\t\t\tsource: \"local\",\n\t\t\t\tbaseDir,\n\t\t\t});\n\t\tdefault:\n\t\t\treturn createSyntheticSourceInfo(filePath, { source, baseDir });\n\t}\n}\n\n/**\n * Load skills from a directory.\n *\n * Discovery rules:\n * - if a directory contains SKILL.md, treat it as a skill root and do not recurse further\n * - otherwise, load direct .md children in the root\n * - recurse into subdirectories to find SKILL.md\n */\nexport function loadSkillsFromDir(options: LoadSkillsFromDirOptions): LoadSkillsResult {\n\tconst { dir, source } = options;\n\treturn loadSkillsFromDirInternal(dir, source, true);\n}\n\nfunction loadSkillsFromDirInternal(\n\tdir: string,\n\tsource: string,\n\tincludeRootFiles: boolean,\n\tignoreMatcher?: IgnoreMatcher,\n\trootDir?: string,\n): LoadSkillsResult {\n\tconst skills: Skill[] = [];\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\n\tif (!existsSync(dir)) {\n\t\treturn { skills, diagnostics };\n\t}\n\n\tconst root = rootDir ?? dir;\n\tconst ig = ignoreMatcher ?? ignore();\n\taddIgnoreRules(ig, dir, root);\n\n\ttry {\n\t\tconst entries = readdirSync(dir, { withFileTypes: true });\n\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name !== \"SKILL.md\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst fullPath = join(dir, entry.name);\n\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry {\n\t\t\t\t\tisFile = statSync(fullPath).isFile();\n\t\t\t\t} catch {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tif (!isFile || ig.ignores(relPath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst result = loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) {\n\t\t\t\tskills.push(result.skill);\n\t\t\t}\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t\treturn { skills, diagnostics };\n\t\t}\n\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name.startsWith(\".\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Skip node_modules to avoid scanning dependencies\n\t\t\tif (entry.name === \"node_modules\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst fullPath = join(dir, entry.name);\n\n\t\t\t// For symlinks, check if they point to a directory and follow them\n\t\t\tlet isDirectory = entry.isDirectory();\n\t\t\tlet isFile = entry.isFile();\n\t\t\tif (entry.isSymbolicLink()) {\n\t\t\t\ttry {\n\t\t\t\t\tconst stats = statSync(fullPath);\n\t\t\t\t\tisDirectory = stats.isDirectory();\n\t\t\t\t\tisFile = stats.isFile();\n\t\t\t\t} catch {\n\t\t\t\t\t// Broken symlink, skip it\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst relPath = toPosixPath(relative(root, fullPath));\n\t\t\tconst ignorePath = isDirectory ? `${relPath}/` : relPath;\n\t\t\tif (ig.ignores(ignorePath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isDirectory) {\n\t\t\t\tconst subResult = loadSkillsFromDirInternal(fullPath, source, false, ig, root);\n\t\t\t\tskills.push(...subResult.skills);\n\t\t\t\tdiagnostics.push(...subResult.diagnostics);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!isFile || !includeRootFiles || !entry.name.endsWith(\".md\")) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst result = loadSkillFromFile(fullPath, source);\n\t\t\tif (result.skill) {\n\t\t\t\tskills.push(result.skill);\n\t\t\t}\n\t\t\tdiagnostics.push(...result.diagnostics);\n\t\t}\n\t} catch {}\n\n\treturn { skills, diagnostics };\n}\n\nfunction loadSkillFromFile(\n\tfilePath: string,\n\tsource: string,\n): { skill: Skill | null; diagnostics: ResourceDiagnostic[] } {\n\tconst diagnostics: ResourceDiagnostic[] = [];\n\n\ttry {\n\t\tconst rawContent = readFileSync(filePath, \"utf-8\");\n\t\tconst { frontmatter } = parseFrontmatter<SkillFrontmatter>(rawContent);\n\t\tconst skillDir = dirname(filePath);\n\t\tconst parentDirName = basename(skillDir);\n\n\t\t// Validate description\n\t\tconst descErrors = validateDescription(frontmatter.description);\n\t\tfor (const error of descErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\n\t\t// Use name from frontmatter, or fall back to parent directory name\n\t\tconst name = frontmatter.name || parentDirName;\n\n\t\t// Validate name\n\t\tconst nameErrors = validateName(name);\n\t\tfor (const error of nameErrors) {\n\t\t\tdiagnostics.push({ type: \"warning\", message: error, path: filePath });\n\t\t}\n\n\t\t// Still load the skill even with warnings (unless description is completely missing)\n\t\tif (!frontmatter.description || frontmatter.description.trim() === \"\") {\n\t\t\treturn { skill: null, diagnostics };\n\t\t}\n\n\t\treturn {\n\t\t\tskill: {\n\t\t\t\tname,\n\t\t\t\tdescription: frontmatter.description,\n\t\t\t\tfilePath,\n\t\t\t\tbaseDir: skillDir,\n\t\t\t\tsourceInfo: createSkillSourceInfo(filePath, skillDir, source),\n\t\t\t\tdisableModelInvocation: frontmatter[\"disable-model-invocation\"] === true,\n\t\t\t},\n\t\t\tdiagnostics,\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : \"failed to parse skill file\";\n\t\tdiagnostics.push({ type: \"warning\", message, path: filePath });\n\t\treturn { skill: null, diagnostics };\n\t}\n}\n\n/**\n * Format skills for inclusion in a system prompt.\n * Uses XML format per Agent Skills standard.\n * See: https://agentskills.io/integrate-skills\n *\n * Skills with disableModelInvocation=true are excluded from the prompt\n * (they can only be invoked explicitly via /skill:name commands).\n */\nexport function formatSkillsForPrompt(skills: Skill[]): string {\n\tconst visibleSkills = skills.filter((s) => !s.disableModelInvocation);\n\n\tif (visibleSkills.length === 0) {\n\t\treturn \"\";\n\t}\n\n\tconst lines = [\n\t\t\"\\n\\nThe following skills provide specialized instructions for specific tasks.\",\n\t\t\"Use the read tool to load a skill's file when the task matches its description.\",\n\t\t\"When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.\",\n\t\t\"\",\n\t\t\"<available_skills>\",\n\t];\n\n\tfor (const skill of visibleSkills) {\n\t\tlines.push(\" <skill>\");\n\t\tlines.push(` <name>${escapeXml(skill.name)}</name>`);\n\t\tlines.push(` <description>${escapeXml(skill.description)}</description>`);\n\t\tlines.push(` <location>${escapeXml(skill.filePath)}</location>`);\n\t\tlines.push(\" </skill>\");\n\t}\n\n\tlines.push(\"</available_skills>\");\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction escapeXml(str: string): string {\n\treturn str\n\t\t.replace(/&/g, \"&amp;\")\n\t\t.replace(/</g, \"&lt;\")\n\t\t.replace(/>/g, \"&gt;\")\n\t\t.replace(/\"/g, \"&quot;\")\n\t\t.replace(/'/g, \"&apos;\");\n}\n\nexport interface LoadSkillsOptions {\n\t/** Working directory for project-local skills. */\n\tcwd: string;\n\t/** Agent config directory for global skills. */\n\tagentDir: string;\n\t/** Explicit skill paths (files or directories) */\n\tskillPaths: string[];\n\t/** Include default skills directories. */\n\tincludeDefaults: boolean;\n}\n\n/**\n * Load skills from all configured locations.\n * Returns skills and any validation diagnostics.\n */\nexport function loadSkills(options: LoadSkillsOptions): LoadSkillsResult {\n\tconst { agentDir, skillPaths, includeDefaults } = options;\n\n\t// Resolve agentDir - if not provided, use default from config\n\tconst resolvedCwd = resolvePath(options.cwd);\n\tconst resolvedAgentDir = resolvePath(agentDir ?? getAgentDir());\n\n\tconst skillMap = new Map<string, Skill>();\n\tconst realPathSet = new Set<string>();\n\tconst allDiagnostics: ResourceDiagnostic[] = [];\n\tconst collisionDiagnostics: ResourceDiagnostic[] = [];\n\n\tfunction addSkills(result: LoadSkillsResult) {\n\t\tallDiagnostics.push(...result.diagnostics);\n\t\tfor (const skill of result.skills) {\n\t\t\t// Resolve symlinks to detect duplicate files\n\t\t\tconst realPath = canonicalizePath(skill.filePath);\n\n\t\t\t// Skip silently if we've already loaded this exact file (via symlink)\n\t\t\tif (realPathSet.has(realPath)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst existing = skillMap.get(skill.name);\n\t\t\tif (existing) {\n\t\t\t\tcollisionDiagnostics.push({\n\t\t\t\t\ttype: \"collision\",\n\t\t\t\t\tmessage: `name \"${skill.name}\" collision`,\n\t\t\t\t\tpath: skill.filePath,\n\t\t\t\t\tcollision: {\n\t\t\t\t\t\tresourceType: \"skill\",\n\t\t\t\t\t\tname: skill.name,\n\t\t\t\t\t\twinnerPath: existing.filePath,\n\t\t\t\t\t\tloserPath: skill.filePath,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tskillMap.set(skill.name, skill);\n\t\t\t\trealPathSet.add(realPath);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (includeDefaults) {\n\t\taddSkills(loadSkillsFromDirInternal(join(resolvedAgentDir, \"skills\"), \"user\", true));\n\t\taddSkills(loadSkillsFromDirInternal(resolve(resolvedCwd, CONFIG_DIR_NAME, \"skills\"), \"project\", true));\n\t}\n\n\tconst userSkillsDir = join(resolvedAgentDir, \"skills\");\n\tconst projectSkillsDir = resolve(resolvedCwd, CONFIG_DIR_NAME, \"skills\");\n\n\tconst isUnderPath = (target: string, root: string): boolean => {\n\t\tconst normalizedRoot = resolve(root);\n\t\tif (target === normalizedRoot) {\n\t\t\treturn true;\n\t\t}\n\t\tconst prefix = normalizedRoot.endsWith(sep) ? normalizedRoot : `${normalizedRoot}${sep}`;\n\t\treturn target.startsWith(prefix);\n\t};\n\n\tconst getSource = (resolvedPath: string): \"user\" | \"project\" | \"path\" => {\n\t\tif (!includeDefaults) {\n\t\t\tif (isUnderPath(resolvedPath, userSkillsDir)) return \"user\";\n\t\t\tif (isUnderPath(resolvedPath, projectSkillsDir)) return \"project\";\n\t\t}\n\t\treturn \"path\";\n\t};\n\n\tfor (const rawPath of skillPaths) {\n\t\tconst resolvedPath = resolvePath(rawPath, resolvedCwd, { trim: true });\n\t\tif (!existsSync(resolvedPath)) {\n\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path does not exist\", path: resolvedPath });\n\t\t\tcontinue;\n\t\t}\n\n\t\ttry {\n\t\t\tconst stats = statSync(resolvedPath);\n\t\t\tconst source = getSource(resolvedPath);\n\t\t\tif (stats.isDirectory()) {\n\t\t\t\taddSkills(loadSkillsFromDirInternal(resolvedPath, source, true));\n\t\t\t} else if (stats.isFile() && resolvedPath.endsWith(\".md\")) {\n\t\t\t\tconst result = loadSkillFromFile(resolvedPath, source);\n\t\t\t\tif (result.skill) {\n\t\t\t\t\taddSkills({ skills: [result.skill], diagnostics: result.diagnostics });\n\t\t\t\t} else {\n\t\t\t\t\tallDiagnostics.push(...result.diagnostics);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tallDiagnostics.push({ type: \"warning\", message: \"skill path is not a markdown file\", path: resolvedPath });\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : \"failed to read skill path\";\n\t\t\tallDiagnostics.push({ type: \"warning\", message, path: resolvedPath });\n\t\t}\n\t}\n\n\treturn {\n\t\tskills: Array.from(skillMap.values()),\n\t\tdiagnostics: [...allDiagnostics, ...collisionDiagnostics],\n\t};\n}\n"]}
1
+ {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAA6B,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA2D9E,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,KAAK;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,UAAU,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,WAAW,EAAE,kBAAkB,EAAE,CAAC;CAClC;AA2CD,MAAM,WAAW,wBAAwB;IACxC,mCAAmC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;CACf;AA0BD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,gBAAgB,CAGrF;AA4JD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CA0B7D;AAWD,MAAM,WAAW,iBAAiB;IACjC,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,0CAA0C;IAC1C,eAAe,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,CAoGvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,CACxB,cAAc,EAAE,MAAM,KAClB,gBAAgB,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,CAAC;CACpE;AA4FD,wBAAgB,qCAAqC,CAAC,cAAc,EAAE,MAAM,GAAG,gBAAgB,EAAE,GAAG,IAAI,CA4CvG;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CA8BrE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,aAAa,CAAC,mBAAmB,CAkB/E,CAAC","sourcesContent":["import type { AutocompleteItem } from \"@earendil-works/pi-tui\";\nimport { APP_NAME } from \"../config.ts\";\nimport {\n\tATOMIC_GUIDE_COMMAND_DESCRIPTION,\n\tATOMIC_GUIDE_COMMAND_NAME,\n\tgetAtomicGuideArgumentCompletions,\n} from \"./atomic-guide-command.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n\tgetArgumentCompletions?: (\n\t\targumentPrefix: string,\n\t) => AutocompleteItem[] | null | Promise<AutocompleteItem[] | null>;\n}\n\ntype WorkflowInputCompletionMetadata = {\n\tdescription: string;\n\tkind?: \"boolean\" | \"number\" | \"string\";\n};\n\ntype WorkflowCompletionMetadata = {\n\tname: string;\n\tdescription: string;\n\tinputs: Record<string, WorkflowInputCompletionMetadata>;\n};\n\nconst WORKFLOW_ADMIN_COMPLETIONS: AutocompleteItem[] = [\n\t{ value: \"connect \", label: \"connect\", description: \"Attach to a run (picker if no id)\" },\n\t{ value: \"attach \", label: \"attach\", description: \"Open the in-place attach pane on a node\" },\n\t{ value: \"list \", label: \"list\", description: \"List registered workflows\" },\n\t{ value: \"status \", label: \"status\", description: \"List current-session active and retained terminal runs\" },\n\t{ value: \"interrupt \", label: \"interrupt\", description: \"Interrupt a run\" },\n\t{ value: \"kill \", label: \"kill\", description: \"Kill and retain a run\" },\n\t{ value: \"pause \", label: \"pause\", description: \"Pause a run or stage\" },\n\t{ value: \"resume \", label: \"resume\", description: \"Re-open overlay for a run\" },\n\t{ value: \"inputs \", label: \"inputs\", description: \"Show a workflow's input schema\" },\n\t{ value: \"reload \", label: \"reload\", description: \"Reload workflow resources\" },\n];\n\nconst BUNDLED_WORKFLOW_COMPLETION_METADATA: WorkflowCompletionMetadata[] = [\n\t{\n\t\tname: \"deep-research-codebase\",\n\t\tdescription: \"Scout + research-history chain → parallel specialist waves → aggregator for deep codebase research.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Research question or investigation focus for the codebase.\", kind: \"string\" },\n\t\t\tmax_partitions: { description: \"Maximum number of codebase partitions to explore in parallel.\", kind: \"number\" },\n\t\t\tmax_concurrency: { description: \"Maximum number of workflow stages to run concurrently during deep research.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"goal\",\n\t\tdescription: \"Goal Runner workflow with bounded LM turns, acceptance criteria, ledger artifacts, reviewers, and reducer-gated completion.\",\n\t\tinputs: {\n\t\t\tobjective: { description: \"The objective or delta for this Goal Runner workflow run.\", kind: \"string\" },\n\t\t\tacceptance_criteria: { description: \"Original immutable task contract this run must remain consistent with.\", kind: \"string\" },\n\t\t\tmax_turns: { description: \"Maximum worker/review turns before Goal Runner stops as needs_human.\", kind: \"number\" },\n\t\t\tbase_branch: { description: \"Optional branch reviewers compare the current code delta against.\", kind: \"string\" },\n\t\t\tgit_worktree_dir: { description: \"Optional Git worktree path.\", kind: \"string\" },\n\t\t\tcreate_pr: { description: \"Whether to run the final pull-request creation stage after approval.\", kind: \"boolean\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"open-claude-design\",\n\t\tdescription: \"AI-powered design workflow: discovery, reference research, HTML generation, refinement, and handoff.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"What to design, such as a dashboard, page, component, or prototype.\", kind: \"string\" },\n\t\t\tdiscover_references: { description: \"Discover current reference designs and feed them to generation.\", kind: \"boolean\" },\n\t\t\tmax_refinements: { description: \"Maximum generate/user-feedback loop iterations.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"ralph\",\n\t\tdescription: \"Raw prompt → research → orchestrate → multi-model parallel review loop with bounded iteration.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"The task or goal to research, execute, and refine.\", kind: \"string\" },\n\t\t\tacceptance_criteria: { description: \"Original immutable task contract this run must remain consistent with.\", kind: \"string\" },\n\t\t\tmax_loops: { description: \"Maximum research/orchestrate/review iterations.\", kind: \"number\" },\n\t\t\tbase_branch: { description: \"Branch reviewers compare the current code delta against.\", kind: \"string\" },\n\t\t\tgit_worktree_dir: { description: \"Optional Git worktree path.\", kind: \"string\" },\n\t\t\tcreate_pr: { description: \"Whether to run the final pull-request creation stage.\", kind: \"boolean\" },\n\t\t},\n\t},\n];\n\nfunction completeWorkflowToken(argumentText: string, candidates: AutocompleteItem[]): AutocompleteItem[] | null {\n\tconst tokenStart = /\\s$/.test(argumentText)\n\t\t? argumentText.length\n\t\t: Math.max(argumentText.lastIndexOf(\" \"), argumentText.lastIndexOf(\"\\t\")) + 1;\n\tconst head = argumentText.slice(0, tokenStart);\n\tconst token = argumentText.slice(tokenStart);\n\tconst normalizedToken = token.trimEnd();\n\tconst filtered = candidates\n\t\t.filter((candidate) => candidate.value.startsWith(token) && candidate.value.trimEnd() !== normalizedToken)\n\t\t.map((candidate) => ({ ...candidate, value: `${head}${candidate.value}` }));\n\treturn filtered.length > 0 ? filtered : null;\n}\n\nfunction bundledWorkflowNameItems(): AutocompleteItem[] {\n\treturn BUNDLED_WORKFLOW_COMPLETION_METADATA.map((workflow) => ({\n\t\tvalue: `${workflow.name} `,\n\t\tlabel: workflow.name,\n\t\tdescription: `Run workflow: ${workflow.name}`,\n\t}));\n}\n\nexport function getBundledWorkflowArgumentCompletions(argumentPrefix: string): AutocompleteItem[] | null {\n\tconst parts = argumentPrefix.trim().split(/\\s+/).filter(Boolean);\n\tconst subcommand = parts[0] ?? \"\";\n\tconst workflowItems = bundledWorkflowNameItems();\n\tif (!argumentPrefix.includes(\" \")) {\n\t\treturn completeWorkflowToken(argumentPrefix, [...WORKFLOW_ADMIN_COMPLETIONS, ...workflowItems]);\n\t}\n\tif (subcommand === \"inputs\") return completeWorkflowToken(argumentPrefix, workflowItems);\n\tif (subcommand === \"interrupt\" || subcommand === \"kill\") {\n\t\tconst verb = subcommand === \"kill\" ? \"Kill and retain\" : \"Interrupt\";\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: \"--all \", label: \"--all\", description: `${verb} all in-flight runs` },\n\t\t\t{ value: \"--yes \", label: \"--yes\", description: \"Skip confirmation\" },\n\t\t\t{ value: \"-y \", label: \"-y\", description: \"Skip confirmation\" },\n\t\t]);\n\t}\n\tif (!subcommand) return completeWorkflowToken(argumentPrefix, [...WORKFLOW_ADMIN_COMPLETIONS, ...workflowItems]);\n\n\tconst workflow = BUNDLED_WORKFLOW_COMPLETION_METADATA.find((candidate) => candidate.name === subcommand);\n\tif (!workflow) return null;\n\tconst tokenStart = /\\s$/.test(argumentPrefix)\n\t\t? argumentPrefix.length\n\t\t: Math.max(argumentPrefix.lastIndexOf(\" \"), argumentPrefix.lastIndexOf(\"\\t\")) + 1;\n\tconst token = argumentPrefix.slice(tokenStart);\n\tconst equalsIndex = token.indexOf(\"=\");\n\tif (equalsIndex > 0) {\n\t\tconst inputName = token.slice(0, equalsIndex);\n\t\tconst input = workflow.inputs[inputName];\n\t\tif (input?.kind !== \"boolean\") return null;\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: `${inputName}=true `, label: \"true\", description: inputName },\n\t\t\t{ value: `${inputName}=false `, label: \"false\", description: inputName },\n\t\t]);\n\t}\n\n\treturn completeWorkflowToken(argumentPrefix, [\n\t\t{ value: \"--no-picker \", label: \"--no-picker\", description: \"Skip interactive input picker\" },\n\t\t{ value: \"--help \", label: \"--help\", description: \"Show this workflow's input schema\" },\n\t\t...Object.entries(workflow.inputs).map(([name, input]) => ({\n\t\t\tvalue: `${name}=`,\n\t\t\tlabel: name,\n\t\t\tdescription: input.description,\n\t\t})),\n\t]);\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for ctrl+p cycling\" },\n\t{ name: \"fast\", description: \"Configure Codex fast mode for chat and workflows\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{\n\t\tname: ATOMIC_GUIDE_COMMAND_NAME,\n\t\tdescription: ATOMIC_GUIDE_COMMAND_DESCRIPTION,\n\t\tgetArgumentCompletions: getAtomicGuideArgumentCompletions,\n\t},\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"trust\", description: \"Save project trust decision for future sessions\" },\n\t{ name: \"login\", description: \"Configure provider authentication\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Compact context with verbatim logical deletions\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"exit\", description: `Exit ${APP_NAME}` },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n\nexport const BUNDLED_EXTENSION_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{\n\t\tname: \"workflow\",\n\t\tdescription: \"Run or inspect Atomic workflows. Usage: /workflow <name> [key=value…] | /workflow [list|status|connect|attach|interrupt|kill|pause|resume|inputs|reload] [args]\",\n\t\tgetArgumentCompletions: getBundledWorkflowArgumentCompletions,\n\t},\n\t{ name: \"run\", description: \"Run a subagent directly: /run agent[output=file] [task] [--bg] [--fork]\" },\n\t{ name: \"chain\", description: \"Run agents in sequence: /chain scout task -> planner [--bg] [--fork]\" },\n\t{ name: \"run-chain\", description: \"Run a saved chain: /run-chain chainName -- task [--bg] [--fork]\" },\n\t{ name: \"parallel\", description: \"Run agents in parallel: /parallel scout task1 -> reviewer task2 [--bg] [--fork]\" },\n\t{ name: \"subagents-doctor\", description: \"Show subagent diagnostics\" },\n\t{ name: \"mcp\", description: \"Show MCP server status\" },\n\t{ name: \"mcp-auth\", description: \"Authenticate with an MCP server (OAuth)\" },\n\t{ name: \"curator\", description: \"Toggle or configure the search curator workflow\" },\n\t{ name: \"google-account\", description: \"Show the active Google account for Gemini Web\" },\n\t{ name: \"search\", description: \"Browse stored web search results\" },\n\t{ name: \"websearch\", description: \"Open web search curator\" },\n\t{ name: \"intercom\", description: \"Open session intercom overlay\" },\n];\n"]}
1
+ {"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,CACxB,cAAc,EAAE,MAAM,KAClB,gBAAgB,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,CAAC;CACpE;AA4FD,wBAAgB,qCAAqC,CAAC,cAAc,EAAE,MAAM,GAAG,gBAAgB,EAAE,GAAG,IAAI,CA4CvG;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CA8BrE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,aAAa,CAAC,mBAAmB,CAkB/E,CAAC"}
@@ -147,7 +147,7 @@ export const BUILTIN_SLASH_COMMANDS = [
147
147
  { name: "login", description: "Configure provider authentication" },
148
148
  { name: "logout", description: "Remove provider authentication" },
149
149
  { name: "new", description: "Start a new session" },
150
- { name: "compact", description: "Compact context with verbatim logical deletions" },
150
+ { name: "compact", description: "Compact older context with verbatim line ranges" },
151
151
  { name: "resume", description: "Resume a different session" },
152
152
  { name: "reload", description: "Reload keybindings, extensions, skills, prompts, and themes" },
153
153
  { name: "exit", description: `Exit ${APP_NAME}` },
@@ -1 +1 @@
1
- {"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EACN,gCAAgC,EAChC,yBAAyB,EACzB,iCAAiC,GACjC,MAAM,2BAA2B,CAAC;AA+BnC,MAAM,0BAA0B,GAAuB;IACtD,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,mCAAmC,EAAE;IACzF,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;IAC7F,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,2BAA2B,EAAE;IAC3E,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,wDAAwD,EAAE;IAC5G,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE;IAC3E,EAAE,KAAK,EAAE,OA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BAAyB,EAAE;IAC7D,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,+BAA+B,EAAE;CAClE,CAAC","sourcesContent":["import type { AutocompleteItem } from \"@earendil-works/pi-tui\";\nimport { APP_NAME } from \"../config.ts\";\nimport {\n\tATOMIC_GUIDE_COMMAND_DESCRIPTION,\n\tATOMIC_GUIDE_COMMAND_NAME,\n\tgetAtomicGuideArgumentCompletions,\n} from \"./atomic-guide-command.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n\tgetArgumentCompletions?: (\n\t\targumentPrefix: string,\n\t) => AutocompleteItem[] | null | Promise<AutocompleteItem[] | null>;\n}\n\ntype WorkflowInputCompletionMetadata = {\n\tdescription: string;\n\tkind?: \"boolean\" | \"number\" | \"string\";\n};\n\ntype WorkflowCompletionMetadata = {\n\tname: string;\n\tdescription: string;\n\tinputs: Record<string, WorkflowInputCompletionMetadata>;\n};\n\nconst WORKFLOW_ADMIN_COMPLETIONS: AutocompleteItem[] = [\n\t{ value: \"connect \", label: \"connect\", description: \"Attach to a run (picker if no id)\" },\n\t{ value: \"attach \", label: \"attach\", description: \"Open the in-place attach pane on a node\" },\n\t{ value: \"list \", label: \"list\", description: \"List registered workflows\" },\n\t{ value: \"status \", label: \"status\", description: \"List current-session active and retained terminal runs\" },\n\t{ value: \"interrupt \", label: \"interrupt\", description: \"Interrupt a run\" },\n\t{ value: \"kill \", label: \"kill\", description: \"Kill and retain a run\" },\n\t{ value: \"pause \", label: \"pause\", description: \"Pause a run or stage\" },\n\t{ value: \"resume \", label: \"resume\", description: \"Re-open overlay for a run\" },\n\t{ value: \"inputs \", label: \"inputs\", description: \"Show a workflow's input schema\" },\n\t{ value: \"reload \", label: \"reload\", description: \"Reload workflow resources\" },\n];\n\nconst BUNDLED_WORKFLOW_COMPLETION_METADATA: WorkflowCompletionMetadata[] = [\n\t{\n\t\tname: \"deep-research-codebase\",\n\t\tdescription: \"Scout + research-history chain → parallel specialist waves → aggregator for deep codebase research.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Research question or investigation focus for the codebase.\", kind: \"string\" },\n\t\t\tmax_partitions: { description: \"Maximum number of codebase partitions to explore in parallel.\", kind: \"number\" },\n\t\t\tmax_concurrency: { description: \"Maximum number of workflow stages to run concurrently during deep research.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"goal\",\n\t\tdescription: \"Goal Runner workflow with bounded LM turns, acceptance criteria, ledger artifacts, reviewers, and reducer-gated completion.\",\n\t\tinputs: {\n\t\t\tobjective: { description: \"The objective or delta for this Goal Runner workflow run.\", kind: \"string\" },\n\t\t\tacceptance_criteria: { description: \"Original immutable task contract this run must remain consistent with.\", kind: \"string\" },\n\t\t\tmax_turns: { description: \"Maximum worker/review turns before Goal Runner stops as needs_human.\", kind: \"number\" },\n\t\t\tbase_branch: { description: \"Optional branch reviewers compare the current code delta against.\", kind: \"string\" },\n\t\t\tgit_worktree_dir: { description: \"Optional Git worktree path.\", kind: \"string\" },\n\t\t\tcreate_pr: { description: \"Whether to run the final pull-request creation stage after approval.\", kind: \"boolean\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"open-claude-design\",\n\t\tdescription: \"AI-powered design workflow: discovery, reference research, HTML generation, refinement, and handoff.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"What to design, such as a dashboard, page, component, or prototype.\", kind: \"string\" },\n\t\t\tdiscover_references: { description: \"Discover current reference designs and feed them to generation.\", kind: \"boolean\" },\n\t\t\tmax_refinements: { description: \"Maximum generate/user-feedback loop iterations.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"ralph\",\n\t\tdescription: \"Raw prompt → research → orchestrate → multi-model parallel review loop with bounded iteration.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"The task or goal to research, execute, and refine.\", kind: \"string\" },\n\t\t\tacceptance_criteria: { description: \"Original immutable task contract this run must remain consistent with.\", kind: \"string\" },\n\t\t\tmax_loops: { description: \"Maximum research/orchestrate/review iterations.\", kind: \"number\" },\n\t\t\tbase_branch: { description: \"Branch reviewers compare the current code delta against.\", kind: \"string\" },\n\t\t\tgit_worktree_dir: { description: \"Optional Git worktree path.\", kind: \"string\" },\n\t\t\tcreate_pr: { description: \"Whether to run the final pull-request creation stage.\", kind: \"boolean\" },\n\t\t},\n\t},\n];\n\nfunction completeWorkflowToken(argumentText: string, candidates: AutocompleteItem[]): AutocompleteItem[] | null {\n\tconst tokenStart = /\\s$/.test(argumentText)\n\t\t? argumentText.length\n\t\t: Math.max(argumentText.lastIndexOf(\" \"), argumentText.lastIndexOf(\"\\t\")) + 1;\n\tconst head = argumentText.slice(0, tokenStart);\n\tconst token = argumentText.slice(tokenStart);\n\tconst normalizedToken = token.trimEnd();\n\tconst filtered = candidates\n\t\t.filter((candidate) => candidate.value.startsWith(token) && candidate.value.trimEnd() !== normalizedToken)\n\t\t.map((candidate) => ({ ...candidate, value: `${head}${candidate.value}` }));\n\treturn filtered.length > 0 ? filtered : null;\n}\n\nfunction bundledWorkflowNameItems(): AutocompleteItem[] {\n\treturn BUNDLED_WORKFLOW_COMPLETION_METADATA.map((workflow) => ({\n\t\tvalue: `${workflow.name} `,\n\t\tlabel: workflow.name,\n\t\tdescription: `Run workflow: ${workflow.name}`,\n\t}));\n}\n\nexport function getBundledWorkflowArgumentCompletions(argumentPrefix: string): AutocompleteItem[] | null {\n\tconst parts = argumentPrefix.trim().split(/\\s+/).filter(Boolean);\n\tconst subcommand = parts[0] ?? \"\";\n\tconst workflowItems = bundledWorkflowNameItems();\n\tif (!argumentPrefix.includes(\" \")) {\n\t\treturn completeWorkflowToken(argumentPrefix, [...WORKFLOW_ADMIN_COMPLETIONS, ...workflowItems]);\n\t}\n\tif (subcommand === \"inputs\") return completeWorkflowToken(argumentPrefix, workflowItems);\n\tif (subcommand === \"interrupt\" || subcommand === \"kill\") {\n\t\tconst verb = subcommand === \"kill\" ? \"Kill and retain\" : \"Interrupt\";\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: \"--all \", label: \"--all\", description: `${verb} all in-flight runs` },\n\t\t\t{ value: \"--yes \", label: \"--yes\", description: \"Skip confirmation\" },\n\t\t\t{ value: \"-y \", label: \"-y\", description: \"Skip confirmation\" },\n\t\t]);\n\t}\n\tif (!subcommand) return completeWorkflowToken(argumentPrefix, [...WORKFLOW_ADMIN_COMPLETIONS, ...workflowItems]);\n\n\tconst workflow = BUNDLED_WORKFLOW_COMPLETION_METADATA.find((candidate) => candidate.name === subcommand);\n\tif (!workflow) return null;\n\tconst tokenStart = /\\s$/.test(argumentPrefix)\n\t\t? argumentPrefix.length\n\t\t: Math.max(argumentPrefix.lastIndexOf(\" \"), argumentPrefix.lastIndexOf(\"\\t\")) + 1;\n\tconst token = argumentPrefix.slice(tokenStart);\n\tconst equalsIndex = token.indexOf(\"=\");\n\tif (equalsIndex > 0) {\n\t\tconst inputName = token.slice(0, equalsIndex);\n\t\tconst input = workflow.inputs[inputName];\n\t\tif (input?.kind !== \"boolean\") return null;\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: `${inputName}=true `, label: \"true\", description: inputName },\n\t\t\t{ value: `${inputName}=false `, label: \"false\", description: inputName },\n\t\t]);\n\t}\n\n\treturn completeWorkflowToken(argumentPrefix, [\n\t\t{ value: \"--no-picker \", label: \"--no-picker\", description: \"Skip interactive input picker\" },\n\t\t{ value: \"--help \", label: \"--help\", description: \"Show this workflow's input schema\" },\n\t\t...Object.entries(workflow.inputs).map(([name, input]) => ({\n\t\t\tvalue: `${name}=`,\n\t\t\tlabel: name,\n\t\t\tdescription: input.description,\n\t\t})),\n\t]);\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for ctrl+p cycling\" },\n\t{ name: \"fast\", description: \"Configure Codex fast mode for chat and workflows\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{\n\t\tname: ATOMIC_GUIDE_COMMAND_NAME,\n\t\tdescription: ATOMIC_GUIDE_COMMAND_DESCRIPTION,\n\t\tgetArgumentCompletions: getAtomicGuideArgumentCompletions,\n\t},\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"trust\", description: \"Save project trust decision for future sessions\" },\n\t{ name: \"login\", description: \"Configure provider authentication\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Compact context with verbatim logical deletions\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"exit\", description: `Exit ${APP_NAME}` },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n\nexport const BUNDLED_EXTENSION_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{\n\t\tname: \"workflow\",\n\t\tdescription: \"Run or inspect Atomic workflows. Usage: /workflow <name> [key=value…] | /workflow [list|status|connect|attach|interrupt|kill|pause|resume|inputs|reload] [args]\",\n\t\tgetArgumentCompletions: getBundledWorkflowArgumentCompletions,\n\t},\n\t{ name: \"run\", description: \"Run a subagent directly: /run agent[output=file] [task] [--bg] [--fork]\" },\n\t{ name: \"chain\", description: \"Run agents in sequence: /chain scout task -> planner [--bg] [--fork]\" },\n\t{ name: \"run-chain\", description: \"Run a saved chain: /run-chain chainName -- task [--bg] [--fork]\" },\n\t{ name: \"parallel\", description: \"Run agents in parallel: /parallel scout task1 -> reviewer task2 [--bg] [--fork]\" },\n\t{ name: \"subagents-doctor\", description: \"Show subagent diagnostics\" },\n\t{ name: \"mcp\", description: \"Show MCP server status\" },\n\t{ name: \"mcp-auth\", description: \"Authenticate with an MCP server (OAuth)\" },\n\t{ name: \"curator\", description: \"Toggle or configure the search curator workflow\" },\n\t{ name: \"google-account\", description: \"Show the active Google account for Gemini Web\" },\n\t{ name: \"search\", description: \"Browse stored web search results\" },\n\t{ name: \"websearch\", description: \"Open web search curator\" },\n\t{ name: \"intercom\", description: \"Open session intercom overlay\" },\n];\n"]}
1
+ {"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EACN,gCAAgC,EAChC,yBAAyB,EACzB,iCAAiC,GACjC,MAAM,2BAA2B,CAAC;AA+BnC,MAAM,0BAA0B,GAAuB;IACtD,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,mCAAmC,EAAE;IACzF,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;IAC7F,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,2BAA2B,EAAE;IAC3E,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EA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EAAE,WAAW,EAAE,+CAA+C,EAAE;IACxF,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE;IACnE,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,yBAAyB,EAAE;IAC7D,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,+BAA+B,EAAE;CAClE,CAAC","sourcesContent":["import type { AutocompleteItem } from \"@earendil-works/pi-tui\";\nimport { APP_NAME } from \"../config.ts\";\nimport {\n\tATOMIC_GUIDE_COMMAND_DESCRIPTION,\n\tATOMIC_GUIDE_COMMAND_NAME,\n\tgetAtomicGuideArgumentCompletions,\n} from \"./atomic-guide-command.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n\tgetArgumentCompletions?: (\n\t\targumentPrefix: string,\n\t) => AutocompleteItem[] | null | Promise<AutocompleteItem[] | null>;\n}\n\ntype WorkflowInputCompletionMetadata = {\n\tdescription: string;\n\tkind?: \"boolean\" | \"number\" | \"string\";\n};\n\ntype WorkflowCompletionMetadata = {\n\tname: string;\n\tdescription: string;\n\tinputs: Record<string, WorkflowInputCompletionMetadata>;\n};\n\nconst WORKFLOW_ADMIN_COMPLETIONS: AutocompleteItem[] = [\n\t{ value: \"connect \", label: \"connect\", description: \"Attach to a run (picker if no id)\" },\n\t{ value: \"attach \", label: \"attach\", description: \"Open the in-place attach pane on a node\" },\n\t{ value: \"list \", label: \"list\", description: \"List registered workflows\" },\n\t{ value: \"status \", label: \"status\", description: \"List current-session active and retained terminal runs\" },\n\t{ value: \"interrupt \", label: \"interrupt\", description: \"Interrupt a run\" },\n\t{ value: \"kill \", label: \"kill\", description: \"Kill and retain a run\" },\n\t{ value: \"pause \", label: \"pause\", description: \"Pause a run or stage\" },\n\t{ value: \"resume \", label: \"resume\", description: \"Re-open overlay for a run\" },\n\t{ value: \"inputs \", label: \"inputs\", description: \"Show a workflow's input schema\" },\n\t{ value: \"reload \", label: \"reload\", description: \"Reload workflow resources\" },\n];\n\nconst BUNDLED_WORKFLOW_COMPLETION_METADATA: WorkflowCompletionMetadata[] = [\n\t{\n\t\tname: \"deep-research-codebase\",\n\t\tdescription: \"Scout + research-history chain → parallel specialist waves → aggregator for deep codebase research.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"Research question or investigation focus for the codebase.\", kind: \"string\" },\n\t\t\tmax_partitions: { description: \"Maximum number of codebase partitions to explore in parallel.\", kind: \"number\" },\n\t\t\tmax_concurrency: { description: \"Maximum number of workflow stages to run concurrently during deep research.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"goal\",\n\t\tdescription: \"Goal Runner workflow with bounded LM turns, acceptance criteria, ledger artifacts, reviewers, and reducer-gated completion.\",\n\t\tinputs: {\n\t\t\tobjective: { description: \"The objective or delta for this Goal Runner workflow run.\", kind: \"string\" },\n\t\t\tacceptance_criteria: { description: \"Original immutable task contract this run must remain consistent with.\", kind: \"string\" },\n\t\t\tmax_turns: { description: \"Maximum worker/review turns before Goal Runner stops as needs_human.\", kind: \"number\" },\n\t\t\tbase_branch: { description: \"Optional branch reviewers compare the current code delta against.\", kind: \"string\" },\n\t\t\tgit_worktree_dir: { description: \"Optional Git worktree path.\", kind: \"string\" },\n\t\t\tcreate_pr: { description: \"Whether to run the final pull-request creation stage after approval.\", kind: \"boolean\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"open-claude-design\",\n\t\tdescription: \"AI-powered design workflow: discovery, reference research, HTML generation, refinement, and handoff.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"What to design, such as a dashboard, page, component, or prototype.\", kind: \"string\" },\n\t\t\tdiscover_references: { description: \"Discover current reference designs and feed them to generation.\", kind: \"boolean\" },\n\t\t\tmax_refinements: { description: \"Maximum generate/user-feedback loop iterations.\", kind: \"number\" },\n\t\t},\n\t},\n\t{\n\t\tname: \"ralph\",\n\t\tdescription: \"Raw prompt → research → orchestrate → multi-model parallel review loop with bounded iteration.\",\n\t\tinputs: {\n\t\t\tprompt: { description: \"The task or goal to research, execute, and refine.\", kind: \"string\" },\n\t\t\tacceptance_criteria: { description: \"Original immutable task contract this run must remain consistent with.\", kind: \"string\" },\n\t\t\tmax_loops: { description: \"Maximum research/orchestrate/review iterations.\", kind: \"number\" },\n\t\t\tbase_branch: { description: \"Branch reviewers compare the current code delta against.\", kind: \"string\" },\n\t\t\tgit_worktree_dir: { description: \"Optional Git worktree path.\", kind: \"string\" },\n\t\t\tcreate_pr: { description: \"Whether to run the final pull-request creation stage.\", kind: \"boolean\" },\n\t\t},\n\t},\n];\n\nfunction completeWorkflowToken(argumentText: string, candidates: AutocompleteItem[]): AutocompleteItem[] | null {\n\tconst tokenStart = /\\s$/.test(argumentText)\n\t\t? argumentText.length\n\t\t: Math.max(argumentText.lastIndexOf(\" \"), argumentText.lastIndexOf(\"\\t\")) + 1;\n\tconst head = argumentText.slice(0, tokenStart);\n\tconst token = argumentText.slice(tokenStart);\n\tconst normalizedToken = token.trimEnd();\n\tconst filtered = candidates\n\t\t.filter((candidate) => candidate.value.startsWith(token) && candidate.value.trimEnd() !== normalizedToken)\n\t\t.map((candidate) => ({ ...candidate, value: `${head}${candidate.value}` }));\n\treturn filtered.length > 0 ? filtered : null;\n}\n\nfunction bundledWorkflowNameItems(): AutocompleteItem[] {\n\treturn BUNDLED_WORKFLOW_COMPLETION_METADATA.map((workflow) => ({\n\t\tvalue: `${workflow.name} `,\n\t\tlabel: workflow.name,\n\t\tdescription: `Run workflow: ${workflow.name}`,\n\t}));\n}\n\nexport function getBundledWorkflowArgumentCompletions(argumentPrefix: string): AutocompleteItem[] | null {\n\tconst parts = argumentPrefix.trim().split(/\\s+/).filter(Boolean);\n\tconst subcommand = parts[0] ?? \"\";\n\tconst workflowItems = bundledWorkflowNameItems();\n\tif (!argumentPrefix.includes(\" \")) {\n\t\treturn completeWorkflowToken(argumentPrefix, [...WORKFLOW_ADMIN_COMPLETIONS, ...workflowItems]);\n\t}\n\tif (subcommand === \"inputs\") return completeWorkflowToken(argumentPrefix, workflowItems);\n\tif (subcommand === \"interrupt\" || subcommand === \"kill\") {\n\t\tconst verb = subcommand === \"kill\" ? \"Kill and retain\" : \"Interrupt\";\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: \"--all \", label: \"--all\", description: `${verb} all in-flight runs` },\n\t\t\t{ value: \"--yes \", label: \"--yes\", description: \"Skip confirmation\" },\n\t\t\t{ value: \"-y \", label: \"-y\", description: \"Skip confirmation\" },\n\t\t]);\n\t}\n\tif (!subcommand) return completeWorkflowToken(argumentPrefix, [...WORKFLOW_ADMIN_COMPLETIONS, ...workflowItems]);\n\n\tconst workflow = BUNDLED_WORKFLOW_COMPLETION_METADATA.find((candidate) => candidate.name === subcommand);\n\tif (!workflow) return null;\n\tconst tokenStart = /\\s$/.test(argumentPrefix)\n\t\t? argumentPrefix.length\n\t\t: Math.max(argumentPrefix.lastIndexOf(\" \"), argumentPrefix.lastIndexOf(\"\\t\")) + 1;\n\tconst token = argumentPrefix.slice(tokenStart);\n\tconst equalsIndex = token.indexOf(\"=\");\n\tif (equalsIndex > 0) {\n\t\tconst inputName = token.slice(0, equalsIndex);\n\t\tconst input = workflow.inputs[inputName];\n\t\tif (input?.kind !== \"boolean\") return null;\n\t\treturn completeWorkflowToken(argumentPrefix, [\n\t\t\t{ value: `${inputName}=true `, label: \"true\", description: inputName },\n\t\t\t{ value: `${inputName}=false `, label: \"false\", description: inputName },\n\t\t]);\n\t}\n\n\treturn completeWorkflowToken(argumentPrefix, [\n\t\t{ value: \"--no-picker \", label: \"--no-picker\", description: \"Skip interactive input picker\" },\n\t\t{ value: \"--help \", label: \"--help\", description: \"Show this workflow's input schema\" },\n\t\t...Object.entries(workflow.inputs).map(([name, input]) => ({\n\t\t\tvalue: `${name}=`,\n\t\t\tlabel: name,\n\t\t\tdescription: input.description,\n\t\t})),\n\t]);\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"model\", description: \"Select model (opens selector UI)\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for ctrl+p cycling\" },\n\t{ name: \"fast\", description: \"Configure Codex fast mode for chat and workflows\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{\n\t\tname: ATOMIC_GUIDE_COMMAND_NAME,\n\t\tdescription: ATOMIC_GUIDE_COMMAND_DESCRIPTION,\n\t\tgetArgumentCompletions: getAtomicGuideArgumentCompletions,\n\t},\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message\" },\n\t{ name: \"clone\", description: \"Duplicate the current session at the current position\" },\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"trust\", description: \"Save project trust decision for future sessions\" },\n\t{ name: \"login\", description: \"Configure provider authentication\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session\" },\n\t{ name: \"compact\", description: \"Compact older context with verbatim line ranges\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"exit\", description: `Exit ${APP_NAME}` },\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n\nexport const BUNDLED_EXTENSION_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{\n\t\tname: \"workflow\",\n\t\tdescription: \"Run or inspect Atomic workflows. Usage: /workflow <name> [key=value…] | /workflow [list|status|connect|attach|interrupt|kill|pause|resume|inputs|reload] [args]\",\n\t\tgetArgumentCompletions: getBundledWorkflowArgumentCompletions,\n\t},\n\t{ name: \"run\", description: \"Run a subagent directly: /run agent[output=file] [task] [--bg] [--fork]\" },\n\t{ name: \"chain\", description: \"Run agents in sequence: /chain scout task -> planner [--bg] [--fork]\" },\n\t{ name: \"run-chain\", description: \"Run a saved chain: /run-chain chainName -- task [--bg] [--fork]\" },\n\t{ name: \"parallel\", description: \"Run agents in parallel: /parallel scout task1 -> reviewer task2 [--bg] [--fork]\" },\n\t{ name: \"subagents-doctor\", description: \"Show subagent diagnostics\" },\n\t{ name: \"mcp\", description: \"Show MCP server status\" },\n\t{ name: \"mcp-auth\", description: \"Authenticate with an MCP server (OAuth)\" },\n\t{ name: \"curator\", description: \"Toggle or configure the search curator workflow\" },\n\t{ name: \"google-account\", description: \"Show the active Google account for Gemini Web\" },\n\t{ name: \"search\", description: \"Browse stored web search results\" },\n\t{ name: \"websearch\", description: \"Open web search curator\" },\n\t{ name: \"intercom\", description: \"Open session intercom overlay\" },\n];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"source-info.d.ts","sourceRoot":"","sources":["../../src/core/source-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;AAC3D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,CAAC;AAEnD,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,UAAU,CAQjF;AAED,wBAAgB,yBAAyB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IACR,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,GACC,UAAU,CAQZ","sourcesContent":["import type { PathMetadata } from \"./package-manager.ts\";\n\nexport type SourceScope = \"user\" | \"project\" | \"temporary\";\nexport type SourceOrigin = \"package\" | \"top-level\";\n\nexport interface SourceInfo {\n\tpath: string;\n\tsource: string;\n\tscope: SourceScope;\n\torigin: SourceOrigin;\n\tbaseDir?: string;\n}\n\nexport function createSourceInfo(path: string, metadata: PathMetadata): SourceInfo {\n\treturn {\n\t\tpath,\n\t\tsource: metadata.source,\n\t\tscope: metadata.scope,\n\t\torigin: metadata.origin,\n\t\tbaseDir: metadata.baseDir,\n\t};\n}\n\nexport function createSyntheticSourceInfo(\n\tpath: string,\n\toptions: {\n\t\tsource: string;\n\t\tscope?: SourceScope;\n\t\torigin?: SourceOrigin;\n\t\tbaseDir?: string;\n\t},\n): SourceInfo {\n\treturn {\n\t\tpath,\n\t\tsource: options.source,\n\t\tscope: options.scope ?? \"temporary\",\n\t\torigin: options.origin ?? \"top-level\",\n\t\tbaseDir: options.baseDir,\n\t};\n}\n"]}
1
+ {"version":3,"file":"source-info.d.ts","sourceRoot":"","sources":["../../src/core/source-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;AAC3D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,WAAW,CAAC;AA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;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,+DAA+D;IAC/D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gCAAgC;IAChC,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,yBAAyB;IACzB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAyK3E","sourcesContent":["/**\n * System prompt construction and project context loading\n */\n\nimport { getDocsPath, getExamplesPath, getReadmePath } from \"../config.ts\";\nimport { formatSkillsForPrompt, type Skill } from \"./skills.ts\";\n\nconst DEFAULT_PROMPT_TOOLS = [\n \"read\",\n \"bash\",\n \"edit\",\n \"write\",\n \"find\",\n \"search\",\n \"ask_user_question\",\n \"todo\",\n] as const;\n\nexport interface SystemPromptModel {\n /** Provider identifier for the selected model. */\n provider: string;\n /** Stable provider-specific model identifier. */\n id: string;\n /** Human-readable model name, when available. */\n name?: string;\n}\n\nexport interface BuildSystemPromptOptions {\n /** Custom system prompt (replaces default). */\n customPrompt?: string;\n /** Tools to include in prompt. Default: [read, bash, edit, write, find, search, ask_user_question, todo] */\n selectedTools?: string[];\n /** Tool names explicitly excluded by the caller and omitted from generated guidance. */\n excludedTools?: string[];\n /** Optional one-line tool snippets keyed by tool name. */\n toolSnippets?: Record<string, string>;\n /** Additional guideline bullets appended to the default system prompt guidelines. */\n promptGuidelines?: string[];\n /** Text to append to system prompt. */\n appendSystemPrompt?: string;\n /** Working directory. */\n cwd: string;\n /** Currently selected model, used for model-aware prompt metadata. */\n selectedModel?: SystemPromptModel;\n /** Current reasoning/thinking level for the selected model. */\n selectedThinkingLevel?: string;\n /** Pre-loaded context files. */\n contextFiles?: Array<{ path: string; content: string }>;\n /** Pre-loaded skills. */\n skills?: Skill[];\n}\n\n/** Build the system prompt with tools, guidelines, and context */\nexport function buildSystemPrompt(options: BuildSystemPromptOptions): string {\n const {\n customPrompt,\n selectedTools,\n excludedTools,\n toolSnippets,\n promptGuidelines,\n appendSystemPrompt,\n cwd,\n selectedModel,\n selectedThinkingLevel,\n contextFiles: providedContextFiles,\n skills: providedSkills,\n } = options;\n const resolvedCwd = cwd;\n const promptCwd = resolvedCwd.replace(/\\\\/g, \"/\");\n\n const now = new Date();\n const year = now.getFullYear();\n const month = String(now.getMonth() + 1).padStart(2, \"0\");\n const day = String(now.getDate()).padStart(2, \"0\");\n const date = `${year}-${month}-${day}`;\n\n const appendSection = appendSystemPrompt ? `\\n\\n${appendSystemPrompt}` : \"\";\n const modelName =\n selectedModel?.name?.trim() || selectedModel?.id || \"unknown\";\n const modelReasoningLevel = selectedThinkingLevel?.trim() || \"off\";\n\n const contextFiles = providedContextFiles ?? [];\n const skills = providedSkills ?? [];\n const explicitlyExcludedTools = new Set(excludedTools ?? []);\n const isPromptToolAvailable = (name: string): boolean =>\n (!selectedTools || selectedTools.includes(name)) &&\n !explicitlyExcludedTools.has(name);\n\n if (customPrompt) {\n let prompt = customPrompt;\n\n if (appendSection) {\n prompt += appendSection;\n }\n\n // Append project context files\n if (contextFiles.length > 0) {\n prompt += \"\\n\\n# Project Context\\n\\n\";\n prompt += \"Project-specific instructions and guidelines:\\n\\n\";\n for (const { path: filePath, content } of contextFiles) {\n prompt += `<context_file path=\\\"${filePath}\\\">\\n${content}\\n</context_file>\\n\\n`;\n }\n }\n\n // Append skills section (only if read tool is available)\n if (isPromptToolAvailable(\"read\") && skills.length > 0) {\n prompt += formatSkillsForPrompt(skills);\n }\n\n // Add model metadata, date, and working directory last\n prompt += `\\nModel name (used for commit attribution): ${modelName}`;\n prompt += `\\nModel reasoning level: ${modelReasoningLevel}`;\n prompt += `\\nCurrent date: ${date}`;\n prompt += `\\nCurrent working directory: ${promptCwd}`;\n\n return prompt;\n }\n\n // Get absolute paths to documentation and examples\n const readmePath = getReadmePath();\n const docsPath = getDocsPath();\n const examplesPath = getExamplesPath();\n\n // Build tools list based on selected tools.\n // A tool appears in Available tools only when the caller provides a one-line snippet.\n const tools = (selectedTools ?? DEFAULT_PROMPT_TOOLS).filter(\n (name) => !explicitlyExcludedTools.has(name),\n );\n const visibleTools = tools.filter((name) => !!toolSnippets?.[name]);\n const toolsList =\n visibleTools.length > 0\n ? visibleTools\n .map((name) => `- ${name}: ${toolSnippets![name]}`)\n .join(\"\\n\")\n : \"(none)\";\n\n // Build guidelines based on which tools are actually available\n const guidelinesList: string[] = [];\n const guidelinesSet = new Set<string>();\n const addGuideline = (guideline: string): void => {\n if (guidelinesSet.has(guideline)) {\n return;\n }\n guidelinesSet.add(guideline);\n guidelinesList.push(guideline);\n };\n\n const hasBash = tools.includes(\"bash\");\n const hasFind = tools.includes(\"find\");\n const hasLs = tools.includes(\"ls\");\n const hasRead = tools.includes(\"read\");\n const shouldIncludeAskUserFallbackGuidance =\n selectedTools !== undefined &&\n tools.length > 0 &&\n !tools.includes(\"ask_user_question\") &&\n !explicitlyExcludedTools.has(\"ask_user_question\");\n\n // File exploration guidelines\n if (hasBash && !hasFind && !hasLs) {\n addGuideline(\"Use bash for file operations like ls, rg, find\");\n }\n if (shouldIncludeAskUserFallbackGuidance) {\n addGuideline(\"Clarify ambiguous requirements using the ask_user_question tool if available.\");\n }\n\n for (const guideline of promptGuidelines ?? []) {\n const normalized = guideline.trim();\n if (normalized.length > 0) {\n addGuideline(normalized);\n }\n }\n\n // Always include these\n addGuideline(\"Be concise in your responses\");\n addGuideline(\"Show file paths clearly when working with files\");\n\n const guidelines = guidelinesList.map((g) => `- ${g}`).join(\"\\n\");\n\n let prompt = `You are an expert coding assistant operating named Atomic, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.\n\nAvailable tools:\n${toolsList}\n\nIn addition to the tools above, you may have access to other custom tools depending on the project.\n\nGuidelines:\n${guidelines}\n\nAtomic documentation (read only when the user asks about customizing Atomic itself, its SDK, creating workflows, packages, extensions, themes, skills, or TUI):\n- Main documentation: ${readmePath}\n- Additional docs: ${docsPath}\n- Examples: ${examplesPath} (extensions, custom tools, SDK)\n- Docs/examples references above must be resolved against these absolute roots; e.g. docs/foo.md means ${docsPath}/foo.md and examples/bar means ${examplesPath}/bar.\n- When asked about: atomic workflows (docs/workflows.md), extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), atomic packages (docs/packages.md)\n- When working on Atomic topics, read the docs and examples, and follow .md cross-references before implementing\n- Always read Atomic .md files completely and follow links to related docs (e.g., tui.md for TUI API details)`;\n\n if (appendSection) {\n prompt += appendSection;\n }\n\n // Append project context files\n if (contextFiles.length > 0) {\n prompt += \"\\n\\n# Project Context\\n\\n\";\n prompt += \"Project-specific instructions and guidelines:\\n\\n\";\n for (const { path: filePath, content } of contextFiles) {\n prompt += `<context_file path=\\\"${filePath}\\\">\\n${content}\\n</context_file>\\n\\n`;\n }\n }\n\n // Append skills section (only if read tool is available)\n if (hasRead && skills.length > 0) {\n prompt += formatSkillsForPrompt(skills);\n }\n\n // Add model metadata, date, and working directory last\n prompt += `\\nModel name (used for commit attribution): ${modelName}`;\n prompt += `\\nModel reasoning level: ${modelReasoningLevel}`;\n prompt += `\\nCurrent date: ${date}`;\n prompt += `\\nCurrent working directory: ${promptCwd}`;\n\n return prompt;\n}\n"]}
1
+ {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/core/system-prompt.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAyB,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAahE,MAAM,WAAW,iBAAiB;IAChC,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4GAA4G;IAC5G,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,+DAA+D;IAC/D,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,gCAAgC;IAChC,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,yBAAyB;IACzB,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB;AAED,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAyK3E"}
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/core/telemetry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAO7D,wBAAgB,yBAAyB,CACxC,eAAe,EAAE,eAAe,EAChC,YAAY,GAAE,MAAM,GAAG,SAAsC,GAC3D,OAAO,CAET","sourcesContent":["import { ENV_TELEMETRY, getEnvValue } from \"../config.ts\";\nimport type { SettingsManager } from \"./settings-manager.ts\";\n\nfunction isTruthyEnvFlag(value: string | undefined): boolean {\n\tif (!value) return false;\n\treturn value === \"1\" || value.toLowerCase() === \"true\" || value.toLowerCase() === \"yes\";\n}\n\nexport function isInstallTelemetryEnabled(\n\tsettingsManager: SettingsManager,\n\ttelemetryEnv: string | undefined = getEnvValue(ENV_TELEMETRY),\n): boolean {\n\treturn telemetryEnv !== undefined ? isTruthyEnvFlag(telemetryEnv) : settingsManager.getEnableInstallTelemetry();\n}\n"]}
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/core/telemetry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAO7D,wBAAgB,yBAAyB,CACxC,eAAe,EAAE,eAAe,EAChC,YAAY,GAAE,MAAM,GAAG,SAAsC,GAC3D,OAAO,CAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"thinking-blocks.d.ts","sourceRoot":"","sources":["../../src/core/thinking-blocks.ts"],"names":[],"mappings":"AAAA,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,UAAU,GAAG,mBAAmB,CAEpG;AAED,wBAAgB,qCAAqC,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAK1F;AAED,wBAAgB,uCAAuC,CAAC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAI/G","sourcesContent":["export function isAssistantThinkingBlockType(type: unknown): type is \"thinking\" | \"redacted_thinking\" {\n\treturn type === \"thinking\" || type === \"redacted_thinking\";\n}\n\nexport function contentArrayHasAssistantThinkingBlock(content: readonly unknown[]): boolean {\n\treturn content.some((block) => {\n\t\tif (!block || typeof block !== \"object\") return false;\n\t\treturn isAssistantThinkingBlockType((block as { type?: unknown }).type);\n\t});\n}\n\nexport function messageHasAssistantThinkingContentBlock(message: { role?: unknown; content?: unknown }): boolean {\n\treturn message.role === \"assistant\" &&\n\t\tArray.isArray(message.content) &&\n\t\tcontentArrayHasAssistantThinkingBlock(message.content);\n}\n"]}
1
+ {"version":3,"file":"thinking-blocks.d.ts","sourceRoot":"","sources":["../../src/core/thinking-blocks.ts"],"names":[],"mappings":"AAAA,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,UAAU,GAAG,mBAAmB,CAEpG;AAED,wBAAgB,qCAAqC,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAK1F;AAED,wBAAgB,uCAAuC,CAAC,OAAO,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAI/G"}
@@ -1 +1 @@
1
- {"version":3,"file":"timings.d.ts","sourceRoot":"","sources":["../../src/core/timings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,YAAY,CAAC;AAIhD,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,WAAW,CAAC;CACvB;AAED,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAYD,wBAAgB,YAAY,CAAC,SAAS,GAAE,WAAoB,GAAG,IAAI,CAIlE;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,WAAoB,GAAG,IAAI,CAMzE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,WAAoB,GAAG,UAAU,GAAG,IAAI,CAGjG;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAM3D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,GAAE,WAAoB,GAAG,IAAI,CAI7F;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,WAAoB,GAAG,IAAI,CAIzF;AAaD,wBAAgB,YAAY,IAAI,IAAI,CAKnC","sourcesContent":["/**\n * Central timing instrumentation for startup profiling.\n * Enable with the app-specific timing environment variable (for Atomic, ATOMIC_TIMING=1).\n */\n\nimport { ENV_TIMING, getEnvValue } from \"../config.ts\";\n\nconst ENABLED = getEnvValue(ENV_TIMING) === \"1\";\n\ninterface TimingNamespace {\n\ttimings: Array<{ label: string; ms: number }>;\n\tlastTime: number;\n\tresetTime: number;\n}\n\nexport type TimingLabel = \"main\" | \"extensions\";\n\nconst timingNamespaces = new Map<TimingLabel, TimingNamespace>();\n\nexport interface TimingSpan {\n\tlabel: string;\n\tstart: number;\n\tnamespace: TimingLabel;\n}\n\nexport function isTimingEnabled(): boolean {\n\treturn ENABLED;\n}\n\nfunction ensureNamespace(namespace: TimingLabel): TimingNamespace {\n\tlet entry = timingNamespaces.get(namespace);\n\tif (!entry) {\n\t\tconst now = Date.now();\n\t\tentry = { timings: [], lastTime: now, resetTime: now };\n\t\ttimingNamespaces.set(namespace, entry);\n\t}\n\treturn entry;\n}\n\nexport function resetTimings(namespace: TimingLabel = \"main\"): void {\n\tif (!ENABLED) return;\n\tconst now = Date.now();\n\ttimingNamespaces.set(namespace, { timings: [], lastTime: now, resetTime: now });\n}\n\nexport function time(label: string, namespace: TimingLabel = \"main\"): void {\n\tif (!ENABLED) return;\n\tconst now = Date.now();\n\tconst timingNamespace = ensureNamespace(namespace);\n\ttimingNamespace.timings.push({ label, ms: now - timingNamespace.lastTime });\n\ttimingNamespace.lastTime = now;\n}\n\nexport function startTimingSpan(label: string, namespace: TimingLabel = \"main\"): TimingSpan | null {\n\tif (!ENABLED) return null;\n\treturn { label, start: Date.now(), namespace };\n}\n\nexport function endTimingSpan(span: TimingSpan | null): void {\n\tif (!ENABLED || !span) return;\n\tconst now = Date.now();\n\tconst timingNamespace = ensureNamespace(span.namespace);\n\ttimingNamespace.timings.push({ label: span.label, ms: now - span.start });\n\ttimingNamespace.lastTime = now;\n}\n\nexport function recordTiming(label: string, ms: number, namespace: TimingLabel = \"main\"): void {\n\tif (!ENABLED) return;\n\tconst timingNamespace = ensureNamespace(namespace);\n\ttimingNamespace.timings.push({ label, ms });\n}\n\nexport function recordTimeSinceReset(label: string, namespace: TimingLabel = \"main\"): void {\n\tif (!ENABLED) return;\n\tconst timingNamespace = ensureNamespace(namespace);\n\ttimingNamespace.timings.push({ label, ms: Date.now() - timingNamespace.resetTime });\n}\n\nfunction printTimingGroup(title: string, namespace: TimingNamespace): void {\n\tconst printableTimings = namespace.timings.filter((timing) => timing.ms >= 0);\n\tif (printableTimings.length === 0) return;\n\tconsole.error(`\\n--- ${title} ---`);\n\tfor (const t of printableTimings) {\n\t\tconsole.error(` ${t.label}: ${t.ms}ms`);\n\t}\n\tconsole.error(` TOTAL initialization time: ${Date.now() - namespace.resetTime}ms`);\n\tconsole.error(`${\"-\".repeat(title.length + 8)}\\n`);\n}\n\nexport function printTimings(): void {\n\tif (!ENABLED) return;\n\tfor (const [namespace, timingNamespace] of timingNamespaces) {\n\t\tprintTimingGroup(`Startup Timings: ${namespace}`, timingNamespace);\n\t}\n}\n"]}
1
+ {"version":3,"file":"timings.d.ts","sourceRoot":"","sources":["../../src/core/timings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,YAAY,CAAC;AAIhD,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,WAAW,CAAC;CACvB;AAED,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAYD,wBAAgB,YAAY,CAAC,SAAS,GAAE,WAAoB,GAAG,IAAI,CAIlE;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,WAAoB,GAAG,IAAI,CAMzE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,WAAoB,GAAG,UAAU,GAAG,IAAI,CAGjG;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAM3D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,GAAE,WAAoB,GAAG,IAAI,CAI7F;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,GAAE,WAAoB,GAAG,IAAI,CAIzF;AAaD,wBAAgB,YAAY,IAAI,IAAI,CAKnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"artifact-protocol.d.ts","sourceRoot":"","sources":["../../../src/core/tools/artifact-protocol.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAItE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAErD;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGjE;AAMD,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,GAAG,SAAS,CActG;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,SAAS,MAAM,EAAE,GAAG,sBAAsB,CAanG;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,CAIjF","sourcesContent":["/**\n * artifact:// protocol resolution, mirrored from oh-my-pi's\n * `packages/coding-agent/src/internal-urls/artifact-protocol.ts` at 15b5c1397fc.\n *\n * `artifact://<numericId>` resolves to an artifact file by matching the\n * `${id}.` prefix. The calling session's artifacts dir is searched first,\n * then any other registered active dirs (so subagents can see parent\n * artifacts). Artifacts are immutable reads.\n */\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { getArtifactManager } from \"./artifacts.ts\";\nimport type { InternalResourceRouter } from \"./resource-selectors.ts\";\n\nconst activeArtifactDirs = new Set<string>();\n\nexport function registerArtifactDir(dir: string): void {\n\tactiveArtifactDirs.add(dir);\n}\n\nexport function unregisterArtifactDir(dir: string): void {\n\tactiveArtifactDirs.delete(dir);\n}\n\nexport function artifactIdFromUrl(url: string): string | undefined {\n\tconst match = url.match(/^artifact:\\/\\/([^/]+)/i);\n\treturn match?.[1];\n}\n\nfunction isValidId(id: string): boolean {\n\treturn /^\\d+$/.test(id);\n}\n\n/** Resolve an artifact:// url to a backing file path across known dirs. */\nexport function resolveArtifactUrl(url: string, pinnedDirs: readonly string[] = []): string | undefined {\n\tconst id = artifactIdFromUrl(url);\n\tif (id === undefined) throw new Error(\"artifact:// URL requires a numeric ID: artifact://0\");\n\tif (!isValidId(id)) throw new Error(`artifact:// ID must be numeric, got: ${id}`);\n\tconst ordered = [...pinnedDirs, ...activeArtifactDirs];\n\tconst seen = new Set<string>();\n\tfor (const dir of ordered) {\n\t\tif (seen.has(dir)) continue;\n\t\tseen.add(dir);\n\t\tconst resolved = getArtifactManager(dir).resolve(id);\n\t\tif (resolved) return resolved;\n\t}\n\tconst available = [...new Set([...pinnedDirs, ...activeArtifactDirs])].flatMap((dir) => getArtifactManager(dir).list());\n\tthrow new Error(`Artifact ${id} not found. Available: ${available.join(\", \") || \"none\"}`);\n}\n\n/** Build an InternalResourceRouter that resolves/reads artifact:// urls. */\nexport function createArtifactRouter(getPinnedDirs: () => readonly string[]): InternalResourceRouter {\n\treturn {\n\t\tresolve: (url) => {\n\t\t\tif (!/^artifact:\\/\\//i.test(url)) return undefined;\n\t\t\ttry { return resolveArtifactUrl(url, getPinnedDirs()); } catch { return undefined; }\n\t\t},\n\t\tread: (url) => {\n\t\t\tif (!/^artifact:\\/\\//i.test(url)) return undefined;\n\t\t\tconst path = resolveArtifactUrl(url, getPinnedDirs());\n\t\t\tif (!path || !existsSync(path)) throw new Error(`Artifact not found: ${url}`);\n\t\t\treturn readFileSync(path, \"utf8\");\n\t\t},\n\t};\n}\n\n/** Resolve and read an artifact directly from a context's artifact dirs. */\nexport function readArtifactUrl(url: string, dirs: readonly string[] = []): string {\n\tconst path = resolveArtifactUrl(url, dirs);\n\tif (!path || !existsSync(path)) throw new Error(`Artifact not found: ${url}`);\n\treturn readFileSync(path, \"utf8\");\n}\n"]}
1
+ {"version":3,"file":"artifact-protocol.d.ts","sourceRoot":"","sources":["../../../src/core/tools/artifact-protocol.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAItE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAErD;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEvD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGjE;AAMD,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,GAAG,SAAS,CActG;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,SAAS,MAAM,EAAE,GAAG,sBAAsB,CAanG;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,SAAS,MAAM,EAAO,GAAG,MAAM,CAIjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/core/tools/artifacts.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACX;AAED,qBAAa,eAAe;;IAK3B,YAAY,GAAG,EAAE,MAAM,EAEtB;IAED,IAAI,GAAG,IAAI,MAAM,CAEhB;IAkBD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAK5C;IAED,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM9C;IAED,mFAAmF;IACnF,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMtC;IAED,IAAI,IAAI,MAAM,EAAE,CASf;CACD;AAID,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,CAOxE;AAED,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD","sourcesContent":["/**\n * Session artifact storage, mirrored from oh-my-pi's\n * `packages/coding-agent/src/session/artifacts.ts` at 15b5c1397fc.\n *\n * Artifacts are persisted as `<numericId>.<toolType>.log` files inside a\n * session artifacts directory. IDs are sequential and scan-initialized from\n * existing files so a resumed session keeps a contiguous id space. Subagents\n * that share a session dir share the same manager/id space.\n */\nimport { existsSync, mkdirSync, readdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nexport interface AllocatedArtifact {\n\tpath: string;\n\tid: string;\n}\n\nexport class ArtifactManager {\n\t#nextId = 0;\n\treadonly #dir: string;\n\t#initialized = false;\n\n\tconstructor(dir: string) {\n\t\tthis.#dir = dir;\n\t}\n\n\tget dir(): string {\n\t\treturn this.#dir;\n\t}\n\n\t#init(): void {\n\t\tif (this.#initialized) return;\n\t\tthis.#initialized = true;\n\t\tlet max = -1;\n\t\tif (existsSync(this.#dir)) {\n\t\t\tfor (const name of readdirSync(this.#dir)) {\n\t\t\t\tconst match = name.match(/^(\\d+)\\..*\\.log$/);\n\t\t\t\tif (match) {\n\t\t\t\t\tconst id = Number.parseInt(match[1] ?? \"0\", 10);\n\t\t\t\t\tif (id > max) max = id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.#nextId = max + 1;\n\t}\n\n\tallocate(toolType: string): AllocatedArtifact {\n\t\tthis.#init();\n\t\tconst id = String(this.#nextId++);\n\t\tconst path = join(this.#dir, `${id}.${toolType}.log`);\n\t\treturn { path, id };\n\t}\n\n\tsave(content: string, toolType: string): string {\n\t\tthis.#init();\n\t\tconst { path, id } = this.allocate(toolType);\n\t\tif (!existsSync(this.#dir)) mkdirSync(this.#dir, { recursive: true });\n\t\twriteFileSync(path, content, \"utf8\");\n\t\treturn id;\n\t}\n\n\t/** Resolve a numeric id to its artifact file path, matching by `${id}.` prefix. */\n\tresolve(id: string): string | undefined {\n\t\tthis.#init();\n\t\tif (!existsSync(this.#dir)) return undefined;\n\t\tconst prefix = `${id}.`;\n\t\tfor (const name of readdirSync(this.#dir)) if (name.startsWith(prefix) && name.endsWith(\".log\")) return join(this.#dir, name);\n\t\treturn undefined;\n\t}\n\n\tlist(): string[] {\n\t\tthis.#init();\n\t\tif (!existsSync(this.#dir)) return [];\n\t\tconst ids: number[] = [];\n\t\tfor (const name of readdirSync(this.#dir)) {\n\t\t\tconst match = name.match(/^(\\d+)\\..*\\.log$/);\n\t\t\tif (match) ids.push(Number.parseInt(match[1] ?? \"0\", 10));\n\t\t}\n\t\treturn ids.sort((a, b) => a - b).map(String);\n\t}\n}\n\nconst managers = new Map<string, ArtifactManager>();\n\n/** Returns a shared ArtifactManager for a session artifacts dir (cached per dir). */\nexport function getArtifactManager(artifactsDir: string): ArtifactManager {\n\tlet manager = managers.get(artifactsDir);\n\tif (!manager) {\n\t\tmanager = new ArtifactManager(artifactsDir);\n\t\tmanagers.set(artifactsDir, manager);\n\t}\n\treturn manager;\n}\n\nexport function resetArtifactManagerCache(): void {\n\tmanagers.clear();\n}\n"]}
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/core/tools/artifacts.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACX;AAED,qBAAa,eAAe;;IAK3B,YAAY,GAAG,EAAE,MAAM,EAEtB;IAED,IAAI,GAAG,IAAI,MAAM,CAEhB;IAkBD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAK5C;IAED,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM9C;IAED,mFAAmF;IACnF,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMtC;IAED,IAAI,IAAI,MAAM,EAAE,CASf;CACD;AAID,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,CAOxE;AAED,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD"}
@@ -1 +1 @@
1
- {"version":3,"file":"ask-user-question.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/ask-user-question.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAIN,KAAK,YAAY,EAGjB,oBAAoB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAI/E,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,YAAY,GAAG,kBAAkB,EAAE,CAWlF;AAED,eAAO,MAAM,sBAAsB,iGAA0I,CAAC;AAC9K,eAAO,MAAM,yBAAyB,EAAE,MAAM,EAK7C,CAAC;AAEF,wBAAgB,mCAAmC,IAAI,cAAc,CAAC,OAAO,oBAAoB,EAAE,OAAO,CAAC,CA4E1G;AAED,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import type { ToolDefinition } from \"../../extensions/types.ts\";\nimport { loadConfig, validateGuidanceFields } from \"./config.ts\";\nimport { QuestionnaireSession } from \"./state/questionnaire-session.ts\";\nimport { ROW_INTENT_META, sentinelsToAppend } from \"./state/row-intent.ts\";\nimport { buildQuestionnaireResponse, buildToolResult } from \"./tool/response-envelope.ts\";\nimport {\n\tMAX_OPTIONS,\n\tMAX_QUESTIONS,\n\tMIN_OPTIONS,\n\ttype QuestionData,\n\ttype QuestionnaireResult,\n\ttype QuestionParams,\n\tQuestionParamsSchema,\n} from \"./tool/types.ts\";\nimport { validateQuestionnaire } from \"./tool/validate-questionnaire.ts\";\nimport type { WrappingSelectItem } from \"./view/components/wrapping-select.ts\";\n\nconst ERROR_NO_UI = \"Error: UI not available (running in non-interactive mode)\";\n\nexport function buildItemsForQuestion(question: QuestionData): WrappingSelectItem[] {\n\tconst items: WrappingSelectItem[] = question.options.map((o) => ({\n\t\tkind: \"option\",\n\t\tlabel: o.label,\n\t\tdescription: o.description,\n\t}));\n\tconst hasAnyPreview = question.options.some((o) => typeof o.preview === \"string\" && o.preview.length > 0);\n\tfor (const kind of sentinelsToAppend(question, hasAnyPreview)) {\n\t\titems.push({ kind, label: ROW_INTENT_META[kind].label });\n\t}\n\treturn items;\n}\n\nexport const DEFAULT_PROMPT_SNIPPET = `Ask the user up to ${MAX_QUESTIONS} structured questions (${MIN_OPTIONS}-${MAX_OPTIONS} options each) when requirements are ambiguous`;\nexport const DEFAULT_PROMPT_GUIDELINES: string[] = [\n\t`Use ask_user_question whenever the user's request is underspecified and you cannot proceed without concrete decisions — you can ask up to ${MAX_QUESTIONS} questions per invocation.`,\n\t`Each question MUST have ${MIN_OPTIONS}-${MAX_OPTIONS} options. Every option requires a concise label (1-5 words) and a description explaining what the choice means or its trade-offs. The user can additionally type a custom answer (\"Type something.\" row is appended automatically to single-select questions) or pick \"Chat about this\" to abandon the questionnaire.`,\n\t`Set multiSelect: true when multiple answers are valid; this suppresses the \"Type something.\" row. Provide an options[].preview markdown string when an option benefits from richer side-by-side context (mockups, code snippets, diagrams, configs) — single-select only. NOTE: any non-empty preview on a single-select question ALSO suppresses the \"Type something.\" row (no room in the side-by-side layout); \"Chat about this\" remains the escape hatch. If you recommend a specific option, make it the first option and append \"(Recommended)\" to its label.`,\n\t\"Do not stack multiple ask_user_question calls back-to-back — group all clarifying questions into one invocation.\",\n];\n\nexport function createAskUserQuestionToolDefinition(): ToolDefinition<typeof QuestionParamsSchema, unknown> {\n\tconst guidance = validateGuidanceFields(loadConfig().guidance);\n\treturn {\n\t\tname: \"ask_user_question\",\n\t\tlabel: \"Ask User Question\",\n\t\tdescription: `Ask the user one or more structured questions during execution. Use when you need to:\n1. Gather user preferences or requirements\n2. Clarify ambiguous instructions\n3. Get decisions on implementation choices as you work\n4. Offer choices to the user about what direction to take\n\nUsage notes:\n- Users will always be able to type a custom answer (\"Type something.\" row is appended automatically to every single-select question) or pick \"Chat about this\" to abandon the questionnaire and continue in free-form conversation. Do NOT author \"Other\" / \"Type something.\" / \"Chat about this\" labels yourself — duplicates are rejected at runtime.\n- Use multiSelect: true to allow multiple answers to be selected for a question. The \"Type something.\" row is suppressed on multi-select questions, and is ALSO suppressed on single-select questions where any option carries a \\`preview\\` (the side-by-side layout has no room for inline custom text — \"Chat about this\" remains as the free-form escape hatch).\n- If you recommend a specific option, make that the first option in the list and add \"(Recommended)\" at the end of the label.\n\nPreview feature:\nUse the optional \\`preview\\` field on options when presenting concrete artifacts that users need to visually compare:\n- ASCII mockups of UI layouts or components\n- Code snippets showing different implementations\n- Diagram variations\n- Configuration examples\n\nPreview content is rendered as markdown in a monospace box. Multi-line text with newlines is supported. When any option has a preview, the UI switches to a side-by-side layout with a vertical option list on the left and preview on the right. Do not use previews for simple preference questions where labels and descriptions suffice. Note: previews are only supported for single-select questions (not multiSelect).`,\n\t\tpromptSnippet: guidance.promptSnippet ?? DEFAULT_PROMPT_SNIPPET,\n\t\tpromptGuidelines: guidance.promptGuidelines ?? DEFAULT_PROMPT_GUIDELINES,\n\t\tparameters: QuestionParamsSchema,\n\n\t\tasync execute(_toolCallId, params, signal, _onUpdate, ctx) {\n\t\t\tconst typed = params as unknown as QuestionParams;\n\t\t\tif (!ctx.hasUI) return buildToolResult(ERROR_NO_UI, { answers: [], cancelled: true, error: \"no_ui\" });\n\n\t\t\tconst validation = validateQuestionnaire(typed);\n\t\t\tif (!validation.ok) {\n\t\t\t\treturn buildToolResult(validation.message, {\n\t\t\t\t\tanswers: [],\n\t\t\t\t\tcancelled: true,\n\t\t\t\t\terror: validation.error,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst itemsByTab: WrappingSelectItem[][] = typed.questions.map((q) => buildItemsForQuestion(q));\n\n\t\t\t// Suspend the animated working loader for the lifetime of the blocking dialog.\n\t\t\t//\n\t\t\t// The questionnaire mounts inline, directly below the status/working-loader row.\n\t\t\t// That loader ticks every ~80ms and calls `requestRender()` on each frame. On a\n\t\t\t// short terminal the (tall) side-by-side dialog pushes the loader line above the\n\t\t\t// viewport top, so pi-tui's differential renderer sees `firstChanged < viewportTop`\n\t\t\t// and falls back to a full clear+replay (`\\x1b[2J\\x1b[H\\x1b[3J`) on every tick. The\n\t\t\t// transcript is replayed before the dialog each time, which is the flicker. The\n\t\t\t// loader conveys nothing while we're blocked on human input, so hide it for the\n\t\t\t// duration and restore it once the dialog closes (on every path).\n\t\t\t//\n\t\t\t// Guarded: some hosts (e.g. the workflow stage-UI broker) pass a minimal UI\n\t\t\t// context that only implements `custom`, so treat a missing loader control as a\n\t\t\t// no-op rather than throwing.\n\t\t\tctx.ui.setWorkingVisible?.(false);\n\t\t\ttry {\n\t\t\t\tconst result = await ctx.ui.custom<QuestionnaireResult>((tui, theme, _kb, done) => {\n\t\t\t\t\tconst session = new QuestionnaireSession({\n\t\t\t\t\t\ttui,\n\t\t\t\t\t\ttheme,\n\t\t\t\t\t\tparams: typed,\n\t\t\t\t\t\titemsByTab,\n\t\t\t\t\t\tdone,\n\t\t\t\t\t});\n\t\t\t\t\treturn session.component;\n\t\t\t\t}, { signal });\n\n\t\t\t\treturn buildQuestionnaireResponse(result, typed);\n\t\t\t} finally {\n\t\t\t\tctx.ui.setWorkingVisible?.(true);\n\t\t\t}\n\t\t},\n\t};\n}\n\nexport { buildQuestionnaireResponse, buildToolResult };\n"]}
1
+ {"version":3,"file":"ask-user-question.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/ask-user-question.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAIhE,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAIN,KAAK,YAAY,EAGjB,oBAAoB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAI/E,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,YAAY,GAAG,kBAAkB,EAAE,CAWlF;AAED,eAAO,MAAM,sBAAsB,iGAA0I,CAAC;AAC9K,eAAO,MAAM,yBAAyB,EAAE,MAAM,EAK7C,CAAC;AAEF,wBAAgB,mCAAmC,IAAI,cAAc,CAAC,OAAO,oBAAoB,EAAE,OAAO,CAAC,CA4E1G;AAED,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/config.ts"],"names":[],"mappings":"AAOA,UAAU,cAAc;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,UAAU,qBAAqB;IAC9B,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAgB,UAAU,IAAI,qBAAqB,CASlD;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,CAetE","sourcesContent":["import { existsSync, readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nconst CONFIG_DIR = join(homedir(), \".config\", \"rpiv-ask-user-question\");\nconst CONFIG_PATH = join(CONFIG_DIR, \"config.json\");\n\ninterface GuidanceFields {\n\tpromptSnippet?: string;\n\tpromptGuidelines?: string[];\n}\n\ninterface AskUserQuestionConfig {\n\tguidance?: GuidanceFields;\n}\n\nexport function loadConfig(): AskUserQuestionConfig {\n\tif (!existsSync(CONFIG_PATH)) return {};\n\ttry {\n\t\tconst parsed = JSON.parse(readFileSync(CONFIG_PATH, \"utf-8\")) as unknown;\n\t\tif (parsed === null || typeof parsed !== \"object\") return {};\n\t\treturn parsed as AskUserQuestionConfig;\n\t} catch {\n\t\treturn {};\n\t}\n}\n\nexport function validateGuidanceFields(fields: unknown): GuidanceFields {\n\tif (!fields || typeof fields !== \"object\") return {};\n\tconst g = fields as Record<string, unknown>;\n\tconst result: GuidanceFields = {};\n\tif (typeof g.promptSnippet === \"string\" && g.promptSnippet.length > 0) {\n\t\tresult.promptSnippet = g.promptSnippet;\n\t}\n\tif (\n\t\tArray.isArray(g.promptGuidelines) &&\n\t\tg.promptGuidelines.length > 0 &&\n\t\tg.promptGuidelines.every((s) => typeof s === \"string\" && s.length > 0)\n\t) {\n\t\tresult.promptGuidelines = g.promptGuidelines;\n\t}\n\treturn result;\n}\n"]}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/config.ts"],"names":[],"mappings":"AAOA,UAAU,cAAc;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,UAAU,qBAAqB;IAC9B,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAgB,UAAU,IAAI,qBAAqB,CASlD;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,CAetE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/**\n * `ask_user_question` base tool — registered alongside read/bash/edit/write.\n *\n * Upstream: https://github.com/juicesharp/rpiv-mono/tree/main/packages/rpiv-ask-user-question\n * Upstream copyright: (c) 2026 juicesharp — MIT (see ./LICENSE.upstream).\n *\n * Differences from upstream:\n * - i18n is removed entirely. The upstream `state/i18n-bridge.ts`,\n * `locales/*.json`, and the optional `@juicesharp/rpiv-i18n` peer\n * dependency are gone. All UI copy is plain English string literals\n * or local module-level constants.\n * - Exposed as a base tool definition (no extension registration).\n *\n * cross-ref:\n * - ../index.ts (registers via createAllToolDefinitions)\n * - ./ask-user-question.ts (tool definition + execute pipeline)\n */\nexport { createAskUserQuestionToolDefinition } from \"./ask-user-question.ts\";\n"]}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,mCAAmC,EAAE,MAAM,wBAAwB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"build-questionnaire.d.ts","sourceRoot":"","sources":["../../../../../src/core/tools/ask-user-question/state/build-questionnaire.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAgBrD,OAAO,KAAK,EAAE,kBAAkB,EAAuB,MAAM,uCAAuC,CAAC;AAErG,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAerE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,WAAW,wBAAwB;IACxC,GAAG,EAAE;QAAE,QAAQ,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,aAAa,IAAI,IAAI,CAAA;KAAE,CAAC;IAC9D,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,YAAY,EAAE,CAAC;IACnC,UAAU,EAAE,aAAa,CAAC,SAAS,kBAAkB,EAAE,CAAC,CAAC;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,kBAAkB,CAAC;IACjC,aAAa,EAAE,MAAM,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,yBAAyB,CAAC;IACnC,UAAU,EAAE,KAAK,CAAC;IAClB,WAAW,EAAE,KAAK,CAAC;IACnB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IACpC,UAAU,EAAE,MAAM,IAAI,CAAC;CACvB;AAwBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB,CAEvF","sourcesContent":["import { getMarkdownTheme, type Theme } from \"../../../../modes/interactive/theme/theme.ts\";\nimport { Input } from \"@earendil-works/pi-tui\";\nimport type { QuestionData } from \"../tool/types.ts\";\nimport {\n\ttype BoundGlobalBinding,\n\ttype BoundPerTabBinding,\n\tglobalBinding,\n\tperTabBinding,\n} from \"../view/component-binding.ts\";\nimport { ChatRowView } from \"../view/components/chat-row-view.ts\";\nimport { MultiSelectView } from \"../view/components/multi-select-view.ts\";\nimport { OptionListView } from \"../view/components/option-list-view.ts\";\nimport { PreviewBlockRenderer } from \"../view/components/preview/preview-block-renderer.ts\";\nimport { crossTabLeftWidthWithDonation } from \"../view/components/preview/preview-layout-decider.ts\";\nimport type { PreviewPaneProps } from \"../view/components/preview/preview-pane.ts\";\nimport { PreviewPane } from \"../view/components/preview/preview-pane.ts\";\nimport { SubmitPicker } from \"../view/components/submit-picker.ts\";\nimport { TabBar } from \"../view/components/tab-bar.ts\";\nimport type { WrappingSelectItem, WrappingSelectTheme } from \"../view/components/wrapping-select.ts\";\nimport { DialogView } from \"../view/dialog-builder.ts\";\nimport { QuestionnairePropsAdapter } from \"../view/props-adapter.ts\";\nimport type { StatefulView } from \"../view/stateful-view.ts\";\nimport type { TabBodyHeights, TabComponents } from \"../view/tab-components.ts\";\nimport { ROW_INTENT_META } from \"./row-intent.ts\";\nimport type { PerTabSelector } from \"./selectors/contract.ts\";\nimport { selectActivePreviewPaneIndex } from \"./selectors/derivations.ts\";\nimport {\n\tselectChatRowProps,\n\tselectDialogProps,\n\tselectMultiSelectProps,\n\tselectOptionListProps,\n\tselectPreviewPaneProps,\n\tselectSubmitPickerProps,\n\tselectTabBarProps,\n} from \"./selectors/projections.ts\";\nimport type { QuestionnaireState } from \"./state.ts\";\n\nexport interface QuestionnaireBuildConfig {\n\ttui: { terminal: { columns: number }; requestRender(): void };\n\ttheme: Theme;\n\tquestions: readonly QuestionData[];\n\titemsByTab: ReadonlyArray<readonly WrappingSelectItem[]>;\n\tisMulti: boolean;\n\tinitialState: QuestionnaireState;\n\tgetCurrentTab: () => number;\n}\n\nexport interface QuestionnaireBuilt {\n\tadapter: QuestionnairePropsAdapter;\n\tnotesInput: Input;\n\tinlineInput: Input;\n\trender: (width: number) => string[];\n\tinvalidate: () => void;\n}\n\ninterface HeightComputers {\n\tglobal: (width: number) => number;\n\tcurrent: (width: number) => number;\n}\n\nfunction previewBodyHeights(pane: PreviewPane): (width: number) => TabBodyHeights {\n\treturn (width) => ({\n\t\tcurrent: pane.naturalHeight(width),\n\t\tmax: pane.maxNaturalHeight(width),\n\t});\n}\n\nfunction multiSelectBodyHeights(view: MultiSelectView): (width: number) => TabBodyHeights {\n\treturn (width) => {\n\t\tconst h = view.naturalHeight(width);\n\t\treturn { current: h, max: h };\n\t};\n}\n\nconst isActiveTab: PerTabSelector<boolean> = (s, ctx) =>\n\tctx.i === selectActivePreviewPaneIndex(s.currentTab, ctx.totalQuestions);\n\n/**\n * Pure factory: assembles every TUI component, the props adapter, and a\n * lifecycle handle. Session-state dependencies arrive via `getCurrentTab` and\n * the `inputBuffer` cell. Initial paint is delegated to\n * `adapter.apply(initialState)` (called by the session at construction-end);\n * no selector is invoked here.\n */\nexport function buildQuestionnaire(config: QuestionnaireBuildConfig): QuestionnaireBuilt {\n\treturn new QuestionnaireBuilder(config).build();\n}\n\n/**\n * Programming-by-intention assembly: each private method names one\n * construction step from `build()`. Read top-down; the class is build-only and\n * discarded once the handle is returned.\n */\nclass QuestionnaireBuilder {\n\tprivate readonly tui: QuestionnaireBuildConfig[\"tui\"];\n\tprivate readonly theme: Theme;\n\tprivate readonly questions: readonly QuestionData[];\n\tprivate readonly itemsByTab: ReadonlyArray<readonly WrappingSelectItem[]>;\n\tprivate readonly isMulti: boolean;\n\tprivate readonly initialState: QuestionnaireState;\n\tprivate readonly getCurrentTab: () => number;\n\n\tprivate readonly selectTheme: WrappingSelectTheme;\n\tprivate readonly markdownTheme = getMarkdownTheme();\n\tprivate readonly chatRow: ChatRowView;\n\tprivate readonly notesInput = new Input();\n\tprivate readonly inlineInput = new Input();\n\tprivate readonly getTerminalWidth = () => this.tui.terminal.columns;\n\n\tconstructor(config: QuestionnaireBuildConfig) {\n\t\tthis.tui = config.tui;\n\t\tthis.theme = config.theme;\n\t\tthis.questions = config.questions;\n\t\tthis.itemsByTab = config.itemsByTab;\n\t\tthis.isMulti = config.isMulti;\n\t\tthis.initialState = config.initialState;\n\t\tthis.getCurrentTab = config.getCurrentTab;\n\n\t\tthis.selectTheme = this.makeSelectTheme();\n\t\tthis.chatRow = new ChatRowView({\n\t\t\titem: { kind: \"chat\", label: ROW_INTENT_META.chat.label },\n\t\t\ttheme: this.selectTheme,\n\t\t});\n\t}\n\n\tbuild(): QuestionnaireBuilt {\n\t\tconst tabs = this.buildTabComponents();\n\t\tthis.injectGlobalLeftWidth(tabs);\n\t\tconst submitPicker = this.buildSubmitPicker();\n\t\tconst tabBar = this.buildTabBar();\n\t\tconst heights = this.buildHeightComputers(tabs);\n\t\tconst dialog = this.buildDialog(tabs, submitPicker, tabBar, heights);\n\t\tconst globalBindings = this.buildGlobalBindings(dialog, submitPicker, tabBar);\n\t\tconst perTabBindings = this.buildPerTabBindings();\n\t\tconst adapter = this.buildAdapter(tabs, globalBindings, perTabBindings);\n\t\treturn this.handle(adapter, dialog);\n\t}\n\n\tprivate makeSelectTheme(): WrappingSelectTheme {\n\t\tconst t = this.theme;\n\t\treturn {\n\t\t\tselectedText: (s) => t.fg(\"accent\", t.bold(s)),\n\t\t\tdescription: (s) => t.fg(\"muted\", s),\n\t\t\tscrollInfo: (s) => t.fg(\"dim\", s),\n\t\t};\n\t}\n\n\tprivate buildTabComponents(): ReadonlyArray<TabComponents> {\n\t\treturn this.questions.map((q, i) => this.buildTabFor(q, i));\n\t}\n\n\tprivate buildTabFor(question: QuestionData, index: number): TabComponents {\n\t\tconst optionList = new OptionListView({\n\t\t\titems: this.itemsByTab[index] ?? [],\n\t\t\ttheme: this.selectTheme,\n\t\t});\n\t\tconst previewBlock = new PreviewBlockRenderer({\n\t\t\tquestion,\n\t\t\ttheme: this.theme,\n\t\t\tmarkdownTheme: this.markdownTheme,\n\t\t});\n\t\tconst preview = new PreviewPane({\n\t\t\tquestion,\n\t\t\tgetTerminalWidth: this.getTerminalWidth,\n\t\t\toptionListView: optionList,\n\t\t\tpreviewBlock,\n\t\t});\n\t\tconst multiSelect = question.multiSelect ? new MultiSelectView(this.theme, question) : undefined;\n\t\tconst bodyHeights = this.buildBodyHeights(question, preview, multiSelect);\n\t\treturn { optionList, preview, multiSelect, bodyHeights };\n\t}\n\n\tprivate buildBodyHeights(\n\t\tquestion: QuestionData,\n\t\tpreview: PreviewPane,\n\t\tmultiSelect: MultiSelectView | undefined,\n\t): (width: number) => TabBodyHeights {\n\t\treturn question.multiSelect ? multiSelectBodyHeights(multiSelect!) : previewBodyHeights(preview);\n\t}\n\n\t/**\n\t * Compute cross-tab max adaptive left width and inject into each PreviewPane.\n\t * Mirrors buildHeightComputers pattern — iterates all tabs, takes max.\n\t * Called after buildTabComponents, before buildDialog (so setGlobalLeftWidth\n\t * is set before any rendering occurs).\n\t */\n\tprivate injectGlobalLeftWidth(tabs: ReadonlyArray<TabComponents>): void {\n\t\tconst questions = this.questions;\n\t\tconst itemsByTab = this.itemsByTab;\n\t\tconst tabsDescriptor = questions.map((q) => ({ multiSelect: q.multiSelect }));\n\t\tconst globalLeftWidth = (paneWidth: number): number =>\n\t\t\tcrossTabLeftWidthWithDonation(tabsDescriptor, itemsByTab, questions, paneWidth);\n\t\tfor (const tab of tabs) {\n\t\t\ttab.preview.setGlobalLeftWidth(globalLeftWidth);\n\t\t}\n\t}\n\n\tprivate buildSubmitPicker(): SubmitPicker | undefined {\n\t\treturn this.isMulti ? new SubmitPicker(this.theme) : undefined;\n\t}\n\n\tprivate buildTabBar(): TabBar | undefined {\n\t\treturn this.isMulti ? new TabBar(this.theme) : undefined;\n\t}\n\n\tprivate buildHeightComputers(tabs: ReadonlyArray<TabComponents>): HeightComputers {\n\t\tconst global = (width: number): number => {\n\t\t\tlet max = 0;\n\t\t\tfor (const tab of tabs) {\n\t\t\t\tconst h = tab.bodyHeights(width).max;\n\t\t\t\tif (h > max) max = h;\n\t\t\t}\n\t\t\treturn Math.max(1, max);\n\t\t};\n\t\tconst current = (width: number): number => {\n\t\t\tconst idx = Math.min(this.getCurrentTab(), tabs.length - 1);\n\t\t\treturn Math.max(0, tabs[idx]?.bodyHeights(width).current ?? 0);\n\t\t};\n\t\treturn { global, current };\n\t}\n\n\tprivate pickInitialActivePreview(tabs: ReadonlyArray<TabComponents>): StatefulView<PreviewPaneProps> {\n\t\tconst idx = selectActivePreviewPaneIndex(this.initialState.currentTab, this.questions.length);\n\t\treturn tabs[idx]?.preview ?? tabs[0]!.preview;\n\t}\n\n\tprivate buildDialog(\n\t\ttabs: ReadonlyArray<TabComponents>,\n\t\tsubmitPicker: SubmitPicker | undefined,\n\t\ttabBar: TabBar | undefined,\n\t\theights: HeightComputers,\n\t): DialogView {\n\t\treturn new DialogView(\n\t\t\t{\n\t\t\t\ttheme: this.theme,\n\t\t\t\tquestions: this.questions,\n\t\t\t\ttabBar,\n\t\t\t\tnotesInput: this.notesInput,\n\t\t\t\tchatRow: this.chatRow,\n\t\t\t\tisMulti: this.isMulti,\n\t\t\t\ttabsByIndex: tabs,\n\t\t\t\tsubmitPicker,\n\t\t\t\tgetBodyHeight: heights.global,\n\t\t\t\tgetCurrentBodyHeight: heights.current,\n\t\t\t},\n\t\t\t{ state: this.initialState, activePreviewPane: this.pickInitialActivePreview(tabs) },\n\t\t);\n\t}\n\n\tprivate buildGlobalBindings(\n\t\tdialog: DialogView,\n\t\tsubmitPicker: SubmitPicker | undefined,\n\t\ttabBar: TabBar | undefined,\n\t): ReadonlyArray<BoundGlobalBinding> {\n\t\treturn [\n\t\t\tglobalBinding({ component: dialog, select: selectDialogProps }),\n\t\t\tglobalBinding({ component: this.chatRow, select: selectChatRowProps }),\n\t\t\t...(submitPicker ? [globalBinding({ component: submitPicker, select: selectSubmitPickerProps })] : []),\n\t\t\t...(tabBar ? [globalBinding({ component: tabBar, select: selectTabBarProps })] : []),\n\t\t];\n\t}\n\n\tprivate buildPerTabBindings(): ReadonlyArray<BoundPerTabBinding> {\n\t\treturn [\n\t\t\tperTabBinding({\n\t\t\t\tresolve: (tab) => tab.optionList,\n\t\t\t\tpredicate: isActiveTab,\n\t\t\t\tselect: selectOptionListProps,\n\t\t\t}),\n\t\t\tperTabBinding({\n\t\t\t\tresolve: (tab) => tab.preview,\n\t\t\t\tpredicate: isActiveTab,\n\t\t\t\tselect: selectPreviewPaneProps,\n\t\t\t}),\n\t\t\tperTabBinding({\n\t\t\t\tresolve: (tab) => tab.multiSelect,\n\t\t\t\tselect: selectMultiSelectProps,\n\t\t\t}),\n\t\t];\n\t}\n\n\tprivate buildAdapter(\n\t\ttabs: ReadonlyArray<TabComponents>,\n\t\tglobalBindings: ReadonlyArray<BoundGlobalBinding>,\n\t\tperTabBindings: ReadonlyArray<BoundPerTabBinding>,\n\t): QuestionnairePropsAdapter {\n\t\treturn new QuestionnairePropsAdapter({\n\t\t\ttui: this.tui,\n\t\t\tquestions: this.questions,\n\t\t\titemsByTab: this.itemsByTab,\n\t\t\ttabsByIndex: tabs,\n\t\t\tinlineInput: this.inlineInput,\n\t\t\tglobalBindings,\n\t\t\tperTabBindings,\n\t\t\textraInvalidatables: [this.notesInput],\n\t\t});\n\t}\n\n\tprivate handle(adapter: QuestionnairePropsAdapter, dialog: DialogView): QuestionnaireBuilt {\n\t\treturn {\n\t\t\tadapter,\n\t\t\tnotesInput: this.notesInput,\n\t\t\tinlineInput: this.inlineInput,\n\t\t\trender: (w) => dialog.render(w),\n\t\t\tinvalidate: () => adapter.invalidate(),\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"build-questionnaire.d.ts","sourceRoot":"","sources":["../../../../../src/core/tools/ask-user-question/state/build-questionnaire.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,KAAK,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAgBrD,OAAO,KAAK,EAAE,kBAAkB,EAAuB,MAAM,uCAAuC,CAAC;AAErG,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAerE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,WAAW,wBAAwB;IACxC,GAAG,EAAE;QAAE,QAAQ,EAAE;YAAE,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,aAAa,IAAI,IAAI,CAAA;KAAE,CAAC;IAC9D,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,SAAS,YAAY,EAAE,CAAC;IACnC,UAAU,EAAE,aAAa,CAAC,SAAS,kBAAkB,EAAE,CAAC,CAAC;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,kBAAkB,CAAC;IACjC,aAAa,EAAE,MAAM,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,yBAAyB,CAAC;IACnC,UAAU,EAAE,KAAK,CAAC;IAClB,WAAW,EAAE,KAAK,CAAC;IACnB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IACpC,UAAU,EAAE,MAAM,IAAI,CAAC;CACvB;AAwBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,kBAAkB,CAEvF"}
@@ -1 +1 @@
1
- {"version":3,"file":"inline-input.d.ts","sourceRoot":"","sources":["../../../../../src/core/tools/ask-user-question/state/inline-input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;;;;;;;GAYG;AAEH,iGAAiG;AACjG,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAEtG;AAED,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAEtG;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAC9B,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACX,kBAAkB,CAapB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAUlG","sourcesContent":["import { ROW_INTENT_META } from \"./row-intent.ts\";\nimport type { InlineInputOwner, QuestionnaireState } from \"./state.ts\";\n\n/**\n * Shared owner-branching accessors/mutator for the two per-owner inline-input\n * map pairs on `QuestionnaireState`:\n * - `\"chat\"` → `chatDraftByTab` / `chatCaretByTab`\n * - `\"other\"` → `customDraftByTab` / `customCaretByTab`\n *\n * Both the pure reducer (`state-reducer.ts`) and the runtime\n * (`questionnaire-session.ts`) read and write these maps. Hoisting the helpers\n * here keeps the `owner === \"chat\"` branch in exactly one place instead of\n * copying it into each caller (previously `withInlineDraft` was duplicated\n * verbatim and the accessor pairs were near-duplicates split across the two\n * files).\n */\n\n/** Raw draft text persisted for `owner` at the current tab, or undefined when none is stored. */\nexport function readInlineDraft(state: QuestionnaireState, owner: InlineInputOwner): string | undefined {\n\treturn owner === \"chat\" ? state.chatDraftByTab.get(state.currentTab) : state.customDraftByTab.get(state.currentTab);\n}\n\n/** Raw caret offset persisted for `owner` at the current tab, or undefined when none is stored. */\nexport function readInlineCaret(state: QuestionnaireState, owner: InlineInputOwner): number | undefined {\n\treturn owner === \"chat\" ? state.chatCaretByTab.get(state.currentTab) : state.customCaretByTab.get(state.currentTab);\n}\n\n/** Immutably persist `value`/`caret` into `owner`'s draft+caret maps for the current tab. */\nexport function withInlineDraft(\n\tstate: QuestionnaireState,\n\towner: InlineInputOwner,\n\tvalue: string,\n\tcaret: number,\n): QuestionnaireState {\n\tif (owner === \"chat\") {\n\t\tconst chatDraftByTab = new Map(state.chatDraftByTab);\n\t\tconst chatCaretByTab = new Map(state.chatCaretByTab);\n\t\tchatDraftByTab.set(state.currentTab, value);\n\t\tchatCaretByTab.set(state.currentTab, caret);\n\t\treturn { ...state, chatDraftByTab, chatCaretByTab };\n\t}\n\tconst customDraftByTab = new Map(state.customDraftByTab);\n\tconst customCaretByTab = new Map(state.customCaretByTab);\n\tcustomDraftByTab.set(state.currentTab, value);\n\tcustomCaretByTab.set(state.currentTab, caret);\n\treturn { ...state, customDraftByTab, customCaretByTab };\n}\n\n/**\n * Draft text used to hydrate the inline editor when (re)focusing `owner`: the\n * in-flight draft when present, otherwise the prior committed answer for that\n * owner. The `\"chat\"` owner excludes the reserved sentinel label so a prior\n * signal-only chat (`\"Chat about this\"`) does not re-hydrate as editable text.\n */\nexport function resolveInlineDraftValue(state: QuestionnaireState, owner: InlineInputOwner): string {\n\tconst draft = readInlineDraft(state, owner);\n\tif (draft !== undefined) return draft;\n\tconst prior = state.answers.get(state.currentTab);\n\tif (owner === \"other\") {\n\t\treturn prior?.kind === \"custom\" && typeof prior.answer === \"string\" ? prior.answer : \"\";\n\t}\n\treturn prior?.kind === \"chat\" && typeof prior.answer === \"string\" && prior.answer !== ROW_INTENT_META.chat.label\n\t\t? prior.answer\n\t\t: \"\";\n}\n"]}
1
+ {"version":3,"file":"inline-input.d.ts","sourceRoot":"","sources":["../../../../../src/core/tools/ask-user-question/state/inline-input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;;;;;;;GAYG;AAEH,iGAAiG;AACjG,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAEtG;AAED,mGAAmG;AACnG,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAEtG;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAC9B,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACX,kBAAkB,CAapB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAUlG"}