mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-26 08:56:22 +02:00
35 lines
773 B
TypeScript
35 lines
773 B
TypeScript
import { z } from "zod";
|
|
|
|
export const BaseTool = z.object({
|
|
name: z.string(),
|
|
});
|
|
|
|
export const BuiltinTool = BaseTool.extend({
|
|
type: z.literal("builtin"),
|
|
});
|
|
|
|
export const McpTool = BaseTool.extend({
|
|
type: z.literal("mcp"),
|
|
description: z.string(),
|
|
inputSchema: z.any(),
|
|
mcpServerName: z.string(),
|
|
});
|
|
|
|
export const AgentAsATool = BaseTool.extend({
|
|
type: z.literal("agent"),
|
|
});
|
|
|
|
export const ToolAttachment = z.discriminatedUnion("type", [
|
|
BuiltinTool,
|
|
McpTool,
|
|
AgentAsATool,
|
|
]);
|
|
|
|
export const Agent = z.object({
|
|
name: z.string(),
|
|
provider: z.string().optional(),
|
|
model: z.string().optional(),
|
|
description: z.string(),
|
|
instructions: z.string(),
|
|
tools: z.record(z.string(), ToolAttachment).optional(),
|
|
});
|