Commit Graph

63 Commits

Author SHA1 Message Date
venkat82 706b01ce75 feat(connected-accounts-py): namespace SHARED-connection surface under experimental
Aligns the Python SDK with the experimental wire shape used by Shared
Connections. The flat `account_type` / `acl_config_for_shared` kwargs on
`link()` and `authorize()` have moved under a single `experimental` dict,
and `update_acl` has moved off `composio.connected_accounts` onto the
`composio.experimental` namespace — same precedent as
`composio.experimental.tool` / `composio.experimental.Toolkit`.

The `experimental` namespace is the signal that the shape may change in
future releases. Pinning a SHARED connection in a session config and
direct execute by `connectedAccountId` are unchanged — only the
connection-create / patch / authorize surfaces are namespaced.

Also surfaces the `account_type=` filter on `composio.connected_accounts.list()`
so SHARED connections can be listed without dropping to the raw client.
The wire keeps this as a flat query param (`?account_type=`), so the
SDK keeps it flat too with the experimental signal carried in the value
enum description.

Caller migration:

  # before
  composio.connected_accounts.link(
      user_id, auth_config_id,
      account_type="SHARED",
      acl_config_for_shared={"allow_all_users": True},
  )
  composio.connected_accounts.update_acl(
      "ca_abc", allow_all_users=True,
  )
  session.authorize(
      "github",
      account_type="SHARED",
      acl_config_for_shared={"allow_all_users": True},
  )

  # after
  composio.connected_accounts.link(
      user_id, auth_config_id,
      experimental={
          "account_type": "SHARED",
          "acl_config_for_shared": {"allow_all_users": True},
      },
  )
  composio.experimental.update_acl(
      "ca_abc", allow_all_users=True,
  )
  session.authorize(
      "github",
      experimental={
          "account_type": "SHARED",
          "acl_config_for_shared": {"allow_all_users": True},
      },
  )

  # new — list SHARED connections
  shared = composio.connected_accounts.list(
      account_type="SHARED",
      user_ids=["user_creator"],
  )

composio-client bumped from 1.38.0 -> 1.39.0 so the generated typed
client carries the Experimental TypedDicts for link.create,
tool_router.session.link, and connected_accounts.patch.

Tests cover: experimental block forwarding (link + authorize),
no-op when omitted, empty-list preservation, typed error mapping for
the PRIVATE-with-ACL case, experimental.update_acl body construction +
deny-list handling + ValidationError when no fields are provided +
ValidationError when called without a bound client, and
list(account_type="SHARED") flat-filter delegation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 20:43:25 +05:30
venkat82 fafaa55f88 fix(py): ruff format the new files + regenerate uv.lock for 0.14.0
Two CI / review issues on #3401:

1. "Lint and Format Check" failed — `ruff format --check` flagged
   `composio/core/models/tool_router_session.py` and
   `tests/test_connected_accounts.py`. Local `nox -s chk` only runs
   `ruff check` (lint), not `ruff format --check`, so the gap slipped
   through. Ran `ruff format` on both.

2. Bugbot caught uv.lock drift — pyproject.toml bumped to 0.14.0 but
   uv.lock still recorded 0.13.0 from when the dep bump commit was
   created. Ran `uv lock` to regenerate; the lockfile now records 0.14.0.

