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
|
@@ -52,6 +52,8 @@ import {
|
|
|
52
52
|
ProviderJournalResponseSchema
|
|
53
53
|
} from "./index-9xr44d2g.js";
|
|
54
54
|
import {
|
|
55
|
+
PurgeInvocationPayloadsInputSchema2,
|
|
56
|
+
PurgeInvocationPayloadsResultSchema2,
|
|
55
57
|
InvocationStartedSchema,
|
|
56
58
|
InvocationRequestSchema,
|
|
57
59
|
InvocationResponseSchema,
|
|
@@ -59,7 +61,7 @@ import {
|
|
|
59
61
|
InvocationPayloadReceiptSchema,
|
|
60
62
|
isModelInvocationRecord,
|
|
61
63
|
assistantStatus
|
|
62
|
-
} from "./index-
|
|
64
|
+
} from "./index-vgzhw2zk.js";
|
|
63
65
|
import {
|
|
64
66
|
StepEventPayloadSchema,
|
|
65
67
|
ParkEventPayloadSchema,
|
|
@@ -148,7 +150,7 @@ var BRANCH_RUNTIME_REFERENCE_KEYS = [
|
|
|
148
150
|
];
|
|
149
151
|
var BranchApplicationKeySchema = z2.object({
|
|
150
152
|
key: z2.enum(BRANCH_RUNTIME_REFERENCE_KEYS),
|
|
151
|
-
sourceIdentity: z2.enum(["refuse", "retain"]).default("refuse")
|
|
153
|
+
sourceIdentity: z2.enum(["refuse", "retain", "rekey-spill"]).default("refuse")
|
|
152
154
|
}).strict();
|
|
153
155
|
var BranchApplicationKeysSchema = z2.array(BranchApplicationKeySchema).superRefine((keys, ctx) => {
|
|
154
156
|
const names = keys.map((entry) => entry.key);
|
|
@@ -201,10 +203,34 @@ var AgentConversationBranchPlanSchema2 = z2.object({
|
|
|
201
203
|
}).strict();
|
|
202
204
|
|
|
203
205
|
// src/agent-runtime/agent-tool.ts
|
|
204
|
-
function
|
|
206
|
+
function defineAgentToolDescriptor(descriptor) {
|
|
207
|
+
const identity = Object.freeze({
|
|
208
|
+
...descriptor.identity,
|
|
209
|
+
...descriptor.identity.meta !== undefined && {
|
|
210
|
+
meta: Object.freeze({ ...descriptor.identity.meta })
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
const expose = Object.freeze(["AGENT"]);
|
|
214
|
+
return Object.freeze({
|
|
215
|
+
...descriptor,
|
|
216
|
+
identity,
|
|
217
|
+
expose
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
function bindAgentTool(descriptor, handler) {
|
|
205
221
|
return {
|
|
206
|
-
|
|
207
|
-
|
|
222
|
+
name: descriptor.name,
|
|
223
|
+
description: descriptor.description,
|
|
224
|
+
identity: {
|
|
225
|
+
...descriptor.identity,
|
|
226
|
+
...descriptor.identity.meta !== undefined && {
|
|
227
|
+
meta: { ...descriptor.identity.meta }
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
input: descriptor.input,
|
|
231
|
+
output: descriptor.output,
|
|
232
|
+
expose: descriptor.expose,
|
|
233
|
+
handler: (context) => handler(context)
|
|
208
234
|
};
|
|
209
235
|
}
|
|
210
236
|
|
|
@@ -952,18 +978,47 @@ var TraceInputSchema = z10.object({
|
|
|
952
978
|
limit: z10.int().positive().max(1000).default(100)
|
|
953
979
|
}).strict();
|
|
954
980
|
var TraceOutputSchema = z10.object({ events: z10.array(EventOutputSchema), nextSeq: z10.number().optional() }).strict();
|
|
981
|
+
var SEARCH_DESCRIPTOR = defineAgentToolDescriptor({
|
|
982
|
+
name: AGENT_EVENT_SEARCH_TOOL_NAMES.search,
|
|
983
|
+
description: "Search authorized durable conversation events and return exact addresses.",
|
|
984
|
+
identity: { serviceName: "agent-events", action: "search", method: "POST" },
|
|
985
|
+
input: SearchInputSchema,
|
|
986
|
+
output: SearchOutputSchema,
|
|
987
|
+
expose: ["AGENT"]
|
|
988
|
+
});
|
|
989
|
+
var TRACE_DESCRIPTOR = defineAgentToolDescriptor({
|
|
990
|
+
name: AGENT_EVENT_SEARCH_TOOL_NAMES.trace,
|
|
991
|
+
description: "Read a bounded contiguous slice of this conversation event trace.",
|
|
992
|
+
identity: { serviceName: "agent-events", action: "trace", method: "GET" },
|
|
993
|
+
input: TraceInputSchema,
|
|
994
|
+
output: TraceOutputSchema,
|
|
995
|
+
expose: ["AGENT"]
|
|
996
|
+
});
|
|
997
|
+
var EVENT_DESCRIPTOR = defineAgentToolDescriptor({
|
|
998
|
+
name: AGENT_EVENT_SEARCH_TOOL_NAMES.event,
|
|
999
|
+
description: "Read one durable event by exact conversation and sequence address.",
|
|
1000
|
+
identity: { serviceName: "agent-events", action: "read", method: "GET" },
|
|
1001
|
+
input: EventAddressSchema,
|
|
1002
|
+
output: EventOutputSchema,
|
|
1003
|
+
expose: ["AGENT"]
|
|
1004
|
+
});
|
|
1005
|
+
var AGENT_EVENT_SEARCH_TOOL_DESCRIPTORS2 = Object.freeze([
|
|
1006
|
+
SEARCH_DESCRIPTOR,
|
|
1007
|
+
TRACE_DESCRIPTOR,
|
|
1008
|
+
EVENT_DESCRIPTOR
|
|
1009
|
+
]);
|
|
955
1010
|
var AGENT_EVENT_SEARCH_TOOL_SCHEMAS = {
|
|
956
|
-
[
|
|
957
|
-
input:
|
|
958
|
-
output:
|
|
1011
|
+
[SEARCH_DESCRIPTOR.name]: {
|
|
1012
|
+
input: SEARCH_DESCRIPTOR.input,
|
|
1013
|
+
output: SEARCH_DESCRIPTOR.output
|
|
959
1014
|
},
|
|
960
|
-
[
|
|
961
|
-
input:
|
|
962
|
-
output:
|
|
1015
|
+
[TRACE_DESCRIPTOR.name]: {
|
|
1016
|
+
input: TRACE_DESCRIPTOR.input,
|
|
1017
|
+
output: TRACE_DESCRIPTOR.output
|
|
963
1018
|
},
|
|
964
|
-
[
|
|
965
|
-
input:
|
|
966
|
-
output:
|
|
1019
|
+
[EVENT_DESCRIPTOR.name]: {
|
|
1020
|
+
input: EVENT_DESCRIPTOR.input,
|
|
1021
|
+
output: EVENT_DESCRIPTOR.output
|
|
967
1022
|
}
|
|
968
1023
|
};
|
|
969
1024
|
function createAgentEventSearchTools2(config) {
|
|
@@ -998,55 +1053,31 @@ function createAgentEventSearchTools2(config) {
|
|
|
998
1053
|
};
|
|
999
1054
|
};
|
|
1000
1055
|
return [
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
input: SearchInputSchema,
|
|
1006
|
-
output: SearchOutputSchema,
|
|
1007
|
-
expose: ["AGENT"],
|
|
1008
|
-
handler: async ({ input: request }) => ({
|
|
1009
|
-
results: [
|
|
1010
|
-
...await input.search({
|
|
1011
|
-
requestingConversationId: input.conversationId,
|
|
1012
|
-
...request
|
|
1013
|
-
})
|
|
1014
|
-
]
|
|
1015
|
-
})
|
|
1016
|
-
}),
|
|
1017
|
-
defineAgentTool({
|
|
1018
|
-
name: AGENT_EVENT_SEARCH_TOOL_NAMES.trace,
|
|
1019
|
-
description: "Read a bounded contiguous slice of this conversation event trace.",
|
|
1020
|
-
identity: { serviceName: "agent-events", action: "trace", method: "GET" },
|
|
1021
|
-
input: TraceInputSchema,
|
|
1022
|
-
output: TraceOutputSchema,
|
|
1023
|
-
expose: ["AGENT"],
|
|
1024
|
-
handler: async ({ input: request }) => {
|
|
1025
|
-
const page = await input.store.readEvents({
|
|
1026
|
-
conversationId: input.conversationId,
|
|
1056
|
+
bindAgentTool(SEARCH_DESCRIPTOR, async ({ input: request }) => ({
|
|
1057
|
+
results: [
|
|
1058
|
+
...await input.search({
|
|
1059
|
+
requestingConversationId: input.conversationId,
|
|
1027
1060
|
...request
|
|
1028
|
-
})
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1061
|
+
})
|
|
1062
|
+
]
|
|
1063
|
+
})),
|
|
1064
|
+
bindAgentTool(TRACE_DESCRIPTOR, async ({ input: request }) => {
|
|
1065
|
+
const page = await input.store.readEvents({
|
|
1066
|
+
conversationId: input.conversationId,
|
|
1067
|
+
...request
|
|
1068
|
+
});
|
|
1069
|
+
return {
|
|
1070
|
+
events: page.items.map((event) => ({
|
|
1071
|
+
conversationId: event.conversationId,
|
|
1072
|
+
seq: event.seq,
|
|
1073
|
+
kind: event.kind,
|
|
1074
|
+
occurredAt: event.occurredAt,
|
|
1075
|
+
payload: event.payload
|
|
1076
|
+
})),
|
|
1077
|
+
...page.nextSeq !== undefined && { nextSeq: page.nextSeq }
|
|
1078
|
+
};
|
|
1040
1079
|
}),
|
|
1041
|
-
|
|
1042
|
-
name: AGENT_EVENT_SEARCH_TOOL_NAMES.event,
|
|
1043
|
-
description: "Read one durable event by exact conversation and sequence address.",
|
|
1044
|
-
identity: { serviceName: "agent-events", action: "read", method: "GET" },
|
|
1045
|
-
input: EventAddressSchema,
|
|
1046
|
-
output: EventOutputSchema,
|
|
1047
|
-
expose: ["AGENT"],
|
|
1048
|
-
handler: ({ input: request }) => readExact(request)
|
|
1049
|
-
})
|
|
1080
|
+
bindAgentTool(EVENT_DESCRIPTOR, ({ input: request }) => readExact(request))
|
|
1050
1081
|
];
|
|
1051
1082
|
}
|
|
1052
1083
|
|
|
@@ -1089,7 +1120,7 @@ function assertSourceCapabilities(driver, source) {
|
|
|
1089
1120
|
}
|
|
1090
1121
|
|
|
1091
1122
|
// src/agent-runtime/store-create.ts
|
|
1092
|
-
import { z as
|
|
1123
|
+
import { z as z25 } from "zod";
|
|
1093
1124
|
|
|
1094
1125
|
// src/agent-runtime/store-archive.ts
|
|
1095
1126
|
import { z as z14 } from "zod";
|
|
@@ -1967,10 +1998,10 @@ async function exportConversationIn(driver, transaction, conversationId) {
|
|
|
1967
1998
|
|
|
1968
1999
|
// src/agent-runtime/store-branch.ts
|
|
1969
2000
|
import { createHash as createHash7 } from "node:crypto";
|
|
1970
|
-
import { z as
|
|
2001
|
+
import { z as z23 } from "zod";
|
|
1971
2002
|
|
|
1972
2003
|
// src/agent-runtime/branch-events.ts
|
|
1973
|
-
import { z as
|
|
2004
|
+
import { z as z20 } from "zod";
|
|
1974
2005
|
|
|
1975
2006
|
// src/agent-runtime/branch-messages.ts
|
|
1976
2007
|
import { z as z16 } from "zod";
|
|
@@ -2060,31 +2091,55 @@ function branchRuntimeToolRecord(ids, name, value, output) {
|
|
|
2060
2091
|
|
|
2061
2092
|
// src/agent-runtime/branch-messages.ts
|
|
2062
2093
|
var RETAINABLE = new Set(["conversation", "run", "message"]);
|
|
2094
|
+
var RUNTIME_REFERENCE_KEYS = new Set(BRANCH_RUNTIME_REFERENCE_KEYS);
|
|
2063
2095
|
function branchOpaqueJson(ids, value, path = "") {
|
|
2064
2096
|
if (Array.isArray(value)) {
|
|
2065
|
-
value.
|
|
2066
|
-
branchOpaqueJson(ids, entry, `${path}[${index}]`);
|
|
2067
|
-
});
|
|
2068
|
-
return value;
|
|
2097
|
+
return value.map((entry, index) => branchOpaqueJson(ids, entry, `${path}[${index}]`));
|
|
2069
2098
|
}
|
|
2070
2099
|
if (value !== null && typeof value === "object") {
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2100
|
+
return branchOpaqueRecord(ids, value, path);
|
|
2101
|
+
}
|
|
2102
|
+
return value;
|
|
2103
|
+
}
|
|
2104
|
+
function branchOpaqueRecord(ids, value, path = "") {
|
|
2105
|
+
const out = {};
|
|
2106
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
2107
|
+
const at = path ? `${path}.${key}` : key;
|
|
2108
|
+
if (!RUNTIME_REFERENCE_KEYS.has(key)) {
|
|
2109
|
+
out[key] = branchOpaqueJson(ids, entry, at);
|
|
2110
|
+
continue;
|
|
2111
|
+
}
|
|
2112
|
+
const mode = ids.applicationKey(key);
|
|
2113
|
+
if (mode === undefined) {
|
|
2114
|
+
ids.refuse({
|
|
2115
|
+
code: "application-key-undeclared",
|
|
2116
|
+
message: `Branch cannot rekey an opaque payload containing ${key} at ${at}; declare it in applicationKeys if it is application data`,
|
|
2117
|
+
key,
|
|
2118
|
+
path: at
|
|
2119
|
+
});
|
|
2120
|
+
out[key] = branchOpaqueJson(ids, entry, at);
|
|
2121
|
+
continue;
|
|
2122
|
+
}
|
|
2123
|
+
if (mode === "rekey-spill") {
|
|
2124
|
+
if (typeof entry === "string") {
|
|
2125
|
+
const kinds = ids.sourceIdentitiesOf(entry);
|
|
2126
|
+
if (kinds.size === 1 && kinds.has("spill")) {
|
|
2127
|
+
out[key] = ids.reference("spill", entry);
|
|
2128
|
+
} else {
|
|
2129
|
+
ids.refuse({
|
|
2130
|
+
code: "application-key-source-identity",
|
|
2131
|
+
message: `Branch cannot rekey non-spill or foreign value under the application key ${key} at ${at}`,
|
|
2132
|
+
key,
|
|
2133
|
+
path: at
|
|
2134
|
+
});
|
|
2135
|
+
out[key] = entry;
|
|
2136
|
+
}
|
|
2137
|
+
} else {
|
|
2138
|
+
out[key] = branchOpaqueJson(ids, entry, at);
|
|
2084
2139
|
}
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2140
|
+
continue;
|
|
2141
|
+
}
|
|
2142
|
+
if (typeof entry === "string") {
|
|
2088
2143
|
for (const kind of ids.sourceIdentitiesOf(entry)) {
|
|
2089
2144
|
if (mode === "retain" && RETAINABLE.has(kind))
|
|
2090
2145
|
continue;
|
|
@@ -2097,10 +2152,9 @@ function branchOpaqueJson(ids, value, path = "") {
|
|
|
2097
2152
|
break;
|
|
2098
2153
|
}
|
|
2099
2154
|
}
|
|
2100
|
-
|
|
2101
|
-
branchOpaqueJson(ids, entry, path ? `${path}.${key}` : key);
|
|
2155
|
+
out[key] = branchOpaqueJson(ids, entry, at);
|
|
2102
2156
|
}
|
|
2103
|
-
return
|
|
2157
|
+
return out;
|
|
2104
2158
|
}
|
|
2105
2159
|
function branchToolJson(ids, name, value, output) {
|
|
2106
2160
|
return branchRuntimeToolRecord(ids, name, value, output) ?? branchOpaqueJson(ids, value);
|
|
@@ -2112,15 +2166,15 @@ function branchPartAt(ids, part) {
|
|
|
2112
2166
|
switch (part.type) {
|
|
2113
2167
|
case "file":
|
|
2114
2168
|
return { ...part, reference: ids.fileReference(part.reference) };
|
|
2115
|
-
case "tool-call":
|
|
2116
|
-
if (part.provider)
|
|
2117
|
-
branchOpaqueJson(ids, part.provider.data);
|
|
2169
|
+
case "tool-call":
|
|
2118
2170
|
return {
|
|
2119
2171
|
...part,
|
|
2172
|
+
...part.provider && {
|
|
2173
|
+
provider: { ...part.provider, data: branchOpaqueRecord(ids, part.provider.data) }
|
|
2174
|
+
},
|
|
2120
2175
|
callId: ids.reference("call", part.callId),
|
|
2121
2176
|
input: branchToolJson(ids, part.toolName, part.input, false)
|
|
2122
2177
|
};
|
|
2123
|
-
}
|
|
2124
2178
|
case "tool-result":
|
|
2125
2179
|
return {
|
|
2126
2180
|
...part,
|
|
@@ -2140,9 +2194,10 @@ function branchPartAt(ids, part) {
|
|
|
2140
2194
|
case "provider":
|
|
2141
2195
|
throw new TypeError("Branch cannot rekey an opaque provider part");
|
|
2142
2196
|
case "reasoning":
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2197
|
+
return part.provider ? {
|
|
2198
|
+
...part,
|
|
2199
|
+
provider: { ...part.provider, data: branchOpaqueRecord(ids, part.provider.data) }
|
|
2200
|
+
} : part;
|
|
2146
2201
|
default:
|
|
2147
2202
|
return part;
|
|
2148
2203
|
}
|
|
@@ -2200,7 +2255,7 @@ var Retry = z17.object({
|
|
|
2200
2255
|
delayMs: z17.number().nonnegative().optional(),
|
|
2201
2256
|
reason: z17.string().optional()
|
|
2202
2257
|
}).strict();
|
|
2203
|
-
var
|
|
2258
|
+
var SpillEventPayloadSchema = z17.object({ reference: Id, bytes: z17.int().nonnegative(), sha256: Hash2.optional() }).strict();
|
|
2204
2259
|
var Schedule = z17.object({
|
|
2205
2260
|
id: Id,
|
|
2206
2261
|
kind: z17.enum(["at", "after", "every"]).optional(),
|
|
@@ -2219,16 +2274,16 @@ function durability(ids, raw, kind) {
|
|
|
2219
2274
|
const value = kind === "durability/step" ? StepEventPayloadSchema.parse(raw) : kind === "durability/park" ? ParkEventPayloadSchema.parse(raw) : kind === "durability/event" ? DeliveredEventPayloadSchema.parse(raw) : EffectEventPayloadSchema.parse(raw);
|
|
2220
2275
|
if (canonicalAgentJson2(value) !== canonicalAgentJson2(raw))
|
|
2221
2276
|
throw new TypeError("Branch cannot rekey opaque durability payload");
|
|
2222
|
-
|
|
2223
|
-
branchOpaqueJson(ids, z17.json().parse(JSON.parse(value.encoded)));
|
|
2277
|
+
const encoded = "encoded" in value ? JSON.stringify(branchOpaqueJson(ids, z17.json().parse(JSON.parse(value.encoded)))) : undefined;
|
|
2224
2278
|
return {
|
|
2225
2279
|
...value,
|
|
2280
|
+
...encoded !== undefined && { encoded },
|
|
2226
2281
|
runId: ids.reference("run", value.runId),
|
|
2227
2282
|
..."id" in value && { id: ids.define("key", value.id) }
|
|
2228
2283
|
};
|
|
2229
2284
|
}
|
|
2230
2285
|
function spill(ids, raw) {
|
|
2231
|
-
const value =
|
|
2286
|
+
const value = SpillEventPayloadSchema.parse(raw);
|
|
2232
2287
|
return { ...value, reference: ids.reference("spill", value.reference) };
|
|
2233
2288
|
}
|
|
2234
2289
|
function schedule(ids, raw) {
|
|
@@ -2249,9 +2304,9 @@ function childState(ids, raw) {
|
|
|
2249
2304
|
const value = ChildStateEventPayloadSchema.parse(raw);
|
|
2250
2305
|
if ("action" in value) {
|
|
2251
2306
|
if (value.action === "blocking-presented") {
|
|
2252
|
-
branchOpaqueJson(ids, value.input);
|
|
2253
2307
|
return {
|
|
2254
2308
|
...value,
|
|
2309
|
+
input: branchOpaqueJson(ids, value.input),
|
|
2255
2310
|
childConversationId: rekeyChildConversation(ids, value.childConversationId),
|
|
2256
2311
|
approvalId: ids.define("approval", value.approvalId),
|
|
2257
2312
|
childApprovalId: ids.define("approval", value.childApprovalId),
|
|
@@ -2316,8 +2371,7 @@ var OBSERVATION_RULES = {
|
|
|
2316
2371
|
}).strict().parse(raw),
|
|
2317
2372
|
"state/set": (ids, raw) => {
|
|
2318
2373
|
const value = State.parse(raw);
|
|
2319
|
-
branchOpaqueJson(ids, value.value);
|
|
2320
|
-
return value;
|
|
2374
|
+
return { ...value, value: branchOpaqueJson(ids, value.value) };
|
|
2321
2375
|
},
|
|
2322
2376
|
"retry/scheduled": retry,
|
|
2323
2377
|
"retry/started": retry,
|
|
@@ -2401,16 +2455,49 @@ var BranchObservationSchema = z17.object({ sourceKind: Id, payload: z17.json() }
|
|
|
2401
2455
|
|
|
2402
2456
|
// src/agent-runtime/branch-provider.ts
|
|
2403
2457
|
import { createHash as createHash3 } from "node:crypto";
|
|
2458
|
+
import { z as z18 } from "zod";
|
|
2459
|
+
var ProviderOptionsRecordSchema = z18.record(z18.string(), z18.record(z18.string(), z18.json()));
|
|
2460
|
+
var ReferenceRecordSchema = z18.record(z18.string(), z18.string()).refine((value) => !("type" in value), "Provider reference cannot contain a file discriminator");
|
|
2404
2461
|
function hash(value) {
|
|
2405
2462
|
return createHash3("sha256").update(canonicalAgentJson2(value)).digest("hex");
|
|
2406
2463
|
}
|
|
2407
|
-
function
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2464
|
+
function rekeyProviderOptions(ids, options) {
|
|
2465
|
+
return ProviderOptionsRecordSchema.parse(branchOpaqueJson(ids, options));
|
|
2466
|
+
}
|
|
2467
|
+
function rekeyReference(ids, value) {
|
|
2468
|
+
return ReferenceRecordSchema.parse(branchOpaqueJson(ids, value));
|
|
2469
|
+
}
|
|
2470
|
+
function rekeyContentFileData(ids, value) {
|
|
2471
|
+
if (value.type === "reference") {
|
|
2472
|
+
return { ...value, reference: rekeyReference(ids, value.reference) };
|
|
2473
|
+
}
|
|
2474
|
+
return value;
|
|
2475
|
+
}
|
|
2476
|
+
function isBinaryMarker(value) {
|
|
2477
|
+
return "binary" in value && value.binary === true;
|
|
2478
|
+
}
|
|
2479
|
+
function rekeyFilePartData(ids, value) {
|
|
2480
|
+
if (typeof value === "string")
|
|
2481
|
+
return value;
|
|
2482
|
+
if (isBinaryMarker(value))
|
|
2483
|
+
return value;
|
|
2484
|
+
if ("type" in value) {
|
|
2485
|
+
if (value.type === "reference" && "reference" in value && typeof value.reference === "object" && value.reference !== null) {
|
|
2486
|
+
return { type: "reference", reference: rekeyReference(ids, value.reference) };
|
|
2487
|
+
}
|
|
2488
|
+
return value;
|
|
2489
|
+
}
|
|
2490
|
+
return rekeyReference(ids, value);
|
|
2491
|
+
}
|
|
2492
|
+
function rekeyImagePartData(ids, value) {
|
|
2493
|
+
if (typeof value === "string")
|
|
2494
|
+
return value;
|
|
2495
|
+
if (isBinaryMarker(value))
|
|
2496
|
+
return value;
|
|
2497
|
+
return rekeyReference(ids, value);
|
|
2498
|
+
}
|
|
2499
|
+
function rekeyReasoningFileData(_ids, value) {
|
|
2500
|
+
return value;
|
|
2414
2501
|
}
|
|
2415
2502
|
|
|
2416
2503
|
class BranchProvider {
|
|
@@ -2424,62 +2511,11 @@ class BranchProvider {
|
|
|
2424
2511
|
const value = ProviderJournalMessageSchema.parse(raw);
|
|
2425
2512
|
if (hash(value.message) !== value.sha256)
|
|
2426
2513
|
throw new TypeError("Branch provider message digest is inconsistent");
|
|
2427
|
-
|
|
2428
|
-
branchOpaqueJson(this.ids, value.message.providerOptions);
|
|
2514
|
+
const rekeyedMessageOptions = value.message.providerOptions ? rekeyProviderOptions(this.ids, value.message.providerOptions) : undefined;
|
|
2429
2515
|
const message = {
|
|
2430
2516
|
...value.message,
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
branchOpaqueJson(this.ids, part.providerOptions);
|
|
2434
|
-
if (part.type === "file" || part.type === "reasoning-file")
|
|
2435
|
-
checkFileData(this.ids, part.data);
|
|
2436
|
-
if (part.type === "image")
|
|
2437
|
-
checkFileData(this.ids, part.image);
|
|
2438
|
-
if (part.type === "tool-call")
|
|
2439
|
-
return {
|
|
2440
|
-
...part,
|
|
2441
|
-
toolCallId: this.ids.reference("call", part.toolCallId),
|
|
2442
|
-
input: branchToolJson(this.ids, part.toolName, part.input, false)
|
|
2443
|
-
};
|
|
2444
|
-
if (part.type === "tool-result") {
|
|
2445
|
-
if ("providerOptions" in part.output && part.output.providerOptions)
|
|
2446
|
-
branchOpaqueJson(this.ids, part.output.providerOptions);
|
|
2447
|
-
if (part.output.type === "error-json")
|
|
2448
|
-
branchOpaqueJson(this.ids, part.output.value);
|
|
2449
|
-
if (part.output.type === "content")
|
|
2450
|
-
for (const item of part.output.value) {
|
|
2451
|
-
if (item.providerOptions)
|
|
2452
|
-
branchOpaqueJson(this.ids, item.providerOptions);
|
|
2453
|
-
if (item.type === "file")
|
|
2454
|
-
checkFileData(this.ids, item.data);
|
|
2455
|
-
if ("providerReference" in item)
|
|
2456
|
-
branchOpaqueJson(this.ids, item.providerReference);
|
|
2457
|
-
if ("fileId" in item && typeof item.fileId !== "string")
|
|
2458
|
-
branchOpaqueJson(this.ids, item.fileId);
|
|
2459
|
-
}
|
|
2460
|
-
return {
|
|
2461
|
-
...part,
|
|
2462
|
-
toolCallId: this.ids.reference("call", part.toolCallId),
|
|
2463
|
-
output: part.output.type === "json" ? {
|
|
2464
|
-
...part.output,
|
|
2465
|
-
value: branchToolJson(this.ids, part.toolName, part.output.value, true)
|
|
2466
|
-
} : part.output
|
|
2467
|
-
};
|
|
2468
|
-
}
|
|
2469
|
-
if (part.type === "tool-approval-request")
|
|
2470
|
-
return {
|
|
2471
|
-
type: part.type,
|
|
2472
|
-
approvalId: this.ids.reference("approval", part.approvalId),
|
|
2473
|
-
toolCallId: this.ids.reference("call", part.toolCallId),
|
|
2474
|
-
...part.reason !== undefined && { reason: part.reason }
|
|
2475
|
-
};
|
|
2476
|
-
if (part.type === "tool-approval-response")
|
|
2477
|
-
return {
|
|
2478
|
-
...part,
|
|
2479
|
-
approvalId: this.ids.reference("approval", part.approvalId)
|
|
2480
|
-
};
|
|
2481
|
-
return part;
|
|
2482
|
-
})
|
|
2517
|
+
...rekeyedMessageOptions !== undefined && { providerOptions: rekeyedMessageOptions },
|
|
2518
|
+
content: typeof value.message.content === "string" ? value.message.content : value.message.content.map((part) => this.rekeyPart(part))
|
|
2483
2519
|
};
|
|
2484
2520
|
const sha256 = hash(message);
|
|
2485
2521
|
this.digests.set(value.sha256, sha256);
|
|
@@ -2506,10 +2542,92 @@ class BranchProvider {
|
|
|
2506
2542
|
const value = ProviderJournalResponseSchema.parse(raw);
|
|
2507
2543
|
return { ...value, runId: this.ids.reference("run", value.runId) };
|
|
2508
2544
|
}
|
|
2545
|
+
rekeyPart(part) {
|
|
2546
|
+
const providerOptions = "providerOptions" in part && part.providerOptions !== undefined ? rekeyProviderOptions(this.ids, part.providerOptions) : undefined;
|
|
2547
|
+
const base = providerOptions !== undefined ? { ...part, providerOptions } : part;
|
|
2548
|
+
if (base.type === "file") {
|
|
2549
|
+
return { ...base, data: rekeyFilePartData(this.ids, base.data) };
|
|
2550
|
+
}
|
|
2551
|
+
if (base.type === "reasoning-file") {
|
|
2552
|
+
return { ...base, data: rekeyReasoningFileData(this.ids, base.data) };
|
|
2553
|
+
}
|
|
2554
|
+
if (base.type === "image") {
|
|
2555
|
+
return { ...base, image: rekeyImagePartData(this.ids, base.image) };
|
|
2556
|
+
}
|
|
2557
|
+
if (base.type === "tool-call") {
|
|
2558
|
+
return {
|
|
2559
|
+
...base,
|
|
2560
|
+
toolCallId: this.ids.reference("call", base.toolCallId),
|
|
2561
|
+
input: branchToolJson(this.ids, base.toolName, base.input, false)
|
|
2562
|
+
};
|
|
2563
|
+
}
|
|
2564
|
+
if (base.type === "tool-result") {
|
|
2565
|
+
return {
|
|
2566
|
+
...base,
|
|
2567
|
+
toolCallId: this.ids.reference("call", base.toolCallId),
|
|
2568
|
+
output: this.rekeyToolResultOutput(base.toolName, base.output)
|
|
2569
|
+
};
|
|
2570
|
+
}
|
|
2571
|
+
if (base.type === "tool-approval-request") {
|
|
2572
|
+
return {
|
|
2573
|
+
type: base.type,
|
|
2574
|
+
approvalId: this.ids.reference("approval", base.approvalId),
|
|
2575
|
+
toolCallId: this.ids.reference("call", base.toolCallId),
|
|
2576
|
+
...base.reason !== undefined && { reason: base.reason }
|
|
2577
|
+
};
|
|
2578
|
+
}
|
|
2579
|
+
if (base.type === "tool-approval-response") {
|
|
2580
|
+
return {
|
|
2581
|
+
...base,
|
|
2582
|
+
approvalId: this.ids.reference("approval", base.approvalId)
|
|
2583
|
+
};
|
|
2584
|
+
}
|
|
2585
|
+
return base;
|
|
2586
|
+
}
|
|
2587
|
+
rekeyToolResultOutput(toolName, output) {
|
|
2588
|
+
const providerOptions = "providerOptions" in output && output.providerOptions !== undefined ? rekeyProviderOptions(this.ids, output.providerOptions) : undefined;
|
|
2589
|
+
if (output.type === "json") {
|
|
2590
|
+
return {
|
|
2591
|
+
...output,
|
|
2592
|
+
...providerOptions !== undefined && { providerOptions },
|
|
2593
|
+
value: branchToolJson(this.ids, toolName, output.value, true)
|
|
2594
|
+
};
|
|
2595
|
+
}
|
|
2596
|
+
if (output.type === "error-json") {
|
|
2597
|
+
return {
|
|
2598
|
+
...output,
|
|
2599
|
+
...providerOptions !== undefined && { providerOptions },
|
|
2600
|
+
value: branchOpaqueJson(this.ids, output.value)
|
|
2601
|
+
};
|
|
2602
|
+
}
|
|
2603
|
+
if (output.type === "content") {
|
|
2604
|
+
return {
|
|
2605
|
+
...output,
|
|
2606
|
+
value: output.value.map((item) => {
|
|
2607
|
+
const itemOptions = item.providerOptions !== undefined ? rekeyProviderOptions(this.ids, item.providerOptions) : undefined;
|
|
2608
|
+
const next = itemOptions !== undefined ? { ...item, providerOptions: itemOptions } : item;
|
|
2609
|
+
if (next.type === "file") {
|
|
2610
|
+
return { ...next, data: rekeyContentFileData(this.ids, next.data) };
|
|
2611
|
+
}
|
|
2612
|
+
if (next.type === "file-reference" || next.type === "image-file-reference") {
|
|
2613
|
+
return {
|
|
2614
|
+
...next,
|
|
2615
|
+
providerReference: rekeyReference(this.ids, next.providerReference)
|
|
2616
|
+
};
|
|
2617
|
+
}
|
|
2618
|
+
if ((next.type === "file-id" || next.type === "image-file-id") && typeof next.fileId !== "string") {
|
|
2619
|
+
return { ...next, fileId: rekeyReference(this.ids, next.fileId) };
|
|
2620
|
+
}
|
|
2621
|
+
return next;
|
|
2622
|
+
})
|
|
2623
|
+
};
|
|
2624
|
+
}
|
|
2625
|
+
return providerOptions !== undefined ? { ...output, providerOptions } : output;
|
|
2626
|
+
}
|
|
2509
2627
|
}
|
|
2510
2628
|
|
|
2511
2629
|
// src/agent-runtime/branch-transitions.ts
|
|
2512
|
-
import { z as
|
|
2630
|
+
import { z as z19 } from "zod";
|
|
2513
2631
|
function rekeyBranchTransition(ids, source, operation) {
|
|
2514
2632
|
const message = (value) => branchMessage(ids, source, value);
|
|
2515
2633
|
const input = operation.input;
|
|
@@ -2581,11 +2699,11 @@ function rekeyBranchTransition(ids, source, operation) {
|
|
|
2581
2699
|
}
|
|
2582
2700
|
}
|
|
2583
2701
|
function branchJson(value) {
|
|
2584
|
-
return
|
|
2702
|
+
return z19.json().parse(value);
|
|
2585
2703
|
}
|
|
2586
2704
|
|
|
2587
2705
|
// src/agent-runtime/branch-events.ts
|
|
2588
|
-
var Hash3 =
|
|
2706
|
+
var Hash3 = z20.string().regex(/^[a-f0-9]{64}$/);
|
|
2589
2707
|
function rekeyBranchEvents(ids, source, events, retainedMessages = new Map) {
|
|
2590
2708
|
try {
|
|
2591
2709
|
const hydrated = events.map((event) => atEvent(ids, event, () => {
|
|
@@ -2649,14 +2767,14 @@ function rekeyBranchEvent(ids, source, event, provider) {
|
|
|
2649
2767
|
if (event.kind === "runtime/transition") {
|
|
2650
2768
|
const operation = branchTransition(event);
|
|
2651
2769
|
const rekeyed = rekeyBranchTransition(ids, source, operation);
|
|
2652
|
-
const raw =
|
|
2653
|
-
type:
|
|
2654
|
-
input:
|
|
2655
|
-
assistant:
|
|
2770
|
+
const raw = z20.object({
|
|
2771
|
+
type: z20.string(),
|
|
2772
|
+
input: z20.object({
|
|
2773
|
+
assistant: z20.object({
|
|
2656
2774
|
sha256: Hash3.optional(),
|
|
2657
2775
|
sourceSha256: Hash3.optional(),
|
|
2658
|
-
bytes:
|
|
2659
|
-
parts:
|
|
2776
|
+
bytes: z20.int(),
|
|
2777
|
+
parts: z20.int()
|
|
2660
2778
|
}).passthrough()
|
|
2661
2779
|
}).passthrough()
|
|
2662
2780
|
}).passthrough().safeParse(event.payload);
|
|
@@ -2764,6 +2882,9 @@ class BranchIdentities {
|
|
|
2764
2882
|
this.definitions.set(kind, values);
|
|
2765
2883
|
return target;
|
|
2766
2884
|
}
|
|
2885
|
+
defineExpiredSpill(source) {
|
|
2886
|
+
return this.define("spill", source);
|
|
2887
|
+
}
|
|
2767
2888
|
within(address, work) {
|
|
2768
2889
|
const outer = this.address;
|
|
2769
2890
|
this.address = { ...outer, ...address };
|
|
@@ -2904,22 +3025,22 @@ class BranchIdentities {
|
|
|
2904
3025
|
|
|
2905
3026
|
// src/agent-runtime/branch-source.ts
|
|
2906
3027
|
import { createHash as createHash6 } from "node:crypto";
|
|
2907
|
-
import { z as
|
|
3028
|
+
import { z as z22 } from "zod";
|
|
2908
3029
|
|
|
2909
3030
|
// src/agent-runtime/archive-spill.ts
|
|
2910
3031
|
import { createHash as createHash5 } from "node:crypto";
|
|
2911
|
-
import { z as
|
|
2912
|
-
var ArchiveSpillSchema =
|
|
2913
|
-
reference:
|
|
2914
|
-
runId:
|
|
2915
|
-
toolCallId:
|
|
2916
|
-
mediaType:
|
|
2917
|
-
bytes:
|
|
2918
|
-
sha256:
|
|
2919
|
-
createdAt:
|
|
2920
|
-
expiresAt:
|
|
3032
|
+
import { z as z21 } from "zod";
|
|
3033
|
+
var ArchiveSpillSchema = z21.object({
|
|
3034
|
+
reference: z21.string().min(1),
|
|
3035
|
+
runId: z21.string().min(1).optional(),
|
|
3036
|
+
toolCallId: z21.string().min(1).optional(),
|
|
3037
|
+
mediaType: z21.string().min(1),
|
|
3038
|
+
bytes: z21.int().nonnegative(),
|
|
3039
|
+
sha256: z21.string().regex(/^[a-f0-9]{64}$/),
|
|
3040
|
+
createdAt: z21.iso.datetime({ offset: true }),
|
|
3041
|
+
expiresAt: z21.iso.datetime({ offset: true }).optional(),
|
|
2921
3042
|
authorization: AgentCodingToolAuthorizationSchema2.optional(),
|
|
2922
|
-
base64:
|
|
3043
|
+
base64: z21.string()
|
|
2923
3044
|
}).strict().superRefine((spill, ctx) => {
|
|
2924
3045
|
const bytes = Buffer.from(spill.base64, "base64");
|
|
2925
3046
|
if (bytes.toString("base64") !== spill.base64 || bytes.byteLength !== spill.bytes || createHash5("sha256").update(bytes).digest("hex") !== spill.sha256) {
|
|
@@ -2931,7 +3052,7 @@ var ArchiveSpillSchema = z20.object({
|
|
|
2931
3052
|
});
|
|
2932
3053
|
|
|
2933
3054
|
// src/agent-runtime/branch-source.ts
|
|
2934
|
-
var SnapshotProjection =
|
|
3055
|
+
var SnapshotProjection = z22.object({ archiveType: z22.literal("runtime-snapshot"), snapshot: AgentSnapshotSchema2 }).strict();
|
|
2935
3056
|
function branchHash(value) {
|
|
2936
3057
|
return createHash6("sha256").update(canonicalAgentJson2(value)).digest("hex");
|
|
2937
3058
|
}
|
|
@@ -2948,13 +3069,13 @@ function boundary(events, throughRunId) {
|
|
|
2948
3069
|
for (const event of events) {
|
|
2949
3070
|
if (event.kind !== "runtime/transition")
|
|
2950
3071
|
continue;
|
|
2951
|
-
const candidate =
|
|
2952
|
-
type:
|
|
2953
|
-
input:
|
|
2954
|
-
runId:
|
|
2955
|
-
reason:
|
|
2956
|
-
action:
|
|
2957
|
-
absorb:
|
|
3072
|
+
const candidate = z22.object({
|
|
3073
|
+
type: z22.string(),
|
|
3074
|
+
input: z22.object({
|
|
3075
|
+
runId: z22.string().optional(),
|
|
3076
|
+
reason: z22.string().optional(),
|
|
3077
|
+
action: z22.string().optional(),
|
|
3078
|
+
absorb: z22.array(z22.object({ runId: z22.string() })).optional()
|
|
2958
3079
|
})
|
|
2959
3080
|
}).safeParse(event.payload);
|
|
2960
3081
|
if (!candidate.success)
|
|
@@ -2965,6 +3086,83 @@ function boundary(events, throughRunId) {
|
|
|
2965
3086
|
}
|
|
2966
3087
|
throw new TypeError("Branch boundary run has no exact settled event");
|
|
2967
3088
|
}
|
|
3089
|
+
function integrityRefusal(message, address) {
|
|
3090
|
+
return new AgentConversationBranchRefusedError2([
|
|
3091
|
+
{ ...address ?? {}, code: "integrity", message }
|
|
3092
|
+
]);
|
|
3093
|
+
}
|
|
3094
|
+
function collectExpiredSpills(events, liveSpills) {
|
|
3095
|
+
const created = new Map;
|
|
3096
|
+
const deleted = new Map;
|
|
3097
|
+
for (const event of events) {
|
|
3098
|
+
let sourceKind = event.kind;
|
|
3099
|
+
let payload = event.payload;
|
|
3100
|
+
if (event.kind === "runtime/branch-observation") {
|
|
3101
|
+
const obs = BranchObservationSchema.safeParse(event.payload);
|
|
3102
|
+
if (!obs.success)
|
|
3103
|
+
continue;
|
|
3104
|
+
sourceKind = obs.data.sourceKind;
|
|
3105
|
+
payload = obs.data.payload;
|
|
3106
|
+
}
|
|
3107
|
+
if (sourceKind !== "spill/created" && sourceKind !== "spill/deleted")
|
|
3108
|
+
continue;
|
|
3109
|
+
const parsed = SpillEventPayloadSchema.safeParse(payload);
|
|
3110
|
+
if (!parsed.success) {
|
|
3111
|
+
throw integrityRefusal(`Branch archive has malformed ${sourceKind} payload`, {
|
|
3112
|
+
seq: event.seq,
|
|
3113
|
+
eventKind: event.kind
|
|
3114
|
+
});
|
|
3115
|
+
}
|
|
3116
|
+
const { reference, bytes, sha256 } = parsed.data;
|
|
3117
|
+
if (sourceKind === "spill/created") {
|
|
3118
|
+
if (created.has(reference)) {
|
|
3119
|
+
throw integrityRefusal("Branch archive has duplicate spill/created event", {
|
|
3120
|
+
seq: event.seq,
|
|
3121
|
+
eventKind: event.kind
|
|
3122
|
+
});
|
|
3123
|
+
}
|
|
3124
|
+
created.set(reference, { seq: event.seq, bytes, ...sha256 ? { sha256 } : {} });
|
|
3125
|
+
} else {
|
|
3126
|
+
if (deleted.has(reference)) {
|
|
3127
|
+
throw integrityRefusal("Branch archive has duplicate spill/deleted event", {
|
|
3128
|
+
seq: event.seq,
|
|
3129
|
+
eventKind: event.kind
|
|
3130
|
+
});
|
|
3131
|
+
}
|
|
3132
|
+
const origin = created.get(reference);
|
|
3133
|
+
if (!origin || event.seq <= origin.seq) {
|
|
3134
|
+
throw integrityRefusal("Branch archive has spill/deleted without prior spill/created", {
|
|
3135
|
+
seq: event.seq,
|
|
3136
|
+
eventKind: event.kind
|
|
3137
|
+
});
|
|
3138
|
+
}
|
|
3139
|
+
if (origin.bytes !== bytes || origin.sha256 !== undefined && sha256 !== undefined && origin.sha256 !== sha256) {
|
|
3140
|
+
throw integrityRefusal("Branch archive spill/deleted disagrees with spill/created", {
|
|
3141
|
+
seq: event.seq,
|
|
3142
|
+
eventKind: event.kind
|
|
3143
|
+
});
|
|
3144
|
+
}
|
|
3145
|
+
deleted.set(reference, {
|
|
3146
|
+
seq: event.seq,
|
|
3147
|
+
bytes,
|
|
3148
|
+
...sha256 !== undefined ? { sha256 } : origin.sha256 !== undefined ? { sha256: origin.sha256 } : {}
|
|
3149
|
+
});
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3152
|
+
const liveSet = new Set(liveSpills.map((spill) => spill.reference));
|
|
3153
|
+
for (const [ref, meta] of deleted) {
|
|
3154
|
+
if (liveSet.has(ref)) {
|
|
3155
|
+
throw integrityRefusal("Branch archive has both a live spill and spill/deleted", {
|
|
3156
|
+
seq: meta.seq,
|
|
3157
|
+
eventKind: "spill/deleted"
|
|
3158
|
+
});
|
|
3159
|
+
}
|
|
3160
|
+
}
|
|
3161
|
+
return {
|
|
3162
|
+
expiredSpills: [...deleted.keys()].sort(),
|
|
3163
|
+
deletedMeta: deleted
|
|
3164
|
+
};
|
|
3165
|
+
}
|
|
2968
3166
|
function prepareBranchSource(bytes, {
|
|
2969
3167
|
source,
|
|
2970
3168
|
applicationFiles = [],
|
|
@@ -2977,7 +3175,7 @@ function prepareBranchSource(bytes, {
|
|
|
2977
3175
|
if (event.seq !== index + 1)
|
|
2978
3176
|
throw new TypeError("Branch source event sequence is incomplete");
|
|
2979
3177
|
}
|
|
2980
|
-
const projections = archive.projections.map((value) =>
|
|
3178
|
+
const projections = archive.projections.map((value) => z22.union([SnapshotProjection, ArchiveProjectionSchema]).parse(value));
|
|
2981
3179
|
if (projections.some((value, index) => canonicalAgentJson2(value) !== canonicalAgentJson2(archive.projections[index])))
|
|
2982
3180
|
throw new TypeError("Branch archive snapshot contains an unknown opaque field");
|
|
2983
3181
|
const snapshots = projections.filter((value) => ("archiveType" in value));
|
|
@@ -2997,10 +3195,13 @@ function prepareBranchSource(bytes, {
|
|
|
2997
3195
|
const allSpills = archive.spills.map((value) => ArchiveSpillSchema.parse(value));
|
|
2998
3196
|
if (new Set(allSpills.map((spill) => spill.reference)).size !== allSpills.length)
|
|
2999
3197
|
throw new TypeError("Branch archive has duplicate spill identities");
|
|
3198
|
+
const { expiredSpills: allExpiredSpills, deletedMeta } = collectExpiredSpills(archive.events, allSpills);
|
|
3000
3199
|
const full = replayBranchEvents(archive.conversationId, archive.events, expected);
|
|
3001
3200
|
const validationIds = new BranchIdentities("branch-validation", "branch-validation", archive.conversationId);
|
|
3002
3201
|
for (const spill of allSpills)
|
|
3003
3202
|
validationIds.define("spill", spill.reference);
|
|
3203
|
+
for (const expired of allExpiredSpills)
|
|
3204
|
+
validationIds.defineExpiredSpill(expired);
|
|
3004
3205
|
validationIds.declareApplicationFiles(applicationFiles);
|
|
3005
3206
|
validationIds.declareApplicationKeys(applicationKeys);
|
|
3006
3207
|
rekeyBranchEvents(validationIds, archive.conversationId, archive.events, full.retainedMessages);
|
|
@@ -3023,17 +3224,33 @@ function prepareBranchSource(bytes, {
|
|
|
3023
3224
|
const selectedIds = new BranchIdentities("branch-validation", "branch-validation", archive.conversationId);
|
|
3024
3225
|
for (const spill of allSpills)
|
|
3025
3226
|
selectedIds.define("spill", spill.reference);
|
|
3227
|
+
for (const expired of allExpiredSpills)
|
|
3228
|
+
selectedIds.defineExpiredSpill(expired);
|
|
3026
3229
|
selectedIds.declareApplicationFiles(applicationFiles);
|
|
3027
3230
|
selectedIds.declareApplicationKeys(applicationKeys);
|
|
3028
3231
|
rekeyBranchEvents(selectedIds, archive.conversationId, events, replay.retainedMessages);
|
|
3029
3232
|
const references = selectedIds.referenced("spill");
|
|
3030
3233
|
const spills = allSpills.filter((spill) => references.has(spill.reference));
|
|
3031
|
-
|
|
3032
|
-
|
|
3234
|
+
const expiredSpills = allExpiredSpills.filter((ref) => references.has(ref));
|
|
3235
|
+
if (spills.length + expiredSpills.length !== references.size)
|
|
3236
|
+
throw integrityRefusal("Branch source is missing a referenced spill");
|
|
3237
|
+
const tailDeletedSpills = [];
|
|
3238
|
+
for (const ref of expiredSpills) {
|
|
3239
|
+
const meta = deletedMeta.get(ref);
|
|
3240
|
+
if (meta && meta.seq > seq) {
|
|
3241
|
+
tailDeletedSpills.push({
|
|
3242
|
+
reference: ref,
|
|
3243
|
+
bytes: meta.bytes,
|
|
3244
|
+
...meta.sha256 !== undefined && { sha256: meta.sha256 }
|
|
3245
|
+
});
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3033
3248
|
return {
|
|
3034
3249
|
conversationId: archive.conversationId,
|
|
3035
3250
|
events,
|
|
3036
3251
|
spills,
|
|
3252
|
+
expiredSpills,
|
|
3253
|
+
tailDeletedSpills,
|
|
3037
3254
|
replay,
|
|
3038
3255
|
...refused && { refused },
|
|
3039
3256
|
applicationFiles: validationIds.applicationFileReferences(),
|
|
@@ -3041,6 +3258,7 @@ function prepareBranchSource(bytes, {
|
|
|
3041
3258
|
conversationId: archive.conversationId,
|
|
3042
3259
|
events,
|
|
3043
3260
|
spills,
|
|
3261
|
+
expiredSpills,
|
|
3044
3262
|
snapshot: replay.snapshot
|
|
3045
3263
|
})
|
|
3046
3264
|
};
|
|
@@ -3165,6 +3383,8 @@ async function branchConversation(driver, raw) {
|
|
|
3165
3383
|
const ids = new BranchIdentities(input.destinationConversationId, input.requestKey, source.conversationId);
|
|
3166
3384
|
for (const spill of source.spills)
|
|
3167
3385
|
ids.define("spill", spill.reference);
|
|
3386
|
+
for (const expired of source.expiredSpills)
|
|
3387
|
+
ids.defineExpiredSpill(expired);
|
|
3168
3388
|
ids.declareApplicationFiles(input.applicationFiles ?? []);
|
|
3169
3389
|
ids.declareApplicationKeys(input.applicationKeys ?? []);
|
|
3170
3390
|
const events = rekeyBranchEvents(ids, source.conversationId, source.events, source.replay.retainedMessages);
|
|
@@ -3220,18 +3440,32 @@ async function branchConversation(driver, raw) {
|
|
|
3220
3440
|
if (appended.seq !== event.seq)
|
|
3221
3441
|
throw new TypeError("Branch event sequence changed");
|
|
3222
3442
|
}
|
|
3443
|
+
for (const tail of source.tailDeletedSpills) {
|
|
3444
|
+
await driver.events.append(tx, agentStoreEventDraft({
|
|
3445
|
+
conversationId: input.destinationConversationId,
|
|
3446
|
+
kind: "runtime/branch-observation",
|
|
3447
|
+
payload: {
|
|
3448
|
+
sourceKind: "spill/deleted",
|
|
3449
|
+
payload: {
|
|
3450
|
+
reference: ids.reference("spill", tail.reference),
|
|
3451
|
+
bytes: tail.bytes,
|
|
3452
|
+
...tail.sha256 !== undefined && { sha256: tail.sha256 }
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
}));
|
|
3456
|
+
}
|
|
3223
3457
|
await driver.archive?.import(tx, {
|
|
3224
3458
|
format: "stitchkit.agent-conversation",
|
|
3225
3459
|
formatVersion: 1,
|
|
3226
3460
|
conversationId: input.destinationConversationId,
|
|
3227
3461
|
events: [],
|
|
3228
3462
|
projections: [],
|
|
3229
|
-
spills:
|
|
3463
|
+
spills: z23.array(z23.json()).parse(spills)
|
|
3230
3464
|
});
|
|
3231
3465
|
await driver.events.append(tx, agentStoreEventDraft({
|
|
3232
3466
|
conversationId: input.destinationConversationId,
|
|
3233
3467
|
kind: "runtime/branched",
|
|
3234
|
-
payload:
|
|
3468
|
+
payload: z23.json().parse(receipt)
|
|
3235
3469
|
}));
|
|
3236
3470
|
return { outcome: "created", receipt };
|
|
3237
3471
|
});
|
|
@@ -3270,7 +3504,7 @@ function findEventOnce(driver, input) {
|
|
|
3270
3504
|
}
|
|
3271
3505
|
|
|
3272
3506
|
// src/agent-runtime/store-mutate.ts
|
|
3273
|
-
import { z as
|
|
3507
|
+
import { z as z24 } from "zod";
|
|
3274
3508
|
function validateAdmissionReceipt(receipt, record, conversationId) {
|
|
3275
3509
|
const input = receipt.input;
|
|
3276
3510
|
const run = record.run;
|
|
@@ -3417,7 +3651,7 @@ async function persistApplied(driver, transaction, read, operation, reduced) {
|
|
|
3417
3651
|
await driver.events.append(transaction, agentStoreEventDraft({
|
|
3418
3652
|
conversationId,
|
|
3419
3653
|
kind: "runtime/transition",
|
|
3420
|
-
payload:
|
|
3654
|
+
payload: z24.json().parse(transitionRecord(operation, reduced))
|
|
3421
3655
|
}));
|
|
3422
3656
|
return { outcome: "applied", snapshot: reduced.snapshot };
|
|
3423
3657
|
}
|
|
@@ -3466,9 +3700,9 @@ function createStoreConversationPurge(driver, conversations) {
|
|
|
3466
3700
|
}
|
|
3467
3701
|
|
|
3468
3702
|
// src/agent-runtime/store-create.ts
|
|
3469
|
-
var AgentRecoverableScanInputSchema =
|
|
3470
|
-
cursor:
|
|
3471
|
-
limit:
|
|
3703
|
+
var AgentRecoverableScanInputSchema = z25.object({
|
|
3704
|
+
cursor: z25.string().min(1).optional(),
|
|
3705
|
+
limit: z25.number().int().min(1).max(1000)
|
|
3472
3706
|
});
|
|
3473
3707
|
function createAgentRuntimeStore2(driver) {
|
|
3474
3708
|
const capabilities = driverCapabilities(driver);
|
|
@@ -3489,6 +3723,25 @@ function createAgentRuntimeStore2(driver) {
|
|
|
3489
3723
|
...driver.conversations && {
|
|
3490
3724
|
purgeConversation: createStoreConversationPurge(driver, driver.conversations)
|
|
3491
3725
|
},
|
|
3726
|
+
...driver.events.redactExpiredPayloads && {
|
|
3727
|
+
async purgeExpiredPayloads(rawInput) {
|
|
3728
|
+
const parsed = PurgeInvocationPayloadsInputSchema2.parse(rawInput);
|
|
3729
|
+
const redact = driver.events.redactExpiredPayloads;
|
|
3730
|
+
if (!redact)
|
|
3731
|
+
throw new TypeError("Agent runtime store does not support payload purge");
|
|
3732
|
+
const before = new Date(Date.parse(parsed.before)).toISOString();
|
|
3733
|
+
const expiredAt = new Date().toISOString();
|
|
3734
|
+
const result = await driver.transaction((tx) => redact(tx, {
|
|
3735
|
+
before,
|
|
3736
|
+
expiredAt,
|
|
3737
|
+
...parsed.conversationId !== undefined && {
|
|
3738
|
+
conversationId: parsed.conversationId
|
|
3739
|
+
},
|
|
3740
|
+
limit: parsed.limit ?? 1000
|
|
3741
|
+
}));
|
|
3742
|
+
return PurgeInvocationPayloadsResultSchema2.parse(result);
|
|
3743
|
+
}
|
|
3744
|
+
},
|
|
3492
3745
|
acceptInputAndAssignRun: (input) => mutate({
|
|
3493
3746
|
type: "accept",
|
|
3494
3747
|
input: AcceptInputAndAssignRunSchema2.parse(input)
|
|
@@ -3523,4 +3776,4 @@ function createAgentRuntimeStore2(driver) {
|
|
|
3523
3776
|
};
|
|
3524
3777
|
}
|
|
3525
3778
|
|
|
3526
|
-
export { AgentBranchRefusalCodeSchema2, AgentBranchRefusalSchema2, AgentConversationBranchRefusedError2, BranchAgentConversationInputSchema2, AgentConversationBranchReceiptSchema2, AgentConversationBranchResultSchema2, AgentConversationBranchPlanSchema2,
|
|
3779
|
+
export { AgentBranchRefusalCodeSchema2, AgentBranchRefusalSchema2, AgentConversationBranchRefusedError2, BranchAgentConversationInputSchema2, AgentConversationBranchReceiptSchema2, AgentConversationBranchResultSchema2, AgentConversationBranchPlanSchema2, defineAgentToolDescriptor, bindAgentTool, SqlIntegerSchema, HeadRowSchema, MessageRowSchema, PositionedMessageRowSchema, CountRowSchema, FlagSchema, EVENT_COLUMNS, parseJson, encodeJson, missing, placeholders, parseRunRow, parseEventRow, nextEventSeqByMaximum, AgentChildBudgetSchema2, AgentChildStateSchema2, AgentChildRecordSchema2, AgentChildBlockingKindSchema2, AgentChildBlockingSourceSchema2, AgentChildBlockingEventSchema2, ChildBlockingDecisionSchema, ChildSpawnedEventPayloadSchema, ChildStateEventPayloadSchema, parseChild, usageNumbers, AgentConversationPurgeInputSchema2, AgentConversationPurgeResultSchema2, AgentConversationPurgedError2, purgeAgentConversation2, DeferredAgentToolSearchInputSchema2, DeferredAgentToolMatchSchema2, DeferredAgentToolReceiptSchema2, agentSqlTables, isRetryablePostgresConflict, POSTGRES_ISOLATION, postgresSession, setPostgresTransactionIsolation, runPostgresTransaction, AgentEventSearchResultSchema2, createAgentEventSearch2, AGENT_EVENT_SEARCH_TOOL_DESCRIPTORS2, createAgentEventSearchTools2, AgentStoreUnsupportedCapabilityError2, ArchiveProjectionSchema, isRuntimeSnapshotEntry, replaceMessage, appendEventIn, ArchiveSpillSchema, createAgentRuntimeStore2 };
|