skydive-cli 0.5.0-beta.36 → 0.5.0-beta.41
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 +2 -1
- package/dist/js/bin.mjs +21 -21
- package/dist/js/{boot-CmInaUwJ.mjs → boot-B1Y1D48W.mjs} +140 -33
- package/dist/js/client-DCwVlAal.mjs +5 -0
- package/dist/js/{client-d6K9qm6B.mjs → client-DMYwKALl.mjs} +74 -8
- package/dist/js/{daemon-Dg89tpOE.mjs → daemon-By-I_HVM.mjs} +2 -2
- package/dist/js/{daemon-CH95gDij.mjs → daemon-D8WoX21I.mjs} +2 -2
- package/dist/js/{daemon-client-BNDnEGw6.mjs → daemon-client-Bp5DMeIi.mjs} +1 -1
- package/dist/js/daemon-client-_SVAskeO.mjs +8 -0
- package/dist/js/{install-aZ751iYf.mjs → install-BkMcGVYS.mjs} +2 -2
- package/dist/js/{print-DV9L41G2.mjs → print-BAmEefvX.mjs} +2 -2
- package/dist/js/{print-h22UbIfZ.mjs → print-CwbdwCeQ.mjs} +1 -1
- package/dist/js/{print-share-BBy3OTno.mjs → print-share-azWHVxpt.mjs} +1 -1
- package/dist/js/{rest-v-7FQqLP.mjs → rest-B5DVQ1LM.mjs} +1 -1
- package/dist/js/{rest-ClVPZquN.mjs → rest-Bbe-RhMy.mjs} +19 -4
- package/package.json +5 -5
- package/dist/js/client-yz3zrpAS.mjs +0 -5
- package/dist/js/daemon-client-CC9sxWac.mjs +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -15,7 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
15
|
|
|
16
16
|
- `/search` (alias `/find`) in the chat TUI — opens the conversation picker with its search field focused, so "find a conversation" has a discoverable command instead of being a feature you had to know the bare picker already had. Pass a query inline (`/search billing deep dive`) and the picker opens already narrowed to the matches; bare `/search` opens it ready for you to type. The search runs server-side across conversation titles, message bodies, and participant names, the same search the picker exposes.
|
|
17
17
|
- 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.
|
|
18
|
-
- `/computer`
|
|
18
|
+
- `/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.
|
|
19
|
+
- `/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.
|
|
19
20
|
- `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.)
|
|
20
21
|
|
|
21
22
|
## [0.4.0] - 2026-08-07
|
package/dist/js/bin.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as installAgentAlias, B as resolveWorkspaceId, D as machineOsFromPlatform, E as buildImportSeedPrompt, F as detectShell, H as name, I as ensureActiveOrganization, L as getActiveWorkspaceId, M as takenAliasNames, N as SUPPORTED_SHELLS, O as aliasActivationHint, P as defaultInstallEnv, R as getSessionIdentity, U as version, V as setActiveWorkspace, c as getAutomaticLogsDir, j as slugifyAliasName, k as dedupeAliasName, l as maybeStartProfiling, o as brandHelpArt, t as installCrashHandler, u as profileDir, w as themes, z as listWorkspaces } from "./install-
|
|
3
|
-
import { A as getShareMachineDefault, C as getConfigPath, D as getPromptHistoryPath, E as getPreference, F as resolveAppUrl, H as saveSession, I as resolveChatAuth, L as resolveConfig, M as getStoredApiKeyWorkspaceName, N as getUpdateCheckDisabled, R as resolveManagementAuth, S as deleteConfig, T as getLastSeenVersion, V as saveConfig, W as setLastSeenVersion, _ as API_KEY_FAMILY_PREFIX, g as API_KEYS_URL, i as resolveAgent$1, j as getStoredApiKeyId, v as API_KEY_PREFIX, w as getDefaultAgent, x as PREFERENCES, y as DEFAULT_API_URL, z as resolveSession$1 } from "./print-
|
|
2
|
+
import { A as installAgentAlias, B as resolveWorkspaceId, D as machineOsFromPlatform, E as buildImportSeedPrompt, F as detectShell, H as name, I as ensureActiveOrganization, L as getActiveWorkspaceId, M as takenAliasNames, N as SUPPORTED_SHELLS, O as aliasActivationHint, P as defaultInstallEnv, R as getSessionIdentity, U as version, V as setActiveWorkspace, c as getAutomaticLogsDir, j as slugifyAliasName, k as dedupeAliasName, l as maybeStartProfiling, o as brandHelpArt, t as installCrashHandler, u as profileDir, w as themes, z as listWorkspaces } from "./install-BkMcGVYS.mjs";
|
|
3
|
+
import { A as getShareMachineDefault, C as getConfigPath, D as getPromptHistoryPath, E as getPreference, F as resolveAppUrl, H as saveSession, I as resolveChatAuth, L as resolveConfig, M as getStoredApiKeyWorkspaceName, N as getUpdateCheckDisabled, R as resolveManagementAuth, S as deleteConfig, T as getLastSeenVersion, V as saveConfig, W as setLastSeenVersion, _ as API_KEY_FAMILY_PREFIX, g as API_KEYS_URL, i as resolveAgent$1, j as getStoredApiKeyId, v as API_KEY_PREFIX, w as getDefaultAgent, x as PREFERENCES, y as DEFAULT_API_URL, z as resolveSession$1 } from "./print-CwbdwCeQ.mjs";
|
|
4
4
|
import { n as printError, r as printTable, t as output } from "./output-wY0VQDea.mjs";
|
|
5
5
|
import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
|
|
6
|
-
import { t as createRestClient } from "./rest-
|
|
6
|
+
import { t as createRestClient } from "./rest-Bbe-RhMy.mjs";
|
|
7
7
|
import "./billing-blocked-D3l5kJlX.mjs";
|
|
8
|
-
import { r as resolveMachineIdentity } from "./client-
|
|
9
|
-
import { i as queryDaemonStatus, l as PORTAL_DAEMON_FLAG, n as ensureDaemonRunning, s as stopDaemon, u as daemonPaths } from "./daemon-
|
|
8
|
+
import { r as resolveMachineIdentity } from "./client-DMYwKALl.mjs";
|
|
9
|
+
import { i as queryDaemonStatus, l as PORTAL_DAEMON_FLAG, n as ensureDaemonRunning, s as stopDaemon, u as daemonPaths } from "./daemon-D8WoX21I.mjs";
|
|
10
10
|
import "./tls-cert-CV-pwxVN.mjs";
|
|
11
11
|
import { i as grantPortalAccess, n as fetchPortalDevices, o as registerPortalDevice, r as findThisDevice, s as revokePortalAccess } from "./api-DQCaztBg.mjs";
|
|
12
12
|
import { a as encodeFsRequest, i as decodeFsResponse, n as SANDBOX_STREAM_PATH, r as streamSpecToQuery, t as SandboxStream } from "./client-Btq6bMzX.mjs";
|
|
@@ -1586,7 +1586,7 @@ const importCommand = {
|
|
|
1586
1586
|
process.exit(1);
|
|
1587
1587
|
}
|
|
1588
1588
|
}
|
|
1589
|
-
const { runChat } = await import("./boot-
|
|
1589
|
+
const { runChat } = await import("./boot-B1Y1D48W.mjs");
|
|
1590
1590
|
await runChat({
|
|
1591
1591
|
appUrl,
|
|
1592
1592
|
sessionToken: session.value.sessionToken,
|
|
@@ -1616,7 +1616,7 @@ async function runImportPrintMode({ argv, appUrl }) {
|
|
|
1616
1616
|
printError(`${session.error.message} For non-interactive use, run \`skydive auth login --web\` first, or set SKYDIVE_SESSION_TOKEN.`);
|
|
1617
1617
|
process.exit(1);
|
|
1618
1618
|
}
|
|
1619
|
-
const { connectMachineShare } = await import("./print-share-
|
|
1619
|
+
const { connectMachineShare } = await import("./print-share-azWHVxpt.mjs");
|
|
1620
1620
|
const machineShare = await connectMachineShare({
|
|
1621
1621
|
appUrl,
|
|
1622
1622
|
sessionToken: session.value.sessionToken,
|
|
@@ -1624,7 +1624,7 @@ async function runImportPrintMode({ argv, appUrl }) {
|
|
|
1624
1624
|
});
|
|
1625
1625
|
const extra = (argv.print ?? "").trim();
|
|
1626
1626
|
const prompt = buildImportSeedPrompt(process.cwd(), machineOsFromPlatform(process.platform)) + (extra ? `\n\nAdditional instructions: ${extra}` : "");
|
|
1627
|
-
const { runPrint } = await import("./print-
|
|
1627
|
+
const { runPrint } = await import("./print-BAmEefvX.mjs");
|
|
1628
1628
|
try {
|
|
1629
1629
|
const result = await runPrint({
|
|
1630
1630
|
appUrl,
|
|
@@ -2031,7 +2031,7 @@ const chatCommand = {
|
|
|
2031
2031
|
sessionToken: auth.value.token,
|
|
2032
2032
|
agentSelector: argv.agent ?? null
|
|
2033
2033
|
});
|
|
2034
|
-
const { runChat } = await import("./boot-
|
|
2034
|
+
const { runChat } = await import("./boot-B1Y1D48W.mjs");
|
|
2035
2035
|
await runChat({
|
|
2036
2036
|
appUrl: auth.value.appUrl,
|
|
2037
2037
|
sessionToken: auth.value.token,
|
|
@@ -2115,7 +2115,7 @@ async function runPrintMode({ argv, appUrl }) {
|
|
|
2115
2115
|
printError(`${auth.error.message} For non-interactive use, run \`skydive auth login\` first, or set SKYDIVE_API_KEY / SKYDIVE_SESSION_TOKEN.`);
|
|
2116
2116
|
process.exit(1);
|
|
2117
2117
|
}
|
|
2118
|
-
const { runPrint, readStdin } = await import("./print-
|
|
2118
|
+
const { runPrint, readStdin } = await import("./print-BAmEefvX.mjs");
|
|
2119
2119
|
const workspaceId = await resolveWorkspaceFlag({
|
|
2120
2120
|
appUrl,
|
|
2121
2121
|
sessionToken: auth.value.token,
|
|
@@ -2145,7 +2145,7 @@ async function runPrintMode({ argv, appUrl }) {
|
|
|
2145
2145
|
process.exit(1);
|
|
2146
2146
|
}
|
|
2147
2147
|
} else {
|
|
2148
|
-
const { connectMachineShare } = await import("./print-share-
|
|
2148
|
+
const { connectMachineShare } = await import("./print-share-azWHVxpt.mjs");
|
|
2149
2149
|
machineShare = await connectMachineShare({
|
|
2150
2150
|
appUrl: auth.value.appUrl,
|
|
2151
2151
|
sessionToken: auth.value.token,
|
|
@@ -2210,7 +2210,7 @@ const getCommand$1 = {
|
|
|
2210
2210
|
printError(`${auth.error.message} Run \`skydive auth login\` first, or set SKYDIVE_API_KEY / SKYDIVE_SESSION_TOKEN.`);
|
|
2211
2211
|
process.exit(1);
|
|
2212
2212
|
}
|
|
2213
|
-
const { messageGet } = await import("./print-
|
|
2213
|
+
const { messageGet } = await import("./print-BAmEefvX.mjs");
|
|
2214
2214
|
try {
|
|
2215
2215
|
const result = await messageGet({
|
|
2216
2216
|
appUrl: auth.value.appUrl,
|
|
@@ -2326,7 +2326,7 @@ const showCommand = {
|
|
|
2326
2326
|
console.log(recap ?? "(no recap available)");
|
|
2327
2327
|
return;
|
|
2328
2328
|
}
|
|
2329
|
-
const messages = await client.listMessages({ conversationId });
|
|
2329
|
+
const { messages } = await client.listMessages({ conversationId });
|
|
2330
2330
|
if (argv.json) {
|
|
2331
2331
|
output(argv, messages);
|
|
2332
2332
|
return;
|
|
@@ -2413,7 +2413,7 @@ const switchCommand = {
|
|
|
2413
2413
|
printError("The workspace picker needs the Bun runtime and it could not be set up automatically. Pass a workspace slug instead, or install Bun and retry.");
|
|
2414
2414
|
process.exit(1);
|
|
2415
2415
|
}
|
|
2416
|
-
const { runWorkspacePicker } = await import("./boot-
|
|
2416
|
+
const { runWorkspacePicker } = await import("./boot-B1Y1D48W.mjs");
|
|
2417
2417
|
await runWorkspacePicker(session);
|
|
2418
2418
|
return;
|
|
2419
2419
|
}
|
|
@@ -2492,7 +2492,7 @@ const openCommand = {
|
|
|
2492
2492
|
const agent = argv.agent ? resolveAgent$1((await fetchPortalDevices(session)).agents, argv.agent) : null;
|
|
2493
2493
|
const cwd = argv.cwd ? path.resolve(argv.cwd) : process.cwd();
|
|
2494
2494
|
const { machineName } = await resolveMachineIdentity(null);
|
|
2495
|
-
const { PortalDaemonClient } = await import("./daemon-client-
|
|
2495
|
+
const { PortalDaemonClient } = await import("./daemon-client-_SVAskeO.mjs");
|
|
2496
2496
|
let lastLine = "";
|
|
2497
2497
|
let signalConnected;
|
|
2498
2498
|
const connected = new Promise((resolve) => {
|
|
@@ -2806,8 +2806,8 @@ const sandboxCommand = {
|
|
|
2806
2806
|
}).example("skydive sandbox --agent grace", "Live terminal (Ctrl-] detaches)").example("skydive sandbox --agent grace -- tail -n 50 /tmp/harness.log", "One-shot command (use `--` so its flags reach the sandbox)").example("skydive sandbox --agent grace -- sh -c 'ls /tmp | wc -l'", "Shell features go through an explicit `sh -c`"),
|
|
2807
2807
|
handler: async (argv) => {
|
|
2808
2808
|
const session = requireSession(argv);
|
|
2809
|
-
const { createRestClient } = await import("./rest-
|
|
2810
|
-
const { resolveAgent } = await import("./print-
|
|
2809
|
+
const { createRestClient } = await import("./rest-B5DVQ1LM.mjs");
|
|
2810
|
+
const { resolveAgent } = await import("./print-BAmEefvX.mjs");
|
|
2811
2811
|
const client = createRestClient({
|
|
2812
2812
|
appUrl: session.appUrl,
|
|
2813
2813
|
sessionToken: session.sessionToken
|
|
@@ -3075,8 +3075,8 @@ const fsEditCommand = {
|
|
|
3075
3075
|
handler: async (argv) => {
|
|
3076
3076
|
const session = requireSession(argv);
|
|
3077
3077
|
const remotePath = argv.path;
|
|
3078
|
-
const { createRestClient } = await import("./rest-
|
|
3079
|
-
const { resolveAgent } = await import("./print-
|
|
3078
|
+
const { createRestClient } = await import("./rest-B5DVQ1LM.mjs");
|
|
3079
|
+
const { resolveAgent } = await import("./print-BAmEefvX.mjs");
|
|
3080
3080
|
const client = createRestClient({
|
|
3081
3081
|
appUrl: session.appUrl,
|
|
3082
3082
|
sessionToken: session.sessionToken
|
|
@@ -4403,7 +4403,7 @@ function setupUpdateCheck(argv) {
|
|
|
4403
4403
|
|
|
4404
4404
|
//#endregion
|
|
4405
4405
|
//#region src/changelog.generated.ts
|
|
4406
|
-
const CHANGELOG_MD = "# Changelog\n\nAll notable changes to the Skydive CLI are documented here.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n### Changed\n\n- `npm i -g skydive-cli` (and yarn/pnpm/bun) now installs a tiny launcher plus one prebuilt, os/cpu-matched binary that carries its own runtime — so on the common platforms `skydive chat` and `skydive import` start instantly and **do not download a Bun runtime on first use**. On any platform without a prebuilt binary (or if the optional dependency is skipped), the CLI automatically falls back to the existing behavior: it runs under your Node and provisions Bun on first `chat`, exactly as before. Nothing about the commands, flags, config, or `SKYDIVE_*` environment variables changes, and `skydive update` still upgrades npm installs via your package manager and standalone-binary installs in place.\n\n### Added\n\n- `/search` (alias `/find`) in the chat TUI — opens the conversation picker with its search field focused, so \"find a conversation\" has a discoverable command instead of being a feature you had to know the bare picker already had. Pass a query inline (`/search billing deep dive`) and the picker opens already narrowed to the matches; bare `/search` opens it ready for you to type. The search runs server-side across conversation titles, message bodies, and participant names, the same search the picker exposes.\n- First run in a workspace with no agents now sets you up automatically: instead of dropping you on an empty agent picker, `skydive` creates your first agent for you (with a suggested name and avatar, mirroring the web onboarding flow) and then offers to have it learn how you already work — reading the other coding agents set up on your machine (Claude Code, Cursor, Codex, and more), the same import that `skydive import` runs, with a plan shown first and credentials never copied. Decline and you go straight into the new agent's chat. You can replay this flow anytime with `skydive --onboarding` (or `SKYDIVE_FORCE_ONBOARDING=1`), even in a workspace that already has agents.\n- `/computer` (alias `/stats`) in the chat TUI — a snapshot of the agent's sandbox drawn as colored bar graphs: CPU, memory, and disk usage. Bars turn amber past 75%% and red past 90%% so a glance tells you whether the box is under pressure. The numbers come from the Skydive API (the same live resource sample the web computer view reads), not by connecting to the sandbox — so the card shows instantly, never waking or hanging on a box that isn't running: when the agent has no live sandbox it simply reads \"no sandbox running\". The card keeps itself current quietly (a slow background refresh, no flicker or \"updating\" chrome); only the most recent card refreshes, and it silently stops while you're scrolled up (no wasted polls on a card you're not looking at) and resumes at the bottom.\n- `skydive fs` — a namespace for working with the files on an agent's computer (its sandbox) from your own machine. Its first subcommand, `skydive fs edit <path>`, reads a remote file down over the same relay `skydive sandbox` uses, opens it in your local editor (`$VISUAL`/`$EDITOR`, override with `--editor`, defaults to `vi`), and writes your changes back atomically when you save and close — so you can edit a remote file as if it were local without opening the chat TUI. A path that doesn't exist yet is created on save; no changes means nothing is written. Access is gated on EDIT permission for the agent, exactly like `skydive sandbox`. (A first-class `fs` relay channel and `skydive fs mount` land in follow-ups.)\n\n## [0.4.0] - 2026-08-07\n\n### Added\n\n- `skydive chat` works with API key auth: an API key alone now opens the chat TUI (and headless `chat -p`) without a browser login, using the key's pinned workspace.\n- `skydive config` command to view and set the safe, hand-editable CLI preferences (`shareMachineDefault`, `updateCheck`) without opening `config.json`. `config`/`config list` shows each key, its effective value, and whether it comes from the file or the built-in default; `config get`/`set`/`unset` read and change one key; `config path` prints the config file location. It only ever touches those preference keys, never credentials or flow-managed state.\n- Billing-blocked sends and runs now surface the server-authored recovery\n guidance from the typed billing outcome. The chat TUI renders it as a\n warning-toned system-notice row — live when a send is refused or a run is\n stopped at the billing boundary, and again when reopening a conversation\n that holds a persisted billing notice — instead of a generic error.\n Headless `chat -p` and `messages get` print the guidance (state, recovery\n step, and manage-billing URL) on stderr, keep any partial output already\n streamed on stdout, and exit with code `5` (distinct from the generic `1`)\n so scripted callers can tell a billing pause from a failure.\n- Syntax highlighting for 14 more languages in the chat transcript and file/review panes (python, bash, go, rust, c, cpp, java, ruby, css, html, json, yaml, and more) — previously only JavaScript/TypeScript rendered colored.\n\n### Changed\n\n- `skydive agent list` lists the full agent roster by default instead of a truncated page.\n\n### Fixed\n\n- Long multi-line bash tool-call commands (e.g. heredocs) are clamped with a `+N more · click to expand` tail instead of dumping their whole body into the scrollback.\n- Tool error output is clipped the same way as ok output, so a failing command no longer floods the transcript.\n- The TUI toast overlay has an opaque background instead of letting the transcript bleed through.\n\n## [0.3.0] - 2026-08-04\n\n### Added\n\n**Chat TUI**\n\n- `/fork` slash command to fork a conversation at any point and continue in a new thread.\n- `/conversation` switches threads from inside a live session.\n- `/compact` triggers manual conversation compaction.\n- `/portal` and `/copy` slash commands.\n- Archive the current conversation from the chat TUI.\n- `--new` flag on `skydive chat` to start a fresh conversation.\n- Debounced server-side conversation search in the picker, with title matches ranked first.\n- File review pane orientation toggle, and review comments in the file pane.\n- Pinned plan card controls and a jump-to-latest hint.\n- Terminal title (OSC) follows the live conversation title on every screen; inside cmux the workspace is renamed too, and linked PRs are pushed to the cmux sidebar.\n- Every participating agent shows in the conversation list; connect cards each have their own identity, and ctrl+r asks which connect card to act on.\n- Colored Skydive splash art in `skydive --help` and the TUI pickers.\n- New-agent name prefilled from the server's suggestion.\n\n**CLI & platform**\n\n- `skydive update` self-updater, with an update notice when a new version is available.\n- Shell completions for bash, zsh, and fish via `completion install`.\n- Portal daemon: one connection per host with per-conversation working directories.\n- Agent-led coding-agent import (`skydive import`).\n- Per-workspace scoping on the REST client, and cross-org `--agent <uuid>` auto-switches workspace.\n- `skydive-beta` wrapper for the canary channel.\n\n### Fixed\n\n- `skydive update` no longer claims an update is available on every npm install.\n- Chat memory is bounded (payload clamps + windowed rows) with a memory watchdog and OOM diagnostic report; transcript rows are memoized so streaming stops re-rendering the whole chat.\n- Chat-send failures map to real error messages.\n- Notification and sidebar previews use the last text block of the reply and strip inline markdown.\n- Picker rows no longer overlap when a conversation title contains a newline, tab, or control character.\n- Sending to non-web channel conversations is blocked in the TUI.\n- GitHub bot connect opens on the web front door, not api.skydive.com.\n- TUI activity counter times from the run, not the screen.\n\n## [0.2.0] - 2026-07-29\n\n### Added\n\n**Sandbox & machine access**\n\n- Standalone `skydive sandbox` command for direct access to an agent's sandbox.\n- `/sandbox` in the chat TUI — live PTY session and one-shot command execution.\n- Headless machine sharing via `skydive portal`, with self-registering portal grants.\n- `shareMachineDefault` config key for always-on portal sharing.\n\n**Chat TUI**\n\n- File pane (`ctrl+g`) with Changes and Files tabs: a shared file tree plus source viewer and a workspace browser, mouse-resizable and responsive to terminal size.\n- Agent todo list rendered in the chat TUI, above the composer, mirroring the web chat's todo card.\n- Fuzzy finder in the conversation and agent pickers.\n- Slash-command autocomplete menu.\n- Paste or drag-and-drop any file into the composer; paste clipboard images with Cmd+V.\n- Run local shell commands with `!` in the composer.\n- Conversation recaps, streamed live title updates, and per-agent attribution on assistant turns.\n- Working timer rolls up into minutes and hours.\n- Conversation picker paginates past 50 conversations and shows only your own conversations.\n- Esc leaves a live run; typing `exit` quits the chat.\n- Cursor Dark theme.\n- Picker rows no longer overlap when a conversation title contains a newline, tab, or control character.\n\n**Headless & scripting**\n\n- Resume a conversation by id.\n- `conversations list` and `conversations show` for transcript reads.\n- `messages get`, with run recovery keyed on message id.\n- Connect cards surface in headless `-p` mode so a driving agent never gets stuck.\n\n**Authentication**\n\n- `skydive auth login` via the browser now auto-mints an API key, so one login yields both a chat session and a usable management credential. Management commands announce the key's pinned workspace when it drives them, so a workspace mismatch is visible at use time.\n- Workspace picker on the device authorization page.\n- Account and workspace identity shown in `auth status`.\n\n**Platform**\n\n- Standalone binary builds compiling the CLI into a per-target executable.\n- Interactive workspace switcher; management commands follow the active workspace.\n- Terminal host integrations and agent notifications.\n\n### Fixed\n\n- Transcript errors collapse to one line, click to expand (REST and portal errors keep their full body).\n- Dragged/pasted image file paths attach the file instead of inserting path text, including macOS paths with literal parentheses.\n- Bare URLs in chat markdown are hyperlinked so they survive text wrap.\n- Composer draft is preserved across TUI overlays.\n- Relative connect links resolve before opening the browser.\n- Numbered markdown headings render colored in the TUI.\n- Chat transcript pages by 75% of a screen; picker rows stay on one line.\n- Run starts push to the TUI over the conversation stream.\n- Security: remediated high-severity dependency findings and cleared tar/shell-quote CVEs.\n\n## [0.1.0] - 2026-07-21\n\nInitial public release: `skydive chat` TUI, agent and conversation management,\ndevice authorization, and headless `-p` mode.\n";
|
|
4406
|
+
const CHANGELOG_MD = "# Changelog\n\nAll notable changes to the Skydive CLI are documented here.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n### Changed\n\n- `npm i -g skydive-cli` (and yarn/pnpm/bun) now installs a tiny launcher plus one prebuilt, os/cpu-matched binary that carries its own runtime — so on the common platforms `skydive chat` and `skydive import` start instantly and **do not download a Bun runtime on first use**. On any platform without a prebuilt binary (or if the optional dependency is skipped), the CLI automatically falls back to the existing behavior: it runs under your Node and provisions Bun on first `chat`, exactly as before. Nothing about the commands, flags, config, or `SKYDIVE_*` environment variables changes, and `skydive update` still upgrades npm installs via your package manager and standalone-binary installs in place.\n\n### Added\n\n- `/search` (alias `/find`) in the chat TUI — opens the conversation picker with its search field focused, so \"find a conversation\" has a discoverable command instead of being a feature you had to know the bare picker already had. Pass a query inline (`/search billing deep dive`) and the picker opens already narrowed to the matches; bare `/search` opens it ready for you to type. The search runs server-side across conversation titles, message bodies, and participant names, the same search the picker exposes.\n- First run in a workspace with no agents now sets you up automatically: instead of dropping you on an empty agent picker, `skydive` creates your first agent for you (with a suggested name and avatar, mirroring the web onboarding flow) and then offers to have it learn how you already work — reading the other coding agents set up on your machine (Claude Code, Cursor, Codex, and more), the same import that `skydive import` runs, with a plan shown first and credentials never copied. Decline and you go straight into the new agent's chat. You can replay this flow anytime with `skydive --onboarding` (or `SKYDIVE_FORCE_ONBOARDING=1`), even in a workspace that already has agents.\n- `/computer` 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";
|
|
4407
4407
|
|
|
4408
4408
|
//#endregion
|
|
4409
4409
|
//#region src/whats-new.ts
|
|
@@ -4546,7 +4546,7 @@ if (process.argv.includes(UPDATE_WORKER_FLAG)) {
|
|
|
4546
4546
|
process.exit(0);
|
|
4547
4547
|
}
|
|
4548
4548
|
if (process.argv.includes(PORTAL_DAEMON_FLAG)) {
|
|
4549
|
-
const { runPortalDaemon } = await import("./daemon-
|
|
4549
|
+
const { runPortalDaemon } = await import("./daemon-By-I_HVM.mjs");
|
|
4550
4550
|
runPortalDaemon(process.argv);
|
|
4551
4551
|
} else runCli();
|
|
4552
4552
|
function runCli() {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as installAgentAlias, C as themeVersion, D as machineOsFromPlatform, F as detectShell, L as getActiveWorkspaceId, M as takenAliasNames, O as aliasActivationHint, S as themeModeFromColorFgBg, T as themesForMode, V as setActiveWorkspace, _ as monoTheme, a as WORDMARK, b as themeForMode, d as profilingEnabled, f as record, g as findTheme, h as applyTheme, i as MARK_CELLS, j as slugifyAliasName, k as dedupeAliasName, m as DEFAULT_THEME_ID, n as buildCrashReport, p as writeArtifact, r as writeCrashReport, s as splashFitsWidth, t as installCrashHandler, v as noColorRequested, x as themeMode, y as theme, z as listWorkspaces } from "./install-
|
|
3
|
-
import { B as resolveWebUrl, C as getConfigPath, O as getReviewStateDir, P as recordDefaultAgent, U as saveTheme, b as DEFAULT_APP_URL, c as cardActionErrorMessage, d as reconcileMaskedInput, f as resolveConnectUrl, h as specKeyFor, i as resolveAgent, k as getSavedTheme, l as parseExternalOauthConnectParams, m as parseConnectCard, p as computeSettledLabel, s as MASK_CHAR, u as parseOauthConnectParams, y as DEFAULT_API_URL } from "./print-
|
|
2
|
+
import { A as installAgentAlias, C as themeVersion, D as machineOsFromPlatform, F as detectShell, L as getActiveWorkspaceId, M as takenAliasNames, O as aliasActivationHint, S as themeModeFromColorFgBg, T as themesForMode, V as setActiveWorkspace, _ as monoTheme, a as WORDMARK, b as themeForMode, d as profilingEnabled, f as record, g as findTheme, h as applyTheme, i as MARK_CELLS, j as slugifyAliasName, k as dedupeAliasName, m as DEFAULT_THEME_ID, n as buildCrashReport, p as writeArtifact, r as writeCrashReport, s as splashFitsWidth, t as installCrashHandler, v as noColorRequested, x as themeMode, y as theme, z as listWorkspaces } from "./install-BkMcGVYS.mjs";
|
|
3
|
+
import { B as resolveWebUrl, C as getConfigPath, O as getReviewStateDir, P as recordDefaultAgent, U as saveTheme, b as DEFAULT_APP_URL, c as cardActionErrorMessage, d as reconcileMaskedInput, f as resolveConnectUrl, h as specKeyFor, i as resolveAgent, k as getSavedTheme, l as parseExternalOauthConnectParams, m as parseConnectCard, p as computeSettledLabel, s as MASK_CHAR, u as parseOauthConnectParams, y as DEFAULT_API_URL } from "./print-CwbdwCeQ.mjs";
|
|
4
4
|
import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
|
|
5
|
-
import { a as isRecord, i as errorMessage, n as errorDetail, r as sendErrorMessage, t as createRestClient } from "./rest-
|
|
5
|
+
import { a as isRecord, i as errorMessage, n as errorDetail, r as sendErrorMessage, t as createRestClient } from "./rest-Bbe-RhMy.mjs";
|
|
6
6
|
import { i as billingBlockedOutcomeFromSendResponse } from "./billing-blocked-D3l5kJlX.mjs";
|
|
7
|
-
import { t as PortalClient } from "./client-
|
|
8
|
-
import "./daemon-
|
|
7
|
+
import { t as PortalClient } from "./client-DMYwKALl.mjs";
|
|
8
|
+
import "./daemon-D8WoX21I.mjs";
|
|
9
9
|
import { t as defaultTlsCertSource } from "./tls-cert-CV-pwxVN.mjs";
|
|
10
10
|
import "./api-DQCaztBg.mjs";
|
|
11
11
|
import { t as SandboxStream } from "./client-Btq6bMzX.mjs";
|
|
12
|
-
import { t as PortalDaemonClient } from "./daemon-client-
|
|
12
|
+
import { t as PortalDaemonClient } from "./daemon-client-Bp5DMeIi.mjs";
|
|
13
13
|
import { t as runRawPtyPassthrough } from "./raw-pty-D5PhKZSl.mjs";
|
|
14
14
|
import * as os$1 from "node:os";
|
|
15
15
|
import { homedir, platform, release, tmpdir } from "node:os";
|
|
@@ -7304,9 +7304,14 @@ const MAX_NOTIFICATION_PREVIEW_CHARS = 240;
|
|
|
7304
7304
|
* preview: emphasis, inline code, links/images, headings, blockquotes, and
|
|
7305
7305
|
* list bullets. Block structure is already gone by the time we preview (we
|
|
7306
7306
|
* collapse whitespace to a single line).
|
|
7307
|
+
*
|
|
7308
|
+
* Underscore emphasis follows CommonMark's intra-word rule: `_` is only an
|
|
7309
|
+
* emphasis delimiter at a word boundary, so an identifier such as
|
|
7310
|
+
* `SANDBOX_MAX_CONCURRENT_CREATES` keeps its underscores instead of being
|
|
7311
|
+
* mangled into `SANDBOXMAXCONCURRENTCREATES`. Asterisks stay permissive.
|
|
7307
7312
|
*/
|
|
7308
7313
|
function stripInlineMarkdown(input) {
|
|
7309
|
-
return input.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/`([^`]+)`/g, "$1").replace(/(
|
|
7314
|
+
return input.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/`([^`]+)`/g, "$1").replace(/(\*\*\*|\*\*|\*)(?=\S)(.*?\S)\1/g, "$2").replace(/(\*\*\*|\*\*|\*)(?=\S)(.*?\S)\1/g, "$2").replace(/(?<!\w)(___|__|_)(?=\S)(.*?\S)\1(?!\w)/g, "$2").replace(/(?<!\w)(___|__|_)(?=\S)(.*?\S)\1(?!\w)/g, "$2").replace(/~~(?=\S)(.*?\S)~~/g, "$1").replace(/^\s{0,3}#{1,6}\s+/gm, "").replace(/^\s{0,3}>\s?/gm, "").replace(/^\s{0,3}(?:[-*+]|\d+\.)\s+/gm, "");
|
|
7310
7315
|
}
|
|
7311
7316
|
/**
|
|
7312
7317
|
* Collects assistant `text-delta` chunks for one run and turns them into a
|
|
@@ -8215,9 +8220,9 @@ const slashCommands = [
|
|
|
8215
8220
|
},
|
|
8216
8221
|
{
|
|
8217
8222
|
name: "computer",
|
|
8218
|
-
aliases: [
|
|
8219
|
-
argsHint:
|
|
8220
|
-
description: "show the agent sandbox's cpu
|
|
8223
|
+
aliases: [],
|
|
8224
|
+
argsHint: "[restart]",
|
|
8225
|
+
description: "show the agent sandbox's cpu/memory/disk (restart: reboot it)",
|
|
8221
8226
|
action: { kind: "computer" }
|
|
8222
8227
|
},
|
|
8223
8228
|
{
|
|
@@ -11709,6 +11714,7 @@ function routeInput(raw) {
|
|
|
11709
11714
|
kind: "rename-conversation",
|
|
11710
11715
|
title: match.rest
|
|
11711
11716
|
};
|
|
11717
|
+
case "computer": return match.rest.toLowerCase() === "restart" ? { kind: "computer-restart" } : { kind: "computer" };
|
|
11712
11718
|
case "plan": {
|
|
11713
11719
|
const arg = match.rest.toLowerCase();
|
|
11714
11720
|
return {
|
|
@@ -11724,7 +11730,6 @@ function routeInput(raw) {
|
|
|
11724
11730
|
case "theme-picker":
|
|
11725
11731
|
case "pr-picker":
|
|
11726
11732
|
case "status":
|
|
11727
|
-
case "computer":
|
|
11728
11733
|
case "share":
|
|
11729
11734
|
case "browser":
|
|
11730
11735
|
case "connect":
|
|
@@ -11825,6 +11830,16 @@ const composerKeyBindings = [
|
|
|
11825
11830
|
* keep your place instead of landing on entirely unfamiliar text.
|
|
11826
11831
|
*/
|
|
11827
11832
|
const pageScrollFraction = .75;
|
|
11833
|
+
/**
|
|
11834
|
+
* How many of the newest messages the chat screen fetches before it becomes
|
|
11835
|
+
* interactive on `--resume`. A long transcript used to load in one unbounded
|
|
11836
|
+
* request — the whole history transferred, parsed, and rendered before the
|
|
11837
|
+
* first frame — which is what made resuming an old conversation hang. Now we
|
|
11838
|
+
* pull just this visible tail first, then background-backfill older pages.
|
|
11839
|
+
* Sized to comfortably overfill a tall terminal so the initial view is full
|
|
11840
|
+
* without a visible "loading earlier" beat on ordinary conversations.
|
|
11841
|
+
*/
|
|
11842
|
+
const HISTORY_PAGE_SIZE = 60;
|
|
11828
11843
|
/** Cap composer growth; past this the textarea scrolls its content instead. */
|
|
11829
11844
|
const maxComposerRows = 8;
|
|
11830
11845
|
const maxAttachments = 10;
|
|
@@ -11954,9 +11969,10 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
11954
11969
|
const credPromptOpen = credPrompt !== null;
|
|
11955
11970
|
const [computePrompt, setComputePrompt] = useState(null);
|
|
11956
11971
|
const computePromptOpen = computePrompt !== null;
|
|
11972
|
+
const [restartConfirm, setRestartConfirm] = useState(false);
|
|
11957
11973
|
const [menuDismissed, setMenuDismissed] = useState(false);
|
|
11958
11974
|
const [menuHighlight, setMenuHighlight] = useState(0);
|
|
11959
|
-
const commandQuery = grantPrompt || credPrompt || computePrompt ? null : detectCommandTrigger(input);
|
|
11975
|
+
const commandQuery = grantPrompt || credPrompt || computePrompt || restartConfirm ? null : detectCommandTrigger(input);
|
|
11960
11976
|
const menuCommands = commandQuery === null ? [] : filterSlashCommands(commandQuery);
|
|
11961
11977
|
const menuOpen = commandQuery !== null && !menuDismissed;
|
|
11962
11978
|
const menuHighlightClamped = Math.min(menuHighlight, Math.max(0, menuCommands.length - 1));
|
|
@@ -11974,7 +11990,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
11974
11990
|
credPromptRef.current = credPrompt;
|
|
11975
11991
|
const seenRunsRef = useRef(/* @__PURE__ */ new Set());
|
|
11976
11992
|
const shellSessionRef = useRef(null);
|
|
11977
|
-
const hostState = grantPrompt || credPrompt || computePrompt ? "blocked" : run.kind === "idle" ? "idle" : "working";
|
|
11993
|
+
const hostState = grantPrompt || credPrompt || computePrompt || restartConfirm ? "blocked" : run.kind === "idle" ? "idle" : "working";
|
|
11978
11994
|
useEffect(() => {
|
|
11979
11995
|
agentHost.transition({ state: hostState });
|
|
11980
11996
|
}, [agentHost, hostState]);
|
|
@@ -12035,7 +12051,8 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
12035
12051
|
const credPromptHeight = 4 + (credPrompt && (credPrompt.error || credPrompt.submitting) ? 1 : 0);
|
|
12036
12052
|
const nonWebNoticeHeight = 5;
|
|
12037
12053
|
const computePromptHeight = 4;
|
|
12038
|
-
const
|
|
12054
|
+
const restartConfirmHeight = 3;
|
|
12055
|
+
const bottomBoxHeight = credPrompt ? credPromptHeight : computePrompt ? computePromptHeight : restartConfirm ? restartConfirmHeight : nonWebChannel ? nonWebNoticeHeight : composerBoxHeight;
|
|
12039
12056
|
const bodyWidth = Math.max(1, width - 2);
|
|
12040
12057
|
const bodyHeight = Math.max(1, height - 3);
|
|
12041
12058
|
const reviewPlacement = filePanePlacement({
|
|
@@ -12099,32 +12116,55 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
12099
12116
|
]);
|
|
12100
12117
|
useEffect(() => {
|
|
12101
12118
|
if (!rest || !initialConversationId) return;
|
|
12119
|
+
const conversationId = initialConversationId;
|
|
12102
12120
|
let cancelled = false;
|
|
12121
|
+
const seedPrLinks = (items) => {
|
|
12122
|
+
const toolUrlText = items.map((item) => item.kind === "tool" && item.output?.kind === "ok" ? stringifyToolOutput(item.output.value) : "").join("\n");
|
|
12123
|
+
for (const item of items) {
|
|
12124
|
+
if (item.kind !== "assistant-text") continue;
|
|
12125
|
+
for (const pr of extractPullRequests(item.text, {
|
|
12126
|
+
requireCompleteNumber: false,
|
|
12127
|
+
urlOnlyText: toolUrlText
|
|
12128
|
+
})) {
|
|
12129
|
+
if (reportedPrsRef.current.has(pr.key)) continue;
|
|
12130
|
+
reportedPrsRef.current.set(pr.key, pr);
|
|
12131
|
+
setPrLinks((prev) => [...prev, pr]);
|
|
12132
|
+
agentHost.addPullRequest(pr);
|
|
12133
|
+
}
|
|
12134
|
+
}
|
|
12135
|
+
};
|
|
12103
12136
|
(async () => {
|
|
12104
12137
|
try {
|
|
12105
|
-
const [
|
|
12138
|
+
const [firstPage, recapText] = await Promise.all([rest.listMessages({
|
|
12139
|
+
conversationId,
|
|
12140
|
+
limit: HISTORY_PAGE_SIZE
|
|
12141
|
+
}), rest.getRecap({ conversationId }).catch(() => null)]);
|
|
12106
12142
|
if (cancelled) return;
|
|
12107
|
-
const loaded = uiMessagesToItems(messages);
|
|
12143
|
+
const loaded = uiMessagesToItems(firstPage.messages);
|
|
12108
12144
|
if (recapText && loaded.length > 0) loaded.push({
|
|
12109
12145
|
kind: "recap",
|
|
12110
|
-
id: `recap-${
|
|
12146
|
+
id: `recap-${conversationId}`,
|
|
12111
12147
|
text: recapText
|
|
12112
12148
|
});
|
|
12113
12149
|
setItems(loaded);
|
|
12114
|
-
|
|
12115
|
-
|
|
12116
|
-
|
|
12117
|
-
|
|
12118
|
-
|
|
12119
|
-
|
|
12120
|
-
|
|
12121
|
-
|
|
12122
|
-
|
|
12123
|
-
|
|
12124
|
-
|
|
12150
|
+
seedPrLinks(loaded);
|
|
12151
|
+
setTodos(latestTodosFromHistory(firstPage.messages));
|
|
12152
|
+
setHistoryLoaded(true);
|
|
12153
|
+
let before = firstPage.hasMore ? firstPage.nextBefore : null;
|
|
12154
|
+
while (before) {
|
|
12155
|
+
const older = await rest.listMessages({
|
|
12156
|
+
conversationId,
|
|
12157
|
+
limit: HISTORY_PAGE_SIZE,
|
|
12158
|
+
before
|
|
12159
|
+
});
|
|
12160
|
+
if (cancelled) return;
|
|
12161
|
+
const olderItems = uiMessagesToItems(older.messages);
|
|
12162
|
+
if (olderItems.length > 0) {
|
|
12163
|
+
setItems((prev) => [...olderItems, ...prev]);
|
|
12164
|
+
seedPrLinks(olderItems);
|
|
12125
12165
|
}
|
|
12166
|
+
before = older.hasMore ? older.nextBefore : null;
|
|
12126
12167
|
}
|
|
12127
|
-
setTodos(latestTodosFromHistory(messages));
|
|
12128
12168
|
} catch (err) {
|
|
12129
12169
|
if (cancelled) return;
|
|
12130
12170
|
setItems((prev) => [...prev, {
|
|
@@ -12132,8 +12172,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
12132
12172
|
id: crypto.randomUUID(),
|
|
12133
12173
|
text: `failed to load history: ${errorDetail(err)}`
|
|
12134
12174
|
}]);
|
|
12135
|
-
|
|
12136
|
-
if (!cancelled) setHistoryLoaded(true);
|
|
12175
|
+
setHistoryLoaded(true);
|
|
12137
12176
|
}
|
|
12138
12177
|
})();
|
|
12139
12178
|
return () => {
|
|
@@ -12761,6 +12800,25 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
12761
12800
|
error: null
|
|
12762
12801
|
}]);
|
|
12763
12802
|
}, [appUrl, sessionToken]);
|
|
12803
|
+
const runRestartComputer = useCallback(async () => {
|
|
12804
|
+
if (!rest) return;
|
|
12805
|
+
try {
|
|
12806
|
+
await rest.restartAgent(agent.id);
|
|
12807
|
+
setItems((prev) => [...prev, {
|
|
12808
|
+
kind: "info",
|
|
12809
|
+
id: crypto.randomUUID(),
|
|
12810
|
+
title: "computer",
|
|
12811
|
+
text: `restarting ${agent.name}'s sandbox — the current run (if any) is stopped and a fresh box comes up in a moment.`
|
|
12812
|
+
}]);
|
|
12813
|
+
} catch (err) {
|
|
12814
|
+
const message = err instanceof HttpError && err.status === 404 ? "you don't have permission to restart this agent's sandbox." : `couldn't restart the sandbox: ${err instanceof Error ? err.message : String(err)}`;
|
|
12815
|
+
useStore.getState().showToast({ message });
|
|
12816
|
+
}
|
|
12817
|
+
}, [
|
|
12818
|
+
rest,
|
|
12819
|
+
agent.id,
|
|
12820
|
+
agent.name
|
|
12821
|
+
]);
|
|
12764
12822
|
const runSandboxPty = useCallback(async () => {
|
|
12765
12823
|
if (!appUrl || !sessionToken) return;
|
|
12766
12824
|
const result = await runPtySession({
|
|
@@ -12855,7 +12913,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
12855
12913
|
stageAttachment(image);
|
|
12856
12914
|
}, [stageAttachment]);
|
|
12857
12915
|
usePaste((event) => {
|
|
12858
|
-
if (cardPickerOpen || modelPickerOpen || themePickerOpen || prPickerOpen || helpOpen || bgTasksOpen || credPromptOpen || grantPrompt || computePromptOpen || nonWebChannel) return;
|
|
12916
|
+
if (cardPickerOpen || modelPickerOpen || themePickerOpen || prPickerOpen || helpOpen || bgTasksOpen || credPromptOpen || grantPrompt || computePromptOpen || restartConfirm || nonWebChannel) return;
|
|
12859
12917
|
const text = event.metadata?.kind === "binary" ? "" : decodePasteBytes(event.bytes);
|
|
12860
12918
|
const route = routePaste({
|
|
12861
12919
|
kind: event.metadata?.kind,
|
|
@@ -12994,7 +13052,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
12994
13052
|
goTo
|
|
12995
13053
|
]);
|
|
12996
13054
|
const archiveConversation = useCallback(() => {
|
|
12997
|
-
if (grantPrompt || credPrompt || computePrompt) return;
|
|
13055
|
+
if (grantPrompt || credPrompt || computePrompt || restartConfirm) return;
|
|
12998
13056
|
if (agentRunConversation) {
|
|
12999
13057
|
useStore.getState().showToast({ message: "agent runs can't be archived — ctrl+d in the picker deletes" });
|
|
13000
13058
|
return;
|
|
@@ -13029,6 +13087,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
13029
13087
|
grantPrompt,
|
|
13030
13088
|
credPrompt,
|
|
13031
13089
|
computePrompt,
|
|
13090
|
+
restartConfirm,
|
|
13032
13091
|
agentRunConversation,
|
|
13033
13092
|
conversationId,
|
|
13034
13093
|
rest,
|
|
@@ -13332,6 +13391,9 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
13332
13391
|
case "computer":
|
|
13333
13392
|
runComputerStats();
|
|
13334
13393
|
break;
|
|
13394
|
+
case "computer-restart":
|
|
13395
|
+
setRestartConfirm(true);
|
|
13396
|
+
break;
|
|
13335
13397
|
case "plan": {
|
|
13336
13398
|
if (!(!!todos && todos.length > 0)) {
|
|
13337
13399
|
useStore.getState().showToast({ message: "no plan to show yet" });
|
|
@@ -13500,6 +13562,17 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
13500
13562
|
return;
|
|
13501
13563
|
}
|
|
13502
13564
|
}
|
|
13565
|
+
if (restartConfirm) {
|
|
13566
|
+
if (key.name === "y") {
|
|
13567
|
+
setRestartConfirm(false);
|
|
13568
|
+
runRestartComputer();
|
|
13569
|
+
return;
|
|
13570
|
+
}
|
|
13571
|
+
if (key.name === "n" || key.name === "escape") {
|
|
13572
|
+
setRestartConfirm(false);
|
|
13573
|
+
return;
|
|
13574
|
+
}
|
|
13575
|
+
}
|
|
13503
13576
|
if (credPrompt) {
|
|
13504
13577
|
if (key.name === "escape") {
|
|
13505
13578
|
if (!credPrompt.submitting) setCredPrompt(null);
|
|
@@ -14066,6 +14139,40 @@ function ChatScreen({ agent, conversation, attachRunId }) {
|
|
|
14066
14139
|
children: " later"
|
|
14067
14140
|
})
|
|
14068
14141
|
] })]
|
|
14142
|
+
}) : restartConfirm ? /* @__PURE__ */ jsxs("box", {
|
|
14143
|
+
style: {
|
|
14144
|
+
border: true,
|
|
14145
|
+
borderColor: theme.warning,
|
|
14146
|
+
paddingLeft: 1,
|
|
14147
|
+
paddingRight: 1,
|
|
14148
|
+
height: restartConfirmHeight,
|
|
14149
|
+
flexShrink: 0,
|
|
14150
|
+
marginTop: 1,
|
|
14151
|
+
flexDirection: "row"
|
|
14152
|
+
},
|
|
14153
|
+
children: [
|
|
14154
|
+
/* @__PURE__ */ jsxs("text", {
|
|
14155
|
+
fg: theme.warning,
|
|
14156
|
+
children: [
|
|
14157
|
+
"restart ",
|
|
14158
|
+
agent.name,
|
|
14159
|
+
"'s sandbox? this stops the current run.",
|
|
14160
|
+
" "
|
|
14161
|
+
]
|
|
14162
|
+
}),
|
|
14163
|
+
/* @__PURE__ */ jsx("text", {
|
|
14164
|
+
fg: theme.success,
|
|
14165
|
+
children: "y"
|
|
14166
|
+
}),
|
|
14167
|
+
/* @__PURE__ */ jsx("text", {
|
|
14168
|
+
fg: theme.muted,
|
|
14169
|
+
children: " / "
|
|
14170
|
+
}),
|
|
14171
|
+
/* @__PURE__ */ jsx("text", {
|
|
14172
|
+
fg: theme.error,
|
|
14173
|
+
children: "n"
|
|
14174
|
+
})
|
|
14175
|
+
]
|
|
14069
14176
|
}) : nonWebChannel ? /* @__PURE__ */ jsxs("box", {
|
|
14070
14177
|
style: {
|
|
14071
14178
|
border: true,
|
|
@@ -536,8 +536,14 @@ var JobManager = class {
|
|
|
536
536
|
|
|
537
537
|
//#endregion
|
|
538
538
|
//#region ../portal-daemon/src/client.ts
|
|
539
|
-
const
|
|
540
|
-
|
|
539
|
+
const DEFAULT_HEARTBEAT = {
|
|
540
|
+
intervalMs: 15e3,
|
|
541
|
+
maxMissed: 2,
|
|
542
|
+
wakeTickMs: 2e3,
|
|
543
|
+
wakeGapThresholdMs: 1e4,
|
|
544
|
+
initialBackoffMs: 500,
|
|
545
|
+
maxBackoffMs: 1e4
|
|
546
|
+
};
|
|
541
547
|
/**
|
|
542
548
|
* Shares the local machine with agents over the portal: dials OUT to the api's
|
|
543
549
|
* desktop-portal WebSocket (authenticating with a short-lived device token
|
|
@@ -560,8 +566,38 @@ var PortalClient = class {
|
|
|
560
566
|
machineName = "";
|
|
561
567
|
friendlyName = "";
|
|
562
568
|
legacyGrantsChecked = false;
|
|
569
|
+
wakeWatch = null;
|
|
570
|
+
lastTick = Date.now();
|
|
571
|
+
heartbeatConfig;
|
|
563
572
|
constructor(opts) {
|
|
564
573
|
this.opts = opts;
|
|
574
|
+
this.heartbeatConfig = {
|
|
575
|
+
...DEFAULT_HEARTBEAT,
|
|
576
|
+
...opts.heartbeat
|
|
577
|
+
};
|
|
578
|
+
this.startWakeWatch();
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Detect wake-from-sleep without an Electron/`powerMonitor` dependency (the
|
|
582
|
+
* daemon also runs headless under the CLI). A repeating timer that should
|
|
583
|
+
* fire every WAKE_TICK_MS; when the actual gap since the last tick far
|
|
584
|
+
* exceeds that, the process was suspended (macOS sleep, laptop lid) and the
|
|
585
|
+
* current socket — if any — is a zombie against a server that has already
|
|
586
|
+
* reaped our presence. Terminate it now so `connectLoop` redials at once
|
|
587
|
+
* instead of waiting out the heartbeat deadline. Cheap: one no-op timer.
|
|
588
|
+
*/
|
|
589
|
+
startWakeWatch() {
|
|
590
|
+
this.lastTick = Date.now();
|
|
591
|
+
this.wakeWatch = setInterval(() => {
|
|
592
|
+
const now = Date.now();
|
|
593
|
+
const gap = now - this.lastTick;
|
|
594
|
+
this.lastTick = now;
|
|
595
|
+
if (gap > this.heartbeatConfig.wakeGapThresholdMs && this.ws) {
|
|
596
|
+
this.error = "woke from sleep; reconnecting portal";
|
|
597
|
+
this.ws.terminate();
|
|
598
|
+
}
|
|
599
|
+
}, this.heartbeatConfig.wakeTickMs);
|
|
600
|
+
this.wakeWatch.unref?.();
|
|
565
601
|
}
|
|
566
602
|
isEnabled() {
|
|
567
603
|
return this.enabled;
|
|
@@ -597,6 +633,10 @@ var PortalClient = class {
|
|
|
597
633
|
dispose() {
|
|
598
634
|
this.disposed = true;
|
|
599
635
|
this.enabled = false;
|
|
636
|
+
if (this.wakeWatch) {
|
|
637
|
+
clearInterval(this.wakeWatch);
|
|
638
|
+
this.wakeWatch = null;
|
|
639
|
+
}
|
|
600
640
|
this.jobs?.killAll();
|
|
601
641
|
this.jobs = null;
|
|
602
642
|
this.ws?.close();
|
|
@@ -661,24 +701,31 @@ var PortalClient = class {
|
|
|
661
701
|
this.friendlyName = identity.friendlyName;
|
|
662
702
|
this.opts.onMachineName(identity.machineName, identity.machineNameSource);
|
|
663
703
|
}
|
|
664
|
-
let backoff =
|
|
704
|
+
let backoff = this.heartbeatConfig.initialBackoffMs;
|
|
665
705
|
while (this.enabled && !this.disposed) {
|
|
666
706
|
this.setStatus("connecting");
|
|
667
707
|
try {
|
|
668
708
|
const token = await this.wsToken();
|
|
669
|
-
await this.runConnection(token);
|
|
670
|
-
backoff =
|
|
709
|
+
if (await this.runConnection(token)) backoff = this.heartbeatConfig.initialBackoffMs;
|
|
710
|
+
else backoff = Math.min(backoff * 2, this.heartbeatConfig.maxBackoffMs);
|
|
671
711
|
} catch (err) {
|
|
672
712
|
if (!this.enabled || this.disposed) break;
|
|
673
713
|
this.setStatus("error", errorMessage(err));
|
|
714
|
+
backoff = Math.min(backoff * 2, this.heartbeatConfig.maxBackoffMs);
|
|
674
715
|
}
|
|
675
716
|
if (!this.enabled || this.disposed) break;
|
|
676
|
-
await sleep(backoff);
|
|
677
|
-
backoff = Math.min(backoff * 2, MAX_BACKOFF_MS);
|
|
717
|
+
await sleep(Math.random() * backoff);
|
|
678
718
|
}
|
|
679
719
|
}
|
|
680
720
|
runConnection(token) {
|
|
681
721
|
return new Promise((resolve) => {
|
|
722
|
+
let settled = false;
|
|
723
|
+
let healthy = false;
|
|
724
|
+
const settle = () => {
|
|
725
|
+
if (settled) return;
|
|
726
|
+
settled = true;
|
|
727
|
+
resolve(healthy);
|
|
728
|
+
};
|
|
682
729
|
const ws = new WebSocket(portalWsUrl(this.opts.appUrl, this.machineName, this.friendlyName), {
|
|
683
730
|
headers: { authorization: `Bearer ${token}` },
|
|
684
731
|
maxPayload: MAX_WS_FRAME_BYTES
|
|
@@ -692,21 +739,40 @@ var PortalClient = class {
|
|
|
692
739
|
}
|
|
693
740
|
});
|
|
694
741
|
this.jobs = jobs;
|
|
742
|
+
let missed = 0;
|
|
743
|
+
const heartbeat = setInterval(() => {
|
|
744
|
+
if (ws.readyState !== WebSocket.OPEN) return;
|
|
745
|
+
if (missed >= this.heartbeatConfig.maxMissed) {
|
|
746
|
+
this.error = "portal connection went silent (no pong); reconnecting";
|
|
747
|
+
ws.terminate();
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
missed += 1;
|
|
751
|
+
ws.ping();
|
|
752
|
+
}, this.heartbeatConfig.intervalMs);
|
|
753
|
+
const markAlive = () => {
|
|
754
|
+
missed = 0;
|
|
755
|
+
healthy = true;
|
|
756
|
+
};
|
|
695
757
|
ws.on("open", () => {
|
|
696
758
|
this.setStatus("connected");
|
|
697
759
|
this.syncDeviceState();
|
|
698
760
|
});
|
|
761
|
+
ws.on("pong", markAlive);
|
|
762
|
+
ws.on("ping", markAlive);
|
|
699
763
|
ws.on("message", (data, isBinary) => {
|
|
764
|
+
markAlive();
|
|
700
765
|
if (isBinary) jobs.handleFrame(toBuffer(data));
|
|
701
766
|
});
|
|
702
767
|
ws.on("error", (err) => {
|
|
703
768
|
this.error = errorMessage(err);
|
|
704
769
|
});
|
|
705
770
|
ws.on("close", () => {
|
|
771
|
+
clearInterval(heartbeat);
|
|
706
772
|
jobs.killAll();
|
|
707
773
|
if (this.jobs === jobs) this.jobs = null;
|
|
708
774
|
if (this.ws === ws) this.ws = null;
|
|
709
|
-
|
|
775
|
+
settle();
|
|
710
776
|
});
|
|
711
777
|
});
|
|
712
778
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./client-
|
|
3
|
-
import { a as runPortalDaemon, i as queryDaemonStatus, n as ensureDaemonRunning, o as startPortalDaemon, r as isDaemonListening, s as stopDaemon, t as PortalDaemon } from "./daemon-
|
|
2
|
+
import "./client-DMYwKALl.mjs";
|
|
3
|
+
import { a as runPortalDaemon, i as queryDaemonStatus, n as ensureDaemonRunning, o as startPortalDaemon, r as isDaemonListening, s as stopDaemon, t as PortalDaemon } from "./daemon-D8WoX21I.mjs";
|
|
4
4
|
import "./tls-cert-CV-pwxVN.mjs";
|
|
5
5
|
import "./api-DQCaztBg.mjs";
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as isRecord, t as PortalClient } from "./client-
|
|
2
|
+
import { n as isRecord, t as PortalClient } from "./client-DMYwKALl.mjs";
|
|
3
3
|
import { t as defaultTlsCertSource } from "./tls-cert-CV-pwxVN.mjs";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
@@ -21,7 +21,7 @@ import { access, appendFile, mkdir, readFile, unlink, writeFile } from "node:fs/
|
|
|
21
21
|
* the commit time of the built tree is one monotonic clock they share.
|
|
22
22
|
*/
|
|
23
23
|
function portalDaemonBuild() {
|
|
24
|
-
return "
|
|
24
|
+
return "1786915412";
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Whether a client carrying `mine` should replace a running daemon carrying
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as LOCAL_PROTOCOL_VERSION, d as encodeLine, f as makeLineParser, n as ensureDaemonRunning, p as parseDaemonMessage, u as daemonPaths } from "./daemon-
|
|
2
|
+
import { c as LOCAL_PROTOCOL_VERSION, d as encodeLine, f as makeLineParser, n as ensureDaemonRunning, p as parseDaemonMessage, u as daemonPaths } from "./daemon-D8WoX21I.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { connect } from "node:net";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as getConfigPath } from "./print-
|
|
2
|
+
import { C as getConfigPath } from "./print-CwbdwCeQ.mjs";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { err, ok } from "neverthrow";
|
|
@@ -8,7 +8,7 @@ import fs from "node:fs";
|
|
|
8
8
|
|
|
9
9
|
//#region package.json
|
|
10
10
|
var name = "skydive-cli";
|
|
11
|
-
var version$1 = "0.5.0-beta.
|
|
11
|
+
var version$1 = "0.5.0-beta.41";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/auth/organization.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-
|
|
3
|
-
import "./rest-
|
|
2
|
+
import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-CwbdwCeQ.mjs";
|
|
3
|
+
import "./rest-Bbe-RhMy.mjs";
|
|
4
4
|
import "./billing-blocked-D3l5kJlX.mjs";
|
|
5
5
|
|
|
6
6
|
export { messageGet, readStdin, resolveAgent, runPrint };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
|
|
3
|
-
import { a as isRecord, i as errorMessage, r as sendErrorMessage, t as createRestClient } from "./rest-
|
|
3
|
+
import { a as isRecord, i as errorMessage, r as sendErrorMessage, t as createRestClient } from "./rest-Bbe-RhMy.mjs";
|
|
4
4
|
import { i as billingBlockedOutcomeFromSendResponse, n as BillingBlockedError } from "./billing-blocked-D3l5kJlX.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import Conf from "conf";
|
|
@@ -14,7 +14,7 @@ import { n as printError } from "./output-wY0VQDea.mjs";
|
|
|
14
14
|
* the reply (and to --json).
|
|
15
15
|
*/
|
|
16
16
|
async function connectMachineShare({ appUrl, sessionToken, timeoutHint }) {
|
|
17
|
-
const { PortalClient } = await import("./client-
|
|
17
|
+
const { PortalClient } = await import("./client-DCwVlAal.mjs");
|
|
18
18
|
const { defaultTlsCertSource } = await import("./tls-cert-CLgSQALB.mjs");
|
|
19
19
|
let signalConnected;
|
|
20
20
|
const connected = new Promise((resolve) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
|
|
3
|
-
import { n as errorDetail, r as sendErrorMessage, t as createRestClient } from "./rest-
|
|
3
|
+
import { n as errorDetail, r as sendErrorMessage, t as createRestClient } from "./rest-Bbe-RhMy.mjs";
|
|
4
4
|
import "./billing-blocked-D3l5kJlX.mjs";
|
|
5
5
|
|
|
6
6
|
export { createRestClient };
|
|
@@ -299,9 +299,17 @@ function createRestClient({ appUrl, sessionToken, workspaceId }) {
|
|
|
299
299
|
} while (cursor && all.length < maxConversations);
|
|
300
300
|
return limit ? all.slice(0, limit) : all;
|
|
301
301
|
},
|
|
302
|
-
listMessages: async ({ conversationId }) => {
|
|
303
|
-
const
|
|
304
|
-
|
|
302
|
+
listMessages: async ({ conversationId, limit, before }) => {
|
|
303
|
+
const params = new URLSearchParams();
|
|
304
|
+
if (limit !== void 0) params.set("limit", String(limit));
|
|
305
|
+
if (before !== void 0) params.set("before", before);
|
|
306
|
+
const query = params.toString();
|
|
307
|
+
const { messages, hasMore, nextBefore } = await get(`/api/v1/conversations/${encodeURIComponent(conversationId)}/messages${query ? `?${query}` : ""}`, listMessagesResponseSchema);
|
|
308
|
+
return {
|
|
309
|
+
messages,
|
|
310
|
+
hasMore: hasMore ?? false,
|
|
311
|
+
nextBefore: nextBefore ?? null
|
|
312
|
+
};
|
|
305
313
|
},
|
|
306
314
|
listWorkspaceFiles: async ({ agentId }) => {
|
|
307
315
|
const { files } = await get(`/api/v1/workspace-files?${new URLSearchParams({ agentId }).toString()}`, listWorkspaceFilesResponseSchema);
|
|
@@ -332,6 +340,9 @@ function createRestClient({ appUrl, sessionToken, workspaceId }) {
|
|
|
332
340
|
const { stats } = await get(`/api/v1/compute/live-stats?agentId=${encodeURIComponent(agentId)}`, liveStatsResponseSchema);
|
|
333
341
|
return stats;
|
|
334
342
|
},
|
|
343
|
+
restartAgent: async (agentId) => {
|
|
344
|
+
await post(`/api/v1/agents/${encodeURIComponent(agentId)}/restart`, {}, z.object({ ok: z.boolean() }));
|
|
345
|
+
},
|
|
335
346
|
uploadAttachment: async ({ agentId, fileName, mediaType, data }) => {
|
|
336
347
|
const size = data.byteLength;
|
|
337
348
|
const presign = await post("/api/v1/attachments/presign", {
|
|
@@ -598,7 +609,11 @@ const liveStatsResponseSchema = z.object({ stats: z.object({
|
|
|
598
609
|
diskUsedBytes: z.number(),
|
|
599
610
|
diskTotalBytes: z.number()
|
|
600
611
|
}).nullable() });
|
|
601
|
-
const listMessagesResponseSchema = z.object({
|
|
612
|
+
const listMessagesResponseSchema = z.object({
|
|
613
|
+
messages: z.array(uiMessageSchema),
|
|
614
|
+
hasMore: z.boolean().optional(),
|
|
615
|
+
nextBefore: z.string().nullish()
|
|
616
|
+
});
|
|
602
617
|
const workspaceFileSchema = z.object({
|
|
603
618
|
id: z.string(),
|
|
604
619
|
path: z.string(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skydive-cli",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.41",
|
|
4
4
|
"description": "Skydive CLI — cloud agents from the command line",
|
|
5
5
|
"homepage": "https://skydive.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
},
|
|
70
70
|
"//optionalDependencies": "The per-platform binary packages (skydive-cli-<os>-<arch>) are INTENTIONALLY not committed here. They are published by release-skydive-cli-binaries.yml and injected — pinned to the exact version being published — into the published launcher's optionalDependencies at release time (scripts/prepare-platform-packages.mjs --pin-version, run in release-skydive-cli.yml). Committing them would make `yarn install` try to resolve versions that only exist post-publish, breaking local dev and CI. npm installs of a published skydive-cli still get them (os/cpu-gated); the launcher (src/launcher.ts) resolves and execs the matching one. Local dev never needs them: it runs the JS bundle or `build:binary` directly.",
|
|
71
71
|
"optionalDependencies": {
|
|
72
|
-
"skydive-cli-darwin-arm64": "0.5.0-beta.
|
|
73
|
-
"skydive-cli-darwin-x64": "0.5.0-beta.
|
|
74
|
-
"skydive-cli-linux-x64": "0.5.0-beta.
|
|
75
|
-
"skydive-cli-linux-arm64": "0.5.0-beta.
|
|
72
|
+
"skydive-cli-darwin-arm64": "0.5.0-beta.41",
|
|
73
|
+
"skydive-cli-darwin-x64": "0.5.0-beta.41",
|
|
74
|
+
"skydive-cli-linux-x64": "0.5.0-beta.41",
|
|
75
|
+
"skydive-cli-linux-arm64": "0.5.0-beta.41"
|
|
76
76
|
}
|
|
77
77
|
}
|