skydive-cli 0.5.0-beta.41 → 0.5.0-beta.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  ### Added
15
15
 
16
+ - `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.
17
+ - 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.
16
18
  - `/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
19
  - 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
20
  - `/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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
2
+ import { t as HttpError } from "./http-error-BF2NZZE3.mjs";
3
3
  import { z } from "zod";
4
4
  import http from "node:http";
5
5
  import http2 from "node:http2";
package/dist/js/bin.mjs CHANGED
@@ -1,14 +1,14 @@
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-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
- import { n as printError, r as printTable, t as output } from "./output-wY0VQDea.mjs";
5
- import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
6
- import { t as createRestClient } from "./rest-Bbe-RhMy.mjs";
2
+ import { o as name, s as version, t as createRestClient } from "./rest-DpsJUYTL.mjs";
3
+ import { B as resolveSession$1, C as deleteConfig, D as getPreference, E as getLastSeenVersion, G as setLastSeenVersion, H as saveConfig, I as resolveAppUrl, L as resolveChatAuth, M as getStoredApiKeyId, N as getStoredApiKeyWorkspaceName, O as getPromptHistoryPath, P as getUpdateCheckDisabled, R as resolveConfig, S as PREFERENCES, T as getDefaultAgent, U as saveSession, _ as API_KEYS_URL, b as DEFAULT_API_URL, i as resolveAgent$1, j as getShareMachineDefault, v as API_KEY_FAMILY_PREFIX, w as getConfigPath, y as API_KEY_PREFIX, z as resolveManagementAuth } from "./print-Ds16-Q4O.mjs";
4
+ import { A as installAgentAlias, B as resolveWorkspaceId, D as machineOsFromPlatform, E as buildImportSeedPrompt, F as detectShell, I as ensureActiveOrganization, L as getActiveWorkspaceId, M as takenAliasNames, N as SUPPORTED_SHELLS, O as aliasActivationHint, P as defaultInstallEnv, R as getSessionIdentity, 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-DrtNldUN.mjs";
5
+ import { n as printError, r as printTable, t as output } from "./output-C9mb3sUB.mjs";
6
+ import { t as HttpError } from "./http-error-BF2NZZE3.mjs";
7
7
  import "./billing-blocked-D3l5kJlX.mjs";
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";
8
+ import { r as resolveMachineIdentity } from "./client-BnpgrtCC.mjs";
9
+ import { i as queryDaemonStatus, l as PORTAL_DAEMON_FLAG, n as ensureDaemonRunning, s as stopDaemon, u as daemonPaths } from "./daemon-w8vtZ81t.mjs";
10
10
  import "./tls-cert-CV-pwxVN.mjs";
11
- import { i as grantPortalAccess, n as fetchPortalDevices, o as registerPortalDevice, r as findThisDevice, s as revokePortalAccess } from "./api-DQCaztBg.mjs";
11
+ import { i as grantPortalAccess, n as fetchPortalDevices, o as registerPortalDevice, r as findThisDevice, s as revokePortalAccess } from "./api-TwLD7ibI.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";
13
13
  import { hideBin } from "yargs/helpers";
14
14
  import yargs from "yargs";
@@ -41,6 +41,7 @@ function isNonInteractive() {
41
41
  //#endregion
42
42
  //#region src/api-client.ts
43
43
  const USER_AGENT = `skydive-cli/${version}`;
44
+ const CLI_VERSION_HEADER = "x-skydive-cli-version";
44
45
  /** Largest page `/v1/agents` will return, enforced server-side. */
45
46
  const MAX_AGENT_PAGE = 100;
46
47
  const AgentSchema = z.object({
@@ -161,7 +162,8 @@ var SkydiveApiClient = class {
161
162
  const url = `${this.baseUrl}${params.path}`;
162
163
  const headers = {
163
164
  authorization: `Bearer ${this.token}`,
164
- "user-agent": USER_AGENT
165
+ "user-agent": USER_AGENT,
166
+ [CLI_VERSION_HEADER]: version
165
167
  };
166
168
  if (this.workspaceId) headers["x-workspace-id"] = this.workspaceId;
167
169
  if (params.body) headers["content-type"] = "application/json";
@@ -1586,7 +1588,7 @@ const importCommand = {
1586
1588
  process.exit(1);
1587
1589
  }
1588
1590
  }
1589
- const { runChat } = await import("./boot-B1Y1D48W.mjs");
1591
+ const { runChat } = await import("./boot-ClKjP9Mn.mjs");
1590
1592
  await runChat({
1591
1593
  appUrl,
1592
1594
  sessionToken: session.value.sessionToken,
@@ -1616,7 +1618,7 @@ async function runImportPrintMode({ argv, appUrl }) {
1616
1618
  printError(`${session.error.message} For non-interactive use, run \`skydive auth login --web\` first, or set SKYDIVE_SESSION_TOKEN.`);
1617
1619
  process.exit(1);
1618
1620
  }
