@bastani/atomic 0.5.22 → 0.5.23-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 (33) hide show
  1. package/.agents/skills/workflow-creator/SKILL.md +2 -2
  2. package/.agents/skills/workflow-creator/references/agent-sessions.md +21 -26
  3. package/.agents/skills/workflow-creator/references/discovery-and-verification.md +1 -1
  4. package/.agents/skills/workflow-creator/references/failure-modes.md +16 -9
  5. package/.agents/skills/workflow-creator/references/getting-started.md +0 -1
  6. package/.agents/skills/workflow-creator/references/session-config.md +5 -12
  7. package/.agents/skills/workflow-creator/references/workflow-inputs.md +2 -2
  8. package/.claude/agents/reviewer.md +2 -2
  9. package/.github/agents/reviewer.md +2 -2
  10. package/.opencode/agents/reviewer.md +2 -2
  11. package/dist/commands/cli/claude-stop-hook.d.ts +1 -0
  12. package/dist/commands/cli/claude-stop-hook.d.ts.map +1 -1
  13. package/dist/sdk/providers/claude.d.ts +9 -47
  14. package/dist/sdk/providers/claude.d.ts.map +1 -1
  15. package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts.map +1 -1
  16. package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +1 -1
  17. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts +0 -6
  18. package/dist/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.d.ts.map +1 -1
  19. package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +1 -1
  20. package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts +4 -4
  21. package/dist/sdk/workflows/builtin/ralph/helpers/prompts.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/src/cli.ts +17 -1
  24. package/src/commands/cli/claude-ask-hook.test.ts +128 -0
  25. package/src/commands/cli/claude-ask-hook.ts +84 -0
  26. package/src/commands/cli/claude-stop-hook.ts +2 -1
  27. package/src/sdk/providers/claude.ts +126 -160
  28. package/src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts +1 -6
  29. package/src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts +1 -6
  30. package/src/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.ts +30 -47
  31. package/src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts +0 -6
  32. package/src/sdk/workflows/builtin/ralph/copilot/index.ts +2 -2
  33. package/src/sdk/workflows/builtin/ralph/helpers/prompts.ts +7 -7
