synabun 2.4.3 → 2.4.4

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 (153) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +1 -1
  3. package/docs/browser-extension-bridge.md +61 -32
  4. package/mcp-server/dist/http.d.ts.map +1 -1
  5. package/mcp-server/dist/http.js +8 -1
  6. package/mcp-server/dist/http.js.map +1 -1
  7. package/mcp-server/dist/services/identity.d.ts +2 -0
  8. package/mcp-server/dist/services/identity.d.ts.map +1 -1
  9. package/mcp-server/dist/services/identity.js +4 -0
  10. package/mcp-server/dist/services/identity.js.map +1 -1
  11. package/mcp-server/dist/services/memory-client.d.ts +5 -0
  12. package/mcp-server/dist/services/memory-client.d.ts.map +1 -1
  13. package/mcp-server/dist/services/memory-client.js +21 -2
  14. package/mcp-server/dist/services/memory-client.js.map +1 -1
  15. package/mcp-server/dist/services/memory-writer.d.ts +3 -0
  16. package/mcp-server/dist/services/memory-writer.d.ts.map +1 -1
  17. package/mcp-server/dist/services/memory-writer.js +7 -1
  18. package/mcp-server/dist/services/memory-writer.js.map +1 -1
  19. package/mcp-server/dist/services/neural-interface.d.ts +11 -1
  20. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  21. package/mcp-server/dist/services/neural-interface.js +67 -17
  22. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  23. package/mcp-server/dist/services/typesafe-config.d.ts +38 -2
  24. package/mcp-server/dist/services/typesafe-config.d.ts.map +1 -1
  25. package/mcp-server/dist/services/typesafe-config.js +260 -8
  26. package/mcp-server/dist/services/typesafe-config.js.map +1 -1
  27. package/mcp-server/dist/tools/agent-definition.d.ts +2 -2
  28. package/mcp-server/dist/tools/agents.d.ts +3 -1
  29. package/mcp-server/dist/tools/agents.d.ts.map +1 -1
  30. package/mcp-server/dist/tools/agents.js +11 -6
  31. package/mcp-server/dist/tools/agents.js.map +1 -1
  32. package/mcp-server/dist/tools/browser-observe.d.ts +11 -0
  33. package/mcp-server/dist/tools/browser-observe.d.ts.map +1 -1
  34. package/mcp-server/dist/tools/browser-observe.js +113 -27
  35. package/mcp-server/dist/tools/browser-observe.js.map +1 -1
  36. package/mcp-server/dist/tools/browser-readers.d.ts +6 -0
  37. package/mcp-server/dist/tools/browser-readers.d.ts.map +1 -0
  38. package/mcp-server/dist/tools/browser-readers.js +17 -0
  39. package/mcp-server/dist/tools/browser-readers.js.map +1 -0
  40. package/mcp-server/dist/tools/remember.d.ts.map +1 -1
  41. package/mcp-server/dist/tools/remember.js +6 -2
  42. package/mcp-server/dist/tools/remember.js.map +1 -1
  43. package/mcp-server/dist/tools/youtube/analytics.d.ts +4 -0
  44. package/mcp-server/dist/tools/youtube/analytics.d.ts.map +1 -1
  45. package/mcp-server/dist/tools/youtube/analytics.js +25 -20
  46. package/mcp-server/dist/tools/youtube/analytics.js.map +1 -1
  47. package/mcp-server/dist/tools/youtube/helpers.d.ts +5 -1
  48. package/mcp-server/dist/tools/youtube/helpers.d.ts.map +1 -1
  49. package/mcp-server/dist/tools/youtube/helpers.js +7 -3
  50. package/mcp-server/dist/tools/youtube/helpers.js.map +1 -1
  51. package/mcp-server/dist/tools/youtube/navigate.d.ts +2 -0
  52. package/mcp-server/dist/tools/youtube/navigate.d.ts.map +1 -1
  53. package/mcp-server/dist/tools/youtube/navigate.js +5 -3
  54. package/mcp-server/dist/tools/youtube/navigate.js.map +1 -1
  55. package/mcp-server/dist/tools/youtube/playlist.js +2 -2
  56. package/mcp-server/dist/tools/youtube/playlist.js.map +1 -1
  57. package/mcp-server/dist/tools/youtube/readers.d.ts +4 -0
  58. package/mcp-server/dist/tools/youtube/readers.d.ts.map +1 -0
  59. package/mcp-server/dist/tools/youtube/readers.js +15 -0
  60. package/mcp-server/dist/tools/youtube/readers.js.map +1 -0
  61. package/mcp-server/package-lock.json +2 -2
  62. package/mcp-server/package.json +1 -1
  63. package/mcp-server/src/http.ts +8 -1
  64. package/mcp-server/src/services/identity.ts +5 -0
  65. package/mcp-server/src/services/memory-client.ts +32 -12
  66. package/mcp-server/src/services/memory-writer.ts +5 -2
  67. package/mcp-server/src/services/neural-interface.ts +65 -18
  68. package/mcp-server/src/services/typesafe-config.ts +268 -7
  69. package/mcp-server/src/tools/agents.ts +12 -6
  70. package/mcp-server/src/tools/browser-observe.ts +117 -28
  71. package/mcp-server/src/tools/browser-readers.ts +19 -0
  72. package/mcp-server/src/tools/remember.ts +6 -1
  73. package/mcp-server/src/tools/youtube/analytics.ts +26 -28
  74. package/mcp-server/src/tools/youtube/helpers.ts +8 -2
  75. package/mcp-server/src/tools/youtube/navigate.ts +6 -7
  76. package/mcp-server/src/tools/youtube/playlist.ts +2 -2
  77. package/mcp-server/src/tools/youtube/readers.ts +15 -0
  78. package/neural-interface/i18n/en.json +139 -0
  79. package/neural-interface/i18n/pt-BR.json +139 -0
  80. package/neural-interface/lib/assistant-api.js +90 -0
  81. package/neural-interface/lib/assistant-brains/claude.js +10 -0
  82. package/neural-interface/lib/assistant-dispatch.js +276 -42
  83. package/neural-interface/lib/assistant-memory.js +3 -1
  84. package/neural-interface/lib/assistant-persona.js +6 -0
  85. package/neural-interface/lib/assistant-router.js +18 -8
  86. package/neural-interface/lib/assistant-runtime.js +87 -1
  87. package/neural-interface/lib/assistant-task-prompt.js +15 -2
  88. package/neural-interface/lib/browser-connection-state.js +20 -0
  89. package/neural-interface/lib/browser-extension-adapter.js +221 -15
  90. package/neural-interface/lib/browser-extension-bridge.js +40 -7
  91. package/neural-interface/lib/browser-extension-folder.js +50 -11
  92. package/neural-interface/lib/browser-extension-package.js +6 -5
  93. package/neural-interface/lib/browser-extension-pin.json +15 -13
  94. package/neural-interface/lib/browser-extension-protocol.js +111 -13
  95. package/neural-interface/lib/browser-extension-setup.js +7 -5
  96. package/neural-interface/lib/browser-extension-update.js +104 -0
  97. package/neural-interface/lib/browser-extraction.js +38 -14
  98. package/neural-interface/lib/claude-bg-tasks.js +183 -0
  99. package/neural-interface/lib/claude-history.js +12 -1
  100. package/neural-interface/lib/confined-fs.js +25 -0
  101. package/neural-interface/lib/coordination/operations.js +2 -0
  102. package/neural-interface/lib/db.js +39 -16
  103. package/neural-interface/lib/editor-completion-opencode.js +2 -2
  104. package/neural-interface/lib/git-bash/manager.js +28 -3
  105. package/neural-interface/lib/git-status-runner.js +31 -3
  106. package/neural-interface/lib/loop-inventory.js +162 -0
  107. package/neural-interface/lib/loop-stall.js +74 -4
  108. package/neural-interface/lib/memory-session-capture.js +157 -66
  109. package/neural-interface/lib/native-loop-providers.js +73 -13
  110. package/neural-interface/lib/native-loop-runtime.js +3 -0
  111. package/neural-interface/lib/opencode-protocol.js +4 -2
  112. package/neural-interface/lib/peer-identity.js +62 -16
  113. package/neural-interface/lib/session-cache-builder.js +66 -18
  114. package/neural-interface/lib/session-capture-gate.js +42 -0
  115. package/neural-interface/lib/session-indexer.js +28 -20
  116. package/neural-interface/lib/teams/scheduler.js +3 -2
  117. package/neural-interface/lib/ui-blob-api.js +14 -5
  118. package/neural-interface/lib/ui-blob-store.js +302 -39
  119. package/neural-interface/package-lock.json +2 -2
  120. package/neural-interface/package.json +1 -1
  121. package/neural-interface/public/extension-setup.html +1 -0
  122. package/neural-interface/public/shared/assistant/asst-agents-dock.js +4 -0
  123. package/neural-interface/public/shared/assistant/asst-api.js +42 -0
  124. package/neural-interface/public/shared/assistant/asst-composer.js +85 -12
  125. package/neural-interface/public/shared/assistant/asst-panel.js +285 -10
  126. package/neural-interface/public/shared/assistant/asst-render.js +205 -4
  127. package/neural-interface/public/shared/assistant/asst-scenes.js +12 -0
  128. package/neural-interface/public/shared/assistant/asst-sidepanel.js +18 -1
  129. package/neural-interface/public/shared/assistant/asst-state.js +241 -2
  130. package/neural-interface/public/shared/assistant/asst-steer.js +294 -0
  131. package/neural-interface/public/shared/assistant/asst-styles.js +20 -0
  132. package/neural-interface/public/shared/bg-tasks/bg-tasks-claude.js +147 -0
  133. package/neural-interface/public/shared/bg-tasks/bg-tasks-model.js +527 -0
  134. package/neural-interface/public/shared/bg-tasks/bg-tasks-panel.js +161 -0
  135. package/neural-interface/public/shared/bg-tasks/bg-tasks-view.js +508 -0
  136. package/neural-interface/public/shared/browser-extension-updates.js +88 -0
  137. package/neural-interface/public/shared/cp/cp-bg-tasks.js +130 -0
  138. package/neural-interface/public/shared/extension-setup/es-page.js +18 -11
  139. package/neural-interface/public/shared/extension-update-view.js +34 -0
  140. package/neural-interface/public/shared/ocp-v2/ocp-v2-shell-logic.js +8 -4
  141. package/neural-interface/public/shared/settings/settings-browser-extension.js +10 -4
  142. package/neural-interface/public/shared/settings/settings-extension-update.js +114 -0
  143. package/neural-interface/public/shared/styles.css +4 -0
  144. package/neural-interface/public/shared/ui-claude-panel.js +110 -1
  145. package/neural-interface/public/shared/ui-notifications.js +23 -4
  146. package/neural-interface/public/shared/ui-settings-entry.js +6 -0
  147. package/neural-interface/public/shared/ui-tray-columns.js +9 -2
  148. package/neural-interface/public/shared/worker-end.js +18 -0
  149. package/neural-interface/scripts/patch-node-pty.mjs +151 -0
  150. package/neural-interface/scripts/rebuild-pty.js +10 -0
  151. package/neural-interface/server.js +483 -280
  152. package/npm-shrinkwrap.json +2 -2
  153. package/package.json +1 -1
