skydive-cli 0.1.0-beta.380 → 0.1.0-beta.382

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
@@ -16,7 +16,7 @@ import zlib from "node:zlib";
16
16
  import { WebSocket } from "ws";
17
17
 
18
18
  //#region package.json
19
- var version$1 = "0.1.0-beta.380";
19
+ var version$1 = "0.1.0-beta.382";
20
20
 
21
21
  //#endregion
22
22
  //#region src/types.ts
@@ -138,6 +138,14 @@ function getPromptHistoryPath() {
138
138
  return path.join(path.dirname(store.path), "prompt-history.jsonl");
139
139
  }
140
140
  /**
141
+ * Where the chat TUI persists pending review comments — one JSON file per
142
+ * conversation, so a pending comment survives conversation switches and
143
+ * process death. Kept beside the config file like prompt history.
144
+ */
145
+ function getReviewStateDir() {
146
+ return path.join(path.dirname(store.path), "review");
147
+ }
148
+ /**
141
149
  * Resolve the chat/auth origin. Precedence: `SKYDIVE_APP_URL` env > explicit
142
150
  * `--api-url` style override > stored value > `SKYDIVE_API_URL` env >
143
151
  * `DEFAULT_APP_URL`.
@@ -1177,6 +1185,23 @@ function createRestClient({ appUrl, sessionToken }) {
1177
1185
  const { messages } = await get(`/api/v1/conversations/${encodeURIComponent(conversationId)}/messages`, listMessagesResponseSchema);
1178
1186
  return messages;
1179
1187
  },
1188
+ listWorkspaceFiles: async ({ agentId }) => {
1189
+ const { files } = await get(`/api/v1/workspace-files?${new URLSearchParams({ agentId }).toString()}`, listWorkspaceFilesResponseSchema);
1190
+ return files;
1191
+ },
1192
+ readWorkspaceFile: async ({ fileId, maxBytes = 512 * 1024 }) => {
1193
+ const res = await fetch(`${appUrl}/api/v1/workspace-files/${encodeURIComponent(fileId)}/download?disposition=inline`, { headers: {
1194
+ ...baseHeaders,
1195
+ Range: `bytes=0-${maxBytes}`
1196
+ } });
1197
+ if (!res.ok) throw new HttpError(res.status, await res.text().catch(() => ""));
1198
+ const bytes = new Uint8Array(await res.arrayBuffer());
1199
+ const truncated = bytes.byteLength > maxBytes;
1200
+ return {
1201
+ text: new TextDecoder().decode(bytes.subarray(0, maxBytes)),
1202
+ truncated
1203
+ };
1204
+ },
1180
1205
  getRecap: async ({ conversationId }) => {
1181
1206
  const { recap } = await get(`/api/v1/conversations/${encodeURIComponent(conversationId)}/recap`, recapResponseSchema);
1182
1207
  return recap?.text ?? null;
@@ -1388,6 +1413,16 @@ const uiMessageSchema = z.object({
1388
1413
  });
1389
1414
  const recapResponseSchema = z.object({ recap: z.object({ text: z.string() }).nullable() });
1390
1415
  const listMessagesResponseSchema = z.object({ messages: z.array(uiMessageSchema) });
1416
+ const workspaceFileSchema = z.object({
1417
+ id: z.string(),
1418
+ path: z.string(),
1419
+ mediaType: z.string(),
1420
+ sizeBytes: z.number(),
1421
+ contentHash: z.string(),
1422
+ updatedAt: z.string(),
1423
+ shareUrl: z.string()
1424
+ });
1425
+ const listWorkspaceFilesResponseSchema = z.object({ files: z.array(workspaceFileSchema) });
1391
1426
  const sendResultSchema = z.object({
1392
1427
  runId: z.string(),
1393
1428
  messageId: z.string().uuid().nullish(),
@@ -2793,7 +2828,7 @@ const chatCommand = {
2793
2828
  printError(`Unknown theme "${themeId}". Valid themes: ${themes.map((t) => t.id).join(", ")}`);
2794
2829
  process.exit(1);
2795
2830
  }
2796
- const { runChat } = await import("./boot-DML2xNb6.mjs");
2831
+ const { runChat } = await import("./boot-B48ty_OV.mjs");
2797
2832
  await runChat({
2798
2833
  appUrl,
2799
2834
  sessionToken: session.value.sessionToken,
@@ -3587,7 +3622,7 @@ const switchCommand = {
3587
3622
  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.");
3588
3623
  process.exit(1);
3589
3624
  }
3590
- const { runWorkspacePicker } = await import("./boot-DML2xNb6.mjs");
3625
+ const { runWorkspacePicker } = await import("./boot-B48ty_OV.mjs");
3591
3626
  await runWorkspacePicker(session);
3592
3627
  return;
3593
3628
  }
@@ -4314,4 +4349,4 @@ function resolveArgv(args, tty = {
4314
4349
  createCli(resolveArgv(hideBin(process.argv))).parse();
4315
4350
 
4316
4351
  //#endregion
4317
- export { HttpError as A, resolveWebUrl as B, noColorRequested as C, themeModeFromColorFgBg as D, themeMode as E, setActiveWorkspace as F, DEFAULT_API_URL as I, DEFAULT_APP_URL as L, errorDetail as M, getActiveWorkspaceId as N, themeVersion as O, listWorkspaces as P, getConfigPath as R, monoTheme as S, themeForMode as T, saveTheme as V, errorMessage as _, mintPortalDeviceToken as a, applyTheme as b, portalWsUrl as c, cardActionErrorMessage as d, parseExternalOauthConnectParams as f, parseConnectCard as g, resolveConnectUrl as h, grantPortalAccess as i, createRestClient as j, themesForMode as k, resolveAgent as l, reconcileMaskedInput as m, fetchPortalDevices as n, buildEnv as o, parseOauthConnectParams as p, findThisDevice as r, machineIdentity as s, SandboxStream as t, MASK_CHAR as u, isRecord as v, theme as w, findTheme as x, DEFAULT_THEME_ID as y, getSavedTheme as z };
4352
+ export { HttpError as A, getSavedTheme as B, noColorRequested as C, themeModeFromColorFgBg as D, themeMode as E, setActiveWorkspace as F, saveTheme as H, DEFAULT_API_URL as I, DEFAULT_APP_URL as L, errorDetail as M, getActiveWorkspaceId as N, themeVersion as O, listWorkspaces as P, getConfigPath as R, monoTheme as S, themeForMode as T, resolveWebUrl as V, errorMessage as _, mintPortalDeviceToken as a, applyTheme as b, portalWsUrl as c, cardActionErrorMessage as d, parseExternalOauthConnectParams as f, parseConnectCard as g, resolveConnectUrl as h, grantPortalAccess as i, createRestClient as j, themesForMode as k, resolveAgent as l, reconcileMaskedInput as m, fetchPortalDevices as n, buildEnv as o, parseOauthConnectParams as p, findThisDevice as r, machineIdentity as s, SandboxStream as t, MASK_CHAR as u, isRecord as v, theme as w, findTheme as x, DEFAULT_THEME_ID as y, getReviewStateDir as z };