@bastani/atomic 0.9.13-alpha.2 → 0.9.13-alpha.3

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 (255) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -1
  3. package/dist/builtin/i-have-adhd/package.json +1 -1
  4. package/dist/builtin/intercom/CHANGELOG.md +14 -0
  5. package/dist/builtin/intercom/README.md +12 -12
  6. package/dist/builtin/intercom/incoming-message-delivery.ts +1 -1
  7. package/dist/builtin/intercom/index.ts +1 -1
  8. package/dist/builtin/intercom/intercom-tool.ts +1 -1
  9. package/dist/builtin/intercom/intercom-utils.ts +3 -6
  10. package/dist/builtin/intercom/package.json +1 -1
  11. package/dist/builtin/intercom/result-renderers.ts +1 -1
  12. package/dist/builtin/intercom/session-target.ts +1 -15
  13. package/dist/builtin/intercom/skills/intercom/SKILL.md +6 -6
  14. package/dist/builtin/intercom/terminal-ordering-barrier.ts +2 -2
  15. package/dist/builtin/intercom/ui/inline-message.ts +7 -5
  16. package/dist/builtin/intercom/ui/session-list.ts +23 -10
  17. package/dist/builtin/mcp/package.json +1 -1
  18. package/dist/builtin/subagents/CHANGELOG.md +19 -0
  19. package/dist/builtin/subagents/README.md +29 -73
  20. package/dist/builtin/subagents/package.json +2 -2
  21. package/dist/builtin/subagents/prompts/parallel-cleanup.md +1 -1
  22. package/dist/builtin/subagents/prompts/parallel-review.md +1 -1
  23. package/dist/builtin/subagents/prompts/review-loop.md +2 -2
  24. package/dist/builtin/subagents/skills/subagent/SKILL.md +23 -59
  25. package/dist/builtin/subagents/skills/tmux/SKILL.md +1 -1
  26. package/dist/builtin/subagents/src/extension/control-notices.ts +2 -3
  27. package/dist/builtin/subagents/src/extension/doctor.ts +2 -14
  28. package/dist/builtin/subagents/src/extension/fanout-child.ts +1 -17
  29. package/dist/builtin/subagents/src/extension/index.ts +9 -70
  30. package/dist/builtin/subagents/src/extension/notification-content.ts +1 -1
  31. package/dist/builtin/subagents/src/extension/prompt-guidance.ts +2 -2
  32. package/dist/builtin/subagents/src/extension/schemas.ts +2 -8
  33. package/dist/builtin/subagents/src/extension/tool-description.ts +2 -3
  34. package/dist/builtin/subagents/src/intercom/intercom-bridge.ts +1 -1
  35. package/dist/builtin/subagents/src/intercom/result-intercom.ts +5 -46
  36. package/dist/builtin/subagents/src/runs/{background → foreground}/completion-notification.ts +2 -2
  37. package/dist/builtin/subagents/src/runs/foreground/inprocess-run-sync.ts +25 -88
  38. package/dist/builtin/subagents/src/runs/{background → foreground}/notify.ts +5 -5
  39. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-context.ts +11 -28
  40. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel-task.ts +3 -0
  41. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-parallel.ts +2 -0
  42. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-runtime.ts +0 -5
  43. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-single.ts +30 -20
  44. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-status.ts +4 -4
  45. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-types.ts +0 -13
  46. package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +104 -48
  47. package/dist/builtin/subagents/src/runs/inprocess/index.ts +1 -1
  48. package/dist/builtin/subagents/src/runs/inprocess/runner.ts +5 -5
  49. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-api.ts +0 -7
  50. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-core.ts +0 -10
  51. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-projection.ts +3 -108
  52. package/dist/builtin/subagents/src/runs/inprocess/runtime-support/nested-sanitize.ts +0 -4
  53. package/dist/builtin/subagents/src/runs/shared/subagent-control.ts +1 -1
  54. package/dist/builtin/subagents/src/shared/formatters.ts +3 -5
  55. package/dist/builtin/subagents/src/shared/model-resolution.ts +78 -0
  56. package/dist/builtin/subagents/src/shared/status-format.ts +4 -11
  57. package/dist/builtin/subagents/src/shared/types-config.ts +10 -9
  58. package/dist/builtin/subagents/src/shared/types-nested.ts +127 -0
  59. package/dist/builtin/subagents/src/shared/types-results.ts +2 -8
  60. package/dist/builtin/subagents/src/shared/types-runtime.ts +0 -9
  61. package/dist/builtin/subagents/src/shared/types.ts +1 -1
  62. package/dist/builtin/subagents/src/shared/utils.ts +1 -109
  63. package/dist/builtin/subagents/src/slash/slash-commands.ts +7 -17
  64. package/dist/builtin/subagents/src/tui/render-event-formatting.ts +2 -252
  65. package/dist/builtin/subagents/src/tui/render-layout.ts +4 -4
  66. package/dist/builtin/subagents/src/tui/render-result.ts +0 -9
  67. package/dist/builtin/subagents/src/tui/render-stable-output.ts +1 -34
  68. package/dist/builtin/subagents/src/tui/render.ts +0 -2
  69. package/dist/builtin/web-access/package.json +1 -1
  70. package/dist/builtin/workflows/CHANGELOG.md +12 -0
  71. package/dist/builtin/workflows/README.md +3 -3
  72. package/dist/builtin/workflows/package.json +1 -1
  73. package/dist/builtin/workflows/src/durable/backend.ts +11 -0
  74. package/dist/builtin/workflows/src/durable/completed-catalog-stage-groups.ts +63 -25
  75. package/dist/builtin/workflows/src/durable/completed-catalog.ts +166 -25
  76. package/dist/builtin/workflows/src/durable/dbos-backend.ts +42 -24
  77. package/dist/builtin/workflows/src/durable/dbos-envelope.ts +2 -1
  78. package/dist/builtin/workflows/src/durable/run-timing.ts +28 -7
  79. package/dist/builtin/workflows/src/durable/scoped-backend.ts +4 -0
  80. package/dist/builtin/workflows/src/durable/targeted-inspection.ts +110 -0
  81. package/dist/builtin/workflows/src/engine/run-durable-stage-session.ts +2 -2
  82. package/dist/builtin/workflows/src/engine/runtime.ts +19 -2
  83. package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +3 -0
  84. package/dist/builtin/workflows/src/extension/index.bundle.mjs +680 -152
  85. package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +6 -0
  86. package/dist/builtin/workflows/src/extension/ui-surface.ts +2 -0
  87. package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +6 -1
  88. package/dist/builtin/workflows/src/extension/workflow-targets.ts +18 -10
  89. package/dist/builtin/workflows/src/extension/workflow-tool-inspection.ts +31 -16
  90. package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +75 -3
  91. package/dist/builtin/workflows/src/extension/workflow-tool.ts +53 -6
  92. package/dist/builtin/workflows/src/runs/background/run-inspect.ts +5 -1
  93. package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +94 -60
  94. package/dist/builtin/workflows/src/runs/foreground/executor-stage-context.ts +1 -1
  95. package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +7 -7
  96. package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +25 -4
  97. package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +4 -1
  98. package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +2 -0
  99. package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +142 -4
  100. package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +2 -0
  101. package/dist/builtin/workflows/src/runs/foreground/stage-session-heartbeat.ts +88 -0
  102. package/dist/builtin/workflows/src/tui/run-detail.ts +25 -12
  103. package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +1 -0
  104. package/dist/core/agent-session-events.d.ts.map +1 -1
  105. package/dist/core/agent-session-events.js +16 -5
  106. package/dist/core/agent-session-events.js.map +1 -1
  107. package/dist/core/agent-session-export.d.ts.map +1 -1
  108. package/dist/core/agent-session-export.js +2 -1
  109. package/dist/core/agent-session-export.js.map +1 -1
  110. package/dist/core/agent-session-methods.d.ts +8 -4
  111. package/dist/core/agent-session-methods.d.ts.map +1 -1
  112. package/dist/core/agent-session-methods.js.map +1 -1
  113. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  114. package/dist/core/agent-session-prompt.js +5 -0
  115. package/dist/core/agent-session-prompt.js.map +1 -1
  116. package/dist/core/agent-session-summary.d.ts +21 -0
  117. package/dist/core/agent-session-summary.d.ts.map +1 -0
  118. package/dist/core/agent-session-summary.js +156 -0
  119. package/dist/core/agent-session-summary.js.map +1 -0
  120. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  121. package/dist/core/agent-session-tool-registry.js +0 -4
  122. package/dist/core/agent-session-tool-registry.js.map +1 -1
  123. package/dist/core/agent-session-transfer.d.ts.map +1 -1
  124. package/dist/core/agent-session-transfer.js +0 -2
  125. package/dist/core/agent-session-transfer.js.map +1 -1
  126. package/dist/core/agent-session-tree.d.ts.map +1 -1
  127. package/dist/core/agent-session-tree.js +6 -0
  128. package/dist/core/agent-session-tree.js.map +1 -1
  129. package/dist/core/agent-session.d.ts +7 -3
  130. package/dist/core/agent-session.d.ts.map +1 -1
  131. package/dist/core/agent-session.js +8 -5
  132. package/dist/core/agent-session.js.map +1 -1
  133. package/dist/core/atomic-guide-command.js +2 -2
  134. package/dist/core/atomic-guide-command.js.map +1 -1
  135. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  136. package/dist/core/compaction/branch-summarization.js +1 -0
  137. package/dist/core/compaction/branch-summarization.js.map +1 -1
  138. package/dist/core/compaction/index.d.ts +1 -0
  139. package/dist/core/compaction/index.d.ts.map +1 -1
  140. package/dist/core/compaction/index.js +1 -0
  141. package/dist/core/compaction/index.js.map +1 -1
  142. package/dist/core/compaction/session-summarization.d.ts +41 -0
  143. package/dist/core/compaction/session-summarization.d.ts.map +1 -0
  144. package/dist/core/compaction/session-summarization.js +97 -0
  145. package/dist/core/compaction/session-summarization.js.map +1 -0
  146. package/dist/core/extensions/ui-types.d.ts +2 -0
  147. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  148. package/dist/core/extensions/ui-types.js.map +1 -1
  149. package/dist/core/session-manager-core.d.ts +3 -1
  150. package/dist/core/session-manager-core.d.ts.map +1 -1
  151. package/dist/core/session-manager-core.js +9 -1
  152. package/dist/core/session-manager-core.js.map +1 -1
  153. package/dist/core/session-manager-entries.d.ts +24 -1
  154. package/dist/core/session-manager-entries.d.ts.map +1 -1
  155. package/dist/core/session-manager-entries.js +48 -0
  156. package/dist/core/session-manager-entries.js.map +1 -1
  157. package/dist/core/session-manager-list.d.ts.map +1 -1
  158. package/dist/core/session-manager-list.js +10 -0
  159. package/dist/core/session-manager-list.js.map +1 -1
  160. package/dist/core/session-manager-types.d.ts +10 -1
  161. package/dist/core/session-manager-types.d.ts.map +1 -1
  162. package/dist/core/session-manager-types.js.map +1 -1
  163. package/dist/core/settings-manager-basic-accessors.d.ts +3 -0
  164. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  165. package/dist/core/settings-manager-basic-accessors.js +5 -0
  166. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  167. package/dist/core/settings-manager.d.ts +1 -1
  168. package/dist/core/settings-manager.d.ts.map +1 -1
  169. package/dist/core/settings-manager.js.map +1 -1
  170. package/dist/core/settings-types.d.ts +4 -0
  171. package/dist/core/settings-types.d.ts.map +1 -1
  172. package/dist/core/settings-types.js.map +1 -1
  173. package/dist/core/slash-commands.js +2 -2
  174. package/dist/core/slash-commands.js.map +1 -1
  175. package/dist/core/tools/bash.d.ts +0 -15
  176. package/dist/core/tools/bash.d.ts.map +1 -1
  177. package/dist/core/tools/bash.js +3 -81
  178. package/dist/core/tools/bash.js.map +1 -1
  179. package/dist/core/tools/fetch-url.d.ts +12 -0
  180. package/dist/core/tools/fetch-url.d.ts.map +1 -1
  181. package/dist/core/tools/fetch-url.js +76 -10
  182. package/dist/core/tools/fetch-url.js.map +1 -1
  183. package/dist/core/tools/index.js +4 -4
  184. package/dist/core/tools/index.js.map +1 -1
  185. package/dist/core/tools/session-temp-dir.d.ts +2 -2
  186. package/dist/core/tools/session-temp-dir.d.ts.map +1 -1
  187. package/dist/core/tools/session-temp-dir.js +6 -7
  188. package/dist/core/tools/session-temp-dir.js.map +1 -1
  189. package/dist/core/usage-totals.js +1 -1
  190. package/dist/core/usage-totals.js.map +1 -1
  191. package/dist/modes/interactive/components/footer.js +1 -1
  192. package/dist/modes/interactive/components/footer.js.map +1 -1
  193. package/dist/modes/interactive/components/host-session-picker.d.ts.map +1 -1
  194. package/dist/modes/interactive/components/host-session-picker.js +1 -0
  195. package/dist/modes/interactive/components/host-session-picker.js.map +1 -1
  196. package/dist/modes/interactive/components/session-selector-list.d.ts.map +1 -1
  197. package/dist/modes/interactive/components/session-selector-list.js +29 -4
  198. package/dist/modes/interactive/components/session-selector-list.js.map +1 -1
  199. package/dist/modes/interactive/components/session-selector-search.js +1 -1
  200. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  201. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  202. package/dist/modes/interactive/components/tree-selector-content.js +6 -0
  203. package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
  204. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  205. package/dist/modes/interactive-engine/protocol.js +4 -1
  206. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  207. package/docs/environment-variables.md +1 -1
  208. package/docs/intercom.md +20 -21
  209. package/docs/quickstart.md +5 -1
  210. package/docs/sdk.md +1 -1
  211. package/docs/session-format.md +15 -0
  212. package/docs/sessions.md +8 -0
  213. package/docs/settings.md +6 -0
  214. package/docs/subagents.md +19 -31
  215. package/docs/tools.md +3 -5
  216. package/docs/usage.md +1 -1
  217. package/docs/windows.md +1 -1
  218. package/docs/workflows.md +60 -32
  219. package/npm-shrinkwrap.json +29 -29
  220. package/package.json +2 -2
  221. package/dist/builtin/subagents/src/runs/background/async-job-tracker.ts +0 -331
  222. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +0 -161
  223. package/dist/builtin/subagents/src/runs/inprocess/background-single.ts +0 -195
  224. package/dist/builtin/subagents/src/runs/inprocess/background.ts +0 -90
  225. package/dist/builtin/subagents/src/shared/types-async.ts +0 -247
  226. package/dist/builtin/subagents/src/tui/render-widget-graph.ts +0 -217
  227. package/dist/builtin/subagents/src/tui/render-widget.ts +0 -366
  228. package/dist/core/async/format.d.ts +0 -3
  229. package/dist/core/async/format.d.ts.map +0 -1
  230. package/dist/core/async/format.js +0 -52
  231. package/dist/core/async/format.js.map +0 -1
  232. package/dist/core/async/job-manager.d.ts +0 -40
  233. package/dist/core/async/job-manager.d.ts.map +0 -1
  234. package/dist/core/async/job-manager.js +0 -293
  235. package/dist/core/async/job-manager.js.map +0 -1
  236. package/dist/core/async/session-manager.d.ts +0 -16
  237. package/dist/core/async/session-manager.d.ts.map +0 -1
  238. package/dist/core/async/session-manager.js +0 -34
  239. package/dist/core/async/session-manager.js.map +0 -1
  240. package/dist/core/async/types.d.ts +0 -23
  241. package/dist/core/async/types.d.ts.map +0 -1
  242. package/dist/core/async/types.js +0 -2
  243. package/dist/core/async/types.js.map +0 -1
  244. package/dist/core/tools/bash-async-execution.d.ts +0 -27
  245. package/dist/core/tools/bash-async-execution.d.ts.map +0 -1
  246. package/dist/core/tools/bash-async-execution.js +0 -81
  247. package/dist/core/tools/bash-async-execution.js.map +0 -1
  248. package/dist/core/tools/bash-async-jobs.d.ts +0 -30
  249. package/dist/core/tools/bash-async-jobs.d.ts.map +0 -1
  250. package/dist/core/tools/bash-async-jobs.js +0 -87
  251. package/dist/core/tools/bash-async-jobs.js.map +0 -1
  252. package/dist/core/tools/bash-async-output.d.ts +0 -13
  253. package/dist/core/tools/bash-async-output.d.ts.map +0 -1
  254. package/dist/core/tools/bash-async-output.js +0 -122
  255. package/dist/core/tools/bash-async-output.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tree-selector-content.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tree-selector-content.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,MAAM,UAAU,iBAAiB,CAAC,IAAqB;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,IAAI,CA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AU,OAAO,OAAO,IAAI,GAAG,CAAC;QACxC,CAAC;QACD,KAAK,IAAI,EAAE,CAAC;YACX,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,QAAQ,IAAI,GAAG,CAAC;QACxB,CAAC;QACD,SAAS,CAAC;YACT,kDAAkD;YAClD,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5C,MAAM,OAAO,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5C,OAAO,IAAI,IAAI,KAAK,OAAO,GAAG,cAAc,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;QAC1E,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import type { SessionTreeNode } from \"../../../core/session-manager.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport type { ToolCallInfo } from \"./tree-selector-types.ts\";\n\nexport function getSearchableText(node: SessionTreeNode): string {\n\tconst entry = node.entry;\n\tconst parts: string[] = [];\n\n\tif (node.label) {\n\t\tparts.push(node.label);\n\t}\n\n\tswitch (entry.type) {\n\t\tcase \"message\": {\n\t\t\tconst msg = entry.message;\n\t\t\tparts.push(msg.role);\n\t\t\tif (\"content\" in msg && msg.content) {\n\t\t\t\tparts.push(extractContent(msg.content));\n\t\t\t}\n\t\t\tif (msg.role === \"bashExecution\") {\n\t\t\t\tconst bashMsg = msg as { command?: string };\n\t\t\t\tif (bashMsg.command) parts.push(bashMsg.command);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"custom_message\": {\n\t\t\tparts.push(entry.customType);\n\t\t\tif (typeof entry.content === \"string\") {\n\t\t\t\tparts.push(entry.content);\n\t\t\t} else {\n\t\t\t\tparts.push(extractContent(entry.content));\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"compaction\":\n\t\t\tparts.push(\"compaction\");\n\t\t\tbreak;\n\t\tcase \"branch_summary\":\n\t\t\tparts.push(\"branch summary\", entry.summary);\n\t\t\tbreak;\n\t\tcase \"session_info\":\n\t\t\tparts.push(\"title\");\n\t\t\tif (entry.name) parts.push(entry.name);\n\t\t\tbreak;\n\t\tcase \"model_change\":\n\t\t\tparts.push(\"model\", entry.modelId);\n\t\t\tbreak;\n\t\tcase \"thinking_level_change\":\n\t\t\tparts.push(\"thinking\", entry.thinkingLevel);\n\t\t\tbreak;\n\t\tcase \"custom\":\n\t\t\tparts.push(\"custom\", entry.customType);\n\t\t\tbreak;\n\t\tcase \"label\":\n\t\t\tparts.push(\"label\", entry.label ?? \"\");\n\t\t\tbreak;\n\t}\n\n\treturn parts.join(\" \");\n}\n\nexport function getEntryDisplayText(\n\tnode: SessionTreeNode,\n\tisSelected: boolean,\n\ttoolCallMap: Map<string, ToolCallInfo>,\n): string {\n\tconst entry = node.entry;\n\tlet result: string;\n\n\tswitch (entry.type) {\n\t\tcase \"message\": {\n\t\t\tconst msg = entry.message;\n\t\t\tconst role = msg.role;\n\t\t\tif (role === \"user\") {\n\t\t\t\tconst msgWithContent = msg as { content?: unknown };\n\t\t\t\tconst content = normalizeText(extractContent(msgWithContent.content));\n\t\t\t\tresult = theme.fg(\"accent\", \"user: \") + content;\n\t\t\t} else if (role === \"assistant\") {\n\t\t\t\tconst msgWithContent = msg as { content?: unknown; stopReason?: string; errorMessage?: string };\n\t\t\t\tconst textContent = normalizeText(extractContent(msgWithContent.content));\n\t\t\t\tif (textContent) {\n\t\t\t\t\tresult = theme.fg(\"success\", \"assistant: \") + textContent;\n\t\t\t\t} else if (msgWithContent.stopReason === \"aborted\") {\n\t\t\t\t\tresult = theme.fg(\"success\", \"assistant: \") + theme.fg(\"muted\", \"(aborted)\");\n\t\t\t\t} else if (msgWithContent.errorMessage) {\n\t\t\t\t\tconst errMsg = normalizeText(msgWithContent.errorMessage).slice(0, 80);\n\t\t\t\t\tresult = theme.fg(\"success\", \"assistant: \") + theme.fg(\"error\", errMsg);\n\t\t\t\t} else {\n\t\t\t\t\tresult = theme.fg(\"success\", \"assistant: \") + theme.fg(\"muted\", \"(no content)\");\n\t\t\t\t}\n\t\t\t} else if (role === \"toolResult\") {\n\t\t\t\tconst toolMsg = msg as { toolCallId?: string; toolName?: string };\n\t\t\t\tconst toolCall = toolMsg.toolCallId ? toolCallMap.get(toolMsg.toolCallId) : undefined;\n\t\t\t\tif (toolCall) {\n\t\t\t\t\tresult = theme.fg(\"muted\", formatToolCall(toolCall.name, toolCall.arguments));\n\t\t\t\t} else {\n\t\t\t\t\tresult = theme.fg(\"muted\", `[${toolMsg.toolName ?? \"tool\"}]`);\n\t\t\t\t}\n\t\t\t} else if (role === \"bashExecution\") {\n\t\t\t\tconst bashMsg = msg as { command?: string };\n\t\t\t\tresult = theme.fg(\"dim\", `[bash]: ${normalizeText(bashMsg.command ?? \"\")}`);\n\t\t\t} else {\n\t\t\t\tresult = theme.fg(\"dim\", `[${role}]`);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"custom_message\": {\n\t\t\tconst content =\n\t\t\t\ttypeof entry.content === \"string\"\n\t\t\t\t\t? entry.content\n\t\t\t\t\t: entry.content\n\t\t\t\t\t\t\t.filter((c): c is { type: \"text\"; text: string } => c.type === \"text\")\n\t\t\t\t\t\t\t.map((c) => c.text)\n\t\t\t\t\t\t\t.join(\"\");\n\t\t\tresult = theme.fg(\"customMessageLabel\", `[${entry.customType}]: `) + normalizeText(content);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"compaction\": {\n\t\t\tconst tokens = Math.round(entry.tokensBefore / 1000);\n\t\t\tresult = theme.fg(\"borderAccent\", `[compaction: ${tokens}k tokens]`);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"branch_summary\":\n\t\t\tresult = theme.fg(\"warning\", `[branch summary]: `) + normalizeText(entry.summary);\n\t\t\tbreak;\n\t\tcase \"model_change\":\n\t\t\tresult = theme.fg(\"dim\", `[model: ${entry.modelId}]`);\n\t\t\tbreak;\n\t\tcase \"thinking_level_change\":\n\t\t\tresult = theme.fg(\"dim\", `[thinking: ${entry.thinkingLevel}]`);\n\t\t\tbreak;\n\t\tcase \"custom\":\n\t\t\tresult = theme.fg(\"dim\", `[custom: ${entry.customType}]`);\n\t\t\tbreak;\n\t\tcase \"label\":\n\t\t\tresult = theme.fg(\"dim\", `[label: ${entry.label ?? \"(cleared)\"}]`);\n\t\t\tbreak;\n\t\tcase \"session_info\":\n\t\t\tresult = entry.name\n\t\t\t\t? [theme.fg(\"dim\", \"[title: \"), theme.fg(\"dim\", entry.name), theme.fg(\"dim\", \"]\")].join(\"\")\n\t\t\t\t: [theme.fg(\"dim\", \"[title: \"), theme.italic(theme.fg(\"dim\", \"empty\")), theme.fg(\"dim\", \"]\")].join(\"\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tresult = \"\";\n\t}\n\n\treturn isSelected ? theme.bold(result) : result;\n}\n\nexport function formatLabelTimestamp(timestamp: string): string {\n\tconst date = new Date(timestamp);\n\tconst now = new Date();\n\tconst hours = date.getHours().toString().padStart(2, \"0\");\n\tconst minutes = date.getMinutes().toString().padStart(2, \"0\");\n\tconst time = `${hours}:${minutes}`;\n\n\tif (\n\t\tdate.getFullYear() === now.getFullYear() &&\n\t\tdate.getMonth() === now.getMonth() &&\n\t\tdate.getDate() === now.getDate()\n\t) {\n\t\treturn time;\n\t}\n\n\tconst month = date.getMonth() + 1;\n\tconst day = date.getDate();\n\tif (date.getFullYear() === now.getFullYear()) {\n\t\treturn `${month}/${day} ${time}`;\n\t}\n\n\tconst year = date.getFullYear().toString().slice(-2);\n\treturn `${year}/${month}/${day} ${time}`;\n}\n\nexport function extractContent(content: unknown): string {\n\tconst maxLen = 200;\n\tif (typeof content === \"string\") return content.slice(0, maxLen);\n\tif (Array.isArray(content)) {\n\t\tlet result = \"\";\n\t\tfor (const c of content) {\n\t\t\tif (typeof c === \"object\" && c !== null && \"type\" in c && c.type === \"text\") {\n\t\t\t\tresult += (c as { text: string }).text;\n\t\t\t\tif (result.length >= maxLen) return result.slice(0, maxLen);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\treturn \"\";\n}\n\nexport function hasTextContent(content: unknown): boolean {\n\tif (typeof content === \"string\") return content.trim().length > 0;\n\tif (Array.isArray(content)) {\n\t\tfor (const c of content) {\n\t\t\tif (typeof c === \"object\" && c !== null && \"type\" in c && c.type === \"text\") {\n\t\t\t\tconst text = (c as { text?: string }).text;\n\t\t\t\tif (text && text.trim().length > 0) return true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction normalizeText(s: string): string {\n\treturn s.replace(/[\\n\\t]/g, \" \").trim();\n}\n\nfunction formatToolCall(name: string, args: Record<string, unknown>): string {\n\tconst shortenPath = (p: string): string => {\n\t\tconst home = process.env.HOME || process.env.USERPROFILE || \"\";\n\t\tif (home && p.startsWith(home)) return `~${p.slice(home.length)}`;\n\t\treturn p;\n\t};\n\n\tswitch (name) {\n\t\tcase \"read\": {\n\t\t\tconst path = shortenPath(String(args.path || args.file_path || \"\"));\n\t\t\tconst offset = args.offset as number | undefined;\n\t\t\tconst limit = args.limit as number | undefined;\n\t\t\tlet display = path;\n\t\t\tif (offset !== undefined || limit !== undefined) {\n\t\t\t\tconst start = offset ?? 1;\n\t\t\t\tconst end = limit !== undefined ? start + limit - 1 : \"\";\n\t\t\t\tdisplay += `:${start}${end ? `-${end}` : \"\"}`;\n\t\t\t}\n\t\t\treturn `[read: ${display}]`;\n\t\t}\n\t\tcase \"write\": {\n\t\t\tconst path = shortenPath(String(args.path || args.file_path || \"\"));\n\t\t\treturn `[write: ${path}]`;\n\t\t}\n\t\tcase \"edit\": {\n\t\t\tconst path = shortenPath(String(args.path || args.file_path || \"\"));\n\t\t\treturn `[edit: ${path}]`;\n\t\t}\n\t\tcase \"bash\": {\n\t\t\tconst rawCmd = String(args.command || \"\");\n\t\t\tconst cmd = rawCmd\n\t\t\t\t.replace(/[\\n\\t]/g, \" \")\n\t\t\t\t.trim()\n\t\t\t\t.slice(0, 50);\n\t\t\treturn `[bash: ${cmd}${rawCmd.length > 50 ? \"...\" : \"\"}]`;\n\t\t}\n\t\tcase \"find\": {\n\t\t\tconst pattern = String(args.pattern || \"\");\n\t\t\tconst path = shortenPath(String(args.path || \".\"));\n\t\t\treturn `[find: ${pattern} in ${path}]`;\n\t\t}\n\t\tcase \"ls\": {\n\t\t\tconst path = shortenPath(String(args.path || \".\"));\n\t\t\treturn `[ls: ${path}]`;\n\t\t}\n\t\tdefault: {\n\t\t\t// Custom tool - show name and truncated JSON args\n\t\t\tconst serializedArgs = JSON.stringify(args);\n\t\t\tconst argsStr = serializedArgs.slice(0, 40);\n\t\t\treturn `[${name}: ${argsStr}${serializedArgs.length > 40 ? \"...\" : \"\"}]`;\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"tree-selector-content.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/tree-selector-content.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,MAAM,UAAU,iBAAiB,CAAC,IAAqB;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,SAAS,EAAE,CAAC;YAChB,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACrB,IAAI,SAAS,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;gBACrC,KAAK,CAAC,IAAI,CAAC,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AAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,QAAQ,IAAI,GAAG,CAAC;QACxB,CAAC;QACD,SAAS,CAAC;YACT,kDAAkD;YAClD,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5C,MAAM,OAAO,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5C,OAAO,IAAI,IAAI,KAAK,OAAO,GAAG,cAAc,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;QAC1E,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import type { SessionTreeNode } from \"../../../core/session-manager.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport type { ToolCallInfo } from \"./tree-selector-types.ts\";\n\nexport function getSearchableText(node: SessionTreeNode): string {\n\tconst entry = node.entry;\n\tconst parts: string[] = [];\n\n\tif (node.label) {\n\t\tparts.push(node.label);\n\t}\n\n\tswitch (entry.type) {\n\t\tcase \"message\": {\n\t\t\tconst msg = entry.message;\n\t\t\tparts.push(msg.role);\n\t\t\tif (\"content\" in msg && msg.content) {\n\t\t\t\tparts.push(extractContent(msg.content));\n\t\t\t}\n\t\t\tif (msg.role === \"bashExecution\") {\n\t\t\t\tconst bashMsg = msg as { command?: string };\n\t\t\t\tif (bashMsg.command) parts.push(bashMsg.command);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"custom_message\": {\n\t\t\tparts.push(entry.customType);\n\t\t\tif (typeof entry.content === \"string\") {\n\t\t\t\tparts.push(entry.content);\n\t\t\t} else {\n\t\t\t\tparts.push(extractContent(entry.content));\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"compaction\":\n\t\t\tparts.push(\"compaction\");\n\t\t\tbreak;\n\t\tcase \"branch_summary\":\n\t\t\tparts.push(\"branch summary\", entry.summary);\n\t\t\tbreak;\n\t\tcase \"session_info\":\n\t\t\tparts.push(\"title\");\n\t\t\tif (entry.name) parts.push(entry.name);\n\t\t\tbreak;\n\t\tcase \"session_summary\":\n\t\t\tparts.push(\"session summary\", entry.summary);\n\t\t\tbreak;\n\t\tcase \"model_change\":\n\t\t\tparts.push(\"model\", entry.modelId);\n\t\t\tbreak;\n\t\tcase \"thinking_level_change\":\n\t\t\tparts.push(\"thinking\", entry.thinkingLevel);\n\t\t\tbreak;\n\t\tcase \"custom\":\n\t\t\tparts.push(\"custom\", entry.customType);\n\t\t\tbreak;\n\t\tcase \"label\":\n\t\t\tparts.push(\"label\", entry.label ?? \"\");\n\t\t\tbreak;\n\t}\n\n\treturn parts.join(\" \");\n}\n\nexport function getEntryDisplayText(\n\tnode: SessionTreeNode,\n\tisSelected: boolean,\n\ttoolCallMap: Map<string, ToolCallInfo>,\n): string {\n\tconst entry = node.entry;\n\tlet result: string;\n\n\tswitch (entry.type) {\n\t\tcase \"message\": {\n\t\t\tconst msg = entry.message;\n\t\t\tconst role = msg.role;\n\t\t\tif (role === \"user\") {\n\t\t\t\tconst msgWithContent = msg as { content?: unknown };\n\t\t\t\tconst content = normalizeText(extractContent(msgWithContent.content));\n\t\t\t\tresult = theme.fg(\"accent\", \"user: \") + content;\n\t\t\t} else if (role === \"assistant\") {\n\t\t\t\tconst msgWithContent = msg as { content?: unknown; stopReason?: string; errorMessage?: string };\n\t\t\t\tconst textContent = normalizeText(extractContent(msgWithContent.content));\n\t\t\t\tif (textContent) {\n\t\t\t\t\tresult = theme.fg(\"success\", \"assistant: \") + textContent;\n\t\t\t\t} else if (msgWithContent.stopReason === \"aborted\") {\n\t\t\t\t\tresult = theme.fg(\"success\", \"assistant: \") + theme.fg(\"muted\", \"(aborted)\");\n\t\t\t\t} else if (msgWithContent.errorMessage) {\n\t\t\t\t\tconst errMsg = normalizeText(msgWithContent.errorMessage).slice(0, 80);\n\t\t\t\t\tresult = theme.fg(\"success\", \"assistant: \") + theme.fg(\"error\", errMsg);\n\t\t\t\t} else {\n\t\t\t\t\tresult = theme.fg(\"success\", \"assistant: \") + theme.fg(\"muted\", \"(no content)\");\n\t\t\t\t}\n\t\t\t} else if (role === \"toolResult\") {\n\t\t\t\tconst toolMsg = msg as { toolCallId?: string; toolName?: string };\n\t\t\t\tconst toolCall = toolMsg.toolCallId ? toolCallMap.get(toolMsg.toolCallId) : undefined;\n\t\t\t\tif (toolCall) {\n\t\t\t\t\tresult = theme.fg(\"muted\", formatToolCall(toolCall.name, toolCall.arguments));\n\t\t\t\t} else {\n\t\t\t\t\tresult = theme.fg(\"muted\", `[${toolMsg.toolName ?? \"tool\"}]`);\n\t\t\t\t}\n\t\t\t} else if (role === \"bashExecution\") {\n\t\t\t\tconst bashMsg = msg as { command?: string };\n\t\t\t\tresult = theme.fg(\"dim\", `[bash]: ${normalizeText(bashMsg.command ?? \"\")}`);\n\t\t\t} else {\n\t\t\t\tresult = theme.fg(\"dim\", `[${role}]`);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"custom_message\": {\n\t\t\tconst content =\n\t\t\t\ttypeof entry.content === \"string\"\n\t\t\t\t\t? entry.content\n\t\t\t\t\t: entry.content\n\t\t\t\t\t\t\t.filter((c): c is { type: \"text\"; text: string } => c.type === \"text\")\n\t\t\t\t\t\t\t.map((c) => c.text)\n\t\t\t\t\t\t\t.join(\"\");\n\t\t\tresult = theme.fg(\"customMessageLabel\", `[${entry.customType}]: `) + normalizeText(content);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"compaction\": {\n\t\t\tconst tokens = Math.round(entry.tokensBefore / 1000);\n\t\t\tresult = theme.fg(\"borderAccent\", `[compaction: ${tokens}k tokens]`);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"branch_summary\":\n\t\t\tresult = theme.fg(\"warning\", `[branch summary]: `) + normalizeText(entry.summary);\n\t\t\tbreak;\n\t\tcase \"model_change\":\n\t\t\tresult = theme.fg(\"dim\", `[model: ${entry.modelId}]`);\n\t\t\tbreak;\n\t\tcase \"thinking_level_change\":\n\t\t\tresult = theme.fg(\"dim\", `[thinking: ${entry.thinkingLevel}]`);\n\t\t\tbreak;\n\t\tcase \"custom\":\n\t\t\tresult = theme.fg(\"dim\", `[custom: ${entry.customType}]`);\n\t\t\tbreak;\n\t\tcase \"label\":\n\t\t\tresult = theme.fg(\"dim\", `[label: ${entry.label ?? \"(cleared)\"}]`);\n\t\t\tbreak;\n\t\tcase \"session_info\":\n\t\t\tresult = entry.name\n\t\t\t\t? [theme.fg(\"dim\", \"[title: \"), theme.fg(\"dim\", entry.name), theme.fg(\"dim\", \"]\")].join(\"\")\n\t\t\t\t: [theme.fg(\"dim\", \"[title: \"), theme.italic(theme.fg(\"dim\", \"empty\")), theme.fg(\"dim\", \"]\")].join(\"\");\n\t\t\tbreak;\n\t\tcase \"session_summary\":\n\t\t\tresult = theme.fg(\"dim\", `[session summary]: `) + normalizeText(entry.summary);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tresult = \"\";\n\t}\n\n\treturn isSelected ? theme.bold(result) : result;\n}\n\nexport function formatLabelTimestamp(timestamp: string): string {\n\tconst date = new Date(timestamp);\n\tconst now = new Date();\n\tconst hours = date.getHours().toString().padStart(2, \"0\");\n\tconst minutes = date.getMinutes().toString().padStart(2, \"0\");\n\tconst time = `${hours}:${minutes}`;\n\n\tif (\n\t\tdate.getFullYear() === now.getFullYear() &&\n\t\tdate.getMonth() === now.getMonth() &&\n\t\tdate.getDate() === now.getDate()\n\t) {\n\t\treturn time;\n\t}\n\n\tconst month = date.getMonth() + 1;\n\tconst day = date.getDate();\n\tif (date.getFullYear() === now.getFullYear()) {\n\t\treturn `${month}/${day} ${time}`;\n\t}\n\n\tconst year = date.getFullYear().toString().slice(-2);\n\treturn `${year}/${month}/${day} ${time}`;\n}\n\nexport function extractContent(content: unknown): string {\n\tconst maxLen = 200;\n\tif (typeof content === \"string\") return content.slice(0, maxLen);\n\tif (Array.isArray(content)) {\n\t\tlet result = \"\";\n\t\tfor (const c of content) {\n\t\t\tif (typeof c === \"object\" && c !== null && \"type\" in c && c.type === \"text\") {\n\t\t\t\tresult += (c as { text: string }).text;\n\t\t\t\tif (result.length >= maxLen) return result.slice(0, maxLen);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\treturn \"\";\n}\n\nexport function hasTextContent(content: unknown): boolean {\n\tif (typeof content === \"string\") return content.trim().length > 0;\n\tif (Array.isArray(content)) {\n\t\tfor (const c of content) {\n\t\t\tif (typeof c === \"object\" && c !== null && \"type\" in c && c.type === \"text\") {\n\t\t\t\tconst text = (c as { text?: string }).text;\n\t\t\t\tif (text && text.trim().length > 0) return true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction normalizeText(s: string): string {\n\treturn s.replace(/[\\n\\t]/g, \" \").trim();\n}\n\nfunction formatToolCall(name: string, args: Record<string, unknown>): string {\n\tconst shortenPath = (p: string): string => {\n\t\tconst home = process.env.HOME || process.env.USERPROFILE || \"\";\n\t\tif (home && p.startsWith(home)) return `~${p.slice(home.length)}`;\n\t\treturn p;\n\t};\n\n\tswitch (name) {\n\t\tcase \"read\": {\n\t\t\tconst path = shortenPath(String(args.path || args.file_path || \"\"));\n\t\t\tconst offset = args.offset as number | undefined;\n\t\t\tconst limit = args.limit as number | undefined;\n\t\t\tlet display = path;\n\t\t\tif (offset !== undefined || limit !== undefined) {\n\t\t\t\tconst start = offset ?? 1;\n\t\t\t\tconst end = limit !== undefined ? start + limit - 1 : \"\";\n\t\t\t\tdisplay += `:${start}${end ? `-${end}` : \"\"}`;\n\t\t\t}\n\t\t\treturn `[read: ${display}]`;\n\t\t}\n\t\tcase \"write\": {\n\t\t\tconst path = shortenPath(String(args.path || args.file_path || \"\"));\n\t\t\treturn `[write: ${path}]`;\n\t\t}\n\t\tcase \"edit\": {\n\t\t\tconst path = shortenPath(String(args.path || args.file_path || \"\"));\n\t\t\treturn `[edit: ${path}]`;\n\t\t}\n\t\tcase \"bash\": {\n\t\t\tconst rawCmd = String(args.command || \"\");\n\t\t\tconst cmd = rawCmd\n\t\t\t\t.replace(/[\\n\\t]/g, \" \")\n\t\t\t\t.trim()\n\t\t\t\t.slice(0, 50);\n\t\t\treturn `[bash: ${cmd}${rawCmd.length > 50 ? \"...\" : \"\"}]`;\n\t\t}\n\t\tcase \"find\": {\n\t\t\tconst pattern = String(args.pattern || \"\");\n\t\t\tconst path = shortenPath(String(args.path || \".\"));\n\t\t\treturn `[find: ${pattern} in ${path}]`;\n\t\t}\n\t\tcase \"ls\": {\n\t\t\tconst path = shortenPath(String(args.path || \".\"));\n\t\t\treturn `[ls: ${path}]`;\n\t\t}\n\t\tdefault: {\n\t\t\t// Custom tool - show name and truncated JSON args\n\t\t\tconst serializedArgs = JSON.stringify(args);\n\t\t\tconst argsStr = serializedArgs.slice(0, 40);\n\t\t\treturn `[${name}: ${argsStr}${serializedArgs.length > 40 ? \"...\" : \"\"}]`;\n\t\t}\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive-engine/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAwB,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAClG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,IAAI,CAAC;AAErD,MAAM,WAAW,UAAU;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AAED,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,EAAE,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpF,MAAM,WAAW,0BAA0B;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM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,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACzF;IAAE,IAAI,EAAE,0BAA0B,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAY7D,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,IAAI,SAAS,CAIhG;AA4KD,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS,CAgIhG;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS,CAkFhG;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,wBAAwB,GAAG,wBAAwB,GAAG,MAAM,CAEpH;AAED,eAAO,MAAM,iCAAiC,wCAAkC,CAAC"}
