@bastani/atomic 0.8.28 → 0.8.29-alpha.3
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.
- package/CHANGELOG.md +37 -0
- package/dist/builtin/cursor/CHANGELOG.md +27 -0
- package/dist/builtin/cursor/LICENSE +26 -0
- package/dist/builtin/cursor/README.md +22 -0
- package/dist/builtin/cursor/index.ts +9 -0
- package/dist/builtin/cursor/package.json +46 -0
- package/dist/builtin/cursor/src/auth.ts +352 -0
- package/dist/builtin/cursor/src/catalog-cache.ts +155 -0
- package/dist/builtin/cursor/src/config.ts +123 -0
- package/dist/builtin/cursor/src/conversation-state.ts +135 -0
- package/dist/builtin/cursor/src/cursor-models-raw.json +583 -0
- package/dist/builtin/cursor/src/model-mapper.ts +270 -0
- package/dist/builtin/cursor/src/models.ts +54 -0
- package/dist/builtin/cursor/src/native-loader.ts +71 -0
- package/dist/builtin/cursor/src/proto/README.md +34 -0
- package/dist/builtin/cursor/src/proto/agent_pb.ts +15294 -0
- package/dist/builtin/cursor/src/proto/protobuf-codec.ts +717 -0
- package/dist/builtin/cursor/src/provider.ts +301 -0
- package/dist/builtin/cursor/src/stream.ts +564 -0
- package/dist/builtin/cursor/src/transport.ts +791 -0
- package/dist/builtin/intercom/CHANGELOG.md +4 -0
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/intercom/skills/intercom/SKILL.md +5 -5
- package/dist/builtin/mcp/CHANGELOG.md +4 -0
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/subagents/CHANGELOG.md +13 -0
- package/dist/builtin/subagents/README.md +7 -3
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +9 -24
- package/dist/builtin/subagents/agents/debugger.md +3 -5
- package/dist/builtin/subagents/package.json +4 -4
- package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +2 -1
- package/dist/builtin/subagents/src/runs/foreground/execution.ts +2 -1
- package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +1 -0
- package/dist/builtin/subagents/src/runs/shared/pi-args.ts +19 -2
- package/dist/builtin/subagents/src/runs/shared/structured-output.ts +271 -10
- package/dist/builtin/subagents/src/runs/shared/subagent-prompt-runtime.ts +12 -39
- package/dist/builtin/subagents/src/shared/types.ts +5 -3
- package/dist/builtin/subagents/src/shared/utils.ts +50 -10
- package/dist/builtin/subagents/src/slash/saved-chain-mapping.ts +77 -0
- package/dist/builtin/subagents/src/slash/slash-commands.ts +1 -55
- package/dist/builtin/web-access/CHANGELOG.md +5 -1
- package/dist/builtin/web-access/README.md +1 -1
- package/dist/builtin/web-access/github-extract.ts +1 -1
- package/dist/builtin/web-access/package.json +3 -3
- package/dist/builtin/workflows/CHANGELOG.md +26 -0
- package/dist/builtin/workflows/README.md +28 -8
- package/dist/builtin/workflows/builtin/deep-research-codebase.ts +9 -49
- package/dist/builtin/workflows/builtin/goal.ts +63 -106
- package/dist/builtin/workflows/builtin/index.d.ts +2 -0
- package/dist/builtin/workflows/builtin/open-claude-design.ts +31 -76
- package/dist/builtin/workflows/builtin/ralph.d.ts +2 -0
- package/dist/builtin/workflows/builtin/ralph.ts +227 -518
- package/dist/builtin/workflows/builtin/shared-prompts.ts +7 -0
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/skills/research-codebase/SKILL.md +17 -3
- package/dist/builtin/workflows/src/extension/wiring.ts +72 -9
- package/dist/builtin/workflows/src/extension/workflow-schema.ts +34 -0
- package/dist/builtin/workflows/src/runs/foreground/executor.ts +13 -2
- package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +86 -14
- package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +11 -3
- package/dist/builtin/workflows/src/shared/types.ts +8 -4
- package/dist/builtin/workflows/src/tui/overlay-adapter.ts +64 -2
- package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +8 -8
- package/dist/builtin/workflows/src/tui/workflow-status.ts +2 -0
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +7 -7
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/core/builtin-packages.d.ts.map +1 -1
- package/dist/core/builtin-packages.js +6 -0
- package/dist/core/builtin-packages.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/types.d.ts +20 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +17 -8
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-manager.d.ts +11 -9
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +55 -10
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/project-trust.d.ts +1 -0
- package/dist/core/project-trust.d.ts.map +1 -1
- package/dist/core/project-trust.js +3 -3
- package/dist/core/project-trust.js.map +1 -1
- package/dist/core/resource-loader.d.ts +11 -2
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +72 -9
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +3 -3
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +5 -5
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -0
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +1 -0
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/structured-output.d.ts +39 -0
- package/dist/core/tools/structured-output.d.ts.map +1 -0
- package/dist/core/tools/structured-output.js +141 -0
- package/dist/core/tools/structured-output.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +36 -14
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +3 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +16 -0
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +11 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +158 -11
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +39 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/docs/custom-provider.md +1 -0
- package/docs/extensions.md +2 -2
- package/docs/models.md +2 -0
- package/docs/packages.md +3 -1
- package/docs/providers.md +15 -0
- package/docs/quickstart.md +3 -3
- package/docs/sdk.md +61 -0
- package/docs/security.md +1 -1
- package/docs/subagents.md +21 -0
- package/docs/usage.md +2 -0
- package/docs/workflows.md +28 -21
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/structured-output.ts +22 -53
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +12 -9
package/docs/workflows.md
CHANGED
|
@@ -9,7 +9,7 @@ Use a workflow when a task should be repeatable, inspectable, resumable, or spli
|
|
|
9
9
|
**Key capabilities:**
|
|
10
10
|
- **Tracked stages** - Name each step and inspect it in workflow status and graph views
|
|
11
11
|
- **Parallel branches** - Run independent research, review, or implementation branches concurrently
|
|
12
|
-
- **Context handoffs** - Pass summaries, artifacts, files, and structured
|
|
12
|
+
- **Context handoffs** - Pass summaries, artifacts, files, and schema-backed structured results between stages
|
|
13
13
|
- **Human input** - Pause for `ctx.ui.input`, `confirm`, `select`, `editor`, or custom TUI widget decisions during a run
|
|
14
14
|
- **Resumable control** - Interrupt, pause, resume, attach to, or kill workflow runs
|
|
15
15
|
- **Artifacts** - Save large outputs to files instead of pushing everything through model context
|
|
@@ -153,7 +153,7 @@ For the builtin result tables below, `deep-research-codebase`, `goal`, and `ralp
|
|
|
153
153
|
|---|---|---|
|
|
154
154
|
| `deep-research-codebase` | Scout + research-history chain → parallel specialist waves → aggregator. Indexes the whole repo and synthesizes findings. | Broad or cross-cutting research before you decide what to change. Prefer `/skill:research-codebase` for one subsystem. |
|
|
155
155
|
| `goal` | Persisted goal ledger → bounded worker turns → receipts → three-reviewer gate → deterministic reducer → final report. | Small-to-medium scope changes when you can identify the work surface, state the exact outcome, and name the validation that proves it is done — for example tests, lint/typecheck, docs builds, or observable behavior. |
|
|
156
|
-
| `ralph` |
|
|
156
|
+
| `ralph` | Prompt-engineering → codebase/online research → sub-agent orchestration → parallel review → optional final-stage PR handoff. | Larger migrations, broad refactors, and multi-package changes where you want Atomic to transform the prompt into a research question, research the codebase before implementing, delegate through sub-agents, review, iterate, and optionally allow only the final `pull-request` stage to attempt PR creation with `create_pr=true`. |
|
|
157
157
|
| `open-claude-design` | Design-system onboarding → reference import → HTML generation → impeccable-driven refinement → quality gate → rich HTML handoff. Renders a live `preview.html` you can iterate against (opens through `browser` when available). | UI, page, component, theme, or design-token work that benefits from generation + critique loops. |
|
|
158
158
|
|
|
159
159
|
### `deep-research-codebase`
|
|
@@ -224,7 +224,7 @@ Run examples:
|
|
|
224
224
|
|
|
225
225
|
Write the `objective` like a compact acceptance spec. Say what should exist when the run is done, how you want testing handled, which command(s) or manual checks matter, and what outcome proves completion. The workflow is intentionally lean: it does not first generate an RFC or migration plan, so the developer-supplied objective is where scope, validation, and completion criteria belong.
|
|
226
226
|
|
|
227
|
-
The worker may claim readiness, but it cannot finalize completion. Three reviewers independently inspect the ledger, worker receipt, repository state, and diff against `base_branch`; each returns structured JSON with findings, evidence, verification still remaining, and an optional blocker. A TypeScript reducer marks the goal complete only when reviewer quorum approves, marks blocked only when the same dependency/tool blocker repeats for the blocker threshold, continues when evidence is missing, and returns `needs_human` when `max_turns` is exhausted or worker execution fails.
|
|
227
|
+
The worker may claim readiness, but it cannot finalize completion. Workers and reviewers are prompted to verify user-visible behavior end-to-end when practical, using browser-skilled subagents for web/frontend flows that may depend on backend/API behavior and tmux-skilled subagents for TUI or terminal-app scenarios. Three reviewers independently inspect the ledger, worker receipt, repository state, and diff against `base_branch`; each returns structured JSON with findings, evidence, verification still remaining, and an optional blocker. A TypeScript reducer marks the goal complete only when reviewer quorum approves, marks blocked only when the same dependency/tool blocker repeats for the blocker threshold, continues when evidence is missing, and returns `needs_human` when `max_turns` is exhausted or worker execution fails.
|
|
228
228
|
|
|
229
229
|
Result fields:
|
|
230
230
|
|
|
@@ -248,8 +248,8 @@ Inputs:
|
|
|
248
248
|
|
|
249
249
|
| Input | Type | Required | Default | Description |
|
|
250
250
|
|---|---|---|---|---|
|
|
251
|
-
| `prompt` | text | yes | — | Task, feature request, issue summary, or spec path to
|
|
252
|
-
| `max_loops` | number | no | `10` | Maximum
|
|
251
|
+
| `prompt` | text | yes | — | Task, feature request, issue summary, or spec path to research, execute, refine, and review. |
|
|
252
|
+
| `max_loops` | number | no | `10` | Maximum research/orchestrate/review iterations before the workflow completes or, when enabled, proceeds to final handoff without reviewer approval. |
|
|
253
253
|
| `base_branch` | string | no | `origin/main` | Branch reviewers and the optional final stage compare the current code delta against; also used to create a missing worktree. |
|
|
254
254
|
| `git_worktree_dir` | string | no | `""` | Optional reusable Git worktree root. Empty runs in the invoking checkout; non-empty values run Ralph stages in the created/reused worktree. |
|
|
255
255
|
| `create_pr` | boolean | no | `false` | Safe-by-default PR creation flag. Omitted or `false` skips the final `pull-request` stage and omits `pr_report`; prompt text alone does not opt in, and only strict `true` authorizes the final `pull-request` stage to attempt provider-appropriate PR/MR/review creation. |
|
|
@@ -257,12 +257,12 @@ Inputs:
|
|
|
257
257
|
Run examples:
|
|
258
258
|
|
|
259
259
|
```text
|
|
260
|
-
/workflow ralph prompt="
|
|
260
|
+
/workflow ralph prompt="Migrate the database layer to Drizzle" max_loops=3 base_branch=develop
|
|
261
261
|
/workflow ralph prompt="Refactor authentication across the API, CLI, and web UI" create_pr=true
|
|
262
262
|
/workflow ralph prompt="Safely implement the API refactor" git_worktree_dir=../atomic-ralph-api-wt base_branch=main
|
|
263
263
|
```
|
|
264
264
|
|
|
265
|
-
Each `ralph` iteration
|
|
265
|
+
Each `ralph` iteration starts by prompt-engineering the user prompt with `/skill:prompt-engineer Transform the following user prompt to a codebase and online research question which can be thoroughly explored: ...`, then researches that transformed question with `/skill:research-codebase ...` and writes the findings under `research/`. The orchestrator treats that research artifact as its primary implementation context, initializes/updates an OS-temp implementation notes file, delegates implementation through sub-agents, and asks two reviewers to inspect the patch directly against `base_branch`. Ralph's orchestrator and reviewers are prompted to verify user-visible behavior end-to-end when practical, using browser-skilled subagents for web/frontend flows that may depend on backend/API behavior and tmux-skilled subagents for TUI or terminal-app scenarios. If reviewers find issues, the next prompt-engineering and research stages receive the review artifact path so follow-up research can address unresolved findings, and research stages fork from prior research session data when available. The loop stops when every reviewer approves or `max_loops` is reached. By default Ralph does not start the final `pull-request` stage, and `pr_report` is omitted. Prompt text alone does not opt in. Pass `create_pr=true` only when you explicitly want the final `pull-request` stage to inspect provider credentials and attempt provider-appropriate PR/MR/review creation, such as GitHub `gh`, Azure Repos `az repos pr create`, or Sapling/Phabricator tooling; Ralph's own PR-creation instructions live in that final stage.
|
|
266
266
|
|
|
267
267
|
Set `git_worktree_dir` when you want Ralph's worker stages isolated in a reusable Git worktree. Relative paths resolve from the invoking repository root, existing same-repository worktree roots are reused, and missing paths are created from `base_branch`. Ralph preserves the invoking repo-relative cwd inside the worktree, so launching from `repo/packages/api` with `git_worktree_dir=../repo-wt` runs stages from `../repo-wt/packages/api`.
|
|
268
268
|
|
|
@@ -271,16 +271,18 @@ Result fields:
|
|
|
271
271
|
| Field | Meaning |
|
|
272
272
|
|---|---|
|
|
273
273
|
| `result` | Final implementation report from the orchestrator stage. |
|
|
274
|
-
| `plan` | Latest
|
|
275
|
-
| `plan_path` |
|
|
274
|
+
| `plan` | Latest transformed research question, retained for compatibility. |
|
|
275
|
+
| `plan_path` | Backward-compatible alias for `research_path`. |
|
|
276
|
+
| `research` | Latest research report text or artifact reference. |
|
|
277
|
+
| `research_path` | Path to the latest generated research artifact under `research/`. |
|
|
276
278
|
| `implementation_notes_path` | OS-temp notes file containing decisions, deviations, blockers, and validation notes. |
|
|
277
279
|
| `pr_report` | Pull-request report emitted only when `create_pr=true` and the final `pull-request` stage runs. |
|
|
278
280
|
| `approved` | Whether the reviewer loop approved before completion or optional final handoff. |
|
|
279
|
-
| `iterations_completed` | Number of
|
|
281
|
+
| `iterations_completed` | Number of research/orchestrate/review loops completed. |
|
|
280
282
|
| `review_report` | Compact reference to the latest reviewer payload artifact. |
|
|
281
283
|
| `review_report_path` | JSON artifact path for the latest Ralph review round. |
|
|
282
284
|
|
|
283
|
-
A typical end-to-end flow is `/skill:research-codebase` → `/skill:create-spec` → `/workflow goal objective="Implement the researched rate-limit behavior, run the focused tests, and finish when the documented burst behavior is validated"` when you can identify the work surface, state the exact outcome, and name the validation that proves it is done. Keep using `/workflow ralph` for larger migrations, broad refactors, multi-package changes
|
|
285
|
+
A typical end-to-end flow is `/skill:research-codebase` → `/skill:create-spec` → `/workflow goal objective="Implement the researched rate-limit behavior, run the focused tests, and finish when the documented burst behavior is validated"` when you can identify the work surface, state the exact outcome, and name the validation that proves it is done. Keep using `/workflow ralph` for larger migrations, broad refactors, and multi-package changes where you want Atomic to research first, delegate through sub-agents, review, iterate, and optionally allow only the final `pull-request` stage to attempt PR creation with `create_pr=true`.
|
|
284
286
|
|
|
285
287
|
### `open-claude-design`
|
|
286
288
|
|
|
@@ -335,7 +337,7 @@ Use the goal workflow to implement specs/2026-03-rate-limit.md, run the focused
|
|
|
335
337
|
```
|
|
336
338
|
|
|
337
339
|
```text
|
|
338
|
-
Use the ralph workflow to
|
|
340
|
+
Use the ralph workflow to research a database-layer migration, implement it, review it, and set `create_pr=true` for final-stage PR handoff.
|
|
339
341
|
```
|
|
340
342
|
|
|
341
343
|
```text
|
|
@@ -381,7 +383,7 @@ If the task is only deterministic TypeScript with no LLM/session stage, use a sc
|
|
|
381
383
|
|-----------|-----|
|
|
382
384
|
| Run, inspect, attach to, pause, interrupt, resume, or check status for an existing workflow | `/workflow ...` or `workflow({ action: ... })` |
|
|
383
385
|
| Implement a small-to-medium scope change with an identifiable work surface, exact outcome, and named validation | `/workflow goal objective="..."` so Atomic keeps the run bounded, captures receipts in a goal ledger, gates completion through reviewers, and stops as `complete`, `blocked`, or `needs_human` |
|
|
384
|
-
|
|
|
386
|
+
| Research and execute a larger migration, broad refactor, or multi-package change | `/workflow ralph prompt="..."` so Atomic can transform the prompt into a research question, research the codebase first, delegate implementation through sub-agents, review, and iterate; prompt text alone does not opt in to PR creation, so add `create_pr=true` only when you want the final `pull-request` stage and `pr_report` |
|
|
385
387
|
| Create or edit reusable automation | a TypeScript workflow definition exported from `defineWorkflow(...).compile()` |
|
|
386
388
|
| Track one-off work without saving a workflow file | direct `workflow({ task })`, `workflow({ tasks })`, or `workflow({ chain })` calls |
|
|
387
389
|
| Make a workflow robust | design the stage graph, context handoffs, artifacts, validation gates, model fallbacks, and human approval points before coding |
|
|
@@ -1100,7 +1102,7 @@ Control-signal probing is fail-closed. When the executor inspects an arbitrary t
|
|
|
1100
1102
|
- Avoid workflow-specific or stage-specific vocabulary that is not explained inside the current prompt.
|
|
1101
1103
|
- Use clear software engineering terminology in self-described prompts.
|
|
1102
1104
|
- Avoid hard-coded regular expressions for condition matching when gating reviews or model outputs.
|
|
1103
|
-
- Prefer
|
|
1105
|
+
- Prefer schema-backed workflow stages (`ctx.stage(..., { schema })`, `ctx.chain` items, or `ctx.parallel` items) for review/gate decisions whenever model output needs to be evaluated; Atomic injects the canonical `structured_output` tool only for those schema-enabled items.
|
|
1104
1106
|
- Treat atomic workflow units as language model stages, not deterministic tools.
|
|
1105
1107
|
- When deterministic gates are needed, create small dedicated stages that instruct a model to run a specific tool or perform a specific check. This keeps gates adaptive to the current codebase while preserving explicit workflow structure.
|
|
1106
1108
|
|
|
@@ -1315,7 +1317,7 @@ Common builtin import targets:
|
|
|
1315
1317
|
|---|---|---|---|
|
|
1316
1318
|
| `deep-research-codebase` | `deepResearchCodebase` | `@bastani/workflows/builtin/deep-research-codebase` | Gather broad repo research before planning, synthesis, or implementation. |
|
|
1317
1319
|
| `goal` | `goal` | `@bastani/workflows/builtin/goal` | Run a bounded implementation/check loop with receipts and reviewer-gated completion. |
|
|
1318
|
-
| `ralph` | `ralph` | `@bastani/workflows/builtin/ralph` | Delegate a larger migration/refactor
|
|
1320
|
+
| `ralph` | `ralph` | `@bastani/workflows/builtin/ralph` | Delegate a larger migration/refactor effort to Ralph's research/orchestrate/review loop; pass `create_pr=true` to authorize only the final PR-creation stage. |
|
|
1319
1321
|
| `open-claude-design` | `openClaudeDesign` | `@bastani/workflows/builtin/open-claude-design` | Generate and refine a UI/design artifact and handoff spec. |
|
|
1320
1322
|
|
|
1321
1323
|
Example parent workflow that runs builtin deep research, then chooses either `goal` or `ralph` as the nested implementation runner:
|
|
@@ -1330,7 +1332,7 @@ export default defineWorkflow("research-then-implement")
|
|
|
1330
1332
|
"runner",
|
|
1331
1333
|
Type.Union([Type.Literal("goal"), Type.Literal("ralph")], {
|
|
1332
1334
|
default: "goal",
|
|
1333
|
-
description: "Use goal for bounded changes or Ralph for broad
|
|
1335
|
+
description: "Use goal for bounded changes or Ralph for broad research-first implementation work.",
|
|
1334
1336
|
}),
|
|
1335
1337
|
)
|
|
1336
1338
|
.output("research_doc_path", Type.Optional(Type.String({ description: "Path to the deep-research document used for implementation." })))
|
|
@@ -1473,9 +1475,14 @@ Common task/stage options include:
|
|
|
1473
1475
|
- `context: "fresh" | "fork"`, `forkFromSessionFile`
|
|
1474
1476
|
- `model`, `fallbackModels`, `thinkingLevel`, `scopedModels`, `modelRegistry` — `model` and each `fallbackModels` entry accept a `model_name:thinking_effort` reasoning suffix; the standalone `thinkingLevel` is deprecated (see [Reasoning levels](#reasoning-levels))
|
|
1475
1477
|
- `tools`, `noTools`, `customTools`, `mcp: { allow?: string[], deny?: string[] }`, `bashPolicy`
|
|
1478
|
+
- `schema` for a structured final answer from this workflow item
|
|
1476
1479
|
- `output`, `outputMode`, `reads`, `worktree`, `gitWorktreeDir`, `baseBranch`, `maxOutput`, `artifacts`, `sessionDir`, `cwd`, `agentDir`
|
|
1477
1480
|
- advanced host-supplied SDK seams: `authStorage`, `resourceLoader`, `sessionManager`, `settingsManager`, `sessionStartEvent`
|
|
1478
1481
|
|
|
1482
|
+
`schema` is opt-in. When a `ctx.stage` call, `ctx.task` call, `ctx.chain` item, or `ctx.parallel` item includes a top-level object TypeBox/JSON Schema, Atomic registers a schema-specific `structured_output` tool for that item only, appends final-answer instructions, and requires the stage to finish by calling the tool exactly once. The prompt result is the parsed structured value for `ctx.stage(..., { schema }).prompt(...)`; task/chain/parallel results also include `result.structured` and keep `result.text` as formatted JSON for handoffs. Because the result contract is single-use, a schema-backed `StageContext` supports one `prompt()` call; create a new `ctx.stage(..., { schema })` for each additional structured prompt. If the item also uses an explicit `tools` allowlist, Atomic automatically adds `structured_output` to that allowlist. Items without `schema` do not receive `structured_output` from the normal tool registry.
|
|
1483
|
+
|
|
1484
|
+
`subagent` is available as a default workflow-stage tool, with the same default two-hop nesting budget as main chat: a workflow stage can launch a subagent, and that subagent can launch one nested subagent before the guard blocks further delegation. `tools` remains an allowlist across built-in tools and bundled extension tools; if you set `tools`, list every tool the stage should see. Explicitly listing tools such as `subagent`, `web_search`, `fetch_content`, or `intercom` exposes those tools to the stage, while `excludedTools` and `noTools: "all"` still win. The bundled subagent definitions from `@bastani/subagents` are available to the `subagent` tool in workflow stages; when a workflow is itself running inside a subagent child process, Atomic isolates stage resource discovery from the parent child-process flags so `subagent` remains available while workflow-stage nested-depth guards remain in force.
|
|
1485
|
+
|
|
1479
1486
|
`bashPolicy` scopes the built-in `bash` tool for one stage or task. `tools` must still include `"bash"` (or leave it available by default); the policy only narrows command text after the shell tool is exposed. It supports exact strings, `{ prefix }`, command-string `{ glob }`, and `{ regex, flags? }` rules, `default: "allow" | "deny"` (default `"allow"`), `deny` precedence, and `match: "segments" | "whole"` (default `"segments"`). Omitting `bashPolicy`, passing `{}`, or passing a default-allow policy with no `allow`/`deny` rules (including empty arrays or match-only default-allow policies) preserves legacy behavior and does not parse commands; malformed policy shapes such as unknown top-level keys (`denny`, `extra`), non-array `allow`/`deny`, invalid rule objects, invalid regexes, invalid glob bracket ranges, or stateful `g`/`y` regex flags fail closed as `invalid-policy`. Segment mode checks each command in pipelines/chains/substitutions before execution, treats unquoted LF, CRLF, and bare CR as command separators, keeps non-leading Bash `>|` noclobber redirections inside the current command segment, and rejects reserved/compound shell heads, leading redirections, attached command-head redirections, and command heads that are not literal words.
|
|
1480
1487
|
|
|
1481
1488
|
```ts
|
|
@@ -1619,7 +1626,7 @@ Stage prompts should be local contracts, not miniature descriptions of the entir
|
|
|
1619
1626
|
|
|
1620
1627
|
- the stage's current objective and what is out of scope for this stage
|
|
1621
1628
|
- the exact files, artifacts, child outputs, or user inputs it may use
|
|
1622
|
-
- the expected output format or
|
|
1629
|
+
- the expected output format, or the schema it must return when the workflow item is schema-enabled
|
|
1623
1630
|
- the checks, tools, or deterministic commands it should run when relevant
|
|
1624
1631
|
- the success criteria that let this stage stop
|
|
1625
1632
|
|
|
@@ -1735,9 +1742,9 @@ Build validation into the workflow instead of waiting for a final manual check.
|
|
|
1735
1742
|
- reviewer stages: fresh-context reviewers that inspect artifacts and current files
|
|
1736
1743
|
- LLM-as-judge stages: direct scoring, pairwise comparison, or rubric-based grading for subjective outputs
|
|
1737
1744
|
|
|
1738
|
-
Prefer
|
|
1745
|
+
Prefer schema-enabled workflow items for model review and gate decisions. `structured_output` is not available to workflow stages through the normal Atomic tool registry; it is injected only when a `ctx.stage`, `ctx.task`, `ctx.chain` item, or `ctx.parallel` item includes `schema`. Structured-output schemas must be top-level object tool-argument schemas, so wrap array or primitive decisions in object fields such as `{ items: [...] }` or `{ value: ... }`; direct JSON invocations of the `workflow` tool must use a schema with `type: "object"` so invalid array/primitive contracts fail at argument validation instead of later in the stage. Terminating `structured_output` JSON is preserved inline even when it exceeds the normal oversized-tool-result threshold, so workflow code can consume the parsed value instead of a `<persisted-output>` pointer. Do not add the old synthetic `{ value: ... }` wrapper around an object payload unless your schema defines that field, and do not make correctness depend on brittle regular-expression matching against free-form prose such as “looks good”, “approved”, or “PASS”. A schema with explicit booleans/enums, findings arrays, confidence, evidence fields, and error reporting is easier to validate, replay, and safely default to “not approved” when malformed.
|
|
1739
1746
|
|
|
1740
|
-
Use small dedicated model stages for adaptive gates when deterministic code alone cannot decide what to check. For example, a stage can read an artifact, inspect the repo, run a named tool or command, and then emit a structured decision. Keep that stage's prompt narrow: tell it the specific check to perform, the files/tools it may use, and the structured decision it must return.
|
|
1747
|
+
Use small dedicated model stages for adaptive gates when deterministic code alone cannot decide what to check. For example, a stage can read an artifact, inspect the repo, run a named tool or command, and then emit a structured decision by configuring `schema` on that workflow item. Keep that stage's prompt narrow: tell it the specific check to perform, the files/tools it may use, and the structured decision it must return.
|
|
1741
1748
|
|
|
1742
1749
|
When using LLM judges, mitigate bias by defining score anchors, asking for evidence, calibrating against examples, and keeping length/order effects in mind. Track pass rates and failures over time for reusable workflows.
|
|
1743
1750
|
|
|
@@ -1794,5 +1801,5 @@ Good workflows are information-flow systems, not just prompt sequences. Keep sta
|
|
|
1794
1801
|
- Do not call `kill` when the user asks to interrupt or pause resumably.
|
|
1795
1802
|
- Keep stage names readable because they appear in workflow status and UI.
|
|
1796
1803
|
- Do not write stage prompts that depend on hidden workflow-wide awareness; make each model stage locally scoped and self-described.
|
|
1797
|
-
- Do not parse model gate decisions from ad-hoc prose with regular expressions;
|
|
1798
|
-
- Return compact structured output and save large artifacts to files.
|
|
1804
|
+
- Do not parse model gate decisions from ad-hoc prose with regular expressions; configure `schema` on a focused workflow item so Atomic injects the canonical `structured_output` tool for that item.
|
|
1805
|
+
- Return compact structured output for decisions and save large artifacts to files; schema-enabled workflow items preserve final JSON inline, but artifact handoffs should still use files when the next stage does not need the whole payload in context.
|
|
@@ -36,7 +36,7 @@ cp permission-gate.ts ~/.atomic/agent/extensions/
|
|
|
36
36
|
| `questionnaire.ts` | Multi-question input with tab bar navigation between questions |
|
|
37
37
|
| `tool-override.ts` | Override built-in tools (e.g., add logging/access control to `read`) |
|
|
38
38
|
| `dynamic-tools.ts` | Register tools after startup (`session_start`) and at runtime via command, with prompt snippets and tool-specific prompt guidelines |
|
|
39
|
-
| `structured-output.ts` |
|
|
39
|
+
| `structured-output.ts` | Opt-in schema-specific `structured_output` tool using Atomic's canonical terminating output factory |
|
|
40
40
|
| `built-in-tool-renderer.ts` | Custom compact rendering for built-in tools (read, bash, edit, write) while keeping original behavior |
|
|
41
41
|
| `minimal-mode.ts` | Override built-in tool rendering for minimal display (only tool calls, no output in collapsed mode) |
|
|
42
42
|
| `truncated-tool.ts` | Wraps ripgrep with proper output truncation (50KB/2000 lines) |
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atomic-extension-custom-provider-anthropic",
|
|
3
|
-
"version": "0.79.
|
|
3
|
+
"version": "0.79.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "atomic-extension-custom-provider-anthropic",
|
|
9
|
-
"version": "0.79.
|
|
9
|
+
"version": "0.79.3",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atomic-extension-gondolin",
|
|
3
|
-
"version": "0.79.
|
|
3
|
+
"version": "0.79.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "atomic-extension-gondolin",
|
|
9
|
-
"version": "0.79.
|
|
9
|
+
"version": "0.79.3",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atomic-extension-sandbox",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "atomic-extension-sandbox",
|
|
9
|
-
"version": "1.9.
|
|
9
|
+
"version": "1.9.3",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,65 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Schema-specific structured_output tool
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Atomic does not register `structured_output` in normal agent sessions by
|
|
5
|
+
* default. This extension demonstrates the canonical factory for adding a
|
|
6
|
+
* schema-backed terminating final-answer tool only when this extension is
|
|
7
|
+
* enabled.
|
|
8
|
+
*
|
|
9
|
+
* Custom factory names are opt-in tools too: `createStructuredOutputTool({ name:
|
|
10
|
+
* "final_decision", ... })` registers `final_decision`; include that name in any
|
|
11
|
+
* explicit `tools` allowlist. The default factory name registers
|
|
12
|
+
* `structured_output` for this extension/runtime only.
|
|
6
13
|
*/
|
|
7
14
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
15
|
+
import {
|
|
16
|
+
createStructuredOutputTool,
|
|
17
|
+
type ExtensionAPI,
|
|
18
|
+
} from "@bastani/atomic";
|
|
10
19
|
import { Type } from "typebox";
|
|
11
20
|
|
|
12
|
-
|
|
13
|
-
headline:
|
|
14
|
-
summary:
|
|
15
|
-
actionItems:
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const structuredOutputTool = defineTool({
|
|
19
|
-
name: "structured_output",
|
|
20
|
-
label: "Structured Output",
|
|
21
|
-
description:
|
|
22
|
-
"Return a final structured answer. Use this as your last action when the user asks for structured output or a machine-readable summary.",
|
|
23
|
-
promptSnippet: "Emit a final structured answer as a terminating tool result",
|
|
24
|
-
promptGuidelines: [
|
|
25
|
-
"Use structured_output as your final action when the user asks for structured output, JSON-like output, or a machine-readable summary.",
|
|
26
|
-
"After calling structured_output, do not emit another assistant response in the same turn.",
|
|
27
|
-
],
|
|
28
|
-
parameters: Type.Object({
|
|
29
|
-
headline: Type.String({ description: "Short title for the result" }),
|
|
30
|
-
summary: Type.String({ description: "One-paragraph summary" }),
|
|
31
|
-
actionItems: Type.Array(Type.String(), { description: "Concrete next steps or key bullets" }),
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
async execute(_toolCallId, params) {
|
|
35
|
-
return {
|
|
36
|
-
content: [{ type: "text", text: `Saved structured output: ${params.headline}` }],
|
|
37
|
-
details: {
|
|
38
|
-
headline: params.headline,
|
|
39
|
-
summary: params.summary,
|
|
40
|
-
actionItems: params.actionItems,
|
|
41
|
-
} satisfies StructuredOutputDetails,
|
|
42
|
-
terminate: true,
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
renderResult(result, _options, theme) {
|
|
47
|
-
const details = result.details as StructuredOutputDetails | undefined;
|
|
48
|
-
if (!details) {
|
|
49
|
-
const text = result.content[0];
|
|
50
|
-
return new Text(text?.type === "text" ? text.text : "", 0, 0);
|
|
51
|
-
}
|
|
21
|
+
const SummarySchema = Type.Object({
|
|
22
|
+
headline: Type.String({ description: "Short title for the result" }),
|
|
23
|
+
summary: Type.String({ description: "One-paragraph summary" }),
|
|
24
|
+
actionItems: Type.Array(Type.String(), { description: "Concrete next steps or key bullets" }),
|
|
25
|
+
}, { additionalProperties: false });
|
|
52
26
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
theme.fg("text", details.summary),
|
|
56
|
-
"",
|
|
57
|
-
...details.actionItems.map((item, index) => theme.fg("muted", `${index + 1}. ${item}`)),
|
|
58
|
-
];
|
|
59
|
-
return new Text(lines.join("\n"), 0, 0);
|
|
60
|
-
},
|
|
27
|
+
const structuredOutputTool = createStructuredOutputTool({
|
|
28
|
+
schema: SummarySchema,
|
|
61
29
|
});
|
|
62
30
|
|
|
63
31
|
export default function (pi: ExtensionAPI) {
|
|
32
|
+
// Register structured_output for sessions that load this extension.
|
|
64
33
|
pi.registerTool(structuredOutputTool);
|
|
65
34
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atomic-extension-with-deps",
|
|
3
|
-
"version": "0.79.
|
|
3
|
+
"version": "0.79.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "atomic-extension-with-deps",
|
|
9
|
-
"version": "0.79.
|
|
9
|
+
"version": "0.79.3",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.29-alpha.3",
|
|
4
4
|
"description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"atomicConfig": {
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
|
-
"import": "./dist/index.js"
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"default": "./dist/index.js"
|
|
25
26
|
},
|
|
26
27
|
"./hooks": {
|
|
27
28
|
"types": "./dist/core/hooks/index.d.ts",
|
|
@@ -67,9 +68,11 @@
|
|
|
67
68
|
"prepublishOnly": "bun run clean && bun run build"
|
|
68
69
|
},
|
|
69
70
|
"dependencies": {
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"@earendil-works/pi-
|
|
71
|
+
"@bastani/atomic-natives": "0.8.29-alpha.3",
|
|
72
|
+
"@bufbuild/protobuf": "^2.0.0",
|
|
73
|
+
"@earendil-works/pi-agent-core": "^0.79.3",
|
|
74
|
+
"@earendil-works/pi-ai": "^0.79.3",
|
|
75
|
+
"@earendil-works/pi-tui": "^0.79.3",
|
|
73
76
|
"@modelcontextprotocol/ext-apps": "^1.7.2",
|
|
74
77
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
75
78
|
"@mozilla/readability": "^0.6.0",
|
|
@@ -85,7 +88,7 @@
|
|
|
85
88
|
"linkedom": "^0.18.12",
|
|
86
89
|
"minimatch": "^10.2.3",
|
|
87
90
|
"open": "^11.0.0",
|
|
88
|
-
"p-limit": "^
|
|
91
|
+
"p-limit": "^7.3.0",
|
|
89
92
|
"proper-lockfile": "^4.1.2",
|
|
90
93
|
"turndown": "^7.2.0",
|
|
91
94
|
"typebox": "^1.1.24",
|
|
@@ -101,14 +104,14 @@
|
|
|
101
104
|
}
|
|
102
105
|
},
|
|
103
106
|
"optionalDependencies": {
|
|
104
|
-
"@mariozechner/clipboard": "^0.3.
|
|
107
|
+
"@mariozechner/clipboard": "^0.3.9"
|
|
105
108
|
},
|
|
106
109
|
"devDependencies": {
|
|
107
110
|
"@types/cross-spawn": "6.0.6",
|
|
108
|
-
"@types/diff": "^
|
|
111
|
+
"@types/diff": "^8.0.0",
|
|
109
112
|
"@types/hosted-git-info": "^3.0.5",
|
|
110
113
|
"@types/ms": "^2.1.0",
|
|
111
|
-
"@types/node": "^25.9.
|
|
114
|
+
"@types/node": "^25.9.3",
|
|
112
115
|
"@types/proper-lockfile": "^4.1.4",
|
|
113
116
|
"@typescript/native-preview": "7.0.0-dev.20260511.1",
|
|
114
117
|
"shx": "^0.4.0",
|