@bastani/atomic 0.9.11-alpha.4 → 0.9.11-alpha.6

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 (1032) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +12 -5
  3. package/dist/builtin/intercom/package.json +2 -2
  4. package/dist/builtin/mcp/CHANGELOG.md +6 -0
  5. package/dist/builtin/mcp/README.md +3 -3
  6. package/dist/builtin/mcp/cli.js +0 -1
  7. package/dist/builtin/mcp/config.ts +0 -2
  8. package/dist/builtin/mcp/package.json +3 -3
  9. package/dist/builtin/mcp/types.ts +0 -1
  10. package/dist/builtin/subagents/CHANGELOG.md +19 -0
  11. package/dist/builtin/subagents/README.md +10 -1
  12. package/dist/builtin/subagents/agents/code-simplifier.md +47 -102
  13. package/dist/builtin/subagents/agents/codebase-analyzer.md +27 -130
  14. package/dist/builtin/subagents/agents/codebase-locator.md +24 -83
  15. package/dist/builtin/subagents/agents/codebase-online-researcher.md +60 -259
  16. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +29 -207
  17. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +28 -150
  18. package/dist/builtin/subagents/agents/codebase-research-locator.md +21 -118
  19. package/dist/builtin/subagents/agents/debugger.md +29 -65
  20. package/dist/builtin/subagents/agents/worker.md +23 -30
  21. package/dist/builtin/subagents/package.json +4 -4
  22. package/dist/builtin/subagents/prompts/gather-context-and-clarify.md +18 -11
  23. package/dist/builtin/subagents/prompts/parallel-cleanup.md +34 -33
  24. package/dist/builtin/subagents/prompts/parallel-context-build.md +22 -36
  25. package/dist/builtin/subagents/prompts/parallel-handoff-plan.md +20 -52
  26. package/dist/builtin/subagents/prompts/parallel-research.md +17 -41
  27. package/dist/builtin/subagents/prompts/parallel-review.md +23 -28
  28. package/dist/builtin/subagents/prompts/review-loop.md +18 -27
  29. package/dist/builtin/subagents/skills/subagent/SKILL.md +6 -6
  30. package/dist/builtin/subagents/src/extension/prompt-guidance.ts +4 -1
  31. package/dist/builtin/subagents/src/runs/background/async-execution-chain.ts +23 -4
  32. package/dist/builtin/subagents/src/runs/background/async-execution-single.ts +2 -0
  33. package/dist/builtin/subagents/src/runs/background/async-execution-types.ts +10 -0
  34. package/dist/builtin/subagents/src/runs/background/subagent-runner-step.ts +1 -0
  35. package/dist/builtin/subagents/src/runs/foreground/chain-execution-dynamic-step.ts +2 -0
  36. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-runner.ts +8 -0
  37. package/dist/builtin/subagents/src/runs/foreground/chain-execution-parallel-step.ts +1 -0
  38. package/dist/builtin/subagents/src/runs/foreground/chain-execution-sequential-step.ts +6 -0
  39. package/dist/builtin/subagents/src/runs/foreground/chain-execution-types.ts +2 -0
  40. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-async.ts +7 -0
  41. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-chain.ts +1 -0
  42. package/dist/builtin/subagents/src/runs/foreground/subagent-executor-resume.ts +3 -0
  43. package/dist/builtin/subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +1 -2
  44. package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +1 -0
  45. package/dist/builtin/subagents/src/runs/shared/pi-args.ts +5 -3
  46. package/dist/builtin/subagents/src/shared/settings.ts +4 -0
  47. package/dist/builtin/web-access/package.json +2 -2
  48. package/dist/builtin/workflows/CHANGELOG.md +53 -0
  49. package/dist/builtin/workflows/README.md +72 -70
  50. package/dist/builtin/workflows/ambient.d.ts +0 -5
  51. package/dist/builtin/workflows/builtin/adversarial-verification-prompts.ts +7 -4
  52. package/dist/builtin/workflows/builtin/adversarial-verification-runner.ts +1 -1
  53. package/dist/builtin/workflows/builtin/adversarial-verification.ts +2 -1
  54. package/dist/builtin/workflows/builtin/classify-and-act-prompts.ts +5 -2
  55. package/dist/builtin/workflows/builtin/classify-and-act-runner.ts +5 -7
  56. package/dist/builtin/workflows/builtin/classify-and-act.ts +3 -2
  57. package/dist/builtin/workflows/builtin/fan-out-and-synthesize-prompts.ts +6 -3
  58. package/dist/builtin/workflows/builtin/fan-out-and-synthesize-runner.ts +5 -5
  59. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.ts +3 -2
  60. package/dist/builtin/workflows/builtin/generate-and-filter-prompts.ts +7 -4
  61. package/dist/builtin/workflows/builtin/generate-and-filter-runner.ts +6 -3
  62. package/dist/builtin/workflows/builtin/generate-and-filter.ts +3 -2
  63. package/dist/builtin/workflows/builtin/goal-artifacts.ts +1 -1
  64. package/dist/builtin/workflows/builtin/goal-models.ts +39 -39
  65. package/dist/builtin/workflows/builtin/goal-orchestrator-prompts.ts +94 -0
  66. package/dist/builtin/workflows/builtin/goal-prompts.ts +66 -286
  67. package/dist/builtin/workflows/builtin/goal-reducer.ts +1 -1
  68. package/dist/builtin/workflows/builtin/goal-runner.ts +72 -116
  69. package/dist/builtin/workflows/builtin/goal.ts +9 -8
  70. package/dist/builtin/workflows/builtin/index.d.ts +17 -112
  71. package/dist/builtin/workflows/builtin/index.ts +1 -2
  72. package/dist/builtin/workflows/builtin/loop-until-done-prompts.ts +20 -12
  73. package/dist/builtin/workflows/builtin/loop-until-done-runner.ts +3 -0
  74. package/dist/builtin/workflows/builtin/loop-until-done.ts +3 -2
  75. package/dist/builtin/workflows/builtin/open-claude-design-phases.ts +52 -55
  76. package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +45 -52
  77. package/dist/builtin/workflows/builtin/open-claude-design-setup.ts +41 -46
  78. package/dist/builtin/workflows/builtin/open-claude-design-utils.ts +16 -21
  79. package/dist/builtin/workflows/builtin/open-claude-design.ts +2 -1
  80. package/dist/builtin/workflows/builtin/ralph-core.ts +61 -57
  81. package/dist/builtin/workflows/builtin/ralph-forked-prompts.ts +41 -45
  82. package/dist/builtin/workflows/builtin/ralph-models.ts +33 -43
  83. package/dist/builtin/workflows/builtin/ralph-reviewer-prompt.ts +35 -117
  84. package/dist/builtin/workflows/builtin/ralph-runner.ts +81 -108
  85. package/dist/builtin/workflows/builtin/ralph.ts +2 -1
  86. package/dist/builtin/workflows/builtin/shared-prompts.ts +111 -80
  87. package/dist/builtin/workflows/builtin/steering-context.ts +51 -0
  88. package/dist/builtin/workflows/builtin/tournament-prompts.ts +21 -12
  89. package/dist/builtin/workflows/builtin/tournament-runner.ts +3 -0
  90. package/dist/builtin/workflows/builtin/tournament.ts +3 -2
  91. package/dist/builtin/workflows/package.json +2 -2
  92. package/dist/builtin/workflows/skills/create-spec/SKILL.md +1 -1
  93. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +6 -8
  94. package/dist/builtin/workflows/skills/impeccable/reference/live.md +3 -4
  95. package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +2 -20
  96. package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +4 -42
  97. package/dist/builtin/workflows/skills/impeccable/scripts/hook.mjs +3 -3
  98. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +2 -3
  99. package/dist/builtin/workflows/skills/impeccable/scripts/live-inject.mjs +0 -1
  100. package/dist/builtin/workflows/skills/impeccable/scripts/live-poll.mjs +2 -2
  101. package/dist/builtin/workflows/skills/impeccable/scripts/pin.mjs +4 -4
  102. package/dist/builtin/workflows/skills/prompt-engineer/SKILL.md +57 -252
  103. package/dist/builtin/workflows/skills/prompt-engineer/references/advanced_patterns.md +70 -226
  104. package/dist/builtin/workflows/skills/prompt-engineer/references/core_prompting.md +64 -103
  105. package/dist/builtin/workflows/skills/prompt-engineer/references/quality_improvement.md +81 -155
  106. package/dist/builtin/workflows/src/authoring.d.ts +5 -1
  107. package/dist/builtin/workflows/src/durable/backend.ts +68 -9
  108. package/dist/builtin/workflows/src/durable/boundary-lifecycle.ts +148 -0
  109. package/dist/builtin/workflows/src/durable/boundary-topology.ts +420 -0
  110. package/dist/builtin/workflows/src/durable/child-invocation.ts +14 -0
  111. package/dist/builtin/workflows/src/durable/child-primitive.ts +74 -44
  112. package/dist/builtin/workflows/src/durable/completed-catalog-stage-groups.ts +250 -0
  113. package/dist/builtin/workflows/src/durable/completed-catalog.ts +205 -131
  114. package/dist/builtin/workflows/src/durable/completed-inspection.ts +8 -2
  115. package/dist/builtin/workflows/src/durable/completed-subtree.ts +31 -0
  116. package/dist/builtin/workflows/src/durable/dbos-backend.ts +28 -24
  117. package/dist/builtin/workflows/src/durable/dbos-envelope.ts +130 -3
  118. package/dist/builtin/workflows/src/durable/dbos-metadata.ts +18 -0
  119. package/dist/builtin/workflows/src/durable/scoped-backend.ts +64 -17
  120. package/dist/builtin/workflows/src/durable/stage-primitive.ts +60 -60
  121. package/dist/builtin/workflows/src/durable/stage-topology-validation.ts +234 -0
  122. package/dist/builtin/workflows/src/durable/stage-topology.ts +53 -0
  123. package/dist/builtin/workflows/src/durable/tool-failure-checkpoint.ts +49 -0
  124. package/dist/builtin/workflows/src/durable/tool-outcome.ts +120 -0
  125. package/dist/builtin/workflows/src/durable/tool-primitive.ts +367 -58
  126. package/dist/builtin/workflows/src/durable/types.ts +97 -0
  127. package/dist/builtin/workflows/src/durable/ui-primitive.ts +46 -0
  128. package/dist/builtin/workflows/src/durable/workflow-child-result.ts +58 -0
  129. package/dist/builtin/workflows/src/engine/options.ts +1 -0
  130. package/dist/builtin/workflows/src/engine/primitives/workflow.ts +19 -10
  131. package/dist/builtin/workflows/src/engine/run-durable-finalize.ts +11 -1
  132. package/dist/builtin/workflows/src/engine/run-durable-topology.ts +190 -18
  133. package/dist/builtin/workflows/src/engine/run-terminal-event.ts +37 -0
  134. package/dist/builtin/workflows/src/engine/run-terminal-failure.ts +50 -0
  135. package/dist/builtin/workflows/src/engine/run-tool-execution-tracker.ts +152 -0
  136. package/dist/builtin/workflows/src/engine/run-tool-node-lifecycle.ts +87 -0
  137. package/dist/builtin/workflows/src/engine/run.ts +111 -110
  138. package/dist/builtin/workflows/src/engine/runtime.ts +15 -2
  139. package/dist/builtin/workflows/src/extension/extension-factory.ts +1 -0
  140. package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +11 -0
  141. package/dist/builtin/workflows/src/extension/index.bundle.mjs +6599 -4776
  142. package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +16 -5
  143. package/dist/builtin/workflows/src/extension/render-result.ts +16 -2
  144. package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +3 -0
  145. package/dist/builtin/workflows/src/extension/runtime.ts +4 -0
  146. package/dist/builtin/workflows/src/extension/wiring.ts +3 -1
  147. package/dist/builtin/workflows/src/extension/workflow-command-surfaces.ts +1 -0
  148. package/dist/builtin/workflows/src/extension/workflow-durable-resume-command.ts +9 -3
  149. package/dist/builtin/workflows/src/extension/workflow-module-loader.ts +18 -3
  150. package/dist/builtin/workflows/src/extension/workflow-prompts.ts +27 -9
  151. package/dist/builtin/workflows/src/extension/workflow-status-summary.ts +43 -0
  152. package/dist/builtin/workflows/src/extension/workflow-targets.ts +34 -30
  153. package/dist/builtin/workflows/src/extension/workflow-tool-content.ts +12 -5
  154. package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +162 -63
  155. package/dist/builtin/workflows/src/runs/background/run-inspect.ts +7 -1
  156. package/dist/builtin/workflows/src/runs/background/status.ts +18 -8
  157. package/dist/builtin/workflows/src/runs/background/workflow-lifecycle-aggregate.ts +3 -11
  158. package/dist/builtin/workflows/src/runs/foreground/executor-child-boundary.ts +24 -21
  159. package/dist/builtin/workflows/src/runs/foreground/executor-hil.ts +1 -1
  160. package/dist/builtin/workflows/src/runs/foreground/executor-lifecycle.ts +30 -13
  161. package/dist/builtin/workflows/src/runs/foreground/executor-prompt-nodes.ts +102 -53
  162. package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +13 -5
  163. package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +26 -8
  164. package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +11 -4
  165. package/dist/builtin/workflows/src/runs/foreground/executor-stage-types.ts +4 -1
  166. package/dist/builtin/workflows/src/runs/foreground/executor-types.ts +7 -1
  167. package/dist/builtin/workflows/src/runs/foreground/postmortem-stage-chat.ts +35 -1
  168. package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +136 -17
  169. package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +12 -4
  170. package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +35 -42
  171. package/dist/builtin/workflows/src/runs/foreground/stage-runner-options.ts +5 -1
  172. package/dist/builtin/workflows/src/runs/foreground/stage-runner-pause.ts +195 -0
  173. package/dist/builtin/workflows/src/runs/foreground/stage-runner-session-options.ts +0 -13
  174. package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +14 -2
  175. package/dist/builtin/workflows/src/runs/shared/model-fallback-candidates.ts +3 -143
  176. package/dist/builtin/workflows/src/sdk-surface.ts +1 -1
  177. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +6 -11
  178. package/dist/builtin/workflows/src/shared/authoring-contract-stage.ts +6 -11
  179. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +57 -6
  180. package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +76 -11
  181. package/dist/builtin/workflows/src/shared/expanded-workflow-graph.ts +206 -116
  182. package/dist/builtin/workflows/src/shared/intercom-group.ts +17 -10
  183. package/dist/builtin/workflows/src/shared/persistence-restore-helpers.ts +30 -0
  184. package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +5 -0
  185. package/dist/builtin/workflows/src/shared/render-inputs-schema.ts +3 -3
  186. package/dist/builtin/workflows/src/shared/store-factory.ts +2 -0
  187. package/dist/builtin/workflows/src/shared/store-internal.ts +8 -0
  188. package/dist/builtin/workflows/src/shared/store-public-types.ts +8 -0
  189. package/dist/builtin/workflows/src/shared/store-run-methods.ts +9 -0
  190. package/dist/builtin/workflows/src/shared/store-stage-methods.ts +2 -0
  191. package/dist/builtin/workflows/src/shared/store-tool-node-methods.ts +46 -0
  192. package/dist/builtin/workflows/src/shared/store-types.ts +34 -0
  193. package/dist/builtin/workflows/src/shared/types.ts +14 -24
  194. package/dist/builtin/workflows/src/shared/workflow-failures-classifier.ts +11 -5
  195. package/dist/builtin/workflows/src/shared/workflow-failures-signals.ts +58 -0
  196. package/dist/builtin/workflows/src/shared/workflow-run-ownership.ts +53 -0
  197. package/dist/builtin/workflows/src/tui/graph-view-input.ts +2 -8
  198. package/dist/builtin/workflows/src/tui/graph-view-render-helpers.ts +11 -4
  199. package/dist/builtin/workflows/src/tui/graph-view-render.ts +1 -0
  200. package/dist/builtin/workflows/src/tui/graph-view-state.ts +27 -9
  201. package/dist/builtin/workflows/src/tui/graph-view-types.ts +4 -3
  202. package/dist/builtin/workflows/src/tui/node-card.ts +4 -3
  203. package/dist/builtin/workflows/src/tui/overlay-adapter.ts +0 -4
  204. package/dist/builtin/workflows/src/tui/run-detail.ts +53 -17
  205. package/dist/builtin/workflows/src/tui/session-list.ts +8 -4
  206. package/dist/builtin/workflows/src/tui/stage-chat-view-render-helpers.ts +12 -0
  207. package/dist/builtin/workflows/src/tui/stage-chat-view-render-settings.ts +21 -1
  208. package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +3 -19
  209. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +4 -2
  210. package/dist/builtin/workflows/src/tui/switcher.ts +13 -3
  211. package/dist/builtin/workflows/src/tui/workflow-attach-pane-handle.ts +1 -1
  212. package/dist/builtin/workflows/src/tui/workflow-attach-pane-types.ts +0 -9
  213. package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +16 -49
  214. package/dist/builtin/workflows/src/tui/workflow-status.ts +7 -0
  215. package/dist/builtin/workflows/src/workflows/identity.ts +1 -1
  216. package/dist/cli/args.d.ts +0 -1
  217. package/dist/cli/args.d.ts.map +1 -1
  218. package/dist/cli/args.js +1 -20
  219. package/dist/cli/args.js.map +1 -1
  220. package/dist/cli/config-selector.js +1 -1
  221. package/dist/cli/config-selector.js.map +1 -1
  222. package/dist/cli/list-models.d.ts.map +1 -1
  223. package/dist/cli/list-models.js +1 -2
  224. package/dist/cli/list-models.js.map +1 -1
  225. package/dist/cli/session-picker.d.ts.map +1 -1
  226. package/dist/cli/session-picker.js +2 -1
  227. package/dist/cli/session-picker.js.map +1 -1
  228. package/dist/cli/startup-ui.js +2 -2
  229. package/dist/cli/startup-ui.js.map +1 -1
  230. package/dist/config-self-update.js +1 -1
  231. package/dist/config-self-update.js.map +1 -1
  232. package/dist/config.d.ts +2 -0
  233. package/dist/config.d.ts.map +1 -1
  234. package/dist/config.js +34 -10
  235. package/dist/config.js.map +1 -1
  236. package/dist/core/agent-session-accessors.d.ts.map +1 -1
  237. package/dist/core/agent-session-accessors.js +2 -1
  238. package/dist/core/agent-session-accessors.js.map +1 -1
  239. package/dist/core/agent-session-auto-compaction.d.ts +4 -3
  240. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  241. package/dist/core/agent-session-auto-compaction.js +55 -59
  242. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  243. package/dist/core/agent-session-bash.d.ts +9 -6
  244. package/dist/core/agent-session-bash.d.ts.map +1 -1
  245. package/dist/core/agent-session-bash.js +32 -13
  246. package/dist/core/agent-session-bash.js.map +1 -1
  247. package/dist/core/agent-session-compaction.d.ts +11 -1
  248. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  249. package/dist/core/agent-session-compaction.js +87 -19
  250. package/dist/core/agent-session-compaction.js.map +1 -1
  251. package/dist/core/agent-session-custom-message-commit.d.ts +14 -0
  252. package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -0
  253. package/dist/core/agent-session-custom-message-commit.js +141 -0
  254. package/dist/core/agent-session-custom-message-commit.js.map +1 -0
  255. package/dist/core/agent-session-delivery-forwarding.d.ts +9 -0
  256. package/dist/core/agent-session-delivery-forwarding.d.ts.map +1 -0
  257. package/dist/core/agent-session-delivery-forwarding.js +36 -0
  258. package/dist/core/agent-session-delivery-forwarding.js.map +1 -0
  259. package/dist/core/agent-session-events.d.ts +1 -1
  260. package/dist/core/agent-session-events.d.ts.map +1 -1
  261. package/dist/core/agent-session-events.js +45 -14
  262. package/dist/core/agent-session-events.js.map +1 -1
  263. package/dist/core/agent-session-extension-bindings.d.ts +2 -6
  264. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  265. package/dist/core/agent-session-extension-bindings.js +18 -11
  266. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  267. package/dist/core/agent-session-message-queue.d.ts +5 -2
  268. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  269. package/dist/core/agent-session-message-queue.js +91 -97
  270. package/dist/core/agent-session-message-queue.js.map +1 -1
  271. package/dist/core/agent-session-methods.d.ts +47 -39
  272. package/dist/core/agent-session-methods.d.ts.map +1 -1
  273. package/dist/core/agent-session-methods.js.map +1 -1
  274. package/dist/core/agent-session-models.d.ts +2 -38
  275. package/dist/core/agent-session-models.d.ts.map +1 -1
  276. package/dist/core/agent-session-models.js +5 -147
  277. package/dist/core/agent-session-models.js.map +1 -1
  278. package/dist/core/agent-session-persistent-custom-messages.d.ts +47 -0
  279. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -0
  280. package/dist/core/agent-session-persistent-custom-messages.js +267 -0
  281. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -0
  282. package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
  283. package/dist/core/agent-session-post-tool-compaction.js +34 -9
  284. package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
  285. package/dist/core/agent-session-prompt.d.ts +2 -0
  286. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  287. package/dist/core/agent-session-prompt.js +42 -16
  288. package/dist/core/agent-session-prompt.js.map +1 -1
  289. package/dist/core/agent-session-queue-pause.d.ts +10 -0
  290. package/dist/core/agent-session-queue-pause.d.ts.map +1 -0
  291. package/dist/core/agent-session-queue-pause.js +86 -0
  292. package/dist/core/agent-session-queue-pause.js.map +1 -0
  293. package/dist/core/agent-session-retry.d.ts +0 -11
  294. package/dist/core/agent-session-retry.d.ts.map +1 -1
  295. package/dist/core/agent-session-retry.js +8 -57
  296. package/dist/core/agent-session-retry.js.map +1 -1
  297. package/dist/core/agent-session-runtime-auth.d.ts +6 -0
  298. package/dist/core/agent-session-runtime-auth.d.ts.map +1 -0
  299. package/dist/core/agent-session-runtime-auth.js +26 -0
  300. package/dist/core/agent-session-runtime-auth.js.map +1 -0
  301. package/dist/core/agent-session-runtime.d.ts +13 -2
  302. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  303. package/dist/core/agent-session-runtime.js +32 -6
  304. package/dist/core/agent-session-runtime.js.map +1 -1
  305. package/dist/core/agent-session-services.d.ts +0 -2
  306. package/dist/core/agent-session-services.d.ts.map +1 -1
  307. package/dist/core/agent-session-services.js +6 -7
  308. package/dist/core/agent-session-services.js.map +1 -1
  309. package/dist/core/agent-session-state.d.ts.map +1 -1
  310. package/dist/core/agent-session-state.js +3 -0
  311. package/dist/core/agent-session-state.js.map +1 -1
  312. package/dist/core/agent-session-tool-hooks.d.ts.map +1 -1
  313. package/dist/core/agent-session-tool-hooks.js +6 -1
  314. package/dist/core/agent-session-tool-hooks.js.map +1 -1
  315. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  316. package/dist/core/agent-session-tool-registry.js +2 -18
  317. package/dist/core/agent-session-tool-registry.js.map +1 -1
  318. package/dist/core/agent-session-transfer.d.ts +4 -0
  319. package/dist/core/agent-session-transfer.d.ts.map +1 -0
  320. package/dist/core/agent-session-transfer.js +71 -0
  321. package/dist/core/agent-session-transfer.js.map +1 -0
  322. package/dist/core/agent-session-tree.js +1 -1
  323. package/dist/core/agent-session-tree.js.map +1 -1
  324. package/dist/core/agent-session-types.d.ts +5 -11
  325. package/dist/core/agent-session-types.d.ts.map +1 -1
  326. package/dist/core/agent-session-types.js +0 -3
  327. package/dist/core/agent-session-types.js.map +1 -1
  328. package/dist/core/agent-session.d.ts +12 -2
  329. package/dist/core/agent-session.d.ts.map +1 -1
  330. package/dist/core/agent-session.js +8 -2
  331. package/dist/core/agent-session.js.map +1 -1
  332. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  333. package/dist/core/atomic-guide-command.js +31 -33
  334. package/dist/core/atomic-guide-command.js.map +1 -1
  335. package/dist/core/auth-storage.js +2 -2
  336. package/dist/core/auth-storage.js.map +1 -1
  337. package/dist/core/bash-executor.d.ts +5 -3
  338. package/dist/core/bash-executor.d.ts.map +1 -1
  339. package/dist/core/bash-executor.js +5 -4
  340. package/dist/core/bash-executor.js.map +1 -1
  341. package/dist/core/builtin-packages.d.ts.map +1 -1
  342. package/dist/core/builtin-packages.js +0 -6
  343. package/dist/core/builtin-packages.js.map +1 -1
  344. package/dist/core/compaction/branch-summarization.d.ts +8 -3
  345. package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
  346. package/dist/core/compaction/branch-summarization.js +17 -6
  347. package/dist/core/compaction/branch-summarization.js.map +1 -1
  348. package/dist/core/compaction/compaction-boundary.d.ts +18 -1
  349. package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
  350. package/dist/core/compaction/compaction-boundary.js +2 -2
  351. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  352. package/dist/core/compaction/compaction-runner.d.ts +61 -6
  353. package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
  354. package/dist/core/compaction/compaction-runner.js +242 -18
  355. package/dist/core/compaction/compaction-runner.js.map +1 -1
  356. package/dist/core/compaction/compaction-types.d.ts +53 -2
  357. package/dist/core/compaction/compaction-types.d.ts.map +1 -1
  358. package/dist/core/compaction/compaction-types.js.map +1 -1
  359. package/dist/core/compaction/fallback-planner.d.ts +64 -0
  360. package/dist/core/compaction/fallback-planner.d.ts.map +1 -0
  361. package/dist/core/compaction/fallback-planner.js +75 -0
  362. package/dist/core/compaction/fallback-planner.js.map +1 -0
  363. package/dist/core/compaction/index.d.ts +3 -0
  364. package/dist/core/compaction/index.d.ts.map +1 -1
  365. package/dist/core/compaction/index.js +3 -0
  366. package/dist/core/compaction/index.js.map +1 -1
  367. package/dist/core/compaction/planner-outcome.d.ts +86 -0
  368. package/dist/core/compaction/planner-outcome.d.ts.map +1 -0
  369. package/dist/core/compaction/planner-outcome.js +122 -0
  370. package/dist/core/compaction/planner-outcome.js.map +1 -0
  371. package/dist/core/compaction/range-planner-diagnostics.d.ts +58 -6
  372. package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -1
  373. package/dist/core/compaction/range-planner-diagnostics.js +69 -31
  374. package/dist/core/compaction/range-planner-diagnostics.js.map +1 -1
  375. package/dist/core/compaction/range-planner.d.ts +36 -8
  376. package/dist/core/compaction/range-planner.d.ts.map +1 -1
  377. package/dist/core/compaction/range-planner.js +136 -51
  378. package/dist/core/compaction/range-planner.js.map +1 -1
  379. package/dist/core/compaction/region-trimming.d.ts +34 -0
  380. package/dist/core/compaction/region-trimming.d.ts.map +1 -0
  381. package/dist/core/compaction/region-trimming.js +73 -0
  382. package/dist/core/compaction/region-trimming.js.map +1 -0
  383. package/dist/core/compaction/transcript-serialization.d.ts +8 -1
  384. package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
  385. package/dist/core/compaction/transcript-serialization.js +78 -27
  386. package/dist/core/compaction/transcript-serialization.js.map +1 -1
  387. package/dist/core/context-tool-pairing.d.ts +19 -0
  388. package/dist/core/context-tool-pairing.d.ts.map +1 -0
  389. package/dist/core/context-tool-pairing.js +50 -0
  390. package/dist/core/context-tool-pairing.js.map +1 -0
  391. package/dist/core/diagnostics.d.ts +8 -0
  392. package/dist/core/diagnostics.d.ts.map +1 -1
  393. package/dist/core/diagnostics.js.map +1 -1
  394. package/dist/core/extensions/context-types.d.ts +3 -0
  395. package/dist/core/extensions/context-types.d.ts.map +1 -1
  396. package/dist/core/extensions/context-types.js.map +1 -1
  397. package/dist/core/extensions/index.d.ts +2 -0
  398. package/dist/core/extensions/index.d.ts.map +1 -1
  399. package/dist/core/extensions/index.js.map +1 -1
  400. package/dist/core/extensions/loader-api.d.ts.map +1 -1
  401. package/dist/core/extensions/loader-api.js +48 -27
  402. package/dist/core/extensions/loader-api.js.map +1 -1
  403. package/dist/core/extensions/loader-runtime.d.ts +2 -4
  404. package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
  405. package/dist/core/extensions/loader-runtime.js +199 -18
  406. package/dist/core/extensions/loader-runtime.js.map +1 -1
  407. package/dist/core/extensions/message-types.d.ts +7 -4
  408. package/dist/core/extensions/message-types.d.ts.map +1 -1
  409. package/dist/core/extensions/message-types.js.map +1 -1
  410. package/dist/core/extensions/provider-types.d.ts +9 -4
  411. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  412. package/dist/core/extensions/provider-types.js.map +1 -1
  413. package/dist/core/extensions/runner-context.d.ts +2 -0
  414. package/dist/core/extensions/runner-context.d.ts.map +1 -1
  415. package/dist/core/extensions/runner-context.js +4 -0
  416. package/dist/core/extensions/runner-context.js.map +1 -1
  417. package/dist/core/extensions/runner.d.ts +1 -0
  418. package/dist/core/extensions/runner.d.ts.map +1 -1
  419. package/dist/core/extensions/runner.js +28 -20
  420. package/dist/core/extensions/runner.js.map +1 -1
  421. package/dist/core/extensions/runtime-types.d.ts +25 -0
  422. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  423. package/dist/core/extensions/runtime-types.js.map +1 -1
  424. package/dist/core/extensions/tool-types.d.ts +7 -3
  425. package/dist/core/extensions/tool-types.d.ts.map +1 -1
  426. package/dist/core/extensions/tool-types.js.map +1 -1
  427. package/dist/core/extensions/ui-types.d.ts +14 -4
  428. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  429. package/dist/core/extensions/ui-types.js.map +1 -1
  430. package/dist/core/fallback-models.d.ts +37 -0
  431. package/dist/core/fallback-models.d.ts.map +1 -0
  432. package/dist/core/fallback-models.js +48 -0
  433. package/dist/core/fallback-models.js.map +1 -0
  434. package/dist/core/flattened-tool-arguments.d.ts +4 -7
  435. package/dist/core/flattened-tool-arguments.d.ts.map +1 -1
  436. package/dist/core/flattened-tool-arguments.js +4 -7
  437. package/dist/core/flattened-tool-arguments.js.map +1 -1
  438. package/dist/core/http-dispatcher.d.ts.map +1 -1
  439. package/dist/core/http-dispatcher.js +0 -5
  440. package/dist/core/http-dispatcher.js.map +1 -1
  441. package/dist/core/messages.d.ts +14 -2
  442. package/dist/core/messages.d.ts.map +1 -1
  443. package/dist/core/messages.js +28 -4
  444. package/dist/core/messages.js.map +1 -1
  445. package/dist/core/model-capabilities.d.ts +18 -0
  446. package/dist/core/model-capabilities.d.ts.map +1 -0
  447. package/dist/core/model-capabilities.js +23 -0
  448. package/dist/core/model-capabilities.js.map +1 -0
  449. package/dist/core/model-registry-auth.d.ts.map +1 -1
  450. package/dist/core/model-registry-auth.js +0 -2
  451. package/dist/core/model-registry-auth.js.map +1 -1
  452. package/dist/core/model-registry-builtins.d.ts +0 -2
  453. package/dist/core/model-registry-builtins.d.ts.map +1 -1
  454. package/dist/core/model-registry-builtins.js +9 -76
  455. package/dist/core/model-registry-builtins.js.map +1 -1
  456. package/dist/core/model-registry-custom-loader.d.ts.map +1 -1
  457. package/dist/core/model-registry-custom-loader.js +1 -12
  458. package/dist/core/model-registry-custom-loader.js.map +1 -1
  459. package/dist/core/model-registry-dynamic.d.ts.map +1 -1
  460. package/dist/core/model-registry-dynamic.js +3 -15
  461. package/dist/core/model-registry-dynamic.js.map +1 -1
  462. package/dist/core/model-registry-extension-refresh.d.ts +23 -0
  463. package/dist/core/model-registry-extension-refresh.d.ts.map +1 -0
  464. package/dist/core/model-registry-extension-refresh.js +32 -0
  465. package/dist/core/model-registry-extension-refresh.js.map +1 -0
  466. package/dist/core/model-registry-schemas.d.ts +118 -9
  467. package/dist/core/model-registry-schemas.d.ts.map +1 -1
  468. package/dist/core/model-registry-schemas.js +10 -3
  469. package/dist/core/model-registry-schemas.js.map +1 -1
  470. package/dist/core/model-registry-types.d.ts +5 -5
  471. package/dist/core/model-registry-types.d.ts.map +1 -1
  472. package/dist/core/model-registry-types.js.map +1 -1
  473. package/dist/core/model-registry-validation.d.ts +7 -0
  474. package/dist/core/model-registry-validation.d.ts.map +1 -0
  475. package/dist/core/model-registry-validation.js +12 -0
  476. package/dist/core/model-registry-validation.js.map +1 -0
  477. package/dist/core/model-registry.d.ts +5 -3
  478. package/dist/core/model-registry.d.ts.map +1 -1
  479. package/dist/core/model-registry.js +34 -33
  480. package/dist/core/model-registry.js.map +1 -1
  481. package/dist/core/model-resolver-defaults.d.ts.map +1 -1
  482. package/dist/core/model-resolver-defaults.js +0 -1
  483. package/dist/core/model-resolver-defaults.js.map +1 -1
  484. package/dist/core/model-resolver-initial.d.ts.map +1 -1
  485. package/dist/core/model-resolver-initial.js +9 -0
  486. package/dist/core/model-resolver-initial.js.map +1 -1
  487. package/dist/core/model-resolver-patterns.d.ts.map +1 -1
  488. package/dist/core/model-resolver-patterns.js +0 -2
  489. package/dist/core/model-resolver-patterns.js.map +1 -1
  490. package/dist/core/model-resolver-scope.d.ts +2 -0
  491. package/dist/core/model-resolver-scope.d.ts.map +1 -1
  492. package/dist/core/model-resolver-scope.js +18 -4
  493. package/dist/core/model-resolver-scope.js.map +1 -1
  494. package/dist/core/model-resolver-types.d.ts +2 -0
  495. package/dist/core/model-resolver-types.d.ts.map +1 -1
  496. package/dist/core/model-resolver-types.js.map +1 -1
  497. package/dist/core/oauth-provider-bridge.d.ts +21 -0
  498. package/dist/core/oauth-provider-bridge.d.ts.map +1 -1
  499. package/dist/core/oauth-provider-bridge.js +68 -7
  500. package/dist/core/oauth-provider-bridge.js.map +1 -1
  501. package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
  502. package/dist/core/package-manager-auto-resources.js +12 -4
  503. package/dist/core/package-manager-auto-resources.js.map +1 -1
  504. package/dist/core/package-manager-resolver.d.ts.map +1 -1
  505. package/dist/core/package-manager-resolver.js +42 -11
  506. package/dist/core/package-manager-resolver.js.map +1 -1
  507. package/dist/core/package-manager-types.d.ts +2 -0
  508. package/dist/core/package-manager-types.d.ts.map +1 -1
  509. package/dist/core/package-manager-types.js.map +1 -1
  510. package/dist/core/package-manager.d.ts +1 -1
  511. package/dist/core/package-manager.d.ts.map +1 -1
  512. package/dist/core/package-manager.js.map +1 -1
  513. package/dist/core/remote-catalog-provider.d.ts +1 -1
  514. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  515. package/dist/core/remote-catalog-provider.js +17 -11
  516. package/dist/core/remote-catalog-provider.js.map +1 -1
  517. package/dist/core/resource-loader-assets.d.ts.map +1 -1
  518. package/dist/core/resource-loader-assets.js +30 -4
  519. package/dist/core/resource-loader-assets.js.map +1 -1
  520. package/dist/core/resource-loader-context-files.d.ts.map +1 -1
  521. package/dist/core/resource-loader-context-files.js +3 -1
  522. package/dist/core/resource-loader-context-files.js.map +1 -1
  523. package/dist/core/resource-loader-core.d.ts +2 -1
  524. package/dist/core/resource-loader-core.d.ts.map +1 -1
  525. package/dist/core/resource-loader-core.js +3 -0
  526. package/dist/core/resource-loader-core.js.map +1 -1
  527. package/dist/core/resource-loader-extensions.d.ts +1 -0
  528. package/dist/core/resource-loader-extensions.d.ts.map +1 -1
  529. package/dist/core/resource-loader-extensions.js +120 -7
  530. package/dist/core/resource-loader-extensions.js.map +1 -1
  531. package/dist/core/resource-loader-package-resources.d.ts.map +1 -1
  532. package/dist/core/resource-loader-package-resources.js +14 -1
  533. package/dist/core/resource-loader-package-resources.js.map +1 -1
  534. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  535. package/dist/core/resource-loader-reload.js +2 -1
  536. package/dist/core/resource-loader-reload.js.map +1 -1
  537. package/dist/core/resource-loader-source-info.d.ts.map +1 -1
  538. package/dist/core/resource-loader-source-info.js +6 -3
  539. package/dist/core/resource-loader-source-info.js.map +1 -1
  540. package/dist/core/sdk-types.d.ts +11 -10
  541. package/dist/core/sdk-types.d.ts.map +1 -1
  542. package/dist/core/sdk-types.js.map +1 -1
  543. package/dist/core/sdk.d.ts +1 -0
  544. package/dist/core/sdk.d.ts.map +1 -1
  545. package/dist/core/sdk.js +13 -84
  546. package/dist/core/sdk.js.map +1 -1
  547. package/dist/core/session-manager-core.d.ts +3 -3
  548. package/dist/core/session-manager-core.d.ts.map +1 -1
  549. package/dist/core/session-manager-core.js +18 -25
  550. package/dist/core/session-manager-core.js.map +1 -1
  551. package/dist/core/session-manager-entries.d.ts +2 -5
  552. package/dist/core/session-manager-entries.d.ts.map +1 -1
  553. package/dist/core/session-manager-entries.js +2 -8
  554. package/dist/core/session-manager-entries.js.map +1 -1
  555. package/dist/core/session-manager-history.d.ts +3 -3
  556. package/dist/core/session-manager-history.d.ts.map +1 -1
  557. package/dist/core/session-manager-history.js +49 -27
  558. package/dist/core/session-manager-history.js.map +1 -1
  559. package/dist/core/session-manager-storage.d.ts +6 -0
  560. package/dist/core/session-manager-storage.d.ts.map +1 -1
  561. package/dist/core/session-manager-storage.js +38 -5
  562. package/dist/core/session-manager-storage.js.map +1 -1
  563. package/dist/core/session-manager-types.d.ts +6 -6
  564. package/dist/core/session-manager-types.d.ts.map +1 -1
  565. package/dist/core/session-manager-types.js.map +1 -1
  566. package/dist/core/session-manager.d.ts +1 -1
  567. package/dist/core/session-manager.d.ts.map +1 -1
  568. package/dist/core/session-manager.js.map +1 -1
  569. package/dist/core/settings-manager-basic-accessors.d.ts +0 -4
  570. package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
  571. package/dist/core/settings-manager-basic-accessors.js +0 -50
  572. package/dist/core/settings-manager-basic-accessors.js.map +1 -1
  573. package/dist/core/settings-manager-core.d.ts +2 -4
  574. package/dist/core/settings-manager-core.d.ts.map +1 -1
  575. package/dist/core/settings-manager-core.js +5 -51
  576. package/dist/core/settings-manager-core.js.map +1 -1
  577. package/dist/core/settings-manager.d.ts +1 -1
  578. package/dist/core/settings-manager.d.ts.map +1 -1
  579. package/dist/core/settings-manager.js.map +1 -1
  580. package/dist/core/settings-storage.d.ts +3 -1
  581. package/dist/core/settings-storage.d.ts.map +1 -1
  582. package/dist/core/settings-storage.js +22 -0
  583. package/dist/core/settings-storage.js.map +1 -1
  584. package/dist/core/settings-types.d.ts +2 -4
  585. package/dist/core/settings-types.d.ts.map +1 -1
  586. package/dist/core/settings-types.js.map +1 -1
  587. package/dist/core/slash-commands.d.ts.map +1 -1
  588. package/dist/core/slash-commands.js +69 -23
  589. package/dist/core/slash-commands.js.map +1 -1
  590. package/dist/core/source-info.d.ts +3 -1
  591. package/dist/core/source-info.d.ts.map +1 -1
  592. package/dist/core/source-info.js +2 -0
  593. package/dist/core/source-info.js.map +1 -1
  594. package/dist/core/system-prompt.d.ts.map +1 -1
  595. package/dist/core/system-prompt.js +11 -0
  596. package/dist/core/system-prompt.js.map +1 -1
  597. package/dist/core/tools/ask-user-question/ask-user-question.js +1 -1
  598. package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
  599. package/dist/core/tools/bash-session-environment.d.ts +13 -0
  600. package/dist/core/tools/bash-session-environment.d.ts.map +1 -0
  601. package/dist/core/tools/bash-session-environment.js +35 -0
  602. package/dist/core/tools/bash-session-environment.js.map +1 -0
  603. package/dist/core/tools/bash.d.ts +4 -1
  604. package/dist/core/tools/bash.d.ts.map +1 -1
  605. package/dist/core/tools/bash.js +16 -8
  606. package/dist/core/tools/bash.js.map +1 -1
  607. package/dist/core/tools/tool-definition-wrapper.d.ts +3 -0
  608. package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
  609. package/dist/core/tools/tool-definition-wrapper.js +10 -2
  610. package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
  611. package/dist/extensions/index.js +1 -1
  612. package/dist/extensions/index.js.map +1 -1
  613. package/dist/extensions/llama/provider.d.ts +3 -2
  614. package/dist/extensions/llama/provider.d.ts.map +1 -1
  615. package/dist/extensions/llama/provider.js +9 -3
  616. package/dist/extensions/llama/provider.js.map +1 -1
  617. package/dist/index-extensions.d.ts +1 -1
  618. package/dist/index-extensions.d.ts.map +1 -1
  619. package/dist/index-extensions.js.map +1 -1
  620. package/dist/index.d.ts +2 -3
  621. package/dist/index.d.ts.map +1 -1
  622. package/dist/index.js +1 -2
  623. package/dist/index.js.map +1 -1
  624. package/dist/main-session-options.d.ts.map +1 -1
  625. package/dist/main-session-options.js +0 -4
  626. package/dist/main-session-options.js.map +1 -1
  627. package/dist/main-session.d.ts.map +1 -1
  628. package/dist/main-session.js +2 -1
  629. package/dist/main-session.js.map +1 -1
  630. package/dist/main.d.ts.map +1 -1
  631. package/dist/main.js +1 -17
  632. package/dist/main.js.map +1 -1
  633. package/dist/modes/index.d.ts +1 -1
  634. package/dist/modes/index.d.ts.map +1 -1
  635. package/dist/modes/index.js.map +1 -1
  636. package/dist/modes/interactive/chat-input-actions.d.ts +1 -1
  637. package/dist/modes/interactive/chat-input-actions.d.ts.map +1 -1
  638. package/dist/modes/interactive/chat-input-actions.js +14 -96
  639. package/dist/modes/interactive/chat-input-actions.js.map +1 -1
  640. package/dist/modes/interactive/components/atomic-banner.d.ts +9 -8
  641. package/dist/modes/interactive/components/atomic-banner.d.ts.map +1 -1
  642. package/dist/modes/interactive/components/atomic-banner.js +68 -24
  643. package/dist/modes/interactive/components/atomic-banner.js.map +1 -1
  644. package/dist/modes/interactive/components/atomic-working-status.d.ts +52 -0
  645. package/dist/modes/interactive/components/atomic-working-status.d.ts.map +1 -0
  646. package/dist/modes/interactive/components/atomic-working-status.js +202 -0
  647. package/dist/modes/interactive/components/atomic-working-status.js.map +1 -0
  648. package/dist/modes/interactive/components/chat-message-renderer.js +1 -1
  649. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  650. package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
  651. package/dist/modes/interactive/components/chat-session-host-actions.js +99 -7
  652. package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
  653. package/dist/modes/interactive/components/chat-session-host-editor.js +3 -3
  654. package/dist/modes/interactive/components/chat-session-host-editor.js.map +1 -1
  655. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  656. package/dist/modes/interactive/components/chat-session-host-events.js +52 -9
  657. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  658. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  659. package/dist/modes/interactive/components/chat-session-host-rendering.js +23 -7
  660. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  661. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +2 -0
  662. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
  663. package/dist/modes/interactive/components/chat-session-host-runtime.js +67 -18
  664. package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
  665. package/dist/modes/interactive/components/chat-session-host-state.d.ts +9 -0
  666. package/dist/modes/interactive/components/chat-session-host-state.d.ts.map +1 -1
  667. package/dist/modes/interactive/components/chat-session-host-state.js +5 -0
  668. package/dist/modes/interactive/components/chat-session-host-state.js.map +1 -1
  669. package/dist/modes/interactive/components/chat-session-host-types.d.ts +10 -0
  670. package/dist/modes/interactive/components/chat-session-host-types.d.ts.map +1 -1
  671. package/dist/modes/interactive/components/chat-session-host-types.js.map +1 -1
  672. package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
  673. package/dist/modes/interactive/components/compaction-boundary-message.js +2 -1
  674. package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
  675. package/dist/modes/interactive/components/custom-message.d.ts +3 -1
  676. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  677. package/dist/modes/interactive/components/custom-message.js +9 -2
  678. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  679. package/dist/modes/interactive/components/extension-editor.d.ts +3 -2
  680. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  681. package/dist/modes/interactive/components/extension-editor.js +14 -43
  682. package/dist/modes/interactive/components/extension-editor.js.map +1 -1
  683. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  684. package/dist/modes/interactive/components/scoped-models-selector.js +18 -13
  685. package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
  686. package/dist/modes/interactive/components/startup-identity.d.ts +22 -0
  687. package/dist/modes/interactive/components/startup-identity.d.ts.map +1 -0
  688. package/dist/modes/interactive/components/startup-identity.js +58 -0
  689. package/dist/modes/interactive/components/startup-identity.js.map +1 -0
  690. package/dist/modes/interactive/components/tree-selector-content.d.ts.map +1 -1
  691. package/dist/modes/interactive/components/tree-selector-content.js +0 -6
  692. package/dist/modes/interactive/components/tree-selector-content.js.map +1 -1
  693. package/dist/modes/interactive/components/tree-selector-model.d.ts.map +1 -1
  694. package/dist/modes/interactive/components/tree-selector-model.js +0 -1
  695. package/dist/modes/interactive/components/tree-selector-model.js.map +1 -1
  696. package/dist/modes/interactive/components/working-status.d.ts +5 -11
  697. package/dist/modes/interactive/components/working-status.d.ts.map +1 -1
  698. package/dist/modes/interactive/components/working-status.js +14 -15
  699. package/dist/modes/interactive/components/working-status.js.map +1 -1
  700. package/dist/modes/interactive/external-editor.d.ts +23 -0
  701. package/dist/modes/interactive/external-editor.d.ts.map +1 -0
  702. package/dist/modes/interactive/external-editor.js +120 -0
  703. package/dist/modes/interactive/external-editor.js.map +1 -0
  704. package/dist/modes/interactive/interactive-agent-events.js +25 -20
  705. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  706. package/dist/modes/interactive/interactive-auth-login.js +16 -6
  707. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  708. package/dist/modes/interactive/interactive-auth-routing.js +3 -0
  709. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  710. package/dist/modes/interactive/interactive-bash-compact.d.ts +2 -1
  711. package/dist/modes/interactive/interactive-bash-compact.d.ts.map +1 -1
  712. package/dist/modes/interactive/interactive-bash-compact.js +8 -0
  713. package/dist/modes/interactive/interactive-bash-compact.js.map +1 -1
  714. package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
  715. package/dist/modes/interactive/interactive-deferred-startup.js +49 -19
  716. package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
  717. package/dist/modes/interactive/interactive-editor-actions.js +4 -3
  718. package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
  719. package/dist/modes/interactive/interactive-extension-dialogs.js +1 -1
  720. package/dist/modes/interactive/interactive-extension-dialogs.js.map +1 -1
  721. package/dist/modes/interactive/interactive-extension-runtime.js +3 -2
  722. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  723. package/dist/modes/interactive/interactive-initial-session-binding.d.ts +4 -0
  724. package/dist/modes/interactive/interactive-initial-session-binding.d.ts.map +1 -0
  725. package/dist/modes/interactive/interactive-initial-session-binding.js +23 -0
  726. package/dist/modes/interactive/interactive-initial-session-binding.js.map +1 -0
  727. package/dist/modes/interactive/interactive-input-handling.d.ts +2 -1
  728. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  729. package/dist/modes/interactive/interactive-input-handling.js +27 -51
  730. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  731. package/dist/modes/interactive/interactive-mode-base.d.ts +11 -7
  732. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  733. package/dist/modes/interactive/interactive-mode-base.js +14 -6
  734. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  735. package/dist/modes/interactive/interactive-mode-deps.d.ts +2 -4
  736. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  737. package/dist/modes/interactive/interactive-mode-deps.js +2 -4
  738. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  739. package/dist/modes/interactive/interactive-mode-surface.d.ts +9 -8
  740. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  741. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  742. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  743. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  744. package/dist/modes/interactive/interactive-mode.js +1 -0
  745. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  746. package/dist/modes/interactive/interactive-model-catalog-startup.d.ts +2 -3
  747. package/dist/modes/interactive/interactive-model-catalog-startup.d.ts.map +1 -1
  748. package/dist/modes/interactive/interactive-model-catalog-startup.js +3 -6
  749. package/dist/modes/interactive/interactive-model-catalog-startup.js.map +1 -1
  750. package/dist/modes/interactive/interactive-model-routing.js +26 -97
  751. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  752. package/dist/modes/interactive/interactive-pause.d.ts +4 -0
  753. package/dist/modes/interactive/interactive-pause.d.ts.map +1 -0
  754. package/dist/modes/interactive/interactive-pause.js +8 -0
  755. package/dist/modes/interactive/interactive-pause.js.map +1 -0
  756. package/dist/modes/interactive/interactive-process-lifecycle.js +5 -4
  757. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  758. package/dist/modes/interactive/interactive-prompt-turn.d.ts +2 -0
  759. package/dist/modes/interactive/interactive-prompt-turn.d.ts.map +1 -0
  760. package/dist/modes/interactive/interactive-prompt-turn.js +41 -0
  761. package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -0
  762. package/dist/modes/interactive/interactive-render-chat.js +20 -8
  763. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  764. package/dist/modes/interactive/interactive-resource-paths.js +11 -2
  765. package/dist/modes/interactive/interactive-resource-paths.js.map +1 -1
  766. package/dist/modes/interactive/interactive-resource-rendering.js +99 -0
  767. package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
  768. package/dist/modes/interactive/interactive-session-runtime.js +1 -1
  769. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  770. package/dist/modes/interactive/interactive-slash-commands.js +1 -1
  771. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  772. package/dist/modes/interactive/interactive-startup-chat-container.d.ts +20 -0
  773. package/dist/modes/interactive/interactive-startup-chat-container.d.ts.map +1 -0
  774. package/dist/modes/interactive/interactive-startup-chat-container.js +26 -0
  775. package/dist/modes/interactive/interactive-startup-chat-container.js.map +1 -0
  776. package/dist/modes/interactive/interactive-startup.d.ts +1 -1
  777. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  778. package/dist/modes/interactive/interactive-startup.js +30 -25
  779. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  780. package/dist/modes/interactive/interactive-summarization-retry-events.d.ts.map +1 -1
  781. package/dist/modes/interactive/interactive-summarization-retry-events.js +9 -3
  782. package/dist/modes/interactive/interactive-summarization-retry-events.js.map +1 -1
  783. package/dist/modes/interactive/theme/catppuccin-frappe.json +1 -1
  784. package/dist/modes/interactive/theme/catppuccin-latte.json +1 -1
  785. package/dist/modes/interactive/theme/catppuccin-macchiato.json +1 -1
  786. package/dist/modes/interactive/theme/catppuccin-mocha.json +9 -1
  787. package/dist/modes/interactive/theme/dark.json +1 -1
  788. package/dist/modes/interactive/theme/light.json +1 -1
  789. package/dist/modes/interactive/theme/theme-class.d.ts +4 -0
  790. package/dist/modes/interactive/theme/theme-class.d.ts.map +1 -1
  791. package/dist/modes/interactive/theme/theme-class.js +7 -0
  792. package/dist/modes/interactive/theme/theme-class.js.map +1 -1
  793. package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
  794. package/dist/modes/interactive/theme/theme-loading.js +4 -0
  795. package/dist/modes/interactive/theme/theme-loading.js.map +1 -1
  796. package/dist/modes/interactive/theme/theme-schema.d.ts +32 -0
  797. package/dist/modes/interactive/theme/theme-schema.d.ts.map +1 -1
  798. package/dist/modes/interactive/theme/theme-schema.js +8 -0
  799. package/dist/modes/interactive/theme/theme-schema.js.map +1 -1
  800. package/dist/modes/interactive/theme/theme-schema.json +15 -2
  801. package/dist/modes/interactive/whimsical-messages.d.ts +1 -0
  802. package/dist/modes/interactive/whimsical-messages.d.ts.map +1 -1
  803. package/dist/modes/interactive/whimsical-messages.js +2 -2
  804. package/dist/modes/interactive/whimsical-messages.js.map +1 -1
  805. package/dist/modes/interactive-engine/create-isolated-runtime.d.ts.map +1 -1
  806. package/dist/modes/interactive-engine/create-isolated-runtime.js +3 -1
  807. package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -1
  808. package/dist/modes/interactive-engine/engine-args.d.ts.map +1 -1
  809. package/dist/modes/interactive-engine/engine-args.js +0 -1
  810. package/dist/modes/interactive-engine/engine-args.js.map +1 -1
  811. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  812. package/dist/modes/interactive-engine/engine-custom-ui.js +5 -17
  813. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  814. package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
  815. package/dist/modes/interactive-engine/engine-render-service.js +8 -19
  816. package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
  817. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +2 -0
  818. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
  819. package/dist/modes/interactive-engine/extension-ui-bridge.js +3 -0
  820. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
  821. package/dist/modes/interactive-engine/isolated-auth.d.ts +10 -0
  822. package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -0
  823. package/dist/modes/interactive-engine/isolated-auth.js +14 -0
  824. package/dist/modes/interactive-engine/isolated-auth.js.map +1 -0
  825. package/dist/modes/interactive-engine/isolated-runtime.d.ts +9 -1
  826. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  827. package/dist/modes/interactive-engine/isolated-runtime.js +46 -34
  828. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  829. package/dist/modes/interactive-engine/protocol.d.ts +1 -1
  830. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  831. package/dist/modes/interactive-engine/protocol.js +3 -10
  832. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  833. package/dist/modes/interactive-engine/remote-model-catalog.d.ts +1 -0
  834. package/dist/modes/interactive-engine/remote-model-catalog.d.ts.map +1 -1
  835. package/dist/modes/interactive-engine/remote-model-catalog.js +10 -1
  836. package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
  837. package/dist/modes/interactive-engine/remote-queue-pause.d.ts +13 -0
  838. package/dist/modes/interactive-engine/remote-queue-pause.d.ts.map +1 -0
  839. package/dist/modes/interactive-engine/remote-queue-pause.js +38 -0
  840. package/dist/modes/interactive-engine/remote-queue-pause.js.map +1 -0
  841. package/dist/modes/interactive-engine/remote-renderer.d.ts +3 -1
  842. package/dist/modes/interactive-engine/remote-renderer.d.ts.map +1 -1
  843. package/dist/modes/interactive-engine/remote-renderer.js +4 -1
  844. package/dist/modes/interactive-engine/remote-renderer.js.map +1 -1
  845. package/dist/modes/print-mode.d.ts.map +1 -1
  846. package/dist/modes/print-mode.js +5 -0
  847. package/dist/modes/print-mode.js.map +1 -1
  848. package/dist/modes/rpc/jsonl.d.ts +2 -7
  849. package/dist/modes/rpc/jsonl.d.ts.map +1 -1
  850. package/dist/modes/rpc/jsonl.js +7 -24
  851. package/dist/modes/rpc/jsonl.js.map +1 -1
  852. package/dist/modes/rpc/queued-writer.d.ts +19 -0
  853. package/dist/modes/rpc/queued-writer.d.ts.map +1 -0
  854. package/dist/modes/rpc/{bounded-writer.js → queued-writer.js} +7 -30
  855. package/dist/modes/rpc/queued-writer.js.map +1 -0
  856. package/dist/modes/rpc/rpc-bash-request-owners.d.ts +24 -0
  857. package/dist/modes/rpc/rpc-bash-request-owners.d.ts.map +1 -0
  858. package/dist/modes/rpc/rpc-bash-request-owners.js +45 -0
  859. package/dist/modes/rpc/rpc-bash-request-owners.js.map +1 -0
  860. package/dist/modes/rpc/rpc-client-api.d.ts +8 -5
  861. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  862. package/dist/modes/rpc/rpc-client-api.js +10 -11
  863. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  864. package/dist/modes/rpc/rpc-client-process.d.ts +1 -4
  865. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
  866. package/dist/modes/rpc/rpc-client-process.js +2 -14
  867. package/dist/modes/rpc/rpc-client-process.js.map +1 -1
  868. package/dist/modes/rpc/rpc-client.d.ts +8 -4
  869. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  870. package/dist/modes/rpc/rpc-client.js +21 -30
  871. package/dist/modes/rpc/rpc-client.js.map +1 -1
  872. package/dist/modes/rpc/rpc-command-handler.d.ts +7 -4
  873. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  874. package/dist/modes/rpc/rpc-command-handler.js +76 -93
  875. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  876. package/dist/modes/rpc/rpc-input-scheduler.d.ts +3 -3
  877. package/dist/modes/rpc/rpc-input-scheduler.d.ts.map +1 -1
  878. package/dist/modes/rpc/rpc-input-scheduler.js +7 -4
  879. package/dist/modes/rpc/rpc-input-scheduler.js.map +1 -1
  880. package/dist/modes/rpc/rpc-mode.d.ts +1 -1
  881. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  882. package/dist/modes/rpc/rpc-mode.js +5 -5
  883. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  884. package/dist/modes/rpc/rpc-model-fallback-prompt.d.ts +4 -0
  885. package/dist/modes/rpc/rpc-model-fallback-prompt.d.ts.map +1 -0
  886. package/dist/modes/rpc/rpc-model-fallback-prompt.js +11 -0
  887. package/dist/modes/rpc/rpc-model-fallback-prompt.js.map +1 -0
  888. package/dist/modes/rpc/rpc-oauth-client.d.ts +22 -0
  889. package/dist/modes/rpc/rpc-oauth-client.d.ts.map +1 -0
  890. package/dist/modes/rpc/rpc-oauth-client.js +74 -0
  891. package/dist/modes/rpc/rpc-oauth-client.js.map +1 -0
  892. package/dist/modes/rpc/rpc-oauth-interaction.d.ts +9 -0
  893. package/dist/modes/rpc/rpc-oauth-interaction.d.ts.map +1 -0
  894. package/dist/modes/rpc/rpc-oauth-interaction.js +49 -0
  895. package/dist/modes/rpc/rpc-oauth-interaction.js.map +1 -0
  896. package/dist/modes/rpc/rpc-output-buffer.d.ts +2 -1
  897. package/dist/modes/rpc/rpc-output-buffer.d.ts.map +1 -1
  898. package/dist/modes/rpc/rpc-output-buffer.js +4 -39
  899. package/dist/modes/rpc/rpc-output-buffer.js.map +1 -1
  900. package/dist/modes/rpc/rpc-provider-auth.d.ts +23 -0
  901. package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -0
  902. package/dist/modes/rpc/rpc-provider-auth.js +145 -0
  903. package/dist/modes/rpc/rpc-provider-auth.js.map +1 -0
  904. package/dist/modes/rpc/rpc-responses.d.ts +0 -1
  905. package/dist/modes/rpc/rpc-responses.d.ts.map +1 -1
  906. package/dist/modes/rpc/rpc-responses.js +0 -14
  907. package/dist/modes/rpc/rpc-responses.js.map +1 -1
  908. package/dist/modes/rpc/rpc-types.d.ts +83 -27
  909. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  910. package/dist/modes/rpc/rpc-types.js.map +1 -1
  911. package/dist/utils/clipboard.d.ts.map +1 -1
  912. package/dist/utils/clipboard.js +21 -8
  913. package/dist/utils/clipboard.js.map +1 -1
  914. package/dist/utils/version-check.d.ts.map +1 -1
  915. package/dist/utils/version-check.js +3 -1
  916. package/dist/utils/version-check.js.map +1 -1
  917. package/docs/changelog.mdx +12 -1
  918. package/docs/compaction.md +101 -18
  919. package/docs/custom-provider.md +13 -4
  920. package/docs/docs.json +1 -0
  921. package/docs/environment-variables.md +37 -0
  922. package/docs/extensions.md +45 -9
  923. package/docs/index.md +1 -0
  924. package/docs/intercom.md +1 -1
  925. package/docs/json.md +4 -4
  926. package/docs/keybindings.md +4 -2
  927. package/docs/llama-cpp.md +3 -1
  928. package/docs/models.md +29 -43
  929. package/docs/providers.md +18 -24
  930. package/docs/quickstart.md +19 -16
  931. package/docs/rpc.md +38 -85
  932. package/docs/sdk.md +15 -22
  933. package/docs/session-format.md +2 -15
  934. package/docs/sessions.md +1 -1
  935. package/docs/settings.md +10 -15
  936. package/docs/skills.md +8 -0
  937. package/docs/subagents.md +24 -8
  938. package/docs/themes.md +10 -1
  939. package/docs/tui.md +3 -3
  940. package/docs/usage.md +30 -2
  941. package/docs/windows.md +1 -1
  942. package/docs/workflows.md +1128 -522
  943. package/examples/extensions/README.md +1 -1
  944. package/examples/extensions/handoff.ts +8 -1
  945. package/examples/extensions/message-renderer.ts +2 -2
  946. package/examples/extensions/summarize.ts +3 -0
  947. package/examples/extensions/working-indicator.ts +2 -2
  948. package/npm-shrinkwrap.json +40 -46
  949. package/package.json +9 -7
  950. package/dist/builtin/cursor/CHANGELOG.md +0 -281
  951. package/dist/builtin/cursor/LICENSE +0 -26
  952. package/dist/builtin/cursor/README.md +0 -24
  953. package/dist/builtin/cursor/index.ts +0 -9
  954. package/dist/builtin/cursor/package.json +0 -47
  955. package/dist/builtin/cursor/src/auth.ts +0 -352
  956. package/dist/builtin/cursor/src/catalog-cache.ts +0 -155
  957. package/dist/builtin/cursor/src/config.ts +0 -123
  958. package/dist/builtin/cursor/src/conversation-state.ts +0 -135
  959. package/dist/builtin/cursor/src/cursor-models-raw.json +0 -412
  960. package/dist/builtin/cursor/src/model-mapper.ts +0 -369
  961. package/dist/builtin/cursor/src/model-reference.ts +0 -282
  962. package/dist/builtin/cursor/src/models.ts +0 -54
  963. package/dist/builtin/cursor/src/native-loader.ts +0 -71
  964. package/dist/builtin/cursor/src/proto/README.md +0 -34
  965. package/dist/builtin/cursor/src/proto/agent_pb.ts +0 -15294
  966. package/dist/builtin/cursor/src/proto/protobuf-codec-base64.ts +0 -22
  967. package/dist/builtin/cursor/src/proto/protobuf-codec-json.ts +0 -44
  968. package/dist/builtin/cursor/src/proto/protobuf-codec-request.ts +0 -311
  969. package/dist/builtin/cursor/src/proto/protobuf-codec-wire.ts +0 -248
  970. package/dist/builtin/cursor/src/proto/protobuf-codec.ts +0 -200
  971. package/dist/builtin/cursor/src/provider.ts +0 -301
  972. package/dist/builtin/cursor/src/stream.ts +0 -494
  973. package/dist/builtin/cursor/src/transport-errors.ts +0 -74
  974. package/dist/builtin/cursor/src/transport-frame.ts +0 -56
  975. package/dist/builtin/cursor/src/transport-http2.ts +0 -122
  976. package/dist/builtin/cursor/src/transport-native-client.ts +0 -161
  977. package/dist/builtin/cursor/src/transport-run-stream.ts +0 -188
  978. package/dist/builtin/cursor/src/transport-timeouts.ts +0 -87
  979. package/dist/builtin/cursor/src/transport-types.ts +0 -143
  980. package/dist/builtin/cursor/src/transport.ts +0 -26
  981. package/dist/builtin/workflows/builtin/deep-research-codebase-runner.ts +0 -492
  982. package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +0 -383
  983. package/dist/builtin/workflows/builtin/deep-research-codebase.d.ts +0 -35
  984. package/dist/builtin/workflows/builtin/deep-research-codebase.ts +0 -47
  985. package/dist/builtin/workflows/skills/impeccable/scripts/hook-before-edit.mjs +0 -516
  986. package/dist/core/context-window.d.ts +0 -54
  987. package/dist/core/context-window.d.ts.map +0 -1
  988. package/dist/core/context-window.js +0 -110
  989. package/dist/core/context-window.js.map +0 -1
  990. package/dist/core/copilot-anthropic-sse-repair.d.ts +0 -23
  991. package/dist/core/copilot-anthropic-sse-repair.d.ts.map +0 -1
  992. package/dist/core/copilot-anthropic-sse-repair.js +0 -340
  993. package/dist/core/copilot-anthropic-sse-repair.js.map +0 -1
  994. package/dist/core/copilot-errors.d.ts +0 -9
  995. package/dist/core/copilot-errors.d.ts.map +0 -1
  996. package/dist/core/copilot-errors.js +0 -32
  997. package/dist/core/copilot-errors.js.map +0 -1
  998. package/dist/core/copilot-gemini-payload-sanitizer.d.ts +0 -72
  999. package/dist/core/copilot-gemini-payload-sanitizer.d.ts.map +0 -1
  1000. package/dist/core/copilot-gemini-payload-sanitizer.js +0 -296
  1001. package/dist/core/copilot-gemini-payload-sanitizer.js.map +0 -1
  1002. package/dist/core/copilot-gemini-reasoning.d.ts +0 -126
  1003. package/dist/core/copilot-gemini-reasoning.d.ts.map +0 -1
  1004. package/dist/core/copilot-gemini-reasoning.js +0 -265
  1005. package/dist/core/copilot-gemini-reasoning.js.map +0 -1
  1006. package/dist/core/copilot-gemini-tool-arguments.d.ts +0 -42
  1007. package/dist/core/copilot-gemini-tool-arguments.d.ts.map +0 -1
  1008. package/dist/core/copilot-gemini-tool-arguments.js +0 -159
  1009. package/dist/core/copilot-gemini-tool-arguments.js.map +0 -1
  1010. package/dist/core/copilot-hosts.d.ts +0 -12
  1011. package/dist/core/copilot-hosts.d.ts.map +0 -1
  1012. package/dist/core/copilot-hosts.js +0 -33
  1013. package/dist/core/copilot-hosts.js.map +0 -1
  1014. package/dist/core/copilot-model-catalog.d.ts +0 -114
  1015. package/dist/core/copilot-model-catalog.d.ts.map +0 -1
  1016. package/dist/core/copilot-model-catalog.js +0 -392
  1017. package/dist/core/copilot-model-catalog.js.map +0 -1
  1018. package/dist/core/copilot-model-static-fallbacks.d.ts +0 -43
  1019. package/dist/core/copilot-model-static-fallbacks.d.ts.map +0 -1
  1020. package/dist/core/copilot-model-static-fallbacks.js +0 -50
  1021. package/dist/core/copilot-model-static-fallbacks.js.map +0 -1
  1022. package/dist/core/copilot-model-synthesis.d.ts +0 -10
  1023. package/dist/core/copilot-model-synthesis.d.ts.map +0 -1
  1024. package/dist/core/copilot-model-synthesis.js +0 -91
  1025. package/dist/core/copilot-model-synthesis.js.map +0 -1
  1026. package/dist/modes/interactive/components/context-window-selector.d.ts +0 -53
  1027. package/dist/modes/interactive/components/context-window-selector.d.ts.map +0 -1
  1028. package/dist/modes/interactive/components/context-window-selector.js +0 -136
  1029. package/dist/modes/interactive/components/context-window-selector.js.map +0 -1
  1030. package/dist/modes/rpc/bounded-writer.d.ts +0 -27
  1031. package/dist/modes/rpc/bounded-writer.d.ts.map +0 -1
  1032. package/dist/modes/rpc/bounded-writer.js.map +0 -1
