From 581a43bb6a23e991ec0162714a1155226d12df65 Mon Sep 17 00:00:00 2001 From: James Russo Date: Tue, 17 Nov 2026 02:38:22 +0000 Subject: [PATCH] fix(producer): local renders leave out scripts from outside the project unless included (#7998) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A local render brought in .js and .mjs files that markup or a project link reached outside the project, so an imported composition could copy a script from elsewhere on disk into the page it runs and read it. Images, video, audio, fonts and CSS still come in. Scripts are left out with a warning that names each one and how to include it: move it into the project, or pass the new --include-outside-files to hyperframes render. The policy covers the compiler's outside-asset copy, the file server's linked files and the distributed plan's project copy. — Rames Co-authored-by: Claude Opus 5.5 --- docs/packages/cli.mdx | 8 +++ packages/cli/src/commands/render.ts | 23 ++++++- packages/cli/src/commands/render/execute.ts | 2 + packages/cli/src/commands/render/plan.test.ts | 6 ++ packages/cli/src/commands/render/plan.ts | 3 + packages/cli/src/utils/publishProject.ts | 2 +- packages/producer/src/renderRequest.ts | 7 ++- .../producer/src/services/distributed/plan.ts | 13 +++- .../src/services/distributed/renderSpan.ts | 8 ++- .../src/services/distributed/shared.ts | 2 + packages/producer/src/services/fileServer.ts | 5 +- .../producer/src/services/htmlCompiler.ts | 6 +- .../src/services/outsideProjectAssets.test.ts | 62 ++++++++++++++++++- .../services/render/stages/compileStage.ts | 1 + .../src/services/render/stages/probeStage.ts | 1 + .../src/services/renderOrchestrator.ts | 2 + packages/producer/src/utils/paths.ts | 25 ++++++-- .../studio-server/src/helpers/outsideFile.ts | 15 ++++- 18 files changed, 171 insertions(+), 20 deletions(-) diff --git a/docs/packages/cli.mdx b/docs/packages/cli.mdx index 15b6b54de4..0d479c04f9 100644 --- a/docs/packages/cli.mdx +++ b/docs/packages/cli.mdx @@ -1953,11 +1953,19 @@ How it uses the machine, and when it gives up: | `--wait` / `--no-wait` | on | One local render at a time per user account: wait while another runs, or fail at once. Env: `HYPERFRAMES_RENDER_LOCK=off` renders side by side. | | `--strict` / `--strict-all` | off | Fail on lint errors, or on errors and warnings | | `--strict-variables` | off | Fail rather than warn on an undeclared or mistyped variable key | +| `--include-outside-files` | off | Also run `.js` and `.mjs` scripts the project references from outside its folder. See the note below. | | `--batch-concurrency` / `--batch-fail-fast` | `1` / off | Batch rows at once, and whether the first failure stops the rest | | `--debug` | off | Keep intermediates and write diagnostics under the Producer `.debug` directory | | `--quiet` | off | Less output | | `--skill` | — | Record which authoring workflow started this render, in usage telemetry | +A local render brings in images, video, audio, fonts and CSS that the project +references from outside its folder. It leaves out scripts from outside the +folder, warning with each one's name, because a script runs in the render's +browser and can read and send anything the render can reach. Move a script you +trust into the project, or pass `--include-outside-files` to run it where it is. +A composition that needs the left-out script stops with a script-load error. + Renders started side by side starve each other of CPU and GPU until frames stop landing, so a second local or `--docker` render from the same user account waits for the first and says which render it is waiting for (pid and project). The diff --git a/packages/cli/src/commands/render.ts b/packages/cli/src/commands/render.ts index d72083ad0e..ace35967ae 100644 --- a/packages/cli/src/commands/render.ts +++ b/packages/cli/src/commands/render.ts @@ -348,6 +348,13 @@ export default defineCommand({ description: "Fail render on lint errors", default: false, }, + "include-outside-files": { + type: "boolean", + description: + "Also run .js and .mjs scripts the project references from outside its folder. Without it they are left out " + + "with a warning; images, video, audio, fonts and CSS outside the folder are always included.", + default: false, + }, "strict-all": { type: "boolean", description: "Fail render on lint errors AND warnings", @@ -585,6 +592,8 @@ export interface RenderOptions { /** Segmented capture: keep the segment directory after success. */ keepSegments?: boolean; bestEffort?: boolean; + /** --include-outside-files: run scripts the project references from outside its folder. */ + includeOutsideScripts?: boolean; browserPath?: string; variables?: Record; entryFile?: string; @@ -1155,6 +1164,7 @@ async function executeLocalRender( const allowOutsideProjectAssets = outsideAssetsAllowed(projectDir, options.entryFile, (line) => console.warn(c.warn(` ${line}`)), ); + const includeOutsideScripts = options.includeOutsideScripts === true; const deParallelRouterActive = options.manageDeParallelRouterBreaker === true ? applyDeParallelRouterCircuitBreaker(options.quiet) @@ -1235,10 +1245,15 @@ async function executeLocalRender( cpu, signal: cancellation.signal, allowOutsideProjectAssets, + includeOutsideScripts, }); } const job = producer.createRenderJob( - producer.renderConfigFromRequest(request, { logger, allowOutsideProjectAssets }), + producer.renderConfigFromRequest(request, { + logger, + allowOutsideProjectAssets, + includeOutsideScripts, + }), ); const onProgress = options.quiet @@ -1357,6 +1372,7 @@ async function renderRange(input: { cpu: RenderCpuSampler; signal: AbortSignal; allowOutsideProjectAssets: boolean; + includeOutsideScripts: boolean; }): Promise { const { producer, options } = input; let framesEncoded = 0; @@ -1371,7 +1387,10 @@ async function renderRange(input: { config, input.range, input.outputPath, - { allowOutsideProjectAssets: input.allowOutsideProjectAssets }, + { + allowOutsideProjectAssets: input.allowOutsideProjectAssets, + includeOutsideScripts: input.includeOutsideScripts, + }, ); framesEncoded = spanResult.framesEncoded; reference = producer.referenceBackgroundResult(spanResult[producer.REFERENCE_BACKGROUND_FIELD]); diff --git a/packages/cli/src/commands/render/execute.ts b/packages/cli/src/commands/render/execute.ts index 3da41b8893..e61a727343 100644 --- a/packages/cli/src/commands/render/execute.ts +++ b/packages/cli/src/commands/render/execute.ts @@ -206,6 +206,7 @@ export function renderOptionsFromPlan( resumeSegments: plan.resumeSegments, keepSegments: plan.keepSegments, bestEffort: plan.bestEffort, + includeOutsideScripts: plan.includeOutsideScripts, variables, entryFile: plan.entryFile, outputResolution: plan.outputResolution, @@ -425,6 +426,7 @@ export function batchRowRenderOptions( resumeSegments: plan.resumeSegments, keepSegments: plan.keepSegments, bestEffort: plan.bestEffort, + includeOutsideScripts: plan.includeOutsideScripts, exitAfterComplete: false, throwOnError: true, skipFeedback: true, diff --git a/packages/cli/src/commands/render/plan.test.ts b/packages/cli/src/commands/render/plan.test.ts index e950a798f9..1baa02344a 100644 --- a/packages/cli/src/commands/render/plan.test.ts +++ b/packages/cli/src/commands/render/plan.test.ts @@ -127,6 +127,12 @@ describe("createRenderPlan", () => { expect(plan.bestEffort).toBe(false); }); + it("runs outside scripts only with --include-outside-files", () => { + expect(createRenderPlan({ dir: projectDir }).includeOutsideScripts).toBe(false); + const included = createRenderPlan({ dir: projectDir, "include-outside-files": true }); + expect(included.includeOutsideScripts).toBe(true); + }); + it.each([undefined, "off"])("preserves page motion blur override %s", (value) => { expect(createRenderPlan({ dir: projectDir, "page-motion-blur": value }).pageMotionBlur).toBe( value, diff --git a/packages/cli/src/commands/render/plan.ts b/packages/cli/src/commands/render/plan.ts index 4054375e42..751f583914 100644 --- a/packages/cli/src/commands/render/plan.ts +++ b/packages/cli/src/commands/render/plan.ts @@ -104,6 +104,7 @@ export interface RenderCommandArgs { wait?: boolean; strict?: boolean; "strict-all"?: boolean; + "include-outside-files"?: boolean; "lint-verbose"?: boolean; "max-concurrent-renders"?: string; variables?: string; @@ -168,6 +169,7 @@ export interface RenderPlan { /** Segmented capture: keep the segment directory after success. */ keepSegments: boolean; bestEffort: boolean; + includeOutsideScripts: boolean; waitForRenderSlot: boolean; batchJson: boolean; effectiveQuiet: boolean; @@ -671,6 +673,7 @@ export function createRenderPlan(args: RenderCommandArgs, now = new Date()): Ren resumeSegments: args.resume ?? false, keepSegments: args["keep-segments"] ?? false, bestEffort: args["best-effort"] ?? true, + includeOutsideScripts: args["include-outside-files"] ?? false, waitForRenderSlot: args.wait ?? true, batchJson, effectiveQuiet: quiet || batchJson, diff --git a/packages/cli/src/utils/publishProject.ts b/packages/cli/src/utils/publishProject.ts index e4119ecd7a..3783d3f402 100644 --- a/packages/cli/src/utils/publishProject.ts +++ b/packages/cli/src/utils/publishProject.ts @@ -860,7 +860,7 @@ function composeNamesInText(fileContents: Map, filePaths: st } } -type WalkedLeftOutReason = Exclude; +type WalkedLeftOutReason = Exclude; const WALKED_LEFT_OUT: Record = { private: diff --git a/packages/producer/src/renderRequest.ts b/packages/producer/src/renderRequest.ts index 8ac52fce94..6e1fcb806a 100644 --- a/packages/producer/src/renderRequest.ts +++ b/packages/producer/src/renderRequest.ts @@ -285,7 +285,11 @@ export function createRenderRequest(input: CreateRenderRequestInput): RenderRequ export function renderConfigFromRequest( request: RenderRequest, - runtime: { logger?: ProducerLogger; allowOutsideProjectAssets?: boolean } = {}, + runtime: { + logger?: ProducerLogger; + allowOutsideProjectAssets?: boolean; + includeOutsideScripts?: boolean; + } = {}, ): RenderConfig { const { engineConfig, distributed: _distributed, ...options } = request.options; return { @@ -293,6 +297,7 @@ export function renderConfigFromRequest( producerConfig: engineConfig, logger: runtime.logger, allowOutsideProjectAssets: runtime.allowOutsideProjectAssets === true, + includeOutsideScripts: runtime.includeOutsideScripts === true, }; } diff --git a/packages/producer/src/services/distributed/plan.ts b/packages/producer/src/services/distributed/plan.ts index 8023fa48ca..f27b0cf930 100644 --- a/packages/producer/src/services/distributed/plan.ts +++ b/packages/producer/src/services/distributed/plan.ts @@ -358,6 +358,7 @@ export interface BuildLocalExecutionPlanOptions { readonly deferAudio?: boolean; /** Trusted local callers only; see CompileForRenderOptions. Never read from config. */ readonly allowOutsideProjectAssets?: boolean; + readonly includeOutsideScripts?: boolean; } export interface RemoteProjectFile { @@ -1202,7 +1203,10 @@ async function compilePlanComposition( planDir: string, options: Pick< BuildLocalExecutionPlanOptions, - "executionPlanSizeLimitBytes" | "remoteFiles" | "allowOutsideProjectAssets" + | "executionPlanSizeLimitBytes" + | "remoteFiles" + | "allowOutsideProjectAssets" + | "includeOutsideScripts" >, ) { // Plan-time validation. Rejections here surface as typed errors with @@ -1250,6 +1254,7 @@ async function compilePlanComposition( strictVariables: config.strictVariables, pageMotionBlur: config.pageMotionBlur, allowOutsideProjectAssets: options.allowOutsideProjectAssets === true, + includeOutsideScripts: options.includeOutsideScripts === true, }); const entryFile = config.entryFile ?? "index.html"; const htmlPath = join(projectDir, entryFile); @@ -1286,7 +1291,9 @@ async function compilePlanComposition( if (rel === "") return true; if (leavesRoot(rel)) return false; if (job.config.allowOutsideProjectAssets) { - if (refusesOutsideLink(projectDir, src, (line) => log.warn(`[Plan] ${line}`))) return false; + const warn = (line: string) => log.warn(`[Plan] ${line}`); + const policy = { includeScripts: job.config.includeOutsideScripts }; + if (refusesOutsideLink(projectDir, src, warn, policy)) return false; } else if (!isSafePath(projectDir, src)) return false; const firstSegment = rel.split(sep, 1)[0]; return firstSegment === undefined || !PLAN_PROJECT_DIR_SKIP_SEGMENTS.has(firstSegment); @@ -1915,7 +1922,7 @@ export async function plan( planDir: string, options: Pick< BuildLocalExecutionPlanOptions, - "chunksCarryAudio" | "allowOutsideProjectAssets" + "chunksCarryAudio" | "allowOutsideProjectAssets" | "includeOutsideScripts" > = {}, ): Promise { const executionPlan = await buildLocalExecutionPlan(projectDir, config, planDir, options); diff --git a/packages/producer/src/services/distributed/renderSpan.ts b/packages/producer/src/services/distributed/renderSpan.ts index f501a6b547..79c95dfcc3 100644 --- a/packages/producer/src/services/distributed/renderSpan.ts +++ b/packages/producer/src/services/distributed/renderSpan.ts @@ -55,7 +55,7 @@ export async function renderSpan( config: DistributedRenderConfig, span: { startSeconds: number; endSeconds?: number }, outputPath: string, - options: { allowOutsideProjectAssets?: boolean } = {}, + options: { allowOutsideProjectAssets?: boolean; includeOutsideScripts?: boolean } = {}, ): Promise { if (config.format !== "mp4") { throw new RenderSpanUnsupportedError( @@ -75,7 +75,11 @@ export async function renderSpan( projectDir, { ...config, rejectOnSystemFonts: false, failClosedFontFetch: false }, planDir, - { chunksCarryAudio: true, allowOutsideProjectAssets: options.allowOutsideProjectAssets }, + { + chunksCarryAudio: true, + allowOutsideProjectAssets: options.allowOutsideProjectAssets, + includeOutsideScripts: options.includeOutsideScripts, + }, ); const { startFrame, endFrame } = spanFrameRange( span.startSeconds, diff --git a/packages/producer/src/services/distributed/shared.ts b/packages/producer/src/services/distributed/shared.ts index 0768dd4a55..bb265f154a 100644 --- a/packages/producer/src/services/distributed/shared.ts +++ b/packages/producer/src/services/distributed/shared.ts @@ -447,6 +447,7 @@ export interface SyntheticRenderJobInput { strictVariables?: RenderConfig["strictVariables"]; pageMotionBlur?: RenderConfig["pageMotionBlur"]; allowOutsideProjectAssets?: boolean; + includeOutsideScripts?: boolean; } /** @@ -477,6 +478,7 @@ export function buildSyntheticRenderJob(input: SyntheticRenderJobInput): RenderJ strictVariables: input.strictVariables, pageMotionBlur: input.pageMotionBlur, allowOutsideProjectAssets: input.allowOutsideProjectAssets, + includeOutsideScripts: input.includeOutsideScripts, }; return createRenderJob(renderConfig); } diff --git a/packages/producer/src/services/fileServer.ts b/packages/producer/src/services/fileServer.ts index 9dc44a9079..cfadc39bbc 100644 --- a/packages/producer/src/services/fileServer.ts +++ b/packages/producer/src/services/fileServer.ts @@ -724,6 +724,7 @@ export interface FileServerOptions { stripEmbeddedRuntime?: boolean; /** Serve project symlinks that lead outside projectDir, as local preview does. Default: false. */ allowOutsideProjectAssets?: boolean; + includeOutsideScripts?: boolean; } export interface FileServerHandle { @@ -802,6 +803,7 @@ export function createFileServer(options: FileServerOptions): Promise console.warn(`[FileServer] ${terminalText(line)}`); + const outsidePolicy = { includeScripts: includeOutsideScripts }; let listeningPort = -1; app.use(async function loadEachFileOnlyAsItsNamedType(c, next) { @@ -845,7 +848,7 @@ export function createFileServer(options: FileServerOptions): Promise } { const absProjectDir = resolve(projectDir); const externalAssets = new Map(); @@ -1492,7 +1494,7 @@ export function collectExternalAssets( } const onShare = namesAnotherNetworkRoot(absProjectDir, absPath); if (!onShare && !existsSync(absPath)) return null; - const refusal = onShare ? "network_share" : outsideAssetRefusal(absProjectDir, absPath); + const refusal = onShare ? "network_share" : outsideAssetRefusal(absProjectDir, absPath, policy); if (refusal) { if (!leftOut.has(trimmed)) log.warn(`[Compiler] ${leftOutOfRender(file, trimmed, refusal)}`); leftOut.add(trimmed); @@ -2109,6 +2111,7 @@ export interface CompileForRenderOptions { pageMotionBlur?: "off"; /** Trusted local renders only (CLI, Studio): import files markup reaches outside projectDir. */ allowOutsideProjectAssets?: boolean; + includeOutsideScripts?: boolean; } /** Renders follow the same `HYPERFRAMES_GSAP_BASE_URL` mirror as Studio preview. */ @@ -2411,6 +2414,7 @@ export async function compileForRender( projectDir, options.log, entryFileName(projectDir, htmlPath), + { includeScripts: options.includeOutsideScripts }, ) : { html: embeddedHtml, externalAssets: new Map() }; diff --git a/packages/producer/src/services/outsideProjectAssets.test.ts b/packages/producer/src/services/outsideProjectAssets.test.ts index 15e7512ee4..f23294e69b 100644 --- a/packages/producer/src/services/outsideProjectAssets.test.ts +++ b/packages/producer/src/services/outsideProjectAssets.test.ts @@ -147,7 +147,11 @@ async function statusOf( } } -async function compileInProcess(projectDir: string, allowOutsideProjectAssets?: boolean) { +async function compileInProcess( + projectDir: string, + allowOutsideProjectAssets?: boolean, + includeOutsideScripts?: boolean, +) { const workDir = join(projectDir, "..", "work"); mkdirSync(workDir, { recursive: true }); const warnings: string[] = []; @@ -156,6 +160,7 @@ async function compileInProcess(projectDir: string, allowOutsideProjectAssets?: fps: { num: 30, den: 1 }, quality: "draft", allowOutsideProjectAssets, + includeOutsideScripts, }); const cfg = resolveConfig(); const result = await runCompileStage({ @@ -168,7 +173,8 @@ async function compileInProcess(projectDir: string, allowOutsideProjectAssets?: ...{ projectDir, compiledDir, job, cfg, log, composition: result.composition }, ...{ abortSignal: undefined, assertNotAborted: () => {} }, }); - const serve = () => createFileServer({ projectDir, compiledDir, allowOutsideProjectAssets }); + const serve = () => + createFileServer({ projectDir, compiledDir, allowOutsideProjectAssets, includeOutsideScripts }); return { result, compiledDir, extract, serve, warnings }; } @@ -395,6 +401,58 @@ describe.skipIf(!HAS_FFMPEG)("render servers keep markup inside the project", () }); }); +function outsideScriptsProject() { + const { root, projectDir, outsideDir, secretKey } = outsideProject(false); + writeFileSync(join(outsideDir, "tool.js"), "window.OUTSIDE_TOOL = 1;"); + writeFileSync(join(outsideDir, "tool.mjs"), "export const OUTSIDE_TOOL = 1;"); + writeFileSync(join(outsideDir, "look.css"), ".x { color: red; }"); + symlinkSync(join(outsideDir, "tool.mjs"), join(projectDir, "linked.mjs")); + const html = readFileSync(join(projectDir, "index.html"), "utf-8").replace( + "", + ``, + ); + writeFileSync(join(projectDir, "index.html"), html); + const key = (file: string) => toExternalAssetKey(join(outsideDir, file)); + return { root, projectDir, secretKey, tool: key("tool.js"), css: key("look.css") }; +} + +describe.skipIf(!HAS_FFMPEG)("outside scripts in a trusted local render", () => { + it("are left out with a warning naming the flag, while media and CSS still come in", async () => { + const { root, projectDir, secretKey, tool, css } = outsideScriptsProject(); + const { result, compiledDir, serve, warnings } = await compileInProcess(projectDir, true); + + expect(filesUnder(compiledDir).sort()).toEqual([css, secretKey, "index.html"].sort()); + expect(result.compiled.html).toContain('src="../outside/tool.js"'); + expect(warnings.join("\n")).toContain( + "index.html references ../outside/tool.js, which is a script outside the project; it was left out of the render. Move it into the project, or pass --include-outside-files to hyperframes render, to run it.", + ); + expect(await statusOf(await serve(), ["/linked.mjs", "/link.png"])).toEqual([404, 200]); + + const planDir = join(root, "plan"); + await plan(projectDir, config, planDir, { allowOutsideProjectAssets: true }); + const planned = filesUnder(join(planDir, "compiled")); + expect(planned).not.toContain(tool); + expect(planned).not.toContain("linked.mjs"); + expect(planned).toEqual(expect.arrayContaining([css, secretKey, "link.png"])); + }); + + it("come in with --include-outside-files", async () => { + const { root, projectDir, tool } = outsideScriptsProject(); + const { compiledDir, serve, warnings } = await compileInProcess(projectDir, true, true); + + expect(existsSync(join(compiledDir, tool))).toBe(true); + expect(warnings.join("\n")).not.toContain("script outside the project"); + expect(await statusOf(await serve(), [`/${tool}`, "/linked.mjs"])).toEqual([200, 200]); + + const planDir = join(root, "plan"); + const included = { allowOutsideProjectAssets: true, includeOutsideScripts: true }; + await plan(projectDir, config, planDir, included); + expect(filesUnder(join(planDir, "compiled"))).toEqual( + expect.arrayContaining([tool, "linked.mjs"]), + ); + }); +}); + // These sources skip the earlier filters on purpose: each reader must refuse them on its own. describe.skipIf(!HAS_FFMPEG)("render readers open nothing outside the project", () => { const escaping = (file: string) => [ diff --git a/packages/producer/src/services/render/stages/compileStage.ts b/packages/producer/src/services/render/stages/compileStage.ts index d6d8287a57..a3ad447fa3 100644 --- a/packages/producer/src/services/render/stages/compileStage.ts +++ b/packages/producer/src/services/render/stages/compileStage.ts @@ -263,6 +263,7 @@ export async function runCompileStage(input: CompileStageInput): Promise leftOutWarning(file, reference, reason, "render"); /** True, after a warning, when a trusted local render must not serve or copy `path`, a project file that leads outside. */ -export function refusesOutsideLink(projectDir: string, path: string, warn: (line: string) => void) { - const refusal = outsideAssetRefusal(projectDir, path); +export function refusesOutsideLink( + projectDir: string, + path: string, + warn: (line: string) => void, + policy: OutsideFilePolicy = {}, +) { + const refusal = outsideAssetRefusal(projectDir, path, policy); if (!refusal) return false; const file = nodeRelative(projectDir, path).split(sep).join("/"); warn(leftOutOfRender(file, realFilePath(path), refusal)); diff --git a/packages/studio-server/src/helpers/outsideFile.ts b/packages/studio-server/src/helpers/outsideFile.ts index c639c13158..35269e3c1e 100644 --- a/packages/studio-server/src/helpers/outsideFile.ts +++ b/packages/studio-server/src/helpers/outsideFile.ts @@ -146,14 +146,21 @@ export function isPrivateOutsideFile(projectDir: string, absPath: string): boole export const linksOutside = (projectDir: string, filePath: string): boolean => isOutside(relative(realFilePath(projectDir), realFilePath(filePath))); -/** `blocklisted`: a private location; `received`: reached from an imported file; `file_type`: not a type uploads copy; `network_share`: on another computer. */ -export type LeftOutReason = "blocklisted" | "received" | "file_type" | "private" | "network_share"; +/** `blocklisted`: a private location; `received`: reached from an imported file; `file_type`: not a type uploads copy; `network_share`: on another computer; `script`: a script a local render was not told to run. */ +export type LeftOutReason = + | "blocklisted" + | "received" + | "file_type" + | "private" + | "network_share" + | "script"; const WHY: Record, string> = { private: "which holds secrets or tool data", blocklisted: "which is outside the project in a private location", received: "which leads outside the project and came in with an imported project", network_share: "which is on another computer's network share or is a Windows device path", + script: "which is a script outside the project", }; const COPIED_TYPES = { @@ -172,5 +179,7 @@ export function leftOutWarning( ? `which is outside the project and is not ${COPIED_TYPES[from]}` : WHY[reason]; const warning = `${file} references ${reference}, ${why}; it was left out of the ${from}.`; - return reason === "file_type" ? `${warning} Move it into the project to include it.` : warning; + if (reason === "file_type") return `${warning} Move it into the project to include it.`; + if (reason !== "script") return warning; + return `${warning} Move it into the project, or pass --include-outside-files to hyperframes render, to run it.`; }