skydive-cli 0.6.0-beta.48 → 0.6.0-beta.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/js/bin.mjs +543 -70
- package/dist/js/{boot-CgKBdegB.mjs → boot-oH6ZHYdH.mjs} +390 -63
- package/dist/js/{client-CFnT0cAy.mjs → client-CAX6sE_Y.mjs} +1 -1
- package/dist/js/{client-jTc5DmAj.mjs → client-CnvxmYZ6.mjs} +1 -1
- package/dist/js/{client-DzD76Qd7.mjs → client-CwrwJrXX.mjs} +2 -1
- package/dist/js/{daemon-DcACMRe7.mjs → daemon-Dr2kCY9V.mjs} +2 -2
- package/dist/js/{daemon-D7hURPaU.mjs → daemon-DyzekuZq.mjs} +55 -15
- package/dist/js/{daemon-client-GaxCwNSy.mjs → daemon-client-BYB_2WYU.mjs} +1 -1
- package/dist/js/daemon-client-BpkvG_0G.mjs +8 -0
- package/dist/js/{install-CBFdOTjb.mjs → install-aadv_dwX.mjs} +49 -3
- package/dist/js/{print-2hTs7Wb6.mjs → print-BbRVB3lw.mjs} +2 -2
- package/dist/js/{print-B38Wx3CM.mjs → print-CDDNlUPH.mjs} +2 -2
- package/dist/js/{print-share-R1p66Gev.mjs → print-share-BZCjBNpt.mjs} +1 -1
- package/dist/js/raw-pty-BF3tEnca.mjs +5 -0
- package/dist/js/{raw-pty-Cj-O0pyb.mjs → raw-pty-BcZNOOGh.mjs} +1 -1
- package/dist/js/{rest-BUR9emV8.mjs → rest-CnpAZq0e.mjs} +1 -1
- package/dist/js/{rest-UJz2FS1U.mjs → rest-DdTf06cT.mjs} +36 -2
- package/package.json +8 -7
- package/dist/js/daemon-client-JTG8fkSV.mjs +0 -8
- package/dist/js/raw-pty-HlNGqFLC.mjs +0 -5
package/dist/js/bin.mjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as version, s as name, t as createRestClient } from "./rest-
|
|
3
|
-
import { A as getPreference, B as resolveChatAuth, C as DEFAULT_API_URL, D as getConfigPath, E as deleteConfig, F as getStoredApiKeyId, G as saveConfig, H as resolveManagementAuth, I as getStoredApiKeyWorkspaceName, J as setLastSeenVersion, K as saveSession, L as getUpdateCheckDisabled, O as getDefaultAgent, P as getShareMachineDefault, S as API_KEY_PREFIX, T as PREFERENCES, U as resolveSession$1, V as resolveConfig, b as API_KEYS_URL, i as resolveAgent$1, j as getPromptHistoryPath, k as getLastSeenVersion, x as API_KEY_FAMILY_PREFIX, z as resolveAppUrl } from "./print-
|
|
4
|
-
import { A as
|
|
2
|
+
import { c as version, s as name, t as createRestClient } from "./rest-DdTf06cT.mjs";
|
|
3
|
+
import { A as getPreference, B as resolveChatAuth, C as DEFAULT_API_URL, D as getConfigPath, E as deleteConfig, F as getStoredApiKeyId, G as saveConfig, H as resolveManagementAuth, I as getStoredApiKeyWorkspaceName, J as setLastSeenVersion, K as saveSession, L as getUpdateCheckDisabled, O as getDefaultAgent, P as getShareMachineDefault, S as API_KEY_PREFIX, T as PREFERENCES, U as resolveSession$1, V as resolveConfig, b as API_KEYS_URL, i as resolveAgent$1, j as getPromptHistoryPath, k as getLastSeenVersion, x as API_KEY_FAMILY_PREFIX, z as resolveAppUrl } from "./print-CDDNlUPH.mjs";
|
|
4
|
+
import { A as aliasActivationHint, B as getSessionIdentity, E as themes, F as SUPPORTED_SHELLS, H as resolveWorkspaceId, I as defaultInstallEnv, L as detectShell, M as installAgentAlias, N as slugifyAliasName, O as buildImportSeedPrompt, P as takenAliasNames, R as ensureActiveOrganization, U as setActiveWorkspace, V as listWorkspaces, c as brandHelpArt, d as maybeStartProfiling, f as profileDir, j as dedupeAliasName, k as machineOsFromPlatform, t as installCrashHandler, u as getAutomaticLogsDir, z as getActiveWorkspaceId } from "./install-aadv_dwX.mjs";
|
|
5
5
|
import { n as printError, r as printTable, t as output } from "./output-C9mb3sUB.mjs";
|
|
6
6
|
import { t as HttpError } from "./http-error-BF2NZZE3.mjs";
|
|
7
7
|
import "./billing-blocked-D3l5kJlX.mjs";
|
|
8
|
-
import { s as resolveMachineIdentity } from "./client-
|
|
8
|
+
import { s as resolveMachineIdentity } from "./client-CwrwJrXX.mjs";
|
|
9
9
|
import "./tls-cert-Rua2oV7n.mjs";
|
|
10
10
|
import { i as grantPortalAccess, n as fetchPortalDevices, o as registerPortalDevice, r as findThisDevice, s as revokePortalAccess } from "./api-BFQ4PQDA.mjs";
|
|
11
|
-
import { d as daemonPaths, i as queryDaemonStatus, n as ensureDaemonRunning, s as stopDaemon, u as PORTAL_DAEMON_FLAG } from "./daemon-
|
|
12
|
-
import { a as
|
|
11
|
+
import { d as daemonPaths, i as queryDaemonStatus, n as ensureDaemonRunning, s as stopDaemon, u as PORTAL_DAEMON_FLAG } from "./daemon-DyzekuZq.mjs";
|
|
12
|
+
import { a as decodeFsResponse, i as FS_MAX_BLOB_BYTES, n as SANDBOX_STREAM_PATH, o as encodeFsRequest, r as streamSpecToQuery, t as SandboxStream } from "./client-CAX6sE_Y.mjs";
|
|
13
13
|
import { hideBin } from "yargs/helpers";
|
|
14
14
|
import yargs from "yargs";
|
|
15
15
|
import { hostname, tmpdir } from "node:os";
|
|
16
16
|
import path, { join } from "node:path";
|
|
17
17
|
import { err, ok } from "neverthrow";
|
|
18
|
+
import fsp, { mkdtemp, open, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
18
19
|
import { z } from "zod";
|
|
19
|
-
import open from "open";
|
|
20
|
+
import open$1 from "open";
|
|
20
21
|
import fs from "node:fs";
|
|
21
22
|
import { spawn, spawnSync } from "node:child_process";
|
|
22
23
|
import { createHash } from "node:crypto";
|
|
23
24
|
import zlib from "node:zlib";
|
|
24
|
-
import fsp, { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
25
25
|
import { WebSocket } from "ws";
|
|
26
26
|
import semver from "semver";
|
|
27
27
|
import { createInterface } from "node:readline";
|
|
@@ -88,6 +88,30 @@ const ListedGitTokenSchema = z.object({
|
|
|
88
88
|
});
|
|
89
89
|
const ListGitTokensResponseSchema = z.object({ tokens: z.array(ListedGitTokenSchema) });
|
|
90
90
|
const SetSecretResponseSchema = z.object({ key: z.string() });
|
|
91
|
+
const AvatarPresignResponseSchema = z.object({
|
|
92
|
+
uploadUrl: z.string(),
|
|
93
|
+
ttlSeconds: z.number()
|
|
94
|
+
});
|
|
95
|
+
const AvatarCommitResponseSchema = z.object({ avatarUrl: z.string() });
|
|
96
|
+
/** Same cap the server enforces at avatar commit; enforced client-side too so
|
|
97
|
+
* oversized files fail before the presign/PUT round-trip. */
|
|
98
|
+
const MAX_AGENT_AVATAR_BYTES = 5 * 1024 * 1024;
|
|
99
|
+
/**
|
|
100
|
+
* Sniff an agent-avatar media type from file magic bytes. Kept in sync with
|
|
101
|
+
* the api's commit sniff — `apps/anyone/api/src/lib/agent-avatar.ts`
|
|
102
|
+
* `sniffAvatarMediaType` — so the declared type always matches what the
|
|
103
|
+
* server accepts; the CLI deliberately has no @createinc/anyone-* deps (and
|
|
104
|
+
* no barrel imports, see the CLI bundle rules), so this stays a local copy.
|
|
105
|
+
* If you add a type here, add it there too or the server 415s at commit.
|
|
106
|
+
* null means the file is not an avatar-acceptable raster and the server
|
|
107
|
+
* would reject it.
|
|
108
|
+
*/
|
|
109
|
+
function sniffAgentAvatarMediaType(bytes) {
|
|
110
|
+
if (bytes.byteLength >= 8 && bytes[0] === 137 && bytes[1] === 80 && bytes[2] === 78 && bytes[3] === 71) return "image/png";
|
|
111
|
+
if (bytes.byteLength >= 3 && bytes[0] === 255 && bytes[1] === 216 && bytes[2] === 255) return "image/jpeg";
|
|
112
|
+
if (bytes.byteLength >= 12 && bytes[0] === 82 && bytes[1] === 73 && bytes[2] === 70 && bytes[3] === 70 && bytes[8] === 87 && bytes[9] === 69 && bytes[10] === 66 && bytes[11] === 80) return "image/webp";
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
91
115
|
var SkydiveApiClient = class {
|
|
92
116
|
baseUrl;
|
|
93
117
|
token;
|
|
@@ -198,6 +222,78 @@ var SkydiveApiClient = class {
|
|
|
198
222
|
path: `/agents/${encodeURIComponent(agentId)}/git-tokens/${encodeURIComponent(tokenId)}`
|
|
199
223
|
});
|
|
200
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Set an agent's avatar photo, driving the server's presigned-PUT flow end
|
|
227
|
+
* to end: read the local file, sniff its raster type, presign, PUT the bytes
|
|
228
|
+
* straight to storage, then commit. Returns the versioned avatar URL the
|
|
229
|
+
* server stored.
|
|
230
|
+
*/
|
|
231
|
+
async setAgentAvatar(params) {
|
|
232
|
+
const prefix = Buffer.alloc(16);
|
|
233
|
+
let sniffBytes;
|
|
234
|
+
try {
|
|
235
|
+
const handle = await open(params.filePath, "r");
|
|
236
|
+
try {
|
|
237
|
+
const { bytesRead } = await handle.read(prefix, 0, prefix.byteLength, 0);
|
|
238
|
+
sniffBytes = prefix.subarray(0, bytesRead);
|
|
239
|
+
} finally {
|
|
240
|
+
await handle.close();
|
|
241
|
+
}
|
|
242
|
+
} catch (e) {
|
|
243
|
+
return err({
|
|
244
|
+
message: `Cannot read ${params.filePath}: ${e instanceof Error ? e.message : String(e)}`,
|
|
245
|
+
status: null
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
const mediaType = sniffAgentAvatarMediaType(sniffBytes);
|
|
249
|
+
if (!mediaType) return err({
|
|
250
|
+
message: "Not an avatar the server accepts: it must be a PNG, JPEG, or WebP image.",
|
|
251
|
+
status: null
|
|
252
|
+
});
|
|
253
|
+
let bytes;
|
|
254
|
+
try {
|
|
255
|
+
bytes = await readFile(params.filePath);
|
|
256
|
+
} catch (e) {
|
|
257
|
+
return err({
|
|
258
|
+
message: `Cannot read ${params.filePath}: ${e instanceof Error ? e.message : String(e)}`,
|
|
259
|
+
status: null
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
if (bytes.byteLength > MAX_AGENT_AVATAR_BYTES) return err({
|
|
263
|
+
message: "image exceeds 5 MB",
|
|
264
|
+
status: null
|
|
265
|
+
});
|
|
266
|
+
const presign = await this.request({
|
|
267
|
+
method: "POST",
|
|
268
|
+
path: `/agents/${encodeURIComponent(params.agentId)}/avatar/presign`,
|
|
269
|
+
body: { mediaType },
|
|
270
|
+
schema: AvatarPresignResponseSchema
|
|
271
|
+
});
|
|
272
|
+
if (presign.isErr()) return err(presign.error);
|
|
273
|
+
const put = await fetch(presign.value.uploadUrl, {
|
|
274
|
+
method: "PUT",
|
|
275
|
+
headers: { "content-type": mediaType },
|
|
276
|
+
body: new Uint8Array(bytes)
|
|
277
|
+
});
|
|
278
|
+
if (!put.ok) return err({
|
|
279
|
+
message: `Avatar upload failed: HTTP ${put.status}`,
|
|
280
|
+
status: put.status
|
|
281
|
+
});
|
|
282
|
+
return this.request({
|
|
283
|
+
method: "POST",
|
|
284
|
+
path: `/agents/${encodeURIComponent(params.agentId)}/avatar`,
|
|
285
|
+
body: { mediaType },
|
|
286
|
+
schema: AvatarCommitResponseSchema
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
/** Remove an agent's uploaded avatar photo; the generated preset takes
|
|
290
|
+
* over. Idempotent server-side — removing an agent with no photo succeeds. */
|
|
291
|
+
async deleteAgentAvatar(agentId) {
|
|
292
|
+
return this.request({
|
|
293
|
+
method: "DELETE",
|
|
294
|
+
path: `/agents/${encodeURIComponent(agentId)}/avatar`
|
|
295
|
+
});
|
|
296
|
+
}
|
|
201
297
|
async request(params) {
|
|
202
298
|
const url = `${this.baseUrl}${params.path}`;
|
|
203
299
|
const headers = {
|
|
@@ -382,7 +478,7 @@ async function loginWithDevice({ appUrl, openBrowser = true }) {
|
|
|
382
478
|
const verificationUrl = code.verification_uri_complete ?? code.verification_uri;
|
|
383
479
|
process.stderr.write(`\nTo sign in, open:\n ${verificationUrl}\n`);
|
|
384
480
|
process.stderr.write(`and enter the code: ${formatUserCode(code.user_code)}\n\n`);
|
|
385
|
-
if (openBrowser) await open(verificationUrl).catch(() => void 0);
|
|
481
|
+
if (openBrowser) await open$1(verificationUrl).catch(() => void 0);
|
|
386
482
|
process.stderr.write("Waiting for approval…\n");
|
|
387
483
|
let intervalMs = (code.interval ?? 5) * 1e3 || DEFAULT_INTERVAL_MS;
|
|
388
484
|
const expiresAt = Date.now() + code.expires_in * 1e3;
|
|
@@ -1080,7 +1176,7 @@ async function resolveTargetAgentId(client, selector) {
|
|
|
1080
1176
|
printError("Missing --agent <id or name>. Run `skydive agents list` for candidates.");
|
|
1081
1177
|
process.exit(1);
|
|
1082
1178
|
}
|
|
1083
|
-
const { resolveAgent } = await import("./print-
|
|
1179
|
+
const { resolveAgent } = await import("./print-BbRVB3lw.mjs");
|
|
1084
1180
|
const result = await client.listAgents({
|
|
1085
1181
|
scope: "org",
|
|
1086
1182
|
limit: 100
|
|
@@ -1304,7 +1400,7 @@ async function resolveAgent(client, selector) {
|
|
|
1304
1400
|
if (matches.length === 0) throw new Error(`No agent named "${selector}". Pass an id, or run \`skydive agents list\`.`);
|
|
1305
1401
|
throw new Error(`Multiple agents named "${selector}". Pass the id instead:\n${matches.map((a) => ` ${a.name} ${a.id}`).join("\n")}`);
|
|
1306
1402
|
}
|
|
1307
|
-
const listCommand$
|
|
1403
|
+
const listCommand$7 = {
|
|
1308
1404
|
command: "list",
|
|
1309
1405
|
describe: "List agents in the active workspace",
|
|
1310
1406
|
builder: (y) => y.option("limit", {
|
|
@@ -1525,10 +1621,76 @@ const aliasCommand = {
|
|
|
1525
1621
|
console.log(aliasActivationHint(result));
|
|
1526
1622
|
}
|
|
1527
1623
|
};
|
|
1624
|
+
const avatarSetCommand = {
|
|
1625
|
+
command: "set <agent>",
|
|
1626
|
+
describe: "Set an agent's avatar photo (PNG, JPEG, or WebP, max 5 MB)",
|
|
1627
|
+
builder: (y) => y.positional("agent", {
|
|
1628
|
+
type: "string",
|
|
1629
|
+
demandOption: true,
|
|
1630
|
+
describe: "Agent id or name to set the avatar on"
|
|
1631
|
+
}).option("file", {
|
|
1632
|
+
type: "string",
|
|
1633
|
+
demandOption: true,
|
|
1634
|
+
describe: "Path to the image file to upload"
|
|
1635
|
+
}).example("skydive agents avatar set Ripple --file avatar.png", "upload a photo"),
|
|
1636
|
+
handler: async (argv) => {
|
|
1637
|
+
const client = requireManagementClient(argv);
|
|
1638
|
+
const agent = await resolveAgent(client, argv.agent);
|
|
1639
|
+
const result = await client.setAgentAvatar({
|
|
1640
|
+
agentId: agent.id,
|
|
1641
|
+
filePath: argv.file
|
|
1642
|
+
});
|
|
1643
|
+
if (result.isErr()) {
|
|
1644
|
+
printError(result.error.message);
|
|
1645
|
+
process.exit(1);
|
|
1646
|
+
}
|
|
1647
|
+
if (argv.json) {
|
|
1648
|
+
output(argv, {
|
|
1649
|
+
agent: agent.id,
|
|
1650
|
+
avatarUrl: result.value.avatarUrl
|
|
1651
|
+
});
|
|
1652
|
+
return;
|
|
1653
|
+
}
|
|
1654
|
+
if (argv.quiet) {
|
|
1655
|
+
console.log(result.value.avatarUrl);
|
|
1656
|
+
return;
|
|
1657
|
+
}
|
|
1658
|
+
console.log(`Avatar set for ${agent.name}.`);
|
|
1659
|
+
}
|
|
1660
|
+
};
|
|
1661
|
+
const avatarRemoveCommand = {
|
|
1662
|
+
command: "remove <agent>",
|
|
1663
|
+
describe: "Remove an agent's uploaded avatar (the generated preset takes over)",
|
|
1664
|
+
builder: (y) => y.positional("agent", {
|
|
1665
|
+
type: "string",
|
|
1666
|
+
demandOption: true,
|
|
1667
|
+
describe: "Agent id or name to remove the avatar from"
|
|
1668
|
+
}),
|
|
1669
|
+
handler: async (argv) => {
|
|
1670
|
+
const client = requireManagementClient(argv);
|
|
1671
|
+
const agent = await resolveAgent(client, argv.agent);
|
|
1672
|
+
const result = await client.deleteAgentAvatar(agent.id);
|
|
1673
|
+
if (result.isErr()) {
|
|
1674
|
+
printError(result.error.message);
|
|
1675
|
+
process.exit(1);
|
|
1676
|
+
}
|
|
1677
|
+
if (argv.json) {
|
|
1678
|
+
output(argv, { agent: agent.id });
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
console.log(`Avatar removed for ${agent.name}.`);
|
|
1682
|
+
}
|
|
1683
|
+
};
|
|
1684
|
+
const avatarCommand = {
|
|
1685
|
+
command: "avatar",
|
|
1686
|
+
describe: "Manage an agent's avatar photo",
|
|
1687
|
+
builder: (y) => y.command(avatarSetCommand).command(avatarRemoveCommand).demandCommand(1, "Specify a subcommand: set, remove"),
|
|
1688
|
+
handler: () => {}
|
|
1689
|
+
};
|
|
1528
1690
|
const agentsCommand = {
|
|
1529
1691
|
command: "agents",
|
|
1530
1692
|
describe: "Manage agents",
|
|
1531
|
-
builder: (y) => y.command(listCommand$
|
|
1693
|
+
builder: (y) => y.command(listCommand$7).command(getCommand$2).command(createCommand$1).command(aliasCommand).command(gitCommand).command(avatarCommand).demandCommand(1, "Specify a subcommand: list, get, create, alias, git, avatar"),
|
|
1532
1694
|
handler: () => {}
|
|
1533
1695
|
};
|
|
1534
1696
|
|
|
@@ -1823,7 +1985,7 @@ const importCommand = {
|
|
|
1823
1985
|
process.exit(1);
|
|
1824
1986
|
}
|
|
1825
1987
|
}
|
|
1826
|
-
const { runChat } = await import("./boot-
|
|
1988
|
+
const { runChat } = await import("./boot-oH6ZHYdH.mjs");
|
|
1827
1989
|
await runChat({
|
|
1828
1990
|
appUrl,
|
|
1829
1991
|
sessionToken: session.value.sessionToken,
|
|
@@ -1853,7 +2015,7 @@ async function runImportPrintMode({ argv, appUrl }) {
|
|
|
1853
2015
|
printError(`${session.error.message} For non-interactive use, run \`skydive auth login --web\` first, or set SKYDIVE_SESSION_TOKEN.`);
|
|
1854
2016
|
process.exit(1);
|
|
1855
2017
|
}
|
|
1856
|
-
const { connectMachineShare } = await import("./print-share-
|
|
2018
|
+
const { connectMachineShare } = await import("./print-share-BZCjBNpt.mjs");
|
|
1857
2019
|
const machineShare = await connectMachineShare({
|
|
1858
2020
|
appUrl,
|
|
1859
2021
|
sessionToken: session.value.sessionToken,
|
|
@@ -1861,7 +2023,7 @@ async function runImportPrintMode({ argv, appUrl }) {
|
|
|
1861
2023
|
});
|
|
1862
2024
|
const extra = (argv.print ?? "").trim();
|
|
1863
2025
|
const prompt = buildImportSeedPrompt(process.cwd(), machineOsFromPlatform(process.platform)) + (extra ? `\n\nAdditional instructions: ${extra}` : "");
|
|
1864
|
-
const { runPrint } = await import("./print-
|
|
2026
|
+
const { runPrint } = await import("./print-BbRVB3lw.mjs");
|
|
1865
2027
|
try {
|
|
1866
2028
|
const result = await runPrint({
|
|
1867
2029
|
appUrl,
|
|
@@ -1885,7 +2047,7 @@ async function runImportPrintMode({ argv, appUrl }) {
|
|
|
1885
2047
|
|
|
1886
2048
|
//#endregion
|
|
1887
2049
|
//#region src/commands/keys.ts
|
|
1888
|
-
const listCommand$
|
|
2050
|
+
const listCommand$6 = {
|
|
1889
2051
|
command: "list",
|
|
1890
2052
|
describe: "List API keys for an agent",
|
|
1891
2053
|
handler: async (argv) => {
|
|
@@ -1982,7 +2144,7 @@ const keysCommand = {
|
|
|
1982
2144
|
}).option("agent-id", {
|
|
1983
2145
|
type: "string",
|
|
1984
2146
|
describe: "Target agent id (legacy; prefer --agent)"
|
|
1985
|
-
}).command(listCommand$
|
|
2147
|
+
}).command(listCommand$6).command(createCommand).command(revokeCommand$1).demandCommand(1, "Specify a subcommand: list, create, revoke"),
|
|
1986
2148
|
handler: () => {}
|
|
1987
2149
|
};
|
|
1988
2150
|
|
|
@@ -1994,7 +2156,7 @@ async function readStdin() {
|
|
|
1994
2156
|
for await (const chunk of process.stdin) chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
1995
2157
|
return Buffer.concat(chunks).toString("utf8").replace(/\n$/, "");
|
|
1996
2158
|
}
|
|
1997
|
-
const listCommand$
|
|
2159
|
+
const listCommand$5 = {
|
|
1998
2160
|
command: "list",
|
|
1999
2161
|
describe: "List secret names for an agent (values are never shown)",
|
|
2000
2162
|
handler: async (argv) => {
|
|
@@ -2088,7 +2250,7 @@ const secretsCommand = {
|
|
|
2088
2250
|
}).option("agent-id", {
|
|
2089
2251
|
type: "string",
|
|
2090
2252
|
describe: "Target agent id (legacy; prefer --agent)"
|
|
2091
|
-
}).command(listCommand$
|
|
2253
|
+
}).command(listCommand$5).command(setCommand$1).command(rmCommand).demandCommand(1, "Specify a subcommand: list, set, rm"),
|
|
2092
2254
|
handler: () => {}
|
|
2093
2255
|
};
|
|
2094
2256
|
|
|
@@ -2284,7 +2446,7 @@ const chatCommand = {
|
|
|
2284
2446
|
sessionToken: auth.value.token,
|
|
2285
2447
|
agentSelector: argv.agent ?? null
|
|
2286
2448
|
});
|
|
2287
|
-
const { runChat } = await import("./boot-
|
|
2449
|
+
const { runChat } = await import("./boot-oH6ZHYdH.mjs");
|
|
2288
2450
|
await runChat({
|
|
2289
2451
|
appUrl: auth.value.appUrl,
|
|
2290
2452
|
sessionToken: auth.value.token,
|
|
@@ -2368,7 +2530,7 @@ async function runPrintMode({ argv, appUrl }) {
|
|
|
2368
2530
|
printError(`${auth.error.message} For non-interactive use, run \`skydive auth login\` first, or set SKYDIVE_API_KEY / SKYDIVE_SESSION_TOKEN.`);
|
|
2369
2531
|
process.exit(1);
|
|
2370
2532
|
}
|
|
2371
|
-
const { runPrint, readStdin } = await import("./print-
|
|
2533
|
+
const { runPrint, readStdin } = await import("./print-BbRVB3lw.mjs");
|
|
2372
2534
|
const workspaceId = await resolveWorkspaceFlag({
|
|
2373
2535
|
appUrl,
|
|
2374
2536
|
sessionToken: auth.value.token,
|
|
@@ -2398,7 +2560,7 @@ async function runPrintMode({ argv, appUrl }) {
|
|
|
2398
2560
|
process.exit(1);
|
|
2399
2561
|
}
|
|
2400
2562
|
} else {
|
|
2401
|
-
const { connectMachineShare } = await import("./print-share-
|
|
2563
|
+
const { connectMachineShare } = await import("./print-share-BZCjBNpt.mjs");
|
|
2402
2564
|
machineShare = await connectMachineShare({
|
|
2403
2565
|
appUrl: auth.value.appUrl,
|
|
2404
2566
|
sessionToken: auth.value.token,
|
|
@@ -2463,7 +2625,7 @@ const getCommand$1 = {
|
|
|
2463
2625
|
printError(`${auth.error.message} Run \`skydive auth login\` first, or set SKYDIVE_API_KEY / SKYDIVE_SESSION_TOKEN.`);
|
|
2464
2626
|
process.exit(1);
|
|
2465
2627
|
}
|
|
2466
|
-
const { messageGet } = await import("./print-
|
|
2628
|
+
const { messageGet } = await import("./print-BbRVB3lw.mjs");
|
|
2467
2629
|
try {
|
|
2468
2630
|
const result = await messageGet({
|
|
2469
2631
|
appUrl: auth.value.appUrl,
|
|
@@ -2510,7 +2672,7 @@ function messageToText(message) {
|
|
|
2510
2672
|
}
|
|
2511
2673
|
return chunks.join("\n").trim();
|
|
2512
2674
|
}
|
|
2513
|
-
const listCommand$
|
|
2675
|
+
const listCommand$4 = {
|
|
2514
2676
|
command: "list",
|
|
2515
2677
|
describe: "List an agent's conversations",
|
|
2516
2678
|
builder: (y) => y.option("agent", {
|
|
@@ -2600,7 +2762,7 @@ const conversationsCommand = {
|
|
|
2600
2762
|
command: "conversations",
|
|
2601
2763
|
aliases: ["conv"],
|
|
2602
2764
|
describe: "List and read agent conversations",
|
|
2603
|
-
builder: (y) => y.command(listCommand$
|
|
2765
|
+
builder: (y) => y.command(listCommand$4).command(showCommand).demandCommand(1, "Specify a subcommand: list, show"),
|
|
2604
2766
|
handler: () => {}
|
|
2605
2767
|
};
|
|
2606
2768
|
|
|
@@ -2642,7 +2804,7 @@ async function runList(argv, { hint }) {
|
|
|
2642
2804
|
]));
|
|
2643
2805
|
if (hint && !argv.quiet) console.log("\nRun `skydive workspace switch` to pick a workspace, or pass its slug directly.");
|
|
2644
2806
|
}
|
|
2645
|
-
const listCommand$
|
|
2807
|
+
const listCommand$3 = {
|
|
2646
2808
|
command: "list",
|
|
2647
2809
|
describe: "List workspaces on your account",
|
|
2648
2810
|
handler: (argv) => runList(argv, { hint: false })
|
|
@@ -2666,7 +2828,7 @@ const switchCommand = {
|
|
|
2666
2828
|
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.");
|
|
2667
2829
|
process.exit(1);
|
|
2668
2830
|
}
|
|
2669
|
-
const { runWorkspacePicker } = await import("./boot-
|
|
2831
|
+
const { runWorkspacePicker } = await import("./boot-oH6ZHYdH.mjs");
|
|
2670
2832
|
await runWorkspacePicker(session);
|
|
2671
2833
|
return;
|
|
2672
2834
|
}
|
|
@@ -2699,7 +2861,7 @@ const switchCommand = {
|
|
|
2699
2861
|
const workspaceCommand = {
|
|
2700
2862
|
command: "workspace",
|
|
2701
2863
|
describe: "List or switch the workspace all `skydive` commands act on",
|
|
2702
|
-
builder: (y) => y.command(listCommand$
|
|
2864
|
+
builder: (y) => y.command(listCommand$3).command(switchCommand),
|
|
2703
2865
|
handler: (argv) => runList(argv, { hint: true })
|
|
2704
2866
|
};
|
|
2705
2867
|
|
|
@@ -2745,7 +2907,7 @@ const openCommand = {
|
|
|
2745
2907
|
const agent = argv.agent ? resolveAgent$1((await fetchPortalDevices(session)).agents, argv.agent) : null;
|
|
2746
2908
|
const cwd = argv.cwd ? path.resolve(argv.cwd) : process.cwd();
|
|
2747
2909
|
const { machineName } = await resolveMachineIdentity(null);
|
|
2748
|
-
const { PortalDaemonClient } = await import("./daemon-client-
|
|
2910
|
+
const { PortalDaemonClient } = await import("./daemon-client-BpkvG_0G.mjs");
|
|
2749
2911
|
let lastLine = "";
|
|
2750
2912
|
let signalConnected;
|
|
2751
2913
|
const connected = new Promise((resolve) => {
|
|
@@ -3105,8 +3267,8 @@ const sandboxCommand = {
|
|
|
3105
3267
|
}).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`"),
|
|
3106
3268
|
handler: async (argv) => {
|
|
3107
3269
|
const session = requireSession(argv);
|
|
3108
|
-
const { createRestClient } = await import("./rest-
|
|
3109
|
-
const { resolveAgent } = await import("./print-
|
|
3270
|
+
const { createRestClient } = await import("./rest-CnpAZq0e.mjs");
|
|
3271
|
+
const { resolveAgent } = await import("./print-BbRVB3lw.mjs");
|
|
3110
3272
|
const client = createRestClient({
|
|
3111
3273
|
appUrl: session.appUrl,
|
|
3112
3274
|
sessionToken: session.sessionToken
|
|
@@ -3221,7 +3383,7 @@ async function runPty({ session, agentId, agentName }) {
|
|
|
3221
3383
|
return 1;
|
|
3222
3384
|
}
|
|
3223
3385
|
console.error(`Connecting to ${agentName}'s sandbox… (Ctrl-] detaches)`);
|
|
3224
|
-
const { runRawPtyPassthrough } = await import("./raw-pty-
|
|
3386
|
+
const { runRawPtyPassthrough } = await import("./raw-pty-BF3tEnca.mjs");
|
|
3225
3387
|
const result = await runRawPtyPassthrough({
|
|
3226
3388
|
stdin: process.stdin,
|
|
3227
3389
|
stdout: process.stdout,
|
|
@@ -3392,6 +3554,53 @@ function resolveEditor(override, env, platform = process.platform) {
|
|
|
3392
3554
|
};
|
|
3393
3555
|
}
|
|
3394
3556
|
/**
|
|
3557
|
+
* Resolve the target agent and open the multiplexed fs channel to its
|
|
3558
|
+
* sandbox. Shared by every `fs` subcommand. A failed agent listing or a
|
|
3559
|
+
* failed upgrade (expired session, an agent the caller can't edit, or the
|
|
3560
|
+
* `sandbox-fs-enabled` kill switch) exits here before any file work.
|
|
3561
|
+
*/
|
|
3562
|
+
async function openAgentFs(session, agentSelector) {
|
|
3563
|
+
const { createRestClient } = await import("./rest-CnpAZq0e.mjs");
|
|
3564
|
+
const { resolveAgent } = await import("./print-BbRVB3lw.mjs");
|
|
3565
|
+
let agent;
|
|
3566
|
+
try {
|
|
3567
|
+
agent = resolveAgent(await createRestClient({
|
|
3568
|
+
appUrl: session.appUrl,
|
|
3569
|
+
sessionToken: session.sessionToken
|
|
3570
|
+
}).listAgents({
|
|
3571
|
+
scope: "org",
|
|
3572
|
+
onPage: null
|
|
3573
|
+
}), agentSelector);
|
|
3574
|
+
} catch (error) {
|
|
3575
|
+
printError(error instanceof Error ? error.message : String(error));
|
|
3576
|
+
process.exit(1);
|
|
3577
|
+
}
|
|
3578
|
+
let fs;
|
|
3579
|
+
try {
|
|
3580
|
+
fs = await SandboxFsClient.connect({
|
|
3581
|
+
appUrl: session.appUrl,
|
|
3582
|
+
sessionToken: session.sessionToken,
|
|
3583
|
+
agentId: agent.id
|
|
3584
|
+
});
|
|
3585
|
+
} catch (error) {
|
|
3586
|
+
printError(`Could not open the sandbox filesystem channel: ${error instanceof Error ? error.message : String(error)}`);
|
|
3587
|
+
process.exit(1);
|
|
3588
|
+
}
|
|
3589
|
+
return {
|
|
3590
|
+
agent,
|
|
3591
|
+
fs
|
|
3592
|
+
};
|
|
3593
|
+
}
|
|
3594
|
+
/**
|
|
3595
|
+
* The oversized-file error for `fs put` and `fs cp`. The fs channel's write
|
|
3596
|
+
* op is whole-file only (no offset or append), so the CLI cannot chunk a
|
|
3597
|
+
* file larger than the relay's per-write cap — the web Files tab is the path
|
|
3598
|
+
* for those.
|
|
3599
|
+
*/
|
|
3600
|
+
function oversizeWriteError(label, size) {
|
|
3601
|
+
return `${label} is ${size} bytes, over the ${Math.floor(FS_MAX_BLOB_BYTES / (1024 * 1024))}MB per-write cap of the sandbox filesystem channel. Upload larger files through the Files tab in the web app instead.`;
|
|
3602
|
+
}
|
|
3603
|
+
/**
|
|
3395
3604
|
* `skydive fs edit <path>` — edit a file that lives on the agent's computer
|
|
3396
3605
|
* (its sandbox) with your LOCAL editor. It reads the remote file down over the
|
|
3397
3606
|
* multiplexed `fs` sandbox-stream channel, opens it in `$EDITOR`, and writes
|
|
@@ -3423,33 +3632,7 @@ const fsEditCommand = {
|
|
|
3423
3632
|
handler: async (argv) => {
|
|
3424
3633
|
const session = requireSession(argv);
|
|
3425
3634
|
const remotePath = argv.path;
|
|
3426
|
-
const {
|
|
3427
|
-
const { resolveAgent } = await import("./print-2hTs7Wb6.mjs");
|
|
3428
|
-
const client = createRestClient({
|
|
3429
|
-
appUrl: session.appUrl,
|
|
3430
|
-
sessionToken: session.sessionToken
|
|
3431
|
-
});
|
|
3432
|
-
let agent;
|
|
3433
|
-
try {
|
|
3434
|
-
agent = resolveAgent(await client.listAgents({
|
|
3435
|
-
scope: "org",
|
|
3436
|
-
onPage: null
|
|
3437
|
-
}), argv.agent ?? null);
|
|
3438
|
-
} catch (error) {
|
|
3439
|
-
printError(error instanceof Error ? error.message : String(error));
|
|
3440
|
-
process.exit(1);
|
|
3441
|
-
}
|
|
3442
|
-
let fs;
|
|
3443
|
-
try {
|
|
3444
|
-
fs = await SandboxFsClient.connect({
|
|
3445
|
-
appUrl: session.appUrl,
|
|
3446
|
-
sessionToken: session.sessionToken,
|
|
3447
|
-
agentId: agent.id
|
|
3448
|
-
});
|
|
3449
|
-
} catch (error) {
|
|
3450
|
-
printError(`Could not open the sandbox filesystem channel: ${error instanceof Error ? error.message : String(error)}`);
|
|
3451
|
-
process.exit(1);
|
|
3452
|
-
}
|
|
3635
|
+
const { agent, fs } = await openAgentFs(session, argv.agent ?? null);
|
|
3453
3636
|
const cleanup = async (dir) => {
|
|
3454
3637
|
await rm(dir, {
|
|
3455
3638
|
recursive: true,
|
|
@@ -3514,21 +3697,157 @@ function openEditor(override, file) {
|
|
|
3514
3697
|
});
|
|
3515
3698
|
}
|
|
3516
3699
|
/**
|
|
3700
|
+
* Upload a local file to a path on the agent's sandbox in one `write` op.
|
|
3701
|
+
* The relay caps a single write's payload at {@link FS_MAX_BLOB_BYTES} and the
|
|
3702
|
+
* write op is whole-file only (no offset/append), so a larger file is
|
|
3703
|
+
* rejected up front with a pointer to the web Files tab rather than a
|
|
3704
|
+
* truncated or partial upload.
|
|
3705
|
+
*/
|
|
3706
|
+
const fsPutCommand = {
|
|
3707
|
+
command: "put <agent> <local-file> <remote-path>",
|
|
3708
|
+
describe: "Copy a file from your machine onto the agent's sandbox",
|
|
3709
|
+
builder: (y) => y.positional("agent", {
|
|
3710
|
+
type: "string",
|
|
3711
|
+
demandOption: true,
|
|
3712
|
+
describe: "Target agent, by id, slug, or name"
|
|
3713
|
+
}).positional("local-file", {
|
|
3714
|
+
type: "string",
|
|
3715
|
+
demandOption: true,
|
|
3716
|
+
describe: "Path of the file on your machine to upload"
|
|
3717
|
+
}).positional("remote-path", {
|
|
3718
|
+
type: "string",
|
|
3719
|
+
demandOption: true,
|
|
3720
|
+
describe: "Absolute or sandbox-relative path to write it to"
|
|
3721
|
+
}).example("skydive fs put grace ./report.pdf /home/user/Downloads/report.pdf", "Upload a local file to the sandbox"),
|
|
3722
|
+
handler: async (argv) => {
|
|
3723
|
+
const { fs } = await openAgentFs(requireSession(argv), argv.agent ?? null);
|
|
3724
|
+
try {
|
|
3725
|
+
const localStat = await stat(argv["local-file"]);
|
|
3726
|
+
if (localStat.isDirectory()) {
|
|
3727
|
+
printError(`${argv["local-file"]} is a directory; fs put copies a single file.`);
|
|
3728
|
+
process.exit(1);
|
|
3729
|
+
}
|
|
3730
|
+
if (localStat.size > FS_MAX_BLOB_BYTES) {
|
|
3731
|
+
printError(oversizeWriteError(argv["local-file"], localStat.size));
|
|
3732
|
+
process.exit(1);
|
|
3733
|
+
}
|
|
3734
|
+
const bytes = await readFile(argv["local-file"]);
|
|
3735
|
+
await fs.write(argv["remote-path"], new Uint8Array(bytes));
|
|
3736
|
+
fs.close();
|
|
3737
|
+
} catch (error) {
|
|
3738
|
+
fs.close();
|
|
3739
|
+
printError(error instanceof Error ? error.message : String(error));
|
|
3740
|
+
process.exit(1);
|
|
3741
|
+
}
|
|
3742
|
+
}
|
|
3743
|
+
};
|
|
3744
|
+
/**
|
|
3745
|
+
* Download a file from the agent's sandbox to a local path. Reads are
|
|
3746
|
+
* range-based, so a file of any size comes down in chunks of
|
|
3747
|
+
* {@link FS_MAX_BLOB_BYTES}; the chunks are concatenated into one local
|
|
3748
|
+
* write. Silent on success so it composes in scripts (exit code carries the
|
|
3749
|
+
* result).
|
|
3750
|
+
*/
|
|
3751
|
+
const fsGetCommand = {
|
|
3752
|
+
command: "get <agent> <remote-path> <local-path>",
|
|
3753
|
+
describe: "Copy a file from the agent's sandbox onto your machine",
|
|
3754
|
+
builder: (y) => y.positional("agent", {
|
|
3755
|
+
type: "string",
|
|
3756
|
+
demandOption: true,
|
|
3757
|
+
describe: "Target agent, by id, slug, or name"
|
|
3758
|
+
}).positional("remote-path", {
|
|
3759
|
+
type: "string",
|
|
3760
|
+
demandOption: true,
|
|
3761
|
+
describe: "Absolute or sandbox-relative path of the file to download"
|
|
3762
|
+
}).positional("local-path", {
|
|
3763
|
+
type: "string",
|
|
3764
|
+
demandOption: true,
|
|
3765
|
+
describe: "Path on your machine to write it to"
|
|
3766
|
+
}).example("skydive fs get grace /home/user/.self/soul.md ./soul.md", "Download a file from the sandbox"),
|
|
3767
|
+
handler: async (argv) => {
|
|
3768
|
+
const { fs } = await openAgentFs(requireSession(argv), argv.agent ?? null);
|
|
3769
|
+
try {
|
|
3770
|
+
const remoteStat = await fs.stat(argv["remote-path"]);
|
|
3771
|
+
if (remoteStat.type === "dir") {
|
|
3772
|
+
printError(`${argv["remote-path"]} is a directory; fs get copies a single file.`);
|
|
3773
|
+
process.exit(1);
|
|
3774
|
+
}
|
|
3775
|
+
const chunks = [];
|
|
3776
|
+
for (let offset = 0; offset < remoteStat.size; offset += FS_MAX_BLOB_BYTES) chunks.push(await fs.read(argv["remote-path"], {
|
|
3777
|
+
offset,
|
|
3778
|
+
length: FS_MAX_BLOB_BYTES
|
|
3779
|
+
}));
|
|
3780
|
+
await writeFile(argv["local-path"], Buffer.concat(chunks));
|
|
3781
|
+
fs.close();
|
|
3782
|
+
} catch (error) {
|
|
3783
|
+
fs.close();
|
|
3784
|
+
printError(error instanceof Error ? error.message : String(error));
|
|
3785
|
+
process.exit(1);
|
|
3786
|
+
}
|
|
3787
|
+
}
|
|
3788
|
+
};
|
|
3789
|
+
/**
|
|
3790
|
+
* Copy a file from one sandbox path to another, via one read and one write.
|
|
3791
|
+
* Same per-write cap as `fs put`: the write op is whole-file only, so a
|
|
3792
|
+
* source larger than {@link FS_MAX_BLOB_BYTES} is rejected up front.
|
|
3793
|
+
*/
|
|
3794
|
+
const fsCpCommand = {
|
|
3795
|
+
command: "cp <agent> <src> <dst>",
|
|
3796
|
+
describe: "Copy a file to another path inside the agent's sandbox",
|
|
3797
|
+
builder: (y) => y.positional("agent", {
|
|
3798
|
+
type: "string",
|
|
3799
|
+
demandOption: true,
|
|
3800
|
+
describe: "Target agent, by id, slug, or name"
|
|
3801
|
+
}).positional("src", {
|
|
3802
|
+
type: "string",
|
|
3803
|
+
demandOption: true,
|
|
3804
|
+
describe: "Absolute or sandbox-relative path of the file to copy"
|
|
3805
|
+
}).positional("dst", {
|
|
3806
|
+
type: "string",
|
|
3807
|
+
demandOption: true,
|
|
3808
|
+
describe: "Absolute or sandbox-relative path to copy it to"
|
|
3809
|
+
}).example("skydive fs cp grace /tmp/notes.md /home/user/.self/notes.md", "Copy a file within the sandbox"),
|
|
3810
|
+
handler: async (argv) => {
|
|
3811
|
+
const { fs } = await openAgentFs(requireSession(argv), argv.agent ?? null);
|
|
3812
|
+
try {
|
|
3813
|
+
const srcStat = await fs.stat(argv.src);
|
|
3814
|
+
if (srcStat.type === "dir") {
|
|
3815
|
+
printError(`${argv.src} is a directory; fs cp copies a single file.`);
|
|
3816
|
+
process.exit(1);
|
|
3817
|
+
}
|
|
3818
|
+
if (srcStat.size > FS_MAX_BLOB_BYTES) {
|
|
3819
|
+
printError(oversizeWriteError(argv.src, srcStat.size));
|
|
3820
|
+
process.exit(1);
|
|
3821
|
+
}
|
|
3822
|
+
const bytes = await fs.read(argv.src, null);
|
|
3823
|
+
await fs.write(argv.dst, bytes);
|
|
3824
|
+
fs.close();
|
|
3825
|
+
} catch (error) {
|
|
3826
|
+
fs.close();
|
|
3827
|
+
printError(error instanceof Error ? error.message : String(error));
|
|
3828
|
+
process.exit(1);
|
|
3829
|
+
}
|
|
3830
|
+
}
|
|
3831
|
+
};
|
|
3832
|
+
/**
|
|
3517
3833
|
* `skydive fs` — work with the files on an agent's computer (its sandbox) from
|
|
3518
3834
|
* your own machine. The namespace for filesystem access:
|
|
3519
3835
|
*
|
|
3520
|
-
* - `fs edit <path>` edit one remote file with your local editor
|
|
3836
|
+
* - `fs edit <path>` edit one remote file with your local editor.
|
|
3837
|
+
* - `fs put ...` upload a local file to the sandbox.
|
|
3838
|
+
* - `fs get ...` download a sandbox file to your machine.
|
|
3839
|
+
* - `fs cp ...` copy a file within the sandbox.
|
|
3521
3840
|
* - `fs mount <dir>` mount the whole sandbox filesystem locally (coming in a
|
|
3522
3841
|
* later PR, on the same first-class `fs` relay channel).
|
|
3523
3842
|
*
|
|
3524
3843
|
* Grouping these under one command keeps the file surface discoverable and
|
|
3525
|
-
* leaves room to grow (`fs ls`, `fs cat
|
|
3526
|
-
*
|
|
3844
|
+
* leaves room to grow (`fs ls`, `fs cat`) without adding more top-level
|
|
3845
|
+
* commands.
|
|
3527
3846
|
*/
|
|
3528
3847
|
const fsCommand = {
|
|
3529
3848
|
command: "fs <command>",
|
|
3530
3849
|
describe: "Work with the files on an agent's computer (its sandbox)",
|
|
3531
|
-
builder: (y) => y.command(fsEditCommand).demandCommand(1, "Specify a subcommand: edit"),
|
|
3850
|
+
builder: (y) => y.command(fsEditCommand).command(fsPutCommand).command(fsGetCommand).command(fsCpCommand).demandCommand(1, "Specify a subcommand: edit, put, get, cp"),
|
|
3532
3851
|
handler: () => {}
|
|
3533
3852
|
};
|
|
3534
3853
|
|
|
@@ -4256,7 +4575,7 @@ function snapshot(pref) {
|
|
|
4256
4575
|
describe: pref.describe
|
|
4257
4576
|
};
|
|
4258
4577
|
}
|
|
4259
|
-
const listCommand$
|
|
4578
|
+
const listCommand$2 = {
|
|
4260
4579
|
command: "list",
|
|
4261
4580
|
aliases: ["ls"],
|
|
4262
4581
|
describe: "Show every editable preference, its value, and its source",
|
|
@@ -4361,8 +4680,162 @@ const pathCommand$1 = {
|
|
|
4361
4680
|
const configCommand = {
|
|
4362
4681
|
command: "config",
|
|
4363
4682
|
describe: "View and set CLI preferences (safe, hand-editable keys only)",
|
|
4364
|
-
builder: (y) => y.command(listCommand$
|
|
4365
|
-
handler: (argv) => listCommand$
|
|
4683
|
+
builder: (y) => y.command(listCommand$2).command(getCommand).command(setCommand).command(unsetCommand).command(pathCommand$1),
|
|
4684
|
+
handler: (argv) => listCommand$2.handler(argv)
|
|
4685
|
+
};
|
|
4686
|
+
|
|
4687
|
+
//#endregion
|
|
4688
|
+
//#region src/commands/proxy.ts
|
|
4689
|
+
/**
|
|
4690
|
+
* `skydive proxy skip-list` — manage the sandbox egress proxy's custom skip
|
|
4691
|
+
* list. The agent-visible verbs are `skip-list add <host…>` / `skip-list
|
|
4692
|
+
* remove <host…>`; a bare `skip-list` lists what is currently skipped.
|
|
4693
|
+
*
|
|
4694
|
+
* Skipped hosts leave the sandbox RAW: the mitmproxy addon forwards them
|
|
4695
|
+
* without rewriting through the transparent proxy, which means NO platform
|
|
4696
|
+
* credential injection (that's the point — a user's own API keys go straight
|
|
4697
|
+
* to the provider), but also no agent rules, no content policy, no billing
|
|
4698
|
+
* gate, and no platform-side record of the egress.
|
|
4699
|
+
*
|
|
4700
|
+
* Config is agent-scoped runtime state: it lives in the in-sandbox daemon's
|
|
4701
|
+
* env and survives daemon restarts and pause/resume, but resets on a fresh
|
|
4702
|
+
* box (a new sandbox cold-create starts with the addon's built-in defaults
|
|
4703
|
+
* only). Platform control-plane hosts can never be skipped.
|
|
4704
|
+
*
|
|
4705
|
+
* Loopback-only daemon routes: this command only works INSIDE a sandbox
|
|
4706
|
+
* (where the egress proxy actually runs).
|
|
4707
|
+
*/
|
|
4708
|
+
const DAEMON_BASE_URL = process.env["SKYDIVE_DAEMON_URL"] ?? "http://localhost:38994";
|
|
4709
|
+
async function daemonFetch(path, init) {
|
|
4710
|
+
try {
|
|
4711
|
+
const res = await fetch(`${DAEMON_BASE_URL}${path}`, {
|
|
4712
|
+
...init,
|
|
4713
|
+
headers: {
|
|
4714
|
+
"Content-Type": "application/json",
|
|
4715
|
+
...init?.headers
|
|
4716
|
+
}
|
|
4717
|
+
});
|
|
4718
|
+
const parsed = z.object({
|
|
4719
|
+
hosts: z.array(z.string()).optional(),
|
|
4720
|
+
error: z.string().optional()
|
|
4721
|
+
}).safeParse(await res.json().catch((_error) => ({})));
|
|
4722
|
+
const body = parsed.success ? parsed.data : {};
|
|
4723
|
+
return {
|
|
4724
|
+
status: res.status,
|
|
4725
|
+
body
|
|
4726
|
+
};
|
|
4727
|
+
} catch (err) {
|
|
4728
|
+
return {
|
|
4729
|
+
status: 0,
|
|
4730
|
+
body: { error: `Could not reach the sandbox daemon at ${DAEMON_BASE_URL}. This command only works inside a sandbox. (${err instanceof Error ? err.message : String(err)})` }
|
|
4731
|
+
};
|
|
4732
|
+
}
|
|
4733
|
+
}
|
|
4734
|
+
function printHosts(argv, hosts) {
|
|
4735
|
+
if (argv.json) {
|
|
4736
|
+
output(argv, { hosts });
|
|
4737
|
+
return;
|
|
4738
|
+
}
|
|
4739
|
+
if (hosts.length === 0) {
|
|
4740
|
+
console.log("No custom skip hosts. (Platform defaults still apply.)");
|
|
4741
|
+
return;
|
|
4742
|
+
}
|
|
4743
|
+
printTable(["Host"], hosts.map((h) => [h]));
|
|
4744
|
+
}
|
|
4745
|
+
const listCommand$1 = {
|
|
4746
|
+
command: "list",
|
|
4747
|
+
aliases: ["ls"],
|
|
4748
|
+
describe: "Show the custom proxy skip hosts (same as bare `skip-list`)",
|
|
4749
|
+
handler: async (argv) => {
|
|
4750
|
+
const { status, body } = await daemonFetch("/v1/proxy/skip-list", null);
|
|
4751
|
+
if (status !== 200) {
|
|
4752
|
+
printError(body.error ?? `daemon /v1/proxy/skip-list: ${status}`);
|
|
4753
|
+
process.exit(1);
|
|
4754
|
+
}
|
|
4755
|
+
printHosts(argv, body.hosts ?? []);
|
|
4756
|
+
}
|
|
4757
|
+
};
|
|
4758
|
+
const addCommand = {
|
|
4759
|
+
command: "add <hosts..>",
|
|
4760
|
+
describe: "Skip the proxy for exact host(s). Their traffic leaves the sandbox RAW: no platform credential injection, no agent rules, no billing gate.",
|
|
4761
|
+
builder: (y) => y.positional("hosts", {
|
|
4762
|
+
type: "string",
|
|
4763
|
+
array: true,
|
|
4764
|
+
demandOption: true,
|
|
4765
|
+
describe: "One or more exact hostnames (api.example.com), no wildcards"
|
|
4766
|
+
}),
|
|
4767
|
+
handler: async (argv) => {
|
|
4768
|
+
for (const host of argv.hosts) {
|
|
4769
|
+
const { status, body } = await daemonFetch("/v1/proxy/skip-list/add", {
|
|
4770
|
+
method: "POST",
|
|
4771
|
+
body: JSON.stringify({ host })
|
|
4772
|
+
});
|
|
4773
|
+
if (status === 0) {
|
|
4774
|
+
printError(body.error ?? `daemon unreachable (host ${host})`);
|
|
4775
|
+
process.exitCode = 1;
|
|
4776
|
+
continue;
|
|
4777
|
+
}
|
|
4778
|
+
if (status !== 200) {
|
|
4779
|
+
printError(`${host}: ${body.error ?? status}`);
|
|
4780
|
+
process.exitCode = 1;
|
|
4781
|
+
continue;
|
|
4782
|
+
}
|
|
4783
|
+
if (argv.json) output(argv, {
|
|
4784
|
+
host,
|
|
4785
|
+
hosts: body.hosts ?? []
|
|
4786
|
+
});
|
|
4787
|
+
else console.log(`${host} is now skipped: requests to it leave the sandbox raw (no platform credential injection).`);
|
|
4788
|
+
}
|
|
4789
|
+
}
|
|
4790
|
+
};
|
|
4791
|
+
const removeCommand = {
|
|
4792
|
+
command: "remove <hosts..>",
|
|
4793
|
+
aliases: ["rm"],
|
|
4794
|
+
describe: "Remove host(s) from the custom skip list",
|
|
4795
|
+
builder: (y) => y.positional("hosts", {
|
|
4796
|
+
type: "string",
|
|
4797
|
+
array: true,
|
|
4798
|
+
demandOption: true,
|
|
4799
|
+
describe: "Exact hostnames to remove"
|
|
4800
|
+
}),
|
|
4801
|
+
handler: async (argv) => {
|
|
4802
|
+
for (const host of argv.hosts) {
|
|
4803
|
+
const { status, body } = await daemonFetch("/v1/proxy/skip-list/remove", {
|
|
4804
|
+
method: "POST",
|
|
4805
|
+
body: JSON.stringify({ host })
|
|
4806
|
+
});
|
|
4807
|
+
if (status === 0) {
|
|
4808
|
+
printError(body.error ?? `daemon unreachable (host ${host})`);
|
|
4809
|
+
process.exitCode = 1;
|
|
4810
|
+
continue;
|
|
4811
|
+
}
|
|
4812
|
+
if (status !== 200) {
|
|
4813
|
+
printError(`${host}: ${body.error ?? status}`);
|
|
4814
|
+
process.exitCode = 1;
|
|
4815
|
+
continue;
|
|
4816
|
+
}
|
|
4817
|
+
if (argv.json) output(argv, {
|
|
4818
|
+
host,
|
|
4819
|
+
hosts: body.hosts ?? []
|
|
4820
|
+
});
|
|
4821
|
+
else console.log(`${host} removed from the skip list.`);
|
|
4822
|
+
}
|
|
4823
|
+
}
|
|
4824
|
+
};
|
|
4825
|
+
/** `skydive proxy skip-list` — no subcommand lists; add/remove mutate. */
|
|
4826
|
+
const skipListCommand = {
|
|
4827
|
+
command: "skip-list [command]",
|
|
4828
|
+
describe: "Manage hosts that bypass the egress proxy",
|
|
4829
|
+
builder: (y) => y.command(listCommand$1).command(addCommand).command(removeCommand).default("command", "list"),
|
|
4830
|
+
handler: async (argv) => {
|
|
4831
|
+
if (argv.command === "list" || argv.command === "ls") await listCommand$1.handler(argv);
|
|
4832
|
+
}
|
|
4833
|
+
};
|
|
4834
|
+
const proxyCommand = {
|
|
4835
|
+
command: "proxy <command>",
|
|
4836
|
+
describe: "Inspect and configure the sandbox egress proxy",
|
|
4837
|
+
builder: (y) => y.command(skipListCommand).demandCommand(1, "Run `skydive proxy skip-list`"),
|
|
4838
|
+
handler: () => {}
|
|
4366
4839
|
};
|
|
4367
4840
|
|
|
4368
4841
|
//#endregion
|
|
@@ -4419,7 +4892,7 @@ async function offerIssueReport(archivePath) {
|
|
|
4419
4892
|
console.log(`File an issue: ${ISSUE_REPOSITORY_URL}`);
|
|
4420
4893
|
return;
|
|
4421
4894
|
}
|
|
4422
|
-
await open(issueUrl(archivePath));
|
|
4895
|
+
await open$1(issueUrl(archivePath));
|
|
4423
4896
|
console.log(`Attach the diagnostics archive: ${archivePath}`);
|
|
4424
4897
|
} finally {
|
|
4425
4898
|
prompt.close();
|
|
@@ -4522,7 +4995,7 @@ function createCli(argv) {
|
|
|
4522
4995
|
type: "string",
|
|
4523
4996
|
global: true,
|
|
4524
4997
|
describe: "Override API base URL"
|
|
4525
|
-
}).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(logsCommand).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) => {
|
|
4998
|
+
}).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(proxyCommand).command(logsCommand).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) => {
|
|
4526
4999
|
printError(err ? err instanceof Error ? err.message : String(err) : msg ?? "Unknown error");
|
|
4527
5000
|
process.exit(1);
|
|
4528
5001
|
});
|
|
@@ -4735,7 +5208,7 @@ function setupUpdateCheck(argv) {
|
|
|
4735
5208
|
|
|
4736
5209
|
//#endregion
|
|
4737
5210
|
//#region src/changelog.generated.ts
|
|
4738
|
-
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- `skydive secrets` and `skydive keys` now accept `--agent <id or name>` (the same flag every other agent-targeting command uses), resolving the name against your agent roster. They used to take only a raw `--agent-id`, so passing the name every other command accepts 404'd \"agent not found\" for a perfectly real agent; `--agent-id` still works.\n\n- `/fork` in the chat TUI now works while the agent is mid-run. It used to refuse with \"finish or cancel the run first\"; now it copies the conversation up to the last completed message and opens the copy, while the agent keeps working on the original — reopen the original to reattach, exactly as after `esc`. This matches the web \"Fork chat\" menu item, which never had the restriction.\n- The two cards pinned above the chat TUI composer — **subagents** and **plan** — can now be minimized to a single header row. Click a card's header (the `▾`/`▸` chevron shows which way it goes), or use `/subagent minimize` and `/plan minimize`; the same again, or `/plan expand`, brings the rows back. Minimized, a card keeps its label and its progress counter (`Subagents 7/10`), so a ten-task fan-out costs one row instead of ten and the rest of the terminal goes back to the transcript. `/plan expand` and `/plan collapse` keep their meaning (unfold and re-fold the completed rows the card windows away); clicking the card's _body_ still does the same, and the hints now say which surface does which.\n- Reopening a conversation whose subagents and plan are all finished now opens both pinned cards minimized to their header row (`▸ ✔ Subagents 4/4`, `▸ Plan 5/5`) instead of spending up to ten rows above the composer on finished work. A card that opens this way pops back open by itself the moment new work goes live in that conversation (a fresh fan-out, a new in-progress step); a card you minimized yourself stays minimized, as before. Work still running when you open the conversation shows its rows, exactly as it did.\n\n- The chat TUI status bar now always shows where the portal stands, instead of only lighting up once everything already worked. It reads `portal off`, `portal connecting`, `portal on` (open on this machine, but this agent has no grant), `portal shared` (green — this agent can run commands here), `portal error`, or `portal unavailable` when you signed in with an API key and no portal is possible. Previously the badge rendered nothing in every one of those states, so \"why can't the agent reach my machine?\" had no answer on screen.\n- One word for that feature across the whole CLI: **portal**. The footer hint is now `ctrl+t portal` / `ctrl+t close portal` (was `local access` / `revoke access`), `/status` reports a `portal` row (was `local access`), and `/share` and `/portal` describe themselves as opening the portal and granting an agent access to your machine. `/portal` used to say \"access your computer\", which collided with `/computer` — that command still means the **agent's** sandbox, and \"computer\" stays reserved for it. `--share-machine` and the `shareMachineDefault` config key are unchanged.\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- `skydive agents git token` — create, list, and revoke git-proxy tokens for an agent's repo from your machine. `agents git token create <agent>` prints a read_write token plus the tokenless remote URL (the same routes the web settings page uses); `… git token list <agent>` shows the agent's tokens by id, and `… git token revoke <agent> <token-id>` revokes one. The command's job ends at the credential: it writes nothing to git on your machine, so what to do with the token (credential store, remote URLs) stays with whatever tooling you already pipe credentials through. `auth login` now points at it for laptop git setup.\n- Files an agent shares into the conversation now show as a saveable row in the chat TUI. When the agent sends you a file (a report, an export, a screenshot), it appears as a `📎` row with the filename and size and a \"click to save\" hint; clicking it downloads the file to your `~/Downloads` (falling back to your home directory) and opens it with your default app, then the row shows where it landed. Clicking a saved row again re-opens it. Previously these files were only reachable in the web app — in the terminal they were invisible.\n- `platform ask` forms now render in the chat TUI. The card lists each question with lettered options (A/B/C/D plus Other); `ctrl+r` opens a full overlay picker (one question at a time, arrows + enter, Other as a typed row — the Claude Code interaction). The answer sends as a normal message. Headless `chat -p` prints the question as an `[action needed]` block instead of dropping it.\n- Every API request now reports this install's version (`x-skydive-cli-version`) so the server can refuse features the installed CLI cannot render — `platform ask` needs the #21411 canary (`0.5.0-beta.43` or newer), not 0.4.0 and not earlier 0.5.0 betas.\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` 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- `/computer restart` in the chat TUI — reboot the agent's sandbox from chat. It asks a `y`/`n` confirm first (the restart stops whatever run is going and brings up a fresh box), then enqueues the same restart the web \"Restart\" control does. Available to anyone with edit access to the agent; view-only members are told they can't.\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";
|
|
5211
|
+
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 put`, `fs get`, and `fs cp` — move files between your machine and an agent's sandbox without opening the chat TUI or the web app. `fs put [agent] <local-file> <remote-path>` uploads a file, `fs get [agent] <remote-path> <local-path>` downloads one, and `fs cp [agent] <src> <dst>` copies a file to another path inside the sandbox. They ride the same first-class `fs` relay channel as `fs edit` (same EDIT-permission and kill-switch gating); downloads stream in 8MB ranges so large files come down fine, while uploads and in-sandbox copies are capped at the relay's 8MB per-write limit — a bigger file is rejected up front with a pointer to the web Files tab. Silent on success so they compose in scripts; exit code carries the result.\n\n### Changed\n\n- `skydive secrets` and `skydive keys` now accept `--agent <id or name>` (the same flag every other agent-targeting command uses), resolving the name against your agent roster. They used to take only a raw `--agent-id`, so passing the name every other command accepts 404'd \"agent not found\" for a perfectly real agent; `--agent-id` still works.\n\n- `/fork` in the chat TUI now works while the agent is mid-run. It used to refuse with \"finish or cancel the run first\"; now it copies the conversation up to the last completed message and opens the copy, while the agent keeps working on the original — reopen the original to reattach, exactly as after `esc`. This matches the web \"Fork chat\" menu item, which never had the restriction.\n- The two cards pinned above the chat TUI composer — **subagents** and **plan** — can now be minimized to a single header row. Click a card's header (the `▾`/`▸` chevron shows which way it goes), or use `/subagent minimize` and `/plan minimize`; the same again, or `/plan expand`, brings the rows back. Minimized, a card keeps its label and its progress counter (`Subagents 7/10`), so a ten-task fan-out costs one row instead of ten and the rest of the terminal goes back to the transcript. `/plan expand` and `/plan collapse` keep their meaning (unfold and re-fold the completed rows the card windows away); clicking the card's _body_ still does the same, and the hints now say which surface does which.\n- Reopening a conversation whose subagents and plan are all finished now opens both pinned cards minimized to their header row (`▸ ✔ Subagents 4/4`, `▸ Plan 5/5`) instead of spending up to ten rows above the composer on finished work. A card that opens this way pops back open by itself the moment new work goes live in that conversation (a fresh fan-out, a new in-progress step); a card you minimized yourself stays minimized, as before. Work still running when you open the conversation shows its rows, exactly as it did.\n\n- The chat TUI status bar now always shows where the portal stands, instead of only lighting up once everything already worked. It reads `portal off`, `portal connecting`, `portal on` (open on this machine, but this agent has no grant), `portal shared` (green — this agent can run commands here), `portal error`, or `portal unavailable` when you signed in with an API key and no portal is possible. Previously the badge rendered nothing in every one of those states, so \"why can't the agent reach my machine?\" had no answer on screen.\n- One word for that feature across the whole CLI: **portal**. The footer hint is now `ctrl+t portal` / `ctrl+t close portal` (was `local access` / `revoke access`), `/status` reports a `portal` row (was `local access`), and `/share` and `/portal` describe themselves as opening the portal and granting an agent access to your machine. `/portal` used to say \"access your computer\", which collided with `/computer` — that command still means the **agent's** sandbox, and \"computer\" stays reserved for it. `--share-machine` and the `shareMachineDefault` config key are unchanged.\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- `skydive agents git token` — create, list, and revoke git-proxy tokens for an agent's repo from your machine. `agents git token create <agent>` prints a read_write token plus the tokenless remote URL (the same routes the web settings page uses); `… git token list <agent>` shows the agent's tokens by id, and `… git token revoke <agent> <token-id>` revokes one. The command's job ends at the credential: it writes nothing to git on your machine, so what to do with the token (credential store, remote URLs) stays with whatever tooling you already pipe credentials through. `auth login` now points at it for laptop git setup.\n- Files an agent shares into the conversation now show as a saveable row in the chat TUI. When the agent sends you a file (a report, an export, a screenshot), it appears as a `📎` row with the filename and size and a \"click to save\" hint; clicking it downloads the file to your `~/Downloads` (falling back to your home directory) and opens it with your default app, then the row shows where it landed. Clicking a saved row again re-opens it. Previously these files were only reachable in the web app — in the terminal they were invisible.\n- `platform ask` forms now render in the chat TUI. The card lists each question with lettered options (A/B/C/D plus Other); `ctrl+r` opens a full overlay picker (one question at a time, arrows + enter, Other as a typed row — the Claude Code interaction). The answer sends as a normal message. Headless `chat -p` prints the question as an `[action needed]` block instead of dropping it.\n- Every API request now reports this install's version (`x-skydive-cli-version`) so the server can refuse features the installed CLI cannot render — `platform ask` needs the #21411 canary (`0.5.0-beta.43` or newer), not 0.4.0 and not earlier 0.5.0 betas.\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` 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- `/computer restart` in the chat TUI — reboot the agent's sandbox from chat. It asks a `y`/`n` confirm first (the restart stops whatever run is going and brings up a fresh box), then enqueues the same restart the web \"Restart\" control does. Available to anyone with edit access to the agent; view-only members are told they can't.\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";
|
|
4739
5212
|
|
|
4740
5213
|
//#endregion
|
|
4741
5214
|
//#region src/whats-new.ts
|
|
@@ -4878,7 +5351,7 @@ if (process.argv.includes(UPDATE_WORKER_FLAG)) {
|
|
|
4878
5351
|
process.exit(0);
|
|
4879
5352
|
}
|
|
4880
5353
|
if (process.argv.includes(PORTAL_DAEMON_FLAG)) {
|
|
4881
|
-
const { runPortalDaemon } = await import("./daemon-
|
|
5354
|
+
const { runPortalDaemon } = await import("./daemon-Dr2kCY9V.mjs");
|
|
4882
5355
|
runPortalDaemon(process.argv);
|
|
4883
5356
|
} else runCli();
|
|
4884
5357
|
function runCli() {
|