@@ -2,13 +2,15 @@
2
2
 
3
3
  LLMs have finite context windows. Atomic reduces transcript context with **verbatim line compaction** while preserving an exact count of recent context-visible messages as ordinary messages. Branch summarization is a separate, intentionally lossy feature used only when navigating away from a branch.
4
4
 
5
- Compaction runs entirely locally with the active session model; no external compaction service is involved. The model only selects which lines to delete — Atomic reconstructs the retained text mechanically, so surviving lines are never rewritten.
5
+ Compaction runs entirely locally; no external compaction service is involved. It normally uses the active session model. If that model cannot rank the lines — a rate limit, a quota exhaustion, a provider error, a context overflow, or an empty plan — Atomic *borrows* the next model from your configured `fallbackModels` for that one planner request. **A configured fallback model may therefore receive the compaction transcript**, and it is sent with that provider's own credentials. Borrowing never changes the session's model or thinking level. The model only selects which lines to delete — Atomic reconstructs the retained text mechanically, so surviving lines are never rewritten.
6
6
 
7
7
  ## Overview
8
8
 
9
9
  | Mechanism | Trigger | Model output | Durable result |
10
10
  |---|---|---|---|
11
11
  | Verbatim compaction | `/compact`, RPC `compact`, or automatic threshold/overflow recovery | Bare `start,end` deletion records (one per line) | A `CompactionEntry` whose `summary` is mechanically reconstructed transcript text |
