@neta-art/cohub-cli 10.26.0 → 10.27.1
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 +5 -2
- package/dist/board-gpu/page.js +123 -123
- package/dist/build.json +1 -1
- package/dist/chunks/apps.js +51 -2
- package/dist/chunks/binary-pins.js +1 -1
- package/dist/chunks/board-export.js +11 -9
- package/dist/chunks/board-kernel.js +439 -47
- package/dist/chunks/board-kernel2.js +1 -1
- package/dist/chunks/board-profile.js +1 -1
- package/dist/chunks/board-simulate.js +34 -2
- package/dist/chunks/board-time.js +7 -5
- package/dist/chunks/boards.js +50 -16
- package/dist/chunks/client.js +24 -5
- package/dist/chunks/cron-jobs.js +55 -8
- package/dist/chunks/environment.js +3 -1
- package/dist/chunks/id.js +36 -3
- package/dist/chunks/me.js +40 -10
- package/dist/chunks/spaces.js +3 -4
- package/dist/chunks/supervisor.js +1 -1
- package/dist/chunks/themes.js +110 -13
- package/dist/chunks/user-lists.js +16 -0
- package/package.json +2 -2
package/dist/build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"commit":"
|
|
1
|
+
{"commit":"d3e094e","rootCommands":[["auth","Authentication management"],["boards","Read, write, animate and export Boards (by id or .board path)"],["profile","Manage your profile"],["me","Account-level data across your spaces"],["prompt [options] [content...]","Send or schedule a prompt in a space"],["completion [options] [content...]","Raw LLM completion with full message control"],["decision [options] [state...]","Answer yes/no, choice and score questions about text or images"],["spaces","Space management"],["labels","Manage personal labels"],["runtime","Connect a local workspace"],["generate [options] [prompt]","Generate multimodal outputs"],["models","List available LLM and multimodal models"],["prompts","Prompt template management"],["public","Upload and manage public Space files"],["skills","Skill management"],["search [options] [query]","Search spaces, chats, and label items"],["references","Inspect resource references (forks, mentions, tool calls, mods, file access)"],["referrals [options]","View and manage your referral link"],["tasks","Task runs"],["cron-jobs","Scheduled jobs"],["apps|works","App management"],["rooms","Take part in App rooms: join, read and publish events, set presence"],["feedback [options] [message...]","Send feedback or a bug report to the Cohub team"],["desktop","Drive the Cohub desktop that started this chat"],["version [options]","This CLI, the cohub on PATH, and the versions running Runtimes serve"]]}
|
package/dist/chunks/apps.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { C as error, D as json, E as handleHttp, O as jsonRequested, T as formatLocalDateTime, b as resolveSpace, ft as isHttpErrorCode, j as table, k as ok, n as createClientWithAccessToken, t as createClient } from "./client.js";
|
|
2
2
|
import { s as HttpError } from "./app-realtime.js";
|
|
3
|
+
import { t as isUserAppFilter } from "./user-lists.js";
|
|
3
4
|
import { r as getCohubContext, s as resolveExecutionAppId } from "./environment.js";
|
|
4
5
|
import { n as parseAppRef, t as getAppByRef } from "./app-ref.js";
|
|
5
6
|
import { n as putBytes, r as putLocalFile } from "./http-put.js";
|
|
@@ -934,9 +935,57 @@ function registerApps(program) {
|
|
|
934
935
|
const appsCmd = program.command("apps").description("App management").alias("works").hook("preAction", () => {
|
|
935
936
|
if (process.argv.slice(2).includes("works")) ok("Deprecated: `cohub works` is now `cohub apps`.");
|
|
936
937
|
});
|
|
937
|
-
appsCmd.command("ls").alias("list").description("List apps in the target space").option("--json", "Output as JSON").action(async (opts) => {
|
|
938
|
-
const spaceId = await resolveSpace(appsCmd, { home: true });
|
|
938
|
+
appsCmd.command("ls").alias("list").description("List apps in the target space, or across all spaces with --all").option("--all", "List apps across spaces").option("--filter <filter>", "With --all: mine, all, or disabled", "mine").option("--cursor <cursor>", "With --all: pagination cursor").option("--json", "Output as JSON").action(async (opts) => {
|
|
939
939
|
const client = createClient();
|
|
940
|
+
if (opts.all) {
|
|
941
|
+
if (!isUserAppFilter(opts.filter)) error("Invalid filter", "Expected mine, all, or disabled");
|
|
942
|
+
try {
|
|
943
|
+
const result = await client.user.listApps({
|
|
944
|
+
filter: opts.filter,
|
|
945
|
+
cursor: opts.cursor
|
|
946
|
+
});
|
|
947
|
+
if (jsonRequested(opts)) return json(result);
|
|
948
|
+
if (result.items.length === 0) return console.log(" (empty)");
|
|
949
|
+
table(result.items.map((app) => ({
|
|
950
|
+
...app,
|
|
951
|
+
spaceName: app.space.name
|
|
952
|
+
})), [
|
|
953
|
+
{
|
|
954
|
+
key: "id",
|
|
955
|
+
label: "ID"
|
|
956
|
+
},
|
|
957
|
+
{
|
|
958
|
+
key: "slug",
|
|
959
|
+
label: "Slug"
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
key: "spaceName",
|
|
963
|
+
label: "Space"
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
key: "status",
|
|
967
|
+
label: "Status"
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
key: "visibility",
|
|
971
|
+
label: "Visibility"
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
key: "latestVersion",
|
|
975
|
+
label: "Version"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
key: "updatedAt",
|
|
979
|
+
label: "Updated"
|
|
980
|
+
}
|
|
981
|
+
]);
|
|
982
|
+
if (result.pageInfo.nextCursor) console.log(`\n More: --cursor ${result.pageInfo.nextCursor}`);
|
|
983
|
+
} catch (e) {
|
|
984
|
+
handleHttp(e);
|
|
985
|
+
}
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
const spaceId = await resolveSpace(appsCmd, { home: true });
|
|
940
989
|
try {
|
|
941
990
|
const result = await client.apps.listBySpace(spaceId);
|
|
942
991
|
if (jsonRequested(opts)) return json(result);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as packagePath } from "./package-paths.js";
|
|
2
2
|
import { t as createClient } from "./client.js";
|
|
3
|
-
import { dt as parseBoardMediaSource } from "./id.js";
|
|
3
|
+
import { dt as parseBoardMediaSource, ht as BOARD_CAMERA_VIEWPORT } from "./id.js";
|
|
4
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 {
|
|
5
|
+
import { A as boardAnimatesScriptParams, T as buildBoardScene } from "./themes.js";
|
|
6
6
|
import { i as mediaVariantSize, n as imageVariantUrl, s as videoFrameUrl } from "./media.js";
|
|
7
7
|
import { i as settleBoardDocument, n as BoardExportResourceError, r as createBoardExportImageBudget, s as loadBoardDocument } from "./board-export-resources.js";
|
|
8
8
|
import { n as downloadPublicImage, r as downloadPublicVideo, t as downloadPublicAudio } from "./safe-remote-image.js";
|
|
@@ -371,8 +371,8 @@ async function runBoardVideoExport(options) {
|
|
|
371
371
|
const step = times[1] - times[0];
|
|
372
372
|
if (!Number.isFinite(step) || step <= 0) throw new Error("Video export needs an increasing --at range.");
|
|
373
373
|
const derivedFps = 1e3 / step;
|
|
374
|
-
if (Math.abs(options.fps -
|
|
375
|
-
if (times.some((time, index) => index > 0 && Math.abs(time - times[index - 1] - step) > .
|
|
374
|
+
if (Math.abs(1e3 / options.fps - step) > .0015) throw new Error(`--fps must match the --at step (${derivedFps.toFixed(3)} fps).`);
|
|
375
|
+
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
376
|
await execFile$1("ffmpeg", ["-version"], { signal: options.signal }).catch(() => {
|
|
377
377
|
throw new Error("Video export needs ffmpeg. Install ffmpeg and try again.");
|
|
378
378
|
});
|
|
@@ -472,7 +472,9 @@ async function runBoardExport(options) {
|
|
|
472
472
|
options.signal?.throwIfAborted();
|
|
473
473
|
const document = options.document ?? await settleBoardDocument(options.spaceId, (await loadBoardDocument(options.spaceId, options.target)).document);
|
|
474
474
|
const inputs = options.inputs ? parseBoardScriptInputs(options.inputs) : void 0;
|
|
475
|
-
|
|
475
|
+
const animation = options.animation ? document.animations[options.animation] : void 0;
|
|
476
|
+
if (options.animation && !animation) throw new Error(`Animation ${options.animation} does not exist.`);
|
|
477
|
+
const camera = options.camera === "viewport" ? { ...animation?.viewport ?? BOARD_CAMERA_VIEWPORT } : options.camera;
|
|
476
478
|
const times = options.times?.length ? options.times : [null];
|
|
477
479
|
const timeoutMs = options.timeoutMs ?? 12e4;
|
|
478
480
|
const imageMemoryBytes = (options.imageMemoryMiB ?? 256) * 1024 ** 2;
|
|
@@ -529,7 +531,7 @@ async function runBoardExport(options) {
|
|
|
529
531
|
...options.padding === void 0 ? {} : { padding: options.padding }
|
|
530
532
|
});
|
|
531
533
|
if (!plan) return null;
|
|
532
|
-
const region = times.length > 1 && !
|
|
534
|
+
const region = times.length > 1 && !camera ? {
|
|
533
535
|
kind: "rect",
|
|
534
536
|
rect: plan.world
|
|
535
537
|
} : options.region;
|
|
@@ -537,7 +539,7 @@ async function runBoardExport(options) {
|
|
|
537
539
|
const first = prepareBoardExport(document, {
|
|
538
540
|
sampler,
|
|
539
541
|
region,
|
|
540
|
-
camera
|
|
542
|
+
camera,
|
|
541
543
|
scale: options.scale,
|
|
542
544
|
padding: times.length > 1 ? 0 : options.padding,
|
|
543
545
|
...firstTime === null ? {} : { at: {
|
|
@@ -637,7 +639,7 @@ async function runBoardExport(options) {
|
|
|
637
639
|
host?.clearFrames();
|
|
638
640
|
const frameOptions = {
|
|
639
641
|
sampler,
|
|
640
|
-
camera
|
|
642
|
+
camera,
|
|
641
643
|
...time === null ? {} : { at: {
|
|
642
644
|
animation: options.animation,
|
|
643
645
|
time
|
|
@@ -727,7 +729,7 @@ async function runBoardExport(options) {
|
|
|
727
729
|
const result = await gpu.render({
|
|
728
730
|
time,
|
|
729
731
|
region,
|
|
730
|
-
...
|
|
732
|
+
...camera ? { camera } : {},
|
|
731
733
|
scale: options.scale,
|
|
732
734
|
...times.length > 1 || options.padding === void 0 ? {} : { padding: options.padding },
|
|
733
735
|
background: options.background,
|