@contractspec/lib.ai-agent 1.57.0 → 1.58.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
package/dist/tools/index.js
CHANGED
|
@@ -1,6 +1,345 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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;
|
|
5
14
|
|
|
6
|
-
|
|
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";
|
|
150
|
+
function specToolToAISDKTool(specTool, handler, context = {}) {
|
|
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
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function specToolsToAISDKTools(specTools, handlers, context = {}) {
|
|
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;
|
|
178
|
+
}
|
|
179
|
+
function createToolHandler(handler) {
|
|
180
|
+
return async (input, context) => {
|
|
181
|
+
return handler(input, context);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function buildToolHandlers(handlersObj) {
|
|
185
|
+
return new Map(Object.entries(handlersObj));
|
|
186
|
+
}
|
|
187
|
+
var init_tool_adapter = __esm(() => {
|
|
188
|
+
init_json_schema_to_zod();
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// src/tools/knowledge-tool.ts
|
|
192
|
+
import { tool as tool2 } from "ai";
|
|
193
|
+
import * as z2 from "zod";
|
|
194
|
+
function createKnowledgeQueryTool(retriever, knowledgeRefs) {
|
|
195
|
+
const optionalSpaces = knowledgeRefs.filter((k) => !k.required).map((k) => k.key).filter((key) => retriever.supportsSpace(key));
|
|
196
|
+
if (optionalSpaces.length === 0) {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
const spaceDescriptions = knowledgeRefs.filter((k) => !k.required && retriever.supportsSpace(k.key)).map((k) => `- ${k.key}: ${k.instructions ?? "Knowledge space"}`).join(`
|
|
200
|
+
`);
|
|
201
|
+
return tool2({
|
|
202
|
+
description: `Query knowledge bases for relevant information. Use this tool when you need to look up specific information that may not be in your context.
|
|
203
|
+
|
|
204
|
+
Available knowledge spaces:
|
|
205
|
+
${spaceDescriptions}`,
|
|
206
|
+
inputSchema: z2.object({
|
|
207
|
+
query: z2.string().describe("The question or search query to find relevant information"),
|
|
208
|
+
spaceKey: z2.enum(optionalSpaces).optional().describe("Specific knowledge space to query. If omitted, searches all available spaces."),
|
|
209
|
+
topK: z2.number().optional().default(5).describe("Maximum number of results to return")
|
|
210
|
+
}),
|
|
211
|
+
execute: async ({ query, spaceKey, topK }) => {
|
|
212
|
+
const spacesToSearch = spaceKey ? [spaceKey] : optionalSpaces;
|
|
213
|
+
const allResults = [];
|
|
214
|
+
for (const space of spacesToSearch) {
|
|
215
|
+
try {
|
|
216
|
+
const results = await retriever.retrieve(query, {
|
|
217
|
+
spaceKey: space,
|
|
218
|
+
topK: topK ?? 5
|
|
219
|
+
});
|
|
220
|
+
for (const result of results) {
|
|
221
|
+
allResults.push({
|
|
222
|
+
space,
|
|
223
|
+
content: result.content,
|
|
224
|
+
score: result.score
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
} catch (error) {
|
|
228
|
+
console.warn(`Failed to query knowledge space ${space}:`, error);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (allResults.length === 0) {
|
|
232
|
+
return "No relevant information found in the knowledge bases.";
|
|
233
|
+
}
|
|
234
|
+
allResults.sort((a, b) => b.score - a.score);
|
|
235
|
+
const topResults = allResults.slice(0, topK ?? 5);
|
|
236
|
+
return topResults.map((r, i) => `[Source ${i + 1} - ${r.space}] (relevance: ${(r.score * 100).toFixed(0)}%)
|
|
237
|
+
${r.content}`).join(`
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
`);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
var init_knowledge_tool = () => {};
|
|
246
|
+
|
|
247
|
+
// src/tools/mcp-client.ts
|
|
248
|
+
import { experimental_createMCPClient } from "@ai-sdk/mcp";
|
|
249
|
+
import { Experimental_StdioMCPTransport as StdioClientTransport } from "@ai-sdk/mcp/mcp-stdio";
|
|
250
|
+
async function mcpServerToTools(config) {
|
|
251
|
+
const transport = new StdioClientTransport({
|
|
252
|
+
command: config.command,
|
|
253
|
+
args: config.args,
|
|
254
|
+
env: config.env
|
|
255
|
+
});
|
|
256
|
+
const client = await experimental_createMCPClient({ transport });
|
|
257
|
+
const tools = await client.tools();
|
|
258
|
+
return {
|
|
259
|
+
tools,
|
|
260
|
+
cleanup: () => client.close()
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
async function createMcpToolsets(configs) {
|
|
264
|
+
const results = await Promise.all(configs.map(mcpServerToTools));
|
|
265
|
+
const combinedTools = {};
|
|
266
|
+
for (const result of results) {
|
|
267
|
+
Object.assign(combinedTools, result.tools);
|
|
268
|
+
}
|
|
269
|
+
return {
|
|
270
|
+
tools: combinedTools,
|
|
271
|
+
cleanup: async () => {
|
|
272
|
+
await Promise.all(results.map((r) => r.cleanup()));
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// src/tools/mcp-server.ts
|
|
278
|
+
init_json_schema_to_zod();
|
|
279
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
280
|
+
import * as z3 from "zod";
|
|
281
|
+
function agentToMcpServer(agent, spec) {
|
|
282
|
+
const server = new McpServer({
|
|
283
|
+
name: spec.meta.key,
|
|
284
|
+
version: `${spec.meta.version}`
|
|
285
|
+
});
|
|
286
|
+
server.registerTool(spec.meta.key, {
|
|
287
|
+
description: spec.description ?? `Interact with ${spec.meta.key} agent`,
|
|
288
|
+
inputSchema: z3.object({
|
|
289
|
+
message: z3.string().describe("The message or query to send to the agent"),
|
|
290
|
+
sessionId: z3.string().optional().describe("Optional session ID to continue a conversation")
|
|
291
|
+
})
|
|
292
|
+
}, async (args) => {
|
|
293
|
+
const { message, sessionId } = args;
|
|
294
|
+
const result = await agent.generate({
|
|
295
|
+
prompt: message,
|
|
296
|
+
options: { sessionId }
|
|
297
|
+
});
|
|
298
|
+
return {
|
|
299
|
+
content: [
|
|
300
|
+
{
|
|
301
|
+
type: "text",
|
|
302
|
+
text: result.text
|
|
303
|
+
}
|
|
304
|
+
]
|
|
305
|
+
};
|
|
306
|
+
});
|
|
307
|
+
for (const toolConfig of spec.tools) {
|
|
308
|
+
const inputSchema = toolConfig.schema ? jsonSchemaToZodSafe(toolConfig.schema) : z3.object({});
|
|
309
|
+
server.registerTool(`${spec.meta.key}.${toolConfig.name}`, {
|
|
310
|
+
description: toolConfig.description ?? `Execute ${toolConfig.name} tool`,
|
|
311
|
+
inputSchema
|
|
312
|
+
}, async (args) => {
|
|
313
|
+
const result = await agent.generate({
|
|
314
|
+
prompt: `Execute the ${toolConfig.name} tool with the following arguments: ${JSON.stringify(args)}`
|
|
315
|
+
});
|
|
316
|
+
return {
|
|
317
|
+
content: [
|
|
318
|
+
{
|
|
319
|
+
type: "text",
|
|
320
|
+
text: result.text
|
|
321
|
+
}
|
|
322
|
+
]
|
|
323
|
+
};
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
return server;
|
|
327
|
+
}
|
|
328
|
+
function createAgentMcpServer(config) {
|
|
329
|
+
return agentToMcpServer(config.agent, config.spec);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// src/tools/index.ts
|
|
333
|
+
init_tool_adapter();
|
|
334
|
+
init_knowledge_tool();
|
|
335
|
+
export {
|
|
336
|
+
specToolsToAISDKTools,
|
|
337
|
+
specToolToAISDKTool,
|
|
338
|
+
mcpServerToTools,
|
|
339
|
+
createToolHandler,
|
|
340
|
+
createMcpToolsets,
|
|
341
|
+
createKnowledgeQueryTool,
|
|
342
|
+
createAgentMcpServer,
|
|
343
|
+
buildToolHandlers,
|
|
344
|
+
agentToMcpServer
|
|
345
|
+
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
//#region src/tools/knowledge-tool.d.ts
|
|
1
|
+
import { type Tool } from 'ai';
|
|
2
|
+
import type { KnowledgeRetriever } from '@contractspec/lib.knowledge/retriever';
|
|
3
|
+
import type { AgentKnowledgeRef } from '../spec/spec';
|
|
6
4
|
/**
|
|
7
5
|
* Create a knowledge query tool for dynamic RAG.
|
|
8
6
|
*
|
|
@@ -14,7 +12,5 @@ import { KnowledgeRetriever } from "@contractspec/lib.knowledge/retriever";
|
|
|
14
12
|
* @param knowledgeRefs - Knowledge references from the agent spec
|
|
15
13
|
* @returns AI SDK CoreTool for knowledge queries
|
|
16
14
|
*/
|
|
17
|
-
declare function createKnowledgeQueryTool(retriever: KnowledgeRetriever, knowledgeRefs: AgentKnowledgeRef[]): Tool<any, any> | null;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { createKnowledgeQueryTool };
|
|
15
|
+
export declare function createKnowledgeQueryTool(retriever: KnowledgeRetriever, knowledgeRefs: AgentKnowledgeRef[]): Tool<any, any> | null;
|
|
20
16
|
//# sourceMappingURL=knowledge-tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knowledge-tool.d.ts","
|
|
1
|
+
{"version":3,"file":"knowledge-tool.d.ts","sourceRoot":"","sources":["../../src/tools/knowledge-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,IAAI,EAAE,MAAM,IAAI,CAAC;AAErC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,kBAAkB,EAC7B,aAAa,EAAE,iBAAiB,EAAE,GAEjC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAgFvB"}
|
|
@@ -1,54 +1,74 @@
|
|
|
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
|
-
* This tool allows the agent to query optional knowledge spaces
|
|
9
|
-
* at runtime. Required knowledge is injected statically via
|
|
10
|
-
* the knowledge injector.
|
|
11
|
-
*
|
|
12
|
-
* @param retriever - The knowledge retriever to use
|
|
13
|
-
* @param knowledgeRefs - Knowledge references from the agent spec
|
|
14
|
-
* @returns AI SDK CoreTool for knowledge queries
|
|
15
|
-
*/
|
|
15
|
+
// src/tools/knowledge-tool.ts
|
|
16
|
+
import { tool } from "ai";
|
|
17
|
+
import * as z from "zod";
|
|
16
18
|
function createKnowledgeQueryTool(retriever, knowledgeRefs) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const optionalSpaces = knowledgeRefs.filter((k) => !k.required).map((k) => k.key).filter((key) => retriever.supportsSpace(key));
|
|
20
|
+
if (optionalSpaces.length === 0) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const spaceDescriptions = knowledgeRefs.filter((k) => !k.required && retriever.supportsSpace(k.key)).map((k) => `- ${k.key}: ${k.instructions ?? "Knowledge space"}`).join(`
|
|
24
|
+
`);
|
|
25
|
+
return tool({
|
|
26
|
+
description: `Query knowledge bases for relevant information. Use this tool when you need to look up specific information that may not be in your context.
|
|
21
27
|
|
|
22
28
|
Available knowledge spaces:
|
|
23
|
-
${
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
29
|
+
${spaceDescriptions}`,
|
|
30
|
+
inputSchema: z.object({
|
|
31
|
+
query: z.string().describe("The question or search query to find relevant information"),
|
|
32
|
+
spaceKey: z.enum(optionalSpaces).optional().describe("Specific knowledge space to query. If omitted, searches all available spaces."),
|
|
33
|
+
topK: z.number().optional().default(5).describe("Maximum number of results to return")
|
|
34
|
+
}),
|
|
35
|
+
execute: async ({ query, spaceKey, topK }) => {
|
|
36
|
+
const spacesToSearch = spaceKey ? [spaceKey] : optionalSpaces;
|
|
37
|
+
const allResults = [];
|
|
38
|
+
for (const space of spacesToSearch) {
|
|
39
|
+
try {
|
|
40
|
+
const results = await retriever.retrieve(query, {
|
|
41
|
+
spaceKey: space,
|
|
42
|
+
topK: topK ?? 5
|
|
43
|
+
});
|
|
44
|
+
for (const result of results) {
|
|
45
|
+
allResults.push({
|
|
46
|
+
space,
|
|
47
|
+
content: result.content,
|
|
48
|
+
score: result.score
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.warn(`Failed to query knowledge space ${space}:`, error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (allResults.length === 0) {
|
|
56
|
+
return "No relevant information found in the knowledge bases.";
|
|
57
|
+
}
|
|
58
|
+
allResults.sort((a, b) => b.score - a.score);
|
|
59
|
+
const topResults = allResults.slice(0, topK ?? 5);
|
|
60
|
+
return topResults.map((r, i) => `[Source ${i + 1} - ${r.space}] (relevance: ${(r.score * 100).toFixed(0)}%)
|
|
61
|
+
${r.content}`).join(`
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
`);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
50
68
|
}
|
|
69
|
+
var init_knowledge_tool = () => {};
|
|
70
|
+
init_knowledge_tool();
|
|
51
71
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
72
|
+
export {
|
|
73
|
+
createKnowledgeQueryTool
|
|
74
|
+
};
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import { Tool } from
|
|
2
|
-
|
|
3
|
-
//#region src/tools/mcp-client.d.ts
|
|
1
|
+
import type { Tool } from 'ai';
|
|
4
2
|
/**
|
|
5
3
|
* Configuration for connecting to an MCP server.
|
|
6
4
|
*/
|
|
7
|
-
interface McpClientConfig {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
export interface McpClientConfig {
|
|
6
|
+
/** Display name for the MCP server */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Command to spawn the MCP server process */
|
|
9
|
+
command: string;
|
|
10
|
+
/** Arguments to pass to the command */
|
|
11
|
+
args?: string[];
|
|
12
|
+
/** Environment variables for the process */
|
|
13
|
+
env?: Record<string, string>;
|
|
16
14
|
}
|
|
17
15
|
/**
|
|
18
16
|
* Result of creating an MCP client with tools.
|
|
19
17
|
*/
|
|
20
|
-
interface McpClientResult {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
export interface McpClientResult {
|
|
19
|
+
/** AI SDK tools from the MCP server */
|
|
20
|
+
tools: Record<string, Tool<unknown, unknown>>;
|
|
21
|
+
/** Cleanup function to close the connection */
|
|
22
|
+
cleanup: () => Promise<void>;
|
|
25
23
|
}
|
|
26
24
|
/**
|
|
27
25
|
* Create AI SDK tools from an MCP server.
|
|
@@ -45,14 +43,12 @@ interface McpClientResult {
|
|
|
45
43
|
* await cleanup();
|
|
46
44
|
* ```
|
|
47
45
|
*/
|
|
48
|
-
declare function mcpServerToTools(config: McpClientConfig): Promise<McpClientResult>;
|
|
46
|
+
export declare function mcpServerToTools(config: McpClientConfig): Promise<McpClientResult>;
|
|
49
47
|
/**
|
|
50
48
|
* Create multiple MCP tool sets from configurations.
|
|
51
49
|
*
|
|
52
50
|
* @param configs - Array of MCP server configurations
|
|
53
51
|
* @returns Combined tools and cleanup function
|
|
54
52
|
*/
|
|
55
|
-
declare function createMcpToolsets(configs: McpClientConfig[]): Promise<McpClientResult>;
|
|
56
|
-
//#endregion
|
|
57
|
-
export { McpClientConfig, McpClientResult, createMcpToolsets, mcpServerToTools };
|
|
53
|
+
export declare function createMcpToolsets(configs: McpClientConfig[]): Promise<McpClientResult>;
|
|
58
54
|
//# sourceMappingURL=mcp-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-client.d.ts","
|
|
1
|
+
{"version":3,"file":"mcp-client.d.ts","sourceRoot":"","sources":["../../src/tools/mcp-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE/B;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAC9C,+CAA+C;IAC/C,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,eAAe,CAAC,CAc1B;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,eAAe,EAAE,GACzB,OAAO,CAAC,eAAe,CAAC,CAc1B"}
|
package/dist/tools/mcp-client.js
CHANGED
|
@@ -1,58 +1,47 @@
|
|
|
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
|
-
* This adapter allows ContractSpec agents to consume tools
|
|
9
|
-
* from external MCP servers (e.g., filesystem, database, etc.).
|
|
10
|
-
*
|
|
11
|
-
* @param config - MCP server configuration
|
|
12
|
-
* @returns Tools and cleanup function
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* const { tools, cleanup } = await mcpServerToTools({
|
|
17
|
-
* name: 'filesystem',
|
|
18
|
-
* command: 'npx',
|
|
19
|
-
* args: ['-y', '@modelcontextprotocol/server-filesystem', '/path'],
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
* // Use tools in agent...
|
|
23
|
-
*
|
|
24
|
-
* await cleanup();
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
15
|
+
// src/tools/mcp-client.ts
|
|
16
|
+
import { experimental_createMCPClient } from "@ai-sdk/mcp";
|
|
17
|
+
import { Experimental_StdioMCPTransport as StdioClientTransport } from "@ai-sdk/mcp/mcp-stdio";
|
|
27
18
|
async function mcpServerToTools(config) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
const transport = new StdioClientTransport({
|
|
20
|
+
command: config.command,
|
|
21
|
+
args: config.args,
|
|
22
|
+
env: config.env
|
|
23
|
+
});
|
|
24
|
+
const client = await experimental_createMCPClient({ transport });
|
|
25
|
+
const tools = await client.tools();
|
|
26
|
+
return {
|
|
27
|
+
tools,
|
|
28
|
+
cleanup: () => client.close()
|
|
29
|
+
};
|
|
37
30
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Create multiple MCP tool sets from configurations.
|
|
40
|
-
*
|
|
41
|
-
* @param configs - Array of MCP server configurations
|
|
42
|
-
* @returns Combined tools and cleanup function
|
|
43
|
-
*/
|
|
44
31
|
async function createMcpToolsets(configs) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
32
|
+
const results = await Promise.all(configs.map(mcpServerToTools));
|
|
33
|
+
const combinedTools = {};
|
|
34
|
+
for (const result of results) {
|
|
35
|
+
Object.assign(combinedTools, result.tools);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
tools: combinedTools,
|
|
39
|
+
cleanup: async () => {
|
|
40
|
+
await Promise.all(results.map((r) => r.cleanup()));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
54
43
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
export {
|
|
45
|
+
mcpServerToTools,
|
|
46
|
+
createMcpToolsets
|
|
47
|
+
};
|