@orangecatai/adgen-canvas 0.0.39 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/dev/chunk-2K6ZAAHB.js +1535 -0
  2. package/dist/dev/chunk-2K6ZAAHB.js.map +7 -0
  3. package/dist/dev/{chunk-E7VZGEUJ.js → chunk-2Q5Z4UTF.js} +2 -2
  4. package/dist/dev/{chunk-E7VZGEUJ.js.map → chunk-2Q5Z4UTF.js.map} +1 -1
  5. package/dist/dev/{chunk-LIELFD5T.js → chunk-3WIRZ6S7.js} +6 -1
  6. package/dist/dev/chunk-3WIRZ6S7.js.map +7 -0
  7. package/dist/dev/{chunk-5XP2WJAQ.js → chunk-7XZBXIDZ.js} +1300 -1252
  8. package/dist/dev/chunk-7XZBXIDZ.js.map +7 -0
  9. package/dist/dev/chunk-AKA4GZ3R.js +62 -0
  10. package/dist/dev/chunk-AKA4GZ3R.js.map +7 -0
  11. package/dist/dev/chunk-LWUV2KR2.js +27 -0
  12. package/dist/dev/chunk-LWUV2KR2.js.map +7 -0
  13. package/dist/dev/chunk-T57LHRZV.js +2167 -0
  14. package/dist/dev/chunk-T57LHRZV.js.map +7 -0
  15. package/dist/dev/components/auto-resize/nativeResizeAgent-5XWJJ74W.js +1074 -0
  16. package/dist/dev/components/auto-resize/nativeResizeAgent-5XWJJ74W.js.map +7 -0
  17. package/dist/dev/data/{image-PUPXCX7M.js → image-MTDE3WXB.js} +4 -3
  18. package/dist/dev/index.css +618 -27
  19. package/dist/dev/index.css.map +3 -3
  20. package/dist/dev/index.js +6769 -8217
  21. package/dist/dev/index.js.map +4 -4
  22. package/dist/dev/locales/{en-VCZQBJ2N.js → en-3S2H3QGO.js} +2 -2
  23. package/dist/dev/model-capabilities.js +47 -0
  24. package/dist/dev/model-capabilities.js.map +7 -0
  25. package/dist/dev/subset-shared.chunk.js +1 -1
  26. package/dist/dev/subset-worker.chunk.js +1 -1
  27. package/dist/prod/chunk-6YYSQB5E.js +1 -0
  28. package/dist/prod/{chunk-CLQPYXMS.js → chunk-PIM2DC2L.js} +3 -3
  29. package/dist/prod/chunk-POCDVKZK.js +142 -0
  30. package/dist/prod/chunk-PWBUVPCU.js +1 -0
  31. package/dist/prod/{chunk-WBFDC4WN.js → chunk-R4DNAEVN.js} +1 -1
  32. package/dist/prod/chunk-U2I2OXQ7.js +4 -0
  33. package/dist/prod/chunk-UR7GPHHO.js +1 -0
  34. package/dist/prod/components/auto-resize/nativeResizeAgent-45UNA3LO.js +5 -0
  35. package/dist/prod/data/image-U4RMOYQQ.js +1 -0
  36. package/dist/prod/index.css +1 -1
  37. package/dist/prod/index.js +67 -298
  38. package/dist/prod/locales/{en-ZZURI326.js → en-Z3CKUL4S.js} +1 -1
  39. package/dist/prod/model-capabilities.js +1 -0
  40. package/dist/prod/subset-shared.chunk.js +1 -1
  41. package/dist/prod/subset-worker.chunk.js +1 -1
  42. package/dist/types/common/src/utils.d.ts +4 -1
  43. package/dist/types/element/src/index.d.ts +3 -0
  44. package/dist/types/element/src/newElement.d.ts +2 -1
  45. package/dist/types/element/src/textHtml.d.ts +14 -0
  46. package/dist/types/element/src/textLayout.d.ts +97 -0
  47. package/dist/types/element/src/textStyleRanges.d.ts +62 -0
  48. package/dist/types/element/src/textWrapping.d.ts +27 -0
  49. package/dist/types/element/src/types.d.ts +35 -0
  50. package/dist/types/excalidraw/actions/actionFrame.d.ts +1 -0
  51. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -0
  52. package/dist/types/excalidraw/actions/actionProperties.d.ts +50 -0
  53. package/dist/types/excalidraw/actions/index.d.ts +1 -1
  54. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  55. package/dist/types/excalidraw/components/AIChatPanel.d.ts +18 -2
  56. package/dist/types/excalidraw/components/App.d.ts +6 -0
  57. package/dist/types/excalidraw/components/FontSizeInput.d.ts +19 -0
  58. package/dist/types/excalidraw/components/ImageGeneratorPanel.d.ts +946 -45
  59. package/dist/types/excalidraw/components/VideoGeneratorPanel.d.ts +67 -53
  60. package/dist/types/excalidraw/components/ai-chat/ActivityTimeline.d.ts +18 -0
  61. package/dist/types/excalidraw/components/ai-chat/activitySteps.d.ts +106 -0
  62. package/dist/types/excalidraw/components/ai-chat/agentLoop.d.ts +66 -3
  63. package/dist/types/excalidraw/components/ai-chat/canvasTools.d.ts +23 -8
  64. package/dist/types/excalidraw/components/ai-chat/htmlToExcalidraw.d.ts +3 -0
  65. package/dist/types/excalidraw/components/ai-chat/openRouterStream.d.ts +13 -0
  66. package/dist/types/excalidraw/components/auto-resize/ResizeActivityCard.d.ts +7 -0
  67. package/dist/types/excalidraw/components/auto-resize/autoResizeEngine.d.ts +5 -2
  68. package/dist/types/excalidraw/components/auto-resize/autoResizeStore.d.ts +23 -0
  69. package/dist/types/excalidraw/components/auto-resize/imageBounds.d.ts +11 -0
  70. package/dist/types/excalidraw/components/auto-resize/nativeResizeAgent.d.ts +5 -0
  71. package/dist/types/excalidraw/components/auto-resize/resizeFitting.d.ts +7 -0
  72. package/dist/types/excalidraw/components/auto-resize/resizeLayout.d.ts +33 -0
  73. package/dist/types/excalidraw/components/icons.d.ts +6 -0
  74. package/dist/types/excalidraw/components/template-builder/TemplateBuilderTray.d.ts +1 -0
  75. package/dist/types/excalidraw/index.d.ts +9 -0
  76. package/dist/types/excalidraw/modelCapabilities/index.d.ts +17 -0
  77. package/dist/types/excalidraw/modelCapabilities/registry.image.d.ts +2 -0
  78. package/dist/types/excalidraw/modelCapabilities/registry.video.d.ts +2 -0
  79. package/dist/types/excalidraw/modelCapabilities/shared.d.ts +24 -0
  80. package/dist/types/excalidraw/modelCapabilities/types.d.ts +276 -0
  81. package/dist/types/excalidraw/modelCapabilities/validate.d.ts +48 -0
  82. package/dist/types/excalidraw/types.d.ts +4 -4
  83. package/dist/types/excalidraw/utils/imageApi.d.ts +3 -0
  84. package/dist/types/excalidraw/utils/referenceBudget.d.ts +12 -23
  85. package/dist/types/excalidraw/utils/videoApi.d.ts +21 -1
  86. package/dist/types/excalidraw/wysiwyg/richTextEditable.d.ts +36 -0
  87. package/dist/types/excalidraw/wysiwyg/textSelectionStyles.d.ts +32 -0
  88. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +6 -2
  89. package/package.json +10 -4
  90. package/dist/dev/chunk-5XP2WJAQ.js.map +0 -7
  91. package/dist/dev/chunk-LIELFD5T.js.map +0 -7
  92. package/dist/prod/chunk-T3ZLBHX4.js +0 -4
  93. package/dist/prod/data/image-AG3CTRSJ.js +0 -1
  94. /package/dist/dev/data/{image-PUPXCX7M.js.map → image-MTDE3WXB.js.map} +0 -0
  95. /package/dist/dev/locales/{en-VCZQBJ2N.js.map → en-3S2H3QGO.js.map} +0 -0
