├── python ├── docs │ ├── .gitkeep │ └── release.md ├── composio │ ├── py.typed │ ├── core │ │ ├── __init__.py │ │ ├── provider │ │ │ └── __init__.py │ │ ├── models │ │ │ └── __init__.py │ │ └── types.py │ ├── __version__.py │ ├── integration_test │ │ ├── __init__.py │ │ ├── pytest.ini │ │ └── README.md │ ├── utils │ │ └── uuid.py │ └── __init__.py ├── .python-version ├── tests │ ├── __init__.py │ └── conftest.py ├── providers │ ├── crewai │ │ ├── README.md │ │ ├── composio_crewai │ │ │ ├── py.typed │ │ │ └── __init__.py │ │ └── pyproject.toml │ ├── gemini │ │ ├── composio_gemini │ │ │ ├── py.typed │ │ │ └── __init__.py │ │ ├── pyproject.toml │ │ └── gemini_demo.py │ ├── google │ │ ├── composio_google │ │ │ ├── py.typed │ │ │ └── __init__.py │ │ └── pyproject.toml │ ├── openai │ │ ├── composio_openai │ │ │ ├── py.typed │ │ │ ├── __init__.py │ │ │ └── provider.py │ │ └── pyproject.toml │ ├── autogen │ │ ├── composio_autogen │ │ │ ├── py.typed │ │ │ └── __init__.py │ │ ├── README.md │ │ └── pyproject.toml │ ├── anthropic │ │ ├── composio_anthropic │ │ │ ├── py.typed │ │ │ └── __init__.py │ │ └── pyproject.toml │ ├── google_adk │ │ ├── composio_google_adk │ │ │ ├── py.typed │ │ │ └── __init__.py │ │ ├── README.md │ │ └── pyproject.toml │ ├── langchain │ │ ├── composio_langchain │ │ │ ├── py.typed │ │ │ └── __init__.py │ │ ├── README.md │ │ └── pyproject.toml │ ├── langgraph │ │ ├── composio_langgraph │ │ │ ├── py.typed │ │ │ └── __init__.py │ │ └── pyproject.toml │ ├── llamaindex │ │ ├── composio_llamaindex │ │ │ ├── py.typed │ │ │ └── __init__.py │ │ ├── README.md │ │ └── pyproject.toml │ └── openai_agents │ │ ├── composio_openai_agents │ │ ├── py.typed │ │ └── __init__.py │ │ └── pyproject.toml ├── .gitmodules ├── config │ ├── ruff.toml │ ├── codecov.yml │ ├── pytest.ini │ └── mypy.ini ├── pytest.ini └── examples │ ├── toolkits.py │ ├── tool_router │ └── claude_agent.py │ └── fastapi_app.py ├── fern ├── .python-version ├── llms-txt-worker │ ├── public │ │ └── .keepFolder │ ├── tsconfig.json │ ├── wrangler.jsonc │ ├── package.json │ ├── tsconfig.options.json │ └── turbo.json ├── generators │ ├── python_sdk │ │ ├── templates │ │ │ └── index.mdx │ │ ├── autodoc_core │ │ │ └── __init__.py │ │ └── __init__.py │ └── tool_doc_generator │ │ ├── __init__.py │ │ └── base_docs.py ├── fern.config.json ├── assets │ ├── favicon.png │ ├── Inter-Medium.woff2 │ ├── images │ │ ├── triggers.png │ │ ├── index-docs.png │ │ ├── after-execute.png │ │ ├── setup-webhook.png │ │ ├── ask-index-docs.png │ │ ├── before-execute.png │ │ ├── cursor-settings.png │ │ ├── custom-auth-app.png │ │ ├── executingtools.png │ │ ├── github-callback.png │ │ ├── google-callback.png │ │ ├── oauth-branding.png │ │ ├── schema-modifier.png │ │ ├── trigger-config.png │ │ ├── composio-auth-app.png │ │ ├── examples │ │ │ ├── toolkits.png │ │ │ ├── auth-configs.png │ │ │ ├── trigger-config.png │ │ │ ├── webhook-secret.png │ │ │ ├── ai-email-labels.png │ │ │ ├── connection-status.png │ │ │ ├── create-connection.png │ │ │ ├── gmail-agent-trace.png │ │ │ └── custom-tool-component.png │ │ ├── auth-config-creation.png │ │ ├── auth-screen-example.png │ │ ├── custom-auth-hubspot.png │ │ ├── custom-auth-posthog.png │ │ ├── custom-redirect-uri.png │ │ ├── github-oauth-config.png │ │ ├── google-oauth-config.png │ │ ├── integration-step-3-0.png │ │ ├── oauth-composio-branding.png │ │ ├── trigger-enable-disable.png │ │ ├── debugging-info │ │ │ ├── debugging-info.png │ │ │ └── project-settings.jpeg │ │ ├── tool-router │ │ │ └── auth-config-custom-redirect.png │ │ ├── vercel-logo.svg │ │ └── anthropic-logo.svg │ ├── IBMPlexMono-Light.ttf │ └── videos │ │ └── enabling-triggers.mp4 ├── apis │ └── v3 │ │ └── generators.yml ├── snippets │ ├── tool-calling │ │ ├── python │ │ │ ├── raw_tools.py │ │ │ ├── versioning-sdk-init.py │ │ │ ├── versioning-manage.py │ │ │ ├── file-download.py │ │ │ ├── file-upload.py │ │ │ ├── versioning-per-execution.py │ │ │ ├── direct-tool-call.py │ │ │ ├── proxy-tool.py │ │ │ └── checking-connection-status.py │ │ └── typescript │ │ │ ├── raw_tools.ts │ │ │ ├── versioning-sdk-init.ts │ │ │ ├── file-download.ts │ │ │ ├── versioning-per-execution.ts │ │ │ ├── file-upload.ts │ │ │ ├── versioning-manage.ts │ │ │ ├── proxy-tool.ts │ │ │ ├── direct-tool-call.ts │ │ │ └── checking-connection-status.ts │ ├── migration │ │ ├── pyproject.toml │ │ ├── old_tools.ts │ │ ├── providers.py │ │ ├── old_auth_config.py │ │ ├── providers.ts │ │ ├── new_connected_acc.py │ │ ├── new_auth_config.ts │ │ ├── new_execute_tools.py │ │ ├── new_tools.py │ │ ├── old_auth_config.ts │ │ ├── new_auth_config.py │ │ ├── old_tools.py │ │ ├── new_tools.ts │ │ ├── new_connected_acc.ts │ │ ├── old_custom_tools.py │ │ └── old_tool_modifiers.py │ ├── authentication │ │ ├── typescript │ │ │ ├── auth-config.ts │ │ │ └── define-scopes.ts │ │ └── python │ │ │ ├── auth-config.py │ │ │ └── define-scopes.py │ ├── triggers │ │ ├── python │ │ │ ├── trigger-subscription.py │ │ │ └── triggers.py │ │ └── typescript │ │ │ ├── trigger-subscription.ts │ │ │ └── triggers.ts │ └── providers │ │ └── python │ │ └── google.py ├── tsconfig.json ├── tailwind.config.js ├── components │ ├── cards-container.tsx │ ├── authors-container.tsx │ └── secondary-title-container.tsx ├── pages │ └── src │ │ └── providers │ │ └── google-adk.mdx ├── tsconfig.typedoc.json └── packages │ └── snippet-tester │ ├── tsconfig.json │ └── package.json ├── ts ├── examples │ ├── toolkits │ │ ├── src │ │ │ ├── example.json │ │ │ ├── toolkits.ts │ │ │ └── index.ts │ │ ├── .env.example │ │ ├── tsconfig.json │ │ └── package.json │ ├── openai │ │ ├── .env.example │ │ └── tsconfig.json │ ├── vercel │ │ ├── .env.example │ │ ├── src │ │ │ └── types.ts │ │ └── tsconfig.json │ ├── langchain │ │ ├── .env.example │ │ ├── tsconfig.json │ │ └── src │ │ │ └── openai.ts │ ├── modifiers │ │ ├── .env.example │ │ ├── tsconfig.json │ │ └── package.json │ ├── anthropic │ │ ├── .env.example │ │ └── tsconfig.json │ ├── connected-accounts │ │ ├── .env.example │ │ ├── src │ │ │ ├── scopes.ts │ │ │ ├── multiple-connected-accounts.ts │ │ │ └── api-key.ts │ │ ├── tsconfig.json │ │ └── package.json │ ├── tools │ │ ├── src │ │ │ ├── image.png │ │ │ └── tool-conversion.ts │ │ ├── .env.example │ │ ├── tsconfig.json │ │ └── package.json │ ├── cloudflare-wrangler │ │ ├── test │ │ │ ├── env.d.ts │ │ │ └── tsconfig.json │ │ ├── .prettierrc │ │ ├── .editorconfig │ │ ├── vitest.config.mts │ │ └── package.json │ ├── file-handling │ │ ├── pepe-silvia.png │ │ ├── .env.example │ │ ├── tsconfig.json │ │ └── package.json │ ├── google │ │ ├── .env.example │ │ └── tsconfig.json │ ├── mcp │ │ ├── .env.example │ │ └── tsconfig.json │ ├── llamaindex │ │ ├── .env.example │ │ └── tsconfig.json │ ├── mastra │ │ ├── .env.example │ │ └── tsconfig.json │ ├── triggers │ │ ├── .env.example │ │ ├── tsconfig.json │ │ ├── src │ │ │ ├── trigger-types.ts │ │ │ └── create.ts │ │ └── package.json │ ├── custom-tools │ │ ├── .env.example │ │ ├── tsconfig.json │ │ └── package.json │ ├── tool-router │ │ ├── .env.example │ │ ├── src │ │ │ ├── toolkits.ts │ │ │ ├── authorize.ts │ │ │ ├── logger.ts │ │ │ └── index.ts │ │ └── tsconfig.json │ ├── json-schema-to-zod │ │ ├── .env.example │ │ └── tsconfig.json │ ├── session-management │ │ ├── .env.example │ │ ├── tsconfig.json │ │ └── package.json │ ├── versioning │ │ ├── .env.example │ │ ├── tsconfig.json │ │ └── package.json │ ├── error-handling-demo │ │ ├── tsconfig.json │ │ └── package.json │ └── cjs │ │ ├── tsconfig.json │ │ ├── package.json │ │ └── README.md └── packages │ ├── core │ ├── .gitignore │ ├── src │ │ ├── types │ │ │ ├── org.types.ts │ │ │ ├── composio.types.ts │ │ │ ├── files.types.ts │ │ │ ├── connectionRequest.types.ts │ │ │ └── pusher.types.ts │ │ ├── utils │ │ │ ├── uuid.ts │ │ │ └── constants.ts │ │ ├── services │ │ │ └── internal │ │ │ │ └── InternalService.types.ts │ │ └── errors │ │ │ ├── FileModifierErrors.ts │ │ │ └── AuthConfigErrors.ts │ ├── .env.example │ ├── eslint.config.mjs │ ├── tsconfig.build.json │ ├── tsconfig.type-tests.json │ ├── tsdown.config.ts │ ├── test │ │ └── utils │ │ │ └── mocks │ │ │ ├── provider.mock.ts │ │ │ └── client.mock.ts │ └── tsconfig.json │ ├── cli │ ├── test │ │ ├── __fixtures__ │ │ │ ├── python-project │ │ │ │ ├── setup.py │ │ │ │ └── requirements.txt │ │ │ ├── python-project-with-composio-core │ │ │ │ ├── .python-version │ │ │ │ ├── requirements.txt │ │ │ │ ├── main.py │ │ │ │ ├── uv.lock │ │ │ │ ├── pyproject.toml │ │ │ │ └── setup.sh │ │ │ ├── user-config-example │ │ │ │ └── .composio │ │ │ │ │ └── user_data.json │ │ │ ├── typescript-project │ │ │ │ ├── package.json │ │ │ │ └── tsconfig.json │ │ │ └── typescript-project-with-composio-core │ │ │ │ ├── src │ │ │ │ └── index.js │ │ │ │ ├── package.json │ │ │ │ ├── tsconfig.json │ │ │ │ ├── bun.lock │ │ │ │ └── pnpm-lock.yaml │ │ ├── __mocks__ │ │ │ ├── tools-github.ts │ │ │ ├── tools-gmail.ts │ │ │ ├── tools-googledrive.ts │ │ │ ├── trigger-types-gmail.ts │ │ │ ├── trigger-types-github.ts │ │ │ ├── trigger-types-googledrive.ts │ │ │ ├── tools-types-github.ts │ │ │ ├── tools-types-gmail.ts │ │ │ └── tools-types-googledrive.ts │ │ └── __utils__ │ │ │ ├── index.ts │ │ │ ├── sanitize.ts │ │ │ └── cli.ts │ ├── .gitignore │ ├── src │ │ ├── effect-errors │ │ │ ├── logic │ │ │ │ ├── path │ │ │ │ │ ├── index.ts │ │ │ │ │ └── strip-cwd-path.ts │ │ │ │ ├── stack │ │ │ │ │ ├── index.ts │ │ │ │ │ └── stack-regex.ts │ │ │ │ ├── errors │ │ │ │ │ ├── index.ts │ │ │ │ │ └── capture-errors-from-cause.ts │ │ │ │ └── spans │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── maybe-add-error-to-spans-stack.ts │ │ │ │ │ └── split-spans-attributes-by-type.ts │ │ │ ├── dependencies │ │ │ │ └── fs │ │ │ │ │ ├── index.ts │ │ │ │ │ └── read-json │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── json-parsing.error.ts │ │ │ │ │ ├── parse-json.ts │ │ │ │ │ └── read-json.ts │ │ │ ├── pretty-print │ │ │ │ ├── common │ │ │ │ │ ├── constants │ │ │ │ │ │ ├── interrupted-message.ts │ │ │ │ │ │ └── missing-spans-warning.ts │ │ │ │ │ ├── spans-stack-trailing-char.ts │ │ │ │ │ ├── format-span-duration.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── format-title.ts │ │ │ │ │ ├── maybe-warn-about-plain-strings.ts │ │ │ │ │ ├── format-spans-attribute.ts │ │ │ │ │ └── format-error-title.ts │ │ │ │ ├── index.ts │ │ │ │ └── captured-errors │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── maybe-advice-spans-usage.ts │ │ │ │ │ └── maybe-advise-spans-usage.ts │ │ │ ├── types │ │ │ │ ├── index.ts │ │ │ │ ├── error-span.type.ts │ │ │ │ ├── pretty-print-options.type.ts │ │ │ │ └── pretty-error.type.ts │ │ │ ├── sourcemaps │ │ │ │ ├── index.ts │ │ │ │ └── get-error-location-from-file-path.ts │ │ │ ├── index.ts │ │ │ └── README.md │ │ ├── generation │ │ │ ├── types.ts │ │ │ ├── constants.ts │ │ │ └── python │ │ │ │ └── generate.ts │ │ ├── type-utils.ts │ │ ├── cli-config.ts │ │ ├── ui │ │ │ └── colors.ts │ │ ├── effects │ │ │ ├── version.ts │ │ │ ├── force-config.ts │ │ │ ├── json.ts │ │ │ └── with-log-level.ts │ │ ├── services │ │ │ ├── node-process.ts │ │ │ └── node-os.ts │ │ ├── commands │ │ │ ├── py │ │ │ │ └── py.cmd.ts │ │ │ ├── ts │ │ │ │ └── ts.cmd.ts │ │ │ ├── upgrade.cmd.ts │ │ │ ├── version.cmd.ts │ │ │ └── logout.cmd.ts │ │ └── models │ │ │ └── utils │ │ │ ├── extract-actual.ts │ │ │ └── json-transform-schema.ts │ ├── eslint.config.mjs │ ├── turbo.json │ ├── tsup.config.ts │ ├── tsconfig.json │ ├── tsconfig.src.json │ ├── tsconfig.test.json │ └── tsconfig.options.json │ ├── json-schema-to-zod │ ├── test │ │ └── e2e │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── zod-v4 │ │ │ └── package.json │ │ │ └── zod-v3 │ │ │ └── package.json │ ├── src │ │ ├── index.ts │ │ ├── utils │ │ │ ├── half.ts │ │ │ ├── omit.ts │ │ │ └── extend-schema.ts │ │ ├── parsers │ │ │ ├── parse-default.ts │ │ │ ├── parse-null.ts │ │ │ ├── parse-boolean.ts │ │ │ ├── parse-const.ts │ │ │ ├── parse-multiple-type.ts │ │ │ ├── parse-not.ts │ │ │ ├── parse-any-of.ts │ │ │ └── parse-enum.ts │ │ └── json-schema-to-zod.ts │ ├── eslint.config.mjs │ ├── tsconfig.json │ ├── tsup.config.ts │ ├── tsconfig.src.json │ ├── tsconfig.test.json │ └── tsconfig.options.json │ ├── ts-builders │ ├── src │ │ ├── BasicBuilder.ts │ │ ├── isValidJsIdentifier.ts │ │ ├── helpers.ts │ │ ├── ArrayValue.ts │ │ ├── NamedValue.ts │ │ ├── AnyDeclarationBuilder.ts │ │ ├── WellKnownSymbol.ts │ │ ├── DocSectionComment.ts │ │ ├── ArraySpread.ts │ │ ├── KeyofType.ts │ │ ├── ArrayType.ts │ │ ├── TypeOf.ts │ │ ├── ConstDeclaration.test.ts │ │ ├── NamedType.test.ts │ │ └── FunctionCall.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ ├── tsconfig.test.json │ ├── tsconfig.src.json │ ├── README.md │ └── tsconfig.options.json │ └── providers │ ├── google │ ├── tsup.config.ts │ └── tsconfig.json │ ├── mastra │ ├── tsup.config.ts │ └── tsconfig.json │ ├── openai │ ├── tsup.config.ts │ ├── tsconfig.json │ └── src │ │ └── index.ts │ ├── vercel │ ├── tsup.config.ts │ └── tsconfig.json │ ├── anthropic │ ├── tsup.config.ts │ └── tsconfig.json │ ├── cloudflare │ ├── tsup.config.ts │ └── tsconfig.json │ ├── langchain │ ├── tsup.config.ts │ └── tsconfig.json │ ├── llamaindex │ ├── tsup.config.ts │ └── tsconfig.json │ └── openai-agents │ ├── tsup.config.ts │ └── tsconfig.json ├── public ├── cover.png └── logo.png ├── .github ├── CODEOWNERS ├── dependabot.yml ├── SUPPORT.md └── workflows │ ├── ts.typecheck.yml │ └── ts.build.yml ├── .prettierrc ├── .husky └── pre-commit ├── .changeset ├── config.json └── README.md ├── .dockerignore ├── tsconfig.base.json ├── turbo.json ├── context7.json └── .pnpmfile.cjs /python/docs/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/composio/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fern/.python-version: -------------------------------------------------------------------------------- 1 | 3.12 2 | -------------------------------------------------------------------------------- /python/.python-version: -------------------------------------------------------------------------------- 1 | 3.11 2 | -------------------------------------------------------------------------------- /python/composio/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ts/examples/toolkits/src/example.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fern/llms-txt-worker/public/.keepFolder: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/tests/__init__.py: -------------------------------------------------------------------------------- 1 | """Tests""" 2 | -------------------------------------------------------------------------------- /ts/packages/core/.gitignore: -------------------------------------------------------------------------------- 1 | generated/ 2 | -------------------------------------------------------------------------------- /ts/packages/core/src/types/org.types.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fern/generators/python_sdk/templates/index.mdx: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/providers/crewai/README.md: -------------------------------------------------------------------------------- 1 | # CrewAI plugin -------------------------------------------------------------------------------- /python/providers/crewai/composio_crewai/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/providers/gemini/composio_gemini/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/providers/google/composio_google/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/providers/openai/composio_openai/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/providers/autogen/composio_autogen/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/providers/anthropic/composio_anthropic/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/providers/google_adk/composio_google_adk/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/providers/langchain/composio_langchain/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/providers/langgraph/composio_langgraph/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/providers/llamaindex/composio_llamaindex/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/python-project/setup.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/composio/__version__.py: -------------------------------------------------------------------------------- 1 | __version__ = "1.0.0-rc2" 2 | -------------------------------------------------------------------------------- /python/providers/openai_agents/composio_openai_agents/py.typed: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/tests/conftest.py: -------------------------------------------------------------------------------- 1 | """pytest configuration module""" 2 | -------------------------------------------------------------------------------- /ts/examples/openai/.env.example: -------------------------------------------------------------------------------- 1 | COMPOSIO_API_KEY= 2 | OPENAI_API_KEY= -------------------------------------------------------------------------------- /ts/examples/vercel/.env.example: -------------------------------------------------------------------------------- 1 | COMPOSIO_API_KEY= 2 | OPENAI_API_KEY= -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/test/e2e/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /python/providers/langchain/README.md: -------------------------------------------------------------------------------- 1 | # Langchain provider for composio SDK -------------------------------------------------------------------------------- /ts/examples/langchain/.env.example: -------------------------------------------------------------------------------- 1 | COMPOSIO_API_KEY= 2 | OPENAI_API_KEY= -------------------------------------------------------------------------------- /ts/examples/modifiers/.env.example: -------------------------------------------------------------------------------- 1 | COMPOSIO_API_KEY= 2 | OPENAI_API_KEY= -------------------------------------------------------------------------------- /ts/examples/toolkits/.env.example: -------------------------------------------------------------------------------- 1 | COMPOSIO_API_KEY= 2 | OPENAI_API_KEY= -------------------------------------------------------------------------------- /ts/examples/anthropic/.env.example: -------------------------------------------------------------------------------- 1 | COMPOSIO_API_KEY= 2 | ANTHROPIC_API_KEY= -------------------------------------------------------------------------------- /python/providers/google_adk/README.md: -------------------------------------------------------------------------------- 1 | # Composio Provider For Google ADK 2 | 3 | -------------------------------------------------------------------------------- /ts/examples/connected-accounts/.env.example: -------------------------------------------------------------------------------- 1 | COMPOSIO_API_KEY= 2 | OPENAI_API_KEY= -------------------------------------------------------------------------------- /ts/packages/cli/.gitignore: -------------------------------------------------------------------------------- 1 | .generated/ 2 | composio 3 | .envrc 4 | sandbox/ 5 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/python-project/requirements.txt: -------------------------------------------------------------------------------- 1 | click=8.1.2 2 | -------------------------------------------------------------------------------- /public/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/public/cover.png -------------------------------------------------------------------------------- /public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/public/logo.png -------------------------------------------------------------------------------- /python/providers/autogen/README.md: -------------------------------------------------------------------------------- 1 | ## 🚀🔗 Integrating Composio with Autogen SDK 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | fern/ @haxzie @sushmithamallesh 2 | ts/ @haxzie 3 | python/ @haxzie 4 | -------------------------------------------------------------------------------- /fern/fern.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "organization": "composio", 3 | "version": "3.22.3" 4 | } 5 | -------------------------------------------------------------------------------- /fern/generators/python_sdk/autodoc_core/__init__.py: -------------------------------------------------------------------------------- 1 | # Empty init file to make this a package -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/logic/path/index.ts: -------------------------------------------------------------------------------- 1 | export * from './strip-cwd-path'; 2 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/python-project-with-composio-core/.python-version: -------------------------------------------------------------------------------- 1 | 3.12 2 | -------------------------------------------------------------------------------- /fern/generators/tool_doc_generator/__init__.py: -------------------------------------------------------------------------------- 1 | """Tool Documentation Generator for Composio.""" -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/dependencies/fs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './read-json/index'; 2 | -------------------------------------------------------------------------------- /ts/packages/core/.env.example: -------------------------------------------------------------------------------- 1 | COMPOSIO_LOG_LEVEL= 2 | COMPOSIO_API_KEY= 3 | COMPOSIO_API_BASE_URL= -------------------------------------------------------------------------------- /fern/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/favicon.png -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/python-project-with-composio-core/requirements.txt: -------------------------------------------------------------------------------- 1 | composio_core 2 | -------------------------------------------------------------------------------- /ts/packages/core/src/types/composio.types.ts: -------------------------------------------------------------------------------- 1 | export type ComposioRequestHeaders = Record; 2 | -------------------------------------------------------------------------------- /fern/assets/Inter-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/Inter-Medium.woff2 -------------------------------------------------------------------------------- /fern/assets/images/triggers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/triggers.png -------------------------------------------------------------------------------- /python/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "client"] 2 | path = client 3 | url = git@github.com:composiohq/composio-base-py 4 | -------------------------------------------------------------------------------- /ts/examples/tools/src/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/ts/examples/tools/src/image.png -------------------------------------------------------------------------------- /ts/packages/cli/src/generation/types.ts: -------------------------------------------------------------------------------- 1 | export type SourceFile = readonly [filename: string, content: string]; 2 | -------------------------------------------------------------------------------- /fern/assets/IBMPlexMono-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/IBMPlexMono-Light.ttf -------------------------------------------------------------------------------- /fern/assets/images/index-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/index-docs.png -------------------------------------------------------------------------------- /fern/assets/images/after-execute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/after-execute.png -------------------------------------------------------------------------------- /fern/assets/images/setup-webhook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/setup-webhook.png -------------------------------------------------------------------------------- /python/config/ruff.toml: -------------------------------------------------------------------------------- 1 | # Same as Black. 2 | line-length = 88 3 | indent-width = 4 4 | 5 | [lint] 6 | ignore = [ "E741" ] 7 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/logic/stack/index.ts: -------------------------------------------------------------------------------- 1 | export * from './filter-stack'; 2 | export * from './stack-regex'; 3 | -------------------------------------------------------------------------------- /ts/packages/cli/src/generation/constants.ts: -------------------------------------------------------------------------------- 1 | export const BANNER = 'Auto-generated by Composio CLI. Do not modify manually.'; 2 | -------------------------------------------------------------------------------- /fern/assets/images/ask-index-docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/ask-index-docs.png -------------------------------------------------------------------------------- /fern/assets/images/before-execute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/before-execute.png -------------------------------------------------------------------------------- /fern/assets/images/cursor-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/cursor-settings.png -------------------------------------------------------------------------------- /fern/assets/images/custom-auth-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/custom-auth-app.png -------------------------------------------------------------------------------- /fern/assets/images/executingtools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/executingtools.png -------------------------------------------------------------------------------- /fern/assets/images/github-callback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/github-callback.png -------------------------------------------------------------------------------- /fern/assets/images/google-callback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/google-callback.png -------------------------------------------------------------------------------- /fern/assets/images/oauth-branding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/oauth-branding.png -------------------------------------------------------------------------------- /fern/assets/images/schema-modifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/schema-modifier.png -------------------------------------------------------------------------------- /fern/assets/images/trigger-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/trigger-config.png -------------------------------------------------------------------------------- /python/providers/gemini/composio_gemini/__init__.py: -------------------------------------------------------------------------------- 1 | from .provider import GeminiProvider 2 | 3 | __all__ = ("GeminiProvider",) 4 | -------------------------------------------------------------------------------- /ts/examples/cloudflare-wrangler/test/env.d.ts: -------------------------------------------------------------------------------- 1 | declare module 'cloudflare:test' { 2 | interface ProvidedEnv extends Env {} 3 | } 4 | -------------------------------------------------------------------------------- /fern/assets/images/composio-auth-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/composio-auth-app.png -------------------------------------------------------------------------------- /fern/assets/images/examples/toolkits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/examples/toolkits.png -------------------------------------------------------------------------------- /fern/assets/videos/enabling-triggers.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/videos/enabling-triggers.mp4 -------------------------------------------------------------------------------- /python/providers/autogen/composio_autogen/__init__.py: -------------------------------------------------------------------------------- 1 | from .provider import AutogenProvider 2 | 3 | __all__ = ("AutogenProvider",) 4 | -------------------------------------------------------------------------------- /ts/examples/file-handling/pepe-silvia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/ts/examples/file-handling/pepe-silvia.png -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/user-config-example/.composio/user_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "api_key": "api_key_from_test_fixture" 3 | } 4 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/index.ts: -------------------------------------------------------------------------------- 1 | export type * from './types'; 2 | export { jsonSchemaToZod } from './json-schema-to-zod'; 3 | -------------------------------------------------------------------------------- /fern/assets/images/auth-config-creation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/auth-config-creation.png -------------------------------------------------------------------------------- /fern/assets/images/auth-screen-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/auth-screen-example.png -------------------------------------------------------------------------------- /fern/assets/images/custom-auth-hubspot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/custom-auth-hubspot.png -------------------------------------------------------------------------------- /fern/assets/images/custom-auth-posthog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/custom-auth-posthog.png -------------------------------------------------------------------------------- /fern/assets/images/custom-redirect-uri.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/custom-redirect-uri.png -------------------------------------------------------------------------------- /fern/assets/images/examples/auth-configs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/examples/auth-configs.png -------------------------------------------------------------------------------- /fern/assets/images/github-oauth-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/github-oauth-config.png -------------------------------------------------------------------------------- /fern/assets/images/google-oauth-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/google-oauth-config.png -------------------------------------------------------------------------------- /fern/assets/images/integration-step-3-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/integration-step-3-0.png -------------------------------------------------------------------------------- /python/providers/langgraph/composio_langgraph/__init__.py: -------------------------------------------------------------------------------- 1 | from .provider import LanggraphProvider 2 | 3 | __all__ = ("LanggraphProvider",) 4 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/dependencies/fs/read-json/index.ts: -------------------------------------------------------------------------------- 1 | export * from './json-parsing.error'; 2 | export * from './read-json'; 3 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/logic/errors/index.ts: -------------------------------------------------------------------------------- 1 | export * from './capture-errors-from-cause'; 2 | export * from './parse-error'; 3 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/typescript-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "typescript": "^5.9.2" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /fern/assets/images/examples/trigger-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/examples/trigger-config.png -------------------------------------------------------------------------------- /fern/assets/images/examples/webhook-secret.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/examples/webhook-secret.png -------------------------------------------------------------------------------- /fern/assets/images/oauth-composio-branding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/oauth-composio-branding.png -------------------------------------------------------------------------------- /fern/assets/images/trigger-enable-disable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/trigger-enable-disable.png -------------------------------------------------------------------------------- /python/providers/crewai/composio_crewai/__init__.py: -------------------------------------------------------------------------------- 1 | from composio_crewai.providers import CrewAIProvider 2 | 3 | __all__ = ("CrewAIProvider",) 4 | -------------------------------------------------------------------------------- /python/providers/google/composio_google/__init__.py: -------------------------------------------------------------------------------- 1 | from composio_google.provider import GoogleProvider 2 | 3 | __all__ = ("GoogleProvider",) 4 | -------------------------------------------------------------------------------- /python/providers/google_adk/composio_google_adk/__init__.py: -------------------------------------------------------------------------------- 1 | from .provider import GoogleAdkProvider 2 | 3 | __all__ = ("GoogleAdkProvider",) 4 | -------------------------------------------------------------------------------- /python/providers/llamaindex/composio_llamaindex/__init__.py: -------------------------------------------------------------------------------- 1 | from .provider import LlamaIndexProvider 2 | 3 | __all__ = ("LlamaIndexProvider",) 4 | -------------------------------------------------------------------------------- /ts/examples/cloudflare-wrangler/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 140, 3 | "singleQuote": true, 4 | "semi": true, 5 | "useTabs": true 6 | } 7 | -------------------------------------------------------------------------------- /fern/assets/images/examples/ai-email-labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/examples/ai-email-labels.png -------------------------------------------------------------------------------- /fern/assets/images/examples/connection-status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/examples/connection-status.png -------------------------------------------------------------------------------- /fern/assets/images/examples/create-connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/examples/create-connection.png -------------------------------------------------------------------------------- /fern/assets/images/examples/gmail-agent-trace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/examples/gmail-agent-trace.png -------------------------------------------------------------------------------- /fern/assets/images/debugging-info/debugging-info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/debugging-info/debugging-info.png -------------------------------------------------------------------------------- /fern/assets/images/examples/custom-tool-component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/examples/custom-tool-component.png -------------------------------------------------------------------------------- /python/providers/anthropic/composio_anthropic/__init__.py: -------------------------------------------------------------------------------- 1 | from composio_anthropic.provider import AnthropicProvider 2 | 3 | __all__ = ("AnthropicProvider",) 4 | -------------------------------------------------------------------------------- /python/providers/langchain/composio_langchain/__init__.py: -------------------------------------------------------------------------------- 1 | from composio_langchain.provider import LangchainProvider 2 | 3 | __all__ = ("LangchainProvider",) 4 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/logic/spans/index.ts: -------------------------------------------------------------------------------- 1 | export * from './maybe-add-error-to-spans-stack'; 2 | export * from './split-spans-attributes-by-type'; 3 | -------------------------------------------------------------------------------- /fern/assets/images/debugging-info/project-settings.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/debugging-info/project-settings.jpeg -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/common/constants/interrupted-message.ts: -------------------------------------------------------------------------------- 1 | export const interruptedMessage = '✅ All fibers interrupted without errors.'; 2 | -------------------------------------------------------------------------------- /ts/packages/cli/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | export default { 2 | extends: ['../../eslint.config.mjs'], 3 | rules: { 4 | '@effect/eslint-plugin': 'error', 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/types/index.ts: -------------------------------------------------------------------------------- 1 | export * from './error-span.type'; 2 | export * from './pretty-error.type'; 3 | export * from './pretty-print-options.type'; 4 | -------------------------------------------------------------------------------- /fern/assets/images/tool-router/auth-config-custom-redirect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ComposioHQ/composio/HEAD/fern/assets/images/tool-router/auth-config-custom-redirect.png -------------------------------------------------------------------------------- /python/providers/openai_agents/composio_openai_agents/__init__.py: -------------------------------------------------------------------------------- 1 | from composio_openai_agents.provider import OpenAIAgentsProvider 2 | 3 | __all__ = ("OpenAIAgentsProvider",) 4 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/utils/half.ts: -------------------------------------------------------------------------------- 1 | export const half = (arr: T[]): [T[], T[]] => { 2 | return [arr.slice(0, arr.length / 2), arr.slice(arr.length / 2)]; 3 | }; 4 | -------------------------------------------------------------------------------- /fern/apis/v3/generators.yml: -------------------------------------------------------------------------------- 1 | api: 2 | specs: 3 | - openapi: ../openapi.json 4 | overrides: ../openapi-overrides.yml 5 | settings: 6 | title-as-schema-name: false 7 | -------------------------------------------------------------------------------- /ts/packages/core/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['../../.eslintrc.cjs'], 3 | // parserOptions: { 4 | // project: ['./tsconfig.json'], 5 | // }, 6 | } 7 | -------------------------------------------------------------------------------- /python/providers/openai/composio_openai/__init__.py: -------------------------------------------------------------------------------- 1 | from composio_openai.provider import OpenAIProvider, OpenAIResponsesProvider 2 | 3 | __all__ = ("OpenAIProvider", "OpenAIResponsesProvider") 4 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/index.ts: -------------------------------------------------------------------------------- 1 | export * from './common/constants/interrupted-message'; 2 | export * from './common/format-title'; 3 | export * from './format-captured-error'; 4 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__mocks__/tools-github.ts: -------------------------------------------------------------------------------- 1 | import TOOLS from './tools-as-enums.json' with { type: 'json' }; 2 | 3 | export const TOOLS_GITHUB = TOOLS.filter(tool => tool.startsWith('GITHUB_')); 4 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__mocks__/tools-gmail.ts: -------------------------------------------------------------------------------- 1 | import TOOLS from './tools-as-enums.json' with { type: 'json' }; 2 | 3 | export const TOOLS_GMAIL = TOOLS.filter(tool => tool.startsWith('GMAIL_')); 4 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ['../../.eslintrc.cjs'], 3 | // parserOptions: { 4 | // project: ['./tsconfig.json'], 5 | // }, 6 | }; 7 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/BasicBuilder.ts: -------------------------------------------------------------------------------- 1 | import { Writer } from './Writer'; 2 | 3 | export interface BasicBuilder { 4 | write(writer: Writer): void; 5 | } 6 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/logic/stack/stack-regex.ts: -------------------------------------------------------------------------------- 1 | export const stackAtRegex = / {4}at /g; 2 | export const sourceFileWithMapPointerRegex = /^(file:\/\/)?(.*.([jt])sx?)(\?.*)?:(\d*):(\d*)$/; 3 | -------------------------------------------------------------------------------- /python/config/codecov.yml: -------------------------------------------------------------------------------- 1 | comment: 2 | layout: "diff, flags, files" 3 | behavior: default 4 | require_changes: false 5 | require_base: false 6 | require_head: true 7 | hide_project_coverage: false 8 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/python-project-with-composio-core/main.py: -------------------------------------------------------------------------------- 1 | def main(): 2 | print("Hello from python-project-with-composio-core!") 3 | 4 | 5 | if __name__ == "__main__": 6 | main() 7 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__mocks__/tools-googledrive.ts: -------------------------------------------------------------------------------- 1 | import TOOLS from './tools-as-enums.json' with { type: 'json' }; 2 | 3 | export const TOOLS_GOOGLEDRIVE = TOOLS.filter(tool => tool.startsWith('GOOGLEDRIVE_')); 4 | -------------------------------------------------------------------------------- /ts/packages/cli/src/type-utils.ts: -------------------------------------------------------------------------------- 1 | import type { Command } from '@effect/cli'; 2 | 3 | export type GetCmdParams = 4 | T extends Command.Command ? P : never; 5 | -------------------------------------------------------------------------------- /ts/packages/core/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | // https://github.com/egoist/tsup/issues/571#issuecomment-1760052931 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "composite": false 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /fern/generators/python_sdk/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Python SDK documentation generator for Composio. 3 | 4 | This module provides tools to generate SDK documentation from Python code 5 | using autodoc markers in markdown files. 6 | """ -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "trailingComma": "es5", 4 | "singleQuote": true, 5 | "printWidth": 100, 6 | "tabWidth": 2, 7 | "useTabs": false, 8 | "bracketSpacing": true, 9 | "arrowParens": "avoid" 10 | } -------------------------------------------------------------------------------- /ts/examples/google/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY= 3 | # Google GenAI (Gemini) API Key - Get it from https://aistudio.google.com/ 4 | GEMINI_API_KEY=your_composio_api_key_here -------------------------------------------------------------------------------- /ts/examples/vercel/src/types.ts: -------------------------------------------------------------------------------- 1 | export const MessageRoles = { 2 | USER: 'user', 3 | ASSISTANT: 'assistant', 4 | TOOL: 'tool', 5 | } as const; 6 | 7 | export type MessageRole = (typeof MessageRoles)[keyof typeof MessageRoles]; 8 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/isValidJsIdentifier.ts: -------------------------------------------------------------------------------- 1 | import { isIdentifierName } from '@babel/helper-validator-identifier'; 2 | 3 | export function isValidJsIdentifier(name: string): boolean { 4 | return isIdentifierName(name); 5 | } 6 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.options.json", 4 | "compilerOptions": { 5 | "rootDir": "." 6 | }, 7 | "include": ["src"] 8 | } 9 | -------------------------------------------------------------------------------- /fern/llms-txt-worker/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.options.json", 4 | "compilerOptions": { 5 | "rootDir": "./src" 6 | }, 7 | "include": ["src/**/*.ts"] 8 | } -------------------------------------------------------------------------------- /fern/snippets/tool-calling/python/raw_tools.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio() 4 | 5 | tool = composio.tools.get_raw_composio_tool_by_slug("HACKERNEWS_GET_LATEST_POSTS") 6 | 7 | print(tool.model_dump_json()) 8 | -------------------------------------------------------------------------------- /python/providers/llamaindex/README.md: -------------------------------------------------------------------------------- 1 | ## Using Composio With LLamaIndex 2 | 3 | Integrate Composio with LLamaIndex Agentic workflows & enable them to interact seamlessly 4 | with external apps, enhancing their functionality and reach. 5 | -------------------------------------------------------------------------------- /ts/examples/toolkits/src/toolkits.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio(); 4 | 5 | const toolkits = await composio.toolkits.get({}); 6 | 7 | console.log(JSON.stringify(toolkits, null, 2)); 8 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/sourcemaps/index.ts: -------------------------------------------------------------------------------- 1 | export * from './get-error-location-from-file-path'; 2 | export * from './get-source-code'; 3 | export * from './get-sources-from-map-file'; 4 | export * from './transform-raw-error'; 5 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/common/spans-stack-trailing-char.ts: -------------------------------------------------------------------------------- 1 | import * as color from 'src/ui/colors'; 2 | 3 | export const spanStackTrailingChar = (isLastEntry: boolean) => 4 | isLastEntry ? color.gray('╰') : color.gray('├'); 5 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/parsers/parse-default.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod/v3'; 2 | 3 | import type { JsonSchemaObject } from '../types'; 4 | 5 | export const parseDefault = (_jsonSchema: JsonSchemaObject) => { 6 | return z.any(); 7 | }; 8 | -------------------------------------------------------------------------------- /fern/snippets/migration/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "migration" 3 | version = "0.1.0" 4 | description = "Add your description here" 5 | readme = "README.md" 6 | requires-python = ">=3.12" 7 | dependencies = [ 8 | "composio", 9 | ] 10 | -------------------------------------------------------------------------------- /ts/packages/cli/src/cli-config.ts: -------------------------------------------------------------------------------- 1 | import type { CliConfig } from '@effect/cli/CliConfig'; 2 | 3 | export const ComposioCliConfig = { 4 | showBuiltIns: false, 5 | autoCorrectLimit: 0, 6 | isCaseSensitive: true, 7 | } satisfies Partial; 8 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/common/constants/missing-spans-warning.ts: -------------------------------------------------------------------------------- 1 | import * as color from 'src/ui/colors'; 2 | 3 | export const missingSpansWarning = `\r\n${color.gray('ℹ️ Consider using spans to improve errors reporting.')}`; 4 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/typescript-project-with-composio-core/src/index.js: -------------------------------------------------------------------------------- 1 | import { Toolkits } from '@composio/core/generated'; 2 | 3 | console.log('Test: Using generated Composio types'); 4 | console.log(Toolkits.GMAIL.tools.CREATE_EMAIL_DRAFT); 5 | -------------------------------------------------------------------------------- /ts/examples/cloudflare-wrangler/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["@cloudflare/vitest-pool-workers"] 5 | }, 6 | "include": ["./**/*.ts", "../worker-configuration.d.ts"], 7 | "exclude": [] 8 | } 9 | -------------------------------------------------------------------------------- /ts/examples/connected-accounts/src/scopes.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio(); 4 | 5 | const response = await composio.authConfigs.get('ac_3COrKCdQYLNu'); 6 | 7 | console.log(JSON.stringify(response, null, 2)); 8 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/dependencies/fs/read-json/json-parsing.error.ts: -------------------------------------------------------------------------------- 1 | import { TaggedError } from 'effect/Data'; 2 | 3 | export class JsonParsingError extends TaggedError('json-parsing-error')<{ 4 | cause?: unknown; 5 | message?: string; 6 | }> {} 7 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/captured-errors/index.ts: -------------------------------------------------------------------------------- 1 | export * from './maybe-advise-spans-usage'; 2 | export * from './maybe-print-node-stacktrace'; 3 | export * from './maybe-print-spans-timeline'; 4 | export * from './print-effect-stacktrace'; 5 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/python-project-with-composio-core/uv.lock: -------------------------------------------------------------------------------- 1 | version = 1 2 | revision = 2 3 | requires-python = ">=3.12, <4" 4 | 5 | [[package]] 6 | name = "python-project-with-composio-core" 7 | version = "0.1.0" 8 | source = { virtual = "." } 9 | -------------------------------------------------------------------------------- /ts/packages/core/tsconfig.type-tests.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "rootDir": "." 6 | }, 7 | "include": ["src/**/*.ts", "type-tests/**/*.ts", "type-tests/**/*.d.ts", "package.json"] 8 | } 9 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/parsers/parse-null.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod/v3'; 2 | 3 | import type { JsonSchemaObject } from '../types'; 4 | 5 | export const parseNull = (_jsonSchema: JsonSchemaObject & { type: 'null' }) => { 6 | return z.null(); 7 | }; 8 | -------------------------------------------------------------------------------- /python/composio/integration_test/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Integration test package for Composio SDK. 3 | 4 | This package contains comprehensive integration tests for various Composio features, 5 | including experimental MCP functionality. 6 | """ 7 | 8 | __all__ = [] 9 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/types/error-span.type.ts: -------------------------------------------------------------------------------- 1 | export interface ErrorSpan { 2 | name: string; 3 | attributes: Record; 4 | durationInMilliseconds: number | undefined; 5 | startTime: bigint; 6 | endTime: bigint | undefined; 7 | } 8 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.options.json", 4 | "compilerOptions": { 5 | "rootDir": "." 6 | }, 7 | "include": ["src/**/*", "test/**/*", "package.json"] 8 | } 9 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/typescript/raw_tools.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio(); 4 | 5 | const tool = await composio.tools.getRawComposioToolBySlug('GITHUB_GET_OCTOCAT'); 6 | 7 | console.log(JSON.stringify(tool, null, 2)); 8 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/typescript-project-with-composio-core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "devDependencies": { 4 | "typescript": "^5.9.2" 5 | }, 6 | "dependencies": { 7 | "@composio/core": "link:../../../../core" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/parsers/parse-boolean.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod/v3'; 2 | 3 | import type { JsonSchemaObject } from '../types'; 4 | 5 | export const parseBoolean = (_jsonSchema: JsonSchemaObject & { type: 'boolean' }) => { 6 | return z.boolean(); 7 | }; 8 | -------------------------------------------------------------------------------- /ts/packages/providers/google/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | }); 11 | -------------------------------------------------------------------------------- /ts/packages/providers/mastra/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | }); 11 | -------------------------------------------------------------------------------- /ts/packages/providers/openai/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | }); 11 | -------------------------------------------------------------------------------- /ts/packages/providers/vercel/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | }); 11 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/logic/path/strip-cwd-path.ts: -------------------------------------------------------------------------------- 1 | const cwdRegex = global.process !== undefined ? new RegExp(global.process.cwd(), 'g') : null; 2 | 3 | export const stripCwdPath = (path: string): string => 4 | cwdRegex === null ? path : path.replace(cwdRegex, '.'); 5 | -------------------------------------------------------------------------------- /ts/packages/core/src/utils/uuid.ts: -------------------------------------------------------------------------------- 1 | import { v4 as uuidv4 } from 'uuid'; 2 | 3 | export function getRandomUUID(): string { 4 | return uuidv4(); 5 | } 6 | 7 | export function getRandomShortId(): string { 8 | return getRandomUUID().slice(0, 8).replace(/-/g, ''); 9 | } 10 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | }); 11 | -------------------------------------------------------------------------------- /ts/packages/providers/anthropic/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | }); 11 | -------------------------------------------------------------------------------- /ts/packages/providers/cloudflare/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | }); 11 | -------------------------------------------------------------------------------- /ts/packages/providers/langchain/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | }); 11 | -------------------------------------------------------------------------------- /ts/packages/providers/llamaindex/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | }); 11 | -------------------------------------------------------------------------------- /ts/examples/cloudflare-wrangler/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = tab 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.yml] 12 | indent_style = space 13 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/python-project-with-composio-core/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "python-project-with-composio-core" 3 | version = "0.1.0" 4 | description = "Add your description here" 5 | readme = "README.md" 6 | requires-python = ">=3.12, <4" 7 | dependencies = [] 8 | -------------------------------------------------------------------------------- /ts/packages/providers/openai-agents/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | }); 11 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/common/format-span-duration.ts: -------------------------------------------------------------------------------- 1 | import * as color from 'src/ui/colors'; 2 | 3 | export const formatSpanDuration = (durationInMs: number | bigint, isLastEntry: boolean) => 4 | `\r\n${isLastEntry ? ' ' : color.gray('│')} ~ ${durationInMs}ms`; 5 | -------------------------------------------------------------------------------- /ts/packages/core/src/types/files.types.ts: -------------------------------------------------------------------------------- 1 | export type FileUploadData = { 2 | name: string; 3 | mimetype: string; 4 | s3key: string; 5 | }; 6 | 7 | export type FileDownloadData = { 8 | name: string; 9 | mimeType: string; 10 | s3Url: string; 11 | filePath: string; 12 | }; 13 | -------------------------------------------------------------------------------- /ts/examples/mcp/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY=your_composio_api_key_here 3 | 4 | # Add other environment variables as needed for your example 5 | # OPENAI_API_KEY=your_openai_api_key_here 6 | # ANTHROPIC_API_KEY=your_anthropic_api_key_here 7 | -------------------------------------------------------------------------------- /ts/examples/tools/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY=your_composio_api_key_here 3 | 4 | # Add other environment variables as needed for your example 5 | # OPENAI_API_KEY=your_openai_api_key_here 6 | # ANTHROPIC_API_KEY=your_anthropic_api_key_here 7 | -------------------------------------------------------------------------------- /ts/examples/llamaindex/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY=your_composio_api_key_here 3 | 4 | # Add other environment variables as needed for your example 5 | # OPENAI_API_KEY=your_openai_api_key_here 6 | # ANTHROPIC_API_KEY=your_anthropic_api_key_here 7 | -------------------------------------------------------------------------------- /ts/examples/mastra/.env.example: -------------------------------------------------------------------------------- 1 | 2 | # # Composio API Key - Get it from https://app.composio.dev 3 | # COMPOSIO_API_KEY=your_composio_api_key 4 | 5 | # # Add other environment variables as needed for your example 6 | # OPENAI_API_KEY=your_openai_api_key 7 | # # ANTHROPIC_API_KEY=your_anthropic_api_key_here 8 | -------------------------------------------------------------------------------- /ts/examples/triggers/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY=your_composio_api_key_here 3 | 4 | # Add other environment variables as needed for your example 5 | # OPENAI_API_KEY=your_openai_api_key_here 6 | # ANTHROPIC_API_KEY=your_anthropic_api_key_here 7 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | tsconfig: './tsconfig.src.json', 11 | }); 12 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | # #!/usr/bin/env sh 2 | 3 | # Uncomment tools in docs.yml before commit to avoid issues 4 | # echo "Uncommenting tools in docs.yml before commit..." 5 | # (cd fern && uv run python generators/tool_doc_generator/pre_commit_tool_doc.py) 6 | 7 | # Run existing lint-staged 8 | pnpm lint-staged 9 | -------------------------------------------------------------------------------- /python/providers/openai/composio_openai/provider.py: -------------------------------------------------------------------------------- 1 | """ 2 | OpenAI Provider for composio SDK. 3 | """ 4 | 5 | from composio.core.provider._openai import OpenAIProvider 6 | from composio.core.provider._openai_responses import OpenAIResponsesProvider 7 | 8 | __all__ = ["OpenAIProvider", "OpenAIResponsesProvider"] 9 | -------------------------------------------------------------------------------- /ts/examples/custom-tools/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY=your_composio_api_key_here 3 | 4 | # Add other environment variables as needed for your example 5 | # OPENAI_API_KEY=your_openai_api_key_here 6 | # ANTHROPIC_API_KEY=your_anthropic_api_key_here 7 | -------------------------------------------------------------------------------- /ts/examples/file-handling/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY=your_composio_api_key_here 3 | 4 | # Add other environment variables as needed for your example 5 | # OPENAI_API_KEY=your_openai_api_key_here 6 | # ANTHROPIC_API_KEY=your_anthropic_api_key_here 7 | -------------------------------------------------------------------------------- /ts/examples/tool-router/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY=your_composio_api_key_here 3 | 4 | # Add other environment variables as needed for your example 5 | # OPENAI_API_KEY=your_openai_api_key_here 6 | # ANTHROPIC_API_KEY=your_anthropic_api_key_here 7 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/helpers.ts: -------------------------------------------------------------------------------- 1 | import { NamedType, namedType } from './NamedType'; 2 | import { TypeBuilder } from './TypeBuilder'; 3 | 4 | export function omit(type: TypeBuilder, keyType: TypeBuilder): NamedType { 5 | return namedType('Omit').addGenericArgument(type).addGenericArgument(keyType); 6 | } 7 | -------------------------------------------------------------------------------- /python/config/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | addopts = --strict-markers 3 | markers = 4 | core: marks tests that check only the core functionality 5 | openai: marks tests that check the OpenAIProvider 6 | langchain: marks tests that check the LangChainProvider 7 | agno: marks tests that check the AgnoProvider 8 | -------------------------------------------------------------------------------- /ts/examples/json-schema-to-zod/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY=your_composio_api_key_here 3 | 4 | # Add other environment variables as needed for your example 5 | # OPENAI_API_KEY=your_openai_api_key_here 6 | # ANTHROPIC_API_KEY=your_anthropic_api_key_here 7 | -------------------------------------------------------------------------------- /ts/examples/session-management/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY=your_composio_api_key_here 3 | 4 | # Add other environment variables as needed for your example 5 | # OPENAI_API_KEY=your_openai_api_key_here 6 | # ANTHROPIC_API_KEY=your_anthropic_api_key_here 7 | -------------------------------------------------------------------------------- /ts/examples/tool-router/src/toolkits.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio(); 4 | 5 | const session = await composio.create('user_123'); 6 | 7 | const toolkits = await session.toolkits({ toolkits: ["github"]}); 8 | 9 | console.log(JSON.stringify({ toolkits }, null, 2)) -------------------------------------------------------------------------------- /ts/packages/cli/src/ui/colors.ts: -------------------------------------------------------------------------------- 1 | import color from 'picocolors'; 2 | 3 | export const { 4 | bold, 5 | underline, 6 | bgWhite, 7 | bgBlack, 8 | bgRed, 9 | gray, 10 | red, 11 | redBright, 12 | white, 13 | blue, 14 | cyanBright, 15 | } = color.createColors(!Boolean(process.env.NO_COLOR)); 16 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/parsers/parse-const.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod/v3'; 2 | 3 | import type { JsonSchemaObject, Serializable } from '../types'; 4 | 5 | export const parseConst = (jsonSchema: JsonSchemaObject & { const: Serializable }) => { 6 | return z.literal(jsonSchema.const as z.Primitive); 7 | }; 8 | -------------------------------------------------------------------------------- /ts/examples/cloudflare-wrangler/vitest.config.mts: -------------------------------------------------------------------------------- 1 | import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config'; 2 | 3 | export default defineWorkersConfig({ 4 | test: { 5 | poolOptions: { 6 | workers: { 7 | wrangler: { configPath: './wrangler.jsonc' }, 8 | }, 9 | }, 10 | }, 11 | }); 12 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/index.ts: -------------------------------------------------------------------------------- 1 | export * from './capture-errors.js'; 2 | export * from './pretty-print-from-captured-errors.js'; 3 | export type { ErrorLocation, ErrorRelatedSources, SourceCode } from './sourcemaps'; 4 | export type { ErrorSpan } from './types/index'; 5 | export * from './types/pretty-print-options.type'; 6 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__mocks__/trigger-types-gmail.ts: -------------------------------------------------------------------------------- 1 | import TRIGGER_TYPES from './trigger-types.json' with { type: 'json' }; 2 | import { TriggerType } from 'src/models/trigger-types'; 3 | 4 | export const TRIGGER_TYPES_GMAIL = TRIGGER_TYPES.filter(triggerType => 5 | triggerType.slug.startsWith('GMAIL') 6 | ) as TriggerType[]; 7 | -------------------------------------------------------------------------------- /ts/packages/cli/turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["//"], 3 | "tasks": { 4 | "build": { 5 | "dependsOn": ["^build"], 6 | "outputs": ["dist/**", "dist/**/*.d.ts"] 7 | }, 8 | "build:bin": { 9 | "dependsOn": ["^build"], 10 | "outputs": ["dist/**", "dist/**/*.d.ts"] 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /fern/snippets/migration/old_tools.ts: -------------------------------------------------------------------------------- 1 | import { OpenAIToolSet } from 'composio-core'; 2 | 3 | const toolset = new OpenAIToolSet(); 4 | 5 | const tools_1 = await toolset.getTools({ apps: ['GITHUB'] }); 6 | const tools_2 = await toolset.getTools({ 7 | actions: ['GITHUB_GET_THE_AUTHENTICATED_USER', 'LINEAR_CREATE_LINEAR_ISSUE'], 8 | }); 9 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__mocks__/trigger-types-github.ts: -------------------------------------------------------------------------------- 1 | import TRIGGER_TYPES from './trigger-types.json' with { type: 'json' }; 2 | import { TriggerType } from 'src/models/trigger-types'; 3 | 4 | export const TRIGGER_TYPES_GITHUB = TRIGGER_TYPES.filter(triggerType => 5 | triggerType.slug.startsWith('GITHUB_') 6 | ) as TriggerType[]; 7 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effects/version.ts: -------------------------------------------------------------------------------- 1 | import { Effect, Option } from 'effect'; 2 | import { DEBUG_OVERRIDE_CONFIG } from 'src/effects/debug-config'; 3 | import * as constants from 'src/constants'; 4 | 5 | export const getVersion = Effect.map( 6 | DEBUG_OVERRIDE_CONFIG.VERSION, 7 | Option.getOrElse(() => constants.APP_VERSION) 8 | ); 9 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/python-project-with-composio-core/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e -o pipefail 4 | 5 | # uv init 6 | 7 | uv venv 8 | source .venv/bin/activate 9 | uv pip install --requirements requirements.txt; 10 | 11 | uv run python -c "import composio; print (composio.__file__)" 12 | 13 | # deactivate 14 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": false, 5 | "fixed": [], 6 | "linked": [], 7 | "access": "restricted", 8 | "baseBranch": "main", 9 | "updateInternalDependencies": "patch", 10 | "ignore": [] 11 | } 12 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__utils__/index.ts: -------------------------------------------------------------------------------- 1 | import pkg from '../../package.json' with { type: 'json' }; 2 | 3 | export * as MockConsole from './services/mock-console'; 4 | export * as MockTerminal from './services/mock-terminal'; 5 | export { TestLayer as TestLive } from './services/test-layer'; 6 | export { cli } from './cli'; 7 | export { pkg }; 8 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.options.json", 4 | "compilerOptions": { 5 | "rootDir": ".", 6 | "paths": { 7 | "src/*": ["./src/*"], 8 | "test/*": ["./test/*"] 9 | } 10 | }, 11 | "include": ["test"] 12 | } 13 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/python/versioning-sdk-init.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | # Pin specific versions for each toolkit 4 | composio = Composio( 5 | api_key="YOUR_API_KEY", 6 | toolkit_versions={ 7 | "github": "20251027_00", 8 | "slack": "20251027_00", 9 | "gmail": "20251027_00" 10 | } 11 | ) -------------------------------------------------------------------------------- /ts/packages/cli/test/__mocks__/trigger-types-googledrive.ts: -------------------------------------------------------------------------------- 1 | import TRIGGER_TYPES from './trigger-types.json' with { type: 'json' }; 2 | import { TriggerType } from 'src/models/trigger-types'; 3 | 4 | export const TRIGGER_TYPES_GOOGLEDRIVE = TRIGGER_TYPES.filter(triggerType => 5 | triggerType.slug.startsWith('GOOGLEDRIVE') 6 | ) as TriggerType[]; 7 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/utils/omit.ts: -------------------------------------------------------------------------------- 1 | export const omit = (obj: T, ...keys: K[]): Omit => 2 | Object.keys(obj).reduce((acc: Record, key) => { 3 | if (!keys.includes(key as K)) { 4 | acc[key] = obj[key as K]; 5 | } 6 | 7 | return acc; 8 | }, {}) as Omit; 9 | -------------------------------------------------------------------------------- /ts/packages/cli/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/bin.ts'], 5 | format: ['esm'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | tsconfig: './tsconfig.src.json', 11 | banner: { 12 | js: '#!/usr/bin/env bun', 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /ts/examples/versioning/.env.example: -------------------------------------------------------------------------------- 1 | # Composio API Key - Get it from https://app.composio.dev 2 | COMPOSIO_API_KEY=your_composio_api_key_here 3 | COMPOSIO_TOOLKIT_VERSION_HACKERNEWS=20250911_00 4 | 5 | # Add other environment variables as needed for your example 6 | # OPENAI_API_KEY=your_openai_api_key_here 7 | # ANTHROPIC_API_KEY=your_anthropic_api_key_here 8 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__utils__/sanitize.ts: -------------------------------------------------------------------------------- 1 | import { pipe, Effect, String } from 'effect'; 2 | import { getVersion } from 'src/effects/version'; 3 | 4 | export const sanitize = (str: string) => 5 | Effect.gen(function* () { 6 | const version = yield* getVersion; 7 | 8 | return pipe(str, String.replaceAll(version, '')); 9 | }); 10 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/types/pretty-print-options.type.ts: -------------------------------------------------------------------------------- 1 | export interface PrettyPrintOptions { 2 | enabled?: boolean; 3 | stripCwd?: boolean | undefined; 4 | hideStackTrace?: boolean; 5 | } 6 | 7 | export const prettyPrintOptionsDefault: PrettyPrintOptions = { 8 | enabled: true, 9 | stripCwd: true, 10 | hideStackTrace: true, 11 | }; 12 | -------------------------------------------------------------------------------- /fern/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "../tsconfig.base.json", 4 | "include": ["pages/**/*", "src/**/*"], 5 | "exclude": ["node_modules", "dist"], 6 | "compilerOptions": { 7 | "module": "esnext", 8 | "target": "es2022", 9 | "moduleResolution": "bundler" 10 | } 11 | } -------------------------------------------------------------------------------- /ts/packages/cli/test/__utils__/cli.ts: -------------------------------------------------------------------------------- 1 | import { Effect } from 'effect'; 2 | import * as Cli from 'src/commands'; 3 | 4 | // Run CLI in test environment 5 | export const cli = (args: ReadonlyArray) => 6 | Effect.flatMap(Cli.runWithConfig, run => run(['node', '', ...args])) satisfies Effect.Effect< 7 | void, 8 | any, 9 | any 10 | >; 11 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/typescript/versioning-sdk-init.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from "@composio/core"; 2 | 3 | // Pin specific versions for each toolkit 4 | const composio = new Composio({ 5 | apiKey: "YOUR_API_KEY", 6 | toolkitVersions: { 7 | github: "20251027_00", 8 | slack: "20251027_00", 9 | gmail: "20251027_00" 10 | } 11 | }); -------------------------------------------------------------------------------- /fern/tailwind.config.js: -------------------------------------------------------------------------------- 1 | const plugin = require("tailwindcss"); 2 | 3 | /** @type {import('tailwindcss').Config} */ 4 | module.exports = { 5 | darkMode: "class", 6 | content: ["./**/*.{md,mdx,tsx}", "./fern/assets/input.css"], 7 | theme: { 8 | extend: {}, 9 | }, 10 | plugins: [], 11 | future: { 12 | hoverOnlyWhenSupported: true, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/tsconfig.src.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.options.json", 4 | "compilerOptions": { 5 | "outDir": "./dist", 6 | "rootDir": ".", 7 | "paths": { 8 | "src/*": ["./src/*"] 9 | } 10 | }, 11 | "include": ["src"], 12 | "exclude": ["src/**/*.test.ts"] 13 | } 14 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/common/index.ts: -------------------------------------------------------------------------------- 1 | export * from './constants/missing-spans-warning'; 2 | export * from './format-error-title'; 3 | export * from './format-span-duration'; 4 | export * from './format-spans-attribute'; 5 | export * from './format-title'; 6 | export * from './maybe-warn-about-plain-strings'; 7 | export * from './spans-stack-trailing-char'; 8 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/test/e2e/README.md: -------------------------------------------------------------------------------- 1 | # E2E Tests 2 | 3 | End-to-end tests that verify `@composio/json-schema-to-zod` works correctly with different versions of zod. 4 | 5 | ## Structure 6 | 7 | - `zod-v3/` - Tests with zod 3.25.76 and `zod-to-json-schema` for round-trip conversion 8 | - `zod-v4/` - Tests with zod ^4.0.0 and native `z.toJSONSchema()` for validation 9 | -------------------------------------------------------------------------------- /fern/snippets/authentication/typescript/auth-config.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio(); 4 | 5 | const authConfig = await composio.authConfigs.create('PERPLEXITYAI', { 6 | name: 'Perplexity AI', 7 | type: 'use_custom_auth', 8 | credentials: {}, 9 | authScheme: 'API_KEY', 10 | }); 11 | 12 | console.log(authConfig); 13 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/types/pretty-error.type.ts: -------------------------------------------------------------------------------- 1 | import type { Span } from 'effect/Tracer'; 2 | 3 | export class PrettyError { 4 | constructor( 5 | readonly message: unknown, 6 | readonly stack: string | undefined, 7 | readonly span: Span | undefined, 8 | readonly isPlainString: boolean, 9 | readonly errorType?: unknown 10 | ) {} 11 | } 12 | -------------------------------------------------------------------------------- /ts/packages/core/tsdown.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'tsdown'; 2 | 3 | export default defineConfig({ 4 | entry: ['src/index.ts'], 5 | format: ['esm', 'cjs'], 6 | dts: true, 7 | clean: true, 8 | minify: false, 9 | outDir: 'dist', 10 | tsconfig: './tsconfig.build.json', 11 | onSuccess() { 12 | console.info('🙏 Build succeeded!'); 13 | }, 14 | }); 15 | -------------------------------------------------------------------------------- /fern/snippets/authentication/python/auth-config.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio() 4 | 5 | # Use custom auth 6 | auth_config = composio.auth_configs.create( 7 | toolkit="perplexityai", 8 | options={ 9 | "type": "use_custom_auth", 10 | "auth_scheme": "API_KEY", 11 | "credentials": {} 12 | }, 13 | ) 14 | print(auth_config) 15 | -------------------------------------------------------------------------------- /ts/packages/core/test/utils/mocks/provider.mock.ts: -------------------------------------------------------------------------------- 1 | import { vi } from 'vitest'; 2 | import { BaseAgenticProvider } from '../../../src/provider/BaseProvider'; 3 | 4 | export class MockProvider extends BaseAgenticProvider { 5 | readonly name = 'MockProvider'; 6 | readonly _isAgentic = true; 7 | 8 | wrapTool = vi.fn(); 9 | wrapTools = vi.fn(); 10 | } 11 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/tsconfig.src.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.options.json", 4 | "compilerOptions": { 5 | "outDir": "./dist", 6 | "rootDir": ".", 7 | "baseUrl": "." 8 | }, 9 | "include": ["src/**/*", "package.json"], 10 | "exclude": ["node_modules", "../../../node_modules", "**/dist"] 11 | } 12 | -------------------------------------------------------------------------------- /fern/assets/images/vercel-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | -------------------------------------------------------------------------------- /fern/llms-txt-worker/wrangler.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/wrangler/config-schema.json", 3 | "name": "composio-docs-proxy", 4 | "main": "src/index.ts", 5 | "compatibility_date": "2025-07-26", 6 | "assets": { 7 | "directory": "./public/", 8 | "binding": "ASSETS" 9 | }, 10 | "routes": [ 11 | { "pattern": "docs.composio.dev/*", "zone_name": "composio.dev" } 12 | ] 13 | } -------------------------------------------------------------------------------- /python/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | testpaths = tests 3 | python_files = test_*.py 4 | python_classes = Test* 5 | python_functions = test_* 6 | addopts = -v --tb=short 7 | markers = 8 | slow: marks tests as slow (deselect with '-m "not slow"') 9 | integration: marks tests as integration tests 10 | unit: marks tests as unit tests 11 | schema: marks tests as schema-related tests 12 | -------------------------------------------------------------------------------- /fern/snippets/authentication/typescript/define-scopes.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from "@composio/core"; 2 | 3 | const composio = new Composio(); 4 | 5 | const authConfig = await composio.authConfigs.create("HUBSPOT", { 6 | name: "HubspotConfig", 7 | type: "use_composio_managed_auth", 8 | credentials: { 9 | scopes: "sales-email-read,tickets", 10 | }, 11 | }); 12 | 13 | console.log(authConfig); -------------------------------------------------------------------------------- /ts/examples/connected-accounts/src/multiple-connected-accounts.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio({ 4 | apiKey: process.env.COMPOSIO_API_KEY, 5 | }); 6 | 7 | const connectionRequest = await composio.connectedAccounts.initiate('default', 'ac_NSC2s9WqTE4n', { 8 | allowMultiple: true, 9 | }); 10 | 11 | console.log(connectionRequest.redirectUrl); 12 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.options.json", 4 | "compilerOptions": { 5 | "rootDir": ".", 6 | "baseUrl": "." 7 | }, 8 | "include": ["src/**/*", "test/**/*", "package.json"], 9 | "exclude": ["node_modules", "../../../node_modules", "**/dist", "test/e2e", "test-sandboxes"] 10 | } 11 | -------------------------------------------------------------------------------- /ts/examples/vercel/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true 13 | }, 14 | "include": ["src"] 15 | } 16 | -------------------------------------------------------------------------------- /python/composio/core/provider/__init__.py: -------------------------------------------------------------------------------- 1 | import typing as t 2 | 3 | from .agentic import AgenticProvider, AgenticProviderExecuteFn 4 | from .none_agentic import NonAgenticProvider 5 | 6 | TProvider = t.TypeVar("TProvider", bound=AgenticProvider | NonAgenticProvider) 7 | 8 | __all__ = [ 9 | "TProvider", 10 | "AgenticProvider", 11 | "NonAgenticProvider", 12 | "AgenticProviderExecuteFn", 13 | ] 14 | -------------------------------------------------------------------------------- /ts/examples/langchain/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true 13 | }, 14 | "include": ["src"] 15 | } 16 | -------------------------------------------------------------------------------- /ts/examples/modifiers/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true 13 | }, 14 | "include": ["src"] 15 | } 16 | -------------------------------------------------------------------------------- /ts/examples/toolkits/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true 13 | }, 14 | "include": ["src"] 15 | } 16 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/README.md: -------------------------------------------------------------------------------- 1 | The code in this folder is adapter from the `effect-errors` package published at https://github.com/jpb06/effect-errors/tree/d8bedbcb9e0506eabe396449cd16cd247eb55003. 2 | Compared to the original, it has been modified to work with custom colors. 3 | 4 | See the original [MIT License](https://github.com/jpb06/effect-errors/blob/d8bedbcb9e0506eabe396449cd16cd247eb55003/LICENSE). 5 | -------------------------------------------------------------------------------- /fern/snippets/migration/providers.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | # from composio_langchain import LangchainProvider 3 | 4 | composio = Composio() 5 | # composio = Composio(provider=LangchainProvider()) 6 | 7 | tools = composio.tools.get( 8 | user_id="0001", 9 | tools=["LINEAR_CREATE_LINEAR_ISSUE", "GITHUB_CREATE_COMMIT"] 10 | ) 11 | # tools returned is formatted for the provider. by default, OpenAI. 12 | -------------------------------------------------------------------------------- /ts/examples/connected-accounts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true 13 | }, 14 | "include": ["src"] 15 | } 16 | -------------------------------------------------------------------------------- /ts/examples/error-handling-demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true 13 | }, 14 | "include": ["src"] 15 | } 16 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Git 2 | .git 3 | .gitignore 4 | 5 | # Docker 6 | Dockerfile 7 | .dockerignore 8 | 9 | # Node.js 10 | node_modules 11 | /packages/*/node_modules 12 | /packages/*/dist 13 | /dist 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | 18 | # Editor directories and files 19 | .idea 20 | .vscode 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | 26 | # OS generated files 27 | .DS_Store 28 | Thumbs.db 29 | -------------------------------------------------------------------------------- /ts/examples/connected-accounts/src/api-key.ts: -------------------------------------------------------------------------------- 1 | import { AuthScheme, Composio } from '@composio/core'; 2 | 3 | const composio = new Composio({ 4 | apiKey: process.env.COMPOSIO_API_KEY, 5 | }); 6 | 7 | const connectionRequest = await composio.connectedAccounts.initiate('user_123', 'auth_config_123', { 8 | config: AuthScheme.APIKey({ 9 | api_key: 'your_api_key', 10 | }), 11 | }); 12 | 13 | console.log(connectionRequest); 14 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__mocks__/tools-types-github.ts: -------------------------------------------------------------------------------- 1 | import type { Tools } from 'src/models/tools'; 2 | import TOOLS from './tools.json' with { type: 'json' }; 3 | 4 | // Work around TypeScript's "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. ts(7056)" error. 5 | export const TOOLS_TYPES_GITHUB = (TOOLS as Tools).filter(tool => tool.slug.startsWith('GITHUB_')); 6 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__mocks__/tools-types-gmail.ts: -------------------------------------------------------------------------------- 1 | import type { Tools } from 'src/models/tools'; 2 | import TOOLS from './tools.json' with { type: 'json' }; 3 | 4 | // Work around TypeScript's "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. ts(7056)" error. 5 | export const TOOLS_TYPES_GMAIL = (TOOLS as Tools).filter(tool => tool.slug.startsWith('GMAIL_')); 6 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/test/e2e/zod-v4/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@test-e2e/json-schema-to-zod-e2e-zod-v4", 3 | "version": "1.0.0", 4 | "private": true, 5 | "type": "module", 6 | "scripts": { 7 | "test": "vitest run" 8 | }, 9 | "dependencies": { 10 | "@composio/json-schema-to-zod": "workspace:*", 11 | "zod": "^4.1.0" 12 | }, 13 | "devDependencies": { 14 | "vitest": "catalog:" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/cjs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/mcp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/openai/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "esnext", 4 | "module": "esnext", 5 | "lib": ["esnext", "dom"], 6 | "declaration": true, 7 | "declarationDir": "./dist", 8 | "outDir": "./dist", 9 | "rootDir": "./src", 10 | "strict": true, 11 | "esModuleInterop": true, 12 | "moduleResolution": "bundler", 13 | "skipLibCheck": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/tools/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/packages/cli/src/services/node-process.ts: -------------------------------------------------------------------------------- 1 | import process from 'node:process'; 2 | import { Effect } from 'effect'; 3 | 4 | // Service to that wraps `node:process`, for testing purposes. 5 | export class NodeProcess extends Effect.Service()('services/NodeProcess', { 6 | sync: () => ({ 7 | cwd: process.cwd(), 8 | platform: process.platform, 9 | arch: process.arch, 10 | }), 11 | dependencies: [], 12 | }) {} 13 | -------------------------------------------------------------------------------- /ts/packages/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src/**/*.ts"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/packages/providers/openai/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "declarationDir": "./dist", 8 | "outDir": "./dist", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true 13 | }, 14 | "include": ["src"] 15 | } 16 | -------------------------------------------------------------------------------- /ts/examples/anthropic/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/google/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/llamaindex/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/mastra/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/triggers/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/versioning/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /fern/components/cards-container.tsx: -------------------------------------------------------------------------------- 1 | import { SimpleCard, SimpleCardProps } from "./simple-card"; 2 | 3 | export interface CardsContainerProps { 4 | cards: SimpleCardProps[]; 5 | } 6 | 7 | export function CardsContainer({ cards }: CardsContainerProps) { 8 | return ( 9 |
10 | {cards.map((card, index) => ( 11 | 12 | ))} 13 |
14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /ts/examples/custom-tools/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/file-handling/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/tool-router/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/python/versioning-manage.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio(api_key="YOUR_API_KEY") 4 | 5 | # Get toolkit information including available versions 6 | toolkit = composio.toolkits.get(slug="github") 7 | 8 | # Extract and print version information 9 | print(f"Toolkit: {toolkit.name}") 10 | print(f"Current Version: {toolkit.meta.version}") 11 | print(f"Available Versions: {toolkit.meta.available_versions}") -------------------------------------------------------------------------------- /ts/examples/json-schema-to-zod/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/session-management/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "declarationDir": "./dist", 7 | "outDir": "./dist", 8 | "rootDir": "./src", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/packages/cli/src/commands/py/py.cmd.ts: -------------------------------------------------------------------------------- 1 | import { Command } from '@effect/cli'; 2 | import { pyCmd$Generate } from './commands/py.generate.cmd'; 3 | 4 | /** 5 | * CLI entry point for Python commands. 6 | * 7 | * @example 8 | * ```bash 9 | * composio py 10 | * ``` 11 | */ 12 | export const pyCmd = Command.make('py').pipe( 13 | Command.withDescription('Handle Python projects.'), 14 | Command.withSubcommands([pyCmd$Generate]) 15 | ); 16 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__mocks__/tools-types-googledrive.ts: -------------------------------------------------------------------------------- 1 | import type { Tools } from 'src/models/tools'; 2 | import TOOLS from './tools.json' with { type: 'json' }; 3 | 4 | // Work around TypeScript's "The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed. ts(7056)" error. 5 | export const TOOLS_TYPES_GOOGLEDRIVE = (TOOLS as Tools).filter(tool => 6 | tool.slug.startsWith('GOOGLEDRIVE_') 7 | ); 8 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/ArrayValue.ts: -------------------------------------------------------------------------------- 1 | import { ValueBuilder } from './ValueBuilder'; 2 | import type { Writer } from './Writer'; 3 | 4 | export class ArrayValue extends ValueBuilder { 5 | private items: ValueBuilder[] = []; 6 | 7 | add(item: ValueBuilder): this { 8 | this.items.push(item); 9 | return this; 10 | } 11 | 12 | write(writer: Writer): void { 13 | writer.write('[').writeJoined(', ', this.items).write(']'); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/typescript/file-download.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | const composio = new Composio({apiKey: 'your-composio-api-key'}); 3 | 4 | // Download a file from Google Drive 5 | const result = await composio.tools.execute('GOOGLEDRIVE_DOWNLOAD_FILE', { 6 | userId: 'user-1235***', 7 | arguments: { 8 | file_id: 'your-file-id' 9 | } 10 | }); 11 | 12 | // Result includes local file path 13 | console.log(result); -------------------------------------------------------------------------------- /ts/packages/cli/src/commands/ts/ts.cmd.ts: -------------------------------------------------------------------------------- 1 | import { Command } from '@effect/cli'; 2 | import { tsCmd$Generate } from './commands/ts.generate.cmd'; 3 | 4 | /** 5 | * CLI entry point for TypeScript commands. 6 | * 7 | * @example 8 | * ```bash 9 | * composio ts 10 | * ``` 11 | */ 12 | export const tsCmd = Command.make('ts').pipe( 13 | Command.withDescription('Handle TypeScript projects.'), 14 | Command.withSubcommands([tsCmd$Generate]) 15 | ); 16 | -------------------------------------------------------------------------------- /fern/snippets/authentication/python/define-scopes.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio() 4 | 5 | response = composio.auth_configs.create( 6 | toolkit="HUBSPOT", 7 | options={ 8 | "name": "HubspotConfig", 9 | "authScheme": "OAUTH2", 10 | "type": "use_composio_managed_auth", 11 | "credentials": { 12 | "scopes": "sales-email-read,tickets" 13 | } 14 | } 15 | ) 16 | 17 | print(response.id) -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/captured-errors/maybe-advice-spans-usage.ts: -------------------------------------------------------------------------------- 1 | import * as color from 'src/ui/colors'; 2 | 3 | import type { ErrorSpan } from 'effect-errors/types'; 4 | 5 | export const maybeAdviseSpansUsage = (spans: ErrorSpan[] | undefined): string[] => { 6 | if (spans === undefined || spans.length === 0) { 7 | return ['', color.gray('ℹ️ Consider using spans to improve errors reporting.')]; 8 | } 9 | 10 | return []; 11 | }; 12 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/captured-errors/maybe-advise-spans-usage.ts: -------------------------------------------------------------------------------- 1 | import * as color from 'src/ui/colors'; 2 | 3 | import type { ErrorSpan } from 'effect-errors/types'; 4 | 5 | export const maybeAdviseSpansUsage = (spans: ErrorSpan[] | undefined): string[] => { 6 | if (spans === undefined || spans.length === 0) { 7 | return [' ', color.gray('ℹ️ Consider using spans to improve errors reporting.')]; 8 | } 9 | 10 | return []; 11 | }; 12 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effects/force-config.ts: -------------------------------------------------------------------------------- 1 | import { Config } from 'effect'; 2 | 3 | type FORCE_CONFIG = Config.Config.Wrap<{ 4 | USE_CACHE: boolean; 5 | }>; 6 | 7 | /** 8 | * Describe force configuration keys used at runtime. 9 | * Keys are read from environment variables (with the `FORCE_` format). 10 | */ 11 | export const FORCE_CONFIG = { 12 | USE_CACHE: Config.boolean('FORCE_USE_CACHE').pipe(Config.withDefault(false)), 13 | } satisfies FORCE_CONFIG; 14 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effects/json.ts: -------------------------------------------------------------------------------- 1 | import { Data, Effect } from 'effect'; 2 | 3 | export class JSONParseError extends Data.TaggedError('effects/JSONParseError')<{ 4 | readonly cause: Error; 5 | readonly message: string; 6 | }> {} 7 | 8 | export const JSONParse = (s: string) => 9 | Effect.try({ 10 | try: () => JSON.parse(s) as Record, 11 | catch: e => new JSONParseError({ cause: e as Error, message: 'Failed to parse JSON' }), 12 | }); 13 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/python/file-download.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | 4 | composio = Composio( 5 | api_key="your_composio_key", file_download_dir="./downloads" 6 | ) # Optional: Specify the directory to download files to 7 | 8 | result = composio.tools.execute( 9 | "GOOGLEDRIVE_DOWNLOAD_FILE", 10 | user_id="user-1235***", 11 | arguments={"file_id": "your_file_id"}, 12 | ) 13 | 14 | # Result includes local file path 15 | print(result) 16 | -------------------------------------------------------------------------------- /python/composio/core/models/__init__.py: -------------------------------------------------------------------------------- 1 | from .auth_configs import AuthConfigs 2 | from .connected_accounts import ConnectedAccounts 3 | from .mcp import MCP 4 | from .tool_router import ToolRouter 5 | from .toolkits import Toolkits 6 | from .tools import Tools 7 | from .triggers import Triggers 8 | 9 | __all__ = [ 10 | "AuthConfigs", 11 | "ConnectedAccounts", 12 | "MCP", 13 | "ToolRouter", 14 | "Toolkits", 15 | "Tools", 16 | "Triggers", 17 | ] 18 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/json-schema-to-zod.ts: -------------------------------------------------------------------------------- 1 | import type { z } from 'zod/v3'; 2 | 3 | import { parseSchema } from './parsers/parse-schema'; 4 | import type { JsonSchemaToZodOptions, JsonSchema } from './types'; 5 | 6 | export const jsonSchemaToZod = ( 7 | schema: JsonSchema, 8 | options: JsonSchemaToZodOptions = {} 9 | ): z.ZodType => { 10 | return parseSchema(schema, { 11 | path: [], 12 | seen: new Map(), 13 | ...options, 14 | }); 15 | }; 16 | -------------------------------------------------------------------------------- /ts/packages/providers/google/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "declarationDir": "./dist", 8 | "outDir": "./dist", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/packages/providers/mastra/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "declarationDir": "./dist", 8 | "outDir": "./dist", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/packages/providers/vercel/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "declarationDir": "./dist", 8 | "outDir": "./dist", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/python/file-upload.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from composio import Composio 4 | 5 | composio = Composio(api_key="your_composio_key") 6 | 7 | # Upload a local file to Google Drive 8 | result = composio.tools.execute( 9 | slug="GOOGLEDRIVE_UPLOAD_FILE", 10 | user_id="user-1235***", 11 | arguments={"file_to_upload": os.path.join(os.getcwd(), "document.pdf")}, # Local file path 12 | ) 13 | 14 | print(result) # Print Google Drive file details 15 | -------------------------------------------------------------------------------- /python/composio/utils/uuid.py: -------------------------------------------------------------------------------- 1 | """UUID utility functions for Composio SDK.""" 2 | 3 | import uuid 4 | 5 | 6 | def generate_uuid() -> str: 7 | """Generate a random UUID v4 string.""" 8 | return str(uuid.uuid4()) 9 | 10 | 11 | def generate_short_id() -> str: 12 | """ 13 | Generate a short ID (8 characters) from a UUID. 14 | 15 | Returns the first 8 characters of a UUID with dashes removed. 16 | """ 17 | return generate_uuid()[:8].replace("-", "") 18 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/test/e2e/zod-v3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@test-e2e/json-schema-to-zod-e2e-zod-v3", 3 | "version": "1.0.0", 4 | "private": true, 5 | "type": "module", 6 | "scripts": { 7 | "test": "vitest run" 8 | }, 9 | "dependencies": { 10 | "@composio/json-schema-to-zod": "workspace:*", 11 | "zod": "3.25.76", 12 | "zod-to-json-schema": "catalog:" 13 | }, 14 | "devDependencies": { 15 | "vitest": "catalog:" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /ts/packages/providers/anthropic/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "declarationDir": "./dist", 8 | "outDir": "./dist", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/packages/providers/cloudflare/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "declarationDir": "./dist", 8 | "outDir": "./dist", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/packages/providers/langchain/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "declarationDir": "./dist", 8 | "outDir": "./dist", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /ts/packages/providers/llamaindex/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "declarationDir": "./dist", 8 | "outDir": "./dist", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/python/versioning-per-execution.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio(api_key="YOUR_API_KEY") 4 | 5 | # Specify version directly in execute call 6 | result = composio.tools.execute( 7 | "GITHUB_LIST_STARGAZERS", 8 | arguments={ 9 | "owner": "ComposioHQ", 10 | "repo": "composio" 11 | }, 12 | user_id="user-k7334", 13 | version="20251027_00" # Override version for this execution 14 | ) 15 | print(result) -------------------------------------------------------------------------------- /ts/examples/tool-router/src/authorize.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio(); 4 | const session = await composio.create('user_123', { toolkits: ['gmail'] }); 5 | const connectionRequest = await session.authorize("gmail", { 6 | callbackUrl: "https://google.com" 7 | }); 8 | 9 | console.log(connectionRequest); 10 | 11 | const connectedAccount = await connectionRequest.waitForConnection(); 12 | console.log(connectedAccount); 13 | 14 | 15 | -------------------------------------------------------------------------------- /ts/packages/providers/openai-agents/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "declarationDir": "./dist", 8 | "outDir": "./dist", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true 14 | }, 15 | "include": ["src"] 16 | } 17 | -------------------------------------------------------------------------------- /fern/llms-txt-worker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@composio/llms-txt-worker", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "build": "echo 'llms.txt generated by parent turbo task'", 7 | "deploy": "wrangler deploy", 8 | "publish": "wrangler deploy", 9 | "dev": "wrangler dev", 10 | "start": "wrangler dev" 11 | }, 12 | "devDependencies": { 13 | "@cloudflare/workers-types": "catalog:", 14 | "typescript": "catalog:", 15 | "wrangler": "catalog:" 16 | } 17 | } -------------------------------------------------------------------------------- /tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "baseUrl": ".", // Required for paths 5 | "paths": { 6 | "@composio/core": ["ts/packages/core/src"] // or wherever your core is 7 | }, 8 | "lib": ["es2022", "DOM"], 9 | "target": "es2022", 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "strict": true, 13 | "skipLibCheck": true, 14 | "noEmitOnError": true 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ts/examples/triggers/src/trigger-types.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio({ 4 | apiKey: process.env.COMPOSIO_API_KEY, 5 | }); 6 | 7 | const triggerTypes = await composio.triggers.listTypes({ 8 | toolkits: ['github'], 9 | limit: 1, 10 | }); 11 | 12 | console.log(JSON.stringify(triggerTypes, null, 2)); 13 | 14 | const triggerType = await composio.triggers.getType('GITHUB_COMMIT_EVENT'); 15 | 16 | console.log(JSON.stringify(triggerType, null, 2)); -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/NamedValue.ts: -------------------------------------------------------------------------------- 1 | import { ValueBuilder } from './ValueBuilder'; 2 | import { Writer } from './Writer'; 3 | 4 | export class NamedValue extends ValueBuilder { 5 | #name: string; 6 | 7 | constructor(name: string) { 8 | super(); 9 | this.#name = name; 10 | } 11 | 12 | override write(writer: Writer): void { 13 | writer.write(this.#name); 14 | } 15 | } 16 | 17 | export function namedValue(name: string): NamedValue { 18 | return new NamedValue(name); 19 | } 20 | -------------------------------------------------------------------------------- /turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turbo.build/schema.json", 3 | "tasks": { 4 | "build": { 5 | "dependsOn": ["^build"], 6 | "outputs": ["dist/"] 7 | }, 8 | "test": { 9 | "dependsOn": ["^build"], 10 | "outputs": ["dist/"] 11 | }, 12 | "clean": { 13 | "cache": false 14 | }, 15 | "typecheck": { 16 | "dependsOn": ["^build"], 17 | "cache": false 18 | }, 19 | "//#clean": { 20 | "cache": false 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ts/packages/cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.options.json", 4 | "compilerOptions": { 5 | "rootDir": ".", 6 | "paths": { 7 | "src/*": ["./src/*"], 8 | "test/*": ["./test/*"], 9 | "~/*": ["./*"], 10 | "effect-errors/*": ["./src/effect-errors/*"] 11 | }, 12 | "types": ["@types/bun", "vitest/importMeta"] 13 | }, 14 | "include": ["src/**/*", "test/**/*", "scripts/**/*", "package.json"] 15 | } 16 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/README.md: -------------------------------------------------------------------------------- 1 | # @composio/ts-builders 2 | 3 | This package provides a set of utilities for programmatically generating TypeScript Abstract Syntax Trees. It is used to generate type stubs for TypeScript projects in the Composio CLI ([@composio/cli](./../cli/README.md)). 4 | 5 | ## Development 6 | 7 | ### Installation 8 | 9 | ```bash 10 | pnpm install 11 | ``` 12 | 13 | ### Build 14 | 15 | ```bash 16 | pnpm build 17 | ``` 18 | 19 | ### Test 20 | 21 | ```bash 22 | pnpm test 23 | ``` 24 | -------------------------------------------------------------------------------- /fern/snippets/migration/old_auth_config.py: -------------------------------------------------------------------------------- 1 | from composio_openai import App, ComposioToolSet 2 | 3 | toolset = ComposioToolSet() 4 | 5 | integration = toolset.create_integration( 6 | app=App.GITHUB, 7 | auth_mode="OAUTH2", 8 | use_composio_oauth_app=True, 9 | # For use_composio_oauth_app=False, you can provide your own OAuth app credentials here 10 | # auth_config={ 11 | # "client_id": "123456", 12 | # "client_secret": "123456" 13 | # } 14 | 15 | ) 16 | print(integration.id) -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/AnyDeclarationBuilder.ts: -------------------------------------------------------------------------------- 1 | import { ClassDeclaration } from './Class'; 2 | import { ConstDeclaration } from './ConstDeclaration'; 3 | import { InterfaceDeclaration } from './Interface'; 4 | import { NamespaceDeclaration } from './NamespaceDeclaration'; 5 | import { TypeDeclaration } from './TypeDeclaration'; 6 | 7 | export type AnyDeclarationBuilder = 8 | | TypeDeclaration 9 | | ConstDeclaration 10 | | InterfaceDeclaration 11 | | ClassDeclaration 12 | | NamespaceDeclaration; 13 | -------------------------------------------------------------------------------- /fern/snippets/migration/providers.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | // import { VercelProvider } from '@composio/vercel'; 3 | 4 | const composio = new Composio({ 5 | // provider: new VercelProvider(), 6 | }); 7 | // Can specify other providers too, like OpenAI, Anthropic, Vercel AI SDK. 8 | 9 | const tools = await composio.tools.get('user@example.com', { 10 | tools: ['LINEAR_CREATE_LINEAR_ISSUE', 'GITHUB_CREATE_COMMIT'], 11 | }); 12 | // tools returned is formatted for the provider. by default, OpenAI. -------------------------------------------------------------------------------- /fern/snippets/tool-calling/typescript/versioning-per-execution.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from "@composio/core"; 2 | 3 | const composio = new Composio({ apiKey: "YOUR_API_KEY" }); 4 | 5 | // Specify version directly in execute call 6 | const result = await composio.tools.execute("GITHUB_LIST_STARGAZERS", { 7 | userId: "user-k7334", 8 | arguments: { 9 | owner: "ComposioHQ", 10 | repo: "composio" 11 | }, 12 | version: "20251027_00" // Override version for this execution 13 | }); 14 | console.log(result); -------------------------------------------------------------------------------- /ts/packages/cli/src/models/utils/extract-actual.ts: -------------------------------------------------------------------------------- 1 | import type { ParseIssue } from 'effect/ParseResult'; 2 | import { inspect } from 'node:util'; 3 | 4 | export function extractActual({ actual }: ParseIssue, cap = 50) { 5 | // Cap the length of the actual value to 50 characters 6 | let str: string; 7 | 8 | if (typeof actual === 'object') { 9 | str = inspect(actual, { depth: 2 }); 10 | } else { 11 | str = String(actual); 12 | } 13 | 14 | return str.slice(0, cap) + (str.length > cap ? '...' : ''); 15 | } 16 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/WellKnownSymbol.ts: -------------------------------------------------------------------------------- 1 | import type { BasicBuilder } from './BasicBuilder'; 2 | import { Writer } from './Writer'; 3 | 4 | export class WellKnownSymbol implements BasicBuilder { 5 | constructor(readonly name: string) {} 6 | write(writer: Writer): void { 7 | writer.write('Symbol.').write(this.name); 8 | } 9 | } 10 | 11 | export function wellKnownSymbol(name: string) { 12 | return new WellKnownSymbol(name); 13 | } 14 | 15 | export const toStringTag = wellKnownSymbol('toStringTag'); 16 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/common/format-title.ts: -------------------------------------------------------------------------------- 1 | import * as color from 'src/ui/colors'; 2 | 3 | export const formatTitle = (errorsCount: number): string[] => { 4 | if (errorsCount === 1) { 5 | return ['']; 6 | } 7 | 8 | const libName = color.bold(`${color.underline(color.redBright('effect-errors'))}`); 9 | const title = color.bold( 10 | color.cyanBright(`${errorsCount} error${errorsCount > 1 ? 's' : ''} occurred`) 11 | ); 12 | 13 | return ['', `❌ ${libName} ❌ ${title}`, '', '']; 14 | }; 15 | -------------------------------------------------------------------------------- /ts/packages/core/test/utils/mocks/client.mock.ts: -------------------------------------------------------------------------------- 1 | import { vi } from 'vitest'; 2 | 3 | export const mockClient = { 4 | tools: { 5 | list: vi.fn(), 6 | retrieve: vi.fn(), 7 | execute: vi.fn(), 8 | retrieveEnum: vi.fn(), 9 | getInput: vi.fn(), 10 | proxy: vi.fn(), 11 | }, 12 | connectedAccounts: { 13 | list: vi.fn(), 14 | get: vi.fn(), 15 | }, 16 | toolkits: { 17 | retrieve: vi.fn(), 18 | }, 19 | toolRouter: { 20 | session: { 21 | executeMeta: vi.fn(), 22 | }, 23 | }, 24 | }; 25 | -------------------------------------------------------------------------------- /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /ts/examples/tool-router/src/logger.ts: -------------------------------------------------------------------------------- 1 | import { ExecuteToolModifiers } from "@composio/core"; 2 | import ora from 'ora'; 3 | let spinner = ora(); 4 | 5 | export const modifiers: ExecuteToolModifiers = { 6 | beforeExecute: ({ toolSlug, params }) => { 7 | spinner = ora(); 8 | spinner.start(`Executing ${toolSlug}`); 9 | console.log(JSON.stringify(params, null, 2)); 10 | return params; 11 | }, 12 | afterExecute: ({ toolSlug, result }) => { 13 | spinner.succeed(`Executed ${toolSlug}`); 14 | return result; 15 | }, 16 | }; -------------------------------------------------------------------------------- /fern/snippets/migration/new_connected_acc.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | linear_auth_config_id = "ac_1234" 4 | user_id = "user@email.com" 5 | composio = Composio() 6 | 7 | # Create a new connected account 8 | connection_request = composio.connected_accounts.initiate( 9 | user_id=user_id, 10 | auth_config_id=linear_auth_config_id, 11 | ) 12 | print(connection_request.redirect_url) 13 | 14 | # Wait for the connection to be established 15 | connected_account = connection_request.wait_for_connection() 16 | print(connected_account) 17 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/parsers/parse-multiple-type.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod/v3'; 2 | 3 | import { parseSchema } from './parse-schema'; 4 | import type { JsonSchema, JsonSchemaObject, Refs } from '../types'; 5 | 6 | export const parseMultipleType = ( 7 | jsonSchema: JsonSchemaObject & { type: string[] }, 8 | refs: Refs 9 | ) => { 10 | return z.union( 11 | jsonSchema.type.map(type => parseSchema({ ...jsonSchema, type } as JsonSchema, refs)) as [ 12 | z.ZodTypeAny, 13 | z.ZodTypeAny, 14 | ] 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /ts/packages/cli/src/services/node-os.ts: -------------------------------------------------------------------------------- 1 | import os from 'node:os'; 2 | import { Effect } from 'effect'; 3 | 4 | // Service to that wraps `node:os`, for testing purposes. 5 | export class NodeOs extends Effect.Service()('services/NodeOs', { 6 | sync: () => ({ 7 | homedir: os.homedir(), 8 | platform: os.platform(), 9 | arch: os.arch(), 10 | }), 11 | dependencies: [], 12 | }) {} 13 | 14 | export const defaultNodeOs = ({ homedir }: { homedir: string }) => 15 | new NodeOs({ homedir, platform: os.platform(), arch: os.arch() }); 16 | -------------------------------------------------------------------------------- /fern/snippets/migration/new_auth_config.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio(); 4 | 5 | const authConfig = await composio.authConfigs.create('LINEAR', { 6 | name: 'Linear', 7 | type: 'use_composio_managed_auth', 8 | // type: "use_custom_auth", 9 | // credentials: { 10 | // client_id: "1234567890", 11 | // client_secret: "1234567890", 12 | // oauth_redirect_uri: "https://backend.composio.dev/api/v3/toolkits/auth/callback", 13 | // }, 14 | }); 15 | 16 | console.log(authConfig); 17 | -------------------------------------------------------------------------------- /fern/snippets/migration/new_execute_tools.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | from openai import OpenAI 3 | 4 | openai_client = OpenAI() 5 | composio = Composio() 6 | 7 | tools = composio.tools.get(user_id="user@acme.com", tools=["GITHUB_GET_THE_ZEN_OF_GITHUB"]) 8 | response = openai_client.chat.completions.create( 9 | model="gpt-4.1", 10 | messages=[{"role": "user", "content": "gimme some zen."}], 11 | tools=tools, 12 | ) 13 | 14 | result = composio.provider.handle_tool_calls(user_id="user@acme.com", response=response) 15 | print(result) 16 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/python/direct-tool-call.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | user_id = "user-k7334" 4 | # Configure toolkit versions at SDK level 5 | composio = Composio( 6 | api_key="your_composio_key", 7 | toolkit_versions={"github": "20251027_00"} 8 | ) 9 | 10 | # Find available arguments for any tool in the Composio dashboard 11 | result = composio.tools.execute( 12 | "GITHUB_LIST_STARGAZERS", 13 | user_id=user_id, 14 | arguments={"owner": "ComposioHQ", "repo": "composio", "page": 1, "per_page": 5} 15 | ) 16 | print(result) -------------------------------------------------------------------------------- /fern/snippets/tool-calling/typescript/file-upload.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | import path from 'path'; 3 | 4 | const composio = new Composio({ 5 | apiKey: 'your-composio-api-key' 6 | }); 7 | 8 | // Upload a local file to Google Drive 9 | const result = await composio.tools.execute('GOOGLEDRIVE_UPLOAD_FILE', { 10 | userId: 'user-4235***', 11 | arguments: { 12 | file_to_upload: path.join(__dirname, 'document.pdf') // Local file path 13 | } 14 | }); 15 | 16 | console.log(result.data); // Contains Google Drive file details 17 | -------------------------------------------------------------------------------- /python/examples/toolkits.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio() 4 | 5 | # List all toolkits 6 | toolkits = composio.toolkits.get() 7 | print(toolkits) 8 | 9 | # Get a toolkit by slug 10 | toolkit = composio.toolkits.get(slug="github") 11 | print(toolkit) 12 | 13 | # List all toolkits categories 14 | categories = composio.toolkits.list_categories() 15 | print(categories) 16 | 17 | # Authorize a user to a toolkit 18 | connection_request = composio.toolkits.authorize(user_id="123", toolkit="github") 19 | print(connection_request) 20 | -------------------------------------------------------------------------------- /context7.json: -------------------------------------------------------------------------------- 1 | { 2 | "projectTitle": "Composio", 3 | "description": "Composio equip's your AI agents & LLMs with 100+ high-quality integrations via function calling", 4 | "folders": ["fern/pages/src", "fern/snippets", "ts", "python"], 5 | "excludeFolders": [], 6 | "excludeFiles": [ 7 | "CHANGELOG.md", 8 | "changelog.md", 9 | "CHANGELOG.mdx", 10 | "changelog.mdx", 11 | "LICENSE.md", 12 | "license.md", 13 | "CODE_OF_CONDUCT.md", 14 | "code_of_conduct.md" 15 | ], 16 | "rules": [], 17 | "previousVersions": [] 18 | } 19 | -------------------------------------------------------------------------------- /ts/examples/triggers/src/create.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio({ 4 | apiKey: process.env.COMPOSIO_API_KEY, 5 | }); 6 | 7 | // fetch a trigger type 8 | const triggerType = await composio.triggers.getType('GMAIL_NEW_GMAIL_MESSAGE'); 9 | 10 | console.log(JSON.stringify(triggerType, null, 2)); 11 | 12 | // create a trigger 13 | const trigger = await composio.triggers.create('default', triggerType.slug, { 14 | connectedAccountId: 'ca_uQvmu9uZOhQo', 15 | triggerConfig: {}, 16 | }); 17 | 18 | console.log(trigger); 19 | -------------------------------------------------------------------------------- /ts/packages/core/src/types/connectionRequest.types.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ConnectedAccountRetrieveResponse, 3 | ConnectedAccountStatus, 4 | } from './connectedAccounts.types'; 5 | 6 | export interface ConnectionRequestState { 7 | id: string; 8 | status?: ConnectedAccountStatus; 9 | redirectUrl?: string | null; 10 | } 11 | 12 | export interface ConnectionRequest extends ConnectionRequestState { 13 | waitForConnection: (timeout?: number) => Promise; 14 | toJSON: () => ConnectionRequestState; 15 | toString: () => string; 16 | } 17 | -------------------------------------------------------------------------------- /fern/snippets/migration/new_tools.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio() 4 | 5 | user_id = "user@acme.org" 6 | 7 | tools_1 = composio.tools.get(user_id=user_id, toolkits=["GITHUB", "LINEAR"]) 8 | 9 | tools_2 = composio.tools.get(user_id=user_id, toolkits=["SLACK"], limit=5) # Default limit=20 10 | 11 | tools_3 = composio.tools.get( 12 | user_id=user_id, 13 | tools=["GITHUB_CREATE_AN_ISSUE", "GITHUB_CREATE_AN_ISSUE_COMMENT", "GITHUB_CREATE_A_COMMIT"], 14 | ) 15 | 16 | tools_4 = composio.tools.get(user_id="john", search="hackernews posts") 17 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/parsers/parse-not.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod/v3'; 2 | 3 | import { parseSchema } from './parse-schema'; 4 | import type { JsonSchemaObject, JsonSchema, Refs } from '../types'; 5 | 6 | export const parseNot = (jsonSchema: JsonSchemaObject & { not: JsonSchema }, refs: Refs) => { 7 | return z.any().refine( 8 | value => 9 | !parseSchema(jsonSchema.not, { 10 | ...refs, 11 | path: [...refs.path, 'not'], 12 | }).safeParse(value).success, 13 | 'Invalid input: Should NOT be valid against schema' 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /fern/generators/tool_doc_generator/base_docs.py: -------------------------------------------------------------------------------- 1 | base_layout = [ 2 | { 3 | "section": "Toolkits", 4 | "skip-slug": True, 5 | "contents": [ 6 | { 7 | "page": "Introduction", 8 | "path": "toolkits/src/introduction.mdx", 9 | "slug": "toolkits/introduction" 10 | }, 11 | { 12 | "page": "Premium Tools", 13 | "path": "toolkits/src/premium-tools.mdx", 14 | "slug": "toolkits/premium-tools" 15 | } 16 | ] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/DocSectionComment.ts: -------------------------------------------------------------------------------- 1 | import type { BasicBuilder } from './BasicBuilder'; 2 | import { Writer } from './Writer'; 3 | 4 | export class DocSectionComment implements BasicBuilder { 5 | constructor(private startingText: string) {} 6 | 7 | write(writer: Writer): void { 8 | const lines = this.startingText.split('\n'); 9 | 10 | for (const line of lines) { 11 | writer.writeLine(line.trimStart()); 12 | } 13 | } 14 | } 15 | 16 | export function docSectionComment(startingText: string) { 17 | return new DocSectionComment(startingText); 18 | } 19 | -------------------------------------------------------------------------------- /python/docs/release.md: -------------------------------------------------------------------------------- 1 | # Creating python package release 2 | 3 | 1. Decide which packages you want to publish 4 | 2. Run `python scripts/bump.py` 5 | 3. This will prompt you with the different packages and the next version, select next version or skip for given package 6 | 4. Create a release PR 7 | 5. Merge and publish a github release 8 | 9 | **NOTES** 10 | 11 | * Since the development is active on `next` branch, only select this branch when creating github release 12 | * While the development is active, only create release-candidate by selecting `pre` when prompted for next version in `bump.py` -------------------------------------------------------------------------------- /fern/llms-txt-worker/tsconfig.options.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "target": "ES2022", 5 | "lib": ["ES2022", "DOM"], 6 | "module": "ES2022", 7 | "moduleResolution": "bundler", 8 | "allowSyntheticDefaultImports": true, 9 | "esModuleInterop": true, 10 | "strict": true, 11 | "skipLibCheck": true, 12 | "pretty": true, 13 | "noImplicitReturns": true, 14 | "noFallthroughCasesInSwitch": true, 15 | "types": ["@cloudflare/workers-types"] 16 | }, 17 | "exclude": ["node_modules", "**/dist"] 18 | } -------------------------------------------------------------------------------- /fern/snippets/triggers/python/trigger-subscription.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | # Initialize Composio client 4 | composio = Composio(api_key="your_api_key_here") 5 | 6 | # Subscribe to trigger events 7 | subscription = composio.triggers.subscribe() 8 | 9 | # Define event handler 10 | @subscription.handle(trigger_id="your_trigger_id") 11 | def handle_github_commit(data): 12 | print(f"New commit detected: {data}") 13 | # Add your custom logic here 14 | 15 | # listen for events on the trigger 16 | subscription.wait_forever() 17 | # Note: For production use, set up webhooks instead 18 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/common/maybe-warn-about-plain-strings.ts: -------------------------------------------------------------------------------- 1 | import * as color from 'src/ui/colors'; 2 | 3 | export const maybeWarnAboutPlainStrings = (isPlainString: boolean): string[] => { 4 | if (!isPlainString) { 5 | return []; 6 | } 7 | 8 | return [ 9 | ' ', 10 | color.gray( 11 | 'ℹ️ You used a plain string to represent a failure in the error channel (E). You should consider using tagged objects (with a _tag field), or yieldable errors such as Data.TaggedError and Schema.TaggedError for better handling experience.' 12 | ), 13 | ]; 14 | }; 15 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/python/proxy-tool.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio(api_key="your_composio_key") 4 | 5 | # Send a proxy request to the endpoint 6 | response = composio.tools.proxy( 7 | endpoint="/repos/composiohq/composio/issues/1", 8 | method="GET", 9 | connected_account_id="ca_jI6********", # use connected account for github 10 | parameters=[ 11 | { 12 | "name": "Accept", 13 | "value": "application/vnd.github.v3+json", 14 | "type": "header", 15 | }, 16 | ], 17 | ) 18 | 19 | print(response) 20 | -------------------------------------------------------------------------------- /python/composio/integration_test/pytest.ini: -------------------------------------------------------------------------------- 1 | [tool:pytest] 2 | # Simple pytest configuration for Composio integration tests 3 | 4 | testpaths = . 5 | python_files = test_*.py 6 | python_classes = Test* 7 | python_functions = test_* 8 | 9 | # Add timeout and other options 10 | # --timeout=120: Each test gets max 2 minutes 11 | # --timeout-method=thread: Use thread-based timeout (works cross-platform) 12 | addopts = -v --tb=short --timeout=120 --timeout-method=thread 13 | 14 | markers = 15 | slow: marks tests as slow (deselect with '-m "not slow"') 16 | integration: marks tests as integration tests 17 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/dependencies/fs/read-json/parse-json.ts: -------------------------------------------------------------------------------- 1 | import { parse } from 'comment-json'; 2 | import { Effect, pipe } from 'effect'; 3 | 4 | import { JsonParsingError } from './json-parsing.error'; 5 | 6 | export const parseJson = (data: string) => 7 | pipe( 8 | Effect.sync(() => parse(data, null, true)), 9 | Effect.catchAll(e => 10 | Effect.fail( 11 | new JsonParsingError({ 12 | cause: e, 13 | }) 14 | ) 15 | ), 16 | Effect.withSpan('parse-json', { 17 | attributes: { 18 | data, 19 | }, 20 | }) 21 | ); 22 | -------------------------------------------------------------------------------- /ts/packages/core/src/services/internal/InternalService.types.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod/v3'; 2 | 3 | export interface ComposioSDKRealtimeCredentialsResponse { 4 | pusher_key: string; 5 | project_id: string; 6 | pusher_cluster: string; 7 | } 8 | 9 | export const SDKRealtimeCredentialsResponseSchema = z.object({ 10 | projectId: z.string().describe('The project ID'), 11 | pusherKey: z.string().describe('The Pusher key'), 12 | pusherCluster: z.string().describe('The Pusher cluster'), 13 | }); 14 | export type SDKRealtimeCredentialsResponse = z.infer; 15 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/typescript-project/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "outDir": "./dist", 7 | "rootDir": "./src", 8 | "paths": { 9 | "src/*": ["./src/*"], 10 | "test/*": ["./test/*"] 11 | }, 12 | "strict": true, 13 | "esModuleInterop": true, 14 | "moduleResolution": "bundler", 15 | "skipLibCheck": true, 16 | "resolveJsonModule": true 17 | }, 18 | "include": ["src"], 19 | "exclude": ["**/dist", "**/node_modules", "test/__fixtures__/**"] 20 | } 21 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/ArraySpread.ts: -------------------------------------------------------------------------------- 1 | import { TypeBuilder } from './TypeBuilder'; 2 | import { Writer } from './Writer'; 3 | import { OperatorPrecedence } from './OperatorPrecedence'; 4 | 5 | export class ArraySpread extends TypeBuilder { 6 | readonly precedence = OperatorPrecedence.ArrayType; 7 | 8 | constructor(private innerType: TypeBuilder) { 9 | super(); 10 | } 11 | write(writer: Writer): void { 12 | writer.write('[...').write(this.innerType).write(']'); 13 | } 14 | } 15 | 16 | export function arraySpread(innerType: TypeBuilder) { 17 | return new ArraySpread(innerType); 18 | } 19 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/typescript/versioning-manage.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from "@composio/core"; 2 | 3 | const composio = new Composio({ apiKey: "YOUR_API_KEY" }); 4 | 5 | // Get toolkit information including available versions 6 | const toolkit = await composio.toolkits.get("github"); 7 | 8 | // Extract and print version information 9 | console.log("Toolkit:", toolkit.name); 10 | console.log("Current Version:", toolkit.meta.version); 11 | console.log("Available Versions:", toolkit.meta.availableVersions); 12 | console.log("Latest Version:", toolkit.meta.availableVersions[0]); // First one is usually the latest -------------------------------------------------------------------------------- /ts/examples/toolkits/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio(); 4 | 5 | const toolkit = await composio.toolkits.get('gmail'); 6 | console.log(toolkit); 7 | 8 | const connectionRequest = await composio.toolkits.authorize('default', 'gmail'); 9 | console.log(connectionRequest.toJSON()); 10 | 11 | const redirectURL = connectionRequest.redirectUrl; 12 | console.log(`Please visit the following URL to authorize the toolkit: ${redirectURL}`); 13 | 14 | const connectedAccount = await connectionRequest.waitForConnection(); 15 | 16 | console.log(connectedAccount); 17 | -------------------------------------------------------------------------------- /python/composio/core/types.py: -------------------------------------------------------------------------------- 1 | """Core types for Composio SDK.""" 2 | 3 | import typing as t 4 | 5 | import typing_extensions as te 6 | 7 | # Tool versioning types 8 | ToolkitLatestVersion = te.Literal["latest"] 9 | ToolkitVersion = t.Union[ 10 | ToolkitLatestVersion, str 11 | ] # Can be "latest" or any version string like "20250906_01" 12 | ToolkitVersions = t.Dict[str, ToolkitVersion] 13 | ToolkitVersionParam = t.Union[ToolkitVersions, ToolkitLatestVersion, None] 14 | 15 | __all__ = [ 16 | "ToolkitLatestVersion", 17 | "ToolkitVersion", 18 | "ToolkitVersions", 19 | "ToolkitVersionParam", 20 | ] 21 | -------------------------------------------------------------------------------- /python/composio/__init__.py: -------------------------------------------------------------------------------- 1 | from .__version__ import __version__ 2 | from .core.models.tools import ( 3 | after_execute, 4 | before_execute, 5 | schema_modifier, 6 | ) 7 | from .core.types import ( 8 | ToolkitLatestVersion, 9 | ToolkitVersion, 10 | ToolkitVersionParam, 11 | ToolkitVersions, 12 | ) 13 | from .sdk import Composio 14 | 15 | __all__ = ( 16 | "Composio", 17 | "after_execute", 18 | "before_execute", 19 | "schema_modifier", 20 | "__version__", 21 | "ToolkitLatestVersion", 22 | "ToolkitVersion", 23 | "ToolkitVersions", 24 | "ToolkitVersionParam", 25 | ) 26 | -------------------------------------------------------------------------------- /ts/examples/cloudflare-wrangler/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cloudflare-wrangler-deploy", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "deploy": "wrangler deploy", 7 | "dev": "wrangler dev", 8 | "start": "wrangler dev", 9 | "test": "vitest", 10 | "cf-typegen": "wrangler types" 11 | }, 12 | "devDependencies": { 13 | "@cloudflare/vitest-pool-workers": "catalog:", 14 | "typescript": "catalog:", 15 | "vitest": "catalog:", 16 | "wrangler": "catalog:" 17 | }, 18 | "dependencies": { 19 | "@composio/core": "workspace:^", 20 | "hono": "^4.10.3", 21 | "openai": "^4.94.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/typescript-project-with-composio-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "esnext", 5 | "declaration": true, 6 | "outDir": "./dist", 7 | "rootDir": "./src", 8 | "paths": { 9 | "src/*": ["./src/*"], 10 | "test/*": ["./test/*"] 11 | }, 12 | "strict": true, 13 | "esModuleInterop": true, 14 | "moduleResolution": "bundler", 15 | "skipLibCheck": true, 16 | "resolveJsonModule": true 17 | }, 18 | "include": ["src"], 19 | "exclude": ["**/dist", "**/node_modules", "test/__fixtures__/**"] 20 | } 21 | -------------------------------------------------------------------------------- /fern/assets/images/anthropic-logo.svg: -------------------------------------------------------------------------------- 1 | 2 | Anthropic 3 | 13 | 14 | -------------------------------------------------------------------------------- /fern/snippets/migration/old_auth_config.ts: -------------------------------------------------------------------------------- 1 | import { OpenAIToolSet } from "composio-core"; 2 | 3 | const composioToolset = new OpenAIToolSet(); 4 | 5 | const integration = await composioToolset.integrations.create({ 6 | name: "gmail_integration", 7 | appUniqueKey: "gmail", 8 | forceNewIntegration: true, 9 | useComposioAuth: false, 10 | // For useComposioAuth: false, you can provide your own OAuth app credentials here 11 | // authScheme: "OAUTH2", 12 | // authConfig: { 13 | // clientId: "123456", 14 | // clientSecret: "123456" 15 | // } 16 | }) 17 | 18 | console.log(integration.id) 19 | -------------------------------------------------------------------------------- /ts/packages/cli/tsconfig.src.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.options.json", 4 | "references": [ 5 | { 6 | "path": "../core" 7 | } 8 | ], 9 | "compilerOptions": { 10 | "outDir": "./dist", 11 | "rootDir": ".", 12 | "baseUrl": ".", 13 | "paths": { 14 | "src/*": ["./src/*"], 15 | "effect-errors/*": ["./src/effect-errors/*"] 16 | }, 17 | "types": ["@types/bun"] 18 | }, 19 | "include": ["src/**/*", "package.json"], 20 | "exclude": ["node_modules", "../../../node_modules", "**/dist", "test/__fixtures__/**"] 21 | } 22 | -------------------------------------------------------------------------------- /fern/components/authors-container.tsx: -------------------------------------------------------------------------------- 1 | export interface Author { 2 | name: string; 3 | imageSrc: string; 4 | } 5 | 6 | export const AuthorsContainer = ({ authors }: { authors: Author[] }) => { 7 | return ( 8 |
9 | {authors.map((author, i) => ( 10 |
11 | {author.name} 16 | {author.name} 17 |
18 | ))} 19 |
20 | ); 21 | }; 22 | -------------------------------------------------------------------------------- /python/providers/langgraph/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-langgraph" 3 | version = "0.10.1" 4 | description = "Use Composio to get array of tools with LangGraph Agent Workflows." 5 | readme = "README.md" 6 | requires-python = ">=3.9,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "langgraph", 17 | ] 18 | 19 | [project.urls] 20 | Homepage = "https://github.com/ComposioHQ/composio" 21 | -------------------------------------------------------------------------------- /ts/packages/cli/src/commands/upgrade.cmd.ts: -------------------------------------------------------------------------------- 1 | import { Command } from '@effect/cli'; 2 | import { Effect } from 'effect'; 3 | import { UpgradeBinary } from 'src/services/upgrade-binary'; 4 | 5 | /** 6 | * CLI command to upgrade the CLI to the latest available version. 7 | * 8 | * @example 9 | * ```bash 10 | * composio upgrade 11 | * ``` 12 | */ 13 | export const upgradeCmd = Command.make('upgrade', {}, () => 14 | Effect.gen(function* () { 15 | const upgradeBinary = yield* UpgradeBinary; 16 | yield* upgradeBinary.upgrade(); 17 | }) 18 | ).pipe(Command.withDescription('Upgrade your Composio CLI to the latest available version.')); 19 | -------------------------------------------------------------------------------- /fern/pages/src/providers/google-adk.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Google ADK Provider 3 | subtitle: Use Composio with Google's ADK 4 | slug: /providers/google-adk 5 | image: "https://og.composio.dev/api/og?title=Google%20ADK%20Provider" # image for socials 6 | keywords: "" 7 | hide-nav-links: false 8 | --- 9 | 10 | - [ ] Pending on Python SDK 11 | 12 | ## Google ADK Provider 13 | 14 | The Google ADK Provider formats the Composio tools into an object compatible with Google's ADK capabilities. Agents and LLM workflows built with this can call and execute the Composio tools. 15 | 16 | ## Setup 17 | 18 | ```typescript TypeScript maxLines=60 wordWrap 19 | 20 | ``` -------------------------------------------------------------------------------- /fern/snippets/migration/new_auth_config.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio() 4 | 5 | # Use composio managed auth 6 | auth_config = composio.auth_configs.create( 7 | toolkit="notion", 8 | options={ 9 | "type": "use_composio_managed_auth", 10 | # "type": "use_custom_auth", 11 | # "auth_scheme": "OAUTH2", 12 | # "credentials": { 13 | # "client_id": "1234567890", 14 | # "client_secret": "1234567890", 15 | # "oauth_redirect_uri": "https://backend.composio.dev/api/v3/toolkits/auth/callback", 16 | # }, 17 | }, 18 | ) 19 | print(auth_config) 20 | -------------------------------------------------------------------------------- /fern/tsconfig.typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2022", 4 | "module": "esnext", 5 | "moduleResolution": "bundler", 6 | "skipLibCheck": true, 7 | "strict": false, 8 | "resolveJsonModule": true, 9 | "declaration": true, 10 | "esModuleInterop": true, 11 | "lib": ["ES2022", "DOM"], 12 | "types": ["node"], 13 | "noEmit": true, 14 | "allowJs": true 15 | }, 16 | "include": [ 17 | "../ts/packages/core/src/**/*.ts" 18 | ], 19 | "exclude": [ 20 | "**/*.test.ts", 21 | "**/*.spec.ts", 22 | "**/test/**", 23 | "**/tests/**", 24 | "**/node_modules/**" 25 | ] 26 | } -------------------------------------------------------------------------------- /python/providers/llamaindex/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-llamaindex" 3 | version = "0.10.1" 4 | description = "Use Composio to get array of tools with LlamaIndex Agent Workflows." 5 | readme = "README.md" 6 | requires-python = ">=3.9,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "llama_index", 17 | ] 18 | 19 | [project.urls] 20 | Homepage = "https://github.com/ComposioHQ/composio" 21 | -------------------------------------------------------------------------------- /ts/packages/core/src/types/pusher.types.ts: -------------------------------------------------------------------------------- 1 | export interface PusherClient { 2 | subscribe: (channelName: string) => PusherChannel; 3 | unsubscribe: (channelName: string) => void; 4 | bind: (event: string, callback: (data: Record) => void) => void; 5 | } 6 | 7 | export interface PusherChannel { 8 | subscribe: (channelName: string) => unknown; 9 | unsubscribe: (channelName: string) => void; 10 | bind: (event: string, callback: (data: Record) => void) => void; 11 | } 12 | 13 | export type TChunkedTriggerData = { 14 | id: string; 15 | index: number; 16 | chunk: string; 17 | final: boolean; 18 | }; 19 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | #Currently set to run every Friday at 06:30 UTC/12:00 IST 7 | version: 2 8 | updates: 9 | - package-ecosystem: "npm" 10 | directory: "/" # Location of package manifests 11 | schedule: 12 | interval: "weekly" 13 | day: "friday" 14 | time: "06:30" 15 | -------------------------------------------------------------------------------- /fern/snippets/migration/old_tools.py: -------------------------------------------------------------------------------- 1 | from composio_openai import ComposioToolSet, Action, App 2 | from openai import OpenAI 3 | 4 | toolset = ComposioToolSet() 5 | client = OpenAI() 6 | 7 | tools = toolset.get_tools( 8 | actions=[Action.GITHUB_GET_THE_AUTHENTICATED_USER], check_connected_accounts=True 9 | ) 10 | 11 | tools = toolset.get_tools(apps=[App.GITHUB, App.LINEAR, App.SLACK], check_connected_accounts=True) 12 | 13 | messages = [...] 14 | response = client.chat.completions.create( 15 | model="gpt-4o-mini", 16 | messages=messages, 17 | tools=tools, 18 | ) 19 | 20 | result = toolset.handle_tool_calls(response) 21 | print(result) 22 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/typescript/proxy-tool.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio({apiKey: "your_composio_key"}); 4 | 5 | // Send a proxy request to the endpoint 6 | const { data } = await composio.tools.proxyExecute({ 7 | endpoint:'/repos/composiohq/composio/issues/1', 8 | method: 'GET', 9 | connectedAccountId: 'ca_jI*****', // use connected account for github 10 | parameters:[ 11 | { 12 | "name": "Accept", 13 | "value": "application/vnd.github.v3+json", 14 | "in": "header", 15 | }, 16 | ], 17 | }); 18 | 19 | console.log(data); 20 | -------------------------------------------------------------------------------- /fern/llms-txt-worker/turbo.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://turbo.build/schema.json", 3 | "extends": [ 4 | "//" 5 | ], 6 | "tasks": { 7 | "build": { 8 | "cache": false 9 | }, 10 | "publish": { 11 | "dependsOn": [ 12 | "^build" 13 | ], 14 | "cache": false, 15 | "env": [ 16 | "CLOUDFLARE_API_TOKEN", 17 | "CLOUDFLARE_ACCOUNT_ID" 18 | ] 19 | }, 20 | "deploy": { 21 | "dependsOn": [ 22 | "^build" 23 | ], 24 | "cache": false, 25 | "env": [ 26 | "CLOUDFLARE_API_TOKEN", 27 | "CLOUDFLARE_ACCOUNT_ID" 28 | ] 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /python/providers/crewai/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-crewai" 3 | version = "0.10.1" 4 | description = "Use Composio to get an array of tools with your CrewAI agent." 5 | readme = "README.md" 6 | requires-python = ">=3.9,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "crewai>=0.51.0", 17 | "composio", 18 | ] 19 | 20 | [project.urls] 21 | Homepage = "https://github.com/ComposioHQ/composio" 22 | -------------------------------------------------------------------------------- /python/providers/gemini/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-gemini" 3 | version = "0.10.1" 4 | description = "Use Composio to get an array of tools with your Gemini agent." 5 | readme = "README.md" 6 | requires-python = ">=3.9,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "google-genai", 17 | "composio", 18 | ] 19 | 20 | [project.urls] 21 | Homepage = "https://github.com/ComposioHQ/composio" 22 | -------------------------------------------------------------------------------- /python/providers/openai/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-openai" 3 | version = "0.10.1" 4 | description = "Use Composio to get an array of tools with your OpenAI Function Call." 5 | readme = "README.md" 6 | requires-python = ">=3.9,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "openai", 17 | "composio", 18 | ] 19 | 20 | [project.urls] 21 | Homepage = "https://github.com/ComposioHQ/composio" 22 | -------------------------------------------------------------------------------- /ts/examples/cjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cjs-example", 3 | "type": "commonjs", 4 | "private": true, 5 | "version": "0.1.0", 6 | "description": "Example project for CommonJS", 7 | "main": "src/index.ts", 8 | "scripts": { 9 | "start": "node ./src/index.cjs" 10 | }, 11 | "keywords": ["composio", "example", "cjs"], 12 | "author": "", 13 | "license": "ISC", 14 | "packageManager": "pnpm@10.17.0", 15 | "dependencies": { 16 | "@composio/core": "workspace:*", 17 | "dotenv": "^16.4.1", 18 | "zod": "catalog:" 19 | }, 20 | "devDependencies": { 21 | "@types/bun": "^1.2.9", 22 | "typescript": "catalog:" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fern/snippets/triggers/python/triggers.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio(api_key="your-api-key") 4 | user_id = "user-id-123435" 5 | 6 | # Check what configuration is required 7 | trigger_type = composio.triggers.get_type("GITHUB_COMMIT_EVENT") 8 | print(trigger_type.config) 9 | # Returns: {"properties": {...}, "required": ["owner", "repo"], ...} 10 | 11 | # Create trigger with the required config 12 | trigger = composio.triggers.create( 13 | slug="GITHUB_COMMIT_EVENT", 14 | user_id=user_id, 15 | trigger_config={"owner": "your-repo-owner", "repo": "your-repo-name"}, 16 | ) 17 | print(f"Trigger created: {trigger.trigger_id}") 18 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/sourcemaps/get-error-location-from-file-path.ts: -------------------------------------------------------------------------------- 1 | import { sourceFileWithMapPointerRegex } from 'effect-errors/logic/stack'; 2 | 3 | export interface ErrorLocation { 4 | filePath: string; 5 | line: number; 6 | column: number; 7 | } 8 | 9 | export const getErrorLocationFrom = (sourceFile: string): ErrorLocation | undefined => { 10 | const regex = sourceFileWithMapPointerRegex.exec(sourceFile); 11 | if (regex === null || regex.length !== 7) { 12 | return; 13 | } 14 | 15 | const filePath = regex[2]; 16 | const line = +regex[5]; 17 | const column = +regex[6]; 18 | 19 | return { filePath, line, column }; 20 | }; 21 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/typescript-project-with-composio-core/bun.lock: -------------------------------------------------------------------------------- 1 | { 2 | "lockfileVersion": 1, 3 | "workspaces": { 4 | "": { 5 | "dependencies": { 6 | "@composio/core": "link:../../../../core", 7 | }, 8 | "devDependencies": { 9 | "typescript": "^5.9.2", 10 | }, 11 | }, 12 | }, 13 | "packages": { 14 | "@composio/core": ["@composio/core@link:../../../../core", {}], 15 | 16 | "typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="], 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fern/components/secondary-title-container.tsx: -------------------------------------------------------------------------------- 1 | import { PropsWithChildren } from "react"; 2 | 3 | interface SecondaryTitleContainerProps { 4 | id?: string; 5 | title: string; 6 | description: string; 7 | } 8 | 9 | export function SecondaryTitleContainer({ 10 | id, 11 | title, 12 | description, 13 | children, 14 | }: PropsWithChildren) { 15 | return ( 16 |
17 |

