zidane-gui 7.0.31 → 7.0.32

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.
@@ -14605,13 +14605,6 @@ function retryLabel(info) {
14605
14605
  const suffix = info.source === "parent" ? "" : ` · ${info.source}`;
14606
14606
  return `retrying ${info.attempt}/${info.max}${suffix}`;
14607
14607
  }
14608
- function streamingLabel(progress, opts = {}) {
14609
- if (!progress || progress.outputTokens <= 0) return "";
14610
- const count2 = `↓${progress.estimated ? "~" : ""}${fmtTokens(progress.outputTokens)}`;
14611
- if (opts.rate === false || progress.elapsedMs < 2e3) return count2;
14612
- const perSecond = Math.round(progress.outputTokens / (progress.elapsedMs / 1e3));
14613
- return perSecond > 0 ? `${count2} · ${perSecond} tok/s` : count2;
14614
- }
14615
14608
  function compactingLabel(estTokens, startedAt, now = Date.now()) {
14616
14609
  const base2 = "Compacting...";
14617
14610
  const elapsedMs = typeof startedAt === "number" ? now - startedAt : 0;
@@ -14896,6 +14889,16 @@ const TOOL_DISPLAY = {
14896
14889
  return null;
14897
14890
  }
14898
14891
  },
14892
+ call_tool: {
14893
+ displayName: "Call tool",
14894
+ format: (input) => {
14895
+ const name2 = stringField(input, "name");
14896
+ return name2 ? {
14897
+ target: name2,
14898
+ meta: ["malformed call"]
14899
+ } : null;
14900
+ }
14901
+ },
14899
14902
  skills_use: {
14900
14903
  displayName: (input) => {
14901
14904
  return (input ? stringField(input, "mode") : void 0) === "deactivate" ? "Disable skill" : "Enable skill";
@@ -15390,6 +15393,7 @@ const DEFAULT_SETTINGS = {
15390
15393
  showAllProjects: false,
15391
15394
  resumeLastSession: true,
15392
15395
  persistToolResults: true,
15396
+ stableToolList: false,
15393
15397
  autoCompact: true,
15394
15398
  autoCompactThreshold: 0.8,
15395
15399
  showEditDiffs: true,
@@ -15475,18 +15479,18 @@ const SETTINGS_TOGGLES = [
15475
15479
  {
15476
15480
  key: "checkForUpdates",
15477
15481
  label: "Check for updates",
15478
- description: "check npm for new releases and show ↑ vX.Y.Z in the footer (click installs the GUI and TUI through their package managers; a pending restart is shown regardless)"
15482
+ description: "check npm for new releases and show ↑ vX.Y.Z in the footer (click installs the GUI and TUI through their package managers, a pending restart is shown regardless)"
15479
15483
  },
15480
15484
  {
15481
15485
  key: "useDaemon",
15482
15486
  label: "Shared daemon runtime (experimental)",
15483
- description: "execute sessions in a shared daemon — runs survive window close, and every TUI/GUI window on the same session shares the live stream, drafts, attachments, queue, search, and settings (requires the zidane TUI/daemon installed; falls back in-process when no daemon is reachable)"
15487
+ description: "run sessions in a shared daemon: runs survive window close and every TUI/GUI window on the same session shares the live stream, drafts, attachments, queue, search and settings (requires the zidane TUI/daemon installed, falls back in-process when no daemon is reachable)"
15484
15488
  },
15485
15489
  {
15486
15490
  key: "orchestration",
15487
15491
  requires: "useDaemon",
15488
15492
  label: "Main session (orchestration)",
15489
- description: 'pin a "Main" session that can create sessions in specific directories, steer them, and read their results — it receives their outcomes as events in its own history'
15493
+ description: "pin a Main session that creates sessions in specific directories, steers them and reads their results, and receives their outcomes as events in its own history"
15490
15494
  },
15491
15495
  { key: "safeMode", label: "Safe mode", description: "prompt before each tool call (unless safelisted)" },
15492
15496
  {
@@ -15499,7 +15503,7 @@ const SETTINGS_TOGGLES = [
15499
15503
  * with canonical `settings-context.tsx`; `settings-consent-copy.test.ts`
15500
15504
  * enforces that the warning survives future rewording.
15501
15505
  */
15502
- description: "run extensions under <project>/.zidane/extensions — off by default (they execute arbitrary local code)"
15506
+ description: "run extensions from <project>/.zidane/extensions (off by default, they execute arbitrary local code)"
15503
15507
  },
15504
15508
  {
15505
15509
  key: "resumeLastSession",
@@ -15516,6 +15520,11 @@ const SETTINGS_TOGGLES = [
15516
15520
  label: "Persist large tool results",
15517
15521
  description: "write >8 KiB tool outputs to disk and inline a preview"
15518
15522
  },
15523
+ {
15524
+ key: "stableToolList",
15525
+ label: "Stable tool list (call_tool)",
15526
+ description: "invoke MCP tools surfaced by tool_search through `call_tool` instead of adding them to the model's tool list, so tool discovery never breaks the prompt cache (next session activation)"
15527
+ },
15519
15528
  {
15520
15529
  key: "autoCompact",
15521
15530
  label: "Auto-compact",
@@ -15543,7 +15552,7 @@ const SETTINGS_TOGGLES = [
15543
15552
  {
15544
15553
  key: "attachmentsEnabled",
15545
15554
  label: "Paste attachments",
15546
- description: "fold dropped images + long pastes into prompt attachments (off = everything pastes inline)"
15555
+ description: "turn dropped images and long pastes into prompt attachments (off = everything pastes inline)"
15547
15556
  },
15548
15557
  {
15549
15558
  key: "inlineAutocomplete",
@@ -15558,12 +15567,12 @@ const SETTINGS_TOGGLES = [
15558
15567
  {
15559
15568
  key: "importForeignConfigs",
15560
15569
  label: "Import configurations from other agents",
15561
- description: "discover MCP servers + skills from Claude Code, Codex, and Pi configs (project + user) — imported stdio servers execute commands from files zidane does not own"
15570
+ description: "discover MCP servers and skills from Claude Code, Codex and Pi configs, project and user (imported stdio servers run commands from files zidane does not own)"
15562
15571
  },
15563
15572
  {
15564
15573
  key: "importRulerConfigs",
15565
15574
  label: "Support Ruler configuration (.ruler)",
15566
- description: `discover MCP servers, skills + instructions from .ruler/ (project) and ~/.config/ruler (user) — read-only, zidane's own configs win collisions; stdio servers additionally need "Import configurations from other agents" (they execute local commands)`
15575
+ description: `discover MCP servers, skills and instructions from .ruler/ and ~/.config/ruler (read-only, zidane's own configs win collisions; stdio servers also need "Import configurations from other agents")`
15567
15576
  },
15568
15577
  { key: "showThrobber", label: "Throbber", description: "animated indicator while the agent is working" },
15569
15578
  { key: "artifacts", label: "Artifacts", description: "track pull requests, branches, commits and recorded files per session" },
@@ -15641,7 +15650,7 @@ const SETTINGS_CHOICES = [
15641
15650
  {
15642
15651
  key: "retryMaxAttempts",
15643
15652
  label: "Provider retry attempts",
15644
- description: "max attempts per provider call (retryable errors + silent stream stalls) — applies to the session and its subagents",
15653
+ description: "max attempts per provider call for retryable errors and silent stream stalls, applies to the session and its subagents",
15645
15654
  options: [
15646
15655
  { value: 0, label: "Default (3)" },
15647
15656
  { value: 1, label: "1 (no retry)" },
@@ -15702,7 +15711,7 @@ const SETTINGS_CHOICES = [
15702
15711
  {
15703
15712
  key: "theme",
15704
15713
  label: "Theme",
15705
- description: "colors + markdown / syntax styles",
15714
+ description: "colors and markdown / syntax styles",
15706
15715
  options: [
15707
15716
  { value: "default", label: "Default" },
15708
15717
  { value: "catppuccin-mocha", label: "Catppuccin Mocha" },
@@ -17244,11 +17253,15 @@ function SessionsProvider({ children }) {
17244
17253
  return window.api.chat.isRunning(row.id).then((running) => running === false).catch(() => false);
17245
17254
  })
17246
17255
  );
17247
- if (version !== refreshVersion.current || !unchanged()) {
17256
+ if (version !== refreshVersion.current) {
17248
17257
  return;
17249
17258
  }
17259
+ const runStateStable = unchanged();
17250
17260
  rawSessionsRef.current = next;
17251
17261
  setSessions(next);
17262
+ if (!runStateStable) {
17263
+ return;
17264
+ }
17252
17265
  for (const [index2, row] of next.entries()) {
17253
17266
  if (row.status === "running") {
17254
17267
  markRunning(row.id);
@@ -18649,12 +18662,21 @@ function DockRow({
18649
18662
  glyph,
18650
18663
  children,
18651
18664
  trailing,
18652
- className = ""
18665
+ className = "",
18666
+ align = "center"
18653
18667
  }) {
18654
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex items-center gap-2 min-h-7 text-xs ${className}`, children: [
18655
- glyph !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "w-3 shrink-0 inline-flex items-center justify-center text-[var(--zg-text-muted)]", children: glyph }),
18668
+ const side = align === "start" ? "h-7" : "";
18669
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex ${align === "start" ? "items-start" : "items-center"} gap-2 min-h-7 text-xs ${className}`, children: [
18670
+ glyph !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
18671
+ "span",
18672
+ {
18673
+ "aria-hidden": true,
18674
+ className: `w-3 shrink-0 inline-flex items-center justify-center text-[var(--zg-text-muted)] ${side}`,
18675
+ children: glyph
18676
+ }
18677
+ ),
18656
18678
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 min-w-0", children }),
18657
- trailing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "shrink-0 inline-flex items-center gap-1", children: trailing })
18679
+ trailing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `shrink-0 inline-flex items-center gap-1 ${side}`, children: trailing })
18658
18680
  ] });
18659
18681
  }
18660
18682
  function DockIconButton({
@@ -43134,6 +43156,7 @@ function AskUserModal({ request }) {
43134
43156
  useCloseWhenResolved(interactions.pending.some((p2) => p2.request.id === request.id));
43135
43157
  const payload = request.payload;
43136
43158
  const [answers, setAnswers] = reactExports.useState(() => seedDefaults(payload));
43159
+ const [instructions, setInstructions] = reactExports.useState("");
43137
43160
  const [busy, setBusy] = reactExports.useState(false);
43138
43161
  const [error, setError] = reactExports.useState(null);
43139
43162
  const canSubmit = reactExports.useMemo(() => {
@@ -43155,7 +43178,11 @@ function AskUserModal({ request }) {
43155
43178
  setBusy(true);
43156
43179
  setError(null);
43157
43180
  try {
43158
- await interactions.respond(request.id, { kind: "question", answers });
43181
+ await interactions.respond(request.id, {
43182
+ kind: "question",
43183
+ answers,
43184
+ ...instructions.trim() ? { instructions: instructions.trim() } : {}
43185
+ });
43159
43186
  modal.close();
43160
43187
  } catch (err) {
43161
43188
  setError(err.message ?? String(err));
@@ -43226,8 +43253,35 @@ function AskUserModal({ request }) {
43226
43253
  }
43227
43254
  },
43228
43255
  children: [
43229
- payload.intro && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "prose-styles text-sm text-[var(--zg-text)] zg-pretty rounded-lg border border-[var(--zg-border)] bg-[var(--zg-bg)] px-4 py-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: payload.intro }) }),
43230
- payload.questions.map((q2) => /* @__PURE__ */ jsxRuntimeExports.jsx(QuestionField, { question: q2, value: answers[q2.id], onChange: (v2) => setAnswer(q2.id, v2) }, q2.id))
43256
+ payload.intro && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "prose-styles text-sm text-[var(--zg-text)] zg-pretty rounded-lg border border-[var(--zg-border)] bg-[var(--zg-bg)] px-4 py-3.5", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: payload.intro }) }),
43257
+ payload.questions.map((q2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
43258
+ QuestionField,
43259
+ {
43260
+ index: index2,
43261
+ question: q2,
43262
+ value: answers[q2.id],
43263
+ onChange: (v2) => setAnswer(q2.id, v2)
43264
+ },
43265
+ q2.id
43266
+ )),
43267
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg bg-[var(--zg-bg-elevated)] px-4 py-3.5 flex flex-col gap-3", children: [
43268
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
43269
+ /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: `ask-${request.id}-instructions`, className: "text-sm font-medium text-[var(--zg-text)]", children: "Additional instructions" }),
43270
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-[var(--zg-text-muted)] zg-pretty", children: "Optional. Anything the agent should know or do differently. It refines or overrides the answers above." })
43271
+ ] }),
43272
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43273
+ "textarea",
43274
+ {
43275
+ id: `ask-${request.id}-instructions`,
43276
+ value: instructions,
43277
+ onChange: (e) => setInstructions(e.target.value),
43278
+ placeholder: "e.g. keep the old endpoint alive until the migration lands",
43279
+ rows: 3,
43280
+ spellCheck: false,
43281
+ className: "w-full min-h-20 text-sm bg-[var(--zg-bg)] border border-[var(--zg-border)] rounded-lg px-3 py-2.5 text-[var(--zg-text)] outline-none focus:border-[var(--zg-accent)] focus:ring-2 focus:ring-[var(--zg-accent)]/20 resize-y"
43282
+ }
43283
+ )
43284
+ ] })
43231
43285
  ]
43232
43286
  }
43233
43287
  )
@@ -43237,39 +43291,48 @@ function AskUserModal({ request }) {
43237
43291
  function isRequired(q2) {
43238
43292
  return q2.required ?? (q2.type === "select" || q2.type === "confirm");
43239
43293
  }
43240
- function QuestionField({ question, value, onChange }) {
43294
+ function QuestionField({ index: index2, question, value, onChange }) {
43241
43295
  const required = isRequired(question);
43296
+ const inputId = `ask-q-${question.id}`;
43242
43297
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg border border-[var(--zg-border)] bg-[var(--zg-bg)] px-4 py-3.5 flex flex-col gap-3", children: [
43243
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
43244
- /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "text-sm font-medium text-[var(--zg-text)] zg-balance", children: [
43245
- question.prompt,
43246
- required && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-text-muted)] ml-1", children: "*" })
43298
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-baseline gap-2.5", children: [
43299
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "w-5 shrink-0 text-right text-xs tabular-nums text-[var(--zg-text-muted)]", children: [
43300
+ index2 + 1,
43301
+ "."
43247
43302
  ] }),
43248
- question.description && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs text-[var(--zg-text-muted)] zg-pretty", children: question.description })
43303
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
43304
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { htmlFor: inputId, className: "text-sm font-medium leading-5 text-[var(--zg-text)] zg-balance", children: [
43305
+ question.prompt,
43306
+ required && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1 text-[var(--zg-text-muted)]", title: "Required", "aria-label": "required", children: "*" })
43307
+ ] }),
43308
+ question.description && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs leading-4 text-[var(--zg-text-muted)] zg-pretty", children: question.description }),
43309
+ question.type === "select" && question.multi && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs leading-4 text-[var(--zg-text-muted)]", children: "Pick one or more." })
43310
+ ] })
43249
43311
  ] }),
