Skip to content

armgit / hypit

Public Imported from GitHub
0

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.

feat: activate speech take projections

kashorin984753ee4ab1
diff --git a/examples/talking-film-golden/README.md b/examples/talking-film-golden/README.md
index ed09cdb1..da9a8481 100644
--- a/examples/talking-film-golden/README.md
+++ b/examples/talking-film-golden/README.md
@@ -74,7 +74,7 @@ Candidates and Operations.
| `media:Image` | `@svml/media` | content-addressed authored Artifact | package/Surface missing |
| `seedance:Prompt` | `@svml/seedance` | package-private immutable direction value | missing |
| `seedance:Speech model="mini"` | `@svml/seedance` | explicit Seedance Mini Need returning one speech clip Product | missing |
-| `speech:Spine` | `@svml/speech` | ordered clips -> one `SpeechBasis`, then ordinary projections | basis/projections implemented; author assembly missing |
+| `speech:Spine` | `@svml/speech` | ordered clips -> one `SpeechBasis`, then ordinary projections | basis and four locked projection facets implemented; author assembly missing |
| `whisperx:Alignment` | `@svml/whisperx` | 48k speech master -> explicit 16k evidence Need -> WhisperX -> provider-neutral `@svml/speech-align` -> Map | Graph Fragment, local media projection and local Provider adapter implemented; Surface/sidecar packaging missing |
| `seedance:Video model="mini"` | `@svml/seedance` | explicit Seedance Mini video Need | missing |
| `broll:Track` | `@svml/broll` | semantic windows + media + recipe -> peer Visual/Audio Tracks | Program/lowering implemented; Surface missing |
diff --git a/packages/prelude-video/README.md b/packages/prelude-video/README.md
index daad5b4e..e449a660 100644
--- a/packages/prelude-video/README.md
+++ b/packages/prelude-video/README.md
@@ -5,5 +5,9 @@ Manifests, the SVS Frontend, official Text Surfaces and the deterministic comput
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 now carries the complete `@svml/speech-take` Manifest and its four deterministic
+Product projections. A physical package-lock test proves that this dependency is 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.json
index 70ed1bf0..fa61c40c 100644
--- a/packages/prelude-video/package.json
+++ b/packages/prelude-video/package.json
@@ -16,6 +16,7 @@
"@svml/hyperframes-render": "workspace:*",
"@svml/media-pipeline": "workspace:*",
"@svml/script": "workspace:*",
+ "@svml/speech-take": "workspace:*",
"@svml/svs": "workspace:*"
},
"devDependencies": {
diff --git a/packages/prelude-video/src/index.ts b/packages/prelude-video/src/index.ts
index 05796241..beba6a94 100644
--- a/packages/prelude-video/src/index.ts
+++ b/packages/prelude-video/src/index.ts
@@ -30,6 +30,10 @@ import {
scriptModuleRef,
scriptSurfaceImplementationDigest,
} from "@svml/script";
+import {
+ speechTakeComponent,
+ speechTakeManifest,
+} from "@svml/speech-take";
import { svsFrontend, svsManifest } from "@svml/svs";
export const svmlPackage: NodePackageActivation = {
@@ -41,6 +45,7 @@ export const svmlPackage: NodePackageActivation = {
{ manifest: svsManifest },
{ manifest: hyperframesManifest },
{ manifest: mediaPipelineManifest },
+ { manifest: speechTakeManifest },
{ manifest: filmManifest, specifiers: ["@svml/film", "@svml/film@1"] },
{
manifest: hyperframesRenderManifest,
@@ -51,6 +56,7 @@ export const svmlPackage: NodePackageActivation = {
components: [
...videoContractsComponents,
mediaPipelineComponent,
+ speechTakeComponent,
hyperframesComponent,
hyperframesRenderComponent,
],
diff --git a/packages/prelude-video/test/activation.test.ts b/packages/prelude-video/test/activation.test.ts
new file mode 100644
index 00000000..48647604
--- /dev/null
+++ b/packages/prelude-video/test/activation.test.ts
@@ -0,0 +1,51 @@
+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 {
+ createNodePackageLock,
+ loadNodePackages,
+ nodePackageComponents,
+ writeNodePackageLock,
+} from "@svml/package-loader-node";
+import {
+ speechTakeComponent,
+ speechTakeManifest,
+} from "@svml/speech-take";
+
+import { svmlPackage } from "../src/index.js";
+
+test("the official prelude activates SpeechTake compute without teaching the Host its name", () => {
+ const components = nodePackageComponents([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 installed official package lock physically contains SpeechTake 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);
+ await writeNodePackageLock(lockPath, lock);
+ const packages = await loadNodePackages(lockPath, installedRoot);
+ const components = nodePackageComponents(packages);
+ assert.equal(components.some((component) => component.name === "@svml/speech-take"), true);
+ } finally {
+ await rm(directory, { recursive: true, force: true });
+ }
+});
diff --git a/packages/speech-take/README.md b/packages/speech-take/README.md
index a81e2177..44a879aa 100644
--- a/packages/speech-take/README.md
+++ b/packages/speech-take/README.md
@@ -3,9 +3,19 @@
Reference Product/Projection package for an atomic speech take.
`SpeechBasis` is the indivisible Product that binds audio, visual clips, ProgramSpace and
-`basisDigest`. `project-audio` and `project-visual` are ordinary deterministic Producers. Core has no
-Projection primitive and never treats these outputs as ports of one mutable workflow node.
+`basisDigest`. Four ordinary deterministic Producers project it into `ProgramSpace`,
+`SpeechAudioBasis`, `VisualTrack` and `AudioTrack`. Core has no Projection primitive and never treats
+these outputs as ports of one mutable workflow node.
This gives the author several independent Logical Outputs while preserving one shared generation
Operation. Selecting an Existing `SpeechBasis` stops generation and leaves both Projections usable;
selecting only an Existing visual Candidate does not contaminate the independent exact audio path.
+
+`speechTakeComponent` enumerates all four Producer facets. Their identities are checked against the
+static `speechTakeManifest`, enter the installed implementation package lock, and can be activated by
+any compatible compute Host without a Driver or Runtime source change. The component has no Provider,
+Artifact access, queue or credentials.
+
+The package intentionally publishes no Type validators: it does not own any of its input or output
+Types. `@svml/contracts` remains the semantic owner of `SpeechBasis`, `ProgramSpace` and the generic
+Track Types and supplies any owner validators required by those contracts.
diff --git a/packages/speech-take/package.json b/packages/speech-take/package.json
index 2b3fef08..ed940b5d 100644
--- a/packages/speech-take/package.json
+++ b/packages/speech-take/package.json
@@ -7,11 +7,11 @@
".": "./src/index.ts"
},
"dependencies": {
+ "@svml/component-kit": "workspace:*",
"@svml/contracts": "workspace:*",
"@svml/protocol": "workspace:*"
},
"devDependencies": {
- "@svml/component-kit": "workspace:*",
"@svml/core": "workspace:*",
"@svml/driver-node": "workspace:*",
"@svml/validation": "workspace:*"
diff --git a/packages/speech-take/src/component.ts b/packages/speech-take/src/component.ts
new file mode 100644
index 00000000..d11cf40d
--- /dev/null
+++ b/packages/speech-take/src/component.ts
@@ -0,0 +1,82 @@
+import type { ComponentPackage } from "@svml/component-kit";
+import type { SpeechBasis } from "@svml/contracts";
+import type { StoredValue } from "@svml/protocol";
+import { canonicalize } from "@svml/protocol";
+
+import {
+ speechTakeProducers,
+} from "./manifest.js";
+import {
+ projectSpeechAudio,
+ projectSpeechAudioImplementationDigest,
+ projectSpeechAudioTrack,
+ projectSpeechAudioTrackImplementationDigest,
+ projectSpeechProgramSpace,
+ projectSpeechProgramSpaceImplementationDigest,
+ projectSpeechVisual,
+ projectSpeechVisualImplementationDigest,
+} from "./projection.js";
+
+function speechBasis(value: StoredValue | undefined): SpeechBasis {
+ if (value?.kind !== "inline") throw new Error("SpeechBasis must be inline");
+ return value.value as unknown as SpeechBasis;
+}
+
+/** Pure projections of one atomic SpeechBasis; no Artifact read or external capability is hidden here. */
+export const speechTakeComponent = {
+ name: "@svml/speech-take",
+ producers: [
+ {
+ producer: speechTakeProducers.projectProgramSpace,
+ implementationDigest: projectSpeechProgramSpaceImplementationDigest,
+ handler: ({ inputs }) => ({
+ outputs: {
+ programSpace: {
+ kind: "inline",
+ value: canonicalize(projectSpeechProgramSpace(speechBasis(inputs.basis?.value))),
+ },
+ },
+ needs: {},
+ }),
+ },
+ {
+ producer: speechTakeProducers.projectAudio,
+ implementationDigest: projectSpeechAudioImplementationDigest,
+ handler: ({ inputs }) => ({
+ outputs: {
+ audio: {
+ kind: "inline",
+ value: canonicalize(projectSpeechAudio(speechBasis(inputs.basis?.value))),
+ },
+ },
+ needs: {},
+ }),
+ },
+ {
+ producer: speechTakeProducers.projectVisual,
+ implementationDigest: projectSpeechVisualImplementationDigest,
+ handler: ({ inputs }) => ({
+ outputs: {
+ visual: {
+ kind: "inline",
+ value: canonicalize(projectSpeechVisual(speechBasis(inputs.basis?.value))),
+ },
+ },
+ needs: {},
+ }),
+ },
+ {
+ producer: speechTakeProducers.projectAudioTrack,
+ implementationDigest: projectSpeechAudioTrackImplementationDigest,
+ handler: ({ inputs }) => ({
+ outputs: {
+ track: {
+ kind: "inline",
+ value: canonicalize(projectSpeechAudioTrack(speechBasis(inputs.basis?.value))),
+ },
+ },
+ needs: {},
+ }),
+ },
+ ],
+} satisfies ComponentPackage;
diff --git a/packages/speech-take/src/index.ts b/packages/speech-take/src/index.ts
index 36c0cc60..a987390e 100644
--- a/packages/speech-take/src/index.ts
+++ b/packages/speech-take/src/index.ts
@@ -1,3 +1,4 @@
+export { speechTakeComponent } from "./component.js";
export {
speechTakeManifest,
speechTakeManifestDigest,
diff --git a/packages/speech-take/test/product.test.ts b/packages/speech-take/test/product.test.ts
index ae02a073..786d2ccb 100644
--- a/packages/speech-take/test/product.test.ts
+++ b/packages/speech-take/test/product.test.ts
@@ -1,7 +1,10 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { registerTypeValidatorFacets } from "@svml/component-kit";
+import {
+ registerProducerFacets,
+ registerTypeValidatorFacets,
+} from "@svml/component-kit";
import {
compositionContractsComponent,
compositionValidatorDigests,
@@ -34,12 +37,11 @@ import type {
TypeRef,
} from "@svml/protocol";
import {
- projectSpeechAudioImplementationDigest,
projectSpeechAudio,
projectSpeechAudioTrack,
projectSpeechProgramSpace,
- projectSpeechVisualImplementationDigest,
projectSpeechVisual,
+ speechTakeComponent,
speechTakeManifest,
speechTakeProducers,
} from "@svml/speech-take";
@@ -287,6 +289,18 @@ test("SpeechBasis is one Product and audio/visual are ordinary shared projection
);
});
+test("the component enumerates every Manifest-declared SpeechTake projection", () => {
+ const declared = speechTakeManifest.producers.map((producer) => ({
+ name: producer.name,
+ digest: producer.implementation.digest,
+ })).sort((left, right) => left.name.localeCompare(right.name));
+ const implemented = speechTakeComponent.producers.map((facet) => ({
+ name: facet.producer.name,
+ digest: facet.implementationDigest,
+ })).sort((left, right) => left.name.localeCompare(right.name));
+ assert.deepEqual(implemented, declared);
+});
+
test("SpeechBasis projects to peer generic visual and audio Tracks", () => {
const take = sampleTake();
const visual = projectSpeechVisual(take);
@@ -336,30 +350,7 @@ test("the Build Machine executes one shared generation for both projected output
generations += 1;
return { outputs: { take: { kind: "inline", value: sampleTake() } }, needs: {} };
});
- registry.registerProducer(
- speechTakeProducers.projectAudio,
- projectSpeechAudioImplementationDigest,
- ({ inputs }) => {
- const value = inputs.basis?.value;
- assert.equal(value?.kind, "inline");
- return {
- outputs: { audio: { kind: "inline", value: projectSpeechAudio(value.value as unknown as SpeechBasis) } },
- needs: {},
- };
- },
- );
- registry.registerProducer(
- speechTakeProducers.projectVisual,
- projectSpeechVisualImplementationDigest,
- ({ inputs }) => {
- const value = inputs.basis?.value;
- assert.equal(value?.kind, "inline");
- return {
- outputs: { visual: { kind: "inline", value: projectSpeechVisual(value.value as unknown as SpeechBasis) } },
- needs: {},
- };
- },
- );
+ registerProducerFacets(registry, speechTakeComponent.producers);
const result = await new NodeDriver({ registry, validators: validatorRegistry() }).run(
build({ "opening.audio": "exact", "opening.visual": "exact" }),
);
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 350cfbf1..28f932fd 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -470,6 +470,9 @@ importers:
'@svml/script':
specifier: workspace:*
version: link:../script
+ '@svml/speech-take':
+ specifier: workspace:*
+ version: link:../speech-take
'@svml/svs':
specifier: workspace:*
version: link:../svs
@@ -759,6 +762,9 @@ importers:
packages/speech-take:
dependencies:
+ '@svml/component-kit':
+ specifier: workspace:*
+ version: link:../component-kit
'@svml/contracts':
specifier: workspace:*
version: link:../contracts
@@ -766,9 +772,6 @@ importers:
specifier: workspace:*
version: link:../protocol
devDependencies:
- '@svml/component-kit':
- specifier: workspace:*
- version: link:../component-kit
'@svml/core':
specifier: workspace:*
version: link:../core