skydive-cli 0.4.0-beta.1340 → 0.4.0-beta.1360
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
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
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `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.)
|
|
13
|
+
|
|
10
14
|
## [0.4.0] - 2026-08-07
|
|
11
15
|
|
|
12
16
|
### Added
|
package/dist/js/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as ensureActiveOrganization, D as setActiveWorkspace, E as listWorkspaces, O as name, T as getSessionIdentity, a as installCrashHandler, k as version, t as maybeStartProfiling, u as brandHelpArt, w as getActiveWorkspaceId, x as themes } from "./profiler-
|
|
2
|
+
import { C as ensureActiveOrganization, D as setActiveWorkspace, E as listWorkspaces, O as name, T as getSessionIdentity, a as installCrashHandler, k as version, t as maybeStartProfiling, u as brandHelpArt, w as getActiveWorkspaceId, x as themes } from "./profiler-CHCFyQ51.mjs";
|
|
3
3
|
import { A as getStoredApiKeyWorkspaceName, C as getLastSeenVersion, F as resolveManagementAuth, I as resolveSession, M as resolveAppUrl, N as resolveChatAuth, O as getShareMachineDefault, P as resolveConfig, R as saveConfig, S as getConfigPath, T as getPromptHistoryPath, V as setLastSeenVersion, _ as API_KEY_PREFIX, b as PREFERENCES, g as API_KEY_FAMILY_PREFIX, h as API_KEYS_URL, i as resolveAgent, j as getUpdateCheckDisabled, k as getStoredApiKeyId, v as DEFAULT_API_URL, w as getPreference, x as deleteConfig, z as saveSession } from "./print-CbayCa87.mjs";
|
|
4
4
|
import { n as printError, r as printTable, t as output } from "./output-DYzzdXYV.mjs";
|
|
5
5
|
import { t as HttpError } from "./http-error-DzyrsLAZ.mjs";
|
|
@@ -10,16 +10,17 @@ import { c as PORTAL_DAEMON_FLAG, i as queryDaemonStatus, l as daemonPaths, n as
|
|
|
10
10
|
import { t as SandboxStream } from "./client-Cn2af31H.mjs";
|
|
11
11
|
import { hideBin } from "yargs/helpers";
|
|
12
12
|
import yargs from "yargs";
|
|
13
|
-
import os, { hostname } from "node:os";
|
|
14
|
-
import path from "node:path";
|
|
13
|
+
import os, { hostname, tmpdir } from "node:os";
|
|
14
|
+
import path, { join } from "node:path";
|
|
15
15
|
import { err, ok } from "neverthrow";
|
|
16
16
|
import { z } from "zod";
|
|
17
17
|
import open from "open";
|
|
18
18
|
import fs from "node:fs";
|
|
19
19
|
import { spawn, spawnSync } from "node:child_process";
|
|
20
|
-
import { createHash } from "node:crypto";
|
|
20
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
21
21
|
import zlib from "node:zlib";
|
|
22
|
-
import fsp from "node:fs/promises";
|
|
22
|
+
import fsp, { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
23
|
+
import { quote } from "shell-quote";
|
|
23
24
|
import semver from "semver";
|
|
24
25
|
import { createInterface } from "node:readline";
|
|
25
26
|
|
|
@@ -1515,7 +1516,7 @@ const importCommand = {
|
|
|
1515
1516
|
process.exit(1);
|
|
1516
1517
|
}
|
|
1517
1518
|
}
|
|
1518
|
-
const { runChat } = await import("./boot-
|
|
1519
|
+
const { runChat } = await import("./boot-DwKlGj-L.mjs");
|
|
1519
1520
|
await runChat({
|
|
1520
1521
|
appUrl,
|
|
1521
1522
|
sessionToken: session.value.sessionToken,
|
|
@@ -1927,7 +1928,7 @@ const chatCommand = {
|
|
|
1927
1928
|
sessionToken: auth.value.token,
|
|
1928
1929
|
agentSelector: argv.agent ?? null
|
|
1929
1930
|
});
|
|
1930
|
-
const { runChat } = await import("./boot-
|
|
1931
|
+
const { runChat } = await import("./boot-DwKlGj-L.mjs");
|
|
1931
1932
|
await runChat({
|
|
1932
1933
|
appUrl: auth.value.appUrl,
|
|
1933
1934
|
sessionToken: auth.value.token,
|
|
@@ -2286,7 +2287,7 @@ const switchCommand = {
|
|
|
2286
2287
|
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.");
|
|
2287
2288
|
process.exit(1);
|
|
2288
2289
|
}
|
|
2289
|
-
const { runWorkspacePicker } = await import("./boot-
|
|
2290
|
+
const { runWorkspacePicker } = await import("./boot-DwKlGj-L.mjs");
|
|
2290
2291
|
await runWorkspacePicker(session);
|
|
2291
2292
|
return;
|
|
2292
2293
|
}
|
|
@@ -2600,7 +2601,7 @@ const portalCommand = {
|
|
|
2600
2601
|
//#endregion
|
|
2601
2602
|
//#region src/commands/sandbox.ts
|
|
2602
2603
|
/** POSIX single-quote one word so the remote shell treats it as one token. */
|
|
2603
|
-
function shellQuote(word) {
|
|
2604
|
+
function shellQuote$1(word) {
|
|
2604
2605
|
if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(word)) return word;
|
|
2605
2606
|
return `'${word.replace(/'/g, `'\\''`)}'`;
|
|
2606
2607
|
}
|
|
@@ -2615,7 +2616,7 @@ function shellQuote(word) {
|
|
|
2615
2616
|
* for too. yargs number-coerces bare numerals, so words are stringified.
|
|
2616
2617
|
*/
|
|
2617
2618
|
function joinCommandWords(words) {
|
|
2618
|
-
return words.map(String).map(shellQuote).join(" ").trim();
|
|
2619
|
+
return words.map(String).map(shellQuote$1).join(" ").trim();
|
|
2619
2620
|
}
|
|
2620
2621
|
/**
|
|
2621
2622
|
* `skydive sandbox` — the standalone counterpart to the chat TUI's `/sandbox`
|
|
@@ -2720,6 +2721,275 @@ async function runPty({ session, agentId, agentName }) {
|
|
|
2720
2721
|
return result.code;
|
|
2721
2722
|
}
|
|
2722
2723
|
|
|
2724
|
+
//#endregion
|
|
2725
|
+
//#region src/commands/fs.ts
|
|
2726
|
+
/**
|
|
2727
|
+
* POSIX-quote one word so the remote shell treats it as a single token. Wraps
|
|
2728
|
+
* `shell-quote`'s `quote` (already a repo dependency, used elsewhere in the
|
|
2729
|
+
* CLI) rather than hand-rolling the escaping — it is the well-tested source of
|
|
2730
|
+
* truth for making a path/arg with spaces, quotes, `$`, `;`, globs, etc. inert
|
|
2731
|
+
* when interpolated into an `sh -c` line.
|
|
2732
|
+
*/
|
|
2733
|
+
function shellQuote(word) {
|
|
2734
|
+
return quote([word]);
|
|
2735
|
+
}
|
|
2736
|
+
const MISSING_FILE_EXIT = 44;
|
|
2737
|
+
/**
|
|
2738
|
+
* Build the remote shell command that base64-encodes a file to stdout. Exits
|
|
2739
|
+
* {@link MISSING_FILE_EXIT} when the path doesn't exist, 1 when it's a
|
|
2740
|
+
* directory, so the caller can tell "create new" from a genuine error.
|
|
2741
|
+
*/
|
|
2742
|
+
function buildReadCommand(path) {
|
|
2743
|
+
const q = shellQuote(path);
|
|
2744
|
+
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}`)}`;
|
|
2745
|
+
}
|
|
2746
|
+
/**
|
|
2747
|
+
* Build the remote shell command that decodes `b64` and writes it to `path`
|
|
2748
|
+
* atomically (temp file + `mv`) so a dropped connection can't truncate the
|
|
2749
|
+
* original in place. `token` is a caller-supplied unique suffix for the temp
|
|
2750
|
+
* file — generated in JS (not the shell's `$$`, which shell-quote would escape
|
|
2751
|
+
* to a literal, so every write would collide on the same temp name).
|
|
2752
|
+
*/
|
|
2753
|
+
function buildWriteCommand(path, b64, token) {
|
|
2754
|
+
const tmp = `${path}.skydive-edit.${token}`;
|
|
2755
|
+
return `sh -c ${shellQuote(`printf %s ${shellQuote(b64)} | base64 -d > ${shellQuote(tmp)} && mv -f ${shellQuote(tmp)} ${shellQuote(path)}`)}`;
|
|
2756
|
+
}
|
|
2757
|
+
/**
|
|
2758
|
+
* Resolve the editor command from an explicit override, then $VISUAL, $EDITOR,
|
|
2759
|
+
* then `vi`. Split so `EDITOR="code --wait"` (command + flags) is honored.
|
|
2760
|
+
*/
|
|
2761
|
+
function resolveEditor(override, env) {
|
|
2762
|
+
const parts = (override || env.VISUAL || env.EDITOR || "vi").split(/\s+/).filter(Boolean);
|
|
2763
|
+
return {
|
|
2764
|
+
bin: parts[0] ?? "vi",
|
|
2765
|
+
args: parts.slice(1)
|
|
2766
|
+
};
|
|
2767
|
+
}
|
|
2768
|
+
/**
|
|
2769
|
+
* `skydive fs edit <path>` — edit a file that lives on the agent's computer
|
|
2770
|
+
* (its sandbox) with your LOCAL editor. It reads the remote file down over the
|
|
2771
|
+
* same relay `skydive sandbox` uses, opens it in `$EDITOR`, and writes your
|
|
2772
|
+
* changes back when you save and close — so you edit a remote file as if it
|
|
2773
|
+
* were local, without opening the chat TUI.
|
|
2774
|
+
*
|
|
2775
|
+
* There is no server-side "file" endpoint yet: this rides entirely on the
|
|
2776
|
+
* existing one-shot `exec` mode of the sandbox stream. Contents move
|
|
2777
|
+
* base64-encoded in BOTH directions (exec has no stdin, so the write payload is
|
|
2778
|
+
* embedded in the command string) which keeps binary bytes, trailing newlines,
|
|
2779
|
+
* and CRLF intact. Access gating (EDIT on the agent + the sandbox kill switch)
|
|
2780
|
+
* is enforced by the relay, exactly as for `skydive sandbox`. A future PR adds
|
|
2781
|
+
* a first-class `fs` channel that `edit` (and `fs mount`) will ride instead.
|
|
2782
|
+
*/
|
|
2783
|
+
const fsEditCommand = {
|
|
2784
|
+
command: "edit <path>",
|
|
2785
|
+
describe: "Edit a file on the agent's computer (its sandbox) with your local $EDITOR",
|
|
2786
|
+
builder: (y) => y.positional("path", {
|
|
2787
|
+
type: "string",
|
|
2788
|
+
demandOption: true,
|
|
2789
|
+
describe: "Absolute or sandbox-relative path of the file to edit"
|
|
2790
|
+
}).option("agent", {
|
|
2791
|
+
type: "string",
|
|
2792
|
+
describe: "Target agent, by id, slug, or name. Optional when the account has exactly one agent."
|
|
2793
|
+
}).option("editor", {
|
|
2794
|
+
type: "string",
|
|
2795
|
+
describe: "Editor command to open (defaults to $VISUAL, then $EDITOR, then vi)"
|
|
2796
|
+
}).example("skydive fs edit --agent grace /tmp/notes.md", "Edit a remote file").example("EDITOR=nano skydive fs edit /home/user/.self/soul.md", "Pick the editor via $EDITOR"),
|
|
2797
|
+
handler: async (argv) => {
|
|
2798
|
+
const session = requireSession(argv);
|
|
2799
|
+
const remotePath = argv.path;
|
|
2800
|
+
const { createRestClient } = await import("./rest-DADJh0bi.mjs");
|
|
2801
|
+
const { resolveAgent } = await import("./print-ba_0hiV9.mjs");
|
|
2802
|
+
const client = createRestClient({
|
|
2803
|
+
appUrl: session.appUrl,
|
|
2804
|
+
sessionToken: session.sessionToken
|
|
2805
|
+
});
|
|
2806
|
+
let agent;
|
|
2807
|
+
try {
|
|
2808
|
+
agent = resolveAgent(await client.listAgents({
|
|
2809
|
+
scope: "org",
|
|
2810
|
+
onPage: null
|
|
2811
|
+
}), argv.agent ?? null);
|
|
2812
|
+
} catch (error) {
|
|
2813
|
+
printError(error instanceof Error ? error.message : String(error));
|
|
2814
|
+
process.exit(1);
|
|
2815
|
+
}
|
|
2816
|
+
const opts = {
|
|
2817
|
+
session,
|
|
2818
|
+
agentId: agent.id
|
|
2819
|
+
};
|
|
2820
|
+
console.error(`Reading ${remotePath} from ${agent.name}'s sandbox…`);
|
|
2821
|
+
const read = await readRemote({
|
|
2822
|
+
...opts,
|
|
2823
|
+
path: remotePath
|
|
2824
|
+
});
|
|
2825
|
+
if (read.kind === "error") {
|
|
2826
|
+
printError(read.message);
|
|
2827
|
+
process.exit(1);
|
|
2828
|
+
}
|
|
2829
|
+
const original = read.content;
|
|
2830
|
+
if (read.kind === "missing") console.error(`${remotePath} does not exist yet — it will be created when you save.`);
|
|
2831
|
+
const dir = await mkdtemp(join(tmpdir(), "skydive-edit-"));
|
|
2832
|
+
const local = join(dir, remotePath.split("/").pop() || "file");
|
|
2833
|
+
try {
|
|
2834
|
+
await writeFile(local, original);
|
|
2835
|
+
if (!await openEditor(argv.editor, local)) {
|
|
2836
|
+
printError("Editor exited non-zero; not saving any changes.");
|
|
2837
|
+
process.exit(1);
|
|
2838
|
+
}
|
|
2839
|
+
const edited = await readFile(local);
|
|
2840
|
+
if (edited.equals(original)) {
|
|
2841
|
+
console.error("No changes — nothing written.");
|
|
2842
|
+
process.exit(0);
|
|
2843
|
+
}
|
|
2844
|
+
console.error(`Writing changes back to ${remotePath}…`);
|
|
2845
|
+
const wrote = await writeRemote({
|
|
2846
|
+
...opts,
|
|
2847
|
+
path: remotePath,
|
|
2848
|
+
content: edited
|
|
2849
|
+
});
|
|
2850
|
+
if (wrote.kind === "error") {
|
|
2851
|
+
printError(`${wrote.message}\nYour edited copy is kept at ${local} so you don't lose it.`);
|
|
2852
|
+
process.exit(1);
|
|
2853
|
+
}
|
|
2854
|
+
console.error("Saved.");
|
|
2855
|
+
process.exit(0);
|
|
2856
|
+
} finally {
|
|
2857
|
+
await rm(dir, {
|
|
2858
|
+
recursive: true,
|
|
2859
|
+
force: true
|
|
2860
|
+
}).catch((error) => {
|
|
2861
|
+
console.error(`Note: could not remove temp dir ${dir}: ${error instanceof Error ? error.message : String(error)}`);
|
|
2862
|
+
});
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2865
|
+
};
|
|
2866
|
+
/**
|
|
2867
|
+
* Read a remote file as bytes. Runs `base64` on the file in the sandbox and
|
|
2868
|
+
* decodes the streamed stdout locally. Distinguishes "file is missing" (exit
|
|
2869
|
+
* code 44, so `edit` can create it) from a real read failure.
|
|
2870
|
+
*/
|
|
2871
|
+
function readRemote({ session, agentId, path }) {
|
|
2872
|
+
const command = buildReadCommand(path);
|
|
2873
|
+
const chunks = [];
|
|
2874
|
+
const stderr = [];
|
|
2875
|
+
return new Promise((resolve) => {
|
|
2876
|
+
SandboxStream.open({
|
|
2877
|
+
mode: "exec",
|
|
2878
|
+
appUrl: session.appUrl,
|
|
2879
|
+
sessionToken: session.sessionToken,
|
|
2880
|
+
agentId,
|
|
2881
|
+
command,
|
|
2882
|
+
onEvent: (e) => {
|
|
2883
|
+
switch (e.type) {
|
|
2884
|
+
case "data":
|
|
2885
|
+
chunks.push(Buffer.from(e.bytes));
|
|
2886
|
+
break;
|
|
2887
|
+
case "exit":
|
|
2888
|
+
if (e.code === MISSING_FILE_EXIT) resolve({
|
|
2889
|
+
kind: "missing",
|
|
2890
|
+
content: Buffer.alloc(0)
|
|
2891
|
+
});
|
|
2892
|
+
else if (e.code === 0) resolve({
|
|
2893
|
+
kind: "ok",
|
|
2894
|
+
content: Buffer.from(Buffer.concat(chunks).toString("utf8").replace(/\s+/g, ""), "base64")
|
|
2895
|
+
});
|
|
2896
|
+
else resolve({
|
|
2897
|
+
kind: "error",
|
|
2898
|
+
message: stderr.join("").trim() || `Could not read the file (exit ${e.code}).`
|
|
2899
|
+
});
|
|
2900
|
+
break;
|
|
2901
|
+
case "error":
|
|
2902
|
+
stderr.push(e.message);
|
|
2903
|
+
break;
|
|
2904
|
+
case "close":
|
|
2905
|
+
resolve({
|
|
2906
|
+
kind: "error",
|
|
2907
|
+
message: e.failure || "The connection to the sandbox closed before the file could be read."
|
|
2908
|
+
});
|
|
2909
|
+
break;
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2912
|
+
});
|
|
2913
|
+
});
|
|
2914
|
+
}
|
|
2915
|
+
/**
|
|
2916
|
+
* Write bytes to a remote file. Exec has no stdin, so the base64 payload is
|
|
2917
|
+
* embedded in the command and decoded on the far side. Writes atomically via a
|
|
2918
|
+
* temp file + `mv` so a dropped connection mid-write can't leave a truncated
|
|
2919
|
+
* file in place of the original.
|
|
2920
|
+
*/
|
|
2921
|
+
function writeRemote({ session, agentId, path, content }) {
|
|
2922
|
+
const token = randomBytes(6).toString("hex");
|
|
2923
|
+
const command = buildWriteCommand(path, content.toString("base64"), token);
|
|
2924
|
+
const stderr = [];
|
|
2925
|
+
return new Promise((resolve) => {
|
|
2926
|
+
SandboxStream.open({
|
|
2927
|
+
mode: "exec",
|
|
2928
|
+
appUrl: session.appUrl,
|
|
2929
|
+
sessionToken: session.sessionToken,
|
|
2930
|
+
agentId,
|
|
2931
|
+
command,
|
|
2932
|
+
onEvent: (e) => {
|
|
2933
|
+
switch (e.type) {
|
|
2934
|
+
case "data":
|
|
2935
|
+
stderr.push(Buffer.from(e.bytes).toString("utf8"));
|
|
2936
|
+
break;
|
|
2937
|
+
case "exit":
|
|
2938
|
+
resolve(e.code === 0 ? { kind: "ok" } : {
|
|
2939
|
+
kind: "error",
|
|
2940
|
+
message: stderr.join("").trim() || `Could not write the file (exit ${e.code}).`
|
|
2941
|
+
});
|
|
2942
|
+
break;
|
|
2943
|
+
case "error":
|
|
2944
|
+
stderr.push(e.message);
|
|
2945
|
+
break;
|
|
2946
|
+
case "close":
|
|
2947
|
+
resolve({
|
|
2948
|
+
kind: "error",
|
|
2949
|
+
message: e.failure || "The connection to the sandbox closed before the file was written."
|
|
2950
|
+
});
|
|
2951
|
+
break;
|
|
2952
|
+
}
|
|
2953
|
+
}
|
|
2954
|
+
});
|
|
2955
|
+
});
|
|
2956
|
+
}
|
|
2957
|
+
/**
|
|
2958
|
+
* Open `file` in the caller's editor and resolve to whether it exited cleanly.
|
|
2959
|
+
* Precedence: explicit `--editor`, then $VISUAL, $EDITOR, then `vi`. The editor
|
|
2960
|
+
* inherits the real TTY so full-screen editors (vim/nano) work.
|
|
2961
|
+
*/
|
|
2962
|
+
function openEditor(override, file) {
|
|
2963
|
+
const { bin, args: editorArgs } = resolveEditor(override, process.env);
|
|
2964
|
+
const args = [...editorArgs, file];
|
|
2965
|
+
return new Promise((resolve) => {
|
|
2966
|
+
const child = spawn(bin, args, { stdio: "inherit" });
|
|
2967
|
+
child.on("error", (err) => {
|
|
2968
|
+
printError(`Could not launch editor "${bin}": ${err.message}`);
|
|
2969
|
+
resolve(false);
|
|
2970
|
+
});
|
|
2971
|
+
child.on("exit", (code) => resolve(code === 0));
|
|
2972
|
+
});
|
|
2973
|
+
}
|
|
2974
|
+
/**
|
|
2975
|
+
* `skydive fs` — work with the files on an agent's computer (its sandbox) from
|
|
2976
|
+
* your own machine. The namespace for filesystem access:
|
|
2977
|
+
*
|
|
2978
|
+
* - `fs edit <path>` edit one remote file with your local editor (shipped).
|
|
2979
|
+
* - `fs mount <dir>` mount the whole sandbox filesystem locally (coming in a
|
|
2980
|
+
* later PR, on a first-class `fs` relay channel).
|
|
2981
|
+
*
|
|
2982
|
+
* Grouping these under one command keeps the file surface discoverable and
|
|
2983
|
+
* leaves room to grow (`fs ls`, `fs cat`, `fs pull`) without adding more
|
|
2984
|
+
* top-level commands.
|
|
2985
|
+
*/
|
|
2986
|
+
const fsCommand = {
|
|
2987
|
+
command: "fs <command>",
|
|
2988
|
+
describe: "Work with the files on an agent's computer (its sandbox)",
|
|
2989
|
+
builder: (y) => y.command(fsEditCommand).demandCommand(1, "Specify a subcommand: edit"),
|
|
2990
|
+
handler: () => {}
|
|
2991
|
+
};
|
|
2992
|
+
|
|
2723
2993
|
//#endregion
|
|
2724
2994
|
//#region src/update-check/manifest.ts
|
|
2725
2995
|
/**
|
|
@@ -3528,7 +3798,7 @@ const configCommand = {
|
|
|
3528
3798
|
//#endregion
|
|
3529
3799
|
//#region src/cli.ts
|
|
3530
3800
|
function createCli(argv) {
|
|
3531
|
-
return yargs(argv).scriptName("skydive").usage("$0 <command> [options]").parserConfiguration({ "populate--": true }).example("skydive auth login", "Store your API key").example("skydive chat", "Open the interactive chat TUI (prod)").example("skydive chat --api-url http://localhost:4500", "Chat against a local dev API").example("skydive agents list", "List your agents").example("skydive completion install", "Set up TAB completion for your shell").example("skydive keys create \"my-key\"", "Create an API key").example("skydive secrets set OPENAI_API_KEY --agent-id <id>", "Set a secret (value from stdin)").example("skydive workspace list", "List workspaces on your account").example("skydive config set updateCheck false", "Disable the daily update check").example("skydive workspace switch acme-team", "Switch the workspace all `skydive` commands act on").example("skydive portal open --agent grace", "Open the portal to this machine for an agent, headless (no TUI)").option("json", {
|
|
3801
|
+
return yargs(argv).scriptName("skydive").usage("$0 <command> [options]").parserConfiguration({ "populate--": true }).example("skydive auth login", "Store your API key").example("skydive chat", "Open the interactive chat TUI (prod)").example("skydive chat --api-url http://localhost:4500", "Chat against a local dev API").example("skydive agents list", "List your agents").example("skydive completion install", "Set up TAB completion for your shell").example("skydive keys create \"my-key\"", "Create an API key").example("skydive secrets set OPENAI_API_KEY --agent-id <id>", "Set a secret (value from stdin)").example("skydive workspace list", "List workspaces on your account").example("skydive config set updateCheck false", "Disable the daily update check").example("skydive workspace switch acme-team", "Switch the workspace all `skydive` commands act on").example("skydive portal open --agent grace", "Open the portal to this machine for an agent, headless (no TUI)").example("skydive fs edit --agent grace /tmp/notes.md", "Edit a file on the agent's computer with your local editor").option("json", {
|
|
3532
3802
|
type: "boolean",
|
|
3533
3803
|
default: false,
|
|
3534
3804
|
global: true,
|
|
@@ -3542,7 +3812,7 @@ function createCli(argv) {
|
|
|
3542
3812
|
type: "string",
|
|
3543
3813
|
global: true,
|
|
3544
3814
|
describe: "Override API base URL"
|
|
3545
|
-
}).command(authCommand).command(chatCommand).command(messagesCommand).command(conversationsCommand).command(agentsCommand).command(importCommand).command(keysCommand).command(secretsCommand).command(workspaceCommand).command(portalCommand).command(sandboxCommand).command(updateCommand).command(configCommand).command(completionCommand).demandCommand(1, "Specify a command. Run --help for usage.").strict().wrap(null).version(version).alias("v", "version").alias("h", "help").help().fail((msg, err) => {
|
|
3815
|
+
}).command(authCommand).command(chatCommand).command(messagesCommand).command(conversationsCommand).command(agentsCommand).command(importCommand).command(keysCommand).command(secretsCommand).command(workspaceCommand).command(portalCommand).command(sandboxCommand).command(fsCommand).command(updateCommand).command(configCommand).command(completionCommand).demandCommand(1, "Specify a command. Run --help for usage.").strict().wrap(null).version(version).alias("v", "version").alias("h", "help").help().fail((msg, err) => {
|
|
3546
3816
|
printError(err ? err instanceof Error ? err.message : String(err) : msg ?? "Unknown error");
|
|
3547
3817
|
process.exit(1);
|
|
3548
3818
|
});
|
|
@@ -3755,7 +4025,7 @@ function setupUpdateCheck(argv) {
|
|
|
3755
4025
|
|
|
3756
4026
|
//#endregion
|
|
3757
4027
|
//#region src/changelog.generated.ts
|
|
3758
|
-
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## [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";
|
|
4028
|
+
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- `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";
|
|
3759
4029
|
|
|
3760
4030
|
//#endregion
|
|
3761
4031
|
//#region src/whats-new.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { D as setActiveWorkspace, E as listWorkspaces, S as themesForMode, _ as themeForMode, a as installCrashHandler, b as themeVersion, c as MARK_CELLS, d as DEFAULT_THEME_ID, f as applyTheme, g as theme, h as noColorRequested, i as writeArtifact, l as WORDMARK, m as monoTheme, n as profilingEnabled, o as buildCrashReport, p as findTheme, r as record, s as writeCrashReport, v as themeMode, w as getActiveWorkspaceId, y as themeModeFromColorFgBg } from "./profiler-
|
|
2
|
+
import { D as setActiveWorkspace, E as listWorkspaces, S as themesForMode, _ as themeForMode, a as installCrashHandler, b as themeVersion, c as MARK_CELLS, d as DEFAULT_THEME_ID, f as applyTheme, g as theme, h as noColorRequested, i as writeArtifact, l as WORDMARK, m as monoTheme, n as profilingEnabled, o as buildCrashReport, p as findTheme, r as record, s as writeCrashReport, v as themeMode, w as getActiveWorkspaceId, y as themeModeFromColorFgBg } from "./profiler-CHCFyQ51.mjs";
|
|
3
3
|
import { B as saveTheme, D as getSavedTheme, E as getReviewStateDir, L as resolveWebUrl, S as getConfigPath, c as cardActionErrorMessage, d as reconcileMaskedInput, f as resolveConnectUrl, i as resolveAgent, l as parseExternalOauthConnectParams, m as specKeyFor, p as parseConnectCard, s as MASK_CHAR, u as parseOauthConnectParams, v as DEFAULT_API_URL, y as DEFAULT_APP_URL } from "./print-CbayCa87.mjs";
|
|
4
4
|
import { t as HttpError } from "./http-error-DzyrsLAZ.mjs";
|
|
5
5
|
import { a as isRecord, i as errorMessage, n as errorDetail, r as sendErrorMessage, t as createRestClient } from "./rest-BY2nADw5.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skydive-cli",
|
|
3
|
-
"version": "0.4.0-beta.
|
|
3
|
+
"version": "0.4.0-beta.1360",
|
|
4
4
|
"description": "Skydive CLI — cloud agents from the command line",
|
|
5
5
|
"homepage": "https://skydive.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"react-devtools-core": "^7.0.1",
|
|
42
42
|
"safe-stable-stringify": "^2.3.1",
|
|
43
43
|
"semver": "^7.7.4",
|
|
44
|
+
"shell-quote": "1.9.0",
|
|
44
45
|
"web-tree-sitter": "0.25.10",
|
|
45
46
|
"ws": "^8.21.0",
|
|
46
47
|
"yargs": "^17.7.2",
|