@canvakit/showreel 0.0.0-stage → 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.
package/LICENSE ADDED
@@ -0,0 +1,105 @@
1
+ # Functional Source License, Version 1.1, ALv2 Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-ALv2
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 AGENTIK SAS
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,132 @@
1
- # Temporary Holding Version
1
+ # @canvakit/showreel
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Generate a pitch **showreel** from a live web app — a single
4
+ `showreel.config.json` in, a narrated `.mp4` + `deck.pdf` out.
5
+
6
+ > **Status: scaffold.** The zod schema and the `MeasuredTimeline` (ms)
7
+ > contract are frozen and tested. The pipeline stages
8
+ > (`browser` / `scenes` / `audio` / `assemble`) are typed stubs whose
9
+ > bodies `throw new Error("not implemented")` — the real
10
+ > puppeteer-core / ElevenLabs / ffmpeg wiring branches in next.
11
+
12
+ ## The pipeline (target shape)
13
+
14
+ 1. **browser** — drive the live app (puppeteer-core, headless Chrome):
15
+ scripted `navigate` / `type` / `click` / `waitFor` → screenshots of key
16
+ states + a screen-recording.
17
+ 2. **scenes** — HTML/CSS promo motion-graphics (brand tokens injected via
18
+ `@canvakit/designkit`), recorded through the same headless-Chrome path.
19
+ 3. **audio** — ElevenLabs TTS narration, one clip per timeline item,
20
+ placed by its *measured* `startMs`; ElevenLabs Music API bed, ducked.
21
+ 4. **assemble** — ffmpeg mux (CFR concat, fades, title/outro cards) + a
22
+ deck PDF via `@canvakit/export` (Chrome print-to-pdf).
23
+
24
+ ## The frozen contract: `MeasuredTimeline`
25
+
26
+ ```ts
27
+ interface MeasuredTimelineItem {
28
+ id: string // matches the config timeline item's id
29
+ kind: "scene" | "capture" | "clip"
30
+ startMs: number // measured offset on the master timeline
31
+ endMs: number
32
+ }
33
+ type MeasuredTimeline = MeasuredTimelineItem[]
34
+ ```
35
+
36
+ This is **the** interface between capture and assembly. Durations are
37
+ *measured*, never assumed — a capture lasts until its `waitFor` resolves;
38
+ a scene lasts its declared `duration`. Narration `adelay` and clip
39
+ placement derive from this array, so A/V sync is deterministic and the
40
+ timeline is CI-diffable. It stays purely temporal: no clip paths live
41
+ here (those belong to `CaptureResult` / `SceneResult` / `AudioResult`).
42
+
43
+ ## Config
44
+
45
+ See [`showreel.config.example.jsonc`](./showreel.config.example.jsonc).
46
+ `timeline` is a single ordered list of heterogeneous `scene | capture |
47
+ clip` items (montage order == array order); item `id`s must be unique
48
+ because they key both narration and the measured timeline.
49
+
50
+ ### The `clip` kind
51
+
52
+ Mounts an existing video file onto the timeline:
53
+
54
+ ```json
55
+ {
56
+ "kind": "clip",
57
+ "id": "roll",
58
+ "src": "footage/roll.mp4",
59
+ "trim": { "startMs": 1000, "endMs": 4000 },
60
+ "fit": "cover",
61
+ "narration": "And here's the real thing, in production."
62
+ }
63
+ ```
64
+
65
+ - `src` resolves relative to the **config file's own directory** (absolute
66
+ paths pass through unchanged) — a clip asset travels with its config,
67
+ unlike a `brand` ref (see below), which resolves relative to wherever the
68
+ process is run from.
69
+ - No `duration` field — a clip's length is MEASURED via `ffprobe`, never
70
+ declared. `trim` (both bounds optional) narrows that measured window; a
71
+ `trim` outside what was actually measured throws immediately, naming the
72
+ item id and the resolved path.
73
+ - `fit` is `"cover"` (default — crops to fill, no bars) or `"contain"`
74
+ (letterboxes, never crops).
75
+ - Like a `scene`, a `clip` is always a segmentation singleton — it breaks a
76
+ run of consecutive `capture` items into two separate segments.
77
+
78
+ ### `brand` — using an existing design-kit `.design.md`
79
+
80
+ `brand` accepts an inline object, or a design ref string resolved via
81
+ `@canvakit/designkit`'s `DesignSourceRegistry` (`dk:<preset>`, `kit:<slug>`
82
+ → `_design/<slug>.md`, or `ws:<path>` → any workspace file). The `ws:`
83
+ resolver takes a plain filesystem path, so it already reaches ANY
84
+ `.design.md` on disk that a relative path can walk to — no new scheme is
85
+ needed to point a showreel at a design kit that lives outside the
86
+ package's own `_design/` folder. For example, the Agentik brand kit at
87
+ `projects/agentik-branding/design-kit/agentik.design.md` (repo-relative)
88
+ is usable as-is:
89
+
90
+ ```jsonc
91
+ // invoked from this package's root: canvakit showreel <config>
92
+ "brand": "ws:../../agentik-branding/design-kit/agentik.design.md"
93
+ ```
94
+
95
+ (`agentik-dark.design.md` sits right next to it for a dark-surface variant.)
96
+ `ws:`/`kit:` refs resolve relative to **`process.cwd()`** when the pipeline
97
+ runs (`runShowreelWith`'s default `fs`, or `deps.fs` if you override it) —
98
+ not the config file's directory, unlike a `clip`'s `src` above — so the
99
+ exact `../` count depends on where you invoke `canvakit showreel` from; the
100
+ path above assumes the canonical invocation shown in Usage, from
101
+ `packages/showreel/`.
102
+
103
+ ## Usage
104
+
105
+ ```sh
106
+ # validate + preview the planned timeline (no rendering yet)
107
+ canvakit showreel packages/showreel/showreel.config.example.jsonc
108
+ ```
109
+
110
+ ```ts
111
+ import { validateConfig, type ShowreelConfig } from "@canvakit/showreel"
112
+
113
+ const config: ShowreelConfig = validateConfig(JSON.parse(raw))
114
+ ```
115
+
116
+ ## Structure
117
+
118
+ ```
119
+ src/
120
+ core/ schema.ts — zod contract + MeasuredTimeline + validateConfig
121
+ browser/ puppeteer-core capture (stub)
122
+ scenes/ designkit promo scenes (stub)
123
+ audio/ ElevenLabs TTS + music (stub)
124
+ assemble/ ffmpeg mux + deck PDF (stub)
125
+ index.ts barrel
126
+ ```
127
+
128
+ ## License
129
+
130
+ [FSL-1.1-ALv2](./LICENSE), the Functional Source License with an Apache 2.0 future
131
+ license: free for any use except offering a competing product or service, and
132
+ each version becomes Apache-2.0 two years after its release. Copyright AGENTIK SAS.