43250
- question.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(
43251
- "input",
43252
- {
43253
- type: "text",
43254
- value: typeof value === "string" ? value : "",
43255
- onChange: (e) => onChange(e.target.value),
43256
- placeholder: question.placeholder,
43257
- className: "w-full h-10 text-sm bg-[var(--zg-bg-elevated)] border border-[var(--zg-border)] rounded-lg px-3 text-[var(--zg-text)] outline-none focus:border-[var(--zg-accent)] focus:ring-2 focus:ring-[var(--zg-accent)]/20"
43258
- }
43259
- ),
43260
- question.type === "textarea" && /* @__PURE__ */ jsxRuntimeExports.jsx(
43261
- "textarea",
43262
- {
43263
- value: typeof value === "string" ? value : "",
43264
- onChange: (e) => onChange(e.target.value),
43265
- placeholder: question.placeholder,
43266
- rows: 4,
43267
- className: "w-full min-h-32 text-sm bg-[var(--zg-bg-elevated)] border border-[var(--zg-border)] rounded-lg px-3 py-2.5 text-[var(--zg-text)] outline-none focus:border-[var(--zg-accent)] focus:ring-2 focus:ring-[var(--zg-accent)]/20 resize-y"
43268
- }
43269
- ),
43270
- question.type === "select" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 gap-2", role: question.multi ? "group" : "radiogroup", children: [
43271
- question.multi && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[11px] text-[var(--zg-text-muted)] -mt-1", children: "Pick one or more." }),
43272
- question.choices.map((choice) => {
43312
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col pl-[30px]", children: [
43313
+ question.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(
43314
+ "input",
43315
+ {
43316
+ id: inputId,
43317
+ type: "text",
43318
+ value: typeof value === "string" ? value : "",
43319
+ onChange: (e) => onChange(e.target.value),
43320
+ placeholder: question.placeholder,
43321
+ className: "w-full h-10 text-sm bg-[var(--zg-bg-elevated)] border border-[var(--zg-border)] rounded-lg px-3 text-[var(--zg-text)] outline-none focus:border-[var(--zg-accent)] focus:ring-2 focus:ring-[var(--zg-accent)]/20"
43322
+ }
43323
+ ),
43324
+ question.type === "textarea" && /* @__PURE__ */ jsxRuntimeExports.jsx(
43325
+ "textarea",
43326
+ {
43327
+ id: inputId,
43328
+ value: typeof value === "string" ? value : "",
43329
+ onChange: (e) => onChange(e.target.value),
43330
+ placeholder: question.placeholder,
43331
+ rows: 4,
43332
+ className: "w-full min-h-28 text-sm bg-[var(--zg-bg-elevated)] border border-[var(--zg-border)] rounded-lg px-3 py-2.5 text-[var(--zg-text)] outline-none focus:border-[var(--zg-accent)] focus:ring-2 focus:ring-[var(--zg-accent)]/20 resize-y"
43333
+ }
43334
+ ),
43335
+ question.type === "select" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 gap-2", role: question.multi ? "group" : "radiogroup", children: question.choices.map((choice) => {
43273
43336
  const picked = Array.isArray(value) ? value : typeof value === "string" ? [value] : [];
43274
43337
  const selected = picked.includes(choice.id);
43275
43338
  const toggle = () => {
@@ -43286,48 +43349,47 @@ function QuestionField({ question, value, onChange }) {
43286
43349
  role: question.multi ? "checkbox" : "radio",
43287
43350
  "aria-checked": selected,
43288
43351
  onClick: toggle,
43289
- className: `zg-press-subtle min-h-11 flex items-start gap-3 text-left px-3 py-2.5 rounded-lg border bg-[var(--zg-bg-elevated)] cursor-pointer transition-colors duration-150 ${selected ? "border-[var(--zg-accent)] text-[var(--zg-text)]" : "border-[var(--zg-border)] text-[var(--zg-text-muted)] hover:text-[var(--zg-text)] hover:bg-[var(--zg-bg-hover)]"}`,
43352
+ className: `zg-press-subtle min-h-10 flex items-start gap-3 text-left px-3 py-2 rounded-lg border bg-[var(--zg-bg-elevated)] cursor-pointer transition-colors duration-150 ${selected ? "border-[var(--zg-accent)] text-[var(--zg-text)]" : "border-[var(--zg-border)] text-[var(--zg-text-muted)] hover:text-[var(--zg-text)] hover:bg-[var(--zg-bg-hover)]"}`,
43290
43353
  children: [
43291
- /* @__PURE__ */ jsxRuntimeExports.jsx(
43354
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "flex h-5 shrink-0 items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43292
43355
  "span",
43293
43356
  {
43294
- "aria-hidden": true,
43295
- className: `inline-block w-3 h-3 mt-1 shrink-0 ${question.multi ? "rounded-[3px]" : "rounded-full"}`,
43357
+ className: `block h-3 w-3 ${question.multi ? "rounded-[3px]" : "rounded-full"}`,
43296
43358
  style: {
43297
43359
  background: selected ? "var(--zg-accent)" : "transparent",
43298
- border: selected ? "none" : "1px solid var(--zg-border)"
43360
+ border: selected ? "none" : "1px solid var(--zg-text-muted)"
43299
43361
  }
43300
43362
  }
43301
- ),
43363
+ ) }),
43302
43364
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex-1 min-w-0", children: [
43303
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm", children: choice.label }),
43304
- choice.description && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block text-[11px] text-[var(--zg-text-muted)] mt-0.5 zg-pretty", children: choice.description })
43365
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block text-sm leading-5", children: choice.label }),
43366
+ choice.description && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block text-xs leading-4 text-[var(--zg-text-muted)] mt-0.5 zg-pretty", children: choice.description })
43305
43367
  ] })