12
+ | Planner fallback borrowing | Any terminal planner outcome on the current planner model | Same deletion records, from a configured `fallbackModels` entry | The same `"planned"` boundary, with `details.plannerModel` naming the borrowed model |
13
+ | Fresh context window | Load-bearing compaction after every configured model failed | *(none — no model call)* | A `CompactionEntry` with `details.rung: "fresh"` |
12
14
  | Branch summarization | Optional `/tree` navigation | Generated summary prose | A `BranchSummaryEntry` |
13
15
 
14
16
  There is one context-compaction door: `compact`.
@@ -62,7 +64,7 @@ The effective parameters appear in extension events and successful results:
62
64
  | `preserve_recent` | `2` | Exact number of newest context-visible messages protected client-side |
63
65
  | `query` | Last visible user message | Relevance focus for deciding which older lines to retain |
64
66
 
65
- `preserve_recent` counts context-visible messages without aligning the boundary to a user turn. An assistant message or tool result may therefore begin the kept tail. A value of `0` protects no messages and makes the entire active transcript compactable. If `query` is absent, Atomic derives it from the last visible user message.
67
+ `preserve_recent` counts context-visible messages without aligning the boundary to a user turn. An assistant message or tool result may therefore begin the kept tail. Because such a tail can start or end mid-turn, the kept messages are not replayed as structured message blocks: they are serialized with the same transcript grammar as the compacted region and appended to the end of the boundary string, so the whole boundary reaches the provider as one message. Serialization of the kept tail is lossless — tool results keep their full text instead of being truncated at 16k characters, and images stay attached as image blocks rather than becoming `[image]` markers — so protected content is preserved, not merely summarized. A value of `0` protects no messages and makes the entire active transcript compactable. If `query` is absent, Atomic derives it from the last visible user message.
66
68
 
