skydive-cli 0.2.0-beta.594 → 0.2.0-beta.595

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-DZnAT7BG.mjs";
2
+ import { t as HttpError } from "./rest-BMh7CURU.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 getPromptHistoryPath, B as resolveSession, C as API_KEY_PREFIX, D as deleteConfig, E as DEFAULT_WEB_URL, F as getStoredApiKeyWorkspaceName, G as setLastSeenVersion, H as saveConfig, I as getUpdateCheckDisabled, L as resolveAppUrl, N as getShareMachineDefault, O as getConfigPath, P as getStoredApiKeyId, R as resolveConfig, S as API_KEY_FAMILY_PREFIX, U as saveSession, _ as getActiveWorkspaceId, b as setActiveWorkspace, g as ensureActiveOrganization, k as getLastSeenVersion, m as themes, r as brandHelpArt, v as getSessionIdentity, w as DEFAULT_API_URL, x as API_KEYS_URL, y as listWorkspaces, z as resolveManagementAuth } from "./brand-BVALAEf1.mjs";
3
3
  import { n as printError, r as printTable, t as output } from "./output-B4cW10Ph.mjs";
4
- import { n as createRestClient } from "./rest-DZnAT7BG.mjs";
5
- import { i as resolveAgent } from "./print-XvAHDKqu.mjs";
6
- import { a as registerPortalDevice, c as machineIdentity, n as findThisDevice, o as revokePortalAccess, r as grantPortalAccess, t as fetchPortalDevices } from "./api-BHq-5eW_.mjs";
4
+ import { n as createRestClient } from "./rest-BMh7CURU.mjs";
5
+ import { i as resolveAgent } from "./print-SAL2aiGh.mjs";
6
+ import { a as registerPortalDevice, c as machineIdentity, n as findThisDevice, o as revokePortalAccess, r as grantPortalAccess, t as fetchPortalDevices } from "./api-CQXTPT-p.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.594";
23
+ var version = "0.2.0-beta.595";
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-C-sSzYb6.mjs");
1203
+ const { runChat } = await import("./boot-BY_wmF2R.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-DT89ADa6.mjs");
1229
+ const { connectMachineShare } = await import("./print-share-CzS5Y6De.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-Chg635Ye.mjs");
1237
+ const { runPrint } = await import("./print-D0SpmKCV.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-C-sSzYb6.mjs");
1514
+ const { runChat } = await import("./boot-BY_wmF2R.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-Chg635Ye.mjs");
1542
+ const { runPrint, readStdin } = await import("./print-D0SpmKCV.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-DT89ADa6.mjs");
1557
+ const { connectMachineShare } = await import("./print-share-CzS5Y6De.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-Chg635Ye.mjs");
1616
+ const { messageGet } = await import("./print-D0SpmKCV.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-C-sSzYb6.mjs");
1813
+ const { runWorkspacePicker } = await import("./boot-BY_wmF2R.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-CRAGDqp0.mjs");
1891
+ const { PortalClient } = await import("./client-C9p4ta7J.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-Ci_yRwoi.mjs");
2064
- const { resolveAgent } = await import("./print-Chg635Ye.mjs");
2063
+ const { createRestClient } = await import("./rest-DPta4XUe.mjs");
2064
+ const { resolveAgent } = await import("./print-D0SpmKCV.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 { M as getSavedTheme, O as getConfigPath, T as DEFAULT_APP_URL, V as resolveWebUrl, W as saveTheme, _ as getActiveWorkspaceId, a as applyTheme, b as setActiveWorkspace, c as noColorRequested, d as themeMode, f as themeModeFromColorFgBg, h as themesForMode, i as DEFAULT_THEME_ID, j as getReviewStateDir, l as theme, n as WORDMARK, o as findTheme, p as themeVersion, s as monoTheme, t as MARK_CELLS, u as themeForMode, w as DEFAULT_API_URL, y as listWorkspaces } from "./brand-BVALAEf1.mjs";
3
- import { n as createRestClient, r as errorDetail, t as HttpError } from "./rest-DZnAT7BG.mjs";
3
+ import { n as createRestClient, r as errorDetail, t as HttpError } from "./rest-BMh7CURU.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-XvAHDKqu.mjs";
6
- import "./api-BHq-5eW_.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-SAL2aiGh.mjs";
6
+ import "./api-CQXTPT-p.mjs";
7
7
  import { t as SandboxStream } from "./client-CpEvH2Pq.mjs";
8
- import { t as PortalClient } from "./client-t6GmE8TI.mjs";
8
+ import { t as PortalClient } from "./client-BwMzD7Iw.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";
@@ -4320,6 +4320,74 @@ function TodoCardView({ todos, isActive }) {
4320
4320
  });