@@ -232,7 +232,7 @@ defineWorkflow({
232
232
  | Behaviour | Unset (default) | Set to a version newer than the installed CLI |
233
233
  |---|---|---|
234
234
  | Loader | Always loads | Refuses to load, returns `IncompatibleSDKError` |
235
- | `atomic workflow -l` | Normal row | `⚠ needs v<X> (installed v<Y>)` — dim name, visible |
235
+ | `atomic workflow list` | Normal row | `⚠ needs v<X> (installed v<Y>)` — dim name, visible |
236
236
  | Picker | Normal row | `⚠ update required` glyph + preview explains the gap; Enter is disabled |
237
237
  | `atomic workflow -n <name>` | Runs | Errors with an upgrade hint, non-zero exit |
238
238
 
@@ -314,7 +314,7 @@ Use `.for<"agent">()` on the builder to narrow all context types and get correct
314
314
  | Agent | Builder Chain | Primary Session API |
315
315
  |-------|---------------|---------------------|
316
316
  | Claude | `defineWorkflow({...}).for<"claude">()` | `s.session.query(prompt)` — sends prompt to the Claude TUI pane |
317
- | Copilot | `defineWorkflow({...}).for<"copilot">()` | `s.session.send({ prompt })` — fire-and-forget; use `sendAndWait({ prompt }, timeoutMs)` only when the user explicitly requests timeout-based waiting |
317
+ | Copilot | `defineWorkflow({...}).for<"copilot">()` | `s.session.send({ prompt })` — the runtime wraps `send` to block until `session.idle` with no timeout (see `failure-modes.md` §F10); do not use `sendAndWait` in Atomic workflows |
318
318
  | OpenCode | `defineWorkflow({...}).for<"opencode">()` | `s.client.session.prompt({ sessionID: s.session.id, parts: [...] })` |
319
319
 
320
320
  The runtime manages client/session lifecycle automatically. For native SDK types and advanced APIs, import directly from the provider packages (`@github/copilot-sdk`, `@anthropic-ai/claude-agent-sdk`, `@opencode-ai/sdk/v2`).
@@ -6,7 +6,7 @@ Each `ctx.stage()` call inside a workflow's `.run()` callback creates an isolate
6
6
 
7
7
  ## Claude Agent SDK
8
8
 
9
- Claude runs as a full interactive TUI in a tmux pane. The runtime auto-starts the Claude CLI (via `s.client`) and creates a session wrapper (`s.session`) before the callback runs. Pass CLI flags via `clientOpts` (2nd arg) and query defaults via `sessionOpts` (3rd arg).
9
+ Claude runs as a full interactive TUI in a tmux pane. The runtime auto-starts the Claude CLI (via `s.client`) and creates a session wrapper (`s.session`) before the callback runs. Pass CLI flags via `clientOpts` (2nd arg). Claude has **no per-session options** — the 3rd arg must be `{}`.
10
10
 
11
11
  ### Session lifecycle
12
12
 
@@ -18,7 +18,7 @@ import { defineWorkflow } from "@bastani/atomic/workflows";
18
18
  await ctx.stage(
19
19
  { name: "implement", description: "Implement the feature" },
20
20
  {}, // clientOpts: chatFlags and readyTimeoutMs go here
21
- {}, // sessionOpts: query defaults (pollIntervalMs, readyTimeoutMs, etc.) go here
21
+ {}, // sessionOpts: must be {} for Claude no per-session options exist
22
22
  async (s) => {
23
23
  // s.client — Claude CLI wrapper (already started by runtime)
24
24
  // s.session — session wrapper (ready to accept queries via s.session.query())
@@ -43,11 +43,9 @@ Client options (2nd arg to `ctx.stage()`):
43
43
  - `chatFlags` — CLI flags (default: `["--allow-dangerously-skip-permissions", "--dangerously-skip-permissions"]`)
44
44
  - `readyTimeoutMs` — timeout waiting for TUI readiness (default: 30s)
45
45
 
46
- Session options (3rd arg to `ctx.stage()`), applied as defaults to every `s.session.query()` call:
47
- - `pollIntervalMs` — polling interval (default: 2000ms)
48
- - `submitPresses` — C-m presses per submit round (default: 1)
49
- - `maxSubmitRounds` — max submit rounds (default: 6)
50
- - `readyTimeoutMs` — timeout waiting for pane readiness before sending (default: 30s)
46
+ Session options (3rd arg to `ctx.stage()`): **none**. The Claude session wrapper takes no configuration — interactive delivery is driven entirely by the CLI's Stop hook, and idle detection watches the Stop-hook marker automatically. Pass `{}`.
47
+
48
+ For **headless Claude** (`headless: true` in `stageOpts`), `s.session.query(prompt, options)` forwards its second argument as `Partial<SDKOptions>` to the Agent SDK that's where you pass `agent`, `permissionMode`, `allowDangerouslySkipPermissions`, etc. (see the headless example further down).
51
49
 
52
50
  No manual timeout is needed — idle detection watches for the pane prompt to return, and the session transcript is used to extract the response text.
53
51
 
@@ -292,30 +290,27 @@ export default defineWorkflow({
292
290
 
293
291
  ### `send` vs `sendAndWait`: choosing the right method
294
292
 
295
- **Default to `send`** for all Copilot workflow stages. `send` dispatches the
296
- prompt and returns the `messageId` immediately no timeout to guess, no
297
- constants to tune, no risk of aborting a long-running agent mid-work.
293
+ **Always use `send`** for Copilot workflow stages. Inside a stage callback the
294
+ Atomic runtime wraps `s.session.send()` so the returned promise only resolves
295
+ when the session emits `session.idle` the same semantics as Claude's
296
+ `query()` and OpenCode's `session.prompt()`. The wrapper has **no timeout**,
297
+ so long-running planners and reviewers are safe. This is different from the
298
+ raw Copilot SDK, where `send` is fire-and-forget; the wrapper is installed
299
+ per-stage by the runtime (`wrapCopilotSend` in `src/sdk/runtime/executor.ts`).
298
300
 
299
301
  ```ts
300
- // Default pattern — clean, no timeout guessing
302
+ // Default pattern — blocks until the agent is idle, no timeout
301
303
  await s.session.send({ prompt });
304
+ const messages = await s.session.getMessages(); // safe to read now
302
305
  ```
303
306
 
304
- **Use `sendAndWait` only when the user explicitly requests timeout-based
305
- waiting.** `sendAndWait` blocks until the session emits `session.idle` or the
306
- timeout fires. If you must use it, ask the user for a reasonable timeout. If
307
- they aren't sure, default to **5 minutes** (300 000 ms).
308
-
309
- ```ts
310
- // Only when the user explicitly wants timeout-gated waiting
311
- const SEND_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes default; ask the user
312
- await s.session.sendAndWait({ prompt }, SEND_TIMEOUT_MS);
313
- ```
314
-
315
- **Why not `sendAndWait` by default?** The 60-second default timeout is almost
316
- never correct for real agent work — planners, reviewers, and orchestrators
317
- routinely exceed it. Guessing large timeouts (30-60 min) adds messy constants
318
- and still risks aborting work prematurely. `send` avoids the problem entirely.
307
+ **Do not use `sendAndWait` in Atomic workflows.** It keeps the SDK's native
308
+ 60-second default timeout, which is almost never enough for real agent work —
309
+ planners, reviewers, and orchestrators routinely exceed it, and the throw
310
+ propagates out of `run()` and halts the whole workflow (see
311
+ `failure-modes.md` §F10). `send` already blocks until idle with no timeout,
312
+ so `sendAndWait` buys you nothing but a failure mode. If you think you need
313
+ it, you almost certainly want `send`.
319
314
 
320
315
  ### Critical pitfall: session lifecycle controls what context is available
321
316
 
@@ -164,7 +164,7 @@ discovery but marked **incompatible** — it never silently vanishes:
164
164
  |---|---|
165
165
  | `WorkflowLoader.loadWorkflow()` | Returns `{ ok: false, stage: "load", error: IncompatibleSDKError }` carrying `requiredVersion` + `currentVersion` |
166
166
  | `loadWorkflowsMetadata()` | Yields an entry with `status: { kind: "incompatible", requiredVersion, currentVersion, message }` |
167
- | `atomic workflow -l` | Row is dimmed, with an inline `⚠ needs v<X> (installed v<Y>)` badge after the name |
167
+ | `atomic workflow list` | Row is dimmed, with an inline `⚠ needs v<X> (installed v<Y>)` badge after the name |
168
168
  | `atomic workflow -a <agent>` picker | Row shows a `⚠` gutter glyph; preview pane explains the version gap and remediation; Enter does not advance to the prompt phase; bottom hint dims `↵ select` to `↵ unavailable` |
169
169
  | `atomic workflow -n <name> -a <agent>` | Exits non-zero, prints the `IncompatibleSDKError` message (`requires Atomic SDK v<X>, but v<Y> is installed. Update Atomic, or re-save the workflow against the current SDK.`) |
170
170
 
@@ -485,20 +485,27 @@ log the length. A 0-length or JSON-that-isn't-prose signature = F9.
485
485
  subsequent `ctx.stage()` call never executes — the throw propagates out of
486
486
  `run()` and halts the workflow.
487
487
 
488
- **Fix.** Use `send` instead of `sendAndWait` — it has no timeout and avoids
489
- the problem entirely. Only use `sendAndWait` when the user explicitly
490
- requests timeout-based waiting, and always pass an explicit timeout (default
491
- to 5 minutes if the user is unsure).
488
+ **Root cause.** The raw Copilot SDK's `sendAndWait(options, timeout?)`
489
+ defaults to a 60-second timeout that throws on expiry. Real agent work
490
+ (planners, reviewers, orchestrators) routinely exceeds this.
491
+
492
+ **Fix.** Use `send` instead. Inside an Atomic stage the runtime wraps
493
+ `s.session.send()` so it blocks until `session.idle` with **no timeout** —
494
+ the same blocking semantics as Claude's `query()` and OpenCode's
495
+ `session.prompt()`. The wrapper lives in `wrapCopilotSend`
496
+ (`src/sdk/runtime/executor.ts`) and is installed per-stage.
492
497
 
493
498
  ```ts
494
- // Default pattern no timeout, no risk
499
+ // Correct: send() in an Atomic stage blocks until idle, no timeout.
495
500
  await s.session.send({ prompt });
496
-
497
- // Only when the user explicitly wants timeout-gated waiting
498
- const SEND_TIMEOUT_MS = 5 * 60 * 1000; // ask the user for a value
499
- await s.session.sendAndWait({ prompt }, SEND_TIMEOUT_MS);
501
+ const messages = await s.session.getMessages(); // safe to read
500
502
  ```
501
503
 
504
+ **Do not reach for `sendAndWait` with a larger explicit timeout.** `send`
505
+ already waits for idle; `sendAndWait` just adds a throw-on-timeout failure
506
+ mode on top. If you catch yourself writing `sendAndWait(..., 5 * 60 * 1000)`
507
+ to "be safe", you want `send`.
508
+
502
509
  ---
503
510
 
504
511
  ## F11. ~~Manual Claude session initialization~~ (resolved by runtime)
@@ -234,7 +234,6 @@ The `@bastani/atomic/workflows` package exports the workflow authoring primitive
234
234
  - `ProviderClient<A>` — the `s.client` type, resolved by agent type
235
235
  - `ProviderSession<A>` — the `s.session` type, resolved by agent type
236
236
  - `ClaudeSessionWrapper` — Atomic wrapper for Claude sessions (exposes `s.session.query()`, which returns `SessionMessage[]`)
237
- - `ClaudeQueryDefaults` — per-stage query defaults (timeouts, poll interval) for Claude sessions
238
237
  - `SessionRef` — `string | SessionHandle<unknown>` for transcript/message lookups
239
238
  - `WorkflowContext` — top-level context passed to `.run()` callback
240
239
  - `WorkflowOptions` — `{ name, description? }` workflow metadata
@@ -19,16 +19,12 @@ await ctx.stage({ name: "..." }, {
19
19
 
20
20
  ### Session options (`sessionOpts` — 3rd arg to `ctx.stage()`)
21
21
 
22
- These are `ClaudeQueryDefaults` and set defaults for every `s.session.query()`
23
- call inside the callback. The available fields are: `pollIntervalMs`,
24
- `submitPresses`, `maxSubmitRounds`, `readyTimeoutMs`. Note that `timeoutMs` no
25
- longer exists — idle detection is automatic (pane capture for interactive
26
- stages, SDK streaming for headless stages).
22
+ Claude has **no per-session options** — the type is `Record<string, never>` and the 3rd arg must be `{}`. Interactive delivery is driven entirely by the CLI's Stop hook; idle detection is automatic (pane capture for interactive stages, SDK streaming for headless stages).
23
+
24
+ If you want to configure agent/permission/tools behavior for a **headless** Claude stage, pass those fields as the second argument to `s.session.query(prompt, options)` they flow through as `Partial<SDKOptions>` to the Agent SDK (see the headless example below).
27
25
 
28
26
  ```ts
29
- await ctx.stage({ name: "..." }, {}, {
30
- pollIntervalMs: 1_000, // Poll interval for output
31
- }, async (s) => {
27
+ await ctx.stage({ name: "..." }, {}, {}, async (s) => {
32
28
  await s.session.query((ctx.inputs.prompt ?? ""));
33
29
  s.save(s.sessionId);
34
30
  });
@@ -103,7 +99,7 @@ const result = query({
103
99
  the pane ID from `s.paneId` automatically. Call it inside the stage callback:
104
100
 
105
101
  ```ts
106
- import { extractAssistantText } from "@anthropic-ai/claude-agent-sdk";
102
+ import { extractAssistantText } from "@bastani/atomic/workflows";
107
103
 
108
104
  await ctx.stage({ name: "..." }, {}, {}, async (s) => {
109
105
  const result = await s.session.query("Your prompt");
@@ -113,9 +109,6 @@ await ctx.stage({ name: "..." }, {}, {}, async (s) => {
113
109
  });
114
110
  ```
115
111
 
116
- The query defaults (poll interval, submit presses, etc.) can be configured via
117
- `sessionOpts` as shown above.
118
-
119
112
  For **headless stages**, SDK options (such as `permissionMode`, `agent`,
120
113
  `allowDangerouslySkipPermissions`) can be passed directly as the second
121
114
  argument to `s.session.query()`:
@@ -214,7 +214,7 @@ redefining the canonical version of a workflow in a way that confuses
214
214
  teammates or breaks automation.
215
215
 
216
216
  You'll still see shadowed local/global workflows in
217
- `atomic workflow -l` output so the collision is visible, but running
217
+ `atomic workflow list` output so the collision is visible, but running
218
218
  `atomic workflow -n ralph -a claude` will always land on the builtin.
219
219
 
220
220
  The practical implication: **don't name a new workflow `ralph` or
@@ -225,7 +225,7 @@ this.
225
225
 
226
226
  ```bash
227
227
  # List everything, grouped by source
228
- atomic workflow -l
228
+ atomic workflow list
229
229
 
230
230
  # Launch the picker for a pinned agent
231
231
  atomic workflow -a claude
@@ -80,7 +80,7 @@ OUTPUT FORMAT:
80
80
  "confidence_score": <float 0.0-1.0>,
81
81
  "priority": <int 0-3, optional>,
82
82
  "code_location": {
83
- "absolute_file_path": "<file path>",
83
+ "file_path": "<repo-relative path>",
84
84
  "line_range": {"start": <int>, "end": <int>}
85
85
  }
86
86
  }
@@ -92,7 +92,7 @@ OUTPUT FORMAT:
92
92
  ```
93
93
 
94
94
  - **Do not** wrap the JSON in markdown fences or extra prose.
95
- - The code_location field is required and must include absolute_file_path and line_range.
95
+ - The code_location field is required and must include file_path (repo-relative) and line_range.
96
96
  - Line ranges must be as short as possible for interpreting the issue (avoid ranges over 5–10 lines; pick the most suitable subrange).
97
97
  - The code_location should overlap with the diff.
98
98
  - Do not generate a PR fix.
@@ -77,7 +77,7 @@ OUTPUT FORMAT:
77
77
  "confidence_score": <float 0.0-1.0>,
78
78
  "priority": <int 0-3, optional>,
79
79
  "code_location": {
80
- "absolute_file_path": "<file path>",
80
+ "file_path": "<repo-relative path>",
81
81
  "line_range": {"start": <int>, "end": <int>}
82
82
  }
83
83
  }
@@ -89,7 +89,7 @@ OUTPUT FORMAT:
89
89
  ```
90
90
 
91
91
  - **Do not** wrap the JSON in markdown fences or extra prose.
92
- - The code_location field is required and must include absolute_file_path and line_range.
92
+ - The code_location field is required and must include file_path (repo-relative) and line_range.
93
93
  - Line ranges must be as short as possible for interpreting the issue (avoid ranges over 5–10 lines; pick the most suitable subrange).
94
94
  - The code_location should overlap with the diff.
95
95
  - Do not generate a PR fix.
@@ -85,7 +85,7 @@ OUTPUT FORMAT:
85
85
  "confidence_score": <float 0.0-1.0>,
86
86
  "priority": <int 0-3, optional>,
87
87
  "code_location": {
88
- "absolute_file_path": "<file path>",
88
+ "file_path": "<repo-relative path>",
89
89
  "line_range": {"start": <int>, "end": <int>}
90
90
  }
91
91
  }
@@ -97,7 +97,7 @@ OUTPUT FORMAT:
97
97
  ```
98
98
 
99
99
  - **Do not** wrap the JSON in markdown fences or extra prose.
100
- - The code_location field is required and must include absolute_file_path and line_range.
100
+ - The code_location field is required and must include file_path (repo-relative) and line_range.
101
101
  - Line ranges must be as short as possible for interpreting the issue (avoid ranges over 5–10 lines; pick the most suitable subrange).
102
102
  - The code_location should overlap with the diff.
103
103
  - Do not generate a PR fix.
@@ -44,6 +44,7 @@ export declare function claudeHookDirs(): {
44
44
  marker: string;
45
45
  queue: string;
46
46
  release: string;
47
+ hil: string;
47
48
  };
48
49
  /** Options for {@link claudeStopHookCommand}. Primarily used by tests to shrink the wait budget. */
49
50
  export interface ClaudeStopHookOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"claude-stop-hook.d.ts","sourceRoot":"","sources":["../../../src/commands/cli/claude-stop-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAOH,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAeD;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAOnF;AAED,oGAAoG;AACpG,MAAM,WAAW,qBAAqB;IACpC,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAKD;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,MAAM,CAAC,CAsGjB"}
1
+ {"version":3,"file":"claude-stop-hook.d.ts","sourceRoot":"","sources":["../../../src/commands/cli/claude-stop-hook.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAOH,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAeD;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAQhG;AAED,oGAAoG;AACpG,MAAM,WAAW,qBAAqB;IACpC,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAKD;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,MAAM,CAAC,CAsGjB"}
@@ -63,16 +63,6 @@ export interface ClaudeSessionOptions {
63
63
  * ```
64
64
  */
65
65
  export declare function createClaudeSession(options: ClaudeSessionOptions): Promise<string>;
66
- /**
67
- * Returns true if the most recent assistant message contains an
68
- * `AskUserQuestion` tool_use block that has not yet been resolved
69
- * by a corresponding `tool_result` in a subsequent user message.
70
- *
71
- * Pure function — no side effects, safe to call from a watch loop.
72
- *
73
- * Exported as `_hasUnresolvedHILTool` for unit testing.
74
- */
75
- export declare function _hasUnresolvedHILTool(messages: SessionMessage[]): boolean;
76
66
  /**
77
67
  * Returns true when the most recent assistant message in the transcript
78
68
  * ended with `stop_reason: "tool_use"` — i.e. the agent stopped the current
@@ -93,47 +83,19 @@ export declare function _hasUnresolvedHILTool(messages: SessionMessage[]): boole
93
83
  */
94
84
  export declare function _isMidAgentLoop(messages: SessionMessage[]): boolean;
95
85
  /**
96
- * Core HIL watcher loop pure logic, dependency-injected for testability.
97
- *
98
- * Iterates an async iterable of "file change" events (each event triggers a
99
- * transcript read via `readMessages`). Calls `onHIL(true)` when
100
- * `_hasUnresolvedHILTool` first returns true, `onHIL(false)` when it returns
101
- * false after having been true. The `wasHIL` guard prevents redundant
102
- * callbacks on repeated events with the same HIL state. Read errors from
103
- * `readMessages` are swallowed so a single corrupt JSONL write doesn't kill
104
- * the watcher.
105
- *
106
- * Exported as `_runHILWatcher` for unit testing (event source and message
107
- * reader are injected rather than hard-coded to `fs.watch` / `getSessionMessages`).
108
- */
109
- export declare function _runHILWatcher(events: AsyncIterable<unknown>, readMessages: () => Promise<SessionMessage[]>, onHIL: (waiting: boolean) => void): Promise<void>;
110
- /**
111
- * Path helpers for the transcript JSONL written by Claude Code.
112
- * @internal Exported for tests.
113
- */
114
- export declare function transcriptDir(): string;
115
- /** @internal Exported for tests. */
116
- export declare function transcriptPath(claudeSessionId: string): string;
117
- /**
118
- * Watch this session's transcript JSONL and call `onHIL` on every HIL-state
119
- * transition — independently of the Stop hook.
120
- *
121
- * Why not piggyback on the Stop hook? `AskUserQuestion` is a deferred tool
122
- * (`shouldDefer: true`, see Claude Code's
123
- * `src/tools/AskUserQuestionTool/AskUserQuestionTool.tsx`). While the question
124
- * is pending, Claude's agent loop blocks on the tool with
125
- * `needsFollowUp === true`, so `handleStopHooks` never runs
126
- * (`src/query.ts`: `if (!needsFollowUp)`). A watcher tied to the Stop-hook
127
- * marker would sleep through the entire HIL window and only wake up after
128
- * the user has already answered.
86
+ * Watch `~/.atomic/claude-hil/` for this session's marker file and fire
87
+ * `onHIL(true|false)` on create/unlink. Returns when `signal` is aborted.
129
88
  *
130
- * Watches the parent session directory rather than the file itself so the
131
- * attach is safe before Claude has created the JSONL on first query. Events
132
- * are filtered by `<sessionId>.jsonl`. Returns when `signal` is aborted.
89
+ * The marker is written by the `_claude-ask-hook enter` subcommand from
90
+ * Claude Code's `PreToolUse` hook (matched on `AskUserQuestion`) and removed
91
+ * by `_claude-ask-hook exit` from `PostToolUse` / `PostToolUseFailure`. That
92
+ * makes the signal deterministic and independent of Claude Code's batched
93
+ * JSONL flush timing, which used to hide the HIL window entirely when
94
+ * tool_use and tool_result landed in the same file write.
133
95
  *
134
96
  * @internal Exported for tests.
135
97
  */
136
- export declare function watchTranscriptForHIL(claudeSessionId: string, onHIL: (waiting: boolean) => void, signal: AbortSignal): Promise<void>;
98
+ export declare function watchHILMarker(claudeSessionId: string, onHIL: (waiting: boolean) => void, signal: AbortSignal): Promise<void>;
137
99
  /**
138
100
  * Path of the directory where the claude-stop-hook writes marker files.
139
101
  * Each Claude turn creates `~/.atomic/claude-stop/<session_id>` which
@@ -1 +1 @@
1
- {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/sdk/providers/claude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,OAAO,IAAI,UAAU,EAC3B,MAAM,gCAAgC,CAAC;AAgCxC;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAWtE;AA4DD,MAAM,WAAW,oBAAoB;IACnC,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,sIAAsI;IACtI,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;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pC;;;;;;;;OAQG;IACG,KAAK,CACT,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAC7B,OAAO,CAAC,cAAc,EAAE,CAAC;IAQ5B,gEAAgE;IAC1D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAClC;AAMD;;;GAGG;AACH,qBAAa,2BAA2B;IACtC;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;IAGxB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;GAUG;AACH,qBAAa,4BAA4B;IACvC,QAAQ,CAAC,MAAM,MAAM;IACrB;;;;;OAKG;IACH,OAAO,CAAC,cAAc,CAAc;IAEpC,IAAI,SAAS,IAAI,MAAM,CAEtB;IAEK,KAAK,CACT,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,cAAc,CAAC,EAC9C,OAAO,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAC5B,OAAO,CAAC,cAAc,EAAE,CAAC;IAetB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAClC;AAQD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,+DAejC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;;AAsCH,wBA6Ta"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;;AAsCH,wBAwTa"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;AA6CH,wBAiSa"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;AA6CH,wBA4Ra"}
@@ -51,7 +51,6 @@ export declare function buildScoutPrompt(opts: {
51
51
  export declare function buildLocatorPrompt(opts: {
52
52
  question: string;
53
53
  partition: PartitionUnit[];
54
- root: string;
55
54
  scoutOverview: string;
56
55
  index: number;
57
56
  total: number;
@@ -60,7 +59,6 @@ export declare function buildLocatorPrompt(opts: {
60
59
  export declare function buildPatternFinderPrompt(opts: {
61
60
  question: string;
62
61
  partition: PartitionUnit[];
63
- root: string;
64
62
  scoutOverview: string;
65
63
  index: number;
66
64
  total: number;
@@ -70,7 +68,6 @@ export declare function buildAnalyzerPrompt(opts: {
70
68
  question: string;
71
69
  partition: PartitionUnit[];
72
70
  locatorOutput: string;
73
- root: string;
74
71
  scoutOverview: string;
75
72
  index: number;
76
73
  total: number;
@@ -80,20 +77,17 @@ export declare function buildOnlineResearcherPrompt(opts: {
80
77
  question: string;
81
78
  partition: PartitionUnit[];
82
79
  locatorOutput: string;
83
- root: string;
84
80
  index: number;
85
81
  total: number;
86
82
  }): string;
87
83
  /** codebase-research-locator — find prior research docs about the topic. */
88
84
  export declare function buildHistoryLocatorPrompt(opts: {
89
85
  question: string;
90
- root: string;
91
86
  }): string;
92
87
  /** codebase-research-analyzer — synthesize insights from located research docs. */
93
88
  export declare function buildHistoryAnalyzerPrompt(opts: {
94
89
  question: string;
95
90
  locatorOutput: string;
96
- root: string;
97
91
  }): string;
98
92
  export declare function buildAggregatorPrompt(opts: {
99
93
  question: string;
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../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b,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CA0FT;AAED,qFAAqF;AACrF,wBAAgB,2BAA2B,CAAC,IAAI,EAAE;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CA2ET;AAMD,4EAA4E;AAC5E,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,CAsDT;AAED,mFAAmF;AACnF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,CAuDT;AAMD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,aAAa,EAAE,CAAC;KAC5B,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,MAAM,CAwIT"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/helpers/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;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AAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CA2ET;AAMD,4EAA4E;AAC5E,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CAoDT;AAED,mFAAmF;AACnF,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,CAuDT;AAMD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,aAAa,EAAE,CAAC;KAC5B,EAAE,CAAC;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;CACzB,GAAG,MAAM,CAwIT"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;AAsCH,wBAoVa"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;AAsCH,wBA8Ua"}
@@ -19,7 +19,7 @@ export declare const ReviewFindingSchema: z.ZodObject<{
19
19
  confidence_score: z.ZodOptional<z.ZodNumber>;
20
20
  priority: z.ZodOptional<z.ZodNumber>;
21
21
  code_location: z.ZodOptional<z.ZodObject<{
22
- absolute_file_path: z.ZodString;
22
+ file_path: z.ZodString;
23
23
  line_range: z.ZodObject<{
24
24
  start: z.ZodNumber;
25
25
  end: z.ZodNumber;
@@ -34,7 +34,7 @@ export declare const ReviewResultSchema: z.ZodObject<{
34
34
  confidence_score: z.ZodOptional<z.ZodNumber>;
35
35
  priority: z.ZodOptional<z.ZodNumber>;
36
36
  code_location: z.ZodOptional<z.ZodObject<{
37
- absolute_file_path: z.ZodString;
37
+ file_path: z.ZodString;
38
38
  line_range: z.ZodObject<{
39
39
  start: z.ZodNumber;
40
40
  end: z.ZodNumber;
@@ -53,7 +53,7 @@ export declare const REVIEW_RESULT_JSON_SCHEMA: z.core.ZodStandardJSONSchemaPayl
53
53
  confidence_score: z.ZodOptional<z.ZodNumber>;
54
54
  priority: z.ZodOptional<z.ZodNumber>;
55
55
  code_location: z.ZodOptional<z.ZodObject<{
56
- absolute_file_path: z.ZodString;
56
+ file_path: z.ZodString;
57
57
  line_range: z.ZodObject<{
58
58
  start: z.ZodNumber;
59
59
  end: z.ZodNumber;
@@ -143,7 +143,7 @@ export interface ReviewFinding {
143
143
  confidence_score?: number;
144
144
  priority?: number;
145
145
  code_location?: {
146
- absolute_file_path: string;
146
+ file_path: string;
147
147
  line_range: {
148
148
  start: number;
149
149
  end: number;
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/ralph/helpers/prompts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,8CAA8C;AAC9C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iBAsC9B,CAAC;AAEH,wDAAwD;AACxD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;iBAgB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AAM,EAAE,CAAC;KAClB,CAAC;IACF,2DAA2D;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,GACrB,MAAM,CAgMR;AAMD,MAAM,WAAW,eAAe;IAC9B,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,SAAS,EAAE;QACT,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;CACH;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,GAAG,IAAI,EAC3B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,GACvB,MAAM,CAoHR;AAMD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAgDtE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC,GAAG,YAAY,CAUf;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAS5D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.5.22",
3
+ "version": "0.5.23-0",
4
4
  "description": "Configuration management CLI and SDK for coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/cli.ts CHANGED
@@ -347,6 +347,21 @@ Examples:
347
347
  process.exit(exitCode);
348
348
  });
349
349
 
350
+ // ── Internal: Claude AskUserQuestion hook handler ─────────────────────
351
+ program
352
+ .command("_claude-ask-hook", { hidden: true })
353
+ .description("Internal: Claude Code AskUserQuestion hook handler — writes/removes HIL marker")
354
+ .argument("<mode>", "enter (PreToolUse) or exit (PostToolUse / PostToolUseFailure)")
355
+ .action(async (mode: string) => {
356
+ if (mode !== "enter" && mode !== "exit") {
357
+ console.error(`[claude-ask-hook] Invalid mode: ${mode}`);
358
+ process.exit(0);
359
+ }
360
+ const { claudeAskHookCommand } = await import("./commands/cli/claude-ask-hook.ts");
361
+ const exitCode = await claudeAskHookCommand(mode);
362
+ process.exit(exitCode);
363
+ });
364
+
350
365
  // ── Completions command ────────────────────────────────────────────────
351
366
  program
352
367
  .command("completions")
@@ -398,7 +413,8 @@ async function main(): Promise<void> {
398
413
  argv.includes("-h") ||
399
414
  argv[0] === "completions" ||
400
415
  argv[0] === "_footer" ||
401
- argv[0] === "_claude-stop-hook";
416
+ argv[0] === "_claude-stop-hook" ||
417
+ argv[0] === "_claude-ask-hook";
402
418
 
403
419
  if (!isInfoCommand) {
404
420
  const { autoSyncIfStale } = await import("./services/system/auto-sync.ts");