@songsid/agend 2.3.5 → 2.3.6-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/README.md +11 -1
  2. package/README.zh-TW.md +11 -1
  3. package/dist/agent-cli-instructions.md +15 -9
  4. package/dist/agent-cli.js +47 -20
  5. package/dist/agent-cli.js.map +1 -1
  6. package/dist/agent-endpoint.js +23 -8
  7. package/dist/agent-endpoint.js.map +1 -1
  8. package/dist/agent-list-output.d.ts +23 -0
  9. package/dist/agent-list-output.js +53 -0
  10. package/dist/agent-list-output.js.map +1 -0
  11. package/dist/agent-whats-new.js +10 -7
  12. package/dist/agent-whats-new.js.map +1 -1
  13. package/dist/auth-api.js +3 -1
  14. package/dist/auth-api.js.map +1 -1
  15. package/dist/backend/agy-onboarding.d.ts +14 -0
  16. package/dist/backend/agy-onboarding.js +114 -0
  17. package/dist/backend/agy-onboarding.js.map +1 -0
  18. package/dist/backend/antigravity.js +3 -0
  19. package/dist/backend/antigravity.js.map +1 -1
  20. package/dist/backend/claude-code.d.ts +8 -0
  21. package/dist/backend/claude-code.js +11 -4
  22. package/dist/backend/claude-code.js.map +1 -1
  23. package/dist/backend/codex.d.ts +7 -14
  24. package/dist/backend/codex.js +32 -32
  25. package/dist/backend/codex.js.map +1 -1
  26. package/dist/backend/grok-mcp.d.ts +5 -0
  27. package/dist/backend/grok-mcp.js +221 -0
  28. package/dist/backend/grok-mcp.js.map +1 -0
  29. package/dist/backend/grok.d.ts +19 -10
  30. package/dist/backend/grok.js +117 -83
  31. package/dist/backend/grok.js.map +1 -1
  32. package/dist/backend/types.d.ts +16 -1
  33. package/dist/backend/types.js.map +1 -1
  34. package/dist/channel/mcp-tools.js +10 -10
  35. package/dist/channel/mcp-tools.js.map +1 -1
  36. package/dist/claude-model-observation.d.ts +71 -0
  37. package/dist/claude-model-observation.js +169 -0
  38. package/dist/claude-model-observation.js.map +1 -0
  39. package/dist/cli.js +62 -12
  40. package/dist/cli.js.map +1 -1
  41. package/dist/codex-pane-ownership.d.ts +13 -0
  42. package/dist/codex-pane-ownership.js +192 -0
  43. package/dist/codex-pane-ownership.js.map +1 -0
  44. package/dist/config-validator.js +19 -0
  45. package/dist/config-validator.js.map +1 -1
  46. package/dist/cross-instance-envelope.d.ts +4 -1
  47. package/dist/cross-instance-envelope.js +12 -7
  48. package/dist/cross-instance-envelope.js.map +1 -1
  49. package/dist/daemon.d.ts +26 -2
  50. package/dist/daemon.js +344 -49
  51. package/dist/daemon.js.map +1 -1
  52. package/dist/decision-list.d.ts +5 -4
  53. package/dist/decision-list.js +22 -8
  54. package/dist/decision-list.js.map +1 -1
  55. package/dist/delivery-consumed-watch.d.ts +24 -0
  56. package/dist/delivery-consumed-watch.js +21 -10
  57. package/dist/delivery-consumed-watch.js.map +1 -1
  58. package/dist/delivery-outbox.d.ts +9 -1
  59. package/dist/delivery-outbox.js +16 -0
  60. package/dist/delivery-outbox.js.map +1 -1
  61. package/dist/delivery-reconciliation.d.ts +1 -1
  62. package/dist/delivery-reconciliation.js +1 -1
  63. package/dist/dispatcher-liveness.d.ts +172 -0
  64. package/dist/dispatcher-liveness.js +238 -0
  65. package/dist/dispatcher-liveness.js.map +1 -0
  66. package/dist/fleet-manager.d.ts +30 -2
  67. package/dist/fleet-manager.js +195 -22
  68. package/dist/fleet-manager.js.map +1 -1
  69. package/dist/general-knowledge/skills/concepts/SKILL.md +43 -4
  70. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +17 -2
  71. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +18 -8
  72. package/dist/general-knowledge/skills/fleet-health/SKILL.md +15 -0
  73. package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -1
  74. package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -1
  75. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +63 -17
  76. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +5 -1
  77. package/dist/grok-delivery-proof.d.ts +24 -0
  78. package/dist/grok-delivery-proof.js +124 -0
  79. package/dist/grok-delivery-proof.js.map +1 -0
  80. package/dist/human-delivery-receipts.d.ts +4 -2
  81. package/dist/human-delivery-receipts.js +20 -13
  82. package/dist/human-delivery-receipts.js.map +1 -1
  83. package/dist/inbound-presentation.d.ts +28 -0
  84. package/dist/inbound-presentation.js +48 -0
  85. package/dist/inbound-presentation.js.map +1 -0
  86. package/dist/install-user-systemd.d.ts +20 -0
  87. package/dist/install-user-systemd.js +55 -0
  88. package/dist/install-user-systemd.js.map +1 -0
  89. package/dist/instance-config-impact.js +2 -0
  90. package/dist/instance-config-impact.js.map +1 -1
  91. package/dist/instance-lifecycle.d.ts +2 -0
  92. package/dist/instance-lifecycle.js +3 -0
  93. package/dist/instance-lifecycle.js.map +1 -1
  94. package/dist/instructions.d.ts +10 -2
  95. package/dist/instructions.js +32 -7
  96. package/dist/instructions.js.map +1 -1
  97. package/dist/linux-launchers.d.ts +88 -0
  98. package/dist/linux-launchers.js +296 -0
  99. package/dist/linux-launchers.js.map +1 -0
  100. package/dist/locale.js +174 -8
  101. package/dist/locale.js.map +1 -1
  102. package/dist/log-steps.d.ts +13 -0
  103. package/dist/log-steps.js +85 -40
  104. package/dist/log-steps.js.map +1 -1
  105. package/dist/needs-you-hub.js +8 -4
  106. package/dist/needs-you-hub.js.map +1 -1
  107. package/dist/needs-you.d.ts +7 -2
  108. package/dist/needs-you.js +5 -9
  109. package/dist/needs-you.js.map +1 -1
  110. package/dist/office-share-page.js +1 -1
  111. package/dist/office-share-page.js.map +1 -1
  112. package/dist/outbound-handlers.d.ts +1 -0
  113. package/dist/outbound-handlers.js +25 -19
  114. package/dist/outbound-handlers.js.map +1 -1
  115. package/dist/outbound-schemas.d.ts +20 -0
  116. package/dist/outbound-schemas.js +24 -4
  117. package/dist/outbound-schemas.js.map +1 -1
  118. package/dist/queued-handoffs.d.ts +3 -1
  119. package/dist/queued-handoffs.js +1 -1
  120. package/dist/queued-handoffs.js.map +1 -1
  121. package/dist/scheduler/db.d.ts +3 -0
  122. package/dist/scheduler/db.js +4 -0
  123. package/dist/scheduler/db.js.map +1 -1
  124. package/dist/scheduler/task-board.d.ts +1 -0
  125. package/dist/scheduler/task-board.js +10 -1
  126. package/dist/scheduler/task-board.js.map +1 -1
  127. package/dist/scheduler/task-liveness.d.ts +34 -0
  128. package/dist/scheduler/task-liveness.js +49 -0
  129. package/dist/scheduler/task-liveness.js.map +1 -0
  130. package/dist/selection-card.d.ts +4 -3
  131. package/dist/selection-card.js +2 -1
  132. package/dist/selection-card.js.map +1 -1
  133. package/dist/service-installer.js +11 -2
  134. package/dist/service-installer.js.map +1 -1
  135. package/dist/settings-change.d.ts +2 -0
  136. package/dist/settings-change.js +43 -29
  137. package/dist/settings-change.js.map +1 -1
  138. package/dist/settings-confirmation.d.ts +4 -0
  139. package/dist/settings-confirmation.js +5 -1
  140. package/dist/settings-confirmation.js.map +1 -1
  141. package/dist/settings-http-confirmation.js +2 -1
  142. package/dist/settings-http-confirmation.js.map +1 -1
  143. package/dist/settings-summary.d.ts +24 -0
  144. package/dist/settings-summary.js +42 -0
  145. package/dist/settings-summary.js.map +1 -0
  146. package/dist/task-board-tool.d.ts +0 -12
  147. package/dist/task-board-tool.js +52 -4
  148. package/dist/task-board-tool.js.map +1 -1
  149. package/dist/tool-receipt-output.d.ts +151 -0
  150. package/dist/tool-receipt-output.js +50 -0
  151. package/dist/tool-receipt-output.js.map +1 -0
  152. package/dist/topic-commands.js +2 -1
  153. package/dist/topic-commands.js.map +1 -1
  154. package/dist/transcript-delta-reader.d.ts +9 -1
  155. package/dist/transcript-delta-reader.js +37 -8
  156. package/dist/transcript-delta-reader.js.map +1 -1
  157. package/dist/transcript-monitor.d.ts +5 -1
  158. package/dist/transcript-monitor.js +66 -4
  159. package/dist/transcript-monitor.js.map +1 -1
  160. package/dist/transcript-sources.d.ts +2 -0
  161. package/dist/transcript-sources.js +2 -0
  162. package/dist/transcript-sources.js.map +1 -1
  163. package/dist/types.d.ts +10 -0
  164. package/dist/ui/chat-quote.js +12 -17
  165. package/dist/ui/chat-render.js +11 -2
  166. package/dist/ui/chat-strings.js +4 -4
  167. package/dist/ui/fleet-canvas.js +5 -2
  168. package/dist/ui/fleet-office-card.js +4 -2
  169. package/dist/ui/fleet-org.js +2 -0
  170. package/dist/ui/panel-chat.js +28 -6
  171. package/dist/ui/panel-details.js +6 -1
  172. package/dist/ui/panel-log.js +4 -2
  173. package/dist/ui/panel-needs.js +2 -0
  174. package/dist/ui/panel-settings.js +29 -1
  175. package/dist/ui/settings-registry.js +4 -0
  176. package/dist/ui/settings-strings.js +14 -0
  177. package/dist/ui/shared/app-i18n.js +2 -2
  178. package/dist/ui/shared/app-needs.js +3 -0
  179. package/dist/ui/shared/app-shell.js +48 -3
  180. package/dist/ui/shared/app.css +2 -0
  181. package/dist/ui/shared/chat-work-bar.css +12 -0
  182. package/dist/ui/shared/model-observation.js +16 -0
  183. package/dist/ui/shared/usage-dialog.js +2 -1
  184. package/dist/ui/shared/view-strings.js +2 -0
  185. package/dist/update-dispatch.d.ts +62 -0
  186. package/dist/update-dispatch.js +69 -2
  187. package/dist/update-dispatch.js.map +1 -1
  188. package/dist/usage/agent-output.d.ts +144 -0
  189. package/dist/usage/agent-output.js +76 -0
  190. package/dist/usage/agent-output.js.map +1 -0
  191. package/dist/usage/i18n-keys.d.ts +1 -1
  192. package/dist/usage/i18n-keys.js +1 -1
  193. package/dist/usage/i18n-keys.js.map +1 -1
  194. package/dist/usage/i18n.d.ts +1 -1
  195. package/dist/usage/i18n.js +2 -1
  196. package/dist/usage/i18n.js.map +1 -1
  197. package/dist/usage/providers.d.ts +4 -1
  198. package/dist/usage/providers.js +22 -11
  199. package/dist/usage/providers.js.map +1 -1
  200. package/dist/usage/usage-api.d.ts +1 -1
  201. package/dist/usage/usage-api.js +4 -4
  202. package/dist/usage/usage-api.js.map +1 -1
  203. package/dist/web-api.d.ts +1 -0
  204. package/dist/web-api.js +2 -1
  205. package/dist/web-api.js.map +1 -1
  206. package/dist/windows-shortcuts.d.ts +29 -5
  207. package/dist/windows-shortcuts.js +52 -9
  208. package/dist/windows-shortcuts.js.map +1 -1
  209. package/dist/workflow-templates/default.md +2 -2
  210. package/launcher/agend-install.cjs +7 -1
  211. package/package.json +1 -1
  212. package/templates/icons/agend-restart.ico +0 -0
  213. package/templates/icons/agend.ico +0 -0
  214. package/templates/windows-shortcuts.ps1 +45 -12
