stitchkit 0.128.0 → 0.130.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/CHANGELOG.md +83 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +87 -19
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +4 -2
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts +56 -0
- package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-map.d.ts +13 -2
- package/dist/agent-executor/acp/v1-map.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-permission.d.ts +44 -0
- package/dist/agent-executor/acp/v1-permission.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts +63 -10
- package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +34 -7
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-turn.d.ts +51 -13
- package/dist/agent-executor/acp/v1-turn.d.ts.map +1 -1
- package/dist/agent-executor/claude/classify.d.ts +10 -0
- package/dist/agent-executor/claude/classify.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +4 -1
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/events.d.ts +146 -0
- package/dist/agent-executor/claude/events.d.ts.map +1 -0
- package/dist/agent-executor/claude/limits.d.ts +7 -1
- package/dist/agent-executor/claude/limits.d.ts.map +1 -1
- package/dist/agent-executor/claude/protocol.d.ts +49 -9
- package/dist/agent-executor/claude/protocol.d.ts.map +1 -1
- package/dist/agent-executor/claude/session.d.ts +2 -0
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude/transcript.d.ts +2 -2
- package/dist/agent-executor/claude/transcript.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/controls.d.ts +28 -0
- package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/driver.d.ts +208 -4
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/probe.d.ts +29 -0
- package/dist/agent-executor/claude-sdk/probe.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/query-loop.d.ts +94 -0
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts +29 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/session.d.ts +5 -5
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/turn-usage.d.ts +81 -0
- package/dist/agent-executor/claude-sdk/turn-usage.d.ts.map +1 -0
- package/dist/agent-executor/codex/classify.d.ts +4 -0
- package/dist/agent-executor/codex/classify.d.ts.map +1 -1
- package/dist/agent-executor/codex/connect.d.ts +46 -0
- package/dist/agent-executor/codex/connect.d.ts.map +1 -0
- package/dist/agent-executor/codex/control-client.d.ts +168 -0
- package/dist/agent-executor/codex/control-client.d.ts.map +1 -0
- package/dist/agent-executor/codex/driver.d.ts +71 -10
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/handlers.d.ts +47 -0
- package/dist/agent-executor/codex/handlers.d.ts.map +1 -0
- package/dist/agent-executor/codex/limits.d.ts +11 -2
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/protocol.d.ts +173 -4
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +101 -0
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -0
- package/dist/agent-executor/codex/session-controls.d.ts +195 -0
- package/dist/agent-executor/codex/session-controls.d.ts.map +1 -0
- package/dist/agent-executor/codex/session.d.ts +55 -37
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-server.d.ts +29 -0
- package/dist/agent-executor/codex/shared-server.d.ts.map +1 -0
- package/dist/agent-executor/codex/shared-thread.d.ts +46 -0
- package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -0
- package/dist/agent-executor/codex/thread-controls.d.ts +128 -0
- package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -0
- package/dist/agent-executor/codex/turn-input.d.ts +30 -0
- package/dist/agent-executor/codex/turn-input.d.ts.map +1 -0
- package/dist/agent-executor/codex/unix-socket-target.d.ts +26 -0
- package/dist/agent-executor/codex/unix-socket-target.d.ts.map +1 -0
- package/dist/agent-executor/codex/unix-socket.d.ts +26 -0
- package/dist/agent-executor/codex/unix-socket.d.ts.map +1 -0
- package/dist/agent-executor/codex/ws-frame.d.ts +15 -0
- package/dist/agent-executor/codex/ws-frame.d.ts.map +1 -0
- package/dist/agent-executor/contract.d.ts +79 -0
- package/dist/agent-executor/contract.d.ts.map +1 -1
- package/dist/agent-executor/engine-process.d.ts +9 -0
- package/dist/agent-executor/engine-process.d.ts.map +1 -1
- package/dist/agent-executor/engine.d.ts +6 -2
- package/dist/agent-executor/engine.d.ts.map +1 -1
- package/dist/agent-executor/executor-contract.d.ts +54 -0
- package/dist/agent-executor/executor-contract.d.ts.map +1 -1
- package/dist/agent-executor/handoff-schemas.d.ts +407 -0
- package/dist/agent-executor/handoff-schemas.d.ts.map +1 -0
- package/dist/agent-executor/handoff.d.ts +12 -0
- package/dist/agent-executor/handoff.d.ts.map +1 -0
- package/dist/agent-executor/hello.d.ts +80 -0
- package/dist/agent-executor/hello.d.ts.map +1 -1
- package/dist/agent-executor/image-input.d.ts +22 -0
- package/dist/agent-executor/image-input.d.ts.map +1 -1
- package/dist/agent-executor/projection.d.ts +2 -2
- package/dist/agent-executor/projection.d.ts.map +1 -1
- package/dist/agent-executor/session-primitives.d.ts +10 -1
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-executor/testing/conformance.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-driver.d.ts +41 -0
- package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-gate.d.ts +11 -0
- package/dist/agent-executor/testing/replay-gate.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-runner.d.ts +27 -0
- package/dist/agent-executor/testing/replay-runner.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-scenarios.d.ts +21 -0
- package/dist/agent-executor/testing/replay-scenarios.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-transcript.d.ts +296 -0
- package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -0
- package/dist/agent-executor/vocabulary.d.ts +135 -0
- package/dist/agent-executor/vocabulary.d.ts.map +1 -1
- package/dist/agent-runtime/branch-observations.d.ts +5 -5
- package/dist/agent-runtime/deferred-tool-selection.d.ts.map +1 -1
- package/dist/agent-runtime/sql-rows.d.ts +10 -10
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/entrypoints/agent-executor/acp.d.ts +4 -1
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +852 -219
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts +5 -1
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/claude-sdk.js +1075 -136
- package/dist/entrypoints/agent-executor/claude.js +48 -23
- package/dist/entrypoints/agent-executor/codex.d.ts +11 -0
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/codex.js +3067 -388
- package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/testing.js +1002 -2
- package/dist/entrypoints/agent-executor.d.ts +4 -2
- package/dist/entrypoints/agent-executor.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor.js +416 -28
- package/dist/entrypoints/agent-runtime/browser.js +1 -1
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness.js +8 -8
- package/dist/entrypoints/agent-runtime/openrouter.js +2 -2
- package/dist/entrypoints/agent-runtime/postgres.js +6 -6
- package/dist/entrypoints/agent-runtime/realtime.js +4 -4
- package/dist/entrypoints/agent-runtime/sandbox.js +5 -5
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
- package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
- package/dist/entrypoints/agent-runtime/testing.js +5 -5
- package/dist/entrypoints/agent-runtime.js +21 -40
- package/dist/entrypoints/application/directory-inbox.js +2 -2
- package/dist/entrypoints/application/opentelemetry.js +2 -2
- package/dist/entrypoints/application.js +2 -2
- package/dist/entrypoints/cli/publish.js +3 -3
- package/dist/entrypoints/cli.js +8 -8
- package/dist/entrypoints/contract.js +2 -2
- package/dist/entrypoints/files/packaging.js +2 -2
- package/dist/entrypoints/files.js +7 -7
- package/dist/entrypoints/handler.js +4 -4
- package/dist/entrypoints/http.js +5 -5
- package/dist/entrypoints/index.js +7 -7
- package/dist/entrypoints/node.js +5 -5
- package/dist/entrypoints/observability.js +4 -4
- package/dist/entrypoints/primitives.js +2 -2
- package/dist/entrypoints/process.js +5 -5
- package/dist/entrypoints/react.js +1 -1
- package/dist/entrypoints/remote.js +2 -2
- package/dist/entrypoints/server.js +6 -6
- package/dist/entrypoints/service-host/macos.js +5 -5
- package/dist/entrypoints/service-host.js +7 -7
- package/dist/entrypoints/spend.js +1 -1
- package/dist/entrypoints/sync/postgres.js +1 -1
- package/dist/entrypoints/sync.js +2 -2
- package/dist/entrypoints/telegram.js +2 -2
- package/dist/entrypoints/testing.js +5 -5
- package/dist/entrypoints/tools/agent.js +5 -5
- package/dist/entrypoints/tools/connections.js +2 -2
- package/dist/entrypoints/tools/invoker.js +4 -4
- package/dist/entrypoints/tools/mcp.d.ts +1 -0
- package/dist/entrypoints/tools/mcp.d.ts.map +1 -1
- package/dist/entrypoints/tools/mcp.js +5 -5
- package/dist/entrypoints/tools/toolkit.js +8 -8
- package/dist/entrypoints/tools.js +12 -12
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/xlsx.js +1 -1
- package/dist/{index-prf6ayhf.js → index-13wmzpa6.js} +1 -1
- package/dist/{index-n7f89hjw.js → index-17qgm6xe.js} +3 -3
- package/dist/{index-wv8dqy7q.js → index-205456mf.js} +1 -1
- package/dist/{index-pwskmywy.js → index-21cfxc4z.js} +1 -1
- package/dist/{index-13dnv6d0.js → index-2s8sy57y.js} +37 -104
- package/dist/{index-d4svrknj.js → index-39c2hj6h.js} +2 -2
- package/dist/{index-sfzfd2m2.js → index-39rmc00v.js} +1 -1
- package/dist/{index-ky3ardqn.js → index-3fym4j8n.js} +1 -1
- package/dist/{index-c5gp2gh6.js → index-5tdc0q43.js} +1 -1
- package/dist/{index-3ypvpkwr.js → index-669374qc.js} +1 -1
- package/dist/{index-5jyjb4s0.js → index-80acsm27.js} +1 -1
- package/dist/{index-xmr47znh.js → index-827bgv33.js} +1 -1
- package/dist/{index-v1mxss62.js → index-93n6jwy0.js} +3 -3
- package/dist/{index-d54npte7.js → index-9kpxz49v.js} +2 -2
- package/dist/{index-xv9jb84s.js → index-9sfhje6y.js} +3 -3
- package/dist/{index-9y0afd5f.js → index-apf5g7y9.js} +1 -1
- package/dist/{index-bh4pmtr9.js → index-dbp6xemn.js} +78 -8
- package/dist/{index-g3e57qj6.js → index-dcsxj68j.js} +2 -2
- package/dist/{index-waa6t4zx.js → index-dnzxxf8a.js} +1 -1
- package/dist/{index-gf92hc87.js → index-fgahdc7s.js} +2 -2
- package/dist/{index-kzavdze2.js → index-gr0kxymw.js} +5 -1
- package/dist/{index-e06z0tkb.js → index-gya4hwh3.js} +2 -2
- package/dist/{index-gzny6zsw.js → index-hab790s6.js} +5 -5
- package/dist/{index-bz3gn6cs.js → index-j0ef04jw.js} +2 -2
- package/dist/{index-rhb33thr.js → index-jcge9tx3.js} +1 -1
- package/dist/{index-4qvyhn23.js → index-jrn3prgm.js} +1 -1
- package/dist/index-kne9g2c5.js +30 -0
- package/dist/{index-pn5b11ce.js → index-mkfhpk11.js} +1 -1
- package/dist/{index-1qwrczr1.js → index-mttkdm5a.js} +1 -1
- package/dist/{index-rxnyygke.js → index-n3bm7zqq.js} +1 -1
- package/dist/{index-6wp4dn9d.js → index-p06z7g7w.js} +3 -3
- package/dist/{index-kt6dh1n6.js → index-p16q492v.js} +1 -1
- package/dist/index-p1qmpq0p.js +1300 -0
- package/dist/{index-t7wa7k12.js → index-pp97q86a.js} +1 -1
- package/dist/{index-39n02e0q.js → index-psye60qn.js} +1 -1
- package/dist/{index-5ptwb6ka.js → index-pzhqydxb.js} +1 -1
- package/dist/{index-7kfcb576.js → index-qa2jjb65.js} +1 -1
- package/dist/{index-rzeezh79.js → index-qhjmmsm2.js} +2 -2
- package/dist/{index-7grgs8cx.js → index-qpzyahe3.js} +2 -2
- package/dist/{index-jfecdk1e.js → index-r97ppg0g.js} +2 -2
- package/dist/{index-bmaz3jzy.js → index-rjs94dny.js} +1 -1
- package/dist/{index-5v5vg85s.js → index-rxh3qy4x.js} +32 -5
- package/dist/{index-en8e5zsj.js → index-ryxb427v.js} +1 -1
- package/dist/{index-y065r8g5.js → index-sd4e5x5j.js} +7 -7
- package/dist/{index-g56ht6qf.js → index-t3qcac2a.js} +1 -1
- package/dist/{index-m18xm96h.js → index-v759mzed.js} +156 -6
- package/dist/{index-4j8efqr3.js → index-x2fb37t0.js} +2 -2
- package/dist/{index-cbhxhma2.js → index-x5ayy5bn.js} +1 -0
- package/dist/index-y0a4gt1s.js +142 -0
- package/dist/{index-wavv538x.js → index-ybdq8kk2.js} +3 -3
- package/dist/{index-4gk6k3zc.js → index-ycr4pk0z.js} +1 -1
- package/dist/{index-0tyt97nk.js → index-yrr3n391.js} +1 -1
- package/dist/{index-v37b2cd6.js → index-z20pdxeb.js} +2 -2
- package/dist/{index-8x22nprv.js → index-z9d74jmb.js} +3 -3
- package/dist/{index-3tnwtz38.js → index-zhshhxew.js} +1 -1
- package/dist/{index-hj1zq7mh.js → index-znd1b57f.js} +3 -3
- package/dist/internal/positive-integer.d.ts +2 -0
- package/dist/internal/positive-integer.d.ts.map +1 -1
- package/dist/internal/unix-socket.d.ts +7 -0
- package/dist/internal/unix-socket.d.ts.map +1 -1
- package/dist/tools/internal/rank-tools.d.ts +10 -0
- package/dist/tools/internal/rank-tools.d.ts.map +1 -0
- package/dist/tools/mcp/handler.d.ts +7 -3
- package/dist/tools/mcp/handler.d.ts.map +1 -1
- package/dist/tools/mcp/lazy-discovery.d.ts +47 -0
- package/dist/tools/mcp/lazy-discovery.d.ts.map +1 -0
- package/dist/tools/mcp/mount.d.ts +7 -0
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts +2 -2
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +7 -8
- package/llms/agent-executor-claude-sdk.txt +15 -10
- package/llms/agent-executor-claude.txt +1 -1
- package/llms/agent-executor-codex.txt +13 -3
- package/llms/agent-executor-testing.txt +5 -1
- package/llms/agent-executor.txt +9 -8
- package/llms/stitchkit.txt +74 -74
- package/llms/tools-mcp.txt +3 -2
- package/llms/tools.txt +24 -0
- package/llms/{upgrading-0.128.0.txt → upgrading-0.128.0-0.130.0.txt} +58 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +206 -107
- package/llms.txt +10 -10
- package/package.json +1 -1
- package/dist/index-0gqs8ght.js +0 -558
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { AgentMessagePart } from '../../agent-parts/parts.js';
|
|
1
2
|
import type { AgentEngineSession } from '../engine.js';
|
|
3
|
+
import type { InteractionReply } from '../executor-contract.js';
|
|
2
4
|
import type { ExecutorProfileConfig } from '../profile.js';
|
|
5
|
+
import type { ExecutorStartupPhase } from '../vocabulary.js';
|
|
3
6
|
import { type AcpDriverConfig } from './v1-connect.js';
|
|
4
7
|
import { type AcpConfigOption } from './v1-protocol.js';
|
|
5
8
|
/**
|
|
@@ -8,7 +11,27 @@ import { type AcpConfigOption } from './v1-protocol.js';
|
|
|
8
11
|
* to ask before running tools and never synthesizes fake requests after `tool_call` updates.
|
|
9
12
|
*/
|
|
10
13
|
export type AcpApprovalEnforcement = 'agent-initiated';
|
|
11
|
-
/**
|
|
14
|
+
/** Input to {@link AcpDriver.open}, extending {@link AgentEngineDriver.open} with per-session overrides. */
|
|
15
|
+
export interface AcpOpenInput {
|
|
16
|
+
readonly profile: ExecutorProfileConfig;
|
|
17
|
+
readonly cwd: string;
|
|
18
|
+
/** Resume or load this native session; a fresh one is started without it. */
|
|
19
|
+
readonly nativeThreadId?: string;
|
|
20
|
+
/** Per-session model override (overrides {@link AcpDriverConfig.model}). */
|
|
21
|
+
readonly model?: string;
|
|
22
|
+
/** Per-session thought level override (overrides {@link AcpDriverConfig.thoughtLevel}). */
|
|
23
|
+
readonly thoughtLevel?: string;
|
|
24
|
+
/** Per-session mode override (overrides {@link AcpDriverConfig.mode}). */
|
|
25
|
+
readonly mode?: string;
|
|
26
|
+
/** Optional observer invoked with startup phases (`spawning`, `initializing`) during open. */
|
|
27
|
+
readonly onStartupPhase?: (phase: ExecutorStartupPhase) => void;
|
|
28
|
+
readonly signal?: AbortSignal;
|
|
29
|
+
}
|
|
30
|
+
/** Input to {@link AcpSession.steerTurn} when `steerMode` is `'prompt'`. */
|
|
31
|
+
export interface AcpSteerTurnInput {
|
|
32
|
+
readonly input: readonly AgentMessagePart[];
|
|
33
|
+
}
|
|
34
|
+
/** A session with what ACP says about it besides turns: its settings, title, commands, steering, and post-settle replies. */
|
|
12
35
|
export interface AcpSession extends AgentEngineSession {
|
|
13
36
|
/** Always `'agent-initiated'`: whether a tool pauses for host approval is decided by the agent. */
|
|
14
37
|
readonly approvalEnforcement: AcpApprovalEnforcement;
|
|
@@ -20,11 +43,15 @@ export interface AcpSession extends AgentEngineSession {
|
|
|
20
43
|
readonly commands: readonly string[];
|
|
21
44
|
/** Change one setting; the agent answers with every option, which may have narrowed. */
|
|
22
45
|
setConfigOption(configId: string, value: string): Promise<readonly AcpConfigOption[]>;
|
|
46
|
+
/** Answer a pending permission request from either the active turn or a post-settle `onPermissionRequest` event. */
|
|
47
|
+
respond(interactionId: string, reply: InteractionReply['reply']): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Steer the currently running turn with an additional `session/prompt` generation when
|
|
50
|
+
* `steerMode` is `'prompt'`. Throws `TypeError` when `steerMode` is `'none'` (default).
|
|
51
|
+
*/
|
|
52
|
+
steerTurn(input: AcpSteerTurnInput): Promise<{
|
|
53
|
+
readonly turnId: string;
|
|
54
|
+
}>;
|
|
23
55
|
}
|
|
24
|
-
export declare function openAcpSession(config: AcpDriverConfig, input:
|
|
25
|
-
profile: ExecutorProfileConfig;
|
|
26
|
-
cwd: string;
|
|
27
|
-
nativeThreadId?: string;
|
|
28
|
-
signal?: AbortSignal;
|
|
29
|
-
}): Promise<AcpSession>;
|
|
56
|
+
export declare function openAcpSession(config: AcpDriverConfig, input: AcpOpenInput): Promise<AcpSession>;
|
|
30
57
|
//# sourceMappingURL=v1-session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1-session.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"v1-session.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAG7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YA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;IACxF,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,eAAe,EAAE,CAAC,CAAC;IACtF,oHAAoH;IACpH,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChF;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3E;AAiFD,wBAAsB,cAAc,CAClC,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,UAAU,CAAC,CAsKrB"}
|
|
@@ -1,25 +1,63 @@
|
|
|
1
|
+
import type { AgentMessagePart } from '../../agent-parts/parts.js';
|
|
1
2
|
import type { AgentEngineTurn } from '../engine.js';
|
|
2
3
|
import { type EngineRequestTurn } from '../engine-requests.js';
|
|
3
4
|
import type { JsonRpcPeer, JsonRpcValue } from '../json-rpc-peer.js';
|
|
4
|
-
import { type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}> {
|
|
5
|
+
import { type ExecutorTokenUsage } from '../vocabulary.js';
|
|
6
|
+
import type { AcpDriverConfig, AcpPromptOutcomeOverride } from './v1-connect.js';
|
|
7
|
+
import { type AcpPromptLimits, type AcpUpdateTrack } from './v1-map.js';
|
|
8
|
+
import { type AcpPermissionDetail } from './v1-permission.js';
|
|
9
|
+
import { type AcpPromptResult } from './v1-protocol.js';
|
|
10
|
+
/** Checker returned by `watchPromptOutcome` before `session/prompt` and consulted after it settles. */
|
|
11
|
+
export type AcpCheckPromptOutcome = (result: AcpPromptResult) => Promise<AcpPromptOutcomeOverride | undefined> | AcpPromptOutcomeOverride | undefined;
|
|
12
|
+
/** One running ACP turn (possibly spanning multiple steered `session/prompt` generations). */
|
|
13
|
+
export interface AcpTurnSlot extends EngineRequestTurn<JsonRpcValue, AcpPermissionDetail> {
|
|
14
14
|
chunk: number;
|
|
15
15
|
track: AcpUpdateTrack;
|
|
16
|
+
/** Monotonic generation of the latest `session/prompt` sent for this turn (1 for initial, 2+ for steers). */
|
|
17
|
+
promptGeneration: number;
|
|
18
|
+
/** Normalized token counters summed across all prompt generations of this turn. */
|
|
19
|
+
accumulatedUsage: ExecutorTokenUsage | undefined;
|
|
20
|
+
/** True once `turn-end` or channel failure has settled this turn. */
|
|
21
|
+
settled: boolean;
|
|
16
22
|
}
|
|
17
23
|
export declare function newAcpTurn(turnId: string): AcpTurnSlot;
|
|
18
24
|
/**
|
|
19
|
-
* Send
|
|
20
|
-
*
|
|
25
|
+
* Send one `session/prompt` generation and settle the turn once the latest generation completes:
|
|
26
|
+
* accumulated usage, optional `watchPromptOutcome` override (`errorKind`, `threadDisposition`),
|
|
27
|
+
* failure by kind, and `turn-end`. Earlier steered prompt generations fold their usage into the
|
|
28
|
+
* turn without closing `turn.channel`.
|
|
21
29
|
*/
|
|
22
|
-
export declare function runAcpPrompt(
|
|
30
|
+
export declare function runAcpPrompt(input: {
|
|
31
|
+
peer: JsonRpcPeer;
|
|
32
|
+
sessionId: string;
|
|
33
|
+
prompt: readonly JsonRpcValue[];
|
|
34
|
+
turn: AcpTurnSlot;
|
|
35
|
+
generation: number;
|
|
36
|
+
usageInputIncludesCachedRead?: boolean;
|
|
37
|
+
checkOutcome?: AcpCheckPromptOutcome;
|
|
38
|
+
done: () => void;
|
|
39
|
+
}): void;
|
|
23
40
|
/** The turn as the executor steers it: interrupt with `session/cancel`, answer permission requests. */
|
|
24
41
|
export declare function acpTurnHandle(peer: JsonRpcPeer, sessionId: string, turn: AcpTurnSlot): AgentEngineTurn;
|
|
42
|
+
/** Build `startTurn` and `steerTurn` for an open ACP session. */
|
|
43
|
+
export declare function createAcpTurnControls(input: {
|
|
44
|
+
config: AcpDriverConfig;
|
|
45
|
+
peer: JsonRpcPeer;
|
|
46
|
+
sessionId: string;
|
|
47
|
+
limits: AcpPromptLimits;
|
|
48
|
+
ensureAlive(): void;
|
|
49
|
+
getTurn(): AcpTurnSlot | undefined;
|
|
50
|
+
setTurn(turn: AcpTurnSlot | undefined): void;
|
|
51
|
+
}): {
|
|
52
|
+
startTurn(turnInput: {
|
|
53
|
+
turnId: string;
|
|
54
|
+
clientId: string;
|
|
55
|
+
input: readonly AgentMessagePart[];
|
|
56
|
+
}): Promise<AgentEngineTurn>;
|
|
57
|
+
steerTurn(steerInput: {
|
|
58
|
+
readonly input: readonly AgentMessagePart[];
|
|
59
|
+
}): Promise<{
|
|
60
|
+
readonly turnId: string;
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
25
63
|
//# sourceMappingURL=v1-turn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1-turn.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-turn.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"v1-turn.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/acp/v1-turn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EAMpB,MAAM,UAAU,CAAC;AAClB,OAAO,EAEL,KAAK,mBAAmB,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,MAAM,EAAE,eAAe,CAAC;IACxB,WAAW,IAAI,IAAI,CAAC;IACpB,OAAO,IAAI,WAAW,GAAG,SAAS,CAAC;IACnC,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,CAAC;CAC9C;IAOS,SAAS,YAAY;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;KACpC,GAAG,OAAO,CAAC,eAAe,CAAC;IAqCtB,SAAS,aAAa;QAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;KAC7C,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;EAgE3C"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { ExecutorDelta } from '../vocabulary.js';
|
|
2
|
+
import { type ClaudeRuntimeEvent } from './events.js';
|
|
2
3
|
/** What one turn has seen so far: which tool each call named, and whether it was asked to stop. */
|
|
3
4
|
export interface ClaudeTurnState {
|
|
4
5
|
readonly turnId: string;
|
|
5
6
|
readonly toolNames: Map<string, string>;
|
|
6
7
|
interruptRequested: boolean;
|
|
8
|
+
compactCount: number;
|
|
9
|
+
primaryModel?: string;
|
|
7
10
|
}
|
|
8
11
|
export declare function newClaudeTurnState(turnId: string): ClaudeTurnState;
|
|
9
12
|
/**
|
|
@@ -21,6 +24,10 @@ export type ClaudeVerdict = {
|
|
|
21
24
|
type: 'request';
|
|
22
25
|
}>;
|
|
23
26
|
input: unknown;
|
|
27
|
+
/** Validated raw tool name when non-empty; `undefined` refuses session-scoped rules. */
|
|
28
|
+
toolName: string | undefined;
|
|
29
|
+
/** When `true`, the engine asked not to persist a session-scoped allow rule. */
|
|
30
|
+
suppressSessionRule: boolean;
|
|
24
31
|
} | {
|
|
25
32
|
kind: 'end';
|
|
26
33
|
deltas: ExecutorDelta[];
|
|
@@ -28,6 +35,9 @@ export type ClaudeVerdict = {
|
|
|
28
35
|
} | {
|
|
29
36
|
kind: 'limits';
|
|
30
37
|
info: Record<string, unknown>;
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'event';
|
|
40
|
+
event: ClaudeRuntimeEvent;
|
|
31
41
|
} | {
|
|
32
42
|
kind: 'session';
|
|
33
43
|
sessionId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/classify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/classify.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAyC,MAAM,eAAe,CAAC;AAC1F,OAAO,EACL,KAAK,kBAAkB,EAGxB,MAAM,UAAU,CAAC;AAwBlB,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAElE;AAED;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,aAAa,EAAE,CAAA;CAAE,GAC3C;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACnD,KAAK,EAAE,OAAO,CAAC;IACf,wFAAwF;IACxF,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,gFAAgF;IAChF,mBAAmB,EAAE,OAAO,CAAC;CAC9B,GACD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,aAAa,EAAE,CAAC;IAAC,OAAO,EAAE,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAA;CAAE,GACzF;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,kBAAkB,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClC,sBAAsB,CAAC;AAE3B;;;;GAIG;AACH,UAAU,sBAAsB;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACjD;AA4JD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,GAAG,aAAa,CAuL1F"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentEngineDriver } from '../engine.js';
|
|
2
|
+
import type { ExecutorDriverCapabilities } from '../hello.js';
|
|
2
3
|
/** Configuration for {@link createClaudeCliDriver}. */
|
|
3
4
|
export interface ClaudeCliDriverConfig {
|
|
4
5
|
/** The CLI to run. Default `claude`, found on the engine's `PATH`. */
|
|
@@ -27,5 +28,7 @@ export interface ClaudeCliDriverConfig {
|
|
|
27
28
|
* with a control request, and learns whether an input arrived from the
|
|
28
29
|
* session's transcript in the profile.
|
|
29
30
|
*/
|
|
30
|
-
export declare function createClaudeCliDriver(config?: ClaudeCliDriverConfig): AgentEngineDriver
|
|
31
|
+
export declare function createClaudeCliDriver(config?: ClaudeCliDriverConfig): AgentEngineDriver & {
|
|
32
|
+
readonly capabilities: ExecutorDriverCapabilities;
|
|
33
|
+
};
|
|
31
34
|
//# sourceMappingURL=cli-driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-driver.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/cli-driver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"cli-driver.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/cli-driver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAc,MAAM,UAAU,CAAC;AAoCvE,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,cAAc,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,MAAM,GAAG,mBAAmB,GAAG,MAAM,CAAC;IACnF,4FAA4F;IAC5F,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IACzD,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CACxD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,GAAE,qBAA0B,GACjC,iBAAiB,GAAG;IAAE,QAAQ,CAAC,YAAY,EAAE,0BAA0B,CAAA;CAAE,CA4G3E"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Token, tool-use and duration counters reported on Claude task progress/notification events. */
|
|
3
|
+
export declare const ClaudeTaskUsageSchema: z.ZodObject<{
|
|
4
|
+
totalTokens: z.ZodInt;
|
|
5
|
+
toolUses: z.ZodInt;
|
|
6
|
+
durationMs: z.ZodNumber;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
/** Inferred from {@link ClaudeTaskUsageSchema}. */
|
|
9
|
+
export type ClaudeTaskUsage = z.infer<typeof ClaudeTaskUsageSchema>;
|
|
10
|
+
/**
|
|
11
|
+
* Typed non-delta runtime events emitted by Claude Code and the Claude Agent SDK
|
|
12
|
+
* (`task_*`, `background_tasks_changed`, `api_retry`, `elicitation_complete`, `tool_progress`).
|
|
13
|
+
* Delivered out-of-band via `onEvent` so high-frequency progress and post-turn background
|
|
14
|
+
* notifications never flood `TurnReport.deltas` (512-delta cap).
|
|
15
|
+
*/
|
|
16
|
+
export declare const ClaudeRuntimeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
18
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
19
|
+
type: z.ZodLiteral<"task_started">;
|
|
20
|
+
taskId: z.ZodString;
|
|
21
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
toolUseId: z.ZodOptional<z.ZodString>;
|
|
23
|
+
description: z.ZodString;
|
|
24
|
+
subagentType: z.ZodOptional<z.ZodString>;
|
|
25
|
+
isBackgrounded: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
spawnDepth: z.ZodOptional<z.ZodInt>;
|
|
27
|
+
parentTaskId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
taskType: z.ZodOptional<z.ZodString>;
|
|
29
|
+
workflowName: z.ZodOptional<z.ZodString>;
|
|
30
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
31
|
+
skipTranscript: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
ambient: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
34
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
35
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
36
|
+
type: z.ZodLiteral<"task_updated">;
|
|
37
|
+
taskId: z.ZodString;
|
|
38
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
patch: z.ZodObject<{
|
|
40
|
+
status: z.ZodOptional<z.ZodString>;
|
|
41
|
+
description: z.ZodOptional<z.ZodString>;
|
|
42
|
+
endTime: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
totalPausedMs: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
error: z.ZodOptional<z.ZodString>;
|
|
45
|
+
isBackgrounded: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
48
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
49
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
50
|
+
type: z.ZodLiteral<"task_progress">;
|
|
51
|
+
taskId: z.ZodString;
|
|
52
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
53
|
+
toolUseId: z.ZodOptional<z.ZodString>;
|
|
54
|
+
description: z.ZodString;
|
|
55
|
+
subagentType: z.ZodOptional<z.ZodString>;
|
|
56
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
totalTokens: z.ZodInt;
|
|
58
|
+
toolUses: z.ZodInt;
|
|
59
|
+
durationMs: z.ZodNumber;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
lastToolName: z.ZodOptional<z.ZodString>;
|
|
62
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
64
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
65
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
66
|
+
type: z.ZodLiteral<"task_notification">;
|
|
67
|
+
taskId: z.ZodString;
|
|
68
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
69
|
+
toolUseId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
status: z.ZodString;
|
|
71
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
72
|
+
outputFile: z.ZodOptional<z.ZodString>;
|
|
73
|
+
summary: z.ZodString;
|
|
74
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
totalTokens: z.ZodInt;
|
|
76
|
+
toolUses: z.ZodInt;
|
|
77
|
+
durationMs: z.ZodNumber;
|
|
78
|
+
}, z.core.$strict>>;
|
|
79
|
+
skipTranscript: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
ambient: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
82
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
83
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
84
|
+
type: z.ZodLiteral<"background_tasks_changed">;
|
|
85
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
86
|
+
taskId: z.ZodString;
|
|
87
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
88
|
+
taskType: z.ZodString;
|
|
89
|
+
subagentType: z.ZodOptional<z.ZodString>;
|
|
90
|
+
description: z.ZodString;
|
|
91
|
+
parentTaskId: z.ZodOptional<z.ZodString>;
|
|
92
|
+
ambient: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
}, z.core.$strict>>;
|
|
94
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
95
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
96
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
97
|
+
type: z.ZodLiteral<"api_retry">;
|
|
98
|
+
attempt: z.ZodInt;
|
|
99
|
+
maxRetries: z.ZodInt;
|
|
100
|
+
retryDelayMs: z.ZodNumber;
|
|
101
|
+
errorStatus: z.ZodNullable<z.ZodInt>;
|
|
102
|
+
error: z.ZodString;
|
|
103
|
+
noResponse: z.ZodOptional<z.ZodObject<{
|
|
104
|
+
waitedMs: z.ZodNumber;
|
|
105
|
+
retryWaitMs: z.ZodNumber;
|
|
106
|
+
}, z.core.$strict>>;
|
|
107
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
108
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
109
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
110
|
+
type: z.ZodLiteral<"elicitation_complete">;
|
|
111
|
+
mcpServerName: z.ZodString;
|
|
112
|
+
elicitationId: z.ZodString;
|
|
113
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
114
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
115
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
116
|
+
type: z.ZodLiteral<"tool_progress">;
|
|
117
|
+
toolUseId: z.ZodString;
|
|
118
|
+
toolName: z.ZodString;
|
|
119
|
+
parentToolUseId: z.ZodNullable<z.ZodString>;
|
|
120
|
+
elapsedTimeSeconds: z.ZodNumber;
|
|
121
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
122
|
+
heartbeat: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
subagentType: z.ZodOptional<z.ZodString>;
|
|
124
|
+
subagentRetry: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
agentId: z.ZodString;
|
|
126
|
+
attempt: z.ZodInt;
|
|
127
|
+
maxRetries: z.ZodInt;
|
|
128
|
+
retryDelayMs: z.ZodNumber;
|
|
129
|
+
errorStatus: z.ZodNullable<z.ZodInt>;
|
|
130
|
+
errorCategory: z.ZodString;
|
|
131
|
+
}, z.core.$strict>>;
|
|
132
|
+
}, z.core.$strict>], "type">;
|
|
133
|
+
/** Typed non-delta runtime event inferred from {@link ClaudeRuntimeEventSchema}. */
|
|
134
|
+
export type ClaudeRuntimeEvent = z.infer<typeof ClaudeRuntimeEventSchema>;
|
|
135
|
+
/** Whether a Claude `system` record subtype maps to a {@link ClaudeRuntimeEvent}. */
|
|
136
|
+
export declare function isClaudeRuntimeSystemSubtype(subtype: string): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Parse a validated Claude `system` (task/retry/elicitation) or top-level `tool_progress`
|
|
139
|
+
* wire record into a normalized {@link ClaudeRuntimeEvent}. Returns `undefined` when required
|
|
140
|
+
* fields are missing or malformed so the classifier can surface `unhandled` fail-closed.
|
|
141
|
+
*/
|
|
142
|
+
export declare function parseClaudeRuntimeEvent(record: {
|
|
143
|
+
readonly type: string;
|
|
144
|
+
readonly subtype?: string;
|
|
145
|
+
}): ClaudeRuntimeEvent | undefined;
|
|
146
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,kGAAkG;AAClG,eAAO,MAAM,qBAAqB;;;;kBAIhC,CAAC;AAEH,mDAAmD;AACnD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAyCpE;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAsFnC,CAAC;AAEH,oFAAoF;AACpF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AA6J1E,qFAAqF;AACrF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErE;AAkJD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,kBAAkB,GAAG,SAAS,CA6BjC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { type PlanWindow } from '../hello.js';
|
|
1
|
+
import { type PlanLimits, type PlanWindow } from '../hello.js';
|
|
2
|
+
/**
|
|
3
|
+
* Normalize an active Claude SDK `get_usage` response (`SDKControlGetUsageResponse`) into
|
|
4
|
+
* {@link PlanLimits}. Unlike passive `rate_limit_event` (0–1 fraction + epoch seconds),
|
|
5
|
+
* `get_usage` reports utilization in percent (0–100, nullable) and ISO-8601 `resets_at`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function claudeUsagePlanLimits(raw: unknown, now: Date): PlanLimits;
|
|
2
8
|
/**
|
|
3
9
|
* Claude's `rate_limit_event` as windows: `unifiedWindows` when present
|
|
4
10
|
* (`five_hour`, `seven_day`), else the one window it names. Utilization is a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/limits.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/limits.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,UAAU,EAEhB,MAAM,UAAU,CAAC;AAkDlB;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,GAAG,UAAU,CAuEzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,EAAE,CAwB7D"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { type InteractionReply } from '../executor-contract.js';
|
|
2
3
|
import { type InlinedPart, type SupportedImageMediaType } from '../image-input.js';
|
|
4
|
+
type JsonValue = z.infer<ReturnType<typeof z.json>>;
|
|
3
5
|
export declare const ClaudeContentBlockSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
4
6
|
type: z.ZodLiteral<"text">;
|
|
5
7
|
text: z.ZodString;
|
|
@@ -24,6 +26,7 @@ export declare const ClaudeRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
24
26
|
subtype: z.ZodString;
|
|
25
27
|
session_id: z.ZodOptional<z.ZodString>;
|
|
26
28
|
model: z.ZodOptional<z.ZodString>;
|
|
29
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
27
30
|
}, z.core.$loose>, z.ZodObject<{
|
|
28
31
|
type: z.ZodLiteral<"user">;
|
|
29
32
|
uuid: z.ZodOptional<z.ZodString>;
|
|
@@ -51,8 +54,10 @@ export declare const ClaudeRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
51
54
|
}, z.core.$loose>;
|
|
52
55
|
}, z.core.$loose>, z.ZodObject<{
|
|
53
56
|
type: z.ZodLiteral<"assistant">;
|
|
57
|
+
parent_tool_use_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
54
58
|
message: z.ZodObject<{
|
|
55
59
|
id: z.ZodString;
|
|
60
|
+
model: z.ZodOptional<z.ZodString>;
|
|
56
61
|
content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
57
62
|
type: z.ZodLiteral<"text">;
|
|
58
63
|
text: z.ZodString;
|
|
@@ -101,11 +106,16 @@ export declare const ClaudeRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
101
106
|
api_error_status: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodInt, z.ZodString]>>>;
|
|
102
107
|
result: z.ZodOptional<z.ZodString>;
|
|
103
108
|
total_cost_usd: z.ZodOptional<z.ZodNumber>;
|
|
104
|
-
usage: z.ZodOptional<z.ZodObject<{
|
|
105
|
-
input_tokens: z.ZodOptional<z.ZodInt
|
|
106
|
-
output_tokens: z.ZodOptional<z.ZodInt
|
|
107
|
-
cache_read_input_tokens: z.ZodOptional<z.ZodInt
|
|
108
|
-
|
|
109
|
+
usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
110
|
+
input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
111
|
+
output_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
112
|
+
cache_read_input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
113
|
+
cache_creation_input_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
114
|
+
output_tokens_details: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
115
|
+
thinking_tokens: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
116
|
+
}, z.core.$loose>>>;
|
|
117
|
+
}, z.core.$loose>>>;
|
|
118
|
+
modelUsage: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
109
119
|
}, z.core.$loose>, z.ZodObject<{
|
|
110
120
|
type: z.ZodLiteral<"rate_limit_event">;
|
|
111
121
|
rate_limit_info: z.ZodObject<{}, z.core.$loose>;
|
|
@@ -117,6 +127,7 @@ export declare const ClaudeRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
117
127
|
tool_name: z.ZodOptional<z.ZodString>;
|
|
118
128
|
input: z.ZodOptional<z.ZodJSONSchema>;
|
|
119
129
|
tool_use_id: z.ZodOptional<z.ZodString>;
|
|
130
|
+
suppress_always_allow_rule: z.ZodOptional<z.ZodBoolean>;
|
|
120
131
|
}, z.core.$loose>;
|
|
121
132
|
}, z.core.$loose>, z.ZodObject<{
|
|
122
133
|
type: z.ZodLiteral<"control_response">;
|
|
@@ -128,6 +139,8 @@ export declare const ClaudeRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
128
139
|
type: z.ZodLiteral<"command_lifecycle">;
|
|
129
140
|
command_uuid: z.ZodOptional<z.ZodString>;
|
|
130
141
|
state: z.ZodString;
|
|
142
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
143
|
+
type: z.ZodLiteral<"tool_progress">;
|
|
131
144
|
}, z.core.$loose>], "type">;
|
|
132
145
|
export type ClaudeRecord = z.infer<typeof ClaudeRecordSchema>;
|
|
133
146
|
/** A record whose `type` this driver does not know: carried as `unhandled`, never dropped. */
|
|
@@ -166,14 +179,38 @@ export declare function claudeUserMessage(input: {
|
|
|
166
179
|
parent_tool_use_id: null;
|
|
167
180
|
session_id: string;
|
|
168
181
|
};
|
|
169
|
-
/**
|
|
170
|
-
export
|
|
182
|
+
/** Session-scoped allow rule attached to a Claude `can_use_tool` allow response. */
|
|
183
|
+
export interface ClaudeSessionAllowRule {
|
|
184
|
+
readonly type: 'addRules';
|
|
185
|
+
readonly rules: readonly {
|
|
186
|
+
readonly toolName: string;
|
|
187
|
+
}[];
|
|
188
|
+
readonly behavior: 'allow';
|
|
189
|
+
readonly destination: 'session';
|
|
190
|
+
}
|
|
191
|
+
/** Metadata kept with one held Claude permission request (CLI `control_request` or SDK `canUseTool`). */
|
|
192
|
+
export interface ClaudePendingPermissionDetail<TInput = unknown> {
|
|
193
|
+
readonly input: TInput;
|
|
194
|
+
readonly toolName: string | undefined;
|
|
195
|
+
readonly suppressSessionRule: boolean;
|
|
196
|
+
}
|
|
197
|
+
/** Normalized decision produced from a host `InteractionReply` for a pending Claude permission request. */
|
|
198
|
+
export type ClaudePermissionDecision<TInput = unknown> = {
|
|
171
199
|
behavior: 'allow';
|
|
172
|
-
input:
|
|
200
|
+
input: TInput | Record<string, JsonValue>;
|
|
201
|
+
updatedPermissions?: readonly ClaudeSessionAllowRule[];
|
|
173
202
|
} | {
|
|
174
203
|
behavior: 'deny';
|
|
175
204
|
message: string;
|
|
176
|
-
|
|
205
|
+
interrupt?: boolean;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Validate a host `InteractionReply` against a held Claude permission request without mutating
|
|
209
|
+
* pending state on refusal. Shared by both Claude CLI and Claude SDK drivers.
|
|
210
|
+
*/
|
|
211
|
+
export declare function resolveClaudePermissionReply<TInput>(detail: ClaudePendingPermissionDetail<TInput>, rawReply: InteractionReply['reply']): ClaudePermissionDecision<TInput>;
|
|
212
|
+
/** An answer to `can_use_tool`, in the dialect's own form: `deny` always carries a message. */
|
|
213
|
+
export declare function claudePermissionResponse(requestId: string, decision: ClaudePermissionDecision): {
|
|
177
214
|
type: string;
|
|
178
215
|
response: {
|
|
179
216
|
subtype: string;
|
|
@@ -181,9 +218,11 @@ export declare function claudePermissionResponse(requestId: string, decision: {
|
|
|
181
218
|
response: {
|
|
182
219
|
behavior: string;
|
|
183
220
|
updatedInput: unknown;
|
|
221
|
+
updatedPermissions?: readonly ClaudeSessionAllowRule[] | undefined;
|
|
184
222
|
} | {
|
|
185
223
|
behavior: string;
|
|
186
224
|
message: string;
|
|
225
|
+
interrupt?: boolean | undefined;
|
|
187
226
|
};
|
|
188
227
|
};
|
|
189
228
|
};
|
|
@@ -203,4 +242,5 @@ export declare function claudeInterrupt(requestId: string): {
|
|
|
203
242
|
subtype: string;
|
|
204
243
|
};
|
|
205
244
|
};
|
|
245
|
+
export {};
|
|
206
246
|
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,uBAAuB,EAC7B,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK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CACtC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,wBAAwB;IAGhC,IAAI;IACJ,QAAQ;QACN,OAAO;QACP,UAAU;QACV,QAAQ;;;;;;;;;;EAgBb;AAED,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;;;;;;;EAKlE;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM;IACtC,IAAI;IAAqB,UAAU;IAAa,OAAO;QAAI,OAAO;;EAC5E"}
|
|
@@ -2,6 +2,7 @@ import type { AgentEngineSession } from '../engine.js';
|
|
|
2
2
|
import type { PlanLimits } from '../hello.js';
|
|
3
3
|
import { type DriverImageOptions } from '../image-input.js';
|
|
4
4
|
import { type ExecutorProfileConfig } from '../profile.js';
|
|
5
|
+
import type { ExecutorStartupPhase } from '../vocabulary.js';
|
|
5
6
|
/**
|
|
6
7
|
* One Claude Code process for one connection: spawned with the session's
|
|
7
8
|
* flags, read by one loop for its whole life, each turn's records routed to
|
|
@@ -18,6 +19,7 @@ export declare function openClaudeSession(config: DriverImageOptions & {
|
|
|
18
19
|
profile: ExecutorProfileConfig;
|
|
19
20
|
cwd: string;
|
|
20
21
|
nativeThreadId?: string;
|
|
22
|
+
onStartupPhase?: (phase: ExecutorStartupPhase) => void;
|
|
21
23
|
signal?: AbortSignal;
|
|
22
24
|
}): Promise<AgentEngineSession>;
|
|
23
25
|
//# sourceMappingURL=session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAmB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAmB,MAAM,WAAW,CAAC;AAUrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,qBAAqB,EAAoC,MAAM,YAAY,CAAC;AAQ1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAwD1D;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,kBAAkB,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACtD,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACjC,EACD,KAAK,EAAE;IACL,OAAO,EAAE,qBAAqB,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACvD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GACA,OAAO,CAAC,kBAAkB,CAAC,CAgL7B"}
|
|
@@ -2,8 +2,8 @@ import type { ExecutorEngine } from '../hello.js';
|
|
|
2
2
|
import { type ExecutorProfileConfig } from '../profile.js';
|
|
3
3
|
/**
|
|
4
4
|
* Where Claude Code keeps a session's transcript in a profile:
|
|
5
|
-
* `<home>/projects/<cwd with every character but letters,
|
|
6
|
-
* replaced by "-">/<sessionId>.jsonl`, as observed on the CLI.
|
|
5
|
+
* `<home>/projects/<canonical realpath(cwd) with every character but letters,
|
|
6
|
+
* digits and "-" replaced by "-">/<sessionId>.jsonl`, as observed on the CLI.
|
|
7
7
|
*/
|
|
8
8
|
export declare function claudeTranscriptPath(input: {
|
|
9
9
|
home: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/transcript.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude/transcript.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,KAAK,qBAAqB,EAAiB,MAAM,YAAY,CAAC;AAsCvE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,MAAM,CAWT;AA+BD;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA6E1F;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAU3E;AAED,8FAA8F;AAC9F,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,OAAO,CAAC,cAAc,EAAE,YAAY,GAAG,YAAY,CAAC,EAC5D,KAAK,EAAE;IACL,OAAO,EAAE,qBAAqB,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB,GACA,OAAO,CAAC,OAAO,CAAC,CAUlB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Options, Query } from '@anthropic-ai/claude-agent-sdk';
|
|
2
|
+
import { type PlanLimits } from '../hello.js';
|
|
3
|
+
import type { ClaudeSdkRun, ClaudeSdkSession, ClaudeSdkUsageRead } from './driver.js';
|
|
4
|
+
export type ClaudeSdkFlagSettings = Parameters<Query['applyFlagSettings']>[0];
|
|
5
|
+
type LiveMethods = Omit<ClaudeSdkSession, 'nativeThreadId' | 'providerPid' | 'startTurn' | 'close'>;
|
|
6
|
+
/** Session state needed by live-control operations on an active Claude SDK query. */
|
|
7
|
+
export interface ClaudeSdkControlHost {
|
|
8
|
+
readonly signal: AbortSignal;
|
|
9
|
+
isClosed(): boolean;
|
|
10
|
+
ensureQuery(): Promise<{
|
|
11
|
+
readonly query: ClaudeSdkRun;
|
|
12
|
+
}>;
|
|
13
|
+
setActiveModel(model: string | undefined): void;
|
|
14
|
+
setActivePermissionMode(mode: NonNullable<Options['permissionMode']>): void;
|
|
15
|
+
recordFlagSettings(settings: ClaudeSdkFlagSettings): void;
|
|
16
|
+
recordPlanLimits(limits: PlanLimits): void;
|
|
17
|
+
recordPlanLimitsFailure(error: unknown): void;
|
|
18
|
+
}
|
|
19
|
+
/** Build a `ClaudeSdkUsageRead` for an SDK build without the experimental usage endpoint. */
|
|
20
|
+
export declare function unpublishedClaudeSdkUsageRead(now?: Date): ClaudeSdkUsageRead;
|
|
21
|
+
/** Normalize a raw Claude SDK usage payload into a {@link ClaudeSdkUsageRead} and optionally cache known/no-plan limits. */
|
|
22
|
+
export declare function normalizeClaudeSdkUsageRead(raw: Extract<ClaudeSdkUsageRead, {
|
|
23
|
+
readonly supported: true;
|
|
24
|
+
}>['raw'], recordPlanLimits?: (limits: PlanLimits) => void, now?: Date): ClaudeSdkUsageRead;
|
|
25
|
+
/** Create the live-session control and inspection methods exposed on {@link ClaudeSdkSession}. */
|
|
26
|
+
export declare function createClaudeSdkControls(host: ClaudeSdkControlHost): LiveMethods;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../../src/agent-executor/claude-sdk/controls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA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