@bastani/atomic 0.8.17 → 0.8.18

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
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.8.18] - 2026-05-27
6
+
7
+ ### Changed
8
+
9
+ - Promoted the 0.8.18 prerelease changes to a stable release.
10
+
11
+ ## [0.8.18-0] - 2026-05-27
12
+
13
+ ### Added
14
+
15
+ - Added SDK `excludeTools` support for omitting named built-in, extension, and custom tools from `createAgentSession()` sessions while preserving existing `tools` and `noTools` behavior ([#1070](https://github.com/flora131/atomic/issues/1070)).
16
+
17
+ ### Changed
18
+
19
+ - Clarified bundled workflow docs and `/atomic` onboarding copy for using `goal` on smaller scoped changes with explicit outcomes, testing instructions, and done criteria, while positioning `ralph` for larger migrations, broad refactors, and PR-prep workflows.
20
+
5
21
  ## [0.8.17] - 2026-05-26
6
22
 
7
23
  ### Changed
@@ -4,6 +4,11 @@ All notable changes to the `pi-intercom` extension will be documented in this fi
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.18] - 2026-05-27
8
+
9
+ ### Changed
10
+ - Promoted the 0.8.18 prerelease package version to a stable release.
11
+
7
12
  ## [0.8.17] - 2026-05-26
8
13
 
9
14
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.8.17",
3
+ "version": "0.8.18",
4
4
  "private": true,
5
5
  "description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
6
6
  "contributors": [
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.8.18] - 2026-05-27
11
+
12
+ ### Changed
13
+ - Promoted the 0.8.18 prerelease package version to a stable release.
14
+
10
15
  ## [0.8.17] - 2026-05-26
11
16
 
12
17
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.8.17",
3
+ "version": "0.8.18",
4
4
  "private": true,
5
5
  "description": "Atomic extension that adapts MCP (Model Context Protocol) servers into the coding agent. Fork of: https://github.com/nicobailon/pi-mcp-adapter",
6
6
  "contributors": [
@@ -11,6 +11,11 @@
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [0.8.18] - 2026-05-27
15
+
16
+ ### Changed
17
+ - Promoted the 0.8.18 prerelease package version to a stable release.
18
+
14
19
  ## [0.8.17] - 2026-05-26
15
20
 
16
21
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.8.17",
3
+ "version": "0.8.18",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with chains, parallel execution, and TUI clarification. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.18] - 2026-05-27
8
+
9
+ ### Changed
10
+ - Promoted the 0.8.18 prerelease package version to a stable release.
11
+
7
12
  ## [0.8.17] - 2026-05-26
8
13
 
9
14
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.8.17",
3
+ "version": "0.8.18",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -6,6 +6,31 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.8.18] - 2026-05-27
10
+
11
+ ### Changed
12
+
13
+ - Promoted the 0.8.18 prerelease changes to a stable release.
14
+
15
+ ## [0.8.18-0] - 2026-05-27
16
+
17
+ ### Added
18
+
19
+ - Added Ralph `git_worktree_dir` support for running stages from an optional Git worktree, reusing/sharing existing worktrees from the invoking repository as-is and leaving worktrees in place for retries.
20
+
21
+ ### Changed
22
+
23
+ - Replaced regex-based workflow discovery stage validation with runtime empty-graph validation based on actual stage creation while keeping discovery side-effect-free.
24
+ - Threaded named workflow invocation cwd into workflow run contexts so workflow-owned artifacts can use the explicit runner cwd.
25
+ - Split worker project-initialization preflight guidance from Goal receipt/reporting instructions.
26
+
27
+ ### Fixed
28
+
29
+ - Defaulted workflow `ctx.cwd` to the reusable worktree cwd when `worktreeFromInputs` resolves a `gitWorktreeDir`, so workflow-owned artifacts such as Ralph specs are written inside the worktree unless explicitly overridden.
30
+ - Avoided blank deep-research display paths when a displayed artifact path equals the workflow invocation directory.
31
+ - Distinguished Ralph same-repository worktree classification and canonicalization failures from definitely non-Git existing `git_worktree_dir` paths.
32
+ - Updated Ralph to revise a stable original spec file across planner iterations and clarified `git_worktree_dir` null-byte diagnostics.
33
+
9
34
  ## [0.8.17] - 2026-05-26
10
35
 
11
36
  ### Changed
@@ -105,6 +105,64 @@ export default defineWorkflow("review-and-merge")
105
105
  .compile();
