@neta-art/cohub-cli 10.29.1 → 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.
- package/dist/board-gpu/page.js +3011 -133
- package/dist/bootstrap.js +2 -4
- package/dist/build.json +1 -1
- package/dist/chunks/FilterPipe.js +145 -269
- package/dist/chunks/about.js +2 -3
- package/dist/chunks/app-realtime.js +113 -115
- package/dist/chunks/app-realtime2.js +1 -2
- package/dist/chunks/app-ref.js +4 -5
- package/dist/chunks/apps.js +8 -14
- package/dist/chunks/auth.js +1 -2
- package/dist/chunks/avatar.js +2 -4
- package/dist/chunks/binary-pins.js +1 -2
- package/dist/chunks/board-export-resources.js +55 -12
- package/dist/chunks/board-export.js +26 -21
- package/dist/chunks/board-export2.js +1 -2
- package/dist/chunks/board-kernel.js +2672 -1623
- package/dist/chunks/board-kernel2.js +2 -2
- package/dist/chunks/board-model.js +970 -0
- package/dist/chunks/board-profile.js +4 -5
- package/dist/chunks/board-simulate.js +6 -6
- package/dist/chunks/board-time.js +1 -2
- package/dist/chunks/boards.js +547 -23
- package/dist/chunks/browserAll.js +18 -35
- package/dist/chunks/channels.js +1 -2
- package/dist/chunks/client.js +637 -713
- package/dist/chunks/command-input.js +1 -2
- package/dist/chunks/commander.js +16 -22
- package/dist/chunks/cron-jobs.js +2 -3
- package/dist/chunks/daemon.js +18 -4
- package/dist/chunks/daemon2.js +1 -2
- package/dist/chunks/desktop.js +2 -3
- package/dist/chunks/endpoint-options.js +1 -2
- package/dist/chunks/env-proxy.js +4 -5
- package/dist/chunks/environment.js +2 -4
- package/dist/chunks/feedback.js +3 -4
- package/dist/chunks/generations.js +3 -4
- package/dist/chunks/host.js +1 -2
- package/dist/chunks/http-put.js +1 -2
- package/dist/chunks/id.js +77 -928
- package/dist/chunks/init.js +7 -12
- package/dist/chunks/install.js +142 -138
- package/dist/chunks/launch.js +4 -6
- package/dist/chunks/lexer.js +226 -66
- package/dist/chunks/local-media.js +1 -2
- package/dist/chunks/me.js +1 -2
- package/dist/chunks/media.js +1 -2
- package/dist/chunks/{themes.js → model-clips.js} +395 -43
- package/dist/chunks/models.js +3 -5
- package/dist/chunks/operands.js +1 -2
- package/dist/chunks/package-paths.js +1 -2
- package/dist/chunks/policy.js +1 -2
- package/dist/chunks/preferences.js +1 -2
- package/dist/chunks/profile.js +2 -3
- package/dist/chunks/prompts.js +1 -2
- package/dist/chunks/public.js +1 -2
- package/dist/chunks/public2.js +3 -4
- package/dist/chunks/references.js +3 -3
- package/dist/chunks/referrals.js +1 -2
- package/dist/chunks/rolldown-runtime.js +2 -3
- package/dist/chunks/rooms-connect.js +1 -2
- package/dist/chunks/rooms-connect2.js +1 -2
- package/dist/chunks/rooms-rtc.js +4 -6
- package/dist/chunks/rooms.js +2 -3
- package/dist/chunks/run.js +2 -3
- package/dist/chunks/runtime.js +6 -12
- package/dist/chunks/runtime2.js +2 -3
- package/dist/chunks/runtimes.js +1 -2
- package/dist/chunks/safe-remote-image.js +1 -2
- package/dist/chunks/schemas.js +58 -43
- package/dist/chunks/search.js +3 -3
- package/dist/chunks/self-update.js +4 -5
- package/dist/chunks/serve.js +11 -25
- package/dist/chunks/session-status.js +1 -2
- package/dist/chunks/skills.js +1 -2
- package/dist/chunks/spaces.js +26 -45
- package/dist/chunks/src.js +5 -9
- package/dist/chunks/supervisor.js +16 -28
- package/dist/chunks/supervisor2.js +1 -2
- package/dist/chunks/tasks.js +1 -2
- package/dist/chunks/user-lists.js +1 -2
- package/dist/chunks/version.js +1 -2
- package/dist/chunks/version2.js +1 -2
- package/dist/chunks/version3.js +3 -4
- package/dist/chunks/web.js +1 -2
- package/dist/runtime/native/pi-extension.js +1 -2
- package/dist/runtime/worker.js +2 -3
- package/package.json +11 -10
package/dist/chunks/serve.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as readAuthSession, F as AuthRequiredError, G as revokeAndClearAuthSession, H as requestDeviceCode, I as authSessionPath, W as resolveAccessToken, Y as readRuntimeSpaceBindings, Z as runtimeSpaceBindingsPath, a as findLocalWorkspace, at as APP_RUNTIME_HAPTICS, d as runtimeInstancesRoot, f as stopRuntimeInstance, h as currentIdentityKey, i as connectLocalWorkspace, l as requestRuntimeInstance, m as clearHomeSpaceCache, nt as LocalWorkspaceUnavailableError, p as watchRuntimeInstance, s as controlRuntimeInstance, tt as LocalWorkspaceRpcError, u as runtimeInstanceDirectory, v as jwtClaim, xt as displayIdSchema, z as pollDeviceCode } from "./client.js";
|
|
2
2
|
import { _ as union, a as array, b as uuid, c as discriminatedUnion, d as literal, f as number, h as string, i as _undefined, m as record, n as _enum, o as base64, p as object, s as boolean, v as unknown, y as url } from "./schemas.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as writeRuntimePreferences, t as readRuntimePreferences } from "./preferences.js";
|
|
3
|
+
import { t as describeCli } from "./about.js";
|
|
5
4
|
import { t as EXPECTED_IDENTITY_ENV } from "./launch.js";
|
|
5
|
+
import { n as writeRuntimePreferences, t as readRuntimePreferences } from "./preferences.js";
|
|
6
6
|
import { n as hostRuntimes, r as rememberHostRuntime, t as forgetHostRuntime } from "./runtimes.js";
|
|
7
|
-
import { t as
|
|
7
|
+
import { t as packagePath } from "./package-paths.js";
|
|
8
8
|
import { execFile, spawn } from "node:child_process";
|
|
9
9
|
import { homedir } from "node:os";
|
|
10
10
|
import { existsSync, mkdirSync, watch } from "node:fs";
|
|
@@ -12,13 +12,6 @@ import { basename, dirname, join, relative, sep } from "node:path";
|
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import { createInterface } from "node:readline";
|
|
14
14
|
import { opendir, readdir, realpath, stat } from "node:fs/promises";
|
|
15
|
-
//#region ../protocol/src/app-runtime.ts
|
|
16
|
-
const APP_RUNTIME_HAPTICS = [
|
|
17
|
-
"tick",
|
|
18
|
-
"confirm",
|
|
19
|
-
"reject",
|
|
20
|
-
"longPress"
|
|
21
|
-
];
|
|
22
15
|
const hostBridgeCapabilitySchema = _enum([
|
|
23
16
|
"auth.token",
|
|
24
17
|
"auth.signIn",
|
|
@@ -470,8 +463,7 @@ object({
|
|
|
470
463
|
}).strict();
|
|
471
464
|
const HOST_SERVICE_SHELL_EVENTS = { open: "shell.open" };
|
|
472
465
|
const hostShellOpenSchema = object({ url: url({ protocol: /^https?$/ }).max(8192) }).strict();
|
|
473
|
-
|
|
474
|
-
//#region ../sdk/src/host-bridge.ts
|
|
466
|
+
// ../sdk/src/host-bridge.ts
|
|
475
467
|
var HostBridgeErrorClass = class extends Error {
|
|
476
468
|
code;
|
|
477
469
|
constructor(code, message) {
|
|
@@ -489,8 +481,7 @@ var HostBridgeErrorClass = class extends Error {
|
|
|
489
481
|
return this.code === HOST_BRIDGE_ERROR.unsupported;
|
|
490
482
|
}
|
|
491
483
|
};
|
|
492
|
-
|
|
493
|
-
//#region src/host/auth.ts
|
|
484
|
+
// src/host/auth.ts
|
|
494
485
|
const REOPEN_AFTER_MS = 1e4;
|
|
495
486
|
function snapshot() {
|
|
496
487
|
const session = readAuthSession();
|
|
@@ -618,8 +609,7 @@ var HostAuth = class {
|
|
|
618
609
|
}));
|
|
619
610
|
}
|
|
620
611
|
};
|
|
621
|
-
|
|
622
|
-
//#region src/host/login-env.ts
|
|
612
|
+
// src/host/login-env.ts
|
|
623
613
|
const TIMEOUT_MS = 1e4;
|
|
624
614
|
const SCOPED = /^(COHUB_.*|ENV)$/;
|
|
625
615
|
const quote = (value) => `'${value.replaceAll("'", `'\\''`)}'`;
|
|
@@ -653,8 +643,7 @@ async function loginShellEnv(base = process.env, platform = process.platform) {
|
|
|
653
643
|
return base;
|
|
654
644
|
}
|
|
655
645
|
}
|
|
656
|
-
|
|
657
|
-
//#region src/host/runtime.ts
|
|
646
|
+
// src/host/runtime.ts
|
|
658
647
|
const MAX_FOLDERS = 1e4;
|
|
659
648
|
const MAX_VOLUMES = 16;
|
|
660
649
|
const DISPLAY_CONTROL_MS = 15e3;
|
|
@@ -1094,8 +1083,7 @@ var DeviceRuntimeHost = class {
|
|
|
1094
1083
|
throw new Error(reason || `Runtime exited (${code})`);
|
|
1095
1084
|
}
|
|
1096
1085
|
};
|
|
1097
|
-
|
|
1098
|
-
//#region src/host/workspaces.ts
|
|
1086
|
+
// src/host/workspaces.ts
|
|
1099
1087
|
async function callLocalWorkspace(spaceId, method, params) {
|
|
1100
1088
|
const endpoint = await findLocalWorkspace(spaceId);
|
|
1101
1089
|
if (endpoint) try {
|
|
@@ -1109,8 +1097,7 @@ async function callLocalWorkspace(spaceId, method, params) {
|
|
|
1109
1097
|
}
|
|
1110
1098
|
throw new HostBridgeErrorClass(HOST_BRIDGE_ERROR.unavailable, "This device does not serve that Space");
|
|
1111
1099
|
}
|
|
1112
|
-
|
|
1113
|
-
//#region src/host/serve.ts
|
|
1100
|
+
// src/host/serve.ts
|
|
1114
1101
|
const CAPABILITIES = [
|
|
1115
1102
|
"auth.token",
|
|
1116
1103
|
"auth.signIn",
|
|
@@ -1232,7 +1219,7 @@ async function serveHost(entry = packagePath("bin", "cohub.js")) {
|
|
|
1232
1219
|
setTimeout(() => void about().catch(() => void 0), 3e3).unref();
|
|
1233
1220
|
const input = createInterface({
|
|
1234
1221
|
input: process.stdin,
|
|
1235
|
-
crlfDelay:
|
|
1222
|
+
crlfDelay: 1e400
|
|
1236
1223
|
});
|
|
1237
1224
|
input.on("line", (line) => {
|
|
1238
1225
|
if (line.length <= MAX_LINE) answer(line);
|
|
@@ -1242,5 +1229,4 @@ async function serveHost(entry = packagePath("bin", "cohub.js")) {
|
|
|
1242
1229
|
await runtime.stopOwnSharing();
|
|
1243
1230
|
runtime.close();
|
|
1244
1231
|
}
|
|
1245
|
-
//#endregion
|
|
1246
1232
|
export { serveHost };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/session-status.ts
|
|
2
2
|
function sessionStatusText(session) {
|
|
3
3
|
const turn = session.activeTurn;
|
|
4
4
|
if (turn) return turn.status === "abort_requested" ? "stopping" : turn.status;
|
|
@@ -20,5 +20,4 @@ function sessionArchiveFilter(opts) {
|
|
|
20
20
|
}
|
|
21
21
|
return opts.archived ? "only" : opts.all ? "include" : void 0;
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { sessionArchiveFilter as n, SESSION_STATUS_COLUMN as t };
|
package/dist/chunks/skills.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as json, E as handleHttp, O as jsonRequested, j as table, t as createClient } from "./client.js";
|
|
2
|
-
|
|
2
|
+
// src/commands/skills.ts
|
|
3
3
|
function registerSkills(program) {
|
|
4
4
|
program.command("skills").description("Skill management").command("ls").alias("list").description("List skills available for slash commands").option("--space <id>", "Filter by space").option("--json", "Output as JSON").action(async (opts) => {
|
|
5
5
|
const client = createClient();
|
|
@@ -31,5 +31,4 @@ function registerSkills(program) {
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { registerSkills };
|
package/dist/chunks/spaces.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { C as MODEL_THINKING_LEVELS, i as isApprovalMode, t as APPROVAL_MODES, w as isModelThinkingLevel, x as harnessSchema } from "./runtime.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as uploadChatImageAsset, o as UPLOAD_MAX_FILE_BYTES, r as uploadLikeStickerAsset, t as uploadAvatarAsset } from "./avatar.js";
|
|
4
|
-
import { o as mimeTypeForPath } from "./id.js";
|
|
5
|
-
import { d as normalizeRequestSource, l as joinApiUrl, p as isUuidLike } from "./app-realtime.js";
|
|
2
|
+
import { d as normalizeRequestSource, l as joinApiUrl, m as isUuidLike } from "./app-realtime.js";
|
|
6
3
|
import { a as resolveApiBaseUrl, o as resolveCohubEnvironment } from "./environment.js";
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import { r as putLocalFile } from "./http-put.js";
|
|
4
|
+
import { n as uploadChatImageAsset, o as UPLOAD_MAX_FILE_BYTES, r as uploadLikeStickerAsset, t as uploadAvatarAsset } from "./avatar.js";
|
|
5
|
+
import { C as error, Ct as splitDisplayText, D as json, E as handleHttp, L as authSource, M as truncateText, N as warn, O as jsonRequested, St as normalizeDisplayPoint, T as formatLocalDateTime, _ as failSpaceTarget, _t as displayActStepSchema, b as resolveSpace, bt as DISPLAY_SYSTEM_ACTIONS, et as buildSpaceInvitePath, g as explicitSpace, gt as DISPLAY_RECORDINGS_DIR, ht as DISPLAY_HANDOVER_WAIT_MS, j as table, k as ok, mt as DISPLAY_HANDOVER_MAX_MS, nt as LocalWorkspaceUnavailableError, pt as DISPLAY_HANDOVER_DEFAULT_MS, r as createRealtimeClient, rt as localWorkspaceHttpError, t as createClient, vt as DISPLAY_ELEMENT_REF_PATTERN, w as formatEpochMs, x as resolveSpaceRef, yt as DISPLAY_ELEMENT_ROLES } from "./client.js";
|
|
10
6
|
import { n as readPromptContent, t as collectOption } from "./command-input.js";
|
|
11
7
|
import { n as sessionArchiveFilter, t as SESSION_STATUS_COLUMN } from "./session-status.js";
|
|
8
|
+
import { o as mimeTypeForPath } from "./id.js";
|
|
9
|
+
import { r as putLocalFile } from "./http-put.js";
|
|
12
10
|
import { n as Option } from "./commander.js";
|
|
11
|
+
import { i as parseSpaceFileOperand, r as parseCopyOperand, t as InvalidFileOperandError } from "./operands.js";
|
|
12
|
+
import { t as webUrl } from "./web.js";
|
|
13
13
|
import { homedir } from "node:os";
|
|
14
14
|
import { createWriteStream, openAsBlob } from "node:fs";
|
|
15
15
|
import { basename, dirname, join, posix, relative, resolve, sep } from "node:path";
|
|
@@ -18,7 +18,7 @@ import { Readable } from "node:stream";
|
|
|
18
18
|
import { cp, lstat, mkdir, readFile, readdir, rename, rm, stat, utimes, writeFile } from "node:fs/promises";
|
|
19
19
|
import { pipeline } from "node:stream/promises";
|
|
20
20
|
import { once } from "node:events";
|
|
21
|
-
|
|
21
|
+
// ../protocol/dist/upload-errors.js
|
|
22
22
|
/**
|
|
23
23
|
* Split entries into batches that respect the batch byte and file caps, keeping
|
|
24
24
|
* input order. A single entry larger than the batch byte cap still gets its own
|
|
@@ -43,8 +43,7 @@ function batchUploadEntries(entries, sizeOf, options = {}) {
|
|
|
43
43
|
if (batch.length > 0) batches.push(batch);
|
|
44
44
|
return batches;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
//#region ../protocol/src/display/actions.ts
|
|
46
|
+
// ../protocol/dist/display/actions.js
|
|
48
47
|
const TAP_MS = 60;
|
|
49
48
|
const LONG_PRESS_MS = 800;
|
|
50
49
|
const SWIPE_MS = 300;
|
|
@@ -272,8 +271,7 @@ function compileDisplayPlan(actions, width, height) {
|
|
|
272
271
|
return parsed.data;
|
|
273
272
|
});
|
|
274
273
|
}
|
|
275
|
-
|
|
276
|
-
//#region ../protocol/src/turn-origin.ts
|
|
274
|
+
// ../protocol/dist/turn-origin.js
|
|
277
275
|
const SESSION_TURN_ORIGIN_KINDS = [
|
|
278
276
|
"prompt",
|
|
279
277
|
"scheduled_prompt",
|
|
@@ -310,11 +308,9 @@ const readSessionTurnOrigin = (meta, spaceId) => {
|
|
|
310
308
|
kind: "background_task"
|
|
311
309
|
});
|
|
312
310
|
};
|
|
313
|
-
|
|
314
|
-
//#region ../protocol/src/turn-reply.ts
|
|
311
|
+
// ../protocol/dist/turn-reply.js
|
|
315
312
|
const isSessionTurnReplyMode = (value) => value === "note" || value === "prompt";
|
|
316
|
-
|
|
317
|
-
//#region ../protocol/src/sent-turns.ts
|
|
313
|
+
// ../protocol/dist/sent-turns.js
|
|
318
314
|
const record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
319
315
|
const normalizeSentTurnRef = (value) => {
|
|
320
316
|
const input = record(value);
|
|
@@ -349,8 +345,7 @@ const readSentTurns = (meta) => {
|
|
|
349
345
|
}
|
|
350
346
|
return refs;
|
|
351
347
|
};
|
|
352
|
-
|
|
353
|
-
//#region ../protocol/src/speech.ts
|
|
348
|
+
// ../protocol/dist/speech.js
|
|
354
349
|
function isRecord(value) {
|
|
355
350
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
356
351
|
}
|
|
@@ -366,8 +361,7 @@ function readTurnSpeech(meta, voice) {
|
|
|
366
361
|
segments
|
|
367
362
|
} : null;
|
|
368
363
|
}
|
|
369
|
-
|
|
370
|
-
//#region src/space-files/limit.ts
|
|
364
|
+
// src/space-files/limit.ts
|
|
371
365
|
function createLimiter(concurrency) {
|
|
372
366
|
let active = 0;
|
|
373
367
|
const waiting = [];
|
|
@@ -382,8 +376,7 @@ function createLimiter(concurrency) {
|
|
|
382
376
|
}
|
|
383
377
|
};
|
|
384
378
|
}
|
|
385
|
-
|
|
386
|
-
//#region src/space-files/upload.ts
|
|
379
|
+
// src/space-files/upload.ts
|
|
387
380
|
const PUT_CONCURRENCY = 4;
|
|
388
381
|
const uploadsDirectly = async (files) => Boolean((await files.workspace())?.put);
|
|
389
382
|
async function uploadLocalFiles(files, entries, options = {}) {
|
|
@@ -475,8 +468,7 @@ async function uploadThroughApi(files, entries, options) {
|
|
|
475
468
|
uploadIds
|
|
476
469
|
};
|
|
477
470
|
}
|
|
478
|
-
|
|
479
|
-
//#region src/commands/decision.ts
|
|
471
|
+
// src/commands/decision.ts
|
|
480
472
|
const REMOTE_URL = /^https?:\/\//i;
|
|
481
473
|
async function readJsonObject(source, label) {
|
|
482
474
|
const text = source.trim().startsWith("{") ? source : await readFile(source, "utf-8").catch(() => error(`Cannot read ${label}`, source));
|
|
@@ -577,8 +569,7 @@ Examples:
|
|
|
577
569
|
cohub decision "Duplicate charge?" --image receipt.png -q questions.json
|
|
578
570
|
cohub decision --input request.json`).action((words, opts) => runDecisionCommand(parent, words, opts));
|
|
579
571
|
}
|
|
580
|
-
|
|
581
|
-
//#region src/commands/space-commerce.ts
|
|
572
|
+
// src/commands/space-commerce.ts
|
|
582
573
|
const PRODUCT_STATUSES = ["draft", "active"];
|
|
583
574
|
const PRODUCT_UPDATE_STATUSES = [
|
|
584
575
|
"draft",
|
|
@@ -1006,8 +997,7 @@ Examples:
|
|
|
1006
997
|
}
|
|
1007
998
|
});
|
|
1008
999
|
}
|
|
1009
|
-
|
|
1010
|
-
//#region src/space-files/transfer.ts
|
|
1000
|
+
// src/space-files/transfer.ts
|
|
1011
1001
|
var CopyAbortError = class extends Error {
|
|
1012
1002
|
name = "CopyAbortError";
|
|
1013
1003
|
};
|
|
@@ -1303,8 +1293,7 @@ async function copyLocal(input) {
|
|
|
1303
1293
|
}
|
|
1304
1294
|
return result;
|
|
1305
1295
|
}
|
|
1306
|
-
|
|
1307
|
-
//#region src/commands/space-files.ts
|
|
1296
|
+
// src/commands/space-files.ts
|
|
1308
1297
|
function fail(e) {
|
|
1309
1298
|
if (e instanceof InvalidFileOperandError || e instanceof CopyAbortError) return error(e.message);
|
|
1310
1299
|
return failSpaceTarget(e);
|
|
@@ -1503,8 +1492,7 @@ Examples:
|
|
|
1503
1492
|
cohub -s <spaceId> spaces files cp -r other:docs docs
|
|
1504
1493
|
cohub spaces files cp /tmp/chart.png <spaceId>:assets/`).action((paths, opts) => copyFiles(spacesCmd, paths, opts));
|
|
1505
1494
|
}
|
|
1506
|
-
|
|
1507
|
-
//#region src/commands/space-wallet.ts
|
|
1495
|
+
// src/commands/space-wallet.ts
|
|
1508
1496
|
const usd = (value) => `$${value.toFixed(2)}`;
|
|
1509
1497
|
const uncertain = (cause) => {
|
|
1510
1498
|
const status = cause.status;
|
|
@@ -1704,8 +1692,7 @@ function registerSpaceWallet(spaces) {
|
|
|
1704
1692
|
}
|
|
1705
1693
|
});
|
|
1706
1694
|
}
|
|
1707
|
-
|
|
1708
|
-
//#region src/commands/space-activity.ts
|
|
1695
|
+
// src/commands/space-activity.ts
|
|
1709
1696
|
const DEFAULT_DAYS$1 = 30;
|
|
1710
1697
|
const MAX_DAYS$1 = 365;
|
|
1711
1698
|
var InvalidSpaceActivityDaysError = class extends Error {
|
|
@@ -1915,8 +1902,7 @@ function registerSpaceActivity(spacesCmd, dependencies = {}) {
|
|
|
1915
1902
|
}
|
|
1916
1903
|
});
|
|
1917
1904
|
}
|
|
1918
|
-
|
|
1919
|
-
//#region src/commands/space-displays.ts
|
|
1905
|
+
// src/commands/space-displays.ts
|
|
1920
1906
|
const DIRECTIONS = [
|
|
1921
1907
|
"up",
|
|
1922
1908
|
"down",
|
|
@@ -2654,8 +2640,7 @@ function registerRecord(displays, spacesCmd) {
|
|
|
2654
2640
|
}
|
|
2655
2641
|
});
|
|
2656
2642
|
}
|
|
2657
|
-
|
|
2658
|
-
//#region src/commands/space-invitations.ts
|
|
2643
|
+
// src/commands/space-invitations.ts
|
|
2659
2644
|
const SPACE_ROLES$1 = [
|
|
2660
2645
|
"host",
|
|
2661
2646
|
"builder",
|
|
@@ -2827,8 +2812,7 @@ function registerSpaceInvitations(spacesCommand, dependencies = { createClient }
|
|
|
2827
2812
|
});
|
|
2828
2813
|
return invitations;
|
|
2829
2814
|
}
|
|
2830
|
-
|
|
2831
|
-
//#region src/commands/space-turns.ts
|
|
2815
|
+
// src/commands/space-turns.ts
|
|
2832
2816
|
const SPACE_TURN_AUTHORS = [
|
|
2833
2817
|
"any",
|
|
2834
2818
|
"self",
|
|
@@ -3023,8 +3007,7 @@ function registerSpaceTurns(spacesCmd, dependencies = {}) {
|
|
|
3023
3007
|
});
|
|
3024
3008
|
return turnsCmd;
|
|
3025
3009
|
}
|
|
3026
|
-
|
|
3027
|
-
//#region src/commands/space-webhooks.ts
|
|
3010
|
+
// src/commands/space-webhooks.ts
|
|
3028
3011
|
function parseBody(raw) {
|
|
3029
3012
|
if (raw === void 0) return null;
|
|
3030
3013
|
try {
|
|
@@ -3082,8 +3065,7 @@ function registerSpaceWebhooks(spacesCmd, deps = {}) {
|
|
|
3082
3065
|
}
|
|
3083
3066
|
});
|
|
3084
3067
|
}
|
|
3085
|
-
|
|
3086
|
-
//#region src/commands/spaces.ts
|
|
3068
|
+
// src/commands/spaces.ts
|
|
3087
3069
|
const cliEnv = resolveCohubEnvironment();
|
|
3088
3070
|
const defaultIdleTtlSeconds = cliEnv === "prod" ? 3600 : 300;
|
|
3089
3071
|
const SPACE_ROLES = [
|
|
@@ -5160,5 +5142,4 @@ function registerCheckpoints(spacesCmd) {
|
|
|
5160
5142
|
}
|
|
5161
5143
|
});
|
|
5162
5144
|
}
|
|
5163
|
-
//#endregion
|
|
5164
5145
|
export { registerPrompt, registerSpaces };
|
package/dist/chunks/src.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as buildInfo, t as CLI_VERSION } from "./version2.js";
|
|
2
1
|
import { r as Help, t as Command } from "./commander.js";
|
|
3
2
|
import { n as registerEndpointOptions } from "./endpoint-options.js";
|
|
4
|
-
|
|
3
|
+
import { n as buildInfo, t as CLI_VERSION } from "./version2.js";
|
|
4
|
+
// src/command-index.ts
|
|
5
5
|
const COMMANDS = [
|
|
6
6
|
{
|
|
7
7
|
names: ["auth"],
|
|
@@ -118,8 +118,7 @@ function addRootCommandStubs(program, lines) {
|
|
|
118
118
|
return terms.get(command) ?? Help.prototype.subcommandTerm.call(this, command);
|
|
119
119
|
} });
|
|
120
120
|
}
|
|
121
|
-
|
|
122
|
-
//#region src/help-path.ts
|
|
121
|
+
// src/help-path.ts
|
|
123
122
|
function isHelpFlag(token) {
|
|
124
123
|
return token === "-h" || token === "--help";
|
|
125
124
|
}
|
|
@@ -331,8 +330,7 @@ function formatUnknownCommandError(result) {
|
|
|
331
330
|
else if (result.suggestion) lines.push(`(Did you mean ${result.suggestion}?)`);
|
|
332
331
|
return `${lines.join("\n")}\n`;
|
|
333
332
|
}
|
|
334
|
-
|
|
335
|
-
//#region src/program.ts
|
|
333
|
+
// src/program.ts
|
|
336
334
|
function createProgram() {
|
|
337
335
|
return registerEndpointOptions(new Command("cohub")).name("cohub").summary("Work with Cohub from your terminal").description("Send prompts, manage Space files, and publish public output.").version(CLI_VERSION, "-v, --version", "Show version").option("-s, --space <space>", "Target Space: ID, slug, or username/slug").option("--json", "Print machine-readable JSON when supported").helpOption("-h, --help", "Show help").addHelpText("after", `
|
|
338
336
|
|
|
@@ -383,8 +381,7 @@ Environment:
|
|
|
383
381
|
Runtime logs ~/.local/state/cohub/runtime/<space-id>/diagnostics
|
|
384
382
|
`);
|
|
385
383
|
}
|
|
386
|
-
|
|
387
|
-
//#region src/index.ts
|
|
384
|
+
// src/index.ts
|
|
388
385
|
const program = createProgram();
|
|
389
386
|
const argv = process.argv.slice(2);
|
|
390
387
|
const name = rootCommandName(program, argv);
|
|
@@ -401,5 +398,4 @@ else if (help.kind === "unknown") {
|
|
|
401
398
|
process.exit(1);
|
|
402
399
|
} else if (name === "run" && await (await import("./run.js")).maybeHandleRunCommand(argv)) process.exit();
|
|
403
400
|
else program.parse();
|
|
404
|
-
//#endregion
|
|
405
401
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as resolveWebsocketUrl } from "./environment.js";
|
|
2
|
+
import { F as AuthRequiredError, P as describeError, W as resolveAccessToken, Y as readRuntimeSpaceBindings, c as ownRuntimeInstance, h as currentIdentityKey, o as UNCONFIRMED_WORK, t as createClient, u as runtimeInstanceDirectory } from "./client.js";
|
|
2
3
|
import { t as CLI_VERSION } from "./version2.js";
|
|
4
|
+
import "./binary-pins.js";
|
|
3
5
|
import { a as runtimeCapabilitiesSchema, b as assertHarnessAccess, c as runtimeHelloCapabilities, l as runtimeReadySchema, m as runtimeNativeStopSchema, n as RUNTIME_MAX_FRAME_BYTES, o as runtimeCommandSchema, p as runtimeApprovalDecisionSchema, s as runtimeEventSchema } from "./runtime.js";
|
|
4
|
-
import { F as AuthRequiredError, P as describeError, W as resolveAccessToken, Y as readRuntimeSpaceBindings, c as ownRuntimeInstance, h as currentIdentityKey, o as UNCONFIRMED_WORK, t as createClient, u as runtimeInstanceDirectory } from "./client.js";
|
|
5
6
|
import { A as formatVersion, B as closeHost, E as CodexShared, F as piTranslator, G as RuntimeDiagnostics, H as ProcessCleanupUncertainError, I as ArchiveNotRestorableError, J as serializeDiagnosticError, L as PI_MIN_VERSION, M as SizeLimitError, N as LiveProgress, P as codexTranslator, R as PiLink, S as harnessAdapter, U as confirmQuiescentProcessGroup, V as record$1, Y as serializeProjectionRecords, a as NativeIngest, b as atomicRuntimeJson, c as runtimeStateRoot, d as createDiagnosticConsole, j as harnessVersion, k as atLeast, n as piExtensionSource, r as piExtensionState, s as readNativeConfig, v as readTranscript, w as refreshHarnesses, x as discoverHarnesses, y as RuntimeArchiveStore, z as controlSocketPath } from "./install.js";
|
|
6
|
-
import { d as resolveWebsocketUrl } from "./environment.js";
|
|
7
|
-
import "./binary-pins.js";
|
|
8
7
|
import { t as readRuntimePreferences } from "./preferences.js";
|
|
8
|
+
import { t as packagePath } from "./package-paths.js";
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
10
10
|
import { homedir, tmpdir } from "node:os";
|
|
11
11
|
import { createReadStream, createWriteStream, mkdirSync, renameSync, writeFileSync } from "node:fs";
|
|
@@ -18,7 +18,7 @@ import { PassThrough, Readable } from "node:stream";
|
|
|
18
18
|
import { chmod, copyFile, lstat, mkdir, mkdtemp, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
19
19
|
import { pipeline } from "node:stream/promises";
|
|
20
20
|
import { isDeepStrictEqual } from "node:util";
|
|
21
|
-
|
|
21
|
+
// src/commands/sandboxd-binary.ts
|
|
22
22
|
const BINARY_NAME = "cohub-sandboxd";
|
|
23
23
|
const binaryName = (goos) => goos === "windows" ? `${BINARY_NAME}.exe` : BINARY_NAME;
|
|
24
24
|
const cdnBaseUrl = () => (process.env.COHUB_SANDBOXD_CDN_BASE_URL?.trim() || "https://public.cohub.live/sandboxd").replace(/\/+$/, "");
|
|
@@ -223,8 +223,7 @@ const ensureSandboxdBinary = async (options = {}) => {
|
|
|
223
223
|
return path;
|
|
224
224
|
});
|
|
225
225
|
};
|
|
226
|
-
|
|
227
|
-
//#region src/runtime/native/execution.ts
|
|
226
|
+
// src/runtime/native/execution.ts
|
|
228
227
|
/** Run one Cohub Turn in a local harness through its adapter. */
|
|
229
228
|
async function executeTurn(executor, input, emit, signal, requestId, context) {
|
|
230
229
|
signal.throwIfAborted();
|
|
@@ -279,8 +278,7 @@ async function executeTurn(executor, input, emit, signal, requestId, context) {
|
|
|
279
278
|
...uncertainCleanup ? { uncertainCleanup } : {}
|
|
280
279
|
};
|
|
281
280
|
}
|
|
282
|
-
|
|
283
|
-
//#region src/runtime/native/results.ts
|
|
281
|
+
// src/runtime/native/results.ts
|
|
284
282
|
var ContextRequiredError = class extends Error {};
|
|
285
283
|
const missing = (error) => error?.code === "ENOENT";
|
|
286
284
|
/** One small receipt per Cohub-executed Turn until the server acknowledges its result. */
|
|
@@ -418,8 +416,7 @@ var ExecutionResults = class {
|
|
|
418
416
|
}];
|
|
419
417
|
}
|
|
420
418
|
};
|
|
421
|
-
|
|
422
|
-
//#region src/runtime/connection.ts
|
|
419
|
+
// src/runtime/connection.ts
|
|
423
420
|
async function serveRuntime(options) {
|
|
424
421
|
const runtimeId = options.runtimeId ?? options.diagnostics?.runtimeId ?? randomUUID();
|
|
425
422
|
let backoff = 500;
|
|
@@ -1214,8 +1211,7 @@ async function connect(options) {
|
|
|
1214
1211
|
reason: fatalReason
|
|
1215
1212
|
} : conflict ? { kind: "conflict" } : { kind: "retry" };
|
|
1216
1213
|
}
|
|
1217
|
-
|
|
1218
|
-
//#region src/runtime/cli-path.ts
|
|
1214
|
+
// src/runtime/cli-path.ts
|
|
1219
1215
|
const ENTRY = packagePath("bin", "cohub.js");
|
|
1220
1216
|
/**
|
|
1221
1217
|
* Puts this Runtime's own `cohub` last on PATH, so what it runs can always call the CLI while a
|
|
@@ -1235,8 +1231,7 @@ function appendCliToPath(env = process.env, node = process.execPath, entry = ENT
|
|
|
1235
1231
|
return dir;
|
|
1236
1232
|
}
|
|
1237
1233
|
const quote = (value) => `'${value.replace(/'/g, `'\\''`)}'`;
|
|
1238
|
-
|
|
1239
|
-
//#region src/runtime/native/approvals.ts
|
|
1234
|
+
// src/runtime/native/approvals.ts
|
|
1240
1235
|
/** How long a card waits for a person; unanswered, the request is declined. */
|
|
1241
1236
|
const APPROVAL_TIMEOUT_MS = 18e5;
|
|
1242
1237
|
/** Asks the web for a decision over the control connection; without one, it declines. */
|
|
@@ -1304,8 +1299,7 @@ var ApprovalBroker = class {
|
|
|
1304
1299
|
if (entry && entry.sessionId === input.sessionId && entry.turnId === input.turnId) entry.resolve(input.decision);
|
|
1305
1300
|
}
|
|
1306
1301
|
};
|
|
1307
|
-
|
|
1308
|
-
//#region src/runtime/turn-projection.ts
|
|
1302
|
+
// src/runtime/turn-projection.ts
|
|
1309
1303
|
const record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
1310
1304
|
const iso = (value) => value ?? (/* @__PURE__ */ new Date(0)).toISOString();
|
|
1311
1305
|
const sourceSessionId = (turn) => turn.sourceSessionId ?? turn.sessionId;
|
|
@@ -1464,8 +1458,7 @@ async function listSessionProjectionTurns(source, sessionId, options = {}) {
|
|
|
1464
1458
|
function projectTurnBatch(input, target) {
|
|
1465
1459
|
return harnessAdapter(target).session.project(input);
|
|
1466
1460
|
}
|
|
1467
|
-
|
|
1468
|
-
//#region src/runtime/projection-store.ts
|
|
1461
|
+
// src/runtime/projection-store.ts
|
|
1469
1462
|
/** Give the projection's own records (the native header) the identity of the file it becomes. */
|
|
1470
1463
|
function rebindProjectionNativeSession(result, nativeSessionId) {
|
|
1471
1464
|
const records = harnessAdapter(result.projection.target).session.rebind(result.projection.records, nativeSessionId);
|
|
@@ -1506,8 +1499,7 @@ var ProjectionStore = class {
|
|
|
1506
1499
|
};
|
|
1507
1500
|
}
|
|
1508
1501
|
};
|
|
1509
|
-
|
|
1510
|
-
//#region src/runtime/native/sessions.ts
|
|
1502
|
+
// src/runtime/native/sessions.ts
|
|
1511
1503
|
/** Chooses the native file a Turn runs in. 1. */
|
|
1512
1504
|
var NativeSessions = class {
|
|
1513
1505
|
options;
|
|
@@ -1622,8 +1614,7 @@ var NativeSessions = class {
|
|
|
1622
1614
|
};
|
|
1623
1615
|
}
|
|
1624
1616
|
};
|
|
1625
|
-
|
|
1626
|
-
//#region src/runtime/native/transport.ts
|
|
1617
|
+
// src/runtime/native/transport.ts
|
|
1627
1618
|
/**
|
|
1628
1619
|
* Transcript ingest travels over the existing Runtime WebSocket: one connection, one credential, no
|
|
1629
1620
|
* second channel and no local receipts.
|
|
@@ -1649,8 +1640,7 @@ function nativeWebSocketTransport(send, features = {}) {
|
|
|
1649
1640
|
}, options)
|
|
1650
1641
|
};
|
|
1651
1642
|
}
|
|
1652
|
-
|
|
1653
|
-
//#region src/runtime/native/daemon.ts
|
|
1643
|
+
// src/runtime/native/daemon.ts
|
|
1654
1644
|
const text = (value) => typeof value === "string" ? value : "";
|
|
1655
1645
|
/** Streamed previews reach the web at most this often. */
|
|
1656
1646
|
const STREAM_INTERVAL_MS = 250;
|
|
@@ -2023,8 +2013,7 @@ var NativeRuntime = class {
|
|
|
2023
2013
|
entry.timer.unref?.();
|
|
2024
2014
|
}
|
|
2025
2015
|
};
|
|
2026
|
-
|
|
2027
|
-
//#region src/runtime/supervisor.ts
|
|
2016
|
+
// src/runtime/supervisor.ts
|
|
2028
2017
|
const DISPLAY_ANSWER_MS = 1e4;
|
|
2029
2018
|
const ACTIVITY_MS = 6e4;
|
|
2030
2019
|
function sandboxOutputLevel(value, stream) {
|
|
@@ -2513,5 +2502,4 @@ async function runRuntime(config, onState, externalSignal, onDiagnostic) {
|
|
|
2513
2502
|
}
|
|
2514
2503
|
}
|
|
2515
2504
|
}
|
|
2516
|
-
//#endregion
|
|
2517
2505
|
export { sandboxOutputLevel as n, runRuntime as t };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { runRuntime };
|
|
1
|
+
export { t as runRuntime } from "./supervisor.js";
|
package/dist/chunks/tasks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as json, E as handleHttp, O as jsonRequested, j as table, t as createClient } from "./client.js";
|
|
2
|
-
|
|
2
|
+
// src/commands/tasks.ts
|
|
3
3
|
function registerTasks(program, dependencies = {}) {
|
|
4
4
|
const getClient = dependencies.createClient ?? createClient;
|
|
5
5
|
const cmd = program.command("tasks").description("Task runs");
|
|
@@ -78,5 +78,4 @@ function registerTasks(program, dependencies = {}) {
|
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
//#endregion
|
|
82
81
|
export { registerTasks };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../protocol/dist/user-lists.js
|
|
2
2
|
const USER_APP_FILTERS = [
|
|
3
3
|
"mine",
|
|
4
4
|
"all",
|
|
@@ -12,5 +12,4 @@ const USER_CRONJOB_FILTERS = [
|
|
|
12
12
|
];
|
|
13
13
|
const isUserAppFilter = (value) => USER_APP_FILTERS.includes(value);
|
|
14
14
|
const isUserCronJobFilter = (value) => USER_CRONJOB_FILTERS.includes(value);
|
|
15
|
-
//#endregion
|
|
16
15
|
export { isUserCronJobFilter as n, isUserAppFilter as t };
|
package/dist/chunks/version.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { CLI_VERSION };
|
|
1
|
+
export { t as CLI_VERSION } from "./version2.js";
|
package/dist/chunks/version2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as packagePath } from "./package-paths.js";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
|
-
|
|
3
|
+
// src/version.ts
|
|
4
4
|
const CLI_VERSION = (() => {
|
|
5
5
|
try {
|
|
6
6
|
return JSON.parse(readFileSync(packagePath("package.json"), "utf8")).version;
|
|
@@ -18,5 +18,4 @@ function buildInfo() {
|
|
|
18
18
|
function cliCommit() {
|
|
19
19
|
return buildInfo().commit ?? null;
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { buildInfo as n, cliCommit as r, CLI_VERSION as t };
|
package/dist/chunks/version3.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as isNewerVersion } from "./self-update.js";
|
|
2
|
-
import { D as json, O as jsonRequested, h as currentIdentityKey } from "./client.js";
|
|
3
1
|
import { t as describeCli } from "./about.js";
|
|
4
|
-
|
|
2
|
+
import { D as json, O as jsonRequested, h as currentIdentityKey } from "./client.js";
|
|
3
|
+
import { n as isNewerVersion } from "./self-update.js";
|
|
4
|
+
// src/commands/version.ts
|
|
5
5
|
function registerVersion(program) {
|
|
6
6
|
program.command("version").description("This CLI, the cohub on PATH, and the versions running Runtimes serve").option("--json", "JSON output").action(async (options) => {
|
|
7
7
|
const about = await describeCli(process.env, currentIdentityKey());
|
|
@@ -14,5 +14,4 @@ function registerVersion(program) {
|
|
|
14
14
|
process.stdout.write(`${rows.join("\n")}\n`);
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { registerVersion };
|
package/dist/chunks/web.js
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
|
3
3
|
import { connect } from "node:net";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
|
-
|
|
6
|
+
// src/runtime/native/pi-extension.ts
|
|
7
7
|
/** Bumped when the daemon and the extension must be installed together. */
|
|
8
8
|
const COHUB_PI_PROTOCOL = 1;
|
|
9
9
|
/** Pi's tools read the process environment when they run, so this reaches the next tool call. */
|
|
@@ -191,5 +191,4 @@ function cohub(pi) {
|
|
|
191
191
|
globals[marker] = false;
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
//#endregion
|
|
195
194
|
export { COHUB_PI_PROTOCOL, controlSocketPath, cohub as default, forwardedEvent };
|
package/dist/runtime/worker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as enableEnvProxy } from "../chunks/env-proxy.js";
|
|
2
|
-
import { J as serializeDiagnosticError } from "../chunks/install.js";
|
|
3
2
|
import { t as runRuntime } from "../chunks/supervisor.js";
|
|
4
|
-
|
|
3
|
+
import { J as serializeDiagnosticError } from "../chunks/install.js";
|
|
4
|
+
// src/runtime/worker.ts
|
|
5
5
|
enableEnvProxy();
|
|
6
6
|
const notify = (message) => {
|
|
7
7
|
if (process.connected) process.send?.(message, () => void 0);
|
|
@@ -27,5 +27,4 @@ process.once("message", (config) => {
|
|
|
27
27
|
if (process.connected) process.disconnect?.();
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
-
//#endregion
|
|
31
30
|
export {};
|