skydive-cli 0.2.0-beta.693 → 0.2.0-beta.700

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/dist/js/bin.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { C as setActiveWorkspace, S as listWorkspaces, T as version, _ as themes, b as getActiveWorkspaceId, o as brandHelpArt, t as installCrashHandler, w as name, x as getSessionIdentity, y as ensureActiveOrganization } from "./install-D7zXhVT1.mjs";
3
- import { A as resolveAppUrl, C as getPromptHistoryPath, D as getStoredApiKeyId, E as getShareMachineDefault, F as saveConfig, I as saveSession, M as resolveManagementAuth, N as resolveSession, O as getStoredApiKeyWorkspaceName, R as setLastSeenVersion, S as getLastSeenVersion, _ as API_KEY_PREFIX, b as deleteConfig, g as API_KEY_FAMILY_PREFIX, h as API_KEYS_URL, i as resolveAgent, j as resolveConfig, k as getUpdateCheckDisabled, v as DEFAULT_API_URL, x as getConfigPath } from "./print-BUbxOvnm.mjs";
2
+ import { C as setActiveWorkspace, S as listWorkspaces, T as version, _ as themes, b as getActiveWorkspaceId, o as brandHelpArt, t as installCrashHandler, w as name, x as getSessionIdentity, y as ensureActiveOrganization } from "./install-DVPqms6J.mjs";
3
+ import { A as resolveAppUrl, C as getPromptHistoryPath, D as getStoredApiKeyId, E as getShareMachineDefault, F as saveConfig, I as saveSession, M as resolveManagementAuth, N as resolveSession, O as getStoredApiKeyWorkspaceName, R as setLastSeenVersion, S as getLastSeenVersion, _ as API_KEY_PREFIX, b as deleteConfig, g as API_KEY_FAMILY_PREFIX, h as API_KEYS_URL, i as resolveAgent, j as resolveConfig, k as getUpdateCheckDisabled, v as DEFAULT_API_URL, x as getConfigPath } from "./print-CcvhSMi9.mjs";
4
4
  import { n as printError, r as printTable, t as output } from "./output-DYzzdXYV.mjs";
5
- import { n as createRestClient } from "./rest-CCyln7vx.mjs";
6
- import { a as registerPortalDevice, i as grantPortalAccess, n as fetchPortalDevices, o as revokePortalAccess, r as findThisDevice, s as machineIdentity } from "./client-O5KfzIaB.mjs";
7
- import { c as PORTAL_DAEMON_FLAG, i as queryDaemonStatus, l as daemonPaths, n as ensureDaemonRunning, o as stopDaemon } from "./daemon-Dk4RinJn.mjs";
5
+ import { n as createRestClient } from "./rest-B5v4v5ux.mjs";
6
+ import { a as registerPortalDevice, i as grantPortalAccess, n as fetchPortalDevices, o as revokePortalAccess, r as findThisDevice, s as machineIdentity } from "./client-DqidlIb-.mjs";
7
+ import { c as PORTAL_DAEMON_FLAG, i as queryDaemonStatus, l as daemonPaths, n as ensureDaemonRunning, o as stopDaemon } from "./daemon-mXhmMGsS.mjs";
8
8
  import { t as SandboxStream } from "./client-DfcJFEbh.mjs";
9
9
  import { hideBin } from "yargs/helpers";
10
10
  import yargs from "yargs";
@@ -1500,7 +1500,7 @@ const importCommand = {
1500
1500
  process.exit(1);
1501
1501
  }
1502
1502
  }
