@bastani/atomic 0.9.17 → 0.9.18-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/builtin/intercom/index.bundle.mjs +349 -57517
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/index.bundle.mjs +28948 -58339
  5. package/dist/builtin/mcp/package.json +1 -1
  6. package/dist/builtin/mcp/xdg-open +1267 -0
  7. package/dist/builtin/subagents/package.json +1 -1
  8. package/dist/builtin/subagents/src/extension/index.bundle.mjs +7929 -78021
  9. package/dist/builtin/web-access/index.bundle.mjs +70791 -57707
  10. package/dist/builtin/web-access/package.json +1 -1
  11. package/dist/builtin/workflows/builtin/adversarial-verification.js +0 -1
  12. package/dist/builtin/workflows/builtin/{chunk-3y1hmzw6.js → chunk-6v0yv8tj.js} +1 -1
  13. package/dist/builtin/workflows/builtin/{chunk-w9c7rkrk.js → chunk-brerg33r.js} +5 -7
  14. package/dist/builtin/workflows/builtin/{chunk-bz1c9732.js → chunk-ngffz3y8.js} +1 -1
  15. package/dist/builtin/workflows/builtin/{chunk-6rbajjf5.js → chunk-szz1ajz9.js} +1 -3
  16. package/dist/builtin/workflows/builtin/classify-and-act.js +0 -1
  17. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +0 -1
  18. package/dist/builtin/workflows/builtin/generate-and-filter.js +0 -1
  19. package/dist/builtin/workflows/builtin/goal.js +2 -5
  20. package/dist/builtin/workflows/builtin/index.js +4 -7
  21. package/dist/builtin/workflows/builtin/loop-until-done.js +0 -1
  22. package/dist/builtin/workflows/builtin/open-claude-design.js +1 -4
  23. package/dist/builtin/workflows/builtin/ralph.js +2 -5
  24. package/dist/builtin/workflows/builtin/steering-context.js +0 -1
  25. package/dist/builtin/workflows/builtin/tournament.js +0 -1
  26. package/dist/builtin/workflows/package.json +1 -1
  27. package/dist/builtin/workflows/src/extension/index.bundle.mjs +39989 -81500
  28. package/dist/builtin/workflows/src/index.js +1253 -58524
  29. package/dist/bun/cli.js.map +1 -1
  30. package/dist/bun/split-loader.js +2 -0
  31. package/dist/bun/split-loader.js.map +1 -1
  32. package/dist/cli/args.js.map +1 -1
  33. package/dist/cli/auth-command.js.map +1 -1
  34. package/dist/cli/session-picker.js.map +1 -1
  35. package/dist/cli/startup-ui.js.map +1 -1
  36. package/dist/cli.js +5 -2
  37. package/dist/cli.js.map +1 -1
  38. package/dist/core/agent-session-extension-bindings.d.ts +19 -2
  39. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  40. package/dist/core/agent-session-extension-bindings.js +253 -74
  41. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  42. package/dist/core/agent-session-methods.d.ts +8 -3
  43. package/dist/core/agent-session-methods.d.ts.map +1 -1
  44. package/dist/core/agent-session-methods.js.map +1 -1
  45. package/dist/core/agent-session-prompt.d.ts +2 -7
  46. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  47. package/dist/core/agent-session-prompt.js +1 -35
  48. package/dist/core/agent-session-prompt.js.map +1 -1
  49. package/dist/core/agent-session-services.d.ts.map +1 -1
  50. package/dist/core/agent-session-services.js +2 -0
  51. package/dist/core/agent-session-services.js.map +1 -1
  52. package/dist/core/agent-session-types.d.ts +2 -0
  53. package/dist/core/agent-session-types.d.ts.map +1 -1
  54. package/dist/core/agent-session-types.js.map +1 -1
  55. package/dist/core/agent-session.d.ts +1 -0
  56. package/dist/core/agent-session.d.ts.map +1 -1
  57. package/dist/core/agent-session.js +2 -0
  58. package/dist/core/agent-session.js.map +1 -1
  59. package/dist/core/auth-guidance.js.map +1 -1
  60. package/dist/core/auth-storage-backends.js.map +1 -1
  61. package/dist/core/auth-storage.js.map +1 -1
  62. package/dist/core/bash-executor.js.map +1 -1
  63. package/dist/core/builtin-packages.d.ts +8 -0
  64. package/dist/core/builtin-packages.d.ts.map +1 -1
  65. package/dist/core/builtin-packages.js +11 -5
  66. package/dist/core/builtin-packages.js.map +1 -1
  67. package/dist/core/event-bus.d.ts +11 -0
  68. package/dist/core/event-bus.d.ts.map +1 -1
  69. package/dist/core/event-bus.js +96 -0
  70. package/dist/core/event-bus.js.map +1 -1
  71. package/dist/core/experimental.js.map +1 -1
  72. package/dist/core/export-html/index.js.map +1 -1
  73. package/dist/core/extensions/builtin-extension-entry-labels.d.ts +6 -0
  74. package/dist/core/extensions/builtin-extension-entry-labels.d.ts.map +1 -0
  75. package/dist/core/extensions/builtin-extension-entry-labels.js +22 -0
  76. package/dist/core/extensions/builtin-extension-entry-labels.js.map +1 -0
  77. package/dist/core/extensions/host-module-bridge.d.ts +22 -0
  78. package/dist/core/extensions/host-module-bridge.d.ts.map +1 -0
  79. package/dist/core/extensions/host-module-bridge.js +39 -0
  80. package/dist/core/extensions/host-module-bridge.js.map +1 -0
  81. package/dist/core/extensions/loader-api.d.ts.map +1 -1
  82. package/dist/core/extensions/loader-api.js +2 -2
  83. package/dist/core/extensions/loader-api.js.map +1 -1
  84. package/dist/core/extensions/loader-core.js.map +1 -1
  85. package/dist/core/extensions/loader-discovery.js.map +1 -1
  86. package/dist/core/extensions/loader-host-modules.d.ts +10 -0
  87. package/dist/core/extensions/loader-host-modules.d.ts.map +1 -0
  88. package/dist/core/extensions/loader-host-modules.js +88 -0
  89. package/dist/core/extensions/loader-host-modules.js.map +1 -0
  90. package/dist/core/extensions/loader-runtime.d.ts.map +1 -1
  91. package/dist/core/extensions/loader-runtime.js +1 -0
  92. package/dist/core/extensions/loader-runtime.js.map +1 -1
  93. package/dist/core/extensions/loader-virtual-modules.d.ts +5 -2
  94. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  95. package/dist/core/extensions/loader-virtual-modules.js +51 -71
  96. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  97. package/dist/core/extensions/loader.d.ts +1 -1
  98. package/dist/core/extensions/loader.js.map +1 -1
  99. package/dist/core/extensions/native-builtin-entries.d.ts +6 -0
  100. package/dist/core/extensions/native-builtin-entries.d.ts.map +1 -0
  101. package/dist/core/extensions/native-builtin-entries.js +23 -0
  102. package/dist/core/extensions/native-builtin-entries.js.map +1 -0
  103. package/dist/core/extensions/runtime-types.d.ts +2 -0
  104. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  105. package/dist/core/extensions/runtime-types.js.map +1 -1
  106. package/dist/core/keybindings.js.map +1 -1
  107. package/dist/core/lifecycle-timings.d.ts +21 -0
  108. package/dist/core/lifecycle-timings.d.ts.map +1 -0
  109. package/dist/core/lifecycle-timings.js +57 -0
  110. package/dist/core/lifecycle-timings.js.map +1 -0
  111. package/dist/core/mandatory-resource-loader.d.ts.map +1 -1
  112. package/dist/core/mandatory-resource-loader.js +43 -0
  113. package/dist/core/mandatory-resource-loader.js.map +1 -1
  114. package/dist/core/model-runtime.d.ts +8 -0
  115. package/dist/core/model-runtime.d.ts.map +1 -1
  116. package/dist/core/model-runtime.js +82 -0
  117. package/dist/core/model-runtime.js.map +1 -1
  118. package/dist/core/models-store.js.map +1 -1
  119. package/dist/core/package-manager-auto-resources.js.map +1 -1
  120. package/dist/core/package-manager-env.js.map +1 -1
  121. package/dist/core/package-manager-git.js.map +1 -1
  122. package/dist/core/package-manager-manifest.js.map +1 -1
  123. package/dist/core/package-manager-npm.js.map +1 -1
  124. package/dist/core/package-manager-paths.js.map +1 -1
  125. package/dist/core/package-manager-resolver.js.map +1 -1
  126. package/dist/core/project-trust.js.map +1 -1
  127. package/dist/core/prompt-templates-async.js.map +1 -1
  128. package/dist/core/prompt-templates.js.map +1 -1
  129. package/dist/core/provider-attribution.js.map +1 -1
  130. package/dist/core/remote-catalog-provider.js.map +1 -1
  131. package/dist/core/resource-loader-assets.js.map +1 -1
  132. package/dist/core/resource-loader-context-files.js.map +1 -1
  133. package/dist/core/resource-loader-core.d.ts +5 -1
  134. package/dist/core/resource-loader-core.d.ts.map +1 -1
  135. package/dist/core/resource-loader-core.js +90 -1
  136. package/dist/core/resource-loader-core.js.map +1 -1
  137. package/dist/core/resource-loader-discovery.js.map +1 -1
  138. package/dist/core/resource-loader-paths.js.map +1 -1
  139. package/dist/core/resource-loader-source-info.js.map +1 -1
  140. package/dist/core/resource-loader-types.d.ts +16 -0
  141. package/dist/core/resource-loader-types.d.ts.map +1 -1
  142. package/dist/core/resource-loader-types.js.map +1 -1
  143. package/dist/core/sdk.d.ts.map +1 -1
  144. package/dist/core/sdk.js +4 -1
  145. package/dist/core/sdk.js.map +1 -1
  146. package/dist/core/session-manager-core.js.map +1 -1
  147. package/dist/core/session-manager-list.js.map +1 -1
  148. package/dist/core/session-manager-paths.js.map +1 -1
  149. package/dist/core/settings-manager-core.d.ts +6 -0
  150. package/dist/core/settings-manager-core.d.ts.map +1 -1
  151. package/dist/core/settings-manager-core.js +24 -0
  152. package/dist/core/settings-manager-core.js.map +1 -1
  153. package/dist/core/settings-manager-ui-accessors.js.map +1 -1
  154. package/dist/core/settings-storage.js.map +1 -1
  155. package/dist/core/skills-async.js.map +1 -1
  156. package/dist/core/skills.js.map +1 -1
  157. package/dist/core/slash-commands.d.ts.map +1 -1
  158. package/dist/core/slash-commands.js +0 -6
  159. package/dist/core/slash-commands.js.map +1 -1
  160. package/dist/core/system-prompt.js.map +1 -1
  161. package/dist/core/telemetry.js.map +1 -1
  162. package/dist/core/timings.js.map +1 -1
  163. package/dist/core/tools/bash.js.map +1 -1
  164. package/dist/core/tools/output-accumulator.js.map +1 -1
  165. package/dist/core/tools/powershell.js.map +1 -1
  166. package/dist/core/tools/read.js.map +1 -1
  167. package/dist/core/tools/session-temp-cleanup.js.map +1 -1
  168. package/dist/core/tools/session-temp-dir.js.map +1 -1
  169. package/dist/core/tools/todos-paths.js.map +1 -1
  170. package/dist/core/trust-manager.js.map +1 -1
  171. package/dist/index.d.ts +1 -1
  172. package/dist/index.js.map +1 -1
  173. package/dist/main-deferred-startup.d.ts +16 -0
  174. package/dist/main-deferred-startup.d.ts.map +1 -1
  175. package/dist/main-deferred-startup.js +14 -0
  176. package/dist/main-deferred-startup.js.map +1 -1
  177. package/dist/main-session.js.map +1 -1
  178. package/dist/main.d.ts.map +1 -1
  179. package/dist/main.js +41 -22
  180. package/dist/main.js.map +1 -1
  181. package/dist/migrations.js.map +1 -1
  182. package/dist/modes/interactive/chat-input-actions.js.map +1 -1
  183. package/dist/modes/interactive/components/config-selector-list.js.map +1 -1
  184. package/dist/modes/interactive/components/config-selector-project-scope.js.map +1 -1
  185. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  186. package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
  187. package/dist/modes/interactive/components/first-time-setup.js.map +1 -1
  188. package/dist/modes/interactive/components/startup-identity.d.ts.map +1 -1
  189. package/dist/modes/interactive/components/startup-identity.js +4 -0
  190. package/dist/modes/interactive/components/startup-identity.js.map +1 -1
  191. package/dist/modes/interactive/external-editor.js.map +1 -1
  192. package/dist/modes/interactive/interactive-editor-actions.js +13 -5
  193. package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
  194. package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
  195. package/dist/modes/interactive/interactive-input-handling.js +2 -5
  196. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  197. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  198. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  199. package/dist/modes/interactive/interactive-mode-surface.d.ts +8 -8
  200. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  201. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  202. package/dist/modes/interactive/interactive-onboarding.js +1 -1
  203. package/dist/modes/interactive/interactive-onboarding.js.map +1 -1
  204. package/dist/modes/interactive/interactive-prompt-restore.d.ts.map +1 -1
  205. package/dist/modes/interactive/interactive-prompt-restore.js +2 -1
  206. package/dist/modes/interactive/interactive-prompt-restore.js.map +1 -1
  207. package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
  208. package/dist/modes/interactive/interactive-render-chat.js +2 -0
  209. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  210. package/dist/modes/interactive/interactive-resource-disclosure.js +21 -53
  211. package/dist/modes/interactive/interactive-resource-disclosure.js.map +1 -1
  212. package/dist/modes/interactive/interactive-resource-paths.js +29 -5
  213. package/dist/modes/interactive/interactive-resource-paths.js.map +1 -1
  214. package/dist/modes/interactive/interactive-resource-rendering.js +66 -69
  215. package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
  216. package/dist/modes/interactive/interactive-startup-chat-container.d.ts.map +1 -1
  217. package/dist/modes/interactive/interactive-startup-chat-container.js +2 -0
  218. package/dist/modes/interactive/interactive-startup-chat-container.js.map +1 -1
  219. package/dist/modes/interactive/interactive-startup.d.ts +2 -0
  220. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  221. package/dist/modes/interactive/interactive-startup.js +30 -10
  222. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  223. package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
  224. package/dist/modes/interactive/interactive-tui.js +12 -2
  225. package/dist/modes/interactive/interactive-tui.js.map +1 -1
  226. package/dist/modes/interactive/theme/global-theme.js.map +1 -1
  227. package/dist/modes/interactive/theme/theme-loading.js.map +1 -1
  228. package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -1
  229. package/dist/modes/interactive-engine/engine-child-liveness.d.ts +2 -0
  230. package/dist/modes/interactive-engine/engine-child-liveness.d.ts.map +1 -1
  231. package/dist/modes/interactive-engine/engine-child-liveness.js +16 -2
  232. package/dist/modes/interactive-engine/engine-child-liveness.js.map +1 -1
  233. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  234. package/dist/modes/interactive-engine/engine-monitor.d.ts +5 -0
  235. package/dist/modes/interactive-engine/engine-monitor.d.ts.map +1 -1
  236. package/dist/modes/interactive-engine/engine-monitor.js +24 -0
  237. package/dist/modes/interactive-engine/engine-monitor.js.map +1 -1
  238. package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
  239. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts +3 -1
  240. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
  241. package/dist/modes/interactive-engine/extension-ui-bridge.js +6 -0
  242. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
  243. package/dist/modes/interactive-engine/isolated-runtime.d.ts +21 -2
  244. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  245. package/dist/modes/interactive-engine/isolated-runtime.js +160 -7
  246. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  247. package/dist/modes/interactive-engine/protocol.d.ts +9 -4
  248. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  249. package/dist/modes/interactive-engine/protocol.js +8 -4
  250. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  251. package/dist/modes/interactive-engine/resource-readiness-error.d.ts +6 -0
  252. package/dist/modes/interactive-engine/resource-readiness-error.d.ts.map +1 -0
  253. package/dist/modes/interactive-engine/resource-readiness-error.js +11 -0
  254. package/dist/modes/interactive-engine/resource-readiness-error.js.map +1 -0
  255. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
  256. package/dist/modes/rpc/rpc-client-process.js +3 -0
  257. package/dist/modes/rpc/rpc-client-process.js.map +1 -1
  258. package/dist/modes/rpc/rpc-client.d.ts +1 -0
  259. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  260. package/dist/modes/rpc/rpc-client.js +5 -1
  261. package/dist/modes/rpc/rpc-client.js.map +1 -1
  262. package/dist/modes/rpc/rpc-command-handler.d.ts +4 -1
  263. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  264. package/dist/modes/rpc/rpc-command-handler.js +59 -18
  265. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  266. package/dist/modes/rpc/rpc-mode.d.ts +4 -13
  267. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  268. package/dist/modes/rpc/rpc-mode.js +31 -2
  269. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  270. package/dist/modes/rpc/rpc-resource-readiness.d.ts +11 -0
  271. package/dist/modes/rpc/rpc-resource-readiness.d.ts.map +1 -0
  272. package/dist/modes/rpc/rpc-resource-readiness.js +51 -0
  273. package/dist/modes/rpc/rpc-resource-readiness.js.map +1 -0
  274. package/dist/modes/rpc/rpc-session-binding.d.ts +2 -0
  275. package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
  276. package/dist/modes/rpc/rpc-session-binding.js +21 -0
  277. package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
  278. package/dist/modes/rpc/rpc-types.d.ts +7 -0
  279. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  280. package/dist/modes/rpc/rpc-types.js.map +1 -1
  281. package/dist/package-manager-cli-parser.js.map +1 -1
  282. package/dist/package-manager-cli.js.map +1 -1
  283. package/dist/rpc-entry.js.map +1 -1
  284. package/dist/self-update-plan.js.map +1 -1
  285. package/dist/utils/changelog.d.ts +1 -1
  286. package/dist/utils/changelog.js.map +1 -1
  287. package/dist/utils/module-require.js.map +1 -1
  288. package/dist/utils/pi-user-agent.js.map +1 -1
  289. package/dist/utils/shell.js.map +1 -1
  290. package/dist/utils/tools-manager.js.map +1 -1
  291. package/dist/utils/version-check.js.map +1 -1
  292. package/dist/utils/windows-self-update.js.map +1 -1
  293. package/docs/development.md +28 -1
  294. package/docs/extensions.md +5 -3
  295. package/docs/quickstart.md +1 -3
  296. package/docs/sdk.md +2 -0
  297. package/docs/usage.md +3 -1
  298. package/docs/windows.md +8 -0
  299. package/npm-shrinkwrap.json +32 -32
  300. package/package.json +4 -4
  301. package/dist/builtin/workflows/builtin/chunk-4febxsv4.js +0 -264
  302. package/dist/builtin/workflows/builtin/chunk-5wgwscd0.js +0 -4
  303. package/dist/builtin/workflows/builtin/chunk-dattsgxg.js +0 -529
  304. package/dist/builtin/workflows/builtin/chunk-gdx0avpx.js +0 -70082
  305. package/dist/builtin/workflows/builtin/chunk-qx2ptjs3.js +0 -215
  306. package/dist/builtin/workflows/builtin/chunk-x2ghn0je.js +0 -4110
  307. package/dist/core/atomic-guide-command.d.ts +0 -41
  308. package/dist/core/atomic-guide-command.d.ts.map +0 -1
  309. package/dist/core/atomic-guide-command.js +0 -311
  310. package/dist/core/atomic-guide-command.js.map +0 -1
