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
fix(providers): align exact model capabilities
kashorinc82c52ad5579
diff --git a/packages/gpt-image/README.md b/packages/gpt-image/README.mdindex a5018ee7..a27f42bb 100644--- a/packages/gpt-image/README.md+++ b/packages/gpt-image/README.md@@ -8,9 +8,8 @@ then finalized into the only `GenerationRequest` a Provider can receive. The pacsemantics but no API key, Provider selection, queue or network code. `@hypit/provider-kie` isone optional Runtime implementation.-Provider limits are checked by the Provider before any paid operation. In particular, KIE's GPT-Image 2 endpoints reject `4:3`, `3:4` and `4:5`; those values remain in this model contract because-the model Surface is Provider-neutral, but a KIE Runtime must use one of its accepted ratios.+Provider-specific combination limits are checked by that Provider before any paid operation. They+do not narrow this model-owned vocabulary or leak into author source.The one physical package exposes two independently importable logical modules:diff --git a/packages/grok-imagine/README.md b/packages/grok-imagine/README.mdindex f1b7b302..d4ef31dd 100644--- a/packages/grok-imagine/README.md+++ b/packages/grok-imagine/README.md@@ -16,4 +16,6 @@ optional Runtime implementation.aspect-ratio="9:16" resolution="720p"/>```-Continuation via `source-task-id` belongs only to `Video` and requires an explicit reference image.+Both Surfaces accept up to seven reference images. `Video` accepts 6–30 seconds; `PreviewVideo`+accepts 1–15 seconds and also offers `auto` aspect ratio. Provider task identifiers are execution+state, not author inputs, and are deliberately absent from both Surfaces.diff --git a/packages/grok-imagine/src/index.ts b/packages/grok-imagine/src/index.tsindex 839a2f8a..502dcbac 100644--- a/packages/grok-imagine/src/index.ts+++ b/packages/grok-imagine/src/index.ts@@ -27,27 +27,25 @@ export const grokImagineVideoPorts: GenerationPortTable = sealGenerationPortTabl},{ name: "resolution", value: { kind: "enum", values: ["480p", "720p", "1080p"] }, minItems: 1, maxItems: 1 },{ name: "duration", value: { kind: "number", integer: true, minimum: 6, maximum: 30 }, minItems: 1, maxItems: 1 },- { name: "images", value: { kind: "media", accepts: ["image"] }, minItems: 0, maxItems: 4 },- /** Continues an earlier generation; only meaningful beside its source images. */- { name: "sourceTaskId", value: { kind: "token", minLength: 1, maxLength: 255 }, minItems: 0, maxItems: 1 },+ { name: "images", value: { kind: "media", accepts: ["image"] }, minItems: 0, maxItems: 7 },],- requires: [{ kind: "requiresPresent", port: "sourceTaskId", needs: ["images"] }],+ requires: [],});export const grokImagine15PreviewPorts: GenerationPortTable = sealGenerationPortTable({model: "grok-imagine-video-1.5-preview",result: "video",ports: [- { name: "prompt", value: { kind: "text", maxChars: 5_000 }, minItems: 1, maxItems: 1 },+ { name: "prompt", value: { kind: "text", maxChars: 4_096 }, minItems: 1, maxItems: 1 },{name: "aspectRatio",- value: { kind: "enum", values: ["2:3", "3:2", "1:1", "16:9", "9:16"] },+ value: { kind: "enum", values: ["auto", "2:3", "3:2", "1:1", "16:9", "9:16"] },minItems: 1,maxItems: 1,},{ name: "resolution", value: { kind: "enum", values: ["480p", "720p", "1080p"] }, minItems: 1, maxItems: 1 },- { name: "duration", value: { kind: "number", integer: true, minimum: 6, maximum: 30 }, minItems: 1, maxItems: 1 },- { name: "images", value: { kind: "media", accepts: ["image"] }, minItems: 0, maxItems: 4 },+ { name: "duration", value: { kind: "number", integer: true, minimum: 1, maximum: 15 }, minItems: 1, maxItems: 1 },+ { name: "images", value: { kind: "media", accepts: ["image"] }, minItems: 0, maxItems: 7 },],requires: [],});@@ -97,21 +95,29 @@ const surface = (vocabulary,});-const grokImagineVideoAttributes: readonly SurfaceAttributeVocabulary[] = [+const grokImagineBaseAttributes: readonly SurfaceAttributeVocabulary[] = [{ name: "id", kind: "identifier", required: true,summary: "Names this generation so its video Artifact can be referenced elsewhere in the Source." },{ name: "prompt", kind: "reference", required: true, accepts: [textTypes.text],summary: "Selects the Text the model generates from." },- { name: "duration", kind: "literal", required: true,- summary: "Sets the length of the generated video in whole seconds." },- { name: "aspect-ratio", kind: "literal", required: true,- values: ["2:3", "3:2", "1:1", "16:9", "9:16"],- summary: "Sets the width-to-height ratio of the generated video." },{ name: "resolution", kind: "literal", required: true,values: ["480p", "720p", "1080p"],summary: "Sets the picture height of the generated video." },];+function grokImagineVideoAttributes(preview: boolean): readonly SurfaceAttributeVocabulary[] {+ return [+ ...grokImagineBaseAttributes,+ { name: "duration", kind: "literal", required: true,+ summary: "Sets the length of the generated video in whole seconds." },+ { name: "aspect-ratio", kind: "literal", required: true,+ values: preview+ ? ["auto", "2:3", "3:2", "1:1", "16:9", "9:16"]+ : ["2:3", "3:2", "1:1", "16:9", "9:16"],+ summary: "Sets the width-to-height ratio of the generated video." },+ ];+}+const grokImagineVideoChildren: readonly SurfaceChildVocabulary[] = [{ tag: "Reference", cardinality: "many",summary: "Attaches one image Artifact the model generates from.",@@ -126,19 +132,12 @@ const grokImagineVideoPortVocabulary: readonly SurfacePortVocabulary[] = [summary: "The generated video Artifact." },];-const grokImagineVideoNotes: readonly string[] = [- "`Reference` accepts only an `image` reference to an image Blob, is empty, and repeats at most four times.",- "`duration` is a whole number of seconds between 6 and 30.",-];+const grokImagineReferenceNote = "`Reference` accepts only an `image` reference to an image Blob, is empty, and repeats at most seven times.";export const grokImagineMarkupSurfaces = [surface("video", "Video", grokImagineEndpoints.video!, {- summary: "Generates one video Artifact from a Text prompt and up to four reference images with the Grok Imagine video model.",- attributes: [- ...grokImagineVideoAttributes,- { name: "source-task-id", kind: "literal", required: false,- summary: "Continues an earlier Grok Imagine generation named by its task identifier." },- ],+ summary: "Generates one video Artifact from a Text prompt and up to seven reference images with the Grok Imagine video model.",+ attributes: grokImagineVideoAttributes(false),children: grokImagineVideoChildren,ports: grokImagineVideoPortVocabulary,example: [@@ -147,20 +146,20 @@ export const grokImagineMarkupSurfaces = ["</grok:Video>",].join("\n"),notes: [- ...grokImagineVideoNotes,- "`source-task-id` requires at least one `Reference`; the continuation resumes from the images it names.",+ grokImagineReferenceNote,+ "`duration` is a whole number of seconds between 6 and 30.","The element carries no text content.",],}),surface("preview-video", "PreviewVideo", grokImagineEndpoints["preview-1.5"]!, {- summary: "Generates one video Artifact from a Text prompt and up to four reference images with the Grok Imagine 1.5 preview video model.",- attributes: grokImagineVideoAttributes,+ summary: "Generates one video Artifact from a Text prompt and up to seven reference images with the Grok Imagine 1.5 preview video model.",+ attributes: grokImagineVideoAttributes(true),children: grokImagineVideoChildren,ports: grokImagineVideoPortVocabulary,example: '<grok:PreviewVideo id="preview" prompt={previewPrompt} duration="6" aspect-ratio="9:16" resolution="720p"/>',notes: [- ...grokImagineVideoNotes,- "The preview model has no continuation port, so `source-task-id` belongs to `Video` alone.",+ grokImagineReferenceNote,+ "`duration` is a whole number of seconds between 1 and 15.","The element carries no text content.",],}),diff --git a/packages/grok-imagine/src/surface.ts b/packages/grok-imagine/src/surface.tsindex b7e5d29f..e8def2de 100644--- a/packages/grok-imagine/src/surface.ts+++ b/packages/grok-imagine/src/surface.ts@@ -64,13 +64,9 @@ function ref(return result;}-function decoder(endpoint: ExactModelEndpoint, continuation: boolean): StructuredSurfaceHandler {+function decoder(endpoint: ExactModelEndpoint): StructuredSurfaceHandler {return ({ element, resolveReference }) => {- exact(element,- continuation- ? ["id", "prompt", "duration", "aspect-ratio", "resolution", "source-task-id"]- : ["id", "prompt", "duration", "aspect-ratio", "resolution"],- ["id", "prompt", "duration", "aspect-ratio", "resolution"]);+ exact(element, ["id", "prompt", "duration", "aspect-ratio", "resolution"]);const id = text(element, "id");const prompt = ref(element, "prompt", textTypes.text, resolveReference);if (prompt.record !== undefined) {@@ -101,11 +97,6 @@ function decoder(endpoint: ExactModelEndpoint, continuation: boolean): StructureaspectRatio: [text(element, "aspect-ratio")],resolution: [text(element, "resolution")],};- if (element.attributes["source-task-id"] !== undefined) {- assert(continuation, `${element.name} does not support source-task-id`);- ports.sourceTaskId = [text(element, "source-task-id")];- assert(images.length > 0, `${element.name}.source-task-id requires at least one Reference`);- }const draft = sealGenerationRequestDraft(endpoint.ports, ports);const records: Array<{id: string;@@ -154,5 +145,5 @@ function decoder(endpoint: ExactModelEndpoint, continuation: boolean): Structure};}-export const decodeGrokImagineVideoSurface = decoder(grokImagineEndpoints.video!, true);-export const decodeGrokImaginePreviewVideoSurface = decoder(grokImagineEndpoints["preview-1.5"]!, false);+export const decodeGrokImagineVideoSurface = decoder(grokImagineEndpoints.video!);+export const decodeGrokImaginePreviewVideoSurface = decoder(grokImagineEndpoints["preview-1.5"]!);diff --git a/packages/minimax-h3/README.md b/packages/minimax-h3/README.mdindex 6394c58f..fdfe7100 100644--- a/packages/minimax-h3/README.md+++ b/packages/minimax-h3/README.md@@ -2,7 +2,7 @@Exact author/compute contracts and package-owned author Surfaces for MiniMax H3 video generation.-Text, first/last-frame and subject-reference modes are separate Surfaces rather than one dynamic+Text, frame-guided and subject-reference modes are separate Surfaces rather than one dynamicport mode. Each produces an ordinary video Artifact. This package owns request semanticsand validation only; Provider calls, credentials, retries and queueing belong to a Runtime Endpointsuch as `@hypit/provider-kie`.@@ -18,3 +18,4 @@ such as `@hypit/provider-kie`.```The Surface makes every prompt/media dependency an explicit graph edge and leaves execution to a Provider.+`FrameVideo` accepts a first frame, a last frame, or both; either frame is an ordinary image Artifact edge.diff --git a/packages/minimax-h3/src/index.ts b/packages/minimax-h3/src/index.tsindex 1d936eae..4c26ef4c 100644--- a/packages/minimax-h3/src/index.ts+++ b/packages/minimax-h3/src/index.ts@@ -46,12 +46,16 @@ export const minimaxH3Ports: GenerationPortTable = sealGenerationPortTable({],requires: [{ kind: "atMostOneOf", ports: ["referenceImage", "firstFrame"] },+ { kind: "atMostOneOf", ports: ["referenceImage", "lastFrame"] },{ kind: "atMostOneOf", ports: ["referenceVideo", "firstFrame"] },+ { kind: "atMostOneOf", ports: ["referenceVideo", "lastFrame"] },{ kind: "atMostOneOf", ports: ["referenceAudio", "firstFrame"] },+ { kind: "atMostOneOf", ports: ["referenceAudio", "lastFrame"] },{ kind: "requiresAnyOf", port: "referenceAudio", anyOf: ["referenceImage", "referenceVideo"] },// A first/last frame run inherits its framing from the uploaded image, so the// model takes no aspect ratio in that mode.{ kind: "atMostOneOf", ports: ["aspectRatio", "firstFrame"] },+ { kind: "atMostOneOf", ports: ["aspectRatio", "lastFrame"] },{ kind: "weightedTotal", weights: { referenceImage: 1, referenceVideo: 1, referenceAudio: 1 }, maximum: 12 },],});@@ -122,10 +126,10 @@ export const minimaxH3MarkupSurfaces = [],}),declaration("frame-video", "FrameVideo", ["firstFrame", "lastFrame"], {- summary: "Generates one video Artifact that opens on a given image and optionally closes on a second image with the MiniMax H3 model.",+ summary: "Generates one video Artifact from a first frame, a last frame, or both with the MiniMax H3 model.",attributes: [...minimaxH3Common,- { name: "first-frame", kind: "reference", required: true, accepts: [artifactTypes.blob],+ { name: "first-frame", kind: "reference", required: false, accepts: [artifactTypes.blob],summary: "Selects the image Artifact the generated video opens on." },{ name: "last-frame", kind: "reference", required: false, accepts: [artifactTypes.blob],summary: "Selects the image Artifact the generated video closes on." },@@ -139,7 +143,7 @@ export const minimaxH3MarkupSurfaces = [minimaxH3DurationNote,minimaxH3ResolutionNote,"A first/last frame run inherits its framing from the given image, so this element takes no `aspect-ratio`.",- "`first-frame` and `last-frame` reference image Blobs.",+ "At least one of `first-frame` or `last-frame` is required; both reference image Blobs.","The element takes no children and no text content.",],}),diff --git a/packages/minimax-h3/src/surface.ts b/packages/minimax-h3/src/surface.tsindex 7d81cb86..500db59e 100644--- a/packages/minimax-h3/src/surface.ts+++ b/packages/minimax-h3/src/surface.ts@@ -61,8 +61,11 @@ export const decodeMinimaxTextVideoSurface: StructuredSurfaceHandler = ({ elemenconst { prompt, ports } = common(element, resolveReference); return output(element, prompt, ports, []);};export const decodeMinimaxFrameVideoSurface: StructuredSurfaceHandler = ({ element, resolveReference }) => {- exact(element, ["id", "prompt", "duration", "resolution", "first-frame", "last-frame"], ["id", "prompt", "duration", "first-frame"]); empty(element);- const { prompt, ports } = common(element, resolveReference); const media: Media[] = [{ port: "firstFrame", role: "image", source: mediaRef(element, "first-frame", "image", resolveReference) }];+ exact(element, ["id", "prompt", "duration", "resolution", "first-frame", "last-frame"], ["id", "prompt", "duration"]); empty(element);+ assert(element.attributes["first-frame"] !== undefined || element.attributes["last-frame"] !== undefined,+ `${element.name} requires first-frame, last-frame or both`);+ const { prompt, ports } = common(element, resolveReference); const media: Media[] = [];+ if (element.attributes["first-frame"] !== undefined) media.push({ port: "firstFrame", role: "image", source: mediaRef(element, "first-frame", "image", resolveReference) });if (element.attributes["last-frame"] !== undefined) media.push({ port: "lastFrame", role: "image", source: mediaRef(element, "last-frame", "image", resolveReference) });return output(element, prompt, ports, media);};diff --git a/packages/nano-banana/README.md b/packages/nano-banana/README.mdindex 83d8550e..74941e79 100644--- a/packages/nano-banana/README.md+++ b/packages/nano-banana/README.md@@ -17,3 +17,7 @@ Import the model variant you mean and connect prompt and references as ordinary```The Surface only lowers this syntax into the package's exact model request. It does not select a Provider.++Nano Banana 2 accepts prompts up to 20,000 characters, up to 14 references and its wider aspect-ratio+set. Nano Banana Pro accepts prompts up to 10,000 characters, up to eight references and the ratios+its exact model exposes; the two Surfaces do not share a guessed common request table.diff --git a/packages/nano-banana/src/index.ts b/packages/nano-banana/src/index.tsindex 2e6c24d1..1b8867a2 100644--- a/packages/nano-banana/src/index.ts+++ b/packages/nano-banana/src/index.ts@@ -9,19 +9,24 @@ export const nanoBananaModuleRef = { name: "@hypit/nano-banana", version: "1" }export const nanoBananaModels = ["nano-banana-2", "nano-banana-pro"] as const;export type NanoBananaModel = typeof nanoBananaModels[number];+const NANO_BANANA_2_RATIOS = ["auto", "1:1", "2:3", "3:2", "1:4", "4:1", "3:4", "4:3", "4:5",+ "5:4", "1:8", "8:1", "9:16", "16:9", "21:9"] as const;+const NANO_BANANA_PRO_RATIOS = ["auto", "1:1", "2:3", "3:2", "3:4", "4:3", "4:5",+ "5:4", "9:16", "16:9", "21:9"] as const;+function nanoBananaPortTable(model: NanoBananaModel): GenerationPortTable {+ const pro = model === "nano-banana-pro";return sealGenerationPortTable({model,result: "image",ports: [- { name: "prompt", value: { kind: "text", maxChars: 20_000 }, minItems: 1, maxItems: 1 },- { name: "images", value: { kind: "media", accepts: ["image"] }, minItems: 0, maxItems: 14 },+ { name: "prompt", value: { kind: "text", maxChars: pro ? 10_000 : 20_000 }, minItems: 1, maxItems: 1 },+ { name: "images", value: { kind: "media", accepts: ["image"] }, minItems: 0, maxItems: pro ? 8 : 14 },{name: "aspectRatio",value: {kind: "enum",- values: ["auto", "1:1", "2:3", "3:2", "1:4", "4:1", "3:4", "4:3", "4:5",- "5:4", "1:8", "8:1", "9:16", "16:9", "21:9"],+ values: pro ? [...NANO_BANANA_PRO_RATIOS] : [...NANO_BANANA_2_RATIOS],},minItems: 1,maxItems: 1,@@ -57,43 +62,44 @@ const nanoBananaBaseDefinition = defineExactModelModule({export const nanoBananaEndpoints = nanoBananaBaseDefinition.endpoints;export const nanoBananaComponent = nanoBananaBaseDefinition.component;-const nanoBananaAttributes: readonly SurfaceAttributeVocabulary[] = [- {- name: "id",- kind: "identifier",- required: true,- summary: "Names this generation and prefixes the bindings it publishes.",- },- {- name: "prompt",- kind: "reference",- required: true,- summary: "The Text edge describing the picture the model renders.",- accepts: [textTypes.text],- },- {- name: "aspect-ratio",- kind: "literal",- required: true,- summary: "The shape of the generated picture.",- values: ["auto", "1:1", "2:3", "3:2", "1:4", "4:1", "3:4", "4:3", "4:5",- "5:4", "1:8", "8:1", "9:16", "16:9", "21:9"],- },- {- name: "resolution",- kind: "literal",- required: true,- summary: "The size band the model renders at.",- values: ["1K", "2K", "4K"],- },- {- name: "output-format",- kind: "literal",- required: true,- summary: "The encoding of the returned image Artifact.",- values: ["png", "jpg"],- },-];+function nanoBananaAttributes(pro: boolean): readonly SurfaceAttributeVocabulary[] {+ return [+ {+ name: "id",+ kind: "identifier",+ required: true,+ summary: "Names this generation and prefixes the bindings it publishes.",+ },+ {+ name: "prompt",+ kind: "reference",+ required: true,+ summary: "The Text edge describing the picture the model renders.",+ accepts: [textTypes.text],+ },+ {+ name: "aspect-ratio",+ kind: "literal",+ required: true,+ summary: "The shape of the generated picture.",+ values: pro ? [...NANO_BANANA_PRO_RATIOS] : [...NANO_BANANA_2_RATIOS],+ },+ {+ name: "resolution",+ kind: "literal",+ required: true,+ summary: "The size band the model renders at.",+ values: ["1K", "2K", "4K"],+ },+ {+ name: "output-format",+ kind: "literal",+ required: true,+ summary: "The encoding of the returned image Artifact.",+ values: ["png", "jpg"],+ },+ ];+}const nanoBananaChildren: readonly SurfaceChildVocabulary[] = [{ tag: "Reference", cardinality: "many",@@ -104,16 +110,11 @@ const nanoBananaChildren: readonly SurfaceChildVocabulary[] = [] },];-const nanoBananaNotes: readonly string[] = [- "The element accepts at most 14 `Reference` children and no text content.",- "Every `Reference` is an ordinary image Artifact edge; the Surface copies no runtime media into request metadata.",- "The Surface lowers the element into the package's exact model request and selects no Provider.",-];-const surface = (name: "image" | "pro-image",tag: "Image" | "ProImage",endpoint: (typeof nanoBananaEndpoints)["v2" | "pro"],+ pro: boolean,summary: string,example: string,) => ({@@ -123,7 +124,7 @@ const surface = (outputs: [endpoint!.draftType, endpoint!.mediaBindings.images!.type],vocabulary: {summary,- attributes: nanoBananaAttributes,+ attributes: nanoBananaAttributes(pro),children: nanoBananaChildren,ports: [{name: "image",@@ -131,12 +132,16 @@ const surface = (summary: "The primary generated image, addressed as `<id>.image`.",}],example,- notes: nanoBananaNotes,+ notes: [+ `The element accepts at most ${pro ? 8 : 14} \`Reference\` children and no text content.`,+ "Every `Reference` is an ordinary image Artifact edge; the Surface copies no runtime media into request metadata.",+ "The Surface lowers the element into the package's exact model request and selects no Provider.",+ ],},});export const nanoBananaMarkupSurfaces = [- surface("image", "Image", nanoBananaEndpoints.v2!,+ surface("image", "Image", nanoBananaEndpoints.v2!, false,"Generates one picture with the exact Nano Banana 2 model from a Text prompt and optional reference images.",`<nano:Imageid="draft"@@ -147,7 +152,7 @@ export const nanoBananaMarkupSurfaces = [><nano:Reference image={person.image}/></nano:Image>`),- surface("pro-image", "ProImage", nanoBananaEndpoints.pro!,+ surface("pro-image", "ProImage", nanoBananaEndpoints.pro!, true,"Generates one picture with the exact Nano Banana Pro model from a Text prompt and optional reference images.",`<nano:ProImageid="final"diff --git a/packages/provider-hypihub/src/mapping.ts b/packages/provider-hypihub/src/mapping.tsindex eca4975f..eb57cd19 100644--- a/packages/provider-hypihub/src/mapping.ts+++ b/packages/provider-hypihub/src/mapping.ts@@ -70,6 +70,7 @@ export const hypiHubMappings: readonly GenerationWireMapping[] = [},{capability: { module: MINIMAX, name: "minimax-h3" }, result: "video", routes: [+ { model: "minimax-h3/image-to-video", whenPresent: ["lastFrame"] },{ model: "minimax-h3/image-to-video", whenPresent: ["firstFrame"] },{ model: "minimax-h3/reference-to-video", whenPresent: ["referenceImage"] },{ model: "minimax-h3/reference-to-video", whenPresent: ["referenceVideo"] },@@ -94,7 +95,6 @@ export const hypiHubMappings: readonly GenerationWireMapping[] = [prompt: { as: "value", field: "prompt" }, duration: { as: "value", field: "seconds" },resolution: { as: "value", field: "resolution" }, aspectRatio: { as: "value", field: "aspect_ratio" },images: { as: "itemObject", field: "reference_images", urlKey: "url", fieldKeys: {} },- sourceTaskId: { as: "value", field: "source_task_id" },},},{diff --git a/packages/provider-hypihub/src/routes.ts b/packages/provider-hypihub/src/routes.tsindex 484b192a..135d42fe 100644--- a/packages/provider-hypihub/src/routes.ts+++ b/packages/provider-hypihub/src/routes.ts@@ -65,11 +65,6 @@ function normalizeHypiHubRequest(const firstFrame = input.first_frame;const lastFrame = input.last_frame;const audioRefs = input.reference_audios;- const sourceTaskId = input.source_task_id;- if (typeof sourceTaskId === "string" && sourceTaskId.length > 0) {- throw new Error("HypiHub unified video API does not support video continuation sourceTaskId");- }-// References are public HypiHub media inputs, not vendor passthrough. They// must remain top-level so Async V2 stages the uploaded capability URLs// before choosing an upstream adaptor.@@ -79,7 +74,6 @@ function normalizeHypiHubRequest(delete input.reference_audios;delete input.first_frame;delete input.last_frame;- delete input.source_task_id;if (typeof firstFrame === "string" && firstFrame.length > 0) input.first_frame = firstFrame;if (typeof lastFrame === "string" && lastFrame.length > 0) input.last_frame = lastFrame;if (Array.isArray(imageRefs) && imageRefs.length > 0) input.reference_image_urls = imageRefs;diff --git a/packages/provider-kie/README.md b/packages/provider-kie/README.mdindex 9dd422ac..6cbfb5f5 100644--- a/packages/provider-kie/README.md+++ b/packages/provider-kie/README.md@@ -28,9 +28,14 @@ routes rather than extra Capabilities.| `@hypit/seedream` | `seedream-5-lite` | `seedream/5-lite-{text,image}-to-image` || `@hypit/background-removal` | `remove-background` | `recraft/remove-background` |-KIE's GPT Image 2 endpoints do not accept `4:3`, `3:4` or `4:5`, even though those values are part-of the model package's general vocabulary. The KIE route rejects those combinations before upload-or paid submission; use `auto`, `1:1`, `3:2`, `2:3`, `16:9`, `9:16` or `21:9` for this Provider.+KIE accepts the GPT Image 2 `4:3`, `3:4` and `4:5` ratios. Its restrictions are combinations rather+than a blacklist: `auto` is 1K-only, `1:1` is unavailable at 4K, and `4:5` is 1K-only. The KIE+Endpoint checks those exact combinations before upload or paid submission without narrowing the+model package's Provider-neutral vocabulary.++KIE's Grok Imagine endpoints accept up to seven reference images, but only one at 1080p. This is+also checked by the KIE Endpoint; the Grok model packages retain their model-level seven-image+capacity.There is deliberately no Grok image capability and no MiMo capability in this release. Seedream's`nsfwCheck` is explicit author request content; KIE cannot silently enable or disable it. Adiff --git a/packages/provider-kie/src/mapping.ts b/packages/provider-kie/src/mapping.tsindex bd10572e..258a047e 100644--- a/packages/provider-kie/src/mapping.ts+++ b/packages/provider-kie/src/mapping.ts@@ -1,11 +1,6 @@import type { CapabilityRef, ModuleRef } from "@hypit/protocol";import type { GenerationWireMapping } from "@hypit/generation";-export type KieGenerationWireMapping = GenerationWireMapping & {- /** Values advertised by the model vocabulary but refused by this KIE route. */- readonly unsupportedPortValues?: Readonly<Record<string, readonly (string | number | boolean)[]>>;-};-/*** How KIE names each model's declared input ports.*@@ -53,6 +48,7 @@ const minimaxMapping: GenerationWireMapping = {capability: { module: MINIMAX, name: "minimax-h3" },result: "video",routes: [+ { model: "minimax-h3/image-to-video", whenPresent: ["lastFrame"] },{ model: "minimax-h3/image-to-video", whenPresent: ["firstFrame"] },{ model: "minimax-h3/reference-to-video", whenPresent: ["referenceImage"] },{ model: "minimax-h3/reference-to-video", whenPresent: ["referenceVideo"] },@@ -82,7 +78,6 @@ const grokVideoMapping: GenerationWireMapping = {resolution: { as: "value", field: "resolution" },duration: { as: "string", field: "duration" },images: { as: "urlArray", field: "image_urls" },- sourceTaskId: { as: "value", field: "task_id" },},constants: { mode: "normal" },};@@ -100,7 +95,7 @@ const grokPreviewMapping: GenerationWireMapping = {},};-const gptImageMapping: KieGenerationWireMapping = {+const gptImageMapping: GenerationWireMapping = {capability: { module: GPT_IMAGE, name: "gpt-image-2" },result: "image",routes: [@@ -113,9 +108,6 @@ const gptImageMapping: KieGenerationWireMapping = {resolution: { as: "value", field: "resolution" },images: { as: "urlArray", field: "input_urls" },},- unsupportedPortValues: {- aspectRatio: ["4:3", "3:4", "4:5"],- },};function nanoBananaMapping(model: string): GenerationWireMapping {@@ -151,7 +143,7 @@ const seedreamMapping: GenerationWireMapping = {},};-export const kieModelCatalog: readonly KieGenerationWireMapping[] = [+export const kieModelCatalog: readonly GenerationWireMapping[] = [seedanceMapping("seedance-2", "bytedance/seedance-2"),seedanceMapping("seedance-2-fast", "bytedance/seedance-2-fast"),seedanceMapping("seedance-2-mini", "bytedance/seedance-2-mini"),diff --git a/packages/provider-kie/src/routes.ts b/packages/provider-kie/src/routes.tsindex b3432772..78e8f65c 100644--- a/packages/provider-kie/src/routes.ts+++ b/packages/provider-kie/src/routes.ts@@ -10,13 +10,12 @@ import {sealGeneratedImageSet,sealGeneratedVideoSet,} from "@hypit/generation";-import type { GenerationArtifactUrlResolver, GenerationRequest } from "@hypit/generation";+import type { GenerationArtifactUrlResolver, GenerationRequest, GenerationWireMapping } from "@hypit/generation";import { canonicalize } from "@hypit/protocol";import type { BlobRef, CanonicalValue, CapabilityRef, StoredValue, TypeRef } from "@hypit/protocol";import type { EndpointRequest } from "@hypit/endpoint-kit";import { kieModelCatalog, verifyKieModelCatalog } from "./mapping.js";-import type { KieGenerationWireMapping } from "./mapping.js";export type KieTaskRequest = {readonly model: string;@@ -41,37 +40,41 @@ function capabilityKey(ref: CapabilityRef): string {return `${ref.module.name}@${ref.module.version}#${ref.name}`;}-function supportsKieGenerationRequest(- mapping: KieGenerationWireMapping,- request: GenerationRequest,-): boolean {- for (const [port, unsupported] of Object.entries(mapping.unsupportedPortValues ?? {})) {- const values = request.ports[port] ?? [];- if (values.some((value) => (typeof value === "string" || typeof value === "number" || typeof value === "boolean")- && unsupported.includes(value))) return false;- }- return true;+function scalar(request: GenerationRequest, port: string): string | number | boolean | undefined {+ const value = request.ports[port]?.[0];+ return typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? value : undefined;}-function validateKieGenerationRequest(- mapping: KieGenerationWireMapping,- request: GenerationRequest,-): void {- for (const [port, unsupported] of Object.entries(mapping.unsupportedPortValues ?? {})) {- const value = request.ports[port]?.find((item) =>- (typeof item === "string" || typeof item === "number" || typeof item === "boolean")- && unsupported.includes(item));- if (value !== undefined) {- throw new Error(`KIE ${mapping.capability.name} does not accept ${port} ${String(value)}`);+/** Returns the KIE-wire limitation that rejects an otherwise valid model request. */+function kieGenerationRejection(mapping: GenerationWireMapping, request: GenerationRequest): string | undefined {+ if (mapping.capability.module.name === "@hypit/gpt-image" && mapping.capability.name === "gpt-image-2") {+ const ratio = scalar(request, "aspectRatio");+ const resolution = scalar(request, "resolution");+ if (ratio === "auto" && resolution !== "1K") {+ return `KIE GPT Image 2 accepts auto aspect ratio only at 1K, not ${String(resolution)}`;+ }+ if (ratio === "1:1" && resolution === "4K") {+ return "KIE GPT Image 2 does not accept 1:1 at 4K";+ }+ if (ratio === "4:5" && resolution !== "1K") {+ return `KIE GPT Image 2 accepts 4:5 only at 1K, not ${String(resolution)}`;}}+ if (mapping.capability.module.name === "@hypit/grok-imagine"+ && (mapping.capability.name === "grok-imagine-video"+ || mapping.capability.name === "grok-imagine-video-1.5-preview")+ && scalar(request, "resolution") === "1080p"+ && (request.ports.images?.length ?? 0) > 1) {+ return `KIE ${mapping.capability.name} accepts at most one reference image at 1080p`;+ }+ return undefined;}-const kieGenerationMappings: readonly (KieGenerationWireMapping & { readonly result: "image" | "video" })[] = kieModelCatalog.map((mapping) => {+const kieGenerationMappings: readonly (GenerationWireMapping & { readonly result: "image" | "video" })[] = kieModelCatalog.map((mapping) => {if (mapping.result === "audio") {throw new Error(`KIE route ${mapping.capability.name} declares unsupported audio output`);}- return mapping as KieGenerationWireMapping & { readonly result: "image" | "video" };+ return mapping as GenerationWireMapping & { readonly result: "image" | "video" };});const generationRoutes: readonly KieRoute[] = kieGenerationMappings.map((mapping) => ({@@ -80,15 +83,14 @@ const generationRoutes: readonly KieRoute[] = kieGenerationMappings.map((mappingreturns: mapping.result === "image" ? generationTypes.imageSet : generationTypes.videoSet,media: mapping.result,maxResults: mapping.result === "image" ? 16 : 8,- ...(mapping.unsupportedPortValues === undefined ? {} : {- supports: (need: EndpointRequest) => supportsKieGenerationRequest(- mapping,- need.constraints as unknown as GenerationRequest,- ),- }),+ supports: (need: EndpointRequest) => kieGenerationRejection(+ mapping,+ need.constraints as unknown as GenerationRequest,+ ) === undefined,compile: async (constraints, resolve) => {const request = constraints as unknown as GenerationRequest;- validateKieGenerationRequest(mapping, request);+ const rejection = kieGenerationRejection(mapping, request);+ if (rejection !== undefined) throw new Error(rejection);return await compileWireRequest(mapping, request, resolve);},packageResult: (artifacts) => ({diff --git a/packages/seedance/src/index.ts b/packages/seedance/src/index.tsindex bb6e1ba4..bdaa3fb3 100644--- a/packages/seedance/src/index.ts+++ b/packages/seedance/src/index.ts@@ -46,7 +46,9 @@ function seedancePortTable(model: SeedanceModel): GenerationPortTable {name: "resolution",value: {kind: "enum",- values: model === "seedance-2" ? ["480p", "720p", "1080p", "4k"] : ["480p", "720p"],+ values: model === "seedance-2"+ ? ["480p", "720p", "1080p", "4k"]+ : is25 ? ["480p", "720p", "1080p"] : ["480p", "720p"],},minItems: 1,maxItems: 1,@@ -180,7 +182,7 @@ const seedanceVideoPort: readonly SurfacePortVocabulary[] = [{const seedanceSettingNotes: readonly string[] = ["`resolution` defaults to `720p`, `aspect-ratio` to `9:16` and `generate-audio` to `false`.",- "`1080p` and `4k` are offered by `standard` alone; the other variants render at `480p` or `720p`.",+ "`standard` offers `1080p` and `4k`; `2.5` offers `1080p`; `fast` and `mini` render at `480p` or `720p`.","`duration` is 4 to 15 seconds for `standard`, `fast` and `mini`, and `-1` for automatic or 4 to 30 seconds for `2.5`.",];diff --git a/packages/seedream/src/index.ts b/packages/seedream/src/index.tsindex b19a87df..6d333c64 100644--- a/packages/seedream/src/index.ts+++ b/packages/seedream/src/index.ts@@ -23,7 +23,7 @@ export const seedream5LitePorts: GenerationPortTable = sealGenerationPortTable({{ name: "outputFormat", value: { kind: "enum", values: ["png", "jpeg"] }, minItems: 1, maxItems: 1 },/** Explicit author choice; the Provider never silently changes this policy. */{ name: "nsfwCheck", value: { kind: "boolean" }, minItems: 1, maxItems: 1 },- { name: "images", value: { kind: "media", accepts: ["image"] }, minItems: 0, maxItems: 16 },+ { name: "images", value: { kind: "media", accepts: ["image"] }, minItems: 0, maxItems: 14 },],requires: [],});@@ -148,7 +148,7 @@ export const seedreamMarkupSurfaces = [{<seedream:Reference image={scene.image}/></seedream:ReferenceImage>`,notes: [- "The element requires at least one `Reference` child and accepts at most 16.",+ "The element requires at least one `Reference` child and accepts at most 14.","The Surface copies no runtime media into request metadata; every reference stays a graph edge.",],},diff --git a/skills/hypit/references/runtime.md b/skills/hypit/references/runtime.mdindex 23c80bf4..e6d2e013 100644--- a/skills/hypit/references/runtime.md+++ b/skills/hypit/references/runtime.md@@ -62,8 +62,8 @@ An Author Source importing `@hypit/gemini` remains Provider-neutral. Bind those`@hypit/provider-vertex` for direct Vertex. The reference-video preprocessing observer runs outside aBuild but reads the same Profile binding; there is no separate environment switch.-Provider-specific input limits are also part of preflight. For the KIE GPT Image 2 route, do not-submit `4:3`, `3:4` or `4:5`; the route rejects those aspect ratios before upload or paid submission.+Provider-specific input limits are also part of preflight. For KIE GPT Image 2, `auto` is 1K-only,+`1:1` is unavailable at 4K, and `4:5` is 1K-only; `4:3` and `3:4` are valid.The local Providers stay small: `media`, `whisperx` and `hyperframes` are bounded by this machine'scores rather than by a remote queue, and raising them buys contention.