@songsid/agend 2.4.0-alpha.3 → 2.4.0-alpha.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-instructions.md +8 -4
- package/dist/agent-whats-new.js +7 -7
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/auth-api.js +7 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/claude-code.d.ts +8 -0
- package/dist/backend/claude-code.js +11 -4
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex.js +7 -3
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok.d.ts +19 -0
- package/dist/backend/grok.js +112 -1
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/types.d.ts +10 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-tools.js +2 -2
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/child-process.d.ts +1 -0
- package/dist/child-process.js.map +1 -1
- package/dist/claude-model-observation.d.ts +71 -0
- package/dist/claude-model-observation.js +169 -0
- package/dist/claude-model-observation.js.map +1 -0
- package/dist/cross-instance-envelope.d.ts +4 -1
- package/dist/cross-instance-envelope.js +12 -7
- package/dist/cross-instance-envelope.js.map +1 -1
- package/dist/daemon.d.ts +24 -2
- package/dist/daemon.js +263 -35
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-consumed-watch.d.ts +24 -0
- package/dist/delivery-consumed-watch.js +21 -10
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/delivery-outbox.d.ts +5 -1
- package/dist/delivery-outbox.js +5 -0
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-manager.d.ts +11 -1
- package/dist/fleet-manager.js +80 -2
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +16 -3
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +5 -3
- package/dist/general-knowledge/skills/hub/SKILL.md +161 -4
- package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +18 -7
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
- package/dist/grok-delivery-proof.d.ts +24 -0
- package/dist/grok-delivery-proof.js +124 -0
- package/dist/grok-delivery-proof.js.map +1 -0
- package/dist/hub/assistant/admin-types.d.ts +43 -0
- package/dist/hub/assistant/admin-types.js +2 -0
- package/dist/hub/assistant/admin-types.js.map +1 -0
- package/dist/hub/assistant/claude-host.d.ts +17 -0
- package/dist/hub/assistant/claude-host.js +300 -0
- package/dist/hub/assistant/claude-host.js.map +1 -0
- package/dist/hub/assistant/context.d.ts +3 -0
- package/dist/hub/assistant/context.js +7 -0
- package/dist/hub/assistant/context.js.map +1 -0
- package/dist/hub/assistant/fleet-host.d.ts +19 -0
- package/dist/hub/assistant/fleet-host.js +28 -0
- package/dist/hub/assistant/fleet-host.js.map +1 -0
- package/dist/hub/assistant/runner.d.ts +64 -0
- package/dist/hub/assistant/runner.js +239 -0
- package/dist/hub/assistant/runner.js.map +1 -0
- package/dist/hub/assistant/service.d.ts +51 -0
- package/dist/hub/assistant/service.js +143 -0
- package/dist/hub/assistant/service.js.map +1 -0
- package/dist/hub/assistant/store.d.ts +3 -0
- package/dist/hub/assistant/store.js +65 -0
- package/dist/hub/assistant/store.js.map +1 -0
- package/dist/hub/assistant/types.d.ts +60 -0
- package/dist/hub/assistant/types.js +2 -0
- package/dist/hub/assistant/types.js.map +1 -0
- package/dist/hub/catalog.js +22 -3
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.d.ts +10 -0
- package/dist/hub/client.js +48 -8
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +8 -1
- package/dist/hub/compose/member.js +224 -58
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +11 -1
- package/dist/hub/compose/server.js +68 -11
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/directory/admission.d.ts +15 -0
- package/dist/hub/directory/admission.js +56 -0
- package/dist/hub/directory/admission.js.map +1 -0
- package/dist/hub/directory/directory.d.ts +1 -1
- package/dist/hub/directory/directory.js +63 -0
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/types.d.ts +13 -0
- package/dist/hub/directory/types.js.map +1 -1
- package/dist/hub/group-policy/admin-control.d.ts +1 -0
- package/dist/hub/group-policy/admin-control.js +4 -2
- package/dist/hub/group-policy/admin-control.js.map +1 -1
- package/dist/hub/group-policy/admin-facts.d.ts +1 -0
- package/dist/hub/group-policy/admin-facts.js +2 -1
- package/dist/hub/group-policy/admin-facts.js.map +1 -1
- package/dist/hub/group-policy/admin-read.d.ts +1 -0
- package/dist/hub/group-policy/admin-read.js +3 -2
- package/dist/hub/group-policy/admin-read.js.map +1 -1
- package/dist/hub/group-policy/errors.d.ts +9 -0
- package/dist/hub/group-policy/errors.js +13 -0
- package/dist/hub/group-policy/errors.js.map +1 -0
- package/dist/hub/group-policy/store.d.ts +3 -9
- package/dist/hub/group-policy/store.js +5 -29
- package/dist/hub/group-policy/store.js.map +1 -1
- package/dist/hub/http/compose.d.ts +1 -0
- package/dist/hub/http/compose.js +429 -14
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +6 -5
- package/dist/hub/http/core.js +74 -48
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +18 -0
- package/dist/hub/http/schema.js +8 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/init/member-certificate.d.ts +1 -0
- package/dist/hub/init/member-certificate.js +39 -0
- package/dist/hub/init/member-certificate.js.map +1 -0
- package/dist/hub/init/plan-digest.js +1 -0
- package/dist/hub/init/plan-digest.js.map +1 -1
- package/dist/hub/invitations.d.ts +96 -0
- package/dist/hub/invitations.js +292 -0
- package/dist/hub/invitations.js.map +1 -0
- package/dist/hub/join/certificate-trust.d.ts +13 -0
- package/dist/hub/join/certificate-trust.js +41 -0
- package/dist/hub/join/certificate-trust.js.map +1 -0
- package/dist/hub/join/certificate.d.ts +11 -0
- package/dist/hub/join/certificate.js +67 -0
- package/dist/hub/join/certificate.js.map +1 -0
- package/dist/hub/join/client.d.ts +5 -0
- package/dist/hub/join/client.js +30 -3
- package/dist/hub/join/client.js.map +1 -1
- package/dist/hub/join/http.js +5 -3
- package/dist/hub/join/http.js.map +1 -1
- package/dist/hub/join/local.d.ts +32 -1
- package/dist/hub/join/local.js +116 -11
- package/dist/hub/join/local.js.map +1 -1
- package/dist/hub/join/service.d.ts +17 -0
- package/dist/hub/join/service.js +12 -0
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/join/trust.d.ts +9 -0
- package/dist/hub/join/trust.js +35 -0
- package/dist/hub/join/trust.js.map +1 -1
- package/dist/hub/member/pairing-api.js +9 -1
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/member/room-ask.d.ts +137 -0
- package/dist/hub/member/room-ask.js +358 -0
- package/dist/hub/member/room-ask.js.map +1 -0
- package/dist/hub/member-journal.d.ts +18 -1
- package/dist/hub/member-journal.js +76 -3
- package/dist/hub/member-journal.js.map +1 -1
- package/dist/hub/member-origin.d.ts +177 -0
- package/dist/hub/member-origin.js +314 -0
- package/dist/hub/member-origin.js.map +1 -0
- package/dist/hub/pairing-notices.d.ts +1 -0
- package/dist/hub/pairing-notices.js +2 -1
- package/dist/hub/pairing-notices.js.map +1 -1
- package/dist/hub/pairing.d.ts +8 -0
- package/dist/hub/pairing.js +32 -5
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/protocol.d.ts +159 -0
- package/dist/hub/protocol.js +19 -1
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/roles/clock.d.ts +18 -0
- package/dist/hub/roles/clock.js +58 -0
- package/dist/hub/roles/clock.js.map +1 -0
- package/dist/hub/roles/cutover-marker.d.ts +57 -0
- package/dist/hub/roles/cutover-marker.js +26 -0
- package/dist/hub/roles/cutover-marker.js.map +1 -0
- package/dist/hub/roles/cutover.js +3 -17
- package/dist/hub/roles/cutover.js.map +1 -1
- package/dist/hub/roles/read.d.ts +7 -3
- package/dist/hub/roles/read.js +9 -1
- package/dist/hub/roles/read.js.map +1 -1
- package/dist/hub/rooms/admin.d.ts +45 -0
- package/dist/hub/rooms/admin.js +105 -0
- package/dist/hub/rooms/admin.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +74 -0
- package/dist/hub/rooms/agents.js +333 -0
- package/dist/hub/rooms/agents.js.map +1 -0
- package/dist/hub/rooms/assistant.d.ts +44 -0
- package/dist/hub/rooms/assistant.js +179 -0
- package/dist/hub/rooms/assistant.js.map +1 -0
- package/dist/hub/rooms/context.d.ts +10 -0
- package/dist/hub/rooms/context.js +24 -0
- package/dist/hub/rooms/context.js.map +1 -0
- package/dist/hub/rooms/direct-view.d.ts +39 -0
- package/dist/hub/rooms/direct-view.js +38 -0
- package/dist/hub/rooms/direct-view.js.map +1 -0
- package/dist/hub/rooms/directory.d.ts +35 -0
- package/dist/hub/rooms/directory.js +98 -0
- package/dist/hub/rooms/directory.js.map +1 -0
- package/dist/hub/rooms/schema.d.ts +11 -0
- package/dist/hub/rooms/schema.js +73 -0
- package/dist/hub/rooms/schema.js.map +1 -0
- package/dist/hub/rooms/service.d.ts +449 -0
- package/dist/hub/rooms/service.js +581 -0
- package/dist/hub/rooms/service.js.map +1 -0
- package/dist/hub/rooms/types.d.ts +79 -0
- package/dist/hub/rooms/types.js +2 -0
- package/dist/hub/rooms/types.js.map +1 -0
- package/dist/hub/rooms.d.ts +7 -1
- package/dist/hub/rooms.js +30 -5
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +8 -0
- package/dist/hub/runtime.js +57 -3
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.d.ts +25 -0
- package/dist/hub/server.js +63 -5
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/sessions.js +1 -1
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/settings-commit.d.ts +6 -1
- package/dist/hub/settings-commit.js +15 -0
- package/dist/hub/settings-commit.js.map +1 -1
- package/dist/hub/settings-directory-recovery.d.ts +5 -0
- package/dist/hub/settings-directory-recovery.js +11 -1
- package/dist/hub/settings-directory-recovery.js.map +1 -1
- package/dist/hub/settings-member-address-control.d.ts +84 -0
- package/dist/hub/settings-member-address-control.js +150 -0
- package/dist/hub/settings-member-address-control.js.map +1 -0
- package/dist/hub/settings-member-address-decision.d.ts +229 -0
- package/dist/hub/settings-member-address-decision.js +318 -0
- package/dist/hub/settings-member-address-decision.js.map +1 -0
- package/dist/hub/settings-member-address-http.d.ts +9 -0
- package/dist/hub/settings-member-address-http.js +78 -0
- package/dist/hub/settings-member-address-http.js.map +1 -0
- package/dist/hub/settings-member-address-network.d.ts +2 -0
- package/dist/hub/settings-member-address-network.js +22 -0
- package/dist/hub/settings-member-address-network.js.map +1 -0
- package/dist/hub/settings-member-address-notices.d.ts +22 -0
- package/dist/hub/settings-member-address-notices.js +21 -0
- package/dist/hub/settings-member-address-notices.js.map +1 -0
- package/dist/hub/settings-member-address-policy.d.ts +21 -0
- package/dist/hub/settings-member-address-policy.js +34 -0
- package/dist/hub/settings-member-address-policy.js.map +1 -0
- package/dist/hub/settings-member-address.d.ts +64 -0
- package/dist/hub/settings-member-address.js +239 -0
- package/dist/hub/settings-member-address.js.map +1 -0
- package/dist/hub/socket.d.ts +2 -0
- package/dist/hub/socket.js +2 -0
- package/dist/hub/socket.js.map +1 -1
- package/dist/hub/teams/types.d.ts +41 -0
- package/dist/hub/teams/types.js +2 -0
- package/dist/hub/teams/types.js.map +1 -0
- package/dist/hub/tls.d.ts +47 -0
- package/dist/hub/tls.js +23 -6
- package/dist/hub/tls.js.map +1 -1
- package/dist/hub/types.d.ts +51 -3
- package/dist/hub/validation.d.ts +1 -1
- package/dist/hub/validation.js +2 -2
- package/dist/hub/validation.js.map +1 -1
- package/dist/hub/web-origin.d.ts +20 -7
- package/dist/hub/web-origin.js +26 -15
- package/dist/hub/web-origin.js.map +1 -1
- package/dist/hub-pilot-trust-settings.d.ts +4 -0
- package/dist/hub-pilot-trust-settings.js +13 -0
- package/dist/hub-pilot-trust-settings.js.map +1 -0
- package/dist/human-delivery-receipts.d.ts +4 -2
- package/dist/human-delivery-receipts.js +20 -13
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/inbound-presentation.d.ts +28 -0
- package/dist/inbound-presentation.js +48 -0
- package/dist/inbound-presentation.js.map +1 -0
- package/dist/instance-lifecycle.js +1 -0
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +4 -2
- package/dist/instructions.js +7 -4
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +14 -0
- package/dist/locale.js.map +1 -1
- package/dist/log-service.d.ts +3 -0
- package/dist/log-service.js +39 -22
- package/dist/log-service.js.map +1 -1
- package/dist/log-steps.d.ts +56 -1
- package/dist/log-steps.js +318 -56
- package/dist/log-steps.js.map +1 -1
- package/dist/needs-you-hub.js +6 -2
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +5 -1
- package/dist/needs-you.js +4 -8
- 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/outbound-handlers.d.ts +1 -0
- package/dist/outbound-handlers.js +6 -0
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +1 -0
- package/dist/outbound-schemas.js +1 -0
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/queued-handoffs.d.ts +3 -1
- package/dist/queued-handoffs.js +1 -1
- package/dist/queued-handoffs.js.map +1 -1
- package/dist/runtime-transcript-source.d.ts +2 -0
- package/dist/runtime-transcript-source.js +23 -1
- package/dist/runtime-transcript-source.js.map +1 -1
- package/dist/settings-api.d.ts +1 -0
- package/dist/settings-api.js +15 -8
- 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-effect.d.ts +3 -0
- package/dist/settings-effect.js +12 -2
- package/dist/settings-effect.js.map +1 -1
- package/dist/topic-commands.js +2 -1
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-jsonl.d.ts +24 -0
- package/dist/transcript-jsonl.js +72 -22
- package/dist/transcript-jsonl.js.map +1 -1
- package/dist/transcript-monitor.d.ts +5 -1
- package/dist/transcript-monitor.js +65 -3
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-needles.d.ts +1 -1
- package/dist/transcript-needles.js +1 -1
- package/dist/transcript-records.d.ts +2 -1
- package/dist/transcript-records.js.map +1 -1
- package/dist/transcript-sources.d.ts +4 -0
- package/dist/transcript-sources.js +2 -0
- package/dist/transcript-sources.js.map +1 -1
- package/dist/ui/agent-details-settings.js +10 -1
- package/dist/ui/chat-activity.js +2 -2
- package/dist/ui/fleet-canvas.js +5 -2
- package/dist/ui/fleet-office-card.js +4 -2
- package/dist/ui/fleet-org.js +2 -0
- package/dist/ui/hub-admin-rooms-strings.js +28 -0
- package/dist/ui/hub-admin-rooms.js +77 -0
- package/dist/ui/hub-assistant-admin-strings.js +26 -0
- package/dist/ui/hub-assistant-admin.js +85 -0
- package/dist/ui/hub-client.js +170 -14
- package/dist/ui/hub-invitations-strings.js +30 -0
- package/dist/ui/hub-invitations.js +108 -0
- package/dist/ui/hub-join-one-strings.js +2 -0
- package/dist/ui/hub-pairing-form-strings.js +48 -0
- package/dist/ui/hub-pilot-trust-strings.js +27 -0
- package/dist/ui/hub-pilot-trust.js +41 -0
- package/dist/ui/hub-room-composer.js +113 -0
- package/dist/ui/hub-room-favorites.js +90 -0
- package/dist/ui/hub-room-list.js +152 -0
- package/dist/ui/hub-room-members-strings.js +12 -0
- package/dist/ui/hub-room-members.js +104 -0
- package/dist/ui/hub-room-new-strings.js +46 -0
- package/dist/ui/hub-room-new.js +135 -0
- package/dist/ui/hub-room-presence.js +123 -0
- package/dist/ui/hub-room-settings-strings.js +26 -0
- package/dist/ui/hub-room-settings.js +134 -0
- package/dist/ui/hub-room-strings.js +222 -0
- package/dist/ui/hub-room-thread.js +262 -0
- package/dist/ui/hub-room-unread.js +51 -0
- package/dist/ui/hub-room-working.js +29 -0
- package/dist/ui/log-row.js +14 -5
- package/dist/ui/panel-details.js +6 -1
- package/dist/ui/panel-hub.js +91 -49
- package/dist/ui/panel-needs.js +2 -0
- package/dist/ui/settings-hub-company-join.js +31 -11
- package/dist/ui/settings-hub-connection.js +9 -3
- package/dist/ui/settings-hub-member-address.js +205 -0
- package/dist/ui/settings-hub-section.js +2 -0
- package/dist/ui/settings-hub.js +10 -4
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-needs.js +3 -0
- package/dist/ui/shared/app-shell.js +4 -1
- package/dist/ui/shared/app.css +5 -0
- package/dist/ui/shared/chat-render.js +10 -0
- package/dist/ui/shared/chat-thread.js +14 -5
- package/dist/ui/shared/hub-chat.css +17 -0
- package/dist/ui/shared/hub-rooms-u2.css +42 -0
- package/dist/ui/shared/model-observation.js +16 -0
- package/dist/ui/shared/stale-tab.css +6 -0
- package/dist/ui/shared/stale-tab.js +50 -0
- package/dist/web-api.d.ts +2 -0
- package/dist/web-api.js +6 -2
- package/dist/web-api.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { modelSwitchText, modelName, observationLabel } from "/assets/model-observation.js";
|
|
1
2
|
// #2661: a person's profile card in the Office (fleet-office.js opens it): a popover beside them, not a modal — the Office
|
|
2
3
|
// keeps running and is not dimmed; on a phone, a bottom sheet swiped down to close. Fixed 320 px wide.
|
|
3
4
|
//
|
|
@@ -60,7 +61,7 @@ export function cardModel({ node, lv, levels, share = false, state, now, where }
|
|
|
60
61
|
const detail = !share && !!e && e.workTokens !== undefined;
|
|
61
62
|
const xp = showLevel && detail ? xpOf(e.level, e.workTokens, lv.unit) : null;
|
|
62
63
|
const rows = [[tc("office"), where]];
|
|
63
|
-
if (!share && it.model) rows.push([tc("model"), modelText(it)]);
|
|
64
|
+
if (!share && it.model) rows.push(it.model_observation ? [observationLabel("selection"), modelName(it.model_observation.session) || observationLabel("unresolved")] : [tc("model"), modelText(it)]);
|
|
64
65
|
if (!share && it.backend) rows.push([tc("backend"), backendLabel(it.backend)]);
|
|
65
66
|
if (detail) rows.push([tc("today"), tc("todayN", tokens(e.today.workTokens), e.today.requests)]);
|
|
66
67
|
if (detail && e.firstSeen) rows.push([tc("firstSeen"), tc("day", dayOf(e.firstSeen))]);
|
|
@@ -70,7 +71,7 @@ export function cardModel({ node, lv, levels, share = false, state, now, where }
|
|
|
70
71
|
badge: on && fx && fx.hideLevel ? { mark: true, tier: 0 } : e ? { text: badgeText(e.level), tier: tierOf(e.level) } : null,
|
|
71
72
|
level: showLevel ? { line1: detail ? `${tc("level", e.level)} · ${tc("work", tokens(e.workTokens))}` : tc("level", e.level), estimated: detail && e.estimated,
|
|
72
73
|
line2: xp ? tc("toNext", tokens(xp.toNext), xp.next) : null, pct: xp ? xp.pct : null, next: xp ? xp.next : null } : null,
|
|
73
|
-
rows, now,
|
|
74
|
+
rows, now, modelSwitch: !share ? modelSwitchText(it.model_observation?.active) : "",
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -89,6 +90,7 @@ export function OfficeCard({ model: m, avatar, sheet, place, onChat, onFind, onC
|
|
|
89
90
|
return html`<div ref=${box} class=${`oo-card${sheet ? " sheet" : ""}`} role="dialog" aria-modal="false" aria-label=${tc("card", m.name)}
|
|
90
91
|
onPointerDown=${down} onPointerUp=${up} onPointerCancel=${() => { swipe.current = null; }}>
|
|
91
92
|
${sheet ? html`<div class="oo-card-grip" aria-hidden="true"></div>` : null}
|
|
93
|
+
${m.modelSwitch ? html`<p class="oo-card-now model-switch" role="status"><strong>${m.modelSwitch}</strong></p>` : null}
|
|
92
94
|
<div class="oo-card-head">
|
|
93
95
|
<div class="oo-card-avatar"><canvas ref=${canvas} width="56" height="56" aria-hidden="true"></canvas>
|
|
94
96
|
${m.badge ? html`<span class=${`oo-badge tier-${m.badge.tier}${m.badge.mark ? " mark" : ""}`} aria-hidden="true">${m.badge.mark ? "" : m.badge.text}</span>` : null}</div>
|
package/dist/ui/fleet-org.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { modelSwitchText, modelName, observationLabel } from "/assets/model-observation.js";
|
|
1
2
|
// #1389: Fleet → Org chart (/ui/fleet/org) — General at the top, then the teams fleet.yaml defines, then their
|
|
2
3
|
// instances; each node names the instance, says what it does, which backend and model it runs, how it is doing now,
|
|
3
4
|
// and links to its thread. Behind the session gate (/ui/js/), imported by the Fleet panel.
|
|
@@ -129,6 +130,7 @@ function Node({ n, sending }) {
|
|
|
129
130
|
${n.i ? html`<div class="org-meta">${n.i.backend ? html`<span class="org-chip">${n.i.backend}</span>` : null}
|
|
130
131
|
${model ? html`<span class="org-model mono" title=${model}>${model}</span>` : null}
|
|
131
132
|
${n.info.classic ? html`<span class="org-chip">${to("classic")}</span>` : null}</div>` : null}
|
|
133
|
+
${n.i?.model_observation?.active ? html`<p class="note model-switch" role="status">${modelSwitchText(n.i.model_observation.active)}</p>` : null}
|
|
132
134
|
${n.i || thread ? html`<div class="org-links">
|
|
133
135
|
${thread ? html`<a class="org-link" href=${thread.url} target="_blank" rel="noopener noreferrer">
|
|
134
136
|
<${Icon} name="external" size=${14} />${to(`thread_${thread.platform}`)}<span class="sr-only"> ${to("newTab")}</span></a>` : null}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Hub rooms, Administration → Rooms (docs/design/hub-rooms-ux.md section 11): only the words the shared room vocabulary
|
|
2
|
+
// (hub-room-strings.js, namespace hubRoom) does not have. A module of its own, so a tab holding an older dictionary still
|
|
3
|
+
// has every word (upgrade skew).
|
|
4
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
5
|
+
|
|
6
|
+
register("hubAdminRooms", {
|
|
7
|
+
en: {
|
|
8
|
+
adminOnly: "Right now only Hub administrators can start rooms.",
|
|
9
|
+
colPeople: "People", colAgents: "Agents", colLast: "Last activity", colState: "Status",
|
|
10
|
+
none: "No rooms yet.",
|
|
11
|
+
rowMenu: "More for {0}",
|
|
12
|
+
saveFailed: "That was not saved. Try again.",
|
|
13
|
+
loadFailed: "Rooms could not be loaded.", retry: "Try again",
|
|
14
|
+
archiveAsk: "Archive “{0}”? The room becomes read-only; its members can still read it.",
|
|
15
|
+
joined: "You are a room manager of “{0}” now. A line in the room says so.",
|
|
16
|
+
},
|
|
17
|
+
"zh-TW": {
|
|
18
|
+
adminOnly: "目前只有 Hub 管理員可以開房間。",
|
|
19
|
+
colPeople: "人數", colAgents: "Agent 數", colLast: "最後活動", colState: "狀態",
|
|
20
|
+
none: "還沒有房間。",
|
|
21
|
+
rowMenu: "{0} 的更多動作",
|
|
22
|
+
saveFailed: "沒有儲存,請再試一次。",
|
|
23
|
+
loadFailed: "無法載入房間。", retry: "再試一次",
|
|
24
|
+
archiveAsk: "要封存「{0}」嗎?房間會變成唯讀,成員仍然看得到內容。",
|
|
25
|
+
joined: "你現在是「{0}」的房間管理,房間裡會出現一則說明。",
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
export const ha = (key, ...args) => t(`hubAdminRooms.${key}`, ...args);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Hub rooms, Administration → Rooms (docs/design/hub-rooms-ux.md section 11), for the Hub administrator:
|
|
2
|
+
// - 「誰可以開房間」: people and teams who may start rooms besides the administrators (empty: administrators only);
|
|
3
|
+
// saved as soon as it changes; everyone can always start a one-to-one chat.
|
|
4
|
+
// - 「所有房間」: every group room's name, people, agents, managers, last activity and status, never its content. Each
|
|
5
|
+
// row's menu: 加入自己成為房間管理 (the room then shows a line saying so) and 封存 (after a confirmation).
|
|
6
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
7
|
+
import { Menu } from "/assets/ui-menu.js";
|
|
8
|
+
import { confirmDialog } from "/assets/ui-confirm.js";
|
|
9
|
+
import { chatTime } from "/assets/chat-time.js";
|
|
10
|
+
import { hubClient } from "./hub-client.js";
|
|
11
|
+
import { hroom } from "./hub-room-strings.js";
|
|
12
|
+
import { ha } from "./hub-admin-rooms-strings.js";
|
|
13
|
+
import { RoomPicker } from "./hub-room-new.js";
|
|
14
|
+
import { linkRoomsU2Css } from "./hub-room-new-strings.js";
|
|
15
|
+
|
|
16
|
+
linkRoomsU2Css();
|
|
17
|
+
|
|
18
|
+
export function AdminRooms({ client = hubClient() } = {}) {
|
|
19
|
+
const [creators, setCreators] = useState(null), [rooms, setRooms] = useState(null), [failed, setFailed] = useState(false);
|
|
20
|
+
const [error, setError] = useState(""), [note, setNote] = useState(""), [busy, setBusy] = useState(false);
|
|
21
|
+
const live = useRef(true);
|
|
22
|
+
const load = async () => {
|
|
23
|
+
const [c, r] = await Promise.all([client.roomCreators(), client.adminRooms()]);
|
|
24
|
+
if (!live.current) return;
|
|
25
|
+
if (!c?.ok || !r?.ok) { setFailed(true); return; }
|
|
26
|
+
setFailed(false);
|
|
27
|
+
setCreators([...(c.people ?? []).map(x => ({ kind: "person", ...named(x) })), ...(c.teams ?? []).map(x => ({ kind: "team", ...named(x) }))]);
|
|
28
|
+
setRooms(Array.isArray(r.rooms) ? r.rooms : []);
|
|
29
|
+
};
|
|
30
|
+
useEffect(() => { live.current = true; void load(); return () => { live.current = false; }; }, [client]);
|
|
31
|
+
if (failed && !rooms) return html`<section class="hub-admin-rooms"><p class="note" role="alert">${ha("loadFailed")} <button type="button" class="btn btn-link" onClick=${() => { void load(); }}>${ha("retry")}</button></p></section>`;
|
|
32
|
+
if (!rooms || !creators) return html`<section class="hub-admin-rooms" aria-busy="true"></section>`;
|
|
33
|
+
const saveCreators = async (next) => {
|
|
34
|
+
const before = creators;
|
|
35
|
+
setCreators(next); setBusy(true); setError(""); setNote("");
|
|
36
|
+
const r = await client.saveRoomCreators({ people: next.filter(x => x.kind === "person").map(x => x.id), teams: next.filter(x => x.kind === "team").map(x => x.id) });
|
|
37
|
+
if (!live.current) return;
|
|
38
|
+
setBusy(false);
|
|
39
|
+
if (!r?.ok) { setCreators(before); setError(ha("saveFailed")); }
|
|
40
|
+
};
|
|
41
|
+
const act = async (send, after) => {
|
|
42
|
+
setBusy(true); setError(""); setNote("");
|
|
43
|
+
const r = await send();
|
|
44
|
+
if (!live.current) return;
|
|
45
|
+
setBusy(false);
|
|
46
|
+
if (!r?.ok) { setError(ha("saveFailed")); return; }
|
|
47
|
+
after?.(); void load();
|
|
48
|
+
};
|
|
49
|
+
const archive = async (room) => {
|
|
50
|
+
if (!await confirmDialog({ title: hroom("archiveRoom"), message: ha("archiveAsk", room.name), confirmLabel: hroom("archive"), danger: true })) return;
|
|
51
|
+
await act(() => client.archiveRoomAsAdmin(room.id, true));
|
|
52
|
+
};
|
|
53
|
+
return html`<section class="hub-admin-rooms">
|
|
54
|
+
${error ? html`<p class="note" role="alert">${error}</p>` : null}
|
|
55
|
+
${note ? html`<p class="note" role="status">${note}</p>` : null}
|
|
56
|
+
<section class="form hub-admin-creators"><h3>${hroom("whoCanCreate")}</h3>
|
|
57
|
+
<${RoomPicker} client=${client} id="hubRoomCreators" kinds=${["person", "team"]} label=${hroom("addPeopleOrTeams")} placeholder=${hroom("addPeopleOrTeams")}
|
|
58
|
+
picked=${creators} onChange=${(next) => { if (!busy) void saveCreators(next); }} />
|
|
59
|
+
${creators.length ? null : html`<p class="note">${ha("adminOnly")}</p>`}
|
|
60
|
+
<p class="note">${hroom("everyoneDirect")}</p>
|
|
61
|
+
</section>
|
|
62
|
+
<section class="hub-admin-all-rooms"><h3>${hroom("allRooms")}</h3>
|
|
63
|
+
<p class="note">${hroom("noContent")}</p>
|
|
64
|
+
${rooms.length ? html`<table class="hub-admin-rooms-table"><thead><tr><th>${hroom("name")}</th><th>${ha("colPeople")}</th><th>${ha("colAgents")}</th><th>${hroom("roomManager")}</th><th>${ha("colLast")}</th><th>${ha("colState")}</th><th></th></tr></thead>
|
|
65
|
+
<tbody>${rooms.map(room => html`<tr key=${room.id} data-room=${room.id}>
|
|
66
|
+
<td>${room.name}</td><td>${Number(room.people) || 0}</td><td>${Number(room.agents) || 0}</td>
|
|
67
|
+
<td>${Array.isArray(room.managers) ? room.managers.join("、") : ""}</td>
|
|
68
|
+
<td>${room.lastAt ? chatTime(room.lastAt) : ""}</td>
|
|
69
|
+
<td>${room.archived ? hroom("archived") : hroom("active")}</td>
|
|
70
|
+
<td><${Menu} label=${ha("rowMenu", room.name)} disabled=${busy} items=${[
|
|
71
|
+
{ key: "join", label: hroom("joinAsManager"), onSelect: () => { void act(() => client.joinRoomAsAdmin(room.id), () => setNote(ha("joined", room.name))); } },
|
|
72
|
+
room.archived ? null : { key: "archive", label: hroom("archive"), danger: true, onSelect: () => { void archive(room); } },
|
|
73
|
+
]} /></td></tr>`)}</tbody></table>` : html`<p class="note">${ha("none")}</p>`}
|
|
74
|
+
</section>
|
|
75
|
+
</section>`;
|
|
76
|
+
}
|
|
77
|
+
const named = (x) => typeof x === "string" ? { id: x, name: x } : { id: String(x?.id ?? ""), name: String(x?.name ?? x?.id ?? ""), ...(Number.isFinite(x?.people) ? { people: x.people } : {}) };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
2
|
+
register("hubAssistantAdmin", {
|
|
3
|
+
en: {
|
|
4
|
+
accountSignedIn: "Signed in.", accountNeedsSignIn: "Sign-in needed. Sign in under AgEnD settings on this Hub computer.",
|
|
5
|
+
accountUnknown: "Sign-in status unknown. Sign in under AgEnD settings on this Hub computer.",
|
|
6
|
+
backend: "Backend", account: "Account", defaultAccount: "Default account", unknown: "Unknown",
|
|
7
|
+
save: "Save", saved: "Saved", refresh: "Refresh", noneRunning: "No room assistants are working or idle.",
|
|
8
|
+
loadFailed: "Could not read room assistant settings. Try again.", saveFailed: "Could not save. Your changes are still here; try again.",
|
|
9
|
+
stoppedRefreshFailed: "Stopped this room assistant. Could not refresh its status; use Refresh to try again.",
|
|
10
|
+
stopFailed: "Could not stop this room assistant. Try again.", usageFailed: "Could not read usage. Try again.",
|
|
11
|
+
usageNotSaved: "Some answer counts could not be saved. The answers were still sent.", quotaPending: "Quota status not available yet",
|
|
12
|
+
starting: "Starting", stopping: "Stopping", failed: "Needs attention", day: "Date (UTC)", answers: "Answers",
|
|
13
|
+
},
|
|
14
|
+
"zh-TW": {
|
|
15
|
+
accountSignedIn: "已登入", accountNeedsSignIn: "需要登入。請在 Hub 這台電腦的 AgEnD 設定裡登入。",
|
|
16
|
+
accountUnknown: "登入狀態未知。請在 Hub 這台電腦的 AgEnD 設定裡登入。",
|
|
17
|
+
backend: "後端", account: "帳號", defaultAccount: "預設帳號", unknown: "未知",
|
|
18
|
+
save: "儲存", saved: "已儲存", refresh: "重新整理", noneRunning: "目前沒有執行中或待命的房間助理。",
|
|
19
|
+
loadFailed: "未能讀取房間助理設定,請再試一次。", saveFailed: "未能儲存,修改仍保留在這裡,請再試一次。",
|
|
20
|
+
stoppedRefreshFailed: "已停止這個房間助理,但未能更新狀態,請按「重新整理」再試一次。",
|
|
21
|
+
stopFailed: "未能停止這個房間助理,請再試一次。", usageFailed: "未能讀取用量,請再試一次。",
|
|
22
|
+
usageNotSaved: "部分回答次數未能儲存,回答仍已送出。", quotaPending: "尚未取得額度狀態",
|
|
23
|
+
starting: "啟動中", stopping: "停止中", failed: "需要處理", day: "日期(UTC)", answers: "回答次數",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
export const ha = (key, ...args) => t(`hubAssistantAdmin.${key}`, ...args);
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
2
|
+
import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
|
|
3
|
+
import { hroom } from "./hub-room-strings.js";
|
|
4
|
+
import { ha } from "./hub-assistant-admin-strings.js";
|
|
5
|
+
|
|
6
|
+
const fields = value => ({ enabled: value.enabled === true, backend: value.backend, account: value.account ?? null, cap: Number(value.cap), idleMinutes: Number(value.idleMinutes) });
|
|
7
|
+
const validLimits = value => Number.isInteger(Number(value?.cap)) && Number(value.cap) >= 1 && Number(value.cap) <= 16 && Number.isInteger(Number(value?.idleMinutes)) && Number(value.idleMinutes) >= 1 && Number(value.idleMinutes) <= 240;
|
|
8
|
+
const accountWord = row => row.state === "signed-in" ? hroom("signedIn") : row.state === "needs-sign-in" ? hroom("needsSignIn") : ha("unknown");
|
|
9
|
+
const accountHelp = row => ha(row?.state === "signed-in" ? "accountSignedIn" : row?.state === "needs-sign-in" ? "accountNeedsSignIn" : "accountUnknown");
|
|
10
|
+
const stateWord = state => state === "idle" ? hroom("stIdle") : state === "working" ? hroom("stWorking") : ha(["starting", "stopping", "failed"].includes(state) ? state : "unknown");
|
|
11
|
+
const quotaWord = band => band === "available" ? hroom("quotaPlenty") : band === "near_limit" ? hroom("quotaLow") : band === "exhausted" ? hroom("quotaGone") : ha("quotaPending");
|
|
12
|
+
|
|
13
|
+
/** Hub-only admin cards; the existing client owns same-origin session/CSRF. No Fleet endpoint is called. */
|
|
14
|
+
export function HubAssistantAdmin({ client }) {
|
|
15
|
+
const [view, setView] = useState(null), [form, setForm] = useState(null), [usage, setUsage] = useState(null);
|
|
16
|
+
const [error, setError] = useState(null), [busy, setBusy] = useState(false), [saved, setSaved] = useState(false);
|
|
17
|
+
const generation = useRef(0);
|
|
18
|
+
const load = async (replaceForm = true) => {
|
|
19
|
+
const mine = ++generation.current;
|
|
20
|
+
const results = await Promise.allSettled([Promise.resolve().then(() => client.assistantSettings()), Promise.resolve().then(() => client.assistantUsage())]);
|
|
21
|
+
const settings = results[0].status === "fulfilled" ? results[0].value : { ok: false };
|
|
22
|
+
const counts = results[1].status === "fulfilled" ? results[1].value : { ok: false };
|
|
23
|
+
if (mine !== generation.current) return;
|
|
24
|
+
if (!settings?.ok) { setError(ha("loadFailed")); return; }
|
|
25
|
+
setView(settings); setForm(value => replaceForm || value === null ? fields(settings) : value); setUsage(counts?.ok ? counts : { ok: false }); setError(null);
|
|
26
|
+
};
|
|
27
|
+
useEffect(() => { setBusy(false); setView(null); setForm(null); void load(); return () => { generation.current++; }; }, [client]);
|
|
28
|
+
const edit = patch => { setSaved(false); setForm(value => ({ ...value, ...patch })); };
|
|
29
|
+
const save = async event => {
|
|
30
|
+
event.preventDefault(); if (busy || !validLimits(form)) return;
|
|
31
|
+
setBusy(true); setError(null); setSaved(false);
|
|
32
|
+
const mine = generation.current;
|
|
33
|
+
let result;
|
|
34
|
+
try { result = await client.saveAssistantSettings(fields(form)); } catch { result = { ok: false }; }
|
|
35
|
+
if (mine !== generation.current) return;
|
|
36
|
+
setBusy(false);
|
|
37
|
+
if (!result?.ok) { setError(ha("saveFailed")); return; }
|
|
38
|
+
setView(result); setForm(fields(result)); setSaved(true);
|
|
39
|
+
};
|
|
40
|
+
const stop = async roomId => {
|
|
41
|
+
if (busy) return; setBusy(true); setError(null);
|
|
42
|
+
const mine = generation.current;
|
|
43
|
+
let result, latest;
|
|
44
|
+
try { result = await client.stopRoomAssistant(roomId); } catch { result = { ok: false }; }
|
|
45
|
+
if (result?.ok) { try { latest = await client.assistantSettings(); } catch { latest = { ok: false }; } }
|
|
46
|
+
if (mine !== generation.current) return;
|
|
47
|
+
setBusy(false);
|
|
48
|
+
if (!result?.ok) { setError(ha("stopFailed")); return; }
|
|
49
|
+
if (!latest?.ok) {
|
|
50
|
+
setView(value => ({ ...value, running: value.running.filter(row => row.roomId !== roomId) }));
|
|
51
|
+
setError(ha("stoppedRefreshFailed")); return;
|
|
52
|
+
}
|
|
53
|
+
setView(latest); // a status refresh must not discard unsaved settings
|
|
54
|
+
};
|
|
55
|
+
if (!view) return html`<section class="card" aria-label=${hroom("roomAssistant")}><h3>${hroom("roomAssistant")}</h3>${error
|
|
56
|
+
? html`<${ErrorState} message=${error} onRetry=${() => load(false)} />` : html`<${Skeleton} variant="rows" lines=${3} />`}</section>`;
|
|
57
|
+
const backends = Array.isArray(view.backends) ? view.backends : [], backend = backends.find(row => row.id === form.backend);
|
|
58
|
+
const accounts = backend?.accounts || [], selected = accounts.find(row => row.id === form.account);
|
|
59
|
+
const canEnable = accounts.some(row => row.state !== "needs-sign-in"), running = Array.isArray(view.running) ? view.running : [];
|
|
60
|
+
return html`<section class="card" aria-label=${hroom("roomAssistant")}><h3>${hroom("roomAssistant")}</h3>
|
|
61
|
+
${!view.enabled ? html`<p class="note">${hroom("assistantNotEnabled")}</p>` : null}
|
|
62
|
+
${!backends.length ? html`<${Empty} title=${hroom("assistantNotEnabled")} hint=${hroom("assistantEnableHint")} />` : null}
|
|
63
|
+
<form class="form" onSubmit=${save}>
|
|
64
|
+
<label class="s-row"><span>${hroom("enableAssistant")}</span><input class="s-ui-toggle" type="checkbox" role="switch" aria-label=${hroom("enableAssistant")} checked=${form.enabled} disabled=${busy || !canEnable && !form.enabled} onChange=${e => edit({ enabled: e.target.checked })} /></label>
|
|
65
|
+
<div class="s-group"><h4>${hroom("aiAccount")}</h4><div class="grid2">
|
|
66
|
+
<label class="field"><span>${ha("backend")}</span><select aria-label=${ha("backend")} value=${form.backend} disabled=${busy || !backends.length} onChange=${e => edit({ backend: e.target.value, account: null })}>
|
|
67
|
+
${backends.map(row => html`<option key=${row.id} value=${row.id}>${row.name}</option>`)}</select></label>
|
|
68
|
+
<label class="field"><span>${ha("account")}</span><select aria-label=${ha("account")} value=${form.account ?? ""} disabled=${busy || !accounts.length} onChange=${e => edit({ account: e.target.value || null })}>
|
|
69
|
+
${accounts.map(row => html`<option key=${row.id ?? "default"} value=${row.id ?? ""} disabled=${row.state === "needs-sign-in"}>${row.id === null ? ha("defaultAccount") : row.name} · ${accountWord(row)}</option>`)}</select></label>
|
|
70
|
+
</div><p class="note">${accountHelp(selected)}</p><p class="note">${hroom("assistantQuota")}</p></div>
|
|
71
|
+
<div class="grid2"><label class="field"><span>${hroom("cap")}</span><input aria-label=${hroom("cap")} type="number" inputmode="numeric" min="1" max="16" step="1" required value=${form.cap} disabled=${busy} onInput=${e => edit({ cap: e.target.value })} /></label>
|
|
72
|
+
<label class="field"><span>${hroom("idleMinutes")}</span><input aria-label=${hroom("idleMinutes")} type="number" inputmode="numeric" min="1" max="240" step="1" required value=${form.idleMinutes} disabled=${busy} onInput=${e => edit({ idleMinutes: e.target.value })} /></label></div>
|
|
73
|
+
${error ? html`<p class="err" role="alert">${error}</p>` : null}${saved ? html`<p class="note" role="status">${ha("saved")}</p>` : null}
|
|
74
|
+
<div class="field-row"><button type="submit" class="btn btn-primary" disabled=${busy || !validLimits(form) || form.enabled && !selected}>${ha("save")}</button></div>
|
|
75
|
+
</form>
|
|
76
|
+
</section>
|
|
77
|
+
<section class="card" aria-label=${hroom("runningNow")}><div class="hub-card-head"><h3>${hroom("runningNow")}</h3><button type="button" class="btn btn-sm btn-ghost" disabled=${busy} onClick=${() => load(false)}>${ha("refresh")}</button></div>
|
|
78
|
+
${running.length ? html`<div class="hub-rows">${running.map(row => html`<div class="s-row hub-row" key=${row.roomId}><span class="hub-row-text"><strong title=${row.roomName}>${row.roomName}</strong><small class="note">${hroom("lastUsed")} · ${new Date(row.lastUsed).toLocaleString(undefined, { dateStyle: "short", timeStyle: "short", hour12: false })}</small></span>
|
|
79
|
+
<span class=${`tag ${row.state === "failed" ? "warn" : ""}`}>${stateWord(row.state)}</span><button type="button" class="btn btn-sm" disabled=${busy || row.state === "stopping"} onClick=${() => stop(row.roomId)}>${hroom("stop")}</button></div>`)}</div>` : html`<p class="note">${ha("noneRunning")}</p>`}
|
|
80
|
+
</section>
|
|
81
|
+
<section class="card" aria-label=${hroom("usage")}><h3>${hroom("usage")}</h3><p class="note">${hroom("usageLead")}</p>
|
|
82
|
+
${usage?.ok ? html`<div class="s-row note"><span>${ha("day")}</span><span>${ha("answers")}</span></div><div class="hub-rows">${usage.days.map(row => html`<div class="s-row" key=${row.day}><time datetime=${row.day}>${new Date(`${row.day}T00:00:00Z`).toLocaleDateString(undefined, { month: "numeric", day: "numeric", timeZone: "UTC" })}</time><strong>${row.count}</strong></div>`)}</div><p>${hroom("aiAccount")} · <span class="tag">${quotaWord(usage.quota?.band)}</span></p>
|
|
83
|
+
${usage.note === "usage-not-saved" ? html`<p class="note" role="status">${ha("usageNotSaved")}</p>` : null}` : html`<${ErrorState} message=${ha("usageFailed")} onRetry=${() => load(false)} />`}
|
|
84
|
+
</section>`;
|
|
85
|
+
}
|
package/dist/ui/hub-client.js
CHANGED
|
@@ -100,6 +100,27 @@ export function hubClient() {
|
|
|
100
100
|
export function setHubClient(next) { client = next; }
|
|
101
101
|
|
|
102
102
|
/** UX checks only (the server parses and canonicalizes): an https:// origin, and a code of the shape people type. */
|
|
103
|
+
/** The session feature a Hub with rooms (seam 1) lists. */
|
|
104
|
+
export const ROOMS_FEATURE = "rooms-v1";
|
|
105
|
+
/** The live stream's events (seam 1). */
|
|
106
|
+
/**
|
|
107
|
+
* The live stream's events (seam 1, as agreed with Lumen): message.added / message.updated { roomId, message, parent?:
|
|
108
|
+
* { id, ask } } (a reply that changes its question's counts carries them), presence.changed { roomId, memberId, presence,
|
|
109
|
+
* presenceNote? }, member.changed { roomId } (joined, left, role: read the room again), room.changed { roomId, room } or
|
|
110
|
+
* { roomId, removed: true } (no longer a member: drop it), unread.changed { roomId, unread }, invitation.changed {}.
|
|
111
|
+
*/
|
|
112
|
+
export const ROOM_EVENTS = Object.freeze(["message.added", "message.updated", "presence.changed", "member.changed", "room.changed", "unread.changed", "invitation.changed"]);
|
|
113
|
+
/**
|
|
114
|
+
* Today's room (one asker, one agent; GET /hub/v1/rooms before ROOMS_FEATURE) in the rooms list's shape: a direct room
|
|
115
|
+
* named after its agent, the old item kept under `legacy` (its state, its agent's state, its grant's end, its features),
|
|
116
|
+
* and `limited: true`: that Hub has no members, presence or unread, so the page leaves those controls out.
|
|
117
|
+
*/
|
|
118
|
+
export function legacyRoom(item) {
|
|
119
|
+
if (!item || typeof item !== "object" || typeof item.id !== "string") return null;
|
|
120
|
+
return { id: item.id, kind: "direct", name: String(item.exposureName || ""), people: 1, agents: 1, online: null, unread: 0,
|
|
121
|
+
lastAt: Number.isFinite(item.lastAt) ? item.lastAt : 0, lastText: "", lastAuthor: "",
|
|
122
|
+
agent: { exposureId: String(item.exposureId || ""), owner: { name: String(item.ownerName || "") }, presence: null }, limited: true, legacy: item };
|
|
123
|
+
}
|
|
103
124
|
export const ADDRESS_HINT = /^https:\/\/[^\s/?#@]+\/?$/i;
|
|
104
125
|
export const CODE_HINT = /^[A-Za-z0-9][A-Za-z0-9 -]{4,62}[A-Za-z0-9]$/;
|
|
105
126
|
/** The part of a fingerprint people compare: its first 32 hex digits (128 bits) in 8 groups of 4. */
|
|
@@ -207,7 +228,7 @@ export function createStubClient({ now = () => Date.now(), agents = () => [] } =
|
|
|
207
228
|
export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTimeoutMs = 120_000 } = {}) {
|
|
208
229
|
// The factory override is for owned transports/rehearsals; the page uses the finite default.
|
|
209
230
|
const readBudget = Number.isInteger(readTimeoutMs) && readTimeoutMs > 0 && readTimeoutMs <= 300_000 ? readTimeoutMs : 120_000;
|
|
210
|
-
let csrf = null, codeNotices = false, generation = 0;
|
|
231
|
+
let csrf = null, codeNotices = false, roomsLive = false, generation = 0;
|
|
211
232
|
const ended = new Set(), pendingReads = new Map(), waits = new Set(), readControllers = new Set();
|
|
212
233
|
let readTail = Promise.resolve();
|
|
213
234
|
const retired = () => ({ ok: false, status: 401, code: "unauthenticated" });
|
|
@@ -277,20 +298,68 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTime
|
|
|
277
298
|
let json = null;
|
|
278
299
|
try { json = await r.json(); } catch { json = null; }
|
|
279
300
|
if (method === "GET" && signal?.aborted) return unreachable();
|
|
280
|
-
if (r.status === 401 && mine === generation) { retireReads(); csrf = null; codeNotices = false; for (const fn of ended) { try { fn(); } catch { /* a listener's own failure */ } } }
|
|
301
|
+
if (r.status === 401 && mine === generation) { retireReads(); csrf = null; codeNotices = false; roomsLive = false; for (const fn of ended) { try { fn(); } catch { /* a listener's own failure */ } } }
|
|
281
302
|
if (!r.ok) return { ok: false, status: r.status, code: (json && typeof json.code === "string" && json.code) || "failed", retryAfter: Number(r.headers.get("Retry-After")) || 0,
|
|
282
303
|
...(method === "POST" && path === "/hub/v1/admin/enrolment-codes" && r.status === 429 && json?.code === "backpressure"
|
|
283
|
-
&& ["live-code-limit", "hourly-code-limit"].includes(json.reason) ? { reason: json.reason } : {}) };
|
|
304
|
+
&& ["live-code-limit", "hourly-code-limit"].includes(json.reason) ? { reason: json.reason } : {}), ...roomRefusal(json) };
|
|
284
305
|
return { ok: true, ...(json && typeof json === "object" ? json : {}) };
|
|
285
306
|
}
|
|
286
307
|
const id = (v) => encodeURIComponent(String(v));
|
|
308
|
+
// Track U2: a refused room write says what the person is told — 409 people-limit the room's would-be head count (the
|
|
309
|
+
// deduplicated union, the creator and current members included) and the limit; 503 group-unavailable which group.
|
|
310
|
+
const roomRefusal = (json) => json?.code === "people-limit" && Number.isSafeInteger(json.people)
|
|
311
|
+
? { people: json.people, limit: Number.isSafeInteger(json.limit) ? json.limit : 100 }
|
|
312
|
+
: json?.code === "group-unavailable" && typeof json.group === "string" ? { group: json.group } : {};
|
|
313
|
+
// One stream per tab (#1580): every live subscription shares one EventSource. A Hub with rooms carries the notices on
|
|
314
|
+
// its rooms stream too (`notices` = the notice version); before that the notices have their own. Listeners are kept
|
|
315
|
+
// per event name; the stream closes with its last listener, and a refused (CLOSED) stream tells every subscriber once.
|
|
316
|
+
// One dispatcher per event name per source, added when the name first listens and kept while that source lives (with no
|
|
317
|
+
// listeners it reads an empty set), so a name that listens again while the stream stays open is heard once (Fable on #3848).
|
|
318
|
+
const stream = { source: null, url: "", listeners: new Map(), dispatchers: new Map(), closers: new Set() };
|
|
319
|
+
const attach = (name) => { if (stream.source && !stream.dispatchers.has(name)) { const fn = dispatch(name); stream.dispatchers.set(name, fn); stream.source.addEventListener(name, fn); } };
|
|
320
|
+
const dispatch = (name) => (event) => {
|
|
321
|
+
let data; try { data = JSON.parse(event.data); } catch { return; }
|
|
322
|
+
for (const fn of [...(stream.listeners.get(name) || [])]) { try { fn(data); } catch { /* a listener's own failure */ } }
|
|
323
|
+
};
|
|
324
|
+
function listen(url, handlers, onClosed) {
|
|
325
|
+
if (typeof EventSource === "undefined") return () => {};
|
|
326
|
+
if (stream.source && stream.url !== url) { stream.source.close(); stream.source = null; stream.dispatchers.clear(); } // the session changed what it may hear
|
|
327
|
+
const mine = [];
|
|
328
|
+
for (const [name, fn] of Object.entries(handlers)) {
|
|
329
|
+
if (typeof fn !== "function") continue;
|
|
330
|
+
if (!stream.listeners.has(name)) stream.listeners.set(name, new Set());
|
|
331
|
+
attach(name);
|
|
332
|
+
stream.listeners.get(name).add(fn); mine.push([name, fn]);
|
|
333
|
+
}
|
|
334
|
+
stream.closers.add(onClosed);
|
|
335
|
+
if (!stream.source) {
|
|
336
|
+
const source = new EventSource(url); stream.source = source; stream.url = url; stream.dispatchers.clear();
|
|
337
|
+
for (const name of stream.listeners.keys()) attach(name);
|
|
338
|
+
source.addEventListener("error", () => {
|
|
339
|
+
// A refused handshake is CLOSED, unlike a transient disconnect that EventSource itself reconnects.
|
|
340
|
+
if (stream.source !== source || source.readyState !== 2) return;
|
|
341
|
+
source.close(); stream.source = null; stream.listeners.clear(); stream.dispatchers.clear();
|
|
342
|
+
const closers = [...stream.closers]; stream.closers.clear();
|
|
343
|
+
for (const fn of closers) { try { fn(); } catch { /* a subscriber's own failure */ } }
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
let live = true;
|
|
347
|
+
return () => {
|
|
348
|
+
if (!live) return; live = false;
|
|
349
|
+
for (const [name, fn] of mine) { const set = stream.listeners.get(name); set?.delete(fn); if (set && !set.size) stream.listeners.delete(name); }
|
|
350
|
+
stream.closers.delete(onClosed);
|
|
351
|
+
if (!stream.listeners.size && stream.source) { stream.source.close(); stream.source = null; stream.dispatchers.clear(); }
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
const noticeVersion = (version) => version === 3 && codeNotices ? 3 : 2;
|
|
355
|
+
const streamUrl = (version) => roomsLive ? `/hub/v1/rooms/events?notices=${noticeVersion(version)}` : `/hub/v1/notices/events?v=${noticeVersion(version)}`;
|
|
287
356
|
return {
|
|
288
357
|
stub: false, web: true,
|
|
289
358
|
/** Hear the session end (a 401 anywhere). @returns {() => void} */
|
|
290
359
|
onSignedOut(fn) { ended.add(fn); return () => ended.delete(fn); },
|
|
291
|
-
async session() { const r = await call("GET", "/hub/v1/session"); if (r.ok) { csrf = r.signedIn ? r.csrf || null : null; codeNotices = r.signedIn === true && r.features?.includes("enrolment-code-v1") === true; } return r; },
|
|
292
|
-
async signIn(login, password) { retireReads(); const r = await call("POST", "/hub/v1/session", { login, password }); if (r.ok) { csrf = r.csrf || null; codeNotices = r.features?.includes("enrolment-code-v1") === true; } return r; },
|
|
293
|
-
async signOut() { retireReads(); const r = await call("DELETE", "/hub/v1/session"); csrf = null; codeNotices = false; return r; },
|
|
360
|
+
async session() { const r = await call("GET", "/hub/v1/session"); if (r.ok) { csrf = r.signedIn ? r.csrf || null : null; codeNotices = r.signedIn === true && r.features?.includes("enrolment-code-v1") === true; roomsLive = r.signedIn === true && r.features?.includes(ROOMS_FEATURE) === true; } return r; },
|
|
361
|
+
async signIn(login, password) { retireReads(); const r = await call("POST", "/hub/v1/session", { login, password }); if (r.ok) { csrf = r.csrf || null; codeNotices = r.features?.includes("enrolment-code-v1") === true; roomsLive = r.features?.includes(ROOMS_FEATURE) === true; } return r; },
|
|
362
|
+
async signOut() { retireReads(); const r = await call("DELETE", "/hub/v1/session"); csrf = null; codeNotices = false; roomsLive = false; return r; },
|
|
294
363
|
catalog() { return call("GET", "/hub/v1/exposures"); },
|
|
295
364
|
sharingPauseV1: true,
|
|
296
365
|
sharing(exposureId, revision, sharingEpoch, paused) { return call("POST", `/hub/v1/exposures/${id(exposureId)}/sharing`, { revision, sharingEpoch, paused }); },
|
|
@@ -329,6 +398,94 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTime
|
|
|
329
398
|
},
|
|
330
399
|
read(roomId, after = 0) { return call("GET", `/hub/v1/rooms/${id(roomId)}/messages?after=${id(after)}`); },
|
|
331
400
|
chooseButtons(roomId, input) { return call("POST", `/hub/v1/rooms/${id(roomId)}/buttons`, input); },
|
|
401
|
+
// Hub rooms (docs/design/hub-rooms-split.md, seams 1, 3 and 5). The Hub speaks them once its session lists
|
|
402
|
+
// ROOMS_FEATURE; before that it has today's rooms (one asker, one agent), which roomList() still answers in the same
|
|
403
|
+
// shape (kind "direct", the old item under `legacy`), and whose messages stay with hub-chat-store.js.
|
|
404
|
+
roomsV1: true,
|
|
405
|
+
/** The Hub answers the rooms calls (seam 1) — otherwise only roomList() is meaningful. */
|
|
406
|
+
roomsLive() { return roomsLive; },
|
|
407
|
+
/**
|
|
408
|
+
* → { ok, rooms: [{ id, kind: "direct" | "group", name, people, agents, online, unread, lastAt, lastText, lastAuthor }] }.
|
|
409
|
+
* `?v=2` (Ridge, #3858): the combined list; GET /hub/v1/rooms itself stays direct-only for older cached tabs, and a
|
|
410
|
+
* server without rooms ignores the parameter (its answer is then normalised here).
|
|
411
|
+
*/
|
|
412
|
+
async roomList() {
|
|
413
|
+
const r = await call("GET", "/hub/v1/rooms?v=2");
|
|
414
|
+
if (!r.ok || roomsLive) return r;
|
|
415
|
+
return { ...r, rooms: (Array.isArray(r.rooms) ? r.rooms : []).map(legacyRoom).filter(Boolean) };
|
|
416
|
+
},
|
|
417
|
+
/** → { ok, room, me: { role }, members: [Member], settings: { allMention, historyForNew } } */
|
|
418
|
+
room(roomId) { return call("GET", `/hub/v1/rooms/${id(roomId)}`); },
|
|
419
|
+
/** A group room: { name, people: [personId], teams: [teamId], groups: [groupId], agents: [exposureId], assistant }. */
|
|
420
|
+
createRoom(input) { return call("POST", "/hub/v1/rooms", input); },
|
|
421
|
+
/** { name?, allMention?, historyForNew?, assistant?, archived? } */
|
|
422
|
+
updateRoom(roomId, patch) { return call("PATCH", `/hub/v1/rooms/${id(roomId)}`, patch); },
|
|
423
|
+
/** One member: { kind: "person" | "team" | "group" | "agent" | "assistant", id? } (the assistant has no id). */
|
|
424
|
+
addRoomMember(roomId, member) { return call("POST", `/hub/v1/rooms/${id(roomId)}/members`, member); },
|
|
425
|
+
removeRoomMember(roomId, memberId) { return call("DELETE", `/hub/v1/rooms/${id(roomId)}/members/${id(memberId)}`); },
|
|
426
|
+
/** A page of Message, newest last: the latest `limit`, or those before the message `before`. */
|
|
427
|
+
roomMessages(roomId, { before, limit } = {}) {
|
|
428
|
+
const q = new URLSearchParams();
|
|
429
|
+
if (before) q.set("before", String(before));
|
|
430
|
+
if (Number.isSafeInteger(limit) && limit > 0) q.set("limit", String(limit));
|
|
431
|
+
const query = q.toString();
|
|
432
|
+
return call("GET", `/hub/v1/rooms/${id(roomId)}/messages${query ? `?${query}` : ""}`);
|
|
433
|
+
},
|
|
434
|
+
/** { text, mentions: ["all" | "assistant" | exposureId], replyTo?, files?: [fileId], idempotencyKey } → the stored Message. */
|
|
435
|
+
sendRoomMessage(roomId, { text, mentions = [], replyTo, files, idempotencyKey }) {
|
|
436
|
+
return call("POST", `/hub/v1/rooms/${id(roomId)}/messages`, { text, mentions, idempotencyKey,
|
|
437
|
+
...(replyTo ? { replyTo } : {}), ...(Array.isArray(files) && files.length ? { files } : {}) });
|
|
438
|
+
},
|
|
439
|
+
markRoomRead(roomId, upTo) { return call("POST", `/hub/v1/rooms/${id(roomId)}/read`, { upTo }); },
|
|
440
|
+
/**
|
|
441
|
+
* The one live stream of everything this person may see (seam 1): `handlers[name](data)` for each of ROOM_EVENTS,
|
|
442
|
+
* on the tab's one stream (which also carries the notices). A refused stream (CLOSED) calls onClosed once; a
|
|
443
|
+
* transient drop reconnects by itself. → unsubscribe.
|
|
444
|
+
*/
|
|
445
|
+
subscribeRooms(handlers = {}, onClosed = () => {}) {
|
|
446
|
+
if (!roomsLive) return () => {};
|
|
447
|
+
const mine = {};
|
|
448
|
+
for (const name of ROOM_EVENTS) if (typeof handlers[name] === "function") mine[name] = (data) => { if (data && typeof data === "object") handlers[name](data); };
|
|
449
|
+
return listen(streamUrl(codeNotices ? 3 : 2), mine, onClosed);
|
|
450
|
+
},
|
|
451
|
+
// Seam 3: agents enter a room by their owner's consent.
|
|
452
|
+
inviteToRoom(roomId, input) { return call("POST", `/hub/v1/rooms/${id(roomId)}/invitations`, input); },
|
|
453
|
+
invitations() { return call("GET", "/hub/v1/invitations"); },
|
|
454
|
+
acceptInvitation(invitationId) { return call("POST", `/hub/v1/invitations/${id(invitationId)}/accept`, {}); },
|
|
455
|
+
declineInvitation(invitationId) { return call("POST", `/hub/v1/invitations/${id(invitationId)}/decline`, {}); },
|
|
456
|
+
// Seam 5: teams, who may open rooms, and the administrator's list of rooms (names and members, no content).
|
|
457
|
+
teams() { return call("GET", "/hub/v1/teams"); },
|
|
458
|
+
team(teamId) { return call("GET", `/hub/v1/teams/${id(teamId)}`); },
|
|
459
|
+
createTeam(input) { return call("POST", "/hub/v1/teams", input); },
|
|
460
|
+
updateTeam(teamId, patch) { return call("PATCH", `/hub/v1/teams/${id(teamId)}`, patch); },
|
|
461
|
+
deleteTeam(teamId) { return call("DELETE", `/hub/v1/teams/${id(teamId)}`); },
|
|
462
|
+
roomCreators() { return call("GET", "/hub/v1/admin/rooms/creators"); },
|
|
463
|
+
saveRoomCreators(input) { return call("PUT", "/hub/v1/admin/rooms/creators", input); },
|
|
464
|
+
adminRooms() { return call("GET", "/hub/v1/admin/rooms"); },
|
|
465
|
+
// Track U2 (dev-claude2): pickers, roles, invitations, leave, the agent's rooms, admin rooms.
|
|
466
|
+
// Leaving is removeRoomMember(roomId, <my id>) (409 last-manager); `me.assistant` comes with roomList()'s answer.
|
|
467
|
+
/** The new-room and add-member pickers → { ok, candidates: [{ kind: "person" | "team" | "group" | "agent", id, name, people?, owner?: { name }, mine? }] }. */
|
|
468
|
+
roomCandidates(q, kind, signal) {
|
|
469
|
+
const s = new URLSearchParams({ q: String(q ?? "") });
|
|
470
|
+
if (kind) s.set("kind", kind);
|
|
471
|
+
return call("GET", `/hub/v1/rooms/candidates?${s}`, undefined, signal);
|
|
472
|
+
},
|
|
473
|
+
/**
|
|
474
|
+
* A chosen AD group's label and head count → { ok, kind: "group", id, name, people } (its direct members now, nested
|
|
475
|
+
* groups not followed; creating the room or adding the group reads the list again). 503 group-unavailable when the
|
|
476
|
+
* directory cannot read the whole list.
|
|
477
|
+
*/
|
|
478
|
+
roomGroup(groupId) { return call("GET", `/hub/v1/rooms/candidates/group/${id(groupId)}`); },
|
|
479
|
+
/** 設為房間管理 / 改為成員. */
|
|
480
|
+
setRoomMemberRole(roomId, memberId, role) { return call("PATCH", `/hub/v1/rooms/${id(roomId)}/members/${id(memberId)}`, { role }); },
|
|
481
|
+
/** A room manager withdraws a pending (or clears an expired) invitation; 重新邀請 is a new inviteToRoom(). */
|
|
482
|
+
cancelRoomInvitation(roomId, invitationId) { return call("DELETE", `/hub/v1/rooms/${id(roomId)}/invitations/${id(invitationId)}`); },
|
|
483
|
+
/** The rooms one of my shared agents is in → { ok, rooms: [{ id, name, people, memberId }] }; 退出這個房間 is removeRoomMember(id, memberId). */
|
|
484
|
+
agentRooms(exposureId) { return call("GET", `/hub/v1/exposures/${id(exposureId)}/rooms`); },
|
|
485
|
+
/** 管理 → 房間: 加入自己成為房間管理 (the room gets a system line). */
|
|
486
|
+
joinRoomAsAdmin(roomId) { return call("POST", `/hub/v1/admin/rooms/${id(roomId)}/join`, {}); },
|
|
487
|
+
/** 管理 → 房間: 封存. */
|
|
488
|
+
archiveRoomAsAdmin(roomId, archived = true) { return call("PATCH", `/hub/v1/admin/rooms/${id(roomId)}`, { archived }); },
|
|
332
489
|
pairings() { return call("GET", "/hub/v1/pairings"); },
|
|
333
490
|
quickPairingV1: true,
|
|
334
491
|
createQuickPairing(label) { return call("POST", "/hub/v1/quick-pairing", { label }); },
|
|
@@ -349,14 +506,7 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTime
|
|
|
349
506
|
pairingNoticeSnapshotV1: typeof EventSource !== "undefined",
|
|
350
507
|
acknowledgePairingNotice(noticeId) { return call("POST", `/hub/v1/notices/${id(noticeId)}/ack`); },
|
|
351
508
|
subscribePairingNotices(fn, onClosed = () => {}, version = 2) {
|
|
352
|
-
|
|
353
|
-
const events = new EventSource(`/hub/v1/notices/events?v=${version === 3 && codeNotices ? 3 : 2}`); let live = true;
|
|
354
|
-
events.addEventListener("notices", (event) => { if (!live) return; try { const value = JSON.parse(event.data); if (Array.isArray(value.notices)) fn(value.notices); } catch { /* bounded server DTO only */ } });
|
|
355
|
-
events.addEventListener("error", () => {
|
|
356
|
-
// A refused handshake is CLOSED, unlike a transient disconnect that EventSource itself reconnects.
|
|
357
|
-
if (live && events.readyState === 2) { live = false; events.close(); onClosed(); }
|
|
358
|
-
});
|
|
359
|
-
return () => { live = false; events.close(); };
|
|
509
|
+
return listen(streamUrl(version), { notices: (value) => { if (value && Array.isArray(value.notices)) fn(value.notices); } }, onClosed);
|
|
360
510
|
},
|
|
361
511
|
confirmPairing(pairingId, fingerprint) { return call("POST", `/hub/v1/pairings/${id(pairingId)}/confirm`, { fingerprint }); },
|
|
362
512
|
companyJoinSettings() { return call("GET", "/hub/v1/admin/company-join"); },
|
|
@@ -402,6 +552,12 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTime
|
|
|
402
552
|
fetchDirectoryCa(input, signal) { return call("POST", "/hub/v1/admin/hub/directory/ca/fetch", input, signal); },
|
|
403
553
|
/** This client has the group permissions calls (a cached older client does not: the pages then hide them). */
|
|
404
554
|
groupPolicyV1: true,
|
|
555
|
+
// Track A (Sentinel): the room assistant's admin page.
|
|
556
|
+
assistantAdminV1: true,
|
|
557
|
+
assistantSettings() { return call("GET", "/hub/v1/admin/assistant"); },
|
|
558
|
+
saveAssistantSettings(input) { return call("PUT", "/hub/v1/admin/assistant", input); },
|
|
559
|
+
assistantUsage() { return call("GET", "/hub/v1/admin/assistant/usage"); },
|
|
560
|
+
stopRoomAssistant(roomId) { return call("POST", `/hub/v1/admin/assistant/rooms/${id(roomId)}/stop`); },
|
|
405
561
|
};
|
|
406
562
|
}
|
|
407
563
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Hub rooms, invitations on the owner's side (docs/design/hub-rooms-ux.md section 8): only the words the shared room
|
|
2
|
+
// vocabulary (hub-room-strings.js, namespace hubRoom) does not have. A module of its own, so a tab holding an older
|
|
3
|
+
// dictionary still has every word (upgrade skew).
|
|
4
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
5
|
+
|
|
6
|
+
register("hubInvitations", {
|
|
7
|
+
en: {
|
|
8
|
+
leadOne: "The 1 person in the room can @ it there; everyone in the room sees its answers.",
|
|
9
|
+
gone: "This invitation is no longer open.",
|
|
10
|
+
failed: "That did not go through. Try again.",
|
|
11
|
+
loadFailed: "Invitations could not be loaded.",
|
|
12
|
+
retry: "Try again",
|
|
13
|
+
roomPeople: "{0} · {1} people",
|
|
14
|
+
leaveFailed: "It did not leave the room. Try again.",
|
|
15
|
+
readsRecent: "When @-ed, it reads the room's recent messages.",
|
|
16
|
+
invitations: "Invitations",
|
|
17
|
+
},
|
|
18
|
+
"zh-TW": {
|
|
19
|
+
leadOne: "房間裡的 1 個人可以在那裡 @ 它;它的回答房間裡的人都看得到。",
|
|
20
|
+
gone: "這個邀請已經不在了。",
|
|
21
|
+
failed: "沒有送出,請再試一次。",
|
|
22
|
+
loadFailed: "無法載入邀請。",
|
|
23
|
+
retry: "再試一次",
|
|
24
|
+
roomPeople: "{0} · {1} 人",
|
|
25
|
+
leaveFailed: "沒有退出房間,請再試一次。",
|
|
26
|
+
readsRecent: "被 @ 時,它會讀到房間最近的訊息。",
|
|
27
|
+
invitations: "邀請",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export const hi = (key, ...args) => t(`hubInvitations.${key}`, ...args);
|