@plaintake/scenario 1.17.0 → 1.24.0

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.
@@ -0,0 +1,182 @@
1
+ import { z } from 'zod';
2
+ export declare const DiffCategorySchema: z.ZodEnum<{
3
+ step: "step";
4
+ assertion: "assertion";
5
+ "target-name": "target-name";
6
+ "target-role": "target-role";
7
+ "target-bounds": "target-bounds";
8
+ timing: "timing";
9
+ caption: "caption";
10
+ actor: "actor";
11
+ }>;
12
+ /** `fail` is structural drift a baseline gates on; `report` is printed and never fails. */
13
+ export declare const SeveritySchema: z.ZodEnum<{
14
+ fail: "fail";
15
+ report: "report";
16
+ }>;
17
+ export declare const DifferenceSchema: z.ZodObject<{
18
+ category: z.ZodEnum<{
19
+ step: "step";
20
+ assertion: "assertion";
21
+ "target-name": "target-name";
22
+ "target-role": "target-role";
23
+ "target-bounds": "target-bounds";
24
+ timing: "timing";
25
+ caption: "caption";
26
+ actor: "actor";
27
+ }>;
28
+ severity: z.ZodEnum<{
29
+ fail: "fail";
30
+ report: "report";
31
+ }>;
32
+ detail: z.ZodString;
33
+ }, z.core.$strip>;
34
+ /** Every field present and `null` when absent, so a baseline file shows the gap rather
35
+ * than silently omitting a key. */
36
+ export declare const SnapshotTargetSchema: z.ZodObject<{
37
+ role: z.ZodNullable<z.ZodString>;
38
+ accessibleName: z.ZodNullable<z.ZodString>;
39
+ rect: z.ZodNullable<z.ZodObject<{
40
+ x: z.ZodNumber;
41
+ y: z.ZodNumber;
42
+ width: z.ZodNumber;
43
+ height: z.ZodNumber;
44
+ }, z.core.$strip>>;
45
+ }, z.core.$strip>;
46
+ export declare const SnapshotStepSchema: z.ZodObject<{
47
+ stableId: z.ZodString;
48
+ target: z.ZodNullable<z.ZodObject<{
49
+ role: z.ZodNullable<z.ZodString>;
50
+ accessibleName: z.ZodNullable<z.ZodString>;
51
+ rect: z.ZodNullable<z.ZodObject<{
52
+ x: z.ZodNumber;
53
+ y: z.ZodNumber;
54
+ width: z.ZodNumber;
55
+ height: z.ZodNumber;
56
+ }, z.core.$strip>>;
57
+ }, z.core.$strip>>;
58
+ durationMs: z.ZodNullable<z.ZodNumber>;
59
+ }, z.core.$strip>;
60
+ export declare const SemanticSnapshotSchema: z.ZodObject<{
61
+ scenarioSha256: z.ZodNullable<z.ZodString>;
62
+ steps: z.ZodArray<z.ZodObject<{
63
+ stableId: z.ZodString;
64
+ target: z.ZodNullable<z.ZodObject<{
65
+ role: z.ZodNullable<z.ZodString>;
66
+ accessibleName: z.ZodNullable<z.ZodString>;
67
+ rect: z.ZodNullable<z.ZodObject<{
68
+ x: z.ZodNumber;
69
+ y: z.ZodNumber;
70
+ width: z.ZodNumber;
71
+ height: z.ZodNumber;
72
+ }, z.core.$strip>>;
73
+ }, z.core.$strip>>;
74
+ durationMs: z.ZodNullable<z.ZodNumber>;
75
+ }, z.core.$strip>>;
76
+ assertions: z.ZodArray<z.ZodObject<{
77
+ stableId: z.ZodString;
78
+ status: z.ZodEnum<{
79
+ passed: "passed";
80
+ failed: "failed";
81
+ }>;
82
+ }, z.core.$strip>>;
83
+ captions: z.ZodOptional<z.ZodArray<z.ZodObject<{
84
+ id: z.ZodString;
85
+ lines: z.ZodArray<z.ZodString>;
86
+ }, z.core.$strip>>>;
87
+ actors: z.ZodObject<{
88
+ ids: z.ZodArray<z.ZodString>;
89
+ turnOrder: z.ZodArray<z.ZodString>;
90
+ labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
91
+ id: z.ZodString;
92
+ label: z.ZodString;
93
+ }, z.core.$strip>>>;
94
+ }, z.core.$strip>;
95
+ }, z.core.$strip>;
96
+ export declare const BASELINE_SCHEMA = "plaintake.baseline/v1";
97
+ export declare const BaselineFileSchema: z.ZodObject<{
98
+ schema: z.ZodLiteral<"plaintake.baseline/v1">;
99
+ plaintakeVersion: z.ZodString;
100
+ snapshot: z.ZodObject<{
101
+ steps: z.ZodArray<z.ZodObject<{
102
+ stableId: z.ZodString;
103
+ target: z.ZodNullable<z.ZodObject<{
104
+ role: z.ZodNullable<z.ZodString>;
105
+ accessibleName: z.ZodNullable<z.ZodString>;
106
+ rect: z.ZodNullable<z.ZodObject<{
107
+ x: z.ZodNumber;
108
+ y: z.ZodNumber;
109
+ width: z.ZodNumber;
110
+ height: z.ZodNumber;
111
+ }, z.core.$strip>>;
112
+ }, z.core.$strip>>;
113
+ durationMs: z.ZodNullable<z.ZodNumber>;
114
+ }, z.core.$strip>>;
115
+ assertions: z.ZodArray<z.ZodObject<{
116
+ stableId: z.ZodString;
117
+ status: z.ZodEnum<{
118
+ passed: "passed";
119
+ failed: "failed";
120
+ }>;
121
+ }, z.core.$strip>>;
122
+ captions: z.ZodOptional<z.ZodArray<z.ZodObject<{
123
+ id: z.ZodString;
124
+ lines: z.ZodArray<z.ZodString>;
125
+ }, z.core.$strip>>>;
126
+ actors: z.ZodObject<{
127
+ ids: z.ZodArray<z.ZodString>;
128
+ turnOrder: z.ZodArray<z.ZodString>;
129
+ labels: z.ZodOptional<z.ZodArray<z.ZodObject<{
130
+ id: z.ZodString;
131
+ label: z.ZodString;
132
+ }, z.core.$strip>>>;
133
+ }, z.core.$strip>;
134
+ scenarioSha256: z.ZodString;
135
+ }, z.core.$strip>;
136
+ }, z.core.$strip>;
137
+ export declare const BaselineStatusSchema: z.ZodEnum<{
138
+ match: "match";
139
+ drift: "drift";
140
+ "scenario-changed": "scenario-changed";
141
+ absent: "absent";
142
+ skipped: "skipped";
143
+ updated: "updated";
144
+ }>;
145
+ /** The `baseline` field of a `check`/`run` result, and the body of `events/drift.json`. */
146
+ export declare const BaselineReportSchema: z.ZodObject<{
147
+ path: z.ZodString;
148
+ status: z.ZodEnum<{
149
+ match: "match";
150
+ drift: "drift";
151
+ "scenario-changed": "scenario-changed";
152
+ absent: "absent";
153
+ skipped: "skipped";
154
+ updated: "updated";
155
+ }>;
156
+ differences: z.ZodArray<z.ZodObject<{
157
+ category: z.ZodEnum<{
158
+ step: "step";
159
+ assertion: "assertion";
160
+ "target-name": "target-name";
161
+ "target-role": "target-role";
162
+ "target-bounds": "target-bounds";
163
+ timing: "timing";
164
+ caption: "caption";
165
+ actor: "actor";
166
+ }>;
167
+ severity: z.ZodEnum<{
168
+ fail: "fail";
169
+ report: "report";
170
+ }>;
171
+ detail: z.ZodString;
172
+ }, z.core.$strip>>;
173
+ }, z.core.$strip>;
174
+ export type DiffCategory = z.infer<typeof DiffCategorySchema>;
175
+ export type Severity = z.infer<typeof SeveritySchema>;
176
+ export type Difference = z.infer<typeof DifferenceSchema>;
177
+ export type SnapshotTarget = z.infer<typeof SnapshotTargetSchema>;
178
+ export type SnapshotStep = z.infer<typeof SnapshotStepSchema>;
179
+ export type SemanticSnapshot = z.infer<typeof SemanticSnapshotSchema>;
180
+ export type BaselineFile = z.infer<typeof BaselineFileSchema>;
181
+ export type BaselineStatus = z.infer<typeof BaselineStatusSchema>;
182
+ export type BaselineReport = z.infer<typeof BaselineReportSchema>;
@@ -6,6 +6,7 @@ export declare const EXIT_CODES: {
6
6
  readonly capture: 4;
7
7
  readonly render: 5;
8
8
  readonly verification: 6;
9
+ readonly drift: 7;
9
10
  };
