@0perator/operator 0.2.0 → 0.2.2-next.0

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.
Files changed (117) hide show
  1. package/README.md +5 -4
  2. package/dist/auth/byo.js +1 -1
  3. package/dist/auth/commands.js +15 -5
  4. package/dist/auth/identity.js +1 -0
  5. package/dist/auth/staff.js +55 -0
  6. package/dist/autonomy/agent-cli.js +1 -1
  7. package/dist/autonomy/delegate-mode.js +2 -2
  8. package/dist/autonomy/delegate.js +41 -14
  9. package/dist/autonomy/headless.js +37 -10
  10. package/dist/autonomy/index.js +2 -4
  11. package/dist/autonomy/pr-isolation.js +92 -0
  12. package/dist/autonomy/pr-preflight.js +474 -0
  13. package/dist/autonomy/session-factory.js +13 -12
  14. package/dist/autonomy/subagent-model.js +17 -7
  15. package/dist/background/capacity.js +136 -0
  16. package/dist/background/evidence.js +42 -0
  17. package/dist/background/index.js +311 -44
  18. package/dist/background/lane-phase.js +60 -0
  19. package/dist/background/lane-summary.js +151 -0
  20. package/dist/background/notices.js +12 -3
  21. package/dist/background/synthesis.js +25 -0
  22. package/dist/browser/capture.js +505 -0
  23. package/dist/browser/engine.js +4 -3
  24. package/dist/browser/page-capture.js +167 -0
  25. package/dist/browser/png.js +116 -0
  26. package/dist/browser/visual-compare.js +229 -0
  27. package/dist/bus/beam-drop.js +55 -0
  28. package/dist/bus/inbox.js +157 -7
  29. package/dist/cli.js +316 -120
  30. package/dist/config/features.js +3 -3
  31. package/dist/config/managed.js +40 -1
  32. package/dist/config/persona.js +80 -29
  33. package/dist/config/product-hosts.js +2 -0
  34. package/dist/config/settings.js +289 -31
  35. package/dist/config/skills-index.js +37 -14
  36. package/dist/config/staff-prompt.js +12 -0
  37. package/dist/engine/agent.js +52 -41
  38. package/dist/engine/aurora.js +54 -13
  39. package/dist/engine/batch-scheduler.js +4 -13
  40. package/dist/engine/compaction.js +1 -1
  41. package/dist/engine/continuation.js +66 -32
  42. package/dist/engine/decision-points.js +2 -3
  43. package/dist/engine/fanout.js +16 -0
  44. package/dist/engine/identity.js +42 -0
  45. package/dist/engine/loop-guard.js +26 -83
  46. package/dist/engine/messages.js +2 -2
  47. package/dist/engine/moa.js +23 -1
  48. package/dist/engine/native-vision-node.js +72 -0
  49. package/dist/engine/native-vision.js +103 -0
  50. package/dist/engine/net-error.js +15 -0
  51. package/dist/engine/rolling-summary.js +142 -93
  52. package/dist/engine/verify-gate.js +37 -7
  53. package/dist/engine/waterfall.js +33 -0
  54. package/dist/gateway-cli.js +24 -4
  55. package/dist/memory/live-progress.js +4 -5
  56. package/dist/memory/session-index.js +3 -3
  57. package/dist/moa/codeact-lane.js +98 -0
  58. package/dist/moa/codeact-sandbox.js +409 -0
  59. package/dist/moa/codeact.js +140 -0
  60. package/dist/permissions/artifact-visibility.js +10 -0
  61. package/dist/permissions/index.js +2 -1
  62. package/dist/permissions/policy.js +9 -2
  63. package/dist/permissions/tier.js +13 -3
  64. package/dist/products/craft.js +92 -3
  65. package/dist/products/temple.js +20 -1
  66. package/dist/products/voice.js +112 -0
  67. package/dist/remote/grants.js +119 -0
  68. package/dist/remote/host.js +33 -5
  69. package/dist/router/free-models.js +5 -9
  70. package/dist/router/models.js +80 -26
  71. package/dist/router/provider-models.js +78 -0
  72. package/dist/router/router.js +15 -3
  73. package/dist/selfimprove/index.js +8 -6
  74. package/dist/selfimprove/lessons.js +23 -0
  75. package/dist/services/preflight.js +35 -91
  76. package/dist/session.js +316 -125
  77. package/dist/skills/catalogue.js +5 -2
  78. package/dist/skills/finder.js +4 -4
  79. package/dist/skills/install-guard.js +68 -0
  80. package/dist/skills/install.js +67 -0
  81. package/dist/toolchain/manifest.json +13 -13
  82. package/dist/tools/background-result.js +1 -1
  83. package/dist/tools/beam.js +246 -0
  84. package/dist/tools/classes.js +103 -0
  85. package/dist/tools/contract.js +1 -1
  86. package/dist/tools/craft.js +36 -2
  87. package/dist/tools/deferred.js +7 -3
  88. package/dist/tools/doc-text.js +1 -1
  89. package/dist/tools/executor.js +25 -15
  90. package/dist/tools/generation-gateway.js +94 -0
  91. package/dist/tools/registry.js +135 -158
  92. package/dist/tools/sandbox.js +6 -6
  93. package/dist/ui/App.js +17 -6
  94. package/dist/ui/ApprovalPrompt.js +1 -1
  95. package/dist/ui/BgPanel.js +15 -10
  96. package/dist/ui/Composer.js +44 -2
  97. package/dist/ui/Header.js +1 -6
  98. package/dist/ui/StatusRule.js +20 -8
  99. package/dist/ui/ToolStep.js +3 -3
  100. package/dist/ui/Transcript.js +41 -14
  101. package/dist/ui/batchLine.js +4 -4
  102. package/dist/ui/editdiff.js +2 -4
  103. package/dist/ui/format.js +4 -20
  104. package/dist/ui/liveTools.js +3 -3
  105. package/dist/ui/modelPicker.js +10 -6
  106. package/dist/ui/opsMode.js +20 -0
  107. package/dist/ui/phase.js +4 -2
  108. package/dist/ui/slashCommands.js +1 -0
  109. package/dist/ui/types.js +0 -2
  110. package/dist/ui/voice.js +185 -0
  111. package/dist/update-check.js +17 -6
  112. package/dist/update.js +1 -2
  113. package/dist/util/audio-io.js +82 -0
  114. package/dist/util/slash.js +2 -2
  115. package/dist/vision/pairs.js +239 -0
  116. package/package.json +1 -1
  117. package/dist/tools/mutating.js +0 -15
@@ -6,6 +6,8 @@ import { useTick } from "./tick.js";
6
6
  import { termCols, termRows } from "./term.js";
7
7
  import { cellWidth, truncateToWidth } from "./StatusRule.js";
8
8
  import { fmtElapsed, fmtTok } from "./format.js";
9
+ import { laneSummary } from "../background/lane-summary.js";
10
+ import { deadlineText } from "../background/synthesis.js";
9
11
  const GLYPH = { queued: "◌", working: "●", idle: "✓", stopped: "✗" };
10
12
  const COLOR = { queued: theme.muted, working: theme.running, idle: theme.success, stopped: theme.error };
11
13
  const DISPLAY_STATUS = { queued: "queued", working: "running", idle: "done", stopped: "errored" };