1619
- const { connectMachineShare } = await import("./print-share-azWHVxpt.mjs");
1621
+ const { connectMachineShare } = await import("./print-share-Df6eAG12.mjs");
1620
1622
  const machineShare = await connectMachineShare({
1621
1623
  appUrl,
1622
1624
  sessionToken: session.value.sessionToken,
@@ -1624,7 +1626,7 @@ async function runImportPrintMode({ argv, appUrl }) {
1624
1626
  });
1625
1627
  const extra = (argv.print ?? "").trim();
1626
1628
  const prompt = buildImportSeedPrompt(process.cwd(), machineOsFromPlatform(process.platform)) + (extra ? `\n\nAdditional instructions: ${extra}` : "");
1627
- const { runPrint } = await import("./print-BAmEefvX.mjs");
1629
+ const { runPrint } = await import("./print-Dc-xRapT.mjs");
1628
1630
  try {
1629
1631
  const result = await runPrint({
1630
1632
  appUrl,
@@ -2031,7 +2033,7 @@ const chatCommand = {
2031
2033
  sessionToken: auth.value.token,
2032
2034
  agentSelector: argv.agent ?? null
2033
2035
  });
2034
- const { runChat } = await import("./boot-B1Y1D48W.mjs");
2036
+ const { runChat } = await import("./boot-ClKjP9Mn.mjs");
2035
2037
  await runChat({
2036
2038
  appUrl: auth.value.appUrl,
2037
2039
  sessionToken: auth.value.token,
@@ -2115,7 +2117,7 @@ async function runPrintMode({ argv, appUrl }) {
2115
2117
  printError(`${auth.error.message} For non-interactive use, run \`skydive auth login\` first, or set SKYDIVE_API_KEY / SKYDIVE_SESSION_TOKEN.`);
2116
2118
  process.exit(1);
2117
2119
  }
2118
- const { runPrint, readStdin } = await import("./print-BAmEefvX.mjs");
2120
+ const { runPrint, readStdin } = await import("./print-Dc-xRapT.mjs");
2119
2121
  const workspaceId = await resolveWorkspaceFlag({
2120
2122
  appUrl,
2121
2123
  sessionToken: auth.value.token,
@@ -2145,7 +2147,7 @@ async function runPrintMode({ argv, appUrl }) {
2145
2147
  process.exit(1);
2146
2148
  }
2147
2149
  } else {
2148
- const { connectMachineShare } = await import("./print-share-azWHVxpt.mjs");
2150
+ const { connectMachineShare } = await import("./print-share-Df6eAG12.mjs");
2149
2151
  machineShare = await connectMachineShare({
2150
2152
  appUrl: auth.value.appUrl,
2151
2153
  sessionToken: auth.value.token,
@@ -2210,7 +2212,7 @@ const getCommand$1 = {
2210
2212
  printError(`${auth.error.message} Run \`skydive auth login\` first, or set SKYDIVE_API_KEY / SKYDIVE_SESSION_TOKEN.`);
2211
2213
  process.exit(1);
2212
2214
  }
2213
- const { messageGet } = await import("./print-BAmEefvX.mjs");
2215
+ const { messageGet } = await import("./print-Dc-xRapT.mjs");
2214
2216
  try {
2215
2217
  const result = await messageGet({
2216
2218
  appUrl: auth.value.appUrl,
@@ -2413,7 +2415,7 @@ const switchCommand = {
2413
2415
  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
2416
  process.exit(1);
2415
2417
  }
2416
- const { runWorkspacePicker } = await import("./boot-B1Y1D48W.mjs");
2418
+ const { runWorkspacePicker } = await import("./boot-ClKjP9Mn.mjs");
2417
2419
  await runWorkspacePicker(session);
2418
2420
  return;
2419
2421
  }
@@ -2492,7 +2494,7 @@ const openCommand = {
2492
2494
  const agent = argv.agent ? resolveAgent$1((await fetchPortalDevices(session)).agents, argv.agent) : null;
2493
2495
  const cwd = argv.cwd ? path.resolve(argv.cwd) : process.cwd();
2494
2496
  const { machineName } = await resolveMachineIdentity(null);
2495
- const { PortalDaemonClient } = await import("./daemon-client-_SVAskeO.mjs");
2497
+ const { PortalDaemonClient } = await import("./daemon-client-D5YCk5Hc.mjs");
2496
2498
  let lastLine = "";
2497
2499
  let signalConnected;
2498
2500
  const connected = new Promise((resolve) => {
@@ -2738,7 +2740,7 @@ const forwardCommand = {
2738
2740
  const agent = resolveAgent$1((await fetchPortalDevices(session)).agents, argv.agent ?? null);
2739
2741
  const targetPort = argv.port;
2740
2742
  const localPort = argv["local-port"] ?? targetPort;
2741
- const { startForward } = await import("./forward-zwB55Bls.mjs");
2743
+ const { startForward } = await import("./forward-Ct8Vd2WW.mjs");
2742
2744
  const { defaultTlsCertSource } = await import("./tls-cert-CLgSQALB.mjs");
2743
2745
  const log = (msg) => console.error(msg);
2744
2746
  const listener = await startForward({
@@ -2806,8 +2808,8 @@ const sandboxCommand = {
2806
2808
  }).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
2809
  handler: async (argv) => {
2808
2810
  const session = requireSession(argv);
2809
- const { createRestClient } = await import("./rest-B5DVQ1LM.mjs");
2810
- const { resolveAgent } = await import("./print-BAmEefvX.mjs");
2811
+ const { createRestClient } = await import("./rest-Do3mPVpC.mjs");
2812
+ const { resolveAgent } = await import("./print-Dc-xRapT.mjs");
2811
2813
  const client = createRestClient({
2812
2814
  appUrl: session.appUrl,
2813
2815
  sessionToken: session.sessionToken
@@ -3075,8 +3077,8 @@ const fsEditCommand = {
3075
3077
  handler: async (argv) => {
3076
3078
  const session = requireSession(argv);
3077
3079
  const remotePath = argv.path;
3078
- const { createRestClient } = await import("./rest-B5DVQ1LM.mjs");
3079
- const { resolveAgent } = await import("./print-BAmEefvX.mjs");
3080
+ const { createRestClient } = await import("./rest-Do3mPVpC.mjs");
3081
+ const { resolveAgent } = await import("./print-Dc-xRapT.mjs");
3080
3082
  const client = createRestClient({
3081
3083
  appUrl: session.appUrl,
3082
3084
  sessionToken: session.sessionToken
@@ -4403,7 +4405,7 @@ function setupUpdateCheck(argv) {
4403
4405
 
4404
4406
  //#endregion
4405
4407
  //#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` 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";
4408
+ 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- `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";
4407
4409
 
4408
4410
  //#endregion
4409
4411
  //#region src/whats-new.ts
@@ -4546,7 +4548,7 @@ if (process.argv.includes(UPDATE_WORKER_FLAG)) {
4546
4548
  process.exit(0);
4547
4549
  }
4548
4550
  if (process.argv.includes(PORTAL_DAEMON_FLAG)) {
4549
- const { runPortalDaemon } = await import("./daemon-By-I_HVM.mjs");
4551
+ const { runPortalDaemon } = await import("./daemon-mLypjXdu.mjs");
4550
4552
  runPortalDaemon(process.argv);
4551
4553
  } else runCli();
4552
4554
  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-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
- 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-Bbe-RhMy.mjs";
2
+ import { a as isRecord, i as errorMessage, n as errorDetail, r as sendErrorMessage, t as createRestClient } from "./rest-DpsJUYTL.mjs";
3
+ import { A as getSavedTheme, F as recordDefaultAgent, V as resolveWebUrl, W as saveTheme, b as DEFAULT_API_URL, c as cardActionErrorMessage, d as reconcileMaskedInput, f as resolveConnectUrl, g as specKeyFor, h as parseConnectCard, i as resolveAgent, k as getReviewStateDir, l as parseExternalOauthConnectParams, m as computeSettledLabel, p as composeQuestionAnswer, s as MASK_CHAR, u as parseOauthConnectParams, w as getConfigPath, x as DEFAULT_APP_URL } from "./print-Ds16-Q4O.mjs";
4
+ 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-DrtNldUN.mjs";
5
+ import { t as HttpError } from "./http-error-BF2NZZE3.mjs";
6
6
  import { i as billingBlockedOutcomeFromSendResponse } from "./billing-blocked-D3l5kJlX.mjs";
7
- import { t as PortalClient } from "./client-DMYwKALl.mjs";
8
- import "./daemon-D8WoX21I.mjs";
7
+ import { t as PortalClient } from "./client-BnpgrtCC.mjs";
8
+ import "./daemon-w8vtZ81t.mjs";
9
9
  import { t as defaultTlsCertSource } from "./tls-cert-CV-pwxVN.mjs";
10
- import "./api-DQCaztBg.mjs";
10
+ import "./api-TwLD7ibI.mjs";
11
11
  import { t as SandboxStream } from "./client-Btq6bMzX.mjs";
12
- import { t as PortalDaemonClient } from "./daemon-client-Bp5DMeIi.mjs";
12
+ import { t as PortalDaemonClient } from "./daemon-client-KKNss0NK.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";
@@ -2794,26 +2794,80 @@ function CollapseHint() {
2794
2794
  /** Collapsed line cap for tool error output. */
2795
2795
  const maxErrorLines = 8;
2796
2796
  /**
2797
+ * Character budget for a collapsed error block, sized so the block still
2798
+ * costs about `maxErrorLines` rows on a conventional 80-column terminal.
2799
+ * Error lines wrap instead of clipping, so without this a single
2800
+ * multi-kilobyte line (a raw JSON body, a minified stack) would wrap into a
2801
+ * wall of scrollback.
2802
+ */
2803
+ const maxErrorChars = maxErrorLines * 80;
2804
+ /**
2805
+ * Squeeze the vertical dead space out of a block: leading and trailing blank
2806
+ * lines dropped, runs of blank lines collapsed to one. A failing command's
2807
+ * error text arrives as stderr (newline-terminated) plus a blank-line-
2808
+ * separated `Command exited with code N`, which otherwise renders as a
2809
+ * two-row hole in the middle of the block.
2810
+ */
2811
+ function tightenBlanks(text) {
2812
+ return text.replace(/\n{3,}/g, "\n\n").replace(/^\n+/, "").replace(/\s+$/, "");
2813
+ }
2814
+ /**
2815
+ * Collapsed form of an error block: whole lines, up to the line cap and the
2816
+ * character budget, left for the renderer to word-wrap. Unlike ok output,
2817
+ * errors are not clipped at a fixed column — the reason a command failed is
2818
+ * usually in the tail of the message, so an ellipsis at column 100 hides the
2819
+ * one thing the block exists to say.
2820
+ */
2821
+ function collapseError(text) {
2822
+ const source = expandLines(text);
2823
+ const lines = [];
2824
+ let room = maxErrorChars;
2825
+ let cut = false;
2826
+ for (const line of source) {
2827
+ if (lines.length === maxErrorLines || room <= 0) break;
2828
+ if (line.length > room) {
2829
+ lines.push(truncate(line, room));
2830
+ cut = true;
2831
+ break;
2832
+ }
2833
+ lines.push(line);
2834
+ room -= line.length;
2835
+ }
2836
+ const hidden = source.length - lines.length;
2837
+ return {
2838
+ lines,
2839
+ hidden,
2840
+ clipped: cut || hidden > 0
2841
+ };
2842
+ }
2843
+ /** Whether a collapsed error block hides any of its text. */
2844
+ function isErrorClipped(text) {
2845
+ return collapseError(tightenBlanks(text)).clipped;
2846
+ }
2847
+ /**
2797
2848
  * Tool error output, clamped like ok output: collapsed it clips to
2798
2849
  * `maxErrorLines` with the "+N more · click to expand" tail; expanded it
2799
- * renders in full, word-wrapped. Same click-to-toggle box as the rest of
2800
- * the block — a failing command's output shouldn't flood the scrollback
2801
- * just because it arrived on the error channel.
2850
+ * renders in full. Same click-to-toggle box as the rest of the block — a
2851
+ * failing command's output shouldn't flood the scrollback just because it
2852
+ * arrived on the error channel.
2802
2853
  */
2803
2854
  function ErrorLines({ text, expanded }) {
2855
+ const tidy = tightenBlanks(text);
2804
2856
  if (expanded) return /* @__PURE__ */ jsx(ExpandedLines, {
2805
- text,
2857
+ text: tidy,
2806
2858
  fg: theme.error
2807
2859
  });
2808
- return /* @__PURE__ */ jsx("box", {
2860
+ const { lines, hidden, clipped } = collapseError(tidy);
2861
+ return /* @__PURE__ */ jsxs("box", {
2809
2862
  style: { flexDirection: "column" },
2810
- children: clipLines(text, {
2811
- maxLines: maxErrorLines,
2812
- maxLineLen: 100
2813
- }).map((line, idx) => /* @__PURE__ */ jsx("text", {
2863
+ children: [lines.map((line, idx) => /* @__PURE__ */ jsx("text", {
2814
2864
  fg: theme.error,
2865
+ style: { wrapMode: "word" },
2815
2866
  children: line
2816
- }, idx))
2867
+ }, idx)), clipped && /* @__PURE__ */ jsx("text", {
2868
+ fg: theme.error,
2869
+ children: hidden > 0 ? `… +${hidden} more lines · click to expand` : "… click to expand"
2870
+ })]
2817
2871
  });
2818
2872
  }
2819
2873
  /** Indents tool output two columns under its header — no rule, just space. */
@@ -3790,12 +3844,38 @@ function CardItem({ item }) {
3790
3844
  children: [
3791
3845
  /* @__PURE__ */ jsxs("text", {
3792
3846
  fg: theme.fg,
3793
- children: ["⚿ ", card.title]
3847
+ children: [card.questions.length > 0 ? "? " : "⚿ ", card.title]
3794
3848
  }),
3795
3849
  card.subtitle ? /* @__PURE__ */ jsx("text", {
3796
3850
  fg: theme.muted,
3797
3851
  children: card.subtitle
3798
3852
  }) : null,
3853
+ card.questions.map((q, qi) => /* @__PURE__ */ jsxs("box", {
3854
+ style: { flexDirection: "column" },
3855
+ children: [
3856
+ card.questions.length > 1 ? /* @__PURE__ */ jsx("text", {
3857
+ fg: theme.fg,
3858
+ children: q.question
3859
+ }) : null,
3860
+ q.options.map((opt, i) => /* @__PURE__ */ jsxs("text", {
3861
+ fg: theme.muted,
3862
+ children: [
3863
+ " ",
3864
+ String.fromCharCode(65 + i),
3865
+ ". ",
3866
+ opt.label
3867
+ ]
3868
+ }, opt.label)),
3869
+ /* @__PURE__ */ jsxs("text", {
3870
+ fg: theme.dim,
3871
+ children: [
3872
+ " ",
3873
+ String.fromCharCode(65 + q.options.length),
3874
+ ". Other…"
3875
+ ]
3876
+ })
3877
+ ]
3878
+ }, qi)),
3799
3879
  card.description ? /* @__PURE__ */ jsx("markdown", {
3800
3880
  content: card.description,
3801
3881
  syntaxStyle: syntaxStyle(),
@@ -4412,7 +4492,7 @@ function ToolEdit({ item }) {
4412
4492
  item.output?.kind === "error" && /* @__PURE__ */ jsxs(Indented, { children: [/* @__PURE__ */ jsx(ErrorLines, {
4413
4493
  text: item.output.errorText,
4414
4494
  expanded
4415
- }), expanded && isClipped(item.output.errorText, maxErrorLines) && /* @__PURE__ */ jsx(CollapseHint, {})] }),
4495
+ }), expanded && isErrorClipped(item.output.errorText) && /* @__PURE__ */ jsx(CollapseHint, {})] }),
4416
4496
  item.output?.kind === "ok" && pairs === null && inputReady && /* @__PURE__ */ jsx(Indented, { children: /* @__PURE__ */ jsx("text", {
4417
4497
  fg: theme.muted,
4418
4498
  children: summarize(item.output.value, 60)
@@ -4595,7 +4675,7 @@ function ToolBash({ item }) {
4595
4675
  text: item.output.errorText,
4596
4676
  expanded
4597
4677
  }) }),
4598
- expanded && (showCommandBlock && isClipped(commandBlockText, maxCommandLines) || output !== null && isClipped(output, maxLines$1) || item.output?.kind === "error" && isClipped(item.output.errorText, maxErrorLines)) && /* @__PURE__ */ jsx(Indented, { children: /* @__PURE__ */ jsx(CollapseHint, {}) })
4678
+ expanded && (showCommandBlock && isClipped(commandBlockText, maxCommandLines) || output !== null && isClipped(output, maxLines$1) || item.output?.kind === "error" && isErrorClipped(item.output.errorText)) && /* @__PURE__ */ jsx(Indented, { children: /* @__PURE__ */ jsx(CollapseHint, {}) })
4599
4679
  ]
4600
4680
  });
4601
4681
  }
@@ -4666,7 +4746,7 @@ function ToolRead({ item }) {
4666
4746
  item.output?.kind === "error" && /* @__PURE__ */ jsxs(Indented, { children: [/* @__PURE__ */ jsx(ErrorLines, {
4667
4747
  text: item.output.errorText,
4668
4748
  expanded
4669
- }), expanded && isClipped(item.output.errorText, maxErrorLines) && /* @__PURE__ */ jsx(CollapseHint, {})] })
4749
+ }), expanded && isErrorClipped(item.output.errorText) && /* @__PURE__ */ jsx(CollapseHint, {})] })
4670
4750
  ]
4671
4751
  });
4672
4752
  }
@@ -4750,7 +4830,7 @@ function ToolGrep({ item }) {
4750
4830
  item.output?.kind === "error" && /* @__PURE__ */ jsxs(Indented, { children: [/* @__PURE__ */ jsx(ErrorLines, {
4751
4831
  text: item.output.errorText,
4752
4832
  expanded
4753
- }), expanded && isClipped(item.output.errorText, maxErrorLines) && /* @__PURE__ */ jsx(CollapseHint, {})] })
4833
+ }), expanded && isErrorClipped(item.output.errorText) && /* @__PURE__ */ jsx(CollapseHint, {})] })
4754
4834
  ]
4755
4835
  });
4756
4836
  }
@@ -7681,7 +7761,7 @@ const keybindGroups = [
7681
7761
  },
7682
7762
  {
7683
7763
  keys: "ctrl+r",
7684
- action: "act on a waiting connect card (auth cards)"
7764
+ action: "act on a waiting connect / ask card"
7685
7765
  },
7686
7766
  {
7687
7767
  keys: "pgup / pgdn",
@@ -8433,6 +8513,248 @@ function printResumeHint(write = (text) => process.stdout.write(text)) {
8433
8513
  lastConversationId = null;
8434
8514
  }
8435
8515
 
8516
+ //#endregion
8517
+ //#region src/chat/tui/screens/ask-picker.tsx
8518
+ /**
8519
+ * In-TUI picker for a `platform ask` form. Modeled on Claude Code's
8520
+ * AskUserQuestion overlay: one question at a time, a highlighted option
8521
+ * list (Other is the last row), enter selects, letters jump, esc cancels.
8522
+ * Multi-question forms advance after each pick and submit once every
8523
+ * question is answered. The composed answer is a normal user message.
8524
+ */
8525
+ function AskPicker({ questions, onSubmit, onCancel }) {
8526
+ const [active, setActive] = useState(0);
8527
+ const [highlight, setHighlight] = useState(0);
8528
+ const [selected, setSelected] = useState({});
8529
+ const [otherOpen, setOtherOpen] = useState(false);
8530
+ const [otherText, setOtherText] = useState("");
8531
+ const q = questions[active] ?? questions[0];
8532
+ const otherIndex = q ? q.options.length : 0;
8533
+ const doneIndex = q?.multiSelect ? otherIndex + 1 : -1;
8534
+ const rowCount = q?.multiSelect ? otherIndex + 2 : otherIndex + 1;
8535
+ const clamped = Math.min(highlight, Math.max(0, rowCount - 1));
8536
+ const picked = selected[active] ?? [];
8537
+ function answersFor(nextSelected, nextOther) {
8538
+ return questions.map((_, qi) => {
8539
+ const labels = nextSelected[qi] ?? [];
8540
+ if (qi === active && nextOther.trim()) return [...labels, nextOther.trim()];
8541
+ return labels;
8542
+ });
8543
+ }
8544
+ function finish(nextSelected, nextOther) {
8545
+ const answers = answersFor(nextSelected, nextOther);
8546
+ if (answers.some((a) => a.length === 0)) return;
8547
+ onSubmit(composeQuestionAnswer(questions, answers));
8548
+ }
8549
+ function advanceOrSubmit(nextSelected) {
8550
+ const nextUnanswered = questions.findIndex((_, i) => i > active && !(nextSelected[i] ?? []).length);
8551
+ if (nextUnanswered === -1) {
8552
+ finish(nextSelected, "");
8553
+ return;
8554
+ }
8555
+ setSelected(nextSelected);
8556
+ setActive(nextUnanswered);
8557
+ setHighlight(0);
8558
+ setOtherOpen(false);
8559
+ setOtherText("");
8560
+ }
8561
+ function pickOption(idx) {
8562
+ if (!q) return;
8563
+ const opt = q.options[idx];
8564
+ if (!opt) return;
8565
+ if (q.multiSelect) {
8566
+ const cur = selected[active] ?? [];
8567
+ const next = cur.includes(opt.label) ? cur.filter((l) => l !== opt.label) : [...cur, opt.label];
8568
+ setSelected({
8569
+ ...selected,
8570
+ [active]: next
8571
+ });
8572
+ return;
8573
+ }
8574
+ advanceOrSubmit({
8575
+ ...selected,
8576
+ [active]: [opt.label]
8577
+ });
8578
+ }
8579
+ function goToQuestion(index) {
8580
+ if (index < 0 || index >= questions.length || index === active) return;
8581
+ setActive(index);
8582
+ setHighlight(0);
8583
+ setOtherOpen(false);
8584
+ setOtherText("");
8585
+ }
8586
+ useKeyboard((key) => {
8587
+ if (!q) return;
8588
+ if (key.name === "escape") {
8589
+ if (otherOpen) {
8590
+ setOtherOpen(false);
8591
+ setOtherText("");
8592
+ return;
8593
+ }
8594
+ onCancel();
8595
+ return;
8596
+ }
8597
+ if (otherOpen) {
8598
+ if (key.name === "return" || key.name === "kpenter") {
8599
+ key.preventDefault();
8600
+ const custom = otherText.trim();
8601
+ if (!custom) return;
8602
+ const nextSelected = {
8603
+ ...selected,
8604
+ [active]: q.multiSelect ? [...selected[active] ?? [], custom] : [custom]
8605
+ };
8606
+ if (q.multiSelect) {
8607
+ setSelected(nextSelected);
8608
+ setOtherOpen(false);
8609
+ setOtherText("");
8610
+ return;
8611
+ }
8612
+ advanceOrSubmit(nextSelected);
8613
+ return;
8614
+ }
8615
+ if (key.name === "backspace") {
8616
+ setOtherText((t) => t.slice(0, -1));
8617
+ return;
8618
+ }
8619
+ const ch = key.sequence ?? key.name;
8620
+ if (ch && ch.length === 1 && !key.ctrl && !key.meta) setOtherText((t) => t + ch);
8621
+ return;
8622
+ }
8623
+ if (key.name === "up") {
8624
+ setHighlight(Math.max(0, clamped - 1));
8625
+ return;
8626
+ }
8627
+ if (key.name === "down") {
8628
+ setHighlight(Math.min(rowCount - 1, clamped + 1));
8629
+ return;
8630
+ }
8631
+ if (key.name === "left" || (key.name === "tab" || key.sequence === "\x1B[Z") && key.shift) {
8632
+ key.preventDefault();
8633
+ goToQuestion(active - 1);
8634
+ return;
8635
+ }
8636
+ if (key.name === "right" || key.name === "tab" && !key.shift) {
8637
+ key.preventDefault();
8638
+ goToQuestion(active + 1);
8639
+ return;
8640
+ }
8641
+ if (key.name === "space" || key.sequence === " ") {
8642
+ key.preventDefault();
8643
+ if (!q.multiSelect) return;
8644
+ if (clamped === otherIndex) {
8645
+ setOtherOpen(true);
8646
+ return;
8647
+ }
8648
+ if (clamped === doneIndex) {
8649
+ if (picked.length === 0) return;
8650
+ advanceOrSubmit({
8651
+ ...selected,
8652
+ [active]: picked
8653
+ });
8654
+ return;
8655
+ }
8656
+ pickOption(clamped);
8657
+ return;
8658
+ }
8659
+ if (key.name === "return" || key.name === "kpenter") {
8660
+ key.preventDefault();
8661
+ if (clamped === otherIndex) {
8662
+ setOtherOpen(true);
8663
+ return;
8664
+ }
8665
+ if (clamped === doneIndex) {
8666
+ if (picked.length === 0) return;
8667
+ advanceOrSubmit({
8668
+ ...selected,
8669
+ [active]: picked
8670
+ });
8671
+ return;
8672
+ }
8673
+ pickOption(clamped);
8674
+ return;
8675
+ }
8676
+ const letter = (key.sequence ?? key.name ?? "").toLowerCase();
8677
+ if (letter.length === 1 && /[a-z]/.test(letter)) {
8678
+ const idx = letter.charCodeAt(0) - 97;
8679
+ if (idx === otherIndex || letter === "o") {
8680
+ setHighlight(otherIndex);
8681
+ setOtherOpen(true);
8682
+ return;
8683
+ }
8684
+ if (q.options[idx]) {
8685
+ setHighlight(idx);
8686
+ pickOption(idx);
8687
+ }
8688
+ }
8689
+ });
8690
+ if (!q) return null;
8691
+ const nav = questions.length > 1 ? `${active + 1}/${questions.length}` : null;
8692
+ return /* @__PURE__ */ jsxs("box", {
8693
+ style: {
8694
+ flexDirection: "column",
8695
+ flexGrow: 1
8696
+ },
8697
+ children: [
8698
+ nav ? /* @__PURE__ */ jsx("text", {
8699
+ fg: theme.dim,
8700
+ children: nav
8701
+ }) : null,
8702
+ /* @__PURE__ */ jsx("text", {
8703
+ fg: theme.fg,
8704
+ children: q.question
8705
+ }),
8706
+ /* @__PURE__ */ jsxs("box", {
8707
+ style: {
8708
+ flexDirection: "column",
8709
+ marginTop: 1
8710
+ },
8711
+ children: [
8712
+ q.options.map((opt, i) => {
8713
+ const isHi = !otherOpen && i === clamped;
8714
+ const isPicked = picked.includes(opt.label);
8715
+ return /* @__PURE__ */ jsxs("text", {
8716
+ fg: isHi ? theme.accent : theme.fg,
8717
+ children: [
8718
+ isHi ? "› " : " ",
8719
+ q.multiSelect ? isPicked ? "☑ " : "☐ " : "",
8720
+ String.fromCharCode(65 + i),
8721
+ ". ",
8722
+ opt.label
8723
+ ]
8724
+ }, opt.label);
8725
+ }),
8726
+ otherOpen ? /* @__PURE__ */ jsxs("text", {
8727
+ fg: theme.accent,
8728
+ children: [
8729
+ "› Other: ",
8730
+ otherText,
8731
+ /* @__PURE__ */ jsx("span", {
8732
+ fg: theme.dim,
8733
+ children: "_"
8734
+ })
8735
+ ]
8736
+ }) : /* @__PURE__ */ jsxs("text", {
8737
+ fg: clamped === otherIndex ? theme.accent : theme.muted,
8738
+ children: [
8739
+ clamped === otherIndex ? "› " : " ",
8740
+ String.fromCharCode(65 + otherIndex),
8741
+ ". Other"
8742
+ ]
8743
+ }),
8744
+ q.multiSelect && !otherOpen ? /* @__PURE__ */ jsxs("text", {
8745
+ fg: clamped === doneIndex ? theme.accent : theme.muted,
8746
+ children: [clamped === doneIndex ? "› " : " ", "Done"]
8747
+ }) : null
8748
+ ]
8749
+ }),
8750
+ /* @__PURE__ */ jsx("text", {
8751
+ fg: theme.dim,
8752
+ children: otherOpen ? "↵ submit · esc back" : q.multiSelect ? questions.length > 1 ? "space toggle · ← back · Done to continue · esc cancel" : "space toggle · Done to continue · esc cancel" : questions.length > 1 ? "↵ select · ← back · ↑/↓ move · esc cancel" : "↵ select · ↑/↓ move · esc cancel"
8753
+ })
8754
+ ]
8755
+ });
8756
+ }
8757
+
8436
8758
  //#endregion
8437
8759
  //#region src/chat/tui/screens/card-picker.tsx
8438
8760
  /**
@@ -11969,10 +12291,12 @@ function ChatScreen({ agent, conversation, attachRunId }) {
11969
12291
  const credPromptOpen = credPrompt !== null;
11970
12292
  const [computePrompt, setComputePrompt] = useState(null);
11971
12293
  const computePromptOpen = computePrompt !== null;
12294
+ const [askPrompt, setAskPrompt] = useState(null);
12295
+ const askPromptOpen = askPrompt !== null;
11972
12296
  const [restartConfirm, setRestartConfirm] = useState(false);
11973
12297
  const [menuDismissed, setMenuDismissed] = useState(false);
11974
12298
  const [menuHighlight, setMenuHighlight] = useState(0);
11975
- const commandQuery = grantPrompt || credPrompt || computePrompt || restartConfirm ? null : detectCommandTrigger(input);
12299
+ const commandQuery = grantPrompt || credPrompt || computePrompt || askPrompt || restartConfirm ? null : detectCommandTrigger(input);
11976
12300
  const menuCommands = commandQuery === null ? [] : filterSlashCommands(commandQuery);
11977
12301
  const menuOpen = commandQuery !== null && !menuDismissed;
11978
12302
  const menuHighlightClamped = Math.min(menuHighlight, Math.max(0, menuCommands.length - 1));
@@ -11990,7 +12314,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
11990
12314
  credPromptRef.current = credPrompt;
11991
12315
  const seenRunsRef = useRef(/* @__PURE__ */ new Set());
11992
12316
  const shellSessionRef = useRef(null);
11993
- const hostState = grantPrompt || credPrompt || computePrompt || restartConfirm ? "blocked" : run.kind === "idle" ? "idle" : "working";
12317
+ const hostState = grantPrompt || credPrompt || computePrompt || askPrompt || restartConfirm ? "blocked" : run.kind === "idle" ? "idle" : "working";
11994
12318
  useEffect(() => {
11995
12319
  agentHost.transition({ state: hostState });
11996
12320
  }, [agentHost, hostState]);
@@ -12046,7 +12370,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
12046
12370
  const reviewBelowBoxRef = useRef(null);
12047
12371
  const paneDragRef = useRef(null);
12048
12372
  const composerBoxHeight = composerRows + 2;
12049
- const pendingVisible = !grantPrompt && !credPrompt && !computePrompt && !nonWebChannel && attachments.length > 0;
12373
+ const pendingVisible = !grantPrompt && !credPrompt && !computePrompt && !askPrompt && !nonWebChannel && attachments.length > 0;
12050
12374
  const pendingRows = pendingVisible ? attachments.length + 2 : 0;
12051
12375
  const credPromptHeight = 4 + (credPrompt && (credPrompt.error || credPrompt.submitting) ? 1 : 0);
12052
12376
  const nonWebNoticeHeight = 5;
@@ -12112,7 +12436,8 @@ function ChatScreen({ agent, conversation, attachRunId }) {
12112
12436
  reviewFocused,
12113
12437
  reviewPlacement,
12114
12438
  credPromptOpen,
12115
- computePromptOpen
12439
+ computePromptOpen,
12440
+ askPromptOpen
12116
12441
  ]);
12117
12442
  useEffect(() => {
12118
12443
  if (!rest || !initialConversationId) return;
@@ -12514,6 +12839,13 @@ function ChatScreen({ agent, conversation, attachRunId }) {
12514
12839
  });
12515
12840
  return;
12516
12841
  }
12842
+ if (action.kind === "answer_question") {
12843
+ setAskPrompt({
12844
+ cardId: item.id,
12845
+ questions: item.card.questions
12846
+ });
12847
+ return;
12848
+ }
12517
12849
  updateCard(item.id, {
12518
12850
  status: "busy",
12519
12851
  detail: null
@@ -12628,6 +12960,11 @@ function ChatScreen({ agent, conversation, attachRunId }) {
12628
12960
  const target = items.find((m) => m.kind === "card" && m.id === computePrompt.cardId);
12629
12961
  if (!target || target.card.settled !== null || target.status === "done") setComputePrompt(null);
12630
12962
  }, [computePrompt, items]);
12963
+ useEffect(() => {
12964
+ if (!askPrompt) return;
12965
+ const target = items.find((m) => m.kind === "card" && m.id === askPrompt.cardId);
12966
+ if (!target || target.card.settled !== null || target.status === "done") setAskPrompt(null);
12967
+ }, [askPrompt, items]);
12631
12968
  const promptForCards = useCallback(() => {
12632
12969
  const targets = itemsRef.current.filter(isActionableCard);
12633
12970
  const [only] = targets;
@@ -12913,7 +13250,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
12913
13250
  stageAttachment(image);
12914
13251
  }, [stageAttachment]);
12915
13252
  usePaste((event) => {
12916
- if (cardPickerOpen || modelPickerOpen || themePickerOpen || prPickerOpen || helpOpen || bgTasksOpen || credPromptOpen || grantPrompt || computePromptOpen || restartConfirm || nonWebChannel) return;
13253
+ if (cardPickerOpen || modelPickerOpen || themePickerOpen || prPickerOpen || helpOpen || bgTasksOpen || credPromptOpen || grantPrompt || computePromptOpen || askPromptOpen || restartConfirm || nonWebChannel) return;
12917
13254
  const text = event.metadata?.kind === "binary" ? "" : decodePasteBytes(event.bytes);
12918
13255
  const route = routePaste({
12919
13256
  kind: event.metadata?.kind,
@@ -13052,7 +13389,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
13052
13389
  goTo
13053
13390
  ]);
13054
13391
  const archiveConversation = useCallback(() => {
13055
- if (grantPrompt || credPrompt || computePrompt || restartConfirm) return;
13392
+ if (grantPrompt || credPrompt || computePrompt || askPrompt || restartConfirm) return;
13056
13393
  if (agentRunConversation) {
13057
13394
  useStore.getState().showToast({ message: "agent runs can't be archived — ctrl+d in the picker deletes" });
13058
13395
  return;
@@ -13087,6 +13424,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
13087
13424
  grantPrompt,
13088
13425
  credPrompt,
13089
13426
  computePrompt,
13427
+ askPrompt,
13090
13428
  restartConfirm,
13091
13429
  agentRunConversation,
13092
13430
  conversationId,
@@ -13537,7 +13875,7 @@ function ChatScreen({ agent, conversation, attachRunId }) {
13537
13875
  }
13538
13876
  if (reviewFocused) return;
13539
13877
  }
13540
- if (cardPickerOpen || modelPickerOpen || themePickerOpen || prPickerOpen || helpOpen || bgTasksOpen) return;
13878
+ if (cardPickerOpen || askPromptOpen || modelPickerOpen || themePickerOpen || prPickerOpen || helpOpen || bgTasksOpen) return;
13541
13879
  if (grantPrompt) {
13542
13880
  if (key.name === "y") {
13543
13881
  confirmGrant();
@@ -13789,6 +14127,19 @@ function ChatScreen({ agent, conversation, attachRunId }) {
13789
14127
  nonWebChannel
13790
14128
  ]);
13791
14129
  const modelHint = formatModelHint(model, effort);
14130
+ if (askPrompt) return /* @__PURE__ */ jsx(AskPicker, {
14131
+ questions: askPrompt.questions,
14132
+ onSubmit: (text) => {
14133
+ const cardId = askPrompt.cardId;
14134
+ setAskPrompt(null);
14135
+ updateCard(cardId, {
14136
+ status: "done",
14137
+ detail: text
14138
+ });
14139
+ sendContent(text, []);
14140
+ },
14141
+ onCancel: () => setAskPrompt(null)
14142
+ });
13792
14143
  if (cardPickerOpen) return /* @__PURE__ */ jsx(CardPicker, {
13793
14144
  cards: actionableCards,
13794
14145
  onSelect: (card) => {
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as mintPortalDeviceToken, c as unifyLegacyCliGrants, i as grantPortalAccess, l as startTlsForward, n as fetchPortalDevices, r as findThisDevice } from "./api-DQCaztBg.mjs";
2
+ import { a as mintPortalDeviceToken, c as unifyLegacyCliGrants, i as grantPortalAccess, l as startTlsForward, n as fetchPortalDevices, r as findThisDevice } from "./api-TwLD7ibI.mjs";
3
3
  import os from "node:os";
4
4
  import { z } from "zod";
5
5
  import * as childProcess from "node:child_process";
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { t as PortalClient } from "./client-BnpgrtCC.mjs";
3
+ import "./api-TwLD7ibI.mjs";
4
+
5
+ export { PortalClient };
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import "./client-BnpgrtCC.mjs";
3
+ import "./daemon-w8vtZ81t.mjs";
4
+ import "./tls-cert-CV-pwxVN.mjs";
5
+ import "./api-TwLD7ibI.mjs";
6
+ import { t as PortalDaemonClient } from "./daemon-client-KKNss0NK.mjs";
7
+
8
+ export { PortalDaemonClient };
@@ -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-D8WoX21I.mjs";
2
+ import { c as LOCAL_PROTOCOL_VERSION, d as encodeLine, f as makeLineParser, n as ensureDaemonRunning, p as parseDaemonMessage, u as daemonPaths } from "./daemon-w8vtZ81t.mjs";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { connect } from "node:net";
5
5
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
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";
2
+ import "./client-BnpgrtCC.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-w8vtZ81t.mjs";
4
4
  import "./tls-cert-CV-pwxVN.mjs";
5
- import "./api-DQCaztBg.mjs";
5
+ import "./api-TwLD7ibI.mjs";
6
6
 
7
7
  export { runPortalDaemon };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as isRecord, t as PortalClient } from "./client-DMYwKALl.mjs";
2
+ import { n as isRecord, t as PortalClient } from "./client-BnpgrtCC.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 "1786915412";
24
+ return "1786941153";
25
25
  }
26
26
  /**
27
27
  * Whether a client carrying `mine` should replace a running daemon carrying
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { r as warnOnRebindProtection } from "./tls-cert-CV-pwxVN.mjs";
3
- import { l as startTlsForward, t as fetchForwardTarget } from "./api-DQCaztBg.mjs";
3
+ import { l as startTlsForward, t as fetchForwardTarget } from "./api-TwLD7ibI.mjs";
4
4
  import net from "node:net";
5
5
  import { WebSocket, createWebSocketStream } from "ws";
6
6
 
@@ -1,16 +1,12 @@
1
1
  #!/usr/bin/env node
2
- import { C as getConfigPath } from "./print-CwbdwCeQ.mjs";
2
+ import { s as version$1 } from "./rest-DpsJUYTL.mjs";
3
+ import { w as getConfigPath } from "./print-Ds16-Q4O.mjs";
3
4
  import os from "node:os";
4
5
  import path from "node:path";
5
6
  import { err, ok } from "neverthrow";
6
7
  import { z } from "zod";
7
8
  import fs from "node:fs";
8
9
 
9
- //#region package.json
10
- var name = "skydive-cli";
11
- var version$1 = "0.5.0-beta.41";
12
-
13
- //#endregion
14
10
  //#region src/auth/organization.ts
15
11
  const workspaceSchema = z.object({
16
12
  id: z.string(),
@@ -1582,4 +1578,4 @@ function printFatalNotice(file, memory) {
1582
1578
  }
1583
1579
 
1584
1580
  //#endregion
1585
- export { installAgentAlias as A, resolveWorkspaceId as B, themeVersion as C, machineOsFromPlatform as D, buildImportSeedPrompt as E, detectShell as F, name as H, ensureActiveOrganization as I, getActiveWorkspaceId as L, takenAliasNames as M, SUPPORTED_SHELLS as N, aliasActivationHint as O, defaultInstallEnv as P, getSessionIdentity as R, themeModeFromColorFgBg as S, themesForMode as T, version$1 as U, setActiveWorkspace as V, monoTheme as _, WORDMARK as a, themeForMode as b, getAutomaticLogsDir as c, profilingEnabled as d, record as f, findTheme as g, applyTheme as h, MARK_CELLS as i, slugifyAliasName as j, dedupeAliasName as k, maybeStartProfiling as l, DEFAULT_THEME_ID as m, buildCrashReport as n, brandHelpArt as o, writeArtifact as p, writeCrashReport as r, splashFitsWidth as s, installCrashHandler as t, profileDir as u, noColorRequested as v, themes as w, themeMode as x, theme as y, listWorkspaces as z };
1581
+ export { installAgentAlias as A, resolveWorkspaceId as B, themeVersion as C, machineOsFromPlatform as D, buildImportSeedPrompt as E, detectShell as F, ensureActiveOrganization as I, getActiveWorkspaceId as L, takenAliasNames as M, SUPPORTED_SHELLS as N, aliasActivationHint as O, defaultInstallEnv as P, getSessionIdentity as R, themeModeFromColorFgBg as S, themesForMode as T, setActiveWorkspace as V, monoTheme as _, WORDMARK as a, themeForMode as b, getAutomaticLogsDir as c, profilingEnabled as d, record as f, findTheme as g, applyTheme as h, MARK_CELLS as i, slugifyAliasName as j, dedupeAliasName as k, maybeStartProfiling as l, DEFAULT_THEME_ID as m, buildCrashReport as n, brandHelpArt as o, writeArtifact as p, writeCrashReport as r, splashFitsWidth as s, installCrashHandler as t, profileDir as u, noColorRequested as v, themes as w, themeMode as x, theme as y, listWorkspaces as z };
@@ -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-CwbdwCeQ.mjs";
3
- import "./rest-Bbe-RhMy.mjs";
2
+ import "./rest-DpsJUYTL.mjs";
3
+ import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-Ds16-Q4O.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
- 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-Bbe-RhMy.mjs";
2
+ import { a as isRecord, i as errorMessage, r as sendErrorMessage, t as createRestClient } from "./rest-DpsJUYTL.mjs";
3
+ import { t as HttpError } from "./http-error-BF2NZZE3.mjs";
4
4
  import { i as billingBlockedOutcomeFromSendResponse, n as BillingBlockedError } from "./billing-blocked-D3l5kJlX.mjs";
5
5
  import path from "node:path";
6
6
  import Conf from "conf";
@@ -440,7 +440,8 @@ function parseDesktopHandoffCard(rootEl) {
440
440
  },
441
441
  state: {},
442
442
  computeRequestId: null,
443
- settled: null
443
+ settled: null,
444
+ questions: []
444
445
  };
445
446
  }
446
447
  /**
@@ -478,7 +479,70 @@ function parseComputeRequestCard(rootEl) {
478
479
  },
479
480
  state: {},
480
481
  computeRequestId: requestId,
481
- settled
482
+ settled,
483
+ questions: []
484
+ };
485
+ }
486
+ function readQuestionOptions(raw) {
487
+ if (!Array.isArray(raw)) return [];
488
+ return raw.flatMap((o) => {
489
+ if (!isRecord(o)) return [];
490
+ const label = optionalString(o.label);
491
+ if (!label) return [];
492
+ return [{ label }];
493
+ });
494
+ }
495
+ function readQuestionEntries(raw) {
496
+ if (!Array.isArray(raw)) return [];
497
+ return raw.flatMap((q) => {
498
+ if (!isRecord(q)) return [];
499
+ const question = optionalString(q.question);
500
+ if (!question) return [];
501
+ const options = readQuestionOptions(q.options);
502
+ if (options.length < 2) return [];
503
+ return [{
504
+ question,
505
+ options,
506
+ multiSelect: Boolean(q.multiSelect)
507
+ }];
508
+ });
509
+ }
510
+ /**
511
+ * The `platform ask` form. The web renders it as an interactive picker; here
512
+ * it maps onto an answer_question button so ctrl+r (and letter shortcuts)
513
+ * open an in-TUI picker. The composed answer is sent as a normal user
514
+ * message — same non-blocking model as the web card. Without this the spec
515
+ * is not a Card, parses to null, and the question is silently dropped.
516
+ */
517
+ /** Compose the user-message body the web card also sends. */
518
+ function composeQuestionAnswer(questions, answers) {
519
+ if (questions.length === 1) return (answers[0] ?? []).join(", ");
520
+ return questions.map((q, i) => `${q.question} → ${(answers[i] ?? []).join(", ")}`).join("\n");
521
+ }
522
+ function parseQuestionCard(rootEl) {
523
+ const props = isRecord(rootEl.props) ? rootEl.props : {};
524
+ const cardId = optionalString(props.cardId);
525
+ if (!cardId) return null;
526
+ const questions = readQuestionEntries(props.questions);
527
+ if (questions.length === 0) return null;
528
+ const settled = (props.status === "answered" ? "answered" : "pending") === "answered" ? optionalString(props.answerSummary) ?? "answered" : null;
529
+ const only = questions.length === 1 ? questions[0] : void 0;
530
+ return {
531
+ title: only ? only.question : "Questions",
532
+ subtitle: null,
533
+ description: null,
534
+ fields: [],
535
+ button: settled ? null : {
536
+ label: "Answer",
537
+ action: {
538
+ kind: "answer_question",
539
+ cardId
540
+ }
541
+ },
542
+ state: {},
543
+ computeRequestId: null,
544
+ settled,
545
+ questions
482
546
  };
483
547
  }
484
548
  function parseConnectCard(spec) {
@@ -489,6 +553,7 @@ function parseConnectCard(spec) {
489
553
  if (!isRecord(rootEl)) return null;
490
554
  if (rootEl.type === "DesktopHandoffCard") return parseDesktopHandoffCard(rootEl);
491
555
  if (rootEl.type === "ComputeRequestCard") return parseComputeRequestCard(rootEl);
556
+ if (rootEl.type === "QuestionCard") return parseQuestionCard(rootEl);
492
557
  if (rootEl.type !== "Card") return null;
493
558
  const rootProps = isRecord(rootEl.props) ? rootEl.props : {};
494
559
  const title = optionalString(rootProps.title);
@@ -529,7 +594,8 @@ function parseConnectCard(spec) {
529
594
  } : null,
530
595
  state: isRecord(spec.state) ? spec.state : {},
531
596
  computeRequestId: null,
532
- settled: null
597
+ settled: null,
598
+ questions: []
533
599
  };
534
600
  }
535
601
 
@@ -677,6 +743,13 @@ function summarizeConnectCard(card, appUrl) {
677
743
  requestId: act.requestId
678
744
  }
679
745
  };
746
+ case "answer_question": return {
747
+ ...base,
748
+ action: {
749
+ kind: "answer_question",
750
+ questions: card.questions.map((q) => q.question)
751
+ }
752
+ };
680
753
  default: return {
681
754
  ...base,
682
755
  action: { kind: "unsupported" }
@@ -717,6 +790,9 @@ function formatConnectCard(card) {
717
790
  case "decide_compute":
718
791
  lines.push("Approve or deny this compute increase in the interactive TUI or web app.");
719
792
  break;
793
+ case "answer_question":
794
+ lines.push(`Answer in the interactive TUI or web app: ${card.action.questions.join("; ")}`);
795
+ break;
720
796
  case "unsupported":
721
797
  lines.push("Open this conversation in the web app to continue.");
722
798
  break;
@@ -936,4 +1012,4 @@ async function readStdin() {
936
1012
  }
937
1013
 
938
1014
  //#endregion
939
- export { getShareMachineDefault as A, resolveWebUrl as B, getConfigPath as C, getPromptHistoryPath as D, getPreference as E, resolveAppUrl as F, saveSession as H, resolveChatAuth as I, resolveConfig as L, getStoredApiKeyWorkspaceName as M, getUpdateCheckDisabled as N, getReviewStateDir as O, recordDefaultAgent as P, resolveManagementAuth as R, deleteConfig as S, getLastSeenVersion as T, saveTheme as U, saveConfig as V, setLastSeenVersion as W, API_KEY_FAMILY_PREFIX as _, runPrint as a, DEFAULT_APP_URL as b, cardActionErrorMessage as c, reconcileMaskedInput as d, resolveConnectUrl as f, API_KEYS_URL as g, specKeyFor as h, resolveAgent as i, getStoredApiKeyId as j, getSavedTheme as k, parseExternalOauthConnectParams as l, parseConnectCard as m, messageGet as n, toPrintError as o, computeSettledLabel as p, readStdin as r, MASK_CHAR as s, collectRunText as t, parseOauthConnectParams as u, API_KEY_PREFIX as v, getDefaultAgent as w, PREFERENCES as x, DEFAULT_API_URL as y, resolveSession as z };
1015
+ export { getSavedTheme as A, resolveSession as B, deleteConfig as C, getPreference as D, getLastSeenVersion as E, recordDefaultAgent as F, setLastSeenVersion as G, saveConfig as H, resolveAppUrl as I, resolveChatAuth as L, getStoredApiKeyId as M, getStoredApiKeyWorkspaceName as N, getPromptHistoryPath as O, getUpdateCheckDisabled as P, resolveConfig as R, PREFERENCES as S, getDefaultAgent as T, saveSession as U, resolveWebUrl as V, saveTheme as W, API_KEYS_URL as _, runPrint as a, DEFAULT_API_URL as b, cardActionErrorMessage as c, reconcileMaskedInput as d, resolveConnectUrl as f, specKeyFor as g, parseConnectCard as h, resolveAgent as i, getShareMachineDefault as j, getReviewStateDir as k, parseExternalOauthConnectParams as l, computeSettledLabel as m, messageGet as n, toPrintError as o, composeQuestionAnswer as p, readStdin as r, MASK_CHAR as s, collectRunText as t, parseOauthConnectParams as u, API_KEY_FAMILY_PREFIX as v, getConfigPath as w, DEFAULT_APP_URL as x, API_KEY_PREFIX as y, resolveManagementAuth as z };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as printError } from "./output-wY0VQDea.mjs";
2
+ import { n as printError } from "./output-C9mb3sUB.mjs";
3
3
 
4
4
  //#region src/chat/print-share.ts
5
5
  /**
@@ -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-DCwVlAal.mjs");
17
+ const { PortalClient } = await import("./client-Cga4PJUc.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
- import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
3
- import { n as errorDetail, r as sendErrorMessage, t as createRestClient } from "./rest-Bbe-RhMy.mjs";
2
+ import { n as errorDetail, r as sendErrorMessage, t as createRestClient } from "./rest-DpsJUYTL.mjs";
3
+ import { t as HttpError } from "./http-error-BF2NZZE3.mjs";
4
4
  import "./billing-blocked-D3l5kJlX.mjs";
5
5
 
6
6
  export { createRestClient };
@@ -1,9 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
2
+ import { t as HttpError } from "./http-error-BF2NZZE3.mjs";
3
3
  import { a as billingBlockedOutcomeSchema } from "./billing-blocked-D3l5kJlX.mjs";
4
4
  import { z } from "zod";
5
5
  import { createParser } from "eventsource-parser";
6
6
 
7
+ //#region package.json
8
+ var name = "skydive-cli";
9
+ var version = "0.5.0-beta.44";
10
+
11
+ //#endregion
7
12
  //#region src/chat/util.ts
8
13
  /** Narrowing helper for the many `unknown` payloads the chat stream and
9
14
  * tool inputs/outputs carry. A type predicate (not an `as` cast), so call
@@ -18,6 +23,7 @@ function errorMessage(err) {
18
23
 
19
24
  //#endregion
20
25
  //#region src/chat/api/rest.ts
26
+ const CLI_VERSION_HEADER = "x-skydive-cli-version";
21
27
  const ERROR_DETAIL_MAX_BODY = 2e3;
22
28
  /**
23
29
  * Fullest renderable text for a thrown value. `HttpError.message` clips the
@@ -104,7 +110,8 @@ const MAX_STREAM_RECONNECTS = 5;
104
110
  function createRestClient({ appUrl, sessionToken, workspaceId }) {
105
111
  const baseHeaders = {
106
112
  authorization: `Bearer ${sessionToken}`,
107
- accept: "application/json"
113
+ accept: "application/json",
114
+ [CLI_VERSION_HEADER]: version
108
115
  };
109
116
  if (workspaceId) baseHeaders["x-workspace-id"] = workspaceId;
110
117
  async function get(path, schema) {
@@ -147,7 +154,8 @@ function createRestClient({ appUrl, sessionToken, workspaceId }) {
147
154
  try {
148
155
  const headers = {
149
156
  authorization: `Bearer ${sessionToken}`,
150
- accept: "text/event-stream"
157
+ accept: "text/event-stream",
158
+ [CLI_VERSION_HEADER]: version
151
159
  };
152
160
  if (workspaceId) headers["x-workspace-id"] = workspaceId;
153
161
  if (lastEventId) headers["last-event-id"] = lastEventId;
@@ -441,6 +449,7 @@ function createRestClient({ appUrl, sessionToken, workspaceId }) {
441
449
  headers: {
442
450
  authorization: `Bearer ${sessionToken}`,
443
451
  accept: "text/event-stream",
452
+ [CLI_VERSION_HEADER]: version,
444
453
  ...workspaceId ? { "x-workspace-id": workspaceId } : {}
445
454
  },
446
455
  signal
@@ -687,4 +696,4 @@ const conversationStreamEventSchema = z.discriminatedUnion("kind", [
687
696
  ]);
688
697
 
689
698
  //#endregion
690
- export { isRecord as a, errorMessage as i, errorDetail as n, sendErrorMessage as r, createRestClient as t };
699
+ export { isRecord as a, errorMessage as i, errorDetail as n, name as o, sendErrorMessage as r, version as s, createRestClient as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skydive-cli",
3
- "version": "0.5.0-beta.41",
3
+ "version": "0.5.0-beta.44",
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.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"
72
+ "skydive-cli-darwin-arm64": "0.5.0-beta.44",
73
+ "skydive-cli-darwin-x64": "0.5.0-beta.44",
74
+ "skydive-cli-linux-x64": "0.5.0-beta.44",
75
+ "skydive-cli-linux-arm64": "0.5.0-beta.44"
76
76
  }
77
77
  }
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import { t as PortalClient } from "./client-DMYwKALl.mjs";
3
- import "./api-DQCaztBg.mjs";
4
-
5
- export { PortalClient };
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import "./client-DMYwKALl.mjs";
3
- import "./daemon-D8WoX21I.mjs";
4
- import "./tls-cert-CV-pwxVN.mjs";
5
- import "./api-DQCaztBg.mjs";
6
- import { t as PortalDaemonClient } from "./daemon-client-Bp5DMeIi.mjs";
7
-
8
- export { PortalDaemonClient };