43306
43368
  ]
43307
43369
  },
43308
43370
  choice.id
43309
43371
  );
43310
- })
43311
- ] }),
43312
- question.type === "confirm" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
43313
- /* @__PURE__ */ jsxRuntimeExports.jsx(
43314
- ConfirmChoice,
43315
- {
43316
- label: question.affirmLabel ?? "yes",
43317
- active: value === true,
43318
- onClick: () => onChange(true),
43319
- tone: "accent"
43320
- }
43321
- ),
43322
- /* @__PURE__ */ jsxRuntimeExports.jsx(
43323
- ConfirmChoice,
43324
- {
43325
- label: question.denyLabel ?? "no",
43326
- active: value === false,
43327
- onClick: () => onChange(false),
43328
- tone: "muted"
43329
- }
43330
- )
43372
+ }) }),
43373
+ question.type === "confirm" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2", role: "radiogroup", children: [
43374
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43375
+ ConfirmChoice,
43376
+ {
43377
+ label: question.affirmLabel ?? "yes",
43378
+ active: value === true,
43379
+ onClick: () => onChange(true),
43380
+ tone: "accent"
43381
+ }
43382
+ ),
43383
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43384
+ ConfirmChoice,
43385
+ {
43386
+ label: question.denyLabel ?? "no",
43387
+ active: value === false,
43388
+ onClick: () => onChange(false),
43389
+ tone: "muted"
43390
+ }
43391
+ )
43392
+ ] })
43331
43393
  ] })
