@bastani/atomic 0.9.3-alpha.3 → 0.9.3-alpha.5

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 (332) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/builtin/cursor/CHANGELOG.md +19 -0
  3. package/dist/builtin/cursor/README.md +2 -1
  4. package/dist/builtin/cursor/package.json +4 -3
  5. package/dist/builtin/cursor/src/auth.ts +1 -1
  6. package/dist/builtin/cursor/src/config.ts +1 -1
  7. package/dist/builtin/cursor/src/cursor-models-raw.json +82 -246
  8. package/dist/builtin/cursor/src/model-mapper.ts +97 -12
  9. package/dist/builtin/cursor/src/model-reference.ts +282 -0
  10. package/dist/builtin/cursor/src/proto/README.md +2 -2
  11. package/dist/builtin/cursor/src/proto/protobuf-codec-request.ts +1 -1
  12. package/dist/builtin/cursor/src/provider.ts +1 -1
  13. package/dist/builtin/cursor/src/stream.ts +1 -1
  14. package/dist/builtin/cursor/src/transport-types.ts +1 -1
  15. package/dist/builtin/intercom/CHANGELOG.md +12 -0
  16. package/dist/builtin/intercom/package.json +2 -2
  17. package/dist/builtin/mcp/CHANGELOG.md +12 -0
  18. package/dist/builtin/mcp/package.json +3 -3
  19. package/dist/builtin/mcp/sampling-handler.ts +1 -1
  20. package/dist/builtin/mcp/types.ts +1 -1
  21. package/dist/builtin/subagents/CHANGELOG.md +12 -0
  22. package/dist/builtin/subagents/package.json +4 -4
  23. package/dist/builtin/subagents/src/runs/background/subagent-runner-streaming.ts +1 -1
  24. package/dist/builtin/subagents/src/runs/background/subagent-runner-types.ts +1 -1
  25. package/dist/builtin/subagents/src/runs/foreground/execution-attempt.ts +1 -1
  26. package/dist/builtin/subagents/src/runs/shared/structured-output.ts +1 -1
  27. package/dist/builtin/subagents/src/shared/types-results.ts +1 -1
  28. package/dist/builtin/subagents/src/shared/utils.ts +1 -1
  29. package/dist/builtin/subagents/src/slash/slash-live-state.ts +1 -1
  30. package/dist/builtin/web-access/CHANGELOG.md +12 -0
  31. package/dist/builtin/web-access/package.json +2 -2
  32. package/dist/builtin/web-access/summary-review.ts +1 -1
  33. package/dist/builtin/web-access/web-search-summary.ts +1 -1
  34. package/dist/builtin/web-access/web-search-tool.ts +1 -1
  35. package/dist/builtin/workflows/CHANGELOG.md +12 -0
  36. package/dist/builtin/workflows/README.md +2 -0
  37. package/dist/builtin/workflows/package.json +2 -2
  38. package/dist/builtin/workflows/src/extension/workflow-prompts.ts +6 -3
  39. package/dist/bun/register-bedrock.d.ts.map +1 -1
  40. package/dist/bun/register-bedrock.js +1 -1
  41. package/dist/bun/register-bedrock.js.map +1 -1
  42. package/dist/cli/file-processor.d.ts +1 -1
  43. package/dist/cli/file-processor.d.ts.map +1 -1
  44. package/dist/cli/file-processor.js.map +1 -1
  45. package/dist/cli/initial-message.d.ts +1 -1
  46. package/dist/cli/initial-message.d.ts.map +1 -1
  47. package/dist/cli/initial-message.js.map +1 -1
  48. package/dist/cli/list-models.d.ts.map +1 -1
  49. package/dist/cli/list-models.js.map +1 -1
  50. package/dist/core/agent-session-auto-compaction.d.ts +1 -1
  51. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  52. package/dist/core/agent-session-auto-compaction.js +1 -1
  53. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  54. package/dist/core/agent-session-events.d.ts +1 -1
  55. package/dist/core/agent-session-events.d.ts.map +1 -1
  56. package/dist/core/agent-session-events.js +1 -1
  57. package/dist/core/agent-session-events.js.map +1 -1
  58. package/dist/core/agent-session-export.d.ts.map +1 -1
  59. package/dist/core/agent-session-export.js.map +1 -1
  60. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  61. package/dist/core/agent-session-extension-bindings.js +1 -1
  62. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  63. package/dist/core/agent-session-message-queue.d.ts +1 -1
  64. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  65. package/dist/core/agent-session-message-queue.js.map +1 -1
  66. package/dist/core/agent-session-methods.d.ts +1 -1
  67. package/dist/core/agent-session-methods.d.ts.map +1 -1
  68. package/dist/core/agent-session-methods.js.map +1 -1
  69. package/dist/core/agent-session-models.d.ts +1 -1
  70. package/dist/core/agent-session-models.d.ts.map +1 -1
  71. package/dist/core/agent-session-models.js +1 -1
  72. package/dist/core/agent-session-models.js.map +1 -1
  73. package/dist/core/agent-session-prompt.d.ts +1 -1
  74. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  75. package/dist/core/agent-session-prompt.js.map +1 -1
  76. package/dist/core/agent-session-retry.d.ts +1 -1
  77. package/dist/core/agent-session-retry.d.ts.map +1 -1
  78. package/dist/core/agent-session-retry.js +1 -1
  79. package/dist/core/agent-session-retry.js.map +1 -1
  80. package/dist/core/agent-session-services.d.ts +1 -1
  81. package/dist/core/agent-session-services.d.ts.map +1 -1
  82. package/dist/core/agent-session-services.js.map +1 -1
  83. package/dist/core/agent-session-state.d.ts +1 -1
  84. package/dist/core/agent-session-state.d.ts.map +1 -1
  85. package/dist/core/agent-session-state.js.map +1 -1
  86. package/dist/core/agent-session-types.d.ts +1 -1
  87. package/dist/core/agent-session-types.d.ts.map +1 -1
  88. package/dist/core/agent-session-types.js.map +1 -1
  89. package/dist/core/agent-session.d.ts +1 -1
  90. package/dist/core/agent-session.d.ts.map +1 -1
  91. package/dist/core/agent-session.js.map +1 -1
  92. package/dist/core/anthropic-thinking-guard.d.ts +1 -1
  93. package/dist/core/anthropic-thinking-guard.d.ts.map +1 -1
  94. package/dist/core/anthropic-thinking-guard.js.map +1 -1
  95. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  96. package/dist/core/atomic-guide-command.js +15 -11
  97. package/dist/core/atomic-guide-command.js.map +1 -1
  98. package/dist/core/auth-storage.d.ts +2 -2
  99. package/dist/core/auth-storage.d.ts.map +1 -1
  100. package/dist/core/auth-storage.js +1 -1
  101. package/dist/core/auth-storage.js.map +1 -1
  102. package/dist/core/codex-fast-mode.d.ts +1 -1
  103. package/dist/core/codex-fast-mode.d.ts.map +1 -1
  104. package/dist/core/codex-fast-mode.js +1 -1
  105. package/dist/core/codex-fast-mode.js.map +1 -1
  106. package/dist/core/compaction/branch-summarization.d.ts +1 -1
  107. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  108. package/dist/core/compaction/branch-summarization.js +1 -1
  109. package/dist/core/compaction/branch-summarization.js.map +1 -1
  110. package/dist/core/compaction/compaction.d.ts +1 -1
  111. package/dist/core/compaction/compaction.d.ts.map +1 -1
  112. package/dist/core/compaction/compaction.js.map +1 -1
  113. package/dist/core/compaction/context-compaction-runner.d.ts +1 -1
  114. package/dist/core/compaction/context-compaction-runner.d.ts.map +1 -1
  115. package/dist/core/compaction/context-compaction-runner.js +1 -1
  116. package/dist/core/compaction/context-compaction-runner.js.map +1 -1
  117. package/dist/core/compaction/context-deletion-tool-definitions.d.ts.map +1 -1
  118. package/dist/core/compaction/context-deletion-tool-definitions.js +1 -1
  119. package/dist/core/compaction/context-deletion-tool-definitions.js.map +1 -1
  120. package/dist/core/compaction/context-transcript-analysis.d.ts.map +1 -1
  121. package/dist/core/compaction/context-transcript-analysis.js.map +1 -1
  122. package/dist/core/compaction/utils.d.ts +1 -1
  123. package/dist/core/compaction/utils.d.ts.map +1 -1
  124. package/dist/core/compaction/utils.js.map +1 -1
  125. package/dist/core/context-window.d.ts +2 -2
  126. package/dist/core/context-window.d.ts.map +1 -1
  127. package/dist/core/context-window.js.map +1 -1
  128. package/dist/core/copilot-gemini-payload-sanitizer.d.ts +1 -1
  129. package/dist/core/copilot-gemini-payload-sanitizer.d.ts.map +1 -1
  130. package/dist/core/copilot-gemini-payload-sanitizer.js.map +1 -1
  131. package/dist/core/copilot-gemini-reasoning.d.ts +1 -1
  132. package/dist/core/copilot-gemini-reasoning.d.ts.map +1 -1
  133. package/dist/core/copilot-gemini-reasoning.js.map +1 -1
  134. package/dist/core/copilot-gemini-tool-arguments.d.ts +1 -1
  135. package/dist/core/copilot-gemini-tool-arguments.d.ts.map +1 -1
  136. package/dist/core/copilot-gemini-tool-arguments.js.map +1 -1
  137. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  138. package/dist/core/export-html/tool-renderer.js.map +1 -1
  139. package/dist/core/extensions/agent-events.d.ts +1 -1
  140. package/dist/core/extensions/agent-events.d.ts.map +1 -1
  141. package/dist/core/extensions/agent-events.js.map +1 -1
  142. package/dist/core/extensions/api-types.d.ts +1 -1
  143. package/dist/core/extensions/api-types.d.ts.map +1 -1
  144. package/dist/core/extensions/api-types.js.map +1 -1
  145. package/dist/core/extensions/context-types.d.ts +1 -1
  146. package/dist/core/extensions/context-types.d.ts.map +1 -1
  147. package/dist/core/extensions/context-types.js.map +1 -1
  148. package/dist/core/extensions/event-results.d.ts +1 -1
  149. package/dist/core/extensions/event-results.d.ts.map +1 -1
  150. package/dist/core/extensions/event-results.js.map +1 -1
  151. package/dist/core/extensions/loader-virtual-modules.d.ts +12 -0
  152. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  153. package/dist/core/extensions/loader-virtual-modules.js +18 -2
  154. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  155. package/dist/core/extensions/provider-types.d.ts +1 -1
  156. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  157. package/dist/core/extensions/provider-types.js.map +1 -1
  158. package/dist/core/extensions/runner-context.d.ts +1 -1
  159. package/dist/core/extensions/runner-context.d.ts.map +1 -1
  160. package/dist/core/extensions/runner-context.js.map +1 -1
  161. package/dist/core/extensions/runner-events.d.ts +1 -1
  162. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  163. package/dist/core/extensions/runner-events.js.map +1 -1
  164. package/dist/core/extensions/runner.d.ts +1 -1
  165. package/dist/core/extensions/runner.d.ts.map +1 -1
  166. package/dist/core/extensions/runner.js.map +1 -1
  167. package/dist/core/extensions/runtime-types.d.ts +1 -1
  168. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  169. package/dist/core/extensions/runtime-types.js.map +1 -1
  170. package/dist/core/extensions/tool-events.d.ts +1 -1
  171. package/dist/core/extensions/tool-events.d.ts.map +1 -1
  172. package/dist/core/extensions/tool-events.js.map +1 -1
  173. package/dist/core/footer-data-provider.d.ts +5 -0
  174. package/dist/core/footer-data-provider.d.ts.map +1 -1
  175. package/dist/core/footer-data-provider.js +46 -12
  176. package/dist/core/footer-data-provider.js.map +1 -1
  177. package/dist/core/http-dispatcher.d.ts +3 -1
  178. package/dist/core/http-dispatcher.d.ts.map +1 -1
  179. package/dist/core/http-dispatcher.js +4 -1
  180. package/dist/core/http-dispatcher.js.map +1 -1
  181. package/dist/core/keybindings.d.ts +1 -1
  182. package/dist/core/messages.d.ts +1 -1
  183. package/dist/core/messages.d.ts.map +1 -1
  184. package/dist/core/messages.js.map +1 -1
  185. package/dist/core/model-registry-auth.d.ts +1 -1
  186. package/dist/core/model-registry-auth.d.ts.map +1 -1
  187. package/dist/core/model-registry-auth.js.map +1 -1
  188. package/dist/core/model-registry-builtins.d.ts +1 -1
  189. package/dist/core/model-registry-builtins.d.ts.map +1 -1
  190. package/dist/core/model-registry-builtins.js +1 -1
  191. package/dist/core/model-registry-builtins.js.map +1 -1
  192. package/dist/core/model-registry-custom-loader.d.ts.map +1 -1
  193. package/dist/core/model-registry-custom-loader.js +1 -1
  194. package/dist/core/model-registry-custom-loader.js.map +1 -1
  195. package/dist/core/model-registry-dynamic.d.ts +1 -1
  196. package/dist/core/model-registry-dynamic.d.ts.map +1 -1
  197. package/dist/core/model-registry-dynamic.js +1 -1
  198. package/dist/core/model-registry-dynamic.js.map +1 -1
  199. package/dist/core/model-registry-loader.d.ts.map +1 -1
  200. package/dist/core/model-registry-loader.js.map +1 -1
  201. package/dist/core/model-registry-types.d.ts +1 -1
  202. package/dist/core/model-registry-types.d.ts.map +1 -1
  203. package/dist/core/model-registry-types.js.map +1 -1
  204. package/dist/core/model-registry.d.ts +1 -1
  205. package/dist/core/model-registry.d.ts.map +1 -1
  206. package/dist/core/model-registry.js +1 -1
  207. package/dist/core/model-registry.js.map +1 -1
  208. package/dist/core/model-resolver-cli.d.ts.map +1 -1
  209. package/dist/core/model-resolver-cli.js.map +1 -1
  210. package/dist/core/model-resolver-defaults.d.ts +1 -1
  211. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  212. package/dist/core/model-resolver-defaults.js.map +1 -1
  213. package/dist/core/model-resolver-initial.d.ts +1 -1
  214. package/dist/core/model-resolver-initial.d.ts.map +1 -1
  215. package/dist/core/model-resolver-initial.js.map +1 -1
  216. package/dist/core/model-resolver-patterns.d.ts +1 -1
  217. package/dist/core/model-resolver-patterns.d.ts.map +1 -1
  218. package/dist/core/model-resolver-patterns.js.map +1 -1
  219. package/dist/core/model-resolver-scope.d.ts.map +1 -1
  220. package/dist/core/model-resolver-scope.js +1 -1
  221. package/dist/core/model-resolver-scope.js.map +1 -1
  222. package/dist/core/model-resolver-types.d.ts +1 -1
  223. package/dist/core/model-resolver-types.d.ts.map +1 -1
  224. package/dist/core/model-resolver-types.js.map +1 -1
  225. package/dist/core/provider-attribution.d.ts +2 -2
  226. package/dist/core/provider-attribution.d.ts.map +1 -1
  227. package/dist/core/provider-attribution.js +4 -0
  228. package/dist/core/provider-attribution.js.map +1 -1
  229. package/dist/core/sdk-types.d.ts +1 -1
  230. package/dist/core/sdk-types.d.ts.map +1 -1
  231. package/dist/core/sdk-types.js.map +1 -1
  232. package/dist/core/sdk.d.ts +1 -1
  233. package/dist/core/sdk.d.ts.map +1 -1
  234. package/dist/core/sdk.js +2 -2
  235. package/dist/core/sdk.js.map +1 -1
  236. package/dist/core/session-manager-core.d.ts +1 -1
  237. package/dist/core/session-manager-core.d.ts.map +1 -1
  238. package/dist/core/session-manager-core.js.map +1 -1
  239. package/dist/core/session-manager-entries.d.ts +1 -1
  240. package/dist/core/session-manager-entries.d.ts.map +1 -1
  241. package/dist/core/session-manager-entries.js.map +1 -1
  242. package/dist/core/session-manager-list.d.ts.map +1 -1
  243. package/dist/core/session-manager-list.js.map +1 -1
  244. package/dist/core/session-manager-types.d.ts +1 -1
  245. package/dist/core/session-manager-types.d.ts.map +1 -1
  246. package/dist/core/session-manager-types.js.map +1 -1
  247. package/dist/core/settings-types.d.ts +1 -1
  248. package/dist/core/settings-types.d.ts.map +1 -1
  249. package/dist/core/settings-types.js.map +1 -1
  250. package/dist/core/tools/oversized-tool-result.d.ts +1 -1
  251. package/dist/core/tools/oversized-tool-result.d.ts.map +1 -1
  252. package/dist/core/tools/oversized-tool-result.js.map +1 -1
  253. package/dist/core/tools/read-url.d.ts +1 -1
  254. package/dist/core/tools/read-url.d.ts.map +1 -1
  255. package/dist/core/tools/read-url.js.map +1 -1
  256. package/dist/core/tools/read.d.ts.map +1 -1
  257. package/dist/core/tools/read.js.map +1 -1
  258. package/dist/core/tools/render-utils.d.ts +1 -1
  259. package/dist/core/tools/render-utils.d.ts.map +1 -1
  260. package/dist/core/tools/render-utils.js.map +1 -1
  261. package/dist/core/tools/todos-types.d.ts.map +1 -1
  262. package/dist/core/tools/todos-types.js +1 -1
  263. package/dist/core/tools/todos-types.js.map +1 -1
  264. package/dist/main-app-mode.d.ts +1 -1
  265. package/dist/main-app-mode.d.ts.map +1 -1
  266. package/dist/main-app-mode.js.map +1 -1
  267. package/dist/main-session-options.d.ts.map +1 -1
  268. package/dist/main-session-options.js +1 -1
  269. package/dist/main-session-options.js.map +1 -1
  270. package/dist/modes/interactive/components/assistant-message.d.ts +1 -1
  271. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  272. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  273. package/dist/modes/interactive/components/chat-message-renderer.d.ts +1 -1
  274. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  275. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  276. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  277. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  278. package/dist/modes/interactive/components/model-selector.d.ts +1 -1
  279. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  280. package/dist/modes/interactive/components/model-selector.js +1 -1
  281. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  282. package/dist/modes/interactive/components/scoped-models-selector.d.ts +1 -1
  283. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  284. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  285. package/dist/modes/interactive/components/settings-selector-handlers.d.ts.map +1 -1
  286. package/dist/modes/interactive/components/settings-selector-handlers.js +2 -2
  287. package/dist/modes/interactive/components/settings-selector-handlers.js.map +1 -1
  288. package/dist/modes/interactive/components/settings-selector-types.d.ts +1 -1
  289. package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
  290. package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
  291. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  292. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  293. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  294. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  295. package/dist/modes/print-mode.d.ts +1 -1
  296. package/dist/modes/print-mode.d.ts.map +1 -1
  297. package/dist/modes/print-mode.js.map +1 -1
  298. package/dist/modes/rpc/rpc-client.d.ts +1 -1
  299. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  300. package/dist/modes/rpc/rpc-client.js.map +1 -1
  301. package/dist/modes/rpc/rpc-types.d.ts +1 -1
  302. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  303. package/dist/modes/rpc/rpc-types.js.map +1 -1
  304. package/docs/changelog.mdx +15 -0
  305. package/docs/custom-provider.md +2 -1
  306. package/docs/models.md +2 -0
  307. package/docs/providers.md +3 -1
  308. package/docs/quickstart.md +6 -4
  309. package/docs/sdk.md +2 -2
  310. package/docs/settings.md +4 -4
  311. package/docs/workflows.md +11 -6
  312. package/examples/extensions/custom-footer.ts +1 -1
  313. package/examples/extensions/custom-provider-anthropic/index.ts +1 -1
  314. package/examples/extensions/custom-provider-gitlab-duo/index.ts +1 -1
  315. package/examples/extensions/custom-provider-gitlab-duo/test.ts +1 -1
  316. package/examples/extensions/handoff.ts +1 -1
  317. package/examples/extensions/hello.ts +1 -1
  318. package/examples/extensions/plan-mode/index.ts +1 -1
  319. package/examples/extensions/preset.ts +1 -1
  320. package/examples/extensions/qna.ts +1 -1
  321. package/examples/extensions/subagent/display.ts +1 -1
  322. package/examples/extensions/subagent/runner.ts +1 -1
  323. package/examples/extensions/subagent/schemas.ts +1 -1
  324. package/examples/extensions/subagent/types.ts +1 -1
  325. package/examples/extensions/summarize.ts +1 -1
  326. package/examples/extensions/tic-tac-toe.ts +1 -1
  327. package/examples/extensions/todo.ts +1 -1
  328. package/examples/extensions/tool-override.ts +1 -1
  329. package/examples/sdk/02-custom-model.ts +1 -1
  330. package/examples/sdk/12-full-control.ts +1 -1
  331. package/examples/sdk/README.md +1 -1
  332. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-types.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAM5D,MAAM,MAAM,UAAU,GAEnB;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC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AC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,GACD;IACA,IAAI,EAAE,sBAAsB,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAClC,eAAe,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC;CAC/C,GACD;IAAE,IAAI,EAAE,sBAAsB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/E;IAAE,IAAI,EAAE,sBAAsB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAMzF,0CAA0C;AAC1C,MAAM,MAAM,sBAAsB,GAC/B;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GACjE;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC;AAMlE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * RPC protocol types for headless operation.\n *\n * Commands are sent as JSON lines on stdin.\n * Responses and events are emitted as JSON lines on stdout.\n */\n\nimport type { AgentMessage, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { Api, ImageContent, Model } from \"@earendil-works/pi-ai\";\nimport type { AgentSessionEvent, SessionStats } from \"../../core/agent-session.ts\";\nimport type { BashResult } from \"../../core/bash-executor.ts\";\nimport type { ContextCompactionResult } from \"../../core/compaction/index.ts\";\nimport type { SourceInfo } from \"../../core/source-info.ts\";\n\n// ============================================================================\n// RPC Commands (stdin)\n// ============================================================================\n\nexport type RpcCommand =\n\t// Prompting\n\t| { id?: string; type: \"prompt\"; message: string; images?: ImageContent[]; streamingBehavior?: \"steer\" | \"followUp\" }\n\t| { id?: string; type: \"steer\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"follow_up\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"abort\" }\n\t| { id?: string; type: \"new_session\"; parentSession?: string }\n\n\t// State\n\t| { id?: string; type: \"get_state\" }\n\n\t// Model\n\t| { id?: string; type: \"set_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"cycle_model\" }\n\t| { id?: string; type: \"get_available_models\" }\n\n\t// Thinking\n\t| { id?: string; type: \"set_thinking_level\"; level: ThinkingLevel }\n\t| { id?: string; type: \"cycle_thinking_level\" }\n\n\t// Context Window\n\t| { id?: string; type: \"set_context_window\"; contextWindow: number | string }\n\t| { id?: string; type: \"get_available_context_windows\" }\n\n\t// Queue modes\n\t| { id?: string; type: \"set_steering_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\t| { id?: string; type: \"set_follow_up_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\n\t// Compaction\n\t| { id?: string; type: \"compact\" }\n\t| { id?: string; type: \"context_compact\" }\n\t| { id?: string; type: \"set_auto_compaction\"; enabled: boolean }\n\n\t// Retry\n\t| { id?: string; type: \"set_auto_retry\"; enabled: boolean }\n\t| { id?: string; type: \"abort_retry\" }\n\n\t// Bash\n\t| { id?: string; type: \"bash\"; command: string; excludeFromContext?: boolean }\n\t| { id?: string; type: \"abort_bash\" }\n\n\t// Session\n\t| { id?: string; type: \"get_session_stats\" }\n\t| { id?: string; type: \"export_html\"; outputPath?: string }\n\t| { id?: string; type: \"switch_session\"; sessionPath: string }\n\t| { id?: string; type: \"fork\"; entryId: string }\n\t| { id?: string; type: \"clone\" }\n\t| { id?: string; type: \"get_fork_messages\" }\n\t| { id?: string; type: \"get_last_assistant_text\" }\n\t| { id?: string; type: \"set_session_name\"; name: string }\n\n\t// Messages\n\t| { id?: string; type: \"get_messages\" }\n\n\t// Commands (available for invocation via prompt)\n\t| { id?: string; type: \"get_commands\" };\n\n// ============================================================================\n// RPC Slash Command (for get_commands response)\n// ============================================================================\n\n/** A command available for invocation via prompt */\nexport interface RpcSlashCommand {\n\t/** Command name (without leading slash) */\n\tname: string;\n\t/** Human-readable description */\n\tdescription?: string;\n\t/** What kind of command this is */\n\tsource: \"extension\" | \"prompt\" | \"skill\";\n\t/** Source metadata for the owning resource */\n\tsourceInfo: SourceInfo;\n}\n\n// ============================================================================\n// RPC State\n// ============================================================================\n\nexport interface RpcSessionState {\n\tmodel?: Model<Api>;\n\tthinkingLevel: ThinkingLevel;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\tsessionFile?: string;\n\tsessionId: string;\n\tsessionName?: string;\n\tautoCompactionEnabled: boolean;\n\tmessageCount: number;\n\tpendingMessageCount: number;\n}\n\nexport interface RpcContextWindowInfo {\n\tcontextWindows: number[];\n\tcurrentContextWindow?: number;\n\tsupportsSelection: boolean;\n}\n\n// ============================================================================\n// RPC Responses (stdout)\n// ============================================================================\n\n// Success responses with data\nexport type RpcResponse =\n\t// Prompting (async - events follow)\n\t| { id?: string; type: \"response\"; command: \"prompt\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"steer\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"follow_up\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"new_session\"; success: true; data: { cancelled: boolean } }\n\n\t// State\n\t| { id?: string; type: \"response\"; command: \"get_state\"; success: true; data: RpcSessionState }\n\n\t// Model\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"set_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<Api>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: { model: Model<Api>; thinkingLevel: ThinkingLevel; isScoped: boolean } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: { models: Model<Api>[] };\n\t }\n\n\t// Thinking\n\t| { id?: string; type: \"response\"; command: \"set_thinking_level\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_thinking_level\";\n\t\t\tsuccess: true;\n\t\t\tdata: { level: ThinkingLevel } | null;\n\t }\n\n\t// Context Window\n\t| { id?: string; type: \"response\"; command: \"set_context_window\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_context_windows\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcContextWindowInfo;\n\t }\n\n\t// Queue modes\n\t| { id?: string; type: \"response\"; command: \"set_steering_mode\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"set_follow_up_mode\"; success: true }\n\n\t// Compaction\n\t| { id?: string; type: \"response\"; command: \"compact\"; success: true; data: ContextCompactionResult }\n\t| { id?: string; type: \"response\"; command: \"context_compact\"; success: true; data: ContextCompactionResult }\n\t| { id?: string; type: \"response\"; command: \"set_auto_compaction\"; success: true }\n\n\t// Retry\n\t| { id?: string; type: \"response\"; command: \"set_auto_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_retry\"; success: true }\n\n\t// Bash\n\t| { id?: string; type: \"response\"; command: \"bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"abort_bash\"; success: true }\n\n\t// Session\n\t| { id?: string; type: \"response\"; command: \"get_session_stats\"; success: true; data: SessionStats }\n\t| { id?: string; type: \"response\"; command: \"export_html\"; success: true; data: { path: string } }\n\t| { id?: string; type: \"response\"; command: \"switch_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"fork\"; success: true; data: { text: string; cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"clone\"; success: true; data: { cancelled: boolean } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_fork_messages\";\n\t\t\tsuccess: true;\n\t\t\tdata: { messages: Array<{ entryId: string; text: string }> };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_last_assistant_text\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text: string | null };\n\t }\n\t| { id?: string; type: \"response\"; command: \"set_session_name\"; success: true }\n\n\t// Messages\n\t| { id?: string; type: \"response\"; command: \"get_messages\"; success: true; data: { messages: AgentMessage[] } }\n\n\t// Commands\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_commands\";\n\t\t\tsuccess: true;\n\t\t\tdata: { commands: RpcSlashCommand[] };\n\t }\n\n\t// Error response (any command can fail)\n\t| { id?: string; type: \"response\"; command: string; success: false; error: string };\n\n// ============================================================================\n// RPC Events (stdout)\n// ============================================================================\n\n/** Events streamed by RPC mode as session activity occurs. */\nexport type RpcEvent = AgentSessionEvent;\n\n// ============================================================================\n// Extension UI Events (stdout)\n// ============================================================================\n\n/** Emitted when an extension needs user input */\nexport type RpcExtensionUIRequest =\n\t| { type: \"extension_ui_request\"; id: string; method: \"select\"; title: string; options: string[]; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"confirm\"; title: string; message: string; timeout?: number }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"input\";\n\t\t\ttitle: string;\n\t\t\tplaceholder?: string;\n\t\t\ttimeout?: number;\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"editor\"; title: string; prefill?: string }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"notify\";\n\t\t\tmessage: string;\n\t\t\tnotifyType?: \"info\" | \"warning\" | \"error\";\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setStatus\";\n\t\t\tstatusKey: string;\n\t\t\tstatusText: string | undefined;\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setWidget\";\n\t\t\twidgetKey: string;\n\t\t\twidgetLines: string[] | undefined;\n\t\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\";\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setTitle\"; title: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"set_editor_text\"; text: string };\n\n// ============================================================================\n// Extension UI Commands (stdin)\n// ============================================================================\n\n/** Response to an extension UI request */\nexport type RpcExtensionUIResponse =\n\t| { type: \"extension_ui_response\"; id: string; value: string }\n\t| { type: \"extension_ui_response\"; id: string; confirmed: boolean }\n\t| { type: \"extension_ui_response\"; id: string; cancelled: true };\n\n// ============================================================================\n// Helper type for extracting command types\n// ============================================================================\n\nexport type RpcCommandType = RpcCommand[\"type\"];\n"]}
