@norskvideo/ctl-product-template-schema 0.1.32 → 0.1.33

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.
Files changed (3) hide show
  1. package/index.d.ts +10 -0
  2. package/index.js +18 -0
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -59,6 +59,10 @@ export declare const ProductTemplateHostTlsSchema: z.ZodObject<{
59
59
  services: z.ZodArray<z.ZodString>;
60
60
  }, z.core.$strip>;
61
61
  export type ProductTemplateHostTls = z.infer<typeof ProductTemplateHostTlsSchema>;
62
+ export declare const ProductTemplateWorkdirSchema: z.ZodObject<{
63
+ services: z.ZodArray<z.ZodString>;
64
+ }, z.core.$strip>;
65
+ export type ProductTemplateWorkdir = z.infer<typeof ProductTemplateWorkdirSchema>;
62
66
  export declare const ProductTemplateAcceleratorSchema: z.ZodEnum<{
63
67
  none: "none";
64
68
  nvidia: "nvidia";
@@ -320,6 +324,9 @@ export declare const ProductTemplateManifestSchema: z.ZodObject<{
320
324
  configPath: z.ZodString;
321
325
  }, z.core.$strict>]>>;
322
326
  }, z.core.$strict>>>;
327
+ workdir: z.ZodOptional<z.ZodObject<{
328
+ services: z.ZodArray<z.ZodString>;
329
+ }, z.core.$strip>>;
323
330
  hostTls: z.ZodOptional<z.ZodObject<{
324
331
  services: z.ZodArray<z.ZodString>;
325
332
  }, z.core.$strip>>;
@@ -558,6 +565,9 @@ export declare const ProductTemplateMaterialsSchema: z.ZodObject<{
558
565
  configPath: z.ZodString;
559
566
  }, z.core.$strict>]>>;
560
567
  }, z.core.$strict>>>;
568
+ workdir: z.ZodOptional<z.ZodObject<{
569
+ services: z.ZodArray<z.ZodString>;
570
+ }, z.core.$strip>>;
561
571
  hostTls: z.ZodOptional<z.ZodObject<{
562
572
  services: z.ZodArray<z.ZodString>;
563
573
  }, z.core.$strip>>;
package/index.js CHANGED
@@ -204,6 +204,21 @@ export const ProductTemplateHostTlsSchema = z
204
204
  }),
205
205
  })
206
206
  .meta({ id: "ProductTemplateHostTls", outputId: "ProductTemplateHostTls" });
207
+ // The instance working directory, handed to a product's own services. WHY THIS
208
+ // EXISTS: it is the one per-instance store that survives a relaunch (a named
209
+ // volume does not: relaunch tears down with `down -v`), and the runner mounts
210
+ // it at /data only into media and studio. A product whose own service keeps
211
+ // state -- a relay's state file and site key -- or writes files the engine must
212
+ // read (assets, recordings) needs the same directory at the same path. A
213
+ // product relying on it declares the runner capability `service-workdir`,
214
+ // since an older runner would ignore the field and lose the state.
215
+ export const ProductTemplateWorkdirSchema = z
216
+ .object({
217
+ services: z.array(z.string().min(1)).min(1).meta({
218
+ description: "Compose services that get the instance working directory, read-write at /data -- the same directory, at the same path, that media and studio have -- with NORSK_WORKDIR=/data. Each must be a service in the template's own compose.yml. It survives relaunch, restart and runner upgrade; only `instance delete --purge` removes it.",
219
+ }),
220
+ })
221
+ .meta({ id: "ProductTemplateWorkdir", outputId: "ProductTemplateWorkdir" });
207
222
  // Placement requirements guidance (requirements-authoring.md). Each dimension
208
223
  // the placer reasons over — capacity (vCPUs), cores, GPU, capabilities, host
209
224
  // ports — is optionally declared with a `mode`:
@@ -350,6 +365,9 @@ export const ProductTemplateManifestSchema = z
350
365
  description: "Host-port bindings whose value rides a product-template parameter. Opt-in per launch via the param value: absent = closed, 'auto' = allocate a free port from `preferred`, number = use it. When opened the port is published as a managed host binding and surfaced to the containers via compose interpolation. Alongside the per-param scalars the runner sets NORSK_ALLOCATED_PORTS: a JSON object keyed by param, each value {port, protocol, service?}, describing every opened port ('{}' when none opted in; unset when nothing is declared) — so a product needing the allocation as data maps one var instead of folding scalars into JSON via interpolation.",
351
366
  }),
352
367
  logs: ProductTemplateLogsSchema.optional(),
368
+ workdir: ProductTemplateWorkdirSchema.optional().meta({
369
+ description: "Mount the instance working directory at /data into the named compose services, as media and studio always have it -- for a product's own service that keeps state across relaunch or shares files with the engine. Absent = not mounted. Declare the runner capability `service-workdir` alongside it.",
370
+ }),
353
371
  hostTls: ProductTemplateHostTlsSchema.optional().meta({
354
372
  description: "Mount the host's TLS certificate and key, read-only, into the named compose services — for a product that serves TLS itself. Copied per launch, so a rotated certificate is picked up on relaunch. Absent = nothing mounted.",
355
373
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norskvideo/ctl-product-template-schema",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {