stitchkit 0.103.0 → 0.103.2
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 +30 -0
- package/dist/agent-runtime/browser-control-contract.d.ts +1118 -0
- package/dist/agent-runtime/browser-control-contract.d.ts.map +1 -0
- package/dist/agent-runtime/browser-controller.d.ts +31 -0
- package/dist/agent-runtime/browser-controller.d.ts.map +1 -0
- package/dist/agent-runtime/harness-control.d.ts.map +1 -1
- package/dist/agent-runtime/harness-realtime.d.ts +25 -0
- package/dist/agent-runtime/harness-realtime.d.ts.map +1 -0
- package/dist/agent-runtime/harness-tools.d.ts +11 -0
- package/dist/agent-runtime/harness-tools.d.ts.map +1 -0
- package/dist/agent-runtime/react.d.ts +4 -0
- package/dist/agent-runtime/react.d.ts.map +1 -0
- package/dist/agent-runtime/run-assertions.d.ts +63 -0
- package/dist/agent-runtime/run-assertions.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/browser.js +235 -0
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness-tools.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/harness-tools.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/harness-tools.js +32 -0
- package/dist/entrypoints/agent-runtime/harness.js +13 -228
- package/dist/entrypoints/agent-runtime/react.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/react.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/react.js +8 -0
- package/dist/entrypoints/agent-runtime/realtime.d.ts +2 -0
- package/dist/entrypoints/agent-runtime/realtime.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/realtime.js +159 -0
- package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
- package/dist/entrypoints/agent-runtime/testing.d.ts +1 -0
- package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/testing.js +67 -2
- package/dist/entrypoints/agent-runtime.js +25 -20
- package/dist/entrypoints/cli.js +8 -8
- package/dist/entrypoints/index.js +15 -226
- package/dist/entrypoints/node.js +7 -5
- package/dist/entrypoints/observability.js +2 -2
- package/dist/entrypoints/react.js +2 -2
- package/dist/entrypoints/remote.js +3 -3
- package/dist/entrypoints/server.js +10 -8
- package/dist/entrypoints/testing.js +4 -4
- package/dist/entrypoints/tools/connections.js +2 -2
- package/dist/entrypoints/tools/invoker.js +6 -6
- package/dist/entrypoints/tools.js +25 -36
- package/dist/entrypoints/tracking.js +2 -2
- package/dist/{index-d82d3xg4.js → index-0c419yx7.js} +1 -1
- package/dist/{index-c6aagrbd.js → index-1br6gwhf.js} +4 -4
- package/dist/{index-xkhk5d6g.js → index-1khy8y7n.js} +5 -48
- package/dist/index-20yvtn9a.js +38 -0
- package/dist/{index-a9pd417t.js → index-5vyd0fkb.js} +1 -34
- package/dist/{index-r1z0rd9c.js → index-7n68nmc6.js} +1 -1
- package/dist/{index-zs4ms3th.js → index-90ppdx3q.js} +7 -30
- package/dist/{index-djjhhgjk.js → index-a4ajxwmb.js} +1 -1
- package/dist/index-c9d05kvt.js +11 -0
- package/dist/{index-ewbaywk5.js → index-dnn9z96q.js} +3 -3
- package/dist/index-jn9g8xdt.js +246 -0
- package/dist/index-kmpzj1cq.js +48 -0
- package/dist/{index-dvwj1f43.js → index-m2xqkv55.js} +2 -2
- package/dist/{index-m9fndta6.js → index-n2gre124.js} +3 -3
- package/dist/index-nggfa2yn.js +34 -0
- package/dist/{index-m79yr938.js → index-pw99k9h5.js} +1 -10
- package/dist/index-qapzv4p5.js +54 -0
- package/dist/index-r34mvse1.js +225 -0
- package/dist/{index-n9tyz8z3.js → index-r956rndn.js} +2 -2
- package/dist/index-srs8hj9c.js +10 -0
- package/dist/{index-jzczzcsb.js → index-tgzhq07n.js} +1 -1
- package/dist/index-vgkbcnkc.js +29 -0
- package/dist/{index-7z9ym7t8.js → index-x87j7csh.js} +35 -14
- package/dist/{index-3ct7hhq6.js → index-xwq9j1sf.js} +6 -56
- package/dist/{index-hby4qhax.js → index-yex7eg1v.js} +4 -10
- package/dist/{index-1h6gtdrj.js → index-ygkka6zn.js} +1 -1
- package/dist/index-ze1eph1k.js +20 -0
- package/dist/tools/schema/flatten-join.d.ts +1 -1
- package/dist/tools/schema/flatten-join.d.ts.map +1 -1
- package/dist/tools/schema/flatten.d.ts.map +1 -1
- package/llms/agent-runtime-browser.txt +26 -0
- package/llms/agent-runtime-harness-tools.txt +25 -0
- package/llms/agent-runtime-harness.txt +140 -1
- package/llms/agent-runtime-react.txt +21 -0
- package/llms/agent-runtime-realtime.txt +30 -0
- package/llms/agent-runtime-testing.txt +6 -0
- package/llms/stitchkit.txt +5 -1
- package/llms/tools.3.txt +1 -1
- package/llms/tools.txt +19 -1
- package/llms-full.txt +229 -3
- package/llms.txt +9 -5
- package/package.json +13 -1
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EffectUnresolvedError2,
|
|
3
|
-
createLocalStepDurability2
|
|
4
|
-
|
|
5
|
-
isAgentToolError2
|
|
6
|
-
} from "../index-a9pd417t.js";
|
|
3
|
+
createLocalStepDurability2
|
|
4
|
+
} from "../index-5vyd0fkb.js";
|
|
7
5
|
import {
|
|
8
6
|
AppError2,
|
|
9
7
|
STITCH_ERROR_STATUS2
|
|
10
8
|
} from "../index-n53mswt3.js";
|
|
9
|
+
import {
|
|
10
|
+
AgentToolError2,
|
|
11
|
+
isAgentToolError2
|
|
12
|
+
} from "../index-nggfa2yn.js";
|
|
11
13
|
import {
|
|
12
14
|
normalizeError2
|
|
13
15
|
} from "../index-b2bz0kdm.js";
|
|
14
16
|
import {
|
|
15
17
|
resolvePropagationContext2
|
|
16
|
-
} from "../index-
|
|
18
|
+
} from "../index-yex7eg1v.js";
|
|
17
19
|
import {
|
|
18
20
|
coerceJsonArgs2
|
|
19
21
|
} from "../index-9pw0a51a.js";
|
|
@@ -33,23 +35,21 @@ import {
|
|
|
33
35
|
presentationMetadata,
|
|
34
36
|
findUntypedProperties2,
|
|
35
37
|
prepareProjectedMcpTools
|
|
36
|
-
} from "../index-
|
|
38
|
+
} from "../index-x87j7csh.js";
|
|
37
39
|
import {
|
|
38
40
|
parseToolCallArguments,
|
|
39
41
|
toolResultFromError,
|
|
40
42
|
ToolExecutionControlError2,
|
|
41
43
|
isToolExecutionControlError2
|
|
42
|
-
} from "../index-
|
|
44
|
+
} from "../index-m2xqkv55.js";
|
|
43
45
|
import {
|
|
44
46
|
collectTools2,
|
|
45
47
|
createToolRunner,
|
|
46
48
|
formatToolError
|
|
47
|
-
} from "../index-
|
|
49
|
+
} from "../index-r956rndn.js";
|
|
48
50
|
import {
|
|
49
|
-
mountAgent2
|
|
50
|
-
|
|
51
|
-
buildToolManifest2
|
|
52
|
-
} from "../index-xkhk5d6g.js";
|
|
51
|
+
mountAgent2
|
|
52
|
+
} from "../index-1khy8y7n.js";
|
|
53
53
|
import"../index-m38ej7e5.js";
|
|
54
54
|
import {
|
|
55
55
|
ALL_TRANSPORTS2,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
WaitTimeoutError,
|
|
78
78
|
runWaitOperation,
|
|
79
79
|
createCli2
|
|
80
|
-
} from "../index-
|
|
80
|
+
} from "../index-1br6gwhf.js";
|
|
81
81
|
import {
|
|
82
82
|
ManagedFilePathSchema2,
|
|
83
83
|
ManagedFileRefSchema2
|
|
@@ -85,6 +85,9 @@ import {
|
|
|
85
85
|
import {
|
|
86
86
|
ManagedFileError2
|
|
87
87
|
} from "../index-v4a2fjtk.js";
|
|
88
|
+
import {
|
|
89
|
+
composeToolLifecycle2
|
|
90
|
+
} from "../index-ze1eph1k.js";
|
|
88
91
|
import {
|
|
89
92
|
signJwt2,
|
|
90
93
|
verifyPkce2
|
|
@@ -98,24 +101,28 @@ import {
|
|
|
98
101
|
guardSignalCallback,
|
|
99
102
|
mediaTypeEssence
|
|
100
103
|
} from "../index-afjvjyck.js";
|
|
104
|
+
import {
|
|
105
|
+
describeToolCatalog2,
|
|
106
|
+
buildToolManifest2
|
|
107
|
+
} from "../index-kmpzj1cq.js";
|
|
101
108
|
import {
|
|
102
109
|
collectToolSurface
|
|
103
|
-
} from "../index-
|
|
110
|
+
} from "../index-dnn9z96q.js";
|
|
104
111
|
import {
|
|
105
112
|
argumentsDigest
|
|
106
113
|
} from "../index-r7a7r7ha.js";
|
|
107
114
|
import {
|
|
108
115
|
createToolInvoker2
|
|
109
|
-
} from "../index-
|
|
116
|
+
} from "../index-n2gre124.js";
|
|
110
117
|
import {
|
|
111
118
|
runWithRequestContext2,
|
|
112
119
|
getRequestContext2,
|
|
113
120
|
getTraceId2
|
|
114
|
-
} from "../index-
|
|
121
|
+
} from "../index-7n68nmc6.js";
|
|
115
122
|
import {
|
|
116
123
|
defineRuntimeTool2,
|
|
117
124
|
createRuntimeToolFactory2
|
|
118
|
-
} from "../index-
|
|
125
|
+
} from "../index-tgzhq07n.js";
|
|
119
126
|
import {
|
|
120
127
|
compareCodeUnits,
|
|
121
128
|
serializeCanonicalJson
|
|
@@ -836,24 +843,6 @@ function mountOAuthProvider(config) {
|
|
|
836
843
|
};
|
|
837
844
|
return dcrEnabled ? [metadataRoute(ctx), registerRoute(ctx), authorizeRoute(ctx), tokenRoute(ctx)] : [metadataRoute(ctx), authorizeRoute(ctx), tokenRoute(ctx)];
|
|
838
845
|
}
|
|
839
|
-
// src/tools/lifecycle.ts
|
|
840
|
-
function composeToolLifecycle(...hooks) {
|
|
841
|
-
return {
|
|
842
|
-
beforeHandle: async (ctx, endpoint) => {
|
|
843
|
-
for (const hook of hooks)
|
|
844
|
-
await hook?.beforeHandle?.(ctx, endpoint);
|
|
845
|
-
},
|
|
846
|
-
afterHandle: async (ctx, result, endpoint) => {
|
|
847
|
-
let current = result;
|
|
848
|
-
for (const hook of hooks) {
|
|
849
|
-
const transformed = await hook?.afterHandle?.(ctx, current, endpoint);
|
|
850
|
-
if (transformed !== undefined)
|
|
851
|
-
current = transformed;
|
|
852
|
-
}
|
|
853
|
-
return current;
|
|
854
|
-
}
|
|
855
|
-
};
|
|
856
|
-
}
|
|
857
846
|
// src/tools/list-names.ts
|
|
858
847
|
function listToolNames(surface) {
|
|
859
848
|
const entries = new Map;
|
|
@@ -2958,7 +2947,7 @@ export {
|
|
|
2958
2947
|
buildToolManifest2 as buildToolManifest,
|
|
2959
2948
|
coerceJsonArgs2 as coerceJsonArgs,
|
|
2960
2949
|
collectTools2 as collectTools,
|
|
2961
|
-
composeToolLifecycle,
|
|
2950
|
+
composeToolLifecycle2 as composeToolLifecycle,
|
|
2962
2951
|
createAsyncOperationSnapshotSchema2 as createAsyncOperationSnapshotSchema,
|
|
2963
2952
|
createLocalStepDurability2 as createLocalStepDurability,
|
|
2964
2953
|
createMcpHandler,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
toolResultFromError,
|
|
6
6
|
toolErrorFromResult
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-m2xqkv55.js";
|
|
8
8
|
import {
|
|
9
9
|
coerceJsonArgs2
|
|
10
10
|
} from "./index-9pw0a51a.js";
|
|
@@ -15,17 +15,17 @@ import {
|
|
|
15
15
|
objectShapeKeys,
|
|
16
16
|
assertUniqueToolName,
|
|
17
17
|
buildToolPresentationSchema
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-x87j7csh.js";
|
|
19
19
|
import {
|
|
20
20
|
createToolRunner,
|
|
21
21
|
formatToolError
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-r956rndn.js";
|
|
23
23
|
import {
|
|
24
24
|
isWithinDir2
|
|
25
25
|
} from "./index-5cc6r990.js";
|
|
26
26
|
import {
|
|
27
27
|
collectToolSurface
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-dnn9z96q.js";
|
|
29
29
|
import {
|
|
30
30
|
formatZodError2
|
|
31
31
|
} from "./index-1eeqpadm.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentToolError2,
|
|
3
3
|
resolveToolDurability
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-nggfa2yn.js";
|
|
5
5
|
import {
|
|
6
6
|
toolResultFromError,
|
|
7
7
|
toolCauseFromResult,
|
|
8
8
|
isToolExecutionControlError2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-m2xqkv55.js";
|
|
10
10
|
import {
|
|
11
11
|
createToolRunner,
|
|
12
12
|
formatToolError
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-r956rndn.js";
|
|
14
14
|
import {
|
|
15
15
|
collectToolSurface
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-dnn9z96q.js";
|
|
17
17
|
import {
|
|
18
18
|
isRecord
|
|
19
19
|
} from "./index-9jfdm5tg.js";
|
|
@@ -108,47 +108,4 @@ function mountAgent2(services, config = {}) {
|
|
|
108
108
|
return tools;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
function utf8Length(value) {
|
|
113
|
-
return new TextEncoder().encode(JSON.stringify(value)).byteLength;
|
|
114
|
-
}
|
|
115
|
-
function describeToolCatalog2(config) {
|
|
116
|
-
const deferred = new Set(config.deferredNames ?? []);
|
|
117
|
-
const entries = collectToolSurface({
|
|
118
|
-
surface: config,
|
|
119
|
-
transport: config.transport,
|
|
120
|
-
extend: config.extend,
|
|
121
|
-
flattenUnionInput: config.flattenUnionInput
|
|
122
|
-
}).map(({ kind, service, action, mountable }) => {
|
|
123
|
-
const schemaBytes = utf8Length(mountable.presentationSchema);
|
|
124
|
-
return {
|
|
125
|
-
name: mountable.name,
|
|
126
|
-
description: mountable.method.desc,
|
|
127
|
-
inputSchema: mountable.presentationSchema,
|
|
128
|
-
source: { kind, service, action },
|
|
129
|
-
schemaBytes,
|
|
130
|
-
deferred: deferred.has(mountable.name)
|
|
131
|
-
};
|
|
132
|
-
});
|
|
133
|
-
if (config.maxSchemaBytes !== undefined) {
|
|
134
|
-
const total = entries.reduce((sum, entry) => sum + entry.schemaBytes, 0);
|
|
135
|
-
if (total > config.maxSchemaBytes) {
|
|
136
|
-
throw new TypeError(`Tool catalog schemas use ${total} bytes, exceeding maxSchemaBytes ${config.maxSchemaBytes}`);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return entries;
|
|
140
|
-
}
|
|
141
|
-
function buildToolManifest2(config) {
|
|
142
|
-
return collectToolSurface({
|
|
143
|
-
surface: config,
|
|
144
|
-
transport: config.transport,
|
|
145
|
-
extend: config.extend,
|
|
146
|
-
flattenUnionInput: config.flattenUnionInput
|
|
147
|
-
}).map(({ mountable }) => ({
|
|
148
|
-
name: mountable.name,
|
|
149
|
-
description: mountable.method.desc,
|
|
150
|
-
inputSchema: mountable.presentationSchema
|
|
151
|
-
}));
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export { mountAgent2, describeToolCatalog2, buildToolManifest2 };
|
|
111
|
+
export { mountAgent2 };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineRealtimeContract2
|
|
3
|
+
} from "./index-814xpr6d.js";
|
|
4
|
+
import {
|
|
5
|
+
AgentTextPartSchema2,
|
|
6
|
+
AgentFilePartSchema2
|
|
7
|
+
} from "./index-8kzct1d6.js";
|
|
8
|
+
import {
|
|
9
|
+
AgentControlRequestSchema2,
|
|
10
|
+
AgentControlResponseSchema2,
|
|
11
|
+
AgentControlDeliverySchema2
|
|
12
|
+
} from "./index-n5yqxd3d.js";
|
|
13
|
+
|
|
14
|
+
// src/agent-runtime/browser-control-contract.ts
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
var AgentBrowserRequestSchema2 = z.discriminatedUnion("operation", [
|
|
17
|
+
AgentControlRequestSchema2.options[0],
|
|
18
|
+
AgentControlRequestSchema2.options[1],
|
|
19
|
+
AgentControlRequestSchema2.options[2],
|
|
20
|
+
AgentControlRequestSchema2.options[3].omit({ context: true }).extend({
|
|
21
|
+
parts: z.array(z.union([AgentTextPartSchema2.strict(), AgentFilePartSchema2.strict()])).min(1)
|
|
22
|
+
}),
|
|
23
|
+
AgentControlRequestSchema2.options[4],
|
|
24
|
+
AgentControlRequestSchema2.options[5].omit({ context: true })
|
|
25
|
+
]);
|
|
26
|
+
var agentControlRealtimeContract2 = defineRealtimeContract2({
|
|
27
|
+
serverToClient: {
|
|
28
|
+
"agent:delivery": { args: z.tuple([AgentControlDeliverySchema2]) }
|
|
29
|
+
},
|
|
30
|
+
clientToServer: {
|
|
31
|
+
"agent:control": {
|
|
32
|
+
args: z.tuple([AgentBrowserRequestSchema2]),
|
|
33
|
+
ack: AgentControlResponseSchema2
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { AgentBrowserRequestSchema2, agentControlRealtimeContract2 };
|
|
@@ -639,37 +639,4 @@ function createLocalStepDurability2(options) {
|
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
641
|
|
|
642
|
-
|
|
643
|
-
var AGENT_TOOL_ERROR_BRAND = Symbol.for("stitchkit.AgentToolError");
|
|
644
|
-
|
|
645
|
-
class AgentToolError2 extends Error {
|
|
646
|
-
output;
|
|
647
|
-
constructor(output, cause) {
|
|
648
|
-
let message = "Tool execution failed";
|
|
649
|
-
try {
|
|
650
|
-
message = JSON.stringify(output);
|
|
651
|
-
} catch {}
|
|
652
|
-
super(message, cause === undefined ? undefined : { cause });
|
|
653
|
-
this.name = "AgentToolError";
|
|
654
|
-
this.output = output;
|
|
655
|
-
Object.defineProperty(this, AGENT_TOOL_ERROR_BRAND, { value: true });
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
function isAgentToolError2(value) {
|
|
659
|
-
return typeof value === "object" && value !== null && AGENT_TOOL_ERROR_BRAND in value;
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
// src/tools/durability-context.ts
|
|
663
|
-
var contexts = new WeakMap;
|
|
664
|
-
function createToolDurabilityContext(factory) {
|
|
665
|
-
const context = {};
|
|
666
|
-
contexts.set(context, factory);
|
|
667
|
-
return context;
|
|
668
|
-
}
|
|
669
|
-
function resolveToolDurability(context, callId, signal) {
|
|
670
|
-
if (typeof context !== "object" || context === null)
|
|
671
|
-
return;
|
|
672
|
-
return contexts.get(context)?.(callId, signal);
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
export { DURABILITY_STEP_EVENT_KIND2, StepResultDecodeError2, StepResultNotSerializableError2, StepAbortedError2, EffectUnresolvedError2, ParkRecordDecodeError2, ParkAbortedError2, createLocalStepDurability2, AgentToolError2, isAgentToolError2, createToolDurabilityContext, resolveToolDurability };
|
|
642
|
+
export { DURABILITY_STEP_EVENT_KIND2, StepResultDecodeError2, StepResultNotSerializableError2, StepAbortedError2, EffectUnresolvedError2, ParkRecordDecodeError2, ParkAbortedError2, createLocalStepDurability2 };
|
|
@@ -12,21 +12,19 @@ import {
|
|
|
12
12
|
AgentSnapshotSchema2
|
|
13
13
|
} from "./index-8kzct1d6.js";
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
ToolExecutionControlError2,
|
|
16
|
+
isToolExecutionControlError2
|
|
17
|
+
} from "./index-m2xqkv55.js";
|
|
17
18
|
import {
|
|
18
|
-
AgentRuntimeEventSchema2,
|
|
19
19
|
agentDurableEventId2
|
|
20
20
|
} from "./index-mnkk1ffz.js";
|
|
21
21
|
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} from "./index-dvwj1f43.js";
|
|
22
|
+
createLocalStepDurability2
|
|
23
|
+
} from "./index-5vyd0fkb.js";
|
|
25
24
|
import {
|
|
26
|
-
createLocalStepDurability2,
|
|
27
25
|
isAgentToolError2,
|
|
28
26
|
createToolDurabilityContext
|
|
29
|
-
} from "./index-
|
|
27
|
+
} from "./index-nggfa2yn.js";
|
|
30
28
|
import {
|
|
31
29
|
canonicalAgentJson2,
|
|
32
30
|
createToolChronology,
|
|
@@ -324,27 +322,6 @@ function createAgentSessionCoordinator2() {
|
|
|
324
322
|
};
|
|
325
323
|
}
|
|
326
324
|
|
|
327
|
-
// src/agent-runtime/events.ts
|
|
328
|
-
function createAgentRuntimeEventSink2(config) {
|
|
329
|
-
const manager = createBoundedSinkManager({
|
|
330
|
-
write: config.write,
|
|
331
|
-
...config.maxPending !== undefined && { maxPending: config.maxPending },
|
|
332
|
-
...config.onSinkError && { onSinkError: config.onSinkError },
|
|
333
|
-
...config.onDrop && { onDrop: config.onDrop }
|
|
334
|
-
});
|
|
335
|
-
return {
|
|
336
|
-
publish(rawEvent) {
|
|
337
|
-
const event = AgentRuntimeEventSchema2.parse(rawEvent);
|
|
338
|
-
const projected = config.project?.(event) ?? (config.project ? undefined : event);
|
|
339
|
-
if (projected)
|
|
340
|
-
manager.submit(() => AgentRuntimeEventSchema2.parse(projected));
|
|
341
|
-
},
|
|
342
|
-
flush: (bound) => manager.flush(bound),
|
|
343
|
-
getStatus: () => manager.getStatus(),
|
|
344
|
-
close: (bound) => manager.close(bound)
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
|
|
348
325
|
// src/agent-runtime/history.ts
|
|
349
326
|
import { modelMessageSchema as modelMessageSchema2 } from "ai";
|
|
350
327
|
|
|
@@ -4310,4 +4287,4 @@ function createAgentRuntime2(config) {
|
|
|
4310
4287
|
};
|
|
4311
4288
|
}
|
|
4312
4289
|
|
|
4313
|
-
export { AgentRuntimeConflictError2, normalizeSdkUsage, AgentContextOverflowError2, createAgentSessionCoordinator2, registerDeferredToolRepair, registerDeferredToolCatalog, deferredToolCatalog, repairedSearchCall,
|
|
4290
|
+
export { AgentRuntimeConflictError2, normalizeSdkUsage, AgentContextOverflowError2, createAgentSessionCoordinator2, registerDeferredToolRepair, registerDeferredToolCatalog, deferredToolCatalog, repairedSearchCall, projectAgentHistoryDetailed2, projectAgentHistory2, ModelInvocationTraceSchema2, CompletionInvocationInputSchema2, ModelInvocationRecordSchema2, currentModelInvocationAttempt2, createModelInvocationLedger2, createAgentToolFenceLifecycle2, AgentTokenCountSchema2, selectAgentHistory2, composeAgentPrompt2, AgentProviderStreamCutError2, classifyProviderFailure2, isToolResultFailure2, recordAgentRetryDecision2, defineStateSlot2, createAgentStateSlotStore2, renderAgentStateSlots2, agentGoalStateSlot2, agentTodoStateSlot2, createAgentRuntime2 };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/internal/random-hex.ts
|
|
2
|
+
function randomHex(bytes) {
|
|
3
|
+
const arr = new Uint8Array(bytes);
|
|
4
|
+
crypto.getRandomValues(arr);
|
|
5
|
+
let hex = "";
|
|
6
|
+
for (const byte of arr)
|
|
7
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
8
|
+
return hex;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { randomHex };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
projectToolSurface
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-x87j7csh.js";
|
|
4
4
|
import {
|
|
5
5
|
contractToolMountable
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-r956rndn.js";
|
|
7
7
|
import {
|
|
8
8
|
runtimeToolMountable
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-tgzhq07n.js";
|
|
10
10
|
|
|
11
11
|
// src/tools/surface.ts
|
|
12
12
|
function collectToolSurface({
|