10
11
  export type FailureKind = Exclude<keyof typeof EXIT_CODES, 'ok'>;
11
12
  /**
@@ -1,3 +1,4 @@
1
+ export * from './baseline.js';
1
2
  export * from './errors.js';
2
3
  export * from './event.js';
3
4
  export * from './json-schema.js';
@@ -376,8 +376,8 @@ export declare const SpeechClipSchema: z.ZodObject<{
376
376
  atMs: z.ZodNumber;
377
377
  durationMs: z.ZodNumber;
378
378
  source: z.ZodEnum<{
379
- explain: "explain";
380
379
  file: "file";
380
+ explain: "explain";
381
381
  synth: "synth";
382
382
  }>;
383
383
  voice: z.ZodOptional<z.ZodString>;
@@ -422,8 +422,8 @@ export declare const SpeechSchema: z.ZodObject<{
422
422
  atMs: z.ZodNumber;
423
423
  durationMs: z.ZodNumber;
424
424
  source: z.ZodEnum<{
425
- explain: "explain";
426
425
  file: "file";
426
+ explain: "explain";
427
427
  synth: "synth";
428
428
  }>;
429
429
  voice: z.ZodOptional<z.ZodString>;
@@ -721,8 +721,8 @@ export declare const RenderPlanSchema: z.ZodObject<{
721
721
  atMs: z.ZodNumber;
722
722
  durationMs: z.ZodNumber;
723
723
  source: z.ZodEnum<{
724
- explain: "explain";
725
724
  file: "file";
725
+ explain: "explain";
726
726
  synth: "synth";
727
727
  }>;
728
728
  voice: z.ZodOptional<z.ZodString>;
@@ -737,6 +737,7 @@ export declare const RenderPlanSchema: z.ZodObject<{
737
737
  theme: z.ZodOptional<z.ZodObject<{
738
738
  accentColor: z.ZodString;
739
739
  }, z.core.$strip>>;
740
+ outputPath: z.ZodOptional<z.ZodString>;
740
741
  actors: z.ZodOptional<z.ZodArray<z.ZodObject<{
741
742
  id: z.ZodString;
742
743
  label: z.ZodString;
@@ -48,6 +48,34 @@ export declare const RunCommandResultSchema: z.ZodObject<{
48
48
  bytes: z.ZodNumber;
49
49
  }, z.core.$strip>>;
50
50
  archivedPath: z.ZodOptional<z.ZodString>;
51
+ baseline: z.ZodOptional<z.ZodObject<{
52
+ path: z.ZodString;
53
+ status: z.ZodEnum<{
54
+ match: "match";
55
+ drift: "drift";
56
+ "scenario-changed": "scenario-changed";
57
+ absent: "absent";
58
+ skipped: "skipped";
59
+ updated: "updated";
60
+ }>;
61
+ differences: z.ZodArray<z.ZodObject<{
62
+ category: z.ZodEnum<{
63
+ step: "step";
64
+ assertion: "assertion";
65
+ "target-name": "target-name";
66
+ "target-role": "target-role";
67
+ "target-bounds": "target-bounds";
68
+ timing: "timing";
69
+ caption: "caption";
70
+ actor: "actor";
71
+ }>;
72
+ severity: z.ZodEnum<{
73
+ fail: "fail";
74
+ report: "report";
75
+ }>;
76
+ detail: z.ZodString;
77
+ }, z.core.$strip>>;
78
+ }, z.core.$strip>>;
51
79
  schema: z.ZodLiteral<"agent-demo.result/v1">;
52
80
  kind: z.ZodLiteral<"run">;
53
81
  ok: z.ZodBoolean;
@@ -72,6 +100,34 @@ export declare const CheckCommandResultSchema: z.ZodObject<{
72
100
  cueId: z.ZodString;
73
101
  detail: z.ZodString;
74
102
  }, z.core.$strip>>;
103
+ baseline: z.ZodOptional<z.ZodObject<{
104
+ path: z.ZodString;
105
+ status: z.ZodEnum<{
106
+ match: "match";
107
+ drift: "drift";
108
+ "scenario-changed": "scenario-changed";
109
+ absent: "absent";
110
+ skipped: "skipped";
111
+ updated: "updated";
112
+ }>;
113
+ differences: z.ZodArray<z.ZodObject<{
114
+ category: z.ZodEnum<{
115
+ step: "step";
116
+ assertion: "assertion";
117
+ "target-name": "target-name";
118
+ "target-role": "target-role";
119
+ "target-bounds": "target-bounds";
120
+ timing: "timing";
121
+ caption: "caption";
122
+ actor: "actor";
123
+ }>;
124
+ severity: z.ZodEnum<{
125
+ fail: "fail";
126
+ report: "report";
127
+ }>;
128
+ detail: z.ZodString;
129
+ }, z.core.$strip>>;
130
+ }, z.core.$strip>>;
75
131
  schema: z.ZodLiteral<"agent-demo.result/v1">;
76
132
  kind: z.ZodLiteral<"check">;
77
133
  ok: z.ZodBoolean;
@@ -244,12 +300,18 @@ export declare const DiffCommandResultSchema: z.ZodObject<{
244
300
  identical: z.ZodBoolean;
245
301
  differences: z.ZodArray<z.ZodObject<{
246
302
  category: z.ZodEnum<{
247
- assertion: "assertion";
248
- target: "target";
249
- actor: "actor";
250
303
  step: "step";
304
+ assertion: "assertion";
305
+ "target-name": "target-name";
306
+ "target-role": "target-role";
307
+ "target-bounds": "target-bounds";
251
308
  timing: "timing";
252
309
  caption: "caption";
310
+ actor: "actor";
311
+ }>;
312
+ severity: z.ZodEnum<{
313
+ fail: "fail";
314
+ report: "report";
253
315
  }>;
254
316
  detail: z.ZodString;
255
317
  }, z.core.$strip>>;
@@ -511,6 +573,46 @@ export declare const LicenceResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
511
573
  ok: z.ZodBoolean;
512
574
  problems: z.ZodArray<z.ZodString>;
513
575
  }, z.core.$strip>], "tier">;
576
+ /**
577
+ * A share that either landed or did not. Discriminated on `ok` because the two halves
578
+ * carry disjoint facts: a failure has a `reason` to switch on, a success has the link —
579
+ * and a caller reading one should never have to wonder whether the other is lying.
580
+ *
581
+ * The success `videoId` is the share service's content-derived id (first 16 bytes of the
582
+ * MP4's sha256, base32), not a plaintake id, so its shape is asserted here rather than
583
+ * borrowed from a bundle schema.
584
+ */
585
+ export declare const PublishResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
586
+ ok: z.ZodLiteral<false>;
587
+ reason: z.ZodEnum<{
588
+ "unexpected-response": "unexpected-response";
589
+ "no-endpoint": "no-endpoint";
590
+ "no-key": "no-key";
591
+ "invalid-store": "invalid-store";
592
+ "not-a-bundle": "not-a-bundle";
593
+ unauthorized: "unauthorized";
594
+ unreachable: "unreachable";
595
+ "hash-mismatch": "hash-mismatch";
596
+ "length-mismatch": "length-mismatch";
597
+ conflict: "conflict";
598
+ }>;
599
+ schema: z.ZodLiteral<"agent-demo.result/v1">;
600
+ kind: z.ZodLiteral<"publish">;
601
+ problems: z.ZodArray<z.ZodString>;
602
+ }, z.core.$strip>, z.ZodObject<{
603
+ ok: z.ZodLiteral<true>;
604
+ videoId: z.ZodString;
605
+ url: z.ZodString;
606
+ uploaded: z.ZodBoolean;
607
+ remembered: z.ZodOptional<z.ZodBoolean>;
608
+ expiresAt: z.ZodOptional<z.ZodString>;
609
+ captions: z.ZodBoolean;
610
+ chapters: z.ZodBoolean;
611
+ poster: z.ZodBoolean;
612
+ schema: z.ZodLiteral<"agent-demo.result/v1">;
613
+ kind: z.ZodLiteral<"publish">;
614
+ problems: z.ZodArray<z.ZodString>;
615
+ }, z.core.$strip>], "ok">;
514
616
  export type ArtifactRef = z.infer<typeof ArtifactRefSchema>;
