@songsid/agend 2.4.0-beta.24 → 2.4.0-beta.26
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/README.md +1 -1
- package/README.zh-TW.md +1 -1
- package/dist/agend-home.js +5 -5
- package/dist/agend-home.js.map +1 -1
- package/dist/agent-endpoint.js +10 -0
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-file-read.js +1 -1
- package/dist/agent-file-read.js.map +1 -1
- package/dist/agent-workspace.d.ts +18 -2
- package/dist/agent-workspace.js +15 -4
- package/dist/agent-workspace.js.map +1 -1
- package/dist/auth-api.js +3 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/antigravity.js +8 -6
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.js +17 -0
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/claude-usage-credits.d.ts +8 -0
- package/dist/backend/claude-usage-credits.js +121 -0
- package/dist/backend/claude-usage-credits.js.map +1 -0
- package/dist/backend/types.d.ts +30 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/adapters/discord.js +7 -1
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/mcp-tools.js +1 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.js +1 -0
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/cli-audited.js +9 -4
- package/dist/cli-audited.js.map +1 -1
- package/dist/cli.js +184 -21
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +11 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/contact-auth-store.d.ts +18 -0
- package/dist/contact-auth-store.js +55 -8
- package/dist/contact-auth-store.js.map +1 -1
- package/dist/contact-auth-types.d.ts +3 -0
- package/dist/contact-auth-types.js.map +1 -1
- package/dist/contact-change-proposals.d.ts +34 -0
- package/dist/contact-change-proposals.js +1 -1
- package/dist/contact-change-proposals.js.map +1 -1
- package/dist/cross-instance-notice.d.ts +1 -0
- package/dist/cross-instance-notice.js +9 -8
- package/dist/cross-instance-notice.js.map +1 -1
- package/dist/daemon.d.ts +35 -0
- package/dist/daemon.js +234 -19
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-outbox.d.ts +42 -1
- package/dist/delivery-outbox.js +198 -21
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-context.d.ts +8 -0
- package/dist/fleet-lock.d.ts +83 -2
- package/dist/fleet-lock.js +276 -2
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +183 -7
- package/dist/fleet-manager.js +1279 -78
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +20 -1
- package/dist/fleet-windows-runtime.js +98 -18
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +13 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +12 -1
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +3 -1
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +21 -4
- package/dist/home-update-lock.d.ts +35 -0
- package/dist/home-update-lock.js +81 -0
- package/dist/home-update-lock.js.map +1 -0
- package/dist/hub/client.js +7 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +5 -1
- package/dist/hub/compose/member.js +15 -6
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +1 -0
- package/dist/hub/compose/server.js +3 -2
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/http/compose.js +3 -2
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +1 -0
- package/dist/hub/member/room-ask.d.ts +12 -8
- package/dist/hub/member/room-ask.js +95 -29
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-mention-feedback.d.ts +2 -0
- package/dist/hub/member/room-mention-feedback.js +1 -1
- package/dist/hub/member/room-mention-feedback.js.map +1 -1
- package/dist/hub/member/room-post-answers.d.ts +2 -0
- package/dist/hub/member/room-post-answers.js +1 -1
- package/dist/hub/member/room-post-answers.js.map +1 -1
- package/dist/hub/member/room-post.d.ts +5 -0
- package/dist/hub/member/room-post.js +4 -1
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/member/room-reaction-acks.d.ts +12 -0
- package/dist/hub/member/room-reaction-acks.js +44 -0
- package/dist/hub/member/room-reaction-acks.js.map +1 -0
- package/dist/hub/member/updates.d.ts +7 -1
- package/dist/hub/member/updates.js +7 -1
- package/dist/hub/member/updates.js.map +1 -1
- package/dist/hub/protocol.d.ts +4 -0
- package/dist/hub/protocol.js +2 -2
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/representative.d.ts +7 -0
- package/dist/hub/representative.js +38 -5
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/roles/audit-details.d.ts +2 -0
- package/dist/hub/roles/audit-details.js +1 -1
- package/dist/hub/roles/audit-details.js.map +1 -1
- package/dist/hub/roles/authority.d.ts +8 -3
- package/dist/hub/roles/authority.js +144 -102
- package/dist/hub/roles/authority.js.map +1 -1
- package/dist/hub/roles/delegation.js +2 -2
- package/dist/hub/roles/delegation.js.map +1 -1
- package/dist/hub/roles/model.d.ts +5 -2
- package/dist/hub/roles/model.js +5 -4
- package/dist/hub/roles/model.js.map +1 -1
- package/dist/hub/roles/review.js +2 -2
- package/dist/hub/roles/review.js.map +1 -1
- package/dist/hub/room-react-ack-model.d.ts +2 -0
- package/dist/hub/room-react-ack-model.js +3 -0
- package/dist/hub/room-react-ack-model.js.map +1 -0
- package/dist/hub/rooms/admin.d.ts +6 -0
- package/dist/hub/rooms/admin.js +33 -0
- package/dist/hub/rooms/admin.js.map +1 -1
- package/dist/hub/rooms/agents.d.ts +2 -0
- package/dist/hub/rooms/agents.js +44 -3
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +5 -1
- package/dist/hub/rooms/service.js +76 -24
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +2 -0
- package/dist/hub/server.js +6 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/types.d.ts +2 -0
- package/dist/install-lock.d.ts +15 -1
- package/dist/install-lock.js +16 -8
- package/dist/install-lock.js.map +1 -1
- package/dist/install-ownership.d.ts +165 -0
- package/dist/install-ownership.js +404 -0
- package/dist/install-ownership.js.map +1 -0
- package/dist/instance-config-impact.js +2 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instructions.d.ts +4 -0
- package/dist/instructions.js +4 -0
- package/dist/instructions.js.map +1 -1
- package/dist/local-pane-endpoint.d.ts +4 -1
- package/dist/local-pane-endpoint.js +12 -2
- package/dist/local-pane-endpoint.js.map +1 -1
- package/dist/locale.js +162 -6
- package/dist/locale.js.map +1 -1
- package/dist/native-agent-admission.d.ts +7 -0
- package/dist/native-agent-admission.js +46 -3
- package/dist/native-agent-admission.js.map +1 -1
- package/dist/native-mcp.d.ts +16 -1
- package/dist/native-mcp.js +38 -5
- package/dist/native-mcp.js.map +1 -1
- package/dist/native-pane-lifecycle.d.ts +9 -0
- package/dist/native-pane-lifecycle.js +23 -0
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-manager.d.ts +19 -6
- package/dist/native-pane-manager.js +79 -4
- package/dist/native-pane-manager.js.map +1 -1
- package/dist/needs-you.d.ts +8 -0
- package/dist/needs-you.js +1 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +12 -0
- package/dist/outbound-handlers.js +30 -2
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/package-preimage.js +4 -0
- package/dist/package-preimage.js.map +1 -1
- package/dist/pane-port.d.ts +1 -0
- package/dist/plist-args.d.ts +9 -0
- package/dist/plist-args.js +22 -0
- package/dist/plist-args.js.map +1 -0
- package/dist/public-preview.d.ts +4 -6
- package/dist/public-preview.js +5 -2
- package/dist/public-preview.js.map +1 -1
- package/dist/public-web-gateway.js +10 -3
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +13 -1
- package/dist/public-web-link.js +28 -1
- package/dist/public-web-link.js.map +1 -1
- package/dist/recover.cjs +2638 -0
- package/dist/remote-card-prompt.d.ts +6 -2
- package/dist/remote-card-prompt.js +12 -3
- package/dist/remote-card-prompt.js.map +1 -1
- package/dist/reply-draft.d.ts +12 -0
- package/dist/reply-draft.js +81 -0
- package/dist/reply-draft.js.map +1 -0
- package/dist/request-contact-api.d.ts +15 -0
- package/dist/request-contact-api.js +120 -0
- package/dist/request-contact-api.js.map +1 -0
- package/dist/request-contact-card.d.ts +36 -0
- package/dist/request-contact-card.js +206 -0
- package/dist/request-contact-card.js.map +1 -0
- package/dist/request-contact-gate.d.ts +79 -0
- package/dist/request-contact-gate.js +262 -0
- package/dist/request-contact-gate.js.map +1 -0
- package/dist/request-contact-native.d.ts +52 -0
- package/dist/request-contact-native.js +87 -0
- package/dist/request-contact-native.js.map +1 -0
- package/dist/request-contact-types.d.ts +86 -0
- package/dist/request-contact-types.js +7 -0
- package/dist/request-contact-types.js.map +1 -0
- package/dist/request-context-call-protocol.d.ts +12 -0
- package/dist/request-context-call-protocol.js +14 -0
- package/dist/request-context-call-protocol.js.map +1 -0
- package/dist/request-context-call.d.ts +22 -0
- package/dist/request-context-call.js +35 -0
- package/dist/request-context-call.js.map +1 -0
- package/dist/request-context-drain.d.ts +39 -0
- package/dist/request-context-drain.js +159 -0
- package/dist/request-context-drain.js.map +1 -0
- package/dist/request-context-fence.d.ts +28 -0
- package/dist/request-context-fence.js +58 -0
- package/dist/request-context-fence.js.map +1 -0
- package/dist/request-context-migration.d.ts +64 -0
- package/dist/request-context-migration.js +158 -0
- package/dist/request-context-migration.js.map +1 -0
- package/dist/request-context-pane.d.ts +25 -0
- package/dist/request-context-pane.js +48 -0
- package/dist/request-context-pane.js.map +1 -0
- package/dist/request-context-policy.d.ts +74 -0
- package/dist/request-context-policy.js +116 -0
- package/dist/request-context-policy.js.map +1 -0
- package/dist/request-context-recovery.d.ts +14 -0
- package/dist/request-context-recovery.js +56 -0
- package/dist/request-context-recovery.js.map +1 -0
- package/dist/request-context-relay.d.ts +19 -0
- package/dist/request-context-relay.js +63 -0
- package/dist/request-context-relay.js.map +1 -0
- package/dist/request-context-returns.d.ts +67 -0
- package/dist/request-context-returns.js +211 -0
- package/dist/request-context-returns.js.map +1 -0
- package/dist/request-context-store.d.ts +2 -1
- package/dist/request-context-store.js +8 -1
- package/dist/request-context-store.js.map +1 -1
- package/dist/request-context-turns.d.ts +99 -0
- package/dist/request-context-turns.js +215 -0
- package/dist/request-context-turns.js.map +1 -0
- package/dist/request-context-view.d.ts +33 -0
- package/dist/request-context-view.js +36 -0
- package/dist/request-context-view.js.map +1 -0
- package/dist/request-hub-context.d.ts +130 -0
- package/dist/request-hub-context.js +89 -0
- package/dist/request-hub-context.js.map +1 -0
- package/dist/request-hub-output.d.ts +11 -0
- package/dist/request-hub-output.js +21 -0
- package/dist/request-hub-output.js.map +1 -0
- package/dist/runtime-cli-install.js +13 -11
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/runtime-client.d.ts +2 -0
- package/dist/runtime-client.js +17 -4
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +4 -1
- package/dist/runtime-coordinator.js +10 -3
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-pane-assets.d.ts +1 -1
- package/dist/runtime-pane-assets.js +1 -1
- package/dist/runtime-pane-assets.js.map +1 -1
- package/dist/runtime-pane-host.d.ts +3 -0
- package/dist/runtime-pane-host.js +39 -21
- package/dist/runtime-pane-host.js.map +1 -1
- package/dist/runtime-pane-link.d.ts +6 -2
- package/dist/runtime-pane-link.js +17 -4
- package/dist/runtime-pane-link.js.map +1 -1
- package/dist/runtime-pane-mcp-relay.d.ts +11 -1
- package/dist/runtime-pane-mcp-relay.js +69 -3
- package/dist/runtime-pane-mcp-relay.js.map +1 -1
- package/dist/runtime-pane-mcp.d.ts +28 -1
- package/dist/runtime-pane-mcp.js +92 -15
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-pane-port.d.ts +6 -0
- package/dist/runtime-pane-port.js +23 -4
- package/dist/runtime-pane-port.js.map +1 -1
- package/dist/runtime-pane-protocol.d.ts +4 -0
- package/dist/runtime-pane-protocol.js +11 -4
- package/dist/runtime-pane-protocol.js.map +1 -1
- package/dist/runtime-pane-service.d.ts +1 -0
- package/dist/runtime-pane-service.js +25 -9
- package/dist/runtime-pane-service.js.map +1 -1
- package/dist/runtime-pane-stdio-protocol.d.ts +4 -0
- package/dist/runtime-pane-stdio-protocol.js +12 -5
- package/dist/runtime-pane-stdio-protocol.js.map +1 -1
- package/dist/runtime-pane-stdio.js +5 -5
- package/dist/runtime-pane-stdio.js.map +1 -1
- package/dist/runtime-protocol.d.ts +3 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/scheduler/scheduler.d.ts +15 -0
- package/dist/scheduler/scheduler.js +45 -1
- package/dist/scheduler/scheduler.js.map +1 -1
- package/dist/scheduler/scheduler.test.js +17 -0
- package/dist/scheduler/scheduler.test.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +4 -0
- package/dist/scheduler/task-board.js +6 -0
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/service-activation.js +3 -13
- package/dist/service-activation.js.map +1 -1
- package/dist/service-lock.d.ts +28 -0
- package/dist/service-lock.js +85 -0
- package/dist/service-lock.js.map +1 -0
- package/dist/settings-api.d.ts +6 -0
- package/dist/settings-api.js +107 -0
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +14 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +11 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/state-lease.d.ts +24 -0
- package/dist/state-lease.js +103 -0
- package/dist/state-lease.js.map +1 -0
- package/dist/tmux-binary.js +1 -1
- package/dist/tmux-binary.js.map +1 -1
- package/dist/tool-receipt-output.d.ts +2 -0
- package/dist/topic-commands.js +21 -1
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-monitor.js +3 -0
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/tunnel/named-link-test.d.ts +27 -0
- package/dist/tunnel/named-link-test.js +41 -0
- package/dist/tunnel/named-link-test.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/dist/ui/chat-store.js +5 -4
- package/dist/ui/contact-auth-strings.js +7 -2
- package/dist/ui/contact-permissions.js +10 -2
- package/dist/ui/fleet-office-card.js +15 -2
- package/dist/ui/fleet-office-pack.d.ts +2 -2
- package/dist/ui/fleet-office-pack.js +25 -8
- package/dist/ui/fleet-office-skin.js +33 -9
- package/dist/ui/fleet-office-vehicles.js +28 -11
- package/dist/ui/fleet-office-zones.js +10 -5
- package/dist/ui/fleet-office.js +158 -20
- package/dist/ui/fleet-task-files.js +1 -1
- package/dist/ui/hub-admin-rooms-strings.js +6 -2
- package/dist/ui/hub-admin-rooms.js +3 -1
- package/dist/ui/hub-group-search.js +2 -2
- package/dist/ui/hub-notify-keep.js +49 -0
- package/dist/ui/hub-role-view.js +1 -1
- package/dist/ui/hub-roles-strings.js +14 -10
- package/dist/ui/hub-roles.js +1 -1
- package/dist/ui/hub-room-notify.js +2 -1
- package/dist/ui/hub-room-strings.js +3 -3
- package/dist/ui/hub-room-thread.js +9 -4
- package/dist/ui/panel-chat.js +15 -2
- package/dist/ui/panel-hub.js +3 -2
- package/dist/ui/panel-needs.js +35 -7
- package/dist/ui/panel-settings.js +22 -8
- package/dist/ui/settings-preview-address.js +156 -0
- package/dist/ui/settings-registry.js +2 -0
- package/dist/ui/settings-strings.js +6 -6
- package/dist/ui/settings-update.js +13 -0
- package/dist/ui/shared/app-install.js +123 -0
- package/dist/ui/shared/app-shell.js +4 -2
- package/dist/ui/shared/app-update.js +16 -2
- package/dist/ui/shared/app.css +119 -2
- package/dist/ui/shared/app.js +3 -0
- package/dist/ui/shared/chat-strings.js +6 -2
- package/dist/ui/shared/chat-thread.js +7 -1
- package/dist/ui/shared/hub-chat.css +6 -0
- package/dist/ui/shared/preview-panel.js +1 -1
- package/dist/ui/shared/preview.js +11 -2
- package/dist/ui/shared/tokens.css +18 -3
- package/dist/ui/shared/ui-confirm.js +7 -5
- package/dist/ui/shared/ui-icons.js +2 -0
- package/dist/ui/shared/update-card-ui.js +419 -0
- package/dist/ui/shared/workspace.css +7 -0
- package/dist/ui/usage-credits-card.js +84 -0
- package/dist/ui/workspace-ignored-strings.js +16 -0
- package/dist/ui/workspace-panel.js +15 -6
- package/dist/update-abandon.d.ts +26 -0
- package/dist/update-abandon.js +111 -0
- package/dist/update-abandon.js.map +1 -0
- package/dist/update-card.d.ts +193 -0
- package/dist/update-card.js +620 -0
- package/dist/update-card.js.map +1 -0
- package/dist/update-dispatch.d.ts +16 -1
- package/dist/update-dispatch.js +12 -4
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-forward.d.ts +59 -0
- package/dist/update-forward.js +227 -0
- package/dist/update-forward.js.map +1 -0
- package/dist/update-goback.d.ts +90 -0
- package/dist/update-goback.js +260 -0
- package/dist/update-goback.js.map +1 -0
- package/dist/update-idle.d.ts +1 -0
- package/dist/update-idle.js +12 -3
- package/dist/update-idle.js.map +1 -1
- package/dist/update-install.d.ts +2 -1
- package/dist/update-install.js +18 -10
- package/dist/update-install.js.map +1 -1
- package/dist/update-journal.d.ts +359 -0
- package/dist/update-journal.js +723 -0
- package/dist/update-journal.js.map +1 -0
- package/dist/update-launch.js +1 -1
- package/dist/update-launch.js.map +1 -1
- package/dist/update-npm-env.d.ts +45 -12
- package/dist/update-npm-env.js +48 -0
- package/dist/update-npm-env.js.map +1 -1
- package/dist/update-package-restore.d.ts +84 -0
- package/dist/update-package-restore.js +329 -0
- package/dist/update-package-restore.js.map +1 -0
- package/dist/update-quiescence.d.ts +221 -0
- package/dist/update-quiescence.js +370 -0
- package/dist/update-quiescence.js.map +1 -0
- package/dist/update-readiness-host.d.ts +61 -0
- package/dist/update-readiness-host.js +297 -0
- package/dist/update-readiness-host.js.map +1 -0
- package/dist/update-readiness.d.ts +83 -0
- package/dist/update-readiness.js +459 -0
- package/dist/update-readiness.js.map +1 -0
- package/dist/update-recovery/kit.d.ts +35 -0
- package/dist/update-recovery/kit.js +99 -0
- package/dist/update-recovery/kit.js.map +1 -0
- package/dist/update-recovery/pre-start.d.ts +34 -0
- package/dist/update-recovery/pre-start.js +103 -0
- package/dist/update-recovery/pre-start.js.map +1 -0
- package/dist/update-recovery/recover-main.d.ts +1 -0
- package/dist/update-recovery/recover-main.js +4 -0
- package/dist/update-recovery/recover-main.js.map +1 -0
- package/dist/update-recovery/recover.d.ts +22 -0
- package/dist/update-recovery/recover.js +134 -0
- package/dist/update-recovery/recover.js.map +1 -0
- package/dist/update-recovery/route.d.ts +53 -0
- package/dist/update-recovery/route.js +262 -0
- package/dist/update-recovery/route.js.map +1 -0
- package/dist/update-recovery/runner.d.ts +62 -0
- package/dist/update-recovery/runner.js +229 -0
- package/dist/update-recovery/runner.js.map +1 -0
- package/dist/update-recovery/service-manager.d.ts +39 -0
- package/dist/update-recovery/service-manager.js +57 -0
- package/dist/update-recovery/service-manager.js.map +1 -0
- package/dist/update-restore.d.ts +50 -0
- package/dist/update-restore.js +360 -0
- package/dist/update-restore.js.map +1 -0
- package/dist/update-retained.d.ts +65 -0
- package/dist/update-retained.js +116 -0
- package/dist/update-retained.js.map +1 -0
- package/dist/update-rollback.d.ts +74 -0
- package/dist/update-rollback.js +221 -0
- package/dist/update-rollback.js.map +1 -0
- package/dist/update-settings.d.ts +63 -0
- package/dist/update-settings.js +162 -0
- package/dist/update-settings.js.map +1 -0
- package/dist/update-snapshot-manifest.d.ts +32 -0
- package/dist/update-snapshot-manifest.js +65 -0
- package/dist/update-snapshot-manifest.js.map +1 -0
- package/dist/update-snapshot-scope.d.ts +67 -0
- package/dist/update-snapshot-scope.js +173 -0
- package/dist/update-snapshot-scope.js.map +1 -0
- package/dist/update-snapshot.d.ts +34 -0
- package/dist/update-snapshot.js +246 -0
- package/dist/update-snapshot.js.map +1 -0
- package/dist/update-writers.d.ts +71 -0
- package/dist/update-writers.js +235 -0
- package/dist/update-writers.js.map +1 -0
- package/dist/web-api.d.ts +3 -0
- package/dist/web-api.js +43 -8
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +7 -0
- package/dist/web-chat-history.js +15 -0
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-icons.d.ts +11 -0
- package/dist/web-icons.js +14 -2
- package/dist/web-icons.js.map +1 -1
- package/dist/web-mentions.d.ts +27 -8
- package/dist/web-mentions.js +108 -1
- package/dist/web-mentions.js.map +1 -1
- package/dist/web-office-acts.js +3 -0
- package/dist/web-office-acts.js.map +1 -1
- package/dist/web-preview.d.ts +5 -0
- package/dist/web-preview.js +1 -1
- package/dist/web-preview.js.map +1 -1
- package/dist/web-update.d.ts +6 -0
- package/dist/windows-agents.d.ts +12 -0
- package/dist/windows-agents.js +5 -0
- package/dist/windows-agents.js.map +1 -1
- package/launcher/agend +4 -1
- package/launcher/agend-agent +4 -1
- package/launcher/agend-install.cjs +16 -8
- package/launcher/install-admission.d.cts +8 -0
- package/launcher/npm-allow-scripts.cjs +72 -0
- package/launcher/npm-global-prefix.cjs +81 -0
- package/launcher/postinstall.cjs +9 -8
- package/launcher/runtime-select.cjs +8 -2
- package/package.json +4 -3
- package/scripts/preinstall-guard.cjs +1 -1
package/dist/daemon.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ReplyDraft } from "./reply-draft.js";
|
|
2
|
+
import { requireRequestContextPolicy } from "./request-context-policy.js";
|
|
3
|
+
import { RequestContextReferenceMap } from "./request-context-fence.js";
|
|
1
4
|
import { managedClaudeBinding } from "./claude-credential-launch.js";
|
|
2
5
|
import { HUB_REPORT_TARGET } from "./hub-report-target.js";
|
|
3
6
|
import { atomicWriteFileSync } from "./atomic-write.js";
|
|
@@ -60,6 +63,7 @@ import { ContextGuardian } from "./context-guardian.js";
|
|
|
60
63
|
import { IpcServer } from "./channel/ipc-bridge.js";
|
|
61
64
|
import { daemonBudgetMs } from "./channel/ipc-timeouts.js";
|
|
62
65
|
import { MessageBus } from "./channel/message-bus.js";
|
|
66
|
+
import { captureRequestContextCall } from "./request-context-call.js";
|
|
63
67
|
import { shellQuote, KiroCompatibilityError, UnsupportedCliError, ResumeBlockedError } from "./backend/types.js";
|
|
64
68
|
import { getTmuxSession } from "./config.js";
|
|
65
69
|
import { routeToolCall } from "./channel/tool-router.js";
|
|
@@ -2365,10 +2369,121 @@ export class Daemon extends EventEmitter {
|
|
|
2365
2369
|
return classicGuardInventory(status.state === "ready" && this.processStatus !== "running"
|
|
2366
2370
|
? { state: "restart-required", backend, reason: "not-running" } : status);
|
|
2367
2371
|
}
|
|
2372
|
+
/** Internal local-lifecycle port only. No config, IPC or MCP setter; production stays unbound until cutover. */
|
|
2373
|
+
requestContextLifecycle;
|
|
2374
|
+
requestContextWrite;
|
|
2375
|
+
requestContextPolicy;
|
|
2376
|
+
bindRequestContextPolicy(policy) { if (this.requestContextPolicy || !this.requestContextLifecycle)
|
|
2377
|
+
throw Error("request-context policy requires its owned turn binding"); this.requestContextPolicy = policy; }
|
|
2378
|
+
requestContextCalls = new RequestContextReferenceMap(call => call.admission.coverage === "covered" ? call.admission.lease.snapshot.context.ref.rootContextId : null, call => `local-call:${call.id}`);
|
|
2379
|
+
requestContextInterruptedLaunch;
|
|
2380
|
+
requestContextLaunch() { return JSON.stringify([this.bootId, this.spawnGeneration, this.nativePaneLifecycle?.snapshot?.()?.launchId ?? null]); }
|
|
2381
|
+
/** First local owned hop only. No lookup at a later Fleet receipt may retag this call. */
|
|
2382
|
+
beginRequestContextCall(socket) {
|
|
2383
|
+
if (!this.requestContextLifecycle)
|
|
2384
|
+
return;
|
|
2385
|
+
if (this.requestContextCalls.size >= 128)
|
|
2386
|
+
throw Error("Request context call admission backlog");
|
|
2387
|
+
const launch = this.requestContextLaunch();
|
|
2388
|
+
const snapshot = socket && this.socketSessionNames.get(socket) === this.name ? this.requestContextTurnSnapshot() : null;
|
|
2389
|
+
const reason = this.requestContextInterruptedLaunch === launch ? "interrupted-launch" : "unbound-input";
|
|
2390
|
+
const admission = snapshot && reason !== "interrupted-launch"
|
|
2391
|
+
? { coverage: "covered", lease: captureRequestContextCall(snapshot, captured => this.requestContextTurnCurrent(captured)) }
|
|
2392
|
+
: { coverage: "not-covered", reason };
|
|
2393
|
+
const call = Object.freeze({ id: randomUUID(), admission: Object.freeze(admission),
|
|
2394
|
+
current: () => !this.deliveryWritesStopping && this.requestContextLaunch() === launch
|
|
2395
|
+
&& (admission.coverage !== "covered" || admission.lease.current()) });
|
|
2396
|
+
this.requestContextCalls.set(call.id, call);
|
|
2397
|
+
return call;
|
|
2398
|
+
}
|
|
2399
|
+
/** Internal Fleet accessor, paired with the current daemon/IPC connection; returns original scope or nothing. */
|
|
2400
|
+
requestContextCall(callId) {
|
|
2401
|
+
const call = this.requestContextCalls.get(callId);
|
|
2402
|
+
return call?.current() ? call : null;
|
|
2403
|
+
}
|
|
2404
|
+
requestContextCallsRequired() { return this.requestContextLifecycle !== undefined; }
|
|
2405
|
+
get requestContextCallDrainRevision() { return this.requestContextCalls.revision; }
|
|
2406
|
+
requestContextCallDrainView(rootId) { return this.requestContextCalls.view(rootId); }
|
|
2407
|
+
requestContextTurnDrainView(rootId) { return this.requestContextLifecycle?.turns.drainView(rootId) ?? null; }
|
|
2408
|
+
get requestContextTurnDrainRevision() { return this.requestContextLifecycle?.turns.drainRevision ?? "unavailable"; }
|
|
2409
|
+
handleOwnedToolCall(message, socket) {
|
|
2410
|
+
let call;
|
|
2411
|
+
try {
|
|
2412
|
+
call = this.beginRequestContextCall(socket);
|
|
2413
|
+
this.handleToolCall(message, socket, undefined, call);
|
|
2414
|
+
}
|
|
2415
|
+
catch {
|
|
2416
|
+
if (call)
|
|
2417
|
+
this.requestContextCalls.delete(call.id);
|
|
2418
|
+
this.ipcServer?.send(socket, { requestId: message.requestId, result: null, error: "Request context call admission is unavailable" });
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
setRequestContextLocalLifecycle(turns, identity) {
|
|
2422
|
+
if (this.tmux || this.ipcServer || this.requestContextLifecycle || this.nativePaneLifecycle && !this.nativePaneLifecycle.requestContextAvailable?.())
|
|
2423
|
+
throw Error("Request context must be bound before a supported daemon startup");
|
|
2424
|
+
this.requestContextCalls.installRegistration(turns.registrationGate ?? undefined);
|
|
2425
|
+
this.requestContextLifecycle = { turns, identity };
|
|
2426
|
+
}
|
|
2427
|
+
requestContextOwner() {
|
|
2428
|
+
const lifecycle = this.requestContextLifecycle;
|
|
2429
|
+
return lifecycle ? { ...lifecycle.identity(), instance: this.name, daemonBootId: this.bootId,
|
|
2430
|
+
spawnGeneration: this.spawnGeneration, launchFenceEpoch: this.launchFenceEpoch, deliveryEpoch: this.deliveryEpoch } : null;
|
|
2431
|
+
}
|
|
2432
|
+
requestContextTurnSnapshot() {
|
|
2433
|
+
const owner = this.requestContextOwner();
|
|
2434
|
+
return owner ? this.requestContextLifecycle.turns.current(owner) : null;
|
|
2435
|
+
}
|
|
2436
|
+
requestContextTurnCurrent(snapshot) {
|
|
2437
|
+
const owner = this.requestContextOwner();
|
|
2438
|
+
return !!owner && this.requestContextLifecycle.turns.isCurrent(snapshot, owner);
|
|
2439
|
+
}
|
|
2440
|
+
bindRequestContextWrite(inputId, text, queued, recovery) {
|
|
2441
|
+
const owner = this.requestContextOwner();
|
|
2442
|
+
if (!owner)
|
|
2443
|
+
return;
|
|
2444
|
+
// Ordinary queues are never evidence of consumption. Only a proven steer can join the EXISTING turn.
|
|
2445
|
+
if (queued && recovery)
|
|
2446
|
+
throw Error("request-context queued input consumption is not covered yet");
|
|
2447
|
+
if (recovery && !recovery.current())
|
|
2448
|
+
throw Error("request-context recovery job is no longer current");
|
|
2449
|
+
const previous = this.requestContextTurnSnapshot();
|
|
2450
|
+
const snapshot = queued ? this.requestContextLifecycle.turns.beforeQueuedSteer(inputId, deliveryContentDigest(text), owner)
|
|
2451
|
+
: recovery ? this.requestContextLifecycle.turns.beforeRecoveryWrite(recovery.inputId, deliveryContentDigest(text), owner, recovery.parent)
|
|
2452
|
+
: this.requestContextLifecycle.turns.beforeWrite(inputId, deliveryContentDigest(text), owner);
|
|
2453
|
+
try {
|
|
2454
|
+
this.nativePaneLifecycle?.stageRequestContext?.(snapshot, deliveryContentDigest(text), () => this.requestContextTurnCurrent(snapshot), this.requestContextInterruptedLaunch === this.requestContextLaunch());
|
|
2455
|
+
}
|
|
2456
|
+
catch (error) {
|
|
2457
|
+
if (snapshot !== previous)
|
|
2458
|
+
this.requestContextLifecycle.turns.ended(snapshot, owner);
|
|
2459
|
+
throw error;
|
|
2460
|
+
}
|
|
2461
|
+
if (this.requestContextWrite?.snapshot.token !== snapshot.token) {
|
|
2462
|
+
const id = snapshot.inputId;
|
|
2463
|
+
const humanId = id.startsWith("human:") ? id.slice(6) : null;
|
|
2464
|
+
const deliveryId = /^delivery:([^:]+):[0-9]+$/.exec(id)?.[1];
|
|
2465
|
+
const endAnchor = !!humanId && /^[A-Za-z0-9_-]+$/.test(humanId) && text.split("\n").some(line => line.startsWith(`[hid:${humanId}]`) || line.startsWith(`[agend-human-id:${humanId}]`))
|
|
2466
|
+
|| !!deliveryId && text.startsWith(`[agend-delivery-id:${deliveryId}]\n`)
|
|
2467
|
+
|| /^[A-Za-z0-9:_-]+$/.test(id) && text.startsWith(`[agend-request-input:${id}]\n`);
|
|
2468
|
+
this.requestContextWrite = { snapshot, text, at: Date.now(), ledger: new TranscriptTurnLedger(), endAnchor };
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
settleRequestContextFromTranscript() {
|
|
2472
|
+
const write = this.requestContextWrite, owner = this.requestContextOwner();
|
|
2473
|
+
if (!write || !write.endAnchor || !owner || !this.requestContextLifecycle.turns.isCurrent(write.snapshot, owner))
|
|
2474
|
+
return;
|
|
2475
|
+
const verdict = write.ledger.verdict(write.text, write.at);
|
|
2476
|
+
if (verdict === "ended" || verdict === "aborted" || verdict === "error") {
|
|
2477
|
+
if (verdict !== "ended")
|
|
2478
|
+
this.requestContextInterruptedLaunch = this.requestContextLaunch();
|
|
2479
|
+
this.requestContextLifecycle.turns.ended(write.snapshot, owner);
|
|
2480
|
+
this.requestContextWrite = undefined;
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2368
2483
|
/** Internal lifecycle injection, before start. Native paths and provider files stay on their runner. */
|
|
2369
2484
|
setNativePaneLifecycle(native) {
|
|
2370
|
-
if (this.tmux || this.ipcServer || this.nativePaneLifecycle)
|
|
2371
|
-
throw Error("Native pane adapter must be bound before daemon startup");
|
|
2485
|
+
if (this.tmux || this.ipcServer || this.nativePaneLifecycle || this.requestContextLifecycle && !native.requestContextAvailable?.())
|
|
2486
|
+
throw Error("Native pane adapter must be bound before daemon startup with a supported request-context producer");
|
|
2372
2487
|
this.nativePaneLifecycle = native;
|
|
2373
2488
|
this.backend = native.backend;
|
|
2374
2489
|
this.paneTransport = native.host;
|
|
@@ -2420,6 +2535,7 @@ export class Daemon extends EventEmitter {
|
|
|
2420
2535
|
// deliberately NOT hooked: stop/spawn abandon the in-memory turn while
|
|
2421
2536
|
// the on-disk interruption must survive for the resume gate.
|
|
2422
2537
|
this.turnReplyGuard.onComplete = () => {
|
|
2538
|
+
this.replyDraft.reset();
|
|
2423
2539
|
clearInFlightTurnMarker(this.instanceDir);
|
|
2424
2540
|
this.publishWorkingState("turn_closed");
|
|
2425
2541
|
};
|
|
@@ -2508,6 +2624,9 @@ export class Daemon extends EventEmitter {
|
|
|
2508
2624
|
return;
|
|
2509
2625
|
this.deliveryWritesStopping = true;
|
|
2510
2626
|
this.deliveryEpoch++;
|
|
2627
|
+
this.replyDraft.reset();
|
|
2628
|
+
this.requestContextLifecycle?.turns.fence();
|
|
2629
|
+
this.requestContextCalls.clear();
|
|
2511
2630
|
}
|
|
2512
2631
|
/** Bounded drain: timeout remains safe because Enter has a write-ahead fence. */
|
|
2513
2632
|
waitForDeliveryWritesToDrain(timeoutMs) {
|
|
@@ -3323,7 +3442,7 @@ export class Daemon extends EventEmitter {
|
|
|
3323
3442
|
this.ipcServer.on("message", (msg, socket) => {
|
|
3324
3443
|
if (msg.type === "tool_call") {
|
|
3325
3444
|
// MCP server forwarding a Claude tool call (reply, react, edit, download)
|
|
3326
|
-
this.
|
|
3445
|
+
this.handleOwnedToolCall(msg, socket);
|
|
3327
3446
|
}
|
|
3328
3447
|
else if (msg.type === "mcp_ready") {
|
|
3329
3448
|
this.handleMcpReady(msg, socket);
|
|
@@ -5221,7 +5340,7 @@ export class Daemon extends EventEmitter {
|
|
|
5221
5340
|
const screen = await tmux.capturePane().catch(() => null);
|
|
5222
5341
|
if (screen === null)
|
|
5223
5342
|
return;
|
|
5224
|
-
await tmux.sendSpecialKey(cancelKey, undefined, { kind: "dialog", screen });
|
|
5343
|
+
await tmux.sendSpecialKey(cancelKey, undefined, { kind: "dialog", screen, cancelTurn: true });
|
|
5225
5344
|
return;
|
|
5226
5345
|
}
|
|
5227
5346
|
await tmux.sendSpecialKey(cancelKey);
|
|
@@ -5237,6 +5356,7 @@ export class Daemon extends EventEmitter {
|
|
|
5237
5356
|
// current human turn; leave already-forwarded tool requests to settle.
|
|
5238
5357
|
this.recoveryCancelled = true;
|
|
5239
5358
|
this.turnReplyGuard.cancelByUser();
|
|
5359
|
+
this.replyDraft.reset();
|
|
5240
5360
|
// #1241: a cancelled turn never confirms — its next edge completes it as
|
|
5241
5361
|
// intentional. Drop a pending confirmation so it cannot promote afterwards.
|
|
5242
5362
|
this.clearReplyGuardConfirm();
|
|
@@ -6248,6 +6368,7 @@ export class Daemon extends EventEmitter {
|
|
|
6248
6368
|
}
|
|
6249
6369
|
}
|
|
6250
6370
|
workingTurnDelivery = null;
|
|
6371
|
+
workingTurnRequestContext = null;
|
|
6251
6372
|
workingBackgroundObservation = null;
|
|
6252
6373
|
/** Pure metadata read: never discovers sessions, captures a pane or reads backend files. */
|
|
6253
6374
|
getWorkingStateObservation() {
|
|
@@ -6986,6 +7107,9 @@ export class Daemon extends EventEmitter {
|
|
|
6986
7107
|
// Its late success must not re-arm the turn that the user just cancelled.
|
|
6987
7108
|
if (!this.isDeliveryEpochCurrent(deliveryEpoch))
|
|
6988
7109
|
return;
|
|
7110
|
+
// New input, including a peer/system input, cannot inherit an earlier draft.
|
|
7111
|
+
// If its transcript was already polled before paste confirmation, prefer a generic recovery.
|
|
7112
|
+
this.replyDraft.reset();
|
|
6989
7113
|
// Channel turns started by a person. Cross-instance, schedules (silent or
|
|
6990
7114
|
// not), and AgEnD system notices must not expect a reply to a person (#2544):
|
|
6991
7115
|
// a proxy or recovery notice would land in the last USER topic, or flag a
|
|
@@ -7019,6 +7143,8 @@ export class Daemon extends EventEmitter {
|
|
|
7019
7143
|
}, this.pendingWork.lastInboundTimestamp());
|
|
7020
7144
|
const armed = this.turnReplyGuard.snapshot();
|
|
7021
7145
|
this.workingTurnDelivery = { generation: armed.generation, deliveryId: meta.delivery_id || null };
|
|
7146
|
+
const requestContext = this.requestContextTurnSnapshot();
|
|
7147
|
+
this.workingTurnRequestContext = requestContext ? { generation: armed.generation, snapshot: requestContext } : null;
|
|
7022
7148
|
this.publishWorkingState("turn_started");
|
|
7023
7149
|
// #1209: persist the in-flight turn with a seam checkpoint. A marker
|
|
7024
7150
|
// that survives a restart is an interrupted turn by construction —
|
|
@@ -7537,6 +7663,7 @@ export class Daemon extends EventEmitter {
|
|
|
7537
7663
|
}
|
|
7538
7664
|
buildTranscriptMonitor(source) {
|
|
7539
7665
|
this.followLog.reset();
|
|
7666
|
+
this.replyDraft.reset();
|
|
7540
7667
|
const modelLaunch = this.backend?.modelObservationLaunch?.();
|
|
7541
7668
|
const monitor = new TranscriptMonitor(this.instanceDir, this.logger, source, () => modelLaunch);
|
|
7542
7669
|
let savedModel;
|
|
@@ -7594,6 +7721,20 @@ export class Daemon extends EventEmitter {
|
|
|
7594
7721
|
if (changed)
|
|
7595
7722
|
this.emit("model_observation");
|
|
7596
7723
|
});
|
|
7724
|
+
monitor.on("reply_draft_record", (entry) => {
|
|
7725
|
+
if (this.transcriptMonitor === monitor && owner === launchIdentity(this.interactionOwner())) {
|
|
7726
|
+
const turn = this.turnReplyGuard?.snapshot();
|
|
7727
|
+
if (turn)
|
|
7728
|
+
this.replyDraft.observe(entry, turn.generation);
|
|
7729
|
+
else
|
|
7730
|
+
this.replyDraft.reset();
|
|
7731
|
+
}
|
|
7732
|
+
});
|
|
7733
|
+
for (const event of ["reset", "workspace_reset", "context_reset"])
|
|
7734
|
+
monitor.on(event, () => {
|
|
7735
|
+
if (this.transcriptMonitor === monitor)
|
|
7736
|
+
this.replyDraft.reset();
|
|
7737
|
+
});
|
|
7597
7738
|
this.transcriptTurns.reset();
|
|
7598
7739
|
this.transcriptActivityAt = 0;
|
|
7599
7740
|
// Monotonic: a wall-clock correction must neither end nor extend the open-turn hold (#1641 R1).
|
|
@@ -7601,6 +7742,10 @@ export class Daemon extends EventEmitter {
|
|
|
7601
7742
|
monitor.on("turns", (turns) => {
|
|
7602
7743
|
this.transcriptTurns.observe(turns, performance.now());
|
|
7603
7744
|
touch();
|
|
7745
|
+
if (this.transcriptMonitor === monitor && owner === launchIdentity(this.interactionOwner())) {
|
|
7746
|
+
this.requestContextWrite?.ledger.observe(turns, performance.now());
|
|
7747
|
+
this.settleRequestContextFromTranscript();
|
|
7748
|
+
}
|
|
7604
7749
|
});
|
|
7605
7750
|
// #3160: the files this turn reads, edits and searches, for the Files & changes panel's Follow (a few string checks;
|
|
7606
7751
|
// nothing is read from disk until someone asks). Claude's turn boundary is its next prompt.
|
|
@@ -7727,8 +7872,13 @@ export class Daemon extends EventEmitter {
|
|
|
7727
7872
|
message: formatReplyDropDetection(turn, reason),
|
|
7728
7873
|
});
|
|
7729
7874
|
}
|
|
7875
|
+
_replyDraft;
|
|
7876
|
+
/** Also supports existing prototype-based lifecycle harnesses without constructor state. */
|
|
7877
|
+
get replyDraft() { return this._replyDraft ??= new ReplyDraft(); }
|
|
7730
7878
|
queueReplyRecoveryPrompt(turn) {
|
|
7731
7879
|
const deliveryEpoch = this.deliveryEpoch;
|
|
7880
|
+
const parent = this.workingTurnRequestContext?.generation === turn.generation ? this.workingTurnRequestContext.snapshot : null;
|
|
7881
|
+
const recoveryInputId = `reply-recovery:${this.bootId}:${turn.generation}:${deliveryEpoch}`;
|
|
7732
7882
|
this.pasteQueueDepth++;
|
|
7733
7883
|
this.pasteLock = this.pasteLock.then(async () => {
|
|
7734
7884
|
try {
|
|
@@ -7744,8 +7894,16 @@ export class Daemon extends EventEmitter {
|
|
|
7744
7894
|
});
|
|
7745
7895
|
return;
|
|
7746
7896
|
}
|
|
7747
|
-
|
|
7897
|
+
let prompt = REPLY_RECOVERY_PROMPT;
|
|
7898
|
+
try {
|
|
7899
|
+
prompt = this.replyDraft.recoveryPrompt(current, REPLY_RECOVERY_PROMPT);
|
|
7900
|
+
}
|
|
7901
|
+
catch { /* Draft evidence is best-effort; keep the existing generic recovery. */ }
|
|
7902
|
+
const recoveryText = parent && this.requestContextLifecycle ? `[agend-request-input:${recoveryInputId}]\n${prompt}` : prompt;
|
|
7903
|
+
const delivered = await this.deliverMessage(recoveryText, undefined, {
|
|
7748
7904
|
deliveryEpoch,
|
|
7905
|
+
...(parent ? { requestContextRecovery: { inputId: recoveryInputId, parent,
|
|
7906
|
+
current: () => !!this.currentReplyRecovery(turn.generation, deliveryEpoch) } } : {}),
|
|
7749
7907
|
});
|
|
7750
7908
|
if (!this.currentReplyRecovery(turn.generation, deliveryEpoch))
|
|
7751
7909
|
return;
|
|
@@ -9348,7 +9506,7 @@ export class Daemon extends EventEmitter {
|
|
|
9348
9506
|
// M-3660: a Hub question is never handed into a running turn (Claude would merge it into that turn's work), and while
|
|
9349
9507
|
// a Hub answer turn runs, nothing else is handed into it: each waits for the idle pane and becomes a turn of its own.
|
|
9350
9508
|
const exclusiveTurn = opts?.hubQuestion !== undefined || this.hubAnswerTurnMayRun();
|
|
9351
|
-
const handOffEligible = !exclusiveTurn && !!(supportsQueuedInput || opts?.steer || composerQueue);
|
|
9509
|
+
const handOffEligible = !exclusiveTurn && (!this.requestContextLifecycle || opts?.steer === true) && !!(supportsQueuedInput || opts?.steer || composerQueue);
|
|
9352
9510
|
const handOffAdmissible = async () => (await this.probeBlockingDialog()).state === "clear"
|
|
9353
9511
|
&& await this.hasPositiveDeliveryInput(true)
|
|
9354
9512
|
&& ((!opts?.steer && !composerQueue) || (this.launchTakesSteer() && await this.steerComposerAdmits(false, opts?.steer === true)));
|
|
@@ -9529,10 +9687,27 @@ export class Daemon extends EventEmitter {
|
|
|
9529
9687
|
return stale();
|
|
9530
9688
|
if (residue !== "clear")
|
|
9531
9689
|
return this.failDelivery(verdict, status, "input-residue", residue);
|
|
9690
|
+
let newlyBound = null;
|
|
9532
9691
|
const written = await this.writeMessageToPane(formatted, windowId, handingOffToNativeQueue, status, opts?.submissionId, verdict, opts?.durableAttempt, opts?.steer === true, writeCurrent, opts?.humanVerificationId,
|
|
9533
9692
|
// M-3660: written into an idle pane, so whatever Hub answer turn ran is over; a Hub question begins its own.
|
|
9534
|
-
() => {
|
|
9535
|
-
|
|
9693
|
+
(wireText) => {
|
|
9694
|
+
const receiptId = opts?.humanMeta?.verification_id ?? opts?.humanVerificationId;
|
|
9695
|
+
const inputId = opts?.requestContextInputId ?? (receiptId ? `human:${receiptId}` : opts?.durableAttempt
|
|
9696
|
+
? `delivery:${opts.durableAttempt.deliveryId}:${opts.durableAttempt.attemptNo}` : null);
|
|
9697
|
+
const prior = this.requestContextTurnSnapshot();
|
|
9698
|
+
this.bindRequestContextWrite(inputId, wireText, handingOffToNativeQueue, opts?.requestContextRecovery);
|
|
9699
|
+
const after = this.requestContextTurnSnapshot();
|
|
9700
|
+
if (after && after !== prior)
|
|
9701
|
+
newlyBound = after;
|
|
9702
|
+
if (!handingOffToNativeQueue)
|
|
9703
|
+
this.hubAnswerTurnBegins(opts?.hubQuestion, opts?.hubContactLimit !== false);
|
|
9704
|
+
opts?.beforePaneWrite?.();
|
|
9705
|
+
}, opts?.lookBeforePaneWrite, opts?.humanMeta);
|
|
9706
|
+
if (written === false && newlyBound && this.nativePaneLifecycle?.lastInputWasNotSent?.()) {
|
|
9707
|
+
const owner = this.requestContextOwner();
|
|
9708
|
+
if (owner && this.requestContextLifecycle.turns.ended(newlyBound, owner))
|
|
9709
|
+
this.requestContextWrite = undefined;
|
|
9710
|
+
}
|
|
9536
9711
|
// #1690: still under the lock — whatever waits on it next must already see what this write started.
|
|
9537
9712
|
if (verdict.paneWriteStarted)
|
|
9538
9713
|
opts?.onPaneWritten?.();
|
|
@@ -11916,7 +12091,7 @@ export class Daemon extends EventEmitter {
|
|
|
11916
12091
|
return this.failDelivery(verdict, status, "paste", "pane-in-tmux-mode");
|
|
11917
12092
|
}
|
|
11918
12093
|
const pasteGeneration = this.spawnGeneration;
|
|
11919
|
-
beforePaste?.();
|
|
12094
|
+
beforePaste?.(formatted);
|
|
11920
12095
|
const pasted = await this.sendDeliveryPaste(formatted, nativeOwner);
|
|
11921
12096
|
if (!pasted && this.nativePaneLifecycle) {
|
|
11922
12097
|
// The native write attempt is retained as uncertain, including exhausted positive refusals. Never route an
|
|
@@ -13209,11 +13384,16 @@ export class Daemon extends EventEmitter {
|
|
|
13209
13384
|
const current = () => lease.current() && lease.allowed(input.tool, input.args) && !this.deliveryWritesStopping && fence === this.launchFenceEpoch;
|
|
13210
13385
|
return new Promise(resolve => {
|
|
13211
13386
|
let settled = false;
|
|
13387
|
+
let call;
|
|
13212
13388
|
const finish = (value) => { if (settled)
|
|
13213
|
-
return; settled = true;
|
|
13389
|
+
return; settled = true; if (call)
|
|
13390
|
+
this.requestContextCalls.delete(call.id); clearTimeout(timer); resolve(value); };
|
|
13214
13391
|
const timer = setTimeout(() => finish({ result: null, error: "Pane tool result is unconfirmed; inspect its operation before retrying" }), daemonBudgetMs(input.tool) + 1000);
|
|
13215
13392
|
timer.unref?.();
|
|
13216
13393
|
try {
|
|
13394
|
+
call = lease.requestContext ? Object.freeze({ id: randomUUID(), admission: lease.requestContext, current }) : undefined;
|
|
13395
|
+
if (call)
|
|
13396
|
+
this.requestContextCalls.set(call.id, call);
|
|
13217
13397
|
this.handleToolCall({ ...input, requestId: ++this.fleetRequestSeq }, undefined, {
|
|
13218
13398
|
current,
|
|
13219
13399
|
dispatch: (tool, args, respond) => {
|
|
@@ -13233,7 +13413,7 @@ export class Daemon extends EventEmitter {
|
|
|
13233
13413
|
...(typeof value.errorCode === "string" || typeof value.errorCode === "number" ? { errorCode: value.errorCode } : {}) });
|
|
13234
13414
|
return false;
|
|
13235
13415
|
},
|
|
13236
|
-
});
|
|
13416
|
+
}, call);
|
|
13237
13417
|
}
|
|
13238
13418
|
catch {
|
|
13239
13419
|
finish({ result: null, error: "Pane tool operation failed" });
|
|
@@ -13246,7 +13426,7 @@ export class Daemon extends EventEmitter {
|
|
|
13246
13426
|
return;
|
|
13247
13427
|
this.emit("mcp_tool_response_written", { operationId, daemonBootId: this.bootId });
|
|
13248
13428
|
}
|
|
13249
|
-
handleToolCall(msg, socket, peer) {
|
|
13429
|
+
handleToolCall(msg, socket, peer, originatingCall) {
|
|
13250
13430
|
const tool = msg.tool;
|
|
13251
13431
|
const args = (msg.args ?? {});
|
|
13252
13432
|
const requestId = msg.requestId;
|
|
@@ -13268,6 +13448,12 @@ export class Daemon extends EventEmitter {
|
|
|
13268
13448
|
: null;
|
|
13269
13449
|
// For now, log and respond. Full adapter routing will be wired in fleet manager.
|
|
13270
13450
|
const respond = (result, error, errorCode) => {
|
|
13451
|
+
if (originatingCall && !originatingCall.current()) {
|
|
13452
|
+
result = null;
|
|
13453
|
+
error = `Tool outcome is unconfirmed. ${operationId ? `Inspect operation ${operationId}` : "Inspect the tool operation status"}; do not repeat it.`;
|
|
13454
|
+
}
|
|
13455
|
+
if (originatingCall)
|
|
13456
|
+
this.requestContextCalls.delete(originatingCall.id);
|
|
13271
13457
|
// A message that verifiably went out stands down the dead-MCP proxy reply
|
|
13272
13458
|
// for this turn: the agent proved it can still speak for itself.
|
|
13273
13459
|
if (!error && result != null && TURN_OUTBOUND_TOOLS.has(tool)) {
|
|
@@ -13320,6 +13506,35 @@ export class Daemon extends EventEmitter {
|
|
|
13320
13506
|
this.emit("mcp_tool_response_written", { operationId, daemonBootId: this.bootId });
|
|
13321
13507
|
}
|
|
13322
13508
|
};
|
|
13509
|
+
const sendFleet = (message) => {
|
|
13510
|
+
if (originatingCall && !originatingCall.current()) {
|
|
13511
|
+
const id = String(message.fleetRequestId ?? ""), callback = this.pendingIpcRequests.get(id);
|
|
13512
|
+
this.pendingIpcRequests.delete(id);
|
|
13513
|
+
if (callback)
|
|
13514
|
+
callback({ error: "Originating request context is no longer current" });
|
|
13515
|
+
else
|
|
13516
|
+
respond(null, "Originating request context is no longer current");
|
|
13517
|
+
return;
|
|
13518
|
+
}
|
|
13519
|
+
this.broadcastFleetMessage(originatingCall ? { ...message, requestContextCallId: originatingCall.id, sourceDaemonBootId: this.bootId } : message);
|
|
13520
|
+
};
|
|
13521
|
+
try {
|
|
13522
|
+
if (this.requestContextPolicy)
|
|
13523
|
+
requireRequestContextPolicy(this, this.name, tool, args, originatingCall?.admission);
|
|
13524
|
+
}
|
|
13525
|
+
catch (error) {
|
|
13526
|
+
respond(null, error.message);
|
|
13527
|
+
return;
|
|
13528
|
+
}
|
|
13529
|
+
if (this.requestContextLifecycle && !peer && !originatingCall || originatingCall && !originatingCall.current()) {
|
|
13530
|
+
respond(null, "Originating request context is unavailable");
|
|
13531
|
+
return;
|
|
13532
|
+
}
|
|
13533
|
+
// These local shell mutations have no scoped admission boundary yet (F); never imply coverage.
|
|
13534
|
+
if (originatingCall && (tool === "checkout_repo" || tool === "release_repo")) {
|
|
13535
|
+
respond(null, "This operation is not covered by request-context admission");
|
|
13536
|
+
return;
|
|
13537
|
+
}
|
|
13323
13538
|
// Native Fleet/task operations carry their lease to the existing dispatcher mutation admission points.
|
|
13324
13539
|
if (peer?.dispatch?.(tool, args, respond))
|
|
13325
13540
|
return;
|
|
@@ -13351,7 +13566,7 @@ export class Daemon extends EventEmitter {
|
|
|
13351
13566
|
clearTimeout(timeout);
|
|
13352
13567
|
respond(respMsg.result, respMsg.error);
|
|
13353
13568
|
});
|
|
13354
|
-
|
|
13569
|
+
sendFleet({
|
|
13355
13570
|
type,
|
|
13356
13571
|
payload: args,
|
|
13357
13572
|
meta: { instance_name: this.name },
|
|
@@ -13377,7 +13592,7 @@ export class Daemon extends EventEmitter {
|
|
|
13377
13592
|
clearTimeout(timeout);
|
|
13378
13593
|
resolve({ result: respMsg.result, error: respMsg.error });
|
|
13379
13594
|
});
|
|
13380
|
-
|
|
13595
|
+
sendFleet({ type: WEB_THEME_IPC[tool], payload, meta: { instance_name: this.name }, fleetRequestId: fleetReqId });
|
|
13381
13596
|
});
|
|
13382
13597
|
void (async () => {
|
|
13383
13598
|
if (tool === "preview_web_appearance") {
|
|
@@ -13456,7 +13671,7 @@ export class Daemon extends EventEmitter {
|
|
|
13456
13671
|
clearTimeout(timeout);
|
|
13457
13672
|
resolve({ result: respMsg.result, error: respMsg.error });
|
|
13458
13673
|
});
|
|
13459
|
-
|
|
13674
|
+
sendFleet({
|
|
13460
13675
|
type: "fleet_task",
|
|
13461
13676
|
payload,
|
|
13462
13677
|
meta: { instance_name: this.name },
|
|
@@ -13489,7 +13704,7 @@ export class Daemon extends EventEmitter {
|
|
|
13489
13704
|
clearTimeout(timeout);
|
|
13490
13705
|
respond(respMsg.result, respMsg.error);
|
|
13491
13706
|
});
|
|
13492
|
-
|
|
13707
|
+
sendFleet({
|
|
13493
13708
|
type: typeMap[tool],
|
|
13494
13709
|
payload: args,
|
|
13495
13710
|
meta: { instance_name: this.name, working_directory: this.config.working_directory },
|
|
@@ -13516,7 +13731,7 @@ export class Daemon extends EventEmitter {
|
|
|
13516
13731
|
clearTimeout(timeout);
|
|
13517
13732
|
respond(respMsg.result, respMsg.error);
|
|
13518
13733
|
});
|
|
13519
|
-
|
|
13734
|
+
sendFleet({
|
|
13520
13735
|
type: typeMap[tool],
|
|
13521
13736
|
payload: args,
|
|
13522
13737
|
meta: {
|
|
@@ -13547,7 +13762,7 @@ export class Daemon extends EventEmitter {
|
|
|
13547
13762
|
clearTimeout(timeout);
|
|
13548
13763
|
respond(respMsg.result, respMsg.error);
|
|
13549
13764
|
});
|
|
13550
|
-
|
|
13765
|
+
sendFleet({
|
|
13551
13766
|
type: "fleet_outbound",
|
|
13552
13767
|
tool,
|
|
13553
13768
|
args,
|
|
@@ -13606,7 +13821,7 @@ export class Daemon extends EventEmitter {
|
|
|
13606
13821
|
// Register the waiter before broadcasting. A fast/mock adapter can settle
|
|
13607
13822
|
// immediately; broadcasting first left a response-before-registration
|
|
13608
13823
|
// window that degraded into a timeout despite a completed POST.
|
|
13609
|
-
|
|
13824
|
+
sendFleet({
|
|
13610
13825
|
type: "fleet_outbound",
|
|
13611
13826
|
tool,
|
|
13612
13827
|
args,
|