diff --git a/apps/rowboat/app/actions/copilot_actions.ts b/apps/rowboat/app/actions/copilot_actions.ts index dcb8a68c..d175509d 100644 --- a/apps/rowboat/app/actions/copilot_actions.ts +++ b/apps/rowboat/app/actions/copilot_actions.ts @@ -74,6 +74,8 @@ export async function getCopilotResponse( const test = { name: 'test', description: 'test', + type: 'custom' as const, + implementation: 'mock' as const, parameters: { type: 'object', properties: {}, diff --git a/apps/rowboat/app/actions/mcp_actions.ts b/apps/rowboat/app/actions/mcp_actions.ts index 9ca6668f..31678422 100644 --- a/apps/rowboat/app/actions/mcp_actions.ts +++ b/apps/rowboat/app/actions/mcp_actions.ts @@ -49,6 +49,8 @@ export async function fetchMcpTools(projectId: string): Promise = { name: mcpTool.name, description: mcpTool.description ?? "", + type: 'library', + implementation: 'default', parameters: { type: "object", properties: props ?? {}, diff --git a/apps/rowboat/app/lib/project_templates.ts b/apps/rowboat/app/lib/project_templates.ts index 43bf2d84..54c72062 100644 --- a/apps/rowboat/app/lib/project_templates.ts +++ b/apps/rowboat/app/lib/project_templates.ts @@ -56,7 +56,18 @@ You are an helpful customer support assistant prompt: "Hello! How can I help you?" } ], - tools: [], + tools: [ + { + "name": "web_search", + "description": "Fetch information from the web based on chat context", + "type": "library", + "parameters": { + "type": "object", + "properties": {}, + }, + "implementation": "default", + } + ], } } diff --git a/apps/rowboat/app/lib/types/workflow_types.ts b/apps/rowboat/app/lib/types/workflow_types.ts index 307563c5..16a7725a 100644 --- a/apps/rowboat/app/lib/types/workflow_types.ts +++ b/apps/rowboat/app/lib/types/workflow_types.ts @@ -34,7 +34,15 @@ export const WorkflowPrompt = z.object({ export const WorkflowTool = z.object({ name: z.string(), description: z.string(), - mockTool: z.boolean().default(false).optional(), + type: z.union([ + z.literal('library'), + z.literal('custom'), + ]).default('custom'), + implementation: z.union([ + z.literal('mock'), + z.literal('default'), + z.literal('api') + ]).default('mock'), autoSubmitMockedResponse: z.boolean().default(false).optional(), mockInstructions: z.string().optional(), parameters: z.object({ diff --git a/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx b/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx index 7b534fc0..3dd317f4 100644 --- a/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx +++ b/apps/rowboat/app/projects/[projectId]/entities/agent_config.tsx @@ -67,7 +67,7 @@ export function AgentConfig({ if (!USE_TRANSFER_CONTROL_OPTIONS && agent.controlType !== 'retain') { handleUpdate({ ...agent, controlType: 'retain' }); } - }, [USE_TRANSFER_CONTROL_OPTIONS, agent.controlType, agent, handleUpdate]); + }, [agent.controlType, agent, handleUpdate]); const validateName = (value: string) => { if (value.length === 0) { diff --git a/apps/rowboat/app/projects/[projectId]/entities/tool_config.tsx b/apps/rowboat/app/projects/[projectId]/entities/tool_config.tsx index 4a827b7f..48c1cbc0 100644 --- a/apps/rowboat/app/projects/[projectId]/entities/tool_config.tsx +++ b/apps/rowboat/app/projects/[projectId]/entities/tool_config.tsx @@ -259,7 +259,7 @@ export function ToolConfig({ } >
- {!isReadOnly && ( + {!isReadOnly && tool.type !== 'library' && (
handleUpdate({ ...tool, - mockTool: value === "mock", - autoSubmitMockedResponse: value === "mock" ? true : undefined + implementation: value as "mock" | "default" | "api", + autoSubmitMockedResponse: value === "mock" ? true : undefined, + mockInstructions: value === "mock" ? tool.mockInstructions : undefined })} orientation="horizontal" classNames={{ @@ -346,20 +347,32 @@ export function ToolConfig({ > Mock tool responses - - Connect tool to your API - + {tool.type === "library" ? ( + + Use default implementation + + ) : ( + + Connect tool to your API + + )}
)} - {tool.mockTool && ( + {tool.implementation === "mock" && (
- {!isReadOnly && ( + {!isReadOnly && tool.type !== 'library' && (