67
69
  Configure defaults in `~/.atomic/agent/settings.json` or `.atomic/settings.json`:
68
70
 
@@ -86,21 +88,80 @@ Configure defaults in `~/.atomic/agent/settings.json` or `.atomic/settings.json`
86
88
  - **Threshold:** automatic compaction starts when estimated context usage exceeds the effective input budget minus `reserveTokens`. Atomic checks both completed responses and the prospective next-turn context after tool results have been appended. A post-tool crossing is compacted before the active Pi tool loop sends its follow-up provider request.
87
89
  - **Overflow:** an actual provider context overflow compacts and then retries the interrupted turn.
88
90
 
89
- Exactly the configured recent-message tail is outside the compactable region; Atomic does not force the final logical turn to remain outside it. Pressing Escape while compaction is active cancels it like other session operations. In isolated interactive mode, cancellation and host UI response frames use an independent RPC control lane, so they can reach the engine while the ordinary `compact` request is still pending instead of waiting behind it. Atomic writes a backup snapshot immediately before appending a compaction boundary.
91
+ Exactly the configured recent-message tail is outside the compactable region; Atomic does not force the final logical turn to remain outside it. After successful automatic compaction, input queued before compaction started resumes automatically once the active run becomes idle; pressing Escape is not required to release it. Pressing Escape while compaction is active cancels it like other session operations. In isolated interactive mode, cancellation and host UI response frames use an independent RPC control lane, so they can reach the engine while the ordinary `compact` request is still pending instead of waiting behind it. Atomic writes a backup snapshot immediately before appending a compaction boundary.
90
92
 
