@bastani/atomic 0.5.21 → 0.5.22-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.
- package/.claude/settings.json +0 -12
- package/dist/commands/cli/claude-stop-hook.d.ts +65 -0
- package/dist/commands/cli/claude-stop-hook.d.ts.map +1 -0
- package/dist/sdk/providers/claude.d.ts +132 -84
- package/dist/sdk/providers/claude.d.ts.map +1 -1
- package/dist/sdk/runtime/executor.d.ts.map +1 -1
- package/dist/sdk/types.d.ts +4 -4
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/sdk/workflows/index.d.ts +1 -1
- package/dist/sdk/workflows/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/commands/cli/claude-stop-hook.test.ts +155 -24
- package/src/commands/cli/claude-stop-hook.ts +122 -16
- package/src/commands/cli/workflow.ts +10 -0
- package/src/sdk/providers/claude.ts +511 -290
- package/src/sdk/runtime/executor.test.ts +173 -27
- package/src/sdk/runtime/executor.ts +348 -102
- package/src/sdk/types.ts +2 -4
- package/src/sdk/workflows/index.ts +0 -1
package/.claude/settings.json
CHANGED
|
@@ -21,17 +21,5 @@
|
|
|
21
21
|
"kotlin-lsp@claude-plugins-official": true,
|
|
22
22
|
"swift-lsp@claude-plugins-official": true,
|
|
23
23
|
"lua-lsp@claude-plugins-official": true
|
|
24
|
-
},
|
|
25
|
-
"hooks": {
|
|
26
|
-
"Stop": [
|
|
27
|
-
{
|
|
28
|
-
"hooks": [
|
|
29
|
-
{
|
|
30
|
-
"type": "command",
|
|
31
|
-
"command": "atomic _claude-stop-hook"
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
24
|
}
|
|
37
25
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Stop Hook command — internal handler for Claude Code's Stop hook.
|
|
3
|
+
*
|
|
4
|
+
* Claude invokes `atomic _claude-stop-hook` at the end of every turn,
|
|
5
|
+
* piping a JSON payload via stdin. This handler has two jobs:
|
|
6
|
+
*
|
|
7
|
+
* 1. Write a per-session marker file that the workflow runtime watches via
|
|
8
|
+
* `fs.watch` to detect turn completion (replacing tmux-pane scraping).
|
|
9
|
+
*
|
|
10
|
+
* 2. Deliver follow-up prompts without tmux send-keys. After the marker is
|
|
11
|
+
* written, this process block-polls `~/.atomic/claude-queue/<session_id>`.
|
|
12
|
+
* If the workflow enqueues a prompt there, we read it, delete the queue
|
|
13
|
+
* entry, and emit `{"decision":"block","reason":<prompt>}` on stdout.
|
|
14
|
+
* Claude Code treats `reason` as the next user message and keeps the
|
|
15
|
+
* agent loop running on the same session — no TUI keystrokes required.
|
|
16
|
+
* If the workflow instead signals session end via
|
|
17
|
+
* `~/.atomic/claude-release/<session_id>`, we exit 0 and let Claude stop.
|
|
18
|
+
*
|
|
19
|
+
* Usage (configured in Claude's Stop hook):
|
|
20
|
+
* atomic _claude-stop-hook
|
|
21
|
+
*
|
|
22
|
+
* Payload (JSON via stdin):
|
|
23
|
+
* {
|
|
24
|
+
* "session_id": "abc123",
|
|
25
|
+
* "transcript_path": "/path/to/transcript",
|
|
26
|
+
* "cwd": "/path/to/cwd",
|
|
27
|
+
* "stop_hook_active": false
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
/** Shape of the JSON payload Claude pipes to the Stop hook via stdin. */
|
|
31
|
+
export interface ClaudeStopHookPayload {
|
|
32
|
+
session_id: string;
|
|
33
|
+
transcript_path?: string;
|
|
34
|
+
cwd?: string;
|
|
35
|
+
stop_hook_active?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Directory paths used by the Stop hook and the workflow runtime to exchange
|
|
39
|
+
* per-session signals.
|
|
40
|
+
*
|
|
41
|
+
* Exported so tests and `src/sdk/providers/claude.ts` share one source of truth.
|
|
42
|
+
*/
|
|
43
|
+
export declare function claudeHookDirs(): {
|
|
44
|
+
marker: string;
|
|
45
|
+
queue: string;
|
|
46
|
+
release: string;
|
|
47
|
+
};
|
|
48
|
+
/** Options for {@link claudeStopHookCommand}. Primarily used by tests to shrink the wait budget. */
|
|
49
|
+
export interface ClaudeStopHookOptions {
|
|
50
|
+
/** Maximum time the hook waits for a queued follow-up prompt before letting Claude stop. */
|
|
51
|
+
waitTimeoutMs?: number;
|
|
52
|
+
/** Polling interval for queue/release detection. */
|
|
53
|
+
pollIntervalMs?: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Handler for the hidden `_claude-stop-hook` subcommand.
|
|
57
|
+
*
|
|
58
|
+
* Returns an exit code (0 on success or benign failure). The caller
|
|
59
|
+
* in src/cli.ts does `process.exit(exitCode)`, so we just return the code.
|
|
60
|
+
*
|
|
61
|
+
* We always return 0 — a non-zero exit would surface as a hook error in
|
|
62
|
+
* Claude's transcript, which is not what we want.
|
|
63
|
+
*/
|
|
64
|
+
export declare function claudeStopHookCommand(options?: ClaudeStopHookOptions): Promise<number>;
|
|
65
|
+
//# sourceMappingURL=claude-stop-hook.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -18,18 +18,16 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type SessionMessage, type SDKUserMessage, type Options as SDKOptions } from "@anthropic-ai/claude-agent-sdk";
|
|
20
20
|
/**
|
|
21
|
-
* Remove a pane from the initialized map
|
|
22
|
-
*
|
|
21
|
+
* Remove a pane from the initialized map and signal the currently-blocked
|
|
22
|
+
* Stop hook that the session is over, so Claude stops promptly instead of
|
|
23
|
+
* waiting out the hook's safety timeout.
|
|
24
|
+
*
|
|
25
|
+
* Called by the runtime when a Claude stage is being torn down. Idempotent.
|
|
23
26
|
*/
|
|
24
|
-
export declare function clearClaudeSession(paneId: string): void
|
|
27
|
+
export declare function clearClaudeSession(paneId: string): Promise<void>;
|
|
25
28
|
export interface ClaudeSessionOptions {
|
|
26
29
|
/** tmux pane ID where Claude should be started */
|
|
27
30
|
paneId: string;
|
|
28
|
-
/**
|
|
29
|
-
* Workflow session directory. The first prompt is written here as
|
|
30
|
-
* `prompt.txt` and Claude is told to read from that path.
|
|
31
|
-
*/
|
|
32
|
-
sessionDir: string;
|
|
33
31
|
/** CLI flags to pass to the `claude` command (default: ["--allow-dangerously-skip-permissions", "--dangerously-skip-permissions"]) */
|
|
34
32
|
chatFlags?: string[];
|
|
35
33
|
/** Timeout in ms waiting for Claude TUI to be ready (default: 30s) */
|
|
@@ -64,7 +62,7 @@ export interface ClaudeSessionOptions {
|
|
|
64
62
|
* });
|
|
65
63
|
* ```
|
|
66
64
|
*/
|
|
67
|
-
export declare function createClaudeSession(options: ClaudeSessionOptions): Promise<
|
|
65
|
+
export declare function createClaudeSession(options: ClaudeSessionOptions): Promise<string>;
|
|
68
66
|
/**
|
|
69
67
|
* Returns true if the most recent assistant message contains an
|
|
70
68
|
* `AskUserQuestion` tool_use block that has not yet been resolved
|
|
@@ -75,6 +73,25 @@ export declare function createClaudeSession(options: ClaudeSessionOptions): Prom
|
|
|
75
73
|
* Exported as `_hasUnresolvedHILTool` for unit testing.
|
|
76
74
|
*/
|
|
77
75
|
export declare function _hasUnresolvedHILTool(messages: SessionMessage[]): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Returns true when the most recent assistant message in the transcript
|
|
78
|
+
* ended with `stop_reason: "tool_use"` — i.e. the agent stopped the current
|
|
79
|
+
* API response to call a tool but has not yet produced its post-tool answer.
|
|
80
|
+
*
|
|
81
|
+
* Claude Code's Stop hook fires each time Claude "finishes responding",
|
|
82
|
+
* which includes intermediate tool-use responses in a multi-step agent
|
|
83
|
+
* loop (not just the final `end_turn`). If we return from `waitForIdle`
|
|
84
|
+
* on the first Stop event, we capture the transcript mid-loop — the
|
|
85
|
+
* final assistant text block is still being generated and won't be on
|
|
86
|
+
* disk yet, so `inbox.md` drops the actual answer.
|
|
87
|
+
*
|
|
88
|
+
* We keep watching until we see an assistant message with a terminal
|
|
89
|
+
* stop_reason (`end_turn`, `max_tokens`, `stop_sequence`, `refusal`),
|
|
90
|
+
* which is the real end of the turn.
|
|
91
|
+
*
|
|
92
|
+
* Exported as `_isMidAgentLoop` for unit testing.
|
|
93
|
+
*/
|
|
94
|
+
export declare function _isMidAgentLoop(messages: SessionMessage[]): boolean;
|
|
78
95
|
/**
|
|
79
96
|
* Core HIL watcher loop — pure logic, dependency-injected for testability.
|
|
80
97
|
*
|
|
@@ -90,10 +107,37 @@ export declare function _hasUnresolvedHILTool(messages: SessionMessage[]): boole
|
|
|
90
107
|
* reader are injected rather than hard-coded to `fs.watch` / `getSessionMessages`).
|
|
91
108
|
*/
|
|
92
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.
|
|
129
|
+
*
|
|
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.
|
|
133
|
+
*
|
|
134
|
+
* @internal Exported for tests.
|
|
135
|
+
*/
|
|
136
|
+
export declare function watchTranscriptForHIL(claudeSessionId: string, onHIL: (waiting: boolean) => void, signal: AbortSignal): Promise<void>;
|
|
93
137
|
/**
|
|
94
138
|
* Path of the directory where the claude-stop-hook writes marker files.
|
|
95
|
-
* Each Claude turn creates `~/.atomic/claude-stop/<session_id>`
|
|
96
|
-
*
|
|
139
|
+
* Each Claude turn creates `~/.atomic/claude-stop/<session_id>` which
|
|
140
|
+
* triggers the `fs.watch` event in `waitForIdle`.
|
|
97
141
|
*
|
|
98
142
|
* @internal Exported for unit tests.
|
|
99
143
|
*/
|
|
@@ -105,53 +149,37 @@ export declare function markerDir(): string;
|
|
|
105
149
|
*/
|
|
106
150
|
export declare function markerPath(claudeSessionId: string): string;
|
|
107
151
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* The function signature is intentionally identical to the previous polling
|
|
129
|
-
* implementation so all callers remain unchanged.
|
|
130
|
-
*
|
|
131
|
-
* @param paneId - tmux pane (kept in signature for caller compat; not used here)
|
|
132
|
-
* @param claudeSessionId - Claude's session UUID (used to identify marker file)
|
|
133
|
-
* @param transcriptBeforeCount - number of messages in transcript before this turn
|
|
134
|
-
* @param beforeContent - (unused) pane content before send; kept for compat
|
|
135
|
-
* @param pollIntervalMs - (unused) kept for compat; watch is event-driven
|
|
136
|
-
* @param onHIL - optional callback for HIL state changes
|
|
152
|
+
* Directory where the workflow runtime writes queued follow-up prompts that
|
|
153
|
+
* `atomic _claude-stop-hook` picks up and feeds back to Claude as
|
|
154
|
+
* `{decision:"block", reason:<prompt>}`. @internal Exported for unit tests.
|
|
155
|
+
*/
|
|
156
|
+
export declare function queueDir(): string;
|
|
157
|
+
/** Return the queue file path for a given Claude session ID. @internal */
|
|
158
|
+
export declare function queuePath(claudeSessionId: string): string;
|
|
159
|
+
/**
|
|
160
|
+
* Directory where the runtime writes session-release signals. When the Stop
|
|
161
|
+
* hook sees `~/.atomic/claude-release/<session_id>` it exits 0 without
|
|
162
|
+
* emitting a block decision — the signal used by `clearClaudeSession` to
|
|
163
|
+
* tell Claude it's safe to actually stop. @internal Exported for unit tests.
|
|
164
|
+
*/
|
|
165
|
+
export declare function releaseDir(): string;
|
|
166
|
+
/** Return the release file path for a given Claude session ID. @internal */
|
|
167
|
+
export declare function releasePath(claudeSessionId: string): string;
|
|
168
|
+
/**
|
|
169
|
+
* Signal the Stop hook's blocking wait that this session is done. Called
|
|
170
|
+
* during session teardown so the final hook invocation exits 0 promptly.
|
|
171
|
+
* Safe to call more than once.
|
|
137
172
|
*/
|
|
173
|
+
export declare function releaseClaudeSession(claudeSessionId: string): Promise<void>;
|
|
138
174
|
/**
|
|
139
175
|
* @internal Exported for unit tests.
|
|
140
176
|
*/
|
|
141
|
-
export declare function waitForIdle(
|
|
177
|
+
export declare function waitForIdle(claudeSessionId: string, transcriptBeforeCount: number): Promise<SessionMessage[]>;
|
|
142
178
|
export interface ClaudeQueryOptions {
|
|
143
179
|
/** tmux pane ID where Claude is running */
|
|
144
180
|
paneId: string;
|
|
145
181
|
/** The prompt to send */
|
|
146
182
|
prompt: string;
|
|
147
|
-
/** Polling interval in ms (default: 2000) */
|
|
148
|
-
pollIntervalMs?: number;
|
|
149
|
-
/** Number of C-m presses per submit round (default: 1 for Claude) */
|
|
150
|
-
submitPresses?: number;
|
|
151
|
-
/** Max submit rounds if text isn't consumed (default: 6) */
|
|
152
|
-
maxSubmitRounds?: number;
|
|
153
|
-
/** Timeout in ms waiting for pane to be ready before sending (default: 30s) */
|
|
154
|
-
readyTimeoutMs?: number;
|
|
155
183
|
/**
|
|
156
184
|
* Called when the agent's human-in-the-loop state changes.
|
|
157
185
|
* `waiting=true` → AskUserQuestion is pending (agent blocked on user input).
|
|
@@ -176,14 +204,23 @@ export declare function extractAssistantText(msgs: ReadonlyArray<{
|
|
|
176
204
|
/**
|
|
177
205
|
* Send a prompt to a Claude Code interactive session running in a tmux pane.
|
|
178
206
|
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
207
|
+
* First query and follow-up queries use different delivery channels:
|
|
208
|
+
*
|
|
209
|
+
* - **First query**: stages the prompt in a tmp file and spawns
|
|
210
|
+
* `claude --session-id <UUID> 'Read the prompt in <path>'` into the
|
|
211
|
+
* empty pane. Claude's first action is a Read tool call, which
|
|
212
|
+
* sidesteps ARG_MAX on the spawn argv.
|
|
213
|
+
*
|
|
214
|
+
* - **Follow-up query**: writes the prompt to
|
|
215
|
+
* `~/.atomic/claude-queue/<session_id>`. The Stop hook from the
|
|
216
|
+
* previous turn is blocked in a poll loop there; it reads the queue
|
|
217
|
+
* entry and emits `{"decision":"block","reason":<prompt>}` on stdout,
|
|
218
|
+
* which Claude Code feeds back as the next user message. No tmux
|
|
219
|
+
* keystrokes, no paste-buffer dance, no pane-state polling — the
|
|
220
|
+
* whole delivery rides Claude's own continuation API.
|
|
221
|
+
*
|
|
222
|
+
* Both paths converge on `waitForIdle`, which watches the Stop-hook marker
|
|
223
|
+
* file for this session and returns the transcript slice for the turn.
|
|
187
224
|
*
|
|
188
225
|
* @example
|
|
189
226
|
* ```typescript
|
|
@@ -197,20 +234,6 @@ export declare function extractAssistantText(msgs: ReadonlyArray<{
|
|
|
197
234
|
* ```
|
|
198
235
|
*/
|
|
199
236
|
export declare function claudeQuery(options: ClaudeQueryOptions): Promise<SessionMessage[]>;
|
|
200
|
-
/**
|
|
201
|
-
* Default query options the user can set per-stage via the `sessionOpts` arg.
|
|
202
|
-
* These become defaults for every `s.session.query()` call within that stage.
|
|
203
|
-
*/
|
|
204
|
-
export interface ClaudeQueryDefaults {
|
|
205
|
-
/** Polling interval in ms (default: 2000) */
|
|
206
|
-
pollIntervalMs?: number;
|
|
207
|
-
/** Number of C-m presses per submit round (default: 1) */
|
|
208
|
-
submitPresses?: number;
|
|
209
|
-
/** Max submit rounds if text isn't consumed (default: 6) */
|
|
210
|
-
maxSubmitRounds?: number;
|
|
211
|
-
/** Timeout in ms waiting for pane to be ready before sending (default: 30s) */
|
|
212
|
-
readyTimeoutMs?: number;
|
|
213
|
-
}
|
|
214
237
|
/**
|
|
215
238
|
* Synthetic client wrapper for Claude stages.
|
|
216
239
|
* Auto-starts the Claude CLI in the tmux pane during `start()`.
|
|
@@ -218,13 +241,19 @@ export interface ClaudeQueryDefaults {
|
|
|
218
241
|
export declare class ClaudeClientWrapper {
|
|
219
242
|
readonly paneId: string;
|
|
220
243
|
private readonly opts;
|
|
221
|
-
|
|
222
|
-
constructor(paneId: string, opts: {
|
|
244
|
+
constructor(paneId: string, opts?: {
|
|
223
245
|
chatFlags?: string[];
|
|
224
246
|
readyTimeoutMs?: number;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
|
|
247
|
+
});
|
|
248
|
+
/**
|
|
249
|
+
* Start the Claude CLI in the tmux pane. Returns the Claude session UUID
|
|
250
|
+
* so the caller can pass it to `ClaudeSessionWrapper` (and thus expose it
|
|
251
|
+
* as `s.sessionId` to workflows). This is the UUID used by Claude Code to
|
|
252
|
+
* name its JSONL transcript file and to key the Stop-hook marker — workflows
|
|
253
|
+
* pass it to `s.save(s.sessionId)` so the save path reads the correct
|
|
254
|
+
* transcript even when many Claude sessions run in parallel.
|
|
255
|
+
*/
|
|
256
|
+
start(): Promise<string>;
|
|
228
257
|
/** Noop — cleanup is handled by the runtime via `clearClaudeSession`. */
|
|
229
258
|
stop(): Promise<void>;
|
|
230
259
|
}
|
|
@@ -235,11 +264,18 @@ export declare class ClaudeClientWrapper {
|
|
|
235
264
|
export declare class ClaudeSessionWrapper {
|
|
236
265
|
readonly paneId: string;
|
|
237
266
|
readonly sessionId: string;
|
|
238
|
-
private readonly defaults;
|
|
239
267
|
private readonly onHIL;
|
|
240
|
-
constructor(paneId: string, sessionId: string,
|
|
241
|
-
/**
|
|
242
|
-
|
|
268
|
+
constructor(paneId: string, sessionId: string, onHIL?: (waiting: boolean) => void);
|
|
269
|
+
/**
|
|
270
|
+
* Send a prompt to Claude and wait for the response.
|
|
271
|
+
*
|
|
272
|
+
* The `_options` parameter exists for signature compatibility with
|
|
273
|
+
* {@link HeadlessClaudeSessionWrapper.query} (which forwards SDK options
|
|
274
|
+
* like `agent`, `permissionMode`, etc. to the Agent SDK). In the
|
|
275
|
+
* interactive pane path these options don't apply — we're driving the
|
|
276
|
+
* `claude` CLI binary, not the SDK — so they are silently ignored.
|
|
277
|
+
*/
|
|
278
|
+
query(prompt: string, _options?: Partial<SDKOptions>): Promise<SessionMessage[]>;
|
|
243
279
|
/** Noop — for API symmetry with CopilotSession.disconnect(). */
|
|
244
280
|
disconnect(): Promise<void>;
|
|
245
281
|
}
|
|
@@ -248,7 +284,13 @@ export declare class ClaudeSessionWrapper {
|
|
|
248
284
|
* Used when `options.headless` is true in `ctx.stage()`.
|
|
249
285
|
*/
|
|
250
286
|
export declare class HeadlessClaudeClientWrapper {
|
|
251
|
-
|
|
287
|
+
/**
|
|
288
|
+
* Headless Claude stages don't pre-allocate a session — each `query()` call
|
|
289
|
+
* to {@link HeadlessClaudeSessionWrapper} spawns a fresh Agent SDK run that
|
|
290
|
+
* emits its own `session_id`. We still return an empty string here so the
|
|
291
|
+
* method signature matches {@link ClaudeClientWrapper.start}.
|
|
292
|
+
*/
|
|
293
|
+
start(): Promise<string>;
|
|
252
294
|
stop(): Promise<void>;
|
|
253
295
|
}
|
|
254
296
|
/**
|
|
@@ -264,9 +306,15 @@ export declare class HeadlessClaudeClientWrapper {
|
|
|
264
306
|
*/
|
|
265
307
|
export declare class HeadlessClaudeSessionWrapper {
|
|
266
308
|
readonly paneId = "";
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
309
|
+
/**
|
|
310
|
+
* The Claude session UUID of the most recently completed `query()`. Exposed
|
|
311
|
+
* via `s.sessionId` so workflows can pass it to `s.save(s.sessionId)` and
|
|
312
|
+
* have the save path read the correct transcript, even when several headless
|
|
313
|
+
* Claude stages run in parallel (each call gets its own SDK-assigned UUID).
|
|
314
|
+
*/
|
|
315
|
+
private _lastSessionId;
|
|
316
|
+
get sessionId(): string;
|
|
317
|
+
query(prompt: string | AsyncIterable<SDKUserMessage>, options?: Partial<SDKOptions>): Promise<SessionMessage[]>;
|
|
270
318
|
disconnect(): Promise<void>;
|
|
271
319
|
}
|
|
272
320
|
/**
|
|
@@ -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;
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAexF;AAiID;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAgCzE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAUnE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAC9B,YAAY,EAAE,M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E,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;CAC5D;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,EACvC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAChC,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,EAAE,CACA,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,GAC3C,MAAM,IAAI,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,wBAAwB,EACjC,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAChC,MAAM,IAAI,CA0BZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,wBAAwB,EACjC,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAChC,MAAM,IAAI,CAwBZ;AA+nBD,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAkMrD"}
|
package/dist/sdk/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { SessionPromptResponse } from "@opencode-ai/sdk/v2";
|
|
|
8
8
|
import type { SessionMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
9
9
|
import type { CopilotClient, CopilotClientOptions, CopilotSession, SessionConfig as CopilotSessionConfig } from "@github/copilot-sdk";
|
|
10
10
|
import type { OpencodeClient, Session as OpencodeSession } from "@opencode-ai/sdk/v2";
|
|
11
|
-
import type { ClaudeClientWrapper, ClaudeSessionWrapper
|
|
11
|
+
import type { ClaudeClientWrapper, ClaudeSessionWrapper } from "./providers/claude.ts";
|
|
12
12
|
/** Supported agent types */
|
|
13
13
|
export type AgentType = "copilot" | "opencode" | "claude";
|
|
14
14
|
/**
|
|
@@ -30,7 +30,7 @@ type ClientOptionsMap = {
|
|
|
30
30
|
* Maps each agent to the session create options the user passes to `ctx.stage()`.
|
|
31
31
|
* - OpenCode: `client.session.create()` body params
|
|
32
32
|
* - Copilot: `client.createSession()` config (onPermissionRequest defaults to approveAll)
|
|
33
|
-
* - Claude:
|
|
33
|
+
* - Claude: no per-session options — delivery is driven entirely by Stop hooks.
|
|
34
34
|
*/
|
|
35
35
|
type SessionOptionsMap = {
|
|
36
36
|
opencode: {
|
|
@@ -39,7 +39,7 @@ type SessionOptionsMap = {
|
|
|
39
39
|
workspaceID?: string;
|
|
40
40
|
};
|
|
41
41
|
copilot: Partial<CopilotSessionConfig>;
|
|
42
|
-
claude:
|
|
42
|
+
claude: Record<string, never>;
|
|
43
43
|
};
|
|
44
44
|
/** Maps each agent to the `s.client` type provided in the stage callback. */
|
|
45
45
|
type ClientMap = {
|
|
@@ -61,7 +61,7 @@ export type StageSessionOptions<A extends AgentType> = SessionOptionsMap[A];
|
|
|
61
61
|
export type ProviderClient<A extends AgentType> = ClientMap[A];
|
|
62
62
|
/** The `s.session` type in a stage callback, resolved by agent type. */
|
|
63
63
|
export type ProviderSession<A extends AgentType> = SessionMap[A];
|
|
64
|
-
export type { CopilotClient, CopilotClientOptions, CopilotSession, CopilotSessionConfig, OpencodeClient, OpencodeSession, ClaudeClientWrapper, ClaudeSessionWrapper,
|
|
64
|
+
export type { CopilotClient, CopilotClientOptions, CopilotSession, CopilotSessionConfig, OpencodeClient, OpencodeSession, ClaudeClientWrapper, ClaudeSessionWrapper, };
|
|
65
65
|
/** A source validation warning emitted by provider-specific workflow validators. */
|
|
66
66
|
export interface ValidationWarning {
|
|
67
67
|
rule: string;
|
package/dist/sdk/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sdk/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,aAAa,IAAI,oBAAoB,EACtC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,cAAc,EACd,OAAO,IAAI,eAAe,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sdk/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,aAAa,IAAI,oBAAoB,EACtC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,cAAc,EACd,OAAO,IAAI,eAAe,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAE/B,4BAA4B;AAC5B,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAI1D;;;GAGG;AACH,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,wBAAwB,CAAC,EAAE,MAAM,C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AAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* for spawning agent sessions using native TypeScript control flow.
|
|
7
7
|
*/
|
|
8
8
|
export { defineWorkflow, WorkflowBuilder } from "../define-workflow.ts";
|
|
9
|
-
export type { AgentType, ValidationWarning, Transcript, SavedMessage, SaveTranscript, SessionContext, SessionRef, SessionHandle, SessionRunOptions, WorkflowContext, WorkflowOptions, WorkflowDefinition, WorkflowInput, WorkflowInputType, StageClientOptions, StageSessionOptions, ProviderClient, ProviderSession, CopilotClient, CopilotClientOptions, CopilotSession, CopilotSessionConfig, OpencodeClient, OpencodeSession, ClaudeClientWrapper, ClaudeSessionWrapper,
|
|
9
|
+
export type { AgentType, ValidationWarning, Transcript, SavedMessage, SaveTranscript, SessionContext, SessionRef, SessionHandle, SessionRunOptions, WorkflowContext, WorkflowOptions, WorkflowDefinition, WorkflowInput, WorkflowInputType, StageClientOptions, StageSessionOptions, ProviderClient, ProviderSession, CopilotClient, CopilotClientOptions, CopilotSession, CopilotSessionConfig, OpencodeClient, OpencodeSession, ClaudeClientWrapper, ClaudeSessionWrapper, } from "../types.ts";
|
|
10
10
|
export type { SessionEvent as CopilotSessionEvent } from "@github/copilot-sdk";
|
|
11
11
|
export type { SessionPromptResponse as OpenCodePromptResponse } from "@opencode-ai/sdk/v2";
|
|
12
12
|
export type { SessionMessage as ClaudeSessionMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/workflows/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExE,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sdk/workflows/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExE,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAGrB,YAAY,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,YAAY,EAAE,qBAAqB,IAAI,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC3F,YAAY,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAG7F,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC5I,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAGpE,YAAY,EA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