@composio/client 0.1.0-alpha.39 → 0.1.0-alpha.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/client.d.mts +1 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +1 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +1 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/auth-configs.d.mts +41 -3
  12. package/resources/auth-configs.d.mts.map +1 -1
  13. package/resources/auth-configs.d.ts +41 -3
  14. package/resources/auth-configs.d.ts.map +1 -1
  15. package/resources/connected-accounts.d.mts +2656 -964
  16. package/resources/connected-accounts.d.mts.map +1 -1
  17. package/resources/connected-accounts.d.ts +2656 -964
  18. package/resources/connected-accounts.d.ts.map +1 -1
  19. package/resources/files.d.mts +30 -0
  20. package/resources/files.d.mts.map +1 -1
  21. package/resources/files.d.ts +30 -0
  22. package/resources/files.d.ts.map +1 -1
  23. package/resources/index.d.mts +1 -1
  24. package/resources/index.d.ts +1 -1
  25. package/resources/index.js +1 -1
  26. package/resources/index.js.map +1 -1
  27. package/resources/index.mjs +1 -1
  28. package/resources/link.d.mts +410 -1
  29. package/resources/link.d.mts.map +1 -1
  30. package/resources/link.d.ts +410 -1
  31. package/resources/link.d.ts.map +1 -1
  32. package/resources/mcp/custom.d.mts +9 -6
  33. package/resources/mcp/custom.d.mts.map +1 -1
  34. package/resources/mcp/custom.d.ts +9 -6
  35. package/resources/mcp/custom.d.ts.map +1 -1
  36. package/resources/mcp/mcp.d.mts +2 -4
  37. package/resources/mcp/mcp.d.mts.map +1 -1
  38. package/resources/mcp/mcp.d.ts +2 -4
  39. package/resources/mcp/mcp.d.ts.map +1 -1
  40. package/resources/mcp/mcp.js.map +1 -1
  41. package/resources/mcp/mcp.mjs.map +1 -1
  42. package/resources/tool-router/index.d.mts +3 -0
  43. package/resources/tool-router/index.d.mts.map +1 -0
  44. package/resources/tool-router/index.d.ts +3 -0
  45. package/resources/tool-router/index.d.ts.map +1 -0
  46. package/resources/tool-router/index.js +9 -0
  47. package/resources/tool-router/index.js.map +1 -0
  48. package/resources/tool-router/index.mjs +4 -0
  49. package/resources/tool-router/index.mjs.map +1 -0
  50. package/resources/tool-router/session.d.mts +708 -0
  51. package/resources/tool-router/session.d.mts.map +1 -0
  52. package/resources/tool-router/session.d.ts +708 -0
  53. package/resources/tool-router/session.d.ts.map +1 -0
  54. package/resources/tool-router/session.js +98 -0
  55. package/resources/tool-router/session.js.map +1 -0
  56. package/resources/tool-router/session.mjs +94 -0
  57. package/resources/tool-router/session.mjs.map +1 -0
  58. package/resources/tool-router/tool-router.d.mts +91 -0
  59. package/resources/tool-router/tool-router.d.mts.map +1 -0
  60. package/resources/tool-router/tool-router.d.ts +91 -0
  61. package/resources/tool-router/tool-router.d.ts.map +1 -0
  62. package/resources/tool-router/tool-router.js +46 -0
  63. package/resources/tool-router/tool-router.js.map +1 -0
  64. package/resources/tool-router/tool-router.mjs +41 -0
  65. package/resources/tool-router/tool-router.mjs.map +1 -0
  66. package/resources/tool-router.d.mts +1 -86
  67. package/resources/tool-router.d.mts.map +1 -1
  68. package/resources/tool-router.d.ts +1 -86
  69. package/resources/tool-router.d.ts.map +1 -1
  70. package/resources/tool-router.js +2 -34
  71. package/resources/tool-router.js.map +1 -1
  72. package/resources/tool-router.mjs +1 -32
  73. package/resources/tool-router.mjs.map +1 -1
  74. package/resources/toolkits.d.mts +9 -9
  75. package/resources/toolkits.d.ts +9 -9
  76. package/resources/toolkits.js +9 -9
  77. package/resources/toolkits.mjs +9 -9
  78. package/resources/tools.d.mts +161 -45
  79. package/resources/tools.d.mts.map +1 -1
  80. package/resources/tools.d.ts +161 -45
  81. package/resources/tools.d.ts.map +1 -1
  82. package/resources/tools.js +3 -3
  83. package/resources/tools.mjs +3 -3
  84. package/resources/trigger-instances/manage.d.mts +17 -0
  85. package/resources/trigger-instances/manage.d.mts.map +1 -1
  86. package/resources/trigger-instances/manage.d.ts +17 -0
  87. package/resources/trigger-instances/manage.d.ts.map +1 -1
  88. package/resources/trigger-instances/manage.js +17 -0
  89. package/resources/trigger-instances/manage.js.map +1 -1
  90. package/resources/trigger-instances/manage.mjs +17 -0
  91. package/resources/trigger-instances/manage.mjs.map +1 -1
  92. package/resources/trigger-instances/trigger-instances.d.mts +25 -0
  93. package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
  94. package/resources/trigger-instances/trigger-instances.d.ts +25 -0
  95. package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
  96. package/resources/trigger-instances/trigger-instances.js +14 -0
  97. package/resources/trigger-instances/trigger-instances.js.map +1 -1
  98. package/resources/trigger-instances/trigger-instances.mjs +14 -0
  99. package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
  100. package/resources/triggers-types.d.mts +1 -5
  101. package/resources/triggers-types.d.mts.map +1 -1
  102. package/resources/triggers-types.d.ts +1 -5
  103. package/resources/triggers-types.d.ts.map +1 -1
  104. package/resources/triggers-types.js +1 -1
  105. package/resources/triggers-types.mjs +1 -1
  106. package/src/client.ts +5 -5
  107. package/src/resources/auth-configs.ts +43 -3
  108. package/src/resources/connected-accounts.ts +4657 -1579
  109. package/src/resources/files.ts +36 -0
  110. package/src/resources/index.ts +1 -1
  111. package/src/resources/link.ts +741 -1
  112. package/src/resources/mcp/custom.ts +10 -6
  113. package/src/resources/mcp/mcp.ts +2 -4
  114. package/src/resources/tool-router/index.ts +19 -0
  115. package/src/resources/tool-router/session.ts +858 -0
  116. package/src/resources/tool-router/tool-router.ts +137 -0
  117. package/src/resources/tool-router.ts +1 -105
  118. package/src/resources/toolkits.ts +9 -9
  119. package/src/resources/tools.ts +237 -45
  120. package/src/resources/trigger-instances/manage.ts +17 -0
  121. package/src/resources/trigger-instances/trigger-instances.ts +25 -0
  122. package/src/resources/triggers-types.ts +1 -6
  123. package/src/version.ts +1 -1
  124. package/version.d.mts +1 -1
  125. package/version.d.ts +1 -1
  126. package/version.js +1 -1
  127. package/version.mjs +1 -1