@@ -470,7 +470,8 @@ export function mergeRunDescriptor(current, next) {
470
470
  out.costUsd = Math.max(Number.isFinite(costA) ? costA : 0, Number.isFinite(costB) ? costB : 0);
471
471
  }
472
472
  if (!out.title && (a.title || b.title)) out.title = a.title || b.title;
473
- return out;
473
+ // A run this panel steered keeps saying so until the steer's turn shows output (settleSteering, at the end of this file).
474
+ return settleSteering(out, next, { previous: a });
474
475
  }
475
476
 
476
477
  function stripUndefined(obj) {
@@ -1048,6 +1049,14 @@ export function compactUsageView(view) {
1048
1049
  };
1049
1050
  }
1050
1051
 
1052
+ /** Whether a usage view can be shown: a task with an id and an exact total, or no task and a session headline. */
1053
+ export function usagePacketValid(packet) {
1054
+ const count = (n) => Number.isSafeInteger(n) && n >= 0;
1055
+ // A session with no task yet (the view a socket gets when it attaches before the first prompt) has its headline only.
1056
+ if (packet?.task == null) return count(packet?.session?.tokens?.total);
1057
+ return !!packet.task.id && count(packet.task.tokens?.total);
1058
+ }
1059
+
1051
1060
  /**
1052
1061
  * Apply server usage. A view computed earlier than the one shown never replaces it: the
1053
1062
  * session's settled tokens only grow, so fewer of them means an older view (see
@@ -1055,7 +1064,7 @@ export function compactUsageView(view) {
1055
1064
  */