@@ -43,7 +43,7 @@ const SESSION_PICKER_MESSAGE_COLORS = ["success", "warning", "accent", "error"];
43
43
  function parseSessionPickerRow(value) {
44
44
  if (!isJsonObject(value))
45
45
  return undefined;
46
- const { path, id, cwd, createdAt, modifiedAt, messageCount, firstMessage, allMessagesText, name, messageColor } = value;
46
+ const { path, id, cwd, createdAt, modifiedAt, messageCount, firstMessage, summary, allMessagesText, name, messageColor, } = value;
47
47
  if (typeof path !== "string" ||
48
48
  typeof id !== "string" ||
49
49
  typeof cwd !== "string" ||
@@ -52,6 +52,8 @@ function parseSessionPickerRow(value) {
52
52
  typeof messageCount !== "number" ||
53
53
  typeof firstMessage !== "string")
54
54
  return undefined;
55
+ if (summary !== undefined && typeof summary !== "string")
56
+ return undefined;
55
57
  if (allMessagesText !== undefined && typeof allMessagesText !== "string")
56
58
  return undefined;
57
59
  if (name !== undefined && typeof name !== "string")
@@ -67,6 +69,7 @@ function parseSessionPickerRow(value) {
67
69
  modifiedAt,
68
70
  messageCount,
69
71
  firstMessage,
72
+ ...(summary !== undefined ? { summary } : {}),
70
73
  ...(allMessagesText !== undefined ? { allMessagesText } : {}),
71
74
  ...(name !== undefined ? { name } : {}),
72
75
  ...(messageColor !== undefined
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/protocol.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAiIrD,MAAM,cAAc,GAAoC;IACvD,gBAAgB;IAChB,UAAU;IACV,cAAc;IACd,cAAc;IACd,mBAAmB;IACnB,cAAc;IACd,wBAAwB;CACxB,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,KAAgD;IAC3E,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1E,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,SAAS,YAAY,CAAC,KAAgB;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,cAAc,CAAC,KAAgB;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,cAAc,CAAC,QAAQ,CAAC,KAA6B,CAAC,CAAC;AAC5F,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAgB;IAC3C,OAAO,CACN,YAAY,CAAC,KAAK,CAAC;QACnB,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ;QAC5B,cAAc,CAAC,KAAK,CAAC,IAAI,C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C5B,eAAe,EAAE,KAAK,CAAC,eAAe;SACtC,CAAC;IACH,CAAC;IACD,IACC,KAAK,CAAC,IAAI,KAAK,uBAAuB;QACtC,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ;QACnC,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;QAC/B,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC;QAC3B,OAAO,KAAK,CAAC,QAAQ,KAAK,SAAS;QACnC,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,EAClC,CAAC;QACF,OAAO;YACN,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,SAAS,EAAE,KAAK,CAAC,SAAS;SAC1B,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,OAA4D;IAC3G,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;AACvC,CAAC;AAED,MAAM,CAAC,MAAM,iCAAiC,GAAG,+BAA+B,CAAC","sourcesContent":["import type { CallbackActivity, CallbackActivityKind } from \"../../core/callback-activity.ts\";\nimport type { HostInputFormField, HostSessionPickerRow } from \"../../core/extensions/ui-types.ts\";\nimport type { KeyId } from \"../../core/keybindings.ts\";\n\n/**\n * Version 3 adds correlated replies for `engine_custom_input`. The host uses\n * those replies to decide whether a matching fullscreen viewport key should be\n * replayed, so a child that cannot send them must not be treated as compatible.\n */\nexport const INTERACTIVE_ENGINE_PROTOCOL_VERSION = 3;\n\nexport interface JsonObject {\n\t[key: string]: JsonValue;\n}\n\nexport type JsonValue = boolean | JsonObject | JsonValue[] | null | number | string;\n\nexport interface SerializableOverlayOptions {\n\tanchor?: string;\n\tcol?: number | string;\n\tmargin?: number | { top?: number; right?: number; bottom?: number; left?: number };\n\tmaxHeight?: number | string;\n\tmaxWidth?: number | string;\n\tminHeight?: number;\n\tminWidth?: number;\n\toffsetX?: number;\n\toffsetY?: number;\n\trow?: number | string;\n\twidth?: number | string;\n}\n\n/**\n * Allowlisted terminal-mode control a remote custom component may ask the host\n * to apply to the real host TTY. Deliberately NOT a raw byte channel: the child\n * names an intent and the host owns the concrete escape sequence, so a buggy or\n * compromised child can only toggle this documented mode.\n */\nexport type EngineTerminalControl = { kind: \"autowrap\"; enabled: boolean };\n\nexport interface EngineExtensionShortcut {\n\tkey: string;\n\tdescription?: string;\n}\n\nexport type SerializableKeybindingsConfig = Record<string, KeyId | KeyId[]>;\n\nexport interface EngineKeybindingState {\n\tuserBindings: SerializableKeybindingsConfig;\n\teffectiveBindings: SerializableKeybindingsConfig;\n\tshortcuts: EngineExtensionShortcut[];\n}\n\nexport type InteractiveEngineMessage =\n\t| { type: \"engine_ready\"; protocolVersion: typeof INTERACTIVE_ENGINE_PROTOCOL_VERSION; pid: number }\n\t| { type: \"engine_bound\" }\n\t| { type: \"engine_keybindings_reloaded\"; state: EngineKeybindingState }\n\t| { type: \"engine_heartbeat\"; at: number }\n\t| { type: \"engine_activity_started\"; activity: CallbackActivity }\n\t| { type: \"engine_activity_finished\"; activityId: string }\n\t/**\n\t * The child took ownership of a correlated RPC request: it has parsed the\n\t * command and is about to run it. Emitted and flushed BEFORE any handler\n\t * work, so a later transport failure can be told apart from a send that\n\t * never landed. Output is not a substitute: a command can run to completion\n\t * with side effects and produce nothing.\n\t */\n\t| { type: \"engine_request_accepted\"; requestId: string; command: string }\n\t| {\n\t\t\ttype: \"engine_custom_open\";\n\t\t\tcomponentId: string;\n\t\t\toverlay: boolean;\n\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\thandlesCtrlC?: boolean;\n\t\t\toverlayOptions?: SerializableOverlayOptions;\n\t\t\twidgetKey?: string;\n\t\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\";\n\t }\n\t| { type: \"engine_custom_close\"; componentId: string }\n\t| { type: \"engine_custom_frame\"; componentId: string; requestId: number; lines: string[] }\n\t| { type: \"engine_custom_input_result\"; componentId: string; requestId: number; handled: boolean }\n\t| { type: \"engine_custom_invalidate\"; componentId: string }\n\t| { type: \"engine_custom_done\"; componentId: string; result?: JsonValue }\n\t| { type: \"engine_custom_terminal\"; componentId: string; control: EngineTerminalControl }\n\t| { type: \"engine_custom_control\"; componentId: string; action: \"focus\" | \"hide\" | \"show\" | \"unfocus\" }\n\t| {\n\t\t\ttype: \"engine_session_picker_open\";\n\t\t\tcomponentId: string;\n\t\t\tsessions: HostSessionPickerRow[];\n\t\t\tshowRenameHint?: boolean;\n\t }\n\t| { type: \"engine_session_picker_update\"; componentId: string; sessions: HostSessionPickerRow[] }\n\t| { type: \"engine_session_picker_error\"; componentId: string; message: string }\n\t| { type: \"engine_session_picker_close\"; componentId: string }\n\t| {\n\t\t\ttype: \"engine_input_form_open\";\n\t\t\tcomponentId: string;\n\t\t\ttitle: string;\n\t\t\tfields: HostInputFormField[];\n\t\t\theading?: string;\n\t\t\tsubmitLabel?: string;\n\t }\n\t| { type: \"engine_input_form_close\"; componentId: string };\nexport type InteractiveEngineCommand =\n\t| { type: \"engine_custom_render\"; componentId: string; requestId: number; width: number; rows: number }\n\t| { type: \"engine_custom_input\"; componentId: string; requestId: number; data: string }\n\t| { type: \"engine_custom_dispose\"; componentId: string }\n\t| {\n\t\t\ttype: \"engine_tool_render\";\n\t\t\tcomponentId: string;\n\t\t\trequestId: number;\n\t\t\twidth: number;\n\t\t\ttoolName: string;\n\t\t\ttoolCallId: string;\n\t\t\targs: JsonValue;\n\t\t\tresult?: JsonObject;\n\t\t\texecutionStarted: boolean;\n\t\t\targsComplete: boolean;\n\t\t\tisPartial: boolean;\n\t\t\texpanded: boolean;\n\t\t\tshowImages: boolean;\n\t\t\timageWidthCells: number;\n\t }\n\t| {\n\t\t\ttype: \"engine_message_render\";\n\t\t\tcomponentId: string;\n\t\t\trequestId: number;\n\t\t\twidth: number;\n\t\t\tmessage: JsonObject;\n\t\t\texpanded: boolean;\n\t\t\toutputPad: number;\n\t }\n\t| { type: \"engine_render_dispose\"; componentId: string }\n\t| { type: \"engine_session_picker_select\"; componentId: string; path: string }\n\t| { type: \"engine_session_picker_cancel\"; componentId: string }\n\t| { type: \"engine_session_picker_delete\"; componentId: string; path: string }\n\t| { type: \"engine_input_form_submit\"; componentId: string; values: Record<string, string> }\n\t| { type: \"engine_input_form_cancel\"; componentId: string };\n\nconst ACTIVITY_KINDS: readonly CallbackActivityKind[] = [\n\t\"extension.hook\",\n\t\"renderer\",\n\t\"tool.execute\",\n\t\"tool.prepare\",\n\t\"workflow.ctx_tool\",\n\t\"workflow.run\",\n\t\"workflow.stage_adapter\",\n];\n\nexport function isJsonValue(value: object | boolean | null | number | string): value is JsonValue {\n\tif (value === null || typeof value !== \"object\") return true;\n\tif (Array.isArray(value)) return value.every((item) => isJsonValue(item));\n\treturn Object.values(value).every((item) => item !== undefined && isJsonValue(item));\n}\n\nfunction isJsonObject(value: JsonValue): value is JsonObject {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isActivityKind(value: JsonValue): value is CallbackActivityKind {\n\treturn typeof value === \"string\" && ACTIVITY_KINDS.includes(value as CallbackActivityKind);\n}\n\nfunction isCallbackActivity(value: JsonValue): value is JsonObject & CallbackActivity {\n\treturn (\n\t\tisJsonObject(value) &&\n\t\ttypeof value.id === \"string\" &&\n\t\tisActivityKind(value.kind) &&\n\t\ttypeof value.name === \"string\" &&\n\t\ttypeof value.startedAt === \"number\"\n\t);\n}\n\nfunction parseEngineTerminalControl(value: JsonValue | undefined): EngineTerminalControl | undefined {\n\tif (value === undefined || !isJsonObject(value) || value.kind !== \"autowrap\" || typeof value.enabled !== \"boolean\") {\n\t\treturn undefined;\n\t}\n\treturn { kind: \"autowrap\", enabled: value.enabled };\n}\n\nconst SESSION_PICKER_MESSAGE_COLORS = [\"success\", \"warning\", \"accent\", \"error\"] as const;\n\nfunction parseSessionPickerRow(value: JsonValue): HostSessionPickerRow | undefined {\n\tif (!isJsonObject(value)) return undefined;\n\tconst { path, id, cwd, createdAt, modifiedAt, messageCount, firstMessage, allMessagesText, name, messageColor } =\n\t\tvalue;\n\tif (\n\t\ttypeof path !== \"string\" ||\n\t\ttypeof id !== \"string\" ||\n\t\ttypeof cwd !== \"string\" ||\n\t\ttypeof createdAt !== \"number\" ||\n\t\ttypeof modifiedAt !== \"number\" ||\n\t\ttypeof messageCount !== \"number\" ||\n\t\ttypeof firstMessage !== \"string\"\n\t)\n\t\treturn undefined;\n\tif (allMessagesText !== undefined && typeof allMessagesText !== \"string\") return undefined;\n\tif (name !== undefined && typeof name !== \"string\") return undefined;\n\tif (\n\t\tmessageColor !== undefined &&\n\t\t!SESSION_PICKER_MESSAGE_COLORS.includes(messageColor as (typeof SESSION_PICKER_MESSAGE_COLORS)[number])\n\t)\n\t\treturn undefined;\n\treturn {\n\t\tpath,\n\t\tid,\n\t\tcwd,\n\t\tcreatedAt,\n\t\tmodifiedAt,\n\t\tmessageCount,\n\t\tfirstMessage,\n\t\t...(allMessagesText !== undefined ? { allMessagesText } : {}),\n\t\t...(name !== undefined ? { name } : {}),\n\t\t...(messageColor !== undefined\n\t\t\t? { messageColor: messageColor as (typeof SESSION_PICKER_MESSAGE_COLORS)[number] }\n\t\t\t: {}),\n\t};\n}\n\nfunction parseSessionPickerRows(value: JsonValue | undefined): HostSessionPickerRow[] | undefined {\n\tif (!Array.isArray(value)) return undefined;\n\tconst rows: HostSessionPickerRow[] = [];\n\tfor (const entry of value) {\n\t\tconst row = parseSessionPickerRow(entry);\n\t\tif (!row) return undefined;\n\t\trows.push(row);\n\t}\n\treturn rows;\n}\n\nconst INPUT_FORM_FIELD_TYPES = [\"string\", \"text\", \"number\", \"integer\", \"boolean\", \"select\"] as const;\n\nfunction parseInputFormFields(value: JsonValue | undefined): HostInputFormField[] | undefined {\n\tif (!Array.isArray(value)) return undefined;\n\tconst fields: HostInputFormField[] = [];\n\tfor (const entry of value) {\n\t\tif (!isJsonObject(entry)) return undefined;\n\t\tconst { name, type, description, required, choices, placeholder, initialValue } = entry;\n\t\tif (\n\t\t\ttypeof name !== \"string\" ||\n\t\t\t!INPUT_FORM_FIELD_TYPES.includes(type as HostInputFormField[\"type\"]) ||\n\t\t\ttypeof initialValue !== \"string\"\n\t\t)\n\t\t\treturn undefined;\n\t\tif (description !== undefined && typeof description !== \"string\") return undefined;\n\t\tif (required !== undefined && typeof required !== \"boolean\") return undefined;\n\t\tif (choices !== undefined && (!Array.isArray(choices) || !choices.every((choice) => typeof choice === \"string\")))\n\t\t\treturn undefined;\n\t\tif (placeholder !== undefined && typeof placeholder !== \"string\") return undefined;\n\t\tfields.push({\n\t\t\tname,\n\t\t\ttype: type as HostInputFormField[\"type\"],\n\t\t\tinitialValue,\n\t\t\t...(typeof description === \"string\" ? { description } : {}),\n\t\t\t...(typeof required === \"boolean\" ? { required } : {}),\n\t\t\t...(Array.isArray(choices) ? { choices: choices as string[] } : {}),\n\t\t\t...(typeof placeholder === \"string\" ? { placeholder } : {}),\n\t\t});\n\t}\n\treturn fields;\n}\n\nfunction parseStringRecord(value: JsonValue | undefined): Record<string, string> | undefined {\n\tif (value === undefined || !isJsonObject(value)) return undefined;\n\tconst entries = Object.entries(value);\n\tif (entries.some(([, entry]) => typeof entry !== \"string\")) return undefined;\n\treturn Object.fromEntries(entries) as Record<string, string>;\n}\n\nfunction parseKeybindingsConfig(value: JsonValue | undefined): SerializableKeybindingsConfig | undefined {\n\tif (value === undefined || !isJsonObject(value)) return undefined;\n\tconst config: SerializableKeybindingsConfig = {};\n\tfor (const [key, binding] of Object.entries(value)) {\n\t\tif (typeof binding === \"string\") config[key] = binding as SerializableKeybindingsConfig[string];\n\t\telse if (Array.isArray(binding) && binding.every((entry) => typeof entry === \"string\")) {\n\t\t\tconfig[key] = binding as SerializableKeybindingsConfig[string];\n\t\t} else return undefined;\n\t}\n\treturn config;\n}\n\nfunction parseKeybindingState(value: JsonValue | undefined): EngineKeybindingState | undefined {\n\tif (value === undefined || !isJsonObject(value) || !Array.isArray(value.shortcuts)) return undefined;\n\tconst userBindings = parseKeybindingsConfig(value.userBindings);\n\tconst effectiveBindings = parseKeybindingsConfig(value.effectiveBindings);\n\tif (!userBindings || !effectiveBindings) return undefined;\n\tconst shortcuts: EngineExtensionShortcut[] = [];\n\tfor (const shortcut of value.shortcuts) {\n\t\tif (\n\t\t\t!isJsonObject(shortcut) ||\n\t\t\ttypeof shortcut.key !== \"string\" ||\n\t\t\t(shortcut.description !== undefined && typeof shortcut.description !== \"string\")\n\t\t)\n\t\t\treturn undefined;\n\t\tshortcuts.push({\n\t\t\tkey: shortcut.key,\n\t\t\t...(typeof shortcut.description === \"string\" ? { description: shortcut.description } : {}),\n\t\t});\n\t}\n\treturn { userBindings, effectiveBindings, shortcuts };\n}\n\nfunction parseJsonObject(line: string): JsonObject | undefined {\n\tlet value: JsonValue;\n\ttry {\n\t\tvalue = JSON.parse(line) as JsonValue;\n\t} catch {\n\t\treturn undefined;\n\t}\n\treturn isJsonObject(value) ? value : undefined;\n}\n\nexport function parseInteractiveEngineMessage(line: string): InteractiveEngineMessage | undefined {\n\tconst value = parseJsonObject(line);\n\tif (!value || typeof value.type !== \"string\") return undefined;\n\tswitch (value.type) {\n\t\tcase \"engine_ready\":\n\t\t\treturn value.protocolVersion === INTERACTIVE_ENGINE_PROTOCOL_VERSION && typeof value.pid === \"number\"\n\t\t\t\t? { type: value.type, protocolVersion: INTERACTIVE_ENGINE_PROTOCOL_VERSION, pid: value.pid }\n\t\t\t\t: undefined;\n\t\tcase \"engine_bound\":\n\t\t\treturn { type: value.type };\n\t\tcase \"engine_keybindings_reloaded\": {\n\t\t\tconst state = parseKeybindingState(value.state);\n\t\t\treturn state ? { type: value.type, state } : undefined;\n\t\t}\n\t\tcase \"engine_heartbeat\":\n\t\t\treturn typeof value.at === \"number\" ? { type: value.type, at: value.at } : undefined;\n\t\tcase \"engine_activity_started\":\n\t\t\treturn isCallbackActivity(value.activity) ? { type: value.type, activity: value.activity } : undefined;\n\t\tcase \"engine_activity_finished\":\n\t\t\treturn typeof value.activityId === \"string\" ? { type: value.type, activityId: value.activityId } : undefined;\n\t\tcase \"engine_request_accepted\":\n\t\t\treturn typeof value.requestId === \"string\" && typeof value.command === \"string\"\n\t\t\t\t? { type: value.type, requestId: value.requestId, command: value.command }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_open\":\n\t\t\treturn typeof value.componentId === \"string\" && typeof value.overlay === \"boolean\"\n\t\t\t\t? {\n\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\tcomponentId: value.componentId,\n\t\t\t\t\t\toverlay: value.overlay,\n\t\t\t\t\t\tdeferInlineCustomUiFocus: value.deferInlineCustomUiFocus === true,\n\t\t\t\t\t\thandlesCtrlC: value.handlesCtrlC === true,\n\t\t\t\t\t\toverlayOptions: isJsonObject(value.overlayOptions)\n\t\t\t\t\t\t\t? (value.overlayOptions as SerializableOverlayOptions)\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\twidgetKey: typeof value.widgetKey === \"string\" ? value.widgetKey : undefined,\n\t\t\t\t\t\twidgetPlacement:\n\t\t\t\t\t\t\tvalue.widgetPlacement === \"belowEditor\"\n\t\t\t\t\t\t\t\t? \"belowEditor\"\n\t\t\t\t\t\t\t\t: value.widgetPlacement === \"aboveEditor\"\n\t\t\t\t\t\t\t\t\t? \"aboveEditor\"\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t}\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_close\":\n\t\t\treturn typeof value.componentId === \"string\"\n\t\t\t\t? { type: value.type, componentId: value.componentId }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_frame\":\n\t\t\treturn typeof value.componentId === \"string\" &&\n\t\t\t\ttypeof value.requestId === \"number\" &&\n\t\t\t\tArray.isArray(value.lines) &&\n\t\t\t\tvalue.lines.every((entry) => typeof entry === \"string\")\n\t\t\t\t? { type: value.type, componentId: value.componentId, requestId: value.requestId, lines: value.lines }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_input_result\":\n\t\t\treturn typeof value.componentId === \"string\" &&\n\t\t\t\ttypeof value.requestId === \"number\" &&\n\t\t\t\ttypeof value.handled === \"boolean\"\n\t\t\t\t? { type: value.type, componentId: value.componentId, requestId: value.requestId, handled: value.handled }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_invalidate\":\n\t\t\treturn typeof value.componentId === \"string\"\n\t\t\t\t? { type: value.type, componentId: value.componentId }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_done\":\n\t\t\treturn typeof value.componentId === \"string\"\n\t\t\t\t? { type: value.type, componentId: value.componentId, result: value.result }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_terminal\": {\n\t\t\tconst control = parseEngineTerminalControl(value.control);\n\t\t\treturn typeof value.componentId === \"string\" && control\n\t\t\t\t? { type: value.type, componentId: value.componentId, control }\n\t\t\t\t: undefined;\n\t\t}\n\t\tcase \"engine_custom_control\":\n\t\t\treturn typeof value.componentId === \"string\" &&\n\t\t\t\t[\"focus\", \"hide\", \"show\", \"unfocus\"].includes(String(value.action))\n\t\t\t\t? {\n\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\tcomponentId: value.componentId,\n\t\t\t\t\t\taction: value.action as \"focus\" | \"hide\" | \"show\" | \"unfocus\",\n\t\t\t\t\t}\n\t\t\t\t: undefined;\n\t\tcase \"engine_session_picker_open\": {\n\t\t\tconst sessions = parseSessionPickerRows(value.sessions);\n\t\t\treturn typeof value.componentId === \"string\" &&\n\t\t\t\tsessions &&\n\t\t\t\t(value.showRenameHint === undefined || typeof value.showRenameHint === \"boolean\")\n\t\t\t\t? {\n\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\tcomponentId: value.componentId,\n\t\t\t\t\t\tsessions,\n\t\t\t\t\t\t...(typeof value.showRenameHint === \"boolean\" ? { showRenameHint: value.showRenameHint } : {}),\n\t\t\t\t\t}\n\t\t\t\t: undefined;\n\t\t}\n\t\tcase \"engine_session_picker_update\": {\n\t\t\tconst sessions = parseSessionPickerRows(value.sessions);\n\t\t\treturn typeof value.componentId === \"string\" && sessions\n\t\t\t\t? { type: value.type, componentId: value.componentId, sessions }\n\t\t\t\t: undefined;\n\t\t}\n\t\tcase \"engine_session_picker_error\":\n\t\t\treturn typeof value.componentId === \"string\" && typeof value.message === \"string\"\n\t\t\t\t? { type: value.type, componentId: value.componentId, message: value.message }\n\t\t\t\t: undefined;\n\t\tcase \"engine_session_picker_close\":\n\t\tcase \"engine_input_form_close\":\n\t\t\treturn typeof value.componentId === \"string\"\n\t\t\t\t? { type: value.type, componentId: value.componentId }\n\t\t\t\t: undefined;\n\t\tcase \"engine_input_form_open\": {\n\t\t\tconst fields = parseInputFormFields(value.fields);\n\t\t\treturn typeof value.componentId === \"string\" && typeof value.title === \"string\" && fields\n\t\t\t\t? {\n\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\tcomponentId: value.componentId,\n\t\t\t\t\t\ttitle: value.title,\n\t\t\t\t\t\tfields,\n\t\t\t\t\t\t...(typeof value.heading === \"string\" ? { heading: value.heading } : {}),\n\t\t\t\t\t\t...(typeof value.submitLabel === \"string\" ? { submitLabel: value.submitLabel } : {}),\n\t\t\t\t\t}\n\t\t\t\t: undefined;\n\t\t}\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nexport function parseInteractiveEngineCommand(line: string): InteractiveEngineCommand | undefined {\n\tconst value = parseJsonObject(line);\n\tif (!value || typeof value.type !== \"string\" || typeof value.componentId !== \"string\") return undefined;\n\tif (\n\t\tvalue.type === \"engine_custom_render\" &&\n\t\ttypeof value.requestId === \"number\" &&\n\t\ttypeof value.width === \"number\" &&\n\t\ttypeof value.rows === \"number\"\n\t) {\n\t\treturn {\n\t\t\ttype: value.type,\n\t\t\tcomponentId: value.componentId,\n\t\t\trequestId: value.requestId,\n\t\t\twidth: value.width,\n\t\t\trows: value.rows,\n\t\t};\n\t}\n\tif (value.type === \"engine_custom_input\" && typeof value.requestId === \"number\" && typeof value.data === \"string\")\n\t\treturn { type: value.type, componentId: value.componentId, requestId: value.requestId, data: value.data };\n\tif (value.type === \"engine_custom_dispose\" || value.type === \"engine_render_dispose\")\n\t\treturn { type: value.type, componentId: value.componentId };\n\tif (\n\t\t(value.type === \"engine_session_picker_select\" || value.type === \"engine_session_picker_delete\") &&\n\t\ttypeof value.path === \"string\"\n\t) {\n\t\treturn { type: value.type, componentId: value.componentId, path: value.path };\n\t}\n\tif (value.type === \"engine_session_picker_cancel\") return { type: value.type, componentId: value.componentId };\n\tif (value.type === \"engine_input_form_cancel\") return { type: value.type, componentId: value.componentId };\n\tif (value.type === \"engine_input_form_submit\") {\n\t\tconst values = parseStringRecord(value.values);\n\t\treturn values ? { type: value.type, componentId: value.componentId, values } : undefined;\n\t}\n\tif (\n\t\tvalue.type === \"engine_tool_render\" &&\n\t\ttypeof value.requestId === \"number\" &&\n\t\ttypeof value.width === \"number\" &&\n\t\ttypeof value.toolName === \"string\" &&\n\t\ttypeof value.toolCallId === \"string\" &&\n\t\ttypeof value.executionStarted === \"boolean\" &&\n\t\ttypeof value.argsComplete === \"boolean\" &&\n\t\ttypeof value.isPartial === \"boolean\" &&\n\t\ttypeof value.expanded === \"boolean\" &&\n\t\ttypeof value.showImages === \"boolean\" &&\n\t\ttypeof value.imageWidthCells === \"number\"\n\t) {\n\t\treturn {\n\t\t\ttype: value.type,\n\t\t\tcomponentId: value.componentId,\n\t\t\trequestId: value.requestId,\n\t\t\twidth: value.width,\n\t\t\ttoolName: value.toolName,\n\t\t\ttoolCallId: value.toolCallId,\n\t\t\targs: value.args,\n\t\t\tresult: isJsonObject(value.result) ? value.result : undefined,\n\t\t\texecutionStarted: value.executionStarted,\n\t\t\targsComplete: value.argsComplete,\n\t\t\tisPartial: value.isPartial,\n\t\t\texpanded: value.expanded,\n\t\t\tshowImages: value.showImages,\n\t\t\timageWidthCells: value.imageWidthCells,\n\t\t};\n\t}\n\tif (\n\t\tvalue.type === \"engine_message_render\" &&\n\t\ttypeof value.requestId === \"number\" &&\n\t\ttypeof value.width === \"number\" &&\n\t\tisJsonObject(value.message) &&\n\t\ttypeof value.expanded === \"boolean\" &&\n\t\ttypeof value.outputPad === \"number\"\n\t) {\n\t\treturn {\n\t\t\ttype: value.type,\n\t\t\tcomponentId: value.componentId,\n\t\t\trequestId: value.requestId,\n\t\t\twidth: value.width,\n\t\t\tmessage: value.message,\n\t\t\texpanded: value.expanded,\n\t\t\toutputPad: value.outputPad,\n\t\t};\n\t}\n\treturn undefined;\n}\n\nexport function serializeInteractiveEngineFrame(message: InteractiveEngineMessage | InteractiveEngineCommand): string {\n\treturn `${JSON.stringify(message)}\\n`;\n}\n\nexport const serializeInteractiveEngineMessage = serializeInteractiveEngineFrame;\n"]}
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/protocol.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAiIrD,MAAM,cAAc,GAAoC;IACvD,gBAAgB;IAChB,UAAU;IACV,cAAc;IACd,cAAc;IACd,mBAAmB;IACnB,cAAc;IACd,wBAAwB;CACxB,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,KAAgD;IAC3E,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1E,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EA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AAK,CAAC,OAAO;YACtB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,SAAS,EAAE,KAAK,CAAC,SAAS;SAC1B,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,+BAA+B,CAAC,OAA4D;IAC3G,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;AACvC,CAAC;AAED,MAAM,CAAC,MAAM,iCAAiC,GAAG,+BAA+B,CAAC","sourcesContent":["import type { CallbackActivity, CallbackActivityKind } from \"../../core/callback-activity.ts\";\nimport type { HostInputFormField, HostSessionPickerRow } from \"../../core/extensions/ui-types.ts\";\nimport type { KeyId } from \"../../core/keybindings.ts\";\n\n/**\n * Version 3 adds correlated replies for `engine_custom_input`. The host uses\n * those replies to decide whether a matching fullscreen viewport key should be\n * replayed, so a child that cannot send them must not be treated as compatible.\n */\nexport const INTERACTIVE_ENGINE_PROTOCOL_VERSION = 3;\n\nexport interface JsonObject {\n\t[key: string]: JsonValue;\n}\n\nexport type JsonValue = boolean | JsonObject | JsonValue[] | null | number | string;\n\nexport interface SerializableOverlayOptions {\n\tanchor?: string;\n\tcol?: number | string;\n\tmargin?: number | { top?: number; right?: number; bottom?: number; left?: number };\n\tmaxHeight?: number | string;\n\tmaxWidth?: number | string;\n\tminHeight?: number;\n\tminWidth?: number;\n\toffsetX?: number;\n\toffsetY?: number;\n\trow?: number | string;\n\twidth?: number | string;\n}\n\n/**\n * Allowlisted terminal-mode control a remote custom component may ask the host\n * to apply to the real host TTY. Deliberately NOT a raw byte channel: the child\n * names an intent and the host owns the concrete escape sequence, so a buggy or\n * compromised child can only toggle this documented mode.\n */\nexport type EngineTerminalControl = { kind: \"autowrap\"; enabled: boolean };\n\nexport interface EngineExtensionShortcut {\n\tkey: string;\n\tdescription?: string;\n}\n\nexport type SerializableKeybindingsConfig = Record<string, KeyId | KeyId[]>;\n\nexport interface EngineKeybindingState {\n\tuserBindings: SerializableKeybindingsConfig;\n\teffectiveBindings: SerializableKeybindingsConfig;\n\tshortcuts: EngineExtensionShortcut[];\n}\n\nexport type InteractiveEngineMessage =\n\t| { type: \"engine_ready\"; protocolVersion: typeof INTERACTIVE_ENGINE_PROTOCOL_VERSION; pid: number }\n\t| { type: \"engine_bound\" }\n\t| { type: \"engine_keybindings_reloaded\"; state: EngineKeybindingState }\n\t| { type: \"engine_heartbeat\"; at: number }\n\t| { type: \"engine_activity_started\"; activity: CallbackActivity }\n\t| { type: \"engine_activity_finished\"; activityId: string }\n\t/**\n\t * The child took ownership of a correlated RPC request: it has parsed the\n\t * command and is about to run it. Emitted and flushed BEFORE any handler\n\t * work, so a later transport failure can be told apart from a send that\n\t * never landed. Output is not a substitute: a command can run to completion\n\t * with side effects and produce nothing.\n\t */\n\t| { type: \"engine_request_accepted\"; requestId: string; command: string }\n\t| {\n\t\t\ttype: \"engine_custom_open\";\n\t\t\tcomponentId: string;\n\t\t\toverlay: boolean;\n\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\thandlesCtrlC?: boolean;\n\t\t\toverlayOptions?: SerializableOverlayOptions;\n\t\t\twidgetKey?: string;\n\t\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\";\n\t }\n\t| { type: \"engine_custom_close\"; componentId: string }\n\t| { type: \"engine_custom_frame\"; componentId: string; requestId: number; lines: string[] }\n\t| { type: \"engine_custom_input_result\"; componentId: string; requestId: number; handled: boolean }\n\t| { type: \"engine_custom_invalidate\"; componentId: string }\n\t| { type: \"engine_custom_done\"; componentId: string; result?: JsonValue }\n\t| { type: \"engine_custom_terminal\"; componentId: string; control: EngineTerminalControl }\n\t| { type: \"engine_custom_control\"; componentId: string; action: \"focus\" | \"hide\" | \"show\" | \"unfocus\" }\n\t| {\n\t\t\ttype: \"engine_session_picker_open\";\n\t\t\tcomponentId: string;\n\t\t\tsessions: HostSessionPickerRow[];\n\t\t\tshowRenameHint?: boolean;\n\t }\n\t| { type: \"engine_session_picker_update\"; componentId: string; sessions: HostSessionPickerRow[] }\n\t| { type: \"engine_session_picker_error\"; componentId: string; message: string }\n\t| { type: \"engine_session_picker_close\"; componentId: string }\n\t| {\n\t\t\ttype: \"engine_input_form_open\";\n\t\t\tcomponentId: string;\n\t\t\ttitle: string;\n\t\t\tfields: HostInputFormField[];\n\t\t\theading?: string;\n\t\t\tsubmitLabel?: string;\n\t }\n\t| { type: \"engine_input_form_close\"; componentId: string };\nexport type InteractiveEngineCommand =\n\t| { type: \"engine_custom_render\"; componentId: string; requestId: number; width: number; rows: number }\n\t| { type: \"engine_custom_input\"; componentId: string; requestId: number; data: string }\n\t| { type: \"engine_custom_dispose\"; componentId: string }\n\t| {\n\t\t\ttype: \"engine_tool_render\";\n\t\t\tcomponentId: string;\n\t\t\trequestId: number;\n\t\t\twidth: number;\n\t\t\ttoolName: string;\n\t\t\ttoolCallId: string;\n\t\t\targs: JsonValue;\n\t\t\tresult?: JsonObject;\n\t\t\texecutionStarted: boolean;\n\t\t\targsComplete: boolean;\n\t\t\tisPartial: boolean;\n\t\t\texpanded: boolean;\n\t\t\tshowImages: boolean;\n\t\t\timageWidthCells: number;\n\t }\n\t| {\n\t\t\ttype: \"engine_message_render\";\n\t\t\tcomponentId: string;\n\t\t\trequestId: number;\n\t\t\twidth: number;\n\t\t\tmessage: JsonObject;\n\t\t\texpanded: boolean;\n\t\t\toutputPad: number;\n\t }\n\t| { type: \"engine_render_dispose\"; componentId: string }\n\t| { type: \"engine_session_picker_select\"; componentId: string; path: string }\n\t| { type: \"engine_session_picker_cancel\"; componentId: string }\n\t| { type: \"engine_session_picker_delete\"; componentId: string; path: string }\n\t| { type: \"engine_input_form_submit\"; componentId: string; values: Record<string, string> }\n\t| { type: \"engine_input_form_cancel\"; componentId: string };\n\nconst ACTIVITY_KINDS: readonly CallbackActivityKind[] = [\n\t\"extension.hook\",\n\t\"renderer\",\n\t\"tool.execute\",\n\t\"tool.prepare\",\n\t\"workflow.ctx_tool\",\n\t\"workflow.run\",\n\t\"workflow.stage_adapter\",\n];\n\nexport function isJsonValue(value: object | boolean | null | number | string): value is JsonValue {\n\tif (value === null || typeof value !== \"object\") return true;\n\tif (Array.isArray(value)) return value.every((item) => isJsonValue(item));\n\treturn Object.values(value).every((item) => item !== undefined && isJsonValue(item));\n}\n\nfunction isJsonObject(value: JsonValue): value is JsonObject {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isActivityKind(value: JsonValue): value is CallbackActivityKind {\n\treturn typeof value === \"string\" && ACTIVITY_KINDS.includes(value as CallbackActivityKind);\n}\n\nfunction isCallbackActivity(value: JsonValue): value is JsonObject & CallbackActivity {\n\treturn (\n\t\tisJsonObject(value) &&\n\t\ttypeof value.id === \"string\" &&\n\t\tisActivityKind(value.kind) &&\n\t\ttypeof value.name === \"string\" &&\n\t\ttypeof value.startedAt === \"number\"\n\t);\n}\n\nfunction parseEngineTerminalControl(value: JsonValue | undefined): EngineTerminalControl | undefined {\n\tif (value === undefined || !isJsonObject(value) || value.kind !== \"autowrap\" || typeof value.enabled !== \"boolean\") {\n\t\treturn undefined;\n\t}\n\treturn { kind: \"autowrap\", enabled: value.enabled };\n}\n\nconst SESSION_PICKER_MESSAGE_COLORS = [\"success\", \"warning\", \"accent\", \"error\"] as const;\n\nfunction parseSessionPickerRow(value: JsonValue): HostSessionPickerRow | undefined {\n\tif (!isJsonObject(value)) return undefined;\n\tconst {\n\t\tpath,\n\t\tid,\n\t\tcwd,\n\t\tcreatedAt,\n\t\tmodifiedAt,\n\t\tmessageCount,\n\t\tfirstMessage,\n\t\tsummary,\n\t\tallMessagesText,\n\t\tname,\n\t\tmessageColor,\n\t} = value;\n\tif (\n\t\ttypeof path !== \"string\" ||\n\t\ttypeof id !== \"string\" ||\n\t\ttypeof cwd !== \"string\" ||\n\t\ttypeof createdAt !== \"number\" ||\n\t\ttypeof modifiedAt !== \"number\" ||\n\t\ttypeof messageCount !== \"number\" ||\n\t\ttypeof firstMessage !== \"string\"\n\t)\n\t\treturn undefined;\n\tif (summary !== undefined && typeof summary !== \"string\") return undefined;\n\tif (allMessagesText !== undefined && typeof allMessagesText !== \"string\") return undefined;\n\tif (name !== undefined && typeof name !== \"string\") return undefined;\n\tif (\n\t\tmessageColor !== undefined &&\n\t\t!SESSION_PICKER_MESSAGE_COLORS.includes(messageColor as (typeof SESSION_PICKER_MESSAGE_COLORS)[number])\n\t)\n\t\treturn undefined;\n\treturn {\n\t\tpath,\n\t\tid,\n\t\tcwd,\n\t\tcreatedAt,\n\t\tmodifiedAt,\n\t\tmessageCount,\n\t\tfirstMessage,\n\t\t...(summary !== undefined ? { summary } : {}),\n\t\t...(allMessagesText !== undefined ? { allMessagesText } : {}),\n\t\t...(name !== undefined ? { name } : {}),\n\t\t...(messageColor !== undefined\n\t\t\t? { messageColor: messageColor as (typeof SESSION_PICKER_MESSAGE_COLORS)[number] }\n\t\t\t: {}),\n\t};\n}\n\nfunction parseSessionPickerRows(value: JsonValue | undefined): HostSessionPickerRow[] | undefined {\n\tif (!Array.isArray(value)) return undefined;\n\tconst rows: HostSessionPickerRow[] = [];\n\tfor (const entry of value) {\n\t\tconst row = parseSessionPickerRow(entry);\n\t\tif (!row) return undefined;\n\t\trows.push(row);\n\t}\n\treturn rows;\n}\n\nconst INPUT_FORM_FIELD_TYPES = [\"string\", \"text\", \"number\", \"integer\", \"boolean\", \"select\"] as const;\n\nfunction parseInputFormFields(value: JsonValue | undefined): HostInputFormField[] | undefined {\n\tif (!Array.isArray(value)) return undefined;\n\tconst fields: HostInputFormField[] = [];\n\tfor (const entry of value) {\n\t\tif (!isJsonObject(entry)) return undefined;\n\t\tconst { name, type, description, required, choices, placeholder, initialValue } = entry;\n\t\tif (\n\t\t\ttypeof name !== \"string\" ||\n\t\t\t!INPUT_FORM_FIELD_TYPES.includes(type as HostInputFormField[\"type\"]) ||\n\t\t\ttypeof initialValue !== \"string\"\n\t\t)\n\t\t\treturn undefined;\n\t\tif (description !== undefined && typeof description !== \"string\") return undefined;\n\t\tif (required !== undefined && typeof required !== \"boolean\") return undefined;\n\t\tif (choices !== undefined && (!Array.isArray(choices) || !choices.every((choice) => typeof choice === \"string\")))\n\t\t\treturn undefined;\n\t\tif (placeholder !== undefined && typeof placeholder !== \"string\") return undefined;\n\t\tfields.push({\n\t\t\tname,\n\t\t\ttype: type as HostInputFormField[\"type\"],\n\t\t\tinitialValue,\n\t\t\t...(typeof description === \"string\" ? { description } : {}),\n\t\t\t...(typeof required === \"boolean\" ? { required } : {}),\n\t\t\t...(Array.isArray(choices) ? { choices: choices as string[] } : {}),\n\t\t\t...(typeof placeholder === \"string\" ? { placeholder } : {}),\n\t\t});\n\t}\n\treturn fields;\n}\n\nfunction parseStringRecord(value: JsonValue | undefined): Record<string, string> | undefined {\n\tif (value === undefined || !isJsonObject(value)) return undefined;\n\tconst entries = Object.entries(value);\n\tif (entries.some(([, entry]) => typeof entry !== \"string\")) return undefined;\n\treturn Object.fromEntries(entries) as Record<string, string>;\n}\n\nfunction parseKeybindingsConfig(value: JsonValue | undefined): SerializableKeybindingsConfig | undefined {\n\tif (value === undefined || !isJsonObject(value)) return undefined;\n\tconst config: SerializableKeybindingsConfig = {};\n\tfor (const [key, binding] of Object.entries(value)) {\n\t\tif (typeof binding === \"string\") config[key] = binding as SerializableKeybindingsConfig[string];\n\t\telse if (Array.isArray(binding) && binding.every((entry) => typeof entry === \"string\")) {\n\t\t\tconfig[key] = binding as SerializableKeybindingsConfig[string];\n\t\t} else return undefined;\n\t}\n\treturn config;\n}\n\nfunction parseKeybindingState(value: JsonValue | undefined): EngineKeybindingState | undefined {\n\tif (value === undefined || !isJsonObject(value) || !Array.isArray(value.shortcuts)) return undefined;\n\tconst userBindings = parseKeybindingsConfig(value.userBindings);\n\tconst effectiveBindings = parseKeybindingsConfig(value.effectiveBindings);\n\tif (!userBindings || !effectiveBindings) return undefined;\n\tconst shortcuts: EngineExtensionShortcut[] = [];\n\tfor (const shortcut of value.shortcuts) {\n\t\tif (\n\t\t\t!isJsonObject(shortcut) ||\n\t\t\ttypeof shortcut.key !== \"string\" ||\n\t\t\t(shortcut.description !== undefined && typeof shortcut.description !== \"string\")\n\t\t)\n\t\t\treturn undefined;\n\t\tshortcuts.push({\n\t\t\tkey: shortcut.key,\n\t\t\t...(typeof shortcut.description === \"string\" ? { description: shortcut.description } : {}),\n\t\t});\n\t}\n\treturn { userBindings, effectiveBindings, shortcuts };\n}\n\nfunction parseJsonObject(line: string): JsonObject | undefined {\n\tlet value: JsonValue;\n\ttry {\n\t\tvalue = JSON.parse(line) as JsonValue;\n\t} catch {\n\t\treturn undefined;\n\t}\n\treturn isJsonObject(value) ? value : undefined;\n}\n\nexport function parseInteractiveEngineMessage(line: string): InteractiveEngineMessage | undefined {\n\tconst value = parseJsonObject(line);\n\tif (!value || typeof value.type !== \"string\") return undefined;\n\tswitch (value.type) {\n\t\tcase \"engine_ready\":\n\t\t\treturn value.protocolVersion === INTERACTIVE_ENGINE_PROTOCOL_VERSION && typeof value.pid === \"number\"\n\t\t\t\t? { type: value.type, protocolVersion: INTERACTIVE_ENGINE_PROTOCOL_VERSION, pid: value.pid }\n\t\t\t\t: undefined;\n\t\tcase \"engine_bound\":\n\t\t\treturn { type: value.type };\n\t\tcase \"engine_keybindings_reloaded\": {\n\t\t\tconst state = parseKeybindingState(value.state);\n\t\t\treturn state ? { type: value.type, state } : undefined;\n\t\t}\n\t\tcase \"engine_heartbeat\":\n\t\t\treturn typeof value.at === \"number\" ? { type: value.type, at: value.at } : undefined;\n\t\tcase \"engine_activity_started\":\n\t\t\treturn isCallbackActivity(value.activity) ? { type: value.type, activity: value.activity } : undefined;\n\t\tcase \"engine_activity_finished\":\n\t\t\treturn typeof value.activityId === \"string\" ? { type: value.type, activityId: value.activityId } : undefined;\n\t\tcase \"engine_request_accepted\":\n\t\t\treturn typeof value.requestId === \"string\" && typeof value.command === \"string\"\n\t\t\t\t? { type: value.type, requestId: value.requestId, command: value.command }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_open\":\n\t\t\treturn typeof value.componentId === \"string\" && typeof value.overlay === \"boolean\"\n\t\t\t\t? {\n\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\tcomponentId: value.componentId,\n\t\t\t\t\t\toverlay: value.overlay,\n\t\t\t\t\t\tdeferInlineCustomUiFocus: value.deferInlineCustomUiFocus === true,\n\t\t\t\t\t\thandlesCtrlC: value.handlesCtrlC === true,\n\t\t\t\t\t\toverlayOptions: isJsonObject(value.overlayOptions)\n\t\t\t\t\t\t\t? (value.overlayOptions as SerializableOverlayOptions)\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\twidgetKey: typeof value.widgetKey === \"string\" ? value.widgetKey : undefined,\n\t\t\t\t\t\twidgetPlacement:\n\t\t\t\t\t\t\tvalue.widgetPlacement === \"belowEditor\"\n\t\t\t\t\t\t\t\t? \"belowEditor\"\n\t\t\t\t\t\t\t\t: value.widgetPlacement === \"aboveEditor\"\n\t\t\t\t\t\t\t\t\t? \"aboveEditor\"\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t}\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_close\":\n\t\t\treturn typeof value.componentId === \"string\"\n\t\t\t\t? { type: value.type, componentId: value.componentId }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_frame\":\n\t\t\treturn typeof value.componentId === \"string\" &&\n\t\t\t\ttypeof value.requestId === \"number\" &&\n\t\t\t\tArray.isArray(value.lines) &&\n\t\t\t\tvalue.lines.every((entry) => typeof entry === \"string\")\n\t\t\t\t? { type: value.type, componentId: value.componentId, requestId: value.requestId, lines: value.lines }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_input_result\":\n\t\t\treturn typeof value.componentId === \"string\" &&\n\t\t\t\ttypeof value.requestId === \"number\" &&\n\t\t\t\ttypeof value.handled === \"boolean\"\n\t\t\t\t? { type: value.type, componentId: value.componentId, requestId: value.requestId, handled: value.handled }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_invalidate\":\n\t\t\treturn typeof value.componentId === \"string\"\n\t\t\t\t? { type: value.type, componentId: value.componentId }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_done\":\n\t\t\treturn typeof value.componentId === \"string\"\n\t\t\t\t? { type: value.type, componentId: value.componentId, result: value.result }\n\t\t\t\t: undefined;\n\t\tcase \"engine_custom_terminal\": {\n\t\t\tconst control = parseEngineTerminalControl(value.control);\n\t\t\treturn typeof value.componentId === \"string\" && control\n\t\t\t\t? { type: value.type, componentId: value.componentId, control }\n\t\t\t\t: undefined;\n\t\t}\n\t\tcase \"engine_custom_control\":\n\t\t\treturn typeof value.componentId === \"string\" &&\n\t\t\t\t[\"focus\", \"hide\", \"show\", \"unfocus\"].includes(String(value.action))\n\t\t\t\t? {\n\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\tcomponentId: value.componentId,\n\t\t\t\t\t\taction: value.action as \"focus\" | \"hide\" | \"show\" | \"unfocus\",\n\t\t\t\t\t}\n\t\t\t\t: undefined;\n\t\tcase \"engine_session_picker_open\": {\n\t\t\tconst sessions = parseSessionPickerRows(value.sessions);\n\t\t\treturn typeof value.componentId === \"string\" &&\n\t\t\t\tsessions &&\n\t\t\t\t(value.showRenameHint === undefined || typeof value.showRenameHint === \"boolean\")\n\t\t\t\t? {\n\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\tcomponentId: value.componentId,\n\t\t\t\t\t\tsessions,\n\t\t\t\t\t\t...(typeof value.showRenameHint === \"boolean\" ? { showRenameHint: value.showRenameHint } : {}),\n\t\t\t\t\t}\n\t\t\t\t: undefined;\n\t\t}\n\t\tcase \"engine_session_picker_update\": {\n\t\t\tconst sessions = parseSessionPickerRows(value.sessions);\n\t\t\treturn typeof value.componentId === \"string\" && sessions\n\t\t\t\t? { type: value.type, componentId: value.componentId, sessions }\n\t\t\t\t: undefined;\n\t\t}\n\t\tcase \"engine_session_picker_error\":\n\t\t\treturn typeof value.componentId === \"string\" && typeof value.message === \"string\"\n\t\t\t\t? { type: value.type, componentId: value.componentId, message: value.message }\n\t\t\t\t: undefined;\n\t\tcase \"engine_session_picker_close\":\n\t\tcase \"engine_input_form_close\":\n\t\t\treturn typeof value.componentId === \"string\"\n\t\t\t\t? { type: value.type, componentId: value.componentId }\n\t\t\t\t: undefined;\n\t\tcase \"engine_input_form_open\": {\n\t\t\tconst fields = parseInputFormFields(value.fields);\n\t\t\treturn typeof value.componentId === \"string\" && typeof value.title === \"string\" && fields\n\t\t\t\t? {\n\t\t\t\t\t\ttype: value.type,\n\t\t\t\t\t\tcomponentId: value.componentId,\n\t\t\t\t\t\ttitle: value.title,\n\t\t\t\t\t\tfields,\n\t\t\t\t\t\t...(typeof value.heading === \"string\" ? { heading: value.heading } : {}),\n\t\t\t\t\t\t...(typeof value.submitLabel === \"string\" ? { submitLabel: value.submitLabel } : {}),\n\t\t\t\t\t}\n\t\t\t\t: undefined;\n\t\t}\n\t\tdefault:\n\t\t\treturn undefined;\n\t}\n}\n\nexport function parseInteractiveEngineCommand(line: string): InteractiveEngineCommand | undefined {\n\tconst value = parseJsonObject(line);\n\tif (!value || typeof value.type !== \"string\" || typeof value.componentId !== \"string\") return undefined;\n\tif (\n\t\tvalue.type === \"engine_custom_render\" &&\n\t\ttypeof value.requestId === \"number\" &&\n\t\ttypeof value.width === \"number\" &&\n\t\ttypeof value.rows === \"number\"\n\t) {\n\t\treturn {\n\t\t\ttype: value.type,\n\t\t\tcomponentId: value.componentId,\n\t\t\trequestId: value.requestId,\n\t\t\twidth: value.width,\n\t\t\trows: value.rows,\n\t\t};\n\t}\n\tif (value.type === \"engine_custom_input\" && typeof value.requestId === \"number\" && typeof value.data === \"string\")\n\t\treturn { type: value.type, componentId: value.componentId, requestId: value.requestId, data: value.data };\n\tif (value.type === \"engine_custom_dispose\" || value.type === \"engine_render_dispose\")\n\t\treturn { type: value.type, componentId: value.componentId };\n\tif (\n\t\t(value.type === \"engine_session_picker_select\" || value.type === \"engine_session_picker_delete\") &&\n\t\ttypeof value.path === \"string\"\n\t) {\n\t\treturn { type: value.type, componentId: value.componentId, path: value.path };\n\t}\n\tif (value.type === \"engine_session_picker_cancel\") return { type: value.type, componentId: value.componentId };\n\tif (value.type === \"engine_input_form_cancel\") return { type: value.type, componentId: value.componentId };\n\tif (value.type === \"engine_input_form_submit\") {\n\t\tconst values = parseStringRecord(value.values);\n\t\treturn values ? { type: value.type, componentId: value.componentId, values } : undefined;\n\t}\n\tif (\n\t\tvalue.type === \"engine_tool_render\" &&\n\t\ttypeof value.requestId === \"number\" &&\n\t\ttypeof value.width === \"number\" &&\n\t\ttypeof value.toolName === \"string\" &&\n\t\ttypeof value.toolCallId === \"string\" &&\n\t\ttypeof value.executionStarted === \"boolean\" &&\n\t\ttypeof value.argsComplete === \"boolean\" &&\n\t\ttypeof value.isPartial === \"boolean\" &&\n\t\ttypeof value.expanded === \"boolean\" &&\n\t\ttypeof value.showImages === \"boolean\" &&\n\t\ttypeof value.imageWidthCells === \"number\"\n\t) {\n\t\treturn {\n\t\t\ttype: value.type,\n\t\t\tcomponentId: value.componentId,\n\t\t\trequestId: value.requestId,\n\t\t\twidth: value.width,\n\t\t\ttoolName: value.toolName,\n\t\t\ttoolCallId: value.toolCallId,\n\t\t\targs: value.args,\n\t\t\tresult: isJsonObject(value.result) ? value.result : undefined,\n\t\t\texecutionStarted: value.executionStarted,\n\t\t\targsComplete: value.argsComplete,\n\t\t\tisPartial: value.isPartial,\n\t\t\texpanded: value.expanded,\n\t\t\tshowImages: value.showImages,\n\t\t\timageWidthCells: value.imageWidthCells,\n\t\t};\n\t}\n\tif (\n\t\tvalue.type === \"engine_message_render\" &&\n\t\ttypeof value.requestId === \"number\" &&\n\t\ttypeof value.width === \"number\" &&\n\t\tisJsonObject(value.message) &&\n\t\ttypeof value.expanded === \"boolean\" &&\n\t\ttypeof value.outputPad === \"number\"\n\t) {\n\t\treturn {\n\t\t\ttype: value.type,\n\t\t\tcomponentId: value.componentId,\n\t\t\trequestId: value.requestId,\n\t\t\twidth: value.width,\n\t\t\tmessage: value.message,\n\t\t\texpanded: value.expanded,\n\t\t\toutputPad: value.outputPad,\n\t\t};\n\t}\n\treturn undefined;\n}\n\nexport function serializeInteractiveEngineFrame(message: InteractiveEngineMessage | InteractiveEngineCommand): string {\n\treturn `${JSON.stringify(message)}\\n`;\n}\n\nexport const serializeInteractiveEngineMessage = serializeInteractiveEngineFrame;\n"]}
@@ -26,7 +26,7 @@ Provider keys include `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `AZURE_OPENAI_API_K
26
26
 
