gooseworks 0.5.0-dev.9.d3e7757f → 0.5.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 (220) hide show
  1. package/README.md +17 -26
  2. package/dist/auth/device-flow.d.ts +10 -0
  3. package/dist/auth/device-flow.d.ts.map +1 -1
  4. package/dist/auth/device-flow.js +39 -1
  5. package/dist/auth/device-flow.js.map +1 -1
  6. package/dist/commands/doctor.d.ts.map +1 -1
  7. package/dist/commands/doctor.js +3 -1
  8. package/dist/commands/doctor.js.map +1 -1
  9. package/dist/commands/video.d.ts +5 -0
  10. package/dist/commands/video.d.ts.map +1 -0
  11. package/dist/commands/video.js +117 -0
  12. package/dist/commands/video.js.map +1 -0
  13. package/dist/config.d.ts.map +1 -1
  14. package/dist/config.js +5 -2
  15. package/dist/config.js.map +1 -1
  16. package/dist/environment.d.ts.map +1 -1
  17. package/dist/environment.js +4 -2
  18. package/dist/environment.js.map +1 -1
  19. package/dist/kit/core/bind.d.ts +12 -0
  20. package/dist/kit/core/bind.d.ts.map +1 -0
  21. package/dist/kit/core/bind.js +77 -0
  22. package/dist/kit/core/bind.js.map +1 -0
  23. package/dist/kit/core/canonical.d.ts +30 -0
  24. package/dist/kit/core/canonical.d.ts.map +1 -0
  25. package/dist/kit/core/canonical.js +67 -0
  26. package/dist/kit/core/canonical.js.map +1 -0
  27. package/dist/kit/core/check.d.ts +22 -0
  28. package/dist/kit/core/check.d.ts.map +1 -0
  29. package/dist/kit/core/check.js +53 -0
  30. package/dist/kit/core/check.js.map +1 -0
  31. package/dist/kit/core/device.d.ts +17 -0
  32. package/dist/kit/core/device.d.ts.map +1 -0
  33. package/dist/kit/core/device.js +153 -0
  34. package/dist/kit/core/device.js.map +1 -0
  35. package/dist/kit/core/errors.d.ts +22 -0
  36. package/dist/kit/core/errors.d.ts.map +1 -0
  37. package/dist/kit/core/errors.js +49 -0
  38. package/dist/kit/core/errors.js.map +1 -0
  39. package/dist/kit/core/files.d.ts +49 -0
  40. package/dist/kit/core/files.d.ts.map +1 -0
  41. package/dist/kit/core/files.js +213 -0
  42. package/dist/kit/core/files.js.map +1 -0
  43. package/dist/kit/core/host.d.ts +26 -0
  44. package/dist/kit/core/host.d.ts.map +1 -0
  45. package/dist/kit/core/host.js +10 -0
  46. package/dist/kit/core/host.js.map +1 -0
  47. package/dist/kit/core/log.d.ts +17 -0
  48. package/dist/kit/core/log.d.ts.map +1 -0
  49. package/dist/kit/core/log.js +82 -0
  50. package/dist/kit/core/log.js.map +1 -0
  51. package/dist/kit/core/paths.d.ts +27 -0
  52. package/dist/kit/core/paths.d.ts.map +1 -0
  53. package/dist/kit/core/paths.js +103 -0
  54. package/dist/kit/core/paths.js.map +1 -0
  55. package/dist/kit/core/pieces.d.ts +84 -0
  56. package/dist/kit/core/pieces.d.ts.map +1 -0
  57. package/dist/kit/core/pieces.js +374 -0
  58. package/dist/kit/core/pieces.js.map +1 -0
  59. package/dist/kit/core/progress-reporter.d.ts +30 -0
  60. package/dist/kit/core/progress-reporter.d.ts.map +1 -0
  61. package/dist/kit/core/progress-reporter.js +106 -0
  62. package/dist/kit/core/progress-reporter.js.map +1 -0
  63. package/dist/kit/core/progress.d.ts +22 -0
  64. package/dist/kit/core/progress.d.ts.map +1 -0
  65. package/dist/kit/core/progress.js +90 -0
  66. package/dist/kit/core/progress.js.map +1 -0
  67. package/dist/kit/core/run.d.ts +35 -0
  68. package/dist/kit/core/run.d.ts.map +1 -0
  69. package/dist/kit/core/run.js +850 -0
  70. package/dist/kit/core/run.js.map +1 -0
  71. package/dist/kit/core/save.d.ts +43 -0
  72. package/dist/kit/core/save.d.ts.map +1 -0
  73. package/dist/kit/core/save.js +265 -0
  74. package/dist/kit/core/save.js.map +1 -0
  75. package/dist/kit/core/schema.d.ts +5 -0
  76. package/dist/kit/core/schema.d.ts.map +1 -0
  77. package/dist/kit/core/schema.js +183 -0
  78. package/dist/kit/core/schema.js.map +1 -0
  79. package/dist/kit/core/secrets.d.ts +9 -0
  80. package/dist/kit/core/secrets.d.ts.map +1 -0
  81. package/dist/kit/core/secrets.js +60 -0
  82. package/dist/kit/core/secrets.js.map +1 -0
  83. package/dist/kit/core/style.d.ts +59 -0
  84. package/dist/kit/core/style.d.ts.map +1 -0
  85. package/dist/kit/core/style.js +179 -0
  86. package/dist/kit/core/style.js.map +1 -0
  87. package/dist/kit/core/toolchain.d.ts +52 -0
  88. package/dist/kit/core/toolchain.d.ts.map +1 -0
  89. package/dist/kit/core/toolchain.js +321 -0
  90. package/dist/kit/core/toolchain.js.map +1 -0
  91. package/dist/kit/core/version.d.ts +18 -0
  92. package/dist/kit/core/version.d.ts.map +1 -0
  93. package/dist/kit/core/version.js +33 -0
  94. package/dist/kit/core/version.js.map +1 -0
  95. package/dist/kit/env.d.ts +42 -0
  96. package/dist/kit/env.d.ts.map +1 -0
  97. package/dist/kit/env.js +76 -0
  98. package/dist/kit/env.js.map +1 -0
  99. package/dist/kit/line/client.d.ts +82 -0
  100. package/dist/kit/line/client.d.ts.map +1 -0
  101. package/dist/kit/line/client.js +325 -0
  102. package/dist/kit/line/client.js.map +1 -0
  103. package/dist/kit/line/types.d.ts +178 -0
  104. package/dist/kit/line/types.d.ts.map +1 -0
  105. package/dist/kit/line/types.js +18 -0
  106. package/dist/kit/line/types.js.map +1 -0
  107. package/dist/kit/maker/browser.d.ts +114 -0
  108. package/dist/kit/maker/browser.d.ts.map +1 -0
  109. package/dist/kit/maker/browser.js +547 -0
  110. package/dist/kit/maker/browser.js.map +1 -0
  111. package/dist/kit/maker/encode.d.ts +27 -0
  112. package/dist/kit/maker/encode.d.ts.map +1 -0
  113. package/dist/kit/maker/encode.js +58 -0
  114. package/dist/kit/maker/encode.js.map +1 -0
  115. package/dist/kit/maker/images.d.ts +14 -0
  116. package/dist/kit/maker/images.d.ts.map +1 -0
  117. package/dist/kit/maker/images.js +174 -0
  118. package/dist/kit/maker/images.js.map +1 -0
  119. package/dist/kit/maker/inputs.d.ts +81 -0
  120. package/dist/kit/maker/inputs.d.ts.map +1 -0
  121. package/dist/kit/maker/inputs.js +235 -0
  122. package/dist/kit/maker/inputs.js.map +1 -0
  123. package/dist/kit/maker/make.d.ts +19 -0
  124. package/dist/kit/maker/make.d.ts.map +1 -0
  125. package/dist/kit/maker/make.js +272 -0
  126. package/dist/kit/maker/make.js.map +1 -0
  127. package/dist/kit/maker/page.d.ts +19 -0
  128. package/dist/kit/maker/page.d.ts.map +1 -0
  129. package/dist/kit/maker/page.js +276 -0
  130. package/dist/kit/maker/page.js.map +1 -0
  131. package/dist/kit/maker/parts/html-frames/1.0.0/part.json +183 -0
  132. package/dist/kit/maker/parts/html-frames/src/part.d.ts +3 -0
  133. package/dist/kit/maker/parts/html-frames/src/part.d.ts.map +1 -0
  134. package/dist/kit/maker/parts/html-frames/src/part.js +10 -0
  135. package/dist/kit/maker/parts/html-frames/src/part.js.map +1 -0
  136. package/dist/kit/maker/runtime.d.ts +7 -0
  137. package/dist/kit/maker/runtime.d.ts.map +1 -0
  138. package/dist/kit/maker/runtime.js +571 -0
  139. package/dist/kit/maker/runtime.js.map +1 -0
  140. package/dist/kit/maker/unzip.d.ts +3 -0
  141. package/dist/kit/maker/unzip.d.ts.map +1 -0
  142. package/dist/kit/maker/unzip.js +133 -0
  143. package/dist/kit/maker/unzip.js.map +1 -0
  144. package/dist/kit/parts/catalog.d.ts +47 -0
  145. package/dist/kit/parts/catalog.d.ts.map +1 -0
  146. package/dist/kit/parts/catalog.js +198 -0
  147. package/dist/kit/parts/catalog.js.map +1 -0
  148. package/dist/kit/parts/fs-safe.d.ts +32 -0
  149. package/dist/kit/parts/fs-safe.d.ts.map +1 -0
  150. package/dist/kit/parts/fs-safe.js +185 -0
  151. package/dist/kit/parts/fs-safe.js.map +1 -0
  152. package/dist/kit/parts/loader.d.ts +50 -0
  153. package/dist/kit/parts/loader.d.ts.map +1 -0
  154. package/dist/kit/parts/loader.js +395 -0
  155. package/dist/kit/parts/loader.js.map +1 -0
  156. package/dist/kit/parts/semver.d.ts +6 -0
  157. package/dist/kit/parts/semver.d.ts.map +1 -0
  158. package/dist/kit/parts/semver.js +44 -0
  159. package/dist/kit/parts/semver.js.map +1 -0
  160. package/dist/program.d.ts.map +1 -1
  161. package/dist/program.js +6 -6
  162. package/dist/program.js.map +1 -1
  163. package/dist/skills/installer.d.ts +22 -0
  164. package/dist/skills/installer.d.ts.map +1 -1
  165. package/dist/skills/installer.js +56 -8
  166. package/dist/skills/installer.js.map +1 -1
  167. package/dist/skills/master-skill.d.ts +11 -70
  168. package/dist/skills/master-skill.d.ts.map +1 -1
  169. package/dist/skills/master-skill.js +120 -2900
  170. package/dist/skills/master-skill.js.map +1 -1
  171. package/dist/skills/package-freshness.d.ts +19 -0
  172. package/dist/skills/package-freshness.d.ts.map +1 -1
  173. package/dist/skills/package-freshness.js +37 -2
  174. package/dist/skills/package-freshness.js.map +1 -1
  175. package/dist/skills/routes.d.ts +7 -2
  176. package/dist/skills/routes.d.ts.map +1 -1
  177. package/dist/skills/routes.js +21 -25
  178. package/dist/skills/routes.js.map +1 -1
  179. package/dist/skills/server-entry-skills.d.ts +14 -0
  180. package/dist/skills/server-entry-skills.d.ts.map +1 -0
  181. package/dist/skills/server-entry-skills.js +119 -0
  182. package/dist/skills/server-entry-skills.js.map +1 -0
  183. package/dist/skills/staging-content.js +1 -1
  184. package/package.json +10 -6
  185. package/skills/goose-ads/SKILL.md +27 -605
  186. package/skills/goose-product-photos/SKILL.md +24 -217
  187. package/skills/goose-video/SKILL.md +23 -610
  188. package/skills/goose-video-local/SKILL.md +3 -1609
  189. package/skills/gooseworks/SKILL.md +58 -529
  190. package/skills/make-custom-video/SKILL.md +23 -725
  191. package/skills/manifest.json +7 -7
  192. package/skills/routes.json +10 -24
  193. package/dist/commands/video-local.d.ts +0 -9
  194. package/dist/commands/video-local.d.ts.map +0 -1
  195. package/dist/commands/video-local.js +0 -83
  196. package/dist/commands/video-local.js.map +0 -1
  197. package/dist/commands/video-save.d.ts +0 -3
  198. package/dist/commands/video-save.d.ts.map +0 -1
  199. package/dist/commands/video-save.js +0 -83
  200. package/dist/commands/video-save.js.map +0 -1
  201. package/dist/lib/video-local-captions.d.ts +0 -83
  202. package/dist/lib/video-local-captions.d.ts.map +0 -1
  203. package/dist/lib/video-local-captions.js +0 -261
  204. package/dist/lib/video-local-captions.js.map +0 -1
  205. package/dist/lib/video-local-runtime.d.ts +0 -8
  206. package/dist/lib/video-local-runtime.d.ts.map +0 -1
  207. package/dist/lib/video-local-runtime.js +0 -201
  208. package/dist/lib/video-local-runtime.js.map +0 -1
  209. package/dist/lib/video-save-mcp.d.ts +0 -9
  210. package/dist/lib/video-save-mcp.d.ts.map +0 -1
  211. package/dist/lib/video-save-mcp.js +0 -162
  212. package/dist/lib/video-save-mcp.js.map +0 -1
  213. package/dist/lib/video-save.d.ts +0 -77
  214. package/dist/lib/video-save.d.ts.map +0 -1
  215. package/dist/lib/video-save.js +0 -440
  216. package/dist/lib/video-save.js.map +0 -1
  217. package/dist/skills/custom-video-skill.d.ts +0 -3
  218. package/dist/skills/custom-video-skill.d.ts.map +0 -1
  219. package/dist/skills/custom-video-skill.js +0 -6
  220. package/dist/skills/custom-video-skill.js.map +0 -1
