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
refactor: return optional components to their package owners
kashorin5c96c3812ce9
diff --git a/packages/comment-sticker-studio/README.md b/packages/comment-sticker-studio/README.mddeleted file mode 100644index ff81444c..00000000--- a/packages/comment-sticker-studio/README.md+++ /dev/null@@ -1,3 +0,0 @@-# `@hypit/comment-sticker-studio`--Hypit Studio Companion for `@hypit/comment-sticker`.diff --git a/packages/comment-sticker-studio/package.json b/packages/comment-sticker-studio/package.jsondeleted file mode 100644index 598cd2ff..00000000--- a/packages/comment-sticker-studio/package.json+++ /dev/null@@ -1,14 +0,0 @@-{- "name": "@hypit/comment-sticker-studio",- "version": "0.0.0-dev",- "license": "SEE LICENSE IN LICENSE",- "private": true,- "type": "module",- "exports": { ".": "./src/index.ts" },- "hypit": { "activation": "./src/activation.ts" },- "dependencies": {- "@hypit/comment-sticker": "workspace:*",- "@hypit/composition": "workspace:*",- "@hypit/studio-adapter": "workspace:*"- }-}diff --git a/packages/comment-sticker-studio/src/activation.ts b/packages/comment-sticker-studio/src/activation.tsdeleted file mode 100644index 018fdf64..00000000--- a/packages/comment-sticker-studio/src/activation.ts+++ /dev/null@@ -1,7 +0,0 @@-import { createStudioTrackCompanionHostFacet } from "@hypit/studio-adapter";-import { commentStickerStudioTrackCompanions } from "./index.js";--export default {- format: "hypit.node-package@1" as const,- hostFacets: [createStudioTrackCompanionHostFacet(commentStickerStudioTrackCompanions)],-};diff --git a/packages/comment-sticker/README.md b/packages/comment-sticker/README.mdindex 2a364b89..7e05856d 100644--- a/packages/comment-sticker/README.md+++ b/packages/comment-sticker/README.md@@ -39,3 +39,6 @@ ordinary graph `Text` references; `comment={...}` is exclusive with body text. Tone package-owned content value through explicit Text edges before temporal placement. `avatar` isan independent Artifact edge. Metadata is never fabricated: if `meta` is absent, no metadata rowis rendered. Sound effects remain a separate Audio Track.++The same installed package contributes its Studio Companion. Runtime behavior and editor projection+therefore share one owner and version; there is no separate Studio package to install.diff --git a/packages/comment-sticker/package.json b/packages/comment-sticker/package.jsonindex 2a6fbb15..62eb228b 100644--- a/packages/comment-sticker/package.json+++ b/packages/comment-sticker/package.json@@ -5,27 +5,33 @@"private": true,"type": "module","exports": {- ".": "./src/index.ts"+ ".": "./src/index.ts",+ "./studio": "./src/studio.ts"},+ "files": [+ "dist",+ "preview",+ "README.md"+ ],"hypit": {"activation": "./src/activation.ts"},- "dependencies": {- "@hypit/artifact": "workspace:*",- "@hypit/component-kit": "workspace:*",- "@hypit/composition": "workspace:*",- "@hypit/elaborator": "workspace:*",+ "peerDependencies": {+ "@hypit/hypit": "workspace:^",+ "@hypit/studio-companion": "workspace:^"+ },+ "devDependencies": {+ "@hypit/blob": "workspace:*",+ "@hypit/html-program": "workspace:*",+ "@hypit/hypit": "workspace:*",+ "@hypit/studio-companion": "workspace:*",+ "@hypit/markup": "workspace:*","@hypit/media": "workspace:*",- "@hypit/protocol": "workspace:*",- "@hypit/timeline": "workspace:*","@hypit/spatial": "workspace:*",- "@hypit/svs": "workspace:*",+ "@hypit/recipe": "workspace:*","@hypit/temporal": "workspace:*",- "@hypit/temporal-markup": "workspace:*","@hypit/text": "workspace:*",- "@hypit/markup": "workspace:*"- },- "devDependencies": {- "@hypit/hyperframes": "workspace:*"+ "@hypit/timeline": "workspace:*",+ "typescript": "5.9.3"}}diff --git a/packages/comment-sticker/src/activation.ts b/packages/comment-sticker/src/activation.tsindex e932d657..08810f58 100644--- a/packages/comment-sticker/src/activation.ts+++ b/packages/comment-sticker/src/activation.ts@@ -1,4 +1,7 @@-import { createMarkupSurfaceHostFacet } from "@hypit/markup";+import { createAdmissionPackageFacet } from "@hypit/hypit/admission";+import { createProducerPackageFacet } from "@hypit/hypit/producer";+import { createMarkupSurfaceFacet } from "@hypit/hypit/markup";+import { createStudioTrackCompanionFacet } from "@hypit/studio-companion";import {commentStickerComponent,@@ -8,24 +11,26 @@ import {decodeCommentStickerTrackSurface,commentStickerMarkupSurfaces,} from "./index.js";+import { commentStickerStudioTrackCompanions } from "./studio.js";export const hypitPackage = {- format: "hypit.node-package@1" as const,+ format: "hypit.package@1" as const,modules: [{manifest: commentStickerManifest,}],- components: [commentStickerComponent],- hostFacets: [- createMarkupSurfaceHostFacet({+ facets: [+ ...[commentStickerComponent].flatMap((component) => [createProducerPackageFacet(component), createAdmissionPackageFacet(component)]),+ createMarkupSurfaceFacet({module: commentStickerModuleRef,declaration: commentStickerMarkupSurfaces.find((item) => item.name === "style")!,handler: decodeCommentStickerStyleSurface,}),- createMarkupSurfaceHostFacet({+ createMarkupSurfaceFacet({module: commentStickerModuleRef,declaration: commentStickerMarkupSurfaces.find((item) => item.name === "track")!,handler: decodeCommentStickerTrackSurface,}),+ createStudioTrackCompanionFacet(commentStickerStudioTrackCompanions),],};diff --git a/packages/comment-sticker/src/author.ts b/packages/comment-sticker/src/author.tsindex 70c7c741..46ff4088 100644--- a/packages/comment-sticker/src/author.ts+++ b/packages/comment-sticker/src/author.ts@@ -1,6 +1,6 @@-import { assertFontStackRef } from "@hypit/media";-import type { FontStackRef } from "@hypit/media";-import type { SvsRecipe } from "@hypit/svs";+import { assertFontStackRef } from "@hypit/hypit/media";+import type { FontStackRef } from "@hypit/hypit/media";+import type { Recipe } from "@hypit/hypit/recipe";import { sealCommentStickerStyle } from "./program.js";import type { CommentStickerStyle, CommentStickerTextStyle } from "./types.js";@@ -19,53 +19,53 @@ const KEYS = new Set(["hold", "hold-amplitude-y", "hold-rotation-amplitude", "hold-period-frames",]);-function fail(recipe: SvsRecipe, message: string): never {+function fail(recipe: Recipe, message: string): never {throw new Error(`Comment Sticker Recipe ${recipe.path} ${message}`);}-function optionalNumber(recipe: SvsRecipe, name: string): number | undefined {+function optionalNumber(recipe: Recipe, name: string): number | undefined {const value = recipe.properties[name];if (value === undefined) return undefined;if (typeof value !== "number" || !Number.isFinite(value)) fail(recipe, `${name} must be a finite number.`);return value;}-function number(recipe: SvsRecipe, name: string, fallback: number): number {+function number(recipe: Recipe, name: string, fallback: number): number {return optionalNumber(recipe, name) ?? fallback;}-function integer(recipe: SvsRecipe, name: string, fallback: number): number {+function integer(recipe: Recipe, name: string, fallback: number): number {const value = number(recipe, name, fallback);if (!Number.isSafeInteger(value)) fail(recipe, `${name} must be an integer.`);return value;}-function optionalString(recipe: SvsRecipe, name: string): string | undefined {+function optionalString(recipe: Recipe, name: string): string | undefined {const value = recipe.properties[name];if (value === undefined) return undefined;if (typeof value !== "string" || value.trim().length === 0) fail(recipe, `${name} must be text.`);return value.trim();}-function string(recipe: SvsRecipe, name: string, fallback: string): string {+function string(recipe: Recipe, name: string, fallback: string): string {return optionalString(recipe, name) ?? fallback;}-function boolean(recipe: SvsRecipe, name: string, fallback: boolean): boolean {+function boolean(recipe: Recipe, name: string, fallback: boolean): boolean {const value = recipe.properties[name];if (value === undefined) return fallback;if (typeof value !== "boolean") fail(recipe, `${name} must be boolean.`);return value;}-function oneOf<const T extends string>(recipe: SvsRecipe, name: string, values: readonly T[], fallback: T): T {+function oneOf<const T extends string>(recipe: Recipe, name: string, values: readonly T[], fallback: T): T {const value = string(recipe, name, fallback);if (!values.includes(value as T)) fail(recipe, `${name} must be ${values.join(" | ")}.`);return value as T;}function typography(- recipe: SvsRecipe,+ recipe: Recipe,fonts: FontStackRef,prefix: "header" | "body" | "meta",defaults: Omit<CommentStickerTextStyle, "fonts">,@@ -79,7 +79,7 @@ function typography(};}-export function decodeCommentStickerStyle(recipe: SvsRecipe, fonts: FontStackRef, id: string): CommentStickerStyle {+export function decodeCommentStickerStyle(recipe: Recipe, fonts: FontStackRef, id: string): CommentStickerStyle {assertFontStackRef(fonts, "Comment Sticker font stack");const unknown = Object.keys(recipe.properties).filter((key) => !KEYS.has(key));if (unknown.length > 0) fail(recipe, `does not accept ${unknown.join(", ")}.`);diff --git a/packages/comment-sticker/src/component.ts b/packages/comment-sticker/src/component.tsindex 05a32db9..e10506fe 100644--- a/packages/comment-sticker/src/component.ts+++ b/packages/comment-sticker/src/component.ts@@ -1,9 +1,10 @@-import type { Timeline } from "@hypit/timeline";-import type { ComponentPackage, ProducerHandlerContext } from "@hypit/component-kit";-import { canonicalize } from "@hypit/protocol";-import type { BlobRef, StoredValue } from "@hypit/protocol";-import type { SpatialFrame } from "@hypit/spatial";-import type { Text } from "@hypit/text";+import type { Timeline } from "@hypit/hypit/timeline";+import type { ProducerPackage, ProducerHandlerContext } from "@hypit/hypit/producer";+import type { AdmissionPackage } from "@hypit/hypit/admission";+import { canonicalize } from "@hypit/hypit/protocol";+import type { BlobRef, StoredValue } from "@hypit/hypit/protocol";+import type { SpatialFrame } from "@hypit/hypit/spatial";+import type { Text } from "@hypit/hypit/text";import { commentStickerProducers, commentStickerTypes } from "./manifest.js";import { appendProjectedCommentSticker, assertCommentStickerProgram, createCommentStickerSet, createCommentStickerContent, setCommentStickerContentText, finalizeCommentSticker, renderCommentSticker } from "./program.js";@@ -15,7 +16,7 @@ import type {CommentStickerSet,CommentStickerStyle,} from "./types.js";-import type { TemporalWindow } from "@hypit/temporal";+import type { TemporalWindow } from "@hypit/hypit/temporal";function inline<T>(value: StoredValue | undefined, label: string): T {if (value?.kind !== "inline") throw new Error(`${label} must be inline.`);@@ -93,4 +94,4 @@ export const commentStickerComponent = {type: commentStickerTypes.program,handler: ({ value }) => assertCommentStickerProgram(inline<CommentStickerProgram>(value, "CommentStickerProgram")),}],-} satisfies ComponentPackage;+} satisfies ProducerPackage & AdmissionPackage;diff --git a/packages/comment-sticker/src/fragment.ts b/packages/comment-sticker/src/fragment.tsindex 0c01908a..bfe090f1 100644--- a/packages/comment-sticker/src/fragment.ts+++ b/packages/comment-sticker/src/fragment.ts@@ -1,13 +1,13 @@-import { timelineTypes } from "@hypit/timeline";+import { timelineTypes } from "@hypit/hypit/timeline";-import { artifactTypes } from "@hypit/artifact";-import { compositionTypes } from "@hypit/composition";-import { sealGraphFragment } from "@hypit/elaborator";-import type { FragmentOperation } from "@hypit/elaborator";-import type { TypeRef } from "@hypit/protocol";-import { spatialTypes } from "@hypit/spatial";-import { textTypes } from "@hypit/text";-import { temporalTypes } from "@hypit/temporal";+import { blobTypes } from "@hypit/hypit/blob";+import { compositionTypes } from "@hypit/hypit/composition";+import { sealGraphFragment } from "@hypit/hypit/author";+import type { FragmentOperation } from "@hypit/hypit/author";+import type { TypeRef } from "@hypit/hypit/protocol";+import { spatialTypes } from "@hypit/hypit/spatial";+import { textTypes } from "@hypit/hypit/text";+import { temporalTypes } from "@hypit/hypit/temporal";import { commentStickerProducers, commentStickerTypes } from "./manifest.js";@@ -51,7 +51,7 @@ export function createCommentStickerFragment(items: readonly CommentStickerFragmif (item.authorName !== undefined) types.set(item.authorName, textTypes.text);if (item.headerTextName !== undefined) types.set(item.headerTextName, textTypes.text);if (item.metaName !== undefined) types.set(item.metaName, textTypes.text);- if (item.avatarName !== undefined) types.set(item.avatarName, artifactTypes.blob);+ if (item.avatarName !== undefined) types.set(item.avatarName, blobTypes.blob);const suffix = String(index + 1).padStart(4, "0");const createContentId = `comment:content:${suffix}:create`;operations.push({diff --git a/packages/comment-sticker/src/manifest.ts b/packages/comment-sticker/src/manifest.tsindex 4c24ce0d..7d9286e2 100644--- a/packages/comment-sticker/src/manifest.ts+++ b/packages/comment-sticker/src/manifest.ts@@ -1,17 +1,17 @@-import { timelineTypes, timelineDependency } from "@hypit/timeline";-import { temporalContextAttributeVocabulary } from "@hypit/temporal-markup";+import { timelineTypes, timelineDependency } from "@hypit/hypit/timeline";+import { temporalContextAttributeVocabulary } from "@hypit/hypit/temporal/markup";import { readFile } from "node:fs/promises";-import { artifactDependency, artifactTypes } from "@hypit/artifact";-import { compositionDependency, compositionTypes } from "@hypit/composition";-import { fontArtifactSchema, mediaDependency, mediaTypes } from "@hypit/media";+import { blobDependency, blobTypes } from "@hypit/hypit/blob";+import { compositionDependency, compositionTypes } from "@hypit/hypit/composition";+import { fontArtifactSchema, mediaDependency, mediaTypes } from "@hypit/hypit/media";-import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/protocol";-import { spatialDependency, spatialFrameSchema, spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";-import { temporalDependency, temporalTypes } from "@hypit/temporal";-import { temporalWindowAttributeVocabulary } from "@hypit/temporal-markup";-import { textDependency, textTypes } from "@hypit/text";+import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/hypit/protocol";+import { spatialDependency, spatialFrameSchema, spatialTypes } from "@hypit/hypit/spatial";+import { recipeType } from "@hypit/hypit/recipe";+import { temporalDependency, temporalTypes } from "@hypit/hypit/temporal";+import { temporalWindowAttributeVocabulary } from "@hypit/hypit/temporal/markup";+import { textDependency, textTypes } from "@hypit/hypit/text";const previewImage = (file: string) => ({mediaType: "image/png",@@ -146,7 +146,7 @@ export const commentStickerMarkupSurfaces = [attributes: [{ name: "id", kind: "identifier", required: true,summary: "Names the Style so a Sticker can reference it." },- { name: "recipe", kind: "reference", required: true, accepts: [svsRecipeType],+ { name: "recipe", kind: "reference", required: true, accepts: [recipeType],summary: "Chooses the Recipe that decides the card's appearance and its enter, hold and exit motion.",recipe: [{ name: "stack-order", required: false, fallback: "62",@@ -294,7 +294,7 @@ export const commentStickerMarkupSurfaces = [summary: "Supplies the card's header row." },{ name: "meta", kind: "expression", required: false, accepts: [textTypes.text],summary: "Supplies the card's metadata row, which is not rendered when it is absent." },- { name: "avatar", kind: "reference", required: false, accepts: [artifactTypes.blob],+ { name: "avatar", kind: "reference", required: false, accepts: [blobTypes.blob],summary: "Supplies the image Artifact drawn as the commenter's avatar." },...temporalWindowAttributeVocabulary,],@@ -331,7 +331,7 @@ export const commentStickerManifest: ModuleManifest = {format: "hypit.module@1",name: commentStickerModuleRef.name,version: commentStickerModuleRef.version,- dependencies: [artifactDependency, timelineDependency, spatialDependency, temporalDependency, mediaDependency, compositionDependency, textDependency],+ dependencies: [blobDependency, timelineDependency, spatialDependency, temporalDependency, mediaDependency, compositionDependency, textDependency],types: [{ name: commentStickerTypes.header.name },{ name: commentStickerTypes.style.name },@@ -355,7 +355,7 @@ export const commentStickerManifest: ModuleManifest = {{ name: commentStickerProducers.createSet.name, inputs: [], outputs: [{ name: "set", type: commentStickerTypes.set }], needs: [] },...([[commentStickerProducers.appendItem, []],- [commentStickerProducers.appendItemAvatar, [{ name: "avatar", type: artifactTypes.blob }]],+ [commentStickerProducers.appendItemAvatar, [{ name: "avatar", type: blobTypes.blob }]],] as const).map(([producer, extra]) => ({name: producer.name,inputs: [...appendInputs, ...extra],diff --git a/packages/comment-sticker/src/program.ts b/packages/comment-sticker/src/program.tsindex 25509cc3..9ea50666 100644--- a/packages/comment-sticker/src/program.ts+++ b/packages/comment-sticker/src/program.ts@@ -1,9 +1,9 @@-import { assertTimelineIdentity } from "@hypit/timeline";-import type { Timeline } from "@hypit/timeline";+import { assertTimelineIdentity } from "@hypit/hypit/timeline";+import type { Timeline } from "@hypit/hypit/timeline";import {assertVisualTrackIdentity,sealVisualTrack,-} from "@hypit/composition";+} from "@hypit/hypit/composition";import type {VisualAnimation,VisualElement,@@ -11,16 +11,16 @@ import type {VisualTextFlow,VisualTextTypography,VisualTrack,-} from "@hypit/composition";-import { assertFontArtifactRef } from "@hypit/media";-import { canonicalize, isResourceId } from "@hypit/protocol";-import type { BlobRef } from "@hypit/protocol";-import { assertSpatialFrame } from "@hypit/spatial";-import type { SpatialFrame } from "@hypit/spatial";-import { assertTemporalWindowFor } from "@hypit/temporal";-import type { TemporalWindow } from "@hypit/temporal";-import { verifyText } from "@hypit/text";-import type { Text } from "@hypit/text";+} from "@hypit/hypit/composition";+import { assertFontArtifactRef } from "@hypit/hypit/media";+import { canonicalize, isResourceId } from "@hypit/hypit/protocol";+import type { BlobRef } from "@hypit/hypit/protocol";+import { assertSpatialFrame } from "@hypit/hypit/spatial";+import type { SpatialFrame } from "@hypit/hypit/spatial";+import { assertTemporalWindowFor } from "@hypit/hypit/temporal";+import type { TemporalWindow } from "@hypit/hypit/temporal";+import { verifyText } from "@hypit/hypit/text";+import type { Text } from "@hypit/hypit/text";import type {CommentStickerContent,diff --git a/packages/comment-sticker-studio/src/index.ts b/packages/comment-sticker/src/studio.tssimilarity index 96%rename from packages/comment-sticker-studio/src/index.tsrename to packages/comment-sticker/src/studio.tsindex e6728c7f..a8aaba9f 100644--- a/packages/comment-sticker-studio/src/index.ts+++ b/packages/comment-sticker/src/studio.ts@@ -1,8 +1,8 @@-import { commentStickerMarkupSurfaces, commentStickerModuleRef, commentStickerTypes } from "@hypit/comment-sticker";-import type { CommentStickerProgram } from "@hypit/comment-sticker";-import { compositionTypes } from "@hypit/composition";-import type { StudioTrackCompanion, StudioTrackCompanionContext, StudioEntityDraft, StudioInspectorFieldDeclaration, StudioSourceBindingDeclaration } from "@hypit/studio-adapter";-import { artifactPreview, childEntities, previewLayer, requiredSurfaceValue, temporalLineageFor, temporalDomainSource, textLayer } from "@hypit/studio-adapter";+import { commentStickerMarkupSurfaces, commentStickerModuleRef, commentStickerTypes } from "./index.js";+import type { CommentStickerProgram } from "./index.js";+import { compositionTypes } from "@hypit/hypit/composition";+import type { StudioTrackCompanion, StudioTrackCompanionContext, StudioEntityDraft, StudioInspectorFieldDeclaration, StudioSourceBindingDeclaration } from "@hypit/studio-companion";+import { artifactPreview, childEntities, previewLayer, requiredSurfaceValue, temporalLineageFor, temporalDomainSource, textLayer } from "@hypit/studio-companion";const frameParameters: readonly StudioSourceBindingDeclaration[] = [{ name: "within" },diff --git a/packages/comment-sticker/src/surface.ts b/packages/comment-sticker/src/surface.tsindex f248439e..0997e841 100644--- a/packages/comment-sticker/src/surface.ts+++ b/packages/comment-sticker/src/surface.ts@@ -1,20 +1,13 @@-import { resolveTemporalContext } from "@hypit/temporal-markup";-import { artifactTypes } from "@hypit/artifact";-import { mediaTypes } from "@hypit/media";-import type { FontStackRef } from "@hypit/media";-import { spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";-import type { SvsRecipe } from "@hypit/svs";-import { sealText, textTypes } from "@hypit/text";-import type {- StructuredElement,- StructuredSurfaceHandler,- SurfaceComponentDraft,- SurfaceRecordDraft,- SurfaceResolvedReference,- MarkupAttributeValue,-} from "@hypit/markup";-import { createTemporalWindowConstruction, temporalWindowAttributeNames } from "@hypit/temporal-markup";+import { resolveTemporalContext } from "@hypit/hypit/temporal/markup";+import { blobTypes } from "@hypit/hypit/blob";+import { mediaTypes } from "@hypit/hypit/media";+import type { FontStackRef } from "@hypit/hypit/media";+import { spatialTypes } from "@hypit/hypit/spatial";+import { recipeType } from "@hypit/hypit/recipe";+import type { Recipe } from "@hypit/hypit/recipe";+import { sealText, textTypes } from "@hypit/hypit/text";+import type { StructuredElement, StructuredSurfaceHandler, SurfaceComponentDraft, SurfaceRecordDraft, SurfaceResolvedReference, MarkupAttributeValue } from "@hypit/hypit/markup";+import { createTemporalWindowConstruction, temporalWindowAttributeNames } from "@hypit/hypit/temporal/markup";import { decodeCommentStickerStyle } from "./author.js";import { createCommentStickerFragment } from "./fragment.js";@@ -81,9 +74,9 @@ export const decodeCommentStickerStyleSurface: StructuredSurfaceHandler = ({ eleallowed(element, ["id", "recipe", "font"], ["id", "recipe", "font"]);if (element.children.some((child) => child.kind === "element" || child.value.trim())) throw new Error(`${element.name} must be empty.`);const id = text(element, "id");- const recipeRef = reference(element.attributes.recipe, `${element.name}.recipe`, svsRecipeType, resolveReference);+ const recipeRef = reference(element.attributes.recipe, `${element.name}.recipe`, recipeType, resolveReference);const fontRef = reference(element.attributes.font, `${element.name}.font`, mediaTypes.fontStack, resolveReference);- const style = decodeCommentStickerStyle(inline<SvsRecipe>(recipeRef, `${element.name}.recipe`), inline<FontStackRef>(fontRef, `${element.name}.font`), id);+ const style = decodeCommentStickerStyle(inline<Recipe>(recipeRef, `${element.name}.recipe`), inline<FontStackRef>(fontRef, `${element.name}.font`), id);return { records: [{ id, type: commentStickerTypes.style, value: { kind: "inline", value: style }, range: element.range }], components: [], fragments: [] };};@@ -116,7 +109,7 @@ export const decodeCommentStickerTrackSurface: StructuredSurfaceHandler = ({ eleconst suffix = String(items.length + 1).padStart(4, "0");const frame = reference(child.attributes.frame, `${child.name}.frame`, spatialTypes.frame, resolveReference);const style = reference(child.attributes.style, `${child.name}.style`, commentStickerTypes.style, resolveReference);- const avatar = child.attributes.avatar === undefined ? undefined : reference(child.attributes.avatar, `${child.name}.avatar`, artifactTypes.blob, resolveReference);+ const avatar = child.attributes.avatar === undefined ? undefined : reference(child.attributes.avatar, `${child.name}.avatar`, blobTypes.blob, resolveReference);const comment = child.attributes.comment === undefined? dedent(child.children.map((node) => node.kind === "text" ? node.value : "").join("")): graphText(child.attributes.comment, `${child.name}.comment`, resolveReference);diff --git a/packages/comment-sticker/src/types.ts b/packages/comment-sticker/src/types.tsindex efdeacd6..47298a89 100644--- a/packages/comment-sticker/src/types.ts+++ b/packages/comment-sticker/src/types.ts@@ -1,7 +1,7 @@-import type { FrameSpan } from "@hypit/composition";-import type { FontArtifactRef } from "@hypit/media";-import type { BlobRef } from "@hypit/protocol";-import type { SpatialFrame } from "@hypit/spatial";+import type { FrameSpan } from "@hypit/hypit/composition";+import type { FontArtifactRef } from "@hypit/hypit/media";+import type { BlobRef } from "@hypit/hypit/protocol";+import type { SpatialFrame } from "@hypit/hypit/spatial";export type CommentStickerTextStyle = {readonly fonts: readonly FontArtifactRef[];diff --git a/packages/comment-sticker/test/comment-sticker.test.ts b/packages/comment-sticker/test/comment-sticker.test.tsindex 69c294e4..5a64c071 100644--- a/packages/comment-sticker/test/comment-sticker.test.ts+++ b/packages/comment-sticker/test/comment-sticker.test.ts@@ -5,13 +5,13 @@ import { fixtureResource } from "../../../test/fixture-resource.js";import { timelineFixture } from "../../../test/timeline-fixture.js";import { projectProgramWindow } from "../../../test/temporal-fixture.js";-import { artifactTypes } from "@hypit/artifact";-import { compileHyperframesDocument } from "@hypit/hyperframes";+import { blobTypes } from "@hypit/blob";+import { compileHtmlProgram } from "@hypit/html-program";import type { FontArtifactRef, FontStackRef } from "@hypit/media";import { mediaTypes } from "@hypit/media";import { spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";-import type { SvsRecipe } from "@hypit/svs";+import { recipeType } from "@hypit/recipe";+import type { Recipe } from "@hypit/recipe";import { parseStructuredElement } from "@hypit/markup";import type { SurfaceResolvedReference } from "@hypit/markup";import { sealText } from "@hypit/text";@@ -40,7 +40,7 @@ const font: FontArtifactRef = {style: "normal",};const fonts: FontStackRef = { faces: [font] };-const recipe: SvsRecipe = {+const recipe: Recipe = {path: "comment.social",properties: { "avatar-fallback": "initial", "body-max-lines": 4 },@@ -90,7 +90,7 @@ test("explicit metadata is rendered and the terminal compiler accepts the Trackconst meta = rendered.presents[0]?.elements.find((element) => element.id === "meta");assert.equal(meta?.kind === "text-flow" ? meta.document.paragraphs[0]?.inlines[0]?.kind === "text"? meta.document.paragraphs[0].inlines[0].text : undefined : undefined, "Featured comment");- const document = compileHyperframesDocument({+ const document = compileHtmlProgram({id: "comment-film",canvas: { width: 1080, height: 1920, clearColor: "#000000" },tracks: [rendered],@@ -151,7 +151,7 @@ const noAsset = () => { throw new Error("No assets are resolved by this test.");test("Style Surface consumes an explicit SVS Recipe and exact Font Stack", async () => {const refs = new Map([- ["styles.comment", authored("styles.comment", svsRecipeType, recipe)],+ ["styles.comment", authored("styles.comment", recipeType, recipe)],["fonts.ui", authored("fonts.ui", mediaTypes.fontStack, fonts)],]);const result = await decodeCommentStickerStyleSurface({@@ -170,7 +170,7 @@ test("Track Surface lowers mixed literal and resolved-Window Stickers to a finit["video.timeline", authored("video.timeline", timelineTypes.timeline, semantic)],["layout.comment", authored("layout.comment", spatialTypes.frame, frame)],["social", authored("social", commentStickerTypes.style, style)],- ["avatar", authored("avatar", artifactTypes.blob, blob)],+ ["avatar", authored("avatar", blobTypes.blob, blob)],["copy", authored("copy", textTypes.text, sealText("This is graph-supplied comment content."))],]);const result = await decodeCommentStickerTrackSurface({diff --git a/packages/depth-stack-studio/README.md b/packages/depth-stack-studio/README.mddeleted file mode 100644index 85ab9a72..00000000--- a/packages/depth-stack-studio/README.md+++ /dev/null@@ -1,3 +0,0 @@-# `@hypit/depth-stack-studio`--Hypit Studio Companion for `@hypit/depth-stack`.diff --git a/packages/depth-stack-studio/package.json b/packages/depth-stack-studio/package.jsondeleted file mode 100644index a5814b0d..00000000--- a/packages/depth-stack-studio/package.json+++ /dev/null@@ -1,14 +0,0 @@-{- "name": "@hypit/depth-stack-studio",- "version": "0.0.0-dev",- "license": "SEE LICENSE IN LICENSE",- "private": true,- "type": "module",- "exports": { ".": "./src/index.ts" },- "hypit": { "activation": "./src/activation.ts" },- "dependencies": {- "@hypit/depth-stack": "workspace:*",- "@hypit/composition": "workspace:*",- "@hypit/studio-adapter": "workspace:*"- }-}diff --git a/packages/depth-stack-studio/src/activation.ts b/packages/depth-stack-studio/src/activation.tsdeleted file mode 100644index 7d4b4d93..00000000--- a/packages/depth-stack-studio/src/activation.ts+++ /dev/null@@ -1,7 +0,0 @@-import { createStudioTrackCompanionHostFacet } from "@hypit/studio-adapter";-import { deckTrackStudioTrackCompanions } from "./index.js";--export default {- format: "hypit.node-package@1" as const,- hostFacets: [createStudioTrackCompanionHostFacet(deckTrackStudioTrackCompanions)],-};diff --git a/packages/depth-stack/README.md b/packages/depth-stack/README.mdindex 197e385d..edc3f5dc 100644--- a/packages/depth-stack/README.md+++ b/packages/depth-stack/README.md@@ -48,4 +48,8 @@ one normal edge; it never reads filenames, URLs or hidden media metadata.The package has no Provider, Need, queue, credential, global z band or cross-Track input. AnotherDeck family can install independently and lower to the same terminal `VisualTrack` without changing-this package, Core, Film, Composition or HyperFrames.+this package, Core, Film, Composition or the `HtmlProgram`.++The package also owns its Studio companion and publishes it from `@hypit/depth-stack/studio`.+Studio observes the same card behavior, activation instants and appearance recipe; it is not a+separately selected or versioned product.diff --git a/packages/depth-stack/package.json b/packages/depth-stack/package.jsonindex 15d7a06e..c3624820 100644--- a/packages/depth-stack/package.json+++ b/packages/depth-stack/package.json@@ -5,29 +5,41 @@"private": true,"type": "module","exports": {- ".": "./src/index.ts"+ ".": "./src/index.ts",+ "./studio": "./src/studio.ts"},+ "files": [+ "dist",+ "preview",+ "README.md"+ ],"hypit": {"activation": "./src/activation.ts"},"dependencies": {- "@hypit/artifact": "workspace:*",- "@hypit/component-kit": "workspace:*",+ "@hypit/visual-track": "workspace:^"+ },+ "peerDependencies": {+ "@hypit/hypit": "workspace:^",+ "@hypit/studio-companion": "workspace:^"+ },+ "devDependencies": {+ "@hypit/blob": "workspace:*",+ "@hypit/producer": "workspace:*","@hypit/composition": "workspace:*",- "@hypit/elaborator": "workspace:*",+ "@hypit/author": "workspace:*","@hypit/media": "workspace:*",- "@hypit/visual-track": "workspace:*","@hypit/protocol": "workspace:*","@hypit/timeline": "workspace:*","@hypit/spatial": "workspace:*",- "@hypit/svs": "workspace:*",+ "@hypit/recipe": "workspace:*","@hypit/temporal": "workspace:*",- "@hypit/temporal-markup": "workspace:*","@hypit/text": "workspace:*",- "@hypit/markup": "workspace:*"- },- "devDependencies": {- "@hypit/core": "workspace:*",- "@hypit/media-pipeline": "workspace:*"+ "@hypit/markup": "workspace:*",+ "@hypit/kernel": "workspace:*",+ "@hypit/hypit": "workspace:*",+ "@hypit/media-operations": "workspace:*",+ "@hypit/studio-companion": "workspace:*",+ "typescript": "5.9.3"}}diff --git a/packages/depth-stack/src/activation.ts b/packages/depth-stack/src/activation.tsindex ce4af7ca..6a391b04 100644--- a/packages/depth-stack/src/activation.ts+++ b/packages/depth-stack/src/activation.ts@@ -1,4 +1,7 @@-import { createMarkupSurfaceHostFacet } from "@hypit/markup";+import { createAdmissionPackageFacet } from "@hypit/hypit/admission";+import { createProducerPackageFacet } from "@hypit/hypit/producer";+import { createMarkupSurfaceFacet } from "@hypit/hypit/markup";+import { createStudioTrackCompanionFacet } from "@hypit/studio-companion";import {decodeDepthStackLabelSurface,@@ -8,24 +11,26 @@ import {depthStackModuleRef,depthStackMarkupSurfaces,} from "./index.js";+import { depthStackStudioTrackCompanions } from "./studio.js";export const hypitPackage = {- format: "hypit.node-package@1" as const,+ format: "hypit.package@1" as const,modules: [{manifest: depthStackManifest,}],- components: [depthStackComponent],- hostFacets: [- createMarkupSurfaceHostFacet({+ facets: [+ ...[depthStackComponent].flatMap((component) => [createProducerPackageFacet(component), createAdmissionPackageFacet(component)]),+ createMarkupSurfaceFacet({module: depthStackModuleRef,declaration: depthStackMarkupSurfaces.find((item) => item.name === "label")!,handler: decodeDepthStackLabelSurface,}),- createMarkupSurfaceHostFacet({+ createMarkupSurfaceFacet({module: depthStackModuleRef,declaration: depthStackMarkupSurfaces.find((item) => item.name === "track")!,handler: decodeDepthStackSurface,}),+ createStudioTrackCompanionFacet(depthStackStudioTrackCompanions),],};diff --git a/packages/depth-stack/src/author.ts b/packages/depth-stack/src/author.tsindex 1ec285bb..fdce5fb2 100644--- a/packages/depth-stack/src/author.ts+++ b/packages/depth-stack/src/author.ts@@ -9,8 +9,8 @@ import type {MediaPaintLayerSpec,MediaSampleLayerSpec,} from "@hypit/visual-track";-import type { ContentFit } from "@hypit/spatial";-import type { SvsRecipe } from "@hypit/svs";+import type { ContentFit } from "@hypit/hypit/spatial";+import type { Recipe } from "@hypit/hypit/recipe";import {sealDepthStackCardSpec,@@ -37,28 +37,28 @@ const DECK_KEYS = ["stack-order",] as const;-function fail(recipe: SvsRecipe, message: string): never {+function fail(recipe: Recipe, message: string): never {throw new Error(`DepthStack Recipe ${recipe.path} ${message}`);}-function optionalNumber(recipe: SvsRecipe, name: string): number | undefined {+function optionalNumber(recipe: Recipe, name: string): number | undefined {const value = recipe.properties[name];if (value === undefined) return undefined;if (typeof value !== "number" || !Number.isFinite(value)) fail(recipe, `${name} must be a finite number.`);return value;}-function number(recipe: SvsRecipe, name: string, fallback: number): number {+function number(recipe: Recipe, name: string, fallback: number): number {return optionalNumber(recipe, name) ?? fallback;}-function integer(recipe: SvsRecipe, name: string, fallback: number): number {+function integer(recipe: Recipe, name: string, fallback: number): number {const value = number(recipe, name, fallback);if (!Number.isSafeInteger(value)) fail(recipe, `${name} must be an integer.`);return value;}-function optionalString(recipe: SvsRecipe, name: string): string | undefined {+function optionalString(recipe: Recipe, name: string): string | undefined {const value = recipe.properties[name];if (value === undefined) return undefined;if (typeof value !== "string" || value.trim().length === 0) fail(recipe, `${name} must be text.`);@@ -66,7 +66,7 @@ function optionalString(recipe: SvsRecipe, name: string): string | undefined {}function oneOf<T extends string>(- recipe: SvsRecipe,+ recipe: Recipe,name: string,values: readonly T[],fallback: T,@@ -76,15 +76,15 @@ function oneOf<T extends string>(return value as T;}-function boolean(recipe: SvsRecipe, name: string, fallback: boolean): boolean {+function boolean(recipe: Recipe, name: string, fallback: boolean): boolean {const value = recipe.properties[name];if (value === undefined) return fallback;if (typeof value !== "boolean") fail(recipe, `${name} must be boolean.`);return value;}-function mediaRecipe(recipe: SvsRecipe, keys: readonly string[]): SvsRecipe {- const selected: Record<string, SvsRecipe["properties"][string]> = {};+function mediaRecipe(recipe: Recipe, keys: readonly string[]): Recipe {+ const selected: Record<string, Recipe["properties"][string]> = {};for (const key of keys) {const value = recipe.properties[key];if (value !== undefined) selected[key] = value;@@ -92,7 +92,7 @@ function mediaRecipe(recipe: SvsRecipe, keys: readonly string[]): SvsRecipe {return { ...recipe, properties: selected };}-function tone(recipe: SvsRecipe, prefix: string, fallback: DeckCardTone): DeckCardTone {+function tone(recipe: Recipe, prefix: string, fallback: DeckCardTone): DeckCardTone {return {brightness: number(recipe, `${prefix}-brightness`, fallback.brightness),contrast: number(recipe, `${prefix}-contrast`, fallback.contrast),@@ -101,7 +101,7 @@ function tone(recipe: SvsRecipe, prefix: string, fallback: DeckCardTone): DeckCa}function step(- recipe: SvsRecipe,+ recipe: Recipe,prefix: "previous" | "next",defaults: DepthStackPoseStep,): DepthStackPoseStep {@@ -117,7 +117,7 @@ function step(};}-function assertKnownKeys(recipe: SvsRecipe): void {+function assertKnownKeys(recipe: Recipe): void {const allowed = new Set<string>([...DECK_KEYS,...visualMaterialKeys.fit,@@ -128,7 +128,7 @@ function assertKnownKeys(recipe: SvsRecipe): void {if (unknown.length > 0) fail(recipe, `does not accept ${unknown.join(", ")}.`);}-export function decodeDepthStackSpec(recipe: SvsRecipe): DepthStackSpec {+export function decodeDepthStackSpec(recipe: Recipe): DepthStackSpec {assertKnownKeys(recipe);const frameRecipe = mediaRecipe(recipe, visualMaterialKeys.frame);const previousDefaults: DepthStackPoseStep = {@@ -180,7 +180,7 @@ export function decodeDepthStackSpec(recipe: SvsRecipe): DepthStackSpec {});}-export function decodeDepthStackCardSpec(recipe: SvsRecipe, id: string): DepthStackCardSpec {+export function decodeDepthStackCardSpec(recipe: Recipe, id: string): DepthStackCardSpec {assertKnownKeys(recipe);return sealDepthStackCardSpec({@@ -193,7 +193,7 @@ export function decodeDepthStackCardSpec(recipe: SvsRecipe, id: string): DepthSt}export function decodeDepthStackMaterial(- recipe: SvsRecipe,+ recipe: Recipe,id: string,sourceKind: "still" | "timed" | "surface",): {diff --git a/packages/depth-stack/src/component.ts b/packages/depth-stack/src/component.tsindex a0f230d4..ec03e01b 100644--- a/packages/depth-stack/src/component.ts+++ b/packages/depth-stack/src/component.ts@@ -1,11 +1,12 @@-import type { Timeline } from "@hypit/timeline";-import type { ComponentPackage, ProducerHandlerContext } from "@hypit/component-kit";-import { canonicalize } from "@hypit/protocol";-import type { StoredValue } from "@hypit/protocol";-import type { SpatialFrame } from "@hypit/spatial";-import type { TemporalInstant } from "@hypit/temporal";+import type { Timeline } from "@hypit/hypit/timeline";+import { canonicalize } from "@hypit/hypit/protocol";+import type { ProducerPackage, ProducerHandlerContext } from "@hypit/hypit/producer";+import type { AdmissionPackage } from "@hypit/hypit/admission";+import type { StoredValue } from "@hypit/hypit/protocol";+import type { SpatialFrame } from "@hypit/hypit/spatial";+import type { TemporalInstant } from "@hypit/hypit/temporal";import type { MediaLayerSet } from "@hypit/visual-track";-import type { Text } from "@hypit/text";+import type { Text } from "@hypit/hypit/text";import { renderDepthStack } from "./lower.js";import { depthStackProducers, depthStackTypes } from "./manifest.js";@@ -82,4 +83,4 @@ export const depthStackComponent = {type: depthStackTypes.program,handler: ({ value }) => assertDepthStackProgram(inline<DepthStackProgram>(value, "DepthStackProgram")),}],-} satisfies ComponentPackage;+} satisfies ProducerPackage & AdmissionPackage;diff --git a/packages/depth-stack/src/fragment.ts b/packages/depth-stack/src/fragment.tsindex 17a615af..07ebe65f 100644--- a/packages/depth-stack/src/fragment.ts+++ b/packages/depth-stack/src/fragment.ts@@ -1,13 +1,13 @@-import { timelineTypes } from "@hypit/timeline";+import { timelineTypes } from "@hypit/hypit/timeline";-import { artifactTypes } from "@hypit/artifact";-import { compositionTypes } from "@hypit/composition";-import { sealGraphFragment } from "@hypit/elaborator";-import type { FragmentOperation, GraphFragment } from "@hypit/elaborator";-import { mediaTypes } from "@hypit/media";+import { blobTypes } from "@hypit/hypit/blob";+import { compositionTypes } from "@hypit/hypit/composition";+import { sealGraphFragment } from "@hypit/hypit/author";+import type { FragmentOperation, GraphFragment } from "@hypit/hypit/author";+import { mediaTypes } from "@hypit/hypit/media";import { visualTrackProducers, visualTrackTypes } from "@hypit/visual-track";-import { spatialTypes } from "@hypit/spatial";-import { temporalTypes } from "@hypit/temporal";+import { spatialTypes } from "@hypit/hypit/spatial";+import { temporalTypes } from "@hypit/hypit/temporal";import { depthStackProducers, depthStackTypes } from "./manifest.js";@@ -29,7 +29,7 @@ export type DepthStackFragmentCard = {function sourceInput(card: DepthStackFragmentCard): GraphFragment["inputs"][number] {const type = card.sourceKind === "still"- ? artifactTypes.blob+ ? blobTypes.blob: card.sourceKind === "timed" ? mediaTypes.synchronized : mediaTypes.compositableSurface;return { name: card.sourceName, type };}diff --git a/packages/depth-stack/src/lower.ts b/packages/depth-stack/src/lower.tsindex 1c4ecc7c..5d60b4dd 100644--- a/packages/depth-stack/src/lower.ts+++ b/packages/depth-stack/src/lower.ts@@ -1,15 +1,15 @@-import type { Timeline } from "@hypit/timeline";+import type { Timeline } from "@hypit/hypit/timeline";import {assertVisualTrackIdentity,sealVisualTrack,-} from "@hypit/composition";+} from "@hypit/hypit/composition";import type {VisualAnimation,VisualElement,VisualSourceTimeMap,VisualStyleDeclaration,VisualTrack,-} from "@hypit/composition";+} from "@hypit/hypit/composition";import {lowerVisualClipElements,resolveMediaLayerPrograms,@@ -19,7 +19,7 @@ import type {VisualClipProgram,MediaSampleLayer,} from "@hypit/visual-track";-import type { SpatialFrame } from "@hypit/spatial";+import type { SpatialFrame } from "@hypit/hypit/spatial";import {assertDepthStackProgramIdentity,diff --git a/packages/depth-stack/src/manifest.ts b/packages/depth-stack/src/manifest.tsindex 3c941c38..fb37d169 100644--- a/packages/depth-stack/src/manifest.ts+++ b/packages/depth-stack/src/manifest.ts@@ -1,8 +1,8 @@-import { timelineTypes, timelineDependency } from "@hypit/timeline";-import { temporalContextAttributeVocabulary } from "@hypit/temporal-markup";+import { timelineTypes, timelineDependency } from "@hypit/hypit/timeline";+import { temporalContextAttributeVocabulary } from "@hypit/hypit/temporal/markup";import { readFile } from "node:fs/promises";-import { artifactTypes } from "@hypit/artifact";+import { blobTypes } from "@hypit/hypit/blob";import {compositionDependency,compositionTypes,@@ -10,8 +10,8 @@ import {visualTextFlowSchema,visualTextPaintSchema,visualTextTypographySchema,-} from "@hypit/composition";-import { mediaDependency, mediaTypes } from "@hypit/media";+} from "@hypit/hypit/composition";+import { mediaDependency, mediaTypes } from "@hypit/hypit/media";import {visualFrameTreatmentSchema,mediaLayerSetSchema,@@ -19,12 +19,12 @@ import {visualTrackTypes,} from "@hypit/visual-track";-import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/protocol";-import { spatialDependency, spatialFrameSchema, spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";-import { temporalDependency, temporalTypes } from "@hypit/temporal";-import { temporalInstantAttributeVocabulary } from "@hypit/temporal-markup";-import { textDependency, textTypes } from "@hypit/text";+import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/hypit/protocol";+import { spatialDependency, spatialFrameSchema, spatialTypes } from "@hypit/hypit/spatial";+import { recipeType } from "@hypit/hypit/recipe";+import { temporalDependency, temporalTypes } from "@hypit/hypit/temporal";+import { temporalInstantAttributeVocabulary } from "@hypit/hypit/temporal/markup";+import { textDependency, textTypes } from "@hypit/hypit/text";const previewImage = (file: string) => ({mediaType: "image/png",@@ -170,7 +170,7 @@ export const depthStackMarkupSurfaces = [...temporalContextAttributeVocabulary,{ name: "frame", kind: "reference", required: true, accepts: [spatialTypes.frame],summary: "Chooses the Frame the whole stack occupies." },- { name: "appearance", kind: "reference", required: true, accepts: [svsRecipeType],+ { name: "appearance", kind: "reference", required: true, accepts: [recipeType],summary: "Chooses the Recipe for visibility, depth poses, frame Paint, motion and reflow, and the Recipe every Card falls back to.",recipe: [{ name: "visible-previous", required: false, fallback: "2",@@ -288,12 +288,12 @@ export const depthStackMarkupSurfaces = [{ name: "id", kind: "identifier", required: true,summary: "Names this Card within the deck." },{ name: "source", kind: "reference", required: true,- accepts: [artifactTypes.blob, mediaTypes.synchronized, mediaTypes.compositableSurface],+ accepts: [blobTypes.blob, mediaTypes.synchronized, mediaTypes.compositableSurface],summary: "Chooses the picture the Card shows, as a still image Artifact, a Synchronized Medium or a Compositable Surface." },{ name: "extent", kind: "reference", required: false, accepts: [spatialTypes.extent],summary: "Gives a still image its pixel Extent, which timed and surface sources already carry." },...temporalInstantAttributeVocabulary,- { name: "appearance", kind: "reference", required: false, accepts: [svsRecipeType],+ { name: "appearance", kind: "reference", required: false, accepts: [recipeType],summary: "Chooses this Card's own Recipe in place of the deck's, adding explicit future and past playback.",recipe: [{ name: "fit", required: false, values: ["contain", "cover", "fit-width", "fit-height", "native", "scale-down", "stretch"], fallback: "contain",diff --git a/packages/depth-stack/src/program.ts b/packages/depth-stack/src/program.tsindex 21ff6863..170c9ac4 100644--- a/packages/depth-stack/src/program.ts+++ b/packages/depth-stack/src/program.ts@@ -1,19 +1,19 @@-import { assertTimelineIdentity, timelineFrameCount } from "@hypit/timeline";-import type { Timeline } from "@hypit/timeline";+import { assertTimelineIdentity, timelineFrameCount } from "@hypit/hypit/timeline";+import type { Timeline } from "@hypit/hypit/timeline";import {assertFontArtifactRef,-} from "@hypit/media";+} from "@hypit/hypit/media";import {assertVisualFrameTreatment,assertMediaLayerSet,} from "@hypit/visual-track";-import { canonicalize } from "@hypit/protocol";-import { verifyText } from "@hypit/text";-import type { Text } from "@hypit/text";-import { assertSpatialFrame } from "@hypit/spatial";-import type { SpatialFrame } from "@hypit/spatial";-import { assertTemporalInstantFor } from "@hypit/temporal";-import type { TemporalInstant } from "@hypit/temporal";+import { canonicalize } from "@hypit/hypit/protocol";+import { verifyText } from "@hypit/hypit/text";+import type { Text } from "@hypit/hypit/text";+import { assertSpatialFrame } from "@hypit/hypit/spatial";+import type { SpatialFrame } from "@hypit/hypit/spatial";+import { assertTemporalInstantFor } from "@hypit/hypit/temporal";+import type { TemporalInstant } from "@hypit/hypit/temporal";import type {DeckCardTone,diff --git a/packages/depth-stack-studio/src/index.ts b/packages/depth-stack/src/studio.tssimilarity index 95%rename from packages/depth-stack-studio/src/index.tsrename to packages/depth-stack/src/studio.tsindex 3cdc6b64..7692996c 100644--- a/packages/depth-stack-studio/src/index.ts+++ b/packages/depth-stack/src/studio.ts@@ -1,8 +1,8 @@-import { depthStackMarkupSurfaces, depthStackModuleRef } from "@hypit/depth-stack";-import type { DepthStackProgram } from "@hypit/depth-stack";-import { compositionTypes } from "@hypit/composition";-import type { StudioTrackCompanion, StudioTrackCompanionContext, StudioEntityDraft, StudioInspectorFieldDeclaration } from "@hypit/studio-adapter";-import { requiredSurfaceValue, temporalLineageFor, temporalDomainSource } from "@hypit/studio-adapter";+import { depthStackMarkupSurfaces, depthStackModuleRef } from "./index.js";+import type { DepthStackProgram } from "./index.js";+import { compositionTypes } from "@hypit/hypit/composition";+import type { StudioTrackCompanion, StudioTrackCompanionContext, StudioEntityDraft, StudioInspectorFieldDeclaration } from "@hypit/studio-companion";+import { requiredSurfaceValue, temporalLineageFor, temporalDomainSource } from "@hypit/studio-companion";const deckProperties = (depthStackMarkupSurfaces.find((surface) => surface.name === "track")?.vocabulary.attributes@@ -107,7 +107,7 @@ function projectDeck(context: StudioTrackCompanionContext): readonly StudioEntit});}-export const deckTrackStudioTrackCompanions: readonly StudioTrackCompanion[] = [+export const depthStackStudioTrackCompanions: readonly StudioTrackCompanion[] = [{id: "track", role: "track",output: { type: compositionTypes.visualTrack, surface: "track", modules: [depthStackModuleRef] },diff --git a/packages/depth-stack/src/surface.ts b/packages/depth-stack/src/surface.tsindex 69f9a5ff..e7170656 100644--- a/packages/depth-stack/src/surface.ts+++ b/packages/depth-stack/src/surface.ts@@ -1,24 +1,17 @@-import { resolveTemporalContext } from "@hypit/temporal-markup";-import { artifactTypes } from "@hypit/artifact";-import { mediaTypes } from "@hypit/media";-import type { FontStackRef } from "@hypit/media";+import { resolveTemporalContext } from "@hypit/hypit/temporal/markup";+import { blobTypes } from "@hypit/hypit/blob";+import { mediaTypes } from "@hypit/hypit/media";+import type { FontStackRef } from "@hypit/hypit/media";import { visualTrackTypes } from "@hypit/visual-track";-import type { TypeRef } from "@hypit/protocol";-import { spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";-import { createTemporalInstantConstruction, temporalInstantAttributeNames } from "@hypit/temporal-markup";-import type { SvsRecipe } from "@hypit/svs";-import { sealText, textTypes } from "@hypit/text";-import { sealGraphFragment } from "@hypit/elaborator";-import type { AuthorValueRef } from "@hypit/elaborator";-import type {- StructuredElement,- StructuredSurfaceHandler,- SurfaceComponentDraft,- SurfaceRecordDraft,- SurfaceResolvedReference,- MarkupAttributeValue,-} from "@hypit/markup";+import type { TypeRef } from "@hypit/hypit/protocol";+import { spatialTypes } from "@hypit/hypit/spatial";+import { recipeType } from "@hypit/hypit/recipe";+import { createTemporalInstantConstruction, temporalInstantAttributeNames } from "@hypit/hypit/temporal/markup";+import type { Recipe } from "@hypit/hypit/recipe";+import { sealText, textTypes } from "@hypit/hypit/text";+import { sealGraphFragment } from "@hypit/hypit/author";+import type { AuthorValueRef } from "@hypit/hypit/author";+import type { StructuredElement, StructuredSurfaceHandler, SurfaceComponentDraft, SurfaceRecordDraft, SurfaceResolvedReference, MarkupAttributeValue } from "@hypit/hypit/markup";import {decodeDepthStackCardSpec,@@ -108,8 +101,8 @@ function recipe(raw: MarkupAttributeValue | undefined,label: string,resolve: (path: string) => SurfaceResolvedReference | undefined,-): SvsRecipe {- return inline<SvsRecipe>(reference(raw, label, svsRecipeType, resolve), label);+): Recipe {+ return inline<Recipe>(reference(raw, label, recipeType, resolve), label);}function labelText(element: StructuredElement): string {@@ -216,8 +209,8 @@ export const decodeDepthStackSurface: StructuredSurfaceHandler = ({ element, rescardIndex += 1;const suffix = String(cardIndex).padStart(4, "0");const cardId = text(child, "id");- const source = oneOfReference(child.attributes.source, `${child.name}.source`, [artifactTypes.blob, mediaTypes.synchronized, mediaTypes.compositableSurface], resolveReference);- const sourceKind = sameType(source.type, artifactTypes.blob) ? "still"+ const source = oneOfReference(child.attributes.source, `${child.name}.source`, [blobTypes.blob, mediaTypes.synchronized, mediaTypes.compositableSurface], resolveReference);+ const sourceKind = sameType(source.type, blobTypes.blob) ? "still": sameType(source.type, mediaTypes.synchronized) ? "timed" : "surface";const extent = child.attributes.extent === undefined ? undefined: reference(child.attributes.extent, `${child.name}.extent`, spatialTypes.extent, resolveReference);diff --git a/packages/depth-stack/src/types.ts b/packages/depth-stack/src/types.tsindex b04eb7c6..9054c894 100644--- a/packages/depth-stack/src/types.ts+++ b/packages/depth-stack/src/types.ts@@ -4,12 +4,12 @@ import type {VisualTextFlow,VisualTextPaintLayer,VisualTextTypography,-} from "@hypit/composition";+} from "@hypit/hypit/composition";import type {VisualFrameTreatment,MediaLayerSet,} from "@hypit/visual-track";-import type { SpatialFrame } from "@hypit/spatial";+import type { SpatialFrame } from "@hypit/hypit/spatial";export type DepthStackVisibility = {readonly previous: number;diff --git a/packages/depth-stack/test/depth-stack.test.ts b/packages/depth-stack/test/depth-stack.test.tsindex 44629cac..a79611d6 100644--- a/packages/depth-stack/test/depth-stack.test.ts+++ b/packages/depth-stack/test/depth-stack.test.ts@@ -7,7 +7,7 @@ import { timelineFixture } from "../../../test/timeline-fixture.js";import { compositionDependency, compositionTypes } from "@hypit/composition";import type { VisualElement, VisualSourceTimeMap } from "@hypit/composition";-import { createResolvedClosure } from "@hypit/core";+import { createResolvedClosure } from "@hypit/kernel";import {decodeDepthStackLabelSurface,decodeDepthStackSurface,@@ -35,22 +35,22 @@ import type {} from "@hypit/depth-stack";import type { FontArtifactRef } from "@hypit/media";import { mediaTypes } from "@hypit/media";-import { mediaPipelineManifest } from "@hypit/media-pipeline";+import { mediaOperationsManifest } from "@hypit/media-operations";import type { MediaLayerSet } from "@hypit/visual-track";import type { ModuleManifest } from "@hypit/protocol";import { temporalTypes } from "@hypit/temporal";import type { TemporalInstant } from "@hypit/temporal";import { canvasFrame, sealCanvas, sealSpatialFrame, spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";+import { recipeType } from "@hypit/recipe";import { sealText, textManifest, textTypes } from "@hypit/text";-import type { SvsRecipe } from "@hypit/svs";+import type { Recipe } from "@hypit/recipe";import type {StructuredElement,StructuredNode,SurfaceResolvedReference,MarkupAttributeValue,} from "@hypit/markup";-import { artifactTypes } from "@hypit/artifact";+import { blobTypes } from "@hypit/blob";import { visualTrackManifest, visualTrackTypes } from "@hypit/visual-track";const space = sealTimeline({ id: "test-space", frameCount: 60, frameRate: { numerator: 30, denominator: 1 },@@ -411,15 +411,15 @@ test("the author Surface keeps every source, trigger, terminal, Frame and optionconst ref = (path: string): MarkupAttributeValue => ({ kind: "reference", path });const node = (name: string, attributes: Record<string, MarkupAttributeValue>, children: StructuredNode[] = []): StructuredElement => ({ kind: "element", name, attributes, children, range });const plain = (path: string, type: SurfaceResolvedReference["type"]): SurfaceResolvedReference => ({ path, ref: { kind: "record", id: path }, type });- const appearance = (path: string, properties: SvsRecipe["properties"]): SurfaceResolvedReference => ({- path, ref: { kind: "record", id: path }, type: svsRecipeType,+ const appearance = (path: string, properties: Recipe["properties"]): SurfaceResolvedReference => ({+ path, ref: { kind: "record", id: path }, type: recipeType,record: { value: { kind: "inline", value: { path, properties } } } as never,});const references = new Map<string, SurfaceResolvedReference>([["timeline", plain("timeline", timelineTypes.timeline)],["within", plain("within", spatialTypes.frame)],["frame", plain("frame", spatialTypes.frame)],- ["first", plain("first", artifactTypes.blob)], ["first-extent", plain("first-extent", spatialTypes.extent)],+ ["first", plain("first", blobTypes.blob)], ["first-extent", plain("first-extent", spatialTypes.extent)],["second", plain("second", mediaTypes.synchronized)], ["one", plain("one", temporalTypes.instant)],["two", plain("two", temporalTypes.instant)], ["terminal", plain("terminal", temporalTypes.instant)],["deck-style", appearance("deck-style", { "visible-previous": 1, "visible-next": 1, "reflow-frames": 4, fit: "cover", "stack-order": 30 })],@@ -514,7 +514,7 @@ test("another Deck family can coexist by contributing only the existing VisualTr};const closure = createResolvedClosure([...videoContractManifests,- mediaPipelineManifest,+ mediaOperationsManifest,visualTrackManifest,textManifest,depthStackManifest,diff --git a/packages/interview-emoji-reveal/package.json b/packages/interview-emoji-reveal/package.jsonindex 1373c8aa..05a36035 100644--- a/packages/interview-emoji-reveal/package.json+++ b/packages/interview-emoji-reveal/package.json@@ -6,20 +6,19 @@"exports": {".": "./src/index.ts"},+ "files": [+ "dist",+ "preview",+ "README.md"+ ],"hypit": {"activation": "./src/activation.ts"},- "dependencies": {- "@hypit/artifact": "workspace:*",- "@hypit/component-kit": "workspace:*",- "@hypit/composition": "workspace:*",- "@hypit/elaborator": "workspace:*",- "@hypit/markup": "workspace:*",- "@hypit/protocol": "workspace:*",- "@hypit/timeline": "workspace:*",- "@hypit/spatial": "workspace:*",- "@hypit/svs": "workspace:*",- "@hypit/temporal": "workspace:*",- "@hypit/temporal-markup": "workspace:*"+ "peerDependencies": {+ "@hypit/hypit": "workspace:^"+ },+ "devDependencies": {+ "@hypit/hypit": "workspace:*",+ "typescript": "5.9.3"}}diff --git a/packages/interview-emoji-reveal/src/activation.ts b/packages/interview-emoji-reveal/src/activation.tsindex 9a1caabe..e45f2dc4 100644--- a/packages/interview-emoji-reveal/src/activation.ts+++ b/packages/interview-emoji-reveal/src/activation.ts@@ -1,14 +1,18 @@-import { createMarkupSurfaceHostFacet } from "@hypit/markup";+import { createMarkupSurfaceFacet } from "@hypit/hypit/markup";+import { createAdmissionPackageFacet } from "@hypit/hypit/admission";+import { createProducerPackageFacet } from "@hypit/hypit/producer";import { emojiRevealComponent, emojiRevealManifest, emojiRevealMarkupSurfaces, emojiRevealModuleRef } from "./index.js";import { decodeEmojiRevealStyleSurface, decodeEmojiRevealTrackSurface } from "./surface.js";export const hypitPackage = {- format: "hypit.node-package@1" as const,- modules: [{ manifest: emojiRevealManifest }], components: [emojiRevealComponent],- hostFacets: [- createMarkupSurfaceHostFacet({ module: emojiRevealModuleRef, declaration: emojiRevealMarkupSurfaces.find((item) => item.name === "style")!, handler: decodeEmojiRevealStyleSurface }),- createMarkupSurfaceHostFacet({ module: emojiRevealModuleRef, declaration: emojiRevealMarkupSurfaces.find((item) => item.name === "emojiReveal")!, handler: decodeEmojiRevealTrackSurface }),+ format: "hypit.package@1" as const,+ modules: [{ manifest: emojiRevealManifest }],+ facets: [+ createProducerPackageFacet(emojiRevealComponent),+ createAdmissionPackageFacet(emojiRevealComponent),+ createMarkupSurfaceFacet({ module: emojiRevealModuleRef, declaration: emojiRevealMarkupSurfaces.find((item) => item.name === "style")!, handler: decodeEmojiRevealStyleSurface }),+ createMarkupSurfaceFacet({ module: emojiRevealModuleRef, declaration: emojiRevealMarkupSurfaces.find((item) => item.name === "emojiReveal")!, handler: decodeEmojiRevealTrackSurface }),],};export default hypitPackage;diff --git a/packages/interview-emoji-reveal/src/component.ts b/packages/interview-emoji-reveal/src/component.tsindex 476dfda5..2764e36a 100644--- a/packages/interview-emoji-reveal/src/component.ts+++ b/packages/interview-emoji-reveal/src/component.ts@@ -1,9 +1,10 @@-import type { Timeline } from "@hypit/timeline";-import type { ComponentPackage } from "@hypit/component-kit";-import { canonicalize } from "@hypit/protocol";-import type { BlobRef, StoredValue } from "@hypit/protocol";-import type { SpatialFrame } from "@hypit/spatial";-import type { TemporalInstant, TemporalWindow } from "@hypit/temporal";+import type { Timeline } from "@hypit/hypit/timeline";+import type { ProducerPackage } from "@hypit/hypit/producer";+import type { AdmissionPackage } from "@hypit/hypit/admission";+import { canonicalize } from "@hypit/hypit/protocol";+import type { BlobRef, StoredValue } from "@hypit/hypit/protocol";+import type { SpatialFrame } from "@hypit/hypit/spatial";+import type { TemporalInstant, TemporalWindow } from "@hypit/hypit/temporal";import { emojiRevealProducers, emojiRevealTypes } from "./manifest.js";import { appendEmojiRevealItem, appendPresetEmojiRevealItem, assertEmojiRevealProgram, createEmojiRevealSet, finalizeEmojiReveal, renderEmojiReveal } from "./program.js";@@ -42,4 +43,4 @@ export const emojiRevealComponent = {)) }, needs: {} }) },],validators: [{ type: emojiRevealTypes.program, handler: ({ value }) => assertEmojiRevealProgram(inline<EmojiRevealProgram>(value, "EmojiRevealProgram")) }],-} satisfies ComponentPackage;+} satisfies ProducerPackage & AdmissionPackage;diff --git a/packages/interview-emoji-reveal/src/fragment.ts b/packages/interview-emoji-reveal/src/fragment.tsindex a9b1e4a9..7de70b59 100644--- a/packages/interview-emoji-reveal/src/fragment.ts+++ b/packages/interview-emoji-reveal/src/fragment.ts@@ -1,11 +1,11 @@-import { timelineTypes } from "@hypit/timeline";+import { timelineTypes } from "@hypit/hypit/timeline";-import { compositionTypes } from "@hypit/composition";-import { artifactTypes } from "@hypit/artifact";-import { sealGraphFragment } from "@hypit/elaborator";-import type { FragmentOperation } from "@hypit/elaborator";-import { spatialTypes } from "@hypit/spatial";-import { temporalTypes } from "@hypit/temporal";+import { compositionTypes } from "@hypit/hypit/composition";+import { blobTypes } from "@hypit/hypit/blob";+import { sealGraphFragment } from "@hypit/hypit/author";+import type { FragmentOperation } from "@hypit/hypit/author";+import { spatialTypes } from "@hypit/hypit/spatial";+import { temporalTypes } from "@hypit/hypit/temporal";import { emojiRevealProducers, emojiRevealTypes } from "./manifest.js";@@ -48,9 +48,9 @@ export function createEmojiRevealFragment(items: readonly EmojiRevealFragmentIteinputs: [{ name: "header", type: emojiRevealTypes.header }, { name: "timeline", type: timelineTypes.timeline },{ name: "within", type: spatialTypes.frame }, { name: "outer", type: temporalTypes.window }, { name: "style", type: emojiRevealTypes.style },- { name: "placeholder", type: artifactTypes.blob },+ { name: "placeholder", type: blobTypes.blob },...items.flatMap((item) => [- { name: item.specName, type: emojiRevealTypes.itemSpec }, { name: item.iconName, type: artifactTypes.blob },+ { name: item.specName, type: emojiRevealTypes.itemSpec }, { name: item.iconName, type: blobTypes.blob },...(item.activationName === undefined ? [] : [{ name: item.activationName, type: temporalTypes.instant }]),]),],diff --git a/packages/interview-emoji-reveal/src/manifest.ts b/packages/interview-emoji-reveal/src/manifest.tsindex b50aa24a..1a3b365a 100644--- a/packages/interview-emoji-reveal/src/manifest.ts+++ b/packages/interview-emoji-reveal/src/manifest.ts@@ -1,15 +1,15 @@-import { timelineTypes, timelineDependency } from "@hypit/timeline";-import { temporalContextAttributeVocabulary } from "@hypit/temporal-markup";+import { timelineTypes, timelineDependency } from "@hypit/hypit/timeline";+import { temporalContextAttributeVocabulary } from "@hypit/hypit/temporal/markup";import { readFile } from "node:fs/promises";-import { artifactDependency, artifactTypes } from "@hypit/artifact";-import { compositionDependency, compositionTypes } from "@hypit/composition";+import { blobDependency, blobTypes } from "@hypit/hypit/blob";+import { compositionDependency, compositionTypes } from "@hypit/hypit/composition";-import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/protocol";-import { spatialDependency, spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";-import { temporalDependency, temporalInstantSchema, temporalTypes, temporalWindowSchema } from "@hypit/temporal";-import { temporalWindowAttributeVocabulary } from "@hypit/temporal-markup";+import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/hypit/protocol";+import { spatialDependency, spatialTypes } from "@hypit/hypit/spatial";+import { recipeType } from "@hypit/hypit/recipe";+import { temporalDependency, temporalInstantSchema, temporalTypes, temporalWindowSchema } from "@hypit/hypit/temporal";+import { temporalWindowAttributeVocabulary } from "@hypit/hypit/temporal/markup";const previewImage = (file: string) => ({mediaType: "image/png",@@ -101,7 +101,7 @@ export const emojiRevealMarkupSurfaces = [summary: "Compiles one Recipe into the visual Style shared by an SVG Reveal strip.",attributes: [{ name: "id", kind: "identifier", required: true, summary: "Names this Style." },- { name: "recipe", kind: "reference", required: true, accepts: [svsRecipeType],+ { name: "recipe", kind: "reference", required: true, accepts: [recipeType],summary: "Chooses the Recipe that controls placement, board paint, slot geometry and reveal motion.",recipe: recipe.map(([name, fallback, summary]) => ({ name, required: false, fallback, summary })) },],@@ -119,12 +119,12 @@ export const emojiRevealMarkupSurfaces = [...temporalContextAttributeVocabulary,{ name: "within", kind: "reference", required: true, accepts: [spatialTypes.frame], summary: "Chooses the Frame used for normalized placement." },{ name: "style", kind: "reference", required: true, accepts: [emojiRevealTypes.style], summary: "Chooses the strip Style." },- { name: "placeholder", kind: "reference", required: true, accepts: [artifactTypes.blob], summary: "Supplies the one image drawn in every unrevealed slot." },+ { name: "placeholder", kind: "reference", required: true, accepts: [blobTypes.blob], summary: "Supplies the one image drawn in every unrevealed slot." },...temporalWindowAttributeVocabulary,],children: [{ tag: "Item", cardinality: "many", summary: "One answer slot, either settled from the start or revealed at one event.", attributes: [{ name: "id", kind: "identifier", required: true, summary: "Names this answer slot and the timing subject it owns." },- { name: "icon", kind: "reference", required: true, accepts: [artifactTypes.blob], summary: "Supplies this answer as an image Artifact from the same visual icon family as the placeholder." },+ { name: "icon", kind: "reference", required: true, accepts: [blobTypes.blob], summary: "Supplies this answer as an image Artifact from the same visual icon family as the placeholder." },{ name: "preset", kind: "literal", required: false, values: ["true", "false"], summary: "Settles this Item from the start of the EmojiReveal Window; preset Items have no at." },{ name: "at", kind: "expression", required: false, accepts: [temporalTypes.instant], summary: "Chooses this non-preset Item's resolved reveal Instant or authored absolute time; required unless preset is true." },] }],@@ -147,7 +147,7 @@ export const emojiRevealMarkupSurfaces = [export const emojiRevealManifest: ModuleManifest = {format: "hypit.module@1", name: emojiRevealModuleRef.name, version: emojiRevealModuleRef.version,- dependencies: [artifactDependency, timelineDependency, spatialDependency, temporalDependency, compositionDependency],+ dependencies: [blobDependency, timelineDependency, spatialDependency, temporalDependency, compositionDependency],types: [{ name: emojiRevealTypes.header.name }, { name: emojiRevealTypes.style.name },{ name: emojiRevealTypes.itemSpec.name }, { name: emojiRevealTypes.set.name }, { name: emojiRevealTypes.program.name },@@ -156,13 +156,13 @@ export const emojiRevealManifest: ModuleManifest = {producers: [{ name: emojiRevealProducers.createSet.name, inputs: [], outputs: [{ name: "set", type: emojiRevealTypes.set }], needs: [] },{ name: emojiRevealProducers.appendItem.name,- inputs: [{ name: "set", type: emojiRevealTypes.set }, { name: "timeline", type: timelineTypes.timeline }, { name: "spec", type: emojiRevealTypes.itemSpec }, { name: "icon", type: artifactTypes.blob }, { name: "activation", type: temporalTypes.instant }],+ inputs: [{ name: "set", type: emojiRevealTypes.set }, { name: "timeline", type: timelineTypes.timeline }, { name: "spec", type: emojiRevealTypes.itemSpec }, { name: "icon", type: blobTypes.blob }, { name: "activation", type: temporalTypes.instant }],outputs: [{ name: "set", type: emojiRevealTypes.set }], needs: [] },{ name: emojiRevealProducers.appendPresetItem.name,- inputs: [{ name: "set", type: emojiRevealTypes.set }, { name: "spec", type: emojiRevealTypes.itemSpec }, { name: "icon", type: artifactTypes.blob }],+ inputs: [{ name: "set", type: emojiRevealTypes.set }, { name: "spec", type: emojiRevealTypes.itemSpec }, { name: "icon", type: blobTypes.blob }],outputs: [{ name: "set", type: emojiRevealTypes.set }], needs: [] },{ name: emojiRevealProducers.finalize.name,- inputs: [{ name: "header", type: emojiRevealTypes.header }, { name: "timeline", type: timelineTypes.timeline }, { name: "outer", type: temporalTypes.window }, { name: "style", type: emojiRevealTypes.style }, { name: "placeholder", type: artifactTypes.blob }, { name: "set", type: emojiRevealTypes.set }],+ inputs: [{ name: "header", type: emojiRevealTypes.header }, { name: "timeline", type: timelineTypes.timeline }, { name: "outer", type: temporalTypes.window }, { name: "style", type: emojiRevealTypes.style }, { name: "placeholder", type: blobTypes.blob }, { name: "set", type: emojiRevealTypes.set }],outputs: [{ name: "program", type: emojiRevealTypes.program }], needs: [] },{ name: emojiRevealProducers.render.name,inputs: [{ name: "within", type: spatialTypes.frame }, { name: "timeline", type: timelineTypes.timeline }, { name: "program", type: emojiRevealTypes.program }],diff --git a/packages/interview-emoji-reveal/src/program.ts b/packages/interview-emoji-reveal/src/program.tsindex b0f023e2..24d59c74 100644--- a/packages/interview-emoji-reveal/src/program.ts+++ b/packages/interview-emoji-reveal/src/program.ts@@ -1,13 +1,13 @@-import { assertTimelineIdentity } from "@hypit/timeline";-import type { Timeline } from "@hypit/timeline";-import { assertVisualTrackIdentity, sealVisualTrack } from "@hypit/composition";-import type { VisualAnimation, VisualElement, VisualTrack } from "@hypit/composition";-import { canonicalize } from "@hypit/protocol";-import type { BlobRef } from "@hypit/protocol";-import { assertSpatialFrame } from "@hypit/spatial";-import type { SpatialFrame } from "@hypit/spatial";-import { assertTemporalInstantFor, assertTemporalWindowFor } from "@hypit/temporal";-import type { TemporalInstant, TemporalWindow } from "@hypit/temporal";+import { assertTimelineIdentity } from "@hypit/hypit/timeline";+import type { Timeline } from "@hypit/hypit/timeline";+import { assertVisualTrackIdentity, sealVisualTrack } from "@hypit/hypit/composition";+import type { VisualAnimation, VisualElement, VisualTrack } from "@hypit/hypit/composition";+import { canonicalize } from "@hypit/hypit/protocol";+import type { BlobRef } from "@hypit/hypit/protocol";+import { assertSpatialFrame } from "@hypit/hypit/spatial";+import type { SpatialFrame } from "@hypit/hypit/spatial";+import { assertTemporalInstantFor, assertTemporalWindowFor } from "@hypit/hypit/temporal";+import type { TemporalInstant, TemporalWindow } from "@hypit/hypit/temporal";import type { EmojiRevealHeader, EmojiRevealItemSpec, EmojiRevealProgram, EmojiRevealSet, EmojiRevealStyle } from "./types.js";diff --git a/packages/interview-emoji-reveal/src/style.ts b/packages/interview-emoji-reveal/src/style.tsindex 6339b2d7..c1136ad5 100644--- a/packages/interview-emoji-reveal/src/style.ts+++ b/packages/interview-emoji-reveal/src/style.ts@@ -1,5 +1,5 @@-import { canonicalize } from "@hypit/protocol";-import type { SvsRecipe } from "@hypit/svs";+import { canonicalize } from "@hypit/hypit/protocol";+import type { Recipe } from "@hypit/hypit/recipe";import { assertEmojiRevealStyle } from "./program.js";import type { EmojiRevealStyle } from "./types.js";@@ -11,23 +11,23 @@ const KEYS = new Set(["icon-size", "reveal-frames", "stack-order",]);-function fail(recipe: SvsRecipe, message: string): never { throw new Error(`Emoji Reveal Recipe ${recipe.path} ${message}`); }-function numeric(recipe: SvsRecipe, name: string, fallback: number): number {+function fail(recipe: Recipe, message: string): never { throw new Error(`Emoji Reveal Recipe ${recipe.path} ${message}`); }+function numeric(recipe: Recipe, name: string, fallback: number): number {const value = recipe.properties[name] ?? fallback;if (typeof value !== "number" || !Number.isFinite(value)) fail(recipe, `${name} must be a finite number.`);return value;}-function integer(recipe: SvsRecipe, name: string, fallback: number): number {+function integer(recipe: Recipe, name: string, fallback: number): number {const value = numeric(recipe, name, fallback);if (!Number.isSafeInteger(value)) fail(recipe, `${name} must be an integer.`);return value;}-function text(recipe: SvsRecipe, name: string, fallback: string): string {+function text(recipe: Recipe, name: string, fallback: string): string {const value = recipe.properties[name] ?? fallback;if (typeof value !== "string" || value.trim().length === 0) fail(recipe, `${name} must be text.`);return value.trim();}-export function decodeEmojiRevealStyle(id: string, recipe: SvsRecipe): EmojiRevealStyle {+export function decodeEmojiRevealStyle(id: string, recipe: Recipe): EmojiRevealStyle {const unknown = Object.keys(recipe.properties).filter((key) => !KEYS.has(key));if (unknown.length > 0) fail(recipe, `does not accept ${unknown.join(", ")}.`);const style: EmojiRevealStyle = {diff --git a/packages/interview-emoji-reveal/src/surface.ts b/packages/interview-emoji-reveal/src/surface.tsindex 71946e30..6e43718f 100644--- a/packages/interview-emoji-reveal/src/surface.ts+++ b/packages/interview-emoji-reveal/src/surface.ts@@ -1,14 +1,11 @@-import { resolveTemporalContext } from "@hypit/temporal-markup";-import {- assertAttributes, assertEmptyElement, optionalTextAttribute, textAttribute, type MarkupAttributeValue, type StructuredSurfaceHandler,- type SurfaceComponentDraft, type SurfaceRecordDraft, type SurfaceResolvedReference,-} from "@hypit/markup";-import { artifactTypes } from "@hypit/artifact";-import { sameType, type CanonicalValue, type TypeRef } from "@hypit/protocol";-import { spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";-import type { SvsRecipe } from "@hypit/svs";-import { createTemporalInstantConstruction, createTemporalWindowConstruction, temporalWindowAttributeNames } from "@hypit/temporal-markup";+import { resolveTemporalContext } from "@hypit/hypit/temporal/markup";+import { assertAttributes, assertEmptyElement, optionalTextAttribute, textAttribute, type MarkupAttributeValue, type StructuredSurfaceHandler, type SurfaceComponentDraft, type SurfaceRecordDraft, type SurfaceResolvedReference } from "@hypit/hypit/markup";+import { blobTypes } from "@hypit/hypit/blob";+import { sameType, type CanonicalValue, type TypeRef } from "@hypit/hypit/protocol";+import { spatialTypes } from "@hypit/hypit/spatial";+import { recipeType } from "@hypit/hypit/recipe";+import type { Recipe } from "@hypit/hypit/recipe";+import { createTemporalInstantConstruction, createTemporalWindowConstruction, temporalWindowAttributeNames } from "@hypit/hypit/temporal/markup";import { createEmojiRevealFragment } from "./fragment.js";import { emojiRevealTypes } from "./manifest.js";@@ -41,8 +38,8 @@ function boolean(element: Parameters<StructuredSurfaceHandler>[0]["element"], naexport const decodeEmojiRevealStyleSurface: StructuredSurfaceHandler = ({ element, resolveReference }) => {assertAttributes(element, ["id", "recipe"]); assertEmptyElement(element);const id = textAttribute(element, "id");- const recipe = reference(element.attributes.recipe, `${element.name}.recipe`, svsRecipeType, resolveReference);- const style = decodeEmojiRevealStyle(id, inline<SvsRecipe>(recipe, `${element.name}.recipe`));+ const recipe = reference(element.attributes.recipe, `${element.name}.recipe`, recipeType, resolveReference);+ const style = decodeEmojiRevealStyle(id, inline<Recipe>(recipe, `${element.name}.recipe`));return { records: [{ id, type: emojiRevealTypes.style, value: { kind: "inline", value: style as unknown as CanonicalValue }, range: element.range }], components: [], fragments: [] };};@@ -52,7 +49,7 @@ export const decodeEmojiRevealTrackSurface: StructuredSurfaceHandler = ({ elemenconst context = resolveTemporalContext({ element, resolveReference });const within = reference(element.attributes.within, `${element.name}.within`, spatialTypes.frame, resolveReference);const style = reference(element.attributes.style, `${element.name}.style`, emojiRevealTypes.style, resolveReference);- const placeholder = reference(element.attributes.placeholder, `${element.name}.placeholder`, artifactTypes.blob, resolveReference);+ const placeholder = reference(element.attributes.placeholder, `${element.name}.placeholder`, blobTypes.blob, resolveReference);const outer = createTemporalWindowConstruction({ id, subjectId: id, element, ...context, resolveReference });const headerId = `${id}.header`;const records: SurfaceRecordDraft[] = [...outer.records, {@@ -79,7 +76,7 @@ export const decodeEmojiRevealTrackSurface: StructuredSurfaceHandler = ({ elemenconst timed = child.attributes.at !== undefined;if (preset && timed) throw new Error(`${child.name} cannot combine preset=true with at.`);if (!preset && !timed) throw new Error(`${child.name} requires at unless preset=true.`);- const icon = reference(child.attributes.icon, `${child.name}.icon`, artifactTypes.blob, resolveReference);+ const icon = reference(child.attributes.icon, `${child.name}.icon`, blobTypes.blob, resolveReference);const spec = sealEmojiRevealItemSpec({ id: itemId, preset });const suffix = String(index).padStart(4, "0");const specId = `${id}.item.${suffix}.spec`; const specName = `item-${suffix}-spec`;diff --git a/packages/interview-emoji-reveal/src/types.ts b/packages/interview-emoji-reveal/src/types.tsindex 9d2dfa98..ef87bc45 100644--- a/packages/interview-emoji-reveal/src/types.ts+++ b/packages/interview-emoji-reveal/src/types.ts@@ -1,5 +1,5 @@-import type { BlobRef } from "@hypit/protocol";-import type { TemporalInstant, TemporalWindow } from "@hypit/temporal";+import type { BlobRef } from "@hypit/hypit/protocol";+import type { TemporalInstant, TemporalWindow } from "@hypit/hypit/temporal";export type EmojiRevealHeader = { readonly id: string };diff --git a/packages/ranking-studio/README.md b/packages/ranking-studio/README.mddeleted file mode 100644index 05dce9c3..00000000--- a/packages/ranking-studio/README.md+++ /dev/null@@ -1,32 +0,0 @@-# `@hypit/ranking-studio`--Hypit Studio Companion for the Ranking module's Column, Tier and Top Three surfaces.--Each surface has separate visual and audio Companion declarations in this one-package. Film chooses `.visual` and `.audio` independently; selecting the visual-output does not connect its sound.--The root lane represents the board; `attachments` expose reveal or activation-events on a detail lane. Both use Studio's ordinary item selection and overlap-behavior. Their time ranges remain the authored event ranges.--Ranking's renderer assigns `subjectId` to each item's rendered phases. The-Companion associates those phases with the item's `renderIds`, so clicking an-entering or settled icon selects the same detail entity. The board and preset-items without a detail event remain associated with the root. Studio measures-the visible parts at the current frame; the Companion does not duplicate motion-geometry or infer identities from rendered ID strings.--The audio Companion presents a `Ranking Sounds` lane. Each emitted clip shows-its item and phase (`Appear` or `Move`) with a waveform. It joins the board's-exported `.events` to the rendered audio clips by exact event identity, so a-phase without a supplied sound contributes no audio item. `Move` is the motion-into the board, not an exit sound.--Selecting a sound exposes the event trigger as a read-only fact and the shared-Ranking Style's sound gains and fade-in length as editable fields. Gain is-displayed as a percentage; edits write the original linear gain to the Style's-recipe. These fields affect every matching event using that recipe. Event-timing comes from the Ranking animation; changing the visual event timing-updates its sound too. The visual Companion owns layout and motion controls,-while the audio Companion owns the sound controls.diff --git a/packages/ranking-studio/package.json b/packages/ranking-studio/package.jsondeleted file mode 100644index bf61b4ab..00000000--- a/packages/ranking-studio/package.json+++ /dev/null@@ -1,19 +0,0 @@-{- "name": "@hypit/ranking-studio",- "version": "0.0.0-dev",- "license": "SEE LICENSE IN LICENSE",- "private": true,- "type": "module",- "exports": {- ".": "./src/index.ts"- },- "hypit": {- "activation": "./src/activation.ts"- },- "dependencies": {- "@hypit/ranking": "workspace:*",- "@hypit/composition": "workspace:*",- "@hypit/studio-adapter": "workspace:*",- "@hypit/fonts-open": "workspace:*"- }-}diff --git a/packages/ranking-studio/src/activation.ts b/packages/ranking-studio/src/activation.tsdeleted file mode 100644index 88363116..00000000--- a/packages/ranking-studio/src/activation.ts+++ /dev/null@@ -1,7 +0,0 @@-import { createStudioTrackCompanionHostFacet } from "@hypit/studio-adapter";-import { rankingStudioTrackCompanions } from "./index.js";--export default {- format: "hypit.node-package@1" as const,- hostFacets: [createStudioTrackCompanionHostFacet(rankingStudioTrackCompanions)],-};diff --git a/packages/ranking/README.md b/packages/ranking/README.mdindex 7bc0dfdb..ce08609c 100644--- a/packages/ranking/README.md+++ b/packages/ranking/README.md@@ -44,23 +44,25 @@ attributes, children, outputs and configured example.## Read it as a temporal component example-The following files are included in the Distribution and show how the responsibilities connect:+The published package contains compiled code, preview material and this README. The maintained source+lives in the Hypit repository; these links show how the responsibilities connect without claiming the+installed tarball contains a second editable source tree:| File | What to learn from it || --- | --- |-| [surface.ts](src/surface.ts) | `rankingSurface` resolves author inputs, projects the outer and item times through `createTemporalWindowConstruction` / `createTemporalInstantConstruction`, and retains the returned drafts and references. |-| [fragment.ts](src/fragment.ts) | `createRankingFragment` receives Timeline and wires typed content, time, layout and Style inputs into finite operations. |-| [schedule.ts](src/schedule.ts) | Compute reveal, activation and settled spans from the projected times. |-| [component.ts](src/component.ts) and [render.ts](src/render.ts) | Build the ranking program and produce picture and optional sound from that schedule. |-| [manifest.ts](src/manifest.ts) and [activation.ts](src/activation.ts) | Publish Types, Producers, Surface vocabulary and package contributions. |-| [Ranking Companion](../ranking-studio/src/index.ts) | Read the same program, present persistent rows and activation lanes, and connect edits to actual Source inputs. |+| [surface.ts](https://github.com/hypit-ai/hypit/blob/main/packages/ranking/src/surface.ts) | `rankingSurface` resolves author inputs, projects the outer and item times through `createTemporalWindowConstruction` / `createTemporalInstantConstruction`, and retains the returned drafts and references. |+| [fragment.ts](https://github.com/hypit-ai/hypit/blob/main/packages/ranking/src/fragment.ts) | `createRankingFragment` receives Timeline and wires typed content, time, layout and Style inputs into finite operations. |+| [schedule.ts](https://github.com/hypit-ai/hypit/blob/main/packages/ranking/src/schedule.ts) | Compute reveal, activation and settled spans from the projected times. |+| [component.ts](https://github.com/hypit-ai/hypit/blob/main/packages/ranking/src/component.ts) and [render.ts](https://github.com/hypit-ai/hypit/blob/main/packages/ranking/src/render.ts) | Build the ranking program and produce picture and optional sound from that schedule. |+| [manifest.ts](https://github.com/hypit-ai/hypit/blob/main/packages/ranking/src/manifest.ts) and [activation.ts](https://github.com/hypit-ai/hypit/blob/main/packages/ranking/src/activation.ts) | Publish Types, Producers, Surface vocabulary and package contributions. |+| [Ranking Companion](https://github.com/hypit-ai/hypit/blob/main/packages/ranking/src/studio.ts) | Read the same program, present persistent rows and activation lanes, and connect edits to actual Source inputs. |A project component can use these relationships with its own behavior. External TypeScript uses-`@hypit/hypit/author-kit`, `@hypit/hypit/temporal-markup` and the appropriate `@hypit/hypit/*` domain APIs; the official-implementation's `@hypit/*` imports are internal workspace spellings. Copy the relevant idea into+`@hypit/hypit/author`, `@hypit/hypit/producer`, `@hypit/hypit/admission`,+`@hypit/hypit/markup`, `@hypit/hypit/temporal/markup` and the appropriate domain APIs. Copy the relevant idea intothe project's own package, with its own Module identity, instead of editing the installed Ranking.The Companion uses published values and temporal lineage, so a visible row and its reveal handle canrepresent different spans. Moving the authored semantic boundary changes the shared event and its-consumers; editing a Style changes its appearance. [Studio Adapter](../studio-adapter/README.md)+consumers; editing a Style changes its appearance. [Studio Companion](../studio-companion/README.md)contains a minimal project Companion and the exact presentation/editing interface.diff --git a/packages/ranking/package.json b/packages/ranking/package.jsonindex 2c13acc3..a7940387 100644--- a/packages/ranking/package.json+++ b/packages/ranking/package.json@@ -5,27 +5,33 @@"private": true,"type": "module","exports": {- ".": "./src/index.ts"+ ".": "./src/index.ts",+ "./studio": "./src/studio.ts"},+ "files": [+ "dist",+ "preview",+ "README.md"+ ],"hypit": {"activation": "./src/activation.ts"},- "dependencies": {- "@hypit/artifact": "workspace:*",- "@hypit/component-kit": "workspace:*",- "@hypit/composition": "workspace:*",- "@hypit/elaborator": "workspace:*",+ "peerDependencies": {+ "@hypit/hypit": "workspace:^",+ "@hypit/studio-companion": "workspace:^"+ },+ "devDependencies": {+ "@hypit/kernel": "workspace:*",+ "@hypit/hypit": "workspace:*",+ "@hypit/studio-companion": "workspace:*",+ "@hypit/markup": "workspace:*","@hypit/media": "workspace:*",- "@hypit/protocol": "workspace:*",- "@hypit/timeline": "workspace:*",+ "@hypit/narrative": "workspace:*",+ "@hypit/recipe": "workspace:*","@hypit/spatial": "workspace:*",- "@hypit/svs": "workspace:*","@hypit/temporal": "workspace:*",- "@hypit/temporal-markup": "workspace:*","@hypit/text": "workspace:*",- "@hypit/markup": "workspace:*"- },- "devDependencies": {- "@hypit/core": "workspace:*"+ "@hypit/timeline": "workspace:*",+ "typescript": "5.9.3"}}diff --git a/packages/ranking/src/activation.ts b/packages/ranking/src/activation.tsindex cf9ef4fd..19a90784 100644--- a/packages/ranking/src/activation.ts+++ b/packages/ranking/src/activation.ts@@ -1,4 +1,7 @@-import { createMarkupSurfaceHostFacet } from "@hypit/markup";+import { createAdmissionPackageFacet } from "@hypit/hypit/admission";+import { createProducerPackageFacet } from "@hypit/hypit/producer";+import { createMarkupSurfaceFacet } from "@hypit/hypit/markup";+import { createStudioTrackCompanionFacet } from "@hypit/studio-companion";import {decodeColumnStyleSurface,@@ -12,6 +15,7 @@ import {rankingMarkupSurfaces,rankingModuleRef,} from "./index.js";+import { rankingStudioTrackCompanions } from "./studio.js";const facets = [["tier-style", decodeTierBoardStyleSurface],@@ -23,16 +27,19 @@ const facets = [] as const;export const hypitPackage = {- format: "hypit.node-package@1" as const,+ format: "hypit.package@1" as const,modules: [{manifest: rankingManifest,}],- components: [rankingComponent],- hostFacets: facets.map(([surface, handler]) => createMarkupSurfaceHostFacet({- module: rankingModuleRef,- declaration: rankingMarkupSurfaces.find((item) => item.name === surface)!,- handler,- })),+ facets: [+ ...[rankingComponent].flatMap((component) => [createProducerPackageFacet(component), createAdmissionPackageFacet(component)]),+ ...facets.map(([surface, handler]) => createMarkupSurfaceFacet({+ module: rankingModuleRef,+ declaration: rankingMarkupSurfaces.find((item) => item.name === surface)!,+ handler,+ })),+ createStudioTrackCompanionFacet(rankingStudioTrackCompanions),+ ],};export default hypitPackage;diff --git a/packages/ranking/src/component.ts b/packages/ranking/src/component.tsindex 91f1d50b..258920d2 100644--- a/packages/ranking/src/component.ts+++ b/packages/ranking/src/component.ts@@ -1,11 +1,12 @@-import type { Timeline } from "@hypit/timeline";-import type { ComponentPackage, ProducerHandlerContext } from "@hypit/component-kit";-import type { SynchronizedMedia } from "@hypit/media";-import { canonicalize } from "@hypit/protocol";-import type { BlobRef, StoredValue } from "@hypit/protocol";-import type { TemporalInstant, TemporalWindow } from "@hypit/temporal";-import type { SpatialFrame } from "@hypit/spatial";-import type { Text } from "@hypit/text";+import type { Timeline } from "@hypit/hypit/timeline";+import type { ProducerPackage, ProducerHandlerContext } from "@hypit/hypit/producer";+import type { AdmissionPackage } from "@hypit/hypit/admission";+import type { SynchronizedMedia } from "@hypit/hypit/media";+import { canonicalize } from "@hypit/hypit/protocol";+import type { BlobRef, StoredValue } from "@hypit/hypit/protocol";+import type { TemporalInstant, TemporalWindow } from "@hypit/hypit/temporal";+import type { SpatialFrame } from "@hypit/hypit/spatial";+import type { Text } from "@hypit/hypit/text";import { rankingProducers, rankingTypes } from "./manifest.js";import { appendColumnItem, appendColumnWindow, appendRankingItemSpec, appendRankingSound, appendTierBoardItem, appendTierBoardWindow, appendTopThreeItem, appendTriggeredRankingCandidate, assertColumnProgram, assertRankingSchedule, assertRankingSoundEventPlan, assertTierBoardProgram, assertTopThreeProgram, buildColumnProgram, buildColumnSchedule, buildColumnSoundEvents, buildTriggeredRankingSchedule, buildTierBoardProgram, buildTierBoardSchedule, buildTierBoardSoundEvents, buildTopThreeProgram, buildTopThreeSoundEvents, createColumnItemSet, createColumnWindowSet, createRankingItemSpecSet, createRankingSoundSet, createTierBoardItemSet, createTierBoardWindowSet, createTopThreeItemSet, createTriggeredRankingCandidateSet, materializeRankingTextItem } from "./schedule.js";@@ -268,4 +269,4 @@ export const rankingComponent = {{ type: rankingTypes.soundEvents,handler: ({ value }) => assertRankingSoundEventPlan(inline<RankingSoundEventPlan>(value, "RankingSoundEventPlan")) },],-} satisfies ComponentPackage;+} satisfies ProducerPackage & AdmissionPackage;diff --git a/packages/ranking/src/fragment.ts b/packages/ranking/src/fragment.tsindex 561fec2e..6647fb07 100644--- a/packages/ranking/src/fragment.ts+++ b/packages/ranking/src/fragment.ts@@ -1,12 +1,12 @@-import { timelineTypes } from "@hypit/timeline";+import { timelineTypes } from "@hypit/hypit/timeline";-import { compositionTypes } from "@hypit/composition";-import { sealGraphFragment } from "@hypit/elaborator";-import type { FragmentOperation, GraphFragment } from "@hypit/elaborator";-import { mediaTypes } from "@hypit/media";-import { spatialTypes } from "@hypit/spatial";-import { textTypes } from "@hypit/text";-import { temporalTypes } from "@hypit/temporal";+import { compositionTypes } from "@hypit/hypit/composition";+import { sealGraphFragment } from "@hypit/hypit/author";+import type { FragmentOperation, GraphFragment } from "@hypit/hypit/author";+import { mediaTypes } from "@hypit/hypit/media";+import { spatialTypes } from "@hypit/hypit/spatial";+import { textTypes } from "@hypit/hypit/text";+import { temporalTypes } from "@hypit/hypit/temporal";import { rankingProducers, rankingTypes } from "./manifest.js";import type { RankingVariant } from "./types.js";diff --git a/packages/ranking/src/manifest.ts b/packages/ranking/src/manifest.tsindex afbe36b8..1a083204 100644--- a/packages/ranking/src/manifest.ts+++ b/packages/ranking/src/manifest.ts@@ -1,17 +1,17 @@-import { timelineTypes, timelineDependency } from "@hypit/timeline";-import { temporalContextAttributeVocabulary } from "@hypit/temporal-markup";+import { timelineTypes, timelineDependency } from "@hypit/hypit/timeline";+import { temporalContextAttributeVocabulary } from "@hypit/hypit/temporal/markup";import { readFile } from "node:fs/promises";-import { artifactDependency } from "@hypit/artifact";-import { compositionDependency, compositionTypes } from "@hypit/composition";-import { mediaDependency, mediaTypes } from "@hypit/media";+import { blobDependency } from "@hypit/hypit/blob";+import { compositionDependency, compositionTypes } from "@hypit/hypit/composition";+import { mediaDependency, mediaTypes } from "@hypit/hypit/media";-import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/protocol";-import { spatialDependency, spatialFrameSchema, spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";-import { temporalDependency, temporalInstantSchema, temporalTypes, temporalWindowSchema } from "@hypit/temporal";-import { temporalInstantAttributeVocabulary } from "@hypit/temporal-markup";-import { textDependency, textTypes } from "@hypit/text";+import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/hypit/protocol";+import { spatialDependency, spatialFrameSchema, spatialTypes } from "@hypit/hypit/spatial";+import { recipeType } from "@hypit/hypit/recipe";+import { temporalDependency, temporalInstantSchema, temporalTypes, temporalWindowSchema } from "@hypit/hypit/temporal";+import { temporalInstantAttributeVocabulary } from "@hypit/hypit/temporal/markup";+import { textDependency, textTypes } from "@hypit/hypit/text";const previewImage = (file: string, mediaType = "image/png") => ({mediaType,@@ -142,7 +142,7 @@ function typedRecipeProperties<const T extends readonly {readonly required: boolean;readonly summary: string;readonly values?: readonly string[];- readonly fallback?: import("@hypit/protocol").CanonicalValue;+ readonly fallback?: import("@hypit/hypit/protocol").CanonicalValue;}[]>(properties: T) {return properties.map((property) => {const schema = rankingRecipeSchemas[property.name as keyof typeof rankingRecipeSchemas];@@ -251,7 +251,7 @@ const allRankingMarkupSurfaces = [attributes: [{ name: "id", kind: "identifier", required: true,summary: "Names this Style so a TierBoard can reference it." },- { name: "recipe", kind: "reference", required: true, accepts: [svsRecipeType],+ { name: "recipe", kind: "reference", required: true, accepts: [recipeType],summary: "Chooses the Recipe carrying the tier rows, board Paint, row and cell geometry, icon treatment and entrance motion.",recipe: typedRecipeProperties([{ name: "rows", required: false, fallback: [@@ -327,7 +327,7 @@ const allRankingMarkupSurfaces = [attributes: [{ name: "id", kind: "identifier", required: true,summary: "Names this Style so a Column can reference it." },- { name: "recipe", kind: "reference", required: true, accepts: [svsRecipeType],+ { name: "recipe", kind: "reference", required: true, accepts: [recipeType],summary: "Chooses the Recipe carrying the rank colors, board Paint, row geometry, icon treatment, staging pose and motion.",recipe: typedRecipeProperties([{ name: "rank-colors", required: false, fallback: ["#facc15", "#d1d5db", "#fb923c", "#60a5fa", "#a78bfa"],@@ -420,7 +420,7 @@ const allRankingMarkupSurfaces = [attributes: [{ name: "id", kind: "identifier", required: true,summary: "Names this Style so a TopThree can reference it." },- { name: "recipe", kind: "reference", required: true, accepts: [svsRecipeType],+ { name: "recipe", kind: "reference", required: true, accepts: [recipeType],summary: "Chooses the Recipe carrying the slot colors, podium geometry, ring and label spacing, board Paint and motion.",recipe: typedRecipeProperties([{ name: "slot-colors", required: false, fallback: ["#facc15", "#d1d5db", "#fb923c"],@@ -697,7 +697,7 @@ export const rankingMarkupSurfaces = allRankingMarkupSurfaces;export const rankingManifest: ModuleManifest = {format: "hypit.module@1", name: rankingModuleRef.name, version: rankingModuleRef.version,- dependencies: [artifactDependency, mediaDependency, timelineDependency, spatialDependency, temporalDependency, compositionDependency, textDependency],+ dependencies: [blobDependency, mediaDependency, timelineDependency, spatialDependency, temporalDependency, compositionDependency, textDependency],types: [{ name: rankingTypes.header.name },{ name: rankingTypes.itemSpec.name },diff --git a/packages/ranking/src/render.ts b/packages/ranking/src/render.tsindex 5a199c16..b0f2c62e 100644--- a/packages/ranking/src/render.ts+++ b/packages/ranking/src/render.ts@@ -1,11 +1,11 @@-import { assertTimelineIdentity, timelineFrameSampleBoundary, timelineSampleFrames } from "@hypit/timeline";-import type { Timeline } from "@hypit/timeline";+import { assertTimelineIdentity, timelineFrameSampleBoundary, timelineSampleFrames } from "@hypit/hypit/timeline";+import type { Timeline } from "@hypit/hypit/timeline";import {assertAudioTrackIdentity,assertVisualTrackIdentity,sealAudioTrack,sealVisualTrack,-} from "@hypit/composition";+} from "@hypit/hypit/composition";import type {AudioClip,AudioTrack,@@ -14,8 +14,8 @@ import type {VisualPresent,VisualStyleDeclaration,VisualTrack,-} from "@hypit/composition";-import { synchronizedMediaSampleFrames, verifySynchronizedMedia } from "@hypit/media";+} from "@hypit/hypit/composition";+import { synchronizedMediaSampleFrames, verifySynchronizedMedia } from "@hypit/hypit/media";import {assertColumnProgram,diff --git a/packages/ranking/src/schedule.ts b/packages/ranking/src/schedule.tsindex 43ed0c0a..e958d98a 100644--- a/packages/ranking/src/schedule.ts+++ b/packages/ranking/src/schedule.ts@@ -1,21 +1,21 @@-import { assertTimelineIdentity, timelineFrameCount } from "@hypit/timeline";-import type { Timeline } from "@hypit/timeline";+import { assertTimelineIdentity, timelineFrameCount } from "@hypit/hypit/timeline";+import type { Timeline } from "@hypit/hypit/timeline";import {assertFontArtifactRef,verifySynchronizedMedia,-} from "@hypit/media";-import type { SynchronizedMedia } from "@hypit/media";-import { canonicalize, isResourceId } from "@hypit/protocol";-import { verifyText } from "@hypit/text";-import type { Text } from "@hypit/text";-import { assertSpatialFrame } from "@hypit/spatial";-import type { SpatialFrame } from "@hypit/spatial";+} from "@hypit/hypit/media";+import type { SynchronizedMedia } from "@hypit/hypit/media";+import { canonicalize, isResourceId } from "@hypit/hypit/protocol";+import { verifyText } from "@hypit/hypit/text";+import type { Text } from "@hypit/hypit/text";+import { assertSpatialFrame } from "@hypit/hypit/spatial";+import type { SpatialFrame } from "@hypit/hypit/spatial";import {assertTemporalInstantFor,assertTemporalWindowFor,resolveTriggeredSchedule,-} from "@hypit/temporal";-import type { TemporalInstant, TemporalWindow } from "@hypit/temporal";+} from "@hypit/hypit/temporal";+import type { TemporalInstant, TemporalWindow } from "@hypit/hypit/temporal";import type {ColumnItem,@@ -769,7 +769,7 @@ export function buildColumnProgram(header: RankingHeader, withinValue: SpatialFrreturn canonicalize(result) as unknown as ColumnProgram;}-export function buildTopThreeProgram(header: RankingHeader, frameValue: import("@hypit/spatial").SpatialFrame, schedule: RankingSchedule, style: TopThreeStyle, set: TopThreeItemSet): TopThreeProgram {+export function buildTopThreeProgram(header: RankingHeader, frameValue: import("@hypit/hypit/spatial").SpatialFrame, schedule: RankingSchedule, style: TopThreeStyle, set: TopThreeItemSet): TopThreeProgram {assert(header.variant === "top-three" && schedule.variant === "top-three", "TopThree variant is inconsistent.");assertSpatialFrame(frameValue);assertTopThreeStyle(style);diff --git a/packages/ranking-studio/src/index.ts b/packages/ranking/src/studio.tssimilarity index 95%rename from packages/ranking-studio/src/index.tsrename to packages/ranking/src/studio.tsindex a5f0ab96..bd7aa3f8 100644--- a/packages/ranking-studio/src/index.ts+++ b/packages/ranking/src/studio.ts@@ -1,13 +1,23 @@-import { openFontStudioFields } from "@hypit/fonts-open/studio";-import { rankingMarkupSurfaces, rankingModuleRef, rankingTypes } from "@hypit/ranking";-import type { RankingProgram, RankingSchedule, RankingSoundEventPlan } from "@hypit/ranking";-import { compositionTypes } from "@hypit/composition";-import type { AudioTrack } from "@hypit/composition";-import type { StudioTrackCompanion, StudioTrackCompanionContext, StudioEntityDraft, StudioInspectorFieldDeclaration, StudioSourceBindingDeclaration } from "@hypit/studio-adapter";-import { artifactPreview, authoredChildFor, previewLayer, requiredSurfaceValue, temporalLineageFor, temporalDomainSource } from "@hypit/studio-adapter";+import { rankingMarkupSurfaces, rankingModuleRef, rankingTypes } from "./index.js";+import type { RankingProgram, RankingSchedule, RankingSoundEventPlan } from "./index.js";+import { compositionTypes } from "@hypit/hypit/composition";+import type { AudioTrack } from "@hypit/hypit/composition";+import type { StudioTrackCompanion, StudioTrackCompanionContext, StudioEntityDraft, StudioInspectorFieldDeclaration, StudioSourceBindingDeclaration } from "@hypit/studio-companion";+import { artifactPreview, authoredChildFor, previewLayer, requiredSurfaceValue, temporalLineageFor, temporalDomainSource } from "@hypit/studio-companion";-const fontInspector = openFontStudioFields("style");+const fontInspector: {+ readonly binding: StudioSourceBindingDeclaration;+ readonly fields: readonly StudioInspectorFieldDeclaration[];+} = {+ binding: { name: "font", referenced: [{ name: "family", writable: true }] },+ fields: [{+ binding: "style.font.family", label: "Font Family", domain: "how",+ page: { id: "font", label: "Font" }, section: { id: "face", label: "Primary Face" },+ summary: "Changes the authored primary font family reference.",+ control: "text",+ }],+};const frameParameters: readonly StudioSourceBindingDeclaration[] = [{ name: "within" },diff --git a/packages/ranking/src/style.ts b/packages/ranking/src/style.tsindex bb594b87..ea210342 100644--- a/packages/ranking/src/style.ts+++ b/packages/ranking/src/style.ts@@ -1,13 +1,13 @@import {assertFontArtifactRef,assertFontStackRef,-} from "@hypit/media";+} from "@hypit/hypit/media";import type {FontArtifactRef,FontStackRef,-} from "@hypit/media";-import { canonicalize } from "@hypit/protocol";-import type { SvsRecipe } from "@hypit/svs";+} from "@hypit/hypit/media";+import { canonicalize } from "@hypit/hypit/protocol";+import type { Recipe } from "@hypit/hypit/recipe";import {assertColumnStyle,@@ -55,44 +55,44 @@ const TOP_KEYS = ["ring-width", "label-gap",] as const;-function fail(recipe: SvsRecipe, message: string): never {+function fail(recipe: Recipe, message: string): never {throw new Error(`Ranking Recipe ${recipe.path} ${message}`);}-function known(recipe: SvsRecipe, allowed: readonly string[]): void {+function known(recipe: Recipe, allowed: readonly string[]): void {const set = new Set(allowed);const unknown = Object.keys(recipe.properties).filter((key) => !set.has(key));if (unknown.length > 0) fail(recipe, `does not accept ${unknown.join(", ")}.`);}-function number(recipe: SvsRecipe, name: string, fallback: number): number {+function number(recipe: Recipe, name: string, fallback: number): number {const value = recipe.properties[name];if (value === undefined) return fallback;if (typeof value !== "number" || !Number.isFinite(value)) fail(recipe, `${name} must be a finite number.`);return value;}-function integer(recipe: SvsRecipe, name: string, fallback: number): number {+function integer(recipe: Recipe, name: string, fallback: number): number {const value = number(recipe, name, fallback);if (!Number.isSafeInteger(value)) fail(recipe, `${name} must be an integer.`);return value;}-function optionalNumber(recipe: SvsRecipe, name: string): number | undefined {+function optionalNumber(recipe: Recipe, name: string): number | undefined {const value = recipe.properties[name];if (value === undefined) return undefined;if (typeof value !== "number" || !Number.isFinite(value)) fail(recipe, `${name} must be a finite number.`);return value;}-function text(recipe: SvsRecipe, name: string, fallback: string): string {+function text(recipe: Recipe, name: string, fallback: string): string {const value = recipe.properties[name];if (value === undefined) return fallback;if (typeof value !== "string" || value.trim().length === 0) fail(recipe, `${name} must be text.`);return value.trim();}-function oneOf<T extends string>(recipe: SvsRecipe, name: string, values: readonly T[], fallback: T): T {+function oneOf<T extends string>(recipe: Recipe, name: string, values: readonly T[], fallback: T): T {const value = text(recipe, name, fallback);if (!values.includes(value as T)) fail(recipe, `${name} must be ${values.join(" | ")}.`);return value as T;@@ -107,7 +107,7 @@ function exactFonts(value: FontStackRef | FontArtifactRef): FontArtifactRef[] {return [structuredClone(value)];}-function typography(recipe: SvsRecipe, fonts: readonly FontArtifactRef[]): RankingTextStyle {+function typography(recipe: Recipe, fonts: readonly FontArtifactRef[]): RankingTextStyle {return {fonts: structuredClone(fonts),sizePx: number(recipe, "font-size", 28),@@ -117,7 +117,7 @@ function typography(recipe: SvsRecipe, fonts: readonly FontArtifactRef[]): Ranki};}-function board(recipe: SvsRecipe): RankingBoardPaint {+function board(recipe: Recipe): RankingBoardPaint {return {background: text(recipe, "board-background", "#151821"),borderColor: text(recipe, "board-border-color", "#ffffff33"),@@ -133,7 +133,7 @@ function board(recipe: SvsRecipe): RankingBoardPaint {};}-function motion(recipe: SvsRecipe): RankingMotionStyle {+function motion(recipe: Recipe): RankingMotionStyle {return {appearFrames: integer(recipe, "appear-frames", 6),moveFrames: integer(recipe, "move-frames", 8),@@ -141,7 +141,7 @@ function motion(recipe: SvsRecipe): RankingMotionStyle {};}-function sound(recipe: SvsRecipe): RankingSoundStyle {+function sound(recipe: Recipe): RankingSoundStyle {const value: RankingSoundStyle = {appearGain: number(recipe, "appear-gain", 1),@@ -152,7 +152,7 @@ function sound(recipe: SvsRecipe): RankingSoundStyle {return canonicalize(value) as unknown as RankingSoundStyle;}-function rowList(recipe: SvsRecipe): TierRowStyle[] {+function rowList(recipe: Recipe): TierRowStyle[] {const value = recipe.properties.rows ?? [{ id: "s", label: "S", color: "#EE5F52" },{ id: "a", label: "A", color: "#F0A04C" },@@ -175,7 +175,7 @@ function rowList(recipe: SvsRecipe): TierRowStyle[] {});}-function colorList(recipe: SvsRecipe, name: string, fallback: readonly string[]): string[] {+function colorList(recipe: Recipe, name: string, fallback: readonly string[]): string[] {const value = recipe.properties[name] ?? fallback;if (!Array.isArray(value) || value.length === 0) fail(recipe, `${name} must be a non-empty color array.`);return value.map((item, index) => {@@ -185,7 +185,7 @@ function colorList(recipe: SvsRecipe, name: string, fallback: readonly string[])}export function decodeTierBoardStyle(- recipe: SvsRecipe,+ recipe: Recipe,font: FontStackRef | FontArtifactRef,): { readonly style: TierBoardStyle; readonly sound: RankingSoundStyle } {known(recipe, TIER_KEYS);@@ -218,7 +218,7 @@ export function decodeTierBoardStyle(}export function decodeColumnStyle(- recipe: SvsRecipe,+ recipe: Recipe,font: FontStackRef | FontArtifactRef,): { readonly style: ColumnStyle; readonly sound: RankingSoundStyle } {known(recipe, COLUMN_KEYS);@@ -246,7 +246,7 @@ export function decodeColumnStyle(}export function decodeTopThreeStyle(- recipe: SvsRecipe,+ recipe: Recipe,font: FontStackRef | FontArtifactRef,): { readonly style: TopThreeStyle; readonly sound: RankingSoundStyle } {known(recipe, TOP_KEYS);diff --git a/packages/ranking/src/surface.ts b/packages/ranking/src/surface.tsindex 256ddac3..33fc4744 100644--- a/packages/ranking/src/surface.ts+++ b/packages/ranking/src/surface.ts@@ -1,25 +1,13 @@-import { resolveTemporalContext } from "@hypit/temporal-markup";-import {- assertEmptyElement as empty,- assertAttributes as allowed,- localName,- textAttribute as text,- optionalTextAttribute as optionalText,- type StructuredElement,- type StructuredSurfaceHandler,- type SurfaceComponentDraft,- type SurfaceRecordDraft,- type SurfaceResolvedReference,- type MarkupAttributeValue,-} from "@hypit/markup";-import { sameType, type CanonicalValue, type TypeRef } from "@hypit/protocol";-import { mediaTypes } from "@hypit/media";-import type { FontArtifactRef, FontStackRef } from "@hypit/media";-import { spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";-import type { SvsRecipe } from "@hypit/svs";-import { textTypes } from "@hypit/text";-import { createTemporalInstantConstruction, createTemporalWindowConstruction, temporalInstantAttributeNames } from "@hypit/temporal-markup";+import { resolveTemporalContext } from "@hypit/hypit/temporal/markup";+import { assertEmptyElement as empty, assertAttributes as allowed, localName, textAttribute as text, optionalTextAttribute as optionalText, type StructuredElement, type StructuredSurfaceHandler, type SurfaceComponentDraft, type SurfaceRecordDraft, type SurfaceResolvedReference, type MarkupAttributeValue } from "@hypit/hypit/markup";+import { sameType, type CanonicalValue, type TypeRef } from "@hypit/hypit/protocol";+import { mediaTypes } from "@hypit/hypit/media";+import type { FontArtifactRef, FontStackRef } from "@hypit/hypit/media";+import { spatialTypes } from "@hypit/hypit/spatial";+import { recipeType } from "@hypit/hypit/recipe";+import type { Recipe } from "@hypit/hypit/recipe";+import { textTypes } from "@hypit/hypit/text";+import { createTemporalInstantConstruction, createTemporalWindowConstruction, temporalInstantAttributeNames } from "@hypit/hypit/temporal/markup";import { createRankingFragment } from "./fragment.js";import type { RankingFragmentItem, RankingFragmentSound } from "./fragment.js";@@ -91,15 +79,15 @@ function inline<T>(value: SurfaceResolvedReference, label: string): T {function styleSurface<T>(styleType: TypeRef,- decode: (recipe: SvsRecipe, font: FontArtifactRef | FontStackRef) => { readonly style: T; readonly sound: RankingSoundStyle },+ decode: (recipe: Recipe, font: FontArtifactRef | FontStackRef) => { readonly style: T; readonly sound: RankingSoundStyle },): StructuredSurfaceHandler {return ({ element, resolveReference }) => {allowed(element, ["id", "recipe", "font"]);empty(element);const id = text(element, "id");- const recipeRef = reference(element.attributes.recipe, `${element.name}.recipe`, svsRecipeType, resolveReference);+ const recipeRef = reference(element.attributes.recipe, `${element.name}.recipe`, recipeType, resolveReference);const fontRef = oneOfReference(element.attributes.font, `${element.name}.font`, [mediaTypes.fontArtifact, mediaTypes.fontStack], resolveReference);- const decoded = decode(inline<SvsRecipe>(recipeRef, `${element.name}.recipe`), inline<FontArtifactRef | FontStackRef>(fontRef, `${element.name}.font`));+ const decoded = decode(inline<Recipe>(recipeRef, `${element.name}.recipe`), inline<FontArtifactRef | FontStackRef>(fontRef, `${element.name}.font`));return {records: [{ id, type: styleType, value: { kind: "inline", value: decoded.style as unknown as CanonicalValue }, range: element.range },diff --git a/packages/ranking/src/types.ts b/packages/ranking/src/types.tsindex bbc1a31b..df98a903 100644--- a/packages/ranking/src/types.ts+++ b/packages/ranking/src/types.ts@@ -1,11 +1,11 @@-import type { FrameSpan } from "@hypit/composition";+import type { FrameSpan } from "@hypit/hypit/composition";import type {FontArtifactRef,SynchronizedMedia,-} from "@hypit/media";-import type { BlobRef } from "@hypit/protocol";-import type { SpatialFrame } from "@hypit/spatial";-import type { TemporalInstant, TemporalWindow } from "@hypit/temporal";+} from "@hypit/hypit/media";+import type { BlobRef } from "@hypit/hypit/protocol";+import type { SpatialFrame } from "@hypit/hypit/spatial";+import type { TemporalInstant, TemporalWindow } from "@hypit/hypit/temporal";export type RankingVariant = "tier-board" | "column" | "top-three";diff --git a/packages/ranking-studio/test/companion.test.ts b/packages/ranking/test/companion.test.tssimilarity index 94%rename from packages/ranking-studio/test/companion.test.tsrename to packages/ranking/test/companion.test.tsindex fd52fac4..2ea97891 100644--- a/packages/ranking-studio/test/companion.test.ts+++ b/packages/ranking/test/companion.test.ts@@ -1,8 +1,8 @@import assert from "node:assert/strict";import test from "node:test";-import { compositionTypes } from "@hypit/composition";-import type { StudioTrackCompanionContext } from "@hypit/studio-adapter";-import { rankingStudioTrackCompanions } from "../src/index.js";+import { compositionTypes } from "@hypit/hypit/composition";+import type { StudioTrackCompanionContext } from "@hypit/studio-companion";+import { rankingStudioTrackCompanions } from "../src/studio.js";test("each Ranking surface has independent visual and audio Companions", () => {for (const surface of ["column", "tier", "top-three"]) {diff --git a/packages/ranking/test/ranking.test.ts b/packages/ranking/test/ranking.test.tsindex aaddd439..2332ff12 100644--- a/packages/ranking/test/ranking.test.ts+++ b/packages/ranking/test/ranking.test.ts@@ -6,12 +6,12 @@ import { fixtureResource } from "../../../test/fixture-resource.js";import { narrativeProjectionFixture, timelineFixture } from "../../../test/timeline-fixture.js";import { projectMomentInstantFixture, projectSegmentWindow, projectSelectionWindow } from "../../../test/temporal-fixture.js";-import { createResolvedClosure } from "@hypit/core";+import { createResolvedClosure } from "@hypit/kernel";import type { FontArtifactRef, SynchronizedMedia } from "@hypit/media";import { mediaTypes } from "@hypit/media";import type { NarrativeSegmentRef, NarrativeMomentRef, NarrativeSelectionRef } from "@hypit/narrative";import { sealCanvas, sealSpatialFrame } from "@hypit/spatial";-import type { SvsRecipe } from "@hypit/svs";+import type { Recipe } from "@hypit/recipe";import {appendColumnItem,@@ -78,7 +78,7 @@ import type {TopThreeItemSpec,} from "@hypit/ranking";import { spatialTypes } from "@hypit/spatial";-import { svsRecipeType } from "@hypit/svs";+import { recipeType } from "@hypit/recipe";import { sealText, textManifest, textTypes } from "@hypit/text";import { temporalProducers, temporalTypes } from "@hypit/temporal";import type { TemporalWindow } from "@hypit/temporal";@@ -151,7 +151,7 @@ const font: FontArtifactRef = {weight: 700,style: "normal",};-const recipe = (path: string, properties: SvsRecipe["properties"] = {}): SvsRecipe => ({+const recipe = (path: string, properties: Recipe["properties"] = {}): Recipe => ({path, properties,});const image = (id: string) => ({ kind: "blob" as const, resource: fixtureResource(`ranking-image:${id}`), size: 64, mediaType: "image/png" });@@ -547,7 +547,7 @@ test("all three author Surfaces preserve absolute temporal, spatial, font, image["top-style", rankingTypes.topThreeStyle, decodeTopThreeStyleSurface, {}],] as const;for (const [id, type, handler, properties] of styleCases) {- references.set(`${id}-recipe`, inlineReference(`${id}-recipe`, svsRecipeType, recipe(id, properties)));+ references.set(`${id}-recipe`, inlineReference(`${id}-recipe`, recipeType, recipe(id, properties)));const result = await handler({sourceName: "ranking.svml",element: node(`ranking:${type.name.replace(/Style$/u, "Style")}`, { id, recipe: ref(`${id}-recipe`), font: ref("font") }),diff --git a/packages/screen-overlay-studio/README.md b/packages/screen-overlay-studio/README.mddeleted file mode 100644index 82c858c3..00000000--- a/packages/screen-overlay-studio/README.md+++ /dev/null@@ -1,3 +0,0 @@-# `@hypit/screen-overlay-studio`--Hypit Studio Companion for `@hypit/screen-overlay`.diff --git a/packages/screen-overlay-studio/package.json b/packages/screen-overlay-studio/package.jsondeleted file mode 100644index 6a52f061..00000000--- a/packages/screen-overlay-studio/package.json+++ /dev/null@@ -1,14 +0,0 @@-{- "name": "@hypit/screen-overlay-studio",- "version": "0.0.0-dev",- "license": "SEE LICENSE IN LICENSE",- "private": true,- "type": "module",- "exports": { ".": "./src/index.ts" },- "hypit": { "activation": "./src/activation.ts" },- "dependencies": {- "@hypit/screen-overlay": "workspace:*",- "@hypit/composition": "workspace:*",- "@hypit/studio-adapter": "workspace:*"- }-}diff --git a/packages/screen-overlay-studio/src/activation.ts b/packages/screen-overlay-studio/src/activation.tsdeleted file mode 100644index 3b956509..00000000--- a/packages/screen-overlay-studio/src/activation.ts+++ /dev/null@@ -1,7 +0,0 @@-import { createStudioTrackCompanionHostFacet } from "@hypit/studio-adapter";-import { screenOverlayStudioTrackCompanions } from "./index.js";--export default {- format: "hypit.node-package@1" as const,- hostFacets: [createStudioTrackCompanionHostFacet(screenOverlayStudioTrackCompanions)],-};diff --git a/packages/screen-overlay-studio/src/index.ts b/packages/screen-overlay-studio/src/index.tsdeleted file mode 100644index c2ca7703..00000000--- a/packages/screen-overlay-studio/src/index.ts+++ /dev/null@@ -1,80 +0,0 @@-import { screenOverlayModuleRef, screenOverlayTypes } from "@hypit/screen-overlay";-import type { ScreenOverlayProgram } from "@hypit/screen-overlay";-import { compositionTypes } from "@hypit/composition";-import type { StudioTrackCompanion, StudioTrackCompanionContext, StudioEntityDraft, StudioInspectorFieldDeclaration } from "@hypit/studio-adapter";-import { childEntities, requiredSurfaceValue, temporalLineageFor, temporalDomainSource } from "@hypit/studio-adapter";--function projectOverlays(context: StudioTrackCompanionContext): readonly StudioEntityDraft[] {- const program = requiredSurfaceValue(context, "program") as ScreenOverlayProgram;- const items = program.items.map((item) => ({- id: item.id,- subjectId: item.subjectId,- startFrame: item.span.startFrame,- endFrameExclusive: item.span.endFrameExclusive,- stackOrder: item.z,- sourceTypes: [screenOverlayTypes.itemSpec],- }));- return childEntities(context, items, "screen-overlay", "standard").map((entity, index) => {- const item = program.items[index];- if (item === undefined) return entity;- const temporal = temporalLineageFor(context, item.id, "window");- const semanticSource = temporalDomainSource(temporal);- return {- ...entity,- display: { title: item.content.kind.replaceAll("-", " "), layers: [] },- ...(semanticSource?.id === undefined- ? {}- : { markerId: semanticSource.id }),- ...(temporal === undefined ? {} : { temporal }),- };- });-}--const overlayOptions: Readonly<Record<string, readonly string[]>> = {- direction: ["left", "right", "up", "down"],- chroma: ["monochrome", "color"],-};--const overlayNames = [- "color", "intensity", "opacity", "attack", "hold", "decay", "center-x", "center-y", "radius-x", "radius-y",- "softness", "spacing", "thickness", "angle", "travel", "coverage", "feather", "from", "to", "direction",- "width", "bars", "colors", "seed", "amount", "size", "chroma", "motion-rate", "min-size", "max-size",- "warmth", "drift", "scan-lines", "z",-] as const;--function title(name: string): string {- return name.split("-").map((part) => `${part.slice(0, 1).toUpperCase()}${part.slice(1)}`).join(" ");-}--const overlayGeometry = new Set(["center-x", "center-y", "radius-x", "radius-y", "width", "size", "min-size", "max-size", "z"]);-const overlayMotion = new Set(["attack", "hold", "decay", "travel", "from", "to", "motion-rate", "drift"]);-const overlayColor = new Set(["color", "colors"]);--const overlayInspector: readonly StudioInspectorFieldDeclaration[] = overlayNames.map((binding) => {- const domain = overlayGeometry.has(binding) ? "where" as const : overlayMotion.has(binding) ? "when" as const : "how" as const;- const page = overlayGeometry.has(binding) ? "Geometry" : overlayMotion.has(binding) ? "Motion" : overlayColor.has(binding) ? "Color" : "Effect";- const options = overlayOptions[binding];- const control = options !== undefined ? "select" as const- : binding === "color" ? "color" : binding === "colors" ? "text" : "number";- return {- binding, label: title(binding), domain,- page: { id: page.toLowerCase(), label: page }, section: { id: page.toLowerCase(), label: page },- control,- ...(options === undefined ? {} : { options }),- };-});--export const screenOverlayStudioTrackCompanions: readonly StudioTrackCompanion[] = [- {- id: "track", role: "track",- output: { type: compositionTypes.visualTrack, surface: "track", modules: [screenOverlayModuleRef] },- family: "screen-overlay", tone: "orange", icon: "component",- bindings: [- ...overlayNames.map((name) => ({ name, writable: true })),- ],- inspector: overlayInspector,- requiredValues: ["program"], project: projectOverlays,- poster: { source: "surface-preview" },- lane: { heightPx: 52 },- },-];diff --git a/packages/screen-overlay/README.md b/packages/screen-overlay/README.mddeleted file mode 100644index c4752c98..00000000--- a/packages/screen-overlay/README.md+++ /dev/null@@ -1,17 +0,0 @@-# `@hypit/screen-overlay`--The Track Surface accepts `timeline={program.timeline}`. The same Timeline supports authored-positions and, where prepared Takes supply evidence, Script Selections and Moments. Shared `at`-inputs accept a Moment or a time such as `2s`; `at` with `for` produces a Window where required.--Official provider-free self-contained screen-paint package.--Every item consumes its typed parameters, explicit Temporal source, placement Frame, Timeline,-seed and local frame. Flash, ColorWash, Vignette, ScanLines, DirectionalMatte, WhipVeil,-GlitchVeil, Grain, LightLeak, Bokeh and TVStatic lower to ordinary absolute-stack `VisualTrack`-Presents. These effects generate their own pixels over the selected interval.--For a transition or filter shared by several pictures, a component can own the participating content-and its compositing scope. Structural styles and a local [browser program](../hyperframes/README.md#local-browser-programs)-support filtering, backdrop filtering and blending. A media/surface transformation is useful when-the intended output is a newly prepared asset. Choose the operation according to what it changes.diff --git a/packages/screen-overlay/package.json b/packages/screen-overlay/package.jsondeleted file mode 100644index 9829ee03..00000000--- a/packages/screen-overlay/package.json+++ /dev/null@@ -1,33 +0,0 @@-{- "name": "@hypit/screen-overlay",- "version": "0.0.0-dev",- "license": "SEE LICENSE IN LICENSE",- "private": true,- "type": "module",- "exports": {- ".": "./src/index.ts"- },- "hypit": {- "activation": "./src/activation.ts"- },- "dependencies": {- "@hypit/component-kit": "workspace:*",- "@hypit/composition": "workspace:*",- "@hypit/elaborator": "workspace:*",- "@hypit/protocol": "workspace:*",- "@hypit/timeline": "workspace:*",- "@hypit/spatial": "workspace:*",- "@hypit/temporal": "workspace:*",- "@hypit/temporal-markup": "workspace:*",- "@hypit/markup": "workspace:*"- },- "devDependencies": {- "@hypit/artifact": "workspace:*",- "@hypit/core": "workspace:*",- "@hypit/media": "workspace:*",- "@hypit/speech": "workspace:*",- "@hypit/speech-evidence": "workspace:*",- "@hypit/validation": "workspace:*",- "@hypit/visual-ir": "workspace:*"- }-}diff --git a/packages/screen-overlay/preview/Track.png b/packages/screen-overlay/preview/Track.pngdeleted file mode 100644index fb25aa68..00000000Binary files a/packages/screen-overlay/preview/Track.png and /dev/null differdiff --git a/packages/screen-overlay/src/activation.ts b/packages/screen-overlay/src/activation.tsdeleted file mode 100644index c31c933a..00000000--- a/packages/screen-overlay/src/activation.ts+++ /dev/null@@ -1,15 +0,0 @@-import { createMarkupSurfaceHostFacet } from "@hypit/markup";-import {- decodeScreenOverlaySurface, screenOverlayComponent, screenOverlayManifest, screenOverlayModuleRef,- screenOverlayMarkupSurfaces,-} from "./index.js";-export const hypitPackage = {- format: "hypit.node-package@1" as const,- modules: [{ manifest: screenOverlayManifest }],- components: [screenOverlayComponent],- hostFacets: [createMarkupSurfaceHostFacet({- module: screenOverlayModuleRef,- declaration: screenOverlayMarkupSurfaces.find((item) => item.name === "track")!, handler: decodeScreenOverlaySurface,- })],-};-export default hypitPackage;diff --git a/packages/screen-overlay/src/component.ts b/packages/screen-overlay/src/component.tsdeleted file mode 100644index ad2ac093..00000000--- a/packages/screen-overlay/src/component.ts+++ /dev/null@@ -1,20 +0,0 @@-import type { Timeline } from "@hypit/timeline";-import type { ComponentPackage } from "@hypit/component-kit";-import { canonicalize } from "@hypit/protocol";-import type { StoredValue } from "@hypit/protocol";-import type { SpatialFrame } from "@hypit/spatial";-import { screenOverlayProducers, screenOverlayTypes } from "./manifest.js";-import { appendProjectedScreenOverlay, assertScreenOverlayProgram, createScreenOverlaySet, finalizeScreenOverlay, renderScreenOverlay } from "./program.js";-import type { ScreenOverlayHeader, ScreenOverlayItemSpec, ScreenOverlayProgram, ScreenOverlaySet } from "./types.js";-import type { TemporalWindow } from "@hypit/temporal";-function inline<T>(value: StoredValue | undefined, label: string): T { if (value?.kind !== "inline") throw new Error(`${label} must be inline.`); return value.value as unknown as T; }-const output = (value: unknown) => ({ kind: "inline" as const, value: canonicalize(value) });-export const screenOverlayComponent = {- producers: [- { producer: screenOverlayProducers.createSet, handler: () => ({ outputs: { set: output(createScreenOverlaySet()) }, needs: {} }) },- { producer: screenOverlayProducers.appendItem, handler: ({ inputs }) => ({ outputs: { set: output(appendProjectedScreenOverlay(inline<ScreenOverlaySet>(inputs.set?.value, "ScreenOverlaySet"), inline<ScreenOverlayHeader>(inputs.header?.value, "ScreenOverlayHeader"), inline<Timeline>(inputs.timeline?.value, "Timeline"), inline<ScreenOverlayItemSpec>(inputs.spec?.value, "ScreenOverlayItemSpec"), inline<TemporalWindow>(inputs.window?.value, "TemporalWindow"))) }, needs: {} }) },- { producer: screenOverlayProducers.finalize, handler: ({ inputs }) => ({ outputs: { program: output(finalizeScreenOverlay(inline<ScreenOverlaySet>(inputs.set?.value, "ScreenOverlaySet"), inline<ScreenOverlayHeader>(inputs.header?.value, "ScreenOverlayHeader"))) }, needs: {} }) },- { producer: screenOverlayProducers.render, handler: ({ inputs }) => ({ outputs: { track: output(renderScreenOverlay(inline<SpatialFrame>(inputs.within?.value, "SpatialFrame"), inline<Timeline>(inputs.timeline?.value, "Timeline"), inline<ScreenOverlayProgram>(inputs.program?.value, "ScreenOverlayProgram"))) }, needs: {} }) },- ],- validators: [{ type: screenOverlayTypes.program, handler: ({ value }) => assertScreenOverlayProgram(inline<ScreenOverlayProgram>(value, "ScreenOverlayProgram")) }],-} satisfies ComponentPackage;diff --git a/packages/screen-overlay/src/fragment.ts b/packages/screen-overlay/src/fragment.tsdeleted file mode 100644index cda3f662..00000000--- a/packages/screen-overlay/src/fragment.ts+++ /dev/null@@ -1,41 +0,0 @@-import { timelineTypes } from "@hypit/timeline";--import { compositionTypes } from "@hypit/composition";-import { sealGraphFragment } from "@hypit/elaborator";-import type { FragmentOperation } from "@hypit/elaborator";-import { spatialTypes } from "@hypit/spatial";-import { temporalTypes } from "@hypit/temporal";-import { screenOverlayProducers, screenOverlayTypes } from "./manifest.js";--export type ScreenOverlayFragmentItem = { readonly specName: string; readonly windowName: string };-const input = (name: string) => ({ kind: "fragment-input" as const, name });-const operation = (id: string) => ({ kind: "fragment-operation" as const, operation: id });-export function createScreenOverlayFragment(items: readonly ScreenOverlayFragmentItem[]) {- if (items.length === 0) throw new Error("Screen Overlay Fragment requires at least one Item.");- const types = new Map<string, typeof screenOverlayTypes.itemSpec | typeof temporalTypes.window>();- const operations: FragmentOperation[] = [- { id: "overlay:set:empty", producer: screenOverlayProducers.createSet, inputs: {}, result: { kind: "output", name: "set" } },- ];- let current = "overlay:set:empty";- items.forEach((item, index) => {- types.set(item.specName, screenOverlayTypes.itemSpec);- types.set(item.windowName, temporalTypes.window);- const id = `overlay:set:append:${String(index + 1).padStart(4, "0")}`;- operations.push({ id, producer: screenOverlayProducers.appendItem,- inputs: { set: operation(current), header: input("header"), spec: input(item.specName),- timeline: input("timeline"), window: input(item.windowName) }, result: { kind: "output", name: "set" } });- current = id;- });- operations.push(- { id: "overlay:program", producer: screenOverlayProducers.finalize, inputs: { set: operation(current), header: input("header") }, result: { kind: "output", name: "program" } },- { id: "overlay:track", producer: screenOverlayProducers.render, inputs: { within: input("within"), timeline: input("timeline"), program: operation("overlay:program") }, result: { kind: "output", name: "track" } },- );- return sealGraphFragment({ inputs: [- { name: "within", type: spatialTypes.frame }, { name: "header", type: screenOverlayTypes.header },- { name: "timeline", type: timelineTypes.timeline }, ...[...types].map(([inputName, type]) => ({ name: inputName, type })),- ], operations, exports: [- { name: "program", type: screenOverlayTypes.program, root: operation("overlay:program") },- { name: "visual", type: compositionTypes.visualTrack, root: operation("overlay:track") },- ] });-}-export const programScreenOverlayFragment = createScreenOverlayFragment([{ specName: "spec", windowName: "window" }]);diff --git a/packages/screen-overlay/src/index.ts b/packages/screen-overlay/src/index.tsdeleted file mode 100644index 6ba82f8a..00000000--- a/packages/screen-overlay/src/index.ts+++ /dev/null@@ -1,7 +0,0 @@-export { screenOverlayComponent } from "./component.js";-export { createScreenOverlayFragment, programScreenOverlayFragment } from "./fragment.js";-export type { ScreenOverlayFragmentItem } from "./fragment.js";-export { screenOverlayDependency, screenOverlayHeaderSchema, screenOverlayItemSpecSchema, screenOverlayManifest, screenOverlayMarkupSurfaces, screenOverlayModuleRef, screenOverlayProducers, screenOverlayProgramSchema, screenOverlaySetSchema, screenOverlayTypes } from "./manifest.js";-export { appendProjectedScreenOverlay, assertScreenOverlayComponent, assertScreenOverlayHeader, assertScreenOverlayItemSpec, assertScreenOverlayProgram, assertScreenOverlaySet, createScreenOverlaySet, finalizeScreenOverlay, renderScreenOverlay, sealScreenOverlayHeader, sealScreenOverlayItemSpec, sealScreenOverlayProgram } from "./program.js";-export { decodeScreenOverlaySurface } from "./surface.js";-export type * from "./types.js";diff --git a/packages/screen-overlay/src/manifest.ts b/packages/screen-overlay/src/manifest.tsdeleted file mode 100644index f040fc5e..00000000--- a/packages/screen-overlay/src/manifest.ts+++ /dev/null@@ -1,303 +0,0 @@-import { timelineTypes, timelineDependency } from "@hypit/timeline";-import { temporalContextAttributeVocabulary } from "@hypit/temporal-markup";-import { readFile } from "node:fs/promises";--import { compositionDependency, compositionTypes } from "@hypit/composition";--import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/protocol";-import { spatialDependency, spatialTypes } from "@hypit/spatial";-import { temporalDependency, temporalTypes } from "@hypit/temporal";-import { temporalWindowAttributeVocabulary } from "@hypit/temporal-markup";--const previewImage = (file: string) => ({- mediaType: "image/png",- path: `preview/${file}`,- open: async () => Uint8Array.from(await readFile(new URL(`../preview/${file}`, import.meta.url))),-});--export const screenOverlayModuleRef = { name: "@hypit/screen-overlay", version: "1" } as const;-export const screenOverlayTypes = {- header: { module: screenOverlayModuleRef, name: "ScreenOverlayHeader" },- itemSpec: { module: screenOverlayModuleRef, name: "ScreenOverlayItemSpec" },- set: { module: screenOverlayModuleRef, name: "ScreenOverlaySet" },- program: { module: screenOverlayModuleRef, name: "ScreenOverlayProgram" },-} satisfies Record<string, TypeRef>;-export const screenOverlayProducers = {- createSet: { module: screenOverlayModuleRef, name: "create-screen-overlay-set" },- appendItem: { module: screenOverlayModuleRef, name: "append-screen-overlay-item" },- finalize: { module: screenOverlayModuleRef, name: "finalize-screen-overlay" },- render: { module: screenOverlayModuleRef, name: "render-screen-overlay" },-} satisfies Record<string, ProducerRef>;--const string = { kind: "string", minLength: 1 } as const;-const number = { kind: "number" } as const;-const nonNegative = { kind: "number", minimum: 0 } as const;-const integer = { kind: "number", integer: true } as const;-const unsignedInteger = { kind: "number", integer: true, minimum: 0 } as const;-const object = (fields: Readonly<Record<string, { readonly schema: ValueSchema; readonly optional?: boolean }>>): ValueSchema => ({ kind: "object", fields });-const normalizedPoint = object({ x: { schema: number }, y: { schema: number } });-const colorArray: ValueSchema = { kind: "array", minItems: 1, items: string };-const component: ValueSchema = { kind: "oneOf", variants: [- object({ kind: { schema: { kind: "literal", value: "flash" } }, color: { schema: string }, intensity: { schema: nonNegative }, attackFrames: { schema: unsignedInteger }, holdFrames: { schema: unsignedInteger }, decayFrames: { schema: unsignedInteger } }),- object({ kind: { schema: { kind: "literal", value: "color-wash" } }, color: { schema: string }, opacity: { schema: nonNegative } }),- object({ kind: { schema: { kind: "literal", value: "vignette" } }, center: { schema: normalizedPoint }, radius: { schema: normalizedPoint }, softness: { schema: nonNegative }, color: { schema: string }, opacity: { schema: nonNegative } }),- object({ kind: { schema: { kind: "literal", value: "scan-lines" } }, spacingPx: { schema: nonNegative }, thicknessPx: { schema: nonNegative }, angleDeg: { schema: number }, opacity: { schema: nonNegative }, travelPx: { schema: number } }),- object({ kind: { schema: { kind: "literal", value: "directional-matte" } }, angleDeg: { schema: number }, coverage: { schema: nonNegative }, feather: { schema: nonNegative }, color: { schema: string }, opacity: { schema: nonNegative }, progress: { schema: object({ from: { schema: number }, to: { schema: number } }) } }),- object({ kind: { schema: { kind: "literal", value: "whip-veil" } }, direction: { schema: { kind: "string", enum: ["left", "right", "up", "down"] } }, widthPx: { schema: nonNegative }, softnessPx: { schema: nonNegative }, travelPx: { schema: nonNegative }, opacity: { schema: nonNegative } }),- object({ kind: { schema: { kind: "literal", value: "glitch-veil" } }, bars: { schema: unsignedInteger }, colors: { schema: colorArray }, opacity: { schema: nonNegative }, travelPx: { schema: number }, seed: { schema: unsignedInteger } }),- object({ kind: { schema: { kind: "literal", value: "grain" } }, amount: { schema: nonNegative }, grainSizePx: { schema: nonNegative }, chroma: { schema: { kind: "string", enum: ["monochrome", "color"] } }, motionRatePxPerFrame: { schema: number }, seed: { schema: unsignedInteger } }),- object({ kind: { schema: { kind: "literal", value: "light-leak" } }, colors: { schema: colorArray }, angleDeg: { schema: number }, softness: { schema: nonNegative }, travelPx: { schema: number }, intensity: { schema: nonNegative }, seed: { schema: unsignedInteger } }),- object({ kind: { schema: { kind: "literal", value: "bokeh" } }, amount: { schema: nonNegative }, sizeMinPx: { schema: nonNegative }, sizeMaxPx: { schema: nonNegative }, color: { schema: string }, warmth: { schema: number }, driftPx: { schema: number }, seed: { schema: unsignedInteger } }),- object({ kind: { schema: { kind: "literal", value: "tv-static" } }, amount: { schema: nonNegative }, noiseSizePx: { schema: nonNegative }, scanLineOpacity: { schema: nonNegative }, motionRatePxPerFrame: { schema: number }, seed: { schema: unsignedInteger } }),-] };-const itemSpec = object({- id: { schema: string },- content: { schema: component },- stackingOrder: { schema: integer },-});-const frameSpan = object({ startFrame: { schema: unsignedInteger }, endFrameExclusive: { schema: unsignedInteger } });-const item = object({- id: { schema: string }, span: { schema: frameSpan }, content: { schema: component },- order: { schema: unsignedInteger }, z: { schema: integer },-});-export const screenOverlayHeaderSchema: ValueSchema = object({ id: { schema: string } });-export const screenOverlayItemSpecSchema: ValueSchema = itemSpec;-export const screenOverlaySetSchema: ValueSchema = object({ items: { schema: { kind: "array", items: item } } });-export const screenOverlayProgramSchema: ValueSchema = object({ id: { schema: string }, items: { schema: { kind: "array", minItems: 1, items: item } } });-const appendInputs = [{ name: "set", type: screenOverlayTypes.set }, { name: "header", type: screenOverlayTypes.header }, { name: "timeline", type: timelineTypes.timeline }, { name: "spec", type: screenOverlayTypes.itemSpec }, { name: "window", type: temporalTypes.window }] as const;--const itemAttributes = [- { name: "id", kind: "identifier", required: false,- summary: "Names this item; the overlay numbers the item after its kind when it is omitted." },- { name: "z", kind: "literal", required: true,- summary: "Sets the stacking order this item is painted in against its siblings." },- ...temporalWindowAttributeVocabulary,-] as const;--export const screenOverlayMarkupSurfaces = [- { name: "track", tag: "Track", mode: "structured", outputs: [screenOverlayTypes.header, screenOverlayTypes.itemSpec, temporalTypes.duration, temporalTypes.extent, temporalTypes.shiftSpec, temporalTypes.instantSpec, temporalTypes.windowSpec, temporalTypes.instant, temporalTypes.window, screenOverlayTypes.program, compositionTypes.visualTrack],- vocabulary: {- summary: "Paints self-contained screen treatments across an explicit Frame and publishes the overlay Program and the VisualTrack it renders to.",- appearance: "Treatments laid edge to edge over the selected Frame, never a card or text, each item covering it for its own span only and painted over its siblings in `z` order. Flash pulses one color up to full and back down across the frame, ColorWash holds that same flat color still, and Vignette leaves the middle clear and darkens outwards to one color in an ellipse around a chosen centre. Four items cross the frame as travelling geometry: ScanLines rule it with evenly spaced white stripes at an angle, DirectionalMatte sweeps a feathered wall of color over it, WhipVeil slides a single soft-edged white band left, right, up or down, and LightLeak drags a heavily blurred angled gradient of colors from one side to the other. The remaining four scatter many small shapes from a seed: GlitchVeil throws wide colored horizontal bars that jump sideways, Grain sprinkles fine specks that crawl diagonally, Bokeh floats blurred round discs of one color that drift apart, and TVStatic fills the frame with grey noise cells beneath fine horizontal scan lines.",- preview: previewImage("Track.png"),- attributes: [- { name: "id", kind: "identifier", required: true,- summary: "Names this overlay so its Program and Track can be referenced elsewhere in the Source." },- { name: "within", kind: "reference", required: true, accepts: [spatialTypes.frame],- summary: "Chooses the Frame every item is painted across." },- ...temporalContextAttributeVocabulary,- ],- children: [- { tag: "Flash", cardinality: "many",- summary: "A full-Frame flash of one color with its own attack, hold and decay in frames.",- attributes: [- ...itemAttributes,- { name: "color", kind: "literal", required: true,- summary: "Sets the hexadecimal color the selected Frame flashes." },- { name: "intensity", kind: "literal", required: true,- summary: "Sets how strong the flash is, from 0 to 1." },- { name: "attack", kind: "literal", required: true,- summary: "Sets how many frames the flash takes to reach full intensity." },- { name: "hold", kind: "literal", required: true,- summary: "Sets how many frames the flash stays at full intensity." },- { name: "decay", kind: "literal", required: true,- summary: "Sets how many frames the flash takes to fade away." },- ] },- { tag: "ColorWash", cardinality: "many",- summary: "One flat color held over the whole selected Frame at a fixed opacity.",- attributes: [- ...itemAttributes,- { name: "color", kind: "literal", required: true,- summary: "Sets the hexadecimal color held over the selected Frame." },- { name: "opacity", kind: "literal", required: true,- summary: "Sets how opaque the wash is, from 0 to 1." },- ] },- { tag: "Vignette", cardinality: "many",- summary: "An elliptical falloff of one color around a normalized centre.",- attributes: [- ...itemAttributes,- { name: "center-x", kind: "literal", required: true,- summary: "Sets the horizontal centre of the falloff as a fraction of the selected Frame width." },- { name: "center-y", kind: "literal", required: true,- summary: "Sets the vertical centre of the falloff as a fraction of the selected Frame height." },- { name: "radius-x", kind: "literal", required: true,- summary: "Sets the horizontal radius of the falloff as a fraction of the selected Frame width." },- { name: "radius-y", kind: "literal", required: true,- summary: "Sets the vertical radius of the falloff as a fraction of the selected Frame height." },- { name: "softness", kind: "literal", required: true,- summary: "Sets how gradually the falloff fades outwards, from 0 to 1." },- { name: "color", kind: "literal", required: true,- summary: "Sets the hexadecimal color the edges are darkened with." },- { name: "opacity", kind: "literal", required: true,- summary: "Sets how opaque the vignette is, from 0 to 1." },- ] },- { tag: "ScanLines", cardinality: "many",- summary: "Repeating lines at a fixed spacing, thickness and angle, travelling across the selected Frame.",- attributes: [- ...itemAttributes,- { name: "spacing", kind: "literal", required: true,- summary: "Sets how many pixels apart the lines are." },- { name: "thickness", kind: "literal", required: true,- summary: "Sets how many pixels thick each line is, at most the spacing." },- { name: "angle", kind: "literal", required: true,- summary: "Sets the angle in degrees the lines run at." },- { name: "opacity", kind: "literal", required: true,- summary: "Sets how opaque the lines are, from 0 to 1." },- { name: "travel", kind: "literal", required: true,- summary: "Sets how many pixels the lines travel across the item's span." },- ] },- { tag: "DirectionalMatte", cardinality: "many",- summary: "A feathered matte of one color crossing the selected Frame at an angle over an explicit progress range.",- attributes: [- ...itemAttributes,- { name: "angle", kind: "literal", required: true,- summary: "Sets the angle in degrees the matte edge crosses the selected Frame at." },- { name: "coverage", kind: "literal", required: true,- summary: "Sets how much of the selected Frame the matte covers, from 0 to 1." },- { name: "feather", kind: "literal", required: true,- summary: "Sets how soft the matte edge is, from 0 to 1." },- { name: "color", kind: "literal", required: true,- summary: "Sets the hexadecimal color the matte is filled with." },- { name: "opacity", kind: "literal", required: true,- summary: "Sets how opaque the matte is, from 0 to 1." },- { name: "from", kind: "literal", required: true,- summary: "Sets the progress the matte starts its crossing at, from -1 to 2." },- { name: "to", kind: "literal", required: true,- summary: "Sets the progress the matte ends its crossing at, from -1 to 2." },- ] },- { tag: "WhipVeil", cardinality: "many",- summary: "A soft band that travels across the selected Frame in one of four directions.",- attributes: [- ...itemAttributes,- { name: "direction", kind: "literal", required: true, values: ["left", "right", "up", "down"],- summary: "Chooses which way the band travels across the selected Frame." },- { name: "width", kind: "literal", required: true,- summary: "Sets how many pixels wide the band is." },- { name: "softness", kind: "literal", required: true,- summary: "Sets how many pixels the band's edges are blurred over." },- { name: "travel", kind: "literal", required: true,- summary: "Sets how many pixels the band travels across the item's span." },- { name: "opacity", kind: "literal", required: true,- summary: "Sets how opaque the band is, from 0 to 1." },- ] },- { tag: "GlitchVeil", cardinality: "many",- summary: "Colored bars laid across the selected Frame and displaced from an explicit seed.",- attributes: [- ...itemAttributes,- { name: "bars", kind: "literal", required: true,- summary: "Sets how many bars are laid across the selected Frame, up to 256." },- { name: "colors", kind: "literal", required: true,- summary: "Lists the hexadecimal colors the bars are drawn in, separated by commas." },- { name: "opacity", kind: "literal", required: true,- summary: "Sets how opaque the bars are, from 0 to 1." },- { name: "travel", kind: "literal", required: true,- summary: "Sets how many pixels the bars are displaced across the item's span." },- { name: "seed", kind: "literal", required: true,- summary: "Sets the seed the bar placement and displacement are drawn from." },- ] },- { tag: "Grain", cardinality: "many",- summary: "Grain at a chosen amount, size and chroma, moving from an explicit seed.",- attributes: [- ...itemAttributes,- { name: "amount", kind: "literal", required: true,- summary: "Sets how much grain is laid over the selected Frame, from 0 to 1." },- { name: "size", kind: "literal", required: true,- summary: "Sets how many pixels across one grain particle is." },- { name: "chroma", kind: "literal", required: true, values: ["monochrome", "color"],- summary: "Decides whether the grain is monochrome or colored." },- { name: "motion-rate", kind: "literal", required: true,- summary: "Sets how many pixels the grain moves each frame." },- { name: "seed", kind: "literal", required: true,- summary: "Sets the seed the grain pattern is drawn from." },- ] },- { tag: "LightLeak", cardinality: "many",- summary: "Colored light angled across the selected Frame and moving from an explicit seed.",- attributes: [- ...itemAttributes,- { name: "colors", kind: "literal", required: true,- summary: "Lists the hexadecimal colors the leak is drawn in, separated by commas." },- { name: "angle", kind: "literal", required: true,- summary: "Sets the angle in degrees the light crosses the selected Frame at." },- { name: "softness", kind: "literal", required: true,- summary: "Sets how soft the leak's edges are, from 0 to 1." },- { name: "travel", kind: "literal", required: true,- summary: "Sets how many pixels the leak travels across the item's span." },- { name: "intensity", kind: "literal", required: true,- summary: "Sets how strong the leak is, from 0 to 1." },- { name: "seed", kind: "literal", required: true,- summary: "Sets the seed the leak's placement is drawn from." },- ] },- { tag: "Bokeh", cardinality: "many",- summary: "Out-of-focus highlights between a minimum and maximum size, drifting from an explicit seed.",- attributes: [- ...itemAttributes,- { name: "amount", kind: "literal", required: true,- summary: "Sets how many highlights are scattered over the selected Frame, from 0 to 1." },- { name: "min-size", kind: "literal", required: true,- summary: "Sets how many pixels across the smallest highlight is." },- { name: "max-size", kind: "literal", required: true,- summary: "Sets how many pixels across the largest highlight is, never below `min-size`." },- { name: "color", kind: "literal", required: true,- summary: "Sets the hexadecimal color the highlights are drawn in." },- { name: "warmth", kind: "literal", required: true,- summary: "Sets how warm or cool the highlights are, from -1 to 1." },- { name: "drift", kind: "literal", required: true,- summary: "Sets how many pixels the highlights drift across the item's span." },- { name: "seed", kind: "literal", required: true,- summary: "Sets the seed the highlight placement is drawn from." },- ] },- { tag: "TVStatic", cardinality: "many",- summary: "Broadcast noise with its own scan-line opacity, moving from an explicit seed.",- attributes: [- ...itemAttributes,- { name: "amount", kind: "literal", required: true,- summary: "Sets how much noise covers the selected Frame, from 0 to 1." },- { name: "size", kind: "literal", required: true,- summary: "Sets how many pixels across one noise cell is." },- { name: "scan-lines", kind: "literal", required: true,- summary: "Sets how opaque the scan lines over the noise are, from 0 to 1." },- { name: "motion-rate", kind: "literal", required: true,- summary: "Sets how many pixels the noise moves each frame." },- { name: "seed", kind: "literal", required: true,- summary: "Sets the seed the noise is drawn from." },- ] },- ],- ports: [- { name: "program", type: screenOverlayTypes.program,- summary: "The resolved overlay: every item with its frame span, its content and its stacking." },- { name: "visual", type: compositionTypes.visualTrack,- summary: "The rendered overlay, an ordinary peer VisualTrack." },- ],- example: `<screen:Track id="effects" timeline={speech.timeline} within={vertical.bounds}>- <screen:Flash during={story-time.overlay} z="80"- color="#ffffff" intensity="0.6" attack="2" hold="2" decay="6"/>-</screen:Track>`,- notes: [- "The overlay requires at least one component child, and a component child is empty.",- "A component child writes `during`, or exactly two of `from`, `until` and `for`.",- "`during` takes `timeline` for the whole programme or an already resolved Window.",- "`from` and `until` accept resolved Instants or absolute Timeline expressions.",- "Explicit `start` and `end` timing binds a Selection through `selection` or a Moment through `moment`, never both.",- "A duration is written as an integral `f` or `ms` count, or as an `s` count that may carry a decimal fraction.",- ],- } },-] as const;---export const screenOverlayManifest: ModuleManifest = {- format: "hypit.module@1", name: screenOverlayModuleRef.name, version: screenOverlayModuleRef.version,- dependencies: [timelineDependency, spatialDependency, temporalDependency, compositionDependency],- types: [- { name: screenOverlayTypes.header.name },- { name: screenOverlayTypes.itemSpec.name },- { name: screenOverlayTypes.set.name },- { name: screenOverlayTypes.program.name },- ], capabilities: [],- producers: [- { name: screenOverlayProducers.createSet.name, inputs: [], outputs: [{ name: "set", type: screenOverlayTypes.set }], needs: [] },- { name: screenOverlayProducers.appendItem.name, inputs: [...appendInputs], outputs: [{ name: "set", type: screenOverlayTypes.set }], needs: [] },- { name: screenOverlayProducers.finalize.name, inputs: [{ name: "set", type: screenOverlayTypes.set }, { name: "header", type: screenOverlayTypes.header }], outputs: [{ name: "program", type: screenOverlayTypes.program }], needs: [] },- { name: screenOverlayProducers.render.name, inputs: [{ name: "within", type: spatialTypes.frame }, { name: "timeline", type: timelineTypes.timeline }, { name: "program", type: screenOverlayTypes.program }], outputs: [{ name: "track", type: compositionTypes.visualTrack }], needs: [] },- ],-};-export const screenOverlayDependency = { module: screenOverlayModuleRef } as const;diff --git a/packages/screen-overlay/src/program.ts b/packages/screen-overlay/src/program.tsdeleted file mode 100644index 85e503cb..00000000--- a/packages/screen-overlay/src/program.ts+++ /dev/null@@ -1,325 +0,0 @@-import { assertTimelineIdentity } from "@hypit/timeline";-import type { Timeline } from "@hypit/timeline";-import { assertVisualTrackIdentity, sealVisualTrack } from "@hypit/composition";-import type { VisualAnimation, VisualElement, VisualStyleDeclaration, VisualTrack } from "@hypit/composition";-import { canonicalize } from "@hypit/protocol";-import { assertSpatialFrame } from "@hypit/spatial";-import type { SpatialFrame } from "@hypit/spatial";-import { assertTemporalWindowFor } from "@hypit/temporal";-import type { TemporalWindow } from "@hypit/temporal";--import type {- ScreenOverlayComponent,- ScreenOverlayHeader,- ScreenOverlayItemProgram,- ScreenOverlayItemSpec,- ScreenOverlayProgram,- ScreenOverlaySet,-} from "./types.js";--function assert(condition: unknown, message: string): asserts condition { if (!condition) throw new Error(message); }-function identity(value: string, label: string): void {- assert(/^[A-Za-z][A-Za-z0-9_.:#-]{0,191}$/u.test(value), `${label} is invalid.`);-}-function finite(value: number, label: string): void { assert(Number.isFinite(value), `${label} is invalid.`); }-function range(value: number, minimum: number, maximum: number, label: string): void {- finite(value, label); assert(value >= minimum && value <= maximum, `${label} is outside ${minimum}..${maximum}.`);-}-function positive(value: number, label: string): void { finite(value, label); assert(value > 0, `${label} must be positive.`); }-function nonNegativeInteger(value: number, label: string): void {- assert(Number.isSafeInteger(value) && value >= 0, `${label} must be a non-negative integer.`);-}-function color(value: string, label: string): void {- assert(/^#[0-9a-f]{6}(?:[0-9a-f]{2})?$/iu.test(value), `${label} must be a hexadecimal color.`);-}-function colors(values: readonly string[], label: string): void {- assert(values.length > 0, `${label} requires at least one color.`);- values.forEach((value, index) => color(value, `${label}.${index + 1}`));-}--export function assertScreenOverlayComponent(value: ScreenOverlayComponent): void {- switch (value.kind) {- case "flash":- color(value.color, "Flash color"); range(value.intensity, 0, 1, "Flash intensity");- nonNegativeInteger(value.attackFrames, "Flash attack"); nonNegativeInteger(value.holdFrames, "Flash hold");- nonNegativeInteger(value.decayFrames, "Flash decay"); return;- case "color-wash": color(value.color, "ColorWash color"); range(value.opacity, 0, 1, "ColorWash opacity"); return;- case "vignette":- range(value.center.x, 0, 1, "Vignette center.x"); range(value.center.y, 0, 1, "Vignette center.y");- positive(value.radius.x, "Vignette radius.x"); positive(value.radius.y, "Vignette radius.y");- range(value.softness, 0, 1, "Vignette softness"); color(value.color, "Vignette color");- range(value.opacity, 0, 1, "Vignette opacity"); return;- case "scan-lines":- positive(value.spacingPx, "ScanLines spacing"); positive(value.thicknessPx, "ScanLines thickness");- assert(value.thicknessPx <= value.spacingPx, "ScanLines thickness exceeds spacing.");- finite(value.angleDeg, "ScanLines angle"); range(value.opacity, 0, 1, "ScanLines opacity");- finite(value.travelPx, "ScanLines travel"); return;- case "directional-matte":- finite(value.angleDeg, "DirectionalMatte angle"); range(value.coverage, 0, 1, "DirectionalMatte coverage");- range(value.feather, 0, 1, "DirectionalMatte feather"); color(value.color, "DirectionalMatte color");- range(value.opacity, 0, 1, "DirectionalMatte opacity"); range(value.progress.from, -1, 2, "DirectionalMatte progress.from");- range(value.progress.to, -1, 2, "DirectionalMatte progress.to"); return;- case "whip-veil":- assert(["left", "right", "up", "down"].includes(value.direction), "WhipVeil direction is invalid.");- positive(value.widthPx, "WhipVeil width"); assert(Number.isFinite(value.softnessPx) && value.softnessPx >= 0, "WhipVeil softness is invalid.");- positive(value.travelPx, "WhipVeil travel"); range(value.opacity, 0, 1, "WhipVeil opacity"); return;- case "glitch-veil":- assert(Number.isSafeInteger(value.bars) && value.bars > 0 && value.bars <= 256, "GlitchVeil bars are invalid.");- colors(value.colors, "GlitchVeil colors"); range(value.opacity, 0, 1, "GlitchVeil opacity");- finite(value.travelPx, "GlitchVeil travel"); nonNegativeInteger(value.seed, "GlitchVeil seed"); return;- case "grain":- range(value.amount, 0, 1, "Grain amount"); positive(value.grainSizePx, "Grain size");- assert(value.chroma === "monochrome" || value.chroma === "color", "Grain chroma is invalid.");- finite(value.motionRatePxPerFrame, "Grain motion rate"); nonNegativeInteger(value.seed, "Grain seed"); return;- case "light-leak":- colors(value.colors, "LightLeak colors"); finite(value.angleDeg, "LightLeak angle");- range(value.softness, 0, 1, "LightLeak softness"); finite(value.travelPx, "LightLeak travel");- range(value.intensity, 0, 1, "LightLeak intensity"); nonNegativeInteger(value.seed, "LightLeak seed"); return;- case "bokeh":- range(value.amount, 0, 1, "Bokeh amount"); positive(value.sizeMinPx, "Bokeh minimum size");- assert(Number.isFinite(value.sizeMaxPx) && value.sizeMaxPx >= value.sizeMinPx, "Bokeh size range is invalid.");- color(value.color, "Bokeh color"); range(value.warmth, -1, 1, "Bokeh warmth"); finite(value.driftPx, "Bokeh drift");- nonNegativeInteger(value.seed, "Bokeh seed"); return;- case "tv-static":- range(value.amount, 0, 1, "TVStatic amount"); positive(value.noiseSizePx, "TVStatic noise size");- range(value.scanLineOpacity, 0, 1, "TVStatic scan-line opacity");- finite(value.motionRatePxPerFrame, "TVStatic motion rate"); nonNegativeInteger(value.seed, "TVStatic seed"); return;- }- throw new Error("Screen Overlay component kind is unsupported.");-}--export function sealScreenOverlayHeader(value: ScreenOverlayHeader): ScreenOverlayHeader {- assertScreenOverlayHeader(value); return canonicalize(value) as unknown as ScreenOverlayHeader;-}-export function assertScreenOverlayHeader(value: ScreenOverlayHeader): void {- identity(value.id, "ScreenOverlayHeader.id");-}-export function sealScreenOverlayItemSpec(value: ScreenOverlayItemSpec): ScreenOverlayItemSpec {- assertScreenOverlayItemSpec(value); return canonicalize(value) as unknown as ScreenOverlayItemSpec;-}-export function assertScreenOverlayItemSpec(value: ScreenOverlayItemSpec): void {- identity(value.id, "ScreenOverlayItemSpec.id"); assertScreenOverlayComponent(value.content);- assert(Number.isSafeInteger(value.stackingOrder), "ScreenOverlay stacking order must be an integer.");-}-export function createScreenOverlaySet(): ScreenOverlaySet { return { items: [] }; }-export function assertScreenOverlaySet(value: ScreenOverlaySet): void {- assert(Array.isArray(value.items), "ScreenOverlaySet is invalid.");-}--function realized(- set: ScreenOverlaySet, header: ScreenOverlayHeader, timeline: Timeline, spec: ScreenOverlayItemSpec,- window: TemporalWindow,-): ScreenOverlaySet {- assertScreenOverlaySet(set); assertScreenOverlayHeader(header); assertScreenOverlayItemSpec(spec);- assertTemporalWindowFor(window, { subjectId: spec.id, timeline: timeline });- const addition = {- id: window.id,- subjectId: spec.id,- span: { ...window.span },- content: structuredClone(spec.content),- order: set.items.length,- z: spec.stackingOrder,- } satisfies ScreenOverlayItemProgram;- const ids = new Set(set.items.map((item) => item.id));- assert(!ids.has(addition.id), `Screen Overlay already contains Item ${addition.id}.`);- return { items: [...set.items, addition] };-}--/** Component entry point: timing has already been resolved into a TemporalWindow. */-export function appendProjectedScreenOverlay(- set: ScreenOverlaySet,- header: ScreenOverlayHeader,- timeline: Timeline,- spec: ScreenOverlayItemSpec,- window: TemporalWindow,-): ScreenOverlaySet {- return realized(set, header, timeline, spec, window);-}-export function sealScreenOverlayProgram(value: ScreenOverlayProgram): ScreenOverlayProgram {- const normalized = { id: value.id,- items: [...value.items].map((item) => structuredClone(item)).sort((a, b) => a.id.localeCompare(b.id)) };- assertScreenOverlayProgram(normalized); return canonicalize(normalized) as unknown as ScreenOverlayProgram;-}-export function finalizeScreenOverlay(set: ScreenOverlaySet, header: ScreenOverlayHeader): ScreenOverlayProgram {- assertScreenOverlaySet(set); assertScreenOverlayHeader(header); assert(set.items.length > 0, "Screen Overlay requires at least one Item.");- return sealScreenOverlayProgram({ id: header.id, items: set.items });-}-export function assertScreenOverlayProgram(value: ScreenOverlayProgram): void {- identity(value.id, "ScreenOverlayProgram.id"); assert(value.items.length > 0, "ScreenOverlayProgram requires Items.");- const ids = new Set<string>();- for (const item of value.items) {- identity(item.id, "ScreenOverlayItemProgram.id"); identity(item.subjectId, "ScreenOverlayItemProgram.subjectId");- assert(!ids.has(item.id), `Duplicate Screen Overlay Item ${item.id}.`); ids.add(item.id);- assert(item.span.startFrame >= 0 && item.span.endFrameExclusive > item.span.startFrame,- `Screen Overlay Item ${item.id} timing is invalid.`);- assertScreenOverlayComponent(item.content);- assert(Number.isSafeInteger(item.order) && item.order >= 0, `Screen Overlay Item ${item.id} order is invalid.`);- assert(Number.isSafeInteger(item.z), `Screen Overlay Item ${item.id} z is invalid.`);- }-}--type Random = () => number;-function random(seed: number): Random {- let state = seed >>> 0;- return () => {- state += 0x6d2b79f5;- let value = state;- value = Math.imul(value ^ value >>> 15, value | 1);- value ^= value + Math.imul(value ^ value >>> 7, value | 61);- return ((value ^ value >>> 14) >>> 0) / 4_294_967_296;- };-}-function px(value: number): string { return `${Number(value.toFixed(6))}px`; }-function percent(value: number): string { return `${Number((value * 100).toFixed(6))}%`; }-function rootStyle(within: SpatialFrame): VisualStyleDeclaration[] { return [- { name: "height", value: px(within.heightPx) }, { name: "left", value: px(within.xPx) },- { name: "overflow", value: "hidden" }, { name: "position", value: "absolute" },- { name: "top", value: px(within.yPx) }, { name: "width", value: px(within.widthPx) },-]; }-function fullChild(- id: string,- style: readonly VisualStyleDeclaration[],- animation?: VisualAnimation,- order = 1,-): VisualElement {- const names = new Set(style.map((item) => item.name));- return { id, parent: "root", order, kind: "box", style: [- ...(names.has("inset") ? [] : [{ name: "inset", value: "0" }]),- ...(names.has("position") ? [] : [{ name: "position", value: "absolute" }]),- ...style,- ], ...(animation === undefined ? {} : { animation }) };-}-function animation(duration: number, start: readonly VisualStyleDeclaration[], end: readonly VisualStyleDeclaration[]): VisualAnimation {- return { keyframes: [{ atFrame: 0, style: start }, { atFrame: duration, style: end }] };-}-function flashElements(content: Extract<ScreenOverlayComponent, { kind: "flash" }>, within: SpatialFrame, duration: number): readonly VisualElement[] {- const total = content.attackFrames + content.holdFrames + content.decayFrames;- if (total === 0) return [{ id: "root", order: 0, kind: "box", style: [...rootStyle(within), { name: "background-color", value: content.color }, { name: "opacity", value: content.intensity }] }];- const marks = new Map<number, number>();- marks.set(0, content.attackFrames === 0 ? content.intensity : 0);- marks.set(content.attackFrames, content.intensity);- marks.set(content.attackFrames + content.holdFrames, content.intensity);- marks.set(total, 0);- marks.set(duration, 0);- return [{ id: "root", order: 0, kind: "box", style: [...rootStyle(within), { name: "background-color", value: content.color }],- animation: { keyframes: [...marks].sort(([a], [b]) => a - b).map(([atFrame, opacity]) => ({ atFrame, style: [{ name: "opacity", value: opacity }] })) } }];-}--function overlayElements(content: ScreenOverlayComponent, within: SpatialFrame, duration: number): readonly VisualElement[] {- if (content.kind === "flash") return flashElements(content, within, duration);- const root: VisualElement = { id: "root", order: 0, kind: "box", style: rootStyle(within) };- switch (content.kind) {- case "color-wash": return [root, fullChild("wash", [{ name: "background-color", value: content.color }, { name: "opacity", value: content.opacity }])];- case "vignette": {- const inner = Math.max(0, 1 - content.softness) * 100;- return [root, fullChild("vignette", [{ name: "background-image", value: `radial-gradient(ellipse ${percent(content.radius.x)} ${percent(content.radius.y)} at ${percent(content.center.x)} ${percent(content.center.y)},transparent ${inner}%,${content.color} 100%)` }, { name: "opacity", value: content.opacity }])];- }- case "scan-lines": {- const travel = `translate3d(${px(content.travelPx * Math.cos(content.angleDeg * Math.PI / 180))},${px(content.travelPx * Math.sin(content.angleDeg * Math.PI / 180))},0)`;- return [root, fullChild("scan-lines", [- { name: "background-image", value: `repeating-linear-gradient(${content.angleDeg}deg,#ffffff 0 ${px(content.thicknessPx)},transparent ${px(content.thicknessPx)} ${px(content.spacingPx)})` },- { name: "inset", value: "-20%" }, { name: "opacity", value: content.opacity },- ], animation(duration, [{ name: "transform", value: "translate3d(0px,0px,0)" }], [{ name: "transform", value: travel }]))];- }- case "directional-matte": {- const extent = Math.hypot(within.widthPx, within.heightPx) * 2;- const move = (progress: number) => `rotate(${content.angleDeg}deg) translate3d(${px((progress - 0.5) * extent)},0px,0)`;- const edge = Math.max(0.001, content.feather) * 100;- return [root, fullChild("matte", [- { name: "background-image", value: `linear-gradient(90deg,${content.color} 0 ${100 - edge}%,transparent 100%)` },- { name: "height", value: "200%" }, { name: "left", value: "-50%" }, { name: "opacity", value: content.opacity },- { name: "top", value: "-50%" }, { name: "width", value: `${200 * content.coverage}%` },- ], animation(duration, [{ name: "transform", value: move(content.progress.from) }], [{ name: "transform", value: move(content.progress.to) }]))];- }- case "whip-veil": {- const horizontal = content.direction === "left" || content.direction === "right";- const sign = content.direction === "left" || content.direction === "up" ? -1 : 1;- const gradient = horizontal ? "90deg" : "180deg";- const transform = (distance: number) => horizontal ? `translate3d(${px(distance)},0px,0)` : `translate3d(0px,${px(distance)},0)`;- return [root, fullChild("veil", [- { name: "background-image", value: `linear-gradient(${gradient},transparent 0,#ffffff ${px(content.softnessPx)},#ffffff calc(100% - ${px(content.softnessPx)}),transparent 100%)` },- { name: "height", value: horizontal ? "100%" : px(content.widthPx) }, { name: "opacity", value: content.opacity },- { name: "width", value: horizontal ? px(content.widthPx) : "100%" },- ], animation(duration, [{ name: "transform", value: transform(-sign * content.travelPx) }], [{ name: "transform", value: transform(sign * content.travelPx) }]))];- }- case "glitch-veil": {- const rng = random(content.seed);- return [root, ...Array.from({ length: content.bars }, (_, index): VisualElement => {- const height = 1 + rng() * 12;- const y = rng() * 100;- const x = (rng() - 0.5) * 20;- const colorValue = content.colors[index % content.colors.length]!;- return { id: `bar-${index + 1}`, parent: "root", order: index + 1, kind: "box", style: [- { name: "background-color", value: colorValue }, { name: "height", value: percent(height / 100) },- { name: "left", value: percent(x / 100) }, { name: "opacity", value: content.opacity * (0.35 + rng() * 0.65) },- { name: "position", value: "absolute" }, { name: "top", value: percent(y / 100) }, { name: "width", value: "120%" },- ], animation: animation(duration, [{ name: "transform", value: "translate3d(0px,0px,0)" }], [{ name: "transform", value: `translate3d(${px(content.travelPx * (rng() < 0.5 ? -1 : 1))},0px,0)` }]) };- })];- }- case "grain": {- const rng = random(content.seed); const count = Math.max(1, Math.round(content.amount * 160));- return [root, ...Array.from({ length: count }, (_, index): VisualElement => {- const hue = content.chroma === "color" ? Math.round(rng() * 360) : 0;- const shade = Math.round(rng() * 255);- const background = content.chroma === "color" ? `hsl(${hue} 85% 60%)` : `rgb(${shade} ${shade} ${shade})`;- const drift = content.motionRatePxPerFrame * duration * (rng() < 0.5 ? -1 : 1);- return { id: `grain-${index + 1}`, parent: "root", order: index + 1, kind: "box", style: [- { name: "background-color", value: background }, { name: "height", value: px(content.grainSizePx) },- { name: "left", value: percent(rng()) }, { name: "opacity", value: 0.08 + content.amount * 0.42 },- { name: "position", value: "absolute" }, { name: "top", value: percent(rng()) }, { name: "width", value: px(content.grainSizePx) },- ], animation: animation(duration, [{ name: "transform", value: "translate3d(0px,0px,0)" }], [{ name: "transform", value: `translate3d(${px(drift)},${px(-drift)},0)` }]) };- })];- }- case "light-leak": {- const rng = random(content.seed); const offset = (rng() - 0.5) * 30;- const stops = content.colors.map((entry, index) => `${entry} ${Number(index * 100 / Math.max(1, content.colors.length - 1)).toFixed(3)}%`).join(",");- return [root, fullChild("light-leak", [- { name: "background-image", value: `linear-gradient(${content.angleDeg + offset}deg,transparent 0,${stops},transparent 100%)` },- { name: "filter", value: `blur(${px(content.softness * 80)})` }, { name: "inset", value: "-20%" },- { name: "opacity", value: content.intensity },- ], animation(duration, [{ name: "transform", value: `translate3d(${px(-content.travelPx)},0px,0)` }], [{ name: "transform", value: `translate3d(${px(content.travelPx)},0px,0)` }]))];- }- case "bokeh": {- const rng = random(content.seed); const count = Math.max(1, Math.round(content.amount * 48));- return [root, ...Array.from({ length: count }, (_, index): VisualElement => {- const size = content.sizeMinPx + rng() * (content.sizeMaxPx - content.sizeMinPx);- const warmthFilter = content.warmth === 0 ? "" : `sepia(${Math.abs(content.warmth)}) hue-rotate(${content.warmth < 0 ? 180 : 0}deg) `;- return { id: `bokeh-${index + 1}`, parent: "root", order: index + 1, kind: "box", style: [- { name: "background-color", value: content.color }, { name: "border-radius", value: "50%" },- { name: "filter", value: `${warmthFilter}blur(${px(size * 0.08)})` }, { name: "height", value: px(size) },- { name: "left", value: percent(rng()) }, { name: "opacity", value: 0.08 + rng() * 0.32 },- { name: "position", value: "absolute" }, { name: "top", value: percent(rng()) }, { name: "width", value: px(size) },- ], animation: animation(duration, [{ name: "transform", value: "translate3d(0px,0px,0)" }], [{ name: "transform", value: `translate3d(${px((rng() - 0.5) * content.driftPx)},${px((rng() - 0.5) * content.driftPx)},0)` }]) };- })];- }- case "tv-static": {- const rng = random(content.seed); const columns = Math.ceil(within.widthPx / content.noiseSizePx);- const rows = Math.ceil(within.heightPx / content.noiseSizePx); const count = Math.min(512, Math.max(1, Math.round(columns * rows * content.amount)));- const cells = Array.from({ length: count }, (_, index): VisualElement => {- const shade = Math.round(rng() * 255); const drift = content.motionRatePxPerFrame * duration;- return { id: `static-${index + 1}`, parent: "root", order: index + 1, kind: "box", style: [- { name: "background-color", value: `rgb(${shade} ${shade} ${shade})` }, { name: "height", value: px(content.noiseSizePx) },- { name: "left", value: percent(rng()) }, { name: "opacity", value: 0.2 + content.amount * 0.6 },- { name: "position", value: "absolute" }, { name: "top", value: percent(rng()) }, { name: "width", value: px(content.noiseSizePx) },- ], animation: animation(duration, [{ name: "transform", value: "translate3d(0px,0px,0)" }], [{ name: "transform", value: `translate3d(0px,${px(drift * (rng() < 0.5 ? -1 : 1))},0)` }]) };- });- return [root, ...cells, fullChild("static-scan-lines", [- { name: "background-image", value: "repeating-linear-gradient(180deg,transparent 0 3px,#000000 3px 4px)" },- { name: "opacity", value: content.scanLineOpacity },- ], undefined, cells.length + 1)];- }- }-}--export function renderScreenOverlay(within: SpatialFrame, timeline: Timeline, program: ScreenOverlayProgram): VisualTrack {- assertSpatialFrame(within); assertTimelineIdentity(timeline); assertScreenOverlayProgram(program);- const track = sealVisualTrack({- timelineId: timeline.id, visualIr: "hypit.visual-ir@1", id: program.id,- presents: program.items.map((item) => ({- id: item.id, order: item.order, z: item.z, subjectId: item.subjectId, span: { ...item.span },- elements: overlayElements(item.content, within, item.span.endFrameExclusive - item.span.startFrame),- })),- });- assertVisualTrackIdentity(track, timeline);- return track;-}diff --git a/packages/screen-overlay/src/surface.ts b/packages/screen-overlay/src/surface.tsdeleted file mode 100644index 91a14fb3..00000000--- a/packages/screen-overlay/src/surface.ts+++ /dev/null@@ -1,89 +0,0 @@-import { resolveTemporalContext } from "@hypit/temporal-markup";-import { spatialTypes } from "@hypit/spatial";-import type { StructuredElement, StructuredSurfaceHandler, SurfaceComponentDraft, SurfaceRecordDraft, SurfaceResolvedReference, MarkupAttributeValue } from "@hypit/markup";-import { createTemporalWindowConstruction, temporalWindowAttributeNames } from "@hypit/temporal-markup";-import { createScreenOverlayFragment } from "./fragment.js";-import { screenOverlayTypes } from "./manifest.js";-import { sealScreenOverlayHeader, sealScreenOverlayItemSpec } from "./program.js";-import type { ScreenOverlayComponent } from "./types.js";--const TIMING = temporalWindowAttributeNames;-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 allowed(element: StructuredElement, names: readonly string[]): void {- const permit = new Set(names); const unexpected = Object.keys(element.attributes).filter((name) => !permit.has(name));- if (unexpected.length > 0) throw new Error(`${element.name} has unsupported attributes ${unexpected.join(", ")}.`);-}-function text(element: StructuredElement, name: string, fallback?: string): string {- const value = element.attributes[name]; if (value === undefined && fallback !== undefined) return fallback;- if (typeof value !== "string" || !value.trim()) throw new Error(`${element.name}.${name} must be text.`); return value.trim();-}-function optionalText(element: StructuredElement, name: string): string | undefined {- const value = element.attributes[name]; if (value === undefined) return undefined;- if (typeof value !== "string" || !value.trim()) throw new Error(`${element.name}.${name} must be text.`); return value.trim();-}-function ref(raw: MarkupAttributeValue | undefined, label: string, expected: SurfaceResolvedReference["type"], resolve: (path: string) => SurfaceResolvedReference | undefined): SurfaceResolvedReference {- if (typeof raw !== "object" || raw.kind !== "reference") throw new Error(`${label} must be a reference.`);- const value = resolve(raw.path); if (value === undefined || !sameType(value.type, expected)) throw new Error(`${label} has the wrong Type.`); return value;-}-function numeric(element: StructuredElement, name: string, fallback?: number): number {- const raw = optionalText(element, name); if (raw === undefined && fallback !== undefined) return fallback;- const value = Number(raw); if (!Number.isFinite(value)) throw new Error(`${element.name}.${name} must be numeric.`); return value;-}-function integer(element: StructuredElement, name: string, fallback?: number): number {- const value = numeric(element, name, fallback); if (!Number.isSafeInteger(value)) throw new Error(`${element.name}.${name} must be an integer.`); return value;-}-function colors(element: StructuredElement, name: string): string[] {- const values = text(element, name).split(",").map((value) => value.trim()).filter(Boolean);- if (values.length === 0) throw new Error(`${element.name}.${name} requires colors.`); return values;-}-function content(element: StructuredElement): { readonly value: ScreenOverlayComponent; readonly attributes: readonly string[] } {- const name = element.name.split(":").at(-1);- switch (name) {- case "Flash": return { value: { kind: "flash", color: text(element, "color"), intensity: numeric(element, "intensity"), attackFrames: integer(element, "attack"), holdFrames: integer(element, "hold"), decayFrames: integer(element, "decay") }, attributes: ["color", "intensity", "attack", "hold", "decay"] };- case "ColorWash": return { value: { kind: "color-wash", color: text(element, "color"), opacity: numeric(element, "opacity") }, attributes: ["color", "opacity"] };- case "Vignette": return { value: { kind: "vignette", center: { x: numeric(element, "center-x"), y: numeric(element, "center-y") }, radius: { x: numeric(element, "radius-x"), y: numeric(element, "radius-y") }, softness: numeric(element, "softness"), color: text(element, "color"), opacity: numeric(element, "opacity") }, attributes: ["center-x", "center-y", "radius-x", "radius-y", "softness", "color", "opacity"] };- case "ScanLines": return { value: { kind: "scan-lines", spacingPx: numeric(element, "spacing"), thicknessPx: numeric(element, "thickness"), angleDeg: numeric(element, "angle"), opacity: numeric(element, "opacity"), travelPx: numeric(element, "travel") }, attributes: ["spacing", "thickness", "angle", "opacity", "travel"] };- case "DirectionalMatte": return { value: { kind: "directional-matte", angleDeg: numeric(element, "angle"), coverage: numeric(element, "coverage"), feather: numeric(element, "feather"), color: text(element, "color"), opacity: numeric(element, "opacity"), progress: { from: numeric(element, "from"), to: numeric(element, "to") } }, attributes: ["angle", "coverage", "feather", "color", "opacity", "from", "to"] };- case "WhipVeil": return { value: { kind: "whip-veil", direction: text(element, "direction") as "left", widthPx: numeric(element, "width"), softnessPx: numeric(element, "softness"), travelPx: numeric(element, "travel"), opacity: numeric(element, "opacity") }, attributes: ["direction", "width", "softness", "travel", "opacity"] };- case "GlitchVeil": return { value: { kind: "glitch-veil", bars: integer(element, "bars"), colors: colors(element, "colors"), opacity: numeric(element, "opacity"), travelPx: numeric(element, "travel"), seed: integer(element, "seed") }, attributes: ["bars", "colors", "opacity", "travel", "seed"] };- case "Grain": return { value: { kind: "grain", amount: numeric(element, "amount"), grainSizePx: numeric(element, "size"), chroma: text(element, "chroma") as "monochrome", motionRatePxPerFrame: numeric(element, "motion-rate"), seed: integer(element, "seed") }, attributes: ["amount", "size", "chroma", "motion-rate", "seed"] };- case "LightLeak": return { value: { kind: "light-leak", colors: colors(element, "colors"), angleDeg: numeric(element, "angle"), softness: numeric(element, "softness"), travelPx: numeric(element, "travel"), intensity: numeric(element, "intensity"), seed: integer(element, "seed") }, attributes: ["colors", "angle", "softness", "travel", "intensity", "seed"] };- case "Bokeh": return { value: { kind: "bokeh", amount: numeric(element, "amount"), sizeMinPx: numeric(element, "min-size"), sizeMaxPx: numeric(element, "max-size"), color: text(element, "color"), warmth: numeric(element, "warmth"), driftPx: numeric(element, "drift"), seed: integer(element, "seed") }, attributes: ["amount", "min-size", "max-size", "color", "warmth", "drift", "seed"] };- case "TVStatic": return { value: { kind: "tv-static", amount: numeric(element, "amount"), noiseSizePx: numeric(element, "size"), scanLineOpacity: numeric(element, "scan-lines"), motionRatePxPerFrame: numeric(element, "motion-rate"), seed: integer(element, "seed") }, attributes: ["amount", "size", "scan-lines", "motion-rate", "seed"] };- default: throw new Error(`${element.name} is not an official self-contained Screen Overlay component.`);- }-}--export const decodeScreenOverlaySurface: StructuredSurfaceHandler = ({ element, resolveReference }) => {- allowed(element, ["id", "within", "timeline"]); const id = text(element, "id");- const within = ref(element.attributes.within, `${element.name}.within`, spatialTypes.frame, resolveReference);- const context = resolveTemporalContext({ element, resolveReference });- const headerId = `${id}.header`; const records: SurfaceRecordDraft[] = [{ id: headerId, type: screenOverlayTypes.header,- value: { kind: "inline", value: sealScreenOverlayHeader({ id }) }, range: element.range }];- const temporalComponents: SurfaceComponentDraft[] = [];- const temporalFragments: ReturnType<typeof createTemporalWindowConstruction>["fragments"][number][] = [];- const fragmentItems: Parameters<typeof createScreenOverlayFragment>[0][number][] = [];- const inputs: Record<string, typeof within.ref> = { within: within.ref, header: { kind: "record", id: headerId }, timeline: context.timeline.ref };- let index = 0;- for (const child of element.children) {- if (child.kind === "text") { if (child.value.trim()) throw new Error(`${element.name} accepts only component children.`); continue; }- if (child.children.some((node) => node.kind === "element" || node.value.trim())) throw new Error(`${child.name} must be empty.`);- index += 1; const suffix = String(index).padStart(4, "0"); const decoded = content(child);- allowed(child, ["id", "z", ...TIMING, ...decoded.attributes]);- const itemSpec = sealScreenOverlayItemSpec({- id: optionalText(child, "id") ?? `${id}.${decoded.value.kind}.${suffix}`, content: decoded.value,- stackingOrder: integer(child, "z") });- const temporal = createTemporalWindowConstruction({ id: itemSpec.id, element: child, ...context, resolveReference });- records.push(...temporal.records); temporalComponents.push(...temporal.components); temporalFragments.push(...temporal.fragments);- const specId = `${id}.item.${suffix}.spec`; const specName = `item-${suffix}-spec`;- records.push({ id: specId, type: screenOverlayTypes.itemSpec, value: { kind: "inline", value: itemSpec }, range: child.range });- const windowName = `item-${suffix}-window`;- inputs[specName] = { kind: "record", id: specId }; inputs[windowName] = temporal.ref;- fragmentItems.push({ specName, windowName });- }- if (fragmentItems.length === 0) throw new Error(`${element.name} requires at least one component.`);- const fragment = createScreenOverlayFragment(fragmentItems);- return { records, components: [...temporalComponents, { id, fragment: fragment.id, inputs, outputs: { program: `${id}.program`, visual: `${id}.visual` }, range: element.range }], fragments: [...temporalFragments, fragment], exports: [`${id}.program`, `${id}.visual`] };-};diff --git a/packages/screen-overlay/src/types.ts b/packages/screen-overlay/src/types.tsdeleted file mode 100644index a276885a..00000000--- a/packages/screen-overlay/src/types.ts+++ /dev/null@@ -1,70 +0,0 @@-import type { FrameSpan } from "@hypit/composition";--export type FlashOverlay = {- readonly kind: "flash"; readonly color: string; readonly intensity: number;- readonly attackFrames: number; readonly holdFrames: number; readonly decayFrames: number;-};-export type ColorWashOverlay = { readonly kind: "color-wash"; readonly color: string; readonly opacity: number };-export type VignetteOverlay = {- readonly kind: "vignette"; readonly center: { readonly x: number; readonly y: number };- readonly radius: { readonly x: number; readonly y: number }; readonly softness: number;- readonly color: string; readonly opacity: number;-};-export type ScanLinesOverlay = {- readonly kind: "scan-lines"; readonly spacingPx: number; readonly thicknessPx: number;- readonly angleDeg: number; readonly opacity: number; readonly travelPx: number;-};-export type DirectionalMatteOverlay = {- readonly kind: "directional-matte"; readonly angleDeg: number; readonly coverage: number;- readonly feather: number; readonly color: string; readonly opacity: number;- readonly progress: { readonly from: number; readonly to: number };-};-export type WhipVeilOverlay = {- readonly kind: "whip-veil"; readonly direction: "left" | "right" | "up" | "down";- readonly widthPx: number; readonly softnessPx: number; readonly travelPx: number; readonly opacity: number;-};-export type GlitchVeilOverlay = {- readonly kind: "glitch-veil"; readonly bars: number; readonly colors: readonly string[];- readonly opacity: number; readonly travelPx: number; readonly seed: number;-};-export type GrainOverlay = {- readonly kind: "grain"; readonly amount: number; readonly grainSizePx: number;- readonly chroma: "monochrome" | "color"; readonly motionRatePxPerFrame: number; readonly seed: number;-};-export type LightLeakOverlay = {- readonly kind: "light-leak"; readonly colors: readonly string[]; readonly angleDeg: number;- readonly softness: number; readonly travelPx: number; readonly intensity: number; readonly seed: number;-};-export type BokehOverlay = {- readonly kind: "bokeh"; readonly amount: number; readonly sizeMinPx: number; readonly sizeMaxPx: number;- readonly color: string; readonly warmth: number; readonly driftPx: number; readonly seed: number;-};-export type TvStaticOverlay = {- readonly kind: "tv-static"; readonly amount: number; readonly noiseSizePx: number;- readonly scanLineOpacity: number; readonly motionRatePxPerFrame: number; readonly seed: number;-};--export type ScreenOverlayComponent =- | FlashOverlay | ColorWashOverlay | VignetteOverlay | ScanLinesOverlay | DirectionalMatteOverlay- | WhipVeilOverlay | GlitchVeilOverlay | GrainOverlay | LightLeakOverlay | BokehOverlay | TvStaticOverlay;--export type ScreenOverlayItemSpec = {- readonly id: string;- readonly content: ScreenOverlayComponent;- readonly stackingOrder: number;-};-export type ScreenOverlayHeader = { readonly id: string };-export type ScreenOverlayItemProgram = {- readonly id: string;- /** Author-owned Item realized by this externally projected window. */- readonly subjectId: string;- readonly span: FrameSpan;- readonly content: ScreenOverlayComponent;- readonly order: number;- readonly z: number;-};-export type ScreenOverlaySet = { readonly items: readonly ScreenOverlayItemProgram[] };-export type ScreenOverlayProgram = {- readonly id: string;- readonly items: readonly ScreenOverlayItemProgram[];-};diff --git a/packages/screen-overlay/test/screen-overlay.test.ts b/packages/screen-overlay/test/screen-overlay.test.tsdeleted file mode 100644index 9ff65787..00000000--- a/packages/screen-overlay/test/screen-overlay.test.ts+++ /dev/null@@ -1,220 +0,0 @@-import { sealTimeline, timelineManifest, timelineDependency, timelineTypes } from "@hypit/timeline";-import assert from "node:assert/strict";-import test from "node:test";-import { fixtureResource } from "../../../test/fixture-resource.js";-import { timelineFixture } from "../../../test/timeline-fixture.js";-import { projectProgramWindow } from "../../../test/temporal-fixture.js";--import { artifactManifest } from "@hypit/artifact";-import { registerTypeValidatorFacets } from "@hypit/component-kit";-import { compositionManifest, compositionTypes, sealComposition, sealVisualTrack } from "@hypit/composition";-import { createResolvedClosure, sealBuildRequest, start } from "@hypit/core";-import { AuthorFrontendRegistry, compileSourceClosure, resolveCompiledSourceExport } from "@hypit/elaborator";-import { compileHyperframesDocument } from "@hypit/hyperframes";-import { mediaManifest } from "@hypit/media";-import { narrativeManifest } from "@hypit/narrative";-import type { ModuleManifest } from "@hypit/protocol";-import {- appendProjectedScreenOverlay,- createScreenOverlaySet,- createScreenOverlayFragment,- decodeScreenOverlaySurface,- finalizeScreenOverlay,- renderScreenOverlay,- screenOverlayManifest,- screenOverlayMarkupSurfaces,- screenOverlayModuleRef,- screenOverlayProducers,- sealScreenOverlayHeader,- sealScreenOverlayItemSpec,-} from "@hypit/screen-overlay";-import type { ScreenOverlayComponent } from "@hypit/screen-overlay";-import { speechEvidenceManifest } from "@hypit/speech-evidence";-import { speechManifest } from "@hypit/speech";-import { narrativeTemporalManifest } from "@hypit/narrative-temporal";-import { sealCanvas, spatialComponent, spatialDependency, spatialManifest, spatialTypes } from "@hypit/spatial";-import { svsManifest } from "@hypit/svs";-import { temporalManifest, temporalProducers } from "@hypit/temporal";-import { MarkupSurfaceRegistry, createMarkupAuthorFrontend } from "@hypit/markup";-import { createRecordAdmitter, TypeValidatorRegistry } from "@hypit/validation";-import { visualIrManifest } from "@hypit/visual-ir";--const canvas = sealCanvas({- widthPx: 1080, heightPx: 1920,-});-const within = { xPx: 0, yPx: 0, widthPx: canvas.widthPx, heightPx: canvas.heightPx };-const space = sealTimeline({ id: "test-space", frameCount: 60, frameRate: { numerator: 30, denominator: 1 },-});-const header = sealScreenOverlayHeader({ id: "screen" });-const semantic = timelineFixture(space);-const components: readonly ScreenOverlayComponent[] = [- { kind: "flash", color: "#ffffff", intensity: 0.9, attackFrames: 2, holdFrames: 3, decayFrames: 5 },- { kind: "color-wash", color: "#2244ff", opacity: 0.2 },- { kind: "vignette", center: { x: 0.5, y: 0.48 }, radius: { x: 0.8, y: 0.65 }, softness: 0.3, color: "#000000", opacity: 0.4 },- { kind: "scan-lines", spacingPx: 8, thicknessPx: 1, angleDeg: 4, opacity: 0.18, travelPx: 12 },- { kind: "directional-matte", angleDeg: 15, coverage: 0.7, feather: 0.2, color: "#ffffff", opacity: 0.8, progress: { from: -0.4, to: 1.2 } },- { kind: "whip-veil", direction: "left", widthPx: 320, softnessPx: 48, travelPx: 1400, opacity: 0.9 },- { kind: "glitch-veil", bars: 8, colors: ["#ff0044", "#00ddff"], opacity: 0.6, travelPx: 90, seed: 7 },- { kind: "grain", amount: 0.25, grainSizePx: 3, chroma: "monochrome", motionRatePxPerFrame: 0.5, seed: 11 },- { kind: "light-leak", colors: ["#ff3300", "#ffd000"], angleDeg: 28, softness: 0.4, travelPx: 260, intensity: 0.55, seed: 13 },- { kind: "bokeh", amount: 0.35, sizeMinPx: 12, sizeMaxPx: 70, color: "#ffe2aa", warmth: 0.4, driftPx: 80, seed: 17 },- { kind: "tv-static", amount: 0.12, noiseSizePx: 5, scanLineOpacity: 0.16, motionRatePxPerFrame: 0.7, seed: 19 },-];--function trackFor(content: ScreenOverlayComponent, stackingOrder = 50) {- const spec = sealScreenOverlayItemSpec({- id: content.kind,- content,- stackingOrder,- });- const window = projectProgramWindow({- itemId: spec.id, semantic,- projection: { start: { ref: "timeline.start" }, end: { ref: "timeline.end" } },- });- return renderScreenOverlay(within, space, finalizeScreenOverlay(- appendProjectedScreenOverlay(createScreenOverlaySet(), header, space, spec, window), header,- ));-}--test("every declared Screen Overlay component lowers to a self-contained deterministic Present", () => {- for (const content of components) {- const first = trackFor(content);- const second = trackFor(structuredClone(content));- assert.deepEqual(first, second, `${content.kind} must be deterministic`);- assert.equal(first.presents.length, 1);- assert.equal(first.presents[0]?.span.endFrameExclusive, 60);- assert.ok(first.presents[0]!.elements.length >= 1);- for (const element of first.presents[0]!.elements) {- assert.equal(element.attributes, undefined, `${content.kind} must not smuggle an external selector or input`);- }- }-});--test("Flash owns its exact envelope instead of inheriting a universal peak", () => {- const flash = trackFor(components[0]!);- assert.deepEqual(flash.presents[0]?.elements[0]?.animation?.keyframes.map((frame) => frame.atFrame), [0, 2, 5, 10, 60]);- const clipped = trackFor({ kind: "flash", color: "#ffffff", intensity: 1, attackFrames: 30, holdFrames: 30, decayFrames: 30 });- assert.deepEqual(clipped.presents[0]?.elements[0]?.animation?.keyframes.map((frame) => frame.atFrame), [0, 30, 60, 90]);-});--test("explicit seeds control stochastic component identity", () => {- const grain = components.find((item) => item.kind === "grain")! as Extract<ScreenOverlayComponent, { kind: "grain" }>;- assert.notDeepEqual(trackFor(grain), trackFor({ ...grain, seed: grain.seed + 1 }));- const bokeh = components.find((item) => item.kind === "bokeh")! as Extract<ScreenOverlayComponent, { kind: "bokeh" }>;- assert.notDeepEqual(trackFor(bokeh), trackFor({ ...bokeh, seed: bokeh.seed + 1 }));-});--test("overlay Tracks interleave with peer Tracks only through absolute stacking", () => {- const below = trackFor(components[1]!, 20);- const above = { ...trackFor(components[0]!, 80), id: "screen-above" };- const middle = sealVisualTrack({ timelineId: "test-space",- visualIr: "hypit.visual-ir@1", id: "middle",- presents: [{ id: "middle", order: 0, z: 50, span: { startFrame: 0, endFrameExclusive: 60 },- elements: [{ id: "root", order: 0, kind: "box", style: [{ name: "background-color", value: "#112233" }] }] }],- });- const document = compileHyperframesDocument(sealComposition({- id: "stack", canvas: { width: 1080, height: 1920, clearColor: "#000000" },- tracks: [above, middle, below],- }), space);- const belowAt = document.html.indexOf('data-hypit-track-id="screen"');- const middleAt = document.html.indexOf('data-hypit-track-id="middle"');- const aboveAt = document.html.indexOf('data-hypit-track-id="screen-above"');- assert.ok(belowAt < middleAt && middleAt < aboveAt);-});--test("the Screen Overlay Fragment publishes its Program and peer VisualTrack", () => {- const fragment = createScreenOverlayFragment([{ specName: "spec", windowName: "window" }]);- assert.deepEqual(fragment.inputs.map((input) => input.name), ["header", "spec", "timeline", "window", "within"]);- assert.deepEqual(fragment.exports.map((output) => [output.name, output.type.name]), [- ["program", "ScreenOverlayProgram"],- ["visual", "VisualTrack"],- ]);-});--test("the self-described Screen Surface parses into a finite peer-Track graph", async () => {- const fixtureModule = { name: "example.screen-inputs", version: "1" } as const;- const fixtureSurfaceDigest = fixtureResource("example.screen-inputs/surface@1");- const fixtureSurface = {- name: "inputs", tag: "Inputs", mode: "structured",- outputs: [spatialTypes.frame, timelineTypes.timeline],- } as const;- const fixtureManifest: ModuleManifest = {- format: "hypit.module@1",- name: fixtureModule.name,- version: fixtureModule.version,- dependencies: [spatialDependency, timelineDependency],- types: [],- capabilities: [],- producers: [],- };- const closure = createResolvedClosure([- artifactManifest,- mediaManifest,- narrativeManifest,- timelineManifest,- speechManifest,- narrativeTemporalManifest,- speechEvidenceManifest,- spatialManifest,- svsManifest,- temporalManifest,- visualIrManifest,- compositionManifest,- screenOverlayManifest,- fixtureManifest,- ]);- const registry = new MarkupSurfaceRegistry();- registry.registerStructured({ module: fixtureModule, declaration: fixtureSurface, handler: ({ element }) => ({- records: [- { id: "within", type: spatialTypes.frame, value: { kind: "inline", value: within }, range: element.range },- { id: "semantic", type: timelineTypes.timeline, value: { kind: "inline", value: semantic }, range: element.range },- ],- components: [],- fragments: [],- }) });- registry.registerStructured({- module: screenOverlayModuleRef,- declaration: screenOverlayMarkupSurfaces.find((item) => item.name === "track")!,- handler: decodeScreenOverlaySurface,- });- const frontends = new AuthorFrontendRegistry();- frontends.register(createMarkupAuthorFrontend({- registry,- resolveModule: (request) => request.from === "example.screen-inputs@1" ? fixtureModule : screenOverlayModuleRef,- }));- const validators = new TypeValidatorRegistry();- registerTypeValidatorFacets(validators, spatialComponent.validators ?? []);- const compiled = await compileSourceClosure({- entry: {- id: "/project/screen.svml",- name: "screen.svml",- text: `<?svml using="@hypit/markup@1"?>- <svml>- <import as="fixture" from="example.screen-inputs@1"/>- <import as="screen" from="@hypit/screen-overlay@1"/>- <fixture:Inputs/>- <screen:Track id="screen-fx" within={within} timeline={semantic}>- <screen:Flash during="timeline" z="70" color="#ffffff" intensity="0.9" attack="2" hold="3" decay="5"/>- </screen:Track>- </svml>`,- },- closure,- frontends,- admitRecord: createRecordAdmitter(validators),- resolveSource() { throw new Error("Screen fixture has no source imports."); },- });- const trackExport = resolveCompiledSourceExport(compiled, "screen-fx.visual", compositionTypes.visualTrack);- assert.equal(trackExport.ref.kind, "logical-output");- const build = start(compiled.program, compiled.graph, sealBuildRequest({- targets: [{ output: trackExport.ref.kind === "logical-output" ? trackExport.ref.id : "" }],- }));- assert.deepEqual(build.plan.steps.map((step) => step.producer.name).sort(), [- screenOverlayProducers.createSet.name,- screenOverlayProducers.appendItem.name,- screenOverlayProducers.finalize.name,- temporalProducers.projectProgramInstant.name,- temporalProducers.projectProgramInstant.name,- temporalProducers.composeWindow.name,- screenOverlayProducers.render.name,- ].sort());-});