1
+ {"version":3,"file":"rpc-types.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,Y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S,EAAE,OAAO,CAAA;CAAE,GACjE;IAAE,IAAI,EAAE,uBAAuB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,IAAI,CAAA;CAAE,CAAC;AAMlE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * RPC protocol types for headless operation.\n *\n * Commands are sent as JSON lines on stdin.\n * Responses and events are emitted as JSON lines on stdout.\n */\n\nimport type { AgentMessage, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { Api, ImageContent, Model } from \"@earendil-works/pi-ai/compat\";\nimport type { AgentSessionEvent, SessionStats } from \"../../core/agent-session.ts\";\nimport type { BashResult } from \"../../core/bash-executor.ts\";\nimport type { ContextCompactionResult } from \"../../core/compaction/index.ts\";\nimport type { SourceInfo } from \"../../core/source-info.ts\";\n\n// ============================================================================\n// RPC Commands (stdin)\n// ============================================================================\n\nexport type RpcCommand =\n\t// Prompting\n\t| { id?: string; type: \"prompt\"; message: string; images?: ImageContent[]; streamingBehavior?: \"steer\" | \"followUp\" }\n\t| { id?: string; type: \"steer\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"follow_up\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"abort\" }\n\t| { id?: string; type: \"new_session\"; parentSession?: string }\n\n\t// State\n\t| { id?: string; type: \"get_state\" }\n\n\t// Model\n\t| { id?: string; type: \"set_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"cycle_model\" }\n\t| { id?: string; type: \"get_available_models\" }\n\n\t// Thinking\n\t| { id?: string; type: \"set_thinking_level\"; level: ThinkingLevel }\n\t| { id?: string; type: \"cycle_thinking_level\" }\n\n\t// Context Window\n\t| { id?: string; type: \"set_context_window\"; contextWindow: number | string }\n\t| { id?: string; type: \"get_available_context_windows\" }\n\n\t// Queue modes\n\t| { id?: string; type: \"set_steering_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\t| { id?: string; type: \"set_follow_up_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\n\t// Compaction\n\t| { id?: string; type: \"compact\" }\n\t| { id?: string; type: \"context_compact\" }\n\t| { id?: string; type: \"set_auto_compaction\"; enabled: boolean }\n\n\t// Retry\n\t| { id?: string; type: \"set_auto_retry\"; enabled: boolean }\n\t| { id?: string; type: \"abort_retry\" }\n\n\t// Bash\n\t| { id?: string; type: \"bash\"; command: string; excludeFromContext?: boolean }\n\t| { id?: string; type: \"abort_bash\" }\n\n\t// Session\n\t| { id?: string; type: \"get_session_stats\" }\n\t| { id?: string; type: \"export_html\"; outputPath?: string }\n\t| { id?: string; type: \"switch_session\"; sessionPath: string }\n\t| { id?: string; type: \"fork\"; entryId: string }\n\t| { id?: string; type: \"clone\" }\n\t| { id?: string; type: \"get_fork_messages\" }\n\t| { id?: string; type: \"get_last_assistant_text\" }\n\t| { id?: string; type: \"set_session_name\"; name: string }\n\n\t// Messages\n\t| { id?: string; type: \"get_messages\" }\n\n\t// Commands (available for invocation via prompt)\n\t| { id?: string; type: \"get_commands\" };\n\n// ============================================================================\n// RPC Slash Command (for get_commands response)\n// ============================================================================\n\n/** A command available for invocation via prompt */\nexport interface RpcSlashCommand {\n\t/** Command name (without leading slash) */\n\tname: string;\n\t/** Human-readable description */\n\tdescription?: string;\n\t/** What kind of command this is */\n\tsource: \"extension\" | \"prompt\" | \"skill\";\n\t/** Source metadata for the owning resource */\n\tsourceInfo: SourceInfo;\n}\n\n// ============================================================================\n// RPC State\n// ============================================================================\n\nexport interface RpcSessionState {\n\tmodel?: Model<Api>;\n\tthinkingLevel: ThinkingLevel;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\tsessionFile?: string;\n\tsessionId: string;\n\tsessionName?: string;\n\tautoCompactionEnabled: boolean;\n\tmessageCount: number;\n\tpendingMessageCount: number;\n}\n\nexport interface RpcContextWindowInfo {\n\tcontextWindows: number[];\n\tcurrentContextWindow?: number;\n\tsupportsSelection: boolean;\n}\n\n// ============================================================================\n// RPC Responses (stdout)\n// ============================================================================\n\n// Success responses with data\nexport type RpcResponse =\n\t// Prompting (async - events follow)\n\t| { id?: string; type: \"response\"; command: \"prompt\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"steer\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"follow_up\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"new_session\"; success: true; data: { cancelled: boolean } }\n\n\t// State\n\t| { id?: string; type: \"response\"; command: \"get_state\"; success: true; data: RpcSessionState }\n\n\t// Model\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"set_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<Api>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: { model: Model<Api>; thinkingLevel: ThinkingLevel; isScoped: boolean } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: { models: Model<Api>[] };\n\t }\n\n\t// Thinking\n\t| { id?: string; type: \"response\"; command: \"set_thinking_level\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_thinking_level\";\n\t\t\tsuccess: true;\n\t\t\tdata: { level: ThinkingLevel } | null;\n\t }\n\n\t// Context Window\n\t| { id?: string; type: \"response\"; command: \"set_context_window\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_context_windows\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcContextWindowInfo;\n\t }\n\n\t// Queue modes\n\t| { id?: string; type: \"response\"; command: \"set_steering_mode\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"set_follow_up_mode\"; success: true }\n\n\t// Compaction\n\t| { id?: string; type: \"response\"; command: \"compact\"; success: true; data: ContextCompactionResult }\n\t| { id?: string; type: \"response\"; command: \"context_compact\"; success: true; data: ContextCompactionResult }\n\t| { id?: string; type: \"response\"; command: \"set_auto_compaction\"; success: true }\n\n\t// Retry\n\t| { id?: string; type: \"response\"; command: \"set_auto_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_retry\"; success: true }\n\n\t// Bash\n\t| { id?: string; type: \"response\"; command: \"bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"abort_bash\"; success: true }\n\n\t// Session\n\t| { id?: string; type: \"response\"; command: \"get_session_stats\"; success: true; data: SessionStats }\n\t| { id?: string; type: \"response\"; command: \"export_html\"; success: true; data: { path: string } }\n\t| { id?: string; type: \"response\"; command: \"switch_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"fork\"; success: true; data: { text: string; cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"clone\"; success: true; data: { cancelled: boolean } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_fork_messages\";\n\t\t\tsuccess: true;\n\t\t\tdata: { messages: Array<{ entryId: string; text: string }> };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_last_assistant_text\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text: string | null };\n\t }\n\t| { id?: string; type: \"response\"; command: \"set_session_name\"; success: true }\n\n\t// Messages\n\t| { id?: string; type: \"response\"; command: \"get_messages\"; success: true; data: { messages: AgentMessage[] } }\n\n\t// Commands\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_commands\";\n\t\t\tsuccess: true;\n\t\t\tdata: { commands: RpcSlashCommand[] };\n\t }\n\n\t// Error response (any command can fail)\n\t| { id?: string; type: \"response\"; command: string; success: false; error: string };\n\n// ============================================================================\n// RPC Events (stdout)\n// ============================================================================\n\n/** Events streamed by RPC mode as session activity occurs. */\nexport type RpcEvent = AgentSessionEvent;\n\n// ============================================================================\n// Extension UI Events (stdout)\n// ============================================================================\n\n/** Emitted when an extension needs user input */\nexport type RpcExtensionUIRequest =\n\t| { type: \"extension_ui_request\"; id: string; method: \"select\"; title: string; options: string[]; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"confirm\"; title: string; message: string; timeout?: number }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"input\";\n\t\t\ttitle: string;\n\t\t\tplaceholder?: string;\n\t\t\ttimeout?: number;\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"editor\"; title: string; prefill?: string }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"notify\";\n\t\t\tmessage: string;\n\t\t\tnotifyType?: \"info\" | \"warning\" | \"error\";\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setStatus\";\n\t\t\tstatusKey: string;\n\t\t\tstatusText: string | undefined;\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setWidget\";\n\t\t\twidgetKey: string;\n\t\t\twidgetLines: string[] | undefined;\n\t\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\";\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setTitle\"; title: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"set_editor_text\"; text: string };\n\n// ============================================================================\n// Extension UI Commands (stdin)\n// ============================================================================\n\n/** Response to an extension UI request */\nexport type RpcExtensionUIResponse =\n\t| { type: \"extension_ui_response\"; id: string; value: string }\n\t| { type: \"extension_ui_response\"; id: string; confirmed: boolean }\n\t| { type: \"extension_ui_response\"; id: string; cancelled: true };\n\n// ============================================================================\n// Helper type for extracting command types\n// ============================================================================\n\nexport type RpcCommandType = RpcCommand[\"type\"];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-types.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * RPC protocol types for headless operation.\n *\n * Commands are sent as JSON lines on stdin.\n * Responses and events are emitted as JSON lines on stdout.\n */\n\nimport type { AgentMessage, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { Api, ImageContent, Model } from \"@earendil-works/pi-ai\";\nimport type { AgentSessionEvent, SessionStats } from \"../../core/agent-session.ts\";\nimport type { BashResult } from \"../../core/bash-executor.ts\";\nimport type { ContextCompactionResult } from \"../../core/compaction/index.ts\";\nimport type { SourceInfo } from \"../../core/source-info.ts\";\n\n// ============================================================================\n// RPC Commands (stdin)\n// ============================================================================\n\nexport type RpcCommand =\n\t// Prompting\n\t| { id?: string; type: \"prompt\"; message: string; images?: ImageContent[]; streamingBehavior?: \"steer\" | \"followUp\" }\n\t| { id?: string; type: \"steer\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"follow_up\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"abort\" }\n\t| { id?: string; type: \"new_session\"; parentSession?: string }\n\n\t// State\n\t| { id?: string; type: \"get_state\" }\n\n\t// Model\n\t| { id?: string; type: \"set_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"cycle_model\" }\n\t| { id?: string; type: \"get_available_models\" }\n\n\t// Thinking\n\t| { id?: string; type: \"set_thinking_level\"; level: ThinkingLevel }\n\t| { id?: string; type: \"cycle_thinking_level\" }\n\n\t// Context Window\n\t| { id?: string; type: \"set_context_window\"; contextWindow: number | string }\n\t| { id?: string; type: \"get_available_context_windows\" }\n\n\t// Queue modes\n\t| { id?: string; type: \"set_steering_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\t| { id?: string; type: \"set_follow_up_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\n\t// Compaction\n\t| { id?: string; type: \"compact\" }\n\t| { id?: string; type: \"context_compact\" }\n\t| { id?: string; type: \"set_auto_compaction\"; enabled: boolean }\n\n\t// Retry\n\t| { id?: string; type: \"set_auto_retry\"; enabled: boolean }\n\t| { id?: string; type: \"abort_retry\" }\n\n\t// Bash\n\t| { id?: string; type: \"bash\"; command: string; excludeFromContext?: boolean }\n\t| { id?: string; type: \"abort_bash\" }\n\n\t// Session\n\t| { id?: string; type: \"get_session_stats\" }\n\t| { id?: string; type: \"export_html\"; outputPath?: string }\n\t| { id?: string; type: \"switch_session\"; sessionPath: string }\n\t| { id?: string; type: \"fork\"; entryId: string }\n\t| { id?: string; type: \"clone\" }\n\t| { id?: string; type: \"get_fork_messages\" }\n\t| { id?: string; type: \"get_last_assistant_text\" }\n\t| { id?: string; type: \"set_session_name\"; name: string }\n\n\t// Messages\n\t| { id?: string; type: \"get_messages\" }\n\n\t// Commands (available for invocation via prompt)\n\t| { id?: string; type: \"get_commands\" };\n\n// ============================================================================\n// RPC Slash Command (for get_commands response)\n// ============================================================================\n\n/** A command available for invocation via prompt */\nexport interface RpcSlashCommand {\n\t/** Command name (without leading slash) */\n\tname: string;\n\t/** Human-readable description */\n\tdescription?: string;\n\t/** What kind of command this is */\n\tsource: \"extension\" | \"prompt\" | \"skill\";\n\t/** Source metadata for the owning resource */\n\tsourceInfo: SourceInfo;\n}\n\n// ============================================================================\n// RPC State\n// ============================================================================\n\nexport interface RpcSessionState {\n\tmodel?: Model<Api>;\n\tthinkingLevel: ThinkingLevel;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\tsessionFile?: string;\n\tsessionId: string;\n\tsessionName?: string;\n\tautoCompactionEnabled: boolean;\n\tmessageCount: number;\n\tpendingMessageCount: number;\n}\n\nexport interface RpcContextWindowInfo {\n\tcontextWindows: number[];\n\tcurrentContextWindow?: number;\n\tsupportsSelection: boolean;\n}\n\n// ============================================================================\n// RPC Responses (stdout)\n// ============================================================================\n\n// Success responses with data\nexport type RpcResponse =\n\t// Prompting (async - events follow)\n\t| { id?: string; type: \"response\"; command: \"prompt\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"steer\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"follow_up\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"new_session\"; success: true; data: { cancelled: boolean } }\n\n\t// State\n\t| { id?: string; type: \"response\"; command: \"get_state\"; success: true; data: RpcSessionState }\n\n\t// Model\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"set_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<Api>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: { model: Model<Api>; thinkingLevel: ThinkingLevel; isScoped: boolean } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: { models: Model<Api>[] };\n\t }\n\n\t// Thinking\n\t| { id?: string; type: \"response\"; command: \"set_thinking_level\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_thinking_level\";\n\t\t\tsuccess: true;\n\t\t\tdata: { level: ThinkingLevel } | null;\n\t }\n\n\t// Context Window\n\t| { id?: string; type: \"response\"; command: \"set_context_window\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_context_windows\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcContextWindowInfo;\n\t }\n\n\t// Queue modes\n\t| { id?: string; type: \"response\"; command: \"set_steering_mode\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"set_follow_up_mode\"; success: true }\n\n\t// Compaction\n\t| { id?: string; type: \"response\"; command: \"compact\"; success: true; data: ContextCompactionResult }\n\t| { id?: string; type: \"response\"; command: \"context_compact\"; success: true; data: ContextCompactionResult }\n\t| { id?: string; type: \"response\"; command: \"set_auto_compaction\"; success: true }\n\n\t// Retry\n\t| { id?: string; type: \"response\"; command: \"set_auto_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_retry\"; success: true }\n\n\t// Bash\n\t| { id?: string; type: \"response\"; command: \"bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"abort_bash\"; success: true }\n\n\t// Session\n\t| { id?: string; type: \"response\"; command: \"get_session_stats\"; success: true; data: SessionStats }\n\t| { id?: string; type: \"response\"; command: \"export_html\"; success: true; data: { path: string } }\n\t| { id?: string; type: \"response\"; command: \"switch_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"fork\"; success: true; data: { text: string; cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"clone\"; success: true; data: { cancelled: boolean } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_fork_messages\";\n\t\t\tsuccess: true;\n\t\t\tdata: { messages: Array<{ entryId: string; text: string }> };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_last_assistant_text\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text: string | null };\n\t }\n\t| { id?: string; type: \"response\"; command: \"set_session_name\"; success: true }\n\n\t// Messages\n\t| { id?: string; type: \"response\"; command: \"get_messages\"; success: true; data: { messages: AgentMessage[] } }\n\n\t// Commands\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_commands\";\n\t\t\tsuccess: true;\n\t\t\tdata: { commands: RpcSlashCommand[] };\n\t }\n\n\t// Error response (any command can fail)\n\t| { id?: string; type: \"response\"; command: string; success: false; error: string };\n\n// ============================================================================\n// RPC Events (stdout)\n// ============================================================================\n\n/** Events streamed by RPC mode as session activity occurs. */\nexport type RpcEvent = AgentSessionEvent;\n\n// ============================================================================\n// Extension UI Events (stdout)\n// ============================================================================\n\n/** Emitted when an extension needs user input */\nexport type RpcExtensionUIRequest =\n\t| { type: \"extension_ui_request\"; id: string; method: \"select\"; title: string; options: string[]; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"confirm\"; title: string; message: string; timeout?: number }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"input\";\n\t\t\ttitle: string;\n\t\t\tplaceholder?: string;\n\t\t\ttimeout?: number;\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"editor\"; title: string; prefill?: string }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"notify\";\n\t\t\tmessage: string;\n\t\t\tnotifyType?: \"info\" | \"warning\" | \"error\";\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setStatus\";\n\t\t\tstatusKey: string;\n\t\t\tstatusText: string | undefined;\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setWidget\";\n\t\t\twidgetKey: string;\n\t\t\twidgetLines: string[] | undefined;\n\t\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\";\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setTitle\"; title: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"set_editor_text\"; text: string };\n\n// ============================================================================\n// Extension UI Commands (stdin)\n// ============================================================================\n\n/** Response to an extension UI request */\nexport type RpcExtensionUIResponse =\n\t| { type: \"extension_ui_response\"; id: string; value: string }\n\t| { type: \"extension_ui_response\"; id: string; confirmed: boolean }\n\t| { type: \"extension_ui_response\"; id: string; cancelled: true };\n\n// ============================================================================\n// Helper type for extracting command types\n// ============================================================================\n\nexport type RpcCommandType = RpcCommand[\"type\"];\n"]}
1
+ {"version":3,"file":"rpc-types.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * RPC protocol types for headless operation.\n *\n * Commands are sent as JSON lines on stdin.\n * Responses and events are emitted as JSON lines on stdout.\n */\n\nimport type { AgentMessage, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { Api, ImageContent, Model } from \"@earendil-works/pi-ai/compat\";\nimport type { AgentSessionEvent, SessionStats } from \"../../core/agent-session.ts\";\nimport type { BashResult } from \"../../core/bash-executor.ts\";\nimport type { ContextCompactionResult } from \"../../core/compaction/index.ts\";\nimport type { SourceInfo } from \"../../core/source-info.ts\";\n\n// ============================================================================\n// RPC Commands (stdin)\n// ============================================================================\n\nexport type RpcCommand =\n\t// Prompting\n\t| { id?: string; type: \"prompt\"; message: string; images?: ImageContent[]; streamingBehavior?: \"steer\" | \"followUp\" }\n\t| { id?: string; type: \"steer\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"follow_up\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"abort\" }\n\t| { id?: string; type: \"new_session\"; parentSession?: string }\n\n\t// State\n\t| { id?: string; type: \"get_state\" }\n\n\t// Model\n\t| { id?: string; type: \"set_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"cycle_model\" }\n\t| { id?: string; type: \"get_available_models\" }\n\n\t// Thinking\n\t| { id?: string; type: \"set_thinking_level\"; level: ThinkingLevel }\n\t| { id?: string; type: \"cycle_thinking_level\" }\n\n\t// Context Window\n\t| { id?: string; type: \"set_context_window\"; contextWindow: number | string }\n\t| { id?: string; type: \"get_available_context_windows\" }\n\n\t// Queue modes\n\t| { id?: string; type: \"set_steering_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\t| { id?: string; type: \"set_follow_up_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\n\t// Compaction\n\t| { id?: string; type: \"compact\" }\n\t| { id?: string; type: \"context_compact\" }\n\t| { id?: string; type: \"set_auto_compaction\"; enabled: boolean }\n\n\t// Retry\n\t| { id?: string; type: \"set_auto_retry\"; enabled: boolean }\n\t| { id?: string; type: \"abort_retry\" }\n\n\t// Bash\n\t| { id?: string; type: \"bash\"; command: string; excludeFromContext?: boolean }\n\t| { id?: string; type: \"abort_bash\" }\n\n\t// Session\n\t| { id?: string; type: \"get_session_stats\" }\n\t| { id?: string; type: \"export_html\"; outputPath?: string }\n\t| { id?: string; type: \"switch_session\"; sessionPath: string }\n\t| { id?: string; type: \"fork\"; entryId: string }\n\t| { id?: string; type: \"clone\" }\n\t| { id?: string; type: \"get_fork_messages\" }\n\t| { id?: string; type: \"get_last_assistant_text\" }\n\t| { id?: string; type: \"set_session_name\"; name: string }\n\n\t// Messages\n\t| { id?: string; type: \"get_messages\" }\n\n\t// Commands (available for invocation via prompt)\n\t| { id?: string; type: \"get_commands\" };\n\n// ============================================================================\n// RPC Slash Command (for get_commands response)\n// ============================================================================\n\n/** A command available for invocation via prompt */\nexport interface RpcSlashCommand {\n\t/** Command name (without leading slash) */\n\tname: string;\n\t/** Human-readable description */\n\tdescription?: string;\n\t/** What kind of command this is */\n\tsource: \"extension\" | \"prompt\" | \"skill\";\n\t/** Source metadata for the owning resource */\n\tsourceInfo: SourceInfo;\n}\n\n// ============================================================================\n// RPC State\n// ============================================================================\n\nexport interface RpcSessionState {\n\tmodel?: Model<Api>;\n\tthinkingLevel: ThinkingLevel;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\tsessionFile?: string;\n\tsessionId: string;\n\tsessionName?: string;\n\tautoCompactionEnabled: boolean;\n\tmessageCount: number;\n\tpendingMessageCount: number;\n}\n\nexport interface RpcContextWindowInfo {\n\tcontextWindows: number[];\n\tcurrentContextWindow?: number;\n\tsupportsSelection: boolean;\n}\n\n// ============================================================================\n// RPC Responses (stdout)\n// ============================================================================\n\n// Success responses with data\nexport type RpcResponse =\n\t// Prompting (async - events follow)\n\t| { id?: string; type: \"response\"; command: \"prompt\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"steer\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"follow_up\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"new_session\"; success: true; data: { cancelled: boolean } }\n\n\t// State\n\t| { id?: string; type: \"response\"; command: \"get_state\"; success: true; data: RpcSessionState }\n\n\t// Model\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"set_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<Api>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: { model: Model<Api>; thinkingLevel: ThinkingLevel; isScoped: boolean } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: { models: Model<Api>[] };\n\t }\n\n\t// Thinking\n\t| { id?: string; type: \"response\"; command: \"set_thinking_level\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_thinking_level\";\n\t\t\tsuccess: true;\n\t\t\tdata: { level: ThinkingLevel } | null;\n\t }\n\n\t// Context Window\n\t| { id?: string; type: \"response\"; command: \"set_context_window\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_context_windows\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcContextWindowInfo;\n\t }\n\n\t// Queue modes\n\t| { id?: string; type: \"response\"; command: \"set_steering_mode\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"set_follow_up_mode\"; success: true }\n\n\t// Compaction\n\t| { id?: string; type: \"response\"; command: \"compact\"; success: true; data: ContextCompactionResult }\n\t| { id?: string; type: \"response\"; command: \"context_compact\"; success: true; data: ContextCompactionResult }\n\t| { id?: string; type: \"response\"; command: \"set_auto_compaction\"; success: true }\n\n\t// Retry\n\t| { id?: string; type: \"response\"; command: \"set_auto_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_retry\"; success: true }\n\n\t// Bash\n\t| { id?: string; type: \"response\"; command: \"bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"abort_bash\"; success: true }\n\n\t// Session\n\t| { id?: string; type: \"response\"; command: \"get_session_stats\"; success: true; data: SessionStats }\n\t| { id?: string; type: \"response\"; command: \"export_html\"; success: true; data: { path: string } }\n\t| { id?: string; type: \"response\"; command: \"switch_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"fork\"; success: true; data: { text: string; cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"clone\"; success: true; data: { cancelled: boolean } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_fork_messages\";\n\t\t\tsuccess: true;\n\t\t\tdata: { messages: Array<{ entryId: string; text: string }> };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_last_assistant_text\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text: string | null };\n\t }\n\t| { id?: string; type: \"response\"; command: \"set_session_name\"; success: true }\n\n\t// Messages\n\t| { id?: string; type: \"response\"; command: \"get_messages\"; success: true; data: { messages: AgentMessage[] } }\n\n\t// Commands\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_commands\";\n\t\t\tsuccess: true;\n\t\t\tdata: { commands: RpcSlashCommand[] };\n\t }\n\n\t// Error response (any command can fail)\n\t| { id?: string; type: \"response\"; command: string; success: false; error: string };\n\n// ============================================================================\n// RPC Events (stdout)\n// ============================================================================\n\n/** Events streamed by RPC mode as session activity occurs. */\nexport type RpcEvent = AgentSessionEvent;\n\n// ============================================================================\n// Extension UI Events (stdout)\n// ============================================================================\n\n/** Emitted when an extension needs user input */\nexport type RpcExtensionUIRequest =\n\t| { type: \"extension_ui_request\"; id: string; method: \"select\"; title: string; options: string[]; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"confirm\"; title: string; message: string; timeout?: number }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"input\";\n\t\t\ttitle: string;\n\t\t\tplaceholder?: string;\n\t\t\ttimeout?: number;\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"editor\"; title: string; prefill?: string }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"notify\";\n\t\t\tmessage: string;\n\t\t\tnotifyType?: \"info\" | \"warning\" | \"error\";\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setStatus\";\n\t\t\tstatusKey: string;\n\t\t\tstatusText: string | undefined;\n\t }\n\t| {\n\t\t\ttype: \"extension_ui_request\";\n\t\t\tid: string;\n\t\t\tmethod: \"setWidget\";\n\t\t\twidgetKey: string;\n\t\t\twidgetLines: string[] | undefined;\n\t\t\twidgetPlacement?: \"aboveEditor\" | \"belowEditor\";\n\t }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setTitle\"; title: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"set_editor_text\"; text: string };\n\n// ============================================================================\n// Extension UI Commands (stdin)\n// ============================================================================\n\n/** Response to an extension UI request */\nexport type RpcExtensionUIResponse =\n\t| { type: \"extension_ui_response\"; id: string; value: string }\n\t| { type: \"extension_ui_response\"; id: string; confirmed: boolean }\n\t| { type: \"extension_ui_response\"; id: string; cancelled: true };\n\n// ============================================================================\n// Helper type for extracting command types\n// ============================================================================\n\nexport type RpcCommandType = RpcCommand[\"type\"];\n"]}
@@ -3,6 +3,21 @@ title: "Changelog"
3
3
  description: "What's new in Atomic"
