playhead-cli 0.1.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.
- package/Dockerfile +24 -0
- package/LICENSE +21 -0
- package/README.md +184 -0
- package/action.yml +71 -0
- package/dist/audio/mux.d.ts +29 -0
- package/dist/audio/mux.d.ts.map +1 -0
- package/dist/audio/timing.d.ts +6 -0
- package/dist/audio/timing.d.ts.map +1 -0
- package/dist/audio/tts.d.ts +23 -0
- package/dist/audio/tts.d.ts.map +1 -0
- package/dist/authoring/author.d.ts +40 -0
- package/dist/authoring/author.d.ts.map +1 -0
- package/dist/authoring/catalog.d.ts +31 -0
- package/dist/authoring/catalog.d.ts.map +1 -0
- package/dist/authoring/explore.d.ts +30 -0
- package/dist/authoring/explore.d.ts.map +1 -0
- package/dist/authoring/serialize.d.ts +26 -0
- package/dist/authoring/serialize.d.ts.map +1 -0
- package/dist/authoring/validate.d.ts +31 -0
- package/dist/authoring/validate.d.ts.map +1 -0
- package/dist/beforeafter.d.ts +25 -0
- package/dist/beforeafter.d.ts.map +1 -0
- package/dist/bundle/hash.d.ts +3 -0
- package/dist/bundle/hash.d.ts.map +1 -0
- package/dist/bundle/reader.d.ts +6 -0
- package/dist/bundle/reader.d.ts.map +1 -0
- package/dist/bundle/types.d.ts +54 -0
- package/dist/bundle/types.d.ts.map +1 -0
- package/dist/bundle/writer.d.ts +35 -0
- package/dist/bundle/writer.d.ts.map +1 -0
- package/dist/capture/driver-api.d.ts +190 -0
- package/dist/capture/driver-api.d.ts.map +1 -0
- package/dist/capture/events.d.ts +78 -0
- package/dist/capture/events.d.ts.map +1 -0
- package/dist/capture/executor.d.ts +19 -0
- package/dist/capture/executor.d.ts.map +1 -0
- package/dist/capture/playwright-driver.d.ts +122 -0
- package/dist/capture/playwright-driver.d.ts.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +6648 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compose/camera/interpolate.d.ts +9 -0
- package/dist/compose/camera/interpolate.d.ts.map +1 -0
- package/dist/compose/camera/planner.d.ts +19 -0
- package/dist/compose/camera/planner.d.ts.map +1 -0
- package/dist/compose/captions.d.ts +22 -0
- package/dist/compose/captions.d.ts.map +1 -0
- package/dist/compose/cursor/path.d.ts +17 -0
- package/dist/compose/cursor/path.d.ts.map +1 -0
- package/dist/compose/cursor/render.d.ts +10 -0
- package/dist/compose/cursor/render.d.ts.map +1 -0
- package/dist/compose/index.d.ts +25 -0
- package/dist/compose/index.d.ts.map +1 -0
- package/dist/compose/kinds.d.ts +27 -0
- package/dist/compose/kinds.d.ts.map +1 -0
- package/dist/compose/overlays/build.d.ts +7 -0
- package/dist/compose/overlays/build.d.ts.map +1 -0
- package/dist/compose/overlays/draw.d.ts +12 -0
- package/dist/compose/overlays/draw.d.ts.map +1 -0
- package/dist/compose/overlays/text.d.ts +18 -0
- package/dist/compose/overlays/text.d.ts.map +1 -0
- package/dist/compose/render/encoder.d.ts +13 -0
- package/dist/compose/render/encoder.d.ts.map +1 -0
- package/dist/compose/render/frameStore.d.ts +27 -0
- package/dist/compose/render/frameStore.d.ts.map +1 -0
- package/dist/compose/render/renderer.d.ts +5 -0
- package/dist/compose/render/renderer.d.ts.map +1 -0
- package/dist/compose/timeline/pacing.d.ts +36 -0
- package/dist/compose/timeline/pacing.d.ts.map +1 -0
- package/dist/compose/types.d.ts +236 -0
- package/dist/compose/types.d.ts.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4963 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/jira.d.ts +44 -0
- package/dist/integrations/jira.d.ts.map +1 -0
- package/dist/mcp/bin.d.ts +3 -0
- package/dist/mcp/bin.d.ts.map +1 -0
- package/dist/mcp/bin.js +5749 -0
- package/dist/mcp/bin.js.map +1 -0
- package/dist/mcp/server.d.ts +10 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/shared/easing.d.ts +9 -0
- package/dist/shared/easing.d.ts.map +1 -0
- package/dist/shared/exit.d.ts +32 -0
- package/dist/shared/exit.d.ts.map +1 -0
- package/dist/shared/ffmpeg.d.ts +19 -0
- package/dist/shared/ffmpeg.d.ts.map +1 -0
- package/dist/shared/geometry.d.ts +47 -0
- package/dist/shared/geometry.d.ts.map +1 -0
- package/dist/shared/log.d.ts +10 -0
- package/dist/shared/log.d.ts.map +1 -0
- package/dist/shared/version.d.ts +4 -0
- package/dist/shared/version.d.ts.map +1 -0
- package/dist/spec/locators.d.ts +62 -0
- package/dist/spec/locators.d.ts.map +1 -0
- package/dist/spec/parse.d.ts +16 -0
- package/dist/spec/parse.d.ts.map +1 -0
- package/dist/spec/schema.d.ts +365 -0
- package/dist/spec/schema.d.ts.map +1 -0
- package/dist/theme/index.d.ts +23 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/verify/checks.d.ts +27 -0
- package/dist/verify/checks.d.ts.map +1 -0
- package/dist/verify/contact-sheet.d.ts +7 -0
- package/dist/verify/contact-sheet.d.ts.map +1 -0
- package/dist/verify/media.d.ts +42 -0
- package/dist/verify/media.d.ts.map +1 -0
- package/dist/verify/report.d.ts +12 -0
- package/dist/verify/report.d.ts.map +1 -0
- package/dist/verify/runner.d.ts +13 -0
- package/dist/verify/runner.d.ts.map +1 -0
- package/dist/verify/types.d.ts +63 -0
- package/dist/verify/types.d.ts.map +1 -0
- package/dist/verify/vision.d.ts +19 -0
- package/dist/verify/vision.d.ts.map +1 -0
- package/package.json +74 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
/**
|
|
3
|
+
* Playhead as a set of tools any coding agent can call. The agent grounds its spec with
|
|
4
|
+
* `playhead_explore`, renders with `playhead_render`, and iterates on the returned verdict —
|
|
5
|
+
* the whole author → verify → fix loop, inside the agent's own workspace.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildServer(): McpServer;
|
|
8
|
+
/** Start the stdio MCP server (called by `playhead mcp`). */
|
|
9
|
+
export declare function startMcpServer(): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAWpE;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,SAAS,CA6IvC;AAqBD,6DAA6D;AAC7D,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAIpD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Cubic bezier easing (CSS-style: fixed endpoints (0,0) and (1,1)). Serializable by its four control values. */
|
|
2
|
+
export type BezierParams = [number, number, number, number];
|
|
3
|
+
export declare const EASE_ZOOM: BezierParams;
|
|
4
|
+
export declare const EASE_PAN: BezierParams;
|
|
5
|
+
/** Evaluate a CSS cubic-bezier at progress t ∈ [0,1] (solves x(t)=t for the parameter, returns y). */
|
|
6
|
+
export declare function cubicBezier(p: BezierParams, t: number): number;
|
|
7
|
+
/** Minimum-jerk position profile: smooth human-like travel, s(0)=0, s(1)=1, zero velocity/acceleration at ends. */
|
|
8
|
+
export declare function minJerk(t: number): number;
|
|
9
|
+
//# sourceMappingURL=easing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easing.d.ts","sourceRoot":"","sources":["../../src/shared/easing.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE5D,eAAO,MAAM,SAAS,EAAE,YAA+B,CAAC;AACxD,eAAO,MAAM,QAAQ,EAAE,YAAgC,CAAC;AAExD,sGAAsG;AACtG,wBAAgB,WAAW,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAc9D;AAYD,mHAAmH;AACnH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAIzC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed exit codes — a CI pipeline must be able to tell WHICH kind of red this is:
|
|
3
|
+
*
|
|
4
|
+
* 0 pass — rendered and publishable
|
|
5
|
+
* 1 flow failure — the APP broke the flow (locator gone, expect failed, step timeout);
|
|
6
|
+
* a partial bundle + failure clip exist
|
|
7
|
+
* 2 quality fail — the flow ran but the video failed verification (framing, captions, audio)
|
|
8
|
+
* 3 infra failure — environment problems (browser/ffmpeg missing, launch failed)
|
|
9
|
+
* 4 usage error — bad spec / bad arguments
|
|
10
|
+
*
|
|
11
|
+
* A test tool that can't distinguish "your app is broken" from "the video is ugly" from
|
|
12
|
+
* "the runner is misconfigured" gets `|| true`'d. This is the contract that prevents that.
|
|
13
|
+
*/
|
|
14
|
+
export declare const EXIT: {
|
|
15
|
+
readonly OK: 0;
|
|
16
|
+
readonly FLOW: 1;
|
|
17
|
+
readonly QUALITY: 2;
|
|
18
|
+
readonly INFRA: 3;
|
|
19
|
+
readonly USAGE: 4;
|
|
20
|
+
};
|
|
21
|
+
/** The app broke the scripted flow (capture-time step failure). */
|
|
22
|
+
export declare class FlowError extends Error {
|
|
23
|
+
readonly exitCode: 1;
|
|
24
|
+
}
|
|
25
|
+
/** Environment/tooling problem — nothing about the app or the spec. */
|
|
26
|
+
export declare class InfraError extends Error {
|
|
27
|
+
readonly exitCode: 3;
|
|
28
|
+
}
|
|
29
|
+
/** Classify an arbitrary thrown error into an exit code. SpecErrors are matched by name to
|
|
30
|
+
* avoid a circular import with the spec parser. */
|
|
31
|
+
export declare function exitCodeFor(e: unknown): number;
|
|
32
|
+
//# sourceMappingURL=exit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exit.d.ts","sourceRoot":"","sources":["../../src/shared/exit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,IAAI;aACf,EAAE,EAAE,CAAC;aACL,IAAI,EAAE,CAAC;aACP,OAAO,EAAE,CAAC;aACV,KAAK,EAAE,CAAC;aACR,KAAK,EAAE,CAAC;CACA,CAAC;AAEX,mEAAmE;AACnE,qBAAa,SAAU,SAAQ,KAAK;IAClC,QAAQ,CAAC,QAAQ,IAAa;CAC/B;AAED,uEAAuE;AACvE,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,QAAQ,IAAc;CAChC;AAED;oDACoD;AACpD,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAU9C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Resolve the ffmpeg binary: $PLAYHEAD_FFMPEG override, else the bundled ffmpeg-static build. */
|
|
2
|
+
export declare function ffmpegPath(): string;
|
|
3
|
+
export declare function ffprobePath(): string;
|
|
4
|
+
export interface RunResult {
|
|
5
|
+
code: number;
|
|
6
|
+
stdout: string;
|
|
7
|
+
stderr: string;
|
|
8
|
+
}
|
|
9
|
+
/** Run ffmpeg/ffprobe to completion, capturing output. For the streaming encoder see compose/render/encoder.ts. */
|
|
10
|
+
export declare function runBinary(bin: string, args: string[], stdin?: Buffer): Promise<RunResult>;
|
|
11
|
+
/** Losslessly concatenate H.264 MP4s (same codec/params) into one file via the concat demuxer. */
|
|
12
|
+
export declare function concatVideos(inputs: string[], outPath: string): Promise<void>;
|
|
13
|
+
/** Run ffmpeg, returning raw stdout bytes (for image2pipe extraction). */
|
|
14
|
+
export declare function runBinaryRaw(bin: string, args: string[]): Promise<{
|
|
15
|
+
code: number;
|
|
16
|
+
stdout: Buffer;
|
|
17
|
+
stderr: string;
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=ffmpeg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ffmpeg.d.ts","sourceRoot":"","sources":["../../src/shared/ffmpeg.ts"],"names":[],"mappings":"AAKA,kGAAkG;AAClG,wBAAgB,UAAU,IAAI,MAAM,CAKnC;AAED,wBAAgB,WAAW,IAAI,MAAM,CAIpC;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,mHAAmH;AACnH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAkBzF;AAED,kGAAkG;AAClG,wBAAsB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBnF;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAYnH"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** Axis-aligned rectangle. Space is documented at each use site (viewport CSS px, frame px, or output px). */
|
|
2
|
+
export interface Rect {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
w: number;
|
|
6
|
+
h: number;
|
|
7
|
+
}
|
|
8
|
+
export interface Point {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function rectCenter(r: Rect): Point;
|
|
13
|
+
export declare function rectUnion(a: Rect, b: Rect): Rect;
|
|
14
|
+
export declare function padRect(r: Rect, pad: number): Rect;
|
|
15
|
+
/** True when `inner` lies fully inside `outer`, with an optional margin inside `outer`. */
|
|
16
|
+
export declare function rectContains(outer: Rect, inner: Rect, margin?: number): boolean;
|
|
17
|
+
export declare function clamp(v: number, min: number, max: number): number;
|
|
18
|
+
export declare function lerp(a: number, b: number, t: number): number;
|
|
19
|
+
export declare function dist(a: Point, b: Point): number;
|
|
20
|
+
/**
|
|
21
|
+
* Camera state on the source viewport plane. The visible window always has the
|
|
22
|
+
* OUTPUT aspect ratio (width-anchored): zoom=1 shows the full viewport width,
|
|
23
|
+
* with height vpW/zoom/outAspect — the camera pans vertically over pages taller
|
|
24
|
+
* than 16:9 rather than distorting them.
|
|
25
|
+
*/
|
|
26
|
+
export interface CameraState {
|
|
27
|
+
cx: number;
|
|
28
|
+
cy: number;
|
|
29
|
+
zoom: number;
|
|
30
|
+
}
|
|
31
|
+
export interface CameraPlane {
|
|
32
|
+
vpW: number;
|
|
33
|
+
vpH: number;
|
|
34
|
+
outW: number;
|
|
35
|
+
outH: number;
|
|
36
|
+
}
|
|
37
|
+
/** The viewport-space rect visible at a camera state (output-aspect, width-anchored). */
|
|
38
|
+
export declare function visibleRect(cam: CameraState, plane: CameraPlane): Rect;
|
|
39
|
+
/** Minimum zoom that keeps the visible window inside a page of this height. */
|
|
40
|
+
export declare function minZoom(plane: CameraPlane): number;
|
|
41
|
+
/** Clamp a camera so its visible rect stays inside the viewport. */
|
|
42
|
+
export declare function clampCamera(cam: CameraState, plane: CameraPlane): CameraState;
|
|
43
|
+
/** Project a viewport-space rect into output space given a camera state. */
|
|
44
|
+
export declare function projectRect(r: Rect, cam: CameraState, plane: CameraPlane): Rect;
|
|
45
|
+
/** Project a viewport-space point into output space given a camera state. */
|
|
46
|
+
export declare function projectPoint(p: Point, cam: CameraState, plane: CameraPlane): Point;
|
|
47
|
+
//# sourceMappingURL=geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/shared/geometry.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,GAAG,KAAK,CAEzC;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAShD;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAElD;AAED,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,SAAI,GAAG,OAAO,CAO1E;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,MAAM,CAE/C;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAItE;AAED,+EAA+E;AAC/E,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAElD;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAG,WAAW,CAS7E;AAED,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAI/E;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAG,KAAK,CAIlF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function setVerbose(v: boolean): void;
|
|
2
|
+
export declare const log: {
|
|
3
|
+
info(msg: string): void;
|
|
4
|
+
step(msg: string): void;
|
|
5
|
+
ok(msg: string): void;
|
|
6
|
+
warn(msg: string): void;
|
|
7
|
+
error(msg: string): void;
|
|
8
|
+
debug(msg: string): void;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/shared/log.ts"],"names":[],"mappings":"AAIA,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAE3C;AAID,eAAO,MAAM,GAAG;IACd,IAAI,MAAM,MAAM,GAAG,IAAI;IAGvB,IAAI,MAAM,MAAM,GAAG,IAAI;IAGvB,EAAE,MAAM,MAAM,GAAG,IAAI;IAGrB,IAAI,MAAM,MAAM,GAAG,IAAI;IAGvB,KAAK,MAAM,MAAM,GAAG,IAAI;IAGxB,KAAK,MAAM,MAAM,GAAG,IAAI;CAGzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/shared/version.ts"],"names":[],"mappings":"AAEA;6FAC6F;AAC7F,eAAO,MAAM,gBAAgB,EAAE,MAEtB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Playhead locator grammar — resilient, label/role-based element addressing.
|
|
3
|
+
*
|
|
4
|
+
* role=button[name="Add user"] role + accessible name
|
|
5
|
+
* role=cell[name=/api key/i] regex accessible name
|
|
6
|
+
* label=Email form control by label
|
|
7
|
+
* text="User added" visible text
|
|
8
|
+
* placeholder=Search input placeholder
|
|
9
|
+
* testid=add-user data-testid
|
|
10
|
+
* css=#legacy .thing escape hatch (warned)
|
|
11
|
+
* ... >> nth=1 pick among multiple matches
|
|
12
|
+
* frame=#preview >> role=button[name="Save"] pierce into an iframe (chainable)
|
|
13
|
+
* frame=iframe[name=a] >> frame=#inner >> text="Hi" nested frames
|
|
14
|
+
*
|
|
15
|
+
* Parsed form is serializable (regexes stored as {source, flags}) so it can live
|
|
16
|
+
* in spec.resolved.json and events.json.
|
|
17
|
+
*/
|
|
18
|
+
export interface RegexSpec {
|
|
19
|
+
source: string;
|
|
20
|
+
flags: string;
|
|
21
|
+
}
|
|
22
|
+
export type TextMatch = {
|
|
23
|
+
exact: string;
|
|
24
|
+
} | {
|
|
25
|
+
substring: string;
|
|
26
|
+
} | {
|
|
27
|
+
regex: RegexSpec;
|
|
28
|
+
};
|
|
29
|
+
export type LocatorBase = {
|
|
30
|
+
kind: 'role';
|
|
31
|
+
role: string;
|
|
32
|
+
name?: TextMatch;
|
|
33
|
+
} | {
|
|
34
|
+
kind: 'label';
|
|
35
|
+
match: TextMatch;
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'text';
|
|
38
|
+
match: TextMatch;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'placeholder';
|
|
41
|
+
match: TextMatch;
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'testid';
|
|
44
|
+
value: string;
|
|
45
|
+
} | {
|
|
46
|
+
kind: 'css';
|
|
47
|
+
selector: string;
|
|
48
|
+
};
|
|
49
|
+
export interface ParsedLocator {
|
|
50
|
+
base: LocatorBase;
|
|
51
|
+
nth?: number;
|
|
52
|
+
/** CSS selectors of the iframe chain to pierce (outermost first) before resolving `base`. */
|
|
53
|
+
frames?: string[];
|
|
54
|
+
/** The original spec string, kept for captions/diagnostics. */
|
|
55
|
+
raw: string;
|
|
56
|
+
}
|
|
57
|
+
export declare class LocatorParseError extends Error {
|
|
58
|
+
}
|
|
59
|
+
export declare function parseLocator(input: string): ParsedLocator;
|
|
60
|
+
/** Human-readable form of what a locator points at, used for captions when the accessible name is unavailable. */
|
|
61
|
+
export declare function locatorDisplayName(loc: ParsedLocator): string;
|
|
62
|
+
//# sourceMappingURL=locators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locators.d.ts","sourceRoot":"","sources":["../../src/spec/locators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CA4DzD;AA0BD,kHAAkH;AAClH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAc7D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Spec } from './schema.js';
|
|
2
|
+
export declare class SpecError extends Error {
|
|
3
|
+
readonly issues: string[];
|
|
4
|
+
constructor(message: string, issues?: string[]);
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Parse + validate YAML text into a Spec. Supports:
|
|
8
|
+
* - `vars:` — `{{name}}` interpolation across every string in the spec; values may reference
|
|
9
|
+
* the environment as `${env.NAME}` or `${env.NAME:-default}`. Unknown `{{var}}` is an error.
|
|
10
|
+
* - line/column positions on every validation error (mapped back to the YAML source).
|
|
11
|
+
* `extends:` requires file context — use loadSpec.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseSpec(yamlText: string, sourcePath?: string): Spec;
|
|
14
|
+
/** Load a spec file, resolving `extends:` (base file merged under this one) and `vars:`. */
|
|
15
|
+
export declare function loadSpec(path: string): Promise<Spec>;
|
|
16
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/spec/parse.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4B,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAElE,qBAAa,SAAU,SAAQ,KAAK;aAGhB,MAAM,EAAE,MAAM,EAAE;IAFlC,YACE,OAAO,EAAE,MAAM,EACC,MAAM,GAAE,MAAM,EAAO,EAGtC;CACF;AA6BD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,SAAa,GAAG,IAAI,CAYzE;AAED,4FAA4F;AAC5F,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ1D"}
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const stepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
4
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
5
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
6
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
continue: "continue";
|
|
8
|
+
cut: "cut";
|
|
9
|
+
}>>;
|
|
10
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
action: z.ZodLiteral<"goto">;
|
|
12
|
+
url: z.ZodString;
|
|
13
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
14
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
15
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
16
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
17
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
18
|
+
continue: "continue";
|
|
19
|
+
cut: "cut";
|
|
20
|
+
}>>;
|
|
21
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
action: z.ZodEnum<{
|
|
23
|
+
click: "click";
|
|
24
|
+
dblclick: "dblclick";
|
|
25
|
+
hover: "hover";
|
|
26
|
+
}>;
|
|
27
|
+
target: z.ZodString;
|
|
28
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
29
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
30
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
31
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
32
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
continue: "continue";
|
|
34
|
+
cut: "cut";
|
|
35
|
+
}>>;
|
|
36
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
action: z.ZodLiteral<"type">;
|
|
38
|
+
target: z.ZodString;
|
|
39
|
+
text: z.ZodString;
|
|
40
|
+
mask: z.ZodDefault<z.ZodBoolean>;
|
|
41
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
42
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
43
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
44
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
45
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
continue: "continue";
|
|
47
|
+
cut: "cut";
|
|
48
|
+
}>>;
|
|
49
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
action: z.ZodLiteral<"press">;
|
|
51
|
+
keys: z.ZodString;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
54
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
55
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
56
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
57
|
+
continue: "continue";
|
|
58
|
+
cut: "cut";
|
|
59
|
+
}>>;
|
|
60
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
action: z.ZodLiteral<"select">;
|
|
62
|
+
target: z.ZodString;
|
|
63
|
+
value: z.ZodString;
|
|
64
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
65
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
66
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
67
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
68
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
69
|
+
continue: "continue";
|
|
70
|
+
cut: "cut";
|
|
71
|
+
}>>;
|
|
72
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
action: z.ZodLiteral<"scroll">;
|
|
74
|
+
target: z.ZodOptional<z.ZodString>;
|
|
75
|
+
by: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
x: z.ZodDefault<z.ZodNumber>;
|
|
77
|
+
y: z.ZodNumber;
|
|
78
|
+
}, z.core.$strict>>;
|
|
79
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
80
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
81
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
82
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
83
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
84
|
+
continue: "continue";
|
|
85
|
+
cut: "cut";
|
|
86
|
+
}>>;
|
|
87
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
action: z.ZodLiteral<"expect">;
|
|
89
|
+
target: z.ZodString;
|
|
90
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
text: z.ZodOptional<z.ZodString>;
|
|
92
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
94
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
95
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
96
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
97
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
98
|
+
continue: "continue";
|
|
99
|
+
cut: "cut";
|
|
100
|
+
}>>;
|
|
101
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
action: z.ZodLiteral<"wait">;
|
|
103
|
+
ms: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
for: z.ZodOptional<z.ZodString>;
|
|
105
|
+
state: z.ZodDefault<z.ZodEnum<{
|
|
106
|
+
hidden: "hidden";
|
|
107
|
+
visible: "visible";
|
|
108
|
+
}>>;
|
|
109
|
+
}, z.core.$strict>], "action">;
|
|
110
|
+
export type Step = z.infer<typeof stepSchema>;
|
|
111
|
+
export declare function editDistance(a: string, b: string): number;
|
|
112
|
+
export declare const specSchema: z.ZodObject<{
|
|
113
|
+
playhead: z.ZodLiteral<1>;
|
|
114
|
+
title: z.ZodString;
|
|
115
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
116
|
+
app: z.ZodObject<{
|
|
117
|
+
url: z.ZodString;
|
|
118
|
+
viewport: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
119
|
+
w: number;
|
|
120
|
+
h: number;
|
|
121
|
+
}, string>>>;
|
|
122
|
+
storageState: z.ZodOptional<z.ZodString>;
|
|
123
|
+
assertLoggedIn: z.ZodOptional<z.ZodString>;
|
|
124
|
+
compareUrl: z.ZodOptional<z.ZodString>;
|
|
125
|
+
environment: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
127
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
128
|
+
colorScheme: z.ZodOptional<z.ZodEnum<{
|
|
129
|
+
dark: "dark";
|
|
130
|
+
light: "light";
|
|
131
|
+
}>>;
|
|
132
|
+
fixedTime: z.ZodOptional<z.ZodString>;
|
|
133
|
+
reducedMotion: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
network: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
block: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
137
|
+
stub: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
138
|
+
url: z.ZodString;
|
|
139
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
body: z.ZodOptional<z.ZodString>;
|
|
141
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
142
|
+
}, z.core.$strict>>>;
|
|
143
|
+
har: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strict>>;
|
|
145
|
+
dialogs: z.ZodOptional<z.ZodEnum<{
|
|
146
|
+
accept: "accept";
|
|
147
|
+
dismiss: "dismiss";
|
|
148
|
+
}>>;
|
|
149
|
+
settle: z.ZodOptional<z.ZodObject<{
|
|
150
|
+
idleMs: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
capMs: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
}, z.core.$strict>;
|
|
154
|
+
output: z.ZodPrefault<z.ZodObject<{
|
|
155
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
156
|
+
"before-after": "before-after";
|
|
157
|
+
"bug-repro": "bug-repro";
|
|
158
|
+
demo: "demo";
|
|
159
|
+
release: "release";
|
|
160
|
+
social: "social";
|
|
161
|
+
walkthrough: "walkthrough";
|
|
162
|
+
}>>;
|
|
163
|
+
aspect: z.ZodDefault<z.ZodEnum<{
|
|
164
|
+
"16:9": "16:9";
|
|
165
|
+
"1:1": "1:1";
|
|
166
|
+
"9:16": "9:16";
|
|
167
|
+
}>>;
|
|
168
|
+
resolution: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
169
|
+
w: number;
|
|
170
|
+
h: number;
|
|
171
|
+
}, string>>>;
|
|
172
|
+
fps: z.ZodDefault<z.ZodNumber>;
|
|
173
|
+
pacing: z.ZodOptional<z.ZodEnum<{
|
|
174
|
+
brisk: "brisk";
|
|
175
|
+
normal: "normal";
|
|
176
|
+
relaxed: "relaxed";
|
|
177
|
+
}>>;
|
|
178
|
+
dwellScale: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
audio: z.ZodOptional<z.ZodObject<{
|
|
180
|
+
narration: z.ZodDefault<z.ZodEnum<{
|
|
181
|
+
none: "none";
|
|
182
|
+
tts: "tts";
|
|
183
|
+
}>>;
|
|
184
|
+
provider: z.ZodDefault<z.ZodEnum<{
|
|
185
|
+
say: "say";
|
|
186
|
+
}>>;
|
|
187
|
+
voice: z.ZodOptional<z.ZodString>;
|
|
188
|
+
rate: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
sfx: z.ZodDefault<z.ZodBoolean>;
|
|
190
|
+
music: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
file: z.ZodString;
|
|
192
|
+
gainDb: z.ZodDefault<z.ZodNumber>;
|
|
193
|
+
}, z.core.$strict>>;
|
|
194
|
+
}, z.core.$strict>>;
|
|
195
|
+
endCard: z.ZodOptional<z.ZodObject<{
|
|
196
|
+
title: z.ZodString;
|
|
197
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, z.core.$strict>>;
|
|
199
|
+
}, z.core.$strict>>;
|
|
200
|
+
theme: z.ZodPrefault<z.ZodObject<{
|
|
201
|
+
accent: z.ZodOptional<z.ZodString>;
|
|
202
|
+
captions: z.ZodDefault<z.ZodEnum<{
|
|
203
|
+
bottom: "bottom";
|
|
204
|
+
off: "off";
|
|
205
|
+
top: "top";
|
|
206
|
+
}>>;
|
|
207
|
+
}, z.core.$strict>>;
|
|
208
|
+
masking: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
209
|
+
target: z.ZodString;
|
|
210
|
+
style: z.ZodDefault<z.ZodEnum<{
|
|
211
|
+
blur: "blur";
|
|
212
|
+
solid: "solid";
|
|
213
|
+
}>>;
|
|
214
|
+
}, z.core.$strict>>>;
|
|
215
|
+
scenes: z.ZodArray<z.ZodObject<{
|
|
216
|
+
id: z.ZodString;
|
|
217
|
+
title: z.ZodOptional<z.ZodString>;
|
|
218
|
+
steps: z.ZodArray<z.ZodPipe<z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodTransform<unknown, Record<string, unknown>>>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
219
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
220
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
221
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
222
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
223
|
+
continue: "continue";
|
|
224
|
+
cut: "cut";
|
|
225
|
+
}>>;
|
|
226
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
227
|
+
action: z.ZodLiteral<"goto">;
|
|
228
|
+
url: z.ZodString;
|
|
229
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
230
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
231
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
232
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
233
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
234
|
+
continue: "continue";
|
|
235
|
+
cut: "cut";
|
|
236
|
+
}>>;
|
|
237
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
238
|
+
action: z.ZodEnum<{
|
|
239
|
+
click: "click";
|
|
240
|
+
dblclick: "dblclick";
|
|
241
|
+
hover: "hover";
|
|
242
|
+
}>;
|
|
243
|
+
target: z.ZodString;
|
|
244
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
245
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
246
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
247
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
248
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
249
|
+
continue: "continue";
|
|
250
|
+
cut: "cut";
|
|
251
|
+
}>>;
|
|
252
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
action: z.ZodLiteral<"type">;
|
|
254
|
+
target: z.ZodString;
|
|
255
|
+
text: z.ZodString;
|
|
256
|
+
mask: z.ZodDefault<z.ZodBoolean>;
|
|
257
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
258
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
259
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
260
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
261
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
262
|
+
continue: "continue";
|
|
263
|
+
cut: "cut";
|
|
264
|
+
}>>;
|
|
265
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
266
|
+
action: z.ZodLiteral<"press">;
|
|
267
|
+
keys: z.ZodString;
|
|
268
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
269
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
270
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
271
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
272
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
273
|
+
continue: "continue";
|
|
274
|
+
cut: "cut";
|
|
275
|
+
}>>;
|
|
276
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
277
|
+
action: z.ZodLiteral<"select">;
|
|
278
|
+
target: z.ZodString;
|
|
279
|
+
value: z.ZodString;
|
|
280
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
281
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
282
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
283
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
284
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
285
|
+
continue: "continue";
|
|
286
|
+
cut: "cut";
|
|
287
|
+
}>>;
|
|
288
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
289
|
+
action: z.ZodLiteral<"scroll">;
|
|
290
|
+
target: z.ZodOptional<z.ZodString>;
|
|
291
|
+
by: z.ZodOptional<z.ZodObject<{
|
|
292
|
+
x: z.ZodDefault<z.ZodNumber>;
|
|
293
|
+
y: z.ZodNumber;
|
|
294
|
+
}, z.core.$strict>>;
|
|
295
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
296
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
297
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
298
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
299
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
300
|
+
continue: "continue";
|
|
301
|
+
cut: "cut";
|
|
302
|
+
}>>;
|
|
303
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
304
|
+
action: z.ZodLiteral<"expect">;
|
|
305
|
+
target: z.ZodString;
|
|
306
|
+
visible: z.ZodOptional<z.ZodBoolean>;
|
|
307
|
+
text: z.ZodOptional<z.ZodString>;
|
|
308
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
309
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
310
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
311
|
+
narration: z.ZodOptional<z.ZodString>;
|
|
312
|
+
focus: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"target">, z.ZodLiteral<"wide">, z.ZodString]>>;
|
|
313
|
+
shot: z.ZodOptional<z.ZodEnum<{
|
|
314
|
+
continue: "continue";
|
|
315
|
+
cut: "cut";
|
|
316
|
+
}>>;
|
|
317
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
318
|
+
action: z.ZodLiteral<"wait">;
|
|
319
|
+
ms: z.ZodOptional<z.ZodNumber>;
|
|
320
|
+
for: z.ZodOptional<z.ZodString>;
|
|
321
|
+
state: z.ZodDefault<z.ZodEnum<{
|
|
322
|
+
hidden: "hidden";
|
|
323
|
+
visible: "visible";
|
|
324
|
+
}>>;
|
|
325
|
+
}, z.core.$strict>], "action">>>;
|
|
326
|
+
}, z.core.$strict>>;
|
|
327
|
+
}, z.core.$strict>;
|
|
328
|
+
export type Spec = z.infer<typeof specSchema>;
|
|
329
|
+
export type Scene = Spec['scenes'][number];
|
|
330
|
+
export type OutputSettings = Spec['output'];
|
|
331
|
+
export type MaskRule = Spec['masking'][number];
|
|
332
|
+
export type OutputKind = Spec['output']['kind'];
|
|
333
|
+
export type Aspect = Spec['output']['aspect'];
|
|
334
|
+
/** Capture viewport + output resolution for each aspect (portrait/square reflow, never crop). */
|
|
335
|
+
export declare const ASPECTS: Record<Aspect, {
|
|
336
|
+
viewport: {
|
|
337
|
+
w: number;
|
|
338
|
+
h: number;
|
|
339
|
+
};
|
|
340
|
+
resolution: {
|
|
341
|
+
w: number;
|
|
342
|
+
h: number;
|
|
343
|
+
};
|
|
344
|
+
}>;
|
|
345
|
+
/** The capture viewport: explicit spec value, else derived from the output aspect. */
|
|
346
|
+
export declare function resolveViewport(spec: Spec): {
|
|
347
|
+
w: number;
|
|
348
|
+
h: number;
|
|
349
|
+
};
|
|
350
|
+
/** The output resolution: explicit spec value, else derived from the aspect. */
|
|
351
|
+
export declare function resolveResolution(spec: Spec): {
|
|
352
|
+
w: number;
|
|
353
|
+
h: number;
|
|
354
|
+
};
|
|
355
|
+
/** A step with its position in the spec — the unit the capture executor and compositor work in. */
|
|
356
|
+
export interface AddressedStep {
|
|
357
|
+
sceneId: string;
|
|
358
|
+
sceneIndex: number;
|
|
359
|
+
stepIndex: number;
|
|
360
|
+
/** Global 1-based index across all scenes, used for step numbering. */
|
|
361
|
+
ordinal: number;
|
|
362
|
+
step: Step;
|
|
363
|
+
}
|
|
364
|
+
export declare function flattenSteps(spec: Spec): AddressedStep[];
|
|
365
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/spec/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA8GxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BASrB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAmD9C,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAazD;AA+BD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqJZ,CAAC;AAEZ,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAC9C,MAAM,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC5C,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/C,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAChD,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;AAE9C,iGAAiG;AACjG,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,UAAU,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAIhH,CAAC;AAEF,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAEpE;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAEtE;AAED,mGAAmG;AACnG,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,EAAE,CAUxD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Spec } from '../spec/schema.js';
|
|
2
|
+
export interface ResolvedTheme {
|
|
3
|
+
name: string;
|
|
4
|
+
/** Accent color for cursor ripple, badges, highlights. */
|
|
5
|
+
accent: string;
|
|
6
|
+
/** Title-card and letterbox background. */
|
|
7
|
+
bg: string;
|
|
8
|
+
bgSubtle: string;
|
|
9
|
+
/** Caption card background (rgba string). */
|
|
10
|
+
surface: string;
|
|
11
|
+
onSurface: string;
|
|
12
|
+
onSurfaceDim: string;
|
|
13
|
+
fontFamily: string;
|
|
14
|
+
captionFontPx: number;
|
|
15
|
+
captionMinFontPx: number;
|
|
16
|
+
captionMaxLines: number;
|
|
17
|
+
captionPosition: 'bottom' | 'top' | 'off';
|
|
18
|
+
radius: number;
|
|
19
|
+
}
|
|
20
|
+
export declare function resolveTheme(spec: Spec): ResolvedTheme;
|
|
21
|
+
/** Register bundled Inter faces so rendering is deterministic across machines. */
|
|
22
|
+
export declare function registerFonts(): void;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC;CAChB;AAoBD,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,CAMtD;AAID,kFAAkF;AAClF,wBAAgB,aAAa,IAAI,IAAI,CAoBpC"}
|