@devries-cameron20 / composio Mirror · read-only / commits / 521c42a64
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, 06:00 UTC

feat(release): plan TypeScript and Python versions from shared changesets

Add the private @composio/python-sdk marker so one changeset can version TypeScript packages and the synchronized Python train, plus the planner that turns pending changesets into one release plan. PRs that change published SDK source now need a changeset or an explicit exemption in their description; the check re-runs when the description is edited.

jkomyno committed Nov 5, 2026 at 17:48 UTC 521c42a64418951f20f597952fdb5d29e5aacf62
16 files changed +1330 -99
.changeset/README.md
+14 -6
@@ -1,8 +1,16 @@
1 -# Changesets
1 +# SDK release notes
2
3 -Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4 -with multi-package repos, or single-package repos to help you version and publish your code. You can
5 -find the full documentation for it [in our repository](https://github.com/changesets/changesets)
3 +Include a Changeset when a PR changes published SDK behavior. Use `pnpm changeset`
4 +and select each affected TypeScript package or `@composio/python-sdk` for Python.
5 +One note can cover both SDKs. Recommend `patch`, `minor`, or `major` and describe the
6 +user-visible change. Python core and all supported providers release together.
7 +The private Python marker is versioned by Changesets and never published to npm.
8 +The CLI uses its own release process and must not appear in SDK Changesets.
9 +
10 +Docs, tests, internal tooling and CLI-only changes need no SDK note. If a change
11 +under SDK source has no public effect, explain it in the PR description:
12 +
13 +```html
14 +<!-- sdk-release-note-exempt: Explain why this change has no published behavior. -->
15 +```
16
7 -We have a quick list of common questions to get you started engaging with this project in
8 -[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
.github/workflows/sdk.release.check.yml new
+61
@@ -0,0 +1,61 @@
1 +name: SDK release checks
2 +
3 +on:
4 + pull_request:
5 + branches: [next]
6 + # `edited` re-checks the release-note exemption when the PR description changes.
7 + types: [opened, synchronize, reopened, edited]
8 + paths:
9 + - '.changeset/**'
10 + - 'python/**'
11 + - 'ts/packages/**'
12 + - 'ts/scripts/validate-changesets.*'
13 + - 'ts/scripts/check-provider-compatibility.ts'
14 + - 'scripts/sdk-release/**'
15 + - 'test/sdk-release-*'
16 + - 'tsconfig.sdk-release.json'
17 + - '.github/workflows/sdk.release*.yml'
18 + - 'package.json'
19 + - 'pnpm-lock.yaml'
20 +
21 +permissions:
22 + contents: read
23 +
24 +# Description edits only re-run the note check, so they must not cancel a code run's tooling.
25 +concurrency:
26 + group: sdk-release-check-${{ github.ref }}-${{ github.event.action == 'edited' && 'description' || 'code' }}
27 + cancel-in-progress: true
28 +
29 +jobs:
30 + release-note:
31 + name: SDK release note
32 + runs-on: ubuntu-latest
33 + steps:
34 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
35 + with:
36 + fetch-depth: 0
37 + persist-credentials: false
38 + - uses: ./.github/actions/setup-node-pnpm-bun
39 + - run: pnpm install --frozen-lockfile --ignore-scripts
40 + - name: Require a changeset for published SDK behavior
41 + env:
42 + SDK_RELEASE_NOTE_BASE: ${{ github.event.pull_request.base.sha }}
43 + SDK_RELEASE_PR_BODY: ${{ github.event.pull_request.body }}
44 + run: pnpm validate:changesets
45 +
46 + tooling:
47 + name: SDK release tooling
48 + if: github.event.action != 'edited'
49 + runs-on: ubuntu-latest
50 + steps:
51 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
52 + with:
53 + persist-credentials: false
54 + - uses: ./.github/actions/setup-node-pnpm-bun
55 + - uses: ./.github/actions/setup-python-uv
56 + with:
57 + enable-caching: 'false'
58 + - run: pnpm install --frozen-lockfile --ignore-scripts
59 + - run: pnpm run typecheck:sdk-release
60 + - run: pnpm exec oxlint scripts/sdk-release test/sdk-release-*.ts
61 + - run: pnpm run test:sdk-release
package.json
+10 -2
@@ -14,7 +14,8 @@
14 "ts/packages/cli",
15 "ts/packages/cli-keyring",
16 "ts/packages/ts-builders",
17 - "ts/packages/providers/*"
17 + "ts/packages/providers/*",
18 + "python"
19 ],
20 "scripts": {
21 "build": "turbo build",
@@ -68,7 +69,9 @@
69 "changeset:pre-exit": "changeset pre exit",
70 "clean": "git clean -xdf .turbo node_modules ts/packages/**/.turbo ts/packages/**/node_modules ts/packages/**/dist",
71 "clean:workspace": "pnpm turbo clean",
71 - "typecheck:agent-workflow": "bun node_modules/typescript/bin/tsc -p tsconfig.agent-workflow.json"
72 + "typecheck:agent-workflow": "bun node_modules/typescript/bin/tsc -p tsconfig.agent-workflow.json",
73 + "test:sdk-release": "bun test test/sdk-release-*.test.ts",
74 + "typecheck:sdk-release": "bun node_modules/typescript/bin/tsc -p tsconfig.sdk-release.json"
75 },
76 "devEngines": {
77 "runtime": {
@@ -79,12 +82,17 @@
82 },
83 "devDependencies": {
84 "@arethetypeswrong/cli": "catalog:",
85 + "@changesets/apply-release-plan": "8.1.1",
86 + "@changesets/assemble-release-plan": "7.0.0",
87 "@changesets/cli": "^3.0.3",
88 + "@changesets/config": "4.0.1",
89 "@changesets/read": "^1.0.1",
90 + "@changesets/types": "7.0.0",
91 "@composio/anthropic": "workspace:*",
92 "@composio/core": "workspace:*",
93 "@composio/openai": "workspace:*",
94 "@effect/platform-bun": "catalog:",
95 + "@manypkg/get-packages": "3.1.0",
96 "@types/bun": "catalog:",
97 "@types/node": "^26.6.4",
98 "@types/semver": "^7.8.0",
pnpm-lock.yaml
+50 -90
@@ -138,12 +138,24 @@ importers:
138 '@arethetypeswrong/cli':
139 specifier: 'catalog:'
140 version: 0.18.5
141 + '@changesets/apply-release-plan':
142 + specifier: 8.1.1
143 + version: 8.1.1
144 + '@changesets/assemble-release-plan':
145 + specifier: 7.0.0
146 + version: 7.0.0
147 '@changesets/cli':
148 specifier: ^3.0.3
149 version: 3.0.3
150 + '@changesets/config':
151 + specifier: 4.0.1
152 + version: 4.0.1
153 '@changesets/read':
154 specifier: ^1.0.1
155 version: 1.0.1
156 + '@changesets/types':
157 + specifier: 7.0.0
158 + version: 7.0.0
159 '@composio/anthropic':
160 specifier: workspace:*
161 version: link:ts/packages/providers/anthropic
@@ -156,6 +168,9 @@ importers:
168 '@effect/platform-bun':
169 specifier: 'catalog:'
170 version: 4.1.1(effect@4.1.1)
171 + '@manypkg/get-packages':
172 + specifier: 3.1.0
173 + version: 3.1.0
174 '@types/bun':
175 specifier: 'catalog:'
176 version: 1.4.3
@@ -214,6 +229,8 @@ importers:
229 specifier: 'catalog:'
230 version: 4.6.7
231
232 + python: {}
233 +
234 ts/e2e-tests/_utils:
235 devDependencies:
236 typescript:
@@ -655,7 +672,7 @@ importers:
672 version: link:../../packages/core
673 '@modelcontextprotocol/sdk':
674 specifier: 'catalog:'
658 - version: 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
675 + version: 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
676 dotenv:
677 specifier: 'catalog:'
678 version: 18.0.8
@@ -759,7 +776,7 @@ importers:
776 version: 2.30.0(@modelcontextprotocol/sdk@1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7))
777 '@modelcontextprotocol/sdk':
778 specifier: 'catalog:'
762 - version: 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
779 + version: 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
780 dotenv:
781 specifier: 'catalog:'
782 version: 18.0.8
@@ -803,19 +820,19 @@ importers:
820 version: link:../../packages/providers/langchain
821 '@langchain/core':
822 specifier: ^1.2.18
806 - version: 1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
823 + version: 1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
824 '@langchain/langgraph':
825 specifier: ^1.5.1
809 - version: 1.5.1(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(zod@4.6.7)
826 + version: 1.5.1(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(zod@4.6.7)
827 '@langchain/openai':
828 specifier: ^1.6.2
812 - version: 1.6.2(@aws-sdk/credential-provider-node@3.972.87)(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)
829 + version: 1.6.2(@aws-sdk/credential-provider-node@3.972.87)(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)
830 dotenv:
831 specifier: 'catalog:'
832 version: 18.0.8
833 langchain:
834 specifier: ^1.5.18
818 - version: 1.5.18(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
835 + version: 1.5.18(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
836 openai:
837 specifier: 'catalog:'
838 version: 7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7)
@@ -911,7 +928,7 @@ importers:
928 version: link:../../packages/providers/vercel
929 '@modelcontextprotocol/sdk':
930 specifier: 'catalog:'
914 - version: 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
931 + version: 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
932 ai:
933 specifier: 'catalog:'
934 version: 7.0.146(zod@4.6.7)
@@ -964,7 +981,7 @@ importers:
981 version: link:../../packages/providers/openai-agents
982 '@modelcontextprotocol/sdk':
983 specifier: 'catalog:'
967 - version: 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
984 + version: 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
985 '@openai/agents':
986 specifier: ^0.20.0
987 version: 0.20.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(supports-color@10.2.2)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7)
@@ -1193,7 +1210,7 @@ importers:
1210 version: link:../../packages/providers/vercel
1211 '@modelcontextprotocol/sdk':
1212 specifier: 'catalog:'
1196 - version: 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
1213 + version: 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
1214 ai:
1215 specifier: 'catalog:'
1216 version: 7.0.146(zod@4.6.7)
@@ -1567,7 +1584,7 @@ importers:
1584 version: link:../../core
1585 '@modelcontextprotocol/sdk':
1586 specifier: 'catalog:'
1570 - version: 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
1587 + version: 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
1588 tsdown:
1589 specifier: 'catalog:'
1590 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))
@@ -7083,7 +7100,7 @@ snapshots:
7100 '@anthropic-ai/claude-agent-sdk@0.3.304(@anthropic-ai/sdk@0.135.0(zod@4.6.7))(@modelcontextprotocol/sdk@1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7))(zod@4.6.7)':
7101 dependencies:
7102 '@anthropic-ai/sdk': 0.135.0(zod@4.6.7)
7086 - '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
7103 + '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
7104 zod: 4.6.7
7105 optionalDependencies:
7106 '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.304
@@ -7857,7 +7874,7 @@ snapshots:
7874 protobufjs: 7.6.5
7875 ws: 8.21.3
7876 optionalDependencies:
7860 - '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
7877 + '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
7878 transitivePeerDependencies:
7879 - bufferutil
7880 - supports-color
@@ -7870,7 +7887,7 @@ snapshots:
7887 protobufjs: 7.6.5
7888 ws: 8.22.0
7889 optionalDependencies:
7873 - '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
7890 + '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
7891 transitivePeerDependencies:
7892 - bufferutil
7893 - supports-color
@@ -7883,7 +7900,7 @@ snapshots:
7900 protobufjs: 7.6.5
7901 ws: 8.22.0
7902 optionalDependencies:
7886 - '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
7903 + '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
7904 transitivePeerDependencies:
7905 - bufferutil
7906 - supports-color
@@ -8141,38 +8158,14 @@ snapshots:
8158 - openai
8159 - ws
8160
8144 - '@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)':
8145 - dependencies:
8146 - '@cfworker/json-schema': 4.1.1
8147 - '@standard-schema/spec': 1.1.0
8148 - js-tiktoken: 1.0.21
8149 - langsmith: 0.11.0(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
8150 - mustache: 4.2.0
8151 - p-queue: 6.6.2
8152 - zod: 4.6.7
8153 - transitivePeerDependencies:
8154 - - '@opentelemetry/api'
8155 - - '@opentelemetry/exporter-trace-otlp-proto'
8156 - - '@opentelemetry/sdk-trace-base'
8157 - - openai
8158 - - ws
8159 -
8161 '@langchain/langgraph-checkpoint@1.1.6(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))':
8162 dependencies:
8163 '@langchain/core': 1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
8164
8164 - '@langchain/langgraph-checkpoint@1.1.6(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))':
8165 - dependencies:
8166 - '@langchain/core': 1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
8167 -
8165 '@langchain/langgraph-checkpoint@1.2.0(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))':
8166 dependencies:
8167 '@langchain/core': 1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
8168
8172 - '@langchain/langgraph-checkpoint@1.2.0(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))':
8173 - dependencies:
8174 - '@langchain/core': 1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
8175 -
8169 '@langchain/langgraph-sdk@1.12.5(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))':
8170 dependencies:
8171 '@langchain/core': 1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
@@ -8181,14 +8174,6 @@ snapshots:
8174 p-queue: 9.3.3
8175 p-retry: 7.1.1
8176
8184 - '@langchain/langgraph-sdk@1.12.5(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))':
8185 - dependencies:
8186 - '@langchain/core': 1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
8187 - '@langchain/protocol': 0.0.19
8188 - '@types/json-schema': 7.0.15
8189 - p-queue: 9.3.3
8190 - p-retry: 7.1.1
8191 -
8177 '@langchain/langgraph@1.5.1(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(zod@4.6.7)':
8178 dependencies:
8179 '@langchain/core': 1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
@@ -8201,18 +8186,6 @@ snapshots:
8186 - react
8187 - react-dom
8188
8204 - '@langchain/langgraph@1.5.1(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(zod@4.6.7)':
8205 - dependencies:
8206 - '@langchain/core': 1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
8207 - '@langchain/langgraph-checkpoint': 1.2.0(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))
8208 - '@langchain/langgraph-sdk': 1.12.5(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))
8209 - '@langchain/protocol': 0.0.19
8210 - '@standard-schema/spec': 1.1.0
8211 - zod: 4.6.7
8212 - transitivePeerDependencies:
8213 - - react
8214 - - react-dom
8215 -
8189 '@langchain/mcp-adapters@2.0.1(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(@langchain/langgraph@1.5.1(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(zod@4.6.7))':
8190 dependencies:
8191 '@langchain/core': 1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
@@ -8234,19 +8207,6 @@ snapshots:
8207 - undici
8208 - ws
8209
8237 - '@langchain/openai@1.6.2(@aws-sdk/credential-provider-node@3.972.87)(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)':
8238 - dependencies:
8239 - '@langchain/core': 1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
8240 - js-tiktoken: 1.0.21
8241 - openai: 7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7)
8242 - zod: 4.6.7
8243 - transitivePeerDependencies:
8244 - - '@aws-sdk/credential-provider-node'
8245 - - '@smithy/hash-node'
8246 - - '@smithy/signature-v4'
8247 - - undici
8248 - - ws
8249 -
8210 '@langchain/protocol@0.0.19': {}
8211
8212 '@llamaindex/core@0.6.22':
@@ -8302,7 +8262,7 @@ snapshots:
8262
8263 '@llamaindex/workflow-core@1.3.4(@modelcontextprotocol/sdk@1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7))(hono@4.13.13)(zod@4.6.7)':
8264 optionalDependencies:
8305 - '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
8265 + '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
8266 hono: 4.13.13
8267 zod: 4.6.7
8268
@@ -8476,7 +8436,7 @@ snapshots:
8436 '@modelcontextprotocol/core': 2.4.0
8437 '@modelcontextprotocol/ext-apps': 1.7.5(@modelcontextprotocol/sdk@1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7))(zod@4.6.7)
8438 '@modelcontextprotocol/node': 2.1.2(@modelcontextprotocol/server@2.4.0)
8479 - '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
8439 + '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
8440 '@modelcontextprotocol/server': 2.4.0
8441 '@modelcontextprotocol/server-legacy': 2.4.0(express@5.3.0)
8442 exit-hook: 5.1.0
@@ -8533,7 +8493,7 @@ snapshots:
8493
8494 '@modelcontextprotocol/ext-apps@1.7.5(@modelcontextprotocol/sdk@1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7))(zod@4.6.7)':
8495 dependencies:
8536 - '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)
8496 + '@modelcontextprotocol/sdk': 1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)
8497 '@standard-schema/spec': 1.1.0
8498 zod: 4.6.7
8499
@@ -8554,7 +8514,7 @@ snapshots:
8514 eventsource: 3.0.7
8515 eventsource-parser: 3.1.1
8516 express: 5.3.0
8557 - express-rate-limit: 8.7.1(express@5.3.0)
8517 + express-rate-limit: 8.7.1(express@5.3.0)(supports-color@10.2.2)
8518 hono: 4.13.13
8519 jose: 6.2.12
8520 json-schema-typed: 8.0.2
@@ -8578,7 +8538,7 @@ snapshots:
8538 eventsource: 3.0.7
8539 eventsource-parser: 3.1.1
8540 express: 5.3.0
8581 - express-rate-limit: 8.7.1(express@5.3.0)
8541 + express-rate-limit: 8.7.1(express@5.3.0)(supports-color@10.2.2)
8542 hono: 4.13.13
8543 jose: 6.2.12
8544 json-schema-typed: 8.0.2
@@ -8591,7 +8551,7 @@ snapshots:
8551 transitivePeerDependencies:
8552 - supports-color
8553
8594 - '@modelcontextprotocol/sdk@1.32.1(@cfworker/json-schema@4.1.1)(zod@3.25.76)':
8554 + '@modelcontextprotocol/sdk@1.32.1(@cfworker/json-schema@4.1.1)(supports-color@10.2.2)(zod@4.6.7)':
8555 dependencies:
8556 '@hono/node-server': 2.1.5(hono@4.13.13)
8557 ajv: 8.20.0
@@ -8602,20 +8562,20 @@ snapshots:
8562 eventsource: 3.0.7
8563 eventsource-parser: 3.1.1
8564 express: 5.3.0
8605 - express-rate-limit: 8.7.1(express@5.3.0)
8565 + express-rate-limit: 8.7.1(express@5.3.0)(supports-color@10.2.2)
8566 hono: 4.13.13
8567 jose: 6.2.13
8568 json-schema-typed: 8.0.2
8569 pkce-challenge: 5.0.1
8570 raw-body: 3.0.2
8611 - zod: 3.25.76
8612 - zod-to-json-schema: 3.25.2(zod@3.25.76)
8571 + zod: 4.6.7
8572 + zod-to-json-schema: 3.25.2(zod@4.6.7)
8573 optionalDependencies:
8574 '@cfworker/json-schema': 4.1.1
8575 transitivePeerDependencies:
8576 - supports-color
8577
8618 - '@modelcontextprotocol/sdk@1.32.1(@cfworker/json-schema@4.1.1)(zod@4.6.7)':
8578 + '@modelcontextprotocol/sdk@1.32.1(@cfworker/json-schema@4.1.1)(zod@3.25.76)':
8579 dependencies:
8580 '@hono/node-server': 2.1.5(hono@4.13.13)
8581 ajv: 8.20.0
@@ -8626,14 +8586,14 @@ snapshots:
8586 eventsource: 3.0.7
8587 eventsource-parser: 3.1.1
8588 express: 5.3.0
8629 - express-rate-limit: 8.7.1(express@5.3.0)
8589 + express-rate-limit: 8.7.1(express@5.3.0)(supports-color@10.2.2)
8590 hono: 4.13.13
8591 jose: 6.2.13
8592 json-schema-typed: 8.0.2
8593 pkce-challenge: 5.0.1
8594 raw-body: 3.0.2
8635 - zod: 4.6.7
8636 - zod-to-json-schema: 3.25.2(zod@4.6.7)
8595 + zod: 3.25.76
8596 + zod-to-json-schema: 3.25.2(zod@3.25.76)
8597 optionalDependencies:
8598 '@cfworker/json-schema': 4.1.1
8599 transitivePeerDependencies:
@@ -8644,7 +8604,7 @@ snapshots:
8604 '@modelcontextprotocol/core': 2.4.0
8605 content-type: 1.0.5
8606 cors: 2.8.6
8647 - express-rate-limit: 8.7.1(express@5.3.0)
8607 + express-rate-limit: 8.7.1(express@5.3.0)(supports-color@10.2.2)
8608 pkce-challenge: 5.0.1
8609 raw-body: 3.0.2
8610 zod: 4.6.7
@@ -9949,7 +9909,7 @@ snapshots:
9909
9910 expect-type@1.4.0: {}
9911
9952 - express-rate-limit@8.7.1(express@5.3.0):
9912 + express-rate-limit@8.7.1(express@5.3.0)(supports-color@10.2.2):
9913 dependencies:
9914 debug: 4.4.3(supports-color@10.2.2)
9915 express: 5.3.0
@@ -10373,11 +10333,11 @@ snapshots:
10333 - react-dom
10334 - ws
10335
10376 - langchain@1.5.18(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0):
10336 + langchain@1.5.18(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0):
10337 dependencies:
10378 - '@langchain/core': 1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
10379 - '@langchain/langgraph': 1.5.1(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(zod@4.6.7)
10380 - '@langchain/langgraph-checkpoint': 1.1.6(@langchain/core@1.2.19(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))
10338 + '@langchain/core': 1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
10339 + '@langchain/langgraph': 1.5.1(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))(zod@4.6.7)
10340 + '@langchain/langgraph-checkpoint': 1.1.6(@langchain/core@1.2.19(@opentelemetry/api@1.10.0)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0))
10341 langsmith: 0.11.0(@opentelemetry/api@1.9.1)(openai@7.39.0(@aws-sdk/credential-provider-node@3.972.87)(@smithy/signature-v4@5.7.4)(undici@6.29.1)(ws@8.22.0)(zod@4.6.7))(ws@8.22.0)
10342 zod: 4.6.7
10343 transitivePeerDependencies:
pnpm-workspace.yaml
+1
@@ -1,4 +1,5 @@
1 packages:
2 + - python
3 - ts/e2e-tests/_utils
4 - ts/e2e-tests/cli/*
5 - ts/e2e-tests/cli/**/*
python/package.json new
+5
@@ -0,0 +1,5 @@
1 +{
2 + "name": "@composio/python-sdk",
3 + "version": "0.31.0",
4 + "private": true
5 +}
scripts/sdk-release/lanes.ts new
+17
@@ -0,0 +1,17 @@
1 +import { Schema } from 'effect';
2 +
3 +export const Language = Schema.Literals(['typescript', 'python']);
4 +export type Language = typeof Language.Type;
5 +export const LANGUAGES = Language.literals;
6 +
7 +/** Private workspace package whose Changesets version drives the synchronized Python train. */
8 +export const PYTHON_RELEASE_MARKER = '@composio/python-sdk';
9 +
10 +export const languageOf = (name: string): Language =>
11 + name === PYTHON_RELEASE_MARKER ? 'python' : 'typescript';
12 +
13 +/** Packages a maintenance release bumps when a language has no recorded change. */
14 +export const PRIMARY_TARGETS: Record<Language, ReadonlyArray<string>> = {
15 + typescript: ['@composio/core', '@composio/slim'],
16 + python: [PYTHON_RELEASE_MARKER],
17 +};
scripts/sdk-release/plan.ts new
+285
@@ -0,0 +1,285 @@
1 +import { Effect, FileSystem, Option, Path, Schema } from 'effect';
2 +import { getPackages } from '@manypkg/get-packages';
3 +import { readChangesets } from '@changesets/read';
4 +import { readConfig } from '@changesets/config';
5 +import { assembleReleasePlan } from '@changesets/assemble-release-plan';
6 +import { applyReleasePlan } from '@changesets/apply-release-plan';
7 +import type { Config, NewChangeset, Packages, ReleasePlan } from '@changesets/types';
8 +import semver from 'semver';
9 +import { LANGUAGES, Language, PRIMARY_TARGETS, PYTHON_RELEASE_MARKER, languageOf } from './lanes';
10 +import {
11 + discoverPythonPackages,
12 + synchronizePythonMetadata,
13 + type PythonMetadataOptions,
14 + type PythonReleasePackage,
15 +} from './python-metadata';
16 +import { ensure, fail, fromPromise, sameJson, sha256Hex, writeFile } from './runtime';
17 +
18 +export { PYTHON_RELEASE_MARKER } from './lanes';
19 +
20 +const Bump = Schema.Literals(['major', 'minor', 'patch']);
21 +type Bump = typeof Bump.Type;
22 +
23 +export const ReleaseChoice = Schema.Literals(['auto', 'major', 'minor', 'patch', 'skip']);
24 +export type ReleaseChoice = typeof ReleaseChoice.Type;
25 +export const autoByDefault = ReleaseChoice.pipe(
26 + Schema.withDecodingDefaultKey(Effect.succeed('auto' as const))
27 +);
28 +
29 +export const ReleaseOptions = Schema.Struct({
30 + typescript: autoByDefault,
31 + python: autoByDefault,
32 +});
33 +export type SdkReleaseOptions = typeof ReleaseOptions.Encoded;
34 +type Choices = Record<Language, ReleaseChoice>;
35 +
36 +const Changeset = Schema.Struct({
37 + id: Schema.String.check(Schema.isPattern(/^[A-Za-z0-9][A-Za-z0-9._-]*$/)),
38 + summary: Schema.String,
39 + releases: Schema.Array(
40 + Schema.Struct({
41 + name: Schema.String,
42 + type: Schema.Literals(['major', 'minor', 'patch', 'none']),
43 + })
44 + ),
45 +});
46 +const Release = Schema.Struct({
47 + name: Schema.String,
48 + type: Bump,
49 + oldVersion: Schema.String,
50 + newVersion: Schema.String,
51 + changesets: Schema.Array(Schema.String),
52 + language: Language,
53 +});
54 +export const SdkReleasePlan = Schema.Struct({
55 + schemaVersion: Schema.Literal(1),
56 + inputFingerprint: Schema.String,
57 + choices: Schema.Struct({ typescript: ReleaseChoice, python: ReleaseChoice }),
58 + recommended: Schema.Array(Release),
59 + releases: Schema.Array(Release),
60 + changesets: Schema.Array(Changeset),
61 + retainedChangesets: Schema.Array(Changeset),
62 +});
63 +export type SdkReleasePlan = typeof SdkReleasePlan.Type;
64 +export type SdkRelease = typeof Release.Type;
65 +
66 +const decodePlan = Schema.decodeUnknownEffect(SdkReleasePlan);
67 +
68 +/** Changesets' APIs take mutable notes. */
69 +const toNewChangeset = (note: typeof Changeset.Type): NewChangeset => ({
70 + ...note,
71 + releases: [...note.releases],
72 +});
73 +const byName = (a: { name: string }, b: { name: string }) => a.name.localeCompare(b.name);
74 +const byId = (a: { id: string }, b: { id: string }) => a.id.localeCompare(b.id);
75 +
76 +/** An explicit bump overrides each note's recommendation; `auto` and `skip` keep it. */
77 +const explicitBump = (choice: ReleaseChoice): Option.Option<Bump> =>
78 + Schema.is(Bump)(choice) ? Option.some(choice) : Option.none();
79 +
80 +const isStable = (version: string) =>
81 + semver.valid(version) !== null && semver.prerelease(version) === null;
82 +
83 +const isSdkTarget = (pkg: Packages['packages'][number], config: Config) =>
84 + !config.ignore.includes(pkg.packageJson.name) &&
85 + (pkg.packageJson.name === PYTHON_RELEASE_MARKER ||
86 + (!pkg.packageJson.private && pkg.packageJson.name.startsWith('@composio/')));
87 +
88 +const loadInputs = (cwd: string) =>
89 + Effect.gen(function* () {
90 + const fs = yield* FileSystem.FileSystem;
91 + const path = yield* Path.Path;
92 + if (yield* fs.exists(path.resolve(cwd, '.changeset/pre.json')))
93 + return yield* fail('Stable SDK planning does not consume Changesets prerelease state');
94 + const packages = yield* fromPromise(() => getPackages(cwd));
95 + const result = yield* fromPromise(() => readConfig(cwd, packages));
96 + if (!result.config)
97 + return yield* fail(`Invalid Changesets config: ${result.errors.join('; ')}`);
98 + const unversionedPrivate = packages.packages
99 + .filter(pkg => pkg.packageJson.private && pkg.packageJson.name !== PYTHON_RELEASE_MARKER)
100 + .map(pkg => pkg.packageJson.name);
101 + const config: Config = {
102 + ...result.config,
103 + ignore: [...new Set([...result.config.ignore, ...unversionedPrivate])].sort(),
104 + };
105 + const changesets = (yield* Schema.decodeUnknownEffect(Schema.Array(Changeset))(
106 + yield* fromPromise(() => readChangesets(cwd))
107 + ))
108 + .toSorted(byId)
109 + .map(toNewChangeset);
110 + const allowed = new Set(
111 + packages.packages.filter(pkg => isSdkTarget(pkg, config)).map(pkg => pkg.packageJson.name)
112 + );
113 + for (const note of changesets)
114 + for (const entry of note.releases)
115 + yield* ensure(
116 + allowed.has(entry.name),
117 + `${entry.name} is not an SDK release target (${note.id})`
118 + );
119 + const marker = packages.packages.find(pkg => pkg.packageJson.name === PYTHON_RELEASE_MARKER);
120 + const python: ReadonlyArray<PythonReleasePackage> = marker
121 + ? yield* discoverPythonPackages(cwd)
122 + : [];
123 + if (marker) {
124 + yield* ensure(marker.packageJson.private === true, 'Python release marker must be private');
125 + for (const pkg of python)
126 + yield* ensure(
127 + pkg.version === marker.packageJson.version,
128 + `Python metadata baseline mismatch for ${pkg.name}`
129 + );
130 + }
131 + const fingerprint = yield* sha256Hex(
132 + JSON.stringify({
133 + config,
134 + packages: packages.packages
135 + .map(pkg => ({ directory: path.relative(cwd, pkg.dir), manifest: pkg.packageJson }))
136 + .sort((a, b) => a.directory.localeCompare(b.directory)),
137 + changesets,
138 + python,
139 + })
140 + );
141 + return { packages, config, changesets, python, allowed, fingerprint };
142 + });
143 +
144 +const selectedReleases = (native: ReleasePlan) =>
145 + Schema.decodeUnknownEffect(Schema.Array(Release))(
146 + native.releases
147 + .filter(release => release.type !== 'none')
148 + .map(release => ({ ...release, language: languageOf(release.name) }))
149 + .sort(byName)
150 + );
151 +
152 +/** Applies per-language choices to authored notes; skipped entries stay for a later release. */
153 +const splitNotes = (notes: ReadonlyArray<NewChangeset>, choices: Choices) => {
154 + const selected: NewChangeset[] = [];
155 + const retained: NewChangeset[] = [];
156 + for (const note of notes) {
157 + const isSkipped = (entry: NewChangeset['releases'][number]) =>
158 + choices[languageOf(entry.name)] === 'skip';
159 + const releases = note.releases
160 + .filter(entry => !isSkipped(entry))
161 + .map(entry => ({
162 + ...entry,
163 + type: Option.getOrElse(explicitBump(choices[languageOf(entry.name)]), () => entry.type),
164 + }));
165 + const remaining = note.releases.filter(isSkipped);
166 + if (releases.length) selected.push({ ...note, releases });
167 + if (remaining.length) retained.push({ ...note, releases: remaining });
168 + }
169 + return { selected, retained };
170 +};
171 +
172 +/** An explicit bump for a language without notes becomes an honest primary-group maintenance release. */
173 +const maintenanceNotes = (
174 + selected: ReadonlyArray<NewChangeset>,
175 + choices: Choices,
176 + allowed: Set<string>
177 +) =>
178 + Effect.forEach(
179 + LANGUAGES.flatMap(language =>
180 + Option.match(explicitBump(choices[language]), {
181 + onNone: () => [],
182 + onSome: type =>
183 + selected.some(note => note.releases.some(entry => languageOf(entry.name) === language))
184 + ? []
185 + : [{ language, type }],
186 + })
187 + ),
188 + ({ language, type }) =>
189 + Effect.gen(function* () {
190 + for (const name of PRIMARY_TARGETS[language])
191 + yield* ensure(allowed.has(name), `Missing primary SDK release target ${name}`);
192 + return {
193 + id: `sdk-maintenance-${language}`,
194 + summary: 'Maintenance release. No user-facing changes were recorded.',
195 + releases: PRIMARY_TARGETS[language].map(name => ({ name, type })),
196 + } satisfies NewChangeset;
197 + })
198 + );
199 +
200 +export const createSdkReleasePlan = (cwd: string, options: SdkReleaseOptions = {}) =>
201 + Effect.gen(function* () {
202 + const choices = yield* Schema.decodeUnknownEffect(ReleaseOptions)(options);
203 + const inputs = yield* loadInputs(cwd);
204 + for (const pkg of inputs.packages.packages)
205 + if (inputs.allowed.has(pkg.packageJson.name))
206 + yield* ensure(
207 + isStable(pkg.packageJson.version),
208 + `SDK version must be stable for ${pkg.packageJson.name}`
209 + );
210 + const notes = inputs.changesets;
211 + const recommendation = assembleReleasePlan(notes, inputs.packages, inputs.config, undefined);
212 + const { selected, retained } = splitNotes(notes, choices);
213 + selected.push(...(yield* maintenanceNotes(selected, choices, inputs.allowed)));
214 + const native = assembleReleasePlan(selected, inputs.packages, inputs.config, undefined);
215 + const releases = yield* selectedReleases(native);
216 + for (const release of releases)
217 + yield* ensure(
218 + inputs.allowed.has(release.name),
219 + `Unexpected SDK release target ${release.name}`
220 + );
221 + return yield* decodePlan({
222 + schemaVersion: 1,
223 + inputFingerprint: inputs.fingerprint,
224 + choices: { typescript: choices.typescript, python: choices.python },
225 + recommended: yield* selectedReleases(recommendation),
226 + releases,
227 + changesets: native.changesets,
228 + retainedChangesets: retained,
229 + });
230 + });
231 +
232 +const serializeChangeset = (note: NewChangeset) =>
233 + `---\n${note.releases.map(entry => `${JSON.stringify(entry.name)}: ${entry.type}`).join('\n')}\n---\n\n${note.summary}\n`;
234 +
235 +/** Writes the planned versions, changelogs, retained notes and Python metadata to `cwd`. */
236 +export const applySdkReleasePlan = (
237 + cwd: string,
238 + value: SdkReleasePlan,
239 + options: PythonMetadataOptions = {}
240 +) =>
241 + Effect.gen(function* () {
242 + const fs = yield* FileSystem.FileSystem;
243 + const path = yield* Path.Path;
244 + const plan = yield* decodePlan(value);
245 + if (plan.releases.length === 0) return;
246 + const inputs = yield* loadInputs(cwd);
247 + yield* ensure(
248 + inputs.fingerprint === plan.inputFingerprint,
249 + 'Release inputs changed after planning; create a new plan'
250 + );
251 + yield* ensure(
252 + sameJson(yield* createSdkReleasePlan(cwd, plan.choices), plan),
253 + 'Release data changed from the selected source plan'
254 + );
255 + const versionOf = (name: string) =>
256 + inputs.packages.packages.find(pkg => pkg.packageJson.name === name)?.packageJson.version;
257 + for (const release of plan.releases)
258 + yield* ensure(
259 + inputs.allowed.has(release.name) && versionOf(release.name) === release.oldVersion,
260 + `Invalid release target ${release.name}`
261 + );
262 + const native = assembleReleasePlan(
263 + plan.changesets.map(toNewChangeset),
264 + inputs.packages,
265 + inputs.config,
266 + undefined
267 + );
268 + yield* ensure(
269 + sameJson(yield* selectedReleases(native), plan.releases),
270 + 'Release targets changed from the selected Changesets plan'
271 + );
272 + yield* fromPromise(() =>
273 + applyReleasePlan(native, inputs.packages, inputs.config, undefined, cwd)
274 + );
275 + for (const note of plan.retainedChangesets)
276 + yield* writeFile(
277 + path.resolve(cwd, '.changeset', `${note.id}.md`),
278 + serializeChangeset(toNewChangeset(note))
279 + );
280 + const retainedIds = new Set(plan.retainedChangesets.map(note => note.id));
281 + for (const note of plan.changesets.filter(note => !retainedIds.has(note.id)))
282 + yield* fs.remove(path.resolve(cwd, '.changeset', `${note.id}.md`), { force: true });
283 + const python = plan.releases.find(release => release.name === PYTHON_RELEASE_MARKER);
284 + if (python) yield* synchronizePythonMetadata(cwd, python.newVersion, options);
285 + });
scripts/sdk-release/python-metadata.ts new
+184
@@ -0,0 +1,184 @@
1 +import { Effect, FileSystem, Path, Schema } from 'effect';
2 +import { Toml } from 'effect/encoding';
3 +import semver from 'semver';
4 +import { ensure, fail, readFile, spawn, withoutReleaseTokens, writeFile } from './runtime';
5 +
6 +const PyProject = Schema.Struct({
7 + project: Schema.Struct({ name: Schema.String, version: Schema.String }),
8 +});
9 +
10 +export interface PythonReleasePackage {
11 + readonly name: string;
12 + readonly version: string;
13 + readonly directory: string;
14 +}
15 +
16 +export interface PythonMetadataOptions {
17 + readonly updateLockfile?: boolean;
18 +}
19 +
20 +const CORE_DIRECTORY = 'python';
21 +const PROVIDERS_DIRECTORY = 'python/providers';
22 +const RUNTIME_VERSION_PATH = 'python/composio/__version__.py';
23 +
24 +/** Each pattern captures `(prefix)(quote)(version)`. */
25 +export const PROJECT_VERSION = /(^\[project\][\s\S]*?^version\s*=\s*)(["'])([^"']+)\2/m;
26 +export const SETUP_VERSION = /(\bversion\s*=\s*)(["'])([^"']+)\2/;
27 +export const RUNTIME_VERSION = /(^\s*__version__\s*=\s*)(["'])([^"']+)\2/m;
28 +
29 +const mirroredVersion = (contents: string, pattern: RegExp) => contents.match(pattern)?.[3];
30 +const withVersion = (contents: string, pattern: RegExp, version: string) =>
31 + contents.replace(
32 + pattern,
33 + (_match, prefix: string, quote: string) => `${prefix}${quote}${version}${quote}`
34 + );
35 +
36 +/** Providers mirror their version in setup.py; the core package keeps it in pyproject.toml only. */
37 +const hasSetupMirror = (directory: string) => directory !== CORE_DIRECTORY;
38 +
39 +const parsePyProject = (contents: string) =>
40 + Effect.fromResult(Toml.parse(contents)).pipe(
41 + Effect.flatMap(Schema.decodeUnknownEffect(PyProject))
42 + );
43 +
44 +const providerDirectories = (cwd: string) =>
45 + Effect.gen(function* () {
46 + const fs = yield* FileSystem.FileSystem;
47 + const path = yield* Path.Path;
48 + const entries = yield* fs
49 + .readDirectory(path.resolve(cwd, PROVIDERS_DIRECTORY))
50 + .pipe(Effect.catchReason('PlatformError', 'NotFound', () => Effect.succeed([])));
51 + const candidates = entries
52 + .toSorted((a, b) => a.localeCompare(b))
53 + .map(entry => `${PROVIDERS_DIRECTORY}/${entry}`);
54 + return yield* Effect.filter(candidates, directory =>
55 + Effect.gen(function* () {
56 + const info = yield* fs.stat(path.resolve(cwd, directory));
57 + return (
58 + info.type === 'Directory' &&
59 + (yield* fs.exists(path.resolve(cwd, directory, 'pyproject.toml')))
60 + );
61 + })
62 + );
63 + });
64 +
65 +const readPackage = (cwd: string, directory: string) =>
66 + Effect.gen(function* () {
67 + const path = yield* Path.Path;
68 + const project = yield* parsePyProject(
69 + yield* readFile(path.resolve(cwd, directory, 'pyproject.toml'))
70 + );
71 + if (hasSetupMirror(directory)) {
72 + const setupPath = `${directory}/setup.py`;
73 + const setup = yield* readFile(path.resolve(cwd, setupPath));
74 + yield* ensure(
75 + mirroredVersion(setup, SETUP_VERSION) === project.project.version,
76 + `Python version mirror mismatch in ${setupPath}`
77 + );
78 + }
79 + return {
80 + name: project.project.name.toLowerCase().replace(/[-_.]+/g, '-'),
81 + version: project.project.version,
82 + directory,
83 + } satisfies PythonReleasePackage;
84 + });
85 +
86 +export const discoverPythonPackages = (cwd: string) =>
87 + Effect.gen(function* () {
88 + const path = yield* Path.Path;
89 + const directories = [CORE_DIRECTORY, ...(yield* providerDirectories(cwd))];
90 + const packages = yield* Effect.forEach(directories, directory => readPackage(cwd, directory), {
91 + concurrency: 'unbounded',
92 + });
93 + const runtime = yield* readFile(path.resolve(cwd, RUNTIME_VERSION_PATH));
94 + yield* ensure(
95 + mirroredVersion(runtime, RUNTIME_VERSION) === packages[0].version,
96 + `Python version mirror mismatch in ${RUNTIME_VERSION_PATH}`
97 + );
98 + return packages;
99 + });
100 +
101 +interface Edit {
102 + readonly path: string;
103 + readonly contents: string;
104 +}
105 +
106 +const editVersion = (absolutePath: string, pattern: RegExp, version: string, missing: string) =>
107 + Effect.gen(function* () {
108 + const contents = yield* readFile(absolutePath);
109 + yield* ensure(pattern.test(contents), missing);
110 + const updated = withVersion(contents, pattern, version);
111 + return updated === contents
112 + ? undefined
113 + : ({ path: absolutePath, contents: updated } satisfies Edit);
114 + });
115 +
116 +const editPyProject = (absolutePath: string, directory: string, version: string) =>
117 + Effect.gen(function* () {
118 + const contents = yield* readFile(absolutePath);
119 + const updated = withVersion(contents, PROJECT_VERSION, version);
120 + const project = yield* parsePyProject(updated);
121 + yield* ensure(
122 + project.project.version === version,
123 + `Cannot update Python project version in ${directory}/pyproject.toml`
124 + );
125 + return updated === contents
126 + ? undefined
127 + : ({ path: absolutePath, contents: updated } satisfies Edit);
128 + });
129 +
130 +const lockWorkspace = (cwd: string) =>
131 + spawn('uv', ['lock'], { cwd, env: withoutReleaseTokens }).pipe(
132 + Effect.mapError(error => error.message),
133 + Effect.flatMap(result =>
134 + result.exitCode === 0 ? Effect.void : Effect.fail(result.stderr || 'unknown failure')
135 + ),
136 + Effect.catch(detail => fail(`uv lock failed: ${detail}`))
137 + );
138 +
139 +export const synchronizePythonMetadata = (
140 + cwd: string,
141 + version: string,
142 + options: PythonMetadataOptions = {}
143 +) =>
144 + Effect.gen(function* () {
145 + yield* ensure(
146 + semver.valid(version) !== null && semver.prerelease(version) === null,
147 + `Python stable release requires a stable semantic version, received ${version}`
148 + );
149 + const path = yield* Path.Path;
150 + const packages = yield* discoverPythonPackages(cwd);
151 + const edits: Array<Edit | undefined> = [];
152 + for (const pkg of packages) {
153 + edits.push(
154 + yield* editPyProject(
155 + path.resolve(cwd, pkg.directory, 'pyproject.toml'),
156 + pkg.directory,
157 + version
158 + )
159 + );
160 + if (hasSetupMirror(pkg.directory))
161 + edits.push(
162 + yield* editVersion(
163 + path.resolve(cwd, pkg.directory, 'setup.py'),
164 + SETUP_VERSION,
165 + version,
166 + `Cannot find provider setup version in ${pkg.directory}/setup.py`
167 + )
168 + );
169 + }
170 + edits.push(
171 + yield* editVersion(
172 + path.resolve(cwd, RUNTIME_VERSION_PATH),
173 + RUNTIME_VERSION,
174 + version,
175 + 'Cannot find Python runtime __version__'
176 + )
177 + );
178 + const changed = edits.filter(edit => edit !== undefined);
179 + yield* Effect.forEach(changed, edit => writeFile(edit.path, edit.contents), { discard: true });
180 + const changedPaths = changed.map(edit => path.relative(cwd, edit.path));
181 + if (options.updateLockfile === false) return changedPaths;
182 + yield* lockWorkspace(cwd);
183 + return [...changedPaths, 'uv.lock'];
184 + });
scripts/sdk-release/runtime.ts new
+165
@@ -0,0 +1,165 @@
1 +import * as BunRuntime from '@effect/platform-bun/BunRuntime';
2 +import * as BunServices from '@effect/platform-bun/BunServices';
3 +import { Cause, Console, Data, Effect, FileSystem, Layer, Option, Schema, Stream } from 'effect';
4 +import { Digest } from 'effect/crypto';
5 +import { FetchHttpClient } from 'effect/http';
6 +import { ChildProcess, ChildProcessSpawner } from 'effect/process';
7 +
8 +/** An SDK release invariant that does not hold. */
9 +export class ReleaseError extends Data.TaggedError('ReleaseError')<{ readonly message: string }> {}
10 +
11 +export const fail = (message: string) => Effect.fail(new ReleaseError({ message }));
12 +export const ensure = (condition: boolean, message: string) =>
13 + condition ? Effect.void : fail(message);
14 +
15 +/** A failure raised by a Promise-based library such as Changesets. */
16 +export class LibraryError extends Data.TaggedError('LibraryError')<{
17 + readonly message: string;
18 + readonly cause: unknown;
19 +}> {}
20 +
21 +export const fromPromise = <A>(evaluate: () => PromiseLike<A>) =>
22 + Effect.tryPromise({
23 + try: evaluate,
24 + catch: cause =>
25 + new LibraryError({
26 + message: cause instanceof Error ? cause.message : String(cause),
27 + cause,
28 + }),
29 + });
30 +
31 +export class CommandError extends Data.TaggedError('CommandError')<{
32 + readonly message: string;
33 + readonly exitCode: number;
34 +}> {}
35 +
36 +export interface CommandResult {
37 + readonly exitCode: number;
38 + readonly stdout: string;
39 + readonly stderr: string;
40 +}
41 +
42 +export interface CommandOptions {
43 + readonly cwd?: string;
44 + readonly env?: Record<string, string | undefined>;
45 + readonly output?: 'pipe' | 'inherit';
46 +}
47 +
48 +/** Commands that build or inspect untrusted release inputs never receive controller tokens. */
49 +export const withoutReleaseTokens = {
50 + SDK_RELEASE_TOKEN: undefined,
51 + GH_TOKEN: undefined,
52 + GITHUB_TOKEN: undefined,
53 +} as const;
54 +
55 +const text = <E>(stream: Stream.Stream<Uint8Array, E>) =>
56 + stream.pipe(Stream.decodeText(), Stream.mkString);
57 +
58 +/** Runs a command to completion and reports its exit code without failing on it. */
59 +export const spawn = (command: string, args: ReadonlyArray<string>, options: CommandOptions = {}) =>
60 + Effect.scoped(
61 + Effect.gen(function* () {
62 + const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
63 + const output = options.output ?? 'pipe';
64 + const handle = yield* spawner.spawn(
65 + ChildProcess.make(command, args, {
66 + cwd: options.cwd,
67 + env: options.env,
68 + extendEnv: true,
69 + stdin: 'ignore',
70 + stdout: output,
71 + stderr: output,
72 + })
73 + );
74 + const [stdout, stderr, exitCode] = yield* Effect.all(
75 + [text(handle.stdout), text(handle.stderr), handle.exitCode],
76 + { concurrency: 'unbounded' }
77 + );
78 + return { exitCode: Number(exitCode), stdout, stderr } satisfies CommandResult;
79 + })
80 + );
81 +
82 +/** Runs a command and returns stdout, failing with its output when it exits non-zero. */
83 +export const run = (command: string, args: ReadonlyArray<string>, options: CommandOptions = {}) =>
84 + spawn(command, args, options).pipe(
85 + Effect.flatMap(result =>
86 + result.exitCode === 0
87 + ? Effect.succeed(result.stdout)
88 + : Effect.fail(
89 + new CommandError({
90 + message: `${command} failed: ${result.stderr || result.stdout || result.exitCode}`,
91 + exitCode: result.exitCode,
92 + })
93 + )
94 + )
95 + );
96 +
97 +export const inDirectory =
98 + (cwd: string, extraEnv: Record<string, string> = {}) =>
99 + (command: string, args: ReadonlyArray<string>) =>
100 + run(command, args, { cwd, env: { ...withoutReleaseTokens, ...extraEnv } });
101 +
102 +/** Reads a file as text; fails when it does not exist (see `readOptionalFile`). */
103 +export const readFile = (path: string) =>
104 + Effect.gen(function* () {
105 + const fs = yield* FileSystem.FileSystem;
106 + return yield* fs.readFileString(path);
107 + });
108 +
109 +export const readOptionalFile = (path: string) =>
110 + readFile(path).pipe(
111 + Effect.map(Option.some),
112 + Effect.catchReason('PlatformError', 'NotFound', () => Effect.succeedNone)
113 + );
114 +
115 +export const writeFile = (path: string, contents: string) =>
116 + Effect.gen(function* () {
117 + const fs = yield* FileSystem.FileSystem;
118 + yield* fs.writeFileString(path, contents);
119 + });
120 +
121 +export const appendFile = (path: string, text: string) =>
122 + Effect.gen(function* () {
123 + const fs = yield* FileSystem.FileSystem;
124 + yield* fs.writeFileString(path, text, { flag: 'a' });
125 + });
126 +
127 +export const parseJson = <S extends Schema.Top>(schema: S, contents: string) =>
128 + Schema.decodeUnknownEffect(Schema.fromJsonString(schema))(contents);
129 +
130 +export const readJson = <S extends Schema.Top>(schema: S, path: string) =>
131 + readFile(path).pipe(Effect.flatMap(contents => parseJson(schema, contents)));
132 +
133 +export const sameJson = (left: unknown, right: unknown) =>
134 + JSON.stringify(left) === JSON.stringify(right);
135 +
136 +export const formatJson = (value: unknown) => `${JSON.stringify(value, null, 2)}\n`;
137 +
138 +export const writeJson = (path: string, value: unknown) => writeFile(path, formatJson(value));
139 +
140 +export const sha256Hex = (bytes: Uint8Array | string) =>
141 + Effect.gen(function* () {
142 + const digest = yield* Digest.Digest;
143 + return yield* digest.digestHex(
144 + Digest.sha256,
145 + typeof bytes === 'string' ? new TextEncoder().encode(bytes) : bytes
146 + );
147 + });
148 +
149 +export const ReleaseServices = Layer.mergeAll(
150 + BunServices.layer,
151 + FetchHttpClient.layer,
152 + Digest.layerWebCrypto
153 +);
154 +
155 +export type ReleaseServices = Layer.Success<typeof ReleaseServices>;
156 +
157 +/** Runs a release entry point; failures go to stderr and exit non-zero, like a thrown error. */
158 +export const runMain = <A, E>(program: Effect.Effect<A, E, ReleaseServices>) =>
159 + BunRuntime.runMain(
160 + program.pipe(
161 + Effect.tapCause(cause => Console.error(Cause.pretty(cause))),
162 + Effect.provide(ReleaseServices)
163 + ),
164 + { disableErrorReporting: true }
165 + );
test/sdk-release-harness.ts new
+82
@@ -0,0 +1,82 @@
1 +import { Effect, FileSystem, Layer, Path } from 'effect';
2 +import { FetchHttpClient } from 'effect/http';
3 +import { ReleaseServices, readFile } from '../scripts/sdk-release/runtime';
4 +
5 +export type Fetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
6 +
7 +const TestServices = ReleaseServices;
8 +type TestServices = Layer.Success<typeof TestServices>;
9 +
10 +/** Runs a release effect with Bun platform services and an optional fake fetch. */
11 +export const runRelease = <A, E>(
12 + effect: Effect.Effect<A, E, TestServices>,
13 + fetch?: Fetch
14 +): Promise<A> => {
15 + const withFetch = fetch
16 + ? effect.pipe(Effect.provideService(FetchHttpClient.Fetch, fetch as typeof globalThis.fetch))
17 + : effect;
18 + return Effect.runPromise(withFetch.pipe(Effect.provide(TestServices)));
19 +};
20 +
21 +export const json = (value: unknown, status = 200) =>
22 + new Response(JSON.stringify(value), {
23 + status,
24 + headers: { 'content-type': 'application/json' },
25 + });
26 +
27 +/** Temporary directories created by a suite; call `cleanup` from `afterEach`. */
28 +export const temporaryDirectories = (prefix: string) => {
29 + const created: string[] = [];
30 + return {
31 + create: () =>
32 + runRelease(
33 + Effect.gen(function* () {
34 + const fs = yield* FileSystem.FileSystem;
35 + const directory = yield* fs.makeTempDirectory({ prefix });
36 + created.push(directory);
37 + return directory;
38 + })
39 + ),
40 + cleanup: () =>
41 + runRelease(
42 + Effect.gen(function* () {
43 + const fs = yield* FileSystem.FileSystem;
44 + yield* Effect.forEach(created.splice(0), directory =>
45 + fs.remove(directory, { recursive: true, force: true })
46 + );
47 + })
48 + ),
49 + };
50 +};
51 +
52 +export const writeText = (file: string, contents: string) =>
53 + runRelease(
54 + Effect.gen(function* () {
55 + const fs = yield* FileSystem.FileSystem;
56 + const path = yield* Path.Path;
57 + yield* fs.makeDirectory(path.dirname(file), { recursive: true });
58 + yield* fs.writeFileString(file, contents);
59 + })
60 + );
61 +
62 +export const readText = (file: string) => runRelease(readFile(file));
63 +
64 +const withFileSystem = <A, E>(use: (fs: FileSystem.FileSystem) => Effect.Effect<A, E>) =>
65 + runRelease(
66 + Effect.gen(function* () {
67 + return yield* use(yield* FileSystem.FileSystem);
68 + })
69 + );
70 +
71 +export const exists = (file: string) => withFileSystem(fs => fs.exists(file));
72 +export const remove = (file: string) => withFileSystem(fs => fs.remove(file));
73 +export const symlink = (target: string, link: string) =>
74 + withFileSystem(fs => fs.symlink(target, link));
75 +export const makeExecutable = (file: string) => withFileSystem(fs => fs.chmod(file, 0o755));
76 +
77 +export const resolvePath = (...segments: string[]) =>
78 + runRelease(
79 + Effect.gen(function* () {
80 + return (yield* Path.Path).resolve(...segments);
81 + })
82 + );
test/sdk-release-notes-policy.test.ts new
+84
@@ -0,0 +1,84 @@
1 +import { describe, expect, test } from 'bun:test';
2 +import { missingReleaseNotes } from '../ts/scripts/validate-changesets.mjs';
3 +
4 +describe('SDK fragment policy', () => {
5 + const packages = [{ name: '@composio/core', directory: 'ts/packages/core', private: false }];
6 + test('requires both language entries for changed public source', () => {
7 + expect(
8 + missingReleaseNotes(
9 + ['ts/packages/core/src/index.ts', 'python/composio/core/tools.py'],
10 + [],
11 + packages
12 + )
13 + ).toEqual(['@composio/core', '@composio/python-sdk']);
14 + expect(
15 + missingReleaseNotes(
16 + ['python/composio/core/tools.py', '.changeset/python-fix.md'],
17 + [{ id: 'python-fix', releases: [{ name: '@composio/python-sdk', type: 'patch' }] }],
18 + packages
19 + )
20 + ).toEqual([]);
21 + });
22 + test('preexisting pending notes cannot cover new public behavior in another PR', () => {
23 + expect(
24 + missingReleaseNotes(
25 + ['python/composio/core/tools.py'],
26 + [{ id: 'older-note', releases: [{ name: '@composio/python-sdk', type: 'patch' }] }],
27 + packages
28 + )
29 + ).toEqual(['@composio/python-sdk']);
30 + expect(
31 + missingReleaseNotes(
32 + ['ts/packages/core/package.json'],
33 + [],
34 + packages,
35 + '<!-- sdk-release-note-exempt: This release PR applies previously reviewed SDK changes and only updates release metadata and generated documentation. -->'
36 + )
37 + ).toEqual([]);
38 + });
39 + test('tests, CLI and a meaningful explicit exemption do not require SDK fragments', () => {
40 + expect(
41 + missingReleaseNotes(
42 + [
43 + 'ts/packages/core/test/index.test.ts',
44 + 'python/tests/test_tools.py',
45 + 'ts/packages/cli/src/index.ts',
46 + ],
47 + [],
48 + packages
49 + )
50 + ).toEqual([]);
51 + expect(
52 + missingReleaseNotes(
53 + ['python/composio/core/tools.py'],
54 + [],
55 + packages,
56 + '<!-- sdk-release-note-exempt: Internal typing adjustment with no runtime or public signature changes. -->'
57 + )
58 + ).toEqual([]);
59 + expect(
60 + missingReleaseNotes(
61 + ['python/composio/core/tools.py'],
62 + [],
63 + packages,
64 + '<!-- sdk-release-note-exempt: none -->'
65 + )
66 + ).toEqual(['@composio/python-sdk']);
67 + });
68 +});
69 +
70 +test('Python packaging needs a note, while Python test files do not', () => {
71 + const packages = [{ name: '@composio/core', directory: 'ts/packages/core', private: false }];
72 + expect(missingReleaseNotes(['python/setup.py'], [], packages)).toEqual(['@composio/python-sdk']);
73 + expect(
74 + missingReleaseNotes(
75 + [
76 + 'python/composio/integration_test/test_tools.py',
77 + 'python/composio/core/test_models.py',
78 + 'python/composio/core/models_test.py',
79 + ],
80 + [],
81 + packages
82 + )
83 + ).toEqual([]);
84 +});
test/sdk-release-plan.test.ts new
+280
@@ -0,0 +1,280 @@
1 +import { afterEach, describe, expect, test } from 'bun:test';
2 +import {
3 + applySdkReleasePlan as applyPlanEffect,
4 + createSdkReleasePlan as createPlanEffect,
5 + type SdkReleaseOptions,
6 + type SdkReleasePlan,
7 +} from '../scripts/sdk-release/plan';
8 +import type { PythonMetadataOptions } from '../scripts/sdk-release/python-metadata';
9 +import { discoverPythonPackages as discoverEffect } from '../scripts/sdk-release/python-metadata';
10 +import {
11 + exists,
12 + readText,
13 + remove,
14 + resolvePath,
15 + runRelease,
16 + symlink,
17 + temporaryDirectories,
18 + writeText,
19 +} from './sdk-release-harness';
20 +
21 +const roots = temporaryDirectories('composio-sdk-plan-');
22 +const createSdkReleasePlan = (cwd: string, options?: SdkReleaseOptions) =>
23 + runRelease(createPlanEffect(cwd, options));
24 +const applySdkReleasePlan = (cwd: string, plan: SdkReleasePlan, options?: PythonMetadataOptions) =>
25 + runRelease(applyPlanEffect(cwd, plan, options));
26 +const discoverPythonPackages = (cwd: string) => runRelease(discoverEffect(cwd));
27 +
28 +async function fixture() {
29 + const cwd = await roots.create();
30 + const json = (path: string, value: unknown) =>
31 + writeText(`${cwd}/${path}`, JSON.stringify(value, null, 2));
32 + await json('package.json', {
33 + name: 'release-fixture',
34 + private: true,
35 + workspaces: ['packages/*', 'python'],
36 + });
37 + await writeText(`${cwd}/pnpm-workspace.yaml`, 'packages:\n - packages/*\n - python\n');
38 + await json('.changeset/config.json', {
39 + changelog: '@changesets/cli/changelog',
40 + format: false,
41 + fixed: [['@composio/core', '@composio/slim']],
42 + linked: [],
43 + privatePackages: { version: true, tag: false },
44 + ignore: ['@composio/cli'],
45 + baseBranch: 'next',
46 + access: 'public',
47 + updateInternalDependencies: 'patch',
48 + ___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH: {
49 + onlyUpdatePeerDependentsWhenOutOfRange: true,
50 + },
51 + });
52 + await json('packages/core/package.json', { name: '@composio/core', version: '0.28.0' });
53 + await json('packages/slim/package.json', { name: '@composio/slim', version: '0.28.0' });
54 + await json('packages/provider/package.json', {
55 + name: '@composio/provider',
56 + version: '0.11.0',
57 + peerDependencies: { '@composio/core': '^0.28.0 || ^0.29.0' },
58 + });
59 + await json('packages/cli/package.json', {
60 + name: '@composio/cli',
61 + version: '0.7.0',
62 + private: true,
63 + });
64 + await json('python/package.json', {
65 + name: '@composio/python-sdk',
66 + version: '0.31.0',
67 + private: true,
68 + });
69 + await writeText(
70 + `${cwd}/python/pyproject.toml`,
71 + '[project]\nname = "composio"\nversion = "0.31.0"\n'
72 + );
73 + await writeText(
74 + `${cwd}/python/setup.py`,
75 + 'from setuptools import setup\nsetup(name="composio")\n'
76 + );
77 + await writeText(`${cwd}/python/composio/__version__.py`, '__version__ = "0.31.0"\n');
78 + for (const provider of ['openai', 'outside']) {
79 + await writeText(
80 + `${cwd}/python/providers/${provider}/pyproject.toml`,
81 + `[project]\nname = "composio-${provider}"\nversion = "0.31.0"\n`
82 + );
83 + await writeText(
84 + `${cwd}/python/providers/${provider}/setup.py`,
85 + `from setuptools import setup\nsetup(name="composio_${provider}", version="0.31.0")\n`
86 + );
87 + }
88 + await symlink(await resolvePath('node_modules'), `${cwd}/node_modules`);
89 + const note = async (
90 + id: string,
91 + releases: Record<string, string>,
92 + summary = 'Recorded SDK change.'
93 + ) =>
94 + writeText(
95 + `${cwd}/.changeset/${id}.md`,
96 + `---\n${Object.entries(releases)
97 + .map(([name, type]) => `${JSON.stringify(name)}: ${type}`)
98 + .join('\n')}\n---\n\n${summary}\n`
99 + );
100 + return { cwd, json, note };
101 +}
102 +
103 +afterEach(() => roots.cleanup());
104 +
105 +function versions(plan: SdkReleasePlan) {
106 + return Object.fromEntries(plan.releases.map(release => [release.name, release.newVersion]));
107 +}
108 +
109 +describe('SDK release planning', () => {
110 + test('Python-only fragments version private marker and every Python mirror without npm targets', async () => {
111 + const { cwd, note } = await fixture();
112 + await note('python-fix', { '@composio/python-sdk': 'patch' }, 'Fix connected account updates.');
113 + const plan = await createSdkReleasePlan(cwd);
114 + expect(versions(plan)).toEqual({ '@composio/python-sdk': '0.31.1' });
115 + expect(plan.releases[0].language).toBe('python');
116 + await applySdkReleasePlan(cwd, plan, { updateLockfile: false });
117 + expect(await readText(`${cwd}/python/CHANGELOG.md`)).toContain(
118 + 'Fix connected account updates.'
119 + );
120 + expect(await readText(`${cwd}/python/composio/__version__.py`)).toContain('0.31.1');
121 + const packages = await discoverPythonPackages(cwd);
122 + expect(packages.map(pkg => pkg.name)).toEqual([
123 + 'composio',
124 + 'composio-openai',
125 + 'composio-outside',
126 + ]);
127 + expect(packages.every(pkg => pkg.version === '0.31.1')).toBe(true);
128 + expect(await readText(`${cwd}/python/providers/outside/setup.py`)).toContain('0.31.1');
129 + expect(await readText(`${cwd}/python/setup.py`)).toBe(
130 + 'from setuptools import setup\nsetup(name="composio")\n'
131 + );
132 + });
133 +
134 + test('mixed recommendations retain TS independent provider versions and per-language overrides', async () => {
135 + const { cwd, note } = await fixture();
136 + await note('mixed', {
137 + '@composio/core': 'minor',
138 + '@composio/provider': 'patch',
139 + '@composio/python-sdk': 'patch',
140 + });
141 + const plan = await createSdkReleasePlan(cwd, { python: 'minor' });
142 + expect(versions(plan)).toEqual({
143 + '@composio/core': '0.29.0',
144 + '@composio/slim': '0.29.0',
145 + '@composio/provider': '0.11.1',
146 + '@composio/python-sdk': '0.32.0',
147 + });
148 + expect(
149 + plan.recommended.find(release => release.name === '@composio/python-sdk')?.newVersion
150 + ).toBe('0.31.1');
151 + });
152 +
153 + test('lower TS override is applied before fixed-group and peer dependency planning', async () => {
154 + const { cwd, note } = await fixture();
155 + await note('minor-core', { '@composio/core': 'minor' });
156 + const plan = await createSdkReleasePlan(cwd, { typescript: 'patch' });
157 + expect(versions(plan)).toEqual({ '@composio/core': '0.28.1', '@composio/slim': '0.28.1' });
158 + expect(plan.recommended.find(release => release.name === '@composio/core')?.newVersion).toBe(
159 + '0.29.0'
160 + );
161 + });
162 +
163 + test('skipping one language preserves its entry and summary in a mixed fragment', async () => {
164 + const { cwd, note } = await fixture();
165 + await note(
166 + 'mixed',
167 + { '@composio/core': 'patch', '@composio/python-sdk': 'minor' },
168 + 'Keep this summary for both SDKs.'
169 + );
170 + const plan = await createSdkReleasePlan(cwd, { python: 'skip' });
171 + await applySdkReleasePlan(cwd, plan, { updateLockfile: false });
172 + const remaining = await readText(`${cwd}/.changeset/mixed.md`);
173 + expect(remaining).toContain('"@composio/python-sdk": minor');
174 + expect(remaining).not.toContain('@composio/core');
175 + expect(remaining).toContain('Keep this summary for both SDKs.');
176 + expect(versions(await createSdkReleasePlan(cwd))).toEqual({ '@composio/python-sdk': '0.32.0' });
177 + });
178 +
179 + test('empty auto is a no-op and explicit bumps create honest primary-group maintenance releases', async () => {
180 + const { cwd } = await fixture();
181 + expect((await createSdkReleasePlan(cwd)).releases).toEqual([]);
182 + const plan = await createSdkReleasePlan(cwd, { typescript: 'patch', python: 'minor' });
183 + expect(versions(plan)).toEqual({
184 + '@composio/core': '0.28.1',
185 + '@composio/slim': '0.28.1',
186 + '@composio/python-sdk': '0.32.0',
187 + });
188 + expect(plan.changesets.map(note => note.summary).join('\n')).toContain(
189 + 'No user-facing changes were recorded'
190 + );
191 + });
192 +
193 + test('prerelease mode is not a stable plan', async () => {
194 + const { cwd, json } = await fixture();
195 + await json('.changeset/pre.json', { mode: 'pre', tag: 'beta' });
196 + await expect(createSdkReleasePlan(cwd)).rejects.toThrow('prerelease');
197 + });
198 +
199 + test.each([
200 + ['python/composio/__version__.py', '__version__ = "0.30.0"\n'],
201 + ['python/providers/outside/setup.py', 'setup(version="0.30.0")\n'],
202 + ])('rejects Python metadata drift in %s before no-op planning', async (path, contents) => {
203 + const { cwd } = await fixture();
204 + await writeText(`${cwd}/${path}`, contents);
205 + await expect(createSdkReleasePlan(cwd)).rejects.toThrow('Python version mirror mismatch');
206 + });
207 +
208 + test('applying Python release metadata regenerates a real uv workspace lock', async () => {
209 + const { cwd, note } = await fixture();
210 + await writeText(
211 + `${cwd}/pyproject.toml`,
212 + '[project]\nname = "release-fixture"\nversion = "0.0.0"\nrequires-python = ">=3.11"\n[tool.uv.workspace]\nmembers = ["python", "python/providers/openai"]\n'
213 + );
214 + await note('python-lock', { '@composio/python-sdk': 'patch' });
215 + const plan = await createSdkReleasePlan(cwd);
216 + const previousOffline = process.env.UV_OFFLINE;
217 + const previousDownloads = process.env.UV_PYTHON_DOWNLOADS;
218 + process.env.UV_OFFLINE = '1';
219 + process.env.UV_PYTHON_DOWNLOADS = 'never';
220 + try {
221 + await applySdkReleasePlan(cwd, plan);
222 + } finally {
223 + if (previousOffline === undefined) delete process.env.UV_OFFLINE;
224 + else process.env.UV_OFFLINE = previousOffline;
225 + if (previousDownloads === undefined) delete process.env.UV_PYTHON_DOWNLOADS;
226 + else process.env.UV_PYTHON_DOWNLOADS = previousDownloads;
227 + }
228 + const lock = await readText(`${cwd}/uv.lock`);
229 + expect(lock).toMatch(/name = "composio"\nversion = "0\.31\.1"/);
230 + expect(lock).toMatch(/name = "composio-openai"\nversion = "0\.31\.1"/);
231 + expect((await discoverPythonPackages(cwd)).every(pkg => pkg.version === '0.31.1')).toBe(true);
232 + });
233 +
234 + test('ignored CLI and unrelated private package notes cannot enter SDK releases', async () => {
235 + const { cwd, note, json } = await fixture();
236 + await note('cli', { '@composio/cli': 'patch' });
237 + await expect(createSdkReleasePlan(cwd)).rejects.toThrow('not an SDK release target');
238 + await remove(`${cwd}/.changeset/cli.md`);
239 + await json('packages/example/package.json', {
240 + name: 'private-example',
241 + version: '1.0.0',
242 + private: true,
243 + });
244 + await note('example', { 'private-example': 'patch' });
245 + await expect(createSdkReleasePlan(cwd)).rejects.toThrow('not an SDK release target');
246 + });
247 +
248 + test('application rejects retained entries that were not in the selected source plan', async () => {
249 + const { cwd, note } = await fixture();
250 + await note('core', { '@composio/core': 'patch' });
251 + const selected = await createSdkReleasePlan(cwd);
252 + const plan = {
253 + ...selected,
254 + retainedChangesets: [
255 + ...selected.retainedChangesets,
256 + {
257 + id: 'unrelated',
258 + summary: 'Not an authored fragment.',
259 + releases: [{ name: '@composio/python-sdk', type: 'patch' as const }],
260 + },
261 + ],
262 + };
263 + await expect(applySdkReleasePlan(cwd, plan, { updateLockfile: false })).rejects.toThrow(
264 + 'selected source plan'
265 + );
266 + expect(await exists(`${cwd}/.changeset/unrelated.md`)).toBe(false);
267 + expect(JSON.parse(await readText(`${cwd}/packages/core/package.json`)).version).toBe('0.28.0');
268 + });
269 +
270 + test('a changed release input is rejected before application changes versions', async () => {
271 + const { cwd, note } = await fixture();
272 + await note('core', { '@composio/core': 'patch' });
273 + const plan = await createSdkReleasePlan(cwd);
274 + await note('new-change', { '@composio/core': 'minor' });
275 + await expect(applySdkReleasePlan(cwd, plan, { updateLockfile: false })).rejects.toThrow(
276 + 'changed'
277 + );
278 + expect(JSON.parse(await readText(`${cwd}/packages/core/package.json`)).version).toBe('0.28.0');
279 + });
280 +});
ts/scripts/validate-changesets.d.mts new
+11
@@ -0,0 +1,11 @@
1 +export function missingReleaseNotes(
2 + changedPaths: string[],
3 + changesets: { id?: string; releases: { name: string; type: string }[] }[],
4 + packages: { name: string; directory: string; private?: boolean }[],
5 + exemption?: string
6 +): string[];
7 +export function validateChangesets(cwd?: string, base?: string): Promise<void>;
8 +export function findIgnoredChangesetReleases(
9 + status: { changesets?: { id: string; releases?: { name: string }[] }[] },
10 + ignoredPackages: string[]
11 +): { changeset: string; package: string }[];
ts/scripts/validate-changesets.mjs
+68 -1
@@ -1,6 +1,8 @@
1 #!/usr/bin/env node
2
3 import { readFileSync } from 'node:fs';
4 +import { execFileSync } from 'node:child_process';
5 +import { getPackages } from '@manypkg/get-packages';
6 import { dirname, resolve } from 'node:path';
7 import { fileURLToPath } from 'node:url';
8 import readChangesets from '@changesets/read';
@@ -18,9 +20,74 @@ export function findIgnoredChangesetReleases(changesetStatus, ignoredPackages) {
20 );
21 }
22
21 -export async function validateChangesets(cwd = repositoryRoot) {
23 +export function missingReleaseNotes(changedPaths, changesets, packages, exemption = '') {
24 + if (/<!--\s*sdk-release-note-exempt:\s*(.{20,}?)\s*-->/s.test(exemption)) return [];
25 + const required = new Set();
26 + for (const path of changedPaths) {
27 + if (
28 + /(?:^|\/)(?:tests?|integration_tests?|__tests__|fixtures?|__fixtures__|examples|scripts)(?:\/|$)|(?:\.test|\.spec)\.|(?:^|\/)test_[^/]*\.py$|_test\.py$|(?:^|\/)(?:AGENTS\.md|CHANGELOG\.md|README\.md)$/.test(
29 + path
30 + )
31 + )
32 + continue;
33 + if (
34 + /^python\/(?:composio\/.*\.pyi?|providers\/[^/]+\/(?:composio_[^/]+\/.*\.pyi?|pyproject\.toml|setup\.py)|pyproject\.toml|setup\.py)$/.test(
35 + path
36 + )
37 + )
38 + required.add('@composio/python-sdk');
39 + for (const pkg of packages) {
40 + if (
41 + !pkg.private &&
42 + pkg.name !== '@composio/cli' &&
43 + path.startsWith(`${pkg.directory}/`) &&
44 + /\.(?:ts|tsx|js|mjs|json)$/.test(path)
45 + )
46 + required.add(pkg.name);
47 + }
48 + }
49 + const covered = new Set(
50 + changesets
51 + .filter(note => changedPaths.includes(`.changeset/${note.id}.md`))
52 + .flatMap(note =>
53 + note.releases
54 + .filter(entry => ['patch', 'minor', 'major'].includes(entry.type))
55 + .map(entry => entry.name)
56 + )
57 + );
58 + return [...required].filter(name => !covered.has(name)).sort();
59 +}
60 +
61 +export async function validateChangesets(
62 + cwd = repositoryRoot,
63 + base = process.env.SDK_RELEASE_NOTE_BASE
64 +) {
65 const config = JSON.parse(readFileSync(resolve(cwd, '.changeset/config.json'), 'utf8'));
66 const changesets = await readChangesets(cwd);
67 + if (base) {
68 + if (!/^[a-zA-Z0-9_./-]+$/.test(base)) throw new Error('Invalid release-note comparison base');
69 + const paths = execFileSync('git', ['diff', '--name-only', `${base}...HEAD`], {
70 + cwd,
71 + encoding: 'utf8',
72 + })
73 + .trim()
74 + .split('\n');
75 + const { packages } = await getPackages(cwd);
76 + const missing = missingReleaseNotes(
77 + paths,
78 + changesets,
79 + packages.map(pkg => ({
80 + name: pkg.packageJson.name,
81 + private: pkg.packageJson.private,
82 + directory: pkg.dir.slice(cwd.length + 1),
83 + })),
84 + process.env.SDK_RELEASE_PR_BODY ?? ''
85 + );
86 + if (missing.length)
87 + throw new Error(
88 + `SDK behavior changes require release notes for: ${missing.join(', ')}. Add a Changeset or explain the public-behavior exemption in the PR description.`
89 + );
90 + }
91 const violations = findIgnoredChangesetReleases({ changesets }, config.ignore ?? []);
92
93 if (violations.length > 0) {
tsconfig.sdk-release.json new
+13
@@ -0,0 +1,13 @@
1 +{
2 + "compilerOptions": {
3 + "target": "ESNext",
4 + "module": "ESNext",
5 + "moduleResolution": "Bundler",
6 + "types": ["bun"],
7 + "strict": true,
8 + "skipLibCheck": true,
9 + "noEmit": true,
10 + "esModuleInterop": true
11 + },
12 + "include": ["scripts/sdk-release/**/*.ts", "test/sdk-release-*.test.ts"]
13 +}