stitchkit 0.68.9 → 0.68.10
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/dist/agent-runtime/deferred-tool-search.d.ts +8 -0
- package/dist/agent-runtime/deferred-tool-search.d.ts.map +1 -0
- package/dist/agent-runtime/deferred-tool-selection.d.ts +15 -0
- package/dist/agent-runtime/deferred-tool-selection.d.ts.map +1 -0
- package/dist/agent-runtime/deferred-tool-types.d.ts +131 -0
- package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -0
- package/dist/agent-runtime/deferred-tools-internal.d.ts +10 -0
- package/dist/agent-runtime/deferred-tools-internal.d.ts.map +1 -0
- package/dist/agent-runtime/deferred-tools.d.ts +4 -0
- package/dist/agent-runtime/deferred-tools.d.ts.map +1 -0
- package/dist/agent-runtime/run-execution.d.ts.map +1 -1
- package/dist/agent-runtime-openrouter.js +1 -1
- package/dist/agent-runtime.d.ts +1 -0
- package/dist/agent-runtime.d.ts.map +1 -1
- package/dist/agent-runtime.js +471 -73
- package/dist/cli.js +7 -8
- package/dist/contract/index.js +2 -2
- package/dist/{index-vkk06pv1.js → index-22by16v6.js} +57 -9
- package/dist/{index-hmfpjnh7.js → index-22tjt2rk.js} +2 -2
- package/dist/{index-1bmpkhj2.js → index-2t6zt5cg.js} +9 -134
- package/dist/index-bt5179zb.js +99 -0
- package/dist/index-eqqyd9v8.js +130 -0
- package/dist/{index-51a19y3v.js → index-f24xg2cw.js} +2 -2
- package/dist/{index-j2nq04z6.js → index-f6n5n7nz.js} +1 -1
- package/dist/{index-9t2tdk1x.js → index-grgvpbch.js} +3 -5
- package/dist/{index-n34x0q5e.js → index-hb0mncmj.js} +3 -3
- package/dist/{index-6tqys26z.js → index-hcx9yypn.js} +4 -4
- package/dist/{index-z575awm9.js → index-hxh98zbm.js} +2 -2
- package/dist/{index-bmmtz6r9.js → index-pgsyp3xh.js} +1 -1
- package/dist/index-qyrqwr4c.js +41 -0
- package/dist/{index-r5s4wqb5.js → index-t23p2b68.js} +1 -1
- package/dist/{index-3ydx9j01.js → index-xyvxez9r.js} +3 -3
- package/dist/{index-04agqrs8.js → index-y2ctppmg.js} +72 -6
- package/dist/index.js +2 -2
- package/dist/internal/typed.d.ts +8 -0
- package/dist/internal/typed.d.ts.map +1 -1
- package/dist/node.js +5 -5
- package/dist/observability/index.js +4 -4
- package/dist/react.js +1 -1
- package/dist/remote.js +4 -4
- package/dist/server/index.js +7 -7
- package/dist/testing.js +5 -6
- package/dist/tool-invoker.js +6 -8
- package/dist/tools/internal/surface-projector.d.ts +7 -0
- package/dist/tools/internal/surface-projector.d.ts.map +1 -1
- package/dist/tools.js +34 -115
- package/llms-full.txt +80 -1
- package/package.json +1 -1
- package/dist/index-6djpbnda.js +0 -56
- package/dist/index-88yyydag.js +0 -75
- package/dist/index-smpbdg6k.js +0 -27
- /package/dist/{index-tss6bk5c.js → index-ksp6e2ye.js} +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/internal/typed.ts
|
|
2
|
+
function typedEntries(value) {
|
|
3
|
+
return Object.entries(value);
|
|
4
|
+
}
|
|
5
|
+
function isRecord(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
function callRuntimeHandler(handler, context) {
|
|
9
|
+
if (typeof handler !== "function") {
|
|
10
|
+
throw new TypeError("Runtime handler must be a function");
|
|
11
|
+
}
|
|
12
|
+
return Reflect.apply(handler, undefined, [context]);
|
|
13
|
+
}
|
|
14
|
+
function executableAgentRuntimeTools(tools) {
|
|
15
|
+
for (const tool of tools) {
|
|
16
|
+
if (typeof tool.handler !== "function") {
|
|
17
|
+
throw new TypeError(`Runtime tool "${tool.name}" must provide a handler`);
|
|
18
|
+
}
|
|
19
|
+
if (tool.present?.agent !== undefined && typeof tool.present.agent !== "function") {
|
|
20
|
+
throw new TypeError(`Runtime tool "${tool.name}" Agent presenter must be a function`);
|
|
21
|
+
}
|
|
22
|
+
if (tool.present?.agent !== undefined && tool.output === undefined) {
|
|
23
|
+
throw new TypeError(`Runtime tool "${tool.name}" Agent presenter requires an output schema`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return tools;
|
|
27
|
+
}
|
|
28
|
+
function transportResult(value) {
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
function mapObject(source, mapper) {
|
|
32
|
+
const result = {};
|
|
33
|
+
for (const [key, value] of typedEntries(source)) {
|
|
34
|
+
const mapped = mapper(key, value);
|
|
35
|
+
if (mapped !== undefined)
|
|
36
|
+
result[key] = mapped;
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { typedEntries, isRecord, callRuntimeHandler, executableAgentRuntimeTools, transportResult, mapObject };
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
contextContributionDelta,
|
|
3
3
|
mergeContextContribution,
|
|
4
4
|
prepareContextContribution
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-hxh98zbm.js";
|
|
6
6
|
import {
|
|
7
7
|
base64UrlToBytes,
|
|
8
8
|
bytesToBase64Url,
|
|
9
9
|
isUnsafeKey,
|
|
10
10
|
safeJsonParse
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-pgsyp3xh.js";
|
|
12
12
|
import {
|
|
13
13
|
isRecord
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-qyrqwr4c.js";
|
|
15
15
|
import {
|
|
16
16
|
forbidden,
|
|
17
17
|
unauthorized
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getRequestContext,
|
|
3
3
|
runWithRequestContext
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-f24xg2cw.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
assertToolExtensionCompatible,
|
|
7
|
+
mergeSchemas,
|
|
8
|
+
objectShapeKeys,
|
|
9
|
+
projectToolSurface,
|
|
10
|
+
rebuildObject
|
|
11
|
+
} from "./index-22by16v6.js";
|
|
8
12
|
import {
|
|
9
13
|
formatZodError,
|
|
10
14
|
isUnsafeKey,
|
|
11
15
|
normalizeError,
|
|
12
16
|
safeJsonParse,
|
|
13
17
|
validateDeclaredOutput
|
|
14
|
-
} from "./index-
|
|
18
|
+
} from "./index-pgsyp3xh.js";
|
|
15
19
|
import {
|
|
16
20
|
isRecord
|
|
17
|
-
} from "./index-
|
|
21
|
+
} from "./index-qyrqwr4c.js";
|
|
18
22
|
import {
|
|
19
23
|
AppError,
|
|
20
24
|
STITCH_ERROR_STATUS,
|
|
@@ -335,4 +339,66 @@ async function runToolMethod(method, toolName, rawArgs, context, hooks, lifecycl
|
|
|
335
339
|
}
|
|
336
340
|
}
|
|
337
341
|
|
|
338
|
-
|
|
342
|
+
// src/tools/mount.ts
|
|
343
|
+
import { z as z2 } from "zod";
|
|
344
|
+
function applyExtend(base, extra) {
|
|
345
|
+
if (base instanceof z2.ZodObject) {
|
|
346
|
+
assertToolExtensionCompatible(base, extra);
|
|
347
|
+
return rebuildObject(base, { ...extra, ...base.shape });
|
|
348
|
+
}
|
|
349
|
+
return z2.intersection(z2.object(extra), base);
|
|
350
|
+
}
|
|
351
|
+
function contractToolMountable(projected, extend) {
|
|
352
|
+
const method = projected.source;
|
|
353
|
+
const baseArgumentSchema = mergeSchemas(method.paramsSchema, method.inputSchema);
|
|
354
|
+
const argumentSchema = projected.shouldExtend && extend ? applyExtend(baseArgumentSchema, extend.schema) : baseArgumentSchema;
|
|
355
|
+
return {
|
|
356
|
+
method,
|
|
357
|
+
name: projected.name,
|
|
358
|
+
argumentSchema,
|
|
359
|
+
presentationSchema: projected.presentationSchema,
|
|
360
|
+
shouldExtend: projected.shouldExtend
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
function collectTools(service, transport, config = {}) {
|
|
364
|
+
const { extend, flattenUnionInput = false, assertNames = true } = config;
|
|
365
|
+
const tools = [];
|
|
366
|
+
for (const projected of projectToolSurface({ services: [service] }, transport === "HTTP" ? "AGENT" : transport, {
|
|
367
|
+
extend,
|
|
368
|
+
flattenUnionInput,
|
|
369
|
+
assertNames,
|
|
370
|
+
assertUniqueNames: false
|
|
371
|
+
})) {
|
|
372
|
+
if (projected.kind !== "contract")
|
|
373
|
+
continue;
|
|
374
|
+
tools.push(contractToolMountable(projected, extend));
|
|
375
|
+
}
|
|
376
|
+
return tools;
|
|
377
|
+
}
|
|
378
|
+
function createToolRunner(config) {
|
|
379
|
+
const extension = config.extend ? {
|
|
380
|
+
schema: z2.object(config.extend.schema),
|
|
381
|
+
resolve: config.extend.resolve
|
|
382
|
+
} : undefined;
|
|
383
|
+
return async function runOneToolCall(tool, rawArgs, context) {
|
|
384
|
+
return executeToolMethod(tool.method, tool.name, rawArgs, { ...config.context, ...context, source: config.source }, config.hooks, config.lifecycle, config.coerceJsonArgs ?? true, config.onOutputStrip ? (paths) => config.onOutputStrip?.(tool.name, paths) : undefined, tool.shouldExtend ? extension : undefined);
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
function formatToolError(result, toolName, errorHint) {
|
|
388
|
+
const err = { error: result.code };
|
|
389
|
+
if (result.details)
|
|
390
|
+
err.details = result.details;
|
|
391
|
+
const hints = [];
|
|
392
|
+
if (result.hint)
|
|
393
|
+
hints.push(result.hint);
|
|
394
|
+
if (errorHint && toolName) {
|
|
395
|
+
const global = errorHint(toolName, result.code);
|
|
396
|
+
if (global)
|
|
397
|
+
hints.push(global);
|
|
398
|
+
}
|
|
399
|
+
if (hints.length > 0)
|
|
400
|
+
err._hint = hints.join(" ");
|
|
401
|
+
return err;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export { coerceJsonArgs, ToolExecutionControlError, isToolExecutionControlError, toolResultFromError, toolErrorFromResult, executeToolMethod, contractToolMountable, collectTools, createToolRunner, formatToolError };
|
package/dist/index.js
CHANGED
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
parseTrailingWildcard,
|
|
22
22
|
rateLimited,
|
|
23
23
|
unauthorized
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-f6n5n7nz.js";
|
|
25
25
|
import {
|
|
26
26
|
isRecord,
|
|
27
27
|
mapObject,
|
|
28
28
|
transportResult,
|
|
29
29
|
typedEntries
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-ksp6e2ye.js";
|
|
31
31
|
|
|
32
32
|
// src/browser/cancellation.ts
|
|
33
33
|
class RequestCancellationError extends Error {
|
package/dist/internal/typed.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SurfaceAgentRuntimeToolDefinition } from '../tools/internal/surface-projector.js';
|
|
2
|
+
import type { RuntimeToolDefinition } from '../tools/runtime-tool.js';
|
|
1
3
|
export declare function typedEntries<T extends object>(value: T): Array<{
|
|
2
4
|
[K in keyof T]: [K, T[K]];
|
|
3
5
|
}[keyof T]>;
|
|
@@ -5,6 +7,12 @@ export declare function typedEntries<T extends object>(value: T): Array<{
|
|
|
5
7
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
6
8
|
/** Invoke a runtime-discovered handler after a fail-first function check. */
|
|
7
9
|
export declare function callRuntimeHandler(handler: unknown, context: unknown): unknown;
|
|
10
|
+
/**
|
|
11
|
+
* Agent-only public declarations use a peer-free structural tool definition.
|
|
12
|
+
* Construction validates executable functions before this boundary restores
|
|
13
|
+
* the richer internal definition consumed by the canonical mount.
|
|
14
|
+
*/
|
|
15
|
+
export declare function executableAgentRuntimeTools(tools: readonly SurfaceAgentRuntimeToolDefinition[]): readonly RuntimeToolDefinition[];
|
|
8
16
|
/**
|
|
9
17
|
* Isolated loose-to-typed adapter boundary for transports whose decoder is
|
|
10
18
|
* selected at runtime while the contract fixes the generic result type.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src/internal/typed.ts"],"names":[],"mappings":"AAAA,wBAAgB,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AG,EAAE,MAAM,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,OAAO,CAAC,KAAK,OAAO,GACrE,OAAO,CAKT"}
|
package/dist/node.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
createHandler,
|
|
6
6
|
createSocketIOServer,
|
|
7
7
|
createUnixClientTransport
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-hcx9yypn.js";
|
|
9
9
|
import {
|
|
10
10
|
createImplement,
|
|
11
11
|
createImplementRegistry,
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
createScopedImplementRegistry,
|
|
15
15
|
implement,
|
|
16
16
|
implementRegistry
|
|
17
|
-
} from "./index-
|
|
18
|
-
import"./index-
|
|
17
|
+
} from "./index-hxh98zbm.js";
|
|
18
|
+
import"./index-f24xg2cw.js";
|
|
19
19
|
import"./index-557by2db.js";
|
|
20
20
|
import {
|
|
21
21
|
ShutdownOptionsSchema,
|
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
ShutdownStatusSchema,
|
|
25
25
|
createServerLifecycle
|
|
26
26
|
} from "./index-dk6e56g0.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
27
|
+
import"./index-pgsyp3xh.js";
|
|
28
|
+
import"./index-qyrqwr4c.js";
|
|
29
29
|
import {
|
|
30
30
|
AppError,
|
|
31
31
|
appError,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
redact,
|
|
11
11
|
sanitizePayload,
|
|
12
12
|
truncatePreview
|
|
13
|
-
} from "../index-
|
|
13
|
+
} from "../index-22tjt2rk.js";
|
|
14
14
|
import {
|
|
15
15
|
getRequestContext,
|
|
16
16
|
getTraceId,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
setRequestError,
|
|
22
22
|
setRequestUser,
|
|
23
23
|
wrapInRequestContext
|
|
24
|
-
} from "../index-
|
|
24
|
+
} from "../index-f24xg2cw.js";
|
|
25
25
|
import {
|
|
26
26
|
childSpan,
|
|
27
27
|
createTraceContext,
|
|
@@ -30,10 +30,10 @@ import {
|
|
|
30
30
|
recordedErrorMessage,
|
|
31
31
|
resolvePropagationContext,
|
|
32
32
|
resolveTraceContext
|
|
33
|
-
} from "../index-
|
|
33
|
+
} from "../index-pgsyp3xh.js";
|
|
34
34
|
import {
|
|
35
35
|
isRecord
|
|
36
|
-
} from "../index-
|
|
36
|
+
} from "../index-qyrqwr4c.js";
|
|
37
37
|
import"../index-0w9abg87.js";
|
|
38
38
|
import"../index-6k1937bx.js";
|
|
39
39
|
|
package/dist/react.js
CHANGED
package/dist/remote.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ApiError,
|
|
3
3
|
createClient
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-hb0mncmj.js";
|
|
5
|
+
import"./index-t23p2b68.js";
|
|
6
6
|
import {
|
|
7
7
|
mergeMeta
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-pgsyp3xh.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-qyrqwr4c.js";
|
|
12
12
|
import {
|
|
13
13
|
AppError
|
|
14
14
|
} from "./index-0w9abg87.js";
|
package/dist/server/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
sseRoute,
|
|
14
14
|
streamingRoute,
|
|
15
15
|
webSocketLane
|
|
16
|
-
} from "../index-
|
|
16
|
+
} from "../index-hcx9yypn.js";
|
|
17
17
|
import {
|
|
18
18
|
composeAuthHooks,
|
|
19
19
|
createAuthHook,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
signJwt,
|
|
27
27
|
verifyJwt,
|
|
28
28
|
verifyPkce
|
|
29
|
-
} from "../index-
|
|
29
|
+
} from "../index-xyvxez9r.js";
|
|
30
30
|
import {
|
|
31
31
|
DEFAULT_CORS_ALLOW_HEADERS,
|
|
32
32
|
DEFAULT_CORS_EXPOSE_HEADERS,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
defineMultipartStream,
|
|
41
41
|
implement,
|
|
42
42
|
implementRegistry
|
|
43
|
-
} from "../index-
|
|
43
|
+
} from "../index-hxh98zbm.js";
|
|
44
44
|
import {
|
|
45
45
|
extractIp,
|
|
46
46
|
generateTraceId,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
getTraceId,
|
|
49
49
|
resolveSocketIp,
|
|
50
50
|
resolveTraceId
|
|
51
|
-
} from "../index-
|
|
51
|
+
} from "../index-f24xg2cw.js";
|
|
52
52
|
import {
|
|
53
53
|
isWithinDir,
|
|
54
54
|
realPathWithinDir
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
inputIsQuery,
|
|
70
70
|
parseSSE,
|
|
71
71
|
streamSSE
|
|
72
|
-
} from "../index-
|
|
72
|
+
} from "../index-t23p2b68.js";
|
|
73
73
|
import {
|
|
74
74
|
DEFAULT_CONTRACT_STREAM_FRAME_BYTES,
|
|
75
75
|
errorCode,
|
|
@@ -78,10 +78,10 @@ import {
|
|
|
78
78
|
normalizeError,
|
|
79
79
|
parseTrailingWildcard,
|
|
80
80
|
zodIssues
|
|
81
|
-
} from "../index-
|
|
81
|
+
} from "../index-pgsyp3xh.js";
|
|
82
82
|
import {
|
|
83
83
|
isRecord
|
|
84
|
-
} from "../index-
|
|
84
|
+
} from "../index-qyrqwr4c.js";
|
|
85
85
|
import {
|
|
86
86
|
AppError,
|
|
87
87
|
STITCH_ERROR_STATUS,
|
package/dist/testing.js
CHANGED
|
@@ -17,22 +17,21 @@ import {
|
|
|
17
17
|
mcpProjectionCandidate,
|
|
18
18
|
prepareProjectedMcpTools,
|
|
19
19
|
projectToolSurface
|
|
20
|
-
} from "./index-
|
|
21
|
-
import"./index-6djpbnda.js";
|
|
20
|
+
} from "./index-22by16v6.js";
|
|
22
21
|
import {
|
|
23
22
|
toJsonSchema
|
|
24
23
|
} from "./index-cby4ar3v.js";
|
|
25
24
|
import {
|
|
26
25
|
createClient,
|
|
27
26
|
createClients
|
|
28
|
-
} from "./index-
|
|
29
|
-
import"./index-
|
|
27
|
+
} from "./index-hb0mncmj.js";
|
|
28
|
+
import"./index-t23p2b68.js";
|
|
30
29
|
import {
|
|
31
30
|
joinRoutePath
|
|
32
|
-
} from "./index-
|
|
31
|
+
} from "./index-pgsyp3xh.js";
|
|
33
32
|
import {
|
|
34
33
|
isRecord
|
|
35
|
-
} from "./index-
|
|
34
|
+
} from "./index-qyrqwr4c.js";
|
|
36
35
|
import"./index-0w9abg87.js";
|
|
37
36
|
import"./index-6k1937bx.js";
|
|
38
37
|
|
package/dist/tool-invoker.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createToolInvoker
|
|
3
|
-
} from "./index-
|
|
4
|
-
import"./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-vkk06pv1.js";
|
|
8
|
-
import"./index-6djpbnda.js";
|
|
3
|
+
} from "./index-grgvpbch.js";
|
|
4
|
+
import"./index-y2ctppmg.js";
|
|
5
|
+
import"./index-f24xg2cw.js";
|
|
6
|
+
import"./index-22by16v6.js";
|
|
9
7
|
import"./index-cby4ar3v.js";
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
8
|
+
import"./index-pgsyp3xh.js";
|
|
9
|
+
import"./index-qyrqwr4c.js";
|
|
12
10
|
import"./index-0w9abg87.js";
|
|
13
11
|
import"./index-6k1937bx.js";
|
|
14
12
|
export {
|
|
@@ -21,6 +21,13 @@ export interface SurfaceRuntimeToolDefinition {
|
|
|
21
21
|
ui?: EndpointUiMeta;
|
|
22
22
|
mcp?: EndpointMcpPolicy;
|
|
23
23
|
}
|
|
24
|
+
/** Peer-free executable shape accepted by Agent-only composition entrypoints. */
|
|
25
|
+
export interface SurfaceAgentRuntimeToolDefinition extends SurfaceRuntimeToolDefinition {
|
|
26
|
+
handler: unknown;
|
|
27
|
+
present?: {
|
|
28
|
+
agent?: unknown;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
24
31
|
/** One peer-free structural extension shared by executable mounts and projections. */
|
|
25
32
|
export interface SurfaceToolExtension<TContext extends Record<string, unknown> = Record<string, unknown>> {
|
|
26
33
|
schema: Record<string, ZodType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface-projector.d.ts","sourceRoot":"","sources":["../../../src/tools/internal/surface-projector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAK,MAAM,KAAK,CAAC;AACtD,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,UAAU,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AASzD,MAAM,MAAM,sBAAsB,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC;AAE7D,wFAAwF;AACxF,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QACR,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,UAAU,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,CAAC;IACF,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC/C,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACtC,EAAE,CAAC,EAAE,c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