27
27
  ## Bash session environment
28
28
 
29
- Every built-in, factory-created, direct, foreground/background, workflow-stage, and isolated bash execution receives one execution-time snapshot:
29
+ Every built-in, factory-created, direct, workflow-stage, and isolated bash execution receives one execution-time snapshot:
30
30
 
31
31
  | Atomic variable | Exact Pi alias | Value |
32
32
  |---|---|---|
package/docs/intercom.md CHANGED
@@ -12,18 +12,17 @@ Atomic bundles `@bastani/intercom`, a first-party extension for direct 1:1 messa
12
12
  **Key capabilities:**
13
13
  - **Session messaging** - `send`, `ask` (blocking, 10-minute timeout), `reply`, `pending`, `list`, and `status` via the `intercom` tool
14
14
  - **Runtime groups** - `join` or `leave` named groups without restarting; joined sessions keep their broker IDs and subagents inherit the joined group
15
- - **Session discovery** - List connected sessions with name, short ID, working directory, model, and live status
15
+ - **Session discovery** - List connected sessions with name, full session ID, working directory, model, and live status
16
16
  - **Keyboard overlay** - ALT+M or `/intercom` opens a session picker and compose overlay
17
17
  - **Attachments** - Share `file`, `snippet`, and `context` payloads between sessions
