Commit Graph

104 Commits

Author SHA1 Message Date
Dhawal Upadhyay ffb7539bb5 Fix ToolRouter example staging runs 2026-05-07 16:42:08 +05:30
Dhawal Upadhyay bccd32beae Refine ToolRouter preload docs and constants 2026-05-07 16:10:38 +05:30
Abir Taheer c96f094b15 feat(core): add session.update() for partial config updates (#3362)
## Summary
- Adds `session.update()` method to both TypeScript and Python SDKs
- Calls the existing `PATCH /api/v3/tool_router/session/{id}` endpoint
- Accepts the same config shape as `create()` (toolkits, tools, tags,
auth_configs, connected_accounts, manage_connections, workbench,
multi_account, preload)
- Mutates the session object in-place (preload, configVersion, warnings)

## Usage

### TypeScript
```typescript
const session = await composio.create('user_123', {
  toolkits: ['gmail'],
  manageConnections: true,
});

await session.update({
  toolkits: { enable: ['gmail', 'github'] },
  workbench: { enable: false },
});
```

### Python
```python
session = composio.create(user_id='user_123', toolkits=['gmail'])

session.update(
    toolkits={'enable': ['gmail', 'github']},
    workbench={'enable': False},
)
```

## Test plan
- [x] TypeScript: `tsc --noEmit` passes
- [x] TypeScript: all 874 existing tests pass
- [x] Python: mypy passes
- [x] Python: ruff lint + format clean
- [x] Python: all 82 tool_router tests pass
- [ ] Manual test: create session, call `session.update()`, verify
config changes

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-07 03:39:14 -07:00
Abir Taheer a17ecef33a docs: add custom tool session reuse examples 2026-05-07 02:29:34 -07:00
Abir Taheer a9977af2c1 docs: add session.update() examples for TypeScript and Python
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-07 02:28:10 -07:00
Dhawal Upadhyay b850d2cfdf Use gpt-5.2 for custom tools agent example 2026-05-06 19:06:37 +05:30
Dhawal Upadhyay eae717ac20 Clean up inline custom tools payload typing 2026-05-06 18:44:40 +05:30
Dhawal Upadhyay 8254999914 Address ToolRouter example review comments 2026-05-06 18:28:44 +05:30
Dhawal Upadhyay 9ad5705661 Add Tool Router preload examples 2026-05-06 16:35:33 +05:30
Dhawal Upadhyay d2155c028b Tighten Tool Router preload changes 2026-05-06 16:26:22 +05:30
Dhawal Upadhyay 3d2093fffb Add tool router preload examples 2026-05-06 16:15:17 +05:30
Musthaq Ahamad ebc9778595 feat(sdk): default-off auto file upload/download; add dangerouslyAllowAutoUploadDownloadFiles (#3260)
## Summary

Automatic tool file upload/download for `file_uploadable` fields is
**off by default** in TypeScript and Python. Callers must explicitly opt
in, and uploads from local paths are constrained by a fail-closed
allowlist.

## Changes

- **Removed (breaking):** `autoUploadDownloadFiles` (TS) /
`auto_upload_download_files` (Python) — the legacy default-on flag is
gone, not just deprecated.
- **New opt-in:** `dangerouslyAllowAutoUploadDownloadFiles` (TS) /
`dangerously_allow_auto_upload_download_files` (Python). When `true`,
`tools.get(...)` collapses `file_uploadable` schemas to `{ type:
'string', format: 'path' }` and the SDK stages local paths/URLs at
execute time.
- **New:** `fileUploadDirs?: string[] | false` — fail-closed allowlist
for local upload paths. `undefined` → `[<home>/.composio/temp]`; `false`
→ reject all local paths (URLs / `File` objects unaffected); explicit
`string[]` replaces the default. Components are matched on a path
boundary after `realpath`.
- **New:** `fileDownloadDir?: string` — directory where
`file_downloadable` results are staged.
- **New:** `beforeFileUpload` hook receives `source: 'path' | 'url' |
'file'` (TS) / `'path' | 'url'` (Python) so it can branch on input type.
- **New (TS):** when auto-upload is **off** and an LLM-driven
`tools.execute` is called against a tool with `file_uploadable` inputs,
the SDK emits a one-shot warning per tool slug pointing at
`composio.files.upload()` for manual staging.

## Migration

To restore previous behavior:

```ts
new Composio({
  apiKey: process.env.COMPOSIO_API_KEY!,
  dangerouslyAllowAutoUploadDownloadFiles: true,
  // Optional: tighten the allowlist beyond the default ~/.composio/temp
  fileUploadDirs: ['/srv/uploads'],
});
```

```python
Composio(api_key="...", dangerously_allow_auto_upload_download_files=True)
```

If you previously passed the legacy flag, remove it. There is no
transitional warning — TS and Python both reject the unknown property at
the type/keyword-arg level.

## Versioning

| Package | Bump |
| ------- | ---- |
| `@composio/core` | minor |
| `composio` (Python) | minor |
| Other `@composio/*` packages | patch (via changesets
`updateInternalDependencies: "patch"`) |

See
`docs/content/changelog/04-24-26-legacy-auto-upload-config-removal.mdx`
for the full migration writeup.
2026-04-28 10:55:03 +05:30
Abir Taheer 8aa93cf33d test: add tests for multi-account support and update docs
Add unit tests for transformToolRouterMultiAccountParams, ToolRouter.create
with multiAccount config, and ConnectedAccounts.update(). Add multi-account
example and document the feature in configuring-sessions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 00:24:17 -07:00
Rahul Tarak a8071e0d35 Add channel-aware Composio CLI skill builds (#3127)
## Summary
- Add a generated `composio-cli` skill source that can render stable and
beta variants from a single channel-aware definition.
- Introduce build and validation scripts to generate the skill output
and verify channel-specific content, references, and reproducibility.
- Update the CLI packaging workflow to validate skills and package the
correct release-channel build for beta vs stable releases.
- Expand the skill content with clearer top-level CLI guidance,
troubleshooting, developer-project workflows, and beta-only power-user
examples.
- Tighten CLI install/upgrade behavior and add tests covering skill
installation behavior.
- Add example validation to the repo test flow and align example package
metadata with workspace expectations.

## Testing
- Not run locally.
- Added `ts/packages/cli/scripts/validate-skills.ts` checks for
stable/beta markers, channel-specific content, and required reference
files.
- Added `ts/packages/cli/test/src/effects/install-skill.test.ts`
coverage for skill installation behavior.
- Added `ts/scripts/validate-examples.ts` to validate example package
manifests during `pnpm test`.
- CI workflow now runs `pnpm run validate:skills` before packaging CLI
skill files.
2026-04-07 01:02:45 -07:00
dhawal dacb617452 Revert "Release: custom tools alpha (0.7.0-alpha.0) (#2953)"
This reverts commit e14d6d98d5, reversing
changes made to 6bcac5beb8.
2026-03-18 23:57:39 +00:00
Dhawal Upadhyay de88244c62 chore: update custom-tools example with multi-task prompt and logging
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:22:45 -07:00
Dhawal Upadhyay 7b58c4a8d6 refactor: use official @composio/client types, proxyExecute via client method
- Bump @composio/client to 0.1.0-alpha.62 (adds proxyExecute, custom tool types)
- Replace hand-rolled CustomToolDefinition/CustomToolkitDefinition with
  SessionCreateParams.Experimental.CustomTool/CustomToolkit from client
- Type experimentalPayload as SessionCreateParams['experimental'] instead
  of Record<string, unknown>
- Replace raw .post() hack in SessionContext/ToolRouterSession proxyExecute
  with official client.toolRouter.session.proxyExecute()
- proxyParamsTransform now returns official ClientProxyExecuteParams type
- Add ToolRouterSessionProxyExecuteResponse (status, data, headers, binaryData)
  matching ToolProxyResponse from client — consistent with tools.proxyExecute()
- Build CustomToolsMap from API response slug/original_slug mapping instead
  of computing LOCAL_ prefix client-side
- Add custom-tools.ts example showing standalone, extension (with proxyExecute),
  and toolkit tools with OpenAI Agents

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 13:05:19 -07:00
Dhawal Upadhyay ba97624843 refactor: session.customTools/customToolkits, early validation, ctx rename, COMPOSIO_ rejection
- Add session.customTools({ toolkit? }) and session.customToolkits() methods
  returning registered tools with final slugs, schemas, and resolved toolkit
- Early slug length validation in createCustomTool (standalone + extension)
  and createCustomToolkit (per tool), with buildCustomToolsMap as safety net
- Reject COMPOSIO_ prefix in CustomToolSlugSchema (prevents meta tool shadowing)
- Rename execute fn param from session → ctx everywhere (type def, docs, examples, tests)
- SessionContextImpl as singleton on ToolRouterSession (created once in constructor)
- Rename internal byPrefixed/byOriginal → byFinalSlug/byOriginalSlug
- Store resolved toolkit on map entries for session.customTools() lookups
- Add RegisteredCustomTool and RegisteredCustomToolkit types to Session interface
- JSDoc on extendsToolkit: must be a valid Composio toolkit slug

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 14:31:50 -07:00
Dhawal Upadhyay 0270042316 feat: align custom tools API with backend refactor, add toolkits and extension tools
- Signature: `experimental_createTool(slug, opts)` / `experimental_createToolkit(slug, opts)`
- Three tool types: standalone (LOCAL_<SLUG>), extension (LOCAL_<TOOLKIT>_<SLUG>), custom toolkit
- Move customTools/customToolkits under `experimental` in session config
- Backend payload: `extends_toolkit` (not `toolkit`), omitted for standalone
- Slug validation: regex, no LOCAL_ prefix, max 60 chars prefixed
- Add `serializeCustomToolkits()`, `buildCustomToolsMap(tools, toolkits?)`
- Export `experimental_createTool`/`experimental_createToolkit` from `@composio/core`
- Add agent example with all 3 tool types (standalone, extension, custom toolkit)
- Update tool-router docs with custom tools section, session.execute/search/proxyExecute
- Update E2E fixtures and tests to new API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 11:12:54 -07:00
jkomyno 515147540f feat(ts): add trigger subscription example 2026-01-29 18:20:10 +04:00
jkomyno 408e7d080f fix(ts/core): webhook subscription with v1, v2, v3 response schemas 2026-01-29 18:20:02 +04:00
jkomyno 35684cd17c feat(ts): update some mastra examples 2026-01-27 04:08:10 +04:00
Alberto Schiabel 1e5fa09378 feat(ts/core): [breaking] remove node:crypto usage from triggers, composio.triggers.verifyWebhook is now async (#2436) 2026-01-23 19:58:12 +04:00
Musthaq Ahamad b132aad902 Update client dependencies and add experimental assistive prompt (#2446) 2026-01-23 16:57:18 +05:30
jkomyno 233d99d65f feat(ts): [breaking] remove node:crypto usage from triggers, composio.triggers.verifyWebhook is now async 2026-01-22 18:47:20 +04:00
Musthaq Ahamad 498505d7d9 Fix file upload/download for tools with anyOf schema (#2416) 2026-01-20 15:02:15 +05:30
Alberto Schiabel d80cd28f46 feat(ci): QoL improvements (#2404)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2026-01-20 11:25:12 +05:30
Musthaq Ahamad 277f02b1b0 Fix prevent providers from bundling @composio/core types (#2401) 2026-01-16 14:36:14 +05:30
jkomyno c012374884 feat(ts): bump openai to v6, fixing #2336 2026-01-15 02:25:02 +01:00
Alberto Schiabel b28c2d7bb1 fix(core): support v1, v2, v3 in composio.triggers.verifyWebhooks (#2361)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2026-01-13 13:06:03 +05:30
Musthaq Ahamad c7e121706f Fix. Use dedicated tools endpoint for tool router (#2368) 2026-01-12 20:37:54 +05:30
Alberto Schiabel 37a89abe57 feat(ts): upgrade Vercel provider to support AI v6 (#2314)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2026-01-12 18:24:28 +05:30
Musthaq Ahamad eeb296b9a8 Fix claude agent sdk (#2307) 2025-12-27 14:25:26 +05:30
Alberto Schiabel 9a4465d87b feat(core): add Anthropic Claude Code Agents provider (#2285)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2025-12-23 11:18:29 +05:30
Musthaq Ahamad 5a500e0288 Merge branch 'next' into feat/ts-langchain-v1 2025-12-17 11:54:57 +05:30
Musthaq Ahamad 73db5f50aa Fix wrong types for callback url in session.authorize (#2273) 2025-12-16 18:05:31 +05:30
jkomyno 3e5004e003 chore: fix conflicts 2025-12-15 12:02:24 +02:00
Musthaq Ahamad a550aeb289 Chore: Move tool router out of experimental and remove depreacted mcp (#2267) 2025-12-13 12:58:09 +05:30
Musthaq Ahamad f97d191cc6 Add native tool execution support for tool router in python (#2266) 2025-12-12 22:17:10 +05:30
jkomyno 794582fb19 chore: fix conflicts 2025-12-11 14:45:36 +01:00
Musthaq Ahamad 07551cd174 Add native tool support for tool router TS SDK (#2249) 2025-12-11 18:40:31 +05:30
jkomyno 27b0c0138f feat(ts): use langchain v1 2025-12-10 12:28:31 +01:00
jkomyno 379c1bd9cb feat(ts): update tool-router openai-agents example 2025-12-10 11:34:25 +01:00
jkomyno 2dc7435c0b chore: merge next 2025-12-08 10:12:43 +01:00
Musthaq Ahamad 31521bd1a5 Fix typedocs and examples for toolkit version (#2212)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2025-12-04 16:03:23 +05:30
Musthaq Ahamad 9e002c5ca3 Tool Router API Integration (#2214)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2025-12-04 15:31:09 +05:30
jkomyno a71c91d4e9 fix: "pnpm audit --prod" 2025-12-03 23:49:15 +01:00
jkomyno e6ee55af94 chore(ts): add CommonJS example in ts/examples/cjs 2025-12-03 23:23:10 +01:00
Musthaq Ahamad b5cc23fab0 Bump TS sdk version for release (#2207) 2025-11-25 17:24:10 +05:30
jkomyno b61bb0cdd1 feat(security): add "pnpm audit --fix" check 2025-11-25 00:40:37 +04:00