@norskvideo/ctl-dev-kit 0.2.128 → 0.2.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,10 +96,11 @@
96
96
  the dev-kit source and re-sync.
97
97
  - **CI runs the norsk-ctl this repo pins** (`flake.nix` `ctlVersion`), never S3's
98
98
  moving `latest`; only a `ctl-candidate` run tests a channel (`rc`). One nightly
99
- bump, `bump.yml`, moves the dev-kit, the ctl-* and moq-* packages, and the
100
- engine/Studio/norsk-ctl pins together, and never pushes to main: it opens one PR
101
- on `bump/nightly`, and `bot-prs` merges it once checks, smoke, integration and
102
- the guides gate (build-image) are green on it. A red bump PR is the alarm for a
99
+ bump, `bump.yml`, moves the dev-kit, the ctl-* and moq-* packages (with zod,
100
+ to exactly the version they declare), and the engine/Studio/norsk-ctl pins
101
+ together, and never pushes to main: it opens one PR on `bump/nightly`, and
102
+ `bot-prs` merges it once checks, smoke, integration and the guides gate
103
+ (build-image) are green on it. A red bump PR is the alarm for a
103
104
  bad upstream change, and names what moved; main stays green. To land the rest
104
105
  without a bad component: `gh workflow run bump.yml -f components=<the others>`
105
106
  (`dev-kit`, `ctl-packages`, `pins`).
@@ -226,6 +226,13 @@ jobs:
226
226
  [ -n "$v" ] || refuse "could not resolve @norskvideo/$short latest"
227
227
  latest[$short]="$v"
228
228
  done
229
+ # zod moves with this family. zod-singleton.ts requires a product's
230
+ # one zod to be exactly the zod the ctl-* packages declare, so moving
231
+ # their pins without it would fail that gate in every product the
232
+ # night a new ctl-sdk declares a new zod. Resolved here, before
233
+ # anything is rewritten, so an unreadable answer refuses the step.
234
+ zod="$(curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 "$reg/@norskvideo%2Fctl-sdk/${latest[ctl-sdk]}" | jq -r '.dependencies.zod // empty' || true)"
235
+ [ -n "$zod" ] || refuse "could not resolve the zod @norskvideo/ctl-sdk ${latest[ctl-sdk]} declares"
229
236
 
230
237
  # Every tracked package.json, not just the root: a repo can pin the
231
238
  # same package in a nested workspace (playout pins the harness twice),
@@ -259,6 +266,22 @@ jobs:
259
266
  done
260
267
  for v in $moq; do parts+=("moq \`$v\`"); done
261
268
 
