@songsid/agend 2.4.0-beta.10 → 2.4.0-beta.11
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/auth-api.js +1 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/claude-code.js +35 -9
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex-precaution.d.ts +7 -0
- package/dist/backend/codex-precaution.js +102 -0
- package/dist/backend/codex-precaution.js.map +1 -0
- package/dist/backend/codex.d.ts +1 -0
- package/dist/backend/codex.js +18 -0
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok.js +21 -6
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/types.d.ts +9 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/cli-audited.js +3 -3
- package/dist/cli-audited.js.map +1 -1
- package/dist/daemon.js +2 -2
- package/dist/daemon.js.map +1 -1
- package/dist/event-log.d.ts +12 -0
- package/dist/event-log.js +40 -0
- package/dist/event-log.js.map +1 -1
- package/dist/fleet-manager.d.ts +17 -1
- package/dist/fleet-manager.js +116 -3
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +13 -6
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +10 -1
- package/dist/hub/admin-dashboard.js +3 -3
- package/dist/hub/admin-dashboard.js.map +1 -1
- package/dist/hub/agent-catalog-model.d.ts +276 -0
- package/dist/hub/agent-catalog-model.js +49 -0
- package/dist/hub/agent-catalog-model.js.map +1 -0
- package/dist/hub/agent-catalog.d.ts +137 -0
- package/dist/hub/agent-catalog.js +118 -0
- package/dist/hub/agent-catalog.js.map +1 -0
- package/dist/hub/agent-intro.d.ts +31 -0
- package/dist/hub/agent-intro.js +51 -0
- package/dist/hub/agent-intro.js.map +1 -0
- package/dist/hub/catalog.d.ts +4 -2
- package/dist/hub/catalog.js +19 -3
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.d.ts +2 -0
- package/dist/hub/client.js +21 -1
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +6 -0
- package/dist/hub/compose/member.js +68 -10
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +4 -0
- package/dist/hub/compose/server.js +2 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/execution/service.d.ts +1 -1
- package/dist/hub/execution/service.js +1 -0
- package/dist/hub/execution/service.js.map +1 -1
- package/dist/hub/http/compose.d.ts +2 -0
- package/dist/hub/http/compose.js +98 -14
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/schema.js +9 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/mcp/tools.js +2 -1
- package/dist/hub/mcp/tools.js.map +1 -1
- package/dist/hub/member/agent-catalog.d.ts +28 -0
- package/dist/hub/member/agent-catalog.js +80 -0
- package/dist/hub/member/agent-catalog.js.map +1 -0
- package/dist/hub/member/exposure-api.d.ts +3 -3
- package/dist/hub/member/exposure-api.js +4 -4
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/exposures.d.ts +12 -4
- package/dist/hub/member/exposures.js +27 -13
- package/dist/hub/member/exposures.js.map +1 -1
- package/dist/hub/member/room-ask.d.ts +4 -1
- package/dist/hub/member/room-ask.js +6 -3
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-context-budget.d.ts +5 -0
- package/dist/hub/member/room-context-budget.js +34 -0
- package/dist/hub/member/room-context-budget.js.map +1 -0
- package/dist/hub/member/sharing-journal.d.ts +252 -0
- package/dist/hub/member/sharing-journal.js +212 -0
- package/dist/hub/member/sharing-journal.js.map +1 -0
- package/dist/hub/member/sharing-link.d.ts +25 -0
- package/dist/hub/member/sharing-link.js +68 -0
- package/dist/hub/member/sharing-link.js.map +1 -0
- package/dist/hub/member/sharing-result.d.ts +6 -0
- package/dist/hub/member/sharing-result.js +46 -0
- package/dist/hub/member/sharing-result.js.map +1 -0
- package/dist/hub/member/sharing.d.ts +37 -0
- package/dist/hub/member/sharing.js +181 -0
- package/dist/hub/member/sharing.js.map +1 -0
- package/dist/hub/personal/owner-host.d.ts +6 -0
- package/dist/hub/personal/owner-host.js +4 -2
- package/dist/hub/personal/owner-host.js.map +1 -1
- package/dist/hub/protocol.d.ts +226 -0
- package/dist/hub/protocol.js +3 -0
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/rooms/agents.d.ts +1 -0
- package/dist/hub/rooms/agents.js +13 -2
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/direct-view.d.ts +5 -1
- package/dist/hub/rooms/direct-view.js +2 -2
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +32 -0
- package/dist/hub/rooms/service.js +25 -11
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +2 -1
- package/dist/hub/rooms.d.ts +1 -0
- package/dist/hub/rooms.js +9 -4
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/server.js +23 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/sharing-previous-access.d.ts +22 -0
- package/dist/hub/sharing-previous-access.js +93 -0
- package/dist/hub/sharing-previous-access.js.map +1 -0
- package/dist/hub/sharing-requests.d.ts +171 -0
- package/dist/hub/sharing-requests.js +311 -0
- package/dist/hub/sharing-requests.js.map +1 -0
- package/dist/hub/sharing-retention.d.ts +47 -0
- package/dist/hub/sharing-retention.js +83 -0
- package/dist/hub/sharing-retention.js.map +1 -0
- package/dist/hub/sharing-withdrawal.d.ts +14 -0
- package/dist/hub/sharing-withdrawal.js +28 -0
- package/dist/hub/sharing-withdrawal.js.map +1 -0
- package/dist/hub/types.d.ts +6 -2
- package/dist/hub-page-sharing-settings.d.ts +6 -0
- package/dist/hub-page-sharing-settings.js +19 -0
- package/dist/hub-page-sharing-settings.js.map +1 -0
- package/dist/hub-sharing-notice.d.ts +43 -0
- package/dist/hub-sharing-notice.js +34 -0
- package/dist/hub-sharing-notice.js.map +1 -0
- package/dist/locale.js +58 -0
- package/dist/locale.js.map +1 -1
- package/dist/login-flows.js +1 -1
- package/dist/login-flows.js.map +1 -1
- package/dist/needs-you.js +1 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/public-web-gateway.js +4 -2
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/remote-card-answer.d.ts +1 -1
- package/dist/remote-card-answer.js +8 -1
- package/dist/remote-card-answer.js.map +1 -1
- package/dist/remote-card-prompt.js +1 -1
- package/dist/remote-card-prompt.js.map +1 -1
- package/dist/settings-api.d.ts +1 -0
- package/dist/settings-api.js +84 -10
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +3 -0
- package/dist/settings-baseline.js +2 -2
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +1 -0
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +3 -0
- package/dist/settings-effect.js +16 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/ui/fleet-office-card.js +8 -4
- package/dist/ui/fleet-office-pack.d.ts +1 -0
- package/dist/ui/fleet-office-pack.js +6 -2
- package/dist/ui/fleet-office-play.js +84 -0
- package/dist/ui/fleet-office-store.js +23 -0
- package/dist/ui/fleet-office-zones.js +5 -1
- package/dist/ui/fleet-office.js +78 -8
- package/dist/ui/hub-agent-intro.js +26 -0
- package/dist/ui/hub-chat-strings.js +4 -4
- package/dist/ui/hub-client.js +12 -1
- package/dist/ui/hub-grant-picker.js +25 -11
- package/dist/ui/hub-group-strings.js +3 -3
- package/dist/ui/hub-my-agents-model.js +42 -0
- package/dist/ui/hub-my-agents-strings.js +18 -0
- package/dist/ui/hub-my-agents.js +141 -0
- package/dist/ui/hub-owner-strings.js +5 -5
- package/dist/ui/hub-personal-agent.js +5 -4
- package/dist/ui/hub-room-composer.js +27 -4
- package/dist/ui/hub-room-list.js +3 -2
- package/dist/ui/hub-room-members.js +3 -2
- package/dist/ui/hub-room-new.js +1 -1
- package/dist/ui/hub-room-strings.js +2 -2
- package/dist/ui/hub-room-thread.js +4 -2
- package/dist/ui/hub-strings.js +5 -5
- package/dist/ui/hub-welcome.js +6 -6
- package/dist/ui/notice-hub-sharing.js +81 -0
- package/dist/ui/panel-hub.js +16 -11
- package/dist/ui/panel-notices.js +2 -1
- package/dist/ui/settings-hub-connection.js +2 -2
- package/dist/ui/settings-hub-page-sharing.js +52 -0
- package/dist/ui/settings-hub.js +4 -2
- package/dist/ui/settings-registry.js +1 -0
- package/dist/ui/shared/app-shell.js +8 -2
- package/dist/ui/shared/app-store.js +6 -2
- package/dist/ui/shared/hub-chat.css +3 -0
- package/dist/ui/shared/hub-my-agents.css +35 -0
- package/dist/web-api.d.ts +4 -1
- package/dist/web-api.js +55 -1
- package/dist/web-api.js.map +1 -1
- package/dist/web-notices.d.ts +17 -0
- package/dist/web-notices.js +47 -6
- package/dist/web-notices.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { html, useState } from "/assets/app-html.js";
|
|
2
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
3
|
+
import { useStore } from "/assets/app-store.js";
|
|
4
|
+
import * as updates from "/assets/app-update.js";
|
|
5
|
+
register("noticeHubSharing", {
|
|
6
|
+
en: {
|
|
7
|
+
"reason_not-owner": "The connected owner changed.",
|
|
8
|
+
"reason_switched-off": "Sharing from the Hub page is turned off in this Fleet's Settings → Hub.",
|
|
9
|
+
"reason_stale-list": "It changed after this list was shown. Refresh to check.",
|
|
10
|
+
"reason_not-shareable": "This agent can't answer Hub questions.",
|
|
11
|
+
"reason_limit": "This Fleet already shares 64 agents, the most allowed.",
|
|
12
|
+
"reason_not-allowed": "The Hub hasn't allowed this share.",
|
|
13
|
+
"reason_unknown-agent": "This agent is no longer available.",
|
|
14
|
+
"reason_expired": "This request expired.",
|
|
15
|
+
"reason_unavailable": "The Fleet could not confirm this change.",
|
|
16
|
+
undoneBy: "A Fleet administrator undid this request.",
|
|
17
|
+
pending: "{0} asked to change sharing with {1} from the Hub page. The result is not confirmed yet.",
|
|
18
|
+
shared: "{0} shared {1} with {2} from the Hub page. Nobody can ask until {0} chooses who may ask.",
|
|
19
|
+
stopped: "{0} stopped sharing {1} with {2} from the Hub page.",
|
|
20
|
+
undoneShare: "{0}: no longer shared.", undoneStop: "{0}: shared again.", changed: "{0}: skipped because it changed or could not be restored.",
|
|
21
|
+
refused: "{0}: not changed ({1}).", undo: "Undo", undoPending: "Not confirmed yet. Refresh Notices to check.",
|
|
22
|
+
expired: "This can no longer be undone here. Use Settings → Hub.", done: "Undone. The notice shows which agents changed.",
|
|
23
|
+
classic: "Hub questions and answers are not posted in its Discord or Telegram room, and the room's chat is not copied to the Hub. It is one agent with one memory: it may use what it learned in the room when it answers here.",
|
|
24
|
+
},
|
|
25
|
+
"zh-TW": {
|
|
26
|
+
"reason_not-owner": "已連接的擁有者已變更。",
|
|
27
|
+
"reason_switched-off": "這個 Fleet 的「設定 → Hub」關閉了從 Hub 頁面分享。",
|
|
28
|
+
"reason_stale-list": "顯示名單之後,狀態已變更,請重新整理確認。",
|
|
29
|
+
"reason_not-shareable": "這個 Agent 目前無法回答 Hub 的提問。",
|
|
30
|
+
"reason_limit": "這個 Fleet 已經分享 64 個 Agent,達到上限。",
|
|
31
|
+
"reason_not-allowed": "Hub 尚未允許這次分享。",
|
|
32
|
+
"reason_unknown-agent": "這個 Agent 已無法使用。",
|
|
33
|
+
"reason_expired": "這次要求已到期。",
|
|
34
|
+
"reason_unavailable": "Fleet 無法確認這次變更。",
|
|
35
|
+
undoneBy: "Fleet 管理員已復原這次變更。",
|
|
36
|
+
pending: "{0} 從 Hub 頁面要求變更與 {1} 的分享,還沒有確認結果。",
|
|
37
|
+
shared: "{0} 從 Hub 頁面把 {1} 分享到 {2}。在 {0} 選擇誰可以問之前,沒有人可以問它。",
|
|
38
|
+
stopped: "{0} 從 Hub 頁面停止把 {1} 分享到 {2}。",
|
|
39
|
+
undoneShare: "{0}:不再分享。", undoneStop: "{0}:已重新分享。", changed: "{0}:狀態已變更或無法還原,已略過。",
|
|
40
|
+
refused: "{0}:沒有變更({1})。", undo: "復原", undoPending: "還沒有確認,請重新整理「通知」確認。",
|
|
41
|
+
expired: "已經無法在這裡復原,請到「設定 → Hub」。", done: "已復原,通知會顯示哪些 Agent 已變更。",
|
|
42
|
+
classic: "Hub 的提問與回答不會貼到它的 Discord 或 Telegram 房間,房間的聊天也不會複製到 Hub。但它是同一個 Agent、同一份記憶:在這裡回答時,可能用到它在房間裡得知的內容。",
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
const tn = (key, ...args) => t(`noticeHubSharing.${key}`, ...args);
|
|
46
|
+
export function hubSharingLines(value) {
|
|
47
|
+
if (!value || !Array.isArray(value.rows)) return [];
|
|
48
|
+
if (value.state === "pending") return [tn("pending", value.byName, value.hubName)];
|
|
49
|
+
const shared = value.rows.filter(row => row.state === "shared").map(row => row.name), stopped = value.rows.filter(row => row.state === "stopped").map(row => row.name);
|
|
50
|
+
const lines = [value.state === "undone" ? tn("undoneBy") : null, shared.length ? tn("shared", value.byName, shared.join(", "), value.hubName) : null,
|
|
51
|
+
stopped.length ? tn("stopped", value.byName, stopped.join(", "), value.hubName) : null].filter(Boolean);
|
|
52
|
+
for (const row of value.rows) {
|
|
53
|
+
if (row.state === "undone") lines.push(tn(row.action === "share" ? "undoneShare" : "undoneStop", row.name));
|
|
54
|
+
if (row.state === "refused") lines.push(tn("refused", row.name, tn(`reason_${row.code || "unavailable"}`)));
|
|
55
|
+
if (row.state === "changed") lines.push(tn("changed", row.name));
|
|
56
|
+
}
|
|
57
|
+
if (value.rows.some(row => row.kind === "classic-room" && row.action === "share" && row.state === "shared")) lines.push(tn("classic"));
|
|
58
|
+
return lines;
|
|
59
|
+
}
|
|
60
|
+
export function HubSharingNotice({ notice }) {
|
|
61
|
+
const value = notice?.hubSharing;
|
|
62
|
+
const [busy, setBusy] = useState(false), [latest, setLatest] = useState(null), [feedback, setFeedback] = useState("");
|
|
63
|
+
const update = updates.updateStore ? useStore(updates.updateStore) : null;
|
|
64
|
+
const shown = latest || value;
|
|
65
|
+
const undo = async () => {
|
|
66
|
+
if (busy) return; setBusy(true); setFeedback("");
|
|
67
|
+
try {
|
|
68
|
+
const response = await fetch(`/api/settings/hub/sharing-notices/${encodeURIComponent(value.key)}/undo`, { method: "POST", headers: { "Content-Type": "application/json" }, body: "{}" });
|
|
69
|
+
const result = await response.json();
|
|
70
|
+
if (response.status === 200) { setLatest(result); }
|
|
71
|
+
else setFeedback(response.status === 409 && result?.error === "expired" ? "expired" : "undoPending");
|
|
72
|
+
} catch { setFeedback("undoPending"); }
|
|
73
|
+
finally { setBusy(false); }
|
|
74
|
+
};
|
|
75
|
+
const expired = !shown || Date.now() >= shown.undoUntil;
|
|
76
|
+
const offered = (shown?.state === "complete" || shown?.state === "undoing") && shown.rows.some(row => row.state === "shared" || row.state === "stopped");
|
|
77
|
+
return html`<div class="n-detail notice-text">${hubSharingLines(shown).map((line, index) => html`<p key=${index}>${line}</p>`)}</div>
|
|
78
|
+
${offered && update?.info?.admin === true ? expired ? html`<p class="note">${tn("expired")}</p>`
|
|
79
|
+
: html`<div class="n-actions"><button type="button" class="btn btn-sm" disabled=${busy} onClick=${undo}>${tn("undo")}</button></div>` : null}
|
|
80
|
+
${feedback ? html`<p class="note" role="status">${tn(feedback)}</p>` : null}`;
|
|
81
|
+
}
|
package/dist/ui/panel-hub.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AgentIntroEditor, hi } from "./hub-agent-intro.js";
|
|
1
2
|
import {hp,personalAgentQuestionHint} from "./hub-personal-agent-strings.js";
|
|
2
3
|
import * as ownerEntryWords from "./hub-owner-strings.js";
|
|
3
4
|
import * as companyViews from "./hub-company-join.js";
|
|
@@ -617,7 +618,7 @@ function ChatLauncher() {
|
|
|
617
618
|
let live = true;
|
|
618
619
|
if (typeof hubClient().room !== "function") return undefined;
|
|
619
620
|
Promise.all(groups.map((r) => hubClient().room(r.id).then((d) => (d && Array.isArray(d.members) ? d.members : [])
|
|
620
|
-
.filter((m) => m && m.kind === "agent" && !m.mine).map((m) => ({ key: `room:${r.id}:${m.id}`, name: m.name || "", sub: hc("launchInRoom", r.name), href: roomPath(r.id) })), () => [])))
|
|
621
|
+
.filter((m) => m && m.kind === "agent" && !m.mine).map((m) => ({ key: `room:${r.id}:${m.id}`, name: m.name || "", sub: [m.intro,hc("launchInRoom", r.name)].filter(Boolean).join(" · "), href: roomPath(r.id) })), () => [])))
|
|
621
622
|
.then((all) => { if (live) setInRooms(all.flat()); });
|
|
622
623
|
return () => { live = false; };
|
|
623
624
|
}, [groupKey]);
|
|
@@ -633,9 +634,9 @@ function ChatLauncher() {
|
|
|
633
634
|
const chats = rs.rooms.filter((r) => r.kind !== "group" && !r.archived);
|
|
634
635
|
const shownIn = new Set(chats.map((r) => (r.legacy || r.agent || {}).exposureId).filter(Boolean));
|
|
635
636
|
const rows = [
|
|
636
|
-
...chats.map((r) => ({ key: r.id, name: r.assistant ? hroom("hubAssistant") : r.name, sub: r.assistant ?
|
|
637
|
+
...chats.map((r) => ({ key: r.id, name: r.assistant ? hroom("hubAssistant") : r.name, sub: r.assistant ? hi("assistant") : [r.agent?.intro,r.agent?.owner?.name ? hc("launchOwner", r.agent.owner.name) : ""].filter(Boolean).join(" · "),
|
|
637
638
|
href: roomPath(r.id), online: r.assistant ? (r.presence || "idle") !== "unavailable" : r.agent?.presence === "online" })),
|
|
638
|
-
...askable.filter((it) => !shownIn.has(it.exposure.id)).map((it) => ({ key: it.grant.id, name: it.exposure.displayName, sub: it.exposure.answerOnly ? hp("answerOnlyAsker") : hc("launchOwner", it.ownerName || "—"), ask: it })),
|
|
639
|
+
...askable.filter((it) => !shownIn.has(it.exposure.id)).map((it) => ({ key: it.grant.id, name: it.exposure.displayName, sub: [it.exposure.intro,it.exposure.answerOnly ? hp("answerOnlyAsker") : hc("launchOwner", it.ownerName || "—")].filter(Boolean).join(" · "), ask: it })),
|
|
639
640
|
...inRooms,
|
|
640
641
|
];
|
|
641
642
|
const needle = q.trim().toLowerCase();
|
|
@@ -796,7 +797,7 @@ function HubRoomView({ room: given }) {
|
|
|
796
797
|
return html`<div class=${`hub-chat${showRail ? " with-rail" : ""}`} ref=${split}>
|
|
797
798
|
<section class="hub-chat-main" aria-label=${name}>
|
|
798
799
|
<header class=${`hub-chat-head${room.answerOnly?" hub-answer-only-head":""}`} data-trust="panel-content">${back}<${Avatar} name=${name} size="sm" />
|
|
799
|
-
<span class="hub-chat-title"><strong>${name}</strong><span class=${`s${room.answerOnly?" hub-answer-only-note":""}`}>${room.answerOnly?hp("answerOnlyAsker"):room.ownerName ? hc("answersFor", room.ownerName) : ""}</span
|
|
800
|
+
<span class="hub-chat-title"><strong>${name}</strong><span class=${`s${room.answerOnly?" hub-answer-only-note":""}`}>${room.answerOnly?hp("answerOnlyAsker"):room.ownerName ? hc("answersFor", room.ownerName) : ""}</span>${room.intro?html`<span class="s hub-agent-intro-line">${room.intro}</span>`:null}</span>
|
|
800
801
|
${tag}
|
|
801
802
|
<button type="button" class="icon-btn" aria-pressed=${wide ? String(showRail) : undefined} aria-label=${hc("showInfo")} title=${hc("showInfo")} onClick=${toggleInfo}><${Icon} name="info" /></button>
|
|
802
803
|
<span class="hub-head-tools"><${TextSizeButton} /></span>
|
|
@@ -917,7 +918,7 @@ function HubThread({ store, name, panelKey, threadRef, extra = null, emptyView =
|
|
|
917
918
|
/** The right-hand panel's cards (the usage rail's look): the agent, its quota (G), your access, who sees it, what is not here. */
|
|
918
919
|
function HubRoomInfo({ room, closed = false, denied = false }) {
|
|
919
920
|
const name = room.exposureName || "", owner = room.ownerName || "";
|
|
920
|
-
return html`<section class="u-provider hub-card hub-agent-card"><${Avatar} name=${name} size="lg" /><strong>${name}</strong
|
|
921
|
+
return html`<section class="u-provider hub-card hub-agent-card"><${Avatar} name=${name} size="lg" /><strong>${name}</strong>${room.intro?html`<p class="note">${room.intro}</p>`:null}
|
|
921
922
|
${owner ? html`<span class="note">${hc("answersFor", owner)}</span>` : null}</section>
|
|
922
923
|
<${QuotaCard} room=${room} />
|
|
923
924
|
${room.grantExpiresAt && !closed ? html`<section class="u-provider hub-card"><div class="u-head"><strong>${hc("yourAccess")}</strong></div>
|
|
@@ -961,6 +962,8 @@ function HubMine() {
|
|
|
961
962
|
const [cat, reload] = useRead(() => hubClient().catalog());
|
|
962
963
|
const [pairings, reloadPairings] = useRead(() => hubClient().pairings());
|
|
963
964
|
const [msg, setMsg] = useState(null);
|
|
965
|
+
const [allowTarget, setAllowTarget] = useState(null);
|
|
966
|
+
const modernSharing = session?.features?.includes("agent-sharing-v1") && hubClient()?.agentSharingV1 === true;
|
|
964
967
|
useEffect(() => {
|
|
965
968
|
linkHubChatCss(); linkHubOwnerCss();
|
|
966
969
|
if (!document.querySelector('link[data-hub-sharing-css="1"]')) {
|
|
@@ -986,10 +989,10 @@ function HubMine() {
|
|
|
986
989
|
// lands nowhere (useRead's own liveness ends with that page).
|
|
987
990
|
if (x) return html`<${HubAgentPage} key=${x.id} x=${x} act=${act} msg=${msg} />`;
|
|
988
991
|
// Nothing shared yet: the empty state below says where to share from, so the lead doesn't say it too (Argon #20).
|
|
989
|
-
return html`<div class="col hub-owner"
|
|
992
|
+
return html`<div class="col hub-owner">${!modernSharing ? html`<${OlderFleetBanner} client=${hubClient()} signIn=${session?.csrf || ""} />` : null}<p class="s-page-lead hub-page-lead">${modernSharing ? ho("mineLeadNew") : ho(cat && !cat.error && !mine.length ? "mineLeadShort" : "mineLead")}</p>
|
|
990
993
|
<div class="s-section-layout">
|
|
991
994
|
${/* M-3190: 「我的 Fleet」 moved here from 對話 — the person's Fleets and the steps to connect one. */ ""}
|
|
992
|
-
${groupPolicyOn(session, hubClient()) ? html`<${LazyGroups} pick=${(m) => m.MyFleetsCard || (() => null)} props=${{ quick: session.features.includes("quick-pairing-v1"), admin: session.admin === true, features: session.features }} />` : null}
|
|
995
|
+
${groupPolicyOn(session, hubClient()) ? html`<${LazyGroups} pick=${(m) => m.MyFleetsCard || (() => null)} props=${{ quick: session.features.includes("quick-pairing-v1"), admin: session.admin === true, features: session.features, compact: modernSharing }} />` : null}
|
|
993
996
|
${session?.features?.includes("personal-agents-v1") ? html`<${LazyRoomPart} load=${() => import("./hub-personal-agent.js")} name="HubPersonalAgent" props=${{client:hubClient(),scope:session.csrf,isAdmin:session.admin===true,onSaved:reload}} />` : null}
|
|
994
997
|
${roomsLive() ? html`<${LazyRoomPart} load=${() => import("./hub-invitations.js")} name="InvitationsList" props=${{ client: hubClient(), heading: true }} />` : null}
|
|
995
998
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
@@ -1000,12 +1003,13 @@ function HubMine() {
|
|
|
1000
1003
|
${p.ownerConfirmed ? html`<span class="tag ok">${hw("confirmed")}</span>` : html`<button type="button" class="btn btn-sm btn-primary" onClick=${() => confirmPairing(p)}>${hw("confirmPairing")}</button>`}
|
|
1001
1004
|
</div>`)}</div></section>` : null}
|
|
1002
1005
|
${!cat ? html`<${Skeleton} variant="rows" lines=${4} />` : cat.error ? html`<${ErrorState} message=${cat.error} onRetry=${reload} />` : null}
|
|
1003
|
-
${
|
|
1004
|
-
${mine.length ? html`<
|
|
1006
|
+
${modernSharing ? html`<${LazyRoomPart} load=${() => import("./hub-my-agents.js")} name="HubMyAgents" props=${{ client: hubClient(), scope: session.csrf, shared: mine, policy: groupPolicyOn(session, hubClient()), personal: session.features.includes("personal-agents-v1"), apps: session.features.includes("mcp-apps-v1"), pausable: session.features.includes("sharing-pause-v1"), subjects: session.features.includes("grant-subjects-v1"), onChanged: reload, onAllow: setAllowTarget }} />` : null}
|
|
1007
|
+
${!modernSharing && cat && !cat.error && !mine.length ? html`<div class="center hub-empty"><${Empty} icon="globe" title=${hw("exposuresEmpty")} hint=${hw("exposuresHint")} /></div>` : null}
|
|
1008
|
+
${!modernSharing && mine.length ? html`<section class="card hub-shared"><h3>${ho(mine.some(e => e.kind === "personal") ? "yourAgentsCount" : "sharedCount", mine.length)}</h3>
|
|
1005
1009
|
<div class="hub-rows">${mine.map((e) => html`<a key=${e.id} class="s-row hub-row hub-row-link" href=${`/ui/hub/exposures?agent=${encodeURIComponent(e.id)}`}>
|
|
1006
|
-
<${Avatar} name=${e.displayName} /><span class="hub-row-text"><strong>${e.displayName}</strong
|
|
1010
|
+
<${Avatar} name=${e.displayName} /><span class="hub-row-text"><strong>${e.displayName}</strong>${e.intro?html`<small class="note">${e.intro}</small>`:null}<small class="note">${grantSummary(e.grants)}</small></span>
|
|
1007
1011
|
${stateTag(e.state, e.kind === "personal")}<${Icon} name="next" size=${16} /></a>`)}</div></section>` : null}
|
|
1008
|
-
</div
|
|
1012
|
+
</div>${allowTarget ? html`<${AllowDialog} x=${allowTarget} act=${act} onClose=${() => setAllowTarget(null)} />` : null}</div>`;
|
|
1009
1013
|
}
|
|
1010
1014
|
|
|
1011
1015
|
/** One shared agent: who may ask (allow, revoke), whether askers see its quota (G), who asked lately, pause. */
|
|
@@ -1042,6 +1046,7 @@ function HubAgentPage({ x, act, msg }) {
|
|
|
1042
1046
|
? `${hroom("agentNoOneToOne")} · ${roomCount === 1 ? hroom("inRoomsOne") : hroom("inRoomsMany", String(roomCount))}` : grantSummary(grants)} />
|
|
1043
1047
|
<div class="s-section-layout">
|
|
1044
1048
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
1049
|
+
${session?.features?.includes("agent-intros-v1") && client.agentIntrosV1 ? html`<${AgentIntroEditor} exposure=${x} client=${client} onSaved=${()=>act(async()=>({ok:true}))} />` : null}
|
|
1045
1050
|
<section class="card"><div class="hub-card-head"><h3>${ho("whoMayAsk")}</h3>${shared ? html`<button type="button" class="btn btn-sm" onClick=${() => setAllowing(true)}><${Icon} name="plus" size=${14} />${ho("allow")}</button>` : null}</div>
|
|
1046
1051
|
${grants.length ? html`<div class="hub-rows">${grants.map((g) => html`<div key=${g.id} class="s-row hub-row">
|
|
1047
1052
|
<${Avatar} name=${g.subjectName || g.subjectLogin} size="sm" />
|
package/dist/ui/panel-notices.js
CHANGED
|
@@ -10,6 +10,7 @@ import { PanelHeader, setTitle } from "/assets/app-shell.js";
|
|
|
10
10
|
import { chatPath } from "/assets/app-route.js";
|
|
11
11
|
import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
|
|
12
12
|
import { Icon } from "/assets/ui-icons.js";
|
|
13
|
+
import { HubSharingNotice } from "./notice-hub-sharing.js";
|
|
13
14
|
import { HubUpdateNotice, useHubUpdateActions } from "./notice-hub-update.js";
|
|
14
15
|
|
|
15
16
|
register("notices", {
|
|
@@ -92,7 +93,7 @@ export function NoticesPanel({ navKey }) {
|
|
|
92
93
|
<div class="n-title"><strong>${tn(`kind_${n.kind}`)}${n.instance ? ` · ${n.instance}` : ""}</strong>
|
|
93
94
|
${n.id > seenAtOpen ? html`<span class="notice-new">${tn("unread")}</span>` : null}
|
|
94
95
|
<span class="n-age" title=${new Date(n.at).toLocaleString()}>${noticeAge(n.at, nowMs)}</span></div>
|
|
95
|
-
${n.hubUpdate ? html`<${HubUpdateNotice} notice=${n} actions=${hubActions} />` : html`<p class="n-detail notice-text">${n.text}</p>`}
|
|
96
|
+
${n.hubSharing ? html`<${HubSharingNotice} notice=${n} />` : n.hubUpdate ? html`<${HubUpdateNotice} notice=${n} actions=${hubActions} />` : html`<p class="n-detail notice-text">${n.text}</p>`}
|
|
96
97
|
${n.instance && known.has(n.instance) ? html`<div class="n-actions"><a class="btn btn-sm btn-ghost" href=${chatPath(n.instance)}>${tn("open")}</a></div>` : null}
|
|
97
98
|
</div>
|
|
98
99
|
</article>`)}
|
|
@@ -12,7 +12,7 @@ register("hubConnection", {
|
|
|
12
12
|
rights: "Whether you can share agents or chat depends on what your Hub administrator allows; the Hub's home page shows yours.",
|
|
13
13
|
title: "Hub connection", unconnected: "Not connected", connected: "Connected", paused: "Paused", connecting: "Connecting…", attention: "Connection needs attention",
|
|
14
14
|
hub: "Hub", fleet: "Fleet", thisFleet: "This Fleet", open: "Open Hub", pause: "Pause connection", resume: "Resume connection",
|
|
15
|
-
connectedHint: "This Fleet can use the Hub. Connecting does not share any
|
|
15
|
+
connectedHint: "This Fleet can use the Hub. Connecting does not share any agent: other people can see and ask one only after you share it.",
|
|
16
16
|
pausedHint: "New Hub work and answer delivery are stopped. The saved connection and existing conversations are kept.",
|
|
17
17
|
connectingHint: "The connection is saved. Waiting for the Hub link before reporting Connected.",
|
|
18
18
|
advanced: "Connect with a pairing code (Advanced)", manualHint: "Use this for a Hub with a pairing code. The main sign-in flow enables membership when it succeeds.",
|
|
@@ -25,7 +25,7 @@ register("hubConnection", {
|
|
|
25
25
|
rights: "連接後能不能分享 Agent、和 Agent 對話,由 Hub 管理員設定;Hub 首頁會顯示你目前的權限。",
|
|
26
26
|
title: "Hub 連接", unconnected: "尚未連接", connected: "已連接", paused: "已暫停", connecting: "正在連接…", attention: "連接需要處理",
|
|
27
27
|
hub: "Hub", fleet: "Fleet", thisFleet: "這個 Fleet", open: "開啟 Hub", pause: "暫停連接", resume: "恢復連接",
|
|
28
|
-
connectedHint: "這個 Fleet 已可使用 Hub。連接不會自動分享 Agent
|
|
28
|
+
connectedHint: "這個 Fleet 已可使用 Hub。連接不會自動分享 Agent:要你自己分享之後,其他人才看得到、才能提問。",
|
|
29
29
|
pausedHint: "已停止新的 Hub 工作與回答傳送;連接資料和既有對話仍保留。",
|
|
30
30
|
connectingHint: "連接資料已儲存,正在等待與 Hub 的網路連線;尚未顯示為已連接。",
|
|
31
31
|
advanced: "使用配對碼連接(進階)", manualHint: "供使用配對碼的 Hub 使用。上方登入流程成功後會自動啟用成員功能。",
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
2
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
3
|
+
import { api, confirmedWrite } from "./settings-confirm.js";
|
|
4
|
+
|
|
5
|
+
register("hubPageSharing", {
|
|
6
|
+
en: {
|
|
7
|
+
title: "Sharing from the Hub", switch: "Let me share agents from the Hub page",
|
|
8
|
+
hint: "When on, this Fleet sends the Hub your agents' names and descriptions, which only you can see there, and applies a share or stop you make on the Hub page without asking again. A notice with Undo is posted here each time.",
|
|
9
|
+
pending: "Waiting for owner confirmation…", unavailable: "This setting is unavailable. Check again.",
|
|
10
|
+
unknown: "The change is not confirmed. Check the saved setting before trying again.", retry: "Check again",
|
|
11
|
+
},
|
|
12
|
+
"zh-TW": {
|
|
13
|
+
title: "從 Hub 分享", switch: "允許我從 Hub 頁面分享 Agent",
|
|
14
|
+
hint: "開啟後,這個 Fleet 會把你的 Agent 名稱與說明傳給 Hub(在 Hub 上只有你看得到),並直接套用你在 Hub 頁面做的分享或停止,不再另外確認。每次都會在這裡發出可以復原的通知。",
|
|
15
|
+
pending: "等待擁有者確認…", unavailable: "目前無法使用這個設定,請再次檢查。",
|
|
16
|
+
unknown: "尚未確認變更,請先檢查儲存的設定再試一次。", retry: "再次檢查",
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const copy = key => t(`hubPageSharing.${key}`);
|
|
20
|
+
const path = "/api/settings/hub/share-from-hub";
|
|
21
|
+
export function HubPageSharingSettings() {
|
|
22
|
+
const [enabled, setEnabled] = useState(null), [busy, setBusy] = useState(false), [phase, setPhase] = useState("");
|
|
23
|
+
const owner = useRef({ live: true, seq: 0, busy: false });
|
|
24
|
+
const read = async () => {
|
|
25
|
+
const seq = ++owner.current.seq;
|
|
26
|
+
let result; try { result = await api(path); } catch { result = null; }
|
|
27
|
+
if (!owner.current.live || owner.current.seq !== seq) return;
|
|
28
|
+
if (result?.ok && typeof result.body?.enabled === "boolean") { setEnabled(result.body.enabled); setPhase(""); }
|
|
29
|
+
else { setEnabled(null); setPhase("unavailable"); }
|
|
30
|
+
};
|
|
31
|
+
useEffect(() => { owner.current.live = true; void read(); return () => { owner.current.live = false; owner.current.seq++; }; }, []);
|
|
32
|
+
const change = async value => {
|
|
33
|
+
if (enabled === null || owner.current.busy) return;
|
|
34
|
+
owner.current.busy = true; owner.current.seq++; setBusy(true); setPhase("");
|
|
35
|
+
try {
|
|
36
|
+
const result = await confirmedWrite(path, { method: "PUT", body: { enabled: value }, resendable: true, label: copy("title"),
|
|
37
|
+
onPending: () => { if (owner.current.live) setPhase("pending"); } });
|
|
38
|
+
if (!owner.current.live) return;
|
|
39
|
+
if (result.ok) await read();
|
|
40
|
+
else { setEnabled(null); setPhase("unknown"); }
|
|
41
|
+
} catch { if (owner.current.live) { setEnabled(null); setPhase("unknown"); } }
|
|
42
|
+
finally { owner.current.busy = false; if (owner.current.live) setBusy(false); }
|
|
43
|
+
};
|
|
44
|
+
return html`<div class="hub-update-consent">
|
|
45
|
+
<label class="check hub-update-switch"><input class="s-ui-toggle" type="checkbox" role="switch" id="hubShareFromHub"
|
|
46
|
+
checked=${enabled === true} disabled=${enabled === null || busy} aria-describedby="hubShareFromHub-note"
|
|
47
|
+
onChange=${event => { void change(event.target.checked); }} /><span>${copy("switch")}</span></label>
|
|
48
|
+
<p class="note" id="hubShareFromHub-note">${copy("hint")}</p>
|
|
49
|
+
${phase ? html`<p role="status">${copy(phase)}</p>` : null}
|
|
50
|
+
${enabled === null && !busy && phase ? html`<button class="btn btn-sm" type="button" onClick=${read}>${copy("retry")}</button>` : null}
|
|
51
|
+
</div>`;
|
|
52
|
+
}
|
package/dist/ui/settings-hub.js
CHANGED
|
@@ -21,11 +21,12 @@ import { confirmPlace, pendingView } from "./hub-confirm-place.js";
|
|
|
21
21
|
import { hq } from "./hub-quick-strings.js";
|
|
22
22
|
import { hp } from "./hub-pairing-progress-strings.js";
|
|
23
23
|
import { hpf, pairingCodeState, pairingFailure } from "./hub-pairing-form-strings.js";
|
|
24
|
+
import { HubPageSharingSettings } from "./settings-hub-page-sharing.js";
|
|
24
25
|
import { HubUpdateConsent } from "./settings-hub-updates.js";
|
|
25
26
|
|
|
26
27
|
register("hubSharingFleet", {
|
|
27
|
-
en: { hint: "To pause and resume without clearing the allow list, open this agent under My
|
|
28
|
-
"zh-TW": { hint: "要保留允許名單並暫停或繼續分享,請在 Hub
|
|
28
|
+
en: { hint: "To pause and resume without clearing the allow list, open this agent under My agents on the Hub. Turning Share off stops sharing." },
|
|
29
|
+
"zh-TW": { hint: "要保留允許名單並暫停或繼續分享,請在 Hub「我的 Agent」開啟這個 Agent。關閉「分享」會停止分享。" },
|
|
29
30
|
});
|
|
30
31
|
const CONNECT_ERRORS = { address: "errAddress", code: "errCode", busy: "errBusy", unreachable: "errUnreachable", refused: "errRefused" };
|
|
31
32
|
const HOLDS = new Set(["unknown_outcome", "expired", "unsaved", "refused", "revoked", "disconnected", "rejected"]);
|
|
@@ -288,6 +289,7 @@ function HubExposures({ client, pairing }) {
|
|
|
288
289
|
}, [rows, msg]);
|
|
289
290
|
return html`<div class="hub-exposures">
|
|
290
291
|
<h4>${hw("sharedTitle")}</h4>
|
|
292
|
+
${pairing?.link === "online" ? html`<${HubPageSharingSettings} />` : null}
|
|
291
293
|
<p class="note">${hw("agentLead")}</p>
|
|
292
294
|
<p class="note">${hw("classicRoomLead")}</p>
|
|
293
295
|
<p class="note hub-sharing-hint">${t("hubSharingFleet.hint")}</p>
|
|
@@ -23,6 +23,7 @@ const ROWS = [
|
|
|
23
23
|
["general.location", "agent-defaults", "#general-location", null, null, ["general", "windows", "paired PC", "host", "location"], ["General", "Windows", "電腦", "主機", "執行位置"], L("Run General on", "General 執行位置")],
|
|
24
24
|
// alpha.6 feedback (#2): "hub" found nothing — Settings → Hub's cards. Connect to a Hub is drawn once membership is on.
|
|
25
25
|
["hub.membership", "hub", "#hubMemberEnabled", null, "hub_member.enabled", ["hub", "team hub", "membership", "connect", "join", "pair", "share agents"], ["Hub", "團隊 Hub", "成員", "連線", "加入", "配對", "分享"], L("Allow this fleet to connect to a Hub", "允許這個 Fleet 連線至 Hub")],
|
|
26
|
+
["hub.page-sharing", "hub", "#hubShareFromHub", null, "hub_member.share_from_hub", ["hub", "share agents", "undo", "owner", "agent list"], ["Hub", "分享 Agent", "復原", "擁有者", "清單"], L("Let me share agents from the Hub page", "允許我從 Hub 頁面分享 Agent")],
|
|
26
27
|
["hub.company-address", "hub", "#hubCompanyAddress", null, null, ["hub", "company account", "company link", "sign in", "connect", "join"], ["Hub", "公司帳號", "公司連結", "登入", "連接", "加入"], L("Hub address", "Hub 位址")],
|
|
27
28
|
["hub.connect", "hub", "#hub-connect", null, null, ["hub", "connect to a hub", "pairing code", "hub address", "fingerprint", "pair", "unpair", "disconnect", "join"], ["Hub", "連線至 Hub", "配對碼", "Hub 位址", "指紋", "配對", "解除配對", "中斷連線", "加入"], L("Connect to a Hub", "連線至 Hub")],
|
|
28
29
|
["quota.notices", "notifications", "#quota-notices", null, "defaults.quota_notice", ["usage", "quota", "notifications", "remaining", "weekly"], ["用量", "額度", "提醒", "通知", "剩餘"], L("Quota notices", "用量提醒")],
|
|
@@ -341,8 +341,8 @@ export function signInHref() {
|
|
|
341
341
|
|
|
342
342
|
// ── AgEnD Hub P1 (docs/design/hub-ui-client.md): the page's mark, set by the listener that served it ──
|
|
343
343
|
register("hubShell", {
|
|
344
|
-
en: { brand: "AgEnD Hub", ask: "Ask", exposures: "My
|
|
345
|
-
"zh-TW": { brand: "AgEnD Hub", ask: "提問", exposures: "
|
|
344
|
+
en: { brand: "AgEnD Hub", ask: "Ask", exposures: "My agents", admin: "Administration", preview: "Preview" },
|
|
345
|
+
"zh-TW": { brand: "AgEnD Hub", ask: "提問", exposures: "我的 Agent", admin: "管理", preview: "預覽版" },
|
|
346
346
|
});
|
|
347
347
|
function hubMarks() {
|
|
348
348
|
const tokens = String((typeof document !== "undefined" && document.body?.dataset?.hub) || "").split(/\s+/);
|
|
@@ -703,6 +703,8 @@ register("pendingSummary", {
|
|
|
703
703
|
"hub.run.stop": "Stop this fleet's Hub and pause chats with shared agents. Valid sign-ins can resume when it runs again. Nothing is deleted.",
|
|
704
704
|
"hub.preview.on": "Serve HTML previews on this Hub at port {0}.",
|
|
705
705
|
"hub.preview.off": "Stop serving HTML previews on this Hub.",
|
|
706
|
+
"hub.pageSharing.enable": "Allow the connected Hub to apply sharing changes requested by this Fleet's owner, and send its agent names and descriptions to that owner.",
|
|
707
|
+
"hub.pageSharing.disable": "Turn off sharing from the Hub page and stop sending its agent list. Existing shares are unchanged.",
|
|
706
708
|
"hub.membership.enable": "Enable this fleet's Hub membership. Connecting and sharing an agent are separate choices.",
|
|
707
709
|
"hub.membership.disable": "Disable this fleet's Hub membership. New Hub work and answer disclosure stop; existing agent conversations remain.",
|
|
708
710
|
"hub.companyJoin.confirm": "Connect this Fleet to Hub {0} using your company account. Agent sharing stays separate.",
|
|
@@ -747,6 +749,8 @@ register("pendingSummary", {
|
|
|
747
749
|
"hub.run.stop": "停止這個 Fleet 的 Hub,暫停與分享的 Agent 的對話。再次執行後,仍有效的登入狀態可以恢復。不會刪除任何資料。",
|
|
748
750
|
"hub.preview.on": "在這個 Hub 的連接埠 {0} 提供 HTML 預覽。",
|
|
749
751
|
"hub.preview.off": "停止在這個 Hub 提供 HTML 預覽。",
|
|
752
|
+
"hub.pageSharing.enable": "允許已連接的 Hub 套用這個 Fleet 擁有者要求的分享變更,並把 Agent 名稱與說明傳給擁有者。",
|
|
753
|
+
"hub.pageSharing.disable": "關閉從 Hub 頁面分享並停止傳送 Agent 清單,既有分享不變。",
|
|
750
754
|
"hub.membership.enable": "啟用這個 Fleet 的 Hub 成員功能。連接與分享 Agent 需另外選擇。",
|
|
751
755
|
"hub.membership.disable": "停用這個 Fleet 的 Hub 成員功能。停止新的 Hub 工作與回答傳送;既有 Agent 對話會保留。",
|
|
752
756
|
"hub.companyJoin.confirm": "以公司帳號將這個 Fleet 連接到 Hub {0}。分享 Agent 需另外選擇。",
|
|
@@ -792,6 +796,8 @@ const pendingSummaryArguments = Object.fromEntries([
|
|
|
792
796
|
["hub.run.stop", ""],
|
|
793
797
|
["hub.preview.on", "s"],
|
|
794
798
|
["hub.preview.off", ""],
|
|
799
|
+
["hub.pageSharing.enable", ""],
|
|
800
|
+
["hub.pageSharing.disable", ""],
|
|
795
801
|
["hub.membership.enable", ""],
|
|
796
802
|
["hub.membership.disable", ""],
|
|
797
803
|
["hub.companyJoin.confirm", "s"],
|
|
@@ -79,7 +79,8 @@ export function applyStatus(d) {
|
|
|
79
79
|
*/
|
|
80
80
|
export const NOTICES_KEPT = 500;
|
|
81
81
|
function noticesState(enabled, byId, seen) {
|
|
82
|
-
const
|
|
82
|
+
const all = [...byId.values()].sort((a, b) => b.id - a.id);
|
|
83
|
+
const items = all.filter((notice, index) => index < NOTICES_KEPT || (notice.hubSharing?.undoUntil || 0) > Date.now());
|
|
83
84
|
return { enabled, items, seen, unread: items.filter((n) => n.id > seen).length };
|
|
84
85
|
}
|
|
85
86
|
const validNotice = (n) => !!n && Number.isSafeInteger(n.id) && n.id > 0 && typeof n.text === "string";
|
|
@@ -91,7 +92,10 @@ export function mergeNoticeList(cur, d) {
|
|
|
91
92
|
return noticesState(!!(d && d.enabled === true), byId, Math.max(cur ? cur.seen | 0 : 0, d ? d.seen | 0 : 0));
|
|
92
93
|
}
|
|
93
94
|
export function addNotice(cur, n) {
|
|
94
|
-
if (!cur || !cur.enabled || !validNotice(n)
|
|
95
|
+
if (!cur || !cur.enabled || !validNotice(n)) return cur;
|
|
96
|
+
const previous = cur.items.find(x => x.id === n.id);
|
|
97
|
+
if (previous && (!n.hubSharing || !previous.hubSharing || n.hubSharing.key !== previous.hubSharing.key
|
|
98
|
+
|| n.hubSharing.version <= previous.hubSharing.version)) return cur;
|
|
95
99
|
return noticesState(true, new Map([...cur.items, n].map((x) => [x.id, x])), cur.seen | 0);
|
|
96
100
|
}
|
|
97
101
|
/** The newest Notice the status frame names that the page does not have yet (a polling page hears no `notice`). 0: none. */
|
|
@@ -172,3 +172,6 @@ a.hub-launch-pill { border: 1px solid var(--border); background: transparent; co
|
|
|
172
172
|
.inst-alt.hub-answer-only-note, .cmd-desc.hub-answer-only-note { white-space: normal; overflow-wrap: anywhere; }
|
|
173
173
|
|
|
174
174
|
.hub-chat-head.hub-answer-only-head { padding-block: var(--s-2); }
|
|
175
|
+
|
|
176
|
+
/* Room context H1: a short public introduction stays readable on narrow screens. */
|
|
177
|
+
.hub-chat-title .hub-agent-intro-line{white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* Lazy linked: retained shells receive the grouped owner page and its phone action bar together. */
|
|
2
|
+
.hub-my-agents { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; padding-bottom: calc(var(--s-6) * 3); }
|
|
3
|
+
.hub-my-agents > .field-row { justify-content: flex-end; }
|
|
4
|
+
.hub-agent-fleet > summary { display: list-item; cursor: pointer; padding: var(--s-2); }
|
|
5
|
+
.hub-agent-fleet > summary strong { margin-right: var(--s-3); }
|
|
6
|
+
.hub-agent-fleet > summary .note { display: inline; }
|
|
7
|
+
.hub-agent-choice { border-bottom: 1px solid var(--border); }
|
|
8
|
+
.hub-agent-choice:last-child { border-bottom: 0; }
|
|
9
|
+
.hub-agent-choice .hub-row-text { overflow-wrap: anywhere; }
|
|
10
|
+
.hub-agent-choice .hub-row-text > .tag { width: fit-content; }
|
|
11
|
+
.hub-agent-tick { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; flex-shrink: 0; }
|
|
12
|
+
.hub-agent-tick input { width: 1.2em; height: 1.2em; }
|
|
13
|
+
.hub-classic-disclosure { margin: 0 var(--s-3) var(--s-3); }
|
|
14
|
+
.hub-share-bar { position: sticky; bottom: var(--s-3); z-index: 5; display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-2); }
|
|
15
|
+
.hub-share-bar > strong { flex: 1; }
|
|
16
|
+
@media (max-width: 899px), (pointer: coarse) {
|
|
17
|
+
.hub-my-agents .btn { min-height: 44px; min-width: 44px; }
|
|
18
|
+
.hub-my-agents a { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); }
|
|
19
|
+
.hub-agent-choice .s-row { flex-wrap: wrap; }
|
|
20
|
+
.hub-agent-choice .hub-row-text { min-width: 0; flex: 1 1 50%; }
|
|
21
|
+
.hub-agent-fleet > summary .note { display: block; }
|
|
22
|
+
.hub-share-bar { bottom: calc(env(safe-area-inset-bottom, 0px) + var(--s-2)); }
|
|
23
|
+
.hub-share-bar > strong { flex-basis: 100%; }
|
|
24
|
+
.hub-share-bar > .btn { flex: 1; }
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.hub-my-fleets-head { justify-content: space-between; flex-wrap: wrap; }
|
|
28
|
+
.hub-my-fleets-head h3 { margin: 0; }
|
|
29
|
+
.hub-agent-choice[data-unavailable] .hub-row-text { opacity: .65; }
|
|
30
|
+
.hub-share-access-list { list-style: none; padding: 0; margin: 0; }
|
|
31
|
+
.hub-share-access-item { display: flex; align-items: center; gap: var(--s-3); padding-block: var(--s-2); flex-wrap: wrap; }
|
|
32
|
+
@media (max-width: 899px), (pointer: coarse) {
|
|
33
|
+
.hub-my-agents .hub-agent-choice .s-row.hub-row { display: grid; grid-template-columns: 44px 28px minmax(0, 1fr); }
|
|
34
|
+
.hub-agent-choice .hub-agent-pause { grid-column: 3; justify-self: start; }
|
|
35
|
+
}
|
package/dist/web-api.d.ts
CHANGED
|
@@ -304,6 +304,8 @@ export interface WebApiContext {
|
|
|
304
304
|
readonly guestSearches?: OfficeWriteLimiter;
|
|
305
305
|
/** #2578: the agents' live acts in the Office view (office_set); absent: /ui/office-acts is not offered. */
|
|
306
306
|
readonly officeActs?: Pick<OfficeActs, "live">;
|
|
307
|
+
/** M-3293: an Office pat or feed for the instance's next real message (FleetManager.officeTell); whether it was stored. */
|
|
308
|
+
officeTell?(instance: string, person: string, kind: "pat" | "feed"): boolean;
|
|
307
309
|
/** #2636: Office share links (office-share-service.ts): the open ones, making and ending one. */
|
|
308
310
|
readonly officeShares?: {
|
|
309
311
|
enabled(): boolean;
|
|
@@ -503,7 +505,8 @@ export interface WebApiContext {
|
|
|
503
505
|
} | null;
|
|
504
506
|
/** Answer one of them, exactly as a click on its platform button would. */
|
|
505
507
|
/** `text`: #2675 — the typed answer, for the one action the page shows a text box for. */
|
|
506
|
-
|
|
508
|
+
webPromptNeedsHuman?(nonce: string): boolean;
|
|
509
|
+
clickWebPrompt?(instance: string, nonce: string, action: string, text?: string, humanSession?: boolean): Promise<{
|
|
507
510
|
status: number;
|
|
508
511
|
error?: string;
|
|
509
512
|
}>;
|
package/dist/web-api.js
CHANGED
|
@@ -3443,6 +3443,51 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3443
3443
|
handleSendMessage(req, res, ctx);
|
|
3444
3444
|
return true;
|
|
3445
3445
|
}
|
|
3446
|
+
// M-3293 (#4119): "Tell" — an Office pat or feed, for the agent's next real message (never a turn, never a wake). The
|
|
3447
|
+
// Office is an admin's (decision 7933bf90: over the public link too), as the archive's reads: a guest (no Office) or a
|
|
3448
|
+
// read-only session is refused; a registered instance; a person (a session revoked meanwhile: 401).
|
|
3449
|
+
if (method === "POST" && path === "/ui/office-tell") {
|
|
3450
|
+
const admission = adminAdmissionOf(req, url, ctx);
|
|
3451
|
+
if (!admission || guestRequestOf(req)) {
|
|
3452
|
+
req.resume();
|
|
3453
|
+
json(res, 403, { error: "admin_only" });
|
|
3454
|
+
return true;
|
|
3455
|
+
}
|
|
3456
|
+
(async () => {
|
|
3457
|
+
let raw;
|
|
3458
|
+
try {
|
|
3459
|
+
raw = await parseBody(req);
|
|
3460
|
+
}
|
|
3461
|
+
catch {
|
|
3462
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
3463
|
+
return;
|
|
3464
|
+
}
|
|
3465
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
3466
|
+
return;
|
|
3467
|
+
// Fable #4130: still that admin once the body is in (a session demoted meanwhile queues nothing), as the other admin POSTs.
|
|
3468
|
+
if (adminAdmissionOf(req, url, ctx) !== admission || guestRequestOf(req)) {
|
|
3469
|
+
json(res, 403, { error: "admin_only" });
|
|
3470
|
+
return;
|
|
3471
|
+
}
|
|
3472
|
+
const b = raw;
|
|
3473
|
+
const instance = typeof b?.instance === "string" ? b.instance : "", kind = b?.kind;
|
|
3474
|
+
if (!instance || instance.length > 128 || !safeInstanceSegment(instance) || (kind !== "pat" && kind !== "feed")) {
|
|
3475
|
+
json(res, 400, { error: "instance and kind (pat or feed) required" });
|
|
3476
|
+
return;
|
|
3477
|
+
}
|
|
3478
|
+
if (!registeredChatInstance(ctx, instance) && !ctx.instanceIpcClients.has(instance)) {
|
|
3479
|
+
json(res, 404, { error: `Instance not found: ${instance}` });
|
|
3480
|
+
return;
|
|
3481
|
+
}
|
|
3482
|
+
const person = webPersonOf(req, new URL(req.url ?? "/", "http://localhost"), ctx);
|
|
3483
|
+
if (!person) {
|
|
3484
|
+
json(res, 401, { error: WEB_TOKEN_INVALID_MESSAGE });
|
|
3485
|
+
return;
|
|
3486
|
+
}
|
|
3487
|
+
json(res, 200, { queued: ctx.officeTell?.(instance, person.name, kind) ?? false });
|
|
3488
|
+
})();
|
|
3489
|
+
return true;
|
|
3490
|
+
}
|
|
3446
3491
|
// ── Files (C2): upload one file for an instance; fetch a file by the id the fleet issued for it ──
|
|
3447
3492
|
if (method === "POST" && path === "/ui/upload") {
|
|
3448
3493
|
handleUpload(req, res, url, ctx);
|
|
@@ -3938,7 +3983,16 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3938
3983
|
json(res, 400, { error: "instance, nonce and action required" });
|
|
3939
3984
|
return;
|
|
3940
3985
|
}
|
|
3941
|
-
const
|
|
3986
|
+
const needsHuman = ctx.webPromptNeedsHuman?.(nonce) === true;
|
|
3987
|
+
if (needsHuman) {
|
|
3988
|
+
const verdict = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
|
|
3989
|
+
if (verdict.kind !== "allow" || verdict.via !== "session" || verdict.session.tier !== "admin") {
|
|
3990
|
+
json(res, 403, { error: "This decision needs a signed-in administrator" });
|
|
3991
|
+
return;
|
|
3992
|
+
}
|
|
3993
|
+
}
|
|
3994
|
+
const r = needsHuman ? await click(instance, nonce, action, text, true)
|
|
3995
|
+
: text === undefined ? await click(instance, nonce, action) : await click(instance, nonce, action, text);
|
|
3942
3996
|
// 409: answered elsewhere first, expired, or never open — the page drops the buttons on `gone`.
|
|
3943
3997
|
json(res, r.status, r.status === 200 ? { answered: true } : { error: r.error ?? "Refused", ...(r.status === 409 ? { gone: true } : {}) });
|
|
3944
3998
|
})().catch(err => {
|