skydive-cli 0.1.0-beta.378 → 0.1.0-beta.380
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.
|
|
19
|
+
var version$1 = "0.1.0-beta.380";
|
|
20
20
|
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/types.ts
|
|
@@ -1003,7 +1003,8 @@ const authCommand = {
|
|
|
1003
1003
|
//#region src/chat/api/rest.ts
|
|
1004
1004
|
var rest_exports = /* @__PURE__ */ __exportAll({
|
|
1005
1005
|
HttpError: () => HttpError,
|
|
1006
|
-
createRestClient: () => createRestClient
|
|
1006
|
+
createRestClient: () => createRestClient,
|
|
1007
|
+
errorDetail: () => errorDetail
|
|
1007
1008
|
});
|
|
1008
1009
|
var HttpError = class extends Error {
|
|
1009
1010
|
constructor(status, body) {
|
|
@@ -1013,6 +1014,20 @@ var HttpError = class extends Error {
|
|
|
1013
1014
|
this.name = "HttpError";
|
|
1014
1015
|
}
|
|
1015
1016
|
};
|
|
1017
|
+
const ERROR_DETAIL_MAX_BODY = 2e3;
|
|
1018
|
+
/**
|
|
1019
|
+
* Fullest renderable text for a thrown value. `HttpError.message` clips the
|
|
1020
|
+
* response body to 200 chars (it flows into logs and one-line UIs); the
|
|
1021
|
+
* transcript renders errors collapsed to a single line, so it can afford the
|
|
1022
|
+
* whole body — capped with an explicit marker, never cut silently.
|
|
1023
|
+
*/
|
|
1024
|
+
function errorDetail(err) {
|
|
1025
|
+
if (err instanceof HttpError) {
|
|
1026
|
+
const body = err.body.length > ERROR_DETAIL_MAX_BODY ? `${err.body.slice(0, ERROR_DETAIL_MAX_BODY)}… (+${err.body.length - ERROR_DETAIL_MAX_BODY} chars)` : err.body;
|
|
1027
|
+
return body ? `HTTP ${err.status}: ${body}` : `HTTP ${err.status}`;
|
|
1028
|
+
}
|
|
1029
|
+
return err instanceof Error ? err.message : String(err);
|
|
1030
|
+
}
|
|
1016
1031
|
const MAX_STREAM_RECONNECTS = 5;
|
|
1017
1032
|
function createRestClient({ appUrl, sessionToken }) {
|
|
1018
1033
|
const baseHeaders = {
|
|
@@ -2778,7 +2793,7 @@ const chatCommand = {
|
|
|
2778
2793
|
printError(`Unknown theme "${themeId}". Valid themes: ${themes.map((t) => t.id).join(", ")}`);
|
|
2779
2794
|
process.exit(1);
|
|
2780
2795
|
}
|
|
2781
|
-
const { runChat } = await import("./boot-
|
|
2796
|
+
const { runChat } = await import("./boot-DML2xNb6.mjs");
|
|
2782
2797
|
await runChat({
|
|
2783
2798
|
appUrl,
|
|
2784
2799
|
sessionToken: session.value.sessionToken,
|
|
@@ -3572,7 +3587,7 @@ const switchCommand = {
|
|
|
3572
3587
|
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.");
|
|
3573
3588
|
process.exit(1);
|
|
3574
3589
|
}
|
|
3575
|
-
const { runWorkspacePicker } = await import("./boot-
|
|
3590
|
+
const { runWorkspacePicker } = await import("./boot-DML2xNb6.mjs");
|
|
3576
3591
|
await runWorkspacePicker(session);
|
|
3577
3592
|
return;
|
|
3578
3593
|
}
|
|
@@ -3700,8 +3715,8 @@ async function portalFetch(auth, path, init) {
|
|
|
3700
3715
|
...init.body ? { body: init.body } : {}
|
|
3701
3716
|
});
|
|
3702
3717
|
if (!res.ok) {
|
|
3703
|
-
const body = await res.text().
|
|
3704
|
-
throw new
|
|
3718
|
+
const body = await res.text().catch(() => "");
|
|
3719
|
+
throw new HttpError(res.status, body);
|
|
3705
3720
|
}
|
|
3706
3721
|
return res.json();
|
|
3707
3722
|
}
|
|
@@ -4299,4 +4314,4 @@ function resolveArgv(args, tty = {
|
|
|
4299
4314
|
createCli(resolveArgv(hideBin(process.argv))).parse();
|
|
4300
4315
|
|
|
4301
4316
|
//#endregion
|
|
4302
|
-
export { HttpError as A,
|
|
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as HttpError, B as
|
|
2
|
+
import { A as HttpError, B as resolveWebUrl, C as noColorRequested, D as themeModeFromColorFgBg, E as themeMode, F as setActiveWorkspace, I as DEFAULT_API_URL, L as DEFAULT_APP_URL, M as errorDetail, N as getActiveWorkspaceId, O as themeVersion, P as listWorkspaces, R as getConfigPath, S as monoTheme, T as themeForMode, V as saveTheme, _ as errorMessage, b as applyTheme, d as cardActionErrorMessage, f as parseExternalOauthConnectParams, g as parseConnectCard, h as resolveConnectUrl, j as createRestClient, k as themesForMode, l as resolveAgent, m as reconcileMaskedInput, p as parseOauthConnectParams, t as SandboxStream, u as MASK_CHAR, v as isRecord, w as theme, x as findTheme, y as DEFAULT_THEME_ID, z as getSavedTheme } from "./bin.mjs";
|
|
3
3
|
import { t as PortalClient } from "./client-XFsd0Wy9.mjs";
|
|
4
4
|
import { n as runRawPtyPassthrough } from "./raw-pty-C1DXKms6.mjs";
|
|
5
5
|
import * as os$1 from "node:os";
|
|
@@ -2106,6 +2106,51 @@ function StatusLine({ item }) {
|
|
|
2106
2106
|
}
|
|
2107
2107
|
}
|
|
2108
2108
|
|
|
2109
|
+
//#endregion
|
|
2110
|
+
//#region src/chat/tui/chunks/error-item.tsx
|
|
2111
|
+
/**
|
|
2112
|
+
* Transcript error block. Anything longer than one line collapses to its
|
|
2113
|
+
* first line — an HTTP error body or a stack must not bury the conversation —
|
|
2114
|
+
* and clicking toggles the full text, matching the reasoning/tool blocks.
|
|
2115
|
+
*/
|
|
2116
|
+
function ErrorItem({ item }) {
|
|
2117
|
+
const [expanded, setExpanded] = useState(false);
|
|
2118
|
+
const text = item.text.trim();
|
|
2119
|
+
const firstLine = text.split("\n").find((line) => line.trim()) ?? text;
|
|
2120
|
+
if (!(text.includes("\n") || firstLine.length > 100)) return /* @__PURE__ */ jsxs("text", {
|
|
2121
|
+
fg: theme.error,
|
|
2122
|
+
children: ["✗ ", text]
|
|
2123
|
+
});
|
|
2124
|
+
if (expanded) return /* @__PURE__ */ jsxs("box", {
|
|
2125
|
+
style: {
|
|
2126
|
+
flexDirection: "column",
|
|
2127
|
+
backgroundColor: theme.surface
|
|
2128
|
+
},
|
|
2129
|
+
onMouseDown: () => setExpanded(false),
|
|
2130
|
+
children: [/* @__PURE__ */ jsx("text", {
|
|
2131
|
+
fg: theme.error,
|
|
2132
|
+
children: "✗ error"
|
|
2133
|
+
}), /* @__PURE__ */ jsxs(Indented, { children: [/* @__PURE__ */ jsx(ExpandedLines, {
|
|
2134
|
+
text,
|
|
2135
|
+
fg: theme.error
|
|
2136
|
+
}), /* @__PURE__ */ jsx(CollapseHint, {})] })]
|
|
2137
|
+
});
|
|
2138
|
+
return /* @__PURE__ */ jsx("box", {
|
|
2139
|
+
onMouseDown: () => setExpanded(true),
|
|
2140
|
+
children: /* @__PURE__ */ jsxs("text", {
|
|
2141
|
+
fg: theme.error,
|
|
2142
|
+
children: [
|
|
2143
|
+
"✗ ",
|
|
2144
|
+
truncate(firstLine, 100),
|
|
2145
|
+
/* @__PURE__ */ jsx("span", {
|
|
2146
|
+
fg: theme.dim,
|
|
2147
|
+
children: " · click to expand"
|
|
2148
|
+
})
|
|
2149
|
+
]
|
|
2150
|
+
})
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2109
2154
|
//#endregion
|
|
2110
2155
|
//#region src/chat/tui/chunks/tool-call-summary.ts
|
|
2111
2156
|
const TOOL_CALL_SUMMARY_KEY = "__skydive_summary__";
|
|
@@ -3018,10 +3063,7 @@ function RenderItem({ item }) {
|
|
|
3018
3063
|
});
|
|
3019
3064
|
case "error": return /* @__PURE__ */ jsx(Row, {
|
|
3020
3065
|
barColor: null,
|
|
3021
|
-
children: /* @__PURE__ */ jsx(
|
|
3022
|
-
fg: theme.error,
|
|
3023
|
-
children: item.text
|
|
3024
|
-
})
|
|
3066
|
+
children: /* @__PURE__ */ jsx(ErrorItem, { item })
|
|
3025
3067
|
});
|
|
3026
3068
|
case "card": return /* @__PURE__ */ jsx(Row, {
|
|
3027
3069
|
barColor: null,
|
|
@@ -5485,7 +5527,7 @@ function ChatScreen({ agent, conversation }) {
|
|
|
5485
5527
|
setItems((prev) => [...prev, {
|
|
5486
5528
|
kind: "error",
|
|
5487
5529
|
id: crypto.randomUUID(),
|
|
5488
|
-
text: `failed to load history: ${
|
|
5530
|
+
text: `failed to load history: ${errorDetail(err)}`
|
|
5489
5531
|
}]);
|
|
5490
5532
|
} finally {
|
|
5491
5533
|
if (!cancelled) setHistoryLoaded(true);
|
|
@@ -5541,7 +5583,7 @@ function ChatScreen({ agent, conversation }) {
|
|
|
5541
5583
|
setItems((prev) => [...prev, {
|
|
5542
5584
|
kind: "error",
|
|
5543
5585
|
id: crypto.randomUUID(),
|
|
5544
|
-
text:
|
|
5586
|
+
text: errorDetail(err)
|
|
5545
5587
|
}]);
|
|
5546
5588
|
setRun({ kind: "idle" });
|
|
5547
5589
|
});
|
|
@@ -5608,7 +5650,7 @@ function ChatScreen({ agent, conversation }) {
|
|
|
5608
5650
|
setItems((prev) => [...prev, {
|
|
5609
5651
|
kind: "error",
|
|
5610
5652
|
id: crypto.randomUUID(),
|
|
5611
|
-
text: `attachment failed: ${row.fileName}${result.status === "rejected" ? ` (${
|
|
5653
|
+
text: `attachment failed: ${row.fileName}${result.status === "rejected" ? ` (${errorDetail(result.reason)})` : ""}`
|
|
5612
5654
|
}]);
|
|
5613
5655
|
}
|
|
5614
5656
|
}
|
|
@@ -5642,7 +5684,7 @@ function ChatScreen({ agent, conversation }) {
|
|
|
5642
5684
|
setItems((prev) => [...prev.filter((m) => m.id !== optimisticId), {
|
|
5643
5685
|
kind: "error",
|
|
5644
5686
|
id: crypto.randomUUID(),
|
|
5645
|
-
text:
|
|
5687
|
+
text: errorDetail(err)
|
|
5646
5688
|
}]);
|
|
5647
5689
|
if (echo) setInput((existing) => existing ? existing : trimmed);
|
|
5648
5690
|
const restore = staged.filter((a) => uploadsRef.current.has(a.tempId));
|
|
@@ -5670,7 +5712,7 @@ function ChatScreen({ agent, conversation }) {
|
|
|
5670
5712
|
setItems((prev) => [...prev, {
|
|
5671
5713
|
kind: "error",
|
|
5672
5714
|
id: crypto.randomUUID(),
|
|
5673
|
-
text: `steer cancel failed: ${
|
|
5715
|
+
text: `steer cancel failed: ${errorDetail(err)}`
|
|
5674
5716
|
}]);
|
|
5675
5717
|
});
|
|
5676
5718
|
return true;
|
|
@@ -6131,7 +6173,7 @@ function ChatScreen({ agent, conversation }) {
|
|
|
6131
6173
|
})).catch((err) => setItems((prev) => [...prev, {
|
|
6132
6174
|
kind: "error",
|
|
6133
6175
|
id: crypto.randomUUID(),
|
|
6134
|
-
text: `couldn't share machine: ${
|
|
6176
|
+
text: `couldn't share machine: ${errorDetail(err)}`
|
|
6135
6177
|
}]));
|
|
6136
6178
|
}, [
|
|
6137
6179
|
portalClient,
|