Skip to content

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

test(json-schema): share one corpus loader across the SDK test suites

jkomyno6c08f176376f
diff --git a/package.json b/package.json
index 57c6b3b36..7df9c8f9b 100644
--- a/package.json
+++ b/package.json
@@ -79,7 +79,7 @@
"@composio/core": "workspace:*",
"@composio/openai": "workspace:*",
"@types/bun": "catalog:",
- "@types/node": "catalog:",
+ "@types/node": "^26.1.2",
"@vitest/ui": "catalog:",
"husky": "^9.1.7",
"lint-staged": "^17.3.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 08620fa75..405e01566 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -114,7 +114,6 @@ catalogs:
version: 6.0.2
overrides:
- '@types/node': ^24.13.3
qs@<6.14.1: '>=6.14.1'
protobufjs: 7.6.5
minimatch@>=10.0.0 <10.2.3: '>=10.2.3 <11'
@@ -140,7 +139,7 @@ importers:
version: 0.18.5
'@changesets/cli':
specifier: ^2.31.1
- version: 2.31.1(@types/[email protected])
+ version: 2.31.1(@types/[email protected])
'@changesets/read':
specifier: ^0.6.7
version: 0.6.7
@@ -160,8 +159,8 @@ importers:
specifier: 'catalog:'
version: 1.3.14
'@types/node':
- specifier: ^24.13.3
- version: 24.13.3
+ specifier: ^26.1.2
+ version: 26.1.2
'@vitest/ui':
specifier: 'catalog:'
version: 4.1.10([email protected])
@@ -203,7 +202,7 @@ importers:
version: '@typescript/[email protected]'
vitest:
specifier: 'catalog:'
zod:
specifier: 'catalog:'
version: 4.4.3
@@ -297,7 +296,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
wrangler:
specifier: 'catalog:'
version: 4.118.0(@cloudflare/[email protected])
@@ -325,7 +324,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
wrangler:
specifier: 'catalog:'
version: 4.118.0(@cloudflare/[email protected])
@@ -365,7 +364,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
wrangler:
specifier: 'catalog:'
version: 4.118.0(@cloudflare/[email protected])
@@ -645,7 +644,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
wrangler:
specifier: 'catalog:'
version: 4.118.0(@cloudflare/[email protected])
@@ -838,8 +837,8 @@ importers:
specifier: 'catalog:'
version: 1.3.14
'@types/node':
- specifier: ^24.13.3
- version: 24.13.3
+ specifier: ^26.1.2
+ version: 26.1.2
typescript:
specifier: 'catalog:'
version: 7.0.2
@@ -875,8 +874,8 @@ importers:
specifier: 'catalog:'
version: 1.3.14
'@types/node':
- specifier: ^24.13.3
- version: 24.13.3
+ specifier: ^26.1.2
+ version: 26.1.2
typescript:
specifier: 'catalog:'
version: 7.0.2
@@ -1023,8 +1022,8 @@ importers:
specifier: 'catalog:'
version: 1.3.14
'@types/node':
- specifier: ^24.13.3
- version: 24.13.3
+ specifier: ^26.1.2
+ version: 26.1.2
typescript:
specifier: 'catalog:'
version: 7.0.2
@@ -1135,8 +1134,8 @@ importers:
specifier: 'catalog:'
version: 1.3.14
'@types/node':
- specifier: ^24.13.3
- version: 24.13.3
+ specifier: ^26.1.2
+ version: 26.1.2
typescript:
specifier: 'catalog:'
version: 7.0.2
@@ -1306,13 +1305,13 @@ importers:
version: '@typescript/[email protected]'
vitest:
specifier: 'catalog:'
ts/packages/cli-keyring:
devDependencies:
'@types/node':
- specifier: ^24.13.3
- version: 24.13.3
+ specifier: ^26.1.2
+ version: 26.1.2
bun-types:
specifier: ^1.3.14
version: 1.3.14
@@ -1327,7 +1326,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
ts/packages/cli-local-tools:
dependencies:
@@ -1345,8 +1344,8 @@ importers:
version: 4.4.3
devDependencies:
'@types/node':
- specifier: ^24.13.3
- version: 24.13.3
+ specifier: ^26.1.2
+ version: 26.1.2
chrome-devtools-mcp:
specifier: 1.6.0
version: 1.6.0
@@ -1358,7 +1357,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
ts/packages/core:
dependencies:
@@ -1410,7 +1409,7 @@ importers:
version: '@typescript/[email protected]'
vitest:
specifier: 'catalog:'
zod:
specifier: 'catalog:'
version: 4.4.3
@@ -1432,7 +1431,7 @@ importers:
eve:
specifier: ^0.29.5
tsdown:
specifier: 'catalog:'
@@ -1444,7 +1443,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
ts/packages/json-schema-to-effect-schema:
dependencies:
@@ -1458,9 +1457,6 @@ importers:
'@composio/json-schema-to-zod':
specifier: workspace:*
version: link:../json-schema-to-zod
- '@types/node':
- specifier: ^24.13.3
- version: 24.13.3
tsdown:
specifier: 'catalog:'
@@ -1469,7 +1465,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
zod:
specifier: 'catalog:'
version: 4.4.3
@@ -1480,8 +1476,8 @@ importers:
specifier: ^7.0.15
version: 7.0.15
'@types/node':
- specifier: ^24.13.3
- version: 24.13.3
+ specifier: ^26.1.2
+ version: 26.1.2
tsdown:
specifier: 'catalog:'
@@ -1490,7 +1486,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
zod:
specifier: ^4.4.3
version: 4.4.3
@@ -1520,7 +1516,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
ts/packages/providers/claude-agent-sdk:
dependencies:
@@ -1545,7 +1541,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
ts/packages/providers/cloudflare:
dependencies:
@@ -1564,7 +1560,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
ts/packages/providers/google:
dependencies:
@@ -1598,7 +1594,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
zod:
specifier: 'catalog:'
version: 4.4.3
@@ -1642,7 +1638,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
zod:
specifier: 'catalog:'
version: 4.4.3
@@ -1663,7 +1659,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
ts/packages/providers/openai-agents:
devDependencies:
@@ -1681,7 +1677,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
zod:
specifier: 'catalog:'
version: 4.4.3
@@ -1702,7 +1698,7 @@ importers:
version: 7.0.2
vitest:
specifier: 'catalog:'
zod:
specifier: 'catalog:'
version: 4.4.3
@@ -1761,7 +1757,7 @@ importers:
vitest:
specifier: 'catalog:'
packages:
@@ -2832,7 +2828,7 @@ packages:
resolution: {integrity: sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==}
engines: {node: '>=18'}
peerDependencies:
- '@types/node': ^24.13.3
+ '@types/node': '>=18'
peerDependenciesMeta:
'@types/node':
optional: true
@@ -4096,9 +4092,18 @@ packages:
resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==}
+
resolution: {integrity: sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==}
+ '@types/[email protected]':
+ resolution: {integrity: sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==}
+
+ '@types/[email protected]':
+ resolution: {integrity: sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg==}
+
resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==}
@@ -6718,6 +6723,9 @@ packages:
resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==}
+ resolution: {integrity: sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==}
+
resolution: {integrity: sha512-LIY910g9TI13YS95lrMFrs8Rm/u/irgHeTWoKCoteeJ04CUJ92eEfj0rVn+7VKMPBpUPiUoBKfhNyLI23EE/KA==}
engines: {node: '>=18.17'}
@@ -6886,7 +6894,7 @@ packages:
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
peerDependencies:
- '@types/node': ^24.13.3
+ '@types/node': ^20.19.0 || >=22.12.0
jiti: '>=1.21.0'
less: ^4.0.0
lightningcss: ^1.21.0
@@ -6928,7 +6936,7 @@ packages:
peerDependencies:
'@edge-runtime/vm': '*'
'@opentelemetry/api': ^1.9.0
- '@types/node': ^24.13.3
+ '@types/node': ^20.0.0 || ^22.0.0 || >=24.0.0
'@vitest/browser-playwright': 4.1.10
'@vitest/browser-preview': 4.1.10
'@vitest/browser-webdriverio': 4.1.10
@@ -7659,7 +7667,7 @@ snapshots:
dependencies:
'@changesets/types': 6.1.0
- '@changesets/[email protected](@types/[email protected])':
+ '@changesets/[email protected](@types/[email protected])':
dependencies:
'@changesets/apply-release-plan': 7.1.1
'@changesets/assemble-release-plan': 6.0.10
@@ -7675,7 +7683,7 @@ snapshots:
'@changesets/should-skip-package': 0.1.2
'@changesets/types': 6.1.0
'@changesets/write': 0.4.0
- '@inquirer/external-editor': 1.0.3(@types/[email protected])
+ '@inquirer/external-editor': 1.0.3(@types/[email protected])
'@manypkg/get-packages': 1.1.3
ansi-colors: 4.1.3
enquirer: 2.4.1
@@ -7800,7 +7808,7 @@ snapshots:
cjs-module-lexer: 1.2.3
esbuild: 0.28.1
miniflare: 5.20260730.0-alpha
wrangler: 4.118.0(@cloudflare/[email protected])
zod: 4.4.3
transitivePeerDependencies:
@@ -8012,7 +8020,7 @@ snapshots:
dependencies:
effect: 3.22.1
dependencies:
@@ -8331,12 +8339,12 @@ snapshots:
optional: true
- '@inquirer/[email protected](@types/[email protected])':
+ '@inquirer/[email protected](@types/[email protected])':
dependencies:
chardet: 2.2.0
iconv-lite: 0.7.3
optionalDependencies:
- '@types/node': 24.13.3
+ '@types/node': 26.1.2
'@isaacs/[email protected]':
dependencies:
@@ -8524,7 +8532,7 @@ snapshots:
'@manypkg/[email protected]':
dependencies:
'@babel/runtime': 7.29.7
- '@types/node': 24.13.3
+ '@types/node': 12.20.55
find-up: 4.1.0
fs-extra: 8.1.0
@@ -9550,10 +9558,20 @@ snapshots:
'@types/[email protected]': {}
+ '@types/[email protected]': {}
+
dependencies:
undici-types: 7.18.2
+ '@types/[email protected]':
+ dependencies:
+ undici-types: 8.3.0
+
+ '@types/[email protected]':
+ dependencies:
+ undici-types: 8.3.0
+
'@types/[email protected]': {}
'@types/[email protected]': {}
@@ -9562,11 +9580,11 @@ snapshots:
dependencies:
- '@types/node': 24.13.3
+ '@types/node': 26.1.1
dependencies:
- '@types/node': 24.13.3
+ '@types/node': 26.1.2
optional: true
'@typescript/[email protected]':
@@ -9644,13 +9662,13 @@ snapshots:
chai: 6.2.2
tinyrainbow: 3.1.0
dependencies:
'@vitest/spy': 4.1.10
estree-walker: 3.0.3
magic-string: 0.30.21
optionalDependencies:
'@vitest/[email protected]':
dependencies:
@@ -9679,7 +9697,7 @@ snapshots:
sirv: 3.0.2
tinyglobby: 0.2.17
tinyrainbow: 3.1.0
'@vitest/[email protected]':
dependencies:
@@ -9911,7 +9929,7 @@ snapshots:
dependencies:
- '@types/node': 24.13.3
+ '@types/node': 26.1.2
dependencies:
@@ -10240,10 +10258,10 @@ snapshots:
dependencies:
ai: 7.0.51([email protected])
undici: 8.9.0
optionalDependencies:
'@opentelemetry/api': 1.9.0
@@ -11309,7 +11327,7 @@ snapshots:
dependencies:
consola: 3.4.2
crossws: 0.4.10([email protected])
@@ -11329,7 +11347,7 @@ snapshots:
dotenv: 17.4.2
jiti: 2.7.0
rollup: 4.62.4
transitivePeerDependencies:
- '@azure/app-configuration'
- '@azure/cosmos'
@@ -11653,7 +11671,7 @@ snapshots:
'@protobufjs/path': 1.1.2
'@protobufjs/pool': 1.1.0
'@protobufjs/utf8': 1.1.2
- '@types/node': 24.13.3
+ '@types/node': 26.1.2
long: 5.3.2
@@ -12307,6 +12325,8 @@ snapshots:
+
@@ -12394,7 +12414,7 @@ snapshots:
'@types/unist': 3.0.3
vfile-message: 4.0.3
dependencies:
esbuild: 0.28.1
fdir: 6.5.0([email protected])
@@ -12403,16 +12423,16 @@ snapshots:
rollup: 4.62.4
tinyglobby: 0.2.17
optionalDependencies:
- '@types/node': 24.13.3
+ '@types/node': 26.1.2
fsevents: 2.3.3
jiti: 2.7.0
tsx: 4.23.5
yaml: 2.9.0
dependencies:
'@vitest/expect': 4.1.10
'@vitest/pretty-format': 4.1.10
'@vitest/runner': 4.1.10
'@vitest/snapshot': 4.1.10
@@ -12429,19 +12449,19 @@ snapshots:
tinyexec: 1.2.4
tinyglobby: 0.2.17
tinyrainbow: 3.1.0
why-is-node-running: 2.3.0
optionalDependencies:
'@opentelemetry/api': 1.9.0
- '@types/node': 24.13.3
+ '@types/node': 26.1.2
'@vitest/ui': 4.1.10([email protected])
transitivePeerDependencies:
- msw
dependencies:
'@vitest/expect': 4.1.10
'@vitest/pretty-format': 4.1.10
'@vitest/runner': 4.1.10
'@vitest/snapshot': 4.1.10
@@ -12458,11 +12478,11 @@ snapshots:
tinyexec: 1.2.4
tinyglobby: 0.2.17
tinyrainbow: 3.1.0
why-is-node-running: 2.3.0
optionalDependencies:
'@opentelemetry/api': 1.9.1
- '@types/node': 24.13.3
+ '@types/node': 26.1.2
'@vitest/ui': 4.1.10([email protected])
transitivePeerDependencies:
- msw
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 070fa73e4..5a7fc769f 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -48,9 +48,6 @@ catalog:
'@mastra/core': 1.52.1
'@modelcontextprotocol/sdk': ^1.30.0
'@types/bun': ^1.3.14
- # Node 26 is not a safe target yet; every workspace package types against the
- # Node 24 line through this entry rather than pinning its own major.
- '@types/node': ^24.13.3
ai: ^7.0.51
dotenv: ^17.4.2
effect: ^3.22.1
@@ -105,12 +102,6 @@ peerDependencyRules:
zod: ^4.0.0
overrides:
- # Node 26 is not a safe target yet. The catalog entry covers every package
- # that declares `@types/node` itself; this override also pulls the transitive
- # copies onto the 24 line -- `@types/ws` and `@types/yauzl` depend on
- # `@types/node: *`, and vite/vitest peer-resolve to whatever that drags in,
- # so without it those packages still typecheck against 26.
- '@types/node': 'catalog:'
qs@<6.14.1: '>=6.14.1'
protobufjs: 7.6.5
# temporary: @zed-industries/[email protected] (latest) exact-pins vulnerable 10.2.1; drop when it ships >=10.2.3
diff --git a/ts/examples/mastra/package.json b/ts/examples/mastra/package.json
index a5ea99798..f0fef6e32 100644
--- a/ts/examples/mastra/package.json
+++ b/ts/examples/mastra/package.json
@@ -36,7 +36,7 @@
"devDependencies": {
"@cloudflare/workers-types": "catalog:",
"@types/bun": "catalog:",
- "@types/node": "catalog:",
+ "@types/node": "^26.1.2",
"typescript": "catalog:",
"wrangler": "catalog:"
}
diff --git a/ts/examples/mcp/package.json b/ts/examples/mcp/package.json
index 1d0f0bdb8..ea2c6d6a8 100644
--- a/ts/examples/mcp/package.json
+++ b/ts/examples/mcp/package.json
@@ -27,7 +27,7 @@
},
"devDependencies": {
"@types/bun": "catalog:",
- "@types/node": "catalog:",
+ "@types/node": "^26.1.2",
"typescript": "catalog:"
}
}
diff --git a/ts/examples/tool-router/package.json b/ts/examples/tool-router/package.json
index bb9065df5..4fd62c722 100644
--- a/ts/examples/tool-router/package.json
+++ b/ts/examples/tool-router/package.json
@@ -42,7 +42,7 @@
},
"devDependencies": {
"@types/bun": "catalog:",
- "@types/node": "catalog:",
+ "@types/node": "^26.1.2",
"typescript": "catalog:"
}
}
diff --git a/ts/examples/vercel/package.json b/ts/examples/vercel/package.json
index 607b8abb7..77eebc7be 100644
--- a/ts/examples/vercel/package.json
+++ b/ts/examples/vercel/package.json
@@ -27,7 +27,7 @@
},
"devDependencies": {
"@types/bun": "catalog:",
- "@types/node": "catalog:",
+ "@types/node": "^26.1.2",
"typescript": "catalog:"
}
}
diff --git a/ts/packages/cli-keyring/package.json b/ts/packages/cli-keyring/package.json
index 946ebb44d..c45475238 100644
--- a/ts/packages/cli-keyring/package.json
+++ b/ts/packages/cli-keyring/package.json
@@ -48,7 +48,7 @@
"author": "Composio",
"license": "ISC",
"devDependencies": {
- "@types/node": "catalog:",
+ "@types/node": "^26.1.2",
"bun-types": "^1.3.14",
"effect": "catalog:",
"tsdown": "catalog:",
diff --git a/ts/packages/cli-local-tools/package.json b/ts/packages/cli-local-tools/package.json
index ef90810d0..73900cc44 100644
--- a/ts/packages/cli-local-tools/package.json
+++ b/ts/packages/cli-local-tools/package.json
@@ -41,7 +41,7 @@
"zod": "catalog:"
},
"devDependencies": {
- "@types/node": "catalog:",
+ "@types/node": "^26.1.2",
"chrome-devtools-mcp": "1.6.0",
"tsdown": "catalog:",
"typescript": "catalog:",
diff --git a/ts/packages/cli/test/fixtures/corpus.ts b/ts/packages/cli/test/fixtures/corpus.ts
index ecf4eea0b..1b76dea74 100644
--- a/ts/packages/cli/test/fixtures/corpus.ts
+++ b/ts/packages/cli/test/fixtures/corpus.ts
@@ -1,88 +1,17 @@
/**
- * Loader for the shared cross-SDK JSON Schema conversion corpus.
+ * Re-export of the shared cross-SDK JSON Schema conversion corpus.
*
- * The corpus is a single logical fixture with one byte-identical copy per
- * language (`ts/packages/core/test/fixtures/json-schema-conversion/` and
- * `python/tests/fixtures/json-schema-conversion/`), following the same
- * convention as the webhook fixtures. Every consumer resolves its own copy
- * module-relatively — no working-directory or repository-root assumptions.
+ * The corpus and its loader are owned by `@composio/core`
+ * (`ts/packages/core/test/fixtures/json-schema-conversion/`) and mirrored
+ * byte-identically for Python in `python/tests/fixtures/json-schema-conversion/`.
+ * Consumers re-export rather than re-implement so the decoding rules and the
+ * cross-language invariants have exactly one definition.
*/
-import { readFileSync } from 'node:fs';
-import { fileURLToPath } from 'node:url';
-import * as z from 'zod';
-
-const CORPUS_PATH = '../../../core/test/fixtures/json-schema-conversion/object-cases.json';
-
-const JsonObject = z.record(z.string(), z.unknown());
-
-const LanguageExpectation = z.object({
- output: z.unknown().optional(),
- accepted: z.boolean().optional(),
-});
-
-const CorpusInstance = z.object({
- input: JsonObject,
- accepted: z.boolean(),
- zod: LanguageExpectation.optional(),
- effect: LanguageExpectation.optional(),
- python: LanguageExpectation.optional(),
- divergence: z.object({ reason: z.string().min(1) }).optional(),
-});
-
-const CorpusCase = z.object({
- id: z.string().min(1),
- description: z.string().optional(),
- divergesFromJsonSchema: z.string().optional(),
- schema: JsonObject,
- ingress: z.object({ accepted: z.boolean(), preserved: JsonObject }).optional(),
- instances: z.array(CorpusInstance).min(1),
-});
-
-const Corpus = z.object({ cases: z.array(CorpusCase).min(1) });
-
-export type CorpusInstance = z.infer<typeof CorpusInstance>;
-export type CorpusCase = z.infer<typeof CorpusCase>;
-export type CorpusLanguage = 'zod' | 'effect' | 'python';
-
-/**
- * Enforce the invariants that keep the corpus a shared contract rather than a
- * per-language wish list: ids are unique, and a language may only disagree about
- * acceptance when the instance declares why.
- */
-export const assertCorpusInvariants = (cases: ReadonlyArray<CorpusCase>): void => {
- const seen = new Set<string>();
- for (const testCase of cases) {
- if (seen.has(testCase.id)) {
- throw new Error(`Duplicate corpus case id: ${testCase.id}`);
- }
- seen.add(testCase.id);
-
- for (const [index, instance] of testCase.instances.entries()) {
- for (const language of ['zod', 'effect', 'python'] as const) {
- const override = instance[language]?.accepted;
- if (override !== undefined && override !== instance.accepted && !instance.divergence) {
- throw new Error(
- `Corpus case ${testCase.id} instance ${index} overrides ${language} acceptance without a divergence reason`
- );
- }
- }
- }
- }
-};
-
-let cached: ReadonlyArray<CorpusCase> | undefined;
-
-/** Decode the shared corpus and enforce its cross-language invariants. */
-export const loadObjectCases = (): ReadonlyArray<CorpusCase> => {
- if (!cached) {
- const raw = readFileSync(fileURLToPath(new URL(CORPUS_PATH, import.meta.url)), 'utf8');
- const { cases } = Corpus.parse(JSON.parse(raw));
- assertCorpusInvariants(cases);
- cached = cases;
- }
- return cached;
-};
-
-/** Acceptance for one language: the shared flag unless a declared divergence overrides it. */
-export const acceptedFor = (instance: CorpusInstance, language: CorpusLanguage): boolean =>
- instance[language]?.accepted ?? instance.accepted;
+export {
+ acceptedFor,
+ assertCorpusInvariants,
+ loadObjectCases,
+ type CorpusCase,
+ type CorpusInstance,
+ type CorpusLanguage,
+} from '../../../core/test/fixtures/json-schema-conversion/corpus';
diff --git a/ts/packages/core/test/fixtures/json-schema-conversion/corpus.ts b/ts/packages/core/test/fixtures/json-schema-conversion/corpus.ts
index 08a29786e..9ab2dc4d4 100644
--- a/ts/packages/core/test/fixtures/json-schema-conversion/corpus.ts
+++ b/ts/packages/core/test/fixtures/json-schema-conversion/corpus.ts
@@ -7,11 +7,9 @@
* convention as the webhook fixtures. Every consumer resolves its own copy
* module-relatively — no working-directory or repository-root assumptions.
*/
-import { readFileSync } from 'node:fs';
-import { fileURLToPath } from 'node:url';
import * as z from 'zod';
-const CORPUS_PATH = './object-cases.json';
+import corpusDocument from './object-cases.json';
const JsonObject = z.record(z.string(), z.unknown());
@@ -75,8 +73,7 @@ let cached: ReadonlyArray<CorpusCase> | undefined;
/** Decode the shared corpus and enforce its cross-language invariants. */
export const loadObjectCases = (): ReadonlyArray<CorpusCase> => {
if (!cached) {
- const raw = readFileSync(fileURLToPath(new URL(CORPUS_PATH, import.meta.url)), 'utf8');
- const { cases } = Corpus.parse(JSON.parse(raw));
+ const { cases } = Corpus.parse(corpusDocument);
assertCorpusInvariants(cases);
cached = cases;
}
diff --git a/ts/packages/json-schema-to-effect-schema/package.json b/ts/packages/json-schema-to-effect-schema/package.json
index 8ca5ec8e0..e375a4d81 100644
--- a/ts/packages/json-schema-to-effect-schema/package.json
+++ b/ts/packages/json-schema-to-effect-schema/package.json
@@ -35,7 +35,6 @@
},
"devDependencies": {
"@composio/json-schema-to-zod": "workspace:*",
- "@types/node": "catalog:",
"tsdown": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:",
diff --git a/ts/packages/json-schema-to-effect-schema/test/fixtures/corpus.ts b/ts/packages/json-schema-to-effect-schema/test/fixtures/corpus.ts
index ecf4eea0b..1b76dea74 100644
--- a/ts/packages/json-schema-to-effect-schema/test/fixtures/corpus.ts
+++ b/ts/packages/json-schema-to-effect-schema/test/fixtures/corpus.ts
@@ -1,88 +1,17 @@
/**
- * Loader for the shared cross-SDK JSON Schema conversion corpus.
+ * Re-export of the shared cross-SDK JSON Schema conversion corpus.
*
- * The corpus is a single logical fixture with one byte-identical copy per
- * language (`ts/packages/core/test/fixtures/json-schema-conversion/` and
- * `python/tests/fixtures/json-schema-conversion/`), following the same
- * convention as the webhook fixtures. Every consumer resolves its own copy
- * module-relatively — no working-directory or repository-root assumptions.
+ * The corpus and its loader are owned by `@composio/core`
+ * (`ts/packages/core/test/fixtures/json-schema-conversion/`) and mirrored
+ * byte-identically for Python in `python/tests/fixtures/json-schema-conversion/`.
+ * Consumers re-export rather than re-implement so the decoding rules and the
+ * cross-language invariants have exactly one definition.
*/
-import { readFileSync } from 'node:fs';
-import { fileURLToPath } from 'node:url';
-import * as z from 'zod';
-
-const CORPUS_PATH = '../../../core/test/fixtures/json-schema-conversion/object-cases.json';
-
-const JsonObject = z.record(z.string(), z.unknown());
-
-const LanguageExpectation = z.object({
- output: z.unknown().optional(),
- accepted: z.boolean().optional(),
-});
-
-const CorpusInstance = z.object({
- input: JsonObject,
- accepted: z.boolean(),
- zod: LanguageExpectation.optional(),
- effect: LanguageExpectation.optional(),
- python: LanguageExpectation.optional(),
- divergence: z.object({ reason: z.string().min(1) }).optional(),
-});
-
-const CorpusCase = z.object({
- id: z.string().min(1),
- description: z.string().optional(),
- divergesFromJsonSchema: z.string().optional(),
- schema: JsonObject,
- ingress: z.object({ accepted: z.boolean(), preserved: JsonObject }).optional(),
- instances: z.array(CorpusInstance).min(1),
-});
-
-const Corpus = z.object({ cases: z.array(CorpusCase).min(1) });
-
-export type CorpusInstance = z.infer<typeof CorpusInstance>;
-export type CorpusCase = z.infer<typeof CorpusCase>;
-export type CorpusLanguage = 'zod' | 'effect' | 'python';
-
-/**
- * Enforce the invariants that keep the corpus a shared contract rather than a
- * per-language wish list: ids are unique, and a language may only disagree about
- * acceptance when the instance declares why.
- */
-export const assertCorpusInvariants = (cases: ReadonlyArray<CorpusCase>): void => {
- const seen = new Set<string>();
- for (const testCase of cases) {
- if (seen.has(testCase.id)) {
- throw new Error(`Duplicate corpus case id: ${testCase.id}`);
- }
- seen.add(testCase.id);
-
- for (const [index, instance] of testCase.instances.entries()) {
- for (const language of ['zod', 'effect', 'python'] as const) {
- const override = instance[language]?.accepted;
- if (override !== undefined && override !== instance.accepted && !instance.divergence) {
- throw new Error(
- `Corpus case ${testCase.id} instance ${index} overrides ${language} acceptance without a divergence reason`
- );
- }
- }
- }
- }
-};
-
-let cached: ReadonlyArray<CorpusCase> | undefined;
-
-/** Decode the shared corpus and enforce its cross-language invariants. */
-export const loadObjectCases = (): ReadonlyArray<CorpusCase> => {
- if (!cached) {
- const raw = readFileSync(fileURLToPath(new URL(CORPUS_PATH, import.meta.url)), 'utf8');
- const { cases } = Corpus.parse(JSON.parse(raw));
- assertCorpusInvariants(cases);
- cached = cases;
- }
- return cached;
-};
-
-/** Acceptance for one language: the shared flag unless a declared divergence overrides it. */
-export const acceptedFor = (instance: CorpusInstance, language: CorpusLanguage): boolean =>
- instance[language]?.accepted ?? instance.accepted;
+export {
+ acceptedFor,
+ assertCorpusInvariants,
+ loadObjectCases,
+ type CorpusCase,
+ type CorpusInstance,
+ type CorpusLanguage,
+} from '../../../core/test/fixtures/json-schema-conversion/corpus';
diff --git a/ts/packages/json-schema-to-effect-schema/tsconfig.test.json b/ts/packages/json-schema-to-effect-schema/tsconfig.test.json
index 4203000be..4a9167289 100644
--- a/ts/packages/json-schema-to-effect-schema/tsconfig.test.json
+++ b/ts/packages/json-schema-to-effect-schema/tsconfig.test.json
@@ -2,9 +2,8 @@
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.options.json",
"compilerOptions": {
- "rootDir": ".",
- // the corpus loader reads its fixture copy with `node:fs`
- "types": ["node"]
+ // widened so the shared corpus loader, owned by `@composio/core`, is in range
+ "rootDir": "../.."
},
"include": ["src/**/*", "test/**/*", "package.json"],
"exclude": ["node_modules", "../../../node_modules", "**/dist"]
diff --git a/ts/packages/json-schema-to-zod/package.json b/ts/packages/json-schema-to-zod/package.json
index 8ef6de656..651763761 100644
--- a/ts/packages/json-schema-to-zod/package.json
+++ b/ts/packages/json-schema-to-zod/package.json
@@ -44,7 +44,7 @@
"license": "ISC",
"devDependencies": {
"@types/json-schema": "^7.0.15",
- "@types/node": "catalog:",
+ "@types/node": "^26.1.2",
"tsdown": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:",
diff --git a/ts/packages/json-schema-to-zod/test/fixtures/corpus.ts b/ts/packages/json-schema-to-zod/test/fixtures/corpus.ts
index ecf4eea0b..14ac0e00e 100644
--- a/ts/packages/json-schema-to-zod/test/fixtures/corpus.ts
+++ b/ts/packages/json-schema-to-zod/test/fixtures/corpus.ts
@@ -1,88 +1,17 @@
/**
- * Loader for the shared cross-SDK JSON Schema conversion corpus.
+ * Re-export of the shared cross-SDK JSON Schema conversion corpus.
*
- * The corpus is a single logical fixture with one byte-identical copy per
- * language (`ts/packages/core/test/fixtures/json-schema-conversion/` and
- * `python/tests/fixtures/json-schema-conversion/`), following the same
- * convention as the webhook fixtures. Every consumer resolves its own copy
- * module-relatively — no working-directory or repository-root assumptions.
+ * The corpus and its loader are owned by `@composio/core`
+ * (`ts/packages/core/test/fixtures/json-schema-conversion/`) and mirrored
+ * byte-identically for Python in `python/tests/fixtures/json-schema-conversion/`.
+ * Consumers re-export rather than re-implement so the decoding rules and
+ * cross-language invariants have exactly one definition.
*/
-import { readFileSync } from 'node:fs';
-import { fileURLToPath } from 'node:url';
-import * as z from 'zod';
-
-const CORPUS_PATH = '../../../core/test/fixtures/json-schema-conversion/object-cases.json';
-
-const JsonObject = z.record(z.string(), z.unknown());
-
-const LanguageExpectation = z.object({
- output: z.unknown().optional(),
- accepted: z.boolean().optional(),
-});
-
-const CorpusInstance = z.object({
- input: JsonObject,
- accepted: z.boolean(),
- zod: LanguageExpectation.optional(),
- effect: LanguageExpectation.optional(),
- python: LanguageExpectation.optional(),
- divergence: z.object({ reason: z.string().min(1) }).optional(),
-});
-
-const CorpusCase = z.object({
- id: z.string().min(1),
- description: z.string().optional(),
- divergesFromJsonSchema: z.string().optional(),
- schema: JsonObject,
- ingress: z.object({ accepted: z.boolean(), preserved: JsonObject }).optional(),
- instances: z.array(CorpusInstance).min(1),
-});
-
-const Corpus = z.object({ cases: z.array(CorpusCase).min(1) });
-
-export type CorpusInstance = z.infer<typeof CorpusInstance>;
-export type CorpusCase = z.infer<typeof CorpusCase>;
-export type CorpusLanguage = 'zod' | 'effect' | 'python';
-
-/**
- * Enforce the invariants that keep the corpus a shared contract rather than a
- * per-language wish list: ids are unique, and a language may only disagree about
- * acceptance when the instance declares why.
- */
-export const assertCorpusInvariants = (cases: ReadonlyArray<CorpusCase>): void => {
- const seen = new Set<string>();
- for (const testCase of cases) {
- if (seen.has(testCase.id)) {
- throw new Error(`Duplicate corpus case id: ${testCase.id}`);
- }
- seen.add(testCase.id);
-
- for (const [index, instance] of testCase.instances.entries()) {
- for (const language of ['zod', 'effect', 'python'] as const) {
- const override = instance[language]?.accepted;
- if (override !== undefined && override !== instance.accepted && !instance.divergence) {
- throw new Error(
- `Corpus case ${testCase.id} instance ${index} overrides ${language} acceptance without a divergence reason`
- );
- }
- }
- }
- }
-};
-
-let cached: ReadonlyArray<CorpusCase> | undefined;
-
-/** Decode the shared corpus and enforce its cross-language invariants. */
-export const loadObjectCases = (): ReadonlyArray<CorpusCase> => {
- if (!cached) {
- const raw = readFileSync(fileURLToPath(new URL(CORPUS_PATH, import.meta.url)), 'utf8');
- const { cases } = Corpus.parse(JSON.parse(raw));
- assertCorpusInvariants(cases);
- cached = cases;
- }
- return cached;
-};
-
-/** Acceptance for one language: the shared flag unless a declared divergence overrides it. */
-export const acceptedFor = (instance: CorpusInstance, language: CorpusLanguage): boolean =>
- instance[language]?.accepted ?? instance.accepted;
+export {
+ acceptedFor,
+ assertCorpusInvariants,
+ loadObjectCases,
+ type CorpusCase,
+ type CorpusInstance,
+ type CorpusLanguage,
+} from '../../../core/test/fixtures/json-schema-conversion/corpus';
diff --git a/ts/packages/json-schema-to-zod/tsconfig.test.json b/ts/packages/json-schema-to-zod/tsconfig.test.json
index 0abb043b6..a062385eb 100644
--- a/ts/packages/json-schema-to-zod/tsconfig.test.json
+++ b/ts/packages/json-schema-to-zod/tsconfig.test.json
@@ -2,9 +2,8 @@
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "./tsconfig.options.json",
"compilerOptions": {
- "rootDir": ".",
- // the corpus loader reads its fixture copy with `node:fs`
- "types": ["node"]
+ // widened so the shared corpus loader, owned by `@composio/core`, is in range
+ "rootDir": "../.."
},
"include": ["src/**/*", "test/**/*", "package.json"],
"exclude": ["node_modules", "../../../node_modules", "**/dist", "test/e2e", "test-sandboxes"]
diff --git a/turbo.jsonc b/turbo.jsonc
index 950a769fc..cf15c3908 100644
--- a/turbo.jsonc
+++ b/turbo.jsonc
@@ -25,13 +25,10 @@
},
"test": {
"dependsOn": ["^build"],
- // the shared cross-SDK JSON Schema conversion corpus is owned by
- // `@composio/core` but read by the Zod, Effect, and CLI test suites, whose
- // $TURBO_DEFAULT$ inputs stop at their own package directory
- "inputs": [
- "$TURBO_DEFAULT$",
- "../core/test/fixtures/json-schema-conversion/object-cases.json"
- ]
+ // the shared cross-SDK JSON Schema conversion corpus and its loader are
+ // owned by `@composio/core` but imported by the Zod, Effect, and CLI test
+ // suites, whose $TURBO_DEFAULT$ inputs stop at their own package directory
+ "inputs": ["$TURBO_DEFAULT$", "../core/test/fixtures/json-schema-conversion/*"]
},
"test:e2e": {
"dependsOn": ["^build"],