@bastani/atomic 0.9.11-alpha.10 → 0.9.11-alpha.12

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 (224) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +1 -1
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/intercom/subagent-relay.ts +8 -5
  5. package/dist/builtin/mcp/package.json +1 -1
  6. package/dist/builtin/subagents/package.json +1 -1
  7. package/dist/builtin/subagents/src/extension/notification-content.ts +14 -9
  8. package/dist/builtin/subagents/src/runs/background/notify.ts +20 -4
  9. package/dist/builtin/web-access/CHANGELOG.md +13 -0
  10. package/dist/builtin/web-access/content-tools.ts +1 -0
  11. package/dist/builtin/web-access/flat-string.ts +37 -0
  12. package/dist/builtin/web-access/github-api.ts +2 -1
  13. package/dist/builtin/web-access/github-extract.ts +3 -2
  14. package/dist/builtin/web-access/package.json +2 -2
  15. package/dist/builtin/workflows/CHANGELOG.md +10 -0
  16. package/dist/builtin/workflows/builtin/goal-ledger.ts +6 -4
  17. package/dist/builtin/workflows/builtin/goal-runner.ts +2 -1
  18. package/dist/builtin/workflows/builtin/goal.ts +1 -1
  19. package/dist/builtin/workflows/builtin/ralph-core.ts +8 -9
  20. package/dist/builtin/workflows/builtin/ralph-forked-prompts.ts +2 -4
  21. package/dist/builtin/workflows/builtin/ralph-runner.ts +5 -8
  22. package/dist/builtin/workflows/builtin/ralph.ts +2 -1
  23. package/dist/builtin/workflows/package.json +1 -1
  24. package/dist/builtin/workflows/src/durable/completed-catalog.ts +14 -8
  25. package/dist/builtin/workflows/src/durable/completed-inspection.ts +10 -11
  26. package/dist/builtin/workflows/src/durable/resume-catalog.ts +1 -1
  27. package/dist/builtin/workflows/src/durable/resume-eligibility.ts +42 -0
  28. package/dist/builtin/workflows/src/durable/resume-runtime.ts +36 -37
  29. package/dist/builtin/workflows/src/durable/tool-primitive.ts +10 -2
  30. package/dist/builtin/workflows/src/engine/run.ts +1 -0
  31. package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +12 -8
  32. package/dist/builtin/workflows/src/extension/hil-answer-notifications.ts +5 -2
  33. package/dist/builtin/workflows/src/extension/index.bundle.mjs +1962 -876
  34. package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +6 -3
  35. package/dist/builtin/workflows/src/extension/postmortem-deps.ts +3 -2
  36. package/dist/builtin/workflows/src/extension/render-result.ts +4 -11
  37. package/dist/builtin/workflows/src/extension/runtime-durable-resume.ts +17 -20
  38. package/dist/builtin/workflows/src/extension/runtime.ts +3 -3
  39. package/dist/builtin/workflows/src/extension/workflow-command-completions.ts +1 -1
  40. package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +3 -7
  41. package/dist/builtin/workflows/src/extension/workflow-durable-resume-command.ts +21 -24
  42. package/dist/builtin/workflows/src/extension/workflow-resume-picker-rows.ts +38 -26
  43. package/dist/builtin/workflows/src/extension/workflow-resume-shadow.ts +2 -1
  44. package/dist/builtin/workflows/src/extension/workflow-run-control-command.ts +56 -64
  45. package/dist/builtin/workflows/src/extension/workflow-schema.ts +2 -2
  46. package/dist/builtin/workflows/src/extension/workflow-status-summary.ts +0 -5
  47. package/dist/builtin/workflows/src/extension/workflow-targets.ts +17 -20
  48. package/dist/builtin/workflows/src/extension/workflow-tool-content.ts +1 -1
  49. package/dist/builtin/workflows/src/extension/workflow-tool-control.ts +24 -51
  50. package/dist/builtin/workflows/src/extension/workflow-tool-inspection.ts +7 -29
  51. package/dist/builtin/workflows/src/extension/workflow-tool-send.ts +5 -13
  52. package/dist/builtin/workflows/src/extension/workflow-tool.ts +4 -13
  53. package/dist/builtin/workflows/src/runs/background/quit.ts +4 -3
  54. package/dist/builtin/workflows/src/runs/background/run-inspect.ts +8 -8
  55. package/dist/builtin/workflows/src/runs/background/status.ts +2 -1
  56. package/dist/builtin/workflows/src/runs/background/workflow-lifecycle-aggregate.ts +2 -1
  57. package/dist/builtin/workflows/src/runs/foreground/executor-direct-helpers.ts +5 -5
  58. package/dist/builtin/workflows/src/runs/foreground/executor-lifecycle.ts +4 -0
  59. package/dist/builtin/workflows/src/runs/foreground/executor-scheduler.ts +2 -0
  60. package/dist/builtin/workflows/src/runs/foreground/executor-stage-call.ts +23 -8
  61. package/dist/builtin/workflows/src/runs/foreground/executor-stage-factory.ts +6 -2
  62. package/dist/builtin/workflows/src/runs/foreground/executor-task-prompts.ts +5 -0
  63. package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +56 -10
  64. package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +6 -0
  65. package/dist/builtin/workflows/src/runs/foreground/stage-runner-output.ts +137 -6
  66. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +2 -0
  67. package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +2 -0
  68. package/dist/builtin/workflows/src/shared/expanded-workflow-graph.ts +159 -10
  69. package/dist/builtin/workflows/src/shared/flat-string.ts +33 -0
  70. package/dist/builtin/workflows/src/shared/graph-store-snapshot.ts +144 -0
  71. package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +2 -3
  72. package/dist/builtin/workflows/src/shared/run-id.ts +36 -0
  73. package/dist/builtin/workflows/src/shared/store-internal.ts +32 -3
  74. package/dist/builtin/workflows/src/shared/store-observation.ts +10 -0
  75. package/dist/builtin/workflows/src/shared/store-public-types.ts +8 -0
  76. package/dist/builtin/workflows/src/shared/store-run-methods.ts +14 -0
  77. package/dist/builtin/workflows/src/shared/store-types.ts +4 -0
  78. package/dist/builtin/workflows/src/shared/types.ts +2 -0
  79. package/dist/builtin/workflows/src/shared/workflow-artifacts.ts +261 -0
  80. package/dist/builtin/workflows/src/tui/dispatch-confirm.ts +39 -23
  81. package/dist/builtin/workflows/src/tui/graph-canvas.ts +26 -9
  82. package/dist/builtin/workflows/src/tui/graph-view-constants.ts +3 -0
  83. package/dist/builtin/workflows/src/tui/graph-view-graph-render.ts +95 -98
  84. package/dist/builtin/workflows/src/tui/graph-view-render.ts +7 -20
  85. package/dist/builtin/workflows/src/tui/graph-view-state.ts +160 -13
  86. package/dist/builtin/workflows/src/tui/layout.ts +8 -2
  87. package/dist/builtin/workflows/src/tui/node-card.ts +57 -45
  88. package/dist/builtin/workflows/src/tui/overlay-adapter.ts +4 -2
  89. package/dist/builtin/workflows/src/tui/prompt-card-render.ts +291 -21
  90. package/dist/builtin/workflows/src/tui/prompt-card.ts +1 -1
  91. package/dist/builtin/workflows/src/tui/renderers.ts +0 -1
  92. package/dist/builtin/workflows/src/tui/run-detail.ts +52 -35
  93. package/dist/builtin/workflows/src/tui/run-identity-rows.ts +97 -0
  94. package/dist/builtin/workflows/src/tui/session-overlays.ts +24 -3
  95. package/dist/builtin/workflows/src/tui/session-picker.ts +94 -41
  96. package/dist/builtin/workflows/src/tui/stage-chat-view-archive-history.ts +190 -26
  97. package/dist/builtin/workflows/src/tui/stage-chat-view-footer-status.ts +52 -18
  98. package/dist/builtin/workflows/src/tui/stage-chat-view-input.ts +9 -5
  99. package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +44 -4
  100. package/dist/builtin/workflows/src/tui/stage-chat-view-types.ts +3 -1
  101. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +3 -2
  102. package/dist/builtin/workflows/src/tui/status-list.ts +67 -45
  103. package/dist/builtin/workflows/src/tui/store-widget-installer.ts +7 -6
  104. package/dist/builtin/workflows/src/tui/widget.ts +49 -40
  105. package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +15 -10
  106. package/dist/builtin/workflows/src/tui/workflow-resume-selector.ts +21 -8
  107. package/dist/core/agent-session-accessors.d.ts.map +1 -1
  108. package/dist/core/agent-session-accessors.js +5 -0
  109. package/dist/core/agent-session-accessors.js.map +1 -1
  110. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  111. package/dist/core/agent-session-auto-compaction.js +5 -0
  112. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  113. package/dist/core/agent-session-compaction.d.ts.map +1 -1
  114. package/dist/core/agent-session-compaction.js +3 -0
  115. package/dist/core/agent-session-compaction.js.map +1 -1
  116. package/dist/core/agent-session-events.d.ts.map +1 -1
  117. package/dist/core/agent-session-events.js +2 -1
  118. package/dist/core/agent-session-events.js.map +1 -1
  119. package/dist/core/agent-session-message-queue.d.ts +3 -7
  120. package/dist/core/agent-session-message-queue.d.ts.map +1 -1
  121. package/dist/core/agent-session-message-queue.js +27 -13
  122. package/dist/core/agent-session-message-queue.js.map +1 -1
  123. package/dist/core/agent-session-methods.d.ts +5 -3
  124. package/dist/core/agent-session-methods.d.ts.map +1 -1
  125. package/dist/core/agent-session-methods.js.map +1 -1
  126. package/dist/core/agent-session-persistent-custom-messages.d.ts.map +1 -1
  127. package/dist/core/agent-session-persistent-custom-messages.js +6 -3
  128. package/dist/core/agent-session-persistent-custom-messages.js.map +1 -1
  129. package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
  130. package/dist/core/agent-session-post-tool-compaction.js +11 -2
  131. package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
  132. package/dist/core/agent-session-tree.d.ts.map +1 -1
  133. package/dist/core/agent-session-tree.js +4 -0
  134. package/dist/core/agent-session-tree.js.map +1 -1
  135. package/dist/core/agent-session-types.d.ts +4 -0
  136. package/dist/core/agent-session-types.d.ts.map +1 -1
  137. package/dist/core/agent-session-types.js.map +1 -1
  138. package/dist/core/agent-session.d.ts +2 -1
  139. package/dist/core/agent-session.d.ts.map +1 -1
  140. package/dist/core/agent-session.js +1 -0
  141. package/dist/core/agent-session.js.map +1 -1
  142. package/dist/core/bounded-model-refresh.d.ts +14 -0
  143. package/dist/core/bounded-model-refresh.d.ts.map +1 -0
  144. package/dist/core/bounded-model-refresh.js +38 -0
  145. package/dist/core/bounded-model-refresh.js.map +1 -0
  146. package/dist/core/messages.d.ts +5 -1
  147. package/dist/core/messages.d.ts.map +1 -1
  148. package/dist/core/messages.js +2 -1
  149. package/dist/core/messages.js.map +1 -1
  150. package/dist/core/session-manager-core.d.ts +1 -1
  151. package/dist/core/session-manager-core.d.ts.map +1 -1
  152. package/dist/core/session-manager-core.js +2 -2
  153. package/dist/core/session-manager-core.js.map +1 -1
  154. package/dist/core/session-manager-entries.d.ts +1 -1
  155. package/dist/core/session-manager-entries.d.ts.map +1 -1
  156. package/dist/core/session-manager-entries.js +2 -1
  157. package/dist/core/session-manager-entries.js.map +1 -1
  158. package/dist/core/session-manager-history.d.ts.map +1 -1
  159. package/dist/core/session-manager-history.js +2 -2
  160. package/dist/core/session-manager-history.js.map +1 -1
  161. package/dist/core/session-manager-types.d.ts +3 -0
  162. package/dist/core/session-manager-types.d.ts.map +1 -1
  163. package/dist/core/session-manager-types.js.map +1 -1
  164. package/dist/index.d.ts +1 -1
  165. package/dist/index.d.ts.map +1 -1
  166. package/dist/index.js.map +1 -1
  167. package/dist/modes/interactive/components/chat-session-host-actions.d.ts +7 -2
  168. package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
  169. package/dist/modes/interactive/components/chat-session-host-actions.js +13 -4
  170. package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
  171. package/dist/modes/interactive/components/chat-session-host-editor.d.ts +3 -1
  172. package/dist/modes/interactive/components/chat-session-host-editor.d.ts.map +1 -1
  173. package/dist/modes/interactive/components/chat-session-host-editor.js +2 -2
  174. package/dist/modes/interactive/components/chat-session-host-editor.js.map +1 -1
  175. package/dist/modes/interactive/components/chat-session-host-events.d.ts +3 -0
  176. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  177. package/dist/modes/interactive/components/chat-session-host-events.js +5 -4
  178. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  179. package/dist/modes/interactive/components/chat-session-host.d.ts +16 -2
  180. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  181. package/dist/modes/interactive/components/chat-session-host.js +31 -4
  182. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  183. package/dist/modes/interactive/components/index.d.ts +1 -0
  184. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  185. package/dist/modes/interactive/components/index.js.map +1 -1
  186. package/dist/modes/interactive/components/model-selector.d.ts +0 -1
  187. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  188. package/dist/modes/interactive/components/model-selector.js +23 -45
  189. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  190. package/dist/modes/interactive/interactive-editor-actions.js +2 -1
  191. package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
  192. package/dist/modes/interactive/interactive-input-handling.js +1 -1
  193. package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
  194. package/dist/modes/interactive/interactive-mode-surface.d.ts +4 -1
  195. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  196. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  197. package/dist/modes/interactive/interactive-model-routing.js +4 -1
  198. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  199. package/dist/modes/interactive/interactive-pause.d.ts +3 -1
  200. package/dist/modes/interactive/interactive-pause.d.ts.map +1 -1
  201. package/dist/modes/interactive/interactive-pause.js +5 -1
  202. package/dist/modes/interactive/interactive-pause.js.map +1 -1
  203. package/dist/modes/interactive/interactive-queueing.js +3 -3
  204. package/dist/modes/interactive/interactive-queueing.js.map +1 -1
  205. package/dist/modes/interactive-engine/isolated-runtime.d.ts +1 -0
  206. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  207. package/dist/modes/interactive-engine/isolated-runtime.js +5 -0
  208. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  209. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  210. package/dist/modes/rpc/rpc-command-handler.js +1 -0
  211. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  212. package/dist/modes/rpc/rpc-types.d.ts +2 -1
  213. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  214. package/dist/modes/rpc/rpc-types.js.map +1 -1
  215. package/docs/index.md +10 -0
  216. package/docs/keybindings.md +1 -1
  217. package/docs/models.md +1 -1
  218. package/docs/quickstart.md +7 -1
  219. package/docs/termux.md +3 -1
  220. package/docs/usage.md +3 -2
  221. package/docs/workflows.md +82 -46
  222. package/npm-shrinkwrap.json +59 -27
  223. package/package.json +3 -3
  224. package/dist/builtin/workflows/src/tui/toast.ts +0 -107