@@ -0,0 +1,276 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.familyOf = familyOf;
37
+ exports.buildPage = buildPage;
38
+ // Builds the page folder a frame page runs from: the style's template and
39
+ // frames at their own relative places, the fonts, product photos and brand
40
+ // files under _kit/, and the template with the kit runtime put first in its
41
+ // <head>. Only these files are in the folder, so the page can show only what
42
+ // its inputs name (and what the step hash covers). Bundled into the part.
43
+ const node_crypto_1 = require("node:crypto");
44
+ const promises_1 = require("node:fs/promises");
45
+ const path = __importStar(require("node:path"));
46
+ const images_1 = require("./images");
47
+ const runtime_1 = require("./runtime");
48
+ const KIT_FOLDER = '_kit';
49
+ const IMAGE_EXT = {
50
+ 'image/png': 'png',
51
+ 'image/jpeg': 'jpg',
52
+ 'image/webp': 'webp',
53
+ 'image/gif': 'gif',
54
+ 'image/avif': 'avif',
55
+ 'image/svg+xml': 'svg',
56
+ };
57
+ const FONT_FORMAT = {
58
+ ttf: { ext: 'ttf', format: 'truetype' },
59
+ otf: { ext: 'otf', format: 'opentype' },
60
+ woff: { ext: 'woff', format: 'woff' },
61
+ woff2: { ext: 'woff2', format: 'woff2' },
62
+ };
63
+ const COLOR = /^(#[0-9a-fA-F]{3,8}|(rgb|rgba|hsl|hsla)\([0-9.,%\s/]+\))$/;
64
+ /** Reads a file the core handed over and refuses it if it changed since the core hashed it. */
65
+ async function readChecked(ref, fail) {
66
+ let data;
67
+ try {
68
+ data = await (0, promises_1.readFile)(ref.path);
69
+ }
70
+ catch {
71
+ return fail(`the file ${path.basename(ref.path)} could not be read`);
72
+ }
73
+ const sha = (0, node_crypto_1.createHash)('sha256').update(data).digest('hex');
74
+ if (sha !== ref.sha256)
75
+ fail(`the file ${path.basename(ref.path)} changed after it was checked`);
76
+ return data;
77
+ }
78
+ function commonFolder(files) {
79
+ let common = path.dirname(files[0]);
80
+ for (const file of files.slice(1)) {
81
+ while (path.relative(common, file).startsWith('..')) {
82
+ const up = path.dirname(common);
83
+ if (up === common)
84
+ break;
85
+ common = up;
86
+ }
87
+ }
88
+ return common;
89
+ }
90
+ function fontOf(ref, fail) {
91
+ const fromMime = ref.mime.startsWith('font/') ? ref.mime.slice(5) : '';
92
+ const fromName = path.extname(ref.path).slice(1).toLowerCase();
93
+ const kind = FONT_FORMAT[fromMime] ?? FONT_FORMAT[fromName];
94
+ if (!kind)
95
+ fail(`the font ${path.basename(ref.path)} is not ttf, otf, woff or woff2`);
96
+ return kind;
97
+ }
98
+ /** The family a style font is used by in CSS: its file name without the extension. */
99
+ function familyOf(ref) {
100
+ return path.basename(ref.path, path.extname(ref.path)).replace(/[^A-Za-z0-9 _-]/g, '-');
101
+ }
102
+ /**
103
+ * Puts the kit's head first in the document, right after the doctype, so it
104
+ * runs before anything of the page's own, even a script placed before <head>.
105
+ * The parser files it into the head the page then continues.
106
+ */
107
+ function injectFirst(html, head) {
108
+ const text = html.replace(/^\uFEFF/, '');
109
+ const doctype = /^\s*<!doctype[^>]*>/i.exec(text);
110
+ if (doctype)
111
+ return doctype[0] + head + text.slice(doctype[0].length);
112
+ return '<!doctype html>' + head + text;
113
+ }
114
+ function cssString(value) {
115
+ return JSON.stringify(value);
116
+ }
117
+ /**
118
+ * Builds the page folder. `reserve(bytes)` is called before every write and
119
+ * throws when the maker's working space would run out, so nothing is written
120
+ * past it.
121
+ */
122
+ async function buildPage(spec, dir, ctx, reserve = () => undefined) {
123
+ const fail = (detail) => {
124
+ throw ctx.error('bad_input', detail);
125
+ };
126
+ await (0, promises_1.mkdir)(path.join(dir, KIT_FOLDER, 'fonts'), { recursive: true });
127
+ await (0, promises_1.mkdir)(path.join(dir, KIT_FOLDER, 'media'), { recursive: true });
128
+ let bytes = 0;
129
+ const put = async (target, data) => {
130
+ const size = Buffer.byteLength(data);
131
+ reserve(size);
132
+ await (0, promises_1.writeFile)(target, data);
133
+ bytes += size;
134
+ };
135
+ const still = (ref, data) => {
136
+ if ((0, images_1.isAnimatedImage)(data))
137
+ fail(`the picture ${path.basename(ref.path)} moves on its own; frame pages take still pictures and draw any motion themselves`);
138
+ };
139
+ // A closed shadow root written into the page's HTML is out of the kit runtime's reach.
140
+ const openTrees = (ref, data) => {
141
+ if (/\bshadowroot(mode)?\s*=\s*["']?closed/i.test(data.toString('utf8'))) {
142
+ fail(`the frame ${path.basename(ref.path)} declares a closed shadow root; use an open one`);
143
+ }
144
+ };
145
+ // The template and its frames keep their places relative to each other.
146
+ const pageFiles = [spec.template, ...spec.frames];
147
+ const base = commonFolder(pageFiles.map((f) => f.path));
148
+ const entry = path.join(dir, path.relative(base, spec.template.path));
149
+ // Every URL the kit gives the page is relative to the page itself.
150
+ const url = (relFromDir) => path.relative(path.dirname(entry), path.join(dir, ...relFromDir.split('/'))).split(path.sep).join('/');
151
+ const placed = new Map();
152
+ const preload = [];
153
+ for (const ref of pageFiles) {
154
+ const rel = path.relative(base, ref.path).split(path.sep).join('/');
155
+ if (rel.split('/')[0] === KIT_FOLDER)
156
+ fail(`the frame ${rel} uses the folder name ${KIT_FOLDER}, which the kit keeps for itself`);
157
+ const known = placed.get(rel);
158
+ if (known !== undefined) {
159
+ if (known !== ref.sha256)
160
+ fail(`two different frames are both called ${rel}`);
161
+ continue;
162
+ }
163
+ placed.set(rel, ref.sha256);
164
+ const data = await readChecked(ref, fail);
165
+ if (ref.media === 'html')
166
+ openTrees(ref, data);
167
+ // The page can't read the rules of its own stylesheet files (each file is its own origin),
168
+ // so the pictures they name as data: URLs are checked here.
169
+ if (ref.mime === 'text/css' || /\.css$/i.test(ref.path)) {
170
+ for (const inline of (0, images_1.cssDataUrls)(data.toString('utf8'))) {
171
+ if ((0, images_1.isAnimatedImage)(inline.bytes))
172
+ fail(`the stylesheet ${rel} names a picture that moves on its own; frame pages take still pictures and draw any motion themselves`);
173
+ }
174
+ }
175
+ const target = path.join(dir, ...rel.split('/'));
176
+ await (0, promises_1.mkdir)(path.dirname(target), { recursive: true });
177
+ if (ref === spec.template)
178
+ continue;
179
+ if (ref.media === 'image')
180
+ still(ref, data);
181
+ await put(target, data);
182
+ if (ref.media === 'image')
183
+ preload.push(url(rel));
184
+ }
185
+ // Fonts: the style's under their file names, the brand's under fixed names.
186
+ const faces = [];
187
+ const families = [];
188
+ const addFont = async (ref, family) => {
189
+ if (families.includes(family))
190
+ fail(`two fonts are both called ${family}`);
191
+ const kind = fontOf(ref, fail);
192
+ const name = `${ref.sha256.slice(0, 16)}.${kind.ext}`;
193
+ await put(path.join(dir, KIT_FOLDER, 'fonts', name), await readChecked(ref, fail));
194
+ faces.push(`@font-face{font-family:${cssString(family)};src:url(${cssString(url(`${KIT_FOLDER}/fonts/${name}`))}) format(${cssString(kind.format)});font-display:block;}`);
195
+ families.push(family);
196
+ };
197
+ for (const font of spec.fonts)
198
+ await addFont(font, familyOf(font));
199
+ if (spec.brand?.fonts.heading)
200
+ await addFont(spec.brand.fonts.heading, 'brand-heading');
201
+ if (spec.brand?.fonts.body)
202
+ await addFont(spec.brand.fonts.body, 'brand-body');
203
+ // Pictures: product photos, the logo and scene stills, by content.
204
+ const media = async (ref) => {
205
+ const ext = IMAGE_EXT[ref.mime];
206
+ if (!ext)
207
+ fail(`the picture ${path.basename(ref.path)} is not png, jpg, webp, gif, avif or svg`);
208
+ const rel = `${KIT_FOLDER}/media/${ref.sha256.slice(0, 16)}.${ext}`;
209
+ if (!preload.includes(url(rel))) {
210
+ const data = await readChecked(ref, fail);
211
+ still(ref, data);
212
+ await put(path.join(dir, ...rel.split('/')), data);
213
+ preload.push(url(rel));
214
+ }
215
+ return url(rel);
216
+ };
217
+ const products = [];
218
+ for (const product of spec.products) {
219
+ const images = [];
220
+ for (const image of product.images)
221
+ images.push(await media(image));
222
+ products.push({ id: product.id, name: product.name, images });
223
+ }
224
+ const scenes = [];
225
+ for (const scene of spec.scenes) {
226
+ const picture = scene.picture && typeof scene.picture === 'object' ? await media(scene.picture) : scene.picture;
227
+ const image = scene.image ? await media(scene.image) : null;
228
+ scenes.push({
229
+ id: scene.id,
230
+ index: scene.index,
231
+ line: scene.line,
232
+ on_screen: scene.on_screen,
233
+ picture,
234
+ image,
235
+ start_s: spec.sceneFrames[scene.index] / spec.fps,
236
+ end_s: spec.sceneFrames[scene.index + 1] / spec.fps,
237
+ });
238
+ }
239
+ const brand = spec.brand
240
+ ? {
241
+ name: spec.brand.name,
242
+ colors: spec.brand.colors,
243
+ logo: spec.brand.logo ? await media(spec.brand.logo) : null,
244
+ fonts: { heading: spec.brand.fonts.heading ? 'brand-heading' : null, body: spec.brand.fonts.body ? 'brand-body' : null },
245
+ cta: spec.brand.cta,
246
+ }
247
+ : null;
248
+ // Brand colours as CSS variables, only when they are plain colours.
249
+ const variables = [`--kit-width:${spec.design.width}px`, `--kit-height:${spec.design.height}px`];
250
+ for (const [key, value] of Object.entries(spec.brand?.colors ?? {})) {
251
+ if (typeof value === 'string' && /^[a-z0-9_]+$/i.test(key) && COLOR.test(value.trim())) {
252
+ variables.push(`--brand-${key.replace(/_/g, '-')}:${value.trim()}`);
253
+ }
254
+ }
255
+ const data = {
256
+ aspect: spec.aspect,
257
+ width: spec.design.width,
258
+ height: spec.design.height,
259
+ fps: spec.fps,
260
+ frames: spec.frameCount,
261
+ duration_s: spec.frameCount / spec.fps,
262
+ scenes,
263
+ products,
264
+ brand,
265
+ fonts: families,
266
+ values: spec.values,
267
+ preload,
268
+ };
269
+ const head = '<meta charset="utf-8">' +
270
+ `<style id="kit-fonts">${faces.join('')}:root{${variables.join(';')}}</style>` +
271
+ `<script>${(0, runtime_1.runtimeScript)(data)}</script>`;
272
+ const template = (await readChecked(spec.template, fail)).toString('utf8');
273
+ await put(entry, injectFirst(template, head));
274
+ return { entry, families, bytes };
275
+ }
276
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/kit/maker/page.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,4BAEC;AAuBD,8BAsJC;AA7PD,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,6CAAyC;AACzC,+CAA8D;AAC9D,gDAAkC;AAElC,qCAAwD;AAExD,uCAA0C;AAE1C,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAM,SAAS,GAA2B;IACxC,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,KAAK;IACnB,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,MAAM;IACpB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,WAAW,GAAoD;IACnE,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE;IACvC,GAAG,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE;IACvC,IAAI,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;IACrC,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;CACzC,CAAC;AAEF,MAAM,KAAK,GAAG,2DAA2D,CAAC;AAa1E,+FAA+F;AAC/F,KAAK,UAAU,WAAW,CAAC,GAAY,EAAE,IAAU;IACjD,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,GAAG,CAA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C,MAAM;QACnB,OAAO;KACR,CAAC;IACF,MAAM,IAAI,GACR,wBAAwB;QACxB,yBAAyB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW;QAC9E,WAAW,IAAA,uBAAa,EAAC,IAAI,CAAC,WAAW,CAAC;IAC5C,MAAM,QAAQ,GAAG,CAAC,MAAM,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC3E,MAAM,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAC9C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACpC,CAAC"}
@@ -0,0 +1,183 @@
1
+ {
2
+ "interface": 1,
3
+ "id": "html-frames",
4
+ "version": "1.0.0",
5
+ "kind": "render_html",
6
+ "title": "HTML frames",
7
+ "summary": "Lays out a style's frame page with the plan's scenes, products and brand in the kit's Chromium, steps a virtual clock frame by frame and encodes the frames to H.264.",
8
+ "runtime": "node",
9
+ "entry": "part.mjs",
10
+ "files": ["part.mjs"],
11
+ "kit": ">=1.0.0 <2.0.0",
12
+ "needs": {
13
+ "browser": true,
14
+ "ffmpeg": { "encoders": ["libx264"] },
15
+ "network": false,
16
+ "models": [],
17
+ "disk_mb": 1024
18
+ },
19
+ "inputs": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["template", "scenes", "aspect", "max_words"],
23
+ "oneOf": [{ "required": ["duration_s"] }, { "required": ["scene_s"] }],
24
+ "properties": {
25
+ "template": {
26
+ "description": "The style's frame page. The maker puts the kit runtime first in its head; the page reads window.kit and draws each frame from kit.render(fn), renderAt(t), seek(ms), or CSS and Web Animations.",
27
+ "type": "object",
28
+ "x-kit-file": { "media": "html" }
29
+ },
30
+ "frames": {
31
+ "description": "Every other file the page uses (css, js, json, svg, png, jpg, webp), kept at the same places relative to the template. The page can load nothing else.",
32
+ "type": "array",
33
+ "maxItems": 200,
34
+ "items": {
35
+ "anyOf": [
36
+ { "type": "object", "x-kit-file": { "media": "html" } },
37
+ { "type": "object", "x-kit-file": { "media": "text" } },
38
+ { "type": "object", "x-kit-file": { "media": "json" } },
39
+ { "type": "object", "x-kit-file": { "media": "image" } }
40
+ ]
41
+ }
42
+ },
43
+ "fonts": {
44
+ "description": "The style's fonts (ttf, otf, woff, woff2). CSS uses each by its file name without the extension.",
45
+ "type": "array",
46
+ "maxItems": 20,
47
+ "items": { "type": "object", "x-kit-file": { "media": "font" } }
48
+ },
49
+ "scenes": {
50
+ "description": "plan.scenes, in order. The scenes share the video evenly; kit.scenes carries each one's start_s and end_s, and picture and image as URLs when they are files.",
51
+ "type": "array",
52
+ "minItems": 1,
53
+ "maxItems": 30,
54
+ "items": {
55
+ "type": "object",
56
+ "properties": {
57
+ "id": { "type": ["string", "null"], "maxLength": 64 },
58
+ "line": { "type": ["string", "null"], "maxLength": 2000 },
59
+ "on_screen": { "type": ["string", "null"], "maxLength": 2000 },
60
+ "picture": {
61
+ "anyOf": [
62
+ { "type": "null" },
63
+ { "type": "string", "maxLength": 2000 },
64
+ { "type": "object", "x-kit-file": { "media": "image" } }
65
+ ]
66
+ },
67
+ "image": {
68
+ "description": "A picture the customer uploaded for this scene, as kit.scenes[i].image (a URL the page can load).",
69
+ "anyOf": [{ "type": "null" }, { "type": "object", "x-kit-file": { "media": "image" } }]
70
+ }
71
+ }
72
+ }
73
+ },
74
+ "max_words": {
75
+ "description": "The style's scenes.max_words. A scene whose line or on-screen text has more words is refused.",
76
+ "type": "integer",
77
+ "minimum": 1,
78
+ "maximum": 200
79
+ },
80
+ "products": {
81
+ "description": "plan.products, in the customer's order.",
82
+ "type": "array",
83
+ "maxItems": 12,
84
+ "items": {
85
+ "type": "object",
86
+ "required": ["id"],
87
+ "properties": {
88
+ "id": { "type": "string", "minLength": 1 },
89
+ "name": { "type": ["string", "null"], "maxLength": 2000 },
90
+ "images": {
91
+ "type": "array",
92
+ "maxItems": 20,
93
+ "items": { "type": "object", "x-kit-file": { "media": "image" } }
94
+ }
95
+ }
96
+ }
97
+ },
98
+ "brand": {
99
+ "description": "The brand frozen at the yes ({\"from\": \"brand\"}): name, logo, colors, fonts (heading, body), cta. Colours become CSS variables (--brand-primary, ...); fonts are brand-heading and brand-body.",
100
+ "type": ["object", "null"],
101
+ "properties": {
102
+ "name": { "type": ["string", "null"], "maxLength": 2000 },
103
+ "logo": { "anyOf": [{ "type": "null" }, { "type": "object", "x-kit-file": { "media": "image" } }] },
104
+ "colors": { "type": ["object", "null"] },
105
+ "fonts": {
106
+ "type": ["object", "null"],
107
+ "properties": {
108
+ "heading": { "anyOf": [{ "type": "null" }, { "type": "object", "x-kit-file": { "media": "font" } }] },
109
+ "body": { "anyOf": [{ "type": "null" }, { "type": "object", "x-kit-file": { "media": "font" } }] }
110
+ }
111
+ },
112
+ "cta": { "type": ["object", "null"] }
113
+ }
114
+ },
115
+ "aspect": { "enum": ["9:16", "1:1", "4:5", "16:9"] },
116
+ "duration_s": {
117
+ "description": "Length of the whole video, in seconds. Give this or scene_s.",
118
+ "type": "number",
119
+ "minimum": 0.5,
120
+ "maximum": 180
121
+ },
122
+ "scene_s": {
123
+ "description": "Seconds per scene; the video is this times the number of scenes. Give this or duration_s.",
124
+ "type": "number",
125
+ "exclusiveMinimum": 0,
126
+ "maximum": 60
127
+ },
128
+ "fps": { "type": "integer", "minimum": 1, "maximum": 60, "default": 30 },
129
+ "short_side": {
130
+ "description": "Pixels on the short side of the video. The page is always laid out at 1080 and scaled.",
131
+ "enum": [720, 1080],
132
+ "default": 1080
133
+ },
134
+ "values": {
135
+ "description": "The style's own plain values for its page (labels, look choices), as kit.values.",
136
+ "type": "object"
137
+ }
138
+ }
139
+ },
140
+ "outputs": {
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "required": ["video", "seconds", "timeline"],
144
+ "properties": {
145
+ "video": {
146
+ "description": "H.264 in yuv420p, BT.709, no sound, at the aspect's size.",
147
+ "type": "object",
148
+ "x-kit-file": { "media": "video", "mime": ["video/mp4"] }
149
+ },
150
+ "seconds": { "type": "number", "exclusiveMinimum": 0 },
151
+ "timeline": {
152
+ "description": "duration_s, width, height, fps, scenes [{id, start_s, end_s}] and an empty speech list.",
153
+ "type": "object",
154
+ "required": ["duration_s", "width", "height", "fps", "scenes", "speech"],
155
+ "properties": {
156
+ "duration_s": { "type": "number" },
157
+ "width": { "type": "integer" },
158
+ "height": { "type": "integer" },
159
+ "fps": { "type": "number" },
160
+ "scenes": {
161
+ "type": "array",
162
+ "items": {
163
+ "type": "object",
164
+ "required": ["id", "start_s", "end_s"],
165
+ "properties": {
166
+ "id": { "type": "string" },
167
+ "start_s": { "type": "number" },
168
+ "end_s": { "type": "number" }
169
+ }
170
+ }
171
+ },
172
+ "speech": { "type": "array", "maxItems": 0 }
173
+ }
174
+ }
175
+ }
176
+ },
177
+ "cost": { "basis": "free" },
178
+ "determinism": "pure",
179
+ "timing": { "typical_s": 90, "timeout_s": 1200 },
180
+ "retry": { "transient": 1 },
181
+ "replaces": ["render-html-frames", "render-search-grid", "render-photo-grid-card", "render-logo-equation-card", "create-kinetic-typography"],
182
+ "x-determinism-scope": "pure within one render environment: the same inputs give the same bytes on the same operating system, Chromium build and fonts. The kit's toolchain id carries the browser's render fingerprint (version, platform and a hash of a probe page drawn with the system's fonts), so a cached step is never reused on a computer that would draw it differently."
183
+ }
@@ -0,0 +1,3 @@
1
+ import type { PartRun } from '../../../../part-interface';
2
+ export declare const run: PartRun;
3
+ //# sourceMappingURL=part.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"part.d.ts","sourceRoot":"","sources":["../../../../../../src/kit/maker/parts/html-frames/src/part.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAG1D,eAAO,MAAM,GAAG,EAAE,OAGjB,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.run = void 0;
4
+ const make_1 = require("../../../make");
5
+ const run = async (inputs, ctx) => {
6
+ const made = await (0, make_1.makeVideo)(inputs, ctx);
7
+ return { video: made.video, seconds: made.seconds, timeline: made.timeline };
8
+ };
9
+ exports.run = run;
10
+ //# sourceMappingURL=part.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"part.js","sourceRoot":"","sources":["../../../../../../src/kit/maker/parts/html-frames/src/part.ts"],"names":[],"mappings":";;;AAIA,wCAA0C;AAEnC,MAAM,GAAG,GAAY,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;IAChD,MAAM,IAAI,GAAG,MAAM,IAAA,gBAAS,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1C,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC/E,CAAC,CAAC;AAHW,QAAA,GAAG,OAGd"}
@@ -0,0 +1,7 @@
1
+ /** Fixed wall-clock start for the page: 2026-01-01T00:00:00Z. */
2
+ export declare const PAGE_EPOCH_MS = 1767225600000;
3
+ /** Page data as a JS literal that is safe inside a <script> element. */
4
+ export declare function scriptJson(value: unknown): string;
5
+ /** The runtime with this page's data in it. */
6
+ export declare function runtimeScript(data: unknown): string;
7
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/kit/maker/runtime.ts"],"names":[],"mappings":"AAsCA,iEAAiE;AACjE,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAqgB3C,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMjD;AAED,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAEnD"}