1056
1065
  export function applyUsagePacket(state, packet) {
1057
1066
  const view = packet?.type === 'assistant:usage' ? packet : { ...packet, type: 'assistant:usage' };
1058
- if (view.sessionId !== state.sessionId || !view.task?.id || !Number.isSafeInteger(view.task?.tokens?.total) || view.task.tokens.total < 0) return false;
1067
+ if (view.sessionId !== state.sessionId || !usagePacketValid(view)) return false;
1059
1068
  if (usagePacketIsStale(state.usageView, view)) return false;
1060
1069
  state.usageView = view;
1061
1070
  return true;
@@ -1132,3 +1141,233 @@ export function runFromPayload(payload) {
1132
1141
  if (payload.runId) return normalizeRunDescriptor(payload);
1133
1142
  return null;
1134
1143
  }
1144
+
1145
+ // ── Steer: what the panel draws with from the first frame ─────────────────
1146
+ // The sentences, the composer's keys, the target chip and the run's steering
1147
+ // mark (settled at every merge, mergeRunDescriptor). The steer itself (the
1148
+ // controller, its POST, the notices) is asst-steer.js, which the panel loads
1149
+ // on demand; it re-exports these names, so either module answers for them.
1150
+ // STEER_COPY holds the English and Portuguese of every sentence; the page's
1151
+ // translator (`assistant.steer.*`) wins when it has the key.
1152
+
1153
+ export const STEER_COPY = Object.freeze({
1154
+ en: Object.freeze({
1155
+ steer: 'Steer',
1156
+ steerNow: 'Steer now (Enter): stop this turn and send',
1157
+ queue: 'Queue',
1158
+ queueTip: 'Queue instead (Alt+Enter): send when this turn finishes',
1159
+ notice: 'Steered: {text}',
1160
+ noticeRun: 'Steered {run}: {text}',
1161
+ steering: 'Steering…',
1162
+ steeringChip: 'steering…',
1163
+ runSteer: 'Steer this run',
1164
+ runSteerPlaceholder: 'Tell this agent what to change…',
1165
+ runSteerSend: 'Send steer',
1166
+ runSteerCancel: 'Cancel',
1167
+ useComposer: 'Write it in the composer',
1168
+ targetChip: '→ #{n} {title}',
1169
+ targetLabel: 'Steering run {title}',
1170
+ targetClear: 'Send to the Assistant instead',
1171
+ targetPlaceholder: 'Steer {title}: what should change?',
1172
+ runEnded: 'That run already ended.',
1173
+ sendToAssistant: 'Send it to the Assistant',
1174
+ failed: 'Could not steer: {error}',
1175
+ unavailable: 'Steering needs a server restart; your message was queued.',
1176
+ emptyText: 'Type what should change first.',
1177
+ }),
1178
+ 'pt-BR': Object.freeze({
1179
+ steer: 'Redirecionar',
1180
+ steerNow: 'Redirecionar agora (Enter): parar este turno e enviar',
1181
+ queue: 'Na fila',
1182
+ queueTip: 'Pôr na fila (Alt+Enter): enviar quando este turno terminar',
1183
+ notice: 'Redirecionado: {text}',
1184
+ noticeRun: '{run} redirecionado: {text}',
1185
+ steering: 'Redirecionando…',
1186
+ steeringChip: 'redirecionando…',
1187
+ runSteer: 'Redirecionar esta execução',
1188
+ runSteerPlaceholder: 'Diga a este agente o que mudar…',
1189
+ runSteerSend: 'Enviar redirecionamento',
1190
+ runSteerCancel: 'Cancelar',
1191
+ useComposer: 'Escrever no campo de mensagem',
1192
+ targetChip: '→ #{n} {title}',
1193
+ targetLabel: 'Redirecionando a execução {title}',
1194
+ targetClear: 'Enviar ao Assistente',
1195
+ targetPlaceholder: 'Redirecionar {title}: o que deve mudar?',
1196
+ runEnded: 'Essa execução já terminou.',
1197
+ sendToAssistant: 'Enviar ao Assistente',
1198
+ failed: 'Não foi possível redirecionar: {error}',
1199
+ unavailable: 'Redirecionar precisa reiniciar o servidor; sua mensagem entrou na fila.',
1200
+ emptyText: 'Escreva primeiro o que deve mudar.',
1201
+ }),
1202
+ });
1203
+
1204
+ const steerFill = (text, params) => String(text).replace(/\{(\w+)\}/g, (whole, k) => (params && params[k] != null ? params[k] : whole));
1205
+
1206
+ /**
1207
+ * A translator for the steer sentences: the page's `assistant.steer.<key>` when it has one, else STEER_COPY in
1208
+ * `locale` (Portuguese for any pt locale), else the English.
1209
+ */
1210
+ export function steerTranslator(pageT = null, locale = 'en') {
1211
+ const table = /^pt/i.test(String(locale || '')) ? STEER_COPY['pt-BR'] : STEER_COPY.en;
1212
+ return (key, params) => {
1213
+ const full = `assistant.steer.${key}`;
1214
+ const v = typeof pageT === 'function' ? pageT(full, params) : undefined;
1215
+ if (typeof v === 'string' && v && v !== full) return v;
1216
+ return steerFill(table[key] ?? STEER_COPY.en[key] ?? key, params);
1217
+ };
1218
+ }
1219
+
1220
+ /**
1221
+ * What a key press in the composer means: 'steer' (Enter while the Assistant works, or while a run is targeted),
1222
+ * 'queue' (Alt+Enter while it works), 'send' (Enter otherwise), or null (not a send key: Shift+Enter is a newline,
1223
+ * an IME composition is still typing).
1224
+ */
1225
+ export function composerKeyIntent(e, { running = false, targeted = false, steerable = true } = {}) {
1226
+ if (!e || e.key !== 'Enter' || e.shiftKey || e.isComposing) return null;
1227
+ if (targeted) return 'steer';
1228
+ if (!running) return 'send';
1229
+ if (e.altKey) return 'queue';
1230
+ return steerable ? 'steer' : 'queue';
1231
+ }
1232
+
1233
+ /**
1234
+ * Whether a steer notice gets the transcript's break (an `.asst-divider`) in front of it: only when the steer cut the
1235
+ * Assistant's own reply (`cut`), and that reply is what came last before the notice (status rows such as "Aborted."
1236
+ * between them do not count). `prevKinds` are the classes of the rows above, nearest first: 'assistant', 'status',
1237
+ * 'divider', 'user', 'route' (a usage / automation / route line), 'other'. A normal turn, a worker's steer and a notice after a break already drawn get none.
1238
+ */
1239
+ export function steerBreakBefore({ kind = 'steer', cut = false, prevKinds = [] } = {}) {
1240
+ if (kind !== 'steer' || !cut) return false;
1241
+ for (const k of prevKinds) {
1242
+ // "Interrupted." and the cut turn's usage / automation line sit between its reply and the notice.
1243
+ if (k === 'status' || k === 'route') continue;
1244
+ return k === 'assistant';
1245
+ }
1246
+ return false;
1247
+ }
1248
+
1249
+ /** A turn (or a result, a run end) that ended because it was steered: never "Task complete", never a failure. */
1250
+ export function isSteeredEnd(value) {
1251
+ if (!value || typeof value !== 'object') return false;
1252
+ const reasons = [value.reason, value.turnEndReason, value.endReason, value.stopReason, value.lastTurn?.reason, value.lastResult?.reason, value.result?.reason, value.subtype];
1253
+ return reasons.some((r) => r === 'steered');
1254
+ }
1255
+
1256
+ /** The run is between its interrupted turn and the steer's turn: the card says "Steering…". */
1257
+ export function isSteering(run) {
1258
+ if (!run || typeof run !== 'object') return false;
1259
+ if (STEER_TERMINAL.has(String(run.status || '')) || STEER_TERMINAL.has(String(run.state || ''))) return false;
1260
+ return run.steering === true;
1261
+ }
1262
+
1263
+ const STEER_TERMINAL = new Set(['completed', 'failed', 'stopped', 'interrupted', 'cancelled', 'canceled', 'removed']);
1264
+
1265
+ /** The transcript line where a turn was cut: "Steered: <text>" (one line, clipped). Live and on replay. */
1266
+ export function steerNoticeText(text, t = steerTranslator(), { run = '' } = {}) {
1267
+ const flat = String(text ?? '').replace(/\s+/g, ' ').trim();
1268
+ const clipped = flat.length > 160 ? `${flat.slice(0, 159).trimEnd()}…` : flat;
1269
+ return run ? t('noticeRun', { run, text: clipped }) : t('notice', { text: clipped });
1270
+ }
1271
+
1272
+ /** The line the runtime puts above a steer of the brain's own turn (lib/assistant-runtime.js STEER_BRAIN_LINE). */
1273
+ export const STEER_BRAIN_LINE = '[SynaBun Steer] The user interrupted your current turn to change it:';
1274
+
1275
+ /** A prompt the runtime sent for a steer → the user's words (the model's line taken off), else null. */
1276
+ export function steerPromptText(text) {
1277
+ const value = String(text ?? '');
1278
+ if (!value.startsWith(STEER_BRAIN_LINE)) return null;
1279
+ return value.slice(STEER_BRAIN_LINE.length).replace(/^\s*\n?/, '').trim();
1280
+ }
1281
+
1282
+ /** The longest a run says "Steering…": whatever the panel hears or misses, the mark never stays longer. */
1283
+ export const STEER_MARK_MAX_MS = 30_000;
1284
+
1285
+ /** The run's token count as the card shows it (usage packets first), or null. */
1286
+ export function steerTokensOf(run) {
1287
+ const total = Number(run?.usageTokens?.total ?? run?.tokens?.total);
1288
+ return Number.isFinite(total) && total >= 0 ? total : null;
1289
+ }
1290
+
1291
+ /** The patch that takes a run's "Steering…" away (steeredAt null: a later merge never brings the mark back). */
1292
+ export const STEER_CLEARED = Object.freeze({ steering: false, steeredAt: null, steerTurnStarted: false });
1293
+
1294
+ /**
1295
+ * After a descriptor merged into a run the panel marked steering: is the steer's turn showing anything yet? Only
1296
+ * then does the mark go, so "Steering…" is seen: the steer's turn starts well under a second after the steer.
1297
+ * The steer's turn has STARTED on the server's `steering: false`, a turn_started, a turn start after the mark or a
1298
+ * higher currentIteration (the mark then records `steerTurnStarted` and the tokens at that moment); once started, the
1299
+ * mark goes when the run's tokens grow past that count (the panel's controller also takes it away at the turn's
1300
+ * first text, call or activity: onRunOutput). It always goes when the run ends and STEER_MARK_MAX_MS after the
1301
+ * steer. `previous` is the run before the merge: the server's own `steering: false` overwrote the mark in `merged`,
1302
+ * and a mark the panel made (its steeredAt) is held through it. A patch that names `steeredAt` itself (STEER_CLEARED)
1303
+ * is the panel's own word. A mark without a steeredAt (another window's, seen in a descriptor) follows the server.
1304
+ * Returns the run to keep (the same object when nothing changes).
1305
+ */
1306
+ export function settleSteering(merged, update = null, { previous = null, now = Date.now() } = {}) {
1307
+ if (!merged) return merged;
1308
+ const u = update && typeof update === 'object' ? update : {};
1309
+ const terminal = (run) => STEER_TERMINAL.has(String(run?.status || '')) || STEER_TERMINAL.has(String(run?.state || ''));
1310
+ let out = merged;
1311
+ if (out.steering !== true && previous?.steering === true && previous.steeredAt && u.steeredAt === undefined && !terminal(out)) {
1312
+ out = {
1313
+ ...out, steering: true, steeredAt: previous.steeredAt, steerText: previous.steerText, steerIteration: previous.steerIteration,
1314
+ steerTokens: previous.steerTokens ?? null, steerTurnStarted: previous.steerTurnStarted === true,
1315
+ };
1316
+ }
1317
+ if (out.steering !== true) return out;
1318
+ const clear = () => ({ ...out, ...STEER_CLEARED });
1319
+ if (terminal(out)) return clear();
1320
+ const markAt = Date.parse(out.steeredAt || '') || 0;
1321
+ if (!markAt) return u.steering === false ? clear() : out;
1322
+ if (now - markAt > STEER_MARK_MAX_MS) return clear();
1323
+ const turnAt = Date.parse(u.turnStartedAt || u.lastTurnStartedAt || '') || 0;
1324
+ const base = Number(out.steerIteration);
1325
+ const iteration = Number(u.currentIteration);
1326
+ const startsNow = u.steering === false || u.type === 'turn_started' || u.event === 'turn_started' || u.reason === 'turn_started'
1327
+ || (turnAt > markAt) || (Number.isFinite(base) && Number.isFinite(iteration) && iteration > base);
1328
+ if (out.steerTurnStarted !== true) {
1329
+ if (!startsNow) return out;
1330
+ // The tokens the cut turn booked so far are not the steer's turn's output: counted from here.
1331
+ return { ...out, steerTurnStarted: true, steerTokens: steerTokensOf(out) ?? out.steerTokens ?? null };
1332
+ }
1333
+ const tokens = steerTokensOf(out);
1334
+ const at = Number(out.steerTokens);
1335
+ if (tokens !== null && Number.isFinite(at) && tokens > at) return clear();
1336
+ return out;
1337
+ }
1338
+
1339
+ /**
1340
+ * Whether a worker's provider event is output of its turn (text, a call, thinking): what ends "Steering…" once the
1341
+ * steer's turn has started. `activity` is what activityOf (asst-scenes.js) found in it, when the caller has it.
1342
+ */
1343
+ export function isRunOutputEvent(payload, activity = null) {
1344
+ if (activity) return true;
1345
+ const event = payload?.event && typeof payload.event === 'object' ? payload.event : null;
1346
+ if (!event) return false;
1347
+ const type = String(payload.eventType || event.type || '');
1348
+ if (event.type === 'assistant') return Array.isArray(event.message?.content) && event.message.content.length > 0; // Claude Code
1349
+ if (event.type === 'stream_event') return /delta|content_block_start/.test(String(event.event?.type || ''));
1350
+ if (/^item\.(started|updated|completed)$/.test(type)) return !!event.item && event.item.type !== 'user_message'; // Codex
1351
+ if (/^message[.:]part[.:](updated|delta)$/i.test(type)) { // OpenCode
1352
+ const part = event.part || {};
1353
+ return /^(text|tool|reasoning)$/.test(String(part.type || '')) || /^message[.:]part[.:]delta$/i.test(type);
1354
+ }
1355
+ return /^(agent_message_chunk|agent_thought_chunk|tool_call|tool_call_update)$/.test(type); // Antigravity (ACP)
1356
+ }
1357
+
1358
+ /** Whether a run card offers Steer: a run that is not over (queued and starting runs too: the server answers). */
1359
+ export function canSteerRun(run) {
1360
+ if (!run?.runId) return false;
1361
+ const status = String(run.status || '');
1362
+ const state = String(run.state || '');
1363
+ if (STEER_TERMINAL.has(status) || STEER_TERMINAL.has(state)) return false;
1364
+ if (run.removed === true) return false;
1365
+ return true;
1366
+ }
1367
+
1368
+ /** The composer's target chip: "→ #2 Fix the login bug" (title clipped). */
1369
+ export function targetChipText(target, t = steerTranslator()) {
1370
+ const title = String(target?.title || target?.runId || '').replace(/\s+/g, ' ').trim();
1371
+ const short = title.length > 40 ? `${title.slice(0, 39).trimEnd()}…` : title;
1372
+ return t('targetChip', { n: target?.index ?? '?', title: short }).replace(/#\?\s*/, '');
1373
+ }
@@ -0,0 +1,294 @@
1
+ // ═══════════════════════════════════════════
2
+ // SynaBun Assistant — steer: redirect work that is under way
3
+ // ═══════════════════════════════════════════
4
+ // A steer cuts the current turn and sends new words at once, instead of
5
+ // queueing them behind it. Two targets:
6
+ // - the Assistant's own turn (direct work in this panel): POST
7
+ // /api/assistant/steer without a runId; the server interrupts the brain's
8
+ // turn and sends the text as the next user message;
9
+ // - one dispatched worker run: the same route with its runId; the server
10
+ // interrupts that worker's turn (its session stays warm) and follows up.
11
+ // Server contract (lib/, the other slice): → { ok, target: { kind: 'run' |
12
+ // 'brain', runId? }, interruptedTurn }; 400 empty text, 404 unknown run or
13
+ // session, 409 { code: 'RUN_NOT_ACTIVE' }. A worker emits a run event of type
14
+ // 'steered' { runId, text, at, interruptedTurn }; the interrupted turn ends
15
+ // with reason 'steered' (never a failure, never a completion). The brain's
16
+ // stream carries a 'steered' notice { target: 'brain', text, at }.
17
+ //
18
+ // No DOM: `node --test` loads this file as it is
19
+ // (tests/assistant-steer-panel.test.mjs). The panel loads it on demand
20
+ // (asst-panel.js steerModule: in idle time after the page is shown or at the
21
+ // first steer); what the panel draws with from the first frame (STEER_COPY,
22
+ // steerTranslator, the composer's keys, the chip, the steering mark) is in
23
+ // asst-state.js, re-exported here.
24
+
25
+ import { STEER_CLEARED, STEER_COPY, STEER_MARK_MAX_MS, canSteerRun, composerKeyIntent, isRunOutputEvent, isSteeredEnd, isSteering, settleSteering, steerNoticeText, steerTokensOf, steerTranslator, targetChipText } from './asst-state.js';
26
+
27
+ export { STEER_CLEARED, STEER_COPY, STEER_MARK_MAX_MS, canSteerRun, composerKeyIntent, isRunOutputEvent, isSteeredEnd, isSteering, settleSteering, steerNoticeText, steerTokensOf, steerTranslator, targetChipText };
28
+
29
+ /** The body of POST /api/assistant/steer; null when there is nothing to send. */
30
+ export function steerRequestBody({ sessionId, text, runId = null } = {}) {
31
+ const words = String(text ?? '').trim();
32
+ if (!sessionId || !words) return null;
33
+ const body = { assistantSessionId: String(sessionId), text: words };
34
+ if (runId) body.runId = String(runId);
35
+ return body;
36
+ }
37
+
38
+ /**
39
+ * POST the steer. Never throws: → { ok: true, target, interruptedTurn } or { ok: false, status, code, error }.
40
+ * `code` is the server's (RUN_NOT_ACTIVE…), or 'UNAVAILABLE' for a server that has no such route yet (404 without a
41
+ * JSON code, or 405), or 'NETWORK'.
42
+ */
43
+ export async function postSteer(body, { fetchImpl = (typeof fetch === 'function' ? fetch : null) } = {}) {
44
+ if (!body) return { ok: false, status: 400, code: 'EMPTY', error: 'empty text' };
45
+ if (typeof fetchImpl !== 'function') return { ok: false, status: 0, code: 'NETWORK', error: 'no fetch' };
46
+ let res;
47
+ try {
48
+ res = await fetchImpl('/api/assistant/steer', {
49
+ method: 'POST',
50
+ credentials: 'same-origin',
51
+ headers: { 'Content-Type': 'application/json', 'X-SynaBun-UI': '1' },
52
+ body: JSON.stringify(body),
53
+ });
54
+ } catch (error) {
55
+ return { ok: false, status: 0, code: 'NETWORK', error: error?.message || String(error) };
56
+ }
57
+ let data = null;
58
+ try { data = await res.json(); } catch { data = null; }
59
+ if (res.ok && data && data.ok !== false) {
60
+ return { ok: true, target: data.target || { kind: body.runId ? 'run' : 'brain', runId: body.runId || undefined }, interruptedTurn: data.interruptedTurn === true };
61
+ }
62
+ const code = data?.code || data?.reason || ((res.status === 404 && !data) || res.status === 405 ? 'UNAVAILABLE' : null);
63
+ return { ok: false, status: res.status, code, error: data?.error || data?.message || `HTTP ${res.status}` };
64
+ }
65
+
66
+ /**
67
+ * What the panel does with a failed steer: { kind, message, offerBrain }.
68
+ * kind: 'ended' (409 RUN_NOT_ACTIVE: offer the Assistant), 'unavailable' (an older server: queue), 'empty', 'error'.
69
+ */
70
+ export function steerFailureView(result, t = steerTranslator()) {
71
+ const code = String(result?.code || '');
72
+ if (code === 'RUN_NOT_ACTIVE' || (result?.status === 409 && !code)) return { kind: 'ended', message: t('runEnded'), offerBrain: true, offerLabel: t('sendToAssistant') };
73
+ if (code === 'UNAVAILABLE') return { kind: 'unavailable', message: t('unavailable'), offerBrain: false };
74
+ if (code === 'EMPTY' || result?.status === 400) return { kind: 'empty', message: t('emptyText'), offerBrain: false };
75
+ return { kind: 'error', message: t('failed', { error: result?.error || code || '?' }), offerBrain: false };
76
+ }
77
+
78
+
79
+ /**
80
+ * A 'steered' notice or run event out of any packet that may carry one, normalized to
81
+ * { target: 'brain' | 'run', runId, text, at, interruptedTurn }, or null.
82
+ * Shapes: { type: 'steered', … } (a stream event, a run event), { type: 'synabun.steered', … },
83
+ * { event: { type: 'steered', … } } and { event: 'steered', … } (a dispatch packet naming its event).
84
+ */
85
+ export function steeredEventOf(packet) {
86
+ if (!packet || typeof packet !== 'object') return null;
87
+ let ev = null;
88
+ if (packet.type === 'steered' || packet.type === 'synabun.steered') ev = packet;
89
+ else if (packet.event && typeof packet.event === 'object' && (packet.event.type === 'steered' || packet.event.type === 'synabun.steered')) ev = { ...packet, ...packet.event };
90
+ else if (packet.event === 'steered' || packet.kind === 'steered' || packet.reason === 'steered') ev = packet; // the dispatcher: assistant:dispatch { reason: 'steered', run, text, at }
91
+ if (!ev) return null;
92
+ const runId = ev.runId || ev.run?.runId || packet.runId || packet.run?.runId || null;
93
+ const target = ev.target === 'brain' || (!runId && ev.target !== 'run') ? 'brain' : 'run';
94
+ const at = Number.isFinite(Date.parse(ev.at)) ? new Date(ev.at).toISOString() : (Number.isFinite(Number(ev.at)) && Number(ev.at) > 0 ? new Date(Number(ev.at)).toISOString() : null);
95
+ return { target, runId: target === 'run' ? runId : null, text: String(ev.text ?? ''), at, interruptedTurn: ev.interruptedTurn === true };
96
+ }
97
+
98
+ /** The patch that marks a run steered now (the panel's own mark until the steer's turn shows output: settleSteering). */
99
+ export function steeringPatch(run, { text = '', at = Date.now() } = {}) {
100
+ return {
101
+ steering: true,
102
+ steeredAt: new Date(at).toISOString(),
103
+ steerText: String(text || ''),
104
+ steerIteration: Number.isFinite(Number(run?.currentIteration)) ? Number(run.currentIteration) : null,
105
+ steerTokens: steerTokensOf(run),
106
+ steerTurnStarted: false,
107
+ };
108
+ }
109
+
110
+ /**
111
+ * The panel's steer logic, with every page part injected (asst-panel.js wires it; the tests pass stand-ins):
112
+ * deps: { sessionId() → id, isRunning() → bool, steerable() → bool, setSteerable(bool),
113
+ * post(body) → postSteer result, queue(payload) → 'queued', send(payload) → 'sent' | false,
114
+ * promptText(payload) → string, getRun(runId), runLabel(run) → "#2 title",
115
+ * patchRun(runId, patch), setActivity(runId, activity | null),
116
+ * notice(text, { kind: 'steer' | 'warn' | 'error', action?: { label, run() } }) → row,
117
+ * setTarget(target | null, text?), focusComposer(), t, now() }
118
+ * Returns { submit(payload), steerRun(runId, text), targetRun(runId, text), onSteered(packet), onTurnStarted(runId) }.
119
+ */
120
+ export function createSteerController(deps = {}) {
121
+ const t = deps.t || steerTranslator();
122
+ const now = typeof deps.now === 'function' ? deps.now : () => Date.now();
123
+ // Notices this panel drew itself: the server's 'steered' echo of the same steer draws nothing more.
124
+ const drawn = [];
125
+ const remember = (key) => { drawn.push({ key, at: now() }); while (drawn.length > 20) drawn.shift(); };
126
+ const seen = (key) => drawn.some((d) => d.key === key && now() - d.at < 120_000);
127
+ // The server keeps at most 500 characters of a steer's text in its event.
128
+ const keyOf = (runId, text) => JSON.stringify([runId || 'brain', String(text || '').replace(/\s+/g, ' ').trim().slice(0, 480)]);
129
+
130
+ const setTimer = typeof deps.setTimer === 'function' ? deps.setTimer : (fn, ms) => { const id = setTimeout(fn, ms); id?.unref?.(); return id; };
131
+ const clearTimer = typeof deps.clearTimer === 'function' ? deps.clearTimer : (id) => clearTimeout(id);
132
+ const markTimers = new Map(); // runId → the timer that takes a mark away STEER_MARK_MAX_MS after it
133
+
134
+ /** "Steering…" goes: the steer's turn shows output, the run ended, or the mark is too old. */
135
+ function clearMark(runId) {
136
+ const timer = markTimers.get(runId);
137
+ if (timer != null) { clearTimer(timer); markTimers.delete(runId); }
138
+ const run = deps.getRun?.(runId);
139
+ if (!run || run.steering !== true) return false;
140
+ deps.patchRun?.(runId, { ...STEER_CLEARED });
141
+ deps.setActivity?.(runId, null);
142
+ return true;
143
+ }
144
+
145
+ function markRunSteering(runId, text) {
146
+ const run = deps.getRun?.(runId) || null;
147
+ const patch = steeringPatch(run, { text, at: now() });
148
+ deps.patchRun?.(runId, patch);
149
+ // The stage and the tray say the steer (the run's activity line) until the steer's turn shows something of its own.
150
+ deps.setActivity?.(runId, { kind: 'steer', name: 'steer', step: steerNoticeText(text, t), at: now() });
151
+ // Never longer than STEER_MARK_MAX_MS: a new steer starts the wait again.
152
+ const previous = markTimers.get(runId);
153
+ if (previous != null) clearTimer(previous);
154
+ markTimers.set(runId, setTimer(() => {
155
+ markTimers.delete(runId);
156
+ if (deps.getRun?.(runId)?.steeredAt === patch.steeredAt) clearMark(runId);
157
+ }, STEER_MARK_MAX_MS + 50));
158
+ }
159
+ /** A run this panel has not marked for a steer yet (a mark seen only in a descriptor has no steeredAt). */
160
+ const freshMark = (run) => !isSteering(run) || !run.steeredAt;
161
+
162
+ /** A failed steer: what the panel says, and the way on ("Send it to the Assistant" after 409). */
163
+ function failed(result, payload, runId) {
164
+ const view = steerFailureView(result, t);
165
+ if (view.kind === 'unavailable') {
166
+ deps.setSteerable?.(false);
167
+ deps.notice?.(view.message, { kind: 'warn' });
168
+ // An older server: the Assistant's own turn queues as before; a run steer cannot be done.
169
+ if (!runId && deps.isRunning?.()) return deps.queue?.(payload) ?? 'queued';
170
+ return false;
171
+ }
172
+ if (view.kind === 'ended') {
173
+ deps.setTarget?.(null);
174
+ const retry = { ...payload, steerTarget: null };
175
+ deps.notice?.(view.message, {
176
+ kind: 'warn',
177
+ action: {
178
+ label: view.offerLabel,
179
+ run: async () => {
180
+ const outcome = await submit({ ...retry, mode: deps.isRunning?.() ? 'steer' : null });
181
+ deps.focusComposer?.();
182
+ return outcome;
183
+ },
184
+ },
185
+ });
186
+ return 'ended';
187
+ }
188
+ deps.notice?.(view.message, { kind: 'error' });
189
+ return false; // the words stay in the composer
190
+ }
191
+
192
+ async function steerBrain(payload) {
193
+ const text = deps.promptText ? deps.promptText(payload) : String(payload?.text || '');
194
+ const body = steerRequestBody({ sessionId: deps.sessionId?.(), text });
195
+ if (!body) return false;
196
+ const result = await deps.post(body);
197
+ if (!result?.ok) return failed(result, payload, null);
198
+ // The server's 'steered' packet may have come before this answer: then it drew the notice already.
199
+ if (seen(keyOf(null, body.text))) return 'steered';
200
+ remember(keyOf(null, body.text));
201
+ // The brain's reply was cut (interruptedTurn): the transcript draws a break before the notice.
202
+ deps.notice?.(steerNoticeText(payload?.display ?? payload?.text ?? body.text, t), { kind: 'steer', cut: result.interruptedTurn !== false });
203
+ return 'steered';
204
+ }
205
+
206
+ async function steerRun(runId, text, payload = null) {
207
+ const body = steerRequestBody({ sessionId: deps.sessionId?.(), text, runId });
208
+ if (!body) return false;
209
+ const result = await deps.post(body);
210
+ if (!result?.ok) return failed(result, payload || { text }, runId);
211
+ const echoed = seen(keyOf(runId, body.text));
212
+ remember(keyOf(runId, body.text));
213
+ const current = deps.getRun?.(runId);
214
+ if (!echoed || freshMark(current)) markRunSteering(runId, body.text);
215
+ if (echoed) return 'steered';
216
+ const run = deps.getRun?.(runId) || null;
217
+ deps.notice?.(steerNoticeText(body.text, t, { run: deps.runLabel?.(run) || runId }), { kind: 'steer' });
218
+ return 'steered';
219
+ }
220
+
221
+ /**
222
+ * The composer's send. 'steer' while the Assistant works → its turn is cut; a target → that run;
223
+ * 'queue' (or a server that cannot steer) → the queue; images cannot ride a steer, so they queue.
224
+ */
225
+ async function submit(payload = {}) {
226
+ const target = payload.steerTarget?.runId || null;
227
+ if (target) {
228
+ const text = deps.promptText ? deps.promptText(payload) : String(payload.text || '');
229
+ return steerRun(target, text, payload);
230
+ }
231
+ if (!deps.isRunning?.()) return deps.send?.(payload);
232
+ const wantsSteer = payload.mode === 'steer' && deps.steerable?.() !== false && !(payload.images && payload.images.length);
233
+ if (!wantsSteer) return deps.queue?.(payload);
234
+ return steerBrain(payload);
235
+ }
236
+
237
+ /** The composer's target chip for a run, with what was typed in the run's own input carried over. */
238
+ function targetRun(runId, text = '', { index = null } = {}) {
239
+ const run = deps.getRun?.(runId) || { runId };
240
+ if (!canSteerRun(run)) return false;
241
+ deps.setTarget?.({ runId, title: run.title || run.task || runId, index }, text);
242
+ deps.focusComposer?.();
243
+ return true;
244
+ }
245
+
246
+ /** A 'steered' notice or run event from the server (this window's steer, another window's, the brain's agent_send). */
247
+ function onSteered(packet) {
248
+ const ev = steeredEventOf(packet);
249
+ if (!ev) return false;
250
+ const key = keyOf(ev.target === 'run' ? ev.runId : null, ev.text);
251
+ // A packet that names the steer without its words (a replayed or slimmed copy) marks the run, never a notice of
252
+ // its own: the notice is drawn once, with the text, by the packet or the answer that carries it.
253
+ const hasText = !!ev.text.trim();
254
+ if (ev.target === 'run' && ev.runId) {
255
+ const run = deps.getRun?.(ev.runId);
256
+ if (!run) return false;
257
+ if (freshMark(run) || (hasText && !seen(key))) markRunSteering(ev.runId, ev.text);
258
+ if (hasText && !seen(key)) { remember(key); deps.notice?.(steerNoticeText(ev.text, t, { run: deps.runLabel?.(run) || ev.runId }), { kind: 'steer' }); }
259
+ return true;
260
+ }
261
+ if (hasText && !seen(key)) { remember(key); deps.notice?.(steerNoticeText(ev.text, t), { kind: 'steer', cut: ev.interruptedTurn }); }
262
+ return true;
263
+ }
264
+
265
+ /**
266
+ * The run began a turn (the steer's): "Steering…" stays until that turn shows something (onRunOutput, onRunTokens),
267
+ * so it is seen at all. True when this was the start of the steer's turn.
268
+ */
269
+ function onTurnStarted(runId) {
270
+ const run = deps.getRun?.(runId);
271
+ if (!isSteering(run) || run.steerTurnStarted === true) return false;
272
+ deps.patchRun?.(runId, { steerTurnStarted: true, steerTokens: steerTokensOf(run) });
273
+ return true;
274
+ }
275
+
276
+ /** A provider event of the run: the steer's turn's first text, call or thinking takes "Steering…" away. */
277
+ function onRunOutput(runId, payload = null, activity = null) {
278
+ const run = deps.getRun?.(runId);
279
+ if (!isSteering(run) || run.steerTurnStarted !== true) return false;
280
+ if (payload && !isRunOutputEvent(payload, activity)) return false;
281
+ return clearMark(runId);
282
+ }
283
+
284
+ /** The run's tokens as a usage packet counts them: more than at the start of the steer's turn is its output. */
285
+ function onRunTokens(runId, total) {
286
+ const run = deps.getRun?.(runId);
287
+ if (!isSteering(run) || run.steerTurnStarted !== true) return false;
288
+ const at = Number(run.steerTokens);
289
+ if (!(Number(total) > (Number.isFinite(at) ? at : 0))) return false;
290
+ return clearMark(runId);
291
+ }
292
+
293
+ return { submit, steerRun, targetRun, onSteered, onTurnStarted, onRunOutput, onRunTokens, clearMark };
294
+ }
@@ -220,6 +220,8 @@ export function injectAssistantStyles() {
220
220
  /* Icon-only actions: bare squares with their row's corners until hovered, the glyph grid-centred. */
221
221
  :is(.asst-iconbtn, .asst-tb-btn.asst-attach) { display: grid; place-items: center; width: var(--cap-h); padding: 0; background: transparent; box-shadow: none; color: var(--asst-text-3); }
222
222
  .asst-iconbtn:has(> .asst-count:not([hidden])) { display: inline-flex; width: auto; gap: 4px; padding: 0 2px 0 calc(var(--cap-px) - 2px); }
223
+ /* Background tasks: its "⟳ N" count sits on the icon's corner (bg-tasks-view.js), ringed in the bar's background. */
224
+ .asst-act-bgtasks { --sbt-badge-ring: var(--asst-card); }
223
225
  /* States */
224
226
  :is(.asst-dd, .asst-tb-btn, .asst-iconbtn, .asst-btn, .asst-cost):hover:not(:disabled) {
225
227
  background: var(--asst-fill-2);
@@ -2069,6 +2071,24 @@ export function injectAssistantStyles() {
2069
2071
  /* ── System notices ─────────────────────────────────────────────── */
2070
2072
  .asst-status { white-space: pre-wrap; overflow-wrap: anywhere; }
2071
2073
  .asst-status.warn { color: var(--asst-warn); }
2074
+
2075
+ /* ── Steer (asst-steer.js): Queue · Steer beside Stop, the target chip, the notice, the card's input ── */
2076
+ .asst-steer-actions { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
2077
+ .asst-steer-actions[hidden] { display: none; }
2078
+ .asst-composer-actions .asst-steer-actions:not([hidden]) + .asst-send { margin-left: 0; }
2079
+ .asst-steer-actions .asst-queue-btn { width: auto; padding: 0 8px; color: var(--asst-text-2); font-size: 12px; }
2080
+ .asst-steer-actions .asst-steer-btn { height: var(--cap-h); padding: 0 10px; font-size: 12px; font-weight: 500; }
2081
+ .asst-composer-target { display: flex; padding: 10px 12px 0; }
2082
+ .asst-composer-target[hidden] { display: none; }
2083
+ .asst-composer-target .asst-steer-target { max-width: 100%; color: var(--asst-text); box-shadow: inset 0 0 0 1px var(--asst-line-2); }
2084
+ .asst-status.asst-steer-notice[data-steer="steer"] { padding-left: 8px; border-left: 2px solid var(--asst-line-2); color: var(--asst-text-2); }
2085
+ .asst-divider.asst-steer-break { gap: 0; margin: 4px 0; }
2086
+ .asst-status.asst-steer-notice .asst-steer-retry { margin-left: 8px; vertical-align: baseline; }
2087
+ .asst-run-steer { --cap-h: var(--asst-pill-h-sm); --cap-r: var(--asst-pill-r-sm); grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; margin-top: 6px; min-width: 0; }
2088
+ .asst-run-steer-input { flex: 1; min-width: 0; height: var(--cap-h); padding: 0 8px; border: 0; border-radius: var(--cap-r); outline: none; background: transparent; box-shadow: inset 0 0 0 1px var(--asst-line-2); color: var(--asst-text); font: inherit; font-size: 12.5px; }
2089
+ .asst-run-steer-input:focus-visible { box-shadow: inset 0 0 0 1px var(--asst-text-2); }
2090
+ .asst-run-steer-input::placeholder { color: var(--asst-text-3); }
2091
+ .asst-run-steer .asst-tb-btn svg { width: 14px; height: 14px; }
2072
2092
  .asst-msg.asst-msg-error .asst-msg-content { padding: 6px 10px; border-radius: var(--asst-r-field); box-shadow: inset 2px 0 0 var(--asst-live), inset 0 0 0 1px color-mix(in srgb, var(--asst-live) 28%, transparent); }
2073
2093
  .asst-local-output { padding-left: 12px; border-left: 2px solid var(--asst-line-2); }
2074
2094
  .asst-local-output .asst-md { --sbo-text: var(--asst-text-2); --sbo-size: 13px; }