@vosjs/cli 0.63.0 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{assetManifest-OMN33M2A.js → assetManifest-RQYJYQ7Q.js} +3 -3
- package/dist/{chunk-PT73CRXX.js → chunk-7CIAU4QP.js} +15 -2
- package/dist/chunk-7CIAU4QP.js.map +1 -0
- package/dist/{chunk-AKIPDSHE.js → chunk-CODEEH2Z.js} +24 -6
- package/dist/chunk-CODEEH2Z.js.map +1 -0
- package/dist/{chunk-LWHVZ5WI.js → chunk-DU3ANWU4.js} +2 -2
- package/dist/{chunk-WCF6KIOK.js → chunk-WVQAZTYU.js} +29 -2
- package/dist/chunk-WVQAZTYU.js.map +1 -0
- package/dist/cli.js +6 -6
- package/dist/index.js +4 -4
- package/dist/{run-OGG3NP2N.js → run-GYCIE77C.js} +5 -5
- package/package.json +4 -4
- package/dist/chunk-AKIPDSHE.js.map +0 -1
- package/dist/chunk-PT73CRXX.js.map +0 -1
- package/dist/chunk-WCF6KIOK.js.map +0 -1
- /package/dist/{assetManifest-OMN33M2A.js.map → assetManifest-RQYJYQ7Q.js.map} +0 -0
- /package/dist/{chunk-LWHVZ5WI.js.map → chunk-DU3ANWU4.js.map} +0 -0
- /package/dist/{run-OGG3NP2N.js.map → run-GYCIE77C.js.map} +0 -0
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ASSET_ROUTE,
|
|
4
4
|
UsageError,
|
|
5
5
|
serveFile
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WVQAZTYU.js";
|
|
7
7
|
|
|
8
8
|
// src/loadConfig.ts
|
|
9
9
|
import { readFile } from "fs/promises";
|
|
@@ -561,4 +561,4 @@ export {
|
|
|
561
561
|
setFlags,
|
|
562
562
|
applyDataSets
|
|
563
563
|
};
|
|
564
|
-
//# sourceMappingURL=chunk-
|
|
564
|
+
//# sourceMappingURL=chunk-DU3ANWU4.js.map
|
|
@@ -404,9 +404,35 @@ async function fetchHosted(id, opts) {
|
|
|
404
404
|
}
|
|
405
405
|
return file;
|
|
406
406
|
}
|
|
407
|
+
function htmlFaceRefs(config) {
|
|
408
|
+
const out = [];
|
|
409
|
+
const stack = Array.isArray(config.stack) ? config.stack : [];
|
|
410
|
+
for (const entry of stack) {
|
|
411
|
+
const data = entry?.data;
|
|
412
|
+
const overlays = Array.isArray(data?.overlays) ? data.overlays : [];
|
|
413
|
+
for (const clip of overlays) {
|
|
414
|
+
const html = clip?.html;
|
|
415
|
+
const faces = Array.isArray(html?.faces) ? html.faces : [];
|
|
416
|
+
for (const face of faces) {
|
|
417
|
+
if (typeof face?.url !== "string" || !face.url) continue;
|
|
418
|
+
out.push({
|
|
419
|
+
where: `overlay ${String(clip.id)} font ${String(face.family)}`,
|
|
420
|
+
url: face.url,
|
|
421
|
+
set: (next) => {
|
|
422
|
+
face.url = next;
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return out;
|
|
429
|
+
}
|
|
407
430
|
async function programAssets(config, opts) {
|
|
408
431
|
const refs = manifestRefs(config);
|
|
409
|
-
|
|
432
|
+
const faces = htmlFaceRefs(config).filter(
|
|
433
|
+
(f) => !isUrl(f.url) || hostedAssetId(f.url, opts.origin ? [opts.origin] : [])
|
|
434
|
+
);
|
|
435
|
+
if (refs.length === 0 && faces.length === 0) return null;
|
|
410
436
|
const files = {};
|
|
411
437
|
const served = /* @__PURE__ */ new Map();
|
|
412
438
|
const serve = (file) => {
|
|
@@ -435,6 +461,7 @@ async function programAssets(config, opts) {
|
|
|
435
461
|
}
|
|
436
462
|
return serve(local.file);
|
|
437
463
|
};
|
|
464
|
+
for (const face of faces) face.set(await reach(face.url, face.where));
|
|
438
465
|
const assets = {};
|
|
439
466
|
for (const { name, index, ref } of refs) {
|
|
440
467
|
const url = await reach(
|
|
@@ -767,4 +794,4 @@ export {
|
|
|
767
794
|
formatChanges,
|
|
768
795
|
serverWarnings
|
|
769
796
|
};
|
|
770
|
-
//# sourceMappingURL=chunk-
|
|
797
|
+
//# sourceMappingURL=chunk-WVQAZTYU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flagUse.ts","../src/args.ts","../src/plugin/container.ts","../src/programAssets.ts","../src/plugin/args.ts","../src/plugin/platform.ts","../src/plugin/hostAgent.ts"],"sourcesContent":["/**\n * Which of the flags a person gave did the verb actually READ?\n *\n * The parsers accept any `--name`, so a mistyped or misplaced flag used to be\n * swallowed: `vos frames <take> --at 3,5,8` wrote five evenly spread stills\n * and exited 0, because the flag is `--times` and nothing ever looked at\n * `at`. It looked like it worked.\n *\n * A declared list per verb would be the obvious guard and the wrong one here:\n * several verbs read their options through data (a name table, a helper three\n * calls down), so a list drifts, and the day it drifts it REFUSES a real flag\n * for every agent at once. Reading is the truth, so reading is what is\n * recorded: both parsers hand back their flags behind a proxy that notes each\n * name a verb asks for, and the CLI's one exit point compares that with what\n * was given. It cannot reject a flag a verb uses, by construction.\n *\n * The cost of being certain is that the verdict lands AFTER the verb ran, so\n * the message says so plainly: the command ran, without that flag.\n */\n\nconst given = new Set<string>()\nconst used = new Set<string>()\n\n/** A flag bag that remembers which names were asked for. */\nexport function trackFlags<T extends Record<string, unknown>>(bag: T): T {\n return new Proxy(bag, {\n get(target, key, receiver) {\n if (typeof key === 'string') used.add(key)\n return Reflect.get(target, key, receiver)\n },\n has(target, key) {\n if (typeof key === 'string') used.add(key)\n return Reflect.has(target, key)\n },\n // hasOwnProperty.call(flags, name) lands here.\n getOwnPropertyDescriptor(target, key) {\n if (typeof key === 'string') used.add(key)\n return Reflect.getOwnPropertyDescriptor(target, key)\n },\n // A spread, Object.keys or JSON.stringify hands every flag onward; what\n // happens to them after that cannot be seen, so they all count as read.\n ownKeys(target) {\n for (const key of Reflect.ownKeys(target))\n if (typeof key === 'string') used.add(key)\n return Reflect.ownKeys(target)\n },\n })\n}\n\nexport function noteGivenFlag(name: string): void {\n given.add(name)\n}\n\n/** Flags that were given and never read, in the order they were given. */\nexport function unusedFlags(): string[] {\n return [...given].filter((name) => !used.has(name) && name !== 'help')\n}\n\nexport function resetFlagUse(): void {\n given.clear()\n used.clear()\n}\n\n/**\n * The `--flags` a verb documents: its `vos <verb>` line in a help text plus\n * the indented lines that continue it.\n */\nexport function helpFlagsFor(help: string, verb: string): string[] {\n const out = new Set<string>()\n let inVerb = false\n for (const line of help.split('\\n')) {\n const head = /^\\s{2}vos\\s+(\\S+)/.exec(line)\n if (head) inVerb = head[1] === verb\n else if (!/^\\s{3,}\\S/.test(line)) inVerb = false\n if (!inVerb) continue\n for (const m of line.matchAll(/--([a-z][a-z0-9-]*)/g)) out.add(m[1])\n }\n return [...out]\n}\n\nfunction editDistance(a: string, b: string): number {\n const row = Array.from({ length: b.length + 1 }, (_, i) => i)\n for (let i = 1; i <= a.length; i++) {\n let prev = row[0]\n row[0] = i\n for (let j = 1; j <= b.length; j++) {\n const keep = row[j]\n row[j] = Math.min(\n row[j] + 1,\n row[j - 1] + 1,\n prev + (a[i - 1] === b[j - 1] ? 0 : 1),\n )\n prev = keep\n }\n }\n return row[b.length]\n}\n\n/** The documented flag a mistyped one most likely meant, or null. */\nexport function nearestFlag(name: string, candidates: string[]): string | null {\n let best: string | null = null\n let bestScore = Infinity\n for (const c of candidates) {\n if (c === name) continue\n // A candidate that contains the name (or the reverse) is as close as a\n // one-letter slip: `--zooms` for `--at-zooms`, `--body` for `--body-px`.\n const d = c.includes(name) || name.includes(c) ? 1 : editDistance(name, c)\n if (d < bestScore) {\n bestScore = d\n best = c\n }\n }\n return best !== null && bestScore <= Math.max(2, Math.floor(name.length / 3))\n ? best\n : null\n}\n\n/** The sentence for a run that ignored what it was given, or null when nothing was. */\nexport function unusedFlagsMessage(\n verb: string,\n documented: string[],\n): string | null {\n const unused = unusedFlags()\n if (!unused.length) return null\n const parts = unused.map((name) => {\n const near = nearestFlag(name, documented)\n return `--${name}${near ? ` (did you mean --${near}?)` : ''}`\n })\n const list = documented.length\n ? ` It reads: ${documented.map((f) => `--${f}`).join(' ')}.`\n : ''\n return `vos ${verb} RAN, and ignored ${parts.join(', ')}: ${unused.length > 1 ? 'they are' : 'it is'} not something this verb reads, so what it printed above was made without ${unused.length > 1 ? 'them' : 'it'}.${list}`\n}\n","/**\n * Minimal argv parser — positionals + `--flag value` / `--flag=value` /\n * boolean flags. Deliberately tiny: the CLI has a small, stable surface and\n * agents benefit from predictable, dependency-free parsing.\n */\nimport { noteGivenFlag, trackFlags } from './flagUse'\n\nexport interface ParsedArgs {\n positionals: string[]\n flags: Record<string, string | true>\n}\n\nexport class UsageError extends Error {}\n\nexport function parseArgs(\n argv: string[],\n booleanFlags: ReadonlySet<string>,\n): ParsedArgs {\n const positionals: string[] = []\n const flags: Record<string, string | true> = {}\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i]\n if (arg === '--') {\n positionals.push(...argv.slice(i + 1))\n break\n }\n if (arg.startsWith('--')) {\n const eq = arg.indexOf('=')\n if (eq !== -1) {\n flags[arg.slice(2, eq)] = arg.slice(eq + 1)\n continue\n }\n const name = arg.slice(2)\n if (booleanFlags.has(name)) {\n flags[name] = true\n continue\n }\n const next = argv[i + 1]\n if (next === undefined || next.startsWith('--')) {\n throw new UsageError(`--${name} expects a value`)\n }\n flags[name] = next\n i++\n continue\n }\n positionals.push(arg)\n }\n for (const name of Object.keys(flags)) noteGivenFlag(name)\n return { positionals, flags: trackFlags(flags) }\n}\n\nexport function numFlag(\n flags: ParsedArgs['flags'],\n name: string,\n fallback: number,\n): number {\n const v = flags[name]\n if (v === undefined) return fallback\n const n = Number(v)\n if (!Number.isFinite(n))\n throw new UsageError(`--${name} expects a number, got \"${String(v)}\"`)\n return n\n}\n","/**\n * What a media file IS, read from its first bytes.\n *\n * A file's NAME and its Content-Type are both CLAIMS, and both drift from the\n * bytes: the in-page recorder remuxes a take to mp4 while keeping the name\n * `recording.webm`, and a hosted asset keeps whatever name it was uploaded\n * under. Believing a claim is how an mp4 gets uploaded as `video/webm`, and\n * every render of that version then dies inside the video element with a\n * format error — one machine and one day away from the mislabelling that\n * caused it.\n *\n * So the rule is one line: THE BYTES DECIDE. A claim is the fallback only for\n * bytes that say nothing (an SVG, a recipe, an unknown blob), which keeps the\n * override safe — a name is corrected only when the file positively contradicts\n * it, never on a guess.\n */\n\nconst OCTET_STREAM = 'application/octet-stream'\n\n/** The one extension↔type table. */\nconst TYPES_BY_EXTENSION: Record<string, string> = {\n svg: 'image/svg+xml',\n png: 'image/png',\n jpg: 'image/jpeg',\n jpeg: 'image/jpeg',\n webp: 'image/webp',\n gif: 'image/gif',\n avif: 'image/avif',\n webm: 'video/webm',\n mp4: 'video/mp4',\n mov: 'video/quicktime',\n mp3: 'audio/mpeg',\n wav: 'audio/wav',\n ogg: 'audio/ogg',\n m4a: 'audio/mp4',\n glb: 'model/gltf-binary',\n}\n\n/** The extension each type is written under, where the table is many-to-one. */\nconst EXTENSION_BY_TYPE: Record<string, string> = {\n 'image/jpeg': '.jpg',\n 'video/mp4': '.mp4',\n 'audio/mp4': '.m4a',\n}\n\n/**\n * Every container a take's own media (footage, mic, cam) can come home in —\n * the name `record` writes first, so a resolver is deterministic when a stale\n * sibling is somehow present.\n */\nexport const TAKE_MEDIA_EXTENSIONS = [\n '.webm',\n '.mp4',\n '.mov',\n '.m4a',\n '.mp3',\n '.ogg',\n '.wav',\n] as const\n\n/** Enough bytes for every signature below (the longest reads 12). */\nexport const MEDIA_HEAD_BYTES = 16\n\n/**\n * ISO base media brands that are NOT plain mp4. Everything else carrying an\n * `ftyp` box (isom, mp42, avc1, iso5, dash, M4V…) is video/mp4.\n */\nconst ISO_BRANDS: Record<string, string> = {\n 'qt ': 'video/quicktime',\n 'M4A ': 'audio/mp4',\n 'M4B ': 'audio/mp4',\n avif: 'image/avif',\n avis: 'image/avif',\n}\n\n/** RIFF forms, read from the four bytes after the size field. */\nconst RIFF_FORMS: Record<string, string> = {\n WEBP: 'image/webp',\n WAVE: 'audio/wav',\n 'AVI ': 'video/x-msvideo',\n}\n\n/** The media type a file's first bytes prove, or null when they prove nothing. */\nexport function sniffMediaType(head: Uint8Array): string | null {\n const ascii = (at: number, len: number): string =>\n head.length >= at + len\n ? String.fromCharCode(...head.subarray(at, at + len))\n : ''\n const startsWith = (...bytes: number[]): boolean =>\n bytes.every((b, i) => head[i] === b)\n\n // EBML: Matroska and its WebM profile. A .mkv sniffs as webm, which is what\n // every consumer here wants — the distinction is a codec constraint, not a\n // container one.\n if (startsWith(0x1a, 0x45, 0xdf, 0xa3)) return 'video/webm'\n if (ascii(4, 4) === 'ftyp') return ISO_BRANDS[ascii(8, 4)] ?? 'video/mp4'\n if (ascii(0, 4) === 'RIFF') return RIFF_FORMS[ascii(8, 4)] ?? null\n if (startsWith(0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a))\n return 'image/png'\n if (startsWith(0xff, 0xd8, 0xff)) return 'image/jpeg'\n if (ascii(0, 4) === 'GIF8') return 'image/gif'\n if (ascii(0, 4) === 'OggS') return 'audio/ogg'\n if (ascii(0, 3) === 'ID3') return 'audio/mpeg'\n // Binary glTF: the magic is the four ASCII bytes `glTF`.\n if (ascii(0, 4) === 'glTF') return 'model/gltf-binary'\n return null\n}\n\n/** A Content-Type header reduced to its bare type, or '' when it says nothing. */\nfunction bareType(value: string | null | undefined): string {\n const type = (value ?? '').split(';')[0].trim().toLowerCase()\n // `binary/octet-stream` is a common spelling of the same non-answer.\n return !type || type === OCTET_STREAM || type === 'binary/octet-stream'\n ? ''\n : type\n}\n\n/** The content type a file's NAME claims, by extension. */\nexport function mediaContentType(file: string): string {\n const ext = (/\\.([a-z0-9]+)$/i.exec(file)?.[1] ?? '').toLowerCase()\n return TYPES_BY_EXTENSION[ext] ?? OCTET_STREAM\n}\n\n/** The extension a media type is written under ('' when it has none here). */\nexport function extensionFor(contentType: string): string {\n const type = (contentType ?? '').split(';')[0].trim().toLowerCase()\n if (EXTENSION_BY_TYPE[type]) return EXTENSION_BY_TYPE[type]\n const ext = Object.keys(TYPES_BY_EXTENSION).find(\n (e) => TYPES_BY_EXTENSION[e] === type,\n )\n return ext ? `.${ext}` : ''\n}\n\nexport interface MediaTypeClaims {\n /** The file's first bytes — `MEDIA_HEAD_BYTES` is enough. */\n head?: Uint8Array | null\n /** What a server said it was serving. */\n declared?: string | null\n /** What the name claims. */\n filename?: string | null\n}\n\nexport interface ResolvedMediaType {\n type: string\n /** Which claim won, so a caller can SAY when the bytes overruled a name. */\n from: 'bytes' | 'declared' | 'filename' | 'unknown'\n}\n\n/** The type to believe: the bytes, then the server, then the name. */\nexport function resolveMediaType(claims: MediaTypeClaims): ResolvedMediaType {\n const sniffed = claims.head?.length ? sniffMediaType(claims.head) : null\n if (sniffed) return { type: sniffed, from: 'bytes' }\n const declared = bareType(claims.declared)\n if (declared) return { type: declared, from: 'declared' }\n const named = mediaContentType(claims.filename ?? '')\n if (named !== OCTET_STREAM) return { type: named, from: 'filename' }\n return { type: OCTET_STREAM, from: 'unknown' }\n}\n\n/**\n * The same name wearing the extension its type earns. Unchanged when the two\n * already agree (`.jpeg` is not churned into `.jpg`) or when the type has no\n * extension here, so a correction is always a real one.\n */\nexport function nameForType(filename: string, type: string): string {\n const ext = extensionFor(type)\n if (!ext) return filename\n const current = /\\.[a-z0-9]+$/i.exec(filename)?.[0] ?? ''\n if (current && mediaContentType(`x${current}`) === type) return filename\n return `${filename.slice(0, filename.length - current.length)}${ext}`\n}\n\n/**\n * What to say about a file whose name and bytes disagree, or null when they\n * agree or the bytes prove nothing.\n *\n * Every reader in this CLI now believes the bytes (the take server sniffs, a\n * push declares from them), so a mismatch breaks nothing here — it is still a\n * file lying about itself to every player, editor and person who opens it, and\n * the rename is one move.\n */\nexport function containerMismatch(\n filename: string,\n head: Uint8Array,\n): string | null {\n const actual = sniffMediaType(head)\n if (!actual) return null\n const claimed = mediaContentType(filename)\n if (claimed === actual) return null\n return `${filename} is ${actual}, not the ${claimed} its name claims — rename it to ${nameForType(filename, actual)}`\n}\n","/**\n * The files a program declares (`config.assets`), for a LOCAL run of it.\n *\n * A capture page has an origin of its own, so a manifest entry that names a\n * file beside the config (`./logo.png`) or a hosted one (`asset:<id>`)\n * cannot be fetched from inside it as written. Each is made reachable here\n * and handed to the engine as the page's `ctx.assets`:\n *\n * - a local file is SERVED to the page from disk, under a path on the\n * page's own origin, so a video is streamed and never inlined;\n * - a hosted asset is downloaded once with the caller's credential into a\n * cache directory and served the same way;\n * - a URL is used as it is.\n *\n * A file that cannot be reached keeps its ref and is said, so the render\n * shows a missing picture with a reason instead of a silent blank.\n */\nimport { createHash } from 'node:crypto'\nimport {\n closeSync,\n existsSync,\n mkdirSync,\n openSync,\n readSync,\n readdirSync,\n realpathSync,\n renameSync,\n rmSync,\n statSync,\n writeFileSync,\n} from 'node:fs'\nimport { homedir } from 'node:os'\nimport { extname, join, resolve, sep } from 'node:path'\nimport { extensionFor } from './plugin/container'\n\n/** Where served files live on a page's own origin. */\nexport const ASSET_ROUTE = '/__assets/'\n\nexport interface ProgramAssetsOptions {\n /**\n * The program's directory: where the manifest's paths are read, and the\n * only place they may reach. Null for a config loaded from a URL, which\n * has no directory and reads no local file.\n */\n baseDir: string | null\n /** For a hosted ref: where it lives and who may read it. */\n origin?: string\n key?: string | null\n log: (line: string) => void\n /**\n * Where hosted files are kept between runs. Default `~/.cache/vos/assets`,\n * private to the user: a shared temp directory would leave a private\n * file readable by everyone else on the machine.\n */\n cacheDir?: string\n}\n\nexport interface ProgramAssets {\n /** Name → the URL (or URLs) the page reads as `ctx.assets.<name>`. */\n assets: Record<string, string | string[]>\n /** Served path (`/__assets/…`) → the file on disk behind it. */\n files: Record<string, string>\n}\n\nconst UUID = '[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}'\nconst HOSTED_URI = new RegExp(`^asset:(${UUID})$`)\nconst HOSTED_FILE = new RegExp(\n `^(https?://[^/?#]+)?/api/assets/(${UUID})/file(?:[?#].*)?$`,\n)\n\n/**\n * The hosted asset id a ref names, or null: `asset:<id>`, the app-relative\n * file path, or that path on one of `homeOrigins`. The same path on any\n * other host is someone else's URL and is left a URL: reading it as a\n * hosted file would name an asset that does not exist.\n */\nexport function hostedAssetId(\n ref: string,\n homeOrigins: readonly string[] = [],\n): string | null {\n const uri = HOSTED_URI.exec(ref)\n if (uri) return uri[1]\n const file = HOSTED_FILE.exec(ref)\n if (!file) return null\n return file[1] === undefined || homeOrigins.includes(file[1]) ? file[2] : null\n}\n\n/** A manifest name: an identifier, as the engine's schema holds it. */\nconst ASSET_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/\n\n/** The type a served file wears, by extension (never by its bytes here). */\nconst SERVED_TYPES: Record<string, string> = {\n '.png': 'image/png',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.webp': 'image/webp',\n '.gif': 'image/gif',\n '.svg': 'image/svg+xml',\n '.avif': 'image/avif',\n '.mp4': 'video/mp4',\n '.webm': 'video/webm',\n '.mov': 'video/quicktime',\n '.mp3': 'audio/mpeg',\n '.ogg': 'audio/ogg',\n '.wav': 'audio/wav',\n '.m4a': 'audio/mp4',\n '.glb': 'model/gltf-binary',\n '.gltf': 'model/gltf+json',\n '.woff2': 'font/woff2',\n '.woff': 'font/woff',\n '.ttf': 'font/ttf',\n '.otf': 'font/otf',\n '.json': 'application/json',\n}\n\nexport interface ServedBytes {\n status: 200 | 206 | 416\n headers: Record<string, string>\n body: Buffer\n}\n\n/**\n * A declared file as an HTTP answer, honouring `Range`. A video element\n * seeks by range and hangs forever against a server that answers only\n * 200, so both the render page's route and the preview server answer\n * through here.\n */\nexport function serveFile(file: string, range?: string | null): ServedBytes {\n const size = statSync(file).size\n const type =\n SERVED_TYPES[extname(file).toLowerCase()] ?? 'application/octet-stream'\n const base = { 'content-type': type, 'accept-ranges': 'bytes' }\n const read = (start: number, end: number): Buffer => {\n const body = Buffer.alloc(Math.max(0, end - start + 1))\n const fd = openSync(file, 'r')\n try {\n readSync(fd, body, 0, body.length, start)\n } finally {\n closeSync(fd)\n }\n return body\n }\n const m = range ? /^bytes=(\\d*)-(\\d*)$/.exec(range.trim()) : null\n if (!m || (m[1] === '' && m[2] === '')) {\n return {\n status: 200,\n headers: { ...base, 'content-length': String(size) },\n body: read(0, size - 1),\n }\n }\n // `bytes=-N` is the last N bytes; `bytes=A-` runs to the end.\n const start = m[1] === '' ? Math.max(0, size - Number(m[2])) : Number(m[1])\n const end =\n m[1] === '' || m[2] === '' ? size - 1 : Math.min(Number(m[2]), size - 1)\n if (start >= size || start > end) {\n return {\n status: 416,\n headers: { ...base, 'content-range': `bytes */${size}` },\n body: Buffer.alloc(0),\n }\n }\n return {\n status: 206,\n headers: {\n ...base,\n 'content-range': `bytes ${start}-${end}/${size}`,\n 'content-length': String(end - start + 1),\n },\n body: read(start, end),\n }\n}\n\n/**\n * The file a manifest path names, when it is the program's to read.\n *\n * A program's functions run in a page, and whatever the page is served the\n * program can read and send anywhere. So a path is honoured only inside the\n * program's own directory (links resolved): a config from somewhere else\n * cannot name a key file or a `.env` two directories up and have a render\n * or a push carry it out. The cost is that a shared file has to be copied\n * (or the config moved up); the alternative is every config being able to\n * read the disk of whoever renders it.\n */\nexport function localFile(\n ref: string,\n baseDir: string | null,\n): { file: string } | { refused: string } {\n if (baseDir === null) {\n return {\n refused:\n 'a config loaded from a URL has no directory, so it reads no local file',\n }\n }\n const file = resolve(baseDir, ref)\n if (!existsSync(file) || !statSync(file).isFile()) {\n return { refused: 'which is not a file beside the config' }\n }\n const root = realpathSync(baseDir)\n const real = realpathSync(file)\n if (!real.startsWith(root + sep)) {\n return {\n refused: `which is outside the program's directory (${root}). A program reads only files in its own directory or below: copy the file there`,\n }\n }\n return { file: real }\n}\n\n/** A ref the page can fetch as written. */\nfunction isUrl(ref: string): boolean {\n return /^(https?:|data:|blob:)/.test(ref)\n}\n\nfunction manifestOf(\n config: Record<string, unknown>,\n): Record<string, { ref: string | string[] }> | null {\n const assets = config.assets\n if (!assets || typeof assets !== 'object' || Array.isArray(assets))\n return null\n return Object.keys(assets).length > 0\n ? (assets as Record<string, { ref: string | string[] }>)\n : null\n}\n\n/** Every ref of a manifest, in declaration order, with where it sits. */\nexport function manifestRefs(\n config: Record<string, unknown>,\n): { name: string; index: number | null; ref: string }[] {\n const out: { name: string; index: number | null; ref: string }[] = []\n for (const [name, decl] of Object.entries(manifestOf(config) ?? {})) {\n // A name becomes a file name when the manifest's files come home, so\n // it is held to the engine's rule HERE, for a config that reached this\n // machine without passing a schema (a fetched document's own config).\n if (!ASSET_NAME.test(name) || !decl || typeof decl !== 'object') continue\n if (Array.isArray(decl.ref)) {\n decl.ref.forEach((ref, index) => {\n if (typeof ref === 'string') out.push({ name, index, ref })\n })\n } else if (typeof decl.ref === 'string') {\n out.push({ name, index: null, ref: decl.ref })\n }\n }\n return out\n}\n\nasync function fetchHosted(\n id: string,\n opts: ProgramAssetsOptions,\n): Promise<string | null> {\n const dir = opts.cacheDir ?? join(homedir(), '.cache', 'vos', 'assets')\n // A hosted file is immutable, so a finished copy is good forever. Only a\n // finished one: a download lands under `.part` and is renamed whole.\n const cached = existsSync(dir)\n ? readdirSync(dir).find(\n (f) => (f === id || f.startsWith(`${id}.`)) && !f.endsWith('.part'),\n )\n : undefined\n if (cached) return join(dir, cached)\n if (!opts.origin || !opts.key) {\n opts.log(\n `note: asset ${id} is hosted and no credential is set, so the render cannot load it (vos login, or keep the file beside the config and name its path)`,\n )\n return null\n }\n const res = await fetch(`${opts.origin}/api/assets/${id}/file`, {\n headers: { authorization: `Bearer ${opts.key}` },\n })\n if (!res.ok) {\n opts.log(\n `note: asset ${id} could not be read (${res.status}), so the render cannot load it`,\n )\n return null\n }\n mkdirSync(dir, { recursive: true, mode: 0o700 })\n // The served type names the extension, so the page is told what it got.\n const type = (res.headers.get('content-type') ?? '').split(';')[0].trim()\n const file = join(dir, `${id}${extensionFor(type)}`)\n const partial = `${file}.part`\n try {\n writeFileSync(partial, new Uint8Array(await res.arrayBuffer()), {\n mode: 0o600,\n })\n renameSync(partial, file)\n } finally {\n rmSync(partial, { force: true })\n }\n return file\n}\n\n/**\n * The faces an HTML layer brings (`fonts` on the document, lowered into the\n * studio entry as `html.faces`), as refs a caller can re-point. The page\n * fetches each `url` itself, so a path is resolved against the page.\n */\nfunction htmlFaceRefs(\n config: Record<string, unknown>,\n): { where: string; url: string; set: (next: string) => void }[] {\n const out: { where: string; url: string; set: (next: string) => void }[] = []\n const stack = Array.isArray(config.stack) ? config.stack : []\n for (const entry of stack as Record<string, unknown>[]) {\n const data = entry?.data as Record<string, unknown> | undefined\n const overlays = Array.isArray(data?.overlays) ? data.overlays : []\n for (const clip of overlays as Record<string, unknown>[]) {\n const html = clip?.html as Record<string, unknown> | undefined\n const faces = Array.isArray(html?.faces) ? html.faces : []\n for (const face of faces as Record<string, unknown>[]) {\n if (typeof face?.url !== 'string' || !face.url) continue\n out.push({\n where: `overlay ${String(clip.id)} font ${String(face.family)}`,\n url: face.url,\n set: (next) => {\n face.url = next\n },\n })\n }\n }\n }\n return out\n}\n\n/**\n * Make every declared file reachable for a local page: the manifest's, and\n * the faces an HTML layer brings from beside its document (re-pointed in\n * place, since the page fetches a face by its url). Null when there is\n * none, so a caller can leave the engine's defaults alone.\n */\nexport async function programAssets(\n config: Record<string, unknown>,\n opts: ProgramAssetsOptions,\n): Promise<ProgramAssets | null> {\n const refs = manifestRefs(config)\n const faces = htmlFaceRefs(config).filter(\n (f) =>\n !isUrl(f.url) || hostedAssetId(f.url, opts.origin ? [opts.origin] : []),\n )\n if (refs.length === 0 && faces.length === 0) return null\n const files: Record<string, string> = {}\n const served = new Map<string, string>()\n const serve = (file: string): string => {\n const known = served.get(file)\n if (known) return known\n // The path is a digest of the file's location plus its extension, and\n // never its name: a space or an accent in a name is percent-encoded in\n // the URL the page asks for and would miss a table keyed by the name.\n const tag = createHash('sha256').update(file).digest('hex').slice(0, 16)\n const ext = extname(file)\n const path = `${ASSET_ROUTE}${tag}${/^\\.[A-Za-z0-9]+$/.test(ext) ? ext.toLowerCase() : ''}`\n files[path] = file\n served.set(file, path)\n return path\n }\n\n const reach = async (ref: string, where: string): Promise<string> => {\n // A hosted file first, in any spelling: its absolute URL is a URL too,\n // but a private one answers only to the key, never to the page.\n const hosted = hostedAssetId(ref, opts.origin ? [opts.origin] : [])\n if (hosted) {\n const file = await fetchHosted(hosted, opts)\n return file ? serve(file) : ref\n }\n if (isUrl(ref)) return ref\n const local = localFile(ref, opts.baseDir)\n if ('refused' in local) {\n opts.log(\n `note: ${where} names ${ref}, ${local.refused}, so the render cannot load it`,\n )\n return ref\n }\n return serve(local.file)\n }\n\n for (const face of faces) face.set(await reach(face.url, face.where))\n\n const assets: Record<string, string | string[]> = {}\n for (const { name, index, ref } of refs) {\n const url = await reach(\n ref,\n index === null ? `assets.${name}` : `assets.${name}[${index}]`,\n )\n if (index === null) assets[name] = url\n else {\n const list = (assets[name] ??= []) as string[]\n list[index] = url\n }\n }\n return { assets, files }\n}\n\n/**\n * The manifest entries that name a file which is not there, for a check\n * that knows where the config lives. Hosted refs and URLs are not files.\n */\nexport function missingManifestFiles(\n config: Record<string, unknown>,\n baseDir: string,\n): string[] {\n const out: string[] = []\n for (const { name, index, ref } of manifestRefs(config)) {\n if (isUrl(ref) || hostedAssetId(ref)) continue\n const local = localFile(ref, baseDir)\n if ('file' in local) continue\n const where = index === null ? `assets.${name}` : `assets.${name}[${index}]`\n out.push(`${where} names ${ref}, ${local.refused}`)\n }\n return out\n}\n","/** Minimal argv parser — mirrors @vosjs/cli's conventions. */\nimport { noteGivenFlag, trackFlags } from '../flagUse'\nimport { UsageError } from '../args'\n\nexport interface ParsedArgs {\n positionals: string[]\n flags: Record<string, string | true>\n /** Values of flags declared repeatable (multiFlags) — accumulated in order. */\n multi: Record<string, string[]>\n}\n\n// ONE usage error for the whole CLI: a verb that reaches a shared helper\n// (outputs.ts) must be reported as a usage error on either side.\nexport { UsageError }\n\nexport function parseArgs(\n argv: string[],\n booleanFlags: ReadonlySet<string>,\n multiFlags: ReadonlySet<string> = new Set(),\n): ParsedArgs {\n const positionals: string[] = []\n const flags: Record<string, string | true> = {}\n const multi: Record<string, string[]> = {}\n const put = (name: string, value: string): void => {\n if (multiFlags.has(name)) (multi[name] ??= []).push(value)\n else flags[name] = value\n }\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i]\n if (arg === '--') {\n positionals.push(...argv.slice(i + 1))\n break\n }\n if (arg.startsWith('--')) {\n const eq = arg.indexOf('=')\n if (eq !== -1) {\n put(arg.slice(2, eq), arg.slice(eq + 1))\n continue\n }\n const name = arg.slice(2)\n if (booleanFlags.has(name)) {\n flags[name] = true\n continue\n }\n if (i + 1 >= argv.length || argv[i + 1].startsWith('--')) {\n throw new UsageError(`--${name} expects a value`)\n }\n put(name, argv[i + 1])\n i++\n continue\n }\n positionals.push(arg)\n }\n for (const name of Object.keys(flags)) noteGivenFlag(name)\n for (const name of Object.keys(multi)) noteGivenFlag(name)\n return { positionals, flags: trackFlags(flags), multi: trackFlags(multi) }\n}\n\nexport function numFlag(\n flags: ParsedArgs['flags'],\n name: string,\n fallback: number,\n): number {\n const v = flags[name]\n if (typeof v !== 'string') return fallback\n const n = Number(v)\n if (!Number.isFinite(n))\n throw new UsageError(`--${name} expects a number, got \"${v}\"`)\n return n\n}\n\n/** String flag value, or undefined when absent (or boolean). */\nexport function strFlag(\n flags: ParsedArgs['flags'],\n name: string,\n): string | undefined {\n const v = flags[name]\n return typeof v === 'string' ? v : undefined\n}\n\nexport function hasFlag(flags: ParsedArgs['flags'], name: string): boolean {\n return Object.prototype.hasOwnProperty.call(flags, name)\n}\n","/**\n * vos.so platform client — THE one HTTP surface of the vos CLI.\n * Every platform verb (fetch/push/pull for programs AND takes, login) goes\n * through here: one origin resolution, one credential ladder, one sync-state\n * file, one 409 conflict shape.\n *\n * Contract notes (mirrored at https://vos.so/llms.txt):\n * - public/unlisted programs read with no auth; writes ride a bearer key\n * - credentials resolve --key → VOS_API_KEY → ~/.config/vos/credentials\n * (first line; `vos login` writes it) and are NEVER printed — not in\n * logs, not in errors, not in NDJSON events\n * - pushed configs travel as the MIGRATED object with params/presets\n * untouched; the platform validates and compiles server-side\n */\nimport { mkdirSync, readFileSync, writeFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'node:path'\nimport { UsageError } from './args'\nimport { detectHostAgent } from './hostAgent'\nimport type { Env } from './hostAgent'\n\n/**\n * Origin resolution: --origin (or legacy --api) → VOS_ORIGIN → legacy\n * VOS_API_BASE (which historically carried a trailing /api) → https://vos.so.\n * Every shape converges on a bare origin; paths below carry the /api prefix.\n */\nexport function platformOrigin(\n flags: { origin?: string; api?: string } = {},\n): string {\n const legacyEnv = process.env.VOS_API_BASE?.trim()\n const raw =\n flags.origin ??\n flags.api ??\n process.env.VOS_ORIGIN?.trim() ??\n legacyEnv ??\n 'https://vos.so'\n if (!flags.origin && !flags.api && !process.env.VOS_ORIGIN && legacyEnv) {\n process.stderr.write(\n 'note: VOS_API_BASE is deprecated — set VOS_ORIGIN (an origin, no /api suffix)\\n',\n )\n }\n return raw.replace(/\\/+$/, '').replace(/\\/api$/, '')\n}\n\n/**\n * Accepts a bare vos id, a watch URL (vos.so/vos/{id}), an embed URL\n * (/embed/vos/{id}), or a studio/stage URL (?vos={id}).\n */\nexport function parseVosId(input: string): string {\n if (!/^https?:\\/\\//.test(input)) {\n if (/^[A-Za-z0-9_-]+$/.test(input)) return input\n throw new UsageError(`\"${input}\" is not a vos id or URL`)\n }\n let url: URL\n try {\n url = new URL(input)\n } catch {\n throw new UsageError(`\"${input}\" is not a valid URL`)\n }\n const query = url.searchParams.get('vos')\n if (query) return query\n const path = url.pathname.match(/\\/vos\\/([A-Za-z0-9_-]+)/)\n if (path) return path[1]\n throw new UsageError(\n `could not find a vos id in ${input} — expected /vos/{id} or ?vos={id}`,\n )\n}\n\nexport function deriveSlug(title: string): string {\n return (\n title\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 50)\n .replace(/-+$/, '') || 'remix'\n )\n}\n\nexport const CREDENTIALS_PATH = join(homedir(), '.config', 'vos', 'credentials')\n\n/**\n * The full documented ladder: explicit --key → VOS_API_KEY → the first line\n * of ~/.config/vos/credentials. A vos_rg_ remix grant is just a key here.\n * Returns null when nothing resolves — callers decide whether auth is needed.\n */\nexport function resolveCredential(explicit?: string): string | null {\n const flag = explicit?.trim()\n if (flag) return flag\n const env = process.env.VOS_API_KEY?.trim()\n if (env) return env\n try {\n const first = readFileSync(CREDENTIALS_PATH, 'utf8').split('\\n')[0].trim()\n return first || null\n } catch {\n return null\n }\n}\n\nexport function requireCredential(explicit?: string): string {\n const key = resolveCredential(explicit)\n if (!key) {\n throw new Error(\n 'no credential found — pass --key, set VOS_API_KEY, or run `vos login` ' +\n '(mint a content key at https://vos.so/app/api; a vos_rg_ remix grant works too)',\n )\n }\n return key\n}\n\n/** `vos login` writes here: 0700 dir, 0600 file, first line is the key. */\nexport function writeCredential(key: string): string {\n mkdirSync(join(homedir(), '.config', 'vos'), { recursive: true, mode: 0o700 })\n writeFileSync(CREDENTIALS_PATH, `${key.trim()}\\n`, { mode: 0o600 })\n return CREDENTIALS_PATH\n}\n\n/**\n * The self-reported client string stamped onto pushed versions (User-Agent\n * grammar). Display-only on the platform — attribution trust\n * stays with the credential. The ladder: an explicit VOS_CLIENT (e.g.\n * VOS_CLIENT=claude-code/2.1), else the coding agent this CLI was spawned by\n * (`claude-code vos-cli`, read from the environment by `detectHostAgent`),\n * else the transport alone, so history rows name the tool that pushed.\n */\nexport function clientId(\n env: Env = process.env,\n exists?: (path: string) => boolean,\n): string {\n const explicit = env.VOS_CLIENT?.trim()\n if (explicit && explicit.length <= 60 && !/[\\r\\n]/.test(explicit))\n return explicit\n const host = detectHostAgent(env, exists)\n return host ? `${host} vos-cli` : 'vos-cli'\n}\n\nexport interface ApiResult {\n status: number\n body: Record<string, unknown>\n}\n\nexport async function apiJson(\n origin: string,\n path: string,\n init: {\n method?: string\n key?: string | null\n body?: unknown\n /** Raw request body (uploads) — used verbatim, with `headers`. */\n raw?: Uint8Array\n headers?: Record<string, string>\n } = {},\n): Promise<ApiResult> {\n const headers: Record<string, string> = {\n accept: 'application/json',\n ...init.headers,\n }\n if (init.key) headers.authorization = `Bearer ${init.key}`\n if (init.body !== undefined) headers['content-type'] = 'application/json'\n const reqBody: BodyInit | undefined =\n init.raw !== undefined\n ? (init.raw as unknown as BodyInit)\n : init.body === undefined\n ? undefined\n : JSON.stringify(init.body)\n const res = await fetch(`${origin}${path}`, {\n method: init.method ?? 'GET',\n headers,\n body: reqBody,\n })\n let body: Record<string, unknown> = {}\n try {\n body = (await res.json()) as Record<string, unknown>\n } catch {\n // non-JSON error bodies stay {}\n }\n return { status: res.status, body }\n}\n\n/** Human-readable error line for a failed platform response. Never echoes credentials. */\nexport function apiError(what: string, r: ApiResult): string {\n const detail =\n typeof r.body.error === 'string'\n ? r.body.error\n : r.body.details !== undefined\n ? JSON.stringify(r.body.details)\n : ''\n const hint =\n r.status === 401\n ? ' (run `vos login`, or set VOS_API_KEY — mint a key at https://vos.so/app/api)'\n : ''\n return `${what} → ${r.status}${detail ? `: ${detail}` : ''}${hint}`\n}\n\n// ---------------------------------------------------------------------------\n// Sync state — ONE file (vos.json) for both artifact kinds, legacy-read\n// compatible with the two files it replaces: push.json (take dirs) and\n// meta.json (fetched program dirs).\n// ---------------------------------------------------------------------------\n\nexport const SYNC_STATE_NAME = 'vos.json'\n\nexport interface SyncState {\n vosId: string\n /** The hosted version this directory is based on — the next push's base. */\n versionId: string | null\n pushedAt?: string\n title?: string\n slug?: string\n remixOfId?: string\n}\n\nfunction readJsonFile(file: string): Record<string, unknown> | null {\n try {\n return JSON.parse(readFileSync(file, 'utf8')) as Record<string, unknown>\n } catch {\n return null\n }\n}\n\n/**\n * vos.json → legacy push.json ({vosId, versionId}) → legacy meta.json\n * ({id, currentVersionId} — guarded on a string `id` so a take dir's\n * RecordingMeta meta.json is never misread as sync state).\n */\nexport function readSyncState(dir: string): SyncState | null {\n const own = readJsonFile(join(dir, SYNC_STATE_NAME))\n if (own && typeof own.vosId === 'string') {\n return {\n vosId: own.vosId,\n versionId: typeof own.versionId === 'string' ? own.versionId : null,\n ...(typeof own.pushedAt === 'string' ? { pushedAt: own.pushedAt } : {}),\n ...(typeof own.title === 'string' ? { title: own.title } : {}),\n ...(typeof own.slug === 'string' ? { slug: own.slug } : {}),\n ...(typeof own.remixOfId === 'string'\n ? { remixOfId: own.remixOfId }\n : {}),\n }\n }\n const push = readJsonFile(join(dir, 'push.json'))\n if (push && typeof push.vosId === 'string') {\n return {\n vosId: push.vosId,\n versionId: typeof push.versionId === 'string' ? push.versionId : null,\n ...(typeof push.pushedAt === 'string' ? { pushedAt: push.pushedAt } : {}),\n }\n }\n const meta = readJsonFile(join(dir, 'meta.json'))\n if (meta && typeof meta.id === 'string') {\n return {\n vosId: meta.id,\n versionId:\n typeof meta.currentVersionId === 'string'\n ? meta.currentVersionId\n : null,\n ...(typeof meta.title === 'string' ? { title: meta.title } : {}),\n ...(typeof meta.slug === 'string' ? { slug: meta.slug } : {}),\n ...(typeof meta.remixOfId === 'string'\n ? { remixOfId: meta.remixOfId }\n : {}),\n }\n }\n return null\n}\n\n/** Merge-writes vos.json; the legacy files are left alone (read-only compat). */\nexport function writeSyncState(\n dir: string,\n patch: Partial<SyncState> & { vosId: string },\n): SyncState {\n const merged = {\n ...(readSyncState(dir) ?? { versionId: null }),\n ...patch,\n } as SyncState\n writeFileSync(\n join(dir, SYNC_STATE_NAME),\n `${JSON.stringify(merged, null, 2)}\\n`,\n )\n return merged\n}\n\n// ---------------------------------------------------------------------------\n// The /changes payload (shape mirrored from the platform)\n// ---------------------------------------------------------------------------\n\nexport interface VersionChange {\n versionId?: string\n versionNumber?: number\n origin?: string\n label?: string | null\n note?: string | null\n summary?: string\n}\n\n/** Human lines for a changes walk — origin/label attributed, note indented. */\nexport function formatChanges(changes: readonly VersionChange[]): string[] {\n const lines: string[] = []\n for (const ch of changes) {\n const label = ch.label ? ` · ${ch.label}` : ''\n const who = ch.origin === 'studio' ? 'human' : (ch.origin ?? 'unknown')\n lines.push(\n `v${String(ch.versionNumber ?? '?')} (${who}${label}): ${ch.summary ?? ''}`,\n )\n if (ch.note) lines.push(` note: ${ch.note}`)\n }\n return lines\n}\n\n/**\n * The warnings a write came back with (a knob or Look the platform dropped),\n * one line each. A push that saved is not a push that kept everything.\n */\nexport function serverWarnings(\n body: Record<string, unknown>,\n log: (line: string) => void,\n): void {\n const warnings = Array.isArray(body.warnings) ? body.warnings : []\n for (const w of warnings) if (typeof w === 'string') log(`warning ${w}`)\n}\n","import { existsSync } from 'node:fs'\n\n/**\n * Which coding agent is driving this CLI, read from the environment the agent\n * spawned it in. Used ONLY to name the tool on a pushed version (`clientId`),\n * which the platform treats as display-only: attribution trust stays with the\n * credential, so a wrong or spoofed answer changes a label and nothing else.\n *\n * The signals follow `@vercel/detect-agent` (Apache-2.0), kept as a small\n * synchronous table because every push reads it: the cross-tool `AI_AGENT`\n * convention first, then each host's own marker. Returns a lowercase slug,\n * or null when nothing says an agent is here.\n */\nexport type Env = Record<string, string | undefined>\n\nconst SLUG = /^[a-z0-9][a-z0-9.-]{0,39}$/\n\n/** The markers each host sets in the shells it runs, in precedence order. */\nconst MARKERS: Array<[slug: string, test: (env: Env) => boolean]> = [\n ['cursor', (e) => !!e.CURSOR_TRACE_ID],\n [\n 'cursor-cli',\n (e) => !!e.CURSOR_AGENT || e.CURSOR_EXTENSION_HOST_ROLE === 'agent-exec',\n ],\n ['gemini-cli', (e) => !!e.GEMINI_CLI],\n ['codex', (e) => !!(e.CODEX_SANDBOX || e.CODEX_CI || e.CODEX_THREAD_ID)],\n ['antigravity', (e) => !!e.ANTIGRAVITY_AGENT],\n ['augment-cli', (e) => !!e.AUGMENT_AGENT],\n ['opencode', (e) => !!e.OPENCODE_CLIENT],\n [\n 'claude-code',\n (e) => !!(e.CLAUDECODE || e.CLAUDE_CODE) && !e.CLAUDE_CODE_IS_COWORK,\n ],\n ['claude-cowork', (e) => !!(e.CLAUDECODE || e.CLAUDE_CODE)],\n ['replit', (e) => !!e.REPL_ID],\n [\n 'github-copilot',\n (e) => !!(e.COPILOT_MODEL || e.COPILOT_ALLOW_ALL || e.COPILOT_GITHUB_TOKEN),\n ],\n]\n\nconst DEVIN_LOCAL_PATH = '/opt/.devin'\n\n/**\n * `AI_AGENT` is free text by convention (`claude-code_2-1-284_agent`,\n * `github-copilot`, `v0`): the tool's name is its leading run of\n * `[a-z0-9.-]`, lowercased, so a version or a role suffix never reaches the\n * label and nothing but a short slug ever leaves the machine.\n */\nexport function slugFromAiAgent(value: string): string | null {\n const head = value.trim().toLowerCase().split('_')[0] ?? ''\n if (head === 'github-copilot-cli') return 'github-copilot'\n return SLUG.test(head) ? head : null\n}\n\nexport function detectHostAgent(\n env: Env = process.env,\n exists: (path: string) => boolean = existsSync,\n): string | null {\n if (env.AI_AGENT) {\n const slug = slugFromAiAgent(env.AI_AGENT)\n if (slug) return slug\n }\n for (const [slug, test] of MARKERS) if (test(env)) return slug\n try {\n if (exists(DEVIN_LOCAL_PATH)) return 'devin'\n } catch {\n // An unreadable path is not an agent.\n }\n return null\n}\n"],"mappings":";;;AAoBA,IAAM,QAAQ,oBAAI,IAAY;AAC9B,IAAM,OAAO,oBAAI,IAAY;AAGtB,SAAS,WAA8C,KAAW;AACvE,SAAO,IAAI,MAAM,KAAK;AAAA,IACpB,IAAI,QAAQ,KAAK,UAAU;AACzB,UAAI,OAAO,QAAQ,SAAU,MAAK,IAAI,GAAG;AACzC,aAAO,QAAQ,IAAI,QAAQ,KAAK,QAAQ;AAAA,IAC1C;AAAA,IACA,IAAI,QAAQ,KAAK;AACf,UAAI,OAAO,QAAQ,SAAU,MAAK,IAAI,GAAG;AACzC,aAAO,QAAQ,IAAI,QAAQ,GAAG;AAAA,IAChC;AAAA;AAAA,IAEA,yBA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AK,GAAG,GAAG,KAAK,MAAM,GAAG,WAAW,EAAE;AAAA,IAC3E;AACA,QAAI,GAAG,KAAM,OAAM,KAAK,aAAa,GAAG,IAAI,EAAE;AAAA,EAChD;AACA,SAAO;AACT;AAMO,SAAS,eACd,MACA,KACM;AACN,QAAM,WAAW,MAAM,QAAQ,KAAK,QAAQ,IAAI,KAAK,WAAW,CAAC;AACjE,aAAW,KAAK,SAAU,KAAI,OAAO,MAAM,SAAU,KAAI,WAAW,CAAC,EAAE;AACzE;","names":["start","end","parseArgs","numFlag","mkdirSync","writeFileSync","homedir","join","existsSync","join","homedir","mkdirSync","writeFileSync"]}
|
package/dist/cli.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
stillOutFor,
|
|
20
20
|
stillWarnings,
|
|
21
21
|
videoFormat
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-DU3ANWU4.js";
|
|
23
23
|
import {
|
|
24
24
|
ASSET_ROUTE,
|
|
25
25
|
MEDIA_HEAD_BYTES,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
resolveMediaType,
|
|
35
35
|
serveFile,
|
|
36
36
|
unusedFlagsMessage
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-WVQAZTYU.js";
|
|
38
38
|
|
|
39
39
|
// src/cli.ts
|
|
40
40
|
import { writeFile } from "fs/promises";
|
|
@@ -803,7 +803,7 @@ async function cmdCheck(argv) {
|
|
|
803
803
|
const result = runCheck(parsed);
|
|
804
804
|
if (result.config) {
|
|
805
805
|
const baseDir = baseDirOf(source);
|
|
806
|
-
const { hostedLiteralWarnings } = await import("./assetManifest-
|
|
806
|
+
const { hostedLiteralWarnings } = await import("./assetManifest-RQYJYQ7Q.js");
|
|
807
807
|
const extra = [
|
|
808
808
|
...baseDir ? missingManifestFiles(result.config, baseDir) : [],
|
|
809
809
|
...hostedLiteralWarnings(result.config)
|
|
@@ -837,7 +837,7 @@ async function cmdCheck(argv) {
|
|
|
837
837
|
return result.ok ? EXIT_OK : EXIT_ERROR;
|
|
838
838
|
}
|
|
839
839
|
async function delegate(argv, viaAlias = false) {
|
|
840
|
-
const { run } = await import("./run-
|
|
840
|
+
const { run } = await import("./run-GYCIE77C.js");
|
|
841
841
|
if (viaAlias && argv[0]) {
|
|
842
842
|
process.stderr.write(
|
|
843
843
|
`note: "vos voila ${argv[0]}" is now "vos ${argv[0]}".
|
|
@@ -877,7 +877,7 @@ async function main() {
|
|
|
877
877
|
const engine = HELP_ENGINE.split("\n").filter(
|
|
878
878
|
(l) => l.startsWith(` vos ${cmd} `)
|
|
879
879
|
);
|
|
880
|
-
const { verbHelp } = await import("./run-
|
|
880
|
+
const { verbHelp } = await import("./run-GYCIE77C.js");
|
|
881
881
|
const take = verbHelp(cmd);
|
|
882
882
|
process.stdout.write(
|
|
883
883
|
`${engine.join("\n")}
|
|
@@ -909,7 +909,7 @@ ${take.includes("no such verb") ? "" : take}`
|
|
|
909
909
|
main().then(async (code) => {
|
|
910
910
|
if (code === EXIT_OK) {
|
|
911
911
|
const verb = process.argv[2] ?? "";
|
|
912
|
-
const { HELP } = await import("./run-
|
|
912
|
+
const { HELP } = await import("./run-GYCIE77C.js");
|
|
913
913
|
const documented = [
|
|
914
914
|
...helpFlagsFor(HELP_ENGINE, verb),
|
|
915
915
|
...helpFlagsFor(HELP, verb)
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
startTakeServer,
|
|
15
15
|
validateActions,
|
|
16
16
|
waitForPageDone
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CODEEH2Z.js";
|
|
18
18
|
import {
|
|
19
19
|
BrowserUnavailableError,
|
|
20
20
|
configDuration,
|
|
@@ -23,13 +23,13 @@ import {
|
|
|
23
23
|
previewPages,
|
|
24
24
|
renderStill,
|
|
25
25
|
renderVideo
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DU3ANWU4.js";
|
|
27
27
|
import {
|
|
28
28
|
RECORDING_NAME,
|
|
29
29
|
loadTake,
|
|
30
30
|
pullMedia,
|
|
31
31
|
takePaths
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-7CIAU4QP.js";
|
|
33
33
|
import {
|
|
34
34
|
apiError,
|
|
35
35
|
apiJson,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
readSyncState,
|
|
39
39
|
resolveCredential,
|
|
40
40
|
writeSyncState
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WVQAZTYU.js";
|
|
42
42
|
import "./chunk-6XPFWQKP.js";
|
|
43
43
|
import {
|
|
44
44
|
manifest
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
takeBackdrop,
|
|
7
7
|
takeBrowserArgs,
|
|
8
8
|
verbHelp
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-CODEEH2Z.js";
|
|
10
|
+
import "./chunk-DU3ANWU4.js";
|
|
11
|
+
import "./chunk-7CIAU4QP.js";
|
|
12
|
+
import "./chunk-WVQAZTYU.js";
|
|
13
13
|
import "./chunk-6XPFWQKP.js";
|
|
14
14
|
export {
|
|
15
15
|
HELP,
|
|
@@ -19,4 +19,4 @@ export {
|
|
|
19
19
|
takeBrowserArgs,
|
|
20
20
|
verbHelp
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=run-
|
|
22
|
+
//# sourceMappingURL=run-GYCIE77C.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vosjs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.0",
|
|
4
4
|
"description": "The vos CLI: record the real product from a scripted browser flow, auto-zoom from the cursor track, cut as data in doc.json, render deterministic video and stills, deliver a release's media per destination spec, and sync with vos.so. One binary, every verb, MIT.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"mediabunny": "^1.55.7",
|
|
53
53
|
"playwright": "^1.49.0",
|
|
54
54
|
"@vosjs/core": "^0.27.0",
|
|
55
|
+
"@vosjs/editor": "^1.4.0",
|
|
55
56
|
"@vosjs/elements": "^0.10.2",
|
|
56
57
|
"@vosjs/shared": "^0.6.0",
|
|
57
58
|
"@vosjs/render-core": "^0.3.17",
|
|
58
|
-
"@vosjs/editor": "^1.4.0",
|
|
59
59
|
"@vosjs/studio-core": "^0.35.2",
|
|
60
|
-
"@vosjs/
|
|
61
|
-
"@vosjs/
|
|
60
|
+
"@vosjs/tween": "^0.8.3",
|
|
61
|
+
"@vosjs/timeline": "^0.5.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@types/node": "^22",
|