@neta-art/cohub-cli 10.29.0 → 10.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/board-gpu/page.js +3011 -133
  2. package/dist/bootstrap.js +2 -4
  3. package/dist/build.json +1 -1
  4. package/dist/chunks/FilterPipe.js +145 -269
  5. package/dist/chunks/about.js +2 -3
  6. package/dist/chunks/app-realtime.js +113 -115
  7. package/dist/chunks/app-realtime2.js +1 -2
  8. package/dist/chunks/app-ref.js +4 -5
  9. package/dist/chunks/apps.js +8 -14
  10. package/dist/chunks/auth.js +1 -2
  11. package/dist/chunks/avatar.js +2 -4
  12. package/dist/chunks/binary-pins.js +1 -2
  13. package/dist/chunks/board-export-resources.js +55 -12
  14. package/dist/chunks/board-export.js +26 -21
  15. package/dist/chunks/board-export2.js +1 -2
  16. package/dist/chunks/board-kernel.js +2672 -1623
  17. package/dist/chunks/board-kernel2.js +2 -2
  18. package/dist/chunks/board-model.js +970 -0
  19. package/dist/chunks/board-profile.js +4 -5
  20. package/dist/chunks/board-simulate.js +6 -6
  21. package/dist/chunks/board-time.js +1 -2
  22. package/dist/chunks/boards.js +547 -23
  23. package/dist/chunks/browserAll.js +18 -35
  24. package/dist/chunks/channels.js +1 -2
  25. package/dist/chunks/client.js +637 -713
  26. package/dist/chunks/command-input.js +1 -2
  27. package/dist/chunks/commander.js +16 -22
  28. package/dist/chunks/cron-jobs.js +2 -3
  29. package/dist/chunks/daemon.js +18 -4
  30. package/dist/chunks/daemon2.js +1 -2
  31. package/dist/chunks/desktop.js +2 -3
  32. package/dist/chunks/endpoint-options.js +1 -2
  33. package/dist/chunks/env-proxy.js +4 -5
  34. package/dist/chunks/environment.js +2 -4
  35. package/dist/chunks/feedback.js +3 -4
  36. package/dist/chunks/generations.js +3 -4
  37. package/dist/chunks/host.js +1 -2
  38. package/dist/chunks/http-put.js +1 -2
  39. package/dist/chunks/id.js +77 -928
  40. package/dist/chunks/init.js +7 -12
  41. package/dist/chunks/install.js +142 -138
  42. package/dist/chunks/launch.js +4 -6
  43. package/dist/chunks/lexer.js +226 -66
  44. package/dist/chunks/local-media.js +1 -2
  45. package/dist/chunks/me.js +1 -2
  46. package/dist/chunks/media.js +1 -2
  47. package/dist/chunks/{themes.js → model-clips.js} +395 -43
  48. package/dist/chunks/models.js +3 -5
  49. package/dist/chunks/operands.js +1 -2
  50. package/dist/chunks/package-paths.js +1 -2
  51. package/dist/chunks/policy.js +1 -2
  52. package/dist/chunks/preferences.js +1 -2
  53. package/dist/chunks/profile.js +2 -3
  54. package/dist/chunks/prompts.js +1 -2
  55. package/dist/chunks/public.js +1 -2
  56. package/dist/chunks/public2.js +3 -4
  57. package/dist/chunks/references.js +3 -3
  58. package/dist/chunks/referrals.js +1 -2
  59. package/dist/chunks/rolldown-runtime.js +2 -3
  60. package/dist/chunks/rooms-connect.js +1 -2
  61. package/dist/chunks/rooms-connect2.js +1 -2
  62. package/dist/chunks/rooms-rtc.js +4 -6
  63. package/dist/chunks/rooms.js +2 -3
  64. package/dist/chunks/run.js +2 -3
  65. package/dist/chunks/runtime.js +6 -12
  66. package/dist/chunks/runtime2.js +2 -3
  67. package/dist/chunks/runtimes.js +1 -2
  68. package/dist/chunks/safe-remote-image.js +1 -2
  69. package/dist/chunks/schemas.js +58 -43
  70. package/dist/chunks/search.js +3 -3
  71. package/dist/chunks/self-update.js +4 -5
  72. package/dist/chunks/serve.js +11 -25
  73. package/dist/chunks/session-status.js +1 -2
  74. package/dist/chunks/skills.js +1 -2
  75. package/dist/chunks/spaces.js +26 -45
  76. package/dist/chunks/src.js +5 -9
  77. package/dist/chunks/supervisor.js +16 -28
  78. package/dist/chunks/supervisor2.js +1 -2
  79. package/dist/chunks/tasks.js +1 -2
  80. package/dist/chunks/user-lists.js +1 -2
  81. package/dist/chunks/version.js +1 -2
  82. package/dist/chunks/version2.js +1 -2
  83. package/dist/chunks/version3.js +3 -4
  84. package/dist/chunks/web.js +1 -2
  85. package/dist/runtime/native/pi-extension.js +1 -2
  86. package/dist/runtime/worker.js +2 -3
  87. package/package.json +11 -10
