skydive-cli 0.2.0-beta.423 → 0.2.0-beta.427

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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as HttpError } from "./rest-04eiQEA9.mjs";
2
+ import { t as HttpError } from "./rest-BBQrPIwq.mjs";
3
3
  import os from "node:os";
4
4
  import { z } from "zod";
5
5
 
package/dist/js/bin.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { A as getShareMachineDefault, B as saveSession, C as DEFAULT_WEB_URL, D as getPromptHistoryPath, E as getLastSeenVersion, F as resolveConfig, H as setLastSeenVersion, I as resolveManagementAuth, L as resolveSession, M as getStoredApiKeyWorkspaceName, N as getUpdateCheckDisabled, P as resolveAppUrl, T as getConfigPath, _ as setActiveWorkspace, b as API_KEY_PREFIX, d as themes, g as listWorkspaces, h as getSessionIdentity, j as getStoredApiKeyId, m as getActiveWorkspaceId, p as ensureActiveOrganization, v as API_KEYS_URL, w as deleteConfig, x as DEFAULT_API_URL, y as API_KEY_FAMILY_PREFIX, z as saveConfig } from "./theme-CuQhvqzN.mjs";
3
3
  import { n as printError, r as printTable, t as output } from "./output-B4cW10Ph.mjs";
4
- import { n as createRestClient } from "./rest-04eiQEA9.mjs";
5
- import { i as resolveAgent } from "./print-CouegX9S.mjs";
6
- import { a as registerPortalDevice, c as machineIdentity, n as findThisDevice, o as revokePortalAccess, r as grantPortalAccess, t as fetchPortalDevices } from "./api-DcGNxnLr.mjs";
4
+ import { n as createRestClient } from "./rest-BBQrPIwq.mjs";
5
+ import { i as resolveAgent } from "./print-YqNIRwdf.mjs";
6
+ import { a as registerPortalDevice, c as machineIdentity, n as findThisDevice, o as revokePortalAccess, r as grantPortalAccess, t as fetchPortalDevices } from "./api-zUf_Vrzh.mjs";
7
7
  import { t as SandboxStream } from "./client-CpEvH2Pq.mjs";
8
8
  import { hideBin } from "yargs/helpers";
9
9
  import yargs from "yargs";
@@ -20,7 +20,7 @@ import semver from "semver";
20
20
 
21
21
  //#region package.json
22
22
  var name = "skydive-cli";
23
- var version = "0.2.0-beta.423";
23
+ var version = "0.2.0-beta.427";
24
24
 
25
25
  //#endregion
26
26
  //#region src/types.ts
@@ -1200,7 +1200,7 @@ const importCommand = {
1200
1200
  process.exit(1);
1201
1201
  }
1202
1202
  }
