@devries-cameron20 / composio Mirror · read-only / commits / d2d41487e
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 07:15 UTC

feat: add trigger instance type and polling interval to triggers.create (PLEN-4489) (#5186)

## Summary ComposioHQ/platform#13820 lets a trigger instance be created as a webhook or a poll, and reports which one it uses. The upsert endpoint gains `type` and `polling_interval`, and the upsert and list-active responses gain `type`, `fallback_reason` and `polling_interval`. The trigger types API already returns `type`, `types` and `requires_webhook_endpoint_setup`. The TypeScript SDK maps every request and response field by hand, so none of these reach SDK users today. The Python SDK returns the generated models, but `triggers.create()` has no keyword arguments for the two new request fields. ComposioHQ/platform#13820 is live in production, and `@composio/client` / `composio-client` 2.0.0 carry its fields, so this PR moves both clients from rc.23 to 2.0.0. Linear: [PLEN-4489](https://linear.app/composio/issue/PLEN-4489/sdk-updates-for-trigger-apis) ## Changes - TypeScript `triggers.create()`: accepts `type` (`'webhook' | 'poll'`) and `pollingInterval` (positive integer), and returns `type`, `fallbackReason` and `pollingInterval` alongside `triggerId`. - TypeScript `triggers.listActive()`: each item carries `type`, `fallbackReason` and `pollingInterval`. - TypeScript `triggers.getType()` / `listTypes()`: return `type`, `types` and `requiresWebhookEndpointSetup`. `listTypes()` items now go through the same mapper as `getType()`, so they're camelCase like the rest of the SDK. - Python `triggers.create()`: accepts `type` and `polling_interval`. Its responses, `list_active()` and `get_type()` already return the generated models, so the new response fields arrive with the client bump. - Client bump: `@composio/client` (pnpm catalog and lockfile) and `composio-client` (`python/pyproject.toml`, `python/setup.py`, `uv.lock`) move from `2.0.0-rc.23` to `2.0.0` ([release](https://github.com/ComposioHQ/composio-client/releases/tag/client-v2.0.0)). CLI test stubs for `createTrigger` gain the three response fields that 2.0.0 makes required; the CLI already prints whatever the API returns. - Breaking in the client, passed through by this bump: POST and PATCH requests, including tool execution and trigger creation, are sent once unless the individual call sets `maxRetries`. Core never set `maxRetries`, so its writes stop retrying on a lost response or retryable status. Other requests keep their retries. - `pyasn1` moves from 0.6.4 to 0.6.5 in `uv.lock`, the release that fixes the four CVEs `py.audit.yml` reports against 0.6.4 (CVE-2026-119194 to CVE-2026-119197). - Changesets: `trigger-instance-type` and `client-2-0-0`, both `@composio/core` and `@composio/slim` minor. ## Type of change - [ ] Bug fix - [x] New feature - [ ] Refactor/Chore - [ ] Documentation - [ ] Breaking change ## How Has This Been Tested? Against the published 2.0.0: - `pnpm typecheck` (workspace): clean. - `pnpm --filter @composio/core test`: 1971 passed, 2 expected fail. - `pnpm --filter @composio/cli test`: 2915 passed, 1 skipped. 21 failed locally, all outside triggers: 19 in `cli-main` and `tools.execute.transport` pass once `CLAUDECODE` is unset (the CLI prints a Claude Code tip), and the 2 `upgrade-binary` beta-release tests fail the same way without this bump. - `nox -s chk` (ruff and mypy on `composio/`, `providers/`, `tests/`, `scripts/`): clean. - `nox -s tst --force-python 3.12`: 2632 passed, 34 skipped; provider suites pass. - `py.audit.yml`'s workspace export and pip-audit, run locally: no known vulnerabilities. - Prettier and oxlint on the changed TypeScript files; ruff format and check on the changed Python files. ## Checklist - [ ] I have read the Code of Conduct and this PR adheres to it - [ ] I have read and understand every line of this diff, including any LLM-generated code - [x] Any third-party docs links or promotional content follow the [third-party links policy](https://github.com/ComposioHQ/composio/blob/next/CONTRIBUTING.md#third-party-links-in-docs) - [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 - Not in this PR: docs-site pages for the new fields, and CLI flags for `triggers create`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: jkomyno <alberto@composio.dev>

Anshu Garg committed Nov 3, 2026 at 15:05 UTC d2d41487e0002a393892ffc9fd837afa7391b48c
30 files changed +306 -123
.agents/skills/cli-command/references/implementation.md
+1 -1
@@ -33,7 +33,7 @@ test/src/commands/<group>/<name>/<group>.<name>.handler.test.ts handler-level
33
34 ## Effect Patterns
35
36 -The CLI is on `effect@4.0.5` (exact pin) plus `@effect/platform-bun`/`@effect/vitest` at the same version. `@effect/cli` and `@effect/platform` no longer exist as separate deps — their functionality is consolidated into `effect`'s barrel and `effect/*` submodules.
36 +The CLI is on `effect@^4.1.0` (workspace range) plus `@effect/platform-bun`/`@effect/vitest` at the same version. `@effect/cli` and `@effect/platform` no longer exist as separate deps — their functionality is consolidated into `effect`'s barrel and `effect/*` submodules.
37
38 Common shape. The command file declares the surface and passes the handler to the three-argument `Command.make`:
39
.agents/skills/effect-v4/SKILL.md
+6 -6
@@ -1,6 +1,6 @@
1 ---
2 name: effect-v4
3 -description: Write, review, or upgrade Effect v4 code in the Composio CLI, cli-keyring, and json-schema-to-effect-schema packages, all pinned exactly to effect@4.0.5 — Context.Service and explicit layers, Schema.TaggedError and typed recovery, the effect/cli command surface, and the vendored effect source oracle. Use when writing or reviewing Effect v4 code, answering a v4 API question, working in effect/cli, defining a Context.Service service, modeling an error with Schema.TaggedError, bumping the Effect pins, or verifying an unfamiliar API against ts/vendor/effect. Do not use for CLI command UX/wiring design (use cli-command) or CLI E2E tests (use cli-e2e).
3 +description: Write, review, or upgrade Effect v4 code in the Composio CLI, cli-keyring, and json-schema-to-effect-schema packages, all using the matching range effect@^4.1.0 — Context.Service and explicit layers, Schema.TaggedError and typed recovery, the effect/cli command surface, and the vendored effect source oracle. Use when writing or reviewing Effect v4 code, answering a v4 API question, working in effect/cli, defining a Context.Service service, modeling an error with Schema.TaggedError, bumping the Effect pins, or verifying an unfamiliar API against ts/vendor/effect. Do not use for CLI command UX/wiring design (use cli-command) or CLI E2E tests (use cli-e2e).
4 ---
5
6 # Effect v4
@@ -8,13 +8,13 @@ description: Write, review, or upgrade Effect v4 code in the Composio CLI, cli-k
8 The CLI, `@composio/cli-keyring`, and `@composio/json-schema-to-effect-schema` run on
9 Effect v4. Every claim below is grounded in the migrated source, not memory of v3.
10
11 -## Exact version matrix
11 +## Version matrix
12
13 `effect`, `@effect/platform-bun`, and `@effect/vitest`
14 -are pinned to the **same exact** `4.0.5` — never `^`, `@next`, or a mismatched
15 -version across packages. `@effect/cli` and `@effect/platform` no longer exist as
14 +use the **same range** `^4.1.0`; keep their lockfile resolutions aligned. Do not use
15 +`@next` or mismatched versions across packages. `@effect/cli` and `@effect/platform` no longer exist as
16 dependencies; their surfaces are consolidated into `effect` and `effect/*`.
17 -See [versions.json](versions.json) for the full matrix (also `typescript`, `vitest`).
17 +See [versions.json](versions.json) for the exact example-check matrix (also `typescript`, `vitest`).
18
19 ## Read next
20
@@ -52,7 +52,7 @@ when an excerpt or explanation disagrees with the implementation.
52 ESLint bans them in `ts/packages/cli/src`.
53 - Treat every remembered v3 package name and API as wrong until verified against
54 `ts/vendor/effect` (read-only source oracle — never edit or import from it) and the
55 - installed `effect@4.0.5` typings. Source may be ahead of the published package;
55 + installed `effect@^4.1.0` typings. Source may be ahead of the published package;
56 the compiler is the compatibility gate.
57
58 ## Verification
.agents/skills/effect-v4/references/cli-surface.md
+1 -1
@@ -1,6 +1,6 @@
1 # Effect CLI in this repository
2
3 -The framework lives in `effect/cli`. The installed `effect@4.0.5` typings determine which interfaces compile. The CLI's registration and invocation modules determine how the repository uses them.
3 +The framework lives in `effect/cli`. The installed `effect@^4.1.0` typings determine which interfaces compile. The CLI's registration and invocation modules determine how the repository uses them.
4
5 ## Command registration
6
.agents/skills/effect-v4/references/upgrade-workflow.md
+8 -6
@@ -15,26 +15,28 @@ Check the target version's npm publish timestamp
15 pin — bumping too early makes `pnpm install` fail to resolve, not silently ignore the
16 constraint.
17
18 -## 2. Bump the exact pins together
18 +## 2. Bump the dependency ranges together
19
20 -Every one of these must move to the same new exact version in the same change — never
20 +Every one of these must move to the same new range in the same change — never
21 upgrade one and leave the others behind:
22
23 - `pnpm-workspace.yaml` catalog: `effect`, `@effect/platform-bun`,
24 `@effect/vitest`.
25 -- `ts/packages/cli-keyring/package.json`: its `effect` peer dependency uses an exact
26 - version (not `catalog:`); update that pin too.
25 +- `ts/packages/cli-keyring/package.json`: its `effect` peer dependency uses an explicit
26 + range (not `catalog:`); update that range too.
27 - Any other package pinning `effect` outside the catalog — grep for `"effect":` across
28 `ts/packages/*/package.json` before assuming the catalog covers everything.
29
30 -Keep every pin an exact version string (no `^`, no `@next`, no range).
30 +The workspace currently uses `^4.1.0`. Use matching ranges for the runtime and
31 +satellites, and keep the example-check matrix in `versions.json` on their exact
32 +lockfile resolution.
33 Confirm the lockfile resolves matching versions.
34
35 ## 3. Advance the vendored source oracle
36
37 `ts/vendor/effect` is a git submodule pinned at a commit on the canonical
38 `Effect-TS/effect` repo, currently
37 -`967a7dc5963a23d3705259d60ccac1ce9f060a3b` (tagged `effect@4.0.3`
39 +`bc492f0965dc0f6a83cefd141071c5ead10f7efa` (tagged `effect@4.1.1`
40 at the time of writing — confirm with `git submodule status ts/vendor/effect`). Advance
41 it to the commit/tag matching the new npm version:
42
.agents/skills/effect-v4/versions.json
+3 -3
@@ -1,7 +1,7 @@
1 {
2 - "effect": "4.0.5",
3 - "@effect/platform-bun": "4.0.5",
4 - "@effect/vitest": "4.0.5",
2 + "effect": "4.1.1",
3 + "@effect/platform-bun": "4.1.1",
4 + "@effect/vitest": "4.1.1",
5 "@types/node": "26.6.4",
6 "typescript": "6.0.2",
7 "vitest": "5.0.3"
.agents/skills/typescript-testing/SKILL.md
+1 -1
@@ -1,6 +1,6 @@
1 ---
2 name: typescript-testing
3 -description: Select and run TypeScript SDK verification for packages, examples, type checks, linting, builds, Vitest suites, Effect v4 CLI tests, and runtime E2E tests. Use when adding tests, diagnosing TypeScript CI, choosing a focused test command, validating TypeScript package changes, or writing/porting CLI tests against effect@4.0.5 and @effect/vitest. Do not use for Python-only checks.
3 +description: Select and run TypeScript SDK verification for packages, examples, type checks, linting, builds, Vitest suites, Effect v4 CLI tests, and runtime E2E tests. Use when adding tests, diagnosing TypeScript CI, choosing a focused test command, validating TypeScript package changes, or writing/porting CLI tests against effect@^4.1.0 and @effect/vitest. Do not use for Python-only checks.
4 ---
5
6 # TypeScript Testing
.agents/skills/typescript-testing/references/effect-v4-cli.md
+2 -2
@@ -1,7 +1,7 @@
1 # Effect v4 CLI testing
2
3 -The CLI test suite (`ts/packages/cli/test/`) runs on `effect@4.0.5` and
4 -`@effect/vitest@4.0.5` (pinned exactly, matching `ts/packages/cli/package.json` and the
3 +The CLI test suite (`ts/packages/cli/test/`) runs on `effect@^4.1.0` and
4 +`@effect/vitest@^4.1.0` (matching range, matching `ts/packages/cli/package.json` and the
5 workspace catalog in `pnpm-workspace.yaml`). `@effect/cli` and `@effect/platform` no longer exist
6 as dependencies — their functionality moved into `effect`/`effect/*`. Read
7 `ts/packages/cli/test/__utils__/services/test-layer.ts` before writing a new test suite; it is the
.agents/skills/typescript-testing/references/test-commands.md
+1 -2
@@ -39,8 +39,7 @@ pnpm --filter @composio/<provider> typecheck
39
40 ## CLI Effect v4 tests
41
42 -`ts/packages/cli` tests run on `effect@4.0.5` and a matching `@effect/vitest` (both pinned
43 -exactly in `pnpm-workspace.yaml`). Read [effect-v4-cli.md](effect-v4-cli.md) before writing or
42 +`ts/packages/cli` tests run on `effect@^4.1.0` and a matching `@effect/vitest` (both using matching ranges in `pnpm-workspace.yaml`). Read [effect-v4-cli.md](effect-v4-cli.md) before writing or
43 porting a CLI test — it covers `it.effect`/`layer(...)` usage, explicit per-service test layers
44 (v4's `Context.Service` has no auto-generated `.Default` the way v3's `Effect.Service` did), and
45 the `@effect/platform-bun` subpath-import rule that keeps the Node-hosted Vitest runner from
.changeset/client-2-0-0.md new
+6
@@ -0,0 +1,6 @@
1 +---
2 +'@composio/core': minor
3 +'@composio/slim': minor
4 +---
5 +
6 +Requires `@composio/client` `2.0.0`. POST and PATCH requests, including tool execution and trigger creation, are now sent once instead of being retried on a lost response or a retryable status, because a write can complete on the server after its response is lost. Other requests keep their retries. On the client returned by `getClient()`, a write retries only when that call sets `maxRetries`.
.changeset/trigger-instance-type.md new
+6
@@ -0,0 +1,6 @@
1 +---
2 +'@composio/core': minor
3 +'@composio/slim': minor
4 +---
5 +
6 +`composio.triggers.create()` accepts `type` (`'webhook'` or `'poll'`, for a trigger that supports both) and `pollingInterval` (minutes between polls, which wins over `triggerConfig.interval`), and returns the instance's `type`, `fallbackReason` and `pollingInterval` along with `triggerId`. `composio.triggers.listActive()` items carry the same three fields, and `getType()` / `listTypes()` return each trigger type's `type`, `types` and `requiresWebhookEndpointSetup`.
pnpm-lock.yaml
+44 -43
@@ -28,17 +28,17 @@ catalogs:
28 specifier: ^5.20261019.1
29 version: 5.20261019.1
30 '@composio/client':
31 - specifier: 2.0.0-rc.23
32 - version: 2.0.0-rc.23
31 + specifier: 2.0.0
32 + version: 2.0.0
33 '@effect/language-service':
34 specifier: ^0.87.5
35 version: 0.87.5
36 '@effect/platform-bun':
37 - specifier: 4.0.5
38 - version: 4.0.5
37 + specifier: ^4.1.0
38 + version: 4.1.1
39 '@effect/vitest':
40 - specifier: 4.0.5
41 - version: 4.0.5
40 + specifier: ^4.1.0
41 + version: 4.1.1
42 '@mastra/core':
43 specifier: 1.53.0
44 version: 1.53.0
@@ -58,8 +58,8 @@ catalogs:
58 specifier: ^18.0.8
59 version: 18.0.8
60 effect:
61 - specifier: 4.0.5
62 - version: 4.0.5
61 + specifier: ^4.1.0
62 + version: 4.1.1
63 hono:
64 specifier: ^4.13.13
65 version: 4.13.13
@@ -155,7 +155,7 @@ importers:
155 version: link:ts/packages/providers/openai
156 '@effect/platform-bun':
157 specifier: 'catalog:'
158 - version: 4.0.5(effect@4.0.5)
158 + version: 4.1.1(effect@4.1.1)
159 '@types/bun':
160 specifier: 'catalog:'
161 version: 1.4.3
@@ -170,7 +170,7 @@ importers:
170 version: 5.0.5(vitest@5.0.5)
171 effect:
172 specifier: 'catalog:'
173 - version: 4.0.5
173 + version: 4.1.1
174 husky:
175 specifier: ^9.1.7
176 version: 9.1.7
@@ -998,7 +998,7 @@ importers:
998 dependencies:
999 '@composio/client':
1000 specifier: 'catalog:'
1001 - version: 2.0.0-rc.23(effect@4.0.5)
1001 + version: 2.0.0(effect@4.1.1)
1002 '@composio/core':
1003 specifier: workspace:*
1004 version: link:../../packages/core
@@ -1246,7 +1246,7 @@ importers:
1246 version: link:../cli-keyring
1247 '@composio/client':
1248 specifier: 'catalog:'
1249 - version: 2.0.0-rc.23(effect@4.0.5)
1249 + version: 2.0.0(effect@4.1.1)
1250 '@composio/core':
1251 specifier: workspace:*
1252 version: link:../core
@@ -1258,10 +1258,10 @@ importers:
1258 version: link:../ts-builders
1259 '@effect/platform-bun':
1260 specifier: 'catalog:'
1261 - version: 4.0.5(effect@4.0.5)
1261 + version: 4.1.1(effect@4.1.1)
1262 effect:
1263 specifier: 'catalog:'
1264 - version: 4.0.5
1264 + version: 4.1.1
1265 extract-zip:
1266 specifier: ^2.0.1
1267 version: 2.0.1(supports-color@10.2.2)
@@ -1307,7 +1307,7 @@ importers:
1307 version: 0.87.5
1308 '@effect/vitest':
1309 specifier: 'catalog:'
1310 - version: 4.0.5(effect@4.0.5)(vitest@5.0.5)
1310 + version: 4.1.1(effect@4.1.1)(vitest@5.0.5)
1311 '@types/bun':
1312 specifier: 'catalog:'
1313 version: 1.4.3
@@ -1340,7 +1340,7 @@ importers:
1340 version: 1.4.3
1341 effect:
1342 specifier: 'catalog:'
1343 - version: 4.0.5
1343 + version: 4.1.1
1344 tsdown:
1345 specifier: 'catalog:'
1346 version: 0.23.1(@arethetypeswrong/core@0.18.5)(publint@0.3.25)(tsx@4.23.15)(typescript@7.0.2)(unrun@0.2.27(@emnapi/core@1.11.2)(@emnapi/runtime@1.11.3))
@@ -1355,7 +1355,7 @@ importers:
1355 dependencies:
1356 '@composio/client':
1357 specifier: 'catalog:'
1358 - version: 2.0.0-rc.23(effect@4.0.5)
1358 + version: 2.0.0(effect@4.1.1)
1359 '@composio/json-schema-to-zod':
1360 specifier: workspace:*
1361 version: link:../json-schema-to-zod
@@ -1462,7 +1462,7 @@ importers:
1462 version: 4.1.1
1463 effect:
1464 specifier: 'catalog:'
1465 - version: 4.0.5
1465 + version: 4.1.1
1466 devDependencies:
1467 '@composio/json-schema-to-zod':
1468 specifier: workspace:*
@@ -1772,7 +1772,7 @@ importers:
1772 dependencies:
1773 '@composio/client':
1774 specifier: 'catalog:'
1775 - version: 2.0.0-rc.23(effect@4.0.5)
1775 + version: 2.0.0(effect@4.1.1)
1776 '@composio/json-schema-to-zod':
1777 specifier: workspace:*
1778 version: link:../json-schema-to-zod
@@ -2324,8 +2324,8 @@ packages:
2324 resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==}
2325 engines: {node: '>=0.1.90'}
2326
2327 - '@composio/client@2.0.0-rc.23':
2328 - resolution: {integrity: sha512-6WyiSimJPWEqbbNgHj2oOFB2jhpSqtjZjTuedD/QSJsRmDKQUarGgUClsa+XjD0HAiJTM7x0eNsKIM7RimfvHQ==}
2327 + '@composio/client@2.0.0':
2328 + resolution: {integrity: sha512-6NK+TNvpsencFPMLJSm3gaVLl0rwYh+8N8pfRywuK9YcjxsP8H0zunO8h/1xg3rq1iV5/KUxKMGwNWookQLbMQ==}
2329 engines: {node: '>=22'}
2330 peerDependencies:
2331 effect: '*'
@@ -2371,21 +2371,21 @@ packages:
2371 resolution: {integrity: sha512-np/zJgk71/PyHxtoqyUKLYcpQhoRBI+L6+1Z0ILk35JSQ/lvXzwlwOwddYZLDkeC4bdF2ukKekqKlla/F88R5w==}
2372 hasBin: true
2373
2374 - '@effect/platform-bun@4.0.5':
2375 - resolution: {integrity: sha512-tB/GapZ/bVoCbwRgnojGP4TwopvkMoFoSCipXT1sf0guvG/2oRVhWzJW/1vkrYFEdLM7XyRnVVLrSJyqdok7DA==}
2374 + '@effect/platform-bun@4.1.1':
2375 + resolution: {integrity: sha512-//p0xPsbvuRfcO+cvq5JqVzR0TLUUS5yNC40xbZ08JNiszg5IxypAgrpKswKpjs2lYvybxdw5DSyVcEWW33Cbg==}
2376 peerDependencies:
2377 - effect: ^4.0.5
2377 + effect: ^4.1.1
2378
2379 - '@effect/platform-node-shared@4.0.5':
2380 - resolution: {integrity: sha512-a8rCdEkfZBGe9C6bsIjxVZuRp73svIyK5IHwHdDAVsvZXjrbkxusfI+rZ8WlX31RP1mKizwI/E72GQTNfdMWHw==}
2381 - engines: {node: '>=18.0.0'}
2379 + '@effect/platform-node-shared@4.1.1':
2380 + resolution: {integrity: sha512-29zdEDs3i5W+t92+mWTFNSfzSHsTpZMcFZ9k4lkkz4tETlC1m4lRwjdjieJtvQ/bKHMnYrCtZwizsBFSf3L5Yg==}
2381 + engines: {node: '>=22.19.0'}
2382 peerDependencies:
2383 - effect: ^4.0.5
2383 + effect: ^4.1.1
2384
2385 - '@effect/vitest@4.0.5':
2386 - resolution: {integrity: sha512-q64paZ/i4V2NiRhTyqCmT2KiDbFjlxc2EZrZca8GGt+Nf8844946HyJM5bPk/q+YeRkFSxIrlCs+J+LSfky/wA==}
2385 + '@effect/vitest@4.1.1':
2386 + resolution: {integrity: sha512-VkE9EUXE4G7mXMmV3X3Iu+6k3pZswWjOf7PB2qiaHMoFAZAPtHp+eUZo9oJM4Ip5z+ghQ9K0IDAQM2iG6+w5MA==}
2387 peerDependencies:
2388 - effect: ^4.0.5
2388 + effect: ^4.1.1
2389 vitest: '>=5.0.0 <6.0.0'
2390
2391 '@emnapi/core@1.11.2':
@@ -4042,6 +4042,7 @@ packages:
4042 '@smithy/core@3.36.0':
4043 resolution: {integrity: sha512-3hJiwG1F5t1SoXqp/yOCmYXziyx7ZVqF63S5W6YU201e/qwVaHPex+E/3vvyY9a3ORq/b+BydeNZpP2saQ9X2g==}
4044 engines: {node: '>=18.0.0'}
4045 + deprecated: Deprecated due to a bug in custom logger data redaction. See https://github.com/aws/aws-sdk-js-v3/issues/8393.
4046
4047 '@smithy/credential-provider-imds@4.5.2':
4048 resolution: {integrity: sha512-A9uSdn72ozbRUSit0eib0TW7nXuNPlaeM0zcGkJ+nE6tFcSDbnmtwoxbTCFBukVQcszDAyvsd7+rTduPTXpygg==}
@@ -4819,8 +4820,8 @@ packages:
4820 ee-first@1.1.1:
4821 resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==}
4822
4822 - effect@4.0.5:
4823 - resolution: {integrity: sha512-BY4/28NlpOd99yzmV741xbVGmp+1U7tks4oB7F/Png64bTa5tm5eCA6W0RiXsnuLDDoJpjfVSo4Dnq4BZb/89Q==}
4823 + effect@4.1.1:
4824 + resolution: {integrity: sha512-XYu65BrcmNqu5i7PPvP4dqL+R5ma37zIsfuSPjcn78mog+6e5PkilNg7Xo+pBpjXJYlWEIpH4j91tMrfW05CMw==}
4825
4826 emoji-regex@8.0.0:
4827 resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
@@ -7540,9 +7541,9 @@ snapshots:
7541 '@colors/colors@1.5.0':
7542 optional: true
7543
7543 - '@composio/client@2.0.0-rc.23(effect@4.0.5)':
7544 + '@composio/client@2.0.0(effect@4.1.1)':
7545 optionalDependencies:
7545 - effect: 4.0.5
7546 + effect: 4.1.1
7547
7548 '@cspotcode/source-map-support@0.8.1':
7549 dependencies:
@@ -7643,26 +7644,26 @@ snapshots:
7644
7645 '@effect/language-service@0.87.5': {}
7646
7646 - '@effect/platform-bun@4.0.5(effect@4.0.5)':
7647 + '@effect/platform-bun@4.1.1(effect@4.1.1)':
7648 dependencies:
7648 - '@effect/platform-node-shared': 4.0.5(effect@4.0.5)
7649 - effect: 4.0.5
7649 + '@effect/platform-node-shared': 4.1.1(effect@4.1.1)
7650 + effect: 4.1.1
7651 transitivePeerDependencies:
7652 - bufferutil
7653 - utf-8-validate
7654
7654 - '@effect/platform-node-shared@4.0.5(effect@4.0.5)':
7655 + '@effect/platform-node-shared@4.1.1(effect@4.1.1)':
7656 dependencies:
7657 '@types/ws': 8.18.2
7657 - effect: 4.0.5
7658 + effect: 4.1.1
7659 ws: 8.22.0
7660 transitivePeerDependencies:
7661 - bufferutil
7662 - utf-8-validate
7663
7663 - '@effect/vitest@4.0.5(effect@4.0.5)(vitest@5.0.5)':
7664 + '@effect/vitest@4.1.1(effect@4.1.1)(vitest@5.0.5)':
7665 dependencies:
7665 - effect: 4.0.5
7666 + effect: 4.1.1
7667 vitest: 5.0.5(@opentelemetry/api@1.9.1)(@types/node@26.6.5)(@vitest/ui@5.0.5)(vite@7.3.5(@types/node@26.6.5)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1))
7668
7669 '@emnapi/core@1.11.2':
@@ -9802,7 +9803,7 @@ snapshots:
9803
9804 ee-first@1.1.1: {}
9805
9805 - effect@4.0.5: {}
9806 + effect@4.1.1: {}
9807
9808 emoji-regex@8.0.0: {}
9809
pnpm-workspace.yaml
+4 -4
@@ -33,10 +33,10 @@ catalog:
33 '@clack/prompts': '^1.8.1'
34 '@cloudflare/vitest-pool-workers': 0.23.0
35 '@cloudflare/workers-types': ^5.20261019.1
36 - '@composio/client': 2.0.0-rc.23
36 + '@composio/client': 2.0.0
37 '@effect/language-service': ^0.87.5
38 - '@effect/platform-bun': 4.0.5
39 - '@effect/vitest': 4.0.5
38 + '@effect/platform-bun': ^4.1.0
39 + '@effect/vitest': ^4.1.0
40 # Bisected against ts/examples/mastra's `cf:dry-run`: 1.54.0 moved the
41 # workspace/sandbox subsystem behind `@mastra/core/agent`, which drags execa
42 # (-> npm-run-path -> unicorn-magic) into the Workers bundle and fails to
@@ -46,7 +46,7 @@ catalog:
46 '@types/bun': ^1.4.3
47 ai: ^7.0.146
48 dotenv: ^18.0.8
49 - effect: 4.0.5
49 + effect: ^4.1.0
50 hono: ^4.13.13
51 openai: ^7.39.0
52 picocolors: ^1.1.1
python/composio/core/models/triggers.py
+15 -1
@@ -1274,6 +1274,8 @@ class Triggers(Resource):
1274 *,
1275 connected_account_id: str,
1276 trigger_config: t.Optional[t.Dict[str, t.Any]] = None,
1277 + type: t.Optional[t.Literal["webhook", "poll"]] = None,
1278 + polling_interval: t.Optional[int] = None,
1279 ) -> trigger_instance_upsert_response.TriggerInstanceUpsertResponse: ...
1280
1281 @t.overload
@@ -1283,6 +1285,8 @@ class Triggers(Resource):
1285 *,
1286 user_id: str,
1287 trigger_config: t.Optional[t.Dict[str, t.Any]] = None,
1288 + type: t.Optional[t.Literal["webhook", "poll"]] = None,
1289 + polling_interval: t.Optional[int] = None,
1290 ) -> trigger_instance_upsert_response.TriggerInstanceUpsertResponse: ...
1291
1292 def create(
@@ -1292,6 +1296,8 @@ class Triggers(Resource):
1296 user_id: t.Optional[str] = None,
1297 connected_account_id: t.Optional[str] = None,
1298 trigger_config: t.Optional[t.Dict[str, t.Any]] = None,
1299 + type: t.Optional[t.Literal["webhook", "poll"]] = None,
1300 + polling_interval: t.Optional[int] = None,
1301 ) -> trigger_instance_upsert_response.TriggerInstanceUpsertResponse:
1302 """
1303 Create a trigger instance
@@ -1302,7 +1308,13 @@ class Triggers(Resource):
1308 active connection for this user and the trigger's toolkit.
1309 :param connected_account_id: The ID of the connected account to pin
1310 :param trigger_config: The configuration of the trigger
1305 - :return: The trigger instance
1311 + :param type: ``webhook`` or ``poll``, for a trigger that supports both.
1312 + Omit it to let Composio choose.
1313 + :param polling_interval: Minutes between polls, for an instance that polls.
1314 + Wins over ``trigger_config["interval"]``.
1315 + :return: The trigger instance, with the ``type`` it uses, the
1316 + ``fallback_reason`` when it polls after a webhook was unavailable, and
1317 + its ``polling_interval``
1318 """
1319 # Treat blank strings as missing so an empty or whitespace-only
1320 # `user_id` / `connected_account_id` does not slip past the guard below
@@ -1337,6 +1349,8 @@ class Triggers(Resource):
1349 connected_account_id=none_to_omit(connected_account_id),
1350 toolkit_versions=self._toolkit_versions,
1351 body_trigger_config_1=none_to_omit(trigger_config),
1352 + type=none_to_omit(type),
1353 + polling_interval=none_to_omit(polling_interval),
1354 user_id=none_to_omit(user_id),
1355 )
1356
python/pyproject.toml
+1 -1
@@ -14,7 +14,7 @@ dependencies = [
14 "pysher==1.0.8",
15 "websocket-client<2",
16 "pydantic>=2.11.9,<3",
17 - "composio-client==2.0.0rc23",
17 + "composio-client==2.0.0",
18 "typing-extensions>=4.16.0,<5",
19 "openai>=2.48.0,<4",
20 "json-schema-to-pydantic>=0.4.11,<1",
python/setup.py
+1 -1
@@ -28,7 +28,7 @@ setup(
28 "pysher==1.0.8",
29 "websocket-client<2",
30 "pydantic>=2.11.9,<3",
31 - "composio-client==2.0.0rc23",
31 + "composio-client==2.0.0",
32 "typing-extensions>=4.16.0,<5",
33 "openai>=2.48.0,<4",
34 "json-schema-to-pydantic>=0.4.11,<1",
python/tests/test_triggers.py
+18
@@ -302,6 +302,24 @@ class TestTriggers:
302 assert call_kwargs["user_id"] is omit
303 assert result == mock_response
304
305 + def test_create_passes_type_and_polling_interval(self, triggers, mock_client):
306 + """type and polling_interval reach the upsert; unset ones are omitted."""
307 + triggers.create(
308 + slug="GMAIL_NEW_GMAIL_MESSAGE",
309 + user_id="user-123",
310 + type="poll",
311 + polling_interval=15,
312 + )
313 + triggers.create(slug="GMAIL_NEW_GMAIL_MESSAGE", user_id="user-123")
314 +
315 + with_fields, without_fields = (
316 + mock_client.trigger_instances.upsert.call_args_list
317 + )
318 + assert with_fields.kwargs["type"] == "poll"
319 + assert with_fields.kwargs["polling_interval"] == 15
320 + assert without_fields.kwargs["type"] is omit
321 + assert without_fields.kwargs["polling_interval"] is omit
322 +
323 def test_create_with_user_id(self, triggers, mock_client):
324 """Test create trigger with user_id only.
325
ts/packages/cli-keyring/package.json
+1 -1
@@ -56,7 +56,7 @@
56 "vitest": "catalog:"
57 },
58 "peerDependencies": {
59 - "effect": "4.0.3"
59 + "effect": "^4.1.0"
60 },
61 "peerDependenciesMeta": {
62 "effect": {
ts/packages/cli/AGENTS.md
+2 -2
@@ -144,7 +144,7 @@ Steps 3–4 (and the TypeScript compiler they need) ship as the `generation-runt
144
145 ### Key Dependencies
146
147 -`effect` (pinned exactly to `4.0.5` through the workspace catalog; `@effect/cli` and `@effect/platform` no longer exist as separate packages — folded into `effect`'s barrel and `effect/{cli,http,process}`), `@effect/platform-bun`, `@effect/vitest` (same exact pin), `@clack/prompts` (terminal UI — stderr by default), `picocolors`, `@composio/client` (owned Composio API client, `2.0.0-rc.23` via the workspace catalog; the CLI calls it through the `@composio/client/effect` entry point and imports only types from the rest of the package), `@composio/core` (types), `@composio/ts-builders` (AST gen), `@composio/cli-keyring` (OS credential store), `@composio/json-schema-to-effect-schema`, `semver`, `open`, `extract-zip`.
147 +`effect` (using the matching range `^4.1.0` through the workspace catalog; `@effect/cli` and `@effect/platform` no longer exist as separate packages — folded into `effect`'s barrel and `effect/{cli,http,process}`), `@effect/platform-bun`, `@effect/vitest` (matching range), `@clack/prompts` (terminal UI — stderr by default), `picocolors`, `@composio/client` (owned Composio API client, `2.0.0` via the workspace catalog; the CLI calls it through the `@composio/client/effect` entry point and imports only types from the rest of the package), `@composio/core` (types), `@composio/ts-builders` (AST gen), `@composio/cli-keyring` (OS credential store), `@composio/json-schema-to-effect-schema`, `semver`, `open`, `extract-zip`.
148
149 ## Output Conventions: Composable CLI Output
150
@@ -240,7 +240,7 @@ The only code allowed to bypass services sits at declared runtime boundaries: th
240
241 ## Vendor Reference Sources
242
243 -Read-only submodules under `ts/vendor/`, pinned at the `effect@4.0.3` release commit (do NOT modify — actual deps come from npm). v4 folded `@effect/cli`/`@effect/platform` into the core `effect` package, so there is no longer a separate `packages/cli` or `packages/platform` — everything lives under `packages/effect/src/`:
243 +Read-only submodules under `ts/vendor/`, pinned at the `effect@4.1.1` release commit (do NOT modify — actual deps come from npm). v4 folded `@effect/cli`/`@effect/platform` into the core `effect` package, so there is no longer a separate `packages/cli` or `packages/platform` — everything lives under `packages/effect/src/`:
244
245 - `ts/vendor/effect/packages/effect/src/` — core Effect runtime (`Effect`, `Schema`, `Layer`, `Context`, `Result`, `Cause`, `Config`, `FileSystem`, `Path`, `PlatformError`, …)
246 - `ts/vendor/effect/packages/effect/src/cli/` — `effect/cli` (`Command`, `Flag`, `Argument`, `CliError`, `CliConfig`, `CliOutput`, `GlobalFlag`, `HelpDoc`, `Completions`, `Prompt`)
ts/packages/cli/CHANGELOG.md
+4
@@ -2,6 +2,10 @@
2
3 ## Unreleased
4
5 +### Patch Changes
6 +
7 +- Update Effect and its Bun and Vitest integrations to `^4.1.0`.
8 +
9 ### Minor Changes
10
11 - A signal now ends each command the way its work ends. A one-shot command,
ts/packages/cli/src/commands/tools/execute/tools.execute.cmd.ts
+5 -2
@@ -1,4 +1,5 @@
1 import { telemetry, withCommandTelemetry } from 'src/analytics/command-input';
2 +import { Array } from 'effect';
3 import { Argument, Command, Flag } from 'effect/cli';
4 import { withCommandMeta } from 'src/invocation/command-identity';
5 import { runToolsExecuteCommand } from './tools.execute.handler';
@@ -20,7 +21,8 @@ const parallel = Flag.Boolean('parallel').pipe(
21 const data = Flag.String('data').pipe(
22 Flag.withAlias('d'),
23 Flag.withDescription('JSON arguments, @file, or - for stdin'),
23 - Flag.optional
24 + Flag.atLeast(0),
25 + Flag.map(Array.head)
26 );
27 const file = Flag.String('file').pipe(
28 Flag.withDescription('Inject a local file path into the single file_uploadable input'),
@@ -30,7 +32,8 @@ const accountOption = Flag.String('account').pipe(
32 Flag.withDescription(
33 'Connected account selector for the inferred toolkit. Matches alias, word_id, or connected account id.'
34 ),
33 - Flag.optional
35 + Flag.atLeast(0),
36 + Flag.map(Array.head)
37 );
38
39 const getSchema = Flag.Boolean('get-schema').pipe(
ts/packages/cli/test/__utils__/services/mock-terminal.ts
+7
@@ -66,9 +66,16 @@ export const make = Effect.gen(function* () {
66
67 const readInput: MockTerminal['readInput'] = Effect.succeed(Queue.asDequeue(queue));
68
69 + const size: MockTerminal['size'] = Effect.gen(function* () {
70 + const queue = yield* Queue.make<Terminal.Size, Cause.Done>();
71 + yield* Queue.offer(queue, { columns: 80, rows: 24 });
72 + return queue;
73 + });
74 +
75 const terminal = Terminal.make({
76 columns: Effect.succeed(80),
77 rows: Effect.succeed(24),
78 + size,
79 display,
80 readInput,
81 readLine: Effect.succeed(''),
ts/packages/cli/test/src/commands/commands-map.test.ts
+12 -9
@@ -3,15 +3,13 @@
3 * registration, with its help summary and the file that defines it.
4 * `pnpm --filter @composio/cli run commands:map` rewrites the file; `pnpm test` fails while it is stale.
5 *
6 - * A registration's source file is the `.cmd.ts` module that exports its definition, so no command
7 - * declares its own file. A definition is recognised by its name and its `examples` array:
8 - * `effect/cli` 4.0.5 creates that array in `Command.make` and `Command.withExamples` and every
9 - * other combinator (`withRegisteredSubcommands`, `withCommandMeta`, `Command.provide`, …) carries
10 - * it over unchanged, so two definitions with the same name and description (`signup` and
11 - * `agent signup`) stay apart. Should an upgrade copy it, every row fails to match below, loudly.
12 - * Commands assembled by a function rather than exported are listed in `ASSEMBLED`.
6 + * A registration's source file is the `.cmd.ts` module that exports its definition.
7 + * Effect 4.1 resolves examples anew when copying a command, so match their values,
8 + * the name and description instead of array identity. Ambiguous definitions and
9 + * commands assembled by a function are listed explicitly in `ASSEMBLED`.
10 */
11 import * as path from 'node:path';
12 +import { isDeepStrictEqual } from 'node:util';
13 import { describe, expect, it } from '@effect/vitest';
14 import { Command } from 'effect/cli';
15 import * as prettier from 'prettier';
@@ -30,6 +28,8 @@ const repoPath = (file: string) => path.relative(repoRoot, file).split(path.sep)
28 const ASSEMBLED: Readonly<Record<string, string>> = {
29 dev: 'dev.cmd.ts',
30 help: 'root-help.ts',
31 + signup: 'signup/signup.cmd.ts',
32 + 'agent signup': 'agent/signup/agent.signup.cmd.ts',
33 };
34
35 const definitions = await Promise.all(
@@ -43,7 +43,7 @@ const definitions = await Promise.all(
43 );
44
45 const sameDefinition = (a: Command.Command.Any, b: Command.Command.Any) =>
46 - a.name === b.name && a.examples === b.examples;
46 + a.name === b.name && a.description === b.description && isDeepStrictEqual(a.examples, b.examples);
47
48 /** The `.cmd.ts` file that exports `registration`'s definition, or why there is not one. */
49 const sourceOf = ({ identity, command }: Registration): string => {
@@ -95,7 +95,10 @@ const rows = registrations
95 const alsoAt = (row: (typeof rows)[number]) =>
96 rows
97 .filter(
98 - other => other !== row && sameDefinition(other.registration.command, row.registration.command)
98 + other =>
99 + other !== row &&
100 + other.source === row.source &&
101 + sameDefinition(other.registration.command, row.registration.command)
102 )
103 .map(other => `\`${other.path}\``)
104 .join(', ');
ts/packages/cli/test/src/commands/run/run.cmd.test.ts
+11 -2
@@ -17,6 +17,7 @@ import {
17 Layer,
18 Option,
19 PlatformError,
20 + Redacted,
21 Runtime,
22 Sink,
23 Stream,
@@ -125,8 +126,16 @@ const inspectRunCommand = (command: ChildProcess.Command) => {
126 throw new Error('Expected the run command to be a standard (non-piped) command.');
127 }
128 return {
128 - cmd: [command.command, ...command.args],
129 - env: command.options.env ?? {},
129 + cmd: [
130 + command.command,
131 + ...command.args.map(arg => (Redacted.isRedacted(arg) ? Redacted.value(arg) : arg)),
132 + ],
133 + env: Object.fromEntries(
134 + Object.entries(command.options.env ?? {}).map(([key, value]) => [
135 + key,
136 + Redacted.isRedacted(value) ? Redacted.value(value) : value,
137 + ])
138 + ),
139 extendEnv: command.options.extendEnv,
140 stdio: [command.options.stdin, command.options.stdout, command.options.stderr],
141 };
ts/packages/cli/test/src/commands/setup.cmd.test.ts
+5 -2
@@ -1,5 +1,5 @@
1 import { describe, expect, layer } from '@effect/vitest';
2 -import { Effect, Exit, Fiber, Latch } from 'effect';
2 +import { Effect, Exit, Fiber, Latch, Redacted } from 'effect';
3 import { TestClock } from 'effect/testing';
4 import { ChildProcess, ChildProcessSpawner } from 'effect/process';
5 import { afterEach, vi } from 'vitest';
@@ -71,7 +71,10 @@ const commandParts = (command: ChildProcess.Command): ReadonlyArray<string> => {
71 if (!ChildProcess.isStandardCommand(command)) {
72 throw new Error('Expected a standard command');
73 }
74 - return [command.command, ...command.args];
74 + return [
75 + command.command,
76 + ...command.args.map(arg => (Redacted.isRedacted(arg) ? Redacted.value(arg) : arg)),
77 + ];
78 };
79
80 const makeRunner = (
ts/packages/core/src/models/Triggers.ts
+10 -1
@@ -236,10 +236,14 @@ export class Triggers<TProvider extends BaseComposioProvider<unknown, unknown, u
236 * Create a new trigger instance for a user
237 * If the connected account id is not provided, the first connected account for the user and toolkit will be used
238 *
239 + * For a trigger that supports both webhook and polling, `body.type` picks one; omit it to let Composio choose.
240 + * `body.pollingInterval` sets the minutes between polls and wins over `triggerConfig.interval`.
241 + *
242 * @param {string} userId - The user id of the trigger instance
243 * @param {string} slug - The slug of the trigger instance
244 * @param {TriggerInstanceUpsertParams} body - The parameters to create the trigger instance
242 - * @returns {Promise<TriggerInstanceUpsertResponse>} The created trigger instance
245 + * @returns {Promise<TriggerInstanceUpsertResponse>} The trigger instance, with the type it uses, why it polls
246 + * when it fell back from a webhook, and its polling interval
247 */
248 async create(
249 userId: string,
@@ -286,6 +290,8 @@ export class Triggers<TProvider extends BaseComposioProvider<unknown, unknown, u
290 const upsertParams: ClientTriggerInstanceUpsertParams = {
291 connected_account_id: parsedBody.data.connectedAccountId,
292 trigger_config: parsedBody.data.triggerConfig,
293 + type: parsedBody.data.type,
294 + polling_interval: parsedBody.data.pollingInterval,
295 toolkit_versions: this.toolkitVersions,
296 user_id: userId,
297 };
@@ -296,6 +302,9 @@ export class Triggers<TProvider extends BaseComposioProvider<unknown, unknown, u
302
303 return {
304 triggerId: result.trigger_id,
305 + type: result.type,
306 + fallbackReason: result.fallback_reason,
307 + pollingInterval: result.polling_interval,
308 };
309 }
310
ts/packages/core/src/types/triggers.types.ts
+14
@@ -30,6 +30,9 @@ export const TriggerInstanceListActiveParamsSchema = z.object({
30
31 export type TriggerInstanceListActiveParams = z.infer<typeof TriggerInstanceListActiveParamsSchema>;
32
33 +export const TriggerInstanceTypeSchema = z.enum(['webhook', 'poll']);
34 +export type TriggerInstanceType = z.infer<typeof TriggerInstanceTypeSchema>;
35 +
36 export const TriggerInstanceListActiveResponseItemSchema = z.object({
37 id: z.string(),
38 connectedAccountId: z.string(),
@@ -40,6 +43,9 @@ export const TriggerInstanceListActiveResponseItemSchema = z.object({
43 updatedAt: z.string(),
44 triggerData: z.string().optional(),
45 uuid: z.string().optional(),
46 + type: TriggerInstanceTypeSchema,
47 + fallbackReason: z.string().nullable(),
48 + pollingInterval: z.number().nullable(),
49 });
50
51 export const TriggerInstanceListActiveResponseSchema = z.object({
@@ -58,12 +64,17 @@ export type TriggerInstanceListActiveResponseItem = z.infer<
64 export const TriggerInstanceUpsertParamsSchema = z.object({
65 connectedAccountId: z.string().optional(),
66 triggerConfig: z.record(z.unknown()).optional(),
67 + type: TriggerInstanceTypeSchema.optional(),
68 + pollingInterval: z.number().int().positive().optional(),
69 });
70
71 export type TriggerInstanceUpsertParams = z.infer<typeof TriggerInstanceUpsertParamsSchema>;
72
73 export const TriggerInstanceUpsertResponseSchema = z.object({
74 triggerId: z.string(),
75 + type: TriggerInstanceTypeSchema,
76 + fallbackReason: z.string().nullable(),
77 + pollingInterval: z.number().nullable(),
78 });
79
80 export type TriggerInstanceUpsertResponse = z.infer<typeof TriggerInstanceUpsertResponseSchema>;
@@ -162,6 +173,9 @@ export const TriggerTypeSchema = z.object({
173 payload: z.record(z.unknown()),
174 config: z.record(z.unknown()),
175 version: z.string().optional(),
176 + type: TriggerInstanceTypeSchema,
177 + types: z.array(TriggerInstanceTypeSchema),
178 + requiresWebhookEndpointSetup: z.boolean().optional(),
179 });
180
181 export type TriggerType = z.infer<typeof TriggerTypeSchema>;
ts/packages/core/src/utils/transformers/triggers.ts
+27 -17
@@ -48,25 +48,32 @@ export function transformIncomingTriggerPayload(response: TriggerData): Incoming
48 }));
49 }
50
51 +function toTriggerType(
52 + response: RawTriggersTypeRetrieveResponse | RawTriggersTypeListResponse['items'][number]
53 +): TriggersTypeRetrieveResponse {
54 + return {
55 + slug: response.slug,
56 + name: response.name,
57 + description: response.description,
58 + instructions: response.instructions,
59 + toolkit: {
60 + logo: response.toolkit.logo,
61 + slug: response.toolkit.slug,
62 + name: response.toolkit.name,
63 + },
64 + version: response.version,
65 + payload: response.payload,
66 + config: response.config,
67 + type: response.type,
68 + types: response.types,
69 + requiresWebhookEndpointSetup: response.requires_webhook_endpoint_setup,
70 + };
71 +}
72 +
73 export function transformTriggerTypeRetrieveResponse(
74 response: RawTriggersTypeRetrieveResponse
75 ): TriggersTypeRetrieveResponse {
54 - return transform(response)
55 - .with(TriggerTypeSchema)
56 - .using(response => ({
57 - slug: response.slug,
58 - name: response.name,
59 - description: response.description,
60 - instructions: response.instructions,
61 - toolkit: {
62 - logo: response.toolkit.logo,
63 - slug: response.toolkit.slug,
64 - name: response.toolkit.name,
65 - },
66 - version: response.version,
67 - payload: response.payload,
68 - config: response.config,
69 - }));
76 + return transform(response).with(TriggerTypeSchema).using(toTriggerType);
77 }
78
79 export function transformTriggerTypeListResponse(
@@ -75,7 +82,7 @@ export function transformTriggerTypeListResponse(
82 return transform(response)
83 .with(TriggersTypeListResponseSchema)
84 .using(response => ({
78 - items: response.items,
85 + items: response.items.map(toTriggerType),
86 nextCursor: response.next_cursor ?? null,
87 totalPages: response.total_pages,
88 }));
@@ -102,6 +109,9 @@ export function transformTriggerInstanceListActiveItem(
109 updatedAt: response.updated_at,
110 triggerData: response.trigger_data,
111 uuid: response.uuid,
112 + type: response.type,
113 + fallbackReason: response.fallback_reason,
114 + pollingInterval: response.polling_interval,
115 }));
116 }
117
ts/packages/core/test/models/triggers.test.ts
+82 -7
@@ -66,6 +66,9 @@ const mockTriggerInstances = {
66 updated_at: '2024-01-01T00:00:00Z',
67 trigger_data: '{"event":"push"}',
68 uuid: 'uuid-123',
69 + type: 'webhook',
70 + fallback_reason: null,
71 + polling_interval: null,
72 },
73 {
74 id: 'trigger-2',
@@ -77,6 +80,9 @@ const mockTriggerInstances = {
80 updated_at: '2024-01-02T00:00:00Z',
81 trigger_data: '{"event":"message"}',
82 uuid: 'uuid-456',
83 + type: 'poll',
84 + fallback_reason: 'No webhook endpoint is set up for this auth config.',
85 + polling_interval: 15,
86 },
87 ],
88 next_cursor: null,
@@ -85,6 +91,16 @@ const mockTriggerInstances = {
91
92 const mockTriggerUpsertResponse = {
93 trigger_id: 'trigger-123',
94 + type: 'webhook',
95 + fallback_reason: null,
96 + polling_interval: null,
97 +};
98 +
99 +const expectedUpsertResult = {
100 + triggerId: mockTriggerUpsertResponse.trigger_id,
101 + type: mockTriggerUpsertResponse.type,
102 + fallbackReason: mockTriggerUpsertResponse.fallback_reason,
103 + pollingInterval: mockTriggerUpsertResponse.polling_interval,
104 };
105
106 const mockTriggerUpdateResponse = {
@@ -116,6 +132,9 @@ const mockTriggerTypes = {
132 logo: 'https://example.com/github.png',
133 },
134 version: '20250101_00',
135 + type: 'webhook',
136 + types: ['webhook'],
137 + requires_webhook_endpoint_setup: false,
138 },
139 ],
140 total_pages: 1,
@@ -141,8 +160,16 @@ const mockTriggerType = {
160 logo: 'https://example.com/github.png',
161 },
162 version: '20250101_00',
163 + type: 'poll',
164 + types: ['webhook', 'poll'],
165 + requires_webhook_endpoint_setup: true,
166 };
167
168 +const toTriggerType = <T extends { requires_webhook_endpoint_setup?: boolean }>({
169 + requires_webhook_endpoint_setup,
170 + ...rest
171 +}: T) => ({ ...rest, requiresWebhookEndpointSetup: requires_webhook_endpoint_setup });
172 +
173 const mockTriggerEnum = {
174 enum: ['github_webhook', 'slack_message', 'email_received'],
175 };
@@ -431,6 +458,9 @@ describe('Triggers', () => {
458 updatedAt: item.updated_at,
459 triggerData: item.trigger_data,
460 uuid: item.uuid,
461 + type: item.type,
462 + fallbackReason: item.fallback_reason,
463 + pollingInterval: item.polling_interval,
464 })),
465 nextCursor: null,
466 totalPages: 1,
@@ -503,7 +533,52 @@ describe('Triggers', () => {
533 },
534 undefined
535 );
506 - expect(result).toEqual({ triggerId: mockTriggerUpsertResponse.trigger_id });
536 + expect(result).toEqual(expectedUpsertResult);
537 + });
538 +
539 + it('should pass type and pollingInterval, and return the type, fallback reason and interval', async () => {
540 + mockClient.triggerInstances.upsert.mockResolvedValue({
541 + trigger_id: 'trigger-123',
542 + type: 'poll',
543 + fallback_reason: 'No webhook endpoint is set up for this auth config.',
544 + polling_interval: 15,
545 + });
546 +
547 + const result = await triggers.create(userId, slug, {
548 + ...body,
549 + type: 'poll',
550 + pollingInterval: 15,
551 + });
552 +
553 + expect(mockClient.triggerInstances.upsert).toHaveBeenCalledWith(
554 + slug,
555 + {
556 + connected_account_id: body.connectedAccountId,
557 + trigger_config: body.triggerConfig,
558 + type: 'poll',
559 + polling_interval: 15,
560 + toolkit_versions: 'latest',
561 + user_id: userId,
562 + },
563 + undefined
564 + );
565 + expect(result).toEqual({
566 + triggerId: 'trigger-123',
567 + type: 'poll',
568 + fallbackReason: 'No webhook endpoint is set up for this auth config.',
569 + pollingInterval: 15,
570 + });
571 + });
572 +
573 + it.each([
574 + { case: 'an unknown type', extra: { type: 'email' } },
575 + { case: 'a fractional pollingInterval', extra: { pollingInterval: 1.5 } },
576 + { case: 'a zero pollingInterval', extra: { pollingInterval: 0 } },
577 + ])('should reject $case before calling the API', async ({ extra }) => {
578 + await expect(triggers.create(userId, slug, { ...body, ...extra } as unknown)).rejects.toThrow(
579 + ValidationError
580 + );
581 + expect(mockClient.triggerInstances.upsert).not.toHaveBeenCalled();
582 });
583
584 it('should let the backend auto-resolve the connection when no connected account ID is provided', async () => {
@@ -530,7 +605,7 @@ describe('Triggers', () => {
605 // resolve it).
606 const upsertParams = mockClient.triggerInstances.upsert.mock.calls[0][1];
607 expect(upsertParams.connected_account_id).toBeUndefined();
533 - expect(result).toEqual({ triggerId: mockTriggerUpsertResponse.trigger_id });
608 + expect(result).toEqual(expectedUpsertResult);
609 });
610
611 it('should throw a validation error when userId is empty', async () => {
@@ -646,7 +721,7 @@ describe('Triggers', () => {
721 );
722 expect(result).toEqual({
723 items: mockTriggerTypes.items.map(item => ({
649 - ...item,
724 + ...toTriggerType(item),
725 payload: item.payload ?? {},
726 })),
727 nextCursor: mockTriggerTypes.next_cursor,
@@ -670,7 +745,7 @@ describe('Triggers', () => {
745 undefined
746 );
747 expect(result).toEqual({
673 - items: mockTriggerTypes.items,
748 + items: mockTriggerTypes.items.map(toTriggerType),
749 nextCursor: mockTriggerTypes.next_cursor,
750 totalPages: mockTriggerTypes.total_pages,
751 });
@@ -691,7 +766,7 @@ describe('Triggers', () => {
766 },
767 undefined
768 );
694 - expect(result).toEqual(mockTriggerType);
769 + expect(result).toEqual(toTriggerType(mockTriggerType));
770 });
771
772 it('should use custom global toolkit versions when configured', async () => {
@@ -712,7 +787,7 @@ describe('Triggers', () => {
787 },
788 undefined
789 );
715 - expect(result).toEqual(mockTriggerType);
790 + expect(result).toEqual(toTriggerType(mockTriggerType));
791 });
792
793 it('should use "latest" as default when no toolkit versions are configured', async () => {
@@ -728,7 +803,7 @@ describe('Triggers', () => {
803 },
804 undefined
805 );
731 - expect(result).toEqual(mockTriggerType);
806 + expect(result).toEqual(toTriggerType(mockTriggerType));
807 });
808 });
809
ts/vendor/effect
+1 -1
@@ -1 +1 @@
1 -Subproject commit 967a7dc5963a23d3705259d60ccac1ce9f060a3b
1 +Subproject commit bc492f0965dc0f6a83cefd141071c5ead10f7efa
uv.lock
+7 -7
@@ -534,7 +534,7 @@ release = [
534 [package.metadata]
535 requires-dist = [
536 { name = "certifi", specifier = ">=2026.10.19" },
537 - { name = "composio-client", specifier = "==2.0.0rc23" },
537 + { name = "composio-client", specifier = "==2.0.0" },
538 { name = "json-schema-to-pydantic", specifier = ">=0.4.11,<1" },
539 { name = "jsonschema", specifier = ">=4.23.0,<5" },
540 { name = "openai", specifier = ">=2.48.0,<4" },
@@ -586,16 +586,16 @@ requires-dist = [
586
587 [[package]]
588 name = "composio-client"
589 -version = "2.0.0rc23"
589 +version = "2.0.0"
590 source = { registry = "https://pypi.org/simple" }
591 dependencies = [
592 { name = "httpx" },
593 { name = "pydantic" },
594 { name = "typing-extensions" },
595 ]
596 -sdist = { url = "https://files.pythonhosted.org/packages/ee/41/1a6a076f44639f712731300f1b3e4688be8dfc2d61d9576f9803016e18fb/composio_client-2.0.0rc23.tar.gz", hash = "sha256:763d02a48a22aca9d078d9fcbed576fcea2b5df45cf6de237224fbe8e038e4c3", size = 582099, upload-time = "2026-10-30T14:22:14.593Z" }
596 +sdist = { url = "https://files.pythonhosted.org/packages/c8/7b/be475ecbab35280d6f565b689724d350c06491d3412d65b7f69b4b48c76a/composio_client-2.0.0.tar.gz", hash = "sha256:78d852ace33f6c330bf66628f2e794e8f6a333eeed20f740d162160ec0466944", size = 588293, upload-time = "2026-11-03T08:31:56.577Z" }
597 wheels = [
598 - { url = "https://files.pythonhosted.org/packages/fa/68/016860107362b89ed6772b642011d6264b3394714b3766e4cd29490a03c6/composio_client-2.0.0rc23-py3-none-any.whl", hash = "sha256:0c29e312169e68ba642ebd1e6cb65d9fe43d6372ac901a9a7e2e3ab7d5e1ae60", size = 468192, upload-time = "2026-10-30T14:22:13.124Z" },
598 + { url = "https://files.pythonhosted.org/packages/5e/be/2ce8fe148ffaa6ad343a8eea6a4f8558c740fca2308970980e7874f6dbf5/composio_client-2.0.0-py3-none-any.whl", hash = "sha256:4de6ef10ae4b731857dd70b6edbf0fd62c4fd41169e5f8d3f21655637c53cfe6", size = 471648, upload-time = "2026-11-03T08:31:54.624Z" },
599 ]
600
601 [[package]]
@@ -2307,11 +2307,11 @@ wheels = [
2307
2308 [[package]]
2309 name = "pyasn1"
2310 -version = "0.6.4"
2310 +version = "0.6.5"
2311 source = { registry = "https://pypi.org/simple" }
2312 -sdist = { url = "https://files.pythonhosted.org/packages/a4/9a/23310166d960def5897e91fe20e5b724601b02a22e84ba1f94232c0b7f67/pyasn1-0.6.4.tar.gz", hash = "sha256:9c447d8431c947fe4c8febc4ed9e760bc29011a5b01e5c74b67025bd9fb8ce81", size = 151262, upload-time = "2026-07-09T01:12:33.988Z" }
2312 +sdist = { url = "https://files.pythonhosted.org/packages/88/7e/3c0da41061a2021cac7cd524fd57092adbe5b515e8bf9005702e366802e2/pyasn1-0.6.5.tar.gz", hash = "sha256:6b11616a6bcf3a40e635f082bb232fa57b5e0dd7f517bd7ddd69ec3794508a47", size = 155152, upload-time = "2026-10-27T06:32:49.125Z" }
2313 wheels = [
2314 - { url = "https://files.pythonhosted.org/packages/9a/3b/6163796d69c3977d1e4287bea4a6979161cbbdd170ebb430511e8e1999ce/pyasn1-0.6.4-py3-none-any.whl", hash = "sha256:deda9277cfd454080ec40b207fb6df82206a3a2688735233cdcd8d3d565f088b", size = 84410, upload-time = "2026-07-09T01:12:32.92Z" },
2314 + { url = "https://files.pythonhosted.org/packages/19/1f/3eefd5c84c35cae44549ce1c7f7e58f7945b34f5a6bce07a135438522073/pyasn1-0.6.5-py3-none-any.whl", hash = "sha256:4017b0fce125096b8573b39c989fdb1a4b19cf761e683398184550fea0e66587", size = 84807, upload-time = "2026-10-27T06:32:48.045Z" },
2315 ]
2316
2317 [[package]]