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 91 lines 2.22 KB
Raw
1 import type { Instant } from '../lib/instant';
2
3 // Parameter schema for tool inputs/outputs
4 export interface ParameterSchema {
5 type: string;
6 description?: string;
7 required?: boolean;
8 default?: unknown;
9 example?: unknown;
10 enum?: string[];
11 // Nested object properties (JSON Schema)
12 properties?: Record<string, ParameterSchema>;
13 // Required fields within this object
14 requiredFields?: string[];
15 // Array item schema
16 items?: ParameterSchema;
17 // Additional properties schema (for map/dictionary types)
18 additionalProperties?: ParameterSchema | boolean;
19 }
20
21 export interface Tool {
22 instant?: Instant;
23 slug: string;
24 name: string;
25 description: string;
26 // Detailed fields fetched on-demand
27 input_parameters?: Record<string, ParameterSchema>;
28 output_parameters?: Record<string, ParameterSchema>;
29 scopes?: string[];
30 tags?: string[];
31 is_deprecated?: boolean;
32 }
33
34 export interface Trigger {
35 slug: string;
36 name: string;
37 description: string;
38 // Detailed fields fetched on-demand
39 type?: 'webhook' | 'poll';
40 config?: Record<string, ParameterSchema>;
41 payload?: Record<string, ParameterSchema>;
42 instructions?: string;
43 }
44
45 // Auth config field definition
46 export interface AuthConfigField {
47 name: string;
48 displayName: string;
49 type: string;
50 description: string;
51 required: boolean;
52 default?: string | null;
53 }
54
55 // Auth config details for a specific auth mode
56 export interface AuthConfigDetail {
57 mode: string;
58 name: string;
59 fields: {
60 auth_config_creation: {
61 required: AuthConfigField[];
62 optional: AuthConfigField[];
63 };
64 connected_account_initiation: {
65 required: AuthConfigField[];
66 optional: AuthConfigField[];
67 };
68 };
69 }
70
71 // Light version for landing page (only fields needed for listing)
72 export interface ToolkitSummary {
73 instant?: Instant;
74 slug: string;
75 name: string;
76 logo: string | null;
77 category: string | null;
78 toolCount: number;
79 triggerCount: number;
80 }
81
82 // Full version with tools, triggers, and auth config details
83 export interface Toolkit extends ToolkitSummary {
84 description: string;
85 authSchemes: string[];
86 composioManagedAuthSchemes?: string[];
87 version: string | null;
88 tools: Tool[];
89 triggers: Trigger[];
90 authConfigDetails?: AuthConfigDetail[];
91 }