@@ -1,107 +0,0 @@
1
- /**
2
- * Toast stack — transient notifications anchored top-right of the overlay.
3
- *
4
- * Visual: solid status-coloured pill (`success`/`warning`/`info`/`error`)
5
- * with `backgroundElement` foreground and bold weight — same vocabulary as
6
- * the header pill (DESIGN.md §5 Mode Pills). Icon glyphs use the same
7
- * cross-platform text symbols as the rest of the workflow UI (`✓ ✗ ⚠ ℹ`).
8
- */
9
-
10
- import { BOLD, hexBg, hexToAnsi, RESET } from "./color-utils.js";
11
- import type { GraphTheme } from "./graph-theme.js";
12
-
13
- export type ToastKind = "success" | "error" | "warn" | "info";
14
-
15
- export interface Toast {
16
- id: string;
17
- kind: ToastKind;
18
- message: string;
19
- createdAt: number;
20
- /** undefined = persistent */
21
- dismissAfterMs?: number;
22
- }
23
-
24
- export interface ToastManagerState {
25
- toasts: Toast[];
26
- }
27
-
28
- let _toastCounter = 0;
29
-
30
- export function createToastManager(): {
31
- add(toast: Omit<Toast, "id" | "createdAt">): string;
32
- dismiss(id: string): void;
33
- tick(now: number): void;
34
- active(): Toast[];
35
- } {
36
- const toasts: Toast[] = [];
37
-
38
- return {
39
- add(toast) {
40
- const id = `toast-${++_toastCounter}`;
41
- toasts.push({ ...toast, id, createdAt: Date.now() });
42
- return id;
43
- },
44
- dismiss(id) {
45
- const idx = toasts.findIndex((t) => t.id === id);
46
- if (idx !== -1) toasts.splice(idx, 1);
47
- },
48
- tick(now) {
49
- let i = toasts.length;
50
- while (i--) {
51
- const t = toasts[i]!;
52
- if (t.dismissAfterMs != null && now - t.createdAt >= t.dismissAfterMs) {
53
- toasts.splice(i, 1);
54
- }
55
- }
56
- },
57
- active() {
58
- return [...toasts];
59
- },
60
- };
61
- }
62
-
63
- export interface ToastOpts {
64
- theme: GraphTheme;
65
- }
66
-
67
- function kindIcon(kind: ToastKind): string {
68
- switch (kind) {
69
- case "success":
70
- return "✓";
71
- case "error":
72
- return "✗";
73
- case "warn":
74
- return "⚠";
75
- case "info":
76
- return "ℹ";
77
- }
78
- }
79
-
80
- function kindBg(kind: ToastKind, theme: GraphTheme): string {
81
- switch (kind) {
82
- case "success":
83
- return theme.success;
84
- case "error":
85
- return theme.error;
86
- case "warn":
87
- return theme.warning;
88
- case "info":
89
- return theme.info;
90
- }
91
- }
92
-
93
- /** Render the toast stack as styled lines (caller overlays them). */
94
- export function renderToasts(toasts: Toast[], opts: ToastOpts): string[] {
95
- const { theme } = opts;
96
- const fg = hexToAnsi(theme.backgroundElement);
97
- const lines: string[] = [];
98
-
99
- for (const toast of toasts) {
100
- const bg = hexBg(kindBg(toast.kind, theme));
101
- const icon = kindIcon(toast.kind);
102
- const msg = toast.message.length > 40 ? `${toast.message.slice(0, 39)}…` : toast.message;
103
- lines.push(`${bg}${fg}${BOLD} ${icon} ${msg} ${RESET}`);
104
- }
105
-
106
- return lines;
107
- }