@@ -1,3 +1,4 @@
1
+ import { modelSwitchText, modelName, observationLabel } from "/assets/model-observation.js";
1
2
  // #1918: Fleet → Org chart as a canvas — the same structure as the list (fleet-org.js: General, the teams fleet.yaml
2
3
  // defines, their members, the instances in no team), drawn as cards in team boxes you can pan, zoom and pinch. No
3
4
  // library: SVG with attributes and classes (never a style attribute, #1300); the view's transform is an SVG attribute
@@ -117,17 +118,19 @@ function Card({ c, lead, cls, onOpen }) {
117
118
  const n = c.node, it = n.i;
118
119
  const { primary, sub, full } = nodeText(n);
119
120
  const id = it ? identityOf(it) : null;
120
- const cy = c.h / 2;
121
+ const switched = it?.model_observation?.active;
122
+ const cy = c.h / 2 - (switched ? 8 : 0);
121
123
  return html`<g class=${`oc-node st-${n.state}${lead ? " lead" : ""}${cls ? ` ${cls}` : ""} ${identityClasses(id)}`} ref=${(el) => paintIdentity(el, id)}
122
124
  transform=${`translate(${c.x} ${c.y})`} data-name=${n.name} data-key=${c.key} tabindex="0" role=${it ? "link" : "img"}
123
125
  aria-label=${it ? `${full}. ${tc("openChat")}` : full} onClick=${it ? () => onOpen(n.name) : undefined}>
124
- <title>${full}</title>
126
+ <title>${full}${switched ? ` · ${modelSwitchText(switched)}` : ""}</title>
125
127
  <rect class="oc-card" width=${c.w} height=${c.h} rx="10" />
126
128
  <rect class="oc-idbar" x="0" y="8" width="4" height=${c.h - 16} rx="2" />
127
129
  <${Face} it=${it} name=${n.name} cx=${26} cy=${cy} r=${16} />
128
130
  <circle class=${`oc-dot st-${n.state}`} cx=${38} cy=${cy + 12} r=${5} />
129
131
  <text class="oc-name" x=${50} y=${cy - 4}>${clip(primary, lead ? 20 : 15)}</text>
130
132
  <text class="oc-sub" x=${50} y=${cy + 13}><tspan class=${`oc-st st-${n.state}`}>${clip(sub, lead ? 27 : 20)}</tspan></text>
133
+ ${switched ? html`<text class="oc-sub" x="8" y=${c.h - 6}><title>${modelSwitchText(switched)}</title>${clip(modelSwitchText(switched), lead ? 34 : 26)}</text>` : null}
131
134
  </g>`;
132
135
  }
133
136
 
@@ -1,3 +1,4 @@
1
+ import { modelSwitchText, modelName, observationLabel } from "/assets/model-observation.js";
1
2
  // #2661: a person's profile card in the Office (fleet-office.js opens it): a popover beside them, not a modal — the Office
2
3
  // keeps running and is not dimmed; on a phone, a bottom sheet swiped down to close. Fixed 320 px wide.
3
4
  //
@@ -60,7 +61,7 @@ export function cardModel({ node, lv, levels, share = false, state, now, where }
60
61
  const detail = !share && !!e && e.workTokens !== undefined;
61
62
  const xp = showLevel && detail ? xpOf(e.level, e.workTokens, lv.unit) : null;
62
63
  const rows = [[tc("office"), where]];
63
- if (!share && it.model) rows.push([tc("model"), modelText(it)]);
64
+ if (!share && it.model) rows.push(it.model_observation ? [observationLabel("selection"), modelName(it.model_observation.session) || observationLabel("unresolved")] : [tc("model"), modelText(it)]);
64
65
  if (!share && it.backend) rows.push([tc("backend"), backendLabel(it.backend)]);
65
66
  if (detail) rows.push([tc("today"), tc("todayN", tokens(e.today.workTokens), e.today.requests)]);
66
67
  if (detail && e.firstSeen) rows.push([tc("firstSeen"), tc("day", dayOf(e.firstSeen))]);
@@ -70,7 +71,7 @@ export function cardModel({ node, lv, levels, share = false, state, now, where }
70
71
  badge: on && fx && fx.hideLevel ? { mark: true, tier: 0 } : e ? { text: badgeText(e.level), tier: tierOf(e.level) } : null,
71
72
  level: showLevel ? { line1: detail ? `${tc("level", e.level)} · ${tc("work", tokens(e.workTokens))}` : tc("level", e.level), estimated: detail && e.estimated,
72
73
  line2: xp ? tc("toNext", tokens(xp.toNext), xp.next) : null, pct: xp ? xp.pct : null, next: xp ? xp.next : null } : null,
73
- rows, now,
74
+ rows, now, modelSwitch: !share ? modelSwitchText(it.model_observation?.active) : "",
74
75
  };
75
76
  }
76
77
 