91
- The post-tool check stays inside the active Pi loop: it runs at most one ordinary verbatim compaction attempt for that completed tool turn, returns the rebuilt context to the loop, and never calls or schedules `agent.continue()`. Normal context reconstruction preserves provider tool-call/result protocol validity. Below-threshold tool turns follow the unchanged request path. Because the same active run resumes without emitting another `agent_start`, the interactive TUI replaces the compaction loader with its working spinner as soon as successful mid-turn compaction ends; streaming feedback therefore resumes immediately without waiting for another user interaction.
93
+ Manual compaction is single-flight. A manual request made while another manual compaction is still in flight joins that run and receives its result instead of starting a second model call, so it emits no extra `compaction_start`/`compaction_end` pair and appends no extra boundary; `abortCompaction()` (Escape) still cancels the single owning run for every waiter. A manual request made while an automatic compaction is in flight is rejected immediately with an "automatic compaction is already in progress" error rather than racing it. In the interactive TUI, `/compact` typed while any compaction is active is refused with a warning; it is not queued, because queueing would only defer a duplicate compaction. Ordinary text typed during compaction is still queued as usual.
92
94
 
93
- ## One-pass planning and failure behavior
95
+ The post-tool check stays inside the active Pi loop: it runs the rung ladder once for that completed tool turn, returns the rebuilt context to the loop, and never calls or schedules `agent.continue()`. Normal context reconstruction preserves provider tool-call/result protocol validity. Below-threshold tool turns follow the unchanged request path. Because the same active run resumes without emitting another `agent_start`, the interactive TUI replaces the compaction loader with its working spinner as soon as successful mid-turn compaction ends; streaming feedback therefore resumes immediately without waiting for another user interaction.
94
96
 
95
- Atomic asks the active session model, at the active reasoning level and through the normal session stream/provider wrapper, to rank every eligible line in one global pass and apply one threshold. The entire compactable region is sent in exactly one classifier request; it is never split into chunks. Manual, threshold, and overflow compaction all calculate the line target directly from the prepared `compression_ratio`. Explicit protected lines form a hard keep floor.
97
+ ## Planning rungs and failure behavior
96
98
 
97
- The request uses the same provider path and failure handling as pi's summary compaction. Provider/API errors, overflow, abort, malformed output, or empty/unusable safe ranges fail after that one request. These failures write no compaction entry and schedule no continuation. During the post-tool preflight, failure or cancellation also stops the active loop before its follow-up provider request, is surfaced through the normal compaction lifecycle, and is not admitted to ordinary provider retry or model fallback. There is no semantic retry, critical rung, deterministic fallback, or deterministic target correction.
99
+ Atomic asks a planner model, at the inherited session reasoning level and through the normal session stream/provider wrapper, to rank every eligible line in one global pass and apply one threshold. The entire compactable region is sent in one classifier request; it is never split into chunks. Manual, threshold, and overflow compaction all calculate the line target directly from the prepared `compression_ratio`. Explicit protected lines form a hard keep floor.
98
100
 
