zcode-app-cli 3.10.2-18 → 3.11.2-19

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/README.md CHANGED
@@ -207,7 +207,8 @@ boundary, the steer stays in a waiting row next to the editor instead of being
207
207
  shown as committed conversation history. Once the runtime confirms injection,
208
208
  the message moves into the transcript at its actual position and uses the normal
209
209
  user-message `›` prefix. The `↪` marker is reserved for the temporary waiting
210
- row.
210
+ row. `Ctrl+C` clears a non-empty editor draft first, including during an active
211
+ turn. With an empty editor it cancels the active turn, or exits when idle.
211
212
 
212
213
  To keep a follow-up editable instead, press `Tab` while the editor contains
213
214
  text and completion is closed. The input remains in the local next-turn queue.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcode-app-cli",
3
- "version": "3.10.2-18",
3
+ "version": "3.11.2-19",
4
4
  "description": "Unofficial terminal client for the ZCode agent runtime",
5
5
  "keywords": [
6
6
  "agent",
@@ -43,6 +43,7 @@
43
43
  "build:tui": "tsdown --filter tui",
44
44
  "bench:tui-memory": "bun --expose-gc scripts/bench-tui-memory.ts",
45
45
  "bench:tui-stream": "bun scripts/bench-tui-stream.ts",
46
+ "bench:tui-thinking": "bun scripts/bench-tui-thinking.ts",
46
47
  "dev": "bun run sync:local && ZCODE_NODE=node bun bin/zcode.ts",
47
48
  "sync": "bun run build && bun scripts/sync-runtime.ts",
48
49
  "sync:locked": "bun run build && bun scripts/sync-runtime.ts --lock zcode-runtime.lock.json",
@@ -1,9 +1,9 @@
1
1
  {
2
- "appVersion": "3.10.2",
2
+ "appVersion": "3.11.2",
3
3
  "cliVersion": "0.16.5",
4
- "extractedAt": "2026-08-31T16:40:24.812Z",
5
- "sha512": "bb9VQ+/T8Lu4YIgiTOHVIlVRzY8XnRvDzXvOrcYFIWCl8FVgb8bRhfA5/5oewXgLGY2rTSGYQZlnHbeZ2jVl3Q==",
6
- "source": "https://cdn-zcode.z.ai/zcode/electron/releases/3.10.2/linux-x64/ZCode-3.10.2-linux-x64.deb",
4
+ "extractedAt": "2026-09-05T07:02:23.320Z",
5
+ "sha512": "4UAMZSP9ZWBrnb8wGaP39rb5dB5ikPx4aYPXKXGea1Vmd6L6vGma3rXwRxKbhBxgsCIE9jv6tmrdSL60RrzGcA==",
6
+ "source": "https://cdn-zcode.z.ai/zcode/electron/releases/3.11.2/linux-x64/ZCode-3.11.2-linux-x64.deb",
7
7
  "runtimeCapabilities": {
8
8
  "schemaVersion": 1,
9
9
  "cli": {
@@ -114,6 +114,11 @@
114
114
  "requirement": "required",
115
115
  "status": "applied"
116
116
  },
117
+ {
118
+ "id": "stream-eof-finish-guard",
119
+ "requirement": "required",
120
+ "status": "applied"
121
+ },
117
122
  {
118
123
  "id": "oauth-http-errors",
119
124
  "requirement": "optional",
@@ -159907,6 +159907,7 @@ const palettes = {
159907
159907
  quote: "38;5;109",
159908
159908
  toolPendingSurface: "38;5;252;48;5;236",
159909
159909
  toolErrorSurface: "38;5;252;48;5;52",
159910
+ scrollbarThumb: "48;5;238",
159910
159911
  diffAddedLine: "38;5;120;48;5;22",
159911
159912
  diffRemovedLine: "38;5;210;48;5;52",
159912
159913
  diffHunkLine: "38;5;159;48;5;24",
@@ -159924,6 +159925,7 @@ const palettes = {
159924
159925
  quote: "38;5;24",
159925
159926
  toolPendingSurface: "38;5;58;48;5;230",
159926
159927
  toolErrorSurface: "38;5;236;48;5;224",
159928
+ scrollbarThumb: "48;5;252",
159927
159929
  diffAddedLine: "38;5;22;48;5;194",
159928
159930
  diffRemovedLine: "38;5;88;48;5;224",
159929
159931
  diffHunkLine: "38;5;24;48;5;189",
@@ -159950,6 +159952,7 @@ function createTheme(enabled, initialColorScheme = "dark") {
159950
159952
  const quote = paletteStyle(state, "quote", enabled);
159951
159953
  const toolPendingBackground = paletteStyle(state, "toolPendingSurface", enabled);
159952
159954
  const toolErrorBackground = paletteStyle(state, "toolErrorSurface", enabled);
159955
+ const scrollbarThumb = paletteStyle(state, "scrollbarThumb", enabled);
159953
159956
  const diffAddedLine = paletteStyle(state, "diffAddedLine", enabled);
159954
159957
  const diffRemovedLine = paletteStyle(state, "diffRemovedLine", enabled);
159955
159958
  const diffHunkLine = paletteStyle(state, "diffHunkLine", enabled);
@@ -159978,6 +159981,7 @@ function createTheme(enabled, initialColorScheme = "dark") {
159978
159981
  bold,
159979
159982
  toolPendingBackground,
159980
159983
  toolErrorBackground,
159984
+ scrollbarThumb,
159981
159985
  diffAddedLine,
159982
159986
  diffRemovedLine,
159983
159987
  diffHunkLine,
@@ -162159,6 +162163,7 @@ var TurnNotifier = class {
162159
162163
  active = false;
162160
162164
  focusReporting = false;
162161
162165
  terminalFocus = "unknown";
162166
+ terminalUnavailable = false;
162162
162167
  constructor(options) {
162163
162168
  this.options = options;
162164
162169
  this.env = options.env ?? process.env;
@@ -162222,11 +162227,24 @@ var TurnNotifier = class {
162222
162227
  return false;
162223
162228
  }
162224
162229
  }
162230
+ /**
162231
+ * Marks the terminal as unusable after an async stream failure (EIO/EPIPE).
162232
+ * writeTerminal's synchronous try/catch cannot observe those; the stream
162233
+ * error handler calls this so later writes are dropped instead of racing
162234
+ * another doomed write against the dying stream.
162235
+ */
162236
+ markTerminalUnavailable() {
162237
+ this.terminalUnavailable = true;
162238
+ this.focusReporting = false;
162239
+ this.terminalFocus = "unknown";
162240
+ }
162225
162241
  writeTerminal(data) {
162242
+ if (this.terminalUnavailable) return false;
162226
162243
  try {
162227
162244
  this.options.writeTerminal(data);
162228
162245
  return true;
162229
162246
  } catch {
162247
+ this.terminalUnavailable = true;
162230
162248
  return false;
162231
162249
  }
162232
162250
  }
@@ -162245,6 +162263,18 @@ var TurnNotifier = class {
162245
162263
  }
162246
162264
  };
162247
162265
  //#endregion
162266
+ //#region packages/zcode-tui/src/stream-error-guard.ts
162267
+ function watchStreamErrors(sources, onError) {
162268
+ const uniqueSources = [...new Set(sources)];
162269
+ for (const source of uniqueSources) source.on("error", onError);
162270
+ let active = true;
162271
+ return () => {
162272
+ if (!active) return;
162273
+ active = false;
162274
+ for (const source of uniqueSources) source.off("error", onError);
162275
+ };
162276
+ }
162277
+ //#endregion
162248
162278
  //#region packages/zcode-tui/src/tui-mode.ts
162249
162279
  function record$1(value) {
162250
162280
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
@@ -163598,12 +163628,86 @@ var SystemEventView = class {
163598
163628
  };
163599
163629
  //#endregion
163600
163630
  //#region packages/zcode-tui/src/thinking-view.ts
163631
+ const maxLiveThinkingLines = 24;
163632
+ const maxLiveThinkingCharacters = 4096;
163633
+ function safeCutStart(value, requested) {
163634
+ let start = Math.max(0, Math.min(value.length, requested));
163635
+ if (start > 0 && start < value.length) {
163636
+ const before = value.charCodeAt(start - 1);
163637
+ const current = value.charCodeAt(start);
163638
+ if (before >= 55296 && before <= 56319 && current >= 56320 && current <= 57343) start += 1;
163639
+ }
163640
+ return start;
163641
+ }
163642
+ function safeSuffixStart(value, maximumCharacters) {
163643
+ return safeCutStart(value, value.length - maximumCharacters);
163644
+ }
163645
+ /** Keeps the visible streaming window bounded without copying the full trace. */
163646
+ var ThinkingTailBuffer = class {
163647
+ lines = [""];
163648
+ length = 0;
163649
+ cachedValue;
163650
+ replace(text) {
163651
+ const start = safeSuffixStart(text, maxLiveThinkingCharacters);
163652
+ const lines = text.slice(start).split("\n");
163653
+ if (lines.length > maxLiveThinkingLines) lines.splice(0, lines.length - maxLiveThinkingLines);
163654
+ this.lines = lines;
163655
+ this.length = this.lines.join("\n").length;
163656
+ this.cachedValue = void 0;
163657
+ }
163658
+ append(delta) {
163659
+ if (!delta) return;
163660
+ if (delta.indexOf("\n") < 0) {
163661
+ const last = this.lines.length - 1;
163662
+ this.lines[last] = `${this.lines[last] ?? ""}${delta}`;
163663
+ this.length += delta.length;
163664
+ if (this.length > maxLiveThinkingCharacters) this.trim();
163665
+ this.cachedValue = void 0;
163666
+ return;
163667
+ }
163668
+ const parts = delta.split("\n");
163669
+ const last = this.lines.length - 1;
163670
+ this.lines[last] = `${this.lines[last] ?? ""}${parts[0] ?? ""}`;
163671
+ for (let index = 1; index < parts.length; index += 1) this.lines.push(parts[index]);
163672
+ this.length += delta.length;
163673
+ if (this.lines.length > maxLiveThinkingLines || this.length > maxLiveThinkingCharacters) this.trim();
163674
+ this.cachedValue = void 0;
163675
+ }
163676
+ value() {
163677
+ if (this.cachedValue === void 0) this.cachedValue = this.lines.join("\n");
163678
+ return this.cachedValue;
163679
+ }
163680
+ trim() {
163681
+ if (this.lines.length > maxLiveThinkingLines) {
163682
+ const removed = this.lines.splice(0, this.lines.length - maxLiveThinkingLines);
163683
+ this.length -= removed.reduce((total, line) => total + line.length + 1, 0);
163684
+ }
163685
+ while (this.length > maxLiveThinkingCharacters && this.lines.length > 0) {
163686
+ const first = this.lines[0];
163687
+ const separatorLength = this.lines.length > 1 ? 1 : 0;
163688
+ const removable = first.length + separatorLength;
163689
+ const excess = this.length - maxLiveThinkingCharacters;
163690
+ if (removable <= excess) {
163691
+ this.lines.shift();
163692
+ this.length -= removable;
163693
+ if (this.lines.length === 0) this.lines.push("");
163694
+ continue;
163695
+ }
163696
+ const start = safeCutStart(first, excess);
163697
+ this.lines[0] = first.slice(start);
163698
+ this.length -= start;
163699
+ break;
163700
+ }
163701
+ }
163702
+ };
163601
163703
  var ThinkingView = class extends Box {
163602
163704
  theme;
163603
163705
  text = "";
163706
+ hasVisibleText = false;
163604
163707
  completed = false;
163605
163708
  expanded = false;
163606
163709
  dirty = false;
163710
+ liveTail = new ThinkingTailBuffer();
163607
163711
  constructor(theme) {
163608
163712
  super(1, 0);
163609
163713
  this.theme = theme;
@@ -163613,12 +163717,22 @@ var ThinkingView = class extends Box {
163613
163717
  const sanitized = sanitizeTerminalText(delta, { preserveSgr: false });
163614
163718
  if (!sanitized) return;
163615
163719
  this.completed = false;
163720
+ this.hasVisibleText ||= sanitized.trim().length > 0;
163616
163721
  this.text += sanitized;
163722
+ this.liveTail.append(sanitized);
163617
163723
  this.dirty = true;
163618
163724
  }
163619
163725
  setText(text) {
163620
163726
  const sanitized = sanitizeTerminalText(text, { preserveSgr: false });
163621
163727
  if (this.text === sanitized) return;
163728
+ if (sanitized.startsWith(this.text)) {
163729
+ const delta = sanitized.slice(this.text.length);
163730
+ this.liveTail.append(delta);
163731
+ this.hasVisibleText ||= delta.trim().length > 0;
163732
+ } else {
163733
+ this.liveTail.replace(sanitized);
163734
+ this.hasVisibleText = sanitized.trim().length > 0;
163735
+ }
163622
163736
  this.text = sanitized;
163623
163737
  this.dirty = true;
163624
163738
  }
@@ -163636,7 +163750,7 @@ var ThinkingView = class extends Box {
163636
163750
  return this.expanded;
163637
163751
  }
163638
163752
  hasHiddenContent() {
163639
- return this.completed && Boolean(this.text.trim()) && !this.expanded;
163753
+ return this.completed && this.hasVisibleText && !this.expanded;
163640
163754
  }
163641
163755
  getSearchText() {
163642
163756
  return this.text;
@@ -163650,12 +163764,15 @@ var ThinkingView = class extends Box {
163650
163764
  }
163651
163765
  rebuild() {
163652
163766
  this.clear();
163653
- const title = this.completed ? `${this.theme.muted("◇")} ${this.theme.bold("Thought")}${this.text.trim() && !this.expanded ? this.theme.muted(" · Ctrl+O to expand") : ""}` : `${this.theme.accent("◇")} ${this.theme.bold("Thinking")} ${this.theme.muted("· active")}`;
163767
+ const title = this.completed ? `${this.theme.muted("◇")} ${this.theme.bold("Thought")}${this.hasVisibleText && !this.expanded ? this.theme.muted(" · Ctrl+O to expand") : ""}` : `${this.theme.accent("◇")} ${this.theme.bold("Thinking")} ${this.theme.muted("· active")}`;
163654
163768
  this.addChild(new Text(title, 0, 0));
163655
- if (this.text.trim() && (!this.completed || this.expanded)) this.addChild(new Markdown(this.text, 1, 0, this.theme.markdown, {
163656
- color: this.theme.muted,
163657
- italic: true
163658
- }));
163769
+ if (this.hasVisibleText && (!this.completed || this.expanded)) {
163770
+ const body = this.completed || this.expanded ? this.text : this.liveTail.value();
163771
+ this.addChild(new Markdown(body, 1, 0, this.theme.markdown, {
163772
+ color: this.theme.muted,
163773
+ italic: true
163774
+ }));
163775
+ }
163659
163776
  }
163660
163777
  };
163661
163778
  //#endregion
@@ -165972,6 +166089,7 @@ var ZCodeTui = class {
165972
166089
  backgroundHandoffInterruptInFlight = false;
165973
166090
  updateCheckAbortController;
165974
166091
  loginRequired;
166092
+ removeStreamErrorGuards;
165975
166093
  constructor(options) {
165976
166094
  this.options = options;
165977
166095
  this.animateTurnTimer = turnTimerAnimationEnabled();
@@ -166062,6 +166180,7 @@ var ZCodeTui = class {
166062
166180
  const onSigint = () => this.handleSignal("SIGINT");
166063
166181
  const onSigterm = () => this.handleSignal("SIGTERM");
166064
166182
  const onSighup = () => this.handleSignal("SIGHUP");
166183
+ this.installStreamErrorGuards();
166065
166184
  process.once("SIGINT", onSigint);
166066
166185
  process.once("SIGTERM", onSigterm);
166067
166186
  if (process.platform !== "win32") process.once("SIGHUP", onSighup);
@@ -166108,9 +166227,15 @@ var ZCodeTui = class {
166108
166227
  process.off("SIGINT", onSigint);
166109
166228
  process.off("SIGTERM", onSigterm);
166110
166229
  if (process.platform !== "win32") process.off("SIGHUP", onSighup);
166111
- if (startAttempted && !this.stopped) {
166112
- this.stop();
166113
- await this.done;
166230
+ try {
166231
+ if (startAttempted && !this.stopped) {
166232
+ this.stop();
166233
+ await this.done;
166234
+ }
166235
+ } finally {
166236
+ await new Promise((resolve) => setImmediate(resolve));
166237
+ this.removeStreamErrorGuards?.();
166238
+ this.removeStreamErrorGuards = void 0;
166114
166239
  }
166115
166240
  }
166116
166241
  }
@@ -166118,6 +166243,25 @@ var ZCodeTui = class {
166118
166243
  process.exitCode = signalExitCode(signal);
166119
166244
  if (!this.stopped) this.stop();
166120
166245
  }
166246
+ /**
166247
+ * process.stdout/stderr stream errors (EIO when the pty is gone, EPIPE when
166248
+ * the reader disconnected) are emitted asynchronously, so the synchronous
166249
+ * try/catch around every terminal write cannot observe them. Without a
166250
+ * listener Node rethrows them and kills the process — a doomed notification
166251
+ * write after the pane closes would crash the whole TUI. Absorb stream
166252
+ * death here, stop notification writes, and let the run loop unwind through
166253
+ * the normal stop path.
166254
+ */
166255
+ installStreamErrorGuards() {
166256
+ if (this.removeStreamErrorGuards) return;
166257
+ this.removeStreamErrorGuards = watchStreamErrors([process.stdout, process.stderr], () => {
166258
+ this.notifications.markTerminalUnavailable();
166259
+ if (!this.stopped) {
166260
+ process.exitCode = 1;
166261
+ this.stop();
166262
+ }
166263
+ });
166264
+ }
166121
166265
  async resolveTerminalColorScheme() {
166122
166266
  if (!this.colorsEnabled || this.themePreference !== "auto") return;
166123
166267
  try {
@@ -166256,7 +166400,8 @@ var ZCodeTui = class {
166256
166400
  follow: "end",
166257
166401
  primary: true,
166258
166402
  overscroll: "chain",
166259
- scrollbar: "always"
166403
+ scrollbar: "auto",
166404
+ scrollbarStyle: this.theme.scrollbarThumb
166260
166405
  });
166261
166406
  this.fullscreenLayout ??= new VStack([
166262
166407
  {
@@ -166632,12 +166777,12 @@ var ZCodeTui = class {
166632
166777
  return { consume: true };
166633
166778
  }
166634
166779
  if (matchesKey(data, "ctrl+c")) {
166635
- if (this.turnAbortController) {
166780
+ if (this.editor.getText()) this.editor.setText("");
166781
+ else if (this.turnAbortController) {
166636
166782
  this.pendingSteerInterrupt = void 0;
166637
166783
  this.turnAbortController.abort();
166638
166784
  this.updateActivity("cancelling…");
166639
- } else if (this.editor.getText()) this.editor.setText("");
166640
- else this.stop();
166785
+ } else this.stop();
166641
166786
  return { consume: true };
166642
166787
  }
166643
166788
  if (matchesKey(data, "ctrl+d") && !this.editor.getText() && !this.turnAbortController) {
@@ -168716,7 +168861,7 @@ var ZCodeTui = class {
168716
168861
  }, {
168717
168862
  value: "fullscreen",
168718
168863
  label: "Fullscreen",
168719
- description: "Alternate screen with scrollable transcript and scrollbars"
168864
+ description: "Alternate screen with a fixed composer and transient themed scrollbar"
168720
168865
  }],
168721
168866
  selectedIndex: this.tuiMode === "fullscreen" ? 1 : 0
168722
168867
  });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "browser-use",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Built-in browser automation runtime and guidance for Desktop IAB and explicitly enabled CLI-managed headless CDP: open, navigate, inspect, click, type, screenshot, record workspace WebM videos, and verify web pages and local dev targets.",
5
5
  "author": { "name": "Z.ai" },
6
6
  "license": "MIT",