Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
ts 26 lines 854 Bytes
Raw
1 import type { AgentIdentity } from 'src/services/agents';
2
3 /**
4 * A READY agent identity as `agents.composio.dev` returns it from `/api/signup` and
5 * `/api/whoami`. Suites override only the fields their scenario is about.
6 */
7 export const makeAgentIdentity = (overrides: Partial<AgentIdentity> = {}): AgentIdentity => ({
8 status: 'READY',
9 slug: 'test-agent',
10 email: 'test-agent@agent.composio.ai',
11 composio_agent_key: 'cak_test_agent',
12 composio: {
13 member_id: 'mem_agent',
14 org_id: 'org_agent',
15 project_id: 'proj_agent',
16 user_api_key: 'uak_agent',
17 },
18 ...overrides,
19 });
20
21 /** A JSON response from the agents API, as the stubbed `fetch` answers it. */
22 export const agentsJsonResponse = (body: unknown, status = 200) =>
23 new Response(JSON.stringify(body), {
24 status,
25 headers: { 'Content-Type': 'application/json' },
26 });