18
18
  - **Subagent escalation** - Delegated children get a `contact_supervisor` tool for decisions, structured interviews, and progress updates
19
- - **Run notifications** - Workflows and subagents deliver async results and control notices to a parent session over Intercom
19
+ - **Run notifications** - Workflows and subagents deliver run results and control notices to a parent session over Intercom
20
20
  - **Bundled skill** - `/skill:intercom` provides planner-worker, group, and escalation-handling patterns
21
21
 
22
22
  **Example use cases:**
23
23
  - Planner–worker splits across two terminals
24
24
  - Research → implementation context handoffs
25
25
  - Supervisor decisions and structured interviews for delegated subagents
26
- - Async workflow/subagent completion and needs-attention notices
27
26
  - Pair debugging between sessions
28
27
 
29
28
  ## Table of Contents
@@ -75,20 +74,20 @@ The agent can list sessions and send messages using the `intercom` tool. Tool ca
75
74
  // List active sessions
76
75
  intercom({ action: "list" })
77
76
  // → **Current session:**
78
- // → • executor (20d43841) — ~/projects/api (claude-sonnet-4) [self, idle]
77
+ // → • executor (20d43841-1111-4222-8333-123456789abc) — ~/projects/api (claude-sonnet-4) [self, idle]
79
78
  // → **Other sessions:**
