skydive-cli 0.3.0-beta.869 → 0.3.0-beta.881
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/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Billing-blocked sends and runs now surface the server-authored recovery
|
|
13
|
+
guidance from the typed billing outcome. The chat TUI renders it as a
|
|
14
|
+
warning-toned system-notice row — live when a send is refused or a run is
|
|
15
|
+
stopped at the billing boundary, and again when reopening a conversation
|
|
16
|
+
that holds a persisted billing notice — instead of a generic error.
|
|
17
|
+
Headless `chat -p` and `messages get` print the guidance (state, recovery
|
|
18
|
+
step, and manage-billing URL) on stderr, keep any partial output already
|
|
19
|
+
streamed on stdout, and exit with code `5` (distinct from the generic `1`)
|
|
20
|
+
so scripted callers can tell a billing pause from a failure.
|
|
21
|
+
|
|
10
22
|
## [0.3.0] - 2026-08-04
|
|
11
23
|
|
|
12
24
|
### Added
|
package/dist/js/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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-Bk8dwJFi.mjs";
|
|
3
3
|
import { A as getStoredApiKeyWorkspaceName, C as getLastSeenVersion, F as resolveManagementAuth, I as resolveSession, M as resolveAppUrl, N as resolveChatAuth, O as getShareMachineDefault, P as resolveConfig, R as saveConfig, S as getConfigPath, T as getPromptHistoryPath, V as setLastSeenVersion, _ as API_KEY_PREFIX, b as PREFERENCES, g as API_KEY_FAMILY_PREFIX, h as API_KEYS_URL, i as resolveAgent, j as getUpdateCheckDisabled, k as getStoredApiKeyId, v as DEFAULT_API_URL, w as getPreference, x as deleteConfig, z as saveSession } from "./print-X2N5wJ5l.mjs";
|
|
4
4
|
import { n as printError, r as printTable, t as output } from "./output-DYzzdXYV.mjs";
|
|
5
5
|
import { n as createRestClient, t as HttpError } from "./rest-imDZZGQA.mjs";
|
|
@@ -1505,7 +1505,7 @@ const importCommand = {
|
|
|
1505
1505
|
process.exit(1);
|
|
1506
1506
|
}
|
|
1507
1507
|
}
|
|
1508
|
-
const { runChat } = await import("./boot-
|
|
1508
|
+
const { runChat } = await import("./boot-QymlWP-W.mjs");
|
|
1509
1509
|
await runChat({
|
|
1510
1510
|
appUrl,
|
|
1511
1511
|
sessionToken: session.value.sessionToken,
|
|
@@ -1917,7 +1917,7 @@ const chatCommand = {
|
|
|
1917
1917
|
sessionToken: auth.value.token,
|
|
1918
1918
|
agentSelector: argv.agent ?? null
|
|
1919
1919
|
});
|
|
1920
|
-
const { runChat } = await import("./boot-
|
|
1920
|
+
const { runChat } = await import("./boot-QymlWP-W.mjs");
|
|
1921
1921
|
await runChat({
|
|
1922
1922
|
appUrl: auth.value.appUrl,
|
|
1923
1923
|
sessionToken: auth.value.token,
|
|
@@ -2276,7 +2276,7 @@ const switchCommand = {
|
|
|
2276
2276
|
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.");
|
|
2277
2277
|
process.exit(1);
|
|
2278
2278
|
}
|
|
2279
|
-
const { runWorkspacePicker } = await import("./boot-
|
|
2279
|
+
const { runWorkspacePicker } = await import("./boot-QymlWP-W.mjs");
|
|
2280
2280
|
await runWorkspacePicker(session);
|
|
2281
2281
|
return;
|
|
2282
2282
|
}
|
|
@@ -3744,7 +3744,7 @@ function setupUpdateCheck(argv) {
|
|
|
3744
3744
|
|
|
3745
3745
|
//#endregion
|
|
3746
3746
|
//#region src/changelog.generated.ts
|
|
3747
|
-
const CHANGELOG_MD = "# Changelog\n\nAll notable changes to the Skydive CLI are documented here.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n## [0.3.0] - 2026-08-04\n\n### Added\n\n**Chat TUI**\n\n- `/fork` slash command to fork a conversation at any point and continue in a new thread.\n- `/conversation` switches threads from inside a live session.\n- `/compact` triggers manual conversation compaction.\n- `/portal` and `/copy` slash commands.\n- Archive the current conversation from the chat TUI.\n- `--new` flag on `skydive chat` to start a fresh conversation.\n- Debounced server-side conversation search in the picker, with title matches ranked first.\n- File review pane orientation toggle, and review comments in the file pane.\n- Pinned plan card controls and a jump-to-latest hint.\n- Terminal title (OSC) follows the live conversation title on every screen; inside cmux the workspace is renamed too, and linked PRs are pushed to the cmux sidebar.\n- Every participating agent shows in the conversation list; connect cards each have their own identity, and ctrl+r asks which connect card to act on.\n- Colored Skydive splash art in `skydive --help` and the TUI pickers.\n- New-agent name prefilled from the server's suggestion.\n\n**CLI & platform**\n\n- `skydive update` self-updater, with an update notice when a new version is available.\n- Shell completions for bash, zsh, and fish via `completion install`.\n- Portal daemon: one connection per host with per-conversation working directories.\n- Agent-led coding-agent import (`skydive import`).\n- Per-workspace scoping on the REST client, and cross-org `--agent <uuid>` auto-switches workspace.\n- `skydive-beta` wrapper for the canary channel.\n- `skydive config` command to view and set the safe, hand-editable CLI preferences (`shareMachineDefault`, `updateCheck`) without opening `config.json`. `config`/`config list` shows each key, its effective value, and whether it comes from the file or the built-in default; `config get`/`set`/`unset` read and change one key; `config path` prints the config file location. It only ever touches those preference keys, never credentials or flow-managed state.\n\n### Fixed\n\n- `skydive update` no longer claims an update is available on every npm install.\n- Chat memory is bounded (payload clamps + windowed rows) with a memory watchdog and OOM diagnostic report; transcript rows are memoized so streaming stops re-rendering the whole chat.\n- Chat-send failures map to real error messages.\n- Notification and sidebar previews use the last text block of the reply and strip inline markdown.\n- Picker rows no longer overlap when a conversation title contains a newline, tab, or control character.\n- Sending to non-web channel conversations is blocked in the TUI.\n- GitHub bot connect opens on the web front door, not api.skydive.com.\n- TUI activity counter times from the run, not the screen.\n\n## [0.2.0] - 2026-07-29\n\n### Added\n\n**Sandbox & machine access**\n\n- Standalone `skydive sandbox` command for direct access to an agent's sandbox.\n- `/sandbox` in the chat TUI — live PTY session and one-shot command execution.\n- Headless machine sharing via `skydive portal`, with self-registering portal grants.\n- `shareMachineDefault` config key for always-on portal sharing.\n\n**Chat TUI**\n\n- File pane (`ctrl+g`) with Changes and Files tabs: a shared file tree plus source viewer and a workspace browser, mouse-resizable and responsive to terminal size.\n- Agent todo list rendered in the chat TUI, above the composer, mirroring the web chat's todo card.\n- Fuzzy finder in the conversation and agent pickers.\n- Slash-command autocomplete menu.\n- Paste or drag-and-drop any file into the composer; paste clipboard images with Cmd+V.\n- Run local shell commands with `!` in the composer.\n- Conversation recaps, streamed live title updates, and per-agent attribution on assistant turns.\n- Working timer rolls up into minutes and hours.\n- Conversation picker paginates past 50 conversations and shows only your own conversations.\n- Esc leaves a live run; typing `exit` quits the chat.\n- Cursor Dark theme.\n- Picker rows no longer overlap when a conversation title contains a newline, tab, or control character.\n\n**Headless & scripting**\n\n- Resume a conversation by id.\n- `conversations list` and `conversations show` for transcript reads.\n- `messages get`, with run recovery keyed on message id.\n- Connect cards surface in headless `-p` mode so a driving agent never gets stuck.\n\n**Authentication**\n\n- `skydive auth login` via the browser now auto-mints an API key, so one login yields both a chat session and a usable management credential. Management commands announce the key's pinned workspace when it drives them, so a workspace mismatch is visible at use time.\n- Workspace picker on the device authorization page.\n- Account and workspace identity shown in `auth status`.\n\n**Platform**\n\n- Standalone binary builds compiling the CLI into a per-target executable.\n- Interactive workspace switcher; management commands follow the active workspace.\n- Terminal host integrations and agent notifications.\n\n### Fixed\n\n- Transcript errors collapse to one line, click to expand (REST and portal errors keep their full body).\n- Dragged/pasted image file paths attach the file instead of inserting path text, including macOS paths with literal parentheses.\n- Bare URLs in chat markdown are hyperlinked so they survive text wrap.\n- Composer draft is preserved across TUI overlays.\n- Relative connect links resolve before opening the browser.\n- Numbered markdown headings render colored in the TUI.\n- Chat transcript pages by 75% of a screen; picker rows stay on one line.\n- Run starts push to the TUI over the conversation stream.\n- Security: remediated high-severity dependency findings and cleared tar/shell-quote CVEs.\n\n## [0.1.0] - 2026-07-21\n\nInitial public release: `skydive chat` TUI, agent and conversation management,\ndevice authorization, and headless `-p` mode.\n";
|
|
3747
|
+
const CHANGELOG_MD = "# Changelog\n\nAll notable changes to the Skydive CLI are documented here.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n### Added\n\n- Billing-blocked sends and runs now surface the server-authored recovery\n guidance from the typed billing outcome. The chat TUI renders it as a\n warning-toned system-notice row — live when a send is refused or a run is\n stopped at the billing boundary, and again when reopening a conversation\n that holds a persisted billing notice — instead of a generic error.\n Headless `chat -p` and `messages get` print the guidance (state, recovery\n step, and manage-billing URL) on stderr, keep any partial output already\n streamed on stdout, and exit with code `5` (distinct from the generic `1`)\n so scripted callers can tell a billing pause from a failure.\n\n## [0.3.0] - 2026-08-04\n\n### Added\n\n**Chat TUI**\n\n- `/fork` slash command to fork a conversation at any point and continue in a new thread.\n- `/conversation` switches threads from inside a live session.\n- `/compact` triggers manual conversation compaction.\n- `/portal` and `/copy` slash commands.\n- Archive the current conversation from the chat TUI.\n- `--new` flag on `skydive chat` to start a fresh conversation.\n- Debounced server-side conversation search in the picker, with title matches ranked first.\n- File review pane orientation toggle, and review comments in the file pane.\n- Pinned plan card controls and a jump-to-latest hint.\n- Terminal title (OSC) follows the live conversation title on every screen; inside cmux the workspace is renamed too, and linked PRs are pushed to the cmux sidebar.\n- Every participating agent shows in the conversation list; connect cards each have their own identity, and ctrl+r asks which connect card to act on.\n- Colored Skydive splash art in `skydive --help` and the TUI pickers.\n- New-agent name prefilled from the server's suggestion.\n\n**CLI & platform**\n\n- `skydive update` self-updater, with an update notice when a new version is available.\n- Shell completions for bash, zsh, and fish via `completion install`.\n- Portal daemon: one connection per host with per-conversation working directories.\n- Agent-led coding-agent import (`skydive import`).\n- Per-workspace scoping on the REST client, and cross-org `--agent <uuid>` auto-switches workspace.\n- `skydive-beta` wrapper for the canary channel.\n- `skydive config` command to view and set the safe, hand-editable CLI preferences (`shareMachineDefault`, `updateCheck`) without opening `config.json`. `config`/`config list` shows each key, its effective value, and whether it comes from the file or the built-in default; `config get`/`set`/`unset` read and change one key; `config path` prints the config file location. It only ever touches those preference keys, never credentials or flow-managed state.\n\n### Fixed\n\n- `skydive update` no longer claims an update is available on every npm install.\n- Chat memory is bounded (payload clamps + windowed rows) with a memory watchdog and OOM diagnostic report; transcript rows are memoized so streaming stops re-rendering the whole chat.\n- Chat-send failures map to real error messages.\n- Notification and sidebar previews use the last text block of the reply and strip inline markdown.\n- Picker rows no longer overlap when a conversation title contains a newline, tab, or control character.\n- Sending to non-web channel conversations is blocked in the TUI.\n- GitHub bot connect opens on the web front door, not api.skydive.com.\n- TUI activity counter times from the run, not the screen.\n\n## [0.2.0] - 2026-07-29\n\n### Added\n\n**Sandbox & machine access**\n\n- Standalone `skydive sandbox` command for direct access to an agent's sandbox.\n- `/sandbox` in the chat TUI — live PTY session and one-shot command execution.\n- Headless machine sharing via `skydive portal`, with self-registering portal grants.\n- `shareMachineDefault` config key for always-on portal sharing.\n\n**Chat TUI**\n\n- File pane (`ctrl+g`) with Changes and Files tabs: a shared file tree plus source viewer and a workspace browser, mouse-resizable and responsive to terminal size.\n- Agent todo list rendered in the chat TUI, above the composer, mirroring the web chat's todo card.\n- Fuzzy finder in the conversation and agent pickers.\n- Slash-command autocomplete menu.\n- Paste or drag-and-drop any file into the composer; paste clipboard images with Cmd+V.\n- Run local shell commands with `!` in the composer.\n- Conversation recaps, streamed live title updates, and per-agent attribution on assistant turns.\n- Working timer rolls up into minutes and hours.\n- Conversation picker paginates past 50 conversations and shows only your own conversations.\n- Esc leaves a live run; typing `exit` quits the chat.\n- Cursor Dark theme.\n- Picker rows no longer overlap when a conversation title contains a newline, tab, or control character.\n\n**Headless & scripting**\n\n- Resume a conversation by id.\n- `conversations list` and `conversations show` for transcript reads.\n- `messages get`, with run recovery keyed on message id.\n- Connect cards surface in headless `-p` mode so a driving agent never gets stuck.\n\n**Authentication**\n\n- `skydive auth login` via the browser now auto-mints an API key, so one login yields both a chat session and a usable management credential. Management commands announce the key's pinned workspace when it drives them, so a workspace mismatch is visible at use time.\n- Workspace picker on the device authorization page.\n- Account and workspace identity shown in `auth status`.\n\n**Platform**\n\n- Standalone binary builds compiling the CLI into a per-target executable.\n- Interactive workspace switcher; management commands follow the active workspace.\n- Terminal host integrations and agent notifications.\n\n### Fixed\n\n- Transcript errors collapse to one line, click to expand (REST and portal errors keep their full body).\n- Dragged/pasted image file paths attach the file instead of inserting path text, including macOS paths with literal parentheses.\n- Bare URLs in chat markdown are hyperlinked so they survive text wrap.\n- Composer draft is preserved across TUI overlays.\n- Relative connect links resolve before opening the browser.\n- Numbered markdown headings render colored in the TUI.\n- Chat transcript pages by 75% of a screen; picker rows stay on one line.\n- Run starts push to the TUI over the conversation stream.\n- Security: remediated high-severity dependency findings and cleared tar/shell-quote CVEs.\n\n## [0.1.0] - 2026-07-21\n\nInitial public release: `skydive chat` TUI, agent and conversation management,\ndevice authorization, and headless `-p` mode.\n";
|
|
3748
3748
|
|
|
3749
3749
|
//#endregion
|
|
3750
3750
|
//#region src/whats-new.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
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-Bk8dwJFi.mjs";
|
|
3
3
|
import { B as saveTheme, D as getSavedTheme, E as getReviewStateDir, L as resolveWebUrl, S as getConfigPath, 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, y as DEFAULT_APP_URL } from "./print-X2N5wJ5l.mjs";
|
|
4
4
|
import { a as errorMessage, i as sendErrorMessage, n as createRestClient, o as isRecord, r as errorDetail, t as HttpError } from "./rest-imDZZGQA.mjs";
|
|
5
|
-
import "./billing-blocked-CwfG1BTR.mjs";
|
|
5
|
+
import { i as billingBlockedOutcomeFromSendResponse } from "./billing-blocked-CwfG1BTR.mjs";
|
|
6
6
|
import { t as PortalClient } from "./client-CKzK-12y.mjs";
|
|
7
7
|
import { d as makeLineParser, f as parseDaemonMessage, l as daemonPaths, n as ensureDaemonRunning, s as LOCAL_PROTOCOL_VERSION, u as encodeLine } from "./daemon-CaFz7Wtw.mjs";
|
|
8
8
|
import { t as SandboxStream } from "./client-D8s9vY4p.mjs";
|
|
@@ -3217,6 +3217,22 @@ function StatusLine({ item }) {
|
|
|
3217
3217
|
}
|
|
3218
3218
|
}
|
|
3219
3219
|
|
|
3220
|
+
//#endregion
|
|
3221
|
+
//#region src/chat/tui/chunks/system-notice-item.tsx
|
|
3222
|
+
/**
|
|
3223
|
+
* Platform system-notice row: the server stopped or refused work for a
|
|
3224
|
+
* platform reason (today: billing-blocked), so it reads as a warning-toned
|
|
3225
|
+
* notice — visually distinct from the ✗ transport/agent error row. The text
|
|
3226
|
+
* already carries the full guidance, produced server-side or derived from a
|
|
3227
|
+
* typed outcome by the producer that pushed the item.
|
|
3228
|
+
*/
|
|
3229
|
+
function SystemNoticeItem({ item }) {
|
|
3230
|
+
return /* @__PURE__ */ jsxs("text", {
|
|
3231
|
+
fg: theme.warning,
|
|
3232
|
+
children: ["◆ ", item.text.trim()]
|
|
3233
|
+
});
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3220
3236
|
//#endregion
|
|
3221
3237
|
//#region src/chat/tui/chunks/error-item.tsx
|
|
3222
3238
|
/**
|
|
@@ -3891,12 +3907,13 @@ function PlainDiff({ diff }) {
|
|
|
3891
3907
|
//#endregion
|
|
3892
3908
|
//#region src/chat/tui/chunks/tool-bash.tsx
|
|
3893
3909
|
const maxLines$1 = 8;
|
|
3910
|
+
const maxCommandLines = 3;
|
|
3894
3911
|
/**
|
|
3895
3912
|
* Rich view for the `bash`/`shell` tool. Leads with the model-authored
|
|
3896
3913
|
* summary when present (mirroring web chat's activity labels), with the
|
|
3897
3914
|
* command on its own dim line beneath; then its output
|
|
3898
3915
|
* (truncated to keep the scrollback usable — click the block to toggle the
|
|
3899
|
-
* full output
|
|
3916
|
+
* full command and output).
|
|
3900
3917
|
*/
|
|
3901
3918
|
function ToolBash({ item }) {
|
|
3902
3919
|
const glyph = toolGlyph(item.state);
|
|
@@ -3905,6 +3922,10 @@ function ToolBash({ item }) {
|
|
|
3905
3922
|
const output = item.output?.kind === "ok" ? typeof item.output.value === "string" ? item.output.value : extractStdout(item.output.value) : null;
|
|
3906
3923
|
const summary = getToolCallSummary(item.input);
|
|
3907
3924
|
const [expanded, setExpanded] = useState(false);
|
|
3925
|
+
const commandText = command || "(empty command)";
|
|
3926
|
+
const headerCommandLine = commandText.split("\n", 1)[0] ?? commandText;
|
|
3927
|
+
const commandBlockText = summary !== null ? `$ ${commandText}` : commandText.slice(headerCommandLine.length + 1);
|
|
3928
|
+
const showCommandBlock = commandBlockText.length > 0;
|
|
3908
3929
|
return /* @__PURE__ */ jsxs("box", {
|
|
3909
3930
|
style: {
|
|
3910
3931
|
flexDirection: "column",
|
|
@@ -3917,14 +3938,19 @@ function ToolBash({ item }) {
|
|
|
3917
3938
|
children: [glyph.ch, " "]
|
|
3918
3939
|
}), /* @__PURE__ */ jsx("span", {
|
|
3919
3940
|
fg: theme.tool,
|
|
3920
|
-
children: summary !== null ? summary : `$ ${
|
|
3941
|
+
children: summary !== null ? summary : `$ ${headerCommandLine}`
|
|
3921
3942
|
})] }),
|
|
3922
|
-
|
|
3943
|
+
showCommandBlock && /* @__PURE__ */ jsx(Indented, { children: expanded ? /* @__PURE__ */ jsx(ExpandedLines, {
|
|
3944
|
+
text: commandBlockText,
|
|
3945
|
+
fg: theme.muted
|
|
3946
|
+
}) : clipLines(commandBlockText, {
|
|
3947
|
+
maxLines: maxCommandLines,
|
|
3948
|
+
maxLineLen: 100
|
|
3949
|
+
}).map((line, idx) => /* @__PURE__ */ jsx("text", {
|
|
3923
3950
|
fg: theme.muted,
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
output !== null && output.length > 0 && /* @__PURE__ */ jsxs(Indented, { children: [expanded ? /* @__PURE__ */ jsx(ExpandedLines, {
|
|
3951
|
+
children: line
|
|
3952
|
+
}, idx)) }),
|
|
3953
|
+
output !== null && output.length > 0 && /* @__PURE__ */ jsx(Indented, { children: expanded ? /* @__PURE__ */ jsx(ExpandedLines, {
|
|
3928
3954
|
text: output,
|
|
3929
3955
|
fg: theme.muted
|
|
3930
3956
|
}) : clipLines(output, {
|
|
@@ -3933,11 +3959,12 @@ function ToolBash({ item }) {
|
|
|
3933
3959
|
}).map((line, idx) => /* @__PURE__ */ jsx("text", {
|
|
3934
3960
|
fg: theme.muted,
|
|
3935
3961
|
children: line
|
|
3936
|
-
}, idx))
|
|
3962
|
+
}, idx)) }),
|
|
3937
3963
|
item.output?.kind === "error" && /* @__PURE__ */ jsx(Indented, { children: /* @__PURE__ */ jsx("text", {
|
|
3938
3964
|
fg: theme.error,
|
|
3939
3965
|
children: item.output.errorText
|
|
3940
|
-
}) })
|
|
3966
|
+
}) }),
|
|
3967
|
+
expanded && (showCommandBlock && isClipped(commandBlockText, maxCommandLines) || output !== null && isClipped(output, maxLines$1)) && /* @__PURE__ */ jsx(Indented, { children: /* @__PURE__ */ jsx(CollapseHint, {}) })
|
|
3941
3968
|
]
|
|
3942
3969
|
});
|
|
3943
3970
|
}
|
|
@@ -4216,6 +4243,10 @@ function RenderItem({ item }) {
|
|
|
4216
4243
|
barColor: null,
|
|
4217
4244
|
children: /* @__PURE__ */ jsx(ErrorItem, { item })
|
|
4218
4245
|
});
|
|
4246
|
+
case "system-notice": return /* @__PURE__ */ jsx(Row, {
|
|
4247
|
+
barColor: null,
|
|
4248
|
+
children: /* @__PURE__ */ jsx(SystemNoticeItem, { item })
|
|
4249
|
+
});
|
|
4219
4250
|
case "card": return /* @__PURE__ */ jsx(Row, {
|
|
4220
4251
|
barColor: null,
|
|
4221
4252
|
children: /* @__PURE__ */ jsx(CardItem, { item })
|
|
@@ -4855,6 +4886,15 @@ function uiMessagesToItems(messages) {
|
|
|
4855
4886
|
const out = [];
|
|
4856
4887
|
for (const m of messages) {
|
|
4857
4888
|
if (m.role === "user") {
|
|
4889
|
+
const billingNotice = billingBlockedNoticeText(m.parts);
|
|
4890
|
+
if (billingNotice) {
|
|
4891
|
+
out.push({
|
|
4892
|
+
kind: "system-notice",
|
|
4893
|
+
id: m.id,
|
|
4894
|
+
text: billingNotice
|
|
4895
|
+
});
|
|
4896
|
+
continue;
|
|
4897
|
+
}
|
|
4858
4898
|
const text = m.parts.map((p) => p.type === "text" ? p.text : "").join("").trim();
|
|
4859
4899
|
const attachments = m.parts.filter((p) => p.type === "data-anyone-attachment").map((p) => {
|
|
4860
4900
|
const data = isRecord(p) && "data" in p && isRecord(p.data) ? p.data : null;
|
|
@@ -4949,6 +4989,14 @@ function uiMessagesToItems(messages) {
|
|
|
4949
4989
|
}
|
|
4950
4990
|
return out.map(clampItem);
|
|
4951
4991
|
}
|
|
4992
|
+
function billingBlockedNoticeText(parts) {
|
|
4993
|
+
for (const part of parts) {
|
|
4994
|
+
if (part.type !== "data-anyone-system-notification") continue;
|
|
4995
|
+
const data = isRecord(part) && isRecord(part.data) ? part.data : null;
|
|
4996
|
+
if (data && data.kind === "billing-blocked" && typeof data.text === "string" && data.text.trim()) return data.text;
|
|
4997
|
+
}
|
|
4998
|
+
return null;
|
|
4999
|
+
}
|
|
4952
5000
|
function mapToolState(raw) {
|
|
4953
5001
|
switch (raw) {
|
|
4954
5002
|
case "output-error": return "error";
|
|
@@ -9702,8 +9750,14 @@ function ChatScreen({ agent, conversation }) {
|
|
|
9702
9750
|
setItems((prev) => applyChunk(prev, event.chunk, streamAgentName));
|
|
9703
9751
|
return;
|
|
9704
9752
|
}
|
|
9753
|
+
const billingOutcome = event.outcome;
|
|
9705
9754
|
const errorText = event.error;
|
|
9706
|
-
if (
|
|
9755
|
+
if (billingOutcome) setItems((prev) => [...prev, {
|
|
9756
|
+
kind: "system-notice",
|
|
9757
|
+
id: crypto.randomUUID(),
|
|
9758
|
+
text: billingOutcome.message
|
|
9759
|
+
}]);
|
|
9760
|
+
else if (event.status !== "ok" && errorText) setItems((prev) => [...prev, {
|
|
9707
9761
|
kind: "error",
|
|
9708
9762
|
id: crypto.randomUUID(),
|
|
9709
9763
|
text: errorText
|
|
@@ -9838,7 +9892,15 @@ function ChatScreen({ agent, conversation }) {
|
|
|
9838
9892
|
}
|
|
9839
9893
|
attachToRun(result.runId, result.agentName ?? null);
|
|
9840
9894
|
} catch (err) {
|
|
9841
|
-
|
|
9895
|
+
const billing = err instanceof HttpError ? billingBlockedOutcomeFromSendResponse({
|
|
9896
|
+
status: err.status,
|
|
9897
|
+
body: err.body
|
|
9898
|
+
}) : null;
|
|
9899
|
+
setItems((prev) => [...prev.filter((m) => m.id !== optimisticId), billing ? {
|
|
9900
|
+
kind: "system-notice",
|
|
9901
|
+
id: crypto.randomUUID(),
|
|
9902
|
+
text: billing.message
|
|
9903
|
+
} : {
|
|
9842
9904
|
kind: "error",
|
|
9843
9905
|
id: crypto.randomUUID(),
|
|
9844
9906
|
text: sendErrorMessage(err)
|