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.

fix: give a component's own surface to the component

rponed56ae439be59
diff --git a/.agents/skills/hypit/references/local-author-package.md b/.agents/skills/hypit/references/local-author-package.md
index 1bcd8a43..1f21b942 100644
--- a/.agents/skills/hypit/references/local-author-package.md
+++ b/.agents/skills/hypit/references/local-author-package.md
@@ -44,6 +44,29 @@ Choose raw versus structured Surface, timing dependencies, ProgramSpace, Frame,
Artifact, Recipe and output Types from the observed behavior and closest package architecture. A
declaration-only or Surface-only package is incomplete.
+## The package draws itself
+
+A package is installed vocabulary. `.svml`, `.svs` and `.svrun` are documents that use it. A package
+that needs one of those documents in order to draw its own appearance has inverted that
+relationship, and the symptom is unmistakable: the component imports cleanly and still shows
+nothing.
+
+- Chrome the component always shows — its paper, board, panel, ruled lines, texture, default
+ backdrop — belongs to the package. Commit it as an ordinary file under the package and read it
+ with `readFile(new URL("../assets/…", import.meta.url))`, the same way the Surface preview image
+ is read. Generate it once while authoring the package if it does not exist.
+- Produce that file outside the graph. Call the image provider's HTTP API directly with the
+ credentials already in the environment, or use any equivalent tool, and save the bytes into the
+ package. A package asset is authoring input, not the output of anybody's video: it is never a
+ Target, never a Record, and never a reason to write a Run Source. Writing one to obtain it is the
+ mistake this section exists to prevent.
+- Only pictures that differ between videos are input ports: photographs, screenshots, thumbnails,
+ product shots, character images.
+- Never require an input the installing project has no reason to choose. If a Run Source exists only
+ to produce the component's own texture, the texture is in the wrong place.
+- A component that cannot render on its own cannot produce the preview image its Surface owes. Treat
+ a missing preview as evidence of this mistake rather than a step to skip.
+
## Install and validate
Reuse an existing workspace when it already includes `packages/*`; otherwise make only the minimal
diff --git a/.agents/skills/hypit/references/playbooks/craft/graphic-compositions.md b/.agents/skills/hypit/references/playbooks/craft/graphic-compositions.md
index fb5875e5..2291bf01 100644
--- a/.agents/skills/hypit/references/playbooks/craft/graphic-compositions.md
+++ b/.agents/skills/hypit/references/playbooks/craft/graphic-compositions.md
@@ -48,8 +48,40 @@ Never bake drawn structure into generated material. A generated picture of text
re-read or corrected, and its wording drifts. A card, inset, phone, browser or screenshot element is
not one picture: its inner picture is material, its frame and entry are structure.
+## A component's own surface belongs to the component
+
+Depicted material divides again, and getting this wrong produces a component that cannot draw
+itself.
+
+- **Component-owned surface** is the chrome a composition always shows: its paper, board, panel,
+ ruled lines, grain, texture, default backdrop. It is part of the component's identity. It ships
+ **inside the package as an ordinary file**, exactly as the package's preview image does, and is
+ read with `readFile(new URL("../assets/…", import.meta.url))`.
+- **Source-supplied material** is content that differs between videos: photographs, screenshots,
+ thumbnails, product shots, character images.
+
+The test is one question: **would two different videos using this component show the same picture
+there?** If yes, it belongs to the package. If they would show different pictures, it is an edge the
+source supplies.
+
+Never make a component's own surface a required input. A component whose chrome arrives from the
+graph cannot render on its own, cannot produce the preview image its Surface owes, and forces every
+project that installs it to obtain a picture that was never theirs to choose. If you find yourself
+writing a Run Source whose only purpose is to produce a component's own texture, the texture is in
+the wrong place: generate it once while authoring the package and commit the file.
+
+Produce that file outside the graph — call the image provider's HTTP API directly, or use any
+equivalent tool, and save the bytes into the package. A package asset is authoring input, not the
+output of anybody's video, so it is never a Target and never a Record.
+
+A package is installed vocabulary. `.svml`, `.svs` and `.svrun` are documents that use it. A package
+that needs one of those documents in order to draw itself has inverted that relationship.
+
## Missing material must be generated
+- Decide first whether the picture is component-owned surface or source-supplied material. A
+ component's own surface is generated once while the package is being authored and committed as a
+ file inside it; the rest of this section is about source-supplied material.
- Source depicted material in this order: material supplied for the task or already in the project;
an Artifact the project already produces; otherwise generation.
- If a required picture does not exist, generating it is mandatory. Do not substitute flat colour, an
diff --git a/.agents/skills/hypit/references/reference-video/vocabulary.md b/.agents/skills/hypit/references/reference-video/vocabulary.md
index a1429da2..fdeb2018 100644
--- a/.agents/skills/hypit/references/reference-video/vocabulary.md
+++ b/.agents/skills/hypit/references/reference-video/vocabulary.md
@@ -49,8 +49,11 @@ just written the package: it proves the specifier resolves, the activation contr
the loader can decode the Surface. `pnpm check` proves none of those, because activation lookups fail
at runtime rather than at compile time.
-The new package owns the whole observed composition, including the surface its elements sit on, and
-consumes missing pictures as material edges rather than generating or embedding them itself.
+The new package owns the whole observed composition. Its own surface — the paper, board, panel or
+texture the composition always shows — is committed inside the package as a file, never demanded
+from the graph. Only pictures that differ between videos are edges the source supplies.
+`../playbooks/craft/graphic-compositions.md` draws that line; a component that cannot draw itself
+without a project document is on the wrong side of it.
Installing the package is not the end of the gap route. Continue into `reconstruction-loop.md`: a
component that loads is not yet a component that looks like the reference.