1203
- const { runChat } = await import("./boot-BJeHUB6U.mjs");
1203
+ const { runChat } = await import("./boot-BiMPCqRg.mjs");
1204
1204
  await runChat({
1205
1205
  appUrl,
1206
1206
  sessionToken: session.value.sessionToken,
@@ -1226,7 +1226,7 @@ async function runImportPrintMode({ argv, appUrl }) {
1226
1226
  printError(`${session.error.message} For non-interactive use, run \`skydive auth login --web\` first, or set SKYDIVE_SESSION_TOKEN.`);
1227
1227
  process.exit(1);
1228
1228
  }
1229
- const { connectMachineShare } = await import("./print-share-BS60u1H2.mjs");
1229
+ const { connectMachineShare } = await import("./print-share-B8sZ0w-M.mjs");
1230
1230
  const machineShare = await connectMachineShare({
1231
1231
  appUrl,
1232
1232
  sessionToken: session.value.sessionToken,
@@ -1234,7 +1234,7 @@ async function runImportPrintMode({ argv, appUrl }) {
1234
1234
  });
1235
1235
  const extra = (argv.print ?? "").trim();
1236
1236
  const prompt = buildImportSeedPrompt(process.cwd()) + (extra ? `\n\nAdditional instructions: ${extra}` : "");
1237
- const { runPrint } = await import("./print-CKEKn9wS.mjs");
1237
+ const { runPrint } = await import("./print-DUsH9Dlh.mjs");
1238
1238
  try {
1239
1239
  const result = await runPrint({
1240
1240
  appUrl,
@@ -1511,7 +1511,7 @@ const chatCommand = {
1511
1511
  printError(`Unknown theme "${themeId}". Valid themes: ${themes.map((t) => t.id).join(", ")}`);
1512
1512
  process.exit(1);
1513
1513
  }
1514
- const { runChat } = await import("./boot-BJeHUB6U.mjs");
1514
+ const { runChat } = await import("./boot-BiMPCqRg.mjs");
1515
1515
  await runChat({
1516
1516
  appUrl,
1517
1517
  sessionToken: session.value.sessionToken,
@@ -1539,7 +1539,7 @@ async function runPrintMode({ argv, appUrl }) {
1539
1539
  printError(`${session.error.message} For non-interactive use, run \`skydive auth login\` first, or set SKYDIVE_SESSION_TOKEN.`);
1540
1540
  process.exit(1);
1541
1541
  }
1542
- const { runPrint, readStdin } = await import("./print-CKEKn9wS.mjs");
1542
+ const { runPrint, readStdin } = await import("./print-DUsH9Dlh.mjs");
1543
1543
  let prompt = (argv.print ?? "").trim();
1544
1544
  if (!prompt) {
1545
1545
  if (process.stdin.isTTY) {
@@ -1554,7 +1554,7 @@ async function runPrintMode({ argv, appUrl }) {
1554
1554
  }
1555
1555
  let machineShare = null;
1556
1556
  if (resolveShareMachine(argv)) {
1557
- const { connectMachineShare } = await import("./print-share-BS60u1H2.mjs");
1557
+ const { connectMachineShare } = await import("./print-share-B8sZ0w-M.mjs");
1558
1558
  machineShare = await connectMachineShare({
1559
1559
  appUrl,
1560
1560
  sessionToken: session.value.sessionToken,
@@ -1613,7 +1613,7 @@ const getCommand = {
1613
1613
  printError(`${session.error.message} Run \`skydive auth login\` first, or set SKYDIVE_SESSION_TOKEN.`);
1614
1614
  process.exit(1);
1615
1615
  }
1616
- const { messageGet } = await import("./print-CKEKn9wS.mjs");
1616
+ const { messageGet } = await import("./print-DUsH9Dlh.mjs");
1617
1617
  try {
1618
1618
  const result = await messageGet({
1619
1619
  appUrl,
@@ -1810,7 +1810,7 @@ const switchCommand = {
1810
1810
  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.");
1811
1811
  process.exit(1);
1812
1812
  }
1813
- const { runWorkspacePicker } = await import("./boot-BJeHUB6U.mjs");
1813
+ const { runWorkspacePicker } = await import("./boot-BiMPCqRg.mjs");
1814
1814
  await runWorkspacePicker(session);
1815
1815
  return;
1816
1816
  }
@@ -1888,7 +1888,7 @@ const openCommand = {
1888
1888
  const agent = argv.agent ? resolveAgent((await fetchPortalDevices(session)).agents, argv.agent) : null;
1889
1889
  const cwd = argv.cwd ? path.resolve(argv.cwd) : process.cwd();
1890
1890
  const { machineName } = machineIdentity();
1891
- const { PortalClient } = await import("./client-Blf9mdM0.mjs");
1891
+ const { PortalClient } = await import("./client-A4m7lNDg.mjs");
1892
1892
  let lastLine = "";
1893
1893
  let signalConnected;
1894
1894
  const connected = new Promise((resolve) => {
@@ -2060,8 +2060,8 @@ const sandboxCommand = {
2060
2060
  }).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`"),
2061
2061
  handler: async (argv) => {
2062
2062
  const session = requireSession(argv);
2063
- const { createRestClient } = await import("./rest-CHW9mvHI.mjs");
2064
- const { resolveAgent } = await import("./print-CKEKn9wS.mjs");
2063
+ const { createRestClient } = await import("./rest-Cz0VLhmi.mjs");
2064
+ const { resolveAgent } = await import("./print-DUsH9Dlh.mjs");
2065
2065
  const client = createRestClient({
2066
2066
  appUrl: session.appUrl,
2067
2067
  sessionToken: session.sessionToken
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { O as getReviewStateDir, R as resolveWebUrl, S as DEFAULT_APP_URL, T as getConfigPath, V as saveTheme, _ as setActiveWorkspace, a as noColorRequested, c as themeMode, f as themesForMode, g as listWorkspaces, i as monoTheme, k as getSavedTheme, l as themeModeFromColorFgBg, m as getActiveWorkspaceId, n as applyTheme, o as theme, r as findTheme, s as themeForMode, t as DEFAULT_THEME_ID, u as themeVersion, x as DEFAULT_API_URL } from "./theme-CuQhvqzN.mjs";
3
- import { n as createRestClient, r as errorDetail, t as HttpError } from "./rest-04eiQEA9.mjs";
3
+ import { n as createRestClient, r as errorDetail, t as HttpError } from "./rest-BBQrPIwq.mjs";
4
4
  import { n as isRecord, t as errorMessage } from "./util-CeisaZVY.mjs";
5
- import { 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 } from "./print-CouegX9S.mjs";
6
- import "./api-DcGNxnLr.mjs";
5
+ import { 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 } from "./print-YqNIRwdf.mjs";
6
+ import "./api-zUf_Vrzh.mjs";
7
7
  import { t as SandboxStream } from "./client-CpEvH2Pq.mjs";
8
- import { t as PortalClient } from "./client-CxOKgU7M.mjs";
8
+ import { t as PortalClient } from "./client-DuPxkSoH.mjs";
9
9
  import { t as runRawPtyPassthrough } from "./raw-pty-GAvxm2ol.mjs";
10
10
  import * as os$1 from "node:os";
11
11
  import { homedir, platform, release, tmpdir } from "node:os";
@@ -7753,6 +7753,15 @@ const maxAttachments = 10;
7753
7753
  function isNewConversation(c) {
7754
7754
  return "kind" in c && c.kind === "new";
7755
7755
  }
7756
+ /**
7757
+ * A server timestamp as local epoch ms, or null when it is missing or
7758
+ * unparseable so the caller can fall back to its own clock.
7759
+ */
7760
+ function parseStampMs(iso) {
7761
+ if (!iso) return null;
7762
+ const ms = Date.parse(iso);
7763
+ return Number.isNaN(ms) ? null : ms;
7764
+ }
7756
7765
  function formatBytes(bytes) {
7757
7766
  if (bytes < 1024) return `${bytes} B`;
7758
7767
  if (bytes < 1024 * 1024) return `${Math.round(bytes / 1024)} KB`;
@@ -7948,17 +7957,18 @@ function ChatScreen({ agent, conversation }) {
7948
7957
  cancelled = true;
7949
7958
  };
7950
7959
  }, [rest, initialConversationId]);
7951
- const attachToRun = useCallback((runId, runAgentName) => {
7960
+ const attachToRun = useCallback((runId, runAgentName, runStartedAtMs) => {
7952
7961
  if (!rest) return;
7953
7962
  seenRunsRef.current.add(runId);
7954
7963
  const abort = new AbortController();
7955
7964
  const responsePreview = createResponsePreview();
7956
7965
  const streamAgentName = runAgentName ?? agent.name;
7957
- setRun({
7966
+ setRun((prev) => ({
7958
7967
  kind: "streaming",
7959
7968
  runId,
7960
- abort
7961
- });
7969
+ abort,
7970
+ startedAtMs: runStartedAtMs ?? (prev.kind === "idle" ? Date.now() : prev.startedAtMs)
7971
+ }));
7962
7972
  rest.streamRun({
7963
7973
  runId,
7964
7974
  signal: abort.signal,
@@ -8019,7 +8029,7 @@ function ChatScreen({ agent, conversation }) {
8019
8029
  if (event.kind === "run") {
8020
8030
  if (seenRunsRef.current.has(event.runId)) return;
8021
8031
  if (runRef.current.kind !== "idle") return;
8022
- attachToRun(event.runId);
8032
+ attachToRun(event.runId, null, parseStampMs(event.createdAt));
8023
8033
  return;
8024
8034
  }
8025
8035
  if (event.title) setChatTitle(event.title);
@@ -8046,7 +8056,10 @@ function ChatScreen({ agent, conversation }) {
8046
8056
  ...stagedNames.length > 0 ? { attachments: stagedNames } : {}
8047
8057
  }]);
8048
8058
  const wasStreaming = runRef.current.kind === "streaming";
8049
- if (!wasStreaming) setRun({ kind: "sending" });
8059
+ if (!wasStreaming) setRun({
8060
+ kind: "sending",
8061
+ startedAtMs: Date.now()
8062
+ });
8050
8063
  try {
8051
8064
  const attachmentIds = [];
8052
8065
  const restorable = [];
@@ -9105,7 +9118,10 @@ function ChatScreen({ agent, conversation }) {
9105
9118
  })
9106
9119
  }) : null, /* @__PURE__ */ jsx(RenderItem, { item })]
9107
9120
  }, item.id);
9108
- }) }), run.kind !== "idle" ? /* @__PURE__ */ jsx(ActivityRow, { label: run.kind === "sending" ? "sending" : "working" }) : null]
9121
+ }) }), run.kind !== "idle" ? /* @__PURE__ */ jsx(ActivityRow, {
9122
+ label: run.kind === "sending" ? "sending" : "working",
9123
+ startedAtMs: run.startedAtMs
9124
+ }) : null]
9109
9125
  })
9110
9126
  }),
9111
9127
  todoCardVisible && todos ? /* @__PURE__ */ jsx(TodoCardView, {
@@ -9350,16 +9366,18 @@ function CredentialPromptBox({ prompt, height, onInput, onSubmit }) {
9350
9366
  /**
9351
9367
  * A live indicator at the foot of the transcript while a run is in flight: an
9352
9368
  * animated spinner plus a label and a seconds counter, so it's obvious the
9353
- * agent is still working even during long gaps between chunks. Owns its own
9354
- * elapsed-time timer so ticking the counter doesn't re-render the transcript.
9369
+ * agent is still working even during long gaps between chunks. The counter
9370
+ * measures from the run's own start, not from this row appearing, so reopening
9371
+ * a conversation mid-run shows how long the agent has really been at it. Owns
9372
+ * its own clock so ticking it doesn't re-render the transcript.
9355
9373
  */
9356
- function ActivityRow({ label }) {
9357
- const [elapsed, setElapsed] = useState(0);
9374
+ function ActivityRow({ label, startedAtMs }) {
9375
+ const [now, setNow] = useState(() => Date.now());
9358
9376
  useEffect(() => {
9359
- const start = Date.now();
9360
- const id = setInterval(() => setElapsed(Math.floor((Date.now() - start) / 1e3)), 250);
9377
+ const id = setInterval(() => setNow(Date.now()), 250);
9361
9378
  return () => clearInterval(id);
9362
9379
  }, []);
9380
+ const elapsed = Math.floor((now - startedAtMs) / 1e3);
9363
9381
  return /* @__PURE__ */ jsxs("box", {
9364
9382
  style: {
9365
9383
  flexDirection: "row",
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import "./rest-BBQrPIwq.mjs";
3
+ import "./api-zUf_Vrzh.mjs";
4
+ import { t as PortalClient } from "./client-DuPxkSoH.mjs";
5
+
6
+ export { PortalClient };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { t as errorMessage } from "./util-CeisaZVY.mjs";
3
- import { c as machineIdentity, i as mintPortalDeviceToken, l as portalWsUrl, n as findThisDevice, r as grantPortalAccess, s as buildEnv, t as fetchPortalDevices } from "./api-DcGNxnLr.mjs";
3
+ import { c as machineIdentity, i as mintPortalDeviceToken, l as portalWsUrl, n as findThisDevice, r as grantPortalAccess, s as buildEnv, t as fetchPortalDevices } from "./api-zUf_Vrzh.mjs";
4
4
  import { z } from "zod";
5
5
  import { spawn } from "node:child_process";
6
6
  import { WebSocket } from "ws";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "./rest-04eiQEA9.mjs";
3
- import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-CouegX9S.mjs";
2
+ import "./rest-BBQrPIwq.mjs";
3
+ import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-YqNIRwdf.mjs";
4
4
 
5
5
  export { messageGet, readStdin, resolveAgent, runPrint };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as createRestClient, t as HttpError } from "./rest-04eiQEA9.mjs";
2
+ import { n as createRestClient, t as HttpError } from "./rest-BBQrPIwq.mjs";
3
3
  import { n as isRecord, t as errorMessage } from "./util-CeisaZVY.mjs";
4
4
  import stableStringify from "safe-stable-stringify";
5
5
 
@@ -14,7 +14,7 @@ import { n as printError } from "./output-B4cW10Ph.mjs";
14
14
  * the reply (and to --json).
15
15
  */
16
16
  async function connectMachineShare({ appUrl, sessionToken, timeoutHint }) {
17
- const { PortalClient } = await import("./client-Blf9mdM0.mjs");
17
+ const { PortalClient } = await import("./client-A4m7lNDg.mjs");
18
18
  let signalConnected;
19
19
  const connected = new Promise((resolve) => {
20
20
  signalConnected = resolve;
@@ -455,7 +455,8 @@ const conversationStreamEventSchema = z.discriminatedUnion("kind", [z.object({
455
455
  title: z.string().nullable()
456
456
  }), z.object({
457
457
  kind: z.literal("run"),
458
- runId: z.string()
458
+ runId: z.string(),
459
+ createdAt: z.string().nullish()
459
460
  })]);
460
461
 
461
462
  //#endregion
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { n as createRestClient, r as errorDetail, t as HttpError } from "./rest-04eiQEA9.mjs";
2
+ import { n as createRestClient, r as errorDetail, t as HttpError } from "./rest-BBQrPIwq.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.423",
3
+ "version": "0.2.0-beta.427",
4
4
  "description": "Skydive CLI — cloud agents from the command line",
5
5
  "homepage": "https://skydive.com",
6
6
  "license": "MIT",
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import "./rest-04eiQEA9.mjs";
3
- import "./api-DcGNxnLr.mjs";
4
- import { t as PortalClient } from "./client-CxOKgU7M.mjs";
5
-
6
- export { PortalClient };