@@ -89,6 +90,7 @@ export function OfficeCard({ model: m, avatar, sheet, place, onChat, onFind, onC
89
90
  return html`<div ref=${box} class=${`oo-card${sheet ? " sheet" : ""}`} role="dialog" aria-modal="false" aria-label=${tc("card", m.name)}
90
91
  onPointerDown=${down} onPointerUp=${up} onPointerCancel=${() => { swipe.current = null; }}>
91
92
  ${sheet ? html`<div class="oo-card-grip" aria-hidden="true"></div>` : null}
93
+ ${m.modelSwitch ? html`<p class="oo-card-now model-switch" role="status"><strong>${m.modelSwitch}</strong></p>` : null}
92
94
  <div class="oo-card-head">
93
95
  <div class="oo-card-avatar"><canvas ref=${canvas} width="56" height="56" aria-hidden="true"></canvas>
94
96
  ${m.badge ? html`<span class=${`oo-badge tier-${m.badge.tier}${m.badge.mark ? " mark" : ""}`} aria-hidden="true">${m.badge.mark ? "" : m.badge.text}</span>` : null}</div>
@@ -1,3 +1,4 @@
1
+ import { modelSwitchText, modelName, observationLabel } from "/assets/model-observation.js";
1
2
  // #1389: Fleet → Org chart (/ui/fleet/org) — General at the top, then the teams fleet.yaml defines, then their
2
3
  // instances; each node names the instance, says what it does, which backend and model it runs, how it is doing now,
3
4
  // and links to its thread. Behind the session gate (/ui/js/), imported by the Fleet panel.
@@ -129,6 +130,7 @@ function Node({ n, sending }) {
129
130
  ${n.i ? html`<div class="org-meta">${n.i.backend ? html`<span class="org-chip">${n.i.backend}</span>` : null}
130
131
  ${model ? html`<span class="org-model mono" title=${model}>${model}</span>` : null}
131
132
  ${n.info.classic ? html`<span class="org-chip">${to("classic")}</span>` : null}</div>` : null}
133
+ ${n.i?.model_observation?.active ? html`<p class="note model-switch" role="status">${modelSwitchText(n.i.model_observation.active)}</p>` : null}
132
134
  ${n.i || thread ? html`<div class="org-links">
133
135
  ${thread ? html`<a class="org-link" href=${thread.url} target="_blank" rel="noopener noreferrer">
134
136
  <${Icon} name="external" size=${14} />${to(`thread_${thread.platform}`)}<span class="sr-only"> ${to("newTab")}</span></a>` : null}
@@ -85,6 +85,20 @@ import { isUpdateLine, needsArgument, paletteFor, parseCommandLine, UPDATE_COMMA
85
85
  import { installTour, refreshTourSpot } from "./chat-tour.js";
86
86
  import { LightboxHost, openLightbox } from "./image-lightbox.js";
87
87
  import { AmbientMotionNote, ChatAmbient, ambientMenuItems } from "./chat-ambient.js";
88
+ /**
89
+ * M-2904: the working bar's Stop has its own stylesheet, linked once when this module loads (before the chat draws): a tab
90
+ * opened before the change keeps its older app.css, which has no rule for it (Prism #3651: a 40×30 Stop on a phone).
91
+ */
92
+ export function linkWorkBarCss(doc = typeof document !== "undefined" ? document : null) {
93
+ try {
94
+ if (!doc || !doc.head || doc.querySelector('link[data-chat-work-bar-css="1"]')) return;
95
+ const link = doc.createElement("link");
96
+ link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/chat-work-bar.css"); link.setAttribute("data-chat-work-bar-css", "1");
97
+ doc.head.appendChild(link);
98
+ } catch { /* Stop still works without it */ }
99
+ }
100
+ linkWorkBarCss();
101
+
88
102
  /** The composer's textarea (#2342: text put back into it is a step Ctrl+Z goes back from). */
89
103
  const composerField = () => (typeof document !== "undefined" ? document.getElementById("msgIn") : null);
90
104
 
@@ -673,7 +687,11 @@ function PromptText({ p, action }) {
673
687
  </form>`;
674
688
  }
675
689
 
676
- /** "<name> is working… 0:42", "looks stuck", "Stopping…", or what it waits on at its terminal. Text only. */
690
+ /**
691
+ * "<name> is working… 0:42", "looks stuck", "Stopping…", or what it waits on at its terminal. Text only.
692
+ * #3724: the strip is always there — idle it keeps its height and shows nothing (no button), so a state change only changes
693
+ * what is inside it and never moves the thread or the composer (chat-work-bar.css fixes the height; long text stays one line).
694
+ */
677
695
  function WorkBar({ name, lease, exec, awaiting, workingLabel }) {
678
696
  const s = store.state;
679
697
  const busy = R().isBusy(exec) ? exec : "";
@@ -684,14 +702,17 @@ function WorkBar({ name, lease, exec, awaiting, workingLabel }) {
684
702
  const h = lease.interval(() => tick(n => n + 1), 1000); // ticks only while it shows, cleared with the lease
685
703
  return () => lease.clear(h);
686
704
  }, [kind, lease]);
687
- if (!kind) return null;
705
+ if (!kind) return html`<div class="work-bar idle" aria-hidden="true"></div>`;
688
706
  // #1629: the agent's own working label (its theme), shown as text — only for "working", never for the other states.
689
707
  const label = kind === "working" && workingLabel ? workingLabel
690
708
  : t(kind === "stuck" ? "chat.stuck" : kind === "stopping" ? "chat.stopping" : kind === "awaiting" ? "chat.awaiting" : "chat.working", name);
691
709
  const since = s.workingSince[name];
692
710
  return html`<div class=${`work-bar ${kind}`}><span class="pulse" aria-hidden="true"></span><span class="lbl">${label}</span>
693
711
  ${kind === "awaiting" ? html`<span class="note" title=${t("chat.approxNote")}>${awaiting || t("chat.approxNote")}</span>`
694
- : html`<span class="elapsed" title=${t("chat.elapsedTitle")} aria-hidden="true">${since == null ? "" : R().formatElapsed(performance.now() - since)}</span>`}</div>`;
712
+ : html`<span class="elapsed" title=${t("chat.elapsedTitle")} aria-hidden="true">${since == null ? "" : R().formatElapsed(performance.now() - since)}</span>`}
713
+ ${/* Stop sits with what it stops (card "composer width": in the composer it took the box's width away). */ ""}
714
+ ${busy ? html`<button id="stopBtn" type="button" class="btn btn-sm btn-stop" title=${t("chat.stopReplyTitle")} aria-label=${t("chat.stopReply")}
715
+ disabled=${!!s.cancelling[name]} onClick=${() => store.cancelReply(name)}><${Icon} name="stop" size=${14} /><span class="stop-label">${t("chat.stopReply")}</span></button>` : null}</div>`;
695
716
  }
696
717
 
697
718
  /** #2272: the reply bar's quote — the first ~80 characters, or what it had instead of text. */
@@ -814,9 +835,10 @@ function Composer({ name, inst, label = name, lease, busy }) {
814
835
  aria-activedescendant=${pick ? optId(pick) : undefined} onInput=${onInput} onKeyDown=${onKeyDown} onPaste=${onPaste}
815
836
  oncompositionstart=${onCompositionStart} oncompositionend=${onCompositionEnd} onBlur=${onCompositionEnd}
816
837
  placeholder=" "></textarea><span class="composer-ph" aria-hidden="true">${t("chat.composerPlaceholder", label)}</span></span>
817
- <button id="stopBtn" type="button" class="btn btn-stop" hidden=${!busy} title=${t("chat.stopReplyTitle")}
818
- disabled=${!!s.cancelling[name]} onClick=${() => store.cancelReply(name)}><${Icon} name="stop" size=${14} /><span class="stop-label">${t("chat.stopReply")}</span></button>
819
- <button id="sendBtn" type="button" class="btn btn-primary btn-send" hidden=${busy && !content} disabled=${!content}
838
+ ${/* Card "composer width": Stop lives in the working bar above (WorkBar), and Send is always here (disabled while
839
+ there is nothing to send) — so nothing in this row comes or goes when the agent starts or stops working, and the
840
+ box keeps one width: a draft never re-wraps under the person's fingers. */ ""}
841
+ <button id="sendBtn" type="button" class="btn btn-primary btn-send" disabled=${!content}
820
842
  onMouseDown=${(e) => e.preventDefault()}
821
843
  aria-label=${t("chat.send")} title=${t("chat.send")} onClick=${submit}><${Icon} name="send" size=${16} /><span class="send-label">${t("chat.send")}</span></button>
822
844
  </div></div>`;
@@ -1,3 +1,4 @@
1
+ import { modelSwitchText, modelName, observationLabel } from "/assets/model-observation.js";
1
2
  // #1523 N2 (§3.3, Q1 = B): Details — "the Fleet side of one instance", at /ui/fleet/agent/<name>. Behind the session
2
3
  // gate (/ui/js/). What it holds:
3
4
  // - runtime and recent activity (what Chat's details dialog showed, now a page);
@@ -49,6 +50,7 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
49
50
  // #1629 r4 §1: the identity card at the top, read when the status frame's card_v moves.
50
51
  const card = useCard(name, inst.card_v);
51
52
  const [d, setD] = useState(null);
53
+ const observed = Object.prototype.hasOwnProperty.call(inst, "model_observation") ? inst.model_observation : d?.model_observation;
52
54
  const [failed, setFailed] = useState(false);
53
55
  const [busy, setBusy] = useState("");
54
56
  const body = useRef(null);
@@ -145,7 +147,10 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
145
147
  <button type="button" class="btn btn-sm d-edit-settings" onClick=${editInSettings}>${t("chat.dEditInSettings")}</button></div></section>
146
148
  <section class="card"><h3>${t("chat.dRuntime")}</h3>
147
149
  ${row(t("chat.dBackend"), d.backend || "--")}
148
- ${row(t("chat.dModel"), `${(d.model && modelText(d)) || sl.model?.display_name || "--"}${d.model_source === "live" ? "" : src(d.model_source)}`)}
150
+ ${row(observed ? observationLabel("selection") : t("chat.dModel"), observed ? modelName(observed.session) || observationLabel("unresolved") : `${(d.model && modelText(d)) || sl.model?.display_name || "--"}${d.model_source === "live" ? "" : src(d.model_source)}`)}
151
+ ${observed ? html`${row(observationLabel("configured"), modelName(observed.configured) || observationLabel("unresolved"))}
152
+ ${row(observationLabel("served"), modelName(observed.lastServed) || observationLabel("unresolved"))}
153
+ ${observed.active ? html`<p class="note model-switch" role="status">${modelSwitchText(observed.active)}</p>` : null}` : null}
149
154
  ${d.effort ? row(t("chat.dEffort"), `${d.effort}${src(d.effort_source)}`) : null}
150
155
  ${row(t("chat.dCost"), `$${cost.toFixed(2)} ${t("chat.dCostNote")}`)}
151
156
  ${row(t("chat.dContext"), html`<span class="pct">${ctx != null ? `${Math.round(ctx)}%` : "--"}</span>${ctx != null ? bar(ctx, ctx > 80 ? "warn" : "") : null}`)}
@@ -1,3 +1,4 @@
1
+ import { modelSwitchText, modelName, observationLabel } from "/assets/model-observation.js";
1
2
  // #1218 phase 1: one instance's Log (紀錄) — its work step by step: what it was asked, what it answered (never its
2
3
  // thinking), each tool call with its arguments and result, errors, where each turn ended, and fleet events (a crash, a
3
4
  // restart, a prompt waiting). Between View and Details (/ui/log/<name>). Behind the session gate (/ui/js/); offered on
@@ -410,14 +411,15 @@ function Row({ x, prev }) {
410
411
  ${x.screen ? html`<button type="button" class="link-btn log-toggle log-screen-toggle" aria-expanded=${open ? "true" : "false"} onClick=${() => setOpen(!open)}>${open ? tl("hideScreen") : tl("showScreen")}</button>` : null}
411
412
  ${x.screen && open ? html`<div class="log-detail"><div class="log-text mono log-screen">${x.screen}</div></div>` : null}`;
412
413
  } else if (x.kind === "user" || x.kind === "assistant") {
413
- row = html`${head(KIND_ICON[x.kind], tl(x.kind))}${text(x.body, x.bodyCut)}`;
414
+ row = html`${head(KIND_ICON[x.kind], tl(x.kind))}${x.servedModel ? text(`${observationLabel("served")}: ${modelName(x.servedModel)}`) : null}${text(x.body, x.bodyCut)}`;
414
415
  } else if (x.kind === "error") {
415
416
  row = html`${head(KIND_ICON.error, x.note ? tl("errorCode", x.note) : tl("error"))}${text(x.body, x.bodyCut)}`;
416
417
  } else if (x.kind === "turn_end") {
417
418
  row = head(KIND_ICON.turn_end, x.durationMs ? tl("turnEndIn", duration(x.durationMs)) : tl("turnEnd"),
418
419
  x.status && x.status !== "done" ? html`<span class=${`log-status ${x.status}`}>${tl(x.status)}</span>` : null);
419
420
  } else if (x.kind === "state") {
420
- row = head(KIND_ICON.state, x.note === "compacted" ? tl("compacted") : x.note || "");
421
+ row = x.modelSwitch ? html`${head(KIND_ICON.state, observationLabel("title"))}${text(modelSwitchText(x.modelSwitch))}`
422
+ : head(KIND_ICON.state, x.note === "compacted" ? tl("compacted") : x.note || "");
421
423
  } else {
422
424
  const cat = x.cat || "other";
423
425
  const subject = cat === "plan" && x.subject ? tl("plan_items", x.subject) : x.subject || "";
@@ -1,3 +1,4 @@
1
+ import { modelSwitchText } from "/assets/model-observation.js";
1
2
  // #1408 step 4 = #1386 part (b): the "Needs you" panel (/ui/needs) — everything waiting on the person, from every
2
3
  // world, in one list. Behind the session gate (/ui/js/), loaded the first time it is opened.
3
4
  //
@@ -102,6 +103,7 @@ const BAD = new Set(["crashed", "delivery_failed", "hang", "exited"]);
102
103
  * its question or what it lacks; anything else is the server's own words.
103
104
  */
104
105
  function detailOf(item) {
106
+ if (item.modelSwitch) return modelSwitchText(item.modelSwitch);
105
107
  const c = item.type === "task" ? item.card : null;
106
108
  if (!c || !c.title) return configDetail(item);
107
109
  const lacks = c.gap ? [c.gap.unchecked ? tn("gapUnchecked", c.gap.unchecked) : "", c.gap.noResult ? tn("gapNoResult") : ""].filter(Boolean).join(tn("gapJoin")) : "";
@@ -978,6 +978,21 @@ const noticeMode = (v) => v !== "false" && v !== false;
978
978
  const noticeChoices = () => [{ value: "true", label: tn("noticeTopic") }, { value: "false", label: tn("noticeOff") }];
979
979
  const noticeLabel = (v) => tn(v ? "noticeTopic" : "noticeOff");
980
980
 
981
+ /** #3647: the dispatcher-liveness thresholds (defaults.task_board.liveness), as the form holds them. */
982
+ const LIVENESS_DEFAULTS = { enabled: true, quiet_minutes: 60, prompt_minutes: 10, crash_grace_minutes: 5 };
983
+ function livenessForm(d) {
984
+ const lv = (d.task_board && d.task_board.liveness) || {};
985
+ return { liveOn: lv.enabled !== false, liveQuiet: String(lv.quiet_minutes ?? LIVENESS_DEFAULTS.quiet_minutes),
986
+ livePrompt: String(lv.prompt_minutes ?? LIVENESS_DEFAULTS.prompt_minutes), liveCrash: String(lv.crash_grace_minutes ?? LIVENESS_DEFAULTS.crash_grace_minutes) };
987
+ }
988
+ /** `defaults.task_board` as saved, with the liveness part from the form (the defaults merge replaces `task_board` whole). */
989
+ function taskBoardDefaults(d, f) {
990
+ const n = (v) => Number(v);
991
+ return { ...(d.task_board || {}), liveness: f ? { enabled: f.liveOn, quiet_minutes: n(f.liveQuiet), prompt_minutes: n(f.livePrompt), crash_grace_minutes: n(f.liveCrash) }
992
+ : { enabled: ((d.task_board && d.task_board.liveness) || {}).enabled !== false, ...Object.fromEntries(["quiet_minutes", "prompt_minutes", "crash_grace_minutes"].map((k) => [k, ((d.task_board && d.task_board.liveness) || {})[k] ?? LIVENESS_DEFAULTS[k]])) } };
993
+ }
994
+ const minutesInRange = (v) => { const n = Number(v); return String(v).trim() !== "" && Number.isFinite(n) && n >= 1 && n <= 1440 ? "" : "livenessRange"; };
995
+
981
996
  /** General's form, from the saved defaults (`d`) and ClassicBot's (`c`). */
982
997
  function generalForm(d, c, fleet = {}, schema = {}) {
983
998
  const hang = d.hang_detector || {}, startup = d.startup || {};
@@ -989,6 +1004,8 @@ function generalForm(d, c, fleet = {}, schema = {}) {
989
1004
  // would bring back a feature another admin changed meanwhile).
990
1005
  ...Object.fromEntries(DASHBOARD_FEATURES.map((k) => [`dash_${k}`, dashboardDefault(d, k)])),
991
1006
  hangOn: hang.enabled !== false, hang: String(hang.timeout_minutes ?? HANG_TIMEOUT_DEFAULT_MINUTES),
1007
+ // #3647: telling a card's dispatcher when its assignee stops.
1008
+ ...livenessForm(d),
992
1009
  // #2347 §10 review: unset startup concurrency is automatic (deriveSpawnConcurrency: 2–10 by free memory and cores),
993
1010
  // not 10 — an empty field, and a save that leaves it unset (the defaults merge replaces `startup` whole).
994
1011
  concurrency: startup.concurrency == null ? "" : String(startup.concurrency), stagger: String(startup.stagger_delay_ms ?? 500),
@@ -1022,6 +1039,7 @@ function General({ ctx, part = "all" }) {
1022
1039
  const num = (v) => Number(v);
1023
1040
  const errors = {
1024
1041
  auto: nonNegative(f.auto), hang: positive(f.hang),
1042
+ liveQuiet: minutesInRange(f.liveQuiet), livePrompt: minutesInRange(f.livePrompt), liveCrash: minutesInRange(f.liveCrash),
1025
1043
  concurrency: f.concurrency.trim() !== "" && (!Number.isInteger(num(f.concurrency)) || num(f.concurrency) < 1 || num(f.concurrency) > 20) ? "concurrencyRange" : "",
1026
1044
  stagger: !Number.isFinite(num(f.stagger)) || f.stagger.trim() === "" || num(f.stagger) < 0 || num(f.stagger) > 30000 ? "staggerRange" : "",
1027
1045
  };
@@ -1032,7 +1050,7 @@ function General({ ctx, part = "all" }) {
1032
1050
  useEffect(() => {
1033
1051
  if (!ready) {
1034
1052
  // Where it is (#2382 review): the bar in another section names it and goes there.
1035
- const at = { auto: "#g-auto", hang: "#g-hang", concurrency: "#g-conc", stagger: "#g-stag" }[Object.keys(errors).find((k) => errors[k])];
1053
+ const at = { auto: "#g-auto", hang: "#g-hang", concurrency: "#g-conc", stagger: "#g-stag", liveQuiet: "#g-live-quiet", livePrompt: "#g-live-prompt", liveCrash: "#g-live-crash" }[Object.keys(errors).find((k) => errors[k])];
1036
1054
  syncStage(ctx, "defaults:invalid", { label: tn("updateDefaults"), invalid: tn(firstError), section: "agent-defaults", target: at });
1037
1055
  return;
1038
1056
  }
@@ -1046,6 +1064,7 @@ function General({ ctx, part = "all" }) {
1046
1064
  dashboard: Object.fromEntries(DASHBOARD_FEATURES.filter((k) => !Object.hasOwn(SEPARATE_FEATURE_KEYS, k)).map((k) => [k, f[`dash_${k}`]])),
1047
1065
  ...Object.fromEntries(Object.entries(SEPARATE_FEATURE_KEYS).map(([k, key]) => [key, f[`dash_${k}`]])),
1048
1066
  hang_detector: { enabled: f.hangOn, timeout_minutes: num(f.hang) },
1067
+ task_board: taskBoardDefaults(d, f),
1049
1068
  startup: { ...(f.concurrency.trim() === "" ? {} : { concurrency: num(f.concurrency) }), stagger_delay_ms: num(f.stagger) },
1050
1069
  }, {
1051
1070
  backend: d.backend || "claude-code", model: d.model || undefined, locale: d.locale || null, auto_pause_after: d.auto_pause_after ?? 0,
@@ -1054,6 +1073,7 @@ function General({ ctx, part = "all" }) {
1054
1073
  dashboard: Object.fromEntries(DASHBOARD_FEATURES.filter((k) => !Object.hasOwn(SEPARATE_FEATURE_KEYS, k)).map((k) => [k, dashboardDefault(d, k)])),
1055
1074
  ...Object.fromEntries(Object.entries(SEPARATE_FEATURE_KEYS).map(([k, key]) => [key, dashboardDefault(d, k)])),
1056
1075
  hang_detector: { enabled: hang.enabled !== false, timeout_minutes: hang.timeout_minutes ?? HANG_TIMEOUT_DEFAULT_MINUTES },
1076
+ task_board: taskBoardDefaults(d, null),
1057
1077
  startup: { ...(startup.concurrency == null ? {} : { concurrency: startup.concurrency }), stagger_delay_ms: startup.stagger_delay_ms ?? 500 },
1058
1078
  });
1059
1079
  const oc = original.c;
@@ -1158,6 +1178,14 @@ function General({ ctx, part = "all" }) {
1158
1178
  <label class=${fc("check", "hangOn")}><input id="g-hang-on" type="checkbox" checked=${f.hangOn} onChange=${(e) => set("hangOn")(e.target.checked)} /><span>${tn("hangEnabled")}</span>${dm("hangOn")}<${Impact} schema=${schema} field="defaults.hang_detector" /></label>
1159
1179
  <div class=${fc("field", "hang")}>${L(`${tn("hangTimeout")} (${tn("minutes")})`, "defaults.hang_detector", "g-hang", "hang")}<input id="g-hang" type="number" min="0.1" step="0.5" class=${errors.hang ? "invalid" : ""} value=${f.hang} onInput=${(e) => set("hang")(e.target.value)} /><${Feedback} error=${errors.hang} /></div>
1160
1180
  </div></section>
1181
+ <section class="card" id="g-liveness"><h3>${tn("livenessTitle")}</h3>
1182
+ <p class="note">${tn("livenessHint")}</p>
1183
+ <div class="grid2">
1184
+ <label class=${fc("check", "liveOn")}><input id="g-live-on" type="checkbox" checked=${f.liveOn} onChange=${(e) => set("liveOn")(e.target.checked)} /><span>${tn("livenessEnabled")}</span>${dm("liveOn")}<${Impact} schema=${schema} field="defaults.task_board" /></label>
1185
+ <div class=${fc("field", "liveQuiet")}>${L(`${tn("livenessQuiet")} (${tn("minutes")})`, "defaults.task_board", "g-live-quiet", "liveQuiet")}<input id="g-live-quiet" type="number" min="1" max="1440" step="1" class=${errors.liveQuiet ? "invalid" : ""} value=${f.liveQuiet} onInput=${(e) => set("liveQuiet")(e.target.value)} /><${Feedback} error=${errors.liveQuiet} /></div>
1186
+ <div class=${fc("field", "livePrompt")}>${L(`${tn("livenessPrompt")} (${tn("minutes")})`, "defaults.task_board", "g-live-prompt", "livePrompt")}<input id="g-live-prompt" type="number" min="1" max="1440" step="1" class=${errors.livePrompt ? "invalid" : ""} value=${f.livePrompt} onInput=${(e) => set("livePrompt")(e.target.value)} /><${Feedback} error=${errors.livePrompt} /></div>
1187
+ <div class=${fc("field", "liveCrash")}>${L(`${tn("livenessCrash")} (${tn("minutes")})`, "defaults.task_board", "g-live-crash", "liveCrash")}<input id="g-live-crash" type="number" min="1" max="1440" step="1" class=${errors.liveCrash ? "invalid" : ""} value=${f.liveCrash} onInput=${(e) => set("liveCrash")(e.target.value)} /><${Feedback} error=${errors.liveCrash} /></div>
1188
+ </div></section>
1161
1189
  <section class="card"><h3>${tn("startup")}</h3><div class="grid2">
1162
1190
  <div class=${fc("field", "concurrency")}>${L(tn("concurrency"), "fleet.spawn_concurrency", "g-conc")}<input id="g-conc" type="number" min="1" max="20" step="1" class=${errors.concurrency ? "invalid" : ""} value=${f.concurrency} onInput=${(e) => set("concurrency")(e.target.value)} /><${Feedback} error=${errors.concurrency} warning=${warnings.concurrency} />
1163
1191
  ${f.concurrency.trim() === "" ? html`<${InEffect} text=${tn("concurrencyAuto")} />` : null}</div>
@@ -51,6 +51,10 @@ const ROWS = [
51
51
  ["defaults.agent-mode", "agent-defaults", "#g-am", "settings.agentMode", "defaults.agent_mode", ["agent mode", "mcp", "cli"], ["agent 模式"]],
52
52
  ["defaults.hang-on", "agent-defaults", "#g-hang-on", "settings.hangEnabled", "defaults.hang_detector.enabled", ["hang detector", "stuck", "frozen"], ["卡住偵測", "卡住", "當機"]],
53
53
  ["defaults.hang-timeout", "agent-defaults", "#g-hang", "settings.hangTimeout", "defaults.hang_detector.timeout_minutes", ["hang timeout", "stuck", "minutes"], ["卡住逾時", "逾時"]],
54
+ ["defaults.liveness-on", "agent-defaults", "#g-live-on", "settings.livenessEnabled", "defaults.task_board.liveness.enabled", ["assignee stopped", "dispatcher", "crashed", "quiet", "task board", "liveness"], ["接手者停下來", "派工者", "當掉", "沒有動靜", "任務看板"]],
55
+ ["defaults.liveness-quiet", "agent-defaults", "#g-live-quiet", "settings.livenessQuiet", "defaults.task_board.liveness.quiet_minutes", ["quiet", "idle", "claimed card", "minutes"], ["沒有動靜", "閒置", "接了卡"]],
56
+ ["defaults.liveness-prompt", "agent-defaults", "#g-live-prompt", "settings.livenessPrompt", "defaults.task_board.liveness.prompt_minutes", ["prompt", "permission", "waiting", "minutes"], ["提示", "權限", "等待"]],
57
+ ["defaults.liveness-crash", "agent-defaults", "#g-live-crash", "settings.livenessCrash", "defaults.task_board.liveness.crash_grace_minutes", ["crashed", "crash grace", "minutes"], ["當掉", "恢復"]],
54
58
  ["defaults.concurrency", "agent-defaults", "#g-conc", "settings.concurrency", "startup.concurrency", ["startup", "concurrency", "parallel", "spawn"], ["啟動", "並行"]],
55
59
  ["defaults.project-roots", "agent-defaults", "#g-roots", "settings.projectRootsTitle", "project_roots", ["project roots", "folders", "directory", "where agents work", "working directory"], ["專案資料夾", "資料夾", "目錄", "工作目錄"]],
56
60
  ["defaults.stagger", "agent-defaults", "#g-stag", "settings.staggerDelay", "startup.stagger_delay_ms", ["startup", "stagger", "delay"], ["啟動", "間隔", "延遲"]],
@@ -103,6 +103,13 @@ register("settings", {
103
103
  advancedSection: "Advanced",
104
104
  hangEnabled: "Hang detector enabled",
105
105
  hangTimeout: "Stuck timeout",
106
+ livenessTitle: "When an assignee stops",
107
+ livenessHint: "Tells the agent that handed out a card when its assignee crashes and does not come back, is paused (sign-in ended, usage limit, errors), looks stuck, waits on a prompt, or stays quiet with the card claimed. Only a message: nothing is restarted or reassigned.",
108
+ livenessEnabled: "Tell the dispatcher",
109
+ livenessQuiet: "Quiet with a claimed card after",
110
+ livenessPrompt: "Waiting on a prompt after",
111
+ livenessCrash: "Crashed and not back after",
112
+ livenessRange: "A number of minutes from 1 to 1440.",
106
113
  agentMode: "Agent mode",
107
114
  toolSet: "Tool set",
108
115
  toolSetUnset: "Not set ({0}; a General: {1})",
@@ -763,6 +770,13 @@ register("settings", {
763
770
  advancedSection: "進階",
764
771
  hangEnabled: "啟用卡住偵測",
765
772
  hangTimeout: "卡住逾時",
773
+ livenessTitle: "接手者停下來時",
774
+ livenessHint: "卡片的接手者當掉沒恢復、暫停(登入到期、用量上限、錯誤)、看起來卡住、卡在提示上,或接了卡卻一直沒有動靜時,通知派出這張卡的 Agent。只發訊息,不會自動重啟或改派。",
775
+ livenessEnabled: "通知派工者",
776
+ livenessQuiet: "接了卡卻沒有動靜超過",
777
+ livenessPrompt: "卡在提示上超過",
778
+ livenessCrash: "當掉沒恢復超過",
779
+ livenessRange: "請輸入 1 到 1440 之間的分鐘數。",
766
780
  agentMode: "Agent 模式",
767
781
  toolSet: "工具集",
768
782
  toolSetUnset: "未設定({0};General 為 {1})",
@@ -116,7 +116,7 @@ register("app", {
116
116
  confirmTitle: "Please confirm", confirmOk: "Continue", cancel: "Cancel",
117
117
  sidePanelLeave: "Leave {0} without saving? Your changes there will be lost.", sidePanelDiscard: "Discard changes",
118
118
  // The server's own wording (src/locale.ts needs.reason.*), so the web says what Discord says.
119
- needs_reason_hang: "Not responding", needs_reason_exited: "Exited", needs_reason_assist: "Waiting at its terminal", needs_reason_question: "Asking you a question", needs_reason_permission: "Permission needed", needs_reason_dangerous_command: "Dangerous command waiting", needs_reason_login: "Waiting to connect its AI account", needs_reason_dialog: "Waiting at a dialog", needs_reason_kiro_choice: "Kiro needs your decision", needs_reason_terminal_input: "May be waiting for input", needs_reason_auth_paused: "Paused: AI account not connected", needs_reason_backend_signin: "AI account needs connecting", needs_reason_config_invalid: "Configuration file needs attention", needs_reason_config_fallback: "Running on stored configuration", config_history_edit: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. The next restart would use the stored valid copy from {4}. Correct the YAML error; the file has not been changed by AgEnD.", config_history_no_history: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. No stored valid copy is available, so the next restart cannot recover automatically. Correct the YAML error before restarting; the file has not been changed by AgEnD.", config_history_fallback: "{0}, line {1}, column {2}: {3}. AgEnD started using the stored valid copy from {4}. Correct the YAML error and reload the settings. The file on disk has not been changed by AgEnD.", needs_reason_crashed: "Crashed", needs_reason_usage_limit: "Usage limit reached · reset time unknown", needs_reason_delivery_uncertain: "Could not confirm delivery", needs_reason_delivery_failed: "Delivery failed", needs_reason_missed_offline: "Missed while AgEnD was offline", needs_reason_task_review: "Waiting for your confirmation", needs_reason_task_blocked: "Blocked: asks you",
119
+ needs_reason_hang: "Not responding", needs_reason_exited: "Exited", needs_reason_assist: "Waiting at its terminal", needs_reason_question: "Asking you a question", needs_reason_permission: "Permission needed", needs_reason_dangerous_command: "Dangerous command waiting", needs_reason_login: "Waiting to connect its AI account", needs_reason_dialog: "Waiting at a dialog", needs_reason_kiro_choice: "Kiro needs your decision", needs_reason_terminal_input: "May be waiting for input", needs_reason_auth_paused: "Paused: AI account not connected", needs_reason_backend_signin: "AI account needs connecting", needs_reason_config_invalid: "Configuration file needs attention", needs_reason_config_fallback: "Running on stored configuration", config_history_edit: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. The next restart would use the stored valid copy from {4}. Correct the YAML error; the file has not been changed by AgEnD.", config_history_no_history: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. No stored valid copy is available, so the next restart cannot recover automatically. Correct the YAML error before restarting; the file has not been changed by AgEnD.", config_history_fallback: "{0}, line {1}, column {2}: {3}. AgEnD started using the stored valid copy from {4}. Correct the YAML error and reload the settings. The file on disk has not been changed by AgEnD.", needs_reason_crashed: "Crashed", needs_reason_model_switch: "Claude model switched", needs_reason_usage_limit: "Usage limit reached · reset time unknown", needs_reason_delivery_uncertain: "Could not confirm delivery", needs_reason_delivery_failed: "Delivery failed", needs_reason_missed_offline: "Missed while AgEnD was offline", needs_reason_task_review: "Waiting for your confirmation", needs_reason_task_blocked: "Blocked: asks you", needs_reason_task_stalled: "Its assignee went quiet",
120
120
  },
121
121
  "zh-TW": {
122
122
  brand: "AgEnD", fleet: "Fleet", fleetOverview: "Fleet 概覽", view: "檢視", settings: "設定", instances: "Agent", newInstance: "新增 Agent", newAgent: "新增 Agent",
@@ -162,6 +162,6 @@ register("app", {
162
162
  search: "搜尋", searchTitle: "搜尋聊天、agent 之間的訊息與任務({0})",
163
163
  confirmTitle: "請確認", confirmOk: "繼續", cancel: "取消",
164
164
  sidePanelLeave: "不儲存就離開「{0}」?你在那裡的修改會遺失。", sidePanelDiscard: "捨棄修改",
165
- needs_reason_hang: "沒有回應", needs_reason_exited: "已結束", needs_reason_assist: "在終端機上等待", needs_reason_question: "正在問你問題", needs_reason_permission: "需要權限", needs_reason_dangerous_command: "危險指令待確認", needs_reason_login: "等待連接 AI 帳號", needs_reason_dialog: "停在對話框", needs_reason_kiro_choice: "Kiro 需要你決定", needs_reason_terminal_input: "可能在等輸入", needs_reason_auth_paused: "已暫停:AI 帳號未連接", needs_reason_backend_signin: "需要連接 AI 帳號", needs_reason_config_invalid: "設定檔需要處理", needs_reason_config_fallback: "正在使用儲存的設定副本", config_history_edit: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。下次重新啟動會改用 {4} 儲存的有效副本。請修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_no_history: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。沒有可用的有效副本,下次重新啟動將無法自動恢復。請在重新啟動前修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_fallback: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 已使用 {4} 儲存的有效副本啟動。請修正 YAML 錯誤並重新載入設定。AgEnD 未更動磁碟上的檔案。", needs_reason_crashed: "已崩潰", needs_reason_usage_limit: "用量已達上限 · 恢復時間未知", needs_reason_delivery_uncertain: "無法確認是否送達", needs_reason_delivery_failed: "傳送失敗", needs_reason_missed_offline: "AgEnD 離線時錯過", needs_reason_task_review: "等你確認", needs_reason_task_blocked: "卡住,在問你",
165
+ needs_reason_hang: "沒有回應", needs_reason_exited: "已結束", needs_reason_assist: "在終端機上等待", needs_reason_question: "正在問你問題", needs_reason_permission: "需要權限", needs_reason_dangerous_command: "危險指令待確認", needs_reason_login: "等待連接 AI 帳號", needs_reason_dialog: "停在對話框", needs_reason_kiro_choice: "Kiro 需要你決定", needs_reason_terminal_input: "可能在等輸入", needs_reason_auth_paused: "已暫停:AI 帳號未連接", needs_reason_backend_signin: "需要連接 AI 帳號", needs_reason_config_invalid: "設定檔需要處理", needs_reason_config_fallback: "正在使用儲存的設定副本", config_history_edit: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。下次重新啟動會改用 {4} 儲存的有效副本。請修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_no_history: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。沒有可用的有效副本,下次重新啟動將無法自動恢復。請在重新啟動前修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_fallback: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 已使用 {4} 儲存的有效副本啟動。請修正 YAML 錯誤並重新載入設定。AgEnD 未更動磁碟上的檔案。", needs_reason_crashed: "已崩潰", needs_reason_model_switch: "Claude 模型已切換", needs_reason_usage_limit: "用量已達上限 · 恢復時間未知", needs_reason_delivery_uncertain: "無法確認是否送達", needs_reason_delivery_failed: "傳送失敗", needs_reason_missed_offline: "AgEnD 離線時錯過", needs_reason_task_review: "等你確認", needs_reason_task_blocked: "卡住,在問你", needs_reason_task_stalled: "接手者很久沒有動靜",
166
166
  },
167
167
  });
@@ -1,3 +1,4 @@
1
+ import { modelSwitchText } from "./model-observation.js";
1
2
  // #1386 §6.3 (#1408 step 4): browser notifications for "Needs you", per device and opt-in, desktop browsers only.
2
3
  //
3
4
  // The list itself is the app store's `needs` (SSE `needs` / the /ui/poll field — no read of its own, #1374). This
@@ -60,6 +61,7 @@ export async function setNotify(on, env = globalThis) {
60
61
  }
61
62
 
62
63
  export const configDetail = (item) => {
64
+ if (item.modelSwitch) return modelSwitchText(item.modelSwitch);
63
65
  const issue = item.configIssue;
64
66
  return issue ? t(`app.config_history_${issue.mode === "fallback" ? "fallback" : issue.time ? "edit" : "no_history"}`, issue.file, issue.line, issue.column, issue.reason, issue.time || "") : item.detail;
65
67
  };
@@ -89,6 +91,7 @@ export function startNeedsNotifier({ open, env = globalThis } = {}) {
89
91
  const listed = new Set(items.map((i) => i.id));
90
92
  for (const [id, h] of timers) if (!listed.has(id)) { clearTimeout(h); timers.delete(id); }
91
93
  for (const item of items) {
94
+ if (item.quiet) { seen.add(item.id); continue; }
92
95
  if (seen.has(item.id) || timers.has(item.id)) continue;
93
96
  if (!hidden()) { seen.add(item.id); continue; }
94
97
  const wait = item.type === "awaiting_input" ? TERMINAL_WAIT_MS - (now() - item.since) : 0;
@@ -569,11 +569,56 @@ register("pendingHub", {
569
569
  en: { connect: "Connect this Fleet to Hub {0} using your company account. Agent sharing stays separate." },
570
570
  "zh-TW": { connect: "以公司帳號將這個 Fleet 連接到 Hub {0}。分享 Agent 需另外選擇。" },
571
571
  });
572
- function pendingSummaryLine(line) {
573
- if (typeof line !== "string") return line;
572
+ // Optional presentation only. Own namespace works with a retained app-i18n.js; no new import is required.
573
+ register("pendingSummary", {
574
+ en: {
575
+ "settings_confirm.summary.default": "default", "settings_confirm.summary.absent": "absent", "settings_confirm.summary.fingerprint": "fingerprint",
576
+ "settings_confirm.summary.in_effect": "{0} (in effect)", "settings_confirm.summary.inherit": " — {0} agent(s) inherit it: {1}", "settings_confirm.summary.more": " +{0} more",
577
+ "settings_confirm.summary.deleted": "deleted", "settings_confirm.summary.add": "add", "settings_confirm.summary.remove": "remove", "settings_confirm.summary.order": "order",
578
+ "settings_confirm.summary.removed": "field removed (inherit/omitted policy)", "settings_confirm.summary.connections": "ordered connections / primary",
579
+ "settings_confirm.summary.connection": "connection", "settings_confirm.summary.confirmed": "confirmed operation",
580
+ "settings_confirm.summary.role.classicAdmin": "Classic admin (C)", "settings_confirm.summary.role.fleetAdmin": "fleet admin (F)",
581
+ "settings_confirm.summary.role.user": "user", "settings_confirm.summary.role.group": "group", "settings_confirm.summary.role.guild": "guild",
582
+ },
583
+ "zh-TW": {
584
+ "settings_confirm.summary.default": "預設", "settings_confirm.summary.absent": "未設定", "settings_confirm.summary.fingerprint": "指紋",
585
+ "settings_confirm.summary.in_effect": "{0}(實際生效)", "settings_confirm.summary.inherit": " — {0} 個 agent 繼承此設定:{1}", "settings_confirm.summary.more": " 等另外 {0} 個",
586
+ "settings_confirm.summary.deleted": "已刪除", "settings_confirm.summary.add": "新增", "settings_confirm.summary.remove": "移除", "settings_confirm.summary.order": "順序",
587
+ "settings_confirm.summary.removed": "已移除欄位(繼承/未指定的政策)", "settings_confirm.summary.connections": "連接順序/主要連接",
588
+ "settings_confirm.summary.connection": "連接", "settings_confirm.summary.confirmed": "需確認的操作",
589
+ "settings_confirm.summary.role.classicAdmin": "Classic 管理員(C)", "settings_confirm.summary.role.fleetAdmin": "Fleet 管理員(F)",
590
+ "settings_confirm.summary.role.user": "使用者", "settings_confirm.summary.role.group": "群組", "settings_confirm.summary.role.guild": "伺服器",
591
+ },
592
+ });
593
+ const pendingSummaryArguments = Object.fromEntries([
594
+ ...["default", "absent", "fingerprint", "deleted", "add", "remove", "order", "removed", "connections", "connection", "confirmed", "role.classicAdmin", "role.fleetAdmin", "role.user", "role.group", "role.guild"].map(key => [`settings_confirm.summary.${key}`, ""]),
595
+ ["settings_confirm.summary.in_effect", "s"], ["settings_confirm.summary.inherit", "ns"], ["settings_confirm.summary.more", "n"],
596
+ ]);
597
+ function legacyPendingSummaryLine(line) {
574
598
  const known = /^(?:Connect this Fleet to Hub (.+) using your company account\. Agent sharing stays separate\.|以公司帳號將這個 Fleet 連接到 Hub (.+)。分享 Agent 需另外選擇。)$/.exec(line);
575
599
  return known ? t("pendingHub.connect", known[1] ?? known[2]) : line;
576
600
  }
601
+ function pendingSummaryLine(line, descriptor) {
602
+ if (typeof line !== "string") return line;
603
+ if (descriptor != null) {
604
+ if (descriptor.v !== 1 || descriptor.fallback !== line || !Array.isArray(descriptor.parts) || !descriptor.parts.length || descriptor.parts.length > 64) return legacyPendingSummaryLine(line);
605
+ let units = 0;
606
+ const rendered = [];
607
+ for (const part of descriptor.parts) {
608
+ if (typeof part === "string") { units += part.length; rendered.push(part); }
609
+ else {
610
+ if (!part || typeof part.key !== "string" || !Object.prototype.hasOwnProperty.call(pendingSummaryArguments, part.key) || !Array.isArray(part.args)) return legacyPendingSummaryLine(line);
611
+ const shape = pendingSummaryArguments[part.key];
612
+ if (part.args.length !== shape.length || !part.args.every((arg, i) => shape[i] === "s" ? typeof arg === "string" : typeof arg === "number" && Number.isFinite(arg))) return legacyPendingSummaryLine(line);
613
+ units += part.args.reduce((sum, arg) => sum + String(arg).length, 0);
614
+ rendered.push(t(`pendingSummary.${part.key}`, ...part.args));
615
+ }
616
+ if (units > 8192) return legacyPendingSummaryLine(line);
617
+ }
618
+ return rendered.join("");
619
+ }
620
+ return legacyPendingSummaryLine(line);
621
+ }
577
622
  export function PendingChanges({ inline = false } = {}) {
578
623
  const { pendingChanges } = useStore(appStore);
579
624
  const list = pendingChanges || [];
@@ -598,7 +643,7 @@ export function PendingChanges({ inline = false } = {}) {
598
643
  ${p.state === "pending" ? html`<span class="pending-left">${t("app.pendingLeft", mmss(p.deadline - NOW()))}</span>` : null}
599
644
  ${p.dismiss ? html`<button type="button" class="icon-btn" aria-label=${t("app.close")} title=${t("app.close")} onClick=${p.dismiss}><${Icon} name="close" size=${14} /></button>` : null}</div>
600
645
  ${p.label ? html`<div class="pending-label">${p.label}</div>` : null}
601
- ${Array.isArray(p.summary) && p.summary.length ? html`<ul class="pending-summary">${p.summary.map((line, i) => html`<li key=${i}>${pendingSummaryLine(line)}</li>`)}</ul>` : null}
646
+ ${Array.isArray(p.summary) && p.summary.length ? html`<ul class="pending-summary">${p.summary.map((line, i) => html`<li key=${i}>${pendingSummaryLine(line, Array.isArray(p.summary_i18n) && p.summary_i18n.length === p.summary.length ? p.summary_i18n[i] : null)}</li>`)}</ul>` : null}
602
647
  ${p.state === "pending" ? html`<${PendingHow} p=${p} />` : null}
603
648
  ${(p.state === "applying" || p.state === "applied") && p.confirmation && p.confirmation.kind === "web" ? html`<p class="note">${t("app.pendingWeb")}</p>` : null}
604
649
  ${p.state !== "pending" && p.state !== "applying" && p.state !== "applied" && p.outcome && p.outcome.message ? html`<p class="note">${p.outcome.message}</p>` : null}
@@ -531,6 +531,8 @@ html:has(.shell), html:has(.shell) body { overflow: hidden; }
531
531
  /* The bar on a phone: the app's 16 px gutter, and Discard / Save a full tap target. */
532
532
  .p-settings > .s-pending { padding-left: var(--s-4); padding-right: var(--s-4); }
533
533
  .p-settings > .s-pending .btn { min-height: var(--tap); }
534
+ /* #3647: the "When an assignee stops" minutes are phone tap targets (style guide rule 7). */
535
+ .p-settings #g-liveness input { min-height: var(--tap); }
534
536
  /* Settings' dialogs are full-screen sheets (§7): an agent's or a connection's fields get the whole screen, the title on
535
537
  top and the actions at the bottom, inside it. The app's own questions (ask()) stay bottom sheets. */
536
538
  .p-settings .dlg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
@@ -0,0 +1,12 @@
1
+ /* M-2904: Stop in the working bar above the chat composer (it left the composer row, where it took the input's width away).
2
+ Its own file, linked by panel-chat.js when it loads (Prism #3651): a tab opened before this change keeps its older
3
+ app.css, which has no rule for it — on a phone that Stop was 40×30, under the 44 px tap target. */
4
+ .work-bar .btn-stop { flex: none; margin-left: auto; }
5
+ @media (max-width: 899px), (pointer: coarse) { .work-bar .btn-stop { min-height: var(--tap, 44px); min-width: var(--tap, 44px); } }
6
+ /* #3724: one height in every state (idle included: the strip stays, empty), so the thread and the composer never move when the
7
+ agent starts, stops or waits. The height is the Stop button's (desktop: btn-sm's 30 px; phone / touch: the 44 px tap target).
8
+ The status text keeps to one line, cut with an ellipsis; the timer and Stop never shrink. */
9
+ .work-bar { box-sizing: border-box; block-size: 30px; min-block-size: 30px; max-block-size: 30px; overflow: hidden; }
10
+ .work-bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
11
+ .work-bar .elapsed, .work-bar .pulse { flex: none; }
12
+ @media (max-width: 899px), (pointer: coarse) { .work-bar { block-size: var(--tap, 44px); min-block-size: var(--tap, 44px); max-block-size: var(--tap, 44px); } }
@@ -0,0 +1,16 @@
1
+ // Metadata-only presentation. New leaf module: retained shell modules need no new named exports.
2
+ import { register, t } from "./app-i18n.js";
3
+ register("app", { en: { needs_reason_model_switch: "Claude model switched" }, "zh-TW": { needs_reason_model_switch: "Claude 模型已切換" } });
4
+ register("modelObservation", {
5
+ en: { title: "Model switched", safeguards: "Model switched by safeguards", availability: "Model switched due to availability", observed: "Different served model observed",
6
+ turn: "turn", session: "session", unknown: "scope unknown", configured: "Configured model", selection: "Session model", served: "Last served model", unresolved: "Not resolved" },
7
+ "zh-TW": { title: "模型已切換", safeguards: "安全機制已切換模型", availability: "模型因供應狀況而切換", observed: "觀察到不同的回應模型",
8
+ turn: "此回合", session: "此工作階段", unknown: "範圍未知", configured: "設定模型", selection: "工作階段模型", served: "最近回應模型", unresolved: "尚未確認" },
9
+ });
10
+ export const modelName = (value) => {
11
+ const id = String(value || "").replace(/\[1m\]$/i, "").replace(/^claude-/i, "").replace(/-\d{8}$/, "");
12
+ const m = /^(opus|sonnet|haiku)-(\d+)(?:[-.](\d+))?$/i.exec(id);
13
+ return m ? `${m[1][0].toUpperCase()}${m[1].slice(1).toLowerCase()} ${m[2]}${m[3] ? `.${m[3]}` : ""}` : id;
14
+ };
15
+ export const observationLabel = (key) => t(`modelObservation.${key}`);
16
+ export const modelSwitchText = (s) => s ? `${observationLabel(s.cause)}: ${modelName(s.original)} → ${modelName(s.served)} · ${observationLabel(s.scope)}` : "";
@@ -288,7 +288,7 @@ export function CompactRow({ p, onExpand }) {
288
288
  const name = title.profile || title.base;
289
289
  const models = !pools && metrics.some((m) => m.scope === "model");
290
290
  return html`<button type="button" class=${`u-crow${p.stale ? " is-stale" : ""}${pools ? " is-pooled" : ""}${models ? " has-models" : ""}`} aria-expanded="false" title=${`${p.name} — ${tn("usageExpand")}`} onClick=${onExpand}>
291
- <span class="u-crow-head"><span class="u-crow-name">${name}</span>
291
+ <span class="u-crow-head"><span class="u-crow-name">${name}</span>${p.noAgents ? html`<span class="note">${tn("usage.no_agents")}</span>` : null}
292
292
  ${p.plan ? html`<span class="pill u-plan" title=${p.plan}><span aria-hidden="true">${planBadge(p.plan)}</span><span class="sr-only">${p.plan}</span></span>` : null}
293
293
  ${stale && metrics.length ? html`<span class="u-crow-stale" title=${detail}>${p.cachedAt ? tn("usageCachedAt", { at: usageClock(p.cachedAt) }) : stale.mark}<span class="sr-only"> (${detail})</span></span>` : null}</span>
294
294
  ${pools ? pools.map((x) => html`<${CompactMeter} key=${x.pool.label} m=${x.worst} tag=${usageText(x.pool.label, x.pool.labelI18n)}
@@ -377,6 +377,7 @@ export function UsageBody({ owner }) {
377
377
  <button type="button" class="icon-btn" disabled=${i === providers.length - 1} aria-label=${tn("usageMoveDown")} title=${tn("usageMoveDown")} onClick=${() => move(key(p), 1, data.providers)}><${Icon} name="down" size=${14} /></button>
378
378
  </span></div>
379
379
  ${providerTitle(p).profile ? html`<div class="u-profile" title=${p.name}>${providerTitle(p).profile}</div>` : null}
380
+ ${p.noAgents ? html`<p class="note">${tn("usage.no_agents")}</p>` : null}
380
381
  ${p.stale ? html`<p class="note u-stale" title=${staleNote(p).detail || null}>${staleNote(p).mark}</p>${staleNote(p).detail ? html`<p class="note u-stale-detail">${staleNote(p).detail}</p>` : null}` : null}
381
382
  ${p.status === "error" && !p.transient ? html`<p class="u-err">${usageText(p.error || tn("usage.error_fallback"), p.errorI18n)}</p>`
382
383
  : p.status === "error" && p.transient ? html`<p class="note">${usageText(p.error || tn("usage.error_fallback"), p.errorI18n)}</p>`
@@ -88,6 +88,7 @@ register("view", {
88
88
  "usage.empty_active": "No active backends with usage tracking",
89
89
  "usage.not_logged_in": "not logged in",
90
90
  "usage.default_login": "default",
91
+ "usage.no_agents": "No agents on this profile",
91
92
  "usage.error_fallback": "error",
92
93
  "usage.no_data": "no data",
93
94
  "usage.reset.in": "resets in {0}",
@@ -356,6 +357,7 @@ register("view", {
356
357
  "usage.empty_active": "沒有使用中且支援用量追蹤的 Backend",
357
358
  "usage.not_logged_in": "未登入",
358
359
  "usage.default_login": "預設",
360
+ "usage.no_agents": "此帳號目前沒有 Agent",
359
361
  "usage.error_fallback": "錯誤",
360
362
  "usage.no_data": "無資料",
361
363
  "usage.reset.in": "{0} 後重置",