Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('**/bun.lock') }}
- run: bun install --frozen-lockfile
- run: bun run check:zod
- run: bun run biome:check
- run: bun run typecheck
- run: bun run test:ci
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
node-version: 22
registry-url: https://registry.npmjs.org
- run: bun install --frozen-lockfile
- run: bun run check:zod
- run: bun run build:packages
- run: bun run release:prepare --version "${{ inputs.version }}"
- run: bun run release:publish --version "${{ inputs.version }}" --dry-run
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
id: version
run: bun run scripts/release/tag-info.ts
- run: bun install --frozen-lockfile
- run: bun run check:zod
- run: bun run biome:check
- run: bun run typecheck
- run: bun run test:ci
Expand Down
1 change: 1 addition & 0 deletions agents/codelayer/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bun
import 'zod/compile'
import { createCodelayerCommand } from './command'

await createCodelayerCommand().parseAsync(process.argv)
7 changes: 4 additions & 3 deletions agents/docs-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
"@humanlayer/agentlayer-filesystem": "workspace:*",
"@humanlayer/codelayer": "workspace:*",
"@types/bun": "latest",
"commander": "catalog:",
"zod": "catalog:"
"commander": "catalog:"
},
"peerDependencies": {
"typescript": "^5"
},
"dependencies": {}
"dependencies": {
"zod": "catalog:"
}
}
1 change: 1 addition & 0 deletions agents/docs-agent/src/workflow.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bun
import 'zod/compile'
import { resolve } from 'node:path'
import { $ } from 'bun'
import { Command } from 'commander'
Expand Down
185 changes: 47 additions & 138 deletions bun.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion examples/yjs-fs-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"ai": "catalog:",
"secure-exec": "^0.2.1",
"y-protocols": "1.0.7",
"yjs": "13.6.30"
"yjs": "13.6.30",
"zod": "catalog:"
},
"devDependencies": {
"@types/bun": "latest",
Expand Down
1 change: 1 addition & 0 deletions examples/yjs-fs-agent/src/run.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bun
import 'zod/compile'
import readline from 'node:readline/promises'
import { anthropic } from '@ai-sdk/anthropic'
import { YjsProvider } from '@durable-streams/y-durable-streams'
Expand Down
4 changes: 2 additions & 2 deletions examples/yjs-fs-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@tiptap/extension-collaboration-cursor": "^2.11.0",
"@tiptap/react": "^2.11.0",
"@tiptap/starter-kit": "^2.11.0",
"@tanstack/react-router": "^1.93.0",
"@tanstack/react-router": "1.170.32",
"@humanlayer/yjs-fs-react": "workspace:*",
"monaco-editor": "^0.52.0",
"y-monaco": "^0.1.6",
Expand All @@ -33,7 +33,7 @@
"devDependencies": {
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@tanstack/router-plugin": "^1.93.0",
"@tanstack/router-plugin": "1.168.35",
"@vitejs/plugin-react": "^4.3.4",
"typescript": "^5.6.3",
"vite": "^6.0.0",
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"biome:check": "biome check .",
"build": "bun --filter '*' build",
"build:packages": "bun --filter './packages/*' --filter './agents/*' build",
"check": "bun --parallel 'typecheck' 'biome' 'test:ci' 'check:release'",
"check": "bun --parallel 'typecheck' 'biome' 'test:ci' 'check:release' 'check:zod'",
"check:release": "bun run scripts/release/validate-manifest.ts",
"check:zod": "bun run scripts/check-zod-version.ts",
"dev": "bun --filter '*' dev",
"docs:build": "bun --filter '@humanlayer/agentlayer-docs' build",
"githooks": "mkdir -p scripts/hooks && cp scripts/hooks/pre-push $(git rev-parse --git-common-dir)/hooks/pre-push && chmod +x $(git rev-parse --git-common-dir)/hooks/pre-push",
Expand Down Expand Up @@ -53,7 +54,7 @@
"effect": "4.0.0-beta.107",
"minimatch": "10.1.1",
"typescript": "5.9.3",
"zod": "4.3.6"
"zod": "4.5.4"
},
"dependencies": {}
}
45 changes: 45 additions & 0 deletions scripts/check-zod-version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bun

const rootPackage = await Bun.file(new URL('../package.json', import.meta.url)).json()
const expectedVersion = rootPackage.catalog?.zod

if (typeof expectedVersion !== 'string') {
throw new Error('The root catalog must define an exact Zod version')
}

const errors: string[] = []

for (const workspaceDirectory of ['agents', 'examples', 'packages']) {
const glob = new Bun.Glob('*/package.json')
for await (const relativePath of glob.scan({ cwd: new URL(`../${workspaceDirectory}/`, import.meta.url).pathname })) {
const manifestPath = `${workspaceDirectory}/${relativePath}`
const manifest = await Bun.file(new URL(`../${manifestPath}`, import.meta.url)).json()

for (const dependencyType of [
'dependencies',
'devDependencies',
'optionalDependencies',
'peerDependencies',
] as const) {
const declaredVersion = manifest[dependencyType]?.zod
if (declaredVersion !== undefined && declaredVersion !== 'catalog:') {
errors.push(`${manifestPath}: ${dependencyType}.zod must use "catalog:", found ${declaredVersion}`)
}
}
}
}

const lockfile = await Bun.file(new URL('../bun.lock', import.meta.url)).text()
const resolvedVersions = new Set([...lockfile.matchAll(/\bzod@(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)/g)].map((match) => match[1]))

if (resolvedVersions.size !== 1 || !resolvedVersions.has(expectedVersion)) {
errors.push(
`bun.lock must resolve only zod@${expectedVersion}, found: ${[...resolvedVersions].sort().join(', ') || 'none'}`,
)
}

if (errors.length > 0) {
throw new Error(`Zod version alignment failed:\n${errors.map((error) => `- ${error}`).join('\n')}`)
}

console.log(`Zod version alignment passed (${expectedVersion})`)
Loading