@songsid/agend 2.4.0-beta.23 → 2.4.0-beta.25
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-cli-instructions.md +4 -3
- package/dist/agent-cli.js +32 -2
- package/dist/agent-cli.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 +2 -2
- package/dist/agent-file-read.js.map +1 -1
- package/dist/agent-whats-new.js +11 -1
- package/dist/agent-whats-new.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/backend/antigravity.js +8 -6
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.d.ts +15 -0
- package/dist/backend/claude-code.js +25 -3
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/claude-mcp-carry.d.ts +63 -0
- package/dist/backend/claude-mcp-carry.js +242 -0
- package/dist/backend/claude-mcp-carry.js.map +1 -0
- 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 +7 -6
- 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 +17 -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 +46 -0
- package/dist/daemon.js +299 -33
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +8 -0
- package/dist/dashboard-permissions.js +8 -0
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-outbox.d.ts +56 -1
- package/dist/delivery-outbox.js +254 -22
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/fleet-context.d.ts +8 -0
- package/dist/fleet-lock.d.ts +67 -2
- package/dist/fleet-lock.js +236 -2
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +177 -6
- package/dist/fleet-manager.js +1203 -75
- 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/concepts/SKILL.md +22 -9
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +6 -0
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +7 -0
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +3 -3
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -1
- package/dist/general-knowledge/skills/task-board/SKILL.md +17 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +4 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +35 -7
- 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/compose/member.d.ts +5 -1
- package/dist/hub/compose/member.js +9 -5
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +1 -1
- package/dist/hub/member/room-ask.d.ts +5 -0
- package/dist/hub/member/room-ask.js +43 -16
- 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/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/representative.d.ts +7 -0
- package/dist/hub/representative.js +38 -5
- package/dist/hub/representative.js.map +1 -1
- 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/instance-lifecycle.d.ts +2 -0
- package/dist/instance-lifecycle.js +29 -1
- package/dist/instance-lifecycle.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 +170 -4
- 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-hub.d.ts +3 -0
- package/dist/needs-you-hub.js +31 -5
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +22 -1
- package/dist/needs-you.js +6 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/office-share.js +2 -1
- package/dist/office-share.js.map +1 -1
- package/dist/outbound-handlers.d.ts +12 -0
- package/dist/outbound-handlers.js +59 -8
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +3 -0
- package/dist/outbound-schemas.js +7 -5
- package/dist/outbound-schemas.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 +11 -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 +2452 -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 +83 -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-compatibility.d.ts +20 -0
- package/dist/request-context-compatibility.js +74 -0
- package/dist/request-context-compatibility.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-protocol.d.ts +137 -0
- package/dist/request-context-protocol.js +38 -0
- package/dist/request-context-protocol.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 +26 -0
- package/dist/request-context-store.js +144 -0
- package/dist/request-context-store.js.map +1 -0
- 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/db.js +26 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/scheduler.d.ts +6 -0
- package/dist/scheduler/scheduler.js +19 -1
- package/dist/scheduler/scheduler.js.map +1 -1
- package/dist/scheduler/task-board-text.d.ts +2 -0
- package/dist/scheduler/task-board-text.js +12 -0
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +106 -2
- package/dist/scheduler/task-board.js +248 -24
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/scheduler/task-files.d.ts +80 -0
- package/dist/scheduler/task-files.js +357 -0
- package/dist/scheduler/task-files.js.map +1 -0
- 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 +8 -0
- package/dist/settings-api.js +41 -1
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +1 -0
- package/dist/settings-baseline.js +1 -1
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +1 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +2 -0
- package/dist/settings-effect.js +5 -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/task-attach-client.d.ts +43 -0
- package/dist/task-attach-client.js +125 -0
- package/dist/task-attach-client.js.map +1 -0
- package/dist/task-board-tool.d.ts +12 -0
- package/dist/task-board-tool.js +107 -6
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-file-limits.d.ts +15 -0
- package/dist/task-file-limits.js +21 -0
- package/dist/task-file-limits.js.map +1 -0
- package/dist/tmux-binary.js +1 -1
- package/dist/tmux-binary.js.map +1 -1
- package/dist/tool-permissions.d.ts +32 -0
- package/dist/tool-permissions.js +63 -0
- package/dist/tool-permissions.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 +13 -0
- package/dist/ui/agent-details-settings.js +7 -5
- package/dist/ui/agent-who-can-use-strings.js +125 -0
- package/dist/ui/agent-who-can-use.js +238 -0
- package/dist/ui/chat-store.js +5 -4
- package/dist/ui/fleet-office-card.js +37 -6
- package/dist/ui/fleet-office-editor.js +5 -5
- package/dist/ui/fleet-office-pack.d.ts +10 -0
- package/dist/ui/fleet-office-pack.js +65 -2
- package/dist/ui/fleet-office-skin.js +75 -17
- package/dist/ui/fleet-office-store.js +33 -2
- package/dist/ui/fleet-office-vehicles.js +130 -0
- package/dist/ui/fleet-office-zones.js +13 -4
- package/dist/ui/fleet-office.js +245 -46
- package/dist/ui/fleet-task-activity.js +9 -82
- package/dist/ui/fleet-task-archive.js +111 -0
- package/dist/ui/fleet-task-card.js +6 -4
- package/dist/ui/fleet-task-common.js +2 -2
- package/dist/ui/fleet-task-edit.js +8 -1
- package/dist/ui/fleet-task-files.js +196 -0
- package/dist/ui/fleet-task-md.js +98 -0
- package/dist/ui/fleet-task-menu.js +1 -1
- package/dist/ui/fleet-task-stats.js +2 -2
- package/dist/ui/fleet-task-view.js +12 -8
- package/dist/ui/fleet-tasks.js +42 -18
- package/dist/ui/panel-chat.js +15 -2
- package/dist/ui/panel-details.js +3 -1
- package/dist/ui/panel-needs.js +25 -5
- package/dist/ui/panel-settings.js +37 -9
- package/dist/ui/settings-preview-address.js +156 -0
- package/dist/ui/settings-registry.js +3 -0
- package/dist/ui/settings-shared-strings.js +9 -0
- package/dist/ui/settings-shared.js +6 -1
- package/dist/ui/settings-strings.js +6 -6
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-needs.js +8 -1
- package/dist/ui/shared/app.css +131 -5
- package/dist/ui/shared/chat-strings.js +10 -6
- package/dist/ui/shared/chat-thread.js +7 -1
- package/dist/ui/shared/preview-panel.js +1 -1
- package/dist/ui/shared/preview.js +11 -2
- package/dist/ui/shared/task-board.css +64 -0
- package/dist/ui/shared/tokens.css +18 -3
- package/dist/ui/shared/ui-confirm.js +5 -4
- 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-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 +73 -0
- package/dist/update-forward.js +283 -0
- package/dist/update-forward.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 +351 -0
- package/dist/update-journal.js +717 -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 +75 -0
- package/dist/update-package-restore.js +318 -0
- package/dist/update-package-restore.js.map +1 -0
- package/dist/update-quiescence.d.ts +192 -0
- package/dist/update-quiescence.js +330 -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 +124 -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 +58 -0
- package/dist/update-recovery/runner.js +196 -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 +44 -0
- package/dist/update-restore.js +355 -0
- package/dist/update-restore.js.map +1 -0
- package/dist/update-retained.d.ts +38 -0
- package/dist/update-retained.js +91 -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 +36 -0
- package/dist/update-settings.js +122 -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 +172 -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 +6 -0
- package/dist/web-api.js +140 -22
- 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-office-acts.d.ts +16 -0
- package/dist/web-office-acts.js +27 -9
- package/dist/web-office-acts.js.map +1 -1
- package/dist/web-office-pack-read.js +1 -1
- package/dist/web-office-pack-read.js.map +1 -1
- package/dist/web-office-skins.d.ts +5 -3
- package/dist/web-office-skins.js +20 -16
- package/dist/web-office-skins.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-settings-patch.d.ts +27 -0
- package/dist/web-settings-patch.js +67 -0
- package/dist/web-settings-patch.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/dist/workflow-templates/default.md +1 -0
- 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 +3 -2
- 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";
|
|
@@ -50,6 +53,7 @@ import { legacyTmuxSocket, tmuxSocket } from "./tmux-binary.js";
|
|
|
50
53
|
import { migrateLegacyWindow, tagWindowId } from "./tmux-legacy.js";
|
|
51
54
|
import { scopedFleetConfigEnvironment } from "./web-experimental.js";
|
|
52
55
|
import { readAgentFile } from "./agent-file-read.js";
|
|
56
|
+
import { sendTaskWrite } from "./task-attach-client.js";
|
|
53
57
|
import { ASSET_UPLOAD_MAX_BYTES, receivePreview, sendAssetInParts, writePreview } from "./web-asset-parts.js";
|
|
54
58
|
import { LOGIN_FLOWS } from "./login-flows.js";
|
|
55
59
|
import { ProgressAccumulator, isSearchProgram, summarizeProgress } from "./tool-progress.js";
|
|
@@ -59,6 +63,7 @@ import { ContextGuardian } from "./context-guardian.js";
|
|
|
59
63
|
import { IpcServer } from "./channel/ipc-bridge.js";
|
|
60
64
|
import { daemonBudgetMs } from "./channel/ipc-timeouts.js";
|
|
61
65
|
import { MessageBus } from "./channel/message-bus.js";
|
|
66
|
+
import { captureRequestContextCall } from "./request-context-call.js";
|
|
62
67
|
import { shellQuote, KiroCompatibilityError, UnsupportedCliError, ResumeBlockedError } from "./backend/types.js";
|
|
63
68
|
import { getTmuxSession } from "./config.js";
|
|
64
69
|
import { routeToolCall } from "./channel/tool-router.js";
|
|
@@ -91,7 +96,8 @@ import { CLI_RUNTIME_SWITCH, cliRunningVersion, cliSwitchAllowed } from "./backe
|
|
|
91
96
|
import { buildResumeContinuation, clearInFlightTurnMarker, consumeInFlightTurnMarker, decideTurnResume, normalizeResumeBackend, readResumeFingerprint, RESUME_BLOCKING_DELIVERY_STATES, writeInFlightTurnMarker, } from "./turn-resume.js";
|
|
92
97
|
import { codexLiveRowMatches } from "./backend/codex.js";
|
|
93
98
|
import { codexPackageProblemMessage } from "./backend/codex-package.js";
|
|
94
|
-
import { claudeConfigDirFor, claudeProfileConfigDir, claudeProjectKey, claudeSwitchDialog, claudeSwitchTargetMatches } from "./backend/claude-code.js";
|
|
99
|
+
import { claudeConfigDirFor, claudeJsonPath, claudeProfileConfigDir, claudeProjectKey, claudeSwitchDialog, claudeSwitchTargetMatches } from "./backend/claude-code.js";
|
|
100
|
+
import { checkClaudeMcpAtLaunch, dismissClaudeMcpMissing } from "./backend/claude-mcp-carry.js";
|
|
95
101
|
import { MuseBackend } from "./backend/muse.js";
|
|
96
102
|
import { BACKEND_LABELS, InteractionObservation, INTERACTION_CONFIRM_MS, sameInteractionOwner } from "./interaction-observation.js";
|
|
97
103
|
import { unrecognisedPromptShape } from "./unrecognised-prompt.js";
|
|
@@ -1999,6 +2005,42 @@ export class Daemon extends EventEmitter {
|
|
|
1999
2005
|
transcriptEventSeq = 0;
|
|
2000
2006
|
usageLimitErrorSeq = 0;
|
|
2001
2007
|
static MODEL_USAGE_LIMIT = CLAUDE_MODEL_USAGE_LIMIT;
|
|
2008
|
+
/** M-3749: the MCP servers missing since a profile switch — Needs you lists them until they are back or dismissed. */
|
|
2009
|
+
mcpMissingState = null;
|
|
2010
|
+
mcpMissing() {
|
|
2011
|
+
return this.mcpMissingState ? { ...this.mcpMissingState, names: [...this.mcpMissingState.names] } : null;
|
|
2012
|
+
}
|
|
2013
|
+
/** M-3749: a person dismissed the missing-MCP list (Needs you → Acknowledge). false: nothing was outstanding. */
|
|
2014
|
+
dismissMcpMissing() {
|
|
2015
|
+
dismissClaudeMcpMissing(this.instanceDir);
|
|
2016
|
+
if (!this.mcpMissingState)
|
|
2017
|
+
return false;
|
|
2018
|
+
this.mcpMissingState = null;
|
|
2019
|
+
this.emit("mcp_missing", { name: this.name, missing: null });
|
|
2020
|
+
return true;
|
|
2021
|
+
}
|
|
2022
|
+
/**
|
|
2023
|
+
* M-3749: at each Claude launch, the user/local-scope MCP servers it had before a credential-profile switch and does not
|
|
2024
|
+
* have now (outstanding until back or dismissed). Never fails a launch; names only, never an entry.
|
|
2025
|
+
*/
|
|
2026
|
+
checkClaudeMcpServers(backendConfig) {
|
|
2027
|
+
const before = this.mcpMissingState;
|
|
2028
|
+
this.mcpMissingState = null;
|
|
2029
|
+
if ((this.config.backend ?? "claude-code") === "claude-code") {
|
|
2030
|
+
try {
|
|
2031
|
+
const profileDir = claudeProfileConfigDir(backendConfig.backendOptions);
|
|
2032
|
+
this.mcpMissingState = checkClaudeMcpAtLaunch({ instanceDir: this.instanceDir, configDir: claudeConfigDirFor(profileDir),
|
|
2033
|
+
jsonPath: claudeJsonPath(profileDir), workingDirectory: this.config.working_directory });
|
|
2034
|
+
}
|
|
2035
|
+
catch (err) {
|
|
2036
|
+
this.logger.debug({ err }, "MCP server check at launch skipped");
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
if (this.mcpMissingState)
|
|
2040
|
+
this.logger.warn({ missing: this.mcpMissingState.names }, "MCP servers from the previous credential profile are not in this one");
|
|
2041
|
+
if (before || this.mcpMissingState)
|
|
2042
|
+
this.emit("mcp_missing", { name: this.name, missing: this.mcpMissing() });
|
|
2043
|
+
}
|
|
2002
2044
|
/** #2822: the usage-limit hold, while it lasts — Needs you lists it. */
|
|
2003
2045
|
usageHold() {
|
|
2004
2046
|
return this.usageLimitHold ? { ...this.usageLimitHold } : null;
|
|
@@ -2327,10 +2369,121 @@ export class Daemon extends EventEmitter {
|
|
|
2327
2369
|
return classicGuardInventory(status.state === "ready" && this.processStatus !== "running"
|
|
2328
2370
|
? { state: "restart-required", backend, reason: "not-running" } : status);
|
|
2329
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
|
+
}
|
|
2330
2483
|
/** Internal lifecycle injection, before start. Native paths and provider files stay on their runner. */
|
|
2331
2484
|
setNativePaneLifecycle(native) {
|
|
2332
|
-
if (this.tmux || this.ipcServer || this.nativePaneLifecycle)
|
|
2333
|
-
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");
|
|
2334
2487
|
this.nativePaneLifecycle = native;
|
|
2335
2488
|
this.backend = native.backend;
|
|
2336
2489
|
this.paneTransport = native.host;
|
|
@@ -2382,6 +2535,7 @@ export class Daemon extends EventEmitter {
|
|
|
2382
2535
|
// deliberately NOT hooked: stop/spawn abandon the in-memory turn while
|
|
2383
2536
|
// the on-disk interruption must survive for the resume gate.
|
|
2384
2537
|
this.turnReplyGuard.onComplete = () => {
|
|
2538
|
+
this.replyDraft.reset();
|
|
2385
2539
|
clearInFlightTurnMarker(this.instanceDir);
|
|
2386
2540
|
this.publishWorkingState("turn_closed");
|
|
2387
2541
|
};
|
|
@@ -2470,6 +2624,9 @@ export class Daemon extends EventEmitter {
|
|
|
2470
2624
|
return;
|
|
2471
2625
|
this.deliveryWritesStopping = true;
|
|
2472
2626
|
this.deliveryEpoch++;
|
|
2627
|
+
this.replyDraft.reset();
|
|
2628
|
+
this.requestContextLifecycle?.turns.fence();
|
|
2629
|
+
this.requestContextCalls.clear();
|
|
2473
2630
|
}
|
|
2474
2631
|
/** Bounded drain: timeout remains safe because Enter has a write-ahead fence. */
|
|
2475
2632
|
waitForDeliveryWritesToDrain(timeoutMs) {
|
|
@@ -3285,7 +3442,7 @@ export class Daemon extends EventEmitter {
|
|
|
3285
3442
|
this.ipcServer.on("message", (msg, socket) => {
|
|
3286
3443
|
if (msg.type === "tool_call") {
|
|
3287
3444
|
// MCP server forwarding a Claude tool call (reply, react, edit, download)
|
|
3288
|
-
this.
|
|
3445
|
+
this.handleOwnedToolCall(msg, socket);
|
|
3289
3446
|
}
|
|
3290
3447
|
else if (msg.type === "mcp_ready") {
|
|
3291
3448
|
this.handleMcpReady(msg, socket);
|
|
@@ -5183,7 +5340,7 @@ export class Daemon extends EventEmitter {
|
|
|
5183
5340
|
const screen = await tmux.capturePane().catch(() => null);
|
|
5184
5341
|
if (screen === null)
|
|
5185
5342
|
return;
|
|
5186
|
-
await tmux.sendSpecialKey(cancelKey, undefined, { kind: "dialog", screen });
|
|
5343
|
+
await tmux.sendSpecialKey(cancelKey, undefined, { kind: "dialog", screen, cancelTurn: true });
|
|
5187
5344
|
return;
|
|
5188
5345
|
}
|
|
5189
5346
|
await tmux.sendSpecialKey(cancelKey);
|
|
@@ -5199,6 +5356,7 @@ export class Daemon extends EventEmitter {
|
|
|
5199
5356
|
// current human turn; leave already-forwarded tool requests to settle.
|
|
5200
5357
|
this.recoveryCancelled = true;
|
|
5201
5358
|
this.turnReplyGuard.cancelByUser();
|
|
5359
|
+
this.replyDraft.reset();
|
|
5202
5360
|
// #1241: a cancelled turn never confirms — its next edge completes it as
|
|
5203
5361
|
// intentional. Drop a pending confirmation so it cannot promote afterwards.
|
|
5204
5362
|
this.clearReplyGuardConfirm();
|
|
@@ -6210,6 +6368,7 @@ export class Daemon extends EventEmitter {
|
|
|
6210
6368
|
}
|
|
6211
6369
|
}
|
|
6212
6370
|
workingTurnDelivery = null;
|
|
6371
|
+
workingTurnRequestContext = null;
|
|
6213
6372
|
workingBackgroundObservation = null;
|
|
6214
6373
|
/** Pure metadata read: never discovers sessions, captures a pane or reads backend files. */
|
|
6215
6374
|
getWorkingStateObservation() {
|
|
@@ -6948,6 +7107,9 @@ export class Daemon extends EventEmitter {
|
|
|
6948
7107
|
// Its late success must not re-arm the turn that the user just cancelled.
|
|
6949
7108
|
if (!this.isDeliveryEpochCurrent(deliveryEpoch))
|
|
6950
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();
|
|
6951
7113
|
// Channel turns started by a person. Cross-instance, schedules (silent or
|
|
6952
7114
|
// not), and AgEnD system notices must not expect a reply to a person (#2544):
|
|
6953
7115
|
// a proxy or recovery notice would land in the last USER topic, or flag a
|
|
@@ -6981,6 +7143,8 @@ export class Daemon extends EventEmitter {
|
|
|
6981
7143
|
}, this.pendingWork.lastInboundTimestamp());
|
|
6982
7144
|
const armed = this.turnReplyGuard.snapshot();
|
|
6983
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;
|
|
6984
7148
|
this.publishWorkingState("turn_started");
|
|
6985
7149
|
// #1209: persist the in-flight turn with a seam checkpoint. A marker
|
|
6986
7150
|
// that survives a restart is an interrupted turn by construction —
|
|
@@ -7499,6 +7663,7 @@ export class Daemon extends EventEmitter {
|
|
|
7499
7663
|
}
|
|
7500
7664
|
buildTranscriptMonitor(source) {
|
|
7501
7665
|
this.followLog.reset();
|
|
7666
|
+
this.replyDraft.reset();
|
|
7502
7667
|
const modelLaunch = this.backend?.modelObservationLaunch?.();
|
|
7503
7668
|
const monitor = new TranscriptMonitor(this.instanceDir, this.logger, source, () => modelLaunch);
|
|
7504
7669
|
let savedModel;
|
|
@@ -7556,6 +7721,20 @@ export class Daemon extends EventEmitter {
|
|
|
7556
7721
|
if (changed)
|
|
7557
7722
|
this.emit("model_observation");
|
|
7558
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
|
+
});
|
|
7559
7738
|
this.transcriptTurns.reset();
|
|
7560
7739
|
this.transcriptActivityAt = 0;
|
|
7561
7740
|
// Monotonic: a wall-clock correction must neither end nor extend the open-turn hold (#1641 R1).
|
|
@@ -7563,6 +7742,10 @@ export class Daemon extends EventEmitter {
|
|
|
7563
7742
|
monitor.on("turns", (turns) => {
|
|
7564
7743
|
this.transcriptTurns.observe(turns, performance.now());
|
|
7565
7744
|
touch();
|
|
7745
|
+
if (this.transcriptMonitor === monitor && owner === launchIdentity(this.interactionOwner())) {
|
|
7746
|
+
this.requestContextWrite?.ledger.observe(turns, performance.now());
|
|
7747
|
+
this.settleRequestContextFromTranscript();
|
|
7748
|
+
}
|
|
7566
7749
|
});
|
|
7567
7750
|
// #3160: the files this turn reads, edits and searches, for the Files & changes panel's Follow (a few string checks;
|
|
7568
7751
|
// nothing is read from disk until someone asks). Claude's turn boundary is its next prompt.
|
|
@@ -7689,8 +7872,13 @@ export class Daemon extends EventEmitter {
|
|
|
7689
7872
|
message: formatReplyDropDetection(turn, reason),
|
|
7690
7873
|
});
|
|
7691
7874
|
}
|
|
7875
|
+
_replyDraft;
|
|
7876
|
+
/** Also supports existing prototype-based lifecycle harnesses without constructor state. */
|
|
7877
|
+
get replyDraft() { return this._replyDraft ??= new ReplyDraft(); }
|
|
7692
7878
|
queueReplyRecoveryPrompt(turn) {
|
|
7693
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}`;
|
|
7694
7882
|
this.pasteQueueDepth++;
|
|
7695
7883
|
this.pasteLock = this.pasteLock.then(async () => {
|
|
7696
7884
|
try {
|
|
@@ -7706,8 +7894,16 @@ export class Daemon extends EventEmitter {
|
|
|
7706
7894
|
});
|
|
7707
7895
|
return;
|
|
7708
7896
|
}
|
|
7709
|
-
|
|
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, {
|
|
7710
7904
|
deliveryEpoch,
|
|
7905
|
+
...(parent ? { requestContextRecovery: { inputId: recoveryInputId, parent,
|
|
7906
|
+
current: () => !!this.currentReplyRecovery(turn.generation, deliveryEpoch) } } : {}),
|
|
7711
7907
|
});
|
|
7712
7908
|
if (!this.currentReplyRecovery(turn.generation, deliveryEpoch))
|
|
7713
7909
|
return;
|
|
@@ -9310,7 +9506,7 @@ export class Daemon extends EventEmitter {
|
|
|
9310
9506
|
// M-3660: a Hub question is never handed into a running turn (Claude would merge it into that turn's work), and while
|
|
9311
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.
|
|
9312
9508
|
const exclusiveTurn = opts?.hubQuestion !== undefined || this.hubAnswerTurnMayRun();
|
|
9313
|
-
const handOffEligible = !exclusiveTurn && !!(supportsQueuedInput || opts?.steer || composerQueue);
|
|
9509
|
+
const handOffEligible = !exclusiveTurn && (!this.requestContextLifecycle || opts?.steer === true) && !!(supportsQueuedInput || opts?.steer || composerQueue);
|
|
9314
9510
|
const handOffAdmissible = async () => (await this.probeBlockingDialog()).state === "clear"
|
|
9315
9511
|
&& await this.hasPositiveDeliveryInput(true)
|
|
9316
9512
|
&& ((!opts?.steer && !composerQueue) || (this.launchTakesSteer() && await this.steerComposerAdmits(false, opts?.steer === true)));
|
|
@@ -9491,10 +9687,27 @@ export class Daemon extends EventEmitter {
|
|
|
9491
9687
|
return stale();
|
|
9492
9688
|
if (residue !== "clear")
|
|
9493
9689
|
return this.failDelivery(verdict, status, "input-residue", residue);
|
|
9690
|
+
let newlyBound = null;
|
|
9494
9691
|
const written = await this.writeMessageToPane(formatted, windowId, handingOffToNativeQueue, status, opts?.submissionId, verdict, opts?.durableAttempt, opts?.steer === true, writeCurrent, opts?.humanVerificationId,
|
|
9495
9692
|
// M-3660: written into an idle pane, so whatever Hub answer turn ran is over; a Hub question begins its own.
|
|
9496
|
-
() => {
|
|
9497
|
-
|
|
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
|
+
}
|
|
9498
9711
|
// #1690: still under the lock — whatever waits on it next must already see what this write started.
|
|
9499
9712
|
if (verdict.paneWriteStarted)
|
|
9500
9713
|
opts?.onPaneWritten?.();
|
|
@@ -11878,7 +12091,7 @@ export class Daemon extends EventEmitter {
|
|
|
11878
12091
|
return this.failDelivery(verdict, status, "paste", "pane-in-tmux-mode");
|
|
11879
12092
|
}
|
|
11880
12093
|
const pasteGeneration = this.spawnGeneration;
|
|
11881
|
-
beforePaste?.();
|
|
12094
|
+
beforePaste?.(formatted);
|
|
11882
12095
|
const pasted = await this.sendDeliveryPaste(formatted, nativeOwner);
|
|
11883
12096
|
if (!pasted && this.nativePaneLifecycle) {
|
|
11884
12097
|
// The native write attempt is retained as uncertain, including exhausted positive refusals. Never route an
|
|
@@ -13171,11 +13384,16 @@ export class Daemon extends EventEmitter {
|
|
|
13171
13384
|
const current = () => lease.current() && lease.allowed(input.tool, input.args) && !this.deliveryWritesStopping && fence === this.launchFenceEpoch;
|
|
13172
13385
|
return new Promise(resolve => {
|
|
13173
13386
|
let settled = false;
|
|
13387
|
+
let call;
|
|
13174
13388
|
const finish = (value) => { if (settled)
|
|
13175
|
-
return; settled = true;
|
|
13389
|
+
return; settled = true; if (call)
|
|
13390
|
+
this.requestContextCalls.delete(call.id); clearTimeout(timer); resolve(value); };
|
|
13176
13391
|
const timer = setTimeout(() => finish({ result: null, error: "Pane tool result is unconfirmed; inspect its operation before retrying" }), daemonBudgetMs(input.tool) + 1000);
|
|
13177
13392
|
timer.unref?.();
|
|
13178
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);
|
|
13179
13397
|
this.handleToolCall({ ...input, requestId: ++this.fleetRequestSeq }, undefined, {
|
|
13180
13398
|
current,
|
|
13181
13399
|
dispatch: (tool, args, respond) => {
|
|
@@ -13195,7 +13413,7 @@ export class Daemon extends EventEmitter {
|
|
|
13195
13413
|
...(typeof value.errorCode === "string" || typeof value.errorCode === "number" ? { errorCode: value.errorCode } : {}) });
|
|
13196
13414
|
return false;
|
|
13197
13415
|
},
|
|
13198
|
-
});
|
|
13416
|
+
}, call);
|
|
13199
13417
|
}
|
|
13200
13418
|
catch {
|
|
13201
13419
|
finish({ result: null, error: "Pane tool operation failed" });
|
|
@@ -13208,7 +13426,7 @@ export class Daemon extends EventEmitter {
|
|
|
13208
13426
|
return;
|
|
13209
13427
|
this.emit("mcp_tool_response_written", { operationId, daemonBootId: this.bootId });
|
|
13210
13428
|
}
|
|
13211
|
-
handleToolCall(msg, socket, peer) {
|
|
13429
|
+
handleToolCall(msg, socket, peer, originatingCall) {
|
|
13212
13430
|
const tool = msg.tool;
|
|
13213
13431
|
const args = (msg.args ?? {});
|
|
13214
13432
|
const requestId = msg.requestId;
|
|
@@ -13230,6 +13448,12 @@ export class Daemon extends EventEmitter {
|
|
|
13230
13448
|
: null;
|
|
13231
13449
|
// For now, log and respond. Full adapter routing will be wired in fleet manager.
|
|
13232
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);
|
|
13233
13457
|
// A message that verifiably went out stands down the dead-MCP proxy reply
|
|
13234
13458
|
// for this turn: the agent proved it can still speak for itself.
|
|
13235
13459
|
if (!error && result != null && TURN_OUTBOUND_TOOLS.has(tool)) {
|
|
@@ -13282,6 +13506,35 @@ export class Daemon extends EventEmitter {
|
|
|
13282
13506
|
this.emit("mcp_tool_response_written", { operationId, daemonBootId: this.bootId });
|
|
13283
13507
|
}
|
|
13284
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
|
+
}
|
|
13285
13538
|
// Native Fleet/task operations carry their lease to the existing dispatcher mutation admission points.
|
|
13286
13539
|
if (peer?.dispatch?.(tool, args, respond))
|
|
13287
13540
|
return;
|
|
@@ -13313,7 +13566,7 @@ export class Daemon extends EventEmitter {
|
|
|
13313
13566
|
clearTimeout(timeout);
|
|
13314
13567
|
respond(respMsg.result, respMsg.error);
|
|
13315
13568
|
});
|
|
13316
|
-
|
|
13569
|
+
sendFleet({
|
|
13317
13570
|
type,
|
|
13318
13571
|
payload: args,
|
|
13319
13572
|
meta: { instance_name: this.name },
|
|
@@ -13339,7 +13592,7 @@ export class Daemon extends EventEmitter {
|
|
|
13339
13592
|
clearTimeout(timeout);
|
|
13340
13593
|
resolve({ result: respMsg.result, error: respMsg.error });
|
|
13341
13594
|
});
|
|
13342
|
-
|
|
13595
|
+
sendFleet({ type: WEB_THEME_IPC[tool], payload, meta: { instance_name: this.name }, fleetRequestId: fleetReqId });
|
|
13343
13596
|
});
|
|
13344
13597
|
void (async () => {
|
|
13345
13598
|
if (tool === "preview_web_appearance") {
|
|
@@ -13407,21 +13660,33 @@ export class Daemon extends EventEmitter {
|
|
|
13407
13660
|
return;
|
|
13408
13661
|
}
|
|
13409
13662
|
if (tool === TASK_TOOL) {
|
|
13410
|
-
|
|
13411
|
-
const
|
|
13412
|
-
this.
|
|
13413
|
-
|
|
13414
|
-
|
|
13415
|
-
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
|
|
13420
|
-
|
|
13421
|
-
|
|
13422
|
-
|
|
13423
|
-
|
|
13663
|
+
// One call to the fleet's task tool; resolves with its answer or an error string (never rejects).
|
|
13664
|
+
const askTask = (payload) => new Promise((resolve) => {
|
|
13665
|
+
const fleetReqId = `task_${++this.fleetRequestSeq}_${requestId}`;
|
|
13666
|
+
const timeout = setTimeout(() => {
|
|
13667
|
+
this.pendingIpcRequests.delete(fleetReqId);
|
|
13668
|
+
resolve({ error: `Task operation timed out after ${daemonBudgetMs(tool) / 1000}s` });
|
|
13669
|
+
}, daemonBudgetMs(tool));
|
|
13670
|
+
this.pendingIpcRequests.set(fleetReqId, (respMsg) => {
|
|
13671
|
+
clearTimeout(timeout);
|
|
13672
|
+
resolve({ result: respMsg.result, error: respMsg.error });
|
|
13673
|
+
});
|
|
13674
|
+
sendFleet({
|
|
13675
|
+
type: "fleet_task",
|
|
13676
|
+
payload,
|
|
13677
|
+
meta: { instance_name: this.name },
|
|
13678
|
+
fleetRequestId: fleetReqId,
|
|
13679
|
+
});
|
|
13424
13680
|
});
|
|
13681
|
+
// files named in `attach` are read HERE, on the agent's side (its working directory, no symlink, size-capped),
|
|
13682
|
+
// and staged on the fleet in parts; the write itself then carries their ids. The fleet never opens a workspace path.
|
|
13683
|
+
void (async () => {
|
|
13684
|
+
const sent = await sendTaskWrite(args, { workspace: this.config.working_directory, configuredWorkspace: this.config.working_directory, stateDir: getAgendHome(), instance: this.name }, askTask);
|
|
13685
|
+
if (sent.staging)
|
|
13686
|
+
respond(null, sent.error);
|
|
13687
|
+
else
|
|
13688
|
+
respond(sent.answer.result, sent.answer.error);
|
|
13689
|
+
})().catch((err) => respond(null, `task failed: ${err instanceof Error ? err.message : "error"}`));
|
|
13425
13690
|
return;
|
|
13426
13691
|
}
|
|
13427
13692
|
if (DECISION_TOOLS.has(tool)) {
|
|
@@ -13439,7 +13704,7 @@ export class Daemon extends EventEmitter {
|
|
|
13439
13704
|
clearTimeout(timeout);
|
|
13440
13705
|
respond(respMsg.result, respMsg.error);
|
|
13441
13706
|
});
|
|
13442
|
-
|
|
13707
|
+
sendFleet({
|
|
13443
13708
|
type: typeMap[tool],
|
|
13444
13709
|
payload: args,
|
|
13445
13710
|
meta: { instance_name: this.name, working_directory: this.config.working_directory },
|
|
@@ -13466,7 +13731,7 @@ export class Daemon extends EventEmitter {
|
|
|
13466
13731
|
clearTimeout(timeout);
|
|
13467
13732
|
respond(respMsg.result, respMsg.error);
|
|
13468
13733
|
});
|
|
13469
|
-
|
|
13734
|
+
sendFleet({
|
|
13470
13735
|
type: typeMap[tool],
|
|
13471
13736
|
payload: args,
|
|
13472
13737
|
meta: {
|
|
@@ -13497,7 +13762,7 @@ export class Daemon extends EventEmitter {
|
|
|
13497
13762
|
clearTimeout(timeout);
|
|
13498
13763
|
respond(respMsg.result, respMsg.error);
|
|
13499
13764
|
});
|
|
13500
|
-
|
|
13765
|
+
sendFleet({
|
|
13501
13766
|
type: "fleet_outbound",
|
|
13502
13767
|
tool,
|
|
13503
13768
|
args,
|
|
@@ -13556,7 +13821,7 @@ export class Daemon extends EventEmitter {
|
|
|
13556
13821
|
// Register the waiter before broadcasting. A fast/mock adapter can settle
|
|
13557
13822
|
// immediately; broadcasting first left a response-before-registration
|
|
13558
13823
|
// window that degraded into a timeout despite a completed POST.
|
|
13559
|
-
|
|
13824
|
+
sendFleet({
|
|
13560
13825
|
type: "fleet_outbound",
|
|
13561
13826
|
tool,
|
|
13562
13827
|
args,
|
|
@@ -15205,6 +15470,7 @@ export class Daemon extends EventEmitter {
|
|
|
15205
15470
|
this.resetInboundPresentation();
|
|
15206
15471
|
}
|
|
15207
15472
|
this.backend.preTrust?.(this.config.working_directory, backendConfig);
|
|
15473
|
+
this.checkClaudeMcpServers(backendConfig);
|
|
15208
15474
|
// Resolve working directory (e.g. symlink for hidden paths)
|
|
15209
15475
|
const resolvedCwd = this.backend.resolveWorkingDirectory?.(this.config.working_directory, this.name) ?? this.config.working_directory;
|
|
15210
15476
|
// Generate a fresh per-instance agent token each spawn. agent-cli reads
|