@@ -1,41 +0,0 @@
1
- import type { AutocompleteItem } from "@earendil-works/pi-tui";
2
- export declare const ATOMIC_GUIDE_COMMAND_NAME = "atomic";
3
- export declare const ATOMIC_GUIDE_COMMAND_DESCRIPTION = "Atomic onboarding and help guide";
4
- declare const GUIDE_SECTIONS: readonly [{
5
- readonly name: "overview";
6
- readonly aliases: readonly [];
7
- readonly label: "overview";
8
- readonly description: "30-second overview";
9
- readonly render: () => string;
10
- }, {
11
- readonly name: "workflows";
12
- readonly aliases: readonly ["workflow"];
13
- readonly label: "workflows";
14
- readonly description: "Workflow primer";
15
- readonly render: () => string;
16
- }, {
17
- readonly name: "example";
18
- readonly aliases: readonly ["examples"];
19
- readonly label: "example";
20
- readonly description: "Practical first workflow";
21
- readonly render: () => string;
22
- }, {
23
- readonly name: "whats-new";
24
- readonly aliases: readonly ["what's new", "whats new", "news", "updates", "changelog"];
25
- readonly label: "what's new";
26
- readonly description: "Recent release notes";
27
- readonly render: typeof readLatestStableChangelog;
28
- }];
29
- type AtomicGuideSection = (typeof GUIDE_SECTIONS)[number];
30
- type AtomicGuideSectionName = AtomicGuideSection["name"];
31
- export type AtomicGuideHelpChoice = AtomicGuideSection["label"];
32
- export type AtomicGuideMode = "help" | AtomicGuideSectionName;
33
- export declare const ATOMIC_GUIDE_HELP_CHOICES: readonly AtomicGuideHelpChoice[];
34
- export declare function isAtomicGuideHelpChoice(choice: string): choice is AtomicGuideHelpChoice;
35
- export declare function normalizeAtomicGuideMode(args: string): AtomicGuideMode;
36
- export declare function getAtomicGuideArgumentCompletions(prefix: string): AutocompleteItem[] | null;
37
- declare function readLatestStableChangelog(cwd: string): string;
38
- export declare function getAtomicGuideMessage(mode: AtomicGuideMode, cwd: string): string;
39
- export declare function atomicGuideModeForChoice(choice: AtomicGuideHelpChoice): AtomicGuideMode;
40
- export {};
41
- //# sourceMappingURL=atomic-guide-command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"atomic-guide-command.d.ts","sourceRoot":"","sources":["../../src/core/atomic-guide-command.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,eAAO,MAAM,yBAAyB,WAAW,CAAC;AAClD,eAAO,MAAM,gCAAgC,qCAAqC,CAAC;AAsNnF,QAAA,MAAM,cAAc;mBAEZ,UAAU;;oBAET,UAAU;0BACJ,oBAAoB;;;mBAI3B,WAAW;;oBAEV,WAAW;0BACL,iBAAiB;;;mBAIxB,SAAS;;oBAER,SAAS;0BACH,0BAA0B;;;mBAIjC,WAAW;;oBAEV,YAAY;0BACN,sBAAsB;;EASlC,CAAC;AAEJ,KAAK,kBAAkB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1D,KAAK,sBAAsB,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,sBAAsB,CAAC;AAE9D,eAAO,MAAM,yBAAyB,EAAE,SAAS,qBAAqB,EAErE,CAAC;AAcF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,qBAAqB,CAEvF;AA6BD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAKtE;AAED,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,EAAE,GAAG,IAAI,CAW3F;AAED,iBAAS,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CActD;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGhF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAEvF"}
@@ -1,311 +0,0 @@
1
- import * as path from "node:path";
2
- import { getChangelogPath, parseChangelog } from "../utils/changelog.js";
3
- export const ATOMIC_GUIDE_COMMAND_NAME = "atomic";
4
- export const ATOMIC_GUIDE_COMMAND_DESCRIPTION = "Atomic onboarding and help guide";
5
- const OVERVIEW = `# Atomic overview
6
-
7
- Atomic turns non-trivial work into executable, inspectable workflows. Default to a workflow for implementation, build, debugging, bug fixes, migrations, features, scoped multi-file changes, and validated docs/code work, or whenever a request has dependencies, handoffs, uncertainty, review gates, measurable done criteria, or evidence requirements. Use direct chat for tiny deterministic low-risk answers or edits. Loop-shaped prompts such as \`do X until Y\`, \`review/fix until passing\`, or \`run checks and fix until green\` are especially strong workflow signals. Workflow-first is not builtin-only or monolithic: use named workflows, direct modes, author a custom TypeScript \`workflow({...})\` inline, or import reusable project/package and builtin definitions from \`@bastani/workflows/builtin\` and nest them with \`ctx.workflow(...)\`. Nested children may compose further children within \`maxDepth\`, enabling powerful research → implementation → verification → approval graphs from reusable parts. Start Atomic in a project with \`atomic\`, then talk to it normally. Use \`@file\` to attach files, \`!command\` to run shell output through the model, and \`!!command\` to run shell output without adding it to context.
8
-
9
- ## Core session commands
10
-
11
- | Command | Use |
12
- |---|---|
13
- | \`/login\` | configure auth |
14
- | \`/model\` | switch model |
15
- | \`/settings\` | thinking level, theme, message delivery, transport |
16
- | \`/new\`, \`/resume\` | start or resume sessions |
17
- | \`/tree\`, \`/fork\`, \`/clone\` | branch or navigate session history |
18
- | \`/compact\` | delete safe older context verbatim |
19
- | \`/hotkeys\`, \`/changelog\` | local help and release notes |
20
-
21
- ## Examples of using Atomic
22
-
23
- | Goal | How to use |
24
- |---|---|
25
- | On-call / broken behavior | Use a focused workflow to reproduce, diagnose, repair, and validate; direct debugger/subagent calls remain useful as stages or for tiny deterministic diagnosis |
26
- | Research → spec → implementation | Use \`/skill:research-codebase\`, then \`/skill:create-spec\`, then a named or custom implementation workflow with explicit validation and review |
27
- | Testing / regression hardening | Use a workflow for test/fix loops so retries, evidence, and the passing stop condition are tracked |
28
- | Large repo discovery | Use repository-focused \`fan-out-and-synthesize\` branches plus a synthesis barrier, or launch locator/analyzer/pattern-finder children with the \`subagent\` tool |
29
- | UI / product polish | Run \`/skill:impeccable\` for interface critique and refinement, or \`/workflow open-claude-design\` for one generated preview plus a live review session and export |
30
-
31
- ## Built-in workflows
32
-
33
- | Workflow | When to use | How to run |
34
- |---|---|---|
35
- | \`classify-and-act\` | structured routing with a low-confidence human fallback | \`/workflow classify-and-act prompt="Triage this request"\` |
36
- | \`fan-out-and-synthesize\` | independent slices or repository-focused research with artifact synthesis | \`/workflow fan-out-and-synthesize prompt="Map payment retries by subsystem"\` |
37
- | \`adversarial-verification\` | fresh verification and bounded repair of a candidate | \`/workflow adversarial-verification task="Verify the migration patch"\` |
38
- | \`generate-and-filter\` | generate many candidates and keep a distinct shortlist | \`/workflow generate-and-filter prompt="Propose command names"\` |
39
- | \`tournament\` | compare whole solutions through balanced pairwise judging | \`/workflow tournament prompt="Design the retry strategy"\` |
40
- | \`loop-until-done\` | iterate until explicit evidence passes or the bound is exhausted | \`/workflow loop-until-done prompt="Repair failures until tests pass"\` |
41
- | \`goal\` | ledger-backed autonomous work with receipts and reviewer-gated completion | \`/workflow goal objective="Update CLI docs and validate the docs build"\` |
42
- | \`ralph\` | research-first delegated implementation with bounded multi-model review | \`/workflow ralph prompt="Implement specs/rate-limit.md"\` |
43
- | \`open-claude-design\` | UI and design-system generation with one live review session and export | \`/workflow open-claude-design prompt="Refresh the settings page hierarchy"\` |
44
-
45
- Use \`/workflow list\` to see what is available and \`/workflow inputs <name>\` to inspect inputs in your environment.
46
-
47
- ## Top skills
48
-
49
- | Skill | When to use | How to run |
50
- |---|---|---|
51
- | \`research-codebase\` | write a grounded research artifact for one subsystem or question | \`/skill:research-codebase how the rate limiter works in src/middleware/\` |
52
- | \`create-spec\` | turn research into an implementation-ready plan | \`/skill:create-spec from research/docs/<date>-<topic>.md\` |
53
- | \`tdd\` | do test-first feature or bug work | \`/skill:tdd\` |
54
- | \`prompt-engineer\` | tighten a vague prompt before a long run | \`/skill:prompt-engineer Draft a sharper implementation prompt for ...\` |
55
- | \`subagent\` | learn when and how to delegate with the \`subagent\` tool | \`/skill:subagent\` |
56
- | \`impeccable\` | critique or refine frontend and product UI | \`/skill:impeccable\` |
57
- | \`show-me\` | explain a topic visually with concise diagrams, code-shape sketches, or focused HTML artifacts (HumanLayer, MIT) | \`/skill:show-me\` |
58
-
59
- ## Subagents
60
-
61
- Subagents are focused child Atomic sessions you can point at one job inside the repo.
62
-
63
- | Built-in subagent | Use |
64
- |---|---|
65
- | \`codebase-locator\` | find relevant files, tests, entrypoints, and configs |
66
- | \`codebase-analyzer\` | explain current behavior with file:line refs |
67
- | \`codebase-pattern-finder\` | find existing code to model after |
68
- | \`debugger\` | reproduce, diagnose, and fix broken behavior |
69
-
70
-
71
- ─────────────────────────────────────────────────────────────────
72
-
73
- Where to next:
74
-
75
- \`/atomic example\` — see the pieces used on a code task
76
- \`/atomic workflows\` — learn when to use workflows`;
77
- const EXAMPLE = `# Practical example
78
-
79
- This example shows a spec-driven development process whose clearly delegated autonomous implementation benefits from durable workflow execution. For interactive or conversation-led work, stay inline or use bounded subagents while the parent remains in control. Type the examples below into the Atomic TUI chat after starting \`atomic\` in your project.
80
-
81
- ## 1. Research what exists
82
-
83
- Use \`/skill:research-codebase\` for a scoped area, subsystem, or directory:
84
-
85
- \`/skill:research-codebase how the rate limiter works in src/middleware/\`
86
-
87
- For repository-wide research, use \`fan-out-and-synthesize\` with distinct subsystem partitions, artifact outputs, and a synthesis prompt that cites concrete paths:
88
-
89
- \`/workflow fan-out-and-synthesize prompt="Partition payment retries by subsystem and synthesize cited end-to-end findings"\`
90
-
91
- If the research prompt is vague, tighten it first with \`/skill:prompt-engineer\`:
92
-
93
- \`/skill:prompt-engineer Draft a sharper repo-research prompt for understanding payment retries end to end, including retries, queues, and failure handling.\`
94
-
95
- ## 2. Create a spec when requirements are fuzzy
96
-
97
- Skip this if the implementation request is already precise.
98
-
99
- \`/skill:create-spec from research/docs/<date>-<topic>.md\`
100
-
101
- ## 3. Implement with review built in
102
-
103
- Default to a workflow for non-trivial implementation and review. Use direct chat only for tiny deterministic low-risk edits; use focused subagents inside workflow stages or for bounded specialist passes. Choose an installed workflow when it fits, or author a custom TypeScript workflow inline from the starter patterns when the task needs a richer graph.
104
-
105
- For implementation with review built in, author a task-specific worker → fresh verifier → reducer loop. Give it literal acceptance criteria, deterministic checks, evidence-backed repair payloads, and a bounded stop condition:
106
-
107
- \`Create and run a workflow that implements specs/<date>-<topic>.md, runs focused tests, sends the patch to fresh verifiers, and repairs findings until the documented behavior passes or the iteration bound is reached.\`
108
-
109
- Loop or stop-condition phrasing is a key workflow signal. Encode \`do X until Y\`, \`review/fix until passing\`, or \`run checks and fix until green\` as explicit bounded workflow gates rather than informal retries.
110
-
111
- ## 4. Decide and land
112
-
113
- Use the workflow's deterministic evidence, verifier decision, remaining-work report, and bound-exhaustion state to decide whether to ship, repair, unblock, or clarify. Keep PR/MR creation, deployment, and publication as separately authorized post-approval actions.
114
-
115
- If you implemented directly instead of using a workflow, launch a fresh-context cleanup pass with the \`subagent\` tool and apply only the synthesized fixes you accept.
116
-
117
- ─────────────────────────────────────────────────────────────────
118
-
119
- Where to next:
120
-
121
- \`/atomic workflows\` — learn when to use workflows
122
- \`/atomic overview\` — quick refresh`;
123
- const WORKFLOWS = `# Workflows primer
124
-
125
- A workflow is a TypeScript-defined pipeline exported from \`workflow({...})\`. It can run tasks, chains, parallel fan-out, human-in-the-loop prompts, background status, and model fallback chains.
126
-
127
- Default to workflows for non-trivial work and requests with inherent structure plus a verifiable objective. Implementation, debugging, migrations, multi-file changes, validation, review, evidence requirements, and explicit stop conditions are workflow-shaped; use direct chat only for tiny deterministic low-risk answers or edits.
128
-
129
- Workflow-first is not builtin-only or monolithic. Atomic can author custom TypeScript \`workflow({...})\` definitions inline, and workflows can import reusable project/package definitions or builtins from \`@bastani/workflows/builtin\`, then nest them with \`ctx.workflow(...)\`. Imported children can nest further children within \`maxDepth\`, so compose proven research, implementation, design, verification, and approval workflows instead of copying their stages. Use the documented starter patterns for classify-and-act routing, dynamic fan-out and synthesis, adversarial verification, candidate selection, and bounded convergence. Atomic writes the parent definition, reloads it, and runs the composed graph.
130
-
131
- ## Built-in workflows
132
-
133
- | Workflow | When to use | How to run |
134
- |---|---|---|
135
- | \`classify-and-act\` | structured routing | \`/workflow classify-and-act prompt="Triage this request"\` |
136
- | \`fan-out-and-synthesize\` | independent slices or repository research | \`/workflow fan-out-and-synthesize prompt="Map payment retries by subsystem"\` |
137
- | \`adversarial-verification\` | fresh verification and bounded repair | \`/workflow adversarial-verification task="Verify the patch"\` |
138
- | \`generate-and-filter\` | candidate generation and shortlisting | \`/workflow generate-and-filter prompt="Propose command names"\` |
139
- | \`tournament\` | balanced whole-solution comparison | \`/workflow tournament prompt="Design the retry strategy"\` |
140
- | \`loop-until-done\` | bounded convergence on explicit evidence | \`/workflow loop-until-done prompt="Repair failures until tests pass"\` |
141
- | \`goal\` | durable ledger, bounded orchestration, and reviewer-gated completion | \`/workflow goal objective="Update CLI docs and validate the docs build"\` |
142
- | \`ralph\` | research-first delegated implementation and iterative review | \`/workflow ralph prompt="Implement specs/rate-limit.md"\` |
143
- | \`open-claude-design\` | frontend and product design | \`/workflow open-claude-design prompt="Refresh the settings page hierarchy"\` |
144
-
145
- Use \`/workflow inputs <name>\` to inspect exact inputs. Goal and Ralph skip PR creation unless \`create_pr=true\` explicitly authorizes their post-approval final stage. Use \`/skill:research-codebase\` for one focused subsystem and repository-focused \`fan-out-and-synthesize\` for independent whole-repository slices.
146
-
147
- If you are drafting research, reviewer, or synthesis prompts for a workflow, use \`/skill:prompt-engineer\` first. It is a good fit when a stage prompt feels vague, overloaded, or underspecified.
148
-
149
- ## What good workflow authoring looks like
150
-
151
- A good workflow request is explicit about stage purpose, model choice, handoff, and the decision each step must return.
152
-
153
- For workflow-owned side effects such as filesystem writes, network mutations, and external API actions, prefer \`ctx.tool(name, args, fn)\`: completed calls are durably cached, so resume returns the saved result without rerunning \`fn\`. Keep pure computation as ordinary TypeScript, and do not wrap agent-stage internals or every function call indiscriminately.
154
-
155
- Example: ask Atomic in chat with something like this:
156
-
157
- ~~~text
158
- Create a reusable workflow called review-changes.
159
-
160
- It should accept one required text input called target for a diff, PR summary, or review target.
161
-
162
- Run two independent review stages in parallel with fresh context:
163
- - one reviewer focused on correctness, regressions, and missing tests using openai-codex/gpt-5.5 at xhigh thinking
164
- - one reviewer focused on edge cases, maintainability, and hidden risks using anthropic/claude-opus-4-8 at xhigh thinking
165
-
166
- Then add an aggregate stage that consolidates both reviews, deduplicates overlap, keeps only evidence-backed issues, and separates blockers from optional suggestions using openai/gpt-5.5 at high thinking.
167
-
168
- Finally add an adjudicate stage using anthropic/claude-sonnet-4 at high thinking that decides what to fix now, what to defer, and what to reject. Return a short action list with rationale.
169
-
170
- The workflow should return structured output with consolidated_review and decision fields.
171
- ~~~
172
-
173
- Why this is good:
174
- - it names the workflow and required input
175
- - it specifies which stages are parallel vs sequential
176
- - each stage has one job
177
- - it defines the handoff and final outputs
178
- - it calls out model choice and thinking level where that matters
179
-
180
- ## Run and inspect
181
-
182
- \`/workflow list\`
183
-
184
- \`/workflow inputs fan-out-and-synthesize\`
185
-
186
- \`/workflow fan-out-and-synthesize prompt="Partition the settings flow by subsystem and synthesize cited findings"\`
187
-
188
- \`/workflow inputs adversarial-verification\`
189
-
190
- \`/workflow adversarial-verification task="Verify the settings form validation patch"\`
191
-
192
- \`/workflow status\`
193
-
194
- \`/workflow connect <run-id>\`
195
-
196
- \`/workflow interrupt <run-id>\`
197
-
198
- \`/workflow quit <run-id>\`
199
-
200
- \`/workflow resume <run-id>\`
201
-
202
- Workflows run as background tasks. Use F2 or \`/workflow connect <run-id>\` for the graph viewer. Human-in-the-loop prompts appear there, not as chat modals, and awaiting-input states do not wake the main chat agent. Completion and failure notices are steered back into the main chat; answers submitted in the workflow UI interrupt stale main-chat questions so the model does not ask again.
203
-
204
- ## Author your own
205
-
206
- Describe your workflow in plain chat — say what you want the workflow to accomplish, what inputs it should accept, what stages should run, and what final output or decision it should return. Atomic will use the workflow docs to scaffold a reusable definition under \`.atomic/workflows/\`, ask clarifying questions when stage purpose, models, or handoffs are ambiguous, and run \`/workflow reload\` so you can launch it immediately.
207
-
208
- ─────────────────────────────────────────────────────────────────
209
-
210
- Where to next:
211
-
212
- \`/atomic example\` — see workflows in a normal task flow
213
- \`/atomic overview\` — quick refresh`;
214
- const GUIDE_SECTIONS = [
215
- {
216
- name: "overview",
217
- aliases: [],
218
- label: "overview",
219
- description: "30-second overview",
220
- render: () => OVERVIEW,
221
- },
222
- {
223
- name: "workflows",
224
- aliases: ["workflow"],
225
- label: "workflows",
226
- description: "Workflow primer",
227
- render: () => WORKFLOWS,
228
- },
229
- {
230
- name: "example",
231
- aliases: ["examples"],
232
- label: "example",
233
- description: "Practical first workflow",
234
- render: () => EXAMPLE,
235
- },
236
- {
237
- name: "whats-new",
238
- aliases: ["what's new", "whats new", "news", "updates", "changelog"],
239
- label: "what's new",
240
- description: "Recent release notes",
241
- render: readLatestStableChangelog,
242
- },
243
- ];
244
- export const ATOMIC_GUIDE_HELP_CHOICES = GUIDE_SECTIONS.map((section) => section.label);
245
- const GUIDE_SECTIONS_BY_NAME = new Map(GUIDE_SECTIONS.map((section) => [section.name, section]));
246
- const GUIDE_SECTIONS_BY_LABEL = new Map(GUIDE_SECTIONS.map((section) => [section.label, section]));
247
- const GUIDE_SECTIONS_BY_INPUT = new Map(GUIDE_SECTIONS.flatMap((section) => [section.name, section.label, ...section.aliases].map((input) => [input, section])));
248
- export function isAtomicGuideHelpChoice(choice) {
249
- return GUIDE_SECTIONS_BY_LABEL.has(choice);
250
- }
251
- const ATOMIC_GUIDE_TRAILING_PUNCTUATION = "?!.,;:";
252
- function stripTrailingAtomicGuidePunctuation(value) {
253
- let end = value.length;
254
- while (end > 0 && ATOMIC_GUIDE_TRAILING_PUNCTUATION.includes(value.charAt(end - 1))) {
255
- end--;
256
- }
257
- return value.slice(0, end);
258
- }
259
- function getGuideSectionForChoice(choice) {
260
- return GUIDE_SECTIONS_BY_LABEL.get(choice);
261
- }
262
- function getGuideSectionForMode(mode) {
263
- const section = GUIDE_SECTIONS_BY_NAME.get(mode);
264
- if (!section)
265
- throw new Error(`Unknown Atomic guide section: ${mode}`);
266
- return section;
267
- }
268
- function getAtomicGuideHelpMenu() {
269
- const sectionHelp = GUIDE_SECTIONS.map((section) => `- \`${section.label}\` — run \`/atomic ${section.label}\``).join("\n");
270
- return `# Atomic\n\nSelect where to start:\n\n${sectionHelp}`;
271
- }
272
- export function normalizeAtomicGuideMode(args) {
273
- const normalized = stripTrailingAtomicGuidePunctuation(args.trim().toLowerCase());
274
- if (!normalized)
275
- return "help";
276
- return GUIDE_SECTIONS_BY_INPUT.get(normalized)?.name ?? "help";
277
- }
278
- export function getAtomicGuideArgumentCompletions(prefix) {
279
- const query = prefix.trim().toLowerCase();
280
- const items = GUIDE_SECTIONS.map((section) => ({
281
- value: section.label,
282
- label: section.label,
283
- description: section.description,
284
- }));
285
- const filtered = query
286
- ? items.filter((item) => item.value.startsWith(query) || item.label.startsWith(query))
287
- : items;
288
- return filtered.length > 0 ? filtered : null;
289
- }
290
- function readLatestStableChangelog(cwd) {
291
- const changelogPath = getChangelogPath();
292
- const stableSections = parseChangelog(changelogPath)
293
- .filter((entry) => entry.prerelease === null)
294
- .slice(0, 3)
295
- .map((entry) => entry.content.trim())
296
- .filter(Boolean);
297
- if (stableSections.length === 0) {
298
- return `# What's new\n\nNo stable release sections were found. Try \`/changelog\` for the interactive changelog viewer.\n\n─────────────────────────────────────────────────────────────────\n\nWhere to next:\n\n\`/atomic example\` — see a practical first workflow\n\`/atomic overview\` — quick refresh`;
299
- }
300
- const relativePath = path.relative(cwd, changelogPath) || changelogPath;
301
- return `# What's new\n\n${stableSections.join("\n\n")}\n\nSource: \`${relativePath}\`\n\n─────────────────────────────────────────────────────────────────\n\nWhere to next:\n\n\`/atomic example\` — see a practical first workflow\n\`/atomic overview\` — quick refresh`;
302
- }
303
- export function getAtomicGuideMessage(mode, cwd) {
304
- if (mode === "help")
305
- return getAtomicGuideHelpMenu();
306
- return getGuideSectionForMode(mode).render(cwd);
307
- }
308
- export function atomicGuideModeForChoice(choice) {
309
- return getGuideSectionForChoice(choice)?.name ?? "help";
310
- }
311
- //# sourceMappingURL=atomic-guide-command.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"atomic-guide-command.js","sourceRoot":"","sources":["../../src/core/atomic-guide-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEzE,MAAM,CAAC,MAAM,yBAAyB,GAAG,QAAQ,CAAC;AAClD,MAAM,CAAC,MAAM,gCAAgC,GAAG,kCAAkC,CAAC;AAEnF,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAuEmC,CAAC;AAErD,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA6CqB,CAAC;AAEtC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA0FmB,CAAC;AAEtC,MAAM,cAAc,GAAG;IACtB;QACC,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,oBAAoB;QACjC,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ;KACtB;IACD;QACC,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,CAAC,UAAU,CAAC;QACrB,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,iBAAiB;QAC9B,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS;KACvB;IACD;QACC,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,CAAC,UAAU,CAAC;QACrB,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,0BAA0B;QACvC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO;KACrB;IACD;QACC,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,CAAC;QACpE,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,sBAAsB;QACnC,MAAM,EAAE,yBAAyB;KACjC;CAOC,CAAC;AASJ,MAAM,CAAC,MAAM,yBAAyB,GAAqC,cAAc,CAAC,GAAG,CAC5F,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAC1B,CAAC;AAEF,MAAM,sBAAsB,GAAG,IAAI,GAAG,CACrC,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CACxD,CAAC;AACF,MAAM,uBAAuB,GAAG,IAAI,GAAG,CACtC,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CACzD,CAAC;AACF,MAAM,uBAAuB,GAAG,IAAI,GAAG,CACtC,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAClC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,CAAU,CAAC,CAC3F,CACD,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACrD,OAAO,uBAAuB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,iCAAiC,GAAG,QAAQ,CAAC;AAEnD,SAAS,mCAAmC,CAAC,KAAa;IACzD,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IACvB,OAAO,GAAG,GAAG,CAAC,IAAI,iCAAiC,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrF,GAAG,EAAE,CAAC;IACP,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,wBAAwB,CAAC,MAAc;IAC/C,OAAO,uBAAuB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,sBAAsB,CAAC,IAA4B;IAC3D,MAAM,OAAO,GAAG,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,EAAE,CAAC,CAAC;IACvE,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAS,sBAAsB;IAC9B,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CACrC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,OAAO,CAAC,KAAK,sBAAsB,OAAO,CAAC,KAAK,IAAI,CACxE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,OAAO,yCAAyC,WAAW,EAAE,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACpD,MAAM,UAAU,GAAG,mCAAmC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAClF,IAAI,CAAC,UAAU;QAAE,OAAO,MAAM,CAAC;IAE/B,OAAO,uBAAuB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,IAAI,IAAI,MAAM,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,MAAc;IAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC9C,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,WAAW,EAAE,OAAO,CAAC,WAAW;KAChC,CAAC,CAAC,CAAC;IACJ,MAAM,QAAQ,GAAG,KAAK;QACrB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACtF,CAAC,CAAC,KAAK,CAAC;IACT,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC;AAED,SAAS,yBAAyB,CAAC,GAAW;IAC7C,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,MAAM,cAAc,GAAG,cAAc,CAAC,aAAa,CAAC;SAClD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;SAC5C,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACX,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;SACpC,MAAM,CAAC,OAAO,CAAC,CAAC;IAElB,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,sSAAsS,CAAC;IAC/S,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC,IAAI,aAAa,CAAC;IACxE,OAAO,mBAAmB,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,YAAY,yLAAyL,CAAC;AAC7Q,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAqB,EAAE,GAAW;IACvE,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,sBAAsB,EAAE,CAAC;IACrD,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,MAA6B;IACrE,OAAO,wBAAwB,CAAC,MAAM,CAAC,EAAE,IAAI,IAAI,MAAM,CAAC;AACzD,CAAC","sourcesContent":["import * as path from \"node:path\";\nimport type { AutocompleteItem } from \"@earendil-works/pi-tui\";\nimport { getChangelogPath, parseChangelog } from \"../utils/changelog.ts\";\n\nexport const ATOMIC_GUIDE_COMMAND_NAME = \"atomic\";\nexport const ATOMIC_GUIDE_COMMAND_DESCRIPTION = \"Atomic onboarding and help guide\";\n\nconst OVERVIEW = `# Atomic overview\n\nAtomic turns non-trivial work into executable, inspectable workflows. Default to a workflow for implementation, build, debugging, bug fixes, migrations, features, scoped multi-file changes, and validated docs/code work, or whenever a request has dependencies, handoffs, uncertainty, review gates, measurable done criteria, or evidence requirements. Use direct chat for tiny deterministic low-risk answers or edits. Loop-shaped prompts such as \\`do X until Y\\`, \\`review/fix until passing\\`, or \\`run checks and fix until green\\` are especially strong workflow signals. Workflow-first is not builtin-only or monolithic: use named workflows, direct modes, author a custom TypeScript \\`workflow({...})\\` inline, or import reusable project/package and builtin definitions from \\`@bastani/workflows/builtin\\` and nest them with \\`ctx.workflow(...)\\`. Nested children may compose further children within \\`maxDepth\\`, enabling powerful research → implementation → verification → approval graphs from reusable parts. Start Atomic in a project with \\`atomic\\`, then talk to it normally. Use \\`@file\\` to attach files, \\`!command\\` to run shell output through the model, and \\`!!command\\` to run shell output without adding it to context.\n\n## Core session commands\n\n| Command | Use |\n|---|---|\n| \\`/login\\` | configure auth |\n| \\`/model\\` | switch model |\n| \\`/settings\\` | thinking level, theme, message delivery, transport |\n| \\`/new\\`, \\`/resume\\` | start or resume sessions |\n| \\`/tree\\`, \\`/fork\\`, \\`/clone\\` | branch or navigate session history |\n| \\`/compact\\` | delete safe older context verbatim |\n| \\`/hotkeys\\`, \\`/changelog\\` | local help and release notes |\n\n## Examples of using Atomic\n\n| Goal | How to use |\n|---|---|\n| On-call / broken behavior | Use a focused workflow to reproduce, diagnose, repair, and validate; direct debugger/subagent calls remain useful as stages or for tiny deterministic diagnosis |\n| Research → spec → implementation | Use \\`/skill:research-codebase\\`, then \\`/skill:create-spec\\`, then a named or custom implementation workflow with explicit validation and review |\n| Testing / regression hardening | Use a workflow for test/fix loops so retries, evidence, and the passing stop condition are tracked |\n| Large repo discovery | Use repository-focused \\`fan-out-and-synthesize\\` branches plus a synthesis barrier, or launch locator/analyzer/pattern-finder children with the \\`subagent\\` tool |\n| UI / product polish | Run \\`/skill:impeccable\\` for interface critique and refinement, or \\`/workflow open-claude-design\\` for one generated preview plus a live review session and export |\n\n## Built-in workflows\n\n| Workflow | When to use | How to run |\n|---|---|---|\n| \\`classify-and-act\\` | structured routing with a low-confidence human fallback | \\`/workflow classify-and-act prompt=\"Triage this request\"\\` |\n| \\`fan-out-and-synthesize\\` | independent slices or repository-focused research with artifact synthesis | \\`/workflow fan-out-and-synthesize prompt=\"Map payment retries by subsystem\"\\` |\n| \\`adversarial-verification\\` | fresh verification and bounded repair of a candidate | \\`/workflow adversarial-verification task=\"Verify the migration patch\"\\` |\n| \\`generate-and-filter\\` | generate many candidates and keep a distinct shortlist | \\`/workflow generate-and-filter prompt=\"Propose command names\"\\` |\n| \\`tournament\\` | compare whole solutions through balanced pairwise judging | \\`/workflow tournament prompt=\"Design the retry strategy\"\\` |\n| \\`loop-until-done\\` | iterate until explicit evidence passes or the bound is exhausted | \\`/workflow loop-until-done prompt=\"Repair failures until tests pass\"\\` |\n| \\`goal\\` | ledger-backed autonomous work with receipts and reviewer-gated completion | \\`/workflow goal objective=\"Update CLI docs and validate the docs build\"\\` |\n| \\`ralph\\` | research-first delegated implementation with bounded multi-model review | \\`/workflow ralph prompt=\"Implement specs/rate-limit.md\"\\` |\n| \\`open-claude-design\\` | UI and design-system generation with one live review session and export | \\`/workflow open-claude-design prompt=\"Refresh the settings page hierarchy\"\\` |\n\nUse \\`/workflow list\\` to see what is available and \\`/workflow inputs <name>\\` to inspect inputs in your environment.\n\n## Top skills\n\n| Skill | When to use | How to run |\n|---|---|---|\n| \\`research-codebase\\` | write a grounded research artifact for one subsystem or question | \\`/skill:research-codebase how the rate limiter works in src/middleware/\\` |\n| \\`create-spec\\` | turn research into an implementation-ready plan | \\`/skill:create-spec from research/docs/<date>-<topic>.md\\` |\n| \\`tdd\\` | do test-first feature or bug work | \\`/skill:tdd\\` |\n| \\`prompt-engineer\\` | tighten a vague prompt before a long run | \\`/skill:prompt-engineer Draft a sharper implementation prompt for ...\\` |\n| \\`subagent\\` | learn when and how to delegate with the \\`subagent\\` tool | \\`/skill:subagent\\` |\n| \\`impeccable\\` | critique or refine frontend and product UI | \\`/skill:impeccable\\` |\n| \\`show-me\\` | explain a topic visually with concise diagrams, code-shape sketches, or focused HTML artifacts (HumanLayer, MIT) | \\`/skill:show-me\\` |\n\n## Subagents\n\nSubagents are focused child Atomic sessions you can point at one job inside the repo.\n\n| Built-in subagent | Use |\n|---|---|\n| \\`codebase-locator\\` | find relevant files, tests, entrypoints, and configs |\n| \\`codebase-analyzer\\` | explain current behavior with file:line refs |\n| \\`codebase-pattern-finder\\` | find existing code to model after |\n| \\`debugger\\` | reproduce, diagnose, and fix broken behavior |\n\n\n─────────────────────────────────────────────────────────────────\n\nWhere to next:\n\n\\`/atomic example\\` — see the pieces used on a code task\n\\`/atomic workflows\\` — learn when to use workflows`;\n\nconst EXAMPLE = `# Practical example\n\nThis example shows a spec-driven development process whose clearly delegated autonomous implementation benefits from durable workflow execution. For interactive or conversation-led work, stay inline or use bounded subagents while the parent remains in control. Type the examples below into the Atomic TUI chat after starting \\`atomic\\` in your project.\n\n## 1. Research what exists\n\nUse \\`/skill:research-codebase\\` for a scoped area, subsystem, or directory:\n\n\\`/skill:research-codebase how the rate limiter works in src/middleware/\\`\n\nFor repository-wide research, use \\`fan-out-and-synthesize\\` with distinct subsystem partitions, artifact outputs, and a synthesis prompt that cites concrete paths:\n\n\\`/workflow fan-out-and-synthesize prompt=\"Partition payment retries by subsystem and synthesize cited end-to-end findings\"\\`\n\nIf the research prompt is vague, tighten it first with \\`/skill:prompt-engineer\\`:\n\n\\`/skill:prompt-engineer Draft a sharper repo-research prompt for understanding payment retries end to end, including retries, queues, and failure handling.\\`\n\n## 2. Create a spec when requirements are fuzzy\n\nSkip this if the implementation request is already precise.\n\n\\`/skill:create-spec from research/docs/<date>-<topic>.md\\`\n\n## 3. Implement with review built in\n\nDefault to a workflow for non-trivial implementation and review. Use direct chat only for tiny deterministic low-risk edits; use focused subagents inside workflow stages or for bounded specialist passes. Choose an installed workflow when it fits, or author a custom TypeScript workflow inline from the starter patterns when the task needs a richer graph.\n\nFor implementation with review built in, author a task-specific worker → fresh verifier → reducer loop. Give it literal acceptance criteria, deterministic checks, evidence-backed repair payloads, and a bounded stop condition:\n\n\\`Create and run a workflow that implements specs/<date>-<topic>.md, runs focused tests, sends the patch to fresh verifiers, and repairs findings until the documented behavior passes or the iteration bound is reached.\\`\n\nLoop or stop-condition phrasing is a key workflow signal. Encode \\`do X until Y\\`, \\`review/fix until passing\\`, or \\`run checks and fix until green\\` as explicit bounded workflow gates rather than informal retries.\n\n## 4. Decide and land\n\nUse the workflow's deterministic evidence, verifier decision, remaining-work report, and bound-exhaustion state to decide whether to ship, repair, unblock, or clarify. Keep PR/MR creation, deployment, and publication as separately authorized post-approval actions.\n\nIf you implemented directly instead of using a workflow, launch a fresh-context cleanup pass with the \\`subagent\\` tool and apply only the synthesized fixes you accept.\n\n─────────────────────────────────────────────────────────────────\n\nWhere to next:\n\n\\`/atomic workflows\\` — learn when to use workflows\n\\`/atomic overview\\` — quick refresh`;\n\nconst WORKFLOWS = `# Workflows primer\n\nA workflow is a TypeScript-defined pipeline exported from \\`workflow({...})\\`. It can run tasks, chains, parallel fan-out, human-in-the-loop prompts, background status, and model fallback chains.\n\nDefault to workflows for non-trivial work and requests with inherent structure plus a verifiable objective. Implementation, debugging, migrations, multi-file changes, validation, review, evidence requirements, and explicit stop conditions are workflow-shaped; use direct chat only for tiny deterministic low-risk answers or edits.\n\nWorkflow-first is not builtin-only or monolithic. Atomic can author custom TypeScript \\`workflow({...})\\` definitions inline, and workflows can import reusable project/package definitions or builtins from \\`@bastani/workflows/builtin\\`, then nest them with \\`ctx.workflow(...)\\`. Imported children can nest further children within \\`maxDepth\\`, so compose proven research, implementation, design, verification, and approval workflows instead of copying their stages. Use the documented starter patterns for classify-and-act routing, dynamic fan-out and synthesis, adversarial verification, candidate selection, and bounded convergence. Atomic writes the parent definition, reloads it, and runs the composed graph.\n\n## Built-in workflows\n\n| Workflow | When to use | How to run |\n|---|---|---|\n| \\`classify-and-act\\` | structured routing | \\`/workflow classify-and-act prompt=\"Triage this request\"\\` |\n| \\`fan-out-and-synthesize\\` | independent slices or repository research | \\`/workflow fan-out-and-synthesize prompt=\"Map payment retries by subsystem\"\\` |\n| \\`adversarial-verification\\` | fresh verification and bounded repair | \\`/workflow adversarial-verification task=\"Verify the patch\"\\` |\n| \\`generate-and-filter\\` | candidate generation and shortlisting | \\`/workflow generate-and-filter prompt=\"Propose command names\"\\` |\n| \\`tournament\\` | balanced whole-solution comparison | \\`/workflow tournament prompt=\"Design the retry strategy\"\\` |\n| \\`loop-until-done\\` | bounded convergence on explicit evidence | \\`/workflow loop-until-done prompt=\"Repair failures until tests pass\"\\` |\n| \\`goal\\` | durable ledger, bounded orchestration, and reviewer-gated completion | \\`/workflow goal objective=\"Update CLI docs and validate the docs build\"\\` |\n| \\`ralph\\` | research-first delegated implementation and iterative review | \\`/workflow ralph prompt=\"Implement specs/rate-limit.md\"\\` |\n| \\`open-claude-design\\` | frontend and product design | \\`/workflow open-claude-design prompt=\"Refresh the settings page hierarchy\"\\` |\n\nUse \\`/workflow inputs <name>\\` to inspect exact inputs. Goal and Ralph skip PR creation unless \\`create_pr=true\\` explicitly authorizes their post-approval final stage. Use \\`/skill:research-codebase\\` for one focused subsystem and repository-focused \\`fan-out-and-synthesize\\` for independent whole-repository slices.\n\nIf you are drafting research, reviewer, or synthesis prompts for a workflow, use \\`/skill:prompt-engineer\\` first. It is a good fit when a stage prompt feels vague, overloaded, or underspecified.\n\n## What good workflow authoring looks like\n\nA good workflow request is explicit about stage purpose, model choice, handoff, and the decision each step must return.\n\nFor workflow-owned side effects such as filesystem writes, network mutations, and external API actions, prefer \\`ctx.tool(name, args, fn)\\`: completed calls are durably cached, so resume returns the saved result without rerunning \\`fn\\`. Keep pure computation as ordinary TypeScript, and do not wrap agent-stage internals or every function call indiscriminately.\n\nExample: ask Atomic in chat with something like this:\n\n~~~text\nCreate a reusable workflow called review-changes.\n\nIt should accept one required text input called target for a diff, PR summary, or review target.\n\nRun two independent review stages in parallel with fresh context:\n- one reviewer focused on correctness, regressions, and missing tests using openai-codex/gpt-5.5 at xhigh thinking\n- one reviewer focused on edge cases, maintainability, and hidden risks using anthropic/claude-opus-4-8 at xhigh thinking\n\nThen add an aggregate stage that consolidates both reviews, deduplicates overlap, keeps only evidence-backed issues, and separates blockers from optional suggestions using openai/gpt-5.5 at high thinking.\n\nFinally add an adjudicate stage using anthropic/claude-sonnet-4 at high thinking that decides what to fix now, what to defer, and what to reject. Return a short action list with rationale.\n\nThe workflow should return structured output with consolidated_review and decision fields.\n~~~\n\nWhy this is good:\n- it names the workflow and required input\n- it specifies which stages are parallel vs sequential\n- each stage has one job\n- it defines the handoff and final outputs\n- it calls out model choice and thinking level where that matters\n\n## Run and inspect\n\n\\`/workflow list\\`\n\n\\`/workflow inputs fan-out-and-synthesize\\`\n\n\\`/workflow fan-out-and-synthesize prompt=\"Partition the settings flow by subsystem and synthesize cited findings\"\\`\n\n\\`/workflow inputs adversarial-verification\\`\n\n\\`/workflow adversarial-verification task=\"Verify the settings form validation patch\"\\`\n\n\\`/workflow status\\`\n\n\\`/workflow connect <run-id>\\`\n\n\\`/workflow interrupt <run-id>\\`\n\n\\`/workflow quit <run-id>\\`\n\n\\`/workflow resume <run-id>\\`\n\nWorkflows run as background tasks. Use F2 or \\`/workflow connect <run-id>\\` for the graph viewer. Human-in-the-loop prompts appear there, not as chat modals, and awaiting-input states do not wake the main chat agent. Completion and failure notices are steered back into the main chat; answers submitted in the workflow UI interrupt stale main-chat questions so the model does not ask again.\n\n## Author your own\n\nDescribe your workflow in plain chat — say what you want the workflow to accomplish, what inputs it should accept, what stages should run, and what final output or decision it should return. Atomic will use the workflow docs to scaffold a reusable definition under \\`.atomic/workflows/\\`, ask clarifying questions when stage purpose, models, or handoffs are ambiguous, and run \\`/workflow reload\\` so you can launch it immediately.\n\n─────────────────────────────────────────────────────────────────\n\nWhere to next:\n\n\\`/atomic example\\` — see workflows in a normal task flow\n\\`/atomic overview\\` — quick refresh`;\n\nconst GUIDE_SECTIONS = [\n\t{\n\t\tname: \"overview\",\n\t\taliases: [],\n\t\tlabel: \"overview\",\n\t\tdescription: \"30-second overview\",\n\t\trender: () => OVERVIEW,\n\t},\n\t{\n\t\tname: \"workflows\",\n\t\taliases: [\"workflow\"],\n\t\tlabel: \"workflows\",\n\t\tdescription: \"Workflow primer\",\n\t\trender: () => WORKFLOWS,\n\t},\n\t{\n\t\tname: \"example\",\n\t\taliases: [\"examples\"],\n\t\tlabel: \"example\",\n\t\tdescription: \"Practical first workflow\",\n\t\trender: () => EXAMPLE,\n\t},\n\t{\n\t\tname: \"whats-new\",\n\t\taliases: [\"what's new\", \"whats new\", \"news\", \"updates\", \"changelog\"],\n\t\tlabel: \"what's new\",\n\t\tdescription: \"Recent release notes\",\n\t\trender: readLatestStableChangelog,\n\t},\n] as const satisfies readonly {\n\treadonly name: string;\n\treadonly aliases: readonly string[];\n\treadonly label: string;\n\treadonly description: string;\n\treadonly render: (cwd: string) => string;\n}[];\n\ntype AtomicGuideSection = (typeof GUIDE_SECTIONS)[number];\ntype AtomicGuideSectionName = AtomicGuideSection[\"name\"];\n\nexport type AtomicGuideHelpChoice = AtomicGuideSection[\"label\"];\n\nexport type AtomicGuideMode = \"help\" | AtomicGuideSectionName;\n\nexport const ATOMIC_GUIDE_HELP_CHOICES: readonly AtomicGuideHelpChoice[] = GUIDE_SECTIONS.map(\n\t(section) => section.label,\n);\n\nconst GUIDE_SECTIONS_BY_NAME = new Map<AtomicGuideSectionName, AtomicGuideSection>(\n\tGUIDE_SECTIONS.map((section) => [section.name, section]),\n);\nconst GUIDE_SECTIONS_BY_LABEL = new Map<string, AtomicGuideSection>(\n\tGUIDE_SECTIONS.map((section) => [section.label, section]),\n);\nconst GUIDE_SECTIONS_BY_INPUT = new Map<string, AtomicGuideSection>(\n\tGUIDE_SECTIONS.flatMap((section) =>\n\t\t[section.name, section.label, ...section.aliases].map((input) => [input, section] as const),\n\t),\n);\n\nexport function isAtomicGuideHelpChoice(choice: string): choice is AtomicGuideHelpChoice {\n\treturn GUIDE_SECTIONS_BY_LABEL.has(choice);\n}\n\nconst ATOMIC_GUIDE_TRAILING_PUNCTUATION = \"?!.,;:\";\n\nfunction stripTrailingAtomicGuidePunctuation(value: string): string {\n\tlet end = value.length;\n\twhile (end > 0 && ATOMIC_GUIDE_TRAILING_PUNCTUATION.includes(value.charAt(end - 1))) {\n\t\tend--;\n\t}\n\treturn value.slice(0, end);\n}\n\nfunction getGuideSectionForChoice(choice: string): AtomicGuideSection | undefined {\n\treturn GUIDE_SECTIONS_BY_LABEL.get(choice);\n}\n\nfunction getGuideSectionForMode(mode: AtomicGuideSectionName): AtomicGuideSection {\n\tconst section = GUIDE_SECTIONS_BY_NAME.get(mode);\n\tif (!section) throw new Error(`Unknown Atomic guide section: ${mode}`);\n\treturn section;\n}\n\nfunction getAtomicGuideHelpMenu(): string {\n\tconst sectionHelp = GUIDE_SECTIONS.map(\n\t\t(section) => `- \\`${section.label}\\` — run \\`/atomic ${section.label}\\``,\n\t).join(\"\\n\");\n\treturn `# Atomic\\n\\nSelect where to start:\\n\\n${sectionHelp}`;\n}\n\nexport function normalizeAtomicGuideMode(args: string): AtomicGuideMode {\n\tconst normalized = stripTrailingAtomicGuidePunctuation(args.trim().toLowerCase());\n\tif (!normalized) return \"help\";\n\n\treturn GUIDE_SECTIONS_BY_INPUT.get(normalized)?.name ?? \"help\";\n}\n\nexport function getAtomicGuideArgumentCompletions(prefix: string): AutocompleteItem[] | null {\n\tconst query = prefix.trim().toLowerCase();\n\tconst items = GUIDE_SECTIONS.map((section) => ({\n\t\tvalue: section.label,\n\t\tlabel: section.label,\n\t\tdescription: section.description,\n\t}));\n\tconst filtered = query\n\t\t? items.filter((item) => item.value.startsWith(query) || item.label.startsWith(query))\n\t\t: items;\n\treturn filtered.length > 0 ? filtered : null;\n}\n\nfunction readLatestStableChangelog(cwd: string): string {\n\tconst changelogPath = getChangelogPath();\n\tconst stableSections = parseChangelog(changelogPath)\n\t\t.filter((entry) => entry.prerelease === null)\n\t\t.slice(0, 3)\n\t\t.map((entry) => entry.content.trim())\n\t\t.filter(Boolean);\n\n\tif (stableSections.length === 0) {\n\t\treturn `# What's new\\n\\nNo stable release sections were found. Try \\`/changelog\\` for the interactive changelog viewer.\\n\\n─────────────────────────────────────────────────────────────────\\n\\nWhere to next:\\n\\n\\`/atomic example\\` — see a practical first workflow\\n\\`/atomic overview\\` — quick refresh`;\n\t}\n\n\tconst relativePath = path.relative(cwd, changelogPath) || changelogPath;\n\treturn `# What's new\\n\\n${stableSections.join(\"\\n\\n\")}\\n\\nSource: \\`${relativePath}\\`\\n\\n─────────────────────────────────────────────────────────────────\\n\\nWhere to next:\\n\\n\\`/atomic example\\` — see a practical first workflow\\n\\`/atomic overview\\` — quick refresh`;\n}\n\nexport function getAtomicGuideMessage(mode: AtomicGuideMode, cwd: string): string {\n\tif (mode === \"help\") return getAtomicGuideHelpMenu();\n\treturn getGuideSectionForMode(mode).render(cwd);\n}\n\nexport function atomicGuideModeForChoice(choice: AtomicGuideHelpChoice): AtomicGuideMode {\n\treturn getGuideSectionForChoice(choice)?.name ?? \"help\";\n}\n"]}