@songsid/agend 2.4.0-beta.2 → 2.4.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-cli.js +1 -1
- package/dist/agent-endpoint.d.ts +1 -1
- package/dist/agent-endpoint.js +8 -2
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-token-header.d.ts +1 -1
- package/dist/agent-token-header.js +1 -1
- package/dist/auth-api.d.ts +3 -0
- package/dist/auth-api.js +15 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/agy-model-switch.d.ts +22 -0
- package/dist/backend/agy-model-switch.js +62 -0
- package/dist/backend/agy-model-switch.js.map +1 -0
- package/dist/backend/antigravity.js +60 -3
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/cli-runtime-switch.d.ts +71 -0
- package/dist/backend/cli-runtime-switch.js +176 -0
- package/dist/backend/cli-runtime-switch.js.map +1 -0
- package/dist/backend/codex-model-switch.d.ts +41 -0
- package/dist/backend/codex-model-switch.js +170 -0
- package/dist/backend/codex-model-switch.js.map +1 -0
- package/dist/backend/credential-profile.js +1 -1
- package/dist/backend/credential-profile.js.map +1 -1
- package/dist/backend/grok-model-switch.d.ts +16 -0
- package/dist/backend/grok-model-switch.js +45 -0
- package/dist/backend/grok-model-switch.js.map +1 -0
- package/dist/backend/grok.js +1 -1
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/muse.d.ts +2 -0
- package/dist/backend/muse.js +7 -3
- package/dist/backend/muse.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-server.js +10 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +8 -0
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/classic-channel-manager.d.ts +1 -1
- package/dist/classic-channel-manager.js +1 -1
- package/dist/cli-audited.js +12 -12
- package/dist/cli-audited.js.map +1 -1
- package/dist/daemon.d.ts +48 -2
- package/dist/daemon.js +302 -21
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-consumed-watch.js +3 -0
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/event-log.d.ts +1 -1
- package/dist/event-log.js +1 -1
- package/dist/fleet-manager.d.ts +104 -2
- package/dist/fleet-manager.js +665 -27
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +10 -0
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +2 -0
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +18 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +154 -0
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +4 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +17 -3
- package/dist/hub/admin-dashboard.d.ts +85 -0
- package/dist/hub/admin-dashboard.js +161 -0
- package/dist/hub/admin-dashboard.js.map +1 -0
- package/dist/hub/attachments/store.d.ts +2 -0
- package/dist/hub/attachments/store.js +6 -0
- package/dist/hub/attachments/store.js.map +1 -1
- package/dist/hub/client.d.ts +10 -0
- package/dist/hub/client.js +72 -10
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +20 -0
- package/dist/hub/compose/member.js +212 -17
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +8 -0
- package/dist/hub/compose/server.js +13 -2
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/display-name.d.ts +10 -0
- package/dist/hub/display-name.js +35 -0
- package/dist/hub/display-name.js.map +1 -0
- package/dist/hub/execution/service.d.ts +1 -0
- package/dist/hub/execution/service.js +1 -1
- package/dist/hub/execution/service.js.map +1 -1
- package/dist/hub/fleet-info.d.ts +12 -0
- package/dist/hub/fleet-info.js +14 -0
- package/dist/hub/fleet-info.js.map +1 -0
- package/dist/hub/fleet-update-model.d.ts +100 -0
- package/dist/hub/fleet-update-model.js +15 -0
- package/dist/hub/fleet-update-model.js.map +1 -0
- package/dist/hub/fleet-updates.d.ts +46 -0
- package/dist/hub/fleet-updates.js +282 -0
- package/dist/hub/fleet-updates.js.map +1 -0
- package/dist/hub/fleet-versions.d.ts +28 -0
- package/dist/hub/fleet-versions.js +80 -0
- package/dist/hub/fleet-versions.js.map +1 -0
- package/dist/hub/http/compose.d.ts +2 -0
- package/dist/hub/http/compose.js +192 -16
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +1 -0
- package/dist/hub/http/schema.js +13 -1
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/member/display-name.d.ts +9 -0
- package/dist/hub/member/display-name.js +71 -0
- package/dist/hub/member/display-name.js.map +1 -0
- package/dist/hub/member/exposure-api.d.ts +4 -0
- package/dist/hub/member/exposure-api.js +8 -3
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/exposures.d.ts +4 -0
- package/dist/hub/member/exposures.js +20 -0
- package/dist/hub/member/exposures.js.map +1 -1
- package/dist/hub/member/pairing-api.js +3 -2
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/member/recommendations.d.ts +37 -0
- package/dist/hub/member/recommendations.js +129 -0
- package/dist/hub/member/recommendations.js.map +1 -0
- package/dist/hub/member/room-ask.d.ts +60 -1
- package/dist/hub/member/room-ask.js +254 -24
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-post-answers.d.ts +52 -0
- package/dist/hub/member/room-post-answers.js +152 -0
- package/dist/hub/member/room-post-answers.js.map +1 -0
- package/dist/hub/member/room-post-receipt.d.ts +21 -0
- package/dist/hub/member/room-post-receipt.js +49 -0
- package/dist/hub/member/room-post-receipt.js.map +1 -0
- package/dist/hub/member/room-post.d.ts +100 -0
- package/dist/hub/member/room-post.js +223 -0
- package/dist/hub/member/room-post.js.map +1 -0
- package/dist/hub/member/updates.d.ts +92 -0
- package/dist/hub/member/updates.js +316 -0
- package/dist/hub/member/updates.js.map +1 -0
- package/dist/hub/protocol.d.ts +658 -1
- package/dist/hub/protocol.js +90 -13
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/published-version.d.ts +3 -0
- package/dist/hub/published-version.js +35 -0
- package/dist/hub/published-version.js.map +1 -0
- package/dist/hub/recommendation-model.d.ts +36 -0
- package/dist/hub/recommendation-model.js +9 -0
- package/dist/hub/recommendation-model.js.map +1 -0
- package/dist/hub/recommendations.d.ts +58 -0
- package/dist/hub/recommendations.js +211 -0
- package/dist/hub/recommendations.js.map +1 -0
- package/dist/hub/representative.d.ts +3 -0
- package/dist/hub/representative.js +2 -1
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/room-context-model.d.ts +43 -0
- package/dist/hub/room-context-model.js +12 -0
- package/dist/hub/room-context-model.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +41 -9
- package/dist/hub/rooms/agents.js +183 -21
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/assistant.d.ts +1 -6
- package/dist/hub/rooms/assistant.js +7 -2
- package/dist/hub/rooms/assistant.js.map +1 -1
- package/dist/hub/rooms/automation.d.ts +24 -0
- package/dist/hub/rooms/automation.js +66 -0
- package/dist/hub/rooms/automation.js.map +1 -0
- package/dist/hub/rooms/buttons.d.ts +85 -0
- package/dist/hub/rooms/buttons.js +62 -0
- package/dist/hub/rooms/buttons.js.map +1 -0
- package/dist/hub/rooms/context-cursor.d.ts +18 -0
- package/dist/hub/rooms/context-cursor.js +61 -0
- package/dist/hub/rooms/context-cursor.js.map +1 -0
- package/dist/hub/rooms/context.d.ts +1 -1
- package/dist/hub/rooms/context.js +4 -4
- package/dist/hub/rooms/context.js.map +1 -1
- package/dist/hub/rooms/mentions.d.ts +15 -0
- package/dist/hub/rooms/mentions.js +43 -0
- package/dist/hub/rooms/mentions.js.map +1 -0
- package/dist/hub/rooms/post-replies.d.ts +23 -0
- package/dist/hub/rooms/post-replies.js +114 -0
- package/dist/hub/rooms/post-replies.js.map +1 -0
- package/dist/hub/rooms/schema.d.ts +9 -0
- package/dist/hub/rooms/schema.js +43 -0
- package/dist/hub/rooms/schema.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +136 -1
- package/dist/hub/rooms/service.js +727 -18
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +27 -3
- package/dist/hub/rooms.js +1 -1
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/runtime.js +12 -0
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.d.ts +6 -1
- package/dist/hub/server.js +75 -5
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/settings-directory-proof.js +22 -1
- package/dist/hub/settings-directory-proof.js.map +1 -1
- package/dist/hub/types.d.ts +133 -2
- package/dist/hub-contact-windows.d.ts +11 -0
- package/dist/hub-contact-windows.js +56 -0
- package/dist/hub-contact-windows.js.map +1 -0
- package/dist/hub-pairing-summary.d.ts +1 -1
- package/dist/hub-room-conversation.d.ts +14 -0
- package/dist/hub-room-conversation.js +60 -0
- package/dist/hub-room-conversation.js.map +1 -0
- package/dist/hub-update-notice.d.ts +12 -0
- package/dist/hub-update-notice.js +35 -0
- package/dist/hub-update-notice.js.map +1 -0
- package/dist/locale.js +58 -2
- package/dist/locale.js.map +1 -1
- package/dist/native-mcp.js +9 -6
- package/dist/native-mcp.js.map +1 -1
- package/dist/outbound-handlers.d.ts +14 -4
- package/dist/outbound-handlers.js +54 -1
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +12 -0
- package/dist/outbound-schemas.js +12 -0
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-port.d.ts +2 -0
- package/dist/queued-handoffs.d.ts +16 -4
- package/dist/queued-handoffs.js +18 -1
- package/dist/queued-handoffs.js.map +1 -1
- package/dist/runtime-cli-install.js +13 -10
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/settings-api.d.ts +1 -0
- package/dist/settings-api.js +87 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/tmux-manager.d.ts +2 -0
- package/dist/tmux-manager.js +2 -0
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tool-permissions.js +3 -0
- package/dist/tool-permissions.js.map +1 -1
- package/dist/ui/chat-msg-actions.js +3 -222
- package/dist/ui/hub-admin-overview.js +189 -0
- package/dist/ui/hub-client.js +36 -4
- package/dist/ui/hub-fleet-versions.js +393 -0
- package/dist/ui/hub-room-agent-strings.js +28 -0
- package/dist/ui/hub-room-composer.js +16 -8
- package/dist/ui/hub-room-members-strings.js +2 -2
- package/dist/ui/hub-room-members.js +3 -2
- package/dist/ui/hub-room-notify.js +161 -0
- package/dist/ui/hub-room-search.js +126 -0
- package/dist/ui/hub-room-strings.js +47 -1
- package/dist/ui/hub-room-thread.js +243 -35
- package/dist/ui/hub-room-unread.js +2 -1
- package/dist/ui/hub-strings.js +8 -0
- package/dist/ui/image-annotate.js +2 -283
- package/dist/ui/image-lightbox.js +2 -176
- package/dist/ui/image-zoom.js +2 -242
- package/dist/ui/notice-hub-update.js +94 -0
- package/dist/ui/panel-chat.js +121 -12
- package/dist/ui/panel-hub.js +133 -19
- package/dist/ui/panel-notices.js +3 -1
- package/dist/ui/panel-settings.js +1 -1
- package/dist/ui/settings-hub-updates.js +67 -0
- package/dist/ui/settings-hub.js +28 -3
- package/dist/ui/settings-registry.js +1 -0
- package/dist/ui/settings-update.js +11 -5
- package/dist/ui/settings-web-authority.js +1 -1
- package/dist/ui/shared/app-i18n.js +2 -0
- package/dist/ui/shared/app-nav.js +6 -2
- package/dist/ui/shared/app-prefs.js +2 -1
- package/dist/ui/shared/app-shell.js +29 -4
- package/dist/ui/shared/app-update.js +90 -8
- package/dist/ui/shared/app.css +33 -0
- package/dist/ui/shared/chat-composer.js +6 -3
- package/dist/ui/shared/chat-msg-actions.js +225 -0
- package/dist/ui/shared/chat-thread.js +70 -5
- package/dist/ui/shared/chat-work-bar.css +48 -0
- package/dist/ui/shared/hub-chat.css +16 -2
- package/dist/ui/shared/hub-owner.css +104 -0
- package/dist/ui/shared/hub-rooms-u2.css +16 -0
- package/dist/ui/shared/hub.css +5 -0
- package/dist/ui/shared/image-annotate.js +306 -0
- package/dist/ui/shared/image-lightbox.js +183 -0
- package/dist/ui/shared/image-zoom.js +242 -0
- package/dist/ui/shared/instance-nav.js +36 -7
- package/dist/ui/shared/model-picker.css +4 -3
- package/dist/ui/shared/view-strings.js +8 -0
- package/dist/ui/shared/web-authorize.js +2 -2
- package/dist/update-dispatch.d.ts +8 -1
- package/dist/update-dispatch.js +16 -1
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-idle.d.ts +65 -0
- package/dist/update-idle.js +190 -0
- package/dist/update-idle.js.map +1 -0
- package/dist/update-launch.d.ts +1 -1
- package/dist/update-launch.js +9 -2
- package/dist/update-launch.js.map +1 -1
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +1 -1
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/profile-timeline.d.ts +2 -0
- package/dist/usage/profile-timeline.js +4 -0
- package/dist/usage/profile-timeline.js.map +1 -1
- package/dist/usage/providers.js +4 -4
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/quota-history.d.ts +1 -1
- package/dist/view-api.js +1 -1
- package/dist/view-api.js.map +1 -1
- package/dist/web-api.js +19 -2
- package/dist/web-api.js.map +1 -1
- package/dist/web-notices.d.ts +3 -0
- package/dist/web-notices.js +17 -2
- package/dist/web-notices.js.map +1 -1
- package/dist/web-prefs.js +1 -0
- package/dist/web-prefs.js.map +1 -1
- package/dist/web-update.d.ts +15 -1
- package/package.json +1 -1
package/dist/ui/panel-hub.js
CHANGED
|
@@ -27,6 +27,8 @@ import { Menu } from "/assets/ui-menu.js";
|
|
|
27
27
|
import { toast } from "/assets/ui-toast.js";
|
|
28
28
|
// #3226 B: the chat is the fleet chat's own drawing (PR A's shared modules), in the fleet chat's words.
|
|
29
29
|
import { createThread, msgKey } from "/assets/chat-thread.js";
|
|
30
|
+
import { installMessageActions } from "/assets/chat-msg-actions.js";
|
|
31
|
+
import { OlderFleetBanner, FleetVersionCells, FleetVersionsSummary, RecommendedVersionCard, FleetUpdateCell, UpdateAllowedButton, hasVersions, hasUpdates, behind } from "./hub-fleet-versions.js";
|
|
30
32
|
import { PreviewPanel, closePanel, panelStore } from "/assets/preview-panel.js";
|
|
31
33
|
import { ComposerInput, WorkBarView, touchScreen } from "/assets/chat-composer.js";
|
|
32
34
|
import { RailFrame } from "/assets/side-rail.js";
|
|
@@ -38,6 +40,8 @@ import { HubRoomRows, readRoomList } from "./hub-room-list.js";
|
|
|
38
40
|
import * as roomFavorites from "./hub-room-favorites.js";
|
|
39
41
|
const { useRoomStar } = roomFavorites;
|
|
40
42
|
import { HubRoomPage } from "./hub-room-thread.js";
|
|
43
|
+
import { TextSizeButton } from "/assets/header-tools.js";
|
|
44
|
+
import { HubNotifyToggle, clearHubMeId, noteHubMeId, rememberedMeId, startHubRoomNotifier } from "./hub-room-notify.js";
|
|
41
45
|
import { hroom } from "./hub-room-strings.js";
|
|
42
46
|
import { hr } from "./hub-read-strings.js";
|
|
43
47
|
import { ht } from "./hub-teams-strings.js";
|
|
@@ -54,6 +58,12 @@ register("hubAccess", {
|
|
|
54
58
|
});
|
|
55
59
|
const ha = key => t(`hubAccess.${key}`);
|
|
56
60
|
// Kept with the fresh renderer: retained owner dictionaries do not know this label.
|
|
61
|
+
// M-3162: Administration's tabs (Lumen's names: "Manage" holds today's long page; "This Hub" its name already).
|
|
62
|
+
register("hubAdminTabs", {
|
|
63
|
+
en: { label: "Administration", overview: "Overview", manage: "Manage", teams: "Teams", groups: "Groups", thisHub: "This Hub" },
|
|
64
|
+
"zh-TW": { label: "管理", overview: "總覽", manage: "管理項目", teams: "團隊", groups: "群組", thisHub: "這個 Hub" },
|
|
65
|
+
});
|
|
66
|
+
const hat = (key) => t(`hubAdminTabs.${key}`);
|
|
57
67
|
register("hubGrantStatus", {
|
|
58
68
|
en: { grantNeverSignedIn: "Hasn't signed in to Hub yet", grantADGroup: "AD group", grantTeam: "Team", grantSubjects: "People, groups and teams allowed: {0}" },
|
|
59
69
|
"zh-TW": { grantNeverSignedIn: "還沒登入過 Hub", grantADGroup: "AD 群組", grantTeam: "團隊", grantSubjects: "已允許的個人、群組與團隊:{0}" },
|
|
@@ -102,6 +112,9 @@ let session; // undefined: not read yet; nul
|
|
|
102
112
|
const sessionSubs = new Set();
|
|
103
113
|
function setSession(next) {
|
|
104
114
|
const was = session;
|
|
115
|
+
// The notifier's remembered person id belongs to the signed-in login: a sign-out, or in as someone else on the
|
|
116
|
+
// same tab, forgets it (the next login's id is learned again from a room detail or the lazy resolve).
|
|
117
|
+
if (!next || !was || was.login !== next.login) clearHubMeId();
|
|
105
118
|
session = next;
|
|
106
119
|
roomFavorites.configureHubFavorites?.(hubClient(), next);
|
|
107
120
|
// #3226 B: the conversation list is this person's: cleared when no one is signed in, read again when someone is.
|
|
@@ -142,6 +155,25 @@ export function HubPanel({ route }) {
|
|
|
142
155
|
const view = viewParam();
|
|
143
156
|
// The owner stylesheet holds the page column (.hub-owner, 860 px) every page with a column uses — Notices too (Argon #12).
|
|
144
157
|
useEffect(() => { linkHubCss(); linkHubOwnerCss(); if (tab === "ask") linkHubChatCss(); }, [tab]);
|
|
158
|
+
// Rooms desktop notifications (§12): one page-level watcher over every room this person may see. Member ids
|
|
159
|
+
// are per room, so the id is kept per room: from a room detail once read, or lazily by reading that room
|
|
160
|
+
// itself on its first live event while opted in.
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (!s || !s.login) return undefined;
|
|
163
|
+
const stop = startHubRoomNotifier({
|
|
164
|
+
client: hubClient(), me: (rid) => { const id = rememberedMeId(rid); return id ? { id } : null; },
|
|
165
|
+
setMe: (rid, m) => noteHubMeId(rid, m && m.id),
|
|
166
|
+
resolveMe: async (rid) => {
|
|
167
|
+
if (typeof hubClient().room !== "function") return null;
|
|
168
|
+
const d = await hubClient().room(rid).catch(() => null);
|
|
169
|
+
return d && d.ok && d.me && d.me.id ? { id: d.me.id } : null;
|
|
170
|
+
},
|
|
171
|
+
roomName: (id) => { const r = (roomsStore.get().rooms || []).find((x) => x.id === id); return (r && r.name) || ""; },
|
|
172
|
+
roomKind: (id) => { const r = (roomsStore.get().rooms || []).find((x) => x.id === id); return (r && r.kind) || ""; },
|
|
173
|
+
open: (rid) => navigate(roomPath(rid)),
|
|
174
|
+
});
|
|
175
|
+
return stop;
|
|
176
|
+
}, [s && s.login]);
|
|
145
177
|
// Join takes precedence over other query views. Rooms and Group permissions otherwise name their own pages.
|
|
146
178
|
const pageName = companyPage ? hj("title") : tab === "exposures" ? hc("mine") : tab === "admin" ? view === "teams" ? ht("title") : hc("admin") : view === "notices" ? hc("noticesTitle")
|
|
147
179
|
: view === "invitations" ? hroom("invitationsTitle") : view === "teams" ? ht("mine") : hc("chats");
|
|
@@ -157,7 +189,7 @@ export function HubPanel({ route }) {
|
|
|
157
189
|
<${PanelHeader} title=${hj("title")} /><div data-trust="panel-content" class="panel-body hub-page-body"><${HubCompanyJoinPage} session=${s} /></div></div>`;
|
|
158
190
|
// Security notices stay on their own page. The bound join branch above never renders the chat or notices page.
|
|
159
191
|
if (s && tab === "ask" && view === "notices" && noticesOffered(s)) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-notices">
|
|
160
|
-
<${PanelHeader} title=${hc("noticesTitle")}
|
|
192
|
+
<${PanelHeader} title=${hc("noticesTitle")}><span class="hub-head-tools"><${HubNotifyToggle} /></span></${PanelHeader}><div data-trust="panel-content" class="panel-body hub-page-body">
|
|
161
193
|
<div class="col hub-owner hub-notices-col"><p class="s-page-lead hub-page-lead">${directoryNoticesOffered(s, hubClient()) ? dn("pageLead") : hc("noticesLead")}</p>
|
|
162
194
|
${pairingNoticesOffered(s) ? html`<${PairingNotices} admin=${!!s.admin} empty=${directoryNoticesOffered(s, hubClient()) ? null : html`<${Empty} icon="bell" title=${hc("noNotices")} />`} />` : null}
|
|
163
195
|
${directoryNoticesOffered(s, hubClient()) ? html`<${DirectoryNotices} client=${hubClient()} />` : null}</div></div></div>`;
|
|
@@ -378,9 +410,11 @@ export function HubSide({ onPick } = {}) {
|
|
|
378
410
|
const [q, setQ] = useState("");
|
|
379
411
|
const [filtering, setFiltering] = useState(false);
|
|
380
412
|
const [picking, setPicking] = useState(false), [newRoom, setNewRoom] = useState(false);
|
|
413
|
+
// M-3127 C: on a Hub with rooms, Ctrl K is the search dialog (names, then messages); before rooms, the list's filter.
|
|
414
|
+
const [searching, setSearching] = useState(false);
|
|
381
415
|
const filter = useRef(null);
|
|
382
416
|
useEffect(() => { linkHubChatCss(); }, []);
|
|
383
|
-
const openFilter = () => { setFiltering(true); setTimeout(() => filter.current?.focus(), 0); };
|
|
417
|
+
const openFilter = () => { if (roomsLive()) { setSearching(true); return; } setFiltering(true); setTimeout(() => filter.current?.focus(), 0); };
|
|
384
418
|
// Ctrl K (⌘K): the conversation filter — the dashboard's search shortcut, on the Hub's own search (no fleet search here).
|
|
385
419
|
useEffect(() => {
|
|
386
420
|
const onKey = (e) => {
|
|
@@ -412,9 +446,12 @@ export function HubSide({ onPick } = {}) {
|
|
|
412
446
|
aria-keyshortcuts=${isMacLike() ? "Meta+K" : "Control+K"}><${Icon} name="search" /><span class="grow">${hc("navSearch")}</span><kbd class="kbd-hint" aria-hidden="true">${searchShortcut()}</kbd></button>
|
|
413
447
|
<button type="button" class="side-row side-new" onClick=${() => setPicking(true)}><${Icon} name="plus" /><span class="grow">${hc("newChat")}</span></button>
|
|
414
448
|
${roomsLive() && rs.me?.canCreateRooms ? html`<button type="button" class="side-row side-new hub-new-room" onClick=${() => setNewRoom(true)}><${Icon} name="room" /><span class="grow">${hroom("newRoomTitle")}</span></button>` : null}
|
|
449
|
+
${searching ? html`<${LazyRoomPart} load=${() => import("./hub-room-search.js")} name="RoomSearch" props=${{ client: hubClient(), rooms: rs.rooms || [], onClose: () => setSearching(false),
|
|
450
|
+
openRoom: (r) => { if (onPick) onPick(); navigate(roomPath(r.id)); },
|
|
451
|
+
openHit: (h) => { if (onPick) onPick(); navigate(`${roomPath(h.roomId)}&m=${encodeURIComponent(h.messageId)}`); } }} />` : null}
|
|
415
452
|
</nav>
|
|
416
453
|
|
|
417
|
-
<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} onPick=${onPick} quietEmpty=${home} />
|
|
454
|
+
<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} onPick=${onPick} quietEmpty=${home} foot=${roomsLive()} />
|
|
418
455
|
${picking ? html`<${NewChatDialog} onClose=${() => setPicking(false)} />` : null}
|
|
419
456
|
${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant,
|
|
420
457
|
onClose: () => setNewRoom(false), onOpenRoom: (id) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(id)); } }} />` : null}`;
|
|
@@ -425,7 +462,7 @@ export function HubSide({ onPick } = {}) {
|
|
|
425
462
|
* count, one-line empty states) — the sidebar's (HubSide) and, on a phone, the chats' home page's (with its own New chat
|
|
426
463
|
* row and the filter always shown): one drawing, not two (Argon #9). `quietEmpty`: the page beside it already says "No chats yet".
|
|
427
464
|
*/
|
|
428
|
-
function HubRoomList({ rs, q, setQ, filtering, setFiltering, filterRef, onPick, quietEmpty = false, onNew = null, onNewRoom = null }) {
|
|
465
|
+
function HubRoomList({ rs, q, setQ, filtering, setFiltering, filterRef, onPick, quietEmpty = false, onNew = null, onNewRoom = null, foot = false }) {
|
|
429
466
|
const current = roomParam();
|
|
430
467
|
const star = useRoomStar(rs.rooms, useSession()?.login); // S-145: favourites, as the Fleet sidebar's
|
|
431
468
|
const go = (e, href) => { if (onPick) onPick(); if (e && (e.metaKey || e.ctrlKey)) return; e && e.preventDefault(); navigate(href); };
|
|
@@ -436,14 +473,24 @@ function HubRoomList({ rs, q, setQ, filtering, setFiltering, filterRef, onPick,
|
|
|
436
473
|
${/* Lumen (spec §2): on the phone's list too, beside New chat — not only in the drawer. */ ""}
|
|
437
474
|
${onNewRoom ? html`<button type="button" class="side-row side-new hub-new-room" onClick=${onNewRoom}><${Icon} name="room" /><span class="grow">${hroom("newRoomTitle")}</span></button>` : null}
|
|
438
475
|
${!rs.rooms.length ? html`<div class="inst-head"><h2 class="side-label">${hc("chats")}</h2></div>` : null}
|
|
439
|
-
${
|
|
476
|
+
${/* M-3127 C (web-claude): on a Hub with rooms the sidebar's filter is the Fleet's, at its foot, always there (below). */ ""}
|
|
477
|
+
${!foot && (filtering || q || (always && rs.rooms.length)) ? html`<label class="hub-side-filter"><${Icon} name="search" size=${14} /><input ref=${filterRef} type="search" placeholder=${hc("search")} aria-label=${hc("search")} value=${q}
|
|
440
478
|
onInput=${(e) => setQ(e.target.value)} onKeyDown=${(e) => { if (e.key === "Escape") { setQ(""); setFiltering(false); } }} /></label>` : null}
|
|
441
479
|
${rs.error ? html`<${ErrorState} message=${rs.error} onRetry=${refreshRooms} />` : null}
|
|
442
480
|
${!rs.loaded ? html`<${Skeleton} variant="rows" lines=${4} />` : null}
|
|
443
481
|
${rs.loaded && !rs.error && !rs.denied && !rs.rooms.length && !quietEmpty ? html`<p class="side-empty muted">${hc("noChats")}</p>` : null}
|
|
444
482
|
${rs.rooms.length && !shown.length ? html`<p class="side-empty muted">${hc("noMatch")}</p>` : null}
|
|
445
483
|
<${HubRoomRows} rooms=${rs.rooms} q=${q} current=${current} href=${(r) => roomPath(r.id)} onGo=${(e, r) => go(e, roomPath(r.id))} star=${star} />
|
|
446
|
-
</div
|
|
484
|
+
</div>
|
|
485
|
+
${/* The Fleet sidebar's filter box (instance-nav.js .v-filter): a name or an owner; Esc or ✕ clears it. Ctrl K is the search. */ ""}
|
|
486
|
+
${foot && rs.rooms.length ? html`<div class="v-filter hub-side-foot-filter">
|
|
487
|
+
<label class="v-filter-box"><${Icon} name="search" size=${14} /><span class="sr-only">${hroom("filterPh")}</span>
|
|
488
|
+
<input ref=${filterRef} type="text" autocomplete="off" spellcheck=${false} placeholder=${hroom("filterPh")} value=${q}
|
|
489
|
+
onInput=${(e) => setQ(e.target.value)} onKeyDown=${(e) => { if (e.key === "Escape" && q) { e.preventDefault(); e.stopPropagation(); setQ(""); } }} />
|
|
490
|
+
${q ? html`<button type="button" class="icon-btn v-filter-clear" aria-label=${hroom("filterClear")} title=${hroom("filterClear")}
|
|
491
|
+
onClick=${() => { setQ(""); filterRef.current && filterRef.current.focus(); }}><${Icon} name="close" size=${14} /></button>` : null}
|
|
492
|
+
</label></div>` : null}
|
|
493
|
+
</div>`;
|
|
447
494
|
}
|
|
448
495
|
|
|
449
496
|
/** The phone's chats home: the same roster, with New chat at its head and the filter in place. */
|
|
@@ -530,10 +577,12 @@ function HubChats() {
|
|
|
530
577
|
// A room of a Hub with rooms: the shared thread with the room's store, composer and members panel (hub-room-thread.js).
|
|
531
578
|
if (id && listed && !listed.legacy) return html`<${HubRoomPage} key=${id} roomId=${id} listed=${listed} Thread=${HubThread} client=${hubClient()}
|
|
532
579
|
rooms=${rs.rooms} openRoom=${(rid) => navigate(roomPath(rid))} goList=${() => navigate("/ui/hub")}
|
|
533
|
-
onLeft=${() => { void refreshRooms(); navigate("/ui/hub"); }} />`;
|
|
580
|
+
onLeft=${() => { void refreshRooms(); navigate("/ui/hub"); }} onMe=${noteHubMeId} />`;
|
|
534
581
|
if (id && room) return html`<${HubRoomView} key=${id} room=${room} />`;
|
|
535
582
|
if (id) return html`<${HubRoomLoading} error=${rs.error} />`;
|
|
536
583
|
return html`<${PanelHeader} title=${hc("chats")} />
|
|
584
|
+
${/* M-3137 (versions spec §2.3): the signed-in person whose own Fleet is behind is told here, once per sign-in. */ ""}
|
|
585
|
+
<${OlderFleetBanner} client=${hubClient()} signIn=${s?.csrf || ""} />
|
|
537
586
|
<div class=${`hub-home${groupPolicyOn(s, hubClient()) ? " has-welcome" : ""}`}>
|
|
538
587
|
<div class="hub-home-list"><${HubHomeList} /></div>
|
|
539
588
|
${groupPolicyOn(s, hubClient()) ? html`<div class="hub-home-pick hub-home-welcome"><${LazyGroups} pick=${(m) => m.HubWelcome} props=${{ name: s.displayName, quick: s.features.includes("quick-pairing-v1"), onChats: () => setPicking(true), admin: s.admin === true, features: s.features }} /></div>`
|
|
@@ -683,6 +732,7 @@ function HubRoomView({ room: given }) {
|
|
|
683
732
|
<span class="hub-chat-title"><strong>${name}</strong><span class="s">${room.ownerName ? hc("answersFor", room.ownerName) : ""}</span></span>
|
|
684
733
|
${tag}
|
|
685
734
|
<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>
|
|
735
|
+
<span class="hub-head-tools"><${TextSizeButton} /></span>
|
|
686
736
|
</header>
|
|
687
737
|
<${HubThread} store=${store} name=${name} panelKey=${panelKey} threadRef=${threadRef} />
|
|
688
738
|
<div class="dock hub-dock" data-trust="composer"><div class="dock-col">
|
|
@@ -747,16 +797,39 @@ function HubThread({ store, name, panelKey, threadRef, extra = null, emptyView =
|
|
|
747
797
|
host.current.append(list);
|
|
748
798
|
thread.attach(scroller.current);
|
|
749
799
|
thread.render(store.messages());
|
|
750
|
-
const
|
|
800
|
+
const sc = scroller.current;
|
|
801
|
+
// The next `before=` page when the reader is at the top, or when the held messages do not fill the view. createThread
|
|
802
|
+
// already grows through what is held; a tall room at the bottom must not fetch the whole history on open.
|
|
803
|
+
let paging = true;
|
|
804
|
+
const maybeOlder = () => {
|
|
805
|
+
if (!paging || !sc || typeof store.older !== "function" || !store.more?.()) return;
|
|
806
|
+
const high = sc.scrollHeight, view = sc.clientHeight;
|
|
807
|
+
if (high > view && sc.scrollTop >= 96) return;
|
|
808
|
+
void store.older();
|
|
809
|
+
};
|
|
810
|
+
const off = store.subscribe(() => { thread.render(store.messages()); maybeOlder(); });
|
|
811
|
+
requestAnimationFrame(() => requestAnimationFrame(maybeOlder));
|
|
751
812
|
// A card shows whether this browser allows previews and whether the panel has its page.
|
|
752
813
|
const P = globalThis.AgendPreview;
|
|
753
814
|
const offOpt = P && typeof P.onChange === "function" ? P.onChange(() => thread.refreshCards()) : () => {};
|
|
754
815
|
const offPanel = panelStore.subscribe(() => thread.refreshCards());
|
|
755
|
-
const
|
|
756
|
-
const onScroll = () => thread.onScroll();
|
|
816
|
+
const onScroll = () => { thread.onScroll(); maybeOlder(); };
|
|
757
817
|
sc.addEventListener("scroll", onScroll, { passive: true });
|
|
758
818
|
list.addEventListener("click", thread.onClick);
|
|
819
|
+
// S-152 (M-3117): the Fleet chat's message menu — right-click, a phone's long press (where the hover strip is hidden),
|
|
820
|
+
// swipe left to reply, R on a focused message. Reply where this page may reply (a room), Copy text everywhere; no Copy
|
|
821
|
+
// link (a Hub message has no address). React (the picker) when the page gives extra.react (M-3127).
|
|
822
|
+
const ex = extra || {};
|
|
823
|
+
const offActions = installMessageActions(list, {
|
|
824
|
+
t: threadT, messageOf: thread.messageOf, rove: thread.rove, copyText, notice: (text, ok = true) => toast(text, ok),
|
|
825
|
+
canReply: () => (typeof ex.canReply === "function" ? ex.canReply() !== false : false) && typeof ex.startReply === "function",
|
|
826
|
+
reply: (x) => ex.startReply?.(x),
|
|
827
|
+
// React opens the thread's picker for that message (extra.react is the thread's own add/remove call, with an emoji).
|
|
828
|
+
...(typeof ex.react === "function" ? { react: (x) => thread.pickReaction?.(msgKey(x)), canReact: (x) => !!x.roomMessage && ex.canReact?.(x) !== false, reactLabel: ex.reactLabel } : {}),
|
|
829
|
+
});
|
|
759
830
|
return () => {
|
|
831
|
+
offActions();
|
|
832
|
+
paging = false;
|
|
760
833
|
off(); offOpt(); offPanel(); sc.removeEventListener("scroll", onScroll); list.removeEventListener("click", thread.onClick);
|
|
761
834
|
thread.dispose(true); list.remove(); th.current = null; if (threadRef && threadRef.current === thread) threadRef.current = null;
|
|
762
835
|
};
|
|
@@ -846,7 +919,7 @@ function HubMine() {
|
|
|
846
919
|
// lands nowhere (useRead's own liveness ends with that page).
|
|
847
920
|
if (x) return html`<${HubAgentPage} key=${x.id} x=${x} act=${act} msg=${msg} />`;
|
|
848
921
|
// Nothing shared yet: the empty state below says where to share from, so the lead doesn't say it too (Argon #20).
|
|
849
|
-
return html`<div class="col hub-owner"
|
|
922
|
+
return html`<div class="col hub-owner"><${OlderFleetBanner} client=${hubClient()} signIn=${session?.csrf || ""} /><p class="s-page-lead hub-page-lead">${ho(cat && !cat.error && !mine.length ? "mineLeadShort" : "mineLead")}</p>
|
|
850
923
|
<div class="s-section-layout">
|
|
851
924
|
${roomsLive() ? html`<${LazyRoomPart} load=${() => import("./hub-invitations.js")} name="InvitationsList" props=${{ client: hubClient(), heading: true }} />` : null}
|
|
852
925
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
@@ -966,18 +1039,46 @@ function LegacyAllowDialog({ x, act, onClose }) {
|
|
|
966
1039
|
}
|
|
967
1040
|
|
|
968
1041
|
// ── Administration ──
|
|
1042
|
+
/**
|
|
1043
|
+
* M-3162 (Lumen): Administration's tabs — Overview (the counts dashboard, the default where this Hub serves it), Manage
|
|
1044
|
+
* (today's long page, unchanged), Teams, Groups and This Hub (with its directory page); a tab whose feature is off is not
|
|
1045
|
+
* drawn. The tab is the address's ?view=, so a reload or a shared link lands on it. On a phone the row scrolls sideways.
|
|
1046
|
+
*/
|
|
1047
|
+
const ADMIN_TAB_VIEWS = { overview: "overview", manage: "manage", teams: "teams", groups: "groups", "this-hub": "this-hub", directory: "this-hub" };
|
|
1048
|
+
let pendingAnchor = ""; // M-3162: a card on Manage to bring into view once it is drawn (Overview's links: "join", "fleets")
|
|
1049
|
+
export function takeAdminAnchor() { const a = pendingAnchor; pendingAnchor = ""; return a; }
|
|
1050
|
+
function openAdminTab(view, anchor = "") { pendingAnchor = anchor; navigate(`/ui/hub/admin?view=${view}`); }
|
|
1051
|
+
function AdminTabs({ tabs, current }) {
|
|
1052
|
+
const row = useRef(null);
|
|
1053
|
+
useEffect(() => { row.current?.querySelector?.('[aria-current="page"]')?.scrollIntoView?.({ block: "nearest", inline: "nearest" }); }, [current]);
|
|
1054
|
+
const label = { overview: hat("overview"), manage: hat("manage"), teams: hat("teams"), groups: hat("groups"), "this-hub": hat("thisHub") };
|
|
1055
|
+
return html`<div class="hub-admin-tabs-wrap"><nav class="hub-admin-tabs" aria-label=${hat("label")} ref=${row}>
|
|
1056
|
+
${tabs.map((k) => html`<a key=${k} href=${`/ui/hub/admin?view=${k}`} class=${`hub-admin-tab${k === current ? " active" : ""}`} aria-current=${k === current ? "page" : undefined}
|
|
1057
|
+
onClick=${(e) => { if (e.metaKey || e.ctrlKey || e.shiftKey || e.button) return; e.preventDefault(); openAdminTab(k); }}>${label[k]}</a>`)}
|
|
1058
|
+
</nav></div>`;
|
|
1059
|
+
}
|
|
969
1060
|
function HubAdmin({ admin }) {
|
|
970
1061
|
useStore(navStore); // ?view= changes without a new route
|
|
971
1062
|
const s = useSession();
|
|
1063
|
+
const [overviewGone, setOverviewGone] = useState(false); // the route answered 404: an older Hub after all
|
|
1064
|
+
useEffect(() => { linkHubOwnerCss(); }, []); // the tab row and Overview are styled there too (not only Manage)
|
|
972
1065
|
if (!admin) return html`<div class="center hub-empty"><${Empty} icon="key" title=${hw("adminOnly")} hint=${hw("adminOnlyHint")} /></div>`;
|
|
973
1066
|
const directory = s?.features?.includes("directory-editor-v1") && hubClient()?.directoryEditorV1 === true;
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1067
|
+
const groups = groupPolicyOn(s, hubClient()), teams = teamsLive();
|
|
1068
|
+
const overview = !overviewGone && s?.features?.includes("admin-dashboard-v1") && typeof hubClient()?.adminDashboard === "function";
|
|
1069
|
+
const tabs = [overview ? "overview" : null, "manage", teams ? "teams" : null, groups ? "groups" : null, "this-hub"].filter(Boolean);
|
|
1070
|
+
const view = adminView();
|
|
1071
|
+
const current = view === "" ? tabs[0] : tabs.includes(ADMIN_TAB_VIEWS[view]) ? ADMIN_TAB_VIEWS[view] : "manage";
|
|
1072
|
+
const bar = html`<${AdminTabs} tabs=${tabs} current=${current} />`;
|
|
1073
|
+
if (current === "overview") return html`${bar}<div class="col hub-owner hub-admin-ov-col"><${LazyRoomPart} load=${() => import("./hub-admin-overview.js")} name="HubAdminOverview"
|
|
1074
|
+
props=${{ client: hubClient(), onOpen: openAdminTab, onGone: () => { setOverviewGone(true); openAdminTab("manage"); } }} /></div>`;
|
|
1075
|
+
if (current === "this-hub") return html`${bar}${directory && view === "directory" ? html`<${LazyDirectory} session=${s} />` : html`<div class="col hub-owner"><${LazyThisHub} directory=${directory} /></div>`}`;
|
|
1076
|
+
if (current === "groups") return html`${bar}<${LazyGroups} pick=${(m) => m.HubGroupPolicyPage} props=${{}} />`;
|
|
1077
|
+
if (current === "teams") return html`${bar}<div class="col hub-owner"><h2 class="sr-only">${ht("title")}</h2><${LazyRoomPart} load=${() => import("./hub-teams.js")} name="HubTeamsPage" props=${{ client: hubClient(), mode: "admin", person: s?.person }} /></div>`;
|
|
977
1078
|
// Reached from a fleet's Settings link on a Hub (or a tab) without group permissions: say so instead of a silent admin page.
|
|
978
|
-
const unavailable =
|
|
979
|
-
return html`${unavailable ? html`<p class="note" role="status" data-groups="unavailable">${t("hubGroupsNote.unavailable")}</p>` : null}
|
|
980
|
-
<${HubAdminPage} groups=${
|
|
1079
|
+
const unavailable = view === "groups" && !groups;
|
|
1080
|
+
return html`${bar}${unavailable ? html`<p class="note" role="status" data-groups="unavailable">${t("hubGroupsNote.unavailable")}</p>` : null}
|
|
1081
|
+
<${HubAdminPage} groups=${groups} companyJoin=${s?.features?.includes("company-join-v1")} directory=${directory} />`;
|
|
981
1082
|
}
|
|
982
1083
|
function LazyDirectory({ session }) {
|
|
983
1084
|
const [Page, setPage] = useState(null);
|
|
@@ -1015,6 +1116,8 @@ function GroupPermissionsEntry() {
|
|
|
1015
1116
|
function HubAdminPage({ groups = false, companyJoin = false, directory = false } = {}) {
|
|
1016
1117
|
const assistantSession = useSession();
|
|
1017
1118
|
const [view, reload] = useRead(() => hubClient().adminOverview());
|
|
1119
|
+
const [needsOnly, setNeedsOnly] = useState(false); // M-3137: Connected fleets' "Needs update" filter
|
|
1120
|
+
const [canRecommend, setCanRecommend] = useState(false); // M-3141: this Hub serves the recommended-version setting
|
|
1018
1121
|
const [login, setLogin] = useState("");
|
|
1019
1122
|
const [offer, setOffer] = useState(null);
|
|
1020
1123
|
const [msg, setMsg] = useState(null);
|
|
@@ -1051,6 +1154,9 @@ function HubAdminPage({ groups = false, companyJoin = false, directory = false }
|
|
|
1051
1154
|
<div class="s-section-layout">${view?.error ? html`<${ErrorState} message=${view.error} onRetry=${reload} />`
|
|
1052
1155
|
: html`<section class="card"><h3>${ho("pairSteps")}</h3><${Skeleton} variant="rows" lines=${3} /></section><section class="card"><${Skeleton} variant="rows" lines=${3} /></section>`}</div></div>`;
|
|
1053
1156
|
const fleets = view.fleets || [], pairings = view.pairings || [];
|
|
1157
|
+
const anchorAsked = takeAdminAnchor(); // M-3162: Overview's "See Connected Fleets" / "Let colleagues join"
|
|
1158
|
+
const anchorSel = { fleets: "#hub-admin-fleets", join: '[data-entry="let-colleagues-join"]' }[anchorAsked];
|
|
1159
|
+
if (anchorSel) setTimeout(() => { try { document.querySelector(anchorSel)?.scrollIntoView?.({ block: "start" }); } catch { /* none */ } }, 0);
|
|
1054
1160
|
const accessEntry = companyJoin && companyViews.companyJoinAdminEntryV1 === true && ownerEntryWords.ownerAdminEntryV1 === true;
|
|
1055
1161
|
const ManualFrame = accessEntry ? "details" : "div";
|
|
1056
1162
|
return html`<div class="col hub-owner hub-admin">${lead}
|
|
@@ -1063,16 +1169,24 @@ function HubAdminPage({ groups = false, companyJoin = false, directory = false }
|
|
|
1063
1169
|
${assistantSession?.features?.includes("room-assistant-v1") && hubClient().assistantAdminV1 === true ? html`<${LazyAssistantAdmin} />` : null}
|
|
1064
1170
|
${view.error ? html`<${ErrorState} message=${view.error} onRetry=${reload} />` : null}
|
|
1065
1171
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
1066
|
-
|
|
1172
|
+
${/* M-3141 (versions spec §3.1): the recommended version, a small card above the list. */ ""}
|
|
1173
|
+
${hasVersions(fleets) ? html`<${RecommendedVersionCard} client=${hubClient()} onSaved=${reload} onAvailable=${setCanRecommend} />` : null}
|
|
1174
|
+
<section class="card hub-fleet-list" id="hub-admin-fleets"><h3>${ho("pairedFleets", fleets.filter((f) => f.status !== "revoked").length)}</h3>
|
|
1175
|
+
${/* M-3137 (versions spec §2.2): the summary line and its filter, when this Hub reports versions. */ ""}
|
|
1176
|
+
${hasVersions(fleets) ? html`<${FleetVersionsSummary} fleets=${fleets} recommended=${view.recommendedVersion ?? null} canRecommend=${canRecommend} filtered=${needsOnly} onFilter=${setNeedsOnly} />` : null}
|
|
1177
|
+
${/* M-3145 (§4.2): "Update {n} Fleets that allow it", while at least one qualifies. */ ""}
|
|
1178
|
+
${hasUpdates(fleets) ? html`<${UpdateAllowedButton} fleets=${fleets} recommended=${view.recommendedVersion ?? null} revision=${view.recommendationRevision ?? 0} client=${hubClient()} onChanged=${reload} />` : null}
|
|
1067
1179
|
${fleets.length ? (() => {
|
|
1068
1180
|
// Spec 1.2: the row's title is the Fleet's label (S1 overview), its subtitle the owner; active first, revoked folded.
|
|
1069
1181
|
const row = (f) => html`<div key=${f.id} class="s-row hub-row" data-fleet=${f.id}>
|
|
1070
1182
|
<${Avatar} name=${f.owner ? f.owner.name : "?"} size="sm" />
|
|
1071
1183
|
<span class="hub-row-text"><strong>${typeof f.label === "string" && f.label ? f.label : ho("fleetOf", f.owner ? f.owner.name : "—")}</strong>${f.owner ? html`<small class="note">${f.owner.name}${f.owner.login ? html` · <code>${f.owner.login}</code>` : null}</small>` : null}</span>
|
|
1184
|
+
${hasVersions(fleets) && f.status !== "revoked" ? html`<${FleetVersionCells} fleet=${f} recommended=${view.recommendedVersion ?? null} />` : null}
|
|
1185
|
+
${hasUpdates(fleets) && f.status === "active" ? html`<${FleetUpdateCell} fleet=${f} recommended=${view.recommendedVersion ?? null} revision=${view.recommendationRevision ?? 0} client=${hubClient()} onChanged=${reload} />` : null}
|
|
1072
1186
|
${f.status === "active" ? html`<span class="tag ok">${ho("active")}</span><${Menu} label=${ho("rowMenu", f.label || (f.owner ? f.owner.name : f.id))} items=${[{ key: "revoke", label: ho("revokeItem"), icon: "trash", danger: true, onSelect: () => revoke(f) }]} />`
|
|
1073
1187
|
: html`<span class="tag">${ho("revokedTag")}</span>`}
|
|
1074
1188
|
</div>`;
|
|
1075
|
-
const current = fleets.filter((f) => f.status !== "revoked").sort((a, b) => (a.status === "active" ? 0 : 1) - (b.status === "active" ? 0 : 1));
|
|
1189
|
+
const current = fleets.filter((f) => f.status !== "revoked" && (!needsOnly || behind(f))).sort((a, b) => (a.status === "active" ? 0 : 1) - (b.status === "active" ? 0 : 1));
|
|
1076
1190
|
const revoked = fleets.filter((f) => f.status === "revoked");
|
|
1077
1191
|
return html`${current.length ? html`<div class="hub-rows">${current.map(row)}</div>` : html`<p class="note">${ho("noFleets")}</p>`}
|
|
1078
1192
|
${revoked.length ? html`<details class="s-ui-disclosure hub-fleets-revoked"><summary>${t("hubFleetList.revoked", revoked.length)}</summary><div class="hub-rows">${revoked.map(row)}</div></details>` : null}`;
|
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 { HubUpdateNotice, useHubUpdateActions } from "./notice-hub-update.js";
|
|
13
14
|
|
|
14
15
|
register("notices", {
|
|
15
16
|
en: {
|
|
@@ -77,6 +78,7 @@ export function NoticesPanel({ navKey }) {
|
|
|
77
78
|
useEffect(() => { markShown(); }, [newest]);
|
|
78
79
|
useEffect(() => { if (typeof document !== "undefined") lease.on(document, "visibilitychange", markShown); }, [lease]);
|
|
79
80
|
const known = new Set((instances || []).map((i) => i && i.name));
|
|
81
|
+
const hubActions = useHubUpdateActions();
|
|
80
82
|
const nowMs = Date.now();
|
|
81
83
|
return html`<div data-effect-panel="notices" class="panel p-notices">
|
|
82
84
|
<${PanelHeader} title=${tn("title")} />
|
|
@@ -90,7 +92,7 @@ export function NoticesPanel({ navKey }) {
|
|
|
90
92
|
<div class="n-title"><strong>${tn(`kind_${n.kind}`)}${n.instance ? ` · ${n.instance}` : ""}</strong>
|
|
91
93
|
${n.id > seenAtOpen ? html`<span class="notice-new">${tn("unread")}</span>` : null}
|
|
92
94
|
<span class="n-age" title=${new Date(n.at).toLocaleString()}>${noticeAge(n.at, nowMs)}</span></div>
|
|
93
|
-
|
|
95
|
+
${n.hubUpdate ? html`<${HubUpdateNotice} notice=${n} actions=${hubActions} />` : html`<p class="n-detail notice-text">${n.text}</p>`}
|
|
94
96
|
${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}
|
|
95
97
|
</div>
|
|
96
98
|
</article>`)}
|
|
@@ -676,7 +676,7 @@ export function DeviceSection() {
|
|
|
676
676
|
</section>
|
|
677
677
|
<section class="card s-device s-synced s-pref-content"><div class="s-pref-group-head"><h3>${tn("prefsContentGroup")}</h3><span class="s-scope" title=${publicLink ? tn("syncedPublicLink") : tn("syncedLead")}>${tn("prefsAccountScope")}</span></div>
|
|
678
678
|
${publicLink ? html`<p class="sub">${tn("syncedPublicLink")}</p>` : null}
|
|
679
|
-
<${DevicePrefs} labels=${true} fields=${["language"]} />
|
|
679
|
+
<${DevicePrefs} labels=${true} fields=${["language", "density"]} />
|
|
680
680
|
${P() ? html`<label class="check s-pref-preview"><span>${t("chat.previews")}</span><input id="pref-previews" class="s-ui-toggle" type="checkbox" checked=${on} onChange=${(e) => { const want = e.target.checked; setPreviewOptIn(want).then(setOn); }} /><small>${layoutText("previewsPersonalHint")}</small></label>` : null}
|
|
681
681
|
</section>
|
|
682
682
|
<section class="card s-device s-local s-pref-help"><h3>${tn("prefsHelpGroup")}</h3>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// M-3145 (docs/design/hub-fleet-versions.md §4.1, phase 3): Fleet Settings → Hub, in the Hub connection card under
|
|
2
|
+
// "Shared agents" — the owner's switch that lets this Hub's administrator start an AgEnD update on this computer.
|
|
3
|
+
// Off by default; turning it on asks once; off at any time (that cancels a waiting request — the Fleet's own rule).
|
|
4
|
+
// A Fleet started by hand (not a service) cannot undo a failed update by itself: the switch is shown, disabled, and says
|
|
5
|
+
// why. Only on the Fleet's own dashboard (not over the public link), like the rest of Hub settings.
|
|
6
|
+
// The Fleet's settings client carries it (hubUpdateConsent / setHubUpdateConsent); a client without them (an older
|
|
7
|
+
// Fleet) draws nothing. A module of its own with its own words (upgrade skew: an older dictionary still has them all).
|
|
8
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
9
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
10
|
+
import { confirmDialog } from "/assets/ui-confirm.js";
|
|
11
|
+
|
|
12
|
+
register("hubUpdates", {
|
|
13
|
+
en: {
|
|
14
|
+
switch: "Let this Hub's administrator update this Fleet",
|
|
15
|
+
lead: "When this is on, an administrator of {0} can start an AgEnD update on this computer. It installs only versions published by AgEnD, waits until your agents are idle, tells you before and after, and goes back to the previous version if the update fails. You can turn this off at any time.",
|
|
16
|
+
askTitle: "Let {0}'s administrator update this Fleet?", allow: "Allow",
|
|
17
|
+
notService: "Not available: this AgEnD was started by hand, so a failed update could not be undone automatically.",
|
|
18
|
+
hubOlder: "Not available yet: {0} runs an older AgEnD that can't update Fleets. This works once the Hub is updated.",
|
|
19
|
+
failed: "It wasn't changed. Try again.",
|
|
20
|
+
},
|
|
21
|
+
"zh-TW": {
|
|
22
|
+
switch: "允許這個 Hub 的管理員更新這個 Fleet",
|
|
23
|
+
lead: "開啟後,{0} 的管理員可以在這台電腦上啟動 AgEnD 更新。只會安裝 AgEnD 正式發布的版本,會等你的 Agent 都閒置才開始,更新前後都會通知你,失敗時會回到原本的版本。你隨時可以關閉。",
|
|
24
|
+
askTitle: "要允許 {0} 的管理員更新這個 Fleet 嗎?", allow: "允許",
|
|
25
|
+
notService: "無法使用:這個 AgEnD 是手動啟動的,更新失敗時無法自動復原。",
|
|
26
|
+
hubOlder: "目前無法使用:{0} 的 AgEnD 版本較舊,還不能更新 Fleet。Hub 更新之後就能使用。",
|
|
27
|
+
failed: "沒有變更,請再試一次。",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export const hu = (key, ...args) => t(`hubUpdates.${key}`, ...args);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The switch. `client.hubUpdateConsent()` → { ok, on, available, reason? } (`available: false`, reason "hub-older": the Hub
|
|
34
|
+
* runs an AgEnD older than phase 3 (M-3173); reason "not-service":
|
|
35
|
+
* started by hand); `client.setHubUpdateConsent(on)` → the same shape. `hubName`: the paired Hub's name.
|
|
36
|
+
*/
|
|
37
|
+
export function HubUpdateConsent({ client, hubName = "" }) {
|
|
38
|
+
const [state, setState] = useState(null), [busy, setBusy] = useState(false), [err, setErr] = useState("");
|
|
39
|
+
const live = useRef(true);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
live.current = true;
|
|
42
|
+
if (typeof client?.hubUpdateConsent === "function") client.hubUpdateConsent().then((r) => { if (live.current && r && r.ok !== false) setState(r); }, () => {});
|
|
43
|
+
return () => { live.current = false; };
|
|
44
|
+
}, [client]);
|
|
45
|
+
if (!state || typeof client?.setHubUpdateConsent !== "function") return null;
|
|
46
|
+
const available = state.available !== false;
|
|
47
|
+
const change = async (on, box) => {
|
|
48
|
+
if (busy) return;
|
|
49
|
+
setErr("");
|
|
50
|
+
// On asks once (the owner's consent); off needs no question. Cancel puts the switch back (the page's own state never
|
|
51
|
+
// moved, so nothing would redraw it).
|
|
52
|
+
if (on && !(await confirmDialog({ title: hu("askTitle", hubName), message: hu("lead", hubName), confirmLabel: hu("allow") }))) { if (box) box.checked = false; return; }
|
|
53
|
+
setBusy(true);
|
|
54
|
+
const r = await client.setHubUpdateConsent(on).catch(() => null);
|
|
55
|
+
if (!live.current) return;
|
|
56
|
+
setBusy(false);
|
|
57
|
+
if (r && r.ok !== false) setState(r);
|
|
58
|
+
else { setErr(hu("failed")); if (box) box.checked = state.on === true; } // not changed: the switch shows what is saved
|
|
59
|
+
};
|
|
60
|
+
return html`<div class="hub-update-consent">
|
|
61
|
+
<label class="check hub-update-switch"><input class="s-ui-toggle" type="checkbox" role="switch" id="hubUpdateConsent"
|
|
62
|
+
checked=${available && state.on === true} disabled=${!available || busy} aria-describedby="hubUpdateConsent-note"
|
|
63
|
+
onChange=${(e) => { void change(e.target.checked, e.target); }} /><span>${hu("switch")}</span></label>
|
|
64
|
+
<p class="note" id="hubUpdateConsent-note">${available ? hu("lead", hubName) : state.reason === "hub-older" ? hu("hubOlder", hubName) : hu("notService")}</p>
|
|
65
|
+
${err ? html`<p class="err" role="alert">${err}</p>` : null}
|
|
66
|
+
</div>`;
|
|
67
|
+
}
|
package/dist/ui/settings-hub.js
CHANGED
|
@@ -21,6 +21,7 @@ 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 { HubUpdateConsent } from "./settings-hub-updates.js";
|
|
24
25
|
|
|
25
26
|
register("hubSharingFleet", {
|
|
26
27
|
en: { hint: "To pause and resume without clearing the allow list, open this agent under My shared agents on the Hub. Turning Share off stops sharing." },
|
|
@@ -223,6 +224,8 @@ export function HubConnectCard({ embedded = false, onPairing, labels = {}, prefi
|
|
|
223
224
|
${p?.state === "paired" && client.pairingNotices?.().length ? html`<${PairingNotices} memberNotices=${client.pairingNotices()} memberOrigin=${safeWebOrigin(p)} />` : null}
|
|
224
225
|
${msg && waitingForPairing(msg, p) ? html`<p class=${msg.error ? "err" : "note"} role=${msg.error ? "alert" : "status"}>${msg.text}</p>` : null}
|
|
225
226
|
${p && p.state === "paired" ? html`<${HubExposures} key=${`${p.binding}|${p.hub.hubId}|${p.hub.fingerprint?.digest}|${safeWebOrigin(p)}`} client=${client} pairing=${p} />` : null}
|
|
227
|
+
${/* M-3145 (versions spec §4.1): under Shared agents, the owner's switch for updates started by this Hub's administrator. */ ""}
|
|
228
|
+
${p && p.state === "paired" ? html`<${HubUpdateConsent} client=${client} hubName=${p.hub.name || p.hub.memberOrigin || ""} />` : null}
|
|
226
229
|
</${Frame}>`;
|
|
227
230
|
}
|
|
228
231
|
|
|
@@ -234,6 +237,7 @@ export function HubConnectCard({ embedded = false, onPairing, labels = {}, prefi
|
|
|
234
237
|
function HubExposures({ client, pairing }) {
|
|
235
238
|
const store = useStore(appStore);
|
|
236
239
|
const [rows, setRows] = useState(null);
|
|
240
|
+
const [contactChoices, setContactChoices] = useState({});
|
|
237
241
|
const [readError, setReadError] = useState(false);
|
|
238
242
|
const [busy, setBusy] = useState(null);
|
|
239
243
|
const [msg, setMsg] = useState(null);
|
|
@@ -242,7 +246,8 @@ function HubExposures({ client, pairing }) {
|
|
|
242
246
|
// rows it has on a failure instead of turning the list into an error.
|
|
243
247
|
const load = (background = false) => {
|
|
244
248
|
const n = ++seq.current; if (!background) setReadError(false);
|
|
245
|
-
return client.exposures().then((r) => { if (live.current && n === seq.current) { setRows(r); setReadError(false);
|
|
249
|
+
return client.exposures().then((r) => { if (live.current && n === seq.current) { setRows(r); setReadError(false);
|
|
250
|
+
setContactChoices(current => Object.fromEntries(Object.entries(current).filter(([agent]) => !r.some(row => row.agent === agent && row.state === "published")))); } },
|
|
246
251
|
() => { if (live.current && n === seq.current && !background) setReadError(true); });
|
|
247
252
|
};
|
|
248
253
|
useEffect(() => { live.current = true; load(); return () => { live.current = false; }; }, []);
|
|
@@ -256,11 +261,11 @@ function HubExposures({ client, pairing }) {
|
|
|
256
261
|
if (!live.current || polling.current || busyRef.current) return;
|
|
257
262
|
polling.current = true; load(true).finally(() => { polling.current = false; });
|
|
258
263
|
}, [pairing]);
|
|
259
|
-
const toggle = async (row, on) => {
|
|
264
|
+
const toggle = async (row, on, contactLimit = contactChoices[row.agent] ?? (row.contactLimit !== false)) => {
|
|
260
265
|
if (busy) return;
|
|
261
266
|
setBusy(row.agent); busyRef.current = row.agent; setMsg(null);
|
|
262
267
|
try {
|
|
263
|
-
const r = await client.setExposed(row.agent, on, row.revision, on ? AGENT_CHOICE : null);
|
|
268
|
+
const r = await client.setExposed(row.agent, on, row.revision, on ? { ...AGENT_CHOICE, contactLimit } : null);
|
|
264
269
|
if (!live.current) return;
|
|
265
270
|
if (!r.ok) { setMsg({ error: true, text: hw(PUBLISH_ERRORS[r.error] || "errUnsaved") }); if (r.error === "conflict") await load(); return; }
|
|
266
271
|
if (!on && r.remote === "pending") setMsg({ error: false, text: hw("withdrawPending") });
|
|
@@ -286,6 +291,15 @@ function HubExposures({ client, pairing }) {
|
|
|
286
291
|
<p class="note">${hw("agentLead")}</p>
|
|
287
292
|
<p class="note hub-sharing-hint">${t("hubSharingFleet.hint")}</p>
|
|
288
293
|
${readError ? html`<${ErrorState} message=${hw("errFailed")} onRetry=${load} />` : !rows ? html`<${Skeleton} variant="rows" lines=${3} />` : null}
|
|
294
|
+
${rows?.some(row => row.contactLimitNotice) ? html`<div class="note hub-contact-notice" role="status">
|
|
295
|
+
<p>${hw("contactLimitNotice")}</p>
|
|
296
|
+
<button type="button" class="btn btn-sm" disabled=${busy !== null} onClick=${async () => {
|
|
297
|
+
setBusy("notice");
|
|
298
|
+
try { if (!(await client.acknowledgeContactLimitNotice())) throw Error(); await load(); }
|
|
299
|
+
catch { if (live.current) setMsg({ error: true, text: hw("errUnsaved") }); }
|
|
300
|
+
finally { if (live.current) setBusy(null); }
|
|
301
|
+
}}>${hw("contactNoticeDone")}</button>
|
|
302
|
+
</div>` : null}
|
|
289
303
|
${rows && !rows.length ? html`<p class="note">${hw("noAgents")}</p>` : null}
|
|
290
304
|
${rows && rows.length ? html`<ul class="hub-exposure-list">${rows.map((row) => html`<li key=${row.agent} class=${`hub-exposure${row.state === "published" ? " is-shared" : ""}`}>
|
|
291
305
|
<label class="hub-exposure-main">
|
|
@@ -294,6 +308,17 @@ function HubExposures({ client, pairing }) {
|
|
|
294
308
|
onChange=${(e) => toggle(row, e.target.checked)} />
|
|
295
309
|
<span class="hub-exposure-name">${row.display}${row.display !== row.agent ? html` <small><code>${row.agent}</code></small>` : null}</span>
|
|
296
310
|
</label>
|
|
311
|
+
<label class="check hub-contact-limit">
|
|
312
|
+
<input type="checkbox" checked=${contactChoices[row.agent] ?? (row.contactLimit !== false)}
|
|
313
|
+
disabled=${busy !== null || !!row.pending || row.state === "frozen" || row.reason === "hub_refused"}
|
|
314
|
+
onChange=${e => {
|
|
315
|
+
const on = e.target.checked;
|
|
316
|
+
if (row.state === "published") toggle(row, true, on);
|
|
317
|
+
else setContactChoices(current => ({ ...current, [row.agent]: on }));
|
|
318
|
+
}} />
|
|
319
|
+
<span>${hw("contactLimit")}</span>
|
|
320
|
+
</label>
|
|
321
|
+
<small class="note hub-contact-hint">${hw("contactLimitHint")}</small>
|
|
297
322
|
${row.pending ? html`<small class="hub-exposure-why hub-exposure-pending">${hw("waitingConfirm")}</small>`
|
|
298
323
|
: row.state === "frozen" ? html`<small class="hub-exposure-why">${hw("frozen")}</small>`
|
|
299
324
|
: !row.enforceable && row.state !== "published" ? html`<small class="hub-exposure-why">${hw(row.reason === "delivery_unavailable" ? "agentDeliveryUnavailable" : "agentNotShareable")}</small>`
|
|
@@ -26,6 +26,7 @@ const ROWS = [
|
|
|
26
26
|
["profile.name", "preferences", "#profile-name", "settings.profileTitle", null, ["name", "display name", "who agents see", "profile"], ["名字", "名稱", "顯示名稱", "個人資料"]],
|
|
27
27
|
["prefs.theme", "look", "#pref-theme", "app.theme", null, ["theme", "dark", "light", "dark mode", "colour scheme"], ["主題", "深色", "淺色", "外觀"]],
|
|
28
28
|
["prefs.lang", "preferences", "#pref-lang", "app.language", null, ["language", "dashboard language", "english", "chinese", "locale"], ["語言", "介面語言", "中文", "英文"]],
|
|
29
|
+
["prefs.density", "preferences", "#pref-density", "app.sidebarDensity", null, ["sidebar", "compact", "detailed", "density", "agent list"], ["側邊欄", "精簡", "詳細", "密度", "Agent 清單"]],
|
|
29
30
|
["prefs.names", "preferences", "#pref-names", "app.names", null, ["names", "nickname", "real name", "instance name", "display"], ["名稱", "暱稱", "實名"]],
|
|
30
31
|
["prefs.previews", "preferences", "#pref-previews", "chat.previews", null, ["html preview", "preview", "iframe"], ["預覽", "HTML 預覽"]],
|
|
31
32
|
["prefs.tour", "preferences", "#tourBtn", "chat.tour", null, ["tour", "help", "walkthrough", "guide"], ["導覽", "說明", "教學"]],
|
|
@@ -6,19 +6,21 @@ import { html, useEffect, useState } from "/assets/app-html.js";
|
|
|
6
6
|
import { register, t, lang } from "/assets/app-i18n.js";
|
|
7
7
|
import { useStore } from "/assets/app-store.js";
|
|
8
8
|
import { toast } from "/assets/ui-toast.js";
|
|
9
|
-
import { checkUpdateNow, openUpdateDialog, refreshUpdate, updateActive, updateStore } from "/assets/app-update.js";
|
|
9
|
+
import { checkUpdateNow, hubNeed, openHubUpdateDialog, openUpdateDialog, refreshUpdate, updateActive, updateStore } from "/assets/app-update.js";
|
|
10
10
|
|
|
11
11
|
register("supdate", {
|
|
12
12
|
en: { title: "Version and update", current: "Current version", line: "Update line", latest: "Latest", checked: "Last checked",
|
|
13
13
|
newer: "v{0} is available", upToDate: "Up to date", stableNewer: "v{0} (stable) is available", notYet: "Not checked yet",
|
|
14
14
|
failed: "The last check could not reach the update source", check: "Check for updates", checking: "Checking…",
|
|
15
15
|
alphaNote: "Updating from the web stays on the Alpha preview line; switching to stable is not offered here.",
|
|
16
|
-
recently: "Checked less than a minute ago.", checkFailed: "The check could not finish.", pillNew: "New version"
|
|
16
|
+
recently: "Checked less than a minute ago.", checkFailed: "The check could not finish.", pillNew: "New version",
|
|
17
|
+
recommendedBy: "Recommended by {0}" },
|
|
17
18
|
"zh-TW": { title: "版本與更新", current: "目前版本", line: "更新管道", latest: "最新", checked: "上次檢查",
|
|
18
19
|
newer: "v{0} 已推出", upToDate: "已是最新版", stableNewer: "v{0}(穩定版)已推出", notYet: "還沒檢查過",
|
|
19
20
|
failed: "上次檢查連不上更新來源", check: "檢查更新", checking: "檢查中…",
|
|
20
21
|
alphaNote: "網頁更新會留在 Alpha 預覽版,不提供切換到穩定版。",
|
|
21
|
-
recently: "一分鐘內剛檢查過。", checkFailed: "檢查沒有完成。", pillNew: "有新版"
|
|
22
|
+
recently: "一分鐘內剛檢查過。", checkFailed: "檢查沒有完成。", pillNew: "有新版",
|
|
23
|
+
recommendedBy: "{0} 建議的版本" },
|
|
22
24
|
});
|
|
23
25
|
|
|
24
26
|
const LINE = { latest: "update.channel_latest", beta: "update.channel_beta", alpha: "update.channel_alpha" };
|
|
@@ -37,6 +39,8 @@ export function UpdateSection() {
|
|
|
37
39
|
if (!info || !info.admin) return null;
|
|
38
40
|
const channel = channelOf(info.current);
|
|
39
41
|
const offer = info.offer;
|
|
42
|
+
// M-3140 (spec §3.3): the Hub's advice, a row of its own; its Update is pinned when it is the higher need (hubNeed).
|
|
43
|
+
const rec = info.hubRecommendation && typeof info.hubRecommendation.version === "string" ? info.hubRecommendation : null, need = hubNeed(info);
|
|
40
44
|
const latest = offer ? (offer.installable ? t("supdate.newer", offer.version) : t("supdate.stableNewer", offer.version))
|
|
41
45
|
: info.check_failed ? t("supdate.failed") : info.checked_at ? t("supdate.upToDate") : t("supdate.notYet");
|
|
42
46
|
const check = async () => {
|
|
@@ -52,10 +56,12 @@ export function UpdateSection() {
|
|
|
52
56
|
<dt>${t("supdate.line")}</dt><dd>${t(LINE[channel])}</dd>
|
|
53
57
|
<dt>${t("supdate.latest")}</dt><dd class=${offer && offer.installable ? "new" : ""}>${latest}</dd>
|
|
54
58
|
<dt>${t("supdate.checked")}</dt><dd>${info.checked_at ? when(info.checked_at) : t("supdate.notYet")}</dd>
|
|
59
|
+
${rec ? html`<dt>${t("supdate.recommendedBy", rec.hubName)}</dt><dd class=${need ? "new" : ""}>v${rec.version}</dd>` : null}
|
|
55
60
|
</dl>
|
|
56
61
|
${offer && !offer.installable ? html`<p class="s-update-note">${t("supdate.alphaNote")}</p>` : null}
|
|
57
62
|
<div class="s-update-row">
|
|
58
|
-
${
|
|
63
|
+
${need ? html`<button type="button" class="btn btn-primary" disabled=${starting || updateActive(info)} onClick=${() => { void openHubUpdateDialog(); }}>${t("update.now")}</button>`
|
|
64
|
+
: offer && offer.installable ? html`<button type="button" class="btn btn-primary" disabled=${starting || updateActive(info)} onClick=${openUpdateDialog}>${t("update.now")}</button>` : null}
|
|
59
65
|
<button type="button" class="btn" disabled=${checking || updateActive(info)} onClick=${check}>${checking ? t("supdate.checking") : t("supdate.check")}</button>
|
|
60
66
|
</div>
|
|
61
67
|
</section>`;
|
|
@@ -64,6 +70,6 @@ export function UpdateSection() {
|
|
|
64
70
|
/** The "new version" mark beside Settings' version pill (admins, an installable offer). */
|
|
65
71
|
export function UpdatePillMark() {
|
|
66
72
|
const { info } = useStore(updateStore);
|
|
67
|
-
if (!info || !info.admin || !info.offer
|
|
73
|
+
if (!info || !info.admin || !((info.offer && info.offer.installable) || hubNeed(info))) return null;
|
|
68
74
|
return html` <span class="pill ver-new">${t("supdate.pillNew")}</span>`;
|
|
69
75
|
}
|
|
@@ -70,7 +70,7 @@ export function WebAuthorityCard({ ctx, staged, disabled = false }) {
|
|
|
70
70
|
}, [f, original, overview]);
|
|
71
71
|
// A fleet with no chat connection is worded for the authenticator (the reference page); one with Discord / Telegram keeps the confirm-card words.
|
|
72
72
|
const webOnly = !!overview && overview.webOnly === true;
|
|
73
|
-
const card = (body) => html`<section class="card s-web-authority"><h3>${tn("vaTitle")}</h3><p class="note s-authority-brief">${layoutText(webOnly ? "revAuthorityBriefWeb" : "revAuthorityBrief")}</p><p class="note s-authority-rule">${layoutText("revAuthorityRule")}</p>${body}<details class="s-setting-details"><summary>${layoutText("revAuthorityDetails")}</summary><p class="note">${tn("vaHint")}</p><p class="note">${tn("vaEnabledHint")}</p><p class="note">${tn("vaLoopbackOnlyHint")}</p></details></section>`;
|
|
73
|
+
const card = (body) => html`<section class="card s-web-authority" id="webAuthority"><h3>${tn("vaTitle")}</h3><p class="note s-authority-brief">${layoutText(webOnly ? "revAuthorityBriefWeb" : "revAuthorityBrief")}</p><p class="note s-authority-rule">${layoutText("revAuthorityRule")}</p>${body}<details class="s-setting-details"><summary>${layoutText("revAuthorityDetails")}</summary><p class="note">${tn("vaHint")}</p><p class="note">${tn("vaEnabledHint")}</p><p class="note">${tn("vaLoopbackOnlyHint")}</p></details></section>`;
|
|
74
74
|
if (failed) return card(html`<p class="note" role="status">${tn("vaLoadFailed")} <button type="button" class="btn btn-sm" onClick=${load}>${t("app.retry")}</button></p>`);
|
|
75
75
|
if (!overview || !f) return card(html`<${Skeleton} variant="rows" lines=${3} />`);
|
|
76
76
|
|