@songsid/agend 2.4.0-beta.32 → 2.4.0-beta.35
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.
- package/dist/build-provenance.json +1 -1
- package/dist/delivery-outbox.d.ts +12 -0
- package/dist/delivery-outbox.js +26 -2
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-context.d.ts +11 -0
- package/dist/fleet-manager.d.ts +54 -2
- package/dist/fleet-manager.js +324 -49
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +60 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +10 -4
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +15 -40
- package/dist/hub/client.js +16 -6
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.js +3 -2
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.js +2 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/http/compose.d.ts +2 -0
- package/dist/hub/http/compose.js +45 -6
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/member-reconciliation.d.ts +2 -0
- package/dist/hub/member-reconciliation.js +3 -1
- package/dist/hub/member-reconciliation.js.map +1 -1
- package/dist/hub/protocol.d.ts +8 -8
- package/dist/hub/protocol.js +7 -2
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/receipt-reason.d.ts +6 -0
- package/dist/hub/receipt-reason.js +12 -0
- package/dist/hub/receipt-reason.js.map +1 -0
- package/dist/hub/representative.d.ts +2 -0
- package/dist/hub/representative.js +7 -3
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/rooms/direct-view.js +2 -0
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +2 -0
- package/dist/hub/rooms.d.ts +12 -0
- package/dist/hub/rooms.js +14 -3
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/server.js +4 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/settings-member-address-decision.js +1 -1
- package/dist/hub/settings-member-address-decision.js.map +1 -1
- package/dist/hub/settings-web-address-decision.js +2 -2
- package/dist/hub/settings-web-address-decision.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +2 -0
- package/dist/instance-lifecycle.js +4 -0
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +36 -6
- package/dist/locale.js.map +1 -1
- package/dist/request-context-control-api.d.ts +18 -0
- package/dist/request-context-control-api.js +9 -1
- package/dist/request-context-control-api.js.map +1 -1
- package/dist/settings-effect.js +5 -2
- package/dist/settings-effect.js.map +1 -1
- package/dist/tips.js +1 -1
- package/dist/tips.js.map +1 -1
- package/dist/topic-commands.js +10 -1
- package/dist/topic-commands.js.map +1 -1
- package/dist/turn-reply-guard.js +4 -1
- package/dist/turn-reply-guard.js.map +1 -1
- package/dist/ui/hub-assistant-admin.js +10 -3
- package/dist/ui/hub-assistant-usage-strings.js +8 -0
- package/dist/ui/hub-owner-strings.js +2 -2
- package/dist/ui/hub-room-composer.js +9 -2
- package/dist/ui/hub-room-strings.js +2 -2
- package/dist/ui/hub-room-thread.js +37 -9
- package/dist/ui/panel-chat.js +3 -3
- package/dist/ui/panel-hub.js +1 -1
- package/dist/ui/request-context-control.js +72 -12
- package/dist/ui/shared/app-update.js +35 -5
- package/dist/ui/shared/app.css +21 -0
- package/dist/ui/shared/chat-msg-actions.js +1 -1
- package/dist/ui/shared/chat-strings.js +2 -2
- package/dist/ui/shared/chat-thread.js +1 -1
- package/dist/ui/shared/hub-owner.css +12 -0
- package/dist/ui/shared/update-card-ui.js +21 -7
- package/dist/update-card.d.ts +17 -2
- package/dist/update-card.js +58 -9
- package/dist/update-card.js.map +1 -1
- package/package.json +1 -1
|
@@ -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, ...(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|
package/dist/ui/panel-chat.js
CHANGED
|
@@ -33,7 +33,7 @@ import { Empty, Skeleton } from "/assets/ui-states.js";
|
|
|
33
33
|
import { Icon } from "/assets/ui-icons.js";
|
|
34
34
|
import { recordEdit } from "/assets/text-undo.js";
|
|
35
35
|
import { toast } from "/assets/ui-toast.js";
|
|
36
|
-
import {
|
|
36
|
+
import { openUpdateCard } from "/assets/app-update.js";
|
|
37
37
|
// cc3ce4fe: registered here, not in the shared chat strings, so a newer panel never shows a bare key on an older page.
|
|
38
38
|
register("nativecli", {
|
|
39
39
|
en: { unverified:"Not yet verified", unverifiedHint:"{0} {1}: AgEnD has not tested this version in Windows panes yet. It still runs; any screen AgEnD does not recognise stops and waits for you in Needs you." },
|
|
@@ -1417,7 +1417,7 @@ function Composer({ name, inst, label = name, lease, busy, bindings, ids = {}, f
|
|
|
1417
1417
|
const machineUnavailable = !!inst?.machine_id && inst.machine_status !== "online";
|
|
1418
1418
|
const sendingBlocked = machineUnavailable || inst?.native_blocked || inst?.native_busy || (busy && !supportsInstanceFeature(inst,"send_while_busy"));
|
|
1419
1419
|
const palette0 = !commandsSupported || files.length || closedFor === value || (guest && !guestAllowed.length) ? null : paletteFor(value, guestAllowed || undefined);
|
|
1420
|
-
// M-2738 (D3): /update is the fleet's, not the agent's: offered (never to a guest)
|
|
1420
|
+
// M-2738 (D3): /update is the fleet's, not the agent's: offered (never to a guest). M-3967: it opens the update card.
|
|
1421
1421
|
const palette = palette0 && !guest && UPDATE_COMMAND.name.startsWith(value.slice(1)) ? [...palette0, UPDATE_COMMAND] : palette0;
|
|
1422
1422
|
const pick = palette && palette.length ? palette[Math.min(sel, palette.length - 1)] : null;
|
|
1423
1423
|
useEffect(() => { if (focused && input.current) input.current.focus(); }, [name]);
|
|
@@ -1476,7 +1476,7 @@ function Composer({ name, inst, label = name, lease, busy, bindings, ids = {}, f
|
|
|
1476
1476
|
const complete = (c) => { recordEdit(input.current); setValue(`/${c.name}${c.arg ? " " : ""}`); };
|
|
1477
1477
|
const submit = () => {
|
|
1478
1478
|
// M-2738 (D3): AgEnD's own Update, whatever the agent's runtime can take (it never reaches the agent).
|
|
1479
|
-
if (!guest && !files.length && isUpdateLine(value)) { setValue("");
|
|
1479
|
+
if (!guest && !files.length && isUpdateLine(value)) { setValue(""); void openUpdateCard(); return; }
|
|
1480
1480
|
if (sendingBlocked) return;
|
|
1481
1481
|
if (!attachmentsSupported && files.length) { toast(t("chat.runtimeNoAttachments"),false); return; }
|
|
1482
1482
|
if (!commandsSupported && parseCommandLine(value)) { toast(t("chat.runtimeNoCommands"),false); return; }
|
package/dist/ui/panel-hub.js
CHANGED
|
@@ -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 } : {}),
|
|
@@ -29,13 +29,20 @@ register("requestContextControl", {
|
|
|
29
29
|
legacy: "Resolve these earlier held messages first: {0}.", peers: "Update AgEnD on {0}, then press Check again.",
|
|
30
30
|
owners: "These agents need preparation: {0}.", ownersWork: "Finish the current work for these agents first: {0}. Wait for them to finish, or restart an agent that stays busy.", ownersUpdate: "Complete the AgEnD update for these agents first: {0}.", recovery: "This work needs your decision: {0}.",
|
|
31
31
|
returns: "Waiting for a reply: {0}.", tickets: "Resolve these held messages: {0}.", work: "Waiting for this work to finish: {0}.",
|
|
32
|
-
previous: "
|
|
32
|
+
previous: "Until this is on, nothing changes: contacts between agents keep following your current contact settings.",
|
|
33
|
+
"busy-not-running": "not running", "busy-starting": "starting", "busy-stopping": "stopping", "busy-turn": "working on a reply",
|
|
34
|
+
"busy-unconfirmed-end": "its last conversation's end isn't confirmed", "busy-tool-calls": "waiting on tool results", "busy-queued-input": "has queued messages",
|
|
35
|
+
"busy-connected-computer": "work on a connected computer",
|
|
36
|
+
notRunning: "Not running: {0}. Start it, or confirm you don't need it.", floor: "You can no longer downgrade to older AgEnD versions.",
|
|
33
37
|
floorBefore: "Note: once on, you can't go back to an older AgEnD, even if you turn this off later.",
|
|
34
38
|
check: "Check again", error: "Couldn't read the current state. Try again.", failed: "Couldn't confirm whether anything changed. Press Check again.",
|
|
35
39
|
notice: "Request-based contact approvals are on: approval applies only to this request. Earlier conversations won't block an administrator's new request. The switch is in Settings → Access & security. Warning: you can no longer downgrade to older AgEnD versions.",
|
|
36
40
|
open: "Open settings", loading: "Checking the current state…",
|
|
37
|
-
acknowledge: "Acknowledge", ackConfirm: "Acknowledge", unknownHint: "Open the agent to inspect this work, then press Check again.", ackTitle: "Acknowledge this message?", ackBody: "
|
|
38
|
-
legacyUncertain: "
|
|
41
|
+
acknowledge: "Acknowledge", ackConfirm: "Acknowledge", unknownHint: "Open the agent to inspect this work, then press Check again.", ackTitle: "Acknowledge this message?", ackBody: "AgEnD couldn't confirm this message was received. This only records that you've seen it; nothing is resent.",
|
|
42
|
+
legacyUncertain: "Earlier messages AgEnD couldn't confirm: {0}.",
|
|
43
|
+
uncertainIntro: "Some earlier messages were sent, but AgEnD couldn't confirm the agent received them. Nothing is resent; acknowledging only records that you've seen them.",
|
|
44
|
+
uncertainOne: "1 message", uncertainMany: "{0} messages", uncertainMore: "{0} more pairs (shown after you acknowledge the ones above)", uncertainLatest: "latest {0}", acknowledgeAll: "Acknowledge all ({0})",
|
|
45
|
+
ackManyTitle: "Acknowledge these {0} messages?", ackAllTitle: "Acknowledge all {0} messages?", ackManyBody: "AgEnD couldn't confirm these messages were received. This only records that you've seen them; nothing is resent.",
|
|
39
46
|
stopGoBack: "After you stop this work, this update can no longer be rolled back with Go back.",
|
|
40
47
|
workFamilies: "Waiting on {0}: {1}.", unknownEnd: "The conversation's end isn't confirmed.",
|
|
41
48
|
"family-turns": "an active conversation", "family-daemon-calls": "agent tool calls", "family-fleet-calls": "pending tool results",
|
|
@@ -62,13 +69,20 @@ register("requestContextControl", {
|
|
|
62
69
|
legacy: "請先處理這些先前擱置的訊息:{0}。", peers: "請在 {0} 上更新 AgEnD,完成後按「重新檢查」。",
|
|
63
70
|
owners: "這些 Agent 需要先完成準備:{0}。", ownersWork: "請先等這些 Agent 完成目前的工作:{0}。請等它們完成,或重新啟動一直忙碌的 Agent。", ownersUpdate: "請先完成這些 Agent 的 AgEnD 更新:{0}。", recovery: "這項工作需要你決定:{0}。",
|
|
64
71
|
returns: "正在等候回覆:{0}。", tickets: "請先處理這些擱置的訊息:{0}。", work: "正在等這項工作結束:{0}。",
|
|
65
|
-
previous: "
|
|
72
|
+
previous: "開啟之前不會有任何變更:Agent 之間的聯絡仍照你現在的聯絡設定。",
|
|
73
|
+
"busy-not-running": "未在執行", "busy-starting": "啟動中", "busy-stopping": "停止中", "busy-turn": "正在回覆",
|
|
74
|
+
"busy-unconfirmed-end": "無法確認上一段對話已結束", "busy-tool-calls": "等待工具結果", "busy-queued-input": "還有排隊中的訊息",
|
|
75
|
+
"busy-connected-computer": "連線電腦上的工作",
|
|
76
|
+
notRunning: "未在執行:{0}(啟動它,或確認不需要它)。", floor: "已不能再降回舊版 AgEnD。",
|
|
66
77
|
floorBefore: "注意:開啟後就不能再降回舊版 AgEnD,之後關閉也一樣。",
|
|
67
78
|
check: "重新檢查", error: "無法讀取目前狀態,請再試一次。", failed: "無法確認是否已變更,請按「重新檢查」。",
|
|
68
79
|
notice: "依請求核准聯絡已開啟:核准只對這一次請求有效,先前的對話不會再擋住管理員的新請求。開關在「設定」→「存取與安全」。注意:已不能再降回舊版 AgEnD。",
|
|
69
80
|
open: "開啟設定", loading: "正在確認目前狀態…",
|
|
70
|
-
acknowledge: "確認已看過", ackConfirm: "確認", unknownHint: "請開啟 Agent 檢查這項工作,再按「重新檢查」。", ackTitle: "確認已看過這則訊息?", ackBody: "
|
|
71
|
-
legacyUncertain: "
|
|
81
|
+
acknowledge: "確認已看過", ackConfirm: "確認", unknownHint: "請開啟 Agent 檢查這項工作,再按「重新檢查」。", ackTitle: "確認已看過這則訊息?", ackBody: "AgEnD 無法確認這則訊息是否已收到。這只會記下你看過了,不會重送。",
|
|
82
|
+
legacyUncertain: "無法確認是否送達的先前訊息:{0}。",
|
|
83
|
+
uncertainIntro: "有些先前的訊息已送出,但 AgEnD 無法確認 Agent 已收到。不會重送;確認已看過只是記錄你看過了。",
|
|
84
|
+
uncertainOne: "1 則", uncertainMany: "{0} 則", uncertainMore: "另外 {0} 組(確認上面的之後會列出)", uncertainLatest: "最近 {0}", acknowledgeAll: "全部確認已看過({0} 則)",
|
|
85
|
+
ackManyTitle: "確認已看過這 {0} 則訊息?", ackAllTitle: "全部確認已看過({0} 則)?", ackManyBody: "AgEnD 無法確認這些訊息是否已收到。這只會記下你看過了,不會重送。",
|
|
72
86
|
stopGoBack: "結束這項工作後,這次更新就不能再退回。",
|
|
73
87
|
workFamilies: "正在等候 {0}:{1}。", unknownEnd: "無法確認這次對話是否已結束。",
|
|
74
88
|
"family-turns": "尚未結束的對話", "family-daemon-calls": "Agent 的工具操作", "family-fleet-calls": "尚未回傳的操作結果",
|
|
@@ -81,9 +95,45 @@ export const requestContextControlText = (key, ...args) => t(`requestContextCont
|
|
|
81
95
|
const LEGACY_KEYS = { "legacy-pending": "legacyPending", "legacy-inflight": "legacyInflight", "legacy-unsettled": "legacyUnsettled", "legacy-deliveries": "legacyDeliveries", "legacy-uncertain": "legacyUncertain" };
|
|
82
96
|
// M-3897: one blocker per earlier ticket or delivery an owner can settle (its id carries the ticket or delivery id).
|
|
83
97
|
const legacyKeyOf = (id) => LEGACY_KEYS[id] || (id.startsWith("legacy-retire:") ? "legacyRetire" : id.startsWith("legacy-withdraw:") ? "legacyWithdraw" : null);
|
|
98
|
+
// M-3963: earlier unconfirmed results arrive grouped by pair (count, newest end), plus one "all" group when there are several.
|
|
99
|
+
const isUncertain = (blocker) => blocker.kind === "legacy" && /^legacy-uncertain(?:-all|-more)?:/.test(blocker.id);
|
|
100
|
+
const isUncertainAll = (blocker) => blocker.id.startsWith("legacy-uncertain-all:");
|
|
101
|
+
function uncertainGroupParts(blocker) {
|
|
102
|
+
const parts = [blocker.id.startsWith("legacy-uncertain-more:") ? requestContextControlText("uncertainMore", blocker.pairs ?? "") : (blocker.labels || []).join(", ")];
|
|
103
|
+
if (blocker.count) parts.push(blocker.count === 1 ? requestContextControlText("uncertainOne") : requestContextControlText("uncertainMany", blocker.count));
|
|
104
|
+
if (blocker.latestAt) parts.push(requestContextControlText("uncertainLatest", clockFormat({ dateStyle: "short", timeStyle: "short" }, "en").format(new Date(blocker.latestAt))));
|
|
105
|
+
return parts.filter(Boolean);
|
|
106
|
+
}
|
|
107
|
+
const uncertainGroupText = (blocker) => uncertainGroupParts(blocker).join(" · ");
|
|
108
|
+
function confirmAcknowledge(blocker) {
|
|
109
|
+
const many = (blocker.count || 1) > 1;
|
|
110
|
+
return confirmDialog({ title: isUncertainAll(blocker) ? requestContextControlText("ackAllTitle", blocker.count) : many ? requestContextControlText("ackManyTitle", blocker.count) : requestContextControlText("ackTitle"),
|
|
111
|
+
message: requestContextControlText(many ? "ackManyBody" : "ackBody"), confirmLabel: requestContextControlText("ackConfirm"), danger: false });
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* M-3963: a busy agent says what it is still doing, e.g. 「AgEnD Leader(正在回覆)」. One that isn't running (and isn't
|
|
115
|
+
* starting or stopping) has nothing to finish, so it gets its own line instead of "wait for these agents" (M-3965 decides
|
|
116
|
+
* whether it should hold the On at all).
|
|
117
|
+
*/
|
|
118
|
+
function requestContextBusyLines(blocker) {
|
|
119
|
+
const zh = lang() === "zh-TW", separator = zh ? "、" : ", ";
|
|
120
|
+
const stopped = (agent) => agent.reasons?.includes("not-running") && !agent.reasons.some(reason => reason === "starting" || reason === "stopping");
|
|
121
|
+
const agents = blocker.agents || [], idle = agents.filter(stopped), working = agents.filter(agent => !stopped(agent));
|
|
122
|
+
const lines = [];
|
|
123
|
+
if (working.length) lines.push(requestContextControlText("ownersWork", working.map(agent => agent.reasons?.length
|
|
124
|
+
? `${agent.label}${zh ? "(" : " ("}${agent.reasons.map(reason => requestContextControlText(`busy-${reason}`)).join(separator)}${zh ? ")" : ")"}` : agent.label).join(separator)));
|
|
125
|
+
if (idle.length) lines.push(requestContextControlText("notRunning", idle.map(agent => agent.label).join(separator)));
|
|
126
|
+
return lines;
|
|
127
|
+
}
|
|
128
|
+
export function requestContextBlockerLines(blocker) {
|
|
129
|
+
if (blocker.kind === "owners" && blocker.ownerCause === "work" && blocker.agents?.some(agent => agent.reasons?.length)) return requestContextBusyLines(blocker);
|
|
130
|
+
return [requestContextBlockerText(blocker)];
|
|
131
|
+
}
|
|
84
132
|
export function requestContextBlockerText(blocker) {
|
|
133
|
+
if (blocker.kind === "owners" && blocker.ownerCause === "work" && blocker.agents?.some(agent => agent.reasons?.length)) return requestContextBusyLines(blocker).join(lang() === "zh-TW" ? "" : " ");
|
|
134
|
+
if (isUncertain(blocker)) return isUncertainAll(blocker) ? requestContextControlText("acknowledgeAll", blocker.count) : requestContextControlText("legacyUncertain", uncertainGroupText(blocker));
|
|
85
135
|
// S-272: an earlier ticket says what settles it (its own sentence by blocker id); an older server's "legacy" keeps its line.
|
|
86
|
-
const legacyKey = blocker.kind === "legacy" &&
|
|
136
|
+
const legacyKey = blocker.kind === "legacy" && legacyKeyOf(blocker.id);
|
|
87
137
|
if(blocker.kind === "work" && blocker.families?.length){
|
|
88
138
|
const separator=lang()==="zh-TW"?"、":", ";
|
|
89
139
|
const text=requestContextControlText("workFamilies",(blocker.labels||[]).join(separator),blocker.families.map(family=>requestContextControlText(`family-${family}`)).join(separator));
|
|
@@ -98,15 +148,21 @@ export function RequestContextBlocked({ state, onCheck, onResolve, busy = false,
|
|
|
98
148
|
const before = !state?.everActivated && !state?.attempted;
|
|
99
149
|
if (!state || before && !(state.blockers || []).length) return null;
|
|
100
150
|
const ownerAgents = [...new Map((state.blockers || []).filter(b => b.kind === "owners" || b.kind === "work").flatMap(b => b.agents || []).map(a => [a.id, a])).values()];
|
|
151
|
+
const listed = (state.blockers || []).filter(b => !isUncertain(b)), uncertain = (state.blockers || []).filter(isUncertain);
|
|
152
|
+
const all = uncertain.find(isUncertainAll), groups = uncertain.filter(b => !isUncertainAll(b)), canAcknowledge = !!(state.canChange && onResolve);
|
|
101
153
|
return html`<div class="request-context-blocked">
|
|
102
154
|
<p>${requestContextControlText(state.phase === "draining" ? "draining" : state.everActivated ? "recoveryBlocked" : before ? "blockedBefore" : "blocked")}</p>
|
|
103
155
|
${state.enableFailed ? html`<p class="notice warn" role="alert">${requestContextControlText("failed")}</p>` : null}
|
|
104
|
-
${
|
|
156
|
+
${listed.map(blocker => html`<div key=${blocker.id}>${requestContextBlockerLines(blocker).map(line => html`<p>${line}</p>`)}
|
|
105
157
|
${blocker.action === "stop-waiting" ? html`<p>${requestContextControlText("waitBody")}</p>` : null}</div>`)}
|
|
158
|
+
${groups.length ? html`<div class="request-context-uncertain"><p>${requestContextControlText("uncertainIntro")}</p>
|
|
159
|
+
${all && canAcknowledge ? html`<div class="request-context-actions"><button type="button" class="btn btn-sm" disabled=${busy} onClick=${() => onResolve(all)}>${requestContextControlText("acknowledgeAll", all.count)}</button></div>` : null}
|
|
160
|
+
<ul class="request-context-uncertain-list">${groups.map(group => html`<li key=${group.id}><span>${uncertainGroupParts(group)[0]}${uncertainGroupParts(group).length > 1 ? html`<span class="request-context-uncertain-when">${uncertainGroupParts(group).slice(1).map((part, i, all) => html`<span class="request-context-nowrap">${part}${i < all.length - 1 ? " ·" : ""}</span>${i < all.length - 1 ? " " : ""}`)}</span>` : null}</span>
|
|
161
|
+
${canAcknowledge ? html`<button type="button" class="btn btn-sm" disabled=${busy} title=${requestContextBlockerText(group)} onClick=${() => onResolve(group)}>${requestContextControlText("acknowledge")}</button>` : null}</li>`)}</ul></div>` : null}
|
|
106
162
|
${!state.everActivated ? html`<p class="note">${requestContextControlText("previous")}</p>` : null}
|
|
107
163
|
<div class="request-context-actions">
|
|
108
164
|
${(state.blockers || []).some(b => b.action === "inspect" && b.kind === "legacy") ? html`<a class="btn btn-sm" href="/ui/fleet/authorizations">${requestContextControlText("inspect")}</a>` : null}
|
|
109
|
-
${
|
|
165
|
+
${listed.map(blocker => blocker.action === "inspect"
|
|
110
166
|
? null // S-272: one Authorizations link, for earlier held requests only; agents and the update have their own links below
|
|
111
167
|
: state.canChange && onResolve && blocker.action ? html`<button key=${blocker.id} type="button" class=${`btn btn-sm ${["stop-work", "stop-waiting", "retire"].includes(blocker.action) ? "btn-danger" : ""}`} disabled=${busy}
|
|
112
168
|
title=${requestContextBlockerText(blocker)} onClick=${() => onResolve(blocker)}>${requestContextControlText(blocker.action)}${blocker.kind === "work" && blocker.families?.length && blocker.labels?.length ? ` · ${blocker.labels.join(lang() === "zh-TW" ? "、" : ", ")}` : ""}</button>` : null)}
|
|
@@ -131,7 +187,7 @@ export function RequestContextNeed({ item }) {
|
|
|
131
187
|
if (writing.current || failed || !state || blocker && !state.canChange) return;
|
|
132
188
|
writing.current = true; setBusy(true); setFailed(false);
|
|
133
189
|
try {
|
|
134
|
-
if(blocker?.action==="acknowledge" && !await
|
|
190
|
+
if(blocker?.action==="acknowledge" && !await confirmAcknowledge(blocker))return;
|
|
135
191
|
if (["stop-work", "stop-waiting"].includes(blocker?.action) && !await confirmStopWork(blocker.action, state.goBack)) return;
|
|
136
192
|
if (blocker?.action === "retire" && !await confirmRetire(state)) return;
|
|
137
193
|
const input = blocker ? { revision: state.revision, action: "resolve", blockerId: blocker.id, resolution: blocker.action } : { revision: state.revision, action: "check" };
|
|
@@ -181,7 +237,7 @@ export function RequestContextSettings() {
|
|
|
181
237
|
writing.current = true; setBusy(true); setFailed(false);
|
|
182
238
|
try {
|
|
183
239
|
if (action === "enable" && !await confirmDialog({ title: requestContextControlText("enableTitle"), message: requestContextControlText("floorBefore") + (state.goBack ? "\n\n" + requestContextControlText("goBack", clockFormat({ dateStyle: "medium", timeStyle: "short", timeZone: state.goBack.timeZone }, "en").format(new Date(state.goBack.availableUntil))) : "") + (state.restartCount ? "\n\n" + requestContextControlText("restart", state.restartCount) : ""), confirmLabel: requestContextControlText("enable"), danger: true })) return;
|
|
184
|
-
if(blocker?.action==="acknowledge" && !await
|
|
240
|
+
if(blocker?.action==="acknowledge" && !await confirmAcknowledge(blocker))return;
|
|
185
241
|
if (["stop-work", "stop-waiting"].includes(blocker?.action) && !await confirmStopWork(blocker.action, state.goBack)) return;
|
|
186
242
|
if (blocker?.action === "retire" && !await confirmRetire(state)) return;
|
|
187
243
|
if (action === "disable" && !await confirmDialog({ title: requestContextControlText("confirmTitle"), message: requestContextControlText("confirmBody"), confirmLabel: requestContextControlText("confirm"), danger: false })) return;
|
|
@@ -195,12 +251,16 @@ export function RequestContextSettings() {
|
|
|
195
251
|
finally { writing.current = false; if (lease.current()) setBusy(false); }
|
|
196
252
|
};
|
|
197
253
|
if (state === null) return null;
|
|
254
|
+
const locked = !!state && state.enableUnavailable && !state.everActivated && !state.enabled;
|
|
198
255
|
return html`<section id="request-context" class="card request-context-control"><h2>${requestContextControlText("title")}</h2>
|
|
199
256
|
${state ? html`<label class="check request-context-toggle"><input type="checkbox" class="s-ui-toggle" ref=${toggle} aria-checked=${failed ? "mixed" : state.enabled ? "true" : "false"} checked=${!failed && state.enabled}
|
|
200
257
|
disabled=${busy || failed || !state.canChange || state.phase === "draining" || !state.enabled && state.enableUnavailable} onChange=${event => { event.target.checked = state.enabled; void change(state.enabled ? "disable" : "enable"); }} />
|
|
201
258
|
<span>${requestContextControlText("title")}</span></label>
|
|
202
259
|
${!state.enabled && state.enableUnavailable ? html`<p role="status">${requestContextControlText("enableUnavailable")}</p>` : null}
|
|
203
|
-
${failed ? html`<p role="status">${requestContextControlText("unknown")}</p>`
|
|
260
|
+
${failed ? html`<p role="status">${requestContextControlText("unknown")}</p>`
|
|
261
|
+
// M-3963: while this version can't turn it on at all, what an On would wait for is nothing anyone can act on.
|
|
262
|
+
: locked ? html`<p class="note">${requestContextControlText("previous")}</p>`
|
|
263
|
+
: ["blocked", "draining"].includes(state.phase) ? html`<${RequestContextBlocked} state=${state} busy=${busy || failed} onCheck=${() => change("check")} onResolve=${state.canChange ? blocker => change("resolve", blocker) : null} />`
|
|
204
264
|
: html`<p role="status">${requestContextControlText(state.phase === "off" && !state.everActivated ? "offBefore" : state.phase)}</p>`}
|
|
205
265
|
${!state.everActivated && !state.enabled && state.enableUnavailable ? null : html`<p class="notice warn">${requestContextControlText(state.everActivated ? "floor" : "floorBefore")}</p>`}
|
|
206
266
|
${!state.canChange ? html`<${AuthorizeChip} />` : null}` : !failed ? html`<p>${requestContextControlText("loading")}</p>` : null}
|
|
@@ -27,7 +27,7 @@ register("update", {
|
|
|
27
27
|
failed_network: "Update failed: the update source could not be reached.", failed_permission: "Update failed: no permission to install the new version.",
|
|
28
28
|
failed_other: "Update failed: the update did not finish.", unchanged: "AgEnD is still v{0}; nothing was changed.",
|
|
29
29
|
afterInstall: "The new version may be installed, but AgEnD did not finish restarting.", retry: "Try again", fullLog: "See the full log",
|
|
30
|
-
logTitle: "Update log", logEmpty: "No update log yet.", logCause: "What the updater said",
|
|
30
|
+
logTitle: "Update log", logEmpty: "No update log yet.", logCause: "What the updater said", cardTitle: "AgEnD update",
|
|
31
31
|
current: "AgEnD is up to date (v{0}).", updated: "AgEnD is updated to v{0}", reloadSub: "Reload this tab to use the new version.", reload: "Reload",
|
|
32
32
|
dismiss: "Dismiss", adminOnly: "Only a fleet admin can update AgEnD.", running: "An update is already running.",
|
|
33
33
|
upToDate: "AgEnD v{0} is up to date.", stableOnly: "v{0} (stable) is available. Updating from the web stays on this install's line.",
|
|
@@ -48,7 +48,7 @@ register("update", {
|
|
|
48
48
|
failed_network: "更新失敗:連不上更新來源。", failed_permission: "更新失敗:沒有權限安裝新版。",
|
|
49
49
|
failed_other: "更新失敗:更新沒有完成。", unchanged: "AgEnD 仍是 v{0},沒有任何變更。",
|
|
50
50
|
afterInstall: "新版可能已經安裝,但 AgEnD 沒能完成重新啟動。", retry: "再試一次", fullLog: "看完整紀錄",
|
|
51
|
-
logTitle: "更新紀錄", logEmpty: "還沒有更新紀錄。", logCause: "更新程式回報的原因",
|
|
51
|
+
logTitle: "更新紀錄", logEmpty: "還沒有更新紀錄。", logCause: "更新程式回報的原因", cardTitle: "AgEnD 更新",
|
|
52
52
|
current: "AgEnD 已是最新版(v{0})。", updated: "AgEnD 已更新到 v{0}", reloadSub: "重新載入這個分頁即可使用新版。", reload: "重新載入",
|
|
53
53
|
dismiss: "關閉", adminOnly: "只有 fleet 管理員可以更新 AgEnD。", running: "已經有一個更新在進行中。",
|
|
54
54
|
upToDate: "AgEnD v{0} 已是最新版。", stableOnly: "v{0}(穩定版)已推出。網頁更新會留在這個安裝的版本線。",
|
|
@@ -73,7 +73,7 @@ const LATER_HUB_KEY = "agend_update_later_hub", LATER_HUB_MS = 24 * 60 * 60 * 10
|
|
|
73
73
|
* tab was loaded on (the first answer's): a later answer naming another one means this tab runs the old page.
|
|
74
74
|
*/
|
|
75
75
|
export const updateStore = createStore({ info: null, loadedVersion: null, skew: 0, starting: false, later: remembered(LATER_KEY),
|
|
76
|
-
dismissed: remembered(DISMISSED_KEY), reloadDismissed: null, log: null, laterHub: remembered(LATER_HUB_KEY) });
|
|
76
|
+
dismissed: remembered(DISMISSED_KEY), reloadDismissed: null, log: null, laterHub: remembered(LATER_HUB_KEY), cardOpen: false, cardAsking: false });
|
|
77
77
|
// #4487 review P2: AgEnD's own update item (a failure, or can't update here) counts in Needs you like any other — its badge,
|
|
78
78
|
// the tab's and the page's count and empty state read it from appStore (app-shell.js needsCount; panel-needs.js).
|
|
79
79
|
updateStore.subscribe((st) => { const n = updateAttention(st && st.info) ? 1 : 0; if ((appStore.get().updateNeeds || 0) !== n) appStore.set({ updateNeeds: n }); });
|
|
@@ -143,6 +143,21 @@ function sameLine(channel) { return t(`update.same_${channel === "alpha" || chan
|
|
|
143
143
|
|
|
144
144
|
/** The one confirmation (the leader's D1: the admin's own, no General card), then the start. From the line, Settings or /update. */
|
|
145
145
|
export async function openUpdateDialog() { return startUpdate(null); }
|
|
146
|
+
/**
|
|
147
|
+
* M-3967: `/update` in a web chat: a fresh check, then the update card itself in a dialog — the top line's own words and
|
|
148
|
+
* buttons (Update now asks once, naming who works), as `/update` shows it in Discord and Telegram. A server without the
|
|
149
|
+
* card, or nothing the card shows, keeps the old question (which says up to date, running, or admin only).
|
|
150
|
+
*/
|
|
151
|
+
export async function openUpdateCard() {
|
|
152
|
+
let info = updateStore.get().info;
|
|
153
|
+
if (!info) info = await refreshUpdate();
|
|
154
|
+
if (!info || !info.admin) { toast(t("update.adminOnly"), false); return { ok: false }; }
|
|
155
|
+
await checkUpdateNow();
|
|
156
|
+
info = updateStore.get().info || info;
|
|
157
|
+
if (info.card === undefined || !cardLine(info, { Line, busy: false, deps: cardDeps, full: true })) return startUpdate(null);
|
|
158
|
+
updateStore.set({ cardOpen: true });
|
|
159
|
+
return { ok: true };
|
|
160
|
+
}
|
|
146
161
|
/** M-3140: the same confirmation and start, pinned to the Hub's recommended version (the server re-reads its own advice). */
|
|
147
162
|
export async function openHubUpdateDialog() { return startUpdate("hub"); }
|
|
148
163
|
|
|
@@ -253,6 +268,19 @@ function LogDialog() {
|
|
|
253
268
|
</${Dialog}>`;
|
|
254
269
|
}
|
|
255
270
|
|
|
271
|
+
/** M-3967: the card opened by a web chat's /update. It closes by itself once the card has nothing to show (updating, done). */
|
|
272
|
+
function CardDialog() {
|
|
273
|
+
const s = useStore(updateStore);
|
|
274
|
+
const line = s.cardOpen && s.info ? cardLine(s.info, { Line, busy: s.starting, deps: dialogDeps, full: true }) : null;
|
|
275
|
+
useEffect(() => { if (s.cardOpen && !line && !s.cardAsking) updateStore.set({ cardOpen: false }); }, [s.cardOpen, !line]);
|
|
276
|
+
if (!s.cardOpen || !line || s.cardAsking) return null;
|
|
277
|
+
const close = () => updateStore.set({ cardOpen: false });
|
|
278
|
+
return html`<${Dialog} title=${t("update.cardTitle")} wide onClose=${close}
|
|
279
|
+
actions=${html`<button type="button" class="btn" onClick=${close}>${t("app.close")}</button>`}>
|
|
280
|
+
<div class="update-card-dialog">${line}</div>
|
|
281
|
+
</${Dialog}>`;
|
|
282
|
+
}
|
|
283
|
+
|
|
256
284
|
/** The app-wide line. Admins see the offer, the progress and its failure; any signed-in tab on an old version, the reload. */
|
|
257
285
|
export function UpdateLine() {
|
|
258
286
|
usePolling();
|
|
@@ -262,7 +290,7 @@ export function UpdateLine() {
|
|
|
262
290
|
const info = s.info;
|
|
263
291
|
const active = updateActive(info);
|
|
264
292
|
useEffect(() => { if (!active) return undefined; const id = setInterval(() => tick((n) => n + 1), 1000); return () => clearInterval(id); }, [active]);
|
|
265
|
-
if (!info) return html`<${LogDialog} />`;
|
|
293
|
+
if (!info) return html`<${LogDialog} /><${CardDialog} />`;
|
|
266
294
|
const p = info.progress;
|
|
267
295
|
let line = null;
|
|
268
296
|
if (s.loadedVersion && info.current !== s.loadedVersion && s.reloadDismissed !== info.current) {
|
|
@@ -305,8 +333,10 @@ export function UpdateLine() {
|
|
|
305
333
|
<button type="button" class="btn btn-sm btn-primary" disabled=${s.starting} onClick=${openUpdateDialog}>${t("update.now")}</button>
|
|
306
334
|
<button type="button" class="btn btn-sm" onClick=${() => { remember(LATER_KEY, o.version); updateStore.set({ later: o.version }); }}>${t("update.later")}</button></${Line}>`;
|
|
307
335
|
}
|
|
308
|
-
return html`${line}<${LogDialog} /><${PickTimeHost} />`;
|
|
336
|
+
return html`${line}<${LogDialog} /><${CardDialog} /><${PickTimeHost} />`;
|
|
309
337
|
}
|
|
310
338
|
/** M-3770 1.4: what update-card-ui.js needs from this module, passed in (it never imports this one). */
|
|
311
339
|
export const cardDeps = { refresh: () => refreshUpdate(), setInfo: (info) => updateStore.set({ info }), getInfo: () => updateStore.get().info,
|
|
312
340
|
setStarting: (starting) => updateStore.set({ starting }) };
|
|
341
|
+
/** M-3967: the card's dialog steps aside while its own question (Update now, Pick a time) is open, and comes back after a Cancel. */
|
|
342
|
+
const dialogDeps = { ...cardDeps, asking: (open, answered = false) => updateStore.set(open ? { cardAsking: true } : { cardAsking: false, ...(answered ? { cardOpen: false } : {}) }) };
|
package/dist/ui/shared/app.css
CHANGED
|
@@ -810,9 +810,21 @@ html:has(.shell), html:has(.shell) body { overflow: hidden; }
|
|
|
810
810
|
.s-setting-row .note { margin: 5px 0 0; }
|
|
811
811
|
.request-context-toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
|
|
812
812
|
.request-context-control, .request-context-blocked { overflow-wrap: anywhere; }
|
|
813
|
+
/* M-3963: every line wraps inside the card, whatever an outer container sets (a busy-agent line ran off the right edge). */
|
|
814
|
+
.request-context-control, .request-context-need, .request-context-blocked { min-width: 0; max-width: 100%; }
|
|
815
|
+
.request-context-blocked p, .request-context-control > p { white-space: normal; word-break: normal; overflow-wrap: anywhere; max-width: 100%; }
|
|
813
816
|
.request-context-control .btn, .request-context-need .btn { min-height: 44px; }
|
|
814
817
|
.request-context-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
|
|
815
818
|
.request-context-actions > .btn { width: auto; flex: 0 0 auto; }
|
|
819
|
+
.request-context-uncertain { display: grid; gap: 8px; margin: 4px 0 8px; }
|
|
820
|
+
.request-context-uncertain > p { margin: 0; color: var(--text-2); }
|
|
821
|
+
.request-context-uncertain-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; }
|
|
822
|
+
.request-context-uncertain-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 6px 10px; }
|
|
823
|
+
.request-context-uncertain-list > li + li { border-top: 1px solid var(--border); }
|
|
824
|
+
.request-context-uncertain-list > li > span { min-width: 0; }
|
|
825
|
+
.request-context-uncertain-list .btn { width: auto; flex: 0 0 auto; border-color: var(--border-strong); }
|
|
826
|
+
.request-context-nowrap { white-space: nowrap; }
|
|
827
|
+
.request-context-uncertain-when { display: block; color: var(--text-2); font-size: 0.92em; }
|
|
816
828
|
.p-settings .request-context-toggle input.s-ui-toggle:not(:checked) { border-color: var(--text-2); background: var(--surface-3, var(--surface-2)); }
|
|
817
829
|
.p-settings .request-context-toggle input.s-ui-toggle:indeterminate::after { transform: translateX(8px); border-radius: 2px; }
|
|
818
830
|
.p-settings input.s-ui-toggle, .p-hub input.s-ui-toggle, .p-fleet input.s-ui-toggle { appearance: none; position: relative; display: inline-block; flex: none; width: 38px; height: 22px; min-height: 0; margin: 0; padding: 0; border: 1px solid var(--border-strong); border-radius: 20px; background: var(--surface-3, var(--surface-2)); cursor: pointer; }
|
|
@@ -2288,6 +2300,8 @@ textarea.s-yaml { white-space: pre; overflow-x: auto; }
|
|
|
2288
2300
|
.update-line { justify-content: flex-start; }
|
|
2289
2301
|
.update-text { flex: 1 1 100%; }
|
|
2290
2302
|
.update-actions.indent { margin-left: 26px; }
|
|
2303
|
+
/* M-3967: four buttons (Update now first) wrap to a second row rather than run off a phone's edge. */
|
|
2304
|
+
.update-actions { flex: 0 1 auto; flex-wrap: wrap; min-width: 0; }
|
|
2291
2305
|
}
|
|
2292
2306
|
/* S-241 (Lumen's point 8): an answered update card (waiting for idle, scheduled) is one line on a phone — its short words
|
|
2293
2307
|
and Change; Change opens the full line. The desk never shows the short words or Change. "A phone" is the app's own
|
|
@@ -2308,6 +2322,13 @@ textarea.s-yaml { white-space: pre; overflow-x: auto; }
|
|
|
2308
2322
|
.uc-answered:not(.open) .uc-short { display: inline; }
|
|
2309
2323
|
.uc-answered:not(.open) .update-actions.indent { margin-left: 0; }
|
|
2310
2324
|
}
|
|
2325
|
+
/* M-3967: the card in /update's dialog: no banner band; its words and buttons share one left edge. */
|
|
2326
|
+
.update-card-dialog .update-line { justify-content: flex-start; background: none; border: 0; padding: 0; }
|
|
2327
|
+
.update-card-dialog .update-text { flex: 1 1 100%; } /* the buttons always on their own row, under the words */
|
|
2328
|
+
.update-card-dialog .update-actions { flex: 0 1 auto; flex-wrap: wrap; min-width: 0; }
|
|
2329
|
+
/* In line with the words, past the spinner (16 px) or the icon (18 px) and the gap. */
|
|
2330
|
+
.update-card-dialog .update-text:has(.update-spinner) + .update-actions { margin-left: calc(16px + var(--s-2)); }
|
|
2331
|
+
.update-card-dialog .update-text:has(.update-icon) + .update-actions { margin-left: calc(18px + var(--s-2)); }
|
|
2311
2332
|
/* M-2738: Settings → Advanced → Version and update */
|
|
2312
2333
|
/* M-3770 1.4: the update card's Settings part — its state, "Updates on this machine", and the controls (pause windows;
|
|
2313
2334
|
Advanced: pin, longest wait). Phone: every control a 44 px box, the day ticks wrap. */
|
|
@@ -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)]);
|
|
@@ -60,7 +60,7 @@ register("chat", {
|
|
|
60
60
|
cmd_ctx: "Context use, model and effort", cmd_compact: "Compact the conversation", cmd_clear: "Clear the conversation (asks first)",
|
|
61
61
|
cmd_model: "Show or switch the model", cmd_backend: "Switch the CLI backend, then model and effort (restarts)", cmd_effort: "Show or set the reasoning effort", cmd_cancel: "Stop the current reply",
|
|
62
62
|
cmd_btw: "A side question that does not interrupt", cmd_steer: "Send into the current turn", cmd_pause: "Pause the instance",
|
|
63
|
-
cmd_wake: "Wake a paused instance", cmd_save: "Save the conversation to a file", cmd_update: "Update AgEnD (
|
|
63
|
+
cmd_wake: "Wake a paused instance", cmd_save: "Save the conversation to a file", cmd_update: "Update AgEnD (shows the update card)",
|
|
64
64
|
tourTitle: "Welcome to web chat", tourStep: "{0} of {1}", tourBack: "Back", tourNext: "Next", tourDone: "Got it", tourSkip: "Skip",
|
|
65
65
|
tour1: "Pick an instance in the list to chat with it. On a phone, ☰ opens the list.",
|
|
66
66
|
tour2: "This is the agent's conversation. If it also has a Telegram or Discord chat, web echo (Settings → Chat & connections) decides whether what you send here shows there too.",
|
|
@@ -239,7 +239,7 @@ register("chat", {
|
|
|
239
239
|
cmd_ctx: "上下文用量、模型與推理強度", cmd_compact: "壓縮對話", cmd_clear: "清空對話(會先確認)",
|
|
240
240
|
cmd_model: "查看或切換模型", cmd_backend: "切換 CLI 後端,再選模型和推理強度(會重新啟動)", cmd_effort: "查看或設定推理強度", cmd_cancel: "停止目前的回覆",
|
|
241
241
|
cmd_btw: "不打斷目前工作的旁問", cmd_steer: "送進目前這一輪", cmd_pause: "暫停 Agent",
|
|
242
|
-
cmd_wake: "喚醒已暫停的 Agent", cmd_save: "把對話存成檔案", cmd_update: "更新 AgEnD
|
|
242
|
+
cmd_wake: "喚醒已暫停的 Agent", cmd_save: "把對話存成檔案", cmd_update: "更新 AgEnD(顯示更新卡片)",
|
|
243
243
|
tourTitle: "歡迎使用網頁聊天", tourStep: "{0} / {1}", tourBack: "上一步", tourNext: "下一步", tourDone: "知道了", tourSkip: "略過",
|
|
244
244
|
tour1: "在清單裡選一個 Agent,就能跟它對話。手機上請按 ☰ 打開清單。",
|
|
245
245
|
tour2: "這是這個 Agent 的對話。如果它也有 Telegram 或 Discord 聊天,在這裡送出的訊息是否也出現在那裡,由「設定 → 聊天與連線」的網頁轉發決定。",
|
|
@@ -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; }
|