43332
43394
  ] });
43333
43395
  }
@@ -43343,10 +43405,12 @@ function ConfirmChoice({
43343
43405
  {
43344
43406
  type: "button",
43345
43407
  onClick,
43346
- className: "zg-press min-h-11 text-sm px-3 py-2 rounded-lg border cursor-pointer transition-colors duration-150",
43408
+ role: "radio",
43409
+ "aria-checked": active,
43410
+ className: "zg-press min-h-10 text-sm leading-5 px-3 py-2 rounded-lg border cursor-pointer transition-colors duration-150",
43347
43411
  style: {
43348
- color: active ? "#fff" : "var(--zg-text-muted)",
43349
- background: active ? accentBg : "transparent",
43412
+ color: active ? tone === "accent" ? "#fff" : "var(--zg-text)" : "var(--zg-text-muted)",
43413
+ background: active ? accentBg : "var(--zg-bg-elevated)",
43350
43414
  borderColor: active ? accentBg : "var(--zg-border)"
43351
43415
  },
43352
43416
  children: label
@@ -43496,94 +43560,6 @@ function InteractionBar({ sessionId }) {
43496
43560
  }
43497
43561
  ) });
43498
43562
  }
43499
- function CallStatusPill({ sessionId }) {
43500
- const running = useSessionRunning(sessionId);
43501
- const events = useSessionEvents(sessionId);
43502
- const startedAtRef = reactExports.useRef(null);
43503
- const [elapsedSec, setElapsedSec] = reactExports.useState(0);
43504
- reactExports.useEffect(() => {
43505
- if (!running) {
43506
- startedAtRef.current = null;
43507
- setElapsedSec(0);
43508
- return void 0;
43509
- }
43510
- startedAtRef.current = performance.now();
43511
- setElapsedSec(0);
43512
- const tick = () => {
43513
- const startedAt = startedAtRef.current;
43514
- if (startedAt === null) {
43515
- return;
43516
- }
43517
- setElapsedSec(Math.max(0, Math.floor((performance.now() - startedAt) / 1e3)));
43518
- };
43519
- const id = window.setInterval(tick, 250);
43520
- return () => window.clearInterval(id);
43521
- }, [running]);
43522
- const tokenEstimate = reactExports.useMemo(() => {
43523
- if (!running || events.length === 0) {
43524
- return 0;
43525
- }
43526
- let lastUserPromptIdx = -1;
43527
- for (let i = events.length - 1; i >= 0; i -= 1) {
43528
- if (events[i].kind === "user-prompt") {
43529
- lastUserPromptIdx = i;
43530
- break;
43531
- }
43532
- }
43533
- let totalChars = 0;
43534
- for (let i = lastUserPromptIdx + 1; i < events.length; i += 1) {
43535
- totalChars += extractTextLength(events[i]);
43536
- }
43537
- if (totalChars === 0) {
43538
- return 0;
43539
- }
43540
- return Math.max(1, Math.round(totalChars / 4));
43541
- }, [events, running]);
43542
- if (!sessionId || !running) {
43543
- return null;
43544
- }
43545
- return (
43546
- // Lives in the composer's trailing pill group (see Center.tsx): same 24px
43547
- // height and mono/muted face as the context and cost pills beside it, no
43548
- // chrome — the value is the indicator.
43549
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
43550
- "div",
43551
- {
43552
- className: "zg-call-status inline-flex items-center h-6 px-1 text-[10px] font-mono tabular-nums text-[var(--zg-text-muted)] whitespace-nowrap shrink-0",
43553
- title: "Elapsed time and estimated tokens for the current turn",
43554
- children: [
43555
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
43556
- elapsedSec,
43557
- "s"
43558
- ] }),
43559
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "opacity-50 mx-1.5", children: "·" }),
43560
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
43561
- tokenEstimate.toLocaleString(),
43562
- " ",
43563
- tokenEstimate === 1 ? "token" : "tokens"
43564
- ] })
43565
- ]
43566
- }
43567
- )
43568
- );
43569
- }
43570
- function extractTextLength(event) {
43571
- if (!event || typeof event !== "object") {
43572
- return 0;
43573
- }
43574
- const e = event;
43575
- if (typeof e.text === "string") {
43576
- return e.text.length;
43577
- }
43578
- if (e.kind === "tool" && e.input && typeof e.input === "object") {
43579
- try {
43580
- return JSON.stringify(e.input).length;
43581
- } catch {
43582
- return 0;
43583
- }
43584
- }
43585
- return 0;
43586
- }
43587
43563
  function OrderedMap(content2) {
43588
43564
  this.content = content2;
43589
43565
  }
