Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
TypeScript agentic-aiagentsaiai-agentsaiagentsdeveloper-toolsfunction-callinggpt-4javascriptjsllmllmopsmcppythonremote-mcp-serverssetypescript
fix(core): preserve SDK reference types
Alberto Schiabelf6b550573905
diff --git a/docs/content/reference/sdk-reference/typescript/auth-configs.mdx b/docs/content/reference/sdk-reference/typescript/auth-configs.mdxindex 5f09a8245..357958f06 100644--- a/docs/content/reference/sdk-reference/typescript/auth-configs.mdx+++ b/docs/content/reference/sdk-reference/typescript/auth-configs.mdx@@ -19,7 +19,7 @@ const result = await composio.authConfigs.list();Create a new auth config```typescript-async create(toolkit: string, options: object): Promise<{ authScheme: string; id: string; isComposioManaged: boolean; toolkit: string }>+async create(toolkit: string, options: CreateAuthConfigParams, requestOptions?: ComposioRequestOptions): Promise<CreateAuthConfigResponse>```**Parameters**@@ -27,11 +27,12 @@ async create(toolkit: string, options: object): Promise<{ authScheme: string; id| Name | Type | Description ||------|------|-------------|| `toolkit` | `string` | Unique identifier of the toolkit |-| `options` | `object` | Options for creating a new auth config |+| `options` | `CreateAuthConfigParams` | Options for creating a new auth config |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — Created auth config+`Promise<CreateAuthConfigResponse>` — Created auth config**Example**@@ -57,7 +58,7 @@ This action cannot be undone and will prevent any connected accounts that usethis auth config from functioning.```typescript-async delete(nanoid: string): Promise<AuthConfigDeleteResponse>+async delete(nanoid: string, requestOptions?: ComposioRequestOptions): Promise<AuthConfigDeleteResponse>```**Parameters**@@ -65,6 +66,7 @@ async delete(nanoid: string): Promise<AuthConfigDeleteResponse>| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | The unique identifier of the auth config to delete |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -88,7 +90,7 @@ When disabled, the auth config cannot be used to create new connected accountsor authenticate with third-party services, but existing connections may continue to work.```typescript-async disable(nanoid: string): Promise+async disable(nanoid: string, requestOptions?: ComposioRequestOptions): Promise<AuthConfigUpdateStatusResponse>```**Parameters**@@ -96,10 +98,11 @@ async disable(nanoid: string): Promise| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | The unique identifier of the auth config to disable |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise` — The updated auth config details+`Promise<AuthConfigUpdateStatusResponse>` — The updated auth config details**Example**@@ -119,7 +122,7 @@ When enabled, the auth config can be used to create new connected accountsand authenticate with third-party services.```typescript-async enable(nanoid: string): Promise+async enable(nanoid: string, requestOptions?: ComposioRequestOptions): Promise<AuthConfigUpdateStatusResponse>```**Parameters**@@ -127,10 +130,11 @@ async enable(nanoid: string): Promise| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | The unique identifier of the auth config to enable |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise` — The updated auth config details+`Promise<AuthConfigUpdateStatusResponse>` — The updated auth config details**Example**@@ -149,7 +153,7 @@ This method fetches detailed information about a single auth configand transforms the response to the SDK's standardized format.```typescript-async get(nanoid: string): Promise<...>+async get(nanoid: string, requestOptions?: ComposioRequestOptions): Promise<AuthConfigRetrieveResponse>```**Parameters**@@ -157,10 +161,11 @@ async get(nanoid: string): Promise<...>| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | The unique identifier of the auth config to retrieve |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — The auth config details+`Promise<AuthConfigRetrieveResponse>` — The auth config details**Example**@@ -181,18 +186,19 @@ This method retrieves auth configs from the Composio API, transforms them to theand supports filtering by various parameters.```typescript-async list(query?: { cursor?: string; isComposioManaged?: boolean; limit?: number; toolkit?: string }): Promise<...>+async list(query?: AuthConfigListParams, requestOptions?: ComposioRequestOptions): Promise<AuthConfigListResponse>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `query?` | `object` | Optional query parameters for filtering auth configs |+| `query?` | `AuthConfigListParams` | Optional query parameters for filtering auth configs |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — A paginated list of auth configurations+`Promise<AuthConfigListResponse>` — A paginated list of auth configurations**Example**@@ -205,6 +211,12 @@ const githubConfigs = await composio.authConfigs.list({toolkit: 'github'});+// Search auth configs by name or id+const searchedConfigs = await composio.authConfigs.list({+ search: 'github',+ showDisabled: true+});+// List Composio-managed auth configsconst managedConfigs = await composio.authConfigs.list({isComposioManaged: true@@ -222,7 +234,7 @@ scopes, or tool restrictions. The update type (custom or default) determines whifields can be updated.```typescript-async update(nanoid: string, data: object): Promise+async update(nanoid: string, data: AuthConfigUpdateParams, requestOptions?: ComposioRequestOptions): Promise<AuthConfigUpdateResponse>```**Parameters**@@ -230,11 +242,12 @@ async update(nanoid: string, data: object): Promise| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | The unique identifier of the auth config to update |-| `data` | `object` | The data to update, which can be either custom or default type |+| `data` | `AuthConfigUpdateParams` | The data to update, which can be either custom or default type |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise` — The updated auth config+`Promise<AuthConfigUpdateResponse>` — The updated auth config**Example**@@ -265,19 +278,20 @@ the auth config cannot be used to create new connected accounts or authenticatewith third-party services.```typescript-async updateStatus(status: 'ENABLED' | 'DISABLED', nanoid: string): Promise+async updateStatus(status: 'ENABLED' | 'DISABLED', nanoid: string, requestOptions?: ComposioRequestOptions): Promise<AuthConfigUpdateStatusResponse>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `status` | `'ENABLED' | 'DISABLED'` | The status to set ('ENABLED' or 'DISABLED') |+| `status` | `'ENABLED' \| 'DISABLED'` | The status to set ('ENABLED' or 'DISABLED') || `nanoid` | `string` | The unique identifier of the auth config |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise` — The updated auth config details+`Promise<AuthConfigUpdateStatusResponse>` — The updated auth config details**Example**diff --git a/docs/content/reference/sdk-reference/typescript/composio.mdx b/docs/content/reference/sdk-reference/typescript/composio.mdxindex 40fc9f93a..9f6db0ab3 100644--- a/docs/content/reference/sdk-reference/typescript/composio.mdx+++ b/docs/content/reference/sdk-reference/typescript/composio.mdx@@ -53,7 +53,7 @@ const composio = new Composio({|------|------|-------------|| `authConfigs` | `AuthConfigs` | Manage authentication configurations for toolkits || `connectedAccounts` | `ConnectedAccounts` | Manage authenticated connections |-| `create` | `object` | Creates a new tool router session for a user.+| `create` | `(userId: string, routerConfig: \{ authConfigs?: Record<string, string>; connectedAccounts?: Record<string, string \| string[]>; experimental?: \{ assistivePrompt?: \{ userTimezone?: string \}; customToolkits?: CustomToolkit[]; customTools?: CustomTool[] \}; manageConnections?: boolean \| \{ callbackUrl?: string; enable?: boolean; waitForConnections?: boolean \}; multiAccount?: \{ enable: boolean; maxAccountsPerToolkit?: number; requireExplicitSelection?: boolean \}; preload?: \{ tools?: string[] \| 'all' \}; sessionPreset?: 'direct_tools'; tags?: 'readOnlyHint' \| 'destructiveHint' \| 'idempotentHint' \| 'openWorldHint'[] \| \{ disable?: ... \| ... \| ... \| ...[]; enable?: ... \| ... \| ... \| ...[] \}; toolkits?: string[] \| \{ disable: string[] \} \| \{ enable: string[] \}; tools?: Record<string, string[] \| \{ enable: ...[] \} \| \{ disable: ...[] \} \| \{ tags: ... \| ... \}>; workbench?: \{ autoOffloadThreshold?: number; enable: boolean; enableProxyExecution?: boolean; sandboxSize?: 'standard' \| 'medium' \| 'large' \| 'xlarge' \} \}, requestOptions: ComposioRequestOptions) => Promise<Session>` | Creates a new tool router session for a user.Use `sessionPreset: SessionPreset.DIRECT_TOOLS` when all needed toolsshould be exposed directly; see `ToolRouterCreateSessionConfig`. || `experimental` | `Experimental` | Experimental SDK methods whose shape may change in future releases.@@ -67,7 +67,7 @@ take a client and perform I/O. Stateless experimental factories| `toolRouter` | `ToolRouter` | Experimental feature, use with caution || `tools` | `Tools` | List, retrieve, and execute tools || `triggers` | `Triggers` | Manage webhook triggers and event subscriptions |-| `use` | `object` | Use an existing tool router session |+| `use` | `(id: string, options: \{ customToolkits?: CustomToolkit[]; customTools?: CustomTool[] \}, requestOptions: ComposioRequestOptions) => Promise<Session>` | Use an existing tool router session |## Methods@@ -90,7 +90,7 @@ createSession(options?: { headers?: ComposioRequestHeaders }): Composio| Name | Type ||------|------|-| `options?` | `object` |+| `options?` | `\{ headers?: ComposioRequestHeaders \}` |**Returns**@@ -161,12 +161,12 @@ export default {Get the Composio SDK client.```typescript-getClient(): Composio+getClient(): ComposioClient```**Returns**-`Composio` — The Composio API client.+`ComposioClient` — The Composio API client.---diff --git a/docs/content/reference/sdk-reference/typescript/connected-accounts.mdx b/docs/content/reference/sdk-reference/typescript/connected-accounts.mdxindex 448211c32..c7af9138e 100644--- a/docs/content/reference/sdk-reference/typescript/connected-accounts.mdx+++ b/docs/content/reference/sdk-reference/typescript/connected-accounts.mdx@@ -22,7 +22,7 @@ This method permanently removes a connected account from the Composio platform.This action cannot be undone and will revoke any access tokens associated with the account.```typescript-async delete(nanoid: string): Promise<ConnectedAccountDeleteResponse>+async delete(nanoid: string, requestOptions?: ComposioRequestOptions): Promise<ConnectedAccountDeleteResponse>```**Parameters**@@ -30,6 +30,7 @@ async delete(nanoid: string): Promise<ConnectedAccountDeleteResponse>| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | The unique identifier of the connected account to delete |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -49,7 +50,7 @@ await composio.connectedAccounts.delete('conn_abc123');Disable a connected account```typescript-async disable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>+async disable(nanoid: string, requestOptions?: ComposioRequestOptions): Promise<ConnectedAccountUpdateStatusResponse>```**Parameters**@@ -57,6 +58,7 @@ async disable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | Unique identifier of the connected account |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -83,7 +85,7 @@ console.log(disabledAccount.isDisabled); // trueEnable a connected account```typescript-async enable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>+async enable(nanoid: string, requestOptions?: ComposioRequestOptions): Promise<ConnectedAccountUpdateStatusResponse>```**Parameters**@@ -91,6 +93,7 @@ async enable(nanoid: string): Promise<ConnectedAccountUpdateStatusResponse>| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | Unique identifier of the connected account |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -114,7 +117,7 @@ This method fetches detailed information about a single connected accountand transforms the response to the SDK's standardized format.```typescript-async get(nanoid: string): Promise<...>+async get(nanoid: string, requestOptions?: ComposioRequestOptions): Promise<ConnectedAccountRetrieveResponse>```**Parameters**@@ -122,10 +125,11 @@ async get(nanoid: string): Promise<...>| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | The unique identifier of the connected account |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — The connected account details+`Promise<ConnectedAccountRetrieveResponse>` — The connected account details**Example**@@ -161,7 +165,7 @@ bearer token, basic auth) are unaffected and continue to work on`initiate()`. See https://docs.composio.dev/docs/changelog/2026/04/24```typescript-async initiate(userId: string, authConfigId: string, options?: object): Promise<ConnectionRequest>+async initiate(userId: string, authConfigId: string, options?: CreateConnectedAccountOptions, requestOptions?: ComposioRequestOptions): Promise<ConnectionRequest>```**Parameters**@@ -170,7 +174,8 @@ async initiate(userId: string, authConfigId: string, options?: object): Promise<|------|------|-------------|| `userId` | `string` | User ID of the connected account || `authConfigId` | `string` | Auth config ID of the connected account |-| `options?` | `object` | Options for creating a new connected account |+| `options?` | `CreateConnectedAccountOptions` | Options for creating a new connected account |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -221,7 +226,7 @@ const connectionRequest = await composio.connectedAccounts.initiate(### link()```typescript-async link(userId: string, authConfigId: string, options?: object): Promise<ConnectionRequest>+async link(userId: string, authConfigId: string, options?: CreateConnectedAccountLinkOptions, requestOptions?: ComposioRequestOptions): Promise<ConnectionRequest>```**Parameters**@@ -230,7 +235,8 @@ async link(userId: string, authConfigId: string, options?: object): Promise<Conn|------|------|-------------|| `userId` | `string` | \{string\} - The external user ID to create the connected account for. || `authConfigId` | `string` | \{string\} - The auth config ID to create the connected account for. |-| `options?` | `object` | \{CreateConnectedAccountOptions\} - Options for creating a new connected account. |+| `options?` | `CreateConnectedAccountLinkOptions` | \{CreateConnectedAccountOptions\} - Options for creating a new connected account. |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -269,18 +275,19 @@ Lists all connected accounts based on provided filter criteria.This method retrieves connected accounts from the Composio API with optional filtering.```typescript-async list(query?: object): Promise<...>+async list(query?: ConnectedAccountListParams, requestOptions?: ComposioRequestOptions): Promise<ConnectedAccountListResponse>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `query?` | `object` | Optional query parameters for filtering connected accounts |+| `query?` | `ConnectedAccountListParams` | Optional query parameters for filtering connected accounts |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — A paginated list of connected accounts+`Promise<ConnectedAccountListResponse>` — A paginated list of connected accounts**Example**@@ -309,7 +316,7 @@ This method attempts to refresh OAuth tokens or other credentials associated witthe connected account. This is useful when a token has expired or is about to expire.```typescript-async refresh(nanoid: string, options?: { redirectUrl?: string; validateCredentials?: boolean }): Promise<ConnectedAccountRefreshResponse>+async refresh(nanoid: string, options?: ConnectedAccountRefreshOptions, requestOptions?: ComposioRequestOptions): Promise<ConnectedAccountRefreshResponse>```**Parameters**@@ -317,7 +324,8 @@ async refresh(nanoid: string, options?: { redirectUrl?: string; validateCredenti| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | The unique identifier of the connected account to refresh |-| `options?` | `object` | |+| `options?` | `ConnectedAccountRefreshOptions` | |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -340,7 +348,7 @@ For ACL writes on SHARED connections, see`composio.experimental.updateAcl()`.```typescript-async update(nanoid: string, params: ConnectedAccountUpdateStatusParams): Promise<ConnectedAccountUpdateStatusResponse>+async update(nanoid: string, params: UpdateConnectedAccountParams, requestOptions?: ComposioRequestOptions): Promise<ConnectedAccountUpdateStatusResponse>```**Parameters**@@ -348,7 +356,8 @@ async update(nanoid: string, params: ConnectedAccountUpdateStatusParams): Promis| Name | Type | Description ||------|------|-------------|| `nanoid` | `string` | The unique identifier of the connected account |-| `params` | `ConnectedAccountUpdateStatusParams` | The update parameters |+| `params` | `UpdateConnectedAccountParams` | The update parameters |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -368,7 +377,7 @@ await composio.connectedAccounts.update('ca_abc123', { enabled: false });Update the status of a connected account```typescript-async updateStatus(nanoid: string, params: ConnectedAccountUpdateStatusParams): Promise<ConnectedAccountUpdateStatusResponse>+async updateStatus(nanoid: string, params: ConnectedAccountUpdateStatusParams, requestOptions?: ComposioRequestOptions): Promise<ConnectedAccountUpdateStatusResponse>```**Parameters**@@ -377,6 +386,7 @@ async updateStatus(nanoid: string, params: ConnectedAccountUpdateStatusParams):|------|------|-------------|| `nanoid` | `string` | Unique identifier of the connected account || `params` | `ConnectedAccountUpdateStatusParams` | Parameters for updating the status |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -407,7 +417,7 @@ This method continuously polls the Composio API to check the status of a connectuntil it either becomes active, enters a terminal error state, or times out.```typescript-async waitForConnection(connectedAccountId: string, timeout?: number): Promise<...>+async waitForConnection(connectedAccountId: string, timeout?: number): Promise<ConnectedAccountRetrieveResponse>```**Parameters**@@ -419,7 +429,7 @@ async waitForConnection(connectedAccountId: string, timeout?: number): Promise<.**Returns**-`Promise<...>` — The finalized connected account data+`Promise<ConnectedAccountRetrieveResponse>` — The finalized connected account data**Example**diff --git a/docs/content/reference/sdk-reference/typescript/experimental.mdx b/docs/content/reference/sdk-reference/typescript/experimental.mdxindex 5c8e858ab..06c846d8b 100644--- a/docs/content/reference/sdk-reference/typescript/experimental.mdx+++ b/docs/content/reference/sdk-reference/typescript/experimental.mdx@@ -34,7 +34,7 @@ Resolution rule (deny wins):4. otherwise → DENY```typescript-async updateAcl(nanoid: string, params: { allowAllUsers?: boolean; allowedUserIds?: string[]; notAllowedUserIds?: string[] }): Promise<ConnectedAccountPatchResponse>+async updateAcl(nanoid: string, params: UpdateConnectedAccountAclParams): Promise<ConnectedAccountPatchResponse>```**Parameters**@@ -42,7 +42,7 @@ async updateAcl(nanoid: string, params: { allowAllUsers?: boolean; allowedUserId| Name | Type ||------|------|| `nanoid` | `string` |-| `params` | `object` |+| `params` | `UpdateConnectedAccountAclParams` |**Returns**diff --git a/docs/content/reference/sdk-reference/typescript/mcp.mdx b/docs/content/reference/sdk-reference/typescript/mcp.mdxindex 260b53a7e..bacf68b26 100644--- a/docs/content/reference/sdk-reference/typescript/mcp.mdx+++ b/docs/content/reference/sdk-reference/typescript/mcp.mdx@@ -25,7 +25,7 @@ const result = await composio.mcp.list();Create a new MCP configuration.```typescript-async create(name: string, mcpConfig: object): Promise<MCPConfigCreateResponse>+async create(name: string, mcpConfig: MCPConfigCreationParams, requestOptions?: ComposioRequestOptions): Promise<MCPConfigCreateResponse>```**Parameters**@@ -33,7 +33,8 @@ async create(name: string, mcpConfig: object): Promise<MCPConfigCreateResponse>| Name | Type ||------|------|| `name` | `string` |-| `mcpConfig` | `object` |+| `mcpConfig` | `MCPConfigCreationParams` |+| `requestOptions?` | `ComposioRequestOptions` |**Returns**@@ -64,7 +65,7 @@ const server = await composio.mcpConfig.create("personal-mcp-server", {Delete an MCP server configuration permanently```typescript-async delete(serverId: string): Promise<{ deleted: boolean; id: string }>+async delete(serverId: string, requestOptions?: ComposioRequestOptions): Promise<{ id: string; deleted: boolean }>```**Parameters**@@ -72,10 +73,11 @@ async delete(serverId: string): Promise<{ deleted: boolean; id: string }>| Name | Type | Description ||------|------|-------------|| `serverId` | `string` | The unique identifier of the MCP server to delete |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — Confirmation object with server ID and deletion status+`Promise<\{ id: string; deleted: boolean \}>` — Confirmation object with server ID and deletion status**Example**@@ -112,7 +114,7 @@ Get server URLs for an existing MCP server.The response is wrapped according to the provider's specifications.```typescript-async generate(userId: string, mcpConfigId: string, options?: { manuallyManageConnections?: boolean }): Promise<...>+async generate(userId: string, mcpConfigId: string, options?: MCPGetInstanceParams, requestOptions?: ComposioRequestOptions): Promise<MCPServerInstance>```**Parameters**@@ -121,11 +123,12 @@ async generate(userId: string, mcpConfigId: string, options?: { manuallyManageCo|------|------|-------------|| `userId` | `string` | \{string\} external user id from your database for whom you want the server for || `mcpConfigId` | `string` | \{string\} config id of the MCPConfig for which you want to create a server for |-| `options?` | `object` | \{object\} additional options |+| `options?` | `MCPGetInstanceParams` | \{object\} additional options |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>`+`Promise<MCPServerInstance>`**Example**@@ -143,7 +146,7 @@ const mcp = await composio.experimental.mcp.generate("default", "<mcp_config_id>Retrieve detailed information about a specific MCP server by its ID```typescript-async get(serverId: string): Promise<...>+async get(serverId: string, requestOptions?: ComposioRequestOptions): Promise<MCPItem>```**Parameters**@@ -151,10 +154,11 @@ async get(serverId: string): Promise<...>| Name | Type | Description ||------|------|-------------|| `serverId` | `string` | The unique identifier of the MCP server to retrieve |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — Complete MCP server details including configuration, tools, and metadata+`Promise<MCPItem>` — Complete MCP server details including configuration, tools, and metadata**Example**@@ -183,18 +187,19 @@ const mcpUrl = server.MCPUrl;List the MCP servers with optional filtering and pagination```typescript-async list(options: { authConfigs: string[]; limit: number; name?: string; page: number; toolkits: string[] }): Promise<...>+async list(options: MCPListParams, requestOptions?: ComposioRequestOptions): Promise<MCPListResponse>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `options` | `object` | Filtering and pagination options |+| `options` | `MCPListParams` | Filtering and pagination options |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — Paginated list of MCP servers with metadata+`Promise<MCPListResponse>` — Paginated list of MCP servers with metadata**Example**@@ -226,7 +231,7 @@ const namedServers = await composio.experimental.mcp.list({Update an existing MCP server configuration with new settings```typescript-async update(serverId: string, config: object): Promise<...>+async update(serverId: string, config: MCPUpdateParams, requestOptions?: ComposioRequestOptions): Promise<MCPItem>```**Parameters**@@ -234,11 +239,12 @@ async update(serverId: string, config: object): Promise<...>| Name | Type | Description ||------|------|-------------|| `serverId` | `string` | The unique identifier of the MCP server to update |-| `config` | `object` | Update configuration parameters |+| `config` | `MCPUpdateParams` | Update configuration parameters |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — Updated MCP server configuration with all details+`Promise<MCPItem>` — Updated MCP server configuration with all details**Example**diff --git a/docs/content/reference/sdk-reference/typescript/session-context-impl.mdx b/docs/content/reference/sdk-reference/typescript/session-context-impl.mdxindex e4ce4ff3b..b4c48e4ab 100644--- a/docs/content/reference/sdk-reference/typescript/session-context-impl.mdx+++ b/docs/content/reference/sdk-reference/typescript/session-context-impl.mdx@@ -16,6 +16,10 @@ const result = await composio.sessionContextImpl.list();| Name | Type | Description ||------|------|-------------|+| `signal` | `AbortSignal` | Per-execution AbortSignal. Never set on the base instance; `executeCustomTool`+grafts it onto a per-call `Object.create` child so concurrent executions+sharing this context don't observe each other's signal. Declared here (rather+than read via a cast) so the contract is explicit. || `userId` | `string` | The user ID for this session |## Methods@@ -29,7 +33,7 @@ otherwise delegates to the backend API.Returns the same response shape as session.execute().```typescript-async execute(toolSlug: string, arguments_: Record<string, unknown>): Promise<{ data: Record<string, unknown>; error: string | null; logId: string }>+async execute(toolSlug: string, arguments_: Record<string, unknown>): Promise<ToolRouterSessionExecuteResponse>```**Parameters**@@ -41,7 +45,7 @@ async execute(toolSlug: string, arguments_: Record<string, unknown>): Promise<{**Returns**-`Promise<...>`+`Promise<ToolRouterSessionExecuteResponse>`---@@ -51,14 +55,14 @@ Proxy API calls through Composio's auth layer.The backend resolves the connected account from the toolkit within the session.```typescript-async proxyExecute(params: object): Promise<ToolRouterSessionProxyExecuteResponse>+async proxyExecute(params: SessionProxyExecuteParams): Promise<ToolRouterSessionProxyExecuteResponse>```**Parameters**| Name | Type ||------|------|-| `params` | `object` |+| `params` | `SessionProxyExecuteParams` |**Returns**diff --git a/docs/content/reference/sdk-reference/typescript/tool-router-session-files-mount.mdx b/docs/content/reference/sdk-reference/typescript/tool-router-session-files-mount.mdxindex d1ae481b1..d6730c2c5 100644--- a/docs/content/reference/sdk-reference/typescript/tool-router-session-files-mount.mdx+++ b/docs/content/reference/sdk-reference/typescript/tool-router-session-files-mount.mdx@@ -22,7 +22,7 @@ Removes the file or directory from the virtual filesystem. Use with caution:deletion is typically irreversible. Ensure the path exists and is intended for removal.```typescript-async delete(remotePath: string, options?: { mountId?: string }): Promise<{ mountRelativePath: string; sandboxMountPrefix: string }>+async delete(remotePath: string, options?: ToolRouterSessionFilesMountDeleteOptions): Promise<FileDeleteResponse>```**Parameters**@@ -30,11 +30,11 @@ async delete(remotePath: string, options?: { mountId?: string }): Promise<{ moun| Name | Type | Description ||------|------|-------------|| `remotePath` | `string` | The path of the file or directory to delete on the mount. |-| `options?` | `object` | Optional configuration for the delete operation. |+| `options?` | `ToolRouterSessionFilesMountDeleteOptions` | Optional configuration for the delete operation. |**Returns**-`Promise<...>` — Confirmation of deletion (implementation-specific).+`Promise<FileDeleteResponse>` — Confirmation of deletion (implementation-specific).**Example**@@ -60,7 +60,7 @@ Retrieves a file stored in the session's virtual filesystem (e.g., one producedby a tool or previously uploaded) and saves it to the specified local path.```typescript-async download(filePath: string, options?: { mountId?: string }): Promise<RemoteFile>+async download(filePath: string, options?: ToolRouterSessionFilesMountDownloadOptions): Promise<RemoteFile>```**Parameters**@@ -68,7 +68,7 @@ async download(filePath: string, options?: { mountId?: string }): Promise<Remote| Name | Type | Description ||------|------|-------------|| `filePath` | `string` | The path of the file on the mount to download, or the local path where the file should be saved (implementation-specific). |-| `options?` | `object` | Optional configuration for the download. |+| `options?` | `ToolRouterSessionFilesMountDownloadOptions` | Optional configuration for the download. |**Returns**@@ -99,18 +99,18 @@ The path is relative to the mount root (e.g., `"/"` for root, `"/documents"` forSupports cursor-based pagination via `cursor` and `limit` options.```typescript-async list(options?: { cursor?: string; limit?: number; mountId?: string; path?: string }): Promise<...>+async list(options?: ToolRouterSessionFilesMountListOptions): Promise<FileListResponse>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `options?` | `object` | Optional configuration for the list operation. |+| `options?` | `ToolRouterSessionFilesMountListOptions` | Optional configuration for the list operation. |**Returns**-`Promise<...>` — List of files with nextCursor for pagination.+`Promise<FileListResponse>` — List of files with nextCursor for pagination.**Example**@@ -137,15 +137,15 @@ Accepts a file path (local or URL), a native File object, or a raw buffer.The file is stored in the virtual filesystem associated with the tool router session.```typescript-async upload(input: string | File | ArrayBuffer | Uint8Array, options?: { mimetype?: string; mountId?: string; remotePath?: string }): Promise<RemoteFile>+async upload(input: string | File | ArrayBuffer | Uint8Array, options?: ToolRouterSessionFilesMountUploadOptions): Promise<RemoteFile>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `input` | `string | File | ArrayBuffer | Uint8Array` | File path (string), native File, or raw buffer (ArrayBuffer | Uint8Array). |-| `options?` | `object` | Optional configuration. When passing a buffer, remotePath is required. |+| `input` | `string \| File \| ArrayBuffer \| Uint8Array` | File path (string), native File, or raw buffer (ArrayBuffer | Uint8Array). |+| `options?` | `ToolRouterSessionFilesMountUploadOptions` | Optional configuration. When passing a buffer, remotePath is required. |**Returns**diff --git a/docs/content/reference/sdk-reference/typescript/tool-router-session.mdx b/docs/content/reference/sdk-reference/typescript/tool-router-session.mdxindex 053bacc4e..65a1e743c 100644--- a/docs/content/reference/sdk-reference/typescript/tool-router-session.mdx+++ b/docs/content/reference/sdk-reference/typescript/tool-router-session.mdx@@ -18,7 +18,7 @@ const result = await composio.toolRouterSession.list();|------|------|| `configVersion` | `number` || `experimental` | `SessionExperimental` |-| `mcp` | `object` |+| `mcp` | `\{ headers?: Record<string, string>; type: 'http' \| 'sse'; url: string \}` || `preload` | `Preload` || `sessionId` | `string` || `warnings` | `Warning[]` |@@ -42,7 +42,7 @@ Experimental — shape may change in future releases.at the SDK boundary.```typescript-async authorize(toolkit: string, options?: object): Promise<ConnectionRequest>+async authorize(toolkit: string, options?: { callbackUrl?: string; alias?: string; experimental?: { accountType?: ConnectedAccountType; aclConfigForShared?: ConnectedAccountAclConfig; }; }, requestOptions?: ComposioRequestOptions): Promise<ConnectionRequest>```**Parameters**@@ -50,7 +50,8 @@ async authorize(toolkit: string, options?: object): Promise<ConnectionRequest>| Name | Type ||------|------|| `toolkit` | `string` |-| `options?` | `object` |+| `options?` | `\{ callbackUrl?: string; alias?: string; experimental?: \{ accountType?: ConnectedAccountType; aclConfigForShared?: ConnectedAccountAclConfig; \}; \}` |+| `requestOptions?` | `ComposioRequestOptions` |**Returns**@@ -86,7 +87,7 @@ customTools(options?: { toolkit?: string }): RegisteredCustomTool[]| Name | Type ||------|------|-| `options?` | `object` |+| `options?` | `\{ toolkit?: string \}` |**Returns**@@ -103,7 +104,7 @@ full slug (e.g. "LOCAL_GREP"). Custom tools are executed in-process;remote tools are sent to the Composio backend.```typescript-async execute(toolSlug: string, arguments_?: Record<string, unknown>, options?: ToolRouterSessionExecuteOptions): Promise<{ data: Record<string, unknown>; error: string | null; logId: string }>+async execute(toolSlug: string, arguments_?: Record<string, unknown>, options?: ToolRouterSessionExecuteOptions, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionExecuteResponse>```**Parameters**@@ -113,10 +114,11 @@ async execute(toolSlug: string, arguments_?: Record<string, unknown>, options?:| `toolSlug` | `string` | The tool slug to execute || `arguments_?` | `Record<string, unknown>` | Optional tool arguments || `options?` | `ToolRouterSessionExecuteOptions` | Optional execution options |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — The tool execution result+`Promise<ToolRouterSessionExecuteResponse>` — The tool execution result---@@ -126,14 +128,15 @@ Proxy an API call through Composio's auth layer using the session's connected acThe backend resolves the connected account from the toolkit within the session.```typescript-async proxyExecute(params: object): Promise<ToolRouterSessionProxyExecuteResponse>+async proxyExecute(params: SessionProxyExecuteParams, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionProxyExecuteResponse>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `params` | `object` | Proxy request parameters (toolkit, endpoint, method, body, headers/query params) |+| `params` | `SessionProxyExecuteParams` | Proxy request parameters (toolkit, endpoint, method, body, headers/query params) |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -147,18 +150,19 @@ Search for tools by semantic use case.Returns relevant tools for the given query with schemas and guidance.```typescript-async search(params: { query: string; toolkits?: string[] }): Promise<...>+async search(params: { query: string; toolkits?: string[]; }, requestOptions?: ComposioRequestOptions): Promise<ToolRouterSessionSearchResponse>```**Parameters**| Name | Type ||------|------|-| `params` | `object` |+| `params` | `\{ query: string; toolkits?: string[]; \}` |+| `requestOptions?` | `ComposioRequestOptions` |**Returns**-`Promise<...>`+`Promise<ToolRouterSessionSearchResponse>`---@@ -168,18 +172,19 @@ Query the connection state of toolkits in the session.Supports pagination and filtering by toolkit slugs.```typescript-async toolkits(options?: { cursor?: string; isConnected?: boolean; limit?: number; search?: string; toolkits?: string[] }): Promise<...>+async toolkits(options?: ToolRouterToolkitsOptions, requestOptions?: ComposioRequestOptions): Promise<{ cursor: string | undefined; items: { connection?: { authConfig?: ... | ...; connectedAccount?: { id: ...; status: ... }; isActive: boolean }; isNoAuth: boolean; logo?: string; name: string; slug: string }[]; totalPages: number }>```**Parameters**| Name | Type ||------|------|-| `options?` | `object` |+| `options?` | `ToolRouterToolkitsOptions` |+| `requestOptions?` | `ComposioRequestOptions` |**Returns**-`Promise<...>`+`Promise<\{ cursor: string \| undefined; items: \{ connection?: \{ authConfig?: ... \| ...; connectedAccount?: \{ id: ...; status: ... \}; isActive: boolean \}; isNoAuth: boolean; logo?: string; name: string; slug: string \}[]; totalPages: number \}>`---@@ -192,7 +197,7 @@ When custom tools are bound to the session, execution of COMPOSIO_MULTI_EXECUTE_is intercepted: local tools are executed in-process, remote tools are sent to the backend.```typescript-async tools(modifiers?: SessionMetaToolOptions): Promise<ReturnType>+async tools(modifiers?: SessionMetaToolOptions, requestOptions?: ComposioRequestOptions): Promise<ReturnType<TProvider['wrapTools']>>```**Parameters**@@ -200,10 +205,11 @@ async tools(modifiers?: SessionMetaToolOptions): Promise<ReturnType>| Name | Type ||------|------|| `modifiers?` | `SessionMetaToolOptions` |+| `requestOptions?` | `ComposioRequestOptions` |**Returns**-`Promise<ReturnType>`+`Promise<ReturnType<TProvider['wrapTools']>>`---@@ -214,14 +220,15 @@ Only the fields provided will be changed; omitted fields are preserved.Mutates this session's `configVersion`, `preload`, and `warnings` in-place.```typescript-async update(config: object): Promise<void>+async update(config: ToolRouterUpdateSessionConfig, requestOptions?: ComposioRequestOptions): Promise<void>```**Parameters**| Name | Type ||------|------|-| `config` | `object` |+| `config` | `ToolRouterUpdateSessionConfig` |+| `requestOptions?` | `ComposioRequestOptions` |**Returns**diff --git a/docs/content/reference/sdk-reference/typescript/toolkits.mdx b/docs/content/reference/sdk-reference/typescript/toolkits.mdxindex 90b949a66..2bbd6b611 100644--- a/docs/content/reference/sdk-reference/typescript/toolkits.mdx+++ b/docs/content/reference/sdk-reference/typescript/toolkits.mdx@@ -20,7 +20,7 @@ Authorizes a user to use a toolkit.This method will create an auth config if one doesn't exist and initiate a connection request.```typescript-async authorize(userId: string, toolkitSlug: string, authConfigId?: string): Promise<ConnectionRequest>+async authorize(userId: string, toolkitSlug: string, authConfigId?: string, requestOptions?: ComposioRequestOptions): Promise<ConnectionRequest>```**Parameters**@@ -30,6 +30,7 @@ async authorize(userId: string, toolkitSlug: string, authConfigId?: string): Pro| `userId` | `string` | The user id of the user to authorize || `toolkitSlug` | `string` | The slug of the toolkit to authorize || `authConfigId?` | `string` | |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -50,7 +51,7 @@ Retrieves a specific toolkit by its slug identifier.**Overload 1**```typescript-async get(slug: string): Promise<...>+async get(slug: string, requestOptions?: ComposioRequestOptions): Promise<ToolkitRetrieveResponse>```**Parameters**@@ -58,26 +59,28 @@ async get(slug: string): Promise<...>| Name | Type | Description ||------|------|-------------|| `slug` | `string` | The unique slug identifier of the toolkit to retrieve |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — The toolkit object with detailed information+`Promise<ToolkitRetrieveResponse>` — The toolkit object with detailed information**Overload 2**```typescript-async get(query?: object): Promise<...>+async get(query?: ToolkitListParams, requestOptions?: ComposioRequestOptions): Promise<ToolKitListResponse>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `query?` | `object` | The query parameters to filter toolkits |+| `query?` | `ToolkitListParams` | The query parameters to filter toolkits |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — A paginated list of toolkits matching the query criteria+`Promise<ToolKitListResponse>` — A paginated list of toolkits matching the query criteria**Example**@@ -95,7 +98,7 @@ console.log(githubToolkit.authConfigDetails); // Authentication configuration deRetrieves the fields required for creating an auth config for a toolkit.```typescript-async getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeType, options: { requiredOnly?: boolean }): Promise<...>+async getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeType, options: { requiredOnly?: boolean }): Promise<ToolkitAuthFieldsResponse>```**Parameters**@@ -104,11 +107,11 @@ async getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeTyp|------|------|-------------|| `toolkitSlug` | `string` | The slug of the toolkit to retrieve the fields for || `authScheme` | `AuthSchemeType` | The auth scheme to retrieve the fields for |-| `options` | `object` | |+| `options` | `\{ requiredOnly?: boolean \}` | |**Returns**-`Promise<...>` — The fields required for creating an auth config+`Promise<ToolkitAuthFieldsResponse>` — The fields required for creating an auth config---@@ -117,7 +120,7 @@ async getAuthConfigCreationFields(toolkitSlug: string, authScheme: AuthSchemeTypRetrieves the fields required for initiating a connected account for a toolkit.```typescript-async getConnectedAccountInitiationFields(toolkitSlug: string, authScheme: AuthSchemeType, options: { requiredOnly?: boolean }): Promise<...>+async getConnectedAccountInitiationFields(toolkitSlug: string, authScheme: AuthSchemeType, options: { requiredOnly?: boolean }): Promise<ToolkitAuthFieldsResponse>```**Parameters**@@ -126,11 +129,11 @@ async getConnectedAccountInitiationFields(toolkitSlug: string, authScheme: AuthS|------|------|-------------|| `toolkitSlug` | `string` | The slug of the toolkit to retrieve the fields for || `authScheme` | `AuthSchemeType` | The auth scheme to retrieve the fields for |-| `options` | `object` | |+| `options` | `\{ requiredOnly?: boolean \}` | |**Returns**-`Promise<...>` — The fields required for initiating a connected account+`Promise<ToolkitAuthFieldsResponse>` — The fields required for initiating a connected account---@@ -142,12 +145,18 @@ This method fetches the complete list of categories from the Composio APIand transforms the response to use camelCase property naming.```typescript-async listCategories(): Promise<...>+async listCategories(requestOptions?: ComposioRequestOptions): Promise<ToolkitRetrieveCategoriesResponse>```+**Parameters**++| Name | Type |+|------|------|+| `requestOptions?` | `ComposioRequestOptions` |+**Returns**-`Promise<...>` — The list of toolkit categories+`Promise<ToolkitRetrieveCategoriesResponse>` — The list of toolkit categories**Example**diff --git a/docs/content/reference/sdk-reference/typescript/tools.mdx b/docs/content/reference/sdk-reference/typescript/tools.mdxindex b9205c2aa..56a11ca41 100644--- a/docs/content/reference/sdk-reference/typescript/tools.mdx+++ b/docs/content/reference/sdk-reference/typescript/tools.mdx@@ -26,7 +26,7 @@ the execution will throw a `ComposioToolVersionRequiredError` unless `dangerouslThis helps prevent unexpected behavior when new toolkit versions are released.```typescript-async execute(slug: string, body: object, modifiers?: ExecuteToolModifiers): Promise<...>+async execute(slug: string, body: ToolExecuteParams, options?: ExecuteToolModifiers & ComposioRequestOptions): Promise<ToolExecuteResponse>```**Parameters**@@ -34,12 +34,12 @@ async execute(slug: string, body: object, modifiers?: ExecuteToolModifiers): Pro| Name | Type | Description ||------|------|-------------|| `slug` | `string` | The slug/ID of the tool to be executed |-| `body` | `object` | The parameters to be passed to the tool |-| `modifiers?` | `ExecuteToolModifiers` | Optional modifiers to transform the request or response |+| `body` | `ToolExecuteParams` | The parameters to be passed to the tool |+| `options?` | `ExecuteToolModifiers & ComposioRequestOptions` | Optional modifiers and request options |**Returns**-`Promise<...>` — - The response from the tool execution+`Promise<ToolExecuteResponse>` — The response from the tool execution**Example**@@ -85,6 +85,14 @@ const result = await composio.tools.execute('GITHUB_GET_ISSUES', {});```+```typescript+const result = await composio.tools.execute('HACKERNEWS_GET_FRONTPAGE', {+ userId: 'default',+ arguments: {},+ dangerouslySkipVersionCheck: true,+}, { signal: AbortSignal.timeout(5_000) });+```+---### executeSessionTool()@@ -92,7 +100,7 @@ const result = await composio.tools.execute('GITHUB_GET_ISSUES', {Executes a tool based on a tool router session.```typescript-async executeSessionTool(toolSlug: string, body: { arguments?: Record<string, unknown>; sessionId: string }, modifiers?: SessionExecuteMetaModifiers, tool?: object, options?: ToolRouterSessionExecuteOptions): Promise<...>+async executeSessionTool(toolSlug: string, body: ToolExecuteMetaParams, modifiers?: SessionExecuteMetaModifiers, tool?: Tool, options?: ToolRouterSessionExecuteOptions, requestOptions?: ComposioRequestOptions): Promise<ToolExecuteResponse>```**Parameters**@@ -100,14 +108,15 @@ async executeSessionTool(toolSlug: string, body: { arguments?: Record<string, un| Name | Type | Description ||------|------|-------------|| `toolSlug` | `string` | The slug of the tool to execute |-| `body` | `object` | The execution parameters |+| `body` | `ToolExecuteMetaParams` | The execution parameters || `modifiers?` | `SessionExecuteMetaModifiers` | The modifiers to apply to the tool |-| `tool?` | `object` | Optional tool schema used to resolve toolkit metadata for modifiers |+| `tool?` | `Tool` | Optional tool schema used to resolve toolkit metadata for modifiers || `options?` | `ToolRouterSessionExecuteOptions` | |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — The response from the tool execution+`Promise<ToolExecuteResponse>` — The response from the tool execution---@@ -119,7 +128,7 @@ This method fetches the tools from the Composio API and wraps them using the pro**Overload 1**```typescript-async get(userId: string, filters: ToolListParams, options?: ProviderOptions): Promise<ReturnType>+async get(userId: string, filters: ToolListParams, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType<T['wrapTools']>>```**Parameters**@@ -128,16 +137,16 @@ async get(userId: string, filters: ToolListParams, options?: ProviderOptions): P|------|------|-------------|| `userId` | `string` | The user id to get the tools for || `filters` | `ToolListParams` | The filters to apply when fetching tools |-| `options?` | `ProviderOptions` | Optional provider options including modifiers |+| `options?` | `ProviderOptions & ComposioRequestOptions` | Provider options, modifiers, and/or AbortSignal |**Returns**-`Promise<ReturnType>` — The wrapped tools collection+`Promise<ReturnType<T['wrapTools']>>` — The wrapped tools collection**Overload 2**```typescript-async get(userId: string, slug: string, options?: ProviderOptions): Promise<ReturnType>+async get(userId: string, slug: string, options?: ProviderOptions & ComposioRequestOptions): Promise<ReturnType<T['wrapTools']>>```**Parameters**@@ -146,11 +155,11 @@ async get(userId: string, slug: string, options?: ProviderOptions): Promise<Retu|------|------|-------------|| `userId` | `string` | The user id to get the tool for || `slug` | `string` | The slug of the tool to fetch |-| `options?` | `ProviderOptions` | Optional provider options including modifiers |+| `options?` | `ProviderOptions & ComposioRequestOptions` | Optional provider options including modifiers and signal |**Returns**-`Promise<ReturnType>` — The wrapped tool+`Promise<ReturnType<T['wrapTools']>>` — The wrapped tool**Example**@@ -161,22 +170,10 @@ const tools = await composio.tools.get('default', {limit: 10});-// Get tools with search-const searchTools = await composio.tools.get('default', {- search: 'user',- limit: 10-});--// Get a specific tool by slug-const hackerNewsUserTool = await composio.tools.get('default', 'HACKERNEWS_GET_USER');--// Get a tool with schema modifications-const tool = await composio.tools.get('default', 'GITHUB_GET_REPOS', {- modifySchema: (toolSlug, toolkitSlug, schema) => {- // Customize the tool schema- return {...schema, description: 'Custom description'};- }-});+// Timeout a slow search after 5s+const emailTools = await composio.tools.get('default', {+ search: 'send email',+}, { signal: AbortSignal.timeout(5_000) });```---@@ -188,7 +185,7 @@ Fetches the input parameters for a given tool.This method is used to get the input parameters for a tool before executing it.```typescript-async getInput(slug: string, body: ToolGetInputParams): Promise<ToolGetInputResponse>+async getInput(slug: string, body: ToolGetInputParams, requestOptions?: ComposioRequestOptions): Promise<ToolGetInputResponse>```**Parameters**@@ -197,6 +194,7 @@ async getInput(slug: string, body: ToolGetInputParams): Promise<ToolGetInputResp|------|------|-------------|| `slug` | `string` | The ID of the tool to find input for || `body` | `ToolGetInputParams` | The parameters to be passed to the tool |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -226,7 +224,7 @@ Tool Router session, then use `session.tools()`, `session.customTools()`, or`session.execute()`.```typescript-async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions): Promise<...>+async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions, requestOptions?: ComposioRequestOptions): Promise<Tool>```**Parameters**@@ -235,10 +233,11 @@ async getRawComposioToolBySlug(slug: string, options?: ToolRetrievalOptions): Pr|------|------|-------------|| `slug` | `string` | The unique identifier of the tool (e.g., 'GITHUB_GET_REPOS') || `options?` | `ToolRetrievalOptions` | Optional configuration for tool retrieval |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — The requested tool with its complete schema and metadata+`Promise<Tool>` — The requested tool with its complete schema and metadata**Example**@@ -289,7 +288,7 @@ them when creating or reusing a Tool Router session, then use `session.tools()`,It provides access to the underlying tool data without provider-specific wrapping.```typescript-async getRawComposioTools(query: ToolListParams, options?: SchemaModifierOptions): Promise<ToolList>+async getRawComposioTools(query: ToolListParams, options?: SchemaModifierOptions, requestOptions?: ComposioRequestOptions): Promise<ToolList>```**Parameters**@@ -298,6 +297,7 @@ async getRawComposioTools(query: ToolListParams, options?: SchemaModifierOptions|------|------|-------------|| `query` | `ToolListParams` | Query parameters to filter the tools (required) || `options?` | `SchemaModifierOptions` | Optional configuration for tool retrieval |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -358,7 +358,7 @@ This includes helper/meta tools plus any tools preloaded into the session.It provides access to the underlying tool data without provider-specific wrapping.```typescript-async getRawToolRouterSessionTools(sessionId: string, options?: SchemaModifierOptions): Promise<ToolList>+async getRawToolRouterSessionTools(sessionId: string, options?: SchemaModifierOptions, requestOptions?: ComposioRequestOptions): Promise<ToolList>```**Parameters**@@ -367,6 +367,7 @@ async getRawToolRouterSessionTools(sessionId: string, options?: SchemaModifierOp|------|------|-------------|| `sessionId` | `string` | \{string\} The session id to get tools for || `options?` | `SchemaModifierOptions` | \{SchemaModifierOptions\} Optional configuration for tool retrieval |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -389,9 +390,15 @@ This method is mostly used by the CLI to get the list of tools.No filtering is done on the tools, the list is cached in the backend, no further optimization is required.```typescript-async getToolsEnum(): Promise<ToolRetrieveEnumResponse>+async getToolsEnum(requestOptions?: ComposioRequestOptions): Promise<ToolRetrieveEnumResponse>```+**Parameters**++| Name | Type |+|------|------|+| `requestOptions?` | `ComposioRequestOptions` |+**Returns**`Promise<ToolRetrieveEnumResponse>` — The complete list of all available tools with their metadata@@ -414,14 +421,15 @@ This method allows sending custom requests to a specific toolkit or integrationwhen you need more flexibility than the standard tool execution methods provide.```typescript-async proxyExecute(body: object): Promise<ToolProxyResponse>+async proxyExecute(body: ToolProxyParams, requestOptions?: ComposioRequestOptions): Promise<ToolProxyResponse>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `body` | `object` | The parameters for the proxy request including toolkit slug and custom data |+| `body` | `ToolProxyParams` | The parameters for the proxy request including toolkit slug and custom data |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**diff --git a/docs/content/reference/sdk-reference/typescript/triggers.mdx b/docs/content/reference/sdk-reference/typescript/triggers.mdxindex 2060ed3a5..9196a73fa 100644--- a/docs/content/reference/sdk-reference/typescript/triggers.mdx+++ b/docs/content/reference/sdk-reference/typescript/triggers.mdx@@ -20,7 +20,7 @@ Create a new trigger instance for a userIf the connected account id is not provided, the first connected account for the user and toolkit will be used```typescript-async create(userId: string, slug: string, body?: { connectedAccountId?: string; triggerConfig?: Record<string, unknown> }): Promise<{ triggerId: string }>+async create(userId: string, slug: string, body?: TriggerInstanceUpsertParams, requestOptions?: ComposioRequestOptions): Promise<TriggerInstanceUpsertResponse>```**Parameters**@@ -29,11 +29,12 @@ async create(userId: string, slug: string, body?: { connectedAccountId?: string;|------|------|-------------|| `userId` | `string` | The user id of the trigger instance || `slug` | `string` | The slug of the trigger instance |-| `body?` | `object` | The parameters to create the trigger instance |+| `body?` | `TriggerInstanceUpsertParams` | The parameters to create the trigger instance |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — The created trigger instance+`Promise<TriggerInstanceUpsertResponse>` — The created trigger instance---@@ -42,7 +43,7 @@ async create(userId: string, slug: string, body?: { connectedAccountId?: string;Delete a trigger instance```typescript-async delete(triggerId: string): Promise<{ triggerId: string }>+async delete(triggerId: string, requestOptions?: ComposioRequestOptions): Promise<TriggerInstanceManageDeleteResponse>```**Parameters**@@ -50,10 +51,11 @@ async delete(triggerId: string): Promise<{ triggerId: string }>| Name | Type | Description ||------|------|-------------|| `triggerId` | `string` | The slug of the trigger instance |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>`+`Promise<TriggerInstanceManageDeleteResponse>`---@@ -62,7 +64,7 @@ async delete(triggerId: string): Promise<{ triggerId: string }>Disable a trigger instance```typescript-async disable(triggerId: string): Promise<ManageUpdateResponse>+async disable(triggerId: string, requestOptions?: ComposioRequestOptions): Promise<ManageUpdateResponse>```**Parameters**@@ -70,6 +72,7 @@ async disable(triggerId: string): Promise<ManageUpdateResponse>| Name | Type | Description ||------|------|-------------|| `triggerId` | `string` | The id of the trigger instance |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -82,7 +85,7 @@ async disable(triggerId: string): Promise<ManageUpdateResponse>Enable a trigger instance```typescript-async enable(triggerId: string): Promise<ManageUpdateResponse>+async enable(triggerId: string, requestOptions?: ComposioRequestOptions): Promise<ManageUpdateResponse>```**Parameters**@@ -90,6 +93,7 @@ async enable(triggerId: string): Promise<ManageUpdateResponse>| Name | Type | Description ||------|------|-------------|| `triggerId` | `string` | The id of the trigger instance |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**@@ -103,7 +107,7 @@ Retrieve a trigger type by its slug for the provided version of the appUse the global toolkit versions param when initializing composio to pass a toolkitversion```typescript-async getType(slug: string): Promise<...>+async getType(slug: string, requestOptions?: ComposioRequestOptions): Promise<TriggersTypeRetrieveResponse>```**Parameters**@@ -111,10 +115,11 @@ async getType(slug: string): Promise<...>| Name | Type | Description ||------|------|-------------|| `slug` | `string` | The slug of the trigger type |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — The trigger type object+`Promise<TriggersTypeRetrieveResponse>` — The trigger type object---@@ -123,18 +128,19 @@ async getType(slug: string): Promise<...>Fetch list of all the active triggers```typescript-async listActive(query?: object): Promise<...>+async listActive(query?: TriggerInstanceListActiveParams, requestOptions?: ComposioRequestOptions): Promise<TriggerInstanceListActiveResponse>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `query?` | `object` | The query parameters to filter the trigger instances |+| `query?` | `TriggerInstanceListActiveParams` | The query parameters to filter the trigger instances |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — List of trigger instances+`Promise<TriggerInstanceListActiveResponse>` — List of trigger instances**Example**@@ -154,9 +160,15 @@ Fetches the list of all the available trigger enumsThis method is used by the CLI where filters are not required.```typescript-async listEnum(): Promise<TriggersTypeRetrieveEnumResponse>+async listEnum(requestOptions?: ComposioRequestOptions): Promise<TriggersTypeRetrieveEnumResponse>```+**Parameters**++| Name | Type |+|------|------|+| `requestOptions?` | `ComposioRequestOptions` |+**Returns**`Promise<TriggersTypeRetrieveEnumResponse>`@@ -168,18 +180,19 @@ async listEnum(): Promise<TriggersTypeRetrieveEnumResponse>List all the trigger types```typescript-async listTypes(query?: { cursor?: string; limit?: number | null; toolkits?: string[] | null }): Promise<...>+async listTypes(query?: TriggersTypeListParams, requestOptions?: ComposioRequestOptions): Promise<TriggersTypeListResponse>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `query?` | `object` | The query parameters to filter the trigger types |+| `query?` | `TriggersTypeListParams` | The query parameters to filter the trigger types |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — The list of trigger types+`Promise<TriggersTypeListResponse>` — The list of trigger types---@@ -188,15 +201,15 @@ async listTypes(query?: { cursor?: string; limit?: number | null; toolkits?: strSubscribe to all the triggers```typescript-async subscribe(fn: object, filters: object): Promise<void>+async subscribe(fn: (_data: IncomingTriggerPayload) => void, filters: TriggerSubscribeParams): Promise<void>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `fn` | `object` | The function to call when a trigger is received |-| `filters` | `object` | The filters to apply to the triggers |+| `fn` | `(_data: IncomingTriggerPayload) => void` | The function to call when a trigger is received |+| `filters` | `TriggerSubscribeParams` | The filters to apply to the triggers |**Returns**@@ -241,7 +254,7 @@ await triggers.unsubscribe();Update an existing trigger instance```typescript-async update(triggerId: string, body: { status: 'enable' | 'disable' }): Promise<{ status: 'success' }>+async update(triggerId: string, body: TriggerInstanceManageUpdateParams, requestOptions?: ComposioRequestOptions): Promise<TriggerInstanceManageUpdateResponse>```**Parameters**@@ -249,11 +262,12 @@ async update(triggerId: string, body: { status: 'enable' | 'disable' }): Promise| Name | Type | Description ||------|------|-------------|| `triggerId` | `string` | The Id of the trigger instance |-| `body` | `object` | The parameters to update the trigger instance |+| `body` | `TriggerInstanceManageUpdateParams` | The parameters to update the trigger instance |+| `requestOptions?` | `ComposioRequestOptions` | |**Returns**-`Promise<...>` — The updated trigger instance response+`Promise<TriggerInstanceManageUpdateResponse>` — The updated trigger instance response---@@ -269,14 +283,14 @@ The signature is computed as: `HMAC-SHA256(${webhookId}.${webhookTimestamp}.${paand is expected in the format: `v1,base64EncodedSignature````typescript-async verifyWebhook(params: object): Promise<VerifyWebhookResult>+async verifyWebhook(params: VerifyWebhookParams): Promise<VerifyWebhookResult>```**Parameters**| Name | Type | Description ||------|------|-------------|-| `params` | `object` | The verification parameters |+| `params` | `VerifyWebhookParams` | The verification parameters |**Returns**diff --git a/ts/packages/core/scripts/generate-docs.ts b/ts/packages/core/scripts/generate-docs.tsindex f9cbaf1e1..cab38d455 100644--- a/ts/packages/core/scripts/generate-docs.ts+++ b/ts/packages/core/scripts/generate-docs.ts@@ -7,10 +7,11 @@* Run: pnpm --filter @composio/core generate:docs*/+import { readFileSync } from 'fs';import { mkdir, writeFile, rm, readdir, readFile } from 'fs/promises';-import { join, dirname } from 'path';+import { join, dirname, resolve } from 'path';import { execSync } from 'child_process';-import { fileURLToPath } from 'url';+import { fileURLToPath, pathToFileURL } from 'url';// Paths (relative to ts/packages/core)const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));@@ -139,6 +140,7 @@ interface TypeDocSignature {parameters?: TypeDocParameter[];type?: TypeDocType;typeParameter?: TypeDocTypeParameter[];+ sources?: Array<{ fileName: string; line: number }>;}interface TypeDocParameter {@@ -214,6 +216,13 @@ interface ClassDoc {source?: { file: string; line: number };}+interface SourceSignatureTypes {+ parameters: Map<string, string>;+ returnType?: string;+}++const sourceFileCache = new Map<string, string>();+function extractText(content?: Array<{ kind: string; text: string }>): string {if (!content) return '';return content@@ -250,6 +259,326 @@ function extractTag(comment: TypeDocReflection['comment'] | undefined, tagName:return comment.blockTags.filter(t => t.tag === tagName).map(t => extractText(t.content));}+function getSourceFileText(fileName: string): string | undefined {+ const filePath = join(PACKAGE_DIR, 'src', fileName);+ const cached = sourceFileCache.get(filePath);+ if (cached !== undefined) return cached;++ try {+ const text = readFileSync(filePath, 'utf-8');+ sourceFileCache.set(filePath, text);+ return text;+ } catch {+ return undefined;+ }+}++function getLineOffset(text: string, line: number): number {+ let offset = 0;+ for (let currentLine = 1; currentLine < line; currentLine++) {+ const nextLine = text.indexOf('\n', offset);+ if (nextLine === -1) return text.length;+ offset = nextLine + 1;+ }+ return offset;+}++function updateTypeDepth(+ char: string,+ depth: { angle: number; brace: number; bracket: number; paren: number }+) {+ switch (char) {+ case '<':+ depth.angle++;+ break;+ case '>':+ depth.angle = Math.max(0, depth.angle - 1);+ break;+ case '{':+ depth.brace++;+ break;+ case '}':+ depth.brace = Math.max(0, depth.brace - 1);+ break;+ case '[':+ depth.bracket++;+ break;+ case ']':+ depth.bracket = Math.max(0, depth.bracket - 1);+ break;+ case '(':+ depth.paren++;+ break;+ case ')':+ depth.paren = Math.max(0, depth.paren - 1);+ break;+ }+}++function splitTopLevel(input: string, delimiter: string): string[] {+ const parts: string[] = [];+ const depth = { angle: 0, brace: 0, bracket: 0, paren: 0 };+ let quote: string | null = null;+ let start = 0;++ for (let i = 0; i < input.length; i++) {+ const char = input[i];+ const prev = input[i - 1];++ if (quote) {+ if (char === quote && prev !== '\\') {+ quote = null;+ }+ continue;+ }++ if (char === "'" || char === '"' || char === '`') {+ quote = char;+ continue;+ }++ updateTypeDepth(char, depth);++ if (+ char === delimiter &&+ depth.angle === 0 &&+ depth.brace === 0 &&+ depth.bracket === 0 &&+ depth.paren === 0+ ) {+ parts.push(input.slice(start, i).trim());+ start = i + 1;+ }+ }++ const finalPart = input.slice(start).trim();+ if (finalPart) {+ parts.push(finalPart);+ }+ return parts;+}++function findMatchingParen(text: string, openIndex: number): number {+ const depth = { angle: 0, brace: 0, bracket: 0, paren: 0 };+ let quote: string | null = null;++ for (let i = openIndex; i < text.length; i++) {+ const char = text[i];+ const prev = text[i - 1];++ if (quote) {+ if (char === quote && prev !== '\\') {+ quote = null;+ }+ continue;+ }++ if (char === "'" || char === '"' || char === '`') {+ quote = char;+ continue;+ }++ if (char === '(') {+ depth.paren++;+ } else if (char === ')') {+ depth.paren--;+ if (depth.paren === 0) return i;+ } else {+ updateTypeDepth(char, depth);+ }+ }++ return -1;+}++function findTopLevelChar(input: string, target: string): number {+ const depth = { angle: 0, brace: 0, bracket: 0, paren: 0 };+ let quote: string | null = null;++ for (let i = 0; i < input.length; i++) {+ const char = input[i];+ const prev = input[i - 1];++ if (quote) {+ if (char === quote && prev !== '\\') {+ quote = null;+ }+ continue;+ }++ if (char === "'" || char === '"' || char === '`') {+ quote = char;+ continue;+ }++ if (+ char === target &&+ !(target === '=' && input[i + 1] === '>') &&+ depth.angle === 0 &&+ depth.brace === 0 &&+ depth.bracket === 0 &&+ depth.paren === 0+ ) {+ return i;+ }++ updateTypeDepth(char, depth);+ }++ return -1;+}++function findReturnTypeColon(text: string, start: number): number {+ const depth = { angle: 0, brace: 0, bracket: 0, paren: 0 };+ let quote: string | null = null;++ for (let i = start; i < text.length; i++) {+ const char = text[i];+ const prev = text[i - 1];++ if (quote) {+ if (char === quote && prev !== '\\') {+ quote = null;+ }+ continue;+ }++ if (char === "'" || char === '"' || char === '`') {+ quote = char;+ continue;+ }++ const isTopLevel =+ depth.angle === 0 && depth.brace === 0 && depth.bracket === 0 && depth.paren === 0;+ if (isTopLevel) {+ if (char === ':') return i;+ if (char === '{' || char === ';') return -1;+ }++ updateTypeDepth(char, depth);+ }++ return -1;+}++function findSignatureEnd(text: string, start: number): number {+ const depth = { angle: 0, brace: 0, bracket: 0, paren: 0 };+ let quote: string | null = null;++ for (let i = start; i < text.length; i++) {+ const char = text[i];+ const prev = text[i - 1];++ if (quote) {+ if (char === quote && prev !== '\\') {+ quote = null;+ }+ continue;+ }++ if (char === "'" || char === '"' || char === '`') {+ quote = char;+ continue;+ }++ const isTopLevel =+ depth.angle === 0 && depth.brace === 0 && depth.bracket === 0 && depth.paren === 0;+ const startsInlineObjectType =+ char === '{' &&+ [':', '|', '&', '(', ',', '='].includes(previousNonWhitespace(text, i - 1) ?? '');++ if ((char === ';' || (char === '{' && !startsInlineObjectType)) && isTopLevel) {+ return i;+ }++ updateTypeDepth(char, depth);+ }++ return -1;+}++function previousNonWhitespace(text: string, index: number): string | undefined {+ for (let i = index; i >= 0; i--) {+ const char = text[i];+ if (!/\s/.test(char)) {+ return char;+ }+ }+ return undefined;+}++function normalizeSourceParamName(name: string): string | undefined {+ const normalized = name+ .trim()+ .replace(/^\.\.\./, '')+ .split(/\s+/)+ .pop()+ ?.replace(/\?$/, '');++ if (!normalized || normalized.startsWith('{') || normalized.startsWith('[')) {+ return undefined;+ }+ return normalized;+}++function parseSourceParameter(param: string): [string, string] | undefined {+ const colonIndex = findTopLevelChar(param, ':');+ if (colonIndex === -1) return undefined;++ const name = normalizeSourceParamName(param.slice(0, colonIndex));+ if (!name) return undefined;++ let type = param.slice(colonIndex + 1).trim();+ const defaultIndex = findTopLevelChar(type, '=');+ if (defaultIndex !== -1) {+ type = type.slice(0, defaultIndex).trim();+ }+ return [name, type];+}++export function parseSourceSignatureTypesAtLine(+ text: string,+ line: number+): SourceSignatureTypes | undefined {+ const lineOffset = getLineOffset(text, line);+ const openParen = text.indexOf('(', lineOffset);+ if (openParen === -1) return undefined;++ const closeParen = findMatchingParen(text, openParen);+ if (closeParen === -1) return undefined;++ const parameters = new Map<string, string>();+ const paramsText = text.slice(openParen + 1, closeParen).trim();+ for (const param of splitTopLevel(paramsText, ',')) {+ const parsed = parseSourceParameter(param);+ if (parsed) {+ parameters.set(parsed[0], parsed[1]);+ }+ }++ const colonIndex = findReturnTypeColon(text, closeParen + 1);+ if (colonIndex === -1) return { parameters };++ const absoluteReturnStart = colonIndex + 1;+ const returnEnd = findSignatureEnd(text, absoluteReturnStart);+ const returnType =+ returnEnd === -1+ ? text.slice(absoluteReturnStart).trim()+ : text.slice(absoluteReturnStart, returnEnd).trim();++ return { parameters, returnType };+}++function getSourceSignatureTypes(signature: TypeDocSignature): SourceSignatureTypes | undefined {+ const source = signature.sources?.[0];+ if (!source) return undefined;++ const text = getSourceFileText(source.fileName);+ if (!text) return undefined;++ return parseSourceSignatureTypesAtLine(text, source.line);+}+function formatYamlFrontmatterString(value: string): string {return JSON.stringify(value);}@@ -331,10 +660,11 @@ function extractMethod(reflection: TypeDocReflection): MethodDoc | null {}const signatures = reflection.signatures.map(sig => {+ const sourceTypes = getSourceSignatureTypes(sig);const parameters = (sig.parameters || []).map(param => ({// Clean up ugly TypeScript internal namesname: param.name.startsWith('__') ? 'options' : param.name,- type: formatType(param.type),+ type: sourceTypes?.parameters.get(param.name) ?? formatType(param.type),required: !param.flags?.isOptional,description: extractDescription(param.comment),default: param.defaultValue,@@ -342,7 +672,7 @@ function extractMethod(reflection: TypeDocReflection): MethodDoc | null {return {parameters,- returnType: formatType(sig.type),+ returnType: sourceTypes?.returnType ?? formatType(sig.type),returnDescription: extractTag(sig.comment, '@returns')[0],};});@@ -357,7 +687,9 @@ function extractMethod(reflection: TypeDocReflection): MethodDoc | null {description,signatures,examples,- isAsync: formatType(primarySig.type).startsWith('Promise'),+ isAsync:+ signatures[0]?.returnType.startsWith('Promise') ??+ formatType(primarySig.type).startsWith('Promise'),source: reflection.sources?.[0]? { file: reflection.sources[0].fileName, line: reflection.sources[0].line }: undefined,@@ -646,29 +978,36 @@ function cleanupGenericTypes(type: string): string {}// Escape type strings for safe use in MDX backtick code spans.-// Escapes curly braces which MDX interprets as JSX expressions.-function escapeTypeForMdx(type: string): string {- return type.replace(/\{/g, '\\{').replace(/\}/g, '\\}');+// Escapes backslashes first so later Markdown escapes cannot be neutralized.+export function escapeTypeForMdx(type: string): string {+ return type+ .replace(/\\/g, '\\\\')+ .replace(/\{/g, '\\{')+ .replace(/\}/g, '\\}')+ .replace(/\|/g, '\\|');+}++function isInlineObjectType(type: string): boolean {+ return type.startsWith('{') || type.includes(': {');}-// Simplify complex types for table display (aggressive)-function simplifyTypeForTable(type: string): string {+// Simplify complex types for table display while preserving public object shapes.+export function simplifyTypeForTable(type: string): string {// First clean up internal genericsconst cleaned = cleanupGenericTypes(type);+ if (isInlineObjectType(cleaned)) {+ return cleaned;+ }+// If type is too long or complex, simplify it- if (cleaned.length > 80 || (cleaned.includes('{') && cleaned.includes('}'))) {+ if (cleaned.length > 80) {// Extract just the outer type name if it's a genericconst genericMatch = cleaned.match(/^([A-Za-z]+)<.*>$/);if (genericMatch) {return `${genericMatch[1]}<...>`;}- // For object types, just show 'object'- if (cleaned.startsWith('{') || cleaned.includes(': {')) {- return 'object';- }-// For function types, simplifyif (cleaned.includes('=>')) {const returnMatch = cleaned.match(/=>\s*(.+)$/);@@ -685,12 +1024,16 @@ function simplifyTypeForTable(type: string): string {}// Simplify types for code block display (less aggressive, preserves structure)-function simplifyTypeForSignature(type: string): string {+export function simplifyTypeForSignature(type: string): string {// First clean up internal genericsconst cleaned = cleanupGenericTypes(type);+ if (isInlineObjectType(cleaned)) {+ return cleaned;+ }+// Keep types under 100 chars as-is- if (cleaned.length <= 100 && !cleaned.includes(': {')) {+ if (cleaned.length <= 100) {return cleaned;}@@ -712,11 +1055,6 @@ function simplifyTypeForSignature(type: string): string {}}- // For inline object types in signatures- if (cleaned.includes(': {') || (cleaned.startsWith('{') && cleaned.length > 60)) {- return 'object';- }-// Truncate very long typesif (cleaned.length > 100) {return cleaned.substring(0, 97) + '...';@@ -897,7 +1235,14 @@ const result = await composio.tools.execute('GITHUB_GET_REPOS', {console.log(` Files generated: ${documented.length + 2}`); // +2 for index.mdx and meta.json}-main().catch(error => {- console.error('Fatal error:', error);- process.exit(1);-});+function isDirectRun(): boolean {+ const entrypoint = process.argv[1];+ return Boolean(entrypoint && import.meta.url === pathToFileURL(resolve(entrypoint)).href);+}++if (isDirectRun()) {+ main().catch(error => {+ console.error('Fatal error:', error);+ process.exit(1);+ });+}diff --git a/ts/packages/core/src/models/Tools.ts b/ts/packages/core/src/models/Tools.tsindex 808fc5dfd..8299a0e93 100644--- a/ts/packages/core/src/models/Tools.ts+++ b/ts/packages/core/src/models/Tools.ts@@ -682,7 +682,7 @@ export class Tools<* });** // Timeout a slow search after 5s- * const tools = await composio.tools.get('default', {+ * const emailTools = await composio.tools.get('default', {* search: 'send email',* }, { signal: AbortSignal.timeout(5_000) });* ```@@ -953,8 +953,8 @@ export class Tools<* @param {string} [body.userId] - The user ID to execute the tool for* @param {string} [body.connectedAccountId] - The connected account ID to use for authenticated tools* @param {Record<string, unknown>} [body.arguments] - The arguments to pass to the tool- * @param {ExecuteToolModifiers} [modifiers] - Optional modifiers to transform the request or response- * @returns {Promise<ToolExecuteResponse>} - The response from the tool execution+ * @param {ExecuteToolModifiers & ComposioRequestOptions} [options] - Optional modifiers and request options+ * @returns {Promise<ToolExecuteResponse>} The response from the tool execution** @throws {ComposioConnectedAccountNotFoundError} If the connected account is not found* @throws {ComposioToolNotFoundError} If the tool with the given slug is not founddiff --git a/ts/packages/core/test/scripts/generate-docs.test.ts b/ts/packages/core/test/scripts/generate-docs.test.tsnew file mode 100644index 000000000..3bd2e871b--- /dev/null+++ b/ts/packages/core/test/scripts/generate-docs.test.ts@@ -0,0 +1,114 @@+import { describe, expect, it } from 'vitest';+import {+ escapeTypeForMdx,+ parseSourceSignatureTypesAtLine,+ simplifyTypeForSignature,+ simplifyTypeForTable,+} from '../../scripts/generate-docs';++describe('generate-docs type rendering', () => {+ it('preserves inline object shapes in signatures', () => {+ const type =+ '{ cursor?: string; isComposioManaged?: boolean; limit?: number; toolkit?: string }';++ expect(simplifyTypeForSignature(type)).toBe(type);+ });++ it('preserves inline object shapes in parameter tables', () => {+ const type = '{ arguments?: Record<string, unknown>; sessionId: string }';++ expect(simplifyTypeForTable(type)).toBe(type);+ });++ it('preserves nested object shapes instead of collapsing them to object', () => {+ const type = '{ account?: { id?: string; label?: string }; timeout?: number }';++ expect(simplifyTypeForSignature(type)).toBe(type);+ expect(simplifyTypeForTable(type)).toBe(type);+ });++ it('escapes pipes and braces for MDX tables', () => {+ expect(escapeTypeForMdx("{ status: 'enable' | 'disable' }")).toBe(+ "\\{ status: 'enable' \\| 'disable' \\}"+ );+ });++ it('escapes existing backslashes before adding MDX table escapes', () => {+ expect(escapeTypeForMdx(String.raw`{ pattern: '\|' }`)).toBe(String.raw`\{ pattern: '\\\|' \}`);+ });++ it('reads named parameter and return types from source signatures', () => {+ const source = `+class Example {+ async list(+ query?: AuthConfigListParams,+ requestOptions?: ComposioRequestOptions+ ): Promise<AuthConfigListResponse> {+ return undefined as never;+ }+}+`;+ const line = source.split('\n').findIndex(line => line.includes('async list(')) + 1;++ const signature = parseSourceSignatureTypesAtLine(source, line);++ expect(signature?.parameters.get('query')).toBe('AuthConfigListParams');+ expect(signature?.parameters.get('requestOptions')).toBe('ComposioRequestOptions');+ expect(signature?.returnType).toBe('Promise<AuthConfigListResponse>');+ });++ it('reads authored inline object types from source signatures', () => {+ const source = `+class Example {+ getResult(input: { id: string; mode?: 'fast' | 'safe' }): { ok: boolean; value?: string } {+ return { ok: true };+ }+}+`;+ const line = source.split('\n').findIndex(line => line.includes('getResult(')) + 1;++ const signature = parseSourceSignatureTypesAtLine(source, line);++ expect(signature?.parameters.get('input')).toBe("{ id: string; mode?: 'fast' | 'safe' }");+ expect(signature?.returnType).toBe('{ ok: boolean; value?: string }');+ });++ it('does not infer a return type when the source signature omits one', () => {+ const source = `+class Example {+ async toolkits(options?: ToolRouterToolkitsOptions, requestOptions?: ComposioRequestOptions) {+ const params = { search: options?.search };+ return params;+ }++ async search(params: { query: string }): Promise<ToolRouterSessionSearchResponse> {+ return undefined as never;+ }+}+`;+ const line = source.split('\n').findIndex(line => line.includes('async toolkits(')) + 1;++ const signature = parseSourceSignatureTypesAtLine(source, line);++ expect(signature?.parameters.get('options')).toBe('ToolRouterToolkitsOptions');+ expect(signature?.parameters.get('requestOptions')).toBe('ComposioRequestOptions');+ expect(signature?.returnType).toBeUndefined();+ });++ it('keeps arrow function parameter types intact', () => {+ const source = `+class Example {+ subscribe(fn: (event: TriggerEvent) => void, filters?: TriggerSubscribeParams): void {+ fn(undefined as never);+ }+}+`;+ const line = source.split('\n').findIndex(line => line.includes('subscribe(')) + 1;++ const signature = parseSourceSignatureTypesAtLine(source, line);++ expect(signature?.parameters.get('fn')).toBe('(event: TriggerEvent) => void');+ expect(signature?.parameters.get('filters')).toBe('TriggerSubscribeParams');+ expect(signature?.returnType).toBe('void');+ });+});