@contractspec/lib.ai-agent 1.57.0 → 1.59.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/dist/agent/agent-factory.d.ts +67 -71
- package/dist/agent/agent-factory.d.ts.map +1 -1
- package/dist/agent/agent-factory.js +658 -100
- package/dist/agent/agent.test.d.ts +2 -0
- package/dist/agent/agent.test.d.ts.map +1 -0
- package/dist/agent/contract-spec-agent.d.ts +48 -52
- package/dist/agent/contract-spec-agent.d.ts.map +1 -1
- package/dist/agent/contract-spec-agent.js +605 -146
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +2102 -4
- package/dist/agent/json-runner.d.ts +15 -19
- package/dist/agent/json-runner.d.ts.map +1 -1
- package/dist/agent/json-runner.js +672 -57
- package/dist/agent/json-runner.test.d.ts +2 -0
- package/dist/agent/json-runner.test.d.ts.map +1 -0
- package/dist/agent/unified-agent.d.ts +132 -109
- package/dist/agent/unified-agent.d.ts.map +1 -1
- package/dist/agent/unified-agent.js +2011 -293
- package/dist/approval/index.d.ts +3 -2
- package/dist/approval/index.d.ts.map +1 -0
- package/dist/approval/index.js +128 -2
- package/dist/approval/workflow.d.ts +106 -110
- package/dist/approval/workflow.d.ts.map +1 -1
- package/dist/approval/workflow.js +126 -157
- package/dist/exporters/claude-agent-exporter.d.ts +50 -48
- package/dist/exporters/claude-agent-exporter.d.ts.map +1 -1
- package/dist/exporters/claude-agent-exporter.js +258 -203
- package/dist/exporters/index.d.ts +28 -4
- package/dist/exporters/index.d.ts.map +1 -0
- package/dist/exporters/index.js +737 -3
- package/dist/exporters/opencode-exporter.d.ts +47 -45
- package/dist/exporters/opencode-exporter.d.ts.map +1 -1
- package/dist/exporters/opencode-exporter.js +507 -191
- package/dist/exporters/types.d.ts +171 -169
- package/dist/exporters/types.d.ts.map +1 -1
- package/dist/exporters/types.js +1 -0
- package/dist/index.d.ts +15 -39
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3337 -32
- package/dist/interop/index.d.ts +48 -4
- package/dist/interop/index.d.ts.map +1 -0
- package/dist/interop/index.js +709 -3
- package/dist/interop/spec-consumer.d.ts +57 -53
- package/dist/interop/spec-consumer.d.ts.map +1 -1
- package/dist/interop/spec-consumer.js +302 -282
- package/dist/interop/tool-consumer.d.ts +57 -53
- package/dist/interop/tool-consumer.d.ts.map +1 -1
- package/dist/interop/tool-consumer.js +412 -213
- package/dist/interop/types.d.ts +173 -171
- package/dist/interop/types.d.ts.map +1 -1
- package/dist/interop/types.js +1 -0
- package/dist/knowledge/index.d.ts +2 -2
- package/dist/knowledge/index.d.ts.map +1 -0
- package/dist/knowledge/index.js +66 -2
- package/dist/knowledge/injector.d.ts +16 -20
- package/dist/knowledge/injector.d.ts.map +1 -1
- package/dist/knowledge/injector.js +56 -47
- package/dist/memory/in-memory.d.ts +15 -19
- package/dist/memory/in-memory.d.ts.map +1 -1
- package/dist/memory/in-memory.js +152 -46
- package/dist/memory/index.d.ts +3 -3
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +155 -3
- package/dist/memory/manager.d.ts +32 -36
- package/dist/memory/manager.d.ts.map +1 -1
- package/dist/memory/manager.js +96 -70
- package/dist/memory/memory.test.d.ts +2 -0
- package/dist/memory/memory.test.d.ts.map +1 -0
- package/dist/node/agent/agent-factory.js +661 -0
- package/dist/node/agent/contract-spec-agent.js +607 -0
- package/dist/node/agent/index.js +2103 -0
- package/dist/node/agent/json-runner.js +684 -0
- package/dist/node/agent/unified-agent.js +2019 -0
- package/dist/node/approval/index.js +129 -0
- package/dist/node/approval/workflow.js +129 -0
- package/dist/node/exporters/claude-agent-exporter.js +265 -0
- package/dist/node/exporters/index.js +738 -0
- package/dist/node/exporters/opencode-exporter.js +516 -0
- package/dist/node/exporters/types.js +0 -0
- package/dist/node/index.js +3337 -0
- package/dist/node/interop/index.js +710 -0
- package/dist/node/interop/spec-consumer.js +307 -0
- package/dist/node/interop/tool-consumer.js +419 -0
- package/dist/node/interop/types.js +0 -0
- package/dist/node/knowledge/index.js +67 -0
- package/dist/node/knowledge/injector.js +67 -0
- package/dist/node/memory/in-memory.js +154 -0
- package/dist/node/memory/index.js +156 -0
- package/dist/node/memory/manager.js +105 -0
- package/dist/node/providers/claude-agent-sdk/adapter.js +624 -0
- package/dist/node/providers/claude-agent-sdk/index.js +673 -0
- package/dist/node/providers/claude-agent-sdk/session-bridge.js +149 -0
- package/dist/node/providers/claude-agent-sdk/tool-bridge.js +118 -0
- package/dist/node/providers/index.js +1261 -0
- package/dist/node/providers/opencode-sdk/adapter.js +669 -0
- package/dist/node/providers/opencode-sdk/agent-bridge.js +299 -0
- package/dist/node/providers/opencode-sdk/index.js +703 -0
- package/dist/node/providers/opencode-sdk/tool-bridge.js +141 -0
- package/dist/node/providers/registry.js +89 -0
- package/dist/node/providers/types.js +56 -0
- package/dist/node/schema/index.js +195 -0
- package/dist/node/schema/json-schema-to-zod.js +152 -0
- package/dist/node/schema/schema-output.js +190 -0
- package/dist/node/session/index.js +90 -0
- package/dist/node/session/store.js +90 -0
- package/dist/node/spec/index.js +85 -0
- package/dist/node/spec/registry.js +56 -0
- package/dist/node/spec/spec.js +44 -0
- package/dist/node/telemetry/adapter.js +85 -0
- package/dist/node/telemetry/index.js +86 -0
- package/dist/node/tools/index.js +345 -0
- package/dist/node/tools/knowledge-tool.js +74 -0
- package/dist/node/tools/mcp-client.js +47 -0
- package/dist/node/tools/mcp-server.js +205 -0
- package/dist/node/tools/tool-adapter.js +197 -0
- package/dist/node/types.js +0 -0
- package/dist/providers/claude-agent-sdk/adapter.d.ts +60 -52
- package/dist/providers/claude-agent-sdk/adapter.d.ts.map +1 -1
- package/dist/providers/claude-agent-sdk/adapter.js +622 -304
- package/dist/providers/claude-agent-sdk/index.d.ts +22 -4
- package/dist/providers/claude-agent-sdk/index.d.ts.map +1 -0
- package/dist/providers/claude-agent-sdk/index.js +672 -4
- package/dist/providers/claude-agent-sdk/session-bridge.d.ts +43 -40
- package/dist/providers/claude-agent-sdk/session-bridge.d.ts.map +1 -1
- package/dist/providers/claude-agent-sdk/session-bridge.js +121 -130
- package/dist/providers/claude-agent-sdk/tool-bridge.d.ts +63 -60
- package/dist/providers/claude-agent-sdk/tool-bridge.d.ts.map +1 -1
- package/dist/providers/claude-agent-sdk/tool-bridge.js +104 -108
- package/dist/providers/index.d.ts +28 -7
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +1261 -8
- package/dist/providers/opencode-sdk/adapter.d.ts +56 -48
- package/dist/providers/opencode-sdk/adapter.d.ts.map +1 -1
- package/dist/providers/opencode-sdk/adapter.js +667 -274
- package/dist/providers/opencode-sdk/agent-bridge.d.ts +62 -57
- package/dist/providers/opencode-sdk/agent-bridge.d.ts.map +1 -1
- package/dist/providers/opencode-sdk/agent-bridge.js +289 -155
- package/dist/providers/opencode-sdk/index.d.ts +22 -4
- package/dist/providers/opencode-sdk/index.d.ts.map +1 -0
- package/dist/providers/opencode-sdk/index.js +702 -4
- package/dist/providers/opencode-sdk/tool-bridge.d.ts +41 -42
- package/dist/providers/opencode-sdk/tool-bridge.d.ts.map +1 -1
- package/dist/providers/opencode-sdk/tool-bridge.js +121 -107
- package/dist/providers/registry.d.ts +10 -11
- package/dist/providers/registry.d.ts.map +1 -1
- package/dist/providers/registry.js +86 -49
- package/dist/providers/types.d.ts +169 -166
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/providers/types.js +54 -42
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +194 -3
- package/dist/schema/json-schema-to-zod.d.ts +23 -26
- package/dist/schema/json-schema-to-zod.d.ts.map +1 -1
- package/dist/schema/json-schema-to-zod.js +138 -110
- package/dist/schema/schema-output.d.ts +29 -32
- package/dist/schema/schema-output.d.ts.map +1 -1
- package/dist/schema/schema-output.js +178 -53
- package/dist/session/index.d.ts +2 -2
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +89 -2
- package/dist/session/store.d.ts +51 -55
- package/dist/session/store.d.ts.map +1 -1
- package/dist/session/store.js +85 -74
- package/dist/spec/index.d.ts +3 -3
- package/dist/spec/index.d.ts.map +1 -0
- package/dist/spec/index.js +84 -3
- package/dist/spec/registry.d.ts +32 -36
- package/dist/spec/registry.d.ts.map +1 -1
- package/dist/spec/registry.js +51 -60
- package/dist/spec/spec.d.ts +80 -84
- package/dist/spec/spec.d.ts.map +1 -1
- package/dist/spec/spec.js +40 -26
- package/dist/telemetry/adapter.d.ts +33 -37
- package/dist/telemetry/adapter.d.ts.map +1 -1
- package/dist/telemetry/adapter.js +78 -96
- package/dist/telemetry/index.d.ts +2 -2
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +85 -2
- package/dist/tools/index.d.ts +5 -5
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +344 -5
- package/dist/tools/knowledge-tool.d.ts +4 -8
- package/dist/tools/knowledge-tool.d.ts.map +1 -1
- package/dist/tools/knowledge-tool.js +68 -48
- package/dist/tools/mcp-client.d.ts +17 -21
- package/dist/tools/mcp-client.d.ts.map +1 -1
- package/dist/tools/mcp-client.js +42 -53
- package/dist/tools/mcp-server.d.ts +14 -18
- package/dist/tools/mcp-server.d.ts.map +1 -1
- package/dist/tools/mcp-server.js +200 -64
- package/dist/tools/tool-adapter.d.ts +7 -11
- package/dist/tools/tool-adapter.d.ts.map +1 -1
- package/dist/tools/tool-adapter.js +187 -70
- package/dist/tools/tools.test.d.ts +2 -0
- package/dist/tools/tools.test.d.ts.map +1 -0
- package/dist/types.d.ts +108 -111
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/package.json +448 -90
- package/dist/_virtual/_rolldown/runtime.js +0 -8
- package/dist/agent/agent-factory.js.map +0 -1
- package/dist/agent/contract-spec-agent.js.map +0 -1
- package/dist/agent/json-runner.js.map +0 -1
- package/dist/agent/unified-agent.js.map +0 -1
- package/dist/approval/workflow.js.map +0 -1
- package/dist/exporters/claude-agent-exporter.js.map +0 -1
- package/dist/exporters/opencode-exporter.js.map +0 -1
- package/dist/interop/spec-consumer.js.map +0 -1
- package/dist/interop/tool-consumer.js.map +0 -1
- package/dist/knowledge/injector.js.map +0 -1
- package/dist/memory/in-memory.js.map +0 -1
- package/dist/memory/manager.js.map +0 -1
- package/dist/providers/claude-agent-sdk/adapter.js.map +0 -1
- package/dist/providers/claude-agent-sdk/session-bridge.js.map +0 -1
- package/dist/providers/claude-agent-sdk/tool-bridge.js.map +0 -1
- package/dist/providers/opencode-sdk/adapter.js.map +0 -1
- package/dist/providers/opencode-sdk/agent-bridge.js.map +0 -1
- package/dist/providers/opencode-sdk/tool-bridge.js.map +0 -1
- package/dist/providers/registry.js.map +0 -1
- package/dist/providers/types.js.map +0 -1
- package/dist/schema/json-schema-to-zod.js.map +0 -1
- package/dist/schema/schema-output.js.map +0 -1
- package/dist/session/store.js.map +0 -1
- package/dist/spec/registry.js.map +0 -1
- package/dist/spec/spec.js.map +0 -1
- package/dist/telemetry/adapter.js.map +0 -1
- package/dist/tools/knowledge-tool.js.map +0 -1
- package/dist/tools/mcp-client.js.map +0 -1
- package/dist/tools/mcp-server.js.map +0 -1
- package/dist/tools/tool-adapter.js.map +0 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
//#region src/tools/mcp-server.d.ts
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { AgentSpec } from '../spec/spec';
|
|
3
|
+
import type { ContractSpecAgent } from '../agent/contract-spec-agent';
|
|
6
4
|
/**
|
|
7
5
|
* Generate an MCP server that exposes a ContractSpec agent as a tool.
|
|
8
6
|
*
|
|
@@ -22,24 +20,22 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
22
20
|
* await server.connect(transport);
|
|
23
21
|
* ```
|
|
24
22
|
*/
|
|
25
|
-
declare function agentToMcpServer(agent: ContractSpecAgent, spec: AgentSpec): McpServer;
|
|
23
|
+
export declare function agentToMcpServer(agent: ContractSpecAgent, spec: AgentSpec): McpServer;
|
|
26
24
|
/**
|
|
27
25
|
* Configuration for running an agent as an MCP server.
|
|
28
26
|
*/
|
|
29
|
-
interface AgentMcpServerConfig {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
export interface AgentMcpServerConfig {
|
|
28
|
+
/** The agent to expose */
|
|
29
|
+
agent: ContractSpecAgent;
|
|
30
|
+
/** The agent specification */
|
|
31
|
+
spec: AgentSpec;
|
|
32
|
+
/** Optional server name override */
|
|
33
|
+
name?: string;
|
|
34
|
+
/** Optional version override */
|
|
35
|
+
version?: string;
|
|
38
36
|
}
|
|
39
37
|
/**
|
|
40
38
|
* Create an MCP server from configuration.
|
|
41
39
|
*/
|
|
42
|
-
declare function createAgentMcpServer(config: AgentMcpServerConfig): McpServer;
|
|
43
|
-
//#endregion
|
|
44
|
-
export { AgentMcpServerConfig, agentToMcpServer, createAgentMcpServer };
|
|
40
|
+
export declare function createAgentMcpServer(config: AgentMcpServerConfig): McpServer;
|
|
45
41
|
//# sourceMappingURL=mcp-server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-server.d.ts","
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../src/tools/mcp-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,SAAS,GACd,SAAS,CAuEX;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,KAAK,EAAE,iBAAiB,CAAC;IACzB,8BAA8B;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,SAAS,CAE5E"}
|
package/dist/tools/mcp-server.js
CHANGED
|
@@ -1,69 +1,205 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
set: (newValue) => all[name] = () => newValue
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
13
|
+
var __require = import.meta.require;
|
|
14
|
+
|
|
15
|
+
// src/schema/json-schema-to-zod.ts
|
|
16
|
+
import { z } from "zod";
|
|
17
|
+
function jsonSchemaToZod(schema) {
|
|
18
|
+
const s = schema;
|
|
19
|
+
const makeNullable = (zodSchema) => {
|
|
20
|
+
return s.nullable ? z.union([zodSchema, z.null()]) : zodSchema;
|
|
21
|
+
};
|
|
22
|
+
if (s.const !== undefined) {
|
|
23
|
+
return z.literal(s.const);
|
|
24
|
+
}
|
|
25
|
+
if (s.enum) {
|
|
26
|
+
const values = s.enum;
|
|
27
|
+
return makeNullable(z.enum(values.map(String)));
|
|
28
|
+
}
|
|
29
|
+
if (s.anyOf && s.anyOf.length > 0) {
|
|
30
|
+
const schemas = s.anyOf.map((sub) => jsonSchemaToZod(sub));
|
|
31
|
+
if (schemas.length === 1)
|
|
32
|
+
return schemas[0] ?? z.unknown();
|
|
33
|
+
return z.union([
|
|
34
|
+
schemas[0] ?? z.unknown(),
|
|
35
|
+
schemas[1] ?? z.unknown(),
|
|
36
|
+
...schemas.slice(2)
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
if (s.oneOf && s.oneOf.length > 0) {
|
|
40
|
+
const schemas = s.oneOf.map((sub) => jsonSchemaToZod(sub));
|
|
41
|
+
if (schemas.length === 1)
|
|
42
|
+
return schemas[0] ?? z.unknown();
|
|
43
|
+
return z.union([
|
|
44
|
+
schemas[0] ?? z.unknown(),
|
|
45
|
+
schemas[1] ?? z.unknown(),
|
|
46
|
+
...schemas.slice(2)
|
|
47
|
+
]);
|
|
48
|
+
}
|
|
49
|
+
if (s.allOf && s.allOf.length > 0) {
|
|
50
|
+
const schemas = s.allOf.map((sub) => jsonSchemaToZod(sub));
|
|
51
|
+
return schemas.reduce((acc, curr) => z.intersection(acc, curr));
|
|
52
|
+
}
|
|
53
|
+
switch (s.type) {
|
|
54
|
+
case "string":
|
|
55
|
+
return makeNullable(buildStringSchema(s));
|
|
56
|
+
case "number":
|
|
57
|
+
case "integer":
|
|
58
|
+
return makeNullable(buildNumberSchema(s));
|
|
59
|
+
case "boolean":
|
|
60
|
+
return makeNullable(z.boolean());
|
|
61
|
+
case "null":
|
|
62
|
+
return z.null();
|
|
63
|
+
case "array":
|
|
64
|
+
return makeNullable(buildArraySchema(s));
|
|
65
|
+
case "object":
|
|
66
|
+
return makeNullable(buildObjectSchema(s));
|
|
67
|
+
default:
|
|
68
|
+
return z.unknown();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function buildStringSchema(schema) {
|
|
72
|
+
let zodSchema = z.string();
|
|
73
|
+
if (schema.description) {
|
|
74
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
75
|
+
}
|
|
76
|
+
switch (schema.format) {
|
|
77
|
+
case "email":
|
|
78
|
+
zodSchema = zodSchema.email();
|
|
79
|
+
break;
|
|
80
|
+
case "uri":
|
|
81
|
+
case "url":
|
|
82
|
+
zodSchema = zodSchema.url();
|
|
83
|
+
break;
|
|
84
|
+
case "uuid":
|
|
85
|
+
zodSchema = zodSchema.uuid();
|
|
86
|
+
break;
|
|
87
|
+
case "date-time":
|
|
88
|
+
zodSchema = zodSchema.datetime();
|
|
89
|
+
break;
|
|
90
|
+
case "date":
|
|
91
|
+
zodSchema = zodSchema.date();
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (schema.minLength !== undefined) {
|
|
95
|
+
zodSchema = zodSchema.min(schema.minLength);
|
|
96
|
+
}
|
|
97
|
+
if (schema.maxLength !== undefined) {
|
|
98
|
+
zodSchema = zodSchema.max(schema.maxLength);
|
|
99
|
+
}
|
|
100
|
+
if (schema.pattern) {
|
|
101
|
+
zodSchema = zodSchema.regex(new RegExp(schema.pattern));
|
|
102
|
+
}
|
|
103
|
+
return zodSchema;
|
|
104
|
+
}
|
|
105
|
+
function buildNumberSchema(schema) {
|
|
106
|
+
let zodSchema = schema.type === "integer" ? z.number().int() : z.number();
|
|
107
|
+
if (schema.description) {
|
|
108
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
109
|
+
}
|
|
110
|
+
if (schema.minimum !== undefined) {
|
|
111
|
+
zodSchema = zodSchema.min(schema.minimum);
|
|
112
|
+
}
|
|
113
|
+
if (schema.maximum !== undefined) {
|
|
114
|
+
zodSchema = zodSchema.max(schema.maximum);
|
|
115
|
+
}
|
|
116
|
+
return zodSchema;
|
|
117
|
+
}
|
|
118
|
+
function buildArraySchema(schema) {
|
|
119
|
+
const itemsSchema = schema.items ? jsonSchemaToZod(schema.items) : z.unknown();
|
|
120
|
+
let zodSchema = z.array(itemsSchema);
|
|
121
|
+
if (schema.description) {
|
|
122
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
123
|
+
}
|
|
124
|
+
return zodSchema;
|
|
125
|
+
}
|
|
126
|
+
function buildObjectSchema(schema) {
|
|
127
|
+
const properties = schema.properties ?? {};
|
|
128
|
+
const required = new Set(schema.required ?? []);
|
|
129
|
+
const shape = {};
|
|
130
|
+
for (const [key, propSchema] of Object.entries(properties)) {
|
|
131
|
+
const zodProp = jsonSchemaToZod(propSchema);
|
|
132
|
+
shape[key] = required.has(key) ? zodProp : zodProp.optional();
|
|
133
|
+
}
|
|
134
|
+
let zodSchema = z.object(shape);
|
|
135
|
+
if (schema.description) {
|
|
136
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
137
|
+
}
|
|
138
|
+
return zodSchema;
|
|
139
|
+
}
|
|
140
|
+
function jsonSchemaToZodSafe(schema) {
|
|
141
|
+
if (!schema || Object.keys(schema).length === 0) {
|
|
142
|
+
return z.object({});
|
|
143
|
+
}
|
|
144
|
+
return jsonSchemaToZod(schema);
|
|
145
|
+
}
|
|
146
|
+
var init_json_schema_to_zod = () => {};
|
|
4
147
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
* This allows other AI agents (e.g., Claude Desktop, Cursor) to use
|
|
10
|
-
* your ContractSpec agents as tools, enabling agent-to-agent composition.
|
|
11
|
-
*
|
|
12
|
-
* @param agent - The ContractSpec agent to expose
|
|
13
|
-
* @param spec - The agent specification
|
|
14
|
-
* @returns MCP Server instance
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const server = agentToMcpServer(myAgent, myAgentSpec);
|
|
19
|
-
*
|
|
20
|
-
* // Run via stdio transport
|
|
21
|
-
* const transport = new StdioServerTransport();
|
|
22
|
-
* await server.connect(transport);
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
148
|
+
// src/tools/mcp-server.ts
|
|
149
|
+
init_json_schema_to_zod();
|
|
150
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
151
|
+
import * as z2 from "zod";
|
|
25
152
|
function agentToMcpServer(agent, spec) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
153
|
+
const server = new McpServer({
|
|
154
|
+
name: spec.meta.key,
|
|
155
|
+
version: `${spec.meta.version}`
|
|
156
|
+
});
|
|
157
|
+
server.registerTool(spec.meta.key, {
|
|
158
|
+
description: spec.description ?? `Interact with ${spec.meta.key} agent`,
|
|
159
|
+
inputSchema: z2.object({
|
|
160
|
+
message: z2.string().describe("The message or query to send to the agent"),
|
|
161
|
+
sessionId: z2.string().optional().describe("Optional session ID to continue a conversation")
|
|
162
|
+
})
|
|
163
|
+
}, async (args) => {
|
|
164
|
+
const { message, sessionId } = args;
|
|
165
|
+
const result = await agent.generate({
|
|
166
|
+
prompt: message,
|
|
167
|
+
options: { sessionId }
|
|
168
|
+
});
|
|
169
|
+
return {
|
|
170
|
+
content: [
|
|
171
|
+
{
|
|
172
|
+
type: "text",
|
|
173
|
+
text: result.text
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
for (const toolConfig of spec.tools) {
|
|
179
|
+
const inputSchema = toolConfig.schema ? jsonSchemaToZodSafe(toolConfig.schema) : z2.object({});
|
|
180
|
+
server.registerTool(`${spec.meta.key}.${toolConfig.name}`, {
|
|
181
|
+
description: toolConfig.description ?? `Execute ${toolConfig.name} tool`,
|
|
182
|
+
inputSchema
|
|
183
|
+
}, async (args) => {
|
|
184
|
+
const result = await agent.generate({
|
|
185
|
+
prompt: `Execute the ${toolConfig.name} tool with the following arguments: ${JSON.stringify(args)}`
|
|
186
|
+
});
|
|
187
|
+
return {
|
|
188
|
+
content: [
|
|
189
|
+
{
|
|
190
|
+
type: "text",
|
|
191
|
+
text: result.text
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
};
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return server;
|
|
59
198
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Create an MCP server from configuration.
|
|
62
|
-
*/
|
|
63
199
|
function createAgentMcpServer(config) {
|
|
64
|
-
|
|
200
|
+
return agentToMcpServer(config.agent, config.spec);
|
|
65
201
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
202
|
+
export {
|
|
203
|
+
createAgentMcpServer,
|
|
204
|
+
agentToMcpServer
|
|
205
|
+
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
//#region src/tools/tool-adapter.d.ts
|
|
1
|
+
import { type Tool } from 'ai';
|
|
2
|
+
import type { AgentToolConfig } from '../spec/spec';
|
|
3
|
+
import type { ToolExecutionContext, ToolHandler } from '../types';
|
|
6
4
|
/**
|
|
7
5
|
* Convert ContractSpec AgentToolConfig to AI SDK CoreTool.
|
|
8
6
|
*
|
|
@@ -11,7 +9,7 @@ import { Tool } from "ai";
|
|
|
11
9
|
* @param context - Partial context to inject into handler calls
|
|
12
10
|
* @returns AI SDK CoreTool
|
|
13
11
|
*/
|
|
14
|
-
declare function specToolToAISDKTool(specTool: AgentToolConfig, handler: ToolHandler, context?: Partial<ToolExecutionContext>): Tool<any, any>;
|
|
12
|
+
export declare function specToolToAISDKTool(specTool: AgentToolConfig, handler: ToolHandler, context?: Partial<ToolExecutionContext>): Tool<any, any>;
|
|
15
13
|
/**
|
|
16
14
|
* Convert multiple ContractSpec tool configs to AI SDK tools.
|
|
17
15
|
*
|
|
@@ -20,7 +18,7 @@ declare function specToolToAISDKTool(specTool: AgentToolConfig, handler: ToolHan
|
|
|
20
18
|
* @param context - Partial context to inject into handler calls
|
|
21
19
|
* @returns Record of AI SDK tools keyed by name
|
|
22
20
|
*/
|
|
23
|
-
declare function specToolsToAISDKTools(specTools: AgentToolConfig[], handlers: Map<string, ToolHandler>, context?: Partial<ToolExecutionContext>): Record<string, Tool<any, any>>;
|
|
21
|
+
export declare function specToolsToAISDKTools(specTools: AgentToolConfig[], handlers: Map<string, ToolHandler>, context?: Partial<ToolExecutionContext>): Record<string, Tool<any, any>>;
|
|
24
22
|
/**
|
|
25
23
|
* Type-safe tool handler builder.
|
|
26
24
|
*
|
|
@@ -31,7 +29,7 @@ declare function specToolsToAISDKTools(specTools: AgentToolConfig[], handlers: M
|
|
|
31
29
|
* });
|
|
32
30
|
* ```
|
|
33
31
|
*/
|
|
34
|
-
declare function createToolHandler<TInput = unknown, TOutput = string>(handler: (input: TInput, context: ToolExecutionContext) => Promise<TOutput> | TOutput): ToolHandler<TInput, TOutput>;
|
|
32
|
+
export declare function createToolHandler<TInput = unknown, TOutput = string>(handler: (input: TInput, context: ToolExecutionContext) => Promise<TOutput> | TOutput): ToolHandler<TInput, TOutput>;
|
|
35
33
|
/**
|
|
36
34
|
* Build a tool handlers map from an object.
|
|
37
35
|
*
|
|
@@ -43,7 +41,5 @@ declare function createToolHandler<TInput = unknown, TOutput = string>(handler:
|
|
|
43
41
|
* });
|
|
44
42
|
* ```
|
|
45
43
|
*/
|
|
46
|
-
declare function buildToolHandlers(handlersObj: Record<string, ToolHandler>): Map<string, ToolHandler>;
|
|
47
|
-
//#endregion
|
|
48
|
-
export { buildToolHandlers, createToolHandler, specToolToAISDKTool, specToolsToAISDKTools };
|
|
44
|
+
export declare function buildToolHandlers(handlersObj: Record<string, ToolHandler>): Map<string, ToolHandler>;
|
|
49
45
|
//# sourceMappingURL=tool-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-adapter.d.ts","
|
|
1
|
+
{"version":3,"file":"tool-adapter.d.ts","sourceRoot":"","sources":["../../src/tools/tool-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,IAAI,EAAE,MAAM,IAAI,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGlE;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,OAAO,CAAC,oBAAoB,CAAM,GAC1C,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAmBhB;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,eAAe,EAAE,EAC5B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAClC,OAAO,GAAE,OAAO,CAAC,oBAAoB,CAAM,GAC1C,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAahC;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,GAAG,OAAO,EAAE,OAAO,GAAG,MAAM,EAClE,OAAO,EAAE,CACP,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,oBAAoB,KAC1B,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAC9B,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAI9B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GACvC,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAE1B"}
|
|
@@ -1,80 +1,197 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (target, all) => {
|
|
4
|
+
for (var name in all)
|
|
5
|
+
__defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
set: (newValue) => all[name] = () => newValue
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
13
|
+
var __require = import.meta.require;
|
|
3
14
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
// src/schema/json-schema-to-zod.ts
|
|
16
|
+
import { z } from "zod";
|
|
17
|
+
function jsonSchemaToZod(schema) {
|
|
18
|
+
const s = schema;
|
|
19
|
+
const makeNullable = (zodSchema) => {
|
|
20
|
+
return s.nullable ? z.union([zodSchema, z.null()]) : zodSchema;
|
|
21
|
+
};
|
|
22
|
+
if (s.const !== undefined) {
|
|
23
|
+
return z.literal(s.const);
|
|
24
|
+
}
|
|
25
|
+
if (s.enum) {
|
|
26
|
+
const values = s.enum;
|
|
27
|
+
return makeNullable(z.enum(values.map(String)));
|
|
28
|
+
}
|
|
29
|
+
if (s.anyOf && s.anyOf.length > 0) {
|
|
30
|
+
const schemas = s.anyOf.map((sub) => jsonSchemaToZod(sub));
|
|
31
|
+
if (schemas.length === 1)
|
|
32
|
+
return schemas[0] ?? z.unknown();
|
|
33
|
+
return z.union([
|
|
34
|
+
schemas[0] ?? z.unknown(),
|
|
35
|
+
schemas[1] ?? z.unknown(),
|
|
36
|
+
...schemas.slice(2)
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
39
|
+
if (s.oneOf && s.oneOf.length > 0) {
|
|
40
|
+
const schemas = s.oneOf.map((sub) => jsonSchemaToZod(sub));
|
|
41
|
+
if (schemas.length === 1)
|
|
42
|
+
return schemas[0] ?? z.unknown();
|
|
43
|
+
return z.union([
|
|
44
|
+
schemas[0] ?? z.unknown(),
|
|
45
|
+
schemas[1] ?? z.unknown(),
|
|
46
|
+
...schemas.slice(2)
|
|
47
|
+
]);
|
|
48
|
+
}
|
|
49
|
+
if (s.allOf && s.allOf.length > 0) {
|
|
50
|
+
const schemas = s.allOf.map((sub) => jsonSchemaToZod(sub));
|
|
51
|
+
return schemas.reduce((acc, curr) => z.intersection(acc, curr));
|
|
52
|
+
}
|
|
53
|
+
switch (s.type) {
|
|
54
|
+
case "string":
|
|
55
|
+
return makeNullable(buildStringSchema(s));
|
|
56
|
+
case "number":
|
|
57
|
+
case "integer":
|
|
58
|
+
return makeNullable(buildNumberSchema(s));
|
|
59
|
+
case "boolean":
|
|
60
|
+
return makeNullable(z.boolean());
|
|
61
|
+
case "null":
|
|
62
|
+
return z.null();
|
|
63
|
+
case "array":
|
|
64
|
+
return makeNullable(buildArraySchema(s));
|
|
65
|
+
case "object":
|
|
66
|
+
return makeNullable(buildObjectSchema(s));
|
|
67
|
+
default:
|
|
68
|
+
return z.unknown();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function buildStringSchema(schema) {
|
|
72
|
+
let zodSchema = z.string();
|
|
73
|
+
if (schema.description) {
|
|
74
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
75
|
+
}
|
|
76
|
+
switch (schema.format) {
|
|
77
|
+
case "email":
|
|
78
|
+
zodSchema = zodSchema.email();
|
|
79
|
+
break;
|
|
80
|
+
case "uri":
|
|
81
|
+
case "url":
|
|
82
|
+
zodSchema = zodSchema.url();
|
|
83
|
+
break;
|
|
84
|
+
case "uuid":
|
|
85
|
+
zodSchema = zodSchema.uuid();
|
|
86
|
+
break;
|
|
87
|
+
case "date-time":
|
|
88
|
+
zodSchema = zodSchema.datetime();
|
|
89
|
+
break;
|
|
90
|
+
case "date":
|
|
91
|
+
zodSchema = zodSchema.date();
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (schema.minLength !== undefined) {
|
|
95
|
+
zodSchema = zodSchema.min(schema.minLength);
|
|
96
|
+
}
|
|
97
|
+
if (schema.maxLength !== undefined) {
|
|
98
|
+
zodSchema = zodSchema.max(schema.maxLength);
|
|
99
|
+
}
|
|
100
|
+
if (schema.pattern) {
|
|
101
|
+
zodSchema = zodSchema.regex(new RegExp(schema.pattern));
|
|
102
|
+
}
|
|
103
|
+
return zodSchema;
|
|
104
|
+
}
|
|
105
|
+
function buildNumberSchema(schema) {
|
|
106
|
+
let zodSchema = schema.type === "integer" ? z.number().int() : z.number();
|
|
107
|
+
if (schema.description) {
|
|
108
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
109
|
+
}
|
|
110
|
+
if (schema.minimum !== undefined) {
|
|
111
|
+
zodSchema = zodSchema.min(schema.minimum);
|
|
112
|
+
}
|
|
113
|
+
if (schema.maximum !== undefined) {
|
|
114
|
+
zodSchema = zodSchema.max(schema.maximum);
|
|
115
|
+
}
|
|
116
|
+
return zodSchema;
|
|
117
|
+
}
|
|
118
|
+
function buildArraySchema(schema) {
|
|
119
|
+
const itemsSchema = schema.items ? jsonSchemaToZod(schema.items) : z.unknown();
|
|
120
|
+
let zodSchema = z.array(itemsSchema);
|
|
121
|
+
if (schema.description) {
|
|
122
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
123
|
+
}
|
|
124
|
+
return zodSchema;
|
|
125
|
+
}
|
|
126
|
+
function buildObjectSchema(schema) {
|
|
127
|
+
const properties = schema.properties ?? {};
|
|
128
|
+
const required = new Set(schema.required ?? []);
|
|
129
|
+
const shape = {};
|
|
130
|
+
for (const [key, propSchema] of Object.entries(properties)) {
|
|
131
|
+
const zodProp = jsonSchemaToZod(propSchema);
|
|
132
|
+
shape[key] = required.has(key) ? zodProp : zodProp.optional();
|
|
133
|
+
}
|
|
134
|
+
let zodSchema = z.object(shape);
|
|
135
|
+
if (schema.description) {
|
|
136
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
137
|
+
}
|
|
138
|
+
return zodSchema;
|
|
139
|
+
}
|
|
140
|
+
function jsonSchemaToZodSafe(schema) {
|
|
141
|
+
if (!schema || Object.keys(schema).length === 0) {
|
|
142
|
+
return z.object({});
|
|
143
|
+
}
|
|
144
|
+
return jsonSchemaToZod(schema);
|
|
145
|
+
}
|
|
146
|
+
var init_json_schema_to_zod = () => {};
|
|
147
|
+
|
|
148
|
+
// src/tools/tool-adapter.ts
|
|
149
|
+
import { tool } from "ai";
|
|
13
150
|
function specToolToAISDKTool(specTool, handler, context = {}) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
151
|
+
return tool({
|
|
152
|
+
description: specTool.description ?? specTool.name,
|
|
153
|
+
inputSchema: jsonSchemaToZodSafe(specTool.schema),
|
|
154
|
+
needsApproval: specTool.requiresApproval ?? !specTool.automationSafe,
|
|
155
|
+
execute: async (input) => {
|
|
156
|
+
const result = await handler(input, {
|
|
157
|
+
agentId: context.agentId ?? "unknown",
|
|
158
|
+
sessionId: context.sessionId ?? "unknown",
|
|
159
|
+
tenantId: context.tenantId,
|
|
160
|
+
actorId: context.actorId,
|
|
161
|
+
metadata: context.metadata,
|
|
162
|
+
signal: context.signal
|
|
163
|
+
});
|
|
164
|
+
return typeof result === "string" ? result : JSON.stringify(result);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
30
167
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Convert multiple ContractSpec tool configs to AI SDK tools.
|
|
33
|
-
*
|
|
34
|
-
* @param specTools - Array of tool configurations
|
|
35
|
-
* @param handlers - Map of tool name to handler function
|
|
36
|
-
* @param context - Partial context to inject into handler calls
|
|
37
|
-
* @returns Record of AI SDK tools keyed by name
|
|
38
|
-
*/
|
|
39
168
|
function specToolsToAISDKTools(specTools, handlers, context = {}) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
169
|
+
const tools = {};
|
|
170
|
+
for (const specTool of specTools) {
|
|
171
|
+
const handler = handlers.get(specTool.name);
|
|
172
|
+
if (!handler) {
|
|
173
|
+
throw new Error(`Missing handler for tool: ${specTool.name}`);
|
|
174
|
+
}
|
|
175
|
+
tools[specTool.name] = specToolToAISDKTool(specTool, handler, context);
|
|
176
|
+
}
|
|
177
|
+
return tools;
|
|
47
178
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Type-safe tool handler builder.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```typescript
|
|
53
|
-
* const handler = createToolHandler<{ query: string }>((input, ctx) => {
|
|
54
|
-
* return `Searched for: ${input.query}`;
|
|
55
|
-
* });
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
179
|
function createToolHandler(handler) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
180
|
+
return async (input, context) => {
|
|
181
|
+
return handler(input, context);
|
|
182
|
+
};
|
|
62
183
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Build a tool handlers map from an object.
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* ```typescript
|
|
68
|
-
* const handlers = buildToolHandlers({
|
|
69
|
-
* search: async (input: { query: string }) => `Found: ${input.query}`,
|
|
70
|
-
* calculate: async (input: { a: number, b: number }) => `${input.a + input.b}`,
|
|
71
|
-
* });
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
184
|
function buildToolHandlers(handlersObj) {
|
|
75
|
-
|
|
185
|
+
return new Map(Object.entries(handlersObj));
|
|
76
186
|
}
|
|
187
|
+
var init_tool_adapter = __esm(() => {
|
|
188
|
+
init_json_schema_to_zod();
|
|
189
|
+
});
|
|
190
|
+
init_tool_adapter();
|
|
77
191
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
192
|
+
export {
|
|
193
|
+
specToolsToAISDKTools,
|
|
194
|
+
specToolToAISDKTool,
|
|
195
|
+
createToolHandler,
|
|
196
|
+
buildToolHandlers
|
|
197
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.test.d.ts","sourceRoot":"","sources":["../../src/tools/tools.test.ts"],"names":[],"mappings":""}
|