zcode-app-cli 3.11.2-22 → 3.11.2-23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcode-app-cli",
3
- "version": "3.11.2-22",
3
+ "version": "3.11.2-23",
4
4
  "description": "Unofficial terminal client for the ZCode agent runtime",
5
5
  "keywords": [
6
6
  "agent",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "appVersion": "3.11.2",
3
3
  "cliVersion": "0.16.5",
4
- "extractedAt": "2026-09-07T15:55:02.609Z",
4
+ "extractedAt": "2026-09-11T10:26:25.347Z",
5
5
  "sha512": "4UAMZSP9ZWBrnb8wGaP39rb5dB5ikPx4aYPXKXGea1Vmd6L6vGma3rXwRxKbhBxgsCIE9jv6tmrdSL60RrzGcA==",
6
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": {
@@ -158169,6 +158169,8 @@ var ChoiceDialog = class {
158169
158169
  contentOffset = 0;
158170
158170
  contentLineCount = 0;
158171
158171
  contentPageSize = 1;
158172
+ /** Number of quick-selectable items; digits beyond this are ignored. */
158173
+ numberShortcutCount = 0;
158172
158174
  constructor(title, prompt, help, list, theme, content, contentLabel = "Details", maxContentLines = 0, maxExpandedContentLines = 0) {
158173
158175
  this.title = title;
158174
158176
  this.prompt = prompt;
@@ -158219,6 +158221,14 @@ var ChoiceDialog = class {
158219
158221
  this.contentExpanded = !this.contentExpanded;
158220
158222
  return;
158221
158223
  }
158224
+ if (this.numberShortcutCount > 0 && this.filter === "" && !this.contentExpanded && data.length === 1 && data >= "1" && data <= "9") {
158225
+ const index = data.charCodeAt(0) - "1".charCodeAt(0);
158226
+ if (index >= this.numberShortcutCount) return;
158227
+ this.list.setSelectedIndex(index);
158228
+ const item = this.list.getSelectedItem();
158229
+ if (item) this.list.onSelect?.(item);
158230
+ return;
158231
+ }
158222
158232
  if ((this.content?.handleInput)?.call(this.content, data) === true) return;
158223
158233
  if (this.contentExpanded) {
158224
158234
  if (matchesKey(data, "escape")) {
@@ -158323,18 +158333,20 @@ function choose(ui, host, theme, options) {
158323
158333
  return new Promise((resolve) => {
158324
158334
  const choicesByValue = /* @__PURE__ */ new Map();
158325
158335
  const detailsByValue = /* @__PURE__ */ new Map();
158336
+ const numberShortcutsEnabled = options.numberShortcuts === true && options.items.length <= 9;
158326
158337
  const searchableItems = options.items.map((item, index) => {
158327
158338
  const safeItem = {
158328
158339
  ...item,
158329
158340
  label: sanitizeTerminalText(item.label, { preserveSgr: false }),
158330
158341
  description: item.description ? sanitizeTerminalText(item.description, { preserveSgr: false }) : void 0
158331
158342
  };
158343
+ const displayLabel = numberShortcutsEnabled ? `${index + 1}. ${safeItem.label}` : safeItem.label;
158332
158344
  const value = `${safeItem.label}\u0000${index}`;
158333
158345
  choicesByValue.set(value, safeItem);
158334
158346
  if (options.showSelectedItemDetails) detailsByValue.set(value, new ChoiceItemDetails(safeItem, theme));
158335
158347
  return {
158336
158348
  value,
158337
- label: safeItem.label,
158349
+ label: displayLabel,
158338
158350
  description: safeItem.description
158339
158351
  };
158340
158352
  });
@@ -158344,7 +158356,8 @@ function choose(ui, host, theme, options) {
158344
158356
  list.setSelectedIndex(options.selectedIndex ?? 0);
158345
158357
  const maxContentLines = Math.max(0, ui.terminal.rows - maxVisible - 9);
158346
158358
  const maxExpandedContentLines = Math.max(2, maxContentLines, ui.terminal.rows - 8);
158347
- const dialog = new ChoiceDialog(sanitizeTerminalText(options.title, { preserveSgr: false }), sanitizeTerminalText(options.prompt, { preserveSgr: false }), sanitizeTerminalText(options.help ?? (hasDetails ? "Type to filter · Up/Down choose · Ctrl+O details · ←/→ or PgUp/PgDn scroll · Enter confirm · Esc cancel" : "Type to filter · Up/Down choose · Enter confirm · Esc cancel · Ctrl+U clear"), { preserveSgr: false }), list, theme, options.content, sanitizeTerminalText(options.contentLabel ?? "Details", { preserveSgr: false }), maxContentLines, maxExpandedContentLines);
158359
+ const dialog = new ChoiceDialog(sanitizeTerminalText(options.title, { preserveSgr: false }), sanitizeTerminalText(options.prompt, { preserveSgr: false }), sanitizeTerminalText(options.help ?? (hasDetails ? numberShortcutsEnabled ? "Type to filter · number selects · Up/Down choose · Ctrl+O details · ←/→ or PgUp/PgDn scroll · Enter confirm · Esc cancel" : "Type to filter · Up/Down choose · Ctrl+O details · ←/→ or PgUp/PgDn scroll · Enter confirm · Esc cancel" : numberShortcutsEnabled ? "Type to filter · number selects · Up/Down choose · Enter confirm · Esc cancel · Ctrl+U clear" : "Type to filter · Up/Down choose · Enter confirm · Esc cancel · Ctrl+U clear"), { preserveSgr: false }), list, theme, options.content, sanitizeTerminalText(options.contentLabel ?? "Details", { preserveSgr: false }), maxContentLines, maxExpandedContentLines);
158360
+ dialog.numberShortcutCount = numberShortcutsEnabled ? options.items.length : 0;
158348
158361
  const previewFor = (item) => {
158349
158362
  if (!item) return void 0;
158350
158363
  return options.showSelectedItemDetails ? detailsByValue.get(item.value) : choicesByValue.get(item.value)?.preview;
@@ -163901,6 +163914,23 @@ function redactSecrets(message, secrets) {
163901
163914
  //#endregion
163902
163915
  //#region packages/zcode-tui/src/session-title.ts
163903
163916
  const SESSION_TITLE_PREFIX = "ZC | ";
163917
+ const sessionTitleSpinnerFrames = [
163918
+ "⠋",
163919
+ "⠙",
163920
+ "⠹",
163921
+ "⠸",
163922
+ "⠼",
163923
+ "⠴",
163924
+ "⠦",
163925
+ "⠧",
163926
+ "⠇",
163927
+ "⠏"
163928
+ ];
163929
+ function sessionTitleSpinnerFrame(elapsedMilliseconds, animated = true) {
163930
+ if (!animated) return sessionTitleSpinnerFrames[0];
163931
+ const frame = Math.floor(Math.max(0, elapsedMilliseconds) / 120);
163932
+ return sessionTitleSpinnerFrames[frame % sessionTitleSpinnerFrames.length] ?? sessionTitleSpinnerFrames[0];
163933
+ }
163904
163934
  function sessionTitleFromFirstMessage(message) {
163905
163935
  const normalized = sanitizeTerminalText(message).replace(/\s+/gu, " ").trim();
163906
163936
  if (!normalized) return null;
@@ -166611,6 +166641,8 @@ var ZCodeTui = class {
166611
166641
  turnTimingVisible = false;
166612
166642
  turnHadWorkActivity = false;
166613
166643
  turnTimer;
166644
+ sessionTitleSpinnerTimer;
166645
+ sessionTitleSpinnerStartedAt;
166614
166646
  pendingTurnNotification;
166615
166647
  pendingTurnNotificationDetail = "";
166616
166648
  goal;
@@ -166619,6 +166651,7 @@ var ZCodeTui = class {
166619
166651
  sessionId;
166620
166652
  sessionTitleEmitted = false;
166621
166653
  sessionTerminalTitle;
166654
+ emittedSessionTerminalTitle;
166622
166655
  sessionMetrics = {};
166623
166656
  usageRefreshInFlight = false;
166624
166657
  usageRefreshPending = false;
@@ -167826,6 +167859,8 @@ var ZCodeTui = class {
167826
167859
  this.sessionId = void 0;
167827
167860
  this.sessionTitleEmitted = false;
167828
167861
  this.sessionTerminalTitle = void 0;
167862
+ this.stopSessionTitleSpinner();
167863
+ this.emittedSessionTerminalTitle = "";
167829
167864
  emitSessionTerminalTitle(this.options.stdout ?? process.stdout, "");
167830
167865
  this.sessionMetrics = {};
167831
167866
  this.restoreTranscript(restoredMessages(result.restoredMessages));
@@ -168871,6 +168906,7 @@ var ZCodeTui = class {
168871
168906
  prompt: asString(request.reason) ?? `${toolName} requests permission to continue.`,
168872
168907
  items,
168873
168908
  signal,
168909
+ numberShortcuts: true,
168874
168910
  content: this.permissionPreview(toolName, request.input, asString(request.riskLevel))
168875
168911
  });
168876
168912
  if (!selected) return {
@@ -170630,9 +170666,30 @@ var ZCodeTui = class {
170630
170666
  this.updateTurnStatus(requestRender);
170631
170667
  }
170632
170668
  refreshSessionTerminalTitle() {
170633
- if (!this.sessionTerminalTitle) return;
170634
- const working = this.activeSubmissions > 0 && this.activity ? `⠋ ${this.activity}` : void 0;
170635
- emitSessionTerminalTitle(this.options.stdout ?? process.stdout, working ?? this.sessionTerminalTitle);
170669
+ if (!this.sessionTerminalTitle) {
170670
+ this.stopSessionTitleSpinner();
170671
+ return;
170672
+ }
170673
+ const now = performance.now();
170674
+ const working = this.activeSubmissions > 0 && this.activity ? `${sessionTitleSpinnerFrame(this.sessionTitleSpinnerStartedAt === void 0 ? 0 : Math.max(0, now - this.sessionTitleSpinnerStartedAt), this.animateTurnTimer)} ${this.activity}` : void 0;
170675
+ if (working && this.animateTurnTimer) {
170676
+ if (this.sessionTitleSpinnerStartedAt === void 0) this.sessionTitleSpinnerStartedAt = now;
170677
+ if (!this.sessionTitleSpinnerTimer) {
170678
+ this.sessionTitleSpinnerTimer = setInterval(() => this.refreshSessionTerminalTitle(), 120);
170679
+ this.sessionTitleSpinnerTimer.unref?.();
170680
+ }
170681
+ } else this.stopSessionTitleSpinner();
170682
+ const nextTitle = working ?? this.sessionTerminalTitle;
170683
+ if (nextTitle === this.emittedSessionTerminalTitle) return;
170684
+ this.emittedSessionTerminalTitle = nextTitle;
170685
+ emitSessionTerminalTitle(this.options.stdout ?? process.stdout, nextTitle);
170686
+ }
170687
+ stopSessionTitleSpinner() {
170688
+ if (this.sessionTitleSpinnerTimer) {
170689
+ clearInterval(this.sessionTitleSpinnerTimer);
170690
+ this.sessionTitleSpinnerTimer = void 0;
170691
+ }
170692
+ this.sessionTitleSpinnerStartedAt = void 0;
170636
170693
  }
170637
170694
  updateTurnStatus(requestRender = true) {
170638
170695
  if (this.turnStartedAt !== void 0) this.turnElapsedMilliseconds = Math.max(0, performance.now() - this.turnStartedAt);
@@ -170645,6 +170702,7 @@ var ZCodeTui = class {
170645
170702
  const right = goalText ? goalStyle(`[ Goal: ${goalText} ]`) : void 0;
170646
170703
  const compactRight = goalLabel ? goalStyle(`[ Goal: ${goalLabel} ]`) : void 0;
170647
170704
  this.turnStatus.setContent(left, right, compactRight);
170705
+ this.refreshSessionTerminalTitle();
170648
170706
  this.updateRuntimeActivity(false);
170649
170707
  if (requestRender) this.ui.requestRender();
170650
170708
  }
@@ -170883,6 +170941,7 @@ var ZCodeTui = class {
170883
170941
  this.updateCheckAbortController?.abort();
170884
170942
  this.modelCatalogRefresh?.stop();
170885
170943
  if (this.turnTimer) clearInterval(this.turnTimer);
170944
+ this.stopSessionTitleSpinner();
170886
170945
  if (this.rewindEscapeTimer) clearTimeout(this.rewindEscapeTimer);
170887
170946
  if (this.fullscreenWelcomeTransitionTimer) clearTimeout(this.fullscreenWelcomeTransitionTimer);
170888
170947
  if (this.runtimeRefreshTimer) clearTimeout(this.runtimeRefreshTimer);