No behaviour changes — formatting + lockfile sync only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 00:30:52 +05:30
venkat82 b283fbbccc feat(connected-accounts-py): surface account_type + per-user ACL on SHARED connections
Python mirror of #3392 (TypeScript SDK). Same Apollo-side feature shipped
across four Hermes PRs (#9860, #9882, #9887 internal, #9902), now exposed
through @composio/* Python SDK wrappers.

Bumped composio-client 1.37.0 → 1.38.0 (the regenerated client published
by composio-base-py#66 — contains account_type + acl_config_for_shared on
LinkCreateParams, ConnectedAccountPatchParams, SessionLinkParams, the
retrieve response, and the list response item).

SDK changes:

- composio.connected_accounts.link() now accepts `account_type` and
  `acl_config_for_shared`. Default behaviour (omit both) creates a
  PRIVATE connection exactly as before.
- New composio.connected_accounts.update_acl(nanoid, *, allow_all_users,
  allowed_user_ids, not_allowed_user_ids) — wraps PATCH /connected_accounts/{id}
  with the same semantics as the TS sibling. PATCH semantics: omit a
  param to leave unchanged; pass [] to clear an allow/deny list. Raises
  ValidationError if all three are None.
- composio.tool_router_session.authorize() options gain `account_type`
  and `acl_config_for_shared` — the /tool_router/session/{id}/link
  endpoint accepts the same fields.
- New typed errors in composio.exceptions:
    * ComposioAclOnlyForSharedError (400) — wired at link() / update_acl()
      / authorize() catch sites via the same
      `acl_config_for_shared is only valid on SHARED` substring match used
      in the TS SDK. Verified against Apollo's createConnectedAccount.ts.
    * ComposioSharedAccessDeniedError (403) — exported, not yet wrapped.
      Wraps when Tools.execute() error mapping lands in a follow-up.
    * ComposioSharedConnectionNotAccessibleError (400) — exported, not
      yet wrapped. Wraps when ToolRouterSession.create()/patch() session-
      validator error mapping lands.

Plumbing:
- python/composio/client/types.py re-exports `link_create_params` (the
  generated client's TypedDicts for link create payloads, including
  `ACLConfigForShared`).

Tests: 12 new tests in TestConnectedAccountsAcl class covering link()
ACL forwarding (4), AclOnlyForShared mapping on link() (1), pass-through
of unrelated BadRequestError (1), update_acl() body construction (3),
empty-fields rejection (1), AclOnlyForShared mapping on update_acl() (1),
pass-through of unrelated BadRequestError on update_acl() (1). 49 tests
pass (37 pre-existing + 12 new); full suite 635 pass / 31 skipped.

Verified: nox -s chk clean (ruff + mypy on src + tests).

Version: 0.13.0 → 0.14.0 (minor — additive surface).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 00:20:01 +05:30
jkomyno a7c2d16bf3 test(connected-accounts): cover REVOKED rollout and forward-compat
Adds the test coverage flagged in PR #3344 review item P1#5:

TS (`ts/packages/core/test/connectedAccounts/connectedAccountAuthStates.test.ts`):
- `Oauth2RevokedConnectionDataSchema` parses with and without optional
  `revoked_at`
- `ConnectionDataSchema` discriminated union accepts REVOKED for both
  OAUTH2 and S2S_OAUTH2 (the preempted Apollo arm from P1#1)
- `transformConnectedAccountResponse` does not silently drop `state`
  for REVOKED on either auth scheme
- Closure test on the `ConnectionStatuses` enum so a future Apollo
  addition trips a CI failure on purpose

TS CLI (`connected-accounts.list.cmd.test.ts`):
- Server returning an unrecognized status no longer crashes the
  command — the `catchTag('ParseError')` fallback warns the user to
  run `composio upgrade` and renders the row anyway

Python (`tests/test_connected_accounts.py`):
- `wait_for_connection` fails fast on FAILED / EXPIRED / REVOKED
  (parameterized) — the contract added by this PR
- `wait_for_connection` does NOT treat INACTIVE as terminal, so a
  connection briefly transiting through INACTIVE still recovers to
  ACTIVE — guards against the regression called out in P1#2
2026-05-07 10:29:14 +02:00
Dhawal Upadhyay 82e0038c7c bump generated clients for v3.1 2026-05-05 14:44:43 +05:30
Dhawal Upadhyay fed23cdc56 fix(tool-router): use generated execute offload params 2026-04-30 17:52:44 +05:30
Zen Agent 1c3276ba8d feat(sdk): add workbench sandbox compute tier (sandboxSize / sandbox_size)
Expose `workbench.sandboxSize` (TypeScript) / `workbench.sandbox_size`
(Python) on `ToolRouter.create()` so callers can pick the workbench
sandbox compute tier (`standard`, `medium`, `large`, `xlarge`).
Optional; the server defaults to `standard` (1 vCPU / 1 GB) when
omitted, so existing callers keep current behavior.

- Bump stainless clients to pick up the field on the wire:
  - `@composio/client` 0.1.0-alpha.66 -> 0.1.0-alpha.67
  - `composio-client` 1.33.0 -> 1.34.0
- TS: extend `ToolRouterCreateSessionConfigSchema.workbench` with
  `sandboxSize` and forward it as snake_case `sandbox_size`. Export
  `SandboxSize` type and `SandboxSizeSchema` zod enum.
- Python: extend `ToolRouterWorkbenchConfig` TypedDict with
  `sandbox_size` and forward it on the create payload. Export
  `SandboxSize` literal alias.
- Changeset: `@composio/core` patch.
- Tests: cover the snake_case forwarding and zod enum rejection.

Docs (Configuring Sessions / Workbench / changelog) are split into a
separate PR so they can land alongside the SDK release.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 11:47:42 +00:00
Musthaq Ahamad 27ed0c9bd6 security(core): sensitive path blocklist + beforeFileUpload hook (patch) (#3262)
## Summary

Security-hardening for automatic file upload in `@composio/core` (patch
release per changeset).

### Changes
- **Default denylist** for local paths before auto-upload /
`files.upload`: blocks common credential directories (e.g. `.ssh`,
`.aws`) and credential-like filenames (e.g. `.env`, default SSH private
keys). Resolves symlinks when the path exists.
- **Config:** `sensitiveFileUploadProtection`,
`fileUploadPathDenySegments` on `Composio`.
- **`beforeFileUpload`** hook (e.g. with `composio.tools.get` /
`tools.execute`): rewrite path, return `false` to abort, or throw.
- **Errors:** `ComposioSensitiveFilePathBlockedError`,
`ComposioFileUploadAbortedError`; file modifier errors exported from
`@composio/core` errors entry.
- **Changeset:** patch bump for `@composio/core`.

### Notes
- URLs and `File` blobs are not subject to the path denylist
(unchanged).
- Opt out of path checks only if required:
`sensitiveFileUploadProtection: false`.

### Tests
- `pnpm test` in `ts/packages/core` (799 tests) passed locally before
commit.

Made with [Cursor](https://cursor.com)
2026-04-23 18:42:16 +05:30
Musthaq Ahamad 40a7dae840 Experimental release for files in tool-router (#2876) 2026-03-13 16:32:13 +05:30
Musthaq Ahamad 2bccee8d55 feat(python): add file upload/download support and ToolRouterSession refactor (#2865) 2026-03-10 13:15:48 +05:30
jkomyno c619487bf7 chore: fix conflicts 2026-02-09 14:42:16 +04:00
Alberto Schiabel ff1e89b7c2 feat(py): support type-safe generic get_tools() based on given provider (#2469)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2026-02-09 15:55:51 +05:30
jkomyno 193d06440d fix(py): common-checks 2026-02-06 10:05:56 +04:00
jkomyno c73c66375b chore: fix conflicts 2026-02-01 16:51:45 +04:00
jkomyno 20ee1c84f2 chore: fix conflicts 2026-01-24 22:20:48 +04:00
Musthaq Ahamad b132aad902 Update client dependencies and add experimental assistive prompt (#2446) 2026-01-23 16:57:18 +05:30
jkomyno d159c4600f fix(py): address cursorbot, introduce json-schema-to-pydantic 2026-01-22 04:15:31 +04:00
jkomyno 1fb0881b4e fix(py): address cursorbot 2026-01-22 00:41:49 +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 30550484a1 Update composio client package to fix authConfig update changes (#2391)
Co-authored-by: Anshu Garg <166364920+anshugarg15@users.noreply.github.com>
2026-01-14 17:06:49 +05:30
Musthaq Ahamad c7e121706f Fix. Use dedicated tools endpoint for tool router (#2368) 2026-01-12 20:37:54 +05:30
Musthaq Ahamad 5d05d0b92a Fix pin python client dependency in py SDK (#2365) 2026-01-12 16:19:23 +05:30
Musthaq Ahamad a76b002705 Feat: Add support for enable/disable tags and search in toolkits (#2305) 2025-12-24 16:36:17 +05:30
Musthaq Ahamad 69cfedefb0 Add openWorldHint as a toolRouter Tag filters, with updated client dependencies (#2288) 2025-12-23 11:44:24 +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 df1c8ec8f4 Fix missing workbench options in session config (#2272) 2025-12-16 15:46:53 +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 87765434a9 test(py): add test for connected_accounts 2025-12-10 11:48:12 +01:00
jkomyno 83142d49c5 feat(py): port langchain to v1 2025-12-08 10:39:05 +01:00
Musthaq Ahamad f0e67c435c Fix tool router types from latest API changes (#2227)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-05 15:50:46 +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
Musthaq Ahamad 3b10fafc03 Fix provider tool execution in py sdk (#2203) 2025-11-26 15:14:59 +05:30
Musthaq Ahamad 97c4138cbb Chore: Update client dependencies and types for triggers (#2150) 2025-11-10 17:53:31 +05:30
Musthaq Ahamad f88ab9936d Fix: Telemetry and request headers (#2134) 2025-10-31 17:27:21 +05:30
Musthaq Ahamad 1ce11707a8 Chore: Update python deps, update types and method signatures (#2135) 2025-10-31 17:17:25 +05:30
Rahul Tarak 2b99c5efed basic experimental tool router docs (#2016) 2025-09-30 18:35:10 -07:00
prateek 106d024136 Update python sdk client dependency version (#2000)
Co-authored-by: Prateek <prateek@composio.dev>
2025-09-27 17:03:27 +05:30
Alberto Schiabel 6c201dd355 feat(core): experimental mcp via new createComposio({ experimental: { mcp: true } }) API (#1956)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
Co-authored-by: haxzie <musthu.gm@gmail.com>
Co-authored-by: Musthaq Ahamad <53584487+haxzie@users.noreply.github.com>
2025-09-23 15:28:10 +05:30
Musthaq Ahamad 8f98b9decc Bump client dependencies in python sdk (#1962) 2025-09-19 12:35:36 +05:30
Musthaq Ahamad b750b06c60 Fix python sdk type issues (#1949) 2025-09-17 00:50:09 +05:30
Jayesh Sharma 140007d47c update changelog and bump to 0.8.11 2025-09-13 18:42:44 +05:30
Musthaq Ahamad b9b005a6e1 Feat: Composio Connect Link Support in SDK (#1900)
Co-authored-by: Jayesh Sharma <wjayesh@outlook.com>
2025-09-10 15:20:33 +05:30
Alberto Schiabel 8d6f77d93b feat(cli): complete login command (#1862)
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
2025-08-22 11:29:17 +05:30
balyan.sid@gmail.com 1673d79383 chore: update composio package versions and clean up template imports
- Updated the version of the composio package from 0.8.1 to 0.8.5 in the uv.lock file.
- Removed unused imports of auth_scheme from Python and TypeScript templates for cleaner code.
- Adjusted the auth config ID format in TypeScript templates for consistency.
2025-07-29 15:23:49 +05:30
balyan.sid@gmail.com 9cb70c136f fix: update package metadata in uv.lock to remove upload-time fields 2025-07-24 23:10:39 +05:30
jkomyno c2e018e819 chore: merge next, fix conflicts 2025-07-23 02:34:21 +04:00
balyan.sid@gmail.com 565c04e9d9 chore: update package versions and modify documentation
- Updated versions of several Composio packages to 0.8.0 and 1.6.0 in uv.lock.
- Changed font settings in docs.yml from Roobert to Inter.
- Added CSS compilation and watch scripts to package.json.
- Removed unused CSS styles and added new styles for callouts in input.css.
- Enhanced migration guide and after-execution modifiers documentation with new examples.
2025-07-22 22:45:05 +05:30
jkomyno febdb4ede4 - Fixed how user context is retrieved from env var and ~/.composio/user_data.json, + test
- Add `logout` cmd + tests
- Fixed `login` login, but still waiting for update web UI
- Rewrite `config` module + tests
- Modify composio client wrapper to use newer @composio/client version (0.1.0-alpha.29)
- Fix config provider to use global `withConfigProvider` instead of local `setConfigProvider`
- Expand `whoami` cmd + tests
- Update vitest config
2025-07-20 14:32:29 +04:00
balyan.sid@gmail.com b304cb0f5d docs: update tool docs to add auth snippets as well as tool call snippets 2025-07-19 01:48:50 +05:30