515
617
  export type ValidationResult = z.infer<typeof ValidationResultSchema>;
516
618
  export type RunCommandResult = z.infer<typeof RunCommandResultSchema>;
@@ -527,7 +629,8 @@ export type InspectResult = z.infer<typeof InspectResultSchema>;
527
629
  export type DoctorResult = z.infer<typeof DoctorResultSchema>;
528
630
  export type ActivateResult = z.infer<typeof ActivateResultSchema>;
529
631
  export type LicenceResult = z.infer<typeof LicenceResultSchema>;
530
- export type DemoResult = ValidationResult | RunCommandResult | CheckCommandResult | RenderCommandResult | VerificationReport | WarmCommandResult | DiffCommandResult | CompareCommandResult | InitResult | PruneCommandResult | ImportCommandResult | InspectResult | DoctorResult | ActivateResult | LicenceResult;
632
+ export type PublishResult = z.infer<typeof PublishResultSchema>;
633
+ export type DemoResult = ValidationResult | RunCommandResult | CheckCommandResult | RenderCommandResult | VerificationReport | WarmCommandResult | DiffCommandResult | CompareCommandResult | InitResult | PruneCommandResult | ImportCommandResult | InspectResult | DoctorResult | ActivateResult | LicenceResult | PublishResult;
531
634
  /**
532
635
  * Renders a filesystem location for display in a result, relative to `root` when it
533
636
  * lies inside it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaintake/scenario",
3
- "version": "1.17.0",
3
+ "version": "1.24.0",
4
4
  "description": "Authoring SDK for PlainTake demo scenarios: defineDemo and the scenario DSL types. Install for editor autocomplete; the PlainTake binary ships a runtime fallback.",
5
5
  "license": "MIT",
6
6
  "type": "module",