@bastani/atomic 0.8.17-0 → 0.8.18-0

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 (53) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +5 -0
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/CHANGELOG.md +5 -0
  5. package/dist/builtin/mcp/package.json +1 -1
  6. package/dist/builtin/subagents/CHANGELOG.md +5 -0
  7. package/dist/builtin/subagents/package.json +1 -1
  8. package/dist/builtin/web-access/CHANGELOG.md +5 -0
  9. package/dist/builtin/web-access/package.json +1 -1
  10. package/dist/builtin/workflows/CHANGELOG.md +25 -0
  11. package/dist/builtin/workflows/README.md +62 -3
  12. package/dist/builtin/workflows/builtin/deep-research-codebase.ts +555 -537
  13. package/dist/builtin/workflows/builtin/goal.ts +5 -0
  14. package/dist/builtin/workflows/builtin/open-claude-design.ts +3 -3
  15. package/dist/builtin/workflows/builtin/ralph.ts +737 -713
  16. package/dist/builtin/workflows/builtin/shared-prompts.ts +11 -0
  17. package/dist/builtin/workflows/package.json +1 -1
  18. package/dist/builtin/workflows/src/extension/discovery.ts +61 -22
  19. package/dist/builtin/workflows/src/extension/index.ts +2 -0
  20. package/dist/builtin/workflows/src/extension/runtime.ts +4 -0
  21. package/dist/builtin/workflows/src/extension/workflow-schema.ts +4 -0
  22. package/dist/builtin/workflows/src/runs/foreground/executor.ts +96 -6
  23. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +2 -0
  24. package/dist/builtin/workflows/src/runs/shared/workflow-runner.ts +7 -0
  25. package/dist/builtin/workflows/src/runs/shared/worktree.ts +214 -1
  26. package/dist/builtin/workflows/src/sdk-surface.ts +2 -0
  27. package/dist/builtin/workflows/src/shared/types.ts +32 -3
  28. package/dist/builtin/workflows/src/workflows/define-workflow.ts +18 -1
  29. package/dist/core/agent-session-services.d.ts +2 -1
  30. package/dist/core/agent-session-services.d.ts.map +1 -1
  31. package/dist/core/agent-session-services.js +1 -0
  32. package/dist/core/agent-session-services.js.map +1 -1
  33. package/dist/core/agent-session.d.ts +3 -0
  34. package/dist/core/agent-session.d.ts.map +1 -1
  35. package/dist/core/agent-session.js +16 -5
  36. package/dist/core/agent-session.js.map +1 -1
  37. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  38. package/dist/core/atomic-guide-command.js +40 -28
  39. package/dist/core/atomic-guide-command.js.map +1 -1
  40. package/dist/core/sdk.d.ts +9 -1
  41. package/dist/core/sdk.d.ts.map +1 -1
  42. package/dist/core/sdk.js +2 -2
  43. package/dist/core/sdk.js.map +1 -1
  44. package/dist/core/system-prompt.d.ts +2 -0
  45. package/dist/core/system-prompt.d.ts.map +1 -1
  46. package/dist/core/system-prompt.js +22 -13
  47. package/dist/core/system-prompt.js.map +1 -1
  48. package/docs/quickstart.md +13 -5
  49. package/docs/sdk.md +20 -5
  50. package/docs/workflows.md +44 -17
  51. package/examples/sdk/05-tools.ts +22 -1
  52. package/examples/sdk/README.md +7 -3
  53. package/package.json +1 -1
@@ -12,6 +12,7 @@ import { tmpdir } from "node:os";
12
12
  import { join } from "node:path";
13
13
  import { defineWorkflow } from "../src/index.js";
14
14
  import type { WorkflowTaskResult } from "../src/shared/types.js";
15
+ import { WORKER_PREFLIGHT_CONTRACT } from "./shared-prompts.js";
15
16
 
16
17
  const DEFAULT_MAX_TURNS = 10;
17
18
  // Goal Runner runs three independent reviewer personas; two approvals form a majority.
@@ -1038,6 +1039,10 @@ export default defineWorkflow("goal")
1038
1039
  prompt: [
1039
1040
  goalContext,
1040
1041
  "",
1042
+ "<project_initialization_preflight>",
1043
+ WORKER_PREFLIGHT_CONTRACT,
1044
+ "</project_initialization_preflight>",
1045
+ "",
1041
1046
  "<worker_turn_contract>",
1042
1047
  WORKER_RECEIPT_CONTRACT,
1043
1048
  "</worker_turn_contract>",
@@ -114,7 +114,7 @@ function joinResults(results: readonly WorkflowTaskResult[]): string {
114
114
  * stay next to the project and are discoverable by pi. Falls back to the OS
115
115
  * tmpdir when the project tree is not writable (CI sandboxes, mocks, etc.).
116
116
  */
117
- function prepareArtifactDir(): {
117
+ function prepareArtifactDir(cwd = process.cwd()): {
118
118
  readonly runId: string;
119
119
  readonly artifactDir: string;
120
120
  readonly previewPath: string;
@@ -122,7 +122,7 @@ function prepareArtifactDir(): {
122
122
  } {
123
123
  const runId = `${new Date().toISOString().replace(/[:.]/g, "-")}-${Math.random().toString(36).slice(2, 8)}`;
124
124
  const candidates = [
125
- join(process.cwd(), "specs", "design", runId),
125
+ join(cwd, "specs", "design", runId),
126
126
  join(tmpdir(), "open-claude-design", runId),
127
127
  ];
128
128
  for (const candidate of candidates) {
@@ -222,7 +222,7 @@ export default defineWorkflow("open-claude-design")
222
222
  DEFAULT_MAX_REFINEMENTS,
223
223
  );
224
224
 
225
- const { runId, artifactDir, previewPath, specPath } = prepareArtifactDir();
225
+ const { runId, artifactDir, previewPath, specPath } = prepareArtifactDir(ctx.cwd);
226
226
  const previewFileUrl = `file://${previewPath}`;
227
227
  const specFileUrl = `file://${specPath}`;
228
228