4
4
  ---
5
5
 
6
+ <Update label="June 29, 2026">
7
+
8
+ ## Upstream Pi sync
9
+
10
+ - **Synced with upstream Pi 0.80.2.** Atomic's coding-agent fork and bundled extensions are now aligned with upstream Pi through `^0.80.2` for `@earendil-works/pi-ai`, `@earendil-works/pi-agent-core`, and `@earendil-works/pi-tui`. The 0.80.x line is dominated by upstream's "Models runtime migration," which made the `@earendil-works/pi-ai` root entrypoint core-only and moved the legacy global provider/model API (`stream`, `complete`, `registerApiProvider`, `getEnvApiKey`, …) onto a temporary `@earendil-works/pi-ai/compat` entrypoint.
11
+ - **Extensions keep working unchanged.** Atomic's extension loader now aliases the `@earendil-works/pi-ai` root specifiers to the `/compat` entrypoint at runtime, so first-party bundled extensions and user-installed extensions that import from the root continue to resolve transparently — no extension code changes required.
12
+ - **Atomic-first compatibility migration.** Atomic's own runtime, tools, tests, and extension examples were retargeted to the `/compat` entrypoint so they resolve the legacy provider/model API at both type-check and runtime, preserving the public extension and SDK surface Atomic's downstream users depend on.
13
+ - **Toolchain and native dependency refresh.** Bundled `@napi-rs/cli`, `@j178/prek`, `actions/checkout`, and transitive Cargo crates (`rustls`, `napi`, `bytes`, `webpki-roots`) were refreshed to current releases, including the latest Mozilla-aligned webpki trust store.
14
+
15
+ ## Fixes
16
+
17
+ - Inherits upstream 0.80.0–0.80.2 fixes from the external Pi packages (`pi-ai`, `pi-agent-core`, `pi-tui`) that Atomic consumes as dependency bumps. This includes provider-side handling of malformed all-zero usage in OpenAI Responses context/compaction estimates, request-scoped `apiKey`/`env` participation in provider auth resolution, the restored `pi-ai/compat` legacy per-API stream aliases and `detectCompat` fallback, the `ApiKeyCredential` `auth.json`-compatible discriminator, and the renamed `ShellExecOptions` agent-core type.
18
+ - Note that coding-agent forked-source fixes (for example session-name newline normalization and threaded session-tree ordering) are NOT inherited automatically; they require intentional source porting and are tracked separately. Atomic retains its existing compaction guard for all-zero usage, which already aligns with the upstream fix.
19
+
20
+ </Update>
6
21
  <Update label="May 25, 2026" tags={["v0.8.14"]}>