@@ -86,7 +88,7 @@ export function detailLine(a) {
86
88
  if (a.status === "stopped")
87
89
  return { text: a.endReason ?? "errored — check transcript for details", tone: "dim" };
88
90
  if (a.status === "queued")
89
- return { text: "waiting for a free slot", tone: "dim" };
91
+ return { text: a.queueReason ? `waiting: ${a.queueReason}` : "waiting for a free slot", tone: "dim" };
90
92
  const steps = a.steps ?? [];
91
93
  const stepLine = steps.slice(-3).map((s) => s.name + (s.arg ? `(${s.arg})` : "") + (s.running ? " …" : "")).join(" · ");
92
94
  const head = stepLine ? `↳ ${stepLine}` : a.thought ? `⋮ ${a.thought.replace(/^…/, "").trim()}` : "";
@@ -170,8 +172,10 @@ export function agentLaneOf(a, now, ctx = {}) {
170
172
  const base = { key: a.id, name: a.name ?? a.id, role: `${a.title ?? "sub-agent"}${a.resumed ? " · resumed" : ""}`, elapsedMs, tokens: a.tokens };
171
173
  const ledger = [a.written?.length ? `wrote ${a.written.length}` : "", a.reads ? `read ${a.reads}` : "", a.commands ? `ran ${a.commands}` : ""].filter(Boolean).join(" · ");
172
174
  const join = (...xs) => xs.filter(Boolean).join(" · ");
173
- if (a.status === "queued")
174
- return { ...base, tone: "queued", mission: ctx.maxRunning ? `queued: ${ctx.running ?? ctx.maxRunning} of ${ctx.maxRunning} agent slots busy` : "queued for a free agent slot" };
175
+ if (a.status === "queued") {
176
+ const why = a.queueReason ?? (ctx.maxRunning ? `${ctx.running ?? ctx.maxRunning} of ${ctx.maxRunning} agent slots busy` : "waiting for a free agent slot");
177
+ return { ...base, tone: "queued", mission: join(`waiting${a.phase?.kind === "queued" ? ` ${fmtElapsed(now - a.phase.since)}` : ""}: ${why}`, deadlineText(a, now)) };
178
+ }
175
179
  if (a.status === "idle")
176
180
  return { ...base, tone: "done", mission: join("done", a.verified === true ? "✓ verified" : a.verified === false ? "✗ unverified" : undefined, a.written?.length ? `wrote ${a.written.slice(-1).map((p) => p.split("/").pop()).join("")}` : undefined, "report delivered") };
177
181
  if (a.status === "stopped") {
@@ -183,8 +187,8 @@ export function agentLaneOf(a, now, ctx = {}) {
183
187
  if (a.slotWaitSince !== undefined) {
184
188
  return { ...base, tone: "waiting", mission: join(`waiting ${fmtElapsed(now - a.slotWaitSince)}: ${a.model ?? "its model"}'s slot is held by ${holderShort(a.slotHolder)}`, ledger || undefined) };
185
189
  }
186
- const where = a.model && ctx.mainServing ? (a.model === ctx.mainServing ? "shares main's slot" : "own server") : undefined;
187
- return { ...base, tone: "working", mission: join(a.round ? `r${a.round}` : undefined, missionLine(a), ledger || undefined, where) };
190
+ // What it is doing in plain words; the backend explains only a wait, so it stays out of a working lane (/agents <id>).
191
+ return { ...base, tone: "working", mission: join(a.round ? `r${a.round}` : undefined, laneSummary(a, now), deadlineText(a, now), a.evidence ? "⚠ shared input" : undefined, ledger || undefined) };
188
192
  }
189
193
  export function jobLaneOf(j, now) {
190
194
  const tone = j.status === "running" ? "job" : j.status === "done" ? "jobDone" : "jobFailed";
@@ -208,11 +212,12 @@ export function laneRow(l, cols) {
208
212
  const mission = truncateToWidth(l.mission, Math.max(0, room));
209
213
  return { left, mission: mission + " ".repeat(Math.max(0, room - cellWidth(mission))), right };
210
214
  }
211
- /** The lanes header: counts, a rule, and the commands that act on them (dropped under 80 cols) — cols−1 wide. */
212
- export function laneHeader(lanes, cols) {
215
+ /** The lanes header: counts, the live pool when the router reports one, a rule, and the commands that act on them
216
+ * (dropped under 80 cols) — cols−1 wide. */
217
+ export function laneHeader(lanes, cols, pool) {
213
218
  const n = (t) => lanes.filter((l) => t.includes(l.tone)).length;
214
219
  const running = n(["main", "working", "stuck"]), waiting = n(["waiting"]), queued = n(["queued"]), jobs = n(["job"]);
215
- const counts = [`${lanes.length} lanes`, running ? `${running} running` : "", waiting ? `${waiting} waiting for a slot` : "", queued ? `${queued} queued` : "", jobs ? `${jobs} shell job${jobs === 1 ? "" : "s"}` : ""].filter(Boolean).join(" · ");
220
+ const counts = [`${lanes.length} lanes`, running ? `${running} running` : "", waiting ? `${waiting} waiting for a slot` : "", queued ? `${queued} queued` : "", jobs ? `${jobs} shell job${jobs === 1 ? "" : "s"}` : "", pool ?? ""].filter(Boolean).join(" · ");
216
221
  const hint = cols >= 80 ? " /agents · /jobs" : "";
217
222
  const head = truncateToWidth(` ⇶ ${counts} `, cols - 1 - cellWidth(hint) - 1);
218
223
  return head + "─".repeat(Math.max(1, cols - 1 - cellWidth(head) - cellWidth(hint))) + hint;
@@ -224,7 +229,7 @@ function LaneRow({ lane, cols }) {
224
229
  return (_jsxs(Text, { children: [" ", lane.tone === "working" ? _jsx(OrbitGlyph, {}) : _jsx(Text, { color: LANE_COLOR[lane.tone], children: LANE_GLYPH[lane.tone] }), " ", _jsx(Text, { bold: true, children: left.slice(0, 6) }), _jsx(Text, { dimColor: true, children: left.slice(6) }), _jsx(Text, { color: lane.tone === "stuck" ? theme.warn : undefined, dimColor: lane.tone !== "stuck" && lane.tone !== "main" && lane.tone !== "working", children: mission }), right ? _jsx(Text, { dimColor: true, children: ` ${right}` }) : null] }));
225
230
  }
226
231
  /** The lanes view: one row per live worker, finished agents lingering until they are reaped. */
227
- export function Lanes({ main, agents, jobs, mainServing, maxRunning }) {
232
+ export function Lanes({ main, agents, jobs, mainServing, maxRunning, pool, warnings = [] }) {
228
233
  const cols = termCols();
229
234
  const now = Date.now();
230
235
  const running = agents.filter((a) => a.status === "working").length;
@@ -236,5 +241,5 @@ export function Lanes({ main, agents, jobs, mainServing, maxRunning }) {
236
241
  ];
237
242
  const cap = termRows() < LANES_SHORT_ROWS ? 3 : 8;
238
243
  const shown = lanes.slice(0, cap);
239
- return (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { dimColor: true, children: laneHeader(lanes, cols) }), shown.map((l) => _jsx(LaneRow, { lane: l, cols: cols }, l.key)), lanes.length > shown.length ? _jsx(Text, { dimColor: true, children: ` +${lanes.length - shown.length} more · /agents` }) : null] }));
244
+ return (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { dimColor: true, children: laneHeader(lanes, cols, pool) }), shown.map((l) => _jsx(LaneRow, { lane: l, cols: cols }, l.key)), warnings.slice(0, 1).map((w) => _jsx(Text, { color: theme.warn, wrap: "truncate-end", children: ` ⚠ ${w}` }, w)), lanes.length > shown.length ? _jsx(Text, { dimColor: true, children: ` +${lanes.length - shown.length} more · /agents` }) : null] }));
240
245
  }