4321
4321
  }
4322
4322
 
4323
+ //#endregion
4324
+ //#region src/chat/tui/chat/use-compaction.ts
4325
+ const COMPACTING_INDICATOR_TIMEOUT_MS = 12e4;
4326
+ /**
4327
+ * Owns everything about manual conversation compaction (`/compact`): the
4328
+ * persistent "compacting…" indicator state, the fire-and-forget command, the
4329
+ * reaction to conversation-stream `compaction` events, and the safety timeout
4330
+ * that clears a stranded `started` so the indicator can never pin forever.
4331
+ *
4332
+ * The screen keeps a single `streamConversation` subscription (which also
4333
+ * carries `run`/`conversation` events), so compaction events arrive there and
4334
+ * are forwarded in via {@link UseCompaction.onCompactionEvent} rather than this
4335
+ * hook opening its own stream.
4336
+ */
4337
+ function useCompaction({ rest, conversationId }) {
4338
+ const [compacting, setCompacting] = useState(false);
4339
+ const timerRef = useRef(null);
4340
+ const clearTimer = useCallback(() => {
4341
+ if (timerRef.current) {
4342
+ clearTimeout(timerRef.current);
4343
+ timerRef.current = null;
4344
+ }
4345
+ }, []);
4346
+ const armIndicator = useCallback(() => {
4347
+ clearTimer();
4348
+ setCompacting(true);
4349
+ timerRef.current = setTimeout(() => setCompacting(false), COMPACTING_INDICATOR_TIMEOUT_MS);
4350
+ }, [clearTimer]);
4351
+ const onCompactionEvent = useCallback((status) => {
4352
+ if (status === "started") {
4353
+ armIndicator();
4354
+ return;
4355
+ }
4356
+ clearTimer();
4357
+ setCompacting(false);
4358
+ if (status === "failed") useStore.getState().showToast({
4359
+ variant: "error",
4360
+ message: "compaction failed"
4361
+ });
4362
+ }, [armIndicator, clearTimer]);
4363
+ const compactConversation = useCallback(() => {
4364
+ if (!rest || !conversationId) {
4365
+ useStore.getState().showToast({ message: "nothing to compact yet — send a message first" });
4366
+ return;
4367
+ }
4368
+ armIndicator();
4369
+ rest.compactConversation({ conversationId }).catch((err) => {
4370
+ clearTimer();
4371
+ setCompacting(false);
4372
+ useStore.getState().showToast({
4373
+ variant: "error",
4374
+ message: `couldn't compact: ${errorDetail(err)}`
4375
+ });
4376
+ });
4377
+ }, [
4378
+ rest,
4379
+ conversationId,
4380
+ armIndicator,
4381
+ clearTimer
4382
+ ]);
4383
+ useEffect(() => clearTimer, [clearTimer]);
4384
+ return {
4385
+ compacting,
4386
+ compactConversation,
4387
+ onCompactionEvent
4388
+ };
4389
+ }
4390
+
4323
4391
  //#endregion
4324
4392
  //#region src/chat/tui/chat/footer-hints.ts
4325
4393
  /** Build the chat footer copy independently of its colors and layout. */
@@ -5216,6 +5284,13 @@ const slashCommands = [
5216
5284
  description: "allow this agent to access your computer",
5217
5285
  action: { kind: "portal" }
5218
5286
  },
