skydive-cli 0.5.0-beta.33 → 0.5.0-beta.36
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 +233 -187
- package/dist/js/{boot-C5HJfwRS.mjs → boot-CmInaUwJ.mjs} +922 -70
- package/dist/js/{client-BTQ1fwzM.mjs → client-Btq6bMzX.mjs} +108 -2
- package/dist/js/{daemon-BPGZufS1.mjs → daemon-CH95gDij.mjs} +1 -1
- package/dist/js/{daemon-WQ8QYrFt.mjs → daemon-Dg89tpOE.mjs} +1 -1
- package/dist/js/{daemon-client-MpAGVkqP.mjs → daemon-client-BNDnEGw6.mjs} +1 -1
- package/dist/js/daemon-client-CC9sxWac.mjs +8 -0
- package/dist/js/{install-BPUAm8bS.mjs → install-aZ751iYf.mjs} +2 -2
- package/dist/js/launcher.mjs +49 -0
- package/dist/js/{print-B9djx8GU.mjs → print-DV9L41G2.mjs} +2 -2
- package/dist/js/{print-Clgq46GU.mjs → print-h22UbIfZ.mjs} +1 -1
- package/dist/js/raw-pty-Ci2qFR9F.mjs +5 -0
- package/dist/js/{raw-pty-B9Bue8gg.mjs → raw-pty-D5PhKZSl.mjs} +1 -1
- package/dist/js/{rest-C6E4mS2A.mjs → rest-ClVPZquN.mjs} +46 -9
- package/dist/js/{rest-CaWUSrnH.mjs → rest-v-7FQqLP.mjs} +1 -1
- package/package.json +11 -4
- package/dist/js/daemon-client-DTfIza0O.mjs +0 -8
- package/dist/js/raw-pty-g3kATVQe.mjs +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- `npm i -g skydive-cli` (and yarn/pnpm/bun) now installs a tiny launcher plus one prebuilt, os/cpu-matched binary that carries its own runtime — so on the common platforms `skydive chat` and `skydive import` start instantly and **do not download a Bun runtime on first use**. On any platform without a prebuilt binary (or if the optional dependency is skipped), the CLI automatically falls back to the existing behavior: it runs under your Node and provisions Bun on first `chat`, exactly as before. Nothing about the commands, flags, config, or `SKYDIVE_*` environment variables changes, and `skydive update` still upgrades npm installs via your package manager and standalone-binary installs in place.
|
|
13
|
+
|
|
10
14
|
### Added
|
|
11
15
|
|
|
12
16
|
- `/search` (alias `/find`) in the chat TUI — opens the conversation picker with its search field focused, so "find a conversation" has a discoverable command instead of being a feature you had to know the bare picker already had. Pass a query inline (`/search billing deep dive`) and the picker opens already narrowed to the matches; bare `/search` opens it ready for you to type. The search runs server-side across conversation titles, message bodies, and participant names, the same search the picker exposes.
|
package/dist/js/bin.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as installAgentAlias, B as resolveWorkspaceId, D as machineOsFromPlatform, E as buildImportSeedPrompt, F as detectShell, H as name, I as ensureActiveOrganization, L as getActiveWorkspaceId, M as takenAliasNames, N as SUPPORTED_SHELLS, O as aliasActivationHint, P as defaultInstallEnv, R as getSessionIdentity, U as version, V as setActiveWorkspace, c as getAutomaticLogsDir, j as slugifyAliasName, k as dedupeAliasName, l as maybeStartProfiling, o as brandHelpArt, t as installCrashHandler, u as profileDir, w as themes, z as listWorkspaces } from "./install-
|
|
3
|
-
import { A as getShareMachineDefault, C as getConfigPath, D as getPromptHistoryPath, E as getPreference, F as resolveAppUrl, H as saveSession, I as resolveChatAuth, L as resolveConfig, M as getStoredApiKeyWorkspaceName, N as getUpdateCheckDisabled, R as resolveManagementAuth, S as deleteConfig, T as getLastSeenVersion, V as saveConfig, W as setLastSeenVersion, _ as API_KEY_FAMILY_PREFIX, g as API_KEYS_URL, i as resolveAgent$1, j as getStoredApiKeyId, v as API_KEY_PREFIX, w as getDefaultAgent, x as PREFERENCES, y as DEFAULT_API_URL, z as resolveSession$1 } from "./print-
|
|
2
|
+
import { A as installAgentAlias, B as resolveWorkspaceId, D as machineOsFromPlatform, E as buildImportSeedPrompt, F as detectShell, H as name, I as ensureActiveOrganization, L as getActiveWorkspaceId, M as takenAliasNames, N as SUPPORTED_SHELLS, O as aliasActivationHint, P as defaultInstallEnv, R as getSessionIdentity, U as version, V as setActiveWorkspace, c as getAutomaticLogsDir, j as slugifyAliasName, k as dedupeAliasName, l as maybeStartProfiling, o as brandHelpArt, t as installCrashHandler, u as profileDir, w as themes, z as listWorkspaces } from "./install-aZ751iYf.mjs";
|
|
3
|
+
import { A as getShareMachineDefault, C as getConfigPath, D as getPromptHistoryPath, E as getPreference, F as resolveAppUrl, H as saveSession, I as resolveChatAuth, L as resolveConfig, M as getStoredApiKeyWorkspaceName, N as getUpdateCheckDisabled, R as resolveManagementAuth, S as deleteConfig, T as getLastSeenVersion, V as saveConfig, W as setLastSeenVersion, _ as API_KEY_FAMILY_PREFIX, g as API_KEYS_URL, i as resolveAgent$1, j as getStoredApiKeyId, v as API_KEY_PREFIX, w as getDefaultAgent, x as PREFERENCES, y as DEFAULT_API_URL, z as resolveSession$1 } from "./print-h22UbIfZ.mjs";
|
|
4
4
|
import { n as printError, r as printTable, t as output } from "./output-wY0VQDea.mjs";
|
|
5
5
|
import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
|
|
6
|
-
import { t as createRestClient } from "./rest-
|
|
6
|
+
import { t as createRestClient } from "./rest-ClVPZquN.mjs";
|
|
7
7
|
import "./billing-blocked-D3l5kJlX.mjs";
|
|
8
8
|
import { r as resolveMachineIdentity } from "./client-d6K9qm6B.mjs";
|
|
9
|
-
import { i as queryDaemonStatus, l as PORTAL_DAEMON_FLAG, n as ensureDaemonRunning, s as stopDaemon, u as daemonPaths } from "./daemon-
|
|
9
|
+
import { i as queryDaemonStatus, l as PORTAL_DAEMON_FLAG, n as ensureDaemonRunning, s as stopDaemon, u as daemonPaths } from "./daemon-CH95gDij.mjs";
|
|
10
10
|
import "./tls-cert-CV-pwxVN.mjs";
|
|
11
11
|
import { i as grantPortalAccess, n as fetchPortalDevices, o as registerPortalDevice, r as findThisDevice, s as revokePortalAccess } from "./api-DQCaztBg.mjs";
|
|
12
|
-
import { t as SandboxStream } from "./client-
|
|
12
|
+
import { a as encodeFsRequest, i as decodeFsResponse, n as SANDBOX_STREAM_PATH, r as streamSpecToQuery, t as SandboxStream } from "./client-Btq6bMzX.mjs";
|
|
13
13
|
import { hideBin } from "yargs/helpers";
|
|
14
14
|
import yargs from "yargs";
|
|
15
15
|
import { hostname, tmpdir } from "node:os";
|
|
@@ -19,10 +19,10 @@ import { z } from "zod";
|
|
|
19
19
|
import open from "open";
|
|
20
20
|
import fs from "node:fs";
|
|
21
21
|
import { spawn, spawnSync } from "node:child_process";
|
|
22
|
-
import { createHash
|
|
22
|
+
import { createHash } from "node:crypto";
|
|
23
23
|
import zlib from "node:zlib";
|
|
24
24
|
import fsp, { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
25
|
-
import {
|
|
25
|
+
import { WebSocket } from "ws";
|
|
26
26
|
import semver from "semver";
|
|
27
27
|
import { createInterface } from "node:readline";
|
|
28
28
|
import { createInterface as createInterface$1 } from "node:readline/promises";
|
|
@@ -1586,7 +1586,7 @@ const importCommand = {
|
|
|
1586
1586
|
process.exit(1);
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
|
-
const { runChat } = await import("./boot-
|
|
1589
|
+
const { runChat } = await import("./boot-CmInaUwJ.mjs");
|
|
1590
1590
|
await runChat({
|
|
1591
1591
|
appUrl,
|
|
1592
1592
|
sessionToken: session.value.sessionToken,
|
|
@@ -1624,7 +1624,7 @@ async function runImportPrintMode({ argv, appUrl }) {
|
|
|
1624
1624
|
});
|
|
1625
1625
|
const extra = (argv.print ?? "").trim();
|
|
1626
1626
|
const prompt = buildImportSeedPrompt(process.cwd(), machineOsFromPlatform(process.platform)) + (extra ? `\n\nAdditional instructions: ${extra}` : "");
|
|
1627
|
-
const { runPrint } = await import("./print-
|
|
1627
|
+
const { runPrint } = await import("./print-DV9L41G2.mjs");
|
|
1628
1628
|
try {
|
|
1629
1629
|
const result = await runPrint({
|
|
1630
1630
|
appUrl,
|
|
@@ -2031,7 +2031,7 @@ const chatCommand = {
|
|
|
2031
2031
|
sessionToken: auth.value.token,
|
|
2032
2032
|
agentSelector: argv.agent ?? null
|
|
2033
2033
|
});
|
|
2034
|
-
const { runChat } = await import("./boot-
|
|
2034
|
+
const { runChat } = await import("./boot-CmInaUwJ.mjs");
|
|
2035
2035
|
await runChat({
|
|
2036
2036
|
appUrl: auth.value.appUrl,
|
|
2037
2037
|
sessionToken: auth.value.token,
|
|
@@ -2115,7 +2115,7 @@ async function runPrintMode({ argv, appUrl }) {
|
|
|
2115
2115
|
printError(`${auth.error.message} For non-interactive use, run \`skydive auth login\` first, or set SKYDIVE_API_KEY / SKYDIVE_SESSION_TOKEN.`);
|
|
2116
2116
|
process.exit(1);
|
|
2117
2117
|
}
|
|
2118
|
-
const { runPrint, readStdin } = await import("./print-
|
|
2118
|
+
const { runPrint, readStdin } = await import("./print-DV9L41G2.mjs");
|
|
2119
2119
|
const workspaceId = await resolveWorkspaceFlag({
|
|
2120
2120
|
appUrl,
|
|
2121
2121
|
sessionToken: auth.value.token,
|
|
@@ -2210,7 +2210,7 @@ const getCommand$1 = {
|
|
|
2210
2210
|
printError(`${auth.error.message} Run \`skydive auth login\` first, or set SKYDIVE_API_KEY / SKYDIVE_SESSION_TOKEN.`);
|
|
2211
2211
|
process.exit(1);
|
|
2212
2212
|
}
|
|
2213
|
-
const { messageGet } = await import("./print-
|
|
2213
|
+
const { messageGet } = await import("./print-DV9L41G2.mjs");
|
|
2214
2214
|
try {
|
|
2215
2215
|
const result = await messageGet({
|
|
2216
2216
|
appUrl: auth.value.appUrl,
|
|
@@ -2413,7 +2413,7 @@ const switchCommand = {
|
|
|
2413
2413
|
printError("The workspace picker needs the Bun runtime and it could not be set up automatically. Pass a workspace slug instead, or install Bun and retry.");
|
|
2414
2414
|
process.exit(1);
|
|
2415
2415
|
}
|
|
2416
|
-
const { runWorkspacePicker } = await import("./boot-
|
|
2416
|
+
const { runWorkspacePicker } = await import("./boot-CmInaUwJ.mjs");
|
|
2417
2417
|
await runWorkspacePicker(session);
|
|
2418
2418
|
return;
|
|
2419
2419
|
}
|
|
@@ -2492,7 +2492,7 @@ const openCommand = {
|
|
|
2492
2492
|
const agent = argv.agent ? resolveAgent$1((await fetchPortalDevices(session)).agents, argv.agent) : null;
|
|
2493
2493
|
const cwd = argv.cwd ? path.resolve(argv.cwd) : process.cwd();
|
|
2494
2494
|
const { machineName } = await resolveMachineIdentity(null);
|
|
2495
|
-
const { PortalDaemonClient } = await import("./daemon-client-
|
|
2495
|
+
const { PortalDaemonClient } = await import("./daemon-client-CC9sxWac.mjs");
|
|
2496
2496
|
let lastLine = "";
|
|
2497
2497
|
let signalConnected;
|
|
2498
2498
|
const connected = new Promise((resolve) => {
|
|
@@ -2768,7 +2768,7 @@ const portalCommand = {
|
|
|
2768
2768
|
//#endregion
|
|
2769
2769
|
//#region src/commands/sandbox.ts
|
|
2770
2770
|
/** POSIX single-quote one word so the remote shell treats it as one token. */
|
|
2771
|
-
function shellQuote
|
|
2771
|
+
function shellQuote(word) {
|
|
2772
2772
|
if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(word)) return word;
|
|
2773
2773
|
return `'${word.replace(/'/g, `'\\''`)}'`;
|
|
2774
2774
|
}
|
|
@@ -2783,7 +2783,7 @@ function shellQuote$1(word) {
|
|
|
2783
2783
|
* for too. yargs number-coerces bare numerals, so words are stringified.
|
|
2784
2784
|
*/
|
|
2785
2785
|
function joinCommandWords(words) {
|
|
2786
|
-
return words.map(String).map(shellQuote
|
|
2786
|
+
return words.map(String).map(shellQuote).join(" ").trim();
|
|
2787
2787
|
}
|
|
2788
2788
|
/**
|
|
2789
2789
|
* `skydive sandbox` — the standalone counterpart to the chat TUI's `/sandbox`
|
|
@@ -2806,8 +2806,8 @@ const sandboxCommand = {
|
|
|
2806
2806
|
}).example("skydive sandbox --agent grace", "Live terminal (Ctrl-] detaches)").example("skydive sandbox --agent grace -- tail -n 50 /tmp/harness.log", "One-shot command (use `--` so its flags reach the sandbox)").example("skydive sandbox --agent grace -- sh -c 'ls /tmp | wc -l'", "Shell features go through an explicit `sh -c`"),
|
|
2807
2807
|
handler: async (argv) => {
|
|
2808
2808
|
const session = requireSession(argv);
|
|
2809
|
-
const { createRestClient } = await import("./rest-
|
|
2810
|
-
const { resolveAgent } = await import("./print-
|
|
2809
|
+
const { createRestClient } = await import("./rest-v-7FQqLP.mjs");
|
|
2810
|
+
const { resolveAgent } = await import("./print-DV9L41G2.mjs");
|
|
2811
2811
|
const client = createRestClient({
|
|
2812
2812
|
appUrl: session.appUrl,
|
|
2813
2813
|
sessionToken: session.sessionToken
|
|
@@ -2876,7 +2876,7 @@ async function runPty({ session, agentId, agentName }) {
|
|
|
2876
2876
|
return 1;
|
|
2877
2877
|
}
|
|
2878
2878
|
console.error(`Connecting to ${agentName}'s sandbox… (Ctrl-] detaches)`);
|
|
2879
|
-
const { runRawPtyPassthrough } = await import("./raw-pty-
|
|
2879
|
+
const { runRawPtyPassthrough } = await import("./raw-pty-Ci2qFR9F.mjs");
|
|
2880
2880
|
const result = await runRawPtyPassthrough({
|
|
2881
2881
|
stdin: process.stdin,
|
|
2882
2882
|
stdout: process.stdout,
|
|
@@ -2888,40 +2888,151 @@ async function runPty({ session, agentId, agentName }) {
|
|
|
2888
2888
|
return result.code;
|
|
2889
2889
|
}
|
|
2890
2890
|
|
|
2891
|
+
//#endregion
|
|
2892
|
+
//#region src/chat/sandbox/fs-client.ts
|
|
2893
|
+
function wsBase(appUrl) {
|
|
2894
|
+
const base = appUrl.replace(/\/+$/, "");
|
|
2895
|
+
if (base.startsWith("https://")) return `wss://${base.slice(8)}`;
|
|
2896
|
+
if (base.startsWith("http://")) return `ws://${base.slice(7)}`;
|
|
2897
|
+
return `wss://${base}`;
|
|
2898
|
+
}
|
|
2899
|
+
function toU8(data) {
|
|
2900
|
+
if (Buffer.isBuffer(data)) return new Uint8Array(data);
|
|
2901
|
+
if (Array.isArray(data)) return new Uint8Array(Buffer.concat(data));
|
|
2902
|
+
return new Uint8Array(Buffer.from(data));
|
|
2903
|
+
}
|
|
2904
|
+
var SandboxFsClient = class SandboxFsClient {
|
|
2905
|
+
ws;
|
|
2906
|
+
ready;
|
|
2907
|
+
nextReqId = 1;
|
|
2908
|
+
pending = /* @__PURE__ */ new Map();
|
|
2909
|
+
closedReason = null;
|
|
2910
|
+
constructor(opts) {
|
|
2911
|
+
const spec = {
|
|
2912
|
+
mode: "fs",
|
|
2913
|
+
agentId: opts.agentId
|
|
2914
|
+
};
|
|
2915
|
+
const url = new URL(`${wsBase(opts.appUrl)}${SANDBOX_STREAM_PATH}`);
|
|
2916
|
+
for (const [key, value] of Object.entries(streamSpecToQuery(spec))) url.searchParams.set(key, value);
|
|
2917
|
+
this.ws = new WebSocket(url.toString(), { headers: { authorization: `Bearer ${opts.sessionToken}` } });
|
|
2918
|
+
this.ws.binaryType = "nodebuffer";
|
|
2919
|
+
this.ready = new Promise((resolve, reject) => {
|
|
2920
|
+
this.ws.once("open", () => resolve());
|
|
2921
|
+
this.ws.once("error", (err) => reject(err));
|
|
2922
|
+
});
|
|
2923
|
+
this.ws.on("message", (data, isBinary) => {
|
|
2924
|
+
if (!isBinary) return;
|
|
2925
|
+
const res = decodeFsResponse(toU8(data));
|
|
2926
|
+
if (!res) return;
|
|
2927
|
+
const p = this.pending.get(res.reqId);
|
|
2928
|
+
if (!p) return;
|
|
2929
|
+
this.pending.delete(res.reqId);
|
|
2930
|
+
if (res.status === "error") p.reject(new Error(res.message));
|
|
2931
|
+
else p.resolve({
|
|
2932
|
+
result: res.result,
|
|
2933
|
+
blob: res.blob
|
|
2934
|
+
});
|
|
2935
|
+
});
|
|
2936
|
+
const failAll = (reason) => {
|
|
2937
|
+
this.closedReason = reason;
|
|
2938
|
+
for (const [, p] of this.pending) p.reject(new Error(reason));
|
|
2939
|
+
this.pending.clear();
|
|
2940
|
+
};
|
|
2941
|
+
this.ws.on("error", (err) => failAll(err.message));
|
|
2942
|
+
this.ws.on("close", () => failAll(this.closedReason ?? "the sandbox filesystem connection closed"));
|
|
2943
|
+
}
|
|
2944
|
+
/** Open and wait for the channel to be ready to accept requests. */
|
|
2945
|
+
static async connect(opts) {
|
|
2946
|
+
const client = new SandboxFsClient(opts);
|
|
2947
|
+
await client.ready;
|
|
2948
|
+
return client;
|
|
2949
|
+
}
|
|
2950
|
+
request(req, blob) {
|
|
2951
|
+
if (this.closedReason) return Promise.reject(new Error(this.closedReason));
|
|
2952
|
+
const reqId = this.nextReqId++;
|
|
2953
|
+
return new Promise((resolve, reject) => {
|
|
2954
|
+
this.pending.set(reqId, {
|
|
2955
|
+
resolve,
|
|
2956
|
+
reject
|
|
2957
|
+
});
|
|
2958
|
+
try {
|
|
2959
|
+
this.ws.send(encodeFsRequest(reqId, req, blob));
|
|
2960
|
+
} catch (error) {
|
|
2961
|
+
this.pending.delete(reqId);
|
|
2962
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
2963
|
+
}
|
|
2964
|
+
});
|
|
2965
|
+
}
|
|
2966
|
+
async list(path) {
|
|
2967
|
+
const { result } = await this.request({
|
|
2968
|
+
op: "list",
|
|
2969
|
+
path
|
|
2970
|
+
}, null);
|
|
2971
|
+
const entries = result["entries"];
|
|
2972
|
+
if (!Array.isArray(entries)) return [];
|
|
2973
|
+
return entries;
|
|
2974
|
+
}
|
|
2975
|
+
async stat(path) {
|
|
2976
|
+
const { result } = await this.request({
|
|
2977
|
+
op: "stat",
|
|
2978
|
+
path
|
|
2979
|
+
}, null);
|
|
2980
|
+
return result["stat"];
|
|
2981
|
+
}
|
|
2982
|
+
async read(path, range) {
|
|
2983
|
+
const req = range ? {
|
|
2984
|
+
op: "read",
|
|
2985
|
+
path,
|
|
2986
|
+
offset: range.offset,
|
|
2987
|
+
length: range.length
|
|
2988
|
+
} : {
|
|
2989
|
+
op: "read",
|
|
2990
|
+
path
|
|
2991
|
+
};
|
|
2992
|
+
const { blob } = await this.request(req, null);
|
|
2993
|
+
return blob;
|
|
2994
|
+
}
|
|
2995
|
+
async write(path, data) {
|
|
2996
|
+
await this.request({
|
|
2997
|
+
op: "write",
|
|
2998
|
+
path
|
|
2999
|
+
}, data);
|
|
3000
|
+
}
|
|
3001
|
+
async mkdir(path) {
|
|
3002
|
+
await this.request({
|
|
3003
|
+
op: "mkdir",
|
|
3004
|
+
path
|
|
3005
|
+
}, null);
|
|
3006
|
+
}
|
|
3007
|
+
async rename(oldPath, newPath) {
|
|
3008
|
+
await this.request({
|
|
3009
|
+
op: "rename",
|
|
3010
|
+
oldPath,
|
|
3011
|
+
newPath
|
|
3012
|
+
}, null);
|
|
3013
|
+
}
|
|
3014
|
+
async remove(path) {
|
|
3015
|
+
await this.request({
|
|
3016
|
+
op: "remove",
|
|
3017
|
+
path
|
|
3018
|
+
}, null);
|
|
3019
|
+
}
|
|
3020
|
+
async exists(path) {
|
|
3021
|
+
const { result } = await this.request({
|
|
3022
|
+
op: "exists",
|
|
3023
|
+
path
|
|
3024
|
+
}, null);
|
|
3025
|
+
return result["exists"] === true;
|
|
3026
|
+
}
|
|
3027
|
+
close() {
|
|
3028
|
+
this.closedReason ??= "closed by caller";
|
|
3029
|
+
this.ws.close();
|
|
3030
|
+
}
|
|
3031
|
+
};
|
|
3032
|
+
|
|
2891
3033
|
//#endregion
|
|
2892
3034
|
//#region src/commands/fs.ts
|
|
2893
3035
|
/**
|
|
2894
|
-
* POSIX-quote one word so the remote shell treats it as a single token. Wraps
|
|
2895
|
-
* `shell-quote`'s `quote` (already a repo dependency, used elsewhere in the
|
|
2896
|
-
* CLI) rather than hand-rolling the escaping — it is the well-tested source of
|
|
2897
|
-
* truth for making a path/arg with spaces, quotes, `$`, `;`, globs, etc. inert
|
|
2898
|
-
* when interpolated into an `sh -c` line.
|
|
2899
|
-
*/
|
|
2900
|
-
function shellQuote(word) {
|
|
2901
|
-
return quote([word]);
|
|
2902
|
-
}
|
|
2903
|
-
const MISSING_FILE_EXIT = 44;
|
|
2904
|
-
/**
|
|
2905
|
-
* Build the remote shell command that base64-encodes a file to stdout. Exits
|
|
2906
|
-
* {@link MISSING_FILE_EXIT} when the path doesn't exist, 1 when it's a
|
|
2907
|
-
* directory, so the caller can tell "create new" from a genuine error.
|
|
2908
|
-
*/
|
|
2909
|
-
function buildReadCommand(path) {
|
|
2910
|
-
const q = shellQuote(path);
|
|
2911
|
-
return `sh -c ${shellQuote(`if [ ! -e ${q} ]; then exit ${MISSING_FILE_EXIT}; fi; if [ -d ${q} ]; then echo 'path is a directory' >&2; exit 1; fi; base64 < ${q}`)}`;
|
|
2912
|
-
}
|
|
2913
|
-
/**
|
|
2914
|
-
* Build the remote shell command that decodes `b64` and writes it to `path`
|
|
2915
|
-
* atomically (temp file + `mv`) so a dropped connection can't truncate the
|
|
2916
|
-
* original in place. `token` is a caller-supplied unique suffix for the temp
|
|
2917
|
-
* file — generated in JS (not the shell's `$$`, which shell-quote would escape
|
|
2918
|
-
* to a literal, so every write would collide on the same temp name).
|
|
2919
|
-
*/
|
|
2920
|
-
function buildWriteCommand(path, b64, token) {
|
|
2921
|
-
const tmp = `${path}.skydive-edit.${token}`;
|
|
2922
|
-
return `sh -c ${shellQuote(`printf %s ${shellQuote(b64)} | base64 -d > ${shellQuote(tmp)} && mv -f ${shellQuote(tmp)} ${shellQuote(path)}`)}`;
|
|
2923
|
-
}
|
|
2924
|
-
/**
|
|
2925
3036
|
* Resolve the editor command from an explicit override, then $VISUAL, $EDITOR,
|
|
2926
3037
|
* then `vi`. Split so `EDITOR="code --wait"` (command + flags) is honored.
|
|
2927
3038
|
*/
|
|
@@ -2935,17 +3046,17 @@ function resolveEditor(override, env) {
|
|
|
2935
3046
|
/**
|
|
2936
3047
|
* `skydive fs edit <path>` — edit a file that lives on the agent's computer
|
|
2937
3048
|
* (its sandbox) with your LOCAL editor. It reads the remote file down over the
|
|
2938
|
-
*
|
|
2939
|
-
* changes back when you save and close — so you edit a remote file as if
|
|
2940
|
-
* were local, without opening the chat TUI.
|
|
3049
|
+
* multiplexed `fs` sandbox-stream channel, opens it in `$EDITOR`, and writes
|
|
3050
|
+
* your changes back when you save and close — so you edit a remote file as if
|
|
3051
|
+
* it were local, without opening the chat TUI.
|
|
2941
3052
|
*
|
|
2942
|
-
*
|
|
2943
|
-
*
|
|
2944
|
-
*
|
|
2945
|
-
* embedded
|
|
2946
|
-
*
|
|
2947
|
-
*
|
|
2948
|
-
*
|
|
3053
|
+
* It rides the first-class `fs` relay channel ({@link SandboxFsClient}): file
|
|
3054
|
+
* bytes move as the frame's trailing binary blob in BOTH directions, so binary
|
|
3055
|
+
* content, trailing newlines, and CRLF are preserved and — unlike the old
|
|
3056
|
+
* exec-mode path that embedded a base64 payload in the upgrade URL — a large
|
|
3057
|
+
* file no longer blows past the WebSocket URL / request-header length limit.
|
|
3058
|
+
* Access gating (EDIT on the agent + the `sandbox-fs-enabled` kill switch) is
|
|
3059
|
+
* enforced by the relay, exactly as for `skydive sandbox`.
|
|
2949
3060
|
*/
|
|
2950
3061
|
const fsEditCommand = {
|
|
2951
3062
|
command: "edit <path>",
|
|
@@ -2964,8 +3075,8 @@ const fsEditCommand = {
|
|
|
2964
3075
|
handler: async (argv) => {
|
|
2965
3076
|
const session = requireSession(argv);
|
|
2966
3077
|
const remotePath = argv.path;
|
|
2967
|
-
const { createRestClient } = await import("./rest-
|
|
2968
|
-
const { resolveAgent } = await import("./print-
|
|
3078
|
+
const { createRestClient } = await import("./rest-v-7FQqLP.mjs");
|
|
3079
|
+
const { resolveAgent } = await import("./print-DV9L41G2.mjs");
|
|
2969
3080
|
const client = createRestClient({
|
|
2970
3081
|
appUrl: session.appUrl,
|
|
2971
3082
|
sessionToken: session.sessionToken
|
|
@@ -2980,148 +3091,63 @@ const fsEditCommand = {
|
|
|
2980
3091
|
printError(error instanceof Error ? error.message : String(error));
|
|
2981
3092
|
process.exit(1);
|
|
2982
3093
|
}
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
if (read.kind === "error") {
|
|
2993
|
-
printError(read.message);
|
|
3094
|
+
let fs;
|
|
3095
|
+
try {
|
|
3096
|
+
fs = await SandboxFsClient.connect({
|
|
3097
|
+
appUrl: session.appUrl,
|
|
3098
|
+
sessionToken: session.sessionToken,
|
|
3099
|
+
agentId: agent.id
|
|
3100
|
+
});
|
|
3101
|
+
} catch (error) {
|
|
3102
|
+
printError(`Could not open the sandbox filesystem channel: ${error instanceof Error ? error.message : String(error)}`);
|
|
2994
3103
|
process.exit(1);
|
|
2995
3104
|
}
|
|
2996
|
-
const
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3105
|
+
const cleanup = async (dir) => {
|
|
3106
|
+
await rm(dir, {
|
|
3107
|
+
recursive: true,
|
|
3108
|
+
force: true
|
|
3109
|
+
}).catch((error) => {
|
|
3110
|
+
console.error(`Note: could not remove temp dir ${dir}: ${error instanceof Error ? error.message : String(error)}`);
|
|
3111
|
+
});
|
|
3112
|
+
};
|
|
3113
|
+
let local = null;
|
|
3114
|
+
let dir = null;
|
|
3000
3115
|
try {
|
|
3116
|
+
console.error(`Reading ${remotePath} from ${agent.name}'s sandbox…`);
|
|
3117
|
+
const isNew = !await fs.exists(remotePath);
|
|
3118
|
+
const original = isNew ? Buffer.alloc(0) : Buffer.from(await fs.read(remotePath, null));
|
|
3119
|
+
if (isNew) console.error(`${remotePath} does not exist yet — it will be created when you save.`);
|
|
3120
|
+
dir = await mkdtemp(join(tmpdir(), "skydive-edit-"));
|
|
3121
|
+
const base = remotePath.split("/").pop() || "file";
|
|
3122
|
+
local = join(dir, base);
|
|
3001
3123
|
await writeFile(local, original);
|
|
3002
3124
|
if (!await openEditor(argv.editor, local)) {
|
|
3003
3125
|
printError("Editor exited non-zero; not saving any changes.");
|
|
3126
|
+
fs.close();
|
|
3127
|
+
await cleanup(dir);
|
|
3004
3128
|
process.exit(1);
|
|
3005
3129
|
}
|
|
3006
3130
|
const edited = await readFile(local);
|
|
3007
3131
|
if (edited.equals(original)) {
|
|
3008
3132
|
console.error("No changes — nothing written.");
|
|
3133
|
+
fs.close();
|
|
3134
|
+
await cleanup(dir);
|
|
3009
3135
|
process.exit(0);
|
|
3010
3136
|
}
|
|
3011
3137
|
console.error(`Writing changes back to ${remotePath}…`);
|
|
3012
|
-
|
|
3013
|
-
...opts,
|
|
3014
|
-
path: remotePath,
|
|
3015
|
-
content: edited
|
|
3016
|
-
});
|
|
3017
|
-
if (wrote.kind === "error") {
|
|
3018
|
-
printError(`${wrote.message}\nYour edited copy is kept at ${local} so you don't lose it.`);
|
|
3019
|
-
process.exit(1);
|
|
3020
|
-
}
|
|
3138
|
+
await fs.write(remotePath, new Uint8Array(edited));
|
|
3021
3139
|
console.error("Saved.");
|
|
3140
|
+
fs.close();
|
|
3141
|
+
await cleanup(dir);
|
|
3022
3142
|
process.exit(0);
|
|
3023
|
-
}
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
}).catch((error) => {
|
|
3028
|
-
console.error(`Note: could not remove temp dir ${dir}: ${error instanceof Error ? error.message : String(error)}`);
|
|
3029
|
-
});
|
|
3143
|
+
} catch (error) {
|
|
3144
|
+
fs.close();
|
|
3145
|
+
printError(`${error instanceof Error ? error.message : String(error)}${local ? `\nYour edited copy is kept at ${local} so you don't lose it.` : ""}`);
|
|
3146
|
+
process.exit(1);
|
|
3030
3147
|
}
|
|
3031
3148
|
}
|
|
3032
3149
|
};
|
|
3033
3150
|
/**
|
|
3034
|
-
* Read a remote file as bytes. Runs `base64` on the file in the sandbox and
|
|
3035
|
-
* decodes the streamed stdout locally. Distinguishes "file is missing" (exit
|
|
3036
|
-
* code 44, so `edit` can create it) from a real read failure.
|
|
3037
|
-
*/
|
|
3038
|
-
function readRemote({ session, agentId, path }) {
|
|
3039
|
-
const command = buildReadCommand(path);
|
|
3040
|
-
const chunks = [];
|
|
3041
|
-
const stderr = [];
|
|
3042
|
-
return new Promise((resolve) => {
|
|
3043
|
-
SandboxStream.open({
|
|
3044
|
-
mode: "exec",
|
|
3045
|
-
appUrl: session.appUrl,
|
|
3046
|
-
sessionToken: session.sessionToken,
|
|
3047
|
-
agentId,
|
|
3048
|
-
command,
|
|
3049
|
-
onEvent: (e) => {
|
|
3050
|
-
switch (e.type) {
|
|
3051
|
-
case "data":
|
|
3052
|
-
chunks.push(Buffer.from(e.bytes));
|
|
3053
|
-
break;
|
|
3054
|
-
case "exit":
|
|
3055
|
-
if (e.code === MISSING_FILE_EXIT) resolve({
|
|
3056
|
-
kind: "missing",
|
|
3057
|
-
content: Buffer.alloc(0)
|
|
3058
|
-
});
|
|
3059
|
-
else if (e.code === 0) resolve({
|
|
3060
|
-
kind: "ok",
|
|
3061
|
-
content: Buffer.from(Buffer.concat(chunks).toString("utf8").replace(/\s+/g, ""), "base64")
|
|
3062
|
-
});
|
|
3063
|
-
else resolve({
|
|
3064
|
-
kind: "error",
|
|
3065
|
-
message: stderr.join("").trim() || `Could not read the file (exit ${e.code}).`
|
|
3066
|
-
});
|
|
3067
|
-
break;
|
|
3068
|
-
case "error":
|
|
3069
|
-
stderr.push(e.message);
|
|
3070
|
-
break;
|
|
3071
|
-
case "close":
|
|
3072
|
-
resolve({
|
|
3073
|
-
kind: "error",
|
|
3074
|
-
message: e.failure || "The connection to the sandbox closed before the file could be read."
|
|
3075
|
-
});
|
|
3076
|
-
break;
|
|
3077
|
-
}
|
|
3078
|
-
}
|
|
3079
|
-
});
|
|
3080
|
-
});
|
|
3081
|
-
}
|
|
3082
|
-
/**
|
|
3083
|
-
* Write bytes to a remote file. Exec has no stdin, so the base64 payload is
|
|
3084
|
-
* embedded in the command and decoded on the far side. Writes atomically via a
|
|
3085
|
-
* temp file + `mv` so a dropped connection mid-write can't leave a truncated
|
|
3086
|
-
* file in place of the original.
|
|
3087
|
-
*/
|
|
3088
|
-
function writeRemote({ session, agentId, path, content }) {
|
|
3089
|
-
const token = randomBytes(6).toString("hex");
|
|
3090
|
-
const command = buildWriteCommand(path, content.toString("base64"), token);
|
|
3091
|
-
const stderr = [];
|
|
3092
|
-
return new Promise((resolve) => {
|
|
3093
|
-
SandboxStream.open({
|
|
3094
|
-
mode: "exec",
|
|
3095
|
-
appUrl: session.appUrl,
|
|
3096
|
-
sessionToken: session.sessionToken,
|
|
3097
|
-
agentId,
|
|
3098
|
-
command,
|
|
3099
|
-
onEvent: (e) => {
|
|
3100
|
-
switch (e.type) {
|
|
3101
|
-
case "data":
|
|
3102
|
-
stderr.push(Buffer.from(e.bytes).toString("utf8"));
|
|
3103
|
-
break;
|
|
3104
|
-
case "exit":
|
|
3105
|
-
resolve(e.code === 0 ? { kind: "ok" } : {
|
|
3106
|
-
kind: "error",
|
|
3107
|
-
message: stderr.join("").trim() || `Could not write the file (exit ${e.code}).`
|
|
3108
|
-
});
|
|
3109
|
-
break;
|
|
3110
|
-
case "error":
|
|
3111
|
-
stderr.push(e.message);
|
|
3112
|
-
break;
|
|
3113
|
-
case "close":
|
|
3114
|
-
resolve({
|
|
3115
|
-
kind: "error",
|
|
3116
|
-
message: e.failure || "The connection to the sandbox closed before the file was written."
|
|
3117
|
-
});
|
|
3118
|
-
break;
|
|
3119
|
-
}
|
|
3120
|
-
}
|
|
3121
|
-
});
|
|
3122
|
-
});
|
|
3123
|
-
}
|
|
3124
|
-
/**
|
|
3125
3151
|
* Open `file` in the caller's editor and resolve to whether it exited cleanly.
|
|
3126
3152
|
* Precedence: explicit `--editor`, then $VISUAL, $EDITOR, then `vi`. The editor
|
|
3127
3153
|
* inherits the real TTY so full-screen editors (vim/nano) work.
|
|
@@ -3144,7 +3170,7 @@ function openEditor(override, file) {
|
|
|
3144
3170
|
*
|
|
3145
3171
|
* - `fs edit <path>` edit one remote file with your local editor (shipped).
|
|
3146
3172
|
* - `fs mount <dir>` mount the whole sandbox filesystem locally (coming in a
|
|
3147
|
-
* later PR, on
|
|
3173
|
+
* later PR, on the same first-class `fs` relay channel).
|
|
3148
3174
|
*
|
|
3149
3175
|
* Grouping these under one command keeps the file surface discoverable and
|
|
3150
3176
|
* leaves room to grow (`fs ls`, `fs cat`, `fs pull`) without adding more
|
|
@@ -3432,7 +3458,27 @@ function resolveSelfPath(execPath = process.execPath) {
|
|
|
3432
3458
|
|
|
3433
3459
|
//#endregion
|
|
3434
3460
|
//#region src/update-check/sources.ts
|
|
3461
|
+
/**
|
|
3462
|
+
* How this CLI was installed, which decides whether `skydive update` (and the
|
|
3463
|
+
* background update check) self-updates the binary from the release CDN or
|
|
3464
|
+
* hands off to the package manager.
|
|
3465
|
+
*
|
|
3466
|
+
* Two signals, runtime env first:
|
|
3467
|
+
* - `SKYDIVE_CLI_INSTALL_SOURCE` env var — set by the npm launcher
|
|
3468
|
+
* (src/launcher.ts) to `package-manager` before it execs the compiled
|
|
3469
|
+
* binary. The binary itself is `--define`'d to `binary`, but when it was
|
|
3470
|
+
* launched via the npm-installed launcher, npm owns its bytes and must not
|
|
3471
|
+
* be self-mutated — so the env override wins.
|
|
3472
|
+
* - The `SKYDIVE_CLI_INSTALL_SOURCE` compile-time constant — stamped
|
|
3473
|
+
* `binary` into the standalone binary, undefined in the npm JS bundle.
|
|
3474
|
+
*
|
|
3475
|
+
* Any value other than exactly `binary` (including unset) means
|
|
3476
|
+
* package-manager, the safe default: we never self-update something we can't
|
|
3477
|
+
* prove is a standalone binary.
|
|
3478
|
+
*/
|
|
3435
3479
|
function resolveInstallSource() {
|
|
3480
|
+
const runtime = typeof process !== "undefined" ? process.env?.["SKYDIVE_CLI_INSTALL_SOURCE"] : void 0;
|
|
3481
|
+
if (runtime !== void 0) return runtime === "binary" ? "binary" : "package-manager";
|
|
3436
3482
|
return typeof SKYDIVE_CLI_INSTALL_SOURCE === "string" && SKYDIVE_CLI_INSTALL_SOURCE === "binary" ? "binary" : "package-manager";
|
|
3437
3483
|
}
|
|
3438
3484
|
const NPM_REGISTRY_URL = "https://registry.npmjs.org";
|
|
@@ -4357,7 +4403,7 @@ function setupUpdateCheck(argv) {
|
|
|
4357
4403
|
|
|
4358
4404
|
//#endregion
|
|
4359
4405
|
//#region src/changelog.generated.ts
|
|
4360
|
-
const CHANGELOG_MD = "# Changelog\n\nAll notable changes to the Skydive CLI are documented here.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n### Added\n\n- `/search` (alias `/find`) in the chat TUI — opens the conversation picker with its search field focused, so \"find a conversation\" has a discoverable command instead of being a feature you had to know the bare picker already had. Pass a query inline (`/search billing deep dive`) and the picker opens already narrowed to the matches; bare `/search` opens it ready for you to type. The search runs server-side across conversation titles, message bodies, and participant names, the same search the picker exposes.\n- First run in a workspace with no agents now sets you up automatically: instead of dropping you on an empty agent picker, `skydive` creates your first agent for you (with a suggested name and avatar, mirroring the web onboarding flow) and then offers to have it learn how you already work — reading the other coding agents set up on your machine (Claude Code, Cursor, Codex, and more), the same import that `skydive import` runs, with a plan shown first and credentials never copied. Decline and you go straight into the new agent's chat. You can replay this flow anytime with `skydive --onboarding` (or `SKYDIVE_FORCE_ONBOARDING=1`), even in a workspace that already has agents.\n- `/computer` (alias `/stats`) in the chat TUI — a snapshot of the agent's sandbox drawn as colored bar graphs: CPU, memory, and disk usage. Bars turn amber past 75%% and red past 90%% so a glance tells you whether the box is under pressure. The numbers come from the Skydive API (the same live resource sample the web computer view reads), not by connecting to the sandbox — so the card shows instantly, never waking or hanging on a box that isn't running: when the agent has no live sandbox it simply reads \"no sandbox running\". The card keeps itself current quietly (a slow background refresh, no flicker or \"updating\" chrome); only the most recent card refreshes, and it silently stops while you're scrolled up (no wasted polls on a card you're not looking at) and resumes at the bottom.\n- `skydive fs` — a namespace for working with the files on an agent's computer (its sandbox) from your own machine. Its first subcommand, `skydive fs edit <path>`, reads a remote file down over the same relay `skydive sandbox` uses, opens it in your local editor (`$VISUAL`/`$EDITOR`, override with `--editor`, defaults to `vi`), and writes your changes back atomically when you save and close — so you can edit a remote file as if it were local without opening the chat TUI. A path that doesn't exist yet is created on save; no changes means nothing is written. Access is gated on EDIT permission for the agent, exactly like `skydive sandbox`. (A first-class `fs` relay channel and `skydive fs mount` land in follow-ups.)\n\n## [0.4.0] - 2026-08-07\n\n### Added\n\n- `skydive chat` works with API key auth: an API key alone now opens the chat TUI (and headless `chat -p`) without a browser login, using the key's pinned workspace.\n- `skydive config` command to view and set the safe, hand-editable CLI preferences (`shareMachineDefault`, `updateCheck`) without opening `config.json`. `config`/`config list` shows each key, its effective value, and whether it comes from the file or the built-in default; `config get`/`set`/`unset` read and change one key; `config path` prints the config file location. It only ever touches those preference keys, never credentials or flow-managed state.\n- Billing-blocked sends and runs now surface the server-authored recovery\n guidance from the typed billing outcome. The chat TUI renders it as a\n warning-toned system-notice row — live when a send is refused or a run is\n stopped at the billing boundary, and again when reopening a conversation\n that holds a persisted billing notice — instead of a generic error.\n Headless `chat -p` and `messages get` print the guidance (state, recovery\n step, and manage-billing URL) on stderr, keep any partial output already\n streamed on stdout, and exit with code `5` (distinct from the generic `1`)\n so scripted callers can tell a billing pause from a failure.\n- Syntax highlighting for 14 more languages in the chat transcript and file/review panes (python, bash, go, rust, c, cpp, java, ruby, css, html, json, yaml, and more) — previously only JavaScript/TypeScript rendered colored.\n\n### Changed\n\n- `skydive agent list` lists the full agent roster by default instead of a truncated page.\n\n### Fixed\n\n- Long multi-line bash tool-call commands (e.g. heredocs) are clamped with a `+N more · click to expand` tail instead of dumping their whole body into the scrollback.\n- Tool error output is clipped the same way as ok output, so a failing command no longer floods the transcript.\n- The TUI toast overlay has an opaque background instead of letting the transcript bleed through.\n\n## [0.3.0] - 2026-08-04\n\n### Added\n\n**Chat TUI**\n\n- `/fork` slash command to fork a conversation at any point and continue in a new thread.\n- `/conversation` switches threads from inside a live session.\n- `/compact` triggers manual conversation compaction.\n- `/portal` and `/copy` slash commands.\n- Archive the current conversation from the chat TUI.\n- `--new` flag on `skydive chat` to start a fresh conversation.\n- Debounced server-side conversation search in the picker, with title matches ranked first.\n- File review pane orientation toggle, and review comments in the file pane.\n- Pinned plan card controls and a jump-to-latest hint.\n- Terminal title (OSC) follows the live conversation title on every screen; inside cmux the workspace is renamed too, and linked PRs are pushed to the cmux sidebar.\n- Every participating agent shows in the conversation list; connect cards each have their own identity, and ctrl+r asks which connect card to act on.\n- Colored Skydive splash art in `skydive --help` and the TUI pickers.\n- New-agent name prefilled from the server's suggestion.\n\n**CLI & platform**\n\n- `skydive update` self-updater, with an update notice when a new version is available.\n- Shell completions for bash, zsh, and fish via `completion install`.\n- Portal daemon: one connection per host with per-conversation working directories.\n- Agent-led coding-agent import (`skydive import`).\n- Per-workspace scoping on the REST client, and cross-org `--agent <uuid>` auto-switches workspace.\n- `skydive-beta` wrapper for the canary channel.\n\n### Fixed\n\n- `skydive update` no longer claims an update is available on every npm install.\n- Chat memory is bounded (payload clamps + windowed rows) with a memory watchdog and OOM diagnostic report; transcript rows are memoized so streaming stops re-rendering the whole chat.\n- Chat-send failures map to real error messages.\n- Notification and sidebar previews use the last text block of the reply and strip inline markdown.\n- Picker rows no longer overlap when a conversation title contains a newline, tab, or control character.\n- Sending to non-web channel conversations is blocked in the TUI.\n- GitHub bot connect opens on the web front door, not api.skydive.com.\n- TUI activity counter times from the run, not the screen.\n\n## [0.2.0] - 2026-07-29\n\n### Added\n\n**Sandbox & machine access**\n\n- Standalone `skydive sandbox` command for direct access to an agent's sandbox.\n- `/sandbox` in the chat TUI — live PTY session and one-shot command execution.\n- Headless machine sharing via `skydive portal`, with self-registering portal grants.\n- `shareMachineDefault` config key for always-on portal sharing.\n\n**Chat TUI**\n\n- File pane (`ctrl+g`) with Changes and Files tabs: a shared file tree plus source viewer and a workspace browser, mouse-resizable and responsive to terminal size.\n- Agent todo list rendered in the chat TUI, above the composer, mirroring the web chat's todo card.\n- Fuzzy finder in the conversation and agent pickers.\n- Slash-command autocomplete menu.\n- Paste or drag-and-drop any file into the composer; paste clipboard images with Cmd+V.\n- Run local shell commands with `!` in the composer.\n- Conversation recaps, streamed live title updates, and per-agent attribution on assistant turns.\n- Working timer rolls up into minutes and hours.\n- Conversation picker paginates past 50 conversations and shows only your own conversations.\n- Esc leaves a live run; typing `exit` quits the chat.\n- Cursor Dark theme.\n- Picker rows no longer overlap when a conversation title contains a newline, tab, or control character.\n\n**Headless & scripting**\n\n- Resume a conversation by id.\n- `conversations list` and `conversations show` for transcript reads.\n- `messages get`, with run recovery keyed on message id.\n- Connect cards surface in headless `-p` mode so a driving agent never gets stuck.\n\n**Authentication**\n\n- `skydive auth login` via the browser now auto-mints an API key, so one login yields both a chat session and a usable management credential. Management commands announce the key's pinned workspace when it drives them, so a workspace mismatch is visible at use time.\n- Workspace picker on the device authorization page.\n- Account and workspace identity shown in `auth status`.\n\n**Platform**\n\n- Standalone binary builds compiling the CLI into a per-target executable.\n- Interactive workspace switcher; management commands follow the active workspace.\n- Terminal host integrations and agent notifications.\n\n### Fixed\n\n- Transcript errors collapse to one line, click to expand (REST and portal errors keep their full body).\n- Dragged/pasted image file paths attach the file instead of inserting path text, including macOS paths with literal parentheses.\n- Bare URLs in chat markdown are hyperlinked so they survive text wrap.\n- Composer draft is preserved across TUI overlays.\n- Relative connect links resolve before opening the browser.\n- Numbered markdown headings render colored in the TUI.\n- Chat transcript pages by 75% of a screen; picker rows stay on one line.\n- Run starts push to the TUI over the conversation stream.\n- Security: remediated high-severity dependency findings and cleared tar/shell-quote CVEs.\n\n## [0.1.0] - 2026-07-21\n\nInitial public release: `skydive chat` TUI, agent and conversation management,\ndevice authorization, and headless `-p` mode.\n";
|
|
4406
|
+
const CHANGELOG_MD = "# Changelog\n\nAll notable changes to the Skydive CLI are documented here.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n### Changed\n\n- `npm i -g skydive-cli` (and yarn/pnpm/bun) now installs a tiny launcher plus one prebuilt, os/cpu-matched binary that carries its own runtime — so on the common platforms `skydive chat` and `skydive import` start instantly and **do not download a Bun runtime on first use**. On any platform without a prebuilt binary (or if the optional dependency is skipped), the CLI automatically falls back to the existing behavior: it runs under your Node and provisions Bun on first `chat`, exactly as before. Nothing about the commands, flags, config, or `SKYDIVE_*` environment variables changes, and `skydive update` still upgrades npm installs via your package manager and standalone-binary installs in place.\n\n### Added\n\n- `/search` (alias `/find`) in the chat TUI — opens the conversation picker with its search field focused, so \"find a conversation\" has a discoverable command instead of being a feature you had to know the bare picker already had. Pass a query inline (`/search billing deep dive`) and the picker opens already narrowed to the matches; bare `/search` opens it ready for you to type. The search runs server-side across conversation titles, message bodies, and participant names, the same search the picker exposes.\n- First run in a workspace with no agents now sets you up automatically: instead of dropping you on an empty agent picker, `skydive` creates your first agent for you (with a suggested name and avatar, mirroring the web onboarding flow) and then offers to have it learn how you already work — reading the other coding agents set up on your machine (Claude Code, Cursor, Codex, and more), the same import that `skydive import` runs, with a plan shown first and credentials never copied. Decline and you go straight into the new agent's chat. You can replay this flow anytime with `skydive --onboarding` (or `SKYDIVE_FORCE_ONBOARDING=1`), even in a workspace that already has agents.\n- `/computer` (alias `/stats`) in the chat TUI — a snapshot of the agent's sandbox drawn as colored bar graphs: CPU, memory, and disk usage. Bars turn amber past 75%% and red past 90%% so a glance tells you whether the box is under pressure. The numbers come from the Skydive API (the same live resource sample the web computer view reads), not by connecting to the sandbox — so the card shows instantly, never waking or hanging on a box that isn't running: when the agent has no live sandbox it simply reads \"no sandbox running\". The card keeps itself current quietly (a slow background refresh, no flicker or \"updating\" chrome); only the most recent card refreshes, and it silently stops while you're scrolled up (no wasted polls on a card you're not looking at) and resumes at the bottom.\n- `skydive fs` — a namespace for working with the files on an agent's computer (its sandbox) from your own machine. Its first subcommand, `skydive fs edit <path>`, reads a remote file down over the same relay `skydive sandbox` uses, opens it in your local editor (`$VISUAL`/`$EDITOR`, override with `--editor`, defaults to `vi`), and writes your changes back atomically when you save and close — so you can edit a remote file as if it were local without opening the chat TUI. A path that doesn't exist yet is created on save; no changes means nothing is written. Access is gated on EDIT permission for the agent, exactly like `skydive sandbox`. (A first-class `fs` relay channel and `skydive fs mount` land in follow-ups.)\n\n## [0.4.0] - 2026-08-07\n\n### Added\n\n- `skydive chat` works with API key auth: an API key alone now opens the chat TUI (and headless `chat -p`) without a browser login, using the key's pinned workspace.\n- `skydive config` command to view and set the safe, hand-editable CLI preferences (`shareMachineDefault`, `updateCheck`) without opening `config.json`. `config`/`config list` shows each key, its effective value, and whether it comes from the file or the built-in default; `config get`/`set`/`unset` read and change one key; `config path` prints the config file location. It only ever touches those preference keys, never credentials or flow-managed state.\n- Billing-blocked sends and runs now surface the server-authored recovery\n guidance from the typed billing outcome. The chat TUI renders it as a\n warning-toned system-notice row — live when a send is refused or a run is\n stopped at the billing boundary, and again when reopening a conversation\n that holds a persisted billing notice — instead of a generic error.\n Headless `chat -p` and `messages get` print the guidance (state, recovery\n step, and manage-billing URL) on stderr, keep any partial output already\n streamed on stdout, and exit with code `5` (distinct from the generic `1`)\n so scripted callers can tell a billing pause from a failure.\n- Syntax highlighting for 14 more languages in the chat transcript and file/review panes (python, bash, go, rust, c, cpp, java, ruby, css, html, json, yaml, and more) — previously only JavaScript/TypeScript rendered colored.\n\n### Changed\n\n- `skydive agent list` lists the full agent roster by default instead of a truncated page.\n\n### Fixed\n\n- Long multi-line bash tool-call commands (e.g. heredocs) are clamped with a `+N more · click to expand` tail instead of dumping their whole body into the scrollback.\n- Tool error output is clipped the same way as ok output, so a failing command no longer floods the transcript.\n- The TUI toast overlay has an opaque background instead of letting the transcript bleed through.\n\n## [0.3.0] - 2026-08-04\n\n### Added\n\n**Chat TUI**\n\n- `/fork` slash command to fork a conversation at any point and continue in a new thread.\n- `/conversation` switches threads from inside a live session.\n- `/compact` triggers manual conversation compaction.\n- `/portal` and `/copy` slash commands.\n- Archive the current conversation from the chat TUI.\n- `--new` flag on `skydive chat` to start a fresh conversation.\n- Debounced server-side conversation search in the picker, with title matches ranked first.\n- File review pane orientation toggle, and review comments in the file pane.\n- Pinned plan card controls and a jump-to-latest hint.\n- Terminal title (OSC) follows the live conversation title on every screen; inside cmux the workspace is renamed too, and linked PRs are pushed to the cmux sidebar.\n- Every participating agent shows in the conversation list; connect cards each have their own identity, and ctrl+r asks which connect card to act on.\n- Colored Skydive splash art in `skydive --help` and the TUI pickers.\n- New-agent name prefilled from the server's suggestion.\n\n**CLI & platform**\n\n- `skydive update` self-updater, with an update notice when a new version is available.\n- Shell completions for bash, zsh, and fish via `completion install`.\n- Portal daemon: one connection per host with per-conversation working directories.\n- Agent-led coding-agent import (`skydive import`).\n- Per-workspace scoping on the REST client, and cross-org `--agent <uuid>` auto-switches workspace.\n- `skydive-beta` wrapper for the canary channel.\n\n### Fixed\n\n- `skydive update` no longer claims an update is available on every npm install.\n- Chat memory is bounded (payload clamps + windowed rows) with a memory watchdog and OOM diagnostic report; transcript rows are memoized so streaming stops re-rendering the whole chat.\n- Chat-send failures map to real error messages.\n- Notification and sidebar previews use the last text block of the reply and strip inline markdown.\n- Picker rows no longer overlap when a conversation title contains a newline, tab, or control character.\n- Sending to non-web channel conversations is blocked in the TUI.\n- GitHub bot connect opens on the web front door, not api.skydive.com.\n- TUI activity counter times from the run, not the screen.\n\n## [0.2.0] - 2026-07-29\n\n### Added\n\n**Sandbox & machine access**\n\n- Standalone `skydive sandbox` command for direct access to an agent's sandbox.\n- `/sandbox` in the chat TUI — live PTY session and one-shot command execution.\n- Headless machine sharing via `skydive portal`, with self-registering portal grants.\n- `shareMachineDefault` config key for always-on portal sharing.\n\n**Chat TUI**\n\n- File pane (`ctrl+g`) with Changes and Files tabs: a shared file tree plus source viewer and a workspace browser, mouse-resizable and responsive to terminal size.\n- Agent todo list rendered in the chat TUI, above the composer, mirroring the web chat's todo card.\n- Fuzzy finder in the conversation and agent pickers.\n- Slash-command autocomplete menu.\n- Paste or drag-and-drop any file into the composer; paste clipboard images with Cmd+V.\n- Run local shell commands with `!` in the composer.\n- Conversation recaps, streamed live title updates, and per-agent attribution on assistant turns.\n- Working timer rolls up into minutes and hours.\n- Conversation picker paginates past 50 conversations and shows only your own conversations.\n- Esc leaves a live run; typing `exit` quits the chat.\n- Cursor Dark theme.\n- Picker rows no longer overlap when a conversation title contains a newline, tab, or control character.\n\n**Headless & scripting**\n\n- Resume a conversation by id.\n- `conversations list` and `conversations show` for transcript reads.\n- `messages get`, with run recovery keyed on message id.\n- Connect cards surface in headless `-p` mode so a driving agent never gets stuck.\n\n**Authentication**\n\n- `skydive auth login` via the browser now auto-mints an API key, so one login yields both a chat session and a usable management credential. Management commands announce the key's pinned workspace when it drives them, so a workspace mismatch is visible at use time.\n- Workspace picker on the device authorization page.\n- Account and workspace identity shown in `auth status`.\n\n**Platform**\n\n- Standalone binary builds compiling the CLI into a per-target executable.\n- Interactive workspace switcher; management commands follow the active workspace.\n- Terminal host integrations and agent notifications.\n\n### Fixed\n\n- Transcript errors collapse to one line, click to expand (REST and portal errors keep their full body).\n- Dragged/pasted image file paths attach the file instead of inserting path text, including macOS paths with literal parentheses.\n- Bare URLs in chat markdown are hyperlinked so they survive text wrap.\n- Composer draft is preserved across TUI overlays.\n- Relative connect links resolve before opening the browser.\n- Numbered markdown headings render colored in the TUI.\n- Chat transcript pages by 75% of a screen; picker rows stay on one line.\n- Run starts push to the TUI over the conversation stream.\n- Security: remediated high-severity dependency findings and cleared tar/shell-quote CVEs.\n\n## [0.1.0] - 2026-07-21\n\nInitial public release: `skydive chat` TUI, agent and conversation management,\ndevice authorization, and headless `-p` mode.\n";
|
|
4361
4407
|
|
|
4362
4408
|
//#endregion
|
|
4363
4409
|
//#region src/whats-new.ts
|
|
@@ -4500,7 +4546,7 @@ if (process.argv.includes(UPDATE_WORKER_FLAG)) {
|
|
|
4500
4546
|
process.exit(0);
|
|
4501
4547
|
}
|
|
4502
4548
|
if (process.argv.includes(PORTAL_DAEMON_FLAG)) {
|
|
4503
|
-
const { runPortalDaemon } = await import("./daemon-
|
|
4549
|
+
const { runPortalDaemon } = await import("./daemon-Dg89tpOE.mjs");
|
|
4504
4550
|
runPortalDaemon(process.argv);
|
|
4505
4551
|
} else runCli();
|
|
4506
4552
|
function runCli() {
|