@devries-cameron20 / composio Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 04:45 UTC

next
ts 228 lines 5.05 KB
Raw
1 export const toolMocks = {
2 rawTool: {
3 slug: 'COMPOSIO_TOOL',
4 name: 'Composio Tool',
5 description: 'A tool for testing',
6 input_parameters: {
7 type: 'object',
8 properties: {
9 query: {
10 type: 'string',
11 description: 'The search query',
12 },
13 },
14 additionalProperties: false,
15 },
16 output_parameters: {
17 type: 'object',
18 properties: {
19 results: {
20 type: 'array',
21 items: {
22 type: 'string',
23 },
24 },
25 },
26 additionalProperties: false,
27 },
28 toolkit: {
29 logo: 'https://example.com/logo.png',
30 slug: 'test-toolkit',
31 name: 'Test Toolkit',
32 },
33 },
34
35 customTool: {
36 slug: 'CUSTOM_TOOL',
37 name: 'Custom Tool',
38 description: 'A custom tool for testing',
39 input_parameters: {
40 type: 'object',
41 properties: {
42 query: {
43 type: 'string',
44 description: 'The search query',
45 },
46 },
47 },
48 output_parameters: {
49 type: 'object',
50 properties: {
51 results: {
52 type: 'array',
53 items: {
54 type: 'string',
55 },
56 },
57 },
58 },
59 toolkit: {
60 logo: 'https://example.com/logo.png',
61 slug: 'custom',
62 name: 'custom',
63 },
64 },
65
66 transformedTool: {
67 slug: 'COMPOSIO_TOOL',
68 name: 'Composio Tool',
69 description: 'A tool for testing',
70 inputParameters: {
71 type: 'object',
72 properties: {
73 query: {
74 type: 'string',
75 description: 'The search query',
76 },
77 },
78 additionalProperties: false,
79 },
80 outputParameters: {
81 type: 'object',
82 properties: {
83 results: {
84 type: 'array',
85 items: {
86 type: 'string',
87 },
88 },
89 },
90 additionalProperties: false,
91 },
92 },
93 // Fixture for the MCP-shaped metadata regression tests (see
94 // normalizeRawToolParameters in models/Tools.ts).
95 mcpRawTool: {
96 slug: 'GRANOLA_MCP_LIST_MEETINGS',
97 name: 'List Meetings',
98 description: 'Lists Granola meetings via MCP',
99 input_parameters: {
100 type: 'object',
101 properties: {
102 time_range: {
103 type: 'string',
104 description: 'Window to query',
105 },
106 },
107 additionalProperties: false,
108 },
109 output_parameters: {},
110 toolkit: {
111 logo: 'https://example.com/granola.png',
112 slug: 'granola_mcp',
113 name: 'Granola MCP',
114 },
115 version: '20260206_00',
116 },
117
118 // Both inputs and outputs empty — pins the both-empty branch of
119 // normalizeRawToolParameters.
120 mcpRawToolBothEmpty: {
121 slug: 'SOME_MCP_PING',
122 name: 'Ping',
123 description: 'Trivial MCP tool with no inputs and no outputs',
124 input_parameters: {},
125 output_parameters: {},
126 toolkit: {
127 logo: 'https://example.com/x.png',
128 slug: 'some_mcp',
129 name: 'Some MCP',
130 },
131 version: '20260206_00',
132 },
133
134 // transformed response from the sdk
135 toolExecuteResponse: {
136 data: {
137 results: true,
138 },
139 error: null,
140 successful: true,
141 logId: '123',
142 sessionInfo: {},
143 },
144 // response from the client
145 rawToolExecuteResponse: {
146 data: {
147 results: true,
148 },
149 error: null,
150 successful: true,
151 log_id: '123',
152 session_info: {},
153 },
154 };
155
156 export const toolkitMocks = {
157 rawToolkit: {
158 name: 'Test Toolkit',
159 slug: 'TEST_TOOLKIT',
160 meta: {
161 categories: [
162 {
163 slug: 'other-/-miscellaneous',
164 name: 'Other / Miscellaneous',
165 },
166 ],
167 createdAt: '2024-06-14T12:12:24.632Z',
168 description: 'test description',
169 logo: 'https://cdn.jsdelivr.net/gh/ComposioHQ/open-logos@master/hackernews.png',
170 toolsCount: 6,
171 triggersCount: 0,
172 updatedAt: '2025-05-19T05:36:24.455Z',
173 },
174 isLocalToolkit: false,
175 composioManagedAuthSchemes: [],
176 authConfigDetails: [
177 {
178 name: 'Test toolkit',
179 mode: 'NO_AUTH',
180 fields: {
181 authConfigCreation: {
182 optional: [],
183 required: [],
184 },
185 connectedAccountInitiation: {
186 optional: [],
187 required: [],
188 },
189 },
190 proxy: {},
191 },
192 ],
193 },
194 };
195
196 export const connectedAccountMocks = {
197 rawConnectedAccountsResponse: {
198 items: [
199 {
200 toolkit: {
201 slug: 'TEST_TOOLKIT',
202 },
203 auth_config: {
204 id: 'test-auth-config',
205 auth_scheme: 'OAUTH2',
206 is_composio_managed: true,
207 is_disabled: false,
208 },
209 id: 'test-connected-account-id',
210 user_id: 'default',
211 status: 'ACTIVE',
212 created_at: '2025-05-16T12:42:44.957Z',
213 updated_at: '2025-05-16T12:42:49.676Z',
214 data: {
215 redirectUrl: 'https://test.com',
216 code_verifier: 'test-core-verifier',
217 callback_url: 'https://test.com',
218 access_token: 'secret-access-token',
219 token_type: 'bearer',
220 scope: 'public_repo,user',
221 },
222 is_disabled: false,
223 status_reason: null,
224 uuid: 'test-uuid',
225 },
226 ],
227 },
228 };