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(renderer): own browser preparation, source selection and capture lifecycle
kashorin2aa8dde48c2e
diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjsnew file mode 100644index 00000000..a534bfa2--- /dev/null+++ b/.puppeteerrc.cjs@@ -0,0 +1,3 @@+// Repository dependency installation prepares JavaScript packages only.+// The selected render Provider prepares its browser through explicit runtime/programs up.+module.exports = { skipDownload: true };diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 02e3835b..1e5ac6bd 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -27,6 +27,12 @@ pnpm install --frozen-lockfileLive Builds additionally need Python 3.10–3.13, uv, ffmpeg and Chromium. The[Development Guide](https://hypit.ai/guide/develop/) lists what each one is for.+For a Profile selecting local rendering, run `hypit programs up --runtime <profile> --endpoint+<render-instance>` before the first render (or `hypit runtime up --runtime <profile>` to prepare+the Profile and start its Worker). This explicitly prepares Chrome even when pnpm skips dependency+build scripts. `hypit doctor --runtime <profile>` diagnoses missing setup without installing it.+See the [local renderer README](packages/provider-hyperframes-local/README.md) for browser overrides.+## Make the change| Where you are working | Guide |@@ -61,7 +67,8 @@ The repository READMEs remain unchanged. `dist/release/README.md` shows the packWith FFmpeg and FFprobe available, run`npm run check:distribution -- dist/release/hypit-hypit-<version>.tgz` to install that tarball outsidethe checkout, build its chat example component, prepare its font and local renderer, render and export-the video, and decode the result. It uses a separate Hypit state directory, stops its Runtime Worker,+the video, and decode the result. It disables implicit Puppeteer downloads, checks missing-browser+diagnostics, and prepares the browser in an isolated cache. It uses a separate Hypit state directory, stops its Runtime Worker,and retains the temporary project on failure. The `npm package execution` workflow runs this on PRsand is reused by publication; publication uploads the same tarball that was installed and executed.diff --git a/CONTRIBUTING.zh-CN.md b/CONTRIBUTING.zh-CN.mdindex d43de113..9784d029 100644--- a/CONTRIBUTING.zh-CN.md+++ b/CONTRIBUTING.zh-CN.md@@ -21,6 +21,13 @@ pnpm install --frozen-lockfile运行真实 Build 还需要 Python 3.10–3.13、uv、ffmpeg 和 Chromium,各自的用途见[开发指南](https://hypit.ai/zh/guide/develop/)。+使用本地渲染的 Profile,首次渲染前执行+`hypit programs up --runtime <profile> --endpoint <render-instance>`;也可以执行+`hypit runtime up --runtime <profile>`,准备整个 Profile 并启动 Worker。+这一步显式准备 Chrome,不依赖 pnpm 放行依赖安装脚本。+`hypit doctor --runtime <profile>` 只诊断,不安装。+浏览器路径配置见[本地渲染器 README](packages/provider-hyperframes-local/README.md)。+## 进行改动| 改动范围 | 文档 |@@ -54,7 +61,8 @@ pnpm test # 包与服务适配器测试准备好 FFmpeg 和 FFprobe 后,运行`npm run check:distribution -- dist/release/hypit-hypit-<version>.tgz`。它在仓库外安装该包,编译包内的聊天示例组件,准备字体和本地渲染器,渲染、导出并解码视频。检查使用独立的-Hypit 状态目录,结束时停止自己的 Runtime Worker,失败时保留临时项目。+Hypit 状态目录,关闭 Puppeteer 隐式下载,先验证缺少浏览器的诊断,再在独立缓存中+显式准备浏览器。结束时停止自己的 Runtime Worker,失败时保留临时项目。`npm package execution` 工作流在 PR 上执行这项检查,发布流程复用它;发布的就是已经安装并执行过的同一份 tarball。diff --git a/bin/hypit.mjs b/bin/hypit.mjsindex 0b63931a..a7b59645 100755--- a/bin/hypit.mjs+++ b/bin/hypit.mjs@@ -19,8 +19,6 @@ process.emitWarning = function hypitWarning(warning, ...args) {};const distributionRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");-process.env.HYPIT_CLI_LAUNCHER ??= import.meta.filename;-process.env.HYPIT_DISTRIBUTION_ROOT ??= distributionRoot;register();const {installDistributionPackageResolution,diff --git a/docs/guide/develop.md b/docs/guide/develop.mdindex f573b43a..0eae8295 100644--- a/docs/guide/develop.md+++ b/docs/guide/develop.md@@ -12,10 +12,15 @@ description: Getting started with Hypit development.| Python | 3.10–3.13 | local WhisperX and OpenCV Managed Programs || uv | latest | Python environment management || ffmpeg / ffprobe | recent stable | media processing |-| Chrome / Chromium | managed by HyperFrames | local HyperFrames rendering |+| Chrome / Chromium | downloaded by `hypit runtime up` | local HyperFrames rendering |Node.js and pnpm are the only hard requirements. The rest are needed only for live Builds.+Before the first local render, run `hypit programs up --runtime <profile> --endpoint <render-instance>`.+`hypit runtime up --runtime <profile>` also prepares the Profile's programs and starts its Worker.+This browser preparation does not depend on pnpm allowing dependency install scripts.+Use `hypit doctor --runtime <profile>` to inspect missing setup without installing it.+## Daily workflow```bashdiff --git a/docs/zh/guide/develop.md b/docs/zh/guide/develop.mdindex 6328688a..57825c72 100644--- a/docs/zh/guide/develop.md+++ b/docs/zh/guide/develop.md@@ -12,10 +12,15 @@ description: 开始 Hypit 开发工作。| Python | 3.10–3.13 | 本地 WhisperX 与 OpenCV Managed Program || uv | latest | Python 环境管理 || ffmpeg / ffprobe | 较新的稳定版 | 媒体处理 |-| Chrome / Chromium | 由 HyperFrames 管理 | 本地 HyperFrames 渲染 |+| Chrome / Chromium | 由 `hypit runtime up` 下载 | 本地 HyperFrames 渲染 |只有 Node.js 与 pnpm 是硬性要求。其余都只在跑真实 Builds 时才需要。+首次本地渲染前执行 `hypit programs up --runtime <profile> --endpoint <render-instance>`。+`hypit runtime up --runtime <profile>` 也会准备 Profile 的程序并启动 Worker。+这一步准备浏览器,不依赖 pnpm 放行依赖安装脚本。+使用 `hypit doctor --runtime <profile>` 检查缺失环境;诊断不会安装浏览器。+## 日常工作流```bashdiff --git a/packages/package-loader-node/README.md b/packages/package-loader-node/README.mdindex 008e2ad9..7a1fcb80 100644--- a/packages/package-loader-node/README.md+++ b/packages/package-loader-node/README.md@@ -51,3 +51,13 @@ This is trusted execution, not a sandbox. Builtins, native libraries and process(including `process.cwd()` and `process.env`) remain shared. Existing module bindings do not changeunder an active Build; a file or dependency firstread later uses ordinary filesystem semantics. Scoped loading does not make a project tree immutable.++## Dependency installation options++A Distribution package may declare `hypit.dependencyInstallEnv` in its package.json, keyed by its+ordinary direct external dependency names. Each value is an environment-variable map passed to that+dependency's explicit npm installation. For example, an owner can disable an SDK's automatic asset+download and prepare that asset through its ManagedProgram instead. Options do not propagate to+unrelated installations or the caller's process. Conflicting values from selected packages fail;+no package wins by discovery order. They are command inputs, not a second dependency inventory,+readiness record, or new version system. Project packages remain owned by their package manager.diff --git a/packages/package-loader-node/src/loader.ts b/packages/package-loader-node/src/loader.tsindex 15038082..bc3eccf4 100644--- a/packages/package-loader-node/src/loader.ts+++ b/packages/package-loader-node/src/loader.ts@@ -16,7 +16,7 @@ import { externalPackageRoots, locateNodePackage } from "./location.js";type PackageJson = {readonly name: string;readonly version?: string;- readonly hypit?: { readonly activation?: string };+ readonly hypit?: { readonly activation?: string; readonly dependencyInstallEnv?: Readonly<Record<string, Readonly<Record<string, string>>>> };readonly dependencies: Readonly<Record<string, string>>;};@@ -43,7 +43,19 @@ function parsePackageJson(value: unknown, subject: string): PackageJson {return {name: text(item.name, `${subject}.name`),...(item.version === undefined ? {} : { version: text(item.version, `${subject}.version`) }),- ...(hypit?.activation === undefined ? {} : { hypit: { activation: text(hypit.activation, `${subject}.hypit.activation`) } }),+ ...(hypit === undefined ? {} : { hypit: {+ ...(hypit.activation === undefined ? {} : { activation: text(hypit.activation, `${subject}.hypit.activation`) }),+ ...(hypit.dependencyInstallEnv === undefined ? {} : { dependencyInstallEnv: Object.fromEntries(+ Object.entries(object(hypit.dependencyInstallEnv, `${subject}.hypit.dependencyInstallEnv`)).map(([name, raw]) => {+ assert(Object.hasOwn(dependencies, name) && !name.startsWith("@hypit/"), `${subject}: installation environment must name a direct external dependency: ${name}`);+ const env = object(raw, `${subject}.hypit.dependencyInstallEnv.${name}`);+ for (const [key, value] of Object.entries(env)) {+ assert(/^[A-Za-z_][A-Za-z0-9_]*$/u.test(key) && typeof value === "string", `${subject}: invalid installation environment for ${name}`);+ }+ return [name, env as Record<string, string>];+ }),+ ) }),+ } }),dependencies: Object.fromEntries(Object.entries(dependencies).map(([name, version]) => [name,text(version, `${subject}.dependencies.${name}`),@@ -183,11 +195,11 @@ export class NodePackageSelectionMissingError extends Error {export async function distributionExternalPackageRequirements(specifiers: readonly string[],distributionRoot: string,-): Promise<readonly { readonly name: string; readonly version: string; readonly specifier: string }[]> {+): Promise<readonly { readonly name: string; readonly version: string; readonly specifier: string; readonly env?: Readonly<Record<string, string>> }[]> {const root = resolve(distributionRoot);const queue = [...new Set(specifiers.filter((name) => name.startsWith("@hypit/")))].sort();const visited = new Set<string>();- const external = new Map<string, { readonly name: string; readonly version: string; readonly specifier: string }>();+ const external = new Map<string, { readonly name: string; readonly version: string; readonly specifier: string; readonly env?: Readonly<Record<string, string>> }>();while (queue.length > 0) {const name = queue.shift()!;if (visited.has(name)) continue;@@ -199,7 +211,15 @@ export async function distributionExternalPackageRequirements(continue;}const specifier = `${dependency}@${version}`;- external.set(specifier, { name: dependency, version, specifier });+ const requested = physical.json.hypit?.dependencyInstallEnv?.[dependency];+ const previous = external.get(specifier);+ const env = { ...previous?.env };+ for (const [key, value] of Object.entries(requested ?? {})) {+ assert(env[key] === undefined || env[key] === value, `Conflicting installation environment ${key} for ${specifier}`);+ env[key] = value;+ }+ external.set(specifier, { name: dependency, version, specifier,+ ...(Object.keys(env).length === 0 ? {} : { env }) });}}return [...external.values()].sort((left, right) => left.specifier.localeCompare(right.specifier));diff --git a/packages/package-loader-node/test/loader.test.ts b/packages/package-loader-node/test/loader.test.tsindex c3fca473..d89214a3 100644--- a/packages/package-loader-node/test/loader.test.ts+++ b/packages/package-loader-node/test/loader.test.ts@@ -1,5 +1,5 @@import assert from "node:assert/strict";-import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";+import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";import { tmpdir } from "node:os";import { join } from "node:path";import test from "node:test";@@ -84,6 +84,28 @@ test("Distribution requirements leave project packages to npm and follow interna}});+test("selected packages own dependency install options and conflicting declarations fail", async () => {+ const root = await mkdtemp(join(tmpdir(), "hypit-package-install-options-"));+ try {+ for (const [name, option] of [["first", "yes"], ["second", "no"]]) {+ await projectPackage(root, `@hypit/${name}`, `{ format: "hypit.node-package@1" }`, { "example-sdk": "1.2.3" });+ const path = join(root, "packages", name!, "package.json");+ const manifest = JSON.parse(await readFile(path, "utf8"));+ manifest.hypit.dependencyInstallEnv = { "example-sdk": { SDK_SKIP_DOWNLOAD: option } };+ await writeFile(path, JSON.stringify(manifest));+ }+ assert.deepEqual(await distributionExternalPackageRequirements(["@hypit/first"], root), [{+ name: "example-sdk", version: "1.2.3", specifier: "[email protected]", env: { SDK_SKIP_DOWNLOAD: "yes" },+ }]);+ await assert.rejects(distributionExternalPackageRequirements(["@hypit/first", "@hypit/second"], root), /Conflicting installation environment/u);+ const path = join(root, "packages", "first", "package.json");+ const manifest = JSON.parse(await readFile(path, "utf8"));+ manifest.hypit.dependencyInstallEnv = { "unrelated-package": { SDK_SKIP_DOWNLOAD: "yes" } };+ await writeFile(path, JSON.stringify(manifest));+ await assert.rejects(distributionExternalPackageRequirements(["@hypit/first"], root), /must name a direct external dependency/u);+ } finally { await rm(root, { recursive: true, force: true }); }+});+test("a Distribution package accepts an exact CLI-only dependency from the machine npm home", async () => {const project = await mkdtemp(join(tmpdir(), "hypit-cli-only-project-"));const distribution = await mkdtemp(join(tmpdir(), "hypit-cli-only-distribution-"));diff --git a/packages/provider-hyperframes-local/README.md b/packages/provider-hyperframes-local/README.mdindex 128dfbca..b0cb736e 100644--- a/packages/provider-hyperframes-local/README.md+++ b/packages/provider-hyperframes-local/README.md@@ -2,7 +2,7 @@Trusted local Provider for the `@hypit/render-hyperframes#render-visual` capability. It stages theResource dependencies declared by a `HyperframesDocument`, renders a silent MP4 with the-HyperFrames engine, probes the bytes, and returns a verified `RenderedVisual`. Before staging a typed+HyperFrames engine, probes the bytes, and returns a verified `RenderedVisual`. Before capturing a typedSurface it decodes the exact bytes and checks declared dimensions, still/frame timing, SDR/sRGB andopaque/straight-alpha facts. These checks validate the typed rendering input; they do not createcontent identity or hidden output metadata.@@ -64,12 +64,67 @@ GPU, or `auto` to let the engine decide. Capture uses screenshots and independenthe CLI's automatic worker and drawElement policies do not override the count. The opaque screenshotadapter uses the engine's public session, video injector and page seek protocol plus Chrome CDP.It waits for seek completion, dynamic images/fonts and the page compositor before capturing PNGs.+Image readiness includes CSS class and pseudo-element images, CSS masks and SVG images. A failed+image decode reports its URL instead of producing a successful frame with missing media. Failed+declared fonts also fail capture instead of silently leaving fallback glyphs in the output.The pinned engine couples its PNG session setup to transparent export, so this adapter initializesan opaque session and chooses PNG separately at capture. It does not patch engine methods or files.-The Runtime Adapter also declares one managed browser program. `programs up` invokes the pinned-HyperFrames CLI's `browser ensure`; its probe resolves and starts that browser and checks-the FFmpeg/FFprobe toolchain before a Build.+The Runtime Adapter declares one managed browser program. Prepare it explicitly:++```sh+hypit programs up --runtime ./hypit.runtime.json --endpoint hyperframes.local+hypit doctor --runtime ./hypit.runtime.json+```++Use the instance name from the Profile. `runtime up` also prepares it and starts the Runtime Worker.+The Provider's `package.json` declares its recommended Chrome Headless Shell version in+`hypit.renderBrowser.version`, alongside the engine dependency used to test that release. The+installer consumes that declaration; it does not have a browser version constant or fetch a+"latest" channel. `config.browserVersion` explicitly selects another exact four-part version.+Changing the recommendation belongs to a Provider release and requires real rendering tests; a+Puppeteer recommendation alone is not a HyperFrames compatibility guarantee.++The default cache is `~/.cache/hyperframes/chrome`; `config.browserCacheDirectory` selects another+location. Only the selected version is used, regardless of other cached or system browsers.+Projects sharing this cache use the existing ManagedProgram preparation lock/logs under+`.hypit-render-program`. Readiness comes from the executable and its reported version, not a receipt.+Explicit preparation reuses a healthy installation or repairs only the selected managed version.+A failed download reports failure without selecting another version or browser.++`config.browserDownloadBaseUrl` selects a Chrome for Testing archive mirror for explicit preparation.+It is an absolute HTTP(S) base URL, without credentials, a query or a fragment. The browser library+appends the selected version, platform and archive name; the mirror must serve that same layout.+For example, a base of `https://mirror.example/chrome-for-testing` serves archives beneath+`<base>/<version>/<platform>/chrome-headless-shell-<platform>.zip`. Choose a source maintained by+the user or organization; this Provider does not keep a mirror list or choose one by region.+Omitting the setting uses the browser library's official Chrome for Testing source. A configured+source replaces it: failed transfers or invalid archives fail preparation without trying the official+source or another mirror. Normal HTTP redirects supplied by the selected server are handled by the+download library. Preparation displays the complete archive URL, version and destination before+download. An npm registry setting does not redirect this binary download.++The download source only determines where missing installation bytes come from. It does not change+the executable selection, and changing it does not invalidate a healthy cached version. No source+receipt is stored. To install into an empty location, explicitly choose `browserCacheDirectory`.++`config.chromePath` selects a user-managed Chrome/Chromium executable. It cannot be combined with+`browserVersion` or `browserDownloadBaseUrl`; invalid combinations fail instead of assigning precedence. Relative paths resolve+from the Runtime Profile root. This mode never downloads or repairs a browser. Its version remains+under the user's control, including system-browser auto-updates. `HYPERFRAMES_BROWSER_PATH` and+`PRODUCER_HEADLESS_SHELL_PATH` do not select browsers in this Provider; configure `chromePath`.+On platforms without a supported managed download, explicitly select an installed browser.++`doctor` displays the selected path and its source, and only inspects it. Build preflight, rendering+and previews never install a browser. `programs up` / `runtime up` display the selected managed+version, installation location and download URL before running preparation. The probe runs `--version` and checks+FFmpeg/FFprobe; it does not promise GPU or page compatibility. Capture receives that same selected+path as the engine's `chromePath`, including its GPU probe. Active Workers keep their loaded package+recommendation; restart them explicitly after changing Profile or package dependencies.++The Provider's `hypit.dependencyInstallEnv` disables Puppeteer's browser download while preparing its+engine/producer npm dependencies. The repository `.puppeteerrc.cjs` does the same for checkout installs.+No browser postinstall allowlist is required. The former `hyperframesCliPath` option is removed.The same executor is exported for callers with an already compiled document:@@ -101,6 +156,17 @@ flushes that message and disconnects IPC so it can exit normally. The owner awaidiagnostics before returning. Normal completion does not enumerate or forcibly terminate processes.On failure, cleanup may be incomplete: the child reports the error and keeps IPC open while the ownerdiscovers and terminates the remaining process tree, before it can become orphaned.+The capture child also installs synchronous exit cleanup before loading the engine. Early+`process.exit()`, uncaught exceptions, and catchable `SIGINT`/`SIGTERM` exits stop descendants+while their owner still exists, even if browser initialization never returned a session.+Successful resource closure removes this exit handler. No historical browser PID list is retained.++Uncatchable termination (`SIGKILL`, native crashes, or OS termination on Windows) cannot run that+cleanup. The owner reports the termination and cannot confirm descendant cleanup; it never searches+by an already-exited root PID. If an orphan keeps the output pipes open, the owner closes its pipe+ends after five seconds so the failed invocation can settle. Guaranteed cleanup after an OS hard+kill requires containment supplied by that deployment (for example a process job or container);+this local Node implementation does not provide that guarantee.At cancellation the child receives a stop request and has up to five seconds to clean up. A childthat remains after cancellation or its completion message is forcibly terminated along with its discovered@@ -118,7 +184,10 @@ more of the shared render budget on a slow initialization or frame.An explicit stage-timeout error names the worker and stage/frame, aborts sibling workers and awaitscleanup. A completed worker closes its Chrome immediately.-One call stages the HTML and every declared asset once. Typed Surface validation includes a complete+One call stages the HTML and every declared asset once. Typed Surface inspection reads the completed+staged file directly, without retaining its chunks, assembling another whole-file buffer, or writing+a second temporary copy. The caller keeps that file until inspection and capture have settled.+Typed Surface validation includes a completedecoded-frame count, even for a short render interval. The renderer then finds source-frame windowsneeded by that interval, merges overlapping windows, and extracts them one source/window at a time.Decoded PNGs are shared by all workers in this call. Each worker initializes its own page, then takes@@ -134,9 +203,13 @@ do not share staged files or decoded PNGs. Exact compiler sampling markers retaifractional playback rates. There is no SVML rewrite, intermediate cut MP4 or repeat normalization.Already compiled video documents need the current compiler's frame markers.-Source extraction uses the pinned engine's FFmpeg/FFprobe resolver. `ffmpegPath` selects the final-H.264 encoder; `ffprobePath` verifies output and typed surfaces. `nodePath` and `hyperframesCliPath`-serve managed browser installation. The requested frame range travels in the Model's Need.+`ffmpegPath` selects both source decoding and final H.264 encoding; `ffprobePath` selects source,+output and typed Surface inspection. Bare commands resolve through PATH. The capture child passes+these selected executables to the engine's public binary overrides; inherited+`HYPERFRAMES_FFMPEG_PATH` / `HYPERFRAMES_FFPROBE_PATH` cannot select a different decoding toolchain.+`nodePath` selects the managed+browser installer's Node executable. Capture uses the current Node process's executable.+The requested frame range travels in the Model's Need; browser paths stay in the Provider.```tsimport { createLocalHyperframesProvider } from "@hypit/provider-hyperframes-local";diff --git a/packages/provider-hyperframes-local/package.json b/packages/provider-hyperframes-local/package.jsonindex d81ab5a1..bc608808 100644--- a/packages/provider-hyperframes-local/package.json+++ b/packages/provider-hyperframes-local/package.json@@ -8,7 +8,18 @@".": "./src/index.ts"},"hypit": {- "activation": "./src/activation.ts"+ "activation": "./src/activation.ts",+ "renderBrowser": {+ "version": "152.0.7928.2"+ },+ "dependencyInstallEnv": {+ "@hyperframes/engine": {+ "PUPPETEER_SKIP_DOWNLOAD": "true"+ },+ "@hyperframes/producer": {+ "PUPPETEER_SKIP_DOWNLOAD": "true"+ }+ }},"dependencies": {"@hyperframes/engine": "0.7.101",@@ -17,13 +28,12 @@"@hypit/hyperframes": "workspace:*","@hypit/media": "workspace:*","@hypit/media-execution": "workspace:*",- "@hypit/package-loader-node": "workspace:*","@hypit/protocol": "workspace:*","@hypit/render-hyperframes": "workspace:*","@hypit/runtime": "workspace:*","@hypit/runtime-host-node": "workspace:*","@hypit/runtime-kit": "workspace:*",- "hyperframes": "0.7.101",+ "@puppeteer/browsers": "3.2.2","tsx": "4.21.0"},"devDependencies": {diff --git a/packages/provider-hyperframes-local/src/activation.ts b/packages/provider-hyperframes-local/src/activation.tsindex f60e066d..7dd43667 100644--- a/packages/provider-hyperframes-local/src/activation.ts+++ b/packages/provider-hyperframes-local/src/activation.ts@@ -1,3 +1,4 @@+import { resolve } from "node:path";import {createRuntimeEndpointAdapterFacet,runtimeConfigExact,@@ -11,7 +12,7 @@ import {} from "@hypit/runtime-host-node";import { createLocalHyperframesProvider } from "./provider.js";-import { defaultHyperframesCliPath } from "./provider.js";+import { configuredBrowserPath, browserExecutablePath, selectedBrowserVersion } from "./browser.js";import type { HyperframesBrowserGpu, HyperframesQuality, HyperframesWorkers } from "./provider.js";import { localHyperframesBrowserProgram } from "./program.js";@@ -21,11 +22,10 @@ const localHyperframesRuntimeAdapter = createRuntimeEndpointAdapterFacet({if (context.pool === undefined) throw new Error("local HyperFrames Provider Pool is required");const config = runtimeConfigObject(context.config, "local HyperFrames");runtimeConfigExact(config, [- "nodePath", "hyperframesCliPath", "ffprobePath", "ffmpegPath", "workers", "maxWorkers", "quality", "browserGpu",+ "nodePath", "chromePath", "browserVersion", "browserCacheDirectory", "browserDownloadBaseUrl", "ffprobePath", "ffmpegPath", "workers", "maxWorkers", "quality", "browserGpu","defaultConcurrency", "browserCapacity", "initializationTimeoutMs", "frameTimeoutMs", "processTimeoutMs", "maxProcessOutputBytes", "maxRenderedBytes",], "local HyperFrames");runtimeConfigString(config.nodePath, "HyperFrames nodePath");- runtimeConfigString(config.hyperframesCliPath, "HyperFrames hyperframesCliPath");runtimeConfigString(config.ffprobePath, "HyperFrames ffprobePath");const workers = config.workers;if (workers !== undefined && workers !== "auto") {@@ -40,10 +40,21 @@ const localHyperframesRuntimeAdapter = createRuntimeEndpointAdapterFacet({throw new Error("HyperFrames browserGpu is invalid");}const configuredNode = runtimeConfigString(config.nodePath, "HyperFrames nodePath");- const configuredCli = runtimeConfigString(config.hyperframesCliPath, "HyperFrames hyperframesCliPath");+ const configuredChrome = runtimeConfigString(config.chromePath, "HyperFrames chromePath");+ const browserVersion = runtimeConfigString(config.browserVersion, "HyperFrames browserVersion");+ const browserDownloadBaseUrl = runtimeConfigString(config.browserDownloadBaseUrl, "HyperFrames browserDownloadBaseUrl");+ const configuredCache = runtimeConfigString(config.browserCacheDirectory, "HyperFrames browserCacheDirectory");+ const chromePath = configuredBrowserPath({ ...(configuredChrome === undefined ? {} : {+ chromePath: resolve(context.dataRoot, configuredChrome),+ }) });+ const browser = {+ ...(browserVersion === undefined ? {} : { browserVersion }),+ ...(browserDownloadBaseUrl === undefined ? {} : { browserDownloadBaseUrl }),+ ...(chromePath === undefined ? {} : { chromePath }),+ ...(configuredCache === undefined ? {} : { browserCacheDirectory: resolve(context.dataRoot, configuredCache) }),+ };const configuredFfprobe = runtimeConfigString(config.ffprobePath, "HyperFrames ffprobePath");const nodePath = resolveRuntimeExecutable(context.dataRoot, configuredNode ?? process.execPath);- const hyperframesCliPath = () => resolveRuntimeExecutable(context.dataRoot, configuredCli ?? defaultHyperframesCliPath());const configuredFfmpeg = runtimeConfigString(config.ffmpegPath, "HyperFrames ffmpegPath");const ffmpegPath = resolveRuntimeExecutable(context.dataRoot, configuredFfmpeg ?? "ffmpeg");const ffprobePath = resolveRuntimeExecutable(context.dataRoot, configuredFfprobe ?? "ffprobe");@@ -60,6 +71,7 @@ const localHyperframesRuntimeAdapter = createRuntimeEndpointAdapterFacet({instance: context.instance,pool: context.pool,nodePath,+ ...browser,ffprobePath,ffmpegPath,...(workers === undefined ? {} : { workers: workers as HyperframesWorkers }),@@ -77,11 +89,13 @@ const localHyperframesRuntimeAdapter = createRuntimeEndpointAdapterFacet({program: localHyperframesBrowserProgram({id: context.instance,nodePath,- hyperframesCliPath,+ ...browser,ffprobePath,ffmpegPath,}),diagnose: async () => [+ { severity: "info", code: "HYPERFRAMES_BROWSER_SELECTION", subject: context.instance,+ message: `${chromePath === undefined ? `Managed Chrome Headless Shell ${selectedBrowserVersion(browser)} (${browserVersion === undefined ? "Provider recommendation" : "Profile version"})` : "Profile browser"}: ${browserExecutablePath(browser)}` },...await diagnoseRuntimeExecutable({ root: context.dataRoot, configured: configuredFfmpeg, fallback: "ffmpeg", subject: "FFmpeg" }),...await diagnoseRuntimeExecutable({root: context.dataRoot,diff --git a/packages/provider-hyperframes-local/src/browser-install.ts b/packages/provider-hyperframes-local/src/browser-install.tsnew file mode 100644index 00000000..02b57d6f--- /dev/null+++ b/packages/provider-hyperframes-local/src/browser-install.ts@@ -0,0 +1,5 @@+import { installRenderBrowser } from "./browser.js";++const [cacheDir, version, baseUrl] = process.argv.slice(2);+if (process.argv.length < 4 || process.argv.length > 5 || !cacheDir || !version) throw new Error("Expected the render browser cache directory, exact version and optional archive base URL");+await installRenderBrowser(cacheDir, version, baseUrl);diff --git a/packages/provider-hyperframes-local/src/browser.ts b/packages/provider-hyperframes-local/src/browser.tsnew file mode 100644index 00000000..e9f7b637--- /dev/null+++ b/packages/provider-hyperframes-local/src/browser.ts@@ -0,0 +1,118 @@+import { execFile } from "node:child_process";+import { promisify } from "node:util";+import { access, stat } from "node:fs/promises";+import { constants, readFileSync } from "node:fs";+import { homedir } from "node:os";+import { join, resolve } from "node:path";+import { Browser, computeExecutablePath, detectBrowserPlatform, getDownloadUrl, install, uninstall } from "@puppeteer/browsers";++// The Provider's release owns this recommendation alongside its engine dependencies.+// It is installation input, not a second browser discovery policy in executable code.+const manifest = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));+export const recommendedBrowserVersion: string = exactBrowserVersion(manifest.hypit?.renderBrowser?.version);++function exactBrowserVersion(value: unknown): string {+ if (typeof value !== "string" || !/^\d+\.\d+\.\d+\.\d+$/u.test(value)) {+ throw new Error("HyperFrames browserVersion must be an exact four-part Chrome version; channels such as latest are not selections");+ }+ return value;+}++export type BrowserOptions = {+ readonly chromePath?: string;+ readonly browserVersion?: string;+ readonly browserCacheDirectory?: string;+ /** Chrome for Testing archive base URL; used only during explicit preparation. */+ readonly browserDownloadBaseUrl?: string;+};++export function browserDownloadBaseUrl(options: BrowserOptions): string | undefined {+ const value = options.browserDownloadBaseUrl;+ if (value === undefined) return undefined;+ if (options.chromePath !== undefined) {+ throw new Error("HyperFrames chromePath and browserDownloadBaseUrl are mutually exclusive; a user-managed browser is not downloaded");+ }+ let url: URL;+ try { url = new URL(value); } catch {+ throw new Error("HyperFrames browserDownloadBaseUrl must be an absolute HTTP(S) archive base URL");+ }+ if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.search || url.hash) {+ throw new Error("HyperFrames browserDownloadBaseUrl must be an HTTP(S) archive base URL without credentials, query or fragment");+ }+ return url.href.replace(/\/+$/u, "");+}++export function browserDownloadUrl(options: BrowserOptions): string {+ const baseUrl = browserDownloadBaseUrl(options);+ const version = selectedBrowserVersion(options);+ if (version === undefined) throw new Error("A user-managed browser has no download URL");+ const platform = detectBrowserPlatform();+ if (platform === undefined) throw new Error("The managed render browser is unavailable for this host; select chromePath");+ return getDownloadUrl(Browser.CHROMEHEADLESSSHELL, platform, version, baseUrl).href;+}++/** Only Profile/caller configuration selects a browser; environment hints are not inputs. */+export function configuredBrowserPath(options: BrowserOptions): string | undefined {+ browserDownloadBaseUrl(options);+ if (options.chromePath !== undefined && options.browserVersion !== undefined) {+ throw new Error("HyperFrames chromePath and browserVersion are mutually exclusive");+ }+ if (options.chromePath === "") throw new Error("HyperFrames chromePath must not be empty");+ return options.chromePath === undefined ? undefined : resolve(options.chromePath);+}++export function selectedBrowserVersion(options: BrowserOptions): string | undefined {+ return configuredBrowserPath(options) === undefined+ ? exactBrowserVersion(options.browserVersion ?? recommendedBrowserVersion) : undefined;+}++export function browserCacheDirectory(options: BrowserOptions): string {+ return resolve(options.browserCacheDirectory ?? join(homedir(), ".cache", "hyperframes", "chrome"));+}++export function browserExecutablePath(options: BrowserOptions): string {+ const configured = configuredBrowserPath(options);+ if (configured !== undefined) return configured;+ const version = selectedBrowserVersion(options)!;+ try {+ return computeExecutablePath({+ browser: Browser.CHROMEHEADLESSSHELL, buildId: version, cacheDir: browserCacheDirectory(options),+ });+ } catch (error) {+ throw new Error("The managed render browser is unavailable for this host. Select an installed Chrome/Chromium with the Provider's chromePath.", { cause: error });+ }+}++export async function requireBrowserExecutable(path: string, version?: string): Promise<void> {+ try {+ if (!(await stat(path)).isFile()) throw new Error("Browser path is not a file");+ await access(path, constants.X_OK);+ const { stdout } = await promisify(execFile)(path, ["--version"], { timeout: 15_000, windowsHide: true });+ if (!stdout.trim()) throw new Error("Browser returned no version");+ if (version !== undefined && !stdout.trim().split(/\s+/u).includes(version)) {+ throw new Error(`Expected Chrome Headless Shell ${version}, received ${stdout.trim()}`);+ }+ }+ catch (error) {+ throw new Error(`Render browser is unavailable at ${path}: ${error instanceof Error ? error.message : String(error)}. Prepare the selected Runtime with hypit runtime up --runtime <profile>, or correct its chromePath.`, { cause: error });+ }+}++/** Called only by the selected ManagedProgram's explicit installation command. */+export async function installRenderBrowser(cacheDir: string, version: string, downloadBaseUrl?: string): Promise<void> {+ const buildId = exactBrowserVersion(version);+ const options = { browserVersion: buildId, ...(downloadBaseUrl === undefined ? {} : { browserDownloadBaseUrl: downloadBaseUrl }) };+ const baseUrl = browserDownloadBaseUrl(options);+ const url = browserDownloadUrl(options);+ const path = computeExecutablePath({ browser: Browser.CHROMEHEADLESSSHELL, buildId, cacheDir });+ process.stdout.write(`Preparing Chrome Headless Shell ${buildId} at ${path}\nDownload source: ${url}\n`);+ try { await requireBrowserExecutable(path, buildId); return; } catch { /* Explicit preparation repairs this selection only. */ }+ await uninstall({ browser: Browser.CHROMEHEADLESSSHELL, buildId, cacheDir });+ try {+ // A single baseUrl uses the library's DefaultProvider without its provider-chain fallback.+ await install({ browser: Browser.CHROMEHEADLESSSHELL, buildId, cacheDir, ...(baseUrl === undefined ? {} : { baseUrl }) });+ await requireBrowserExecutable(path, buildId);+ } catch (error) {+ throw new Error(`Could not prepare Chrome Headless Shell ${buildId} from ${url} at ${path}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });+ }+}diff --git a/packages/provider-hyperframes-local/src/capture-bootstrap.ts b/packages/provider-hyperframes-local/src/capture-bootstrap.tsindex be8b1db7..01f18590 100644--- a/packages/provider-hyperframes-local/src/capture-bootstrap.ts+++ b/packages/provider-hyperframes-local/src/capture-bootstrap.ts@@ -1,5 +1,5 @@/**- * Preloaded into the disposable capture process, which never enters `bin/hypit.mjs`.+ * Preloaded into capture and browser-install processes, which never enter `bin/hypit.mjs`.** `module.registerHooks` is process-local, so the resolver the launcher installs does not* reach a child that Node starts directly. This registers the same resolution environment@@ -11,11 +11,9 @@*/import { resolve } from "node:path";-// `bin/hypit.mjs` publishes this for every process it starts; the fallback mirrors-// `packages/video-cli/src/distribution.ts` for callers that import a Distribution directly.-const distributionRoot = resolve(- process.env.HYPIT_DISTRIBUTION_ROOT ?? resolve(import.meta.dirname, "../../.."),-);+// This preload belongs to the Provider the parent actually loaded. Inherited shell+// hints must not redirect its dependencies to a different Hypit installation.+const distributionRoot = resolve(import.meta.dirname, "../../..");const { installDistributionPackageResolution, installExternalPackageResolution } =await import("../../package-loader-node/src/distribution-resolution.js");diff --git a/packages/provider-hyperframes-local/src/capture-exit.ts b/packages/provider-hyperframes-local/src/capture-exit.tsnew file mode 100644index 00000000..150bcc56--- /dev/null+++ b/packages/provider-hyperframes-local/src/capture-exit.ts@@ -0,0 +1,24 @@+import { writeSync } from "node:fs";+import { killRenderDescendantsSync } from "./process-tree.js";++// Installed before loading the engine: process.exit and uncaught exceptions can+// bypass async finally blocks, including during engine import/browser launch.+// Keep cleanup inside the still-live owner, not a history of browser PIDs.+const cleanup = () => {+ try { killRenderDescendantsSync(process.pid); }+ catch (error) {+ writeSync(2, `Render exit cleanup could not be confirmed: ${String(error)}\n`);+ }+};+const terminate = () => process.exit(143);+const interrupt = () => process.exit(130);+process.once("exit", cleanup);+process.once("SIGTERM", terminate);+process.once("SIGINT", interrupt);++/** Call only after capture has closed every resource successfully. */+export function releaseCaptureExitCleanup(): void {+ process.off("exit", cleanup);+ process.off("SIGTERM", terminate);+ process.off("SIGINT", interrupt);+}diff --git a/packages/provider-hyperframes-local/src/capture-process.ts b/packages/provider-hyperframes-local/src/capture-process.tsindex e7d6f3b6..b2bf6655 100644--- a/packages/provider-hyperframes-local/src/capture-process.ts+++ b/packages/provider-hyperframes-local/src/capture-process.ts@@ -1,58 +1,12 @@import type { ExecutionDiagnostic } from "@hypit/runtime";-import { execFile, spawn } from "node:child_process";-import { promisify } from "node:util";+import { spawn } from "node:child_process";import { fileURLToPath } from "node:url";-import { setTimeout as delay } from "node:timers/promises";+import { killRenderTree } from "./process-tree.js";import type { CaptureInput } from "./capture.js";import type { HyperframesRenderProgress } from "./render.js";-const exec = promisify(execFile);const cleanupMs = 5_000;-/** Chrome starts its own process group, so stopping only the Node child is insufficient. */-async function killRenderTree(pid: number): Promise<void> {- if (process.platform === "win32") {- try {- await exec("taskkill", ["/PID", String(pid), "/T", "/F"], { windowsHide: true, timeout: cleanupMs });- } catch (error) {- // The worker may exit after reporting completion, before taskkill opens it.- // Ask the OS whether it is gone; localized taskkill output is not an API.- try { process.kill(pid, 0); }- catch (probeError) {- if ((probeError as NodeJS.ErrnoException).code === "ESRCH") return;- }- throw error;- }- return;- }- const descendants = [pid];- for (let i = 0; i < descendants.length; i++) {- const children = await exec("pgrep", ["-P", String(descendants[i])], { timeout: cleanupMs })- .then(({ stdout }) => stdout.trim().split(/\s+/u).filter(Boolean).map(Number),- (error) => { if ((error as { code?: unknown }).code === 1) return []; throw error; });- for (const child of children) if (!descendants.includes(child)) descendants.push(child);- }- // Kill the whole tree before waiting: only after every ancestor is dead are- // orphaned descendants reparented and reaped, making kill(pid, 0) read ESRCH.- for (const child of descendants.reverse()) {- for (const target of [-child, child]) {- try { process.kill(target, "SIGKILL"); }- catch (error) { if ((error as NodeJS.ErrnoException).code !== "ESRCH") throw error; }- }- }- const deadline = Date.now() + cleanupMs;- let remaining = descendants;- while (remaining.length > 0) {- remaining = remaining.filter((child) => {- try { process.kill(child, 0); return true; }- catch (error) { if ((error as NodeJS.ErrnoException).code === "ESRCH") return false; throw error; }- });- if (remaining.length === 0) break;- if (Date.now() >= deadline) throw new Error(`Render process ${remaining[0]} did not stop after SIGKILL`);- await delay(20);- }-}-/** One disposable execution, with no persisted state or resubmission behavior. */export async function runCaptureProcess(input: CaptureInput,@@ -68,6 +22,7 @@ export async function runCaptureProcess(const child = spawn(process.execPath, ["--import", import.meta.resolve("tsx"),"--import", new URL("./capture-bootstrap.ts", import.meta.url).href,+ "--import", new URL("./capture-exit.ts", import.meta.url).href,fileURLToPath(entry),], {detached: process.platform !== "win32", windowsHide: true,@@ -76,6 +31,7 @@ export async function runCaptureProcess(let failure: Error | undefined;let completed = false;let closed = false;+ let exited = false;let outputBytes = 0;let stderr = "";let diagnostics = Promise.resolve();@@ -83,6 +39,14 @@ export async function runCaptureProcess(let killing: Promise<void> | undefined;const kill = () => {if (grace !== undefined) clearTimeout(grace);+ grace = undefined;+ // A PID is no longer ours after exit. Inherited pipes can outlive it, but+ // looking up that old PID cannot recover the former process tree safely.+ if (exited) {+ child.stdout?.destroy();+ child.stderr?.destroy();+ return Promise.resolve();+ }killing ??= (child.pid === undefined ? Promise.resolve() : killRenderTree(child.pid)).catch((error) => {if (!completed) failure = new Error(`${failure?.message ?? "Render cleanup failed"}; ${String(error)}`);diagnostic({ level: "warning", message: `Render process-tree cleanup could not be confirmed: ${String(error)}` });@@ -103,7 +67,9 @@ export async function runCaptureProcess(};const awaitExit = () => {grace ??= setTimeout(() => {- diagnostic({ level: "warning", message: `Render process did not exit within ${cleanupMs} ms; terminating its remaining process tree` });+ diagnostic({ level: "warning", message: exited+ ? `Render process exited but its output pipes did not close within ${cleanupMs} ms; closing this execution's pipes`+ : `Render process did not exit within ${cleanupMs} ms; terminating its remaining process tree` });void kill();}, cleanupMs);};@@ -140,14 +106,25 @@ export async function runCaptureProcess(}});child.on("error", (error) => { failure ??= error; void kill(); });- child.on("close", () => {+ child.once("exit", (code, exitSignal) => {+ exited = true;+ if (!completed && failure === undefined) {+ failure = new Error(`HyperFrames process exited before completion (${exitSignal ?? `code ${String(code)}`})`);+ }+ if (exitSignal !== null && killing === undefined) {+ diagnostic({ level: "warning", message: `Render process was terminated by ${exitSignal}; descendant cleanup could not be confirmed` });+ }+ // An abruptly orphaned descendant may still hold stdout/stderr open.+ awaitExit();+ });+ child.on("close", (code, exitSignal) => {closed = true;if (grace !== undefined) clearTimeout(grace);signal.removeEventListener("abort", abort);void (killing ?? Promise.resolve()).then(async () => {await diagnostics;- if (failure !== undefined) reject(failure);- else if (!completed) reject(new Error(`HyperFrames process exited before completion: ${stderr}`));+ if (failure !== undefined) reject(new Error(`${failure.message}${stderr ? `\n${stderr}` : ""}`, { cause: failure }));+ else if (!completed) reject(new Error(`HyperFrames process exited before completion (${exitSignal ?? `code ${String(code)}`}): ${stderr}`));else resolve();});});diff --git a/packages/provider-hyperframes-local/src/capture-worker.ts b/packages/provider-hyperframes-local/src/capture-worker.tsindex 23c467e7..d1d52daf 100644--- a/packages/provider-hyperframes-local/src/capture-worker.ts+++ b/packages/provider-hyperframes-local/src/capture-worker.ts@@ -1,3 +1,4 @@+import { releaseCaptureExitCleanup } from "./capture-exit.js";import { captureStagedVisual } from "./capture.js";import type { CaptureInput } from "./capture.js";@@ -13,6 +14,7 @@ const finish = (value: { type: "completed" } | { type: "failed"; error: string }if (value.type === "failed") { report(value); return; }// Successful capture has closed its resources. Flush the result before closing our IPC handle;// our own disconnect is not a cancellation by the owner.+ releaseCaptureExitCleanup();process.off("disconnect", disconnected);process.off("message", receive);if (!process.connected) return;diff --git a/packages/provider-hyperframes-local/src/capture.ts b/packages/provider-hyperframes-local/src/capture.tsindex 95ccc353..c499f2b0 100644--- a/packages/provider-hyperframes-local/src/capture.ts+++ b/packages/provider-hyperframes-local/src/capture.ts@@ -3,7 +3,7 @@ import { join, relative, resolve, sep } from "node:path";import type { HyperframesDocument } from "@hypit/hyperframes";import type { MediaFrameRange } from "@hypit/media";import type { HyperframesRenderProgress, resolveExecutionOptions } from "./render.js";-import { assert, runProcess } from "./process.js";+import { assert, mediaExecutablePath, runProcess } from "./process.js";import { verifyOutput } from "./output.js";import { distributeFrameRange, sourceFrameAt, sourceWindows, videoSlots } from "./sampling.js";import { renderWorkerLimit } from "./render.js";@@ -13,7 +13,7 @@ import { createOpaqueFrameCapture } from "./opaque-capture.js";export type CaptureInput = {readonly document: HyperframesDocument;readonly range: MediaFrameRange;- readonly config: ReturnType<typeof resolveExecutionOptions>;+ readonly config: ReturnType<typeof resolveExecutionOptions> & { readonly chromePath: string };readonly directory: string;readonly engineModule: string;readonly producerModule: string;@@ -36,6 +36,13 @@ export async function captureStagedVisual(input: CaptureInput, controller: Abortconst started = performance.now();const elapsedMs = () => Math.round(performance.now() - started);const engine = await import(input.engineModule) as typeof import("@hyperframes/engine");+ const [ffmpegPath, ffprobePath] = await Promise.all([+ mediaExecutablePath(config.ffmpegPath), mediaExecutablePath(config.ffprobePath),+ ]);+ // This is one disposable render process. Use the engine's public override+ // ports here without changing the Runtime owner's environment or other renders.+ process.env[engine.FFMPEG_PATH_ENV] = ffmpegPath;+ process.env[engine.FFPROBE_PATH_ENV] = ffprobePath;const { createFileServer } = await import(input.producerModule) as typeof import("@hyperframes/producer");type Session = Awaited<ReturnType<typeof engine.createCaptureSession>>;const sessions = new Set<Session>();@@ -158,7 +165,7 @@ export async function captureStagedVisual(input: CaptureInput, controller: Abortconst source = sources.get(slot.src);return source === undefined ? [] : [{ id: slot.id, width: source.width, height: source.height }];}),- }, injector, { browserGpuMode: config.browserGpu, enableBrowserPool: false, forceScreenshot: true, useDrawElement: false });+ }, injector, { chromePath: config.chromePath, browserGpuMode: config.browserGpu, enableBrowserPool: false, forceScreenshot: true, useDrawElement: false });sessions.add(session);signal.throwIfAborted();const activeSession = session;@@ -235,14 +242,14 @@ export async function captureStagedVisual(input: CaptureInput, controller: Abortconst output = join(work, "visual.mp4");onProgress({ phase: "encoding", elapsedMs: elapsedMs() });const crf = { draft: 28, standard: 23, high: 18 }[config.quality];- await runProcess({ executable: config.ffmpegPath,+ await runProcess({ executable: ffmpegPath,argv: ["-v", "error", "-y", "-framerate", `${fps.num}/${fps.den}`, "-i", join(outputFrames, "%09d.png"),"-frames:v", String(frameCount), "-an", "-c:v", "libx264", "-crf", String(crf),"-preset", config.quality === "draft" ? "veryfast" : "medium", "-pix_fmt", "yuv420p", "-movflags", "+faststart", output],timeoutMs: config.processTimeoutMs, maxOutputBytes: config.maxProcessOutputBytes, signal });const outputStat = await stat(output);assert(outputStat.size > 0 && outputStat.size <= config.maxRenderedBytes, "HyperFrames output is empty or exceeds its byte limit");- await verifyOutput({ path: output, document: { ...document, frameCount }, ffprobePath: config.ffprobePath,+ await verifyOutput({ path: output, document: { ...document, frameCount }, ffprobePath,timeoutMs: config.processTimeoutMs, maxOutputBytes: config.maxProcessOutputBytes, signal });signal.throwIfAborted();return output;diff --git a/packages/provider-hyperframes-local/src/opaque-capture.ts b/packages/provider-hyperframes-local/src/opaque-capture.tsindex f8e9dfb0..bf18f55f 100644--- a/packages/provider-hyperframes-local/src/opaque-capture.ts+++ b/packages/provider-hyperframes-local/src/opaque-capture.ts@@ -22,33 +22,61 @@ export async function createOpaqueFrameCapture(session: CaptureSession) {const cdp = await getCdpSession(page);// MP4 has no alpha channel. The authored Canvas paints over this final matte.await cdp.send("Emulation.setDefaultBackgroundColorOverride", { color: { r: 0, g: 0, b: 0, a: 1 } });- // These decoded image handles belong to this page, just like its DOM. Retain- // only URLs used by inline background images; changing a style can need a load- // even after initializeSession has finished its initial resource readiness.+ // Image readiness belongs to this page. A seek can select a new image through+ // attributes, a CSS class or a pseudo-element after initial page readiness.await page.evaluate(() => {const decoded = new Map<string, Promise<void>>();+ const images = {+ load(url: string): Promise<void> {+ let ready = decoded.get(url);+ if (ready === undefined) {+ const image = new Image();+ image.src = url;+ ready = image.decode().catch(error => {+ throw new Error(`HyperFrames image could not be decoded: ${url}`, { cause: error });+ });+ decoded.set(url, ready);+ }+ return ready;+ },+ background(value: string, pending: Promise<unknown>[]) {+ for (const match of value.matchAll(/url\(\s*(?:"((?:\\.|[^"])*)"|'((?:\\.|[^'])*)'|([^)]*))\s*\)/gu)) {+ const url = (match[1] ?? match[2] ?? match[3] ?? "").trim();+ if (url) pending.push(this.load(url));+ }+ },+ style(style: CSSStyleDeclaration, pending: Promise<unknown>[]) {+ for (const value of [style.backgroundImage, style.maskImage, style.borderImageSource, style.listStyleImage, style.content]) {+ this.background(value, pending);+ }+ },+ };(window as unknown as { __hypitPrepareImages: () => Promise<void> }).__hypitPrepareImages = async () => {const pending: Promise<unknown>[] = [];- if (document.fonts.status === "loading") pending.push(document.fonts.ready);for (const image of Array.from(document.images)) {- if (!image.complete) pending.push(image.decode());+ if ((image.currentSrc || image.getAttribute("src") || image.getAttribute("srcset"))+ && (!image.complete || image.naturalWidth === 0)) {+ pending.push(image.decode().catch(error => {+ throw new Error(`HyperFrames image could not be decoded: ${image.currentSrc || image.src}`, { cause: error });+ }));+ }}- for (const element of Array.from(document.querySelectorAll<HTMLElement>('[style*="background"]'))) {- const background = element.style.backgroundImage;- for (const match of background.matchAll(/url\(\s*(?:"((?:\\.|[^"])*)"|'((?:\\.|[^'])*)'|([^)]*))\s*\)/gu)) {- const url = (match[1] ?? match[2] ?? match[3] ?? "").trim();- if (!url) continue;- let ready = decoded.get(url);- if (ready === undefined) {- const image = new Image();- image.src = url;- ready = image.decode();- decoded.set(url, ready);- }- pending.push(ready);+ for (const element of Array.from(document.querySelectorAll("*"))) {+ images.style(getComputedStyle(element), pending);+ for (const pseudo of ["::before", "::after"]) {+ const style = getComputedStyle(element, pseudo);+ if (style.content !== "none" && style.content !== "normal") images.style(style, pending);}}+ for (const image of Array.from(document.querySelectorAll("svg image"))) {+ const href = image.getAttribute("href") ?? image.getAttributeNS("http://www.w3.org/1999/xlink", "href");+ if (href) pending.push(images.load(new URL(href, document.baseURI).href));+ }await Promise.all(pending);+ await document.fonts.ready;+ document.fonts.forEach(font => {+ if (font.status === "error") throw new Error(`HyperFrames font could not be loaded: ${font.family}`);+ });};});return async (frame: number) => {diff --git a/packages/provider-hyperframes-local/src/options.ts b/packages/provider-hyperframes-local/src/options.tsindex ef535cf9..feca96f5 100644--- a/packages/provider-hyperframes-local/src/options.ts+++ b/packages/provider-hyperframes-local/src/options.ts@@ -2,9 +2,9 @@ export type HyperframesWorkers = number | "auto";export type HyperframesQuality = "draft" | "standard" | "high";export type HyperframesBrowserGpu = "auto" | "software" | "hardware";-export type HyperframesExecutionOptions = {+export type HyperframesExecutionOptions = import("./browser.js").BrowserOptions & {readonly ffprobePath?: string;- /** Final H.264 encoder. Source extraction uses the pinned engine's binary resolver. */+ /** Selected FFmpeg command for both source extraction and final H.264 encoding. */readonly ffmpegPath?: string;/** Parallel Chrome workers inside one render. This is separate from Provider request concurrency. */readonly workers?: HyperframesWorkers;diff --git a/packages/provider-hyperframes-local/src/process-tree.ts b/packages/provider-hyperframes-local/src/process-tree.tsnew file mode 100644index 00000000..086f59bf--- /dev/null+++ b/packages/provider-hyperframes-local/src/process-tree.ts@@ -0,0 +1,82 @@+import { execFile, execFileSync } from "node:child_process";+import { promisify } from "node:util";+import { setTimeout as delay } from "node:timers/promises";++const exec = promisify(execFile);+const cleanupMs = 5_000;++/** Chrome starts its own process group, so stopping only the Node child is insufficient. */+export async function killRenderTree(pid: number): Promise<void> {+ if (process.platform === "win32") {+ try {+ await exec("taskkill", ["/PID", String(pid), "/T", "/F"], { windowsHide: true, timeout: cleanupMs });+ } catch (error) {+ // The worker may exit after reporting completion, before taskkill opens it.+ // Ask the OS whether it is gone; localized taskkill output is not an API.+ try { process.kill(pid, 0); }+ catch (probeError) {+ if ((probeError as NodeJS.ErrnoException).code === "ESRCH") return;+ }+ throw error;+ }+ return;+ }+ const descendants = [pid];+ for (let i = 0; i < descendants.length; i++) {+ const children = await exec("pgrep", ["-P", String(descendants[i])], { timeout: cleanupMs })+ .then(({ stdout }) => stdout.trim().split(/\s+/u).filter(Boolean).map(Number),+ (error) => { if ((error as { code?: unknown }).code === 1) return []; throw error; });+ for (const child of children) if (!descendants.includes(child)) descendants.push(child);+ }+ // Kill the whole tree before waiting: only after every ancestor is dead are+ // orphaned descendants reparented and reaped, making kill(pid, 0) read ESRCH.+ for (const child of descendants.reverse()) {+ for (const target of [-child, child]) {+ try { process.kill(target, "SIGKILL"); }+ catch (error) { if ((error as NodeJS.ErrnoException).code !== "ESRCH") throw error; }+ }+ }+ const deadline = Date.now() + cleanupMs;+ let remaining = descendants;+ while (remaining.length > 0) {+ remaining = remaining.filter((child) => {+ try { process.kill(child, 0); return true; }+ catch (error) { if ((error as NodeJS.ErrnoException).code === "ESRCH") return false; throw error; }+ });+ if (remaining.length === 0) break;+ if (Date.now() >= deadline) throw new Error(`Render process ${remaining[0]} did not stop after SIGKILL`);+ await delay(20);+ }+}++/** Exit callbacks cannot await: stop live descendants before the owner is reparented. */+export function killRenderDescendantsSync(pid: number): void {+ if (process.platform === "win32") {+ // taskkill owns the traversal, including this exiting process, on Windows.+ execFileSync("taskkill", ["/PID", String(pid), "/T", "/F"], {+ windowsHide: true, timeout: cleanupMs, stdio: "pipe",+ });+ return;+ }+ const descendants = [pid];+ for (let i = 0; i < descendants.length; i++) {+ let output: string;+ try {+ output = execFileSync("pgrep", ["-P", String(descendants[i])], {+ encoding: "utf8", timeout: cleanupMs, stdio: ["ignore", "pipe", "pipe"],+ });+ } catch (error) {+ if ((error as { status?: unknown }).status === 1) continue;+ throw error;+ }+ for (const child of output.trim().split(/\s+/u).filter(Boolean).map(Number)) {+ if (!descendants.includes(child)) descendants.push(child);+ }+ }+ for (const child of descendants.slice(1).reverse()) {+ for (const target of [-child, child]) {+ try { process.kill(target, "SIGKILL"); }+ catch (error) { if ((error as NodeJS.ErrnoException).code !== "ESRCH") throw error; }+ }+ }+}diff --git a/packages/provider-hyperframes-local/src/process.ts b/packages/provider-hyperframes-local/src/process.tsindex 35ad9192..5a8cf471 100644--- a/packages/provider-hyperframes-local/src/process.ts+++ b/packages/provider-hyperframes-local/src/process.ts@@ -1,4 +1,7 @@import { spawn } from "node:child_process";+import { access, stat } from "node:fs/promises";+import { constants } from "node:fs";+import { delimiter, isAbsolute, resolve } from "node:path";type ProcessResult = {readonly stdout: Uint8Array;@@ -13,6 +16,25 @@ export function positiveInteger(value: number, subject: string): number {return value;}+/** The engine's binary override requires a path; resolve our selected command without its fallback search. */+export async function mediaExecutablePath(value: string): Promise<string> {+ const pathLike = isAbsolute(value) || value.includes("/") || value.includes("\\");+ const bases = pathLike ? [resolve(value)]+ : (process.env.PATH ?? "").split(delimiter).filter(Boolean).map(directory => resolve(directory, value));+ const extensions = process.platform === "win32" && !/\.[^\\/]+$/u.test(value) ? [".exe", ".com", ""] : [""];+ for (const base of bases) for (const extension of extensions) {+ const candidate = `${base}${extension}`;+ try {+ if (!(await stat(candidate)).isFile()) continue;+ await access(candidate, process.platform === "win32" ? constants.F_OK : constants.X_OK);+ return candidate;+ } catch (error) {+ if (!["ENOENT", "ENOTDIR", "EACCES"].includes((error as NodeJS.ErrnoException).code ?? "")) throw error;+ }+ }+ throw new Error(`HyperFrames media executable ${value} is unavailable; correct the Provider's ffmpegPath or ffprobePath.`);+}+function processEnvironment(): NodeJS.ProcessEnv {const names = ["PATH", "HOME", "TMPDIR", "LANG", "LC_ALL"] as const;return Object.fromEntries(names.flatMap((name) => process.env[name] === undefineddiff --git a/packages/provider-hyperframes-local/src/program.ts b/packages/provider-hyperframes-local/src/program.tsindex fd521053..d95725ff 100644--- a/packages/provider-hyperframes-local/src/program.ts+++ b/packages/provider-hyperframes-local/src/program.ts@@ -1,54 +1,46 @@-import { execFile } from "node:child_process";+import { fileURLToPath } from "node:url";+import { join } from "node:path";import { probeMediaToolchain } from "@hypit/media-execution";import type { ManagedProgram, ManagedProgramState } from "@hypit/runtime-kit";--function run(executable: string, args: readonly string[]): Promise<{ ok: boolean; output: string }> {- return new Promise((resolve) => {- execFile(executable, [...args], { timeout: 15_000, shell: false, windowsHide: true }, (error, stdout, stderr) => {- resolve(error === null- ? { ok: true, output: stdout.trim() }- : { ok: false, output: (stderr.trim() || error.message).split("\n").at(-1) ?? "" });- });- });-}+import { browserCacheDirectory, browserDownloadBaseUrl, browserDownloadUrl, browserExecutablePath, configuredBrowserPath, requireBrowserExecutable, selectedBrowserVersion } from "./browser.js";+import type { BrowserOptions } from "./browser.js";/**- * HyperFrames owns the browser cache behind its CLI. It is deployment state,- * not an author dependency, so the Endpoint lifecycle prepares it only- * when this Provider is selected.+ * This Provider owns browser selection and preparation. Probes never install;+ * rendering receives the same selected executable instead of invoking engine discovery.*/export function localHyperframesBrowserProgram(- input: {+ input: BrowserOptions & {readonly id: string;readonly nodePath: string;- readonly hyperframesCliPath: string | (() => string);readonly ffprobePath: string;readonly ffmpegPath?: string;},): ManagedProgram {- const cliPath = () => typeof input.hyperframesCliPath === "string" ? input.hyperframesCliPath : input.hyperframesCliPath();+ const version = selectedBrowserVersion(input);+ const selectedPath = browserExecutablePath(input);+ const baseUrl = browserDownloadBaseUrl(input);const probeBrowser = async (): Promise<ManagedProgramState> => {- let executable: string;- try { executable = cliPath(); } catch (error) { return { state: "down", detail: error instanceof Error ? error.message : String(error) }; }- const located = await run(input.nodePath, [executable, "browser", "path"]);- if (!located.ok) return { state: "down", detail: `HyperFrames browser is unavailable: ${located.output}` };- const path = located.output.trim();- if (path.length === 0 || path.includes("\n") || path.includes("\r")) {- return { state: "mismatch", detail: "HyperFrames returned an invalid browser path" };- }- const version = await run(path, ["--version"]);- if (!version.ok || version.output.length === 0) {- return { state: "mismatch", detail: `HyperFrames browser cannot start: ${version.output}` };- }+ try { await requireBrowserExecutable(selectedPath, version); }+ catch (error) { return { state: "down", detail: error instanceof Error ? error.message : String(error) }; }return { state: "ready" };};return {id: input.id,- installation: {- probe: probeBrowser,- get commands() { return [{ command: input.nodePath, args: [cliPath(), "browser", "ensure"] }]; },- },+ ...(configuredBrowserPath(input) === undefined ? {+ // Projects sharing this installation also share the existing Program lifecycle lock/logs.+ stateRoot: join(browserCacheDirectory(input), ".hypit-render-program"),+ installation: {+ probe: probeBrowser,+ commands: [{ label: `Install Chrome Headless Shell ${version} at ${selectedPath} from ${browserDownloadUrl(input)}`, command: input.nodePath, args: [+ "--import", import.meta.resolve("tsx"),+ "--import", new URL("./capture-bootstrap.ts", import.meta.url).href,+ fileURLToPath(new URL("./browser-install.ts", import.meta.url)), browserCacheDirectory(input), version!,+ ...(baseUrl === undefined ? [] : [baseUrl]),+ ] }],+ },+ } : {}),async probe(): Promise<ManagedProgramState> {const browser = await probeBrowser();if (browser.state !== "ready") return browser;diff --git a/packages/provider-hyperframes-local/src/provider.ts b/packages/provider-hyperframes-local/src/provider.tsindex fcfa1ba4..0f76b0bf 100644--- a/packages/provider-hyperframes-local/src/provider.ts+++ b/packages/provider-hyperframes-local/src/provider.ts@@ -2,7 +2,6 @@ import { defineEndpointPackage } from "@hypit/endpoint-kit";import { mediaTypes } from "@hypit/media";import { renderHyperframesCapabilities, verifyHyperframesVisualRequest } from "@hypit/render-hyperframes";import { canonicalize } from "@hypit/protocol";-import { resolveNodePackageExecutable } from "@hypit/package-loader-node";import { renderHyperframesVisual, resolveExecutionOptions, renderWorkerLimit } from "./render.js";import type { HyperframesExecutionOptions } from "./options.js";import { renderProgressReporter } from "./progress.js";@@ -14,17 +13,12 @@ export type CreateLocalHyperframesProviderOptions = HyperframesExecutionOptionsreadonly pool?: string;/** Used by managed browser installation, not frame capture. */readonly nodePath?: string;- readonly hyperframesCliPath?: string;/** Whole render requests admitted concurrently; independent of frame workers. */readonly defaultConcurrency?: number;/** Shared Chrome slots across Need executions using this pool. */readonly browserCapacity?: number;};-export function defaultHyperframesCliPath(): string {- return resolveNodePackageExecutable("hyperframes", "hyperframes", { from: import.meta.url });-}-export function createLocalHyperframesProvider(config: CreateLocalHyperframesProviderOptions) {const execution = resolveExecutionOptions(config);const pool = config.pool ?? config.instance ?? "hyperframes.local";@@ -62,7 +56,10 @@ export function createLocalHyperframesProvider(config: CreateLocalHyperframesPro: request.range.endFrameExclusive - request.range.startFrame;const progress = renderProgressReporter(context.reportProgress, frameCount);try {- const visual = await renderHyperframesVisual(request, { ...config, workers: execution.workers, maxWorkers,+ const visual = await renderHyperframesVisual(request, { ...config,+ ...(execution.chromePath === undefined ? { browserVersion: execution.browserVersion! } : { chromePath: execution.chromePath }),+ browserCacheDirectory: execution.browserCacheDirectory,+ workers: execution.workers, maxWorkers,resources: context.resources, onProgress: progress.onProgress,...(context.reportDiagnostic === undefined ? {} : { onDiagnostic: context.reportDiagnostic }) });return { value: { kind: "inline", value: canonicalize(visual) } };diff --git a/packages/provider-hyperframes-local/src/render.ts b/packages/provider-hyperframes-local/src/render.tsindex 7883a5cb..06e8ffec 100644--- a/packages/provider-hyperframes-local/src/render.ts+++ b/packages/provider-hyperframes-local/src/render.ts@@ -6,7 +6,7 @@ import type { EndpointInvocationContext } from "@hypit/endpoint-kit";import { stageHyperframesProject } from "@hypit/hyperframes/project";import { sealRenderedVisual } from "@hypit/media";import type { MediaFrameRange, RenderedVisual } from "@hypit/media";-import { verifyCompositableSurfaceBytes } from "@hypit/media-execution";+import { verifyCompositableSurfaceFile } from "@hypit/media-execution";import { verifyHyperframesVisualRequest } from "@hypit/render-hyperframes";import type { HyperframesVisualRequest } from "@hypit/render-hyperframes";import { isStreamingResourceStore } from "@hypit/runtime";@@ -15,6 +15,7 @@ import { assert, positiveInteger } from "./process.js";import { runCaptureProcess } from "./capture-process.js";import { finished } from "node:stream/promises";import { autoWorkerLimit } from "./concurrency.js";+import { browserCacheDirectory, browserExecutablePath, configuredBrowserPath, requireBrowserExecutable, selectedBrowserVersion } from "./browser.js";export type HyperframesRenderProgress =| { readonly phase: "staging" | "encoding" | "storing"; readonly elapsedMs: number }@@ -43,6 +44,9 @@ export function resolveExecutionOptions(options: HyperframesExecutionOptions) {const browserGpu = options.browserGpu ?? "hardware";assert(["auto", "software", "hardware"].includes(browserGpu), "HyperFrames browserGpu is invalid");return {+ chromePath: configuredBrowserPath(options),+ browserVersion: selectedBrowserVersion(options),+ browserCacheDirectory: browserCacheDirectory(options),workers,maxWorkers: workers === "auto" ? positiveInteger(options.maxWorkers ?? autoWorkerLimit(), "maxWorkers") : workers,quality, browserGpu,@@ -71,7 +75,7 @@ export async function renderHyperframesVisual(options: RenderHyperframesVisualOptions,): Promise<RenderedVisual> {verifyHyperframesVisualRequest(request);- const config = resolveExecutionOptions(options);+ const config = { ...resolveExecutionOptions(options), chromePath: browserExecutablePath(options) };const { document } = request;const range = request.range ?? { startFrame: 0, endFrameExclusive: document.frameCount };const frameCount = range.endFrameExclusive - range.startFrame;@@ -97,8 +101,9 @@ export async function renderHyperframesVisual(};try {signal.throwIfAborted();+ await requireBrowserExecutable(config.chromePath, config.browserVersion);await options.onDiagnostic?.({ level: "info", message:- `Render ${frameCount} frames; workers ${config.workers} (limit ${renderWorkerLimit(config, frameCount, document.frameRate.numerator / document.frameRate.denominator)}); opaque fast PNG; quality ${config.quality}; GPU ${config.browserGpu}; encoder ${config.ffmpegPath}` });+ `Render ${frameCount} frames; workers ${config.workers} (limit ${renderWorkerLimit(config, frameCount, document.frameRate.numerator / document.frameRate.denominator)}); opaque fast PNG; quality ${config.quality}; GPU ${config.browserGpu}; browser ${config.chromePath}; encoder ${config.ffmpegPath}` });options.onProgress?.({ phase: "staging", elapsedMs: 0 });work = await mkdtemp(join(tmpdir(), "hypit-hyperframes-local-"));await stageHyperframesProject({ document, directory: work, signal,@@ -109,7 +114,7 @@ export async function renderHyperframesVisual(assert(bytes !== undefined, `HyperFrames Artifact ${artifact.resource} is unavailable`);return bytes;},- validateSurface: (surface, bytes, probeSignal) => verifyCompositableSurfaceBytes({ surface, bytes,+ validateSurface: (surface, path, probeSignal) => verifyCompositableSurfaceFile({ surface, path,ffprobePath: config.ffprobePath, processTimeoutMs: config.processTimeoutMs,maxProbeOutputBytes: config.maxProcessOutputBytes, signal: probeSignal! }),});diff --git a/packages/provider-hyperframes-local/test/browser-download.test.ts b/packages/provider-hyperframes-local/test/browser-download.test.tsnew file mode 100644index 00000000..8fce201e--- /dev/null+++ b/packages/provider-hyperframes-local/test/browser-download.test.ts@@ -0,0 +1,108 @@+import test from "node:test";+import assert from "node:assert/strict";+import http from "node:http";+import https from "node:https";+import { syncBuiltinESMExports } from "node:module";+import { execFile, spawnSync } from "node:child_process";+import { promisify } from "node:util";+import { chmod, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";+import { tmpdir } from "node:os";+import { dirname, join, relative } from "node:path";+import { canonicalize } from "@hypit/protocol";+import type { RuntimeEndpointAdapterImplementation } from "@hypit/runtime-kit";+import { hypitPackage } from "../src/activation.js";+import { browserDownloadBaseUrl, browserDownloadUrl, browserExecutablePath, installRenderBrowser, recommendedBrowserVersion, requireBrowserExecutable } from "../src/browser.js";++test("download source accepts an archive base and rejects ignored or malformed configuration", () => {+ assert.equal(browserDownloadBaseUrl({ browserDownloadBaseUrl: "https://mirror.example/chrome///" }), "https://mirror.example/chrome");+ for (const value of ["", "mirror.example", "file:///tmp/browser", "https://mirror.example/?token=1", "https://mirror.example/#archive", "https://user:[email protected]"]) {+ assert.throws(() => browserExecutablePath({ browserDownloadBaseUrl: value }), /browserDownloadBaseUrl/u);+ }+ assert.throws(() => browserExecutablePath({ chromePath: process.execPath, browserDownloadBaseUrl: "https://mirror.example" }), /mutually exclusive/u);+ assert.equal(browserExecutablePath({ browserDownloadBaseUrl: "https://mirror.example" }), browserExecutablePath({}), "source changes must not change the selected executable");+});++test("Profile mirror reaches the real preparation command and installs its archive", {+ skip: process.platform === "win32" || spawnSync("zip", ["-v"], { stdio: "ignore" }).status !== 0,+}, async (t) => {+ const directory = await mkdtemp(join(tmpdir(), "hypit-browser-mirror-"));+ t.after(() => rm(directory, { recursive: true, force: true }));+ const cacheDir = join(directory, "cache");+ const path = browserExecutablePath({ browserCacheDirectory: cacheDir });+ const archiveRoot = dirname(dirname(path));+ const fixtureRoot = join(directory, "fixture");+ const entry = relative(archiveRoot, path);+ await mkdir(dirname(join(fixtureRoot, entry)), { recursive: true });+ // A protocol fixture exercises transfer, unpacking and executable/version inspection, not rendering.+ await writeFile(join(fixtureRoot, entry), `#!${process.execPath}\nconsole.log('Chrome Headless Shell ${recommendedBrowserVersion}');\n`);+ await chmod(join(fixtureRoot, entry), 0o755);+ const archive = join(directory, "browser.zip");+ await promisify(execFile)("zip", ["-q", "-r", archive, "."], { cwd: fixtureRoot });+ const bytes = await readFile(archive);+ const requests: string[] = [];+ const server = http.createServer((request, response) => {+ requests.push(request.url!);+ response.writeHead(200, { "Content-Length": bytes.length });+ response.end(bytes);+ });+ await new Promise<void>(resolve => server.listen(0, "127.0.0.1", resolve));+ t.after(() => new Promise<void>((resolve, reject) => server.close(error => error ? reject(error) : resolve())));+ const address = server.address() as import("node:net").AddressInfo;+ const baseUrl = `http://127.0.0.1:${address.port}/chrome`;+ const adapter = hypitPackage.hostFacets[0]!.implementation as RuntimeEndpointAdapterImplementation;+ const activation = await adapter.activate({+ hostStateRoot: directory, dataRoot: directory, instance: "render", pool: "machine",+ config: canonicalize({ browserCacheDirectory: "cache", browserDownloadBaseUrl: `${baseUrl}/` }),+ });+ const program = activation.program!;+ const command = program.installation!.commands[0]!;+ assert.equal(command.args.at(-1), baseUrl);+ assert.ok(command.label!.includes(browserDownloadUrl({ browserDownloadBaseUrl: baseUrl })));+ assert.equal((await program.probe()).state, "down");+ assert.deepEqual(requests, [], "doctor must not contact the mirror");+ const result = await promisify(execFile)(command.command, [...command.args], { timeout: 30_000 });+ assert.ok(result.stdout.includes(`Download source: ${browserDownloadUrl({ browserDownloadBaseUrl: baseUrl })}`));+ await requireBrowserExecutable(path, recommendedBrowserVersion);+ assert.deepEqual(requests, [new URL(browserDownloadUrl({ browserDownloadBaseUrl: baseUrl })).pathname]);+ await promisify(execFile)(command.command, [...command.args], { timeout: 30_000 });+ assert.equal(requests.length, 1, "healthy installation is reused without a second download");+});++test("failed mirror download or unpack never requests the official source", async (t) => {+ const directory = await mkdtemp(join(tmpdir(), "hypit-browser-mirror-failure-"));+ t.after(() => rm(directory, { recursive: true, force: true }));+ let status = 503;+ const requests: string[] = [];+ const server = http.createServer((request, response) => {+ requests.push(request.url!);+ response.writeHead(status);+ response.end("not a browser archive");+ });+ await new Promise<void>(resolve => server.listen(0, "127.0.0.1", resolve));+ t.after(() => new Promise<void>((resolve, reject) => server.close(error => error ? reject(error) : resolve())));+ const address = server.address() as import("node:net").AddressInfo;+ const baseUrl = `http://127.0.0.1:${address.port}/chosen-mirror`;+ const unexpected: unknown[] = [];+ const originalHttpRequest = http.request;+ t.mock.method(http, "request", (...args: Parameters<typeof http.request>) => {+ const options = args[0] as import("node:http").RequestOptions;+ if (options.hostname !== "127.0.0.1" || Number(options.port) !== address.port) {+ unexpected.push(options);+ throw new Error("Unexpected download destination");+ }+ return Reflect.apply(originalHttpRequest, http, args);+ });+ t.mock.method(https, "request", (...args: unknown[]) => { unexpected.push(args[0]); throw new Error("Unexpected HTTPS download"); });+ syncBuiltinESMExports();+ t.after(() => { t.mock.restoreAll(); syncBuiltinESMExports(); });+ for (status of [503, 200]) {+ await assert.rejects(installRenderBrowser(join(directory, String(status)), recommendedBrowserVersion, baseUrl), error => {+ assert.ok(error instanceof Error);+ assert.ok(error.message.includes(baseUrl));+ assert.ok(error.message.includes(recommendedBrowserVersion));+ return true;+ });+ }+ assert.equal(requests.length, 2);+ assert.deepEqual(unexpected, [], "neither HTTP failure nor invalid archive may trigger another source");+});diff --git a/packages/provider-hyperframes-local/test/browser.test.ts b/packages/provider-hyperframes-local/test/browser.test.tsnew file mode 100644index 00000000..018f219e--- /dev/null+++ b/packages/provider-hyperframes-local/test/browser.test.ts@@ -0,0 +1,76 @@+import test from "node:test";+import assert from "node:assert/strict";+import { chmod, mkdir, mkdtemp, readFile, readdir, rm, writeFile } from "node:fs/promises";+import { tmpdir } from "node:os";+import { dirname, join } from "node:path";+import { browserExecutablePath, recommendedBrowserVersion } from "../src/browser.js";+import { localHyperframesBrowserProgram } from "../src/program.js";+import { resolveExecutionOptions } from "../src/render.js";++test("browser inspection is read-only and ignores unrelated installed browsers", async (t) => {+ const directory = await mkdtemp(join(tmpdir(), "hypit-browser-"));+ const saved = [process.env.HYPERFRAMES_BROWSER_PATH, process.env.PRODUCER_HEADLESS_SHELL_PATH];+ delete process.env.HYPERFRAMES_BROWSER_PATH;+ delete process.env.PRODUCER_HEADLESS_SHELL_PATH;+ t.after(async () => {+ for (const [index, key] of ["HYPERFRAMES_BROWSER_PATH", "PRODUCER_HEADLESS_SHELL_PATH"].entries()) {+ if (saved[index] === undefined) delete process.env[key]; else process.env[key] = saved[index];+ }+ await rm(directory, { recursive: true, force: true });+ });+ const options = { browserCacheDirectory: directory };+ const program = localHyperframesBrowserProgram({ ...options, id: "render", nodePath: process.execPath, ffprobePath: "ffprobe" });+ const state = await program.probe();+ assert.equal(state.state, "down");+ assert.ok(state.detail.includes(browserExecutablePath(options)));+ assert.match(state.detail, /runtime up/u);+ assert.deepEqual(await readdir(directory), [], "diagnosis must not prepare or download anything");+ const otherProject = localHyperframesBrowserProgram({ ...options, id: "other-render", nodePath: process.execPath, ffprobePath: "ffprobe" });+ assert.equal(otherProject.stateRoot, program.stateRoot, "shared browser installation uses the existing shared Program lifecycle");+ assert.equal(resolveExecutionOptions(options).browserCacheDirectory, directory);++ // Two different overrides previously selected different binaries in the CLI and engine.+ process.env.HYPERFRAMES_BROWSER_PATH = process.execPath;+ process.env.PRODUCER_HEADLESS_SHELL_PATH = join(directory, "wrong-env-browser");+ assert.equal(resolveExecutionOptions(options).chromePath, undefined);+ assert.equal(resolveExecutionOptions(options).browserVersion, recommendedBrowserVersion);+ assert.notEqual(browserExecutablePath(options), process.execPath);+ assert.equal((await program.probe()).state, "down", "system/environment browsers do not satisfy this selection");+ const invalid = { ...options, chromePath: join(directory, "missing-explicit-browser") };+ const configured = localHyperframesBrowserProgram({ ...invalid, id: "render", nodePath: process.execPath, ffprobePath: "ffprobe" });+ assert.equal(configured.installation, undefined, "explicit paths must never cause a managed replacement download");+ assert.equal((await configured.probe()).state, "down");+ assert.equal(resolveExecutionOptions(invalid).chromePath, invalid.chromePath);+ assert.deepEqual(await readdir(directory), []);+});+++test("browser selection rejects ambiguous choices and floating versions", () => {+ assert.throws(() => browserExecutablePath({ chromePath: process.execPath, browserVersion: recommendedBrowserVersion }), /mutually exclusive/u);+ assert.throws(() => browserExecutablePath({ browserVersion: "latest" }), /exact four-part/u);+ assert.throws(() => browserExecutablePath({ chromePath: "" }), /must not be empty/u);+ const chosen = { browserVersion: "151.0.7922.71", browserCacheDirectory: "/tmp/explicit-browser-cache" };+ const program = localHyperframesBrowserProgram({ ...chosen, id: "render", nodePath: process.execPath, ffprobePath: "ffprobe" });+ assert.equal(program.installation!.commands[0]!.args.at(-1), chosen.browserVersion);+ assert.equal(program.installation!.commands[0]!.args.at(-2), chosen.browserCacheDirectory);+ assert.ok(program.installation!.commands[0]!.label!.includes(browserExecutablePath(chosen)));+});++test("a wrong-version managed executable cannot satisfy readiness or trigger a different selection", {+ skip: process.platform === "win32",+}, async () => {+ const directory = await mkdtemp(join(tmpdir(), "hypit-browser-mismatch-"));+ try {+ const options = { browserCacheDirectory: directory, browserVersion: "151.0.7922.71" };+ const path = browserExecutablePath(options);+ await mkdir(dirname(path), { recursive: true });+ await writeFile(path, `#!${process.execPath}\nconsole.log('Chrome Headless Shell 999.0.0.0');\n`);+ await chmod(path, 0o755);+ const program = localHyperframesBrowserProgram({ ...options, id: "render", nodePath: process.execPath, ffprobePath: "ffprobe" });+ const state = await program.probe();+ assert.equal(state.state, "down");+ assert.match(state.detail, /Expected Chrome Headless Shell 151\.0\.7922\.71/u);+ assert.match(await readFile(path, "utf8"), /999\.0\.0\.0/u, "probe must not repair files");+ assert.equal(program.installation!.commands[0]!.args.at(-1), options.browserVersion);+ } finally { await rm(directory, { recursive: true, force: true }); }+});diff --git a/packages/provider-hyperframes-local/test/capture-process.test.ts b/packages/provider-hyperframes-local/test/capture-process.test.tsindex a414b1ac..ce13a3c6 100644--- a/packages/provider-hyperframes-local/test/capture-process.test.ts+++ b/packages/provider-hyperframes-local/test/capture-process.test.ts@@ -8,6 +8,120 @@ import { execFileSync, spawnSync } from "node:child_process";import { runCaptureProcess } from "../src/capture-process.js";import { resolveExecutionOptions } from "../src/render.js";import type { CaptureInput } from "../src/capture.js";+import { browserExecutablePath } from "../src/browser.js";++const exitCleanup = new URL("../src/capture-exit.ts", import.meta.url).href;++test("abrupt engine exit closes its actual Chrome without disturbing another browser", {+ skip: process.env.HYPIT_BROWSER_TESTS !== "1",+}, async () => {+ const { default: puppeteer } = await import("puppeteer-core");+ const chromePath = browserExecutablePath({});+ const other = await puppeteer.launch({ executablePath: chromePath, headless: true, args: ["--no-sandbox"] });+ const root = await mkdtemp(join(tmpdir(), "hypit-abrupt-chrome-"));+ const pidFile = join(root, "browser");+ let browserPid: number | undefined;+ try {+ const engine = join(root, "engine.mjs");+ await writeFile(engine, `import { acquireBrowser } from ${JSON.stringify(import.meta.resolve("@hyperframes/engine"))};+import { writeFileSync } from 'node:fs';+const { browser } = await acquireBrowser(['--no-sandbox'], {+ chromePath: ${JSON.stringify(chromePath)}, forceScreenshot: true, enableBrowserPool: false,+});+await browser.newPage();+writeFileSync(${JSON.stringify(pidFile)}, String(browser.process().pid));+process.exit(7);`);+ await assert.rejects(runCaptureProcess({+ document: { frameRate: { numerator: 30, denominator: 1 } },+ range: { startFrame: 0, endFrameExclusive: 1 }, config: resolveExecutionOptions({}),+ directory: root, engineModule: pathToFileURL(engine).href,+ } as CaptureInput, new AbortController().signal, () => {}), /exited before completion/u);+ browserPid = Number(await readFile(pidFile, "utf8"));+ try {+ process.kill(browserPid, 0);+ assert.notEqual(process.platform, "win32");+ assert.match(execFileSync("ps", ["-p", String(browserPid), "-o", "stat="], { encoding: "utf8" }).trim(), /^Z/u);+ } catch (error) {+ if ((error as NodeJS.ErrnoException).code !== "ESRCH") throw error;+ }+ const page = await other.newPage();+ assert.equal(await page.evaluate(() => 6 * 7), 42);+ } finally {+ browserPid ??= await readFile(pidFile, "utf8").then(Number, () => undefined);+ if (browserPid !== undefined) { try { process.kill(browserPid, "SIGKILL"); } catch {} }+ await other.close();+ await rm(root, { recursive: true, force: true });+ }+});++test("an uncatchable exit cannot hang on an orphan's inherited output pipes", {+ skip: process.platform === "win32", timeout: 15_000,+}, async () => {+ const root = await mkdtemp(join(tmpdir(), "hypit-capture-killed-"));+ let descendant: number | undefined;+ const diagnostics: string[] = [];+ try {+ const entry = join(root, "worker.mjs");+ await writeFile(entry, `import { spawn } from 'node:child_process';+process.once('message', () => {+ const child = spawn(process.execPath, ['-e', 'setInterval(() => {}, 1000)'], {+ detached: true, stdio: ['ignore', process.stdout, process.stderr],+ });+ child.unref();+ process.send({ type: 'progress', event: { phase: 'worker-start', browserPid: child.pid } },+ () => process.kill(process.pid, 'SIGKILL'));+});`);+ await assert.rejects(runCaptureProcess({ config: resolveExecutionOptions({}) } as CaptureInput,+ new AbortController().signal, event => {+ if ("browserPid" in event) descendant = event.browserPid;+ }, pathToFileURL(entry), async event => { diagnostics.push(event.message); }), /SIGKILL/u);+ assert.ok(diagnostics.some(message => /descendant cleanup could not be confirmed/u.test(message)));+ assert.ok(diagnostics.some(message => /output pipes did not close/u.test(message)));+ } finally {+ if (descendant !== undefined) { try { process.kill(descendant, "SIGKILL"); } catch {} }+ await rm(root, { recursive: true, force: true });+ }+});++for (const scenario of ["exit-zero", "exit-error", "uncaught", "SIGTERM"] as const) {+ test(`abrupt capture ${scenario} stops detached children before losing their owner`, {+ skip: scenario === "SIGTERM" && process.platform === "win32",+ }, async () => {+ const root = await mkdtemp(join(tmpdir(), "hypit-abrupt-capture-"));+ const pidFile = join(root, "descendant");+ let descendant: number | undefined;+ try {+ const engine = join(root, "engine.mjs");+ const end = scenario === "uncaught" ? "setImmediate(() => { throw new Error('unexpected engine crash'); }); await new Promise(() => {});"+ : scenario === "SIGTERM" ? "process.kill(process.pid, 'SIGTERM'); await new Promise(() => {});"+ : `process.exit(${scenario === "exit-zero" ? 0 : 7});`;+ await writeFile(engine, `import { spawn } from 'node:child_process';+import { writeFileSync } from 'node:fs';+const child = spawn(process.execPath, ['-e', 'setInterval(() => {}, 1000)'], { detached: true, stdio: 'ignore' });+child.unref();+writeFileSync(${JSON.stringify(pidFile)}, String(child.pid));+${end}`);+ await assert.rejects(runCaptureProcess({+ document: { frameRate: { numerator: 30, denominator: 1 } },+ range: { startFrame: 0, endFrameExclusive: 1 }, config: resolveExecutionOptions({}),+ directory: root, engineModule: pathToFileURL(engine).href,+ } as CaptureInput, new AbortController().signal, () => {}), /exited before completion/u);+ descendant = Number(await readFile(pidFile, "utf8"));+ try {+ process.kill(descendant, 0);+ assert.notEqual(process.platform, "win32");+ assert.match(execFileSync("ps", ["-p", String(descendant), "-o", "stat="], { encoding: "utf8" }).trim(), /^Z/u);+ } catch (error) {+ if ((error as NodeJS.ErrnoException).code !== "ESRCH") throw error;+ }+ } finally {+ // Also stop this test's child if an assertion fails before its PID is read.+ descendant ??= await readFile(pidFile, "utf8").then(Number, () => undefined);+ if (descendant !== undefined) { try { process.kill(descendant, "SIGKILL"); } catch {} }+ await rm(root, { recursive: true, force: true });+ }+ });+}test("a capture failure still terminates a detached process left by failed resource cleanup", async () => {const root = await mkdtemp(join(tmpdir(), "hypit-worker-failed-cleanup-"));@@ -45,9 +159,11 @@ test("a completed renderer finishes its IPC shutdown and exits naturally", asynctry {const marker = join(root, "exited");const entry = join(root, "worker.mjs");- await writeFile(entry, `import { writeFileSync } from 'node:fs';+ await writeFile(entry, `import { releaseCaptureExitCleanup } from ${JSON.stringify(exitCleanup)};+import { writeFileSync } from 'node:fs';process.on('exit', () => writeFileSync(${JSON.stringify(marker)}, 'natural exit'));process.once('message', () => {+ releaseCaptureExitCleanup();process.send({ type: 'completed' }, () => setTimeout(() => process.disconnect(), 100));});`);await runCaptureProcess({ config: resolveExecutionOptions({}) } as CaptureInput,@@ -110,11 +226,20 @@ process.stdout.write("resolved:" + Object.keys(module).join(",") + "\\n");`);assert.equal(resolved.status, 0, resolved.stderr);assert.match(resolved.stdout, /stageHyperframesProject/u);+ const stale = spawnSync(process.execPath, ["--import", tsx, "--import", bootstrap, probe], {+ encoding: "utf8", timeout: 120_000,+ env: { ...process.env, HYPIT_DISTRIBUTION_ROOT: join(root, "old-installation") },+ });+ assert.equal(stale.status, 0, stale.stderr);+ assert.match(stale.stdout, /stageHyperframesProject/u);+// The render entry point must actually pass that preload to its child.const worker = join(root, "worker.mjs");- await writeFile(worker, `process.once("message", async () => {+ await writeFile(worker, `import { releaseCaptureExitCleanup } from ${JSON.stringify(exitCleanup)};+process.once("message", async () => {const module = await import("@hypit/hyperframes/project");process.stdout.write("resolved:" + Object.keys(module).join(",") + "\\n");+ releaseCaptureExitCleanup();process.send({ type: "completed" }, () => process.disconnect());});`);const diagnostics: string[] = [];@@ -130,9 +255,11 @@ test("renderer stdout and stderr diagnostics are drained before reporting succesconst messages: import("@hypit/runtime").ExecutionDiagnostic[] = [];try {const entry = join(root, "report.mjs");- await writeFile(entry, `process.once('message', () => {+ await writeFile(entry, `import { releaseCaptureExitCleanup } from ${JSON.stringify(exitCleanup)};+process.once('message', () => {process.stdout.write('browser ready\\n');process.stderr.write('render diagnostic\\n');+ releaseCaptureExitCleanup();process.send({ type: 'completed' }, () => process.disconnect());});`);await runCaptureProcess({ config: resolveExecutionOptions({}) } as CaptureInput,@@ -172,7 +299,9 @@ process.stdout.write(JSON.stringify({ error, diagnostics }));const result = scenario === "failed" ? { type: "failed", error: "capture failed" }: scenario === "cancelled" ? { type: "progress", event: { phase: "encoding" } }: { type: "completed" };- await writeFile(entry, `process.once('message', () => {+ await writeFile(entry, `import { releaseCaptureExitCleanup } from ${JSON.stringify(exitCleanup)};+process.once('message', () => {+ ${scenario === 'completed' ? 'releaseCaptureExitCleanup();' : ''}process.send(${JSON.stringify(result)}, () => { ${scenario !== "completed" ? "setInterval(() => {}, 1000);" : "process.disconnect();"} });});`);const run = spawnSync(process.execPath, ["--import", import.meta.resolve("tsx"), runner, entry],diff --git a/packages/provider-hyperframes-local/test/provider.test.ts b/packages/provider-hyperframes-local/test/provider.test.tsindex b8557c9c..7c75c4ef 100644--- a/packages/provider-hyperframes-local/test/provider.test.ts+++ b/packages/provider-hyperframes-local/test/provider.test.ts@@ -1,4 +1,7 @@import { spawnSync } from "node:child_process";+import { mkdtemp, readdir, rm } from "node:fs/promises";+import { tmpdir } from "node:os";+import { join } from "node:path";import test from "node:test";import { mediaTypes, verifyRenderedVisual } from "@hypit/media";import type { CompositableSurfaceRef, RenderedVisual } from "@hypit/media";@@ -13,12 +16,42 @@ import { renderHyperframesCapabilities, hyperframesVisualRequest } from "@hypit/import { canonicalize } from "@hypit/protocol";import type { CanonicalValue, Need } from "@hypit/protocol";-import { createLocalHyperframesProvider } from "../src/index.js";+import { createLocalHyperframesProvider, renderHyperframesVisual } from "../src/index.js";import { localHyperframesBrowserProgram } from "../src/program.js";+import { browserExecutablePath } from "../src/browser.js";const liveEnabled = process.env.HYPIT_BROWSER_TESTS === "1";const hasFfprobe = spawnSync("ffprobe", ["-version"], { stdio: "ignore", windowsHide: true }).status === 0;+test("rendering with a missing selection fails without installing or substituting a browser", async () => {+ const directory = await mkdtemp(join(tmpdir(), "hypit-missing-render-browser-"));+ try {+ for (const selection of [+ { browserVersion: "0.0.0.1", browserCacheDirectory: directory },+ { chromePath: join(directory, "missing-browser") },+ ]) {+ await assert.rejects(renderHyperframesVisual({ document: documentFixture() }, {+ ...selection, resources: new MemoryResourceStore(),+ }), /Render browser is unavailable/u);+ assert.deepEqual(await readdir(directory), []);+ }+ } finally { await rm(directory, { recursive: true, force: true }); }+});++test("an explicit browser renders without installing a managed replacement", { skip: !liveEnabled || !hasFfprobe }, async () => {+ const chromePath = browserExecutablePath({});+ const program = localHyperframesBrowserProgram({ chromePath, id: "external", nodePath: process.execPath, ffprobePath: "ffprobe" });+ assert.equal(program.installation, undefined);+ assert.equal((await program.probe()).state, "ready");+ const diagnostics: string[] = [];+ const visual = await renderHyperframesVisual({ document: documentFixture() }, {+ chromePath, resources: new MemoryResourceStore(), workers: 1,+ onDiagnostic: async event => { diagnostics.push(event.message); },+ });+ assert.equal(visual.frameCount, 12);+ assert.ok(diagnostics.some(message => message.includes(`browser ${chromePath}`)));+});+function documentFixture(surface?: CompositableSurfaceRef) {const programSpace = sealProgramSpace({ id: "test-space", durationSec: 1,frameRate: { numerator: 12, denominator: 1 },@@ -110,12 +143,11 @@ test("the selected HyperFrames Provider owns one idempotent browser installationconst program = localHyperframesBrowserProgram({id: "hyperframes",nodePath: process.execPath,- hyperframesCliPath: "/hyperframes-cli.js",ffprobePath: "ffprobe",});assert.equal(program.id, "hyperframes");assert.equal(program.start, undefined);- assert.deepEqual(program.installation?.commands[0]?.args.slice(-2), ["browser", "ensure"]);+ assert.match(program.installation!.commands[0]!.args.at(-3)!, /browser-install\.ts$/u);});test("local HyperFrames Provider really renders a silent frame-exact MP4 with parallel workers", {diff --git a/packages/provider-hyperframes-local/test/range.test.ts b/packages/provider-hyperframes-local/test/range.test.tsindex ca2b9ce3..e30e76a8 100644--- a/packages/provider-hyperframes-local/test/range.test.ts+++ b/packages/provider-hyperframes-local/test/range.test.ts@@ -55,7 +55,8 @@ test("a render deadline cancels resource preparation and awaits the reader's cle}const resources = new StalledResources();const document = documentFor({ kind: "blob", resource: "res_waiting", size: 1, mediaType: "video/mp4" });- await assert.rejects(renderHyperframesVisual({ document }, { resources, processTimeoutMs: 100 }),+ // This test stops during resource preparation, before any browser is launched.+ await assert.rejects(renderHyperframesVisual({ document }, { resources, chromePath: process.execPath, processTimeoutMs: 100 }),/render timed out during preparing resources/u);assert.equal(resources.active, 0, "the failed render must not leave its reader running");});@@ -89,8 +90,16 @@ test("source selection retains loop, hold and fractional-speed sampling and shartest("real selected renders sample video correctly across loop, hold and stretch with independent browsers", {skip: process.env.HYPIT_BROWSER_TESTS !== "1",-}, async () => {+}, async (t) => {const root = await mkdtemp(join(tmpdir(), "hypit-render-range-test-"));+ const saved = [process.env.HYPERFRAMES_FFMPEG_PATH, process.env.HYPERFRAMES_FFPROBE_PATH];+ process.env.HYPERFRAMES_FFMPEG_PATH = join(root, "unselected-ffmpeg");+ process.env.HYPERFRAMES_FFPROBE_PATH = join(root, "unselected-ffprobe");+ t.after(() => {+ for (const [index, key] of ["HYPERFRAMES_FFMPEG_PATH", "HYPERFRAMES_FFPROBE_PATH"].entries()) {+ if (saved[index] === undefined) delete process.env[key]; else process.env[key] = saved[index];+ }+ });try {const colors = [[240, 20, 20], [20, 220, 20], [20, 20, 240], [220, 220, 20]];const raw = Buffer.concat(colors.map((color) => Buffer.from(Array.from({ length: 64 * 64 }, () => color).flat())));diff --git a/packages/provider-hyperframes-local/test/visual-readiness.test.ts b/packages/provider-hyperframes-local/test/visual-readiness.test.tsnew file mode 100644index 00000000..4a62cf14--- /dev/null+++ b/packages/provider-hyperframes-local/test/visual-readiness.test.ts@@ -0,0 +1,115 @@+import assert from "node:assert/strict";+import { createServer } from "node:http";+import test from "node:test";+import puppeteer from "puppeteer-core";+import sharp from "sharp";+import type { CaptureSession } from "@hyperframes/engine";+import { sealComposition, sealVisualTrack } from "@hypit/composition";+import type { VisualElement, VisualTextTypography } from "@hypit/composition";+import { compileHyperframesDocument, materializeHyperframesHtml } from "@hypit/hyperframes";+import { sealProgramSpace } from "@hypit/program-space";+import { browserExecutablePath } from "../src/browser.js";+import { createOpaqueFrameCapture } from "../src/opaque-capture.js";++const live = { skip: process.env.HYPIT_BROWSER_TESTS !== "1" };++test("capture waits for dynamic images and rejects broken images or exact fonts", live, async (t) => {+ const png = await sharp({ create: { width: 64, height: 64, channels: 3, background: "#ff0000" } }).png().toBuffer();+ const server = createServer((_request, response) => {+ setTimeout(() => {+ response.setHeader("Content-Type", "image/png");+ response.setHeader("Access-Control-Allow-Origin", "*");+ response.end(png);+ }, 300);+ });+ await new Promise<void>(resolve => server.listen(0, "127.0.0.1", resolve));+ const address = server.address();+ assert.ok(address !== null && typeof address !== "string");+ const origin = `http://127.0.0.1:${address.port}`;+ const browser = await puppeteer.launch({ executablePath: browserExecutablePath({}), headless: true, args: ["--no-sandbox"] });+ try {+ for (const kind of ["class", "pseudo", "mask", "svg", "broken", "font"] as const) await t.test(kind, async () => {+ const page = await browser.newPage();+ try {+ await page.setViewport({ width: 64, height: 64 });+ const css = kind === "mask" ? `.paint{background:red;mask-image:url(${origin}/mask.png)}`+ : kind === "font" ? '@font-face{font-family:broken;src:url(data:font/woff2;base64,AA==)}body{font-family:broken}' : kind === "pseudo"+ ? `.paint::before{content:'';position:absolute;inset:0;background-image:url(${origin}/pseudo.png)}`+ : `.paint{background-image:url(${origin}/class.png)}`;+ const html = kind === "font" ? '<span>A</span>' : kind === "svg" ? '<svg width="64" height="64"><image id="target" width="64" height="64"/></svg>'+ : kind === "broken" ? '<img src="data:image/png;base64,YmFk"/>'+ : '<div id="target" style="width:64px;height:64px"></div>';+ await page.setContent(`<style>body{margin:0}${css}</style>${html}`);+ if (kind === "broken") await page.waitForFunction(() => document.images[0]!.complete);+ await page.evaluate(({ kind, origin }) => {+ (window as unknown as { __hf: unknown }).__hf = { async seek() {+ const target = document.getElementById("target");+ if (kind === "svg") target!.setAttribute("href", `${origin}/svg.png`);+ else if (target !== null) target.classList.add("paint");+ } };+ }, { kind, origin });+ const capture = await createOpaqueFrameCapture({ page,+ options: { fps: { num: 30, den: 1 }, width: 64, height: 64 } } as unknown as CaptureSession);+ if (kind === "broken") await assert.rejects(capture(0), /image could not be decoded/u);+ else if (kind === "font") await assert.rejects(capture(0), /font could not be loaded/u);+ else {+ const frame = await capture(0);+ const { data, info } = await sharp(frame.buffer).raw().toBuffer({ resolveWithObject: true });+ const center = (32 * info.width + 32) * info.channels;+ assert.deepEqual([...data.subarray(center, center + 3)], [255, 0, 0]);+ }+ } finally { await page.close(); }+ });+ } finally {+ await browser.close();+ await new Promise<void>((resolve, reject) => server.close(error => error ? reject(error) : resolve()));+ }+});++test("terminal text and SVG mask sources retain their Present frame animations on direct seeks", live, async () => {+ const space = sealProgramSpace({ id: "animations", durationSec: 2, frameRate: { numerator: 30, denominator: 1 } });+ const image = { kind: "blob", resource: "res_mask", size: 1, mediaType: "image/png" } as const;+ const font = { sources: [{ artifact: { kind: "blob", resource: "res_font", size: 1, mediaType: "font/woff2" } }],+ weight: 400, style: "normal" } as const;+ const typography: VisualTextTypography = { fonts: [font], sizePx: 20, weight: 400, style: "normal", axes: [], features: [],+ synthesis: "none", kerning: "auto", trackingPx: 0, wordSpacingPx: 0, lineHeight: 1, direction: "auto",+ writingMode: "horizontal-tb", baselineShiftPx: 0, tabSize: 4, indentationPx: 0, paragraphBeforePx: 0,+ paragraphAfterPx: 0, transform: "none", variantCaps: "normal", verticalAlign: "baseline", decorations: [],+ cjk: { textSpacing: "normal", punctuationTrim: "none" } };+ const animation = { keyframes: [{ atFrame: 0, style: [{ name: "opacity", value: 0 }] },+ { atFrame: 30, style: [{ name: "opacity", value: 1 }] }] };+ const text = { style: [], animation, document: { paragraphs: [{ id: "p", inlines: [{ kind: "text" as const, id: "t", text: "A" }] }] },+ typography, paints: [{ kind: "fill" as const, paint: { kind: "solid" as const, color: "#ffffff" } }], sequences: [] };+ const elements: VisualElement[] = [+ { id: "root", kind: "box", order: 0, style: [] },+ { ...text, id: "flow", parent: "root", order: 1, kind: "text-flow", flow: {+ form: { kind: "area" }, inlineSize: "hug", blockSize: "hug", paddingPx: { inlineStart: 0, inlineEnd: 0, blockStart: 0, blockEnd: 0 },+ inlineAlign: "start", blockAlign: "start", wrap: "none", overflow: "visible", clipToFrame: false, columns: 1,+ columnGapPx: 0, metricEdge: "line-box" } },+ { ...text, id: "path", parent: "root", order: 2, kind: "path-text",+ path: [{ kind: "move", x: 0, y: 20 }, { kind: "line", x: 100, y: 20 }], side: "left", orientation: "follow",+ align: "start", overflow: "visible", startMarginPx: 0, endMarginPx: 0, reverse: false },+ { id: "mask", parent: "root", order: 3, kind: "mask", mode: "alpha", maskElement: "mask-image", contentElement: "content",+ style: [{ name: "width", value: "64px" }, { name: "height", value: "64px" }] },+ { id: "mask-image", parent: "mask", order: 4, kind: "image", artifact: image, style: [], animation },+ { id: "content", parent: "mask", order: 5, kind: "box", style: [{ name: "background", value: "#ffffff" }] },+ ];+ const track = sealVisualTrack({ id: "visual", programSpaceId: space.id, visualIr: "hypit.visual-ir@1",+ presents: [{ id: "later", span: { startFrame: 15, endFrameExclusive: 60 }, stacking: { order: 0, tieBreak: "later" }, elements }] });+ const compiled = compileHyperframesDocument(sealComposition({ id: "animation", canvas: { width: 128, height: 128, clearColor: "#000000" }, tracks: [track] }), space);+ const browser = await puppeteer.launch({ executablePath: browserExecutablePath({}), headless: true, args: ["--no-sandbox"] });+ try {+ const page = await browser.newPage();+ // Glyph appearance is irrelevant to this element-opacity test; the tiny invalid font+ // settles immediately. Font loading and painted text have separate integration coverage.+ await page.setContent(materializeHyperframesHtml(compiled, artifact => artifact.resource === "res_font"+ ? "data:font/woff2;base64,AA==" : "data:image/png;base64,AA=="));+ for (const frame of [30, 45, 15, 40, 30]) {+ const values = await page.evaluate(frame => {+ window.dispatchEvent(new CustomEvent("hf-seek", { detail: { time: frame / 30 } }));+ return ["flow", "path", "mask-image"].map(id => Number(getComputedStyle(document.querySelector(`[data-hypit-element-id="${id}"]`)!).opacity));+ }, frame);+ for (const value of values) assert.ok(Math.abs(value - (frame - 15) / 30) < 0.001, `frame ${frame}: ${values}`);+ }+ } finally { await browser.close(); }+});diff --git a/packages/runtime-host-node/README.md b/packages/runtime-host-node/README.mdindex 4978dfad..7e558959 100644--- a/packages/runtime-host-node/README.md+++ b/packages/runtime-host-node/README.md@@ -53,3 +53,8 @@ to start execution, then `const runtime = await host.createRuntime(); await runtto submit work. `RuntimeHostExecution` does not run a second embedded Worker loop. A local carriermay stop accepting new Builds and drain; its assigned Builds stay in place and all carriers continueusing the same resource accounting. Process policy belongs to the local Runtime, not this Host ABI.++`prepareHostPackages` accepts exact specifier strings or `{ specifier, env }` installation inputs.+The optional environment is applied only to that npm child process, merged over its inherited+environment. It is neither persisted as installation status nor returned in package reports.+The shared installer does not interpret SDK-specific variables; their owning packages supply them.diff --git a/packages/runtime-host-node/src/packages.ts b/packages/runtime-host-node/src/packages.tsindex 2d125d09..87cfec8e 100644--- a/packages/runtime-host-node/src/packages.ts+++ b/packages/runtime-host-node/src/packages.ts@@ -73,7 +73,7 @@ export async function inspectHostPackage(: undefined;}-async function runNpm(root: string, specifiers: readonly string[], logPath: string): Promise<void> {+async function runNpm(root: string, specifiers: readonly string[], logPath: string, env?: Readonly<Record<string, string>>): Promise<void> {// npm's prefix and cwd must denote the same physical project (not /tmp vs /private/tmp).const cwd = await realpath(root);const npmArgs = [@@ -96,6 +96,7 @@ async function runNpm(root: string, specifiers: readonly string[], logPath: stricwd,shell: false,windowsHide: true,+ env: { ...process.env, ...env },stdio: ["ignore", log.fd, log.fd],});child.on("error", (error) => reject(new Error(`Cannot start npm: ${error.message}. Log: ${logPath}`, { cause: error })));@@ -114,21 +115,26 @@ async function runNpm(root: string, specifiers: readonly string[], logPath: stri* package.json, lockfile and dependencies; Hypit keeps no parallel inventory.*/export async function prepareHostPackages(- specifiers: readonly string[],+ specifiers: readonly (string | { readonly specifier: string; readonly env?: Readonly<Record<string, string>> })[],options: {readonly root: string;readonly onProgress?: (event: HostPackageProgress) => void;},): Promise<readonly HostPackageReport[]> {const root = resolve(options.root);- const bySpecifier = new Map<string, RegistryPackageSpec>();+ const bySpecifier = new Map<string, RegistryPackageSpec & { readonly env?: Readonly<Record<string, string>> }>();for (const specifier of specifiers) {- const parsed = parseRegistryPackageSpec(specifier);- bySpecifier.set(parsed.specifier, parsed);+ const parsed = parseRegistryPackageSpec(typeof specifier === "string" ? specifier : specifier.specifier);+ const env = { ...bySpecifier.get(parsed.specifier)?.env };+ for (const [key, value] of Object.entries(typeof specifier === "string" ? {} : specifier.env ?? {})) {+ if (env[key] !== undefined && env[key] !== value) throw new Error(`Conflicting installation environment ${key} for ${parsed.specifier}`);+ env[key] = value;+ }+ bySpecifier.set(parsed.specifier, { ...parsed, ...(Object.keys(env).length === 0 ? {} : { env }) });}const required = [...bySpecifier.values()].sort((left, right) => left.specifier.localeCompare(right.specifier));const reports: HostPackageReport[] = [];- for (const item of required) {+ for (const { env, ...item } of required) {const installation = externalPackageInstallRoot(root, item.name, item.version);options.onProgress?.({ ...item, phase: "checking" });const missing = await installedVersion(installation, item.name) !== item.version;@@ -142,7 +148,7 @@ export async function prepareHostPackages(dependencies: { [item.name]: item.version },}, null, 2)}\n`, "utf8");options.onProgress?.({ ...item, phase: "installing", logPath });- await runNpm(installation, [item.specifier], logPath);+ await runNpm(installation, [item.specifier], logPath, env);}const version = await installedVersion(installation, item.name);if (version !== item.version) {diff --git a/packages/runtime-host-node/test/runtime-host-node.test.ts b/packages/runtime-host-node/test/runtime-host-node.test.tsindex 705428af..8e62e79b 100644--- a/packages/runtime-host-node/test/runtime-host-node.test.ts+++ b/packages/runtime-host-node/test/runtime-host-node.test.ts@@ -1,9 +1,39 @@import assert from "node:assert/strict";-import { chmod, mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";+import { chmod, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";import { tmpdir } from "node:os";import { join } from "node:path";import test from "node:test";+test("declared dependency installation environment reaches npm without changing the caller", {+ skip: process.platform === "win32",+}, async () => {+ const root = await mkdtemp(join(tmpdir(), "hypit-package-install-env-"));+ const originalPath = process.env.PATH;+ const originalValue = process.env.HYPIT_TEST_INSTALL_OPTION;+ try {+ const npm = join(root, "npm");+ await writeFile(npm, `#!${process.execPath}+const fs = require('node:fs');+fs.writeFileSync('received.json', JSON.stringify({option: process.env.HYPIT_TEST_INSTALL_OPTION}));+fs.mkdirSync('node_modules/example-sdk', {recursive: true});+fs.writeFileSync('node_modules/example-sdk/package.json', JSON.stringify({name:'example-sdk', version:'1.2.3'}));+`);+ await chmod(npm, 0o755);+ process.env.PATH = root;+ const reports = await prepareHostPackages([{ specifier: "[email protected]", env: { HYPIT_TEST_INSTALL_OPTION: "selected" } }], { root: join(root, "packages") });+ assert.equal(JSON.parse(await readFile(join(reports[0]!.root, "received.json"), "utf8")).option, "selected");+ assert.equal(process.env.HYPIT_TEST_INSTALL_OPTION, originalValue);+ assert.equal("env" in reports[0]!, false, "installation parameters are not output metadata");+ await assert.rejects(prepareHostPackages([+ { specifier: "[email protected]", env: { OPTION: "a" } },+ { specifier: "[email protected]", env: { OPTION: "b" } },+ ], { root }), /Conflicting installation environment/u);+ } finally {+ if (originalPath === undefined) delete process.env.PATH; else process.env.PATH = originalPath;+ await rm(root, { recursive: true, force: true });+ }+});+import {diagnoseRuntimeExecutable,hypitHostPackageRoot,diff --git a/packages/runtime-local/src/config.ts b/packages/runtime-local/src/config.tsindex 3f8f02af..57c4a6ef 100644--- a/packages/runtime-local/src/config.ts+++ b/packages/runtime-local/src/config.ts@@ -462,7 +462,7 @@ export async function prepareRuntimeConfigPackages(...document.endpoints.map((item) => item.use),...credentials.credentials.map((item) => item.use),], options.distributionPackageRoot);- return await prepareHostPackages(requirements.map((item) => item.specifier), {+ return await prepareHostPackages(requirements, {root: hypitHostPackageRoot(options.hostStateRoot),...(options.onProgress === undefined ? {} : { onProgress: options.onProgress }),});diff --git a/packages/video-cli/src/distribution.ts b/packages/video-cli/src/distribution.tsindex a88155c8..ec010544 100644--- a/packages/video-cli/src/distribution.ts+++ b/packages/video-cli/src/distribution.ts@@ -12,8 +12,7 @@ import {// The Distribution root is the replaceable Hypit tool checkout, not this// package's source directory and never the author's project.-const packageRoot = resolve(process.env.HYPIT_DISTRIBUTION_ROOT ?? resolve(import.meta.dirname, "../../.."));-const installedLauncher = process.env.HYPIT_CLI_LAUNCHER;+const packageRoot = resolve(import.meta.dirname, "../../..");const defaultBuildResultRepository = {use: "@hypit/build-result-fs",config: { path: ".hypit/results" },@@ -57,14 +56,8 @@ export const videoCliDistribution: CliDistribution = {: { distributionPackageRoot: options.distributionPackageRoot }),workerLaunch: {command: process.execPath,- // The repository launcher registers TypeScript support before entering the CLI.- // Tests that import this Distribution directly keep the current Node arguments.- args: installedLauncher === undefined- ? [- ...process.execArgv.filter((item) => !item.startsWith("--test")),- fileURLToPath(new URL("./cli.ts", import.meta.url)),- ]- : [installedLauncher],+ // The loaded Distribution owns its Worker entry and TypeScript/package resolution.+ args: [fileURLToPath(new URL("../../../bin/hypit.mjs", import.meta.url))],},}),openProjectResults: async (projectRoot, options) => {diff --git a/packages/video-cli/src/version.ts b/packages/video-cli/src/version.tsindex fb6accad..4894662c 100644--- a/packages/video-cli/src/version.ts+++ b/packages/video-cli/src/version.ts@@ -20,7 +20,7 @@ export function writeVersionHelp(io: CliIo): void {/** Installation discovery belongs to the executable, independent of video execution and Skill installers. */export async function runVersionCli(argv: readonly string[], io: CliIo, environment: VersionEnvironment = {packageRoot: resolve(import.meta.dirname, "../../.."),- ...(process.env.HYPIT_CLI_LAUNCHER === undefined ? {} : { launcher: process.env.HYPIT_CLI_LAUNCHER }),+ launcher: resolve(import.meta.dirname, "../../../bin/hypit.mjs"),fetch: globalThis.fetch,}): Promise<void> {let check = false;diff --git a/packages/video-cli/test/version.test.ts b/packages/video-cli/test/version.test.tsindex 4962270f..f1c2c066 100644--- a/packages/video-cli/test/version.test.ts+++ b/packages/video-cli/test/version.test.ts@@ -4,6 +4,21 @@ import { tmpdir } from "node:os";import { join } from "node:path";import test from "node:test";import { runVersionCli } from "../src/version.js";+import { spawnSync } from "node:child_process";+import { fileURLToPath } from "node:url";++test("the launched Distribution ignores inherited installation and launcher hints", () => {+ const root = fileURLToPath(new URL("../../../", import.meta.url));+ const launcher = join(root, "bin", "hypit.mjs");+ const result = spawnSync(process.execPath, [launcher, "version", "--json"], {+ encoding: "utf8", windowsHide: true,+ env: { ...process.env, HYPIT_DISTRIBUTION_ROOT: join(tmpdir(), "old-hypit"), HYPIT_CLI_LAUNCHER: join(tmpdir(), "old-hypit.mjs") },+ });+ assert.equal(result.status, 0, result.stderr);+ const report = JSON.parse(result.stdout);+ assert.equal(report.distribution, join(root, "."));+ assert.equal(report.launcher, launcher);+});test("version reads its Distribution without a project, Runtime or registry request", async () => {const root = await mkdtemp(join(tmpdir(), "hypit-version-"));diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 7879ee08..cc96fc2a 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -2163,9 +2163,6 @@ importers:'@hypit/media-execution':specifier: workspace:*version: link:../media-execution- '@hypit/package-loader-node':- specifier: workspace:*- version: link:../package-loader-node'@hypit/protocol':specifier: workspace:*version: link:../protocol@@ -2181,9 +2178,9 @@ importers:'@hypit/runtime-kit':specifier: workspace:*version: link:../runtime-kit- hyperframes:- specifier: 0.7.101- version: 0.7.101(@types/[email protected])+ '@puppeteer/browsers':+ specifier: 3.2.2+ version: 3.2.2tsx:specifier: 4.21.0version: 4.21.0@@ -4502,15 +4499,6 @@ packages:'@fontsource/[email protected]':resolution: {integrity: sha512-iRuUPl9ONFbYzi6JcEshpE4VedINyzQ4hv0Z5XEt0cB0pMPiQeqc2Qvv1NwJCNzkPwG02VCdcO+cF2K8ylYn2A==}- '@google/[email protected]':- resolution: {integrity: sha512-gwSvbpiN/17O9TbsqSsE/OzZcpv5Fo4RQjdngGgogtuB9RsyJ8ZHhX5KjHj1bp5N9snN2eK8LDGXSaWW2hof8Q==}- engines: {node: '>=20.0.0'}- peerDependencies:- '@modelcontextprotocol/sdk': ^1.25.2- peerDependenciesMeta:- '@modelcontextprotocol/sdk':- optional: true-'@hono/[email protected]':resolution: {integrity: sha512-eWpQYr67tqJLeaSUl0Q+TquuYfUdTibpOJlUMV2FfUP7+KqCC5TufnwnlXL6mobZBJbGAYRd7ZvEBDCbLInjhg==}engines: {node: '>=20'}@@ -4708,10 +4696,6 @@ packages:'@infolektuell/[email protected]':resolution: {integrity: sha512-B6kpvqeD0ukTR7sydGKpktvO3VhZkOwQxAdLLGPdSHxQxREa2+sH6B9ODop6quPGjhmsZkJ/hL01rQ8At5xDew==}- '@isaacs/[email protected]':- resolution: {integrity: sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==}- engines: {node: '>=18.0.0'}-'@jridgewell/[email protected]':resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==}@@ -4815,33 +4799,6 @@ packages:'@oxc-project/[email protected]':resolution: {integrity: sha512-Nm4s/jB+4FpFsPhWGEC4h7rzksesmtnMXomo6rCMcg/b8zLQuOziRgkCS1fxDCXOlJB/6Q8oABOZ/OP6RIPj9A==}- '@protobufjs/[email protected]':- resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==}-- '@protobufjs/[email protected]':- resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==}-- '@protobufjs/[email protected]':- resolution: {integrity: sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==}-- '@protobufjs/[email protected]':- resolution: {integrity: sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==}-- '@protobufjs/[email protected]':- resolution: {integrity: sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==}-- '@protobufjs/[email protected]':- resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==}-- '@protobufjs/[email protected]':- resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==}-- '@protobufjs/[email protected]':- resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==}-- '@protobufjs/[email protected]':- resolution: {integrity: sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==}-'@puppeteer/[email protected]':resolution: {integrity: sha512-RDLpio3fH/qrj5k4DVY6eyiN8tCS0Zovd/6jW//n605oeqkWcUjn+3k+9ZtZBnbwMpsu0F7xDIiKXvVmG5c5Bw==}engines: {node: '>=22.12.0'}@@ -5153,9 +5110,6 @@ packages:resolution: {integrity: sha512-0JFs3V2y2M9tKW5na/qxe69Zv+uxLMO7QBbhxF/FHu/Gp2NFZAAL9tWl9PU02xxo07pb3G9FTyjNc6D5uZrJIg==}engines: {node: '>=18.0.0'}- '@swc/[email protected]':- resolution: {integrity: sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==}-'@types/[email protected]':resolution: {integrity: sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==}@@ -5177,9 +5131,6 @@ packages:'@types/[email protected]':resolution: {integrity: sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==}- '@types/[email protected]':- resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==}-'@types/[email protected]':resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==}@@ -5291,14 +5242,6 @@ packages:engines: {node: '>=0.4.0'}hasBin: true- resolution: {integrity: sha512-XleryMhbuksdKtofnWZ9Sk+4CUTbms4Mb/EU32SZwToAyZ5RgVos/ki8n+yr0LWHOGKuakbXTuuYNHLQjhddgg==}- engines: {node: '>=14.0'}-- resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==}- engines: {node: '>= 14'}-resolution: {integrity: sha512-PrqppUmhT4ENdas2pH9caE7efUcxy6EcSFhWzosiVuQBzu2tQ5yLTI6jwomT/1cuBnivzGfxiJCqDNN9FRRh+Q==}engines: {node: '>= 14.0.0'}@@ -5318,12 +5261,6 @@ packages:resolution: {integrity: sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==}engines: {node: '>=4'}- resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}-- resolution: {integrity: sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==}-resolution: {integrity: sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw==}@@ -5331,26 +5268,12 @@ packages:resolution: {integrity: sha512-DkVaaQHymRhpYEYo9x1oo7Q7B0Y6KJUsjm3c9eTyFDby4MHLBTwZ6ZDWBel5zrYxj1WsZgC5oLpiz+93MluXeA==}engines: {node: '>=20.19.0'}- resolution: {integrity: sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==}- deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.-resolution: {integrity: sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==}resolution: {integrity: sha512-FaHFT5WDCR5zwtjVTqxk01o2MDaf22ORHityX1lxMamBcVNX6NWXB6hw7nx4fmlEseRMv0xfuSybINZylljLfA==}- resolution: {integrity: sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==}-- resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==}-- resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==}- engines: {node: '>=18'}-resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}@@ -5360,19 +5283,12 @@ packages:resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==}- resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==}- engines: {node: '>=18'}-resolution: {integrity: sha512-5v9GQFhTktFvotn/OFNJBmKLKRAb6n9r0bVCwf7sHgWc3/JryK0bj1nn93L3pHFrfgcsu6Be6EWsDi+1XHTGDg==}engines: {node: '>=20.19.0 <22.0.0 || >=22.12.0'}peerDependencies:devtools-protocol: '*'- resolution: {integrity: sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w==}-resolution: {integrity: sha512-Ca8swihM+/4yKecYHY52kgJd300hi2lADU/a1RxNTRe+RJ9jvqQlESpbz9DnG9mowez8qwXHB8qYdIUw9e+F5Q==}@@ -5380,19 +5296,12 @@ packages:resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==}engines: {node: '>=20'}- resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==}- engines: {node: '>=0.8'}-resolution: {integrity: sha512-6y5X4OxsYFnHERo6WSVPnLrk53G07MOQ8aUb2z555JgwynpbZsHR0a//WdN6DUcmE1j2auTF2TtL4PpoKze8QQ==}resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==}- resolution: {integrity: sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==}-resolution: {integrity: sha512-7Vv6asjS4gMOuILabD3l739tsaxFQmC+a7pLZm02zyvs8p977bL3zEgq3yDk5rn9B0PbYgIv++jmHcuUab4RhA==}engines: {node: '>=18'}@@ -5416,39 +5325,6 @@ packages:resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}- resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==}- engines: {node: '>= 12'}-- resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}- engines: {node: '>=6.0'}- peerDependencies:- supports-color: '*'- peerDependenciesMeta:- supports-color:- optional: true-- resolution: {integrity: sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==}- engines: {node: '>=12'}-- resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}- engines: {node: '>= 0.4'}-resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}engines: {node: '>=6'}@@ -5457,9 +5333,6 @@ packages:resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==}engines: {node: '>=8'}- resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==}-resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==}@@ -5469,9 +5342,6 @@ packages:resolution: {integrity: sha512-gCcO42XCHKEs7Ag0S7aGYsnJ7hlgrO3qderYqeiY0Eqk+0GFfuvT13IA0hHreJTa2KCdDVyGMeOhdMNmrrTjVg==}- resolution: {integrity: sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q==}-resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==}@@ -5501,9 +5371,6 @@ packages:resolution: {integrity: sha512-qI4JLRKnSzqFqr7hAlS5xQDusBCjKSEG4t4+7aNrIQMHBcsC2TGEhuyABJdYkgSewL57PNLYEiibY2iPKhKpaA==}engines: {node: '>=20.19.0'}- resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==}-resolution: {integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==}@@ -5522,17 +5389,6 @@ packages:resolution: {integrity: sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==}engines: {node: '>=20.19.0'}- resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==}-resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==}engines: {node: '>=12'}@@ -5552,10 +5408,6 @@ packages:resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}engines: {node: '>=6'}- resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}- engines: {node: '>=10'}-resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}engines: {node: '>=4'}@@ -5564,12 +5416,6 @@ packages:resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}- resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}-- resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}-resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}engines: {node: '>=12.0.0'}@@ -5579,33 +5425,14 @@ packages:picomatch:optional: true- resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}- engines: {node: ^12.20 || >= 14.13}-resolution: {integrity: sha512-/yNdlIkpWbM0ptxno3ONTuf+2g318kh2ez3KSeZN5dZ8YC6AAmgeWz+GasYYiBJPFaYcSAPeu4GfhUaChzIJXA==}- resolution: {integrity: sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g==}-- resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}- engines: {node: '>=12.20.0'}-resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}os: [darwin]- resolution: {integrity: sha512-RB5vLV+vvQeoFPCX4QMK6/hjVkbIamPp1QSUD0CiZcnj12qbpiL+pLbYtgD+oZkWl0tl9z+o2Utp+MpM3QRhBA==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg==}- engines: {node: '>=18'}-resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}engines: {node: 6.* || 8.* || >= 10.*}@@ -5617,33 +5444,6 @@ packages:resolution: {integrity: sha512-yTb+8DXzDREzgvYmh6s9vHsSVCHeC0G3PI5bEXNBHtmshPnO+S5O7qgLEOn0I5QvMy6kpZN8K1NKGyilLb93wA==}- resolution: {integrity: sha512-r+mvuDjrjMpsdw46Kmeydb8bdHm7wOKw8wNBtTndkjbPjgAp5oUJUxRE76wZFknxIPokfWvep2qSXK37aXE6zg==}- hasBin: true-- resolution: {integrity: sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==}- engines: {node: '>=10.0'}-- resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-i1ydyHrqcIxXkWh/uBmVkzCvIuq5yiK2ATndIe5XxKholrG/MTYP9xGYka4sQhrbIAgGjL2B6NOE7rFaiF3fXw==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==}- engines: {node: '>=14'}-- resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}- engines: {node: '>= 0.4'}-- resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==}-resolution: {integrity: sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==}@@ -5666,52 +5466,13 @@ packages:resolution: {integrity: sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==}- resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==}- engines: {node: '>= 14'}-- resolution: {integrity: sha512-Y6+qLyEo5rwHfMJzPXLACDvV5QlGo0qs2BgVmq/Jn2pgWg+N9VXsF9drBXnIG7v5DpDvqGumCttfsv/tmq3ixQ==}- engines: {node: '>=22'}- hasBin: true-- resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}- engines: {node: '>= 4'}-- resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==}- engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}- hasBin: true-- resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==}- engines: {node: '>=14.16'}- hasBin: true-resolution: {integrity: sha512-oG7cgbmg5kLYae2N5IVd3jm2s+vldjxJzK1pcu9LfpGuQ93MQSzo0okvRna+7y5ifrD+20FE8FvjusyGaz14fw==}engines: {node: '>=18'}- resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==}- engines: {node: '>=16'}-resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}- resolution: {integrity: sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==}-- resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}-- resolution: {integrity: sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==}-- resolution: {integrity: sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==}-resolution: {integrity: sha512-0qE3lZ8jllRqPN4Ob6Ajl7c2bJSJDhQWuKLGP5hIEpHLllJWv1ydHFMhHmHc5p/W9GticKVDbYzZd7TBoQ4CZg==}@@ -5802,19 +5563,12 @@ packages:canvas:optional: true- resolution: {integrity: sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==}-resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}resolution: {integrity: sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==}- resolution: {integrity: sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==}- engines: {node: '>=10'}-resolution: {integrity: sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==}@@ -5833,17 +5587,9 @@ packages:resolution: {integrity: sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==}- resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==}- engines: {node: '>=16 || 14 >=14.17'}-resolution: {integrity: sha512-dqT2XBYUOZOiC5t2HRnwADjhNS2cecp9u+TJRiJ1Qp/f5qjkeT5APcGPjHw+bz89Ms8Jp+cG4AlE+QZ/QnDglg==}- resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==}- engines: {node: '>= 18'}-resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==}@@ -5855,9 +5601,6 @@ packages:resolution: {integrity: sha512-snEhs+6G5Tjd4I7tLCDOaoln2RgE0bD19RzEKgvgK2hZ5VKy3MpLhLTZ2fWpXSTg4K2cyPwp+VHATFJhxfnOeA==}engines: {node: '>=18.0.0'}- resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}-resolution: {integrity: sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==}engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}@@ -5868,44 +5611,13 @@ packages:engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}hasBin: true- resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}- engines: {node: '>=10.5.0'}- deprecated: Use your platform's native DOMException instead-- resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==}- engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}-resolution: {integrity: sha512-GX0gsdbGVCgnRgbeGaubfjpBXyYRWOOCVeYh08bSQvDZqxz5ndXs1OTfAt/h36G1xvI94YIspsI0sVFqAV9+RQ==}engines: {node: '>=20.19.0'}- resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}- engines: {node: '>= 0.4'}-resolution: {integrity: sha512-bUH8SDvPkH3ho3dvwJwfonjlQ4R80vjyvrU8YpxuROddv55vAEJrTuCuCVUhhsHbtlD9tGGbaNApGQckXhS8iQ==}- resolution: {integrity: sha512-E0q8+fMyJ+F8dvlwVsXcujrOc96lkPIDAZh3p6pjrZS4bzjowIcUMv48W5zOcFLtlWyycUlRPJWUUK2+3IL1eA==}-- resolution: {integrity: sha512-YThL/YYeGAeytecOvRcTKUORTIE2f8/iSo/JZgHFawWrV4zOY7fWLEaNuscgjmY5C5/VE/Wr7tm+ucSsc/AysQ==}- os: [win32, darwin, linux]-- resolution: {integrity: sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==}- engines: {node: '>=8'}-- resolution: {integrity: sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==}-resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==}@@ -5936,18 +5648,9 @@ packages:preact-render-to-string:optional: true- resolution: {integrity: sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==}- engines: {node: '>=14'}- hasBin: true-resolution: {integrity: sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==}- resolution: {integrity: sha512-/FPD0nUc9jH6rfFjji9IBqOz4pcSE3CsT1m7Ep6Mdb0LxSUMj8hgl6GomOvZzpNpAqqGaXA0P3VSrZLFzIhQrw==}- engines: {node: '>=12.0.0'}-resolution: {integrity: sha512-Hy5eMQshOEMil4JUUx03h5pw1HYkYCso1RG/gcpPlFSd4cYPOcopxcXEAxpLPOkOPJb9LIJtwxuj66bSdvknFg==}engines: {node: '>=22.12.0'}@@ -5977,20 +5680,9 @@ packages:resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==}- resolution: {integrity: sha512-gSfoiOEA0VPE6Tukkrr7I0RBdE0s7H1eFCDBk05l1KIQT1UIKNc5JZy6jdyW6eYH3aR3g5b3PuL77rq0hvwtAw==}-- resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==}- engines: {node: '>= 4'}-resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==}- resolution: {integrity: sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==}- engines: {node: '>=8.0'}-resolution: {integrity: sha512-g0EtLvBjTUB7jhyV0S/TCup3v/XSVl45vUIGbOGU4QPiyjTenCe4mKuFvW9fEgYmS2Fo42AUssRmNuMziXdrig==}engines: {node: ^20.19.0 || >=22.12.0}@@ -6008,28 +5700,14 @@ packages:engines: {node: '>=18.0.0', npm: '>=8.0.0'}hasBin: true- resolution: {integrity: sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==}-resolution: {integrity: sha512-RQPdCYTa8A68uM2jwxoY842xDhvx3E5LFL1LxvxCNMev4o5mLuokczhzjAgGwUZBAmOKZknArSxLKmXtIi2AxQ==}- resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==}-resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==}engines: {node: '>=10'}hasBin: true- resolution: {integrity: sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==}- engines: {node: '>=10'}-resolution: {integrity: sha512-n++8XWcj+jCOr2IOl7h8LbKnGBDY4aPbmprMONBNFdn0ImXqpGVv5zliDs0V9HbmbCQLpbuo2ej9rAoOQTvMDA==}engines: {node: '>=20.9.0'}@@ -6057,9 +5735,6 @@ packages:resolution: {integrity: sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==}engines: {node: '>=0.10.0'}- resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==}-resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==}engines: {node: '>=18'}@@ -6082,13 +5757,6 @@ packages:resolution: {integrity: sha512-wieBHXygIm7OyQOu5hQlkk62/WyCFYGlWg7L6/ZCUZwx0o398Zkn4pVmMyfYhfMG8kGrj/Krt8eIk6UKC6VzwA==}- resolution: {integrity: sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==}- engines: {node: '>=18'}-- resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==}-resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==}@@ -6107,10 +5775,6 @@ packages:engines: {node: '>=18.0.0'}hasBin: true- resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==}- engines: {node: '>=10'}-resolution: {integrity: sha512-EOPFbyIub4ngnEdqi2yOcNeDLaX/0jcE1JoAXQDDMIthap7FoN795lc/SHfIq2d416VufXpM8z/lD+WRm2gfOQ==}@@ -6125,12 +5789,6 @@ packages:resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}- resolution: {integrity: sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==}-- resolution: {integrity: sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==}-resolution: {integrity: sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==}@@ -6253,10 +5911,6 @@ packages:resolution: {integrity: sha512-r0CEmvpH63r4T15ebFqeOjGqU4+EgTx4I510NtK35EMciSdcTxCw3Byy3JnBonz7iyIFZ0AbVo0bbFpEVuhCYA==}hasBin: true- resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==}- engines: {node: '>= 8'}-resolution: {integrity: sha512-VSV+fzfChirL3e7jay2yUC7B4HQCGtEWEg/MSSQbK+qWbqeGlRLlXTzPpYr3XGUvbpDHumWZBJxgesg4N7dbtA==}@@ -6291,18 +5945,10 @@ packages:utf-8-validate:optional: true- resolution: {integrity: sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==}- engines: {node: '>=18'}-resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}engines: {node: '>=10'}- resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==}- engines: {node: '>=18'}-resolution: {integrity: sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==}engines: {node: ^20.19.0 || ^22.12.0 || >=23}@@ -7221,18 +6867,6 @@ snapshots:'@fontsource/[email protected]':optional: true- '@google/[email protected]':- dependencies:- google-auth-library: 10.9.1- p-retry: 4.6.2- protobufjs: 7.6.5- ws: 8.21.1- transitivePeerDependencies:- - bufferutil- - supports-color- - utf-8-validate- optional: true-'@hono/[email protected]([email protected])':dependencies:hono: 4.12.32@@ -7446,10 +7080,6 @@ snapshots:'@infolektuell/[email protected]':optional: true- '@isaacs/[email protected]':- dependencies:- minipass: 7.1.3-'@jridgewell/[email protected]': {}'@koromix/[email protected]':@@ -7511,35 +7141,6 @@ snapshots:'@oxc-project/[email protected]': {}- '@protobufjs/[email protected]':- optional: true-- '@protobufjs/[email protected]':- optional: true-- '@protobufjs/[email protected]':- optional: true-- '@protobufjs/[email protected]':- optional: true-- '@protobufjs/[email protected]':- dependencies:- '@protobufjs/aspromise': 1.1.2- optional: true-- '@protobufjs/[email protected]':- optional: true-- '@protobufjs/[email protected]':- optional: true-- '@protobufjs/[email protected]':- optional: true-- '@protobufjs/[email protected]':- optional: true-'@puppeteer/[email protected]':dependencies:modern-tar: 0.7.7@@ -7745,10 +7346,6 @@ snapshots:dependencies:tslib: 2.8.1- '@swc/[email protected]':- dependencies:- tslib: 2.8.1-'@types/[email protected]': {}'@types/[email protected]':@@ -7772,9 +7369,6 @@ snapshots:dependencies:undici-types: 7.16.0- '@types/[email protected]':- optional: true-'@types/[email protected]': {}'@types/[email protected]': {}@@ -7891,11 +7485,6 @@ snapshots:- [email protected]: {}-- optional: true-dependencies:'@algolia/abtesting': 1.22.0@@ -7923,40 +7512,20 @@ snapshots:dependencies:tslib: 2.8.1- [email protected]: {}-- optional: true-- [email protected]: {}-- dependencies:- base64-js: 1.5.1-- optional: true-- dependencies:- run-applescript: 7.1.0-- [email protected]: {}-dependencies:devtools-protocol: 0.0.1653615@@ -7969,8 +7538,6 @@ snapshots:mitt: 3.0.1zod: 3.25.76- [email protected]: {}-@@ -7979,14 +7546,10 @@ snapshots:strip-ansi: 7.2.0wrap-ansi: 9.0.2- [email protected]: {}-- [email protected]: {}-dependencies:is-what: 5.5.0@@ -8007,40 +7570,10 @@ snapshots:- optional: true-- dependencies:- ms: 2.1.3-- [email protected]: {}-- dependencies:- bundle-name: 4.1.0- default-browser-id: 5.0.1-- dependencies:- es-define-property: 1.0.1- es-errors: 1.3.0- gopd: 1.2.0-- [email protected]: {}-- dependencies:- define-data-property: 1.1.4- has-property-descriptors: 1.0.2- object-keys: 1.1.1-- [email protected]: {}-dependencies:dequal: 2.0.3@@ -8049,8 +7582,6 @@ snapshots:- [email protected]: {}-dependencies:domelementtype: 2.3.0@@ -8087,11 +7618,6 @@ snapshots:domelementtype: 3.0.0domhandler: 6.0.1- dependencies:- safe-buffer: 5.2.1- optional: true-@@ -8102,12 +7628,6 @@ snapshots:- [email protected]: {}-- [email protected]: {}-- [email protected]: {}-optionalDependencies:'@esbuild/aix-ppc64': 0.21.5@@ -8162,6 +7682,7 @@ snapshots:'@esbuild/win32-arm64': 0.25.12'@esbuild/win32-ia32': 0.25.12'@esbuild/win32-x64': 0.25.12+ optional: trueoptionalDependencies:@@ -8194,69 +7715,21 @@ snapshots:- [email protected]: {}-- optional: true-- [email protected]: {}-optionalDependencies:picomatch: 4.0.7- dependencies:- node-domexception: 1.0.0- web-streams-polyfill: 3.3.3- optional: true-dependencies:tabbable: 6.5.0- dependencies:- '@swc/helpers': 0.5.23- brotli: 1.3.3- clone: 2.1.2- dfa: 1.2.0- fast-deep-equal: 3.1.3- restructure: 3.0.2- tiny-inflate: 1.0.3- unicode-properties: 1.4.1- unicode-trie: 2.0.0-- dependencies:- fetch-blob: 3.2.0- optional: true-optional: true- dependencies:- extend: 3.0.2- https-proxy-agent: 7.0.6- node-fetch: 3.3.2- transitivePeerDependencies:- - supports-color- optional: true-- dependencies:- gaxios: 7.3.0- google-logging-utils: 1.1.3- json-bigint: 1.0.0- transitivePeerDependencies:- - supports-color- optional: true-@@ -8265,43 +7738,6 @@ snapshots:dependencies:resolve-pkg-maps: 1.0.0- [email protected]: {}-- dependencies:- boolean: 3.2.0- es6-error: 4.1.1- matcher: 3.0.0- roarr: 2.15.4- semver: 7.8.5- serialize-error: 7.0.1-- dependencies:- define-properties: 1.2.1- gopd: 1.2.0-- dependencies:- base64-js: 1.5.1- ecdsa-sig-formatter: 1.0.11- gaxios: 7.3.0- gcp-metadata: 8.1.2- google-logging-utils: 1.1.3- jws: 4.0.1- transitivePeerDependencies:- - supports-color- optional: true-- optional: true-- [email protected]: {}-- dependencies:- es-define-property: 1.0.1-dependencies:'@types/hast': 3.0.5@@ -8335,81 +7771,11 @@ snapshots:domutils: 3.2.2entities: 7.0.1- dependencies:- agent-base: 7.1.4- debug: 4.4.3- transitivePeerDependencies:- - supports-color- optional: true-- [email protected](@types/[email protected]):- dependencies:- '@hono/node-server': 2.0.12([email protected])- '@puppeteer/browsers': 3.1.0- adm-zip: 0.6.0- citty: 0.2.2- compare-versions: 6.1.1- debug: 4.4.3- esbuild: 0.25.12- fontkit: 2.0.4- giget: 3.3.1- hono: 4.12.32- ignore: 5.3.2- onnxruntime-node: 1.21.1- open: 10.2.0- postcss: 8.5.25- prettier: 3.9.6- puppeteer-core: 25.5.0- sharp: 0.35.4(@types/[email protected])- optionalDependencies:- '@google/genai': 1.52.0- transitivePeerDependencies:- - '@modelcontextprotocol/sdk'- - '@types/node'- - bufferutil- - proxy-agent- - supports-color- - utf-8-validate- - yauzl-- [email protected]: {}-- [email protected]: {}-- dependencies:- is-docker: 3.0.0-- dependencies:- is-inside-container: 1.0.0-optional: true- dependencies:- bignumber.js: 9.3.1- optional: true-- [email protected]: {}-- dependencies:- buffer-equal-constant-time: 1.0.1- ecdsa-sig-formatter: 1.0.11- safe-buffer: 5.2.1- optional: true-- dependencies:- jwa: 2.0.1- safe-buffer: 5.2.1- optional: true-optionalDependencies:'@koromix/koffi-android-arm64': 3.2.1@@ -8490,19 +7856,12 @@ snapshots:htmlparser2: 10.1.0uhyphen: 0.2.0- optional: true-dependencies:'@jridgewell/sourcemap-codec': 1.5.5- dependencies:- escape-string-regexp: 4.0.0-dependencies:'@types/hast': 3.0.5@@ -8532,71 +7891,28 @@ snapshots:- [email protected]: {}-- dependencies:- minipass: 7.1.3-- [email protected]: {}-- optional: true-- dependencies:- data-uri-to-buffer: 4.0.1- fetch-blob: 3.2.0- formdata-polyfill: 4.0.10- optional: true-dependencies:boolbase: 2.0.0- [email protected]: {}-dependencies:emoji-regex-xs: 1.0.0regex: 6.1.0regex-recursion: 6.0.2- [email protected]: {}-- dependencies:- global-agent: 3.0.0- onnxruntime-common: 1.21.1- tar: 7.5.22-- dependencies:- default-browser: 5.5.0- define-lazy-prop: 3.0.0- is-inside-container: 1.0.0- wsl-utils: 0.1.0-- dependencies:- '@types/retry': 0.12.0- retry: 0.13.1- optional: true-- [email protected]: {}-@@ -8622,25 +7938,8 @@ snapshots:- [email protected]: {}-- dependencies:- '@protobufjs/aspromise': 1.1.2- '@protobufjs/base64': 1.1.2- '@protobufjs/codegen': 2.0.5- '@protobufjs/eventemitter': 1.1.1- '@protobufjs/fetch': 1.1.1- '@protobufjs/float': 1.0.2- '@protobufjs/path': 1.1.2- '@protobufjs/pool': 1.1.0- '@protobufjs/utf8': 1.1.2- '@types/node': 24.10.1- long: 5.3.2- optional: true-dependencies:'@puppeteer/browsers': 3.2.2@@ -8703,22 +8002,8 @@ snapshots:- [email protected]: {}-- optional: true-- dependencies:- boolean: 3.2.0- detect-node: 2.1.0- globalthis: 1.0.4- json-stringify-safe: 5.0.1- semver-compare: 1.0.0- sprintf-js: 1.1.3-dependencies:'@oxc-project/types': 0.148.0@@ -8780,21 +8065,10 @@ snapshots:'@rollup/rollup-win32-x64-msvc': 4.62.4fsevents: 2.3.3- [email protected]: {}-- optional: true-- [email protected]: {}-- dependencies:- type-fest: 0.13.1-[email protected](@types/[email protected]):dependencies:'@img/colour': 1.1.0@@ -8847,8 +8121,6 @@ snapshots:- [email protected]: {}-dependencies:emoji-regex: 10.6.0@@ -8875,16 +8147,6 @@ snapshots:- dependencies:- '@isaacs/fs-minipass': 4.0.1- chownr: 3.0.0- minipass: 7.1.3- minizlib: 3.1.0- yallist: 5.0.0-- [email protected]: {}-@@ -8903,8 +8165,6 @@ snapshots:optionalDependencies:fsevents: 2.3.3- [email protected]: {}-@@ -8913,16 +8173,6 @@ snapshots:- dependencies:- base64-js: 1.5.1- unicode-trie: 2.0.0-- dependencies:- pako: 0.2.9- tiny-inflate: 1.0.3-dependencies:'@types/unist': 3.0.3@@ -9045,9 +8295,6 @@ snapshots:dependencies:argparse: 2.0.1- optional: true-@@ -9062,14 +8309,8 @@ snapshots:- dependencies:- is-wsl: 3.1.1-- [email protected]: {}-diff --git a/scripts/check-distribution.mjs b/scripts/check-distribution.mjsindex c294868b..8fc8b6cb 100644--- a/scripts/check-distribution.mjs+++ b/scripts/check-distribution.mjs@@ -1,6 +1,6 @@import assert from "node:assert/strict";import { spawn } from "node:child_process";-import { cp, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";+import { cp, mkdir, mkdtemp, readFile, readdir, rm, writeFile } from "node:fs/promises";import { tmpdir } from "node:os";import { join, resolve } from "node:path";@@ -14,13 +14,19 @@ const root = await mkdtemp(join(tmpdir(), "hypit-distribution-"));const project = join(root, "project");await mkdir(project);const env = { ...process.env, HYPIT_STATE_HOME: join(root, "state") };-// A caller's checkout resolver must not select sources outside this installation.-delete env.HYPIT_DISTRIBUTION_ROOT;-delete env.HYPIT_CLI_LAUNCHER;+// Old shell hints must not redirect the installed launcher, Worker or capture child.+env.HYPIT_DISTRIBUTION_ROOT = join(root, "stale-distribution");+env.HYPIT_CLI_LAUNCHER = join(root, "stale-distribution", "bin", "hypit.mjs");delete env.NODE_PATH;delete env.NODE_OPTIONS;+delete env.HYPERFRAMES_BROWSER_PATH;+delete env.PRODUCER_HEADLESS_SHELL_PATH;+// The selected Provider's installation declaration, not this test's environment,+// must suppress Puppeteer's transitive browser download.+delete env.PUPPETEER_SKIP_DOWNLOAD;+env.PUPPETEER_CACHE_DIR = join(root, "unselected-puppeteer-cache");-function run(command, args, capture = false) {+function run(command, args, capture = false, expectedCode = 0) {console.log(`> ${command} ${args.join(" ")}`);return new Promise((resolveRun, reject) => {const child = spawn(command, args, { cwd: project, env, windowsHide: true,@@ -29,14 +35,14 @@ function run(command, args, capture = false) {child.stdout?.setEncoding("utf8").on("data", (text) => { stdout += text; });child.once("error", reject);child.once("close", (code, signal) => {- if (code === 0) resolveRun(stdout);+ if (code === expectedCode) resolveRun(stdout);else reject(new Error(`${command} ${args[0]} failed (${signal ?? code})${stdout ? `\n${stdout}` : ""}`));});});}const npm = (...args) => run(process.execPath, [npmCli, ...args]);const distribution = join(project, "node_modules", "@hypit", "hypit");-const hypit = (args, capture = false) => run(process.execPath, [join(distribution, "bin", "hypit.mjs"), ...args], capture);+const hypit = (args, capture = false, expectedCode = 0) => run(process.execPath, [join(distribution, "bin", "hypit.mjs"), ...args], capture, expectedCode);const scope = ["--workspace", project, "--runtime", join(project, "hypit.runtime.json")];let runtimeStarted = false;let passed = false;@@ -65,11 +71,18 @@ try {const profilePath = join(project, "hypit.runtime.json");const profile = JSON.parse(await readFile(profilePath, "utf8"));profile.endpoints["hyperframes.local"].config.browserGpu = "software";+ profile.endpoints["hyperframes.local"].config.browserCacheDirectory = join(root, "render-browser");await writeFile(profilePath, JSON.stringify(profile, null, 2));await hypit(["packages", "install", "@fontsource-variable/[email protected]"]);await hypit(["check", "chat.svml", "--workspace", project]);+ const missingBrowser = await hypit(["doctor", ...scope, "--json"], true, 1);+ assert.match(missingBrowser, /Render browser is unavailable/u);runtimeStarted = true;await hypit(["runtime", "up", ...scope]);+ assert.deepEqual(await readdir(env.PUPPETEER_CACHE_DIR).catch(error => {+ if (error.code === "ENOENT") return []; throw error;+ }), [], "npm dependencies must not download an unselected Puppeteer browser");+ await hypit(["doctor", ...scope]);const result = JSON.parse(await hypit(["build", "chat.svrun", ...scope, "--follow", "--max-wait-ms", "180000", "--json"], true));assert.equal(result.build.work.outcome, "complete", JSON.stringify(result));const output = join(project, "chat.mp4");diff --git a/skills/hypit/SKILL.md b/skills/hypit/SKILL.mdindex b1b96114..0d4fa5d5 100644--- a/skills/hypit/SKILL.md+++ b/skills/hypit/SKILL.md@@ -249,7 +249,7 @@ practical, revisit that choice and carry the improvement into the work and its n| locating the active `hypit`, working in a remote Agent environment, or checking and updating the executable and Skill through their own channels | `references/environment/distribution.md` || what this machine can do, credentials, Model/Provider/Endpoint choices or shared capacity | `references/environment/profile.md` || explaining model-service costs, using HypiHub, the user's API or model deployment, or making a project Model/Provider extension | `references/environment/model-and-provider.md` |-| assessing local WhisperX preparation, installing local tools, or repairing a Managed Program | `references/environment/local-tools.md` |+| preparing local WhisperX or a render browser, choosing a browser download source, installing local tools, or repairing a Managed Program | `references/environment/local-tools.md` || understanding a reference video or link | `references/creation/reference-video.md` || defining the target: what the user asked for, and what the new piece will be | `references/creation/brief.md` || cloning with supplied faces or products, changing the Script, language, length, or combining references | `references/creation/transformations.md` |diff --git a/skills/hypit/references/environment/local-tools.md b/skills/hypit/references/environment/local-tools.mdindex 035e300b..e525a0eb 100644--- a/skills/hypit/references/environment/local-tools.md+++ b/skills/hypit/references/environment/local-tools.md@@ -106,6 +106,39 @@ Ordinary projects use these declarations instead of running a service's internalentry point by hand. Contributor/operator commands in a service README are for diagnosing thatpackaged service, not for creating a second project-local installation.+## Prepare the local rendering browser++The selected HyperFrames Provider owns the browser used for rendering. Read the installed+`@hypit/provider-hyperframes-local` README for the configuration supported by that installation;+a newer Skill does not add options to an older executable. [Distribution updates](distribution.md#check-and-update-the-relevant-installation)+explains how to check and update the relevant installation when a needed option is absent.++For ordinary local rendering, use the Provider release's recommended browser. Prepare the selected+instance explicitly, substituting its actual Profile path and Endpoint name:++```bash+hypit programs up --runtime <profile> --endpoint <render-instance>+hypit doctor --runtime <profile>+```++`runtime up` also prepares selected Programs and starts the Worker. Package installation alone does+not prepare the browser. `doctor` and Build preflight inspect the selected executable without+downloading it; a system Chrome installation does not establish that the selected browser is ready.+If using an existing browser is an intentional deployment choice, select it with `config.chromePath`.+Use `config.browserVersion` for an explicit managed version when needed. These are alternative+choices; consult the Provider README for supported values and combinations. Browser environment+hints and cached alternatives do not override that selection.++When the browser download is blocked, choose a compatible source through the Provider's+`config.browserDownloadBaseUrl`; an npm registry mirror does not redirect browser archives.+Check the archive URL, selected version and destination shown by preparation. A failed selected+mirror reports failure without trying another source. Changing the source preserves a healthy+cached installation. Use [network preparation](#make-network-preparation-practical) to distinguish+an unavailable archive from a network problem and choose a route within the user's existing scope.+After changing Profile or package dependencies, restart an active Worker explicitly when existing+work permits so it loads the new selection. Browser readiness is not a promise that every GPU or+page will render; investigate an actual capture failure through its render diagnostics.+## Select local WhisperX explicitlyLocal and hosted WhisperX implement the same alignment capability. When local execution is chosen,@@ -183,7 +216,8 @@ Mirrors address particular download clients and hosts:| Python packages | pip uses `--index-url` / `PIP_INDEX_URL`; uv uses `--default-index` / `UV_DEFAULT_INDEX`. They are different clients. Hypit's managed service uses frozen uv dependencies; consult its Provider README before expecting an index change to redirect locked artifact URLs. || Python runtime | uv's `UV_PYTHON_INSTALL_MIRROR` selects a compatible Python-distribution mirror. A PyPI mirror does not supply Python itself. An already compatible installed Python may avoid this download. || Hugging Face weights | `HF_ENDPOINT` selects a compatible Hub endpoint; `HF_HOME` / `HF_HUB_CACHE` select reusable cache locations. A model's redirected weight host and its language-alignment download must also be reachable. |-| FFmpeg, browser and other binaries | Use the selected package manager's binary-download settings or a compatible official prebuilt installation. An npm/PyPI mirror does not generally redirect these downloads. Homebrew bottles, browser archives and GitHub release assets have their own sources. |+| HyperFrames browser | The selected Provider owns the archive source; follow [browser preparation](#prepare-the-local-rendering-browser) and its installed README. |+| FFmpeg and other binaries | Use the selected package manager's binary-download settings or a compatible official prebuilt installation. An npm/PyPI mirror does not generally redirect these downloads. Homebrew bottles and GitHub release assets have their own sources. |Make a route change explicit: explain the blocked download, the proposed source and which commandor service will use it. Use a mirror the user or organization trusts, with settings scoped to thediff --git a/skills/hypit/references/production/component-visuals.md b/skills/hypit/references/production/component-visuals.mdindex 9c1b0814..bbd64f0a 100644--- a/skills/hypit/references/production/component-visuals.md+++ b/skills/hypit/references/production/component-visuals.md@@ -95,7 +95,7 @@ When a scene's video viewport and graphics share motion or layout, one componenttogether. `browserProgram` from `@hypit/hypit/hyperframes` creates a `program` element's payload. Its HTMLowns the local structure; CSS supplies layout, stacking, masks, filters and blending; optional`setup(root, data)` code returns `render(localFrame)`. This function sets the complete state at that-frame. A range render may start in the middle, so compute state from the frame and authored inputs.+frame synchronously. A range render may start in the middle, so compute state from the frame and authored inputs.Prepare stable structure in `setup`: locate elements, construct geometry and retain reusable drawingobjects there. Paint static procedural textures once their resources are ready.@@ -104,6 +104,11 @@ fast repeated capture and direct seeking. A program is sampled within its Presenoutside it, the renderer may retain the boundary pose. Re-entry and repeated active seeks mustproduce the complete requested state, including when an image became ready since the last call.+Repeated browser-program instances share one document's HTML/SVG ID space even though their CSS+is scoped. For SVG masks, gradients or filters, derive each required ID from `root.id` in `setup`+and update its references together. The installed `@hypit/hyperframes` README owns the browser-program+API and resource-loading behavior.+For a depth or material effect, choose the representation that carries its visible behavior:CSS can tilt a panel, while a deforming textured surface may warrant mesh geometry and Canvas orWebGL drawing. Keep that implementation inside the project component; give Source the usefuldiff --git a/skills/hypit/references/production/rendering.md b/skills/hypit/references/production/rendering.mdindex 4b664442..e6d0de99 100644--- a/skills/hypit/references/production/rendering.md+++ b/skills/hypit/references/production/rendering.md@@ -104,6 +104,10 @@ HyperFrames compiles the selected composition and renders its picture. Timelinefrom the included AudioTracks, then picture and sound are muxed into the delivered file. A Runtimecan bind these capabilities to different compatible Endpoints.+Before the first local render, or when browser startup reports a missing executable, follow+[browser preparation](../environment/local-tools.md#prepare-the-local-rendering-browser).+That selected Provider owns browser installation and download configuration.+For the local HyperFrames Provider, `workers` selects independent Chrome processes within one render.They share the staged document and decoded source frames, capture different parts of the selectedinterval, and produce one encoded result. Prefer `workers: "auto"` for ordinary local rendering;@@ -126,6 +130,9 @@ While rendering, communicate the current phase and meaningful progress. The Provdecoding, browser startup, capture, encoding and storage; `hypit logs <build-id>` preserves theirtimings and execution details when a slow or failed stage needs investigation.+Image decode and declared-font loading failures stop capture with an error. Repair the named+resource in its owning Source or component, then retry with accepted media retained in the Run.+A local render timeout ends that execution attempt and releases capacity after its work has stopped.Its failure and already completed Outputs belong to the Build Result. Continue through a new Runand Build that explicitly reuse the available media, as described in [Runs](runs.md).