99
- A syntactically valid usable result is accepted once after safety-only normalization, even when it deletes fewer lines or tokens than requested. Atomic never adds or restores model-selected deletions to force a target. During overflow recovery, the existing one-shot compact-and-retry continuation may therefore surface unresolved overflow naturally. During a post-tool preflight, Atomic likewise does not add a second compaction strategy or attempt; if the rebuilt context is still known to exceed the provider's hard input limit, it refuses to send the follow-up request and reports the limit failure clearly.
101
+ **The planner sends no output cap.** Only the provider's own context clamp bounds the response, so reasoning tokens cannot crowd out the deletion records. The reasoning level is inherited from the session and is never modified between attempts; a `model:level` suffix on a `fallbackModels` entry sets the level for that candidate only.
102
+
103
+ Each planner attempt ends in exactly one typed outcome:
104
+
105
+ | Outcome | Meaning | What happens next |
106
+ |---|---|---|
107
+ | ranked | Valid deletion records | Boundary written, `rung: "planned"` |
108
+ | recovered | A length-truncated response with usable complete records | Boundary written silently, `rung: "planned"` |
109
+ | overflowed | The planner request itself exceeded the context window, including a silent overflow that arrives as an ordinary `stop` or `length` completion whose usage already exceeds the window — classified before the response text is parsed, so valid-looking records or truncation recovery cannot mask it | The oldest region lines are withheld and the *same* model retried, repeatedly, until no strictly smaller view remains; the withheld head becomes a deterministic deletion |
110
+ | rateLimited | A limit failure. `category` says which one — `rate_limited` for `429`/rate limit/overloaded/any `5xx`, `quota` for quota, billing, or usage-limit exhaustion — and `exhausted` separately reports whether a retry was actually scheduled | Advance to the next configured model |
111
+ | unusable | Malformed output, no usable safe ranges, or reasoning starvation (`starved`) | Advance to the next configured model |
112
+ | providerError | Any other provider or transport failure | Advance to the next configured model |
113
+
114
+ Each trimmed retry halves the remaining suffix, so the walk is finite, and each view
115
+ derives its own keep target from `compression_ratio`. Carrying the original
116
+ whole-preparation target into a smaller view would ask it to keep every visible
117
+ line — a request for zero deletions, whose obedient empty answer then hits the
118
+ zero-usable-ranges rejection. The planner
119
+ door returns validated line numbers, so no unvalidated model output leaves it,
120
+ and the runner still validates once more before writing a boundary.
121
+
122
+ Generic usage-limit wording, such as `The usage limit has been reached`, is
123
+ classified as quota exhaustion (`exhausted: false`). That is a deliberate local
124
+ addition rather than a copy of pi-ai's tables: pi-ai lists it in neither its
125
+ retryable nor its non-retryable set, so it never spends a backoff, and reporting
126
+ it as transient throttling would claim a retry budget that was never used.
127
+
128
+ Unavailable credentials are ladder control flow, not an early failure. If the
129
+ session model has no usable credentials, no request is attempted for it, that
130
+ candidate is marked attempted, and a configured fallback with its own working
131
+ credentials can still rank the lines. A load-bearing caller with no usable
132
+ credentials anywhere still reaches the credential-free fresh rung; a recoverable
133
+ caller reports the original authentication error and writes nothing.
134
+
135
+ `settings.retry` still governs transport attempts *within* one candidate, with its existing backoff. When a candidate is exhausted, Atomic borrows the next entry from `settings.fallbackModels`, resolving that candidate's own credentials. Each candidate is tried at most once per compaction run, in configured order, keyed by `provider/model:thinkingLevel`. That walk is one monotonic pass over the configured list. Each position is inspected at most once — whether it fails to resolve to a model, has no usable credentials, duplicates an earlier identity, or yields a planner — so the order can never rewind to an earlier entry even if the registry or its credentials later change.
136
+
137
+ Borrowing never mutates the session: no `agent.state.model` write, no model-change or thinking-level entry, no system-prompt refresh, no `model_changed`/`model_select`/`model_fallback_start`, and no `agent.continue()`. After compaction returns, `session.model` is exactly what it was before, and the main chat's own fallback bookkeeping is untouched.
138
+
139
+ When every configured model is exhausted, what happens depends on how much the caller can afford to lose:
140
+
141
+ | Call site | Urgency | Can borrow a model | Can start a fresh context window |
142
+ |---|---|---|---|
143
+ | `/compact`, `ctx.compact()`, `session.compact()`, RPC `compact` | recoverable | yes | no |
144
+ | Threshold auto-compaction | recoverable | yes | no |
145
+ | Overflow recovery | load-bearing | yes | yes |
146
+ | Post-tool preflight | load-bearing | yes | yes |
147
+
148
+ A recoverable compaction fails honestly: it writes no compaction entry, schedules no continuation, and reports the typed cause through `compaction_end`. Manual compaction's recoverable urgency is fixed at the door: `session.compact()` projects only compaction parameters, so no runtime property on a caller-supplied object can raise it to `load_bearing` and reach the destructive rung. A load-bearing compaction always completes, falling through to the **fresh context window** rung described below.
149
+
150
+ A syntactically valid usable result is accepted once after safety-only normalization, even when it deletes fewer lines or tokens than requested. Atomic never adds or restores model-selected deletions to force a target. During overflow recovery, the existing one-shot compact-and-retry continuation may therefore surface unresolved overflow naturally.
151
+
152
+ ### The fresh context window rung
153
+
154
+ `startNewContextWindow` is total: no provider, no credentials, no network, no failure mode. A region below the planner minimum reaches it only when the context is already known not to fit — overflow recovery, or a post-tool preflight whose projected context is over the provider hard input limit — because no planner change could make such a region rankable. A post-tool threshold crossing that still fits is a safe no-op instead: no boundary, no planner call, and the follow-up request proceeds unchanged. Clearing a context that fits would destroy conversation for nothing. It discards the compactable region and any prior durable summary, keeps explicit protected spans, and keeps the `preserve_recent` protected tail — dropping the tail only when the tail **alone** exceeds the provider hard input limit, in which case the boundary persists `firstKeptEntryId: null`. It emits the whole region as one deletion range and hands it to the same validation and reconstruction path as every other rung, so retained lines stay byte-identical.
155
+
156
+ A committed fresh boundary stays visible even when the following provider hard-input-limit gate reports its own error: `compaction_end` carries `result` and `errorMessage` independently, and the boundary is shown before the status. The fresh rung destroys conversation, so it is loud: the boundary reads `✻ Context cleared (compaction degraded)` instead of `✻ Context compacted`, in the main chat and in attached workflow stage chat alike, and `details.rung` records `"fresh"` durably. The precise cause stays in the `0600` diagnostic sidecar.
157
+
158
+ The ladder guarantees that *compaction* completes. It does not guarantee the *turn* succeeds: if every configured model is rate limited, the follow-up request will be too. What it buys is that a compaction failure does not additionally destroy the turn, that a healthy fallback model rescues quality when one exists, and that the retry starts from a small context.
159
+
160
+ During a post-tool preflight, Atomic still gates the rebuilt context: if it is known to exceed the provider's hard input limit even after compaction, Atomic refuses to send the follow-up request and reports the limit failure clearly. The fresh rung's tail-dropping rule exists so that gate is reachable rather than hollow.
100
161
 
101
162
  ### Length-truncated response recovery
102
163
 
103
- When the planner model's output is truncated by `max_tokens` (indicated by `stopReason: "length"`), Atomic silently recovers complete newline-terminated deletion records from the truncated response. A deterministic line parser validates each completed line (those followed by a newline) against the strict `start,end` grammar. The final fragment after the last newline is always discarded — even if it looks syntactically complete — because EOF may have cut a multi-digit integer (e.g. `300,30` could have intended `300,305`). If any completed line has invalid syntax or zero usable records survive validation, recovery fails and the normal `RangePlanError` path applies.
164
+ When the planner model's output is truncated at the provider's own limit (indicated by `stopReason: "length"`), Atomic silently recovers complete newline-terminated deletion records from the truncated response. Atomic sends no `max_tokens` of its own, so this reflects the provider's context clamp rather than a caller-imposed cap. A deterministic line parser validates each completed line (those followed by a newline) against the strict `start,end` grammar. The final fragment after the last newline is always discarded — even if it looks syntactically complete — because EOF may have cut a multi-digit integer (e.g. `300,30` could have intended `300,305`). If any completed line has invalid syntax or zero usable records survive validation, the attempt becomes an `unusable` outcome and the ladder advances.
104
165
 
105
166
  Example of truncated output:
106
167
 
@@ -114,19 +175,19 @@ Recovery yields `120,180` and `6,40`; discards `300,` without guessing. The plan
114
175
 
115
176
  Successful partial recovery is an ordinary successful compaction: no warning, banner, toast, or special status copy appears. The UI shows the normal spinner then `✻ Context compacted`.
116
177
 
117
- For operational observability, a private recovery diagnostic sidecar is written beside persisted sessions with `0600` permissions. It records the full raw response, stop reason, usage, request `maxTokens`, model metadata, recovered range count, and recovery category. The sidecar path is never surfaced in the success UI, error messages, or user-visible status. In-memory sessions and sidecar write failures do not affect the successful recovery.
178
+ For operational observability, a private recovery diagnostic sidecar is written beside persisted sessions with `0600` permissions. It records the full raw response, stop reason, usage (including `usage.reasoning`), the request `maxTokens` (now always absent, since no cap is sent), model metadata, recovered range count, and recovery category. The sidecar path is never surfaced in the success UI, error messages, or user-visible status. In-memory sessions and sidecar write failures do not affect the successful recovery.
118
179
 
119
180
  ### Planner failure diagnostics
120
181
 
121
- For a persisted session, a failed planner call writes a JSON sidecar beside the session JSONL and includes its path in the `RangePlanError`, for example:
182
+ For a persisted session, each failed planner attempt writes its own JSON sidecar beside the session JSONL and carries the path on the typed outcome. When a recoverable compaction exhausts every configured model, the resulting `RangePlanError` includes that path, for example:
122
183
 
123
184
  ```text
124
- Compaction range planning returned malformed output (diagnostic: /path/session-compaction-diagnostic-….json)
185
+ Compaction range planning returned malformed output (diagnostic: /path/session-compaction-diagnostic-1785222000000-019fa7….json)
125
186
  ```
126
187
 
127
- The private sidecar uses `0600` permissions where supported and records the full planner response text, stop reason, provider error, usage, request `maxTokens`, timestamp, failure category, and non-secret model metadata. It does not record API keys, request headers, the planner prompt, or the numbered transcript request. The raw response itself may contain sensitive text if the model echoed input, so treat the sidecar with the same care as its adjacent session file.
188
+ The private sidecar uses `0600` permissions where supported and records the full planner response text, stop reason, provider error, usage, the request `maxTokens` (absent — no cap is sent), timestamp, failure category, and non-secret model metadata for **the model that made that attempt**, so a run rescued by a fallback leaves per-model evidence. It does not record API keys, request headers, the planner prompt, or the numbered transcript request. The raw response itself may contain sensitive text if the model echoed input, so treat the sidecar with the same care as its adjacent session file.
128
189
 
129
- Diagnostic categories distinguish malformed output, valid output with no usable ranges, provider errors, and stream failures. In-memory sessions do not create sidecars. If the diagnostic write fails, Atomic preserves the original error and classification rather than replacing the planner failure.
190
+ Diagnostic categories distinguish malformed output, valid output with no usable ranges, provider errors, stream failures, reasoning starvation (`starved`), transient rate limiting (`rate_limited`), quota exhaustion (`quota`), and context overflow (`context_overflow`) — overflow is a distinct typed outcome in code, so it is distinct in the durable record too rather than folded into a generic provider failure. When a *borrowed* fallback model produces the accepted ranking, a separate `<session>-compaction-success-<timestamp>-<id>.json` sidecar records that model and its effective thinking level, so a rescued run leaves evidence for both the model that failed and the model that succeeded. Quota, billing, and usage-limit exhaustion get their own `quota` category, so they stay distinguishable from transient throttling in the durable record and not only in provider text. A limit record additionally sets `rateLimitExhausted`, derived from observed retry activity: `true` only when a retry was actually scheduled, and `false` for quota or for a throttled request under a disabled or zero retry budget. Atomic classifies the whole HTTP `5xx` class as rate limiting, which is a local broadening — pi-ai lists only selected statuses, so it may schedule no backoff for one Atomic types this way, and `rateLimitExhausted` reports that fact rather than assuming it. Every sidecar filename carries both a timestamp and a per-attempt identifier, and is created exclusively, so two attempts inside the same millisecond — routine across overflow trims or a fast fallback walk — cannot overwrite each other's evidence. In-memory sessions do not create sidecars. If the diagnostic write fails, Atomic preserves the original classification rather than replacing the planner outcome.
130
191
 
131
192
  Interactive main chat and attached workflow stage chat treat `compaction_end` as the authority for cancellation and failure UI. A failed or cancelled `/compact` stops its spinner, shows the event-provided status or diagnostic path without a duplicate stack trace, writes no boundary, and leaves the session usable for another `/compact` attempt or a normal follow-up turn.
132
193
 
@@ -155,7 +216,20 @@ A successful run appends the existing pi-style `type:"compaction"` entry shape:
155
216
  }
156
217
  ```
157
218
 
158
- A `compaction` entry is active only when `details.strategy === "verbatim-lines"`. On rebuild, Atomic emits a visible custom-role boundary message containing the durable `summary`, followed by the original messages beginning at `firstKeptEntryId`. When no pre-boundary context-visible message is retained—such as with `preserve_recent: 0`—`firstKeptEntryId` is `null`. Messages appended after the boundary are always replayed. The boundary is converted to a user-role provider message and shown in the TUI as a collapsible compaction card.
219
+ `details.rung` is one of `"planned"` (a model ranked the lines the session model **or** a borrowed fallback, including silent partial recovery), `"extension"` (a `session_before_compact` override), or `"fresh"` (the compactable conversation was discarded and a new context window started). `details.plannerModel` is present **only** when a borrowed fallback model ranked the lines:
220
+
221
+ ```json
222
+ "details": {
223
+ "strategy": "verbatim-lines",
224
+ "promptVersion": 3,
225
+ "rung": "planned",
226
+ "plannerModel": {"provider": "openai", "id": "gpt-5.1", "thinkingLevel": "high"}
227
+ }
228
+ ```
229
+
230
+ There is no format-version bump and no new entry type. Both `"fresh"` and `plannerModel` are additive: they are absent on every existing entry and on any compaction that used the session model, so old readers are unaffected. A `"fresh"` boundary that had to drop the `preserve_recent` tail persists `firstKeptEntryId: null`.
231
+
232
+ A `compaction` entry is active only when `details.strategy === "verbatim-lines"`. On rebuild, Atomic emits one visible custom-role boundary message: the durable `summary` with the kept tail—the entries from `firstKeptEntryId` up to the boundary—serialized and concatenated onto its end. The tail is never restored as separate assistant/tool-result blocks, so a tail that starts or ends mid-turn cannot produce out-of-order provider blocks; images inside the tail ride along as image blocks on that same boundary message. When no pre-boundary context-visible message is retained—such as with `preserve_recent: 0`—`firstKeptEntryId` is `null` and the boundary carries the `summary` alone. Messages appended after the boundary are always replayed as real messages. The boundary is converted to a user-role provider message and shown in the TUI as a collapsible compaction card.
159
233
 
160
234
  Resume does not rerun planning or re-derive deletions: the exact compacted string and nullable tail boundary are already in JSONL. Existing records with a string `firstKeptEntryId` keep their original resume behavior. Legacy `context_compaction` logical-deletion records and old `compaction` summary records without the discriminator are inert archival data. Their historical omissions are not reapplied when an old session resumes.
161
235
 
@@ -185,8 +259,9 @@ After persistence, Atomic emits an observe-only event:
185
259
 
186
260
  ```typescript
187
261
  pi.on("session_compact", async (event) => {
188
- console.log(event.result.rung, event.result.stats);
189
- console.log(event.compactionEntry.details.strategy); // "verbatim-lines"
262
+ console.log(event.result.rung, event.result.stats); // rung: "planned" | "extension" | "fresh"
263
+ console.log(event.result.plannerModel); // set only when a fallback model was borrowed
264
+ console.log(event.compactionEntry.details.strategy); // "verbatim-lines"
190
265
  console.log(event.fromExtension);
191
266
  });
192
267
  ```
@@ -365,6 +440,12 @@ pi.on("session_before_tree", async (event, ctx) => {
365
440
 
366
441
  See `SessionBeforeTreeEvent` and `TreePreparation` in the types file.
367
442
 
443
+ ## Summary request isolation
444
+
445
+ Verbatim planning and branch summarization are standalone provider requests. Each receives a fresh routing session ID instead of reusing the chat's provider-affinity ID, and sets cache retention to `none` so it cannot write summary/planner prompts into the main prompt cache. Neither sends a `max_tokens` of its own. Existing API-key, header-only `ANTHROPIC_AUTH_TOKEN`, custom-header, abort, and bounded retry behavior still applies. These controls affect provider request routing/cache writes only; successful results are persisted through the normal Atomic session lifecycle.
446
+
447
+ **Isolation is per model, not per session.** When compaction borrows a fallback model, that request is built with the borrowed candidate's own API key, headers, and base URL; the session model's credentials are never sent to another provider. The corollary is a real data-flow change: **a model listed in `settings.fallbackModels` may receive the compaction transcript.** The list is user-authored, so the set of providers that can see it is yours to control — remove an entry if you do not want it to see transcript content.
448
+
368
449
  ## Settings
369
450
 
370
451
  Configure compaction in `~/.atomic/agent/settings.json` or `<project-dir>/.atomic/settings.json` (legacy `.pi` paths are also supported):
@@ -381,7 +462,9 @@ Configure compaction in `~/.atomic/agent/settings.json` or `<project-dir>/.atomi
381
462
  | Setting | Default | Description |
382
463
  |---------|---------|-------------|
383
464
  | `enabled` | `true` | Enable automatic Verbatim Compaction. |
384
- | `reserveTokens` | `16384` | Tokens to reserve for the next LLM response; threshold auto-compaction starts when completed-response usage or a prospective post-tool context exceeds the model's effective input budget minus this reserve. |
465
+ | `reserveTokens` | `16384` | Tokens to reserve for the next LLM response; threshold auto-compaction starts when completed-response usage or a prospective post-tool context exceeds the model's effective input budget minus this reserve. It is an **input-side** reserve only and never caps planner output. |
466
+
467
+ Compaction has no configuration key of its own for fallback borrowing: it reuses `settings.fallbackModels`, the same ordered `provider/model[:thinkingLevel]` list that main-chat model fallback walks. With no `fallbackModels` configured, compaction behaves as before: one planner model, then either an honest failure (recoverable) or a fresh context window (load-bearing).
385
468
 
386
469
  Disable auto-compaction with `"enabled": false`. You can still compact manually with `/compact`.
387
470
 
@@ -13,7 +13,6 @@ See these complete provider examples:
13
13
 