@@ -74362,17 +74338,19 @@ function ChatboxStatusPills({
74362
74338
  contextStatus,
74363
74339
  costStatus,
74364
74340
  streaming = null,
74341
+ runOutputTokens = 0,
74365
74342
  runningWorkCount = 0,
74366
74343
  onOpenRunningWork
74367
74344
  }) {
74345
+ const running = useSessionRunning(activeSession?.id ?? null);
74368
74346
  if (!activeSession) {
74369
74347
  return null;
74370
74348
  }
74371
- if (!contextStatus && !costStatus?.label && runningWorkCount === 0 && !streaming) {
74349
+ if (!contextStatus && !costStatus?.label && runningWorkCount === 0 && !running) {
74372
74350
  return null;
74373
74351
  }
74374
74352
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "zg-chatbox-status flex items-center gap-2 min-w-0", children: [
74375
- /* @__PURE__ */ jsxRuntimeExports.jsx(StreamingChip, { progress: streaming, cost: costStatus }),
74353
+ /* @__PURE__ */ jsxRuntimeExports.jsx(RunStatusChip, { running, progress: streaming, settledOutputTokens: runOutputTokens, cost: costStatus }),
74376
74354
  runningWorkCount > 0 && onOpenRunningWork && /* @__PURE__ */ jsxRuntimeExports.jsxs(
74377
74355
  "button",
74378
74356
  {
@@ -74432,31 +74410,76 @@ function useTweenedCount(target) {
74432
74410
  }, [target]);
74433
74411
  return shown;
74434
74412
  }
74435
- function StreamingChip({ progress, cost }) {
74436
- const lastProgress = reactExports.useRef(null);
74437
- if (progress !== null) {
74438
- lastProgress.current = progress;
74439
- }
74440
- const shown = progress ?? lastProgress.current;
74441
- const tweened = useTweenedCount(shown?.outputTokens ?? 0);
74442
- const show = progress !== null && progress.outputTokens > 0;
74443
- const label = shown ? streamingLabel({ ...shown, outputTokens: tweened }) : "";
74444
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence$1, { show, className: "shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
74413
+ function useRunElapsedSec(running) {
74414
+ const [elapsedSec, setElapsedSec] = reactExports.useState(0);
74415
+ reactExports.useEffect(() => {
74416
+ if (!running) {
74417
+ return void 0;
74418
+ }
74419
+ const startedAt = performance.now();
74420
+ setElapsedSec(0);
74421
+ const id = window.setInterval(() => {
74422
+ setElapsedSec(Math.max(0, Math.floor((performance.now() - startedAt) / 1e3)));
74423
+ }, 250);
74424
+ return () => window.clearInterval(id);
74425
+ }, [running]);
74426
+ return elapsedSec;
74427
+ }
74428
+ function RunStatusChip({
74429
+ running,
74430
+ progress,
74431
+ settledOutputTokens,
74432
+ cost
74433
+ }) {
74434
+ const elapsedSec = useRunElapsedSec(running);
74435
+ const live = progress;
74436
+ const total = settledOutputTokens + (live?.outputTokens ?? 0);
74437
+ const tweened = useTweenedCount(total);
74438
+ const rate = tokensPerSecond(progress);
74439
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence$1, { show: running, className: "shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
74445
74440
  "span",
74446
74441
  {
74447
74442
  className: "inline-flex items-center gap-1.5 h-6 px-2 rounded-full bg-[var(--zg-bg-hover)] border border-[var(--zg-border)] text-[11px] tabular-nums text-[var(--zg-text-muted)] whitespace-nowrap",
74448
- title: shown?.estimated ? "Tokens estimated from streamed text; settles at turn end" : "Tokens counted by the provider",
74443
+ title: live?.estimated ? "Elapsed time, output tokens (estimated from streamed text, settles at turn end) and session cost for this run" : "Elapsed time, output tokens and session cost for this run",
74449
74444
  "aria-live": "off",
74450
74445
  children: [
74451
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-accent)]", children: label }),
74452
- cost?.label && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: { color: cost.estimated ? "var(--zg-text-muted)" : "var(--zg-money)" }, children: [
74453
- cost.estimated ? "~" : "",
74454
- cost.label
74446
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
74447
+ elapsedSec,
74448
+ "s"
74449
+ ] }),
74450
+ tweened > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
74451
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Dot$1, {}),
74452
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[var(--zg-accent)]", children: [
74453
+ "↓",
74454
+ live?.estimated ? "~" : "",
74455
+ fmtTokens(tweened)
74456
+ ] })
74457
+ ] }),
74458
+ rate && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
74459
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Dot$1, {}),
74460
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-accent)]", children: rate })
74461
+ ] }),
74462
+ cost?.label && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
74463
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Dot$1, {}),
74464
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: { color: cost.estimated ? "var(--zg-text-muted)" : "var(--zg-money)" }, children: [
74465
+ cost.estimated ? "~" : "",
74466
+ cost.label
74467
+ ] })
74455
74468
  ] })
