@songsid/agend 2.4.0-alpha.3 → 2.4.0-beta.1
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 +8 -8
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/auth-api.js +8 -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/credential-profiles/SKILL.md +8 -2
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +5 -3
- package/dist/general-knowledge/skills/hub/SKILL.md +203 -10
- 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.d.ts +1 -1
- package/dist/hub/catalog.js +55 -12
- 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 +12 -1
- package/dist/hub/compose/server.js +74 -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/grant-access.js +23 -3
- package/dist/hub/grant-access.js.map +1 -1
- package/dist/hub/grant-search.js +13 -1
- package/dist/hub/grant-search.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/impact-inventory.js +18 -2
- package/dist/hub/group-policy/impact-inventory.js.map +1 -1
- 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 +482 -15
- 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 +20 -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/store.d.ts +5 -0
- package/dist/hub/join/store.js +12 -2
- package/dist/hub/join/store.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 +320 -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 +79 -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 +22 -0
- package/dist/hub/settings-member-address-policy.js +36 -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/settings-web-address-decision.js +3 -1
- package/dist/hub/settings-web-address-decision.js.map +1 -1
- package/dist/hub/settings-web-address-http.js +3 -2
- package/dist/hub/settings-web-address-http.js.map +1 -1
- package/dist/hub/settings-web-address-policy.d.ts +3 -2
- package/dist/hub/settings-web-address-policy.js +3 -1
- package/dist/hub/settings-web-address-policy.js.map +1 -1
- 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/grant-schema.d.ts +2 -0
- package/dist/hub/teams/grant-schema.js +13 -0
- package/dist/hub/teams/grant-schema.js.map +1 -0
- package/dist/hub/teams/index.d.ts +7 -0
- package/dist/hub/teams/index.js +273 -0
- package/dist/hub/teams/index.js.map +1 -0
- package/dist/hub/teams/store.d.ts +34 -0
- package/dist/hub/teams/store.js +57 -0
- package/dist/hub/teams/store.js.map +1 -0
- package/dist/hub/teams/types.d.ts +98 -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 +54 -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 +16 -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 +178 -14
- package/dist/ui/hub-grant-picker.js +14 -5
- package/dist/ui/hub-group-strings.js +3 -3
- 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 +123 -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 +224 -0
- package/dist/ui/hub-room-thread.js +288 -0
- package/dist/ui/hub-room-unread.js +51 -0
- package/dist/ui/hub-room-working.js +29 -0
- package/dist/ui/hub-strings.js +2 -0
- package/dist/ui/hub-teams-strings.js +34 -0
- package/dist/ui/hub-teams.js +169 -0
- package/dist/ui/log-row.js +14 -5
- package/dist/ui/panel-details.js +6 -1
- package/dist/ui/panel-hub.js +115 -57
- 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 +220 -0
- package/dist/ui/settings-hub-section.js +4 -2
- package/dist/ui/settings-hub-web-address.js +21 -5
- package/dist/ui/settings-hub.js +10 -4
- package/dist/ui/settings-layout.js +5 -1
- 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 +7 -4
- package/dist/ui/shared/app.css +8 -0
- package/dist/ui/shared/chat-render.js +10 -0
- package/dist/ui/shared/chat-thread.js +15 -5
- package/dist/ui/shared/hub-chat.css +22 -0
- package/dist/ui/shared/hub-rooms-u2.css +42 -0
- package/dist/ui/shared/hub-signin.css +2 -0
- package/dist/ui/shared/hub-teams.css +31 -0
- package/dist/ui/shared/model-observation.js +16 -0
- package/dist/ui/shared/page-head.js +3 -2
- package/dist/ui/shared/stale-tab.css +6 -0
- package/dist/ui/shared/stale-tab.js +50 -0
- package/dist/ui/shared/usage-dialog.js +2 -1
- package/dist/ui/shared/view-strings.js +2 -0
- package/dist/usage/agent-output.js +1 -0
- package/dist/usage/agent-output.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/i18n.d.ts +1 -1
- package/dist/usage/i18n.js +2 -1
- package/dist/usage/i18n.js.map +1 -1
- package/dist/usage/providers.d.ts +4 -1
- package/dist/usage/providers.js +25 -10
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.d.ts +1 -1
- package/dist/usage/usage-api.js +4 -4
- package/dist/usage/usage-api.js.map +1 -1
- 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
package/dist/ui/log-row.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { modelSwitchText, modelName, observationLabel } from "/assets/model-observation.js";
|
|
1
2
|
// AGEND-181: one step of an instance's work as a row — shared by the Log tab (panel-log.js) and the chat's activity
|
|
2
3
|
// timeline (chat-activity.js), so a step looks and behaves the same in both: its icon, words, status, and its arguments
|
|
3
4
|
// and output on demand. Masking and cutting are the server's (log-steps.ts); this only shows what it is given.
|
|
@@ -157,9 +158,16 @@ export function mergeSteps(list, incoming, older = false) {
|
|
|
157
158
|
// category and start time stay; the outcome is the newer read's.
|
|
158
159
|
// Prism #3709 R5: a read that saw only a call's result has no turn evidence (`turn: ""`) — it never erases the turn the
|
|
159
160
|
// call already gave (a fresh parser per cursor range), so a poll-by-poll Log groups exactly as a cold read does.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
// A result with no call (`tool: ""`) is not proof of anything about a step the page already holds as finished: codex runs a
|
|
162
|
+
// tool through an `exec` script call, and the item that did the work takes the call's step over (done / failed, with its
|
|
163
|
+
// own output); the script's own, later output — read by a poll that cannot see the call — is not the action's outcome.
|
|
164
|
+
// It completes a call still running, and never rewrites an outcome (a failed command stays failed, with its body).
|
|
165
|
+
const orphan = s.kind === "tool" && !s.tool && next[i].tool;
|
|
166
|
+
if (!older) next[i] = orphan && (next[i].status === "done" || next[i].status === "failed")
|
|
167
|
+
? { ...next[i], ...kept(s.turn, next[i].turn) }
|
|
168
|
+
: orphan
|
|
169
|
+
? { ...next[i], ...s, tool: next[i].tool, cat: next[i].cat, ts: next[i].ts, ...kept(s.turn, next[i].turn) }
|
|
170
|
+
: { ...next[i], ...s, ...kept(s.turn, next[i].turn) };
|
|
163
171
|
else if (next[i].kind === "tool" && !next[i].tool && s.tool) {
|
|
164
172
|
const { tool, cat, subject, input, ts } = s;
|
|
165
173
|
next[i] = { ...next[i], tool, cat, ...(subject !== undefined ? { subject } : {}), ...(input !== undefined ? { input } : {}), ...(ts ? { ts } : {}), ...kept(next[i].turn, s.turn) };
|
|
@@ -294,7 +302,7 @@ export function LogRow({ x, prev, paths, chat, compact, latest }) {
|
|
|
294
302
|
${x.screen && open ? html`<div class="log-detail"><div class="log-text mono log-screen">${x.screen}</div></div>` : null}`;
|
|
295
303
|
} else if (x.kind === "user" || x.kind === "assistant") {
|
|
296
304
|
// In the chat's timeline an assistant line is what the agent said on the way (its replies are the bubbles): "Said".
|
|
297
|
-
row = html`${head(KIND_ICON[x.kind], x.kind === "assistant" && chat ? tl("said") : tl(x.kind))}${text(x.body, x.bodyCut)}`;
|
|
305
|
+
row = html`${head(KIND_ICON[x.kind], x.kind === "assistant" && chat ? tl("said") : tl(x.kind))}${x.servedModel ? text(`${observationLabel("served")}: ${modelName(x.servedModel)}`) : null}${text(x.body, x.bodyCut)}`;
|
|
298
306
|
} else if (x.kind === "thinking") {
|
|
299
307
|
// AGEND-181: the model's thinking (admin only; the server sends it only then): folded to its start, opened on demand.
|
|
300
308
|
const body = x.body || "";
|
|
@@ -309,7 +317,8 @@ export function LogRow({ x, prev, paths, chat, compact, latest }) {
|
|
|
309
317
|
row = head(KIND_ICON.turn_end, x.durationMs ? tl("turnEndIn", duration(x.durationMs)) : tl("turnEnd"),
|
|
310
318
|
x.status && x.status !== "done" ? html`<span class=${`log-status ${x.status}`}>${tl(x.status)}</span>` : null);
|
|
311
319
|
} else if (x.kind === "state") {
|
|
312
|
-
row = head(KIND_ICON.state,
|
|
320
|
+
row = x.modelSwitch ? html`${head(KIND_ICON.state, observationLabel("title"))}${text(modelSwitchText(x.modelSwitch))}`
|
|
321
|
+
: head(KIND_ICON.state, x.note === "compacted" ? tl("compacted") : x.note || "");
|
|
313
322
|
} else {
|
|
314
323
|
const cat = x.cat || "other";
|
|
315
324
|
const subject = cat === "plan" && x.subject ? tl("plan_items", x.subject) : short(x.subject || "");
|
package/dist/ui/panel-details.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NativePaneRecovery } from "./native-pane-recovery.js";
|
|
2
|
+
import { modelSwitchText, modelName, observationLabel } from "/assets/model-observation.js";
|
|
2
3
|
// #1523 N2 (§3.3, Q1 = B): Details — "the Fleet side of one instance", at /ui/fleet/agent/<name>. Behind the session
|
|
3
4
|
// gate (/ui/js/). What it holds:
|
|
4
5
|
// - runtime and recent activity (what Chat's details dialog showed, now a page);
|
|
@@ -60,6 +61,7 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
|
|
|
60
61
|
// #1629 r4 §1: the identity card at the top, read when the status frame's card_v moves.
|
|
61
62
|
const card = useCard(name, inst.card_v);
|
|
62
63
|
const [d, setD] = useState(null);
|
|
64
|
+
const observed = Object.prototype.hasOwnProperty.call(inst, "model_observation") ? inst.model_observation : d?.model_observation;
|
|
63
65
|
const [failed, setFailed] = useState(false);
|
|
64
66
|
const [busy, setBusy] = useState("");
|
|
65
67
|
const body = useRef(null);
|
|
@@ -162,7 +164,10 @@ function DetailsView({ name, inst, navKey, exec, awaiting }) {
|
|
|
162
164
|
${row(t("chat.dTags"), Array.isArray(d.tags) && d.tags.length ? html`<span class="d-tags">${d.tags.map((x) => html`<span key=${x} class="tag">${x}</span>`)}</span>` : "--")}</section>
|
|
163
165
|
<section class="card"><h3>${t("chat.dRuntime")}</h3>
|
|
164
166
|
${row(t("chat.dBackend"), d.backend || "--")}
|
|
165
|
-
${row(t("chat.dModel"), `${(d.model && modelText(d)) || sl.model?.display_name || "--"}${d.model_source === "live" ? "" : src(d.model_source)}`)}
|
|
167
|
+
${row(observed ? observationLabel("selection") : t("chat.dModel"), observed ? modelName(observed.session) || observationLabel("unresolved") : `${(d.model && modelText(d)) || sl.model?.display_name || "--"}${d.model_source === "live" ? "" : src(d.model_source)}`)}
|
|
168
|
+
${observed ? html`${row(observationLabel("configured"), modelName(observed.configured) || observationLabel("unresolved"))}
|
|
169
|
+
${row(observationLabel("served"), modelName(observed.lastServed) || observationLabel("unresolved"))}
|
|
170
|
+
${observed.active ? html`<p class="note model-switch" role="status">${modelSwitchText(observed.active)}</p>` : null}` : null}
|
|
166
171
|
${d.effort ? row(t("chat.dEffort"), `${d.effort}${src(d.effort_source)}`) : null}
|
|
167
172
|
${row(t("chat.dCost"), `$${cost.toFixed(2)} ${t("chat.dCostNote")}`)}
|
|
168
173
|
${row(t("chat.dContext"), html`<span class="pct">${ctx != null ? `${Math.round(ctx)}%` : "--"}</span>${ctx != null ? bar(ctx, ctx > 80 ? "warn" : "") : null}`)}
|
package/dist/ui/panel-hub.js
CHANGED
|
@@ -34,7 +34,12 @@ import "/assets/chat-strings.js";
|
|
|
34
34
|
import { compareGroups, hubClient } from "./hub-client.js";
|
|
35
35
|
import { hw, linkHubCss } from "./hub-strings.js";
|
|
36
36
|
import { hc, linkHubChatCss } from "./hub-chat-strings.js";
|
|
37
|
+
import { HubRoomRows, readRoomList } from "./hub-room-list.js";
|
|
38
|
+
import { useRoomStar } from "./hub-room-favorites.js";
|
|
39
|
+
import { HubRoomPage } from "./hub-room-thread.js";
|
|
40
|
+
import { hroom } from "./hub-room-strings.js";
|
|
37
41
|
import { hr } from "./hub-read-strings.js";
|
|
42
|
+
import { ht } from "./hub-teams-strings.js";
|
|
38
43
|
import { ho, linkHubOwnerCss } from "./hub-owner-strings.js";
|
|
39
44
|
import { hg } from "./hub-grant-strings.js";
|
|
40
45
|
import { createHubChatStore } from "./hub-chat-store.js";
|
|
@@ -49,8 +54,8 @@ register("hubAccess", {
|
|
|
49
54
|
const ha = key => t(`hubAccess.${key}`);
|
|
50
55
|
// Kept with the fresh renderer: retained owner dictionaries do not know this label.
|
|
51
56
|
register("hubGrantStatus", {
|
|
52
|
-
en: { grantNeverSignedIn: "Hasn't signed in to Hub yet", grantADGroup: "AD group", grantSubjects: "People and
|
|
53
|
-
"zh-TW": { grantNeverSignedIn: "還沒登入過 Hub", grantADGroup: "AD 群組", grantSubjects: "
|
|
57
|
+
en: { grantNeverSignedIn: "Hasn't signed in to Hub yet", grantADGroup: "AD group", grantTeam: "Team", grantSubjects: "People, groups and teams allowed: {0}" },
|
|
58
|
+
"zh-TW": { grantNeverSignedIn: "還沒登入過 Hub", grantADGroup: "AD 群組", grantTeam: "團隊", grantSubjects: "已允許的個人、群組與團隊:{0}" },
|
|
54
59
|
});
|
|
55
60
|
|
|
56
61
|
// These words travel with the renderer; retained dictionaries need no new exports.
|
|
@@ -136,7 +141,8 @@ export function HubPanel({ route }) {
|
|
|
136
141
|
// The owner stylesheet holds the page column (.hub-owner, 860 px) every page with a column uses — Notices too (Argon #12).
|
|
137
142
|
useEffect(() => { linkHubCss(); linkHubOwnerCss(); if (tab === "ask") linkHubChatCss(); }, [tab]);
|
|
138
143
|
// Join takes precedence over other query views. Rooms and Group permissions otherwise name their own pages.
|
|
139
|
-
const pageName = companyPage ? hj("title") : tab === "exposures" ? hc("mine") : tab === "admin" ? hc("admin") : view === "notices" ? hc("noticesTitle")
|
|
144
|
+
const pageName = companyPage ? hj("title") : tab === "exposures" ? hc("mine") : tab === "admin" ? view === "teams" ? ht("title") : hc("admin") : view === "notices" ? hc("noticesTitle")
|
|
145
|
+
: view === "invitations" ? hroom("invitationsTitle") : view === "teams" ? ht("mine") : hc("chats");
|
|
140
146
|
useEffect(() => { if (companyPage || !(tab === "ask" && roomParam()) && !(tab === "admin" && view === "groups")) setTitle(pageName); }, [tab, view, pageName, roomParam(), companyPage]);
|
|
141
147
|
let body = tab === "ask" ? roomParam() ? html`<${HubRoomLoading} />`
|
|
142
148
|
: html`<${PanelHeader} title=${hc("chats")} /><div class="hub-home"><${Skeleton} variant="rows" lines=${4} /></div>`
|
|
@@ -153,6 +159,13 @@ export function HubPanel({ route }) {
|
|
|
153
159
|
<div class="col hub-owner hub-notices-col"><p class="s-page-lead hub-page-lead">${directoryNoticesOffered(s, hubClient()) ? dn("pageLead") : hc("noticesLead")}</p>
|
|
154
160
|
${pairingNoticesOffered(s) ? html`<${PairingNotices} admin=${!!s.admin} empty=${directoryNoticesOffered(s, hubClient()) ? null : html`<${Empty} icon="bell" title=${hc("noNotices")} />`} />` : null}
|
|
155
161
|
${directoryNoticesOffered(s, hubClient()) ? html`<${DirectoryNotices} client=${hubClient()} />` : null}</div></div></div>`;
|
|
162
|
+
// M-3092: the owner's invitations (spec §8), a page of the chats like Notices.
|
|
163
|
+
if (s && tab === "ask" && view === "invitations" && roomsLive()) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-invitations">
|
|
164
|
+
<${PanelHeader} title=${hroom("invitationsTitle")} /><div data-trust="panel-content" class="panel-body hub-page-body"><div class="col hub-owner">
|
|
165
|
+
<${LazyRoomPart} load=${() => import("./hub-invitations.js")} name="InvitationsList" props=${{ client: hubClient(), heading: false }} /></div></div></div>`;
|
|
166
|
+
if (s && tab === "ask" && view === "teams" && teamsLive()) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-teams">
|
|
167
|
+
<${PanelHeader} title=${ht("mine")} /><div data-trust="panel-content" class="panel-body hub-page-body"><div class="col hub-owner">
|
|
168
|
+
<${LazyRoomPart} load=${() => import("./hub-teams.js")} name="HubTeamsPage" props=${{ client: hubClient(), mode: "lead", person: s.person }} /></div></div></div>`;
|
|
156
169
|
// The chats draw their own header (the room's); the other pages keep the panel's.
|
|
157
170
|
if (s !== null && tab === "ask") return html`<div data-effect-panel="hub" class="panel p-hub p-hub-ask"><div data-trust="panel-content" class="panel-body hub-chat-body">${body}</div></div>`;
|
|
158
171
|
// #3226 C: My shared agents and Administration are Settings-like pages. The panel's header names the page once, its scope
|
|
@@ -246,6 +259,7 @@ function HubSignIn() {
|
|
|
246
259
|
<div class="hub-signin-brand"><strong>${t("hubShell.brand")}</strong>${name ? html`<span>${name}</span>` : null}</div>
|
|
247
260
|
<h1 id="hubSignInTitle">${hw("signInTitle")}</h1>
|
|
248
261
|
${company.requestId ? html`<${CompanyJoinLead} context=${company.view?.ok ? company.view : null} />` : html`<p class="hub-signin-lead">${hw("signInLead")}</p>`}
|
|
262
|
+
<p class="note hub-signin-preview">${hw("signInPreview")}</p>
|
|
249
263
|
${company.requestId && company.view === undefined ? html`<${Skeleton} variant="form" lines=${2} label=${hj("loading")} />` : company.requestId && company.view && !company.view.ok ? html`<${ErrorState} message=${joinError(company.view.code)} onRetry=${company.retry} />` : null}
|
|
250
264
|
${!company.requestId || company.view?.ok && company.view.state === "pending" ? html`<form class="hub-signin-form" onSubmit=${submit}>
|
|
251
265
|
<label for="hubLogin">${hw("login")}</label>
|
|
@@ -280,11 +294,13 @@ function useRead(read) {
|
|
|
280
294
|
/** The person's open rooms, as the list shows them: { loaded, rooms, error }; read on demand and every ROOMS_MS. */
|
|
281
295
|
export const ROOMS_MS = 30_000;
|
|
282
296
|
export function refreshRooms() {
|
|
283
|
-
|
|
297
|
+
// M-3092: the rooms list (docs/design/hub-rooms-split.md seam 1). A Hub without rooms yet answers today's chats in the
|
|
298
|
+
// same shape (kind "direct", `limited`, the old item under `legacy`: hub-client.js legacyRoom()).
|
|
299
|
+
return roomsReading ??= readRoomList(hubClient()).then((r) => {
|
|
284
300
|
// With group permissions on, a person whose groups don't include chatting is refused the list: that is their access, shown
|
|
285
301
|
// by the welcome, not a failure (Cairn #3372) — the list stays empty and quiet. Every chat action still asks the server.
|
|
286
302
|
if (!r.ok && (r.code === "denied" || r.code === "revoked") && groupPolicyOn(session, hubClient())) roomsStore.set({ loaded: true, rooms: [], error: null, denied: true });
|
|
287
|
-
else roomsStore.set(r.ok ? { loaded: true, rooms: r.rooms || [], error: null } : { ...roomsStore.get(), loaded: true, error: errText(r) });
|
|
303
|
+
else roomsStore.set(r.ok ? { loaded: true, rooms: r.rooms || [], me: r.me || null, invitations: Number(r.invitations) || 0, error: null } : { ...roomsStore.get(), loaded: true, error: errText(r) });
|
|
288
304
|
}, () => roomsStore.set({ ...roomsStore.get(), loaded: true, error: hw("errFailed") })).finally(() => { roomsReading = null; });
|
|
289
305
|
}
|
|
290
306
|
/** Keeps the list fresh while something shows it (every ROOMS_MS, paused while the page is hidden). */
|
|
@@ -297,22 +313,22 @@ function useRooms() {
|
|
|
297
313
|
}, []);
|
|
298
314
|
return rs;
|
|
299
315
|
}
|
|
300
|
-
|
|
316
|
+
// A room's id as the list gives it (today's are UUIDs; a Hub with rooms may name them otherwise): matched against the list
|
|
317
|
+
// and encoded into each call, never trusted as anything else.
|
|
318
|
+
const roomParam = () => { try { const v = new URLSearchParams(location.search).get("room"); return v && /^[A-Za-z0-9-]{1,64}$/.test(v) ? v : null; } catch { return null; } };
|
|
301
319
|
const roomPath = (id) => `/ui/hub?room=${encodeURIComponent(id)}`;
|
|
302
320
|
/** cid-hub-shell-parity: the Notices page is /ui/hub?view=notices (the path every Hub listener and router already serves). */
|
|
303
321
|
const viewParam = () => { try { return new URLSearchParams(location.search).get("view"); } catch { return null; } };
|
|
304
322
|
export const NOTICES_PATH = "/ui/hub?view=notices";
|
|
323
|
+
/** M-3092: the owner's invitations (spec §8). */
|
|
324
|
+
export const INVITATIONS_PATH = "/ui/hub?view=invitations";
|
|
325
|
+
export const MY_TEAMS_PATH = "/ui/hub?view=teams";
|
|
305
326
|
const pairingNoticesOffered = (s) => !!s && Array.isArray(s.features) && s.features.includes("quick-pairing-v1") && !!hubClient().quickPairingV1;
|
|
306
327
|
const noticesOffered = s => pairingNoticesOffered(s) || directoryNoticesOffered(s, hubClient());
|
|
307
328
|
const initial = (name) => (String(name || "?").trim()[0] || "?").toUpperCase();
|
|
308
329
|
const AV_TONES = 6;
|
|
309
330
|
const tone = (name) => { let h = 0; for (const c of String(name || "")) h = (h * 31 + c.codePointAt(0)) >>> 0; return h % AV_TONES; };
|
|
310
331
|
function Avatar({ name, size = "" }) { return html`<span class=${`hub-av t${tone(name)} ${size}`} aria-hidden="true">${initial(name)}</span>`; }
|
|
311
|
-
const listTime = (ms) => {
|
|
312
|
-
if (!ms) return "";
|
|
313
|
-
const d = new Date(ms), now = new Date();
|
|
314
|
-
return d.toDateString() === now.toDateString() ? d.toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit" }) : d.toLocaleDateString(undefined, { month: "numeric", day: "numeric" });
|
|
315
|
-
};
|
|
316
332
|
const dateOnly = (ms) => new Date(ms).toLocaleDateString(undefined, { year: "numeric", month: "long", day: "numeric" });
|
|
317
333
|
function daysLeft(ms) {
|
|
318
334
|
const d = Math.ceil((ms - Date.now()) / 86_400_000);
|
|
@@ -325,10 +341,11 @@ export function HubNav({ onPick } = {}) {
|
|
|
325
341
|
const rs = useRooms();
|
|
326
342
|
const [q, setQ] = useState("");
|
|
327
343
|
const [picking, setPicking] = useState(false);
|
|
344
|
+
const star = useRoomStar(rs.rooms, s?.login);
|
|
328
345
|
useEffect(() => { linkHubChatCss(); }, []);
|
|
329
346
|
if (!s) return null;
|
|
330
347
|
const current = roomParam();
|
|
331
|
-
const shown = rs.rooms.filter((r) => !q.trim() ||
|
|
348
|
+
const shown = rs.rooms.filter((r) => !q.trim() || [r.name, r.agent?.owner?.name, r.lastText].some((v) => String(v || "").toLowerCase().includes(q.trim().toLowerCase())));
|
|
332
349
|
const pick = (e, r) => { if (onPick) onPick(); if (e && (e.metaKey || e.ctrlKey)) return; e && e.preventDefault(); navigate(roomPath(r.id)); };
|
|
333
350
|
return html`<div class="hub-nav">
|
|
334
351
|
<button type="button" class="btn hub-new" onClick=${() => setPicking(true)}><${Icon} name="plus" size=${16} />${hc("newChat")}</button>
|
|
@@ -339,12 +356,7 @@ export function HubNav({ onPick } = {}) {
|
|
|
339
356
|
${!rs.loaded ? html`<${Skeleton} variant="rows" lines=${4} />` : null}
|
|
340
357
|
${rs.loaded && !rs.error && !rs.denied && !rs.rooms.length ? html`<p class="note hub-list-empty">${hc("noChats")}</p>` : null}
|
|
341
358
|
${rs.rooms.length && !shown.length ? html`<p class="note hub-list-empty">${hc("noMatch")}</p>` : null}
|
|
342
|
-
<
|
|
343
|
-
<a class=${`hub-room-row${current === r.id ? " active" : ""}${r.state === "closed" ? " closed" : ""}`} href=${roomPath(r.id)} aria-current=${current === r.id ? "page" : undefined} onClick=${(e) => pick(e, r)}>
|
|
344
|
-
<${Avatar} name=${r.exposureName} />
|
|
345
|
-
<span class="hub-room-text"><span class="t">${r.exposureName}</span><span class="s">${r.state === "closed" ? hc("tagClosed") : r.waiting ? hc("waiting") : r.ownerName ? hc("represents", r.ownerName) : ""}</span></span>
|
|
346
|
-
<span class="hub-room-side"><span class="time">${listTime(r.lastAt)}</span>${r.waiting ? html`<span class="pulse" title=${hc("waiting")}></span>` : null}</span>
|
|
347
|
-
</a></li>`)}</ul>
|
|
359
|
+
<div class="view-roster inst-nav hub-side-rooms"><${HubRoomRows} rooms=${rs.rooms} q=${q} current=${current} href=${(r) => roomPath(r.id)} onGo=${pick} star=${star} /></div>
|
|
348
360
|
${picking ? html`<${NewChatDialog} onClose=${() => setPicking(false)} />` : null}
|
|
349
361
|
</div>`;
|
|
350
362
|
}
|
|
@@ -363,7 +375,7 @@ export function HubSide({ onPick } = {}) {
|
|
|
363
375
|
const { route } = useStore(navStore);
|
|
364
376
|
const [q, setQ] = useState("");
|
|
365
377
|
const [filtering, setFiltering] = useState(false);
|
|
366
|
-
const [picking, setPicking] = useState(false);
|
|
378
|
+
const [picking, setPicking] = useState(false), [newRoom, setNewRoom] = useState(false);
|
|
367
379
|
const filter = useRef(null);
|
|
368
380
|
useEffect(() => { linkHubChatCss(); }, []);
|
|
369
381
|
const openFilter = () => { setFiltering(true); setTimeout(() => filter.current?.focus(), 0); };
|
|
@@ -380,7 +392,7 @@ export function HubSide({ onPick } = {}) {
|
|
|
380
392
|
if (!s) return null;
|
|
381
393
|
const tab = route && route.panel === "hub" ? route.tab : "ask";
|
|
382
394
|
const view = viewParam();
|
|
383
|
-
const here = (key) =>
|
|
395
|
+
const here = (key) => ["notices", "invitations", "teams"].includes(key) ? tab === "ask" && view === key : key === "ask" ? tab === "ask" && view !== "notices" && view !== "invitations" && view !== "teams" : tab === key;
|
|
384
396
|
const go = (e, href) => { if (onPick) onPick(); if (e && (e.metaKey || e.ctrlKey)) return; e && e.preventDefault(); navigate(href); };
|
|
385
397
|
const row = (key, href, icon, label) => html`<a class=${`side-row${here(key) ? " active" : ""}`} href=${href} aria-current=${here(key) ? "page" : undefined}
|
|
386
398
|
onClick=${(e) => go(e, href)}><${Icon} name=${icon} /><span class="grow">${label}</span></a>`;
|
|
@@ -389,14 +401,21 @@ export function HubSide({ onPick } = {}) {
|
|
|
389
401
|
return html`<nav data-trust="navigation" class="side-nav" aria-label=${t("app.menu")}>
|
|
390
402
|
${row("ask", "/ui/hub", "chat", hc("chats"))}
|
|
391
403
|
${row("exposures", "/ui/hub/exposures", "globe", hc("mine"))}
|
|
404
|
+
${teamsLive() ? html`<${LazyRoomPart} load=${() => import("./hub-teams.js")} name="HubMyTeamsEntry" props=${{ client: hubClient(), person: s.person, active: here("teams"), onPick }} />` : null}
|
|
405
|
+
${roomsLive() && rs.invitations > 0 ? html`<a class=${`side-row${here("invitations") ? " active" : ""}`} href=${INVITATIONS_PATH} aria-current=${here("invitations") ? "page" : undefined}
|
|
406
|
+
onClick=${(e) => go(e, INVITATIONS_PATH)}><${Icon} name="inbox" /><span class="grow">${hroom("invitationsTitle")}</span><span class="nav-count" title=${hroom("invitationsN", String(rs.invitations))}>${rs.invitations}</span></a>` : null}
|
|
392
407
|
${s.admin ? row("admin", "/ui/hub/admin", "key", hc("admin")) : null}
|
|
393
408
|
${noticesOffered(s) ? row("notices", NOTICES_PATH, "bell", hc("notices")) : null}
|
|
394
409
|
<button type="button" class="side-row side-search" onClick=${openFilter} title=${`${hc("search")} (${searchShortcut()})`}
|
|
395
410
|
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>
|
|
396
411
|
<button type="button" class="side-row side-new" onClick=${() => setPicking(true)}><${Icon} name="plus" /><span class="grow">${hc("newChat")}</span></button>
|
|
412
|
+
${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}
|
|
397
413
|
</nav>
|
|
414
|
+
|
|
398
415
|
<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} onPick=${onPick} quietEmpty=${home} />
|
|
399
|
-
${picking ? html`<${NewChatDialog} onClose=${() => setPicking(false)} />` : null}
|
|
416
|
+
${picking ? html`<${NewChatDialog} onClose=${() => setPicking(false)} />` : null}
|
|
417
|
+
${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant,
|
|
418
|
+
onClose: () => setNewRoom(false), onOpenRoom: (id) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(id)); } }} />` : null}`;
|
|
400
419
|
}
|
|
401
420
|
|
|
402
421
|
/**
|
|
@@ -404,36 +423,37 @@ export function HubSide({ onPick } = {}) {
|
|
|
404
423
|
* count, one-line empty states) — the sidebar's (HubSide) and, on a phone, the chats' home page's (with its own New chat
|
|
405
424
|
* row and the filter always shown): one drawing, not two (Argon #9). `quietEmpty`: the page beside it already says "No chats yet".
|
|
406
425
|
*/
|
|
407
|
-
function HubRoomList({ rs, q, setQ, filtering, setFiltering, filterRef, onPick, quietEmpty = false, onNew = null }) {
|
|
426
|
+
function HubRoomList({ rs, q, setQ, filtering, setFiltering, filterRef, onPick, quietEmpty = false, onNew = null, onNewRoom = null }) {
|
|
408
427
|
const current = roomParam();
|
|
428
|
+
const star = useRoomStar(rs.rooms, useSession()?.login); // S-145: favourites, as the Fleet sidebar's
|
|
409
429
|
const go = (e, href) => { if (onPick) onPick(); if (e && (e.metaKey || e.ctrlKey)) return; e && e.preventDefault(); navigate(href); };
|
|
410
|
-
const shown = rs.rooms.filter((r) => !q.trim() ||
|
|
430
|
+
const shown = rs.rooms.filter((r) => !q.trim() || [r.name, r.agent?.owner?.name, r.lastText].some((v) => String(v || "").toLowerCase().includes(q.trim().toLowerCase())));
|
|
411
431
|
const always = !!onNew; // the home page's list: its filter is always there (when there's a list to filter)
|
|
412
432
|
return html`<div class="view-roster inst-nav hub-side-rooms"><div data-trust="navigation" class="side-section">
|
|
413
433
|
${onNew ? html`<button type="button" class="side-row side-new" onClick=${onNew}><${Icon} name="plus" /><span class="grow">${hc("newChat")}</span></button>` : null}
|
|
414
|
-
|
|
434
|
+
${/* Lumen (spec §2): on the phone's list too, beside New chat — not only in the drawer. */ ""}
|
|
435
|
+
${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}
|
|
436
|
+
${!rs.rooms.length ? html`<div class="inst-head"><h2 class="side-label">${hc("chats")}</h2></div>` : null}
|
|
415
437
|
${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}
|
|
416
438
|
onInput=${(e) => setQ(e.target.value)} onKeyDown=${(e) => { if (e.key === "Escape") { setQ(""); setFiltering(false); } }} /></label>` : null}
|
|
417
439
|
${rs.error ? html`<${ErrorState} message=${rs.error} onRetry=${refreshRooms} />` : null}
|
|
418
440
|
${!rs.loaded ? html`<${Skeleton} variant="rows" lines=${4} />` : null}
|
|
419
441
|
${rs.loaded && !rs.error && !rs.denied && !rs.rooms.length && !quietEmpty ? html`<p class="side-empty muted">${hc("noChats")}</p>` : null}
|
|
420
442
|
${rs.rooms.length && !shown.length ? html`<p class="side-empty muted">${hc("noMatch")}</p>` : null}
|
|
421
|
-
|
|
422
|
-
<a class=${`hub-room-row${current === r.id ? " active" : ""}${r.state === "closed" ? " closed" : ""}`} href=${roomPath(r.id)} aria-current=${current === r.id ? "page" : undefined} onClick=${(e) => go(e, roomPath(r.id))}>
|
|
423
|
-
<${Avatar} name=${r.exposureName} />
|
|
424
|
-
<span class="hub-room-text"><span class="t">${r.exposureName}</span><span class="s">${r.state === "closed" ? hc("tagClosed") : r.waiting ? hc("waiting") : r.ownerName ? hc("represents", r.ownerName) : ""}</span></span>
|
|
425
|
-
<span class="hub-room-side"><span class="time">${listTime(r.lastAt)}</span>${r.waiting ? html`<span class="pulse" title=${hc("waiting")}></span>` : null}</span>
|
|
426
|
-
</a></li>`)}</ul>
|
|
443
|
+
<${HubRoomRows} rooms=${rs.rooms} q=${q} current=${current} href=${(r) => roomPath(r.id)} onGo=${(e, r) => go(e, roomPath(r.id))} star=${star} />
|
|
427
444
|
</div></div>`;
|
|
428
445
|
}
|
|
429
446
|
|
|
430
447
|
/** The phone's chats home: the same roster, with New chat at its head and the filter in place. */
|
|
431
448
|
function HubHomeList() {
|
|
432
449
|
const rs = useRooms();
|
|
433
|
-
const [q, setQ] = useState(""), [filtering, setFiltering] = useState(false), [picking, setPicking] = useState(false);
|
|
450
|
+
const [q, setQ] = useState(""), [filtering, setFiltering] = useState(false), [picking, setPicking] = useState(false), [newRoom, setNewRoom] = useState(false);
|
|
434
451
|
const filter = useRef(null);
|
|
435
|
-
return html`<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} onNew=${() => setPicking(true)}
|
|
436
|
-
|
|
452
|
+
return html`<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} onNew=${() => setPicking(true)}
|
|
453
|
+
onNewRoom=${roomsLive() && rs.me?.canCreateRooms ? () => setNewRoom(true) : null} />
|
|
454
|
+
${picking ? html`<${NewChatDialog} onClose=${() => setPicking(false)} />` : null}
|
|
455
|
+
${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant,
|
|
456
|
+
onClose: () => setNewRoom(false), onOpenRoom: (id) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(id)); } }} />` : null}`;
|
|
437
457
|
}
|
|
438
458
|
|
|
439
459
|
/**
|
|
@@ -475,7 +495,7 @@ function NewChatDialog({ onClose }) {
|
|
|
475
495
|
};
|
|
476
496
|
const all = cat && cat.askable ? cat.askable : [];
|
|
477
497
|
const shown = all.filter((it) => !q.trim() || `${it.exposure.displayName} ${it.ownerName}`.toLowerCase().includes(q.trim().toLowerCase()));
|
|
478
|
-
const hasRoom = (it) => rs.rooms.some((r) => r.exposureId === it.exposure.id &&
|
|
498
|
+
const hasRoom = (it) => rs.rooms.some((r) => { const o = r.legacy || r; return o.exposureId === it.exposure.id && o.grantId === it.grant.id; });
|
|
479
499
|
return html`<${Dialog} title=${hc("pickTitle")} onClose=${onClose}>
|
|
480
500
|
<div class="hub-pick">
|
|
481
501
|
<label class="field"><span class="sr-only">${hc("pickSearch")}</span><input type="search" placeholder=${hc("pickSearch")} value=${q} onInput=${(e) => setQ(e.target.value)} /></label>
|
|
@@ -501,7 +521,14 @@ function HubChats() {
|
|
|
501
521
|
const [picking, setPicking] = useState(false);
|
|
502
522
|
useEffect(() => { linkHubChatCss(); }, []);
|
|
503
523
|
const id = roomParam();
|
|
504
|
-
|
|
524
|
+
// Today's chats (the list's `legacy` item) open the room view they always had; a room of a Hub with rooms opens the
|
|
525
|
+
// shared thread (M-3092 PR 2).
|
|
526
|
+
const listed = id ? rs.rooms.find((r) => r.id === id) : null;
|
|
527
|
+
const room = id ? (listed ? listed.legacy || listed : rs.loaded ? { id, exposureName: "", ownerName: "", features: [] } : null) : null;
|
|
528
|
+
// A room of a Hub with rooms: the shared thread with the room's store, composer and members panel (hub-room-thread.js).
|
|
529
|
+
if (id && listed && !listed.legacy) return html`<${HubRoomPage} key=${id} roomId=${id} listed=${listed} Thread=${HubThread} client=${hubClient()}
|
|
530
|
+
rooms=${rs.rooms} openRoom=${(rid) => navigate(roomPath(rid))} goList=${() => navigate("/ui/hub")}
|
|
531
|
+
onLeft=${() => { void refreshRooms(); navigate("/ui/hub"); }} />`;
|
|
505
532
|
if (id && room) return html`<${HubRoomView} key=${id} room=${room} />`;
|
|
506
533
|
if (id) return html`<${HubRoomLoading} error=${rs.error} />`;
|
|
507
534
|
return html`<${PanelHeader} title=${hc("chats")} />
|
|
@@ -557,7 +584,7 @@ function HubRoomView({ room: given }) {
|
|
|
557
584
|
const waiting = store.entries().some((e) => ["queued", "delivered", "consumed"].includes(e.receipt && e.receipt.stage));
|
|
558
585
|
if (was !== null && waiting !== was) {
|
|
559
586
|
// The row says so at once; the list is read again behind it.
|
|
560
|
-
roomsStore.set((rs) => ({ ...rs, rooms: rs.rooms.map((r) => (r.id === given.id ? { ...r, waiting } : r)) }));
|
|
587
|
+
roomsStore.set((rs) => ({ ...rs, rooms: rs.rooms.map((r) => (r.id === given.id ? (r.legacy ? { ...r, legacy: { ...r.legacy, waiting } } : { ...r, waiting }) : r)) }));
|
|
561
588
|
void refreshRooms();
|
|
562
589
|
}
|
|
563
590
|
was = waiting;
|
|
@@ -689,7 +716,7 @@ function HubWorkBar({ name, since }) {
|
|
|
689
716
|
}
|
|
690
717
|
|
|
691
718
|
/** The thread: the fleet chat's own (createThread), fed by the room's store. */
|
|
692
|
-
function HubThread({ store, name, panelKey, threadRef }) {
|
|
719
|
+
function HubThread({ store, name, panelKey, threadRef, extra = null, emptyView = null }) {
|
|
693
720
|
const scroller = useRef(null), host = useRef(null);
|
|
694
721
|
const [jump, setJump] = useState({ show: false, unseen: 0 });
|
|
695
722
|
const [empty, setEmpty] = useState(false);
|
|
@@ -710,6 +737,8 @@ function HubThread({ store, name, panelKey, threadRef }) {
|
|
|
710
737
|
replyButtonBusy: (id) => store.busy(id), pollMine: (id) => store.mine(id), serverNow: () => Date.now(),
|
|
711
738
|
retryOutgoing: () => {}, deleteOutgoing: () => {}, putBackOutgoing: () => {}, startReply: () => {}, findQuoted: () => null,
|
|
712
739
|
emojis: () => false, mentions: () => null,
|
|
740
|
+
// M-3092: a room of a Hub with rooms (hub-room-thread.js) says whose messages are mine, and replies and quotes.
|
|
741
|
+
...(extra || {}),
|
|
713
742
|
});
|
|
714
743
|
th.current = thread;
|
|
715
744
|
if (threadRef) threadRef.current = thread;
|
|
@@ -736,7 +765,8 @@ function HubThread({ store, name, panelKey, threadRef }) {
|
|
|
736
765
|
${!loaded && !store.error() && !store.closed() ? html`<${Skeleton} variant="rows" lines=${5} />` : null}
|
|
737
766
|
${store.error() === "backpressure" ? html`<p class="hub-banner warn" role="status">${hr("busy")}</p>`
|
|
738
767
|
: !loaded && store.error() ? html`<${ErrorState} message=${errText({ code: store.error() })} onRetry=${() => store.refresh()} />` : null}
|
|
739
|
-
${empty && loaded && !store.closed() ? html`<div class="center hub-room-empty"
|
|
768
|
+
${empty && loaded && !store.closed() && emptyView ? html`<div class="center hub-room-empty">${emptyView}</div>` : null}
|
|
769
|
+
${empty && loaded && !store.closed() && !emptyView ? html`<div class="center hub-room-empty"><${Empty} icon="chat" title=${hc("emptyRoom", name)} hint=${`${hc("emptyRoomHint", store.room().ownerName || name)}${lang() === "zh-TW" ? "" : " "}${hw("roomShared")}`} /></div>` : null}
|
|
740
770
|
<div class="jump-dock">${jump.show ? html`<button data-trust="thread-control" type="button" class="jump-latest" onClick=${() => th.current && th.current.jumpLatest()}>
|
|
741
771
|
<${Icon} name="down" size=${16} />${jump.unseen > 0 ? t("chat.newBelow", jump.unseen) : t("chat.jumpLatest")}</button>` : null}</div>
|
|
742
772
|
</div>`;
|
|
@@ -770,7 +800,7 @@ const stateTag = (state) => state === "published" ? html`<span class="tag ok">${
|
|
|
770
800
|
: state === "paused" ? html`<span class="tag warn">${t("hubSharing.paused")}</span>`
|
|
771
801
|
: state === "frozen" ? html`<span class="tag warn">${ho("statePaused")}</span>` : html`<span class="tag">${ho("stateWithdrawn")}</span>`;
|
|
772
802
|
const mayAsk = (n) => (n === 0 ? ho("mayAskNone") : n === 1 ? ho("mayAskOne") : ho("mayAsk", n));
|
|
773
|
-
const grantSummary = (grants = []) => grants.some(g => g.subject?.kind
|
|
803
|
+
const grantSummary = (grants = []) => grants.some(g => ["group", "team"].includes(g.subject?.kind)) ? t("hubGrantStatus.grantSubjects", grants.length) : mayAsk(grants.length);
|
|
774
804
|
const agentParam = () => { try { const v = new URLSearchParams(location.search).get("agent"); return v && /^[a-f0-9-]{36}$/.test(v) ? v : null; } catch { return null; } };
|
|
775
805
|
|
|
776
806
|
/**
|
|
@@ -816,6 +846,7 @@ function HubMine() {
|
|
|
816
846
|
// Nothing shared yet: the empty state below says where to share from, so the lead doesn't say it too (Argon #20).
|
|
817
847
|
return html`<div class="col hub-owner"><p class="s-page-lead hub-page-lead">${ho(cat && !cat.error && !mine.length ? "mineLeadShort" : "mineLead")}</p>
|
|
818
848
|
<div class="s-section-layout">
|
|
849
|
+
${roomsLive() ? html`<${LazyRoomPart} load=${() => import("./hub-invitations.js")} name="InvitationsList" props=${{ client: hubClient(), heading: true }} />` : null}
|
|
819
850
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
820
851
|
${!pairings ? html`<${Skeleton} lines=${2} />` : pairings.error ? html`<${ErrorState} message=${pairings.error} onRetry=${reloadPairings} />` : null}
|
|
821
852
|
${pend.length ? html`<section class="card hub-pairings"><h3>${ho("pendingPairings")}</h3><p class="note">${ho("pendingLead")}</p>
|
|
@@ -837,6 +868,8 @@ function HubAgentPage({ x, act, msg }) {
|
|
|
837
868
|
const session = useSession(), client = hubClient();
|
|
838
869
|
const resumable = session?.features?.includes("sharing-pause-v1") && client?.sharingPauseV1 === true && typeof client.sharing === "function";
|
|
839
870
|
const [sharingBusy, setSharingBusy] = useState(false);
|
|
871
|
+
// M-3092: how many rooms this agent is in — reported by its 「在這些房間裡」 section's own read (one read, no second count).
|
|
872
|
+
const [roomCount, setRoomCount] = useState(null);
|
|
840
873
|
const sharing = async () => {
|
|
841
874
|
if (sharingBusy) return; setSharingBusy(true);
|
|
842
875
|
try { await act(() => client.sharing(x.id, x.revision, x.sharingEpoch ?? 0, x.state !== "paused")); }
|
|
@@ -860,16 +893,19 @@ function HubAgentPage({ x, act, msg }) {
|
|
|
860
893
|
const acts = activity && activity.activity ? activity.activity : [];
|
|
861
894
|
return html`<div class="col hub-owner">
|
|
862
895
|
<a class="hub-crumb" href="/ui/hub/exposures"><${Icon} name="back" size=${14} />${ho("backToMine")}</a>
|
|
863
|
-
<${PageHead} title=${x.displayName} scope=${stateTag(x.state)} lead=${
|
|
896
|
+
<${PageHead} title=${x.displayName} scope=${stateTag(x.state)} lead=${!grants.length && roomCount > 0
|
|
897
|
+
? `${hroom("agentNoOneToOne")} · ${roomCount === 1 ? hroom("inRoomsOne") : hroom("inRoomsMany", String(roomCount))}` : grantSummary(grants)} />
|
|
864
898
|
<div class="s-section-layout">
|
|
865
899
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
866
900
|
<section class="card"><div class="hub-card-head"><h3>${ho("whoMayAsk")}</h3>${shared ? html`<button type="button" class="btn btn-sm" onClick=${() => setAllowing(true)}><${Icon} name="plus" size=${14} />${ho("allow")}</button>` : null}</div>
|
|
867
901
|
${grants.length ? html`<div class="hub-rows">${grants.map((g) => html`<div key=${g.id} class="s-row hub-row">
|
|
868
902
|
<${Avatar} name=${g.subjectName || g.subjectLogin} size="sm" />
|
|
869
|
-
<span class="hub-row-text"><strong>${g.subjectName || g.subjectLogin}</strong><small class="note">${g.subjectLogin ? html`<code>${g.subjectLogin}</code> · ` : null}${ho("untilLeft", dateOnly(g.expiresAt), DAYS_LEFT(g.expiresAt))}</small>${g.subject?.kind === "group" ? html`<small class="tag">${t("hubGrantStatus.grantADGroup")}</small>` : g.subjectSignedIn === false ? html`<small class="tag warn">${t("hubGrantStatus.grantNeverSignedIn")}</small>` : null}</span>
|
|
903
|
+
<span class="hub-row-text"><strong>${g.subjectName || g.subjectLogin}</strong><small class="note">${g.subjectLogin ? html`<code>${g.subjectLogin}</code> · ` : null}${ho("untilLeft", dateOnly(g.expiresAt), DAYS_LEFT(g.expiresAt))}</small>${g.subject?.kind === "group" ? html`<small class="tag">${t("hubGrantStatus.grantADGroup")}</small>` : g.subject?.kind === "team" ? html`<small class="tag">${t("hubGrantStatus.grantTeam")}</small>` : g.subjectSignedIn === false ? html`<small class="tag warn">${t("hubGrantStatus.grantNeverSignedIn")}</small>` : null}</span>
|
|
870
904
|
<${Menu} label=${ho("rowMenu", g.subjectName || g.subjectLogin)} items=${[{ key: "revoke", label: ho("revokeItem"), icon: "trash", danger: true, onSelect: () => revoke(g) }]} />
|
|
871
|
-
</div>`)}</div>` : html`<p class="note">${hw("noGrants")}</p>`}
|
|
905
|
+
</div>`)}</div>` : html`<p class="note">${roomCount > 0 ? hroom("agentNoOneToOne") : hw("noGrants")}</p>`}
|
|
906
|
+
${roomCount > 0 ? html`<p class="note hub-rooms-can-ask">${hroom("roomsCanAskIt")}</p>` : null}
|
|
872
907
|
</section>
|
|
908
|
+
${roomsLive() ? html`<${LazyRoomPart} load=${() => import("./hub-invitations.js")} name="AgentRoomsSection" props=${{ client: hubClient(), exposureId: x.id, onRooms: setRoomCount }} />` : null}
|
|
873
909
|
<${QuotaVisibilityRow} exposure=${x} onSaved=${() => act(async () => ({ ok: true }))} />
|
|
874
910
|
<section class="card"><h3>${ho("recent")}</h3><p class="note">${ho("recentLead")}</p>
|
|
875
911
|
${!activity ? html`<${Skeleton} variant="rows" lines=${3} />` : activity.error ? html`<${ErrorState} message=${activity.error} onRetry=${reloadActivity} />` : null}
|
|
@@ -935,6 +971,7 @@ function HubAdmin({ admin }) {
|
|
|
935
971
|
const directory = s?.features?.includes("directory-editor-v1") && hubClient()?.directoryEditorV1 === true;
|
|
936
972
|
if (directory && adminView() === "directory") return html`<${LazyDirectory} session=${s} />`;
|
|
937
973
|
if (groupPolicyOn(s, hubClient()) && adminView() === "groups") return html`<${LazyGroups} pick=${(m) => m.HubGroupPolicyPage} props=${{}} />`;
|
|
974
|
+
if (teamsLive() && adminView() === "teams") return html`<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>`;
|
|
938
975
|
// Reached from a fleet's Settings link on a Hub (or a tab) without group permissions: say so instead of a silent admin page.
|
|
939
976
|
const unavailable = adminView() === "groups" && !groupPolicyOn(s, hubClient());
|
|
940
977
|
return html`${unavailable ? html`<p class="note" role="status" data-groups="unavailable">${t("hubGroupsNote.unavailable")}</p>` : null}
|
|
@@ -946,11 +983,27 @@ function LazyDirectory({ session }) {
|
|
|
946
983
|
return Page ? html`<${Page} client=${hubClient()} offered=${true} login=${session.login} afterSave=${async () => !!(await readSession())} />` : null;
|
|
947
984
|
}
|
|
948
985
|
/** M-2682: Administration → This Hub, its own lazy module (an older server doesn't serve it: then it's left out). */
|
|
986
|
+
/**
|
|
987
|
+
* M-3092: one of the Hub rooms' own screens (dev-claude2's modules: new room, invitations, administration → rooms), loaded
|
|
988
|
+
* when first shown; nothing while it loads or if this Hub does not serve it.
|
|
989
|
+
*/
|
|
990
|
+
function LazyRoomPart({ load, name, props = {} }) {
|
|
991
|
+
const [C, setC] = useState(null);
|
|
992
|
+
useEffect(() => { let live = true; load().then((m) => { if (live && typeof m[name] === "function") setC(() => m[name]); }, () => {}); return () => { live = false; }; }, []);
|
|
993
|
+
return C ? html`<${C} ...${props} />` : null;
|
|
994
|
+
}
|
|
995
|
+
const teamsLive = () => { const c = hubClient(); return typeof c.teamsLive === "function" && c.teamsLive() === true; };
|
|
996
|
+
const roomsLive = () => { const c = hubClient(); return typeof c.roomsLive === "function" && c.roomsLive() === true; };
|
|
949
997
|
function LazyThisHub({ directory }) {
|
|
950
998
|
const [C, setC] = useState(null);
|
|
951
999
|
useEffect(() => { let live = true; import("./hub-this-hub.js").then((m) => { if (live) setC(() => m.ThisHubCard); }, () => {}); return () => { live = false; }; }, []);
|
|
952
1000
|
return C ? html`<${C} directory=${directory} />` : null;
|
|
953
1001
|
}
|
|
1002
|
+
function LazyAssistantAdmin() {
|
|
1003
|
+
const [C, setC] = useState(null);
|
|
1004
|
+
useEffect(() => { let live = true; import("./hub-assistant-admin.js").then(m => { if (live) setC(() => m.HubAssistantAdmin); }, () => {}); return () => { live = false; }; }, []);
|
|
1005
|
+
return C ? html`<${C} client=${hubClient()} />` : null;
|
|
1006
|
+
}
|
|
954
1007
|
/** #3298 S-89: Administration's sub-page (?view=groups: Group permissions), from the page's own address. */
|
|
955
1008
|
function adminView() { try { return new URLSearchParams(location.search).get("view") || ""; } catch { return ""; } }
|
|
956
1009
|
/** #3298 S-89: the prominent entry to Group permissions at the top of Administration (discovery without docs). */
|
|
@@ -958,6 +1011,7 @@ function GroupPermissionsEntry() {
|
|
|
958
1011
|
return html`<${LazyGroups} pick=${(m) => m.GroupPermissionsCard} props=${{}} />`;
|
|
959
1012
|
}
|
|
960
1013
|
function HubAdminPage({ groups = false, companyJoin = false, directory = false } = {}) {
|
|
1014
|
+
const assistantSession = useSession();
|
|
961
1015
|
const [view, reload] = useRead(() => hubClient().adminOverview());
|
|
962
1016
|
const [login, setLogin] = useState("");
|
|
963
1017
|
const [offer, setOffer] = useState(null);
|
|
@@ -1001,8 +1055,27 @@ function HubAdminPage({ groups = false, companyJoin = false, directory = false }
|
|
|
1001
1055
|
<div class="s-section-layout">
|
|
1002
1056
|
${groups && !accessEntry ? html`<${GroupPermissionsEntry} />` : null}
|
|
1003
1057
|
${companyJoin ? html`<${CompanyJoinAdminCard} entry=${accessEntry} groups=${groups} />` : null}
|
|
1058
|
+
${/* Lumen's order: Let colleagues join → Teams → Rooms → Room assistant → Connected fleets → pairing. */ ""}
|
|
1059
|
+
${teamsLive() ? html`<${LazyRoomPart} load=${() => import("./hub-teams.js")} name="HubTeamsEntry" props=${{ client: hubClient() }} />` : null}
|
|
1060
|
+
${roomsLive() ? html`<${LazyRoomPart} load=${() => import("./hub-admin-rooms.js")} name="AdminRooms" props=${{ client: hubClient() }} />` : null}
|
|
1061
|
+
${assistantSession?.features?.includes("room-assistant-v1") && hubClient().assistantAdminV1 === true ? html`<${LazyAssistantAdmin} />` : null}
|
|
1004
1062
|
${view.error ? html`<${ErrorState} message=${view.error} onRetry=${reload} />` : null}
|
|
1005
1063
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
1064
|
+
<section class="card hub-fleet-list"><h3>${ho("pairedFleets", fleets.filter((f) => f.status !== "revoked").length)}</h3>
|
|
1065
|
+
${fleets.length ? (() => {
|
|
1066
|
+
// Spec 1.2: the row's title is the Fleet's label (S1 overview), its subtitle the owner; active first, revoked folded.
|
|
1067
|
+
const row = (f) => html`<div key=${f.id} class="s-row hub-row" data-fleet=${f.id}>
|
|
1068
|
+
<${Avatar} name=${f.owner ? f.owner.name : "?"} size="sm" />
|
|
1069
|
+
<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>
|
|
1070
|
+
${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) }]} />`
|
|
1071
|
+
: html`<span class="tag">${ho("revokedTag")}</span>`}
|
|
1072
|
+
</div>`;
|
|
1073
|
+
const current = fleets.filter((f) => f.status !== "revoked").sort((a, b) => (a.status === "active" ? 0 : 1) - (b.status === "active" ? 0 : 1));
|
|
1074
|
+
const revoked = fleets.filter((f) => f.status === "revoked");
|
|
1075
|
+
return html`${current.length ? html`<div class="hub-rows">${current.map(row)}</div>` : html`<p class="note">${ho("noFleets")}</p>`}
|
|
1076
|
+
${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}`;
|
|
1077
|
+
})() : html`<p class="note">${ho("noFleets")}</p>`}
|
|
1078
|
+
</section>
|
|
1006
1079
|
<${ManualFrame} class=${accessEntry ? "s-ui-disclosure hub-admin-manual" : ""} open=${accessEntry && (!!offer || pairings.some(p => p.ownerConfirmed && !p.adminApproved))}>${accessEntry ? html`<summary>${ho("manualAdvanced")}</summary>` : null}<section class="card"><h3>${ho("pairSteps")}</h3>
|
|
1007
1080
|
<ol class="hub-steps">
|
|
1008
1081
|
<li class=${offer || pairings.length ? "done" : "now"}><div class="hub-step-body"><span><b>${ho("stepCode")}</b><small class="note">${ho("stepCodeHint")}</small></span>
|
|
@@ -1024,21 +1097,6 @@ function HubAdminPage({ groups = false, companyJoin = false, directory = false }
|
|
|
1024
1097
|
: html`<span class="tag warn">${ho("waitingOwner")}</span>`}
|
|
1025
1098
|
</div>`)}</div>` : null}
|
|
1026
1099
|
</section></${ManualFrame}>
|
|
1027
|
-
<section class="card hub-fleet-list"><h3>${ho("pairedFleets", fleets.filter((f) => f.status !== "revoked").length)}</h3>
|
|
1028
|
-
${fleets.length ? (() => {
|
|
1029
|
-
// Spec 1.2: the row's title is the Fleet's label (S1 overview), its subtitle the owner; active first, revoked folded.
|
|
1030
|
-
const row = (f) => html`<div key=${f.id} class="s-row hub-row" data-fleet=${f.id}>
|
|
1031
|
-
<${Avatar} name=${f.owner ? f.owner.name : "?"} size="sm" />
|
|
1032
|
-
<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>
|
|
1033
|
-
${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) }]} />`
|
|
1034
|
-
: html`<span class="tag">${ho("revokedTag")}</span>`}
|
|
1035
|
-
</div>`;
|
|
1036
|
-
const current = fleets.filter((f) => f.status !== "revoked").sort((a, b) => (a.status === "active" ? 0 : 1) - (b.status === "active" ? 0 : 1));
|
|
1037
|
-
const revoked = fleets.filter((f) => f.status === "revoked");
|
|
1038
|
-
return html`${current.length ? html`<div class="hub-rows">${current.map(row)}</div>` : html`<p class="note">${ho("noFleets")}</p>`}
|
|
1039
|
-
${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}`;
|
|
1040
|
-
})() : html`<p class="note">${ho("noFleets")}</p>`}
|
|
1041
|
-
</section>
|
|
1042
1100
|
<${LazyThisHub} directory=${directory} />
|
|
1043
1101
|
</div></div>`;
|
|
1044
1102
|
}
|
package/dist/ui/panel-needs.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { modelSwitchText } from "/assets/model-observation.js";
|
|
1
2
|
// #1408 step 4 = #1386 part (b): the "Needs you" panel (/ui/needs) — everything waiting on the person, from every
|
|
2
3
|
// world, in one list. Behind the session gate (/ui/js/), loaded the first time it is opened.
|
|
3
4
|
//
|
|
@@ -140,6 +141,7 @@ const BAD = new Set(["crashed", "delivery_failed", "hang", "exited"]);
|
|
|
140
141
|
* its question or what it lacks; anything else is the server's own words.
|
|
141
142
|
*/
|
|
142
143
|
function detailOf(item) {
|
|
144
|
+
if (item.modelSwitch) return modelSwitchText(item.modelSwitch);
|
|
143
145
|
const c = item.type === "task" ? item.card : null;
|
|
144
146
|
if (!c || !c.title) return configDetail(item);
|
|
145
147
|
const lacks = c.gap ? [c.gap.unchecked ? tn("gapUnchecked", c.gap.unchecked) : "", c.gap.noResult ? tn("gapNoResult") : ""].filter(Boolean).join(tn("gapJoin")) : "";
|