@scenerok/sdk 0.2.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.
Files changed (53) hide show
  1. package/README.md +114 -0
  2. package/dist/duration.d.ts +29 -0
  3. package/dist/duration.d.ts.map +1 -0
  4. package/dist/duration.js +87 -0
  5. package/dist/grid.d.ts +61 -0
  6. package/dist/grid.d.ts.map +1 -0
  7. package/dist/grid.js +174 -0
  8. package/dist/index.d.ts +27 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +22 -0
  11. package/dist/ir-builder.d.ts +28 -0
  12. package/dist/ir-builder.d.ts.map +1 -0
  13. package/dist/ir-builder.js +452 -0
  14. package/dist/ir.d.ts +204 -0
  15. package/dist/ir.d.ts.map +1 -0
  16. package/dist/ir.js +30 -0
  17. package/dist/media.d.ts +16 -0
  18. package/dist/media.d.ts.map +1 -0
  19. package/dist/media.js +105 -0
  20. package/dist/motion.d.ts +9 -0
  21. package/dist/motion.d.ts.map +1 -0
  22. package/dist/motion.js +31 -0
  23. package/dist/plugins/cloudflare.d.ts +80 -0
  24. package/dist/plugins/cloudflare.d.ts.map +1 -0
  25. package/dist/plugins/cloudflare.js +55 -0
  26. package/dist/plugins/elevenlabs-music.d.ts +37 -0
  27. package/dist/plugins/elevenlabs-music.d.ts.map +1 -0
  28. package/dist/plugins/elevenlabs-music.js +21 -0
  29. package/dist/plugins/invoke.d.ts +26 -0
  30. package/dist/plugins/invoke.d.ts.map +1 -0
  31. package/dist/plugins/invoke.js +109 -0
  32. package/dist/plugins/types.d.ts +21 -0
  33. package/dist/plugins/types.d.ts.map +1 -0
  34. package/dist/plugins/types.js +4 -0
  35. package/dist/plugins/xai.d.ts +76 -0
  36. package/dist/plugins/xai.d.ts.map +1 -0
  37. package/dist/plugins/xai.js +60 -0
  38. package/dist/stdlib.d.ts +96 -0
  39. package/dist/stdlib.d.ts.map +1 -0
  40. package/dist/stdlib.js +66 -0
  41. package/dist/timeline.d.ts +27 -0
  42. package/dist/timeline.d.ts.map +1 -0
  43. package/dist/timeline.js +117 -0
  44. package/dist/transitions/catalog.d.ts +33 -0
  45. package/dist/transitions/catalog.d.ts.map +1 -0
  46. package/dist/transitions/catalog.js +51 -0
  47. package/dist/transitions/index.d.ts +62 -0
  48. package/dist/transitions/index.d.ts.map +1 -0
  49. package/dist/transitions/index.js +57 -0
  50. package/dist/types.d.ts +177 -0
  51. package/dist/types.d.ts.map +1 -0
  52. package/dist/types.js +14 -0
  53. package/package.json +64 -0
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Client stubs for `@scenerok/xai` — same surface as VidScript `import xai from "@scenerok/xai"`.
3
+ * Host executes the real plugin via CompilerAPI during `scenerok validate/render`.
4
+ */
5
+ import { invokeAudioPlugin, invokeDataPlugin, invokeVideoPlugin } from './invoke.js';
6
+ const PKG = '@scenerok/xai';
7
+ /** Text → video (Grok Imagine Video). */
8
+ export function imagine(prompt, options) {
9
+ return invokeVideoPlugin(PKG, 'imagine', prompt, options ?? {});
10
+ }
11
+ /** Text → still image clip. */
12
+ export function image(prompt, options) {
13
+ return invokeVideoPlugin(PKG, 'image', prompt, options ?? {});
14
+ }
15
+ export function generateImage(prompt, options) {
16
+ return invokeVideoPlugin(PKG, 'generateImage', prompt, options ?? {});
17
+ }
18
+ /** Text → video. */
19
+ export function genVideo(prompt, options) {
20
+ return invokeVideoPlugin(PKG, 'genVideo', prompt, options ?? {});
21
+ }
22
+ /** Animate one image into video. */
23
+ export function imageToVideo(imageSrc, prompt, options) {
24
+ if (prompt === undefined) {
25
+ return invokeVideoPlugin(PKG, 'imageToVideo', imageSrc, options ?? {});
26
+ }
27
+ return invokeVideoPlugin(PKG, 'imageToVideo', imageSrc, prompt, options ?? {});
28
+ }
29
+ /** Guide a scene with 1–7 reference images. */
30
+ export function referenceToVideo(images, prompt, options) {
31
+ return invokeVideoPlugin(PKG, 'referenceToVideo', images, prompt, options ?? {});
32
+ }
33
+ /** Extend an existing video clip. */
34
+ export function extendVideo(videoSrc, prompt, options) {
35
+ return invokeVideoPlugin(PKG, 'extendVideo', videoSrc, prompt, options ?? {});
36
+ }
37
+ /** Text → speech. */
38
+ export function tts(text, options) {
39
+ return invokeAudioPlugin(PKG, 'tts', text, options ?? {});
40
+ }
41
+ export function textToSpeech(text, options) {
42
+ return invokeAudioPlugin(PKG, 'textToSpeech', text, options ?? {});
43
+ }
44
+ /** List available TTS voices. */
45
+ export function listVoices() {
46
+ return invokeDataPlugin(PKG, 'listVoices');
47
+ }
48
+ const xai = {
49
+ imagine,
50
+ image,
51
+ generateImage,
52
+ genVideo,
53
+ imageToVideo,
54
+ referenceToVideo,
55
+ extendVideo,
56
+ tts,
57
+ textToSpeech,
58
+ listVoices,
59
+ };
60
+ export default xai;
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Client-side stubs for `@scenerok/stdlib`.
3
+ * At compile time the SDK runtime injects `globalThis.__scenerokStdlib` with real host implementations.
4
+ */
5
+ /** Path, URL, data URI, or any value the host can resolve to a media file. */
6
+ export type MediaSource = string;
7
+ export type StdlibMediaKind = 'video' | 'audio' | 'image' | 'unknown';
8
+ export interface MediaInfo {
9
+ source: string;
10
+ kind: StdlibMediaKind;
11
+ duration: number | null;
12
+ width: number | null;
13
+ height: number | null;
14
+ fps: number | null;
15
+ hasAudio: boolean;
16
+ codec: string | null;
17
+ audioCodec: string | null;
18
+ }
19
+ export interface Dimensions {
20
+ width: number;
21
+ height: number;
22
+ }
23
+ export interface LoudnessInfo {
24
+ integratedLufs: number | null;
25
+ truePeakDb: number | null;
26
+ loudnessRange: number | null;
27
+ duration: number | null;
28
+ }
29
+ export interface FitBox {
30
+ width: number;
31
+ height: number;
32
+ x: number;
33
+ y: number;
34
+ }
35
+ export interface GrabFrameOptions {
36
+ /** Output width in pixels (height scales). Default 720. */
37
+ width?: number;
38
+ /** JPEG quality 2–31 (ffmpeg -q:v). Default 5. */
39
+ quality?: number;
40
+ /** Prefer data URL instead of uploading. Default true for SDK/local. */
41
+ asDataUrl?: boolean;
42
+ }
43
+ export interface MeasureTextStyle {
44
+ font?: string;
45
+ size?: number;
46
+ bold?: boolean;
47
+ italic?: boolean;
48
+ letterSpacing?: number;
49
+ lineHeight?: number;
50
+ maxWidth?: number;
51
+ }
52
+ export interface TextMetrics {
53
+ width: number;
54
+ height: number;
55
+ lines?: number;
56
+ }
57
+ /** Full host API injected as `globalThis.__scenerokStdlib`. */
58
+ export interface StdlibHostApi {
59
+ getVideoLength(src: MediaSource): Promise<number>;
60
+ getAudioLength(src: MediaSource): Promise<number>;
61
+ getMediaInfo(src: MediaSource): Promise<MediaInfo>;
62
+ getDimensions(src: MediaSource): Promise<Dimensions>;
63
+ getFps(src: MediaSource): Promise<number | null>;
64
+ getLoudness(src: MediaSource): Promise<LoudnessInfo>;
65
+ hasAudio(src: MediaSource): Promise<boolean>;
66
+ mediaKind(src: MediaSource): Promise<StdlibMediaKind>;
67
+ grabFrame(src: MediaSource, time: number, options?: GrabFrameOptions): Promise<string>;
68
+ grabFrames(src: MediaSource, times: readonly number[], options?: GrabFrameOptions): Promise<string[]>;
69
+ grabFrameAtFraction(src: MediaSource, fraction: number, options?: GrabFrameOptions): Promise<string>;
70
+ measureText(content: string, style?: MeasureTextStyle): Promise<TextMetrics>;
71
+ fitContain(srcW: number, srcH: number, boxW: number, boxH: number): FitBox;
72
+ fitCover(srcW: number, srcH: number, boxW: number, boxH: number): FitBox;
73
+ clampTime(t: number, duration: number): number;
74
+ parseTime(value: number | string): number;
75
+ timecode(seconds: number): string;
76
+ beats(bpm: number, count: number): number;
77
+ }
78
+ export declare function getVideoLength(src: MediaSource): Promise<number>;
79
+ export declare function getAudioLength(src: MediaSource): Promise<number>;
80
+ export declare function getMediaInfo(src: MediaSource): Promise<MediaInfo>;
81
+ export declare function getDimensions(src: MediaSource): Promise<Dimensions>;
82
+ export declare function getFps(src: MediaSource): Promise<number | null>;
83
+ export declare function getLoudness(src: MediaSource): Promise<LoudnessInfo>;
84
+ export declare function hasAudio(src: MediaSource): Promise<boolean>;
85
+ export declare function mediaKind(src: MediaSource): Promise<StdlibMediaKind>;
86
+ export declare function grabFrame(src: MediaSource, time: number, options?: GrabFrameOptions): Promise<string>;
87
+ export declare function grabFrames(src: MediaSource, times: readonly number[], options?: GrabFrameOptions): Promise<string[]>;
88
+ export declare function grabFrameAtFraction(src: MediaSource, fraction: number, options?: GrabFrameOptions): Promise<string>;
89
+ export declare function measureText(content: string, style?: MeasureTextStyle): Promise<TextMetrics>;
90
+ export declare function fitContain(srcW: number, srcH: number, boxW: number, boxH: number): FitBox;
91
+ export declare function fitCover(srcW: number, srcH: number, boxW: number, boxH: number): FitBox;
92
+ export declare function clampTime(t: number, duration: number): number;
93
+ export declare function parseTime(value: number | string): number;
94
+ export declare function timecode(seconds: number): string;
95
+ export declare function beats(bpm: number, count: number): number;
96
+ //# sourceMappingURL=stdlib.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdlib.d.ts","sourceRoot":"","sources":["../src/stdlib.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAEtE,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,M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,EAAE,gBAAgB,GACzB,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAE3F;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzF;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEvF;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAExD"}
package/dist/stdlib.js ADDED
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Client-side stubs for `@scenerok/stdlib`.
3
+ * At compile time the SDK runtime injects `globalThis.__scenerokStdlib` with real host implementations.
4
+ */
5
+ function host() {
6
+ const h = globalThis.__scenerokStdlib;
7
+ if (!h) {
8
+ throw new Error('@scenerok/stdlib is only available when compiling via SceneRok (scenerok validate/render). '
9
+ + 'Host bindings were not injected.');
10
+ }
11
+ return h;
12
+ }
13
+ export function getVideoLength(src) {
14
+ return host().getVideoLength(src);
15
+ }
16
+ export function getAudioLength(src) {
17
+ return host().getAudioLength(src);
18
+ }
19
+ export function getMediaInfo(src) {
20
+ return host().getMediaInfo(src);
21
+ }
22
+ export function getDimensions(src) {
23
+ return host().getDimensions(src);
24
+ }
25
+ export function getFps(src) {
26
+ return host().getFps(src);
27
+ }
28
+ export function getLoudness(src) {
29
+ return host().getLoudness(src);
30
+ }
31
+ export function hasAudio(src) {
32
+ return host().hasAudio(src);
33
+ }
34
+ export function mediaKind(src) {
35
+ return host().mediaKind(src);
36
+ }
37
+ export function grabFrame(src, time, options) {
38
+ return host().grabFrame(src, time, options);
39
+ }
40
+ export function grabFrames(src, times, options) {
41
+ return host().grabFrames(src, times, options);
42
+ }
43
+ export function grabFrameAtFraction(src, fraction, options) {
44
+ return host().grabFrameAtFraction(src, fraction, options);
45
+ }
46
+ export function measureText(content, style) {
47
+ return host().measureText(content, style);
48
+ }
49
+ export function fitContain(srcW, srcH, boxW, boxH) {
50
+ return host().fitContain(srcW, srcH, boxW, boxH);
51
+ }
52
+ export function fitCover(srcW, srcH, boxW, boxH) {
53
+ return host().fitCover(srcW, srcH, boxW, boxH);
54
+ }
55
+ export function clampTime(t, duration) {
56
+ return host().clampTime(t, duration);
57
+ }
58
+ export function parseTime(value) {
59
+ return host().parseTime(value);
60
+ }
61
+ export function timecode(seconds) {
62
+ return host().timecode(seconds);
63
+ }
64
+ export function beats(bpm, count) {
65
+ return host().beats(bpm, count);
66
+ }
@@ -0,0 +1,27 @@
1
+ import { type TimeInput } from './duration.js';
2
+ import type { GridSpec } from './grid.js';
3
+ import type { IRTimeline } from './ir.js';
4
+ import type { RangeBinder, Schedulable, TimelineLike, TimelineOptions } from './types.js';
5
+ export interface Timeline extends TimelineLike {
6
+ /** Dual-index schedule: `t[start][end] = value` */
7
+ [start: string | number | symbol]: RangeBinder | Schedulable | unknown;
8
+ grid(spec: GridSpec): this;
9
+ range(start: TimeInput, end: TimeInput, value: Schedulable): this;
10
+ push(value: Schedulable, duration?: TimeInput): this;
11
+ toIR(): IRTimeline;
12
+ }
13
+ /**
14
+ * Create a timeline. Schedule with dual-index assignment:
15
+ *
16
+ * ```ts
17
+ * const t = timeline({ width: 1080, height: 1920, fps: 30 })
18
+ * t.grid({ rows: '20% 1fr 30%', areas: ['title', 'stage', 'caption'] })
19
+ * t[0][scene.duration] = scene
20
+ * t['0s']['3s'] = text('Hello', { area: 'title' })
21
+ * t.push(text('Tail'))
22
+ * return t.toIR()
23
+ * ```
24
+ */
25
+ export declare function timeline(options?: TimelineOptions): Timeline;
26
+ export declare function isTimeline(value: unknown): value is Timeline;
27
+ //# sourceMappingURL=timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../src/timeline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAU7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,eAAe,EAEhB,MAAM,YAAY,CAAC;AAkCpB,MAAM,WAAW,QAAS,SAAQ,YAAY;IAC5C,mDAAmD;IACnD,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC;IACvE,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAClE,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACrD,IAAI,IAAI,UAAU,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,QAAQ,CA2EhE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAO5D"}
@@ -0,0 +1,117 @@
1
+ import { isAutoPlayheadKey, toSeconds } from './duration.js';
2
+ import { assertSchedulable, bindTransitions, createIrBuilder, inferAutoDuration, scheduleAt, setGrid, } from './ir-builder.js';
3
+ const INTERNAL = Symbol('scenerok.timeline.internal');
4
+ function parseTimeKey(key) {
5
+ if (isAutoPlayheadKey(key))
6
+ return 'auto';
7
+ if (typeof key === 'symbol') {
8
+ throw new TypeError('Timeline keys must be numbers, Duration, time strings, or "-"');
9
+ }
10
+ return toSeconds(key);
11
+ }
12
+ function createRangeBinder(internal, start) {
13
+ return new Proxy({}, {
14
+ set(_target, endKey, value) {
15
+ assertSchedulable(value);
16
+ const endParsed = parseTimeKey(endKey);
17
+ if (endParsed === 'auto') {
18
+ throw new TypeError('End time cannot be auto-playhead "-"');
19
+ }
20
+ scheduleAt(internal.state, start, endParsed, value);
21
+ return true;
22
+ },
23
+ get() {
24
+ return undefined;
25
+ },
26
+ });
27
+ }
28
+ /**
29
+ * Create a timeline. Schedule with dual-index assignment:
30
+ *
31
+ * ```ts
32
+ * const t = timeline({ width: 1080, height: 1920, fps: 30 })
33
+ * t.grid({ rows: '20% 1fr 30%', areas: ['title', 'stage', 'caption'] })
34
+ * t[0][scene.duration] = scene
35
+ * t['0s']['3s'] = text('Hello', { area: 'title' })
36
+ * t.push(text('Tail'))
37
+ * return t.toIR()
38
+ * ```
39
+ */
40
+ export function timeline(options = {}) {
41
+ const internal = {
42
+ state: createIrBuilder(options),
43
+ options: { ...options },
44
+ };
45
+ const api = {
46
+ __sdk: true,
47
+ kind: 'timeline',
48
+ options: internal.options,
49
+ get duration() {
50
+ return internal.state.ir.duration;
51
+ },
52
+ get length() {
53
+ return internal.state.ir.duration;
54
+ },
55
+ grid(spec) {
56
+ setGrid(internal.state, spec);
57
+ return proxy;
58
+ },
59
+ range(start, end, value) {
60
+ assertSchedulable(value);
61
+ scheduleAt(internal.state, toSeconds(start), toSeconds(end), value);
62
+ return proxy;
63
+ },
64
+ push(value, duration) {
65
+ assertSchedulable(value);
66
+ const start = value.kind === 'audio'
67
+ ? internal.state.audioCursor
68
+ : internal.state.visualCursor;
69
+ const span = inferAutoDuration(value, duration);
70
+ scheduleAt(internal.state, start, start + span, value);
71
+ return proxy;
72
+ },
73
+ toIR() {
74
+ // Bind transition fromId/toId now that all clips are present (incl. nested remaps).
75
+ bindTransitions(internal.state.ir);
76
+ // JSON clone — works in isolated-vm (no structuredClone) and strips non-JSON.
77
+ return JSON.parse(JSON.stringify(internal.state.ir));
78
+ },
79
+ };
80
+ const proxy = new Proxy(api, {
81
+ get(target, prop, receiver) {
82
+ if (prop === INTERNAL)
83
+ return internal;
84
+ if (prop in target || typeof prop === 'symbol') {
85
+ return Reflect.get(target, prop, receiver);
86
+ }
87
+ const startParsed = parseTimeKey(prop);
88
+ if (startParsed === 'auto') {
89
+ // `t['-'] = value` — auto-append
90
+ return undefined;
91
+ }
92
+ return createRangeBinder(internal, startParsed);
93
+ },
94
+ set(target, prop, value, receiver) {
95
+ if (prop in api && prop !== 'duration' && prop !== 'length') {
96
+ return Reflect.set(target, prop, value, receiver);
97
+ }
98
+ if (isAutoPlayheadKey(prop)) {
99
+ assertSchedulable(value);
100
+ api.push(value);
101
+ return true;
102
+ }
103
+ // Single-index set is not supported (would be ambiguous). Guide users to dual-index.
104
+ throw new TypeError('Use t[start][end] = value, t.range(start, end, value), or t["-"] = value / t.push(value)');
105
+ },
106
+ has(target, prop) {
107
+ return prop in target || prop === INTERNAL;
108
+ },
109
+ });
110
+ return proxy;
111
+ }
112
+ export function isTimeline(value) {
113
+ return (typeof value === 'object'
114
+ && value !== null
115
+ && value.__sdk === true
116
+ && value.kind === 'timeline');
117
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @scenerok/transitions catalog — shared by VidScript plugin and TypeScript SDK.
3
+ *
4
+ * Each entry maps `tr.<fn>(...)` to a native two-texture GL pass that blends a
5
+ * "from" clip into a "to" clip using a GLSL shader.
6
+ */
7
+ export interface CatalogParam {
8
+ name: string;
9
+ default: string;
10
+ }
11
+ export interface TransitionCatalogEntry {
12
+ /** Public function name: tr.<fn>(...) */
13
+ fn: string;
14
+ /** Shader library key used by the render engine */
15
+ shaderName: string;
16
+ /** Default duration in seconds (used by auto-append / push) */
17
+ defaultDuration: number;
18
+ width: number;
19
+ height: number;
20
+ /** Positional args (in order) map to these param names. */
21
+ positional: string[];
22
+ params: CatalogParam[];
23
+ }
24
+ /** Common params shared by every transition function. */
25
+ export declare const TRANSITION_COMMON_PARAMS: CatalogParam[];
26
+ /**
27
+ * Every transition: 0.6 s default, 1920×1080, four common named params.
28
+ * fn names are the public API (WITHOUT the `tr.` prefix).
29
+ */
30
+ export declare const TRANSITIONS: TransitionCatalogEntry[];
31
+ export type TransitionFnName = (typeof TRANSITIONS)[number]['fn'];
32
+ export declare function getTransitionEntry(fn: string): TransitionCatalogEntry | undefined;
33
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/transitions/catalog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,yDAAyD;AACzD,eAAO,MAAM,wBAAwB,EAAE,YAAY,EAKlD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,sBAAsB,EA8B/C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAElE,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS,CAEjF"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @scenerok/transitions catalog — shared by VidScript plugin and TypeScript SDK.
3
+ *
4
+ * Each entry maps `tr.<fn>(...)` to a native two-texture GL pass that blends a
5
+ * "from" clip into a "to" clip using a GLSL shader.
6
+ */
7
+ /** Common params shared by every transition function. */
8
+ export const TRANSITION_COMMON_PARAMS = [
9
+ { name: 'direction', default: '' },
10
+ { name: 'ease', default: 'power2' },
11
+ { name: 'strength', default: '' },
12
+ { name: 'mode', default: '' },
13
+ ];
14
+ /**
15
+ * Every transition: 0.6 s default, 1920×1080, four common named params.
16
+ * fn names are the public API (WITHOUT the `tr.` prefix).
17
+ */
18
+ export const TRANSITIONS = [
19
+ { fn: 'dissolve', shaderName: 'dissolve', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
20
+ { fn: 'push', shaderName: 'push', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
21
+ { fn: 'cover', shaderName: 'cover', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
22
+ { fn: 'radial', shaderName: 'radial', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
23
+ { fn: 'grid', shaderName: 'grid', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
24
+ { fn: 'scale', shaderName: 'scale', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
25
+ { fn: 'cube', shaderName: 'cube', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
26
+ { fn: 'blur', shaderName: 'blur', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
27
+ { fn: 'distortion', shaderName: 'distortion', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
28
+ { fn: 'destruction', shaderName: 'destruction', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
29
+ { fn: 'light', shaderName: 'light', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
30
+ { fn: 'mechanical', shaderName: 'mechanical', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
31
+ { fn: 'wipe', shaderName: 'wipe', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
32
+ { fn: 'cinematic_zoom', shaderName: 'cinematic_zoom', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
33
+ { fn: 'whip_pan', shaderName: 'whip_pan', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
34
+ { fn: 'light_leak', shaderName: 'light_leak', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
35
+ { fn: 'flash', shaderName: 'flash', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
36
+ { fn: 'warp_morph', shaderName: 'warp_morph', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
37
+ { fn: 'domain_warp', shaderName: 'domain_warp', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
38
+ { fn: 'chromatic_split', shaderName: 'chromatic_split', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
39
+ { fn: 'lens', shaderName: 'lens', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
40
+ { fn: 'glitch', shaderName: 'glitch', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
41
+ { fn: 'swirl', shaderName: 'swirl', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
42
+ { fn: 'thermal', shaderName: 'thermal', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
43
+ { fn: 'ripple', shaderName: 'ripple', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
44
+ { fn: 'iris', shaderName: 'iris', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
45
+ { fn: 'burn', shaderName: 'burn', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
46
+ { fn: 'shatter', shaderName: 'shatter', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
47
+ { fn: 'liquid', shaderName: 'liquid', defaultDuration: 0.6, width: 1920, height: 1080, positional: [], params: TRANSITION_COMMON_PARAMS },
48
+ ];
49
+ export function getTransitionEntry(fn) {
50
+ return TRANSITIONS.find((entry) => entry.fn === fn);
51
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Client factories for `@scenerok/transitions`.
3
+ *
4
+ * Same surface as VidScript `import tr from "@scenerok/transitions"`:
5
+ *
6
+ * ```ts
7
+ * import { timeline, video } from '@scenerok/sdk'
8
+ * import tr from '@scenerok/transitions'
9
+ *
10
+ * t[0][5] = video('./a.mp4', { duration: 5 })
11
+ * t[5][5.6] = tr.dissolve()
12
+ * t[5.6][10] = video('./b.mp4', { duration: 4.4 })
13
+ * ```
14
+ *
15
+ * A transition window binds the clip active at start (from) and end (to).
16
+ * Binding runs in `timeline.toIR()` after all clips are scheduled.
17
+ */
18
+ import { type TimeInput } from '../duration.js';
19
+ import { type TransitionFnName } from './catalog.js';
20
+ import type { TransitionEffect, TransitionOptions } from '../types.js';
21
+ /** Create a transition by catalog function name. */
22
+ export declare function transition(fn: TransitionFnName | string, options?: TransitionOptions): TransitionEffect;
23
+ type TransitionFactory = (options?: TransitionOptions) => TransitionEffect;
24
+ export interface TransitionsPlugin {
25
+ dissolve: TransitionFactory;
26
+ push: TransitionFactory;
27
+ cover: TransitionFactory;
28
+ radial: TransitionFactory;
29
+ grid: TransitionFactory;
30
+ scale: TransitionFactory;
31
+ cube: TransitionFactory;
32
+ blur: TransitionFactory;
33
+ distortion: TransitionFactory;
34
+ destruction: TransitionFactory;
35
+ light: TransitionFactory;
36
+ mechanical: TransitionFactory;
37
+ wipe: TransitionFactory;
38
+ cinematic_zoom: TransitionFactory;
39
+ whip_pan: TransitionFactory;
40
+ light_leak: TransitionFactory;
41
+ flash: TransitionFactory;
42
+ warp_morph: TransitionFactory;
43
+ domain_warp: TransitionFactory;
44
+ chromatic_split: TransitionFactory;
45
+ lens: TransitionFactory;
46
+ glitch: TransitionFactory;
47
+ swirl: TransitionFactory;
48
+ thermal: TransitionFactory;
49
+ ripple: TransitionFactory;
50
+ iris: TransitionFactory;
51
+ burn: TransitionFactory;
52
+ shatter: TransitionFactory;
53
+ liquid: TransitionFactory;
54
+ /** Lookup by name — same as `transition(fn, options)`. */
55
+ transition: typeof transition;
56
+ }
57
+ declare const tr: TransitionsPlugin;
58
+ export { TRANSITIONS, TRANSITION_COMMON_PARAMS, getTransitionEntry, type CatalogParam, type TransitionCatalogEntry, type TransitionFnName, } from './catalog.js';
59
+ export type { TransitionEffect, TransitionOptions } from '../types.js';
60
+ export type { TimeInput };
61
+ export default tr;
62
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transitions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC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I,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,0DAA0D;IAC1D,UAAU,EAAE,OAAO,UAAU,CAAC;CAC/B;AAQD,QAAA,MAAM,EAAE,EAGH,iBAAiB,CAAC;AAEvB,OAAO,EACL,WAAW,EACX,wBAAwB,EACxB,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACvE,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,eAAe,EAAE,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Client factories for `@scenerok/transitions`.
3
+ *
4
+ * Same surface as VidScript `import tr from "@scenerok/transitions"`:
5
+ *
6
+ * ```ts
7
+ * import { timeline, video } from '@scenerok/sdk'
8
+ * import tr from '@scenerok/transitions'
9
+ *
10
+ * t[0][5] = video('./a.mp4', { duration: 5 })
11
+ * t[5][5.6] = tr.dissolve()
12
+ * t[5.6][10] = video('./b.mp4', { duration: 4.4 })
13
+ * ```
14
+ *
15
+ * A transition window binds the clip active at start (from) and end (to).
16
+ * Binding runs in `timeline.toIR()` after all clips are scheduled.
17
+ */
18
+ import { toSeconds } from '../duration.js';
19
+ import { getTransitionEntry, TRANSITIONS, } from './catalog.js';
20
+ function resolveDuration(entry, options) {
21
+ if (options.duration !== undefined)
22
+ return toSeconds(options.duration);
23
+ return entry.defaultDuration;
24
+ }
25
+ function buildTransition(entry, options = {}) {
26
+ const duration = resolveDuration(entry, options);
27
+ return {
28
+ __sdk: true,
29
+ kind: 'transition',
30
+ name: entry.fn,
31
+ shaderName: entry.shaderName,
32
+ options: { ...options },
33
+ duration,
34
+ with(opts) {
35
+ return buildTransition(entry, { ...options, ...opts });
36
+ },
37
+ };
38
+ }
39
+ /** Create a transition by catalog function name. */
40
+ export function transition(fn, options) {
41
+ const entry = getTransitionEntry(fn);
42
+ if (!entry) {
43
+ const known = TRANSITIONS.map((t) => t.fn).join(', ');
44
+ throw new Error(`Unknown transition '${fn}' (available: ${known})`);
45
+ }
46
+ return buildTransition(entry, options ?? {});
47
+ }
48
+ function makeFactory(entry) {
49
+ return (options) => buildTransition(entry, options ?? {});
50
+ }
51
+ const factories = Object.fromEntries(TRANSITIONS.map((entry) => [entry.fn, makeFactory(entry)]));
52
+ const tr = {
53
+ ...factories,
54
+ transition,
55
+ };
56
+ export { TRANSITIONS, TRANSITION_COMMON_PARAMS, getTransitionEntry, } from './catalog.js';
57
+ export default tr;