@songsid/agend 2.4.0-beta.32 → 2.4.0-beta.34

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 (55) hide show
  1. package/dist/build-provenance.json +1 -1
  2. package/dist/fleet-manager.d.ts +9 -0
  3. package/dist/fleet-manager.js +26 -2
  4. package/dist/fleet-manager.js.map +1 -1
  5. package/dist/general-knowledge/skills/hub/SKILL.md +10 -4
  6. package/dist/hub/client.js +16 -6
  7. package/dist/hub/client.js.map +1 -1
  8. package/dist/hub/compose/member.js +3 -2
  9. package/dist/hub/compose/member.js.map +1 -1
  10. package/dist/hub/compose/server.js +2 -1
  11. package/dist/hub/compose/server.js.map +1 -1
  12. package/dist/hub/group-policy/resources.d.ts +1 -1
  13. package/dist/hub/http/compose.d.ts +2 -0
  14. package/dist/hub/http/compose.js +45 -6
  15. package/dist/hub/http/compose.js.map +1 -1
  16. package/dist/hub/member-reconciliation.d.ts +2 -0
  17. package/dist/hub/member-reconciliation.js +3 -1
  18. package/dist/hub/member-reconciliation.js.map +1 -1
  19. package/dist/hub/protocol.d.ts +8 -8
  20. package/dist/hub/protocol.js +7 -2
  21. package/dist/hub/protocol.js.map +1 -1
  22. package/dist/hub/receipt-reason.d.ts +6 -0
  23. package/dist/hub/receipt-reason.js +12 -0
  24. package/dist/hub/receipt-reason.js.map +1 -0
  25. package/dist/hub/representative.d.ts +2 -0
  26. package/dist/hub/representative.js +7 -3
  27. package/dist/hub/representative.js.map +1 -1
  28. package/dist/hub/rooms/direct-view.js +2 -0
  29. package/dist/hub/rooms/direct-view.js.map +1 -1
  30. package/dist/hub/rooms/types.d.ts +2 -0
  31. package/dist/hub/rooms.d.ts +12 -0
  32. package/dist/hub/rooms.js +14 -3
  33. package/dist/hub/rooms.js.map +1 -1
  34. package/dist/hub/server.js +4 -1
  35. package/dist/hub/server.js.map +1 -1
  36. package/dist/hub/settings-member-address-decision.js +1 -1
  37. package/dist/hub/settings-member-address-decision.js.map +1 -1
  38. package/dist/hub/settings-web-address-decision.js +2 -2
  39. package/dist/hub/settings-web-address-decision.js.map +1 -1
  40. package/dist/instance-lifecycle.d.ts +2 -0
  41. package/dist/instance-lifecycle.js +4 -0
  42. package/dist/instance-lifecycle.js.map +1 -1
  43. package/dist/turn-reply-guard.js +4 -1
  44. package/dist/turn-reply-guard.js.map +1 -1
  45. package/dist/ui/hub-assistant-admin.js +10 -3
  46. package/dist/ui/hub-assistant-usage-strings.js +8 -0
  47. package/dist/ui/hub-owner-strings.js +2 -2
  48. package/dist/ui/hub-room-composer.js +9 -2
  49. package/dist/ui/hub-room-strings.js +2 -2
  50. package/dist/ui/hub-room-thread.js +37 -9
  51. package/dist/ui/panel-hub.js +1 -1
  52. package/dist/ui/shared/chat-msg-actions.js +1 -1
  53. package/dist/ui/shared/chat-thread.js +1 -1
  54. package/dist/ui/shared/hub-owner.css +12 -0
  55. package/package.json +1 -1