74456
74469
  ]
74457
74470
  }
74458
74471
  ) });
74459
74472
  }
74473
+ function tokensPerSecond(progress) {
74474
+ if (!progress || progress.outputTokens <= 0 || progress.elapsedMs < 2e3) {
74475
+ return null;
74476
+ }
74477
+ const perSecond = Math.round(progress.outputTokens / (progress.elapsedMs / 1e3));
74478
+ return perSecond > 0 ? `${perSecond} tok/s` : null;
74479
+ }
74480
+ function Dot$1() {
74481
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "opacity-50", children: "·" });
74482
+ }
74460
74483
  function Popover({
74461
74484
  trigger,
74462
74485
  render: render2,
@@ -75054,11 +75077,12 @@ function QueueStrip({ messages, onPush, onDrop }) {
75054
75077
  setEditingId(msg.id);
75055
75078
  setDraft(msg.text);
75056
75079
  };
75080
+ const cancelEdit = () => setEditingId(null);
75057
75081
  const commitEdit = async (msg) => {
75058
- setEditingId(null);
75059
75082
  if (editingId !== msg.id) {
75060
75083
  return msg.text;
75061
75084
  }
75085
+ setEditingId(null);
75062
75086
  const next = draft.trim();
75063
75087
  if (!next || next === msg.text) {
75064
75088
  return msg.text;
@@ -75074,56 +75098,84 @@ function QueueStrip({ messages, onPush, onDrop }) {
75074
75098
  "Queued · ",
75075
75099
  messages.length
75076
75100
  ] }),
75077
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col", children: messages.map((msg, i) => /* @__PURE__ */ jsxRuntimeExports.jsx(
75078
- DockRow,
75079
- {
75080
- className: "group",
75081
- glyph: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-[11px]", children: "❯" }),
75082
- trailing: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-0.5 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150", children: [
75083
- /* @__PURE__ */ jsxRuntimeExports.jsx(
75084
- DockIconButton,
75101
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col", children: messages.map((msg, i) => {
75102
+ const editing = editingId === msg.id;
75103
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
75104
+ DockRow,
75105
+ {
75106
+ className: "group",
75107
+ align: editing ? "start" : "center",
75108
+ glyph: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-[11px]", children: "❯" }),
75109
+ trailing: (
75110
+ /*
75111
+ * While editing, `onMouseDown.preventDefault` keeps focus in
75112
+ * the textarea so the click reaches the action without a blur
75113
+ * racing it. Both actions then commit the draft themselves.
75114
+ */
75115
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
75116
+ "span",
75117
+ {
75118
+ onMouseDown: editing ? (e) => e.preventDefault() : void 0,
75119
+ className: `inline-flex items-center gap-0.5 transition-opacity duration-150 ${editing ? "opacity-100" : "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100"}`,
75120
+ children: [
75121
+ !editing && /* @__PURE__ */ jsxRuntimeExports.jsx(
75122
+ DockIconButton,
75123
+ {
75124
+ label: "Edit before it is sent",
75125
+ icon: "i-heroicons-pencil",
75126
+ onClick: () => startEdit(msg)
75127
+ }
75128
+ ),
75129
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
75130
+ DockIconButton,
75131
+ {
75132
+ label: editing ? "Save and push into the run now" : "Push into the run now (delivered between tool calls)",
75133
+ icon: "i-heroicons-play",
75134
+ tone: "accent",
75135
+ onClick: () => void pushEntry(msg)
75136
+ }
75137
+ ),
75138
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
75139
+ DockIconButton,
75140
+ {
75141
+ label: "Remove this queued message",
75142
+ icon: "i-heroicons-x-mark",
75143
+ tone: "danger",
75144
+ onClick: () => onDrop(msg.id)
75145
+ }
75146
+ )
75147
+ ]
75148
+ }
75149
+ )
75150
+ ),
75151
+ children: editing ? /* @__PURE__ */ jsxRuntimeExports.jsx(
75152
+ QueueEditor,
75085
75153
  {
75086
- label: "Push into the run now (delivered between tool calls)",
75087
- icon: "i-heroicons-play",
75088
- tone: "accent",
75089
- onClick: () => void pushEntry(msg)
75154
+ value: draft,
75155
+ dirty: draft.trim() !== msg.text && draft.trim().length > 0,
75156
+ onChange: setDraft,
75157
+ onSave: () => void commitEdit(msg),
75158
+ onSaveAndPush: () => void pushEntry(msg),
75159
+ onCancel: cancelEdit
75090
75160
  }
75091
- ),
75092
- /* @__PURE__ */ jsxRuntimeExports.jsx(
75093
- DockIconButton,
75161
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
75162
+ "button",
75094
75163
  {
75095
- label: "Remove this queued message",
75096
- icon: "i-heroicons-x-mark",
75097
- tone: "danger",
75098
- onClick: () => onDrop(msg.id)
75164
+ type: "button",
75165
+ title: "Click to edit before it is sent",
75166
+ onClick: () => startEdit(msg),
75167
+ className: "flex items-center gap-2 w-full min-w-0 h-7 text-left bg-transparent border-0 p-0 cursor-text text-xs text-[var(--zg-text)] rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--zg-accent)]",
75168
+ children: [
75169
+ messages.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "shrink-0 tabular-nums text-[10px] text-[var(--zg-text-muted)]", children: i + 1 }),
75170
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "min-w-0 truncate", children: flattenForRow(msg.text) }),
75171
+ msg.attachments?.map((att, j2) => /* @__PURE__ */ jsxRuntimeExports.jsx(AttachmentChip, { attachment: att }, `${att.name ?? att.mediaType}-${j2}`))
75172
+ ]
75099
75173
  }