106
106
  ```
107
107
 
108
+ ### Reusable Git worktrees
109
+
110
+ Use `gitWorktreeDir` when a workflow should run in a reusable Git worktree instead of the invoking checkout. The executor creates the worktree if it is missing, reuses it when it already exists as a same-repository worktree root, defaults workflow `ctx.cwd` to the matching path inside that worktree for `worktreeFromInputs`, and defaults stage/task `cwd` to that worktree path.
111
+
112
+ ```typescript
113
+ import { defineWorkflow } from "@bastani/workflows";
114
+
115
+ export default defineWorkflow("safe-implementation")
116
+ .description("Run implementation stages in a reusable worktree.")
117
+ .input("task", { type: "text", required: true })
118
+ .input("worktree", { type: "string", default: "" })
119
+ .input("base_branch", { type: "string", default: "origin/main" })
120
+ .worktreeFromInputs({
121
+ gitWorktreeDir: "worktree",
122
+ baseBranch: "base_branch",
123
+ })
124
+ .run(async (ctx) => {
125
+ const result = await ctx.task("implement", {
126
+ task: String(ctx.inputs.task),
127
+ // No cwd needed: when `worktree` is non-empty, this task runs from the
128
+ // corresponding cwd inside that reusable Git worktree.
129
+ });
130
+ return { result: result.text };
131
+ })
132
+ .compile();
133
+ ```
134
+
135
+ You can also pass worktree options per stage/task or as shared chain/parallel defaults:
136
+
137
+ ```typescript
138
+ await ctx.stage("review", {
139
+ gitWorktreeDir: "../review-worktree",
140
+ baseBranch: "origin/main",
141
+ }).prompt("Review the current changes.");
142
+
143
+ await ctx.parallel([
144
+ { name: "security", task: "Security review" },
145
+ { name: "runtime", task: "Runtime review" },
146
+ ], {
147
+ gitWorktreeDir: "../review-worktree",
148
+ baseBranch: "origin/main",
149
+ failFast: false,
150
+ });
151
+ ```
152
+
153
+ Worktree semantics:
154
+
155
+ - `gitWorktreeDir` must be used from inside a Git repository. Relative paths resolve from the logical invoking repository root; absolute paths are used as-is.
156
+ - If the requested path exists, it must be an actual Git worktree/checkout root belonging to the invoking repository. Existing subdirectories are rejected so writes do not silently land in the main checkout.
157
+ - If the path is missing, the parent directory is created and Git runs `git worktree add --detach <path> <baseBranch>`. `baseBranch` defaults to `HEAD` when omitted.
158
+ - The default execution cwd preserves the caller's repo-relative cwd inside the worktree. For example, invoking a workflow from `repo/packages/api` with `gitWorktreeDir=../repo-wt` uses `../repo-wt/packages/api` for workflow `ctx.cwd` and stage/task execution.
159
+ - Symlinked repo/worktree paths preserve their logical spelling in the default cwd, matching Codex-style worktree behavior.
160
+ - Explicit `cwd` still wins. Relative `cwd` values are resolved against the worktree default cwd; absolute `cwd` values are used as provided.
161
+
162
+ `worktree: true` is different: it creates temporary isolated worktrees for direct task/parallel/chain execution and cleans them up afterward. It is mutually exclusive with `gitWorktreeDir`, which is intended for named/reusable worktrees that remain available across retries.
163
+
164
+ For advanced integrations, the SDK also exports `setupGitWorktree(options)`, which returns `{ worktreeRoot, cwd, repositoryRoot, created }` and uses the same validation/path behavior as the executor.
165
+
108
166
  ### Model fallbacks
109
167
 
110
168
  Stages and high-level task helpers can retry transient provider/model failures with an ordered `fallbackModels` list. The primary `model` is tried first, then each fallback, and finally the current pi-selected model when available. Fallbacks are only used for retryable model/provider failures such as rate limits, quota/auth/provider outages, unavailable models, network timeouts, and 5xx errors — ordinary tool, shell, validation, cancellation, and workflow-code failures are not retried.
@@ -280,7 +338,7 @@ await runWorkflow({
280
338
  });
281
339
  ```
282
340
 
283
- The programmatic definition object mirrors the workflow tool: named workflow runs, single-task runs, parallel `tasks`, and mixed `chain` runs accept the same direct options (`reads`, `output`, `outputMode`, `worktree`, `maxOutput`, `artifacts`, `concurrency`, `failFast`, and stage/session options such as `cwd`, `agentDir`, `model`, `tools`, `context`, and `sessionDir`). `chainDir` is chain-only: it provides the shared artifact directory for chain reads, outputs, and worktree diffs.
341
+ The programmatic definition object mirrors the workflow tool: named workflow runs, single-task runs, parallel `tasks`, and mixed `chain` runs accept the same direct options (`reads`, `output`, `outputMode`, `worktree`, `gitWorktreeDir`, `baseBranch`, `maxOutput`, `artifacts`, `concurrency`, `failFast`, and stage/session options such as `cwd`, `agentDir`, `model`, `tools`, `context`, and `sessionDir`). `chainDir` is chain-only: it provides the shared artifact directory for chain reads, outputs, and worktree diffs.
284
342
 
285
343
  Workflow stage sessions follow Atomic SDK directory defaults: `DefaultResourceLoader` is initialized with the project `cwd` and the Atomic default `~/.atomic/agent` directory, while legacy `.pi` paths remain readable where the SDK supports multiple config directories. A stage-supplied `agentDir` is treated as an explicit user override; a stage-supplied `resourceLoader` owns discovery, with `cwd`/`agentDir` left for session naming and tool path resolution.
286
344
 
@@ -333,8 +391,9 @@ Plan → orchestrate → simplify → discover → review → PR-handoff workflo
333
391
  | Input | Type | Required | Default | Description |
334
392
  | ------------- | -------- | -------- | ------------- | ------------------------------------------------------------- |
335
393
  | `prompt` | `text` | ✓ | — | Task, feature request, issue summary, or spec path to plan, execute, refine, review, and prepare for PR. |
336
- | `max_loops` | `number` | — | `10` | Maximum plan/orchestrate/review iterations before PR handoff. |
337
- | `base_branch` | `string` | — | `origin/main` | Branch reviewers and PR-prep compare the current delta with. |
394
+ | `max_loops` | `number` | — | `10` | Maximum plan/orchestrate/review iterations before PR handoff. |
395
+ | `base_branch` | `string` | — | `origin/main` | Branch reviewers and PR-prep compare the current delta with; also used to create a missing worktree. |
396
+ | `git_worktree_dir` | `string` | — | `""` | Optional reusable Git worktree root. Empty runs in the invoking checkout; non-empty values run Ralph stages in the created/reused worktree. |
338
397
 
339
398
  ### `open-claude-design`
340
399