@@ -0,0 +1,62 @@
1
+ import {
2
+ blobToArrayBuffer,
3
+ decode,
4
+ encode
5
+ } from "./chunk-7XZBXIDZ.js";
6
+
7
+ // data/image.ts
8
+ import tEXt from "png-chunk-text";
9
+ import encodePng from "png-chunks-encode";
10
+ import decodePng from "png-chunks-extract";
11
+ import { EXPORT_DATA_TYPES, MIME_TYPES } from "@orangecatai/common";
12
+ var getTEXtChunk = async (blob) => {
13
+ const chunks = decodePng(new Uint8Array(await blobToArrayBuffer(blob)));
14
+ const metadataChunk = chunks.find((chunk) => chunk.name === "tEXt");
15
+ if (metadataChunk) {
16
+ return tEXt.decode(metadataChunk.data);
17
+ }
18
+ return null;
19
+ };
20
+ var encodePngMetadata = async ({
21
+ blob,
22
+ metadata
23
+ }) => {
24
+ const chunks = decodePng(new Uint8Array(await blobToArrayBuffer(blob)));
25
+ const metadataChunk = tEXt.encode(
26
+ MIME_TYPES.excalidraw,
27
+ JSON.stringify(
28
+ encode({
29
+ text: metadata,
30
+ compress: true
31
+ })
32
+ )
33
+ );
34
+ chunks.splice(-1, 0, metadataChunk);
35
+ return new Blob([encodePng(chunks)], { type: MIME_TYPES.png });
36
+ };
37
+ var decodePngMetadata = async (blob) => {
38
+ const metadata = await getTEXtChunk(blob);
39
+ if (metadata?.keyword === MIME_TYPES.excalidraw) {
40
+ try {
41
+ const encodedData = JSON.parse(metadata.text);
42
+ if (!("encoded" in encodedData)) {
43
+ if ("type" in encodedData && encodedData.type === EXPORT_DATA_TYPES.excalidraw) {
44
+ return metadata.text;
45
+ }
46
+ throw new Error("FAILED");
47
+ }
48
+ return decode(encodedData);
49
+ } catch (error) {
50
+ console.error(error);
51
+ throw new Error("FAILED");
52
+ }
53
+ }
54
+ throw new Error("INVALID");
55
+ };
56
+
57
+ export {
58
+ getTEXtChunk,
59
+ encodePngMetadata,
60
+ decodePngMetadata
61
+ };
62
+ //# sourceMappingURL=chunk-AKA4GZ3R.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../data/image.ts"],
4
+ "sourcesContent": ["import tEXt from \"png-chunk-text\";\nimport encodePng from \"png-chunks-encode\";\nimport decodePng from \"png-chunks-extract\";\n\nimport { EXPORT_DATA_TYPES, MIME_TYPES } from \"@orangecatai/common\";\n\nimport { blobToArrayBuffer } from \"./blob\";\nimport { encode, decode } from \"./encode\";\n\n// -----------------------------------------------------------------------------\n// PNG\n// -----------------------------------------------------------------------------\n\nexport const getTEXtChunk = async (\n blob: Blob,\n): Promise<{ keyword: string; text: string } | null> => {\n const chunks = decodePng(new Uint8Array(await blobToArrayBuffer(blob)));\n const metadataChunk = chunks.find((chunk) => chunk.name === \"tEXt\");\n if (metadataChunk) {\n return tEXt.decode(metadataChunk.data);\n }\n return null;\n};\n\nexport const encodePngMetadata = async ({\n blob,\n metadata,\n}: {\n blob: Blob;\n metadata: string;\n}) => {\n const chunks = decodePng(new Uint8Array(await blobToArrayBuffer(blob)));\n\n const metadataChunk = tEXt.encode(\n MIME_TYPES.excalidraw,\n JSON.stringify(\n encode({\n text: metadata,\n compress: true,\n }),\n ),\n );\n // insert metadata before last chunk (iEND)\n chunks.splice(-1, 0, metadataChunk);\n\n return new Blob([encodePng(chunks)], { type: MIME_TYPES.png });\n};\n\nexport const decodePngMetadata = async (blob: Blob) => {\n const metadata = await getTEXtChunk(blob);\n if (metadata?.keyword === MIME_TYPES.excalidraw) {\n try {\n const encodedData = JSON.parse(metadata.text);\n if (!(\"encoded\" in encodedData)) {\n // legacy, un-encoded scene JSON\n if (\n \"type\" in encodedData &&\n encodedData.type === EXPORT_DATA_TYPES.excalidraw\n ) {\n return metadata.text;\n }\n throw new Error(\"FAILED\");\n }\n return decode(encodedData);\n } catch (error: any) {\n console.error(error);\n throw new Error(\"FAILED\");\n }\n }\n throw new Error(\"INVALID\");\n};\n"],
5
+ "mappings": ";;;;;;;AAAA,OAAO,UAAU;AACjB,OAAO,eAAe;AACtB,OAAO,eAAe;AAEtB,SAAS,mBAAmB,kBAAkB;AASvC,IAAM,eAAe,OAC1B,SACsD;AACtD,QAAM,SAAS,UAAU,IAAI,WAAW,MAAM,kBAAkB,IAAI,CAAC,CAAC;AACtE,QAAM,gBAAgB,OAAO,KAAK,CAAC,UAAU,MAAM,SAAS,MAAM;AAClE,MAAI,eAAe;AACjB,WAAO,KAAK,OAAO,cAAc,IAAI;AAAA,EACvC;AACA,SAAO;AACT;AAEO,IAAM,oBAAoB,OAAO;AAAA,EACtC;AAAA,EACA;AACF,MAGM;AACJ,QAAM,SAAS,UAAU,IAAI,WAAW,MAAM,kBAAkB,IAAI,CAAC,CAAC;AAEtE,QAAM,gBAAgB,KAAK;AAAA,IACzB,WAAW;AAAA,IACX,KAAK;AAAA,MACH,OAAO;AAAA,QACL,MAAM;AAAA,QACN,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AAEA,SAAO,OAAO,IAAI,GAAG,aAAa;AAElC,SAAO,IAAI,KAAK,CAAC,UAAU,MAAM,CAAC,GAAG,EAAE,MAAM,WAAW,IAAI,CAAC;AAC/D;AAEO,IAAM,oBAAoB,OAAO,SAAe;AACrD,QAAM,WAAW,MAAM,aAAa,IAAI;AACxC,MAAI,UAAU,YAAY,WAAW,YAAY;AAC/C,QAAI;AACF,YAAM,cAAc,KAAK,MAAM,SAAS,IAAI;AAC5C,UAAI,EAAE,aAAa,cAAc;AAE/B,YACE,UAAU,eACV,YAAY,SAAS,kBAAkB,YACvC;AACA,iBAAO,SAAS;AAAA,QAClB;AACA,cAAM,IAAI,MAAM,QAAQ;AAAA,MAC1B;AACA,aAAO,OAAO,WAAW;AAAA,IAC3B,SAAS,OAAY;AACnB,cAAQ,MAAM,KAAK;AACnB,YAAM,IAAI,MAAM,QAAQ;AAAA,IAC1B;AAAA,EACF;AACA,QAAM,IAAI,MAAM,SAAS;AAC3B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,27 @@
1
+ // modelCapabilities/types.ts
2
+ var MAX_USER_REFERENCE_IMAGES = 6;
3
+ var MAX_REFERENCE_IMAGES = 12;
4
+ var REFERENCE_WIRE_BUDGET_BYTES = 3.2 * 1024 * 1024;
5
+ var HOST_ASSET_BYTE_RESERVATION = 180 * 1024;
6
+ var RESOLUTION_RANK = {
7
+ "0.5k": 1,
8
+ "480p": 2,
9
+ "720p": 3,
10
+ "1k": 4,
11
+ "1.5k": 5,
12
+ "1080p": 6,
13
+ "2k": 7,
14
+ "3k": 8,
15
+ "4k": 9
16
+ };
17
+ var ADAPTIVE_ASPECT_RATIO = "adaptive";
18
+
19
+ export {
20
+ MAX_USER_REFERENCE_IMAGES,
21
+ MAX_REFERENCE_IMAGES,
22
+ REFERENCE_WIRE_BUDGET_BYTES,
23
+ HOST_ASSET_BYTE_RESERVATION,
24
+ RESOLUTION_RANK,
25
+ ADAPTIVE_ASPECT_RATIO
26
+ };
27
+ //# sourceMappingURL=chunk-LWUV2KR2.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../modelCapabilities/types.ts"],
4
+ "sourcesContent": ["// Model input capability contract.\n//\n// This module is the canonical, dependency-light description of what each\n// registered image/video model accepts as input. It is consumed by two\n// enforcement layers:\n//\n// - the SDK, for UI behaviour and request construction;\n// - the host proxy, for authoritative validation before forwarding upstream.\n//\n// The host must never trust client-provided capability values: it resolves the\n// record by requested model ID from its own import of this module.\n//\n// \u2500\u2500 Sourcing rule \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Every value here is transcribed from the MODEL MAKER's own API docs \u2014 never\n// from OpenRouter or any other aggregator/reseller. Each record carries a\n// `verified` block naming the first-party doc it came from.\n//\n// Where a first-party doc does not state a limit, the field takes a\n// CONSERVATIVE DEFAULT (the safest documented-adjacent value) and the field\n// path is listed in `unknownFields`. An unknown limit is never silently\n// treated as verified, and never treated as zero.\n//\n// This file must remain import-free so it can be bundled as a server-safe\n// entry point and consumed from a Next.js API route without pulling in React.\n\n// \u2500\u2500\u2500 Transport guards \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// These are OUR limits, not any provider's, and they are deliberately separate\n// from the capability records. Most providers accept far more than we send\n// (Seedance allows a 64 MB body and 30 references; Seedream allows 30 MB per\n// image), so in practice these guards bind first. The effective limit is always\n// the smaller of the two \u2014 see `effectiveUserReferenceLimit`.\n\n/**\n * Hard cap on user-supplied reference images per generation. Six covers every\n * realistic ad brief. This is a product/transport decision, NOT a provider\n * limit \u2014 `ModelInputCapabilities.references.maxImages` carries those.\n */\nexport const MAX_USER_REFERENCE_IMAGES = 6;\n\n/**\n * Ceiling on total attached references across all tiers.\n * 6 user + 1 source + 1 logo + 2 brand assets + 2 ad references.\n */\nexport const MAX_REFERENCE_IMAGES = 12;\n\n/**\n * Wire-byte budget for the attached images alone. Vercel rejects at 4.5 MB;\n * this leaves headroom for the prompt, brand context and JSON envelope.\n */\nexport const REFERENCE_WIRE_BUDGET_BYTES = 3.2 * 1024 * 1024;\n\n/**\n * What the SDK assumes a host-injected brand asset costs on the wire, and the\n * ceiling the host compresses each one to before injecting it.\n */\nexport const HOST_ASSET_BYTE_RESERVATION = 180 * 1024;\n\n// \u2500\u2500\u2500 Cross-field constraints \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Some providers couple controls to each other: Veo 3.1 requires an 8 s\n// duration whenever reference images, 1080p or 4k are used; Grok Imagine Video\n// caps reference-to-video at 720p. Expressing these declaratively keeps the SDK\n// and the host from drifting into two different interpretations.\n\nexport type CapabilityCondition =\n | { kind: \"hasReferences\" }\n | { kind: \"hasStartFrame\" }\n | { kind: \"hasEndFrame\" }\n | { kind: \"hasAnyFrame\" }\n | { kind: \"resolutionIn\"; values: readonly string[] };\n\nexport type CapabilityRequirement =\n | { kind: \"durationMustBe\"; seconds: number }\n | { kind: \"resolutionAtMost\"; value: string }\n | { kind: \"aspectRatioMustBe\"; value: string };\n\nexport interface CapabilityConstraint {\n /** Fires when ANY of these conditions holds. */\n whenAny: readonly CapabilityCondition[];\n requires: CapabilityRequirement;\n /** User-readable explanation, quoting the provider rule where possible. */\n message: string;\n}\n\n/**\n * Ordering used by `resolutionAtMost`. Lower rank = smaller output.\n * Keys are compared case-insensitively.\n */\nexport const RESOLUTION_RANK: Readonly<Record<string, number>> = {\n \"0.5k\": 1,\n \"480p\": 2,\n \"720p\": 3,\n \"1k\": 4,\n \"1.5k\": 5,\n \"1080p\": 6,\n \"2k\": 7,\n \"3k\": 8,\n \"4k\": 9,\n};\n\n// \u2500\u2500\u2500 The contract \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type Modality = \"image\" | \"video\";\n\n/**\n * How a model groups reference images.\n *\n * `flat` \u2014 a plain list of images (Seedream, Seedance, Wan, Grok, Veo).\n * `elements` \u2014 nested subjects, each built from several views of one subject.\n * Kling 3.0 only: max 3 Elements, each 1 frontal image plus 1-3\n * additional angles. A flat count cannot express this.\n */\nexport type ReferenceGrouping = \"flat\" | \"elements\";\n\nexport interface ReferenceCapabilities {\n supported: boolean;\n grouping: ReferenceGrouping;\n /** Max reference IMAGES. For `elements`, the total across all groups. */\n maxImages: number;\n /** `elements` only: max number of subjects. */\n maxGroups?: number;\n /** `elements` only: images permitted per subject, frontal image included. */\n imagesPerGroup?: { min: number; max: number };\n maxVideos: number;\n maxAudios: number;\n /** Provider-side ceiling across every reference asset type, when documented. */\n maxTotalAssets?: number;\n acceptsImageAndVideoReferences: boolean;\n /**\n * Whether references may accompany a start/end frame. This is the field the\n * providers disagree on most sharply: ByteDance and Alibaba forbid the\n * combination outright, xAI explicitly permits it, and Google documents\n * neither (so Veo takes the conservative `false`).\n */\n canCombineWithStartFrame: boolean;\n canCombineWithEndFrame: boolean;\n}\n\nexport interface FrameSlotCapability {\n supported: boolean;\n maxImages: 0 | 1;\n}\n\nexport interface FrameCapabilities {\n start: FrameSlotCapability;\n end: FrameSlotCapability;\n allowsStartAndEndTogether: boolean;\n /**\n * True when an end frame is only accepted alongside a start frame.\n * Veo 3.1: `lastFrame` \"must be used in combination with the image\n * parameter\". Kling 3.0: \"last-frame-only video generation is not\n * supported\".\n */\n endFrameRequiresStartFrame: boolean;\n}\n\nexport interface AssetCapabilities {\n /** Lower-case MIME types the provider documents for input images. */\n imageMimeTypes: readonly string[];\n maxImageBytes: number | null;\n minEdgePx: number | null;\n maxEdgePx: number | null;\n /**\n * Permitted total pixel count (width x height) of an INPUT image. Several\n * providers bound the product rather than either edge -- Seedream allows\n * [196, 36,000,000] regardless of how the pixels are distributed.\n */\n inputPixels: { min: number; max: number } | null;\n /** Permitted width/height ratio of an INPUT image, as [min, max]. */\n inputAspectRatioRange: readonly [number, number] | null;\n /** Provider cap on the whole request body. */\n maxRequestBytes: number | null;\n}\n\n/**\n * How the provider treats an explicit output aspect ratio.\n *\n * `settable` \u2014 accepts an explicit value in every mode.\n * `forcedAdaptiveWithFrames` \u2014 accepts a value for text-to-video, but requires\n * `adaptive` once a frame is attached, deriving the\n * ratio from the first frame (Seedance 2.x).\n * `notApplicableWithFrames` \u2014 the image-to-video endpoint has no aspect-ratio\n * parameter at all, though text-to-video does\n * (Kling 3.0).\n * `notApplicable` \u2014 no aspect-ratio parameter in any mode.\n */\nexport type AspectRatioMode =\n | \"settable\"\n | \"forcedAdaptiveWithFrames\"\n | \"notApplicableWithFrames\"\n | \"notApplicable\";\n\n/** The value providers use to mean \"derive the ratio from the input media\". */\nexport const ADAPTIVE_ASPECT_RATIO = \"adaptive\";\n\nexport type AudioMode =\n | \"always-on\"\n | \"toggle-default-on\"\n | \"toggle-default-off\"\n | \"none\";\n\nexport interface ControlCapabilities {\n aspectRatioMode: AspectRatioMode;\n aspectRatios: readonly string[];\n resolutions: readonly string[];\n /** Discrete allowed durations. Mutually exclusive with min/max. */\n durationsSeconds?: readonly number[];\n minDurationSeconds?: number;\n maxDurationSeconds?: number;\n /** Whether the provider accepts `-1` / auto duration. */\n supportsAutoDuration?: boolean;\n audio: AudioMode;\n supportsNegativePrompt: boolean;\n supportsSeed: boolean;\n /** Output pixel envelope, where the provider documents one. */\n outputPixels?: { min: number; max: number };\n /** Output edge constraints, where documented. */\n outputEdge?: { min?: number; max?: number; multipleOf?: number };\n /** Max ratio of longer edge to shorter edge for the OUTPUT. */\n maxOutputEdgeRatio?: number;\n}\n\nexport interface VerificationRecord {\n /** First-party doc URL(s) the values were transcribed from. */\n sources: readonly string[];\n /** ISO date the transcription was checked. */\n checkedOn: string;\n}\n\nexport interface ModelInputCapabilities {\n modelId: string;\n modality: Modality;\n verified: VerificationRecord;\n /**\n * Dotted paths of fields holding a CONSERVATIVE DEFAULT because the\n * first-party docs do not state the value. Never empty-by-omission: a field\n * absent from this list is a transcribed, verified value.\n */\n unknownFields: readonly string[];\n /** Why each unknown field defaults the way it does, keyed by the same path. */\n unknownNotes?: Readonly<Record<string, string>>;\n references: ReferenceCapabilities;\n frames: FrameCapabilities;\n assets: AssetCapabilities;\n controls: ControlCapabilities;\n constraints: readonly CapabilityConstraint[];\n /** Provider rules we cannot check client-side, surfaced for messaging. */\n providerCaveats?: readonly string[];\n}\n\n// \u2500\u2500\u2500 Normalized inputs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface InputAsset {\n /** Data URL or remote URL. Empty string marks a host-filled placeholder. */\n dataUrl: string;\n mimeType?: string;\n bytes?: number;\n widthPx?: number;\n heightPx?: number;\n label?: string;\n}\n\n/**\n * A reference \"subject\" for `elements` grouping: one frontal view plus\n * additional angles of the same subject.\n */\nexport interface ReferenceGroup {\n frontal: InputAsset;\n additional: InputAsset[];\n label?: string;\n}\n\n/**\n * Every request is normalized into explicit slots before validation. The\n * validator must keep these categories distinct: a start frame is not an\n * ordinary reference image unless the provider docs say it is counted as one,\n * and the same holds for an end frame and a Quick Edit source image.\n */\nexport interface NormalizedGenerationInputs {\n startFrame: InputAsset | null;\n endFrame: InputAsset | null;\n /**\n * How many images the caller actually supplied for each frame slot. Every\n * registered model accepts at most one, so anything above that is reported\n * rather than silently truncated.\n */\n startFrameCount: number;\n endFrameCount: number;\n referenceImages: InputAsset[];\n referenceVideos: InputAsset[];\n referenceAudios: InputAsset[];\n /** `elements` grouping only. */\n referenceGroups: ReferenceGroup[];\n sourceImage: InputAsset | null;\n brandLogo: InputAsset | null;\n /** Host-injected brand/ad references the SDK only reserves room for. */\n hostReferences: InputAsset[];\n}\n\n/**\n * What callers hand to `normalizeInputs`. Every field is optional, and the\n * frame slots accept either a single asset or an array so an over-supply is\n * visible to the validator.\n */\nexport interface RawGenerationInputs {\n startFrame?: InputAsset | InputAsset[] | null;\n endFrame?: InputAsset | InputAsset[] | null;\n referenceImages?: InputAsset[];\n referenceVideos?: InputAsset[];\n referenceAudios?: InputAsset[];\n referenceGroups?: ReferenceGroup[];\n sourceImage?: InputAsset | null;\n brandLogo?: InputAsset | null;\n hostReferences?: InputAsset[];\n}\n\n/** The control values accompanying a request, for constraint evaluation. */\nexport interface RequestedControls {\n aspectRatio?: string;\n resolution?: string;\n durationSeconds?: number;\n audio?: boolean;\n seed?: number;\n negativePrompt?: string;\n}\n\n// \u2500\u2500\u2500 Error contract \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type InputCapabilityErrorCode =\n | \"UNKNOWN_MODEL_CAPABILITIES\"\n | \"START_FRAME_NOT_SUPPORTED\"\n | \"END_FRAME_NOT_SUPPORTED\"\n | \"TOO_MANY_START_FRAMES\"\n | \"TOO_MANY_END_FRAMES\"\n | \"END_FRAME_REQUIRES_START_FRAME\"\n | \"START_AND_END_FRAME_NOT_SUPPORTED_TOGETHER\"\n | \"FRAME_REFERENCE_COMBINATION_NOT_SUPPORTED\"\n // Distinguishes a block caused by MISSING DOCUMENTATION from one caused by a\n // documented provider rule, so the two are separable in logs.\n | \"REFERENCE_FRAME_COMBINATION_UNVERIFIED\"\n | \"REFERENCES_NOT_SUPPORTED\"\n | \"TOO_MANY_REFERENCE_IMAGES\"\n | \"TOO_MANY_REFERENCE_VIDEOS\"\n | \"TOO_MANY_REFERENCE_AUDIOS\"\n | \"TOO_MANY_REFERENCE_ASSETS\"\n | \"TOO_MANY_REFERENCE_GROUPS\"\n | \"INVALID_REFERENCE_GROUP_SIZE\"\n | \"UNSUPPORTED_MEDIA_TYPE\"\n | \"UNSUPPORTED_DIMENSIONS\"\n | \"REQUEST_TOO_LARGE\"\n | \"UNSUPPORTED_CONTROL\"\n | \"CONTROL_CONSTRAINT_VIOLATED\";\n\nexport interface InputCapabilityError {\n code: InputCapabilityErrorCode;\n message: string;\n modelId: string;\n /** Which input category or control caused the rejection. */\n field?: string;\n /** The permitted value, count, or set of values. */\n allowed?: number | string | readonly string[];\n received?: number | string;\n}\n"],
5
+ "mappings": ";AAqCO,IAAM,4BAA4B;AAMlC,IAAM,uBAAuB;AAM7B,IAAM,8BAA8B,MAAM,OAAO;AAMjD,IAAM,8BAA8B,MAAM;AAgC1C,IAAM,kBAAoD;AAAA,EAC/D,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AA+FO,IAAM,wBAAwB;",
6
+ "names": []
7
+ }