75100
75174
  )
75101
- ] }),
75102
- children: editingId === msg.id ? /* @__PURE__ */ jsxRuntimeExports.jsx(
75103
- QueueEditArea,
75104
- {
75105
- value: draft,
75106
- onChange: setDraft,
75107
- onCommit: () => void commitEdit(msg),
75108
- onCancel: () => setEditingId(null)
75109
- }
75110
- ) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
75111
- "button",
75112
- {
75113
- type: "button",
75114
- title: "Click to edit before it is sent",
75115
- onClick: () => startEdit(msg),
75116
- className: "flex items-center gap-2 w-full min-w-0 text-left bg-transparent border-0 p-0 cursor-text text-xs text-[var(--zg-text)] rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--zg-accent)]",
75117
- children: [
75118
- messages.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "shrink-0 tabular-nums text-[10px] text-[var(--zg-text-muted)]", children: i + 1 }),
75119
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "min-w-0 truncate", children: flattenForRow(msg.text) }),
75120
- msg.attachments?.map((att, j2) => /* @__PURE__ */ jsxRuntimeExports.jsx(AttachmentChip, { attachment: att }, `${att.name ?? att.mediaType}-${j2}`))
75121
- ]
75122
- }
75123
- )
75124
- },
75125
- msg.id
75126
- )) })
75175
+ },
75176
+ msg.id
75177
+ );
75178
+ }) })
75127
75179
  ] });
75128
75180
  }
75129
75181
  function flattenForRow(text2) {
@@ -75144,10 +75196,12 @@ function AttachmentChip({ attachment }) {
75144
75196
  }
75145
75197
  );
75146
75198
  }
75147
- function QueueEditArea({ value, onChange, onCommit, onCancel }) {
75148
- const ref = reactExports.useRef(null);
75199
+ const EDITOR_MAX_HEIGHT_PX = 240;
75200
+ function QueueEditor({ value, dirty, onChange, onSave, onSaveAndPush, onCancel }) {
75201
+ const root2 = reactExports.useRef(null);
75202
+ const area = reactExports.useRef(null);
75149
75203
  reactExports.useEffect(() => {
75150
- const el = ref.current;
75204
+ const el = area.current;
75151
75205
  if (!el) {
75152
75206
  return;
75153
75207
  }
@@ -75155,33 +75209,82 @@ function QueueEditArea({ value, onChange, onCommit, onCancel }) {
75155
75209
  el.setSelectionRange(el.value.length, el.value.length);
75156
75210
  }, []);
75157
75211
  reactExports.useEffect(() => {
75158
- const el = ref.current;
75212
+ const el = area.current;
75159
75213
  if (!el) {
75160
75214
  return;
75161
75215
  }
75162
75216
  el.style.height = "auto";
75163
- el.style.height = `${el.scrollHeight}px`;
75217
+ const next = Math.min(el.scrollHeight, EDITOR_MAX_HEIGHT_PX);
75218
+ el.style.height = `${next}px`;
75219
+ el.style.overflowY = el.scrollHeight > EDITOR_MAX_HEIGHT_PX ? "auto" : "hidden";
75164
75220
  }, [value]);
75165
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
75166
- "textarea",
75221
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
75222
+ "div",
75167
75223
  {
75168
- ref,
75169
- value,
75170
- rows: 1,
75171
- onChange: (e) => onChange(e.target.value),
75172
- onBlur: onCommit,
75173
- onKeyDown: (e) => {
75174
- e.stopPropagation();
75175
- if (e.key === "Enter" && !e.shiftKey) {
75176
- e.preventDefault();
75177
- onCommit();
75178
- }
75179
- if (e.key === "Escape") {
75180
- e.preventDefault();
75181
- onCancel();
75224
+ ref: root2,
75225
+ className: "flex flex-col gap-1.5 w-full py-1",
75226
+ onBlur: (e) => {
75227
+ if (root2.current?.contains(e.relatedTarget)) {
75228
+ return;
75182
75229
  }
75230
+ onSave();
75183
75231
  },
75184
- className: "flex-1 min-w-0 resize-none text-xs text-[var(--zg-text)] bg-[var(--zg-bg)] border border-[var(--zg-border)] rounded-md px-2 py-1 -my-1 outline-none focus:border-[var(--zg-accent)] focus:ring-2 focus:ring-[var(--zg-accent)]/20"
75232
+ children: [
75233
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
75234
+ "textarea",
75235
+ {
75236
+ ref: area,
75237
+ value,
75238
+ rows: 1,
75239
+ spellCheck: false,
75240
+ "aria-label": "Edit queued message",
75241
+ onChange: (e) => onChange(e.target.value),
75242
+ onKeyDown: (e) => {
75243
+ e.stopPropagation();
75244
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
75245
+ e.preventDefault();
75246
+ onSaveAndPush();
75247
+ return;
75248
+ }
75249
+ if (e.key === "Enter" && !e.shiftKey) {
75250
+ e.preventDefault();
75251
+ onSave();
75252
+ return;
75253
+ }
75254
+ if (e.key === "Escape") {
75255
+ e.preventDefault();
75256
+ onCancel();
75257
+ }
75258
+ },
75259
+ className: "block w-full resize-none text-xs leading-5 text-[var(--zg-text)] bg-[var(--zg-bg)] border border-[var(--zg-border)] rounded-md px-2.5 py-1.5 outline-none focus:border-[var(--zg-accent)] focus:ring-2 focus:ring-[var(--zg-accent)]/20"
75260
+ }
75261
+ ),
75262
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 h-6", children: [
75263
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "min-w-0 truncate text-[10px] text-[var(--zg-text-muted)]", children: "↵ save · shift+↵ newline · ⌘↵ send now · esc cancel" }),
75264
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ml-auto inline-flex items-center gap-1", children: [
75265
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EditorButton, { onClick: onCancel, children: "Cancel" }),
75266
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EditorButton, { onClick: onSave, tone: "accent", disabled: !dirty, children: "Save" })
75267
+ ] })
75268
+ ] })
75269
+ ]
75270
+ }
75271
+ );
75272
+ }
75273
+ function EditorButton({
75274
+ children,
75275
+ onClick,
75276
+ tone = "muted",
75277
+ disabled = false
75278
+ }) {
75279
+ const look = tone === "accent" ? "text-[var(--zg-accent-hover)] hover:text-[var(--zg-accent)] disabled:text-[var(--zg-text-muted)]" : "text-[var(--zg-text-muted)] hover:text-[var(--zg-text)]";
75280
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
75281
+ "button",
75282
+ {
75283
+ type: "button",
75284
+ disabled,
75285
+ onClick,
75286
+ className: `zg-press-soft h-6 px-2 rounded-md text-[11px] font-medium bg-transparent hover:bg-[var(--zg-bg-hover)] disabled:hover:bg-transparent disabled:cursor-default border-0 cursor-pointer transition-colors duration-150 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--zg-accent)] ${look}`,
75287
+ children
75185
75288
  }
75186
75289
  );
