@radaros/core 0.1.0 → 0.2.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/index.d.ts +224 -1
- package/dist/index.js +401 -8
- package/package.json +6 -2
- package/src/a2a/a2a-remote-agent.ts +270 -0
- package/src/a2a/types.ts +142 -0
- package/src/index.ts +24 -0
- package/src/mcp/mcp-client.ts +264 -0
- package/src/tools/tool-executor.ts +17 -9
- package/src/tools/types.ts +2 -0
|
@@ -115,15 +115,23 @@ export class ToolExecutor {
|
|
|
115
115
|
}> = [];
|
|
116
116
|
|
|
117
117
|
for (const tool of this.tools.values()) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
118
|
+
if (tool.rawJsonSchema) {
|
|
119
|
+
defs.push({
|
|
120
|
+
name: tool.name,
|
|
121
|
+
description: tool.description,
|
|
122
|
+
parameters: tool.rawJsonSchema,
|
|
123
|
+
});
|
|
124
|
+
} else {
|
|
125
|
+
const jsonSchema = zodToJsonSchema(tool.parameters, {
|
|
126
|
+
target: "openApi3",
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
defs.push({
|
|
130
|
+
name: tool.name,
|
|
131
|
+
description: tool.description,
|
|
132
|
+
parameters: jsonSchema as Record<string, unknown>,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
127
135
|
}
|
|
128
136
|
|
|
129
137
|
return defs;
|
package/src/tools/types.ts
CHANGED
|
@@ -17,6 +17,8 @@ export interface ToolDef {
|
|
|
17
17
|
description: string;
|
|
18
18
|
parameters: z.ZodObject<any>;
|
|
19
19
|
execute: (args: Record<string, unknown>, ctx: RunContext) => Promise<string | ToolResult>;
|
|
20
|
+
/** Raw JSON Schema to send to the LLM, bypassing Zod-to-JSON conversion (used by MCP tools). */
|
|
21
|
+
rawJsonSchema?: Record<string, unknown>;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
export interface ToolCallResult {
|