5287
+ {
5288
+ name: "compact",
5289
+ aliases: [],
5290
+ argsHint: null,
5291
+ description: "summarize older turns to free up context now",
5292
+ action: { kind: "compact" }
5293
+ },
5219
5294
  {
5220
5295
  name: "help",
5221
5296
  aliases: [],
@@ -8276,6 +8351,7 @@ function routeInput(raw) {
8276
8351
  case "connect":
8277
8352
  case "copy":
8278
8353
  case "portal":
8354
+ case "compact":
8279
8355
  case "help":
8280
8356
  case "quit": return { kind: action.kind };
8281
8357
  default: {
@@ -8468,6 +8544,10 @@ function ChatScreen({ agent, conversation }) {
8468
8544
  const agentHost = useAgentHost();
8469
8545
  const nonWebChannel = nonWebChannelLabel(conversation);
8470
8546
  const [conversationId, setConversationId] = useState(initialConversationId);
8547
+ const { compacting, compactConversation, onCompactionEvent } = useCompaction({
8548
+ rest,
8549
+ conversationId
8550
+ });
8471
8551
  const [items, setItems] = useState([]);
8472
8552
  const [todos, setTodos] = useState(null);
8473
8553
  const [planHidden, setPlanHidden] = useState(false);
@@ -8732,15 +8812,22 @@ function ChatScreen({ agent, conversation }) {
8732
8812
  attachToRun(event.runId, null, parseStampMs(event.createdAt));
8733
8813
  return;
8734
8814
  }
8735
- if (event.title) setChatTitle(event.title);
8815
+ if (event.kind === "compaction") {
8816
+ onCompactionEvent(event.status);
8817
+ return;
8818
+ }
8819
+ if (event.kind === "conversation" && event.title) setChatTitle(event.title);
8736
8820
  }
8737
8821
  }).catch(() => {});
8738
- return () => abort.abort();
8822
+ return () => {
8823
+ abort.abort();
8824
+ };
8739
8825
  }, [
8740
8826
  rest,
8741
8827
  conversationId,
8742
8828
  setChatTitle,
8743
- attachToRun
8829
+ attachToRun,
8830
+ onCompactionEvent
8744
8831
  ]);