18 | {title} 19 |

20 |

{description}

21 | {children} 22 |
23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /python/providers/anthropic/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-anthropic" 3 | version = "0.10.1" 4 | description = "Use Composio to get an array of tools with your Anthropic LLMs." 5 | readme = "README.md" 6 | requires-python = ">=3.10,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "anthropic>=0.25.7", 17 | "composio", 18 | ] 19 | 20 | [project.urls] 21 | Homepage = "https://github.com/ComposioHQ/composio" 22 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/common/format-spans-attribute.ts: -------------------------------------------------------------------------------- 1 | import * as color from 'src/ui/colors'; 2 | 3 | const maybePrintPipe = (isLastEntry: boolean) => (isLastEntry ? ' ' : color.gray('│')); 4 | 5 | export const formatSpanAttributes = (attributes: Record, isLastEntry: boolean) => { 6 | const entries = Object.entries(attributes); 7 | if (entries.length === 0) { 8 | return []; 9 | } 10 | 11 | const lines = Array.from(entries).map( 12 | ([key, value]) => 13 | `${maybePrintPipe(isLastEntry)} ${color.white(key)}${color.gray(':')} ${value}` 14 | ); 15 | 16 | return `\r\n${lines.join('\r\n')}`; 17 | }; 18 | -------------------------------------------------------------------------------- /ts/packages/cli/tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "extends": "./tsconfig.options.json", 4 | "references": [ 5 | { 6 | "path": "../core" 7 | } 8 | ], 9 | "compilerOptions": { 10 | "rootDir": ".", 11 | "baseUrl": ".", 12 | "paths": { 13 | "src/*": ["./src/*"], 14 | "effect-errors/*": ["./src/effect-errors/*"], 15 | "test/*": ["./test/*"] 16 | }, 17 | "types": ["@types/bun", "vitest/importMeta"] 18 | }, 19 | "include": ["src/**/*", "test/**/*", "package.json"], 20 | "exclude": ["node_modules", "../../../node_modules", "**/dist", "test/__fixtures__/**"] 21 | } 22 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/KeyofType.ts: -------------------------------------------------------------------------------- 1 | import { TypeBuilder } from './TypeBuilder'; 2 | import { Writer } from './Writer'; 3 | import { OperatorPrecedence, TypeContext } from './OperatorPrecedence'; 4 | 5 | export class KeyofType extends TypeBuilder { 6 | readonly precedence = OperatorPrecedence.KeyofType; 7 | 8 | constructor(public baseType: TypeBuilder) { 9 | super(); 10 | } 11 | 12 | write(writer: Writer): void { 13 | writer.write(`keyof `); 14 | this.baseType.writeInContext(writer, TypeContext.KeyofOperand); 15 | } 16 | } 17 | 18 | export function keyOfType(baseType: TypeBuilder): KeyofType { 19 | return new KeyofType(baseType); 20 | } 21 | -------------------------------------------------------------------------------- /fern/snippets/migration/new_tools.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const userId = 'user@acme.org'; 4 | 5 | const composio = new Composio(); 6 | 7 | const tools_1 = await composio.tools.get(userId, { 8 | toolkits: ['GITHUB', 'LINEAR'], 9 | }); 10 | 11 | const tools_2 = await composio.tools.get(userId, { 12 | toolkits: ['GITHUB'], 13 | limit: 5, // Default limit=20 14 | }); 15 | 16 | const tools_3 = await composio.tools.get(userId, { 17 | tools: ['GITHUB_CREATE_AN_ISSUE', 'GITHUB_CREATE_AN_ISSUE_COMMENT', 'GITHUB_CREATE_A_COMMIT'], 18 | }); 19 | 20 | const tools_4 = await composio.tools.get(userId, { 21 | search: 'hackernews posts', 22 | }); 23 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/ArrayType.ts: -------------------------------------------------------------------------------- 1 | import { TypeBuilder } from './TypeBuilder'; 2 | import { Writer } from './Writer'; 3 | import { OperatorPrecedence, TypeContext } from './OperatorPrecedence'; 4 | 5 | export class ArrayType extends TypeBuilder { 6 | readonly precedence = OperatorPrecedence.ArrayType; 7 | 8 | constructor(private elementType: TypeBuilder) { 9 | super(); 10 | } 11 | 12 | write(writer: Writer): void { 13 | this.elementType.writeInContext(writer, TypeContext.ArrayElement); 14 | writer.write('[]'); 15 | } 16 | } 17 | 18 | export function array(elementType: TypeBuilder): ArrayType { 19 | return new ArrayType(elementType); 20 | } 21 | -------------------------------------------------------------------------------- /fern/snippets/migration/new_connected_acc.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from "@composio/core"; 2 | 3 | const composio = new Composio(); 4 | const linearAuthConfigId = "ac_1234"; 5 | const userId = "user@email.com"; 6 | 7 | // Initiate the OAuth connection request 8 | const connRequest = await composio.connectedAccounts.initiate(userId, linearAuthConfigId); 9 | 10 | const { redirectUrl, id } = connRequest; 11 | console.log(redirectUrl); 12 | 13 | // Wait for the connection to be established 14 | await connRequest.waitForConnection(); 15 | 16 | // If you only have the connection request ID, you can also wait using: 17 | await composio.connectedAccounts.waitForConnection(id); 18 | 19 | -------------------------------------------------------------------------------- /python/providers/google_adk/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-google-adk" 3 | version = "0.10.1" 4 | description = "Use Composio to get an array of tools with your Google AI Python Gemini model." 5 | readme = "README.md" 6 | requires-python = ">=3.9,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "google-adk", 17 | "composio", 18 | ] 19 | 20 | [project.urls] 21 | Homepage = "https://github.com/ComposioHQ/composio" 22 | -------------------------------------------------------------------------------- /python/providers/langchain/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-langchain" 3 | version = "0.10.1" 4 | description = "Use Composio to get an array of tools with your Langchain agent." 5 | readme = "README.md" 6 | requires-python = ">=3.9,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "langchain>=1.1.0,<2.0.0", 17 | "composio", 18 | ] 19 | 20 | [project.urls] 21 | Homepage = "https://github.com/ComposioHQ/composio" 22 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/TypeOf.ts: -------------------------------------------------------------------------------- 1 | import { TypeBuilder } from './TypeBuilder'; 2 | import type { Writer } from './Writer'; 3 | import { OperatorPrecedence, TypeContext } from './OperatorPrecedence'; 4 | 5 | export class TypeofType extends TypeBuilder { 6 | readonly precedence = OperatorPrecedence.TypeofType; 7 | 8 | constructor(public baseType: TypeBuilder) { 9 | super(); 10 | } 11 | 12 | write(writer: Writer): void { 13 | writer.write(`typeof `); 14 | this.baseType.writeInContext(writer, TypeContext.TypeofOperand); 15 | } 16 | } 17 | 18 | export function typeOfType(baseType: TypeBuilder): TypeofType { 19 | return new TypeofType(baseType); 20 | } 21 | -------------------------------------------------------------------------------- /python/providers/openai_agents/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-openai-agents" 3 | version = "0.10.1" 4 | description = "Use Composio to get array of strongly typed tools for OpenAI Agents" 5 | readme = "README.md" 6 | requires-python = ">=3.9,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "openai-agents>=0.0.3", 17 | "composio", 18 | ] 19 | 20 | [project.urls] 21 | Homepage = "https://github.com/ComposioHQ/composio" 22 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/pretty-print/common/format-error-title.ts: -------------------------------------------------------------------------------- 1 | import * as color from 'src/ui/colors'; 2 | 3 | export const formatErrorTitle = ( 4 | errorType: unknown, 5 | message: unknown, 6 | failuresLength: number, 7 | failureIndex: number 8 | ): string[] => { 9 | const failuresCount = 10 | failuresLength > 1 ? color.bgRed(color.white(` #${failureIndex + 1} -`)) : ''; 11 | const type = color.bgRed( 12 | color.white(` ${(errorType as string | undefined) ?? 'Unknown error'} `) 13 | ); 14 | const formattedMessage = color.bold(color.white(` • ${message as string}`)); 15 | 16 | return [`💥 ${failuresCount}${type}${formattedMessage}`]; 17 | }; 18 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/typescript/direct-tool-call.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from "@composio/core"; 2 | 3 | const userId = "user-k7334"; 4 | // Configure toolkit versions at SDK level 5 | const composio = new Composio({ 6 | apiKey: "your_composio_key", 7 | toolkitVersions: { github: "20251027_00" } 8 | }); 9 | 10 | // Find available arguments for any tool in the Composio dashboard 11 | const result = await composio.tools.execute("GITHUB_LIST_STARGAZERS", { 12 | userId, 13 | arguments: { 14 | "owner": "ComposioHQ", 15 | "repo": "composio", 16 | "page": 1, 17 | "per_page": 5 18 | }, 19 | }); 20 | console.log('GitHub stargazers:', JSON.stringify(result, null, 2)); -------------------------------------------------------------------------------- /python/examples/tool_router/claude_agent.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | from claude_agent_sdk import query, ClaudeAgentOptions 3 | import asyncio 4 | 5 | composio = Composio() 6 | session = composio.create( 7 | user_id="user_123", 8 | ) 9 | 10 | 11 | async def main(): 12 | options = ClaudeAgentOptions( 13 | system_prompt="You are an expert Python developer", 14 | permission_mode="bypassPermissions", 15 | mcp_servers={"composio": session.mcp}, 16 | ) 17 | 18 | async for message in query( 19 | prompt="Fetch my last email and summarize it.", options=options 20 | ): 21 | print(message) 22 | 23 | 24 | asyncio.run(main()) 25 | -------------------------------------------------------------------------------- /ts/examples/error-handling-demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "error-handling-example", 3 | "private": true, 4 | "version": "0.1.10-alpha.0", 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "clean": "git clean -xdf node_modules", 9 | "start": "bun src/index.ts", 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "packageManager": "pnpm@10.17.0", 16 | "dependencies": { 17 | "@composio/core": "workspace:*", 18 | "dotenv": "^16.5.0" 19 | }, 20 | "devDependencies": { 21 | "@types/bun": "^1.2.9", 22 | "typescript": "catalog:" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ts/packages/cli/src/models/utils/json-transform-schema.ts: -------------------------------------------------------------------------------- 1 | import { Schema, ParseResult } from 'effect'; 2 | 3 | export function JSONTransformSchema(to: To) { 4 | return Schema.transformOrFail(Schema.String, to, { 5 | strict: true, 6 | encode: (obj, _options, ast) => 7 | ParseResult.try({ 8 | try: () => JSON.stringify(obj), 9 | catch: e => new ParseResult.Type(ast, obj, (e as Error).message), 10 | }), 11 | decode: (str, _options, ast) => 12 | ParseResult.try({ 13 | try: () => JSON.parse(str), 14 | catch: e => new ParseResult.Type(ast, str, (e as Error).message), 15 | }), 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /.pnpmfile.cjs: -------------------------------------------------------------------------------- 1 | /** 2 | * Alias manager for pnpm. 3 | */ 4 | function readPackage(pkg, context) { 5 | if (pkg.dependencies) { 6 | // Note: you can use this to alias `@composio/client` to a preview Stainless package URL for local testing. 7 | // if ('@composio/client' in pkg.dependencies) { 8 | // const url = 'https://pkg.stainless.com/s/composio-sdk-typescript/4a53e1ae40ca5a0a3479727eb59d2512110c81cc' 9 | // pkg.dependencies['@composio/client'] = url 10 | // context.log(`@composio/client => ${url} in dependencies of ${pkg.name}`) 11 | // } 12 | } 13 | 14 | return pkg 15 | } 16 | 17 | module.exports = { 18 | hooks: { 19 | readPackage 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/python/checking-connection-status.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | 3 | composio = Composio(api_key="your_api_key") 4 | 5 | # Get a specific connected account 6 | connected_account = composio.connected_accounts.get("your_connected_account_id") 7 | print(f"Status: {connected_account.status}") 8 | 9 | # Filter connections by user_id, auth_config_id, and status (only active accounts) 10 | filtered_connections = composio.connected_accounts.list( 11 | user_ids=["user_123"], 12 | auth_config_ids=["your_auth_config_id"], 13 | statuses=["ACTIVE"] 14 | ) 15 | for connection in filtered_connections.items: 16 | print(f"{connection.id}: {connection.status}") 17 | -------------------------------------------------------------------------------- /python/providers/google/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-google" 3 | version = "0.10.1" 4 | description = "Use Composio to get an array of tools with your Google AI Python Gemini model." 5 | readme = "README.md" 6 | requires-python = ">=3.9,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "google-cloud-aiplatform>=1.38.0", 17 | "composio", 18 | ] 19 | 20 | [project.urls] 21 | Homepage = "https://github.com/ComposioHQ/composio" 22 | -------------------------------------------------------------------------------- /ts/examples/connected-accounts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "connected-accounts-example", 3 | "private": true, 4 | "version": "0.1.10-alpha.0", 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "clean": "git clean -xdf node_modules", 9 | "start": "bun src/index.ts", 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "packageManager": "pnpm@10.17.0", 16 | "dependencies": { 17 | "@composio/core": "workspace:*", 18 | "openai": "^4.94.0" 19 | }, 20 | "devDependencies": { 21 | "@types/bun": "^1.2.9", 22 | "typescript": "catalog:" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/logic/errors/capture-errors-from-cause.ts: -------------------------------------------------------------------------------- 1 | import { type Cause, reduceWithContext } from 'effect/Cause'; 2 | 3 | import type { PrettyError } from 'effect-errors/types'; 4 | 5 | import { parseError } from './parse-error'; 6 | 7 | export const captureErrorsFrom = (cause: Cause): readonly PrettyError[] => 8 | reduceWithContext(cause, undefined, { 9 | emptyCase: (): readonly PrettyError[] => [], 10 | dieCase: (_, unknownError) => [parseError(unknownError)], 11 | failCase: (_, error) => [parseError(error)], 12 | interruptCase: () => [], 13 | parallelCase: (_, l, r) => [...l, ...r], 14 | sequentialCase: (_, l, r) => [...l, ...r], 15 | }); 16 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/tsconfig.options.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "es2022", 6 | "lib": ["es2022", "DOM"], 7 | "declaration": true, 8 | "outDir": "./dist", 9 | "rootDir": ".", 10 | "strict": true, 11 | "esModuleInterop": true, 12 | "moduleResolution": "bundler", 13 | "skipLibCheck": true, 14 | "resolveJsonModule": true, 15 | "pretty": true, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true, 18 | "noUnusedLocals": false, 19 | "noUnusedParameters": false 20 | }, 21 | "exclude": ["node_modules", "**/dist"] 22 | } 23 | -------------------------------------------------------------------------------- /fern/snippets/triggers/typescript/trigger-subscription.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | // Initialize Composio client 4 | const composio = new Composio({ apiKey: "your_api_key_here" }); 5 | 6 | // Subscribe to trigger events 7 | composio.triggers.subscribe( 8 | (data) => { 9 | console.log(`New commit detected:`, data); 10 | // Add your custom logic here 11 | }, 12 | { triggerId: 'your_trigger_id' 13 | // userId: 'user@acme.com', 14 | // toolkits: ['github', 'slack'], 15 | // triggerSlug: ["GITHUB_STAR_ADDED_EVENT"] 16 | // authConfigId: "ac_1234567890" } 17 | } 18 | ); 19 | 20 | // Note: For production use, set up webhooks instead -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/dependencies/fs/read-json/read-json.ts: -------------------------------------------------------------------------------- 1 | import { FileSystem } from '@effect/platform/FileSystem'; 2 | import { Effect, pipe } from 'effect'; 3 | 4 | import { parseJson } from './parse-json'; 5 | 6 | export const readJsonEffect = (filePath: string) => 7 | pipe( 8 | Effect.gen(function* () { 9 | const { readFileString } = yield* FileSystem; 10 | const data = yield* readFileString(filePath, 'utf8'); 11 | 12 | if (data.length === 0) { 13 | return null; 14 | } 15 | 16 | const json = yield* parseJson(data); 17 | 18 | return json as TJson; 19 | }), 20 | Effect.withSpan('read-json', { attributes: { filePath } }) 21 | ); 22 | -------------------------------------------------------------------------------- /ts/packages/core/src/errors/FileModifierErrors.ts: -------------------------------------------------------------------------------- 1 | import { ComposioError, ComposioErrorOptions } from './ComposioError'; 2 | 3 | export const FileModifierErrorCodes = { 4 | FILE_UPLOAD_FAILED: 'FILE_UPLOAD_FAILED', 5 | } as const; 6 | 7 | export class ComposioFileUploadError extends ComposioError { 8 | constructor( 9 | message: string = 'Failed to upload file', 10 | options: Omit = {} 11 | ) { 12 | super(message, { 13 | ...options, 14 | code: FileModifierErrorCodes.FILE_UPLOAD_FAILED, 15 | possibleFixes: options.possibleFixes || ['Check if the file exists in the location provided'], 16 | }); 17 | this.name = 'ComposioFileUploadError'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ts/examples/langchain/src/openai.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | import { LangchainProvider } from '@composio/langchain'; 3 | import { createAgent } from "langchain"; 4 | import { ChatOpenAI } from '@langchain/openai'; 5 | 6 | // initiate composio 7 | const composio = new Composio({ 8 | provider: new LangchainProvider(), 9 | }); 10 | 11 | const githubTool = await composio.tools.get('jkomyno', 'GMAIL_FETCH_EMAILS'); 12 | 13 | const agent = createAgent({ 14 | model: new ChatOpenAI({ model: "gpt-5" }), 15 | tools: githubTool, 16 | }); 17 | 18 | console.log( 19 | await agent.invoke({ 20 | messages: [{ role: "user", content: "Provide a summary of my last email received." }], 21 | }) 22 | ); -------------------------------------------------------------------------------- /ts/examples/versioning/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "versioning-example", 3 | "private": true, 4 | "version": "0.1.0", 5 | "description": "Example project for Versioning", 6 | "main": "src/index.ts", 7 | "scripts": { 8 | "start": "bun src/index.ts", 9 | "dev": "bun --watch src/index.ts", 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": ["composio", "example", "versioning"], 13 | "author": "", 14 | "license": "ISC", 15 | "packageManager": "pnpm@10.17.0", 16 | "dependencies": { 17 | "@composio/core": "workspace:*", 18 | "dotenv": "^16.4.1" 19 | }, 20 | "devDependencies": { 21 | "@types/bun": "^1.2.9", 22 | "typescript": "catalog:" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /python/providers/autogen/pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "composio-autogen" 3 | version = "0.10.1" 4 | description = "Use Composio to get an array of tools with your autogen agent." 5 | readme = "README.md" 6 | requires-python = ">=3.9,<4" 7 | authors = [ 8 | { name = "Composio", email = "tech@composio.dev" } 9 | ] 10 | classifiers = [ 11 | "Programming Language :: Python :: 3", 12 | "License :: OSI Approved :: Apache Software License", 13 | "Operating System :: OS Independent", 14 | ] 15 | dependencies = [ 16 | "pyautogen>=0.2.19", 17 | "flaml==2.2.0", 18 | "autogen_core>=0.4.0", 19 | "autogen_agentchat>=0.4.0" 20 | ] 21 | 22 | [project.urls] 23 | Homepage = "https://github.com/ComposioHQ/composio" 24 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/tsconfig.options.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "target": "es2022", 5 | "module": "esnext", 6 | "declaration": true, 7 | "outDir": "./dist", 8 | "rootDir": ".", 9 | "strict": true, 10 | "esModuleInterop": true, 11 | "moduleResolution": "bundler", 12 | "skipLibCheck": true, 13 | "resolveJsonModule": true, 14 | "verbatimModuleSyntax": true, 15 | "pretty": true, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true, 18 | "noUnusedLocals": false, 19 | "noUnusedParameters": false 20 | }, 21 | "include": ["src"], 22 | "exclude": ["**/dist", "test/__fixtures__/**"] 23 | } 24 | -------------------------------------------------------------------------------- /ts/examples/file-handling/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "file-handling-example", 3 | "private": true, 4 | "version": "0.1.0", 5 | "description": "Example project for File-handling", 6 | "main": "src/index.ts", 7 | "scripts": { 8 | "start": "bun src/index.ts", 9 | "dev": "bun --watch src/index.ts", 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": ["composio", "example", "file-handling"], 13 | "author": "", 14 | "license": "ISC", 15 | "packageManager": "pnpm@10.17.0", 16 | "dependencies": { 17 | "@composio/core": "workspace:*", 18 | "dotenv": "^16.4.1" 19 | }, 20 | "devDependencies": { 21 | "@types/bun": "^1.2.9", 22 | "typescript": "catalog:" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/ConstDeclaration.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, test } from 'vitest'; 2 | 3 | import { constDeclaration } from './ConstDeclaration'; 4 | import { docComment } from './DocComment'; 5 | import { namedType } from './NamedType'; 6 | import { stringify } from './stringify'; 7 | 8 | const A = namedType('A'); 9 | 10 | test('basic', () => { 11 | expect(stringify(constDeclaration('B', A))).toMatchInlineSnapshot(`"const B: A"`); 12 | }); 13 | 14 | test('with doc comment', () => { 15 | const decl = constDeclaration('B', A).setDocComment(docComment('Some important value')); 16 | expect(stringify(decl)).toMatchInlineSnapshot(` 17 | "/** 18 | * Some important value 19 | */ 20 | const B: A" 21 | `); 22 | }); 23 | -------------------------------------------------------------------------------- /python/config/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | exclude = ^(apps/composio/|utils/|\.nox/|.*/setup\.py|.*/build/|examples/|.*demo.*) 3 | strict_optional=True 4 | disable_error_code=var-annotated 5 | 6 | 7 | ; Only add packages which does not have type-stub package 8 | [mypy-pysher.*] 9 | ignore_missing_imports=true 10 | 11 | [mypy-crewai.*] 12 | ignore_missing_imports=true 13 | 14 | [mypy-vertexai.*] 15 | ignore_missing_imports=true 16 | 17 | [mypy-google.adk.*] 18 | ignore_missing_imports=true 19 | 20 | [mypy-google.genai.*] 21 | ignore_missing_imports=true 22 | 23 | [mypy-proto.marshal.collections.maps] 24 | ignore_missing_imports=true 25 | 26 | [mypy-autogen.*] 27 | ignore_missing_imports=true 28 | 29 | [mypy-autogen_core.*] 30 | ignore_missing_imports=true -------------------------------------------------------------------------------- /fern/packages/snippet-tester/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "lib": ["ESNext"], 5 | "module": "esnext", 6 | "moduleResolution": "bundler", 7 | "types": ["bun-types"], 8 | "skipLibCheck": true, 9 | "resolveJsonModule": true, 10 | "allowImportingTsExtensions": true, 11 | "isolatedModules": true, 12 | "noEmit": true, 13 | "strict": true, 14 | "noUnusedLocals": true, 15 | "noUnusedParameters": true, 16 | "noFallthroughCasesInSwitch": true, 17 | "outDir": "dist", 18 | "declaration": true, 19 | "esModuleInterop": true, 20 | "forceConsistentCasingInFileNames": true 21 | }, 22 | "include": ["src/**/*"], 23 | "exclude": ["node_modules", "dist"] 24 | } -------------------------------------------------------------------------------- /ts/examples/cjs/README.md: -------------------------------------------------------------------------------- 1 | # CJS Example 2 | 3 | This example demonstrates how to use Composio SDK with CommonJS. 4 | 5 | ## Setup 6 | 7 | 1. **Install dependencies:** 8 | ```bash 9 | pnpm install 10 | ``` 11 | 12 | 2. **Configure environment:** 13 | ```bash 14 | cp .env.example .env 15 | ``` 16 | 17 | Then edit `.env` and add your API keys: 18 | - `COMPOSIO_API_KEY`: Get it from [Composio Dashboard](https://app.composio.dev) 19 | 20 | ## Running the Example 21 | 22 | ```bash 23 | # Run the example 24 | pnpm start 25 | ``` 26 | 27 | ## Support 28 | 29 | - [Documentation](https://docs.composio.dev) 30 | - [Discord Community](https://discord.gg/composio) 31 | - [GitHub Issues](https://github.com/composio/composio/issues) 32 | -------------------------------------------------------------------------------- /ts/packages/cli/src/commands/version.cmd.ts: -------------------------------------------------------------------------------- 1 | import { Command } from '@effect/cli'; 2 | import { Effect, Console } from 'effect'; 3 | import { getVersion } from 'src/effects/version'; 4 | 5 | /** 6 | * CLI command to display the version of the Composio CLI. 7 | * 8 | * @example 9 | * ```bash 10 | * composio version 11 | * ``` 12 | */ 13 | export const versionCmd = Command.make('version', {}).pipe( 14 | Command.withDescription('Display your account information.'), 15 | Command.withHandler(() => 16 | Effect.gen(function* () { 17 | const version = yield* getVersion; 18 | yield* Console.log(`${version}`); 19 | 20 | yield* Effect.logDebug('Composio CLI version command executed successfully.'); 21 | }) 22 | ) 23 | ); 24 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effects/with-log-level.ts: -------------------------------------------------------------------------------- 1 | import { Effect, Option, Logger, LogLevel, Layer } from 'effect'; 2 | import { APP_CONFIG } from 'src/effects/app-config'; 3 | 4 | /** 5 | * Sets the minimum log level for subsequent logging operation, preferring the given log level, 6 | * and falling back to the one read from the config. 7 | */ 8 | export const setMinimumLogLevel = (logLevelFromCLI: Option.Option) => 9 | APP_CONFIG['LOG_LEVEL'].pipe( 10 | Effect.map(logLevelFromEnv => { 11 | return Option.zipLeft(logLevelFromCLI, logLevelFromEnv); 12 | }), 13 | Effect.map(Option.getOrElse(() => LogLevel.Info)), 14 | Effect.map(logLevel => Logger.minimumLogLevel(logLevel)), 15 | Layer.unwrapEffect 16 | ); 17 | -------------------------------------------------------------------------------- /ts/examples/modifiers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "modifiers-example", 3 | "private": true, 4 | "version": "0.1.10-alpha.0", 5 | "description": "", 6 | "main": "src/index.ts", 7 | "scripts": { 8 | "clean": "git clean -xdf node_modules", 9 | "start": "bun src/index.ts", 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "packageManager": "pnpm@10.17.0", 16 | "dependencies": { 17 | "@ai-sdk/openai": "^1.3.16", 18 | "@composio/core": "workspace:*", 19 | "@composio/vercel": "workspace:*", 20 | "ai": "catalog:" 21 | }, 22 | "devDependencies": { 23 | "@types/bun": "^1.2.9", 24 | "typescript": "catalog:" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ts/examples/toolkits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "toolkits-example", 3 | "private": true, 4 | "version": "0.1.10-alpha.0", 5 | "description": "", 6 | "main": "src/index.ts", 7 | "scripts": { 8 | "clean": "git clean -xdf node_modules", 9 | "start": "bun src/index.ts", 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [], 13 | "author": "", 14 | "license": "ISC", 15 | "packageManager": "pnpm@10.17.0", 16 | "dependencies": { 17 | "@ai-sdk/openai": "^1.3.16", 18 | "@composio/core": "workspace:*", 19 | "@composio/vercel": "workspace:*", 20 | "ai": "catalog:" 21 | }, 22 | "devDependencies": { 23 | "@types/bun": "^1.2.9", 24 | "typescript": "catalog:" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fern/snippets/providers/python/google.py: -------------------------------------------------------------------------------- 1 | from composio import Composio 2 | from composio_gemini import GeminiProvider 3 | from google import genai 4 | from google.genai import types 5 | 6 | # Create composio client 7 | composio = Composio(provider=GeminiProvider()) 8 | # Create google client 9 | client = genai.Client() 10 | 11 | user_id = "0000-1111-2222" 12 | tools = composio.tools.get(user_id, tools=["COMPOSIO_SEARCH_DUCK_DUCK_GO_SEARCH"]) 13 | 14 | # Create genai client config 15 | config = types.GenerateContentConfig(tools=tools) 16 | 17 | # # Use the chat interface. 18 | chat = client.chats.create(model="gemini-2.0-flash", config=config) 19 | response = chat.send_message("search about the latest info on windsurf acquisition.") 20 | print(response.text) 21 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/NamedType.test.ts: -------------------------------------------------------------------------------- 1 | import { expect, test } from 'vitest'; 2 | 3 | import { namedType } from './NamedType'; 4 | import { stringify } from './stringify'; 5 | 6 | test('name only', () => { 7 | expect(stringify(namedType('MyType'))).toMatchInlineSnapshot(`"MyType"`); 8 | }); 9 | 10 | test('with generic argument', () => { 11 | expect(stringify(namedType('MyType').addGenericArgument(namedType('Foo')))).toMatchInlineSnapshot( 12 | `"MyType"` 13 | ); 14 | }); 15 | 16 | test('with multiple generic arguments', () => { 17 | expect( 18 | stringify( 19 | namedType('MyType').addGenericArgument(namedType('Foo')).addGenericArgument(namedType('Bar')) 20 | ) 21 | ).toMatchInlineSnapshot(`"MyType"`); 22 | }); 23 | -------------------------------------------------------------------------------- /ts/examples/tools/src/tool-conversion.ts: -------------------------------------------------------------------------------- 1 | import { Composio, jsonSchemaToZodSchema } from '@composio/core'; 2 | import zodToJsonSchema from 'zod-to-json-schema'; 3 | 4 | const composio = new Composio({ 5 | apiKey: process.env.COMPOSIO_API_KEY, 6 | }); 7 | 8 | const tool = await composio.tools.getRawComposioToolBySlug( 9 | 'GOOGLESHEETS_SPREADSHEETS_VALUES_APPEND' 10 | ); 11 | const inputParams = tool.inputParameters; 12 | console.log(`---------- Original Input Parameters ----------`); 13 | console.log(JSON.stringify(inputParams, null, 2)); 14 | 15 | const zodSchema = jsonSchemaToZodSchema(inputParams ?? {}); 16 | console.log(`---------- Zod Schema Parsed ----------`); 17 | console.log(JSON.stringify(zodToJsonSchema(zodSchema, { target: "jsonSchema7"}), null, 2)); 18 | -------------------------------------------------------------------------------- /ts/packages/cli/test/__fixtures__/typescript-project-with-composio-core/pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '9.0' 2 | 3 | settings: 4 | autoInstallPeers: true 5 | excludeLinksFromLockfile: false 6 | 7 | importers: 8 | 9 | .: 10 | dependencies: 11 | '@composio/core': 12 | specifier: link:../../../../core 13 | version: link:../../../../core 14 | devDependencies: 15 | typescript: 16 | specifier: ^5.9.2 17 | version: 5.9.2 18 | 19 | packages: 20 | 21 | typescript@5.9.2: 22 | resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} 23 | engines: {node: '>=14.17'} 24 | hasBin: true 25 | 26 | snapshots: 27 | 28 | typescript@5.9.2: {} 29 | -------------------------------------------------------------------------------- /ts/examples/triggers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "triggers-example", 3 | "private": true, 4 | "version": "0.1.0", 5 | "description": "Example project for Triggers", 6 | "main": "src/index.ts", 7 | "scripts": { 8 | "clean": "git clean -xdf node_modules", 9 | "start": "bun src/index.ts", 10 | "dev": "bun --watch src/index.ts", 11 | "test": "echo \"Error: no test specified\" && exit 1" 12 | }, 13 | "keywords": ["composio", "example", "triggers"], 14 | "author": "", 15 | "license": "ISC", 16 | "packageManager": "pnpm@10.17.0", 17 | "dependencies": { 18 | "@composio/core": "workspace:*", 19 | "dotenv": "^16.4.1" 20 | }, 21 | "devDependencies": { 22 | "@types/bun": "^1.2.9", 23 | "typescript": "catalog:" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/logic/spans/maybe-add-error-to-spans-stack.ts: -------------------------------------------------------------------------------- 1 | export const removeNodeModulesEntriesFromStack = (stack: string) => { 2 | const lines = stack.split('\r\n'); 3 | 4 | return lines.filter(line => line.includes(process.cwd()) && !line.includes('/node_modules/')); 5 | }; 6 | 7 | export const maybeAddErrorToSpansStack = ( 8 | stack: string | undefined, 9 | spanAttributesStack: string[] | undefined 10 | ) => { 11 | const effectStack: string[] = []; 12 | 13 | if (stack && spanAttributesStack !== undefined) { 14 | effectStack.push(...removeNodeModulesEntriesFromStack(stack)); 15 | } 16 | if (spanAttributesStack !== undefined) { 17 | effectStack.push(...spanAttributesStack); 18 | } 19 | 20 | return effectStack; 21 | }; 22 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/parsers/parse-any-of.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod/v3'; 2 | 3 | import { parseSchema } from './parse-schema'; 4 | import type { JsonSchemaObject, JsonSchema, Refs } from '../types'; 5 | 6 | export const parseAnyOf = (jsonSchema: JsonSchemaObject & { anyOf: JsonSchema[] }, refs: Refs) => { 7 | return jsonSchema.anyOf.length 8 | ? jsonSchema.anyOf.length === 1 9 | ? parseSchema(jsonSchema.anyOf[0], { 10 | ...refs, 11 | path: [...refs.path, 'anyOf', 0], 12 | }) 13 | : z.union( 14 | jsonSchema.anyOf.map((schema, i) => 15 | parseSchema(schema, { ...refs, path: [...refs.path, 'anyOf', i] }) 16 | ) as [z.ZodTypeAny, z.ZodTypeAny] 17 | ) 18 | : z.any(); 19 | }; 20 | -------------------------------------------------------------------------------- /ts/packages/providers/openai/src/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * OpenAI Provider 3 | * 4 | * Author: Musthaq Ahamad 5 | * Core Reference: /packages/core/src/provider/OpenAIProvider.ts 6 | * Legacy Reference: https://github.com/ComposioHQ/composio/blob/master/js/src/frameworks/openai.ts 7 | * 8 | * This provider provides a set of tools for interacting with OpenAI's API. 9 | * The provider is shipped with Composio Core and is ready to use. 10 | * This export is just a convenience export for external usage, and is not required for using with Composio. 11 | * 12 | * @packageDocumentation 13 | * @module providers/openai 14 | */ 15 | export { OpenAIProvider } from '@composio/core'; 16 | export { OpenAIResponsesProvider } from './OpenAIResponsesProvider'; 17 | -------------------------------------------------------------------------------- /.github/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Support 2 | 3 | Thanks for using Composio! If you need help, use the following channels: 4 | 5 | - Documentation: https://docs.composio.dev 6 | - Discord: https://discord.gg/composio (best for community help and quick questions) 7 | - Email: support@composio.dev (account issues, private questions, or if you can’t use Discord) 8 | 9 | Please avoid filing support requests as GitHub issues unless you believe you’ve found a bug. For security issues, do not open a public issue—follow `.github/SECURITY.md`. 10 | 11 | ## Before asking for help 12 | - Check open and closed issues 13 | - Search the docs and Discord 14 | - Include versions, logs, minimal repro steps, and expected vs. actual behavior 15 | 16 | We do our best to respond within 2–3 business days. 17 | -------------------------------------------------------------------------------- /fern/snippets/tool-calling/typescript/checking-connection-status.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio({ apiKey: 'your_api_key' }); 4 | 5 | // Get a specific connected account by its nanoid 6 | const connectedAccount = await composio.connectedAccounts.get('your_connected_account_id'); 7 | console.log(`Status: ${connectedAccount.status}`); 8 | 9 | // Filter connections by user_id, auth_config_id, and status (only active accounts) 10 | const filteredConnections = await composio.connectedAccounts.list({ 11 | userIds: ['user_123'], 12 | authConfigIds: ['your_auth_config_id'], 13 | statuses: ['ACTIVE'] 14 | }); 15 | filteredConnections.items.forEach(connection => { 16 | console.log(`${connection.id}: ${connection.status}`); 17 | }); 18 | -------------------------------------------------------------------------------- /python/examples/fastapi_app.py: -------------------------------------------------------------------------------- 1 | from fastapi import FastAPI 2 | from fastapi.responses import RedirectResponse 3 | 4 | from composio import Composio 5 | 6 | # Create a FastAPI app 7 | app = FastAPI() 8 | 9 | # Create a Composio client 10 | composio = Composio() 11 | 12 | 13 | @app.get("/authorize/{toolkit}") 14 | def authorize_app(toolkit: str): 15 | # retrieve the user id from your app 16 | user_id = "" 17 | 18 | # retrieve the auth config id from your app 19 | auth_config_id = "" 20 | 21 | # initiate the connection request 22 | connection_request = composio.connected_accounts.initiate( 23 | user_id=user_id, 24 | auth_config_id=auth_config_id, 25 | ) 26 | return RedirectResponse(url=connection_request.redirect_url) # type: ignore 27 | -------------------------------------------------------------------------------- /ts/examples/tool-router/src/index.ts: -------------------------------------------------------------------------------- 1 | import { openai } from '@ai-sdk/openai'; 2 | import { Composio } from '@composio/core'; 3 | import { VercelProvider } from '@composio/vercel'; 4 | import { stepCountIs, streamText } from 'ai'; 5 | import { modifiers } from './logger'; 6 | 7 | const composio = new Composio({ 8 | provider: new VercelProvider(), 9 | }); 10 | const session = await composio.create('user_123', { toolkits: ['gmail'] }); 11 | 12 | 13 | const tools = await session.tools(modifiers); 14 | 15 | const stream = await streamText({ 16 | model: openai('gpt-4o-mini'), 17 | prompt: 'Find my last email from gmail?', 18 | stopWhen: stepCountIs(10), 19 | tools, 20 | }); 21 | 22 | for await (const textPart of stream.textStream) { 23 | process.stdout.write(textPart); 24 | } 25 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/parsers/parse-enum.ts: -------------------------------------------------------------------------------- 1 | import { z } from 'zod/v3'; 2 | 3 | import type { JsonSchemaObject, Serializable } from '../types'; 4 | 5 | export const parseEnum = (jsonSchema: JsonSchemaObject & { enum: Serializable[] }) => { 6 | if (jsonSchema.enum.length === 0) { 7 | return z.never(); 8 | } 9 | 10 | if (jsonSchema.enum.length === 1) { 11 | // union does not work when there is only one element 12 | return z.literal(jsonSchema.enum[0] as z.Primitive); 13 | } 14 | 15 | if (jsonSchema.enum.every(x => typeof x === 'string')) { 16 | return z.enum(jsonSchema.enum as [string]); 17 | } 18 | 19 | return z.union( 20 | jsonSchema.enum.map(x => z.literal(x as z.Primitive)) as unknown as [z.ZodTypeAny, z.ZodTypeAny] 21 | ); 22 | }; 23 | -------------------------------------------------------------------------------- /ts/packages/ts-builders/src/FunctionCall.ts: -------------------------------------------------------------------------------- 1 | import { ValueBuilder } from './ValueBuilder'; 2 | import { Writer } from './Writer'; 3 | 4 | export class FunctionCall extends ValueBuilder { 5 | #name: string; 6 | #args: ValueBuilder[]; 7 | 8 | constructor(name: string, args: ValueBuilder[]) { 9 | super(); 10 | this.#name = name; 11 | this.#args = args; 12 | } 13 | 14 | addArgument(arg: ValueBuilder): this { 15 | this.#args.push(arg); 16 | return this; 17 | } 18 | 19 | override write(writer: Writer): void { 20 | writer.write(this.#name).write('(').writeJoined(', ', this.#args).write(')'); 21 | } 22 | } 23 | 24 | export function functionCall(name: string, args: ValueBuilder[] = []): FunctionCall { 25 | return new FunctionCall(name, args); 26 | } 27 | -------------------------------------------------------------------------------- /fern/snippets/triggers/typescript/triggers.ts: -------------------------------------------------------------------------------- 1 | import { Composio } from '@composio/core'; 2 | 3 | const composio = new Composio({apiKey: "your-api-key"}); 4 | const userId = 'user-id-123435'; 5 | 6 | // Check what configuration is required 7 | const triggerType = await composio.triggers.getType("GITHUB_COMMIT_EVENT"); 8 | console.log(triggerType.config); 9 | // Returns: {"properties": {...}, "required": ["owner", "repo"], ...} 10 | 11 | // Create trigger with the required config 12 | const trigger = await composio.triggers.create( 13 | userId, 14 | 'GITHUB_COMMIT_EVENT', 15 | { 16 | triggerConfig: { 17 | owner: 'your-repo-owner', 18 | repo: 'your-repo-name' 19 | } 20 | } 21 | ); 22 | console.log(`Trigger created: ${trigger.triggerId}`); -------------------------------------------------------------------------------- /ts/packages/cli/tsconfig.options.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "compilerOptions": { 4 | "target": "esnext", 5 | "module": "esnext", 6 | "lib": ["esnext", "DOM"], 7 | "declaration": true, 8 | "outDir": "./dist", 9 | "rootDir": ".", 10 | "strict": true, 11 | "esModuleInterop": true, 12 | "moduleResolution": "bundler", 13 | "skipLibCheck": true, 14 | "resolveJsonModule": true, 15 | "pretty": true, 16 | "noImplicitReturns": true, 17 | "noFallthroughCasesInSwitch": true, 18 | "noUnusedLocals": false, 19 | "noUnusedParameters": false, 20 | "plugins": [ 21 | { 22 | "name": "@effect/language-service" 23 | } 24 | ] 25 | }, 26 | "exclude": ["node_modules", "**/dist"] 27 | } 28 | -------------------------------------------------------------------------------- /ts/examples/session-management/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "session-management-example", 3 | "private": true, 4 | "version": "0.1.0", 5 | "description": "Example project for Session-management", 6 | "main": "src/index.ts", 7 | "scripts": { 8 | "clean": "git clean -xdf node_modules", 9 | "start": "bun src/index.ts", 10 | "dev": "bun --watch src/index.ts", 11 | "test": "echo \"Error: no test specified\" && exit 1" 12 | }, 13 | "keywords": ["composio", "example", "session-management"], 14 | "author": "", 15 | "license": "ISC", 16 | "packageManager": "pnpm@10.17.0", 17 | "dependencies": { 18 | "@composio/core": "workspace:*", 19 | "dotenv": "^16.4.1" 20 | }, 21 | "devDependencies": { 22 | "@types/bun": "^1.2.9", 23 | "typescript": "catalog:" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /fern/snippets/migration/old_custom_tools.py: -------------------------------------------------------------------------------- 1 | # Python Example using execute_request 2 | from composio import action, ComposioToolSet 3 | import typing as t 4 | 5 | toolset = ComposioToolSet() 6 | 7 | @action(toolname="github") # Associate with GitHub app for auth 8 | def get_github_repo_topics( 9 | owner: t.Annotated[str, "Repository owner username"], 10 | repo: t.Annotated[str, "Repository name"], 11 | execute_request: t.Callable # Injected by Composio 12 | ) -> dict: 13 | """Gets the topics associated with a specific GitHub repository.""" 14 | response_data = execute_request( 15 | endpoint=f"/repos/{owner}/{repo}/topics", # API path relative to base URL 16 | method="GET" 17 | ) 18 | if isinstance(response_data, dict): 19 | return {"topics": response_data.get("names", [])} -------------------------------------------------------------------------------- /ts/packages/cli/src/commands/logout.cmd.ts: -------------------------------------------------------------------------------- 1 | import { Command } from '@effect/cli'; 2 | import { Effect, Console } from 'effect'; 3 | import { ComposioUserContext } from 'src/services/user-context'; 4 | 5 | /** 6 | * CLI command to log out from the Composio CLI. 7 | * 8 | * @example 9 | * ```bash 10 | * composio logout 11 | * ``` 12 | */ 13 | export const logoutCmd = Command.make('logout', {}, () => 14 | Effect.gen(function* () { 15 | const ctx = yield* ComposioUserContext; 16 | 17 | if (!ctx.isLoggedIn()) { 18 | yield* Console.log('You are not logged in yet. Please run `composio login`.'); 19 | return; 20 | } 21 | 22 | yield* ctx.logout; 23 | yield* Console.log(`Logged out successfully.`); 24 | }) 25 | ).pipe(Command.withDescription('Log out from the Composio SDK.')); 26 | -------------------------------------------------------------------------------- /ts/packages/json-schema-to-zod/src/utils/extend-schema.ts: -------------------------------------------------------------------------------- 1 | import type { z } from 'zod/v3'; 2 | 3 | import type { JsonSchemaObject } from '../types'; 4 | 5 | export function extendSchemaWithMessage< 6 | TZod extends z.ZodTypeAny, 7 | TJson extends JsonSchemaObject, 8 | TKey extends keyof TJson, 9 | >( 10 | zodSchema: TZod, 11 | jsonSchema: TJson, 12 | key: TKey, 13 | extend: (zodSchema: TZod, value: NonNullable, errorMessage?: string) => TZod 14 | ) { 15 | const value = jsonSchema[key]; 16 | 17 | if (value !== undefined) { 18 | const errorMessage = (jsonSchema as unknown as { errorMessage?: Record }) 19 | .errorMessage?.[key as string]; 20 | return extend(zodSchema, value as NonNullable, errorMessage); 21 | } 22 | 23 | return zodSchema; 24 | } 25 | -------------------------------------------------------------------------------- /python/providers/gemini/gemini_demo.py: -------------------------------------------------------------------------------- 1 | from composio_gemini import GeminiProvider 2 | from google import genai 3 | from google.genai import types 4 | 5 | from composio import Composio 6 | 7 | # Create composio client 8 | composio = Composio(provider=GeminiProvider()) 9 | 10 | # Create google client 11 | client = genai.Client() 12 | 13 | # Create genai client config 14 | config = types.GenerateContentConfig( 15 | tools=composio.tools.get( 16 | user_id="default", 17 | tools=[ 18 | "GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER", 19 | ], 20 | ) 21 | ) 22 | 23 | # Use the chat interface. 24 | chat = client.chats.create(model="gemini-2.0-flash", config=config) 25 | response = chat.send_message("Can you star composiohq/composio repository on github") 26 | print(response.text) 27 | -------------------------------------------------------------------------------- /ts/packages/cli/src/generation/python/generate.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path'; 2 | import type { ToolkitIndex } from 'src/generation/create-toolkit-index'; 3 | import type { SourceFile } from 'src/generation/types'; 4 | import { generatePythonToolkitSources } from './generate-toolkit-sources'; 5 | 6 | type GeneratePythonSourcesParams = { 7 | banner: string; 8 | outputDir: string; 9 | }; 10 | 11 | export function generatePythonSources(params: GeneratePythonSourcesParams) { 12 | return (index: ToolkitIndex): Array => { 13 | const toolkiteSources = generatePythonToolkitSources(params.banner)(index); 14 | 15 | return [ 16 | ...toolkiteSources.map( 17 | ([filename, content]) => [path.join(params.outputDir, filename), content] as const 18 | ), 19 | ] as const; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /fern/snippets/migration/old_tool_modifiers.py: -------------------------------------------------------------------------------- 1 | from composio_openai import ComposioToolSet, Action 2 | 3 | toolset = ComposioToolSet() 4 | 5 | 6 | def my_schema_processor(schema: dict) -> dict: ... 7 | def my_preprocessor(inputs: dict) -> dict: ... 8 | def my_postprocessor(result: dict) -> dict: ... 9 | 10 | 11 | # Get tools with the modified schema 12 | processed_tools = toolset.get_tools( 13 | actions=[Action.GMAIL_SEND_EMAIL], 14 | processors={ 15 | # Applied BEFORE the LLM sees the schema 16 | "schema": {Action.SOME_ACTION: my_schema_processor}, 17 | # Applied BEFORE the tool executes 18 | "pre": {Action.SOME_ACTION: my_preprocessor}, 19 | # Applied AFTER the tool executes, BEFORE the result is returned 20 | "post": {Action.SOME_ACTION: my_postprocessor}, 21 | }, 22 | ) -------------------------------------------------------------------------------- /ts/packages/core/src/utils/constants.ts: -------------------------------------------------------------------------------- 1 | import { getEnvVariable } from './env'; 2 | 3 | // Constants 4 | export const COMPOSIO_DIR = '.composio'; 5 | export const USER_DATA_FILE_NAME = 'user_data.json'; 6 | export const TEMP_FILES_DIRECTORY_NAME = 'files'; 7 | export const DEFAULT_BASE_URL = 'https://backend.composio.dev'; 8 | export const DEFAULT_WEB_URL = 'https://platform.composio.dev'; 9 | 10 | export const TELEMETRY_URL = 'https://app.composio.dev'; 11 | export const CLIENT_PUSHER_KEY = getEnvVariable('CLIENT_PUSHER_KEY') || 'ff9f18c208855d77a152'; 12 | 13 | export const COMPOSIO_LOG_LEVEL = getEnvVariable('COMPOSIO_LOG_LEVEL') as 14 | | 'debug' 15 | | 'info' 16 | | 'warn' 17 | | 'error' 18 | | undefined; 19 | 20 | export const IS_DEVELOPMENT_OR_CI = getEnvVariable('DEVELOPMENT') || getEnvVariable('CI') || false; 21 | -------------------------------------------------------------------------------- /fern/packages/snippet-tester/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "snippet-tester", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "clean": "git clean -xdf node_modules", 8 | "test": "bun test", 9 | "start": "bun run src/index.ts" 10 | }, 11 | "keywords": [], 12 | "author": "", 13 | "license": "ISC", 14 | "dependencies": { 15 | "@pnpm/find-workspace-dir": "^7.0.2", 16 | "cohere": "^1.1.1", 17 | "cohere-ai": "^7.14.0", 18 | "convict": "^6.2.4", 19 | "glob": "^11.0.0", 20 | "nodemon": "^3.1.7", 21 | "ts-node": "^10.9.2" 22 | }, 23 | "devDependencies": { 24 | "@types/convict": "^6.1.6", 25 | "@types/glob": "^8.1.0", 26 | "@types/node": "^20.10.0", 27 | "typescript": "catalog:", 28 | "bun-types": "latest" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.github/workflows/ts.typecheck.yml: -------------------------------------------------------------------------------- 1 | name: Typecheck Typescript SDK 2 | 3 | on: 4 | push: 5 | branches: [main, next] 6 | paths: 7 | - "ts/**" 8 | pull_request: 9 | branches: [main, next] 10 | paths: 11 | - "ts/**" 12 | 13 | jobs: 14 | typecheck: 15 | name: Typecheck Typescript SDK 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Checkout Code 20 | uses: actions/checkout@v3 21 | 22 | - name: Setup PNPM 23 | uses: pnpm/action-setup@v4 24 | 25 | - name: Set up Node.js 26 | uses: actions/setup-node@v3 27 | with: 28 | node-version: "20" 29 | cache: "pnpm" 30 | 31 | - name: Install Dependencies 32 | run: pnpm install --frozen-lockfile 33 | 34 | - name: Run Typecheck 35 | run: pnpm run typecheck 36 | -------------------------------------------------------------------------------- /ts/examples/tools/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tools-example", 3 | "private": true, 4 | "version": "0.1.0", 5 | "description": "Example project for Tools", 6 | "main": "src/index.ts", 7 | "scripts": { 8 | "start": "bun src/index.ts", 9 | "dev": "bun --watch src/index.ts", 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "keywords": [ 13 | "composio", 14 | "example", 15 | "tools" 16 | ], 17 | "author": "", 18 | "license": "ISC", 19 | "packageManager": "pnpm@10.17.0", 20 | "dependencies": { 21 | "@composio/core": "workspace:*", 22 | "dotenv": "^16.4.1", 23 | "openai": "^5.19.1", 24 | "zod": "catalog:", 25 | "zod-to-json-schema": "catalog:" 26 | }, 27 | "devDependencies": { 28 | "@types/bun": "^1.2.9", 29 | "typescript": "catalog:" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /python/composio/integration_test/README.md: -------------------------------------------------------------------------------- 1 | # Integration Tests 2 | 3 | Integration tests for Composio SDK functionality. 4 | 5 | ## Setup 6 | 7 | ```bash 8 | export COMPOSIO_API_KEY="your_api_key_here" 9 | ``` 10 | 11 | ## Running Tests 12 | 13 | ```bash 14 | # From project root 15 | cd /path/to/composio 16 | python -m pytest python/composio/integration_test/ -v 17 | 18 | # From python directory 19 | cd /path/to/composio/python 20 | pytest composio/integration_test/ -v 21 | 22 | # Using uv 23 | cd /path/to/composio/python 24 | uv run pytest composio/integration_test/ -v 25 | ``` 26 | 27 | ## Test Files 28 | 29 | - **`test_mcp.py`** - MCP (Model Context Protocol) functionality tests 30 | - **`test_tool_router.py`** - ToolRouter experimental feature tests 31 | 32 | ## Requirements 33 | 34 | - Python 3.12+ 35 | - pytest 36 | - Valid Composio API key -------------------------------------------------------------------------------- /ts/examples/custom-tools/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "custom-tools-example", 3 | "private": true, 4 | "version": "0.1.0", 5 | "description": "Example project for Custom-tools", 6 | "main": "src/index.ts", 7 | "scripts": { 8 | "clean": "git clean -xdf node_modules", 9 | "start": "bun src/index.ts", 10 | "dev": "bun --watch src/index.ts", 11 | "test": "echo \"Error: no test specified\" && exit 1" 12 | }, 13 | "keywords": [ 14 | "composio", 15 | "example", 16 | "custom-tools" 17 | ], 18 | "author": "", 19 | "license": "ISC", 20 | "packageManager": "pnpm@10.17.0", 21 | "dependencies": { 22 | "@composio/core": "workspace:*", 23 | "dotenv": "^16.4.1", 24 | "zod": "catalog:" 25 | }, 26 | "devDependencies": { 27 | "@types/bun": "^1.2.9", 28 | "typescript": "catalog:" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /.github/workflows/ts.build.yml: -------------------------------------------------------------------------------- 1 | name: Build Typescript SDK 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | paths: 7 | - "ts/**" 8 | pull_request: 9 | paths: 10 | - "ts/**" 11 | 12 | jobs: 13 | build: 14 | name: Build Typescript SDK 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout Code 19 | uses: actions/checkout@v3 20 | 21 | - name: Setup PNPM 22 | uses: pnpm/action-setup@v4 23 | 24 | - name: Set up Node.js 25 | uses: actions/setup-node@v3 26 | with: 27 | node-version: "20" 28 | cache: "pnpm" 29 | 30 | - name: Install Dependencies 31 | run: pnpm install --frozen-lockfile 32 | 33 | - name: Run Linting 34 | run: pnpm lint 35 | 36 | - name: Run Build 37 | run: pnpm run build:packages 38 | -------------------------------------------------------------------------------- /ts/packages/cli/src/effect-errors/logic/spans/split-spans-attributes-by-type.ts: -------------------------------------------------------------------------------- 1 | interface FilteredEffectAttributes { 2 | stacktrace: string[]; 3 | attributes: ReadonlyMap; 4 | } 5 | 6 | export const splitSpansAttributesByTypes = (attributes: ReadonlyMap) => 7 | Array.from(attributes.entries()).reduce( 8 | (prev, [key, value]) => { 9 | if (key === 'code.stacktrace') { 10 | return { 11 | attributes: prev.attributes, 12 | stacktrace: [...prev.stacktrace, value] as string[], 13 | }; 14 | } 15 | 16 | return { 17 | attributes: new Map([...prev.attributes, [key, value]]), 18 | stacktrace: prev.stacktrace, 19 | }; 20 | }, 21 | { 22 | stacktrace: [], 23 | attributes: new Map(), 24 | } 25 | ); 26 | -------------------------------------------------------------------------------- /ts/packages/core/src/errors/AuthConfigErrors.ts: -------------------------------------------------------------------------------- 1 | import { ComposioError, ComposioErrorOptions } from './ComposioError'; 2 | 3 | export const AuthConfigErrorCodes = { 4 | AUTH_CONFIG_NOT_FOUND: 'AUTH_CONFIG_NOT_FOUND', 5 | } as const; 6 | 7 | export class ComposioAuthConfigNotFoundError extends ComposioError { 8 | constructor( 9 | message: string = 'Auth config not found', 10 | options: Omit = {} 11 | ) { 12 | super(message, { 13 | ...options, 14 | code: AuthConfigErrorCodes.AUTH_CONFIG_NOT_FOUND, 15 | possibleFixes: options.possibleFixes || [ 16 | 'Check if the auth config exists', 17 | 'Check if the auth config id is correct', 18 | 'Check if the auth config is enabled', 19 | ], 20 | }); 21 | this.name = 'ComposioAuthConfigNotFoundError'; 22 | } 23 | } 24 | --------------------------------------------------------------------------------