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
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
CommandStopped,
|
|
6
6
|
startNativeCommand
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-qa2jjb65.js";
|
|
8
8
|
import {
|
|
9
9
|
ScanStopped,
|
|
10
10
|
ContainedScanBudget,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./index-rj32hkkp.js";
|
|
14
14
|
import {
|
|
15
15
|
writeContainedFile
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-rjs94dny.js";
|
|
17
17
|
import {
|
|
18
18
|
openPinnedDirectory,
|
|
19
19
|
openContainedDirectory,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
} from "./index-9pv126eh.js";
|
|
43
43
|
import {
|
|
44
44
|
assertPositiveSafeInteger
|
|
45
|
-
} from "./index-
|
|
45
|
+
} from "./index-gr0kxymw.js";
|
|
46
46
|
import {
|
|
47
47
|
withSignalDeadline
|
|
48
48
|
} from "./index-agy5fqgf.js";
|
|
@@ -66,10 +66,10 @@ import {
|
|
|
66
66
|
readBoundedChunks,
|
|
67
67
|
concatChunks,
|
|
68
68
|
readBoundedText
|
|
69
|
-
} from "./index-
|
|
69
|
+
} from "./index-827bgv33.js";
|
|
70
70
|
import {
|
|
71
71
|
assertPositiveSafeInteger
|
|
72
|
-
} from "./index-
|
|
72
|
+
} from "./index-gr0kxymw.js";
|
|
73
73
|
import {
|
|
74
74
|
isRecord,
|
|
75
75
|
isAsyncIterable
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
assertUnixSocketPathLength,
|
|
12
12
|
assertExpectedOwnerUid,
|
|
13
13
|
assertUnixSocketClientTarget
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-hab790s6.js";
|
|
15
15
|
import {
|
|
16
16
|
DEFAULT_PROCESS_SIGNALS,
|
|
17
17
|
defaultSignalSource,
|
|
@@ -44,10 +44,10 @@ import {
|
|
|
44
44
|
import {
|
|
45
45
|
readBoundedBody2,
|
|
46
46
|
readBoundedText
|
|
47
|
-
} from "./index-
|
|
47
|
+
} from "./index-827bgv33.js";
|
|
48
48
|
import {
|
|
49
49
|
assertPositiveSafeInteger
|
|
50
|
-
} from "./index-
|
|
50
|
+
} from "./index-gr0kxymw.js";
|
|
51
51
|
import {
|
|
52
52
|
isRecord,
|
|
53
53
|
transportResult
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
toolResultFromError,
|
|
8
8
|
toolCauseFromResult,
|
|
9
9
|
isToolExecutionControlError2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-n3bm7zqq.js";
|
|
11
11
|
import {
|
|
12
12
|
createToolRunner,
|
|
13
13
|
formatToolError
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-fgahdc7s.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveRuntimeToolCall
|
|
17
17
|
} from "./index-eh71zr32.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./index-1psbyyhj.js";
|
|
21
21
|
import {
|
|
22
22
|
collectToolSurface
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-x2fb37t0.js";
|
|
24
24
|
import {
|
|
25
25
|
agentPresenterOf
|
|
26
26
|
} from "./index-7csn6pva.js";
|
|
@@ -9,6 +9,8 @@ type ErrorType = new (message: string) => Error;
|
|
|
9
9
|
interface IntegerOptions {
|
|
10
10
|
readonly absent?: 'passes' | 'refused';
|
|
11
11
|
}
|
|
12
|
+
/** Return whether `value` is a positive safe integer (`>= 1`). */
|
|
13
|
+
export declare function isPositiveSafeInteger(value: unknown): value is number;
|
|
12
14
|
/** Refuse a limit that is not a positive safe integer. */
|
|
13
15
|
export declare function assertPositiveSafeInteger(name: string, value: number | undefined, errorType?: ErrorType, options?: IntegerOptions): void;
|
|
14
16
|
/** Refuse a count or a position that is not a non-negative safe integer. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positive-integer.d.ts","sourceRoot":"","sources":["../../src/internal/positive-integer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK,SAAS,GAAG,KAAK,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC;AAEhD,UAAU,cAAc;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CACxC;AAeD,0DAA0D;AAC1D,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,GAAE,SAAqB,EAChC,OAAO,GAAE,cAAmB,GAC3B,IAAI,CAEN;AAED,4EAA4E;AAC5E,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,GAAE,SAAqB,EAChC,OAAO,GAAE,cAAmB,GAC3B,IAAI,CASN"}
|
|
1
|
+
{"version":3,"file":"positive-integer.d.ts","sourceRoot":"","sources":["../../src/internal/positive-integer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,KAAK,SAAS,GAAG,KAAK,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC;AAEhD,UAAU,cAAc;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CACxC;AAeD,kEAAkE;AAClE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAGrE;AAED,0DAA0D;AAC1D,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,GAAE,SAAqB,EAChC,OAAO,GAAE,cAAmB,GAC3B,IAAI,CAEN;AAED,4EAA4E;AAC5E,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,GAAE,SAAqB,EAChC,OAAO,GAAE,cAAmB,GAC3B,IAAI,CASN"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FileStatsView } from './file-observation.js';
|
|
1
2
|
/** Where a unix socket is bound and the exact permission bits it is born with. */
|
|
2
3
|
export interface UnixSocketBinding {
|
|
3
4
|
readonly path: string;
|
|
@@ -33,6 +34,12 @@ export declare function unlinkUnixSocketIfOwned(owned: OwnedUnixSocket): boolean
|
|
|
33
34
|
export declare function assertUnixSocketPathLength(socketPath: string, caller: string): void;
|
|
34
35
|
/** Validate an explicit expected Unix owner UID (`0`..`4294967295`). */
|
|
35
36
|
export declare function assertExpectedOwnerUid(uid: number | undefined, caller: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Inspect `dir`'s `lstat` result against private Unix socket directory rules (real non-symlink
|
|
39
|
+
* directory owned by `expectedUid ?? process.getuid()` and not writable by group or others).
|
|
40
|
+
* Returns a human-readable violation string, or `undefined` when compliant.
|
|
41
|
+
*/
|
|
42
|
+
export declare function unixSocketDirectoryViolation(dir: string, stats: Pick<FileStatsView, 'mode' | 'uid' | 'isDirectory' | 'isSymbolicLink'>, caller: string, expectedUid?: number): string | undefined;
|
|
36
43
|
/**
|
|
37
44
|
* Verify that `dirname(socketPath)` exists, is a real directory (not a symlink), is owned by
|
|
38
45
|
* the current user, and is not writable by group or others.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unix-socket.d.ts","sourceRoot":"","sources":["../../src/internal/unix-socket.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unix-socket.d.ts","sourceRoot":"","sources":["../../src/internal/unix-socket.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAMxD,kFAAkF;AAClF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4FAA4F;IAC5F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,uFAAuF;AACvF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,+EAA+E;AAC/E,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;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C,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,CAAC,EAChC,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,GACxB;IAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAA;CAAE,CAyCzD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,CAqCzF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rank tool catalog entries against a search query: whole phrase first (exact name → prefix →
|
|
3
|
+
* token-prefix → name substring → description substring), then deduplicated multi-word hits as
|
|
4
|
+
* a deterministic fallback preserving manifest order on ties.
|
|
5
|
+
*/
|
|
6
|
+
export declare function rankToolsByQuery<T extends {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly description: string;
|
|
9
|
+
}>(query: string, entries: readonly T[]): T[];
|
|
10
|
+
//# sourceMappingURL=rank-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rank-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/internal/rank-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,SAAS;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,EACjE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAG3C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ProtectedResourceConfig } from '../../server/oauth/metadata.js';
|
|
2
2
|
import type { RawRoute } from '../../server/types.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type DirectMcpSurfaceConfig, type FiniteMcpSurfaceConfig, type McpServerSharedConfig } from './mount.js';
|
|
4
4
|
import { type McpSurfaceRegistry } from './prepare.js';
|
|
5
5
|
/** Compatibility posture for protocol revisions predating 2026-07-28. */
|
|
6
6
|
export type McpLegacyPolicy = 'serve' | 'reject';
|
|
@@ -31,9 +31,13 @@ export interface McpHttpConfig<TAuth> {
|
|
|
31
31
|
}) => void | Promise<void>;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Full config for `createMcpHandler`: the shared surface config
|
|
34
|
+
* Full config for `createMcpHandler`: the shared surface config (excluding stateful lazy
|
|
35
|
+
* `discovery`) plus the HTTP auth settings.
|
|
35
36
|
*/
|
|
36
|
-
export type McpHandlerConfig<TAuth, TSurfaces extends McpSurfaceRegistry = McpSurfaceRegistry> =
|
|
37
|
+
export type McpHandlerConfig<TAuth, TSurfaces extends McpSurfaceRegistry = McpSurfaceRegistry> = Omit<McpServerSharedConfig<TAuth>, 'discovery'> & {
|
|
38
|
+
/** Lazy tool discovery requires a stateful MCP session and is refused on stateless HTTP handlers. */
|
|
39
|
+
readonly discovery?: never;
|
|
40
|
+
} & (DirectMcpSurfaceConfig<TAuth> | FiniteMcpSurfaceConfig<TAuth, TSurfaces>) & McpHttpConfig<TAuth>;
|
|
37
41
|
/** Framework-owned Fetch face for one stateless dual-era MCP endpoint. */
|
|
38
42
|
export interface McpHttpHandler {
|
|
39
43
|
fetch(request: Request): Promise<Response>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/handler.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAOnD,OAAO,EAGL,KAAK,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":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CAAC,GAAG;IACpD,qGAAqG;IACrG,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC;CAC5B,GAAG,CAAC,sBAAsB,CAAC,KAAK,CAAC,GAAG,sBAAsB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,GAC5E,aAAa,CAAC,KAAK,CAAC,CAAC;AAEvB,0EAA0E;AAC1E,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAiFD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EACL,KAAK,CAAC,SAAS,SAAS,kBAAkB,GAAG,kBAAkB,EAC/D,MAAM,EAAE,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAC,GAAG,cAAc,CA+F5D;AA8BD,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,cAAc,CAAC;CACzB,GAAG,QAAQ,CAMX"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { McpServer, RegisteredTool } from '@modelcontextprotocol/server';
|
|
2
|
+
import type { ErrorHintFn, ToolCallHooks, ToolLifecycle } from '../execute-hooks.js';
|
|
3
|
+
import type { McpCatalogStamp } from './catalog-stamp.js';
|
|
4
|
+
/** Opt-in lazy tool discovery configuration for stateful `stitchkit/tools/mcp` mounts. */
|
|
5
|
+
export interface McpLazyDiscoveryConfig {
|
|
6
|
+
readonly mode: 'lazy';
|
|
7
|
+
/** Contract tool names enabled immediately on session start; all other contract tools start disabled. */
|
|
8
|
+
readonly initialTools: readonly string[];
|
|
9
|
+
/** Name of the built-in discovery tool. Default `'tool_search'`. */
|
|
10
|
+
readonly searchToolName?: string;
|
|
11
|
+
/** Maximum matching hidden tools returned and enabled per search call (`1..50`). Default `10`. */
|
|
12
|
+
readonly maxResults?: number;
|
|
13
|
+
}
|
|
14
|
+
/** Normalized lazy discovery parameters returned by {@link validateMcpLazyDiscovery}. */
|
|
15
|
+
export interface ValidatedMcpLazyDiscovery {
|
|
16
|
+
readonly initialTools: ReadonlySet<string>;
|
|
17
|
+
readonly searchToolName: string;
|
|
18
|
+
readonly maxResults: number;
|
|
19
|
+
}
|
|
20
|
+
/** One contract tool handle managed by lazy discovery on a single `McpServer` session. */
|
|
21
|
+
export interface ManagedLazyMcpTool {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly description: string;
|
|
24
|
+
readonly registered: RegisteredTool;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Synchronously validate `discovery` configuration before any tools are registered on `McpServer`.
|
|
28
|
+
* Refuses unknown `initialTools`, name collisions with contract or runtime tools, and invalid bounds.
|
|
29
|
+
*/
|
|
30
|
+
export declare function validateMcpLazyDiscovery(rawConfig: unknown, contractToolNames: readonly string[], reservedToolNames?: readonly string[]): ValidatedMcpLazyDiscovery;
|
|
31
|
+
/**
|
|
32
|
+
* Hide non-initial contract tools on this `McpServer` session and register the built-in discovery
|
|
33
|
+
* tool through Stitchkit's standard runtime-tool pipeline (`access`, `hooks`, `catalog` stamp).
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyMcpLazyDiscovery(input: {
|
|
36
|
+
readonly server: McpServer;
|
|
37
|
+
readonly discovery: ValidatedMcpLazyDiscovery;
|
|
38
|
+
readonly tools: readonly ManagedLazyMcpTool[];
|
|
39
|
+
readonly lifecycle: ToolLifecycle;
|
|
40
|
+
readonly hooks?: ToolCallHooks;
|
|
41
|
+
readonly context?: Record<string, unknown>;
|
|
42
|
+
readonly catalog?: McpCatalogStamp;
|
|
43
|
+
readonly coerceJsonArgs?: boolean;
|
|
44
|
+
readonly errorHint?: ErrorHintFn;
|
|
45
|
+
readonly onOutputStrip?: (toolName: string, paths: string[]) => void;
|
|
46
|
+
}): void;
|
|
47
|
+
//# sourceMappingURL=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C,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC9C,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CACtE,GAAG,IAAI,CA+DP"}
|
|
@@ -6,6 +6,7 @@ import { type ToolExtend } from '../mount.js';
|
|
|
6
6
|
import type { RuntimeToolDefinition } from '../runtime-tool-declaration.js';
|
|
7
7
|
import { type McpResourceDef } from './app.js';
|
|
8
8
|
import type { McpCatalogStamp } from './catalog-stamp.js';
|
|
9
|
+
import { type McpLazyDiscoveryConfig } from './lazy-discovery.js';
|
|
9
10
|
import { type McpSchemaValidationConfig, type McpSurfaceRegistry, type PreparedMcpServerSurface, type PreparedMcpSurface, type ValidateMcpSchemasConfig } from './prepare.js';
|
|
10
11
|
import type { McpRoundRuntime } from './round.js';
|
|
11
12
|
/**
|
|
@@ -41,11 +42,15 @@ export interface McpMountConfig {
|
|
|
41
42
|
errorHint?: ErrorHintFn;
|
|
42
43
|
/** Report output keys the contract schema removed — → ADR 0037. */
|
|
43
44
|
onOutputStrip?: (toolName: string, paths: string[]) => void;
|
|
45
|
+
/** Opt-in lazy tool discovery hiding non-initial contract tools behind a built-in search tool. */
|
|
46
|
+
discovery?: McpLazyDiscoveryConfig;
|
|
44
47
|
}
|
|
45
48
|
interface PreparedMcpMountConfig extends McpMountConfig {
|
|
46
49
|
multiRoundRuntime?: McpRoundRuntime;
|
|
47
50
|
/** The catalog this surface advertises, stamped onto listings and results. */
|
|
48
51
|
catalog?: McpCatalogStamp;
|
|
52
|
+
/** Additional tool names mounted on the same server (for example runtime tools) that `searchToolName` cannot collide with. */
|
|
53
|
+
reservedToolNames?: readonly string[];
|
|
49
54
|
}
|
|
50
55
|
/**
|
|
51
56
|
* Validate that every contract tool in `services` can be advertised on the MCP
|
|
@@ -132,6 +137,8 @@ export interface McpServerSharedConfig<TAuth> {
|
|
|
132
137
|
errorHint?: ErrorHintFn;
|
|
133
138
|
/** Report output keys the contract schema removed — → ADR 0037. */
|
|
134
139
|
onOutputStrip?: (toolName: string, paths: string[]) => void;
|
|
140
|
+
/** Opt-in lazy tool discovery hiding non-initial contract tools behind a built-in search tool. */
|
|
141
|
+
discovery?: McpLazyDiscoveryConfig;
|
|
135
142
|
}
|
|
136
143
|
/**
|
|
137
144
|
* Surface config with a fixed or per-identity list of services and runtime tools; cannot be
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAET,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,OAAO,CAAC;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 +1,4 @@
|
|
|
1
|
-
import { type CallToolResult, type McpServer } from '@modelcontextprotocol/server';
|
|
1
|
+
import { type CallToolResult, type McpServer, type RegisteredTool } from '@modelcontextprotocol/server';
|
|
2
2
|
import type { EndpointUiMeta } from '../../contract/tool-options.js';
|
|
3
3
|
import type { ToolExecutionOptions } from '../execute.js';
|
|
4
4
|
import type { ToolCallHooks, ToolLifecycle } from '../execute-hooks.js';
|
|
@@ -35,5 +35,5 @@ export interface McpToolRegistrationConfig {
|
|
|
35
35
|
* as an `isError` tool result: MCP reserves JSON-RPC errors for the protocol, and
|
|
36
36
|
* a tool's own failure is a result the model can read.
|
|
37
37
|
*/
|
|
38
|
-
export declare function registerMcpTool(server: McpServer, presentation: McpToolPresentation, descriptor: PreparedMcpTool, config: McpToolRegistrationConfig):
|
|
38
|
+
export declare function registerMcpTool(server: McpServer, presentation: McpToolPresentation, descriptor: PreparedMcpTool, config: McpToolRegistrationConfig): RegisteredTool;
|
|
39
39
|
//# sourceMappingURL=register.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/register.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/register.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAA2B,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAI3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAmB,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,mBAAmB,CAAC;AAEzE,OAAO,KAAK,EAAE,a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,UAAU,EAAE,eAAe,EAC3B,MAAM,EAAE,yBAAyB,GAChC,cAAc,CAoIhB"}
|
|
@@ -27,19 +27,18 @@ fields — are let through; the keys the driver reads are typed. Evolving.
|
|
|
27
27
|
Whether an agent pauses for host approval before running a tool is controlled by the agent
|
|
28
28
|
itself, not by ACP: the driver's `approvalEnforcement` is `'agent-initiated'`, meaning it
|
|
29
29
|
answers `session/request_permission` requests when the agent sends them and never synthesizes
|
|
30
|
-
approvals for unprompted tool calls.
|
|
31
|
-
`session/request_permission` in their default configuration; a host that requires interactive
|
|
32
|
-
tool approval must configure the agent's own approval policy (for example `toolPermission: "strict"`
|
|
33
|
-
in the agent's settings under `profile.home`, bearing in mind whether the agent's OAuth session
|
|
34
|
-
is bound to that profile directory).
|
|
30
|
+
approvals for unprompted tool calls. Explicit `approve` supports `scope: 'once'` (selecting `allow_once`), `scope: 'session'` (selecting `allow_always` when the agent advertises one, refusing fail-closed otherwise), or direct `optionId` via `{ kind: 'input', value: { optionId } }`; `approve.updatedInput` and `deny` with `interrupt: true` are refused fail-closed with `TypeError`. Host-specific environment variables (such as `TMPDIR`, `SSH_CONNECTION`, or agent-specific `AGY_*` variables) can be forwarded explicitly via `profile.env`.
|
|
35
31
|
|
|
36
32
|
| Export | Kind | Purpose |
|
|
37
33
|
|--------|------|---------|
|
|
38
|
-
| `createAcpDriver` / `AcpDriver` / `AcpDriverConfig` | function / _types_ | the driver (`approvalEnforcement: 'agent-initiated'`): `executable` and `args`; `
|
|
39
|
-
| `AcpSession` / `AcpConfigOption` / `AcpApprovalEnforcement` | _types_ | a session's settings, title and commands
|
|
34
|
+
| `createAcpDriver` / `AcpDriver` / `AcpDriverConfig` | function / _types_ | the driver (`approvalEnforcement: 'agent-initiated'`): `executable` and `args`; optional `clientInfo`, `sessionMeta`, `stdoutLineFilter`, `probeMode` (`'ephemeral-session' \| 'initialize-only' \| 'passive'`) / `passiveVersion`, `model` / `thoughtLevel` / `mode` (also overridable per open via `AcpOpenInput`, falling back to `session/set_model`), `mcpServers`, `transformUpdate`, post-settle `onUpdate` / `onPermissionRequest`, `onDisconnect`, `watchPromptOutcome`, `usageInputIncludesCachedRead`, `steerMode` (`'none' \| 'prompt'`), `resolveFile`, `maxImageBytes` (5 MiB), `maxFrameBytes` (8 MiB), `ambient`, and `requestTimeoutMs` (60 s, capping `session/close` / `session/delete` to at most 5 s) |
|
|
35
|
+
| `AcpSession` / `AcpOpenInput` / `AcpSteerTurnInput` / `AcpConfigOption` / `AcpApprovalEnforcement` | _types_ | a session's settings, title and commands, `approvalEnforcement` (`'agent-initiated'`), `setConfigOption(category or id, value)`, `respond(interactionId, reply)` for post-settle permissions, `steerTurn(input)` when `steerMode: 'prompt'`, and per-open overrides on `AcpOpenInput` |
|
|
36
|
+
| `AcpProbeMode` / `AcpSteerMode` / `AcpSessionMetaInput` / `AcpWatchPromptOutcome` / `AcpPromptOutcomeOverride` | _types_ | probe strategy, steer mode, static or `initialize`-derived `_meta` attachment on session open, and prompt-outcome verification hook reclassifying masked `end_turn` failures with `errorKind` and `threadDisposition` |
|
|
37
|
+
| `AcpTransformUpdate` / `AcpUpdateEvent` / `AcpPermissionRequestEvent` | _types_ | update normalizer (`transformUpdate`), live/post-settle `session/update` observer payload (`onUpdate`), and out-of-turn permission request payload with `respond()` (`onPermissionRequest`) |
|
|
38
|
+
| `AcpClientInfoSchema` / `AcpClientInfo` / `AcpInitializeResult` / `AcpSessionUpdate` / `AcpPromptResult` / `AcpPromptUsage` / `AcpPermissionRequest` / `AcpPermissionOption` | schema / _types_ | typed ACP v1 wire payloads exposed to `sessionMeta`, `transformUpdate`, `onUpdate`, `onPermissionRequest`, and `watchPromptOutcome` |
|
|
40
39
|
| `AcpSessionSummary` | _type_ | a session the agent keeps: id, working directory, title, last update |
|
|
41
40
|
| `AcpMcpServerSchema` / `AcpMcpServer` | schema / _type_ | an MCP server as ACP v1 names it: a command with arguments and environment, or an `http`/`sse` URL with headers |
|
|
42
|
-
| `ACP_PROTOCOL_VERSION` | constant | `1`;
|
|
41
|
+
| `ACP_PROTOCOL_VERSION` | constant | `1`; ACP v1 agents answering `protocolVersion >= 1` are accepted while protocol `< 1` and ACP v2 responses carrying `"info"` are refused at hello |
|
|
43
42
|
| `acpFakeScenarios` | constant | the conformance scenarios in this dialect, for a scripted agent |
|
|
44
43
|
|
|
45
44
|
A turn's input is text and images: an image `file` part goes as an `image`
|
|
@@ -14,18 +14,23 @@ Also read:
|
|
|
14
14
|
|
|
15
15
|
## `stitchkit/agent-executor/claude-sdk`
|
|
16
16
|
|
|
17
|
-
Claude through the Agent SDK. The application imports `query`
|
|
18
|
-
`@anthropic-ai/claude-agent-sdk` (an optional peer) and
|
|
19
|
-
imports only the SDK's types, so it loads without the
|
|
20
|
-
the same classifier as the CLI's, permissions arrive
|
|
21
|
-
interrupt is `Query.interrupt()` and denies a
|
|
22
|
-
query that breaks fails its turn — the next
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
Claude through the Agent SDK. The application imports `query` (and optionally
|
|
18
|
+
`forkSession`) from `@anthropic-ai/claude-agent-sdk` (an optional peer) and
|
|
19
|
+
passes them in; the leaf imports only the SDK's types, so it loads without the
|
|
20
|
+
SDK. Records are read by the same classifier as the CLI's, permissions arrive
|
|
21
|
+
through `canUseTool`, an interrupt is `Query.interrupt()` and denies a
|
|
22
|
+
permission still pending, and a query that breaks fails its turn — the next
|
|
23
|
+
turn opens a new one that resumes the session with live model, permission mode
|
|
24
|
+
and flag settings re-applied. Reconcile is by the input's `uuid` in the
|
|
25
|
+
profile's transcript. Evolving.
|
|
25
26
|
|
|
26
27
|
| Export | Kind | Purpose |
|
|
27
28
|
|--------|------|---------|
|
|
28
|
-
| `createClaudeSdkDriver` / `ClaudeSdkDriverConfig` | function /
|
|
29
|
-
| `
|
|
29
|
+
| `createClaudeSdkDriver` / `ClaudeSdkDriver` / `ClaudeSdkDriverConfig` | function / _types_ | the driver: `query` and `sdkVersion` required; optional `forkSession`, `model`, `permissionMode` (default `default`), `allowDangerouslySkipPermissions`, `pathToClaudeCodeExecutable`, `systemPrompt`, `settingSources`, `enableFileCheckpointing`, `supportedDialogKinds` / `onUserDialog`, `hooks`, `tools`, `allowedTools`, `disallowedTools`, `mcpServers`, `mcpServersDelivery`, `strictMcpConfig`, `plugins`, `agents`, `extraArgs`, `stderr`, `spawnClaudeCodeProcess`, `onProviderPid`, `onQueryExit`, `onElicitation`, `onPermissionRequest`, `onEvent`, `onTurnUsage`, `verifyDelegation`, `resolveFile`, `maxImageBytes` (default 5 MiB), and `ambient`. Exposes `probeCapabilities(input)` for isolated never-yielding capability probes, `status` over passive `rate_limit_event` or active `readUsage()`, and `forkSession(sessionId, options?)` |
|
|
30
|
+
| `ClaudeSdkSession` / `ClaudeSdkOpenInput` / `ClaudeSdkUsageRead` / `ClaudeSdkQueryExitContext` / `ClaudeSdkPermissionRequestMeta` | _types_ | extended session returned by `open(ClaudeSdkOpenInput)` (supporting `resumeSessionAt`, `resumeDropsTurn`, and `onStartupPhase`): exposes `providerPid`, `readUsage(opts?)`, `setModel`, `setPermissionMode`, `applyFlagSettings`, `initializationResult`, `supportedModels`, `supportedCommands`, `accountInfo`, `getContextUsage`, `mcpServerStatus`, `toggleMcpServer`, `reconnectMcpServer`, `setMcpServers`, `stopTask`, `backgroundTasks`, and `rewindFiles`; supports `approve` with `updatedInput` for `AskUserQuestion` and emits `ClaudeSdkPermissionRequestMeta` (`toolName`, `toolUseID`, `turnId`, `interactionId`, `input`, `decisionReason`, `blockedPath`, `suggestions`, `requestId`, `title`, `displayName`, `description`, `agentID`, `mcpServer`, `defaultToNo`, `suppressAlwaysAllowRule`, `matchedAskRule`) to `onPermissionRequest` |
|
|
31
|
+
| `ClaudeRuntimeEventSchema` / `ClaudeRuntimeEvent` / `ClaudeTaskUsageSchema` / `ClaudeTaskUsage` / `ClaudeSdkTurnUsageSchema` / `ClaudeSdkTurnUsage` / `ClaudeSdkTokenPairSchema` / `ClaudeSdkTokenPair` | schemas / _types_ | structured runtime events delivered to `onEvent` during and after turns (`task_started`, `task_updated`, `task_progress`, `task_notification`, `background_tasks_changed`, `tool_progress`, `api_retry`, `elicitation_complete`) alongside `compact_boundary` → `window { reset: 'context' }`, plus per-turn additive `modelUsage` deltas and `otherUsage` delivered to `onTurnUsage` |
|
|
32
|
+
| `ClaudeSdkProbeCapabilitiesInput` / `ClaudeSdkCapabilitiesProbe` | _types_ | input and result shapes for `driver.probeCapabilities(input)`: runs an isolated never-yielding SDK query to inspect models, commands, account info, and optional usage, always closing the query in `finally` |
|
|
33
|
+
| `ClaudeSdkDelegationCheck` | _type_ | fail-closed startup verification options (`requireHooksApplied`, `requireNoMcpServers`, `timeoutMs`) enforced at `open()` and on every query restart |
|
|
34
|
+
| `ClaudeSdkQuery` / `ClaudeSdkRun` / `ClaudeSdkForkSession` | _types_ | the SDK `query` / `forkSession` signatures the leaf takes and the subset of a running `Query` it uses; the SDK's own functions fit as they are |
|
|
30
35
|
|
|
31
36
|
---
|
|
@@ -23,7 +23,7 @@ Evolving.
|
|
|
23
23
|
|--------|------|---------|
|
|
24
24
|
| `createClaudeCliDriver` / `ClaudeCliDriverConfig` | function / _type_ | the driver; `permissionMode` defaults to `default`, so the server decides every tool the profile does not already allow; optional `resolveFile` and `maxImageBytes` (default 5 MiB) enable ordered turn-input image attachments |
|
|
25
25
|
| `claudeFakeScenarios` | constant | the conformance scenarios in this dialect, for a scripted engine |
|
|
26
|
-
| `claudeTranscriptPath` | function | where a profile keeps a session's transcript (`{ home, cwd, sessionId }`) |
|
|
26
|
+
| `claudeTranscriptPath` | function | where a profile keeps a session's transcript (`{ home, cwd, sessionId }`), resolving `realpath` of `cwd` (or its nearest existing ancestor) so symlinked workspaces match the canonical transcript location |
|
|
27
27
|
| `claudePlanWindows` | function | Claude's `rate_limit_event` as plan windows (`five_hour`, `seven_day`) |
|
|
28
28
|
|
|
29
29
|
---
|
|
@@ -14,12 +14,22 @@ Also read:
|
|
|
14
14
|
|
|
15
15
|
## `stitchkit/agent-executor/codex`
|
|
16
16
|
|
|
17
|
-
Codex through `codex app-server` over stdio
|
|
17
|
+
Codex through `codex app-server` over stdio (default) or RFC 6455
|
|
18
|
+
WebSocket-over-Unix-socket (`unix-listen` / `unix-connect`). Evolving.
|
|
18
19
|
|
|
19
20
|
| Export | Kind | Purpose |
|
|
20
21
|
|--------|------|---------|
|
|
21
|
-
| `createCodexDriver` / `CodexDriverConfig` | function /
|
|
22
|
+
| `createCodexDriver` / `CodexDriver` / `CodexDriverConfig` | function / _types_ | the driver: `transport` (`stdio`, `unix-listen`, `unix-connect`), `serverArgs`, thread policy (`model`, `modelProvider`, `approvalPolicy`, `sandbox`, `developerInstructions`, `runtimeWorkspaceRoots`, `config`), `prepareThread` / `verifyThread` lifecycle hooks, observers (`onNotification`, `onServerRequest`, `onDisconnect`), optional `resolveFile` and `maxImageBytes` (default 5 MiB) for turn-input images, `connectControl(input)` for threadless connections, opt-in `openSharedServer(input)` for headless `stdio` multi-thread multiplexing (ADR 0329), approvals and input asked of the host, and multi-bucket limits from `account/rateLimits/read` |
|
|
23
|
+
| `CodexTransportConfig` | _type_ | transport selector: `{ kind: 'stdio' }`, `{ kind: 'unix-listen', socketPath, listenTimeoutMs? }`, or `{ kind: 'unix-connect', socketPath, expectedOwnerUid? }` |
|
|
24
|
+
| `CodexSession` / `CodexControlClient` / `CodexControlConnection` / `CodexControlConnectInput` | _types_ | extended session returned by `open()` and threadless connection returned by `connectControl()`: expose `providerPid`, `respond`, `readConfig`, `readThread`, `listThreads`, `listLoadedThreads`, `listCollaborationModes`, `listTurns`, `listItems`, `archiveThread`, `unarchiveThread`, `unsubscribeThread`, `setThreadName`, `updateThreadMetadata`, `revertThread`, `injectItems`, `listMcpServerStatus`, `listSkills`, `listModels`, `readAccount`, and `readRateLimits`; `CodexSession` also exposes `threadContext`, `startTurn`, `steerTurn`, non-mutating `forkThread`, and `compactThread` |
|
|
25
|
+
| `CodexSharedServer` / `CodexSharedServerOpenInput` / `CodexSharedServerThreadInput` | _types_ | opt-in headless `stdio` multi-thread server returned by `driver.openSharedServer()` multiplexing up to `maxThreads` (default `32`, hard cap `256`) independent `CodexSession` instances with per-thread routing and `thread/unsubscribe` cleanup on thread close (refuses `unix-listen` / `unix-connect` fail-closed) |
|
|
26
|
+
| `CodexReadThreadParams` / `CodexListThreadsParams` / `CodexListLoadedThreadsParams` / `CodexListTurnsParams` / `CodexListItemsParams` / `CodexThreadItemsCursor` / `CodexThreadItemsDeferOutput` / `CodexThreadSortKey` / `CodexThreadSourceKind` | _types_ | typed parameters for `thread/read`, `thread/list`, `thread/loaded/list`, `thread/turns/list`, and `thread/items/list` |
|
|
27
|
+
| `CodexThreadIdParams` / `CodexSetThreadNameParams` / `CodexUpdateThreadMetadataParams` / `CodexThreadGitInfoUpdate` / `CodexRevertThreadParams` / `CodexRevertThreadResult` / `CodexInjectItemsParams` | _types_ | typed parameters and results for thread lifecycle (`archive`, `unarchive`, `unsubscribe`, `name/set`, `metadata/update`), history rollback (`thread/revert` via `revertThread`), and item injection (`thread/inject_items` via `injectItems`) |
|
|
28
|
+
| `CodexNotificationEvent` / `CodexServerRequestEvent` / `CodexServerRequestMethod` / `CodexMcpElicitationMode` | _types_ | observer event payloads for server notifications and the 5 handled v2 server requests (`item/commandExecution/requestApproval`, `item/fileChange/requestApproval`, `item/permissions/requestApproval`, `item/tool/requestUserInput`, `mcpServer/elicitation/request`) answered via `respond` without `-32601` (rejecting `approve.updatedInput` and `deny.interrupt: true` on `item/permissions/requestApproval` fail-closed with `TypeError`; excluded legacy/dynamic requests return `-32601`) |
|
|
29
|
+
| `CodexOpenInput` / `CodexOpenForkOptions` / `CodexThreadContext` / `CodexThreadPolicyOverrides` / `CodexApprovalPolicy` / `CodexSandboxMode` | _types_ | `open()` input (including opening directly through `thread/fork` via `forkFrom` with `deferGoalContinuation`), applied policy/model context reported by `thread/start`, `thread/resume`, or `thread/fork`, and overridable thread policy fields |
|
|
30
|
+
| `CodexTurnInput` / `CodexTurnInputPart` / `CodexSkillInputSchema` / `CodexSkillInput` / `CodexCollaborationMode` / `CodexSteerTurnInput` / `CodexForkThreadOptions` / `CodexForkedThread` | schema / _types_ | per-turn `startTurn` overrides (`model`, fail-closed `modelProvider`, `reasoningEffort`, `collaborationMode`, `approvalPolicy`, `sandboxPolicy`, `runtimeWorkspaceRoots`), ordered text / image / `skill` (`{ type: 'skill', name, path }`) turn and steer inputs, and `forkThread` options/result (including `deferGoalContinuation`) |
|
|
31
|
+
| `CodexUnixSocketError` / `CodexUnixSocketErrorKind` | class / _type_ | typed Unix-socket refusal/transport error distinguishing `endpoint-absent`, `endpoint-not-listening`, `target-refused`, `upgrade-refused`, and `connection-lost` |
|
|
22
32
|
| `codexFakeScenarios` | constant | the conformance scenarios in this dialect, for a scripted app-server |
|
|
23
|
-
| `codexPlanWindows` | function | Codex's `rateLimits`
|
|
33
|
+
| `codexPlanWindows` | function | unfolds Codex's `account/rateLimits/read` envelope (including `rateLimitsByLimitId`) or a single snapshot into `<limitId\|limit>:<minutes>m\|<slot>` plan windows carrying optional `windowDurationMins` and `label` |
|
|
24
34
|
|
|
25
35
|
---
|
|
@@ -16,7 +16,11 @@ Also read:
|
|
|
16
16
|
|
|
17
17
|
| Export | Kind | Purpose |
|
|
18
18
|
|--------|------|---------|
|
|
19
|
-
| `runAgentEngineConformance` / `AgentEngineConformanceConfig` / `AgentEngineDialectScenarios` | function / _types_ | prove a driver against its dialect's scripted engine: text and reconcile, approvals, failures by kind, interrupts (including `interruptDuringApproval`, whose request must close with `request-resolved`, and `requestAfterInterrupt`, which the driver must refuse rather than offer), a request still held when the turn ends (`requestAtTurnEnd`, closed with `request-resolved` before the end) or when the engine dies (`requestThenCrash`), neither left open to the consumer's answer, a dead or garbled engine, unknown records, and a dispatch never sent twice |
|
|
19
|
+
| `runAgentEngineConformance` / `AgentEngineConformanceConfig` / `AgentEngineDialectScenarios` | function / _types_ | prove a driver against its dialect's scripted engine: capabilities shape, text and reconcile, approvals, failures by kind, interrupts (including `interruptDuringApproval`, whose request must close with `request-resolved`, and `requestAfterInterrupt`, which the driver must refuse rather than offer), a request still held when the turn ends (`requestAtTurnEnd`, closed with `request-resolved` before the end) or when the engine dies (`requestThenCrash`), neither left open to the consumer's answer, a dead or garbled engine, unknown records, and a dispatch never sent twice |
|
|
20
|
+
| `createReplayExecutorDriver` / `ReplayExecutorDriver` / `ReplayExecutorDriverConfig` | function / _types_ | in-process, zero-subprocess, deterministic replay `AgentEngineDriver` over validated NDJSON transcripts for local dev and e2e tests; emulates any existing `ExecutorEngine` without widening `ExecutorEngineSchema` and provides `inputsFor`, `wasAnswered`, and `assertComplete` |
|
|
21
|
+
| `createReplayGate` / `ReplayGate` | function / _type_ | deterministic label-based synchronization gate pausing `{ kind: 'gate', label }` steps until `waitForReached` / `release` without timers |
|
|
22
|
+
| `ExecutorReplayTranscriptSchema` / `ExecutorReplayTranscript` / `ExecutorReplayStepSchema` / `ExecutorReplayStep` / `parseReplayTranscript` / `ParseReplayTranscriptOptions` / `formatReplayTranscript` | schemas / functions / _types_ | strict Zod-validated NDJSON transcript format (bounded by `maxBytes` and `maxSteps`, substituting `<workspace>` placeholders) and round-trip parser/formatter |
|
|
23
|
+
| `REPLAY_SCENARIOS` / `unpackReplayScenario` / `replayDialectScenarios` | constant / functions | built-in deterministic scenario presets (`'text-stream'`, `'approval'`, `'user-input'`, `'tool-calls'`, `'rate-limit'`, `'multi-turn'`, `'crash-mid-turn'`) and conformance dialect adapter |
|
|
20
24
|
| `FakeEngineScenarioSchema` / `FakeEngineScenario` / `FakeEngineStepSchema` / `FakeEngineStep` | schemas / _types_ | a scripted engine turn in any dialect: expect, emit, delay, crash, exit |
|
|
21
25
|
| `runFakeClaudeEngine` | function | play a scenario as Claude Code does on `stream-json` — the engine side of a Claude-dialect conformance test; Codex and ACP fakes speak JSON-RPC and are not exported |
|
|
22
26
|
|
package/llms/agent-executor.txt
CHANGED
|
@@ -21,17 +21,18 @@ leaves of their own; this entrypoint knows no vendor. Evolving.
|
|
|
21
21
|
| Export | Kind | Purpose |
|
|
22
22
|
|--------|------|---------|
|
|
23
23
|
| `defineAgentExecutorContract` / `agentExecutorRealtimeContract` | functions / contract | the operations (`hello`, `claim`, `renew`, `release`, `report`) and the events the server pushes (`turn:offer`, `turn:interrupt`, `turn:reply`) |
|
|
24
|
-
| `ExecutorHelloSchema` / `ExecutorHello` / `ExecutorHelloAckSchema` / `ExecutorHelloAck` / `ExecutorEngineSchema` / `ExecutorEngine` / `ExecutorEngineInfoSchema` / `ExecutorReconcileSchema` / `ExecutorProfileSchema` / `ExecutorProfile` / `ExecutorResumableTurnSchema` | schemas / _types_ | what an executor announces — engines (their `models`: `listed` with ids, `not-asked` or `failed` with why), private profiles, resumable turns with their `turnOrdinal` — and what the server holds of each: `acked` up to `ackedSeq`, or `not-retained` |
|
|
25
|
-
| `PlanLimitsSchema` / `PlanLimits` / `PlanWindowSchema` / `PlanWindow` | schemas / _types_ | a subscription's limits: `known`, `no-plan-limit` or `unpublished`, with the last read's error beside the last answer |
|
|
24
|
+
| `ExecutorHelloSchema` / `ExecutorHello` / `ExecutorHelloAckSchema` / `ExecutorHelloAck` / `ExecutorEngineSchema` / `ExecutorEngine` / `ExecutorEngineInfoSchema` / `ExecutorDriverCapabilitiesSchema` / `ExecutorDriverCapabilities` / `ExecutorReconcileSchema` / `ExecutorProfileSchema` / `ExecutorProfile` / `ExecutorResumableTurnSchema` | schemas / _types_ | what an executor announces — engines (their `models`: `listed` with ids, `not-asked` or `failed` with why, plus optional declarative `capabilities` describing runtime policy enforcement, session approval, `updatedToolInput`, structured input, steer/fork/revert/compact/injectItems, background work, `multiThreadPerProcess`, images, and `planLimits`), private profiles, resumable turns with their `turnOrdinal` — and what the server holds of each: `acked` up to `ackedSeq`, or `not-retained` |
|
|
25
|
+
| `PlanLimitsSchema` / `PlanLimits` / `PlanWindowSchema` / `PlanWindow` | schemas / _types_ | a subscription's limits: `known`, `no-plan-limit` or `unpublished`, with the last read's error beside the last answer; each window carries `name`, `usedPercent`, and optional `resetsAt`, `windowDurationMins` and `label` |
|
|
26
26
|
| `ThreadClaimSchema` / `ThreadClaim` / `ThreadLeaseSchema` / `ThreadLease` / `ThreadRenewSchema` / `ThreadReleaseSchema` | schemas / _types_ | thread leases pinned to an executor and profile, under a fence |
|
|
27
|
-
| `TurnOfferSchema` / `TurnOffer` / `TurnPhaseSchema` / `TurnPhase` / `TurnReportSchema` / `TurnReport` / `TurnReportAckSchema` / `TurnFailureKindSchema` / `TurnInterruptSchema` / `InteractionReplySchema` / `InteractionReply` / `EXECUTOR_ERRORS` | schemas / _types_ / constant | a turn offered under its thread's `turnOrdinal`, its phases and reports applied once by `executorSeq` (acknowledged `applied`, `duplicate` or `not-retained`), interrupts, answers to an engine's requests, and the refusal codes |
|
|
28
|
-
| `ExecutorDeltaSchema` / `ExecutorDelta` / `ExecutorErrorKindSchema` / `ExecutorErrorKind` / `ExecutorRawSchema` | schemas / _types_ | what an engine said: `agent-parts` blocks with `turnId`, `itemId` and `raw`, plus requests, usage, the context gauge (`context-usage`), the end of the turn, errors by kind and window resets |
|
|
29
|
-
| `projectExecutorDeltas` | function | fold a turn's deltas into the message parts the agent runtime stores |
|
|
30
|
-
| `
|
|
27
|
+
| `TurnOfferSchema` / `TurnOffer` / `TurnPhaseSchema` / `TurnPhase` / `TurnReportSchema` / `TurnReport` / `TurnReportAckSchema` / `TurnFailureKindSchema` / `TurnInterruptSchema` / `InteractionReplySchema` / `InteractionReply` / `EXECUTOR_ERRORS` | schemas / _types_ / constant | a turn offered under its thread's `turnOrdinal`, its phases and reports applied once by `executorSeq` (acknowledged `applied`, `duplicate` or `not-retained`), interrupts, answers to an engine's requests (`approve` with optional `scope: 'once' \| 'session'` and `updatedInput`, `deny` with optional `interrupt: boolean`), and the refusal codes |
|
|
28
|
+
| `ExecutorDeltaSchema` / `ExecutorDelta` / `ExecutorStatusDeltaSchema` / `ExecutorStartupPhaseSchema` / `ExecutorStartupPhase` / `ExecutorThreadDispositionSchema` / `ExecutorThreadDisposition` / `ExecutorErrorKindSchema` / `ExecutorErrorKind` / `ExecutorRawSchema` / `ExecutorTokenUsageSchema` / `ExecutorTokenUsage` / `ExecutorModelUsageSchema` / `ExecutorModelUsage` | schemas / _types_ | what an engine said: `agent-parts` blocks with `turnId`, `itemId` and `raw`, plus requests, usage (including optional `cacheCreationInputTokens`, `thinkingTokens`, `totalTokens`, cumulative `total`, and per-model `modelUsage`), the context gauge (`context-usage`), lifecycle `status` deltas (`ExecutorStartupPhase`: `spawning`, `initializing`, `verifying`), the end of the turn (with optional `threadDisposition`: `'reusable' \| 'broken'`, also carried on `TurnReportSchema.failure`), errors by kind and window resets |
|
|
29
|
+
| `projectExecutorDeltas` | function | fold a turn's deltas into the message parts the agent runtime stores (ignoring lifecycle `status` deltas) |
|
|
30
|
+
| `buildContextHandoff` / `withInlineHandoffContext` / `InlineHandoffComposition` / `ContextHandoffInputSchema` / `ContextHandoffInput` / `ContextHandoffEntrySchema` / `ContextHandoffEntry` / `ContextHandoffMessageEntrySchema` / `ContextHandoffClearEntrySchema` / `ContextHandoffBudgetSchema` / `ContextHandoffStrategySchema` / `ContextHandoffResultSchema` / `ContextHandoffResult` / `ContextHandoffSelectedItemSchema` / `ContextHandoffSelectedItem` / `ContextHandoffStructuredItemSchema` / `ContextHandoffStructuredItem` | functions / schemas / _types_ | pure portable context-handoff builder for cross-engine or cross-session transitions: supports `full` and `delta` (`afterItemId` or `afterTurnId`, fail-closed `missingAnchor: 'error'` or `'full'`) strategies respecting the latest `clear` barrier, keeps intact items by fixed priority (`last user → last assistant → first user → newest..oldest`) under strict `maxTokens` / `maxBytes` / `maxOmittedIds` (and optional `contextWindowTokens` / `usedTokens` / `workReserveTokens`) ceilings while dropping non-text/binary/reasoning/provider parts, emits deterministic `inlineText` and Responses API `structuredItems`, and composes inline context ahead of a user prompt via `withInlineHandoffContext` (deferring on leading `/slash` commands) |
|
|
31
|
+
| `AgentEngineDriver` / `AgentEngineSession` / `AgentEngineTurn` / `ExecutorEngineInfo` | _types_ | one vendor's engine behind one interface: info, declarative `capabilities`, login status, a session per connection (accepting `onStartupPhase` on `open`), turns with `interrupt` and `respond`, `findInput` for a `client-id` engine |
|
|
31
32
|
| `dispatchTurn` / `DispatchOutcome` | function / _type_ | send a turn's input at most once through `LocalStepDurability.effect`: `sent`, `delivered` after a reconcile, or `unknown_after_restart` — never resent |
|
|
32
|
-
| `spawnEngineProcess` / `EngineProcess` | function / _type_ | an engine process talked to by lines over `stitchkit/process`: declared environment, owner-loss termination, bounded lines (`maxLineBytes`), stderr, queued stdin (`maxPendingStdinBytes`) and stdin written over the connection's life (`maxStdinBytes`, a refused `send()` that leaves the engine running); every option checked before the spawn |
|
|
33
|
+
| `spawnEngineProcess` / `EngineProcess` | function / _type_ | an engine process talked to by lines over `stitchkit/process`: declared environment, owner-loss termination, optional leader `pid` / `pidReady`, `stdoutMode` (`'lines'` default or `'drain'` for socket-serving engines), bounded lines (`maxLineBytes`), stderr, queued stdin (`maxPendingStdinBytes`) and stdin written over the connection's life (`maxStdinBytes`, a refused `send()` that leaves the engine running); every option checked before the spawn |
|
|
33
34
|
| `createExecutorLeases` / `memoryExecutorLeaseStore` / `ExecutorLeaseStateStore` / `ExecutorLeaseState` / `ExecutorLeaseStateSchema` / `ExecutorLeaseRefusal` | functions / _types_ / class | the server's thread leases and turn receipts over one atomically updated value, bounded by threads: each thread keeps the receipts of its last `retainedTurns` turns (default 64, at most 1024) and the highest `turnOrdinal` it let go, a report of a turn at or below it is `not-retained`, and `resume(resumable)` answers a hello the same way; a `StateStore` of `stitchkit/application` fits; a refusal is an `ExecutorLeaseRefusal` — an `AppError` with status 409 and a code of `EXECUTOR_ERRORS` — so an operation returning the service's promise answers `409 { error: { code } }` |
|
|
34
|
-
| `ExecutorProfileConfigSchema` / `ExecutorProfileConfig` / `engineEnvironment` / `ownCredentials` / `helloProfile` / `CREDENTIAL_VARIABLES` | schema / _type_ / functions / constant | a profile on the executor's machine, the engine's allowlisted environment with the profile's `home` as `CLAUDE_CONFIG_DIR`, `CODEX_HOME` or (ACP) `HOME`, and `helloProfile({ profile, status, ambient })` carrying no path and no value; a driver refuses a profile whose `engine` is not its own with a `TypeError`, before it reads a file or starts the engine |
|
|
35
|
+
| `ExecutorProfileConfigSchema` / `ExecutorProfileConfig` / `engineEnvironment` / `ownCredentials` / `helloProfile` / `CREDENTIAL_VARIABLES` | schema / _type_ / functions / constant | a profile on the executor's machine, the engine's allowlisted environment with the profile's `home` as `CLAUDE_CONFIG_DIR`, `CODEX_HOME` or (ACP) `HOME` plus explicit `profile.env` pass-through for host-specific overrides (such as `TMPDIR`, `SSH_CONNECTION`, or agent-specific `AGY_*` variables), and `helloProfile({ profile, status, ambient })` carrying no path and no value; a driver refuses a profile whose `engine` is not its own with a `TypeError`, before it reads a file or starts the engine |
|
|
35
36
|
| `mergeRateLimitEvent` / `planLimitsReadFailed` / `planLimitsDue` / `planWindowExpired` | functions | plan limits kept as three answers (`mergeRateLimitEvent`, `planLimitsReadFailed`, `planLimitsDue` take an options object), with a failed read beside the last answer |
|
|
36
37
|
| `canAdvanceTurnPhase` / `isTerminalTurnPhase` | functions | the turn phase machine: a terminal phase is never left |
|
|
37
38
|
| `advanceExecutorConnection` / `canAcceptTurn` / `INITIAL_EXECUTOR_CONNECTION` / `ExecutorConnectionState` / `ExecutorConnectionEvent` | functions / constant / _types_ | the executor's connection as a pure machine with generations: an answer of an earlier connection never acts on a later one |
|