@bastani/atomic 0.8.14 → 0.8.15
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 +29 -0
- package/README.md +0 -8
- package/dist/builtin/intercom/CHANGELOG.md +5 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/CHANGELOG.md +5 -0
- package/dist/builtin/mcp/index.ts +4 -8
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +2 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/tmux/SKILL.md +220 -0
- package/dist/builtin/subagents/skills/tmux/scripts/find-sessions.sh +112 -0
- package/dist/builtin/subagents/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/dist/builtin/web-access/CHANGELOG.md +5 -0
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +12 -1
- package/dist/builtin/workflows/README.md +3 -1
- package/dist/builtin/workflows/builtin/ralph.ts +222 -295
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/background-ui-adapter.ts +20 -11
- package/dist/builtin/workflows/src/extension/index.ts +1 -0
- package/dist/builtin/workflows/src/extension/status-writer.ts +18 -3
- package/dist/builtin/workflows/src/runs/background/runner.ts +8 -10
- package/dist/builtin/workflows/src/runs/foreground/executor.ts +484 -91
- package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +13 -2
- package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +41 -15
- package/dist/builtin/workflows/src/runs/shared/graph-inference.ts +31 -0
- package/dist/builtin/workflows/src/runs/shared/prompt-callsite.ts +98 -0
- package/dist/builtin/workflows/src/shared/persistence-restore.ts +3 -1
- package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +4 -0
- package/dist/builtin/workflows/src/shared/store-types.ts +12 -1
- package/dist/builtin/workflows/src/shared/store.ts +77 -3
- package/dist/builtin/workflows/src/tui/graph-view.ts +17 -1
- package/dist/builtin/workflows/src/tui/prompt-card.ts +185 -30
- package/dist/builtin/workflows/src/tui/stage-chat-view.ts +386 -21
- package/docs/changelog.mdx +41 -14
- package/docs/docs.json +1 -0
- package/docs/extensions.md +19 -19
- package/docs/images/workflow-input-picker.png +0 -0
- package/docs/images/workflow-list.png +0 -0
- package/docs/index.md +33 -27
- package/docs/providers.md +2 -2
- package/docs/quickstart.md +15 -15
- package/docs/sdk.md +8 -8
- package/docs/sessions.md +5 -5
- package/docs/settings.md +27 -1
- package/docs/skills.md +2 -2
- package/docs/subagents.md +157 -0
- package/docs/usage.md +7 -7
- package/docs/windows.md +8 -0
- package/docs/workflows.md +62 -9
- package/package.json +2 -1
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -3
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Subagents"
|
|
3
|
+
description: "Run focused Atomic child agents"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Subagents
|
|
7
|
+
|
|
8
|
+
Atomic bundles `@bastani/subagents`, an extension for running focused child agents with their own context. Use it when a task benefits from isolation, parallel investigation, background execution, or a specialist pass for locating code, analyzing behavior, researching references, debugging, or simplifying code.
|
|
9
|
+
|
|
10
|
+
You do not need to install anything separately when you use `@bastani/atomic`.
|
|
11
|
+
|
|
12
|
+
## Start with natural language
|
|
13
|
+
|
|
14
|
+
Ask Atomic to coordinate subagents in plain language:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
Map the authentication flow with focused subagents before we change it.
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
Run a parallel review composition: one pass for current behavior, one for failure modes, and one for existing patterns.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
Research the upstream library behavior online, then compare it with our local implementation.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Atomic decides whether to call the bundled `subagent` tool, which specialist fits each part, and whether the work should run as a single child, parallel group, chain, foreground run, or background run.
|
|
29
|
+
|
|
30
|
+
## Bundled agents
|
|
31
|
+
|
|
32
|
+
Atomic currently bundles these agents from `@bastani/subagents`:
|
|
33
|
+
|
|
34
|
+
| Agent | Use it for | Edit files? |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| `codebase-locator` | Find relevant files, directories, tests, configs, and docs for a topic. | No |
|
|
37
|
+
| `codebase-analyzer` | Explain how specific code works and trace data flow with file references. | No |
|
|
38
|
+
| `codebase-pattern-finder` | Find similar implementations, conventions, and test examples to model after. | No |
|
|
39
|
+
| `codebase-research-locator` | Locate prior `research/` and `specs/` documents related to the task. | No |
|
|
40
|
+
| `codebase-research-analyzer` | Extract decisions, constraints, and still-relevant conclusions from prior local docs. | No |
|
|
41
|
+
| `codebase-online-researcher` | Research official docs, ecosystem behavior, and open-source source references online. | Can write research notes |
|
|
42
|
+
| `debugger` | Reproduce, diagnose, and fix failures or unexpected behavior. | Yes |
|
|
43
|
+
| `code-simplifier` | Clean up recently changed code while preserving behavior. | Yes |
|
|
44
|
+
|
|
45
|
+
Read-oriented agents should inspect and report. `debugger` and `code-simplifier` can edit files, so run them with an explicit scope and validation target.
|
|
46
|
+
|
|
47
|
+
## Review compositions
|
|
48
|
+
|
|
49
|
+
Atomic does not bundle a single generic review agent. Instead, compose specialists with distinct angles and let the parent session synthesize their findings before applying any fix.
|
|
50
|
+
|
|
51
|
+
Common review angles:
|
|
52
|
+
|
|
53
|
+
| Angle | Specialist pattern |
|
|
54
|
+
|---|---|
|
|
55
|
+
| Current behavior and regressions | `codebase-analyzer` inspects the changed flow and cites file/line evidence. |
|
|
56
|
+
| Failure modes | `debugger` runs in inspect-only mode to reproduce or reason about likely failures without editing. |
|
|
57
|
+
| Fit with project conventions | `codebase-pattern-finder` compares the patch with existing local examples. |
|
|
58
|
+
| Prior decisions | `codebase-research-locator` finds relevant docs, then `codebase-research-analyzer` extracts applicable constraints. |
|
|
59
|
+
| External API or library conformance | `codebase-online-researcher` checks authoritative sources and version-specific behavior. |
|
|
60
|
+
|
|
61
|
+
Example request:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
Review the current diff with fresh-context specialists: analyze correctness, inspect failure modes without editing, and compare the implementation to existing patterns. Synthesize only issues worth fixing now.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Useful prompt templates include `/parallel-review`, `/review-loop`, `/parallel-research`, `/parallel-context-build`, `/parallel-handoff-plan`, and `/parallel-cleanup`. Treat them as reusable compositions, not as separate bundled agent names.
|
|
68
|
+
|
|
69
|
+
## Background work and control
|
|
70
|
+
|
|
71
|
+
Foreground subagents stream progress in the conversation. Background subagents keep working after control returns to you and report completion later.
|
|
72
|
+
|
|
73
|
+
Natural-language examples:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
Run the local research scan in the background.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
Show me the current async subagent runs.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Tool examples:
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
subagent({ agent: "codebase-analyzer", task: "Trace the auth flow with file references.", async: true })
|
|
87
|
+
subagent({ action: "status" })
|
|
88
|
+
subagent({ action: "status", id: "<run-id>" })
|
|
89
|
+
subagent({ action: "interrupt", id: "<run-id>" })
|
|
90
|
+
subagent({ action: "resume", id: "<run-id>", message: "continue with the test failures" })
|
|
91
|
+
subagent({ action: "doctor" })
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Use `interrupt` when you want a resumable stop. Use `resume` to send a follow-up to a reachable async child, or to revive a completed child from its saved session when the run has enough metadata. Use `doctor` for read-only setup diagnostics.
|
|
95
|
+
|
|
96
|
+
Background runs are detached. If Atomic has no useful independent work while a background subagent runs, it should end the turn instead of polling in a loop; the run will notify the originating session when it completes.
|
|
97
|
+
|
|
98
|
+
## Context and execution modes
|
|
99
|
+
|
|
100
|
+
Subagents can run with fresh or forked context:
|
|
101
|
+
|
|
102
|
+
- `context: "fresh"` starts a separate child with only the task and selected agent context.
|
|
103
|
+
- `context: "fork"` creates a real branched child session from the parent session leaf. It fails fast if the parent session cannot be forked; it does not silently downgrade to fresh context.
|
|
104
|
+
|
|
105
|
+
For adversarial review or research, prefer fresh context so the specialist inspects the repository directly. Use forked context when a writer needs the parent conversation history in a separate branch.
|
|
106
|
+
|
|
107
|
+
For parallel implementation work, `worktree: true` can give each child an isolated git worktree so concurrent edits do not clobber each other.
|
|
108
|
+
|
|
109
|
+
## Nested and fanout boundaries
|
|
110
|
+
|
|
111
|
+
Child-safety boundaries are enforced by the bundled subagent extension:
|
|
112
|
+
|
|
113
|
+
- Normal child sessions do not receive the `subagent` tool or the parent-only subagents skill.
|
|
114
|
+
- Child context is filtered to remove parent orchestration artifacts, old control/status messages, and prior parent `subagent` tool calls/results.
|
|
115
|
+
- Non-fanout children are instructed that they are not the parent orchestrator and must not propose or run subagents.
|
|
116
|
+
- Nested fanout is available only for explicitly authorized agents whose resolved tools include `subagent`. Authorized fanout children receive narrower instructions that limit delegation to the assigned fanout.
|
|
117
|
+
|
|
118
|
+
This keeps the parent session responsible for orchestration unless you deliberately choose a fanout-capable custom agent.
|
|
119
|
+
|
|
120
|
+
## Custom agents
|
|
121
|
+
|
|
122
|
+
Custom agents are Markdown files with YAML frontmatter and a system prompt body. Common locations are:
|
|
123
|
+
|
|
124
|
+
| Scope | Path |
|
|
125
|
+
|---|---|
|
|
126
|
+
| User | `~/.atomic/agent/agents/**/*.md` |
|
|
127
|
+
| Project | `.atomic/agents/**/*.md` |
|
|
128
|
+
|
|
129
|
+
A small custom read-only inspection agent:
|
|
130
|
+
|
|
131
|
+
```markdown
|
|
132
|
+
---
|
|
133
|
+
name: strict-inspector
|
|
134
|
+
description: Inspect code for correctness and regressions
|
|
135
|
+
tools: read, grep, bash
|
|
136
|
+
model: anthropic/claude-sonnet-4
|
|
137
|
+
fallbackModels: openai/gpt-5-mini
|
|
138
|
+
inheritProjectContext: true
|
|
139
|
+
completionGuard: false
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
You are a read-only inspector. Inspect the current diff, cite evidence with file paths, and return only issues worth fixing now. Do not edit files.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Use `completionGuard: false` sparingly. It opts a user-authored agent out of automatic completion-guard reminders and is intended for read-only agents whose prompt already prevents premature completion. Do not use it to bypass required implementation or validation work.
|
|
146
|
+
|
|
147
|
+
## Fallback models
|
|
148
|
+
|
|
149
|
+
Agents can define ordered `fallbackModels` for retryable provider or model failures such as rate limits, quota/auth problems, unavailable models, network timeouts, or 5xx errors. Atomic tries the requested primary model first, then configured fallbacks, and finally appends the current user-selected model as the last fallback candidate when available.
|
|
150
|
+
|
|
151
|
+
Fallbacks do not retry ordinary task failures, validation failures, tool failures, cancellations, or workflow-code errors. Because a fallback may send the same prompt and context to a different provider, choose models that match your cost, privacy, and data-handling requirements.
|
|
152
|
+
|
|
153
|
+
## Related docs
|
|
154
|
+
|
|
155
|
+
- [Workflows](/workflows) for multi-stage reusable automation.
|
|
156
|
+
- [Skills](/skills) for reusable instructions invoked with `/skill:<name>`.
|
|
157
|
+
- [Settings](/settings) for user and project configuration.
|
package/docs/usage.md
CHANGED
|
@@ -27,7 +27,7 @@ The editor can be replaced temporarily by built-in UI such as `/settings` or by
|
|
|
27
27
|
| Hidden shell command | `!!command` runs without sending output to the model |
|
|
28
28
|
| External editor | CTRL+G opens `$VISUAL` or `$EDITOR` |
|
|
29
29
|
|
|
30
|
-
See [Keybindings](keybindings
|
|
30
|
+
See [Keybindings](/keybindings) for all shortcuts and customization.
|
|
31
31
|
|
|
32
32
|
## Slash Commands
|
|
33
33
|
|
|
@@ -64,9 +64,9 @@ You can submit messages while the agent is still working:
|
|
|
64
64
|
- **Escape** aborts and restores queued messages to the editor.
|
|
65
65
|
- **ALT+Up** retrieves queued messages back to the editor.
|
|
66
66
|
|
|
67
|
-
On Windows Terminal, ALT+Enter is fullscreen by default. Remap it as described in [Terminal setup](terminal-setup
|
|
67
|
+
On Windows Terminal, ALT+Enter is fullscreen by default. Remap it as described in [Terminal setup](/terminal-setup) if you want Atomic to receive the shortcut.
|
|
68
68
|
|
|
69
|
-
Configure delivery in [Settings](settings
|
|
69
|
+
Configure delivery in [Settings](/settings) with `steeringMode` and `followUpMode`.
|
|
70
70
|
|
|
71
71
|
## Sessions
|
|
72
72
|
|
|
@@ -88,7 +88,7 @@ Useful session commands:
|
|
|
88
88
|
- `/clone` duplicates the current active branch into a new session file.
|
|
89
89
|
- `/compact` summarizes older messages to free context.
|
|
90
90
|
|
|
91
|
-
See [Sessions](sessions
|
|
91
|
+
See [Sessions](/sessions) and [Compaction](/compaction) for details.
|
|
92
92
|
|
|
93
93
|
## Context Files
|
|
94
94
|
|
|
@@ -137,7 +137,7 @@ atomic list # List installed packages
|
|
|
137
137
|
atomic config # Enable/disable package resources
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
See [Atomic Packages](packages
|
|
140
|
+
See [Atomic Packages](/packages) for package sources and security notes.
|
|
141
141
|
|
|
142
142
|
### Modes
|
|
143
143
|
|
|
@@ -145,8 +145,8 @@ See [Atomic Packages](packages.md) for package sources and security notes.
|
|
|
145
145
|
|------|-------------|
|
|
146
146
|
| default | Interactive mode |
|
|
147
147
|
| `-p`, `--print` | Print response and exit |
|
|
148
|
-
| `--mode json` | Output all events as JSON lines; see [JSON mode](json
|
|
149
|
-
| `--mode rpc` | RPC mode over stdin/stdout; see [RPC mode](rpc
|
|
148
|
+
| `--mode json` | Output all events as JSON lines; see [JSON mode](/json) |
|
|
149
|
+
| `--mode rpc` | RPC mode over stdin/stdout; see [RPC mode](/rpc) |
|
|
150
150
|
| `--export <in> [out]` | Export a session to HTML |
|
|
151
151
|
|
|
152
152
|
In print mode, Atomic also reads piped stdin and merges it into the initial prompt:
|
package/docs/windows.md
CHANGED
|
@@ -15,3 +15,11 @@ For most users, [Git for Windows](https://git-scm.com/download/win) is sufficien
|
|
|
15
15
|
"shellPath": "C:\\cygwin64\\bin\\bash.exe"
|
|
16
16
|
}
|
|
17
17
|
```
|
|
18
|
+
|
|
19
|
+
## Self-Update Behavior
|
|
20
|
+
|
|
21
|
+
`atomic update --self` can update Windows installations that Atomic can identify as writable global package-manager installs. `atomic update` includes the same self-update step before updating packages unless you pass `--extensions`.
|
|
22
|
+
|
|
23
|
+
When self-update starts on Windows, Atomic first cleans any previous `.atomic-native-quarantine` directory under the global package root. If native add-ons from the current install are loaded by the running process, Atomic moves those files into a per-run quarantine directory and copies them back into place before invoking the package manager. This lets the package manager replace native dependency files that Windows would otherwise keep locked.
|
|
24
|
+
|
|
25
|
+
If Atomic cannot safely self-update the current installation, it exits with a clear message instead of guessing. The message explains that the install is unsupported, unmanaged, or not writable; prints the detected executable path when available; and tells you to update Atomic with the package manager, wrapper, source checkout, or release artifact that originally installed it.
|
package/docs/workflows.md
CHANGED
|
@@ -139,7 +139,7 @@ Atomic bundles three workflows that cover the most common multi-stage jobs. They
|
|
|
139
139
|
| Workflow | What it does | When to use |
|
|
140
140
|
|---|---|---|
|
|
141
141
|
| `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. |
|
|
142
|
-
| `ralph` |
|
|
142
|
+
| `ralph` | Goal contract → orchestrate → simplify → parallel review/audit loop → PR preparation. Reviewer findings feed back into the next planner and completion is judged against an inferred verification oracle. | Larger autonomous implementation loops where you want implementation, receipts, review, validation, audit, and conditional PR creation built in. |
|
|
143
143
|
| `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 `playwright-cli` when available). | UI, page, component, theme, or design-token work that benefits from generation + critique loops. |
|
|
144
144
|
|
|
145
145
|
### `deep-research-codebase`
|
|
@@ -169,6 +169,22 @@ workflow({
|
|
|
169
169
|
})
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
+
Output locations and result fields:
|
|
173
|
+
|
|
174
|
+
| Field | Meaning |
|
|
175
|
+
|---|---|
|
|
176
|
+
| `findings` | Final Markdown research report text. |
|
|
177
|
+
| `research_doc_path` | Public report path under `research/<date>-<topic>.md`. If a file already exists, the workflow writes a suffixed filename. |
|
|
178
|
+
| `artifact_dir` | Hidden per-run handoff directory under `research/.deep-research-<run-id>/`. |
|
|
179
|
+
| `manifest_path` | Manifest JSON path inside the hidden artifact directory. |
|
|
180
|
+
| `partitions` | Codebase partitions the specialists explored. |
|
|
181
|
+
| `explorer_count` | Number of partition explorer groups used. |
|
|
182
|
+
| `specialist_count` | Number of specialist stages run across the research waves. |
|
|
183
|
+
| `max_concurrency` | Concurrency limit used for the run. |
|
|
184
|
+
| `history` | Prior-research/history overview included in the final synthesis. |
|
|
185
|
+
|
|
186
|
+
The dated Markdown report is intended for people to read and commit or share. The hidden artifact directory keeps large scout, history, and specialist handoff files available for audit without cluttering the visible research index.
|
|
187
|
+
|
|
172
188
|
### `ralph`
|
|
173
189
|
|
|
174
190
|
Inputs:
|
|
@@ -186,9 +202,24 @@ Run examples:
|
|
|
186
202
|
/workflow ralph prompt="Migrate the database layer to Drizzle" max_loops=5 base_branch=develop
|
|
187
203
|
```
|
|
188
204
|
|
|
189
|
-
Ralph writes each planner
|
|
205
|
+
Ralph writes each planner goal contract to an OS-temp workflow artifact, returns the path as `plan_path`, then instructs the orchestrator to read that path instead of inlining the full plan. The goal contract captures owner intent, verification oracle, work surface, execution loop, and proof requirements; any user-supplied spec remains supporting input rather than the primary success criterion. The orchestrator also maintains OS-temp implementation notes, returned as `implementation_notes_path`, for the active work surface, receipts, decisions, goal-contract deviations, tradeoffs, blockers, and validation outcomes.
|
|
206
|
+
|
|
207
|
+
The review loop also performs the completion audit: reviewers map receipts and verification results back to the original owner outcome and inferred oracle before approving. After approval or loop exhaustion, Ralph runs PR preparation: reviewing changes against `base_branch`, checking the current diff and untracked files, checking local git identity (`git config user.name` and `git config user.email`), and looking for GitHub credentials. It creates a pull request only when there are meaningful changes, a usable remote/branch target, suitable repository state, and credentials that can access the repository. When multiple GitHub accounts are logged in, it uses local git identity as a hint and tries available credentials until one works. If PR creation succeeds, the final phase posts the implementation notes and reviewer approval summary as a PR comment. If not, `pr_report` explains what blocked creation and the commands or steps to run later.
|
|
208
|
+
|
|
209
|
+
Result fields:
|
|
210
|
+
|
|
211
|
+
| Field | Meaning |
|
|
212
|
+
|---|---|
|
|
213
|
+
| `result` | Final orchestrator summary. |
|
|
214
|
+
| `plan` | Last planner output text. |
|
|
215
|
+
| `plan_path` | OS-temp path to the latest planner goal contract. |
|
|
216
|
+
| `implementation_notes_path` | OS-temp Markdown notes maintained during orchestration. |
|
|
217
|
+
| `pr_report` | Final PR-preparation report, including created PR URL or why no PR was created. |
|
|
218
|
+
| `approved` | Whether the review loop approved the patch. |
|
|
219
|
+
| `iterations_completed` | Number of plan/orchestrate/review loops run. |
|
|
220
|
+
| `review_report` | Last structured review report used to decide whether to stop, including oracle satisfaction and remaining verification. |
|
|
190
221
|
|
|
191
|
-
A typical end-to-end flow is `/skill:research-codebase` → `/
|
|
222
|
+
A typical end-to-end flow is `/skill:research-codebase` → `/workflow ralph prompt="Implement the researched rate-limit behavior and validate it"`. If you already have a spec, pass it in the prompt as supporting input.
|
|
192
223
|
|
|
193
224
|
### `open-claude-design`
|
|
194
225
|
|
|
@@ -241,7 +272,9 @@ Named runs go to the background. Common controls:
|
|
|
241
272
|
/workflow kill <run-id> # destructive abort
|
|
242
273
|
```
|
|
243
274
|
|
|
244
|
-
Human-in-the-loop prompts from `ctx.ui.input`, `ctx.ui.confirm`, `ctx.ui.select`, and `ctx.ui.editor` appear in the workflow graph viewer, not as chat modals — use `/workflow connect <run-id>` (or F2) to answer them.
|
|
275
|
+
Human-in-the-loop prompts from `ctx.ui.input`, `ctx.ui.confirm`, `ctx.ui.select`, and `ctx.ui.editor` appear as awaiting-input nodes in the workflow graph viewer, not as chat modals — use `/workflow connect <run-id>` (or F2), focus the node, and press Enter to answer them locally.
|
|
276
|
+
|
|
277
|
+
Prompt answers are replayable only while the source run remains in the live in-memory store. `StageSnapshot.promptAnswerState` is snapshot-safe metadata for continuation: `available` means a matching live answer can be replayed, `unavailable` means the matching prompt node exists but its private answer was purged, and `ambiguous` means multiple matching prompt nodes exist so Atomic asks again. The raw answer lives in a private `PromptAnswerRecord` ledger, is never written to snapshots or persistence, and remains resident in memory until the answer is cleared, the run is removed, or the store is cleared. Prompt replay keys include the prompt kind, message text, select choices, input/editor initial value, and hashed author callsite, so changing any of those inputs may intentionally re-ask on continuation. An empty `ctx.ui.select(..., [])` has no answerable choices and throws before creating a prompt node.
|
|
245
278
|
|
|
246
279
|
## When to Use Workflows
|
|
247
280
|
|
|
@@ -459,13 +492,14 @@ In the TUI, `/workflow <name>` opens an input picker when the workflow declares
|
|
|
459
492
|
/workflow interrupt <run-id|--all>
|
|
460
493
|
/workflow kill <run-id|--all>
|
|
461
494
|
/workflow resume <run-id> [stage-id-or-name] [message]
|
|
495
|
+
/workflow reload
|
|
462
496
|
```
|
|
463
497
|
|
|
464
|
-
Use `connect` for the workflow graph. Use `attach` when you want a chat pane for a specific stage. Use `interrupt`, `pause`, and `resume` for resumable live work; `resume` on a non-paused run reopens the saved snapshot or overlay. Use `kill` only when the run should be terminated and removed from live history/status. `/workflow status` lists in-flight runs by default; `/workflow status --all` includes retained ended runs.
|
|
498
|
+
Use `connect` for the workflow graph. Use `attach` when you want a chat pane for a specific stage. Use `interrupt`, `pause`, and `resume` for resumable live work; `resume` on a non-paused run reopens the saved snapshot or overlay. Use `kill` only when the run should be terminated and removed from live history/status. Use `/workflow reload` after adding, editing, installing, or removing workflow resources and you want Atomic to rediscover them in-process. `/workflow status` lists in-flight runs by default; `/workflow status --all` includes retained ended runs.
|
|
465
499
|
|
|
466
500
|
<p align="center"><img src="images/workflow-graph.png" alt="Workflow Graph Viewer" width="600" /></p>
|
|
467
501
|
|
|
468
|
-
Human-in-the-loop prompts from `ctx.ui.input`, `ctx.ui.confirm`, `ctx.ui.select`, and `ctx.ui.editor` appear in the workflow UI/graph viewer, not as ordinary chat modals.
|
|
502
|
+
Human-in-the-loop prompts from `ctx.ui.input`, `ctx.ui.confirm`, `ctx.ui.select`, and `ctx.ui.editor` appear as awaiting-input nodes in the workflow UI/graph viewer, not as ordinary chat modals.
|
|
469
503
|
|
|
470
504
|
## Monitor and Control Runs
|
|
471
505
|
|
|
@@ -475,6 +509,17 @@ The workflow tool exposes lifecycle controls for non-interactive use:
|
|
|
475
509
|
workflow({ action: "status" })
|
|
476
510
|
workflow({ action: "status", runId: "<id-or-prefix>" })
|
|
477
511
|
|
|
512
|
+
workflow({ action: "stages", runId: "<id-or-prefix>", statusFilter: "all" })
|
|
513
|
+
workflow({ action: "stage", runId: "<id-or-prefix>", stageId: "review" })
|
|
514
|
+
workflow({ action: "transcript", runId: "<id-or-prefix>", stageId: "review", tail: 40 })
|
|
515
|
+
workflow({ action: "transcript", runId: "<id-or-prefix>", stageId: "review", includeToolOutput: true })
|
|
516
|
+
|
|
517
|
+
workflow({ action: "send", runId: "<id-or-prefix>", stageId: "review", text: "please focus on tests" })
|
|
518
|
+
workflow({ action: "send", runId: "<id-or-prefix>", stageId: "approval", response: true, delivery: "answer" })
|
|
519
|
+
|
|
520
|
+
workflow({ action: "pause", runId: "<id-or-prefix>" })
|
|
521
|
+
workflow({ action: "pause", runId: "<id-or-prefix>", stageId: "review" })
|
|
522
|
+
|
|
478
523
|
workflow({ action: "interrupt", runId: "<id-or-prefix>" })
|
|
479
524
|
workflow({ action: "interrupt", all: true })
|
|
480
525
|
|
|
@@ -483,15 +528,23 @@ workflow({ action: "resume", runId: "<id-or-prefix>", stageId: "review", message
|
|
|
483
528
|
|
|
484
529
|
workflow({ action: "kill", runId: "<id-or-prefix>" })
|
|
485
530
|
workflow({ action: "kill", all: true })
|
|
531
|
+
|
|
532
|
+
workflow({ action: "reload", reason: "added team workflow" })
|
|
486
533
|
```
|
|
487
534
|
|
|
488
535
|
Control behavior:
|
|
489
536
|
|
|
490
|
-
- `runId` accepts full run ids or unique prefixes for
|
|
491
|
-
- `
|
|
537
|
+
- `runId` accepts full run ids or unique prefixes for lifecycle and inspection actions.
|
|
538
|
+
- `stages` lists stage summaries. Use `statusFilter: "all"` to include completed, failed, skipped, and pending stages.
|
|
539
|
+
- `stage` returns details for one stage by stage id, unique prefix, or stage name.
|
|
540
|
+
- `transcript` reads recent messages for a stage. `tail` overrides `limit`; `includeToolOutput` includes captured snapshot tool output when available.
|
|
541
|
+
- `send` can answer pending prompts, steer streaming stages, queue follow-ups, or resume paused work. `delivery: "auto"` chooses in that order; use `delivery: "answer"` with `promptId` or `response` for explicit prompt answers.
|
|
542
|
+
- `pause`, `interrupt`, and `kill` can target one run or `all: true`; `stageId` cannot be combined with `all: true`.
|
|
492
543
|
- `interrupt` is resumable: it pauses live work when pausable stages exist and keeps the run in live history/status.
|
|
544
|
+
- `pause` is useful for pausing a live run or a single live stage without treating it as a destructive abort.
|
|
493
545
|
- `resume` can target a stage with `stageId`; the target may be a stage id, unique prefix, or stage name. `message` is forwarded to paused work.
|
|
494
546
|
- `kill` is destructive: it aborts in-flight work and removes the run from live history/status.
|
|
547
|
+
- `reload` refreshes discovered workflow resources in-process; the optional `reason` is echoed in the result.
|
|
495
548
|
|
|
496
549
|
Use slash commands for graph connect and stage attach because those are interactive TUI surfaces. When a run needs user input or attention, surface that to the user instead of polling silently.
|
|
497
550
|
|
|
@@ -682,7 +735,7 @@ Common task/stage options include:
|
|
|
682
735
|
`@bastani/workflows` is an Atomic package extension. It registers:
|
|
683
736
|
|
|
684
737
|
- `/workflow <name> key=value ...` for interactive named runs
|
|
685
|
-
- `/workflow connect|attach|pause|interrupt|resume|status|inputs` for live control and
|
|
738
|
+
- `/workflow connect|attach|pause|interrupt|resume|status|inputs|reload` for live control, inspection, and rediscovery
|
|
686
739
|
- the `workflow` tool for agent-initiated orchestration and direct one-off runs
|
|
687
740
|
- `runWorkflow(definition)` for explicit library or script usage
|
|
688
741
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.15",
|
|
4
4
|
"description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"atomicConfig": {
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"copy-binary-assets": "shx cp package.json dist/ && shx cp README.md dist/ && shx cp CHANGELOG.md dist/ && shx mkdir -p dist/theme && shx cp src/modes/interactive/theme/*.json dist/theme/ && shx mkdir -p dist/assets && shx cp src/modes/interactive/assets/*.png dist/assets/ && shx mkdir -p dist/export-html/vendor && shx cp src/core/export-html/template.html dist/export-html/ && shx cp src/core/export-html/vendor/*.js dist/export-html/vendor/ && shx cp -r docs dist/ && shx cp -r examples dist/ && shx cp ../../node_modules/@silvia-odwyer/photon-node/photon_rs_bg.wasm dist/ && bun run copy-builtin-packages",
|
|
44
44
|
"copy-builtin-packages": "bun run scripts/copy-builtin-packages.ts",
|
|
45
45
|
"copy-builtin-workflows": "bun run copy-builtin-packages",
|
|
46
|
+
"docs:check": "bun run scripts/validate-docs-links.ts",
|
|
46
47
|
"test": "vitest --run",
|
|
47
48
|
"prepublishOnly": "bun run clean && bun run build"
|
|
48
49
|
},
|
|
Binary file
|
package/docs/images/exy.png
DELETED