@@ -0,0 +1,858 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../core/resource';
4
+ import { APIPromise } from '../../core/api-promise';
5
+ import { buildHeaders } from '../../internal/headers';
6
+ import { RequestOptions } from '../../internal/request-options';
7
+ import { path } from '../../internal/utils/path';
8
+
9
+ export class Session extends APIResource {
10
+ /**
11
+ * Creates a new session for the tool router feature. This endpoint initializes a
12
+ * new session with specified toolkits and their authentication configurations. The
13
+ * session provides an isolated environment for testing and managing tool routing
14
+ * logic with scoped MCP server access.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const session = await client.toolRouter.session.create({
19
+ * user_id: 'user_123456789',
20
+ * });
21
+ * ```
22
+ */
23
+ create(body: SessionCreateParams, options?: RequestOptions): APIPromise<SessionCreateResponse> {
24
+ return this._client.post('/api/v3/tool_router/session', { body, ...options });
25
+ }
26
+
27
+ /**
28
+ * Retrieves an existing tool router session by its ID. Returns the session
29
+ * configuration, MCP server URL, and available tools.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const session = await client.toolRouter.session.retrieve(
34
+ * 'trs_123456789',
35
+ * );
36
+ * ```
37
+ */
38
+ retrieve(sessionID: string, options?: RequestOptions): APIPromise<SessionRetrieveResponse> {
39
+ return this._client.get(path`/api/v3/tool_router/session/${sessionID}`, options);
40
+ }
41
+
42
+ /**
43
+ * Executes a specific tool within a tool router session. The toolkit is
44
+ * automatically inferred from the tool slug. The tool must belong to an allowed
45
+ * toolkit and must not be disabled in the session configuration. This endpoint
46
+ * validates permissions, resolves connected accounts, and executes the tool with
47
+ * the session context.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const response = await client.toolRouter.session.execute(
52
+ * 'trs_LX9uJKBinWWr',
53
+ * { tool_slug: 'GITHUB_CREATE_ISSUE' },
54
+ * );
55
+ * ```
56
+ */
57
+ execute(
58
+ sessionID: string,
59
+ params: SessionExecuteParams,
60
+ options?: RequestOptions,
61
+ ): APIPromise<SessionExecuteResponse> {
62
+ const { 'x-session-access-key': xSessionAccessKey, ...body } = params;
63
+ return this._client.post(path`/api/v3/tool_router/session/${sessionID}/execute`, {
64
+ body,
65
+ ...options,
66
+ headers: buildHeaders([
67
+ { ...(xSessionAccessKey != null ? { 'x-session-access-key': xSessionAccessKey } : undefined) },
68
+ options?.headers,
69
+ ]),
70
+ });
71
+ }
72
+
73
+ /**
74
+ * Initiates an authentication link session for a specific toolkit within a tool
75
+ * router session. Returns a link token and redirect URL that users can use to
76
+ * complete the OAuth flow.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const response = await client.toolRouter.session.link(
81
+ * 'trs_LX9uJKBinWWr',
82
+ * { toolkit: 'github' },
83
+ * );
84
+ * ```
85
+ */
86
+ link(
87
+ sessionID: string,
88
+ body: SessionLinkParams,
89
+ options?: RequestOptions,
90
+ ): APIPromise<SessionLinkResponse> {
91
+ return this._client.post(path`/api/v3/tool_router/session/${sessionID}/link`, { body, ...options });
92
+ }
93
+
94
+ /**
95
+ * Retrieves a cursor-paginated list of toolkits available in the tool router
96
+ * session. Includes toolkit metadata, composio-managed auth schemes, and connected
97
+ * accounts if available. Optionally filter by specific toolkit slugs.
98
+ *
99
+ * @example
100
+ * ```ts
101
+ * const response = await client.toolRouter.session.toolkits(
102
+ * 'trs_123456789',
103
+ * );
104
+ * ```
105
+ */
106
+ toolkits(
107
+ sessionID: string,
108
+ query: SessionToolkitsParams | null | undefined = {},
109
+ options?: RequestOptions,
110
+ ): APIPromise<SessionToolkitsResponse> {
111
+ return this._client.get(path`/api/v3/tool_router/session/${sessionID}/toolkits`, { query, ...options });
112
+ }
113
+ }
114
+
115
+ export interface SessionCreateResponse {
116
+ /**
117
+ * The session configuration including user, toolkits, and overrides
118
+ */
119
+ config: SessionCreateResponse.Config;
120
+
121
+ mcp: SessionCreateResponse.Mcp;
122
+
123
+ /**
124
+ * The identifier of the session
125
+ */
126
+ session_id: string;
127
+
128
+ /**
129
+ * List of available tools in this session
130
+ */
131
+ tool_router_tools: Array<
132
+ | 'COMPOSIO_SEARCH_TOOLS'
133
+ | 'COMPOSIO_MULTI_EXECUTE_TOOL'
134
+ | 'COMPOSIO_MANAGE_CONNECTIONS'
135
+ | 'COMPOSIO_REMOTE_WORKBENCH'
136
+ | 'COMPOSIO_REMOTE_BASH_TOOL'
137
+ >;
138
+ }
139
+
140
+ export namespace SessionCreateResponse {
141
+ /**
142
+ * The session configuration including user, toolkits, and overrides
143
+ */
144
+ export interface Config {
145
+ /**
146
+ * User identifier for this session
147
+ */
148
+ user_id: string;
149
+
150
+ /**
151
+ * Connections configuration
152
+ */
153
+ connections?: Config.Connections;
154
+
155
+ /**
156
+ * Execution configuration
157
+ */
158
+ execution?: Config.Execution;
159
+
160
+ /**
161
+ * Toolkit configuration - either enabled list or disabled list
162
+ */
163
+ toolkits?: Config.Enabled | Config.Disabled;
164
+
165
+ /**
166
+ * Tools configuration
167
+ */
168
+ tools?: Config.Tools;
169
+ }
170
+
171
+ export namespace Config {
172
+ /**
173
+ * Connections configuration
174
+ */
175
+ export interface Connections {
176
+ /**
177
+ * Auth config overrides per toolkit
178
+ */
179
+ auth_config_overrides?: { [key: string]: string };
180
+
181
+ /**
182
+ * Whether to enable the connection manager for automatic connection handling
183
+ */
184
+ auto_manage_connections?: boolean;
185
+
186
+ /**
187
+ * Custom callback URI for connected account auth flows
188
+ */
189
+ callback_uri?: string;
190
+
191
+ /**
192
+ * Connected account overrides per toolkit
193
+ */
194
+ connected_account_overrides?: { [key: string]: string };
195
+
196
+ /**
197
+ * Whether to auto-infer auth scopes from tools
198
+ */
199
+ infer_scopes_from_tools?: boolean;
200
+ }
201
+
202
+ /**
203
+ * Execution configuration
204
+ */
205
+ export interface Execution {
206
+ /**
207
+ * Whether to allow proxy execute calls in the workbench
208
+ */
209
+ proxy_execution_enabled?: boolean;
210
+
211
+ /**
212
+ * Maximum execution time for workbench operations in seconds
213
+ */
214
+ timeout_seconds?: number;
215
+ }
216
+
217
+ export interface Enabled {
218
+ enabled: Array<string>;
219
+ }
220
+
221
+ export interface Disabled {
222
+ disabled: Array<string>;
223
+ }
224
+
225
+ /**
226
+ * Tools configuration
227
+ */
228
+ export interface Tools {
229
+ /**
230
+ * Tool filtering configuration
231
+ */
232
+ filters?: Tools.Filters;
233
+
234
+ /**
235
+ * Tool-level overrides per toolkit
236
+ */
237
+ overrides?: { [key: string]: Tools.Enabled | Tools.Disabled };
238
+ }
239
+
240
+ export namespace Tools {
241
+ /**
242
+ * Tool filtering configuration
243
+ */
244
+ export interface Filters {
245
+ /**
246
+ * Filter tools by specific tags
247
+ */
248
+ tags?: Filters.Tags;
249
+ }
250
+
251
+ export namespace Filters {
252
+ /**
253
+ * Filter tools by specific tags
254
+ */
255
+ export interface Tags {
256
+ /**
257
+ * Exclude tools that have these tags
258
+ */
259
+ exclude?: Array<string>;
260
+
261
+ /**
262
+ * Only include tools that have these tags
263
+ */
264
+ include?: Array<string>;
265
+ }
266
+ }
267
+
268
+ export interface Enabled {
269
+ enabled: Array<string>;
270
+ }
271
+
272
+ export interface Disabled {
273
+ disabled: Array<string>;
274
+ }
275
+ }
276
+ }
277
+
278
+ export interface Mcp {
279
+ /**
280
+ * The type of the MCP server. Can be http
281
+ */
282
+ type: 'HTTP';
283
+
284
+ /**
285
+ * The URL of the MCP server
286
+ */
287
+ url: string;
288
+ }
289
+ }
290
+
291
+ export interface SessionRetrieveResponse {
292
+ /**
293
+ * The session configuration including user, toolkits, and overrides
294
+ */
295
+ config: SessionRetrieveResponse.Config;
296
+
297
+ mcp: SessionRetrieveResponse.Mcp;
298
+
299
+ /**
300
+ * The identifier of the session
301
+ */
302
+ session_id: string;
303
+
304
+ /**
305
+ * List of available tools in this session
306
+ */
307
+ tool_router_tools: Array<
308
+ | 'COMPOSIO_SEARCH_TOOLS'
309
+ | 'COMPOSIO_MULTI_EXECUTE_TOOL'
310
+ | 'COMPOSIO_MANAGE_CONNECTIONS'
311
+ | 'COMPOSIO_REMOTE_WORKBENCH'
312
+ | 'COMPOSIO_REMOTE_BASH_TOOL'
313
+ >;
314
+ }
315
+
316
+ export namespace SessionRetrieveResponse {
317
+ /**
318
+ * The session configuration including user, toolkits, and overrides
319
+ */
320
+ export interface Config {
321
+ /**
322
+ * User identifier for this session
323
+ */
324
+ user_id: string;
325
+
326
+ /**
327
+ * Connections configuration
328
+ */
329
+ connections?: Config.Connections;
330
+
331
+ /**
332
+ * Execution configuration
333
+ */
334
+ execution?: Config.Execution;
335
+
336
+ /**
337
+ * Toolkit configuration - either enabled list or disabled list
338
+ */
339
+ toolkits?: Config.Enabled | Config.Disabled;
340
+
341
+ /**
342
+ * Tools configuration
343
+ */
344
+ tools?: Config.Tools;
345
+ }
346
+
347
+ export namespace Config {
348
+ /**
349
+ * Connections configuration
350
+ */
351
+ export interface Connections {
352
+ /**
353
+ * Auth config overrides per toolkit
354
+ */
355
+ auth_config_overrides?: { [key: string]: string };
356
+
357
+ /**
358
+ * Whether to enable the connection manager for automatic connection handling
359
+ */
360
+ auto_manage_connections?: boolean;
361
+
362
+ /**
363
+ * Custom callback URI for connected account auth flows
364
+ */
365
+ callback_uri?: string;
366
+
367
+ /**
368
+ * Connected account overrides per toolkit
369
+ */
370
+ connected_account_overrides?: { [key: string]: string };
371
+
372
+ /**
373
+ * Whether to auto-infer auth scopes from tools
374
+ */
375
+ infer_scopes_from_tools?: boolean;
376
+ }
377
+
378
+ /**
379
+ * Execution configuration
380
+ */
381
+ export interface Execution {
382
+ /**
383
+ * Whether to allow proxy execute calls in the workbench
384
+ */
385
+ proxy_execution_enabled?: boolean;
386
+
387
+ /**
388
+ * Maximum execution time for workbench operations in seconds
389
+ */
390
+ timeout_seconds?: number;
391
+ }
392
+
393
+ export interface Enabled {
394
+ enabled: Array<string>;
395
+ }
396
+
397
+ export interface Disabled {
398
+ disabled: Array<string>;
399
+ }
400
+
401
+ /**
402
+ * Tools configuration
403
+ */
404
+ export interface Tools {
405
+ /**
406
+ * Tool filtering configuration
407
+ */
408
+ filters?: Tools.Filters;
409
+
410
+ /**
411
+ * Tool-level overrides per toolkit
412
+ */
413
+ overrides?: { [key: string]: Tools.Enabled | Tools.Disabled };
414
+ }
415
+
416
+ export namespace Tools {
417
+ /**
418
+ * Tool filtering configuration
419
+ */
420
+ export interface Filters {
421
+ /**
422
+ * Filter tools by specific tags
423
+ */
424
+ tags?: Filters.Tags;
425
+ }
426
+
427
+ export namespace Filters {
428
+ /**
429
+ * Filter tools by specific tags
430
+ */
431
+ export interface Tags {
432
+ /**
433
+ * Exclude tools that have these tags
434
+ */
435
+ exclude?: Array<string>;
436
+
437
+ /**
438
+ * Only include tools that have these tags
439
+ */
440
+ include?: Array<string>;
441
+ }
442
+ }
443
+
444
+ export interface Enabled {
445
+ enabled: Array<string>;
446
+ }
447
+
448
+ export interface Disabled {
449
+ disabled: Array<string>;
450
+ }
451
+ }
452
+ }
453
+
454
+ export interface Mcp {
455
+ /**
456
+ * The type of the MCP server. Can be http
457
+ */
458
+ type: 'HTTP';
459
+
460
+ /**
461
+ * The URL of the MCP server
462
+ */
463
+ url: string;
464
+ }
465
+ }
466
+
467
+ export interface SessionExecuteResponse {
468
+ /**
469
+ * The data returned by the tool execution
470
+ */
471
+ data: { [key: string]: unknown };
472
+
473
+ /**
474
+ * Error message if the execution failed, null otherwise
475
+ */
476
+ error: string | null;
477
+
478
+ /**
479
+ * Unique identifier for the execution log
480
+ */
481
+ log_id: string;
482
+ }
483
+
484
+ export interface SessionLinkResponse {
485
+ /**
486
+ * The unique identifier for the connected account
487
+ */
488
+ connected_account_id: string;
489
+
490
+ /**
491
+ * Token used to complete the authentication flow
492
+ */
493
+ link_token: string;
494
+
495
+ /**
496
+ * The URL where users should be redirected to complete OAuth
497
+ */
498
+ redirect_url: string;
499
+ }
500
+
501
+ export interface SessionToolkitsResponse {
502
+ current_page: number;
503
+
504
+ items: Array<SessionToolkitsResponse.Item>;
505
+
506
+ total_items: number;
507
+
508
+ total_pages: number;
509
+
510
+ next_cursor?: string | null;
511
+ }
512
+
513
+ export namespace SessionToolkitsResponse {
514
+ export interface Item {
515
+ /**
516
+ * Available Composio-managed auth schemes
517
+ */
518
+ composio_managed_auth_schemes: Array<string>;
519
+
520
+ /**
521
+ * Connected account if available
522
+ */
523
+ connected_account: Item.ConnectedAccount | null;
524
+
525
+ /**
526
+ * Whether the toolkit is enabled
527
+ */
528
+ enabled: boolean;
529
+
530
+ /**
531
+ * Toolkit metadata
532
+ */
533
+ meta: Item.Meta;
534
+
535
+ /**
536
+ * Display name of the toolkit
537
+ */
538
+ name: string;
539
+
540
+ /**
541
+ * Unique slug identifier
542
+ */
543
+ slug: string;
544
+ }
545
+
546
+ export namespace Item {
547
+ /**
548
+ * Connected account if available
549
+ */
550
+ export interface ConnectedAccount {
551
+ /**
552
+ * Connected account identifier
553
+ */
554
+ id: string;
555
+
556
+ /**
557
+ * Auth config details
558
+ */
559
+ auth_config: ConnectedAccount.AuthConfig;
560
+
561
+ /**
562
+ * Creation timestamp
563
+ */
564
+ created_at: string;
565
+
566
+ /**
567
+ * Connection status
568
+ */
569
+ status: string;
570
+
571
+ /**
572
+ * Last update timestamp
573
+ */
574
+ updated_at: string;
575
+
576
+ /**
577
+ * User identifier
578
+ */
579
+ user_id: string;
580
+ }
581
+
582
+ export namespace ConnectedAccount {
583
+ /**
584
+ * Auth config details
585
+ */
586
+ export interface AuthConfig {
587
+ /**
588
+ * Auth config identifier
589
+ */
590
+ id: string;
591
+
592
+ /**
593
+ * Authentication scheme type
594
+ */
595
+ auth_scheme: string;
596
+
597
+ /**
598
+ * Whether this is a Composio-managed auth config
599
+ */
600
+ is_composio_managed: boolean;
601
+ }
602
+ }
603
+
604
+ /**
605
+ * Toolkit metadata
606
+ */
607
+ export interface Meta {
608
+ /**
609
+ * Description of the toolkit
610
+ */
611
+ description: string;
612
+
613
+ /**
614
+ * URL to the toolkit logo
615
+ */
616
+ logo: string;
617
+ }
618
+ }
619
+ }
620
+
621
+ export interface SessionCreateParams {
622
+ /**
623
+ * The identifier of the user who is initiating the session, ideally a unique
624
+ * identifier from your database like a user ID or email address
625
+ */
626
+ user_id: string;
627
+
628
+ /**
629
+ * Configuration for authentication and connected account management
630
+ */
631
+ connections?: SessionCreateParams.Connections;
632
+
633
+ /**
634
+ * Configuration for workbench behavior including security restrictions and
635
+ * execution limits
636
+ */
637
+ execution?: SessionCreateParams.Execution;
638
+
639
+ /**
640
+ * Toolkit configuration - specify either enabled toolkits (allowlist) or disabled
641
+ * toolkits (denylist). Mutually exclusive.
642
+ */
643
+ toolkits?: SessionCreateParams.Enabled | SessionCreateParams.Disabled;
644
+
645
+ /**
646
+ * Configuration for tool overrides and filtering
647
+ */
648
+ tools?: SessionCreateParams.Tools;
649
+ }
650
+
651
+ export namespace SessionCreateParams {
652
+ /**
653
+ * Configuration for authentication and connected account management
654
+ */
655
+ export interface Connections {
656
+ /**
657
+ * The auth configs to use for the session. This will override the default behavior
658
+ * and use the given auth config when specific toolkits are being executed
659
+ */
660
+ auth_config_overrides?: { [key: string]: string };
661
+
662
+ /**
663
+ * Whether to enable the connection manager for automatic connection handling. If
664
+ * true, we will provide a tool your agent can use to initiate connections to
665
+ * toolkits if it doesnt exist. If set to false, then you have to manage
666
+ * connections manually.
667
+ */
668
+ auto_manage_connections?: boolean | null;
669
+
670
+ /**
671
+ * The URI to redirect to after a user completes authentication for a connected
672
+ * account. This allows you to handle the auth callback in your own application.
673
+ */
674
+ callback_uri?: string;
675
+
676
+ /**
677
+ * The connected accounts to use for the session. This will override the default
678
+ * behaviour and use the given connected account when specific toolkits are being
679
+ * executed
680
+ */
681
+ connected_account_overrides?: { [key: string]: string };
682
+
683
+ /**
684
+ * If enabled, authentication scopes will be automatically inferred from the
685
+ * specific tools being used in the session. This ensures minimal permissions are
686
+ * requested.
687
+ */
688
+ infer_scopes_from_tools?: boolean | null;
689
+ }
690
+
691
+ /**
692
+ * Configuration for workbench behavior including security restrictions and
693
+ * execution limits
694
+ */
695
+ export interface Execution {
696
+ /**
697
+ * Whether to allow proxy execute calls in the workbench. If false, prevents
698
+ * arbitrary HTTP requests and destructive actions.
699
+ */
700
+ proxy_execution_enabled?: boolean | null;
701
+
702
+ /**
703
+ * Maximum allowed execution time for workbench operations in seconds. If not
704
+ * specified, uses the default timeout.
705
+ */
706
+ timeout_seconds?: number;
707
+ }
708
+
709
+ /**
710
+ * Enable only specific toolkits (allowlist)
711
+ */
712
+ export interface Enabled {
713
+ /**
714
+ * Only these specific toolkits will be enabled
715
+ */
716
+ enabled: Array<string>;
717
+ }
718
+
719
+ /**
720
+ * Disable specific toolkits (denylist)
721
+ */
722
+ export interface Disabled {
723
+ /**
724
+ * These specific toolkits will be disabled
725
+ */
726
+ disabled: Array<string>;
727
+ }
728
+
729
+ /**
730
+ * Configuration for tool overrides and filtering
731
+ */
732
+ export interface Tools {
733
+ /**
734
+ * Configuration for filtering available tools based on tags and characteristics
735
+ */
736
+ filters?: Tools.Filters;
737
+
738
+ /**
739
+ * Tool-level overrides per toolkit - either specify enabled tools (whitelist) or
740
+ * disabled tools (blacklist) for each toolkit
741
+ */
742
+ overrides?: { [key: string]: Tools.Enabled | Tools.Disabled };
743
+ }
744
+
745
+ export namespace Tools {
746
+ /**
747
+ * Configuration for filtering available tools based on tags and characteristics
748
+ */
749
+ export interface Filters {
750
+ /**
751
+ * Filter tools by tags such as read_only_hint, non_destructive_hint,
752
+ * open_world_hint, idempotent_hint. Use include to only show tools with specific
753
+ * tags, or exclude to hide tools with specific tags.
754
+ */
755
+ tags?: Filters.Tags;
756
+ }
757
+
758
+ export namespace Filters {
759
+ /**
760
+ * Filter tools by tags such as read_only_hint, non_destructive_hint,
761
+ * open_world_hint, idempotent_hint. Use include to only show tools with specific
762
+ * tags, or exclude to hide tools with specific tags.
763
+ */
764
+ export interface Tags {
765
+ /**
766
+ * Exclude tools that have any of these tags. Tools with any of these tags will be
767
+ * filtered out.
768
+ */
769
+ exclude?: Array<string>;
770
+
771
+ /**
772
+ * Only include tools that have these tags. Tools must have at least one of these
773
+ * tags to be included.
774
+ */
775
+ include?: Array<string>;
776
+ }
777
+ }
778
+
779
+ export interface Enabled {
780
+ /**
781
+ * Only these specific tools will be available for this toolkit
782
+ */
783
+ enabled: Array<string>;
784
+ }
785
+
786
+ export interface Disabled {
787
+ /**
788
+ * These specific tools will be disabled for this toolkit
789
+ */
790
+ disabled: Array<string>;
791
+ }
792
+ }
793
+ }
794
+
795
+ export interface SessionExecuteParams {
796
+ /**
797
+ * Body param: The unique slug identifier of the tool to execute
798
+ */
799
+ tool_slug: string;
800
+
801
+ /**
802
+ * Body param: The arguments required by the tool
803
+ */
804
+ arguments?: { [key: string]: unknown };
805
+
806
+ /**
807
+ * Header param: Session access key for sandbox/workbench authentication.
808
+ * Alternative to x-api-key for internal tool router endpoints.
809
+ */
810
+ 'x-session-access-key'?: string;
811
+ }
812
+
813
+ export interface SessionLinkParams {
814
+ /**
815
+ * The unique slug identifier of the toolkit to connect
816
+ */
817
+ toolkit: string;
818
+
819
+ /**
820
+ * URL where users will be redirected after completing auth
821
+ */
822
+ callback_url?: string;
823
+ }
824
+
825
+ export interface SessionToolkitsParams {
826
+ /**
827
+ * Cursor for pagination. The cursor is a base64 encoded string of the page and
828
+ * limit. The page is the page number and the limit is the number of items per
829
+ * page. The cursor is used to paginate through the items. The cursor is not
830
+ * required for the first page.
831
+ */
832
+ cursor?: string;
833
+
834
+ /**
835
+ * Number of items per page, max allowed is 1000
836
+ */
837
+ limit?: number | null;
838
+
839
+ /**
840
+ * Optional comma-separated list of toolkit slugs to filter by. If provided, only
841
+ * these toolkits will be returned, overriding the session configuration.
842
+ */
843
+ toolkits?: Array<string> | null;
844
+ }
845
+
846
+ export declare namespace Session {
847
+ export {
848
+ type SessionCreateResponse as SessionCreateResponse,
849
+ type SessionRetrieveResponse as SessionRetrieveResponse,
850
+ type SessionExecuteResponse as SessionExecuteResponse,
851
+ type SessionLinkResponse as SessionLinkResponse,
852
+ type SessionToolkitsResponse as SessionToolkitsResponse,
853
+ type SessionCreateParams as SessionCreateParams,
854
+ type SessionExecuteParams as SessionExecuteParams,
855
+ type SessionLinkParams as SessionLinkParams,
856
+ type SessionToolkitsParams as SessionToolkitsParams,
857
+ };
858
+ }