Files
composiohq__composio/AGENTS.md
T
Alberto Schiabel 4fe776898a chore(toolchain): finish mise migration (#3493)
## Summary

Depends on #3492.

This completes the Phase 2 migration by removing the transitional
version-file layer and making `mise.toml` plus `mise.lock` the
repository toolchain source of truth. It also moves runtime test
matrices into `toolchain-versions.json`, so CI matrix changes are
explicit and reviewable without reintroducing `.nvmrc`, `.dvmrc`,
`.bun-version`, or `.python-version`.

The Node.js e2e matrix now starts at the latest Node 22 LTS line and
also covers the latest Node 24 and Node 25 lines. That removes Node 20
from the well-known e2e versions while keeping us covered on the
runtimes SDK users are moving toward.

## Rationale

Phase 1 introduced mise side by side with the existing version files to
keep the first PR low-risk. Phase 2 removes that compatibility layer so
there is one place to update tool versions. That avoids silent drift
between local setup, GitHub Actions, Docker E2E images, release docs,
and install-time checks.

The composite setup actions now install Node, Bun, Python, and uv
through mise by default, with explicit version overrides only where a
matrix needs them. New GitHub actions added in this PR are pinned by
release commit SHA and include the release version comment.

## What changed

- Deleted the transitional root/version files: `.nvmrc`, `.bun-version`,
`.dvmrc`, root `.python-version`, and `python/.python-version`.
- Removed `idiomatic_version_file_enable_tools` from `mise.toml` and
added a committed `mise.lock` for linux/macOS x64/arm64 tool resolution.
- Replaced `BYPASS_BUN_VERSION_CHECK` with `BYPASS_TOOLCHAIN_CHECK`, and
made Docker E2E image installs use that bypass because they receive
explicit build args instead of installing mise.
- Updated Node/Bun and Python/uv composite actions to default to mise,
remove `*-version-file` inputs, report resolved versions, and cache pnpm
after `corepack enable`.
- Centralized CI runtime matrices in `toolchain-versions.json` for TS
E2E, Python tests, and CLI npm fallback coverage.
- Updated the Node E2E matrix to `22.22.3`, `24.16.0`, and `25.9.0`,
removing Node 20 from the well-known runtime versions.
- Updated workflows, docs, E2E helpers, Dockerfiles, and release
guidance to reference `mise.toml` / `mise.lock`.

## Verification

- Verified latest Node 22/24/25 releases from the official Node dist
index: `22.22.3`, `24.16.0`, `25.9.0`
(https://nodejs.org/dist/index.json).
- `pnpm install --frozen-lockfile`
- `pnpm --filter @e2e-tests/utils typecheck`
- `pnpm --filter @e2e-tests/utils exec tsc --noEmit --target es2022
--module esnext --moduleResolution bundler --types bun
--resolveJsonModule --skipLibCheck --strict scripts/docker-build.ts`
- `bash -n ts/scripts/pre-install.sh && bun run
ts/scripts/pre-install/check-toolchain.ts && BYPASS_TOOLCHAIN_CHECK=1
bash ts/scripts/pre-install.sh`
- `pnpm exec prettier --check ...` on touched YAML/Markdown/TS/JSON
files
- `ruby -e "require \"yaml\"; ARGV.each { |f| YAML.load_file(f) }" ...`
on touched actions/workflows
- `mise lock --platform linux-x64,linux-arm64,macos-arm64,macos-x64 &&
git diff --exit-code mise.lock`
- `mise exec node@22.22.3 -- pnpm --filter @e2e-tests/utils typecheck`
- `mise exec node@22.22.3 -- pnpm --filter @e2e-tests/node-esm-basic
typecheck`
- `mise exec node@22.22.3 -- pnpm --filter @e2e-tests/node-cjs-basic
typecheck`
- `docker manifest inspect node:24.16.0-slim`
- `docker manifest inspect node:25.9.0-slim`
- `git diff --check`
2026-06-15 14:03:21 +04:00

7.5 KiB

AGENTS.md

This file provides guidance to AI coding agents (Codex, Claude Code, etc.) when working with code in this repository.

Overview

This is the Composio SDK v3 repository containing both TypeScript and Python SDKs. The main development focus is on the TypeScript SDK located in /ts/ directory. The project uses a monorepo structure with multiple packages and examples.

Notes

  • For documentation tasks, refer to docs/CLAUDE.md
  • Vendor submodules in ts/vendor/ are read-only reference only — do not modify them

Common Development Commands

Build and Development

pnpm build              # Build all packages
pnpm build:packages     # Build only TypeScript packages
pnpm clean              # Clean build artifacts
pnpm lint               # Lint code
pnpm lint:fix           # Lint and auto-fix
pnpm format             # Format code
pnpm test               # Run tests

Package Management

mise install            # Install Node, Bun, Deno, Python, uv (one-time; needs mise — https://mise.jdx.dev/installing-mise.html)
corepack enable         # Activate pnpm from package.json#packageManager
pnpm install            # Install dependencies
pnpm check:peer-deps    # Check peer dependencies
pnpm update:peer-deps   # Update peer dependencies

Creating New Components

pnpm create:provider <provider-name> [--agentic]
pnpm create:example <example-name>

Release Management

pnpm changeset            # Create changeset for releases
pnpm changeset:version    # Version packages
pnpm changeset:release    # Publish packages

Project Architecture

Repository Structure

composio/
├── ts/                      # TypeScript SDK (main development)
│   ├── packages/
│   │   ├── core/           # Core SDK functionality
│   │   ├── providers/      # AI provider integrations (OpenAI, Anthropic, etc.)
│   │   ├── cli/           # Command-line interface (Effect.ts + @clack/prompts)
│   │   ├── json-schema-to-zod/ # Schema conversion utility
│   │   └── ts-builders/   # TypeScript code generation utilities
│   ├── vendor/            # Read-only reference submodules (Effect, Clack)
│   └── examples/          # Usage examples for different providers
├── python/                # Python SDK
├── docs/                  # Documentation (Fumadocs)
└── examples/              # Cross-platform examples

Core Packages

@composio/core — Main SDK functionality:

  • src/composio.ts — Main Composio class
  • src/models/ — Core models (Tools, Toolkits, ConnectedAccounts, etc.)
  • src/provider/ — Base provider implementations
  • src/services/ — Internal services (telemetry, pusher)
  • src/types/ — TypeScript type definitions
  • src/utils/ — Utility functions and helpers

Provider Packages — AI integrations:

  • @composio/openai, @composio/anthropic, @composio/google
  • @composio/langchain, @composio/vercel, @composio/mastra

Key Concepts

  • Tools — Individual functions (e.g., GITHUB_CREATE_REPO, GMAIL_SEND_EMAIL)
  • Toolkits — Collections of related tools grouped by service (github, gmail, slack)
  • Connected Accounts — User authentication/authorization for external services
  • Auth Configs — Configuration for different authentication methods
  • Custom Tools — User-defined tools with custom logic
  • Providers — Integrations with AI frameworks (OpenAI, Anthropic, etc.)
  • Modifiers — Middleware to transform tool inputs/outputs

Development Workflow

Testing

  • Unit tests use Vitest — run with pnpm test
  • Tests are in test/ directories within each package
  • Mock implementations in test/utils/mocks/

Code Quality

  • ESLint — config in eslint.config.mjs
  • Prettier — for code formatting
  • TypeScript — strict mode enabled
  • Husky — pre-commit hooks for quality checks

TypeScript E2E Tests

pnpm test:e2e              # All (Node.js + Deno + Cloudflare)
pnpm test:e2e:node         # Node.js CJS/ESM compatibility (Docker)
pnpm test:e2e:deno         # Deno npm: specifier compatibility (Docker)
pnpm test:e2e:cloudflare   # Cloudflare Workers

Environment Variables

COMPOSIO_API_KEY            # Required: Your Composio API key
COMPOSIO_BASE_URL           # Optional: Custom API base URL
COMPOSIO_LOG_LEVEL          # Optional: silent, error, warn, info, debug
COMPOSIO_DISABLE_TELEMETRY  # Optional: Set to "true" to disable telemetry

Key Files and Locations

  • Main SDK Entry: ts/packages/core/src/index.ts
  • Core Composio Class: ts/packages/core/src/composio.ts
  • Type Definitions: ts/packages/core/src/types/
  • Error Classes: ts/packages/core/src/errors/
  • Documentation: docs/
  • Build Configs: turbo.jsonc, tsconfig.base.json, tsdown.config.base.ts

Common Patterns

Tool Execution

const composio = new Composio({ apiKey: 'your-key' });
const result = await composio.tools.execute('TOOL_NAME', {
  userId: 'user-id',
  arguments: {
    /* tool args */
  },
});

Provider Integration

import { OpenAIProvider } from '@composio/openai';
const provider = new OpenAIProvider({ apiKey: 'openai-key' });
const tools = await composio.tools.get('user-id', { toolkits: ['github'] });
const wrappedTools = provider.wrapTools(tools);

Custom Tool Creation

import { Composio, experimental_createTool } from '@composio/core';
import { z } from 'zod';

const composio = new Composio();

// Custom tools are session-scoped: define a local tool, then attach it when
// creating a Tool Router session. Use `extendsToolkit` + `ctx.proxyExecute`
// to inherit a toolkit's managed auth and call its API.
const myTool = experimental_createTool('MY_TOOL', {
  name: 'My Tool',
  description: 'Tool description',
  inputParams: z.object({
    param: z.string().describe('Parameter description'),
  }),
  execute: async input => {
    return { result: input.param };
  },
});

const session = await composio.create('user-id', {
  experimental: { customTools: [myTool] }
});

Python SDK Development

Setup

cd python
make env                 # Create virtual env with all dependencies
source .venv/bin/activate

Commands

make fmt       # Format code (ruff)
make chk       # Check linting and type issues
make tst       # Run tests
make snt       # Run sanity tests
make build     # Build packages

Code Quality

  • Formatter: Ruff (Black-compatible, 88 char line length)
  • Linter: Ruff
  • Type Checker: mypy with strict optional typing
  • Test Framework: pytest with markers (core, openai, langchain, agno)
  • Python Version: >=3.10, <4

Maintenance Tasks

When Updating GitHub Actions

Toolchain versions are coalesced in mise.toml. To check the current values:

  • Node.js: mise current node
  • Bun: mise current bun
  • Deno: mise current deno
  • Python: mise current python
  • uv: mise current uv
  • pnpm: node -p "require('./package.json').packageManager"

To bump, edit mise.toml (or package.json#packageManager for pnpm), then run:

mise lock --platform linux-x64,linux-arm64,macos-arm64,macos-x64

Commit mise.lock with the version bump. The "Prerequisites" section in ts/docs/internal/release.md references mise.toml so it stays current automatically.

This monorepo uses pnpm workspaces and Turbo for efficient builds and development.