@songsid/agend 2.3.4-beta.7 → 2.3.5-alpha.3
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 +2 -0
- package/README.zh-TW.md +2 -0
- package/THIRD_PARTY_NOTICES.md +53 -0
- package/dist/agent-endpoint.d.ts +5 -1
- package/dist/agent-endpoint.js +12 -2
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/auth-api.d.ts +21 -0
- package/dist/auth-api.js +89 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/web-authority.d.ts +12 -2
- package/dist/authority/web-authority.js +25 -4
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/claude-code.d.ts +15 -12
- package/dist/backend/claude-code.js +152 -133
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex-package.d.ts +5 -2
- package/dist/backend/codex-package.js +1 -5
- package/dist/backend/codex-package.js.map +1 -1
- package/dist/backend/codex.d.ts +136 -113
- package/dist/backend/codex.js +1281 -1219
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok-model-cache.d.ts +7 -0
- package/dist/backend/grok-model-cache.js +65 -0
- package/dist/backend/grok-model-cache.js.map +1 -0
- package/dist/backend/grok.d.ts +2 -0
- package/dist/backend/grok.js +22 -0
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/native-pane.d.ts +9 -0
- package/dist/backend/native-pane.js +59 -0
- package/dist/backend/native-pane.js.map +1 -0
- package/dist/backend/types.d.ts +7 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/channel/ipc-bridge.d.ts +2 -0
- package/dist/channel/mcp-tools.js +1 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +71 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +16 -0
- package/dist/config.js.map +1 -1
- package/dist/daemon.d.ts +67 -5
- package/dist/daemon.js +823 -266
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-consumed-watch.d.ts +15 -3
- package/dist/delivery-consumed-watch.js +23 -1
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/delivery-outbox.d.ts +5 -0
- package/dist/delivery-outbox.js +32 -4
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/delivery-reconciliation.d.ts +2 -35
- package/dist/delivery-reconciliation.js +2 -156
- package/dist/delivery-reconciliation.js.map +1 -1
- package/dist/fleet-context.d.ts +2 -2
- package/dist/fleet-level-config.d.ts +1 -1
- package/dist/fleet-level-config.js +2 -0
- package/dist/fleet-level-config.js.map +1 -1
- package/dist/fleet-manager.d.ts +238 -3
- package/dist/fleet-manager.js +1826 -104
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +92 -0
- package/dist/fleet-windows-runtime.js +380 -0
- package/dist/fleet-windows-runtime.js.map +1 -0
- package/dist/general-binding.d.ts +85 -0
- package/dist/general-binding.js +298 -0
- package/dist/general-binding.js.map +1 -0
- package/dist/general-host-owner.d.ts +8 -0
- package/dist/general-host-owner.js +26 -0
- package/dist/general-host-owner.js.map +1 -0
- package/dist/general-instance.d.ts +7 -0
- package/dist/general-instance.js +20 -3
- package/dist/general-instance.js.map +1 -1
- package/dist/general-role.d.ts +5 -0
- package/dist/general-role.js +26 -0
- package/dist/general-role.js.map +1 -0
- package/dist/instance-config-impact.js +4 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +21 -3
- package/dist/instance-lifecycle.js +378 -162
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +2 -0
- package/dist/instructions.js +6 -0
- package/dist/instructions.js.map +1 -1
- package/dist/local-pane-endpoint.d.ts +46 -0
- package/dist/local-pane-endpoint.js +189 -0
- package/dist/local-pane-endpoint.js.map +1 -0
- package/dist/local-pane-launcher.d.ts +2 -0
- package/dist/local-pane-launcher.js +38 -0
- package/dist/local-pane-launcher.js.map +1 -0
- package/dist/local-pane-stage.ps1 +101 -0
- package/dist/locale.js +85 -0
- package/dist/locale.js.map +1 -1
- package/dist/model-catalog-defaults.d.ts +14 -0
- package/dist/model-catalog-defaults.js +20 -0
- package/dist/model-catalog-defaults.js.map +1 -0
- package/dist/native-agent-admission.d.ts +7 -0
- package/dist/native-agent-admission.js +26 -0
- package/dist/native-agent-admission.js.map +1 -0
- package/dist/native-daemon-client.d.ts +13 -0
- package/dist/native-daemon-client.js +28 -0
- package/dist/native-daemon-client.js.map +1 -0
- package/dist/native-instance-api.d.ts +14 -0
- package/dist/native-instance-api.js +205 -0
- package/dist/native-instance-api.js.map +1 -0
- package/dist/native-instance-input.d.ts +84 -0
- package/dist/native-instance-input.js +54 -0
- package/dist/native-instance-input.js.map +1 -0
- package/dist/native-instance-registry.d.ts +32 -0
- package/dist/native-instance-registry.js +105 -0
- package/dist/native-instance-registry.js.map +1 -0
- package/dist/native-mcp.d.ts +40 -0
- package/dist/native-mcp.js +278 -0
- package/dist/native-mcp.js.map +1 -0
- package/dist/native-model-catalog.d.ts +5 -0
- package/dist/native-model-catalog.js +76 -0
- package/dist/native-model-catalog.js.map +1 -0
- package/dist/native-pane-crash-budget.d.ts +20 -0
- package/dist/native-pane-crash-budget.js +60 -0
- package/dist/native-pane-crash-budget.js.map +1 -0
- package/dist/native-pane-create.d.ts +26 -0
- package/dist/native-pane-create.js +53 -0
- package/dist/native-pane-create.js.map +1 -0
- package/dist/native-pane-lifecycle.d.ts +65 -0
- package/dist/native-pane-lifecycle.js +230 -0
- package/dist/native-pane-lifecycle.js.map +1 -0
- package/dist/native-pane-manager.d.ts +59 -0
- package/dist/native-pane-manager.js +584 -0
- package/dist/native-pane-manager.js.map +1 -0
- package/dist/native-pane-output-log.d.ts +15 -0
- package/dist/native-pane-output-log.js +108 -0
- package/dist/native-pane-output-log.js.map +1 -0
- package/dist/native-pane-reconciliation.d.ts +4 -0
- package/dist/native-pane-reconciliation.js +40 -0
- package/dist/native-pane-reconciliation.js.map +1 -0
- package/dist/native-pane-recovery.d.ts +12 -0
- package/dist/native-pane-recovery.js +10 -0
- package/dist/native-pane-recovery.js.map +1 -0
- package/dist/native-pane-tools.d.ts +2 -0
- package/dist/native-pane-tools.js +14 -0
- package/dist/native-pane-tools.js.map +1 -0
- package/dist/needs-you-hub.d.ts +2 -0
- package/dist/needs-you-hub.js +2 -1
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +19 -1
- package/dist/needs-you.js +12 -2
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +16 -2
- package/dist/outbound-handlers.js +67 -3
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +38 -0
- package/dist/outbound-schemas.js +12 -0
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-port.d.ts +118 -0
- package/dist/pane-port.js +2 -0
- package/dist/pane-port.js.map +1 -0
- package/dist/public-web-gateway.js +9 -0
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +5 -0
- package/dist/public-web-link.js +4 -0
- package/dist/public-web-link.js.map +1 -1
- package/dist/quickstart-api.js +9 -5
- package/dist/quickstart-api.js.map +1 -1
- package/dist/quickstart.d.ts +1 -0
- package/dist/quickstart.js +4 -1
- package/dist/quickstart.js.map +1 -1
- package/dist/runtime-api.d.ts +8 -0
- package/dist/runtime-api.js +96 -0
- package/dist/runtime-api.js.map +1 -0
- package/dist/runtime-assets/@xterm/addon-serialize/LICENSE +21 -0
- package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.js +2 -0
- package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.mjs +19 -0
- package/dist/runtime-assets/@xterm/addon-serialize/package.json +29 -0
- package/dist/runtime-assets/@xterm/headless/LICENSE +21 -0
- package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.js +2 -0
- package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.mjs +46 -0
- package/dist/runtime-assets/@xterm/headless/package.json +29 -0
- package/dist/runtime-assets/node-pty/CONPTY-LICENSE +21 -0
- package/dist/runtime-assets/node-pty/CONPTY-NOTICE.md +503 -0
- package/dist/runtime-assets/node-pty/LICENSE +69 -0
- package/dist/runtime-assets/node-pty/lib/conpty_console_list_agent.js +16 -0
- package/dist/runtime-assets/node-pty/lib/eventEmitter2.js +47 -0
- package/dist/runtime-assets/node-pty/lib/index.js +52 -0
- package/dist/runtime-assets/node-pty/lib/interfaces.js +7 -0
- package/dist/runtime-assets/node-pty/lib/shared/conout.js +11 -0
- package/dist/runtime-assets/node-pty/lib/terminal.js +190 -0
- package/dist/runtime-assets/node-pty/lib/types.js +7 -0
- package/dist/runtime-assets/node-pty/lib/unixTerminal.js +346 -0
- package/dist/runtime-assets/node-pty/lib/utils.js +39 -0
- package/dist/runtime-assets/node-pty/lib/windowsConoutConnection.js +125 -0
- package/dist/runtime-assets/node-pty/lib/windowsPtyAgent.js +320 -0
- package/dist/runtime-assets/node-pty/lib/windowsTerminal.js +199 -0
- package/dist/runtime-assets/node-pty/lib/worker/conoutSocketWorker.js +22 -0
- package/dist/runtime-assets/node-pty/package.json +64 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty.node +0 -0
- package/dist/runtime-assets/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
- package/dist/runtime-bundle.d.ts +17 -0
- package/dist/runtime-bundle.js +150 -0
- package/dist/runtime-bundle.js.map +1 -0
- package/dist/runtime-cli.d.ts +2 -0
- package/dist/runtime-cli.js +117 -0
- package/dist/runtime-cli.js.map +1 -0
- package/dist/runtime-client-store.d.ts +49 -0
- package/dist/runtime-client-store.js +292 -0
- package/dist/runtime-client-store.js.map +1 -0
- package/dist/runtime-client.d.ts +100 -0
- package/dist/runtime-client.js +700 -0
- package/dist/runtime-client.js.map +1 -0
- package/dist/runtime-coordinator.d.ts +82 -0
- package/dist/runtime-coordinator.js +864 -0
- package/dist/runtime-coordinator.js.map +1 -0
- package/dist/runtime-general-protocol.d.ts +22 -0
- package/dist/runtime-general-protocol.js +57 -0
- package/dist/runtime-general-protocol.js.map +1 -0
- package/dist/runtime-general-workspace.d.ts +17 -0
- package/dist/runtime-general-workspace.js +213 -0
- package/dist/runtime-general-workspace.js.map +1 -0
- package/dist/runtime-pane-assets.d.ts +17 -0
- package/dist/runtime-pane-assets.js +23 -0
- package/dist/runtime-pane-assets.js.map +1 -0
- package/dist/runtime-pane-boot.d.ts +2 -0
- package/dist/runtime-pane-boot.js +24 -0
- package/dist/runtime-pane-boot.js.map +1 -0
- package/dist/runtime-pane-codex-index.d.ts +1 -0
- package/dist/runtime-pane-codex-index.js +47 -0
- package/dist/runtime-pane-codex-index.js.map +1 -0
- package/dist/runtime-pane-config.d.ts +16 -0
- package/dist/runtime-pane-config.js +54 -0
- package/dist/runtime-pane-config.js.map +1 -0
- package/dist/runtime-pane-host.d.ts +44 -0
- package/dist/runtime-pane-host.js +424 -0
- package/dist/runtime-pane-host.js.map +1 -0
- package/dist/runtime-pane-job-owner.d.ts +1 -0
- package/dist/runtime-pane-job-owner.js +29 -0
- package/dist/runtime-pane-job-owner.js.map +1 -0
- package/dist/runtime-pane-job.ps1 +116 -0
- package/dist/runtime-pane-link.d.ts +40 -0
- package/dist/runtime-pane-link.js +246 -0
- package/dist/runtime-pane-link.js.map +1 -0
- package/dist/runtime-pane-mcp-protocol.d.ts +32 -0
- package/dist/runtime-pane-mcp-protocol.js +39 -0
- package/dist/runtime-pane-mcp-protocol.js.map +1 -0
- package/dist/runtime-pane-mcp-relay.d.ts +17 -0
- package/dist/runtime-pane-mcp-relay.js +70 -0
- package/dist/runtime-pane-mcp-relay.js.map +1 -0
- package/dist/runtime-pane-mcp.d.ts +51 -0
- package/dist/runtime-pane-mcp.js +150 -0
- package/dist/runtime-pane-mcp.js.map +1 -0
- package/dist/runtime-pane-native.d.ts +45 -0
- package/dist/runtime-pane-native.js +65 -0
- package/dist/runtime-pane-native.js.map +1 -0
- package/dist/runtime-pane-output.d.ts +19 -0
- package/dist/runtime-pane-output.js +53 -0
- package/dist/runtime-pane-output.js.map +1 -0
- package/dist/runtime-pane-port.d.ts +139 -0
- package/dist/runtime-pane-port.js +558 -0
- package/dist/runtime-pane-port.js.map +1 -0
- package/dist/runtime-pane-private.d.ts +14 -0
- package/dist/runtime-pane-private.js +51 -0
- package/dist/runtime-pane-private.js.map +1 -0
- package/dist/runtime-pane-private.ps1 +14 -0
- package/dist/runtime-pane-process.d.ts +4 -0
- package/dist/runtime-pane-process.js +108 -0
- package/dist/runtime-pane-process.js.map +1 -0
- package/dist/runtime-pane-protocol.d.ts +172 -0
- package/dist/runtime-pane-protocol.js +195 -0
- package/dist/runtime-pane-protocol.js.map +1 -0
- package/dist/runtime-pane-screen.d.ts +19 -0
- package/dist/runtime-pane-screen.js +76 -0
- package/dist/runtime-pane-screen.js.map +1 -0
- package/dist/runtime-pane-service.d.ts +11 -0
- package/dist/runtime-pane-service.js +221 -0
- package/dist/runtime-pane-service.js.map +1 -0
- package/dist/runtime-pane-stdio-protocol.d.ts +54 -0
- package/dist/runtime-pane-stdio-protocol.js +94 -0
- package/dist/runtime-pane-stdio-protocol.js.map +1 -0
- package/dist/runtime-pane-stdio.d.ts +3 -0
- package/dist/runtime-pane-stdio.js +123 -0
- package/dist/runtime-pane-stdio.js.map +1 -0
- package/dist/runtime-pane-store.d.ts +33 -0
- package/dist/runtime-pane-store.js +164 -0
- package/dist/runtime-pane-store.js.map +1 -0
- package/dist/runtime-pane-transcript-protocol.d.ts +43 -0
- package/dist/runtime-pane-transcript-protocol.js +58 -0
- package/dist/runtime-pane-transcript-protocol.js.map +1 -0
- package/dist/runtime-pane-transcript.d.ts +45 -0
- package/dist/runtime-pane-transcript.js +605 -0
- package/dist/runtime-pane-transcript.js.map +1 -0
- package/dist/runtime-pane-worker.d.ts +1 -0
- package/dist/runtime-pane-worker.js +154 -0
- package/dist/runtime-pane-worker.js.map +1 -0
- package/dist/runtime-protocol.d.ts +149 -0
- package/dist/runtime-protocol.js +19 -0
- package/dist/runtime-protocol.js.map +1 -0
- package/dist/runtime-switches.d.ts +79 -0
- package/dist/runtime-switches.js +90 -0
- package/dist/runtime-switches.js.map +1 -0
- package/dist/runtime-transcript-delta-reader.d.ts +23 -0
- package/dist/runtime-transcript-delta-reader.js +74 -0
- package/dist/runtime-transcript-delta-reader.js.map +1 -0
- package/dist/runtime-transcript-source.d.ts +36 -0
- package/dist/runtime-transcript-source.js +189 -0
- package/dist/runtime-transcript-source.js.map +1 -0
- package/dist/runtime-windows-bridge.d.ts +41 -0
- package/dist/runtime-windows-bridge.js +157 -0
- package/dist/runtime-windows-bridge.js.map +1 -0
- package/dist/settings-api.d.ts +5 -0
- package/dist/settings-api.js +95 -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 +28 -0
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +16 -1
- package/dist/settings-confirmation.js +47 -9
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +4 -0
- package/dist/settings-effect.js +58 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +1 -0
- package/dist/settings-http-confirmation.js +15 -2
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-request-capability.d.ts +2 -0
- package/dist/settings-request-capability.js +4 -0
- package/dist/settings-request-capability.js.map +1 -1
- package/dist/settings-route-lifetime.d.ts +14 -0
- package/dist/settings-route-lifetime.js +48 -0
- package/dist/settings-route-lifetime.js.map +1 -0
- package/dist/settings-transaction.d.ts +4 -0
- package/dist/settings-transaction.js +9 -0
- package/dist/settings-transaction.js.map +1 -1
- package/dist/setup-form.js +6 -3
- package/dist/setup-form.js.map +1 -1
- package/dist/setup-i18n.js +3 -0
- package/dist/setup-i18n.js.map +1 -1
- package/dist/tmux-control.d.ts +2 -1
- package/dist/tmux-control.js.map +1 -1
- package/dist/tmux-manager.d.ts +2 -1
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tmux-pane-host.d.ts +26 -0
- package/dist/tmux-pane-host.js +25 -0
- package/dist/tmux-pane-host.js.map +1 -0
- package/dist/tool-permissions.js +2 -1
- package/dist/tool-permissions.js.map +1 -1
- package/dist/topic-commands.js +3 -0
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-delta-reader.d.ts +1 -1
- package/dist/transcript-delta-reader.js +1 -1
- package/dist/transcript-delta-reader.js.map +1 -1
- package/dist/transcript-monitor.d.ts +3 -0
- package/dist/transcript-monitor.js +22 -46
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-needles.d.ts +35 -0
- package/dist/transcript-needles.js +158 -0
- package/dist/transcript-needles.js.map +1 -0
- package/dist/transcript-records.d.ts +21 -0
- package/dist/transcript-records.js +140 -0
- package/dist/transcript-records.js.map +1 -0
- package/dist/transcript-sources.d.ts +5 -0
- package/dist/transcript-sources.js +8 -79
- package/dist/transcript-sources.js.map +1 -1
- package/dist/types.d.ts +23 -0
- package/dist/ui/agent-proposals.js +90 -0
- package/dist/ui/agent-runtime.js +106 -0
- package/dist/ui/chat-store.js +13 -2
- package/dist/ui/chat-strings.js +48 -0
- package/dist/ui/cli-picker.js +42 -0
- package/dist/ui/general-location.js +71 -0
- package/dist/ui/native-instance-settings.js +47 -0
- package/dist/ui/native-pane-recovery.js +45 -0
- package/dist/ui/panel-chat.js +63 -32
- package/dist/ui/panel-details.js +2 -1
- package/dist/ui/panel-fleet.js +99 -18
- package/dist/ui/panel-needs.js +154 -3
- package/dist/ui/panel-runtimes.js +231 -0
- package/dist/ui/panel-settings.js +19 -9
- package/dist/ui/panel-windows-agent.js +86 -0
- package/dist/ui/panel-windows-cli.js +143 -0
- package/dist/ui/provider-marks.js +83 -0
- package/dist/ui/runtime-catalog.js +55 -0
- package/dist/ui/settings-catalog.js +37 -10
- package/dist/ui/settings-confirm.js +3 -1
- package/dist/ui/settings-dialogs.js +22 -7
- package/dist/ui/settings-model.js +2 -1
- package/dist/ui/settings-outside.js +176 -0
- package/dist/ui/settings-registry.js +6 -0
- package/dist/ui/settings-strings.js +16 -0
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-route.js +6 -2
- package/dist/ui/shared/app-shell.js +3 -2
- package/dist/ui/shared/app-store.js +1 -0
- package/dist/ui/shared/app-stream.js +3 -1
- package/dist/ui/shared/app.css +301 -0
- package/dist/ui/shared/app.js +4 -0
- package/dist/ui/shared/header-tools.js +6 -4
- package/dist/ui/shared/instance-nav.js +33 -7
- package/dist/ui/shared/instance-switch.js +4 -3
- package/dist/ui/shared/qrcode.module.js +2237 -0
- package/dist/ui/shared/signin.js +39 -5
- package/dist/ui/shared/ui-menu.js +28 -8
- package/dist/ui/shared/vendor/qrcode-generator.LICENSE +27 -0
- package/dist/ui/shared/vendor/vendor.json +19 -2
- package/dist/ui/shared/view-strings.js +8 -0
- package/dist/ui/windows-agents-nav.js +2 -0
- package/dist/ui/windows-cli-catalog.js +79 -0
- package/dist/web-api.d.ts +37 -0
- package/dist/web-api.js +248 -6
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +19 -2
- package/dist/web-chat-history.js +72 -3
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-only-fleet.d.ts +20 -0
- package/dist/web-only-fleet.js +21 -0
- package/dist/web-only-fleet.js.map +1 -1
- package/dist/web-remote-access.d.ts +152 -0
- package/dist/web-remote-access.js +368 -0
- package/dist/web-remote-access.js.map +1 -0
- package/dist/web-session.d.ts +7 -0
- package/dist/web-session.js +2 -0
- package/dist/web-session.js.map +1 -1
- package/dist/web-shell-routes.d.ts +4 -1
- package/dist/web-shell-routes.js +7 -2
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/windows-agents.d.ts +124 -0
- package/dist/windows-agents.js +487 -0
- package/dist/windows-agents.js.map +1 -0
- package/dist/windows-cli-api.d.ts +23 -0
- package/dist/windows-cli-api.js +158 -0
- package/dist/windows-cli-api.js.map +1 -0
- package/dist/windows-cli-providers.d.ts +115 -0
- package/dist/windows-cli-providers.js +429 -0
- package/dist/windows-cli-providers.js.map +1 -0
- package/dist/windows-cli-worker.d.ts +58 -0
- package/dist/windows-cli-worker.js +479 -0
- package/dist/windows-cli-worker.js.map +1 -0
- package/dist/windows-cli.d.ts +115 -0
- package/dist/windows-cli.js +402 -0
- package/dist/windows-cli.js.map +1 -0
- package/dist/windows-native-mcp.d.ts +19 -0
- package/dist/windows-native-mcp.js +143 -0
- package/dist/windows-native-mcp.js.map +1 -0
- package/dist/windows-pane-mcp.d.ts +26 -0
- package/dist/windows-pane-mcp.js +187 -0
- package/dist/windows-pane-mcp.js.map +1 -0
- package/package.json +9 -3
- package/templates/runtime-assets/conpty-LICENSE +21 -0
- package/templates/runtime-assets/conpty-NOTICE.md +503 -0
- package/templates/runtime-assets/local-pane-stage.ps1 +101 -0
- package/templates/runtime-assets/runtime-pane-job.ps1 +116 -0
- package/templates/runtime-assets/runtime-pane-private.ps1 +14 -0
- package/templates/runtime-assets/xterm-LICENSE +21 -0
package/dist/web-api.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CANVAS_WORKER_EXPERIMENTAL_MESSAGE } from "./web-experimental.js";
|
|
2
|
+
import { MachineSlotLimitError } from "./windows-agents.js";
|
|
2
3
|
import { daemonTopicMode } from "./web-only-fleet.js";
|
|
3
4
|
import { webHumanOrigin } from "./human-delivery-receipts.js";
|
|
4
5
|
import { classifyWebPeer, confirmAfterBody, noAuthority } from "./authority/web-authority.js";
|
|
@@ -32,6 +33,7 @@ import { shellRoute } from "./web-shell-routes.js";
|
|
|
32
33
|
import { createReadStream, createWriteStream, readFileSync } from "node:fs";
|
|
33
34
|
import { join, dirname } from "node:path";
|
|
34
35
|
import { fileURLToPath } from "node:url";
|
|
36
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
35
37
|
import { CreateInstanceArgs, CreateScheduleArgs, UpdateScheduleArgs, validateArgs } from "./outbound-schemas.js";
|
|
36
38
|
import { scheduleView } from "./web-schedules.js";
|
|
37
39
|
import { DEFAULT_SCHEDULER_CONFIG } from "./scheduler/index.js";
|
|
@@ -54,6 +56,12 @@ import { resolveTz } from "./tz-utils.js";
|
|
|
54
56
|
import { QUERY_MAX_CHARS, RESULT_MAX, SEARCH_SOURCES } from "./search/search-store.js";
|
|
55
57
|
import { xmsgShown } from "./search/search-docs.js";
|
|
56
58
|
import { WebSendDedupe } from "./web-send-dedupe.js";
|
|
59
|
+
import { handleWindowsCliRequest, nativeCliAuthorization } from "./windows-cli-api.js";
|
|
60
|
+
import { createNativeInstance, handleNativeInstanceRequest } from "./native-instance-api.js";
|
|
61
|
+
import { isWindowsInstance, isNativePaneInstance, isNativeExecInstance } from "./native-instance-registry.js";
|
|
62
|
+
import { handleNativeModelCatalog } from "./native-model-catalog.js";
|
|
63
|
+
import { claudeDocumentedModels } from "./model-catalog-defaults.js";
|
|
64
|
+
import { handleRuntimeRequest } from "./runtime-api.js";
|
|
57
65
|
// ── Strict public-facing schemas ────────────────────────────────────────────
|
|
58
66
|
// web-api endpoints must reject unknown fields so the dashboard cannot inject
|
|
59
67
|
// internal-only flags that would reach handleCreate/scheduler/config writers.
|
|
@@ -1871,6 +1879,27 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1871
1879
|
return false;
|
|
1872
1880
|
}
|
|
1873
1881
|
// ── Static files ───────────────────────────────────────
|
|
1882
|
+
// Native local tools retain their administrator boundary on the shared chat/read/action routes.
|
|
1883
|
+
const nativePath = /^\/ui\/(?:chat|instance|cancel|stop|start|restart)\/([^/]+)$/.exec(path);
|
|
1884
|
+
let nativeTarget = url.searchParams.get("instance") ?? "";
|
|
1885
|
+
if (nativePath) {
|
|
1886
|
+
try {
|
|
1887
|
+
nativeTarget = decodeURIComponent(nativePath[1]);
|
|
1888
|
+
}
|
|
1889
|
+
catch {
|
|
1890
|
+
nativeTarget = "";
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
if (isWindowsInstance(ctx.fleetConfig?.instances?.[nativeTarget]) && !nativeCliAuthorization(req, url, ctx)) {
|
|
1894
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
1895
|
+
return true;
|
|
1896
|
+
}
|
|
1897
|
+
if (handleNativeInstanceRequest(req, res, url, ctx))
|
|
1898
|
+
return true;
|
|
1899
|
+
if (handleWindowsCliRequest(req, res, url, ctx))
|
|
1900
|
+
return true;
|
|
1901
|
+
if (handleRuntimeRequest(req, res, url, ctx))
|
|
1902
|
+
return true;
|
|
1874
1903
|
// #1408: the app shell, for exactly the paths the classifier names (src/web-shell-routes.ts). One page for every
|
|
1875
1904
|
// route; the client router mounts the panel. A malformed instance name is a 400, an unknown one is the shell (the
|
|
1876
1905
|
// panel says "not found"), so the response never tells which names exist.
|
|
@@ -1926,7 +1955,45 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
1926
1955
|
json(res, 400, { error: "backend (and optional instance) required" });
|
|
1927
1956
|
return true;
|
|
1928
1957
|
}
|
|
1929
|
-
|
|
1958
|
+
const runtime = url.searchParams.get("runtime"), refresh = url.searchParams.get("refresh");
|
|
1959
|
+
const machineId = url.searchParams.get("machineId");
|
|
1960
|
+
if (machineId !== null && (!/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(machineId) || runtime === "wsl")) {
|
|
1961
|
+
json(res, 400, { error: "Invalid model runtime machine" });
|
|
1962
|
+
return true;
|
|
1963
|
+
}
|
|
1964
|
+
if ((runtime !== null && runtime !== "wsl" && runtime !== "windows") || (refresh !== null && refresh !== "1")) {
|
|
1965
|
+
json(res, 400, { error: "Invalid model catalog options" });
|
|
1966
|
+
return true;
|
|
1967
|
+
}
|
|
1968
|
+
if (handleNativeModelCatalog(req, res, url, ctx))
|
|
1969
|
+
return true;
|
|
1970
|
+
const models = ctx.modelCatalogFor?.(backend, instance) ?? [];
|
|
1971
|
+
const answerCatalog = () => {
|
|
1972
|
+
if (backend === "claude-code" && !models.length) {
|
|
1973
|
+
const version = ctx.backendAvailabilityRows?.().find(row => row.backend === backend)?.version;
|
|
1974
|
+
json(res, 200, { backend, models: claudeDocumentedModels(version), source: "official-catalog" });
|
|
1975
|
+
}
|
|
1976
|
+
else
|
|
1977
|
+
json(res, 200, { backend, models });
|
|
1978
|
+
};
|
|
1979
|
+
// The existing catalog belongs to this instance/account and always wins.
|
|
1980
|
+
if (models.length || !ctx.cliModelCatalogFor) {
|
|
1981
|
+
answerCatalog();
|
|
1982
|
+
return true;
|
|
1983
|
+
}
|
|
1984
|
+
const canAnswer = () => !res.headersSent && !res.destroyed && !res.writableEnded && stillAuthorized(req, res, url, ctx);
|
|
1985
|
+
void (async () => {
|
|
1986
|
+
const cliModels = await ctx.cliModelCatalogFor?.(backend, instance) ?? [];
|
|
1987
|
+
if (!canAnswer())
|
|
1988
|
+
return;
|
|
1989
|
+
if (cliModels.length)
|
|
1990
|
+
json(res, 200, { backend, models: cliModels, source: "cli-cache" });
|
|
1991
|
+
else
|
|
1992
|
+
answerCatalog();
|
|
1993
|
+
})().catch(() => {
|
|
1994
|
+
if (canAnswer())
|
|
1995
|
+
json(res, 503, { error: "CLI model cache unavailable" });
|
|
1996
|
+
});
|
|
1930
1997
|
return true;
|
|
1931
1998
|
}
|
|
1932
1999
|
if (method === "GET" && path === "/ui/backends") {
|
|
@@ -2925,6 +2992,116 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2925
2992
|
});
|
|
2926
2993
|
return true;
|
|
2927
2994
|
}
|
|
2995
|
+
// ── #3008: connections from outside (a web-only fleet) ──
|
|
2996
|
+
// GET /ui/outside: the state (any admin; over the outside link too, read-only). Everything that changes it is this
|
|
2997
|
+
// computer's admin's, on this computer (the fleet asks the live session each time; the public link refuses these
|
|
2998
|
+
// routes outright): POST /ui/outside/enroll (a new secret, shown once), POST /ui/outside/enroll/confirm {code},
|
|
2999
|
+
// POST /ui/outside/remove, POST /ui/outside/switch {on}. Never a guest (not in GUEST_ROUTES).
|
|
3000
|
+
if (method === "GET" && path === "/ui/outside") {
|
|
3001
|
+
res.setHeader("Cache-Control", "no-store");
|
|
3002
|
+
json(res, 200, ctx.webOutsideStatus?.(req) ?? { webOnly: false, here: false, enrolled: false, enrolledAt: null, outside: false, pausedForMs: 0, link: null });
|
|
3003
|
+
return true;
|
|
3004
|
+
}
|
|
3005
|
+
if (method === "POST" && (path === "/ui/outside/enroll" || path === "/ui/outside/enroll/confirm" || path === "/ui/outside/remove" || path === "/ui/outside/switch")) {
|
|
3006
|
+
if (gatewayRequestContext(req)) {
|
|
3007
|
+
json(res, 403, { error: "outside_not_here" });
|
|
3008
|
+
return true;
|
|
3009
|
+
}
|
|
3010
|
+
(async () => {
|
|
3011
|
+
let body;
|
|
3012
|
+
try {
|
|
3013
|
+
body = await parseBody(req);
|
|
3014
|
+
}
|
|
3015
|
+
catch {
|
|
3016
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
3017
|
+
return;
|
|
3018
|
+
}
|
|
3019
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
3020
|
+
return;
|
|
3021
|
+
res.setHeader("Cache-Control", "no-store");
|
|
3022
|
+
if (path === "/ui/outside/enroll") {
|
|
3023
|
+
const r = ctx.webOutsideBeginEnrollment?.(req) ?? null;
|
|
3024
|
+
if (!r) {
|
|
3025
|
+
json(res, 403, { error: "outside_not_here" });
|
|
3026
|
+
return;
|
|
3027
|
+
}
|
|
3028
|
+
json(res, 200, r);
|
|
3029
|
+
return;
|
|
3030
|
+
}
|
|
3031
|
+
if (path === "/ui/outside/enroll/confirm") {
|
|
3032
|
+
const code = body && typeof body === "object" ? body.code : undefined;
|
|
3033
|
+
if (typeof code !== "string" || code.length > 32) {
|
|
3034
|
+
json(res, 400, { error: "code required" });
|
|
3035
|
+
return;
|
|
3036
|
+
}
|
|
3037
|
+
const r = ctx.webOutsideConfirmEnrollment?.(req, code) ?? "not_here";
|
|
3038
|
+
json(res, r === "ok" ? 200 : r === "not_here" ? 403 : r === "unsaved" ? 503 : 400, r === "ok" ? { ok: true } : { error: r === "not_here" ? "outside_not_here" : r });
|
|
3039
|
+
return;
|
|
3040
|
+
}
|
|
3041
|
+
if (path === "/ui/outside/remove") {
|
|
3042
|
+
const r = ctx.webOutsideRemove?.(req) ?? "not_here";
|
|
3043
|
+
json(res, r === "ok" ? 200 : r === "unsaved" ? 503 : 403, r === "ok" ? { ok: true } : { error: r === "unsaved" ? "unsaved" : "outside_not_here" });
|
|
3044
|
+
return;
|
|
3045
|
+
}
|
|
3046
|
+
const on = body && typeof body === "object" ? body.on : undefined;
|
|
3047
|
+
if (typeof on !== "boolean") {
|
|
3048
|
+
json(res, 400, { error: "on must be true or false" });
|
|
3049
|
+
return;
|
|
3050
|
+
}
|
|
3051
|
+
const r = ctx.webOutsideSwitch?.(req, on) ?? "not_here";
|
|
3052
|
+
json(res, r === "ok" ? 200 : r === "not_here" ? 403 : r === "unsaved" ? 503 : 409, r === "ok" ? { ok: true } : { error: r === "not_here" ? "outside_not_here" : r });
|
|
3053
|
+
})().catch(err => {
|
|
3054
|
+
ctx.logger.error({ err: err.message }, "Outside connections change failed");
|
|
3055
|
+
try {
|
|
3056
|
+
json(res, 500, { error: "outside_failed" });
|
|
3057
|
+
}
|
|
3058
|
+
catch { /* already answered */ }
|
|
3059
|
+
});
|
|
3060
|
+
return true;
|
|
3061
|
+
}
|
|
3062
|
+
// ── alpha.2 (M-2300): an agent's Windows request, decided by a web-only fleet's owner in Needs you ──
|
|
3063
|
+
// The list is the owner's only: anyone else (a guest, a LAN or public-link session, a chat fleet's admin) reads an
|
|
3064
|
+
// empty one, so nothing actionable ever reaches them. The stream's `agent_proposals` event carries nothing.
|
|
3065
|
+
if (method === "GET" && path === "/ui/agent-proposals") {
|
|
3066
|
+
const list = ctx.webAgentProposals?.(req) ?? null;
|
|
3067
|
+
json(res, 200, { owner: list !== null, proposals: list ?? [] });
|
|
3068
|
+
return true;
|
|
3069
|
+
}
|
|
3070
|
+
const proposalMatch = method === "POST" ? /^\/ui\/agent-proposals\/([0-9a-f]{32})$/.exec(path) : null;
|
|
3071
|
+
if (proposalMatch) {
|
|
3072
|
+
if (!ctx.webDecideAgentProposal) {
|
|
3073
|
+
json(res, 404, { error: "not_found" });
|
|
3074
|
+
return true;
|
|
3075
|
+
}
|
|
3076
|
+
const decide = ctx.webDecideAgentProposal.bind(ctx), id = proposalMatch[1];
|
|
3077
|
+
(async () => {
|
|
3078
|
+
let body;
|
|
3079
|
+
try {
|
|
3080
|
+
body = await parseBody(req);
|
|
3081
|
+
}
|
|
3082
|
+
catch {
|
|
3083
|
+
json(res, 400, { error: "Invalid JSON" });
|
|
3084
|
+
return;
|
|
3085
|
+
}
|
|
3086
|
+
if (!permitWebContinuation(req, res, ctx))
|
|
3087
|
+
return;
|
|
3088
|
+
const decision = body && typeof body === "object" ? body.decision : undefined;
|
|
3089
|
+
if (decision !== "confirm" && decision !== "reject") {
|
|
3090
|
+
json(res, 400, { error: "decision must be confirm or reject" });
|
|
3091
|
+
return;
|
|
3092
|
+
}
|
|
3093
|
+
const r = await decide(req, id, decision);
|
|
3094
|
+
if (!res.headersSent && !res.destroyed)
|
|
3095
|
+
json(res, r.status, r.body);
|
|
3096
|
+
})().catch(err => {
|
|
3097
|
+
ctx.logger.error({ err: err.message }, "Agent request decision failed");
|
|
3098
|
+
try {
|
|
3099
|
+
json(res, 500, { error: "decide_failed" });
|
|
3100
|
+
}
|
|
3101
|
+
catch { /* already answered */ }
|
|
3102
|
+
});
|
|
3103
|
+
return true;
|
|
3104
|
+
}
|
|
2928
3105
|
if (method === "POST" && path === "/ui/needs/ack") {
|
|
2929
3106
|
if (!ctx.acknowledgeNeedsItem) {
|
|
2930
3107
|
json(res, 404, { error: "Nothing to acknowledge here" });
|
|
@@ -3050,6 +3227,20 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3050
3227
|
json(res, 400, { error: "instance and command required" });
|
|
3051
3228
|
return;
|
|
3052
3229
|
}
|
|
3230
|
+
if (isNativeExecInstance(ctx.fleetConfig?.instances[instance])) {
|
|
3231
|
+
json(res, 400, { error: "This runtime does not support CLI control commands; use Agent settings or Cancel" });
|
|
3232
|
+
return;
|
|
3233
|
+
}
|
|
3234
|
+
if (isNativePaneInstance(ctx.fleetConfig?.instances[instance])) {
|
|
3235
|
+
if (!nativeCliAuthorization(req, url, ctx)) {
|
|
3236
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
3237
|
+
return;
|
|
3238
|
+
}
|
|
3239
|
+
if (command !== "model") {
|
|
3240
|
+
json(res, 400, { error: "This persistent Windows runtime supports the model command; use its shared controls for other actions" });
|
|
3241
|
+
return;
|
|
3242
|
+
}
|
|
3243
|
+
}
|
|
3053
3244
|
if (body.args !== undefined && str(body.args, MAX_COMMAND_ARGS) === undefined) {
|
|
3054
3245
|
json(res, 400, { error: "args too long" });
|
|
3055
3246
|
return;
|
|
@@ -3313,6 +3504,10 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3313
3504
|
const body = await parseBody(req);
|
|
3314
3505
|
if (!permitWebContinuation(req, res, ctx))
|
|
3315
3506
|
return;
|
|
3507
|
+
if (body?.runtime === "windows") {
|
|
3508
|
+
await createNativeInstance(req, res, url, ctx, body);
|
|
3509
|
+
return;
|
|
3510
|
+
}
|
|
3316
3511
|
const v = validateArgs(CreateInstanceArgs, body, "create_instance");
|
|
3317
3512
|
if (!v.ok) {
|
|
3318
3513
|
json(res, 400, { error: v.error });
|
|
@@ -4074,6 +4269,9 @@ function uploadRecipient(ctx, name) {
|
|
|
4074
4269
|
/** Closed, path-free explanations; arbitrary launch errors stay in the host log. */
|
|
4075
4270
|
function webDeliveryFailure(err) {
|
|
4076
4271
|
const message = err instanceof Error ? err.message : "";
|
|
4272
|
+
// M-2297: the per-PC agent limit — say so, with the agents holding its slots (names only: no path, no id).
|
|
4273
|
+
if (err instanceof MachineSlotLimitError)
|
|
4274
|
+
return { reason: "machine_limit", error: message, limit: err.limit, holders: err.holders.map(h => ({ name: h.name, unknown: h.unknown })) };
|
|
4077
4275
|
if (/No warm slot is free/.test(message))
|
|
4078
4276
|
return { reason: "wake_capacity", error: "No slot is free to wake this instance. Retry when another instance is idle." };
|
|
4079
4277
|
if (/login|log in|sign in|\bauth(?:entication|orization)?\b|credential|api.?key/i.test(message))
|
|
@@ -4121,6 +4319,15 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4121
4319
|
return;
|
|
4122
4320
|
}
|
|
4123
4321
|
const { instance, message: typed, attachments = [], replyTo, clientId } = parsed.data;
|
|
4322
|
+
const native = isWindowsInstance(ctx.fleetConfig?.instances[instance]);
|
|
4323
|
+
if (native && !nativeCliAuthorization(req, new URL(req.url ?? "/", "http://localhost"), ctx)) {
|
|
4324
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
4325
|
+
return;
|
|
4326
|
+
}
|
|
4327
|
+
if (native && attachments.length) {
|
|
4328
|
+
json(res, 400, { error: "Attachments are not supported by this runtime yet" });
|
|
4329
|
+
return;
|
|
4330
|
+
}
|
|
4124
4331
|
// #1920 step 2b: a guest writes only to an in-scope instance, while guests may chat, and never a command.
|
|
4125
4332
|
const guest = guestRequestOf(req);
|
|
4126
4333
|
const refused = guestChatRefusal(guest, instance);
|
|
@@ -4174,6 +4381,16 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4174
4381
|
break;
|
|
4175
4382
|
}
|
|
4176
4383
|
}
|
|
4384
|
+
const locationHold = ctx.generalLocationDeliveryHold?.(instance);
|
|
4385
|
+
if (locationHold) {
|
|
4386
|
+
const messageId = newWebMessageId(), ts = new Date().toISOString();
|
|
4387
|
+
// Settle this client ID as answered. A Retry after reconnect must never queue its old input.
|
|
4388
|
+
acceptedId = messageId;
|
|
4389
|
+
ctx.emitSseEvent("message", { instance, sender: person.name, role: "user", text: typed, ts, messageId, ...(person.bound ? { from: person.voterKey } : {}), ...(clientId ? { clientId } : {}) });
|
|
4390
|
+
ctx.emitSseEvent("message", { instance, role: "status", sender: "AgEnD", text: locationHold, ts, messageId: newWebMessageId() });
|
|
4391
|
+
json(res, 200, { sent: true, messageId, serviceResponse: true });
|
|
4392
|
+
return;
|
|
4393
|
+
}
|
|
4177
4394
|
let files = [];
|
|
4178
4395
|
if (attachments.length > 0) {
|
|
4179
4396
|
const taken = ctx.webFiles?.takeForMessage(instance, attachments);
|
|
@@ -4196,15 +4413,39 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4196
4413
|
// Recheck the same admission all the way through a wake, before the facade's actual IPC handoff.
|
|
4197
4414
|
const requestUrl = new URL(req.url ?? "/", "http://localhost");
|
|
4198
4415
|
const admission = admissionOf(req, requestUrl, ctx);
|
|
4199
|
-
|
|
4416
|
+
// The sender's authority, without the request's own lifetime: the same admission, the same guest still allowed, the
|
|
4417
|
+
// instance still registered (a Windows one still Windows). A Windows turn is journaled before /ui/send answers and its
|
|
4418
|
+
// process starts after, so the bridge rechecks this one (a revoke in between still stops it); never res, which a
|
|
4419
|
+
// finished response marks destroyed (S-30: every web-chat turn to a Windows agent was refused).
|
|
4420
|
+
const authorityCurrent = () => admission !== null && admissionOf(req, requestUrl, ctx) === admission
|
|
4200
4421
|
&& (!guest || (guest.current() && !guestChatRefusal(guest, instance)))
|
|
4201
|
-
&& (
|
|
4422
|
+
&& (native ? isWindowsInstance(ctx.fleetConfig?.instances[instance]) && nativeCliAuthorization(req, requestUrl, ctx)
|
|
4423
|
+
: registered ? registeredChatInstance(ctx, instance) : ctx.instanceIpcClients.has(instance));
|
|
4424
|
+
const stillCurrent = () => !res.destroyed && authorityCurrent();
|
|
4202
4425
|
const message = typed;
|
|
4203
4426
|
// #1939 S1: what the receipt records about who authorized it (observe only: agents still read web as recognition).
|
|
4204
4427
|
const { authority } = confirmAfterBody(arrival, webAuthorityOf(req, new URL(req.url ?? "/", "http://localhost"), ctx, instance));
|
|
4205
4428
|
const ts = new Date().toISOString();
|
|
4206
4429
|
// The id the agent is given, and the one its delivery reports come back under: the page's ticks.
|
|
4207
|
-
const
|
|
4430
|
+
const nativeRequestId = isNativeExecInstance(ctx.fleetConfig?.instances[instance]) ? (() => {
|
|
4431
|
+
if (!clientId)
|
|
4432
|
+
return randomUUID();
|
|
4433
|
+
const hash = createHash("sha256").update(`agend-native-web\0${WebSendDedupe.key(person.key, instance, clientId)}`).digest("hex");
|
|
4434
|
+
return `${hash.slice(0, 8)}-${hash.slice(8, 12)}-4${hash.slice(13, 16)}-8${hash.slice(17, 20)}-${hash.slice(20, 32)}`;
|
|
4435
|
+
})() : undefined;
|
|
4436
|
+
const messageId = nativeRequestId ? `native:${nativeRequestId}:user` : newWebMessageId();
|
|
4437
|
+
if (nativeRequestId && ctx.nativeInstanceRuntime) {
|
|
4438
|
+
const previous = ctx.nativeInstanceRuntime().get(instance)?.turns.find(turn => turn.id === nativeRequestId);
|
|
4439
|
+
if (previous) {
|
|
4440
|
+
if (previous.prompt !== delivery.text) {
|
|
4441
|
+
json(res, 409, { error: "clientId belongs to a different message" });
|
|
4442
|
+
return;
|
|
4443
|
+
}
|
|
4444
|
+
acceptedId = messageId;
|
|
4445
|
+
json(res, 200, { sent: true, messageId, repeated: true });
|
|
4446
|
+
return;
|
|
4447
|
+
}
|
|
4448
|
+
}
|
|
4208
4449
|
// Use real Telegram context so daemon's lastChatId/lastThreadId are set,
|
|
4209
4450
|
// enabling reply tool even when first message comes from Web UI.
|
|
4210
4451
|
// Pure Web UI mode (no channel config) leaves these empty; the agent's reply then comes back to the
|
|
@@ -4250,11 +4491,12 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4250
4491
|
let delivered;
|
|
4251
4492
|
try {
|
|
4252
4493
|
const deliver = (name, payload) => ctx.deliverHumanToInstance
|
|
4253
|
-
? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent })
|
|
4254
|
-
: ctx.deliverToInstance(name, payload, { stillCurrent });
|
|
4494
|
+
? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
|
|
4495
|
+
: ctx.deliverToInstance(name, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
|
|
4255
4496
|
delivered = await deliver(instance, {
|
|
4256
4497
|
type: "fleet_inbound",
|
|
4257
4498
|
content: delivery.text,
|
|
4499
|
+
...(nativeRequestId ? { requestId: nativeRequestId } : {}),
|
|
4258
4500
|
targetSession: instance,
|
|
4259
4501
|
meta: {
|
|
4260
4502
|
chat_id: groupId ? String(groupId) : "",
|