269
+ # Exactly the version, in every manifest that declares zod (root
270
+ # overrides and workspace dependencies alike), as create-product
271
+ # emits it. workspace:, file: and link: values are not versions and
272
+ # stay as they are.
273
+ zhit=0
274
+ for m in "${manifests[@]}"; do
275
+ for old in $(grep -oE '"zod"[[:space:]]*:[[:space:]]*"[~^]?[0-9][^"]*"' "$m" | sed -E 's/.*"([^"]*)"$/\1/' | sort -u); do
276
+ [ "$old" != "$zod" ] || continue
277
+ echo "$m: zod $old -> $zod"
278
+ moved+=("- zod: $old -> $zod ($m)")
279
+ zhit=1
280
+ done
281
+ sed -i -E "s|(\"zod\"[[:space:]]*:[[:space:]]*\")[~^]?[0-9][^\"]*(\")|\1$zod\2|g" "$m"
282
+ done
283
+ [ "$zhit" = 0 ] || parts+=("zod \`$zod\`")
284
+
262
285
  if [ ${#moved[@]} -eq 0 ]; then
263
286
  echo "every ctl-* and moq-* pin is already on its newest published version."
264
287
  { echo "changed=0"; echo "summary="; echo "refused="; } >> "$GITHUB_OUTPUT"
@@ -3,7 +3,8 @@
3
3
  # run and one PR:
4
4
  # 1. dev-kit: @norskvideo/ctl-dev-kit to npm `latest`, and every convention
5
5
  # copy re-synced from it (sync-drift) -- this workflow included;
6
- # 2. ctl-packages: the @norskvideo/ctl-* and moq-* family to npm `latest`;
6
+ # 2. ctl-packages: the @norskvideo/ctl-* and moq-* family to npm `latest`,
7
+ # and every zod pin to exactly the zod ctl-sdk declares;
7
8
  # 3. pins: the engine and Studio image pair from the nightly entry of
8
9
  # norsk-studio's channel manifest, and flake.nix's norsk-ctl pin to the
9
10
  # `rc` channel (hourly builds of main that passed ctl's release checks;
@@ -251,6 +252,13 @@ jobs:
251
252
  [ -n "$v" ] || refuse "could not resolve @norskvideo/$short latest"
252
253
  latest[$short]="$v"
253
254
  done
255
+ # zod moves with this family. zod-singleton.ts requires a product's
256
+ # one zod to be exactly the zod the ctl-* packages declare, so moving
257
+ # their pins without it would fail that gate in every product the
258
+ # night a new ctl-sdk declares a new zod. Resolved here, before
259
+ # anything is rewritten, so an unreadable answer refuses the step.
260
+ zod="$(curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 "$reg/@norskvideo%2Fctl-sdk/${latest[ctl-sdk]}" | jq -r '.dependencies.zod // empty' || true)"
261
+ [ -n "$zod" ] || refuse "could not resolve the zod @norskvideo/ctl-sdk ${latest[ctl-sdk]} declares"
254
262
 
255
263
  # Every tracked package.json, not just the root: a repo can pin the
256
264
  # same package in a nested workspace (playout pins the harness twice),
@@ -284,6 +292,22 @@ jobs:
284
292
  done
285
293
  for v in $moq; do parts+=("moq \`$v\`"); done
286
294
 
295
+ # Exactly the version, in every manifest that declares zod (root
296
+ # overrides and workspace dependencies alike), as create-product
297
+ # emits it. workspace:, file: and link: values are not versions and
298
+ # stay as they are.
299
+ zhit=0
300
+ for m in "${manifests[@]}"; do
301
+ for old in $(grep -oE '"zod"[[:space:]]*:[[:space:]]*"[~^]?[0-9][^"]*"' "$m" | sed -E 's/.*"([^"]*)"$/\1/' | sort -u); do
302
+ [ "$old" != "$zod" ] || continue
303
+ echo "$m: zod $old -> $zod"
304
+ moved+=("- zod: $old -> $zod ($m)")
305
+ zhit=1
306
+ done
307
+ sed -i -E "s|(\"zod\"[[:space:]]*:[[:space:]]*\")[~^]?[0-9][^\"]*(\")|\1$zod\2|g" "$m"
308
+ done
309
+ [ "$zhit" = 0 ] || parts+=("zod \`$zod\`")
310
+
287
311
  if [ ${#moved[@]} -eq 0 ]; then
288
312
  echo "every ctl-* and moq-* pin is already on its newest published version."
289
313
  { echo "changed=0"; echo "summary="; echo "refused="; } >> "$GITHUB_OUTPUT"
@@ -4,13 +4,12 @@
4
4
  //
5
5
  // norsk-studio consolidated onto one hoisted zod 4 (2026-08) and guards it with
6
6
  // its own scripts/check-zod-singleton.mjs — but that guard is repo-local and was
7
- // never shipped, so the products are the one layer where studio's `zod ^4.4.3`,
8
- // norsk-ctl's exact `zod 4.4.3` (pinned for @modelcontextprotocol/sdk) and
9
- // @norskvideo/moq-watch's `zod ^4.5.4` all meet, with the loosest declared range
10
- // (`^4.3.6`) and nothing checking the result. That is how probe went red and how
11
- // funke/reuters ended up latently split: the tree resolves TWO zod instances and
12
- // a schema handed across the boundary (e.g. ManifestSchema from ctl-sdk into
13
- // zod-openapi) stops typechecking.
7
+ // never shipped, so the products are the one layer where studio's zod range,
8
+ // norsk-ctl's exact zod pin and @norskvideo/moq-watch's range all meet, with
9
+ // the loosest declared range (`^4.3.6`) and nothing checking the result. That
10
+ // is how probe went red and how funke/reuters ended up latently split: the tree
11
+ // resolves TWO zod instances and a schema handed across the boundary (e.g.
12
+ // ManifestSchema from ctl-sdk into zod-openapi) stops typechecking.
14
13
  //
15
14
  // This is the products' analogue of that guard, run in the `checks` quality job
16
15
  // (conventions/checks.yml) the same way as check-drift.ts — invoked by its
@@ -20,9 +19,11 @@
20
19
  // zod 3.x (a dev-only tool npm/bun isolates) is tolerated and only noted. Any
21
20
  // second distinct 4.x — the split — fails, and the fix is a single-version pin
22
21
  // in the root package.json `overrides`, matching the exact zod the @norskvideo/ctl-*
23
- // packages depend on (create-product emits it as PRODUCT_ZOD). That is 4.4.3:
24
- // @modelcontextprotocol/sdk does not work with 4.5 whatever its range says, so
25
- // do not pin products up past it.
22
+ // packages depend on (create-product emits it as PRODUCT_ZOD). Products follow
23
+ // that pin: the nightly bump (bump.yml) moves zod with the ctl-* pins. (zod 4.5+ renders a schema with a
24
+ // root registry id as a bare `$ref`, which the MCP client rejects as a tool's
25
+ // inputSchema; norsk-ctl strips the root id with `withoutRootId` before it
26
+ // registers a tool, so that is no reason to hold zod back.)
26
27
 
27
28
  import { existsSync, readFileSync } from "node:fs";
28
29
  import { join } from "node:path";
@@ -120,8 +121,7 @@ export function checkZodSingleton(repoRoot: string): ZodSingletonResult {
120
121
  errors.push(`bun.lock: unexpected zod ${v} (${keys.join(", ")}) — only zod 4 is permitted`);
121
122
  }
122
123
 
123
- // The ctl-* packages pin zod exactly (4.4.3: @modelcontextprotocol/sdk does not
124
- // work with 4.5 whatever its range says). A product's one zod must be that one.
124
+ // The ctl-* packages pin zod exactly. A product's one zod must be that one.
125
125
  const required = ctlZod.size === 1 ? [...ctlZod.keys()][0] : undefined;
126
126
  if (ctlZod.size > 1) {
127
127
  const detail = [...ctlZod].map(([v, pkgs]) => ` zod ${v}: ${pkgs.join(", ")}`).join("\n");
@@ -74,12 +74,23 @@ export interface GeneratedFile {
74
74
  executable?: boolean;
75
75
  }
76
76
 
77
+ /** `norsk-acme` -> `Norsk Acme`: the install name as screens show it. */
78
+ export function productTitle(name: string): string {
79
+ return name
80
+ .split("-")
81
+ .filter((part) => part.length > 0)
82
+ .map((part) => part[0].toUpperCase() + part.slice(1))
83
+ .join(" ");
84
+ }
85
+
77
86
  export interface ShapeContext {
78
87
  name: string;
79
88
  /** Workspace scope, `@<name>`. */
80
89
  scope: string;
81
90
  /** `product:` value for the shared workflows — `name` minus the `norsk-` prefix. */
82
91
  dashboardKey: string;
92
+ /** Human product title for screens, e.g. `Norsk Acme`. */
93
+ title: string;
83
94
  devPort: number;
84
95
  pins: { mediaImage: string; studioImage: string; studioLib: string; mediaLib: string };
85
96
  canon: Canon;
@@ -157,8 +168,7 @@ const DEFAULT_STUDIO_LIB = devKitPin(devKitPackageJson, "@norskvideo/norsk-studi
157
168
  * and declared by every workspace that uses zod. Derived from the dev-kit's own
158
169
  * pin, the same exact version the published ctl-* packages depend on, so the
159
170
  * product's tree dedupes onto it instead of splitting beside a newer zod and
160
- * failing conventions/zod-singleton.ts on day one. It is held at 4.4.3 because
161
- * @modelcontextprotocol/sdk does not work with 4.5 despite its declared range. */
171
+ * failing conventions/zod-singleton.ts on day one. */
162
172
  export const PRODUCT_ZOD = devKitPin(devKitPackageJson, "zod");
163
173
 
164
174
  const bareTag = (ref: string) => ref.slice(ref.lastIndexOf(":") + 1);
@@ -211,6 +221,7 @@ export function shapeContext(opts: CreateProductOptions): ShapeContext {
211
221
  name: opts.name,
212
222
  scope: `@${opts.name}`,
213
223
  dashboardKey: opts.name.replace(/^norsk-/, ""),
224
+ title: productTitle(opts.name),
214
225
  devPort: opts.devPort ?? 4323,
215
226
  pins: {
216
227
  mediaImage,
@@ -112,7 +112,7 @@ function indexHtml(ctx: ShapeContext): string {
112
112
  <head>
113
113
  <meta charset="UTF-8" />
114
114
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
115
- <title>${ctx.name} — Operator</title>
115
+ <title>${ctx.title}</title>
116
116
  </head>
117
117
  <body>
118
118
  <div id="root"></div>
@@ -93,7 +93,7 @@ function indexHtml(ctx: ShapeContext): string {
93
93
  <head>
94
94
  <meta charset="UTF-8" />
95
95
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
96
- <title>${ctx.name} — configure</title>
96
+ <title>${ctx.title} — configure</title>
97
97
  </head>
98
98
  <body>
99
99
  <div id="root"></div>
@@ -130,7 +130,7 @@ function appTsx(ctx: ShapeContext): string {
130
130
  export default function App() {
131
131
  return (
132
132
  <main>
133
- <h1>${ctx.name}</h1>
133
+ <h1>${ctx.title}</h1>
134
134
  <p>
135
135
  The starter template needs no configuration. Launch it from norsk-ctl to bring up the Studio + Norsk stack this
136
136
  product composes.
@@ -151,7 +151,7 @@ import App from "./App.tsx";
151
151
 
152
152
  test("names the product", () => {
153
153
  render(<App />);
154
- expect(screen.getByRole("heading", { name: "${ctx.name}" })).toBeInTheDocument();
154
+ expect(screen.getByRole("heading", { name: "${ctx.title}" })).toBeInTheDocument();
155
155
  });
156
156
  `;
157
157
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-dev-kit",
3
- "version": "0.2.128",
3
+ "version": "0.2.130",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -67,7 +67,7 @@
67
67
  "vite": "^8.3.5",
68
68
  "vitest": "^4.1.12",
69
69
  "yaml": "^2.8.0",
70
- "zod": "4.4.3"
70
+ "zod": "4.6.7"
71
71
  },
72
72
  "peerDependenciesMeta": {
73
73
  "@playwright/test": {