skydive-cli 0.6.0-beta.48 → 0.6.0-beta.59
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/CHANGELOG.md +4 -0
- package/dist/js/bin.mjs +543 -70
- package/dist/js/{boot-CgKBdegB.mjs → boot-oH6ZHYdH.mjs} +390 -63
- package/dist/js/{client-CFnT0cAy.mjs → client-CAX6sE_Y.mjs} +1 -1
- package/dist/js/{client-jTc5DmAj.mjs → client-CnvxmYZ6.mjs} +1 -1
- package/dist/js/{client-DzD76Qd7.mjs → client-CwrwJrXX.mjs} +2 -1
- package/dist/js/{daemon-DcACMRe7.mjs → daemon-Dr2kCY9V.mjs} +2 -2
- package/dist/js/{daemon-D7hURPaU.mjs → daemon-DyzekuZq.mjs} +55 -15
- package/dist/js/{daemon-client-GaxCwNSy.mjs → daemon-client-BYB_2WYU.mjs} +1 -1
- package/dist/js/daemon-client-BpkvG_0G.mjs +8 -0
- package/dist/js/{install-CBFdOTjb.mjs → install-aadv_dwX.mjs} +49 -3
- package/dist/js/{print-2hTs7Wb6.mjs → print-BbRVB3lw.mjs} +2 -2
- package/dist/js/{print-B38Wx3CM.mjs → print-CDDNlUPH.mjs} +2 -2
- package/dist/js/{print-share-R1p66Gev.mjs → print-share-BZCjBNpt.mjs} +1 -1
- package/dist/js/raw-pty-BF3tEnca.mjs +5 -0
- package/dist/js/{raw-pty-Cj-O0pyb.mjs → raw-pty-BcZNOOGh.mjs} +1 -1
- package/dist/js/{rest-BUR9emV8.mjs → rest-CnpAZq0e.mjs} +1 -1
- package/dist/js/{rest-UJz2FS1U.mjs → rest-DdTf06cT.mjs} +36 -2
- package/package.json +8 -7
- package/dist/js/daemon-client-JTG8fkSV.mjs +0 -8
- package/dist/js/raw-pty-HlNGqFLC.mjs +0 -5
|
@@ -297,4 +297,4 @@ function toBuffer(data) {
|
|
|
297
297
|
}
|
|
298
298
|
|
|
299
299
|
//#endregion
|
|
300
|
-
export {
|
|
300
|
+
export { decodeFsResponse as a, FS_MAX_BLOB_BYTES as i, SANDBOX_STREAM_PATH as n, encodeFsRequest as o, streamSpecToQuery as r, SandboxStream as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as PortalClient, r as RATE_LIMIT_STAND_DOWN_MS, t as AUTH_STAND_DOWN_MS } from "./client-
|
|
2
|
+
import { n as PortalClient, r as RATE_LIMIT_STAND_DOWN_MS, t as AUTH_STAND_DOWN_MS } from "./client-CwrwJrXX.mjs";
|
|
3
3
|
import "./api-BFQ4PQDA.mjs";
|
|
4
4
|
|
|
5
5
|
export { PortalClient };
|
|
@@ -161,7 +161,7 @@ function errorMessage(err) {
|
|
|
161
161
|
* the commit time of the built tree is one monotonic clock they share.
|
|
162
162
|
*/
|
|
163
163
|
function portalDaemonBuild() {
|
|
164
|
-
return "
|
|
164
|
+
return "1791415159";
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* Whether a client carrying `mine` should replace a running daemon carrying
|
|
@@ -958,6 +958,7 @@ var PortalClient = class {
|
|
|
958
958
|
const token = await this.wsToken();
|
|
959
959
|
const { healthy, standDown } = await this.runConnection(token);
|
|
960
960
|
if (standDown) {
|
|
961
|
+
this.setStatus("stand-down");
|
|
961
962
|
const now = Date.now();
|
|
962
963
|
standDowns.push(now);
|
|
963
964
|
standDowns = standDowns.filter((at) => now - at <= this.heartbeatConfig.flapWindowMs);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./client-
|
|
2
|
+
import "./client-CwrwJrXX.mjs";
|
|
3
3
|
import "./tls-cert-Rua2oV7n.mjs";
|
|
4
4
|
import "./api-BFQ4PQDA.mjs";
|
|
5
|
-
import { a as runPortalDaemon, c as stopDaemonForHandoff, i as queryDaemonStatus, n as ensureDaemonRunning, o as startPortalDaemon, r as isDaemonListening, s as stopDaemon, t as PortalDaemon } from "./daemon-
|
|
5
|
+
import { a as runPortalDaemon, c as stopDaemonForHandoff, i as queryDaemonStatus, n as ensureDaemonRunning, o as startPortalDaemon, r as isDaemonListening, s as stopDaemon, t as PortalDaemon } from "./daemon-DyzekuZq.mjs";
|
|
6
6
|
|
|
7
7
|
export { runPortalDaemon };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as portalDaemonBuild, i as isNewerBuild, n as PortalClient, o as isRecord } from "./client-
|
|
2
|
+
import { a as portalDaemonBuild, i as isNewerBuild, n as PortalClient, o as isRecord } from "./client-CwrwJrXX.mjs";
|
|
3
3
|
import { t as defaultTlsCertSource } from "./tls-cert-Rua2oV7n.mjs";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
6
|
+
import { access, appendFile, mkdir, readFile, stat, unlink, writeFile } from "node:fs/promises";
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
import { spawn } from "node:child_process";
|
|
8
9
|
import { createHash } from "node:crypto";
|
|
9
10
|
import { connect, createServer } from "node:net";
|
|
10
|
-
import { access, appendFile, mkdir, readFile, stat, unlink, writeFile } from "node:fs/promises";
|
|
11
11
|
|
|
12
12
|
//#region ../portal-daemon/src/local-protocol.ts
|
|
13
13
|
/**
|
|
@@ -381,6 +381,16 @@ const IDLE_SHUTDOWN_MS = 3e4;
|
|
|
381
381
|
*/
|
|
382
382
|
const SOCKET_WATCH_TICK_MS = 3e4;
|
|
383
383
|
/**
|
|
384
|
+
* Grace window after a server stand-down: the check fires the instant the
|
|
385
|
+
* close lands, but the WINNER's socket bind may still be in flight — a check
|
|
386
|
+
* run at t=0 can see our own still-good socket, conclude we are the owner, and
|
|
387
|
+
* redial into the supersede war the stand-down exists to end. On a
|
|
388
|
+
* stand-down-triggered check, wait this out once and re-stat before
|
|
389
|
+
* concluding ownership. The periodic watch tick runs grace-free (nothing just
|
|
390
|
+
* displaced us there).
|
|
391
|
+
*/
|
|
392
|
+
const STAND_DOWN_GRACE_MS = 1500;
|
|
393
|
+
/**
|
|
384
394
|
* Upper bound an incumbent daemon waits, during a graceful handoff, for the
|
|
385
395
|
* successor to dial out and claim presence before giving up and releasing the
|
|
386
396
|
* slot itself. Comfortably above a normal successor boot + WS dial (a few
|
|
@@ -407,12 +417,14 @@ var PortalDaemon = class {
|
|
|
407
417
|
socketId = null;
|
|
408
418
|
socketCheckRunning = false;
|
|
409
419
|
socketWatchTickMs;
|
|
420
|
+
standDownGraceMs;
|
|
410
421
|
exit;
|
|
411
422
|
constructor(appUrl, options) {
|
|
412
423
|
this.appUrl = canonicalPortalAppUrl(appUrl);
|
|
413
424
|
this.paths = daemonPaths(this.appUrl);
|
|
414
425
|
this.fallbackCwd = process.env.HOME ?? process.cwd();
|
|
415
426
|
this.socketWatchTickMs = options?.socketWatchTickMs ?? SOCKET_WATCH_TICK_MS;
|
|
427
|
+
this.standDownGraceMs = options?.standDownGraceMs ?? STAND_DOWN_GRACE_MS;
|
|
416
428
|
this.exit = options?.exit ?? (() => process.exit(0));
|
|
417
429
|
}
|
|
418
430
|
/** Start listening. Rejects if the socket is already held by another daemon. */
|
|
@@ -460,24 +472,42 @@ var PortalDaemon = class {
|
|
|
460
472
|
*/
|
|
461
473
|
startSocketWatch() {
|
|
462
474
|
this.socketWatch = setInterval(() => {
|
|
463
|
-
|
|
464
|
-
this.socketCheckRunning = true;
|
|
465
|
-
this.checkSocketOwnership().catch((error) => this.logError("socket ownership check failed", error)).finally(() => {
|
|
466
|
-
this.socketCheckRunning = false;
|
|
467
|
-
});
|
|
475
|
+
this.runOwnershipCheck();
|
|
468
476
|
}, this.socketWatchTickMs);
|
|
469
477
|
this.socketWatch.unref();
|
|
470
478
|
}
|
|
479
|
+
/** One socket-ownership pass, shared by the watch timer (grace-free) and the
|
|
480
|
+
* client's 'stand-down' state (with grace — see STAND_DOWN_GRACE_MS).
|
|
481
|
+
*/
|
|
482
|
+
runOwnershipCheck(graceMs = 0) {
|
|
483
|
+
if (this.socketCheckRunning) return;
|
|
484
|
+
this.socketCheckRunning = true;
|
|
485
|
+
this.checkSocketOwnership(graceMs).catch((error) => this.logError("socket ownership check failed", error)).finally(() => {
|
|
486
|
+
this.socketCheckRunning = false;
|
|
487
|
+
});
|
|
488
|
+
}
|
|
471
489
|
stopSocketWatch() {
|
|
472
490
|
if (this.socketWatch) {
|
|
473
491
|
clearInterval(this.socketWatch);
|
|
474
492
|
this.socketWatch = null;
|
|
475
493
|
}
|
|
476
494
|
}
|
|
477
|
-
async checkSocketOwnership() {
|
|
495
|
+
async checkSocketOwnership(graceMs = 0) {
|
|
478
496
|
if (!this.server || this.handingOff) return;
|
|
479
497
|
const current = await stat(this.paths.socketPath).catch(() => null);
|
|
480
|
-
if (current && this.socketId && current.dev === this.socketId.dev && current.ino === this.socketId.ino)
|
|
498
|
+
if (current && this.socketId && current.dev === this.socketId.dev && current.ino === this.socketId.ino) {
|
|
499
|
+
if (graceMs > 0) {
|
|
500
|
+
await new Promise((r) => setTimeout(r, graceMs));
|
|
501
|
+
const recheck = await stat(this.paths.socketPath).catch(() => null);
|
|
502
|
+
const socketId = this.socketId;
|
|
503
|
+
if (recheck && socketId && !(recheck.dev === socketId.dev && recheck.ino === socketId.ino)) {
|
|
504
|
+
this.logInfo("control socket taken over during stand-down grace; standing down");
|
|
505
|
+
this.standDown();
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
481
511
|
if (current) {
|
|
482
512
|
this.logInfo("control socket path is owned by another daemon; standing down");
|
|
483
513
|
this.standDown();
|
|
@@ -648,13 +678,23 @@ var PortalDaemon = class {
|
|
|
648
678
|
tlsCertSource: defaultTlsCertSource(process.env, (msg) => this.logInfo(msg)),
|
|
649
679
|
persistedMachineName: this.persistedMachineName,
|
|
650
680
|
onMachineName: (name, source) => this.onMachineName(name, source),
|
|
651
|
-
onState: (state) =>
|
|
652
|
-
this.lastState = state;
|
|
653
|
-
this.broadcastState();
|
|
654
|
-
}
|
|
681
|
+
onState: (state) => this.handleClientState(state)
|
|
655
682
|
});
|
|
656
683
|
}
|
|
657
684
|
/**
|
|
685
|
+
* Client state transition. A server stand-down ('stand-down' status — the
|
|
686
|
+
* superseded/flap-cooldown close, distinguishable from an ordinary close
|
|
687
|
+
* through the status) runs the ownership check NOW with grace, so a
|
|
688
|
+
* duplicate that already lost the control socket yields within one server
|
|
689
|
+
* round trip instead of waiting for the next watch tick and fighting
|
|
690
|
+
* (supersede war).
|
|
691
|
+
*/
|
|
692
|
+
handleClientState(state) {
|
|
693
|
+
if (state.status === "stand-down") this.runOwnershipCheck(this.standDownGraceMs);
|
|
694
|
+
this.lastState = state;
|
|
695
|
+
this.broadcastState();
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
658
698
|
* The identity resolved on connect. Persist the name so a later scutil
|
|
659
699
|
* failure reuses it instead of adopting the volatile hostname, and log the
|
|
660
700
|
* source — a `hostname-fallback` after we'd previously registered under
|
|
@@ -736,7 +776,7 @@ var PortalDaemon = class {
|
|
|
736
776
|
appUrl: this.appUrl,
|
|
737
777
|
build: portalDaemonBuild(),
|
|
738
778
|
portal: {
|
|
739
|
-
status: portal?.status ?? "off",
|
|
779
|
+
status: portal?.status === "stand-down" ? "connecting" : portal?.status ?? "off",
|
|
740
780
|
machineName: portal?.machineName ?? "",
|
|
741
781
|
friendlyName: portal?.friendlyName ?? "",
|
|
742
782
|
error: portal?.error ?? null,
|
|
@@ -1006,7 +1046,7 @@ async function stopDaemon(appUrl) {
|
|
|
1006
1046
|
function stateMessage(state, declined) {
|
|
1007
1047
|
return {
|
|
1008
1048
|
t: "state",
|
|
1009
|
-
status: state.status,
|
|
1049
|
+
status: state.status === "stand-down" ? "connecting" : state.status,
|
|
1010
1050
|
machineName: state.machineName,
|
|
1011
1051
|
friendlyName: state.friendlyName,
|
|
1012
1052
|
error: state.error,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { d as daemonPaths, f as encodeLine, l as LOCAL_PROTOCOL_VERSION, m as parseDaemonMessage, n as ensureDaemonRunning, p as makeLineParser } from "./daemon-
|
|
2
|
+
import { d as daemonPaths, f as encodeLine, l as LOCAL_PROTOCOL_VERSION, m as parseDaemonMessage, n as ensureDaemonRunning, p as makeLineParser } from "./daemon-DyzekuZq.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { connect } from "node:net";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as version$1 } from "./rest-
|
|
3
|
-
import { D as getConfigPath } from "./print-
|
|
2
|
+
import { c as version$1 } from "./rest-DdTf06cT.mjs";
|
|
3
|
+
import { D as getConfigPath } from "./print-CDDNlUPH.mjs";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { err, ok } from "neverthrow";
|
|
@@ -1547,6 +1547,51 @@ function formatMb(bytes) {
|
|
|
1547
1547
|
return `${(bytes / MB).toFixed(1)} MB`;
|
|
1548
1548
|
}
|
|
1549
1549
|
|
|
1550
|
+
//#endregion
|
|
1551
|
+
//#region src/chat/tui/autowrap.ts
|
|
1552
|
+
/**
|
|
1553
|
+
* Why the TUI turns the terminal's autowrap off for its lifetime.
|
|
1554
|
+
*
|
|
1555
|
+
* OpenTUI's incremental cell-diff emitter positions every run with an
|
|
1556
|
+
* absolute cursor move — it never relies on the terminal to advance the
|
|
1557
|
+
* cursor — but it leaves the terminal's autowrap (DECAWM) enabled. When a
|
|
1558
|
+
* run reaches the last column, the host terminal wraps its cursor to column
|
|
1559
|
+
* 1 of the next row and paints the run's tail there, into cells owned by a
|
|
1560
|
+
* different element. The diff buffer then records the *intended* cells, so
|
|
1561
|
+
* those stray bytes are never repainted and unrelated text smears together
|
|
1562
|
+
* until a full repaint (a resize). Filed upstream with a repro and root
|
|
1563
|
+
* cause: https://github.com/anomalyco/opentui/issues/1187 — unfixed there,
|
|
1564
|
+
* the consumer-side fix (verified in numux#115) is to disable DECAWM while
|
|
1565
|
+
* the renderer runs. Pane content still wraps, inside OpenTUI's own grid.
|
|
1566
|
+
*/
|
|
1567
|
+
const AUTOWRAP_OFF = "\x1B[?7l";
|
|
1568
|
+
const AUTOWRAP_ON = "\x1B[?7h";
|
|
1569
|
+
/** Escape hatch: if any surface turns out to depend on host autowrap. */
|
|
1570
|
+
const keepAutowrap = () => Boolean(process.env["SKYDIVE_TUI_AUTOWRAP"]);
|
|
1571
|
+
let disabledBy = false;
|
|
1572
|
+
/**
|
|
1573
|
+
* Disable host autowrap so the diff emitter's runs can never wrap onto the
|
|
1574
|
+
* next row. No-op when stdout is not a terminal (piped output, tests) and
|
|
1575
|
+
* under `SKYDIVE_TUI_AUTOWRAP`.
|
|
1576
|
+
*/
|
|
1577
|
+
function disableTerminalAutowrap(stdout = process.stdout) {
|
|
1578
|
+
if (!stdout.isTTY || keepAutowrap() || disabledBy) return;
|
|
1579
|
+
disabledBy = true;
|
|
1580
|
+
stdout.write(AUTOWRAP_OFF);
|
|
1581
|
+
}
|
|
1582
|
+
/**
|
|
1583
|
+
* Restore host autowrap. The terminal mode is a property of the host, so
|
|
1584
|
+
* every teardown path must run this even when the renderer cannot finish
|
|
1585
|
+
* its own teardown: the renderer's `onDestroy` hook covers renderer-driven
|
|
1586
|
+
* exits, and the forced-fallback reset in `hard-exit.ts` carries the
|
|
1587
|
+
* restore for a teardown that never got there. Idempotent.
|
|
1588
|
+
*/
|
|
1589
|
+
function restoreTerminalAutowrap(stdout = process.stdout) {
|
|
1590
|
+
if (!disabledBy) return;
|
|
1591
|
+
disabledBy = false;
|
|
1592
|
+
stdout.write(AUTOWRAP_ON);
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1550
1595
|
//#endregion
|
|
1551
1596
|
//#region src/crash/install.ts
|
|
1552
1597
|
let installed = false;
|
|
@@ -1566,6 +1611,7 @@ function installCrashHandler(opts = {}) {
|
|
|
1566
1611
|
if (installed) return;
|
|
1567
1612
|
installed = true;
|
|
1568
1613
|
process.on("uncaughtException", (error) => {
|
|
1614
|
+
restoreTerminalAutowrap();
|
|
1569
1615
|
const memory = safeMemory();
|
|
1570
1616
|
printFatalNotice(writeCrashReport(buildCrashReport({
|
|
1571
1617
|
reason: "uncaughtException",
|
|
@@ -1594,4 +1640,4 @@ function printFatalNotice(file, memory) {
|
|
|
1594
1640
|
}
|
|
1595
1641
|
|
|
1596
1642
|
//#endregion
|
|
1597
|
-
export {
|
|
1643
|
+
export { aliasActivationHint as A, getSessionIdentity as B, themeMode as C, themesForMode as D, themes as E, SUPPORTED_SHELLS as F, resolveWorkspaceId as H, defaultInstallEnv as I, detectShell as L, installAgentAlias as M, slugifyAliasName as N, buildImportSeedPrompt as O, takenAliasNames as P, ensureActiveOrganization as R, themeForMode as S, themeVersion as T, setActiveWorkspace as U, listWorkspaces as V, applyTheme as _, writeCrashReport as a, noColorRequested as b, brandHelpArt as c, maybeStartProfiling as d, profileDir as f, DEFAULT_THEME_ID as g, writeArtifact as h, buildCrashReport as i, dedupeAliasName as j, machineOsFromPlatform as k, splashFitsWidth as l, record as m, disableTerminalAutowrap as n, MARK_CELLS as o, profilingEnabled as p, restoreTerminalAutowrap as r, WORDMARK as s, installCrashHandler as t, getAutomaticLogsDir as u, findTheme as v, themeModeFromColorFgBg as w, theme as x, monoTheme as y, getActiveWorkspaceId as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./rest-
|
|
3
|
-
import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-
|
|
2
|
+
import "./rest-DdTf06cT.mjs";
|
|
3
|
+
import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-CDDNlUPH.mjs";
|
|
4
4
|
import "./billing-blocked-D3l5kJlX.mjs";
|
|
5
5
|
|
|
6
6
|
export { messageGet, readStdin, resolveAgent, runPrint };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as errorMessage, i as sendErrorMessage, o as isRecord, t as createRestClient } from "./rest-
|
|
2
|
+
import { a as errorMessage, i as sendErrorMessage, o as isRecord, t as createRestClient } from "./rest-DdTf06cT.mjs";
|
|
3
3
|
import { t as HttpError } from "./http-error-BF2NZZE3.mjs";
|
|
4
4
|
import { i as billingBlockedOutcomeFromSendResponse, n as BillingBlockedError } from "./billing-blocked-D3l5kJlX.mjs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -823,7 +823,7 @@ function summarizeConnectCard(card, appUrl) {
|
|
|
823
823
|
}
|
|
824
824
|
/**
|
|
825
825
|
* Parse a `data-anyone-render-spec` stream chunk into a connect-card summary,
|
|
826
|
-
* or null if the chunk isn't a connect card (other render specs —
|
|
826
|
+
* or null if the chunk isn't a connect card (other render specs — e.g.
|
|
827
827
|
* deep-learn — parse to null, same as the TUI). A card that arrives already
|
|
828
828
|
* settled (a compute request's decided re-emission) is an FYI, not an action,
|
|
829
829
|
* so it stays out of the "[action needed]" stream too.
|
|
@@ -14,7 +14,7 @@ import { n as printError } from "./output-C9mb3sUB.mjs";
|
|
|
14
14
|
* the reply (and to --json).
|
|
15
15
|
*/
|
|
16
16
|
async function connectMachineShare({ appUrl, sessionToken, timeoutHint }) {
|
|
17
|
-
const { PortalClient } = await import("./client-
|
|
17
|
+
const { PortalClient } = await import("./client-CnvxmYZ6.mjs");
|
|
18
18
|
const { defaultTlsCertSource } = await import("./tls-cert-BpCaD5AT.mjs");
|
|
19
19
|
let signalConnected;
|
|
20
20
|
const connected = new Promise((resolve) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as sendErrorMessage, n as errorDetail, r as filenameFromContentDisposition, t as createRestClient } from "./rest-
|
|
2
|
+
import { i as sendErrorMessage, n as errorDetail, r as filenameFromContentDisposition, t as createRestClient } from "./rest-DdTf06cT.mjs";
|
|
3
3
|
import { t as HttpError } from "./http-error-BF2NZZE3.mjs";
|
|
4
4
|
import "./billing-blocked-D3l5kJlX.mjs";
|
|
5
5
|
|
|
@@ -6,7 +6,7 @@ import { createParser } from "eventsource-parser";
|
|
|
6
6
|
|
|
7
7
|
//#region package.json
|
|
8
8
|
var name = "skydive-cli";
|
|
9
|
-
var version = "0.6.0-beta.
|
|
9
|
+
var version = "0.6.0-beta.59";
|
|
10
10
|
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/chat/util.ts
|
|
@@ -377,6 +377,10 @@ function createRestClient({ appUrl, sessionToken, workspaceId }) {
|
|
|
377
377
|
const { recap } = await get(`/api/v1/conversations/${encodeURIComponent(conversationId)}/recap`, recapResponseSchema);
|
|
378
378
|
return recap?.text ?? null;
|
|
379
379
|
},
|
|
380
|
+
getConversationUsage: async ({ conversationId }) => {
|
|
381
|
+
const { usage } = await get(`/api/v1/conversations/${encodeURIComponent(conversationId)}/usage`, conversationUsageResponseSchema);
|
|
382
|
+
return usage;
|
|
383
|
+
},
|
|
380
384
|
listSubagentTasks: async ({ conversationId }) => {
|
|
381
385
|
const { result } = await get(`/api/v1/trpc/v2.subagentTasks.list?input=${encodeURIComponent(JSON.stringify({ conversationId }))}`, subagentTasksResponseSchema);
|
|
382
386
|
return new Map(result.data.subagentTasks.map((task) => [task.id, task]));
|
|
@@ -563,7 +567,12 @@ const platformModelSchema = z.object({
|
|
|
563
567
|
compliant: z.boolean().optional(),
|
|
564
568
|
noTraining: z.boolean().optional(),
|
|
565
569
|
thinkingLevels: z.array(z.string()).optional(),
|
|
566
|
-
thinkingLevelLabels: z.record(z.string(), z.string()).optional()
|
|
570
|
+
thinkingLevelLabels: z.record(z.string(), z.string()).optional(),
|
|
571
|
+
signals: z.object({
|
|
572
|
+
intelligence: z.number().int().min(1).max(6).nullable(),
|
|
573
|
+
speed: z.number().int().min(1).max(6).nullable(),
|
|
574
|
+
cost: z.number().int().min(1).max(6).nullable()
|
|
575
|
+
}).optional()
|
|
567
576
|
}).passthrough();
|
|
568
577
|
const listModelsResponseSchema = z.object({
|
|
569
578
|
models: z.array(platformModelSchema),
|
|
@@ -673,6 +682,31 @@ const uiMessageSchema = z.object({
|
|
|
673
682
|
agentName: z.string().nullish()
|
|
674
683
|
}).passthrough().optional() }).passthrough().optional()
|
|
675
684
|
});
|
|
685
|
+
const conversationUsageModelSchema = z.object({
|
|
686
|
+
model: z.string().nullable(),
|
|
687
|
+
promptTokens: z.number(),
|
|
688
|
+
completionTokens: z.number(),
|
|
689
|
+
cacheCreationTokens: z.number(),
|
|
690
|
+
cacheReadTokens: z.number(),
|
|
691
|
+
cents: z.number()
|
|
692
|
+
});
|
|
693
|
+
const conversationUsageSchema = z.object({
|
|
694
|
+
own: z.object({
|
|
695
|
+
inferenceCents: z.number(),
|
|
696
|
+
byModel: z.array(conversationUsageModelSchema)
|
|
697
|
+
}),
|
|
698
|
+
children: z.object({
|
|
699
|
+
inferenceCents: z.number(),
|
|
700
|
+
conversationCount: z.number()
|
|
701
|
+
}),
|
|
702
|
+
compute: z.object({
|
|
703
|
+
cents: z.number(),
|
|
704
|
+
vcpuSeconds: z.number()
|
|
705
|
+
}),
|
|
706
|
+
unpriced: z.array(z.string()),
|
|
707
|
+
totalCents: z.number()
|
|
708
|
+
});
|
|
709
|
+
const conversationUsageResponseSchema = z.object({ usage: conversationUsageSchema.nullable() });
|
|
676
710
|
const recapResponseSchema = z.object({ recap: z.object({ text: z.string() }).nullable() });
|
|
677
711
|
const subagentTaskSnapshotSchema = z.object({
|
|
678
712
|
id: z.string(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skydive-cli",
|
|
3
|
-
"version": "0.6.0-beta.
|
|
3
|
+
"version": "0.6.0-beta.59",
|
|
4
4
|
"description": "Skydive CLI — cloud agents from the command line",
|
|
5
5
|
"homepage": "https://skydive.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"zustand": "^5.0.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
+
"@createinc/anyone-agents": "^0.0.0",
|
|
54
55
|
"@createinc/anyone-portal-daemon": "0.0.0",
|
|
55
56
|
"@createinc/anyone-sandbox-stream-protocol": "0.0.0",
|
|
56
57
|
"@createinc/tsconfig": "0.0.0",
|
|
@@ -60,10 +61,10 @@
|
|
|
60
61
|
"@types/semver": "^7.7.1",
|
|
61
62
|
"@types/yargs": "^17.0.33",
|
|
62
63
|
"@typescript/native-preview": "^7.0.0-dev.20260113.1",
|
|
63
|
-
"@vitest/coverage-v8": "^2.
|
|
64
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
64
65
|
"tsdown": "^0.20.3",
|
|
65
66
|
"typescript": "^5.9.3",
|
|
66
|
-
"vitest": "^2.
|
|
67
|
+
"vitest": "^3.2.4"
|
|
67
68
|
},
|
|
68
69
|
"engines": {
|
|
69
70
|
"bun": ">=1.3.14",
|
|
@@ -71,9 +72,9 @@
|
|
|
71
72
|
},
|
|
72
73
|
"//optionalDependencies": "The per-platform binary packages (skydive-cli-<os>-<arch>) are INTENTIONALLY not committed here. They are published by release-skydive-cli-binaries.yml and injected — pinned to the exact version being published — into the published launcher's optionalDependencies at release time (scripts/prepare-platform-packages.mjs --pin-version, run in release-skydive-cli.yml). Committing them would make `yarn install` try to resolve versions that only exist post-publish, breaking local dev and CI. npm installs of a published skydive-cli still get them (os/cpu-gated); the launcher (src/launcher.ts) resolves and execs the matching one. Local dev never needs them: it runs the JS bundle or `build:binary` directly.",
|
|
73
74
|
"optionalDependencies": {
|
|
74
|
-
"skydive-cli-darwin-arm64": "0.6.0-beta.
|
|
75
|
-
"skydive-cli-darwin-x64": "0.6.0-beta.
|
|
76
|
-
"skydive-cli-linux-x64": "0.6.0-beta.
|
|
77
|
-
"skydive-cli-linux-arm64": "0.6.0-beta.
|
|
75
|
+
"skydive-cli-darwin-arm64": "0.6.0-beta.59",
|
|
76
|
+
"skydive-cli-darwin-x64": "0.6.0-beta.59",
|
|
77
|
+
"skydive-cli-linux-x64": "0.6.0-beta.59",
|
|
78
|
+
"skydive-cli-linux-arm64": "0.6.0-beta.59"
|
|
78
79
|
}
|
|
79
80
|
}
|