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

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 (74) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/builtin/cursor/package.json +2 -2
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/package.json +1 -1
  5. package/dist/builtin/subagents/package.json +1 -1
  6. package/dist/builtin/web-access/package.json +1 -1
  7. package/dist/builtin/workflows/CHANGELOG.md +20 -0
  8. package/dist/builtin/workflows/builtin/goal-prompts.ts +8 -3
  9. package/dist/builtin/workflows/builtin/goal.ts +4 -4
  10. package/dist/builtin/workflows/builtin/ralph-forked-prompts.ts +1 -1
  11. package/dist/builtin/workflows/builtin/ralph-reviewer-prompt.ts +3 -1
  12. package/dist/builtin/workflows/builtin/ralph-runner.ts +2 -0
  13. package/dist/builtin/workflows/builtin/ralph.ts +4 -4
  14. package/dist/builtin/workflows/builtin/shared-prompts.ts +16 -0
  15. package/dist/builtin/workflows/package.json +2 -2
  16. package/dist/builtin/workflows/src/authoring/workflow.ts +1 -0
  17. package/dist/builtin/workflows/src/durable/dbos-lifecycle.ts +27 -1
  18. package/dist/builtin/workflows/src/durable/factory.ts +29 -3
  19. package/dist/builtin/workflows/src/durable/index.ts +2 -0
  20. package/dist/builtin/workflows/src/engine/run-durable-admission.ts +50 -0
  21. package/dist/builtin/workflows/src/engine/run.ts +12 -17
  22. package/dist/builtin/workflows/src/extension/extension-factory.ts +16 -1
  23. package/dist/builtin/workflows/src/extension/extension-lifecycle.ts +16 -2
  24. package/dist/builtin/workflows/src/extension/index.bundle.mjs +71724 -0
  25. package/dist/builtin/workflows/src/extension/runtime.ts +5 -3
  26. package/dist/builtin/workflows/src/extension/workflow-command-registration.ts +4 -1
  27. package/dist/builtin/workflows/src/extension/workflow-prompts.ts +3 -1
  28. package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +1 -0
  29. package/dist/builtin/workflows/src/shared/authoring-contract-ui.ts +1 -0
  30. package/dist/builtin/workflows/src/shared/types.ts +7 -0
  31. package/dist/builtin/workflows/src/shared/workflow-authoring-types.d.ts +1 -0
  32. package/dist/builtin/workflows/src/shared/workflow-authoring-types.ts +1 -0
  33. package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +6 -8
  34. package/dist/builtin/workflows/src/tui/stage-chat-view-types.ts +2 -0
  35. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +4 -0
  36. package/dist/cli/args.d.ts +8 -0
  37. package/dist/cli/args.d.ts.map +1 -1
  38. package/dist/cli/args.js +16 -0
  39. package/dist/cli/args.js.map +1 -1
  40. package/dist/cli.js +2 -0
  41. package/dist/cli.js.map +1 -1
  42. package/dist/modes/interactive/components/chat-session-host-rendering.d.ts.map +1 -1
  43. package/dist/modes/interactive/components/chat-session-host-rendering.js +5 -1
  44. package/dist/modes/interactive/components/chat-session-host-rendering.js.map +1 -1
  45. package/dist/modes/interactive/components/footer.d.ts +7 -1
  46. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  47. package/dist/modes/interactive/components/footer.js +12 -6
  48. package/dist/modes/interactive/components/footer.js.map +1 -1
  49. package/dist/modes/interactive-engine/engine-monitor.d.ts +8 -1
  50. package/dist/modes/interactive-engine/engine-monitor.d.ts.map +1 -1
  51. package/dist/modes/interactive-engine/engine-monitor.js +13 -15
  52. package/dist/modes/interactive-engine/engine-monitor.js.map +1 -1
  53. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
  54. package/dist/modes/rpc/rpc-client-process.js +3 -0
  55. package/dist/modes/rpc/rpc-client-process.js.map +1 -1
  56. package/dist/modes/rpc/rpc-extension-ui.d.ts +3 -1
  57. package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
  58. package/dist/modes/rpc/rpc-extension-ui.js +7 -2
  59. package/dist/modes/rpc/rpc-extension-ui.js.map +1 -1
  60. package/dist/modes/rpc/rpc-session-binding.d.ts +1 -0
  61. package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
  62. package/dist/modes/rpc/rpc-session-binding.js +66 -43
  63. package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
  64. package/dist/rpc-entry.js +6 -2
  65. package/dist/rpc-entry.js.map +1 -1
  66. package/dist/utils/compile-cache.d.ts +8 -0
  67. package/dist/utils/compile-cache.d.ts.map +1 -0
  68. package/dist/utils/compile-cache.js +31 -0
  69. package/dist/utils/compile-cache.js.map +1 -0
  70. package/docs/tui.md +2 -0
  71. package/docs/usage.md +7 -0
  72. package/docs/workflows.md +34 -11
  73. package/npm-shrinkwrap.json +23 -23
  74. package/package.json +2 -2
@@ -12,7 +12,7 @@ import type { ExtensionAPI } from "./public-types.js";
12
12
  import type { WorkflowExtensionRuntimeState } from "./extension-runtime-state.js";
13
13
  import { deAdvertiseAskUserQuestionWhenHeadless, formatStartupDiagnostics } from "./workflow-command-surfaces.js";
14
14
  import { inFlightRunCount } from "./workflow-targets.js";
15
- import { shutdownDbos } from "../durable/dbos-lifecycle.js";
15
+ import { flushDbos, shutdownDbos } from "../durable/dbos-lifecycle.js";
16
16
 
17
17
  let processShutdownInstalled = false;
18
18
 
@@ -28,6 +28,19 @@ function shutdownDbosQuietly(): Promise<void> {
28
28
  });
29
29
  }
30
30
 
31
+ /**
32
+ * Process-preserving host-session boundaries (`/new`, `/resume`, `/fork`,
33
+ * `/reload`) must NOT stop the process-scoped DBOS executor: the replacement
34
+ * session reuses it for subsequent workflow runs. Flush pending durable
35
+ * writes instead, and reserve SDK shutdown for actual process exit.
36
+ */
37
+ function flushDbosQuietly(): Promise<void> {
38
+ return flushDbos().catch((error: unknown) => {
39
+ const detail = error instanceof Error ? error.message : String(error);
40
+ console.error(`atomic-workflows: DBOS durability flush failed: ${detail}`);
41
+ });
42
+ }
43
+
31
44
  function installDbosProcessShutdown(): void {
32
45
  if (processShutdownInstalled) return;
33
46
  processShutdownInstalled = true;
@@ -135,6 +148,7 @@ export function registerWorkflowLifecycleHandlers(
135
148
  deps.storeWidgetRef.current = null;
136
149
  runtimeState.resetWorkflowDiscoveryForSession();
137
150
  runtimeState.setNotificationsActive(false);
138
- await shutdownDbosQuietly();
151
+ if (reason === "quit") await shutdownDbosQuietly();
152
+ else await flushDbosQuietly();
139
153
  });
140
154
  }