@@ -1,21 +1,21 @@
1
- import { t as packagePath } from "./package-paths.js";
2
- import { t as createClient } from "./client.js";
3
- import { dt as parseBoardMediaSource, ht as BOARD_CAMERA_VIEWPORT } from "./id.js";
4
- import { E as boardTimedMedia, S as boardTexturePixels, T as boardMediaSpans, _ as selectBoardExportAssets, a as describeBoardScriptLanes, b as boardMediaNaturalSize, c as boardRenderTheme, g as planBoardExport, h as boardExportView, i as createNodeBoardScriptHost, j as hasBoardScripts, k as parseBoardScriptInputs, m as boardAutoplayLoops, n as createNodeBoardRenderer, o as describeBoardExportWarning, p as createBoardRenderSampler, r as exportBoardImageBytes, s as prepareBoardExport, v as boardAssetKey, w as boardMediaRate, x as boardTextureEdge, y as boardAssetKeySource } from "./board-kernel.js";
5
- import { A as boardAnimatesScriptParams, T as buildBoardScene } from "./themes.js";
1
+ import { A as parseBoardMediaSource, I as BOARD_CAMERA_VIEWPORT } from "./board-model.js";
2
+ import { A as parseBoardScriptInputs, C as boardTextureEdge, D as boardTimedMedia, E as boardMediaSpans, M as hasBoardScripts, S as boardMediaNaturalSize, T as boardMediaRate, _ as boardDocumentUsesDepth, a as describeBoardScriptLanes, b as boardAssetKey, c as boardRenderTheme, g as planBoardExport, h as boardExportView, i as createNodeBoardScriptHost, m as boardAutoplayLoops, n as createNodeBoardRenderer, o as describeBoardExportWarning, p as createBoardRenderSampler, r as exportBoardImageBytes, s as prepareBoardExport, v as isBoardViewLevel, w as boardTexturePixels, x as boardAssetKeySource, y as selectBoardExportAssets } from "./board-kernel.js";
3
+ import { P as buildBoardScene, g as isBoardModelItem, z as boardAnimatesScriptParams } from "./model-clips.js";
6
4
  import { i as mediaVariantSize, n as imageVariantUrl, s as videoFrameUrl } from "./media.js";
7
5
  import { i as settleBoardDocument, n as BoardExportResourceError, r as createBoardExportImageBudget, s as loadBoardDocument } from "./board-export-resources.js";
8
- import { n as downloadPublicImage, r as downloadPublicVideo, t as downloadPublicAudio } from "./safe-remote-image.js";
9
6
  import { a as findBoardGpuBrowser, r as openBoardGpu } from "./daemon.js";
7
+ import { t as createClient } from "./client.js";
8
+ import { n as downloadPublicImage, r as downloadPublicVideo, t as downloadPublicAudio } from "./safe-remote-image.js";
9
+ import { t as packagePath } from "./package-paths.js";
10
10
  import { createRequire } from "node:module";
11
- import { execFile } from "node:child_process";
11
+ import { execFile as execFile$2 } from "node:child_process";
12
12
  import { tmpdir } from "node:os";
