OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.
ralph(M13-001): P13 groundwork under pnpm: every direct dependency pinned to the exact version pnpm-lock resolved, a lock snapshot + drift gate, the SSR gate script, and docs/BUN_INSTALL_RECIPE.md
ralph15114464d51e
diff --git a/apps/api/package.json b/apps/api/package.jsonindex 9fa958fba..423480a51 100644--- a/apps/api/package.json+++ b/apps/api/package.json@@ -21,13 +21,13 @@"elysia": "1.4.30","pino": "catalog:","pino-pretty": "catalog:",- "uuid": "^9.0.1",+ "uuid": "9.0.1","zod": "catalog:"},"devDependencies": {- "@faker-js/faker": "^9.0.1",+ "@faker-js/faker": "9.0.1","@openpanel/tsconfig": "workspace:*",- "@types/uuid": "^10.0.0",+ "@types/uuid": "10.0.0","bun-types": "1.4.0","typescript": "catalog:"}diff --git a/apps/public/package.json b/apps/public/package.jsonindex 6ecf12e58..8aa786695 100644--- a/apps/public/package.json+++ b/apps/public/package.json@@ -15,10 +15,10 @@"cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts"},"dependencies": {- "@nivo/funnel": "^0.99.0",+ "@nivo/funnel": "0.99.0","@number-flow/react": "0.5.10",- "@opennextjs/cloudflare": "^1.17.1",- "@openpanel/nextjs": "^1.2.0",+ "@opennextjs/cloudflare": "1.17.1",+ "@openpanel/nextjs": "1.2.0","@openpanel/payments": "workspace:^","@openpanel/sdk-info": "workspace:^","@openstatus/react": "0.0.3",@@ -26,39 +26,39 @@"@radix-ui/react-slider": "1.3.6","@radix-ui/react-slot": "1.2.4","@radix-ui/react-tooltip": "1.2.8",- "cheerio": "^1.0.0",+ "cheerio": "1.1.2","class-variance-authority": "0.7.1","clsx": "2.1.1","dotted-map": "2.2.3","framer-motion": "12.23.25","fumadocs-core": "16.7.11","fumadocs-mdx": "14.2.11",- "fumadocs-openapi": "^10.6.7",+ "fumadocs-openapi": "10.6.7","fumadocs-ui": "16.7.11","geist": "1.5.1",- "lucide-react": "^0.555.0",+ "lucide-react": "0.555.0","next": "16.0.7",- "next-themes": "^0.4.6",+ "next-themes": "0.4.6","react": "catalog:","react-dom": "catalog:",- "react-markdown": "^10.1.0",- "recharts": "^2.15.0",+ "react-markdown": "10.1.0",+ "recharts": "2.15.4","rehype-external-links": "3.0.0",- "shiki": "^4.0.2",+ "shiki": "4.0.2","tailwind-merge": "3.4.0","tailwindcss-animate": "1.0.7","zod": "catalog:"},"devDependencies": {- "@tailwindcss/postcss": "^4.1.17",- "@types/mdx": "^2.0.13",+ "@tailwindcss/postcss": "4.1.17",+ "@types/mdx": "2.0.13","@types/node": "catalog:","@types/react": "catalog:","@types/react-dom": "catalog:",- "autoprefixer": "^10.4.22",- "postcss": "^8.5.6",+ "autoprefixer": "10.4.22",+ "postcss": "8.5.6","tailwindcss": "4.1.17","typescript": "catalog:",- "wrangler": "^4.65.0"+ "wrangler": "4.65.0"}}\ No newline at end of filediff --git a/apps/start/package.json b/apps/start/package.jsonindex 336cdb412..6b015a473 100644--- a/apps/start/package.json+++ b/apps/start/package.json@@ -18,71 +18,71 @@"with-env": "dotenv -e ../../.env -c --"},"dependencies": {- "@better-agent/client": "^0.1.0-beta.3",- "@codemirror/commands": "^6.7.0",- "@codemirror/lang-javascript": "^6.2.0",- "@codemirror/lang-json": "^6.0.1",- "@codemirror/state": "^6.4.0",- "@codemirror/theme-one-dark": "^6.1.3",- "@codemirror/view": "^6.35.0",- "@dnd-kit/core": "^6.3.1",- "@dnd-kit/sortable": "^10.0.0",- "@dnd-kit/utilities": "^3.2.2",- "@faker-js/faker": "^9.6.0",- "@hookform/resolvers": "^5.2.2",- "@nivo/sankey": "^0.99.0",+ "@better-agent/client": "0.1.0-beta.3",+ "@codemirror/commands": "6.10.1",+ "@codemirror/lang-javascript": "6.2.4",+ "@codemirror/lang-json": "6.0.2",+ "@codemirror/state": "6.5.4",+ "@codemirror/theme-one-dark": "6.1.3",+ "@codemirror/view": "6.39.11",+ "@dnd-kit/core": "6.3.1",+ "@dnd-kit/sortable": "10.0.0",+ "@dnd-kit/utilities": "3.2.2",+ "@faker-js/faker": "9.9.0",+ "@hookform/resolvers": "5.2.2",+ "@nivo/sankey": "0.99.0","@number-flow/react": "0.5.10","@openpanel/core": "workspace:^","@openpanel/payments": "workspace:*","@openpanel/sdk-info": "workspace:^",- "@openpanel/web": "^1.0.1",- "@radix-ui/react-accordion": "^1.2.12",- "@radix-ui/react-alert-dialog": "^1.1.15",- "@radix-ui/react-aspect-ratio": "^1.1.7",- "@radix-ui/react-avatar": "^1.1.10",- "@radix-ui/react-checkbox": "^1.3.3",- "@radix-ui/react-dialog": "^1.1.15",- "@radix-ui/react-dropdown-menu": "^2.1.16",- "@radix-ui/react-label": "^2.1.7",- "@radix-ui/react-popover": "^1.1.15",- "@radix-ui/react-portal": "^1.1.9",- "@radix-ui/react-progress": "^1.1.7",- "@radix-ui/react-radio-group": "^1.3.8",- "@radix-ui/react-scroll-area": "^1.2.10",- "@radix-ui/react-select": "^2.2.6",- "@radix-ui/react-separator": "^1.1.7",+ "@openpanel/web": "1.0.5",+ "@radix-ui/react-accordion": "1.2.12",+ "@radix-ui/react-alert-dialog": "1.1.15",+ "@radix-ui/react-aspect-ratio": "1.1.7",+ "@radix-ui/react-avatar": "1.1.10",+ "@radix-ui/react-checkbox": "1.3.3",+ "@radix-ui/react-dialog": "1.1.15",+ "@radix-ui/react-dropdown-menu": "2.1.16",+ "@radix-ui/react-label": "2.1.7",+ "@radix-ui/react-popover": "1.1.15",+ "@radix-ui/react-portal": "1.1.9",+ "@radix-ui/react-progress": "1.1.7",+ "@radix-ui/react-radio-group": "1.3.8",+ "@radix-ui/react-scroll-area": "1.2.10",+ "@radix-ui/react-select": "2.2.6",+ "@radix-ui/react-separator": "1.1.7","@radix-ui/react-slider": "1.2.3",- "@radix-ui/react-slot": "^1.2.3",- "@radix-ui/react-switch": "^1.2.6",- "@radix-ui/react-tabs": "^1.1.13",- "@radix-ui/react-toast": "^1.2.15",- "@radix-ui/react-toggle": "^1.1.10",- "@radix-ui/react-toggle-group": "^1.1.11",- "@radix-ui/react-tooltip": "^1.2.8",- "@reduxjs/toolkit": "^2.8.2",- "@sentry/tanstackstart-react": "^9.12.0",- "@tailwindcss/container-queries": "^0.1.1",- "@tailwindcss/typography": "^0.5.15",- "@tailwindcss/vite": "^4.0.6",- "@tanstack/match-sorter-utils": "^8.19.4",- "@tanstack/nitro-v2-vite-plugin": "^1.133.19",- "@tanstack/react-devtools": "^0.7.6",- "@tanstack/react-query": "^5.90.2",- "@tanstack/react-query-devtools": "^5.90.2",- "@tanstack/react-router": "^1.132.47",- "@tanstack/react-router-devtools": "^1.132.51",- "@tanstack/react-router-ssr-query": "^1.132.47",- "@tanstack/react-start": "^1.132.56",- "@tanstack/react-store": "^0.8.0",- "@tanstack/react-table": "^8.21.3",- "@tanstack/react-virtual": "^3.13.12",- "@tanstack/router-plugin": "^1.132.56",- "@tanstack/store": "^0.8.0",- "@trpc/client": "^11.17.0",- "@trpc/react-query": "^11.6.0",- "@trpc/server": "^11.17.0",- "@trpc/tanstack-react-query": "^11.6.0",- "@types/d3": "^7.4.3",+ "@radix-ui/react-slot": "1.2.3",+ "@radix-ui/react-switch": "1.2.6",+ "@radix-ui/react-tabs": "1.1.13",+ "@radix-ui/react-toast": "1.2.15",+ "@radix-ui/react-toggle": "1.1.10",+ "@radix-ui/react-toggle-group": "1.1.11",+ "@radix-ui/react-tooltip": "1.2.8",+ "@reduxjs/toolkit": "2.8.2",+ "@sentry/tanstackstart-react": "9.46.0",+ "@tailwindcss/container-queries": "0.1.1",+ "@tailwindcss/typography": "0.5.15",+ "@tailwindcss/vite": "4.1.12",+ "@tanstack/match-sorter-utils": "8.19.4",+ "@tanstack/nitro-v2-vite-plugin": "1.133.19",+ "@tanstack/react-devtools": "0.7.6",+ "@tanstack/react-query": "5.90.2",+ "@tanstack/react-query-devtools": "5.90.2",+ "@tanstack/react-router": "1.132.47",+ "@tanstack/react-router-devtools": "1.132.51",+ "@tanstack/react-router-ssr-query": "1.132.47",+ "@tanstack/react-start": "1.132.56",+ "@tanstack/react-store": "0.8.0",+ "@tanstack/react-table": "8.21.3",+ "@tanstack/react-virtual": "3.13.12",+ "@tanstack/router-plugin": "1.132.56",+ "@tanstack/store": "0.8.0",+ "@trpc/client": "11.17.0",+ "@trpc/react-query": "11.6.0",+ "@trpc/server": "11.17.0",+ "@trpc/tanstack-react-query": "11.6.0",+ "@types/d3": "7.4.3","@visx/curve": "4.0.1-alpha.0","@visx/event": "4.0.1-alpha.0","@visx/gradient": "4.0.1-alpha.0",@@ -91,99 +91,99 @@"@visx/responsive": "4.0.1-alpha.0","@visx/scale": "4.0.1-alpha.0","@visx/shape": "4.0.1-alpha.0",- "bind-event-listener": "^3.0.0",- "class-variance-authority": "^0.7.1",- "clsx": "^2.1.1",- "cmdk": "^0.2.1",- "codemirror": "^6.0.1",- "d3": "^7.8.5",- "d3-array": "^3.2.4",- "date-fns": "^3.3.1",- "debounce": "^2.2.0",- "embla-carousel-autoplay": "^8.6.0",+ "bind-event-listener": "3.0.0",+ "class-variance-authority": "0.7.1",+ "clsx": "2.1.1",+ "cmdk": "0.2.1",+ "codemirror": "6.0.2",+ "d3": "7.8.5",+ "d3-array": "3.2.4",+ "date-fns": "3.3.1",+ "debounce": "2.2.0",+ "embla-carousel-autoplay": "8.6.0","embla-carousel-react": "8.0.0-rc22",- "flag-icons": "^7.1.0",- "framer-motion": "^11.0.28",- "hamburger-react": "^2.5.0",- "input-otp": "^1.2.4",- "javascript-time-ago": "^2.5.9",- "katex": "^0.16.21",- "lodash.debounce": "^4.0.8",- "lodash.isequal": "^4.5.0",- "lodash.throttle": "^4.1.1",- "lottie-react": "^2.4.0",- "lucide-react": "^0.476.0",- "mathjs": "^12.3.2",- "mitt": "^3.0.1",- "motion": "^12.40.0",- "nanoid": "^5.1.6",- "nuqs": "^2.5.2",- "prisma-error-enum": "^0.1.3",- "pushmodal": "^1.0.3",- "ramda": "^0.29.1",- "random-animal-name": "^0.1.1",- "rc-virtual-list": "^3.14.5",+ "flag-icons": "7.1.0",+ "framer-motion": "11.18.2",+ "hamburger-react": "2.5.0",+ "input-otp": "1.2.4",+ "javascript-time-ago": "2.5.9",+ "katex": "0.16.21",+ "lodash.debounce": "4.0.8",+ "lodash.isequal": "4.5.0",+ "lodash.throttle": "4.1.1",+ "lottie-react": "2.4.0",+ "lucide-react": "0.476.0",+ "mathjs": "12.3.2",+ "mitt": "3.0.1",+ "motion": "12.40.0",+ "nanoid": "5.1.6",+ "nuqs": "2.5.2",+ "prisma-error-enum": "0.1.3",+ "pushmodal": "1.0.3",+ "ramda": "0.29.1",+ "random-animal-name": "0.1.1",+ "rc-virtual-list": "3.14.5","react": "catalog:",- "react-animate-height": "^3.2.3",- "react-animated-numbers": "^1.1.1",- "react-day-picker": "^9.9.0",+ "react-animate-height": "3.2.3",+ "react-animated-numbers": "1.1.1",+ "react-day-picker": "9.9.0","react-dom": "catalog:",- "react-grid-layout": "^1.5.2",- "react-hook-form": "^7.50.1",+ "react-grid-layout": "1.5.2",+ "react-hook-form": "7.50.1","react-in-viewport": "1.0.0-beta.8",- "react-markdown": "^10.1.0",- "react-redux": "^8.1.3",- "react-resizable": "^3.0.5",- "react-responsive": "^9.0.2",+ "react-markdown": "10.1.0",+ "react-redux": "8.1.3",+ "react-resizable": "3.0.5",+ "react-responsive": "9.0.2","react-simple-maps": "3.0.0","react-svg-worldmap": "2.0.0-alpha.16",- "react-syntax-highlighter": "^15.5.0",- "react-use-websocket": "^4.7.0",- "react-virtualized-auto-sizer": "^1.0.22",- "recharts": "^2.15.4",- "rehype-katex": "^7.0.1",- "remark-gfm": "^4.0.1",- "remark-highlight": "^0.1.1",- "remark-math": "^6.0.0",- "remark-parse": "^11.0.0",- "remark-rehype": "^11.1.2",+ "react-syntax-highlighter": "15.5.0",+ "react-use-websocket": "4.7.0",+ "react-virtualized-auto-sizer": "1.0.22",+ "recharts": "2.15.4",+ "rehype-katex": "7.0.1",+ "remark-gfm": "4.0.1",+ "remark-highlight": "0.1.1",+ "remark-math": "6.0.0",+ "remark-parse": "11.0.0",+ "remark-rehype": "11.1.2","rrweb-player": "2.0.0-alpha.20",- "short-unique-id": "^5.0.3",- "slugify": "^1.6.6",- "sonner": "^1.4.0",- "superjson": "^2.2.2",- "tailwind-merge": "^3.3.1",- "tailwindcss": "^4.0.6",- "tailwindcss-animate": "^1.0.7",- "tw-animate-css": "^1.3.6",- "use-stick-to-bottom": "^1.1.3",- "usehooks-ts": "^2.14.0",- "vite-tsconfig-paths": "^5.1.4",+ "short-unique-id": "5.0.3",+ "slugify": "1.6.6",+ "sonner": "1.4.0",+ "superjson": "2.2.2",+ "tailwind-merge": "3.3.1",+ "tailwindcss": "4.1.12",+ "tailwindcss-animate": "1.0.7",+ "tw-animate-css": "1.3.7",+ "use-stick-to-bottom": "1.1.3",+ "usehooks-ts": "2.14.0",+ "vite-tsconfig-paths": "5.1.4","zod": "catalog:"},"devDependencies": {"@biomejs/biome": "1.9.4","@cloudflare/vite-plugin": "1.33.2","@openpanel/db": "workspace:*",- "@tanstack/devtools-event-client": "^0.3.3",- "@testing-library/dom": "^10.4.0",- "@testing-library/react": "^16.2.0",- "@types/d3-array": "^3.2.2",- "@types/lodash.debounce": "^4.0.9",- "@types/lodash.isequal": "^4.5.8",- "@types/lodash.throttle": "^4.1.9",- "@types/ramda": "^0.31.0",+ "@tanstack/devtools-event-client": "0.3.3",+ "@testing-library/dom": "10.4.1",+ "@testing-library/react": "16.3.0",+ "@types/d3-array": "3.2.2",+ "@types/lodash.debounce": "4.0.9",+ "@types/lodash.isequal": "4.5.8",+ "@types/lodash.throttle": "4.1.9",+ "@types/ramda": "0.31.0","@types/react": "catalog:","@types/react-dom": "catalog:",- "@types/react-grid-layout": "^1.3.5",- "@types/react-simple-maps": "^3.0.4",- "@types/react-syntax-highlighter": "^15.5.11",- "@vitejs/plugin-react": "^5.2.0",- "jsdom": "^26.0.0",+ "@types/react-grid-layout": "1.3.5",+ "@types/react-simple-maps": "3.0.4",+ "@types/react-syntax-highlighter": "15.5.11",+ "@vitejs/plugin-react": "5.2.0",+ "jsdom": "26.1.0","typescript": "catalog:",- "vite": "^7.3.0",- "vitest": "^3.0.5",- "web-vitals": "^4.2.4",+ "vite": "7.3.0",+ "vitest": "3.1.3",+ "web-vitals": "4.2.4","wrangler": "4.85.0"}}diff --git a/apps/testbed/package.json b/apps/testbed/package.jsonindex 73515a917..3275d1f78 100644--- a/apps/testbed/package.json+++ b/apps/testbed/package.json@@ -10,15 +10,15 @@},"dependencies": {"@openpanel/web": "workspace:*",- "react": "^19.0.0",- "react-dom": "^19.0.0",- "react-router-dom": "^7.13.1"+ "react": "19.2.3",+ "react-dom": "19.2.3",+ "react-router-dom": "7.13.1"},"devDependencies": {- "@types/react": "^19.0.0",- "@types/react-dom": "^19.0.0",- "@vitejs/plugin-react": "^4.3.4",+ "@types/react": "19.2.7",+ "@types/react-dom": "19.2.3",+ "@vitejs/plugin-react": "4.7.0","typescript": "catalog:",- "vite": "^6.0.0"+ "vite": "6.3.5"}}diff --git a/docs/BUN_INSTALL_RECIPE.md b/docs/BUN_INSTALL_RECIPE.mdnew file mode 100644index 000000000..694cacaa9--- /dev/null+++ b/docs/BUN_INSTALL_RECIPE.md@@ -0,0 +1,518 @@+# BUN_INSTALL_RECIPE++How `pnpm install` becomes `bun install` in M13-002, what each line of+`pnpm-workspace.yaml` turns into, and what the swap is forbidden from doing.++**Status: a recipe, not a decision.** ADR-014 (ACCEPTED) is the decision, and+its stop rule governs everything here:++> **any pin that cannot be reproduced ends P13 and the repo stays on pnpm.**++Nothing in this file may be read as permission to make a pin reproduce by+changing what it pins. ADR-017 rule 3 says the same thing from the other side —+P13 lockfile churn is not an upgrade, and the installer swap must not carry a+declared-range change of its own.++Written for M13-001 (2026-09-07), against `pnpm-workspace.yaml` at the commit+that pinned every direct dependency to its resolved version. Numbers are+labelled with who measured them and when; the operator's throwaway-worktree+survey of a bare `bun install` is labelled as such, because this task did not+run `bun install` against this tree.++---++## 0. What M13-001 already did, and why it matters here++Every direct dependency of every workspace importer that declares a version+range now names an **exact** version, except the two lines ADR-017 rule 2+forbids this task from touching. Audited on the pinned tree, 2026-09-07, across+the lock's 20 importers:++| | count |+|---|---:|+| declared ranges, now exact | **306** |+| still a range — the ADR-017 rule 2 carve-out, below | **2** |+| `workspace:` / `catalog:` specifiers, untouched by design | 99 |+| peers auto-installed by pnpm, left as peer ranges by design | 9 |++`tooling/scripts/pin-from-pnpm-lock.ts` did 263 of those rewrites (253 in 20+`package.json` files plus the 10 `catalog:` entries — the other 53 were already+exact), taking every value from what `pnpm-lock.yaml` had already resolved.+**Not one `version:` line in the lock moved**; only its 263 matching+`specifier:` fields were relabelled, and `pnpm install --frozen-lockfile` is+green on the result. The lock is edited rather than regenerated on purpose —+see *Why the lock is edited, not refreshed* below for the measurement.++### The two dependencies that stay a range++`packages/redis/package.json` and `packages/sdks/_info/package.json` each carry+a stale `prisma: ^5.1.1` devDep, a whole major behind the `@prisma/client` /+`prisma` 6.14.0 that `packages/db` actually uses. **ADR-017 rule 2 (ACCEPTED)+names those two lines by path** and rules that they "are to be **deleted, not+aligned to 6.14**" — the ruling is that touching their version at all is the+wrong move, and the deletion belongs to a separate CLEAN task. Rule 3 is the+general P13 pinning permission; rule 2 is a specific, named exception to it, and+a binding ADR outranks the mechanical "pin everything".++So `pin-from-pnpm-lock.ts` carries an explicit, commented exclusion list+(`ADR_017_RULE_2_FROZEN`) for exactly those two entries, and leaves both the+manifest line and its `specifier:` in the lock at `^5.1.1`. `pnpm-lock.yaml`+still resolves both to `[email protected]`, and+`tooling/gates/p13-lock-snapshot.json` records `5.9.1` for them — the snapshot+is a record of **resolutions**, not of declared ranges, so the drift gate still+holds these two to an exact installed version.++**What M13-002 must know:** these are the only two direct dependencies whose+declared range bun gets to resolve itself. Bun re-resolving `^5.1.1` to a newer+5.x (or the whole `prisma` 5 line vanishing) shows up in `p13-drift.sh` as+drift, not as a silent change. If the CLEAN task deletes them before the swap,+the exclusion list and this section become dead and should go with them; until+then, do not "fix" them in a P13 commit.++That is the precondition for everything below. Bun 1.4.0 **cannot read+`pnpm-lock.yaml`** (operator survey, 2026-09-07) — it re-resolves the whole+graph from the declared ranges — so under carets the swap is an uncontrolled+upgrade of the entire tree (see *Known drift hazards*). A+manifest full of exact versions turns the swap into something a resolver has to+*reproduce* rather than *decide*, and `tooling/gates/p13-drift.sh` is what+checks that it did.++`tooling/gates/p13-lock-snapshot.json` (416 direct dependencies across 20+workspace packages) is the reference, kept as its own committed file precisely+because M13-002 deletes `pnpm-lock.yaml`.++---++## Why the lock is edited, not refreshed++`pin-from-pnpm-lock.ts` writes the manifests, `pnpm-workspace.yaml`'s catalog+**and** the matching `specifier:` lines of `pnpm-lock.yaml`. It does not run+`pnpm install` to have pnpm regenerate the lock, and M13-002 must not either.++The reason is that a non-frozen `pnpm install` does not merely relabel the+specifiers — it re-resolves the whole graph and dedupes it, which moves the+baseline in the same commit that is supposed to prove nothing moved.++**Measured on this box, 2026-09-07**, on the pinned tree, with the manifests+already pinned and only the lock rolled back to `HEAD`'s:++```bash+# from the pinned working tree+cp pnpm-lock.yaml /tmp/lock.pinned.yaml+git show HEAD:pnpm-lock.yaml > pnpm-lock.yaml+pnpm install --lockfile-only # 24.6s, pnpm 11.23.0+cp pnpm-lock.yaml /tmp/lock.refreshed.yaml+cp /tmp/lock.pinned.yaml pnpm-lock.yaml # baseline restored+```++Comparing `/tmp/lock.refreshed.yaml` against the committed (edited) lock:++| | |+|---|---:|+| `packages:` entries, edited lock | 3608 |+| `packages:` entries, refreshed lock | 3466 |+| package versions **pruned** by the refresh | **142** |+| package versions **added** by the refresh | **0** |+| distinct package names that lost a duplicate copy | 135 |+| package names that disappeared entirely | 0 |+| changed lines in the lock diff | 3643 |+| of those, `specifier:` lines | **0** |+| importer `version:` lines that changed | 6 |+| direct dependencies whose resolved version changed | **0** |++Counted with:++```bash+count() { awk '/^packages:/{f=1;next} /^[a-z]/{f=0} f && /^ [^ ]/{n++} END{print n+0}' "$1"; }+count /tmp/lock.refreshed.yaml+diff -u /tmp/lock.pinned.yaml /tmp/lock.refreshed.yaml | grep -cE '^[-+]'+```++The 142 prunes are duplicate copies collapsing: every pruned name still has a+surviving copy, and consumers get re-pointed at it. Concretely, `@babel/core`+goes from four copies (7.24.5, 7.28.3, 7.28.5, 7.29.0) to two, `magicast` from+three (0.3.5, 0.5.1, 0.5.3) to two, `semver` from nine to six. That is why the+6 changed importer `version:` lines are peer-resolution **suffix** changes only+`…(@babel/[email protected]…)` — with the base version identical in all six, which is+why the snapshot generated from the refreshed lock is byte-identical to the+committed one.++So the refresh moves no direct dependency, but it does move 142 transitive+resolutions. ADR-014's stop rule is "any pin that cannot be **reproduced**",+and M13-002 measures bun's tree against the pnpm tree; re-deduping the pnpm+tree first means measuring against a baseline nobody ever ran, built or+shipped. Rewriting the `specifier:` fields is the mechanical,+resolution-preserving half of what that install would have done.++**The three proofs that the edit is legitimate**, all verification commands of+M13-001:++```bash+# 1. the lock diff against HEAD touches specifier: lines and nothing else+git diff -U0 -- pnpm-lock.yaml | grep -E '^[-+]' | grep -vE '^(\+\+\+|---)|specifier:' # prints nothing++# 2. pnpm itself accepts the edited lock as consistent with the manifests+pnpm install --frozen-lockfile # green++# 3. the installed tree still matches what pnpm had resolved+bash tooling/gates/p13-drift.sh --assert # exit 0+```++A fourth, not required but worth knowing: on the edited lock a plain+`pnpm install --lockfile-only` reports `Already up to date` and rewrites+nothing, so the hand-edited lock is a fixpoint of pnpm's own resolver rather+than a file pnpm merely tolerates.++---++## 1. Translation table: `pnpm-workspace.yaml` → root `package.json`++Every block of the file is accounted for. Bun has no workspace file; the three+things it does read all live in the root `package.json`.++| `pnpm-workspace.yaml` block | Lines | Becomes | Notes |+|---|---|---|---|+| `packages:` (`apps/*`, `packages/**`, `tooling/*`) | 1–4 | `workspaces.packages: ["apps/*", "packages/**", "tooling/*"]` | Must resolve to the **same 20 importers**. `packages/**` is the one to check: `packages/sdks/*` are members only if bun expands `**` the way pnpm does. If it does not, write the globs out (`packages/*`, `packages/sdks/*`) rather than dropping a member. The check is `bun pm ls` against the 20 keys of `p13-lock-snapshot.json` |+| `patchedDependencies: { nuqs }` | 7–8 | **deleted** | ADR-014 decision 17. `patches/` and the lock's `patchedDependencies` hash go with it. `bun patch` exists and we deliberately do not use it |+| `allowUnusedPatches: true` | 10–17 | **deleted** | Its cause dies with the patch: it existed only because the api image installed a workspace subset in which `nuqs` was absent |+| `verifyDepsBeforeRun: false` | 19–38 | **no bun analogue — dropped** | ADR-014 *Tradeoffs*: this is a pnpm-11 behaviour toggle, not a setting to port. Its cause — `apps/start/Dockerfile` installing ~10 of its 18 importers and then `COPY packages` — **remains**. Whether bun re-resolves in that situation is an empirical question, and `tooling/gates/p13-ssr.sh` is the thing that answers it |+| `overrides:` (6 entries) | 40–72 | `overrides` in the root `package.json` | Five translate one-for-one; one cannot be expressed — see §1.1 |+| `catalog:` (10 entries) | 75–85 | `workspaces.catalog` | All ten are now exact (M13-001), so the catalog is a version map, not a range map. Importers keep writing `catalog:` |+| `allowBuilds:` (12 entries, **all `false`**) | 87–117 | **`trustedDependencies` omitted entirely** | ADR-014 amendment 2. Writing the twelve names in would *invert* the policy. See §2, which is where the real work is |++`workspaces` must therefore be the **object** form, because the array form has+nowhere to put the catalog:++```jsonc+"workspaces": {+ "packages": ["apps/*", "packages/**", "tooling/*"],+ "catalog": {+ "zod": "4.3.6",+ "react": "19.2.3",+ "@types/react": "19.2.7",+ "react-dom": "19.2.3",+ "@types/react-dom": "19.2.3",+ "@types/node": "24.10.1",+ "typescript": "5.9.3",+ "pino": "10.3.1",+ "pino-pretty": "13.1.3",+ "@hyperdx/node-opentelemetry": "0.10.3"+ }+},+"overrides": {+ "rolldown": "1.0.0-beta.43",+ "esm-env": "npm:esm-env-runtime@^0.1.0",+ "seroval": "1.3.2",+ "seroval-plugins": "1.3.2",+ "embla-carousel": "8.0.0-rc22"+}+```++### 1.1 The one row bun cannot express: `"@nuxt/vite-builder>seroval": 1.4.0`++pnpm's `parent>child` override syntax scopes an override to one parent. **Bun's+`overrides` has no such form** — an override key is a package name, full stop.+So the exemption that keeps `@nuxt/vite-builder` on `[email protected]` while the+dashboard graph stays on `1.3.2` has no direct translation.++**Recorded as moot, to be re-proven, not assumed.** In the operator's+2026-09-07 survey the Nuxt SDK built under the **global `seroval: 1.3.2` pin**,+with no per-parent exemption. That is consistent with what+`pnpm-workspace.yaml:60-64` itself says about the row: `@nuxt/vite-builder`+"only imports `serialize`, which exists in both, so 1.3.2 would very likely+work" — the exemption was written so a *future* nuxt bump needing a real 1.4+API would fail loudly in the Nuxt SDK build rather than be silently held back.++So the recipe is: **drop the row, keep the global `seroval`/`seroval-plugins`+1.3.2 pins, and let the Nuxt SDK build be the proof.** The moment+`packages/sdks/nuxt` fails to build, the row was not moot after all and — per+the stop rule — that is an unreproducible pin, not an invitation to bump nuxt.++The two seroval pins themselves are the highest-stakes rows in the whole file:+they are what stands between the dashboard and `r.createEffectfulFunction is+not a function` on every SSR route. `tooling/gates/p13-ssr.sh` exists for them.++---++## 2. Lifecycle scripts: what pnpm actually ran, and what bun would++### The evidence++**pnpm runs no dependency build script at all.** `allowBuilds` is twelve+entries and every one is `false`. Measured on this box on 2026-09-07: a+`pnpm install` on this tree printed exactly two lifecycle scripts, and both are+**workspace-own** `postinstall`s, not dependency ones:++```+apps/testbed postinstall$ node scripts/copy-op1.mjs+apps/public postinstall$ fumadocs-mdx+```++**Bun's default is not "run nothing".** Bun ships a built-in trusted list, and+it is large. Measured on this box on 2026-09-07 with `bun pm default-trusted`+(Bun 1.4.0): **367 packages**, of which **8 of the 12 `allowBuilds: false`+entries are on it** —++| on bun's default-trusted list | not on it |+|---|---|+| `@prisma/client`, `@prisma/engines`, `prisma`, `esbuild`, `msgpackr-extract`, `sharp`, `simple-git-hooks`, `workerd` | `@biomejs/biome`, `@parcel/watcher`, `@tailwindcss/oxide`, `protobufjs` |++A bare `bun install` therefore runs install scripts for eight packages whose+scripts have **never run** in any image this repo has ever shipped. That is+precisely the inversion ADR-014 amendment 2 forbids, and the repo already has+the scar: flipping `allowBuilds` to `true` during the pnpm 11 bump made+`sharp`'s install script attempt a node-gyp compile under+`npm_config_build_from_source=true` and broke the dashboard build+(`pnpm-workspace.yaml:98-103`, reverted in `4e715348`).++**And one of the eight fails outright.** In the operator's 2026-09-07 survey,+`simple-git-hooks`'s `postinstall` — which assumes a hoisted layout and walks+up to find `.git` — crashed under `bun install --linker=isolated`, the layout+ADR-014 amendment 1 makes the default attempt.++### The policy M13-002 uses++**`--ignore-scripts` on every install command**, not a `trustedDependencies`+array.++- It reproduces pnpm's *actual behaviour* (nothing ran) rather than a+ hand-maintained approximation of it.+- `trustedDependencies` is an allow-list layered on top of a 367-entry default;+ omitting it does **not** get you "nothing", it gets you those 367. The only+ formulation whose meaning does not depend on what a future bun release adds+ to its default list is the flag.+- It is one word per install command, greppable, and identical in the+ Dockerfiles, in CI and on a laptop — which is what makes "did a script run?"+ answerable from the command line rather than from a list.+- ADR-014 amendment 2 already says the field is omitted entirely. This is the+ same ruling stated as a positive: omit the field **and** pass the flag.++**The two workspace-own `postinstall`s must still run**, because they are build+steps the tree depends on (`apps/public`'s `fumadocs-mdx` generates the MDX+index; `apps/testbed`'s copies `op1.js` into `public/`). `--ignore-scripts`+suppresses them too, so every install site gains an explicit follow-up:++```bash+bun install --linker=isolated --frozen-lockfile --ignore-scripts+bun run --filter public postinstall+bun run --filter testbed postinstall+```++Naming them is a feature: it makes the set of scripts this repo runs a list in+one file rather than a property of a resolver's defaults.++---++## 3. Every `package.json` script that shells out to `pnpm`++Measured 2026-09-07: **25 scripts across 5 manifests** — root, `apps/api`,+`apps/start`, `packages/core`, `packages/db`. Verified on Bun 1.4.0 on this+box: `bun run <script> <args…>` forwards trailing arguments to the script body+exactly as `pnpm <script> <args…>` does, so every `pnpm with-env X` becomes+`bun run with-env X` with no change to `with-env` itself; and `bun run` takes+`-F, --filter=<pattern>` — "Run a script in all workspace packages matching the+pattern" — which is what replaces `pnpm -r --filter`.++### `package.json` (root)++| script | today | bun |+|---|---|---|+| `test` | `pnpm --filter @openpanel/core run test && pnpm --filter @openpanel/db run test && pnpm --filter @openpanel/api run test && pnpm --filter start run test && vitest run` | `bun run --filter @openpanel/core test && bun run --filter @openpanel/db test && bun run --filter @openpanel/api test && bun run --filter start test && vitest run` |+| `gen:bots` | `pnpm -r --filter core gen:bots` | `bun run --filter core gen:bots` |+| `gen:referrers` | `pnpm -r --filter core gen:referrers` | `bun run --filter core gen:referrers` |+| `db:codegen` | `pnpm -r --filter db run codegen` | `bun run --filter db codegen` |+| `codegen` | `pnpm -r --filter db --filter core run codegen` | `bun run --filter db codegen && bun run --filter core codegen` — bun takes one `--filter` pattern per run; keep the **db-then-core order**, core's codegen reads db's generated client |+| `migrate` | `pnpm -r --filter db run migrate` | `bun run --filter db migrate` |+| `migrate:deploy` | `pnpm -r --filter db run migrate:deploy` | `bun run --filter db migrate:deploy` |+| `dev` | `pnpm --filter api run testing & pnpm --filter start run dev & wait` | `bun run --filter api testing & bun run --filter start dev & wait` |+| `dev:public` | `pnpm -r --filter public dev` | `bun run --filter public dev` |+| `typecheck` | `pnpm -r --no-bail typecheck` | `bun run --filter '*' typecheck` — **behaviour gap:** `--no-bail` makes pnpm typecheck every workspace and report all failures. Bun has no `--no-bail`. If it stops at the first failure, the script must keep going by construction (a loop over the workspace list, collecting exit codes) or the gate silently narrows to "the first package that fails" |+| `check:workspace` | `pnpm dlx sherif@latest` | `bunx sherif@<pinned>` — pin it while touching it (ADR-014 benchmark item 13; it is unpinned today) |+| `check:deps` | `NODE_PATH=$PWD/node_modules pnpm dlx --package [email protected] depcruise …` | `NODE_PATH=$PWD/node_modules bunx --package [email protected] depcruise …` |+| `check` | `ultracite check && pnpm run check:deps` | `ultracite check && bun run check:deps` |++### `apps/api/package.json`++| script | today | bun |+|---|---|---|+| `testing` | `API_PORT=3333 pnpm dev` | `API_PORT=3333 bun run dev` |++### `apps/start/package.json`++| script | today | bun |+|---|---|---|+| `dev` | `pnpm with-env vite dev --port 3000` | `bun run with-env vite dev --port 3000` |+| `build` | `pnpm with-env vite build` | `bun run with-env vite build` |+| `start_deprecated` | `pnpm with-env node .output/server/index.mjs` | `bun run with-env node .output/server/index.mjs` |+| `deploy` | `pnpm build && npx wrangler deploy` | `bun run build && bunx wrangler deploy` |++`apps/start`'s `build` is the one the SSR gate drives, so it is the one that+must be right first.++### `packages/core/package.json`++| script | today | bun |+|---|---|---|+| `migrate:deploy:code` | `pnpm with-env jiti ./src/code-migrations/migrate.ts` | `bun run with-env bun ./src/code-migrations/migrate.ts` — ADR-019 row 7b already replaces `jiti` with bun as the TS runner |++### `packages/db/package.json`++| script | today | bun |+|---|---|---|+| `codegen` | `pnpm with-env prisma generate && jiti prisma/prisma-json-types.ts` | `bun run with-env prisma generate && bun prisma/prisma-json-types.ts` |+| `migrate` | `pnpm with-env prisma migrate dev` | `bun run with-env prisma migrate dev` |+| `migrate:deploy:db` | `pnpm with-env prisma migrate deploy` | `bun run with-env prisma migrate deploy` |+| `migrate:deploy:code` | `pnpm --filter @openpanel/core run migrate:deploy:code` | `bun run --filter @openpanel/core migrate:deploy:code` |+| `migrate:deploy` | `pnpm migrate:deploy:db && pnpm migrate:deploy:code` | `bun run migrate:deploy:db && bun run migrate:deploy:code` |+| `duplicate-events` | `pnpm with-env jiti ./scripts/find-duplicate-events.ts` | `bun run with-env bun ./scripts/find-duplicate-events.ts` |++**Out of this file's scope but in the same release** (ADR-014 *Migration+impact*): the shipped self-hosting templates —+`self-hosting/docker-compose.template.yml`, `self-hosting/coolify.yml` and+`.github/smoke/docker-compose.yml` — invoke `pnpm` **inside the api image** at+container start. They must change in the same release as the image, or+self-hosters' containers fail at boot.++---++## 4. The SSR gate procedure++`tooling/gates/p13-ssr.sh`. It is **green under pnpm today** — that is the+baseline the swap is measured against — and M13-002 runs it **unchanged**. The+only installer-specific thing in it is which binary runs the workspace's own+`build` script, detected the way `verification/full.sh` detects it: a committed+`bun.lock` means bun installed the tree.++```bash+bash tooling/gates/p13-ssr.sh+```++What it does, in `apps/start/Dockerfile`'s order:++1. **Builds** `apps/start` with `NITRO=1 SELF_HOSTED=1` through the package's+ own `build` script (which goes through `with-env`, i.e. the repo `.env`).+2. **Reproduces the runner stage's `esm-env` shim** and its+ `BROWSER=false / NODE=true / DEV=false` assertion. The standalone Nitro+ output ships `esm-env-runtime` under the `esm-env` override, so `esm-env`+ has to be made resolvable inside the SSR bundle; without it,+ `@number-flow/react` is a hard `ERR_MODULE_NOT_FOUND` at first render. This+ is the `overrides` row whose failure mode is invisible until a page renders.+3. **Boots `apps/api` (`ROLE=api`) and then `.output/server/index.mjs`**, each+ on a free port, with the `app_env` block from+ `.github/smoke/docker-compose.yml` pointed at this box's already-running+ services and at the api it just started. Databases are the **isolated+ `openpanel_test` Postgres and ClickHouse**, never the prod-copy `openpanel`+ ones; both asserted routes read no analytics, so the cost is one session+ lookup.+4. **Asserts exactly what `.github/smoke/smoke.sh`'s `assert_ssr_route`+ asserts** — HTTP 200, an `<html` in the body, at least 1000 bytes — for+ **`/login`** and **`/onboarding`**.+5. **Greps the dashboard log** for+ `is not a function|Cannot find (module|package)|ERR_MODULE_NOT_FOUND|ERR_PACKAGE_PATH_NOT_EXPORTED`+ and fails on any hit — `assert_no_server_errors`, so an SSR failure+ swallowed into a 200 still shows up.++It always kills the two servers it started, on success, on failure and on an+interrupt. Logs land in `/tmp/openpanel-p13-ssr/` (`P13_SSR_RUN_DIR` to move+them).++**Why `/onboarding` is the second route.** ADR-014's gate wants "`/login` plus+one dashboard route", and every route past `/login` needs a session the smoke+stack has never seeded. `/onboarding` is the create-an-account page and renders+**without** a session by construction: its `beforeLoad` redirects only when a+session *exists*, and its loader is a no-op unless an `inviteId` search param is+present, so an anonymous request needs no seeded row. It also sits under the+`_public` layout rather than `/login`'s `_login` one, so the two assertions+cover two different server-rendered subtrees instead of the same layout twice.++**Run it with `tooling/gates/p13-drift.sh --assert`**, not instead of it. The+drift gate answers "did anything move?" and the SSR gate answers "does it still+work?" — main-8e60 was green on the second question's cheaper cousin (the+build) and red on the real one.++---++## Known drift hazards++**The installer swap is not an upgrade.** Everything in this section is what+happens when it is allowed to become one.++### What a bare `bun install` did to this tree++Operator survey, throwaway worktree, 2026-09-07 — **before** M13-001 pinned the+manifests, i.e. against the carets that were there:++| Workspace | direct deps | re-resolved to a **newer** version |+|---|---:|---:|+| `apps/start` | 165 | **86** |+| `packages/core` | 67 | **27** |+| `apps/public` | 43 | **9** |++Named examples: `prisma` 6.14 → **6.19**, `@clickhouse/client` 1.18 → **1.23**,+`nuqs` 2.5.2 → **2.10.1**. (The per-workspace direct-dependency counts are this+task's own measurement, from `tooling/gates/p13-lock-snapshot.json`.)++Two things then broke, both downstream of that re-resolve, neither of them in+the installer:++- **`apps/api` failed to boot**: `Export named 'Unsafe' not found` from+ `@sinclair/[email protected]` — a transitive of the Elysia stack that a+ different resolution paired with a copy expecting a different export surface.+- **`apps/public` failed to build**: `activeAnimations` missing from+ `motion-dom`, and `renderTranslation` missing from `fumadocs-core/i18n` — the+ same shape of failure, twice, in a workspace that is not even part of the+ backend rewrite.++Note what these have in common with the seroval incident+(`pnpm-workspace.yaml:19-37`): a resolver picked a *newer, in-range* version of+a package nobody edited, and the failure surfaced somewhere that looks like+application code. `prisma` 6.14 → 6.19 also crosses ADR-017 row 3+(**REFUSED** — 6.14.0 already carries both preview features) and ADR-012, which+pins `@prisma/adapter-pg` to `6.14.0` *because it matches the client exactly*.+A silent 6.19 breaks a decision, not just a build.++### The rule that follows++> **Drift is fixed by exact pins and `overrides` that cite the breakage — never+> by editing code to fit a newer dependency.**++Concretely, when M13-002 hits a version that moved:++1. **Pin it back**, using `tooling/gates/p13-lock-snapshot.json` as the source+ of truth for what it was. `tooling/gates/p13-drift.sh --assert` is the check.+2. If a **transitive** moved, add an `overrides` entry and **write the+ breakage into a comment next to it**, the way every row in+ `pnpm-workspace.yaml` does today. An override with no recorded symptom is+ the next person's mystery.+3. If neither works, **stop.** ADR-014's stop rule is not a last resort to be+ argued around — it is the decision. The repo stays on pnpm and the backend+ rewrite loses nothing, because Bun has run a pnpm-built `node_modules` since+ P3.++What is **never** the fix:++- changing application source so it compiles against a newer dependency (that+ is the upgrade the swap is not allowed to be, and it makes the swap+ unrevertible);+- bumping a declared range to "whatever bun picked" (ADR-017 rule 3: the+ lockfile swap must not carry a declared-range change in the same commit);+- relaxing a gate. `--linker=hoisted` instead of `isolated` is allowed *only*+ with a recorded reason and a re-run of the full gate (ADR-014 amendment 1),+ because a hoisted layout resolves phantom dependencies by accident and turns+ an install-time failure into a container-time one.++### Two smaller hazards worth naming++- **Workspace-vs-registry linking.** `apps/start` depends on+ `@openpanel/[email protected]` **from npm** while `packages/sdks/web` is+ `1.4.1-local`; `apps/public` likewise takes `@openpanel/[email protected]` from+ npm. If bun's workspace-linking default differs from pnpm's, the dashboard+ silently starts running a different copy of its own tracking SDK. Both are in+ the snapshot at their registry versions, so `p13-drift.sh` sees the flip.+- **`bun install` re-resolving inside a Docker build stage.** This is the+ main-8e60 mechanism in a new costume: `apps/start/Dockerfile` installs a+ subset, then `COPY packages`, then builds. `--frozen-lockfile` on every+ install command is what makes that re-resolve an error instead of a silent+ rewrite — and it is the successor to `verifyDepsBeforeRun: false`, which has+ no bun analogue.diff --git a/package.json b/package.jsonindex cab4cabe6..f82418e36 100644--- a/package.json+++ b/package.json@@ -32,15 +32,15 @@},"dependencies": {"@hyperdx/node-opentelemetry": "catalog:",- "dotenv-cli": "^7.3.0",- "semver": "^7.5.4",+ "dotenv-cli": "7.3.0",+ "semver": "7.6.0","typescript": "catalog:"},"devDependencies": {"@biomejs/biome": "2.3.15",- "depcheck": "^1.4.7",- "simple-git-hooks": "^2.12.1",+ "depcheck": "1.4.7",+ "simple-git-hooks": "2.12.1","ultracite": "7.2.0",- "vitest": "^3.0.4"+ "vitest": "3.1.3"}}diff --git a/packages/core/package.json b/packages/core/package.jsonindex 5406436ce..26a32e980 100644--- a/packages/core/package.json+++ b/packages/core/package.json@@ -19,74 +19,74 @@"with-env": "dotenv -e ../../.env -c --"},"dependencies": {- "@aws-sdk/client-s3": "^3.974.0",- "@aws-sdk/client-sts": "^3.974.0",- "@babel/parser": "^7.26.0",- "@better-agent/core": "^0.1.0-beta.3",- "@better-agent/providers": "^0.1.0-beta.3",+ "@aws-sdk/client-s3": "3.984.0",+ "@aws-sdk/client-sts": "3.1117.0",+ "@babel/parser": "7.29.7",+ "@better-agent/core": "0.1.0-beta.3",+ "@better-agent/providers": "0.1.0-beta.3","@bull-board/api": "9.6.0","@bull-board/elysia": "9.6.0","@elysiajs/cors": "1.4.2","@elysiajs/openapi": "1.4.15",- "@google-cloud/storage": "^7.18.0",+ "@google-cloud/storage": "7.22.0","@hyperdx/node-opentelemetry": "catalog:",- "@maxmind/geoip2-node": "^6.1.0",- "@modelcontextprotocol/sdk": "^1.12.0",- "@node-rs/argon2": "^2.0.2",+ "@maxmind/geoip2-node": "6.1.0",+ "@modelcontextprotocol/sdk": "1.27.1",+ "@node-rs/argon2": "2.0.2","@openpanel/db": "workspace:*","@openpanel/email": "workspace:*","@openpanel/payments": "workspace:*","@openpanel/redis": "workspace:*",- "@oslojs/crypto": "^1.0.1",- "@oslojs/encoding": "^1.1.0",- "@oslojs/otp": "^1.1.0",- "@slack/bolt": "^3.18.0",- "@slack/oauth": "^3.0.0",- "@trpc/server": "^11.17.0",- "arctic": "^2.3.0",+ "@oslojs/crypto": "1.0.1",+ "@oslojs/encoding": "1.1.0",+ "@oslojs/otp": "1.1.0",+ "@slack/bolt": "3.21.4",+ "@slack/oauth": "3.0.1",+ "@trpc/server": "11.17.0",+ "arctic": "2.3.0","bullmq": "6.3.3",- "cheerio": "^1.0.0",- "csv-parse": "^6.1.0",- "date-fns": "^3.3.1",+ "cheerio": "1.1.2",+ "csv-parse": "6.1.0",+ "date-fns": "3.3.1","elysia": "1.4.30",- "fast-deep-equal": "^3.1.3",- "fast-json-stable-hash": "^1.0.3",- "ipaddr.js": "^2.5.0",- "jiti": "^2.4.1",- "js-yaml": "^4.1.0",- "kafkajs": "^2.2.4",- "lru-cache": "^11.2.4",- "luxon": "^3.7.2",- "mathjs": "^12.3.2",- "nanoid": "^5.1.6",+ "fast-deep-equal": "3.1.3",+ "fast-json-stable-hash": "1.0.3",+ "ipaddr.js": "2.5.0",+ "jiti": "2.6.1",+ "js-yaml": "4.1.1",+ "kafkajs": "2.2.4",+ "lru-cache": "11.5.1",+ "luxon": "3.7.2",+ "mathjs": "12.3.2",+ "nanoid": "5.1.6","pino": "catalog:","pino-pretty": "catalog:",- "prisma-error-enum": "^0.1.3",- "prom-client": "^15.1.3",- "qrcode": "^1.5.4",- "ramda": "^0.29.1",- "sharp": "^0.33.5",- "short-unique-id": "^5.0.3",- "slugify": "^1.6.6",- "superjson": "^1.13.3",- "ua-parser-js": "^2.0.6",- "undici": "^8.10.0",- "unzipper": "^0.12.3",- "url-metadata": "^5.4.1",- "uuid": "^9.0.1",+ "prisma-error-enum": "0.1.3",+ "prom-client": "15.1.3",+ "qrcode": "1.5.4",+ "ramda": "0.29.1",+ "sharp": "0.33.5",+ "short-unique-id": "5.0.3",+ "slugify": "1.6.9",+ "superjson": "1.13.3",+ "ua-parser-js": "2.0.6",+ "undici": "8.10.0",+ "unzipper": "0.12.5",+ "url-metadata": "5.4.1",+ "uuid": "9.0.1","zod": "catalog:"},"devDependencies": {- "@clickhouse/client": "^1.18.5",+ "@clickhouse/client": "1.18.5","@openpanel/tsconfig": "workspace:*",- "@types/js-yaml": "^4.0.9",- "@types/luxon": "^3.7.1",- "@types/qrcode": "^1.5.6",- "@types/ramda": "^0.31.1",- "@types/unzipper": "^0.10.10",- "@types/uuid": "^10.0.0",+ "@types/js-yaml": "4.0.9",+ "@types/luxon": "3.7.1",+ "@types/qrcode": "1.5.6",+ "@types/ramda": "0.31.1",+ "@types/unzipper": "0.10.11",+ "@types/uuid": "10.0.0","bun-types": "1.4.0",- "tar": "^7.4.3",+ "tar": "7.4.3","typescript": "catalog:"}}diff --git a/packages/db/package.json b/packages/db/package.jsonindex 654678339..e3a211a24 100644--- a/packages/db/package.json+++ b/packages/db/package.json@@ -15,23 +15,23 @@"with-env": "dotenv -e ../../.env -c --"},"dependencies": {- "@clickhouse/client": "^1.18.5",+ "@clickhouse/client": "1.18.5","@hyperdx/node-opentelemetry": "catalog:","@openpanel/core": "workspace:*","@openpanel/payments": "workspace:*","@openpanel/redis": "workspace:*",- "@prisma/client": "^6.14.0",- "jiti": "^2.4.1",+ "@prisma/client": "6.14.0",+ "jiti": "2.4.1","pino": "catalog:","pino-pretty": "catalog:",- "prisma-json-types-generator": "^3.1.1",+ "prisma-json-types-generator": "3.1.1","zod": "catalog:"},"devDependencies": {"@openpanel/tsconfig": "workspace:*","@types/node": "catalog:","bun-types": "1.4.0",- "prisma": "^6.14.0",+ "prisma": "6.14.0","typescript": "catalog:"}}diff --git a/packages/email/package.json b/packages/email/package.jsonindex 5f9fa8b55..8519ddd55 100644--- a/packages/email/package.json+++ b/packages/email/package.json@@ -9,14 +9,14 @@},"dependencies": {"@openpanel/db": "workspace:*",- "@react-email/components": "^0.5.6",- "@react-email/render": "^2.0.7",- "@types/nodemailer": "^8.0.0",- "nodemailer": "^8.0.5",+ "@react-email/components": "0.5.6",+ "@react-email/render": "2.0.7",+ "@types/nodemailer": "8.0.0",+ "nodemailer": "8.0.5","react": "catalog:","react-dom": "catalog:",- "resend": "^4.0.1",- "responsive-react-email": "^0.0.5",+ "resend": "4.0.1",+ "responsive-react-email": "0.0.5","zod": "catalog:"},"devDependencies": {diff --git a/packages/payments/package.json b/packages/payments/package.jsonindex 1d6dd0655..4832c0586 100644--- a/packages/payments/package.json+++ b/packages/payments/package.json@@ -13,18 +13,18 @@"typecheck": "tsc --noEmit"},"dependencies": {- "@polar-sh/sdk": "^0.49.0",- "date-fns": "^3.3.1"+ "@polar-sh/sdk": "0.49.0",+ "date-fns": "3.3.1"},"devDependencies": {"@openpanel/db": "workspace:*","@openpanel/tsconfig": "workspace:*",- "@types/inquirer": "^9.0.7",- "@types/inquirer-autocomplete-prompt": "^3.0.3",+ "@types/inquirer": "9.0.7",+ "@types/inquirer-autocomplete-prompt": "3.0.3","@types/node": "catalog:","@types/react": "catalog:",- "inquirer": "^9.3.5",- "inquirer-autocomplete-prompt": "^3.0.1",+ "inquirer": "9.3.6",+ "inquirer-autocomplete-prompt": "3.0.1","typescript": "catalog:"}}\ No newline at end of filediff --git a/packages/redis/package.json b/packages/redis/package.jsonindex 96ab50752..efa0ceb41 100644--- a/packages/redis/package.json+++ b/packages/redis/package.json@@ -8,8 +8,8 @@},"dependencies": {"ioredis": "5.8.2",- "lru-cache": "^11.2.2",- "superjson": "^1.13.3"+ "lru-cache": "11.2.2",+ "superjson": "1.13.3"},"devDependencies": {"@openpanel/core": "workspace:*",diff --git a/packages/sdks/astro/package.json b/packages/sdks/astro/package.jsonindex edd4cd77a..916a2069e 100644--- a/packages/sdks/astro/package.json+++ b/packages/sdks/astro/package.json@@ -24,7 +24,7 @@"@openpanel/web": "workspace:1.4.1-local"},"devDependencies": {- "astro": "^6.4.2"+ "astro": "6.4.2"},"peerDependencies": {"astro": "^4.0.0 || ^5.0.0 || ^6.0.0"diff --git a/packages/sdks/express/package.json b/packages/sdks/express/package.jsonindex 0f9e394ae..61aa4b380 100644--- a/packages/sdks/express/package.json+++ b/packages/sdks/express/package.json@@ -18,9 +18,9 @@},"devDependencies": {"@openpanel/tsconfig": "workspace:*",- "@types/express": "^5.0.3",- "@types/request-ip": "^0.0.41",- "tsup": "^7.2.0",+ "@types/express": "5.0.3",+ "@types/request-ip": "0.0.41",+ "tsup": "7.3.0","typescript": "catalog:"}}diff --git a/packages/sdks/nextjs/package.json b/packages/sdks/nextjs/package.jsonindex 6c158005a..c7caec078 100644--- a/packages/sdks/nextjs/package.json+++ b/packages/sdks/nextjs/package.json@@ -21,7 +21,7 @@"devDependencies": {"@openpanel/tsconfig": "workspace:*","@types/react": "catalog:",- "tsup": "^7.2.0",+ "tsup": "7.3.0","typescript": "catalog:"}}diff --git a/packages/sdks/nuxt/package.json b/packages/sdks/nuxt/package.jsonindex e2a83193e..dadb7f026 100644--- a/packages/sdks/nuxt/package.json+++ b/packages/sdks/nuxt/package.json@@ -32,13 +32,13 @@"nuxt": "^3.0.0 || ^4.0.0"},"devDependencies": {- "@nuxt/kit": "^3.0.0",- "@nuxt/module-builder": "^1.0.2",- "@nuxt/types": "^2.18.1",+ "@nuxt/kit": "3.20.2",+ "@nuxt/module-builder": "1.0.2",+ "@nuxt/types": "2.18.1","@openpanel/tsconfig": "workspace:*","@types/node": "catalog:",- "@vue/runtime-core": "^3.5.25",+ "@vue/runtime-core": "3.5.25","typescript": "catalog:",- "unbuild": "^3.6.1"+ "unbuild": "3.6.1"}}diff --git a/packages/sdks/react-native/package.json b/packages/sdks/react-native/package.jsonindex fcca7fa79..585c1ffc2 100644--- a/packages/sdks/react-native/package.json+++ b/packages/sdks/react-native/package.json@@ -16,7 +16,7 @@"devDependencies": {"@openpanel/tsconfig": "workspace:*","@types/node": "catalog:",- "tsup": "^7.2.0",+ "tsup": "7.3.0","typescript": "catalog:"},"peerDependencies": {diff --git a/packages/sdks/sdk/package.json b/packages/sdks/sdk/package.jsonindex 24efbe354..75aed2cac 100644--- a/packages/sdks/sdk/package.json+++ b/packages/sdks/sdk/package.json@@ -14,7 +14,7 @@"devDependencies": {"@openpanel/tsconfig": "workspace:*","@types/node": "catalog:",- "tsup": "^7.2.0",+ "tsup": "7.3.0","typescript": "catalog:"}}diff --git a/packages/sdks/web/package.json b/packages/sdks/web/package.jsonindex ae2ac5c0b..cbb1977eb 100644--- a/packages/sdks/web/package.json+++ b/packages/sdks/web/package.json@@ -18,7 +18,7 @@"devDependencies": {"@openpanel/tsconfig": "workspace:*","@types/node": "catalog:",- "tsup": "^7.2.0",+ "tsup": "7.3.0","typescript": "catalog:"}}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex bd1fcafba..f8ddc61fc 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -7,34 +7,34 @@ settings:catalogs:default:'@hyperdx/node-opentelemetry':- specifier: ^0.10.3+ specifier: 0.10.3version: 0.10.3'@types/node':- specifier: ^24.7.1+ specifier: 24.10.1version: 24.10.1'@types/react':- specifier: ^19.2.3+ specifier: 19.2.7version: 19.2.7'@types/react-dom':- specifier: ^19.2.3+ specifier: 19.2.3version: 19.2.3pino:- specifier: ^10.3.1+ specifier: 10.3.1version: 10.3.1pino-pretty:- specifier: ^13.1.3+ specifier: 13.1.3version: 13.1.3react:- specifier: ^19.2.3+ specifier: 19.2.3version: 19.2.3react-dom:- specifier: ^19.2.3+ specifier: 19.2.3version: 19.2.3typescript:- specifier: ^5.9.3+ specifier: 5.9.3version: 5.9.3zod:- specifier: ^4.1.8+ specifier: 4.3.6version: 4.3.6overrides:@@ -56,10 +56,10 @@ importers:specifier: 'catalog:'version: 0.10.3([email protected])dotenv-cli:- specifier: ^7.3.0+ specifier: 7.3.0version: 7.3.0semver:- specifier: ^7.5.4+ specifier: 7.6.0version: 7.6.0typescript:specifier: 'catalog:'@@ -69,16 +69,16 @@ importers:specifier: 2.3.15version: 2.3.15depcheck:- specifier: ^1.4.7+ specifier: 1.4.7version: 1.4.7([email protected])simple-git-hooks:- specifier: ^2.12.1+ specifier: 2.12.1version: 2.12.1ultracite:specifier: 7.2.0version: 7.2.0vitest:- specifier: ^3.0.4+ specifier: 3.1.3version: 3.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])apps/api:@@ -102,20 +102,20 @@ importers:specifier: 'catalog:'version: 13.1.3uuid:- specifier: ^9.0.1+ specifier: 9.0.1version: 9.0.1zod:specifier: 'catalog:'version: 4.3.6devDependencies:'@faker-js/faker':- specifier: ^9.0.1+ specifier: 9.0.1version: 9.0.1'@openpanel/tsconfig':specifier: workspace:*version: link:../../tooling/typescript'@types/uuid':- specifier: ^10.0.0+ specifier: 10.0.0version: 10.0.0bun-types:specifier: 1.4.0@@ -127,16 +127,16 @@ importers:apps/public:dependencies:'@nivo/funnel':- specifier: ^0.99.0+ specifier: 0.99.0'@number-flow/react':specifier: 0.5.10'@opennextjs/cloudflare':- specifier: ^1.17.1+ specifier: 1.17.1version: 1.17.1([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])'@openpanel/nextjs':- specifier: ^1.2.0+ specifier: 1.2.0version: 1.2.0([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])'@openpanel/payments':specifier: workspace:^@@ -160,7 +160,7 @@ importers:specifier: 1.2.8version: 1.2.8(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])cheerio:- specifier: ^1.0.0+ specifier: 1.1.2version: 1.1.2class-variance-authority:specifier: 0.7.1@@ -181,7 +181,7 @@ importers:specifier: 14.2.11version: 14.2.11(@types/[email protected])(@types/[email protected])(@types/[email protected])([email protected](@mdx-js/[email protected]([email protected]))(@tanstack/[email protected]([email protected]([email protected]))([email protected]))(@types/[email protected])(@types/[email protected])(@types/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))fumadocs-openapi:- specifier: ^10.6.7+ specifier: 10.6.7version: 10.6.7(763e641a8a256664c00b8169e2df1082)fumadocs-ui:specifier: 16.7.11@@ -190,13 +190,13 @@ importers:specifier: 1.5.1version: 1.5.1([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])([email protected]([email protected]))([email protected]))lucide-react:- specifier: ^0.555.0+ specifier: 0.555.0version: 0.555.0([email protected])next:specifier: 16.0.7version: 16.0.7(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])([email protected]([email protected]))([email protected])next-themes:- specifier: ^0.4.6+ specifier: 0.4.6react:specifier: 'catalog:'@@ -205,16 +205,16 @@ importers:specifier: 'catalog:'version: 19.2.3([email protected])react-markdown:- specifier: ^10.1.0+ specifier: 10.1.0recharts:- specifier: ^2.15.0+ specifier: 2.15.4rehype-external-links:specifier: 3.0.0version: 3.0.0shiki:- specifier: ^4.0.2+ specifier: 4.0.2version: 4.0.2tailwind-merge:specifier: 3.4.0@@ -227,10 +227,10 @@ importers:version: 4.3.6devDependencies:'@tailwindcss/postcss':- specifier: ^4.1.17+ specifier: 4.1.17version: 4.1.17'@types/mdx':- specifier: ^2.0.13+ specifier: 2.0.13version: 2.0.13'@types/node':specifier: 'catalog:'@@ -242,10 +242,10 @@ importers:specifier: 'catalog:'version: 19.2.3(@types/[email protected])autoprefixer:- specifier: ^10.4.22+ specifier: 10.4.22version: 10.4.22([email protected])postcss:- specifier: ^8.5.6+ specifier: 8.5.6version: 8.5.6tailwindcss:specifier: 4.1.17@@ -254,49 +254,49 @@ importers:specifier: 'catalog:'version: 5.9.3wrangler:- specifier: ^4.65.0+ specifier: 4.65.0version: 4.65.0apps/start:dependencies:'@better-agent/client':- specifier: ^0.1.0-beta.3+ specifier: 0.1.0-beta.3'@codemirror/commands':- specifier: ^6.7.0+ specifier: 6.10.1version: 6.10.1'@codemirror/lang-javascript':- specifier: ^6.2.0+ specifier: 6.2.4version: 6.2.4'@codemirror/lang-json':- specifier: ^6.0.1+ specifier: 6.0.2version: 6.0.2'@codemirror/state':- specifier: ^6.4.0+ specifier: 6.5.4version: 6.5.4'@codemirror/theme-one-dark':- specifier: ^6.1.3+ specifier: 6.1.3version: 6.1.3'@codemirror/view':- specifier: ^6.35.0+ specifier: 6.39.11version: 6.39.11'@dnd-kit/core':- specifier: ^6.3.1+ specifier: 6.3.1'@dnd-kit/sortable':- specifier: ^10.0.0+ specifier: 10.0.0version: 10.0.0(@dnd-kit/[email protected]([email protected]([email protected]))([email protected]))([email protected])'@dnd-kit/utilities':- specifier: ^3.2.2+ specifier: 3.2.2version: 3.2.2([email protected])'@faker-js/faker':- specifier: ^9.6.0+ specifier: 9.9.0version: 9.9.0'@hookform/resolvers':- specifier: ^5.2.2+ specifier: 5.2.2version: 5.2.2([email protected]([email protected]))'@nivo/sankey':- specifier: ^0.99.0+ specifier: 0.99.0'@number-flow/react':specifier: 0.5.10@@ -311,148 +311,148 @@ importers:specifier: workspace:^version: link:../../packages/sdks/_info'@openpanel/web':- specifier: ^1.0.1+ specifier: 1.0.5version: 1.0.5'@radix-ui/react-accordion':- specifier: ^1.2.12+ specifier: 1.2.12version: 1.2.12(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-alert-dialog':- specifier: ^1.1.15+ specifier: 1.1.15version: 1.1.15(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-aspect-ratio':- specifier: ^1.1.7+ specifier: 1.1.7version: 1.1.7(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-avatar':- specifier: ^1.1.10+ specifier: 1.1.10version: 1.1.10(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-checkbox':- specifier: ^1.3.3+ specifier: 1.3.3version: 1.3.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-dialog':- specifier: ^1.1.15+ specifier: 1.1.15version: 1.1.15(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-dropdown-menu':- specifier: ^2.1.16+ specifier: 2.1.16version: 2.1.16(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-label':- specifier: ^2.1.7+ specifier: 2.1.7version: 2.1.7(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-popover':- specifier: ^1.1.15+ specifier: 1.1.15version: 1.1.15(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-portal':- specifier: ^1.1.9+ specifier: 1.1.9version: 1.1.9(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-progress':- specifier: ^1.1.7+ specifier: 1.1.7version: 1.1.7(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-radio-group':- specifier: ^1.3.8+ specifier: 1.3.8version: 1.3.8(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-scroll-area':- specifier: ^1.2.10+ specifier: 1.2.10version: 1.2.10(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-select':- specifier: ^2.2.6+ specifier: 2.2.6version: 2.2.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-separator':- specifier: ^1.1.7+ specifier: 1.1.7version: 1.1.7(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-slider':specifier: 1.2.3version: 1.2.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-slot':- specifier: ^1.2.3+ specifier: 1.2.3version: 1.2.3(@types/[email protected])([email protected])'@radix-ui/react-switch':- specifier: ^1.2.6+ specifier: 1.2.6version: 1.2.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-tabs':- specifier: ^1.1.13+ specifier: 1.1.13version: 1.1.13(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-toast':- specifier: ^1.2.15+ specifier: 1.2.15version: 1.2.15(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-toggle':- specifier: ^1.1.10+ specifier: 1.1.10version: 1.1.10(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-toggle-group':- specifier: ^1.1.11+ specifier: 1.1.11version: 1.1.11(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@radix-ui/react-tooltip':- specifier: ^1.2.8+ specifier: 1.2.8version: 1.2.8(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@reduxjs/toolkit':- specifier: ^2.8.2+ specifier: 2.8.2version: 2.8.2([email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected](@babel/[email protected]([email protected]))(@babel/[email protected](@babel/[email protected]([email protected]))([email protected]))([email protected])([email protected]))([email protected])([email protected]))([email protected])'@sentry/tanstackstart-react':- specifier: ^9.12.0+ specifier: 9.46.0version: 9.46.0([email protected])([email protected])'@tailwindcss/container-queries':- specifier: ^0.1.1+ specifier: 0.1.1version: 0.1.1([email protected])'@tailwindcss/typography':- specifier: ^0.5.15+ specifier: 0.5.15version: 0.5.15([email protected])'@tailwindcss/vite':- specifier: ^4.0.6+ specifier: 4.1.12version: 4.1.12([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))'@tanstack/match-sorter-utils':- specifier: ^8.19.4+ specifier: 8.19.4version: 8.19.4'@tanstack/nitro-v2-vite-plugin':- specifier: ^1.133.19+ specifier: 1.133.19version: 1.133.19([email protected])([email protected](@emnapi/[email protected])(@emnapi/[email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))'@tanstack/react-devtools':- specifier: ^0.7.6+ specifier: 0.7.6version: 0.7.6(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])'@tanstack/react-query':- specifier: ^5.90.2+ specifier: 5.90.2version: 5.90.2([email protected])'@tanstack/react-query-devtools':- specifier: ^5.90.2+ specifier: 5.90.2'@tanstack/react-router':- specifier: ^1.132.47+ specifier: 1.132.47'@tanstack/react-router-devtools':- specifier: ^1.132.51+ specifier: 1.132.51version: 1.132.51(@tanstack/[email protected]([email protected]([email protected]))([email protected]))(@tanstack/[email protected])(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])'@tanstack/react-router-ssr-query':- specifier: ^1.132.47+ specifier: 1.132.47version: 1.132.47(@tanstack/[email protected])(@tanstack/[email protected]([email protected]))(@tanstack/[email protected]([email protected]([email protected]))([email protected]))(@tanstack/[email protected])([email protected]([email protected]))([email protected])'@tanstack/react-start':- specifier: ^1.132.56+ specifier: 1.132.56version: 1.132.56([email protected]([email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))'@tanstack/react-store':- specifier: ^0.8.0+ specifier: 0.8.0'@tanstack/react-table':- specifier: ^8.21.3+ specifier: 8.21.3'@tanstack/react-virtual':- specifier: ^3.13.12+ specifier: 3.13.12'@tanstack/router-plugin':- specifier: ^1.132.56+ specifier: 1.132.56version: 1.132.56(@tanstack/[email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))'@tanstack/store':- specifier: ^0.8.0+ specifier: 0.8.0version: 0.8.0'@trpc/client':- specifier: ^11.17.0+ specifier: 11.17.0'@trpc/react-query':- specifier: ^11.6.0+ specifier: 11.6.0version: 11.6.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])'@trpc/server':- specifier: ^11.17.0+ specifier: 11.17.0version: 11.17.0([email protected])'@trpc/tanstack-react-query':- specifier: ^11.6.0+ specifier: 11.6.0version: 11.6.0(@tanstack/[email protected]([email protected]))(@trpc/[email protected](@trpc/[email protected]([email protected]))([email protected]))(@trpc/[email protected]([email protected]))([email protected]([email protected]))([email protected])([email protected])'@types/d3':- specifier: ^7.4.3+ specifier: 7.4.3version: 7.4.3'@visx/curve':specifier: 4.0.1-alpha.0@@ -479,136 +479,136 @@ importers:specifier: 4.0.1-alpha.0version: 4.0.1-alpha.0([email protected])bind-event-listener:- specifier: ^3.0.0+ specifier: 3.0.0version: 3.0.0class-variance-authority:- specifier: ^0.7.1+ specifier: 0.7.1version: 0.7.1clsx:- specifier: ^2.1.1+ specifier: 2.1.1version: 2.1.1cmdk:- specifier: ^0.2.1+ specifier: 0.2.1codemirror:- specifier: ^6.0.1+ specifier: 6.0.2version: 6.0.2d3:- specifier: ^7.8.5+ specifier: 7.8.5version: 7.8.5d3-array:- specifier: ^3.2.4+ specifier: 3.2.4version: 3.2.4date-fns:- specifier: ^3.3.1+ specifier: 3.3.1version: 3.3.1debounce:- specifier: ^2.2.0+ specifier: 2.2.0version: 2.2.0embla-carousel-autoplay:- specifier: ^8.6.0+ specifier: 8.6.0version: 8.6.0([email protected])embla-carousel-react:specifier: 8.0.0-rc22version: 8.0.0-rc22([email protected])flag-icons:- specifier: ^7.1.0+ specifier: 7.1.0version: 7.1.0framer-motion:- specifier: ^11.0.28+ specifier: 11.18.2version: 11.18.2(@emotion/[email protected])([email protected]([email protected]))([email protected])hamburger-react:- specifier: ^2.5.0+ specifier: 2.5.0version: 2.5.0([email protected])input-otp:- specifier: ^1.2.4+ specifier: 1.2.4javascript-time-ago:- specifier: ^2.5.9+ specifier: 2.5.9version: 2.5.9katex:- specifier: ^0.16.21+ specifier: 0.16.21version: 0.16.21lodash.debounce:- specifier: ^4.0.8+ specifier: 4.0.8version: 4.0.8lodash.isequal:- specifier: ^4.5.0+ specifier: 4.5.0version: 4.5.0lodash.throttle:- specifier: ^4.1.1+ specifier: 4.1.1version: 4.1.1lottie-react:- specifier: ^2.4.0+ specifier: 2.4.0lucide-react:- specifier: ^0.476.0+ specifier: 0.476.0version: 0.476.0([email protected])mathjs:- specifier: ^12.3.2+ specifier: 12.3.2version: 12.3.2mitt:- specifier: ^3.0.1+ specifier: 3.0.1version: 3.0.1motion:- specifier: ^12.40.0+ specifier: 12.40.0version: 12.40.0(@emotion/[email protected])([email protected]([email protected]))([email protected])nanoid:- specifier: ^5.1.6+ specifier: 5.1.6version: 5.1.6nuqs:- specifier: ^2.5.2+ specifier: 2.5.2version: 2.5.2(patch_hash=4f93812bf7a04685f9477b2935e3acbf2aa24dfbb1b00b9ae0ed8f7a2877a98e)(@tanstack/[email protected]([email protected]([email protected]))([email protected]))([email protected](@babel/[email protected]([email protected]))(@opentelemetry/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]([email protected]))([email protected]))([email protected]([email protected]([email protected]))([email protected]))([email protected])prisma-error-enum:- specifier: ^0.1.3+ specifier: 0.1.3version: 0.1.3pushmodal:- specifier: ^1.0.3+ specifier: 1.0.3version: 1.0.3(@radix-ui/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])ramda:- specifier: ^0.29.1+ specifier: 0.29.1version: 0.29.1random-animal-name:- specifier: ^0.1.1+ specifier: 0.1.1version: 0.1.1rc-virtual-list:- specifier: ^3.14.5+ specifier: 3.14.5react:specifier: 'catalog:'version: 19.2.3react-animate-height:- specifier: ^3.2.3+ specifier: 3.2.3react-animated-numbers:- specifier: ^1.1.1+ specifier: 1.1.1react-day-picker:- specifier: ^9.9.0+ specifier: 9.9.0version: 9.9.0([email protected])react-dom:specifier: 'catalog:'version: 19.2.3([email protected])react-grid-layout:- specifier: ^1.5.2+ specifier: 1.5.2react-hook-form:- specifier: ^7.50.1+ specifier: 7.50.1version: 7.50.1([email protected])react-in-viewport:specifier: 1.0.0-beta.8react-markdown:- specifier: ^10.1.0+ specifier: 10.1.0react-redux:- specifier: ^8.1.3+ specifier: 8.1.3version: 8.1.3(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected](@babel/[email protected]([email protected]))(@babel/[email protected](@babel/[email protected]([email protected]))([email protected]))([email protected])([email protected]))([email protected])([email protected])react-resizable:- specifier: ^3.0.5+ specifier: 3.0.5react-responsive:- specifier: ^9.0.2+ specifier: 9.0.2version: 9.0.2([email protected])react-simple-maps:specifier: 3.0.0@@ -617,70 +617,70 @@ importers:specifier: 2.0.0-alpha.16react-syntax-highlighter:- specifier: ^15.5.0+ specifier: 15.5.0version: 15.5.0([email protected])react-use-websocket:- specifier: ^4.7.0+ specifier: 4.7.0react-virtualized-auto-sizer:- specifier: ^1.0.22+ specifier: 1.0.22recharts:- specifier: ^2.15.4+ specifier: 2.15.4rehype-katex:- specifier: ^7.0.1+ specifier: 7.0.1version: 7.0.1remark-gfm:- specifier: ^4.0.1+ specifier: 4.0.1version: 4.0.1([email protected])remark-highlight:- specifier: ^0.1.1+ specifier: 0.1.1version: 0.1.1remark-math:- specifier: ^6.0.0+ specifier: 6.0.0version: 6.0.0([email protected])remark-parse:- specifier: ^11.0.0+ specifier: 11.0.0version: 11.0.0([email protected])remark-rehype:- specifier: ^11.1.2+ specifier: 11.1.2version: 11.1.2rrweb-player:specifier: 2.0.0-alpha.20version: 2.0.0-alpha.20short-unique-id:- specifier: ^5.0.3+ specifier: 5.0.3version: 5.0.3slugify:- specifier: ^1.6.6+ specifier: 1.6.6version: 1.6.6sonner:- specifier: ^1.4.0+ specifier: 1.4.0superjson:- specifier: ^2.2.2+ specifier: 2.2.2version: 2.2.2tailwind-merge:- specifier: ^3.3.1+ specifier: 3.3.1version: 3.3.1tailwindcss:- specifier: ^4.0.6+ specifier: 4.1.12version: 4.1.12tailwindcss-animate:- specifier: ^1.0.7+ specifier: 1.0.7version: 1.0.7([email protected])tw-animate-css:- specifier: ^1.3.6+ specifier: 1.3.7version: 1.3.7use-stick-to-bottom:- specifier: ^1.1.3+ specifier: 1.1.3version: 1.1.3([email protected])usehooks-ts:- specifier: ^2.14.0+ specifier: 2.14.0version: 2.14.0([email protected])vite-tsconfig-paths:- specifier: ^5.1.4+ specifier: 5.1.4version: 5.1.4([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))zod:specifier: 'catalog:'@@ -696,28 +696,28 @@ importers:specifier: workspace:*version: link:../../packages/db'@tanstack/devtools-event-client':- specifier: ^0.3.3+ specifier: 0.3.3version: 0.3.3'@testing-library/dom':- specifier: ^10.4.0+ specifier: 10.4.1version: 10.4.1'@testing-library/react':- specifier: ^16.2.0+ specifier: 16.3.0version: 16.3.0(@testing-library/[email protected])(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])'@types/d3-array':- specifier: ^3.2.2+ specifier: 3.2.2version: 3.2.2'@types/lodash.debounce':- specifier: ^4.0.9+ specifier: 4.0.9version: 4.0.9'@types/lodash.isequal':- specifier: ^4.5.8+ specifier: 4.5.8version: 4.5.8'@types/lodash.throttle':- specifier: ^4.1.9+ specifier: 4.1.9version: 4.1.9'@types/ramda':- specifier: ^0.31.0+ specifier: 0.31.0version: 0.31.0'@types/react':specifier: 'catalog:'@@ -726,31 +726,31 @@ importers:specifier: 'catalog:'version: 19.2.3(@types/[email protected])'@types/react-grid-layout':- specifier: ^1.3.5+ specifier: 1.3.5version: 1.3.5'@types/react-simple-maps':- specifier: ^3.0.4+ specifier: 3.0.4version: 3.0.4'@types/react-syntax-highlighter':- specifier: ^15.5.11+ specifier: 15.5.11version: 15.5.11'@vitejs/plugin-react':- specifier: ^5.2.0+ specifier: 5.2.0version: 5.2.0([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))jsdom:- specifier: ^26.0.0+ specifier: 26.1.0version: 26.1.0([email protected])typescript:specifier: 'catalog:'version: 5.9.3vite:- specifier: ^7.3.0+ specifier: 7.3.0version: 7.3.0(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])vitest:- specifier: ^3.0.5+ specifier: 3.1.3version: 3.1.3(@types/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])web-vitals:- specifier: ^4.2.4+ specifier: 4.2.4version: 4.2.4wrangler:specifier: 4.85.0@@ -762,47 +762,47 @@ importers:specifier: workspace:*version: link:../../packages/sdks/webreact:- specifier: ^19.0.0+ specifier: 19.2.3version: 19.2.3react-dom:- specifier: ^19.0.0+ specifier: 19.2.3version: 19.2.3([email protected])react-router-dom:- specifier: ^7.13.1+ specifier: 7.13.1devDependencies:'@types/react':- specifier: ^19.0.0+ specifier: 19.2.7version: 19.2.7'@types/react-dom':- specifier: ^19.0.0+ specifier: 19.2.3version: 19.2.3(@types/[email protected])'@vitejs/plugin-react':- specifier: ^4.3.4+ specifier: 4.7.0version: 4.7.0([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))typescript:specifier: 'catalog:'version: 5.9.3vite:- specifier: ^6.0.0+ specifier: 6.3.5version: 6.3.5(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])packages/core:dependencies:'@aws-sdk/client-s3':- specifier: ^3.974.0+ specifier: 3.984.0version: 3.984.0'@aws-sdk/client-sts':- specifier: ^3.974.0+ specifier: 3.1117.0version: 3.1117.0'@babel/parser':- specifier: ^7.26.0+ specifier: 7.29.7version: 7.29.7'@better-agent/core':- specifier: ^0.1.0-beta.3+ specifier: 0.1.0-beta.3version: 0.1.0-beta.3'@better-agent/providers':- specifier: ^0.1.0-beta.3+ specifier: 0.1.0-beta.3version: 0.1.0-beta.3(@better-agent/[email protected])'@bull-board/api':specifier: 9.6.0@@ -817,19 +817,19 @@ importers:specifier: 1.4.15version: 1.4.15([email protected](@sinclair/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected]))'@google-cloud/storage':- specifier: ^7.18.0+ specifier: 7.22.0version: 7.22.0([email protected])'@hyperdx/node-opentelemetry':specifier: 'catalog:'version: 0.10.3([email protected])'@maxmind/geoip2-node':- specifier: ^6.1.0+ specifier: 6.1.0version: 6.1.0'@modelcontextprotocol/sdk':- specifier: ^1.12.0+ specifier: 1.27.1version: 1.27.1([email protected])([email protected])'@node-rs/argon2':- specifier: ^2.0.2+ specifier: 2.0.2version: 2.0.2'@openpanel/db':specifier: workspace:*@@ -844,70 +844,70 @@ importers:specifier: workspace:*version: link:../redis'@oslojs/crypto':- specifier: ^1.0.1+ specifier: 1.0.1version: 1.0.1'@oslojs/encoding':- specifier: ^1.1.0+ specifier: 1.1.0version: 1.1.0'@oslojs/otp':- specifier: ^1.1.0+ specifier: 1.1.0version: 1.1.0'@slack/bolt':- specifier: ^3.18.0+ specifier: 3.21.4'@slack/oauth':- specifier: ^3.0.0+ specifier: 3.0.1version: 3.0.1([email protected]([email protected]))'@trpc/server':- specifier: ^11.17.0+ specifier: 11.17.0version: 11.17.0([email protected])arctic:- specifier: ^2.3.0+ specifier: 2.3.0version: 2.3.0bullmq:specifier: 6.3.3version: 6.3.3([email protected]([email protected]))cheerio:- specifier: ^1.0.0+ specifier: 1.1.2version: 1.1.2csv-parse:- specifier: ^6.1.0+ specifier: 6.1.0version: 6.1.0date-fns:- specifier: ^3.3.1+ specifier: 3.3.1version: 3.3.1elysia:specifier: 1.4.30version: 1.4.30(@sinclair/[email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])fast-deep-equal:- specifier: ^3.1.3+ specifier: 3.1.3version: 3.1.3fast-json-stable-hash:- specifier: ^1.0.3+ specifier: 1.0.3version: 1.0.3ipaddr.js:- specifier: ^2.5.0+ specifier: 2.5.0version: 2.5.0jiti:- specifier: ^2.4.1+ specifier: 2.6.1version: 2.6.1js-yaml:- specifier: ^4.1.0+ specifier: 4.1.1version: 4.1.1kafkajs:- specifier: ^2.2.4+ specifier: 2.2.4version: 2.2.4lru-cache:- specifier: ^11.2.4+ specifier: 11.5.1version: 11.5.1luxon:- specifier: ^3.7.2+ specifier: 3.7.2version: 3.7.2mathjs:- specifier: ^12.3.2+ specifier: 12.3.2version: 12.3.2nanoid:- specifier: ^5.1.6+ specifier: 5.1.6version: 5.1.6pino:specifier: 'catalog:'@@ -916,77 +916,77 @@ importers:specifier: 'catalog:'version: 13.1.3prisma-error-enum:- specifier: ^0.1.3+ specifier: 0.1.3version: 0.1.3prom-client:- specifier: ^15.1.3+ specifier: 15.1.3version: 15.1.3qrcode:- specifier: ^1.5.4+ specifier: 1.5.4version: 1.5.4ramda:- specifier: ^0.29.1+ specifier: 0.29.1version: 0.29.1sharp:- specifier: ^0.33.5+ specifier: 0.33.5version: 0.33.5short-unique-id:- specifier: ^5.0.3+ specifier: 5.0.3version: 5.0.3slugify:- specifier: ^1.6.6+ specifier: 1.6.9version: 1.6.9superjson:- specifier: ^1.13.3+ specifier: 1.13.3version: 1.13.3ua-parser-js:- specifier: ^2.0.6+ specifier: 2.0.6version: 2.0.6undici:- specifier: ^8.10.0+ specifier: 8.10.0version: 8.10.0unzipper:- specifier: ^0.12.3+ specifier: 0.12.5version: 0.12.5url-metadata:- specifier: ^5.4.1+ specifier: 5.4.1version: 5.4.1uuid:- specifier: ^9.0.1+ specifier: 9.0.1version: 9.0.1zod:specifier: 'catalog:'version: 4.3.6devDependencies:'@clickhouse/client':- specifier: ^1.18.5+ specifier: 1.18.5version: 1.18.5'@openpanel/tsconfig':specifier: workspace:*version: link:../../tooling/typescript'@types/js-yaml':- specifier: ^4.0.9+ specifier: 4.0.9version: 4.0.9'@types/luxon':- specifier: ^3.7.1+ specifier: 3.7.1version: 3.7.1'@types/qrcode':- specifier: ^1.5.6+ specifier: 1.5.6version: 1.5.6'@types/ramda':- specifier: ^0.31.1+ specifier: 0.31.1version: 0.31.1'@types/unzipper':- specifier: ^0.10.10+ specifier: 0.10.11version: 0.10.11'@types/uuid':- specifier: ^10.0.0+ specifier: 10.0.0version: 10.0.0bun-types:specifier: 1.4.0version: 1.4.0tar:- specifier: ^7.4.3+ specifier: 7.4.3version: 7.4.3typescript:specifier: 'catalog:'@@ -995,7 +995,7 @@ importers:packages/db:dependencies:'@clickhouse/client':- specifier: ^1.18.5+ specifier: 1.18.5version: 1.18.5'@hyperdx/node-opentelemetry':specifier: 'catalog:'@@ -1010,10 +1010,10 @@ importers:specifier: workspace:*version: link:../redis'@prisma/client':- specifier: ^6.14.0+ specifier: 6.14.0jiti:- specifier: ^2.4.1+ specifier: 2.4.1version: 2.4.1pino:specifier: 'catalog:'@@ -1022,7 +1022,7 @@ importers:specifier: 'catalog:'version: 13.1.3prisma-json-types-generator:- specifier: ^3.1.1+ specifier: 3.1.1zod:specifier: 'catalog:'@@ -1038,7 +1038,7 @@ importers:specifier: 1.4.0version: 1.4.0prisma:- specifier: ^6.14.0+ specifier: 6.14.0version: 6.14.0([email protected])([email protected])typescript:specifier: 'catalog:'@@ -1050,16 +1050,16 @@ importers:specifier: workspace:*version: link:../db'@react-email/components':- specifier: ^0.5.6+ specifier: 0.5.6'@react-email/render':- specifier: ^2.0.7+ specifier: 2.0.7'@types/nodemailer':- specifier: ^8.0.0+ specifier: 8.0.0version: 8.0.0nodemailer:- specifier: ^8.0.5+ specifier: 8.0.5version: 8.0.5react:specifier: 'catalog:'@@ -1068,10 +1068,10 @@ importers:specifier: 'catalog:'version: 19.2.3([email protected])resend:- specifier: ^4.0.1+ specifier: 4.0.1responsive-react-email:- specifier: ^0.0.5+ specifier: 0.0.5version: 0.0.5([email protected](@opentelemetry/[email protected])([email protected]([email protected]))([email protected])([email protected]))([email protected])zod:specifier: 'catalog:'@@ -1096,10 +1096,10 @@ importers:packages/payments:dependencies:'@polar-sh/sdk':- specifier: ^0.49.0+ specifier: 0.49.0version: 0.49.0date-fns:- specifier: ^3.3.1+ specifier: 3.3.1version: 3.3.1devDependencies:'@openpanel/db':@@ -1109,10 +1109,10 @@ importers:specifier: workspace:*version: link:../../tooling/typescript'@types/inquirer':- specifier: ^9.0.7+ specifier: 9.0.7version: 9.0.7'@types/inquirer-autocomplete-prompt':- specifier: ^3.0.3+ specifier: 3.0.3version: 3.0.3'@types/node':specifier: 'catalog:'@@ -1121,10 +1121,10 @@ importers:specifier: 'catalog:'version: 19.2.7inquirer:- specifier: ^9.3.5+ specifier: 9.3.6version: 9.3.6inquirer-autocomplete-prompt:- specifier: ^3.0.1+ specifier: 3.0.1version: 3.0.1([email protected])typescript:specifier: 'catalog:'@@ -1136,10 +1136,10 @@ importers:specifier: 5.8.2version: 5.8.2([email protected])lru-cache:- specifier: ^11.2.2+ specifier: 11.2.2version: 11.2.2superjson:- specifier: ^1.13.3+ specifier: 1.13.3version: 1.13.3devDependencies:'@openpanel/core':@@ -1187,7 +1187,7 @@ importers:version: link:../webdevDependencies:astro:- specifier: ^6.4.2+ specifier: 6.4.2version: 6.4.2(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])packages/sdks/express:@@ -1203,13 +1203,13 @@ importers:specifier: workspace:*version: link:../../../tooling/typescript'@types/express':- specifier: ^5.0.3+ specifier: 5.0.3version: 5.0.3'@types/request-ip':- specifier: ^0.0.41+ specifier: 0.0.41version: 0.0.41tsup:- specifier: ^7.2.0+ specifier: 7.3.0typescript:specifier: 'catalog:'@@ -1237,7 +1237,7 @@ importers:specifier: 'catalog:'version: 19.2.7tsup:- specifier: ^7.2.0+ specifier: 7.3.0typescript:specifier: 'catalog:'@@ -1256,13 +1256,13 @@ importers:version: 4.2.2(@biomejs/[email protected])(@parcel/[email protected])(@types/[email protected])(@vue/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected](@emnapi/[email protected])(@emnapi/[email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])devDependencies:'@nuxt/kit':- specifier: ^3.0.0+ specifier: 3.20.2version: 3.20.2([email protected])'@nuxt/module-builder':- specifier: ^1.0.2+ specifier: 1.0.2version: 1.0.2(@nuxt/[email protected]([email protected])([email protected])([email protected]))(@vue/[email protected])([email protected])([email protected])([email protected]([email protected]))'@nuxt/types':- specifier: ^2.18.1+ specifier: 2.18.1version: 2.18.1'@openpanel/tsconfig':specifier: workspace:*@@ -1271,13 +1271,13 @@ importers:specifier: 'catalog:'version: 24.10.1'@vue/runtime-core':- specifier: ^3.5.25+ specifier: 3.5.25version: 3.5.25typescript:specifier: 'catalog:'version: 5.9.3unbuild:- specifier: ^3.6.1+ specifier: 3.6.1version: 3.6.1([email protected])([email protected](@vue/[email protected])([email protected])([email protected]([email protected])))([email protected]([email protected]))packages/sdks/react-native:@@ -1302,7 +1302,7 @@ importers:specifier: 'catalog:'version: 24.10.1tsup:- specifier: ^7.2.0+ specifier: 7.3.0typescript:specifier: 'catalog:'@@ -1317,7 +1317,7 @@ importers:specifier: 'catalog:'version: 24.10.1tsup:- specifier: ^7.2.0+ specifier: 7.3.0typescript:specifier: 'catalog:'@@ -1342,7 +1342,7 @@ importers:specifier: 'catalog:'version: 24.10.1tsup:- specifier: ^7.2.0+ specifier: 7.3.0typescript:specifier: 'catalog:'@@ -1351,10 +1351,10 @@ importers:tooling/publish:dependencies:arg:- specifier: ^5.0.2+ specifier: 5.0.2version: 5.0.2semver:- specifier: ^7.5.4+ specifier: 7.6.0version: 7.6.0devDependencies:'@openpanel/tsconfig':@@ -1364,7 +1364,7 @@ importers:specifier: 'catalog:'version: 24.10.1'@types/semver':- specifier: ^7.5.4+ specifier: 7.5.7version: 7.5.7typescript:specifier: 'catalog:'@@ -1373,7 +1373,7 @@ importers:tooling/typescript:devDependencies:tsup:- specifier: ^7.2.0+ specifier: 7.3.0packages:diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex e2cea20ff..b9c0d5860 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -73,16 +73,16 @@ overrides:# Define a catalog of version ranges.catalog:- zod: ^4.1.8- react: ^19.2.3- "@types/react": ^19.2.3- "react-dom": ^19.2.3- "@types/react-dom": ^19.2.3- "@types/node": ^24.7.1- typescript: ^5.9.3- pino: ^10.3.1- pino-pretty: ^13.1.3- "@hyperdx/node-opentelemetry": ^0.10.3+ zod: 4.3.6+ react: 19.2.3+ "@types/react": 19.2.7+ "react-dom": 19.2.3+ "@types/react-dom": 19.2.3+ "@types/node": 24.10.1+ typescript: 5.9.3+ pino: 10.3.1+ pino-pretty: 13.1.3+ "@hyperdx/node-opentelemetry": 0.10.3# pnpm 11 replacement for build-script approval.#diff --git a/tooling/gates/p13-drift.sh b/tooling/gates/p13-drift.shnew file mode 100755index 000000000..082968170--- /dev/null+++ b/tooling/gates/p13-drift.sh@@ -0,0 +1,157 @@+#!/usr/bin/env bash+#+# P13 drift gate (ADR-014) — does the INSTALLED tree still match what pnpm+# resolved?+#+# --report every drifted direct dependency, per workspace package, plus a+# TOTAL line. Always exits 0.+# --assert exits 1 if anything drifted, printing the offenders; exits 0+# when the installed tree matches the snapshot exactly.+#+# The reference is tooling/gates/p13-lock-snapshot.json, generated from+# pnpm-lock.yaml by tooling/scripts/write-p13-lock-snapshot.ts. It is a+# separate committed file because M13-002 deletes pnpm-lock.yaml: after that+# commit the snapshot is the only record of what pnpm had resolved, and it is+# what makes "the installer swap moved nothing" a checkable claim rather than+# an assertion. ADR-014's stop rule is exactly this question.+#+# The installed version of <dep> for workspace package <pkg> is read from+# <pkg>/node_modules/<dep>/package.json (the isolated layout pnpm and+# `bun install --linker=isolated`+# both produce)+# falling back to+# node_modules/<dep>/package.json (a hoisted layout, which+# ADR-014 amendment 1 allows only+# with a recorded reason)+# so the gate reads both layouts unchanged. A dependency present in neither is+# reported as `missing` and counts as drift — an undeclared/unlinked+# dependency is the phantom-dependency failure the isolated layout exists to+# surface.+#+# Workspace links are compared too, at the linked package's own version. A+# resolver silently preferring the REGISTRY copy of a workspace package over+# the local source is a documented hazard on this tree (apps/start depends on+# @openpanel/[email protected] from npm while packages/sdks/web is 1.4.1-local), and it+# shows up here as a version mismatch rather than as a mystery at runtime.+#+# Output is deterministic — no timestamps, no paths outside the repo — so two+# runs diff cleanly.++set -uo pipefail++REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"+cd "$REPO_ROOT" || exit 1++readonly SNAPSHOT='tooling/gates/p13-lock-snapshot.json'+readonly IMPORTER_COLUMN_WIDTH=26+readonly DEPENDENCY_COLUMN_WIDTH=34+readonly VERSION_COLUMN_WIDTH=16+readonly TABLE_RULE_WIDTH=92++usage() {+ echo "usage: $(basename "$0") --report | --assert" >&2+}++# Emits "<importer>\t<dependency>\t<expected>\t<installed>" for every direct+# dependency whose installed version differs from the snapshot. `missing` in+# the installed column means the package is not present in either layout.+scan() {+ bun -e '+ import { readFileSync } from "node:fs";+ import { join } from "node:path";++ const snapshot = JSON.parse(readFileSync(process.argv[1], "utf8"));++ const installedVersion = (importer, name) => {+ const roots = importer === "." ? ["."] : [importer, "."];+ for (const root of roots) {+ try {+ const manifest = JSON.parse(+ readFileSync(join(root, "node_modules", name, "package.json"), "utf8")+ );+ if (manifest.version) return manifest.version;+ } catch {}+ }+ return null;+ };++ const rows = [];+ for (const importer of Object.keys(snapshot).sort()) {+ for (const name of Object.keys(snapshot[importer]).sort()) {+ const expected = snapshot[importer][name];+ const installed = installedVersion(importer, name);+ if (installed !== expected) {+ rows.push([importer, name, expected, installed ?? "missing"].join("\t"));+ }+ }+ }+ if (rows.length) process.stdout.write(rows.join("\n") + "\n");+ ' "$SNAPSHOT"+}++# The number of (importer, dependency) pairs the snapshot covers — printed so+# a TOTAL of 0 is readable as "0 of N drifted" rather than "nothing ran".+snapshot_size() {+ bun -e '+ import { readFileSync } from "node:fs";+ const snapshot = JSON.parse(readFileSync(process.argv[1], "utf8"));+ let total = 0;+ for (const deps of Object.values(snapshot)) total += Object.keys(deps).length;+ console.log(`${Object.keys(snapshot).length} ${total}`);+ ' "$SNAPSHOT"+}++table_rule() {+ printf '%*s\n' "$TABLE_RULE_WIDTH" '' | tr ' ' '-'+}++print_report() {+ local drift importers pairs drifted=0+ drift="$(scan)"+ read -r importers pairs <<<"$(snapshot_size)"+ [[ -n "$drift" ]] && drifted=$(printf '%s\n' "$drift" | wc -l | tr -d ' ')++ printf '%-*s%-*s%-*s%s\n' \+ "$IMPORTER_COLUMN_WIDTH" "workspace package" \+ "$DEPENDENCY_COLUMN_WIDTH" "dependency" \+ "$VERSION_COLUMN_WIDTH" "snapshot" "installed"+ table_rule++ if [[ -n "$drift" ]]; then+ printf '%s\n' "$drift" | awk -F'\t' \+ -v i="$IMPORTER_COLUMN_WIDTH" -v d="$DEPENDENCY_COLUMN_WIDTH" -v v="$VERSION_COLUMN_WIDTH" \+ '{ printf "%-*s%-*s%-*s%s\n", i, $1, d, $2, v, $3, $4 }'+ fi++ table_rule+ printf 'TOTAL: %s drifted of %s direct dependencies across %s workspace packages\n' \+ "$drifted" "$pairs" "$importers"+}++assert_clean() {+ local drift+ drift="$(scan)"++ if [[ -n "$drift" ]]; then+ echo "FAIL: the installed tree does not match $SNAPSHOT."+ printf '%s\n' "$drift" |+ awk -F'\t' '{ printf " %s: %s expected %s, installed %s\n", $1, $2, $3, $4 }'+ echo+ print_report+ return 1+ fi++ echo "OK: every direct dependency matches $SNAPSHOT."+ return 0+}++[[ -f "$SNAPSHOT" ]] || {+ echo "FAIL: $SNAPSHOT is missing — regenerate it with tooling/scripts/write-p13-lock-snapshot.ts" >&2+ exit 1+}++case "${1-}" in+ --report) print_report ;;+ --assert) assert_clean || exit 1 ;;+ *) usage; exit 2 ;;+esacdiff --git a/tooling/gates/p13-lock-snapshot.json b/tooling/gates/p13-lock-snapshot.jsonnew file mode 100644index 000000000..f1621b294--- /dev/null+++ b/tooling/gates/p13-lock-snapshot.json@@ -0,0 +1,458 @@+{+ ".": {+ "@biomejs/biome": "2.3.15",+ "@hyperdx/node-opentelemetry": "0.10.3",+ "depcheck": "1.4.7",+ "dotenv-cli": "7.3.0",+ "semver": "7.6.0",+ "simple-git-hooks": "2.12.1",+ "typescript": "5.9.3",+ "ultracite": "7.2.0",+ "vitest": "3.1.3"+ },+ "apps/api": {+ "@faker-js/faker": "9.0.1",+ "@openpanel/core": "0.0.1",+ "@openpanel/db": "0.0.1",+ "@openpanel/redis": "0.0.1",+ "@openpanel/tsconfig": "0.1.0",+ "@types/uuid": "10.0.0",+ "bun-types": "1.4.0",+ "elysia": "1.4.30",+ "pino": "10.3.1",+ "pino-pretty": "13.1.3",+ "typescript": "5.9.3",+ "uuid": "9.0.1",+ "zod": "4.3.6"+ },+ "apps/public": {+ "@nivo/funnel": "0.99.0",+ "@number-flow/react": "0.5.10",+ "@opennextjs/cloudflare": "1.17.1",+ "@openpanel/nextjs": "1.2.0",+ "@openpanel/payments": "0.0.1",+ "@openpanel/sdk-info": "0.0.1",+ "@openstatus/react": "0.0.3",+ "@radix-ui/react-accordion": "1.2.12",+ "@radix-ui/react-slider": "1.3.6",+ "@radix-ui/react-slot": "1.2.4",+ "@radix-ui/react-tooltip": "1.2.8",+ "@tailwindcss/postcss": "4.1.17",+ "@types/mdx": "2.0.13",+ "@types/node": "24.10.1",+ "@types/react": "19.2.7",+ "@types/react-dom": "19.2.3",+ "autoprefixer": "10.4.22",+ "cheerio": "1.1.2",+ "class-variance-authority": "0.7.1",+ "clsx": "2.1.1",+ "dotted-map": "2.2.3",+ "framer-motion": "12.23.25",+ "fumadocs-core": "16.7.11",+ "fumadocs-mdx": "14.2.11",+ "fumadocs-openapi": "10.6.7",+ "fumadocs-ui": "16.7.11",+ "geist": "1.5.1",+ "lucide-react": "0.555.0",+ "next": "16.0.7",+ "next-themes": "0.4.6",+ "postcss": "8.5.6",+ "react": "19.2.3",+ "react-dom": "19.2.3",+ "react-markdown": "10.1.0",+ "recharts": "2.15.4",+ "rehype-external-links": "3.0.0",+ "shiki": "4.0.2",+ "tailwind-merge": "3.4.0",+ "tailwindcss": "4.1.17",+ "tailwindcss-animate": "1.0.7",+ "typescript": "5.9.3",+ "wrangler": "4.65.0",+ "zod": "4.3.6"+ },+ "apps/start": {+ "@better-agent/client": "0.1.0-beta.3",+ "@biomejs/biome": "1.9.4",+ "@cloudflare/vite-plugin": "1.33.2",+ "@codemirror/commands": "6.10.1",+ "@codemirror/lang-javascript": "6.2.4",+ "@codemirror/lang-json": "6.0.2",+ "@codemirror/state": "6.5.4",+ "@codemirror/theme-one-dark": "6.1.3",+ "@codemirror/view": "6.39.11",+ "@dnd-kit/core": "6.3.1",+ "@dnd-kit/sortable": "10.0.0",+ "@dnd-kit/utilities": "3.2.2",+ "@faker-js/faker": "9.9.0",+ "@hookform/resolvers": "5.2.2",+ "@nivo/sankey": "0.99.0",+ "@number-flow/react": "0.5.10",+ "@openpanel/core": "0.0.1",+ "@openpanel/db": "0.0.1",+ "@openpanel/payments": "0.0.1",+ "@openpanel/sdk-info": "0.0.1",+ "@openpanel/web": "1.0.5",+ "@radix-ui/react-accordion": "1.2.12",+ "@radix-ui/react-alert-dialog": "1.1.15",+ "@radix-ui/react-aspect-ratio": "1.1.7",+ "@radix-ui/react-avatar": "1.1.10",+ "@radix-ui/react-checkbox": "1.3.3",+ "@radix-ui/react-dialog": "1.1.15",+ "@radix-ui/react-dropdown-menu": "2.1.16",+ "@radix-ui/react-label": "2.1.7",+ "@radix-ui/react-popover": "1.1.15",+ "@radix-ui/react-portal": "1.1.9",+ "@radix-ui/react-progress": "1.1.7",+ "@radix-ui/react-radio-group": "1.3.8",+ "@radix-ui/react-scroll-area": "1.2.10",+ "@radix-ui/react-select": "2.2.6",+ "@radix-ui/react-separator": "1.1.7",+ "@radix-ui/react-slider": "1.2.3",+ "@radix-ui/react-slot": "1.2.3",+ "@radix-ui/react-switch": "1.2.6",+ "@radix-ui/react-tabs": "1.1.13",+ "@radix-ui/react-toast": "1.2.15",+ "@radix-ui/react-toggle": "1.1.10",+ "@radix-ui/react-toggle-group": "1.1.11",+ "@radix-ui/react-tooltip": "1.2.8",+ "@reduxjs/toolkit": "2.8.2",+ "@sentry/tanstackstart-react": "9.46.0",+ "@tailwindcss/container-queries": "0.1.1",+ "@tailwindcss/typography": "0.5.15",+ "@tailwindcss/vite": "4.1.12",+ "@tanstack/devtools-event-client": "0.3.3",+ "@tanstack/match-sorter-utils": "8.19.4",+ "@tanstack/nitro-v2-vite-plugin": "1.133.19",+ "@tanstack/react-devtools": "0.7.6",+ "@tanstack/react-query": "5.90.2",+ "@tanstack/react-query-devtools": "5.90.2",+ "@tanstack/react-router": "1.132.47",+ "@tanstack/react-router-devtools": "1.132.51",+ "@tanstack/react-router-ssr-query": "1.132.47",+ "@tanstack/react-start": "1.132.56",+ "@tanstack/react-store": "0.8.0",+ "@tanstack/react-table": "8.21.3",+ "@tanstack/react-virtual": "3.13.12",+ "@tanstack/router-plugin": "1.132.56",+ "@tanstack/store": "0.8.0",+ "@testing-library/dom": "10.4.1",+ "@testing-library/react": "16.3.0",+ "@trpc/client": "11.17.0",+ "@trpc/react-query": "11.6.0",+ "@trpc/server": "11.17.0",+ "@trpc/tanstack-react-query": "11.6.0",+ "@types/d3": "7.4.3",+ "@types/d3-array": "3.2.2",+ "@types/lodash.debounce": "4.0.9",+ "@types/lodash.isequal": "4.5.8",+ "@types/lodash.throttle": "4.1.9",+ "@types/ramda": "0.31.0",+ "@types/react": "19.2.7",+ "@types/react-dom": "19.2.3",+ "@types/react-grid-layout": "1.3.5",+ "@types/react-simple-maps": "3.0.4",+ "@types/react-syntax-highlighter": "15.5.11",+ "@visx/curve": "4.0.1-alpha.0",+ "@visx/event": "4.0.1-alpha.0",+ "@visx/gradient": "4.0.1-alpha.0",+ "@visx/grid": "4.0.1-alpha.0",+ "@visx/pattern": "4.0.1-alpha.0",+ "@visx/responsive": "4.0.1-alpha.0",+ "@visx/scale": "4.0.1-alpha.0",+ "@visx/shape": "4.0.1-alpha.0",+ "@vitejs/plugin-react": "5.2.0",+ "bind-event-listener": "3.0.0",+ "class-variance-authority": "0.7.1",+ "clsx": "2.1.1",+ "cmdk": "0.2.1",+ "codemirror": "6.0.2",+ "d3": "7.8.5",+ "d3-array": "3.2.4",+ "date-fns": "3.3.1",+ "debounce": "2.2.0",+ "embla-carousel-autoplay": "8.6.0",+ "embla-carousel-react": "8.0.0-rc22",+ "flag-icons": "7.1.0",+ "framer-motion": "11.18.2",+ "hamburger-react": "2.5.0",+ "input-otp": "1.2.4",+ "javascript-time-ago": "2.5.9",+ "jsdom": "26.1.0",+ "katex": "0.16.21",+ "lodash.debounce": "4.0.8",+ "lodash.isequal": "4.5.0",+ "lodash.throttle": "4.1.1",+ "lottie-react": "2.4.0",+ "lucide-react": "0.476.0",+ "mathjs": "12.3.2",+ "mitt": "3.0.1",+ "motion": "12.40.0",+ "nanoid": "5.1.6",+ "nuqs": "2.5.2",+ "prisma-error-enum": "0.1.3",+ "pushmodal": "1.0.3",+ "ramda": "0.29.1",+ "random-animal-name": "0.1.1",+ "rc-virtual-list": "3.14.5",+ "react": "19.2.3",+ "react-animate-height": "3.2.3",+ "react-animated-numbers": "1.1.1",+ "react-day-picker": "9.9.0",+ "react-dom": "19.2.3",+ "react-grid-layout": "1.5.2",+ "react-hook-form": "7.50.1",+ "react-in-viewport": "1.0.0-beta.8",+ "react-markdown": "10.1.0",+ "react-redux": "8.1.3",+ "react-resizable": "3.0.5",+ "react-responsive": "9.0.2",+ "react-simple-maps": "3.0.0",+ "react-svg-worldmap": "2.0.0-alpha.16",+ "react-syntax-highlighter": "15.5.0",+ "react-use-websocket": "4.7.0",+ "react-virtualized-auto-sizer": "1.0.22",+ "recharts": "2.15.4",+ "rehype-katex": "7.0.1",+ "remark-gfm": "4.0.1",+ "remark-highlight": "0.1.1",+ "remark-math": "6.0.0",+ "remark-parse": "11.0.0",+ "remark-rehype": "11.1.2",+ "rrweb-player": "2.0.0-alpha.20",+ "short-unique-id": "5.0.3",+ "slugify": "1.6.6",+ "sonner": "1.4.0",+ "superjson": "2.2.2",+ "tailwind-merge": "3.3.1",+ "tailwindcss": "4.1.12",+ "tailwindcss-animate": "1.0.7",+ "tw-animate-css": "1.3.7",+ "typescript": "5.9.3",+ "use-stick-to-bottom": "1.1.3",+ "usehooks-ts": "2.14.0",+ "vite": "7.3.0",+ "vite-tsconfig-paths": "5.1.4",+ "vitest": "3.1.3",+ "web-vitals": "4.2.4",+ "wrangler": "4.85.0",+ "zod": "4.3.6"+ },+ "apps/testbed": {+ "@openpanel/web": "1.4.1-local",+ "@types/react": "19.2.7",+ "@types/react-dom": "19.2.3",+ "@vitejs/plugin-react": "4.7.0",+ "react": "19.2.3",+ "react-dom": "19.2.3",+ "react-router-dom": "7.13.1",+ "typescript": "5.9.3",+ "vite": "6.3.5"+ },+ "packages/core": {+ "@aws-sdk/client-s3": "3.984.0",+ "@aws-sdk/client-sts": "3.1117.0",+ "@babel/parser": "7.29.7",+ "@better-agent/core": "0.1.0-beta.3",+ "@better-agent/providers": "0.1.0-beta.3",+ "@bull-board/api": "9.6.0",+ "@bull-board/elysia": "9.6.0",+ "@clickhouse/client": "1.18.5",+ "@elysiajs/cors": "1.4.2",+ "@elysiajs/openapi": "1.4.15",+ "@google-cloud/storage": "7.22.0",+ "@hyperdx/node-opentelemetry": "0.10.3",+ "@maxmind/geoip2-node": "6.1.0",+ "@modelcontextprotocol/sdk": "1.27.1",+ "@node-rs/argon2": "2.0.2",+ "@openpanel/db": "0.0.1",+ "@openpanel/email": "0.0.1",+ "@openpanel/payments": "0.0.1",+ "@openpanel/redis": "0.0.1",+ "@openpanel/tsconfig": "0.1.0",+ "@oslojs/crypto": "1.0.1",+ "@oslojs/encoding": "1.1.0",+ "@oslojs/otp": "1.1.0",+ "@slack/bolt": "3.21.4",+ "@slack/oauth": "3.0.1",+ "@trpc/server": "11.17.0",+ "@types/js-yaml": "4.0.9",+ "@types/luxon": "3.7.1",+ "@types/qrcode": "1.5.6",+ "@types/ramda": "0.31.1",+ "@types/unzipper": "0.10.11",+ "@types/uuid": "10.0.0",+ "arctic": "2.3.0",+ "bullmq": "6.3.3",+ "bun-types": "1.4.0",+ "cheerio": "1.1.2",+ "csv-parse": "6.1.0",+ "date-fns": "3.3.1",+ "elysia": "1.4.30",+ "fast-deep-equal": "3.1.3",+ "fast-json-stable-hash": "1.0.3",+ "ipaddr.js": "2.5.0",+ "jiti": "2.6.1",+ "js-yaml": "4.1.1",+ "kafkajs": "2.2.4",+ "lru-cache": "11.5.1",+ "luxon": "3.7.2",+ "mathjs": "12.3.2",+ "nanoid": "5.1.6",+ "pino": "10.3.1",+ "pino-pretty": "13.1.3",+ "prisma-error-enum": "0.1.3",+ "prom-client": "15.1.3",+ "qrcode": "1.5.4",+ "ramda": "0.29.1",+ "sharp": "0.33.5",+ "short-unique-id": "5.0.3",+ "slugify": "1.6.9",+ "superjson": "1.13.3",+ "tar": "7.4.3",+ "typescript": "5.9.3",+ "ua-parser-js": "2.0.6",+ "undici": "8.10.0",+ "unzipper": "0.12.5",+ "url-metadata": "5.4.1",+ "uuid": "9.0.1",+ "zod": "4.3.6"+ },+ "packages/db": {+ "@clickhouse/client": "1.18.5",+ "@hyperdx/node-opentelemetry": "0.10.3",+ "@openpanel/core": "0.0.1",+ "@openpanel/payments": "0.0.1",+ "@openpanel/redis": "0.0.1",+ "@openpanel/tsconfig": "0.1.0",+ "@prisma/client": "6.14.0",+ "@types/node": "24.10.1",+ "bun-types": "1.4.0",+ "jiti": "2.4.1",+ "pino": "10.3.1",+ "pino-pretty": "13.1.3",+ "prisma": "6.14.0",+ "prisma-json-types-generator": "3.1.1",+ "typescript": "5.9.3",+ "zod": "4.3.6"+ },+ "packages/email": {+ "@openpanel/db": "0.0.1",+ "@openpanel/tsconfig": "0.1.0",+ "@react-email/components": "0.5.6",+ "@react-email/render": "2.0.7",+ "@types/node": "24.10.1",+ "@types/nodemailer": "8.0.0",+ "@types/react": "19.2.7",+ "nodemailer": "8.0.5",+ "react": "19.2.3",+ "react-dom": "19.2.3",+ "react-email": "3.0.4",+ "resend": "4.0.1",+ "responsive-react-email": "0.0.5",+ "typescript": "5.9.3",+ "zod": "4.3.6"+ },+ "packages/payments": {+ "@openpanel/db": "0.0.1",+ "@openpanel/tsconfig": "0.1.0",+ "@polar-sh/sdk": "0.49.0",+ "@types/inquirer": "9.0.7",+ "@types/inquirer-autocomplete-prompt": "3.0.3",+ "@types/node": "24.10.1",+ "@types/react": "19.2.7",+ "date-fns": "3.3.1",+ "inquirer": "9.3.6",+ "inquirer-autocomplete-prompt": "3.0.1",+ "typescript": "5.9.3"+ },+ "packages/redis": {+ "@openpanel/core": "0.0.1",+ "@openpanel/db": "0.0.1",+ "@openpanel/tsconfig": "0.1.0",+ "@types/node": "24.10.1",+ "ioredis": "5.8.2",+ "lru-cache": "11.2.2",+ "prisma": "5.9.1",+ "superjson": "1.13.3",+ "typescript": "5.9.3"+ },+ "packages/sdks/_info": {+ "@openpanel/tsconfig": "0.1.0",+ "@types/react": "19.2.7",+ "prisma": "5.9.1",+ "react": "19.2.3",+ "typescript": "5.9.3"+ },+ "packages/sdks/astro": {+ "@openpanel/web": "1.4.1-local",+ "astro": "6.4.2"+ },+ "packages/sdks/express": {+ "@openpanel/sdk": "1.3.1-local",+ "@openpanel/tsconfig": "0.1.0",+ "@types/express": "5.0.3",+ "@types/request-ip": "0.0.41",+ "express": "4.19.2",+ "tsup": "7.3.0",+ "typescript": "5.9.3"+ },+ "packages/sdks/nextjs": {+ "@openpanel/tsconfig": "0.1.0",+ "@openpanel/web": "1.4.1-local",+ "@types/react": "19.2.7",+ "next": "15.0.3",+ "react": "19.1.1",+ "react-dom": "19.1.1",+ "tsup": "7.3.0",+ "typescript": "5.9.3"+ },+ "packages/sdks/nuxt": {+ "@nuxt/kit": "3.20.2",+ "@nuxt/module-builder": "1.0.2",+ "@nuxt/types": "2.18.1",+ "@openpanel/tsconfig": "0.1.0",+ "@openpanel/web": "1.4.1-local",+ "@types/node": "24.10.1",+ "@vue/runtime-core": "3.5.25",+ "h3": "1.15.4",+ "nuxt": "4.2.2",+ "typescript": "5.9.3",+ "unbuild": "3.6.1"+ },+ "packages/sdks/react-native": {+ "@openpanel/sdk": "1.3.1-local",+ "@openpanel/tsconfig": "0.1.0",+ "@types/node": "24.10.1",+ "expo-application": "5.3.1",+ "expo-constants": "15.4.5",+ "react-native": "0.73.6",+ "tsup": "7.3.0",+ "typescript": "5.9.3"+ },+ "packages/sdks/sdk": {+ "@openpanel/tsconfig": "0.1.0",+ "@types/node": "24.10.1",+ "tsup": "7.3.0",+ "typescript": "5.9.3"+ },+ "packages/sdks/web": {+ "@openpanel/sdk": "1.3.1-local",+ "@openpanel/tsconfig": "0.1.0",+ "@rrweb/types": "2.0.0-alpha.20",+ "@types/node": "24.10.1",+ "rrweb": "2.0.0-alpha.20",+ "tsup": "7.3.0",+ "typescript": "5.9.3"+ },+ "tooling/publish": {+ "@openpanel/tsconfig": "0.1.0",+ "@types/node": "24.10.1",+ "@types/semver": "7.5.7",+ "arg": "5.0.2",+ "semver": "7.6.0",+ "typescript": "5.9.3"+ },+ "tooling/typescript": {+ "tsup": "7.3.0"+ }+}diff --git a/tooling/gates/p13-ssr.sh b/tooling/gates/p13-ssr.shnew file mode 100755index 000000000..b3b2eefbb--- /dev/null+++ b/tooling/gates/p13-ssr.sh@@ -0,0 +1,316 @@+#!/usr/bin/env bash+#+# P13 SSR gate (ADR-014) — does the dashboard still SERVER-RENDER after an+# install?+#+# ADR-014's gate is "apps/start builds AND SSR-renders /login plus one more+# route", and the reason is `.github/smoke/smoke.sh:6-11`: main-8e60 built+# green, pushed green, and every dashboard route returned 500 because a+# dependency re-resolve paired two incompatible copies of seroval. Nothing in+# CI ever started the image. A build that succeeds proves nothing here.+#+# This script is the baseline half of that gate: it is GREEN UNDER PNPM, and+# M13-002 runs it UNCHANGED after the swap. It is therefore deliberately+# installer-agnostic — the only installer-specific thing it does is pick which+# package-manager binary runs the workspace's own `build` script, detected the+# same way verification/full.sh does it (a committed bun.lock means bun+# installed the tree).+#+# What it does, in the Dockerfile's order (apps/start/Dockerfile):+# 1. builds apps/start with NITRO=1 SELF_HOSTED=1 through the package's own+# `build` script (which goes through `with-env`, i.e. the repo .env);+# 2. reproduces the runner stage's esm-env shim and its BROWSER/NODE/DEV+# assertion — the standalone Nitro output ships `esm-env-runtime` under+# the `esm-env` OVERRIDE, and without the shim @number-flow/react's+# `import "esm-env"` is a hard ERR_MODULE_NOT_FOUND at first render;+# 3. boots apps/api and then `.output/server/index.mjs`, each on a free+# port, with the `app_env` block from .github/smoke/docker-compose.yml+# pointed at this box's services and at the api it just started;+# 4. asserts exactly what smoke.sh's assert_ssr_route asserts — HTTP 200, an+# `<html` in the body, at least 1000 bytes — for /login and /onboarding;+# 5. greps the dashboard's log for the module/runtime resolution errors+# smoke.sh's assert_no_server_errors greps for, and fails on any hit.+#+# Why /onboarding is the second route: it is the create-an-account page and it+# renders WITHOUT a session by construction — its beforeLoad redirects only+# when a session EXISTS, and its loader is a no-op unless an `inviteId` search+# param is present, so an anonymous request needs no seeded row. It also sits+# under the `_public` layout rather than /login's `_login` one, so the two+# assertions cover two different server-rendered subtrees instead of the same+# layout twice.+#+# DATABASES: the isolated `openpanel_test` Postgres and ClickHouse, never the+# prod-copy `openpanel` ones. Both asserted routes issue exactly one tRPC call+# (auth.session) and read no analytics, so this costs a session lookup.+#+# The two servers it starts are always killed, on success, on failure and on+# an interrupt.+#+# bash tooling/gates/p13-ssr.sh++set -uo pipefail++REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"+cd "$REPO_ROOT" || exit 1++readonly RUN_DIR="${P13_SSR_RUN_DIR:-/tmp/openpanel-p13-ssr}"+readonly API_LOG="$RUN_DIR/api.log"+readonly DASHBOARD_LOG="$RUN_DIR/dashboard.log"+readonly BUILD_LOG="$RUN_DIR/build.log"+readonly BODY_FILE="$RUN_DIR/ssr-body.html"++readonly SERVER_OUTPUT='apps/start/.output/server'+readonly API_ENTRYPOINT='apps/api/src/main.ts'++# smoke.sh's own thresholds, reproduced rather than referenced.+readonly MIN_SSR_BODY_BYTES=1000+readonly SSR_REQUEST_TIMEOUT_SECONDS=30++readonly API_READY_TIMEOUT_SECONDS=120+readonly DASHBOARD_READY_TIMEOUT_SECONDS=90+readonly READY_POLL_INTERVAL_SECONDS=1+readonly STOP_WAIT_SECONDS=10++# The shapes a broken bundle or a missing dependency takes (smoke.sh:88-90).+readonly RESOLUTION_ERROR_PATTERN='is not a function|Cannot find (module|package)|ERR_MODULE_NOT_FOUND|ERR_PACKAGE_PATH_NOT_EXPORTED'++API_PID=''+DASHBOARD_PID=''+FAILED=0++# --- process lifecycle -------------------------------------------------------++# Both servers are started so that $! is the server process itself (`env`+# execs the runtime, and the dashboard's subshell uses an explicit `exec`), so+# the pid is the thing holding the port. Any child bash left in between is+# swept first, because a wrapper that outlives its parent keeps the port.+stop_server() {+ local name="$1" pid="$2" child+ [[ -n "$pid" ]] || return 0+ kill -0 "$pid" 2>/dev/null || return 0++ for child in $(pgrep -P "$pid" 2>/dev/null); do+ kill -TERM "$child" 2>/dev/null || true+ done+ kill -TERM "$pid" 2>/dev/null || true++ for _ in $(seq "$STOP_WAIT_SECONDS"); do+ kill -0 "$pid" 2>/dev/null || break+ sleep 1+ done+ kill -0 "$pid" 2>/dev/null && kill -KILL "$pid" 2>/dev/null+ echo " stopped $name"+}++cleanup() {+ stop_server dashboard "$DASHBOARD_PID"+ stop_server api "$API_PID"+}+trap cleanup EXIT INT TERM++fail() {+ echo "FAIL: $*" >&2+ FAILED=1+}++die() {+ fail "$@"+ echo "--- api log (last 60) ---" >&2+ tail -60 "$API_LOG" 2>/dev/null >&2+ echo "--- dashboard log (last 60) ---" >&2+ tail -60 "$DASHBOARD_LOG" 2>/dev/null >&2+ exit 1+}++free_port() {+ bun -e 'const s = Bun.listen({ hostname: "127.0.0.1", port: 0, socket: { data() {} } }); console.log(s.port); s.stop(true);'+}++wait_ready() {+ local name="$1" url="$2" timeout="$3" waited=0 pid="$4"+ until curl -fsS -o /dev/null --max-time 5 "$url" 2>/dev/null; do+ if ! kill -0 "$pid" 2>/dev/null; then+ die "$name exited before it became ready"+ fi+ sleep "$READY_POLL_INTERVAL_SECONDS"+ waited=$((waited + READY_POLL_INTERVAL_SECONDS))+ if ((waited >= timeout)); then+ die "$name never became ready at $url within ${timeout}s"+ fi+ done+ echo " $name ready at $url (${waited}s)"+}++# --- the assertions ----------------------------------------------------------++# smoke.sh's assert_ssr_route, verbatim in intent: a 200, a real HTML document,+# and enough of it that a degraded-but-200 render still fails.+assert_ssr_route() {+ local path="$1" status bytes+ echo "asserting SSR route $path"++ status=$(curl -sS -o "$BODY_FILE" -w '%{http_code}' \+ --max-time "$SSR_REQUEST_TIMEOUT_SECONDS" "$DASHBOARD_URL$path" || echo '000')+ bytes=$(wc -c <"$BODY_FILE" 2>/dev/null | tr -d ' ')+ bytes=${bytes:-0}++ if [[ "$status" != '200' ]]; then+ { head -60 "$BODY_FILE" 2>/dev/null; echo; } >&2+ fail "$path returned HTTP $status (expected 200)"+ return 1+ fi+ if ! grep -q '<html' "$BODY_FILE"; then+ { head -40 "$BODY_FILE"; echo; } >&2+ fail "$path returned 200 but no <html> — SSR did not render"+ return 1+ fi+ if ((bytes < MIN_SSR_BODY_BYTES)); then+ { cat "$BODY_FILE"; echo; } >&2+ fail "$path rendered only ${bytes} bytes — suspiciously empty for an SSR page"+ return 1+ fi++ echo " $path OK (HTTP 200, ${bytes} bytes)"+}++assert_no_server_errors() {+ local name="$1" log="$2"+ if grep -qE "$RESOLUTION_ERROR_PATTERN" "$log" 2>/dev/null; then+ echo "--- matching lines ---" >&2+ grep -nE "$RESOLUTION_ERROR_PATTERN" "$log" | head -20 >&2+ fail "$name logged a module/runtime resolution error"+ return 1+ fi+ echo " $name log clean"+}++# --- build -------------------------------------------------------------------++detect_package_manager() {+ if [[ -f bun.lock ]]; then echo bun; else echo pnpm; fi+}++build_dashboard() {+ local package_manager="$1"+ echo "==> building apps/start (NITRO=1 SELF_HOSTED=1, via $package_manager)"+ if ! (+ cd apps/start &&+ NITRO=1 SELF_HOSTED=1 "$package_manager" run build+ ) >"$BUILD_LOG" 2>&1; then+ tail -60 "$BUILD_LOG" >&2+ die "apps/start build failed — see $BUILD_LOG"+ fi+ [[ -f "$SERVER_OUTPUT/index.mjs" ]] ||+ die "the build produced no $SERVER_OUTPUT/index.mjs"+ echo " built $SERVER_OUTPUT/index.mjs"+}++# apps/start/Dockerfile's runner stage, ported. The standalone Nitro output+# preserves the target package name for the esm-env -> esm-env-runtime+# override, so `esm-env` has to be made resolvable inside the SSR bundle.+apply_esm_env_shim() {+ local modules="$SERVER_OUTPUT/node_modules"+ [[ -d "$modules/esm-env-runtime" ]] ||+ die "$modules/esm-env-runtime is missing — the esm-env override did not survive the build"++ if [[ ! -d "$modules/esm-env" ]]; then+ mkdir -p "$modules/esm-env"+ cp "$modules/esm-env-runtime/node.js" "$modules/esm-env/index.js"+ printf '%s\n' \+ '{' \+ ' "name": "esm-env",' \+ ' "version": "1.1.4",' \+ ' "type": "module",' \+ ' "exports": "./index.js"' \+ '}' \+ >"$modules/esm-env/package.json"+ fi++ ( cd "$SERVER_OUTPUT" && node --input-type=module -e '+ const assert = await import("node:assert/strict");+ const env = await import("esm-env");+ assert.equal(env.BROWSER, false, "esm-env BROWSER should be false in the Node SSR runtime");+ assert.equal(env.NODE, true, "esm-env NODE should be true in the Node SSR runtime");+ assert.equal(env.DEV, false, "esm-env DEV should be false in the production runtime");+ ' ) || die 'the esm-env shim does not resolve to the Node runtime build'+ echo " esm-env resolves (BROWSER=false, NODE=true, DEV=false)"+}++# --- environment -------------------------------------------------------------++# The `app_env` block from .github/smoke/docker-compose.yml, with the compose+# service names replaced by this box's already-running services and the two+# URLs pointed at the ports this script just picked. The DATABASE/CLICKHOUSE+# values are the ISOLATED test databases, never the prod-copy `openpanel` ones.+export_smoke_app_env() {+ export NODE_ENV=production+ export SELF_HOSTED=true+ export BATCH_SIZE=5000+ export BATCH_INTERVAL=10000+ export ALLOW_REGISTRATION=true+ export ALLOW_INVITATION=true+ export REDIS_URL=redis://localhost:6379+ export CLICKHOUSE_URL=http://localhost:8123/openpanel_test+ export DATABASE_URL='postgresql://postgres:postgres@localhost:5432/openpanel_test?schema=public'+ export DATABASE_URL_DIRECT="$DATABASE_URL"+ export DASHBOARD_URL="http://localhost:$DASHBOARD_PORT"+ export API_URL="http://localhost:$API_PORT"+ export COOKIE_SECRET=p13-ssr-gate-cookie-secret-not-a-real-secret+ export [email protected]+ export RESEND_API_KEY=re_p13_ssr_gate_key+ export KAFKA_BROKERS=127.0.0.1:19092+ export KAFKA_EVENTS_TOPIC_PARTITIONS=24+}++# --- run ---------------------------------------------------------------------++mkdir -p "$RUN_DIR"+: >"$API_LOG"+: >"$DASHBOARD_LOG"++PACKAGE_MANAGER="$(detect_package_manager)"+build_dashboard "$PACKAGE_MANAGER"+apply_esm_env_shim++# .env supplies the vars the smoke block does not name (LOG_LEVEL, secrets,+# feature flags). It is sourced FIRST so that the smoke block and the two+# freshly-picked ports both override it — .env pins API_PORT=3333, and a gate+# that quietly used the developer's own api port would pass against a stack it+# did not start.+set -a+# shellcheck disable=SC1091+[[ -f .env ]] && source .env+set +a++API_PORT="$(free_port)"+DASHBOARD_PORT="$(free_port)"+[[ -n "$API_PORT" && -n "$DASHBOARD_PORT" ]] || die 'could not pick free ports'+export_smoke_app_env++echo "==> starting apps/api (ROLE=api) on :$API_PORT"+env ROLE=api API_PORT="$API_PORT" bun run "$API_ENTRYPOINT" >"$API_LOG" 2>&1 &+API_PID=$!+wait_ready api "http://localhost:$API_PORT/healthz/ready" \+ "$API_READY_TIMEOUT_SECONDS" "$API_PID"++echo "==> starting the dashboard SSR server on :$DASHBOARD_PORT"+# Nitro's node-server preset listens on PORT.+( cd apps/start && exec env PORT="$DASHBOARD_PORT" node .output/server/index.mjs ) \+ >"$DASHBOARD_LOG" 2>&1 &+DASHBOARD_PID=$!+wait_ready dashboard "$DASHBOARD_URL/api/healthcheck" \+ "$DASHBOARD_READY_TIMEOUT_SECONDS" "$DASHBOARD_PID"++echo "==> SSR rendering"+assert_ssr_route '/login'+assert_ssr_route '/onboarding'++echo "==> server logs"+assert_no_server_errors dashboard "$DASHBOARD_LOG"++if ((FAILED != 0)); then+ echo "p13-ssr: FAILED (logs in $RUN_DIR)" >&2+ exit 1+fi++echo "p13-ssr: PASSED (/login and /onboarding rendered; dashboard log clean)"diff --git a/tooling/publish/package.json b/tooling/publish/package.jsonindex 616de43f7..490877de7 100644--- a/tooling/publish/package.json+++ b/tooling/publish/package.json@@ -8,13 +8,13 @@"typecheck": "tsc --noEmit"},"dependencies": {- "arg": "^5.0.2",- "semver": "^7.5.4"+ "arg": "5.0.2",+ "semver": "7.6.0"},"devDependencies": {"@openpanel/tsconfig": "workspace:*","@types/node": "catalog:",- "@types/semver": "^7.5.4",+ "@types/semver": "7.5.7","typescript": "catalog:"}}diff --git a/tooling/scripts/pin-from-pnpm-lock.ts b/tooling/scripts/pin-from-pnpm-lock.tsnew file mode 100644index 000000000..6eca298fa--- /dev/null+++ b/tooling/scripts/pin-from-pnpm-lock.ts@@ -0,0 +1,504 @@+#!/usr/bin/env bun+/**+ * P13 groundwork (ADR-014): pin every declared range to the version+ * `pnpm-lock.yaml` already resolved for it.+ *+ * ADR-014's stop rule ends P13 the moment a pin cannot be reproduced under+ * bun, and bun 1.4.0 cannot read `pnpm-lock.yaml` — it re-resolves the whole+ * graph from the declared ranges. A caret in a manifest is therefore an+ * instruction to a resolver we are about to replace. Writing the resolved+ * version into the manifest turns each range into a fact the next installer+ * has to reproduce rather than a question it gets to answer.+ *+ * For every workspace importer in the lock this rewrites each+ * `dependencies` / `devDependencies` / `optionalDependencies` range in that+ * importer's package.json to the EXACT version the lock resolved FOR THAT+ * IMPORTER, pins every `catalog:` entry in `pnpm-workspace.yaml` the same way,+ * and carries the identical values into the lock's own `specifier:` fields so+ * the tree stays installable with `--frozen-lockfile`.+ *+ * Left alone, deliberately:+ * - `workspace:` / `catalog:` / `npm:` specifiers, which name a resolution+ * strategy rather than a range;+ * - `peerDependencies`, which are compatibility contracts (pnpm's+ * `autoInstallPeers: true` lists them under an importer's `dependencies`+ * in the lock even though the manifest declares them as peers);+ * - the two stale `prisma: ^5.1.1` devDeps ADR-017 rule 2 carves out by path+ * (see ADR_017_RULE_2_FROZEN below);+ * - every `version:` field in the lock. NOT ONE RESOLUTION MOVES.+ *+ * Why the lock's specifiers are rewritten here instead of by `pnpm install`:+ * a non-frozen `pnpm install` re-resolves the whole graph and dedupes it. On+ * this tree, on 2026-09-07, that pruned 142 package versions across 135+ * package names and added none — `@babel/core` collapsing from four copies to+ * two, `magicast` from three to two — which is real resolution movement in the+ * same commit that is supposed to prove nothing moved. Rewriting the specifier+ * fields is the mechanical, resolution-preserving half of what that install+ * would do; `pnpm install --frozen-lockfile` then verifies the result is+ * consistent. The full measurement is in+ * docs/BUN_INSTALL_RECIPE.md § Why the lock is edited, not refreshed.+ *+ * Edits are surgical — only the value on a matched line is replaced — so key+ * order, indentation and every comment survive byte-for-byte, and nothing is+ * written when a file would be unchanged. That is what makes a second run a+ * no-op.+ *+ * bun run tooling/scripts/pin-from-pnpm-lock.ts+ * bun run tooling/scripts/pin-from-pnpm-lock.ts --check # exit 1 if stale+ */++import { write, YAML } from 'bun';+import { readFileSync } from 'node:fs';+import { dirname, join, resolve } from 'node:path';+import { fileURLToPath } from 'node:url';++const REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../..');+const LOCKFILE = 'pnpm-lock.yaml';+const WORKSPACE_FILE = 'pnpm-workspace.yaml';++const DEPENDENCY_SECTIONS = [+ 'dependencies',+ 'devDependencies',+ 'optionalDependencies',+] as const;++/** Specifiers that name a resolution strategy rather than a version range. */+const PROTOCOL_SPECIFIER = /^(workspace|catalog|npm|link|file|git|github):/;++/** A resolved version we are willing to write: plain semver, nothing exotic. */+const PLAIN_VERSION = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/;++/**+ * ADR-017 rule 2 (ACCEPTED) names these two lines by path and rules that the+ * stale `prisma: ^5.1.1` devDeps "are to be **deleted, not aligned to 6.14**" —+ * i.e. touching their version is itself the wrong move, and the deletion belongs+ * to a CLEAN task. Pinning them to the 5.9.1 the lock resolved would be exactly+ * the aligning edit the ADR forbids, so the pinner leaves the manifest entry AND+ * its `specifier:` in the lock alone. Rule 3 is the general P13 pinning+ * permission; rule 2 is a specific, named exception to it.+ */+const ADR_017_RULE_2_FROZEN: ReadonlySet<string> = new Set([+ 'packages/redis\tdevDependencies\tprisma',+ 'packages/sdks/_info\tdevDependencies\tprisma',+]);++function isFrozenByAdr017Rule2(+ importerPath: string,+ section: string,+ name: string+): boolean {+ return ADR_017_RULE_2_FROZEN.has(`${importerPath}\t${section}\t${name}`);+}++/** The default catalog's name in the lockfile's `catalogs:` map. */+const DEFAULT_CATALOG = 'default';++const EXIT_STALE = 1;++interface LockEntry {+ specifier?: string;+ version?: string;+}+type LockImporter = Partial<Record<string, Record<string, LockEntry>>>;+interface Lockfile {+ importers?: Record<string, LockImporter>;+ catalogs?: Record<string, Record<string, LockEntry>>;+}++/** Every pin the run decided on, keyed for the lockfile rewrite. */+interface Pin {+ importer: string;+ section: string;+ name: string;+ version: string;+}+interface CatalogPin {+ catalog: string;+ name: string;+ version: string;+}++/**+ * pnpm records the peer-resolution suffix inline:+ * `1.4.30([email protected])`, `2.5.2(patch_hash=…)([email protected])`.+ * The version is everything before the first `(`.+ */+function exactVersion(lockVersion: string | undefined): string | null {+ if (!lockVersion) {+ return null;+ }+ const version = lockVersion.split('(')[0]?.trim() ?? '';+ return PLAIN_VERSION.test(version) ? version : null;+}++function escapeForRegExp(value: string): string {+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');+}++function readTextOrNull(relativePath: string): string | null {+ try {+ return readFileSync(join(REPO_ROOT, relativePath), 'utf8');+ } catch {+ return null;+ }+}++/** The `{ … }` slice of `text` that follows `"<section>":`, braces balanced. */+function findSectionBody(+ text: string,+ section: string+): { start: number; end: number } | null {+ const header = new RegExp(`"${section}"\\s*:\\s*\\{`).exec(text);+ if (!header) {+ return null;+ }+ const start = header.index + header[0].length;+ let depth = 1;+ for (let index = start; index < text.length; index++) {+ const char = text[index];+ if (char === '{') {+ depth++;+ } else if (char === '}') {+ depth--;+ if (depth === 0) {+ return { start, end: index };+ }+ }+ }+ return null;+}++/** Replaces the quoted range of `"<name>": "<range>"` inside one section. */+function pinInSection(+ text: string,+ section: string,+ name: string,+ version: string+): string {+ const body = findSectionBody(text, section);+ if (!body) {+ return text;+ }+ const entry = new RegExp(`("${escapeForRegExp(name)}"\\s*:\\s*")([^"]*)(")`);+ const slice = text.slice(body.start, body.end);+ return (+ text.slice(0, body.start) ++ slice.replace(entry, `$1${version}$3`) ++ text.slice(body.end)+ );+}++function manifestPathOf(importerPath: string): string {+ return importerPath === '.' ? 'package.json' : `${importerPath}/package.json`;+}++function pinManifest(+ importerPath: string,+ importer: LockImporter+): { path: string; text: string; pins: number; targets: Pin[] } | null {+ const relativePath = manifestPathOf(importerPath);+ const original = readTextOrNull(relativePath);+ if (original === null) {+ console.warn(`skip ${relativePath}: no such file`);+ return null;+ }++ const manifest = JSON.parse(original) as Partial<+ Record<string, Record<string, string>>+ >;+ let text = original;+ let pins = 0;+ const targets: Pin[] = [];++ for (const section of DEPENDENCY_SECTIONS) {+ for (const [name, entry] of Object.entries(importer[section] ?? {})) {+ const declared = manifest[section]?.[name];+ if (declared === undefined || PROTOCOL_SPECIFIER.test(declared)) {+ continue;+ }+ if (isFrozenByAdr017Rule2(importerPath, section, name)) {+ continue;+ }+ const version = exactVersion(entry.version);+ if (version === null) {+ continue;+ }+ // Recorded whether or not the manifest needs the edit: the lockfile's+ // own specifier has to reach the same value, and an already-pinned+ // manifest beside an unpinned lock is exactly the half-done state+ // `--frozen-lockfile` rejects.+ targets.push({ importer: importerPath, section, name, version });+ if (declared !== version) {+ text = pinInSection(text, section, name, version);+ pins++;+ }+ }+ }++ return targets.length === 0+ ? null+ : { path: relativePath, text, pins, targets };+}++/**+ * `pnpm-workspace.yaml` carries ~90 lines of comments recording the production+ * failure behind each pin, so the catalog is edited line by line rather than+ * re-serialized. Handles the default `catalog:` block and named `catalogs:`.+ */+function pinWorkspaceCatalogs(+ catalogs: Record<string, Record<string, LockEntry>>+): { path: string; text: string; pins: number; targets: CatalogPin[] } | null {+ const original = readTextOrNull(WORKSPACE_FILE);+ if (original === null) {+ return null;+ }++ const lines = original.split('\n');+ const targets: CatalogPin[] = [];+ let pins = 0;+ let catalog: string | null = null;+ let inNamedCatalogs = false;++ for (const [index, line] of lines.entries()) {+ if (/^catalog:\s*$/.test(line)) {+ catalog = DEFAULT_CATALOG;+ inNamedCatalogs = false;+ continue;+ }+ if (/^catalogs:\s*$/.test(line)) {+ catalog = null;+ inNamedCatalogs = true;+ continue;+ }+ if (/^[^\s#]/.test(line)) {+ catalog = null;+ inNamedCatalogs = false;+ continue;+ }+ if (inNamedCatalogs) {+ const named = /^ {2}(?:'([^']+)'|"([^"]+)"|([^\s:]+)):\s*$/.exec(line);+ if (named) {+ catalog = named[1] ?? named[2] ?? named[3] ?? null;+ }+ continue;+ }++ const entry =+ /^(\s+(?:'[^']+'|"[^"]+"|[^\s:]+):[ \t]*)(\S.*?)([ \t]*)$/.exec(line);+ if (catalog === null || !entry) {+ continue;+ }+ const key = /^\s*(?:'([^']+)'|"([^"]+)"|([^\s:]+)):/.exec(line);+ const name = key?.[1] ?? key?.[2] ?? key?.[3];+ if (!name) {+ continue;+ }+ const version = exactVersion(catalogs[catalog]?.[name]?.version);+ if (version === null) {+ continue;+ }+ targets.push({ catalog, name, version });+ if (entry[2] !== version) {+ lines[index] = `${entry[1]}${version}${entry[3]}`;+ pins++;+ }+ }++ return targets.length === 0+ ? null+ : { path: WORKSPACE_FILE, text: lines.join('\n'), pins, targets };+}++/**+ * Carries the manifest and catalog pins into the lock's `specifier:` fields.+ * Every `version:` line is left exactly as it was — this is a relabelling, not+ * a re-resolution. Walks the file as lines because the lock is ~1.4 MB of+ * hand-diffable YAML and a round-trip through a serializer would rewrite all+ * of it.+ */+function pinLockSpecifiers(+ pins: Pin[],+ catalogPins: CatalogPin[]+): { path: string; text: string; pins: number } | null {+ const original = readTextOrNull(LOCKFILE);+ if (original === null) {+ return null;+ }++ const wanted = new Map<string, string>();+ for (const pin of pins) {+ wanted.set(`i\t${pin.importer}\t${pin.section}\t${pin.name}`, pin.version);+ }+ for (const pin of catalogPins) {+ wanted.set(`c\t${pin.catalog}\t${pin.name}`, pin.version);+ }++ const lines = original.split('\n');+ let block: 'importers' | 'catalogs' | 'other' = 'other';+ let scope: string | null = null;+ let section: string | null = null;+ let name: string | null = null;+ const seen = { matched: 0, changed: 0 };++ const unquote = (raw: string) => raw.replace(/^['"]|['"]$/g, '');++ for (const [index, line] of lines.entries()) {+ if (/^[^\s#]/.test(line)) {+ block = line.startsWith('importers:')+ ? 'importers'+ : line.startsWith('catalogs:')+ ? 'catalogs'+ : 'other';+ scope = null;+ section = null;+ name = null;+ continue;+ }+ if (block === 'other' || line.trim() === '') {+ continue;+ }++ const indent = line.length - line.trimStart().length;+ const key = /^\s*(.+?):\s*$/.exec(line);++ if (block === 'importers') {+ if (indent === 2 && key) {+ scope = unquote(key[1] as string);+ section = null;+ name = null;+ continue;+ }+ if (indent === 4 && key) {+ section = unquote(key[1] as string);+ name = null;+ continue;+ }+ if (indent === 6 && key) {+ name = unquote(key[1] as string);+ continue;+ }+ if (indent === 8 && scope && section && name) {+ rewriteSpecifier(+ lines,+ index,+ wanted.get(`i\t${scope}\t${section}\t${name}`),+ seen+ );+ }+ continue;+ }++ if (indent === 2 && key) {+ scope = unquote(key[1] as string);+ name = null;+ continue;+ }+ if (indent === 4 && key) {+ name = unquote(key[1] as string);+ continue;+ }+ if (indent === 6 && scope && name) {+ rewriteSpecifier(lines, index, wanted.get(`c\t${scope}\t${name}`), seen);+ }+ }++ // Every pin must have been located, or the lock and the manifests would+ // disagree and `--frozen-lockfile` would reject the tree.+ if (seen.matched !== wanted.size) {+ throw new Error(+ `lockfile rewrite located ${seen.matched} of ${wanted.size} pins — refusing to write a half-updated ${LOCKFILE}`+ );+ }++ return seen.changed === 0+ ? null+ : { path: LOCKFILE, text: lines.join('\n'), pins: seen.changed };+}++/** Replaces `specifier: <range>` in place, counting what it saw and changed. */+function rewriteSpecifier(+ lines: string[],+ index: number,+ version: string | undefined,+ seen: { matched: number; changed: number }+): void {+ if (version === undefined) {+ return;+ }+ const specifier = /^(\s*specifier:\s*)(.*)$/.exec(lines[index] as string);+ if (!specifier) {+ return;+ }+ seen.matched++;+ if (specifier[2] === version) {+ return;+ }+ lines[index] = `${specifier[1]}${version}`;+ seen.changed++;+}++async function main(): Promise<number> {+ const checkOnly = process.argv.includes('--check');+ const lockText = readTextOrNull(LOCKFILE);+ if (lockText === null) {+ console.error(`FAIL: ${LOCKFILE} not found under ${REPO_ROOT}`);+ return EXIT_STALE;+ }+ const lock = YAML.parse(lockText) as Lockfile;++ const writes: Array<{ path: string; text: string; pins: number }> = [];+ const targets: Pin[] = [];++ for (const [importerPath, importer] of Object.entries(+ lock.importers ?? {}+ ).sort(([a], [b]) => a.localeCompare(b))) {+ const manifest = pinManifest(importerPath, importer);+ if (!manifest) {+ continue;+ }+ targets.push(...manifest.targets);+ if (manifest.pins > 0) {+ writes.push({+ path: manifest.path,+ text: manifest.text,+ pins: manifest.pins,+ });+ }+ }++ const workspace = pinWorkspaceCatalogs(lock.catalogs ?? {});+ if (workspace && workspace.pins > 0) {+ writes.push({+ path: workspace.path,+ text: workspace.text,+ pins: workspace.pins,+ });+ }++ const lockWrite = pinLockSpecifiers(targets, workspace?.targets ?? []);+ if (lockWrite) {+ writes.push(lockWrite);+ }++ if (writes.length === 0) {+ console.log('OK: every direct dependency already names its exact version.');+ return 0;+ }++ for (const pending of writes) {+ console.log(+ `${checkOnly ? 'STALE' : 'pinned'} ${String(pending.pins).padStart(4)} ${pending.path}`+ );+ if (!checkOnly) {+ await write(join(REPO_ROOT, pending.path), pending.text);+ }+ }++ const total = writes.reduce((sum, pending) => sum + pending.pins, 0);+ console.log(+ `${checkOnly ? 'STALE' : 'DONE'}: ${total} specifier(s) across ${writes.length} file(s).`+ );+ return checkOnly ? EXIT_STALE : 0;+}++process.exit(await main());diff --git a/tooling/scripts/write-p13-lock-snapshot.ts b/tooling/scripts/write-p13-lock-snapshot.tsnew file mode 100644index 000000000..f69cddf05--- /dev/null+++ b/tooling/scripts/write-p13-lock-snapshot.ts@@ -0,0 +1,115 @@+#!/usr/bin/env bun+/**+ * Writes `tooling/gates/p13-lock-snapshot.json` from `pnpm-lock.yaml`.+ *+ * The snapshot is the reference `tooling/gates/p13-drift.sh` compares an+ * installed tree against. It exists as a separate committed file because+ * M13-002 DELETES `pnpm-lock.yaml`: once the lock is gone there is nothing+ * left to say what pnpm had resolved, and "did the installer swap move+ * anything?" becomes unanswerable. This file outlives the lock.+ *+ * Shape:+ * { "<importer path>": { "<dependency>": "<exact version>" } }+ *+ * Every direct dependency of every workspace importer — `dependencies`,+ * `devDependencies` and `optionalDependencies` alike, registry copies and+ * `workspace:` links alike. Links are recorded at the linked package's own+ * `version`, which is what a correctly-linked `node_modules/<dep>/package.json`+ * reports; that is deliberate, because a resolver silently preferring the+ * REGISTRY copy of a workspace package over the local one is a real hazard+ * here (`apps/start` depends on `@openpanel/[email protected]` from npm while the+ * workspace source is 1.4.1-local) and the gate should see it.+ *+ * bun run tooling/scripts/write-p13-lock-snapshot.ts+ */++import { file, write, YAML } from 'bun';+import { readFileSync } from 'node:fs';+import { dirname, join, normalize, resolve } from 'node:path';+import { fileURLToPath } from 'node:url';++const REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../..');+const LOCKFILE = join(REPO_ROOT, 'pnpm-lock.yaml');+const SNAPSHOT = join(REPO_ROOT, 'tooling/gates/p13-lock-snapshot.json');++const DEPENDENCY_SECTIONS = [+ 'dependencies',+ 'devDependencies',+ 'optionalDependencies',+] as const;++const LINK_PREFIX = 'link:';++interface LockEntry {+ specifier?: string;+ version?: string;+}+interface Lockfile {+ importers?: Record<+ string,+ Partial<Record<string, Record<string, LockEntry>>>+ >;+}++/** `1.4.30([email protected])` and `2.5.2(patch_hash=…)(…)` both mean `x.y.z`. */+function registryVersion(lockVersion: string): string {+ return lockVersion.split('(')[0]?.trim() ?? '';+}++/** A `link:` target's version is the linked workspace package's own version. */+function linkedVersion(+ importerPath: string,+ lockVersion: string+): string | null {+ const target = normalize(+ join(+ importerPath === '.' ? '.' : importerPath,+ lockVersion.slice(LINK_PREFIX.length)+ )+ );+ try {+ const manifest = JSON.parse(+ readFileSync(join(REPO_ROOT, target, 'package.json'), 'utf8')+ ) as { version?: string };+ return manifest.version ?? null;+ } catch {+ return null;+ }+}++const lock = YAML.parse(await file(LOCKFILE).text()) as Lockfile;+const snapshot: Record<string, Record<string, string>> = {};++for (const importerPath of Object.keys(lock.importers ?? {}).sort()) {+ const importer = lock.importers?.[importerPath] ?? {};+ const direct: Record<string, string> = {};++ for (const section of DEPENDENCY_SECTIONS) {+ for (const name of Object.keys(importer[section] ?? {}).sort()) {+ const lockVersion = importer[section]?.[name]?.version;+ if (!lockVersion) {+ continue;+ }+ const version = lockVersion.startsWith(LINK_PREFIX)+ ? linkedVersion(importerPath, lockVersion)+ : registryVersion(lockVersion);+ if (version) {+ direct[name] = version;+ }+ }+ }++ snapshot[importerPath] = Object.fromEntries(+ Object.entries(direct).sort(([a], [b]) => (a < b ? -1 : 1))+ );+}++await write(SNAPSHOT, `${JSON.stringify(snapshot, null, 2)}\n`);++const total = Object.values(snapshot).reduce(+ (sum, deps) => sum + Object.keys(deps).length,+ 0+);+console.log(+ `wrote ${SNAPSHOT}: ${Object.keys(snapshot).length} importers, ${total} direct dependencies.`+);diff --git a/tooling/typescript/package.json b/tooling/typescript/package.jsonindex 47fd9a89a..3db24fdaf 100644--- a/tooling/typescript/package.json+++ b/tooling/typescript/package.json@@ -5,6 +5,6 @@"private": true,"files": ["base.json", "sdk.json", "tsup.config.json"],"devDependencies": {- "tsup": "^7.2.0"+ "tsup": "7.3.0"}}