zidane-gui 7.0.31 → 7.1.1
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.
|
@@ -14584,34 +14584,10 @@ const DAEMON_HEALTH_STYLE = {
|
|
|
14584
14584
|
label: "daemon unreachable"
|
|
14585
14585
|
}
|
|
14586
14586
|
};
|
|
14587
|
-
function formatTokens$1(tokens) {
|
|
14588
|
-
return tokens >= 1e3 ? `${(tokens / 1e3).toFixed(1)}k` : String(tokens);
|
|
14589
|
-
}
|
|
14590
|
-
function cacheBreakChip(info) {
|
|
14591
|
-
const rebilled = formatTokens$1(info.rebilledTokens);
|
|
14592
|
-
const cost = info.costUsd !== void 0 ? ` · ~$${info.costUsd < 0.01 ? "<0.01" : info.costUsd.toFixed(2)}` : "";
|
|
14593
|
-
if (info.changed.length === 0) return {
|
|
14594
|
-
tone: "dim",
|
|
14595
|
-
glyph: "⚡",
|
|
14596
|
-
label: `cache expired · +${rebilled} tok${cost}`
|
|
14597
|
-
};
|
|
14598
|
-
return {
|
|
14599
|
-
tone: "warn",
|
|
14600
|
-
glyph: "⚡",
|
|
14601
|
-
label: `cache break · ${info.changed.join(",")} · +${rebilled} tok${cost}`
|
|
14602
|
-
};
|
|
14603
|
-
}
|
|
14604
14587
|
function retryLabel(info) {
|
|
14605
14588
|
const suffix = info.source === "parent" ? "" : ` · ${info.source}`;
|
|
14606
14589
|
return `retrying ${info.attempt}/${info.max}${suffix}`;
|
|
14607
14590
|
}
|
|
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
14591
|
function compactingLabel(estTokens, startedAt, now = Date.now()) {
|
|
14616
14592
|
const base2 = "Compacting...";
|
|
14617
14593
|
const elapsedMs = typeof startedAt === "number" ? now - startedAt : 0;
|
|
@@ -14896,6 +14872,16 @@ const TOOL_DISPLAY = {
|
|
|
14896
14872
|
return null;
|
|
14897
14873
|
}
|
|
14898
14874
|
},
|
|
14875
|
+
call_tool: {
|
|
14876
|
+
displayName: "Call tool",
|
|
14877
|
+
format: (input) => {
|
|
14878
|
+
const name2 = stringField(input, "name");
|
|
14879
|
+
return name2 ? {
|
|
14880
|
+
target: name2,
|
|
14881
|
+
meta: ["malformed call"]
|
|
14882
|
+
} : null;
|
|
14883
|
+
}
|
|
14884
|
+
},
|
|
14899
14885
|
skills_use: {
|
|
14900
14886
|
displayName: (input) => {
|
|
14901
14887
|
return (input ? stringField(input, "mode") : void 0) === "deactivate" ? "Disable skill" : "Enable skill";
|
|
@@ -15390,6 +15376,13 @@ const DEFAULT_SETTINGS = {
|
|
|
15390
15376
|
showAllProjects: false,
|
|
15391
15377
|
resumeLastSession: true,
|
|
15392
15378
|
persistToolResults: true,
|
|
15379
|
+
stableToolList: false,
|
|
15380
|
+
// OS sandbox for the model's shell commands (Seatbelt / bwrap). Off by
|
|
15381
|
+
// default; `sandboxAllowWrite` is stored but has no GUI row yet (free-text
|
|
15382
|
+
// inputs are not surfaced in the GUI panel).
|
|
15383
|
+
sandbox: false,
|
|
15384
|
+
sandboxNetwork: "allow",
|
|
15385
|
+
sandboxAllowWrite: "",
|
|
15393
15386
|
autoCompact: true,
|
|
15394
15387
|
autoCompactThreshold: 0.8,
|
|
15395
15388
|
showEditDiffs: true,
|
|
@@ -15461,6 +15454,7 @@ const DEFAULT_SETTINGS = {
|
|
|
15461
15454
|
maxCostUsd: 0,
|
|
15462
15455
|
maxTotalTokens: 0,
|
|
15463
15456
|
maxWallMinutes: 0,
|
|
15457
|
+
thinkingBinding: "drop_block",
|
|
15464
15458
|
showCompactionSummary: false,
|
|
15465
15459
|
compactionModel: "",
|
|
15466
15460
|
fileLogging: false,
|
|
@@ -15475,18 +15469,18 @@ const SETTINGS_TOGGLES = [
|
|
|
15475
15469
|
{
|
|
15476
15470
|
key: "checkForUpdates",
|
|
15477
15471
|
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
|
|
15472
|
+
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
15473
|
},
|
|
15480
15474
|
{
|
|
15481
15475
|
key: "useDaemon",
|
|
15482
15476
|
label: "Shared daemon runtime (experimental)",
|
|
15483
|
-
description: "
|
|
15477
|
+
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
15478
|
},
|
|
15485
15479
|
{
|
|
15486
15480
|
key: "orchestration",
|
|
15487
15481
|
requires: "useDaemon",
|
|
15488
15482
|
label: "Main session (orchestration)",
|
|
15489
|
-
description:
|
|
15483
|
+
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
15484
|
},
|
|
15491
15485
|
{ key: "safeMode", label: "Safe mode", description: "prompt before each tool call (unless safelisted)" },
|
|
15492
15486
|
{
|
|
@@ -15499,7 +15493,7 @@ const SETTINGS_TOGGLES = [
|
|
|
15499
15493
|
* with canonical `settings-context.tsx`; `settings-consent-copy.test.ts`
|
|
15500
15494
|
* enforces that the warning survives future rewording.
|
|
15501
15495
|
*/
|
|
15502
|
-
description: "run extensions
|
|
15496
|
+
description: "run extensions from <project>/.zidane/extensions (off by default, they execute arbitrary local code)"
|
|
15503
15497
|
},
|
|
15504
15498
|
{
|
|
15505
15499
|
key: "resumeLastSession",
|
|
@@ -15516,6 +15510,16 @@ const SETTINGS_TOGGLES = [
|
|
|
15516
15510
|
label: "Persist large tool results",
|
|
15517
15511
|
description: "write >8 KiB tool outputs to disk and inline a preview"
|
|
15518
15512
|
},
|
|
15513
|
+
{
|
|
15514
|
+
key: "stableToolList",
|
|
15515
|
+
label: "Stable tool list (call_tool)",
|
|
15516
|
+
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. Anthropic always works this way (replayed thinking is bound to the tool list); this toggle affects other providers (next session activation)"
|
|
15517
|
+
},
|
|
15518
|
+
{
|
|
15519
|
+
key: "sandbox",
|
|
15520
|
+
label: "Sandbox shell commands",
|
|
15521
|
+
description: "run the model's shell commands under the OS sandbox (macOS Seatbelt / Linux bwrap): writes limited to the project, temp dirs and the configured writable paths, credential dirs hidden; write_file/edit follow the same roots. Does not cover MCP servers or fetch_url. Fails closed when the sandbox is unavailable (next session activation)"
|
|
15522
|
+
},
|
|
15519
15523
|
{
|
|
15520
15524
|
key: "autoCompact",
|
|
15521
15525
|
label: "Auto-compact",
|
|
@@ -15543,7 +15547,7 @@ const SETTINGS_TOGGLES = [
|
|
|
15543
15547
|
{
|
|
15544
15548
|
key: "attachmentsEnabled",
|
|
15545
15549
|
label: "Paste attachments",
|
|
15546
|
-
description: "
|
|
15550
|
+
description: "turn dropped images and long pastes into prompt attachments (off = everything pastes inline)"
|
|
15547
15551
|
},
|
|
15548
15552
|
{
|
|
15549
15553
|
key: "inlineAutocomplete",
|
|
@@ -15558,12 +15562,12 @@ const SETTINGS_TOGGLES = [
|
|
|
15558
15562
|
{
|
|
15559
15563
|
key: "importForeignConfigs",
|
|
15560
15564
|
label: "Import configurations from other agents",
|
|
15561
|
-
description: "discover MCP servers
|
|
15565
|
+
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
15566
|
},
|
|
15563
15567
|
{
|
|
15564
15568
|
key: "importRulerConfigs",
|
|
15565
15569
|
label: "Support Ruler configuration (.ruler)",
|
|
15566
|
-
description: `discover MCP servers, skills
|
|
15570
|
+
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
15571
|
},
|
|
15568
15572
|
{ key: "showThrobber", label: "Throbber", description: "animated indicator while the agent is working" },
|
|
15569
15573
|
{ key: "artifacts", label: "Artifacts", description: "track pull requests, branches, commits and recorded files per session" },
|
|
@@ -15594,6 +15598,15 @@ const SETTINGS_CHOICES = [
|
|
|
15594
15598
|
{ value: "disabled", label: "Disable tools" }
|
|
15595
15599
|
]
|
|
15596
15600
|
},
|
|
15601
|
+
{
|
|
15602
|
+
key: "sandboxNetwork",
|
|
15603
|
+
label: "Sandbox network",
|
|
15604
|
+
description: 'network access for sandboxed shell commands (allow keeps bun install / git fetch / gh working; deny blocks all sockets, the only way to stop exfiltration of readable files). Needs "Sandbox shell commands"',
|
|
15605
|
+
options: [
|
|
15606
|
+
{ value: "allow", label: "Allow" },
|
|
15607
|
+
{ value: "deny", label: "Deny" }
|
|
15608
|
+
]
|
|
15609
|
+
},
|
|
15597
15610
|
{
|
|
15598
15611
|
key: "toolCallDisplay",
|
|
15599
15612
|
label: "Tool calls display",
|
|
@@ -15641,7 +15654,7 @@ const SETTINGS_CHOICES = [
|
|
|
15641
15654
|
{
|
|
15642
15655
|
key: "retryMaxAttempts",
|
|
15643
15656
|
label: "Provider retry attempts",
|
|
15644
|
-
description: "max attempts per provider call
|
|
15657
|
+
description: "max attempts per provider call for retryable errors and silent stream stalls, applies to the session and its subagents",
|
|
15645
15658
|
options: [
|
|
15646
15659
|
{ value: 0, label: "Default (3)" },
|
|
15647
15660
|
{ value: 1, label: "1 (no retry)" },
|
|
@@ -15699,10 +15712,20 @@ const SETTINGS_CHOICES = [
|
|
|
15699
15712
|
{ value: 60, label: "60 min" }
|
|
15700
15713
|
]
|
|
15701
15714
|
},
|
|
15715
|
+
{
|
|
15716
|
+
key: "thinkingBinding",
|
|
15717
|
+
label: "Preserved thinking (Anthropic only)",
|
|
15718
|
+
description: "when earlier reasoning no longer matches the conversation prefix: drop it server-side and continue, fail the run with the API error (no retry, history untouched — for debugging), or let the account default decide. Applies on the next run",
|
|
15719
|
+
options: [
|
|
15720
|
+
{ value: "drop_block", label: "Drop silently" },
|
|
15721
|
+
{ value: "error", label: "Fail the run" },
|
|
15722
|
+
{ value: "off", label: "Account default" }
|
|
15723
|
+
]
|
|
15724
|
+
},
|
|
15702
15725
|
{
|
|
15703
15726
|
key: "theme",
|
|
15704
15727
|
label: "Theme",
|
|
15705
|
-
description: "colors
|
|
15728
|
+
description: "colors and markdown / syntax styles",
|
|
15706
15729
|
options: [
|
|
15707
15730
|
{ value: "default", label: "Default" },
|
|
15708
15731
|
{ value: "catppuccin-mocha", label: "Catppuccin Mocha" },
|
|
@@ -16362,16 +16385,6 @@ class StreamStore {
|
|
|
16362
16385
|
}
|
|
16363
16386
|
case "cache:break": {
|
|
16364
16387
|
this._cacheBreak.set(signal.sessionId, signal.info);
|
|
16365
|
-
const chip = cacheBreakChip(signal.info);
|
|
16366
|
-
const prior = this._events.get(signal.sessionId) ?? [];
|
|
16367
|
-
this._events.set(
|
|
16368
|
-
signal.sessionId,
|
|
16369
|
-
appendEvent(prior, {
|
|
16370
|
-
kind: "info",
|
|
16371
|
-
text: chip.label,
|
|
16372
|
-
notice: { severity: chip.tone === "warn" ? "warn" : "info", label: "cache" }
|
|
16373
|
-
})
|
|
16374
|
-
);
|
|
16375
16388
|
this._notifySession(signal.sessionId);
|
|
16376
16389
|
return;
|
|
16377
16390
|
}
|
|
@@ -17244,11 +17257,15 @@ function SessionsProvider({ children }) {
|
|
|
17244
17257
|
return window.api.chat.isRunning(row.id).then((running) => running === false).catch(() => false);
|
|
17245
17258
|
})
|
|
17246
17259
|
);
|
|
17247
|
-
if (version !== refreshVersion.current
|
|
17260
|
+
if (version !== refreshVersion.current) {
|
|
17248
17261
|
return;
|
|
17249
17262
|
}
|
|
17263
|
+
const runStateStable = unchanged();
|
|
17250
17264
|
rawSessionsRef.current = next;
|
|
17251
17265
|
setSessions(next);
|
|
17266
|
+
if (!runStateStable) {
|
|
17267
|
+
return;
|
|
17268
|
+
}
|
|
17252
17269
|
for (const [index2, row] of next.entries()) {
|
|
17253
17270
|
if (row.status === "running") {
|
|
17254
17271
|
markRunning(row.id);
|
|
@@ -18649,12 +18666,21 @@ function DockRow({
|
|
|
18649
18666
|
glyph,
|
|
18650
18667
|
children,
|
|
18651
18668
|
trailing,
|
|
18652
|
-
className = ""
|
|
18669
|
+
className = "",
|
|
18670
|
+
align = "center"
|
|
18653
18671
|
}) {
|
|
18654
|
-
|
|
18655
|
-
|
|
18672
|
+
const side = align === "start" ? "h-7" : "";
|
|
18673
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `flex ${align === "start" ? "items-start" : "items-center"} gap-2 min-h-7 text-xs ${className}`, children: [
|
|
18674
|
+
glyph !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18675
|
+
"span",
|
|
18676
|
+
{
|
|
18677
|
+
"aria-hidden": true,
|
|
18678
|
+
className: `w-3 shrink-0 inline-flex items-center justify-center text-[var(--zg-text-muted)] ${side}`,
|
|
18679
|
+
children: glyph
|
|
18680
|
+
}
|
|
18681
|
+
),
|
|
18656
18682
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 min-w-0", children }),
|
|
18657
|
-
trailing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className:
|
|
18683
|
+
trailing && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `shrink-0 inline-flex items-center gap-1 ${side}`, children: trailing })
|
|
18658
18684
|
] });
|
|
18659
18685
|
}
|
|
18660
18686
|
function DockIconButton({
|
|
@@ -43134,6 +43160,7 @@ function AskUserModal({ request }) {
|
|
|
43134
43160
|
useCloseWhenResolved(interactions.pending.some((p2) => p2.request.id === request.id));
|
|
43135
43161
|
const payload = request.payload;
|
|
43136
43162
|
const [answers, setAnswers] = reactExports.useState(() => seedDefaults(payload));
|
|
43163
|
+
const [instructions, setInstructions] = reactExports.useState("");
|
|
43137
43164
|
const [busy, setBusy] = reactExports.useState(false);
|
|
43138
43165
|
const [error, setError] = reactExports.useState(null);
|
|
43139
43166
|
const canSubmit = reactExports.useMemo(() => {
|
|
@@ -43155,7 +43182,11 @@ function AskUserModal({ request }) {
|
|
|
43155
43182
|
setBusy(true);
|
|
43156
43183
|
setError(null);
|
|
43157
43184
|
try {
|
|
43158
|
-
await interactions.respond(request.id, {
|
|
43185
|
+
await interactions.respond(request.id, {
|
|
43186
|
+
kind: "question",
|
|
43187
|
+
answers,
|
|
43188
|
+
...instructions.trim() ? { instructions: instructions.trim() } : {}
|
|
43189
|
+
});
|
|
43159
43190
|
modal.close();
|
|
43160
43191
|
} catch (err) {
|
|
43161
43192
|
setError(err.message ?? String(err));
|
|
@@ -43226,8 +43257,35 @@ function AskUserModal({ request }) {
|
|
|
43226
43257
|
}
|
|
43227
43258
|
},
|
|
43228
43259
|
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(
|
|
43260
|
+
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 }) }),
|
|
43261
|
+
payload.questions.map((q2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43262
|
+
QuestionField,
|
|
43263
|
+
{
|
|
43264
|
+
index: index2,
|
|
43265
|
+
question: q2,
|
|
43266
|
+
value: answers[q2.id],
|
|
43267
|
+
onChange: (v2) => setAnswer(q2.id, v2)
|
|
43268
|
+
},
|
|
43269
|
+
q2.id
|
|
43270
|
+
)),
|
|
43271
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg bg-[var(--zg-bg-elevated)] px-4 py-3.5 flex flex-col gap-3", children: [
|
|
43272
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
43273
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: `ask-${request.id}-instructions`, className: "text-sm font-medium text-[var(--zg-text)]", children: "Additional instructions" }),
|
|
43274
|
+
/* @__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." })
|
|
43275
|
+
] }),
|
|
43276
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43277
|
+
"textarea",
|
|
43278
|
+
{
|
|
43279
|
+
id: `ask-${request.id}-instructions`,
|
|
43280
|
+
value: instructions,
|
|
43281
|
+
onChange: (e) => setInstructions(e.target.value),
|
|
43282
|
+
placeholder: "e.g. keep the old endpoint alive until the migration lands",
|
|
43283
|
+
rows: 3,
|
|
43284
|
+
spellCheck: false,
|
|
43285
|
+
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"
|
|
43286
|
+
}
|
|
43287
|
+
)
|
|
43288
|
+
] })
|
|
43231
43289
|
]
|
|
43232
43290
|
}
|
|
43233
43291
|
)
|
|
@@ -43237,39 +43295,48 @@ function AskUserModal({ request }) {
|
|
|
43237
43295
|
function isRequired(q2) {
|
|
43238
43296
|
return q2.required ?? (q2.type === "select" || q2.type === "confirm");
|
|
43239
43297
|
}
|
|
43240
|
-
function QuestionField({ question, value, onChange }) {
|
|
43298
|
+
function QuestionField({ index: index2, question, value, onChange }) {
|
|
43241
43299
|
const required = isRequired(question);
|
|
43300
|
+
const inputId = `ask-q-${question.id}`;
|
|
43242
43301
|
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
|
|
43244
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("
|
|
43245
|
-
|
|
43246
|
-
|
|
43302
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-baseline gap-2.5", children: [
|
|
43303
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "w-5 shrink-0 text-right text-xs tabular-nums text-[var(--zg-text-muted)]", children: [
|
|
43304
|
+
index2 + 1,
|
|
43305
|
+
"."
|
|
43247
43306
|
] }),
|
|
43248
|
-
|
|
43307
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
43308
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { htmlFor: inputId, className: "text-sm font-medium leading-5 text-[var(--zg-text)] zg-balance", children: [
|
|
43309
|
+
question.prompt,
|
|
43310
|
+
required && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1 text-[var(--zg-text-muted)]", title: "Required", "aria-label": "required", children: "*" })
|
|
43311
|
+
] }),
|
|
43312
|
+
question.description && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs leading-4 text-[var(--zg-text-muted)] zg-pretty", children: question.description }),
|
|
43313
|
+
question.type === "select" && question.multi && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs leading-4 text-[var(--zg-text-muted)]", children: "Pick one or more." })
|
|
43314
|
+
] })
|
|
43249
43315
|
] }),
|
|
43250
|
-
|
|
43251
|
-
"
|
|
43252
|
-
|
|
43253
|
-
|
|
43254
|
-
|
|
43255
|
-
|
|
43256
|
-
|
|
43257
|
-
|
|
43258
|
-
|
|
43259
|
-
|
|
43260
|
-
|
|
43261
|
-
|
|
43262
|
-
|
|
43263
|
-
|
|
43264
|
-
|
|
43265
|
-
|
|
43266
|
-
|
|
43267
|
-
|
|
43268
|
-
|
|
43269
|
-
|
|
43270
|
-
|
|
43271
|
-
|
|
43272
|
-
|
|
43316
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col pl-[30px]", children: [
|
|
43317
|
+
question.type === "text" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43318
|
+
"input",
|
|
43319
|
+
{
|
|
43320
|
+
id: inputId,
|
|
43321
|
+
type: "text",
|
|
43322
|
+
value: typeof value === "string" ? value : "",
|
|
43323
|
+
onChange: (e) => onChange(e.target.value),
|
|
43324
|
+
placeholder: question.placeholder,
|
|
43325
|
+
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"
|
|
43326
|
+
}
|
|
43327
|
+
),
|
|
43328
|
+
question.type === "textarea" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43329
|
+
"textarea",
|
|
43330
|
+
{
|
|
43331
|
+
id: inputId,
|
|
43332
|
+
value: typeof value === "string" ? value : "",
|
|
43333
|
+
onChange: (e) => onChange(e.target.value),
|
|
43334
|
+
placeholder: question.placeholder,
|
|
43335
|
+
rows: 4,
|
|
43336
|
+
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"
|
|
43337
|
+
}
|
|
43338
|
+
),
|
|
43339
|
+
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
43340
|
const picked = Array.isArray(value) ? value : typeof value === "string" ? [value] : [];
|
|
43274
43341
|
const selected = picked.includes(choice.id);
|
|
43275
43342
|
const toggle = () => {
|
|
@@ -43286,48 +43353,47 @@ function QuestionField({ question, value, onChange }) {
|
|
|
43286
43353
|
role: question.multi ? "checkbox" : "radio",
|
|
43287
43354
|
"aria-checked": selected,
|
|
43288
43355
|
onClick: toggle,
|
|
43289
|
-
className: `zg-press-subtle min-h-
|
|
43356
|
+
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
43357
|
children: [
|
|
43291
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43358
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "flex h-5 shrink-0 items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43292
43359
|
"span",
|
|
43293
43360
|
{
|
|
43294
|
-
"
|
|
43295
|
-
className: `inline-block w-3 h-3 mt-1 shrink-0 ${question.multi ? "rounded-[3px]" : "rounded-full"}`,
|
|
43361
|
+
className: `block h-3 w-3 ${question.multi ? "rounded-[3px]" : "rounded-full"}`,
|
|
43296
43362
|
style: {
|
|
43297
43363
|
background: selected ? "var(--zg-accent)" : "transparent",
|
|
43298
|
-
border: selected ? "none" : "1px solid var(--zg-
|
|
43364
|
+
border: selected ? "none" : "1px solid var(--zg-text-muted)"
|
|
43299
43365
|
}
|
|
43300
43366
|
}
|
|
43301
|
-
),
|
|
43367
|
+
) }),
|
|
43302
43368
|
/* @__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-
|
|
43369
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block text-sm leading-5", children: choice.label }),
|
|
43370
|
+
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
43371
|
] })
|
|
43306
43372
|
]
|
|
43307
43373
|
},
|
|
43308
43374
|
choice.id
|
|
43309
43375
|
);
|
|
43310
|
-
})
|
|
43311
|
-
|
|
43312
|
-
|
|
43313
|
-
|
|
43314
|
-
|
|
43315
|
-
|
|
43316
|
-
|
|
43317
|
-
|
|
43318
|
-
|
|
43319
|
-
|
|
43320
|
-
|
|
43321
|
-
|
|
43322
|
-
|
|
43323
|
-
|
|
43324
|
-
|
|
43325
|
-
|
|
43326
|
-
|
|
43327
|
-
|
|
43328
|
-
|
|
43329
|
-
|
|
43330
|
-
)
|
|
43376
|
+
}) }),
|
|
43377
|
+
question.type === "confirm" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2", role: "radiogroup", children: [
|
|
43378
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43379
|
+
ConfirmChoice,
|
|
43380
|
+
{
|
|
43381
|
+
label: question.affirmLabel ?? "yes",
|
|
43382
|
+
active: value === true,
|
|
43383
|
+
onClick: () => onChange(true),
|
|
43384
|
+
tone: "accent"
|
|
43385
|
+
}
|
|
43386
|
+
),
|
|
43387
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
43388
|
+
ConfirmChoice,
|
|
43389
|
+
{
|
|
43390
|
+
label: question.denyLabel ?? "no",
|
|
43391
|
+
active: value === false,
|
|
43392
|
+
onClick: () => onChange(false),
|
|
43393
|
+
tone: "muted"
|
|
43394
|
+
}
|
|
43395
|
+
)
|
|
43396
|
+
] })
|
|
43331
43397
|
] })
|
|
43332
43398
|
] });
|
|
43333
43399
|
}
|
|
@@ -43343,10 +43409,12 @@ function ConfirmChoice({
|
|
|
43343
43409
|
{
|
|
43344
43410
|
type: "button",
|
|
43345
43411
|
onClick,
|
|
43346
|
-
|
|
43412
|
+
role: "radio",
|
|
43413
|
+
"aria-checked": active,
|
|
43414
|
+
className: "zg-press min-h-10 text-sm leading-5 px-3 py-2 rounded-lg border cursor-pointer transition-colors duration-150",
|
|
43347
43415
|
style: {
|
|
43348
|
-
color: active ? "#fff" : "var(--zg-text-muted)",
|
|
43349
|
-
background: active ? accentBg : "
|
|
43416
|
+
color: active ? tone === "accent" ? "#fff" : "var(--zg-text)" : "var(--zg-text-muted)",
|
|
43417
|
+
background: active ? accentBg : "var(--zg-bg-elevated)",
|
|
43350
43418
|
borderColor: active ? accentBg : "var(--zg-border)"
|
|
43351
43419
|
},
|
|
43352
43420
|
children: label
|
|
@@ -43496,94 +43564,6 @@ function InteractionBar({ sessionId }) {
|
|
|
43496
43564
|
}
|
|
43497
43565
|
) });
|
|
43498
43566
|
}
|
|
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
43567
|
function OrderedMap(content2) {
|
|
43588
43568
|
this.content = content2;
|
|
43589
43569
|
}
|
|
@@ -74362,17 +74342,19 @@ function ChatboxStatusPills({
|
|
|
74362
74342
|
contextStatus,
|
|
74363
74343
|
costStatus,
|
|
74364
74344
|
streaming = null,
|
|
74345
|
+
runOutputTokens = 0,
|
|
74365
74346
|
runningWorkCount = 0,
|
|
74366
74347
|
onOpenRunningWork
|
|
74367
74348
|
}) {
|
|
74349
|
+
const running = useSessionRunning(activeSession?.id ?? null);
|
|
74368
74350
|
if (!activeSession) {
|
|
74369
74351
|
return null;
|
|
74370
74352
|
}
|
|
74371
|
-
if (!contextStatus && !costStatus?.label && runningWorkCount === 0 && !
|
|
74353
|
+
if (!contextStatus && !costStatus?.label && runningWorkCount === 0 && !running) {
|
|
74372
74354
|
return null;
|
|
74373
74355
|
}
|
|
74374
74356
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "zg-chatbox-status flex items-center gap-2 min-w-0", children: [
|
|
74375
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
74357
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RunStatusChip, { running, progress: streaming, settledOutputTokens: runOutputTokens, cost: costStatus }),
|
|
74376
74358
|
runningWorkCount > 0 && onOpenRunningWork && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
74377
74359
|
"button",
|
|
74378
74360
|
{
|
|
@@ -74432,31 +74414,76 @@ function useTweenedCount(target) {
|
|
|
74432
74414
|
}, [target]);
|
|
74433
74415
|
return shown;
|
|
74434
74416
|
}
|
|
74435
|
-
function
|
|
74436
|
-
const
|
|
74437
|
-
|
|
74438
|
-
|
|
74439
|
-
|
|
74440
|
-
|
|
74441
|
-
|
|
74442
|
-
|
|
74443
|
-
|
|
74444
|
-
|
|
74417
|
+
function useRunElapsedSec(running) {
|
|
74418
|
+
const [elapsedSec, setElapsedSec] = reactExports.useState(0);
|
|
74419
|
+
reactExports.useEffect(() => {
|
|
74420
|
+
if (!running) {
|
|
74421
|
+
return void 0;
|
|
74422
|
+
}
|
|
74423
|
+
const startedAt = performance.now();
|
|
74424
|
+
setElapsedSec(0);
|
|
74425
|
+
const id = window.setInterval(() => {
|
|
74426
|
+
setElapsedSec(Math.max(0, Math.floor((performance.now() - startedAt) / 1e3)));
|
|
74427
|
+
}, 250);
|
|
74428
|
+
return () => window.clearInterval(id);
|
|
74429
|
+
}, [running]);
|
|
74430
|
+
return elapsedSec;
|
|
74431
|
+
}
|
|
74432
|
+
function RunStatusChip({
|
|
74433
|
+
running,
|
|
74434
|
+
progress,
|
|
74435
|
+
settledOutputTokens,
|
|
74436
|
+
cost
|
|
74437
|
+
}) {
|
|
74438
|
+
const elapsedSec = useRunElapsedSec(running);
|
|
74439
|
+
const live = progress;
|
|
74440
|
+
const total = settledOutputTokens + (live?.outputTokens ?? 0);
|
|
74441
|
+
const tweened = useTweenedCount(total);
|
|
74442
|
+
const rate = tokensPerSecond(progress);
|
|
74443
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence$1, { show: running, className: "shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
74445
74444
|
"span",
|
|
74446
74445
|
{
|
|
74447
74446
|
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:
|
|
74447
|
+
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
74448
|
"aria-live": "off",
|
|
74450
74449
|
children: [
|
|
74451
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
74452
|
-
|
|
74453
|
-
|
|
74454
|
-
|
|
74450
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
74451
|
+
elapsedSec,
|
|
74452
|
+
"s"
|
|
74453
|
+
] }),
|
|
74454
|
+
tweened > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
74455
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Dot$1, {}),
|
|
74456
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-[var(--zg-accent)]", children: [
|
|
74457
|
+
"↓",
|
|
74458
|
+
live?.estimated ? "~" : "",
|
|
74459
|
+
fmtTokens(tweened)
|
|
74460
|
+
] })
|
|
74461
|
+
] }),
|
|
74462
|
+
rate && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
74463
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Dot$1, {}),
|
|
74464
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-accent)]", children: rate })
|
|
74465
|
+
] }),
|
|
74466
|
+
cost?.label && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
74467
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Dot$1, {}),
|
|
74468
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { style: { color: cost.estimated ? "var(--zg-text-muted)" : "var(--zg-money)" }, children: [
|
|
74469
|
+
cost.estimated ? "~" : "",
|
|
74470
|
+
cost.label
|
|
74471
|
+
] })
|
|
74455
74472
|
] })
|
|
74456
74473
|
]
|
|
74457
74474
|
}
|
|
74458
74475
|
) });
|
|
74459
74476
|
}
|
|
74477
|
+
function tokensPerSecond(progress) {
|
|
74478
|
+
if (!progress || progress.outputTokens <= 0 || progress.elapsedMs < 2e3) {
|
|
74479
|
+
return null;
|
|
74480
|
+
}
|
|
74481
|
+
const perSecond = Math.round(progress.outputTokens / (progress.elapsedMs / 1e3));
|
|
74482
|
+
return perSecond > 0 ? `${perSecond} tok/s` : null;
|
|
74483
|
+
}
|
|
74484
|
+
function Dot$1() {
|
|
74485
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "opacity-50", children: "·" });
|
|
74486
|
+
}
|
|
74460
74487
|
function Popover({
|
|
74461
74488
|
trigger,
|
|
74462
74489
|
render: render2,
|
|
@@ -75054,11 +75081,12 @@ function QueueStrip({ messages, onPush, onDrop }) {
|
|
|
75054
75081
|
setEditingId(msg.id);
|
|
75055
75082
|
setDraft(msg.text);
|
|
75056
75083
|
};
|
|
75084
|
+
const cancelEdit = () => setEditingId(null);
|
|
75057
75085
|
const commitEdit = async (msg) => {
|
|
75058
|
-
setEditingId(null);
|
|
75059
75086
|
if (editingId !== msg.id) {
|
|
75060
75087
|
return msg.text;
|
|
75061
75088
|
}
|
|
75089
|
+
setEditingId(null);
|
|
75062
75090
|
const next = draft.trim();
|
|
75063
75091
|
if (!next || next === msg.text) {
|
|
75064
75092
|
return msg.text;
|
|
@@ -75074,56 +75102,84 @@ function QueueStrip({ messages, onPush, onDrop }) {
|
|
|
75074
75102
|
"Queued · ",
|
|
75075
75103
|
messages.length
|
|
75076
75104
|
] }),
|
|
75077
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col", children: messages.map((msg, i) =>
|
|
75078
|
-
|
|
75079
|
-
|
|
75080
|
-
|
|
75081
|
-
|
|
75082
|
-
|
|
75083
|
-
|
|
75084
|
-
|
|
75105
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col", children: messages.map((msg, i) => {
|
|
75106
|
+
const editing = editingId === msg.id;
|
|
75107
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75108
|
+
DockRow,
|
|
75109
|
+
{
|
|
75110
|
+
className: "group",
|
|
75111
|
+
align: editing ? "start" : "center",
|
|
75112
|
+
glyph: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-[11px]", children: "❯" }),
|
|
75113
|
+
trailing: (
|
|
75114
|
+
/*
|
|
75115
|
+
* While editing, `onMouseDown.preventDefault` keeps focus in
|
|
75116
|
+
* the textarea so the click reaches the action without a blur
|
|
75117
|
+
* racing it. Both actions then commit the draft themselves.
|
|
75118
|
+
*/
|
|
75119
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
75120
|
+
"span",
|
|
75121
|
+
{
|
|
75122
|
+
onMouseDown: editing ? (e) => e.preventDefault() : void 0,
|
|
75123
|
+
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"}`,
|
|
75124
|
+
children: [
|
|
75125
|
+
!editing && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75126
|
+
DockIconButton,
|
|
75127
|
+
{
|
|
75128
|
+
label: "Edit before it is sent",
|
|
75129
|
+
icon: "i-heroicons-pencil",
|
|
75130
|
+
onClick: () => startEdit(msg)
|
|
75131
|
+
}
|
|
75132
|
+
),
|
|
75133
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75134
|
+
DockIconButton,
|
|
75135
|
+
{
|
|
75136
|
+
label: editing ? "Save and push into the run now" : "Push into the run now (delivered between tool calls)",
|
|
75137
|
+
icon: "i-heroicons-play",
|
|
75138
|
+
tone: "accent",
|
|
75139
|
+
onClick: () => void pushEntry(msg)
|
|
75140
|
+
}
|
|
75141
|
+
),
|
|
75142
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75143
|
+
DockIconButton,
|
|
75144
|
+
{
|
|
75145
|
+
label: "Remove this queued message",
|
|
75146
|
+
icon: "i-heroicons-x-mark",
|
|
75147
|
+
tone: "danger",
|
|
75148
|
+
onClick: () => onDrop(msg.id)
|
|
75149
|
+
}
|
|
75150
|
+
)
|
|
75151
|
+
]
|
|
75152
|
+
}
|
|
75153
|
+
)
|
|
75154
|
+
),
|
|
75155
|
+
children: editing ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75156
|
+
QueueEditor,
|
|
75085
75157
|
{
|
|
75086
|
-
|
|
75087
|
-
|
|
75088
|
-
|
|
75089
|
-
|
|
75158
|
+
value: draft,
|
|
75159
|
+
dirty: draft.trim() !== msg.text && draft.trim().length > 0,
|
|
75160
|
+
onChange: setDraft,
|
|
75161
|
+
onSave: () => void commitEdit(msg),
|
|
75162
|
+
onSaveAndPush: () => void pushEntry(msg),
|
|
75163
|
+
onCancel: cancelEdit
|
|
75090
75164
|
}
|
|
75091
|
-
)
|
|
75092
|
-
|
|
75093
|
-
DockIconButton,
|
|
75165
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
75166
|
+
"button",
|
|
75094
75167
|
{
|
|
75095
|
-
|
|
75096
|
-
|
|
75097
|
-
|
|
75098
|
-
|
|
75168
|
+
type: "button",
|
|
75169
|
+
title: "Click to edit before it is sent",
|
|
75170
|
+
onClick: () => startEdit(msg),
|
|
75171
|
+
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)]",
|
|
75172
|
+
children: [
|
|
75173
|
+
messages.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "shrink-0 tabular-nums text-[10px] text-[var(--zg-text-muted)]", children: i + 1 }),
|
|
75174
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "min-w-0 truncate", children: flattenForRow(msg.text) }),
|
|
75175
|
+
msg.attachments?.map((att, j2) => /* @__PURE__ */ jsxRuntimeExports.jsx(AttachmentChip, { attachment: att }, `${att.name ?? att.mediaType}-${j2}`))
|
|
75176
|
+
]
|
|
75099
75177
|
}
|
|
75100
75178
|
)
|
|
75101
|
-
|
|
75102
|
-
|
|
75103
|
-
|
|
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
|
-
)) })
|
|
75179
|
+
},
|
|
75180
|
+
msg.id
|
|
75181
|
+
);
|
|
75182
|
+
}) })
|
|
75127
75183
|
] });
|
|
75128
75184
|
}
|
|
75129
75185
|
function flattenForRow(text2) {
|
|
@@ -75144,10 +75200,12 @@ function AttachmentChip({ attachment }) {
|
|
|
75144
75200
|
}
|
|
75145
75201
|
);
|
|
75146
75202
|
}
|
|
75147
|
-
|
|
75148
|
-
|
|
75203
|
+
const EDITOR_MAX_HEIGHT_PX = 240;
|
|
75204
|
+
function QueueEditor({ value, dirty, onChange, onSave, onSaveAndPush, onCancel }) {
|
|
75205
|
+
const root2 = reactExports.useRef(null);
|
|
75206
|
+
const area = reactExports.useRef(null);
|
|
75149
75207
|
reactExports.useEffect(() => {
|
|
75150
|
-
const el =
|
|
75208
|
+
const el = area.current;
|
|
75151
75209
|
if (!el) {
|
|
75152
75210
|
return;
|
|
75153
75211
|
}
|
|
@@ -75155,33 +75213,82 @@ function QueueEditArea({ value, onChange, onCommit, onCancel }) {
|
|
|
75155
75213
|
el.setSelectionRange(el.value.length, el.value.length);
|
|
75156
75214
|
}, []);
|
|
75157
75215
|
reactExports.useEffect(() => {
|
|
75158
|
-
const el =
|
|
75216
|
+
const el = area.current;
|
|
75159
75217
|
if (!el) {
|
|
75160
75218
|
return;
|
|
75161
75219
|
}
|
|
75162
75220
|
el.style.height = "auto";
|
|
75163
|
-
|
|
75221
|
+
const next = Math.min(el.scrollHeight, EDITOR_MAX_HEIGHT_PX);
|
|
75222
|
+
el.style.height = `${next}px`;
|
|
75223
|
+
el.style.overflowY = el.scrollHeight > EDITOR_MAX_HEIGHT_PX ? "auto" : "hidden";
|
|
75164
75224
|
}, [value]);
|
|
75165
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
75166
|
-
"
|
|
75225
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
75226
|
+
"div",
|
|
75167
75227
|
{
|
|
75168
|
-
ref,
|
|
75169
|
-
|
|
75170
|
-
|
|
75171
|
-
|
|
75172
|
-
|
|
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();
|
|
75228
|
+
ref: root2,
|
|
75229
|
+
className: "flex flex-col gap-1.5 w-full py-1",
|
|
75230
|
+
onBlur: (e) => {
|
|
75231
|
+
if (root2.current?.contains(e.relatedTarget)) {
|
|
75232
|
+
return;
|
|
75182
75233
|
}
|
|
75234
|
+
onSave();
|
|
75183
75235
|
},
|
|
75184
|
-
|
|
75236
|
+
children: [
|
|
75237
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75238
|
+
"textarea",
|
|
75239
|
+
{
|
|
75240
|
+
ref: area,
|
|
75241
|
+
value,
|
|
75242
|
+
rows: 1,
|
|
75243
|
+
spellCheck: false,
|
|
75244
|
+
"aria-label": "Edit queued message",
|
|
75245
|
+
onChange: (e) => onChange(e.target.value),
|
|
75246
|
+
onKeyDown: (e) => {
|
|
75247
|
+
e.stopPropagation();
|
|
75248
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
75249
|
+
e.preventDefault();
|
|
75250
|
+
onSaveAndPush();
|
|
75251
|
+
return;
|
|
75252
|
+
}
|
|
75253
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
75254
|
+
e.preventDefault();
|
|
75255
|
+
onSave();
|
|
75256
|
+
return;
|
|
75257
|
+
}
|
|
75258
|
+
if (e.key === "Escape") {
|
|
75259
|
+
e.preventDefault();
|
|
75260
|
+
onCancel();
|
|
75261
|
+
}
|
|
75262
|
+
},
|
|
75263
|
+
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"
|
|
75264
|
+
}
|
|
75265
|
+
),
|
|
75266
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 h-6", children: [
|
|
75267
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "min-w-0 truncate text-[10px] text-[var(--zg-text-muted)]", children: "↵ save · shift+↵ newline · ⌘↵ send now · esc cancel" }),
|
|
75268
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "ml-auto inline-flex items-center gap-1", children: [
|
|
75269
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(EditorButton, { onClick: onCancel, children: "Cancel" }),
|
|
75270
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(EditorButton, { onClick: onSave, tone: "accent", disabled: !dirty, children: "Save" })
|
|
75271
|
+
] })
|
|
75272
|
+
] })
|
|
75273
|
+
]
|
|
75274
|
+
}
|
|
75275
|
+
);
|
|
75276
|
+
}
|
|
75277
|
+
function EditorButton({
|
|
75278
|
+
children,
|
|
75279
|
+
onClick,
|
|
75280
|
+
tone = "muted",
|
|
75281
|
+
disabled = false
|
|
75282
|
+
}) {
|
|
75283
|
+
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)]";
|
|
75284
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75285
|
+
"button",
|
|
75286
|
+
{
|
|
75287
|
+
type: "button",
|
|
75288
|
+
disabled,
|
|
75289
|
+
onClick,
|
|
75290
|
+
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}`,
|
|
75291
|
+
children
|
|
75185
75292
|
}
|
|
75186
75293
|
);
|
|
75187
75294
|
}
|
|
@@ -82640,6 +82747,7 @@ function Center({
|
|
|
82640
82747
|
contextStatus,
|
|
82641
82748
|
costStatus,
|
|
82642
82749
|
streaming = null,
|
|
82750
|
+
runOutputTokens = 0,
|
|
82643
82751
|
runningWorkCount = 0,
|
|
82644
82752
|
onOpenRunningWork,
|
|
82645
82753
|
lightsInCenter = false,
|
|
@@ -83131,7 +83239,6 @@ function Center({
|
|
|
83131
83239
|
}
|
|
83132
83240
|
),
|
|
83133
83241
|
trailingActions: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
83134
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(CallStatusPill, { sessionId: activeSession?.id ?? null }),
|
|
83135
83242
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
83136
83243
|
ChatboxStatusPills,
|
|
83137
83244
|
{
|
|
@@ -83139,6 +83246,7 @@ function Center({
|
|
|
83139
83246
|
contextStatus,
|
|
83140
83247
|
costStatus,
|
|
83141
83248
|
streaming,
|
|
83249
|
+
runOutputTokens,
|
|
83142
83250
|
runningWorkCount,
|
|
83143
83251
|
onOpenRunningWork
|
|
83144
83252
|
}
|
|
@@ -92030,10 +92138,12 @@ const TAB_SECTIONS = {
|
|
|
92030
92138
|
],
|
|
92031
92139
|
compaction: [
|
|
92032
92140
|
{ title: "Auto-compact", keys: ["autoCompact", "autoCompactThreshold"] },
|
|
92033
|
-
{ title: "Context budget", keys: ["persistToolResults"] }
|
|
92141
|
+
{ title: "Context budget", keys: ["persistToolResults", "stableToolList"] },
|
|
92142
|
+
{ title: "Reasoning", keys: ["thinkingBinding"] }
|
|
92034
92143
|
],
|
|
92035
92144
|
safety: [
|
|
92036
92145
|
{ title: "Guardrails", keys: ["safeMode", "interactionMode"] },
|
|
92146
|
+
{ title: "Sandbox", keys: ["sandbox", "sandboxNetwork"] },
|
|
92037
92147
|
{ title: "Project trust", keys: ["loadProjectExtensions", "importForeignConfigs", "importRulerConfigs"] },
|
|
92038
92148
|
{
|
|
92039
92149
|
title: "Run limits",
|
|
@@ -92065,16 +92175,20 @@ const PANEL_SEARCH_ENTRIES = [
|
|
|
92065
92175
|
{
|
|
92066
92176
|
tab: "instructions",
|
|
92067
92177
|
label: "Instructions",
|
|
92068
|
-
description: "Every chunk of the system prompt with its source
|
|
92178
|
+
description: "Every chunk of the system prompt with its source, and the SYSTEM.md override status."
|
|
92069
92179
|
},
|
|
92070
|
-
{ tab: "extensions", label: "Extensions", description: "Enable
|
|
92180
|
+
{ tab: "extensions", label: "Extensions", description: "Enable or disable discovered extensions." },
|
|
92071
92181
|
{
|
|
92072
92182
|
tab: "plugins",
|
|
92073
92183
|
label: "Plugins",
|
|
92074
|
-
description: "Enable
|
|
92184
|
+
description: "Enable or disable Agent Plugins and the skills and MCP servers they contribute."
|
|
92185
|
+
},
|
|
92186
|
+
{
|
|
92187
|
+
tab: "mcps",
|
|
92188
|
+
label: "MCP servers",
|
|
92189
|
+
description: "Enable or disable MCP servers, probe their tools, sign in with OAuth."
|
|
92075
92190
|
},
|
|
92076
|
-
{ tab: "
|
|
92077
|
-
{ tab: "authentication", label: "Authentication", description: "Sign in to providers — API keys and OAuth." },
|
|
92191
|
+
{ tab: "authentication", label: "Authentication", description: "Sign in to providers with API keys or OAuth." },
|
|
92078
92192
|
{ tab: "logs", label: "Logs", description: "Extension warnings, MCP diagnostics and host debug lines." }
|
|
92079
92193
|
];
|
|
92080
92194
|
function AppVersion() {
|
|
@@ -92932,6 +93046,7 @@ function AppShell() {
|
|
|
92932
93046
|
const [fetchedCostStatus, setFetchedCostStatus] = reactExports.useState(null);
|
|
92933
93047
|
const [accruedCost, setAccruedCost] = reactExports.useState(0);
|
|
92934
93048
|
const [streamProgress, setStreamProgress] = reactExports.useState(null);
|
|
93049
|
+
const [runOutputTokens, setRunOutputTokens] = reactExports.useState(0);
|
|
92935
93050
|
const runGenerationRef = reactExports.useRef(0);
|
|
92936
93051
|
const [runningWork, setRunningWork] = reactExports.useState([]);
|
|
92937
93052
|
const [compacting, setCompacting] = reactExports.useState(false);
|
|
@@ -93022,6 +93137,10 @@ function AppShell() {
|
|
|
93022
93137
|
} else if (signal.kind === "turn:end") {
|
|
93023
93138
|
if (signal.childId === void 0) {
|
|
93024
93139
|
setStreamProgress(null);
|
|
93140
|
+
const output = signal.usage?.output ?? 0;
|
|
93141
|
+
if (output > 0) {
|
|
93142
|
+
setRunOutputTokens((prev) => prev + output);
|
|
93143
|
+
}
|
|
93025
93144
|
}
|
|
93026
93145
|
const cost = signal.usage?.cost ?? 0;
|
|
93027
93146
|
if (cost > 0) {
|
|
@@ -93030,6 +93149,7 @@ function AppShell() {
|
|
|
93030
93149
|
} else if (signal.kind === "run:start") {
|
|
93031
93150
|
runGenerationRef.current += 1;
|
|
93032
93151
|
setAccruedCost(0);
|
|
93152
|
+
setRunOutputTokens(0);
|
|
93033
93153
|
} else if (signal.kind === "run:end") {
|
|
93034
93154
|
setStreamProgress(null);
|
|
93035
93155
|
}
|
|
@@ -93590,6 +93710,7 @@ function AppShell() {
|
|
|
93590
93710
|
contextStatus,
|
|
93591
93711
|
costStatus,
|
|
93592
93712
|
streaming,
|
|
93713
|
+
runOutputTokens,
|
|
93593
93714
|
runningWorkCount: runningWork.length,
|
|
93594
93715
|
onOpenRunningWork: openRunningWork,
|
|
93595
93716
|
lightsInCenter,
|