13
13
  import { constants as constants$1, existsSync } from "node:fs";
14
14
  import { dirname, join } from "node:path";
15
15
  import { randomUUID } from "node:crypto";
16
16
  import { copyFile, link, mkdir, mkdtemp, readFile, rename, rm, unlink, writeFile } from "node:fs/promises";
17
17
  import { debuglog, promisify } from "node:util";
18
- //#region src/board-fonts.ts
18
+ // src/board-fonts.ts
19
19
  const BOARD_EXPORT_FONTS = [
20
20
  {
21
21
  pkg: "@fontsource-variable/geist",
@@ -33,14 +33,13 @@ const BOARD_EXPORT_FONTS = [
33
33
  family: "Figtree Variable"
34
34
  }
35
35
  ];
36
- //#endregion
37
- //#region src/board-media-export.ts
38
- const execFile$2 = promisify(execFile);
36
+ // src/board-media-export.ts
37
+ const execFile$1 = promisify(execFile$2);
39
38
  const CHUNK_SECONDS = 4;
40
39
  const MAX_DECODE_FPS = 60;
41
40
  async function ffmpeg(args, signal) {
42
41
  try {
43
- return await execFile$2("ffmpeg", [
42
+ return await execFile$1("ffmpeg", [
44
43
  "-v",
45
44
  "error",
46
45
  ...args
@@ -80,7 +79,7 @@ function createBoardMediaFiles(spaceId, dir, signal) {
80
79
  let pending = audible.get(src);
81
80
  if (!pending) {
82
81
  pending = this.path(src, kind).then(async (path) => {
83
- const { stdout } = await execFile$2("ffprobe", [
82
+ const { stdout } = await execFile$1("ffprobe", [
84
83
  "-v",
85
84
  "error",
86
85
  "-select_streams",
@@ -101,7 +100,7 @@ function createBoardMediaFiles(spaceId, dir, signal) {
101
100
  let pending = durations.get(src);
102
101
  if (!pending) {
103
102
  pending = this.path(src, "video").then(async (path) => {
104
- const { stdout } = await execFile$2("ffprobe", [
103
+ const { stdout } = await execFile$1("ffprobe", [
105
104
  "-v",
106
105
  "error",
107
106
  "-show_entries",
@@ -237,9 +236,8 @@ async function boardAudioMix(spans, files, firstInput) {
237
236
  filter: `${chains.join(";")};${mixed}amix=inputs=${chains.length}:duration=longest:dropout_transition=0:normalize=0[aout]`
238
237
  };
239
238
  }
240
- //#endregion
241
- //#region src/board-export.ts
242
- const execFile$1 = promisify(execFile);
239
+ // src/board-export.ts
240
+ const execFile = promisify(execFile$2);
243
241
  const debugExport = debuglog("cohub:board-export");
244
242
  function resolveBundledFonts() {
245
243
  const require = createRequire(import.meta.url);
@@ -373,7 +371,7 @@ async function runBoardVideoExport(options) {
373
371
  const derivedFps = 1e3 / step;
374
372
  if (Math.abs(1e3 / options.fps - step) > .0015) throw new Error(`--fps must match the --at step (${derivedFps.toFixed(3)} fps).`);
375
373
  if (times.some((time, index) => index > 0 && Math.abs(time - times[index - 1] - step) > .0015)) throw new Error("Video export needs evenly spaced times.");
376
- await execFile$1("ffmpeg", ["-version"], { signal: options.signal }).catch(() => {
374
+ await execFile("ffmpeg", ["-version"], { signal: options.signal }).catch(() => {
377
375
  throw new Error("Video export needs ffmpeg. Install ffmpeg and try again.");
378
376
  });
379
377
  const document = options.document ?? await settleBoardDocument(options.spaceId, (await loadBoardDocument(options.spaceId, options.target)).document);
@@ -436,7 +434,7 @@ async function runBoardVideoExport(options) {
436
434
  memory: process.memoryUsage()
437
435
  });
438
436
  try {
439
- await execFile$1("ffmpeg", args, {
437
+ await execFile("ffmpeg", args, {
440
438
  encoding: "utf8",
441
439
  maxBuffer: 2097152,
442
440
  signal: options.signal
@@ -600,6 +598,7 @@ async function runBoardExport(options) {
600
598
  };
601
599
  let completed = 0;
602
600
  let decided = options.renderer === "canvas";
601
+ let liftChecked = false;
603
602
  const emit = async (frame) => {
604
603
  if (options.onFrame) await options.onFrame(frame, completed);
605
604
  else frames.push(frame);
@@ -674,10 +673,12 @@ async function runBoardExport(options) {
674
673
  if (!scripted) return;
675
674
  prepared = scripted;
676
675
  }
676
+ const lifts = boardDocumentUsesDepth(prepared.document) || prepared.camera !== void 0 && !isBoardViewLevel(prepared.camera.view) || options.withImages && prepared.plan.items.some(isBoardModelItem);
677
677
  if (!decided) {
678
678
  decided = true;
679
+ liftChecked = lifts;
679
680
  const shaded = (host?.shaders?.(prepared.document, time ?? 0) ?? []).map((owner) => owner.id);
680
- const browser = shaded.length ? findBoardGpuBrowser() : null;
681
+ const browser = shaded.length || lifts ? findBoardGpuBrowser() : null;
681
682
  if (browser) gpu = await launchGpu(browser);
682
683
  else if (host && shaded.length) {
683
684
  report(`Shaders in ${shaded.join(", ")} need Chrome, Chromium or Edge; install one or set COHUB_CHROME to draw them.`);
@@ -686,6 +687,10 @@ async function runBoardExport(options) {
686
687
  if (!scripted) return;
687
688
  prepared = scripted;
688
689
  }
690
+ } else if (lifts && !gpu && !liftChecked && options.renderer === "auto") {
691
+ liftChecked = true;
692
+ const browser = findBoardGpuBrowser();
693
+ if (browser) gpu = await launchGpu(browser);
689
694
  }
690
695
  const timed = boardTimedMedia(prepared.scene);
691
696
  media.push({
@@ -839,6 +844,7 @@ function gpuResources(spaceId, document, framePicture = () => void 0) {
839
844
  family
840
845
  }] : []),
841
846
  readModule: async (path) => new TextDecoder().decode((await readSpaceFileBytes(client, spaceId, path)).bytes),
847
+ readFile: async (path) => (await readSpaceFileBytes(client, spaceId, path)).bytes,
842
848
  async readPicture(request) {
843
849
  if ("background" in request) {
844
850
  const source = document.board.background.image && parseBoardMediaSource(document.board.background.image.src);
@@ -872,5 +878,4 @@ function describeWarning(warning) {
872
878
  if (warning.kind === "many-items") return `${warning.count} items exported.`;
873
879
  return describeBoardExportWarning(warning);
874
880
  }
875
- //#endregion
876
881
  export { readSpaceFileBytes as a, runBoardVideoExport as c, loadBoardTextures as i, boardExportAssetKey as n, resolveBundledFonts as o, gpuResources as r, runBoardExport as s, BOARD_EXPORT_FRAME_TIMEOUT_MS as t };
@@ -1,2 +1 @@
1
- import { a as readSpaceFileBytes, c as runBoardVideoExport, i as loadBoardTextures, n as boardExportAssetKey, o as resolveBundledFonts, r as gpuResources, s as runBoardExport, t as BOARD_EXPORT_FRAME_TIMEOUT_MS } from "./board-export.js";
2
- export { BOARD_EXPORT_FRAME_TIMEOUT_MS, boardExportAssetKey, gpuResources, loadBoardTextures, readSpaceFileBytes, resolveBundledFonts, runBoardExport, runBoardVideoExport };
1
+ export { t as BOARD_EXPORT_FRAME_TIMEOUT_MS, n as boardExportAssetKey, r as gpuResources, i as loadBoardTextures, a as readSpaceFileBytes, o as resolveBundledFonts, s as runBoardExport, c as runBoardVideoExport } from "./board-export.js";