stitchkit 0.127.0 → 0.128.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 +137 -6
- package/dist/agent-executor/acp/v1-connect.d.ts +9 -1
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +8 -2
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-map.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +8 -0
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +4 -0
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/protocol.d.ts +20 -2
- package/dist/agent-executor/claude/protocol.d.ts.map +1 -1
- package/dist/agent-executor/claude/session.d.ts +2 -1
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude/transcript.d.ts +7 -4
- package/dist/agent-executor/claude/transcript.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/driver.d.ts +4 -0
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/driver.d.ts +4 -0
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/protocol.d.ts +26 -2
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/session.d.ts +3 -1
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/image-input.d.ts +71 -0
- package/dist/agent-executor/image-input.d.ts.map +1 -0
- package/dist/agent-executor/session-primitives.d.ts +0 -3
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-runtime/agent-tool.d.ts +21 -7
- package/dist/agent-runtime/agent-tool.d.ts.map +1 -1
- package/dist/agent-runtime/branch-contract.d.ts +1 -0
- package/dist/agent-runtime/branch-contract.d.ts.map +1 -1
- package/dist/agent-runtime/branch-identities.d.ts +5 -2
- package/dist/agent-runtime/branch-identities.d.ts.map +1 -1
- package/dist/agent-runtime/branch-messages.d.ts +9 -9
- package/dist/agent-runtime/branch-messages.d.ts.map +1 -1
- package/dist/agent-runtime/branch-observations.d.ts +45 -32
- package/dist/agent-runtime/branch-observations.d.ts.map +1 -1
- package/dist/agent-runtime/branch-provider.d.ts +12 -6
- package/dist/agent-runtime/branch-provider.d.ts.map +1 -1
- package/dist/agent-runtime/branch-source.d.ts +13 -1
- package/dist/agent-runtime/branch-source.d.ts.map +1 -1
- package/dist/agent-runtime/child-tools.d.ts +64 -0
- package/dist/agent-runtime/child-tools.d.ts.map +1 -1
- package/dist/agent-runtime/event-search-tools.d.ts +82 -5
- package/dist/agent-runtime/event-search-tools.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-attempt.d.ts +1 -1
- package/dist/agent-runtime/invocation-attempt.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-payload.d.ts +12 -0
- package/dist/agent-runtime/invocation-payload.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-read.d.ts +6 -3
- package/dist/agent-runtime/invocation-read.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-schema.d.ts +50 -8
- package/dist/agent-runtime/invocation-schema.d.ts.map +1 -1
- package/dist/agent-runtime/invocations.d.ts +20 -9
- package/dist/agent-runtime/invocations.d.ts.map +1 -1
- package/dist/agent-runtime/postgres.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-tools.d.ts +30 -0
- package/dist/agent-runtime/schedule-tools.d.ts.map +1 -1
- package/dist/agent-runtime/schemas-invocation-payload.d.ts +48 -0
- package/dist/agent-runtime/schemas-invocation-payload.d.ts.map +1 -0
- package/dist/agent-runtime/sql-events.d.ts.map +1 -1
- package/dist/agent-runtime/sql-session.d.ts +11 -0
- package/dist/agent-runtime/sql-session.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -1
- package/dist/agent-runtime/state-tools.d.ts +55 -0
- package/dist/agent-runtime/state-tools.d.ts.map +1 -1
- package/dist/agent-runtime/store-branch.d.ts.map +1 -1
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
- package/dist/agent-runtime/store-conformance-support.d.ts +10 -10
- package/dist/agent-runtime/store-create.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver-contract.d.ts +12 -0
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory-events.d.ts.map +1 -1
- package/dist/agent-runtime/store.d.ts +7 -0
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/declaration/declaration.d.ts +6 -3
- package/dist/declaration/declaration.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.d.ts +1 -1
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +23 -12
- package/dist/entrypoints/agent-executor/claude-sdk.js +26 -10
- package/dist/entrypoints/agent-executor/claude.js +35 -16
- package/dist/entrypoints/agent-executor/codex.js +81 -21
- package/dist/entrypoints/agent-executor.js +1 -1
- package/dist/entrypoints/agent-runtime/harness.js +5 -6
- package/dist/entrypoints/agent-runtime/openrouter.js +2 -2
- package/dist/entrypoints/agent-runtime/postgres.js +8 -3
- package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +4 -4
- package/dist/entrypoints/agent-runtime/sqlite/node.js +4 -4
- package/dist/entrypoints/agent-runtime/testing.js +6 -6
- package/dist/entrypoints/agent-runtime.d.ts +9 -7
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime.js +246 -199
- package/dist/entrypoints/application/diagnostic-journal.js +4 -4
- package/dist/entrypoints/application/directory-inbox.js +8 -8
- package/dist/entrypoints/cli/publish.js +8 -8
- package/dist/entrypoints/cli.js +10 -9
- package/dist/entrypoints/declaration.js +0 -1
- package/dist/entrypoints/files.js +40 -17
- package/dist/entrypoints/node.js +4 -4
- package/dist/entrypoints/observability.js +1 -1
- package/dist/entrypoints/process.js +1 -1
- package/dist/entrypoints/server.js +7 -7
- package/dist/entrypoints/service-host/macos.js +4 -4
- package/dist/entrypoints/service-host.d.ts +4 -1
- package/dist/entrypoints/service-host.d.ts.map +1 -1
- package/dist/entrypoints/service-host.js +831 -220
- package/dist/entrypoints/spend.js +1 -1
- package/dist/entrypoints/telegram.js +4 -4
- package/dist/entrypoints/tools/agent.js +4 -3
- package/dist/entrypoints/tools/invoker.js +3 -2
- package/dist/entrypoints/tools/mcp.js +4 -3
- package/dist/entrypoints/tools/toolkit.js +6 -5
- package/dist/entrypoints/tools.d.ts +1 -1
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +10 -8
- package/dist/files/directory-appearance.d.ts +20 -9
- package/dist/files/directory-appearance.d.ts.map +1 -1
- package/dist/files/polled-json.d.ts.map +1 -1
- package/dist/files/regular-file.d.ts +15 -5
- package/dist/files/regular-file.d.ts.map +1 -1
- package/dist/{index-z4k0hqp9.js → index-0gqs8ght.js} +106 -24
- package/dist/{index-caywx1c0.js → index-13dnv6d0.js} +107 -10
- package/dist/{index-a725ayvz.js → index-1qwrczr1.js} +1 -1
- package/dist/{index-xtkw9866.js → index-2c5w2d1d.js} +1 -1
- package/dist/{index-g1q7fwn9.js → index-2nwvn7m2.js} +1 -1
- package/dist/{index-4s2w4g37.js → index-3tnwtz38.js} +80 -2
- package/dist/{index-5e0zsbf7.js → index-4j8efqr3.js} +1 -1
- package/dist/{index-p1m9djt6.js → index-5v5vg85s.js} +1 -1
- package/dist/{index-x90w78yz.js → index-673drwkn.js} +23 -8
- package/dist/{index-7xp05h20.js → index-6wp4dn9d.js} +6 -6
- package/dist/{index-0hdm5sx6.js → index-8x22nprv.js} +6 -2
- package/dist/{index-j13gzgdv.js → index-bz3gn6cs.js} +8 -4
- package/dist/{index-d96c1n1q.js → index-c5gp2gh6.js} +20 -19
- package/dist/{index-wbnpa8z6.js → index-d54npte7.js} +4 -4
- package/dist/{index-kmbpej2y.js → index-emgrmavr.js} +102 -61
- package/dist/{index-bbzvrq66.js → index-g3e57qj6.js} +455 -202
- package/dist/index-gf92hc87.js +100 -0
- package/dist/{index-3djgv3ch.js → index-gzny6zsw.js} +25 -10
- package/dist/{index-3b31z0pc.js → index-hj1zq7mh.js} +12 -6
- package/dist/{index-8xr2eq99.js → index-jfecdk1e.js} +3 -3
- package/dist/{index-dvd1qdwa.js → index-ke02kxsr.js} +3 -3
- package/dist/{index-83n766x4.js → index-m18xm96h.js} +15 -9
- package/dist/{index-qnzhmk2s.js → index-n7f89hjw.js} +90 -47
- package/dist/{index-3agqmmrg.js → index-pn5b11ce.js} +7 -9
- package/dist/{index-3gwp8ez6.js → index-pwskmywy.js} +12 -17
- package/dist/{index-9wh98cpa.js → index-rxnyygke.js} +130 -90
- package/dist/{index-0djnptn8.js → index-rzeezh79.js} +10 -3
- package/dist/{index-nbv44x0x.js → index-s2e3h616.js} +137 -36
- package/dist/{index-5zwac8ft.js → index-t7wa7k12.js} +2 -2
- package/dist/{index-xypxnzhp.js → index-v1mxss62.js} +2 -2
- package/dist/index-vgzhw2zk.js +304 -0
- package/dist/{index-jrka9029.js → index-vmbxj75t.js} +2 -2
- package/dist/{index-j516jaaz.js → index-waa6t4zx.js} +49 -2
- package/dist/{index-fcw255hd.js → index-xv9jb84s.js} +2 -2
- package/dist/{index-dwa6pskj.js → index-y065r8g5.js} +82 -43
- package/dist/internal/bounded-file-confirm.d.ts +32 -0
- package/dist/internal/bounded-file-confirm.d.ts.map +1 -0
- package/dist/internal/bounded-file-read.d.ts +10 -7
- package/dist/internal/bounded-file-read.d.ts.map +1 -1
- package/dist/internal/file-observation.d.ts +5 -1
- package/dist/internal/file-observation.d.ts.map +1 -1
- package/dist/internal/process-instance.d.ts +8 -0
- package/dist/internal/process-instance.d.ts.map +1 -1
- package/dist/internal/unix-socket.d.ts +3 -1
- package/dist/internal/unix-socket.d.ts.map +1 -1
- package/dist/server/unix-client.d.ts +7 -0
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/service-host/systemd-inspect.d.ts +3 -1
- package/dist/service-host/systemd-inspect.d.ts.map +1 -1
- package/dist/service-host/systemd-render-shared.d.ts +64 -0
- package/dist/service-host/systemd-render-shared.d.ts.map +1 -0
- package/dist/service-host/systemd-render.d.ts +31 -26
- package/dist/service-host/systemd-render.d.ts.map +1 -1
- package/dist/service-host/systemd-timer-render.d.ts +31 -0
- package/dist/service-host/systemd-timer-render.d.ts.map +1 -0
- package/dist/service-host/systemd-timer-rollback.d.ts +26 -0
- package/dist/service-host/systemd-timer-rollback.d.ts.map +1 -0
- package/dist/service-host/systemd-timer.d.ts +82 -0
- package/dist/service-host/systemd-timer.d.ts.map +1 -0
- package/dist/service-host/systemd-unit-ops.d.ts +26 -0
- package/dist/service-host/systemd-unit-ops.d.ts.map +1 -0
- package/dist/service-host/systemd.d.ts +1 -1
- package/dist/service-host/systemd.d.ts.map +1 -1
- package/dist/tools/access.d.ts +30 -1
- package/dist/tools/access.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +2 -2
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args-scan.d.ts +5 -0
- package/dist/tools/cli/args-scan.d.ts.map +1 -1
- package/dist/tools/cli/args.d.ts +11 -5
- package/dist/tools/cli/args.d.ts.map +1 -1
- package/dist/tools/cli/invoke.d.ts +2 -1
- package/dist/tools/cli/invoke.d.ts.map +1 -1
- package/dist/tools/cli/notices.d.ts.map +1 -1
- package/dist/tools/cli/run-managed.d.ts.map +1 -1
- package/dist/tools/cli/session.d.ts.map +1 -1
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +2 -1
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +2 -3
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -3
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +5 -5
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts +2 -1
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +10 -6
- package/llms/agent-executor-claude-sdk.txt +1 -1
- package/llms/agent-executor-claude.txt +1 -1
- package/llms/agent-executor-codex.txt +1 -1
- package/llms/agent-runtime.4.txt +21 -9
- package/llms/cli.3.txt +4 -4
- package/llms/cli.txt +1 -0
- package/llms/declaration.txt +2 -2
- package/llms/files.txt +1 -1
- package/llms/node.txt +2 -2
- package/llms/server.5.txt +2 -2
- package/llms/service-host.txt +5 -5
- package/llms/stitchkit.txt +81 -77
- package/llms/tools.3.txt +3 -2
- package/llms/upgrading-0.128.0.txt +147 -0
- package/llms/upgrading.txt +1 -0
- package/llms-full.txt +272 -113
- package/llms.txt +14 -13
- package/package.json +1 -1
- package/dist/index-ajmtxsky.js +0 -193
- package/dist/index-ax3wns1a.js +0 -93
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {
|
|
2
|
+
rebuildObject,
|
|
3
|
+
mergeSchemas
|
|
4
|
+
} from "./index-360j58vb.js";
|
|
5
|
+
import {
|
|
6
|
+
toolErrorFromResult,
|
|
7
|
+
executeToolMethod
|
|
8
|
+
} from "./index-rxnyygke.js";
|
|
9
|
+
import {
|
|
10
|
+
assertToolExtensionCompatible,
|
|
11
|
+
projectToolSurface
|
|
12
|
+
} from "./index-3ypvpkwr.js";
|
|
13
|
+
import {
|
|
14
|
+
isRetryableStatus2
|
|
15
|
+
} from "./index-9pv126eh.js";
|
|
16
|
+
|
|
17
|
+
// src/tools/mount.ts
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
function applyExtend(base, extra) {
|
|
20
|
+
if (base instanceof z.ZodObject) {
|
|
21
|
+
assertToolExtensionCompatible(base, extra);
|
|
22
|
+
return rebuildObject(base, { ...extra, ...base.shape });
|
|
23
|
+
}
|
|
24
|
+
return z.intersection(z.object(extra), base);
|
|
25
|
+
}
|
|
26
|
+
function contractToolMountable(projected, extend) {
|
|
27
|
+
const method = projected.source;
|
|
28
|
+
const baseArgumentSchema = mergeSchemas(method.paramsSchema, method.inputSchema);
|
|
29
|
+
const argumentSchema = projected.shouldExtend && extend ? applyExtend(baseArgumentSchema, extend.schema) : baseArgumentSchema;
|
|
30
|
+
return {
|
|
31
|
+
method,
|
|
32
|
+
name: projected.name,
|
|
33
|
+
argumentSchema,
|
|
34
|
+
presentationSchema: projected.presentationSchema,
|
|
35
|
+
shouldExtend: projected.shouldExtend
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function collectTools2(service, transport, config = {}) {
|
|
39
|
+
const {
|
|
40
|
+
extend,
|
|
41
|
+
flattenUnionInput = false,
|
|
42
|
+
inputRecursionDepth,
|
|
43
|
+
assertNames = true
|
|
44
|
+
} = config;
|
|
45
|
+
const tools = [];
|
|
46
|
+
for (const projected of projectToolSurface({ services: [service] }, transport === "HTTP" ? "AGENT" : transport, {
|
|
47
|
+
extend,
|
|
48
|
+
flattenUnionInput,
|
|
49
|
+
inputRecursionDepth,
|
|
50
|
+
assertNames,
|
|
51
|
+
assertUniqueNames: false
|
|
52
|
+
})) {
|
|
53
|
+
if (projected.kind !== "contract")
|
|
54
|
+
continue;
|
|
55
|
+
tools.push(contractToolMountable(projected, extend));
|
|
56
|
+
}
|
|
57
|
+
return tools;
|
|
58
|
+
}
|
|
59
|
+
function createToolRunner(config) {
|
|
60
|
+
const extension = config.extend ? {
|
|
61
|
+
schema: z.object(config.extend.schema),
|
|
62
|
+
resolve: config.extend.resolve
|
|
63
|
+
} : undefined;
|
|
64
|
+
return async function runOneToolCall(tool, rawArgs, context, call) {
|
|
65
|
+
return executeToolMethod(tool.method, {
|
|
66
|
+
toolName: tool.name,
|
|
67
|
+
rawArgs,
|
|
68
|
+
context: { ...config.context, ...context, source: config.source }
|
|
69
|
+
}, {
|
|
70
|
+
hooks: config.hooks,
|
|
71
|
+
lifecycle: config.lifecycle,
|
|
72
|
+
coerceJson: config.coerceJsonArgs ?? true,
|
|
73
|
+
onOutputStrip: config.onOutputStrip ? (paths) => config.onOutputStrip?.(tool.name, paths) : undefined,
|
|
74
|
+
extension: tool.shouldExtend ? extension : undefined,
|
|
75
|
+
toolSurface: config.toolSurface ?? false,
|
|
76
|
+
finalizeOutput: call?.finalizeOutput
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function formatToolError(result, toolName, errorHint) {
|
|
81
|
+
const err = {
|
|
82
|
+
error: result.code,
|
|
83
|
+
retryable: result.retryable ?? isRetryableStatus2(toolErrorFromResult(result).status)
|
|
84
|
+
};
|
|
85
|
+
if (result.details)
|
|
86
|
+
err.details = result.details;
|
|
87
|
+
const hints = [];
|
|
88
|
+
if (result.hint)
|
|
89
|
+
hints.push(result.hint);
|
|
90
|
+
if (errorHint && toolName) {
|
|
91
|
+
const global = errorHint(toolName, result.code);
|
|
92
|
+
if (global)
|
|
93
|
+
hints.push(global);
|
|
94
|
+
}
|
|
95
|
+
if (hints.length > 0)
|
|
96
|
+
err._hint = hints.join(" ");
|
|
97
|
+
return err;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { contractToolMountable, collectTools2, createToolRunner, formatToolError };
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
machineIdentitySync,
|
|
3
3
|
readProcessInstanceSync
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-673drwkn.js";
|
|
5
5
|
import {
|
|
6
6
|
recordOwner,
|
|
7
7
|
readOwner,
|
|
8
8
|
diagnoseSync,
|
|
9
9
|
reclaimable,
|
|
10
10
|
OWNER_RECORD_BYTES
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-vmbxj75t.js";
|
|
12
12
|
import {
|
|
13
13
|
UnixClientTransportError2
|
|
14
14
|
} from "./index-cv9b7fz2.js";
|
|
15
15
|
import {
|
|
16
16
|
errnoOf
|
|
17
17
|
} from "./index-jj9228tt.js";
|
|
18
|
+
import {
|
|
19
|
+
assertNonNegativeSafeInteger
|
|
20
|
+
} from "./index-kzavdze2.js";
|
|
18
21
|
import {
|
|
19
22
|
randomHex
|
|
20
23
|
} from "./index-c9d05kvt.js";
|
|
@@ -322,15 +325,25 @@ function assertUnixSocketPathLength(socketPath, caller) {
|
|
|
322
325
|
throw new Error(`[stitchkit] ${caller}: unix socket path "${socketPath}" is ${bytes} bytes, exceeding the ${MAX_UNIX_SOCKET_PATH_BYTES}-byte portable sun_path limit (ENAMETOOLONG) — choose a shorter path`);
|
|
323
326
|
}
|
|
324
327
|
}
|
|
325
|
-
|
|
328
|
+
var MAX_POSIX_UID = 4294967295;
|
|
329
|
+
function assertExpectedOwnerUid(uid, caller) {
|
|
330
|
+
if (uid === undefined)
|
|
331
|
+
return;
|
|
332
|
+
assertNonNegativeSafeInteger(`[stitchkit] ${caller}: expectedOwnerUid`, uid);
|
|
333
|
+
if (uid > MAX_POSIX_UID) {
|
|
334
|
+
throw new TypeError(`[stitchkit] ${caller}: expectedOwnerUid must be a 32-bit unsigned integer (0..${MAX_POSIX_UID}), got ${String(uid)}`);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function directoryPrivacyViolation(dir, stats, caller, expectedUid) {
|
|
326
338
|
if (stats.isSymbolicLink()) {
|
|
327
339
|
return `[stitchkit] ${caller}: unix socket directory "${dir}" must not be a symlink`;
|
|
328
340
|
}
|
|
329
341
|
if (!stats.isDirectory()) {
|
|
330
342
|
return `[stitchkit] ${caller}: unix socket parent "${dir}" is not a directory`;
|
|
331
343
|
}
|
|
332
|
-
|
|
333
|
-
|
|
344
|
+
const requiredUid = expectedUid !== undefined ? expectedUid : typeof process.getuid === "function" ? process.getuid() : undefined;
|
|
345
|
+
if (requiredUid !== undefined && stats.uid !== requiredUid) {
|
|
346
|
+
return `[stitchkit] ${caller}: unix socket directory "${dir}" is owned by uid ${stats.uid}, expected ${requiredUid}`;
|
|
334
347
|
}
|
|
335
348
|
const mode = stats.mode & PERMISSION_BITS;
|
|
336
349
|
if ((mode & GROUP_OR_OTHER_WRITE_BITS) !== 0) {
|
|
@@ -358,7 +371,9 @@ function statForClientTarget(targetPath, label, caller, socketPath) {
|
|
|
358
371
|
throw new UnixClientTransportError2("UNIX_TARGET_REFUSED", `[stitchkit] ${caller}: failed to inspect unix socket ${label} "${targetPath}" (${code})`, "not-dispatched", { cause: error, socketPath });
|
|
359
372
|
}
|
|
360
373
|
}
|
|
361
|
-
function assertUnixSocketClientTarget(socketPath, caller = "createUnixClientTransport") {
|
|
374
|
+
function assertUnixSocketClientTarget(socketPath, caller = "createUnixClientTransport", expectedOwnerUid) {
|
|
375
|
+
assertExpectedOwnerUid(expectedOwnerUid, caller);
|
|
376
|
+
const requiredUid = expectedOwnerUid !== undefined ? expectedOwnerUid : typeof process.getuid === "function" ? process.getuid() : undefined;
|
|
362
377
|
const dir = dirname2(socketPath);
|
|
363
378
|
const refuse = (message) => {
|
|
364
379
|
throw new UnixClientTransportError2("UNIX_TARGET_REFUSED", message, "not-dispatched", {
|
|
@@ -368,7 +383,7 @@ function assertUnixSocketClientTarget(socketPath, caller = "createUnixClientTran
|
|
|
368
383
|
const dirStats = statForClientTarget(dir, "directory", caller, socketPath);
|
|
369
384
|
if (dirStats === undefined)
|
|
370
385
|
return;
|
|
371
|
-
const dirViolation = directoryPrivacyViolation(dir, dirStats, caller);
|
|
386
|
+
const dirViolation = directoryPrivacyViolation(dir, dirStats, caller, requiredUid);
|
|
372
387
|
if (dirViolation !== undefined)
|
|
373
388
|
refuse(dirViolation);
|
|
374
389
|
const socketStats = statForClientTarget(socketPath, "path", caller, socketPath);
|
|
@@ -380,8 +395,8 @@ function assertUnixSocketClientTarget(socketPath, caller = "createUnixClientTran
|
|
|
380
395
|
if (!socketStats.isSocket()) {
|
|
381
396
|
refuse(`[stitchkit] ${caller}: "${socketPath}" is not a unix socket`);
|
|
382
397
|
}
|
|
383
|
-
if (
|
|
384
|
-
refuse(`[stitchkit] ${caller}: unix socket "${socketPath}" is owned by uid ${socketStats.uid}, expected ${
|
|
398
|
+
if (requiredUid !== undefined && socketStats.uid !== requiredUid) {
|
|
399
|
+
refuse(`[stitchkit] ${caller}: unix socket "${socketPath}" is owned by uid ${socketStats.uid}, expected ${requiredUid}`);
|
|
385
400
|
}
|
|
386
401
|
}
|
|
387
402
|
function chooseStagingSocketName(dir, targetPath, platform = process.platform) {
|
|
@@ -469,4 +484,4 @@ function bindUnixSocket2(socket, bind) {
|
|
|
469
484
|
return bound;
|
|
470
485
|
}
|
|
471
486
|
|
|
472
|
-
export { withUnixSocketLockSync, assertUnixSocketMode, unlinkUnixSocketIfMatching, unlinkUnixSocketIfOwned, assertUnixSocketPathLength, assertPrivateUnixSocketDirectory, assertUnixSocketClientTarget, publishStagedUnixSocket, bindUnixSocket2 };
|
|
487
|
+
export { withUnixSocketLockSync, assertUnixSocketMode, unlinkUnixSocketIfMatching, unlinkUnixSocketIfOwned, assertUnixSocketPathLength, assertExpectedOwnerUid, assertPrivateUnixSocketDirectory, assertUnixSocketClientTarget, publishStagedUnixSocket, bindUnixSocket2 };
|
|
@@ -2,12 +2,16 @@ import {
|
|
|
2
2
|
localVerdict
|
|
3
3
|
} from "./index-dsa676h8.js";
|
|
4
4
|
import {
|
|
5
|
+
inspectOnlyError,
|
|
6
|
+
resolveToolAccess,
|
|
5
7
|
toolResultFromError,
|
|
6
8
|
toolCauseFromResult,
|
|
7
|
-
isToolExecutionControlError2
|
|
9
|
+
isToolExecutionControlError2
|
|
10
|
+
} from "./index-rxnyygke.js";
|
|
11
|
+
import {
|
|
8
12
|
createToolRunner,
|
|
9
13
|
formatToolError
|
|
10
|
-
} from "./index-
|
|
14
|
+
} from "./index-gf92hc87.js";
|
|
11
15
|
import {
|
|
12
16
|
resolveRuntimeToolCall
|
|
13
17
|
} from "./index-eh71zr32.js";
|
|
@@ -16,10 +20,7 @@ import {
|
|
|
16
20
|
} from "./index-1psbyyhj.js";
|
|
17
21
|
import {
|
|
18
22
|
collectToolSurface
|
|
19
|
-
} from "./index-
|
|
20
|
-
import {
|
|
21
|
-
resolveToolAccess
|
|
22
|
-
} from "./index-ax3wns1a.js";
|
|
23
|
+
} from "./index-4j8efqr3.js";
|
|
23
24
|
import {
|
|
24
25
|
agentPresenterOf
|
|
25
26
|
} from "./index-7csn6pva.js";
|
|
@@ -59,6 +60,11 @@ function mountAgent2(services, config) {
|
|
|
59
60
|
validate: async (value) => isRecord(value) ? { success: true, value } : { success: false, error: new Error("Tool arguments must be an object") }
|
|
60
61
|
});
|
|
61
62
|
const execute = async (rawArgs, options) => {
|
|
63
|
+
const inspectErr = inspectOnlyError(lifecycle);
|
|
64
|
+
if (inspectErr) {
|
|
65
|
+
const result = toolResultFromError(inspectErr);
|
|
66
|
+
throw new AgentToolError2(formatToolError(result, mountable.name, config.errorHint), toolCauseFromResult(result));
|
|
67
|
+
}
|
|
62
68
|
const args = isRecord(rawArgs) ? rawArgs : {};
|
|
63
69
|
const runtimeCall = resolveRuntimeToolCall(options.context, options.toolCallId, options.abortSignal);
|
|
64
70
|
const durability = runtimeCall?.durability ?? config.durability?.(options.toolCallId, options.abortSignal);
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
writeAllBytes,
|
|
10
10
|
writeAtomicFileStaged
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-t7wa7k12.js";
|
|
12
12
|
import {
|
|
13
13
|
AtomicFilePublicationError2
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-2c5w2d1d.js";
|
|
15
15
|
import {
|
|
16
16
|
BoundedFileReadError,
|
|
17
17
|
readBoundedFile
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-s2e3h616.js";
|
|
19
19
|
import {
|
|
20
20
|
errnoOf
|
|
21
21
|
} from "./index-jj9228tt.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
machineIdentity,
|
|
3
3
|
readProcessInstance
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-673drwkn.js";
|
|
5
5
|
import {
|
|
6
6
|
recordOwner,
|
|
7
7
|
readOwner,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
reclaimable,
|
|
10
10
|
LockRecordError,
|
|
11
11
|
readLockRecord
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-vmbxj75t.js";
|
|
13
13
|
import {
|
|
14
14
|
AtomicFilePublicationError2,
|
|
15
15
|
publishAtomicFile
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-2c5w2d1d.js";
|
|
17
17
|
import {
|
|
18
18
|
errnoOf
|
|
19
19
|
} from "./index-jj9228tt.js";
|
|
@@ -5,13 +5,12 @@ import {
|
|
|
5
5
|
toJsonSchema
|
|
6
6
|
} from "./index-ngwf1s3c.js";
|
|
7
7
|
import {
|
|
8
|
+
inspectOnlyError,
|
|
9
|
+
resolveToolAccess,
|
|
8
10
|
parseToolCallArguments,
|
|
9
11
|
toolResultFromError,
|
|
10
|
-
observed
|
|
11
|
-
|
|
12
|
-
createToolRunner,
|
|
13
|
-
formatToolError
|
|
14
|
-
} from "./index-9wh98cpa.js";
|
|
12
|
+
observed
|
|
13
|
+
} from "./index-rxnyygke.js";
|
|
15
14
|
import {
|
|
16
15
|
toolSurfaceOutputSchema,
|
|
17
16
|
staticInputRounds,
|
|
@@ -20,6 +19,11 @@ import {
|
|
|
20
19
|
presentationMetadata,
|
|
21
20
|
prepareProjectedMcpTools
|
|
22
21
|
} from "./index-3ypvpkwr.js";
|
|
22
|
+
import {
|
|
23
|
+
collectTools2,
|
|
24
|
+
createToolRunner,
|
|
25
|
+
formatToolError
|
|
26
|
+
} from "./index-gf92hc87.js";
|
|
23
27
|
import {
|
|
24
28
|
publishedToolAnnotations
|
|
25
29
|
} from "./index-0x4mnwg5.js";
|
|
@@ -47,10 +51,7 @@ import {
|
|
|
47
51
|
} from "./index-tazm4dxf.js";
|
|
48
52
|
import {
|
|
49
53
|
collectToolSurface
|
|
50
|
-
} from "./index-
|
|
51
|
-
import {
|
|
52
|
-
resolveToolAccess
|
|
53
|
-
} from "./index-ax3wns1a.js";
|
|
54
|
+
} from "./index-4j8efqr3.js";
|
|
54
55
|
import {
|
|
55
56
|
runWithRequestContext2,
|
|
56
57
|
getRequestContext2
|
|
@@ -582,6 +583,9 @@ function registerMcpTool(server, presentation, descriptor, config) {
|
|
|
582
583
|
const { name } = presentation;
|
|
583
584
|
const format = config.formatResult;
|
|
584
585
|
server.registerTool(name, stampToolRegistration(toolConfig, config.catalog), async (rawArgs, mcpContext) => stampToolResult(await runInMcpRequestContext(mcpContext, name, async () => {
|
|
586
|
+
const inspectErr = inspectOnlyError(config.lifecycle);
|
|
587
|
+
if (inspectErr)
|
|
588
|
+
return format(toolResultFromError(inspectErr), "none", name);
|
|
585
589
|
const args = isRecord(rawArgs) ? rawArgs : {};
|
|
586
590
|
const startedAt = Date.now();
|
|
587
591
|
try {
|
|
@@ -688,6 +692,7 @@ function mountPreparedRuntimeMcp(server, tools, config) {
|
|
|
688
692
|
catalog: config.catalog,
|
|
689
693
|
multiRoundRuntime: config.multiRoundRuntime,
|
|
690
694
|
hooks: config.hooks,
|
|
695
|
+
lifecycle: config.lifecycle,
|
|
691
696
|
context: config.context
|
|
692
697
|
});
|
|
693
698
|
}
|
|
@@ -741,6 +746,7 @@ function mountPreparedMcp(mcpServer, prepared, config) {
|
|
|
741
746
|
catalog: config.catalog,
|
|
742
747
|
multiRoundRuntime: config.multiRoundRuntime,
|
|
743
748
|
hooks: config.hooks,
|
|
749
|
+
lifecycle,
|
|
744
750
|
context: config.context
|
|
745
751
|
});
|
|
746
752
|
}
|
|
@@ -11,12 +11,16 @@ import {
|
|
|
11
11
|
AgentSnapshotSchema2
|
|
12
12
|
} from "./index-bn2baakz.js";
|
|
13
13
|
import {
|
|
14
|
+
InvocationPayloadSchema,
|
|
15
|
+
InvocationExpiredPayloadSchema,
|
|
16
|
+
PurgeInvocationPayloadsInputSchema2,
|
|
14
17
|
ModelInvocationTraceSchema2,
|
|
15
18
|
CompletionInvocationInputSchema2,
|
|
16
19
|
InvocationCallerSchema,
|
|
17
20
|
InvocationStartedSchema,
|
|
18
21
|
ModelInvocationRecordSchema2,
|
|
19
|
-
|
|
22
|
+
InvocationStoredPayloadSchema,
|
|
23
|
+
ModelInvocationPayloadReadSchema2,
|
|
20
24
|
isModelInvocationRecord,
|
|
21
25
|
createToolChronology,
|
|
22
26
|
advanceToolChronology,
|
|
@@ -24,7 +28,7 @@ import {
|
|
|
24
28
|
isAssistantHistoryEvidence2,
|
|
25
29
|
isCompleteAgentHistoryTurn,
|
|
26
30
|
assistantStatus
|
|
27
|
-
} from "./index-
|
|
31
|
+
} from "./index-vgzhw2zk.js";
|
|
28
32
|
import {
|
|
29
33
|
withStoreRetries,
|
|
30
34
|
AgentRuntimeConflictError2,
|
|
@@ -59,7 +63,7 @@ import {
|
|
|
59
63
|
hasProviderOrigin,
|
|
60
64
|
markProviderStream,
|
|
61
65
|
wrapInvocationModel
|
|
62
|
-
} from "./index-
|
|
66
|
+
} from "./index-emgrmavr.js";
|
|
63
67
|
import {
|
|
64
68
|
AGENT_TOOL_PROGRESS_MESSAGE_MAX2,
|
|
65
69
|
agentDurableEventId2
|
|
@@ -67,7 +71,7 @@ import {
|
|
|
67
71
|
import {
|
|
68
72
|
ToolExecutionControlError2,
|
|
69
73
|
isToolExecutionControlError2
|
|
70
|
-
} from "./index-
|
|
74
|
+
} from "./index-rxnyygke.js";
|
|
71
75
|
import {
|
|
72
76
|
contractOperationEffects2
|
|
73
77
|
} from "./index-werjqesf.js";
|
|
@@ -93,7 +97,7 @@ import {
|
|
|
93
97
|
} from "./index-r9kq5ark.js";
|
|
94
98
|
import {
|
|
95
99
|
listContractToolNames2
|
|
96
|
-
} from "./index-
|
|
100
|
+
} from "./index-pn5b11ce.js";
|
|
97
101
|
import {
|
|
98
102
|
AgentToolError2,
|
|
99
103
|
isAgentToolError2
|
|
@@ -595,6 +599,27 @@ async function readInvocationRecords(store, input) {
|
|
|
595
599
|
...page.nextSeq !== undefined && { nextSeq: page.nextSeq }
|
|
596
600
|
};
|
|
597
601
|
}
|
|
602
|
+
function decodeStoredPayload(payloads, conversationId, raw) {
|
|
603
|
+
const expired = InvocationExpiredPayloadSchema.safeParse(raw);
|
|
604
|
+
if (expired.success) {
|
|
605
|
+
return ModelInvocationPayloadReadSchema2.parse({
|
|
606
|
+
status: "expired",
|
|
607
|
+
artifactId: expired.data.artifactId,
|
|
608
|
+
sha256: expired.data.sha256,
|
|
609
|
+
bytes: expired.data.bytes,
|
|
610
|
+
expiredAt: expired.data.expiredAt
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
const live = InvocationPayloadSchema.parse(raw);
|
|
614
|
+
const payload = payloads.decrypt(conversationId, live);
|
|
615
|
+
return ModelInvocationPayloadReadSchema2.parse({
|
|
616
|
+
status: "available",
|
|
617
|
+
artifactId: live.artifactId,
|
|
618
|
+
sha256: live.sha256,
|
|
619
|
+
bytes: live.bytes,
|
|
620
|
+
payload
|
|
621
|
+
});
|
|
622
|
+
}
|
|
598
623
|
async function readInvocationPayload(store, payloads, input) {
|
|
599
624
|
const keyed = await store.findEventOnce?.({
|
|
600
625
|
conversationId: input.conversationId,
|
|
@@ -602,7 +627,7 @@ async function readInvocationPayload(store, payloads, input) {
|
|
|
602
627
|
key: input.artifactId
|
|
603
628
|
});
|
|
604
629
|
if (keyed)
|
|
605
|
-
return payloads
|
|
630
|
+
return decodeStoredPayload(payloads, input.conversationId, keyed.payload);
|
|
606
631
|
let fromSeq;
|
|
607
632
|
do {
|
|
608
633
|
const page = await store.readEvents({
|
|
@@ -613,9 +638,10 @@ async function readInvocationPayload(store, payloads, input) {
|
|
|
613
638
|
for (const event of page.items) {
|
|
614
639
|
if (event.kind !== "provider/payload")
|
|
615
640
|
continue;
|
|
616
|
-
const
|
|
617
|
-
if (
|
|
618
|
-
return payloads
|
|
641
|
+
const stored = InvocationStoredPayloadSchema.parse(event.payload);
|
|
642
|
+
if (stored.artifactId === input.artifactId) {
|
|
643
|
+
return decodeStoredPayload(payloads, input.conversationId, stored);
|
|
644
|
+
}
|
|
619
645
|
}
|
|
620
646
|
fromSeq = page.nextSeq;
|
|
621
647
|
} while (fromSeq !== undefined);
|
|
@@ -655,6 +681,46 @@ async function generateWithFallback(models, writer, input, abortSignal) {
|
|
|
655
681
|
}
|
|
656
682
|
throw new Error("No completion model attempt available");
|
|
657
683
|
}
|
|
684
|
+
function finishInvocation(writer, status, failure) {
|
|
685
|
+
return writer.append({
|
|
686
|
+
...writer.identity,
|
|
687
|
+
type: "invocation/finished",
|
|
688
|
+
status,
|
|
689
|
+
...failure && { failure }
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
async function runCompletion(config, payloads, writer, input, signal) {
|
|
693
|
+
const invocationId = writer.identity.invocationId;
|
|
694
|
+
const deadline = AbortSignal.timeout(input.timeoutMs);
|
|
695
|
+
const { signal: abortSignal, release } = linkAbortSignals(signal, deadline);
|
|
696
|
+
let text;
|
|
697
|
+
try {
|
|
698
|
+
text = await generateWithFallback(config.models, writer, input, abortSignal);
|
|
699
|
+
} catch (error) {
|
|
700
|
+
const status = abortSignal.aborted ? "cancelled" : "failed";
|
|
701
|
+
release();
|
|
702
|
+
try {
|
|
703
|
+
const artifact = await payloads.write(writer.identity, { error });
|
|
704
|
+
await finishInvocation(writer, status, {
|
|
705
|
+
artifactId: artifact.artifactId,
|
|
706
|
+
payloadSha256: artifact.sha256
|
|
707
|
+
});
|
|
708
|
+
} catch (receiptError) {
|
|
709
|
+
writer.receiptErrors.push(receiptError);
|
|
710
|
+
await finishInvocation(writer, status).catch((appendError) => {
|
|
711
|
+
writer.receiptErrors.push(appendError);
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
return withReceipt({ invocationId, outcome: status }, writer);
|
|
715
|
+
}
|
|
716
|
+
release();
|
|
717
|
+
try {
|
|
718
|
+
await finishInvocation(writer, "succeeded");
|
|
719
|
+
} catch (receiptError) {
|
|
720
|
+
writer.receiptErrors.push(receiptError);
|
|
721
|
+
}
|
|
722
|
+
return withReceipt({ invocationId, outcome: "succeeded", text }, writer);
|
|
723
|
+
}
|
|
658
724
|
function createModelInvocationLedger2(config) {
|
|
659
725
|
const { store } = config;
|
|
660
726
|
const appendOnce = store.appendEventOnce?.bind(store);
|
|
@@ -714,12 +780,6 @@ function createModelInvocationLedger2(config) {
|
|
|
714
780
|
};
|
|
715
781
|
return { writer, duplicate: admission.outcome === "duplicate" };
|
|
716
782
|
};
|
|
717
|
-
const finish = (writer, status, failure) => writer.append({
|
|
718
|
-
...writer.identity,
|
|
719
|
-
type: "invocation/finished",
|
|
720
|
-
status,
|
|
721
|
-
...failure && { failure }
|
|
722
|
-
});
|
|
723
783
|
const ledger = {
|
|
724
784
|
async complete(rawInput, context, signal) {
|
|
725
785
|
const input = CompletionInvocationInputSchema2.parse(rawInput);
|
|
@@ -732,38 +792,9 @@ function createModelInvocationLedger2(config) {
|
|
|
732
792
|
requested: input,
|
|
733
793
|
models: input.models
|
|
734
794
|
});
|
|
735
|
-
const invocationId = writer.identity.invocationId;
|
|
736
795
|
if (duplicate)
|
|
737
|
-
return { invocationId, outcome: "duplicate" };
|
|
738
|
-
|
|
739
|
-
const { signal: abortSignal, release } = linkAbortSignals(signal, deadline);
|
|
740
|
-
let text;
|
|
741
|
-
try {
|
|
742
|
-
text = await generateWithFallback(config.models, writer, input, abortSignal);
|
|
743
|
-
} catch (error) {
|
|
744
|
-
const status = abortSignal.aborted ? "cancelled" : "failed";
|
|
745
|
-
release();
|
|
746
|
-
try {
|
|
747
|
-
const artifact = await payloads.write(writer.identity, { error });
|
|
748
|
-
await finish(writer, status, {
|
|
749
|
-
artifactId: artifact.artifactId,
|
|
750
|
-
payloadSha256: artifact.sha256
|
|
751
|
-
});
|
|
752
|
-
} catch (receiptError) {
|
|
753
|
-
writer.receiptErrors.push(receiptError);
|
|
754
|
-
await finish(writer, status).catch((error) => {
|
|
755
|
-
writer.receiptErrors.push(error);
|
|
756
|
-
});
|
|
757
|
-
}
|
|
758
|
-
return withReceipt({ invocationId, outcome: status }, writer);
|
|
759
|
-
}
|
|
760
|
-
release();
|
|
761
|
-
try {
|
|
762
|
-
await finish(writer, "succeeded");
|
|
763
|
-
} catch (receiptError) {
|
|
764
|
-
writer.receiptErrors.push(receiptError);
|
|
765
|
-
}
|
|
766
|
-
return withReceipt({ invocationId, outcome: "succeeded", text }, writer);
|
|
796
|
+
return { invocationId: writer.identity.invocationId, outcome: "duplicate" };
|
|
797
|
+
return runCompletion(config, payloads, writer, input, signal);
|
|
767
798
|
},
|
|
768
799
|
async read(rawInput, context) {
|
|
769
800
|
const input = InvocationReadInputSchema.parse(rawInput);
|
|
@@ -777,6 +808,18 @@ function createModelInvocationLedger2(config) {
|
|
|
777
808
|
action: "read-payload"
|
|
778
809
|
});
|
|
779
810
|
return readInvocationPayload(store, payloads, input);
|
|
811
|
+
},
|
|
812
|
+
async purgePayloads(rawInput, context) {
|
|
813
|
+
const input = PurgeInvocationPayloadsInputSchema2.parse(rawInput);
|
|
814
|
+
await authorize({
|
|
815
|
+
context,
|
|
816
|
+
...input.conversationId !== undefined && { conversationId: input.conversationId },
|
|
817
|
+
action: "purge-payloads"
|
|
818
|
+
});
|
|
819
|
+
if (!store.purgeExpiredPayloads) {
|
|
820
|
+
throw new TypeError("Model invocation payload purge requires store.purgeExpiredPayloads");
|
|
821
|
+
}
|
|
822
|
+
return store.purgeExpiredPayloads(input);
|
|
780
823
|
}
|
|
781
824
|
};
|
|
782
825
|
agentBindings.set(ledger, {
|
|
@@ -799,7 +842,7 @@ function createModelInvocationLedger2(config) {
|
|
|
799
842
|
});
|
|
800
843
|
return {
|
|
801
844
|
wrap: (selected, step, override) => wrapInvocationModel(writer, selected, step, override),
|
|
802
|
-
finish: (status) =>
|
|
845
|
+
finish: (status) => finishInvocation(writer, status)
|
|
803
846
|
};
|
|
804
847
|
}
|
|
805
848
|
});
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TOOL_TRANSPORTS2
|
|
3
3
|
} from "./index-yt1gg11x.js";
|
|
4
|
+
import {
|
|
5
|
+
projectToolSurface
|
|
6
|
+
} from "./index-3ypvpkwr.js";
|
|
4
7
|
import {
|
|
5
8
|
contractOnlyService
|
|
6
9
|
} from "./index-wa6h4tz6.js";
|
|
7
|
-
import {
|
|
8
|
-
collectToolSurface
|
|
9
|
-
} from "./index-5e0zsbf7.js";
|
|
10
10
|
|
|
11
11
|
// src/tools/list-names.ts
|
|
12
12
|
function listToolNames2(surface) {
|
|
13
13
|
const entries = new Map;
|
|
14
14
|
for (const transport of TOOL_TRANSPORTS2) {
|
|
15
|
-
for (const entry of
|
|
16
|
-
surface,
|
|
17
|
-
transport,
|
|
15
|
+
for (const entry of projectToolSurface(surface, transport, {
|
|
18
16
|
assertNames: false,
|
|
19
17
|
assertUniqueNames: false
|
|
20
18
|
})) {
|
|
21
|
-
const id = `${entry.kind}\x00${entry.
|
|
19
|
+
const id = `${entry.kind}\x00${entry.serviceName}\x00${entry.action}`;
|
|
22
20
|
const existing = entries.get(id);
|
|
23
21
|
if (existing) {
|
|
24
22
|
existing.expose.push(transport);
|
|
25
23
|
} else {
|
|
26
24
|
entries.set(id, {
|
|
27
25
|
kind: entry.kind,
|
|
28
|
-
name: entry.
|
|
29
|
-
service: entry.
|
|
26
|
+
name: entry.name,
|
|
27
|
+
service: entry.serviceName,
|
|
30
28
|
method: entry.action,
|
|
31
29
|
expose: [transport]
|
|
32
30
|
});
|