@songsid/agend 2.4.0-beta.1 → 2.4.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-cli-instructions.md +4 -1
- package/dist/agent-cli.js +14 -2
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.d.ts +3 -1
- package/dist/agent-endpoint.js +15 -3
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-token-header.d.ts +1 -1
- package/dist/agent-token-header.js +1 -1
- package/dist/app-message-origin.d.ts +2 -0
- package/dist/app-message-origin.js +3 -0
- package/dist/app-message-origin.js.map +1 -0
- package/dist/auth-api.d.ts +8 -0
- package/dist/auth-api.js +40 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/authority-state.d.ts +7 -0
- package/dist/authority/authority-state.js +17 -2
- package/dist/authority/authority-state.js.map +1 -1
- package/dist/authority/web-authority.d.ts +11 -1
- package/dist/authority/web-authority.js +11 -1
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/agy-model-switch.d.ts +22 -0
- package/dist/backend/agy-model-switch.js +62 -0
- package/dist/backend/agy-model-switch.js.map +1 -0
- package/dist/backend/antigravity.d.ts +9 -2
- package/dist/backend/antigravity.js +84 -9
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.js +55 -14
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/cli-env-probe.js +1 -1
- package/dist/backend/cli-env-probe.js.map +1 -1
- package/dist/backend/cli-runtime-switch.d.ts +90 -0
- package/dist/backend/cli-runtime-switch.js +273 -0
- package/dist/backend/cli-runtime-switch.js.map +1 -0
- package/dist/backend/codex-footer-hints.d.ts +1 -0
- package/dist/backend/codex-footer-hints.js +15 -0
- package/dist/backend/codex-footer-hints.js.map +1 -1
- package/dist/backend/codex-model-switch.d.ts +41 -0
- package/dist/backend/codex-model-switch.js +170 -0
- package/dist/backend/codex-model-switch.js.map +1 -0
- package/dist/backend/codex-precaution.d.ts +7 -0
- package/dist/backend/codex-precaution.js +102 -0
- package/dist/backend/codex-precaution.js.map +1 -0
- package/dist/backend/codex.d.ts +7 -4
- package/dist/backend/codex.js +44 -9
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/credential-profile.js +1 -1
- package/dist/backend/credential-profile.js.map +1 -1
- package/dist/backend/grok-model-switch.d.ts +16 -0
- package/dist/backend/grok-model-switch.js +45 -0
- package/dist/backend/grok-model-switch.js.map +1 -0
- package/dist/backend/grok.js +22 -7
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro.js +4 -4
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/muse.d.ts +2 -0
- package/dist/backend/muse.js +7 -3
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/native-pane.js +1 -1
- package/dist/backend/native-pane.js.map +1 -1
- package/dist/backend/types.d.ts +11 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-availability.d.ts +22 -0
- package/dist/backend-availability.js +71 -2
- package/dist/backend-availability.js.map +1 -1
- package/dist/backend-signin-guide.js +1 -1
- package/dist/backend-signin-guide.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/discord.d.ts +10 -0
- package/dist/channel/adapters/discord.js +35 -0
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +2 -0
- package/dist/channel/adapters/telegram.js +3 -0
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-server.js +10 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +9 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.js +9 -2
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/channel/types.d.ts +10 -0
- package/dist/classic-channel-manager.d.ts +1 -1
- package/dist/classic-channel-manager.js +1 -1
- package/dist/cli-audited.js +16 -15
- package/dist/cli-audited.js.map +1 -1
- package/dist/cli-capability.d.ts +3 -0
- package/dist/cli-capability.js.map +1 -1
- package/dist/cli-registry-check.js +1 -1
- package/dist/cli-registry-check.js.map +1 -1
- package/dist/cli-registry.d.ts +1 -0
- package/dist/cli-spec-antigravity.d.ts +1 -0
- package/dist/cli-spec-antigravity.js +3 -1
- package/dist/cli-spec-antigravity.js.map +1 -1
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +18 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/connect/control.d.ts +20 -0
- package/dist/connect/control.js +236 -0
- package/dist/connect/control.js.map +1 -0
- package/dist/connect/install.d.ts +13 -0
- package/dist/connect/install.js +12 -0
- package/dist/connect/install.js.map +1 -0
- package/dist/connect/mcp.d.ts +9 -0
- package/dist/connect/mcp.js +10 -0
- package/dist/connect/mcp.js.map +1 -0
- package/dist/connect/protocol.d.ts +38 -0
- package/dist/connect/protocol.js +36 -0
- package/dist/connect/protocol.js.map +1 -0
- package/dist/connect/service.d.ts +19 -0
- package/dist/connect/service.js +79 -0
- package/dist/connect/service.js.map +1 -0
- package/dist/connect/stdio-entry.d.ts +1 -0
- package/dist/connect/stdio-entry.js +6 -0
- package/dist/connect/stdio-entry.js.map +1 -0
- package/dist/connect/stdio.d.ts +5 -0
- package/dist/connect/stdio.js +33 -0
- package/dist/connect/stdio.js.map +1 -0
- package/dist/daemon.d.ts +64 -2
- package/dist/daemon.js +399 -33
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-consumed-watch.d.ts +2 -0
- package/dist/delivery-consumed-watch.js +4 -1
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/dispatcher-liveness.d.ts +51 -1
- package/dist/dispatcher-liveness.js +92 -2
- package/dist/dispatcher-liveness.js.map +1 -1
- package/dist/event-log.d.ts +13 -1
- package/dist/event-log.js +41 -1
- package/dist/event-log.js.map +1 -1
- package/dist/fleet-manager.d.ts +239 -7
- package/dist/fleet-manager.js +1387 -103
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.js +4 -2
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +11 -1
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +10 -0
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +18 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +302 -29
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +4 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +127 -26
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +2 -0
- package/dist/hub/admin-dashboard.d.ts +85 -0
- package/dist/hub/admin-dashboard.js +177 -0
- package/dist/hub/admin-dashboard.js.map +1 -0
- package/dist/hub/agent-catalog-model.d.ts +276 -0
- package/dist/hub/agent-catalog-model.js +49 -0
- package/dist/hub/agent-catalog-model.js.map +1 -0
- package/dist/hub/agent-catalog.d.ts +137 -0
- package/dist/hub/agent-catalog.js +118 -0
- package/dist/hub/agent-catalog.js.map +1 -0
- package/dist/hub/agent-intro.d.ts +31 -0
- package/dist/hub/agent-intro.js +51 -0
- package/dist/hub/agent-intro.js.map +1 -0
- package/dist/hub/attachments/store.d.ts +2 -0
- package/dist/hub/attachments/store.js +6 -0
- package/dist/hub/attachments/store.js.map +1 -1
- package/dist/hub/audit/index.d.ts +2 -0
- package/dist/hub/audit/index.js +8 -0
- package/dist/hub/audit/index.js.map +1 -1
- package/dist/hub/buttons.js +3 -1
- package/dist/hub/buttons.js.map +1 -1
- package/dist/hub/catalog.d.ts +11 -6
- package/dist/hub/catalog.js +38 -13
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.d.ts +15 -0
- package/dist/hub/client.js +106 -12
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +28 -0
- package/dist/hub/compose/member.js +300 -27
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +17 -0
- package/dist/hub/compose/server.js +108 -14
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/display-name.d.ts +10 -0
- package/dist/hub/display-name.js +35 -0
- package/dist/hub/display-name.js.map +1 -0
- package/dist/hub/execution/service.d.ts +2 -1
- package/dist/hub/execution/service.js +2 -1
- package/dist/hub/execution/service.js.map +1 -1
- package/dist/hub/fleet-info.d.ts +12 -0
- package/dist/hub/fleet-info.js +14 -0
- package/dist/hub/fleet-info.js.map +1 -0
- package/dist/hub/fleet-update-model.d.ts +100 -0
- package/dist/hub/fleet-update-model.js +15 -0
- package/dist/hub/fleet-update-model.js.map +1 -0
- package/dist/hub/fleet-updates.d.ts +46 -0
- package/dist/hub/fleet-updates.js +282 -0
- package/dist/hub/fleet-updates.js.map +1 -0
- package/dist/hub/fleet-versions.d.ts +28 -0
- package/dist/hub/fleet-versions.js +80 -0
- package/dist/hub/fleet-versions.js.map +1 -0
- package/dist/hub/group-policy/admin-api.d.ts +1 -0
- package/dist/hub/group-policy/admin-api.js +10 -1
- package/dist/hub/group-policy/admin-api.js.map +1 -1
- package/dist/hub/group-policy/admin-control.d.ts +1 -0
- package/dist/hub/group-policy/admin-control.js +13 -4
- package/dist/hub/group-policy/admin-control.js.map +1 -1
- package/dist/hub/group-policy/admin-dto.d.ts +39 -1
- package/dist/hub/group-policy/admin-dto.js.map +1 -1
- package/dist/hub/group-policy/admin-facts.d.ts +4 -2
- package/dist/hub/group-policy/admin-facts.js +17 -2
- package/dist/hub/group-policy/admin-facts.js.map +1 -1
- package/dist/hub/group-policy/admin-impact.d.ts +36 -6
- package/dist/hub/group-policy/admin-impact.js +21 -7
- package/dist/hub/group-policy/admin-impact.js.map +1 -1
- package/dist/hub/group-policy/admin-inventory.d.ts +2 -0
- package/dist/hub/group-policy/admin-inventory.js +13 -4
- package/dist/hub/group-policy/admin-inventory.js.map +1 -1
- package/dist/hub/group-policy/admin-search.d.ts +2 -1
- package/dist/hub/group-policy/admin-search.js +56 -7
- package/dist/hub/group-policy/admin-search.js.map +1 -1
- package/dist/hub/group-policy/authorization.d.ts +2 -0
- package/dist/hub/group-policy/authorization.js +7 -2
- package/dist/hub/group-policy/authorization.js.map +1 -1
- package/dist/hub/group-policy/impact-inventory.d.ts +4 -1
- package/dist/hub/group-policy/impact-inventory.js +23 -2
- package/dist/hub/group-policy/impact-inventory.js.map +1 -1
- package/dist/hub/group-policy/model.d.ts +52 -1
- package/dist/hub/group-policy/model.js +20 -7
- package/dist/hub/group-policy/model.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +2 -0
- package/dist/hub/group-policy/resources.js +12 -1
- package/dist/hub/group-policy/resources.js.map +1 -1
- package/dist/hub/group-policy/store.js +22 -3
- package/dist/hub/group-policy/store.js.map +1 -1
- package/dist/hub/group-policy/team-subjects.d.ts +16 -0
- package/dist/hub/group-policy/team-subjects.js +32 -0
- package/dist/hub/group-policy/team-subjects.js.map +1 -0
- package/dist/hub/http/compose.d.ts +4 -0
- package/dist/hub/http/compose.js +477 -40
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.js +27 -0
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +13 -0
- package/dist/hub/http/schema.js +30 -1
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/join/client.js +75 -42
- package/dist/hub/join/client.js.map +1 -1
- package/dist/hub/join/service.d.ts +1 -1
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/mcp/auth-schema.d.ts +7 -0
- package/dist/hub/mcp/auth-schema.js +31 -0
- package/dist/hub/mcp/auth-schema.js.map +1 -0
- package/dist/hub/mcp/auth.d.ts +89 -0
- package/dist/hub/mcp/auth.js +374 -0
- package/dist/hub/mcp/auth.js.map +1 -0
- package/dist/hub/mcp/catalog.d.ts +44 -0
- package/dist/hub/mcp/catalog.js +31 -0
- package/dist/hub/mcp/catalog.js.map +1 -0
- package/dist/hub/mcp/door-schema.d.ts +7 -0
- package/dist/hub/mcp/door-schema.js +20 -0
- package/dist/hub/mcp/door-schema.js.map +1 -0
- package/dist/hub/mcp/http.d.ts +25 -0
- package/dist/hub/mcp/http.js +259 -0
- package/dist/hub/mcp/http.js.map +1 -0
- package/dist/hub/mcp/policy.d.ts +65 -0
- package/dist/hub/mcp/policy.js +153 -0
- package/dist/hub/mcp/policy.js.map +1 -0
- package/dist/hub/mcp/server.d.ts +3 -0
- package/dist/hub/mcp/server.js +32 -0
- package/dist/hub/mcp/server.js.map +1 -0
- package/dist/hub/mcp/tools.d.ts +31 -0
- package/dist/hub/mcp/tools.js +177 -0
- package/dist/hub/mcp/tools.js.map +1 -0
- package/dist/hub/member/agent-catalog.d.ts +28 -0
- package/dist/hub/member/agent-catalog.js +80 -0
- package/dist/hub/member/agent-catalog.js.map +1 -0
- package/dist/hub/member/display-name.d.ts +9 -0
- package/dist/hub/member/display-name.js +71 -0
- package/dist/hub/member/display-name.js.map +1 -0
- package/dist/hub/member/exposure-api.d.ts +9 -3
- package/dist/hub/member/exposure-api.js +16 -9
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/exposures.d.ts +16 -4
- package/dist/hub/member/exposures.js +47 -13
- package/dist/hub/member/exposures.js.map +1 -1
- package/dist/hub/member/pairing-api.js +3 -2
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/member/recommendations.d.ts +37 -0
- package/dist/hub/member/recommendations.js +129 -0
- package/dist/hub/member/recommendations.js.map +1 -0
- package/dist/hub/member/room-ask.d.ts +68 -5
- package/dist/hub/member/room-ask.js +273 -25
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-context-budget.d.ts +5 -0
- package/dist/hub/member/room-context-budget.js +34 -0
- package/dist/hub/member/room-context-budget.js.map +1 -0
- package/dist/hub/member/room-mention-feedback.d.ts +44 -0
- package/dist/hub/member/room-mention-feedback.js +121 -0
- package/dist/hub/member/room-mention-feedback.js.map +1 -0
- package/dist/hub/member/room-notification.d.ts +9 -0
- package/dist/hub/member/room-notification.js +2 -0
- package/dist/hub/member/room-notification.js.map +1 -0
- package/dist/hub/member/room-post-answers.d.ts +46 -0
- package/dist/hub/member/room-post-answers.js +152 -0
- package/dist/hub/member/room-post-answers.js.map +1 -0
- package/dist/hub/member/room-post-receipt.d.ts +21 -0
- package/dist/hub/member/room-post-receipt.js +49 -0
- package/dist/hub/member/room-post-receipt.js.map +1 -0
- package/dist/hub/member/room-post.d.ts +103 -0
- package/dist/hub/member/room-post.js +231 -0
- package/dist/hub/member/room-post.js.map +1 -0
- package/dist/hub/member/sharing-journal.d.ts +252 -0
- package/dist/hub/member/sharing-journal.js +212 -0
- package/dist/hub/member/sharing-journal.js.map +1 -0
- package/dist/hub/member/sharing-link.d.ts +25 -0
- package/dist/hub/member/sharing-link.js +68 -0
- package/dist/hub/member/sharing-link.js.map +1 -0
- package/dist/hub/member/sharing-result.d.ts +6 -0
- package/dist/hub/member/sharing-result.js +46 -0
- package/dist/hub/member/sharing-result.js.map +1 -0
- package/dist/hub/member/sharing.d.ts +37 -0
- package/dist/hub/member/sharing.js +181 -0
- package/dist/hub/member/sharing.js.map +1 -0
- package/dist/hub/member/updates.d.ts +92 -0
- package/dist/hub/member/updates.js +316 -0
- package/dist/hub/member/updates.js.map +1 -0
- package/dist/hub/pairing.d.ts +15 -1
- package/dist/hub/pairing.js +33 -2
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/person-prefs.d.ts +22 -0
- package/dist/hub/person-prefs.js +34 -0
- package/dist/hub/person-prefs.js.map +1 -0
- package/dist/hub/personal/owner-host.d.ts +146 -0
- package/dist/hub/personal/owner-host.js +289 -0
- package/dist/hub/personal/owner-host.js.map +1 -0
- package/dist/hub/personal/refusals.d.ts +11 -0
- package/dist/hub/personal/refusals.js +33 -0
- package/dist/hub/personal/refusals.js.map +1 -0
- package/dist/hub/personal/runtime-host.d.ts +26 -0
- package/dist/hub/personal/runtime-host.js +51 -0
- package/dist/hub/personal/runtime-host.js.map +1 -0
- package/dist/hub/personal/schema.d.ts +4 -0
- package/dist/hub/personal/schema.js +54 -0
- package/dist/hub/personal/schema.js.map +1 -0
- package/dist/hub/personal/turns.d.ts +39 -0
- package/dist/hub/personal/turns.js +221 -0
- package/dist/hub/personal/turns.js.map +1 -0
- package/dist/hub/personal/types.d.ts +42 -0
- package/dist/hub/personal/types.js +2 -0
- package/dist/hub/personal/types.js.map +1 -0
- package/dist/hub/policy.d.ts +1 -1
- package/dist/hub/policy.js +2 -0
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/protocol.d.ts +927 -1
- package/dist/hub/protocol.js +106 -14
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/published-version.d.ts +3 -0
- package/dist/hub/published-version.js +35 -0
- package/dist/hub/published-version.js.map +1 -0
- package/dist/hub/quota.js +3 -1
- package/dist/hub/quota.js.map +1 -1
- package/dist/hub/recommendation-model.d.ts +36 -0
- package/dist/hub/recommendation-model.js +9 -0
- package/dist/hub/recommendation-model.js.map +1 -0
- package/dist/hub/recommendations.d.ts +58 -0
- package/dist/hub/recommendations.js +211 -0
- package/dist/hub/recommendations.js.map +1 -0
- package/dist/hub/representative.d.ts +5 -0
- package/dist/hub/representative.js +6 -1
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/roles/admin-control.d.ts +29 -0
- package/dist/hub/roles/admin-control.js +187 -0
- package/dist/hub/roles/admin-control.js.map +1 -0
- package/dist/hub/roles/admin-types.d.ts +72 -0
- package/dist/hub/roles/admin-types.js +2 -0
- package/dist/hub/roles/admin-types.js.map +1 -0
- package/dist/hub/roles/allowed-list-control.d.ts +34 -0
- package/dist/hub/roles/allowed-list-control.js +179 -0
- package/dist/hub/roles/allowed-list-control.js.map +1 -0
- package/dist/hub/roles/allowed-list.d.ts +8 -0
- package/dist/hub/roles/allowed-list.js +49 -0
- package/dist/hub/roles/allowed-list.js.map +1 -0
- package/dist/hub/roles/audit-details.d.ts +144 -0
- package/dist/hub/roles/audit-details.js +26 -0
- package/dist/hub/roles/audit-details.js.map +1 -0
- package/dist/hub/roles/authority.d.ts +12 -0
- package/dist/hub/roles/authority.js +39 -3
- package/dist/hub/roles/authority.js.map +1 -1
- package/dist/hub/roles/change.d.ts +3 -1
- package/dist/hub/roles/change.js +7 -2
- package/dist/hub/roles/change.js.map +1 -1
- package/dist/hub/roles/clock.d.ts +3 -0
- package/dist/hub/roles/clock.js +1 -1
- package/dist/hub/roles/clock.js.map +1 -1
- package/dist/hub/roles/convert.js +1 -1
- package/dist/hub/roles/convert.js.map +1 -1
- package/dist/hub/roles/cutover-inventory.d.ts +2 -0
- package/dist/hub/roles/cutover-inventory.js +8 -1
- package/dist/hub/roles/cutover-inventory.js.map +1 -1
- package/dist/hub/roles/cutover.d.ts +2 -2
- package/dist/hub/roles/cutover.js +3 -4
- package/dist/hub/roles/cutover.js.map +1 -1
- package/dist/hub/roles/delegation.d.ts +4 -1
- package/dist/hub/roles/delegation.js +7 -2
- package/dist/hub/roles/delegation.js.map +1 -1
- package/dist/hub/roles/evaluate.d.ts +2 -1
- package/dist/hub/roles/evaluate.js +14 -0
- package/dist/hub/roles/evaluate.js.map +1 -1
- package/dist/hub/roles/expiry-effects.d.ts +8 -0
- package/dist/hub/roles/expiry-effects.js +50 -0
- package/dist/hub/roles/expiry-effects.js.map +1 -0
- package/dist/hub/roles/migrations.d.ts +7 -0
- package/dist/hub/roles/migrations.js +44 -0
- package/dist/hub/roles/migrations.js.map +1 -0
- package/dist/hub/roles/model.d.ts +25 -0
- package/dist/hub/roles/model.js +9 -3
- package/dist/hub/roles/model.js.map +1 -1
- package/dist/hub/roles/overview.d.ts +8 -0
- package/dist/hub/roles/overview.js +15 -0
- package/dist/hub/roles/overview.js.map +1 -0
- package/dist/hub/roles/resource-effects.d.ts +17 -0
- package/dist/hub/roles/resource-effects.js +62 -0
- package/dist/hub/roles/resource-effects.js.map +1 -0
- package/dist/hub/roles/review.d.ts +16 -0
- package/dist/hub/roles/review.js +42 -0
- package/dist/hub/roles/review.js.map +1 -0
- package/dist/hub/roles/writer.d.ts +14 -3
- package/dist/hub/roles/writer.js +64 -16
- package/dist/hub/roles/writer.js.map +1 -1
- package/dist/hub/room-context-model.d.ts +43 -0
- package/dist/hub/room-context-model.js +12 -0
- package/dist/hub/room-context-model.js.map +1 -0
- package/dist/hub/room-mention-feedback-model.d.ts +12 -0
- package/dist/hub/room-mention-feedback-model.js +12 -0
- package/dist/hub/room-mention-feedback-model.js.map +1 -0
- package/dist/hub/rooms/agents.d.ts +45 -10
- package/dist/hub/rooms/agents.js +289 -31
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/assistant.d.ts +1 -6
- package/dist/hub/rooms/assistant.js +7 -2
- package/dist/hub/rooms/assistant.js.map +1 -1
- package/dist/hub/rooms/automation.d.ts +24 -0
- package/dist/hub/rooms/automation.js +66 -0
- package/dist/hub/rooms/automation.js.map +1 -0
- package/dist/hub/rooms/buttons.d.ts +85 -0
- package/dist/hub/rooms/buttons.js +62 -0
- package/dist/hub/rooms/buttons.js.map +1 -0
- package/dist/hub/rooms/context-cursor.d.ts +18 -0
- package/dist/hub/rooms/context-cursor.js +61 -0
- package/dist/hub/rooms/context-cursor.js.map +1 -0
- package/dist/hub/rooms/context.d.ts +1 -1
- package/dist/hub/rooms/context.js +4 -4
- package/dist/hub/rooms/context.js.map +1 -1
- package/dist/hub/rooms/direct-view.d.ts +10 -2
- package/dist/hub/rooms/direct-view.js +4 -4
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/mentions.d.ts +15 -0
- package/dist/hub/rooms/mentions.js +43 -0
- package/dist/hub/rooms/mentions.js.map +1 -0
- package/dist/hub/rooms/post-replies.d.ts +23 -0
- package/dist/hub/rooms/post-replies.js +114 -0
- package/dist/hub/rooms/post-replies.js.map +1 -0
- package/dist/hub/rooms/schema.d.ts +9 -0
- package/dist/hub/rooms/schema.js +43 -0
- package/dist/hub/rooms/schema.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +195 -4
- package/dist/hub/rooms/service.js +812 -28
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +30 -3
- package/dist/hub/rooms.d.ts +13 -2
- package/dist/hub/rooms.js +97 -22
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/runtime.js +17 -4
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.d.ts +8 -1
- package/dist/hub/server.js +115 -7
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-directory-transition.d.ts +2 -1
- package/dist/hub/session-directory-transition.js +10 -3
- package/dist/hub/session-directory-transition.js.map +1 -1
- package/dist/hub/sessions.d.ts +1 -1
- package/dist/hub/sessions.js +26 -4
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/settings-commit.d.ts +32 -1
- package/dist/hub/settings-commit.js +11 -4
- package/dist/hub/settings-commit.js.map +1 -1
- package/dist/hub/settings-directory-ca.js +1 -1
- package/dist/hub/settings-directory-ca.js.map +1 -1
- package/dist/hub/settings-directory-control.js +7 -7
- package/dist/hub/settings-directory-control.js.map +1 -1
- package/dist/hub/settings-directory-http.d.ts +2 -0
- package/dist/hub/settings-directory-http.js +21 -6
- package/dist/hub/settings-directory-http.js.map +1 -1
- package/dist/hub/settings-directory-proof.d.ts +5 -1
- package/dist/hub/settings-directory-proof.js +49 -10
- package/dist/hub/settings-directory-proof.js.map +1 -1
- package/dist/hub/settings-directory-recovery.js +2 -1
- package/dist/hub/settings-directory-recovery.js.map +1 -1
- package/dist/hub/settings-directory-save.d.ts +2 -0
- package/dist/hub/settings-directory-save.js +9 -6
- package/dist/hub/settings-directory-save.js.map +1 -1
- package/dist/hub/sharing-previous-access.d.ts +22 -0
- package/dist/hub/sharing-previous-access.js +93 -0
- package/dist/hub/sharing-previous-access.js.map +1 -0
- package/dist/hub/sharing-requests.d.ts +171 -0
- package/dist/hub/sharing-requests.js +311 -0
- package/dist/hub/sharing-requests.js.map +1 -0
- package/dist/hub/sharing-retention.d.ts +47 -0
- package/dist/hub/sharing-retention.js +83 -0
- package/dist/hub/sharing-retention.js.map +1 -0
- package/dist/hub/sharing-withdrawal.d.ts +14 -0
- package/dist/hub/sharing-withdrawal.js +28 -0
- package/dist/hub/sharing-withdrawal.js.map +1 -0
- package/dist/hub/sharing.js +2 -2
- package/dist/hub/sharing.js.map +1 -1
- package/dist/hub/socket.d.ts +1 -0
- package/dist/hub/socket.js +39 -2
- package/dist/hub/socket.js.map +1 -1
- package/dist/hub/teams/index.d.ts +8 -3
- package/dist/hub/teams/index.js +106 -31
- package/dist/hub/teams/index.js.map +1 -1
- package/dist/hub/teams/store.d.ts +5 -1
- package/dist/hub/teams/store.js +25 -2
- package/dist/hub/teams/store.js.map +1 -1
- package/dist/hub/teams/types.d.ts +19 -2
- package/dist/hub/types.d.ts +163 -5
- package/dist/hub-classic-private.d.ts +19 -0
- package/dist/hub-classic-private.js +64 -0
- package/dist/hub-classic-private.js.map +1 -0
- package/dist/hub-contact-windows.d.ts +11 -0
- package/dist/hub-contact-windows.js +56 -0
- package/dist/hub-contact-windows.js.map +1 -0
- package/dist/hub-page-sharing-settings.d.ts +6 -0
- package/dist/hub-page-sharing-settings.js +19 -0
- package/dist/hub-page-sharing-settings.js.map +1 -0
- package/dist/hub-pairing-summary.d.ts +1 -1
- package/dist/hub-room-conversation.d.ts +14 -0
- package/dist/hub-room-conversation.js +60 -0
- package/dist/hub-room-conversation.js.map +1 -0
- package/dist/hub-sharing-notice.d.ts +43 -0
- package/dist/hub-sharing-notice.js +34 -0
- package/dist/hub-sharing-notice.js.map +1 -0
- package/dist/hub-update-notice.d.ts +12 -0
- package/dist/hub-update-notice.js +35 -0
- package/dist/hub-update-notice.js.map +1 -0
- package/dist/human-delivery-receipts.js +8 -0
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/instance-config-impact.js +3 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instructions.js +3 -0
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +195 -24
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +19 -2
- package/dist/login-controller.js +26 -8
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.js +1 -1
- package/dist/login-flows.js.map +1 -1
- package/dist/native-mcp.js +7 -5
- package/dist/native-mcp.js.map +1 -1
- package/dist/native-model-catalog.d.ts +15 -0
- package/dist/native-model-catalog.js +43 -3
- package/dist/native-model-catalog.js.map +1 -1
- package/dist/native-pane-lifecycle.js +3 -2
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-tools.js +3 -0
- package/dist/native-pane-tools.js.map +1 -1
- package/dist/needs-you.js +1 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +2 -2
- package/dist/office-share-page.js.map +1 -1
- package/dist/outbound-handlers.d.ts +14 -4
- package/dist/outbound-handlers.js +54 -1
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +17 -0
- package/dist/outbound-schemas.js +14 -0
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-port.d.ts +2 -0
- package/dist/public-web-gateway.js +155 -5
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/queued-handoffs.d.ts +16 -4
- package/dist/queued-handoffs.js +18 -1
- package/dist/queued-handoffs.js.map +1 -1
- package/dist/quickstart-api.d.ts +0 -1
- package/dist/quickstart-api.js +8 -1
- package/dist/quickstart-api.js.map +1 -1
- package/dist/remote-card-answer.d.ts +1 -1
- package/dist/remote-card-answer.js +8 -1
- package/dist/remote-card-answer.js.map +1 -1
- package/dist/remote-card-prompt.js +1 -1
- package/dist/remote-card-prompt.js.map +1 -1
- package/dist/reply-dedup.js +3 -1
- package/dist/reply-dedup.js.map +1 -1
- package/dist/reply-preview-files.d.ts +38 -0
- package/dist/reply-preview-files.js +142 -0
- package/dist/reply-preview-files.js.map +1 -0
- package/dist/reply-preview-spec.d.ts +18 -0
- package/dist/reply-preview-spec.js +27 -0
- package/dist/reply-preview-spec.js.map +1 -0
- package/dist/runtime-api.js +10 -2
- package/dist/runtime-api.js.map +1 -1
- package/dist/runtime-build-info.js +1 -0
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli-install.js +13 -10
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/runtime-cli.js +31 -5
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.d.ts +5 -0
- package/dist/runtime-client-store.js +28 -0
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.d.ts +4 -0
- package/dist/runtime-client.js +33 -10
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +4 -2
- package/dist/runtime-coordinator.js +33 -6
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-install.d.ts +6 -1
- package/dist/runtime-install.js +12 -4
- package/dist/runtime-install.js.map +1 -1
- package/dist/runtime-pane-native.js +3 -1
- package/dist/runtime-pane-native.js.map +1 -1
- package/dist/runtime-personal-answer-only-probe.d.ts +3 -0
- package/dist/runtime-personal-answer-only-probe.js +134 -0
- package/dist/runtime-personal-answer-only-probe.js.map +1 -0
- package/dist/runtime-personal-answer-only.d.ts +16 -0
- package/dist/runtime-personal-answer-only.js +54 -0
- package/dist/runtime-personal-answer-only.js.map +1 -0
- package/dist/runtime-personal-answer.d.ts +30 -0
- package/dist/runtime-personal-answer.js +124 -0
- package/dist/runtime-personal-answer.js.map +1 -0
- package/dist/runtime-personal-preflight.d.ts +8 -0
- package/dist/runtime-personal-preflight.js +103 -0
- package/dist/runtime-personal-preflight.js.map +1 -0
- package/dist/runtime-personal-profile.d.ts +40 -0
- package/dist/runtime-personal-profile.js +81 -0
- package/dist/runtime-personal-profile.js.map +1 -0
- package/dist/runtime-personal-protocol.d.ts +10 -0
- package/dist/runtime-personal-protocol.js +15 -0
- package/dist/runtime-personal-protocol.js.map +1 -0
- package/dist/runtime-personal-stage.d.ts +37 -0
- package/dist/runtime-personal-stage.js +167 -0
- package/dist/runtime-personal-stage.js.map +1 -0
- package/dist/runtime-protocol.d.ts +2 -0
- package/dist/settings-api.d.ts +16 -0
- package/dist/settings-api.js +294 -86
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +3 -0
- package/dist/settings-baseline.js +2 -2
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +33 -5
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +3 -0
- package/dist/settings-effect.js +29 -3
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.js +18 -44
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/setup-form.js +10 -0
- package/dist/setup-form.js.map +1 -1
- package/dist/setup-i18n.js +2 -2
- package/dist/setup-i18n.js.map +1 -1
- package/dist/subagent-records.js +53 -11
- package/dist/subagent-records.js.map +1 -1
- package/dist/subagent-service.js +3 -1
- package/dist/subagent-service.js.map +1 -1
- package/dist/tmux-manager.d.ts +2 -0
- package/dist/tmux-manager.js +2 -0
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tool-permissions.js +3 -0
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-progress.d.ts +9 -0
- package/dist/tool-progress.js +141 -32
- package/dist/tool-progress.js.map +1 -1
- package/dist/transcript-needles.d.ts +4 -2
- package/dist/transcript-needles.js +35 -4
- package/dist/transcript-needles.js.map +1 -1
- package/dist/tunnel/lease.d.ts +14 -0
- package/dist/tunnel/lease.js +23 -0
- package/dist/tunnel/lease.js.map +1 -1
- package/dist/turn-reply-guard.d.ts +2 -2
- package/dist/turn-reply-guard.js +3 -3
- package/dist/turn-reply-guard.js.map +1 -1
- package/dist/types.d.ts +12 -2
- package/dist/ui/backend-signin.js +91 -22
- package/dist/ui/chat-activity-groups.js +41 -8
- package/dist/ui/chat-activity.js +5 -3
- package/dist/ui/chat-mentions.js +13 -0
- package/dist/ui/chat-msg-actions.js +3 -222
- package/dist/ui/chat-pins.js +106 -0
- package/dist/ui/chat-popout-header.js +2 -2
- package/dist/ui/chat-store.js +143 -7
- package/dist/ui/chat-tour.js +1 -1
- package/dist/ui/chat-workspace.js +3 -3
- package/dist/ui/fleet-canvas.js +14 -5
- package/dist/ui/fleet-office-card.js +8 -4
- package/dist/ui/fleet-office-carousel.d.ts +14 -0
- package/dist/ui/fleet-office-carousel.js +95 -0
- package/dist/ui/fleet-office-editor.js +6 -1
- package/dist/ui/fleet-office-model.js +2 -1
- package/dist/ui/fleet-office-pack.d.ts +1 -0
- package/dist/ui/fleet-office-pack.js +6 -2
- package/dist/ui/fleet-office-play.js +84 -0
- package/dist/ui/fleet-office-skin.js +1 -1
- package/dist/ui/fleet-office-store.js +37 -2
- package/dist/ui/fleet-office-zones.js +55 -10
- package/dist/ui/fleet-office.js +281 -32
- package/dist/ui/fleet-tasks.js +1 -1
- package/dist/ui/host-install.js +5 -2
- package/dist/ui/hub-admin-overview.js +189 -0
- package/dist/ui/hub-admin-rooms.js +1 -1
- package/dist/ui/hub-agent-copy.js +6 -2
- package/dist/ui/hub-agent-intro.js +26 -0
- package/dist/ui/hub-ai-apps-strings.js +6 -0
- package/dist/ui/hub-ai-apps.js +83 -0
- package/dist/ui/hub-chat-strings.js +9 -2
- package/dist/ui/hub-client.js +87 -5
- package/dist/ui/hub-directory-editor-strings.js +2 -2
- package/dist/ui/hub-directory-editor.js +1 -0
- package/dist/ui/hub-fleet-versions.js +393 -0
- package/dist/ui/hub-grant-picker.js +26 -46
- package/dist/ui/hub-group-policy.js +26 -13
- package/dist/ui/hub-group-strings.js +26 -17
- package/dist/ui/hub-join-steps.js +27 -15
- package/dist/ui/hub-my-agents-model.js +42 -0
- package/dist/ui/hub-my-agents-strings.js +18 -0
- package/dist/ui/hub-my-agents.js +141 -0
- package/dist/ui/hub-owner-strings.js +7 -7
- package/dist/ui/hub-personal-agent-strings.js +246 -0
- package/dist/ui/hub-personal-agent.js +118 -0
- package/dist/ui/hub-policy-subjects.js +35 -0
- package/dist/ui/hub-quick-pairing.js +7 -2
- package/dist/ui/hub-role-audit.js +39 -0
- package/dist/ui/hub-role-forms.js +99 -0
- package/dist/ui/hub-role-notices.js +11 -0
- package/dist/ui/hub-role-view.js +86 -0
- package/dist/ui/hub-roles-strings.js +439 -0
- package/dist/ui/hub-roles.js +83 -0
- package/dist/ui/hub-room-agent-strings.js +28 -0
- package/dist/ui/hub-room-composer.js +45 -13
- package/dist/ui/hub-room-favorites.js +63 -5
- package/dist/ui/hub-room-list.js +5 -3
- package/dist/ui/hub-room-members-strings.js +2 -2
- package/dist/ui/hub-room-members.js +9 -5
- package/dist/ui/hub-room-new.js +1 -1
- package/dist/ui/hub-room-notify.js +161 -0
- package/dist/ui/hub-room-search.js +126 -0
- package/dist/ui/hub-room-settings.js +6 -0
- package/dist/ui/hub-room-source-strings.js +17 -0
- package/dist/ui/hub-room-source.js +34 -0
- package/dist/ui/hub-room-strings.js +49 -3
- package/dist/ui/hub-room-thread.js +269 -42
- package/dist/ui/hub-room-unread.js +2 -1
- package/dist/ui/hub-strings.js +13 -5
- package/dist/ui/hub-subject-picker.js +58 -0
- package/dist/ui/hub-switcher.js +2 -2
- package/dist/ui/hub-teams-strings.js +10 -6
- package/dist/ui/hub-teams.js +56 -28
- package/dist/ui/hub-this-hub.js +2 -2
- package/dist/ui/hub-welcome.js +122 -75
- package/dist/ui/image-annotate.js +2 -283
- package/dist/ui/image-lightbox.js +2 -176
- package/dist/ui/image-zoom.js +2 -242
- package/dist/ui/model-picker.js +4 -1
- package/dist/ui/notice-hub-sharing.js +81 -0
- package/dist/ui/notice-hub-update.js +94 -0
- package/dist/ui/office-share-dialog.js +2 -2
- package/dist/ui/panel-chat.js +327 -28
- package/dist/ui/panel-details.js +3 -1
- package/dist/ui/panel-fleet.js +28 -7
- package/dist/ui/panel-hub.js +303 -103
- package/dist/ui/panel-log.js +4 -4
- package/dist/ui/panel-notices.js +4 -1
- package/dist/ui/panel-settings.js +45 -34
- package/dist/ui/preview-panel.js +3 -1
- package/dist/ui/reply-file-preview.js +64 -0
- package/dist/ui/runtime-commands.d.ts +2 -2
- package/dist/ui/runtime-commands.js +7 -4
- package/dist/ui/settings-access-overview.js +3 -3
- package/dist/ui/settings-appearance.js +7 -10
- package/dist/ui/settings-archive-files.js +109 -0
- package/dist/ui/settings-build-version.js +2 -2
- package/dist/ui/settings-catalog.js +22 -0
- package/dist/ui/settings-connector-strings.js +23 -0
- package/dist/ui/settings-connector.js +39 -0
- package/dist/ui/settings-guests-entries.js +16 -0
- package/dist/ui/settings-guests.js +57 -15
- package/dist/ui/settings-hub-connection.js +6 -7
- package/dist/ui/settings-hub-membership.js +6 -7
- package/dist/ui/settings-hub-page-sharing.js +52 -0
- package/dist/ui/settings-hub-section.js +2 -4
- package/dist/ui/settings-hub-setup.js +2 -1
- package/dist/ui/settings-hub-updates.js +67 -0
- package/dist/ui/settings-hub.js +34 -6
- package/dist/ui/settings-layout.js +10 -12
- package/dist/ui/settings-registry.js +19 -3
- package/dist/ui/settings-shared-strings.js +2 -0
- package/dist/ui/settings-strings.js +13 -2
- package/dist/ui/settings-update.js +11 -5
- package/dist/ui/settings-web-authority.js +7 -5
- package/dist/ui/shared/access-overview.css +1 -1
- package/dist/ui/shared/accounts-keepalive.css +1 -1
- package/dist/ui/shared/accounts.css +1 -1
- package/dist/ui/shared/agent-sheet.js +116 -0
- package/dist/ui/shared/agent-widget.js +1 -2
- package/dist/ui/shared/app-i18n.js +4 -0
- package/dist/ui/shared/app-nav.js +9 -5
- package/dist/ui/shared/app-prefs.js +9 -3
- package/dist/ui/shared/app-route.js +4 -2
- package/dist/ui/shared/app-shell.js +184 -23
- package/dist/ui/shared/app-store.js +7 -3
- package/dist/ui/shared/app-stream.js +6 -2
- package/dist/ui/shared/app-swipe.js +3 -1
- package/dist/ui/shared/app-themes.js +3 -5
- package/dist/ui/shared/app-update.js +90 -8
- package/dist/ui/shared/app.css +469 -203
- package/dist/ui/shared/app.js +1 -1
- package/dist/ui/shared/chat-composer.js +29 -5
- package/dist/ui/shared/chat-msg-actions.js +231 -0
- package/dist/ui/shared/chat-strings.js +19 -4
- package/dist/ui/shared/chat-thread.js +120 -17
- package/dist/ui/shared/chat-work-bar.css +118 -0
- package/dist/ui/shared/connector-prompt.d.ts +3 -0
- package/dist/ui/shared/connector-prompt.js +20 -0
- package/dist/ui/shared/hub-ai-apps.css +12 -0
- package/dist/ui/shared/hub-chat.css +61 -4
- package/dist/ui/shared/hub-groups.css +19 -15
- package/dist/ui/shared/hub-my-agents.css +35 -0
- package/dist/ui/shared/hub-owner.css +118 -3
- package/dist/ui/shared/hub-roles.css +99 -0
- package/dist/ui/shared/hub-rooms-u2.css +34 -0
- package/dist/ui/shared/hub.css +23 -5
- package/dist/ui/shared/image-annotate.css +22 -3
- package/dist/ui/shared/image-annotate.js +415 -0
- package/dist/ui/shared/image-lightbox.js +218 -0
- package/dist/ui/shared/image-zoom.js +316 -0
- package/dist/ui/shared/instance-nav.js +120 -15
- package/dist/ui/shared/loading.css +1 -1
- package/dist/ui/shared/model-picker.css +32 -4
- package/dist/ui/shared/owner-css.js +1 -1
- package/dist/ui/shared/panel-view.js +7 -1
- package/dist/ui/shared/preview-panel-actions.js +1 -1
- package/dist/ui/shared/preview-panel.js +6 -2
- package/dist/ui/shared/reply-previews.css +4 -0
- package/dist/ui/shared/runtime-install.css +5 -0
- package/dist/ui/shared/settings-connector.css +7 -0
- package/dist/ui/shared/signin.js +27 -12
- package/dist/ui/shared/task-board.css +2 -2
- package/dist/ui/shared/theme.js +52 -0
- package/dist/ui/shared/tokens.css +27 -10
- package/dist/ui/shared/ui-icons.js +2 -0
- package/dist/ui/shared/ui-toast.js +4 -4
- package/dist/ui/shared/usage-dialog.js +113 -17
- package/dist/ui/shared/view-strings.js +26 -4
- package/dist/ui/shared/web-authorize.js +3 -3
- package/dist/ui/signin.html +4 -2
- package/dist/ui/structured-signin.js +64 -12
- package/dist/ui/web-terminal/terminal.css +1 -1
- package/dist/ui/workspace-panel.js +4 -3
- package/dist/update-dispatch.d.ts +8 -1
- package/dist/update-dispatch.js +16 -1
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-idle.d.ts +65 -0
- package/dist/update-idle.js +190 -0
- package/dist/update-idle.js.map +1 -0
- package/dist/update-launch.d.ts +1 -1
- package/dist/update-launch.js +9 -2
- package/dist/update-launch.js.map +1 -1
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +1 -1
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/profile-timeline.d.ts +2 -0
- package/dist/usage/profile-timeline.js +4 -0
- package/dist/usage/profile-timeline.js.map +1 -1
- package/dist/usage/providers.js +6 -6
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/quota-history.d.ts +1 -1
- package/dist/view-api.js +1 -1
- package/dist/view-api.js.map +1 -1
- package/dist/web-api.d.ts +13 -1
- package/dist/web-api.js +489 -189
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +5 -1
- package/dist/web-backend-login.js +8 -2
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-chat-archive.d.ts +147 -0
- package/dist/web-chat-archive.js +530 -0
- package/dist/web-chat-archive.js.map +1 -0
- package/dist/web-chat-history.d.ts +76 -0
- package/dist/web-chat-history.js +145 -1
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-commands.d.ts +4 -3
- package/dist/web-commands.js +3 -2
- package/dist/web-commands.js.map +1 -1
- package/dist/web-guest-access.d.ts +3 -0
- package/dist/web-guest-access.js +6 -2
- package/dist/web-guest-access.js.map +1 -1
- package/dist/web-icons.js +3 -3
- package/dist/web-icons.js.map +1 -1
- package/dist/web-login.d.ts +7 -0
- package/dist/web-login.js +8 -1
- package/dist/web-login.js.map +1 -1
- package/dist/web-mentions.d.ts +2 -0
- package/dist/web-mentions.js +20 -0
- package/dist/web-mentions.js.map +1 -1
- package/dist/web-notices.d.ts +20 -0
- package/dist/web-notices.js +64 -8
- package/dist/web-notices.js.map +1 -1
- package/dist/web-office-store.d.ts +2 -0
- package/dist/web-office-store.js +15 -3
- package/dist/web-office-store.js.map +1 -1
- package/dist/web-pin-store.d.ts +58 -0
- package/dist/web-pin-store.js +170 -0
- package/dist/web-pin-store.js.map +1 -0
- package/dist/web-prefs.js +5 -1
- package/dist/web-prefs.js.map +1 -1
- package/dist/web-session-authorization.d.ts +24 -0
- package/dist/web-session-authorization.js +32 -0
- package/dist/web-session-authorization.js.map +1 -1
- package/dist/web-session.d.ts +6 -4
- package/dist/web-session.js +5 -3
- package/dist/web-session.js.map +1 -1
- package/dist/web-settings-patch.d.ts +24 -3
- package/dist/web-settings-patch.js +57 -1
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/web-shell-routes.d.ts +1 -1
- package/dist/web-shell-routes.js +1 -1
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-theme.js +2 -2
- package/dist/web-update.d.ts +15 -1
- package/dist/web-upload.d.ts +36 -0
- package/dist/web-upload.js +105 -5
- package/dist/web-upload.js.map +1 -1
- package/dist/windows-cli-api.d.ts +10 -7
- package/dist/windows-cli-api.js +13 -12
- package/dist/windows-cli-api.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +10 -0
- package/dist/windows-cli-worker.js +109 -14
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +10 -1
- package/dist/windows-cli.js +47 -13
- package/dist/windows-cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/runtime-install/install.ps1 +24 -4
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { hi } from "./hub-agent-intro.js";
|
|
2
|
+
import {hp} from "./hub-personal-agent-strings.js";
|
|
1
3
|
// M-3092 PR 2 (Hub rooms, track U): a room's composer — the Fleet chat's own ComposerInput, its palette (`cmd-palette`)
|
|
2
4
|
// and its reply bar (`reply-bar`), with what a room adds (docs/design/hub-rooms-ux.md §4):
|
|
3
5
|
// - typing `@` opens a menu: 「@所有 Agent」 (when this room lets me), 「@房間助理」 (when the room has one), each agent
|
|
@@ -39,18 +41,40 @@ export function mentionOptions(detail, query = "") {
|
|
|
39
41
|
if ((detail?.settings?.allMention !== false || manager) && agents.length && hit(hroom("mentionAll")))
|
|
40
42
|
out.push({ kind: "all", key: "all", label: hroom("mentionAll"), hint: hroom("mentionAllHint", String(agents.length)) });
|
|
41
43
|
if ((detail?.members || []).some((m) => m.kind === "assistant") && hit(hroom("mentionAssistant")))
|
|
42
|
-
out.push({ kind: "assistant", key: "assistant", label: hroom("mentionAssistant"), hint:
|
|
43
|
-
for (const a of agents) if (hit(a.name, a.owner?.name)) out.push({ kind: "agent", key: a.id, label: `@${a.name}`, hint: a.owner?.name
|
|
44
|
+
out.push({ kind: "assistant", key: "assistant", label: hroom("mentionAssistant"), hint: hi("assistant") });
|
|
45
|
+
for (const a of agents) if (hit(a.name, a.owner?.name)) out.push({ kind: "agent", key: a.id, label: `@${a.name}`, ...(a.answerOnly?{answerOnly:true}:{}), hint: [a.intro,a.answerOnly?hp("answerOnlyAsker"):a.owner?.name].filter(Boolean).join(" · "), dot: presenceDot(a.presence, a.presenceReason) });
|
|
44
46
|
for (const p of (detail?.members || []).filter((m) => m.kind === "person" && m.id !== detail?.me?.id)) if (hit(p.name)) out.push({ kind: "person", key: p.id, label: `@${p.name}`, hint: "" });
|
|
45
47
|
return out;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
// `@Name` not followed by an ASCII word character or `-` (as agents have always been read: "@研發助理幫我看" names it, no
|
|
51
|
+
// space needed). `person`: also not after an ASCII letter, digit, `_`, `@` or `\` — an email address or an escaped @ names no one.
|
|
52
|
+
const atName = (name, flags = "", person = false) =>
|
|
53
|
+
new RegExp(`${person ? "(?<![A-Za-z0-9_@\\\\])" : ""}@${String(name).replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![\\w-])`, flags);
|
|
54
|
+
/**
|
|
55
|
+
* The mentions a text names (spec seam 1: "all", "assistant" or an agent's exposure id), read from the text as sent.
|
|
56
|
+
* M-3298: and each person it @s (their member id) — the reminder the @ menu promises: their room list's @ and their page's
|
|
57
|
+
* ping (hub-room-unread.js) read it from the message's mentions. A longer name is read first, so "@Alex Chen" is not also
|
|
58
|
+
* "@Alex"; never me; a name two members share, no one. It is the page's preview: the Hub resolves who a person's @ reminds
|
|
59
|
+
* from the text itself (hub/rooms/service.ts post()), and keeps from what a page sends only what routes (@all, assistant, agents).
|
|
60
|
+
*/
|
|
49
61
|
export function mentionsIn(text, detail) {
|
|
50
62
|
const s = String(text || ""), out = [];
|
|
51
63
|
if (s.includes(hroom("mentionAll"))) out.push("all");
|
|
52
64
|
if (s.includes(hroom("mentionAssistant"))) out.push("assistant");
|
|
53
|
-
for (const a of agentsOf(detail)) if (
|
|
65
|
+
for (const a of agentsOf(detail)) if (atName(a.name).test(s)) out.push(a.id);
|
|
66
|
+
const me = detail?.me?.id, named = [...agentsOf(detail).map((a) => ({ name: a.name, person: null })),
|
|
67
|
+
...(detail?.members || []).filter((m) => m.kind === "person" && m.name).map((m) => ({ name: m.name, person: m.id }))]
|
|
68
|
+
.sort((x, y) => String(y.name).length - String(x.name).length);
|
|
69
|
+
// A name two members share names no one (as the Hub reads it, #4132 review F1): the Hub decides who is reminded.
|
|
70
|
+
const shared = new Map();
|
|
71
|
+
for (const n of named) { const k = String(n.name).toLocaleLowerCase("en-US"); shared.set(k, (shared.get(k) || 0) + 1); }
|
|
72
|
+
let rest = s;
|
|
73
|
+
for (const n of named) {
|
|
74
|
+
if (!atName(n.name, "", !!n.person).test(rest)) continue;
|
|
75
|
+
if (n.person && n.person !== me && shared.get(String(n.name).toLocaleLowerCase("en-US")) === 1) out.push(n.person);
|
|
76
|
+
rest = rest.replace(atName(n.name, "g", !!n.person), (hit) => " ".repeat(hit.length));
|
|
77
|
+
}
|
|
54
78
|
return [...new Set(out)];
|
|
55
79
|
}
|
|
56
80
|
|
|
@@ -71,8 +95,11 @@ export function refusalText(r) {
|
|
|
71
95
|
/**
|
|
72
96
|
* The composer. `store`: the room's (send); `detail`: the room GET; `reply`/`onReply`: the message being answered (the
|
|
73
97
|
* thread's Reply); `closed`: archived or no longer a member (the box says why, nothing is sent).
|
|
98
|
+
* M-3125: `canSendEmpty` — Send works with an empty box (the caller has files ready).
|
|
99
|
+
* M-3117 (for M-3125's files): `attach` is ComposerInput's own ({ title, onFiles } — the Fleet's + left of the box), `pending`
|
|
100
|
+
* the files waiting, drawn first in the box (where the 1:1 chat puts its PendingFiles). Neither given: no Attach.
|
|
74
101
|
*/
|
|
75
|
-
export function RoomComposer({ store, detail, reply = null, onReply = () => {}, closed = false, inputRef, insertRef }) {
|
|
102
|
+
export function RoomComposer({ store, detail, reply = null, onReply = () => {}, closed = false, inputRef, insertRef, attach = null, pending = null, canSendEmpty = false }) {
|
|
76
103
|
const [value, setValue] = useState(""), [msg, setMsg] = useState(null), [busy, setBusy] = useState(false), [pick, setPick] = useState(0);
|
|
77
104
|
const own = useRef(null), input = inputRef || own;
|
|
78
105
|
const [caret, setCaret] = useState(0);
|
|
@@ -80,6 +107,8 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
80
107
|
const palette = at && options.length ? options : null, chosen = palette ? palette[Math.min(pick, palette.length - 1)] : null;
|
|
81
108
|
const room = detail?.room || {}, group = room.kind === "group";
|
|
82
109
|
const short = useShortPlaceholder();
|
|
110
|
+
// M-3117: the Fleet chat's box takes the focus when its conversation opens (panel-chat.js Composer): a room's too.
|
|
111
|
+
useEffect(() => { if (!closed) input.current?.focus(); }, [room.id || "", closed]);
|
|
83
112
|
// 「在這裡 @ 它」 from the members panel: the mention goes into the box, after what is there.
|
|
84
113
|
if (insertRef) insertRef.current = (text) => { setValue((v) => `${v && !/\s$/.test(v) ? `${v} ` : v}${text} `); setTimeout(() => input.current?.focus(), 0); };
|
|
85
114
|
const complete = (o) => {
|
|
@@ -88,7 +117,8 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
88
117
|
setTimeout(() => { const el = input.current; if (el) { const n = at.start + o.label.length + 1; el.focus(); try { el.setSelectionRange(n, n); } catch { /* not a text field */ } setCaret(n); } }, 0);
|
|
89
118
|
};
|
|
90
119
|
const send = async () => {
|
|
91
|
-
|
|
120
|
+
// M-3125: `canSendEmpty` — files are ready to go, so a post may be the files alone (the server takes it).
|
|
121
|
+
const text = value.trim(); if ((!text && !canSendEmpty) || busy || closed) return;
|
|
92
122
|
setBusy(true); setMsg(null);
|
|
93
123
|
const r = await store.send(text, { mentions: mentionsIn(text, detail), ...(reply ? { replyTo: reply.roomMessage } : {}) });
|
|
94
124
|
setBusy(false);
|
|
@@ -103,21 +133,23 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
103
133
|
};
|
|
104
134
|
const track = (v) => { setValue(v); setMsg(null); setCaret(input.current ? input.current.selectionStart ?? v.length : v.length); };
|
|
105
135
|
const paletteId = `hubMention-${room.id || "room"}`, optId = (o) => `${paletteId}-${o.key}`;
|
|
106
|
-
|
|
136
|
+
// M-3117: as the Fleet chat's dock has it — the box, then a failed send, then the line under it (its .composer-row).
|
|
137
|
+
if (closed) return html`<p class="hub-banner warn" role="status">${hroom(detail?.room?.archived ? "errArchived" : "errNotMember")}</p>`;
|
|
107
138
|
return html`<div class="composer-box hub-room-composer">
|
|
139
|
+
${pending}
|
|
108
140
|
${palette ? html`<ul data-trust="palette" class="cmd-palette" id=${paletteId} role="listbox" aria-label=${hroom("mentionAll")}>
|
|
109
141
|
${palette.map((o) => html`<li key=${o.key} id=${optId(o)} role="option" aria-selected=${o === chosen ? "true" : "false"} class=${o === chosen ? "on" : ""}
|
|
110
142
|
onMouseDown=${(e) => { e.preventDefault(); complete(o); }}>
|
|
111
|
-
<span class="cmd-name">${o.dot ? html`<span class=${`dot ${o.dot}`} aria-hidden="true"></span> ` : null}${o.label}</span><span class
|
|
143
|
+
<span class="cmd-name">${o.dot ? html`<span class=${`dot ${o.dot}`} aria-hidden="true"></span> ` : null}${o.label}</span><span class=${`cmd-desc${o.answerOnly?" hub-answer-only-note":""}`}>${o.hint}</span></li>`)}
|
|
112
144
|
</ul>` : null}
|
|
113
145
|
${group && value.includes(hroom("mentionAll")) ? html`<p class="note hub-room-allbar" role="status">${allBar(detail)}</p>` : null}
|
|
114
146
|
${reply ? html`<div class="reply-bar" data-trust="composer" role="status"><span class="reply-text">${reply.sender ? `${reply.sender} · ` : ""}${String(reply.text || "").slice(0, 80)}</span>
|
|
115
147
|
<button type="button" class="icon-btn reply-cancel" title=${hroom("cancel")} aria-label=${hroom("cancel")} onClick=${() => { onReply(null); input.current?.focus(); }}><${Icon} name="close" size=${14} /></button></div>` : null}
|
|
116
|
-
<${ComposerInput} inputRef=${input} value=${value} placeholder=${room.assistant ? hroom("composerAssistant") : group ? (short ? hroom("composerShort") : hroom("composer", room.name || "")) : hroom("composerDirect", room.name || "")} onValue=${track} onKeyDown=${onKeyDown}
|
|
148
|
+
<${ComposerInput} inputRef=${input} value=${value} attach=${attach} placeholder=${room.assistant ? hroom("composerAssistant") : group ? (short ? hroom("composerShort") : hroom("composer", room.name || "")) : hroom("composerDirect", room.name || "")} onValue=${track} onKeyDown=${onKeyDown}
|
|
117
149
|
controls=${palette ? paletteId : undefined} expanded=${!!palette} activeDescendant=${chosen ? optId(chosen) : undefined}
|
|
118
150
|
stop=${{ hidden: true, disabled: true, title: t("chat.stopReply"), label: t("chat.stopReply"), onClick: () => {} }}
|
|
119
|
-
send=${{ hidden: false, disabled: !value.trim() || busy, label: t("chat.send"), onClick: () => { void send(); } }} />
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</div
|
|
151
|
+
send=${{ hidden: false, disabled: (!value.trim() && !canSendEmpty) || busy, label: t("chat.send"), onClick: () => { void send(); } }} />
|
|
152
|
+
</div>
|
|
153
|
+
${msg ? html`<p class="err" role="alert">${msg.text}${msg.retry ? html` <button type="button" class="btn btn-sm" onClick=${send}>${hroom("retrySend")}</button>` : null}</p>` : null}
|
|
154
|
+
${group ? html`<div class="composer-row"><span class="hint hub-room-hint">${hroom("composerHint")}</span></div>` : null}`;
|
|
123
155
|
}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
// 「最愛」 above 「房間」 and 「Agent」 in the order they were starred (or moved in Edit), at most MAX_FAVORITES, and one that
|
|
4
4
|
// is gone from the list (left, removed) is dropped on the next change, never shown.
|
|
5
5
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// apart); another tab follows through the storage event. A Hub-side store replaces the source, not this module's rules.
|
|
6
|
+
// A Hub with person-prefs-v1 keeps them per directory person. This browser's old list seeds an unset Hub record once;
|
|
7
|
+
// an older Hub still uses local storage. The source changes, not the list's rules.
|
|
9
8
|
import { useEffect, useState } from "/assets/app-html.js";
|
|
10
9
|
import { createStore, useStore } from "/assets/app-store.js";
|
|
11
10
|
import { MAX_FAVORITES } from "/assets/instance-nav.js";
|
|
@@ -36,9 +35,68 @@ export const localFavoritesSource = {
|
|
|
36
35
|
};
|
|
37
36
|
|
|
38
37
|
let source = localFavoritesSource;
|
|
39
|
-
/** Tests
|
|
38
|
+
/** Tests swap where favourites are kept. */
|
|
40
39
|
export function setFavoritesSource(next) { source = next || localFavoritesSource; }
|
|
41
40
|
|
|
41
|
+
/** A session-owned cache: serialized writes, first-write migration, and refresh on focus or another tab's write. */
|
|
42
|
+
export function createHubFavoritesSource(client, session) {
|
|
43
|
+
let ids = [], ready = false, active = false, pending = null, writing = null, refreshing = null, revision = 0, edits = 0;
|
|
44
|
+
let changed = () => {};
|
|
45
|
+
const apply = (out) => {
|
|
46
|
+
if (!active || !out.ok || !Number.isSafeInteger(out.revision) || out.revision < revision) return;
|
|
47
|
+
revision = out.revision; ids = cleanIds(out.favorites); ready = true;
|
|
48
|
+
localFavoritesSource.write(session.login, ids);
|
|
49
|
+
changed();
|
|
50
|
+
};
|
|
51
|
+
const drain = () => writing ??= (async () => {
|
|
52
|
+
while (active && ready && pending) {
|
|
53
|
+
const sent = pending;
|
|
54
|
+
let out;
|
|
55
|
+
try { out = await client.savePersonPrefs(session.csrf, sent); } catch { break; }
|
|
56
|
+
if (!active || !out.ok) break; // retain the pending change for focus/the next edit
|
|
57
|
+
if (pending === sent) { pending = null; apply(out); }
|
|
58
|
+
else revision = Math.max(revision, out.revision || 0);
|
|
59
|
+
}
|
|
60
|
+
})().finally(() => { writing = null; });
|
|
61
|
+
const refresh = () => refreshing ??= (async () => {
|
|
62
|
+
await drain();
|
|
63
|
+
if (!active || pending) return;
|
|
64
|
+
const before = edits;
|
|
65
|
+
let out;
|
|
66
|
+
try {
|
|
67
|
+
out = await client.personPrefs(session.csrf);
|
|
68
|
+
if (!active || !out.ok || edits !== before) return;
|
|
69
|
+
if (!out.initialized) out = await client.savePersonPrefs(session.csrf, localFavoritesSource.read(session.login), true);
|
|
70
|
+
} catch { return; }
|
|
71
|
+
if (edits === before) apply(out);
|
|
72
|
+
})().finally(() => { refreshing = null; });
|
|
73
|
+
return {
|
|
74
|
+
ready: () => ready,
|
|
75
|
+
read: () => ids,
|
|
76
|
+
write(_login, value) { ids = cleanIds(value); pending = ids; edits++; void drain(); },
|
|
77
|
+
watch(_login, onChange) {
|
|
78
|
+
active = true; changed = onChange;
|
|
79
|
+
const unwatch = localFavoritesSource.watch(session.login, () => { void refresh(); });
|
|
80
|
+
const focus = () => { void refresh(); };
|
|
81
|
+
globalThis.addEventListener?.("focus", focus);
|
|
82
|
+
void refresh();
|
|
83
|
+
return () => { active = false; changed = () => {}; unwatch(); globalThis.removeEventListener?.("focus", focus); };
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let configuredClient, configuredCsrf;
|
|
89
|
+
/** Called by the session owner; optional from the shell so an older cached module still loads. */
|
|
90
|
+
export function configureHubFavorites(client, session) {
|
|
91
|
+
const remote = session?.features?.includes("person-prefs-v1") && typeof client.personPrefs === "function" && typeof client.savePersonPrefs === "function";
|
|
92
|
+
const csrf = remote ? session.csrf : null;
|
|
93
|
+
if (configuredClient === client && configuredCsrf === csrf) return;
|
|
94
|
+
configuredClient = client; configuredCsrf = csrf;
|
|
95
|
+
loadFavorites(null); // retire the previous person's listener and late responses
|
|
96
|
+
source = remote ? createHubFavoritesSource(client, session) : localFavoritesSource;
|
|
97
|
+
loadFavorites(session?.login);
|
|
98
|
+
}
|
|
99
|
+
|
|
42
100
|
/** { login, ids }: whose favourites are loaded, and their ids in order. */
|
|
43
101
|
export const favoritesStore = createStore({ login: null, ids: [] });
|
|
44
102
|
let unwatch = () => {};
|
|
@@ -83,7 +141,7 @@ export function useRoomStar(rooms, login) {
|
|
|
83
141
|
const fav = useStore(favoritesStore);
|
|
84
142
|
const [editing, setEditing] = useState(false);
|
|
85
143
|
useEffect(() => { loadFavorites(login); }, [login]);
|
|
86
|
-
if (!login || fav.login !== login) return null;
|
|
144
|
+
if (!login || fav.login !== login || source.ready?.(login) === false) return null;
|
|
87
145
|
const known = new Set((Array.isArray(rooms) ? rooms : []).map((r) => r && r.id).filter(Boolean));
|
|
88
146
|
return { ids: liveFavorites(known, fav.ids), editing, setEditing,
|
|
89
147
|
toggle: (id) => toggleFavorite(id, known), move: (id, delta) => moveFavorite(id, delta, known) };
|
package/dist/ui/hub-room-list.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { hi } from "./hub-agent-intro.js";
|
|
2
|
+
import {hp} from "./hub-personal-agent-strings.js";
|
|
1
3
|
// M-3092 (Hub rooms, track U): the Hub's conversation list, drawn as the Fleet chat draws its roster — the same row
|
|
2
4
|
// (`li.v-li > a.inst.v-inst`: avatar with its status dot, the name line and the second line), the same section head
|
|
3
5
|
// (`inst-head > side-label`, its count) and the same count badge (`nav-count`). docs/design/hub-rooms-ux.md §2:
|
|
@@ -29,7 +31,7 @@ export function listRoomOf(item) {
|
|
|
29
31
|
if (!item || typeof item !== "object" || typeof item.id !== "string") return null;
|
|
30
32
|
return { id: item.id, kind: "direct", name: String(item.exposureName || ""), people: 1, agents: 1, online: null, unread: 0,
|
|
31
33
|
lastAt: Number.isFinite(item.lastAt) ? item.lastAt : 0, lastText: "", lastAuthor: "",
|
|
32
|
-
agent: { exposureId: String(item.exposureId || ""), owner: { name: String(item.ownerName || "") }, presence: null }, limited: true, legacy: item };
|
|
34
|
+
agent: { ...(typeof item.intro==="string"?{intro:item.intro}:{}), ...(item.answerOnly?{answerOnly:true}:{}), exposureId: String(item.exposureId || ""), owner: { name: String(item.ownerName || "") }, presence: null }, limited: true, legacy: item };
|
|
33
35
|
}
|
|
34
36
|
/** The rooms list from whichever client this page has: roomList() when it can, else rooms() mapped by listRoomOf(). */
|
|
35
37
|
export function readRoomList(client) {
|
|
@@ -72,7 +74,7 @@ export function rowView(r) {
|
|
|
72
74
|
const closed = limited && r.legacy?.state === "closed", waiting = limited && !closed && r.legacy?.waiting === true;
|
|
73
75
|
const line2 = group ? countsLine(r.people, r.agents)
|
|
74
76
|
: closed ? t("hubChat.tagClosed") : waiting ? t("hubChat.waiting")
|
|
75
|
-
: r.assistant ?
|
|
77
|
+
: r.assistant ? hi("assistant") : [r.agent?.intro,r.agent?.answerOnly ? hp("answerOnlyAsker") : String(r.agent?.owner?.name || "")].filter(Boolean).join(" · ");
|
|
76
78
|
return {
|
|
77
79
|
title: r.assistant ? tr("hubAssistant") : String(r.name || ""), line2,
|
|
78
80
|
avatar: { square: group, text: firstCharacter(r.assistant ? tr("hubAssistant") : String(r.name || "?")) || "?" },
|
|
@@ -131,7 +133,7 @@ export function HubRoomRows({ rooms, q = "", current = null, href, onGo, star =
|
|
|
131
133
|
<span class=${`av${v.avatar.square ? " av-square" : ""}`}><span class="av-text" aria-hidden="true">${v.avatar.text}</span>${v.dot
|
|
132
134
|
? html`<span class=${`av-dot dot ${v.dot}`} aria-hidden="true"></span>` : null}</span>
|
|
133
135
|
<span class="inst-text"><span class="inst-line"><span class="inst-name" title=${v.title}>${v.title}</span><span class="v-meta">${listTime(r.lastAt)}</span></span>
|
|
134
|
-
<span class="inst-line inst-line2"><span class
|
|
136
|
+
<span class="inst-line inst-line2"><span class=${`inst-alt${r.agent?.answerOnly?" hub-answer-only-note":""}`} title=${v.line2 || undefined}>${v.archived ? `${tr("archived")} · ${v.line2}` : v.line2}</span>
|
|
135
137
|
${v.mentioned ? html`<span class="hub-room-at" title=${tr("mentionedYou")}>@</span>` : null}
|
|
136
138
|
${v.unread ? html`<span class="nav-count" title=${tr("unreadN", String(v.unread))}>${v.unread > 99 ? "99+" : v.unread}</span>` : null}</span></span>
|
|
137
139
|
</a>${items.length ? html`<${Menu} cls=${`inst-workspace inst-row-menu agent-menu${starred ? " is-favorite" : ""}`} fit=${true} topLayer=${true}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { register, t } from "/assets/app-i18n.js";
|
|
5
5
|
|
|
6
6
|
register("hubRoomMembers", {
|
|
7
|
-
en: { fewer: "Show fewer", ownerOf: "Owner: {0}", removeFailed: "It was not removed. Try again.", agents: "Agents", ownerAgent: "{0}'s agent", ownerAgentLatin: "{0}'s agent",
|
|
7
|
+
en: { askOwner: "ask {0}", fewer: "Show fewer", ownerOf: "Owner: {0}", removeFailed: "It was not removed. Try again.", agents: "Agents", ownerAgent: "{0}'s agent", ownerAgentLatin: "{0}'s agent",
|
|
8
8
|
noAgents: "No agents yet. A room manager can add or invite them in Room settings." },
|
|
9
|
-
"zh-TW": { fewer: "收合", ownerOf: "擁有者:{0}", removeFailed: "沒有移除,請再試一次。", agents: "Agent", ownerAgent: "{0}的 Agent", ownerAgentLatin: "{0} 的 Agent",
|
|
9
|
+
"zh-TW": { askOwner: "請通知 {0}", fewer: "收合", ownerOf: "擁有者:{0}", removeFailed: "沒有移除,請再試一次。", agents: "Agent", ownerAgent: "{0}的 Agent", ownerAgentLatin: "{0} 的 Agent",
|
|
10
10
|
noAgents: "還沒有 Agent。房間管理可以在房間設定加入或邀請。" },
|
|
11
11
|
});
|
|
12
12
|
export const hm = (key, ...args) => t(`hubRoomMembers.${key}`, ...args);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hi } from "./hub-agent-intro.js";
|
|
1
2
|
// Hub rooms, the right-hand members panel (docs/design/hub-rooms-ux.md section 5): the people, the agents in presence
|
|
2
3
|
// order, the room assistant, who can see what, and (for a room manager) the way to Room settings. Clicking an agent
|
|
3
4
|
// opens a small card: @ it here, chat with it one-to-one (only when I may ask it), and, for a manager, remove it.
|
|
@@ -9,6 +10,7 @@ import { hm } from "./hub-room-members-strings.js";
|
|
|
9
10
|
import { hroom } from "./hub-room-strings.js";
|
|
10
11
|
import { collapse, headerCounts, presenceDot, presenceView, sortAgents } from "./hub-room-presence.js";
|
|
11
12
|
import { hn, linkRoomsU2Css } from "./hub-room-new-strings.js";
|
|
13
|
+
import { roomSource, RoomSourceMark } from "./hub-room-source.js";
|
|
12
14
|
|
|
13
15
|
linkRoomsU2Css();
|
|
14
16
|
|
|
@@ -25,7 +27,8 @@ export function memberStatus(m) {
|
|
|
25
27
|
const v = presenceView(m);
|
|
26
28
|
const word = m.kind === "assistant" && v.word === "stIdle" ? hroom("assistantIdleHub") : hroom(v.word);
|
|
27
29
|
const note = v.noteKey ? hroom(v.noteKey) : v.noteText;
|
|
28
|
-
|
|
30
|
+
// M-3137 (versions spec §2.4): an agent whose Fleet needs an AgEnD update says whom to ask, not only whose it is.
|
|
31
|
+
return { dot: presenceDot(v.dot), text: note ? `${word} · ${note}` : word, ...(v.word === "needsUpdate" ? { update: true } : {}) };
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
/** 「林小華的 Agent」, but 「Alex 的 Agent」: a name ending in a Latin letter or digit takes a space before 的 (Lumen). */
|
|
@@ -73,8 +76,8 @@ export function RoomMembersPanel({ client = hubClient(), roomId, detail, onMenti
|
|
|
73
76
|
};
|
|
74
77
|
// An agent's second line names whose it is beside its state (「處理中 · 林小華的 Agent」), always shown, not only on hover.
|
|
75
78
|
const row = (m, extra = null) => {
|
|
76
|
-
const v = memberStatus(m), owner = (m.kind === "agent" || m.kind === "later") && m.owner?.name ? ownerAgent(m.owner.name) : "";
|
|
77
|
-
return html`<span class="hub-member-name"
|
|
79
|
+
const v = memberStatus(m), owner = (m.kind === "agent" || m.kind === "later") && m.owner?.name ? (v.update ? hm("askOwner", m.owner.name) : ownerAgent(m.owner.name)) : "";
|
|
80
|
+
return html`<span class="hub-member-name"><${RoomSourceMark} source=${roomSource(m)} decorative=${true} />${m.name}${extra}</span><span class="hub-member-state"><span class=${`dot ${v.dot}`} aria-hidden="true"></span><span>${v.text}</span>${owner ? html`<span class="hub-member-owner">· ${owner}</span>` : null}</span>${m.intro||m.kind==="assistant"?html`<small class="note">${m.kind==="assistant"?hi("assistant"):m.intro}</small>`:null}`;
|
|
78
81
|
};
|
|
79
82
|
return html`<aside class="hub-room-members">
|
|
80
83
|
<section><h4>${heads.member}</h4>
|
|
@@ -83,9 +86,10 @@ export function RoomMembersPanel({ client = hubClient(), roomId, detail, onMenti
|
|
|
83
86
|
${agents.length ? null : html`<section class="hub-room-no-agents"><h4>${hm("agents")}</h4><p class="note">${hm("noAgents")}</p></section>`}
|
|
84
87
|
${agents.length ? html`<section><h4>${heads.agent}</h4>
|
|
85
88
|
<ul>${shown.map(m => html`<li class="hub-member hub-member-agent" key=${m.id}>
|
|
86
|
-
<button type="button" class="hub-member-open" title=${m
|
|
89
|
+
<button type="button" class="hub-member-open" title=${roomSource(m)?.label || ""} aria-label=${`${m.name}. ${memberStatus(m).text}. ${roomSource(m)?.label || ""}`} aria-expanded=${open === m.id} onClick=${() => { setFailed(false); setOpen(open === m.id ? null : m.id); }}>${row(m)}</button>
|
|
87
90
|
${open === m.id ? html`<div class="hub-member-card" role="group" aria-label=${m.name}>
|
|
88
|
-
<strong>${m.name}</strong>${m.owner?.name ? html`<small class="note">${hm("ownerOf", m.owner.name)}</small>` : null}
|
|
91
|
+
<strong>${m.name}</strong>${m.intro?html`<p class="note">${m.intro}</p>`:null}${m.owner?.name ? html`<small class="note">${hm("ownerOf", m.owner.name)}</small>` : null}
|
|
92
|
+
<small class="note hub-source-explanation">${roomSource(m)?.label}</small>
|
|
89
93
|
<small class="note">${memberStatus(m).text}</small>
|
|
90
94
|
<div class="field-row">
|
|
91
95
|
<button type="button" class="btn" onClick=${() => { setOpen(null); onMention?.(m); }}>${hroom("mentionHere")}</button>
|
package/dist/ui/hub-room-new.js
CHANGED
|
@@ -73,7 +73,7 @@ export function RoomPicker({ client, kinds, picked, onChange, placeholder, label
|
|
|
73
73
|
${failed ? html`<p class="note" role="alert">${hn("searchFailed")}</p>` : null}
|
|
74
74
|
${groupNote || note ? html`<p class="note hub-room-picker-note" role="alert">${groupNote || note}</p>` : null}
|
|
75
75
|
${results && !failed ? offer.length ? html`<ul class="hub-room-results" role="listbox" aria-label=${label}>${offer.map(c => html`<li key=${keyOf(c)}>
|
|
76
|
-
<button type="button" role="option" class="hub-room-result" onClick=${() => { void pick(c); }}>${pickLabel(c)}${c.owner?.name && c.kind === "agent" ? html` <small class="note">${c.owner.name}</small>` : null}${c.kind === "agent" && !c.mine ? html` <small class="note">${hroom("invitePending")}</small>` : null}</button></li>`)}</ul>`
|
|
76
|
+
<button type="button" role="option" class="hub-room-result" onClick=${() => { void pick(c); }}>${pickLabel(c)}${c.intro?html` <small class="note">${c.intro}</small>`:null}${c.owner?.name && c.kind === "agent" ? html` <small class="note">${c.owner.name}</small>` : null}${c.kind === "agent" && !c.mine ? html` <small class="note">${hroom("invitePending")}</small>` : null}</button></li>`)}</ul>`
|
|
77
77
|
: html`<p class="note">${hn("noMatch")}</p>` : null}
|
|
78
78
|
</div>`;
|
|
79
79
|
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Hub rooms desktop notifications (hub-rooms-ux.md §12: 和 Fleet 聊天相同的桌面通知(要先允許)).
|
|
2
|
+
// Pure gate: shouldNotify in hub-room-unread.js (imported, never copied); the opt-in rule: notifyOn in app-needs.js.
|
|
3
|
+
import { notifyOn, notifySupport, notifyStore, refreshNotify, setNotify } from "/assets/app-needs.js";
|
|
4
|
+
import { html, useEffect } from "/assets/app-html.js";
|
|
5
|
+
import { useStore } from "/assets/app-store.js";
|
|
6
|
+
import { Icon } from "/assets/ui-icons.js";
|
|
7
|
+
import { counts, shouldNotify } from "./hub-room-unread.js";
|
|
8
|
+
import { hroom } from "./hub-room-strings.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Which live events earn a desktop ping (web-claude M-3117: only what is about me): an @ to me, an answer to
|
|
12
|
+
* a question I asked (`answerTo` mine, matched by the server-set `askedBy`; a missing `askedBy` is not mine),
|
|
13
|
+
* a new invitation, and any new message in a direct (1:1) room (`opts.direct`). A group room's chatter and
|
|
14
|
+
* answers to other people's questions only count toward unread (the list and the tab title show them).
|
|
15
|
+
*/
|
|
16
|
+
export function notifyKind(event, me, opts = {}) {
|
|
17
|
+
const c = counts(event, me);
|
|
18
|
+
if (!c || c.unread <= 0) return null;
|
|
19
|
+
if (c.invitation) return "invitation";
|
|
20
|
+
if (c.mentioned) return "mention";
|
|
21
|
+
const m = event && event.message;
|
|
22
|
+
if (m && m.stage === "answered" && m.answerTo && m.askedBy && me && m.askedBy === me.id) return "answer";
|
|
23
|
+
if (opts.direct && event.type === "message.added") return "direct";
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const excerpt = (text) => {
|
|
28
|
+
const s = String(text || "").replace(/\s+/g, " ").trim();
|
|
29
|
+
return s.length > 80 ? `${s.slice(0, 80)}…` : s;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function pingBody(kind, event, room) {
|
|
33
|
+
if (kind === "invitation") {
|
|
34
|
+
const inv = (event && event.invitation) || {};
|
|
35
|
+
const name = (inv.room && inv.room.name) || inv.id || "";
|
|
36
|
+
return hroom("notifyInvite", String(name));
|
|
37
|
+
}
|
|
38
|
+
const m = (event && event.message) || {};
|
|
39
|
+
const who = (m.author && m.author.name) || "";
|
|
40
|
+
if (kind === "direct") return hroom("notifyDirect", String(who), excerpt(m.text));
|
|
41
|
+
return hroom(kind === "mention" ? "notifyMention" : "notifyAnswer", String(who), String(room), excerpt(m.text));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* This person's member id per room for the page-level watcher (counts() matches message authors and @mentions
|
|
46
|
+
* by id, and every room mints its own member ids — one room's me.id never identifies this person in another).
|
|
47
|
+
* The Hub session carries only login and display name. Set per room from a room detail the page reads, or lazily
|
|
48
|
+
* on live events — and cleared wholesale when the signed-in login changes, so a sign-out and sign-in as someone
|
|
49
|
+
* else on the same tab never matches the next person with the previous one's ids.
|
|
50
|
+
*/
|
|
51
|
+
const meByRoom = new Map();
|
|
52
|
+
/** Keeps the id for one room, from its detail or the lazy resolve; ignores empty values. */
|
|
53
|
+
export function noteHubMeId(roomId, id) { if (typeof roomId === "string" && roomId && typeof id === "string" && id) meByRoom.set(roomId, id); }
|
|
54
|
+
/** Forgets every room's id: the signed-in login changed (signed out, or in as someone else). */
|
|
55
|
+
export function clearHubMeId() { meByRoom.clear(); }
|
|
56
|
+
/** The remembered id for one room, or null while unknown. */
|
|
57
|
+
export function rememberedMeId(roomId) { return meByRoom.get(roomId) || null; }
|
|
58
|
+
|
|
59
|
+
let stopPrev = null;
|
|
60
|
+
/** The live starter's generation: a lazy resolve from a replaced or stopped watcher never writes. */
|
|
61
|
+
let liveGen = 0;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Ping while a Hub tab is open but hidden (a visible page shows the rows; what it showed is seen).
|
|
65
|
+
* `me(roomId)`: { id } for that room, or an accessor returning it (null until the page learns it:
|
|
66
|
+
* message rows cannot be matched before that, while an invitation — which carries no author — still pings).
|
|
67
|
+
* `setMe(roomId, { id })`: keeps what `resolveMe(roomId)` learns; `resolveMe`: one async attempt per room id,
|
|
68
|
+
* retried on the next event while still unknown (only while opted in, so an opted-out page never reads for it).
|
|
69
|
+
* `roomName(roomId)`: the ping's title; `roomKind(roomId)`: the list's kind for it (`"direct"` rooms ping
|
|
70
|
+
* on any new message); `open(roomId)`: where a click goes. Returns the stop function;
|
|
71
|
+
* a second start replaces the first.
|
|
72
|
+
*/
|
|
73
|
+
export function startHubRoomNotifier({ client, me, setMe, resolveMe, roomName, roomKind, open, env = globalThis, doc = typeof document !== "undefined" ? document : null } = {}) {
|
|
74
|
+
if (stopPrev) stopPrev();
|
|
75
|
+
const gen = ++liveGen;
|
|
76
|
+
const seen = new Set();
|
|
77
|
+
const resolving = new Map();
|
|
78
|
+
const meOf = (roomId) => (typeof me === "function" ? me(roomId) : me);
|
|
79
|
+
// Starts (or joins) the lazy resolve for a room; returns its promise, or null when no resolve applies.
|
|
80
|
+
const ensureMe = (roomId) => {
|
|
81
|
+
if (!roomId) return null;
|
|
82
|
+
const m = meOf(roomId);
|
|
83
|
+
if (m && m.id) return null;
|
|
84
|
+
if (typeof resolveMe !== "function" || typeof setMe !== "function" || !notifyOn(env)) return null;
|
|
85
|
+
if (!resolving.has(roomId)) {
|
|
86
|
+
resolving.set(roomId, Promise.resolve()
|
|
87
|
+
.then(() => resolveMe(roomId))
|
|
88
|
+
// A resolve that lands after a restart (sign-in change) or stop belongs to the old watcher: drop it,
|
|
89
|
+
// or B would inherit A's id right after the clear.
|
|
90
|
+
.then((got) => { if (gen === liveGen && got && got.id) setMe(roomId, got); }, () => {})
|
|
91
|
+
.finally(() => { resolving.delete(roomId); }));
|
|
92
|
+
}
|
|
93
|
+
return resolving.get(roomId) ?? null;
|
|
94
|
+
};
|
|
95
|
+
const onEvent = (type) => (data, replayed) => {
|
|
96
|
+
const event = { type, ...(data && typeof data === "object" ? data : {}) };
|
|
97
|
+
const focus = !(doc && doc.hidden);
|
|
98
|
+
// Member ids are per room: match each event against that room's own remembered id, so an @mention or
|
|
99
|
+
// answer in any other room still pings, while my own rows (including from another device) never do.
|
|
100
|
+
const self = meOf(event.roomId);
|
|
101
|
+
let kind = null;
|
|
102
|
+
if (self) {
|
|
103
|
+
if (!shouldNotify(event, self, focus, env)) return;
|
|
104
|
+
const direct = typeof roomKind === "function" && roomKind(event.roomId) === "direct";
|
|
105
|
+
kind = notifyKind(event, self, { direct });
|
|
106
|
+
} else {
|
|
107
|
+
// The page has not learned this person's id for this room yet: message rows cannot be matched now.
|
|
108
|
+
// A new invitation (no author) still pings at once under the hidden-tab rule; any other first event
|
|
109
|
+
// in the room is replayed through the normal path once the resolve lands (seen-key dedupe stops a
|
|
110
|
+
// double ping), so the first @mention is never the one that stays silent.
|
|
111
|
+
if (!replayed) {
|
|
112
|
+
const pending = ensureMe(event.roomId);
|
|
113
|
+
if (pending) pending.then(() => {
|
|
114
|
+
if (gen === liveGen && doc && doc.hidden && notifyOn(env)) onEvent(type)(data, true);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (focus || !notifyOn(env)) return;
|
|
118
|
+
const inv = event.invitation;
|
|
119
|
+
if (event.type !== "invitation.changed" || !inv || typeof inv !== "object" || !(inv.id || inv.room)) return;
|
|
120
|
+
kind = "invitation";
|
|
121
|
+
}
|
|
122
|
+
if (!kind) return;
|
|
123
|
+
const id = self ? (counts(event, self).id || `${type}:${event.roomId || ""}`)
|
|
124
|
+
: String((event.invitation && event.invitation.id) || `${type}:invitation`);
|
|
125
|
+
// One ping per row per kind: an @mention and the row's later answer are two moments; the tab's
|
|
126
|
+
// tag stays the row id, so the answer replaces the mention ping instead of stacking (Fleet: tag = item id).
|
|
127
|
+
const seenKey = `${kind}:${id}`;
|
|
128
|
+
if (seen.has(seenKey)) return;
|
|
129
|
+
seen.add(seenKey);
|
|
130
|
+
try {
|
|
131
|
+
const room = typeof roomName === "function" ? roomName(event.roomId) || "" : "";
|
|
132
|
+
const n = new env.Notification(room || "AgEnD Hub", { body: pingBody(kind, event, room), tag: String(id) });
|
|
133
|
+
n.onclick = () => {
|
|
134
|
+
try { if (env.focus) env.focus(); } catch { /* the tab is already there */ }
|
|
135
|
+
if (event.roomId && typeof open === "function") open(event.roomId);
|
|
136
|
+
try { n.close(); } catch { /* already gone */ }
|
|
137
|
+
};
|
|
138
|
+
} catch { /* a browser that refuses at the last moment: the unread count still shows it */ }
|
|
139
|
+
};
|
|
140
|
+
const off = client && typeof client.subscribeRooms === "function"
|
|
141
|
+
? client.subscribeRooms({ "message.added": onEvent("message.added"), "message.updated": onEvent("message.updated"), "invitation.changed": onEvent("invitation.changed") })
|
|
142
|
+
: () => {};
|
|
143
|
+
stopPrev = () => { stopPrev = null; liveGen++; try { off(); } catch { /* already stopped */ } };
|
|
144
|
+
return stopPrev;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** The Hub header's compact Notify-me button: this device's choice (notifyStore), asking on click. */
|
|
148
|
+
export function HubNotifyToggle() {
|
|
149
|
+
const support = notifySupport();
|
|
150
|
+
const { state, asking } = useStore(notifyStore);
|
|
151
|
+
useEffect(() => { refreshNotify(); }, []);
|
|
152
|
+
const on = state === "on";
|
|
153
|
+
const label = hroom("notifyTitle");
|
|
154
|
+
const note = support !== "ok" ? hroom("notifyUnavailable") : state === "denied" ? hroom("notifyDenied") : on ? hroom("notifyOn") : hroom("notifyOff");
|
|
155
|
+
const title = `${label} — ${note}`;
|
|
156
|
+
if (support !== "ok") {
|
|
157
|
+
return html`<span class="icon-btn hub-notify" aria-disabled="true" title=${title} aria-label=${title}><${Icon} name="bell" size=${16} /></span>`;
|
|
158
|
+
}
|
|
159
|
+
return html`<button type="button" class="icon-btn hub-notify" aria-pressed=${on ? "true" : "false"} aria-label=${label} title=${title}
|
|
160
|
+
disabled=${asking} onClick=${() => { void setNotify(!on); }}><${Icon} name="bell" size=${16} /></button>`;
|
|
161
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// M-3127 C: the Hub's Ctrl K (⌘K) — the Fleet's search dialog (search-dialog.js: one box on top, results under it, ↑↓ Enter,
|
|
2
|
+
// Esc or a click outside to close), on the Hub: the rooms and chats whose names match (what Ctrl K did before), then the
|
|
3
|
+
// messages with those words in the group rooms I am in (GET /hub/v1/rooms/search), grouped by room, newest first. A hit
|
|
4
|
+
// opens its room at the message (`?room=…&m=…`: the room page loads back to it and flashes it). The Fleet dialog's look
|
|
5
|
+
// (app.css .search-*), not its module: a Hub page imports no Fleet module. Text only: no innerHTML.
|
|
6
|
+
import { html, useEffect, useLayoutEffect, useMemo, useRef, useState } from "/assets/app-html.js";
|
|
7
|
+
import { Icon } from "/assets/ui-icons.js";
|
|
8
|
+
import { Skeleton } from "/assets/ui-states.js";
|
|
9
|
+
import { hroom } from "./hub-room-strings.js";
|
|
10
|
+
|
|
11
|
+
export const SEARCH_DEBOUNCE_MS = 250;
|
|
12
|
+
|
|
13
|
+
/** A snippet as text segments, the matched ranges (from the Hub, clipped to the text) marked. */
|
|
14
|
+
export function segments(text, marks) {
|
|
15
|
+
const s = String(text || ""), out = [];
|
|
16
|
+
let at = 0;
|
|
17
|
+
for (const m of Array.isArray(marks) ? marks : []) {
|
|
18
|
+
const a = Math.max(at, Math.min(s.length, Number(m && m[0]) || 0)), b = Math.max(a, Math.min(s.length, Number(m && m[1]) || 0));
|
|
19
|
+
if (a > at) out.push({ text: s.slice(at, a) });
|
|
20
|
+
if (b > a) out.push({ text: s.slice(a, b), mark: true });
|
|
21
|
+
at = b;
|
|
22
|
+
}
|
|
23
|
+
if (at < s.length) out.push({ text: s.slice(at) });
|
|
24
|
+
return out;
|
|
25
|
+
}
|
|
26
|
+
/** Hits grouped by room in the order each room's newest hit comes; `index` is each hit's place in the flat order. */
|
|
27
|
+
export function byRoom(hits, offset = 0) {
|
|
28
|
+
const groups = new Map();
|
|
29
|
+
for (const h of hits || []) { if (!groups.has(h.roomId)) groups.set(h.roomId, { roomId: h.roomId, name: h.roomName, hits: [] }); groups.get(h.roomId).hits.push(h); }
|
|
30
|
+
let i = offset;
|
|
31
|
+
return [...groups.values()].map((g) => ({ ...g, hits: g.hits.map((hit) => ({ hit, index: i++ })) }));
|
|
32
|
+
}
|
|
33
|
+
/** "14:05" today, "10/19 14:05" this year, "2025/10/19" before (the Fleet search's). */
|
|
34
|
+
export function when(ms, now = Date.now()) {
|
|
35
|
+
const d = new Date(ms), n = new Date(now);
|
|
36
|
+
if (Number.isNaN(d.getTime())) return "";
|
|
37
|
+
const hm = `${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}`;
|
|
38
|
+
if (d.toDateString() === n.toDateString()) return hm;
|
|
39
|
+
return d.getFullYear() === n.getFullYear() ? `${d.getMonth() + 1}/${d.getDate()} ${hm}` : `${d.getFullYear()}/${d.getMonth() + 1}/${d.getDate()}`;
|
|
40
|
+
}
|
|
41
|
+
/** The address that opens a hit: its room, at its message. */
|
|
42
|
+
export const hitPath = (hit) => `/ui/hub?room=${encodeURIComponent(hit.roomId)}&m=${encodeURIComponent(hit.messageId)}`;
|
|
43
|
+
const roomLabel = (r) => String(r.assistant ? hroom("hubAssistant") : r.kind === "direct" ? (r.agent?.name || r.exposureName || r.name || "") : (r.name || ""));
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* `client`: the Hub client (searchRoomMessages); `rooms`: the list's rows (name matches); `openRoom(room)`,
|
|
47
|
+
* `openHit(hit)`: where a pick goes; `onClose()`.
|
|
48
|
+
*/
|
|
49
|
+
export function RoomSearch({ client, rooms = [], openRoom, openHit, onClose }) {
|
|
50
|
+
const ref = useRef(null), input = useRef(null);
|
|
51
|
+
const [q, setQ] = useState("");
|
|
52
|
+
const [res, setRes] = useState({ status: "idle", hits: [] });
|
|
53
|
+
const [active, setActive] = useState(0);
|
|
54
|
+
const seq = useRef(0);
|
|
55
|
+
// The native modal, as the Fleet's: focus trapped, Esc → cancel (closed through the parent), a click on the backdrop.
|
|
56
|
+
useLayoutEffect(() => {
|
|
57
|
+
const d = ref.current, opener = typeof document !== "undefined" ? document.activeElement : null;
|
|
58
|
+
if (d && typeof d.showModal === "function" && !d.open) d.showModal();
|
|
59
|
+
input.current && input.current.focus();
|
|
60
|
+
return () => { if (d && d.open && typeof d.close === "function") d.close(); if (opener && typeof opener.focus === "function" && document.contains?.(opener)) opener.focus(); };
|
|
61
|
+
}, []);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
const d = ref.current; if (!d) return undefined;
|
|
64
|
+
const onCancel = (e) => { e.preventDefault(); onClose(); }, onClick = (e) => { if (e.target === d) onClose(); };
|
|
65
|
+
d.addEventListener("cancel", onCancel); d.addEventListener("click", onClick);
|
|
66
|
+
return () => { d.removeEventListener("cancel", onCancel); d.removeEventListener("click", onClick); };
|
|
67
|
+
}, [onClose]);
|
|
68
|
+
const query = q.trim();
|
|
69
|
+
// A room or chat by its name, or an agent chat by its owner's (what the list's filter matched before).
|
|
70
|
+
const names = useMemo(() => (query ? rooms.filter((r) => [roomLabel(r), r.agent?.owner?.name].some((v) => String(v || "").toLowerCase().includes(query.toLowerCase()))).slice(0, 8) : []), [rooms, query]);
|
|
71
|
+
// The messages: debounced; an older answer never replaces a newer query's; "Search older messages" appends.
|
|
72
|
+
const run = async (text, cursor = null) => {
|
|
73
|
+
const mine = ++seq.current;
|
|
74
|
+
if (!text || typeof client?.searchRoomMessages !== "function") { setRes({ status: "idle", hits: [] }); return; }
|
|
75
|
+
setRes((r) => ({ ...r, status: "loading", ...(cursor ? {} : { hits: [], cursor: null }) }));
|
|
76
|
+
const a = await client.searchRoomMessages(text, { limit: 30, ...(cursor ? { cursor } : {}) });
|
|
77
|
+
if (mine !== seq.current) return;
|
|
78
|
+
if (a?.ok) setRes((r) => ({ status: "ok", hits: [...(cursor ? r.hits : []), ...(a.hits || [])], cursor: a.cursor || null }));
|
|
79
|
+
else setRes((r) => ({ status: "error", hits: cursor ? r.hits : [], code: a?.code || "failed" }));
|
|
80
|
+
};
|
|
81
|
+
useEffect(() => { setActive(0); const h = setTimeout(() => void run(query), SEARCH_DEBOUNCE_MS); return () => clearTimeout(h); }, [query]);
|
|
82
|
+
const groups = byRoom(res.hits, names.length);
|
|
83
|
+
const flat = [...names.map((room) => ({ room })), ...groups.flatMap((g) => g.hits.map((x) => ({ hit: x.hit })))];
|
|
84
|
+
const pick = (item) => { if (!item) return; onClose(); if (item.room) openRoom(item.room); else openHit(item.hit); };
|
|
85
|
+
const onKey = (e) => {
|
|
86
|
+
if (e.isComposing) return;
|
|
87
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") { e.preventDefault(); if (flat.length) setActive((i) => (i + (e.key === "ArrowDown" ? 1 : flat.length - 1)) % flat.length); }
|
|
88
|
+
else if (e.key === "Enter" && flat.length) { e.preventDefault(); pick(flat[Math.min(active, flat.length - 1)]); }
|
|
89
|
+
};
|
|
90
|
+
useEffect(() => { ref.current?.querySelector?.(`#hub-search-opt-${active}`)?.scrollIntoView?.({ block: "nearest" }); }, [active]);
|
|
91
|
+
const activeId = flat.length ? `hub-search-opt-${Math.min(active, flat.length - 1)}` : undefined;
|
|
92
|
+
const failed = res.status === "error";
|
|
93
|
+
return html`<dialog data-trust="dialog" ref=${ref} class="dlg search-dlg hub-search-dlg" aria-label=${hroom("searchLabel")} onKeyDown=${onKey}>
|
|
94
|
+
<div class="search-box">
|
|
95
|
+
<div class="search-head"><${Icon} name="search" />
|
|
96
|
+
<input ref=${input} class="search-input" type="search" value=${q} placeholder=${hroom("searchPlaceholder")} aria-label=${hroom("searchLabel")}
|
|
97
|
+
role="combobox" aria-expanded=${flat.length ? "true" : "false"} aria-controls="hub-search-results" aria-autocomplete="list" aria-activedescendant=${activeId}
|
|
98
|
+
autocomplete="off" spellcheck=${false} enterkeyhint="search" onInput=${(e) => setQ(e.target.value)} />
|
|
99
|
+
<button type="button" class="icon-btn" aria-label=${hroom("searchClose")} title=${hroom("searchClose")} onClick=${onClose}><${Icon} name="close" /></button>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="search-body">
|
|
102
|
+
${!query ? html`<div class="search-empty"><p class="search-hint">${hroom("searchHint")}</p></div>` : html`
|
|
103
|
+
${res.status === "loading" && !res.hits.length && !names.length ? html`<${Skeleton} variant="rows" lines=${4} label=${hroom("searchSearching")} />` : null}
|
|
104
|
+
${failed ? html`<p class="search-status bad" role="alert">${res.code === "busy" ? hroom("searchBusy") : hroom("searchFailed")}</p>` : null}
|
|
105
|
+
${res.status === "ok" && !res.hits.length && !names.length ? html`<p class="search-status" role="status">${res.cursor ? hroom("searchNoneYet") : hroom("searchNone")}</p>` : null}
|
|
106
|
+
<div id="hub-search-results" role="listbox" aria-label=${hroom("searchResults")} class=${`search-results${res.status === "loading" ? " stale" : ""}`}>
|
|
107
|
+
${names.length ? html`<div role="group" class="search-group" aria-label=${hroom("searchRooms")}>
|
|
108
|
+
<div class="search-group-head" aria-hidden="true"><span>${hroom("searchRooms")}</span></div>
|
|
109
|
+
${names.map((room, i) => html`<div id=${`hub-search-opt-${i}`} role="option" aria-selected=${i === active ? "true" : "false"} class=${`search-row${i === active ? " on" : ""}`}
|
|
110
|
+
onMouseMove=${i === active ? undefined : () => setActive(i)} onClick=${() => pick({ room })}>
|
|
111
|
+
<div class="search-row-top"><span class="search-badge chat">${room.kind === "group" ? hroom("searchBadgeRoom") : hroom("searchBadgeChat")}</span><span class="search-who">${roomLabel(room)}</span></div></div>`)}
|
|
112
|
+
</div>` : null}
|
|
113
|
+
${groups.map((g) => html`<div role="group" class="search-group" aria-label=${g.name}>
|
|
114
|
+
<div class="search-group-head" aria-hidden="true"><span>${g.name}</span><span class="search-count">${hroom("searchCount", String(g.hits.length))}</span></div>
|
|
115
|
+
${g.hits.map(({ hit, index }) => html`<div id=${`hub-search-opt-${index}`} role="option" aria-selected=${index === active ? "true" : "false"} class=${`search-row${index === active ? " on" : ""}`}
|
|
116
|
+
onMouseMove=${index === active ? undefined : () => setActive(index)} onClick=${() => pick({ hit })}>
|
|
117
|
+
<div class="search-row-top"><span class="search-who">${hit.author?.name || ""}</span>
|
|
118
|
+
<time class="search-time" datetime=${Number.isFinite(hit.at) ? new Date(hit.at).toISOString() : undefined}>${when(hit.at)}</time></div>
|
|
119
|
+
<div class="search-snippet">${segments(hit.snippet, hit.marks).map((s) => (s.mark ? html`<mark>${s.text}</mark>` : s.text))}</div></div>`)}
|
|
120
|
+
</div>`)}
|
|
121
|
+
</div>
|
|
122
|
+
${res.cursor && res.status !== "loading" ? html`<p class="search-hint"><button type="button" class="chip-btn hub-search-more" onClick=${() => void run(query, res.cursor)}>${hroom("searchOlder")}</button></p>` : null}`}
|
|
123
|
+
</div>
|
|
124
|
+
<div class="search-foot" aria-hidden="true">${hroom("searchKeys")}</div>
|
|
125
|
+
</div></dialog>`;
|
|
126
|
+
}
|