75187
75290
  }
@@ -82640,6 +82743,7 @@ function Center({
82640
82743
  contextStatus,
82641
82744
  costStatus,
82642
82745
  streaming = null,
82746
+ runOutputTokens = 0,
82643
82747
  runningWorkCount = 0,
82644
82748
  onOpenRunningWork,
82645
82749
  lightsInCenter = false,
@@ -83131,7 +83235,6 @@ function Center({
83131
83235
  }
83132
83236
  ),
83133
83237
  trailingActions: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
83134
- /* @__PURE__ */ jsxRuntimeExports.jsx(CallStatusPill, { sessionId: activeSession?.id ?? null }),
83135
83238
  /* @__PURE__ */ jsxRuntimeExports.jsx(
83136
83239
  ChatboxStatusPills,
83137
83240
  {
@@ -83139,6 +83242,7 @@ function Center({
83139
83242
  contextStatus,
83140
83243
  costStatus,
83141
83244
  streaming,
83245
+ runOutputTokens,
83142
83246
  runningWorkCount,
83143
83247
  onOpenRunningWork
83144
83248
  }
@@ -92030,7 +92134,7 @@ const TAB_SECTIONS = {
92030
92134
  ],
92031
92135
  compaction: [
92032
92136
  { title: "Auto-compact", keys: ["autoCompact", "autoCompactThreshold"] },
92033
- { title: "Context budget", keys: ["persistToolResults"] }
92137
+ { title: "Context budget", keys: ["persistToolResults", "stableToolList"] }
92034
92138
  ],
92035
92139
  safety: [
92036
92140
  { title: "Guardrails", keys: ["safeMode", "interactionMode"] },
@@ -92065,16 +92169,20 @@ const PANEL_SEARCH_ENTRIES = [
92065
92169
  {
92066
92170
  tab: "instructions",
92067
92171
  label: "Instructions",
92068
- description: "Every chunk of the system prompt with its source; SYSTEM.md override status."
92172
+ description: "Every chunk of the system prompt with its source, and the SYSTEM.md override status."
92069
92173
  },
92070
- { tab: "extensions", label: "Extensions", description: "Enable / disable discovered extensions." },
92174
+ { tab: "extensions", label: "Extensions", description: "Enable or disable discovered extensions." },
92071
92175
  {
92072
92176
  tab: "plugins",
92073
92177
  label: "Plugins",
92074
- description: "Enable / disable Agent Plugins and the skills + MCP servers they contribute."
92178
+ description: "Enable or disable Agent Plugins and the skills and MCP servers they contribute."
92075
92179
  },
92076
- { tab: "mcps", label: "MCP servers", description: "Enable / disable MCP servers, probe tools, OAuth sign-in." },
92077
- { tab: "authentication", label: "Authentication", description: "Sign in to providers — API keys and OAuth." },
92180
+ {
92181
+ tab: "mcps",
92182
+ label: "MCP servers",
92183
+ description: "Enable or disable MCP servers, probe their tools, sign in with OAuth."
92184
+ },
92185
+ { tab: "authentication", label: "Authentication", description: "Sign in to providers with API keys or OAuth." },
92078
92186
  { tab: "logs", label: "Logs", description: "Extension warnings, MCP diagnostics and host debug lines." }
92079
92187
  ];
92080
92188
  function AppVersion() {
@@ -92932,6 +93040,7 @@ function AppShell() {
92932
93040
  const [fetchedCostStatus, setFetchedCostStatus] = reactExports.useState(null);
92933
93041
  const [accruedCost, setAccruedCost] = reactExports.useState(0);
92934
93042
  const [streamProgress, setStreamProgress] = reactExports.useState(null);
93043
+ const [runOutputTokens, setRunOutputTokens] = reactExports.useState(0);
92935
93044
  const runGenerationRef = reactExports.useRef(0);
92936
93045
  const [runningWork, setRunningWork] = reactExports.useState([]);
92937
93046
  const [compacting, setCompacting] = reactExports.useState(false);
@@ -93022,6 +93131,10 @@ function AppShell() {
93022
93131
  } else if (signal.kind === "turn:end") {
93023
93132
  if (signal.childId === void 0) {
93024
93133
  setStreamProgress(null);
93134
+ const output = signal.usage?.output ?? 0;
93135
+ if (output > 0) {
93136
+ setRunOutputTokens((prev) => prev + output);
93137
+ }
93025
93138
  }
93026
93139
  const cost = signal.usage?.cost ?? 0;
93027
93140
  if (cost > 0) {
@@ -93030,6 +93143,7 @@ function AppShell() {
93030
93143
  } else if (signal.kind === "run:start") {
93031
93144
  runGenerationRef.current += 1;
93032
93145
  setAccruedCost(0);
93146
+ setRunOutputTokens(0);
93033
93147
  } else if (signal.kind === "run:end") {
93034
93148
  setStreamProgress(null);
93035
93149
  }
@@ -93590,6 +93704,7 @@ function AppShell() {
93590
93704
  contextStatus,
93591
93705
  costStatus,
93592
93706
  streaming,
93707
+ runOutputTokens,
93593
93708
  runningWorkCount: runningWork.length,
93594
93709
  onOpenRunningWork: openRunningWork,
93595
93710
  lightsInCenter,