@songsid/agend 2.4.0-beta.26 → 2.4.0-beta.28
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 +2 -1
- package/dist/agent-cli.js +6 -0
- package/dist/agent-cli.js.map +1 -1
- 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-whats-new.js +4 -0
- package/dist/agent-whats-new.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/claude-turn-boundaries.d.ts +15 -0
- package/dist/claude-turn-boundaries.js +88 -0
- package/dist/claude-turn-boundaries.js.map +1 -0
- package/dist/cli.js +35 -2
- package/dist/cli.js.map +1 -1
- package/dist/contact-auth-service.js +3 -0
- package/dist/contact-auth-service.js.map +1 -1
- package/dist/contact-auth-store.d.ts +16 -0
- package/dist/contact-auth-store.js +61 -1
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/daemon.d.ts +76 -4
- package/dist/daemon.js +621 -115
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +145 -7
- package/dist/delivery-outbox.js +373 -8
- 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 +5 -0
- package/dist/fleet-lock.js +21 -2
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +499 -5
- package/dist/fleet-manager.js +2917 -217
- 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/concepts/SKILL.md +5 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +5 -1
- package/dist/general-knowledge/skills/task-board/SKILL.md +14 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +96 -26
- 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 +9 -2
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.js +8 -1
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.js +4 -2
- 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/http/compose.js +57 -30
- package/dist/hub/http/compose.js.map +1 -1
- 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.js +2 -0
- 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/protocol.d.ts +58 -0
- package/dist/hub/protocol.js +3 -2
- 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/clock.d.ts +1 -1
- package/dist/hub/roles/clock.js +9 -7
- package/dist/hub/roles/clock.js.map +1 -1
- package/dist/hub/roles/read.d.ts +4 -0
- package/dist/hub/roles/read.js +37 -7
- package/dist/hub/roles/read.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/rooms/agents.d.ts +1 -1
- package/dist/hub/rooms/agents.js +3 -2
- 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 +35 -19
- package/dist/hub/rooms/service.js +105 -26
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/server.js +10 -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 +14 -7
- package/dist/hub/settings-directory-decision.js.map +1 -1
- package/dist/hub/settings-member-address-decision.js +3 -2
- 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 +5 -0
- package/dist/hub/store.js +28 -5
- package/dist/hub/store.js.map +1 -1
- package/dist/hub/types.d.ts +2 -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 +68 -4
- 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 +8 -0
- package/dist/outbound-schemas.js +6 -2
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +3 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/recover.cjs +1 -0
- 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-context-activation.d.ts +29 -0
- package/dist/request-context-activation.js +85 -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 +3 -0
- package/dist/request-context-call.js.map +1 -1
- package/dist/request-context-compatibility.js +10 -2
- package/dist/request-context-compatibility.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 +119 -0
- package/dist/request-context-control-api.js +179 -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-projection.d.ts +8 -0
- package/dist/request-context-drain-projection.js +40 -0
- package/dist/request-context-drain-projection.js.map +1 -0
- package/dist/request-context-drain.d.ts +22 -0
- package/dist/request-context-drain.js +139 -7
- 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 +112 -0
- package/dist/request-context-human.js +176 -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-migration.d.ts +11 -0
- package/dist/request-context-migration.js +16 -3
- package/dist/request-context-migration.js.map +1 -1
- 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-reply-pending.d.ts +16 -0
- package/dist/request-context-reply-pending.js +77 -0
- package/dist/request-context-reply-pending.js.map +1 -0
- package/dist/request-context-resolution.d.ts +35 -0
- package/dist/request-context-resolution.js +86 -0
- package/dist/request-context-resolution.js.map +1 -0
- package/dist/request-context-retirement.d.ts +21 -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/db.js +9 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/task-board-text.d.ts +3 -6
- package/dist/scheduler/task-board-text.js +15 -10
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board-unread.d.ts +90 -0
- package/dist/scheduler/task-board-unread.js +192 -0
- package/dist/scheduler/task-board-unread.js.map +1 -0
- package/dist/scheduler/task-board.d.ts +324 -6
- package/dist/scheduler/task-board.js +786 -47
- package/dist/scheduler/task-board.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 +4 -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-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 +59 -1
- 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/task-board-tool.js +24 -3
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-board-waker.d.ts +53 -2
- package/dist/task-board-waker.js +183 -12
- package/dist/task-board-waker.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/transcript-monitor.d.ts +6 -1
- package/dist/transcript-monitor.js +59 -4
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-turns.d.ts +3 -0
- package/dist/transcript-turns.js +5 -0
- package/dist/transcript-turns.js.map +1 -1
- 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 +6 -6
- 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 +25 -8
- package/dist/ui/contact-tool-groups.js +1 -1
- package/dist/ui/fleet-task-activity.js +164 -24
- package/dist/ui/fleet-task-card.js +77 -13
- package/dist/ui/fleet-task-common.js +14 -0
- package/dist/ui/fleet-task-flow.js +353 -0
- package/dist/ui/fleet-task-md.js +1 -1
- package/dist/ui/fleet-task-run.js +98 -22
- package/dist/ui/fleet-task-thread.js +245 -0
- package/dist/ui/fleet-task-unread.js +100 -0
- package/dist/ui/fleet-task-view.js +6 -5
- package/dist/ui/fleet-task-wake.js +140 -0
- package/dist/ui/fleet-tasks.js +13 -6
- package/dist/ui/hub-client.js +3 -0
- package/dist/ui/hub-room-members.js +4 -2
- package/dist/ui/hub-room-settings-strings.js +8 -0
- package/dist/ui/hub-room-settings.js +32 -0
- package/dist/ui/hub-room-thread.js +7 -1
- 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 +14 -3
- package/dist/ui/panel-needs.js +2 -1
- package/dist/ui/panel-settings.js +2 -1
- package/dist/ui/panel-windows-cli.js +2 -2
- 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 +209 -0
- package/dist/ui/settings-registry.js +2 -0
- package/dist/ui/settings-update.js +3 -2
- package/dist/ui/shared/access-overview.css +1 -1
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-install.js +2 -2
- package/dist/ui/shared/app-shell.js +17 -4
- package/dist/ui/shared/app-stream.js +4 -1
- package/dist/ui/shared/app-update.js +2 -1
- package/dist/ui/shared/app.css +101 -10
- package/dist/ui/shared/app.js +19 -2
- package/dist/ui/shared/task-board.css +164 -0
- package/dist/ui/shared/ui-icons.js +3 -0
- package/dist/ui/shared/ui-states.js +6 -0
- package/dist/ui/shared/update-card-ui.js +178 -11
- package/dist/ui/shared/view-strings.js +18 -0
- package/dist/ui/shared/web-authorize.js +1 -1
- package/dist/ui/task-unread.js +70 -0
- package/dist/ui/windows-cli-catalog.js +33 -6
- 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-goback.js +15 -3
- package/dist/update-goback.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-snapshot-scope.js +1 -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 +49 -1
- package/dist/web-api.js +234 -13
- 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 +9 -3
- package/dist/web-icons.js +62 -5
- package/dist/web-icons.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-api.js +4 -2
- package/dist/windows-cli-api.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 +55 -1
- package/dist/windows-cli.js +147 -17
- package/dist/windows-cli.js.map +1 -1
- package/dist/windows-shortcuts.d.ts +3 -22
- package/dist/windows-shortcuts.js +5 -45
- package/dist/windows-shortcuts.js.map +1 -1
- package/dist/workflow-templates/default.md +3 -2
- package/dist/wsl-host.d.ts +52 -0
- package/dist/wsl-host.js +97 -0
- package/dist/wsl-host.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { HUB_ROOM_HISTORY_CAPABILITY, ROOM_HISTORY_BYTES, ROOM_HISTORY_NOTE, roomHistorySchema } from "../room-history-model.js";
|
|
2
|
+
import { spendRoomHistory, historyBinding, historyCursor, readHistoryCursor } from "./history.js";
|
|
3
|
+
import { boundedRoomText } from "./context.js";
|
|
1
4
|
import { HUB_ROOM_MEMBERS_CAPABILITY } from "../room-members-model.js";
|
|
2
5
|
import { pageRoomMembers } from "./members-page.js";
|
|
3
6
|
import { normalizeRoomPurpose } from "./purpose.js";
|
|
@@ -85,7 +88,7 @@ export function validRoomEmoji(s) {
|
|
|
85
88
|
return false;
|
|
86
89
|
return [...new Intl.Segmenter("en", { granularity: "grapheme" }).segment(s)].length === 1;
|
|
87
90
|
}
|
|
88
|
-
const patchSchema = z.strictObject({ name: label.optional(), purpose: purpose.optional(), allMention: z.boolean().optional(), historyForNew: z.enum(["since-join", "all"]).optional(), archived: z.boolean().optional(), assistant: z.boolean().optional(),
|
|
91
|
+
const patchSchema = z.strictObject({ name: label.optional(), purpose: purpose.optional(), allMention: z.boolean().optional(), membersCanAddOwnAgents: z.boolean().optional(), historyForNew: z.enum(["since-join", "all"]).optional(), archived: z.boolean().optional(), assistant: z.boolean().optional(),
|
|
89
92
|
office: z.strictObject({ enabled: z.boolean().optional(), style: z.enum(ROOM_OFFICE_STYLES).optional() }).optional() });
|
|
90
93
|
export class HubRoomRefusal extends Error {
|
|
91
94
|
status;
|
|
@@ -283,34 +286,37 @@ export class HubGroupRooms {
|
|
|
283
286
|
return db.prepare("SELECT display_name FROM hub_people WHERE person=? UNION ALL SELECT display_name FROM hub_room_people WHERE person=? LIMIT 1").get(person, person)?.display_name ?? person;
|
|
284
287
|
}
|
|
285
288
|
maximum(db, id) { return db.prepare("SELECT COALESCE(MAX(sequence),0) AS n FROM hub_room_posts WHERE room_id=?").get(id).n; }
|
|
286
|
-
projection(row) {
|
|
289
|
+
projection(row, batchDb) {
|
|
290
|
+
// A history page already owns a synchronous, fenced transaction. Reuse its
|
|
291
|
+
// database for projection; nested atomic calls would reparse mount state per row.
|
|
292
|
+
const read = (work) => batchDb ? work(batchDb) : this.core.atomic(work);
|
|
287
293
|
let system = row.author_kind === "system" && ["room-created", "member-joined", "admin-joined", "poll-closed", "app-rate-limited"].includes(row.author_id)
|
|
288
294
|
? { kind: row.author_id, name: row.author_name } : undefined;
|
|
289
295
|
if (row.author_kind === "system" && row.author_id === "purpose-changed") {
|
|
290
|
-
const event =
|
|
296
|
+
const event = read(db => db.prepare("SELECT purpose FROM hub_room_purpose_events WHERE post_id=?").get(row.id));
|
|
291
297
|
if (event)
|
|
292
298
|
system = { kind: "purpose-changed", name: row.author_name, purpose: event.purpose };
|
|
293
299
|
}
|
|
294
300
|
if (row.author_kind === "system" && row.author_id === "office-style-changed") {
|
|
295
|
-
const event =
|
|
301
|
+
const event = read(db => db.prepare("SELECT style FROM hub_room_office_style_events WHERE post_id=?").get(row.id));
|
|
296
302
|
if (event)
|
|
297
303
|
system = { kind: "office-style-changed", name: row.author_name, style: event.style };
|
|
298
304
|
}
|
|
299
305
|
if (row.author_kind === "system" && row.author_id === "office-changed") {
|
|
300
|
-
const event =
|
|
306
|
+
const event = read(db => db.prepare("SELECT enabled FROM hub_room_office_events WHERE post_id=?").get(row.id));
|
|
301
307
|
if (event)
|
|
302
308
|
system = { kind: "office-changed", name: row.author_name, enabled: event.enabled === 1 };
|
|
303
309
|
}
|
|
304
310
|
// Agent rows retain their owner-at-message in author_subject; a later exposure transfer must not relabel history.
|
|
305
|
-
const agent = row.author_kind === "agent" ?
|
|
311
|
+
const agent = row.author_kind === "agent" ? read(db => {
|
|
306
312
|
const e = readExposure(db, row.author_id);
|
|
307
313
|
return { owner: { name: this.name(db, row.author_subject) }, ...(e ? { agentKind: e.source_kind === "personal" ? "personal" : "fleet" } : {}) };
|
|
308
314
|
}) : undefined;
|
|
309
|
-
return { id: row.id, roomId: row.room_id, at: row.created_at, sequence: row.sequence, author: { kind: row.author_kind, id: row.author_id, name: row.author_name, ...agent, ...this.viaAuthor(row) },
|
|
310
|
-
...(system ? { system } : {}), ...this.agentMetadata(row), text: this.core.deps.content.get(row.content_ref)?.question ?? "", mentions: JSON.parse(row.mentions),
|
|
315
|
+
return { id: row.id, roomId: row.room_id, at: row.created_at, sequence: row.sequence, author: { kind: row.author_kind, id: row.author_id, name: row.author_name, ...agent, ...this.viaAuthor(row, batchDb) },
|
|
316
|
+
...(system ? { system } : {}), ...this.agentMetadata(row, batchDb), text: this.core.deps.content.get(row.content_ref)?.question ?? "", mentions: JSON.parse(row.mentions),
|
|
311
317
|
...(row.reply_to ? { replyTo: row.reply_to } : {}), ...(row.idempotency_key ? { idempotencyKey: row.idempotency_key } : {}),
|
|
312
|
-
...(row.stage ? { stage: row.stage } : {}), ...(row.answer_to ? { answerTo: row.answer_to } : {}), ...this.filesOf(row),
|
|
313
|
-
...
|
|
318
|
+
...(row.stage ? { stage: row.stage } : {}), ...(row.answer_to ? { answerTo: row.answer_to } : {}), ...this.filesOf(row, batchDb),
|
|
319
|
+
...read(db => {
|
|
314
320
|
const a = this.agents.progress(db, row.id), b = this.assistant.progress(db, row.id);
|
|
315
321
|
const total = (a?.total ?? 0) + (b?.total ?? 0), failed = (a?.failed ?? 0) + (b?.failed ?? 0), blocked = (a?.blocked ?? 0) + (b?.blocked ?? 0);
|
|
316
322
|
const ask = a || b ? { total, answered: (a?.answered ?? 0) + (b?.answered ?? 0), working: (a?.working ?? 0) + (b?.working ?? 0), later: (a?.later ?? 0) + (b?.later ?? 0),
|
|
@@ -342,15 +348,17 @@ export class HubGroupRooms {
|
|
|
342
348
|
store() { const s = this.filesStore(); if (!s)
|
|
343
349
|
throw new HubProtocolError("incompatible"); return s; }
|
|
344
350
|
/** M-3125: a post's files, in order (none when the Hub has no attachment store). */
|
|
345
|
-
filesOf(row) {
|
|
351
|
+
filesOf(row, batchDb) {
|
|
346
352
|
const store = this.filesStore();
|
|
347
353
|
if (!store)
|
|
348
354
|
return {};
|
|
349
|
-
const
|
|
355
|
+
const read = (work) => batchDb ? work(batchDb) : this.core.atomic(work);
|
|
356
|
+
const refs = read(db => [...store.forMessage(db, row.id, "question"), ...store.forMessage(db, row.id, "answer")]);
|
|
350
357
|
return refs.length ? { files: refs.map(r => groupFileView(row.room_id, r)) } : {};
|
|
351
358
|
}
|
|
352
|
-
viaAuthor(row) {
|
|
353
|
-
|
|
359
|
+
viaAuthor(row, batchDb) {
|
|
360
|
+
const read = (work) => batchDb ? work(batchDb) : this.core.atomic(work);
|
|
361
|
+
return read(db => {
|
|
354
362
|
const app = this.appPosts ? db.prepare("SELECT app_id,app_name FROM hub_mcp_room_posts WHERE post_id=?").get(row.id) : undefined;
|
|
355
363
|
if (app)
|
|
356
364
|
return { via: { id: app.app_id, name: app.app_name, kind: "app" } };
|
|
@@ -358,8 +366,9 @@ export class HubGroupRooms {
|
|
|
358
366
|
return op ? { name: op.person_name, via: { id: op.exposure_id, name: op.via_name, kind: "agent" } } : {};
|
|
359
367
|
});
|
|
360
368
|
}
|
|
361
|
-
agentMetadata(row) {
|
|
362
|
-
|
|
369
|
+
agentMetadata(row, batchDb) {
|
|
370
|
+
const read = (work) => batchDb ? work(batchDb) : this.core.atomic(work);
|
|
371
|
+
return read(db => {
|
|
363
372
|
const stop = db.prepare("SELECT source_id,reason,name,retry_at FROM hub_room_agent_stops WHERE post_id=?").get(row.id);
|
|
364
373
|
if (stop)
|
|
365
374
|
return { system: { kind: "agent-mention-stopped", reason: stop.reason, name: stop.name, sourceId: stop.source_id, ...(stop.retry_at !== null ? { retryAt: stop.retry_at } : {}) } };
|
|
@@ -486,6 +495,52 @@ export class HubGroupRooms {
|
|
|
486
495
|
throw new HubProtocolError("backpressure");
|
|
487
496
|
this.agentReadBuckets.set(owner, { at: b?.at ?? at, count: (b?.count ?? 0) + 1 });
|
|
488
497
|
}
|
|
498
|
+
async agentHistory(input, link) {
|
|
499
|
+
const body = validated(roomHistorySchema, input);
|
|
500
|
+
if (!link.features.has(HUB_ROOM_HISTORY_CAPABILITY))
|
|
501
|
+
throw new HubProtocolError("incompatible");
|
|
502
|
+
const { source, fence } = await this.agentSource(body.exposureId, link);
|
|
503
|
+
return this.core.atomic(db => {
|
|
504
|
+
this.agentRead(source.owner);
|
|
505
|
+
const rooms = db.prepare(`SELECT r.id,m.id AS member,m.joined_sequence AS floor FROM hub_room_members m JOIN hub_group_rooms r ON r.id=m.room_id
|
|
506
|
+
WHERE m.kind='agent' AND m.subject=? AND m.owner_at_join=? AND r.assistant_for IS NULL AND (r.id=? OR r.name=?) ORDER BY r.id LIMIT 2`).all(source.id, source.owner, body.room, body.room);
|
|
507
|
+
const room = rooms.find(r => r.id === body.room) ?? (rooms.length === 1 ? rooms[0] : undefined);
|
|
508
|
+
if (!room)
|
|
509
|
+
return { ok: false, code: "not-found" };
|
|
510
|
+
const binding = historyBinding(source.id, source.owner, room.id, room.member, room.floor);
|
|
511
|
+
// Exactly the member floor and inherited audience boundary, including the original question of an answer.
|
|
512
|
+
const visible = `room_id=? AND sequence>=? AND COALESCE((SELECT audience_sequence FROM hub_room_post_lineage l WHERE l.post_id=hub_room_posts.id),sequence)>=?
|
|
513
|
+
AND (answer_to IS NULL OR EXISTS(SELECT 1 FROM hub_room_posts original WHERE original.id=hub_room_posts.answer_to AND original.room_id=hub_room_posts.room_id AND original.sequence>=?))`;
|
|
514
|
+
let until = Number.MAX_SAFE_INTEGER;
|
|
515
|
+
if (body.cursor) {
|
|
516
|
+
const id = readHistoryCursor(body.cursor, binding);
|
|
517
|
+
if (!id)
|
|
518
|
+
return { ok: false, code: "stale" };
|
|
519
|
+
const row = db.prepare(`SELECT sequence FROM hub_room_posts WHERE id=? AND ${visible}`).get(id, room.id, room.floor, room.floor, room.floor);
|
|
520
|
+
if (!row)
|
|
521
|
+
return { ok: false, code: "stale" };
|
|
522
|
+
until = row.sequence;
|
|
523
|
+
}
|
|
524
|
+
if (!spendRoomHistory(db, source.id, this.core.now()))
|
|
525
|
+
return { ok: false, code: "rate-limited", retryAt: (Math.floor(this.core.now() / 3600_000) + 1) * 3600_000 };
|
|
526
|
+
const rows = db.prepare(`SELECT * FROM hub_room_posts WHERE ${visible} AND sequence<? AND (stage IS NULL OR stage='answered')
|
|
527
|
+
AND NOT EXISTS(SELECT 1 FROM hub_room_deliveries d WHERE d.id=hub_room_posts.delivery_id AND d.state='answered' AND d.reason_code='acknowledged-by-reaction' AND d.answer_id IS NULL)
|
|
528
|
+
ORDER BY sequence DESC LIMIT ?`).all(room.id, room.floor, room.floor, room.floor, until, (body.limit ?? 20) + 1);
|
|
529
|
+
const messages = [];
|
|
530
|
+
const result = () => ({ ok: true, roomId: room.id, note: ROOM_HISTORY_NOTE, messages: [...messages].reverse(),
|
|
531
|
+
...(messages.length < rows.length && messages.length ? { next_cursor: historyCursor(binding, messages[messages.length - 1].id) } : {}) });
|
|
532
|
+
for (const row of rows.slice(0, body.limit ?? 20)) {
|
|
533
|
+
const raw = this.core.deps.content.get(row.content_ref)?.question ?? "", text = boundedRoomText(raw, 2048);
|
|
534
|
+
const by = this.viaAuthor(row);
|
|
535
|
+
messages.push({ id: row.id, sequence: row.sequence, at: row.created_at, author: { kind: row.author_kind, name: boundedRoomText(by.name ?? row.author_name, 256), ...(by.via ? { via: { kind: by.via.kind, name: boundedRoomText(by.via.name, 256) } } : {}) }, text, ...(text !== raw ? { truncated: true } : {}) });
|
|
536
|
+
if (Buffer.byteLength(JSON.stringify(result())) > ROOM_HISTORY_BYTES) {
|
|
537
|
+
messages.pop();
|
|
538
|
+
break;
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
return result();
|
|
542
|
+
}, fence);
|
|
543
|
+
}
|
|
489
544
|
async agentMembers(input, link) {
|
|
490
545
|
const body = validated(roomMembersSchema, input);
|
|
491
546
|
if (body.v2 && !link.features.has(HUB_ROOM_MEMBERS_CAPABILITY))
|
|
@@ -667,7 +722,7 @@ export class HubGroupRooms {
|
|
|
667
722
|
AND (p.author_kind<>'person' OR p.author_subject<>?) AND j.value IN (?,?) LIMIT 1`).get(room.id, floor, floor, member.read_sequence, member.subject, member.id, member.subject);
|
|
668
723
|
const online = db.prepare(`SELECT COUNT(*) AS n FROM hub_room_members m WHERE m.room_id=? AND m.kind='person' AND EXISTS
|
|
669
724
|
(SELECT 1 FROM hub_sessions s WHERE s.person=m.subject AND s.state='active' AND s.expires_at>?)`).get(room.id, this.core.now()).n;
|
|
670
|
-
const projected = last ? this.projection(last) : undefined;
|
|
725
|
+
const projected = last ? this.projection(last, db) : undefined;
|
|
671
726
|
const summary = { id: room.id, kind: "group", name: room.name, purpose: room.purpose ?? "", people: counts.find(c => c.kind === "person")?.n ?? 0,
|
|
672
727
|
agents: counts.find(c => c.kind === "agent")?.n ?? 0, online, unread, lastAt: last?.created_at ?? room.created_at,
|
|
673
728
|
lastText: projected?.text.slice(0, 240) ?? "", ...(projected?.system ? { lastSystem: projected.system } : {}), lastAuthor: last?.author_name ?? "", mentioned, archived: room.archived === 1 };
|
|
@@ -893,9 +948,10 @@ export class HubGroupRooms {
|
|
|
893
948
|
const own = this.member(db, id, me), room = this.room(db, id);
|
|
894
949
|
// M-3533 R2a: each shared agent's look (its owner's catalog colour and emoji), each Fleet's catalog read once.
|
|
895
950
|
const catalogs = new Map();
|
|
951
|
+
const transportState = this.core.deps.store.read();
|
|
896
952
|
const lookOf = (fleetId, exposureId) => {
|
|
897
953
|
if (!catalogs.has(fleetId))
|
|
898
|
-
catalogs.set(fleetId, this.looks ? this.looks(fleetId) : null);
|
|
954
|
+
catalogs.set(fleetId, this.looks ? this.looks(fleetId, db, transportState) : null);
|
|
899
955
|
return catalogs.get(fleetId)?.get(exposureId) ?? null;
|
|
900
956
|
};
|
|
901
957
|
const members = db.prepare("SELECT * FROM hub_room_members WHERE room_id=? ORDER BY kind,id").all(id).map(m => {
|
|
@@ -905,7 +961,7 @@ export class HubGroupRooms {
|
|
|
905
961
|
const e = readExposure(db, m.subject), look = memberLook(e?.fleet_id ? lookOf(e.fleet_id, m.subject) : null);
|
|
906
962
|
return { id: m.subject, kind: m.kind, name: e?.display_name ?? m.subject, ...(look ? { look } : {}), ...agentIntro(db, m.subject), role: m.role,
|
|
907
963
|
...(e ? { agentKind: e.source_kind === "personal" ? "personal" : "fleet" } : {}),
|
|
908
|
-
...(e?.answer_only === 1 ? { answerOnly: true } : {}), owner: { name: this.name(db, m.owner_at_join ?? ""), ...(m.owner_at_join ? { id: m.owner_at_join } : {}), ...(m.owner_at_join === me ? { mine: true } : {}) }, ...this.agents.presence(m.subject), canAsk: canAsk.has(m.subject) };
|
|
964
|
+
...(e?.answer_only === 1 ? { answerOnly: true } : {}), owner: { name: this.name(db, m.owner_at_join ?? ""), ...(m.owner_at_join ? { id: m.owner_at_join } : {}), ...(m.owner_at_join === me ? { mine: true } : {}) }, ...this.agents.presence(m.subject, db), canAsk: canAsk.has(m.subject) };
|
|
909
965
|
}
|
|
910
966
|
return { id: m.id, kind: m.kind, name: this.name(db, m.subject), role: m.role,
|
|
911
967
|
signedIn: !!db.prepare("SELECT 1 FROM hub_people WHERE person=?").get(m.subject),
|
|
@@ -913,7 +969,7 @@ export class HubGroupRooms {
|
|
|
913
969
|
});
|
|
914
970
|
// M-3125: the room takes people's files when this Hub stores files (the 1:1 chat's own attachments-v1 mark).
|
|
915
971
|
return { room: { ...this.summary(db, room, own), ...(this.filesStore() ? { features: ["attachments-v1"] } : {}) }, me: { id: own.id, role: own.role }, members,
|
|
916
|
-
settings: { allMention: room.all_mention === 1, historyForNew: room.history_for_new,
|
|
972
|
+
settings: { allMention: room.all_mention === 1, membersCanAddOwnAgents: room.members_add_own_agents === 1, historyForNew: room.history_for_new,
|
|
917
973
|
...(this.appPosts ? { aiApps: db.prepare("SELECT enabled FROM hub_mcp_room_policy WHERE room_id=?").get(id)?.enabled !== 0 } : {}),
|
|
918
974
|
...(members.some(m => m.kind === "assistant") ? { assistant: true } : {}),
|
|
919
975
|
...(this.office ? { office: { enabled: officeOn(room.office_enabled), style: room.office_style } } : {}) }, invited: [] };
|
|
@@ -935,8 +991,8 @@ export class HubGroupRooms {
|
|
|
935
991
|
db.prepare("DELETE FROM hub_room_members WHERE room_id=? AND kind='assistant'").run(id);
|
|
936
992
|
const was = officeOn(row.office_enabled), office = body.office?.enabled === undefined ? row.office_enabled : Number(body.office.enabled);
|
|
937
993
|
const style = body.office?.style ?? row.office_style;
|
|
938
|
-
db.prepare("UPDATE hub_group_rooms SET name=?,purpose=?,all_mention=?,history_for_new=?,archived=?,office_enabled=?,office_style=? WHERE id=?")
|
|
939
|
-
.run(body.name ?? row.name, body.purpose ?? row.purpose, body.allMention === undefined ? row.all_mention : Number(body.allMention), body.historyForNew ?? row.history_for_new, body.archived === undefined ? row.archived : Number(body.archived), office, style, id);
|
|
994
|
+
db.prepare("UPDATE hub_group_rooms SET name=?,purpose=?,all_mention=?,history_for_new=?,archived=?,office_enabled=?,office_style=?,members_add_own_agents=? WHERE id=?")
|
|
995
|
+
.run(body.name ?? row.name, body.purpose ?? row.purpose, body.allMention === undefined ? row.all_mention : Number(body.allMention), body.historyForNew ?? row.history_for_new, body.archived === undefined ? row.archived : Number(body.archived), office, style, body.membersCanAddOwnAgents === undefined ? row.members_add_own_agents : Number(body.membersCanAddOwnAgents), id);
|
|
940
996
|
const changed = [];
|
|
941
997
|
if (body.purpose !== undefined && body.purpose !== row.purpose)
|
|
942
998
|
changed.push(this.recordPurpose(db, tx, id, me, body.purpose, ctx.requestId));
|
|
@@ -961,12 +1017,13 @@ export class HubGroupRooms {
|
|
|
961
1017
|
if (body.kind === "assistant")
|
|
962
1018
|
return this.patch(ctx, id, { assistant: true });
|
|
963
1019
|
if (body.kind === "agent") {
|
|
964
|
-
this.core.atomic(db => { this.
|
|
1020
|
+
this.core.atomic(db => { this.memberAgentAddition(db, id, me); }, this.fence(ctx));
|
|
965
1021
|
const permit = await this.core.groupExposure(body.id, null, this.core.groupContext(ctx));
|
|
966
1022
|
this.core.atomic((db, tx) => {
|
|
967
|
-
this.
|
|
1023
|
+
this.memberAgentAddition(db, id, me);
|
|
968
1024
|
this.addAgentMember(db, tx, id, body.id, me);
|
|
969
1025
|
this.core.audit(tx, { requestId: ctx.requestId, actor: { kind: "person", person: personFromString(me) }, action: "room.agent-added", result: "completed", roomId: id, exposureId: body.id });
|
|
1026
|
+
this.memberAgentAddition(db, id, me);
|
|
970
1027
|
}, { assertCurrent: () => { this.fence(ctx).assertCurrent(); permit.assertCurrent(); } });
|
|
971
1028
|
this.emit({ type: "member.changed", roomId: id, data: { roomId: id } });
|
|
972
1029
|
return { ok: true };
|
|
@@ -1025,6 +1082,27 @@ export class HubGroupRooms {
|
|
|
1025
1082
|
this.emit({ type: "member.changed", roomId: id, data: { roomId: id } });
|
|
1026
1083
|
return { ok: true };
|
|
1027
1084
|
}
|
|
1085
|
+
/** Member authority is local to this room and never permits people, assistants or another owner's agents. */
|
|
1086
|
+
memberAgentAddition(db, id, me) {
|
|
1087
|
+
const member = this.member(db, id, me), room = this.room(db, id);
|
|
1088
|
+
if (room.assistant_for || (member.role !== "manager" && room.members_add_own_agents !== 1))
|
|
1089
|
+
throw new HubRoomRefusal(403, "denied");
|
|
1090
|
+
if (room.archived)
|
|
1091
|
+
throw new HubRoomRefusal(409, "archived");
|
|
1092
|
+
}
|
|
1093
|
+
async ownAgentCandidates(ctx, id, q) {
|
|
1094
|
+
if (q.length > 64 || /[\u0000-\u001f\u007f]/.test(q))
|
|
1095
|
+
throw new HubProtocolError("invalid");
|
|
1096
|
+
const me = await this.who(ctx);
|
|
1097
|
+
const check = () => this.core.atomic(db => this.memberAgentAddition(db, id, me), this.fence(ctx));
|
|
1098
|
+
check();
|
|
1099
|
+
return new HubCatalogService(this.core).withVisible(ctx, view => {
|
|
1100
|
+
check();
|
|
1101
|
+
return view.mine.filter(e => e.state === "published" && e.displayName.toLowerCase().startsWith(q.trim().toLowerCase()))
|
|
1102
|
+
.slice(0, 20).map(e => ({ kind: "agent", id: e.id, name: e.displayName, mine: true,
|
|
1103
|
+
owner: { name: this.core.atomic(db => this.name(db, me)) } }));
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1028
1106
|
/** C invitation acceptance calls this only inside its guarded exact-invitation transaction. */
|
|
1029
1107
|
addAgentMember(db, tx, roomId, exposureId, owner) {
|
|
1030
1108
|
const room = this.room(db, roomId);
|
|
@@ -1093,7 +1171,7 @@ export class HubGroupRooms {
|
|
|
1093
1171
|
until = row.sequence;
|
|
1094
1172
|
}
|
|
1095
1173
|
const rows = db.prepare("SELECT * FROM hub_room_posts WHERE room_id=? AND sequence>=? AND COALESCE((SELECT audience_sequence FROM hub_room_post_lineage l WHERE l.post_id=hub_room_posts.id),sequence)>=? AND sequence<? AND (answer_to IS NULL OR EXISTS(SELECT 1 FROM hub_room_posts original WHERE original.id=hub_room_posts.answer_to AND original.sequence>=?)) ORDER BY sequence DESC LIMIT ?").all(id, member.joined_sequence, member.joined_sequence, until, member.joined_sequence, limit + 1);
|
|
1096
|
-
return { messages: rows.slice(0, limit).reverse().map(row => this.projection(row)), more: rows.length > limit };
|
|
1174
|
+
return { messages: rows.slice(0, limit).reverse().map(row => this.projection(row, db)), more: rows.length > limit };
|
|
1097
1175
|
}, this.fence(ctx));
|
|
1098
1176
|
}
|
|
1099
1177
|
async post(ctx, id, input) {
|
|
@@ -1239,9 +1317,10 @@ export class HubGroupRooms {
|
|
|
1239
1317
|
const answering = this.agents.answering(db, id);
|
|
1240
1318
|
// R2a: each Fleet's catalog read once (it is the owner's latest, kept by the Hub: there when the Fleet is offline).
|
|
1241
1319
|
const catalogs = new Map();
|
|
1320
|
+
const transportState = this.core.deps.store.read();
|
|
1242
1321
|
const lookOf = (fleetId, exposureId) => {
|
|
1243
1322
|
if (!catalogs.has(fleetId))
|
|
1244
|
-
catalogs.set(fleetId, this.looks ? this.looks(fleetId) : null);
|
|
1323
|
+
catalogs.set(fleetId, this.looks ? this.looks(fleetId, db, transportState) : null);
|
|
1245
1324
|
return catalogs.get(fleetId)?.get(exposureId) ?? null;
|
|
1246
1325
|
};
|
|
1247
1326
|
const agents = db.prepare("SELECT * FROM hub_room_members WHERE room_id=? AND kind IN ('agent','assistant') ORDER BY kind,id").all(id).map(m => {
|