@songsid/agend 2.3.4-beta.6 → 2.3.5-alpha.2
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/backend/claude-code.d.ts +15 -12
- package/dist/backend/claude-code.js +137 -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 +1271 -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 +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +59 -0
- 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 +62 -5
- package/dist/daemon.js +749 -267
- 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 +125 -2
- package/dist/fleet-manager.js +1157 -27
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +92 -0
- package/dist/fleet-windows-runtime.js +373 -0
- package/dist/fleet-windows-runtime.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 +20 -3
- package/dist/instance-lifecycle.js +358 -156
- package/dist/instance-lifecycle.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 +34 -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 +227 -0
- package/dist/native-pane-lifecycle.js.map +1 -0
- package/dist/native-pane-manager.d.ts +58 -0
- package/dist/native-pane-manager.js +563 -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 +1 -0
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +12 -1
- package/dist/needs-you.js +8 -1
- 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 +107 -0
- package/dist/pane-port.js +2 -0
- package/dist/pane-port.js.map +1 -0
- 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 +147 -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-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 +43 -0
- package/dist/runtime-pane-host.js +403 -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 +43 -0
- package/dist/runtime-pane-mcp.js +137 -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 +134 -0
- package/dist/runtime-pane-port.js +537 -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 +169 -0
- package/dist/runtime-pane-protocol.js +189 -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.js +58 -0
- package/dist/settings-api.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 +15 -1
- package/dist/settings-confirmation.js +46 -9
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.js +23 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.js +11 -2
- package/dist/settings-http-confirmation.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/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 +21 -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/native-instance-settings.js +47 -0
- package/dist/ui/native-pane-recovery.js +45 -0
- package/dist/ui/panel-chat.js +61 -32
- package/dist/ui/panel-details.js +2 -1
- package/dist/ui/panel-fleet.js +99 -18
- package/dist/ui/panel-needs.js +152 -3
- package/dist/ui/panel-runtimes.js +231 -0
- package/dist/ui/panel-settings.js +14 -8
- 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 +14 -5
- package/dist/ui/settings-registry.js +5 -0
- package/dist/ui/settings-strings.js +14 -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 +20 -4
- package/dist/ui/shared/instance-switch.js +4 -3
- package/dist/ui/shared/ui-menu.js +28 -8
- package/dist/ui/shared/view-strings.js +6 -0
- package/dist/ui/windows-agents-nav.js +2 -0
- package/dist/ui/windows-cli-catalog.js +79 -0
- package/dist/update-check.d.ts +8 -2
- package/dist/update-check.js +5 -2
- package/dist/update-check.js.map +1 -1
- package/dist/web-api.d.ts +25 -0
- package/dist/web-api.js +171 -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-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 +112 -0
- package/dist/windows-agents.js +463 -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,49 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
2925
2992
|
});
|
|
2926
2993
|
return true;
|
|
2927
2994
|
}
|
|
2995
|
+
// ── alpha.2 (M-2300): an agent's Windows request, decided by a web-only fleet's owner in Needs you ──
|
|
2996
|
+
// The list is the owner's only: anyone else (a guest, a LAN or public-link session, a chat fleet's admin) reads an
|
|
2997
|
+
// empty one, so nothing actionable ever reaches them. The stream's `agent_proposals` event carries nothing.
|
|
2998
|
+
if (method === "GET" && path === "/ui/agent-proposals") {
|
|
2999
|
+
const list = ctx.webAgentProposals?.(req) ?? null;
|
|
3000
|
+
json(res, 200, { owner: list !== null, proposals: list ?? [] });
|
|
3001
|
+
return true;
|
|
3002
|
+
}
|
|
3003
|
+
const proposalMatch = method === "POST" ? /^\/ui\/agent-proposals\/([0-9a-f]{32})$/.exec(path) : null;
|
|
3004
|
+
if (proposalMatch) {
|
|
3005
|
+
if (!ctx.webDecideAgentProposal) {
|
|
3006
|
+
json(res, 404, { error: "not_found" });
|
|
3007
|
+
return true;
|
|
3008
|
+
}
|
|
3009
|
+
const decide = ctx.webDecideAgentProposal.bind(ctx), id = proposalMatch[1];
|
|
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
|
+
const decision = body && typeof body === "object" ? body.decision : undefined;
|
|
3022
|
+
if (decision !== "confirm" && decision !== "reject") {
|
|
3023
|
+
json(res, 400, { error: "decision must be confirm or reject" });
|
|
3024
|
+
return;
|
|
3025
|
+
}
|
|
3026
|
+
const r = await decide(req, id, decision);
|
|
3027
|
+
if (!res.headersSent && !res.destroyed)
|
|
3028
|
+
json(res, r.status, r.body);
|
|
3029
|
+
})().catch(err => {
|
|
3030
|
+
ctx.logger.error({ err: err.message }, "Agent request decision failed");
|
|
3031
|
+
try {
|
|
3032
|
+
json(res, 500, { error: "decide_failed" });
|
|
3033
|
+
}
|
|
3034
|
+
catch { /* already answered */ }
|
|
3035
|
+
});
|
|
3036
|
+
return true;
|
|
3037
|
+
}
|
|
2928
3038
|
if (method === "POST" && path === "/ui/needs/ack") {
|
|
2929
3039
|
if (!ctx.acknowledgeNeedsItem) {
|
|
2930
3040
|
json(res, 404, { error: "Nothing to acknowledge here" });
|
|
@@ -3050,6 +3160,20 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3050
3160
|
json(res, 400, { error: "instance and command required" });
|
|
3051
3161
|
return;
|
|
3052
3162
|
}
|
|
3163
|
+
if (isNativeExecInstance(ctx.fleetConfig?.instances[instance])) {
|
|
3164
|
+
json(res, 400, { error: "This runtime does not support CLI control commands; use Agent settings or Cancel" });
|
|
3165
|
+
return;
|
|
3166
|
+
}
|
|
3167
|
+
if (isNativePaneInstance(ctx.fleetConfig?.instances[instance])) {
|
|
3168
|
+
if (!nativeCliAuthorization(req, url, ctx)) {
|
|
3169
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
3170
|
+
return;
|
|
3171
|
+
}
|
|
3172
|
+
if (command !== "model") {
|
|
3173
|
+
json(res, 400, { error: "This persistent Windows runtime supports the model command; use its shared controls for other actions" });
|
|
3174
|
+
return;
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3053
3177
|
if (body.args !== undefined && str(body.args, MAX_COMMAND_ARGS) === undefined) {
|
|
3054
3178
|
json(res, 400, { error: "args too long" });
|
|
3055
3179
|
return;
|
|
@@ -3313,6 +3437,10 @@ export function handleWebRequest(req, res, url, ctx) {
|
|
|
3313
3437
|
const body = await parseBody(req);
|
|
3314
3438
|
if (!permitWebContinuation(req, res, ctx))
|
|
3315
3439
|
return;
|
|
3440
|
+
if (body?.runtime === "windows") {
|
|
3441
|
+
await createNativeInstance(req, res, url, ctx, body);
|
|
3442
|
+
return;
|
|
3443
|
+
}
|
|
3316
3444
|
const v = validateArgs(CreateInstanceArgs, body, "create_instance");
|
|
3317
3445
|
if (!v.ok) {
|
|
3318
3446
|
json(res, 400, { error: v.error });
|
|
@@ -4074,6 +4202,9 @@ function uploadRecipient(ctx, name) {
|
|
|
4074
4202
|
/** Closed, path-free explanations; arbitrary launch errors stay in the host log. */
|
|
4075
4203
|
function webDeliveryFailure(err) {
|
|
4076
4204
|
const message = err instanceof Error ? err.message : "";
|
|
4205
|
+
// M-2297: the per-PC agent limit — say so, with the agents holding its slots (names only: no path, no id).
|
|
4206
|
+
if (err instanceof MachineSlotLimitError)
|
|
4207
|
+
return { reason: "machine_limit", error: message, limit: err.limit, holders: err.holders.map(h => ({ name: h.name, unknown: h.unknown })) };
|
|
4077
4208
|
if (/No warm slot is free/.test(message))
|
|
4078
4209
|
return { reason: "wake_capacity", error: "No slot is free to wake this instance. Retry when another instance is idle." };
|
|
4079
4210
|
if (/login|log in|sign in|\bauth(?:entication|orization)?\b|credential|api.?key/i.test(message))
|
|
@@ -4121,6 +4252,15 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4121
4252
|
return;
|
|
4122
4253
|
}
|
|
4123
4254
|
const { instance, message: typed, attachments = [], replyTo, clientId } = parsed.data;
|
|
4255
|
+
const native = isWindowsInstance(ctx.fleetConfig?.instances[instance]);
|
|
4256
|
+
if (native && !nativeCliAuthorization(req, new URL(req.url ?? "/", "http://localhost"), ctx)) {
|
|
4257
|
+
json(res, 403, { error: "Windows runtime requires an administrator on the local dashboard" });
|
|
4258
|
+
return;
|
|
4259
|
+
}
|
|
4260
|
+
if (native && attachments.length) {
|
|
4261
|
+
json(res, 400, { error: "Attachments are not supported by this runtime yet" });
|
|
4262
|
+
return;
|
|
4263
|
+
}
|
|
4124
4264
|
// #1920 step 2b: a guest writes only to an in-scope instance, while guests may chat, and never a command.
|
|
4125
4265
|
const guest = guestRequestOf(req);
|
|
4126
4266
|
const refused = guestChatRefusal(guest, instance);
|
|
@@ -4196,15 +4336,39 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4196
4336
|
// Recheck the same admission all the way through a wake, before the facade's actual IPC handoff.
|
|
4197
4337
|
const requestUrl = new URL(req.url ?? "/", "http://localhost");
|
|
4198
4338
|
const admission = admissionOf(req, requestUrl, ctx);
|
|
4199
|
-
|
|
4339
|
+
// The sender's authority, without the request's own lifetime: the same admission, the same guest still allowed, the
|
|
4340
|
+
// instance still registered (a Windows one still Windows). A Windows turn is journaled before /ui/send answers and its
|
|
4341
|
+
// process starts after, so the bridge rechecks this one (a revoke in between still stops it); never res, which a
|
|
4342
|
+
// finished response marks destroyed (S-30: every web-chat turn to a Windows agent was refused).
|
|
4343
|
+
const authorityCurrent = () => admission !== null && admissionOf(req, requestUrl, ctx) === admission
|
|
4200
4344
|
&& (!guest || (guest.current() && !guestChatRefusal(guest, instance)))
|
|
4201
|
-
&& (
|
|
4345
|
+
&& (native ? isWindowsInstance(ctx.fleetConfig?.instances[instance]) && nativeCliAuthorization(req, requestUrl, ctx)
|
|
4346
|
+
: registered ? registeredChatInstance(ctx, instance) : ctx.instanceIpcClients.has(instance));
|
|
4347
|
+
const stillCurrent = () => !res.destroyed && authorityCurrent();
|
|
4202
4348
|
const message = typed;
|
|
4203
4349
|
// #1939 S1: what the receipt records about who authorized it (observe only: agents still read web as recognition).
|
|
4204
4350
|
const { authority } = confirmAfterBody(arrival, webAuthorityOf(req, new URL(req.url ?? "/", "http://localhost"), ctx, instance));
|
|
4205
4351
|
const ts = new Date().toISOString();
|
|
4206
4352
|
// The id the agent is given, and the one its delivery reports come back under: the page's ticks.
|
|
4207
|
-
const
|
|
4353
|
+
const nativeRequestId = isNativeExecInstance(ctx.fleetConfig?.instances[instance]) ? (() => {
|
|
4354
|
+
if (!clientId)
|
|
4355
|
+
return randomUUID();
|
|
4356
|
+
const hash = createHash("sha256").update(`agend-native-web\0${WebSendDedupe.key(person.key, instance, clientId)}`).digest("hex");
|
|
4357
|
+
return `${hash.slice(0, 8)}-${hash.slice(8, 12)}-4${hash.slice(13, 16)}-8${hash.slice(17, 20)}-${hash.slice(20, 32)}`;
|
|
4358
|
+
})() : undefined;
|
|
4359
|
+
const messageId = nativeRequestId ? `native:${nativeRequestId}:user` : newWebMessageId();
|
|
4360
|
+
if (nativeRequestId && ctx.nativeInstanceRuntime) {
|
|
4361
|
+
const previous = ctx.nativeInstanceRuntime().get(instance)?.turns.find(turn => turn.id === nativeRequestId);
|
|
4362
|
+
if (previous) {
|
|
4363
|
+
if (previous.prompt !== delivery.text) {
|
|
4364
|
+
json(res, 409, { error: "clientId belongs to a different message" });
|
|
4365
|
+
return;
|
|
4366
|
+
}
|
|
4367
|
+
acceptedId = messageId;
|
|
4368
|
+
json(res, 200, { sent: true, messageId, repeated: true });
|
|
4369
|
+
return;
|
|
4370
|
+
}
|
|
4371
|
+
}
|
|
4208
4372
|
// Use real Telegram context so daemon's lastChatId/lastThreadId are set,
|
|
4209
4373
|
// enabling reply tool even when first message comes from Web UI.
|
|
4210
4374
|
// Pure Web UI mode (no channel config) leaves these empty; the agent's reply then comes back to the
|
|
@@ -4250,11 +4414,12 @@ function handleSendMessage(req, res, ctx) {
|
|
|
4250
4414
|
let delivered;
|
|
4251
4415
|
try {
|
|
4252
4416
|
const deliver = (name, payload) => ctx.deliverHumanToInstance
|
|
4253
|
-
? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent })
|
|
4254
|
-
: ctx.deliverToInstance(name, payload, { stillCurrent });
|
|
4417
|
+
? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
|
|
4418
|
+
: ctx.deliverToInstance(name, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
|
|
4255
4419
|
delivered = await deliver(instance, {
|
|
4256
4420
|
type: "fleet_inbound",
|
|
4257
4421
|
content: delivery.text,
|
|
4422
|
+
...(nativeRequestId ? { requestId: nativeRequestId } : {}),
|
|
4258
4423
|
targetSession: instance,
|
|
4259
4424
|
meta: {
|
|
4260
4425
|
chat_id: groupId ? String(groupId) : "",
|