@composio/client 2.0.0-rc.2 → 2.0.0-rc.21
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.
- package/README.md +629 -9
- package/dist/{client-D5v0_f-k.d.mts → api-key-revocation-BB3FTdR3.d.mts} +5686 -2238
- package/dist/effect/schemas/api-key-revocation/create.d.mts +8 -0
- package/dist/effect/schemas/api-key-revocation/create.mjs +8 -0
- package/dist/effect/schemas/auth/session/retrieve-info.d.mts +56 -0
- package/dist/effect/schemas/auth/session/retrieve-info.mjs +174 -0
- package/dist/effect/schemas/auth-configs/create.d.mts +16 -0
- package/dist/effect/schemas/auth-configs/create.mjs +22 -0
- package/dist/effect/schemas/auth-configs/delete.d.mts +10 -0
- package/dist/effect/schemas/auth-configs/delete.mjs +15 -0
- package/dist/effect/schemas/auth-configs/list.d.mts +54 -0
- package/dist/effect/schemas/auth-configs/list.mjs +66 -0
- package/dist/effect/schemas/auth-configs/retrieve.d.mts +48 -0
- package/dist/effect/schemas/auth-configs/retrieve.mjs +60 -0
- package/dist/effect/schemas/auth-configs/update-status.d.mts +9 -0
- package/dist/effect/schemas/auth-configs/update-status.mjs +11 -0
- package/dist/effect/schemas/auth-configs/update.d.mts +9 -0
- package/dist/effect/schemas/auth-configs/update.mjs +11 -0
- package/dist/effect/schemas/cli/create-codact-failure.d.mts +9 -0
- package/dist/effect/schemas/cli/create-codact-failure.mjs +17 -0
- package/dist/effect/schemas/cli/create-session.d.mts +12 -0
- package/dist/effect/schemas/cli/create-session.mjs +26 -0
- package/dist/effect/schemas/cli/get-session.d.mts +18 -0
- package/dist/effect/schemas/cli/get-session.mjs +48 -0
- package/dist/effect/schemas/cli/realtime/auth.d.mts +9 -0
- package/dist/effect/schemas/cli/realtime/auth.mjs +11 -0
- package/dist/effect/schemas/cli/realtime/credentials.d.mts +10 -0
- package/dist/effect/schemas/cli/realtime/credentials.mjs +12 -0
- package/dist/effect/schemas/components/auth-config-retrieve-response-expected-input-fields.d.mts +17 -0
- package/dist/effect/schemas/components/auth-config-retrieve-response-expected-input-fields.mjs +22 -0
- package/dist/effect/schemas/components/auth-config-retrieve-response-tool-access-config.d.mts +9 -0
- package/dist/effect/schemas/components/auth-config-retrieve-response-tool-access-config.mjs +20 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option1-val-option1.d.mts +31 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option1-val-option1.mjs +33 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option1-val-option4.d.mts +33 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option1-val-option4.mjs +35 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option1-val-option5.d.mts +32 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option1-val-option5.mjs +34 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option1.d.mts +179 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option1.mjs +113 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option10.d.mts +168 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option10.mjs +104 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option11.d.mts +140 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option11.mjs +76 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option12.d.mts +162 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option12.mjs +12 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option13.d.mts +202 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option13.mjs +130 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option14.d.mts +193 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option14.mjs +211 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option15.d.mts +176 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option15.mjs +86 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option2-val-option1.d.mts +33 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option2-val-option1.mjs +35 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option2-val-option5.d.mts +35 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option2-val-option5.mjs +37 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option2-val-option6.d.mts +34 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option2-val-option6.mjs +36 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option2.d.mts +231 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option2.mjs +160 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option3-val-option2.d.mts +31 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option3-val-option2.mjs +33 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option3-val-option6.d.mts +31 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option3-val-option6.mjs +33 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option3.d.mts +171 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option3.mjs +108 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option4.d.mts +139 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option4.mjs +74 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option5.d.mts +136 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option5.mjs +72 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option6.d.mts +139 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option6.mjs +98 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option7-val.d.mts +159 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option7-val.mjs +69 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option7.d.mts +162 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option7.mjs +12 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option8.d.mts +162 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option8.mjs +12 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option9.d.mts +167 -0
- package/dist/effect/schemas/components/connected-account-create-response-connection-data-option9.mjs +101 -0
- package/dist/effect/schemas/components/connected-account-retrieve-response-state.d.mts +2443 -0
- package/dist/effect/schemas/components/connected-account-retrieve-response-state.mjs +42 -0
- package/dist/effect/schemas/components/deprecated-toolkit-info.d.mts +8 -0
- package/dist/effect/schemas/components/deprecated-toolkit-info.mjs +12 -0
- package/dist/effect/schemas/components/execute-completed.d.mts +16 -0
- package/dist/effect/schemas/components/execute-completed.mjs +27 -0
- package/dist/effect/schemas/components/execute-failed.d.mts +16 -0
- package/dist/effect/schemas/components/execute-failed.mjs +27 -0
- package/dist/effect/schemas/components/execute-requires-user-input.d.mts +15 -0
- package/dist/effect/schemas/components/execute-requires-user-input.mjs +16 -0
- package/dist/effect/schemas/components/instant-account.d.mts +12 -0
- package/dist/effect/schemas/components/instant-account.mjs +15 -0
- package/dist/effect/schemas/components/mcp-create-response-commands.d.mts +10 -0
- package/dist/effect/schemas/components/mcp-create-response-commands.mjs +24 -0
- package/dist/effect/schemas/components/mcp-list-response-items.d.mts +23 -0
- package/dist/effect/schemas/components/mcp-list-response-items.mjs +96 -0
- package/dist/effect/schemas/components/project-list-response-data.d.mts +21 -0
- package/dist/effect/schemas/components/project-list-response-data.mjs +74 -0
- package/dist/effect/schemas/components/proxy-execute-completed.d.mts +17 -0
- package/dist/effect/schemas/components/proxy-execute-completed.mjs +36 -0
- package/dist/effect/schemas/components/session-create-response-config.d.mts +84 -0
- package/dist/effect/schemas/components/session-create-response-config.mjs +143 -0
- package/dist/effect/schemas/components/session-create-response-experimental-custom-toolkits.d.mts +20 -0
- package/dist/effect/schemas/components/session-create-response-experimental-custom-toolkits.mjs +25 -0
- package/dist/effect/schemas/components/session-create-response-warnings.d.mts +9 -0
- package/dist/effect/schemas/components/session-create-response-warnings.mjs +25 -0
- package/dist/effect/schemas/components/session-link-response-experimental.d.mts +13 -0
- package/dist/effect/schemas/components/session-link-response-experimental.mjs +18 -0
- package/dist/effect/schemas/components/session-retrieve-response-experimental.d.mts +37 -0
- package/dist/effect/schemas/components/session-retrieve-response-experimental.mjs +27 -0
- package/dist/effect/schemas/components/tool-details.d.mts +51 -0
- package/dist/effect/schemas/components/tool-details.mjs +144 -0
- package/dist/effect/schemas/components/tool-pricing.d.mts +9 -0
- package/dist/effect/schemas/components/tool-pricing.mjs +14 -0
- package/dist/effect/schemas/components/tool-router-session-v31-config-history-list-response.d.mts +95 -0
- package/dist/effect/schemas/components/tool-router-session-v31-config-history-list-response.mjs +154 -0
- package/dist/effect/schemas/components/tool-router-toolkits-list-response.d.mts +34 -0
- package/dist/effect/schemas/components/tool-router-toolkits-list-response.mjs +45 -0
- package/dist/effect/schemas/components/tool.d.mts +51 -0
- package/dist/effect/schemas/components/tool.mjs +144 -0
- package/dist/effect/schemas/components/toolkit-list-response-items.d.mts +36 -0
- package/dist/effect/schemas/components/toolkit-list-response-items.mjs +101 -0
- package/dist/effect/schemas/components/tools-paginated.d.mts +57 -0
- package/dist/effect/schemas/components/tools-paginated.mjs +15 -0
- package/dist/effect/schemas/components/trigger-retrieve-response-log.d.mts +31 -0
- package/dist/effect/schemas/components/trigger-retrieve-response-log.mjs +39 -0
- package/dist/effect/schemas/components/user-input-request.d.mts +11 -0
- package/dist/effect/schemas/components/user-input-request.mjs +19 -0
- package/dist/effect/schemas/connected-accounts/complete-auth.d.mts +9 -0
- package/dist/effect/schemas/connected-accounts/complete-auth.mjs +11 -0
- package/dist/effect/schemas/connected-accounts/create.d.mts +2457 -0
- package/dist/effect/schemas/connected-accounts/create.mjs +58 -0
- package/dist/effect/schemas/connected-accounts/delete.d.mts +9 -0
- package/dist/effect/schemas/connected-accounts/delete.mjs +17 -0
- package/dist/effect/schemas/connected-accounts/list.d.mts +2480 -0
- package/dist/effect/schemas/connected-accounts/list.mjs +84 -0
- package/dist/effect/schemas/connected-accounts/patch.d.mts +10 -0
- package/dist/effect/schemas/connected-accounts/patch.mjs +19 -0
- package/dist/effect/schemas/connected-accounts/refresh.d.mts +10 -0
- package/dist/effect/schemas/connected-accounts/refresh.mjs +27 -0
- package/dist/effect/schemas/connected-accounts/retrieve.d.mts +2477 -0
- package/dist/effect/schemas/connected-accounts/retrieve.mjs +81 -0
- package/dist/effect/schemas/connected-accounts/revoke.d.mts +12 -0
- package/dist/effect/schemas/connected-accounts/revoke.mjs +35 -0
- package/dist/effect/schemas/connected-accounts/update-status.d.mts +8 -0
- package/dist/effect/schemas/connected-accounts/update-status.mjs +11 -0
- package/dist/effect/schemas/custom/delete-toolkit.d.mts +12 -0
- package/dist/effect/schemas/custom/delete-toolkit.mjs +17 -0
- package/dist/effect/schemas/custom/sync.d.mts +10 -0
- package/dist/effect/schemas/custom/sync.mjs +21 -0
- package/dist/effect/schemas/custom/upsert.d.mts +8 -0
- package/dist/effect/schemas/custom/upsert.mjs +11 -0
- package/dist/effect/schemas/files/create-presigned-url.d.mts +15 -0
- package/dist/effect/schemas/files/create-presigned-url.mjs +15 -0
- package/dist/effect/schemas/files/list.d.mts +18 -0
- package/dist/effect/schemas/files/list.mjs +20 -0
- package/dist/effect/schemas/keyring/list-transfer-keys.d.mts +17 -0
- package/dist/effect/schemas/keyring/list-transfer-keys.mjs +19 -0
- package/dist/effect/schemas/link/create.d.mts +19 -0
- package/dist/effect/schemas/link/create.mjs +18 -0
- package/dist/effect/schemas/logs/create-tool-execution.d.mts +25 -0
- package/dist/effect/schemas/logs/create-tool-execution.mjs +39 -0
- package/dist/effect/schemas/logs/retrieve-tool-execution.d.mts +37 -0
- package/dist/effect/schemas/logs/retrieve-tool-execution.mjs +51 -0
- package/dist/effect/schemas/logs/tools/list-fields.d.mts +13 -0
- package/dist/effect/schemas/logs/tools/list-fields.mjs +13 -0
- package/dist/effect/schemas/logs/tools/list.d.mts +28 -0
- package/dist/effect/schemas/logs/tools/list.mjs +33 -0
- package/dist/effect/schemas/logs/tools/retrieve.d.mts +60 -0
- package/dist/effect/schemas/logs/tools/retrieve.mjs +74 -0
- package/dist/effect/schemas/logs/triggers/list.d.mts +34 -0
- package/dist/effect/schemas/logs/triggers/list.mjs +12 -0
- package/dist/effect/schemas/logs/triggers/retrieve.d.mts +33 -0
- package/dist/effect/schemas/logs/triggers/retrieve.mjs +9 -0
- package/dist/effect/schemas/mcp/create-instance.d.mts +12 -0
- package/dist/effect/schemas/mcp/create-instance.mjs +29 -0
- package/dist/effect/schemas/mcp/create.d.mts +23 -0
- package/dist/effect/schemas/mcp/create.mjs +67 -0
- package/dist/effect/schemas/mcp/custom/create.d.mts +17 -0
- package/dist/effect/schemas/mcp/custom/create.mjs +48 -0
- package/dist/effect/schemas/mcp/delete-instance.d.mts +9 -0
- package/dist/effect/schemas/mcp/delete-instance.mjs +11 -0
- package/dist/effect/schemas/mcp/delete.d.mts +9 -0
- package/dist/effect/schemas/mcp/delete.mjs +17 -0
- package/dist/effect/schemas/mcp/generate/url.d.mts +10 -0
- package/dist/effect/schemas/mcp/generate/url.mjs +21 -0
- package/dist/effect/schemas/mcp/list-instances.d.mts +18 -0
- package/dist/effect/schemas/mcp/list-instances.mjs +56 -0
- package/dist/effect/schemas/mcp/list.d.mts +27 -0
- package/dist/effect/schemas/mcp/list.mjs +19 -0
- package/dist/effect/schemas/mcp/retrieve-app.d.mts +27 -0
- package/dist/effect/schemas/mcp/retrieve-app.mjs +19 -0
- package/dist/effect/schemas/mcp/retrieve.d.mts +24 -0
- package/dist/effect/schemas/mcp/retrieve.mjs +68 -0
- package/dist/effect/schemas/mcp/update.d.mts +24 -0
- package/dist/effect/schemas/mcp/update.mjs +68 -0
- package/dist/effect/schemas/org/clanker/create-claim.d.mts +9 -0
- package/dist/effect/schemas/org/clanker/create-claim.mjs +14 -0
- package/dist/effect/schemas/org/consumer/list-connected-toolkits.d.mts +8 -0
- package/dist/effect/schemas/org/consumer/list-connected-toolkits.mjs +8 -0
- package/dist/effect/schemas/org/consumer/project/resolve.d.mts +19 -0
- package/dist/effect/schemas/org/consumer/project/resolve.mjs +30 -0
- package/dist/effect/schemas/org/list.d.mts +17 -0
- package/dist/effect/schemas/org/list.mjs +22 -0
- package/dist/effect/schemas/org/owner/project/create.d.mts +10 -0
- package/dist/effect/schemas/org/owner/project/create.mjs +22 -0
- package/dist/effect/schemas/org/owner/project/delete.d.mts +9 -0
- package/dist/effect/schemas/org/owner/project/delete.mjs +17 -0
- package/dist/effect/schemas/org/owner/project/list.d.mts +27 -0
- package/dist/effect/schemas/org/owner/project/list.mjs +15 -0
- package/dist/effect/schemas/org/owner/project/regenerate-api-key.d.mts +14 -0
- package/dist/effect/schemas/org/owner/project/regenerate-api-key.mjs +31 -0
- package/dist/effect/schemas/org/owner/project/retrieve.d.mts +27 -0
- package/dist/effect/schemas/org/owner/project/retrieve.mjs +93 -0
- package/dist/effect/schemas/org/project/list.d.mts +27 -0
- package/dist/effect/schemas/org/project/list.mjs +15 -0
- package/dist/effect/schemas/org/usage/retrieve-summary.d.mts +13 -0
- package/dist/effect/schemas/org/usage/retrieve-summary.mjs +15 -0
- package/dist/effect/schemas/org/usage/retrieve.d.mts +16 -0
- package/dist/effect/schemas/org/usage/retrieve.mjs +18 -0
- package/dist/effect/schemas/project/usage/retrieve-summary.d.mts +13 -0
- package/dist/effect/schemas/project/usage/retrieve-summary.mjs +15 -0
- package/dist/effect/schemas/project/usage/retrieve.d.mts +16 -0
- package/dist/effect/schemas/project/usage/retrieve.mjs +18 -0
- package/dist/effect/schemas/session-configs/list.d.mts +15 -0
- package/dist/effect/schemas/session-configs/list.mjs +26 -0
- package/dist/effect/schemas/session-configs/retrieve.d.mts +34 -0
- package/dist/effect/schemas/session-configs/retrieve.mjs +67 -0
- package/dist/effect/schemas/tool-router/session/attach.d.mts +129 -0
- package/dist/effect/schemas/tool-router/session/attach.mjs +30 -0
- package/dist/effect/schemas/tool-router/session/config-history.d.mts +94 -0
- package/dist/effect/schemas/tool-router/session/config-history.mjs +8 -0
- package/dist/effect/schemas/tool-router/session/create.d.mts +129 -0
- package/dist/effect/schemas/tool-router/session/create.mjs +45 -0
- package/dist/effect/schemas/tool-router/session/delete.d.mts +9 -0
- package/dist/effect/schemas/tool-router/session/delete.mjs +18 -0
- package/dist/effect/schemas/tool-router/session/execute-meta.d.mts +35 -0
- package/dist/effect/schemas/tool-router/session/execute-meta.mjs +15 -0
- package/dist/effect/schemas/tool-router/session/execute.d.mts +35 -0
- package/dist/effect/schemas/tool-router/session/execute.mjs +15 -0
- package/dist/effect/schemas/tool-router/session/files/create-download-url.d.mts +11 -0
- package/dist/effect/schemas/tool-router/session/files/create-download-url.mjs +13 -0
- package/dist/effect/schemas/tool-router/session/files/create-upload-url.d.mts +11 -0
- package/dist/effect/schemas/tool-router/session/files/create-upload-url.mjs +13 -0
- package/dist/effect/schemas/tool-router/session/files/delete.d.mts +9 -0
- package/dist/effect/schemas/tool-router/session/files/delete.mjs +11 -0
- package/dist/effect/schemas/tool-router/session/files/list.d.mts +14 -0
- package/dist/effect/schemas/tool-router/session/files/list.mjs +16 -0
- package/dist/effect/schemas/tool-router/session/link.d.mts +18 -0
- package/dist/effect/schemas/tool-router/session/link.mjs +25 -0
- package/dist/effect/schemas/tool-router/session/patch.d.mts +129 -0
- package/dist/effect/schemas/tool-router/session/patch.mjs +30 -0
- package/dist/effect/schemas/tool-router/session/proxy-execute.d.mts +26 -0
- package/dist/effect/schemas/tool-router/session/proxy-execute.mjs +10 -0
- package/dist/effect/schemas/tool-router/session/retrieve.d.mts +129 -0
- package/dist/effect/schemas/tool-router/session/retrieve.mjs +30 -0
- package/dist/effect/schemas/tool-router/session/search.d.mts +80 -0
- package/dist/effect/schemas/tool-router/session/search.mjs +78 -0
- package/dist/effect/schemas/tool-router/session/toolkits.d.mts +33 -0
- package/dist/effect/schemas/tool-router/session/toolkits.mjs +8 -0
- package/dist/effect/schemas/tool-router/session/tools.d.mts +56 -0
- package/dist/effect/schemas/tool-router/session/tools.mjs +8 -0
- package/dist/effect/schemas/toolkits/list.d.mts +42 -0
- package/dist/effect/schemas/toolkits/list.mjs +15 -0
- package/dist/effect/schemas/toolkits/recommend-scopes.d.mts +19 -0
- package/dist/effect/schemas/toolkits/recommend-scopes.mjs +21 -0
- package/dist/effect/schemas/toolkits/retrieve-categories.d.mts +15 -0
- package/dist/effect/schemas/toolkits/retrieve-categories.mjs +23 -0
- package/dist/effect/schemas/toolkits/retrieve-changelog.d.mts +16 -0
- package/dist/effect/schemas/toolkits/retrieve-changelog.mjs +16 -0
- package/dist/effect/schemas/toolkits/retrieve-multi.d.mts +42 -0
- package/dist/effect/schemas/toolkits/retrieve-multi.mjs +15 -0
- package/dist/effect/schemas/toolkits/retrieve-scopes-grant-context.d.mts +15 -0
- package/dist/effect/schemas/toolkits/retrieve-scopes-grant-context.mjs +17 -0
- package/dist/effect/schemas/toolkits/retrieve.d.mts +110 -0
- package/dist/effect/schemas/toolkits/retrieve.mjs +202 -0
- package/dist/effect/schemas/tools/execute.d.mts +12 -0
- package/dist/effect/schemas/tools/execute.mjs +35 -0
- package/dist/effect/schemas/tools/get-input.d.mts +9 -0
- package/dist/effect/schemas/tools/get-input.mjs +22 -0
- package/dist/effect/schemas/tools/list.d.mts +56 -0
- package/dist/effect/schemas/tools/list.mjs +8 -0
- package/dist/effect/schemas/tools/proxy.d.mts +16 -0
- package/dist/effect/schemas/tools/proxy.mjs +36 -0
- package/dist/effect/schemas/tools/retrieve-enum.d.mts +6 -0
- package/dist/effect/schemas/tools/retrieve-enum.mjs +8 -0
- package/dist/effect/schemas/tools/retrieve-required-scopes.d.mts +22 -0
- package/dist/effect/schemas/tools/retrieve-required-scopes.mjs +33 -0
- package/dist/effect/schemas/tools/retrieve.d.mts +50 -0
- package/dist/effect/schemas/tools/retrieve.mjs +8 -0
- package/dist/effect/schemas/trigger-instances/list-active.d.mts +34 -0
- package/dist/effect/schemas/trigger-instances/list-active.mjs +37 -0
- package/dist/effect/schemas/trigger-instances/manage/delete.d.mts +8 -0
- package/dist/effect/schemas/trigger-instances/manage/delete.mjs +11 -0
- package/dist/effect/schemas/trigger-instances/manage/update.d.mts +8 -0
- package/dist/effect/schemas/trigger-instances/manage/update.mjs +8 -0
- package/dist/effect/schemas/trigger-instances/upsert.d.mts +8 -0
- package/dist/effect/schemas/trigger-instances/upsert.mjs +8 -0
- package/dist/effect/schemas/triggers-types/list.d.mts +27 -0
- package/dist/effect/schemas/triggers-types/list.mjs +86 -0
- package/dist/effect/schemas/triggers-types/retrieve-enum.d.mts +6 -0
- package/dist/effect/schemas/triggers-types/retrieve-enum.mjs +8 -0
- package/dist/effect/schemas/triggers-types/retrieve.d.mts +21 -0
- package/dist/effect/schemas/triggers-types/retrieve.mjs +80 -0
- package/dist/effect/schemas/webhook-endpoints/create.d.mts +13 -0
- package/dist/effect/schemas/webhook-endpoints/create.mjs +15 -0
- package/dist/effect/schemas/webhook-endpoints/list.d.mts +12 -0
- package/dist/effect/schemas/webhook-endpoints/list.mjs +12 -0
- package/dist/effect/schemas/webhook-endpoints/replace.d.mts +13 -0
- package/dist/effect/schemas/webhook-endpoints/replace.mjs +15 -0
- package/dist/effect/schemas/webhook-endpoints/retrieve.d.mts +13 -0
- package/dist/effect/schemas/webhook-endpoints/retrieve.mjs +15 -0
- package/dist/effect/schemas/webhook-endpoints/update.d.mts +13 -0
- package/dist/effect/schemas/webhook-endpoints/update.mjs +15 -0
- package/dist/effect/schemas/webhook-subscriptions/create.d.mts +14 -0
- package/dist/effect/schemas/webhook-subscriptions/create.mjs +23 -0
- package/dist/effect/schemas/webhook-subscriptions/delete.d.mts +8 -0
- package/dist/effect/schemas/webhook-subscriptions/delete.mjs +8 -0
- package/dist/effect/schemas/webhook-subscriptions/list-event-types.d.mts +12 -0
- package/dist/effect/schemas/webhook-subscriptions/list-event-types.mjs +16 -0
- package/dist/effect/schemas/webhook-subscriptions/list.d.mts +20 -0
- package/dist/effect/schemas/webhook-subscriptions/list.mjs +29 -0
- package/dist/effect/schemas/webhook-subscriptions/retrieve.d.mts +14 -0
- package/dist/effect/schemas/webhook-subscriptions/retrieve.mjs +23 -0
- package/dist/effect/schemas/webhook-subscriptions/rotate-secret.d.mts +9 -0
- package/dist/effect/schemas/webhook-subscriptions/rotate-secret.mjs +14 -0
- package/dist/effect/schemas/webhook-subscriptions/update.d.mts +14 -0
- package/dist/effect/schemas/webhook-subscriptions/update.mjs +23 -0
- package/dist/effect/schemas.d.mts +9645 -0
- package/dist/effect/schemas.mjs +131 -0
- package/dist/effect.d.mts +756 -0
- package/dist/effect.mjs +1626 -0
- package/dist/environments-BXSnADKo.d.mts +19 -0
- package/dist/environments-CmxYUUsW.mjs +222 -0
- package/dist/error-Bw7_G2NZ.mjs +117 -0
- package/dist/{request-zLX87M09.mjs → generated-operations-BNRn8az6.mjs} +1493 -307
- package/dist/index.d.mts +3 -5
- package/dist/index.mjs +157 -1098
- package/dist/pagination-rules-CMnBwktJ.mjs +36 -0
- package/dist/pagination.d.mts +56 -0
- package/dist/pagination.mjs +46 -0
- package/dist/resources/api-key-revocation.d.mts +2 -2
- package/dist/resources/api-key-revocation.mjs +13 -2
- package/dist/resources/auth/auth.d.mts +2 -2
- package/dist/resources/auth/auth.mjs +7 -2
- package/dist/resources/auth/session.d.mts +2 -2
- package/dist/resources/auth/session.mjs +10 -2
- package/dist/resources/auth-configs.d.mts +2 -2
- package/dist/resources/auth-configs.mjs +45 -2
- package/dist/resources/auth.d.mts +2 -2
- package/dist/resources/auth.mjs +1 -5
- package/dist/resources/cli/cli.d.mts +2 -2
- package/dist/resources/cli/cli.mjs +32 -2
- package/dist/resources/cli/realtime.d.mts +2 -2
- package/dist/resources/cli/realtime.mjs +19 -2
- package/dist/resources/cli.d.mts +2 -2
- package/dist/resources/cli.mjs +1 -5
- package/dist/resources/connected-accounts.d.mts +2 -2
- package/dist/resources/connected-accounts.mjs +70 -2
- package/dist/resources/custom.d.mts +2 -0
- package/dist/resources/custom.mjs +30 -0
- package/dist/resources/files.d.mts +2 -2
- package/dist/resources/files.mjs +22 -2
- package/dist/resources/keyring.d.mts +2 -0
- package/dist/resources/keyring.mjs +11 -0
- package/dist/resources/link.d.mts +2 -2
- package/dist/resources/link.mjs +13 -2
- package/dist/resources/logs/logs.d.mts +2 -2
- package/dist/resources/logs/logs.mjs +23 -2
- package/dist/resources/logs/tools.d.mts +2 -2
- package/dist/resources/logs/tools.mjs +23 -2
- package/dist/resources/logs/triggers.d.mts +2 -2
- package/dist/resources/logs/triggers.mjs +19 -2
- package/dist/resources/logs.d.mts +2 -2
- package/dist/resources/logs.mjs +1 -6
- package/dist/resources/mcp/custom.d.mts +2 -2
- package/dist/resources/mcp/custom.mjs +13 -2
- package/dist/resources/mcp/generate.d.mts +2 -2
- package/dist/resources/mcp/generate.mjs +13 -2
- package/dist/resources/mcp/mcp.d.mts +2 -2
- package/dist/resources/mcp/mcp.mjs +67 -2
- package/dist/resources/mcp.d.mts +2 -2
- package/dist/resources/mcp.mjs +1 -6
- package/dist/resources/org/clanker.d.mts +2 -2
- package/dist/resources/org/clanker.mjs +13 -2
- package/dist/resources/org/consumer/consumer.d.mts +2 -2
- package/dist/resources/org/consumer/consumer.mjs +21 -2
- package/dist/resources/org/consumer/project.d.mts +2 -2
- package/dist/resources/org/consumer/project.mjs +14 -2
- package/dist/resources/org/consumer.d.mts +2 -2
- package/dist/resources/org/consumer.mjs +1 -5
- package/dist/resources/org/org.d.mts +2 -2
- package/dist/resources/org/org.mjs +25 -2
- package/dist/resources/org/owner/owner.d.mts +2 -2
- package/dist/resources/org/owner/owner.mjs +7 -2
- package/dist/resources/org/owner/project.d.mts +2 -2
- package/dist/resources/org/owner/project.mjs +37 -2
- package/dist/resources/org/owner.d.mts +2 -2
- package/dist/resources/org/owner.mjs +1 -5
- package/dist/resources/org/project.d.mts +2 -2
- package/dist/resources/org/project.mjs +13 -2
- package/dist/resources/org/usage.d.mts +2 -2
- package/dist/resources/org/usage.mjs +22 -2
- package/dist/resources/org.d.mts +2 -2
- package/dist/resources/org.mjs +1 -9
- package/dist/resources/project/project.d.mts +2 -2
- package/dist/resources/project/project.mjs +7 -2
- package/dist/resources/project/usage.d.mts +2 -2
- package/dist/resources/project/usage.mjs +22 -2
- package/dist/resources/project.d.mts +2 -3
- package/dist/resources/project.mjs +1 -5
- package/dist/resources/session-configs.d.mts +2 -0
- package/dist/resources/session-configs.mjs +20 -0
- package/dist/resources/tool-router/session/files.d.mts +2 -2
- package/dist/resources/tool-router/session/files.mjs +40 -2
- package/dist/resources/tool-router/session/session.d.mts +2 -2
- package/dist/resources/tool-router/session/session.mjs +95 -2
- package/dist/resources/tool-router/session.d.mts +2 -2
- package/dist/resources/tool-router/session.mjs +1 -5
- package/dist/resources/tool-router/tool-router.d.mts +2 -2
- package/dist/resources/tool-router/tool-router.mjs +7 -2
- package/dist/resources/tool-router.d.mts +2 -2
- package/dist/resources/tool-router.mjs +1 -5
- package/dist/resources/toolkits.d.mts +2 -2
- package/dist/resources/toolkits.mjs +51 -2
- package/dist/resources/tools.d.mts +2 -2
- package/dist/resources/tools.mjs +56 -2
- package/dist/resources/trigger-instances/manage.d.mts +2 -2
- package/dist/resources/trigger-instances/manage.mjs +19 -2
- package/dist/resources/trigger-instances/trigger-instances.d.mts +2 -2
- package/dist/resources/trigger-instances/trigger-instances.mjs +24 -2
- package/dist/resources/trigger-instances.d.mts +2 -2
- package/dist/resources/trigger-instances.mjs +1 -5
- package/dist/resources/triggers-types.d.mts +2 -2
- package/dist/resources/triggers-types.mjs +26 -2
- package/dist/resources/webhook-endpoints.d.mts +2 -2
- package/dist/resources/webhook-endpoints.mjs +40 -2
- package/dist/resources/webhook-subscriptions.d.mts +2 -2
- package/dist/resources/webhook-subscriptions.mjs +45 -2
- package/package.json +35 -27
- package/dist/api-key-revocation-BqiqlJh6.mjs +0 -24
- package/dist/auth-ClFXmN5T.mjs +0 -17
- package/dist/auth-configs-COkEdwlP.mjs +0 -48
- package/dist/clanker-1ptspWLR.mjs +0 -23
- package/dist/cli-BWTXVRT4.mjs +0 -42
- package/dist/config-BLBbhLe1.mjs +0 -10
- package/dist/config-DnyMhILW.d.mts +0 -9
- package/dist/connected-accounts-DK24qYIM.mjs +0 -67
- package/dist/consumer-Do3lg_vI.mjs +0 -33
- package/dist/custom-CH7n4Dyd.mjs +0 -22
- package/dist/files-DoNtYu2Q.mjs +0 -29
- package/dist/files-lfGzAnJ_.mjs +0 -45
- package/dist/generate-B7ClqhN0.mjs +0 -22
- package/dist/link-NsFv9L3R.mjs +0 -22
- package/dist/logs-BhCTVSZE.mjs +0 -36
- package/dist/manage-7vQYn-gu.mjs +0 -26
- package/dist/mcp-r-SWyCDh.mjs +0 -73
- package/dist/migration-CBhnoN-Y.mjs +0 -10
- package/dist/migration-CKGKuRO3.d.mts +0 -9
- package/dist/org-C12wx9QM.mjs +0 -44
- package/dist/owner-D4ghEkrK.mjs +0 -17
- package/dist/project-By-OBe-4.mjs +0 -28
- package/dist/project-Cnr9eceg.mjs +0 -24
- package/dist/project-DgdqyoZJ.mjs +0 -22
- package/dist/project-DzrdSIis.mjs +0 -42
- package/dist/realtime-DHJnO2Ye.mjs +0 -26
- package/dist/resources/auth/index.d.mts +0 -2
- package/dist/resources/auth/index.mjs +0 -4
- package/dist/resources/cli/index.d.mts +0 -2
- package/dist/resources/cli/index.mjs +0 -4
- package/dist/resources/index.d.mts +0 -3
- package/dist/resources/index.mjs +0 -16
- package/dist/resources/logs/index.d.mts +0 -2
- package/dist/resources/logs/index.mjs +0 -5
- package/dist/resources/mcp/index.d.mts +0 -2
- package/dist/resources/mcp/index.mjs +0 -5
- package/dist/resources/migration.d.mts +0 -2
- package/dist/resources/migration.mjs +0 -3
- package/dist/resources/org/consumer/index.d.mts +0 -2
- package/dist/resources/org/consumer/index.mjs +0 -4
- package/dist/resources/org/index.d.mts +0 -2
- package/dist/resources/org/index.mjs +0 -8
- package/dist/resources/org/owner/index.d.mts +0 -2
- package/dist/resources/org/owner/index.mjs +0 -4
- package/dist/resources/project/config.d.mts +0 -2
- package/dist/resources/project/config.mjs +0 -3
- package/dist/resources/project/index.d.mts +0 -3
- package/dist/resources/project/index.mjs +0 -4
- package/dist/resources/tool-router/index.d.mts +0 -2
- package/dist/resources/tool-router/index.mjs +0 -4
- package/dist/resources/tool-router/session/index.d.mts +0 -2
- package/dist/resources/tool-router/session/index.mjs +0 -4
- package/dist/resources/trigger-instances/index.d.mts +0 -2
- package/dist/resources/trigger-instances/index.mjs +0 -4
- package/dist/session-Ci0MoTTn.mjs +0 -21
- package/dist/session-CmqSfXtq.mjs +0 -97
- package/dist/tool-router-DbmIxiU5.mjs +0 -14
- package/dist/toolkits-BUWB3p_C.mjs +0 -43
- package/dist/tools-B4kHPHbe.mjs +0 -30
- package/dist/tools-BO1wTIiE.mjs +0 -60
- package/dist/trigger-instances-CoEohjcv.mjs +0 -33
- package/dist/triggers-BwsETpsM.mjs +0 -26
- package/dist/triggers-types-DmOurxxx.mjs +0 -31
- package/dist/usage-BJsJ4nsd.mjs +0 -29
- package/dist/usage-D6ahTV_Y.mjs +0 -29
- package/dist/webhook-endpoints-CyWYVPMe.mjs +0 -46
- package/dist/webhook-subscriptions-BgnCTUGn.mjs +0 -48
package/README.md
CHANGED
|
@@ -2,40 +2,656 @@
|
|
|
2
2
|
|
|
3
3
|
Composio API client for TypeScript, generated from the [v3.1 OpenAPI spec](https://staging-backend.composio.dev/api/v3.1/openapi.json) with [hey-api](https://heyapi.dev).
|
|
4
4
|
|
|
5
|
-
This repo is the successor to the Stainless-generated [`@composio/client`](https://www.npmjs.com/package/@composio/client) (Stainless is sunsetting). Current scope: the full `/api/v3.1` surface — all
|
|
5
|
+
This repo is the successor to the Stainless-generated [`@composio/client`](https://www.npmjs.com/package/@composio/client) (Stainless is sunsetting). Current scope: the full `/api/v3.1` surface — all 113 released operations — in **both** languages: TypeScript at the package root, and Python in [`python/`](./python/README.md) (PyPI takeover pending).
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
|
-
The package root is the
|
|
9
|
+
The package root is the Promise client: `new Composio({ auth })`, the params and response type names, and throwing `APIPromise` semantics (shipped via UXE-163/UXE-164).
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
|
-
import Composio from '@composio/client'
|
|
12
|
+
import Composio, { Auth } from '@composio/client'
|
|
13
13
|
|
|
14
|
-
const composio = new Composio({
|
|
14
|
+
const composio = new Composio({ auth: Auth.project(process.env.COMPOSIO_API_KEY!) })
|
|
15
15
|
|
|
16
16
|
const session = await composio.toolRouter.session.create({ user_id: 'user_123' })
|
|
17
17
|
console.log(session.session_id, session.mcp.url)
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
### Authentication and scope
|
|
21
|
+
|
|
22
|
+
`auth` is required and says how every request authenticates. A request carries at most one Composio
|
|
23
|
+
credential.
|
|
24
|
+
|
|
25
|
+
| `auth` | Sends |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `Auth.project(key)` | `x-api-key` on every request to the API origin |
|
|
28
|
+
| `Auth.user(key)` | `x-user-api-key` on every request to the API origin |
|
|
29
|
+
| `Auth.organization(key)` | `x-org-api-key` on every request to the API origin |
|
|
30
|
+
| `Auth.auto({ project, user, organization })` | one of the keys given, chosen per operation: the project key wherever the operation accepts it, otherwise the first scheme it declares that a key is given for. This is how releases before rc.18 chose |
|
|
31
|
+
| `Auth.none()` | no credential. The credential header names are then ordinary headers, for a client used as a transport for schemes it does not model |
|
|
32
|
+
|
|
33
|
+
A fixed mode never consults the operation table. A key may be a function that returns one (or a
|
|
34
|
+
promise of one): it is called once per call, after the call starts, and its key is reused across
|
|
35
|
+
retries and same-origin redirects. It is not called for a call that starts off the API origin.
|
|
36
|
+
`client.authMode` reads the mode back; the client never returns a credential it was given as a
|
|
37
|
+
function.
|
|
38
|
+
|
|
39
|
+
`scope` names the organization and project the client addresses, sent as `x-org-id` and
|
|
40
|
+
`x-project-id` on requests to the API origin: `{ organizationId }`, `{ projectId }`, or both.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
const composio = new Composio({
|
|
44
|
+
auth: Auth.user(() => vault.read('composio-user-key')),
|
|
45
|
+
scope: { organizationId: 'org_123', projectId: 'pr_456' },
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
A header name is reserved while something is configured to write it: the three credential names
|
|
50
|
+
while `auth` is not `none`, `x-org-id` and `x-project-id` while `scope` is set, and the identity
|
|
51
|
+
names as [below](#identify-the-calling-product). `defaultHeaders` and `COMPOSIO_CUSTOM_HEADERS` that
|
|
52
|
+
name a reserved header fail construction, and a call's `headers` that name one fail the call before
|
|
53
|
+
anything is sent. A client that needs another credential or scope derives one:
|
|
54
|
+
`composio.withOptions({ auth: Auth.project(key) })`. `withOptions` re-runs every construction check.
|
|
55
|
+
|
|
56
|
+
Three operations declare a credential or scope id as a header parameter
|
|
57
|
+
(`org.consumer.project.resolve`, `org.consumer.listConnectedToolkits`, `cli.createCodactFailure`).
|
|
58
|
+
Their signatures are unchanged: the value replaces the configured credential for that call, and an
|
|
59
|
+
`x-org-id` that disagrees with the configured `scope` fails the call.
|
|
60
|
+
|
|
61
|
+
### Pagination
|
|
62
|
+
|
|
63
|
+
Use the `@composio/client/pagination` subpath to traverse list operations that return the standard
|
|
64
|
+
`items` and `next_cursor` fields:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { paginate } from '@composio/client/pagination'
|
|
68
|
+
|
|
69
|
+
const toolkits = paginate(({ cursor }) =>
|
|
70
|
+
composio.toolkits.list({ cursor, limit: 100 }),
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
for await (const toolkit of toolkits) {
|
|
74
|
+
console.log(toolkit.slug)
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Item iteration is lazy. Each traversal starts from the first page, and breaking early stops fetching
|
|
79
|
+
more pages. Use `iterPages()` when page metadata matters, or `toArray()` to collect every item; avoid
|
|
80
|
+
`toArray()` when the full result may not fit comfortably in memory.
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
for await (const page of toolkits.iterPages()) {
|
|
84
|
+
console.log(page.items.length)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const allToolkits = await toolkits.toArray()
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
For another response shape, provide an adapter. Custom cursors must be strings or numbers so repeated
|
|
91
|
+
values can be detected reliably across independently decoded pages:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
const results = paginate(
|
|
95
|
+
({ cursor }) => loadPage(cursor),
|
|
96
|
+
{
|
|
97
|
+
items: page => page.data,
|
|
98
|
+
nextCursor: page => page.nextCursor,
|
|
99
|
+
},
|
|
100
|
+
)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
A repeated cursor cycle throws `ComposioError` instead of requesting pages indefinitely. An empty
|
|
104
|
+
cursor ends traversal. When a response omits `next_cursor` but numeric `current_page` and
|
|
105
|
+
`total_pages` metadata shows that more pages exist, the default adapter fails instead of silently
|
|
106
|
+
returning partial results; provide a custom adapter for that response shape. Requests are sequential
|
|
107
|
+
and inherit the normal client retry/backoff path, but this is not proactive/shared rate-limit pacing.
|
|
108
|
+
|
|
109
|
+
The constructor reads nothing from the process. `Composio.fromEnv` is the one reader of the
|
|
110
|
+
environment, and it reads the mapping it is handed:
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
const composio = Composio.fromEnv(process.env, { baseURL: 'https://staging-backend.composio.dev' })
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`fromEnv` reads `COMPOSIO_API_KEY`, `COMPOSIO_USER_API_KEY` and `COMPOSIO_ORG_API_KEY` into `auth`
|
|
117
|
+
(one set: that fixed mode; several: `Auth.auto`; none: `Auth.none()`), and `COMPOSIO_BASE_URL`,
|
|
118
|
+
`COMPOSIO_ALLOW_INSECURE_HTTP=1`, `COMPOSIO_CUSTOM_HEADERS` (as `defaultHeaders`) and
|
|
119
|
+
`COMPOSIO_LOG_LEVEL`. It does not read `COMPOSIO_ORG_ID` or `COMPOSIO_PROJECT_ID`: `scope` is always
|
|
120
|
+
an argument. An override replaces the whole field it names, so `{ auth: Auth.none() }` means none
|
|
121
|
+
whatever the mapping holds. Derived clients created with `withOptions()` keep using the resolved
|
|
122
|
+
snapshot.
|
|
123
|
+
|
|
124
|
+
Inject a `Transport` when an application or test needs to own HTTP dispatch. The transport receives
|
|
125
|
+
a complete `Request`; retries, credential-safe redirects, timeouts, and response parsing stay in the
|
|
126
|
+
client:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import Composio, { Auth, createFetchTransport } from '@composio/client'
|
|
130
|
+
|
|
131
|
+
const transport = createFetchTransport({ fetch: instrumentedFetch })
|
|
132
|
+
const composio = new Composio({ auth: Auth.project(apiKey), transport })
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Without a `transport`, the client resolves `globalThis.fetch` when a request is sent, so late
|
|
136
|
+
polyfills and test interceptors keep working. A custom `fetch` or extra `RequestInit` defaults go
|
|
137
|
+
through `createFetchTransport({ fetch, defaults })`; the former `fetch`, `fetchOptions` and
|
|
138
|
+
`defaultQuery` constructor options are gone (see the upgrade section).
|
|
139
|
+
|
|
140
|
+
## Effect
|
|
141
|
+
|
|
142
|
+
`@composio/client/effect` is the same API surface for applications written with
|
|
143
|
+
[Effect](https://effect.website). Every operation returns an `Effect` whose failures are tagged
|
|
144
|
+
errors, the transport is the `HttpClient` in context, and interrupting a call aborts its request.
|
|
145
|
+
|
|
146
|
+
Use it when the calling code is already Effect code and would otherwise wrap each call in
|
|
147
|
+
`Effect.tryPromise` and inspect what was thrown. Otherwise use the package root: it needs no peer
|
|
148
|
+
dependency, loads faster and spends less time per request (see [Performance](#performance)).
|
|
149
|
+
|
|
150
|
+
The accessor chains, method names, argument order and request and response types are the root
|
|
151
|
+
client's, and a call sends the same method, URL, body and headers as the root client does for the same
|
|
152
|
+
input. All 113 operations of the spec are there.
|
|
153
|
+
|
|
154
|
+
### Install
|
|
155
|
+
|
|
156
|
+
```sh
|
|
157
|
+
pnpm add @composio/client effect
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
`effect` is an optional peer dependency. The root entry and the `./pagination` and `./resources/*`
|
|
161
|
+
subpaths never import it and load without it.
|
|
162
|
+
|
|
163
|
+
- **Supported range: `effect >=4.0.3 <4.1.0`.** The manifest declares the peer as `*`, because a
|
|
164
|
+
bounded optional peer makes npm refuse the whole install for a project that lists some other
|
|
165
|
+
`effect` and never imports this subpath. The cost is that a package manager does not warn about an
|
|
166
|
+
unsupported version. The range above is the one the subpath is tested against.
|
|
167
|
+
- **Install exactly one copy of `effect`.** With two copies, even one patch apart, the project does
|
|
168
|
+
not type-check: the client's `Effect`, `Layer` and `HttpClient` are not assignable to the
|
|
169
|
+
application's. At run time `Redacted` values do not cross between copies and `instanceof` is false,
|
|
170
|
+
and nothing warns about it.
|
|
171
|
+
- **The supported range bounds your Effect upgrades.** The client runs on the application's `effect`,
|
|
172
|
+
so moving to a new Effect minor waits for a client release whose supported range includes it.
|
|
173
|
+
|
|
174
|
+
### Construct a client
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
import { Effect, Layer } from 'effect'
|
|
178
|
+
import * as FetchHttpClient from 'effect/http/FetchHttpClient'
|
|
179
|
+
import { Auth, ComposioClient, layer, layerConfig } from '@composio/client/effect'
|
|
180
|
+
|
|
181
|
+
// Explicit options, over the `HttpClient` the application provides; here a fetch-backed one.
|
|
182
|
+
const live = layer({ auth: Auth.project('your-api-key') }).pipe(Layer.provide(FetchHttpClient.layer))
|
|
183
|
+
|
|
184
|
+
// Options read from the `COMPOSIO_*` settings.
|
|
185
|
+
const fromConfig = layerConfig().pipe(Layer.provide(FetchHttpClient.layer))
|
|
186
|
+
|
|
187
|
+
const program = Effect.gen(function* () {
|
|
188
|
+
const composio = yield* ComposioClient
|
|
189
|
+
const toolkit = yield* composio.toolkits.retrieve('github')
|
|
190
|
+
return toolkit.slug
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
const slug: Promise<string> = Effect.runPromise(program.pipe(Effect.provide(live)))
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
`make(options, httpClient)` builds the same client synchronously from an `HttpClient` you already
|
|
197
|
+
hold, and throws where the layers fail.
|
|
198
|
+
|
|
199
|
+
`auth` and `scope` mean what they mean on the root client (see
|
|
200
|
+
[Authentication and scope](#authentication-and-scope)), and `Auth` is exported from
|
|
201
|
+
`@composio/client/effect` too. A key may also be a `Redacted<string>`, or a function returning a
|
|
202
|
+
string or a `Redacted<string>`. There is no `withOptions`: a client is a value, and a caller that
|
|
203
|
+
needs another credential calls `make` again with the same `HttpClient`.
|
|
204
|
+
|
|
205
|
+
Only `layerConfig` reads the environment. It reads `COMPOSIO_API_KEY`, `COMPOSIO_USER_API_KEY` and
|
|
206
|
+
`COMPOSIO_ORG_API_KEY` into `auth` by the rule `Composio.fromEnv` applies, each key `Redacted`
|
|
207
|
+
throughout, and `COMPOSIO_BASE_URL` and `COMPOSIO_ALLOW_INSECURE_HTTP=1`, through Effect's `Config`,
|
|
208
|
+
so the `ConfigProvider` in context decides where they come from; by default that is the process
|
|
209
|
+
environment. An option passed to `layerConfig` replaces the setting it names, so
|
|
210
|
+
`layerConfig({ auth: Auth.none() })` means none whatever is configured. `make` and `layer` read
|
|
211
|
+
nothing.
|
|
212
|
+
|
|
213
|
+
Construction fails with a `ConfigurationError` when a credentialed origin is not HTTPS (loopback and
|
|
214
|
+
`allowInsecureHTTP` excepted, as on the root client), when a key or a header option is refused, or
|
|
215
|
+
when `decode: true` is given without `schemas`. A credential provider that fails, or returns
|
|
216
|
+
something a header cannot carry, fails the call with a `ConfigurationError` before anything is sent.
|
|
217
|
+
|
|
218
|
+
The resources are plain objects of functions, not classes, so a method can be passed around without
|
|
219
|
+
binding. The root client's resources are the same since rc.20.
|
|
220
|
+
|
|
221
|
+
### Errors
|
|
222
|
+
|
|
223
|
+
Every call fails with a `ComposioError`, a union of tagged errors. The tags are namespaced:
|
|
224
|
+
|
|
225
|
+
| Tag | When |
|
|
226
|
+
| --- | --- |
|
|
227
|
+
| `@composio/client/BadRequestError` | 400 |
|
|
228
|
+
| `@composio/client/AuthenticationError` | 401 |
|
|
229
|
+
| `@composio/client/PermissionDeniedError` | 403 |
|
|
230
|
+
| `@composio/client/NotFoundError` | 404 |
|
|
231
|
+
| `@composio/client/ConflictError` | 409 |
|
|
232
|
+
| `@composio/client/UnprocessableEntityError` | 422 |
|
|
233
|
+
| `@composio/client/RateLimitError` | 429 |
|
|
234
|
+
| `@composio/client/InternalServerError` | 500 and above |
|
|
235
|
+
| `@composio/client/APIError` | any other non-success status |
|
|
236
|
+
| `@composio/client/APIConnectionError` | the transport failed before a response |
|
|
237
|
+
| `@composio/client/APIConnectionTimeoutError` | an attempt outlived its time budget |
|
|
238
|
+
| `@composio/client/DecodeError` | a success body failed validation (only with `decode: true`) |
|
|
239
|
+
| `@composio/client/ConfigurationError` | no request can be made from this client or call |
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
import { Effect } from 'effect'
|
|
243
|
+
import { isAPIError, type ComposioClientShape } from '@composio/client/effect'
|
|
244
|
+
|
|
245
|
+
const slugOrNull = (composio: ComposioClientShape, slug: string) =>
|
|
246
|
+
composio.toolkits.retrieve(slug).pipe(
|
|
247
|
+
Effect.map((toolkit) => toolkit.slug),
|
|
248
|
+
Effect.catchTag('@composio/client/NotFoundError', () => Effect.succeed(null)),
|
|
249
|
+
Effect.tapError((error) =>
|
|
250
|
+
isAPIError(error) ? Effect.logWarning(`${error.status} ${error.requestId}`) : Effect.void,
|
|
251
|
+
),
|
|
252
|
+
)
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
A status error carries `status`, `requestId`, `details` (the Composio error envelope, when the body
|
|
256
|
+
is one), `body`, `message`, `method` and `url`. `isAPIError` matches any status error and
|
|
257
|
+
`isComposioError` any error of the union; both test the tag, not the class. There is no access to the
|
|
258
|
+
raw response of a successful call.
|
|
259
|
+
|
|
260
|
+
Timeouts follow the root client's policy: one minute per attempt by default. Retries do not. A
|
|
261
|
+
call whose method is idempotent (`GET`, `HEAD`, `OPTIONS`, `PUT`, `DELETE`) is retried up to 2 times
|
|
262
|
+
on a connection failure, a timeout, or a 408, 409, 429 or 5xx response, as the root client retries
|
|
263
|
+
every call. Any other call, `POST` and `PATCH` included, is sent once, because a write that failed in
|
|
264
|
+
flight may already have acted. A call that is safe to repeat opts back in with its own `maxRetries`:
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
composio.toolRouter.session.search(sessionId, { queries }, { maxRetries: 2 })
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Streams
|
|
271
|
+
|
|
272
|
+
Fourteen cursor-paginated operations have a `<method>Stream` beside them that yields items across
|
|
273
|
+
pages:
|
|
274
|
+
|
|
275
|
+
- `authConfigs.listStream`, `connectedAccounts.listStream`, `files.listStream`,
|
|
276
|
+
`sessionConfigs.listStream`, `toolkits.listStream`, `toolkits.retrieveMultiStream`,
|
|
277
|
+
`tools.listStream`, `triggerInstances.listActiveStream`, `triggersTypes.listStream`,
|
|
278
|
+
`webhookSubscriptions.listStream`
|
|
279
|
+
- `toolRouter.session.configHistoryStream`, `toolRouter.session.toolkitsStream`,
|
|
280
|
+
`toolRouter.session.toolsStream`, `toolRouter.session.files.listStream`
|
|
281
|
+
|
|
282
|
+
```ts
|
|
283
|
+
import { Stream } from 'effect'
|
|
284
|
+
import type { ComposioClientShape } from '@composio/client/effect'
|
|
285
|
+
|
|
286
|
+
const firstSlugs = (composio: ComposioClientShape) =>
|
|
287
|
+
composio.toolkits.listStream({ limit: 100 }).pipe(
|
|
288
|
+
Stream.map((toolkit) => toolkit.slug),
|
|
289
|
+
Stream.take(250),
|
|
290
|
+
Stream.runCollect,
|
|
291
|
+
)
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
A page is requested only when the stream is pulled that far, so `Stream.take` above stops after the
|
|
295
|
+
third page. The cursor rules are those of `@composio/client/pagination`, and a traversal that cannot
|
|
296
|
+
continue — a cursor the server repeats, a page with no `items` array — fails with a
|
|
297
|
+
`ConfigurationError`.
|
|
298
|
+
|
|
299
|
+
No other operation has a stream. That includes the list operations whose page is not the standard
|
|
300
|
+
`items` and `next_cursor` shape: `org.list` (`organizations`), `org.project.list` and
|
|
301
|
+
`org.owner.project.list` (`data`), and `logs.createToolExecution` (`logs`). Page those by passing
|
|
302
|
+
`next_cursor` back yourself.
|
|
303
|
+
|
|
304
|
+
### Per-call options
|
|
305
|
+
|
|
306
|
+
The last argument of every operation and raw method:
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
import type { ComposioClientShape } from '@composio/client/effect'
|
|
310
|
+
|
|
311
|
+
const once = (composio: ComposioClientShape) =>
|
|
312
|
+
composio.toolkits.retrieve(
|
|
313
|
+
'github',
|
|
314
|
+
{},
|
|
315
|
+
{
|
|
316
|
+
headers: { 'x-trace-id': 'abc', 'x-team': null }, // `null` removes a default header
|
|
317
|
+
maxRetries: 0,
|
|
318
|
+
timeout: 10_000, // milliseconds, per attempt
|
|
319
|
+
},
|
|
320
|
+
)
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Per-call headers win over the client's `defaultHeaders`. `decode` is the fourth option, described
|
|
324
|
+
next.
|
|
325
|
+
|
|
326
|
+
### Decoding
|
|
327
|
+
|
|
328
|
+
By default a response body is returned as parsed and nothing checks it. Decoding is opt-in, per call
|
|
329
|
+
or as a client default, and needs the response schemas, which are a separate entry:
|
|
330
|
+
|
|
331
|
+
```ts
|
|
332
|
+
import * as HttpClient from 'effect/http/HttpClient'
|
|
333
|
+
import { Effect } from 'effect'
|
|
334
|
+
import { make } from '@composio/client/effect'
|
|
335
|
+
import { schemaLoaders } from '@composio/client/effect/schemas'
|
|
336
|
+
|
|
337
|
+
const checkedCategories = (httpClient: HttpClient.HttpClient) => {
|
|
338
|
+
const composio = make({ auth: Auth.project('your-api-key'), schemas: schemaLoaders }, httpClient)
|
|
339
|
+
return composio.toolkits.retrieveCategories({ decode: true }).pipe(
|
|
340
|
+
Effect.catchTag('@composio/client/DecodeError', (error) =>
|
|
341
|
+
Effect.logError(`${error.operation}: ${JSON.stringify(error.issues)}`).pipe(Effect.as(null)),
|
|
342
|
+
),
|
|
343
|
+
)
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
- **It validates and changes nothing.** A call that passes returns the body exactly as it was parsed;
|
|
348
|
+
a field the API returns ahead of the spec is not stripped. The response type is the same either way.
|
|
349
|
+
- **`DecodeError`** carries `operation` (`toolkits.retrieveCategories`), `status`, `requestId`,
|
|
350
|
+
`method`, `url` and `issues`, each a `path` and a `kind` such as `MissingKey` or `InvalidType`. It
|
|
351
|
+
never carries the body or the value found: a success body is where this API returns secrets.
|
|
352
|
+
- **`decode: true` needs `schemas`.** As a client option without `schemas` it is a compile error, and a
|
|
353
|
+
`ConfigurationError` at construction for a caller the types did not reach. A per-call
|
|
354
|
+
`decode: true` on a client built without `schemas` fails with a `ConfigurationError` before
|
|
355
|
+
anything is sent.
|
|
356
|
+
- **Schemas load lazily.** `schemaLoaders` is a table of `import()` calls, one per operation. A schema
|
|
357
|
+
module is loaded by the first call that decodes its operation. A single schema can also be imported
|
|
358
|
+
directly, for example
|
|
359
|
+
`import { ToolkitRetrieveCategoriesResponse } from '@composio/client/effect/schemas/toolkits/retrieve-categories'`.
|
|
360
|
+
A decoding call also checks that the table contains its operation before sending the request. The
|
|
361
|
+
loader itself runs only after a non-204 success; a failed dynamic import can therefore fail a call
|
|
362
|
+
after the server has already processed it.
|
|
363
|
+
- **An application that never imports `@composio/client/effect/schemas` ships no schema.** The
|
|
364
|
+
`./effect` entry does not reach the table, so a bundler has no path to it.
|
|
365
|
+
- A 204 has no body to validate. A raw call is validated when its path is a declared operation's.
|
|
366
|
+
|
|
367
|
+
A schema is generated from the spec snapshot this version was built from, so decoding holds a
|
|
368
|
+
response to that snapshot. A response from before a required field existed fails: replaying stored
|
|
369
|
+
production responses through the schemas, the four `toolRouter.session` operations `create`,
|
|
370
|
+
`retrieve`, `attach` and `patch` failed on a missing `config.instant` for every capture through
|
|
371
|
+
2026-09-11, taken before the spec declared that field, and passed for the 2026-10-08 capture, taken
|
|
372
|
+
after. The record is in [`docs/upstream-asks.md`](./docs/upstream-asks.md).
|
|
373
|
+
|
|
374
|
+
### Tracing
|
|
375
|
+
|
|
376
|
+
One option, `tracing`, says what the client's own requests add to a trace:
|
|
377
|
+
|
|
378
|
+
| Value | Effect |
|
|
379
|
+
| --- | --- |
|
|
380
|
+
| `'off'` (default) | No span is opened for a request and no trace header is sent, so the request carries exactly the headers the root client sends. |
|
|
381
|
+
| `'span'` | Effect's `HttpClient` opens its client span around each request, a child of the span the call runs in. Nothing about it goes on the wire. |
|
|
382
|
+
| `'propagate'` | The span, also sent to the API as `b3` and `traceparent` headers. |
|
|
383
|
+
|
|
384
|
+
The option only ever reduces tracing, and only for this client's requests. A span asked for here is
|
|
385
|
+
still subject to the application's own `HttpClient.TracerDisabledWhen` and
|
|
386
|
+
`HttpClient.TracerPropagationEnabled`.
|
|
387
|
+
|
|
388
|
+
With a span on, the span ends on the client's own error, not on Effect's `HttpClientError`. That
|
|
389
|
+
error holds the request and its credential headers, and a tracer keeps what a span ended on. To do
|
|
390
|
+
this the client reassigns `end` on the span object the tracer returns, so a tracer that returns
|
|
391
|
+
frozen spans throws when a request starts. The replacement costs about a microsecond per request on
|
|
392
|
+
top of the span itself.
|
|
393
|
+
|
|
394
|
+
### Credentials and redaction
|
|
395
|
+
|
|
396
|
+
A request carries at most one credential header, chosen by `auth` as on the root client:
|
|
397
|
+
`x-api-key`, `x-user-api-key` or `x-org-api-key`. The client holds every key as a `Redacted` value
|
|
398
|
+
and adds all three header names to Effect's redaction list for its requests, so spans and renderings
|
|
399
|
+
of a request show `<redacted>`; Effect's own list knows only `x-api-key`.
|
|
400
|
+
|
|
401
|
+
No error the client produces holds the request, the transport's error or a credential value. One
|
|
402
|
+
caveat: `APIConnectionError.description` is the transport's own message text, copied. A transport
|
|
403
|
+
that writes a header value into its error messages would put it there.
|
|
404
|
+
|
|
405
|
+
The credential is applied before the request reaches the `HttpClient`, so a transform the application
|
|
406
|
+
puts on its `HttpClient` sees it.
|
|
407
|
+
|
|
408
|
+
### Redirects
|
|
409
|
+
|
|
410
|
+
The client follows redirects itself and withdraws credentials once a chain changes origin. It does so
|
|
411
|
+
by dispatching with `redirect: 'manual'`, which a fetch-backed `HttpClient` honors. The guarantee
|
|
412
|
+
holds only when nothing between the client and the wire follows redirects. An `HttpClient` wrapped in
|
|
413
|
+
`HttpClient.followRedirects`, or a transport that follows redirects on its own, forwards the
|
|
414
|
+
credential headers across origins and is unsupported for a credentialed client. Headers an
|
|
415
|
+
application places in `FetchHttpClient.RequestInit` are outside the client's credential handling:
|
|
416
|
+
the credential check does not see them, and they are not withdrawn on a cross-origin redirect.
|
|
417
|
+
|
|
418
|
+
### Deprecation notices
|
|
419
|
+
|
|
420
|
+
A deprecated input, or a response carrying `Deprecation`, `Sunset` and `Link` headers, is reported
|
|
421
|
+
through `Effect.logWarning`, once per operation and notice for each client. The application's
|
|
422
|
+
`Logger` and `References.MinimumLogLevel` decide what becomes of it; there is no client option.
|
|
423
|
+
`isDeprecationNotice` recognises a notice, so a logger can drop or route the notices alone:
|
|
424
|
+
|
|
425
|
+
```ts
|
|
426
|
+
import { isDeprecationNotice } from '@composio/client/effect'
|
|
427
|
+
|
|
428
|
+
const quiet = Logger.make((options) => (isDeprecationNotice(options) ? undefined : base.log(options)))
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### Raw methods
|
|
432
|
+
|
|
433
|
+
`get`, `post`, `put`, `patch` and `delete` reach any path through the same kernel: credentials,
|
|
434
|
+
retries, timeouts, redirects and errors behave as for a generated method.
|
|
435
|
+
|
|
436
|
+
```ts
|
|
437
|
+
import type { ComposioClientShape } from '@composio/client/effect'
|
|
438
|
+
|
|
439
|
+
const raw = (composio: ComposioClientShape) =>
|
|
440
|
+
composio.post<{ id: string }>('/api/v3.1/some/path', {
|
|
441
|
+
query: { dry_run: true },
|
|
442
|
+
body: { name: 'example' },
|
|
443
|
+
maxRetries: 0,
|
|
444
|
+
})
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
The type argument is an assertion, not a check.
|
|
448
|
+
|
|
449
|
+
### Performance
|
|
450
|
+
|
|
451
|
+
Measured against a mocked transport, so these are client overhead and say nothing about network
|
|
452
|
+
latency. The full tables and method are in
|
|
453
|
+
[`docs/benchmarks/client-overhead.md`](./docs/benchmarks/client-overhead.md); the figures below are
|
|
454
|
+
its 2026-10-13 runs on Node 24.17.0 and Bun 1.4.0, `effect` 4.0.3, one Apple M1 Pro.
|
|
455
|
+
|
|
456
|
+
**The Effect surface is slower per request than the root client.** Typed geometric mean over two
|
|
457
|
+
runs: 154.1% and 153.2% of the root client by default, 173.8% and 171.1% with `tracing: 'span'`. In
|
|
458
|
+
absolute terms that is 10 to 14 microseconds more per request, and 3 to 5 more with the span on. It
|
|
459
|
+
is a measurement, not a win; what it buys is the typed failure channel, interruption and a transport
|
|
460
|
+
taken from context.
|
|
461
|
+
|
|
462
|
+
**Decoding costs more than the request.** Validating a twenty-item `toolkits.list` page took a call
|
|
463
|
+
from 77.7 / 78.9 µs to 187.3 / 192.4 µs, about 110 µs or 5.5 µs per item.
|
|
464
|
+
|
|
465
|
+
**Import time**, over what Effect's own HTTP modules already cost, minimum / median of thirty in
|
|
466
|
+
milliseconds:
|
|
467
|
+
|
|
468
|
+
| | Node, modules | Node, bundle | Bun, modules | Bun, bundle |
|
|
469
|
+
| --- | ---: | ---: | ---: | ---: |
|
|
470
|
+
| `./effect`, never decodes | 4.2 / 4.5 | 4.7 / 4.8 | 3.6 / 2.8 | 11.2 / 11.7 |
|
|
471
|
+
| plus importing `schemaLoaders` | 2.4 / 0.2 | 5.3 / 5.2 | 0.2 / −0.7 | 3.6 / 3.8 |
|
|
472
|
+
|
|
473
|
+
The published-module lanes are noisy, which is how a difference comes out negative. Effect itself
|
|
474
|
+
is the larger part: 122.2 / 128.3 ms as modules on Node and 22.0 / 23.8 ms bundled, against 9.6 /
|
|
475
|
+
10.5 ms and 4.0 / 4.4 ms for the root client.
|
|
476
|
+
|
|
477
|
+
**Bundle size** of a single-file consumer: Effect's HTTP modules alone, then with a client that never
|
|
478
|
+
decodes, then with the loader table and every schema it reaches.
|
|
479
|
+
|
|
480
|
+
| Bundler | Effect alone | never decodes | decodes |
|
|
481
|
+
| --- | ---: | ---: | ---: |
|
|
482
|
+
| rolldown | 498 kB | 732 kB | 893 kB |
|
|
483
|
+
| `bun build` | 266 kB | 705 kB | 1088 kB |
|
|
484
|
+
|
|
485
|
+
**Package weight.** The schema modules make the package larger on disk: 3.4 MB unpacked in 509 files,
|
|
486
|
+
of which 2.1 MB and 328 files are `dist/effect/schemas*`, against 1.1 MB in 176 files for
|
|
487
|
+
`2.0.0-rc.11` as published. None of it is on the root entry's import path.
|
|
488
|
+
|
|
489
|
+
### Identify the calling product
|
|
490
|
+
|
|
491
|
+
A product built on the client passes `identity` instead of setting headers by hand. The root client
|
|
492
|
+
and `./effect` take the same option:
|
|
493
|
+
|
|
494
|
+
```ts
|
|
495
|
+
const composio = new Composio({
|
|
496
|
+
auth: Auth.project(apiKey),
|
|
497
|
+
identity: { product: '@composio/core', version: '0.9.0', source: 'TYPESCRIPT_SDK', framework: 'openai' },
|
|
498
|
+
})
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
| Header | Sent from | Without `identity` |
|
|
502
|
+
| --- | --- | --- |
|
|
503
|
+
| `x-client-provenance`, `x-client-version` | `product`, `version` | the package name and version |
|
|
504
|
+
| `x-sdk-version` | `version` | not sent |
|
|
505
|
+
| `x-source`, `x-framework` | `source`, `framework` | not sent |
|
|
506
|
+
| `x-runtime` | `runtime`, else the detected runtime | the detected runtime |
|
|
507
|
+
| `x-client-runtime`, `x-runtime-version` | the detected runtime | the detected runtime |
|
|
508
|
+
| `x-client-library`, `x-client-library-version`, `x-client-language` | the package | the package |
|
|
509
|
+
|
|
510
|
+
The three library headers are the package's own: `defaultHeaders`, `COMPOSIO_CUSTOM_HEADERS` and a
|
|
511
|
+
call's `headers` cannot set or delete them. Once `identity` is set, the same holds for every header
|
|
512
|
+
in the table. A refused name fails construction (`ComposioError`, or `ConfigurationError` on
|
|
513
|
+
`./effect`), or the call before anything is sent. Identity values must be non-empty printable ASCII
|
|
514
|
+
with no surrounding whitespace, and are sent to the configured API origin only.
|
|
515
|
+
|
|
516
|
+
The detected runtime is one of `nodejs`, `bun`, `deno`, `cloudflare`, `vercel_edge`, `netlify`,
|
|
517
|
+
`fastly` or `unknown`, checked in [`std-env`](https://github.com/unjs/std-env)'s order; the
|
|
518
|
+
Python client always reports `python`.
|
|
519
|
+
|
|
520
|
+
## Upgrade from Stainless 0.1.x to 2.0
|
|
521
|
+
|
|
522
|
+
By default, the 2.0 client refuses to send credentials over plain HTTP unless the hostname is
|
|
523
|
+
loopback. For a trusted development backend such as Docker's host gateway, opt in to the exact
|
|
524
|
+
configured origin:
|
|
525
|
+
|
|
526
|
+
```ts
|
|
527
|
+
const composio = new Composio({
|
|
528
|
+
auth: Auth.project(apiKey),
|
|
529
|
+
baseURL: 'http://host.docker.internal:9900',
|
|
530
|
+
allowInsecureHTTP: true,
|
|
531
|
+
})
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
The equivalent environment configuration, for `Composio.fromEnv`, is:
|
|
535
|
+
|
|
536
|
+
```sh
|
|
537
|
+
COMPOSIO_BASE_URL=http://host.docker.internal:9900 \
|
|
538
|
+
COMPOSIO_ALLOW_INSECURE_HTTP=1
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
The opt-in records the resolved scheme, hostname, and port. Mutating `baseURL` cannot broaden it,
|
|
542
|
+
and `withOptions({ baseURL: ... })` requires `allowInsecureHTTP: true` again when the origin
|
|
543
|
+
changes. Redirects to another origin remain credential-free.
|
|
544
|
+
|
|
545
|
+
### Removed in 2.0.0-rc.21
|
|
546
|
+
|
|
547
|
+
The last members of the `Composio` class that existed only to look like the Stainless build. None is a
|
|
548
|
+
gate subject, so the ledger declares nothing; `pnpm test:pack` holds all three.
|
|
549
|
+
|
|
550
|
+
| Removed | Migration |
|
|
551
|
+
| --- | --- |
|
|
552
|
+
| `client.request({ method, path, ... })` | The raw verb for the method: `client.get(path, opts)`, `post`, `patch`, `put`, `delete`, which take the same `query`, `body` and request options |
|
|
553
|
+
| `Composio.Composio` | The class itself: `import { Composio } from '@composio/client'` or the default import |
|
|
554
|
+
| `Composio.DEFAULT_TIMEOUT` | None: the default is one minute, and `timeout` overrides it |
|
|
555
|
+
|
|
556
|
+
### Removed in 2.0.0-rc.20
|
|
557
|
+
|
|
558
|
+
The Stainless structure goes. The two removal classes are declared rule entries in
|
|
559
|
+
`packages/codegen/assignability-ledger.json`; the export spellings are held by `pnpm test:pack`.
|
|
560
|
+
|
|
561
|
+
| Removed | Migration |
|
|
562
|
+
| --- | --- |
|
|
563
|
+
| Resource classes (`ToolRouter`, `Tools`, `ConnectedAccounts`, ... as values) and `Composio.Tools`-style statics | A resource is a plain object typed by an interface of the same name. `import type { Tools } from '@composio/client/resources/tools'` still works as a type; `Composio['tools']` is the same type. `instanceof` a resource class has no replacement |
|
|
564
|
+
| Namespace-merged nested types (`SessionToolkitsResponse.Item`, `LinkCreateParams.Experimental`) | Indexed access: `SessionToolkitsResponse['items'][number]`, `NonNullable<LinkCreateParams['experimental']>` |
|
|
565
|
+
| The `Composio` namespace (`Composio.RequestOptions`, `Composio.ToolListResponse`, ...) | Import the type: `import type { RequestOptions } from '@composio/client'`, `import type { ToolListResponse } from '@composio/client/resources/tools'` |
|
|
566
|
+
| `@composio/client/resources`, `/resources.js`, `/resources.mjs`, `/resources/index` | The resource's own subpath: `@composio/client/resources/mcp` |
|
|
567
|
+
| `.js` and `.mjs` deep subpaths (`/resources/tool-router/session/session.mjs`), `/pagination.js`, `/pagination.mjs` | The extensionless spelling: `/resources/tool-router/session/session`, `/pagination` |
|
|
568
|
+
| `client.migration`, `client.project.config` | None: neither held an operation |
|
|
569
|
+
|
|
570
|
+
### Removed in 2.0.0-rc.19
|
|
571
|
+
|
|
572
|
+
The two option removals are declared entries in `packages/codegen/assignability-ledger.json`. The
|
|
573
|
+
other rows are class members the type check does not pin, listed so an upgrade can find them.
|
|
574
|
+
|
|
575
|
+
| Removed | Migration |
|
|
576
|
+
| --- | --- |
|
|
577
|
+
| `environment: 'production' \| 'staging' \| 'local'` (root `ClientOptions`) | `baseURL: ENVIRONMENTS.staging` or `ENVIRONMENTS.local` — the frozen origin table, exported since rc.20; omitting it means production |
|
|
578
|
+
| `Logger` (exported interface) | `logger` takes a `Console`-shaped object (`Pick<Console, 'debug' \| 'info' \| 'warn' \| 'error'>`) and defaults to `console`. An adapter that forwards to another logger is the same four methods |
|
|
579
|
+
| `client.apiKey`, `userApiKey`, `orgApiKey` (read-only since rc.18) | Keep your own copy of the key; `client.authMode` says which mode is configured |
|
|
580
|
+
| `client.logger` | None: the sink is the client's own. Pass a different one to `withOptions({ logger })` |
|
|
581
|
+
| Assigning `client.baseURL`, `maxRetries`, `timeout` or `logLevel` | `withOptions({ ... })`, which re-runs every validation. The four stay readable; `logLevel` reads the effective level (`'warn'` by default) |
|
|
582
|
+
| `deprecationNotices: 'warn' \| 'off'` (`./effect` `ComposioClientOptions`) | The application's `Logger` and `References.MinimumLogLevel`; a logger that drops records matching `isDeprecationNotice` is `'off'` |
|
|
583
|
+
| `layerFetch(options)` (`./effect`) | `layer(options).pipe(Layer.provide(FetchHttpClient.layer))` |
|
|
584
|
+
|
|
585
|
+
Python removes `default_query` and the `api_key`, `user_api_key` and `org_api_key` reads, and makes
|
|
586
|
+
`base_url`, `max_retries` and `timeout` read-only; `environment=` stays. See
|
|
587
|
+
[`python/README.md`](./python/README.md).
|
|
588
|
+
|
|
589
|
+
### Removed in 2.0.0-rc.18
|
|
590
|
+
|
|
591
|
+
Each removal is a declared entry in `packages/codegen/assignability-ledger.json`. The other rows are
|
|
592
|
+
behaviour the type check cannot see, listed so an upgrade can find them.
|
|
593
|
+
|
|
594
|
+
| Removed | Migration |
|
|
595
|
+
| --- | --- |
|
|
596
|
+
| `apiKey` (root `ClientOptions` and `./effect` `ComposioClientOptions`) | `auth: Auth.project(key)` |
|
|
597
|
+
| `userApiKey` | `auth: Auth.user(key)`, which sends the user key on every request. The old per-operation selection is `Auth.auto({ project, user, organization })` |
|
|
598
|
+
| `orgApiKey` | `auth: Auth.organization(key)`, or `Auth.auto({ ... })` |
|
|
599
|
+
| `apiKey: null` plus a credential in `defaultHeaders` | the `auth` that credential is. While `auth` is not `none`, `defaultHeaders`, `COMPOSIO_CUSTOM_HEADERS` and a call's `headers` cannot name `x-api-key`, `x-user-api-key` or `x-org-api-key` |
|
|
600
|
+
| `x-api-key` overriding the credential for one call | a second client: `withOptions({ auth: Auth.project(key) })` on the root, `make({ ...options, auth: Auth.project(key) }, httpClient)` on `./effect` |
|
|
601
|
+
| `x-org-id`, `x-project-id` in `defaultHeaders` | `scope: { organizationId, projectId }`, which reserves both names. Without `scope` they are still ordinary headers |
|
|
602
|
+
| the constructor reading `COMPOSIO_*` from the process | `Composio.fromEnv(process.env, overrides)`; nothing else reads the environment. `new Composio()` with no options is gone with it |
|
|
603
|
+
| `layerConfig({ apiKey: null })` | `layerConfig({ auth: Auth.none() })`; an override replaces the whole `auth` |
|
|
604
|
+
| `layer()`, `layerFetch()` with no options | pass the options, `auth` included |
|
|
605
|
+
| assigning `client.apiKey`, `userApiKey` or `orgApiKey` | `withOptions({ auth })`. The three fields stayed readable until rc.19; keep your own copy of a key you need |
|
|
606
|
+
| `Credential` on `./effect` accepting `null` | `Auth.none()`. It now also accepts a function that returns a key |
|
|
607
|
+
|
|
608
|
+
Python makes the same change: `auth=ProjectAuth(key)` (and `UserAuth`, `OrganizationAuth`,
|
|
609
|
+
`AutoAuth`, `NoAuth`) and `scope=Scope(...)`, see [`python/README.md`](./python/README.md).
|
|
610
|
+
|
|
611
|
+
### Changed in 2.0.0-rc.17
|
|
612
|
+
|
|
613
|
+
`defaultHeaders`, `COMPOSIO_CUSTOM_HEADERS` and per-call `headers` refuse the library headers
|
|
614
|
+
(`x-client-library`, `x-client-library-version`, `x-client-language`), and refuse every identity
|
|
615
|
+
header once `identity` is set. A wrapper that set its product headers through `defaultHeaders`
|
|
616
|
+
moves them into `identity` (see [Identify the calling product](#identify-the-calling-product)).
|
|
617
|
+
Python takes `identity=ClientIdentity(...)` under the same rule. The type surface is unchanged
|
|
618
|
+
apart from the added option, so the release declares no ledger entry.
|
|
619
|
+
|
|
620
|
+
### Removed in 2.0.0-rc.16
|
|
621
|
+
|
|
622
|
+
Each row is a declared entry in `packages/codegen/assignability-ledger.json`, the list of what a
|
|
623
|
+
release changes against the previous published version.
|
|
624
|
+
|
|
625
|
+
| Removed | Migration |
|
|
626
|
+
| --- | --- |
|
|
627
|
+
| `fetch: f` (constructor) | `transport: createFetchTransport({ fetch: f })` |
|
|
628
|
+
| `fetchOptions: { cache: 'no-store' }` (constructor) | `transport: createFetchTransport({ defaults: { cache: 'no-store' } })`. The defaults cannot set `method`, `headers`, `body`, `signal` or `redirect`, which the client owns |
|
|
629
|
+
| `fetchOptions` (per call, in `RequestOptions`) | None: `headers`, `timeout`, `signal` and `idempotencyKey` stay, and transport-level defaults go through `createFetchTransport({ defaults })` |
|
|
630
|
+
| `defaultQuery` (root `ClientOptions` and `./effect` `ComposioClientOptions`) | None: generated methods own their query, and the raw methods (`get`, `post`, ...) take an explicit `query` |
|
|
631
|
+
| `custom.deleteToolkit(slug, options)` | `custom.deleteToolkit(slug, query, options)` — pass request options third, as on every other `(id, params?, options?)` method. The runtime guard that recognized an options bag in the params position is gone with the overload |
|
|
632
|
+
|
|
20
633
|
## Development
|
|
21
634
|
|
|
22
635
|
Toolchain is pinned via [mise](https://mise.jdx.dev) (`mise install`): Node 24, pnpm 11, Python 3.13, uv. ESM-only, TypeScript 7 (native compiler for typechecking, `typescript@6` retained for tooling until 7.1 restores the compiler API).
|
|
23
636
|
|
|
24
637
|
```sh
|
|
25
638
|
pnpm install
|
|
26
|
-
pnpm generate # hey-api + compat codegen: spec/openapi.json → src/generated
|
|
27
|
-
pnpm lint # eslint over src, test,
|
|
28
|
-
pnpm typecheck # tsgo (TS native)
|
|
639
|
+
pnpm generate # hey-api + compat and Effect codegen: spec/openapi.json → src/generated, src/compat/resources, src/effect/generated (do not edit)
|
|
640
|
+
pnpm lint # eslint over src, test, codegen, parity, and demo
|
|
641
|
+
pnpm typecheck # tsgo (TS native), including type tests and demo
|
|
29
642
|
pnpm typecheck:tsc # same programs under tsc — both compilers must pass
|
|
30
|
-
pnpm codegen:check # verify committed
|
|
643
|
+
pnpm codegen:check # verify every committed generated tree matches the generator
|
|
31
644
|
pnpm test # unit tests (MSW mocks) + codegen tests
|
|
32
645
|
pnpm build # tsdown → dist/ (runs publint + arethetypeswrong)
|
|
33
646
|
pnpm test:pack # pack the real tarball, typecheck + import every drop-in subpath
|
|
647
|
+
pnpm benchmark:baseline # capture the dist/ a benchmark run compares against
|
|
648
|
+
pnpm benchmark # score SDK overhead against that baseline
|
|
649
|
+
pnpm benchmark:import # time what importing each entry costs, on Node and Bun
|
|
34
650
|
pnpm test:contract # live API tests; requires COMPOSIO_API_KEY (copy .env.example to .env)
|
|
35
651
|
pnpm refresh-spec # re-fetch spec/openapi.json from the live backend
|
|
36
652
|
```
|
|
37
653
|
|
|
38
|
-
`src/generated/` and `src/
|
|
654
|
+
`src/generated/`, `src/compat/resources/` and `src/effect/generated/` are regenerated output — never edit them by hand; CI fails if they drift from `spec/openapi.json`.
|
|
39
655
|
|
|
40
656
|
### Python lane
|
|
41
657
|
|
|
@@ -49,3 +665,7 @@ uv run ruff check
|
|
|
49
665
|
uv run mypy src scripts
|
|
50
666
|
uv run pytest
|
|
51
667
|
```
|
|
668
|
+
|
|
669
|
+
Client-overhead measurements use a deterministic in-memory transport and are documented in
|
|
670
|
+
[`docs/benchmarks/client-overhead.md`](./docs/benchmarks/client-overhead.md). They do not measure API
|
|
671
|
+
latency.
|