working pass to backend

This commit is contained in:
Dustin Healy 2025-06-26 16:51:14 -07:00
parent dc03986149
commit 7a73d2daf3
10 changed files with 302 additions and 47 deletions

View file

@ -832,3 +832,55 @@ export const createMemory = (data: {
}): Promise<{ created: boolean; memory: q.TUserMemory }> => {
return request.post(endpoints.memories(), data);
};
export const createTool = (toolData: {
name: string;
description: string;
metadata?: Record<string, unknown>;
// MCP-specific fields
url?: string;
icon?: string;
tools?: string[];
trust?: boolean;
customHeaders?: Array<{
id: string;
name: string;
value: string;
}>;
requestTimeout?: number;
connectionTimeout?: number;
}): Promise<{
id?: string;
mcp_id?: string;
type?: string;
function?: {
name: string;
description: string;
};
metadata:
| Record<string, unknown>
| {
name: string;
description: string;
url?: string;
icon?: string;
tools?: string[];
trust?: boolean;
customHeaders?: Array<{
id: string;
name: string;
value: string;
}>;
requestTimeout?: number;
connectionTimeout?: number;
};
created_at: string;
updated_at: string;
}> => {
return request.post(
endpoints.agents({
path: 'tools/add',
}),
toolData,
);
};

View file

@ -48,6 +48,7 @@ export enum QueryKeys {
banner = 'banner',
/* Memories */
memories = 'memories',
mcpTools = 'mcpTools',
}
export enum MutationKeys {

View file

@ -342,13 +342,17 @@ export type MCPMetadata = Omit<ActionMetadata, 'auth'> & {
description?: string;
url?: string;
tools?: string[];
auth?: MCPAuth;
icon?: string;
trust?: boolean;
customHeaders?: Array<{
id: string;
name: string;
value: string;
}>;
requestTimeout?: number;
connectionTimeout?: number;
};
export type MCPAuth = ActionAuth;
export type AgentToolType = {
tool_id: string;
metadata: ToolMetadata;