@@ -18,6 +18,7 @@ import { useEffect, useRef, useState } from "react";
18
18
  import { Box, Text, useInput, useStdin } from "ink";
19
19
  import { InputHistory } from "./useInputHistory.js";
20
20
  import { isExpandKey } from "./expand.js";
21
+ import { isVoiceKey } from "./voice.js";
21
22
  import { matchSlashCommands } from "./slashCommands.js";
22
23
  import { touchInput } from "../idle/activity.js";
23
24
  import { isSlashCommand } from "../util/slash.js";
@@ -25,7 +26,7 @@ import { agentMention, matchAgentMentions, mentionCompletion, mentionMenuLine }
25
26
  import { termCols } from "./term.js";
26
27
  const PASTE_START = "\x1b[200~";
27
28
  const PASTE_END = "\x1b[201~";
28
- export function Composer({ onSubmit, onInterrupt, onQueue, onSteer, disabled, suspended, onCycleMode, onCycleContext, onBackground, queued = 0, onEditQueued, onDropQueued, nextSteps = 0, onPickNext, onDismissNext, agents = [], onAgentMessage, onSendTo, onFocusSwitcher, onActNow, onOpenFinder, prompt = "› " }) {
29
+ export function Composer({ onSubmit, onInterrupt, onQueue, onSteer, disabled, suspended, onCycleMode, onCycleContext, onBackground, queued = 0, onEditQueued, onDropQueued, nextSteps = 0, onPickNext, onDismissNext, agents = [], onAgentMessage, onSendTo, onFocusSwitcher, onActNow, onOpenFinder, onVoiceKey, prompt = "› " }) {
29
30
  const [value, setValue] = useState("");
30
31
  const suspendedRef = useRef(suspended); // read by the raw-stdin paste listener, registered once below
31
32
  suspendedRef.current = suspended;
@@ -188,6 +189,11 @@ export function Composer({ onSubmit, onInterrupt, onQueue, onSteer, disabled, su
188
189
  onOpenFinder?.();
189
190
  return;
190
191
  }
192
+ // ctrl+t talks (voice mode), idle or mid-turn; the draft stays as it is. Swallowed either way.
193
+ if (isVoiceKey(ch, key)) {
194
+ onVoiceKey?.();
195
+ return;
196
+ }
191
197
  // ESC / Ctrl+C: apply the pure interruptPlan. ESC mid-turn with a pending draft flushes it into
192
198
  // the queue (so it goes through right after the interrupt, via the turn-finally drain), then
193
199
  // interrupts; an empty-draft ESC and every Ctrl+C are plain interrupts. See interruptPlan below.
@@ -247,6 +253,27 @@ export function Composer({ onSubmit, onInterrupt, onQueue, onSteer, disabled, su
247
253
  onSubmit(text);
248
254
  return;
249
255
  }
256
+ // ctrl+u clears the whole draft (⌘⌫ in iTerm2's natural text editing and Ghostty sends it); ctrl+w and option+⌫ delete
257
+ // the previous word. Ahead of the queue keys: on an empty draft they do nothing, never drop a queued message.
258
+ if (isClearDraftKey(ch, key)) {
259
+ setSelIdx(0);
260
+ setValue("");
261
+ pasteStoreRef.current.clear();
262
+ pasteCountRef.current = 0;
263
+ if (historyRef.current.recalling)
264
+ historyRef.current.resetToLive("");
265
+ return;
266
+ }
267
+ if (isDeleteWordKey(ch, key)) {
268
+ setSelIdx(0);
269
+ setValue((v) => {
270
+ const next = deleteWordBack(v);
271
+ if (historyRef.current.recalling)
272
+ historyRef.current.resetToLive(next);
273
+ return next;
274
+ });
275
+ return;
276
+ }
250
277
  // Queued messages (Claude Code's ↑-to-edit): on an empty draft ↑ pulls the most recent one back for editing and
251
278
  // Backspace drops it. Ahead of history recall, which gets ↑ back once the queue is empty.
252
279
  const queuedPlan = queuedKeyPlan(key, { draftEmpty: value === "", queued });
@@ -302,12 +329,14 @@ export function Composer({ onSubmit, onInterrupt, onQueue, onSteer, disabled, su
302
329
  // Surface any image/video paths in the draft as attachment chips so the user can see multiple
303
330
  // media are attached (dragged/pasted paths land in the text). De-duped, basename only.
304
331
  const attachments = Array.from(new Set(value.match(MEDIA_RE) ?? []));
305
- return (_jsxs(Box, { flexDirection: "column", children: [lines.map((line, i) => (_jsxs(Text, { children: [i === 0 ? prompt : " ", line, i === lines.length - 1 ? "▌" : ""] }, i))), attachments.length > 0 && (_jsx(Text, { dimColor: true, children: " " + attachments.map((a) => `${VIDEO_RE.test(a) ? "▷ vid" : "◇ img"}:${a.split("/").pop()}`).join(" ") })), menuMatches.length > 0 && (_jsxs(Box, { flexDirection: "column", children: [menuMatches.slice(0, 10).map((c, i) => {
332
+ return (_jsxs(Box, { flexDirection: "column", children: [lines.map((line, i) => (_jsxs(Text, { children: [i === 0 ? prompt : " ", line, i === lines.length - 1 ? "▌" : ""] }, i))), value.length > LONG_DRAFT && _jsx(Text, { dimColor: true, children: " ctrl+u clear" }), attachments.length > 0 && (_jsx(Text, { dimColor: true, children: " " + attachments.map((a) => `${VIDEO_RE.test(a) ? "▷ vid" : "◇ img"}:${a.split("/").pop()}`).join(" ") })), menuMatches.length > 0 && (_jsxs(Box, { flexDirection: "column", children: [menuMatches.slice(0, 10).map((c, i) => {
306
333
  const on = i === menuSel;
307
334
  const label = `/${c.name}${c.args ? " " + c.args : ""}`.padEnd(24);
308
335
  return (_jsxs(Text, { children: [_jsx(Text, { color: on ? "green" : undefined, bold: on, children: (on ? "▸ " : " ") + label }), _jsx(Text, { dimColor: true, children: c.description })] }, c.name));
309
336
  }), menuMatches.length > 10 && _jsx(Text, { dimColor: true, children: ` …and ${menuMatches.length - 10} more` })] })), atMatches ? _jsx(Text, { dimColor: true, children: mentionMenuLine(atMatches, atSel, termCols()) }) : null] }));
310
337
  }
338
+ // A draft this long (an injected or recalled message) shows the one-key way out under it.
339
+ const LONG_DRAFT = 500;
311
340
  // Recognize media file paths in the draft. IMAGE covers the common still formats, VIDEO the moving
312
341
  // ones; a path matching VIDEO is chipped as video, otherwise image. Extensions only — no I/O.
313
342
  const MEDIA_RE = /\S+\.(?:png|jpe?g|gif|webp|bmp|svg|heic|heif|mp4|mov|webm|mkv|avi|m4v)\b/gi;
@@ -448,3 +477,16 @@ export function isFinderKey(ch, key) {
448
477
  export function isContextCycleKey(ch, key) {
449
478
  return !!key.ctrl && ch === "x";
450
479
  }
480
+ /** ctrl+u — clear the whole draft (readline's line-discard; the cursor is always at the end, so the line is the draft). */
481
+ export function isClearDraftKey(ch, key) {
482
+ return !!key.ctrl && ch === "u";
483
+ }
484
+ /** ctrl+w, or option/alt+⌫: the terminal sends ESC+DEL (or ESC+BS), which Ink reports as delete/backspace with meta. */
485
+ export function isDeleteWordKey(ch, key) {
486
+ return (!!key.ctrl && ch === "w") || (!!key.meta && !!(key.backspace || key.delete));
487
+ }
488
+ /** Delete the word before the cursor (the end of the draft), readline style: trailing whitespace, then the word. A paste
489
+ * chip at the end goes as one word, so it is never left half-broken. */
490
+ export function deleteWordBack(text) {
491
+ return text.replace(/(?:\[Pasted #\d+[^\]]*\]|\S*)\s*$/u, "");
492
+ }
package/dist/ui/Header.js CHANGED
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Box, Text } from "ink";
3
3
  import { termCols } from "./term.js";
4
4
  import { theme } from "./theme.js";
5
+ import { prettyRoute } from "./StatusRule.js"; // the ONE outward-name rule, shared with the status rule
5
6
  const STAR = "✷"; // ✷ — the AXE signal star (brand glyph, matches ThinkingSpinner)
6
7
  function tierLabel(ctx) {
7
8
  if (!ctx)
@@ -12,12 +13,6 @@ function tierLabel(ctx) {
12
13
  return `${Math.round(ctx / 1024)}K`; // /1024 so 307200→"300K", 131072→"128K" (KiB-tokens, truthful)
13
14
  return String(ctx);
14
15
  }
15
- // The status line shows the OUTWARD name only: the internal model ids (operator-1m, or the legacy
16
- // aurora-* alias) collapse to "Operator" — the tier (· 1M) is appended separately below, so
17
- // "operator-1m" would just be redundant. MOA and any custom /model id pass through unchanged.
18
- function prettyRoute(r) {
19
- return /^(operator|aurora)(-|$)/i.test(r) ? "Operator" : r;
20
- }
21
16
  export function Header({ version, route = "operator", ctxWindow, user, build }) {
22
17
  const cols = termCols();
23
18
  const tier = tierLabel(ctxWindow);
@@ -3,6 +3,8 @@ import { Box, Text } from "ink";
3
3
  import { termCols } from "./term.js";
4
4
  import { theme } from "./theme.js";
5
5
  import { ring } from "./chart.js";
6
+ import { opsModeOn } from "./opsMode.js";
7
+ import { shownModelLabel } from "../engine/identity.js";
6
8
  // Compact token count for the status rule: 1234 -> "1.2k", 45231 -> "45k", 800 -> "800".
7
9
  function fmtK(n) {
8
10
  if (n < 1000)
@@ -44,10 +46,18 @@ export function truncateToWidth(s, max) {
44
46
  // the terminal is too narrow to hold every badge, `info` is truncated so cellWidth(right) ≤ cols-3 —
45
47
  // which keeps the leading fill ≥ 1 and the whole line at cols-1, so the rule never becomes the line that
46
48
  // wraps (the creep bug) no matter how many badges are lit or how narrow the window.
47
- const ROUTE_LABELS = { "operator-1m": "aurora" };
48
- /** The model as the owner reads it everywhere ("cortana"; the default operator-1m reads "aurora"). */
49
+ // The OUTWARD name only. Every Operator-branded model id (operator-1m, operator-flash, the legacy
50
+ // aurora-* aliases) reads "Operator" — the tier badge beside it carries the window, so the id would add
51
+ // nothing. A retired name is never shown for a live model: the hardcoded "operator-1m → aurora" map
52
+ // printed "aurora" while Operator-Flash was answering (owner screenshot, 11/26). Any other id — a fleet
53
+ // row, a BYO endpoint, MOA — passes through unchanged, because inventing a name for a model we know
54
+ // nothing about is worse than showing its id.
55
+ export function prettyRoute(r) {
56
+ return /^(operator|aurora)(-|$)/i.test(r) ? "Operator" : r;
57
+ }
58
+ /** The model as the owner reads it everywhere — the one label function every surface calls. */
49
59
  export function routeLabel(route) {
50
- return ROUTE_LABELS[route] ?? route;
60
+ return prettyRoute(route);
51
61
  }
52
62
  export function statusRight(p, cols) {
53
63
  const who = p.user ? `◆ ${p.user} · ` : "";
@@ -60,13 +70,14 @@ export function statusRight(p, cols) {
60
70
  // ("cortana@192.0.2.10:8112" read as noise; /endpoints lists the legs). The default model reads as "aurora", not
61
71
  // its id operator-1m (owner, 11/03: "just aurora 300k"), and the window is the one served, not a pin above it.
62
72
  const window = p.ctxWindow ? ` ${p.ctxWindow}` : "";
63
- let info = `${think}${plan}${seat}${who}${routeLabel(p.route)}${window} ${ring(p.ctxPct)} ${Math.round(p.ctxPct)}% · ${tok}v${p.version}${p.build ? ` ·${p.build}` : ""}`;
64
- let right = `✷ OPERATOR · ${info} ─`;
73
+ let info = `${think}${plan}${seat}${who}${shownModelLabel(routeLabel(p.route))}${window} ${ring(p.ctxPct)} ${Math.round(p.ctxPct)}% · ${tok}v${p.version}${p.build ? ` ·${p.build}` : ""}`;
74
+ const word = p.ops ? "OPS" : "OPERATOR";
75
+ let right = `✷ ${word} · ${info} ─`;
65
76
  const maxRight = cols - 3; // leaves fill ≥ 1 and total = cols-1
66
77
  if (cellWidth(right) > maxRight) {
67
78
  const framing = cellWidth(right) - cellWidth(info); // the wordmark + separators + trailing " ─"
68
79
  info = truncateToWidth(info, maxRight - framing);
69
- right = `✷ OPERATOR · ${info} ─`;
80
+ right = `✷ ${word} · ${info} ─`;
70
81
  }
71
82
  return { info, right };
72
83
  }
@@ -79,9 +90,10 @@ export function ruleFill(right, cols) {
79
90
  }
80
91
  export function StatusRule(props) {
81
92
  const cols = termCols();
82
- const { info, right } = statusRight(props, cols);
93
+ const ops = props.ops ?? opsModeOn();
94
+ const { info, right } = statusRight({ ...props, ops }, cols);
83
95
  const fill = ruleFill(right, cols);
84
96
  // Enterprise header: a dim rule sweeping to a magenta ✷ mark + bright OPERATOR wordmark + dim info,
85
97
  // sitting just above the composer (the input is bounded between this and the InputRule below).
86
- return (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: "─".repeat(fill) + " " }), _jsx(Text, { color: theme.accent, children: "\u2737 " }), _jsx(Text, { bold: true, children: "OPERATOR" }), _jsx(Text, { dimColor: true, children: ` · ${info} ─` })] }));
98
+ return (_jsxs(Box, { children: [_jsx(Text, { dimColor: true, children: "─".repeat(fill) + " " }), _jsx(Text, { color: theme.accent, children: "\u2737 " }), _jsx(Text, { bold: true, children: ops ? "OPS" : "OPERATOR" }), _jsx(Text, { dimColor: true, children: ` · ${info} ─` })] }));
87
99
  }
@@ -5,6 +5,7 @@ import { fileLink } from "./osc.js";
5
5
  import { theme } from "./theme.js";
6
6
  import { computeEditDiff } from "./editdiff.js";
7
7
  import { useTick } from "./tick.js";
8
+ import { SHELL_ANY } from "../tools/classes.js";
8
9
  import { rowBackgroundHint, BULK_ARGS } from "./liveTools.js";
9
10
  import { glyphFor, toolKind, KIND_HUE } from "./toolicons.js";
10
11
  import { renderSweepBar } from "./progressbar.js";
@@ -19,7 +20,6 @@ const COLOR = { selected: theme.muted, running: theme.running, done: theme.succe
19
20
  // (never truncated), so you can always read the exact file name / path a tool wrote or read. Order matters:
20
21
  // path-like keys first.
21
22
  const KEY_ARGS = ["path", "file", "filename", "command", "cmd", "pattern", "url", "query", "workspace", "cwd", "name"];
22
- const SHELL_TOOLS = new Set(["bash", "shell_exec", "shell_background"]);
23
23
  /** `link: false` gives the plain text (a live row clips it, and clipping an OSC-8 escape cuts it); `sizes` are a
24
24
  * draft's bulk arguments by their running length, shown where the finished call shows its own. */
25
25
  export function argsPreview(args, opts = {}) {
@@ -65,7 +65,7 @@ export function argsPreview(args, opts = {}) {
65
65
  /** The call's title. A shell call reads as the command itself — "$ ls -la /path" — like a terminal prompt (owner, 10/31:
66
66
  * "bash needs to just show $"); every other tool reads name(args). `note` is the shell call's description, shown dim. */
67
67
  export function stepTitle(step) {
68
- if (SHELL_TOOLS.has(step.name) && typeof step.args?.command === "string") {
68
+ if (SHELL_ANY.has(step.name) && typeof step.args?.command === "string") {
69
69
  const cmd = step.args.command.replace(/\s+/g, " ").trim();
70
70
  const desc = typeof step.args.description === "string" && step.args.description.trim() ? step.args.description.trim() : undefined;
71
71
  return { head: "$", body: cmd.length > 160 ? cmd.slice(0, 157) + "..." : cmd, note: desc };
@@ -74,7 +74,7 @@ export function stepTitle(step) {
74
74
  }
75
75
  /** For shell tools with a description, the command is shown dim beneath the description line. */
76
76
  export function shellCommandHint(step) {
77
- if (!SHELL_TOOLS.has(step.name) || !step.args?.description)
77
+ if (!SHELL_ANY.has(step.name) || !step.args?.description)
78
78
  return null;
79
79
  const cmd = step.args.command;
80
80
  if (typeof cmd !== "string")
@@ -11,6 +11,7 @@ import { SummaryCard } from "./SummaryCard.js";
11
11
  import { StatsCard } from "./StatsCard.js";
12
12
  import { ToolBatch } from "./ToolBatch.js";
13
13
  import { SB_MARK, SB_IN, SB_OUT } from "./brand.js";
14
+ import { beamDrop, beamDropHint, beamDropLine } from "../bus/beam-drop.js";
14
15
  import { termCols, termRows } from "./term.js";
15
16
  import { reportLine } from "./reportLine.js";
16
17
  import { theme } from "./theme.js";
@@ -44,30 +45,36 @@ function entryKey(entry) {
44
45
  // approaches the window height, and the worst moment is the settle transition when this frame is erased.
45
46
  // So cap the live view to a small slice (≤ ~16 rows, less on short terminals): enough to watch the answer
46
47
  // stream, while the full text always renders complete via <Static> once it settles. Pure (dimensions
47
- // passed in) so the bound is unit-testable.
48
- export function liveTail(s, rows, cols) {
48
+ // passed in) so the bound is unit-testable. `budget` (inline mode) is the exact row count the caller measured
49
+ // as free; without it the budget is derived from the terminal height as before (fullscreen).
50
+ export function liveTail(s, rows, cols, budget) {
49
51
  // Clamp degenerate dimensions: a minimized/detached terminal reports 0, and cols=0 divides to
50
52
  // Infinity/NaN below — which walks `start` to 0 and returns the WHOLE message unbounded, ballooning the
51
53
  // dynamic frame and stacking the streaming line into scrollback (the minimize-duplication bug). Guard
52
54
  // here too (not just at the call site) since this is the pure, unit-tested unit — it must not trust its caller.
53
55
  const c = cols > 0 ? cols : 80;
54
- const budget = Math.max(6, Math.min((rows > 0 ? rows : 24) - 14, 16)); // rendered rows the live frame may occupy
56
+ const cap = budget !== undefined ? Math.max(1, budget) : Math.max(6, Math.min((rows > 0 ? rows : 24) - 14, 16)); // rendered rows the live frame may occupy
55
57
  const lines = s.split("\n");
56
58
  // Walk up from the last line, counting the PHYSICAL rows each takes after wrapping, and keep only what
57
59
  // fits the budget — so even all-long-wrapping lines can't push the dynamic frame past the window.
58
60
  let used = 0, start = lines.length;
59
61
  for (let i = lines.length - 1; i >= 0; i--) {
60
62
  const wrapped = Math.max(1, Math.ceil(lines[i].length / c));
61
- if (used + wrapped > budget && start !== lines.length)
63
+ if (used + wrapped > cap && start !== lines.length)
62
64
  break;
63
65
  used += wrapped;
64
66
  start = i;
65
- if (used >= budget)
67
+ if (used >= cap)
66
68
  break;
67
69
  }
70
+ // One streaming paragraph with no newline yet can wrap past the cap on its own: keep its newest rows.
71
+ if (used > cap) {
72
+ const last = lines[lines.length - 1];
73
+ return { text: last.slice(last.length - cap * c), clipped: lines.length - 1, used: cap };
74
+ }
68
75
  if (start <= 0)
69
- return { text: s, clipped: 0 };
70
- return { text: lines.slice(start).join("\n"), clipped: start };
76
+ return { text: s, clipped: 0, used };
77
+ return { text: lines.slice(start).join("\n"), clipped: start, used };
71
78
  }
72
79
  // A Switchboard bus message rendered inline (SPEC §6, Switchboard surface). Static-rendered like any
73
80
  // settled entry, so it's printed once and scrolls with history — anchored to when it arrived/was sent,
@@ -88,6 +95,10 @@ function hhmm(at) {
88
95
  }
89
96
  function BusCard({ entry }) {
90
97
  const { msg, direction, at } = entry;
98
+ const drop = direction === "in" ? beamDrop(msg) : null;
99
+ if (drop) {
100
+ return (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: "cyan", children: [beamDropLine(drop), _jsx(Text, { dimColor: true, children: ` ${beamDropHint(drop)} · ${hhmm(at)}` })] }) }));
101
+ }
91
102
  const who = direction === "in" ? msg.from : msg.to;
92
103
  const arrow = direction === "in" ? SB_IN : SB_OUT;
93
104
  const lead = direction === "in" ? "" : "sent · ";
@@ -113,7 +124,7 @@ function ReportRow({ agent }) {
113
124
  const name = body.split(" · ")[0];
114
125
  return (_jsxs(Text, { children: [_jsx(Text, { color: tone === "done" ? theme.success : tone === "stopped" ? theme.blocked : theme.error, children: line.slice(0, 2) }), _jsx(Text, { bold: true, children: name }), _jsx(Text, { dimColor: true, children: body.slice(name.length) }), hint ? _jsx(Text, { color: theme.info, children: hint }) : null] }));
115
126
  }
116
- function renderEntry(entry, live = false) {
127
+ function renderEntry(entry, live = false, liveRows) {
117
128
  if (entry.kind === "summary")
118
129
  return _jsx(SummaryCard, { summary: entry.summary });
119
130
  if (entry.kind === "report")
@@ -142,13 +153,29 @@ function renderEntry(entry, live = false) {
142
153
  // process through the WHOLE workflow, not just the gap before the answer starts. Before the answer begins,
143
154
  // reasoning tails the full window; once the answer is streaming, reasoning keeps showing at lower opacity in
144
155
  // a small reserved band above it, and the answer stays primary.
156
+ // Inline mode passes liveRows: the rows the rest of the dynamic frame leaves free (App measures them). Every
157
+ // row of this block (both clip notices and the bottom margin) is then counted against it, so the frame stays
158
+ // under the terminal height. Ink clears the whole screen and repaints all history on every render once it
159
+ // reaches it, which is the inline flicker.
145
160
  const rows = termRows(), cols = termCols();
146
161
  const hasAnswer = !!message.content;
147
162
  const reasoning = message.reasoning ?? "";
148
- const rRows = hasAnswer ? Math.min(6, Math.max(0, Math.floor(rows / 3))) : rows; // dim band capped small once the answer is flowing
149
- const r = reasoning && rRows > 0 ? liveTail(reasoning, rRows, cols) : null;
150
- const aRows = Math.max(1, rows - (r ? rRows + 1 : 0)); // answer gets the remaining height (−1 for the band's clip notice)
151
- const a = hasAnswer ? liveTail(message.content, aRows, cols) : null;
163
+ let r, a;
164
+ if (liveRows !== undefined) {
165
+ const room = liveRows - 1; // −1: this block's marginBottom
166
+ if (room < 2)
167
+ return null; // the panels below fill the window: the answer shows in full once it settles
168
+ const rBudget = (hasAnswer ? Math.min(6, Math.floor(room / 3)) : room) - 1; // −1: the band's clip notice
169
+ r = reasoning && rBudget >= 1 ? liveTail(reasoning, 0, cols, rBudget) : null;
170
+ const aBudget = room - (r ? r.used + (r.clipped > 0 ? 1 : 0) : 0) - 1; // −1: the answer's clip notice
171
+ a = hasAnswer && aBudget >= 1 ? liveTail(message.content, 0, cols, aBudget) : null;
172
+ }
173
+ else {
174
+ const rRows = hasAnswer ? Math.min(6, Math.max(0, Math.floor(rows / 3))) : rows; // dim band capped small once the answer is flowing
175
+ r = reasoning && rRows > 0 ? liveTail(reasoning, rRows, cols) : null;
176
+ const aRows = Math.max(1, rows - (r ? rRows + 1 : 0)); // answer gets the remaining height (−1 for the band's clip notice)
177
+ a = hasAnswer ? liveTail(message.content, aRows, cols) : null;
178
+ }
152
179
  if (!r && !a)
153
180
  return _jsx(Box, { marginBottom: 1 });
154
181
  return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [r && r.clipped > 0 ? _jsx(Text, { dimColor: true, children: `⋯ +${r.clipped} more thinking line${r.clipped === 1 ? "" : "s"} above` }) : null, r ? _jsx(Text, { dimColor: true, children: r.text }) : null, a && a.clipped > 0 ? _jsx(Text, { dimColor: true, children: `⋯ +${a.clipped} more line${a.clipped === 1 ? "" : "s"} above (full text shown when complete)` }) : null, a ? _jsx(Text, { children: a.text }) : null] }));
@@ -170,7 +197,7 @@ function renderEntry(entry, live = false) {
170
197
  const TranscriptRow = React.memo(function TranscriptRow({ entry }) {
171
198
  return _jsx(Box, { children: renderEntry(entry) });
172
199
  });
173
- export function Transcript({ entries, live, bounded, scrollBack = 0 }) {
200
+ export function Transcript({ entries, live, bounded, scrollBack = 0, liveRows }) {
174
201
  if (bounded) {
175
202
  // Fullscreen: no <Static>; render a wheel-scrollable window as a plain column the parent clips +
176
203
  // bottom-anchors. scrollBack (from MouseProvider wheel events, via App) slides the window back through
@@ -182,5 +209,5 @@ export function Transcript({ entries, live, bounded, scrollBack = 0 }) {
182
209
  ? _jsx(Text, { dimColor: true, children: `⋯ ${newerOff} newer line(s) below — scroll down (new output jumps here)` })
183
210
  : (live ? _jsx(Box, { children: renderEntry(live, true) }) : null)] }));
184
211
  }
185
- return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: entries, children: (entry) => _jsx(Box, { children: renderEntry(entry) }, entryKey(entry)) }), live ? _jsx(Box, { children: renderEntry(live, true) }) : null] }));
212
+ return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Static, { items: entries, children: (entry) => _jsx(Box, { children: renderEntry(entry) }, entryKey(entry)) }), live ? _jsx(Box, { children: renderEntry(live, true, liveRows) }) : null] }));
186
213
  }
@@ -9,7 +9,7 @@ import { computeEditDiff } from "./editdiff.js";
9
9
  import { fitSegments, seg } from "./fit.js";
10
10
  import { fmtTok } from "./format.js";
11
11
  import { humanStep } from "./BgPanel.js";
12
- const SHELL_TOOLS = new Set(["bash", "shell_exec", "shell_background"]);
12
+ import { SHELL_ANY } from "../tools/classes.js";
13
13
  const PATH_KEYS = ["path", "file", "filename"];
14
14
  /** A row's time: sub-second precision while short ("80ms", "1.1s"), minutes past one ("2m 13s"). */
15
15
  const rowTime = (ms) => (ms < 60_000 ? formatDuration(ms) : fmtElapsed(ms));
@@ -53,7 +53,7 @@ function tail(step, now) {
53
53
  export function liveRow(step, cols, now = Date.now()) {
54
54
  const t = tail(step, now);
55
55
  const max = cols - 1 - 4; // paddingLeft + the status glyph (counted wide, as cellWidth does) + space
56
- const shell = SHELL_TOOLS.has(step.name) && typeof step.args?.command === "string";
56
+ const shell = SHELL_ANY.has(step.name) && typeof step.args?.command === "string";
57
57
  const head = shell ? "$" : truncateToWidth(step.name, Math.max(1, Math.min(max - 2, Math.max(12, Math.floor(max * 0.6)))));
58
58
  const args = step.args ?? {};
59
59
  if (step.name === "delegate_task" && typeof args.task === "string") { // its title is the task the specialist works on
@@ -127,7 +127,7 @@ export function chipOf(step) {
127
127
  const glyph = tone === "done" ? "✓" : tone === "error" ? "✗" : "⊘";
128
128
  const path = PATH_KEYS.map((k) => a[k]).find((v) => typeof v === "string");
129
129
  let label;
130
- if (SHELL_TOOLS.has(step.name) && typeof a.command === "string")
130
+ if (SHELL_ANY.has(step.name) && typeof a.command === "string")
131
131
  label = words(a.command, 2);
132
132
  else if (/grep|search|find|glob/.test(step.name) && typeof (a.pattern ?? a.query) === "string")
133
133
  label = `${/find|glob/.test(step.name) ? "find" : "grep"} "${String(a.pattern ?? a.query).slice(0, 24)}"`;
@@ -141,7 +141,7 @@ export function chipOf(step) {
141
141
  label = step.name;
142
142
  const tail = step.outcome === "blocked" ? "blocked" : step.outcome === "cancelled" ? "cancelled"
143
143
  : step.exitCode !== undefined ? `exit ${step.exitCode}`
144
- : (() => { const d = step.status === "done" ? computeEditDiff(step.name, step.args) : undefined; return d ? `+${d.added} -${d.removed}` : step.lines && !SHELL_TOOLS.has(step.name) ? String(step.lines) : ""; })();
144
+ : (() => { const d = step.status === "done" ? computeEditDiff(step.name, step.args) : undefined; return d ? `+${d.added} -${d.removed}` : step.lines && !SHELL_ANY.has(step.name) ? String(step.lines) : ""; })();
145
145
  return { tone, glyph, label: tail ? `${label} ${tail}` : label, name: step.name };
146
146
  }
147
147
  /** The chip line: "⇉ 4 calls · 3.4s", then chips while they fit in cols−1, the rest folded into "+3 ✓ +1 ✗", then the
@@ -1,7 +1,5 @@
1
1
  const MAX_PREVIEW_LINES = 4;
2
2
  const MAX_LINE_WIDTH = 100; // a single preview line is truncated, never left to wrap/flood the row
3
- const EDIT_TOOL_NAMES = new Set(["file_edit", "multi_edit"]);
4
- const WRITE_TOOL_NAMES = new Set(["file_write"]);
5
3
  function splitLines(s) {
6
4
  return s === "" ? [] : s.split("\n");
7
5
  }
@@ -54,7 +52,7 @@ function lineDiff(oldLines, newLines) {
54
52
  export function computeEditDiff(name, args) {
55
53
  if (!args)
56
54
  return undefined;
57
- if (EDIT_TOOL_NAMES.has(name)) {
55
+ if (name === "file_edit") {
58
56
  const oldStr = args.old_string;
59
57
  const newStr = args.new_string;
60
58
  if (typeof oldStr !== "string" || typeof newStr !== "string")
@@ -67,7 +65,7 @@ export function computeEditDiff(name, args) {
67
65
  const preview = script.length <= MAX_PREVIEW_LINES ? script.map((l) => ({ kind: l.kind, text: truncateLine(l.text) })) : undefined;
68
66
  return { added, removed, preview };
69
67
  }
70
- if (WRITE_TOOL_NAMES.has(name)) {
68
+ if (name === "file_write") {
71
69
  const content = args.content;
72
70
  if (typeof content !== "string")
73
71
  return undefined;
package/dist/ui/format.js CHANGED
@@ -28,26 +28,10 @@ export function fmtTok(n) {
28
28
  return `${Math.round(v / 1000)}k`;
29
29
  return `${(v / 1_000_000).toFixed(1)}M`;
30
30
  }
31
- export function toolOutcome(result, refused) {
32
- if (refused)
33
- return refused;
34
- const s = result.trim();
35
- if (/^(error|loop guard|\[interrupted|\[timed out)/i.test(s))
36
- return "fail";
37
- const exit = exitCode(s);
38
- if ((exit !== undefined && exit !== 0) || /^\(no output; exit \?\)/.test(s))
39
- return "fail";
40
- if (/\n\[timed out after [^\n]*\]$/.test(s))
41
- return "fail";
42
- return "ok";
43
- }
44
- /** A shell call's exit code from its result (registry.ts shellExec), or undefined: output then an `[exit N]` line —
45
- * which shellResultNotes' `[note: …]`/`[hint: …]` lines and the result guard's notes may follow — or, for a command
46
- * that printed nothing, `(no output; exit N)`. */
47
- export function exitCode(result) {
48
- const m = /(?:^|\n)\[exit (\d+)\](?:\n+\[[^\n]*\])*\s*$/.exec(result) ?? /^\s*\(no output; exit (\d+)\)/.exec(result);
49
- return m ? Number(m[1]) : undefined;
50
- }
31
+ // How a tool call ended (ok · fail · blocked · cancelled) and a shell result's exit code: one reading for the
32
+ // transcript, the live rows, the fold, the editor adapter and the loop guard (tools/classes.ts).
33
+ export { toolOutcome, exitCode } from "../tools/classes.js";
34
+ import { toolOutcome } from "../tools/classes.js";
51
35
  // A tool result reads as an error/loop-guard/interrupt sentinel rather than real output — shared by the
52
36
  // settled-transcript push (cli.tsx) and the live per-call row update (ui/liveTools.ts) so both classify
53
37
  // a result the same way.
@@ -1,4 +1,5 @@
1
1
  import { settledFields } from "./fold.js";
2
+ import { SHELL_FOREGROUND } from "../tools/classes.js";
2
3
  // Bulky payloads — never dumped (they'd bury the path and blow up the line); shown as a size instead.
3
4
  export const BULK_ARGS = ["content", "text", "body", "data", "new_string", "old_string", "diff", "message"];
4
5
  const BULK = new Set(BULK_ARGS);
@@ -168,11 +169,10 @@ export function settleLiveTool(rows, id, result, now = Date.now(), refused) {
168
169
  });
169
170
  return changed ? next : rows;
170
171
  }
171
- const SHELL_TOOLS = new Set(["bash", "shell_exec"]);
172
172
  export const BACKGROUND_HINT_AFTER_MS = 2000;
173
173
  /** Inline per-row variant of the hint, under the running command itself (matches Claude Code). */
174
174
  export function rowBackgroundHint(step, now = Date.now(), inTmux = !!process.env.TMUX) {
175
- if (!SHELL_TOOLS.has(step.name) || step.status !== "running")
175
+ if (!SHELL_FOREGROUND.has(step.name) || step.status !== "running")
176
176
  return null;
177
177
  if (now - (step.startedAt ?? now) <= BACKGROUND_HINT_AFTER_MS)
178
178
  return null;
@@ -182,7 +182,7 @@ export function rowBackgroundHint(step, now = Date.now(), inTmux = !!process.env
182
182
  * shell command has run past the threshold. Inside tmux ctrl+b is the prefix key, so the first press is
183
183
  * swallowed by tmux: say "twice", and name the alias key that has no such clash. */
184
184
  export function backgroundHint(rows, now = Date.now(), inTmux = !!process.env.TMUX) {
185
- const slow = rows.some((r) => SHELL_TOOLS.has(r.name) && r.status === "running" && now - (r.startedAt ?? now) > BACKGROUND_HINT_AFTER_MS);
185
+ const slow = rows.some((r) => SHELL_FOREGROUND.has(r.name) && r.status === "running" && now - (r.startedAt ?? now) > BACKGROUND_HINT_AFTER_MS);
186
186
  if (!slow)
187
187
  return null;
188
188
  return inTmux ? "ctrl+b ctrl+b (tmux) or ctrl+z to run in the background" : "ctrl+b to run in the background";
@@ -10,12 +10,16 @@ import { cellWidth, truncateToWidth } from "./StatusRule.js";
10
10
  import { approxTokens, fmtWait, fmtWhen, readSeconds } from "../router/read-rates.js";
11
11
  /** The last /model row: an action, never a ModelProfile — so the lists fed from the registry (the ACP dropdown, a
12
12
  * follower's model list) can never offer it. */
13
- export const CONNECT_ROW = "+ Connect a provider key (Anthropic, Google, Nous, OpenAI, …)";
13
+ export const CONNECT_ROW = "+ Connect a provider key (Anthropic, Google, OpenAI, …)";
14
14
  /** Presets whose zero-price rows /model lists once their key is connected (router/free-models.ts) — OpenRouter's
15
15
  * `:free` listing joins here. */
16
- export const FREE_ROW_PRESETS = ["operator", "nous"];
17
- /** The /model main rows, in this order (0.1.361); everything else sits behind MORE_ROW. */
18
- export const MAIN_MODEL_IDS = ["operator-flash", "kimi-linear-48b", "operator-dense"];
16
+ export const FREE_ROW_PRESETS = ["operator"];
17
+ /** Sign-in providers whose rows /model reads from their own /models once signed in (router/provider-models.ts). Unlike
18
+ * 0perator Free they are listed under "+ Connect a provider key", where picking one points at the sign-in. */
19
+ export const PROVIDER_ROW_PRESETS = ["portal"];
20
+ /** The /model main rows, in this order; everything else sits behind MORE_ROW. operator-dense left 2026-11-30 (its
21
+ * gateway route was retired: the registry only offers what is served). */
22
+ export const MAIN_MODEL_IDS = ["operator-flash", "kimi-linear-48b"];
19
23
  /** The last main row: an action that opens the rest (other fleet rows, connected providers, free rows, MOA, connect). */
20
24
  export const MORE_ROW = "More models…";
21
25
  // fleet → connected providers → free rows → MOA. The built-ins already list the local row before the gateway rows.
@@ -128,8 +132,8 @@ export function connectedAccounts(has, presets = BYO_PRESETS) {
128
132
  /** The provider rows, from the presets in their order — never listByoAccounts, which sees only the file tier:
129
133
  * `<label>`, plus " ✓ connected" for an account in `connected`. */
130
134
  export function providerPickerView(connected, presets = BYO_PRESETS) {
131
- const choices = Object.entries(presets).filter(([, p]) => !p.signIn).map(([preset, p]) => ({ preset, p }));
132
- return { rows: choices.map(({ p }) => `${p.label}${connected.has(p.account) ? " ✓ connected" : ""}`), choices };
135
+ const choices = Object.entries(presets).filter(([preset, p]) => !p.signIn || PROVIDER_ROW_PRESETS.includes(preset)).map(([preset, p]) => ({ preset, p }));
136
+ return { rows: choices.map(({ p }) => `${p.label}${connected.has(p.account) ? (p.signIn ? " ✓ signed in" : " ✓ connected") : ""}`), choices };
133
137
  }
134
138
  /** What a QuestionPrompt answer means for a picker whose rows were drawn from `entries`: the row picked (by index), the
135
139
  * owner's typed reply, or null — the empty reply / ctrl+c that resolves DISCUSS is never applied as a choice. */
@@ -0,0 +1,20 @@
1
+ // Team mode shows as "OPS" in the status rule's tier slot. The mode is the flag file `team on|off` writes
2
+ // (~/.axe/nimbus/team, TEAM_FLAG_FILE overrides it). The rule re-renders on every keystroke, so the read is cached
3
+ // for a second; any read failure means off — a missing flag must never break the frame.
4
+ import { readFileSync } from "node:fs";
5
+ import { homedir } from "node:os";
6
+ import { join } from "node:path";
7
+ const TTL_MS = 1000;
8
+ let cached;
9
+ export function opsModeOn(now = Date.now()) {
10
+ const path = process.env.TEAM_FLAG_FILE || join(homedir(), ".axe", "nimbus", "team");
11
+ if (cached && cached.path === path && now - cached.at < TTL_MS)
12
+ return cached.on;
13
+ let on = false;
14
+ try {
15
+ on = readFileSync(path, "utf8").trim() === "on";
16
+ }
17
+ catch { /* off */ }
18
+ cached = { path, at: now, on };
19
+ return on;
20
+ }
package/dist/ui/phase.js CHANGED
@@ -88,8 +88,10 @@ export function phaseLine(v, cols, frame = 0) {
88
88
  const phase = wrote ? [seg([`writing the summary · ${wrote}`, `writing · ${wrote}`], 3, true)]
89
89
  : r && r.done >= r.fresh ? [seg(`summarizer read ${fmtTok(r.fresh)} new`, 4), seg(["writing the summary", "writing"], 3, true)]
90
90
  : r ? [seg([r.cache > 0 ? `summarizer reading ${fmtTok(r.done)} new (${fmtTok(r.cache)} reused)` : `summarizer reading ${fmtTok(r.done)} of ${fmtTok(r.fresh)} new`, `summarizer ${Math.round(r.fraction * 100)}%`], 3)]
91
- : [];
92
- return fit([seg(`compacting ${fmtTok(c.before)} tokens`), ...phase]);
91
+ : c.reading ? [seg(`reading ${fmtTok(c.reading)} new`, 3)]
92
+ : [];
93
+ const covered = c.covered ? [seg([`${fmtTok(c.covered)} already summarized`, `${fmtTok(c.covered)} done`], 2)] : [];
94
+ return fit([seg(`compacting ${fmtTok(c.before)} tokens`), ...covered, ...phase]);
93
95
  }
94
96
  default: // waiting
95
97
  return fit([seg("waiting for the model"), v.expect ? seg(v.expect, 3, true) : seg("nothing back yet", 4)]);
@@ -23,6 +23,7 @@ export const SLASH_COMMANDS = [
23
23
  { name: "agents", description: "detailed sub-agent status: running/queued/done/errored + metrics" },
24
24
  { name: "bg", description: "spawn a background sub-agent, list, or stop one", args: "<task|stop id>" },
25
25
  { name: "jobs", description: "background shell jobs: list, or stop one (ctrl+b moves a running command here)", args: "[stop id]" },
26
+ { name: "voice", description: "voice mode: ctrl+t to talk, the answer is spoken back (esc stops it)", args: "[on|off|status]" },
26
27
  { name: "monitor", description: "toggle the live event stream (tool decisions, turns, control)" },
27
28
  { name: "audit", description: "recent tool + control-plane events from the audit trail", args: "[n]" },
28
29
  { name: "stats", description: "session dashboard: turns · tools · tokens · throughput · context fill" },