Clone any viral video with AI agents. Not just a script, the whole workflow: swap the face, the words, the B-roll, ship 100 variants in one command, and get your 100M views.
TypeScript agentic-aiaiai-agentsai-videocompilerdslffmpeggenerative-aillmmarkup-languagemonorepoplugin-systemprogramming-languagetext-to-videotypescriptvideovideo-automationvideo-clonevideo-editingvideo-generation
feat(v2): activate independent packages and prove live run
kashorin8c17a587b643
diff --git a/README.md b/README.mdindex 07a95ced..9d81efa6 100644--- a/README.md+++ b/README.md@@ -77,7 +77,7 @@ The repository implements:The complete live path is:```text-Script → Estimate → Seedance × 2 → media normalization → WhisperX → SemanticMap+Script → Estimate → Seedance × N → media normalization → WhisperX → SemanticMap→ Gemini CaptionPlan → peer Tracks → Film → HyperFrames → audio mix → MP4```@@ -98,10 +98,12 @@ pnpm checkpnpm test# Compile a complete provider-free v2 author graph.-pnpm svml:v2 check examples/talking-film-graph-check/main.svml+pnpm svml:v2 check examples/talking-film-graph-check/main.svml \+ --package-lock examples/talking-film-graph-check/svml.packages.lock --root .# Compile the self-described Run Graph and inspect its finite plan.-pnpm svml:v2 plan examples/talking-film-graph-check/build.svrun+pnpm svml:v2 plan examples/talking-film-graph-check/build.svrun \+ --package-lock examples/talking-film-graph-check/svml.packages.lock --root .```The live example uses an explicit Run Graph, declarative local Runtime Profile and external@@ -110,6 +112,8 @@ credentials:```bashpnpm svml:v2 build examples/talking-film-live/build.svrun \--runtime examples/talking-film-live/svml.runtime.json \+ --package-lock examples/talking-film-live/svml.packages.lock \+ --root . \--build-id talking-film-live \--follow@@ -170,7 +174,7 @@ packages/compiler-node reference Node compiler Hostpackages/compiler-text-node optional official Text compiler assemblypackages/package-loader-node syntax-neutral trusted physical-package loadingpackages/cli generic commands requiring an explicit Distribution-packages/video-cli official Text/video command Distribution+packages/video-cli official video command application; no author-package aggregatepackages/run syntax-neutral Run Source closure and complete Run Graph compilerpackages/run-text optional official human-readable Run Frontendpackages/runtime environment-neutral scheduling and Store portsdiff --git a/docs/README.md b/docs/README.mdindex 11c8d43d..2bd83461 100644--- a/docs/README.md+++ b/docs/README.md@@ -48,6 +48,8 @@ These video contracts are executable candidates, not yet an open-source compatib- [`media-execution-boundary-v1.md`](./media-execution-boundary-v1.md)- [`caption-gemini-provider-contract.md`](./caption-gemini-provider-contract.md)- [`../services/whisperx/README.md`](../services/whisperx/README.md)+- [`../examples/echo-pro-aroll/README.md`](../examples/echo-pro-aroll/README.md) — current four-take+ live acceptance and explicit historical-Candidate reuse witness.- [`../examples/talking-film-live/README.md`](../examples/talking-film-live/README.md)## Documentation rulesdiff --git a/examples/README.md b/examples/README.mdindex f3014cb3..0e32b969 100644--- a/examples/README.md+++ b/examples/README.md@@ -7,6 +7,9 @@requirements.- [`talking-film-live`](./talking-film-live/README.md) executes the real paid two-take path with KIE,local media processing, local WhisperX, Vertex Caption planning and local HyperFrames rendering.+- [`echo-pro-aroll`](./echo-pro-aroll/README.md) is the current four-take acceptance witness and+ demonstrates a second Run that explicitly reuses historical shot Records as zero-input+ Candidates without another KIE submission.- [`talking-film-golden`](./talking-film-golden/README.md) is the larger authoring and visual designfixture used while video packages remain pre-freeze.- [`v2-bootstrap`](./v2-bootstrap/README.md) is the smallest official Text/Script/SVS source-closurediff --git a/examples/echo-pro-aroll/README.md b/examples/echo-pro-aroll/README.mdnew file mode 100644index 00000000..d319b1bf--- /dev/null+++ b/examples/echo-pro-aroll/README.md@@ -0,0 +1,107 @@+# Echo Pro A-roll++Complete four-take Seedance Mini talking-head film with measured captions.++Supply these ignored local assets before checking or building:++- `presenter-clean.png`+- `presenter-with-echo.png`+- `presenter-voice.mp3`++Every take uses the same voice-timbre reference. The visual reference sequence is clean, product,+product, clean.++`@svml/seedance-speaker` binds the reusable project SVS Recipe, Script dialogue and explicit+references into a Prompt Kit Invocation. The generic `@svml/prompt-kit` author compiler applies the+separately imported `official-ugc-v1.svs` mapping. It emits an ordered Prompt Program and exact+Seedance Speech Program while compiling `main.svml`; neither operation is a Runtime task.+The four generated videos are normalized and concatenated into one Speech Spine. One canonical+audio projection goes through WhisperX, direct Script alignment produces the complete SemanticMap,+Gemini plans Cue cuts and the `important` field without seeing timing, and the resulting Caption+VisualTrack joins the peer speech visual/audio Tracks in Film. HyperFrames renders and muxes the+single `final.video` target.++The current deterministic estimate is 12, 15, 15 and 15 seconds. The Recipe deliberately caps a+take at Seedance's 15-second request limit.++Create the explicit package lock used by this development-workspace example:++```sh+pnpm svml:v2 lock-packages examples/echo-pro-aroll/svml.packages.lock \+ --package @svml/artifact \+ --package @svml/contracts \+ --package @svml/media \+ --package @svml/svs \+ --package @svml/script \+ --package @svml/estimate \+ --package @svml/prompt-kit \+ --package @svml/generation \+ --package @svml/seedance \+ --package @svml/seedance-speaker \+ --package @svml/speech-align \+ --package @svml/speech-take \+ --package @svml/speech-program \+ --package @svml/whisperx \+ --package @svml/caption \+ --package @svml/caption-gemini \+ --package @svml/film \+ --package @svml/hyperframes \+ --package @svml/media-pipeline \+ --package @svml/hyperframes-render \+ --package @svml/run-text \+ --root .+```++Inspect all authored outputs—including `*.prompt` and `*.program`—without a paid call:++```sh+pnpm svml:v2 check examples/echo-pro-aroll/main.svml \+ --package-lock examples/echo-pro-aroll/svml.packages.lock \+ --root .+```++Inspect the exact paid plan before submitting it:++```sh+pnpm svml:v2 plan examples/echo-pro-aroll/build.svrun \+ --package-lock examples/echo-pro-aroll/svml.packages.lock \+ --root .+```++Build the complete film after starting the local WhisperX sidecar and exposing `KIE_API_KEY`,+`GOOGLE_CLOUD_PROJECT` and `GOOGLE_APPLICATION_CREDENTIALS_JSON`:++```sh+pnpm svml:v2 build examples/echo-pro-aroll/build.svrun \+ --runtime examples/echo-pro-aroll/svml.runtime.json \+ --package-lock examples/echo-pro-aroll/svml.packages.lock \+ --root . \+ --build-id echo-pro-film-001 \+ --follow++pnpm svml:v2 get echo-pro-film-001 \+ --runtime examples/echo-pro-aroll/svml.runtime.json \+ --name final.video \+ --to examples/echo-pro-aroll/output/final.mp4+```++Run the same downstream film from the four archived generated shots without another Seedance+submission:++```sh+pnpm svml:v2 build examples/echo-pro-aroll/reuse-generated.svrun \+ --runtime examples/echo-pro-aroll/svml.runtime.json \+ --package-lock examples/echo-pro-aroll/svml.packages.lock \+ --root . \+ --build-id echo-pro-film-reuse-001 \+ --follow+```++`reuse-generated.svrun` names the four public shot aliases from `echo-pro-film-001`, exposes each+verified historical Record as a zero-input Candidate and explicitly satisfies the corresponding+logical output as `substitute`. Reverse demand therefore removes all four Seedance branches while+keeping media normalization, WhisperX, Gemini planning, Film and rendering reachable. This is a new+Build, not a continuation or automatic cache hit.++The package lock lists independent packages. It is not a hidden video bundle, and the video CLI+contains no authoring or Run-language package by default.diff --git a/examples/echo-pro-aroll/build.svrun b/examples/echo-pro-aroll/build.svrunnew file mode 100644index 00000000..0844e420--- /dev/null+++ b/examples/echo-pro-aroll/build.svrun@@ -0,0 +1,10 @@+<?svml using="@svml/run-text@1"?>++<svrun version="1" targets="delivery">+ <author source="./main.svml"/>++ <target-set id="delivery">+ <target output="final.video" accepts="exact"/>+ </target-set>++</svrun>diff --git a/examples/echo-pro-aroll/main.svml b/examples/echo-pro-aroll/main.svmlnew file mode 100644index 00000000..be2c3c3b--- /dev/null+++ b/examples/echo-pro-aroll/main.svml@@ -0,0 +1,137 @@+<?svml using="@svml/text@1"?>++<svml>+ <import from="@svml/script@1"/>+ <import as="media" from="@svml/media@1"/>+ <import as="estimate" from="@svml/estimate@1"/>+ <import as="speaker" from="@svml/seedance-speaker@1"/>+ <import as="speech" from="@svml/speech@1"/>+ <import as="whisperx" from="@svml/whisperx@1"/>+ <import as="caption" from="@svml/caption@1"/>+ <import as="caption-ai" from="@svml/caption-gemini@1"/>+ <import as="film" from="@svml/film@1"/>+ <import as="render" from="@svml/hyperframes-render@1"/>+ <import as="studio" source="./studio.svs"/>+ <import as="ugc" source="../../packages/seedance-speaker/kits/official-ugc-v1.svs"/>++ <script id="story">+ <hook>+ <HOST>Girls, you need to hear this. Never let anyone take credit for your work. For years, my boss presented my ideas as his, and I kept telling myself I needed proof—but the truth is, I was too scared to speak up.+ </hook>++ <meeting>+ <HOST>Then I found Echo Pro: a card-sized recorder that snaps onto the back of my phone, paired with an AI agent. I brought it to one meeting. It captured every word, organized the minutes, and showed exactly where my work had been overlooked. For once, I felt seen.+ </meeting>++ <evidence>+ <HOST>That gave me the courage I was missing. Before our month-end review, I gave Echo Pro the meeting notes and my actual work files. It connected the dots and turned everything into one clear, evidence-backed report of what I had really delivered.+ </evidence>++ <payoff>+ <HOST>And guess what? I’m sitting in my old boss’s chair now. The first thing I did was give every person on my team an Echo Pro—so work gets easier, achievements stay visible, and no one has to fight alone just to get the credit they’ve earned.+ </payoff>+ </script>++ <!-- Author-owned reference material. -->+ <media:Image id="presenter-clean" src="./assets/presenter-clean.png"/>+ <media:Image id="presenter-with-echo" src="./assets/presenter-with-echo.png"/>+ <media:Audio id="presenter-voice" src="./assets/presenter-voice.mp3"/>++ <!-- Duration remains an explicit graph fact derived from the pronunciation projection. -->+ <estimate:Speech id="hook-duration" source={story.segment.hook.speech} policy={studio.speech.normal}/>+ <estimate:Speech id="meeting-duration" source={story.segment.meeting.speech} policy={studio.speech.normal}/>+ <estimate:Speech id="evidence-duration" source={story.segment.evidence.speech} policy={studio.speech.normal}/>+ <estimate:Speech id="payoff-duration" source={story.segment.payoff.speech} policy={studio.speech.normal}/>++ <!-- Clean → product → product → clean; all four share the same voice reference. -->+ <speaker:Take+ id="hook-take"+ dialogue={story.segment.hook.dialogue}+ duration={hook-duration.duration}+ recipe={studio.speaker.echo-pro}+ kit={ugc.official-ugc-v1}+ >+ <speaker:Reference image={presenter-clean} role="character-and-scene"/>+ <speaker:Reference audio={presenter-voice} role="voice-timbre"/>+ </speaker:Take>++ <speaker:Take+ id="meeting-take"+ dialogue={story.segment.meeting.dialogue}+ duration={meeting-duration.duration}+ recipe={studio.speaker.echo-pro}+ kit={ugc.official-ugc-v1}+ >+ <speaker:Reference image={presenter-with-echo} role="character-and-scene"/>+ <speaker:Reference audio={presenter-voice} role="voice-timbre"/>+ </speaker:Take>++ <speaker:Take+ id="evidence-take"+ dialogue={story.segment.evidence.dialogue}+ duration={evidence-duration.duration}+ recipe={studio.speaker.echo-pro}+ kit={ugc.official-ugc-v1}+ >+ <speaker:Reference image={presenter-with-echo} role="character-and-scene"/>+ <speaker:Reference audio={presenter-voice} role="voice-timbre"/>+ </speaker:Take>++ <speaker:Take+ id="payoff-take"+ dialogue={story.segment.payoff.dialogue}+ duration={payoff-duration.duration}+ recipe={studio.speaker.echo-pro}+ kit={ugc.official-ugc-v1}+ >+ <speaker:Reference image={presenter-clean} role="character-and-scene"/>+ <speaker:Reference audio={presenter-voice} role="voice-timbre"/>+ </speaker:Take>++ <!-- Four equal Takes become one ordered speech coordinate space and two peer Tracks. -->+ <speech:Spine id="speech">+ <speech:Take source={hook-take.video} segment={story.segment.hook}/>+ <speech:Take source={meeting-take.video} segment={story.segment.meeting}/>+ <speech:Take source={evidence-take.video} segment={story.segment.evidence}/>+ <speech:Take source={payoff-take.video} segment={story.segment.payoff}/>+ </speech:Spine>++ <!-- One measured evidence pass locates the complete authored Script. -->+ <whisperx:Alignment id="timing" narrative={story} audio={speech.audio}/>++ <!-- Gemini sees display atoms and these requirements, never audio or timing. -->+ <caption:Style id="primary-caption" appearance={studio.caption.primary} mode="proportional-word">+ <caption:Cues>+ Split each Script Segment into short complete semantic phrases of two to seven words.+ Never cross a sentence or Segment boundary.+ </caption:Cues>+ <caption:Field id="important" type="boolean" min-per-cue="1" max-per-cue="2">+ Select one or two words whose emphasis best communicates this Cue.+ </caption:Field>+ </caption:Style>++ <caption:Program id="caption-program" narrative={story} default={primary-caption}/>+ <caption-ai:Planner+ id="caption-plan"+ narrative={story}+ program={caption-program}+ model="gemini-2.5-flash"+ />++ <!-- Caption becomes an ordinary self-contained VisualTrack after joining the measured map. -->+ <caption:Track+ id="captions"+ narrative={story}+ map={timing.map}+ program={caption-program}+ plan={caption-plan.plan}+ />++ <film:Film id="main" space={speech.space} appearance={studio.film.vertical}>+ <film:Track source={speech.visual}/>+ <film:Track source={speech.audioTrack}/>+ <film:Track source={captions.track}/>+ </film:Film>++ <render:Video id="final" composition={main.composition}/>+</svml>diff --git a/examples/echo-pro-aroll/reuse-generated.svrun b/examples/echo-pro-aroll/reuse-generated.svrunnew file mode 100644index 00000000..ad7cde2b--- /dev/null+++ b/examples/echo-pro-aroll/reuse-generated.svrun@@ -0,0 +1,18 @@+<?svml using="@svml/run-text@1"?>+<svrun version="1" targets="delivery">+ <author source="./main.svml"/>++ <target-set id="delivery">+ <target output="final.video" accepts="substitute"/>+ </target-set>++ <build-record id="hook-video" build="echo-pro-film-001" output="hook-take.video"/>+ <build-record id="meeting-video" build="echo-pro-film-001" output="meeting-take.video"/>+ <build-record id="evidence-video" build="echo-pro-film-001" output="evidence-take.video"/>+ <build-record id="payoff-video" build="echo-pro-film-001" output="payoff-take.video"/>++ <satisfy output="hook-take.video" candidate="hook-video" fidelity="substitute"/>+ <satisfy output="meeting-take.video" candidate="meeting-video" fidelity="substitute"/>+ <satisfy output="evidence-take.video" candidate="evidence-video" fidelity="substitute"/>+ <satisfy output="payoff-take.video" candidate="payoff-video" fidelity="substitute"/>+</svrun>diff --git a/examples/echo-pro-aroll/studio.svs b/examples/echo-pro-aroll/studio.svsnew file mode 100644index 00000000..70f0c22f--- /dev/null+++ b/examples/echo-pro-aroll/studio.svs@@ -0,0 +1,49 @@+<?svml using="@svml/svs@1"?>++<sheet version="1">+ speech.normal {+ language: en;+ pace: normal;+ padding: 0.3;+ min: 4;+ max: 15;+ rounding: ceil;+ }++ speaker.echo-pro {+ kind: ugc-talking-head;+ model: mini;+ resolution: 720p;+ aspect-ratio: 9:16;++ composition-stability: soft-locked;+ camera-motion: none;+ edit-rhythm: continuous-take;+ performance: natural-explainer;+ gesture: natural;+ voice-mode: single-speaker;+ }++ film.vertical {+ width: 720;+ height: 1280;+ frame-rate: 30;+ background: #09090B;+ }++ caption.primary {+ stack-order: 70;+ x: 0.08;+ y: 0.74;+ width: 0.84;+ font: Inter;+ weight: 800;+ size: 44;+ line-height: 1;+ align: center;+ fill: #FFFFFF;+ background: #09090BCC;+ padding: 14 20;+ radius: 16;+ }+</sheet>diff --git a/examples/echo-pro-aroll/svml.packages.lock b/examples/echo-pro-aroll/svml.packages.locknew file mode 100644index 00000000..118bd14c--- /dev/null+++ b/examples/echo-pro-aroll/svml.packages.lock@@ -0,0 +1,336 @@+{+ "format": "svml.node-package-lock@1",+ "artifacts": [+ {+ "name": "@svml/artifact",+ "version": "0.0.0-dev",+ "digest": "sha256:368270c5c19f9300599a4a1ee9f7525f39b1e3e2c036bf0b03317fa2dc32a303"+ },+ {+ "name": "@svml/caption-gemini",+ "version": "0.0.0-dev",+ "digest": "sha256:13a61548967a7bfad911bb369719466f4051434c06729c5ab3c154e7aeb898a0"+ },+ {+ "name": "@svml/caption",+ "version": "0.0.0-dev",+ "digest": "sha256:a713e3b93bc5f1284d98a4a8e586662e1cb009b329eb0394229bf5170f996527"+ },+ {+ "name": "@svml/component-kit",+ "version": "0.0.0-dev",+ "digest": "sha256:789d38bf44d7d40cf13734e09f68c8fd8302807fcd9b20a9ef0439f488af1ae2"+ },+ {+ "name": "@svml/contracts",+ "version": "0.0.0-dev",+ "digest": "sha256:3ff4cc952af34cd1a593a7410c688a81ad40ff23ce637b3e427776b1d2e2faa5"+ },+ {+ "name": "@svml/core",+ "version": "0.0.0-dev",+ "digest": "sha256:cfb73d509a819e42cad5490f26e53bf4e28a2df7ed1e47ffa85bb2833e40bd1e"+ },+ {+ "name": "@svml/elaborator",+ "version": "0.0.0-dev",+ "digest": "sha256:d31db89e8b0b81ec7e26da804500d14447af7fdf90c6af3a0ad95504c39f37a2"+ },+ {+ "name": "@svml/estimate",+ "version": "0.0.0-dev",+ "digest": "sha256:91770660f244539d2d0db49d46000073cca3202c6148c17466c0547001c4f2dc"+ },+ {+ "name": "@svml/film",+ "version": "0.0.0-dev",+ "digest": "sha256:bdb739078b86f66e1b0fed646fbab675ff4875b74b5c1b58c122e5c3feb61515"+ },+ {+ "name": "@svml/generation",+ "version": "0.0.0-dev",+ "digest": "sha256:e1dd0c788e89989f679ed3f1de3825d3d76df32a1670258922c42fe0b7414940"+ },+ {+ "name": "@svml/host",+ "version": "0.0.0-dev",+ "digest": "sha256:a59a3ac2647bebd223b6ebb4d2830a1c86a19d427d49095ae3479de79519f815"+ },+ {+ "name": "@svml/hyperframes-render",+ "version": "0.0.0-dev",+ "digest": "sha256:84fdc643dcfc751fe1c429d6d5ee665f64f0e1de8b3a3208ff64ed12c0986343"+ },+ {+ "name": "@svml/hyperframes",+ "version": "0.0.0-dev",+ "digest": "sha256:aea7f05d870f84782efe831c09dd729d5303cc9a5b7a54184ac3d1c193bd59fa"+ },+ {+ "name": "@svml/media-pipeline",+ "version": "0.0.0-dev",+ "digest": "sha256:05cf1caee616a44c3a2796d93b38fc6022544b751a29aeaf25869d5f7a84f260"+ },+ {+ "name": "@svml/media",+ "version": "0.0.0-dev",+ "digest": "sha256:2f9d4d7d76397d96991277a1aa372bc3ca7783cccfb27cc8516366c7c9fe2300"+ },+ {+ "name": "@svml/model-kit",+ "version": "0.0.0-dev",+ "digest": "sha256:51c71bac3365c6811b27d0aa345b63ff64cee26047bd33b524ad6aa969cc02de"+ },+ {+ "name": "@svml/prompt-kit",+ "version": "0.0.0-dev",+ "digest": "sha256:4373ee51043dc513a04b159e90000147775ff09aa12d5496340f8297903d1575"+ },+ {+ "name": "@svml/protocol",+ "version": "0.0.0-dev",+ "digest": "sha256:849da200db7a4389f114381ac7b4ce64766ed350481d271394cd0c7348e76786"+ },+ {+ "name": "@svml/realization",+ "version": "0.0.0-dev",+ "digest": "sha256:049aea1333272415b6605c10004d1ca26c72d348bd00c1885927f425cedc60a2"+ },+ {+ "name": "@svml/run-text",+ "version": "0.0.0-dev",+ "digest": "sha256:77d70b1e6f8a2144e71412ca5c44ea80209546525c5b0c3db645d0413b4bd5fc"+ },+ {+ "name": "@svml/run",+ "version": "0.0.0-dev",+ "digest": "sha256:2a083172479c60e759d630acee3bf34a838123d11ac80b30117d62dc2f6a8f21"+ },+ {+ "name": "@svml/script",+ "version": "0.0.0-dev",+ "digest": "sha256:dfde3dd72c7151982e16c8cef39118d1514b5bf0f38543c25b601ae238fd0bfb"+ },+ {+ "name": "@svml/seedance-speaker",+ "version": "0.0.0-dev",+ "digest": "sha256:12e0433da60323502018c5c6cf640e2d2dd3815bec547bc5f919f9d152909dce"+ },+ {+ "name": "@svml/seedance",+ "version": "0.0.0-dev",+ "digest": "sha256:f557df859cebe1af12da15890f891ca92af436583234aec694517b82fa6f3bb4"+ },+ {+ "name": "@svml/source",+ "version": "0.0.0-dev",+ "digest": "sha256:2ab24d6e0a392e602f99573166ce3d48a8c561fa55f9ee425a25361077b8c483"+ },+ {+ "name": "@svml/speech-align",+ "version": "0.0.0-dev",+ "digest": "sha256:fd66824aeae08e54e7d224cbe151bd8f1ee75e429071cc05aed1fddf52fe9c12"+ },+ {+ "name": "@svml/speech-program",+ "version": "0.0.0-dev",+ "digest": "sha256:154950cc6346aad5b00c22450ca7e346186e3c51247d3fc11b444710d879a70a"+ },+ {+ "name": "@svml/speech-take",+ "version": "0.0.0-dev",+ "digest": "sha256:67c738aede20b50bcdd748aa46ba0563b01731444eb4de7663b299f1006f863e"+ },+ {+ "name": "@svml/svs",+ "version": "0.0.0-dev",+ "digest": "sha256:a336db7f075cab5357a96ba0d3b079c213c93fa0a4f95c39926c2e1b784d3d24"+ },+ {+ "name": "@svml/text",+ "version": "0.0.0-dev",+ "digest": "sha256:03985ce5c8bf04fc8dcfc474b4b80133a5bffbb6965604bdc0f9f8fb64ad0524"+ },+ {+ "name": "@svml/validation",+ "version": "0.0.0-dev",+ "digest": "sha256:4322dffd7ea245484a12fb674a0d2f70f25d1287b9f7aa67ed5714431035e9dd"+ },+ {+ "name": "@svml/whisperx",+ "version": "0.0.0-dev",+ "digest": "sha256:e3fe125fbb4ed52ffb6f099674181dda2ae859890c712644402f63745739a7b8"+ }+ ],+ "packages": [+ {+ "specifier": "@svml/artifact",+ "package": {+ "name": "@svml/artifact",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:ed2ce2db96aff1ca26c03c28fbf3a3b7da9f25d13ea5cf62525ad6a606f952cf"+ },+ {+ "specifier": "@svml/caption",+ "package": {+ "name": "@svml/caption",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:182ddde2b002c4c3bc2013c5e984831aa6d034d1ded3ab17e0e71e4dd307438a"+ },+ {+ "specifier": "@svml/caption-gemini",+ "package": {+ "name": "@svml/caption-gemini",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:06d8072364f86102207c0a4bc0b59f126613010636250f53f9d5184d31bb2766"+ },+ {+ "specifier": "@svml/contracts",+ "package": {+ "name": "@svml/contracts",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:1bba3b6672c77931cbc0e002d0509c6ba8f8612cb2a4e0c5897831230b3f35a9"+ },+ {+ "specifier": "@svml/estimate",+ "package": {+ "name": "@svml/estimate",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:9ed84b03dc1ff2010dafae78d98be326058d466bdca92d71398bc237b8c239cc"+ },+ {+ "specifier": "@svml/film",+ "package": {+ "name": "@svml/film",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:3670c3b1093c0d4a1fea763f4fd071a86cae99e1348aee3dbc6cb57d30252dd2"+ },+ {+ "specifier": "@svml/generation",+ "package": {+ "name": "@svml/generation",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:fcba65cbdbe1bf8e3df2df7bd96004b98241a2cc577d5e836b1f9640c6204918"+ },+ {+ "specifier": "@svml/hyperframes",+ "package": {+ "name": "@svml/hyperframes",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:7ad54eba232aa29e5c7475d798fdfc19f51ae72c0fc49171df84b63cbe0921d5"+ },+ {+ "specifier": "@svml/hyperframes-render",+ "package": {+ "name": "@svml/hyperframes-render",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:7ca59aba36e096f1a088ae4510d59d27ec083295ac08d224eae8bc51e51b5af3"+ },+ {+ "specifier": "@svml/media",+ "package": {+ "name": "@svml/media",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:c2b1e3c1fee0315dada7ad9bcc806cd52eb152ef3efd3aca0313c16944e156ad"+ },+ {+ "specifier": "@svml/media-pipeline",+ "package": {+ "name": "@svml/media-pipeline",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:b44c81fb191daf1578cf0ba32272b2f7ec8228bb102e8150aebe5851a88e233d"+ },+ {+ "specifier": "@svml/prompt-kit",+ "package": {+ "name": "@svml/prompt-kit",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:426de83b2e174b73026913781e661e57a6b25120898ef34b327f5dd87db99e5e"+ },+ {+ "specifier": "@svml/run-text",+ "package": {+ "name": "@svml/run-text",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:b3ef99ff47151f27a7601586667fff693724bbe50d45b30317da827997d6a6b4"+ },+ {+ "specifier": "@svml/script",+ "package": {+ "name": "@svml/script",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:e7d80b9059cae0881ee29bfa6e18f96b445c43227ae665b93196aa4eeaeb1f21"+ },+ {+ "specifier": "@svml/seedance",+ "package": {+ "name": "@svml/seedance",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:99a965be70300fe85f53e9cd660efe1a99ce390061f7f1f759e2892ce8965f30"+ },+ {+ "specifier": "@svml/seedance-speaker",+ "package": {+ "name": "@svml/seedance-speaker",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:776b0b7aa7dc312eda8566d05f2db7c8b3c25ced8f8dd9181c89940cb90762db"+ },+ {+ "specifier": "@svml/speech-align",+ "package": {+ "name": "@svml/speech-align",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:5a9a50527fb24cb04c3ddef171b180591522a6ac47d8c186ffb74edf9f3dbe55"+ },+ {+ "specifier": "@svml/speech-program",+ "package": {+ "name": "@svml/speech-program",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:35fbb339defcbbdf7cd0a117ec6fef71e2b348e750a0448c8fe58a4fe1798c68"+ },+ {+ "specifier": "@svml/speech-take",+ "package": {+ "name": "@svml/speech-take",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:58dbc3fe7e419e563bbcdbdd6101c2857fe1e00d1992b2d3cf915803203fca02"+ },+ {+ "specifier": "@svml/svs",+ "package": {+ "name": "@svml/svs",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:40b91f0e3bbaae42fb7bccacb28f49f44a2be37b0506292c49ed98f842371ebe"+ },+ {+ "specifier": "@svml/whisperx",+ "package": {+ "name": "@svml/whisperx",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:8cfd95fd8932a7159a6a1b82a73ad3858aa5e3a99d96e6a793d3c7d02c235b9d"+ }+ ],+ "digest": "sha256:ffb477f7b19d975c09197db11e7b3c7952f643544d84ba2bcd1400859fac037d"+}diff --git a/examples/echo-pro-aroll/svml.runtime.json b/examples/echo-pro-aroll/svml.runtime.jsonnew file mode 100644index 00000000..7b30a826--- /dev/null+++ b/examples/echo-pro-aroll/svml.runtime.json@@ -0,0 +1,72 @@+{+ "format": "svml.runtime-config@1",+ "packageLock": "./svml.packages.lock",+ "services": [],+ "endpoints": [+ {+ "use": "@svml/provider-kie",+ "instance": "kie.echo-pro-aroll",+ "lane": "generation",+ "config": {+ "apiKeyEnv": "KIE_API_KEY",+ "defaultConcurrency": 2+ }+ },+ {+ "use": "@svml/provider-media-local",+ "instance": "media.echo-pro-aroll",+ "lane": "media",+ "config": {+ "defaultConcurrency": 2+ }+ },+ {+ "use": "@svml/provider-whisperx-local",+ "instance": "whisperx.echo-pro-aroll",+ "lane": "alignment",+ "config": {+ "defaultConcurrency": 1+ }+ },+ {+ "use": "@svml/provider-google-vertex",+ "instance": "vertex.echo-pro-aroll",+ "lane": "planning",+ "config": {+ "projectEnv": "GOOGLE_CLOUD_PROJECT",+ "credentialsEnv": "GOOGLE_APPLICATION_CREDENTIALS_JSON",+ "location": "global",+ "defaultConcurrency": 1+ }+ },+ {+ "use": "@svml/provider-hyperframes-local",+ "instance": "hyperframes.echo-pro-aroll",+ "lane": "render",+ "config": {+ "workers": 2,+ "quality": "standard",+ "defaultConcurrency": 1+ }+ }+ ],+ "permissions": [+ "filesystem:whisperx-staging",+ "network:aiplatform.googleapis.com",+ "network:api.kie.ai",+ "network:kieai.redpandaai.co",+ "network:whisperx-loopback",+ "process:hyperframes",+ "process:media"+ ],+ "scheduling": {+ "maxConcurrency": 4,+ "lanes": {+ "generation": 2,+ "media": 2,+ "alignment": 1,+ "planning": 1,+ "render": 1+ }+ }+}diff --git a/examples/talking-film-graph-check/README.md b/examples/talking-film-graph-check/README.mdindex a0538bc5..973c82c9 100644--- a/examples/talking-film-graph-check/README.md+++ b/examples/talking-film-graph-check/README.md@@ -6,9 +6,12 @@ explicit HyperFrames rendering. `check` and `plan` do not invoke Seedance, WhispHyperFrames.```bash-pnpm svml:v2 check examples/talking-film-graph-check/main.svml-pnpm svml:v2 check examples/talking-film-graph-check/build.svrun-pnpm svml:v2 plan examples/talking-film-graph-check/build.svrun+pnpm svml:v2 check examples/talking-film-graph-check/main.svml \+ --package-lock examples/talking-film-graph-check/svml.packages.lock --root .+pnpm svml:v2 check examples/talking-film-graph-check/build.svrun \+ --package-lock examples/talking-film-graph-check/svml.packages.lock --root .+pnpm svml:v2 plan examples/talking-film-graph-check/build.svrun \+ --package-lock examples/talking-film-graph-check/svml.packages.lock --root .```The Gemini planner receives immutable left-side display atoms and resolved style runs only. Its genericdiff --git a/examples/talking-film-graph-check/svml.packages.lock b/examples/talking-film-graph-check/svml.packages.locknew file mode 100644index 00000000..1531d193--- /dev/null+++ b/examples/talking-film-graph-check/svml.packages.lock@@ -0,0 +1,323 @@+{+ "format": "svml.node-package-lock@1",+ "artifacts": [+ {+ "name": "@svml/artifact",+ "version": "0.0.0-dev",+ "digest": "sha256:368270c5c19f9300599a4a1ee9f7525f39b1e3e2c036bf0b03317fa2dc32a303"+ },+ {+ "name": "@svml/broll",+ "version": "0.0.0-dev",+ "digest": "sha256:210356a344a0f46c8234293d097eeb5a26fb91664ebecb70145114f69a716a57"+ },+ {+ "name": "@svml/caption-gemini",+ "version": "0.0.0-dev",+ "digest": "sha256:13a61548967a7bfad911bb369719466f4051434c06729c5ab3c154e7aeb898a0"+ },+ {+ "name": "@svml/caption",+ "version": "0.0.0-dev",+ "digest": "sha256:a713e3b93bc5f1284d98a4a8e586662e1cb009b329eb0394229bf5170f996527"+ },+ {+ "name": "@svml/component-kit",+ "version": "0.0.0-dev",+ "digest": "sha256:789d38bf44d7d40cf13734e09f68c8fd8302807fcd9b20a9ef0439f488af1ae2"+ },+ {+ "name": "@svml/contracts",+ "version": "0.0.0-dev",+ "digest": "sha256:3ff4cc952af34cd1a593a7410c688a81ad40ff23ce637b3e427776b1d2e2faa5"+ },+ {+ "name": "@svml/core",+ "version": "0.0.0-dev",+ "digest": "sha256:cfb73d509a819e42cad5490f26e53bf4e28a2df7ed1e47ffa85bb2833e40bd1e"+ },+ {+ "name": "@svml/elaborator",+ "version": "0.0.0-dev",+ "digest": "sha256:d31db89e8b0b81ec7e26da804500d14447af7fdf90c6af3a0ad95504c39f37a2"+ },+ {+ "name": "@svml/film",+ "version": "0.0.0-dev",+ "digest": "sha256:bdb739078b86f66e1b0fed646fbab675ff4875b74b5c1b58c122e5c3feb61515"+ },+ {+ "name": "@svml/generation",+ "version": "0.0.0-dev",+ "digest": "sha256:e1dd0c788e89989f679ed3f1de3825d3d76df32a1670258922c42fe0b7414940"+ },+ {+ "name": "@svml/host",+ "version": "0.0.0-dev",+ "digest": "sha256:a59a3ac2647bebd223b6ebb4d2830a1c86a19d427d49095ae3479de79519f815"+ },+ {+ "name": "@svml/hyperframes-render",+ "version": "0.0.0-dev",+ "digest": "sha256:84fdc643dcfc751fe1c429d6d5ee665f64f0e1de8b3a3208ff64ed12c0986343"+ },+ {+ "name": "@svml/hyperframes",+ "version": "0.0.0-dev",+ "digest": "sha256:aea7f05d870f84782efe831c09dd729d5303cc9a5b7a54184ac3d1c193bd59fa"+ },+ {+ "name": "@svml/media-pipeline",+ "version": "0.0.0-dev",+ "digest": "sha256:05cf1caee616a44c3a2796d93b38fc6022544b751a29aeaf25869d5f7a84f260"+ },+ {+ "name": "@svml/media",+ "version": "0.0.0-dev",+ "digest": "sha256:2f9d4d7d76397d96991277a1aa372bc3ca7783cccfb27cc8516366c7c9fe2300"+ },+ {+ "name": "@svml/model-kit",+ "version": "0.0.0-dev",+ "digest": "sha256:51c71bac3365c6811b27d0aa345b63ff64cee26047bd33b524ad6aa969cc02de"+ },+ {+ "name": "@svml/protocol",+ "version": "0.0.0-dev",+ "digest": "sha256:849da200db7a4389f114381ac7b4ce64766ed350481d271394cd0c7348e76786"+ },+ {+ "name": "@svml/realization",+ "version": "0.0.0-dev",+ "digest": "sha256:049aea1333272415b6605c10004d1ca26c72d348bd00c1885927f425cedc60a2"+ },+ {+ "name": "@svml/run-text",+ "version": "0.0.0-dev",+ "digest": "sha256:77d70b1e6f8a2144e71412ca5c44ea80209546525c5b0c3db645d0413b4bd5fc"+ },+ {+ "name": "@svml/run",+ "version": "0.0.0-dev",+ "digest": "sha256:2a083172479c60e759d630acee3bf34a838123d11ac80b30117d62dc2f6a8f21"+ },+ {+ "name": "@svml/script",+ "version": "0.0.0-dev",+ "digest": "sha256:dfde3dd72c7151982e16c8cef39118d1514b5bf0f38543c25b601ae238fd0bfb"+ },+ {+ "name": "@svml/seedance",+ "version": "0.0.0-dev",+ "digest": "sha256:f557df859cebe1af12da15890f891ca92af436583234aec694517b82fa6f3bb4"+ },+ {+ "name": "@svml/source",+ "version": "0.0.0-dev",+ "digest": "sha256:2ab24d6e0a392e602f99573166ce3d48a8c561fa55f9ee425a25361077b8c483"+ },+ {+ "name": "@svml/speech-align",+ "version": "0.0.0-dev",+ "digest": "sha256:fd66824aeae08e54e7d224cbe151bd8f1ee75e429071cc05aed1fddf52fe9c12"+ },+ {+ "name": "@svml/speech-program",+ "version": "0.0.0-dev",+ "digest": "sha256:154950cc6346aad5b00c22450ca7e346186e3c51247d3fc11b444710d879a70a"+ },+ {+ "name": "@svml/speech-take",+ "version": "0.0.0-dev",+ "digest": "sha256:67c738aede20b50bcdd748aa46ba0563b01731444eb4de7663b299f1006f863e"+ },+ {+ "name": "@svml/svs",+ "version": "0.0.0-dev",+ "digest": "sha256:a336db7f075cab5357a96ba0d3b079c213c93fa0a4f95c39926c2e1b784d3d24"+ },+ {+ "name": "@svml/text-track",+ "version": "0.0.0-dev",+ "digest": "sha256:f27d283873344ac62c94383b5e1680948e0956b06e2d1ef3593b45f17a291f9e"+ },+ {+ "name": "@svml/text",+ "version": "0.0.0-dev",+ "digest": "sha256:03985ce5c8bf04fc8dcfc474b4b80133a5bffbb6965604bdc0f9f8fb64ad0524"+ },+ {+ "name": "@svml/validation",+ "version": "0.0.0-dev",+ "digest": "sha256:4322dffd7ea245484a12fb674a0d2f70f25d1287b9f7aa67ed5714431035e9dd"+ },+ {+ "name": "@svml/whisperx",+ "version": "0.0.0-dev",+ "digest": "sha256:e3fe125fbb4ed52ffb6f099674181dda2ae859890c712644402f63745739a7b8"+ }+ ],+ "packages": [+ {+ "specifier": "@svml/artifact",+ "package": {+ "name": "@svml/artifact",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:ed2ce2db96aff1ca26c03c28fbf3a3b7da9f25d13ea5cf62525ad6a606f952cf"+ },+ {+ "specifier": "@svml/broll",+ "package": {+ "name": "@svml/broll",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:0b95ac97d139aa527178b577aa9fadde3dfdc1edc078d0a9f410b8dcfad43478"+ },+ {+ "specifier": "@svml/caption",+ "package": {+ "name": "@svml/caption",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:182ddde2b002c4c3bc2013c5e984831aa6d034d1ded3ab17e0e71e4dd307438a"+ },+ {+ "specifier": "@svml/caption-gemini",+ "package": {+ "name": "@svml/caption-gemini",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:06d8072364f86102207c0a4bc0b59f126613010636250f53f9d5184d31bb2766"+ },+ {+ "specifier": "@svml/contracts",+ "package": {+ "name": "@svml/contracts",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:1bba3b6672c77931cbc0e002d0509c6ba8f8612cb2a4e0c5897831230b3f35a9"+ },+ {+ "specifier": "@svml/film",+ "package": {+ "name": "@svml/film",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:3670c3b1093c0d4a1fea763f4fd071a86cae99e1348aee3dbc6cb57d30252dd2"+ },+ {+ "specifier": "@svml/generation",+ "package": {+ "name": "@svml/generation",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:fcba65cbdbe1bf8e3df2df7bd96004b98241a2cc577d5e836b1f9640c6204918"+ },+ {+ "specifier": "@svml/hyperframes",+ "package": {+ "name": "@svml/hyperframes",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:7ad54eba232aa29e5c7475d798fdfc19f51ae72c0fc49171df84b63cbe0921d5"+ },+ {+ "specifier": "@svml/hyperframes-render",+ "package": {+ "name": "@svml/hyperframes-render",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:7ca59aba36e096f1a088ae4510d59d27ec083295ac08d224eae8bc51e51b5af3"+ },+ {+ "specifier": "@svml/media",+ "package": {+ "name": "@svml/media",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:c2b1e3c1fee0315dada7ad9bcc806cd52eb152ef3efd3aca0313c16944e156ad"+ },+ {+ "specifier": "@svml/media-pipeline",+ "package": {+ "name": "@svml/media-pipeline",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:b44c81fb191daf1578cf0ba32272b2f7ec8228bb102e8150aebe5851a88e233d"+ },+ {+ "specifier": "@svml/run-text",+ "package": {+ "name": "@svml/run-text",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:b3ef99ff47151f27a7601586667fff693724bbe50d45b30317da827997d6a6b4"+ },+ {+ "specifier": "@svml/script",+ "package": {+ "name": "@svml/script",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:e7d80b9059cae0881ee29bfa6e18f96b445c43227ae665b93196aa4eeaeb1f21"+ },+ {+ "specifier": "@svml/seedance",+ "package": {+ "name": "@svml/seedance",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:99a965be70300fe85f53e9cd660efe1a99ce390061f7f1f759e2892ce8965f30"+ },+ {+ "specifier": "@svml/speech-align",+ "package": {+ "name": "@svml/speech-align",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:5a9a50527fb24cb04c3ddef171b180591522a6ac47d8c186ffb74edf9f3dbe55"+ },+ {+ "specifier": "@svml/speech-program",+ "package": {+ "name": "@svml/speech-program",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:35fbb339defcbbdf7cd0a117ec6fef71e2b348e750a0448c8fe58a4fe1798c68"+ },+ {+ "specifier": "@svml/speech-take",+ "package": {+ "name": "@svml/speech-take",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:58dbc3fe7e419e563bbcdbdd6101c2857fe1e00d1992b2d3cf915803203fca02"+ },+ {+ "specifier": "@svml/svs",+ "package": {+ "name": "@svml/svs",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:40b91f0e3bbaae42fb7bccacb28f49f44a2be37b0506292c49ed98f842371ebe"+ },+ {+ "specifier": "@svml/text-track",+ "package": {+ "name": "@svml/text-track",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:9cbc834835cd36542ca583ea00781e363db1b3dc1c6b0817813589a065a12342"+ },+ {+ "specifier": "@svml/whisperx",+ "package": {+ "name": "@svml/whisperx",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:8cfd95fd8932a7159a6a1b82a73ad3858aa5e3a99d96e6a793d3c7d02c235b9d"+ }+ ],+ "digest": "sha256:84a9a9aebb102814559b81b765826f3e35cb779506b86813e8dff7e203e08461"+}diff --git a/examples/talking-film-live/README.md b/examples/talking-film-live/README.mdindex 698f7618..76cb9b4c 100644--- a/examples/talking-film-live/README.md+++ b/examples/talking-film-live/README.md@@ -28,9 +28,15 @@ paid Provider request or promise that remote credentials and service health areRun the complete graph through the explicit Run Graph and declarative local Runtime Profile:+The checked-in `svml.packages.lock` selects each author, Run and deterministic compute package+independently; there is no implicit video bundle. Regenerate it after changing one of those package+implementations with the package list documented in the lock file.+```bashpnpm svml:v2 build examples/talking-film-live/build.svrun \--runtime examples/talking-film-live/svml.runtime.json \+ --package-lock examples/talking-film-live/svml.packages.lock \+ --root . \--build-id talking-film-live \--follow@@ -59,10 +65,10 @@ Candidates and their explicit Satisfaction edges to another `.svrun`:<target-set id="delivery"><target output="final.video" accepts="substitute"/></target-set>- <build-record id="opening" build="prior-build-id" output="opening-take"/>- <build-record id="answer" build="prior-build-id" output="answer-take"/>- <satisfy output="opening-take" candidate="opening" fidelity="substitute"/>- <satisfy output="answer-take" candidate="answer" fidelity="substitute"/>+ <build-record id="opening" build="prior-build-id" output="opening-take.video"/>+ <build-record id="answer" build="prior-build-id" output="answer-take.video"/>+ <satisfy output="opening-take.video" candidate="opening" fidelity="substitute"/>+ <satisfy output="answer-take.video" candidate="answer" fidelity="substitute"/></svrun>```diff --git a/examples/talking-film-live/svml.packages.lock b/examples/talking-film-live/svml.packages.locknew file mode 100644index 00000000..40679901--- /dev/null+++ b/examples/talking-film-live/svml.packages.lock@@ -0,0 +1,323 @@+{+ "format": "svml.node-package-lock@1",+ "artifacts": [+ {+ "name": "@svml/artifact",+ "version": "0.0.0-dev",+ "digest": "sha256:368270c5c19f9300599a4a1ee9f7525f39b1e3e2c036bf0b03317fa2dc32a303"+ },+ {+ "name": "@svml/caption-gemini",+ "version": "0.0.0-dev",+ "digest": "sha256:13a61548967a7bfad911bb369719466f4051434c06729c5ab3c154e7aeb898a0"+ },+ {+ "name": "@svml/caption",+ "version": "0.0.0-dev",+ "digest": "sha256:a713e3b93bc5f1284d98a4a8e586662e1cb009b329eb0394229bf5170f996527"+ },+ {+ "name": "@svml/component-kit",+ "version": "0.0.0-dev",+ "digest": "sha256:789d38bf44d7d40cf13734e09f68c8fd8302807fcd9b20a9ef0439f488af1ae2"+ },+ {+ "name": "@svml/contracts",+ "version": "0.0.0-dev",+ "digest": "sha256:3ff4cc952af34cd1a593a7410c688a81ad40ff23ce637b3e427776b1d2e2faa5"+ },+ {+ "name": "@svml/core",+ "version": "0.0.0-dev",+ "digest": "sha256:cfb73d509a819e42cad5490f26e53bf4e28a2df7ed1e47ffa85bb2833e40bd1e"+ },+ {+ "name": "@svml/elaborator",+ "version": "0.0.0-dev",+ "digest": "sha256:d31db89e8b0b81ec7e26da804500d14447af7fdf90c6af3a0ad95504c39f37a2"+ },+ {+ "name": "@svml/estimate",+ "version": "0.0.0-dev",+ "digest": "sha256:91770660f244539d2d0db49d46000073cca3202c6148c17466c0547001c4f2dc"+ },+ {+ "name": "@svml/film",+ "version": "0.0.0-dev",+ "digest": "sha256:bdb739078b86f66e1b0fed646fbab675ff4875b74b5c1b58c122e5c3feb61515"+ },+ {+ "name": "@svml/generation",+ "version": "0.0.0-dev",+ "digest": "sha256:e1dd0c788e89989f679ed3f1de3825d3d76df32a1670258922c42fe0b7414940"+ },+ {+ "name": "@svml/host",+ "version": "0.0.0-dev",+ "digest": "sha256:a59a3ac2647bebd223b6ebb4d2830a1c86a19d427d49095ae3479de79519f815"+ },+ {+ "name": "@svml/hyperframes-render",+ "version": "0.0.0-dev",+ "digest": "sha256:84fdc643dcfc751fe1c429d6d5ee665f64f0e1de8b3a3208ff64ed12c0986343"+ },+ {+ "name": "@svml/hyperframes",+ "version": "0.0.0-dev",+ "digest": "sha256:aea7f05d870f84782efe831c09dd729d5303cc9a5b7a54184ac3d1c193bd59fa"+ },+ {+ "name": "@svml/media-pipeline",+ "version": "0.0.0-dev",+ "digest": "sha256:05cf1caee616a44c3a2796d93b38fc6022544b751a29aeaf25869d5f7a84f260"+ },+ {+ "name": "@svml/media",+ "version": "0.0.0-dev",+ "digest": "sha256:2f9d4d7d76397d96991277a1aa372bc3ca7783cccfb27cc8516366c7c9fe2300"+ },+ {+ "name": "@svml/model-kit",+ "version": "0.0.0-dev",+ "digest": "sha256:51c71bac3365c6811b27d0aa345b63ff64cee26047bd33b524ad6aa969cc02de"+ },+ {+ "name": "@svml/protocol",+ "version": "0.0.0-dev",+ "digest": "sha256:849da200db7a4389f114381ac7b4ce64766ed350481d271394cd0c7348e76786"+ },+ {+ "name": "@svml/realization",+ "version": "0.0.0-dev",+ "digest": "sha256:049aea1333272415b6605c10004d1ca26c72d348bd00c1885927f425cedc60a2"+ },+ {+ "name": "@svml/run-text",+ "version": "0.0.0-dev",+ "digest": "sha256:77d70b1e6f8a2144e71412ca5c44ea80209546525c5b0c3db645d0413b4bd5fc"+ },+ {+ "name": "@svml/run",+ "version": "0.0.0-dev",+ "digest": "sha256:2a083172479c60e759d630acee3bf34a838123d11ac80b30117d62dc2f6a8f21"+ },+ {+ "name": "@svml/script",+ "version": "0.0.0-dev",+ "digest": "sha256:dfde3dd72c7151982e16c8cef39118d1514b5bf0f38543c25b601ae238fd0bfb"+ },+ {+ "name": "@svml/seedance",+ "version": "0.0.0-dev",+ "digest": "sha256:f557df859cebe1af12da15890f891ca92af436583234aec694517b82fa6f3bb4"+ },+ {+ "name": "@svml/source",+ "version": "0.0.0-dev",+ "digest": "sha256:2ab24d6e0a392e602f99573166ce3d48a8c561fa55f9ee425a25361077b8c483"+ },+ {+ "name": "@svml/speech-align",+ "version": "0.0.0-dev",+ "digest": "sha256:fd66824aeae08e54e7d224cbe151bd8f1ee75e429071cc05aed1fddf52fe9c12"+ },+ {+ "name": "@svml/speech-program",+ "version": "0.0.0-dev",+ "digest": "sha256:154950cc6346aad5b00c22450ca7e346186e3c51247d3fc11b444710d879a70a"+ },+ {+ "name": "@svml/speech-take",+ "version": "0.0.0-dev",+ "digest": "sha256:67c738aede20b50bcdd748aa46ba0563b01731444eb4de7663b299f1006f863e"+ },+ {+ "name": "@svml/svs",+ "version": "0.0.0-dev",+ "digest": "sha256:a336db7f075cab5357a96ba0d3b079c213c93fa0a4f95c39926c2e1b784d3d24"+ },+ {+ "name": "@svml/text-track",+ "version": "0.0.0-dev",+ "digest": "sha256:f27d283873344ac62c94383b5e1680948e0956b06e2d1ef3593b45f17a291f9e"+ },+ {+ "name": "@svml/text",+ "version": "0.0.0-dev",+ "digest": "sha256:03985ce5c8bf04fc8dcfc474b4b80133a5bffbb6965604bdc0f9f8fb64ad0524"+ },+ {+ "name": "@svml/validation",+ "version": "0.0.0-dev",+ "digest": "sha256:4322dffd7ea245484a12fb674a0d2f70f25d1287b9f7aa67ed5714431035e9dd"+ },+ {+ "name": "@svml/whisperx",+ "version": "0.0.0-dev",+ "digest": "sha256:e3fe125fbb4ed52ffb6f099674181dda2ae859890c712644402f63745739a7b8"+ }+ ],+ "packages": [+ {+ "specifier": "@svml/artifact",+ "package": {+ "name": "@svml/artifact",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:ed2ce2db96aff1ca26c03c28fbf3a3b7da9f25d13ea5cf62525ad6a606f952cf"+ },+ {+ "specifier": "@svml/caption",+ "package": {+ "name": "@svml/caption",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:182ddde2b002c4c3bc2013c5e984831aa6d034d1ded3ab17e0e71e4dd307438a"+ },+ {+ "specifier": "@svml/caption-gemini",+ "package": {+ "name": "@svml/caption-gemini",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:06d8072364f86102207c0a4bc0b59f126613010636250f53f9d5184d31bb2766"+ },+ {+ "specifier": "@svml/contracts",+ "package": {+ "name": "@svml/contracts",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:1bba3b6672c77931cbc0e002d0509c6ba8f8612cb2a4e0c5897831230b3f35a9"+ },+ {+ "specifier": "@svml/estimate",+ "package": {+ "name": "@svml/estimate",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:9ed84b03dc1ff2010dafae78d98be326058d466bdca92d71398bc237b8c239cc"+ },+ {+ "specifier": "@svml/film",+ "package": {+ "name": "@svml/film",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:3670c3b1093c0d4a1fea763f4fd071a86cae99e1348aee3dbc6cb57d30252dd2"+ },+ {+ "specifier": "@svml/generation",+ "package": {+ "name": "@svml/generation",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:fcba65cbdbe1bf8e3df2df7bd96004b98241a2cc577d5e836b1f9640c6204918"+ },+ {+ "specifier": "@svml/hyperframes",+ "package": {+ "name": "@svml/hyperframes",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:7ad54eba232aa29e5c7475d798fdfc19f51ae72c0fc49171df84b63cbe0921d5"+ },+ {+ "specifier": "@svml/hyperframes-render",+ "package": {+ "name": "@svml/hyperframes-render",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:7ca59aba36e096f1a088ae4510d59d27ec083295ac08d224eae8bc51e51b5af3"+ },+ {+ "specifier": "@svml/media",+ "package": {+ "name": "@svml/media",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:c2b1e3c1fee0315dada7ad9bcc806cd52eb152ef3efd3aca0313c16944e156ad"+ },+ {+ "specifier": "@svml/media-pipeline",+ "package": {+ "name": "@svml/media-pipeline",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:b44c81fb191daf1578cf0ba32272b2f7ec8228bb102e8150aebe5851a88e233d"+ },+ {+ "specifier": "@svml/run-text",+ "package": {+ "name": "@svml/run-text",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:b3ef99ff47151f27a7601586667fff693724bbe50d45b30317da827997d6a6b4"+ },+ {+ "specifier": "@svml/script",+ "package": {+ "name": "@svml/script",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:e7d80b9059cae0881ee29bfa6e18f96b445c43227ae665b93196aa4eeaeb1f21"+ },+ {+ "specifier": "@svml/seedance",+ "package": {+ "name": "@svml/seedance",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:99a965be70300fe85f53e9cd660efe1a99ce390061f7f1f759e2892ce8965f30"+ },+ {+ "specifier": "@svml/speech-align",+ "package": {+ "name": "@svml/speech-align",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:5a9a50527fb24cb04c3ddef171b180591522a6ac47d8c186ffb74edf9f3dbe55"+ },+ {+ "specifier": "@svml/speech-program",+ "package": {+ "name": "@svml/speech-program",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:35fbb339defcbbdf7cd0a117ec6fef71e2b348e750a0448c8fe58a4fe1798c68"+ },+ {+ "specifier": "@svml/speech-take",+ "package": {+ "name": "@svml/speech-take",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:58dbc3fe7e419e563bbcdbdd6101c2857fe1e00d1992b2d3cf915803203fca02"+ },+ {+ "specifier": "@svml/svs",+ "package": {+ "name": "@svml/svs",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:40b91f0e3bbaae42fb7bccacb28f49f44a2be37b0506292c49ed98f842371ebe"+ },+ {+ "specifier": "@svml/text-track",+ "package": {+ "name": "@svml/text-track",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:9cbc834835cd36542ca583ea00781e363db1b3dc1c6b0817813589a065a12342"+ },+ {+ "specifier": "@svml/whisperx",+ "package": {+ "name": "@svml/whisperx",+ "version": "0.0.0-dev"+ },+ "facetsDigest": "sha256:8cfd95fd8932a7159a6a1b82a73ad3858aa5e3a99d96e6a793d3c7d02c235b9d"+ }+ ],+ "digest": "sha256:e579b840a0af15e90123a8d664ff8242b10b7d2881326f98b8e2649e4c7b518d"+}diff --git a/examples/talking-film-live/svml.runtime.json b/examples/talking-film-live/svml.runtime.jsonindex 62cdbd00..0436abb8 100644--- a/examples/talking-film-live/svml.runtime.json+++ b/examples/talking-film-live/svml.runtime.json@@ -1,5 +1,6 @@{"format": "svml.runtime-config@1",+ "packageLock": "./svml.packages.lock","services": [],"endpoints": [{diff --git a/examples/talking-film-live/svml.runtime.ts b/examples/talking-film-live/svml.runtime.tsindex 5576793c..3f2e72e1 100644--- a/examples/talking-film-live/svml.runtime.ts+++ b/examples/talking-film-live/svml.runtime.ts@@ -1,7 +1,6 @@import { fileURLToPath } from "node:url";import { createProjectLocalRuntime } from "@svml/local";-import { svmlPackage } from "@svml/prelude-video";import { createGoogleVertexCaptionProvider } from "@svml/provider-google-vertex";import { createLocalHyperframesProvider } from "@svml/provider-hyperframes-local";import { createKieProvider } from "@svml/provider-kie";@@ -45,7 +44,7 @@ export default async function createTalkingFilmRuntime() {return await createProjectLocalRuntime({root: fileURLToPath(new URL(".", import.meta.url)),- components: svmlPackage.components,+ packageLock: "./svml.packages.lock",endpoints,allowedPermissions: [...new Set(endpoints.flatMap((endpoint) =>endpoint.manifest.facets.flatMap((facet) => facet.permissions)))],diff --git a/examples/v2-bootstrap/README.md b/examples/v2-bootstrap/README.mdindex f3abd3a4..1ec19e87 100644--- a/examples/v2-bootstrap/README.md+++ b/examples/v2-bootstrap/README.md@@ -1,13 +1,13 @@# v2 bootstrap source example-This is the smallest real-file example accepted by the current trusted v2 CLI prelude. It proves-that the Text entry source can import the Script Surface and recursively compile an SVS source with-another Frontend:+This is the smallest real-file example for the official Text compiler Host. It proves that a+self-described Text entry source can import the Script Surface and recursively compile an SVS+source selected by another Header. There is no built-in video prelude or suffix-selected parser:```bash-pnpm svml:v2 check examples/v2-bootstrap/main.svml+pnpm svml:v2 check examples/v2-bootstrap/main.svml \+ --package-lock examples/talking-film-graph-check/svml.packages.lock --root .```-The Recipe is intentionally unused: package-owned Recipe consumption is the next author-language-decision. This example therefore checks Source/Module Closure and authored Records but has no-component Logical Output to `plan` or execute.+The Recipe is intentionally unused. This example therefore checks Source/Module Closure and+authored Records but has no component Logical Output to `plan` or execute.diff --git a/package.json b/package.jsonindex 7d12dbd5..66b5287c 100644--- a/package.json+++ b/package.json@@ -33,14 +33,35 @@"hyperframes": "0.7.84"},"devDependencies": {+ "@svml/artifact": "workspace:*",+ "@svml/broll": "workspace:*",+ "@svml/caption": "workspace:*",+ "@svml/caption-gemini": "workspace:*",+ "@svml/contracts": "workspace:*",+ "@svml/estimate": "workspace:*",+ "@svml/film": "workspace:*",+ "@svml/generation": "workspace:*",+ "@svml/hyperframes": "workspace:*",+ "@svml/hyperframes-render": "workspace:*","@svml/local": "workspace:*",- "@svml/prelude-video": "workspace:*",+ "@svml/media": "workspace:*",+ "@svml/media-pipeline": "workspace:*",+ "@svml/prompt-kit": "workspace:*","@svml/provider-google-vertex": "workspace:*","@svml/provider-hyperframes-local": "workspace:*","@svml/provider-kie": "workspace:*","@svml/provider-media-local": "workspace:*","@svml/provider-whisperx-local": "workspace:*","@svml/run-text": "workspace:*",+ "@svml/script": "workspace:*",+ "@svml/seedance": "workspace:*",+ "@svml/seedance-speaker": "workspace:*",+ "@svml/speech-align": "workspace:*",+ "@svml/speech-program": "workspace:*",+ "@svml/speech-take": "workspace:*",+ "@svml/svs": "workspace:*",+ "@svml/text-track": "workspace:*",+ "@svml/whisperx": "workspace:*","@types/node": "24.10.1","tsx": "4.21.0","typescript": "5.9.3"diff --git a/packages/artifact/package.json b/packages/artifact/package.jsonindex 67e13d11..53424aa4 100644--- a/packages/artifact/package.json+++ b/packages/artifact/package.json@@ -6,6 +6,9 @@"exports": {".": "./src/index.ts"},+ "svml": {+ "activation": "./src/activation.ts"+ },"dependencies": {"@svml/protocol": "workspace:*"}diff --git a/packages/artifact/src/activation.ts b/packages/artifact/src/activation.tsnew file mode 100644index 00000000..80fefa1d--- /dev/null+++ b/packages/artifact/src/activation.ts@@ -0,0 +1,9 @@+import { artifactManifest } from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/artifact",+ modules: [{ manifest: artifactManifest }],+};++export default svmlPackage;diff --git a/packages/broll/package.json b/packages/broll/package.jsonindex 02fc2ad4..e63a9f2d 100644--- a/packages/broll/package.json+++ b/packages/broll/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/artifact": "workspace:*","@svml/component-kit": "workspace:*",diff --git a/packages/broll/src/activation.ts b/packages/broll/src/activation.tsnew file mode 100644index 00000000..1a4a31c9--- /dev/null+++ b/packages/broll/src/activation.ts@@ -0,0 +1,17 @@+import { createTextSurfaceHostFacet } from "@svml/text";+import {+ brollComponent, brollManifest, brollModuleRef, brollSurfaceImplementationDigest,+ decodeBrollTrackSurface,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/broll",+ modules: [{ manifest: brollManifest, specifiers: ["@svml/broll", "@svml/broll@1"] }],+ components: [brollComponent],+ hostFacets: [createTextSurfaceHostFacet({+ module: brollModuleRef, surface: "track", mode: "structured",+ implementationDigest: brollSurfaceImplementationDigest, handler: decodeBrollTrackSurface,+ })],+};+export default svmlPackage;diff --git a/packages/caption-gemini/package.json b/packages/caption-gemini/package.jsonindex c1e0d5b0..3eda9515 100644--- a/packages/caption-gemini/package.json+++ b/packages/caption-gemini/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/caption": "workspace:*","@svml/component-kit": "workspace:*",diff --git a/packages/caption-gemini/src/activation.ts b/packages/caption-gemini/src/activation.tsnew file mode 100644index 00000000..ab38a318--- /dev/null+++ b/packages/caption-gemini/src/activation.ts@@ -0,0 +1,18 @@+import { createTextSurfaceHostFacet } from "@svml/text";+import {+ captionGeminiComponent, captionGeminiImplementationDigests, captionGeminiManifest,+ captionGeminiModuleRef, decodeCaptionGeminiPlannerSurface,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/caption-gemini",+ modules: [{ manifest: captionGeminiManifest, specifiers: ["@svml/caption-gemini", "@svml/caption-gemini@1"] }],+ components: [captionGeminiComponent],+ hostFacets: [createTextSurfaceHostFacet({+ module: captionGeminiModuleRef, surface: "planner", mode: "structured",+ implementationDigest: captionGeminiImplementationDigests.plannerSurface,+ handler: decodeCaptionGeminiPlannerSurface,+ })],+};+export default svmlPackage;diff --git a/packages/caption/package.json b/packages/caption/package.jsonindex e3f6747e..b19336f4 100644--- a/packages/caption/package.json+++ b/packages/caption/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/component-kit": "workspace:*","@svml/contracts": "workspace:*",diff --git a/packages/caption/src/activation.ts b/packages/caption/src/activation.tsnew file mode 100644index 00000000..c661e058--- /dev/null+++ b/packages/caption/src/activation.ts@@ -0,0 +1,20 @@+import { createTextSurfaceHostFacet } from "@svml/text";+import {+ captionComponent, captionManifest, captionModuleRef,+ captionProgramSurfaceImplementationDigest, captionStyleSurfaceImplementationDigest,+ captionSurfaceImplementationDigest, decodeCaptionProgramSurface, decodeCaptionStyleSurface,+ decodeCaptionTrackSurface,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/caption",+ modules: [{ manifest: captionManifest, specifiers: ["@svml/caption", "@svml/caption@1"] }],+ components: [captionComponent],+ hostFacets: [+ createTextSurfaceHostFacet({ module: captionModuleRef, surface: "style", mode: "structured", implementationDigest: captionStyleSurfaceImplementationDigest, handler: decodeCaptionStyleSurface }),+ createTextSurfaceHostFacet({ module: captionModuleRef, surface: "program", mode: "structured", implementationDigest: captionProgramSurfaceImplementationDigest, handler: decodeCaptionProgramSurface }),+ createTextSurfaceHostFacet({ module: captionModuleRef, surface: "track", mode: "structured", implementationDigest: captionSurfaceImplementationDigest, handler: decodeCaptionTrackSurface }),+ ],+};+export default svmlPackage;diff --git a/packages/cli/README.md b/packages/cli/README.mdindex c99058b1..62cadb57 100644--- a/packages/cli/README.md+++ b/packages/cli/README.md@@ -17,9 +17,9 @@ type CliDistribution = {```A Distribution is trusted application assembly, not Core data or source-import authority. The-official `@svml/video-cli` selects `@svml/compiler-text-node`, `@svml/prelude-video` and the current-video Runtime adapters. Another domain can reuse this command engine without installing those-packages.+official `@svml/video-cli` selects `@svml/compiler-text-node` and the current video Runtime+adapters, but no author-package aggregate. A package lock selects the exact Author/Run packages.+Another domain can reuse this command engine without installing any video package.`check` accepts any self-described Author or Run Source whose Header names a trusted Frontend.`plan` and `build` require a Run Source. Targets, Candidate selections and substitute fidelity maydiff --git a/packages/cli/src/run-file.ts b/packages/cli/src/run-file.tsindex bc26674b..efbfdcd2 100644--- a/packages/cli/src/run-file.ts+++ b/packages/cli/src/run-file.ts@@ -43,13 +43,29 @@ export async function loadRunFile(options: {}const frontends = new RunFrontendRegistry();for (const frontend of options.frontends) frontends.register(frontend);+ const archive = new Map<string, Awaited<ReturnType<LocalRuntime["status"]>>>();+ const archived = async (id: string) => {+ const existing = archive.get(id);+ if (existing !== undefined) return existing;+ const status = await options.runtime!.status(id);+ archive.set(id, status);+ return status;+ };const compiler = new NodeRunCompiler({authorCompiler: options.authorCompiler,frontends,fragments,...(options.runtime === undefined ? {} : {async readBuild(id: string) {- return (await options.runtime!.status(id)).build?.state;+ return (await archived(id)).build?.state;+ },+ async resolveBuildOutput(id: string, output: string) {+ const alias = (await archived(id)).catalog?.aliases.find((item) => item.name === output);+ if (alias === undefined) return output;+ if (alias.ref.kind !== "logical-output") {+ throw new Error(`Build ${id} alias ${output} is an authored Record, not a Logical Output`);+ }+ return alias.ref.id;},}),});diff --git a/packages/compiler-node/src/run.ts b/packages/compiler-node/src/run.tsindex 2314f010..3e428d42 100644--- a/packages/compiler-node/src/run.ts+++ b/packages/compiler-node/src/run.ts@@ -41,6 +41,10 @@ export type NodeRunCompilerOptions = {readonly root?: string;readonly workspace?: Workspace;readonly readBuild?: (id: string) => Promise<ArchivedBuildState | undefined> | ArchivedBuildState | undefined;+ readonly resolveBuildOutput?: (+ build: string,+ output: string,+ ) => Promise<string | undefined> | string | undefined;};export type NodeCompiledRun = {@@ -122,6 +126,7 @@ export class NodeRunCompiler {);const executionCompilation = program === author.program ? author : { ...author, program };const readBuild = this.#options.readBuild;+ const resolveBuildOutput = this.#options.resolveBuildOutput;const run = await resolveRunDocument(decoded.document, {compilation: executionCompilation,sourceClosure: decoded.closure,@@ -131,6 +136,11 @@ export class NodeRunCompiler {if (readBuild === undefined) throw new Error(`Run refers to Build ${id}, but the Host has no BuildArchive`);return await readBuild(id);},+ ...(resolveBuildOutput === undefined ? {} : {+ async resolveBuildOutput(build: string, output: string) {+ return await resolveBuildOutput(build, output);+ },+ }),});return {source: source.id,diff --git a/packages/contracts/package.json b/packages/contracts/package.jsonindex 08d3d880..cd70ec16 100644--- a/packages/contracts/package.json+++ b/packages/contracts/package.json@@ -6,6 +6,9 @@"exports": {".": "./src/index.ts"},+ "svml": {+ "activation": "./src/activation.ts"+ },"dependencies": {"@svml/artifact": "workspace:*","@svml/component-kit": "workspace:*",diff --git a/packages/contracts/src/activation.ts b/packages/contracts/src/activation.tsnew file mode 100644index 00000000..3e53afb7--- /dev/null+++ b/packages/contracts/src/activation.ts@@ -0,0 +1,23 @@+import {+ compositionManifest,+ narrativeManifest,+ programSpaceManifest,+ semanticTimeManifest,+ speechManifest,+ compositionContractsComponent,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/contracts",+ modules: [+ { manifest: narrativeManifest },+ { manifest: programSpaceManifest },+ { manifest: speechManifest },+ { manifest: semanticTimeManifest },+ { manifest: compositionManifest },+ ],+ components: [compositionContractsComponent],+};++export default svmlPackage;diff --git a/packages/contracts/src/manifest.ts b/packages/contracts/src/manifest.tsindex 737bd6e4..69769248 100644--- a/packages/contracts/src/manifest.ts+++ b/packages/contracts/src/manifest.ts@@ -628,6 +628,7 @@ export const mediaValidatorDigests = {export const mediaSurfaceImplementationDigests = {image: digestOf("@svml/media/image-surface@1"),+ audio: digestOf("@svml/media/audio-surface@1"),} as const;export const mediaManifest: ModuleManifest = {@@ -713,17 +714,30 @@ export const mediaManifest: ModuleManifest = {{ name: contractTypes.compositableSurface.name, schema: compositableSurfaceSchema },],capabilities: [],- surfaces: [{- name: "image",- tag: "Image",- mode: "structured",- outputs: [contractTypes.blobArtifact],- implementation: {- kind: "trusted-frontend-surface",- locator: "@svml/media/image-surface",- digest: mediaSurfaceImplementationDigests.image,+ surfaces: [+ {+ name: "image",+ tag: "Image",+ mode: "structured",+ outputs: [contractTypes.blobArtifact],+ implementation: {+ kind: "trusted-frontend-surface",+ locator: "@svml/media/image-surface",+ digest: mediaSurfaceImplementationDigests.image,+ },+ },+ {+ name: "audio",+ tag: "Audio",+ mode: "structured",+ outputs: [contractTypes.blobArtifact],+ implementation: {+ kind: "trusted-frontend-surface",+ locator: "@svml/media/audio-surface",+ digest: mediaSurfaceImplementationDigests.audio,+ },},- }],+ ],producers: [],};diff --git a/packages/core/src/schema.ts b/packages/core/src/schema.tsindex be8569c6..f4dc9356 100644--- a/packages/core/src/schema.ts+++ b/packages/core/src/schema.ts@@ -7,6 +7,29 @@ function fail(path: string, message: string): never {throw new CoreError("VALUE_SCHEMA_MISMATCH", `${path} ${message}`, path);}+/**+ * Prove that an object-shaped union branch cannot match by looking only at its+ * literal fields. This is a semantic no-op: a branch skipped here would fail+ * the normal object validation at the same field. It matters for large IRs,+ * where validating every word/style node against every named union variant+ * otherwise constructs thousands of exceptions just to discover that their+ * discriminator literals differ.+ */+function objectLiteralMismatch(value: CanonicalValue, schema: ValueSchema): boolean {+ if (schema.kind !== "object" || value === null || Array.isArray(value) || typeof value !== "object") {+ return false;+ }+ const object = value as Readonly<Record<string, CanonicalValue>>;+ for (const [name, field] of Object.entries(schema.fields)) {+ if (field.schema.kind !== "literal") continue;+ if (!Object.hasOwn(object, name)) return field.optional !== true;+ if (canonicalStringify(object[name] as CanonicalValue) !== canonicalStringify(field.schema.value)) {+ return true;+ }+ }+ return false;+}+function validateInline(value: CanonicalValue, schema: ValueSchema, path: string): void {switch (schema.kind) {case "null":@@ -74,6 +97,7 @@ function validateInline(value: CanonicalValue, schema: ValueSchema, path: stringcase "oneOf": {let matches = 0;for (const variant of schema.variants) {+ if (objectLiteralMismatch(value, variant)) continue;try {validateInline(value, variant, path);matches += 1;diff --git a/packages/core/test/core.test.ts b/packages/core/test/core.test.tsindex d7ee8f05..b9eea7bd 100644--- a/packages/core/test/core.test.ts+++ b/packages/core/test/core.test.ts@@ -6,6 +6,7 @@ import {canonicalize,digestOf,reduce,+ validateStoredValue,validatePlan,verifyBuildState,verifyRecordAffinity,@@ -18,6 +19,7 @@ import type {FulfillNeedCommand,InvokeProducerCommand,TypedRecord,+ ValueSchema,} from "@svml/protocol";import { createGreetingBuild, producers } from "./greeting-fixture.js";@@ -140,6 +142,35 @@ test("schema-invalid producer output is rejected before it becomes a Record", ());});+test("oneOf literal discrimination preserves exact-one semantics", () => {+ const tagged = (tag: string): ValueSchema => ({+ kind: "object",+ fields: {+ kind: { schema: { kind: "literal", value: tag } },+ payload: { schema: { kind: "string" } },+ },+ });+ const generic: ValueSchema = {+ kind: "object",+ fields: {+ kind: { schema: { kind: "string" } },+ payload: { schema: { kind: "string" } },+ },+ };++ assert.doesNotThrow(() => validateStoredValue(+ { kind: "inline", value: { kind: "alpha", payload: "hello" } },+ { kind: "oneOf", variants: [tagged("alpha"), tagged("beta")] },+ ));+ assert.throws(+ () => validateStoredValue(+ { kind: "inline", value: { kind: "alpha", payload: "hello" } },+ { kind: "oneOf", variants: [tagged("alpha"), generic] },+ ),+ (error: unknown) => error instanceof CoreError && error.code === "VALUE_SCHEMA_MISMATCH",+ );+});+test("Producer result affinity rejects an exact output that lies about its input", () => {const current = reachNeed();const fulfilled = reduce(current.state, {diff --git a/packages/driver-node/test/scheduler.test.ts b/packages/driver-node/test/scheduler.test.tsindex f33b93e9..659ac9d8 100644--- a/packages/driver-node/test/scheduler.test.ts+++ b/packages/driver-node/test/scheduler.test.ts@@ -46,7 +46,8 @@ import {types,} from "../../core/test/greeting-fixture.js";-function createParallelGreetingBuild() {+function createParallelGreetingBuild(generationCount = 2) {+ const generations = ["a", "b", "c"].slice(0, generationCount);const closure = createResolvedClosure([manifest]);const authored = sealRecord({id: "intent:root",@@ -73,18 +74,12 @@ function createParallelGreetingBuild() {primary: "make-prompt",semanticInputs: [{ kind: "record", id: "intent:root" }],},- {- id: "generated-a",- type: types.generated,- primary: "generate-a",- semanticInputs: [{ kind: "logical-output", id: "prompt" }],- },- {- id: "generated-b",+ ...generations.map((suffix) => ({+ id: `generated-${suffix}`,type: types.generated,- primary: "generate-b",- semanticInputs: [{ kind: "logical-output", id: "prompt" }],- },+ primary: `generate-${suffix}`,+ semanticInputs: [{ kind: "logical-output" as const, id: "prompt" }],+ })),],candidates: [{@@ -92,16 +87,14 @@ function createParallelGreetingBuild() {type: types.prompt,root: { kind: "operation", result: { kind: "operation-result", operation: "make-prompt" } },},- {- id: "generate-a",+ ...generations.map((suffix) => ({+ id: `generate-${suffix}`,type: types.generated,- root: { kind: "operation", result: { kind: "operation-result", operation: "generate-a" } },- },- {- id: "generate-b",- type: types.generated,- root: { kind: "operation", result: { kind: "operation-result", operation: "generate-b" } },- },+ root: {+ kind: "operation" as const,+ result: { kind: "operation-result" as const, operation: `generate-${suffix}` },+ },+ })),],operations: [{@@ -110,38 +103,23 @@ function createParallelGreetingBuild() {inputs: { intent: { kind: "record", id: "intent:root" } },result: { kind: "output", name: "prompt", record: "prompt:root" },},- {- id: "generate-a",- producer: greetingProducers.requestText,- inputs: { prompt: { kind: "logical-output", id: "prompt" } },- result: {- kind: "need",- name: "generation",- id: "need:generation-a",- record: "generated:a",- accepts: "exact",- },- },- {- id: "generate-b",+ ...generations.map((suffix) => ({+ id: `generate-${suffix}`,producer: greetingProducers.requestText,- inputs: { prompt: { kind: "logical-output", id: "prompt" } },+ inputs: { prompt: { kind: "logical-output" as const, id: "prompt" } },result: {- kind: "need",+ kind: "need" as const,name: "generation",- id: "need:generation-b",- record: "generated:b",- accepts: "exact",+ id: `need:generation-${suffix}`,+ record: `generated:${suffix}`,+ accepts: "exact" as const,},- },+ })),],});return start(program, graph, sealBuildRequest({graph: graph.id,- targets: [- { output: "generated-a", accepts: "exact" },- { output: "generated-b", accepts: "exact" },- ],+ targets: generations.map((suffix) => ({ output: `generated-${suffix}`, accepts: "exact" as const })),satisfactions: [],}));}@@ -374,6 +352,66 @@ test("independent paid commands inside one Build may fill the same lane withoutassert.equal(result?.state.receipts.length, 2);});+test("durable scheduling keeps the rest of an in-flight command batch after one event is stored", async () => {+ let maximumActive = 0;+ const { executor, getCalls } = configuredExecutor({+ lane: "seedance:fixture.account",+ defaultConcurrency: 2,+ observe(active) {+ maximumActive = Math.max(maximumActive, active);+ },+ });+ const store = new MemoryBuildStore();+ const [result] = await new LocalBuildScheduler(executor, {+ buildStore: store,+ maxConcurrency: 8,+ }).run([{+ id: "durable-two-shots",+ state: createParallelGreetingBuild(),+ }]);++ assert.equal(result?.status, "complete");+ assert.equal(getCalls(), 2);+ assert.equal(maximumActive, 2);+ assert.equal(result?.journal.some((entry) =>+ entry.status === "error" && entry.message?.includes("event references command")), false);+ assert.equal((await store.read("durable-two-shots"))?.state.status, "complete");+});++test("durable scheduling can drain successful sibling commands after another sibling errors", async () => {+ const producers = new ProducerRegistry();+ producers.registerProducer(greetingProducers.makePrompt, implementationDigests.makePrompt, ({ inputs }) => {+ const intent = inputs.intent;+ assert.equal(intent?.value.kind, "inline");+ return { outputs: { prompt: { kind: "inline", value: "Greet Ada" } }, needs: {} };+ });+ let calls = 0;+ producers.registerProducer(greetingProducers.requestText, implementationDigests.requestText, async () => {+ calls += 1;+ const call = calls;+ if (call === 1) throw new Error("fixture producer failed");+ await new Promise<void>((resolve) => setTimeout(resolve, call * 5));+ return { outputs: {}, needs: { generation: { prompt: `request ${call}` } } };+ });+ const store = new MemoryBuildStore();+ const [result] = await new LocalBuildScheduler(new NodeDriver({ producers }), {+ buildStore: store,+ maxConcurrency: 8,+ }).run([{+ id: "durable-error-with-siblings",+ state: createParallelGreetingBuild(3),+ }]);++ assert.equal(result?.status, "paused");+ assert.equal(calls, 3);+ assert.equal(result?.journal.filter((entry) => entry.status === "completed"+ && entry.kind === "invoke-producer").length, 3, "the prompt and both successful requests are accepted");+ assert.equal(result?.journal.some((entry) =>+ entry.status === "error" && entry.message?.includes("event references command")), false);+ assert.equal(result?.state.derivations.filter((item) =>+ item.producer.name === greetingProducers.requestText.name).length, 2);+});+test("a locked Runtime Closure assembles exact Endpoint code and Scheduler policy without manual bind", async () => {let maximumActive = 0;const { closure, modules } = resolvedRuntime(2);diff --git a/packages/estimate/package.json b/packages/estimate/package.jsonindex 325da65e..412c15b1 100644--- a/packages/estimate/package.json+++ b/packages/estimate/package.json@@ -6,11 +6,15 @@"exports": {".": "./src/index.ts"},+ "svml": {+ "activation": "./src/activation.ts"+ },"dependencies": {"@svml/component-kit": "workspace:*","@svml/contracts": "workspace:*","@svml/elaborator": "workspace:*","@svml/protocol": "workspace:*",+ "@svml/svs": "workspace:*","@svml/text": "workspace:*"}}diff --git a/packages/estimate/src/activation.ts b/packages/estimate/src/activation.tsnew file mode 100644index 00000000..ce0ae1bd--- /dev/null+++ b/packages/estimate/src/activation.ts@@ -0,0 +1,25 @@+import { createTextSurfaceHostFacet } from "@svml/text";++import {+ decodeSpeechEstimateSurface,+ estimateComponent,+ estimateManifest,+ estimateModuleRef,+ estimateSurfaceImplementationDigest,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/estimate",+ modules: [{ manifest: estimateManifest, specifiers: ["@svml/estimate", "@svml/estimate@1"] }],+ components: [estimateComponent],+ hostFacets: [createTextSurfaceHostFacet({+ module: estimateModuleRef,+ surface: "speech",+ mode: "structured",+ implementationDigest: estimateSurfaceImplementationDigest,+ handler: decodeSpeechEstimateSurface,+ })],+};++export default svmlPackage;diff --git a/packages/estimate/src/index.ts b/packages/estimate/src/index.tsindex 984ea924..1f354d79 100644--- a/packages/estimate/src/index.ts+++ b/packages/estimate/src/index.ts@@ -18,5 +18,8 @@ export {resolveSpeechEstimateLanguage,sealSpeechEstimatePolicy,} from "./program.js";-export { decodeSpeechEstimateSurface } from "./surface.js";+export {+ decodeSpeechEstimateSurface,+ speechEstimatePolicyFromRecipe,+} from "./surface.js";export type * from "./types.js";diff --git a/packages/estimate/src/manifest.ts b/packages/estimate/src/manifest.tsindex 655989fa..2cca1bcb 100644--- a/packages/estimate/src/manifest.ts+++ b/packages/estimate/src/manifest.ts@@ -4,6 +4,7 @@ import {} from "@svml/contracts";import { digestOf } from "@svml/protocol";import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@svml/protocol";+import { svsManifest, svsRecipeType } from "@svml/svs";import { estimateSpeechImplementationDigest } from "./program.js";@@ -14,7 +15,7 @@ export const estimateTypes = {export const estimateProducers = {speech: { module: estimateModuleRef, name: "estimate-speech-duration" },} satisfies Record<string, ProducerRef>;-export const estimateSurfaceImplementationDigest = digestOf("@svml/estimate/speech-surface@1");+export const estimateSurfaceImplementationDigest = digestOf("@svml/estimate/speech-surface@2");const number = { kind: "number" } as const satisfies ValueSchema;const digest = { kind: "string", minLength: 71, maxLength: 71 } as const satisfies ValueSchema;@@ -39,6 +40,7 @@ export const estimateManifest: ModuleManifest = {dependencies: [videoContractDependencies.narrative,videoContractDependencies.speech,+ { module: svsRecipeType.module, digest: digestOf(svsManifest) },],types: [{ name: estimateTypes.speechPolicy.name, schema: speechEstimatePolicySchema }],capabilities: [],diff --git a/packages/estimate/src/surface.ts b/packages/estimate/src/surface.tsindex 54732958..d5c28530 100644--- a/packages/estimate/src/surface.ts+++ b/packages/estimate/src/surface.ts@@ -1,5 +1,7 @@import { contractTypes } from "@svml/contracts";import type { CanonicalValue } from "@svml/protocol";+import { svsRecipeType } from "@svml/svs";+import type { SvsRecipe } from "@svml/svs";import type {StructuredElement,StructuredSurfaceHandler,@@ -22,7 +24,8 @@ function sameType(left: SurfaceResolvedReference["type"], right: SurfaceResolvedfunction attributes(element: StructuredElement): void {const required = ["id", "source"];- const optional = ["language", "pace", "padding", "min", "max", "rounding"];+ const direct = ["language", "pace", "padding", "min", "max", "rounding"];+ const optional = ["policy", ...direct];const allowed = new Set([...required, ...optional]);if (required.some((name) => element.attributes[name] === undefined)@@ -30,11 +33,75 @@ function attributes(element: StructuredElement): void {) {throw new Error(`${element.name} requires id and source; optional: ${optional.join(", ")}`);}+ if (element.attributes.policy !== undefined && direct.some((name) => element.attributes[name] !== undefined)) {+ throw new Error(`${element.name}.policy cannot be combined with inline estimate parameters`);+ }if (element.children.some((child) => child.kind === "element" || child.value.trim().length > 0)) {throw new Error(`${element.name} must be empty`);}}+function wholeReference(element: StructuredElement, name: string): string {+ const raw: TextAttributeValue | undefined = element.attributes[name];+ if (typeof raw !== "object" || raw.kind !== "reference" || raw.path.length === 0) {+ throw new Error(`${element.name}.${name} must be a whole-value reference`);+ }+ return raw.path;+}++function inline<T>(reference: SurfaceResolvedReference, subject: string): T {+ const value = reference.record?.value;+ if (value?.kind !== "inline") throw new Error(`${subject} must reference an authored inline value`);+ return value.value as unknown as T;+}++function recipePolicy(+ element: StructuredElement,+ resolveReference: (path: string) => SurfaceResolvedReference | undefined,+) {+ const path = wholeReference(element, "policy");+ const reference = resolveReference(path);+ if (reference === undefined || !sameType(reference.type, svsRecipeType)) {+ throw new Error(`${element.name}.policy must reference an SVS Recipe`);+ }+ const recipe = inline<SvsRecipe>(reference, `${element.name}.policy`);+ if (recipe.contract !== "svml.svs-recipe@1") throw new Error(`${element.name}.policy Recipe is invalid`);+ return speechEstimatePolicyFromRecipe(recipe, `${element.name}.policy`);+}++export function speechEstimatePolicyFromRecipe(+ recipe: SvsRecipe,+ subject = `SVS Recipe ${recipe.path}`,+) {+ if (recipe.contract !== "svml.svs-recipe@1") throw new Error(`${subject} is invalid`);+ const allowed = new Set(["language", "pace", "padding", "min", "max", "rounding"]);+ const unknown = Object.keys(recipe.properties).filter((name) => !allowed.has(name));+ if (unknown.length > 0) throw new Error(`${subject} contains unknown property ${unknown[0]}`);+ const string = (name: string, fallback: string): string => {+ const value = recipe.properties[name] ?? fallback;+ if (typeof value !== "string" || value.trim().length === 0) {+ throw new Error(`${subject}.${name} must be a non-empty string`);+ }+ return value.trim();+ };+ const finite = (name: string, fallback: number): number => {+ const value = recipe.properties[name] ?? fallback;+ if (typeof value !== "number" || !Number.isFinite(value)) {+ throw new Error(`${subject}.${name} must be a finite number`);+ }+ return value;+ };+ return sealSpeechEstimatePolicy({+ contract: "svml.speech-estimate-policy@1",+ language: string("language", "auto") as SpeechEstimateLanguage,+ pace: string("pace", "normal") as SpeechEstimatePace,+ paddingSec: finite("padding", 0.3),+ minimumSec: finite("min", 4),+ maximumSec: finite("max", 15),+ rounding: string("rounding", "ceil") as SpeechEstimateRounding,+ });+}+function text(element: StructuredElement, name: string, fallback?: string): string {const value = element.attributes[name] ?? fallback;if (typeof value !== "string" || value.trim().length === 0) {@@ -68,18 +135,17 @@ export const decodeSpeechEstimateSurface: StructuredSurfaceHandler = ({ element,attributes(element);const id = text(element, "id");const source = reference(element, resolveReference);- const language = text(element, "language", "auto") as SpeechEstimateLanguage;- const pace = text(element, "pace", "normal") as SpeechEstimatePace;- const rounding = text(element, "rounding", "ceil") as SpeechEstimateRounding;- const policy = sealSpeechEstimatePolicy({- contract: "svml.speech-estimate-policy@1",- language,- pace,- paddingSec: number(element, "padding", 0.3),- minimumSec: number(element, "min", 4),- maximumSec: number(element, "max", 15),- rounding,- });+ const policy = element.attributes.policy === undefined+ ? sealSpeechEstimatePolicy({+ contract: "svml.speech-estimate-policy@1",+ language: text(element, "language", "auto") as SpeechEstimateLanguage,+ pace: text(element, "pace", "normal") as SpeechEstimatePace,+ paddingSec: number(element, "padding", 0.3),+ minimumSec: number(element, "min", 4),+ maximumSec: number(element, "max", 15),+ rounding: text(element, "rounding", "ceil") as SpeechEstimateRounding,+ })+ : recipePolicy(element, resolveReference);const policyId = `${id}.policy`;return {records: [{diff --git a/packages/estimate/test/estimate.test.ts b/packages/estimate/test/estimate.test.tsindex 1ea43d27..770320b6 100644--- a/packages/estimate/test/estimate.test.ts+++ b/packages/estimate/test/estimate.test.ts@@ -6,6 +6,7 @@ import {countSpeechEstimateUnits,estimateSpeechDuration,sealSpeechEstimatePolicy,+ speechEstimatePolicyFromRecipe,} from "@svml/estimate";import { canonicalize, digestOf } from "@svml/protocol";@@ -49,3 +50,25 @@ test("the minimum applies before rounding and the maximum applies after roundingconst bounded = sealSpeechEstimatePolicy({ ...normalContent, maximumSec: 4.5 });assert.equal(estimateSpeechDuration(excerpt("long", "This sentence intentionally contains far more spoken syllables than the selected model duration allows."), bounded).durationSec, 4.5);});++test("an SVS Recipe configures one reusable estimate policy without becoming executable", () => {+ const policy = speechEstimatePolicyFromRecipe({+ contract: "svml.svs-recipe@1",+ path: "speech.normal",+ properties: {+ language: "en",+ pace: "normal",+ padding: 0.3,+ min: 4,+ max: 15,+ rounding: "ceil",+ },+ });+ assert.equal(policy.language, "en");+ assert.equal(policy.maximumSec, 15);+ assert.throws(() => speechEstimatePolicyFromRecipe({+ contract: "svml.svs-recipe@1",+ path: "speech.invalid",+ properties: { provider: "gemini" },+ }), /unknown property provider/u);+});diff --git a/packages/film/package.json b/packages/film/package.jsonindex fd2fd720..f375101a 100644--- a/packages/film/package.json+++ b/packages/film/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/component-kit": "workspace:*","@svml/contracts": "workspace:*",diff --git a/packages/film/src/activation.ts b/packages/film/src/activation.tsnew file mode 100644index 00000000..58d99edc--- /dev/null+++ b/packages/film/src/activation.ts@@ -0,0 +1,16 @@+import { createTextSurfaceHostFacet } from "@svml/text";+import {+ decodeFilmSurface, filmComponent, filmManifest, filmModuleRef, filmSurfaceImplementationDigest,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/film",+ modules: [{ manifest: filmManifest, specifiers: ["@svml/film", "@svml/film@1"] }],+ components: [filmComponent],+ hostFacets: [createTextSurfaceHostFacet({+ module: filmModuleRef, surface: "film", mode: "structured",+ implementationDigest: filmSurfaceImplementationDigest, handler: decodeFilmSurface,+ })],+};+export default svmlPackage;diff --git a/packages/generation/package.json b/packages/generation/package.jsonindex c092db96..0ea42c88 100644--- a/packages/generation/package.json+++ b/packages/generation/package.json@@ -6,6 +6,9 @@"exports": {".": "./src/index.ts"},+ "svml": {+ "activation": "./src/activation.ts"+ },"dependencies": {"@svml/artifact": "workspace:*","@svml/component-kit": "workspace:*",diff --git a/packages/generation/src/activation.ts b/packages/generation/src/activation.tsnew file mode 100644index 00000000..1b599223--- /dev/null+++ b/packages/generation/src/activation.ts@@ -0,0 +1,10 @@+import { generationComponent, generationManifest } from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/generation",+ modules: [{ manifest: generationManifest }],+ components: [generationComponent],+};++export default svmlPackage;diff --git a/packages/hyperframes-render/package.json b/packages/hyperframes-render/package.jsonindex 1e2c23a6..83bc1abc 100644--- a/packages/hyperframes-render/package.json+++ b/packages/hyperframes-render/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/component-kit": "workspace:*","@svml/contracts": "workspace:*",diff --git a/packages/hyperframes-render/src/activation.ts b/packages/hyperframes-render/src/activation.tsnew file mode 100644index 00000000..b5e9955a--- /dev/null+++ b/packages/hyperframes-render/src/activation.ts@@ -0,0 +1,18 @@+import { createTextSurfaceHostFacet } from "@svml/text";+import {+ decodeHyperframesRenderSurface, hyperframesRenderComponent, hyperframesRenderManifest,+ hyperframesRenderModuleRef, hyperframesRenderSurfaceImplementationDigest,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/hyperframes-render",+ modules: [{ manifest: hyperframesRenderManifest, specifiers: ["@svml/hyperframes-render", "@svml/hyperframes-render@1"] }],+ components: [hyperframesRenderComponent],+ hostFacets: [createTextSurfaceHostFacet({+ module: hyperframesRenderModuleRef, surface: "video", mode: "structured",+ implementationDigest: hyperframesRenderSurfaceImplementationDigest,+ handler: decodeHyperframesRenderSurface,+ })],+};+export default svmlPackage;diff --git a/packages/hyperframes/package.json b/packages/hyperframes/package.jsonindex 8745fc45..dbbf782a 100644--- a/packages/hyperframes/package.json+++ b/packages/hyperframes/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/component-kit": "workspace:*","@svml/contracts": "workspace:*",diff --git a/packages/hyperframes/src/activation.ts b/packages/hyperframes/src/activation.tsnew file mode 100644index 00000000..11245f40--- /dev/null+++ b/packages/hyperframes/src/activation.ts@@ -0,0 +1,9 @@+import { hyperframesComponent, hyperframesManifest } from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/hyperframes",+ modules: [{ manifest: hyperframesManifest }],+ components: [hyperframesComponent],+};+export default svmlPackage;diff --git a/packages/media-pipeline/package.json b/packages/media-pipeline/package.jsonindex cfa4dbed..61e4a00c 100644--- a/packages/media-pipeline/package.json+++ b/packages/media-pipeline/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/artifact": "workspace:*","@svml/component-kit": "workspace:*",diff --git a/packages/media-pipeline/src/activation.ts b/packages/media-pipeline/src/activation.tsnew file mode 100644index 00000000..9730cf63--- /dev/null+++ b/packages/media-pipeline/src/activation.ts@@ -0,0 +1,9 @@+import { mediaPipelineComponent, mediaPipelineManifest } from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/media-pipeline",+ modules: [{ manifest: mediaPipelineManifest }],+ components: [mediaPipelineComponent],+};+export default svmlPackage;diff --git a/packages/media/README.md b/packages/media/README.mdindex c06b6742..d85c2d68 100644--- a/packages/media/README.md+++ b/packages/media/README.md@@ -2,6 +2,7 @@Author-facing media declarations for the neutral `@svml/media` contract module.-`<media:Image>` requests bytes through the Host-owned source-asset capability and emits one-content-addressed `BlobArtifact`. It does not open files itself, inspect media, call a Provider or-promote an embedded audio stream to speech.+`<media:Image>` and `<media:Audio>` request bytes through the Host-owned source-asset capability and+emit one content-addressed `BlobArtifact`. They do not open files themselves, inspect media, call a+Provider or promote declared audio to speech. The consuming author package decides whether an audio+artifact is a voice reference, soundtrack, evidence source or something else.diff --git a/packages/media/package.json b/packages/media/package.jsonindex 4aa1f913..67f7a96f 100644--- a/packages/media/package.json+++ b/packages/media/package.json@@ -6,6 +6,9 @@"exports": {".": "./src/index.ts"},+ "svml": {+ "activation": "./src/activation.ts"+ },"dependencies": {"@svml/artifact": "workspace:*","@svml/contracts": "workspace:*",diff --git a/packages/media/src/activation.ts b/packages/media/src/activation.tsnew file mode 100644index 00000000..e335a70b--- /dev/null+++ b/packages/media/src/activation.ts@@ -0,0 +1,35 @@+import { mediaContractsComponent } from "@svml/contracts";+import { createTextSurfaceHostFacet } from "@svml/text";++import {+ decodeMediaAudioSurface,+ decodeMediaImageSurface,+ mediaManifest,+ mediaModuleRef,+ mediaSurfaceImplementationDigests,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/media",+ modules: [{ manifest: mediaManifest, specifiers: ["@svml/media", "@svml/media@1"] }],+ components: [mediaContractsComponent],+ hostFacets: [+ createTextSurfaceHostFacet({+ module: mediaModuleRef,+ surface: "image",+ mode: "structured",+ implementationDigest: mediaSurfaceImplementationDigests.image,+ handler: decodeMediaImageSurface,+ }),+ createTextSurfaceHostFacet({+ module: mediaModuleRef,+ surface: "audio",+ mode: "structured",+ implementationDigest: mediaSurfaceImplementationDigests.audio,+ handler: decodeMediaAudioSurface,+ }),+ ],+};++export default svmlPackage;diff --git a/packages/media/src/index.ts b/packages/media/src/index.tsindex db685bac..d68226ad 100644--- a/packages/media/src/index.ts+++ b/packages/media/src/index.ts@@ -1,4 +1,7 @@-export { decodeMediaImageSurface } from "./surface.js";+export {+ decodeMediaAudioSurface,+ decodeMediaImageSurface,+} from "./surface.js";export {mediaManifest,mediaManifestDigest,diff --git a/packages/media/src/surface.ts b/packages/media/src/surface.tsindex 09aafa97..cf9d92f9 100644--- a/packages/media/src/surface.ts+++ b/packages/media/src/surface.ts@@ -4,7 +4,7 @@ import type {StructuredSurfaceHandler,} from "@svml/text";-const MEDIA_TYPES = new Map([+const IMAGE_MEDIA_TYPES = new Map([[".avif", "image/avif"],[".gif", "image/gif"],[".jpeg", "image/jpeg"],@@ -13,6 +13,17 @@ const MEDIA_TYPES = new Map([[".webp", "image/webp"],]);+const AUDIO_MEDIA_TYPES = new Map([+ [".aac", "audio/aac"],+ [".flac", "audio/flac"],+ [".m4a", "audio/mp4"],+ [".mp3", "audio/mpeg"],+ [".oga", "audio/ogg"],+ [".ogg", "audio/ogg"],+ [".opus", "audio/opus"],+ [".wav", "audio/wav"],+]);+function stringAttribute(element: StructuredElement, name: string): string {const value = element.attributes[name];if (typeof value !== "string" || value.trim().length === 0) {@@ -27,25 +38,35 @@ function assertChildrenEmpty(element: StructuredElement): void {}}-function mediaTypeFor(element: StructuredElement, source: string): string {+function mediaTypeFor(+ element: StructuredElement,+ source: string,+ kind: "image" | "audio",+ known: ReadonlyMap<string, string>,+): string {const explicit = element.attributes["media-type"];if (explicit !== undefined) {- if (typeof explicit !== "string" || !explicit.startsWith("image/")) {- throw new Error(`${element.name}.media-type must be an image media type`);+ if (typeof explicit !== "string" || !explicit.startsWith(`${kind}/`)) {+ throw new Error(`${element.name}.media-type must be an ${kind} media type`);}return explicit;}const clean = source.split(/[?#]/u, 1)[0]!.toLocaleLowerCase("en");const dot = clean.lastIndexOf(".");- const inferred = dot < 0 ? undefined : MEDIA_TYPES.get(clean.slice(dot));+ const inferred = dot < 0 ? undefined : known.get(clean.slice(dot));if (inferred === undefined) {- throw new Error(`${element.name}.src needs a known image extension or an explicit media-type`);+ throw new Error(`${element.name}.src needs a known ${kind} extension or an explicit media-type`);}return inferred;}/** Host resolves and stages the bytes; this Surface only declares their authored media meaning. */-export const decodeMediaImageSurface: StructuredSurfaceHandler = async ({ element, resolveAsset }) => {+async function decodeMediaAssetSurface(+ element: StructuredElement,+ resolveAsset: Parameters<StructuredSurfaceHandler>[0]["resolveAsset"],+ kind: "image" | "audio",+ known: ReadonlyMap<string, string>,+) {const names = Object.keys(element.attributes).sort();if (names.join(",") !== "id,src" && names.join(",") !== "id,media-type,src") {throw new Error(`${element.name} requires id and src, with optional media-type`);@@ -53,10 +74,10 @@ export const decodeMediaImageSurface: StructuredSurfaceHandler = async ({ elemenassertChildrenEmpty(element);const id = stringAttribute(element, "id");const source = stringAttribute(element, "src");- const mediaType = mediaTypeFor(element, source);+ const mediaType = mediaTypeFor(element, source, kind, known);const resolved = await resolveAsset({ from: source, mediaType, range: element.range });- if (!resolved.artifact.mediaType.startsWith("image/")) {- throw new Error(`${element.name}.src did not resolve to an image artifact`);+ if (!resolved.artifact.mediaType.startsWith(`${kind}/`)) {+ throw new Error(`${element.name}.src did not resolve to an ${kind} artifact`);}return {records: [{@@ -68,4 +89,10 @@ export const decodeMediaImageSurface: StructuredSurfaceHandler = async ({ elemencomponents: [],fragments: [],};-};+}++export const decodeMediaImageSurface: StructuredSurfaceHandler = async ({ element, resolveAsset }) =>+ await decodeMediaAssetSurface(element, resolveAsset, "image", IMAGE_MEDIA_TYPES);++export const decodeMediaAudioSurface: StructuredSurfaceHandler = async ({ element, resolveAsset }) =>+ await decodeMediaAssetSurface(element, resolveAsset, "audio", AUDIO_MEDIA_TYPES);diff --git a/packages/prelude-video/README.md b/packages/prelude-video/README.mddeleted file mode 100644index e66b0214..00000000--- a/packages/prelude-video/README.md+++ /dev/null@@ -1,19 +0,0 @@-# `@svml/prelude-video`--Ordinary multi-facet package aggregate for the official video language. It contributes Module-Manifests, the SVS Frontend, official Text Surfaces and the deterministic compute facets currently-owned by those modules. Compiler and Runtime Hosts grant those facets independently. The package-has no Provider, credential, store, queue, network or rendering authority.--The aggregate installs the ordinary `@svml/media` Image Surface, the exact `@svml/seedance`-Prompt/Speech/Video Surfaces and the shared generated-media primary projection. These are package-facets, not CLI or Core branches.--The aggregate also carries the complete `@svml/speech-take`, `@svml/speech-align` and-`@svml/caption` Manifests, including four Product projections, the provider-neutral timing locator,-Caption temporalization, VisualTrack lowering and Caption-owned validators. A physical package-lock-test proves that these dependencies are discovered from the installed package closure rather than-from a CLI or Runtime registration list.--The CLI depends only on this replaceable prelude rather than enumerating Script, Film or-HyperFrames packages itself.diff --git a/packages/prelude-video/package.json b/packages/prelude-video/package.jsondeleted file mode 100644index fb1df546..00000000--- a/packages/prelude-video/package.json+++ /dev/null@@ -1,37 +0,0 @@-{- "name": "@svml/prelude-video",- "version": "0.0.0-dev",- "private": true,- "type": "module",- "exports": {- ".": "./src/index.ts"- },- "svml": {- "activation": "./src/index.ts"- },- "dependencies": {- "@svml/broll": "workspace:*",- "@svml/caption": "workspace:*",- "@svml/caption-gemini": "workspace:*",- "@svml/contracts": "workspace:*",- "@svml/estimate": "workspace:*",- "@svml/generation": "workspace:*",- "@svml/film": "workspace:*",- "@svml/hyperframes": "workspace:*",- "@svml/hyperframes-render": "workspace:*",- "@svml/media-pipeline": "workspace:*",- "@svml/media": "workspace:*",- "@svml/script": "workspace:*",- "@svml/seedance": "workspace:*",- "@svml/speech-align": "workspace:*",- "@svml/speech-program": "workspace:*",- "@svml/speech-take": "workspace:*",- "@svml/svs": "workspace:*",- "@svml/text": "workspace:*",- "@svml/text-track": "workspace:*",- "@svml/whisperx": "workspace:*"- },- "devDependencies": {- "@svml/package-loader-node": "workspace:*"- }-}diff --git a/packages/prelude-video/src/index.ts b/packages/prelude-video/src/index.tsdeleted file mode 100644index 367044be..00000000--- a/packages/prelude-video/src/index.ts+++ /dev/null@@ -1,288 +0,0 @@-import {- videoContractManifests,- videoContractsComponents,-} from "@svml/contracts";-import {- generationComponent,- generationManifest,-} from "@svml/generation";-import {- brollComponent,- brollManifest,- brollModuleRef,- brollSurfaceImplementationDigest,- decodeBrollTrackSurface,-} from "@svml/broll";-import {- captionComponent,- captionManifest,- captionModuleRef,- captionProgramSurfaceImplementationDigest,- captionSurfaceImplementationDigest,- captionStyleSurfaceImplementationDigest,- decodeCaptionProgramSurface,- decodeCaptionStyleSurface,- decodeCaptionTrackSurface,-} from "@svml/caption";-import {- captionGeminiComponent,- captionGeminiImplementationDigests,- captionGeminiManifest,- captionGeminiModuleRef,- decodeCaptionGeminiPlannerSurface,-} from "@svml/caption-gemini";-import {- decodeSpeechEstimateSurface,- estimateComponent,- estimateManifest,- estimateModuleRef,- estimateSurfaceImplementationDigest,-} from "@svml/estimate";-import {- decodeFilmSurface,- filmComponent,- filmManifest,- filmModuleRef,- filmSurfaceImplementationDigest,-} from "@svml/film";-import {- hyperframesComponent,- hyperframesManifest,-} from "@svml/hyperframes";-import {- decodeHyperframesRenderSurface,- hyperframesRenderComponent,- hyperframesRenderManifest,- hyperframesRenderModuleRef,- hyperframesRenderSurfaceImplementationDigest,-} from "@svml/hyperframes-render";-import {- mediaPipelineComponent,- mediaPipelineManifest,-} from "@svml/media-pipeline";-import {- decodeMediaImageSurface,- mediaModuleRef,- mediaSurfaceImplementationDigests,-} from "@svml/media";-import type { NodePackageContribution } from "@svml/package-loader-node";-import {- decodeScriptSurface,- scriptManifest,- scriptModuleRef,- scriptSurfaceImplementationDigest,-} from "@svml/script";-import {- decodeSeedancePromptSurface,- decodeSeedanceSpeechSurface,- decodeSeedanceVideoSurface,- seedanceComponent,- seedanceManifest,- seedanceModuleRef,- seedanceSurfaceImplementationDigests,-} from "@svml/seedance";-import {- speechAlignComponent,- speechAlignManifest,-} from "@svml/speech-align";-import {- speechTakeComponent,- speechTakeManifest,-} from "@svml/speech-take";-import {- decodeSpeechSpineSurface,- speechProgramComponent,- speechProgramManifest,- speechProgramModuleRef,- speechSpineSurfaceImplementationDigest,-} from "@svml/speech-program";-import { svsFrontend, svsManifest } from "@svml/svs";-import {- createTextSurfaceHostFacet,-} from "@svml/text";-import type { TextSurfaceHostFacetOptions } from "@svml/text";-import {- decodeTextTrackSurface,- textTrackComponent,- textTrackManifest,- textTrackModuleRef,- textTrackSurfaceImplementationDigest,-} from "@svml/text-track";-import {- decodeWhisperXAlignmentSurface,- whisperXComponent,- whisperXImplementationDigests,- whisperXManifest,- whisperXModuleRef,-} from "@svml/whisperx";--export const svmlPackage: NodePackageContribution = {- format: "svml.node-package@1",- name: "@svml/prelude-video",- modules: [- ...videoContractManifests.map((manifest) => ({- manifest,- ...(manifest.name === mediaModuleRef.name- ? { specifiers: ["@svml/media", "@svml/media@1"] }- : {}),- })),- { manifest: generationManifest },- { manifest: estimateManifest, specifiers: ["@svml/estimate", "@svml/estimate@1"] },- { manifest: seedanceManifest, specifiers: ["@svml/seedance", "@svml/seedance@1"] },- { manifest: scriptManifest, specifiers: ["@svml/script", "@svml/script@1"] },- { manifest: svsManifest },- { manifest: hyperframesManifest },- { manifest: mediaPipelineManifest },- { manifest: captionManifest, specifiers: ["@svml/caption", "@svml/caption@1"] },- {- manifest: captionGeminiManifest,- specifiers: ["@svml/caption-gemini", "@svml/caption-gemini@1"],- },- { manifest: speechAlignManifest },- { manifest: speechTakeManifest },- { manifest: speechProgramManifest, specifiers: ["@svml/speech", "@svml/speech@1"] },- { manifest: whisperXManifest, specifiers: ["@svml/whisperx", "@svml/whisperx@1"] },- { manifest: textTrackManifest, specifiers: ["@svml/text-track", "@svml/text-track@1"] },- { manifest: brollManifest, specifiers: ["@svml/broll", "@svml/broll@1"] },- { manifest: filmManifest, specifiers: ["@svml/film", "@svml/film@1"] },- {- manifest: hyperframesRenderManifest,- specifiers: ["@svml/hyperframes-render", "@svml/hyperframes-render@1"],- },- ],- authorFrontends: [svsFrontend],- components: [- ...videoContractsComponents,- generationComponent,- estimateComponent,- seedanceComponent,- captionComponent,- captionGeminiComponent,- mediaPipelineComponent,- speechAlignComponent,- speechTakeComponent,- speechProgramComponent,- whisperXComponent,- textTrackComponent,- brollComponent,- filmComponent,- hyperframesComponent,- hyperframesRenderComponent,- ],- hostFacets: ([- {- module: estimateModuleRef,- surface: "speech",- mode: "structured",- implementationDigest: estimateSurfaceImplementationDigest,- handler: decodeSpeechEstimateSurface,- },- {- module: mediaModuleRef,- surface: "image",- mode: "structured",- implementationDigest: mediaSurfaceImplementationDigests.image,- handler: decodeMediaImageSurface,- },- {- module: seedanceModuleRef,- surface: "prompt",- mode: "structured",- implementationDigest: seedanceSurfaceImplementationDigests.prompt,- handler: decodeSeedancePromptSurface,- },- {- module: seedanceModuleRef,- surface: "speech",- mode: "structured",- implementationDigest: seedanceSurfaceImplementationDigests.speech,- handler: decodeSeedanceSpeechSurface,- },- {- module: seedanceModuleRef,- surface: "video",- mode: "structured",- implementationDigest: seedanceSurfaceImplementationDigests.video,- handler: decodeSeedanceVideoSurface,- },- {- module: scriptModuleRef,- surface: "script",- mode: "raw",- implementationDigest: scriptSurfaceImplementationDigest,- handler: decodeScriptSurface,- },- {- module: captionModuleRef,- surface: "style",- mode: "structured",- implementationDigest: captionStyleSurfaceImplementationDigest,- handler: decodeCaptionStyleSurface,- },- {- module: captionModuleRef,- surface: "program",- mode: "structured",- implementationDigest: captionProgramSurfaceImplementationDigest,- handler: decodeCaptionProgramSurface,- },- {- module: captionModuleRef,- surface: "track",- mode: "structured",- implementationDigest: captionSurfaceImplementationDigest,- handler: decodeCaptionTrackSurface,- },- {- module: captionGeminiModuleRef,- surface: "planner",- mode: "structured",- implementationDigest: captionGeminiImplementationDigests.plannerSurface,- handler: decodeCaptionGeminiPlannerSurface,- },- {- module: speechProgramModuleRef,- surface: "spine",- mode: "structured",- implementationDigest: speechSpineSurfaceImplementationDigest,- handler: decodeSpeechSpineSurface,- },- {- module: whisperXModuleRef,- surface: "alignment",- mode: "structured",- implementationDigest: whisperXImplementationDigests.surface,- handler: decodeWhisperXAlignmentSurface,- },- {- module: brollModuleRef,- surface: "track",- mode: "structured",- implementationDigest: brollSurfaceImplementationDigest,- handler: decodeBrollTrackSurface,- },- {- module: textTrackModuleRef,- surface: "track",- mode: "structured",- implementationDigest: textTrackSurfaceImplementationDigest,- handler: decodeTextTrackSurface,- },- {- module: filmModuleRef,- surface: "film",- mode: "structured",- implementationDigest: filmSurfaceImplementationDigest,- handler: decodeFilmSurface,- },- {- module: hyperframesRenderModuleRef,- surface: "video",- mode: "structured",- implementationDigest: hyperframesRenderSurfaceImplementationDigest,- handler: decodeHyperframesRenderSurface,- },- ] satisfies readonly TextSurfaceHostFacetOptions[]).map(createTextSurfaceHostFacet),-};--export default svmlPackage;diff --git a/packages/prelude-video/test/activation.test.ts b/packages/prelude-video/test/activation.test.tsdeleted file mode 100644index 5932ade2..00000000--- a/packages/prelude-video/test/activation.test.ts+++ /dev/null@@ -1,100 +0,0 @@-import assert from "node:assert/strict";-import {- mkdtemp,- rm,-} from "node:fs/promises";-import { tmpdir } from "node:os";-import { join } from "node:path";-import { fileURLToPath } from "node:url";-import test from "node:test";--import {- captionComponent,- captionManifest,-} from "@svml/caption";-import { generationComponent } from "@svml/generation";-import {- createNodePackageLock,- collectNodePackageComponents,- loadNodePackageContributions,- writeNodePackageLock,-} from "@svml/package-loader-node";-import {- speechAlignComponent,- speechAlignManifest,-} from "@svml/speech-align";-import {- speechTakeComponent,- speechTakeManifest,-} from "@svml/speech-take";-import { seedanceComponent } from "@svml/seedance";--import { svmlPackage } from "../src/index.js";--test("the official prelude activates SpeechTake compute without teaching the Host its name", () => {- const components = collectNodePackageComponents([svmlPackage]);- assert.equal(- svmlPackage.modules?.some((module) => module.manifest === speechTakeManifest),- true,- );- assert.equal(components.includes(speechTakeComponent), true);- assert.deepEqual(- speechTakeComponent.producers.map((facet) => facet.producer.name).sort(),- ["project-audio", "project-audio-track", "project-program-space", "project-visual"],- );-});--test("the official prelude activates Speech Align compute without teaching the Host its name", () => {- const components = collectNodePackageComponents([svmlPackage]);- assert.equal(- svmlPackage.modules?.some((module) => module.manifest === speechAlignManifest),- true,- );- assert.equal(components.includes(speechAlignComponent), true);- assert.deepEqual(- speechAlignComponent.producers.map((facet) => facet.producer.name),- ["locate-speech"],- );-});--test("the official prelude activates Caption compute and owner validators without Host special cases", () => {- const components = collectNodePackageComponents([svmlPackage]);- assert.equal(- svmlPackage.modules?.some((module) => module.manifest === captionManifest),- true,- );- assert.equal(components.includes(captionComponent), true);- assert.deepEqual(- captionComponent.producers.map((facet) => facet.producer.name),- ["temporalize-caption", "temporalize-caption-plan", "render-caption-program", "render-caption-track"],- );- assert.deepEqual(- captionComponent.validators?.map((facet) => facet.type.name),- ["CaptionStyle", "CaptionProgram", "CaptionPlan", "TimedCaptionProjection", "CaptionTrackProgram"],- );-});--test("the installed official package lock physically contains speech and Caption compute", async () => {- const directory = await mkdtemp(join(tmpdir(), "svml-prelude-lock-"));- const lockPath = join(directory, "svml.packages.lock");- const installedRoot = fileURLToPath(new URL("../../cli/", import.meta.url));- try {- const lock = await createNodePackageLock(["@svml/prelude-video"], installedRoot);- assert.equal(lock.artifacts.some((artifact) => artifact.name === "@svml/speech-take"), true);- assert.equal(lock.artifacts.some((artifact) => artifact.name === "@svml/speech-align"), true);- assert.equal(lock.artifacts.some((artifact) => artifact.name === "@svml/caption"), true);- assert.equal(lock.artifacts.some((artifact) => artifact.name === "@svml/media"), true);- assert.equal(lock.artifacts.some((artifact) => artifact.name === "@svml/generation"), true);- assert.equal(lock.artifacts.some((artifact) => artifact.name === "@svml/seedance"), true);- await writeNodePackageLock(lockPath, lock);- const packages = await loadNodePackageContributions(lockPath, installedRoot);- const components = collectNodePackageComponents(packages);- assert.equal(components.some((component) => component.name === "@svml/speech-take"), true);- assert.equal(components.some((component) => component.name === "@svml/speech-align"), true);- assert.equal(components.some((component) => component.name === "@svml/caption"), true);- assert.equal(components.includes(generationComponent), true);- assert.equal(components.includes(seedanceComponent), true);- } finally {- await rm(directory, { recursive: true, force: true });- }-});diff --git a/packages/prompt-kit/README.md b/packages/prompt-kit/README.mdnew file mode 100644index 00000000..db0d0fe8--- /dev/null+++ b/packages/prompt-kit/README.md@@ -0,0 +1,14 @@+# `@svml/prompt-kit`++Optional author-time compiler from a declarative Prompt Kit Spec and one Invocation to an ordered,+inspectable Prompt Program. It is reusable beyond video, but is not part of the domain-neutral+Core.++It recognizes only four bounded block forms: fixed text, one parameter axis, a finite conditional+variant and a required/optional text slot. It has no network, Provider, model, video or Speaker+knowledge and cannot execute arbitrary expressions.++The self-described `@svml/prompt-kit/svs@1` Frontend reads ordinary SVS syntax and exports one+authored `PromptKitSpec`. SVS does not execute a Kit. A Surface supplies the domain binding and+invokes this pure compiler while lowering author source; no Prompt Kit Producer, Need, queue task or+Provider call exists in the Run Graph.diff --git a/packages/prompt-kit/package.json b/packages/prompt-kit/package.jsonnew file mode 100644index 00000000..af9684da--- /dev/null+++ b/packages/prompt-kit/package.json@@ -0,0 +1,19 @@+{+ "name": "@svml/prompt-kit",+ "version": "0.0.0-dev",+ "private": true,+ "type": "module",+ "exports": {+ ".": "./src/index.ts"+ },+ "svml": {+ "activation": "./src/activation.ts"+ },+ "dependencies": {+ "@svml/component-kit": "workspace:*",+ "@svml/core": "workspace:*",+ "@svml/elaborator": "workspace:*",+ "@svml/protocol": "workspace:*",+ "@svml/svs": "workspace:*"+ }+}diff --git a/packages/prompt-kit/src/activation.ts b/packages/prompt-kit/src/activation.tsnew file mode 100644index 00000000..ac2d5022--- /dev/null+++ b/packages/prompt-kit/src/activation.ts@@ -0,0 +1,18 @@+import {+ promptKitComponent,+ promptKitManifest,+ promptKitSvsFrontend,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/prompt-kit",+ modules: [{+ manifest: promptKitManifest,+ specifiers: ["@svml/prompt-kit", "@svml/prompt-kit@1"],+ }],+ authorFrontends: [promptKitSvsFrontend],+ components: [promptKitComponent],+};++export default svmlPackage;diff --git a/packages/prompt-kit/src/component.ts b/packages/prompt-kit/src/component.tsnew file mode 100644index 00000000..bcace6d0--- /dev/null+++ b/packages/prompt-kit/src/component.ts@@ -0,0 +1,37 @@+import type { ComponentPackage } from "@svml/component-kit";+import type { StoredValue } from "@svml/protocol";++import {+ promptKitImplementationDigests,+ promptKitTypes,+} from "./manifest.js";+import {+ verifyPromptKitInvocation,+ verifyPromptKitSpec,+ verifyPromptProgram,+} from "./program.js";+function inline<T>(value: StoredValue | undefined, subject: string): T {+ if (value?.kind !== "inline") throw new Error(`${subject} must be inline`);+ return value.value as unknown as T;+}++export const promptKitComponent = {+ name: "@svml/prompt-kit",+ validators: [+ {+ type: promptKitTypes.spec,+ implementationDigest: promptKitImplementationDigests.specValidator,+ handler: ({ value }) => verifyPromptKitSpec(inline(value, "PromptKitSpec")),+ },+ {+ type: promptKitTypes.invocation,+ implementationDigest: promptKitImplementationDigests.invocationValidator,+ handler: ({ value }) => verifyPromptKitInvocation(inline(value, "PromptKitInvocation")),+ },+ {+ type: promptKitTypes.program,+ implementationDigest: promptKitImplementationDigests.programValidator,+ handler: ({ value }) => verifyPromptProgram(inline(value, "PromptProgram")),+ },+ ],+} satisfies ComponentPackage;diff --git a/packages/prompt-kit/src/frontend.ts b/packages/prompt-kit/src/frontend.tsnew file mode 100644index 00000000..7a7e0a25--- /dev/null+++ b/packages/prompt-kit/src/frontend.ts@@ -0,0 +1,73 @@+import {+ sealRecord,+ sealTypedModule,+ verifyClosure,+ verifyRecordStructure,+} from "@svml/core";+import { sealAuthorModule } from "@svml/elaborator";+import type { AuthorFrontend, AuthorSourceExport } from "@svml/elaborator";+import { parseSvs } from "@svml/svs";++import {+ promptKitImplementationDigests,+ promptKitModuleRef,+ promptKitTypes,+} from "./manifest.js";+import { promptKitSpecFromSvsRecipes } from "./svs.js";++export const promptKitSvsFrontendId = "@svml/prompt-kit/svs@1";++/**+ * A self-described Prompt Kit source is ordinary SVS syntax with Prompt Kit semantics.+ * It compiles one complete Kit into one authored PromptKitSpec and never enters the Run Graph.+ */+export const promptKitSvsFrontend: AuthorFrontend = {+ id: promptKitSvsFrontendId,+ implementationDigest: promptKitImplementationDigests.svsFrontend,+ discover() {+ return {+ modules: [`${promptKitModuleRef.name}@${promptKitModuleRef.version}`],+ sources: [],+ };+ },+ decode(source, context) {+ verifyClosure(context.closure);+ const parsed = parseSvs(source.name, source.text);+ const recipes = parsed.recipes.map((item) => item.value);+ const candidates = recipes+ .map((recipe) => /^prompt-kit\.([a-z][a-z0-9-]{0,95})$/u.exec(recipe.path)?.[1])+ .filter((id): id is string => id !== undefined);+ if (candidates.length !== 1) {+ throw new Error(`${source.name} must declare exactly one prompt-kit.<id> metadata Recipe`);+ }+ const spec = promptKitSpecFromSvsRecipes(recipes, candidates[0]!);+ const record = sealRecord({+ id: spec.id,+ type: promptKitTypes.spec,+ value: { kind: "inline", value: spec as unknown as import("@svml/protocol").CanonicalValue },+ conformance: "exact",+ origin: {+ kind: "authored",+ sourceDigest: source.sourceDigest,+ frontendClosureDigest: promptKitImplementationDigests.svsFrontend,+ sourceName: source.name,+ },+ });+ verifyRecordStructure(context.closure, record);+ const exports: AuthorSourceExport[] = [{+ name: spec.id,+ ref: { kind: "record", id: record.id },+ type: record.type,+ }];+ return {+ module: sealTypedModule({+ id: `source:${source.name}`,+ closureDigest: context.closure.digest,+ records: [record],+ }),+ author: sealAuthorModule({ name: `source:${source.name}`, components: [] }),+ fragments: [],+ exports,+ };+ },+};diff --git a/packages/prompt-kit/src/index.ts b/packages/prompt-kit/src/index.tsnew file mode 100644index 00000000..82aa67a1--- /dev/null+++ b/packages/prompt-kit/src/index.ts@@ -0,0 +1,22 @@+export { promptKitComponent } from "./component.js";+export {+ promptKitImplementationDigests,+ promptKitManifest,+ promptKitManifestDigest,+ promptKitModuleRef,+ promptKitTypes,+} from "./manifest.js";+export {+ promptKitSvsFrontend,+ promptKitSvsFrontendId,+} from "./frontend.js";+export {+ compilePromptKit,+ sealPromptKitInvocation,+ sealPromptKitSpec,+ verifyPromptKitInvocation,+ verifyPromptKitSpec,+ verifyPromptProgram,+} from "./program.js";+export { promptKitSpecFromSvsRecipes } from "./svs.js";+export type * from "./types.js";diff --git a/packages/prompt-kit/src/manifest.ts b/packages/prompt-kit/src/manifest.tsnew file mode 100644index 00000000..41a41ec5--- /dev/null+++ b/packages/prompt-kit/src/manifest.ts@@ -0,0 +1,81 @@+import { digestOf } from "@svml/protocol";+import type { Digest, ModuleManifest, TypeRef, ValueSchema } from "@svml/protocol";++export const promptKitModuleRef = { name: "@svml/prompt-kit", version: "0.0.0-dev" } as const;+export const promptKitTypes = {+ spec: { module: promptKitModuleRef, name: "PromptKitSpec" },+ invocation: { module: promptKitModuleRef, name: "PromptKitInvocation" },+ program: { module: promptKitModuleRef, name: "PromptProgram" },+} satisfies Record<string, TypeRef>;+export const promptKitImplementationDigests = {+ svsFrontend: digestOf("@svml/prompt-kit/svs-frontend@1"),+ specValidator: digestOf("@svml/prompt-kit/validate-spec@1"),+ invocationValidator: digestOf("@svml/prompt-kit/validate-invocation@1"),+ programValidator: digestOf("@svml/prompt-kit/validate-program@1"),+} as const;++const digest: ValueSchema = { kind: "string", minLength: 71, maxLength: 71 };+const openObject: ValueSchema = { kind: "object", fields: {}, allowUnknown: true };+const block: ValueSchema = { kind: "object", fields: {}, allowUnknown: true };+const specSchema: ValueSchema = {+ kind: "object",+ fields: {+ contract: { schema: { kind: "literal", value: "svml.prompt-kit-spec@1" } },+ id: { schema: { kind: "string", minLength: 1 } },+ separator: { schema: { kind: "literal", value: "\n\n" } },+ defaults: { schema: openObject },+ blocks: { schema: { kind: "array", minItems: 1, items: block } },+ specDigest: { schema: digest },+ },+};+const invocationSchema: ValueSchema = {+ kind: "object",+ fields: {+ contract: { schema: { kind: "literal", value: "svml.prompt-kit-invocation@1" } },+ kit: { schema: { kind: "string", minLength: 1 } },+ parameters: { schema: openObject },+ selectors: { schema: openObject },+ slots: { schema: openObject },+ invocationDigest: { schema: digest },+ },+};+const programSchema: ValueSchema = {+ kind: "object",+ fields: {+ contract: { schema: { kind: "literal", value: "svml.prompt-program@1" } },+ kit: { schema: { kind: "string", minLength: 1 } },+ specDigest: { schema: digest },+ invocationDigest: { schema: digest },+ separator: { schema: { kind: "literal", value: "\n\n" } },+ blocks: { schema: { kind: "array", minItems: 1, items: block } },+ programDigest: { schema: digest },+ },+};++function validatedType(name: string, schema: ValueSchema, locator: string, validatorDigest: Digest) {+ return {+ name,+ schema,+ validator: {+ abi: "svml.type-validator@1" as const,+ implementation: { kind: "registered" as const, locator, digest: validatorDigest },+ },+ };+}++export const promptKitManifest: ModuleManifest = {+ format: "svml.module@0",+ name: promptKitModuleRef.name,+ version: promptKitModuleRef.version,+ dependencies: [],+ types: [+ validatedType(promptKitTypes.spec.name, specSchema, "@svml/prompt-kit/validate-spec", promptKitImplementationDigests.specValidator),+ validatedType(promptKitTypes.invocation.name, invocationSchema, "@svml/prompt-kit/validate-invocation", promptKitImplementationDigests.invocationValidator),+ validatedType(promptKitTypes.program.name, programSchema, "@svml/prompt-kit/validate-program", promptKitImplementationDigests.programValidator),+ ],+ capabilities: [],+ surfaces: [],+ producers: [],+};++export const promptKitManifestDigest = digestOf(promptKitManifest);diff --git a/packages/prompt-kit/src/program.ts b/packages/prompt-kit/src/program.tsnew file mode 100644index 00000000..c016d1fc--- /dev/null+++ b/packages/prompt-kit/src/program.ts@@ -0,0 +1,290 @@+import { canonicalize, digestOf, isDigest } from "@svml/protocol";++import type {+ PromptKitAxisBlock,+ PromptKitBlockSpec,+ PromptKitChoice,+ PromptKitInvocation,+ PromptKitScalar,+ PromptKitSpec,+ PromptProgram,+ PromptProgramBlock,+} from "./types.js";++const ID = /^[a-z][a-z0-9-]{0,95}$/u;++function object(value: unknown, subject: string): Record<string, unknown> {+ if (value === null || typeof value !== "object" || Array.isArray(value)) {+ throw new Error(`${subject} must be an object`);+ }+ return value as Record<string, unknown>;+}++function scalar(value: unknown, subject: string): asserts value is PromptKitScalar {+ if (+ typeof value !== "string"+ && typeof value !== "boolean"+ && !(typeof value === "number" && Number.isFinite(value))+ ) {+ throw new Error(`${subject} must be a finite scalar`);+ }+}++function scalarMap(value: unknown, subject: string): asserts value is Readonly<Record<string, PromptKitScalar>> {+ const record = object(value, subject);+ for (const [name, item] of Object.entries(record)) {+ if (!ID.test(name)) throw new Error(`${subject} contains invalid key ${name}`);+ scalar(item, `${subject}.${name}`);+ }+}++function stringMap(value: unknown, subject: string): asserts value is Readonly<Record<string, string>> {+ const record = object(value, subject);+ for (const [name, item] of Object.entries(record)) {+ if (!ID.test(name) || typeof item !== "string" || item.length === 0) {+ throw new Error(`${subject}.${name} must be a non-empty string`);+ }+ }+}++function choice(value: unknown, subject: string): asserts value is PromptKitChoice {+ const item = object(value, subject);+ if (!ID.test(String(item.id ?? "")) || typeof item.text !== "string" || item.text.length === 0) {+ throw new Error(`${subject} identity or text is invalid`);+ }+ const when = object(item.when, `${subject}.when`);+ scalarMap(when.parameters, `${subject}.when.parameters`);+ stringMap(when.selectors, `${subject}.when.selectors`);+}++function block(value: unknown, subject: string): asserts value is PromptKitBlockSpec {+ const item = object(value, subject);+ if (!ID.test(String(item.id ?? "")) || !Number.isSafeInteger(item.order) || Number(item.order) < 0) {+ throw new Error(`${subject} identity or order is invalid`);+ }+ if (item.kind === "fixed") {+ if (typeof item.text !== "string" || item.text.length === 0) throw new Error(`${subject}.text is empty`);+ return;+ }+ if (item.kind === "axis") {+ if (!ID.test(String(item.parameter ?? "")) || !Array.isArray(item.choices) || item.choices.length === 0) {+ throw new Error(`${subject} axis is invalid`);+ }+ item.choices.forEach((entry, index) => choice(entry, `${subject}.choices[${index}]`));+ const choices = item.choices as readonly PromptKitChoice[];+ if (choices.some((entry) => Object.keys(entry.when.parameters).length > 0 || Object.keys(entry.when.selectors).length > 0)) {+ throw new Error(`${subject} axis choices cannot carry conditions`);+ }+ return;+ }+ if (item.kind === "variant") {+ if (!Array.isArray(item.choices) || item.choices.length === 0) throw new Error(`${subject} variant has no choices`);+ item.choices.forEach((entry, index) => choice(entry, `${subject}.choices[${index}]`));+ return;+ }+ if (item.kind === "slot") {+ if (!ID.test(String(item.slot ?? "")) || typeof item.optional !== "boolean") {+ throw new Error(`${subject} slot is invalid`);+ }+ if (item.label !== undefined && (typeof item.label !== "string" || item.label.length === 0)) {+ throw new Error(`${subject}.label must be a non-empty string`);+ }+ return;+ }+ throw new Error(`${subject}.kind is invalid`);+}++function specContent(value: Omit<PromptKitSpec, "specDigest">) {+ return canonicalize(value);+}++export function sealPromptKitSpec(value: Omit<PromptKitSpec, "specDigest">): PromptKitSpec {+ const result = { ...value, specDigest: digestOf(specContent(value)) };+ verifyPromptKitSpec(result);+ return result;+}++export function verifyPromptKitSpec(value: unknown): asserts value is PromptKitSpec {+ const spec = object(value, "PromptKitSpec") as PromptKitSpec;+ if (+ spec.contract !== "svml.prompt-kit-spec@1"+ || !ID.test(spec.id)+ || spec.separator !== "\n\n"+ || !Array.isArray(spec.blocks)+ || spec.blocks.length === 0+ || !isDigest(spec.specDigest)+ ) {+ throw new Error("PromptKitSpec header is invalid");+ }+ scalarMap(spec.defaults, "PromptKitSpec.defaults");+ spec.blocks.forEach((item, index) => block(item, `PromptKitSpec.blocks[${index}]`));+ const ids = spec.blocks.map((item) => item.id);+ const orders = spec.blocks.map((item) => item.order);+ if (new Set(ids).size !== ids.length || new Set(orders).size !== orders.length) {+ throw new Error("PromptKitSpec block ids and orders must be unique");+ }+ if (spec.blocks.some((item, index) => index > 0 && item.order <= spec.blocks[index - 1]!.order)) {+ throw new Error("PromptKitSpec blocks must be ordered strictly by order");+ }+ for (const item of spec.blocks) {+ if ((item.kind === "axis" || item.kind === "variant") && new Set(item.choices.map((entry: PromptKitChoice) => entry.id)).size !== item.choices.length) {+ throw new Error(`PromptKitSpec block ${item.id} has duplicate choices`);+ }+ }+ const { specDigest: _digest, ...content } = spec;+ if (spec.specDigest !== digestOf(specContent(content))) throw new Error("PromptKitSpec digest differs from its contents");+}++function invocationContent(value: Omit<PromptKitInvocation, "invocationDigest">) {+ return canonicalize(value);+}++export function sealPromptKitInvocation(+ value: Omit<PromptKitInvocation, "invocationDigest">,+): PromptKitInvocation {+ const result = { ...value, invocationDigest: digestOf(invocationContent(value)) };+ verifyPromptKitInvocation(result);+ return result;+}++export function verifyPromptKitInvocation(value: unknown): asserts value is PromptKitInvocation {+ const invocation = object(value, "PromptKitInvocation") as PromptKitInvocation;+ if (+ invocation.contract !== "svml.prompt-kit-invocation@1"+ || !ID.test(invocation.kit)+ || !isDigest(invocation.invocationDigest)+ ) {+ throw new Error("PromptKitInvocation header is invalid");+ }+ scalarMap(invocation.parameters, "PromptKitInvocation.parameters");+ stringMap(invocation.selectors, "PromptKitInvocation.selectors");+ stringMap(invocation.slots, "PromptKitInvocation.slots");+ const { invocationDigest: _digest, ...content } = invocation;+ if (invocation.invocationDigest !== digestOf(invocationContent(content))) {+ throw new Error("PromptKitInvocation digest differs from its contents");+ }+}++function programContent(value: Omit<PromptProgram, "programDigest">) {+ return canonicalize(value);+}++export function verifyPromptProgram(value: unknown): asserts value is PromptProgram {+ const program = object(value, "PromptProgram") as PromptProgram;+ if (+ program.contract !== "svml.prompt-program@1"+ || !ID.test(program.kit)+ || !isDigest(program.specDigest)+ || !isDigest(program.invocationDigest)+ || program.separator !== "\n\n"+ || !Array.isArray(program.blocks)+ || program.blocks.length === 0+ || !isDigest(program.programDigest)+ ) {+ throw new Error("PromptProgram header is invalid");+ }+ for (const [index, item] of program.blocks.entries()) {+ if (!ID.test(item.id) || typeof item.origin !== "string" || item.origin.length === 0 || typeof item.text !== "string" || item.text.length === 0) {+ throw new Error(`PromptProgram.blocks[${index}] is invalid`);+ }+ }+ if (new Set(program.blocks.map((item) => item.id)).size !== program.blocks.length) {+ throw new Error("PromptProgram block ids must be unique");+ }+ const { programDigest: _digest, ...content } = program;+ if (program.programDigest !== digestOf(programContent(content))) {+ throw new Error("PromptProgram digest differs from its contents");+ }+}++function conditionsMatch(+ choice: PromptKitChoice,+ parameters: Readonly<Record<string, PromptKitScalar>>,+ selectors: Readonly<Record<string, string>>,+): boolean {+ return Object.entries(choice.when.parameters).every(([name, value]) => parameters[name] === value)+ && Object.entries(choice.when.selectors).every(([name, value]) => selectors[name] === value);+}++function knownInputs(spec: PromptKitSpec) {+ const parameters = new Set(Object.keys(spec.defaults));+ const selectors = new Set<string>();+ const slots = new Set<string>();+ for (const item of spec.blocks) {+ if (item.kind === "axis") parameters.add(item.parameter);+ if (item.kind === "variant") {+ for (const option of item.choices) {+ Object.keys(option.when.parameters).forEach((name) => parameters.add(name));+ Object.keys(option.when.selectors).forEach((name) => selectors.add(name));+ }+ }+ if (item.kind === "slot") slots.add(item.slot);+ }+ return { parameters, selectors, slots };+}++function axisBlock(+ item: PromptKitAxisBlock,+ parameters: Readonly<Record<string, PromptKitScalar>>,+): PromptProgramBlock {+ const value = parameters[item.parameter];+ if (value === undefined) throw new Error(`Prompt Kit parameter ${item.parameter} is required`);+ const selected = item.choices.filter((option) => option.id === String(value));+ if (selected.length !== 1) throw new Error(`Prompt Kit axis ${item.parameter} has no unique choice for ${String(value)}`);+ return { id: item.id, origin: `parameter:${item.parameter}:${String(value)}`, text: selected[0]!.text };+}++export function compilePromptKit(spec: PromptKitSpec, invocation: PromptKitInvocation): PromptProgram {+ verifyPromptKitSpec(spec);+ verifyPromptKitInvocation(invocation);+ if (invocation.kit !== spec.id) throw new Error(`Prompt Kit ${invocation.kit} does not match Spec ${spec.id}`);+ const known = knownInputs(spec);+ for (const name of Object.keys(invocation.parameters)) {+ if (!known.parameters.has(name)) throw new Error(`Prompt Kit parameter ${name} is not declared`);+ }+ for (const name of Object.keys(invocation.selectors)) {+ if (!known.selectors.has(name)) throw new Error(`Prompt Kit selector ${name} is not declared`);+ }+ for (const name of Object.keys(invocation.slots)) {+ if (!known.slots.has(name)) throw new Error(`Prompt Kit slot ${name} is not declared`);+ }+ const parameters = { ...spec.defaults, ...invocation.parameters };+ const blocks: PromptProgramBlock[] = [];+ for (const item of spec.blocks) {+ if (item.kind === "fixed") {+ blocks.push({ id: item.id, origin: `kit:${spec.id}:fixed`, text: item.text });+ continue;+ }+ if (item.kind === "axis") {+ blocks.push(axisBlock(item, parameters));+ continue;+ }+ if (item.kind === "variant") {+ const selected = item.choices.filter((option) => conditionsMatch(option, parameters, invocation.selectors));+ if (selected.length !== 1) throw new Error(`Prompt Kit variant ${item.id} matched ${selected.length} choices`);+ blocks.push({ id: item.id, origin: `variant:${item.id}:${selected[0]!.id}`, text: selected[0]!.text });+ continue;+ }+ const value = invocation.slots[item.slot]?.trim();+ if (value === undefined || value.length === 0) {+ if (!item.optional) throw new Error(`Prompt Kit slot ${item.slot} is required`);+ continue;+ }+ blocks.push({+ id: item.id,+ origin: `slot:${item.slot}`,+ text: item.label === undefined ? value : `${item.label}\n${value}`,+ });+ }+ const content: Omit<PromptProgram, "programDigest"> = {+ contract: "svml.prompt-program@1",+ kit: spec.id,+ specDigest: spec.specDigest,+ invocationDigest: invocation.invocationDigest,+ separator: spec.separator,+ blocks,+ };+ const program = { ...content, programDigest: digestOf(programContent(content)) };+ verifyPromptProgram(program);+ return program;+}diff --git a/packages/prompt-kit/src/svs.ts b/packages/prompt-kit/src/svs.tsnew file mode 100644index 00000000..032561a7--- /dev/null+++ b/packages/prompt-kit/src/svs.ts@@ -0,0 +1,129 @@+import type { SvsRecipe } from "@svml/svs";++import { sealPromptKitSpec } from "./program.js";+import type {+ PromptKitBlockSpec,+ PromptKitChoice,+ PromptKitConditions,+ PromptKitScalar,+ PromptKitSpec,+} from "./types.js";++function text(recipe: SvsRecipe, name: string, fallback?: string): string {+ const value = recipe.properties[name] ?? fallback;+ if (typeof value !== "string" || value.length === 0) {+ throw new Error(`${recipe.path}.${name} must be a non-empty string`);+ }+ return value;+}++function integer(recipe: SvsRecipe, name: string): number {+ const value = recipe.properties[name];+ if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0) {+ throw new Error(`${recipe.path}.${name} must be a non-negative integer`);+ }+ return value;+}++function boolean(recipe: SvsRecipe, name: string, fallback: boolean): boolean {+ const value = recipe.properties[name] ?? fallback;+ if (typeof value !== "boolean") throw new Error(`${recipe.path}.${name} must be boolean`);+ return value;+}++function exactProperties(recipe: SvsRecipe, allowed: ReadonlySet<string>, prefixes: readonly string[] = []): void {+ const unknown = Object.keys(recipe.properties).filter(+ (name) => !allowed.has(name) && !prefixes.some((prefix) => name.startsWith(prefix)),+ );+ if (unknown.length > 0) throw new Error(`${recipe.path} contains unknown property ${unknown[0]}`);+}++function choice(recipe: SvsRecipe, id: string): PromptKitChoice {+ exactProperties(recipe, new Set(["text"]), ["when-param-", "when-select-"]);+ const conditions: { parameters: Record<string, PromptKitScalar>; selectors: Record<string, string> } = {+ parameters: {},+ selectors: {},+ };+ for (const [name, value] of Object.entries(recipe.properties)) {+ if (name.startsWith("when-param-")) {+ conditions.parameters[name.slice("when-param-".length)] = value as PromptKitScalar;+ }+ if (name.startsWith("when-select-")) {+ if (typeof value !== "string" || value.length === 0) throw new Error(`${recipe.path}.${name} must be a string`);+ conditions.selectors[name.slice("when-select-".length)] = value;+ }+ }+ return { id, text: text(recipe, "text"), when: conditions satisfies PromptKitConditions };+}++/**+ * Decodes a bounded Prompt Kit data convention from ordinary flat SVS Recipes.+ * SVS itself remains a generic named-value language; it does not execute this specification.+ */+export function promptKitSpecFromSvsRecipes(+ recipes: readonly SvsRecipe[],+ kitId: string,+): PromptKitSpec {+ const prefix = `prompt-kit.${kitId}`;+ const meta = recipes.find((recipe) => recipe.path === prefix);+ if (meta === undefined) throw new Error(`Missing ${prefix} metadata Recipe`);+ exactProperties(meta, new Set(["separator"]), ["default-"]);+ if (text(meta, "separator", "paragraph") !== "paragraph") {+ throw new Error(`${prefix}.separator must be paragraph`);+ }+ const defaults: Record<string, PromptKitScalar> = {};+ for (const [name, value] of Object.entries(meta.properties)) {+ if (name.startsWith("default-")) defaults[name.slice("default-".length)] = value as PromptKitScalar;+ }+ const blockPrefix = `${prefix}.block.`;+ const choicePrefix = `${prefix}.choice.`;+ const blocks: PromptKitBlockSpec[] = recipes+ .filter((recipe) => recipe.path.startsWith(blockPrefix))+ .map((recipe): PromptKitBlockSpec => {+ const id = recipe.path.slice(blockPrefix.length);+ if (id.includes(".")) throw new Error(`${recipe.path} block id cannot contain '.'`);+ const kind = text(recipe, "kind");+ const order = integer(recipe, "order");+ if (kind === "fixed") {+ exactProperties(recipe, new Set(["kind", "order", "text"]));+ return { kind, id, order, text: text(recipe, "text") };+ }+ if (kind === "axis" || kind === "variant") {+ exactProperties(recipe, new Set(["kind", "order", ...(kind === "axis" ? ["parameter"] : [])]));+ const options = recipes+ .filter((item) => item.path.startsWith(`${choicePrefix}${id}.`))+ .map((item) => choice(item, item.path.slice(`${choicePrefix}${id}.`.length)));+ return kind === "axis"+ ? { kind, id, order, parameter: text(recipe, "parameter"), choices: options }+ : { kind, id, order, choices: options };+ }+ if (kind === "slot") {+ exactProperties(recipe, new Set(["kind", "order", "slot", "optional", "label"]));+ const label = recipe.properties.label;+ return {+ kind,+ id,+ order,+ slot: text(recipe, "slot"),+ optional: boolean(recipe, "optional", false),+ ...(label === undefined ? {} : { label: text(recipe, "label") }),+ };+ }+ throw new Error(`${recipe.path}.kind ${kind} is unsupported`);+ })+ .sort((left, right) => left.order - right.order);+ const consumed = new Set([+ meta.path,+ ...blocks.map((item) => `${blockPrefix}${item.id}`),+ ...recipes.filter((recipe) => recipe.path.startsWith(choicePrefix)).map((recipe) => recipe.path),+ ]);+ const stray = recipes.find((recipe) => recipe.path.startsWith(`${prefix}.`) && !consumed.has(recipe.path));+ if (stray !== undefined) throw new Error(`Unrecognized Prompt Kit Recipe ${stray.path}`);+ return sealPromptKitSpec({+ contract: "svml.prompt-kit-spec@1",+ id: kitId,+ separator: "\n\n",+ defaults,+ blocks,+ });+}diff --git a/packages/prompt-kit/src/types.ts b/packages/prompt-kit/src/types.tsnew file mode 100644index 00000000..690e10ee--- /dev/null+++ b/packages/prompt-kit/src/types.ts@@ -0,0 +1,85 @@+import type { Digest } from "@svml/protocol";++export type PromptKitScalar = string | number | boolean;++export type PromptKitConditions = {+ readonly parameters: Readonly<Record<string, PromptKitScalar>>;+ readonly selectors: Readonly<Record<string, string>>;+};++export type PromptKitChoice = {+ readonly id: string;+ readonly text: string;+ readonly when: PromptKitConditions;+};++export type PromptKitFixedBlock = {+ readonly kind: "fixed";+ readonly id: string;+ readonly order: number;+ readonly text: string;+};++export type PromptKitAxisBlock = {+ readonly kind: "axis";+ readonly id: string;+ readonly order: number;+ readonly parameter: string;+ readonly choices: readonly PromptKitChoice[];+};++export type PromptKitVariantBlock = {+ readonly kind: "variant";+ readonly id: string;+ readonly order: number;+ readonly choices: readonly PromptKitChoice[];+};++export type PromptKitSlotBlock = {+ readonly kind: "slot";+ readonly id: string;+ readonly order: number;+ readonly slot: string;+ readonly optional: boolean;+ readonly label?: string;+};++export type PromptKitBlockSpec =+ | PromptKitFixedBlock+ | PromptKitAxisBlock+ | PromptKitVariantBlock+ | PromptKitSlotBlock;++export type PromptKitSpec = {+ readonly contract: "svml.prompt-kit-spec@1";+ readonly id: string;+ readonly separator: "\n\n";+ readonly defaults: Readonly<Record<string, PromptKitScalar>>;+ readonly blocks: readonly PromptKitBlockSpec[];+ readonly specDigest: Digest;+};++export type PromptKitInvocation = {+ readonly contract: "svml.prompt-kit-invocation@1";+ readonly kit: string;+ readonly parameters: Readonly<Record<string, PromptKitScalar>>;+ readonly selectors: Readonly<Record<string, string>>;+ readonly slots: Readonly<Record<string, string>>;+ readonly invocationDigest: Digest;+};++export type PromptProgramBlock = {+ readonly id: string;+ readonly origin: string;+ readonly text: string;+};++export type PromptProgram = {+ readonly contract: "svml.prompt-program@1";+ readonly kit: string;+ readonly specDigest: Digest;+ readonly invocationDigest: Digest;+ readonly separator: "\n\n";+ readonly blocks: readonly PromptProgramBlock[];+ readonly programDigest: Digest;+};diff --git a/packages/prompt-kit/test/program.test.ts b/packages/prompt-kit/test/program.test.tsnew file mode 100644index 00000000..7483e943--- /dev/null+++ b/packages/prompt-kit/test/program.test.ts@@ -0,0 +1,93 @@+import assert from "node:assert/strict";+import test from "node:test";++import {+ compilePromptKit,+ sealPromptKitInvocation,+ sealPromptKitSpec,+ verifyPromptProgram,+} from "@svml/prompt-kit";++const emptyWhen = { parameters: {}, selectors: {} } as const;++const spec = sealPromptKitSpec({+ contract: "svml.prompt-kit-spec@1",+ id: "demo-v1",+ separator: "\n\n",+ defaults: { tone: "calm" },+ blocks: [+ { kind: "fixed", id: "base", order: 10, text: "BASE" },+ {+ kind: "axis", id: "tone", order: 20, parameter: "tone",+ choices: [+ { id: "calm", text: "CALM", when: emptyWhen },+ { id: "loud", text: "LOUD", when: emptyWhen },+ ],+ },+ {+ kind: "variant", id: "evidence", order: 30,+ choices: [+ { id: "none", text: "NO EVIDENCE", when: { parameters: {}, selectors: { evidence: "none" } } },+ { id: "present", text: "USE EVIDENCE", when: { parameters: {}, selectors: { evidence: "present" } } },+ ],+ },+ { kind: "slot", id: "subject", order: 40, slot: "subject", optional: false, label: "SUBJECT:" },+ { kind: "slot", id: "extra", order: 50, slot: "extra", optional: true },+ ],+});++function invocation(parameters: Record<string, string> = {}) {+ return sealPromptKitInvocation({+ contract: "svml.prompt-kit-invocation@1",+ kit: "demo-v1",+ parameters,+ selectors: { evidence: "present" },+ slots: { subject: "a toothbrush" },+ });+}++test("generic Prompt Kit resolves defaults, finite variants and required slots", () => {+ const program = compilePromptKit(spec, invocation());+ verifyPromptProgram(program);+ assert.deepEqual(program.blocks.map((block) => block.text), [+ "BASE", "CALM", "USE EVIDENCE", "SUBJECT:\na toothbrush",+ ]);+ assert.deepEqual(program.blocks.map((block) => block.origin), [+ "kit:demo-v1:fixed",+ "parameter:tone:calm",+ "variant:evidence:present",+ "slot:subject",+ ]);+});++test("Invocation parameters override Spec defaults without changing the Spec", () => {+ const program = compilePromptKit(spec, invocation({ tone: "loud" }));+ assert.equal(program.blocks[1]?.text, "LOUD");+ assert.equal(spec.defaults.tone, "calm");+});++test("unknown inputs and non-unique finite branches fail closed", () => {+ assert.throws(+ () => compilePromptKit(spec, invocation({ typo: "loud" })),+ /parameter typo is not declared/u,+ );+ const ambiguous = sealPromptKitSpec({+ contract: "svml.prompt-kit-spec@1",+ id: "ambiguous-v1",+ separator: "\n\n",+ defaults: {},+ blocks: [{+ kind: "variant", id: "branch", order: 10,+ choices: [+ { id: "first", text: "FIRST", when: emptyWhen },+ { id: "second", text: "SECOND", when: emptyWhen },+ ],+ }],+ });+ const call = sealPromptKitInvocation({+ contract: "svml.prompt-kit-invocation@1",+ kit: "ambiguous-v1",+ parameters: {}, selectors: {}, slots: {},+ });+ assert.throws(() => compilePromptKit(ambiguous, call), /matched 2 choices/u);+});diff --git a/packages/run-text/README.md b/packages/run-text/README.mdindex ee739f95..3561c294 100644--- a/packages/run-text/README.md+++ b/packages/run-text/README.md@@ -25,6 +25,11 @@ Build Record as a zero-input Candidate. `<fragment>` instantiates a trusted packexport several Candidates backed by shared Operations. Two declarations are two instances; onedeclaration with several exports is one instance.+The `output` on `<build-record>` may be the prior source's public output alias. The Host resolves it+through its Build Catalog to the verified logical Record before Run compilation. Core never sees or+trusts the presentation alias, and the historical value receives no automatic semantic-affinity+claim against the output it is selected to satisfy.+Imports form the opening prologue. They name Fragment libraries already admitted by the Host; theydo not install packages. Provider credentials, queues, Stores, Endpoint bindings and inlinecallbacks are not Run language elements.diff --git a/packages/run-text/package.json b/packages/run-text/package.jsonindex 0f8f7d94..10ddba6c 100644--- a/packages/run-text/package.json+++ b/packages/run-text/package.json@@ -6,6 +6,9 @@"exports": {".": "./src/index.ts"},+ "svml": {+ "activation": "./src/activation.ts"+ },"dependencies": {"@svml/protocol": "workspace:*","@svml/run": "workspace:*",diff --git a/packages/run-text/src/activation.ts b/packages/run-text/src/activation.tsnew file mode 100644index 00000000..959e1761--- /dev/null+++ b/packages/run-text/src/activation.ts@@ -0,0 +1,9 @@+import { runTextFrontend } from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/run-text",+ runFrontends: [runTextFrontend],+};++export default svmlPackage;diff --git a/packages/run/src/resolve.ts b/packages/run/src/resolve.tsindex 7f489520..8747d7b2 100644--- a/packages/run/src/resolve.ts+++ b/packages/run/src/resolve.ts@@ -119,9 +119,11 @@ export async function resolveRunDocument(if (declaration.kind === "build-record") {const build = await context.readBuild(declaration.build);if (build === undefined) throw new Error(`Build ${declaration.build} does not exist`);+ const sourceOutput = await context.resolveBuildOutput?.(declaration.build, declaration.output)+ ?? declaration.output;const candidate = createBuildRecordCandidate({build,- sourceOutput: declaration.output,+ sourceOutput,});addCandidate(candidate);bindCandidateName(declaration.id, candidate.id);diff --git a/packages/run/src/types.ts b/packages/run/src/types.tsindex a5429f99..f6d4428b 100644--- a/packages/run/src/types.ts+++ b/packages/run/src/types.ts@@ -175,6 +175,11 @@ export type ResolveRunDocumentContext = {readonly fragments: RunFragmentRegistryLike;readonly readStoredValue: (from: string) => Promise<StoredValue> | StoredValue;readonly readBuild: (id: string) => Promise<BuildState | undefined> | BuildState | undefined;+ /** Host presentation lookup: resolve a prior Build's public output alias to its Logical Output id. */+ readonly resolveBuildOutput?: (+ build: string,+ output: string,+ ) => Promise<string | undefined> | string | undefined;};export type RunCompilation = {diff --git a/packages/run/test/run.test.ts b/packages/run/test/run.test.tsindex 66199550..9dcefd7a 100644--- a/packages/run/test/run.test.ts+++ b/packages/run/test/run.test.ts@@ -5,6 +5,7 @@ import {createResolvedClosure,digestOf,link,+ reduce,sealBuildRequest,sealCompiledGraph,sealRecord,@@ -258,6 +259,60 @@ test("a Provided Value is an ordinary zero-input Candidate selected by Satisfactassert.equal(state.records.find((item) => item.id === state.plan.goals[0]!.record)?.value.kind, "inline");});+test("a Build Record uses the Host Catalog alias without putting presentation names in Core", async () => {+ const compilation = fixture();+ let historical = start(compilation.program, compilation.elaboration.graph, sealBuildRequest({+ graph: compilation.elaboration.graph.id,+ targets: [{ output: "left", accepts: "exact" }],+ satisfactions: [],+ }));+ historical = reduce(historical).state;+ const command = historical.outstanding.find((item) => item.kind === "invoke-producer");+ assert.ok(command);+ const content = {+ kind: "producer-completed" as const,+ command: command.id,+ outputs: { media: { kind: "inline" as const, value: "archived media" } },+ needs: {},+ validations: {},+ };+ historical = reduce(historical, { ...content, id: `event:${digestOf(content)}` }).state;+ assert.equal(historical.status, "complete");++ const compiledRunSource = await compileDocument(`<svrun version="1" targets="delivery">+ <author source="./main.svml"/>+ <target-set id="delivery"><target output="right" accepts="substitute"/></target-set>+ <build-record id="prior" build="prior-build" output="friendly-shot"/>+ <satisfy output="right" candidate="prior" fidelity="substitute"/>+ </svrun>`);+ let resolvedAlias = false;+ const run = await resolveRunDocument(compiledRunSource.document, {+ compilation,+ sourceClosure: compiledRunSource.closure,+ fragments: new RunFragmentRegistry(),+ readStoredValue() { throw new Error("not used"); },+ readBuild(id) {+ assert.equal(id, "prior-build");+ return historical;+ },+ resolveBuildOutput(id, output) {+ assert.equal(id, "prior-build");+ assert.equal(output, "friendly-shot");+ resolvedAlias = true;+ return "left";+ },+ });+ assert.equal(resolvedAlias, true);+ const realized = resolveRealization(compilation.program, compilation.elaboration.graph, [run.overlay!]);+ const state = start(compilation.program, realized.graph, sealBuildRequest({+ graph: realized.graph.id,+ targets: run.graph.targetSets[0]!.targets,+ satisfactions: run.graph.satisfactions,+ }));+ assert.equal(state.plan.steps.length, 0);+ assert.equal(state.plan.initialValues[0]?.conformance, "substitute");+});+test("Run imports are a prologue and Runtime settings are not language elements", () => {assert.throws(() => parseRunDocument("bad.svrun", `<svrun version="1" targets="x">diff --git a/packages/runtime/src/scheduler.ts b/packages/runtime/src/scheduler.tsindex 177a82e6..be2cf2a9 100644--- a/packages/runtime/src/scheduler.ts+++ b/packages/runtime/src/scheduler.ts@@ -139,7 +139,12 @@ export class LocalBuildScheduler implements BuildScheduler {build.revision = written.current.revision;throw new Error(`Build ${build.id} lost its authoritative Store revision`);}- build.state = written.snapshot.state;+ // Stores deliberately remove derived outstanding Commands from their durable snapshot.+ // The state supplied here has already passed Core verification and remains the authority+ // for this live scheduling turn; replacing it with the durable projection would forget+ // sibling Commands which are still executing. A restarted Scheduler will regenerate those+ // Commands from the stored facts instead.+ build.state = state;build.revision = written.snapshot.revision;};diff --git a/packages/script/package.json b/packages/script/package.jsonindex 05d4ea7c..5470aa2f 100644--- a/packages/script/package.json+++ b/packages/script/package.json@@ -6,9 +6,13 @@"exports": {".": "./src/index.ts"},+ "svml": {+ "activation": "./src/activation.ts"+ },"dependencies": {"@svml/contracts": "workspace:*","@svml/core": "workspace:*",- "@svml/protocol": "workspace:*"+ "@svml/protocol": "workspace:*",+ "@svml/text": "workspace:*"}}diff --git a/packages/script/src/activation.ts b/packages/script/src/activation.tsnew file mode 100644index 00000000..e9e7e9eb--- /dev/null+++ b/packages/script/src/activation.ts@@ -0,0 +1,23 @@+import { createTextSurfaceHostFacet } from "@svml/text";++import {+ decodeScriptSurface,+ scriptManifest,+ scriptModuleRef,+ scriptSurfaceImplementationDigest,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/script",+ modules: [{ manifest: scriptManifest, specifiers: ["@svml/script", "@svml/script@1"] }],+ hostFacets: [createTextSurfaceHostFacet({+ module: scriptModuleRef,+ surface: "script",+ mode: "raw",+ implementationDigest: scriptSurfaceImplementationDigest,+ handler: decodeScriptSurface,+ })],+};++export default svmlPackage;diff --git a/packages/seedance-speaker/README.md b/packages/seedance-speaker/README.mdnew file mode 100644index 00000000..cad6bcdf--- /dev/null+++ b/packages/seedance-speaker/README.md@@ -0,0 +1,67 @@+# `@svml/seedance-speaker`++Official deterministic UGC talking-head author module for Seedance. It is currently an internal+private workspace unit, not a commitment to publish one npm package per Seedance author module.++The package consumes an inert project SVS Recipe, one explicitly imported PromptKitSpec, one Script+dialogue excerpt and explicit image/audio references. Its Surface binds them into a generic Prompt+Kit Invocation and compiles an inspectable ordered `PromptProgram` during author compilation. The+same Surface renders the low-level `@svml/seedance` `SpeechProgram`; the Run Graph then reuses the+exact Seedance request and generation contracts. The official Kit source is+[`official-ugc-v1.svs`](./kits/official-ugc-v1.svs).++It owns no Provider, credentials, queue or HTTP behavior. KIE, Volcengine or another explicitly+bound Endpoint only receives the already compiled exact Seedance request.++The official `official-ugc-v1` Kit contains a fixed base, reference contract, script contract,+texture and visible-text exclusion plus six configurable axes: composition stability, camera+motion, edit rhythm, performance, gesture and voice mapping. Project SVS selects values. The+official Kit SVS declares defaults, block order, value-to-Prompt choices and finite conditions. SVS+itself executes neither conditions nor concatenation; the generic Prompt Kit compiler does that.++## Compilation boundary++```text+Script dialogue + authored Blob references + SVS Recipe + PromptKitSpec+ │+ │ Speaker Surface: pure author-time lowering+ ▼+ ordered PromptProgram + Seedance SpeechProgram+ │ existing Runtime-graph model compiler+ ▼+ exact Seedance generation Need+```++`take.prompt` and `take.program` are authored compile artifacts; `take.video` is the ordinary+Logical Output. The Prompt Program retains every ordered block and its origin; flattening is exactly+`blocks.map(block => block.text).join("\n\n")`. No Prompt assembly Operation appears in a BuildPlan.++The author imports this logical module and imports the selected Kit as an ordinary Source Module.+The Host package lock activates `@svml/prompt-kit` and low-level `@svml/seedance` independently. A+future public distribution may offer an optional install bundle, but the current repository keeps+their activations separate.++## `official-ugc-v1`++Defaults:++| Setting | Default | Choices |+|---|---|---|+| model | `seedance-2-mini` | `mini`, `fast`, `standard` |+| resolution | `720p` | `480p`, `720p`; `1080p` only for standard |+| aspect ratio | `9:16` | Seedance-supported aspect ratios |+| web search | `false` | `true`, `false` |+| composition stability | `soft-locked` | `flexible-ugc`, `soft-locked`, `strict-locked` |+| camera motion | `none` | `none`, `subtle-punch-in-return` |+| edit rhythm | `continuous-take` | `continuous-take`, `pause-trim-jump-cuts` |+| performance | `natural-explainer` | `natural-explainer`, `high-energy-ugc`, `calm-authority`, `reactive-playful` |+| gesture | `natural` | `restrained`, `compact`, `natural`, `expressive` |+| voice mode | `single-speaker` | `single-speaker`, `role-tagged-lines` |++The fixed base requests realistic phone-shot UGC, exact ordered dialogue and visible-speaker+lip-sync, coherent reference identity, photoreal texture and no generated readable text. It always+requests generated audio. One to nine image references are required; zero to three audio references+are allowed. With an audio reference, `@audio1` supplies the visible speaker's voice timbre.++`action` and `extra` are optional escape hatches appended as separate attributable blocks. They do+not alter Kit control flow.diff --git a/packages/seedance-speaker/kits/official-ugc-v1.svs b/packages/seedance-speaker/kits/official-ugc-v1.svsnew file mode 100644index 00000000..bb9d3f61--- /dev/null+++ b/packages/seedance-speaker/kits/official-ugc-v1.svs@@ -0,0 +1,205 @@+<?svml using="@svml/prompt-kit/svs@1"?>++<sheet version="1" id="official-ugc-v1">+ prompt-kit.official-ugc-v1 {+ separator: paragraph;+ default-composition-stability: soft-locked;+ default-camera-motion: none;+ default-edit-rhythm: continuous-take;+ default-performance: natural-explainer;+ default-gesture: natural;+ default-voice-mode: single-speaker;+ }++ prompt-kit.official-ugc-v1.block.base {+ kind: fixed;+ order: 10;+ text: "Create a realistic vertical iPhone UGC talking-head video using @image1 as the character-and-scene reference.";+ }++ prompt-kit.official-ugc-v1.block.reference-contract {+ kind: variant;+ order: 20;+ }++ prompt-kit.official-ugc-v1.choice.reference-contract.one {+ when-select-image-count: one;+ text: "REFERENCE CONTRACT: preserve @image1's visible person, face identity, outfit, room, lighting, lens feel, and broad camera style.";+ }++ prompt-kit.official-ugc-v1.choice.reference-contract.many {+ when-select-image-count: many;+ text: "REFERENCE CONTRACT: use @image1 as the primary character-and-scene reference. Use @image2 and later image references only as supplementary identity, wardrobe, product, or environment evidence; preserve one coherent person and scene.";+ }++ prompt-kit.official-ugc-v1.block.script-contract {+ kind: fixed;+ order: 30;+ text: "SCRIPT: deliver the scripted lines exactly in order, with clear lip-sync for the visible speaker's spoken lines.";+ }++ prompt-kit.official-ugc-v1.block.voice-map {+ kind: variant;+ order: 40;+ }++ prompt-kit.official-ugc-v1.choice.voice-map.single-without-audio {+ when-param-voice-mode: single-speaker;+ when-select-audio-count: zero;+ text: "VOICE MAP: the visible person in @image1 delivers the full script on camera with a natural voice matching the character.";+ }++ prompt-kit.official-ugc-v1.choice.voice-map.single-with-audio {+ when-param-voice-mode: single-speaker;+ when-select-audio-count: one;+ text: "VOICE MAP: the visible person in @image1 delivers the full script on camera. @audio1 is the voice-timbre reference for the visible speaker.";+ }++ prompt-kit.official-ugc-v1.choice.voice-map.single-with-many-audios {+ when-param-voice-mode: single-speaker;+ when-select-audio-count: many;+ text: "VOICE MAP: the visible person in @image1 delivers the full script on camera. @audio1 is the voice-timbre reference for the visible speaker. Additional audio references provide supplementary voice evidence only.";+ }++ prompt-kit.official-ugc-v1.choice.voice-map.roles-without-audio {+ when-param-voice-mode: role-tagged-lines;+ when-select-audio-count: zero;+ text: "VOICE MAP: the script uses role labels such as HOST: and NARRATOR:. The visible person in @image1 delivers the first speaking role on camera; lines assigned to the second role play as an off-camera narrator voice while the visible speaker stays present and reacts naturally.";+ }++ prompt-kit.official-ugc-v1.choice.voice-map.roles-with-one-audio {+ when-param-voice-mode: role-tagged-lines;+ when-select-audio-count: one;+ text: "VOICE MAP: the script uses role labels such as HOST: and NARRATOR:. The visible person in @image1 delivers the first speaking role on camera; lines assigned to the second role play as an off-camera narrator voice while the visible speaker stays present and reacts naturally. @audio1 is the visible speaker's voice-timbre reference.";+ }++ prompt-kit.official-ugc-v1.choice.voice-map.roles-with-many-audios {+ when-param-voice-mode: role-tagged-lines;+ when-select-audio-count: many;+ text: "VOICE MAP: the script uses role labels such as HOST: and NARRATOR:. The visible person in @image1 delivers the first speaking role on camera; lines assigned to the second role play as an off-camera narrator voice while the visible speaker stays present and reacts naturally. @audio1 is the visible speaker's voice-timbre reference. @audio2 is the narrator voice-timbre reference.";+ }++ prompt-kit.official-ugc-v1.block.composition-stability {+ kind: axis;+ order: 50;+ parameter: composition-stability;+ }++ prompt-kit.official-ugc-v1.choice.composition-stability.flexible-ugc {+ text: "COMPOSITION STABILITY: preserve @image1's visible person and overall reference setup while allowing normal short-form UGC framing variation for a lively creator video.";+ }++ prompt-kit.official-ugc-v1.choice.composition-stability.soft-locked {+ text: "COMPOSITION STABILITY: keep the speaker in the same general region and maintain the reference composition, allowing natural posture changes and only tiny crop or scale breathing.";+ }++ prompt-kit.official-ugc-v1.choice.composition-stability.strict-locked {+ text: "COMPOSITION STABILITY: treat @image1 as a locked spatial stage. Preserve the same subject placement, perspective, left-right orientation, background relationship, and framing envelope so persistent overlays stay spatially meaningful.";+ }++ prompt-kit.official-ugc-v1.block.camera-motion {+ kind: axis;+ order: 60;+ parameter: camera-motion;+ }++ prompt-kit.official-ugc-v1.choice.camera-motion.none {+ text: "CAMERA MOTION: hold the framing steady in a fixed shot, keeping the selected composition envelope stable from start to finish.";+ }++ prompt-kit.official-ugc-v1.choice.camera-motion.subtle-punch-in-return {+ text: "CAMERA MOTION: use one subtle push-in on the most important phrase along the same optical axis, then return smoothly to the original framing while preserving the same subject placement and background relationship.";+ }++ prompt-kit.official-ugc-v1.block.edit-rhythm {+ kind: axis;+ order: 70;+ parameter: edit-rhythm;+ }++ prompt-kit.official-ugc-v1.choice.edit-rhythm.continuous-take {+ text: "EDIT RHYTHM: make the clip feel like a continuous creator explanation, with natural breath timing and polished short-form pacing.";+ }++ prompt-kit.official-ugc-v1.choice.edit-rhythm.pause-trim-jump-cuts {+ text: "EDIT RHYTHM: use pause-trim jump cuts. The final clip feels tightly edited because silent gaps between spoken phrases have been removed; framing stays locked, with only tiny temporal jumps in expression, mouth position, gaze, hands, and posture at phrase boundaries.";+ }++ prompt-kit.official-ugc-v1.block.performance {+ kind: axis;+ order: 80;+ parameter: performance;+ }++ prompt-kit.official-ugc-v1.choice.performance.natural-explainer {+ text: "PERFORMANCE: natural explainer energy. The speaker uses clear eye focus, expressive eyebrows, small nods, and a friendly teaching rhythm that matches each idea.";+ }++ prompt-kit.official-ugc-v1.choice.performance.high-energy-ugc {+ text: "PERFORMANCE: high-energy short-form UGC delivery. The speaker feels magnetic, quick, vivid, and excited, with expressive face changes on key words.";+ }++ prompt-kit.official-ugc-v1.choice.performance.calm-authority {+ text: "PERFORMANCE: calm authority. The speaker is composed, confident, precise, and trustworthy, with deliberate emphasis.";+ }++ prompt-kit.official-ugc-v1.choice.performance.reactive-playful {+ text: "PERFORMANCE: reactive and playful. The speaker responds visibly to the idea with amused looks, quick smiles, skeptical eyebrows, and lively conversational timing.";+ }++ prompt-kit.official-ugc-v1.block.gesture {+ kind: axis;+ order: 90;+ parameter: gesture;+ }++ prompt-kit.official-ugc-v1.choice.gesture.restrained {+ text: "GESTURE: restrained body language. Let face, eye focus, and voice carry most of the meaning, with small posture shifts and very light hand beats.";+ }++ prompt-kit.official-ugc-v1.choice.gesture.compact {+ text: "GESTURE: compact explanatory gestures. Keep hand movement close to the torso and inside the frame, using small semantic beats that support the words without competing with persistent overlays.";+ }++ prompt-kit.official-ugc-v1.choice.gesture.natural {+ text: "GESTURE: natural creator gestures. Use open palms, small pointing beats, nods, and posture shifts where the script naturally calls for them.";+ }++ prompt-kit.official-ugc-v1.choice.gesture.expressive {+ text: "GESTURE: expressive embodied delivery. Use richer hand, shoulder, and posture changes that clearly visualize the idea while staying coherent with the spoken line.";+ }++ prompt-kit.official-ugc-v1.block.texture {+ kind: fixed;+ order: 100;+ text: "TEXTURE: crisp real-shot phone footage with stable face, hands, skin texture, lighting, and photoreal motion.";+ }++ prompt-kit.official-ugc-v1.block.visible-text {+ kind: fixed;+ order: 110;+ text: "No subtitles, captions, labels, logos, UI text, floating words, or any readable on-screen text inside the generated video.";+ }++ prompt-kit.official-ugc-v1.block.dialogue {+ kind: slot;+ order: 120;+ slot: dialogue;+ optional: false;+ label: "SCRIPT TO DELIVER:";+ }++ prompt-kit.official-ugc-v1.block.action {+ kind: slot;+ order: 130;+ slot: action;+ optional: true;+ }++ prompt-kit.official-ugc-v1.block.extra {+ kind: slot;+ order: 140;+ slot: extra;+ optional: true;+ }+</sheet>diff --git a/packages/seedance-speaker/package.json b/packages/seedance-speaker/package.jsonnew file mode 100644index 00000000..d88239bc--- /dev/null+++ b/packages/seedance-speaker/package.json@@ -0,0 +1,24 @@+{+ "name": "@svml/seedance-speaker",+ "version": "0.0.0-dev",+ "private": true,+ "type": "module",+ "exports": {+ ".": "./src/index.ts"+ },+ "svml": {+ "activation": "./src/activation.ts"+ },+ "dependencies": {+ "@svml/artifact": "workspace:*",+ "@svml/contracts": "workspace:*",+ "@svml/elaborator": "workspace:*",+ "@svml/generation": "workspace:*",+ "@svml/model-kit": "workspace:*",+ "@svml/prompt-kit": "workspace:*",+ "@svml/protocol": "workspace:*",+ "@svml/seedance": "workspace:*",+ "@svml/svs": "workspace:*",+ "@svml/text": "workspace:*"+ }+}diff --git a/packages/seedance-speaker/src/activation.ts b/packages/seedance-speaker/src/activation.tsnew file mode 100644index 00000000..025143bc--- /dev/null+++ b/packages/seedance-speaker/src/activation.ts@@ -0,0 +1,26 @@+import { createTextSurfaceHostFacet } from "@svml/text";++import {+ decodeSeedanceSpeakerTakeSurface,+ seedanceSpeakerImplementationDigests,+ seedanceSpeakerManifest,+ seedanceSpeakerModuleRef,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/seedance-speaker",+ modules: [{+ manifest: seedanceSpeakerManifest,+ specifiers: ["@svml/seedance-speaker", "@svml/seedance-speaker@1"],+ }],+ hostFacets: [createTextSurfaceHostFacet({+ module: seedanceSpeakerModuleRef,+ surface: "take",+ mode: "structured",+ implementationDigest: seedanceSpeakerImplementationDigests.takeSurface,+ handler: decodeSeedanceSpeakerTakeSurface,+ })],+};++export default svmlPackage;diff --git a/packages/seedance-speaker/src/fragment.ts b/packages/seedance-speaker/src/fragment.tsnew file mode 100644index 00000000..5d82d945--- /dev/null+++ b/packages/seedance-speaker/src/fragment.ts@@ -0,0 +1,57 @@+import { artifactTypes } from "@svml/artifact";+import { contractTypes } from "@svml/contracts";+import { sealGraphFragment } from "@svml/elaborator";+import { generationProducers } from "@svml/generation";+import type { ExactModelEndpoint } from "@svml/model-kit";+import type { ProducerRef } from "@svml/protocol";+import { seedanceTypes } from "@svml/seedance";++const input = (name: string) => ({ kind: "fragment-input" as const, name });+const operation = (id: string) => ({ kind: "fragment-operation" as const, operation: id });++export function createSeedanceSpeakerTakeFragment(+ endpoint: ExactModelEndpoint,+ compileRequestProducer: ProducerRef,+) {+ return sealGraphFragment({+ name: `@svml/seedance-speaker/${endpoint.key}-take@1`,+ inputs: [+ { name: "program", type: seedanceTypes.speechProgram },+ { name: "duration", type: contractTypes.speechDuration },+ ],+ operations: [+ {+ id: "compile-request",+ producer: compileRequestProducer,+ inputs: { program: input("program"), duration: input("duration") },+ result: { kind: "output", name: "request" },+ },+ {+ id: "generate",+ producer: endpoint.producer,+ inputs: { request: operation("compile-request") },+ result: { kind: "need", name: "generation", accepts: "exact" },+ },+ {+ id: "select-primary-video",+ producer: generationProducers.primaryVideo,+ inputs: { set: operation("generate") },+ result: { kind: "output", name: "video" },+ },+ ],+ exports: [+ {+ name: "video",+ type: artifactTypes.blob,+ root: operation("select-primary-video"),+ semanticInputs: ["program", "duration"],+ affinity: [{+ resultPointer: "/digest",+ source: operation("generate"),+ sourcePointer: "/videos/0/digest",+ }],+ fidelity: "exact",+ },+ ],+ });+}diff --git a/packages/seedance-speaker/src/index.ts b/packages/seedance-speaker/src/index.tsnew file mode 100644index 00000000..7e38725f--- /dev/null+++ b/packages/seedance-speaker/src/index.ts@@ -0,0 +1,16 @@+export { createSeedanceSpeakerTakeFragment } from "./fragment.js";+export {+ bindSpeakerPromptKit,+ renderSpeakerSpeechProgram,+ sealSpeakerTakeIntent,+ speakerMethodDefaults,+ verifySpeakerTakeIntent,+} from "./kit.js";+export {+ seedanceSpeakerImplementationDigests,+ seedanceSpeakerManifest,+ seedanceSpeakerManifestDigest,+ seedanceSpeakerModuleRef,+} from "./manifest.js";+export { decodeSeedanceSpeakerTakeSurface } from "./surface.js";+export type * from "./types.js";diff --git a/packages/seedance-speaker/src/kit.ts b/packages/seedance-speaker/src/kit.tsnew file mode 100644index 00000000..68e8fad5--- /dev/null+++ b/packages/seedance-speaker/src/kit.ts@@ -0,0 +1,155 @@+import { assertGenerationBlobRef } from "@svml/generation";+import {+ sealPromptKitInvocation,+ verifyPromptKitInvocation,+ verifyPromptProgram,+} from "@svml/prompt-kit";+import type { PromptKitInvocation, PromptKitScalar, PromptProgram } from "@svml/prompt-kit";+import { canonicalize, digestOf, isDigest } from "@svml/protocol";+import {+ sealSeedanceSpeechProgram,+ seedanceModels,+} from "@svml/seedance";+import type { SeedanceSpeechProgram } from "@svml/seedance";++import type { SpeakerTakeIntent } from "./types.js";++export const speakerMethodDefaults = {+ model: "seedance-2-mini",+ resolution: "720p",+ aspectRatio: "9:16",+ webSearch: false,+} as const;++function intentContent(value: Omit<SpeakerTakeIntent, "intentDigest">) {+ return canonicalize(value);+}++export function sealSpeakerTakeIntent(+ value: Omit<SpeakerTakeIntent, "intentDigest">,+): SpeakerTakeIntent {+ const intent = { ...value, intentDigest: digestOf(intentContent(value)) };+ verifySpeakerTakeIntent(intent);+ return intent;+}++export function verifySpeakerTakeIntent(value: unknown): asserts value is SpeakerTakeIntent {+ if (value === null || typeof value !== "object" || Array.isArray(value)) {+ throw new Error("Speaker TakeIntent must be an object");+ }+ const intent = value as SpeakerTakeIntent;+ if (+ intent.contract !== "svml.seedance-speaker-take-intent@1"+ || !/^[a-z][a-z0-9-]{0,95}$/u.test(intent.kit)+ || !seedanceModels.includes(intent.model)+ || !["480p", "720p", "1080p"].includes(intent.resolution)+ || !["1:1", "4:3", "3:4", "16:9", "9:16", "21:9", "adaptive"].includes(intent.aspectRatio)+ || typeof intent.webSearch !== "boolean"+ ) {+ throw new Error("Speaker TakeIntent method settings are invalid");+ }+ if (intent.resolution === "1080p" && intent.model !== "seedance-2") {+ throw new Error("Seedance Mini and Fast Speaker Kits support at most 720p");+ }+ if (+ typeof intent.recipe?.path !== "string"+ || intent.recipe.path.length === 0+ || !isDigest(intent.recipe.recordDigest)+ || intent.promptParameters === null+ || typeof intent.promptParameters !== "object"+ || Array.isArray(intent.promptParameters)+ || typeof intent.segment?.id !== "string"+ || intent.segment.id.length === 0+ || !Number.isSafeInteger(intent.segment.tokenStart)+ || !Number.isSafeInteger(intent.segment.tokenEndExclusive)+ || intent.segment.tokenEndExclusive <= intent.segment.tokenStart+ || !isDigest(intent.segment.dialogueExcerptDigest)+ || typeof intent.segment.dialogue !== "string"+ || intent.segment.dialogue.trim().length === 0+ ) {+ throw new Error("Speaker TakeIntent identity, parameters or dialogue is invalid");+ }+ for (const [name, item] of Object.entries(intent.promptParameters)) {+ if (!/^[a-z][a-z0-9-]{0,95}$/u.test(name)) throw new Error(`Speaker prompt parameter ${name} is invalid`);+ if (typeof item !== "string" && typeof item !== "boolean" && !(typeof item === "number" && Number.isFinite(item))) {+ throw new Error(`Speaker prompt parameter ${name} must be a finite scalar`);+ }+ }+ const images = intent.references.filter((item) => item.kind === "image");+ const audios = intent.references.filter((item) => item.kind === "audio");+ if (images.length < 1 || images.length > 9 || audios.length > 3) {+ throw new Error("Speaker requires 1-9 image references and at most 3 audio references");+ }+ for (const item of intent.references) {+ if ((item.kind !== "image" && item.kind !== "audio") || typeof item.role !== "string" || item.role.length === 0) {+ throw new Error("Speaker reference is invalid");+ }+ assertGenerationBlobRef(item.artifact, `${item.kind}/` as "image/" | "audio/");+ }+ if (!isDigest(intent.intentDigest)) throw new Error("Speaker TakeIntent digest is invalid");+ const { intentDigest: _digest, ...content } = intent;+ if (intent.intentDigest !== digestOf(intentContent(content))) {+ throw new Error("Speaker TakeIntent digest differs from its contents");+ }+}++function audioCount(intent: SpeakerTakeIntent): "zero" | "one" | "many" {+ const count = intent.references.filter((item) => item.kind === "audio").length;+ return count === 0 ? "zero" : count === 1 ? "one" : "many";+}++export function bindSpeakerPromptKit(intent: SpeakerTakeIntent): PromptKitInvocation {+ verifySpeakerTakeIntent(intent);+ const parameters: Record<string, PromptKitScalar> = {};+ for (const [name, value] of Object.entries(intent.promptParameters)) {+ parameters[name] = value as PromptKitScalar;+ }+ const invocation = sealPromptKitInvocation({+ contract: "svml.prompt-kit-invocation@1",+ kit: intent.kit,+ parameters,+ selectors: {+ "image-count": intent.references.filter((item) => item.kind === "image").length === 1 ? "one" : "many",+ "audio-count": audioCount(intent),+ },+ slots: {+ dialogue: intent.segment.dialogue,+ ...(intent.actionPrompt === undefined ? {} : { action: intent.actionPrompt }),+ ...(intent.extraPrompt === undefined ? {} : { extra: intent.extraPrompt }),+ },+ });+ verifyPromptKitInvocation(invocation);+ return invocation;+}++export function renderSpeakerSpeechProgram(+ program: PromptProgram,+ intent: SpeakerTakeIntent,+): SeedanceSpeechProgram {+ verifyPromptProgram(program);+ verifySpeakerTakeIntent(intent);+ if (program.kit !== intent.kit) throw new Error("Speaker PromptProgram uses another Kit");+ const invocation = bindSpeakerPromptKit(intent);+ if (program.invocationDigest !== invocation.invocationDigest) {+ throw new Error("Speaker PromptProgram does not bind this TakeIntent");+ }+ return sealSeedanceSpeechProgram({+ contract: "svml.seedance-speech-program@1",+ model: intent.model,+ prompt: program.blocks.map((item) => item.text).join(program.separator),+ mode: {+ kind: "reference",+ items: intent.references.map((item) => ({ kind: item.kind, artifact: item.artifact })),+ },+ resolution: intent.resolution,+ aspectRatio: intent.aspectRatio,+ generateAudio: true,+ webSearch: intent.webSearch,+ segment: {+ id: intent.segment.id,+ tokenStart: intent.segment.tokenStart,+ tokenEndExclusive: intent.segment.tokenEndExclusive,+ dialogueExcerptDigest: intent.segment.dialogueExcerptDigest,+ },+ });+}diff --git a/packages/seedance-speaker/src/manifest.ts b/packages/seedance-speaker/src/manifest.tsnew file mode 100644index 00000000..71b2ae79--- /dev/null+++ b/packages/seedance-speaker/src/manifest.ts@@ -0,0 +1,53 @@+import { artifactDependency, artifactTypes } from "@svml/artifact";+import {+ videoContractDependencies,+} from "@svml/contracts";+import {+ promptKitManifestDigest,+ promptKitModuleRef,+ promptKitTypes,+} from "@svml/prompt-kit";+import { digestOf } from "@svml/protocol";+import type { ModuleManifest } from "@svml/protocol";+import {+ seedanceManifestDigest,+ seedanceModuleRef,+ seedanceTypes,+} from "@svml/seedance";+import { svsManifest, svsRecipeType } from "@svml/svs";++export const seedanceSpeakerModuleRef = { name: "@svml/seedance-speaker", version: "0.0.0-dev" } as const;++export const seedanceSpeakerImplementationDigests = {+ takeSurface: digestOf("@svml/seedance-speaker/take-surface@3"),+} as const;++export const seedanceSpeakerManifest: ModuleManifest = {+ format: "svml.module@0",+ name: seedanceSpeakerModuleRef.name,+ version: seedanceSpeakerModuleRef.version,+ dependencies: [+ artifactDependency,+ videoContractDependencies.narrative,+ videoContractDependencies.speech,+ { module: promptKitModuleRef, digest: promptKitManifestDigest },+ { module: seedanceModuleRef, digest: seedanceManifestDigest },+ { module: svsRecipeType.module, digest: digestOf(svsManifest) },+ ],+ types: [],+ capabilities: [],+ surfaces: [{+ name: "take",+ tag: "Take",+ mode: "structured",+ outputs: [promptKitTypes.program, seedanceTypes.speechProgram, artifactTypes.blob],+ implementation: {+ kind: "trusted-frontend-surface",+ locator: "@svml/seedance-speaker/take-surface",+ digest: seedanceSpeakerImplementationDigests.takeSurface,+ },+ }],+ producers: [],+};++export const seedanceSpeakerManifestDigest = digestOf(seedanceSpeakerManifest);diff --git a/packages/seedance-speaker/src/surface.ts b/packages/seedance-speaker/src/surface.tsnew file mode 100644index 00000000..addda3af--- /dev/null+++ b/packages/seedance-speaker/src/surface.ts@@ -0,0 +1,298 @@+import { artifactTypes } from "@svml/artifact";+import { contractTypes } from "@svml/contracts";+import type { CanonicalValue, Digest, StoredValue } from "@svml/protocol";+import {+ compilePromptKit,+ promptKitTypes,+ verifyPromptKitSpec,+} from "@svml/prompt-kit";+import type { PromptKitSpec } from "@svml/prompt-kit";+import {+ seedanceEndpointsByModel,+ seedanceSpeechCompileProducers,+ seedanceTypes,+} from "@svml/seedance";+import type { SeedanceModel } from "@svml/seedance";+import { svsRecipeType } from "@svml/svs";+import type { SvsRecipe } from "@svml/svs";+import type {+ StructuredElement,+ StructuredSurfaceHandler,+ SurfaceResolvedReference,+ TextAttributeValue,+} from "@svml/text";++import { createSeedanceSpeakerTakeFragment } from "./fragment.js";+import {+ bindSpeakerPromptKit,+ renderSpeakerSpeechProgram,+ sealSpeakerTakeIntent,+ speakerMethodDefaults,+} from "./kit.js";+import type { SpeakerReference } from "./types.js";++function localName(value: string): string {+ return value.includes(":") ? value.slice(value.lastIndexOf(":") + 1) : value;+}++function sameType(left: SurfaceResolvedReference["type"], right: SurfaceResolvedReference["type"]): boolean {+ return left.module.name === right.module.name+ && left.module.version === right.module.version+ && left.name === right.name;+}++function attributes(element: StructuredElement, required: readonly string[], optional: readonly string[] = []): void {+ const allowed = new Set([...required, ...optional]);+ const unknown = Object.keys(element.attributes).filter((name) => !allowed.has(name));+ if (unknown.length > 0 || required.some((name) => element.attributes[name] === undefined)) {+ throw new Error(+ `${element.name} requires ${required.join(", ")}`+ + (optional.length === 0 ? "" : `; optional: ${optional.join(", ")}`),+ );+ }+}++function stringAttribute(element: StructuredElement, name: string): string {+ const value = element.attributes[name];+ if (typeof value !== "string" || value.trim().length === 0) {+ throw new Error(`${element.name}.${name} must be a non-empty string`);+ }+ return value.trim();+}++function referencePath(element: StructuredElement, name: string): string {+ const value: TextAttributeValue | undefined = element.attributes[name];+ if (typeof value !== "object" || value.kind !== "reference" || value.path.length === 0) {+ throw new Error(`${element.name}.${name} must be a whole-value reference`);+ }+ return value.path;+}++function resolved(+ element: StructuredElement,+ name: string,+ resolveReference: (path: string) => SurfaceResolvedReference | undefined,+): SurfaceResolvedReference {+ const path = referencePath(element, name);+ const value = resolveReference(path);+ if (value === undefined) throw new Error(`${element.name}.${name} cannot resolve ${path}`);+ return value;+}++function inline<T>(reference: SurfaceResolvedReference, subject: string): T {+ const value: StoredValue | undefined = reference.record?.value;+ if (value?.kind !== "inline") throw new Error(`${subject} must reference an authored inline value`);+ return value.value as unknown as T;+}++function blob(reference: SurfaceResolvedReference, subject: string) {+ if (!sameType(reference.type, artifactTypes.blob) || reference.record?.value.kind !== "blob") {+ throw new Error(`${subject} must reference an authored BlobArtifact`);+ }+ return reference.record.value;+}++function recipeValue(+ element: StructuredElement,+ resolveReference: (path: string) => SurfaceResolvedReference | undefined,+) {+ const reference = resolved(element, "recipe", resolveReference);+ if (!sameType(reference.type, svsRecipeType)) {+ throw new Error(`${element.name}.recipe must reference an SVS Recipe`);+ }+ const recipe = inline<SvsRecipe>(reference, `${element.name}.recipe`);+ if (recipe.contract !== "svml.svs-recipe@1") throw new Error(`${element.name}.recipe is invalid`);+ const digest = reference.record?.digest;+ if (digest === undefined) throw new Error(`${element.name}.recipe has no Record digest`);+ return { recipe, digest };+}++function kitValue(+ element: StructuredElement,+ resolveReference: (path: string) => SurfaceResolvedReference | undefined,+): PromptKitSpec {+ const reference = resolved(element, "kit", resolveReference);+ if (!sameType(reference.type, promptKitTypes.spec)) {+ throw new Error(`${element.name}.kit must reference a PromptKitSpec`);+ }+ const spec = inline<PromptKitSpec>(reference, `${element.name}.kit`);+ verifyPromptKitSpec(spec);+ return spec;+}++function dialogueValue(+ element: StructuredElement,+ resolveReference: (path: string) => SurfaceResolvedReference | undefined,+) {+ const reference = resolved(element, "dialogue", resolveReference);+ if (!sameType(reference.type, contractTypes.narrativeDialogueExcerpt)) {+ throw new Error(`${element.name}.dialogue must reference a NarrativeDialogueExcerpt`);+ }+ const value = inline<{+ readonly contract: string;+ readonly id: string;+ readonly tokenStart: number;+ readonly tokenEndExclusive: number;+ readonly dialogue: string;+ readonly excerptDigest: string;+ }>(reference, `${element.name}.dialogue`);+ if (+ value.contract !== "svml.narrative-dialogue-excerpt@1"+ || typeof value.id !== "string"+ || !Number.isSafeInteger(value.tokenStart)+ || !Number.isSafeInteger(value.tokenEndExclusive)+ || typeof value.dialogue !== "string"+ || value.dialogue.trim().length === 0+ ) {+ throw new Error(`${element.name}.dialogue is invalid`);+ }+ return value;+}++function references(+ element: StructuredElement,+ resolveReference: (path: string) => SurfaceResolvedReference | undefined,+): SpeakerReference[] {+ const result: SpeakerReference[] = [];+ for (const child of element.children) {+ if (child.kind === "text") {+ if (child.value.trim().length > 0) throw new Error(`${element.name} accepts only Reference children`);+ continue;+ }+ if (localName(child.name) !== "Reference") throw new Error(`${element.name} accepts only Reference children`);+ attributes(child, [], ["image", "audio", "role"]);+ const kinds = (["image", "audio"] as const).filter((kind) => child.attributes[kind] !== undefined);+ if (kinds.length !== 1) throw new Error(`${child.name} requires exactly one of image or audio`);+ const kind = kinds[0]!;+ const artifact = blob(resolved(child, kind, resolveReference), `${child.name}.${kind}`);+ if (!artifact.mediaType.startsWith(`${kind}/`)) throw new Error(`${child.name}.${kind} is not ${kind} media`);+ const rawRole = child.attributes.role;+ const role = rawRole === undefined+ ? kind === "image" ? "character-and-scene" : "voice-timbre"+ : typeof rawRole === "string" && rawRole.trim().length > 0+ ? rawRole.trim()+ : (() => { throw new Error(`${child.name}.role must be a non-empty string`); })();+ result.push({ kind, artifact, role });+ }+ return result;+}++function recipeString(+ recipe: SvsRecipe,+ name: string,+ fallback: string,+): string {+ const value = recipe.properties[name] ?? fallback;+ if (typeof value !== "string" || value.trim().length === 0) {+ throw new Error(`Speaker Recipe ${recipe.path}.${name} must be a non-empty string`);+ }+ return value.trim();+}++function recipeBoolean(recipe: SvsRecipe, name: string, fallback: boolean): boolean {+ const value = recipe.properties[name] ?? fallback;+ if (typeof value !== "boolean") throw new Error(`Speaker Recipe ${recipe.path}.${name} must be boolean`);+ return value;+}++function model(recipe: SvsRecipe): SeedanceModel {+ const value = recipeString(recipe, "model", "mini");+ if (value === "mini" || value === "seedance-2-mini") return "seedance-2-mini";+ if (value === "fast" || value === "seedance-2-fast") return "seedance-2-fast";+ if (value === "standard" || value === "seedance-2") return "seedance-2";+ throw new Error(`Speaker Recipe ${recipe.path}.model is not supported`);+}++export const decodeSeedanceSpeakerTakeSurface: StructuredSurfaceHandler = ({ element, resolveReference }) => {+ attributes(element, ["id", "dialogue", "duration", "recipe", "kit"]);+ const id = stringAttribute(element, "id");+ const kit = kitValue(element, resolveReference);+ const selectedRecipe = recipeValue(element, resolveReference);+ const recipe = selectedRecipe.recipe;+ const reserved = new Set([+ "kind", "model", "resolution", "aspect-ratio", "web-search", "action", "extra",+ ]);+ if (recipeString(recipe, "kind", "ugc-talking-head") !== "ugc-talking-head") {+ throw new Error(`Speaker Recipe ${recipe.path}.kind must be ugc-talking-head`);+ }+ const selectedModel = model(recipe);+ const dialogue = dialogueValue(element, resolveReference);+ const refs = references(element, resolveReference);+ const optionalPrompt = (name: "action" | "extra") => {+ const value = recipe.properties[name];+ if (value === undefined) return undefined;+ if (typeof value !== "string" || value.trim().length === 0) {+ throw new Error(`Speaker Recipe ${recipe.path}.${name} must be a non-empty string`);+ }+ return value.trim();+ };+ const actionPrompt = optionalPrompt("action");+ const extraPrompt = optionalPrompt("extra");+ const promptParameters: Record<string, CanonicalValue> = {};+ for (const [name, value] of Object.entries(recipe.properties)) {+ if (reserved.has(name)) continue;+ if (typeof value !== "string" && typeof value !== "boolean" && !(typeof value === "number" && Number.isFinite(value))) {+ throw new Error(`Speaker Recipe ${recipe.path}.${name} must be a finite scalar`);+ }+ promptParameters[name] = value;+ }+ const intent = sealSpeakerTakeIntent({+ contract: "svml.seedance-speaker-take-intent@1",+ kit: kit.id,+ recipe: { path: recipe.path, recordDigest: selectedRecipe.digest },+ model: selectedModel,+ resolution: recipeString(recipe, "resolution", speakerMethodDefaults.resolution) as "480p" | "720p" | "1080p",+ aspectRatio: recipeString(recipe, "aspect-ratio", speakerMethodDefaults.aspectRatio) as "1:1" | "4:3" | "3:4" | "16:9" | "9:16" | "21:9" | "adaptive",+ webSearch: recipeBoolean(recipe, "web-search", speakerMethodDefaults.webSearch),+ promptParameters,+ segment: {+ id: dialogue.id,+ tokenStart: dialogue.tokenStart,+ tokenEndExclusive: dialogue.tokenEndExclusive,+ dialogueExcerptDigest: dialogue.excerptDigest as Digest,+ dialogue: dialogue.dialogue,+ },+ references: refs,+ ...(actionPrompt === undefined ? {} : { actionPrompt }),+ ...(extraPrompt === undefined ? {} : { extraPrompt }),+ });+ // All static Kit semantics are lowered here; Runtime never sees axes, defaults or branches.+ const prompt = compilePromptKit(kit, bindSpeakerPromptKit(intent));+ const program = renderSpeakerSpeechProgram(prompt, intent);+ const duration = resolved(element, "duration", resolveReference);+ if (!sameType(duration.type, contractTypes.speechDuration)) {+ throw new Error(`${element.name}.duration must reference a SpeechDuration`);+ }+ const promptId = `${id}.prompt`;+ const programId = `${id}.program`;+ const fragment = createSeedanceSpeakerTakeFragment(+ seedanceEndpointsByModel[selectedModel],+ seedanceSpeechCompileProducers[selectedModel],+ );+ return {+ records: [{+ id: promptId,+ type: promptKitTypes.program,+ value: { kind: "inline", value: prompt as unknown as CanonicalValue },+ range: element.range,+ }, {+ id: programId,+ type: seedanceTypes.speechProgram,+ value: { kind: "inline", value: program as unknown as CanonicalValue },+ range: element.range,+ }],+ components: [{+ id,+ fragment: fragment.id,+ inputs: {+ program: { kind: "record", id: programId },+ duration: duration.ref,+ },+ outputs: {+ video: `${id}.video`,+ },+ range: element.range,+ }],+ fragments: [fragment],+ };+};diff --git a/packages/seedance-speaker/src/types.ts b/packages/seedance-speaker/src/types.tsnew file mode 100644index 00000000..faffc5b5--- /dev/null+++ b/packages/seedance-speaker/src/types.ts@@ -0,0 +1,33 @@+import type { CanonicalValue, BlobRef, Digest } from "@svml/protocol";+import type { SeedanceModel } from "@svml/seedance";++export type SpeakerReference = {+ readonly kind: "image" | "audio";+ readonly artifact: BlobRef;+ readonly role: string;+};++export type SpeakerTakeIntent = {+ readonly contract: "svml.seedance-speaker-take-intent@1";+ readonly kit: string;+ readonly recipe: {+ readonly path: string;+ readonly recordDigest: Digest;+ };+ readonly model: SeedanceModel;+ readonly resolution: "480p" | "720p" | "1080p";+ readonly aspectRatio: "1:1" | "4:3" | "3:4" | "16:9" | "9:16" | "21:9" | "adaptive";+ readonly webSearch: boolean;+ readonly promptParameters: Readonly<Record<string, CanonicalValue>>;+ readonly segment: {+ readonly id: string;+ readonly tokenStart: number;+ readonly tokenEndExclusive: number;+ readonly dialogueExcerptDigest: Digest;+ readonly dialogue: string;+ };+ readonly references: readonly SpeakerReference[];+ readonly actionPrompt?: string;+ readonly extraPrompt?: string;+ readonly intentDigest: Digest;+};diff --git a/packages/seedance-speaker/test/kit.test.ts b/packages/seedance-speaker/test/kit.test.tsnew file mode 100644index 00000000..10517185--- /dev/null+++ b/packages/seedance-speaker/test/kit.test.ts@@ -0,0 +1,122 @@+import assert from "node:assert/strict";+import { readFileSync } from "node:fs";+import test from "node:test";++import {+ compilePromptKit,+ promptKitSpecFromSvsRecipes,+ verifyPromptProgram,+} from "@svml/prompt-kit";+import { digestOf } from "@svml/protocol";+import { parseSvs } from "@svml/svs";+import {+ bindSpeakerPromptKit,+ renderSpeakerSpeechProgram,+ sealSpeakerTakeIntent,+ speakerMethodDefaults,+} from "@svml/seedance-speaker";++const officialUgcV1SvsSource = readFileSync(new URL("../kits/official-ugc-v1.svs", import.meta.url), "utf8");+const officialUgcV1Parsed = parseSvs(+ "official-ugc-v1.svs",+ officialUgcV1SvsSource.slice(officialUgcV1SvsSource.indexOf("<sheet")),+);+const officialUgcV1KitSpec = promptKitSpecFromSvsRecipes(+ officialUgcV1Parsed.recipes.map((item) => item.value),+ "official-ugc-v1",+);++const image = {+ kind: "blob" as const,+ digest: digestOf("speaker-image"),+ size: 100,+ mediaType: "image/png",+};++const audio = {+ kind: "blob" as const,+ digest: digestOf("speaker-audio"),+ size: 200,+ mediaType: "audio/mpeg",+};++function intent() {+ return sealSpeakerTakeIntent({+ contract: "svml.seedance-speaker-take-intent@1",+ kit: "official-ugc-v1",+ recipe: { path: "speaker.default", recordDigest: digestOf("recipe") },+ model: speakerMethodDefaults.model,+ resolution: speakerMethodDefaults.resolution,+ aspectRatio: speakerMethodDefaults.aspectRatio,+ webSearch: speakerMethodDefaults.webSearch,+ promptParameters: {},+ segment: {+ id: "opening",+ tokenStart: 0,+ tokenEndExclusive: 4,+ dialogueExcerptDigest: digestOf("dialogue"),+ dialogue: "HOST: Say exactly these words.",+ },+ references: [+ { kind: "image", artifact: image, role: "character-and-scene" },+ { kind: "audio", artifact: audio, role: "voice-timbre" },+ ],+ });+}++test("published official Kit SVS is the exact package resource compiled by the module", () => {+ assert.match(officialUgcV1SvsSource, /^<\?svml using="@svml\/prompt-kit\/svs@1"\?>/u);+ assert.equal(officialUgcV1KitSpec.id, "official-ugc-v1");+ assert.equal(officialUgcV1KitSpec.defaults.performance, "natural-explainer");+});++test("official UGC Kit emits an ordered generic Prompt Program", () => {+ const invocation = bindSpeakerPromptKit(intent());+ const prompt = compilePromptKit(officialUgcV1KitSpec, invocation);+ verifyPromptProgram(prompt);+ assert.deepEqual(prompt.blocks.map((item) => item.id), [+ "base",+ "reference-contract",+ "script-contract",+ "voice-map",+ "composition-stability",+ "camera-motion",+ "edit-rhythm",+ "performance",+ "gesture",+ "texture",+ "visible-text",+ "dialogue",+ ]);+ assert.equal(prompt.blocks[3]?.origin, "variant:voice-map:single-with-audio");+ assert.match(prompt.blocks[3]?.text ?? "", /@audio1/u);+ assert.equal(prompt.blocks[4]?.origin, "parameter:composition-stability:soft-locked");+});++test("rendering the generic Prompt Program preserves exact Seedance method and references", () => {+ const take = intent();+ const prompt = compilePromptKit(officialUgcV1KitSpec, bindSpeakerPromptKit(take));+ const program = renderSpeakerSpeechProgram(prompt, take);+ assert.equal(program.model, "seedance-2-mini");+ assert.equal(program.resolution, "720p");+ assert.equal(program.aspectRatio, "9:16");+ assert.equal(program.mode.kind, "reference");+ if (program.mode.kind !== "reference") assert.fail("expected reference mode");+ assert.deepEqual(program.mode.items.map((item) => item.kind), ["image", "audio"]);+ assert.equal(program.prompt, prompt.blocks.map((item) => item.text).join("\n\n"));+});++test("Speaker rejects invalid media while Prompt Kit rejects unknown parameters", () => {+ const base = intent();+ const { intentDigest: _digest, ...content } = base;+ assert.throws(() => sealSpeakerTakeIntent({+ ...content,+ references: [{ kind: "audio", artifact: audio, role: "voice-timbre" }],+ }), /requires 1-9 image references/u);+ assert.throws(() => sealSpeakerTakeIntent({ ...content, resolution: "1080p" }), /at most 720p/u);+ const unknown = sealSpeakerTakeIntent({ ...content, promptParameters: { "imaginary-axis": "value" } });+ assert.throws(+ () => compilePromptKit(officialUgcV1KitSpec, bindSpeakerPromptKit(unknown)),+ /parameter imaginary-axis is not declared/u,+ );+});diff --git a/packages/seedance/package.json b/packages/seedance/package.jsonindex 9e652f30..4089e5d5 100644--- a/packages/seedance/package.json+++ b/packages/seedance/package.json@@ -6,6 +6,9 @@"exports": {".": "./src/index.ts"},+ "svml": {+ "activation": "./src/activation.ts"+ },"dependencies": {"@svml/artifact": "workspace:*","@svml/contracts": "workspace:*",diff --git a/packages/seedance/src/activation.ts b/packages/seedance/src/activation.tsnew file mode 100644index 00000000..2e0821c1--- /dev/null+++ b/packages/seedance/src/activation.ts@@ -0,0 +1,43 @@+import { createTextSurfaceHostFacet } from "@svml/text";++import {+ decodeSeedancePromptSurface,+ decodeSeedanceSpeechSurface,+ decodeSeedanceVideoSurface,+ seedanceComponent,+ seedanceManifest,+ seedanceModuleRef,+ seedanceSurfaceImplementationDigests,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/seedance",+ modules: [{ manifest: seedanceManifest, specifiers: ["@svml/seedance", "@svml/seedance@1"] }],+ components: [seedanceComponent],+ hostFacets: [+ createTextSurfaceHostFacet({+ module: seedanceModuleRef,+ surface: "prompt",+ mode: "structured",+ implementationDigest: seedanceSurfaceImplementationDigests.prompt,+ handler: decodeSeedancePromptSurface,+ }),+ createTextSurfaceHostFacet({+ module: seedanceModuleRef,+ surface: "speech",+ mode: "structured",+ implementationDigest: seedanceSurfaceImplementationDigests.speech,+ handler: decodeSeedanceSpeechSurface,+ }),+ createTextSurfaceHostFacet({+ module: seedanceModuleRef,+ surface: "video",+ mode: "structured",+ implementationDigest: seedanceSurfaceImplementationDigests.video,+ handler: decodeSeedanceVideoSurface,+ }),+ ],+};++export default svmlPackage;diff --git a/packages/speech-align/package.json b/packages/speech-align/package.jsonindex 906b70e2..d5b7e0aa 100644--- a/packages/speech-align/package.json+++ b/packages/speech-align/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/component-kit": "workspace:*","@svml/contracts": "workspace:*",diff --git a/packages/speech-align/src/activation.ts b/packages/speech-align/src/activation.tsnew file mode 100644index 00000000..bd9909d8--- /dev/null+++ b/packages/speech-align/src/activation.ts@@ -0,0 +1,9 @@+import { speechAlignComponent, speechAlignManifest } from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/speech-align",+ modules: [{ manifest: speechAlignManifest }],+ components: [speechAlignComponent],+};+export default svmlPackage;diff --git a/packages/speech-program/package.json b/packages/speech-program/package.jsonindex 05af37fd..b526f2d5 100644--- a/packages/speech-program/package.json+++ b/packages/speech-program/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/artifact": "workspace:*","@svml/caption": "workspace:*",diff --git a/packages/speech-program/src/activation.ts b/packages/speech-program/src/activation.tsnew file mode 100644index 00000000..0171a47f--- /dev/null+++ b/packages/speech-program/src/activation.ts@@ -0,0 +1,17 @@+import { createTextSurfaceHostFacet } from "@svml/text";+import {+ decodeSpeechSpineSurface, speechProgramComponent, speechProgramManifest,+ speechProgramModuleRef, speechSpineSurfaceImplementationDigest,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/speech-program",+ modules: [{ manifest: speechProgramManifest, specifiers: ["@svml/speech", "@svml/speech@1"] }],+ components: [speechProgramComponent],+ hostFacets: [createTextSurfaceHostFacet({+ module: speechProgramModuleRef, surface: "spine", mode: "structured",+ implementationDigest: speechSpineSurfaceImplementationDigest, handler: decodeSpeechSpineSurface,+ })],+};+export default svmlPackage;diff --git a/packages/speech-take/package.json b/packages/speech-take/package.jsonindex ed940b5d..72a2727c 100644--- a/packages/speech-take/package.json+++ b/packages/speech-take/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/component-kit": "workspace:*","@svml/contracts": "workspace:*",diff --git a/packages/speech-take/src/activation.ts b/packages/speech-take/src/activation.tsnew file mode 100644index 00000000..2cdd0b93--- /dev/null+++ b/packages/speech-take/src/activation.ts@@ -0,0 +1,9 @@+import { speechTakeComponent, speechTakeManifest } from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/speech-take",+ modules: [{ manifest: speechTakeManifest }],+ components: [speechTakeComponent],+};+export default svmlPackage;diff --git a/packages/svs/package.json b/packages/svs/package.jsonindex d6c9fb8a..680a2390 100644--- a/packages/svs/package.json+++ b/packages/svs/package.json@@ -6,6 +6,9 @@"exports": {".": "./src/index.ts"},+ "svml": {+ "activation": "./src/activation.ts"+ },"dependencies": {"@svml/core": "workspace:*","@svml/elaborator": "workspace:*",diff --git a/packages/svs/src/activation.ts b/packages/svs/src/activation.tsnew file mode 100644index 00000000..6ccfef7c--- /dev/null+++ b/packages/svs/src/activation.ts@@ -0,0 +1,10 @@+import { svsFrontend, svsManifest } from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/svs",+ modules: [{ manifest: svsManifest }],+ authorFrontends: [svsFrontend],+};++export default svmlPackage;diff --git a/packages/svs/src/parser.ts b/packages/svs/src/parser.tsindex 27246fd4..e4d3db95 100644--- a/packages/svs/src/parser.ts+++ b/packages/svs/src/parser.ts@@ -27,7 +27,30 @@ function fail(sourceName: string, code: string, message: string, offset: number)function withoutComments(sourceName: string, text: string): string {const output = [...text];let cursor = 0;+ let quote: "\"" | "'" | undefined;+ let escaped = false;while (cursor < text.length) {+ const character = text[cursor];+ if (escaped) {+ escaped = false;+ cursor += 1;+ continue;+ }+ if (character === "\\" && quote !== undefined) {+ escaped = true;+ cursor += 1;+ continue;+ }+ if (quote !== undefined) {+ if (character === quote) quote = undefined;+ cursor += 1;+ continue;+ }+ if (character === "\"" || character === "'") {+ quote = character;+ cursor += 1;+ continue;+ }if (!text.startsWith("/*", cursor)) {cursor += 1;continue;@@ -42,6 +65,32 @@ function withoutComments(sourceName: string, text: string): string {return output.join("");}+function closingBrace(text: string, start: number, limit: number): number {+ let quote: "\"" | "'" | undefined;+ let escaped = false;+ for (let cursor = start; cursor < limit; cursor += 1) {+ const character = text[cursor];+ if (escaped) {+ escaped = false;+ continue;+ }+ if (character === "\\" && quote !== undefined) {+ escaped = true;+ continue;+ }+ if (quote !== undefined) {+ if (character === quote) quote = undefined;+ continue;+ }+ if (character === "\"" || character === "'") {+ quote = character;+ continue;+ }+ if (character === "}") return cursor;+ }+ return -1;+}+function skipSpace(text: string, start: number): number {let cursor = start;while (/\s/u.test(text[cursor] ?? "")) cursor += 1;@@ -95,6 +144,32 @@ function parseValue(sourceName: string, text: string, offset: number): Canonicalreturn value;}+function valueSemicolon(text: string, start: number): number {+ let quote: "\"" | "'" | undefined;+ let escaped = false;+ for (let cursor = start; cursor < text.length; cursor += 1) {+ const character = text[cursor];+ if (escaped) {+ escaped = false;+ continue;+ }+ if (character === "\\" && quote !== undefined) {+ escaped = true;+ continue;+ }+ if (quote !== undefined) {+ if (character === quote) quote = undefined;+ continue;+ }+ if (character === "\"" || character === "'") {+ quote = character;+ continue;+ }+ if (character === ";") return cursor;+ }+ return -1;+}+function parseProperties(sourceName: string,text: string,@@ -115,7 +190,7 @@ function parseProperties(cursor = skipSpace(text, cursor);if (text[cursor] !== ":") fail(sourceName, "SVS_PROPERTY_COLON", `Property ${name} requires ':'.`, offset + cursor);const valueStart = cursor + 1;- const semicolon = text.indexOf(";", valueStart);+ const semicolon = valueSemicolon(text, valueStart);if (semicolon < 0) fail(sourceName, "SVS_PROPERTY_SEMICOLON", `Property ${name} requires ';'.`, offset + valueStart);properties[name] = parseValue(sourceName, text.slice(valueStart, semicolon), offset + valueStart);cursor = semicolon + 1;@@ -151,7 +226,7 @@ export function parseSvs(sourceName: string, source: string): ParsedSvsSheet {cursor = skipSpace(text, cursor);if (text[cursor] !== "{") fail(sourceName, "SVS_RULE_OPEN", `Recipe ${path} requires '{'.`, cursor);const blockStart = cursor + 1;- const blockEnd = text.indexOf("}", blockStart);+ const blockEnd = closingBrace(text, blockStart, close);if (blockEnd < 0 || blockEnd > close) fail(sourceName, "SVS_RULE_UNCLOSED", `Recipe ${path} is not closed.`, start);const value: SvsRecipe = {contract: "svml.svs-recipe@1",diff --git a/packages/svs/test/source-closure.test.ts b/packages/svs/test/source-closure.test.tsindex 2b41859a..d11faabb 100644--- a/packages/svs/test/source-closure.test.ts+++ b/packages/svs/test/source-closure.test.ts@@ -404,3 +404,11 @@ test("SVS rejects duplicate public recipes", () => {(error: unknown) => error instanceof SvsSyntaxError && error.code === "SVS_RULE_DUPLICATE",);});++test("quoted Recipe values may contain Prompt punctuation without changing SVS structure", () => {+ const sheet = parseSvs(+ "prompt.svs",+ '<sheet version="1">demo.prompt { text: "first; second } /* literal */"; }</sheet>',+ );+ assert.equal(sheet.recipes[0]?.value.properties.text, "first; second } /* literal */");+});diff --git a/packages/text-track/package.json b/packages/text-track/package.jsonindex eb11ac4d..9c93836d 100644--- a/packages/text-track/package.json+++ b/packages/text-track/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/component-kit": "workspace:*","@svml/contracts": "workspace:*",diff --git a/packages/text-track/src/activation.ts b/packages/text-track/src/activation.tsnew file mode 100644index 00000000..19bc8247--- /dev/null+++ b/packages/text-track/src/activation.ts@@ -0,0 +1,17 @@+import { createTextSurfaceHostFacet } from "@svml/text";+import {+ decodeTextTrackSurface, textTrackComponent, textTrackManifest, textTrackModuleRef,+ textTrackSurfaceImplementationDigest,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/text-track",+ modules: [{ manifest: textTrackManifest, specifiers: ["@svml/text-track", "@svml/text-track@1"] }],+ components: [textTrackComponent],+ hostFacets: [createTextSurfaceHostFacet({+ module: textTrackModuleRef, surface: "track", mode: "structured",+ implementationDigest: textTrackSurfaceImplementationDigest, handler: decodeTextTrackSurface,+ })],+};+export default svmlPackage;diff --git a/packages/video-cli/README.md b/packages/video-cli/README.mdindex d60af7d6..0890a25c 100644--- a/packages/video-cli/README.md+++ b/packages/video-cli/README.md@@ -1,29 +1,23 @@# `@svml/video-cli`-Official v2 video command-line Distribution.+Official v2 video command application. It selects the Text compiler Host and the video+Runtime-config adapter registry, but deliberately carries no built-in author or Run package.-Unlike the generic `@svml/cli` engine, this application is an explicit trusted video assembly. It-depends on the one ordinary `@svml/prelude-video` aggregate rather than importing each video package-itself, and registers the optional `@svml/run-text` Frontend. The current prelude contributes:--- package-owned Text Surface Host facets consumed by `@svml/compiler-text-node`;-- the Script raw Surface and its audiovisual Narrative contract dependency;-- the SVS alternate Frontend and generic Recipe manifest;-- the official Speech, WhisperX, provider-free Caption, B-roll, Text, Film and HyperFrames Render- Structured Surfaces plus their exact static dependencies.--It does not place these packages in Core and does not grant source imports network, credential or-process permissions.+Every Frontend, Surface, deterministic Producer and Validator is activated from an explicit+`svml.packages.lock`. Installing a new author package therefore does not require a video CLI or Core+release. Source imports select logical author meaning only after the Host has reviewed and locked+the corresponding physical package. They never grant network, credential or process authority.From the repository:```bash-pnpm svml:v2 check path/to/main.svml-pnpm svml:v2 lock-packages ./svml.packages.lock --package @example/cards --root .+pnpm svml:v2 lock-packages ./svml.packages.lock \+ --package @svml/run-text --package @svml/script --package @example/cards --root .pnpm svml:v2 check path/to/main.svml --package-lock ./svml.packages.lock --root .-pnpm svml:v2 check path/to/build.svrun-pnpm svml:v2 plan path/to/build.svrun-pnpm svml:v2 build path/to/build.svrun --runtime ./svml.runtime.json --build-id delivery-01 --follow+pnpm svml:v2 check path/to/build.svrun --package-lock ./svml.packages.lock --root .+pnpm svml:v2 plan path/to/build.svrun --package-lock ./svml.packages.lock --root .+pnpm svml:v2 build path/to/build.svrun --package-lock ./svml.packages.lock \+ --runtime ./svml.runtime.json --build-id delivery-01 --follow --root .pnpm svml:v2 status <build-id> --runtime ./svml.runtime.jsonpnpm svml:v2 builds --runtime ./svml.runtime.jsonpnpm svml:v2 inspect <build-id> --runtime ./svml.runtime.jsondiff --git a/packages/video-cli/package.json b/packages/video-cli/package.jsonindex 7c468bde..6e868965 100644--- a/packages/video-cli/package.json+++ b/packages/video-cli/package.json@@ -11,13 +11,11 @@"@svml/cli": "workspace:*","@svml/compiler-text-node": "workspace:*","@svml/local": "workspace:*",- "@svml/prelude-video": "workspace:*","@svml/provider-google-vertex": "workspace:*","@svml/provider-hyperframes-local": "workspace:*","@svml/provider-kie": "workspace:*","@svml/provider-media-local": "workspace:*","@svml/provider-whisperx-local": "workspace:*",- "@svml/run-text": "workspace:*","@svml/protocol": "workspace:*","@svml/runtime": "workspace:*"}diff --git a/packages/video-cli/src/compiler.ts b/packages/video-cli/src/compiler.tsindex 8ad08bad..3fac0d31 100644--- a/packages/video-cli/src/compiler.ts+++ b/packages/video-cli/src/compiler.ts@@ -1,10 +1,10 @@import type { CliCompilerOptions } from "@svml/cli";import { createTextNodeCompiler } from "@svml/compiler-text-node";-import { svmlPackage as videoPrelude } from "@svml/prelude-video";-export const videoBuiltInPackageContributions = [videoPrelude] as const;+/** Video authoring packages are selected by an explicit package lock; none are implicit here. */+export const videoBuiltInPackageContributions = [] as const;-/** Video Distribution chooses Text authoring and one ordinary replaceable video Prelude. */+/** Assemble the Text compiler Host from only the packages selected for this invocation. */export function createVideoCompiler(options: CliCompilerOptions) {return createTextNodeCompiler(options.packageContributions, {...(options.root === undefined ? {} : { root: options.root }),diff --git a/packages/video-cli/src/distribution.ts b/packages/video-cli/src/distribution.tsindex 11196d16..54377519 100644--- a/packages/video-cli/src/distribution.ts+++ b/packages/video-cli/src/distribution.ts@@ -1,6 +1,4 @@import type { CliDistribution } from "@svml/cli";-import { runTextFrontend } from "@svml/run-text";-import {createVideoCompiler,videoBuiltInPackageContributions,@@ -11,7 +9,7 @@ import { createVideoRuntimeFromConfig } from "./runtime-config.js";export const videoCliDistribution: CliDistribution = {name: "@svml/video-cli",builtInPackageContributions: videoBuiltInPackageContributions,- runFrontends: [runTextFrontend],+ runFrontends: [],createCompiler: createVideoCompiler,createRuntimeFromConfig: createVideoRuntimeFromConfig,};diff --git a/packages/video-cli/src/index.ts b/packages/video-cli/src/index.tsindex 6ccfb472..e28164ad 100644--- a/packages/video-cli/src/index.ts+++ b/packages/video-cli/src/index.ts@@ -3,6 +3,7 @@ import {materializeRecord,runCli,} from "@svml/cli";+import type { NodePackageContribution } from "@svml/package-loader-node";import { videoCliDistribution } from "./distribution.js";@@ -20,6 +21,10 @@ export { videoCliDistribution } from "./distribution.js";export function runVideoCli(argv: readonly string[],io: { readonly write: (text: string) => void },+ packageContributions: readonly NodePackageContribution[] = [],): Promise<void> {- return runCli(argv, io, videoCliDistribution);+ return runCli(argv, io, {+ ...videoCliDistribution,+ builtInPackageContributions: packageContributions,+ });}diff --git a/packages/video-cli/src/runtime-config.ts b/packages/video-cli/src/runtime-config.tsindex 0a51ba43..4750deb5 100644--- a/packages/video-cli/src/runtime-config.ts+++ b/packages/video-cli/src/runtime-config.ts@@ -9,7 +9,6 @@ import { createLocalHyperframesProvider } from "@svml/provider-hyperframes-localimport { createKieProvider } from "@svml/provider-kie";import { createLocalMediaProvider } from "@svml/provider-media-local";import { createLocalWhisperXProvider } from "@svml/provider-whisperx-local";-import { svmlPackage as videoPrelude } from "@svml/prelude-video";import type { CanonicalValue } from "@svml/protocol";import { credentialRef } from "@svml/runtime";@@ -167,6 +166,5 @@ export function createVideoRuntimeConfigRegistry(): RuntimeConfigRegistry {export async function createVideoRuntimeFromConfig(path: string) {return await createRuntimeFromConfig(path, {registry: createVideoRuntimeConfigRegistry(),- components: videoPrelude.components ?? [],});}diff --git a/packages/video-cli/test/cli.test.ts b/packages/video-cli/test/cli.test.tsindex 1f1a8bfe..23982c62 100644--- a/packages/video-cli/test/cli.test.ts+++ b/packages/video-cli/test/cli.test.ts@@ -5,7 +5,29 @@ import { tmpdir } from "node:os";import { join } from "node:path";import test from "node:test";-import { materializeRecord, runVideoCli as runCli } from "@svml/video-cli";+import { materializeRecord, runVideoCli } from "@svml/video-cli";++import { videoTestPackages } from "./packages.js";++const runCli = (+ argv: readonly string[],+ io: { readonly write: (text: string) => void },+) => runVideoCli(argv, io, videoTestPackages);++test("production video CLI has no implicit author or Run packages", async () => {+ const root = await mkdtemp(join(tmpdir(), "svml-cli-empty-distribution-"));+ const file = join(root, "main.svml");+ await writeFile(file, `<?svml using="@svml/text@1"?>+<svml>+ <import from="@svml/script@1"/>+ <script id="story"><opening><HOST>No hidden package.</opening></script>+</svml>`, "utf8");++ await assert.rejects(+ async () => await runVideoCli(["check", file], { write() {} }),+ /No registered module satisfies @svml\/script@1/u,+ );+});async function writeRun(root: string,@@ -107,6 +129,7 @@ test("official media and Seedance Surfaces lower author intent into exact generaconst root = await mkdtemp(join(tmpdir(), "svml-cli-generation-"));const file = join(root, "main.svml");await writeFile(join(root, "host.png"), new Uint8Array([137, 80, 78, 71]));+ await writeFile(join(root, "voice.mp3"), new Uint8Array([73, 68, 51]));await writeFile(file, `<?svml using="@svml/text@1"?><svml><import from="@svml/script@1"/>@@ -114,12 +137,14 @@ test("official media and Seedance Surfaces lower author intent into exact genera<import as="seedance" from="@svml/seedance@1"/><script id="story"><opening><HOST>Say exactly these words.</opening></script><media:Image id="host" src="./host.png"/>+ <media:Audio id="voice" src="./voice.mp3"/><seedance:Prompt id="direction">Locked medium close-up in a quiet daylight studio.</seedance:Prompt><seedance:Speech id="take" model="mini" dialogue={story.segment.opening.dialogue}prompt={direction} duration="5"><seedance:Reference image={host} role="character"/>+ <seedance:Reference audio={voice} role="voice-timbre"/></seedance:Speech><seedance:Video id="motion" model="mini" prompt={direction} duration="5"/></svml>`, "utf8");@@ -132,7 +157,7 @@ test("official media and Seedance Surfaces lower author intent into exact generareadonly exports: readonly { readonly name: string }[];};assert.equal(checked.ok, true);- assert.deepEqual(checked.sourceAssets.map((item) => item.mediaType), ["image/png"]);+ assert.deepEqual(checked.sourceAssets.map((item) => item.mediaType), ["audio/mpeg", "image/png"]);assert.deepEqual(checked.exports.map((item) => item.name), ["direction","host",@@ -145,6 +170,7 @@ test("official media and Seedance Surfaces lower author intent into exact genera"story.segment.opening.speech","take","take.request",+ "voice",]);let planOutput = "";@@ -171,6 +197,66 @@ test("official media and Seedance Surfaces lower author intent into exact genera);});+test("Prompt Kit source and Speaker Surface finish prompt assembly before the Run Graph", async () => {+ const root = await mkdtemp(join(tmpdir(), "svml-cli-prompt-kit-"));+ const file = join(root, "main.svml");+ const kitSource = await readFile(+ new URL("../../seedance-speaker/kits/official-ugc-v1.svs", import.meta.url),+ "utf8",+ );+ await writeFile(join(root, "official-ugc-v1.svs"), kitSource, "utf8");+ await writeFile(join(root, "studio.svs"), `<?svml using="@svml/svs@1"?>+<sheet version="1">+ speech.normal { language: en; pace: normal; padding: 0.3; min: 4; max: 15; rounding: ceil; }+ speaker.default { kind: ugc-talking-head; model: mini; resolution: 720p; aspect-ratio: 9:16; }+</sheet>`, "utf8");+ await writeFile(join(root, "host.png"), new Uint8Array([137, 80, 78, 71]));+ await writeFile(file, `<?svml using="@svml/text@1"?>+<svml>+ <import from="@svml/script@1"/>+ <import as="media" from="@svml/media@1"/>+ <import as="estimate" from="@svml/estimate@1"/>+ <import as="speaker" from="@svml/seedance-speaker@1"/>+ <import as="studio" source="./studio.svs"/>+ <import as="ugc" source="./official-ugc-v1.svs"/>++ <script id="story"><opening><HOST>Meaning becomes the source.</opening></script>+ <media:Image id="host" src="./host.png"/>+ <estimate:Speech id="duration" source={story.segment.opening.speech} policy={studio.speech.normal}/>+ <speaker:Take id="take" dialogue={story.segment.opening.dialogue}+ duration={duration.duration} recipe={studio.speaker.default} kit={ugc.official-ugc-v1}>+ <speaker:Reference image={host} role="character-and-scene"/>+ </speaker:Take>+</svml>`, "utf8");++ let checkedOutput = "";+ await runCli(["check", file], { write: (text) => { checkedOutput += text; } });+ const checked = JSON.parse(checkedOutput) as {+ readonly exports: readonly { readonly name: string }[];+ };+ const names = checked.exports.map((item) => item.name);+ assert.equal(names.includes("take.prompt"), true);+ assert.equal(names.includes("take.program"), true);+ assert.equal(names.includes("take.video"), true);++ const run = await writeRun(root, "build.svrun", [{ output: "take.video" }]);+ let planOutput = "";+ await runCli(["plan", run], { write: (text) => { planOutput += text; } });+ const plan = JSON.parse(planOutput) as {+ readonly steps: readonly { readonly producer: { readonly name: string } }[];+ };+ assert.deepEqual(plan.steps.map((step) => step.producer.name).sort(), [+ "compile-seedance-2-mini-speech-request",+ "estimate-speech-duration",+ "request-seedance-2-mini",+ "select-primary-video",+ ].sort());+ assert.equal(+ plan.steps.some((step) => /prompt|speaker/u.test(step.producer.name)),+ false,+ );+});+test(".svrun is the complete human-readable Target graph used by plan", async () => {const root = await mkdtemp(join(tmpdir(), "svml-cli-run-"));const source = join(root, "main.svml");@@ -229,7 +315,7 @@ test("CLI accepts a declarative Runtime Profile without an executable config modassert.deepEqual(status.operations, []);});-test("official prelude lowers Speech Spine and explicit WhisperX alignment without provider calls", async () => {+test("independent packages lower Speech Spine and explicit WhisperX alignment without provider calls", async () => {const root = await mkdtemp(join(tmpdir(), "svml-cli-speech-spine-"));const file = join(root, "main.svml");await writeFile(file, `<?svml using="@svml/text@1"?>diff --git a/packages/video-cli/test/packages.ts b/packages/video-cli/test/packages.tsnew file mode 100644index 00000000..17ff41d5--- /dev/null+++ b/packages/video-cli/test/packages.ts@@ -0,0 +1,50 @@+import artifact from "../../artifact/src/activation.js";+import broll from "../../broll/src/activation.js";+import captionGemini from "../../caption-gemini/src/activation.js";+import caption from "../../caption/src/activation.js";+import contracts from "../../contracts/src/activation.js";+import estimate from "../../estimate/src/activation.js";+import film from "../../film/src/activation.js";+import generation from "../../generation/src/activation.js";+import hyperframesRender from "../../hyperframes-render/src/activation.js";+import hyperframes from "../../hyperframes/src/activation.js";+import mediaPipeline from "../../media-pipeline/src/activation.js";+import media from "../../media/src/activation.js";+import promptKit from "../../prompt-kit/src/activation.js";+import runText from "../../run-text/src/activation.js";+import script from "../../script/src/activation.js";+import seedanceSpeaker from "../../seedance-speaker/src/activation.js";+import seedance from "../../seedance/src/activation.js";+import speechAlign from "../../speech-align/src/activation.js";+import speechProgram from "../../speech-program/src/activation.js";+import speechTake from "../../speech-take/src/activation.js";+import svs from "../../svs/src/activation.js";+import textTrack from "../../text-track/src/activation.js";+import whisperX from "../../whisperx/src/activation.js";++/** Test-only explicit environment; production video CLI starts with no author packages. */+export const videoTestPackages = [+ artifact,+ contracts,+ media,+ svs,+ script,+ estimate,+ promptKit,+ generation,+ seedance,+ seedanceSpeaker,+ caption,+ captionGemini,+ speechAlign,+ speechTake,+ speechProgram,+ whisperX,+ broll,+ textTrack,+ film,+ hyperframes,+ mediaPipeline,+ hyperframesRender,+ runText,+] as const;diff --git a/packages/whisperx/package.json b/packages/whisperx/package.jsonindex 1fd28c31..c159302f 100644--- a/packages/whisperx/package.json+++ b/packages/whisperx/package.json@@ -6,6 +6,7 @@"exports": {".": "./src/index.ts"},+ "svml": { "activation": "./src/activation.ts" },"dependencies": {"@svml/component-kit": "workspace:*","@svml/contracts": "workspace:*",diff --git a/packages/whisperx/src/activation.ts b/packages/whisperx/src/activation.tsnew file mode 100644index 00000000..c6674eea--- /dev/null+++ b/packages/whisperx/src/activation.ts@@ -0,0 +1,18 @@+import { createTextSurfaceHostFacet } from "@svml/text";+import {+ decodeWhisperXAlignmentSurface, whisperXComponent, whisperXImplementationDigests,+ whisperXManifest, whisperXModuleRef,+} from "./index.js";++export const svmlPackage = {+ format: "svml.node-package@1" as const,+ name: "@svml/whisperx",+ modules: [{ manifest: whisperXManifest, specifiers: ["@svml/whisperx", "@svml/whisperx@1"] }],+ components: [whisperXComponent],+ hostFacets: [createTextSurfaceHostFacet({+ module: whisperXModuleRef, surface: "alignment", mode: "structured",+ implementationDigest: whisperXImplementationDigests.surface,+ handler: decodeWhisperXAlignmentSurface,+ })],+};+export default svmlPackage;diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex e5cdb2a2..cc2ecdf1 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -12,12 +12,48 @@ importers:specifier: 0.7.84version: 0.7.84(@types/[email protected])devDependencies:+ '@svml/artifact':+ specifier: workspace:*+ version: link:packages/artifact+ '@svml/broll':+ specifier: workspace:*+ version: link:packages/broll+ '@svml/caption':+ specifier: workspace:*+ version: link:packages/caption+ '@svml/caption-gemini':+ specifier: workspace:*+ version: link:packages/caption-gemini+ '@svml/contracts':+ specifier: workspace:*+ version: link:packages/contracts+ '@svml/estimate':+ specifier: workspace:*+ version: link:packages/estimate+ '@svml/film':+ specifier: workspace:*+ version: link:packages/film+ '@svml/generation':+ specifier: workspace:*+ version: link:packages/generation+ '@svml/hyperframes':+ specifier: workspace:*+ version: link:packages/hyperframes+ '@svml/hyperframes-render':+ specifier: workspace:*+ version: link:packages/hyperframes-render'@svml/local':specifier: workspace:*version: link:packages/local- '@svml/prelude-video':+ '@svml/media':+ specifier: workspace:*+ version: link:packages/media+ '@svml/media-pipeline':specifier: workspace:*- version: link:packages/prelude-video+ version: link:packages/media-pipeline+ '@svml/prompt-kit':+ specifier: workspace:*+ version: link:packages/prompt-kit'@svml/provider-google-vertex':specifier: workspace:*version: link:packages/provider-google-vertex@@ -36,6 +72,33 @@ importers:'@svml/run-text':specifier: workspace:*version: link:packages/run-text+ '@svml/script':+ specifier: workspace:*+ version: link:packages/script+ '@svml/seedance':+ specifier: workspace:*+ version: link:packages/seedance+ '@svml/seedance-speaker':+ specifier: workspace:*+ version: link:packages/seedance-speaker+ '@svml/speech-align':+ specifier: workspace:*+ version: link:packages/speech-align+ '@svml/speech-program':+ specifier: workspace:*+ version: link:packages/speech-program+ '@svml/speech-take':+ specifier: workspace:*+ version: link:packages/speech-take+ '@svml/svs':+ specifier: workspace:*+ version: link:packages/svs+ '@svml/text-track':+ specifier: workspace:*+ version: link:packages/text-track+ '@svml/whisperx':+ specifier: workspace:*+ version: link:packages/whisperx'@types/node':specifier: 24.10.1version: 24.10.1@@ -365,6 +428,9 @@ importers:'@svml/protocol':specifier: workspace:*version: link:../protocol+ '@svml/svs':+ specifier: workspace:*+ version: link:../svs'@svml/text':specifier: workspace:*version: link:../text@@ -659,72 +725,23 @@ importers:specifier: workspace:*version: link:../validation- packages/prelude-video:+ packages/prompt-kit:dependencies:- '@svml/broll':- specifier: workspace:*- version: link:../broll- '@svml/caption':- specifier: workspace:*- version: link:../caption- '@svml/caption-gemini':- specifier: workspace:*- version: link:../caption-gemini- '@svml/contracts':- specifier: workspace:*- version: link:../contracts- '@svml/estimate':- specifier: workspace:*- version: link:../estimate- '@svml/film':- specifier: workspace:*- version: link:../film- '@svml/generation':- specifier: workspace:*- version: link:../generation- '@svml/hyperframes':- specifier: workspace:*- version: link:../hyperframes- '@svml/hyperframes-render':- specifier: workspace:*- version: link:../hyperframes-render- '@svml/media':- specifier: workspace:*- version: link:../media- '@svml/media-pipeline':- specifier: workspace:*- version: link:../media-pipeline- '@svml/script':- specifier: workspace:*- version: link:../script- '@svml/seedance':+ '@svml/component-kit':specifier: workspace:*- version: link:../seedance- '@svml/speech-align':+ version: link:../component-kit+ '@svml/core':specifier: workspace:*- version: link:../speech-align- '@svml/speech-program':+ version: link:../core+ '@svml/elaborator':specifier: workspace:*- version: link:../speech-program- '@svml/speech-take':+ version: link:../elaborator+ '@svml/protocol':specifier: workspace:*- version: link:../speech-take+ version: link:../protocol'@svml/svs':specifier: workspace:*version: link:../svs- '@svml/text':- specifier: workspace:*- version: link:../text- '@svml/text-track':- specifier: workspace:*- version: link:../text-track- '@svml/whisperx':- specifier: workspace:*- version: link:../whisperx- devDependencies:- '@svml/package-loader-node':- specifier: workspace:*- version: link:../package-loader-nodepackages/protocol: {}@@ -967,6 +984,9 @@ importers:'@svml/protocol':specifier: workspace:*version: link:../protocol+ '@svml/text':+ specifier: workspace:*+ version: link:../textpackages/seedance:dependencies:@@ -992,6 +1012,39 @@ importers:specifier: workspace:*version: link:../text+ packages/seedance-speaker:+ dependencies:+ '@svml/artifact':+ specifier: workspace:*+ version: link:../artifact+ '@svml/contracts':+ specifier: workspace:*+ version: link:../contracts+ '@svml/elaborator':+ specifier: workspace:*+ version: link:../elaborator+ '@svml/generation':+ specifier: workspace:*+ version: link:../generation+ '@svml/model-kit':+ specifier: workspace:*+ version: link:../model-kit+ '@svml/prompt-kit':+ specifier: workspace:*+ version: link:../prompt-kit+ '@svml/protocol':+ specifier: workspace:*+ version: link:../protocol+ '@svml/seedance':+ specifier: workspace:*+ version: link:../seedance+ '@svml/svs':+ specifier: workspace:*+ version: link:../svs+ '@svml/text':+ specifier: workspace:*+ version: link:../text+packages/seedream:dependencies:'@svml/generation':@@ -1224,9 +1277,6 @@ importers:'@svml/local':specifier: workspace:*version: link:../local- '@svml/prelude-video':- specifier: workspace:*- version: link:../prelude-video'@svml/protocol':specifier: workspace:*version: link:../protocol@@ -1245,9 +1295,6 @@ importers:'@svml/provider-whisperx-local':specifier: workspace:*version: link:../provider-whisperx-local- '@svml/run-text':- specifier: workspace:*- version: link:../run-text'@svml/runtime':specifier: workspace:*version: link:../runtimediff --git a/tools/package-boundaries.test.mjs b/tools/package-boundaries.test.mjsindex a097448a..2f594020 100644--- a/tools/package-boundaries.test.mjs+++ b/tools/package-boundaries.test.mjs@@ -108,11 +108,10 @@ test("Text compilation is one explicit leaf assembly, not a Package Loader or Loassert.ok(!transitive(graph, "@svml/local").has("@svml/text"));});-test("the generic CLI engine reaches no video Prelude or Endpoint package", async () => {+test("the generic CLI reaches no Endpoint package and video CLI activates no author aggregate", async () => {const graph = productionGraph(await workspacePackages());const dependencies = transitive(graph, "@svml/cli");const videoAssembly = [- "@svml/prelude-video","@svml/provider-google-vertex","@svml/provider-hyperframes-local","@svml/provider-kie",@@ -120,6 +119,11 @@ test("the generic CLI engine reaches no video Prelude or Endpoint package", asyn"@svml/provider-whisperx-local",];assert.deepEqual(videoAssembly.filter((name) => dependencies.has(name)), []);- assert.ok(transitive(graph, "@svml/video-cli").has("@svml/prelude-video"));- assert.ok(transitive(graph, "@svml/video-cli").has("@svml/cli"));+ const videoDependencies = transitive(graph, "@svml/video-cli");+ assert.ok(!videoDependencies.has("@svml/script"));+ assert.ok(!videoDependencies.has("@svml/seedance-speaker"));+ assert.ok(!videoDependencies.has("@svml/broll"));+ assert.ok(!videoDependencies.has("@svml/text-track"));+ assert.ok(!videoDependencies.has("@svml/film"));+ assert.ok(videoDependencies.has("@svml/cli"));});diff --git a/tsconfig.v2.json b/tsconfig.v2.jsonindex b5f5ef1d..c39f2403 100644--- a/tsconfig.v2.json+++ b/tsconfig.v2.json@@ -30,6 +30,7 @@"@svml/local": ["packages/local/src/index.ts"],"@svml/generation": ["packages/generation/src/index.ts"],"@svml/model-kit": ["packages/model-kit/src/index.ts"],+ "@svml/prompt-kit": ["packages/prompt-kit/src/index.ts"],"@svml/seedance": ["packages/seedance/src/index.ts"],"@svml/minimax-h3": ["packages/minimax-h3/src/index.ts"],"@svml/gemini-omni": ["packages/gemini-omni/src/index.ts"],@@ -56,7 +57,6 @@"@svml/svs": ["packages/svs/src/index.ts"],"@svml/compiler-node": ["packages/compiler-node/src/index.ts"],"@svml/package-loader-node": ["packages/package-loader-node/src/index.ts"],- "@svml/prelude-video": ["packages/prelude-video/src/index.ts"],"@svml/cli": ["packages/cli/src/index.ts"],"@svml/validation": ["packages/validation/src/index.ts"],"@svml/host": ["packages/host/src/index.ts"],