1503
- const { runChat } = await import("./boot-BCV5bnUy.mjs");
1503
+ const { runChat } = await import("./boot-BLk76r4J.mjs");
1504
1504
  await runChat({
1505
1505
  appUrl,
1506
1506
  sessionToken: session.value.sessionToken,
@@ -1527,7 +1527,7 @@ async function runImportPrintMode({ argv, appUrl }) {
1527
1527
  printError(`${session.error.message} For non-interactive use, run \`skydive auth login --web\` first, or set SKYDIVE_SESSION_TOKEN.`);
1528
1528
  process.exit(1);
1529
1529
  }
1530
- const { connectMachineShare } = await import("./print-share-BTGabspc.mjs");
1530
+ const { connectMachineShare } = await import("./print-share-88a3VFKn.mjs");
1531
1531
  const machineShare = await connectMachineShare({
1532
1532
  appUrl,
1533
1533
  sessionToken: session.value.sessionToken,
@@ -1535,7 +1535,7 @@ async function runImportPrintMode({ argv, appUrl }) {
1535
1535
  });
1536
1536
  const extra = (argv.print ?? "").trim();
1537
1537
  const prompt = buildImportSeedPrompt(process.cwd()) + (extra ? `\n\nAdditional instructions: ${extra}` : "");
1538
- const { runPrint } = await import("./print-DZC3Xxnl.mjs");
1538
+ const { runPrint } = await import("./print-CXRJLvyp.mjs");
1539
1539
  try {
1540
1540
  const result = await runPrint({
1541
1541
  appUrl,
@@ -1816,7 +1816,7 @@ const chatCommand = {
1816
1816
  printError(`Unknown theme "${themeId}". Valid themes: ${themes.map((t) => t.id).join(", ")}`);
1817
1817
  process.exit(1);
1818
1818
  }
1819
- const { runChat } = await import("./boot-BCV5bnUy.mjs");
1819
+ const { runChat } = await import("./boot-BLk76r4J.mjs");
1820
1820
  await runChat({
1821
1821
  appUrl,
1822
1822
  sessionToken: session.value.sessionToken,
@@ -1853,7 +1853,7 @@ async function runPrintMode({ argv, appUrl }) {
1853
1853
  printError(`${session.error.message} For non-interactive use, run \`skydive auth login\` first, or set SKYDIVE_SESSION_TOKEN.`);
1854
1854
  process.exit(1);
1855
1855
  }
1856
- const { runPrint, readStdin } = await import("./print-DZC3Xxnl.mjs");
1856
+ const { runPrint, readStdin } = await import("./print-CXRJLvyp.mjs");
1857
1857
  let prompt = (argv.print ?? "").trim();
1858
1858
  if (!prompt) {
1859
1859
  if (process.stdin.isTTY) {
@@ -1868,7 +1868,7 @@ async function runPrintMode({ argv, appUrl }) {
1868
1868
  }
1869
1869
  let machineShare = null;
1870
1870
  if (resolveShareMachine(argv)) {
1871
- const { connectMachineShare } = await import("./print-share-BTGabspc.mjs");
1871
+ const { connectMachineShare } = await import("./print-share-88a3VFKn.mjs");
1872
1872
  machineShare = await connectMachineShare({
1873
1873
  appUrl,
1874
1874
  sessionToken: session.value.sessionToken,
@@ -1927,7 +1927,7 @@ const getCommand = {
1927
1927
  printError(`${session.error.message} Run \`skydive auth login\` first, or set SKYDIVE_SESSION_TOKEN.`);
1928
1928
  process.exit(1);
1929
1929
  }
1930
- const { messageGet } = await import("./print-DZC3Xxnl.mjs");
1930
+ const { messageGet } = await import("./print-CXRJLvyp.mjs");
1931
1931
  try {
1932
1932
  const result = await messageGet({
1933
1933
  appUrl,
@@ -2124,7 +2124,7 @@ const switchCommand = {
2124
2124
  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.");
2125
2125
  process.exit(1);
2126
2126
  }
2127
- const { runWorkspacePicker } = await import("./boot-BCV5bnUy.mjs");
2127
+ const { runWorkspacePicker } = await import("./boot-BLk76r4J.mjs");
2128
2128
  await runWorkspacePicker(session);
2129
2129
  return;
2130
2130
  }
@@ -2202,7 +2202,7 @@ const openCommand = {
2202
2202
  const agent = argv.agent ? resolveAgent((await fetchPortalDevices(session)).agents, argv.agent) : null;
2203
2203
  const cwd = argv.cwd ? path.resolve(argv.cwd) : process.cwd();
2204
2204
  const { machineName } = machineIdentity();
2205
- const { PortalClient } = await import("./client-Csl6iRdd.mjs");
2205
+ const { PortalClient } = await import("./client-Bi6tvlso.mjs");
2206
2206
  let lastLine = "";
2207
2207
  let signalConnected;
2208
2208
  const connected = new Promise((resolve) => {
@@ -2475,8 +2475,8 @@ const sandboxCommand = {
2475
2475
  }).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`"),
2476
2476
  handler: async (argv) => {
2477
2477
  const session = requireSession(argv);
2478
- const { createRestClient } = await import("./rest-HIAVuPQz.mjs");
2479
- const { resolveAgent } = await import("./print-DZC3Xxnl.mjs");
2478
+ const { createRestClient } = await import("./rest-BFuvemde.mjs");
2479
+ const { resolveAgent } = await import("./print-CXRJLvyp.mjs");
2480
2480
  const client = createRestClient({
2481
2481
  appUrl: session.appUrl,
2482
2482
  sessionToken: session.sessionToken
@@ -3553,7 +3553,7 @@ if (process.argv.includes(UPDATE_WORKER_FLAG)) {
3553
3553
  process.exit(0);
3554
3554
  }
3555
3555
  if (process.argv.includes(PORTAL_DAEMON_FLAG)) {
3556
- const { runPortalDaemon } = await import("./daemon-DxwrTG1K.mjs");
3556
+ const { runPortalDaemon } = await import("./daemon-Dj1iBfMV.mjs");
3557
3557
  runPortalDaemon(process.argv);
3558
3558
  } else runCli();
3559
3559
  function runCli() {
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { C as setActiveWorkspace, S as listWorkspaces, a as WORDMARK, b as getActiveWorkspaceId, c as applyTheme, d as noColorRequested, f as theme, g as themeVersion, h as themeModeFromColorFgBg, i as MARK_CELLS, l as findTheme, m as themeMode, n as buildCrashReport, p as themeForMode, r as writeCrashReport, s as DEFAULT_THEME_ID, t as installCrashHandler, u as monoTheme, v as themesForMode } from "./install-D7zXhVT1.mjs";
3
- import { L as saveTheme, P as resolveWebUrl, T as getSavedTheme, c as cardActionErrorMessage, d as reconcileMaskedInput, f as resolveConnectUrl, i as resolveAgent, l as parseExternalOauthConnectParams, m as specKeyFor, p as parseConnectCard, s as MASK_CHAR, u as parseOauthConnectParams, v as DEFAULT_API_URL, w as getReviewStateDir, x as getConfigPath, y as DEFAULT_APP_URL } from "./print-BUbxOvnm.mjs";
4
- import { a as errorMessage, i as sendErrorMessage, n as createRestClient, o as isRecord, r as errorDetail, t as HttpError } from "./rest-CCyln7vx.mjs";
5
- import { t as PortalClient } from "./client-O5KfzIaB.mjs";
6
- import { d as makeLineParser, f as parseDaemonMessage, l as daemonPaths, n as ensureDaemonRunning, s as LOCAL_PROTOCOL_VERSION, u as encodeLine } from "./daemon-Dk4RinJn.mjs";
2
+ import { C as setActiveWorkspace, S as listWorkspaces, a as WORDMARK, b as getActiveWorkspaceId, c as applyTheme, d as noColorRequested, f as theme, g as themeVersion, h as themeModeFromColorFgBg, i as MARK_CELLS, l as findTheme, m as themeMode, n as buildCrashReport, p as themeForMode, r as writeCrashReport, s as DEFAULT_THEME_ID, t as installCrashHandler, u as monoTheme, v as themesForMode } from "./install-DVPqms6J.mjs";
3
+ import { L as saveTheme, P as resolveWebUrl, T as getSavedTheme, c as cardActionErrorMessage, d as reconcileMaskedInput, f as resolveConnectUrl, i as resolveAgent, l as parseExternalOauthConnectParams, m as specKeyFor, p as parseConnectCard, s as MASK_CHAR, u as parseOauthConnectParams, v as DEFAULT_API_URL, w as getReviewStateDir, x as getConfigPath, y as DEFAULT_APP_URL } from "./print-CcvhSMi9.mjs";
4
+ import { a as errorMessage, i as sendErrorMessage, n as createRestClient, o as isRecord, r as errorDetail, t as HttpError } from "./rest-B5v4v5ux.mjs";
5
+ import { t as PortalClient } from "./client-DqidlIb-.mjs";
6
+ import { d as makeLineParser, f as parseDaemonMessage, l as daemonPaths, n as ensureDaemonRunning, s as LOCAL_PROTOCOL_VERSION, u as encodeLine } from "./daemon-mXhmMGsS.mjs";
7
7
  import { t as SandboxStream } from "./client-DfcJFEbh.mjs";
8
8
  import { t as runRawPtyPassthrough } from "./raw-pty-BcjbTjHJ.mjs";
9
9
  import * as os$1 from "node:os";
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import "./rest-B5v4v5ux.mjs";
3
+ import { t as PortalClient } from "./client-DqidlIb-.mjs";
4
+
5
+ export { PortalClient };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as errorMessage, t as HttpError } from "./rest-CCyln7vx.mjs";
2
+ import { a as errorMessage, t as HttpError } from "./rest-B5v4v5ux.mjs";
3
3
  import os from "node:os";
4
4
  import { z } from "zod";
5
5
  import { spawn } from "node:child_process";
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import "./rest-CCyln7vx.mjs";
3
- import "./client-O5KfzIaB.mjs";
4
- import { a as runPortalDaemon, i as queryDaemonStatus, n as ensureDaemonRunning, o as stopDaemon, r as isDaemonListening, t as PortalDaemon } from "./daemon-Dk4RinJn.mjs";
2
+ import "./rest-B5v4v5ux.mjs";
3
+ import "./client-DqidlIb-.mjs";
4
+ import { a as runPortalDaemon, i as queryDaemonStatus, n as ensureDaemonRunning, o as stopDaemon, r as isDaemonListening, t as PortalDaemon } from "./daemon-mXhmMGsS.mjs";
5
5
 
6
6
  export { runPortalDaemon };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { o as isRecord } from "./rest-CCyln7vx.mjs";
3
- import { t as PortalClient } from "./client-O5KfzIaB.mjs";
2
+ import { o as isRecord } from "./rest-B5v4v5ux.mjs";
3
+ import { t as PortalClient } from "./client-DqidlIb-.mjs";
4
4
  import os from "node:os";
5
5
  import path from "node:path";
6
6
  import { z } from "zod";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { x as getConfigPath } from "./print-BUbxOvnm.mjs";
2
+ import { x as getConfigPath } from "./print-CcvhSMi9.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.2.0-beta.693";
11
+ var version$1 = "0.2.0-beta.700";
12
12
 
13
13
  //#endregion
14
14
  //#region src/auth/organization.ts
@@ -1,5 +1,5 @@
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-BUbxOvnm.mjs";
3
- import "./rest-CCyln7vx.mjs";
2
+ import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-CcvhSMi9.mjs";
3
+ import "./rest-B5v4v5ux.mjs";
4
4
 
5
5
  export { messageGet, readStdin, resolveAgent, runPrint };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as errorMessage, i as sendErrorMessage, n as createRestClient, o as isRecord, t as HttpError } from "./rest-CCyln7vx.mjs";
2
+ import { a as errorMessage, i as sendErrorMessage, n as createRestClient, o as isRecord, t as HttpError } from "./rest-B5v4v5ux.mjs";
3
3
  import path from "node:path";
4
4
  import Conf from "conf";
5
5
  import { err, ok } from "neverthrow";
@@ -14,7 +14,7 @@ import { n as printError } from "./output-DYzzdXYV.mjs";
14
14
  * the reply (and to --json).
15
15
  */
16
16
  async function connectMachineShare({ appUrl, sessionToken, timeoutHint }) {
17
- const { PortalClient } = await import("./client-Csl6iRdd.mjs");
17
+ const { PortalClient } = await import("./client-Bi6tvlso.mjs");
18
18
  let signalConnected;
19
19
  const connected = new Promise((resolve) => {
20
20
  signalConnected = resolve;
@@ -102,11 +102,12 @@ function sendErrorMessage(err) {
102
102
  return fromServer ?? `Send failed (HTTP ${err.status}).`;
103
103
  }
104
104
  const MAX_STREAM_RECONNECTS = 5;
105
- function createRestClient({ appUrl, sessionToken }) {
105
+ function createRestClient({ appUrl, sessionToken, workspaceId }) {
106
106
  const baseHeaders = {
107
107
  authorization: `Bearer ${sessionToken}`,
108
108
  accept: "application/json"
109
109
  };
110
+ if (workspaceId) baseHeaders["x-workspace-id"] = workspaceId;
110
111
  async function get(path, schema) {
111
112
  const res = await fetch(`${appUrl}${path}`, { headers: baseHeaders });
112
113
  if (!res.ok) throw new HttpError(res.status, await res.text().catch(() => ""));
@@ -142,6 +143,7 @@ function createRestClient({ appUrl, sessionToken }) {
142
143
  authorization: `Bearer ${sessionToken}`,
143
144
  accept: "text/event-stream"
144
145
  };
146
+ if (workspaceId) headers["x-workspace-id"] = workspaceId;
145
147
  if (lastEventId) headers["last-event-id"] = lastEventId;
146
148
  const res = await fetch(`${appUrl}${path}`, {
147
149
  headers,
@@ -368,7 +370,8 @@ function createRestClient({ appUrl, sessionToken }) {
368
370
  const res = await fetch(`${appUrl}/api/v1/chat/conversations/${encodeURIComponent(conversationId)}/stream`, {
369
371
  headers: {
370
372
  authorization: `Bearer ${sessionToken}`,
371
- accept: "text/event-stream"
373
+ accept: "text/event-stream",
374
+ ...workspaceId ? { "x-workspace-id": workspaceId } : {}
372
375
  },
373
376
  signal
374
377
  });
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { i as sendErrorMessage, n as createRestClient, r as errorDetail, t as HttpError } from "./rest-CCyln7vx.mjs";
2
+ import { i as sendErrorMessage, n as createRestClient, r as errorDetail, t as HttpError } from "./rest-B5v4v5ux.mjs";
3
3
 
4
4
  export { createRestClient };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skydive-cli",
3
- "version": "0.2.0-beta.693",
3
+ "version": "0.2.0-beta.700",
4
4
  "description": "Skydive CLI — cloud agents from the command line",
5
5
  "homepage": "https://skydive.com",
6
6
  "license": "MIT",
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import "./rest-CCyln7vx.mjs";
3
- import { t as PortalClient } from "./client-O5KfzIaB.mjs";
4
-
5
- export { PortalClient };