7
22
 
8
23
  ## Stable release
@@ -345,6 +345,8 @@ interface OAuthCredentials {
345
345
 
346
346
  For providers with non-standard APIs, implement `streamSimple`. Study the existing provider implementations before writing your own:
347
347
 
348
+ > **Compatibility note (Pi 0.80.2 sync):** Upstream Pi 0.80.2 made the `@earendil-works/pi-ai` root entrypoint core-only and moved the legacy global provider/model API (`stream`, `complete`, `registerApiProvider`, `getEnvApiKey`, `streamSimple`, and the `Model`/`Api`/`SimpleStreamOptions`/`AssistantMessageEventStream` types shown below) onto the `@earendil-works/pi-ai/compat` entrypoint. Atomic's extension loader aliases the `@earendil-works/pi-ai` root to `/compat` at runtime, so extensions that import these symbols from the root keep working unchanged. For new TypeScript code that needs this legacy surface, prefer importing from `@earendil-works/pi-ai/compat` for accurate type resolution. The `/oauth` subpath is unaffected.
349
+
348
350
  **Reference implementations:**
349
351
 
350
352
  Atomic uses provider implementations from its installed `@earendil-works/pi-ai` dependency. Inspect the compiled declarations and JavaScript under `node_modules/@earendil-works/pi-ai/dist/providers/`, including:
@@ -354,7 +356,6 @@ Atomic uses provider implementations from its installed `@earendil-works/pi-ai`
354
356
  - `openai-responses.d.ts` / `openai-responses.js` - OpenAI Responses API
355
357
  - `google.d.ts` / `google.js` - Google Generative AI
356
358
  - `amazon-bedrock.d.ts` / `amazon-bedrock.js` - AWS Bedrock
357
-
358
359
  ### Stream Pattern
359
360
 
360
361
  All providers follow the same pattern:
package/docs/models.md CHANGED
@@ -4,6 +4,8 @@ Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via `~/.atomi
4
4
 
5
5
  Built-in subscription providers such as Cursor (experimental) are selected with the same `provider/model` syntax, for example `cursor/composer-2`. Cursor image input is scoped to known multimodal Cursor Claude, Composer, Gemini, GPT, and Kimi model families (`claude-`, `composer-`, `gemini-`, `gpt-`, `kimi-`), plus `grok-4.3`; text-only Cursor models still reject images. Cursor image payloads must be non-empty standard base64, with MIME-style line wrapping whitespace accepted and stripped before serialization. Live private-API model metadata may fall back to estimated labels. Because Cursor support targets undocumented private endpoints with Cursor CLI-compatible headers, maintainers and users should explicitly accept the risk that it may conflict with Cursor's terms, break without notice, or affect the Cursor account used to authenticate.
6
6
 
7
+ When Cursor omits token limits, Atomic derives them from its bundled `@earendil-works/pi-ai` model catalog and treats explicit `1M` Cursor labels as a 1,000,000-token context floor; unmatched Cursor-only models keep conservative estimates instead of disappearing from `/model`.
8
+
7
9
  ## Table of Contents
8
10
 
9
11
  - [Minimal Example](#minimal-example)
package/docs/providers.md CHANGED
@@ -46,7 +46,7 @@ Anthropic subscription auth is active for Claude Pro/Max accounts. Third-party h
46
46
 
47
47
  ### Cursor (experimental)
48
48
 
49
- Cursor support is bundled as the first-party `@bastani/cursor` extension and appears in `/login` as **Cursor (experimental)**. It uses Cursor's browser PKCE flow and stores OAuth credentials in `~/.atomic/agent/auth.json`; do not paste Cursor tokens into environment variables, command-line arguments, or custom proxies. Atomic identifies as a Cursor CLI-compatible client against private endpoints; maintainers and users should explicitly accept that this may conflict with Cursor's terms of service, stop working without notice, or affect the Cursor account used to authenticate.
49
+ Cursor support is bundled as the first-party `@bastani/cursor` extension and appears in `/login` as **Cursor (Experimental)**. It uses Cursor's browser PKCE flow and stores OAuth credentials in `~/.atomic/agent/auth.json`; do not paste Cursor tokens into environment variables, command-line arguments, or custom proxies. Atomic identifies as a Cursor CLI-compatible client against private endpoints; maintainers and users should explicitly accept that this may conflict with Cursor's terms of service, stop working without notice, or affect the Cursor account used to authenticate.
50
50
 
51
51
  Current limitations:
52
52
 
@@ -54,6 +54,8 @@ Current limitations:
54
54
  - Image input is supported only for known multimodal Cursor Claude, Composer, Gemini, GPT, and Kimi model families (IDs beginning `claude-`, `composer-`, `gemini-`, `gpt-`, or `kimi-`), plus `grok-4.3`. Text-only Cursor models still reject images with a clear error.
55
55
  - For image-capable Cursor models, Atomic serializes user images and mixed text/image MCP tool results into Cursor's private request format. Image payloads must be non-empty standard base64; MIME-style line wrapping whitespace is accepted and stripped before serialization.
56
56
  - Model metadata is cached token-free in `~/.atomic/agent/cursor-model-catalog.json` and can be used at startup before fresh credentials are available. Estimated labels are used only when no valid cache exists and allowed live `GetUsableModels` discovery failures occur; refresh-time discovery is best-effort so rotated credentials are still persisted.
57
+ - Cursor's private model discovery does not return token-limit metadata. Atomic preserves any positive limits Cursor does send, then resolves a model's context window and max output tokens from its bundled `@earendil-works/pi-ai` model catalog by matching the Cursor model ID's family/version. Explicit `1M` Cursor ids or labels on any fast/thinking sibling for the same family are treated as a 1,000,000-token context floor even when the closest reference match advertises a smaller base window. Cursor-only models with no pi-ai match (for example `composer-*` and `default`/Auto) keep a conservative 200k context / 64k output estimate. This only sets limits; it never changes which Cursor models are listed.
58
+ - Cursor thinking levels are derived from the discovered Cursor variants for each model group. Atomic only exposes `xhigh` when Cursor advertises a true `xhigh` or `max` variant for that group; if an older saved `xhigh` selection is restored for a model that currently only has lower-effort variants, the request falls back to the nearest concrete Cursor variant instead of sending an invalid id.
57
59
  - The implementation avoids a localhost proxy and keeps credentials OAuth-only. Cursor's HTTP/2 transport uses the bundled `@bastani/atomic-natives` Rust/N-API client, so it does not require Node.js on `PATH`. The native client currently opens request-scoped HTTP/2 sessions; pooling may be added in a future release.
58
60
  - Cursor request encoding intentionally omits a `previousWorkspaceUris` current-directory entry by default so local absolute working-directory paths are not sent as workspace context. HTTP/2 Connect request/framing code is isolated, buffered across arbitrary chunks, tested with injected fakes, and uses a minimal production protobuf codec with field-order-independent exec ids, protobuf `Value` plus raw UTF-8/JSON tool arguments, historical tool-result correlation, checkpoint token-details parsing, paused-stream abort/idle cleanup, catalog-aware fast/thinking model grouping, and credential/PKCE-redacted protocol errors.
59
61
 
@@ -82,7 +82,9 @@ See [Providers](/providers) for all supported providers, environment variables,
82
82
 
83
83
  On a fresh install with no prior Atomic startup state, Atomic starts with a first-run workflow prompt. Returning users with prior startup state are marked onboarded automatically and continue directly into the normal chat UI; stored credentials by themselves do not skip onboarding. Paste a ticket description, GitHub issue, path to a spec, or task prompt and Atomic hands it to the normal coding-agent session. The handoff raises the selected model to high reasoning when supported and first asks the parent agent to estimate scope from the seed text alone: tickets, issues, and especially specs often list enough work items, files, tests, docs, migrations, or acceptance criteria to classify likely size without immediately inspecting the repo. That text-only pass is treated as a routing confidence signal, not final planning. If the task is clearly tiny/small and high-confidence, the parent can route directly; if the seed references context that must be read or the scope is medium, large, unclear, or risky, it inspects only the necessary issue/spec/path/repo area and can use targeted read-only subagents such as `codebase-locator`, `codebase-analyzer`, and `codebase-pattern-finder` at their normal defaults. It then chooses `goal` for focused work or `ralph` for broader/riskier work, starts the selected workflow, and continues normally. If you paste the task before logging in or selecting a usable model, Atomic keeps only an in-memory copy, asks you to run `/login`, and resumes with the latest saved task after login or `/model` selection makes the session ready; `/new` starts a fresh unresolved onboarding session and drops that saved in-memory task. If you want normal chat instead, type `/chat` or `/chat <message>`; other slash commands such as `/login`, `/model`, and `/atomic` still work and do not dismiss onboarding.
84
84
 
85
- Once Atomic starts, the fastest way to get value is to kick off a built-in workflow or invoke a skill. Atomic turns repeatable engineering loops into executable stages with inspectable evidence instead of relying on a markdown checklist the model may or may not follow.
85
+ Once Atomic starts, the fastest way to get value is to kick off a built-in workflow or invoke a skill. Workflows are the default path for non-trivial tasks and for requests with inherent structure plus a verifiable objective, including implementation, build, debugging, bug-fix, migration, new-feature, scoped multi-file, or docs/code-change work where validation matters. If a prompt says `do X until Y`, `repeat until`, `iterate until`, `review/fix until passing`, or `run checks and fix until green`, it already describes a workflow-shaped loop with a stop condition.
86
+
87
+ Atomic turns repeatable engineering loops into executable stages with inspectable evidence instead of relying on a markdown checklist the model may or may not follow.
86
88
 
87
89
  For an interactive tour any time, run `/atomic` inside the TUI; `/atomic overview`, `/atomic workflows`, and `/atomic example` walk through the same flow in more depth.
88
90
 
@@ -93,8 +95,8 @@ Atomic ships with four workflows you can run immediately. Use `/workflow list` t
93
95
  | Workflow | When to use | Example |
94
96
  |---|---|---|
95
97
  | `deep-research-codebase` | Broad, cross-cutting research before you decide what to change. Scout → research-history → parallel specialist waves → aggregator. | `/workflow deep-research-codebase prompt="How do payment retries work end to end?"` |
96
- | `goal` | Bounded one-off changes when you already know the work surface, exact outcome, and validation — for example tests, lint/typecheck, docs builds, or observable behavior. Keeps the run focused with a goal ledger, reviewer gates, final status `complete`, `blocked`, or `needs_human`, and optional final-stage PR creation with `create_pr=true` after approval. | `/workflow goal objective="Update the CLI docs for --json, include one example, run the docs build, and finish when the build passes"` |
97
- | `ralph` | Planned or broad implementation work from a spec file, GitHub issue, or crisp ticket description. Ralph researches as needed, delegates implementation through sub-agents, reviews, records a QA proof video for UI/full-stack changes when practical, iterates, and optionally lets only the final stage attempt PR creation with `create_pr=true`. | `/workflow ralph prompt="Implement specs/2026-03-rate-limit.md and validate burst traffic returns 429"` |
98
+ | `goal` | Bounded one-off changes when you already know the work surface, exact outcome, and validation — for example bug fixes, debugging, tests, lint/typecheck, docs builds, observable behavior, scoped multi-file edits, or a review/fix/test loop that should continue until passing. Keeps the run focused with a goal ledger, reviewer gates, final status `complete`, `blocked`, or `needs_human`, and optional final-stage PR creation with `create_pr=true` after approval. | `/workflow goal objective="Update the CLI docs for --json, include one example, run the docs build, and finish when the build passes"` |
99
+ | `ralph` | Planned or broad implementation work from a spec file, GitHub issue, or crisp ticket description, including migrations and new features. Ralph researches as needed, delegates implementation through sub-agents, reviews, records a QA proof video for UI/full-stack changes when practical, iterates until approval or the loop limit, and optionally lets only the final stage attempt PR creation with `create_pr=true`. | `/workflow ralph prompt="Implement specs/2026-03-rate-limit.md and validate burst traffic returns 429"` |
98
100
  | `open-claude-design` | UI and design-system work with separate forked generate and feedback chains; renders a live `preview.html` you can iterate against. | `/workflow open-claude-design prompt="Refresh the settings page hierarchy as a page"` |
99
101
 
100
102
  <p align="center"><img src="images/workflow-list.png" alt="Workflow List" width="600" /></p>
@@ -115,7 +117,7 @@ Atomic picks the workflow, fills in inputs from the request, and confirms before
115
117
 
116
118
  For planned work, make `ralph` the default implementation loop after research or spec creation. Give it a spec file, GitHub issue, or crisp ticket description; it refines the prompt, researches as needed, delegates implementation, reviews, records a QA proof video for UI/full-stack changes when practical, and iterates. Add `create_pr=true` only when you want the final PR handoff after the review gate approves.
117
119
 
118
- For smaller one-off tasks, use `goal` with a concrete task description that names the work surface, desired outcome, and validation. It keeps the run bounded, captures receipts in a goal ledger, gates completion through reviewers, stops as `complete`, `blocked`, or `needs_human`, and can optionally run only the final PR handoff with `create_pr=true` after approval.
120
+ For smaller one-off tasks, use `goal` with a concrete task description that names the work surface, desired outcome, and validation. It is the default for small-to-medium non-trivial changes with verifiable done criteria, especially bug fixes, debugging, scoped multi-file edits, and prompts that say to review/fix, test/fix, or iterate until passing. It keeps the run bounded, captures receipts in a goal ledger, gates completion through reviewers, stops as `complete`, `blocked`, or `needs_human`, and can optionally run only the final PR handoff with `create_pr=true` after approval.
119
121
 
120
122
  ### Monitor and steer a run
121
123
 
package/docs/sdk.md CHANGED
@@ -398,7 +398,7 @@ When you pass a custom `ResourceLoader`, `cwd` and `agentDir` no longer control
398
398
  ### Model
399
399
 
400
400
  ```typescript
401
- import { getModel } from "@earendil-works/pi-ai";
401
+ import { getModel } from "@earendil-works/pi-ai/compat";
402
402
  import { AuthStorage, ModelRegistry } from "@bastani/atomic";
403
403
 
404
404
  const authStorage = AuthStorage.create();
@@ -987,7 +987,7 @@ interface LoadExtensionsResult {
987
987
  ## Complete Example
988
988
 
989
989
  ```typescript
990
- import { getModel } from "@earendil-works/pi-ai";
990
+ import { getModel } from "@earendil-works/pi-ai/compat";
991
991
  import { Type } from "typebox";
992
992
  import {
993
993
  AuthStorage,
package/docs/settings.md CHANGED
@@ -158,9 +158,9 @@ Keep `retry.provider.maxRetries` at `0` unless provider-level retries are explic
158
158
 
159
159
  | Setting | Type | Default | Description |
160
160
  |---------|------|---------|-------------|
161
- | `httpIdleTimeoutMs` | number | `300000` | HTTP header/body idle timeout in milliseconds. Must be a non-negative finite number; decimals are rounded down. Set to `0` to disable the idle timeout. |
161
+ | `httpIdleTimeoutMs` | number | `600000` | HTTP header/body idle timeout in milliseconds. Must be a non-negative finite number; decimals are rounded down. Set to `0` to disable the idle timeout. |
162
162
 
163
- Atomic applies this timeout to the global HTTP dispatcher used by `fetch` and provider SDK HTTP clients. The default is 300,000 ms (5 minutes), which keeps long-running requests working while reclaiming stale idle connections.
163
+ Atomic applies this timeout to the global HTTP dispatcher used by `fetch` and provider SDK HTTP clients. The default is 600,000 ms (10 minutes), which keeps slow long-context requests working while reclaiming stale idle connections. The dispatcher also applies a fixed 10-second connect-phase timeout so an unreachable or firewall-blocked host fails fast instead of hanging until the OS TCP timeout.
164
164
 
165
165
  The `/settings` picker offers these presets:
166
166
 
@@ -175,7 +175,7 @@ The `/settings` picker offers these presets:
175
175
 
176
176
  ```json
177
177
  {
178
- "httpIdleTimeoutMs": 300000
178
+ "httpIdleTimeoutMs": 600000
179
179
  }
180
180
  ```
181
181
 
@@ -186,7 +186,7 @@ The `/settings` picker offers these presets:
186
186
  | `steeringMode` | string | `"one-at-a-time"` | How steering messages are sent: `"all"` or `"one-at-a-time"` |
187
187
  | `followUpMode` | string | `"one-at-a-time"` | How follow-up messages are sent: `"all"` or `"one-at-a-time"` |
188
188
  | `transport` | string | `"auto"` | Preferred transport for providers that support multiple transports: `"sse"`, `"websocket"`, `"websocket-cached"`, or `"auto"` |
189
- | `httpIdleTimeoutMs` | number | `300000` | HTTP header/body idle timeout in milliseconds, also used by providers with explicit stream idle timeouts. Set to `0` to disable. |
189
+ | `httpIdleTimeoutMs` | number | `600000` | HTTP header/body idle timeout in milliseconds, also used by providers with explicit stream idle timeouts. Set to `0` to disable. |
190
190
  | `websocketConnectTimeoutMs` | number | `15000` | WebSocket connect/open handshake timeout in milliseconds for providers that support WebSocket transports. Set to `0` to disable. |
191
191
 
192
192
  ### Terminal & Images
package/docs/workflows.md CHANGED
@@ -4,7 +4,9 @@
4
4
 
5
5
  Workflows are how Atomic runs executable engineering loops: reusable multi-stage automation with tracked stages, parallel branches, artifacts, human input, live status, checkpoints, and resumable background execution.
6
6
 
7
- Use a workflow when a task should be repeatable, inspectable, resumable, or split across multiple model sessions. Markdown prompts can describe a loop; Atomic workflows run the loop with scoped context, tools, artifacts, verification, subagents, review gates, and human approvals. For one-off work, the `workflow` tool can also run a tracked single task, parallel fan-out, or chain without creating a saved workflow file.
7
+ Default to a workflow for any non-trivial task, and for any task with inherent structure plus an objective you can make verifiable. Inherent structure includes implementation, build, debugging, bug-fix, migration, new-feature, scoped multi-file, or docs/code-change work where validation matters, plus multiple subtasks, dependencies, handoffs, review/validation gates, uncertainty, or an outcome that needs evidence. Loop-shaped requests are especially strong workflow signals: phrases such as `do X until Y`, `repeat until`, `iterate until`, `review/fix until passing`, `run checks and fix until green`, or `keep going until done` already describe a control loop plus a stop condition. Markdown prompts can describe a loop; Atomic workflows run the loop with scoped context, tools, artifacts, verification, subagents, review gates, and human approvals. For one-off work, the `workflow` tool can also run a tracked single task, parallel fan-out, or chain without creating a saved workflow file.
8
+
9
+ Use direct chat only for tiny, deterministic, low-risk work where workflow tracking would add more overhead than value, usually a clearly single-file/no-test/no-review edit or a simple answer.
8
10
 
9
11
  **Key capabilities:**
10
12
  - **Tracked stages** - Name each step and inspect it in workflow status and graph views
@@ -18,6 +20,7 @@ Use a workflow when a task should be repeatable, inspectable, resumable, or spli
18
20
  - **Package distribution** - Ship workflows through Atomic packages, settings, or conventional directories
19
21
 
20
22
  **Example use cases:**
23
+ - Any non-trivial task with a clear objective and verifiable done criteria
21
24
  - Small, outcome-driven code or docs changes with explicit done criteria
22
25
  - Codebase research with parallel local and external research stages
23
26
  - Review/fix loops with independent reviewers and a synthesis stage
@@ -399,17 +402,19 @@ Prompt answers are replayable only while the source run remains in the live in-m
399
402
 
400
403
  ## When to Use Workflows
401
404
 
402
- Workflows are a good fit when you need:
405
+ Workflows are the default path when a request is non-trivial, has inherent structure, and has an objective you can verify. Choose a workflow before direct chat when the prompt includes any of these signals:
403
406
 
404
- - named stages that appear in status and graph views
405
- - sequential or parallel work with explicit handoffs
407
+ - implementation, build, debugging/diagnosis, bug-fix, migration, new-feature, scoped multi-file, or docs/code-change work where validation matters
408
+ - multiple subtasks, dependencies, or handoffs
409
+ - sequential or parallel work with explicit context handoffs
410
+ - review, validation, QA, approval, or human-input gates
406
411
  - long-running or resumable background execution
407
- - human approval or missing information during a run
408
412
  - saved artifacts for later inspection
409
413
  - model fallback chains for important stages
410
414
  - reusable automation that can be launched again with different inputs
415
+ - loop or stop-condition phrasing such as `do X until Y`, `repeat until`, `iterate until`, `review/fix until passing`, `run checks and fix until green`, or `keep going until done`
411
416
 
412
- If the task is only deterministic TypeScript with no LLM/session stage, use a script, custom tool, or extension command instead.
417
+ Use direct chat instead only for tiny, deterministic, low-risk edits or answers where stage tracking would add more overhead than value, usually a clearly single-file/no-test/no-review edit. If the task is only deterministic TypeScript with no LLM/session stage, use a script, custom tool, or extension command instead.
413
418
 
414
419
  | User goal | Use |
415
420
  |-----------|-----|
@@ -8,7 +8,7 @@
8
8
  * Token stats come from ctx.sessionManager/ctx.model (already accessible).
9
9
  */
10
10
 
11
- import type { AssistantMessage } from "@earendil-works/pi-ai";
11
+ import type { AssistantMessage } from "@earendil-works/pi-ai/compat";
12
12
  import type { ExtensionAPI } from "@bastani/atomic";
13
13
  import { truncateToWidth, visibleWidth } from "@earendil-works/pi-tui";
14
14
 
@@ -19,7 +19,7 @@ import {
19
19
  type Tool,
20
20
  type ToolCall,
21
21
  type ToolResultMessage,
22
- } from "@earendil-works/pi-ai";
22
+ } from "@earendil-works/pi-ai/compat";
23
23
  import type { ExtensionAPI } from "@bastani/atomic";
24
24
  const decode = (s: string) => atob(s);
25
25
  const CLIENT_ID = decode("OWQxYzI1MGEtZTYxYi00NGQ5LTg4ZWQtNTk0NGQxOTYyZjVl");
@@ -21,7 +21,7 @@ import {
21
21
  streamSimpleAnthropic,
22
22
  streamSimpleOpenAIResponses,
23
23
  type ThinkingLevelMap,
24
- } from "@earendil-works/pi-ai";
24
+ } from "@earendil-works/pi-ai/compat";
25
25
  import type { ExtensionAPI } from "@bastani/atomic";
26
26
 
27
27
  // =============================================================================
@@ -8,7 +8,7 @@
8
8
  * npx tsx test.ts claude-sonnet-4-5-20250929 --thinking
9
9
  */
10
10
 
11
- import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "@earendil-works/pi-ai";
11
+ import { type Api, type Context, type Model, registerApiProvider, streamSimple } from "@earendil-works/pi-ai/compat";
12
12
  import { readFileSync } from "fs";
13
13
  import { getAgentDir } from "packages/coding-agent/src/config.js";
14
14
  import { join } from "path";
@@ -12,7 +12,7 @@
12
12
  * The generated prompt appears as a draft in the editor for review/editing.
13
13
  */
14
14
 
15
- import { complete, type Message } from "@earendil-works/pi-ai";
15
+ import { complete, type Message } from "@earendil-works/pi-ai/compat";
16
16
  import type { ExtensionAPI } from "@bastani/atomic";
17
17
  import { BorderedLoader, buildSessionContext, convertToLlm, serializeConversation } from "@bastani/atomic";
18
18
 
@@ -2,7 +2,7 @@
2
2
  * Hello Tool - Minimal custom tool example
3
3
  */
4
4
 
5
- import { Type } from "@earendil-works/pi-ai";
5
+ import { Type } from "@earendil-works/pi-ai/compat";
6
6
  import { defineTool, type ExtensionAPI } from "@bastani/atomic";
7
7
 
8
8
  const helloTool = defineTool({
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  import type { AgentMessage } from "@earendil-works/pi-agent-core";
16
- import type { AssistantMessage, TextContent } from "@earendil-works/pi-ai";
16
+ import type { AssistantMessage, TextContent } from "@earendil-works/pi-ai/compat";
17
17
  import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
18
18
  import { Key } from "@earendil-works/pi-tui";
19
19
  import { extractTodoItems, isSafeCommand, markCompletedSteps, type TodoItem } from "./utils.ts";
@@ -40,7 +40,7 @@
40
40
 
41
41
  import { existsSync, readFileSync } from "node:fs";
42
42
  import { join } from "node:path";
43
- import type { Api, Model } from "@earendil-works/pi-ai";
43
+ import type { Api, Model } from "@earendil-works/pi-ai/compat";
44
44
  import type { ExtensionAPI, ExtensionContext } from "@bastani/atomic";
45
45
  import { CONFIG_DIR_NAME, DynamicBorder, getAgentDir } from "@bastani/atomic";
46
46
  import { Container, Key, type SelectItem, SelectList, Text } from "@earendil-works/pi-tui";
@@ -7,7 +7,7 @@
7
7
  * 3. Loads the result into the editor for user to fill in answers
8
8
  */
9
9
 
10
- import { complete, type UserMessage } from "@earendil-works/pi-ai";
10
+ import { complete, type UserMessage } from "@earendil-works/pi-ai/compat";
11
11
  import type { ExtensionAPI } from "@bastani/atomic";
12
12
  import { BorderedLoader } from "@bastani/atomic";
13
13
 
@@ -1,5 +1,5 @@
1
1
  import * as os from "node:os";
2
- import type { Message } from "@earendil-works/pi-ai";
2
+ import type { Message } from "@earendil-works/pi-ai/compat";
3
3
 
4
4
  export function formatTokens(count: number): string {
5
5
  if (count < 1000) return count.toString();
@@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
2
2
  import * as fs from "node:fs";
3
3
  import * as os from "node:os";
4
4
  import * as path from "node:path";
5
- import type { Message } from "@earendil-works/pi-ai";
5
+ import type { Message } from "@earendil-works/pi-ai/compat";
6
6
  import { APP_NAME, withFileMutationQueue } from "@bastani/atomic";
7
7
  import type { AgentConfig } from "./agents.ts";
8
8
  import { getFinalOutput } from "./display.js";
@@ -1,4 +1,4 @@
1
- import { StringEnum } from "@earendil-works/pi-ai";
1
+ import { StringEnum } from "@earendil-works/pi-ai/compat";
2
2
  import { Type } from "typebox";
3
3
 
4
4
  const TaskItem = Type.Object({
@@ -1,5 +1,5 @@
1
1
  import type { AgentToolResult } from "@earendil-works/pi-agent-core";
2
- import type { Message } from "@earendil-works/pi-ai";
2
+ import type { Message } from "@earendil-works/pi-ai/compat";
3
3
  import type { AgentScope } from "./agents.ts";
4
4
 
5
5
  export interface UsageStats {
@@ -1,4 +1,4 @@
1
- import { complete, getModel } from "@earendil-works/pi-ai";
1
+ import { complete, getModel } from "@earendil-works/pi-ai/compat";
2
2
  import type { ExtensionAPI, ExtensionCommandContext } from "@bastani/atomic";
3
3
  import { DynamicBorder, getMarkdownTheme } from "@bastani/atomic";
4
4
  import { Container, Markdown, matchesKey, Text } from "@earendil-works/pi-tui";
@@ -17,7 +17,7 @@
17
17
  * separate variables. Only the agent cursor is ever exposed to the agent.
18
18
  */
19
19
 
20
- import { StringEnum } from "@earendil-works/pi-ai";
20
+ import { StringEnum } from "@earendil-works/pi-ai/compat";
21
21
  import { Text } from "@earendil-works/pi-tui";
22
22
  import type { ExtensionAPI, ExtensionContext, ToolExecutionMode } from "@bastani/atomic";
23
23
  import { Type } from "typebox";
@@ -10,7 +10,7 @@
10
10
  * correct for that point in history.
11
11
  */
12
12
 
13
- import { StringEnum } from "@earendil-works/pi-ai";
13
+ import { StringEnum } from "@earendil-works/pi-ai/compat";
14
14
  import type { ExtensionAPI, ExtensionContext, Theme } from "@bastani/atomic";
15
15
  import { matchesKey, Text, truncateToWidth } from "@earendil-works/pi-tui";
16
16
  import { Type } from "typebox";
@@ -20,7 +20,7 @@
20
20
  * atomic -e ./tool-override.ts
21
21
  */
22
22
 
23
- import type { TextContent } from "@earendil-works/pi-ai";
23
+ import type { TextContent } from "@earendil-works/pi-ai/compat";
24
24
  import { type ExtensionAPI, getAgentDir, withFileMutationQueue } from "@bastani/atomic";
25
25
  import { constants, readFileSync } from "fs";
26
26
  import { access, appendFile, readFile } from "fs/promises";
@@ -4,7 +4,7 @@
4
4
  * Shows how to select a specific model and thinking level.
5
5
  */
6
6
 
7
- import { getModel } from "@earendil-works/pi-ai";
7
+ import { getModel } from "@earendil-works/pi-ai/compat";
8
8
  import { AuthStorage, createAgentSession, ModelRegistry } from "@bastani/atomic";
9
9
 
10
10
  // Set up auth storage and model registry
@@ -4,7 +4,7 @@
4
4
  * Replace everything - no discovery, explicit configuration.
5
5
  */
6
6
 
7
- import { getModel } from "@earendil-works/pi-ai";
7
+ import { getModel } from "@earendil-works/pi-ai/compat";
8
8
  import {
9
9
  AuthStorage,
10
10
  createAgentSession,
@@ -32,7 +32,7 @@ bun examples/sdk/01-minimal.ts
32
32
  ## Quick Reference
33
33
 
34
34
  ```typescript
35
- import { getModel } from "@earendil-works/pi-ai";
35
+ import { getModel } from "@earendil-works/pi-ai/compat";
36
36
  import {
37
37
  AuthStorage,
38
38
  createAgentSession,