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
|
@@ -2,24 +2,22 @@ import {
|
|
|
2
2
|
createBoundedChannel2
|
|
3
3
|
} from "./index-09f7w2qq.js";
|
|
4
4
|
import {
|
|
5
|
+
ExecutorStartupPhaseSchema2,
|
|
5
6
|
engineEnvironment2
|
|
6
|
-
} from "./index-
|
|
7
|
+
} from "./index-dbp6xemn.js";
|
|
7
8
|
import {
|
|
8
9
|
runNativeCommand2
|
|
9
|
-
} from "./index-
|
|
10
|
+
} from "./index-pzhqydxb.js";
|
|
10
11
|
import {
|
|
11
12
|
jsonDataRefusal
|
|
12
13
|
} from "./index-m6w6jtda.js";
|
|
13
|
-
import {
|
|
14
|
-
assertPositiveSafeInteger
|
|
15
|
-
} from "./index-kzavdze2.js";
|
|
16
14
|
import {
|
|
17
15
|
abortReason,
|
|
18
|
-
raceAbort,
|
|
19
16
|
linkAbortSignals
|
|
20
17
|
} from "./index-rptj3qnc.js";
|
|
21
18
|
|
|
22
19
|
// src/agent-executor/session-primitives.ts
|
|
20
|
+
import { createHash } from "node:crypto";
|
|
23
21
|
import { z } from "zod";
|
|
24
22
|
var TURN_QUEUE = { maxItems: 65536, maxBytes: 64 * 1024 * 1024 };
|
|
25
23
|
var MAX_DATE_MS = 8640000000000000;
|
|
@@ -139,107 +137,42 @@ function safeJsonValue(value) {
|
|
|
139
137
|
}
|
|
140
138
|
return z.json().parse(snapshot.value);
|
|
141
139
|
}
|
|
142
|
-
|
|
143
|
-
// src/agent-executor/image-input.ts
|
|
144
|
-
var DEFAULT_MAX_IMAGE_BYTES = 5 * 1024 * 1024;
|
|
145
|
-
var CLAUDE_CLI_MAX_LINE_BYTES = 16 * 1024 * 1024;
|
|
146
|
-
var SUPPORTED_IMAGE_MEDIA_TYPES = new Set([
|
|
147
|
-
"image/png",
|
|
148
|
-
"image/jpeg",
|
|
149
|
-
"image/gif",
|
|
150
|
-
"image/webp"
|
|
151
|
-
]);
|
|
152
|
-
function isSupportedImageMediaType(value) {
|
|
153
|
-
return value === "image/png" || value === "image/jpeg" || value === "image/gif" || value === "image/webp";
|
|
154
|
-
}
|
|
155
|
-
function validateImageOptions(options) {
|
|
156
|
-
assertPositiveSafeInteger("maxImageBytes", options.maxImageBytes);
|
|
157
|
-
}
|
|
158
|
-
function bytesToBase64(bytes) {
|
|
159
|
-
return Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString("base64");
|
|
160
|
-
}
|
|
161
|
-
async function resolveImageBytes(reference, options) {
|
|
162
|
-
assertPositiveSafeInteger("maxImageBytes", options.maxImageBytes);
|
|
163
|
-
let bytes;
|
|
140
|
+
function invokeSafely(invoke) {
|
|
164
141
|
try {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
throw new TypeError("resolveFile must return a Uint8Array");
|
|
171
|
-
}
|
|
172
|
-
if (bytes.byteLength === 0) {
|
|
173
|
-
throw new RangeError("The image is empty (0 bytes)");
|
|
174
|
-
}
|
|
175
|
-
if (bytes.byteLength > options.maxImageBytes) {
|
|
176
|
-
throw new RangeError(`The image is ${bytes.byteLength} bytes, over maxImageBytes ${options.maxImageBytes}`);
|
|
177
|
-
}
|
|
178
|
-
return bytes;
|
|
179
|
-
}
|
|
180
|
-
async function inlineParts(parts, options) {
|
|
181
|
-
const maxImageBytes = options.maxImageBytes ?? DEFAULT_MAX_IMAGE_BYTES;
|
|
182
|
-
assertPositiveSafeInteger("maxImageBytes", maxImageBytes);
|
|
183
|
-
for (const part of parts) {
|
|
184
|
-
if (part.type === "text")
|
|
185
|
-
continue;
|
|
186
|
-
if (part.type !== "file") {
|
|
187
|
-
throw new TypeError(`${options.driverLabel} sends text and images, received ${part.type}`);
|
|
188
|
-
}
|
|
189
|
-
if (!isSupportedImageMediaType(part.mediaType)) {
|
|
190
|
-
throw new TypeError(`${options.driverLabel} sends PNG, JPEG, GIF or WebP images only, received a file of ${part.mediaType}`);
|
|
191
|
-
}
|
|
192
|
-
if (options.resolveFile === undefined) {
|
|
193
|
-
throw new TypeError("An image needs resolveFile to read its bytes");
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
const resolved = [];
|
|
197
|
-
for (const part of parts) {
|
|
198
|
-
if (part.type === "text") {
|
|
199
|
-
resolved.push({ type: "text", text: part.text });
|
|
200
|
-
continue;
|
|
142
|
+
const result = invoke();
|
|
143
|
+
if (typeof result === "object" && result !== null && "then" in result && typeof result.then === "function") {
|
|
144
|
+
Promise.resolve(result).catch(() => {
|
|
145
|
+
return;
|
|
146
|
+
});
|
|
201
147
|
}
|
|
202
|
-
|
|
203
|
-
continue;
|
|
204
|
-
const read = resolveImageBytes(part.reference, {
|
|
205
|
-
resolveFile: options.resolveFile,
|
|
206
|
-
maxImageBytes
|
|
207
|
-
});
|
|
208
|
-
const bytes = options.signal ? await raceAbort(read, options.signal) : await read;
|
|
209
|
-
resolved.push({
|
|
210
|
-
type: "image",
|
|
211
|
-
mediaType: part.mediaType,
|
|
212
|
-
base64: bytesToBase64(bytes)
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
return resolved;
|
|
148
|
+
} catch {}
|
|
216
149
|
}
|
|
217
|
-
function
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
150
|
+
function emitStartupPhase(callback, phase) {
|
|
151
|
+
if (callback === undefined)
|
|
152
|
+
return;
|
|
153
|
+
const parsed = ExecutorStartupPhaseSchema2.parse(phase);
|
|
154
|
+
invokeSafely(() => callback(parsed));
|
|
155
|
+
}
|
|
156
|
+
function clampUniqueWindowName(prefix, suffix, seenNames, disambiguatorSeed, maxChars = 256) {
|
|
157
|
+
const maxPrefix = Math.max(1, maxChars - suffix.length);
|
|
158
|
+
let candidate = prefix.length > maxPrefix ? `${prefix.slice(0, maxPrefix)}${suffix}`.slice(0, maxChars) : `${prefix}${suffix}`;
|
|
159
|
+
if (!seenNames.has(candidate)) {
|
|
160
|
+
seenNames.add(candidate);
|
|
161
|
+
return candidate;
|
|
221
162
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
signal: options.signal
|
|
236
|
-
});
|
|
237
|
-
} finally {
|
|
238
|
-
preparing = false;
|
|
239
|
-
}
|
|
240
|
-
options.check(input);
|
|
241
|
-
return await options.dispatch(input, parts);
|
|
242
|
-
};
|
|
163
|
+
const digest = createHash("sha256").update(disambiguatorSeed).digest("hex").slice(0, 8);
|
|
164
|
+
const tag = `#${digest}${suffix}`;
|
|
165
|
+
const room = Math.max(1, maxChars - tag.length);
|
|
166
|
+
candidate = `${prefix.slice(0, room)}${tag}`.slice(0, maxChars);
|
|
167
|
+
let index = 2;
|
|
168
|
+
while (seenNames.has(candidate)) {
|
|
169
|
+
const indexedTag = `#${digest}_${index}${suffix}`;
|
|
170
|
+
const indexedRoom = Math.max(1, maxChars - indexedTag.length);
|
|
171
|
+
candidate = `${prefix.slice(0, indexedRoom)}${indexedTag}`.slice(0, maxChars);
|
|
172
|
+
index += 1;
|
|
173
|
+
}
|
|
174
|
+
seenNames.add(candidate);
|
|
175
|
+
return candidate;
|
|
243
176
|
}
|
|
244
177
|
|
|
245
178
|
// src/agent-executor/engine-requests.ts
|
|
@@ -293,4 +226,4 @@ function loseEngineTurn(turn, answer, error) {
|
|
|
293
226
|
turn.channel.fail(error);
|
|
294
227
|
}
|
|
295
228
|
|
|
296
|
-
export { nonEmptyString, epochSecondsToIso, createTurnDeltaChannel, offerTurnDelta, sessionAbort, runEngineCli, stopConnection, withEphemeralConnection, safeJsonValue,
|
|
229
|
+
export { nonEmptyString, epochSecondsToIso, createTurnDeltaChannel, offerTurnDelta, sessionAbort, runEngineCli, stopConnection, withEphemeralConnection, safeJsonValue, invokeSafely, emitStartupPhase, clampUniqueWindowName, holdEngineRequest, answerEngineRequest, drainEngineRequests, endEngineTurn, loseEngineTurn };
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
assertRawBodyEndpoint,
|
|
20
20
|
assertSafelistedBodyEndpoint,
|
|
21
21
|
assertResponseMetaEndpoint
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-ryxb427v.js";
|
|
23
23
|
import {
|
|
24
24
|
assertPositiveSafeInteger
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-gr0kxymw.js";
|
|
26
26
|
import {
|
|
27
27
|
isRecord
|
|
28
28
|
} from "./index-ps3djm8d.js";
|
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
} from "./index-2nwvn7m2.js";
|
|
5
5
|
import {
|
|
6
6
|
writeFileAtomicSync2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-pp97q86a.js";
|
|
8
8
|
import {
|
|
9
9
|
fetchGuarded,
|
|
10
10
|
PrivateAddressRefusal,
|
|
11
11
|
readCapped
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-apf5g7y9.js";
|
|
13
13
|
import {
|
|
14
14
|
serializeCanonicalJson
|
|
15
15
|
} from "./index-fmzg39a8.js";
|
|
16
16
|
import {
|
|
17
17
|
assertPositiveSafeInteger
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-gr0kxymw.js";
|
|
19
19
|
import {
|
|
20
20
|
assertTimerMs,
|
|
21
21
|
withSignalDeadline
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./index-2nwvn7m2.js";
|
|
4
4
|
import {
|
|
5
5
|
writeAtomicFileData
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-pp97q86a.js";
|
|
7
7
|
import {
|
|
8
8
|
publishAtomicFile
|
|
9
9
|
} from "./index-2c5w2d1d.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./index-jj9228tt.js";
|
|
16
16
|
import {
|
|
17
17
|
assertPositiveSafeInteger
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-gr0kxymw.js";
|
|
19
19
|
|
|
20
20
|
// src/application/file-state-store.ts
|
|
21
21
|
import { mkdir, open, unlink } from "node:fs/promises";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RegularFileError2,
|
|
3
3
|
readRegularFile2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-21cfxc4z.js";
|
|
5
5
|
import {
|
|
6
6
|
runNativeCommand2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-pzhqydxb.js";
|
|
8
8
|
import {
|
|
9
9
|
writeFileAtomic2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-pp97q86a.js";
|
|
11
11
|
import {
|
|
12
12
|
errnoOf
|
|
13
13
|
} from "./index-jj9228tt.js";
|
|
@@ -43,13 +43,43 @@ var ExecutorRequestResolvedDeltaSchema = z.strictObject({
|
|
|
43
43
|
interactionId: z.string().min(1)
|
|
44
44
|
});
|
|
45
45
|
var TokenCountSchema = z.int().nonnegative();
|
|
46
|
+
var MAX_MODEL_USAGE_ENTRIES = 64;
|
|
47
|
+
var ExecutorTokenUsageSchema2 = z.strictObject({
|
|
48
|
+
inputTokens: TokenCountSchema.optional(),
|
|
49
|
+
outputTokens: TokenCountSchema.optional(),
|
|
50
|
+
cachedInputTokens: TokenCountSchema.optional(),
|
|
51
|
+
cacheCreationInputTokens: TokenCountSchema.optional(),
|
|
52
|
+
thinkingTokens: TokenCountSchema.optional(),
|
|
53
|
+
totalTokens: TokenCountSchema.optional()
|
|
54
|
+
});
|
|
55
|
+
var ExecutorModelUsageSchema2 = z.strictObject({
|
|
56
|
+
inputTokens: TokenCountSchema,
|
|
57
|
+
outputTokens: TokenCountSchema,
|
|
58
|
+
cacheReadInputTokens: TokenCountSchema.optional(),
|
|
59
|
+
cacheCreationInputTokens: TokenCountSchema.optional(),
|
|
60
|
+
thinkingTokens: TokenCountSchema.optional(),
|
|
61
|
+
cacheCreationEphemeral5mInputTokens: TokenCountSchema.optional(),
|
|
62
|
+
cacheCreationEphemeral1hInputTokens: TokenCountSchema.optional(),
|
|
63
|
+
webSearchRequests: TokenCountSchema.optional(),
|
|
64
|
+
costUsd: z.number().nonnegative().optional(),
|
|
65
|
+
contextWindow: TokenCountSchema.optional(),
|
|
66
|
+
maxOutputTokens: TokenCountSchema.optional(),
|
|
67
|
+
canonicalModel: z.string().min(1).max(256).optional(),
|
|
68
|
+
provider: z.string().min(1).max(128).optional(),
|
|
69
|
+
costBasis: z.enum(["list", "managed", "unknown"]).optional()
|
|
70
|
+
});
|
|
46
71
|
var ExecutorUsageDeltaSchema = z.strictObject({
|
|
47
72
|
type: z.literal("usage"),
|
|
48
73
|
...base,
|
|
49
74
|
inputTokens: TokenCountSchema.optional(),
|
|
50
75
|
outputTokens: TokenCountSchema.optional(),
|
|
51
76
|
cachedInputTokens: TokenCountSchema.optional(),
|
|
52
|
-
|
|
77
|
+
cacheCreationInputTokens: TokenCountSchema.optional(),
|
|
78
|
+
thinkingTokens: TokenCountSchema.optional(),
|
|
79
|
+
totalTokens: TokenCountSchema.optional(),
|
|
80
|
+
costUsd: z.number().nonnegative().optional(),
|
|
81
|
+
total: ExecutorTokenUsageSchema2.optional(),
|
|
82
|
+
modelUsage: z.record(z.string().min(1).max(256), ExecutorModelUsageSchema2).refine((entries) => Object.keys(entries).length <= MAX_MODEL_USAGE_ENTRIES, `modelUsage must carry at most ${MAX_MODEL_USAGE_ENTRIES} models`).optional()
|
|
53
83
|
});
|
|
54
84
|
var ExecutorContextUsageDeltaSchema = z.strictObject({
|
|
55
85
|
type: z.literal("context-usage"),
|
|
@@ -57,10 +87,18 @@ var ExecutorContextUsageDeltaSchema = z.strictObject({
|
|
|
57
87
|
usedTokens: TokenCountSchema,
|
|
58
88
|
windowTokens: TokenCountSchema
|
|
59
89
|
});
|
|
90
|
+
var ExecutorThreadDispositionSchema2 = z.enum(["reusable", "broken"]);
|
|
91
|
+
var ExecutorStartupPhaseSchema2 = z.string().trim().min(1).max(64);
|
|
92
|
+
var ExecutorStatusDeltaSchema2 = z.strictObject({
|
|
93
|
+
type: z.literal("status"),
|
|
94
|
+
...base,
|
|
95
|
+
phase: ExecutorStartupPhaseSchema2
|
|
96
|
+
});
|
|
60
97
|
var ExecutorTurnEndDeltaSchema = z.strictObject({
|
|
61
98
|
type: z.literal("turn-end"),
|
|
62
99
|
...base,
|
|
63
|
-
outcome: z.enum(["completed", "interrupted", "failed"])
|
|
100
|
+
outcome: z.enum(["completed", "interrupted", "failed"]),
|
|
101
|
+
threadDisposition: ExecutorThreadDispositionSchema2.optional()
|
|
64
102
|
});
|
|
65
103
|
var ExecutorErrorKindSchema2 = z.enum([
|
|
66
104
|
"authRequired",
|
|
@@ -89,6 +127,7 @@ var ExecutorDeltaSchema2 = z.discriminatedUnion("type", [
|
|
|
89
127
|
ExecutorRequestResolvedDeltaSchema,
|
|
90
128
|
ExecutorUsageDeltaSchema,
|
|
91
129
|
ExecutorContextUsageDeltaSchema,
|
|
130
|
+
ExecutorStatusDeltaSchema2,
|
|
92
131
|
ExecutorTurnEndDeltaSchema,
|
|
93
132
|
ExecutorErrorDeltaSchema,
|
|
94
133
|
ExecutorWindowDeltaSchema
|
|
@@ -151,7 +190,11 @@ var TurnReportSchema2 = z2.strictObject({
|
|
|
151
190
|
executorSeq: z2.int().positive(),
|
|
152
191
|
phase: TurnPhaseSchema2,
|
|
153
192
|
deltas: z2.array(ExecutorDeltaSchema2).max(512),
|
|
154
|
-
failure: z2.strictObject({
|
|
193
|
+
failure: z2.strictObject({
|
|
194
|
+
kind: TurnFailureKindSchema2,
|
|
195
|
+
message: z2.string().min(1).max(4096),
|
|
196
|
+
threadDisposition: ExecutorThreadDispositionSchema2.optional()
|
|
197
|
+
}).optional()
|
|
155
198
|
});
|
|
156
199
|
var TurnReportAckSchema2 = z2.discriminatedUnion("outcome", [
|
|
157
200
|
z2.strictObject({ outcome: z2.literal("applied"), ackedSeq: z2.int().positive() }),
|
|
@@ -166,8 +209,16 @@ var InteractionReplySchema2 = z2.strictObject({
|
|
|
166
209
|
turnId: ExecutorIdSchema,
|
|
167
210
|
interactionId: ExecutorIdSchema,
|
|
168
211
|
reply: z2.discriminatedUnion("kind", [
|
|
169
|
-
z2.strictObject({
|
|
170
|
-
|
|
212
|
+
z2.strictObject({
|
|
213
|
+
kind: z2.literal("approve"),
|
|
214
|
+
scope: z2.enum(["once", "session"]).optional(),
|
|
215
|
+
updatedInput: z2.record(z2.string(), z2.json()).optional()
|
|
216
|
+
}),
|
|
217
|
+
z2.strictObject({
|
|
218
|
+
kind: z2.literal("deny"),
|
|
219
|
+
message: z2.string().min(1),
|
|
220
|
+
interrupt: z2.boolean().optional()
|
|
221
|
+
}),
|
|
171
222
|
z2.strictObject({ kind: z2.literal("input"), value: z2.json() })
|
|
172
223
|
])
|
|
173
224
|
});
|
|
@@ -193,10 +244,28 @@ var Name = z3.string().min(1).max(HELLO_LIMITS.name);
|
|
|
193
244
|
var Text = z3.string().min(1).max(HELLO_LIMITS.text);
|
|
194
245
|
var ExecutorEngineSchema2 = z3.enum(["claude-cli", "claude-sdk", "codex", "acp"]);
|
|
195
246
|
var ExecutorReconcileSchema2 = z3.enum(["client-id", "none"]);
|
|
247
|
+
var ExecutorDriverCapabilitiesSchema2 = z3.strictObject({
|
|
248
|
+
runtimePolicyEnforcement: z3.enum(["native", "client-boundary"]),
|
|
249
|
+
sessionApproval: z3.boolean(),
|
|
250
|
+
interruptOnDeny: z3.boolean(),
|
|
251
|
+
updatedToolInput: z3.boolean(),
|
|
252
|
+
structuredInput: z3.boolean(),
|
|
253
|
+
steer: z3.boolean(),
|
|
254
|
+
fork: z3.boolean(),
|
|
255
|
+
revert: z3.boolean(),
|
|
256
|
+
compact: z3.boolean(),
|
|
257
|
+
injectItems: z3.boolean(),
|
|
258
|
+
backgroundWorkOutlivesTurn: z3.boolean(),
|
|
259
|
+
multiThreadPerProcess: z3.boolean(),
|
|
260
|
+
images: z3.boolean(),
|
|
261
|
+
planLimits: z3.enum(["pull", "passive", "none"])
|
|
262
|
+
});
|
|
196
263
|
var PlanWindowSchema2 = z3.strictObject({
|
|
197
264
|
name: Name,
|
|
198
265
|
usedPercent: z3.number().min(0).max(100),
|
|
199
|
-
resetsAt: z3.iso.datetime({ offset: true }).optional()
|
|
266
|
+
resetsAt: z3.iso.datetime({ offset: true }).optional(),
|
|
267
|
+
windowDurationMins: z3.int().positive().optional(),
|
|
268
|
+
label: Name.optional()
|
|
200
269
|
});
|
|
201
270
|
var PlanLimitsSchema2 = z3.strictObject({
|
|
202
271
|
answer: z3.enum(["known", "no-plan-limit", "unpublished"]),
|
|
@@ -224,7 +293,8 @@ var ExecutorEngineInfoSchema2 = z3.strictObject({
|
|
|
224
293
|
}),
|
|
225
294
|
z3.strictObject({ answer: z3.literal("not-asked") }),
|
|
226
295
|
z3.strictObject({ answer: z3.literal("failed"), error: Text })
|
|
227
|
-
])
|
|
296
|
+
]),
|
|
297
|
+
capabilities: ExecutorDriverCapabilitiesSchema2.optional()
|
|
228
298
|
});
|
|
229
299
|
var ExecutorResumableTurnSchema2 = z3.strictObject({
|
|
230
300
|
turnId: ExecutorIdSchema,
|
|
@@ -314,4 +384,4 @@ function helloProfile2(input) {
|
|
|
314
384
|
};
|
|
315
385
|
}
|
|
316
386
|
|
|
317
|
-
export { ExecutorRawSchema2, ExecutorErrorKindSchema2, ExecutorDeltaSchema2, ThreadClaimSchema2, ThreadLeaseSchema2, ThreadRenewSchema2, ThreadReleaseSchema2, TurnOfferSchema2, TurnPhaseSchema2, TurnFailureKindSchema2, TurnReportSchema2, TurnReportAckSchema2, TurnInterruptSchema2, InteractionReplySchema2, EXECUTOR_ERRORS2, ExecutorEngineSchema2, ExecutorReconcileSchema2, PlanWindowSchema2, PlanLimitsSchema2, ExecutorProfileSchema2, ExecutorEngineInfoSchema2, ExecutorResumableTurnSchema2, ExecutorHelloSchema2, ExecutorHelloAckSchema2, ExecutorProfileConfigSchema2, engineProfile, CREDENTIAL_VARIABLES2, engineEnvironment2, ownCredentials2, helloProfile2 };
|
|
387
|
+
export { ExecutorRawSchema2, ExecutorTokenUsageSchema2, ExecutorModelUsageSchema2, ExecutorThreadDispositionSchema2, ExecutorStartupPhaseSchema2, ExecutorStatusDeltaSchema2, ExecutorErrorKindSchema2, ExecutorDeltaSchema2, ThreadClaimSchema2, ThreadLeaseSchema2, ThreadRenewSchema2, ThreadReleaseSchema2, TurnOfferSchema2, TurnPhaseSchema2, TurnFailureKindSchema2, TurnReportSchema2, TurnReportAckSchema2, TurnInterruptSchema2, InteractionReplySchema2, EXECUTOR_ERRORS2, ExecutorEngineSchema2, ExecutorReconcileSchema2, ExecutorDriverCapabilitiesSchema2, PlanWindowSchema2, PlanLimitsSchema2, ExecutorProfileSchema2, ExecutorEngineInfoSchema2, ExecutorResumableTurnSchema2, ExecutorHelloSchema2, ExecutorHelloAckSchema2, ExecutorProfileConfigSchema2, engineProfile, CREDENTIAL_VARIABLES2, engineEnvironment2, ownCredentials2, helloProfile2 };
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
AgentSandboxRestrictionSchema2,
|
|
22
22
|
AgentSandboxGradeSchema2,
|
|
23
23
|
AGENT_CODING_TOOL_NAMES
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-ybdq8kk2.js";
|
|
25
25
|
import {
|
|
26
26
|
AgentRuntimeHeadSchema2,
|
|
27
27
|
AgentStoredRunSchema2,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
} from "./index-snef22zr.js";
|
|
71
71
|
import {
|
|
72
72
|
assertPositiveSafeInteger
|
|
73
|
-
} from "./index-
|
|
73
|
+
} from "./index-gr0kxymw.js";
|
|
74
74
|
|
|
75
75
|
// src/agent-runtime/branch-contract.ts
|
|
76
76
|
import { z as z2 } from "zod";
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
toolErrorFromResult,
|
|
7
7
|
executeToolMethod
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-n3bm7zqq.js";
|
|
9
9
|
import {
|
|
10
10
|
assertToolExtensionCompatible,
|
|
11
11
|
projectToolSurface
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-669374qc.js";
|
|
13
13
|
import {
|
|
14
14
|
isRetryableStatus2
|
|
15
15
|
} from "./index-9pv126eh.js";
|
|
@@ -5,6 +5,10 @@ function assertSafeIntegerFrom(least, rule, name, value, errorType, options) {
|
|
|
5
5
|
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < least)
|
|
6
6
|
throw new errorType(`${name} ${rule}, received ${value}`);
|
|
7
7
|
}
|
|
8
|
+
function isPositiveSafeInteger(value) {
|
|
9
|
+
const least = 1;
|
|
10
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= least;
|
|
11
|
+
}
|
|
8
12
|
function assertPositiveSafeInteger(name, value, errorType = TypeError, options = {}) {
|
|
9
13
|
assertSafeIntegerFrom(1, "must be a positive safe integer", name, value, errorType, options);
|
|
10
14
|
}
|
|
@@ -12,4 +16,4 @@ function assertNonNegativeSafeInteger(name, value, errorType = TypeError, option
|
|
|
12
16
|
assertSafeIntegerFrom(0, "must be a non-negative safe integer", name, value, errorType, options);
|
|
13
17
|
}
|
|
14
18
|
|
|
15
|
-
export { assertPositiveSafeInteger, assertNonNegativeSafeInteger };
|
|
19
|
+
export { isPositiveSafeInteger, assertPositiveSafeInteger, assertNonNegativeSafeInteger };
|
|
@@ -19,12 +19,12 @@ import {
|
|
|
19
19
|
isAbortLikeError,
|
|
20
20
|
classifyUnixTransportRetry,
|
|
21
21
|
parseApiErrorBody
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-jcge9tx3.js";
|
|
23
23
|
import {
|
|
24
24
|
DEFAULT_STREAM_LINE_BYTES,
|
|
25
25
|
createBoundedLineDecoder,
|
|
26
26
|
readBoundedUtf8Lines
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-39rmc00v.js";
|
|
28
28
|
import {
|
|
29
29
|
inputIsQuery
|
|
30
30
|
} from "./index-xhzq2qvj.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./index-jj9228tt.js";
|
|
18
18
|
import {
|
|
19
19
|
assertNonNegativeSafeInteger
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-gr0kxymw.js";
|
|
21
21
|
import {
|
|
22
22
|
randomHex
|
|
23
23
|
} from "./index-c9d05kvt.js";
|
|
@@ -334,7 +334,7 @@ function assertExpectedOwnerUid(uid, caller) {
|
|
|
334
334
|
throw new TypeError(`[stitchkit] ${caller}: expectedOwnerUid must be a 32-bit unsigned integer (0..${MAX_POSIX_UID}), got ${String(uid)}`);
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function unixSocketDirectoryViolation(dir, stats, caller, expectedUid) {
|
|
338
338
|
if (stats.isSymbolicLink()) {
|
|
339
339
|
return `[stitchkit] ${caller}: unix socket directory "${dir}" must not be a symlink`;
|
|
340
340
|
}
|
|
@@ -357,7 +357,7 @@ function assertPrivateUnixSocketDirectory(socketPath, caller) {
|
|
|
357
357
|
if (stats === undefined) {
|
|
358
358
|
throw new Error(`[stitchkit] ${caller}: unix socket directory "${dir}" does not exist`);
|
|
359
359
|
}
|
|
360
|
-
const violation =
|
|
360
|
+
const violation = unixSocketDirectoryViolation(dir, stats, caller);
|
|
361
361
|
if (violation !== undefined)
|
|
362
362
|
throw new Error(violation);
|
|
363
363
|
}
|
|
@@ -383,7 +383,7 @@ function assertUnixSocketClientTarget(socketPath, caller = "createUnixClientTran
|
|
|
383
383
|
const dirStats = statForClientTarget(dir, "directory", caller, socketPath);
|
|
384
384
|
if (dirStats === undefined)
|
|
385
385
|
return;
|
|
386
|
-
const dirViolation =
|
|
386
|
+
const dirViolation = unixSocketDirectoryViolation(dir, dirStats, caller, requiredUid);
|
|
387
387
|
if (dirViolation !== undefined)
|
|
388
388
|
refuse(dirViolation);
|
|
389
389
|
const socketStats = statForClientTarget(socketPath, "path", caller, socketPath);
|
|
@@ -484,4 +484,4 @@ function bindUnixSocket2(socket, bind) {
|
|
|
484
484
|
return bound;
|
|
485
485
|
}
|
|
486
486
|
|
|
487
|
-
export { withUnixSocketLockSync, assertUnixSocketMode, unlinkUnixSocketIfMatching, unlinkUnixSocketIfOwned, assertUnixSocketPathLength, assertExpectedOwnerUid, assertPrivateUnixSocketDirectory, assertUnixSocketClientTarget, publishStagedUnixSocket, bindUnixSocket2 };
|
|
487
|
+
export { withUnixSocketLockSync, assertUnixSocketMode, unlinkUnixSocketIfMatching, unlinkUnixSocketIfOwned, assertUnixSocketPathLength, assertExpectedOwnerUid, unixSocketDirectoryViolation, assertPrivateUnixSocketDirectory, assertUnixSocketClientTarget, publishStagedUnixSocket, bindUnixSocket2 };
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
decodeJsonText,
|
|
8
8
|
parseJsonText,
|
|
9
9
|
validateJsonValue
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-21cfxc4z.js";
|
|
11
11
|
import {
|
|
12
12
|
messageOf
|
|
13
13
|
} from "./index-r9kq5ark.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./index-jj9228tt.js";
|
|
20
20
|
import {
|
|
21
21
|
assertPositiveSafeInteger
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-gr0kxymw.js";
|
|
23
23
|
|
|
24
24
|
// src/files/json-file-reading.ts
|
|
25
25
|
var VALUE_REFUSALS = new Set([
|