80
- // → • research (6332faab) — ~/projects/api (claude-sonnet-4) [same cwd, thinking]
79
+ // → • research (6332faab-1111-4222-8333-123456789abc) — ~/projects/api (claude-sonnet-4) [same cwd, thinking]
81
80
 
82
81
  // Send a message
83
82
  intercom({ action: "send", to: "research", message: "Check if UserService.validate() handles null" })
84
83
  // → Message sent to research
85
84
 
86
- // The short ID printed by list is also a valid target
87
- intercom({ action: "ask", to: "6332faab", message: "Which validation path should I use?" })
85
+ // The full session ID printed by list is also a valid target
86
+ intercom({ action: "ask", to: "6332faab-1111-4222-8333-123456789abc", message: "Which validation path should I use?" })
88
87
 
89
88
  // Check connection status
90
89
  intercom({ action: "status" })
91
- // → Connected: Yes, Session ID: abc123, Active sessions: 3
90
+ // → Connected: Yes, Session ID: abc12345-1111-4222-8333-123456789abc, Active sessions: 3
92
91
 
93
92
  // Send with attachments (code snippets, files, or context)
94
93
  intercom({
@@ -132,14 +131,14 @@ A session becomes intercom-connected when all of these are true:
132
131
 
133
132
  The session list only shows intercom-connected sessions, not every open Atomic process on the machine.
134
133
 
135
- Name sessions with `/name` so they can target each other (for example `/name planner` and `/name worker`). If a session is unnamed, Intercom exposes a runtime-only fallback alias like `subagent-chat-1a2b3c4d` so other sessions can still target it. That alias is not persisted as the session title, so resume pickers keep showing the transcript snippet instead of a generic name.
134
+ Name sessions with `/name` so they can target each other (for example `/name planner` and `/name worker`). If a session is unnamed, Intercom exposes a runtime-only fallback alias like `subagent-chat-1a2b3c4d-1111-4222-8333-123456789abc` so other sessions can still target it. That alias is not persisted as the session title, so resume pickers keep showing the transcript snippet instead of a generic name.
136
135
 
137
136
  ## The intercom Tool
138
137
 
139
138
  | Parameter | Type | Description |
140
139
  |-----------|------|-------------|
141
140
  | `action` | string | `"list"`, `"join"`, `"leave"`, `"send"`, `"ask"`, `"reply"`, `"pending"`, or `"status"` |
142
- | `to` | string | Exact session name, exact full ID, or unique ID prefix (for send/ask, or to disambiguate reply) |
141
+ | `to` | string | Exact session name or exact full session ID (for send/ask, or targeted reply) |
143
142
  | `message` | string | Message text (for send/ask/reply) |
144
143
  | `attachments` | array | Optional `file`, `snippet`, or `context` attachments |
145
144
  | `replyTo` | string | Optional message ID for threading or replying to an `ask` |
@@ -151,7 +150,7 @@ Name sessions with `/name` so they can target each other (for example `/name pla
151
150
  |--------|----------|
152
151
  | `join` | Moves the session into a trimmed named group and creates it if needed. The action waits for broker acknowledgement before changing local inheritance state. `default` is the shared group; `true` and `auto` are reserved for subagent auto-groups. |
153
152
  | `leave` | Returns the session to its resolved home group from startup. It takes no `group` parameter. |
154
- | `list` | Returns the current session plus other active intercom-connected sessions with name, short ID, working directory, model, and live status (`idle`, `thinking`, or `tool:<name>`, derived from lifecycle events). Every displayed short ID is a valid target. |
153
+ | `list` | Returns the current session plus other active intercom-connected sessions with name, full session ID, working directory, model, and live status (`idle`, `thinking`, or `tool:<name>`, derived from lifecycle events). Every displayed full session ID is a valid target. |
155
154
  | `send` | Fire-and-forget delivery. Requires `to` and `message`; returns delivery confirmation or the delivery-failure reason. Cannot message the current session. |
156
155
  | `ask` | Sends a message and blocks until the recipient replies (10-minute timeout). The reply is returned as the tool result, so the agent continues in the same turn. |
157
156
  | `reply` | Replies to the intercom-triggered message of the current turn; otherwise falls back to the single unresolved inbound ask. With multiple pending asks, pass `to` or inspect with `pending` first. |
@@ -170,7 +169,7 @@ Sent and received messages are recorded in session history as `intercom_sent` /
170
169
 
171
170
  ### Targeting Sessions
172
171
 
173
- Target lookup resolves an exact full ID first, then an exact case-insensitive name, then a unique session-ID prefix. If a prefix matches multiple sessions, Intercom reports every match and asks for a longer ID or exact name instead of guessing. Resolving a prefix to the current session triggers the normal self-target rejection ("Cannot message the current session"). Targeting is also **group-scoped** — see [Groups](#groups) below.
172
+ Target lookup accepts only an exact full session ID or an exact case-insensitive session name. Targeting is also **group-scoped** — see [Groups](#groups) below.
174
173
 
175
174
  ### Groups
176
175
 
@@ -254,7 +253,7 @@ When Atomic's [subagent runtime](/subagents) admits a delegated child, the child
254
253
 
255
254
  `contact_supervisor` is registered from the typed admission record. The record binds the supervisor target, canonical child identity, child index, session name, and any broker-issued capability to that in-process child session; none of those values are inherited from environment variables. If the parent did not grant supervisor coordination, the session receives only the regular `intercom` tool.
256
255
 
257
- The child identity remains stable across foreground continuation, `async: true`, interruption, and cold resume. Intercom detach uses the same in-process continuation as async work, so the jobs widget and the eventual bounded terminal envelope retain one canonical path.
256
+ The child identity remains stable across foreground continuation, interruption, and cold resume. Intercom detach uses the same in-process continuation as foreground coordination, so the terminal envelope retains one canonical path.
258
257
 
259
258
  | Parameter | Type | Description |
260
259
  |-----------|------|-------------|
@@ -338,16 +337,15 @@ The supervisor can reply with plain JSON or a fenced `json` block. If the reply
338
337
 
339
338
  ## Workflow and Subagent Notifications
340
339
 
341
- Intercom is also the delivery channel for async run results and control notices from [workflows](/workflows) and [subagents](/subagents).
340
+ Intercom is also the delivery channel for workflow run results and subagent control notices from [workflows](/workflows) and [subagents](/subagents).
342
341
 
343
342
  ### Workflow Delivery Modes
344
343
 
345
- Programmatic `workflow()` calls accept an `intercom` option that controls how async direct-run results and control notices reach a parent session:
344
+ Programmatic `workflow()` calls accept an `intercom` option that controls how asynchronous direct-run results and control notices reach a parent session:
346
345
 
347
346
  ```typescript
348
347
  workflow({
349
348
  tasks: [{ agent: "worker", task: "..." }],
350
- async: true,
351
349
  intercom: { delivery: "result" },
352
350
  })
353
351
  ```
@@ -359,17 +357,18 @@ workflow({
359
357
  | `parentSession` | string | Target session for delivery; resolved from args or the Intercom port when omitted |
360
358
  | `notifyOn` | array | Control events to deliver: `"active_long_running"`, `"needs_attention"`, `"completed"`, `"failed"` |
361
359
 
362
- When neither `enabled` nor `delivery` is set, async direct `parallel` runs default to `control-and-result` when Intercom is available; otherwise delivery is off. Treat Intercom payloads from async direct runs as user-visible workflow output.
360
+ When neither `enabled` nor `delivery` is set, direct `parallel` runs default to `control-and-result` when Intercom is available; otherwise delivery is off. Treat Intercom payloads from direct runs as user-visible workflow output.
363
361
 
364
362
  While a workflow stage generation is open, incoming Intercom messages are admitted through the stage session's native steering/follow-up queue. If that stage is busy running a foreground subagent, Atomic synchronously reserves the message in the stage generation before starting the exact child's probe/commit detach handshake. Model-visible queue insertion waits inside that reservation until detach is acknowledged or the owner is unclaimed/disappears, so terminal stage close cannot overtake and silently drop the message. The stage drains the admitted delivery before publishing its terminal snapshot. A destination-side admission failure returns a correlated actionable error to a blocking asker instead of waiting for the 10-minute reply timeout.
363
+
365
364
  ### Subagent Control Notices
366
365
 
367
366
  The `subagent` tool's `control` options select which control events notify the parent and over which channels:
368
367
 
369
368
  - **`notifyOn`** — defaults to `["active_long_running", "needs_attention"]`
370
- - **`notifyChannels`** — defaults to `["event", "async", "intercom"]` (all that are available)
369
+ - **`notifyChannels`** — defaults to `["event", "intercom"]` (all that are available)
371
370
 
372
- Async subagent result delivery over Intercom is confirmation-based and preserves a successful delivery phase across watcher replacement. Each delegated child gets a deterministic Intercom target derived from its run/agent/index identity, and run results report those targets ("Run intercom target" / "Previous intercom target"; targets may be inactive after completion). `subagent({ action: "doctor" })` reports Intercom bridge availability and whether Intercom is enabled in config.
371
+ Detached subagent result delivery over Intercom is confirmation-based and preserves a successful delivery phase across watcher replacement. Each delegated child gets a deterministic Intercom target derived from its run/agent/index identity, and run results report those targets ("Run intercom target" / "Previous intercom target"; targets may be inactive after completion). `subagent({ action: "doctor" })` reports Intercom bridge availability and whether Intercom is enabled in config.
373
372
 
374
373
  If live child-to-parent coordination is needed, invoke `intercom({ action: "status" })` in the parent before launching; the child connects on its first `contact_supervisor` or `intercom` call. Fresh child sessions receive the bundled Intercom wrapper through normal package discovery unless an explicit `extensions` allowlist excludes it.
375
374
 
@@ -377,7 +376,7 @@ If live child-to-parent coordination is needed, invoke `intercom({ action: "stat
377
376
 
378
377
  During a foreground subagent run, Atomic probes for the exact live foreground owner before delivery: the matching child reserves the request, accepts a generation-scoped detach commit, and acknowledges it before messages enter the parent's model-visible steering queue. A commit accepted by one member of a foreground parallel group releases supervision for all active siblings while retaining their in-process session ownership, allowing the aggregate tool call to return. If the owner disappears between probe and commit, a still-current receiver uses its ordinary fallback route rather than dropping the broker-delivered message. Blocking calls stay alive until the exact threaded reply; generation cancellation or replacement invalidates stale handshakes.
379
378
 
380
- For delegated background children, queued messages and terminal lifecycle notices are ordered per child: pre-terminal messages are admitted FIFO and atomically together with the paused, completed, or failed notice, exact terminal-identity deduplication prevents double admission, failed dispatches remain retryable, and correlated ask replies bypass unrelated queued sends. See [Subagents](/subagents) for the full coordination contract.
379
+ For delegated children, queued messages and terminal lifecycle notices are ordered per child: pre-terminal messages are admitted FIFO and atomically together with the paused, completed, or failed notice, exact terminal-identity deduplication prevents double admission, failed dispatches remain retryable, and correlated ask replies bypass unrelated queued sends. See [Subagents](/subagents) for the full coordination contract.
381
380
 
382
381
  ## Configuration
383
382
 
@@ -499,6 +498,6 @@ Use a shared-room messenger for multi-agent swarms working on one shared task. U
499
498
  ## Related Docs
500
499
 
501
500
  - [Subagents](/subagents) for delegated child runs, foreground coordination, and result delivery.
502
- - [Workflows](/workflows) for multi-stage automation and async run notifications.
501
+ - [Workflows](/workflows) for multi-stage automation and run notifications.
503
502
  - [Skills](/skills) for reusable instructions like `/skill:intercom`.
504
503
  - [Usage](/usage) for environment variables and the bundled-extension overview.
@@ -5,7 +5,7 @@ This page gets you from install to a useful first Atomic session. Atomic is the
5
5
  ## Prerequisites
6
6
 
7
7
  - **Node.js 24 LTS or newer** — Atomic requires the latest Node LTS runtime. Check with `node --version`.
8
- - **A package manager** — use npm (included with Node), pnpm, Yarn, or Bun. Use Bun 1.3.14+ for Bun installs or workflow-authoring examples.
8
+ - **A package manager** — use npm (included with Node), pnpm, Yarn, or Bun. Bun installs need Bun 1.3.14+.
9
9
  - **Model-provider access** — Use `/login` after startup. Supports provider subscriptions and APIs.
10
10
 
11
11
  ## Install
@@ -32,6 +32,10 @@ bun add -g @bastani/atomic
32
32
 
33
33
  Atomic does not require package install scripts. If you want to disable dependency lifecycle scripts during the Atomic install, you can add `--ignore-scripts` to the install command.
34
34
 
35
+ ### Which runtime runs your workflows
36
+
37
+ How you install Atomic decides which runtime hosts it: a package-manager install runs under Node, while the standalone binaries are Bun-compiled and run under Bun. Authored workflows execute inside whichever host is active, so a workflow that reaches for a `Bun.*` global runs only under the standalone binary and fails with `Bun is not defined` under an npm install. Installing Bun separately does not change that — the npm install still runs on Node. Write workflow code against APIs both hosts provide, such as `node:child_process` and `node:fs`; see [Workflows](/workflows) for the rule and worked examples.
38
+
35
39
  ### Alpine and musl Linux archives
36
40
 
37
41
  For Alpine Linux, use `atomic-linux-x64-musl.tar.gz` on x64 or `atomic-linux-arm64-musl.tar.gz` on arm64. These archives provide native search and PTY bindings. Install their runtime libraries with `apk add --no-cache libgcc libstdc++`, then see the [Alpine and musl Linux archive notes](/index#alpine-and-musl-linux-archives) for the clipboard fallback and external Postgres or Docker requirement for durable workflows.
package/docs/sdk.md CHANGED
@@ -297,7 +297,7 @@ await session.followUp("After you're done, also do this");
297
297
 
298
298
  Both `steer()` and `followUp()` expand file-based prompt templates but error on extension commands (extension commands cannot be queued).
299
299
 
300
- `pauseQueuedMessages()` is a synchronous admission gate. It moves existing raw steering/follow-up entries into a hold before an abort boundary and keeps later context-bearing arrivals—including trigger-turn custom messages, batches, interrupts, async job delivery, `sendUserMessage()`, and ordinary `prompt()` calls—queued without starting a provider turn. Content blocks, optional data, duplicate identities, raw text, message types, and the existing order within each queue kind are retained. Non-trigger custom messages remain history-only and do not invent a turn.
300
+ `pauseQueuedMessages()` is a synchronous admission gate. It moves existing raw steering/follow-up entries into a hold before an abort boundary and keeps later context-bearing arrivals—including trigger-turn custom messages, batches, interrupts, `sendUserMessage()`, and ordinary `prompt()` calls—queued without starting a provider turn. Content blocks, optional data, duplicate identities, raw text, message types, and the existing order within each queue kind are retained. Non-trigger custom messages remain history-only and do not invent a turn.
301
301
 
302
302
  `resumeQueuedMessages()` releases that hold exactly once but does **not** itself start or continue a model turn. Its promise resolves to `true` only when raw held steering/follow-up work was released, and to `false` when no held raw work existed. The caller must use its existing explicit resume action (for example, the interactive chat submission or workflow resume boundary) to drive execution. `clearQueue()` clears the paused flag when it explicitly removes the final unowned held item; if a protected or interrupt-owned item remains, the gate stays paused.
303
303
 
@@ -307,6 +307,20 @@ Session metadata (e.g., user-defined display name). Set via `/name`, `--name` /
307
307
 
308
308
  The session name is displayed in the session selector (`/resume`) instead of the first message when set.
309
309
 
310
+ ### SessionSummaryEntry
311
+
312
+ A generated one-line description of the session, written automatically once the agent goes idle and shown in the session selector. Never sent to the LLM.
313
+
314
+ ```json
315
+ {"type":"session_summary","id":"l2m3n4o5","parentId":"k1l2m3n4","timestamp":"2024-12-03T14:36:00.000Z","summary":"Refactored auth module token refresh and added retry tests","summarizedThroughId":"j0k1l2m3","usage":{"input":812,"output":21}}
316
+ ```
317
+
318
+ - `summary`: The stored line. Whitespace is collapsed and length is clamped before writing.
319
+ - `summarizedThroughId`: Entry ID of the last user/assistant message the summary covers. The selector shows the summary only while this is still the newest conversation message; anything newer makes it stale and the selector falls back to the session name or first message. Tool results do not count.
320
+ - `usage`: Optional token usage from the model call, counted toward session usage totals.
321
+
322
+ A `branch_summary` written after a `session_summary` also retires it, because the branch it described was abandoned.
323
+
310
324
  ## Tree Structure
311
325
 
312
326
  Entries form a tree:
@@ -420,6 +434,7 @@ for (const stage of stages.filter((session) => session.internal)) {
420
434
  - `appendCompaction(compactedText, firstKeptEntryId, tokensBefore, details)` - Add a durable verbatim-line compaction boundary; pass `null` when no pre-boundary message is retained
421
435
  - `appendCustomEntry(customType, data?)` - Extension state (not in context)
422
436
  - `appendSessionInfo(name)` - Set session display name
437
+ - `appendSessionSummary(summary, summarizedThroughId, usage?)` - Store a generated resume-picker summary, anchored to the message it describes
423
438
  - `appendCustomMessageEntry(customType, content, display, details?)` - Extension message (in context)
424
439
  - `appendLabelChange(targetId, label)` - Set/clear label
425
440
 
package/docs/sessions.md CHANGED
@@ -57,6 +57,14 @@ In the picker you can:
57
57
 
58
58
  When available, Atomic uses the `trash` CLI for deletion instead of permanently removing files.
59
59
 
60
+ ### Session summaries
61
+
62
+ Each row shows a short generated description of what the session was about in its own column, beside the session name or first message, so you can recognize a conversation without opening it. Atomic writes one after the agent goes idle, using the model the session is already configured with, and stores it in the session file as a `session_summary` entry.
63
+
64
+ A summary describes the conversation up to a specific message. Once a newer message arrives it is considered stale and the summary column shows "No summary available." instead — the same placeholder you get when a summary has not been generated yet, could not be generated, or is still in flight. The session name and first message are never displaced by a summary, and the column only appears once at least one listed session has a summary. Summaries are also searchable along with the rest of the session text.
65
+
66
+ Generation is best-effort and never blocks a turn: it is skipped for very short sessions, for workflow stage sessions, and in `--print` and JSON modes, it is cancelled when you send the next message or quit, and its failures are silent. Set `sessionSummary.enabled` to `false` to turn it off entirely.
67
+
60
68
  The picker opens instantly: its header, search field, and loading indicator paint on the first frame, then sessions are discovered and parsed off the terminal's UI loop. Large session directories are scanned in cooperative batches and a single very large transcript is parsed in yielding chunks, so search, navigation, and cancel stay responsive and no individual session can freeze the picker while it loads. Closing the picker cancels any in-flight scan and discards stale results, so a slow load that finishes after you leave never updates the list.
61
69
 
62
70
  ### Internal (workflow) sessions
package/docs/settings.md CHANGED
@@ -196,6 +196,12 @@ The model emits numbered line ranges only; Atomic reconstructs retained text mec
196
196
  | `branchSummary.reserveTokens` | number | `16384` | Tokens reserved for branch summarization |
197
197
  | `branchSummary.skipPrompt` | boolean | `false` | Skip "Summarize branch?" prompt on `/tree` navigation (defaults to no summary) |
198
198
 
199
+ ### Session Summary
200
+
201
+ | Setting | Type | Default | Description |
202
+ |---------|------|---------|-------------|
203
+ | `sessionSummary.enabled` | boolean | `true` | Generate a one-line summary of each session for the `/resume` picker once the agent goes idle |
204
+
199
205
  ### Retry
200
206
 
201
207
  | Setting | Type | Default | Description |