@@ -68,7 +68,8 @@ export class TurnReplyGuard {
68
68
  if (!this.active || this.active.cancelledByUser) {
69
69
  const carried = this.pendingActivityAt >= ingressAt ? this.pendingActivityAt : 0;
70
70
  this.pendingActivityAt = 0;
71
- const pending = this.pendingTool && this.pendingTool.at >= ingressAt ? this.pendingTool : null;
71
+ // Generic pre-arm tools have no Hub message/cid proof. Exact Hub ACKs have their own private route record.
72
+ const pending = !target.hubRoute && this.pendingTool && this.pendingTool.at >= ingressAt ? this.pendingTool : null;
72
73
  this.pendingTool = null;
73
74
  this.active = {
74
75
  generation: ++this.generation,
@@ -158,6 +159,8 @@ export class TurnReplyGuard {
158
159
  return;
159
160
  const active = this.active;
160
161
  if (token.generation === PRE_ARM_GENERATION) {
162
+ if (active?.target.hubRoute)
163
+ return;
161
164
  if (active && !active.cancelledByUser) {
162
165
  this.applySettle(active, token, delivered, active.latestObligation);
163
166
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"turn-reply-guard.js","sourceRoot":"","sources":["../src/turn-reply-guard.ts"],"names":[],"mappings":"A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AAC,iBAAiB,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;CACF"}
@@ -2,6 +2,7 @@ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
2
2
  import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
3
3
  import { hroom } from "./hub-room-strings.js";
4
4
  import { ha } from "./hub-assistant-admin-strings.js";
5
+ import { hu } from "./hub-assistant-usage-strings.js";
5
6
  import { dateTimeText } from "/assets/clock-text.js";
6
7
 
7
8
  const fields = value => ({ enabled: value.enabled === true, backend: value.backend, account: value.account ?? null, cap: Number(value.cap), idleMinutes: Number(value.idleMinutes) });
@@ -79,8 +80,14 @@ export function HubAssistantAdmin({ client }) {
79
80
  ${running.length ? html`<div class="hub-rows">${running.map(row => html`<div class="s-row hub-row" key=${row.roomId}><span class="hub-row-text"><strong title=${row.roomName}>${row.roomName}</strong><small class="note">${hroom("lastUsed")} · ${dateTimeText(row.lastUsed, { dateStyle: "short", timeStyle: "short", hour12: false })}</small></span>
80
81
  <span class=${`tag ${row.state === "failed" ? "warn" : ""}`}>${stateWord(row.state)}</span><button type="button" class="btn btn-sm" disabled=${busy || row.state === "stopping"} onClick=${() => stop(row.roomId)}>${hroom("stop")}</button></div>`)}</div>` : html`<p class="note">${ha("noneRunning")}</p>`}
81
82
  </section>
82
- <section class="card" aria-label=${hroom("usage")}><h3>${hroom("usage")}</h3><p class="note">${hroom("usageLead")}</p>
83
- ${usage?.ok ? html`<div class="s-row note"><span>${ha("day")}</span><span>${ha("answers")}</span></div><div class="hub-rows">${usage.days.map(row => html`<div class="s-row" key=${row.day}><time datetime=${row.day}>${new Date(`${row.day}T00:00:00Z`).toLocaleDateString(undefined, { month: "numeric", day: "numeric", timeZone: "UTC" })}</time><strong>${row.count}</strong></div>`)}</div><p>${hroom("aiAccount")} · <span class="tag">${quotaWord(usage.quota?.band)}</span></p>
84
- ${usage.note === "usage-not-saved" ? html`<p class="note" role="status">${ha("usageNotSaved")}</p>` : null}` : html`<${ErrorState} message=${ha("usageFailed")} onRetry=${() => load(false)} />`}
83
+ <section class="card hub-assistant-usage" aria-label=${hroom("usage")}><h3>${hroom("usage")}</h3><p class="note">${hroom("usageLead")}</p>
84
+ ${!usage?.ok ? html`<${ErrorState} message=${ha("usageFailed")} onRetry=${() => load(false)} />`
85
+ // M-3957: an assistant that is off with no answer in the window has nothing to count; seven 0 rows read as "the Hub is
86
+ // unused". The unsaved-counts warning below stays in both branches.
87
+ : html`${!view.enabled && usage.days.every(row => !row.count) ? html`<p class="note" role="status">${hu("off")}</p>`
88
+ : html`<table><thead><tr><th scope="col">${ha("day")}</th><th scope="col" class="n">${ha("answers")}</th></tr></thead>
89
+ <tbody>${usage.days.map(row => html`<tr key=${row.day}><td><time datetime=${row.day}>${new Date(`${row.day}T00:00:00Z`).toLocaleDateString(undefined, { month: "numeric", day: "numeric", timeZone: "UTC" })}</time></td><td class="n">${row.count}</td></tr>`)}</tbody></table>
90
+ <p class="note">${hroom("aiAccount")} · <span class="tag">${quotaWord(usage.quota?.band)}</span></p>`}
91
+ ${usage.note === "usage-not-saved" ? html`<p class="note" role="status">${ha("usageNotSaved")}</p>` : null}`}
85
92
  </section>`;
86
93
  }
@@ -0,0 +1,8 @@
1
+ // M-3957: the room assistant's Usage card, words added after hub-assistant-admin-strings.js shipped. A module of its own, so
2
+ // a tab holding an older dictionary still has every word (upgrade skew); the card imports it next to the shared one.
3
+ import { register, t } from "/assets/app-i18n.js";
4
+ register("hubAssistantUsage", {
5
+ en: { off: "The room assistant is off and has not answered in the last 7 days." },
6
+ "zh-TW": { off: "房間助理沒有開啟,近 7 天也沒有回答。" },
7
+ });
8
+ export const hu = (key, ...args) => t(`hubAssistantUsage.${key}`, ...args);
@@ -19,7 +19,7 @@ register("hubOwner", {
19
19
  pairedFleets: "Connected fleets · {0}", pauseGo: "Stop sharing…", pauseLead: "No one can ask it any more. To share it again, it has to be shared again from its fleet, and everyone has to be allowed to ask again. What was asked stays readable.",
20
20
  pauseTitle: "Stop sharing", pendingLead: "Check that this fingerprint matches the one your fleet shows, then confirm.",
21
21
  pendingPairings: "Pairings waiting for you", recent: "Recent questions",
22
- recentLead: "Who asked and when, and whether it was answered. What they asked stays in your fleet's chat.", recentNone: "No one has asked yet.",
22
+ recentLead: "Who asked and when, and whether it was answered. What they asked goes only to the agent's own conversation; it isn't posted in your Fleet chat.", recentNone: "No one has asked yet.",
23
23
  refresh: "Refresh", revokeItem: "Revoke…", revokedTag: "Revoked", rowMenu: "More for {0}", scopeHub: "This Hub", scopeYou: "Yours",
24
24
  yourAgentsCount: "My agents · {0}", sharedCount: "Shared · {0}", stageAnswered: "Answered", stageNot: "Not answered", stageWaiting: "Waiting", statePaused: "Sharing stopped on the Hub",
25
25
  stateShared: "Shared", stateWithdrawn: "Withdrawn", stepApprove: "You approve", stepApproveHint: "Check the same fingerprint, then approve.",
@@ -36,7 +36,7 @@ register("hubOwner", {
36
36
  mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 Fleet 的「設定 → Hub」。", mineLeadShort: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。", noFleets: "還沒有已連接的 Fleet。",
37
37
  ownerChecked: "擁有者已確認", ownerLogin: "擁有者的登入名稱", pairSteps: "配對一個 Fleet", pairedFleets: "已連接的 Fleet · {0}", pauseGo: "停止分享…",
38
38
  pauseLead: "之後沒有人能再向它提問。要再分享,必須回到它的 Fleet 重新分享,而且每個人都要重新允許提問。已經問過的內容仍然看得到。", pauseTitle: "停止分享", pendingLead: "確認這個指紋和你 Fleet 上顯示的一致,再按確認。", pendingPairings: "等你核對的配對",
39
- recent: "最近的提問", recentLead: "誰問的、什麼時候,有沒有回答。問了什麼留在你 Fleet 的聊天裡。", recentNone: "還沒有人問過。", refresh: "重新整理", revokeItem: "撤銷…", revokedTag: "已撤銷",
39
+ recent: "最近的提問", recentLead: "誰問的、什麼時候,有沒有回答。問題只會送到這個 Agent 自己的對話裡,不會貼到你 Fleet 的聊天。", recentNone: "還沒有人問過。", refresh: "重新整理", revokeItem: "撤銷…", revokedTag: "已撤銷",
40
40
  rowMenu: "{0} 的更多動作", scopeHub: "這個 Hub", scopeYou: "你的", yourAgentsCount: "我的 Agent · {0}", sharedCount: "分享中 · {0}", stageAnswered: "已回答", stageNot: "未回答", stageWaiting: "等待中",
41
41
  statePaused: "已在 Hub 停止分享", stateShared: "分享中", stateWithdrawn: "已停止分享", stepApprove: "你核准", stepApproveHint: "核對同一個指紋後核准。", stepCode: "產生配對碼",
42
42
  stepCodeHint: "給 Fleet 的擁有者:10 分鐘內在他的 Fleet 輸入,只能用一次。", stepOwner: "擁有者核對指紋", stepOwnerHint: "在他的 Fleet 上,然後在這個 Hub 的「我的 Agent」確認。",
@@ -241,9 +241,16 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
241
241
  // M-3125: `canSendEmpty` — files are ready to go, so a post may be the files alone (the server takes it).
242
242
  const text = value.trim(); if ((!text && !canSendEmpty) || busy || closed) return;
243
243
  setBusy(true); setMsg(null);
244
- const r = await store.send(text, { mentions: boundMentions(value, detail, bindings.current), ...(reply ? { replyTo: reply.roomMessage } : {}) });
244
+ // M-3951: the box empties at once, as the Fleet chat's does (the message is already drawn); a refusal puts it back
245
+ // unless something new was typed meanwhile.
246
+ const was = { value, bindings: bindings.current, reply };
247
+ setValue(""); bindings.current = []; onReply(null);
248
+ const r = await store.send(text, { mentions: boundMentions(was.value, detail, was.bindings), ...(was.reply ? { replyTo: was.reply.roomMessage } : {}) });
245
249
  setBusy(false);
246
- if (r.ok) { setValue(""); bindings.current = []; onReply(null); } else setMsg({ text: refusalText(r), retry: retryable(r) });
250
+ if (!r.ok) {
251
+ if (!input.current?.value) { setValue(was.value); bindings.current = was.bindings; if (was.reply) onReply(was.reply); }
252
+ setMsg({ text: refusalText(r), retry: retryable(r) });
253
+ }
247
254
  };
248
255
  const onKeyDown = (e) => {
249
256
  if (palette && (e.key === "ArrowDown" || e.key === "ArrowUp")) { e.preventDefault(); setPick((i) => (i + (e.key === "ArrowDown" ? 1 : palette.length - 1)) % palette.length); return; }
@@ -137,7 +137,7 @@ register("hubRoom", {
137
137
  assistantQuota: "The room assistant uses this account's quota.",
138
138
  aiAccount: "AI account", cap: "At most this many at once", idleMinutes: "Stop after this many idle minutes",
139
139
  runningNow: "Now", stop: "Stop", lastUsed: "Last used",
140
- usage: "Usage", usageLead: "Answers per day for the last 7 days",
140
+ usage: "Room assistant usage", usageLead: "How many times the Hub's room assistant answered each day, last 7 days. Questions to shared agents are counted on Overview.",
141
141
  quotaPlenty: "Plenty", quotaLow: "Running low", quotaGone: "Used up",
142
142
  assistantNotEnabled: "The room assistant is not enabled yet.",
143
143
  assistantEnableHint: "Sign in an AI account in AgEnD on this computer, then come back and turn it on.",
@@ -285,7 +285,7 @@ register("hubRoom", {
285
285
  assistantQuota: "房間助理使用這個帳號的額度。",
286
286
  aiAccount: "AI 帳號", cap: "同時最多幾個", idleMinutes: "閒置幾分鐘後停止",
287
287
  runningNow: "現在", stop: "停止", lastUsed: "最後使用",
288
- usage: "用量", usageLead: "近 7 天每天的回答次數",
288
+ usage: "房間助理用量", usageLead: "Hub 房間助理近 7 天每天回答的次數。分享的 Agent 收到的提問算在「總覽」。",
289
289
  quotaPlenty: "充足", quotaLow: "快用完", quotaGone: "用完",
290
290
  assistantNotEnabled: "房間助理還沒有啟用。",
291
291
  assistantEnableHint: "先在這台電腦的 AgEnD 登入一個 AI 帳號,再回來開啟。",
@@ -73,7 +73,7 @@ function useNarrowScreen() {
73
73
  /** M-3311 (3): a room message's address — what Copy link copies; opening it shows that message (jumpParam). */
74
74
  export const messageLink = (roomId, messageId) => `${location.origin}/ui/hub?room=${encodeURIComponent(roomId)}${messageId ? `&m=${encodeURIComponent(messageId)}` : ""}`;
75
75
  /** M-3311 (#4159 review): a room row's Copy link — only a message with an address (a room message's id); otherwise none. */
76
- export const roomLinkOf = (roomId) => (x) => (x && x.roomMessage ? messageLink(roomId, x.roomMessage) : null);
76
+ export const roomLinkOf = (roomId) => (x) => (x && x.roomMessage && !x.pending ? messageLink(roomId, x.roomMessage) : null);
77
77
  /** M-3127 C: the message a search hit opens (`?room=…&m=<id>`), or null. */
78
78
  export const jumpParam = () => { try { const v = new URLSearchParams(location.search).get("m"); return v && /^[A-Za-z0-9-]{1,64}$/.test(v) ? v : null; } catch { return null; } };
79
79
  const iso = (ms) => (Number.isFinite(ms) && ms > 0 ? new Date(ms).toISOString() : undefined);
@@ -135,6 +135,21 @@ export function askState(ask) {
135
135
  }
136
136
  return { line: parts.join(" · "), ...(reason ? { reason } : {}) };
137
137
  }
138
+ /**
139
+ * M-3951: my 1:1 question's mark, as the Fleet chat draws its own (◷ waiting, ✓ handed over, ✓✓ the agent has it,
140
+ * ! not delivered, ⊘ dropped). From the Hub's receipt stage, and its answer row: one that is working, or an answer,
141
+ * means the agent has it. Null when the Hub sent no stage (an older Hub): no mark, as before.
142
+ */
143
+ export function directDelivery(m, messages) {
144
+ const stage = m && m.receiptStage;
145
+ if (typeof stage !== "string") return null;
146
+ const answer = Array.isArray(messages) ? messages.find((x) => x && x.answerTo === m.id && x.author?.kind === "agent") : null;
147
+ if (stage === "answered" || stage === "consumed" || answer?.stage === "working" || (answer && answer.text)) return "delivered";
148
+ if (stage === "delivered") return "processing";
149
+ if (stage === "queued") return "queued";
150
+ if (stage === "cancelled" || stage === "uncertain") return "cancelled";
151
+ return "failed";
152
+ }
138
153
  /** When the server has not yet named failed/blocked, a stored `not-answered` child is failed. */
139
154
  function askOf(m, messages) {
140
155
  const ask = m && m.ask;
@@ -215,7 +230,8 @@ export function toThreadMessages(messages, { meId, ids, direct = false, expanded
215
230
  out.push({ boot: BOOT, id, role: kind === "person" && !author.via ? "user" : "agent", sender: authorLine(author, mine, direct), ts: iso(m.at), text: String(m.text || ""), mine,
216
231
  ...(sourceBadge ? { sourceBadge } : {}), ...(kind === "agent" && author.id ? { authorMember: String(author.id) } : {}),
217
232
  ...(kind === "person" && !mine && !author.via ? { person: true } : {}), // Lumen (spec §3): someone else's words, a bubble on the left
218
- roomMessage: m.id, ...(mine && state?.delivery && !neutralNoReply && !deliveredLine ? { delivery: state.delivery } : {}),
233
+ roomMessage: m.id, ...(m.id.startsWith("local:") ? { pending: true } : {}), ...(direct && mine && directDelivery(m, messages) ? { delivery: directDelivery(m, messages) }
234
+ : mine && state?.delivery && !neutralNoReply && !deliveredLine ? { delivery: state.delivery } : {}),
219
235
  // M-3125: a post's files, as the 1:1 chat maps them (images inline through the Hub's own route; HTML gets its preview card).
220
236
  ...(() => { const files = Array.isArray(m.files) ? m.files.map(hubFileAttachment).filter(Boolean) : []; return files.length ? { attachments: files } : {}; })(),
221
237
  ...(!direct && Array.isArray(m.reactions) && m.reactions.length ? { reactionBar: reactionBar(m.reactions, { meId, names }) } : {}),
@@ -259,7 +275,9 @@ export function createRoomStore(roomId, { client, meId = "", pinsOn = false } =
259
275
  if (!m || m.roomId !== roomId || typeof m.id !== "string") return;
260
276
  const i = st.messages.findIndex((x) => x.id === m.id || (m.idempotencyKey && x.idempotencyKey === m.idempotencyKey));
261
277
  // The server always sends the whole message: one without reactions has none left (M-3127), never the old ones.
262
- if (i >= 0) { const next = { ...st.messages[i], ...m }; if (!("reactions" in m)) delete next.reactions; st.messages[i] = next; } else st.messages.push(m);
278
+ // M-3951: my message drawn at send (`local:`) is replaced whole: its optimistic stage never outlives the Hub's copy.
279
+ if (i >= 0 && st.messages[i].id.startsWith("local:")) st.messages[i] = m;
280
+ else if (i >= 0) { const next = { ...st.messages[i], ...m }; if (!("reactions" in m)) delete next.reactions; st.messages[i] = next; } else st.messages.push(m);
263
281
  };
264
282
  const readDetail = async () => { const d = await client.room(roomId); if (!st.live) return; if (d.ok) st.detail = d; else if (!st.detail) st.error = d.code || "failed"; };
265
283
  async function refresh() {
@@ -338,12 +356,21 @@ export function createRoomStore(roomId, { client, meId = "", pinsOn = false } =
338
356
  filesV1: true,
339
357
  async send(text, { mentions = [], replyTo, files } = {}) {
340
358
  const idempotencyKey = (globalThis.crypto?.randomUUID?.() || `${Date.now()}-${Math.random()}`).replace(/[^A-Za-z0-9-]/g, "");
341
- const r = await client.sendRoomMessage(roomId, { text, mentions, replyTo, idempotencyKey, ...(files?.length ? { files } : {}) });
359
+ // M-3951: my message shows at once, as the Fleet chat's does: in a 1:1 with its ◷ until the Hub's copy replaces it.
360
+ // Files keep today's path (their chips stay in the composer until the Hub has them).
361
+ const me = st.detail?.me?.id || meId, local = `local:${idempotencyKey}`, draws = !files?.length && !!text && !!me;
362
+ if (draws) { st.messages.push({ id: local, roomId, at: Date.now(), author: { kind: "person", id: me, name: "" }, text, mentions, idempotencyKey,
363
+ ...(replyTo ? { replyTo } : {}), ...(st.detail?.room?.kind === "direct" ? { receiptStage: "queued" } : {}) }); changed(); }
364
+ let r;
365
+ try { r = await client.sendRoomMessage(roomId, { text, mentions, replyTo, idempotencyKey, ...(files?.length ? { files } : {}) }); }
366
+ finally { if (draws) st.messages = st.messages.filter((m) => m.id !== local); }
342
367
  // The stored message, as the Hub answers it: `{ message }`, or the message itself (Ridge's server) — drawn at once,
343
368
  // whether or not the stream is up yet (a first send after opening the room must not vanish).
344
369
  const { ok, ...bare } = r || {};
345
370
  const sent = r && r.message ? r.message : ok && typeof bare.id === "string" && typeof bare.roomId === "string" ? bare : null;
346
- if (ok && sent) { upsert(sent); changed(); }
371
+ // The stream's copy, when it came first, is at least as new as the send's answer (its stage may already be ✓).
372
+ if (ok && sent && !st.messages.some((m) => m.id === sent.id)) upsert(sent);
373
+ if (draws || (ok && sent)) changed();
347
374
  return r;
348
375
  },
349
376
  older, findQuoted,
@@ -573,18 +600,19 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
573
600
  // read when the thread draws (the thread keeps its options from its first render, before the room's members are known).
574
601
  const labels = () => [hroom("mentionAll"), hroom("mentionAssistant"), ...(store.detail()?.members || []).filter((m) => m.kind !== "assistant").map((m) => `@${m.name}`)];
575
602
  const extra = {
576
- isUser: (x) => x.mine === true, canReply: () => !store.closed(),
603
+ // M-3951: a message still being sent (no Hub id yet) cannot be replied to, reacted to or pinned.
604
+ isUser: (x) => x.mine === true, canReply: (x) => !store.closed() && !x?.pending,
577
605
  // M-3565: an agent's name opens its member card (its "@ it here", "Chat with it one-to-one"); its source in the card.
578
606
  senderBadge: (el, msg) => mountSourceAuthor(el, msg, (id) => focusMember(id)),
579
607
  mentionLabels: labels,
580
608
  // A line's one action: 「展開其餘 N 則」, or 「請房間助理整理」 (spec §10: the same as sending 「@房間助理 整理上面的回答」).
581
609
  statusAction: (arg) => { if (String(arg).startsWith("summarise:")) { if (!store.closed()) void store.send(hroom("summarisePrompt"), { mentions: ["assistant"] }); } else store.expand(arg); },
582
- startReply: (x) => { setReply(x); setTimeout(() => input.current?.focus(), 0); },
610
+ startReply: (x) => { if (x?.pending) return; setReply(x); setTimeout(() => input.current?.focus(), 0); },
583
611
  findQuoted: (key) => store.findQuoted(key),
584
612
  // M-3127: people's reactions — a group room's messages (not a room line), while the room is open to me. Read when the
585
613
  // thread draws: these options are kept from the first render, before the room's kind is known.
586
614
  react: (x, emoji, on) => { void store.react(x.roomMessage, emoji, on).then((r) => { if (!r?.ok && r?.code !== "closed") toast(hroom("reactFailed"), false); }); },
587
- canReact: () => store.detail()?.room?.kind === "group" && !store.closed(),
615
+ canReact: (x) => store.detail()?.room?.kind === "group" && !store.closed() && !x?.pending,
588
616
  reactText: (k) => (k === "add" ? hroom("reactAdd") : k === "pick" ? hroom("reactPick") : ""),
589
617
  reactLabel: hroom("reactAdd"), // the message menu's React (web-claude's HubThread, M-3117 PR 2: phones)
590
618
  // M-3125 PR3: a room picture opens full size in the page; 「標註」 then quotes the marked-up copy here — it joins this
@@ -598,7 +626,7 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
598
626
  // M-3340: the Fleet chat's Pin / Unpin — mine only (read when the menu opens: the pins arrive after the first render).
599
627
  pin: (x) => { void togglePin(x.roomMessage); },
600
628
  pinned: (x) => store.isPinned(x.roomMessage),
601
- canPin: (x) => store.pinsOffered() && !!x.roomMessage && x.role !== "status",
629
+ canPin: (x) => store.pinsOffered() && !!x.roomMessage && !x.pending && x.role !== "status",
602
630
  };
603
631
  // M-3340: pin or unpin a message for me; said in a toast either way (as the Fleet chat says it).
604
632
  async function togglePin(messageId) {
@@ -989,7 +989,7 @@ function HubThread({ store, name, panelKey, threadRef, extra = null, emptyView =
989
989
  const ex = extra || {};
990
990
  const offActions = installMessageActions(list, {
991
991
  t: threadT, messageOf: thread.messageOf, rove: thread.rove, copyText, notice: (text, ok = true) => toast(text, ok),
992
- canReply: () => (typeof ex.canReply === "function" ? ex.canReply() !== false : false) && typeof ex.startReply === "function",
992
+ canReply: (x) => (typeof ex.canReply === "function" ? ex.canReply(x) !== false : false) && typeof ex.startReply === "function",
993
993
  reply: (x) => ex.startReply?.(x),
994
994
  // React opens the thread's picker for that message (extra.react is the thread's own add/remove call, with an emoji).
995
995
  ...(typeof ex.react === "function" ? { react: (x) => thread.pickReaction?.(msgKey(x)), canReact: (x) => !!x.roomMessage && ex.canReact?.(x) !== false, reactLabel: ex.reactLabel } : {}),
@@ -100,7 +100,7 @@ export function installMessageActions(list, deps) {
100
100
  function openMenu(row, x, y) {
101
101
  closeMenu();
102
102
  const items = [];
103
- if (deps.canReply?.() !== false) items.push(["reply", deps.t("chat.reply"), () => deps.reply(row)]);
103
+ if (deps.canReply?.(row) !== false) items.push(["reply", deps.t("chat.reply"), () => deps.reply(row)]);
104
104
  if (typeof deps.pin === "function" && deps.canPin?.(row) !== false) {
105
105
  const on = deps.pinned?.(row) === true;
106
106
  items.push([on ? "unpin" : "pin", deps.t(on ? "chat.unpin" : "chat.pin"), () => deps.pin(row)]);
@@ -212,7 +212,7 @@ export function createThread(list, scroller, opts) {
212
212
  // M-3127: a Hub room (opts.react, a message of the room) also offers Add reaction in the same strip; the Fleet passes none.
213
213
  const reactable = typeof opts.react === "function" && x.roomMessage && opts.canReact?.(x) !== false;
214
214
  const addReact = reactable ? `<button type="button" class="chip-btn icon-only" data-act="reactPick" data-arg="${escAttr(key)}" aria-haspopup="true" aria-expanded="false" title="${escAttr(reactText("add"))}" aria-label="${escAttr(reactText("add"))}">${REACT}</button>` : "";
215
- const act = opts.canReply?.() === false ? (addReact ? `<div data-trust="thread-control" class="msg-actions">${addReact}</div>` : "") : `<div data-trust="thread-control" class="msg-actions">${addReact}<button type="button" class="chip-btn icon-only" data-act="reply" data-arg="${escAttr(key)}" title="${escAttr(tr("chat.reply"))}" aria-label="${escAttr(tr("chat.reply"))}">${REPLY}</button></div>`;
215
+ const act = opts.canReply?.(x) === false ? (addReact ? `<div data-trust="thread-control" class="msg-actions">${addReact}</div>` : "") : `<div data-trust="thread-control" class="msg-actions">${addReact}<button type="button" class="chip-btn icon-only" data-act="reply" data-arg="${escAttr(key)}" title="${escAttr(tr("chat.reply"))}" aria-label="${escAttr(tr("chat.reply"))}">${REPLY}</button></div>`;
216
216
  // A Hub sender's stateless badge is mounted as DOM below. Its escaped descriptor participates in keyed updates;
217
217
  // Fleet callers supply no senderBadge hook and retain their existing sender markup.
218
218
  const badge = opts.senderBadge && x.sourceBadge ? ` data-source-badge="${escAttr(JSON.stringify(x.sourceBadge))}"` : "";
@@ -68,6 +68,18 @@
68
68
  .hub-join-groups .hub-row-text, .hub-group-hits .hub-row-text { flex: 1 1 12em; min-width: 0; }
69
69
  .hub-join-fleets { flex-direction: row; align-items: center; gap: var(--s-2); margin: 0; }
70
70
  .hub-join-fleets input { width: 4.5em; }
71
+ /* M-3957: the subject (a long AD distinguished name) takes the row's first line and wraps; its controls share the line below,
72
+ on one centre line, Remove at its end. Before, the DN squeezed beside the controls and a phone clipped its last part. */
73
+ .hub-join-groups > .s-row > .hub-row-text { flex: 1 1 100%; }
74
+ .hub-join-groups .hub-group-dn { font-size: var(--fs-sm); white-space: normal; overflow-wrap: anywhere; }
75
+ .hub-join-groups .check { display: inline-flex; align-items: center; gap: var(--s-1); margin: 0; }
76
+ .hub-join-groups > .s-row > .btn { margin-inline-start: auto; }
77
+ /* M-3957: the room assistant's daily answers — a compact two-column table, numbers right-aligned under their heading. */
78
+ .hub-assistant-usage table { width: auto; align-self: flex-start; border-collapse: collapse; font-size: var(--fs-sm); min-width: 12rem; margin-top: var(--s-2); }
79
+ .hub-assistant-usage th { text-align: left; font-weight: normal; color: var(--text-2); padding: var(--s-1) var(--s-5) var(--s-1) 0; border-bottom: 1px solid var(--border); }
80
+ .hub-assistant-usage td { padding: var(--s-1) var(--s-5) var(--s-1) 0; border-bottom: 1px solid var(--border); }
81
+ .hub-assistant-usage tr:last-child td { border-bottom: 0; }
82
+ .hub-assistant-usage .n { text-align: right; font-variant-numeric: tabular-nums; padding-right: 0; }
71
83
  .hub-step-form { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; width: 100%; }
72
84
  .hub-step-form .field { margin: 0; flex: 1 1 14em; min-width: 14em; } /* a phone: the button wraps under the field, never squeezing it */
73
85
  .hub-steps .hub-offer { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; margin: 0; padding: 0; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@songsid/agend",
3
- "version": "2.4.0-beta.32",
3
+ "version": "2.4.0-beta.34",
4
4
  "description": "Multi-agent fleet daemon — run coding CLIs (Claude, Muse, Codex, OpenCode) from Discord or Telegram",
5
5
  "type": "module",
6
6
  "bin": {