8745
8832
  const sendContent = useCallback(async (content, staged, opts) => {
8746
8833
  if (!rest) return;
@@ -8859,6 +8946,7 @@ function ChatScreen({ agent, conversation }) {
8859
8946
  portalStatus,
8860
8947
  portalClient,
8861
8948
  agent.id,
8949
+ agent.name,
8862
8950
  sendContent
8863
8951
  ]);
8864
8952
  const cancelLatestSteer = useCallback(() => {
@@ -9584,6 +9672,9 @@ function ChatScreen({ agent, conversation }) {
9584
9672
  case "portal":
9585
9673
  openPortalAccess();
9586
9674
  break;
9675
+ case "compact":
9676
+ compactConversation();
9677
+ break;
9587
9678
  case "connect":
9588
9679
  if (!promptForCards()) useStore.getState().showToast({ message: "no connect card waiting for action" });
9589
9680
  break;
@@ -9618,6 +9709,7 @@ function ChatScreen({ agent, conversation }) {
9618
9709
  openInBrowser,
9619
9710
  copyLastMessage,
9620
9711
  openPortalAccess,
9712
+ compactConversation,
9621
9713
  quit,
9622
9714
  sendContent,
9623
9715
  goTo,
@@ -10043,6 +10135,23 @@ function ChatScreen({ agent, conversation }) {
10043
10135
  todos,
10044
10136
  isActive: run.kind !== "idle"
10045
10137
  }) : null,
10138
+ compacting ? /* @__PURE__ */ jsxs("box", {
10139
+ style: {
10140
+ flexDirection: "row",
10141
+ paddingLeft: 1,
10142
+ paddingRight: 1,
10143
+ height: 1,
10144
+ flexShrink: 0,
10145
+ marginTop: 1
10146
+ },
10147
+ children: [/* @__PURE__ */ jsx("text", {
10148
+ fg: theme.accent,
10149
+ children: "● compacting conversation…"
10150
+ }), /* @__PURE__ */ jsxs("text", {
10151
+ fg: theme.dim,
10152
+ children: [" ", "you can keep typing"]
10153
+ })]
10154
+ }) : null,
10046
10155
  pendingVisible ? /* @__PURE__ */ jsxs("box", {
10047
10156
  style: {
10048
10157
  paddingLeft: 1,
@@ -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-BHq-5eW_.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-CQXTPT-p.mjs";
4
4
  import { z } from "zod";
5
5
  import { spawn } from "node:child_process";
6
6
  import { WebSocket } from "ws";
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import "./rest-BMh7CURU.mjs";
3
+ import "./api-CQXTPT-p.mjs";
4
+ import { t as PortalClient } from "./client-BwMzD7Iw.mjs";
5
+
6
+ export { PortalClient };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "./rest-DZnAT7BG.mjs";
3
- import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-XvAHDKqu.mjs";
2
+ import "./rest-BMh7CURU.mjs";
3
+ import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-SAL2aiGh.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-DZnAT7BG.mjs";
2
+ import { n as createRestClient, t as HttpError } from "./rest-BMh7CURU.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-CRAGDqp0.mjs");
17
+ const { PortalClient } = await import("./client-C9p4ta7J.mjs");
18
18
  let signalConnected;
19
19
  const connected = new Promise((resolve) => {
20
20
  signalConnected = resolve;
@@ -227,6 +227,9 @@ function createRestClient({ appUrl, sessionToken }) {
227
227
  const { conversation } = await post(`/api/v1/conversations/${encodeURIComponent(conversationId)}/fork`, {}, forkConversationResponseSchema);
228
228
  return conversation;
229
229
  },
230
+ compactConversation: async ({ conversationId }) => {
231
+ await post(`/api/v1/conversations/${encodeURIComponent(conversationId)}/compact`, {}, z.object({ status: z.string() }));
232
+ },
230
233
  deleteConversation: async ({ conversationId }) => {
231
234
  await del(`/api/v1/conversations/${encodeURIComponent(conversationId)}`);
232
235
  },
@@ -462,15 +465,26 @@ const runStreamEventSchema = z.union([z.object({
462
465
  error: z.string().nullish()
463
466
  })]);
464
467
  const streamErrorSchema = z.object({ error: z.string() });
465
- const conversationStreamEventSchema = z.discriminatedUnion("kind", [z.object({
466
- kind: z.literal("conversation"),
467
- id: z.string(),
468
- title: z.string().nullable()
469
- }), z.object({
470
- kind: z.literal("run"),
471
- runId: z.string(),
472
- createdAt: z.string().nullish()
473
- })]);
468
+ const conversationStreamEventSchema = z.discriminatedUnion("kind", [
469
+ z.object({
470
+ kind: z.literal("conversation"),
471
+ id: z.string(),
472
+ title: z.string().nullable()
473
+ }),
474
+ z.object({
475
+ kind: z.literal("run"),
476
+ runId: z.string(),
477
+ createdAt: z.string().nullish()
478
+ }),
479
+ z.object({
480
+ kind: z.literal("compaction"),
481
+ status: z.enum([
482
+ "started",
483
+ "completed",
484
+ "failed"
485
+ ])
486
+ })
487
+ ]);
474
488
 
475
489
  //#endregion
476
490
  export { createRestClient as n, errorDetail as r, HttpError as t };
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { n as createRestClient, r as errorDetail, t as HttpError } from "./rest-DZnAT7BG.mjs";
2
+ import { n as createRestClient, r as errorDetail, t as HttpError } from "./rest-BMh7CURU.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.594",
3
+ "version": "0.2.0-beta.595",
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-DZnAT7BG.mjs";
3
- import "./api-BHq-5eW_.mjs";
4
- import { t as PortalClient } from "./client-t6GmE8TI.mjs";
5
-
6
- export { PortalClient };