@songsid/agend 2.4.0-beta.25 → 2.4.0-beta.27
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-endpoint.d.ts +1 -0
- package/dist/agent-endpoint.js +5 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-file-read.js +1 -1
- package/dist/agent-file-read.js.map +1 -1
- package/dist/agent-whats-new.js +4 -0
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/auth-api.js +3 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/kiro-auth-store.d.ts +15 -2
- package/dist/backend/kiro-auth-store.js +64 -0
- package/dist/backend/kiro-auth-store.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/discord.js +4 -4
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.js +3 -3
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/ipc-bridge.d.ts +7 -0
- package/dist/channel/ipc-bridge.js +45 -11
- package/dist/channel/ipc-bridge.js.map +1 -1
- package/dist/channel/mcp-server.js +3 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +6 -4
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/cli.js +35 -2
- package/dist/cli.js.map +1 -1
- package/dist/daemon.d.ts +64 -3
- package/dist/daemon.js +497 -102
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +107 -7
- package/dist/delivery-outbox.js +297 -9
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/detached-fleet-stop.d.ts +40 -0
- package/dist/detached-fleet-stop.js +126 -0
- package/dist/detached-fleet-stop.js.map +1 -0
- package/dist/fleet-lock.d.ts +21 -0
- package/dist/fleet-lock.js +61 -2
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +502 -5
- package/dist/fleet-manager.js +2845 -228
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +39 -3
- package/dist/fleet-windows-runtime.js +208 -30
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +6 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +17 -2
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +3 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +102 -25
- package/dist/hub/admin-dashboard.js +1 -1
- package/dist/hub/admin-dashboard.js.map +1 -1
- package/dist/hub/agent-catalog.d.ts +1 -1
- package/dist/hub/agent-catalog.js +4 -3
- package/dist/hub/agent-catalog.js.map +1 -1
- package/dist/hub/agent-intro.d.ts +1 -1
- package/dist/hub/agent-intro.js +1 -1
- package/dist/hub/agent-intro.js.map +1 -1
- package/dist/hub/agent-pictures.d.ts +1 -1
- package/dist/hub/agent-pictures.js +4 -3
- package/dist/hub/agent-pictures.js.map +1 -1
- package/dist/hub/catalog.d.ts +2 -2
- package/dist/hub/catalog.js +16 -13
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.js +16 -2
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.js +14 -2
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +1 -0
- package/dist/hub/compose/server.js +6 -3
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/fleet-updates.d.ts +2 -2
- package/dist/hub/fleet-updates.js +7 -5
- package/dist/hub/fleet-updates.js.map +1 -1
- package/dist/hub/fleet-versions.d.ts +1 -1
- package/dist/hub/fleet-versions.js +3 -2
- package/dist/hub/fleet-versions.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/http/compose.js +59 -31
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +1 -0
- package/dist/hub/http/schema.js +4 -1
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/join/service.d.ts +6 -0
- package/dist/hub/join/service.js +10 -0
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/member/room-ask.d.ts +7 -8
- package/dist/hub/member/room-ask.js +54 -13
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-post.d.ts +4 -0
- package/dist/hub/member/room-post.js +26 -1
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/member/room-reaction-acks.d.ts +12 -0
- package/dist/hub/member/room-reaction-acks.js +44 -0
- package/dist/hub/member/room-reaction-acks.js.map +1 -0
- package/dist/hub/protocol.d.ts +62 -0
- package/dist/hub/protocol.js +5 -4
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/quota.d.ts +2 -2
- package/dist/hub/quota.js +6 -4
- package/dist/hub/quota.js.map +1 -1
- package/dist/hub/read-statement.d.ts +6 -0
- package/dist/hub/read-statement.js +33 -0
- package/dist/hub/read-statement.js.map +1 -0
- package/dist/hub/recommendations.d.ts +1 -1
- package/dist/hub/recommendations.js +3 -2
- package/dist/hub/recommendations.js.map +1 -1
- package/dist/hub/representative.d.ts +2 -0
- package/dist/hub/representative.js +8 -4
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/roles/audit-details.d.ts +2 -0
- package/dist/hub/roles/audit-details.js +1 -1
- package/dist/hub/roles/audit-details.js.map +1 -1
- package/dist/hub/roles/authority.d.ts +8 -3
- package/dist/hub/roles/authority.js +144 -102
- package/dist/hub/roles/authority.js.map +1 -1
- package/dist/hub/roles/clock.js +6 -5
- package/dist/hub/roles/clock.js.map +1 -1
- package/dist/hub/roles/delegation.js +2 -2
- package/dist/hub/roles/delegation.js.map +1 -1
- package/dist/hub/roles/model.d.ts +5 -2
- package/dist/hub/roles/model.js +5 -4
- package/dist/hub/roles/model.js.map +1 -1
- package/dist/hub/roles/read.d.ts +2 -0
- package/dist/hub/roles/read.js +27 -6
- package/dist/hub/roles/read.js.map +1 -1
- package/dist/hub/roles/review.js +2 -2
- package/dist/hub/roles/review.js.map +1 -1
- package/dist/hub/room-history-model.d.ts +87 -0
- package/dist/hub/room-history-model.js +14 -0
- package/dist/hub/room-history-model.js.map +1 -0
- package/dist/hub/room-react-ack-model.d.ts +2 -0
- package/dist/hub/room-react-ack-model.js +3 -0
- package/dist/hub/room-react-ack-model.js.map +1 -0
- package/dist/hub/rooms/admin.d.ts +6 -0
- package/dist/hub/rooms/admin.js +33 -0
- package/dist/hub/rooms/admin.js.map +1 -1
- package/dist/hub/rooms/agents.d.ts +3 -1
- package/dist/hub/rooms/agents.js +47 -5
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/history.d.ts +8 -0
- package/dist/hub/rooms/history.js +31 -0
- package/dist/hub/rooms/history.js.map +1 -0
- package/dist/hub/rooms/schema.d.ts +2 -0
- package/dist/hub/rooms/schema.js +4 -0
- package/dist/hub/rooms/schema.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +40 -20
- package/dist/hub/rooms/service.js +181 -50
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +2 -0
- package/dist/hub/server.js +15 -3
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-epoch.js +2 -1
- package/dist/hub/session-epoch.js.map +1 -1
- package/dist/hub/settings-directory-decision.js +3 -2
- package/dist/hub/settings-directory-decision.js.map +1 -1
- package/dist/hub/settings-member-address-decision.js +2 -1
- package/dist/hub/settings-member-address-decision.js.map +1 -1
- package/dist/hub/settings-web-address-decision.js +2 -1
- package/dist/hub/settings-web-address-decision.js.map +1 -1
- package/dist/hub/store.d.ts +1 -0
- package/dist/hub/store.js +12 -4
- package/dist/hub/store.js.map +1 -1
- package/dist/hub/types.d.ts +4 -2
- package/dist/hub-agent-incarnation-record.d.ts +24 -0
- package/dist/hub-agent-incarnation-record.js +46 -0
- package/dist/hub-agent-incarnation-record.js.map +1 -0
- package/dist/human-delivery-receipts.d.ts +16 -4
- package/dist/human-delivery-receipts.js +26 -5
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +9 -3
- package/dist/instance-lifecycle.js +27 -10
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/local-pane-endpoint.d.ts +14 -0
- package/dist/local-pane-endpoint.js +32 -0
- package/dist/local-pane-endpoint.js.map +1 -1
- package/dist/locale.js +54 -6
- package/dist/locale.js.map +1 -1
- package/dist/native-agent-admission.js +9 -0
- package/dist/native-agent-admission.js.map +1 -1
- package/dist/native-exec-context.d.ts +11 -0
- package/dist/native-exec-context.js +18 -0
- package/dist/native-exec-context.js.map +1 -0
- package/dist/native-exec-input.d.ts +56 -0
- package/dist/native-exec-input.js +89 -0
- package/dist/native-exec-input.js.map +1 -0
- package/dist/native-mcp.d.ts +9 -1
- package/dist/native-mcp.js +29 -7
- package/dist/native-mcp.js.map +1 -1
- package/dist/native-pane-lifecycle.d.ts +3 -0
- package/dist/native-pane-lifecycle.js +2 -0
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-manager.d.ts +18 -0
- package/dist/native-pane-manager.js +85 -8
- package/dist/native-pane-manager.js.map +1 -1
- package/dist/needs-you.d.ts +2 -1
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +1 -0
- package/dist/outbound-handlers.js +9 -3
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +5 -0
- package/dist/outbound-schemas.js +2 -0
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +5 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/recover.cjs +213 -26
- package/dist/reply-buttons-controller.d.ts +1 -0
- package/dist/reply-buttons-controller.js +1 -1
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/request-contact-gate.d.ts +2 -0
- package/dist/request-contact-gate.js +8 -3
- package/dist/request-contact-gate.js.map +1 -1
- package/dist/request-contact-native.js +4 -0
- package/dist/request-contact-native.js.map +1 -1
- package/dist/request-context-activation.d.ts +29 -0
- package/dist/request-context-activation.js +74 -0
- package/dist/request-context-activation.js.map +1 -0
- package/dist/request-context-admission.d.ts +22 -0
- package/dist/request-context-admission.js +12 -0
- package/dist/request-context-admission.js.map +1 -0
- package/dist/request-context-boot.d.ts +35 -0
- package/dist/request-context-boot.js +97 -0
- package/dist/request-context-boot.js.map +1 -0
- package/dist/request-context-call.d.ts +2 -0
- package/dist/request-context-call.js.map +1 -1
- package/dist/request-context-continuation.d.ts +6 -0
- package/dist/request-context-continuation.js +24 -0
- package/dist/request-context-continuation.js.map +1 -0
- package/dist/request-context-control-api.d.ts +101 -0
- package/dist/request-context-control-api.js +177 -0
- package/dist/request-context-control-api.js.map +1 -0
- package/dist/request-context-control-copy.d.ts +3 -0
- package/dist/request-context-control-copy.js +7 -0
- package/dist/request-context-control-copy.js.map +1 -0
- package/dist/request-context-controller.d.ts +44 -0
- package/dist/request-context-controller.js +129 -0
- package/dist/request-context-controller.js.map +1 -0
- package/dist/request-context-delivery-resolver.d.ts +13 -0
- package/dist/request-context-delivery-resolver.js +30 -0
- package/dist/request-context-delivery-resolver.js.map +1 -0
- package/dist/request-context-drain.d.ts +13 -0
- package/dist/request-context-drain.js +79 -6
- package/dist/request-context-drain.js.map +1 -1
- package/dist/request-context-enable-offer.d.ts +13 -0
- package/dist/request-context-enable-offer.js +31 -0
- package/dist/request-context-enable-offer.js.map +1 -0
- package/dist/request-context-exec-owner.d.ts +39 -0
- package/dist/request-context-exec-owner.js +128 -0
- package/dist/request-context-exec-owner.js.map +1 -0
- package/dist/request-context-go-back-view.d.ts +1 -0
- package/dist/request-context-go-back-view.js +17 -0
- package/dist/request-context-go-back-view.js.map +1 -0
- package/dist/request-context-helper-readiness.d.ts +14 -0
- package/dist/request-context-helper-readiness.js +23 -0
- package/dist/request-context-helper-readiness.js.map +1 -0
- package/dist/request-context-helper.d.ts +20 -0
- package/dist/request-context-helper.js +41 -0
- package/dist/request-context-helper.js.map +1 -0
- package/dist/request-context-hub-resolver.d.ts +29 -0
- package/dist/request-context-hub-resolver.js +90 -0
- package/dist/request-context-hub-resolver.js.map +1 -0
- package/dist/request-context-human-resolver.d.ts +20 -0
- package/dist/request-context-human-resolver.js +77 -0
- package/dist/request-context-human-resolver.js.map +1 -0
- package/dist/request-context-human.d.ts +106 -0
- package/dist/request-context-human.js +153 -0
- package/dist/request-context-human.js.map +1 -0
- package/dist/request-context-inputs.d.ts +21 -0
- package/dist/request-context-inputs.js +63 -0
- package/dist/request-context-inputs.js.map +1 -0
- package/dist/request-context-installation.d.ts +117 -0
- package/dist/request-context-installation.js +328 -0
- package/dist/request-context-installation.js.map +1 -0
- package/dist/request-context-knowledge.d.ts +5 -0
- package/dist/request-context-knowledge.js +32 -0
- package/dist/request-context-knowledge.js.map +1 -0
- package/dist/request-context-native-human.d.ts +20 -0
- package/dist/request-context-native-human.js +91 -0
- package/dist/request-context-native-human.js.map +1 -0
- package/dist/request-context-native-output.d.ts +15 -0
- package/dist/request-context-native-output.js +46 -0
- package/dist/request-context-native-output.js.map +1 -0
- package/dist/request-context-native-result.d.ts +15 -0
- package/dist/request-context-native-result.js +46 -0
- package/dist/request-context-native-result.js.map +1 -0
- package/dist/request-context-off.d.ts +22 -0
- package/dist/request-context-off.js +77 -0
- package/dist/request-context-off.js.map +1 -0
- package/dist/request-context-outside-label.d.ts +5 -0
- package/dist/request-context-outside-label.js +28 -0
- package/dist/request-context-outside-label.js.map +1 -0
- package/dist/request-context-pane.d.ts +8 -0
- package/dist/request-context-pane.js +19 -0
- package/dist/request-context-pane.js.map +1 -1
- package/dist/request-context-pending-work.d.ts +11 -0
- package/dist/request-context-pending-work.js +43 -0
- package/dist/request-context-pending-work.js.map +1 -0
- package/dist/request-context-policy.d.ts +17 -1
- package/dist/request-context-policy.js +84 -6
- package/dist/request-context-policy.js.map +1 -1
- package/dist/request-context-readiness.d.ts +49 -0
- package/dist/request-context-readiness.js +64 -0
- package/dist/request-context-readiness.js.map +1 -0
- package/dist/request-context-recovery.d.ts +6 -2
- package/dist/request-context-recovery.js +25 -0
- package/dist/request-context-recovery.js.map +1 -1
- package/dist/request-context-relay.d.ts +2 -2
- package/dist/request-context-relay.js +10 -10
- package/dist/request-context-relay.js.map +1 -1
- package/dist/request-context-retirement.d.ts +19 -0
- package/dist/request-context-retirement.js +16 -0
- package/dist/request-context-retirement.js.map +1 -0
- package/dist/request-context-start.d.ts +15 -0
- package/dist/request-context-start.js +2 -0
- package/dist/request-context-start.js.map +1 -0
- package/dist/request-context-turns.d.ts +1 -1
- package/dist/request-context-turns.js +3 -2
- package/dist/request-context-turns.js.map +1 -1
- package/dist/request-context-unproved-label.d.ts +4 -0
- package/dist/request-context-unproved-label.js +25 -0
- package/dist/request-context-unproved-label.js.map +1 -0
- package/dist/request-context-update-guard.d.ts +15 -0
- package/dist/request-context-update-guard.js +54 -0
- package/dist/request-context-update-guard.js.map +1 -0
- package/dist/request-context-work.d.ts +50 -0
- package/dist/request-context-work.js +178 -0
- package/dist/request-context-work.js.map +1 -0
- package/dist/request-hub-context.d.ts +1 -0
- package/dist/request-hub-output.d.ts +2 -0
- package/dist/request-hub-output.js +12 -0
- package/dist/request-hub-output.js.map +1 -1
- package/dist/retained-human-control.d.ts +11 -0
- package/dist/retained-human-control.js +11 -0
- package/dist/retained-human-control.js.map +1 -0
- package/dist/runtime-build-info.js +1 -1
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli.js +1 -1
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.js +7 -1
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.js +15 -3
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +23 -0
- package/dist/runtime-coordinator.js +103 -4
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-pane-mcp.d.ts +9 -0
- package/dist/runtime-pane-mcp.js +22 -2
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-protocol.d.ts +2 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/runtime-update-controller.js +1 -1
- package/dist/runtime-update-controller.js.map +1 -1
- package/dist/runtime-windows-bridge.d.ts +8 -0
- package/dist/runtime-windows-bridge.js +50 -3
- package/dist/runtime-windows-bridge.js.map +1 -1
- package/dist/scheduler/scheduler.d.ts +9 -0
- package/dist/scheduler/scheduler.js +26 -0
- package/dist/scheduler/scheduler.js.map +1 -1
- package/dist/scheduler/scheduler.test.js +17 -0
- package/dist/scheduler/scheduler.test.js.map +1 -1
- package/dist/service-install-handover.d.ts +52 -0
- package/dist/service-install-handover.js +50 -0
- package/dist/service-install-handover.js.map +1 -0
- package/dist/service-installer.d.ts +12 -0
- package/dist/service-installer.js +24 -10
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-api.d.ts +2 -0
- package/dist/settings-api.js +76 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +1 -0
- package/dist/settings-baseline.js +5 -4
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +13 -0
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +2 -0
- package/dist/settings-confirmation.js +6 -0
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +2 -0
- package/dist/settings-effect.js +55 -2
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +3 -0
- package/dist/settings-http-confirmation.js +29 -0
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-route-lifetime.d.ts +3 -1
- package/dist/settings-route-lifetime.js +15 -5
- package/dist/settings-route-lifetime.js.map +1 -1
- package/dist/settings-transaction.d.ts +3 -2
- package/dist/settings-transaction.js.map +1 -1
- package/dist/tips.js +1 -1
- package/dist/tips.js.map +1 -1
- package/dist/tool-permissions.js +3 -3
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-receipt-output.d.ts +6 -6
- package/dist/turn-reply-guard.d.ts +16 -1
- package/dist/turn-reply-guard.js +20 -2
- package/dist/turn-reply-guard.js.map +1 -1
- package/dist/ui/app.html +2 -2
- package/dist/ui/contact-auth-strings.js +13 -8
- package/dist/ui/contact-authorizations.js +19 -1
- package/dist/ui/contact-grant-editor.js +71 -11
- package/dist/ui/contact-needs.js +27 -8
- package/dist/ui/contact-permissions.js +34 -9
- package/dist/ui/contact-tool-groups.js +1 -1
- package/dist/ui/fleet-office-pack.d.ts +2 -2
- package/dist/ui/fleet-office-pack.js +25 -8
- package/dist/ui/fleet-office-vehicles.js +28 -11
- package/dist/ui/fleet-office-zones.js +2 -2
- package/dist/ui/fleet-office.js +25 -5
- package/dist/ui/hub-admin-rooms-strings.js +6 -2
- package/dist/ui/hub-admin-rooms.js +3 -1
- package/dist/ui/hub-client.js +3 -0
- package/dist/ui/hub-group-search.js +2 -2
- package/dist/ui/hub-notify-keep.js +49 -0
- package/dist/ui/hub-role-view.js +1 -1
- package/dist/ui/hub-roles-strings.js +14 -10
- package/dist/ui/hub-roles.js +1 -1
- package/dist/ui/hub-room-members.js +4 -2
- package/dist/ui/hub-room-notify.js +2 -1
- package/dist/ui/hub-room-settings-strings.js +8 -0
- package/dist/ui/hub-room-settings.js +32 -0
- package/dist/ui/hub-room-strings.js +3 -3
- package/dist/ui/hub-room-thread.js +16 -5
- package/dist/ui/icons/hub-apple-touch-icon.png +0 -0
- package/dist/ui/icons/hub-favicon.ico +0 -0
- package/dist/ui/icons/hub-favicon.svg +10 -0
- package/dist/ui/icons/hub-icon-192.png +0 -0
- package/dist/ui/icons/hub-icon-512.png +0 -0
- package/dist/ui/icons/hub-icon-maskable-192.png +0 -0
- package/dist/ui/icons/hub-icon-maskable-512.png +0 -0
- package/dist/ui/icons/hub-maskable.svg +12 -0
- package/dist/ui/panel-hub.js +17 -5
- package/dist/ui/panel-needs.js +15 -6
- package/dist/ui/panel-settings.js +2 -1
- package/dist/ui/request-contact-card.js +287 -0
- package/dist/ui/request-contact-client.js +83 -0
- package/dist/ui/request-contact-page.js +78 -0
- package/dist/ui/request-context-control.js +171 -0
- package/dist/ui/settings-registry.js +2 -0
- package/dist/ui/settings-update.js +15 -1
- package/dist/ui/shared/app-install.js +123 -0
- package/dist/ui/shared/app-shell.js +17 -5
- package/dist/ui/shared/app-stream.js +1 -0
- package/dist/ui/shared/app-update.js +17 -2
- package/dist/ui/shared/app.css +136 -8
- package/dist/ui/shared/app.js +19 -2
- package/dist/ui/shared/hub-chat.css +6 -0
- package/dist/ui/shared/ui-confirm.js +4 -3
- package/dist/ui/shared/ui-icons.js +2 -0
- package/dist/ui/shared/ui-states.js +6 -0
- package/dist/ui/shared/update-card-ui.js +586 -0
- package/dist/ui/shared/view-strings.js +18 -0
- package/dist/ui/shared/web-authorize.js +1 -1
- package/dist/update-abandon.d.ts +26 -0
- package/dist/update-abandon.js +111 -0
- package/dist/update-abandon.js.map +1 -0
- package/dist/update-card.d.ts +1 -1
- package/dist/update-card.js +7 -7
- package/dist/update-card.js.map +1 -1
- package/dist/update-fix.d.ts +66 -0
- package/dist/update-fix.js +67 -0
- package/dist/update-fix.js.map +1 -0
- package/dist/update-forward.d.ts +5 -19
- package/dist/update-forward.js +19 -75
- package/dist/update-forward.js.map +1 -1
- package/dist/update-goback.d.ts +90 -0
- package/dist/update-goback.js +270 -0
- package/dist/update-goback.js.map +1 -0
- package/dist/update-journal.d.ts +8 -0
- package/dist/update-journal.js +8 -2
- package/dist/update-journal.js.map +1 -1
- package/dist/update-package-restore.d.ts +11 -2
- package/dist/update-package-restore.js +16 -5
- package/dist/update-package-restore.js.map +1 -1
- package/dist/update-quiescence.d.ts +38 -9
- package/dist/update-quiescence.js +50 -10
- package/dist/update-quiescence.js.map +1 -1
- package/dist/update-readiness.d.ts +2 -0
- package/dist/update-readiness.js +5 -1
- package/dist/update-readiness.js.map +1 -1
- package/dist/update-recovery/recover.js +10 -0
- package/dist/update-recovery/recover.js.map +1 -1
- package/dist/update-recovery/runner.d.ts +4 -0
- package/dist/update-recovery/runner.js +38 -5
- package/dist/update-recovery/runner.js.map +1 -1
- package/dist/update-restore.d.ts +7 -1
- package/dist/update-restore.js +10 -5
- package/dist/update-restore.js.map +1 -1
- package/dist/update-retained.d.ts +28 -1
- package/dist/update-retained.js +28 -3
- package/dist/update-retained.js.map +1 -1
- package/dist/update-settings.d.ts +27 -0
- package/dist/update-settings.js +40 -0
- package/dist/update-settings.js.map +1 -1
- package/dist/update-snapshot-scope.js +2 -0
- package/dist/update-snapshot-scope.js.map +1 -1
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +9 -0
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/providers.d.ts +3 -11
- package/dist/usage/providers.js +93 -131
- package/dist/usage/providers.js.map +1 -1
- package/dist/web-api.d.ts +4 -0
- package/dist/web-api.js +50 -7
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +2 -0
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-icons.d.ts +20 -3
- package/dist/web-icons.js +76 -7
- package/dist/web-icons.js.map +1 -1
- package/dist/web-mentions.d.ts +27 -8
- package/dist/web-mentions.js +108 -1
- package/dist/web-mentions.js.map +1 -1
- package/dist/web-office-acts.js +3 -0
- package/dist/web-office-acts.js.map +1 -1
- package/dist/web-update.d.ts +9 -0
- package/dist/windows-agents.d.ts +24 -2
- package/dist/windows-agents.js +110 -4
- package/dist/windows-agents.js.map +1 -1
- package/dist/windows-cli-worker.js +9 -1
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +15 -0
- package/dist/windows-cli.js +54 -6
- package/dist/windows-cli.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { clockFormat } from "/assets/clock-text.js";
|
|
2
|
+
// S-230: the owner switch. Status comes from the host, never from a browser preference or an agent argument.
|
|
3
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
4
|
+
import { lang, register, t } from "/assets/app-i18n.js";
|
|
5
|
+
import { appStore, useStore } from "/assets/app-store.js";
|
|
6
|
+
import { useLease } from "/assets/app-ctx.js";
|
|
7
|
+
import { confirmedWrite } from "./settings-confirm.js";
|
|
8
|
+
import { confirmDialog } from "/assets/ui-confirm.js";
|
|
9
|
+
import { detailsPath, settingsPath } from "/assets/app-route.js";
|
|
10
|
+
import { AuthorizeChip } from "/assets/web-authorize.js";
|
|
11
|
+
|
|
12
|
+
register("requestContextControl", {
|
|
13
|
+
en: {
|
|
14
|
+
enableUnavailable: "Request-based approvals can't be turned on in this version yet.",
|
|
15
|
+
restart: "Turning this on restarts {0} agents (their conversations are kept); they can't chat for a minute or two.", goBack: "Go back for the latest update is available until {0}; turning this on ends it immediately.", viewUpdate: "View AgEnD update", viewOwners: "View these agents", waitTitle: "End this wait?", enableTitle: "Turn on request-based contact approvals?", enable: "Confirm turn on", unknown: "State unknown", inspect: "View held messages", update: "Finish or resolve the AgEnD update first, then check again.", stopTitle: "Stop this work?", stopBody: "This ends the saved work and prevents it from resuming. History stays. Other outside requests still wait for your decision.", waitBody: "A late reply will not resume this work. Other outside requests still wait for your decision.", title: "Request-based contact approvals", on: "On: approval applies only to this request.",
|
|
16
|
+
off: "Off. Your own messages go through as usual; requests that came from outside wait for your decision.",
|
|
17
|
+
offBefore: "Not enabled. Contacts haven't changed.",
|
|
18
|
+
draining: "Turning off. Waiting for current work to finish.", blocked: "Request-based approvals are waiting.", blockedBefore: "Turning this on has to wait for these first:",
|
|
19
|
+
legacyPending: "Decide these earlier contact requests first, in Fleet → Authorizations: {0}.",
|
|
20
|
+
legacyInflight: "These earlier approved messages are still being delivered: {0}. This clears by itself once each is delivered or fails.",
|
|
21
|
+
legacyUnsettled: "These earlier requests have no readable delivery record, so AgEnD can't tell whether they happened: {0}. They can't be settled from this page yet; leave request-based approvals off for now.",
|
|
22
|
+
legacyDeliveries: "These earlier messages are still waiting to be delivered: {0}. This clears by itself once they are delivered or fail.",
|
|
23
|
+
recoveryBlocked: "Request-based approvals need your attention.",
|
|
24
|
+
confirmTitle: "Turn off request-based approvals?", confirm: "Confirm turn off",
|
|
25
|
+
confirmBody: "New outside requests will wait while current work finishes. Then your own messages go through as usual; outside requests wait for your decision.",
|
|
26
|
+
legacy: "Resolve these earlier held messages first: {0}.", peers: "Update AgEnD on {0}, then press Check again.",
|
|
27
|
+
owners: "These agents need preparation: {0}.", ownersWork: "Finish the current work for these agents first: {0}. Wait for them to finish, or restart an agent that stays busy.", ownersUpdate: "Complete the AgEnD update for these agents first: {0}.", recovery: "This work needs your decision: {0}.",
|
|
28
|
+
returns: "Waiting for a reply: {0}.", tickets: "Resolve these held messages: {0}.", work: "Waiting for this work to finish: {0}.",
|
|
29
|
+
previous: "The previous rules still apply.", floor: "You can no longer downgrade to older AgEnD versions.",
|
|
30
|
+
floorBefore: "Note: once on, you can't go back to an older AgEnD, even if you turn this off later.",
|
|
31
|
+
check: "Check again", error: "Couldn't read the current state. Try again.", failed: "Couldn't confirm whether anything changed. Press Check again.",
|
|
32
|
+
notice: "Request-based contact approvals are on: approval applies only to this request. Earlier conversations won't block an administrator's new request. The switch is in Settings → Access & security. Warning: you can no longer downgrade to older AgEnD versions.",
|
|
33
|
+
open: "Open settings", loading: "Checking the current state…",
|
|
34
|
+
"stop-waiting": "End this wait", decline: "Decline", withdraw: "Withdraw", "stop-work": "Stop this work",
|
|
35
|
+
},
|
|
36
|
+
"zh-TW": {
|
|
37
|
+
enableUnavailable: "這一版還不能開啟依請求核准聯絡。",
|
|
38
|
+
restart: "開啟時會重新啟動 {0} 個 Agent(對話會保留),大約一兩分鐘內無法對話。", goBack: "最近一次更新的「退回上一版」原本可以用到 {0},開啟後會立刻結束。", viewUpdate: "查看 AgEnD 更新", viewOwners: "查看這些 Agent", waitTitle: "結束這次等候?", enableTitle: "開啟依請求核准聯絡?", enable: "確認開啟", unknown: "狀態不明", inspect: "查看擱置的訊息", update: "請先完成或處理 AgEnD 更新,再重新檢查。", stopTitle: "結束這項工作?", stopBody: "這會結束已儲存的工作,不會再繼續執行。歷史會保留,其他外部請求仍會等你決定。", waitBody: "之後的回覆不會再繼續這項工作;其他外部請求仍會等你決定。", title: "依請求核准聯絡", on: "已開啟:核准只對這一次請求有效。",
|
|
39
|
+
off: "已關閉。你自己的訊息照常;從外部來的請求會等你決定。",
|
|
40
|
+
offBefore: "尚未開啟,聯絡方式沒有變更。",
|
|
41
|
+
draining: "正在關閉,等目前的工作結束。", blocked: "依請求核准聯絡尚未開啟。", blockedBefore: "開啟前需要先處理這些項目:",
|
|
42
|
+
legacyPending: "請先在「Fleet → 授權」決定這些先前的聯絡申請:{0}。",
|
|
43
|
+
legacyInflight: "這些先前已核准的訊息仍在送出中:{0}。每則送達或失敗後就會自動解除。",
|
|
44
|
+
legacyUnsettled: "這些先前的申請沒有可讀取的送出紀錄,AgEnD 無法判斷是否已經發生:{0}。目前還無法在這一頁處理;請暫時不要開啟依請求核准聯絡。",
|
|
45
|
+
legacyDeliveries: "這些先前的訊息仍在等候送出:{0}。送達或失敗後就會自動解除。",
|
|
46
|
+
recoveryBlocked: "依請求核准聯絡需要你處理。",
|
|
47
|
+
confirmTitle: "關閉依請求核准聯絡?", confirm: "確認關閉",
|
|
48
|
+
confirmBody: "新的外部請求會先等候,直到目前的工作結束。之後,你自己的訊息照常;從外部來的請求會等你決定。",
|
|
49
|
+
legacy: "請先處理這些先前擱置的訊息:{0}。", peers: "請在 {0} 上更新 AgEnD,完成後按「重新檢查」。",
|
|
50
|
+
owners: "這些 Agent 需要先完成準備:{0}。", ownersWork: "請先結束這些 Agent 目前的工作:{0}。請等它們完成,或重新啟動一直忙碌的 Agent。", ownersUpdate: "請先完成這些 Agent 的 AgEnD 更新:{0}。", recovery: "這項工作需要你決定:{0}。",
|
|
51
|
+
returns: "正在等候回覆:{0}。", tickets: "請先處理這些擱置的訊息:{0}。", work: "正在等這項工作結束:{0}。",
|
|
52
|
+
previous: "目前仍使用原本的規則。", floor: "已不能再降回舊版 AgEnD。",
|
|
53
|
+
floorBefore: "注意:開啟後就不能再降回舊版 AgEnD,之後關閉也一樣。",
|
|
54
|
+
check: "重新檢查", error: "無法讀取目前狀態,請再試一次。", failed: "無法確認是否已變更,請按「重新檢查」。",
|
|
55
|
+
notice: "依請求核准聯絡已開啟:核准只對這一次請求有效,先前的對話不會再擋住管理員的新請求。開關在「設定」→「存取與安全」。注意:已不能再降回舊版 AgEnD。",
|
|
56
|
+
open: "開啟設定", loading: "正在確認目前狀態…",
|
|
57
|
+
"stop-waiting": "結束這次等候", decline: "拒絕", withdraw: "撤回", "stop-work": "結束這項工作",
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
export const requestContextControlText = (key, ...args) => t(`requestContextControl.${key}`, ...args);
|
|
61
|
+
const LEGACY_KEYS = { "legacy-pending": "legacyPending", "legacy-inflight": "legacyInflight", "legacy-unsettled": "legacyUnsettled", "legacy-deliveries": "legacyDeliveries" };
|
|
62
|
+
export function requestContextBlockerText(blocker) {
|
|
63
|
+
// S-272: an earlier ticket says what settles it (its own sentence by blocker id); an older server's "legacy" keeps its line.
|
|
64
|
+
const legacyKey = blocker.kind === "legacy" && LEGACY_KEYS[blocker.id];
|
|
65
|
+
return requestContextControlText(legacyKey || (blocker.kind === "owners" && blocker.ownerCause ? blocker.ownerCause === "work" ? "ownersWork" : "ownersUpdate" : blocker.kind), (blocker.labels || []).join(lang() === "zh-TW" ? "、" : ", "));
|
|
66
|
+
}
|
|
67
|
+
export function RequestContextBlocked({ state, onCheck, onResolve, busy = false, settingsLink = false }) {
|
|
68
|
+
// S-272: before the first attempt it shows what an On would wait for (Check runs the same inspection as the attempt).
|
|
69
|
+
const before = !state?.everActivated && !state?.attempted;
|
|
70
|
+
if (!state || before && !(state.blockers || []).length) return null;
|
|
71
|
+
const ownerAgents = [...new Map((state.blockers || []).filter(b => b.kind === "owners").flatMap(b => b.agents || []).map(a => [a.id, a])).values()];
|
|
72
|
+
return html`<div class="request-context-blocked">
|
|
73
|
+
<p>${requestContextControlText(state.phase === "draining" ? "draining" : state.everActivated ? "recoveryBlocked" : before ? "blockedBefore" : "blocked")}</p>
|
|
74
|
+
${state.enableFailed ? html`<p class="notice warn" role="alert">${requestContextControlText("failed")}</p>` : null}
|
|
75
|
+
${(state.blockers || []).map(blocker => html`<div key=${blocker.id}><p>${requestContextBlockerText(blocker)}</p>
|
|
76
|
+
${blocker.action === "stop-waiting" ? html`<p>${requestContextControlText("waitBody")}</p>` : null}</div>`)}
|
|
77
|
+
${!state.everActivated ? html`<p class="note">${requestContextControlText("previous")}</p>` : null}
|
|
78
|
+
<div class="request-context-actions">
|
|
79
|
+
${(state.blockers || []).some(b => b.action === "inspect" && b.kind === "legacy") ? html`<a class="btn btn-sm" href="/ui/fleet/authorizations">${requestContextControlText("inspect")}</a>` : null}
|
|
80
|
+
${(state.blockers || []).map(blocker => blocker.action === "inspect"
|
|
81
|
+
? null // S-272: one Authorizations link, for earlier held requests only; agents and the update have their own links below
|
|
82
|
+
: state.canChange && onResolve && blocker.action ? html`<button key=${blocker.id} type="button" class=${`btn btn-sm ${["stop-work", "stop-waiting"].includes(blocker.action) ? "btn-danger" : ""}`} disabled=${busy}
|
|
83
|
+
title=${requestContextBlockerText(blocker)} onClick=${() => onResolve(blocker)}>${requestContextControlText(blocker.action)}</button>` : null)}
|
|
84
|
+
${(state.blockers || []).some(b => b.kind === "update") ? html`<a class="btn btn-sm" href=${settingsPath("advanced") + "#settings-update"}>${requestContextControlText("viewUpdate")}</a>` : null}
|
|
85
|
+
${ownerAgents.map(agent => html`<a class="btn btn-sm" key=${agent.id} href=${detailsPath(agent.id)}>${requestContextControlText("viewOwners")}${ownerAgents.length > 1 ? ` · ${agent.label}` : ""}</a>`)}
|
|
86
|
+
${onCheck ? html`<button type="button" class="btn btn-sm" disabled=${busy} onClick=${onCheck}>${requestContextControlText("check")}</button>` : null}
|
|
87
|
+
${settingsLink ? html`<a class="btn btn-sm" href="/settings/access#request-context">${requestContextControlText("open")}</a>` : null}
|
|
88
|
+
</div>
|
|
89
|
+
</div>`;
|
|
90
|
+
}
|
|
91
|
+
async function writeControl(lease, input) {
|
|
92
|
+
if (input.action !== "check") return confirmedWrite("/api/settings/request-context", { body: input, label: requestContextControlText("title") });
|
|
93
|
+
const response = await lease.fetch("/api/settings/request-context", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(input) });
|
|
94
|
+
return { ok: response.ok, status: response.status, body: await response.json() };
|
|
95
|
+
}
|
|
96
|
+
/** Passive Needs-you payload, from the same owner status as Settings. No background GET or timer. */
|
|
97
|
+
export function RequestContextNeed({ item }) {
|
|
98
|
+
const lease = useLease(`request-context-need:${item.id}`), [busy, setBusy] = useState(false), [failed, setFailed] = useState(false), writing = useRef(false);
|
|
99
|
+
const state = item.requestContextCutover;
|
|
100
|
+
useEffect(() => { setFailed(false); }, [state?.revision]);
|
|
101
|
+
const change = async (blocker = null) => {
|
|
102
|
+
if (writing.current || failed || !state || blocker && !state.canChange) return;
|
|
103
|
+
writing.current = true; setBusy(true); setFailed(false);
|
|
104
|
+
try {
|
|
105
|
+
if (["stop-work", "stop-waiting"].includes(blocker?.action) && !await confirmStopWork(blocker.action)) return;
|
|
106
|
+
const input = blocker ? { revision: state.revision, action: "resolve", blockerId: blocker.id, resolution: blocker.action } : { revision: state.revision, action: "check" };
|
|
107
|
+
const response = await writeControl(lease, input);
|
|
108
|
+
if (!lease.current()) return;
|
|
109
|
+
if (!response.ok && response.status !== 409) throw Error("refused");
|
|
110
|
+
} catch { if (lease.current()) setFailed(true); }
|
|
111
|
+
finally { writing.current = false; if (lease.current()) setBusy(false); }
|
|
112
|
+
};
|
|
113
|
+
return html`<article class="card request-context-need"><h3>${requestContextControlText("title")}</h3>
|
|
114
|
+
<${RequestContextBlocked} state=${state} settingsLink=${true} busy=${busy || failed} onCheck=${() => change()} onResolve=${state?.canChange ? change : null} />
|
|
115
|
+
${state && !state.canChange ? html`<${AuthorizeChip} />` : null}
|
|
116
|
+
${failed ? html`<p class="notice warn" role="alert">${requestContextControlText("failed")}</p>` : null}
|
|
117
|
+
</article>`;
|
|
118
|
+
}
|
|
119
|
+
async function confirmStopWork(action) { return confirmDialog({ title: requestContextControlText(action === "stop-waiting" ? "waitTitle" : "stopTitle"), message: requestContextControlText(action === "stop-waiting" ? "waitBody" : "stopBody"), confirmLabel: requestContextControlText(action), danger: true }); }
|
|
120
|
+
export function RequestContextSettings() {
|
|
121
|
+
const lease = useLease("request-context-control"), [state, setState] = useState(undefined), [failed, setFailed] = useState(false), [busy, setBusy] = useState(false);
|
|
122
|
+
const toggle = useRef(null);
|
|
123
|
+
useEffect(() => { if (toggle.current) toggle.current.indeterminate = failed; }, [failed, state]);
|
|
124
|
+
const writing = useRef(false), lastRevision = useRef(-1), { requestContextCutover: pushed } = useStore(appStore);
|
|
125
|
+
const accept = value => {
|
|
126
|
+
if (value !== null) {
|
|
127
|
+
if (!Number.isSafeInteger(value?.revision) || value.revision < lastRevision.current) return;
|
|
128
|
+
lastRevision.current = value.revision;
|
|
129
|
+
}
|
|
130
|
+
setState(value); setFailed(false);
|
|
131
|
+
};
|
|
132
|
+
const load = async () => {
|
|
133
|
+
try {
|
|
134
|
+
const response = await lease.fetch("/api/settings/request-context"), value = response.status === 404 ? null : await response.json();
|
|
135
|
+
if (!lease.current()) return;
|
|
136
|
+
if (response.status !== 404 && !response.ok) throw Error("unavailable");
|
|
137
|
+
accept(value);
|
|
138
|
+
} catch { if (lease.current()) setFailed(true); }
|
|
139
|
+
};
|
|
140
|
+
useEffect(() => { void load(); }, [lease]);
|
|
141
|
+
useEffect(() => { if (pushed !== undefined && lease.current()) accept(pushed); }, [pushed, lease]);
|
|
142
|
+
const change = async (action, blocker = null) => {
|
|
143
|
+
if (writing.current || failed || !state || action !== "check" && !state.canChange) return;
|
|
144
|
+
if (action === "enable" && state.enableUnavailable) return;
|
|
145
|
+
writing.current = true; setBusy(true); setFailed(false);
|
|
146
|
+
try {
|
|
147
|
+
if (action === "enable" && !await confirmDialog({ title: requestContextControlText("enableTitle"), message: requestContextControlText("floorBefore") + (state.goBack ? "\n\n" + requestContextControlText("goBack", clockFormat({ dateStyle: "medium", timeStyle: "short", timeZone: state.goBack.timeZone }, "en").format(new Date(state.goBack.availableUntil))) : "") + (state.restartCount ? "\n\n" + requestContextControlText("restart", state.restartCount) : ""), confirmLabel: requestContextControlText("enable"), danger: true })) return;
|
|
148
|
+
if (["stop-work", "stop-waiting"].includes(blocker?.action) && !await confirmStopWork(blocker.action)) return;
|
|
149
|
+
if (action === "disable" && !await confirmDialog({ title: requestContextControlText("confirmTitle"), message: requestContextControlText("confirmBody"), confirmLabel: requestContextControlText("confirm"), danger: false })) return;
|
|
150
|
+
if (!lease.current()) return;
|
|
151
|
+
const response = await writeControl(lease, blocker ? { revision: state.revision, action: "resolve", blockerId: blocker.id, resolution: blocker.action } : { revision: state.revision, action });
|
|
152
|
+
if (!lease.current()) return;
|
|
153
|
+
if (response.status === 409) { await load(); return; }
|
|
154
|
+
if (!response.ok) throw Error("refused");
|
|
155
|
+
const value = response.body; if (lease.current()) accept(value);
|
|
156
|
+
} catch { if (lease.current()) setFailed(true); }
|
|
157
|
+
finally { writing.current = false; if (lease.current()) setBusy(false); }
|
|
158
|
+
};
|
|
159
|
+
if (state === null) return null;
|
|
160
|
+
return html`<section id="request-context" class="card request-context-control"><h2>${requestContextControlText("title")}</h2>
|
|
161
|
+
${state ? html`<label class="check request-context-toggle"><input type="checkbox" class="s-ui-toggle" ref=${toggle} aria-checked=${failed ? "mixed" : state.enabled ? "true" : "false"} checked=${!failed && state.enabled}
|
|
162
|
+
disabled=${busy || failed || !state.canChange || state.phase === "draining" || !state.enabled && state.enableUnavailable} onChange=${event => { event.target.checked = state.enabled; void change(state.enabled ? "disable" : "enable"); }} />
|
|
163
|
+
<span>${requestContextControlText("title")}</span></label>
|
|
164
|
+
${!state.enabled && state.enableUnavailable ? html`<p role="status">${requestContextControlText("enableUnavailable")}</p>` : null}
|
|
165
|
+
${failed ? html`<p role="status">${requestContextControlText("unknown")}</p>` : ["blocked", "draining"].includes(state.phase) ? html`<${RequestContextBlocked} state=${state} busy=${busy || failed} onCheck=${() => change("check")} onResolve=${state.canChange ? blocker => change("resolve", blocker) : null} />`
|
|
166
|
+
: html`<p role="status">${requestContextControlText(state.phase === "off" && !state.everActivated ? "offBefore" : state.phase)}</p>`}
|
|
167
|
+
<p class="notice warn">${requestContextControlText(state.everActivated ? "floor" : "floorBefore")}</p>
|
|
168
|
+
${!state.canChange ? html`<${AuthorizeChip} />` : null}` : !failed ? html`<p>${requestContextControlText("loading")}</p>` : null}
|
|
169
|
+
${failed ? html`<p class="notice warn" role="alert">${requestContextControlText(state ? "failed" : "error")}</p><button class="btn btn-sm" type="button" disabled=${busy} onClick=${load}>${requestContextControlText("check")}</button>` : null}
|
|
170
|
+
</section>`;
|
|
171
|
+
}
|
|
@@ -21,6 +21,7 @@ const L = (en, zh) => ({ en, "zh-TW": zh });
|
|
|
21
21
|
const CLI_WORDS = Object.keys(CLI_CAPS).flatMap((id) => [id, id.split("-")[0]]);
|
|
22
22
|
/** [id, section, target, labelKey | label, config key, words en, words zh] */
|
|
23
23
|
const ROWS = [
|
|
24
|
+
["request.context", "access", "#request-context", null, null, ["contact", "approval", "request", "permissions"], ["聯絡", "核准", "請求", "權限"], L("Request-based contact approvals", "依請求核准聯絡")],
|
|
24
25
|
["host.monitoring", "notifications", "#host-monitoring", null, "monitoring.enabled", ["host", "health", "monitoring", "disk", "memory", "cpu", "agent footprint"], ["主機", "監測", "磁碟", "記憶體", "資源用量"], L("Host monitoring", "主機監測")],
|
|
25
26
|
["general.location", "agent-defaults", "#general-location", null, null, ["general", "windows", "paired PC", "host", "location"], ["General", "Windows", "電腦", "主機", "執行位置"], L("Run General on", "General 執行位置")],
|
|
26
27
|
// alpha.6 feedback (#2): "hub" found nothing — Settings → Hub's cards. Connect to a Hub is drawn once membership is on.
|
|
@@ -169,6 +170,7 @@ export function searchSettings(query, schema = null) {
|
|
|
169
170
|
const scored = [];
|
|
170
171
|
for (const entry of SETTINGS_REGISTRY) {
|
|
171
172
|
if (entry.id === "host.monitoring" && !hostMonitoringVisible(schema)) continue;
|
|
173
|
+
if (entry.id === "request.context" && schema?.request_context_control !== true) continue;
|
|
172
174
|
const names = [settingLabel(entry, "en"), settingLabel(entry, "zh-TW")].map(fold);
|
|
173
175
|
const keys = fold(entry.key || "");
|
|
174
176
|
const words = [...(entry.words.en || []), ...(entry.words["zh-TW"] || [])].map(fold);
|
|
@@ -8,6 +8,8 @@ import { useStore } from "/assets/app-store.js";
|
|
|
8
8
|
import { toast } from "/assets/ui-toast.js";
|
|
9
9
|
import { checkUpdateNow, hubNeed, openHubUpdateDialog, openUpdateDialog, refreshUpdate, updateActive, updateStore } from "/assets/app-update.js";
|
|
10
10
|
import { dateTimeText } from "/assets/clock-text.js";
|
|
11
|
+
// M-3770 1.4: the update card's Settings part (a module of its own; its deps are passed, never imported back).
|
|
12
|
+
import { UpdateCardSettings, cardActions } from "/assets/update-card-ui.js";
|
|
11
13
|
|
|
12
14
|
register("supdate", {
|
|
13
15
|
en: { title: "Version and update", current: "Current version", line: "Update line", latest: "Latest", checked: "Last checked",
|
|
@@ -62,11 +64,23 @@ export function UpdateSection() {
|
|
|
62
64
|
${offer && !offer.installable ? html`<p class="s-update-note">${t("supdate.alphaNote")}</p>` : null}
|
|
63
65
|
<div class="s-update-row">
|
|
64
66
|
${need ? html`<button type="button" class="btn btn-primary" disabled=${starting || updateActive(info)} onClick=${() => { void openHubUpdateDialog(); }}>${t("update.now")}</button>`
|
|
67
|
+
: info.card !== undefined ? cardButtons(info, starting)
|
|
65
68
|
: offer && offer.installable ? html`<button type="button" class="btn btn-primary" disabled=${starting || updateActive(info)} onClick=${openUpdateDialog}>${t("update.now")}</button>` : null}
|
|
66
|
-
<button type="button" class="btn" disabled=${checking || updateActive(info)} onClick=${check}>${checking ? t("supdate.checking") : t("supdate.check")}</button>
|
|
69
|
+
<button type="button" class="btn" disabled=${checking || starting || updateActive(info)} onClick=${check}>${checking ? t("supdate.checking") : t("supdate.check")}</button>
|
|
67
70
|
</div>
|
|
71
|
+
${info.card !== undefined ? html`<${UpdateCardSettings} info=${info} deps=${CARD_DEPS} />` : null}
|
|
68
72
|
</section>`;
|
|
69
73
|
}
|
|
74
|
+
/** M-3770 1.4: what update-card-ui.js needs from app-update.js, passed in. */
|
|
75
|
+
const CARD_DEPS = { refresh: () => refreshUpdate(), setInfo: (i) => updateStore.set({ info: i }), getInfo: () => updateStore.get().info,
|
|
76
|
+
setStarting: (starting) => updateStore.set({ starting }) }; // #4564: the row is off while Install as a service restarts AgEnD
|
|
77
|
+
/** M-3770 1.4: with the card, the banner's answers in every state (#4487 review P2: the banner is hidden on this page, so
|
|
78
|
+
* waiting and scheduled keep Cancel and Update now here; Pick a time only where a schedule is taken). One policy: cardActions. */
|
|
79
|
+
function cardButtons(info, starting) {
|
|
80
|
+
const busy = starting || updateActive(info);
|
|
81
|
+
const actions = cardActions(info, CARD_DEPS);
|
|
82
|
+
return actions.length ? actions.map((a) => html`<button type="button" key=${a.key} class=${`btn${a.primary ? " btn-primary" : ""}`} disabled=${busy} onClick=${() => { void a.run(); }}>${a.label}</button>`) : null;
|
|
83
|
+
}
|
|
70
84
|
|
|
71
85
|
/** The "new version" mark beside Settings' version pill (admins, an installable offer). */
|
|
72
86
|
export function UpdatePillMark() {
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// S-255: install the dashboard or the Hub as an app. The page registers /sw.js (web-icons.ts: no fetch handler and no
|
|
2
|
+
// cache, so no API answer or chat is ever stored by it) and keeps the browser's install offer for a button:
|
|
3
|
+
// - Chrome/Edge make the offer (beforeinstallprompt) only where the page could be installed: localhost, or https with a
|
|
4
|
+
// certificate the browser trusts. The button installs.
|
|
5
|
+
// - Safari on iPhone/iPad has no offer: the words say Share → Add to Home Screen.
|
|
6
|
+
// - An https page whose certificate the browser doesn't trust (a Hub's self-signed one) cannot register the worker
|
|
7
|
+
// (SecurityError), and a plain-http LAN address isn't a secure context: the words say why, never a prompt that fails.
|
|
8
|
+
// - Already running as the app, or a browser that offers nothing: no hint at all.
|
|
9
|
+
import { html } from "./app-html.js";
|
|
10
|
+
import { createStore, useStore } from "./app-store.js";
|
|
11
|
+
import { register, t } from "./app-i18n.js";
|
|
12
|
+
import { Icon } from "./ui-icons.js";
|
|
13
|
+
import { confirmDialog } from "./ui-confirm.js";
|
|
14
|
+
|
|
15
|
+
register("install", {
|
|
16
|
+
en: {
|
|
17
|
+
title: "Install as an app",
|
|
18
|
+
available: "Opens in its own window, from your Start menu, Dock or home screen.",
|
|
19
|
+
install: "Install",
|
|
20
|
+
short: "Install",
|
|
21
|
+
ios: "In Safari, tap Share, then Add to Home Screen.",
|
|
22
|
+
untrusted: "Can't be installed here: your browser doesn't trust this address's certificate. Ask your administrator for a trusted certificate, then open this page again.",
|
|
23
|
+
insecure: "Can't be installed from a plain http:// address. Open it through localhost or an https:// address.",
|
|
24
|
+
ok: "OK",
|
|
25
|
+
},
|
|
26
|
+
"zh-TW": {
|
|
27
|
+
title: "安裝成應用程式",
|
|
28
|
+
available: "在自己的視窗開啟,可從開始選單、Dock 或主畫面啟動。",
|
|
29
|
+
install: "安裝",
|
|
30
|
+
short: "安裝",
|
|
31
|
+
ios: "在 Safari 點「分享」,再點「加入主畫面」。",
|
|
32
|
+
untrusted: "這裡無法安裝:你的瀏覽器不信任這個網址的憑證。請管理員改用受信任的憑證後,再重新開啟這個頁面。",
|
|
33
|
+
insecure: "一般 http:// 網址無法安裝。請改用 localhost 或 https:// 網址開啟。",
|
|
34
|
+
ok: "知道了",
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
const ti = (k) => t(`install.${k}`);
|
|
38
|
+
|
|
39
|
+
/** "available" | "ios" | "untrusted" | "insecure" | "installed" | "none" (nothing to say). */
|
|
40
|
+
export const installStore = createStore({ state: "none" });
|
|
41
|
+
let offer = null;
|
|
42
|
+
/** The windows already started (the app's one, or a test's own fake). */
|
|
43
|
+
const started = new WeakSet();
|
|
44
|
+
|
|
45
|
+
const standalone = (env) => {
|
|
46
|
+
try { return env.matchMedia?.("(display-mode: standalone)")?.matches === true || env.navigator?.standalone === true; } catch { return false; }
|
|
47
|
+
};
|
|
48
|
+
/** Safari on iPhone/iPad (other iOS browsers can't add to the home screen in a way we can describe). */
|
|
49
|
+
const iosSafari = (env) => {
|
|
50
|
+
const ua = env.navigator?.userAgent || "";
|
|
51
|
+
const ios = /iPhone|iPad|iPod/.test(ua) || (/Macintosh/.test(ua) && (env.navigator?.maxTouchPoints || 0) > 1);
|
|
52
|
+
return ios && /Safari/.test(ua) && !/CriOS|FxiOS|EdgiOS/.test(ua);
|
|
53
|
+
};
|
|
54
|
+
const set = (state) => installStore.set({ state });
|
|
55
|
+
|
|
56
|
+
/** Once per page, from the app's start: listen for the offer, register the worker, decide what to say. */
|
|
57
|
+
export function startInstall(env = globalThis) {
|
|
58
|
+
if (started.has(env)) return;
|
|
59
|
+
started.add(env);
|
|
60
|
+
set("none");
|
|
61
|
+
if (standalone(env)) { set("installed"); return; }
|
|
62
|
+
env.addEventListener?.("beforeinstallprompt", (event) => { event.preventDefault(); offer = event; set("available"); });
|
|
63
|
+
env.addEventListener?.("appinstalled", () => { offer = null; set("installed"); });
|
|
64
|
+
// A plain-http address is not a secure context, and browsers hide the worker API there: say why before looking for it.
|
|
65
|
+
if (env.isSecureContext === false) { if (installStore.get().state === "none") set("insecure"); return; }
|
|
66
|
+
if (iosSafari(env)) set("ios");
|
|
67
|
+
const sw = env.navigator?.serviceWorker;
|
|
68
|
+
if (!sw) return;
|
|
69
|
+
sw.register("/sw.js", { scope: "/" }).catch((error) => {
|
|
70
|
+
// A certificate the browser doesn't trust: registration is refused as a SecurityError.
|
|
71
|
+
if (error && error.name === "SecurityError" && ["none", "ios"].includes(installStore.get().state)) set("untrusted");
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** The browser's own install dialog; afterwards the offer is spent (the browser may make a new one later). */
|
|
76
|
+
export async function promptInstall() {
|
|
77
|
+
const event = offer;
|
|
78
|
+
if (!event) return "none";
|
|
79
|
+
offer = null;
|
|
80
|
+
set("none");
|
|
81
|
+
try {
|
|
82
|
+
await event.prompt();
|
|
83
|
+
const choice = await event.userChoice;
|
|
84
|
+
if (choice?.outcome === "accepted") set("installed");
|
|
85
|
+
return choice?.outcome || "dismissed";
|
|
86
|
+
} catch { return "dismissed"; }
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const SAYS = new Set(["available", "ios", "untrusted", "insecure"]);
|
|
90
|
+
/** Whether there is anything to offer or say (a menu item or button shows only then). */
|
|
91
|
+
export const installOffered = (state) => SAYS.has(state);
|
|
92
|
+
export const installLabel = () => ti("title");
|
|
93
|
+
/** The one action, wherever it is offered: the browser's dialog where it can install; otherwise the reason, in a notice. */
|
|
94
|
+
export function runInstall(state = installStore.get().state) {
|
|
95
|
+
if (state === "available") { void promptInstall(); return; }
|
|
96
|
+
if (SAYS.has(state)) void confirmDialog({ title: ti("title"), message: ti(state), confirmLabel: ti("ok"), notice: true });
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** The Fleet's Needs you settings row, drawn like the notification row beside it. Nothing when there's nothing to say. */
|
|
100
|
+
export function InstallAppSection() {
|
|
101
|
+
const { state } = useStore(installStore);
|
|
102
|
+
if (!SAYS.has(state)) return null;
|
|
103
|
+
return html`<article class="n-notify n-install" data-install=${state}>
|
|
104
|
+
<span class="n-notify-icon"><${Icon} name="install" size=${18} /></span>
|
|
105
|
+
<div class="n-notify-body">
|
|
106
|
+
<div class="n-notify-title"><strong>${ti("title")}</strong></div>
|
|
107
|
+
<p class="n-notify-note note">${ti(state)}</p>
|
|
108
|
+
${state === "available" ? html`<div class="n-notify-actions"><button type="button" class="btn btn-sm btn-primary" onClick=${() => { void promptInstall(); }}>
|
|
109
|
+
<${Icon} name="install" size=${14} />${ti("install")}</button></div>` : null}
|
|
110
|
+
</div>
|
|
111
|
+
</article>`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** The Hub header's compact button: installs where it can, otherwise says how or why not. */
|
|
115
|
+
export function InstallAppButton() {
|
|
116
|
+
const { state } = useStore(installStore);
|
|
117
|
+
if (!SAYS.has(state)) return null;
|
|
118
|
+
// Its name and tooltip are what it does (the leader's capture check: a bare arrow by the bell read as "download notices").
|
|
119
|
+
const label = ti("title");
|
|
120
|
+
const click = () => runInstall(state);
|
|
121
|
+
return html`<button type="button" class="icon-btn hub-install" data-install=${state} aria-label=${label} title=${label} onClick=${click}>
|
|
122
|
+
<${Icon} name="install" size=${16} /><span class="hub-install-label" aria-hidden="true">${ti("short")}</span></button>`;
|
|
123
|
+
}
|
|
@@ -314,7 +314,8 @@ export function setTitle(text) { titleBase = text || ""; drawTitle(); }
|
|
|
314
314
|
const needsWeight = (i) => (i?.type === "contact" && i.reason === "contact_verify_needed" ? Math.max(1, Math.floor(Number(i.contactVerify?.count) || 1)) : 1);
|
|
315
315
|
const needsTotal = (needs) => needs.reduce((n, i) => n + needsWeight(i), 0);
|
|
316
316
|
appStore.subscribe((s) => {
|
|
317
|
-
|
|
317
|
+
// #4487 review P3: AgEnD's own update item (app-update.js keeps it in appStore) counts in the tab's title too.
|
|
318
|
+
const n = (Array.isArray(s.needs) ? needsTotal(s.needs) : 0) + (s.updateNeeds ? 1 : 0);
|
|
318
319
|
if (n !== titleCount) { titleCount = n; drawTitle(); }
|
|
319
320
|
});
|
|
320
321
|
|
|
@@ -573,7 +574,8 @@ register("phoneNav", {
|
|
|
573
574
|
export function needsCount(app) {
|
|
574
575
|
const needs = Array.isArray(app.needs) ? app.needs : [], proposals = Array.isArray(app.proposals) ? app.proposals : [];
|
|
575
576
|
const suggestions = needs.filter(i => i?.type === "contact" && i.reason === "contact_restricted_suggestion").length;
|
|
576
|
-
|
|
577
|
+
// #4487 review P2: AgEnD's own update item (app-update.js keeps it in appStore), counted once.
|
|
578
|
+
return needsTotal(needs) - suggestions + (suggestions ? 1 : 0) + proposals.length + (app.updateNeeds ? 1 : 0);
|
|
577
579
|
}
|
|
578
580
|
|
|
579
581
|
export function PanelHeader({ title, sub, children, headingRef, nav, notice, pageControls, pageActions, back = null }) {
|
|
@@ -864,6 +866,13 @@ function pendingSummaryLine(line, descriptor) {
|
|
|
864
866
|
}
|
|
865
867
|
return legacyPendingSummaryLine(line);
|
|
866
868
|
}
|
|
869
|
+
/** Presentation only: the server's canonical On summary identifies this irreversible consequence. */
|
|
870
|
+
function pendingRequestContextEnable(p) {
|
|
871
|
+
if (p.section !== "access" || !Array.isArray(p.summary) || !Array.isArray(p.summary_i18n) || p.summary.length !== p.summary_i18n.length) return false;
|
|
872
|
+
const keys = p.summary_i18n.flatMap((line, index) => line?.v === 1 && line.fallback === p.summary[index] && Array.isArray(line.parts)
|
|
873
|
+
? line.parts.filter(part => part && typeof part === "object" && Array.isArray(part.args) && part.args.length === 0).map(part => part.key) : []);
|
|
874
|
+
return keys.includes("requestContextControl.enableTitle") && keys.includes("requestContextControl.floorBefore");
|
|
875
|
+
}
|
|
867
876
|
export function PendingChanges({ inline = false } = {}) {
|
|
868
877
|
const { pendingChanges } = useStore(appStore);
|
|
869
878
|
const list = pendingChanges || [];
|
|
@@ -888,6 +897,7 @@ export function PendingChanges({ inline = false } = {}) {
|
|
|
888
897
|
${p.state === "pending" ? html`<span class="pending-left">${t("app.pendingLeft", mmss(p.deadline - NOW()))}</span>` : null}
|
|
889
898
|
${p.dismiss ? html`<button type="button" class="icon-btn" aria-label=${t("app.close")} title=${t("app.close")} onClick=${p.dismiss}><${Icon} name="close" size=${14} /></button>` : null}</div>
|
|
890
899
|
${p.label ? html`<div class="pending-label">${p.label}</div>` : null}
|
|
900
|
+
${pendingRequestContextEnable(p) ? html`<p class="notice warn">${t("pendingHost.requestContextFloor")}</p>` : null}
|
|
891
901
|
${Array.isArray(p.summary) && p.summary.length ? html`<details class="pending-details" open=${Array.isArray(p.summary_i18n)&&p.summary_i18n.some(line=>line?.v===1&&Array.isArray(line.parts)&&line.parts.some(part=>part&&typeof part==="object"&&part.key==="hub.exposure.summary.classicRoom"))}><summary>${t("pendingHost.details")}</summary><ul class="pending-summary">${p.summary.map((line, i) => html`<li key=${i}>${String(pendingSummaryLine(line, Array.isArray(p.summary_i18n) && p.summary_i18n.length === p.summary.length ? p.summary_i18n[i] : null)).replace(/\\([\\`*_~[\]()<>|])/g, "$1")}</li>`)}</ul></details>` : null}
|
|
892
902
|
${p.state === "pending" ? html`<${PendingHow} p=${p} />` : null}
|
|
893
903
|
${(p.state === "applying" || p.state === "applied") && p.confirmation && p.confirmation.kind === "web" ? html`<p class="note">${t("app.pendingWeb")}</p>` : null}
|
|
@@ -929,6 +939,7 @@ function whereText(where) {
|
|
|
929
939
|
// would let it through — never "type this command on the host". The host's command stays folded under Advanced, a last resort.
|
|
930
940
|
register("pendingHost", {
|
|
931
941
|
en: {
|
|
942
|
+
requestContextFloor: "Once on, AgEnD can't go back to an older version.",
|
|
932
943
|
no_chat: "This fleet has no chat app connected, so there is no General to send the confirm card to.",
|
|
933
944
|
no_chat_do: "To confirm from Discord or Telegram instead, connect one in Settings → Chat & connections.",
|
|
934
945
|
cross_platform: "This change affects chat apps on more than one platform, so no single General can confirm it.",
|
|
@@ -961,6 +972,7 @@ register("pendingHost", {
|
|
|
961
972
|
moreHost: "On the computer running AgEnD, open AgEnD in its own browser and press Apply now on this card.",
|
|
962
973
|
},
|
|
963
974
|
"zh-TW": {
|
|
975
|
+
requestContextFloor: "開啟後就不能再降回舊版 AgEnD。",
|
|
964
976
|
no_chat: "這個 Fleet 沒有連接聊天平台,所以沒有 General 可以接收確認卡。",
|
|
965
977
|
no_chat_do: "若要改從 Discord 或 Telegram 確認,請到「設定 → 聊天與連線」連接其中一個。",
|
|
966
978
|
cross_platform: "這項變更涉及多個聊天平台,沒有單一的 General 可以確認。",
|
|
@@ -1073,7 +1085,7 @@ function PendingHow({ p }) {
|
|
|
1073
1085
|
const mode = p.applyNow ? "apply" : p.confirmWithCode ? "code" : p.totpNotSetUp ? "setup" : p.onHost ? "link" : p.hostOnly ? "hostOnly" : "none";
|
|
1074
1086
|
if (!cli && (mode === "none" || mode === "apply")) {
|
|
1075
1087
|
const lead = c.kind === "posting" ? t("app.pendingPosting") : t("app.pendingChatWhere", whereText(c.where));
|
|
1076
|
-
return html`<p class="note">${lead}</p
|
|
1088
|
+
return html`${!p.applyNow ? html`<p class="note">${lead}</p>` : null}
|
|
1077
1089
|
${p.applyNow ? html`<div class="pending-self"><span class="note">${t("app.pendingSelf")}</span>
|
|
1078
1090
|
<button type="button" class="btn btn-sm btn-primary" onClick=${apply}>${t("app.pendingApplyNow")}</button></div>` : null}
|
|
1079
1091
|
${refused && !p.applyNow ? html`<p class="note" role="status">${t("app.pendingApplyRefused")}</p>` : null}
|
|
@@ -1182,7 +1194,7 @@ export function retryable(load) {
|
|
|
1182
1194
|
}
|
|
1183
1195
|
|
|
1184
1196
|
/** Shows the panel for the route, loading its module the first time; Retry is a real new attempt. */
|
|
1185
|
-
export function Outlet({ route, seq, panels }) {
|
|
1197
|
+
export function Outlet({ route, seq, panels, loading = null }) {
|
|
1186
1198
|
const [attempt, setAttempt] = useState(0);
|
|
1187
1199
|
const [, force] = useState(0);
|
|
1188
1200
|
const entry = route ? panels.get(route.panel) : null;
|
|
@@ -1202,7 +1214,7 @@ export function Outlet({ route, seq, panels }) {
|
|
|
1202
1214
|
// #3822: a panel that would not link (this tab is older than AgEnD) needs a reload, not a Retry that loads the same old copy.
|
|
1203
1215
|
if (entry && entry.error && !entry.loading) return html`<div class="panel">${isStaleModuleError(entry.error) ? html`<${StaleTabPrompt} />`
|
|
1204
1216
|
: html`<${ErrorState} onRetry=${() => setAttempt(n => n + 1)} />`}</div>`;
|
|
1205
|
-
if (!entry || !entry.Component) return html`<div class="panel"><${Skeleton} lines=${4} /></div>`;
|
|
1217
|
+
if (!entry || !entry.Component) return loading ?? html`<div class="panel"><${Skeleton} lines=${4} /></div>`;
|
|
1206
1218
|
const C = entry.Component;
|
|
1207
1219
|
return html`<${C} route=${route} navKey=${`${routeKey(route)}|${seq}|${lang()}`} />`;
|
|
1208
1220
|
}
|
|
@@ -164,6 +164,7 @@ export function createStream(opts) {
|
|
|
164
164
|
if (Array.isArray(d.reply_buttons)) for (const u of d.reply_buttons) emit("reply_buttons", u); // #1266
|
|
165
165
|
if (Array.isArray(d.reactions)) for (const u of d.reactions) emit("reactions", u); // #2305
|
|
166
166
|
if (Array.isArray(d.needs)) emit("needs", { items: d.needs });
|
|
167
|
+
if (Object.hasOwn(d, "requestContextCutover")) emit("request-context-control", d.requestContextCutover);
|
|
167
168
|
return true;
|
|
168
169
|
} catch { return false; /* the next tick, or the catch-up's retry, tries again */ }
|
|
169
170
|
})();
|
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
// An older server (no /ui/update) answers 404: nothing is shown.
|
|
6
6
|
import { html, useEffect, useState } from "./app-html.js";
|
|
7
7
|
import { register, t } from "./app-i18n.js";
|
|
8
|
-
import { createStore, useStore } from "./app-store.js";
|
|
8
|
+
import { appStore, createStore, useStore } from "./app-store.js";
|
|
9
9
|
import { confirmDialog } from "./ui-confirm.js";
|
|
10
10
|
import { Dialog } from "./ui-dialog.js";
|
|
11
11
|
import { Icon } from "./ui-icons.js";
|
|
12
12
|
import { toast } from "./ui-toast.js";
|
|
13
|
+
// M-3770 1.4: the one update card (a module of its own: the module-skew rule).
|
|
14
|
+
import { PickTimeHost, cardLine, updateAttention } from "./update-card-ui.js";
|
|
15
|
+
import { navStore } from "./app-nav.js";
|
|
13
16
|
|
|
14
17
|
register("update", {
|
|
15
18
|
en: {
|
|
@@ -71,6 +74,9 @@ const LATER_HUB_KEY = "agend_update_later_hub", LATER_HUB_MS = 24 * 60 * 60 * 10
|
|
|
71
74
|
*/
|
|
72
75
|
export const updateStore = createStore({ info: null, loadedVersion: null, skew: 0, starting: false, later: remembered(LATER_KEY),
|
|
73
76
|
dismissed: remembered(DISMISSED_KEY), reloadDismissed: null, log: null, laterHub: remembered(LATER_HUB_KEY) });
|
|
77
|
+
// #4487 review P2: AgEnD's own update item (a failure, or can't update here) counts in Needs you like any other — its badge,
|
|
78
|
+
// the tab's and the page's count and empty state read it from appStore (app-shell.js needsCount; panel-needs.js).
|
|
79
|
+
updateStore.subscribe((st) => { const n = updateAttention(st && st.info) ? 1 : 0; if ((appStore.get().updateNeeds || 0) !== n) appStore.set({ updateNeeds: n }); });
|
|
74
80
|
|
|
75
81
|
/** Semver "a > b" (major.minor.patch, then a release over its prereleases, then prerelease identifiers) — the server's rule. */
|
|
76
82
|
export function newerVersion(a, b) {
|
|
@@ -251,6 +257,7 @@ function LogDialog() {
|
|
|
251
257
|
export function UpdateLine() {
|
|
252
258
|
usePolling();
|
|
253
259
|
const s = useStore(updateStore);
|
|
260
|
+
const nav = useStore(navStore);
|
|
254
261
|
const [, tick] = useState(0);
|
|
255
262
|
const info = s.info;
|
|
256
263
|
const active = updateActive(info);
|
|
@@ -287,11 +294,19 @@ export function UpdateLine() {
|
|
|
287
294
|
line = html`<${Line} title=${t("update.hubAvailable", rec.hubName, rec.version, info.current)} sub=${[t("update.hubSub")]}>
|
|
288
295
|
<button type="button" class="btn btn-sm btn-primary" disabled=${s.starting} onClick=${() => { void openHubUpdateDialog(); }}>${t("update.now")}</button>
|
|
289
296
|
<button type="button" class="btn btn-sm" onClick=${() => { const v = `${rec.hubId}:${rec.revision}@${Date.now()}`; remember(LATER_HUB_KEY, v); updateStore.set({ laterHub: v }); }}>${t("update.later")}</button></${Line}>`;
|
|
297
|
+
} else if (info.card !== undefined) {
|
|
298
|
+
// M-3770 1.4: a server with the update card — its line (offered, waiting for idle, scheduled, can't), never the
|
|
299
|
+
// per-browser Later below (Not now is the server's, for the whole fleet).
|
|
300
|
+
// The leader (S-237): Settings has the card's own controls; the top line would say it twice there.
|
|
301
|
+
line = nav.route && nav.route.panel === "settings" ? null : cardLine(info, { Line, busy: s.starting, deps: cardDeps });
|
|
290
302
|
} else if (info.offer && info.offer.installable && s.later !== info.offer.version && !hubNeed(info)) {
|
|
291
303
|
const o = info.offer;
|
|
292
304
|
line = html`<${Line} title=${t("update.available", o.version, info.current)} sub=${[t("update.availableSub", channelWord(o.channel))]}>
|
|
293
305
|
<button type="button" class="btn btn-sm btn-primary" disabled=${s.starting} onClick=${openUpdateDialog}>${t("update.now")}</button>
|
|
294
306
|
<button type="button" class="btn btn-sm" onClick=${() => { remember(LATER_KEY, o.version); updateStore.set({ later: o.version }); }}>${t("update.later")}</button></${Line}>`;
|
|
295
307
|
}
|
|
296
|
-
return html`${line}<${LogDialog} />`;
|
|
308
|
+
return html`${line}<${LogDialog} /><${PickTimeHost} />`;
|
|
297
309
|
}
|
|
310
|
+
/** M-3770 1.4: what update-card-ui.js needs from this module, passed in (it never imports this one). */
|
|
311
|
+
export const cardDeps = { refresh: () => refreshUpdate(), setInfo: (info) => updateStore.set({ info }), getInfo: () => updateStore.get().info,
|
|
312
|
+
setStarting: (starting) => updateStore.set({ starting }) };
|