14
14
  - [`examples/extensions/custom-provider-anthropic/`](https://github.com/bastani-inc/atomic/tree/main/packages/coding-agent/examples/extensions/custom-provider-anthropic)
15
15
  - [`examples/extensions/custom-provider-gitlab-duo/`](https://github.com/bastani-inc/atomic/tree/main/packages/coding-agent/examples/extensions/custom-provider-gitlab-duo)
16
- - Built-in reference: `packages/cursor/` registers the experimental first-party Cursor provider with OAuth, model mapping, and a native `streamSimple` adapter without a local proxy.
17
16
 
18
17
  ## Table of Contents
19
18
 
@@ -313,6 +312,12 @@ After registration, users can authenticate via `/login corporate-ai`.
313
312
 
314
313
  Existing extension OAuth definitions keep their `login`, `refreshToken`, `getApiKey`, and optional `modifyModels` methods. OAuth refresh is serialized so concurrent requests do not overwrite each other's credentials.
315
314
 
315
+ In isolated interactive mode, extension code and executable OAuth methods remain in the engine process. Atomic transports only the JSON-safe provider description (`id`, `name`, `loginLabel`, and `usesCallbackServer`) to the terminal process; it never serializes provider functions or acquired credentials and does not load the extension a second time in the frontend. The engine executes the provider's login closure and correlates browser URLs, device codes, progress/info messages, prompts, selections, and manual-code callbacks with the originating login.
316
+
317
+ After acquisition, the engine owns serialized credential persistence, model/current-model refresh, rollback on failure, and logout. The frontend applies the returned catalog only after the engine transaction succeeds. Escape or Ctrl+C cancels only the matching login and leaves the prior credential/catalog intact. Built-in OAuth and direct, non-isolated extension OAuth use the same persistence and cancellation semantics; later provider registrations continue to override earlier registrations by ID.
318
+
319
+ Intentional cancellation is quiet, including native `AbortError`, an aborted signal or its exact reason, nested abort causes, and the legacy exact `Login cancelled` error. Provider denial, timeout, network/protocol errors, malformed responses, token exchange failures, storage failures, and post-login refresh failures remain visible.
320
+
316
321
  ## Dynamic model catalog refresh
317
322
 
318
323
  Providers whose catalogs change at runtime can add `refreshModels`. Atomic calls it during the asynchronous model refresh used by the model picker and authentication flows:
@@ -653,9 +658,6 @@ interface ProviderModelConfig {
653
658
  /** Default/effective context window size in tokens. */
654
659
  contextWindow: number;
655
660
 
656
- /** Optional selectable context-window sizes in tokens. */
657
- contextWindowOptions?: readonly number[];
658
-
659
661
  /** Maximum output tokens. */
660
662
  maxTokens: number;
661
663
 
@@ -668,12 +670,17 @@ interface ProviderModelConfig {
668
670
  supportsDeveloperRole?: boolean;
669
671
  supportsReasoningEffort?: boolean;
670
672
  supportsUsageInStreaming?: boolean;
673
+ supportsStrictMode?: boolean;
674
+ supportsOpenAIGrammarTools?: boolean;
675
+ /** Atomic alias for supportsOpenAIGrammarTools. */
676
+ supportsGrammarTools?: boolean;
671
677
  maxTokensField?: "max_completion_tokens" | "max_tokens";
672
678
  requiresToolResultName?: boolean;
673
679
  requiresAssistantAfterToolResult?: boolean;
674
680
  requiresThinkingAsText?: boolean;
675
681
  requiresReasoningContentOnAssistantMessages?: boolean;
676
682
  thinkingFormat?: "openai" | "openrouter" | "deepseek" | "together" | "zai" | "qwen" | "chat-template" | "qwen-chat-template" | "string-thinking" | "ant-ling";
683
+ supportsStrictTools?: boolean;
677
684
  chatTemplateKwargs?: Record<string, string | number | boolean | null | { "$var": "thinking.enabled" | "thinking.effort"; omitWhenOff?: boolean }>;
678
685
  cacheControlFormat?: "anthropic";
679
686
  sendSessionAffinityHeaders?: boolean;
@@ -689,4 +696,6 @@ The `cost` shape is equivalent to `Model<Api>["cost"]`. Base rates and every tie
689
696
  `openrouter` sends `reasoning: { effort }`. `deepseek` sends `thinking: { type: "enabled" | "disabled" }` and `reasoning_effort` when enabled. `together` sends `reasoning: { enabled }` and also `reasoning_effort` when `supportsReasoningEffort` is enabled. `qwen` is for DashScope-style top-level `enable_thinking`. Use `qwen-chat-template` for local Qwen-compatible servers that read `chat_template_kwargs.enable_thinking` and need `preserve_thinking`. Use `chat-template` for configurable `chat_template_kwargs`, for example DeepSeek V3.x behind vLLM with `chatTemplateKwargs: { "thinking": { "$var": "thinking.enabled" } }`.
690
697
  `cacheControlFormat: "anthropic"` applies Anthropic-style `cache_control` markers to the system prompt, last tool definition, and last user/assistant text content.
691
698
 
699
+ Capability flags are enforcement claims, not preferences. `supportsStrictMode` controls strict JSON-schema tools for OpenAI-compatible APIs; Anthropic/Bedrock use `supportsStrictTools`; `supportsOpenAIGrammarTools` controls OpenAI Lark/regex custom tools. Atomic also accepts `supportsGrammarTools` as a compatibility alias and synchronizes it to the canonical OpenAI name; when both disagree, the canonical field wins. Leave these fields unset/false unless the endpoint and selected model actually preserve and enforce the corresponding request shape. See [Extensions](/extensions#constrained-sampling) for exact `constrainedSampling` modes.
700
+
692
701
  For `openai-responses` providers, set `compat.sessionAffinityFormat` to `"openai"` for `session_id` plus `x-client-request-id`, `"openai-nosession"` to omit `session_id` while retaining `x-client-request-id`, or `"openrouter"` for `x-session-id`. Responses-compatible providers may also set `supportsToolSearch` when they support deferred tool loading.
package/docs/docs.json CHANGED
@@ -18,6 +18,7 @@
18
18
  "quickstart",
19
19
  "usage",
20
20
  "providers",
21
+ "environment-variables",
21
22
  "llama-cpp",
22
23
  "containerization",
23
24
  "security",
@@ -0,0 +1,37 @@
1
+ # Environment Variables
2
+
3
+ Atomic accepts environment variables for configuration, provider credentials, and subprocess context. Atomic-prefixed application variables take precedence over their legacy Pi aliases when both are set.
4
+
5
+ ## Application configuration
6
+
7
+ | Atomic variable | Legacy alias | Purpose |
8
+ |---|---|---|
9
+ | `ATOMIC_CODING_AGENT_DIR` | `PI_CODING_AGENT_DIR` | Agent/config directory; default `~/.atomic/agent` |
10
+ | `ATOMIC_CODING_AGENT_SESSION_DIR` | `PI_CODING_AGENT_SESSION_DIR` | Session directory; `--session-dir` takes precedence |
11
+ | `ATOMIC_PACKAGE_DIR` | `PI_PACKAGE_DIR` | Package directory override |
12
+ | `ATOMIC_OFFLINE` | `PI_OFFLINE` | Disable startup network operations |
13
+ | `ATOMIC_SKIP_VERSION_CHECK` | `PI_SKIP_VERSION_CHECK` | Skip automatic startup version checks; explicit self-update still checks |
14
+ | `ATOMIC_TELEMETRY` | `PI_TELEMETRY` | Enable/disable install/update telemetry |
15
+ | `ATOMIC_REDUCED_MOTION` | `PI_REDUCED_MOTION` | Use static reduced-motion presentation |
16
+
17
+ `PI_CACHE_RETENTION=long` is a provider/upstream prompt-cache option and intentionally has no Atomic-prefixed alias. `VISUAL` and `EDITOR` select the Ctrl+G external editor when `externalEditor` is unset.
18
+
19
+ ## Provider credentials
20
+
21
+ Provider keys include `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `AZURE_OPENAI_API_KEY`, `GEMINI_API_KEY`, AWS/Bedrock credentials, and the variables listed in [Providers](/providers#environment-variables-or-auth-file). `ANTHROPIC_AUTH_TOKEN` is a distinct header-only bearer credential for Anthropic-compatible gateways: Atomic sends `Authorization: Bearer …` without requiring or inventing an API key, including normal turns, isolated execution, branch summaries, and Verbatim Compaction. Custom headers remain independent.
22
+
23
+ ## Bash session environment
24
+
25
+ Every built-in, factory-created, direct, foreground/background, workflow-stage, and isolated bash execution receives one execution-time snapshot:
26
+
27
+ | Atomic variable | Exact Pi alias | Value |
28
+ |---|---|---|
29
+ | `ATOMIC_SESSION_ID` | `PI_SESSION_ID` | Active session ID |
30
+ | `ATOMIC_SESSION_FILE` | `PI_SESSION_FILE` | Active JSONL file; omitted for unsaved/ephemeral sessions |
31
+ | `ATOMIC_PROVIDER` | `PI_PROVIDER` | Active provider; omitted when no model is selected |
32
+ | `ATOMIC_MODEL` | `PI_MODEL` | Active model ID; omitted when no model is selected |
33
+ | `ATOMIC_REASONING_LEVEL` | `PI_REASONING_LEVEL` | Active reasoning level |
34
+
35
+ Atomic clears these ten reserved names before overlaying the current snapshot, preventing stale metadata from another session or workflow stage. Unrelated inherited/caller variables remain intact. The snapshot is taken when execution begins, so a resumed session or later model change is reflected. SDK `createBashTool()` exposes it by default; set `exposeSessionEnvironment: false` to opt out.
36
+
37
+ See [Using Atomic](/usage#environment-variables) and [RPC direct bash](/rpc#bash) for execution and streaming behavior.
@@ -138,6 +138,10 @@ Extensions are auto-discovered from:
138
138
  | `.atomic/extensions/*.ts` | Project-local |
139
139
  | `.atomic/extensions/*/index.ts` | Project-local (subdirectory) |
140
140
 
141
+ Atomic also discovers extensions and package resources inherited from legacy `~/.pi/agent` and `.pi` configuration. When an inherited Pi extension uses the exact same tool, command, prompt, flag, or shortcut name as an extension bundled with Atomic, Atomic keeps the bundled registration and ignores only that conflicting inherited registration. Other resources from the inherited extension remain available. Interactive startup reports all such overlaps in one yellow summary; print and RPC modes apply the same winners without changing the Pi settings or package files.
142
+
143
+ This compatibility rule applies only to inherited Pi resources. Extensions configured through `.atomic` or passed explicitly with `--extension` retain the normal intentional override and load-order behavior described below.
144
+
141
145
  Additional paths via `settings.json`:
142
146
 
143
147
  ```json
@@ -1605,7 +1609,7 @@ mode and would not execute if sent via `prompt`.
1605
1609
 
1606
1610
  ### pi.registerMessageRenderer(customType, renderer)
1607
1611
 
1608
- Register a custom TUI renderer for messages with your `customType`. See [Custom UI](#custom-ui).
1612
+ Register a custom TUI renderer for messages with your `customType`. The renderer options contain `expanded` and the current numeric `outputPad`, so custom output can align with built-in messages. The same options are provided in normal and isolated-engine rendering. See [Custom UI](#custom-ui).
1609
1613
 
1610
1614
  ### pi.registerShortcut(shortcut, options)
1611
1615
 
@@ -1965,6 +1969,34 @@ async execute(toolCallId, params) {
1965
1969
 
1966
1970
  **Important:** Use `StringEnum` from `@bastani/atomic` for string enums. It retains Pi's Google-compatible schema and composes with Atomic's direct TypeBox types; `Type.Union`/`Type.Literal` doesn't work with Google's API.
1967
1971
 
1972
+ #### Constrained sampling
1973
+
1974
+ `ToolDefinition.constrainedSampling` is preserved for extension tools, SDK `customTools`, wrappers, and isolated execution. It accepts `false` or the exported `ConstrainedSamplingConfig`:
1975
+
1976
+ ```typescript
1977
+ pi.registerTool({
1978
+ name: "strict_edit",
1979
+ label: "Strict edit",
1980
+ description: "Edit one file",
1981
+ parameters: Type.Object({ path: Type.String(), content: Type.String() }),
1982
+ constrainedSampling: { type: "json_schema", strict: "prefer" },
1983
+ async execute(_id, params) {
1984
+ return { content: [{ type: "text", text: params.path }], details: {} };
1985
+ },
1986
+ });
1987
+ ```
1988
+
1989
+ Exact modes:
1990
+
1991
+ - `{ type: "json_schema", strict: "prefer" }` requests strict provider enforcement and falls back to ordinary tool calling when unavailable.
1992
+ - `{ type: "json_schema", strict: "require" }` fails the request rather than silently weakening the constraint.
1993
+ - `{ type: "grammar", variants: { openai_lark?: string, openai_regex?: string } }` requests an OpenAI custom grammar tool; Lark wins when both non-empty variants are present.
1994
+ - `false` explicitly opts out. Its runtime effect matches omission, but public tool inspection preserves `false` as a present property.
1995
+
1996
+ Atomic preserves the optional property's exact own-key state across wrappers, active-session inspection, staged extension inspection, bundled tools, and isolated transport: omission stays absent; explicitly present `undefined` stays present; `false` and config objects remain unchanged. This distinction matters to SDK/extension code that uses `Object.hasOwn()` rather than an ordinary property read.
1997
+
1998
+ Grammar tools require an object schema with exactly one required string property. They are emitted only when model metadata advertises `supportsOpenAIGrammarTools` (also exposed as Atomic's `supportsGrammarTools` alias); otherwise provider handling falls back to the normal function/JSON-schema path. Older OpenAI models and gateways that rewrite schemas cannot honor custom grammar tools. Typed RPC clients receive these claims through optional `ModelInfo.compat`. See [Custom Models](/models#constrained-tool-sampling) and [RPC](/rpc#get_available_models).
1999
+
1968
2000
  **Argument preparation:** `prepareArguments(args)` is optional. If defined, it runs before schema validation and before `execute()`. Use it only when a custom tool must normalize arguments before validation. Return the object you want validated against `parameters`, keep the public schema strict, and avoid advertising deprecated fields.
1969
2001
 
1970
2002
  ```typescript
@@ -2279,7 +2311,7 @@ Extensions can interact with users via `ctx.ui` methods and customize how messag
2279
2311
  - Async operations with cancel (BorderedLoader)
2280
2312
  - Settings toggles (SettingsList)
2281
2313
  - Status indicators (setStatus)
2282
- - Working message, visibility, and indicator during streaming (`setWorkingMessage`, `setWorkingVisible`, `setWorkingIndicator`)
2314
+ - Working message, visibility, and indicator from accepted prompt startup through active turns (`setWorkingMessage`, `setWorkingVisible`, `setWorkingIndicator`)
2283
2315
  - Widgets above/below editor (setWidget)
2284
2316
  - Autocomplete providers layered on top of built-in slash/path completion (addAutocompleteProvider)
2285
2317
  - Custom footers (setFooter)
@@ -2303,6 +2335,8 @@ const text = await ctx.ui.editor("Edit:", "prefilled text");
2303
2335
  ctx.ui.notify("Done!", "info"); // "info" | "warning" | "error"
2304
2336
  ```
2305
2337
 
2338
+ Notifications emitted while extensions load or startup is in progress always appear below the startup `RESOURCES` disclosure line, never above it.
2339
+
2306
2340
  #### Timed Dialogs with Countdown
2307
2341
 
2308
2342
  Dialogs support a `timeout` option that auto-dismisses with a live countdown display:
@@ -2361,13 +2395,13 @@ See [examples/extensions/timed-confirm.ts](https://github.com/bastani-inc/atomic
2361
2395
  ctx.ui.setStatus("my-ext", "Processing...");
2362
2396
  ctx.ui.setStatus("my-ext", undefined); // Clear
2363
2397
 
2364
- // Working loader (shown during streaming)
2398
+ // Working loader customization (active from accepted prompt startup through the agent turn)
2365
2399
  ctx.ui.setWorkingMessage("Thinking deeply...");
2366
2400
  ctx.ui.setWorkingMessage(); // Restore default
2367
2401
  ctx.ui.setWorkingVisible(false); // Hide the built-in working loader row entirely
2368
2402
  ctx.ui.setWorkingVisible(true); // Show the built-in working loader row
2369
2403
 
2370
- // Working indicator (shown during streaming)
2404
+ // Working indicator customization (same lifecycle; see TUI Pattern 4b)
2371
2405
  ctx.ui.setWorkingIndicator({ frames: [ctx.ui.theme.fg("accent", "●")] }); // Static dot
2372
2406
  ctx.ui.setWorkingIndicator({
2373
2407
  frames: [
@@ -2379,7 +2413,7 @@ ctx.ui.setWorkingIndicator({
2379
2413
  intervalMs: 120,
2380
2414
  });
2381
2415
  ctx.ui.setWorkingIndicator({ frames: [] }); // Hide indicator
2382
- ctx.ui.setWorkingIndicator(); // Restore default spinner
2416
+ ctx.ui.setWorkingIndicator(); // Restore the default one-cell ∀ luminance ramp
2383
2417
 
2384
2418
  // Widget above editor (default)
2385
2419
  ctx.ui.setWidget("my-widget", ["Line 1", "Line 2"]);
@@ -2451,7 +2485,9 @@ ctx.ui.setTheme(lightTheme!); // Or switch by Theme object
2451
2485
  ctx.ui.theme.fg("accent", "styled text"); // Access current theme
2452
2486
  ```
2453
2487
 
2454
- Custom working-indicator frames are rendered verbatim. If you want colors, add them to the frame strings yourself, for example with `ctx.ui.theme.fg(...)`.
2488
+ Atomic's default working indicator keeps the literal one-cell `∀` fixed while following the active theme's optional `workingIndicator` tone overrides through a dark → accent → bright/bold → accent → dark ramp every 88ms. Any omitted tones are derived from selected-surface, `accent`, and `text` roles. `NO_COLOR` keeps regular/bold activity without foreground-color escapes, and `ATOMIC_REDUCED_MOTION=1` uses a static regular accent `∀` without a timer. Custom working-indicator frames and intervals are rendered verbatim. If you want colors, add them to the frame strings yourself, for example with `ctx.ui.theme.fg(...)`.
2489
+
2490
+ These APIs customize presentation only; they do not start work or emit an extension stream event before prompt startup. See [Working Indicator Customization](/tui#pattern-4b-working-indicator-customization) for accepted-prompt, pre-stream, and agent-turn handoff timing.
2455
2491
 
2456
2492
  ### Autocomplete Providers
2457
2493
 
@@ -2623,7 +2659,7 @@ Register a custom renderer for messages with your `customType`:
2623
2659
  import { Text } from "@earendil-works/pi-tui";
2624
2660
 
2625
2661
  pi.registerMessageRenderer("my-extension", (message, options, theme) => {
2626
- const { expanded } = options;
2662
+ const { expanded, outputPad } = options;
2627
2663
  let text = theme.fg("accent", `[${message.customType}] `);
2628
2664
  text += message.content;
2629
2665
 
@@ -2631,7 +2667,7 @@ pi.registerMessageRenderer("my-extension", (message, options, theme) => {
2631
2667
  text += "\n" + theme.fg("dim", JSON.stringify(message.details, null, 2));
2632
2668
  }
2633
2669
 
2634
- return new Text(text, 0, 0);
2670
+ return new Text(text, outputPad, 0);
2635
2671
  });
2636
2672
  ```
2637
2673
 
@@ -2740,7 +2776,7 @@ All examples in [examples/extensions/](https://github.com/bastani-inc/atomic/tre
2740
2776
  | `auto-commit-on-exit.ts` | Commit on shutdown | `on("session_shutdown")`, `exec` |
2741
2777
  | **UI Components** |||
2742
2778
  | `status-line.ts` | Footer status indicator | `setStatus`, session events |
2743
- | `working-indicator.ts` | Customize the streaming working indicator | `setWorkingIndicator`, `registerCommand` |
2779
+ | `working-indicator.ts` | Customize the Working indicator used during prompt startup and active turns | `setWorkingIndicator`, `registerCommand` |
2744
2780
  | `github-issue-autocomplete.ts` | Add `#1234` issue completions on top of built-in autocomplete by preloading recent open issues from `gh issue list` | `addAutocompleteProvider`, `on("session_start")`, `exec` |
2745
2781
  | `custom-footer.ts` | Replace footer entirely | `registerCommand`, `setFooter` |
2746
2782
  | `custom-header.ts` | Replace startup header | `on("session_start")`, `setHeader` |
package/docs/index.md CHANGED
@@ -48,6 +48,7 @@ For the full first-run flow, see [Quickstart](/quickstart).
48
48
  - [Quickstart](/quickstart) - install, authenticate, and run a first session.
49
49
  - [Using Atomic](/usage) - interactive mode, slash commands, context files, and CLI reference.
50
50
  - [Providers](/providers) - subscription and API-key setup for built-in providers.
51
+ - [Environment variables](/environment-variables) - Atomic/Pi aliases, provider credentials, and bash session metadata.
51
52
  - [Security](/security) - project trust, sandbox boundaries, and vulnerability reporting.
52
53
  - [Containerization](/containerization) - sandbox Atomic with OpenShell, Gondolin, or Docker.
53
54
  - [Settings](/settings) - global and project settings.
package/docs/intercom.md CHANGED
@@ -169,7 +169,7 @@ Every session belongs to exactly one intercom **group**. Sessions with no group
169
169
  - `list`/`status` show your own group and only same-group peers. Pass `group: "name"` to `list`/`status` for a **read-only** peek at another group's membership. `send`/`ask` are always locked to your own group and error if you pass a different `group`.
170
170
  - `session_joined`/`session_left`/`presence_update` are group-scoped, so you never see peers outside your group appear or disappear.
171
171
 
172
- A session's home group is resolved with precedence: workflow/orchestrator-injected per-session group > env `ATOMIC_INTERCOM_GROUP` (legacy `PI_INTERCOM_GROUP`) > intercom `config.json` `"group"` > `"default"`. In workflow and subagent `group` options, boolean `true` and the trimmed, case-insensitive strings `"true"`/`"auto"` request an automatically generated group; those string names are reserved and cannot name literal groups. Groups are the mechanism workflows use to isolate reviewer levels (see [workflows.md](/workflows)). The subagent-only `contact_supervisor` path can cross groups only after a broker capability binds the registered child socket to the issuing supervisor session. The broker, not the client, marks validated traffic as `supervisor`; ordinary `send` frames remain isolated even if a raw client forges that flag, and replies cross back only through an exact broker-recorded `replyTo` match. Parent-held authorization state is restored after broker reconnects. The lightweight wrapper synchronously claims supervisor-authorization requests and lazy-loads the broker provider; a claimed provider failure aborts launch, while runtimes with no provider omit supervisor metadata and do not expose a broken channel.
172
+ A session's home group is resolved with this precedence: explicit stage/task/subagent group > runtime-owned workflow invocation group or inherited launching-session group > env `ATOMIC_INTERCOM_GROUP` (legacy `PI_INTERCOM_GROUP`) > Intercom `config.json` `"group"` > `"default"`. Each top-level workflow invocation gets a stable non-default group from its persistent run identity; Intercom-capable stages, nested workflows, and their delegated subagents inherit it without authors threading IDs. Explicit `group: "default"` opts back into the shared group. Boolean `true` and the trimmed, case-insensitive strings `"true"`/`"auto"` request an automatically generated subgroup; those string names are reserved. Stages and children without Intercom access receive no group. See [workflows.md](/workflows) for workflow-stage rules. The subagent-only `contact_supervisor` path can cross groups only after a broker capability binds the registered child socket to the issuing supervisor session. The broker, not the client, marks validated traffic as `supervisor`; ordinary `send` frames remain isolated even if a raw client forges that flag, and replies cross back only through an exact broker-recorded `replyTo` match. Parent-held authorization state is restored after broker reconnects. The lightweight wrapper synchronously claims supervisor-authorization requests and lazy-loads the broker provider; a claimed provider failure aborts launch, while runtimes with no provider omit supervisor metadata and do not expose a broken channel.
173
173
 
174
174
  ### send vs ask vs reply
175
175
 
package/docs/json.md CHANGED
@@ -6,6 +6,8 @@ atomic --mode json "Your prompt"
6
6
 
7
7
  Outputs all session events as JSON lines to stdout. Useful for integrating Atomic into other tools or custom UIs.
8
8
 
9
+ If a complete saved provider/model default names a provider that remains unsupported after provider registration, JSON mode writes the generic configuration diagnostic to stderr and exits nonzero before sending the prompt. It writes no human diagnostic to stdout, so any stdout records remain valid JSONL. This differs from ordinary supported-provider model or authentication fallback, which retains normal automatic model selection.
10
+
9
11
  ## Event Types
10
12
 
11
13
  Events are defined in [`AgentSessionEvent`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/agent-session.ts#L152):
@@ -18,7 +20,6 @@ type AgentSessionEvent =
18
20
  | { type: "session_info_changed"; name: string | undefined }
19
21
  | { type: "model_changed"; model: Model<Api>; previousModel: Model<Api> | undefined; source: "set" | "cycle" | "restore" }
20
22
  | { type: "thinking_level_changed"; level: ThinkingLevel }
21
- | { type: "context_window_changed"; contextWindow: number }
22
23
  | { type: "compaction_end"; reason: "manual" | "threshold" | "overflow"; result: VerbatimCompactionResult | undefined; aborted: boolean; willRetry: boolean; unresolvedOverflow?: boolean; errorMessage?: string }
23
24
  | { type: "auto_retry_start"; attempt: number; maxAttempts: number; delayMs: number; errorMessage: string }
24
25
  | { type: "auto_retry_end"; success: boolean; attempt: number; finalError?: string }
@@ -28,9 +29,9 @@ type AgentSessionEvent =
28
29
  | { type: "summarization_retry_finished" };
29
30
  ```
30
31
 
31
- `queue_update` emits the full pending steering and follow-up queues whenever they change. `session_info_changed`, `model_changed`, `thinking_level_changed`, and `context_window_changed` report interactive session metadata changes. `context_window_changed` carries the active token budget after `AgentSession.setContextWindow()` or branch navigation replay applies a branch-scoped `context_window_change`; branch replay does not add another session journal entry or write settings. `compaction_start` and `compaction_end` cover manual and automatic verbatim line compaction: the model emits deleted ranges and Atomic mechanically reconstructs retained text.
32
+ `queue_update` emits the full pending steering and follow-up queues whenever they change. `session_info_changed`, `model_changed`, and `thinking_level_changed` report interactive session metadata changes. `compaction_start` and `compaction_end` cover manual and automatic verbatim line compaction: the model emits deleted ranges and Atomic mechanically reconstructs retained text.
32
33
 
33
- For automatic compaction, `compaction_end.willRetry === true` means the agent is retrying the interrupted turn after compaction; `AgentSession.prompt()` waits for that continuation before resolving. This includes overflow recovery and live threshold compaction for retry-worthy interrupted work such as output-token truncation or OpenAI Responses output-budget underflow errors. Generic provider `invalid_request_body` failures still compact with `willRetry: false` when threshold compaction is warranted. If the same-model compact-and-retry overflow path is exhausted, `compaction_end` includes `unresolvedOverflow: true` plus an `errorMessage` so orchestration layers can fall back to another model instead of treating the prompt as successful.
34
+ For automatic compaction, `compaction_end.willRetry === true` means the agent is retrying the interrupted turn after compaction; `AgentSession.prompt()` waits for that continuation before resolving. This includes overflow recovery and live threshold compaction for retry-worthy interrupted work such as output-token truncation or OpenAI Responses output-budget underflow errors. Generic provider `invalid_request_body` failures still compact with `willRetry: false` when threshold compaction is warranted. If the same-model compact-and-retry overflow path is exhausted, `compaction_end` includes `unresolvedOverflow: true` plus an `errorMessage` so orchestration layers can fall back to another model instead of treating the prompt as successful. `result` and `errorMessage` are independent fields: a mid-turn compaction that commits a boundary and then fails the provider hard-input-limit gate emits both at once, so a non-null `result` alongside an `errorMessage` means the boundary is durable and only the follow-up request failed.
34
35
 
35
36
  Compaction planning and branch summaries reuse the configured retry policy for transient provider failures. Their `summarization_retry_*` events expose scheduling, each restarted request (including whether it belongs to branch summarization or a compaction reason), and retry-loop completion to JSON, RPC, SDK, and interactive consumers.
36
37
 
@@ -77,7 +78,6 @@ Each line is a JSON object. The first line is the session header:
77
78
  Followed by events as they occur:
78
79
 
79
80
  ```json
80
- {"type":"context_window_changed","contextWindow":1000000}
81
81
  {"type":"agent_start"}
82
82
  {"type":"turn_start"}
83
83
  {"type":"message_start","message":{"role":"assistant","content":[],...}}
@@ -82,8 +82,8 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `ctrl+1
82
82
 
83
83
  | Keybinding id | Default | Description |
84
84
  |--------|---------|-------------|
85
- | `app.interrupt` | `escape` | Cancel / abort the running agent, bash command, compaction, or retry |
86
- | `app.clear` | `ctrl+c` | Interrupt the running agent when busy; otherwise clear the editor (press twice to exit) |
85
+ | `app.interrupt` | `escape` | Abort active work and hold queued messages; repeated Escape does not dequeue the hold |
86
+ | `app.clear` | `ctrl+c` | Interrupt active or queued work; once idle, clear the editor (press twice while idle to exit) |
87
87
  | `app.exit` | `ctrl+d` | Exit (when editor empty) |
88
88
  | `app.suspend` | `ctrl+z` (none on Windows) | Suspend to background |
89
89
  | `app.editor.external` | `ctrl+g` | Open in external editor (`$VISUAL` or `$EDITOR`) |
@@ -92,6 +92,8 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `ctrl+1
92
92
 
93
93
  When `app.clipboard.pasteImage` finds text rather than an image, Atomic inserts that clipboard text into the editor instead of reporting an image-paste failure.
94
94
 
95
+ A held paused queue by itself is idle for Ctrl+C handling. After an interruption settles, the next Ctrl+C clears the editor without releasing or dequeuing the hold, and a second quick idle press exits normally.
96
+
95
97
  ### Sessions
96
98
 
97
99
  | Keybinding id | Default | Description |
package/docs/llama-cpp.md CHANGED
@@ -55,7 +55,9 @@ Run `/llama` in interactive mode:
55
55
 
56
56
  Hugging Face search uses `HF_TOKEN` when set, then checks `$HF_TOKEN_PATH`, `$HF_HOME/token`, `$XDG_CACHE_HOME/huggingface/token`, and `~/.cache/huggingface/token`. Unauthenticated search has lower rate limits. Atomic warns before gated downloads and links to the access page. Because llama.cpp performs the download, its process must also have `HF_TOKEN` for gated repositories.
57
57
 
58
- Atomic asks before unloading other models, never silently unloads models, and never deletes model files. `/llama` always displays the router's current state because other clients may share it. Only loaded models appear in `/model`; load one first, then select it there. If the router disconnects, choose **Retry** to reconnect and refresh state without replaying the interrupted operation.
58
+ Atomic asks before unloading other models, never silently unloads models, and never deletes model files. `/llama` always displays the router's current state because other clients may share it. Only loaded models appear in `/model`; load one first, then select it there. Atomic persists the last successful loaded-model catalog in `~/.atomic/agent/models-store.json` (or the active custom agent directory), so those entries remain selectable after restart and before the first successful refresh. If that first online refresh fails, Atomic reports the original router error while continuing to expose the validated persisted catalog; a later successful refresh replaces those stale loaded-state entries without duplicates. If the router disconnects, choose **Retry** to reconnect and refresh state without replaying the interrupted operation.
59
+
60
+ Each llama model uses the router-reported loaded context (`meta.n_ctx`, then training context, otherwise Atomic's fallback) for both `contextWindow` and `maxTokens`; Atomic no longer applies a separate 16K output cap. The server remains authoritative and may impose a smaller practical generation limit.
59
61
 
60
62
  ## Troubleshooting
61
63