@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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** The activation transaction is authoritative for Go back; retained.json is only a projection. */
|
|
2
|
+
import type Database from "better-sqlite3";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import type { RequestContextActivationLease } from "./request-context-update-guard.js";
|
|
5
|
+
export declare const REQUEST_CONTEXT_ACTIVATIONS_TABLE = "request_context_activations_v1";
|
|
6
|
+
declare const record: z.ZodObject<{
|
|
7
|
+
epoch: z.ZodString;
|
|
8
|
+
owner: z.ZodString;
|
|
9
|
+
activatedAt: z.ZodNumber;
|
|
10
|
+
invalidates: z.ZodArray<z.ZodString>;
|
|
11
|
+
offeredLatestDeadline: z.ZodNullable<z.ZodNumber>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export type RequestContextActivationRecord = z.infer<typeof record>;
|
|
14
|
+
/** Uses an already confined, read-only outbox handle. Unreadable or malformed means refusal, never no activation. */
|
|
15
|
+
export declare function readRequestContextActivations(db: Database.Database): readonly RequestContextActivationRecord[];
|
|
16
|
+
/**
|
|
17
|
+
* Before any restore, under updater locks and the EXCLUSIVE lease, pass a manifest-hash-verified private copy of the actual snapshot, opened readonly.
|
|
18
|
+
* Never open the immutable snapshot in place: even readonly WAL opens can create sidecars.
|
|
19
|
+
* A timestamp cannot prove ordering: a backwards clock can stamp a pre-activation commit later than activation.
|
|
20
|
+
* Only preservation of the live activation history proves that restoration will not erase the version floor.
|
|
21
|
+
*/
|
|
22
|
+
export declare function requestContextGoBackAllowed(db: Database.Database, id: string, committedAt: number, snapshotDb?: Database.Database): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Dormant assembly primitive. The caller stages every owner before this, and supplies freshly rechecked readiness
|
|
25
|
+
* and the exact confirmed Go back offer. Floor, epoch, owner and invalidation are one SQLite COMMIT, including when
|
|
26
|
+
* nested in the owning transaction. Failure anywhere leaves no partial activation or Go back invalidation.
|
|
27
|
+
*/
|
|
28
|
+
export declare function commitRequestContextActivation(db: Database.Database, value: RequestContextActivationRecord, update: RequestContextActivationLease, stillReadyAndSameOffer: () => boolean): void;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { readRequestContextResolutionHistory, requestContextResolutionHistoriesEqual } from "./request-context-resolution.js";
|
|
2
|
+
import { contactRetirementImage } from "./contact-auth-store.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { activateRequestContextBarrier, assertRequestContextCompatibility } from "./request-context-compatibility.js";
|
|
5
|
+
export const REQUEST_CONTEXT_ACTIVATIONS_TABLE = "request_context_activations_v1";
|
|
6
|
+
const attemptId = z.string().regex(/^\d{8}T\d{6}Z-[a-f0-9]{8}$/);
|
|
7
|
+
const time = z.number().int().nonnegative().safe();
|
|
8
|
+
const record = z.strictObject({ epoch: z.string().min(1).max(256), owner: z.string().min(1).max(256), activatedAt: time,
|
|
9
|
+
invalidates: z.array(attemptId).max(1024), offeredLatestDeadline: time.nullable() }).superRefine((r, ctx) => {
|
|
10
|
+
if (new Set(r.invalidates).size !== r.invalidates.length || JSON.stringify([...r.invalidates].sort()) !== JSON.stringify(r.invalidates)
|
|
11
|
+
|| (r.invalidates.length === 0) !== (r.offeredLatestDeadline === null))
|
|
12
|
+
ctx.addIssue({ code: "custom", message: "Invalid Go back offer" });
|
|
13
|
+
});
|
|
14
|
+
/** Uses an already confined, read-only outbox handle. Unreadable or malformed means refusal, never no activation. */
|
|
15
|
+
export function readRequestContextActivations(db) {
|
|
16
|
+
const table = db.prepare("SELECT type FROM sqlite_master WHERE name=?").get(REQUEST_CONTEXT_ACTIVATIONS_TABLE);
|
|
17
|
+
const floor = db.prepare("SELECT 1 FROM sqlite_master WHERE name='request_context_compatibility'").get();
|
|
18
|
+
if (!table) {
|
|
19
|
+
if (floor)
|
|
20
|
+
throw Error("Activation history unavailable");
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
if (table.type !== "table" || !floor)
|
|
24
|
+
throw Error("Invalid activation history");
|
|
25
|
+
assertRequestContextCompatibility(db, 1);
|
|
26
|
+
const rows = db.prepare(`SELECT epoch,owner,activated_at,invalidates_json,offered_latest_deadline FROM ${REQUEST_CONTEXT_ACTIVATIONS_TABLE} ORDER BY activated_at,epoch LIMIT 1025`).all();
|
|
27
|
+
if (!rows.length || rows.length > 1024)
|
|
28
|
+
throw Error("Invalid activation history");
|
|
29
|
+
return rows.map(r => record.parse({ epoch: r.epoch, owner: r.owner, activatedAt: r.activated_at,
|
|
30
|
+
invalidates: JSON.parse(r.invalidates_json), offeredLatestDeadline: r.offered_latest_deadline }));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Before any restore, under updater locks and the EXCLUSIVE lease, pass a manifest-hash-verified private copy of the actual snapshot, opened readonly.
|
|
34
|
+
* Never open the immutable snapshot in place: even readonly WAL opens can create sidecars.
|
|
35
|
+
* A timestamp cannot prove ordering: a backwards clock can stamp a pre-activation commit later than activation.
|
|
36
|
+
* Only preservation of the live activation history proves that restoration will not erase the version floor.
|
|
37
|
+
*/
|
|
38
|
+
export function requestContextGoBackAllowed(db, id, committedAt, snapshotDb) {
|
|
39
|
+
attemptId.parse(id);
|
|
40
|
+
time.parse(committedAt); // Audit metadata only; never evidence for permission.
|
|
41
|
+
const live = readRequestContextActivations(db);
|
|
42
|
+
if (live.some(r => r.invalidates.includes(id)))
|
|
43
|
+
return false;
|
|
44
|
+
const retirements = contactRetirementImage(db);
|
|
45
|
+
if (!live.length) {
|
|
46
|
+
if (readRequestContextResolutionHistory(db).guard)
|
|
47
|
+
throw Error("Resolution without activation history");
|
|
48
|
+
// Legacy ticket retirement precedes first On. It still must never be undone
|
|
49
|
+
// by restoring an older snapshot, even when there is no activation to compare.
|
|
50
|
+
if (!snapshotDb)
|
|
51
|
+
return retirements === "none";
|
|
52
|
+
return snapshotDb !== db && snapshotDb.readonly && retirements === contactRetirementImage(snapshotDb);
|
|
53
|
+
}
|
|
54
|
+
if (!snapshotDb || snapshotDb === db || !snapshotDb.readonly)
|
|
55
|
+
return false;
|
|
56
|
+
const snapshot = readRequestContextActivations(snapshotDb);
|
|
57
|
+
return JSON.stringify(live) === JSON.stringify(snapshot) && requestContextResolutionHistoriesEqual(db, snapshotDb)
|
|
58
|
+
&& retirements === contactRetirementImage(snapshotDb);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Dormant assembly primitive. The caller stages every owner before this, and supplies freshly rechecked readiness
|
|
62
|
+
* and the exact confirmed Go back offer. Floor, epoch, owner and invalidation are one SQLite COMMIT, including when
|
|
63
|
+
* nested in the owning transaction. Failure anywhere leaves no partial activation or Go back invalidation.
|
|
64
|
+
*/
|
|
65
|
+
export function commitRequestContextActivation(db, value, update, stillReadyAndSameOffer) {
|
|
66
|
+
const input = record.parse(value);
|
|
67
|
+
db.transaction(() => {
|
|
68
|
+
if (!update.current() || !stillReadyAndSameOffer())
|
|
69
|
+
throw Error("Activation preparation changed");
|
|
70
|
+
activateRequestContextBarrier(db, 1);
|
|
71
|
+
db.exec(`CREATE TABLE IF NOT EXISTS ${REQUEST_CONTEXT_ACTIVATIONS_TABLE} (
|
|
72
|
+
epoch TEXT PRIMARY KEY, owner TEXT NOT NULL, activated_at INTEGER NOT NULL,
|
|
73
|
+
invalidates_json TEXT NOT NULL, offered_latest_deadline INTEGER);
|
|
74
|
+
CREATE TRIGGER IF NOT EXISTS request_context_activation_no_update BEFORE UPDATE ON ${REQUEST_CONTEXT_ACTIVATIONS_TABLE}
|
|
75
|
+
BEGIN SELECT RAISE(ABORT,'Activation history is immutable'); END;
|
|
76
|
+
CREATE TRIGGER IF NOT EXISTS request_context_activation_no_delete BEFORE DELETE ON ${REQUEST_CONTEXT_ACTIVATIONS_TABLE}
|
|
77
|
+
BEGIN SELECT RAISE(ABORT,'Activation history is immutable'); END;`);
|
|
78
|
+
db.prepare(`INSERT INTO ${REQUEST_CONTEXT_ACTIVATIONS_TABLE} VALUES (?,?,?,?,?)`).run(input.epoch, input.owner, input.activatedAt, JSON.stringify(input.invalidates), input.offeredLatestDeadline);
|
|
79
|
+
assertRequestContextCompatibility(db, 1);
|
|
80
|
+
if (!update.current() || !stillReadyAndSameOffer())
|
|
81
|
+
throw Error("Activation preparation changed");
|
|
82
|
+
readRequestContextActivations(db);
|
|
83
|
+
})();
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=request-context-activation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-context-activation.js","sourceRoot":"","sources":["../src/request-context-activation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mCAAmC,EAAC,sCAAsC,EAAC,MAAM,iCAAiC,CAAC;AAC3H,OAAO,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAG/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,6BAA6B,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AAGtH,MAAM,CAAC,MAAM,iCAAiC,GAAG,gCAAgC,CAAC;AAClF,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;AACjE,MAAM,IAAI,GAA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AC,IAAI,CAAC,8BAA8B,iCAAiC;;;2FAGgB,iCAAiC;;2FAEjC,iCAAiC;0EAClD,CAAC,CAAC;QACxE,EAAE,CAAC,OAAO,CAAC,eAAe,iCAAiC,qBAAqB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,EAC/H,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAClE,iCAAiC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,sBAAsB,EAAE;YAAE,MAAM,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAClG,6BAA6B,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,EAAE,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** An in-process gate proof, not serialized authority. Only its owning publication can recognize it. */
|
|
2
|
+
export interface RequestContextContinuation {
|
|
3
|
+
readonly rootContextId: string;
|
|
4
|
+
current(): boolean;
|
|
5
|
+
}
|
|
6
|
+
/** Trusted process-owned input fence, shared by Fleet, daemon and exec producers. No model/config authority. */
|
|
7
|
+
export interface RequestContextAdmissionPort {
|
|
8
|
+
/** Pure observation, for pump/claim eligibility. It must not count a poll as a producer arrival. */
|
|
9
|
+
available(continuation?: RequestContextContinuation): boolean;
|
|
10
|
+
/** A pump may inspect candidates while roots are paused; each claim still needs available(its proof). */
|
|
11
|
+
dispatchAvailable?(): boolean;
|
|
12
|
+
/** An actual durable producer arrived without claiming input (for example an outbox admission). */
|
|
13
|
+
arrived(): void;
|
|
14
|
+
/** Retain at the owning producer until admission opens; false means that exact producer is no longer current. */
|
|
15
|
+
wait(current: () => boolean, continuation?: RequestContextContinuation): Promise<boolean>;
|
|
16
|
+
/** Re-evaluate held producers after an owner/transport change; never opens admission by itself. */
|
|
17
|
+
changed(): void;
|
|
18
|
+
/** Scheduling notification only; subscribing is not an input arrival and grants no admission. */
|
|
19
|
+
subscribe(listener: (available: boolean) => void): () => void;
|
|
20
|
+
}
|
|
21
|
+
/** The callback starts synchronously after the last availability check, including exec claim/journal creation. */
|
|
22
|
+
export declare function runWithRequestContextAdmission<T>(port: RequestContextAdmissionPort, current: () => boolean, run: () => T, continuation?: RequestContextContinuation): Promise<Awaited<T>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The callback starts synchronously after the last availability check, including exec claim/journal creation. */
|
|
2
|
+
export async function runWithRequestContextAdmission(port, current, run, continuation) {
|
|
3
|
+
for (;;) {
|
|
4
|
+
if (!current())
|
|
5
|
+
throw Error("Input owner is no longer current");
|
|
6
|
+
if (port.available(continuation))
|
|
7
|
+
return await run();
|
|
8
|
+
if (!await port.wait(current, continuation))
|
|
9
|
+
throw Error("Input owner is no longer current");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=request-context-admission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-context-admission.js","sourceRoot":"","sources":["../src/request-context-admission.ts"],"names":[],"mappings":"AAiBA,kHAAkH;AAClH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAAI,IAAiC,EAAE,OAAsB,EAC/G,GAAY,EAAC,YAAwC;IACrD,SAAS,CAAC;QACR,IAAI,CAAC,OAAO,EAAE;YAAE,MAAM,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAChE,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;YAAE,OAAO,MAAM,GAAG,EAAE,CAAC;QACrD,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAC,YAAY,CAAC;YAAE,MAAM,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RequestContextPublication, type RequestContextInstallationState } from "./request-context-installation.js";
|
|
2
|
+
import { type RequestContextPolicyPort } from "./request-context-policy.js";
|
|
3
|
+
export interface RequestContextFleetLease {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
current(): boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface RequestContextServingIngress {
|
|
8
|
+
readonly relay: import("./request-context-relay.js").RequestContextRelayPort;
|
|
9
|
+
readonly human: (instance: string, payload: Record<string, unknown>, origin: import("./human-delivery-receipts.js").HumanOrigin, body: string) => ReturnType<import("./delivery-outbox.js").DeliveryOutbox["createHumanReceipt"]>;
|
|
10
|
+
readonly hub: (input: import("./hub/representative.js").HubRepresentativeDelivery) => ReturnType<import("./request-context-hub-resolver.js").RequestHubInputResolver["capture"]>;
|
|
11
|
+
readonly api: import("./request-contact-api.js").RequestContactApiHost;
|
|
12
|
+
readonly cards: import("./request-contact-card.js").RequestContactCards;
|
|
13
|
+
current(): boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface RequestContextBootPorts {
|
|
16
|
+
readonly policy: RequestContextPolicyPort;
|
|
17
|
+
readonly serving?: RequestContextServingIngress;
|
|
18
|
+
}
|
|
19
|
+
/** Missing is legacy. Unreadable, redirected, partial or malformed is never legacy. Live DB only, never a snapshot. */
|
|
20
|
+
export declare function readRequestContextBootState(dataDir: string): RequestContextInstallationState | null;
|
|
21
|
+
/** An activated boot never creates a legacy owner while the capable installer is unavailable. */
|
|
22
|
+
export declare class RequestContextBoot {
|
|
23
|
+
readonly initial: RequestContextInstallationState | null;
|
|
24
|
+
readonly publication: RequestContextPublication<RequestContextBootPorts>;
|
|
25
|
+
readonly owner: {
|
|
26
|
+
readonly owner: string;
|
|
27
|
+
current(): boolean;
|
|
28
|
+
};
|
|
29
|
+
readonly policy: RequestContextPolicyPort;
|
|
30
|
+
/** First On has no durable state yet. Its publication stays legacy until the owner explicitly fences preparation. */
|
|
31
|
+
static prepareFirstOn(owner: string, lease: RequestContextFleetLease): RequestContextBoot;
|
|
32
|
+
constructor(initial: RequestContextInstallationState | null, lease: RequestContextFleetLease, firstOwner?: string);
|
|
33
|
+
readonly recoveryCurrent: () => boolean;
|
|
34
|
+
requirePreparedOwner(): never;
|
|
35
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** Startup inspection precedes the outbox's writable open, recovery and all owner launches. */
|
|
2
|
+
import Database from "better-sqlite3";
|
|
3
|
+
import { lstatSync, realpathSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { RequestContextPublication, readRequestContextInstallation } from "./request-context-installation.js";
|
|
6
|
+
import { RequestContextPolicyError } from "./request-context-policy.js";
|
|
7
|
+
/** Missing is legacy. Unreadable, redirected, partial or malformed is never legacy. Live DB only, never a snapshot. */
|
|
8
|
+
export function readRequestContextBootState(dataDir) {
|
|
9
|
+
const path = join(dataDir, "delivery-outbox.db");
|
|
10
|
+
let before;
|
|
11
|
+
try {
|
|
12
|
+
before = lstatSync(path);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (error.code !== "ENOENT")
|
|
16
|
+
throw error;
|
|
17
|
+
for (const suffix of ["-wal", "-shm"]) {
|
|
18
|
+
try {
|
|
19
|
+
lstatSync(path + suffix);
|
|
20
|
+
}
|
|
21
|
+
catch (sidecar) {
|
|
22
|
+
if (sidecar.code === "ENOENT")
|
|
23
|
+
continue;
|
|
24
|
+
throw sidecar;
|
|
25
|
+
}
|
|
26
|
+
throw Error("Request-context database is missing but its journal remains");
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const parent = realpathSync(dataDir);
|
|
31
|
+
if (!before.isFile() || before.nlink !== 1 || realpathSync(path) !== join(parent, "delivery-outbox.db"))
|
|
32
|
+
throw Error("Request-context database path differs");
|
|
33
|
+
for (const suffix of ["-wal", "-shm"]) {
|
|
34
|
+
try {
|
|
35
|
+
const sidecar = lstatSync(path + suffix);
|
|
36
|
+
if (!sidecar.isFile() || sidecar.nlink !== 1)
|
|
37
|
+
throw Error("Request-context database sidecar differs");
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
if (error.code !== "ENOENT")
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const db = new Database(path, { readonly: true, fileMustExist: true });
|
|
45
|
+
try {
|
|
46
|
+
db.pragma("query_only = ON");
|
|
47
|
+
const value = readRequestContextInstallation(db), after = lstatSync(path);
|
|
48
|
+
if (before.dev !== after.dev || before.ino !== after.ino || !after.isFile())
|
|
49
|
+
throw Error("Request-context database changed during startup");
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
db.close();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** An activated boot never creates a legacy owner while the capable installer is unavailable. */
|
|
57
|
+
export class RequestContextBoot {
|
|
58
|
+
initial;
|
|
59
|
+
publication;
|
|
60
|
+
owner;
|
|
61
|
+
policy;
|
|
62
|
+
/** First On has no durable state yet. Its publication stays legacy until the owner explicitly fences preparation. */
|
|
63
|
+
static prepareFirstOn(owner, lease) {
|
|
64
|
+
if (!owner || owner.length > 256 || /[\x00-\x1f\x7f]/.test(owner))
|
|
65
|
+
throw Error("Request-context Fleet identity unavailable");
|
|
66
|
+
return new RequestContextBoot(null, lease, owner);
|
|
67
|
+
}
|
|
68
|
+
constructor(initial, lease, firstOwner) {
|
|
69
|
+
this.initial = initial;
|
|
70
|
+
if (!lease.current())
|
|
71
|
+
throw Error("Request-context Fleet lease unavailable");
|
|
72
|
+
// Durable Fleet identity belongs to the retained installation; currentness belongs to this exact process lock.
|
|
73
|
+
const owner = initial?.owner ?? firstOwner;
|
|
74
|
+
if (!owner)
|
|
75
|
+
throw Error("Request-context Fleet identity unavailable");
|
|
76
|
+
this.owner = Object.freeze({ owner, current: () => lease.current() });
|
|
77
|
+
this.publication = new RequestContextPublication(this.owner, initial !== null);
|
|
78
|
+
this.policy = Object.freeze({
|
|
79
|
+
assert: (input) => {
|
|
80
|
+
const covered = input.admission?.coverage === "covered" ? input.admission.lease : null;
|
|
81
|
+
if (covered && !covered.current())
|
|
82
|
+
throw new RequestContextPolicyError("stale");
|
|
83
|
+
const installed = covered ? this.publication.captureExecution() : this.publication.capture();
|
|
84
|
+
if (!installed)
|
|
85
|
+
throw new RequestContextPolicyError("uncovered");
|
|
86
|
+
const permit = installed.ports.policy.assert(input);
|
|
87
|
+
if (covered ? !covered.current() || !installed.executionCurrent() : !installed.current())
|
|
88
|
+
throw new RequestContextPolicyError("stale");
|
|
89
|
+
return permit;
|
|
90
|
+
},
|
|
91
|
+
installedMode: () => this.publication.installedMode(),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
recoveryCurrent = () => this.publication.recoveryAvailable();
|
|
95
|
+
requirePreparedOwner() { throw Error("Request-context owner preparation unavailable"); }
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=request-context-boot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-context-boot.js","sourceRoot":"","sources":["../src/request-context-boot.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,8BAA8B,EAAwC,MAAM,mCAAmC,CAAC;AACpJ,OAAO,EAAE,yBAAyB,EAA+D,MAAM,6BAA6B,CAAC;AAYrI,uHAAuH;AACvH,MAAM,UAAU,2BAA2B,CAAC,OAAe;IACzD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;IACjD,IAAI,MAAM,CAAC;IACX,IAAI,CAAC;QAAC,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;IACjC,OAAO,KAAK,EAAE,CA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,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC;IAC/E,oBAAoB,KAAY,MAAM,KAAK,CAAC,+CAA+C,CAAC,CAAC,CAAC,CAAC;CAChG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TurnReplyRouteLease } from "./turn-reply-guard.js";
|
|
1
2
|
import type { RequestContextTurnSnapshot } from "./request-context-turns.js";
|
|
2
3
|
/** Server-private captured call scope, not a tool argument, bearer file or human authority. */
|
|
3
4
|
export interface RequestContextCallLease {
|
|
@@ -16,6 +17,8 @@ export type RequestContextCallAdmission = {
|
|
|
16
17
|
export interface RequestContextLocalCall {
|
|
17
18
|
readonly id: string;
|
|
18
19
|
readonly admission: RequestContextCallAdmission;
|
|
20
|
+
readonly replyRoute?: TurnReplyRouteLease;
|
|
21
|
+
readonly waitForReplyRoute?: (budgetMs: number) => Promise<void>;
|
|
19
22
|
current(): boolean;
|
|
20
23
|
}
|
|
21
24
|
/** Capture exactly once. The callback checks THIS snapshot against the real owner; it cannot substitute a later context. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context-call.js","sourceRoot":"","sources":["../src/request-context-call.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request-context-call.js","sourceRoot":"","sources":["../src/request-context-call.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,SAAS,MAAM,CAAI,KAAQ;IACzB,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAAC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;YAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAAC,C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AAC,CAAC;QAAE,MAAM,KAAK,CAAC,2CAA2C,CAAC,CAAC;IACzH,MAAM,CAAC,MAAM,CAAC,CAAC;IACf,MAAM,OAAO,GAAG,GAAY,EAAE,GAAG,IAAI,CAAC;QAAC,OAAO,YAAY,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,KAAK,CAAC;IAAC,CAAC,CAAC,CAAC,CAAC;IACzG,IAAI,CAAC,OAAO,EAAE;QAAE,MAAM,KAAK,CAAC,2CAA2C,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,oBAAoB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AACpG,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assertRequestContextResolutionGuard, REQUEST_CONTEXT_RESOLUTION_FUNCTION, REQUEST_CONTEXT_RESOLUTION_GUARD } from "./request-context-resolution.js";
|
|
1
2
|
export const REQUEST_CONTEXT_DISPATCH_VERSION = 1;
|
|
2
3
|
export const REQUEST_CONTEXT_VERSION_FUNCTION = "agend_request_context_dispatch_version";
|
|
3
4
|
const MARKER = "request_context_compatibility";
|
|
@@ -21,13 +22,18 @@ export function registerRequestContextDispatcher(db, version) {
|
|
|
21
22
|
if (version !== 0 && version !== REQUEST_CONTEXT_DISPATCH_VERSION)
|
|
22
23
|
fail("Unsupported request-context dispatcher capability");
|
|
23
24
|
db.function(REQUEST_CONTEXT_VERSION_FUNCTION, { deterministic: true }, () => version);
|
|
25
|
+
db.function(REQUEST_CONTEXT_RESOLUTION_FUNCTION, { deterministic: true }, () => version === 1 ? 1 : 0);
|
|
24
26
|
}
|
|
25
27
|
/** Must run before legacy initialization/recovery, including for the capability-0 bridge itself. */
|
|
26
28
|
export function assertRequestContextCompatibility(db, version) {
|
|
27
29
|
const artifacts = db.prepare("SELECT type,name,tbl_name,sql FROM sqlite_master WHERE name=? OR (type='trigger' AND substr(name,1,?)=?)")
|
|
28
30
|
.all(MARKER, PREFIX.length, PREFIX);
|
|
29
|
-
|
|
31
|
+
const resolution = assertRequestContextResolutionGuard(db);
|
|
32
|
+
if (!artifacts.length) {
|
|
33
|
+
if (resolution)
|
|
34
|
+
fail("Resolution requires request-context barrier");
|
|
30
35
|
return "inactive";
|
|
36
|
+
}
|
|
31
37
|
const marker = artifacts.find(row => row.name === MARKER);
|
|
32
38
|
if (!marker || marker.type !== "table")
|
|
33
39
|
fail("Invalid request-context compatibility barrier");
|
|
@@ -39,7 +45,9 @@ export function assertRequestContextCompatibility(db, version) {
|
|
|
39
45
|
if (required !== REQUEST_CONTEXT_DISPATCH_VERSION || version < required) {
|
|
40
46
|
fail(`request-context dispatch v${required} required; this dispatcher supports v${version}`);
|
|
41
47
|
}
|
|
42
|
-
if (artifacts.
|
|
48
|
+
if (resolution && !artifacts.some(row => row.name === REQUEST_CONTEXT_RESOLUTION_GUARD))
|
|
49
|
+
fail("Missing resolution guard");
|
|
50
|
+
if (artifacts.length !== 1 + TABLES.length * OPERATIONS.length + (resolution ? 1 : 0))
|
|
43
51
|
fail("Invalid request-context barrier guard set");
|
|
44
52
|
for (const table of TABLES)
|
|
45
53
|
for (const operation of OPERATIONS) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-context-compatibility.js","sourceRoot":"","sources":["../src/request-context-compatibility.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request-context-compatibility.js","sourceRoot":"","sources":["../src/request-context-compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mCAAmC,EAAC,mCAAmC,EAAC,gCAAgC,EAAC,MAAM,iCAAiC,CAAC;AAGzJ,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAU,CAAC;AAC3D,MAAM,CAAC,MAAM,gCAAgC,GAAG,wCAAwC,CAAC;AACzF,MAAM,MAAM,GAAG,+BAA+B,CAAC;A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gC,eAAe,CAAC,CAAC,GAAG,EAAyB,CAAC;IAClH,IAAI,MAAM,CAAC,OAAO,KAAK,OAAO;QAAE,IAAI,CAAC,iEAAiE,CAAC,CAAC;IACxG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE;QAClB,IAAI,iCAAiC,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,QAAQ;YAAE,OAAO;QACxE,EAAE,CAAC,IAAI,CAAC,gBAAgB,MAAM,iGAAiG,CAAC,CAAC;QACjI,KAAK,MAAM,KAAK,IAAI,MAAM;YAAE,KAAK,MAAM,SAAS,IAAI,UAAU;gBAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;QACpG,EAAE,CAAC,OAAO,CAAC,eAAe,MAAM,eAAe,CAAC,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;QACvF,iCAAiC,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC,CAAC,EAAE,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Admission leases for already admitted deliveries. Correlations and model-supplied root ids grant nothing. */
|
|
2
|
+
import type { DeliveryOutbox, OutboxDelivery } from "./delivery-outbox.js";
|
|
3
|
+
import type { RequestContextPublication } from "./request-context-installation.js";
|
|
4
|
+
import type { RequestContextContinuation } from "./request-context-admission.js";
|
|
5
|
+
/** A queued candidate is inspected without claiming it. Re-claim/state changes need a fresh lease. */
|
|
6
|
+
export declare function requestDeliveryContinuation<T extends object>(box: DeliveryOutbox, publication: RequestContextPublication<T>, delivery: OutboxDelivery, current: () => boolean): RequestContextContinuation | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { requestContextDigest } from "./request-context-store.js";
|
|
2
|
+
/** A queued candidate is inspected without claiming it. Re-claim/state changes need a fresh lease. */
|
|
3
|
+
export function requestDeliveryContinuation(box, publication, delivery, current) {
|
|
4
|
+
const operation = box.requestContextForDelivery(delivery.deliveryId);
|
|
5
|
+
if (!operation)
|
|
6
|
+
return null;
|
|
7
|
+
const deliveryImage = requestContextDigest(delivery), operationImage = requestContextDigest(operation);
|
|
8
|
+
const valid = () => {
|
|
9
|
+
try {
|
|
10
|
+
if (!current() || !box.isOpen)
|
|
11
|
+
return false;
|
|
12
|
+
const row = box.get(delivery.deliveryId), binding = box.requestContextForDelivery(delivery.deliveryId);
|
|
13
|
+
return !!row && !!binding && ["queued", "delivering", "submission_started"].includes(row.state)
|
|
14
|
+
&& requestContextDigest(row) === deliveryImage && requestContextDigest(binding) === operationImage && current();
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
if (!valid())
|
|
21
|
+
throw Error("Request continuation delivery changed");
|
|
22
|
+
return publication.continuation(operation.binding.rootContextId, valid);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=request-context-continuation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-context-continuation.js","sourceRoot":"","sources":["../src/request-context-continuation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,CAAC;AAEhE,sGAAsG;AACtG,MAAM,UAAU,2BAA2B,CAAmB,GAAkB,EAAC,WAAwC,EACvH,QAAuB,EAAC,OAAmB;IAC3C,MAAM,SAAS,GAAC,GAAG,CAAC,yBAAyB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACnE,IAAG,CAAC,SAAS;QAAC,OAAO,IAAI,CAAC;IAC1B,MAAM,aAAa,GAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAC,cAAc,GAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAClG,MAAM,KAAK,GAAC,GAAE,EAAE;QACd,IAAG,CAAC;YACF,IAAG,CAAC,OAAO,EAAE,IAAE,CAAC,GAAG,CAAC,MAAM;gBAAC,OAAO,KAAK,CAAC;YACxC,MAAM,GAAG,GAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAC,OAAO,GAAC,GAAG,CAAC,yBAAyB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YAClG,OAAO,CAAC,CAAC,GAAG,IAAE,CAAC,CAAC,OAAO,IAAE,CAAC,QAAQ,EAAC,YAAY,EAAC,oBAAoB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;mBACrF,oBAAoB,CAAC,GAAG,CAAC,KAAG,aAAa,IAAE,oBAAoB,CAAC,OAAO,CAAC,KAAG,cAAc,IAAE,OAAO,EAAE,CAAC;QAC3G,CAAC;QAAA,MAAK,CAAC;YAAA,OAAO,KAAK,CAAC;QAAA,CAAC;IACvB,CAAC,CAAC;IACF,IAAG,CAAC,KAAK,EAAE;QAAC,MAAM,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACjE,OAAO,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,OAAO,CAAC,aAAa,EAAC,KAAK,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/** Host-owner UI boundary. Kept independent from the installer so Off still works after a failed install. */
|
|
2
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import type { SettingsExecution } from "./settings-transaction.js";
|
|
5
|
+
export declare const REQUEST_CONTEXT_ENABLE_UNAVAILABLE = "request-context-enable-unavailable";
|
|
6
|
+
export declare const RequestContextControlViewSchema: z.ZodObject<{
|
|
7
|
+
revision: z.ZodNumber;
|
|
8
|
+
enabled: z.ZodBoolean;
|
|
9
|
+
everActivated: z.ZodBoolean;
|
|
10
|
+
attempted: z.ZodBoolean;
|
|
11
|
+
restartCount: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
goBack: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
attemptIds: z.ZodArray<z.ZodString>;
|
|
14
|
+
availableUntil: z.ZodISODateTime;
|
|
15
|
+
timeZone: z.ZodString;
|
|
16
|
+
}, z.core.$strict>>;
|
|
17
|
+
phase: z.ZodEnum<{
|
|
18
|
+
blocked: "blocked";
|
|
19
|
+
draining: "draining";
|
|
20
|
+
off: "off";
|
|
21
|
+
on: "on";
|
|
22
|
+
}>;
|
|
23
|
+
canChange: z.ZodBoolean;
|
|
24
|
+
enableFailed: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
enableUnavailable: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
blockers: z.ZodArray<z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
kind: z.ZodEnum<{
|
|
29
|
+
legacy: "legacy";
|
|
30
|
+
owners: "owners";
|
|
31
|
+
peers: "peers";
|
|
32
|
+
recovery: "recovery";
|
|
33
|
+
returns: "returns";
|
|
34
|
+
tickets: "tickets";
|
|
35
|
+
update: "update";
|
|
36
|
+
work: "work";
|
|
37
|
+
}>;
|
|
38
|
+
families: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
39
|
+
"daemon-calls": "daemon-calls";
|
|
40
|
+
"fleet-calls": "fleet-calls";
|
|
41
|
+
"human-input": "human-input";
|
|
42
|
+
"native-exec": "native-exec";
|
|
43
|
+
"native-grants": "native-grants";
|
|
44
|
+
"pane-ledgers": "pane-ledgers";
|
|
45
|
+
"pane-proofs": "pane-proofs";
|
|
46
|
+
"pending-stop": "pending-stop";
|
|
47
|
+
"registered-work": "registered-work";
|
|
48
|
+
turns: "turns";
|
|
49
|
+
unknown: "unknown";
|
|
50
|
+
}>>>;
|
|
51
|
+
unknownEnd: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
labels: z.ZodArray<z.ZodString>;
|
|
53
|
+
ownerCause: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
update: "update";
|
|
55
|
+
work: "work";
|
|
56
|
+
}>>;
|
|
57
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
58
|
+
id: z.ZodString;
|
|
59
|
+
label: z.ZodString;
|
|
60
|
+
}, z.core.$strict>>>;
|
|
61
|
+
action: z.ZodOptional<z.ZodEnum<{
|
|
62
|
+
acknowledge: "acknowledge";
|
|
63
|
+
decline: "decline";
|
|
64
|
+
inspect: "inspect";
|
|
65
|
+
retire: "retire";
|
|
66
|
+
"stop-waiting": "stop-waiting";
|
|
67
|
+
"stop-work": "stop-work";
|
|
68
|
+
withdraw: "withdraw";
|
|
69
|
+
}>>;
|
|
70
|
+
}, z.core.$strict>>;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
export type RequestContextControlView = z.infer<typeof RequestContextControlViewSchema>;
|
|
73
|
+
export declare const RequestContextControlDecisionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
74
|
+
revision: z.ZodNumber;
|
|
75
|
+
action: z.ZodEnum<{
|
|
76
|
+
check: "check";
|
|
77
|
+
disable: "disable";
|
|
78
|
+
enable: "enable";
|
|
79
|
+
}>;
|
|
80
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
81
|
+
revision: z.ZodNumber;
|
|
82
|
+
action: z.ZodLiteral<"resolve">;
|
|
83
|
+
blockerId: z.ZodString;
|
|
84
|
+
resolution: z.ZodEnum<{
|
|
85
|
+
acknowledge: "acknowledge";
|
|
86
|
+
decline: "decline";
|
|
87
|
+
retire: "retire";
|
|
88
|
+
"stop-waiting": "stop-waiting";
|
|
89
|
+
"stop-work": "stop-work";
|
|
90
|
+
withdraw: "withdraw";
|
|
91
|
+
}>;
|
|
92
|
+
}, z.core.$strict>], "action">;
|
|
93
|
+
export type RequestContextControlDecision = z.infer<typeof RequestContextControlDecisionSchema>;
|
|
94
|
+
export interface RequestContextControlPrincipal {
|
|
95
|
+
/** Exact admitted session/account binding, not a browser-provided key. */
|
|
96
|
+
readonly binding: string;
|
|
97
|
+
readonly verified: boolean;
|
|
98
|
+
readonly person?: import("./contact-auth-types.js").ContactPerson;
|
|
99
|
+
/** Present only on the server-created, independently confirmed Settings replay. */
|
|
100
|
+
readonly execution?: SettingsExecution;
|
|
101
|
+
current(): boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface RequestContextControlHost {
|
|
104
|
+
principal(req: IncomingMessage, url: URL): RequestContextControlPrincipal | null;
|
|
105
|
+
permitContinuation(req: IncomingMessage, res: ServerResponse): boolean;
|
|
106
|
+
read(actor: RequestContextControlPrincipal): RequestContextControlView | Promise<RequestContextControlView>;
|
|
107
|
+
/** Already-derived state for passive channels; never runs readiness or any installer mutation. */
|
|
108
|
+
snapshot(): RequestContextControlView | null;
|
|
109
|
+
/** Read-only readiness refresh. Must never activate, resolve work or emit the enable notice. */
|
|
110
|
+
recheck(actor: RequestContextControlPrincipal): RequestContextControlView | Promise<RequestContextControlView>;
|
|
111
|
+
/** The owner must recheck actor.execution at the actual commit after any asynchronous preparation. */
|
|
112
|
+
change(input: Readonly<RequestContextControlDecision>, actor: RequestContextControlPrincipal): RequestContextControlView | Promise<RequestContextControlView>;
|
|
113
|
+
}
|
|
114
|
+
export declare function projectRequestContextControl(req: IncomingMessage, url: URL, host: RequestContextControlHost | undefined, value: unknown): RequestContextControlView | undefined;
|
|
115
|
+
export declare function projectRequestContextNeeds(req: IncomingMessage, url: URL, host: RequestContextControlHost | undefined, items: unknown[]): unknown[];
|
|
116
|
+
export declare function requestContextControlSnapshot(req: IncomingMessage, url: URL, host: RequestContextControlHost | undefined): RequestContextControlView | null | undefined;
|
|
117
|
+
/** Capture the original verified principal, not its credentials. No body/header can mint this continuation. */
|
|
118
|
+
export declare function prepareRequestContextControlReplay(req: IncomingMessage, url: URL, host: RequestContextControlHost): (replay: IncomingMessage, confirmedCurrent: () => boolean) => void;
|
|
119
|
+
export declare function handleRequestContextControlApi(req: IncomingMessage, res: ServerResponse, url: URL, host?: RequestContextControlHost): boolean;
|