@songsid/agend 2.3.5-alpha.4 → 2.3.5-beta.1
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 +0 -2
- package/README.zh-TW.md +0 -2
- package/THIRD_PARTY_NOTICES.md +12 -28
- package/dist/agent-cli-instructions.md +1 -1
- package/dist/agent-credentials.d.ts +24 -0
- package/dist/agent-credentials.js +66 -0
- package/dist/agent-credentials.js.map +1 -0
- package/dist/agent-endpoint.d.ts +4 -6
- package/dist/agent-endpoint.js +15 -12
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/auth-api.d.ts +0 -21
- package/dist/auth-api.js +8 -93
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/session-authorizations.d.ts +30 -4
- package/dist/authority/session-authorizations.js +69 -17
- package/dist/authority/session-authorizations.js.map +1 -1
- package/dist/authority/web-authority.d.ts +2 -12
- package/dist/authority/web-authority.js +4 -25
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/antigravity.js +3 -1
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.d.ts +12 -15
- package/dist/backend/claude-code.js +133 -152
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex-metadata.d.ts +14 -0
- package/dist/backend/codex-metadata.js +45 -0
- package/dist/backend/codex-metadata.js.map +1 -1
- package/dist/backend/codex-package.d.ts +2 -5
- package/dist/backend/codex-package.js +5 -1
- package/dist/backend/codex-package.js.map +1 -1
- package/dist/backend/codex-quota-history.d.ts +7 -0
- package/dist/backend/codex-quota-history.js +72 -0
- package/dist/backend/codex-quota-history.js.map +1 -0
- package/dist/backend/codex-session-lookup.d.ts +6 -0
- package/dist/backend/codex-session-lookup.js +1 -1
- package/dist/backend/codex-session-lookup.js.map +1 -1
- package/dist/backend/codex-speed.d.ts +14 -0
- package/dist/backend/codex-speed.js +35 -0
- package/dist/backend/codex-speed.js.map +1 -0
- package/dist/backend/codex.d.ts +116 -136
- package/dist/backend/codex.js +912 -942
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok-weekly-reset.d.ts +24 -0
- package/dist/backend/grok-weekly-reset.js +95 -0
- package/dist/backend/grok-weekly-reset.js.map +1 -0
- package/dist/backend/grok.d.ts +30 -3
- package/dist/backend/grok.js +301 -76
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro.d.ts +3 -0
- package/dist/backend/kiro.js +50 -2
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/muse.js +5 -3
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/types.d.ts +15 -8
- package/dist/backend/types.js +3 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/bundled-tmux-guard.d.ts +21 -0
- package/dist/bundled-tmux-guard.js +96 -0
- package/dist/bundled-tmux-guard.js.map +1 -0
- package/dist/cache-ledger.d.ts +95 -0
- package/dist/cache-ledger.js +276 -4
- package/dist/cache-ledger.js.map +1 -1
- package/dist/cache-service.d.ts +5 -0
- package/dist/cache-service.js +16 -4
- package/dist/cache-service.js.map +1 -1
- package/dist/channel/adapters/discord.js +11 -3
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +51 -0
- package/dist/channel/adapters/telegram.js +235 -17
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/ipc-bridge.d.ts +0 -2
- package/dist/channel/mcp-tools.js +3 -3
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/types.d.ts +2 -0
- package/dist/classic-channel-manager.d.ts +2 -0
- package/dist/classic-channel-manager.js +5 -1
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/cli.js +14 -10
- package/dist/cli.js.map +1 -1
- package/dist/config-validator.js +30 -71
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +3 -17
- package/dist/config.js.map +1 -1
- package/dist/cross-instance-notice.d.ts +10 -0
- package/dist/cross-instance-notice.js +67 -5
- package/dist/cross-instance-notice.js.map +1 -1
- package/dist/daemon.d.ts +70 -68
- package/dist/daemon.js +774 -846
- package/dist/daemon.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +8 -0
- package/dist/dashboard-permissions.js +16 -0
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-consumed-watch.d.ts +26 -16
- package/dist/delivery-consumed-watch.js +31 -26
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/delivery-outbox.d.ts +0 -5
- package/dist/delivery-outbox.js +4 -32
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/delivery-reconciliation.d.ts +42 -2
- package/dist/delivery-reconciliation.js +164 -2
- package/dist/delivery-reconciliation.js.map +1 -1
- package/dist/export-import.d.ts +7 -0
- package/dist/export-import.js +44 -10
- package/dist/export-import.js.map +1 -1
- package/dist/fleet-context.d.ts +4 -2
- package/dist/fleet-level-config.d.ts +1 -1
- package/dist/fleet-level-config.js +0 -2
- package/dist/fleet-level-config.js.map +1 -1
- package/dist/fleet-manager.d.ts +108 -245
- package/dist/fleet-manager.js +656 -2028
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-instance.d.ts +0 -7
- package/dist/general-instance.js +3 -20
- package/dist/general-instance.js.map +1 -1
- package/dist/general-knowledge/skills/concepts/SKILL.md +393 -0
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +1 -0
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +3 -1
- package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +41 -4
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +9 -3
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
- package/dist/instance-config-impact.js +6 -7
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +19 -23
- package/dist/instance-lifecycle.js +216 -383
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instance-topic-delete.d.ts +77 -0
- package/dist/instance-topic-delete.js +123 -0
- package/dist/instance-topic-delete.js.map +1 -0
- package/dist/instructions.d.ts +1 -3
- package/dist/instructions.js +1 -7
- package/dist/instructions.js.map +1 -1
- package/dist/kiro-engine-status.d.ts +11 -0
- package/dist/kiro-engine-status.js +6 -0
- package/dist/kiro-engine-status.js.map +1 -1
- package/dist/locale.js +63 -86
- package/dist/locale.js.map +1 -1
- package/dist/log-service.d.ts +28 -0
- package/dist/log-service.js +29 -0
- package/dist/log-service.js.map +1 -1
- package/dist/log-steps.d.ts +4 -3
- package/dist/log-steps.js +32 -7
- package/dist/log-steps.js.map +1 -1
- package/dist/logger.d.ts +16 -2
- package/dist/logger.js +346 -66
- package/dist/logger.js.map +1 -1
- package/dist/login-flows.d.ts +7 -0
- package/dist/login-flows.js +5 -2
- package/dist/login-flows.js.map +1 -1
- package/dist/login-manager.js +25 -4
- package/dist/login-manager.js.map +1 -1
- package/dist/missed-offline.d.ts +25 -0
- package/dist/missed-offline.js +79 -0
- package/dist/missed-offline.js.map +1 -0
- package/dist/muse-usage-relay.d.ts +2 -0
- package/dist/muse-usage-relay.js +5 -3
- package/dist/muse-usage-relay.js.map +1 -1
- package/dist/needs-you-hub.d.ts +6 -3
- package/dist/needs-you-hub.js +31 -9
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +20 -18
- package/dist/needs-you.js +18 -14
- 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/outbound-handlers.d.ts +2 -16
- package/dist/outbound-handlers.js +10 -72
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +0 -38
- package/dist/outbound-schemas.js +5 -14
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-quota-history.d.ts +7 -0
- package/dist/pane-quota-history.js +47 -0
- package/dist/pane-quota-history.js.map +1 -0
- package/dist/platform-general.d.ts +46 -0
- package/dist/platform-general.js +91 -0
- package/dist/platform-general.js.map +1 -0
- package/dist/public-web-gateway.js +0 -9
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +0 -11
- package/dist/public-web-link.js +0 -13
- package/dist/public-web-link.js.map +1 -1
- package/dist/queued-handoffs.d.ts +33 -0
- package/dist/queued-handoffs.js +75 -0
- package/dist/queued-handoffs.js.map +1 -0
- package/dist/quickstart-api.js +5 -9
- package/dist/quickstart-api.js.map +1 -1
- package/dist/quickstart.d.ts +8 -1
- package/dist/quickstart.js +42 -4
- package/dist/quickstart.js.map +1 -1
- package/dist/quota-notice-config.d.ts +22 -0
- package/dist/quota-notice-config.js +41 -0
- package/dist/quota-notice-config.js.map +1 -0
- package/dist/quota-notice.d.ts +7 -0
- package/dist/quota-notice.js +40 -0
- package/dist/quota-notice.js.map +1 -1
- package/dist/reply-buttons-controller.js +10 -6
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/reply-polls.d.ts +2 -2
- package/dist/reply-polls.js +3 -3
- package/dist/reply-polls.js.map +1 -1
- package/dist/scheduler/db.d.ts +2 -1
- package/dist/scheduler/db.js +23 -9
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +9 -0
- package/dist/scheduler/task-board.js +19 -0
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/settings-api.d.ts +13 -5
- package/dist/settings-api.js +26 -96
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +0 -1
- package/dist/settings-baseline.js +1 -1
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +23 -28
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +1 -16
- package/dist/settings-confirmation.js +9 -47
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +0 -4
- package/dist/settings-effect.js +1 -58
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +0 -4
- package/dist/settings-http-confirmation.js +3 -31
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-instance-patch.js +28 -1
- package/dist/settings-instance-patch.js.map +1 -1
- package/dist/settings-request-capability.d.ts +0 -2
- package/dist/settings-request-capability.js +0 -4
- package/dist/settings-request-capability.js.map +1 -1
- package/dist/settings-transaction.d.ts +0 -4
- package/dist/settings-transaction.js +0 -9
- package/dist/settings-transaction.js.map +1 -1
- package/dist/setup-form.js +3 -6
- package/dist/setup-form.js.map +1 -1
- package/dist/setup-i18n.js +0 -3
- package/dist/setup-i18n.js.map +1 -1
- package/dist/task-board-tool.d.ts +11 -0
- package/dist/task-board-tool.js +44 -0
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-board-waker.d.ts +6 -0
- package/dist/task-board-waker.js +4 -0
- package/dist/task-board-waker.js.map +1 -1
- package/dist/tmux-control.d.ts +1 -2
- package/dist/tmux-control.js.map +1 -1
- package/dist/tmux-manager.d.ts +1 -2
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tool-permissions.d.ts +5 -2
- package/dist/tool-permissions.js +7 -7
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-progress.d.ts +2 -0
- package/dist/tool-progress.js +19 -3
- package/dist/tool-progress.js.map +1 -1
- package/dist/topic-commands.js +4 -3
- 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 +20 -3
- package/dist/transcript-monitor.js +92 -24
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-sources.d.ts +0 -5
- package/dist/transcript-sources.js +79 -8
- package/dist/transcript-sources.js.map +1 -1
- package/dist/types.d.ts +3 -23
- package/dist/ui/app.html +8 -1
- package/dist/ui/backend-signin.js +21 -36
- package/dist/ui/chat-md-strings.js +9 -0
- package/dist/ui/chat-store.js +2 -13
- package/dist/ui/chat-strings.js +2 -50
- package/dist/ui/chat-thread.js +53 -3
- package/dist/ui/fleet-task-card.js +3 -3
- package/dist/ui/fleet-task-common.js +10 -0
- package/dist/ui/fleet-tasks.js +7 -5
- package/dist/ui/fleet-usage.js +90 -27
- package/dist/ui/panel-chat.js +37 -66
- package/dist/ui/panel-details.js +1 -2
- package/dist/ui/panel-fleet.js +88 -107
- package/dist/ui/panel-needs.js +21 -163
- package/dist/ui/panel-notices.js +4 -3
- package/dist/ui/panel-settings.js +149 -239
- package/dist/ui/preview-panel.js +84 -6
- package/dist/ui/search-dialog.js +3 -2
- package/dist/ui/settings-appearance.js +23 -122
- package/dist/ui/settings-catalog.js +10 -37
- package/dist/ui/settings-codex-copy.js +19 -0
- package/dist/ui/settings-confirm.js +1 -3
- package/dist/ui/settings-dialogs.js +20 -27
- package/dist/ui/settings-guests.js +14 -27
- package/dist/ui/settings-model.js +17 -12
- package/dist/ui/settings-quota-notice.js +100 -0
- package/dist/ui/settings-registry.js +4 -11
- package/dist/ui/settings-strings.js +4 -113
- package/dist/ui/settings-web-authority.js +13 -15
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-needs.js +1 -1
- package/dist/ui/shared/app-route.js +2 -6
- package/dist/ui/shared/app-shell.js +18 -23
- package/dist/ui/shared/app-store.js +2 -3
- package/dist/ui/shared/app-stream.js +1 -3
- package/dist/ui/shared/app.css +40 -1312
- package/dist/ui/shared/app.js +2 -5
- package/dist/ui/shared/header-tools.js +4 -6
- package/dist/ui/shared/instance-nav.js +7 -34
- package/dist/ui/shared/instance-switch.js +3 -4
- package/dist/ui/shared/loading.css +37 -0
- package/dist/ui/shared/panel-view.js +77 -4
- package/dist/ui/shared/signin.js +6 -39
- package/dist/ui/shared/tokens.css +0 -1
- package/dist/ui/shared/ui-dialog.js +2 -2
- package/dist/ui/shared/ui-menu.js +10 -30
- package/dist/ui/shared/ui-states.js +14 -3
- package/dist/ui/shared/usage-dialog.js +18 -1
- package/dist/ui/shared/vendor/vendor.json +2 -19
- package/dist/ui/shared/view-history.css +17 -0
- package/dist/ui/shared/view-history.js +438 -0
- package/dist/ui/shared/view-strings.js +16 -8
- package/dist/ui/signin.html +5 -2
- package/dist/unattended-install.d.ts +11 -2
- package/dist/unattended-install.js +39 -5
- package/dist/unattended-install.js.map +1 -1
- package/dist/usage/capacity.d.ts +69 -0
- package/dist/usage/capacity.js +119 -0
- package/dist/usage/capacity.js.map +1 -0
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +3 -0
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/profile-timeline.d.ts +16 -0
- package/dist/usage/profile-timeline.js +58 -0
- package/dist/usage/profile-timeline.js.map +1 -0
- package/dist/usage/providers.d.ts +5 -0
- package/dist/usage/providers.js +5 -0
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/quota-history.d.ts +43 -0
- package/dist/usage/quota-history.js +168 -0
- package/dist/usage/quota-history.js.map +1 -0
- package/dist/usage/quota-notices.d.ts +38 -0
- package/dist/usage/quota-notices.js +160 -0
- package/dist/usage/quota-notices.js.map +1 -0
- package/dist/usage/usage-api.d.ts +32 -0
- package/dist/usage/usage-api.js +96 -1
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/usage-report.d.ts +25 -1
- package/dist/usage-report.js +55 -4
- package/dist/usage-report.js.map +1 -1
- package/dist/usage-rollup.d.ts +6 -1
- package/dist/usage-rollup.js +16 -4
- package/dist/usage-rollup.js.map +1 -1
- package/dist/view-api.d.ts +16 -0
- package/dist/view-api.js +100 -16
- package/dist/view-api.js.map +1 -1
- package/dist/view-history.d.ts +84 -0
- package/dist/view-history.js +116 -0
- package/dist/view-history.js.map +1 -0
- package/dist/web-api.d.ts +6 -38
- package/dist/web-api.js +20 -255
- package/dist/web-api.js.map +1 -1
- package/dist/web-chat-history.d.ts +2 -19
- package/dist/web-chat-history.js +3 -72
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-only-fleet.d.ts +0 -20
- package/dist/web-only-fleet.js +0 -21
- package/dist/web-only-fleet.js.map +1 -1
- package/dist/web-session-authorization.d.ts +13 -2
- package/dist/web-session-authorization.js +10 -3
- package/dist/web-session-authorization.js.map +1 -1
- package/dist/web-session.d.ts +0 -7
- package/dist/web-session.js +0 -2
- package/dist/web-session.js.map +1 -1
- package/dist/web-shell-routes.d.ts +1 -4
- package/dist/web-shell-routes.js +2 -7
- package/dist/web-shell-routes.js.map +1 -1
- package/launcher/private-home.cjs +1 -1
- package/package.json +3 -9
- package/dist/agent-runtime-api.d.ts +0 -4
- package/dist/agent-runtime-api.js +0 -59
- package/dist/agent-runtime-api.js.map +0 -1
- package/dist/agent-runtime-change.d.ts +0 -74
- package/dist/agent-runtime-change.js +0 -102
- package/dist/agent-runtime-change.js.map +0 -1
- package/dist/backend/grok-model-cache.d.ts +0 -7
- package/dist/backend/grok-model-cache.js +0 -65
- package/dist/backend/grok-model-cache.js.map +0 -1
- package/dist/backend/native-pane.d.ts +0 -9
- package/dist/backend/native-pane.js +0 -59
- package/dist/backend/native-pane.js.map +0 -1
- package/dist/fleet-windows-runtime.d.ts +0 -97
- package/dist/fleet-windows-runtime.js +0 -449
- package/dist/fleet-windows-runtime.js.map +0 -1
- package/dist/general-binding.d.ts +0 -85
- package/dist/general-binding.js +0 -298
- package/dist/general-binding.js.map +0 -1
- package/dist/general-host-owner.d.ts +0 -8
- package/dist/general-host-owner.js +0 -26
- package/dist/general-host-owner.js.map +0 -1
- package/dist/general-role.d.ts +0 -5
- package/dist/general-role.js +0 -26
- package/dist/general-role.js.map +0 -1
- package/dist/local-pane-endpoint.d.ts +0 -46
- package/dist/local-pane-endpoint.js +0 -189
- package/dist/local-pane-endpoint.js.map +0 -1
- package/dist/local-pane-launcher.d.ts +0 -2
- package/dist/local-pane-launcher.js +0 -38
- package/dist/local-pane-launcher.js.map +0 -1
- package/dist/local-pane-stage.ps1 +0 -101
- package/dist/model-catalog-defaults.d.ts +0 -14
- package/dist/model-catalog-defaults.js +0 -20
- package/dist/model-catalog-defaults.js.map +0 -1
- package/dist/native-agent-admission.d.ts +0 -7
- package/dist/native-agent-admission.js +0 -26
- package/dist/native-agent-admission.js.map +0 -1
- package/dist/native-daemon-client.d.ts +0 -13
- package/dist/native-daemon-client.js +0 -28
- package/dist/native-daemon-client.js.map +0 -1
- package/dist/native-instance-api.d.ts +0 -14
- package/dist/native-instance-api.js +0 -205
- package/dist/native-instance-api.js.map +0 -1
- package/dist/native-instance-input.d.ts +0 -84
- package/dist/native-instance-input.js +0 -54
- package/dist/native-instance-input.js.map +0 -1
- package/dist/native-instance-registry.d.ts +0 -32
- package/dist/native-instance-registry.js +0 -105
- package/dist/native-instance-registry.js.map +0 -1
- package/dist/native-mcp.d.ts +0 -40
- package/dist/native-mcp.js +0 -278
- package/dist/native-mcp.js.map +0 -1
- package/dist/native-model-catalog.d.ts +0 -5
- package/dist/native-model-catalog.js +0 -76
- package/dist/native-model-catalog.js.map +0 -1
- package/dist/native-pane-crash-budget.d.ts +0 -20
- package/dist/native-pane-crash-budget.js +0 -60
- package/dist/native-pane-crash-budget.js.map +0 -1
- package/dist/native-pane-create.d.ts +0 -26
- package/dist/native-pane-create.js +0 -53
- package/dist/native-pane-create.js.map +0 -1
- package/dist/native-pane-lifecycle.d.ts +0 -65
- package/dist/native-pane-lifecycle.js +0 -230
- package/dist/native-pane-lifecycle.js.map +0 -1
- package/dist/native-pane-manager.d.ts +0 -59
- package/dist/native-pane-manager.js +0 -584
- package/dist/native-pane-manager.js.map +0 -1
- package/dist/native-pane-output-log.d.ts +0 -15
- package/dist/native-pane-output-log.js +0 -108
- package/dist/native-pane-output-log.js.map +0 -1
- package/dist/native-pane-reconciliation.d.ts +0 -4
- package/dist/native-pane-reconciliation.js +0 -40
- package/dist/native-pane-reconciliation.js.map +0 -1
- package/dist/native-pane-recovery.d.ts +0 -12
- package/dist/native-pane-recovery.js +0 -10
- package/dist/native-pane-recovery.js.map +0 -1
- package/dist/native-pane-tools.d.ts +0 -2
- package/dist/native-pane-tools.js +0 -14
- package/dist/native-pane-tools.js.map +0 -1
- package/dist/pane-port.d.ts +0 -118
- package/dist/pane-port.js +0 -2
- package/dist/pane-port.js.map +0 -1
- package/dist/runtime-api.d.ts +0 -8
- package/dist/runtime-api.js +0 -171
- package/dist/runtime-api.js.map +0 -1
- package/dist/runtime-assets/@xterm/addon-serialize/LICENSE +0 -21
- package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.js +0 -2
- package/dist/runtime-assets/@xterm/addon-serialize/lib/addon-serialize.mjs +0 -19
- package/dist/runtime-assets/@xterm/addon-serialize/package.json +0 -29
- package/dist/runtime-assets/@xterm/headless/LICENSE +0 -21
- package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.js +0 -2
- package/dist/runtime-assets/@xterm/headless/lib-headless/xterm-headless.mjs +0 -46
- package/dist/runtime-assets/@xterm/headless/package.json +0 -29
- package/dist/runtime-assets/node-pty/CONPTY-LICENSE +0 -21
- package/dist/runtime-assets/node-pty/CONPTY-NOTICE.md +0 -503
- package/dist/runtime-assets/node-pty/LICENSE +0 -69
- package/dist/runtime-assets/node-pty/lib/conpty_console_list_agent.js +0 -16
- package/dist/runtime-assets/node-pty/lib/eventEmitter2.js +0 -47
- package/dist/runtime-assets/node-pty/lib/index.js +0 -52
- package/dist/runtime-assets/node-pty/lib/interfaces.js +0 -7
- package/dist/runtime-assets/node-pty/lib/shared/conout.js +0 -11
- package/dist/runtime-assets/node-pty/lib/terminal.js +0 -190
- package/dist/runtime-assets/node-pty/lib/types.js +0 -7
- package/dist/runtime-assets/node-pty/lib/unixTerminal.js +0 -346
- package/dist/runtime-assets/node-pty/lib/utils.js +0 -39
- package/dist/runtime-assets/node-pty/lib/windowsConoutConnection.js +0 -125
- package/dist/runtime-assets/node-pty/lib/windowsPtyAgent.js +0 -320
- package/dist/runtime-assets/node-pty/lib/windowsTerminal.js +0 -199
- package/dist/runtime-assets/node-pty/lib/worker/conoutSocketWorker.js +0 -22
- package/dist/runtime-assets/node-pty/package.json +0 -64
- 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-build-info.d.ts +0 -9
- package/dist/runtime-build-info.js +0 -57
- package/dist/runtime-build-info.js.map +0 -1
- package/dist/runtime-bundle.d.ts +0 -19
- package/dist/runtime-bundle.js +0 -156
- package/dist/runtime-bundle.js.map +0 -1
- package/dist/runtime-cli.d.ts +0 -7
- package/dist/runtime-cli.js +0 -152
- package/dist/runtime-cli.js.map +0 -1
- package/dist/runtime-client-store.d.ts +0 -68
- package/dist/runtime-client-store.js +0 -344
- package/dist/runtime-client-store.js.map +0 -1
- package/dist/runtime-client.d.ts +0 -112
- package/dist/runtime-client.js +0 -736
- package/dist/runtime-client.js.map +0 -1
- package/dist/runtime-connection.d.ts +0 -22
- package/dist/runtime-connection.js +0 -93
- package/dist/runtime-connection.js.map +0 -1
- package/dist/runtime-coordinator.d.ts +0 -91
- package/dist/runtime-coordinator.js +0 -911
- package/dist/runtime-coordinator.js.map +0 -1
- package/dist/runtime-general-protocol.d.ts +0 -22
- package/dist/runtime-general-protocol.js +0 -57
- package/dist/runtime-general-protocol.js.map +0 -1
- package/dist/runtime-general-workspace.d.ts +0 -17
- package/dist/runtime-general-workspace.js +0 -213
- package/dist/runtime-general-workspace.js.map +0 -1
- package/dist/runtime-pane-assets.d.ts +0 -17
- package/dist/runtime-pane-assets.js +0 -23
- package/dist/runtime-pane-assets.js.map +0 -1
- package/dist/runtime-pane-boot.d.ts +0 -9
- package/dist/runtime-pane-boot.js +0 -47
- package/dist/runtime-pane-boot.js.map +0 -1
- package/dist/runtime-pane-codex-index.d.ts +0 -1
- package/dist/runtime-pane-codex-index.js +0 -47
- package/dist/runtime-pane-codex-index.js.map +0 -1
- package/dist/runtime-pane-config.d.ts +0 -16
- package/dist/runtime-pane-config.js +0 -54
- package/dist/runtime-pane-config.js.map +0 -1
- package/dist/runtime-pane-host.d.ts +0 -44
- package/dist/runtime-pane-host.js +0 -424
- package/dist/runtime-pane-host.js.map +0 -1
- package/dist/runtime-pane-job-owner.d.ts +0 -1
- package/dist/runtime-pane-job-owner.js +0 -29
- package/dist/runtime-pane-job-owner.js.map +0 -1
- package/dist/runtime-pane-job.ps1 +0 -116
- package/dist/runtime-pane-link.d.ts +0 -40
- package/dist/runtime-pane-link.js +0 -246
- package/dist/runtime-pane-link.js.map +0 -1
- package/dist/runtime-pane-mcp-protocol.d.ts +0 -32
- package/dist/runtime-pane-mcp-protocol.js +0 -39
- package/dist/runtime-pane-mcp-protocol.js.map +0 -1
- package/dist/runtime-pane-mcp-relay.d.ts +0 -17
- package/dist/runtime-pane-mcp-relay.js +0 -70
- package/dist/runtime-pane-mcp-relay.js.map +0 -1
- package/dist/runtime-pane-mcp.d.ts +0 -51
- package/dist/runtime-pane-mcp.js +0 -150
- package/dist/runtime-pane-mcp.js.map +0 -1
- package/dist/runtime-pane-native.d.ts +0 -45
- package/dist/runtime-pane-native.js +0 -65
- package/dist/runtime-pane-native.js.map +0 -1
- package/dist/runtime-pane-output.d.ts +0 -19
- package/dist/runtime-pane-output.js +0 -53
- package/dist/runtime-pane-output.js.map +0 -1
- package/dist/runtime-pane-port.d.ts +0 -139
- package/dist/runtime-pane-port.js +0 -558
- package/dist/runtime-pane-port.js.map +0 -1
- package/dist/runtime-pane-private.d.ts +0 -14
- package/dist/runtime-pane-private.js +0 -51
- package/dist/runtime-pane-private.js.map +0 -1
- package/dist/runtime-pane-private.ps1 +0 -14
- package/dist/runtime-pane-process.d.ts +0 -4
- package/dist/runtime-pane-process.js +0 -108
- package/dist/runtime-pane-process.js.map +0 -1
- package/dist/runtime-pane-protocol.d.ts +0 -172
- package/dist/runtime-pane-protocol.js +0 -195
- package/dist/runtime-pane-protocol.js.map +0 -1
- package/dist/runtime-pane-screen.d.ts +0 -19
- package/dist/runtime-pane-screen.js +0 -76
- package/dist/runtime-pane-screen.js.map +0 -1
- package/dist/runtime-pane-service.d.ts +0 -11
- package/dist/runtime-pane-service.js +0 -221
- package/dist/runtime-pane-service.js.map +0 -1
- package/dist/runtime-pane-stdio-protocol.d.ts +0 -54
- package/dist/runtime-pane-stdio-protocol.js +0 -94
- package/dist/runtime-pane-stdio-protocol.js.map +0 -1
- package/dist/runtime-pane-stdio.d.ts +0 -3
- package/dist/runtime-pane-stdio.js +0 -123
- package/dist/runtime-pane-stdio.js.map +0 -1
- package/dist/runtime-pane-store.d.ts +0 -33
- package/dist/runtime-pane-store.js +0 -164
- package/dist/runtime-pane-store.js.map +0 -1
- package/dist/runtime-pane-transcript-protocol.d.ts +0 -43
- package/dist/runtime-pane-transcript-protocol.js +0 -58
- package/dist/runtime-pane-transcript-protocol.js.map +0 -1
- package/dist/runtime-pane-transcript.d.ts +0 -45
- package/dist/runtime-pane-transcript.js +0 -605
- package/dist/runtime-pane-transcript.js.map +0 -1
- package/dist/runtime-pane-worker.d.ts +0 -1
- package/dist/runtime-pane-worker.js +0 -154
- package/dist/runtime-pane-worker.js.map +0 -1
- package/dist/runtime-protocol.d.ts +0 -162
- package/dist/runtime-protocol.js +0 -37
- package/dist/runtime-protocol.js.map +0 -1
- package/dist/runtime-switches.d.ts +0 -79
- package/dist/runtime-switches.js +0 -90
- package/dist/runtime-switches.js.map +0 -1
- package/dist/runtime-transcript-delta-reader.d.ts +0 -23
- package/dist/runtime-transcript-delta-reader.js +0 -74
- package/dist/runtime-transcript-delta-reader.js.map +0 -1
- package/dist/runtime-transcript-source.d.ts +0 -36
- package/dist/runtime-transcript-source.js +0 -189
- package/dist/runtime-transcript-source.js.map +0 -1
- package/dist/runtime-windows-bridge.d.ts +0 -41
- package/dist/runtime-windows-bridge.js +0 -157
- package/dist/runtime-windows-bridge.js.map +0 -1
- package/dist/settings-route-lifetime.d.ts +0 -14
- package/dist/settings-route-lifetime.js +0 -48
- package/dist/settings-route-lifetime.js.map +0 -1
- package/dist/tmux-pane-host.d.ts +0 -26
- package/dist/tmux-pane-host.js +0 -25
- package/dist/tmux-pane-host.js.map +0 -1
- package/dist/transcript-needles.d.ts +0 -35
- package/dist/transcript-needles.js +0 -158
- package/dist/transcript-needles.js.map +0 -1
- package/dist/transcript-records.d.ts +0 -21
- package/dist/transcript-records.js +0 -140
- package/dist/transcript-records.js.map +0 -1
- package/dist/ui/agent-proposals.js +0 -90
- package/dist/ui/agent-runtime-settings.js +0 -67
- package/dist/ui/agent-runtime.js +0 -124
- package/dist/ui/cli-picker.js +0 -42
- package/dist/ui/general-location.js +0 -71
- package/dist/ui/native-instance-settings.js +0 -44
- package/dist/ui/native-pane-recovery.js +0 -45
- package/dist/ui/panel-runtimes.js +0 -334
- package/dist/ui/panel-windows-agent.js +0 -86
- package/dist/ui/panel-windows-cli.js +0 -179
- package/dist/ui/provider-marks.js +0 -83
- package/dist/ui/runtime-catalog.js +0 -55
- package/dist/ui/settings-agent-filters.js +0 -94
- package/dist/ui/settings-layout.js +0 -245
- package/dist/ui/settings-outside.js +0 -176
- package/dist/ui/settings-shortcuts.js +0 -65
- package/dist/ui/shared/machine-name.js +0 -13
- package/dist/ui/shared/qrcode.module.js +0 -2237
- package/dist/ui/shared/settings-width.js +0 -31
- package/dist/ui/shared/vendor/qrcode-generator.LICENSE +0 -27
- package/dist/ui/windows-agents-nav.js +0 -2
- package/dist/ui/windows-cli-catalog.js +0 -108
- package/dist/web-remote-access.d.ts +0 -152
- package/dist/web-remote-access.js +0 -368
- package/dist/web-remote-access.js.map +0 -1
- package/dist/windows-agents.d.ts +0 -126
- package/dist/windows-agents.js +0 -490
- package/dist/windows-agents.js.map +0 -1
- package/dist/windows-cli-api.d.ts +0 -23
- package/dist/windows-cli-api.js +0 -159
- package/dist/windows-cli-api.js.map +0 -1
- package/dist/windows-cli-providers.d.ts +0 -115
- package/dist/windows-cli-providers.js +0 -429
- package/dist/windows-cli-providers.js.map +0 -1
- package/dist/windows-cli-worker.d.ts +0 -59
- package/dist/windows-cli-worker.js +0 -479
- package/dist/windows-cli-worker.js.map +0 -1
- package/dist/windows-cli.d.ts +0 -116
- package/dist/windows-cli.js +0 -407
- package/dist/windows-cli.js.map +0 -1
- package/dist/windows-native-mcp.d.ts +0 -19
- package/dist/windows-native-mcp.js +0 -143
- package/dist/windows-native-mcp.js.map +0 -1
- package/dist/windows-pane-mcp.d.ts +0 -26
- package/dist/windows-pane-mcp.js +0 -187
- package/dist/windows-pane-mcp.js.map +0 -1
- package/templates/runtime-assets/conpty-LICENSE +0 -21
- package/templates/runtime-assets/conpty-NOTICE.md +0 -503
- package/templates/runtime-assets/local-pane-stage.ps1 +0 -101
- package/templates/runtime-assets/runtime-pane-job.ps1 +0 -116
- package/templates/runtime-assets/runtime-pane-private.ps1 +0 -14
- package/templates/runtime-assets/xterm-LICENSE +0 -21
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/** Native panes reuse the ordinary pure detectors, while all provider filesystem state stays on the runner. */
|
|
2
|
-
import { CodexPaneDetectors } from "./codex.js";
|
|
3
|
-
import { win32 } from "node:path";
|
|
4
|
-
import { ClaudePaneDetectors, claudeTrustDialogState } from "./claude-code.js";
|
|
5
|
-
import { selectionCard } from "../selection-card.js";
|
|
6
|
-
export function createNativePaneBackend(provider, snapshot) {
|
|
7
|
-
const forbidden = () => { throw Error("Native pane launch preparation must run on its owned Windows host"); };
|
|
8
|
-
const detectors = provider === "codex"
|
|
9
|
-
? new CodexPaneDetectors({ statusLineItems: () => snapshot().statusLineItems, launchMayResume: () => snapshot().resumes, windowsConpty: true })
|
|
10
|
-
: new ClaudePaneDetectors();
|
|
11
|
-
const originalStartup = detectors.getStartupDialogs.bind(detectors);
|
|
12
|
-
const originalRuntime = detectors.getRuntimeDialogs.bind(detectors);
|
|
13
|
-
const trustScope = (dialog) => {
|
|
14
|
-
if (provider !== "claude-code" || !dialog.description.startsWith("Claude workspace trust dialog"))
|
|
15
|
-
return dialog;
|
|
16
|
-
const matchesCwd = (pane) => {
|
|
17
|
-
const cwd = snapshot().cwd;
|
|
18
|
-
const paths = pane.split(/\r?\n/).map(row => row.trim()).filter(row => /^[A-Za-z]:[\\/]/.test(row));
|
|
19
|
-
return !!cwd && paths.length === 1 && win32.normalize(paths[0]).toLowerCase() === win32.normalize(cwd).toLowerCase();
|
|
20
|
-
};
|
|
21
|
-
return { ...dialog, isActive: (pane) => dialog.holdOnly
|
|
22
|
-
? !!dialog.isActive?.(pane) || (claudeTrustDialogState(pane).active && !matchesCwd(pane))
|
|
23
|
-
: matchesCwd(pane) && !!dialog.isActive?.(pane) };
|
|
24
|
-
};
|
|
25
|
-
const shellCard = (pane) => {
|
|
26
|
-
if (provider !== "claude-code" || detectors.readInputRow(pane) !== null
|
|
27
|
-
|| !/^[ \t]*(?:PowerShell|Bash) command[ \t]*$/m.test(pane)
|
|
28
|
-
|| !/^[ \t]*Do you want to proceed\?[ \t]*$/m.test(pane)
|
|
29
|
-
|| !/^[ \t]*Esc to cancel\b/m.test(pane))
|
|
30
|
-
return null;
|
|
31
|
-
const card = selectionCard(pane, "Claude Code");
|
|
32
|
-
return card && card.options.some(option => /^Yes\b/.test(option.title)) ? card : null;
|
|
33
|
-
};
|
|
34
|
-
const backend = Object.assign(detectors, {
|
|
35
|
-
buildCommand: (_config) => forbidden(),
|
|
36
|
-
writeConfig: (_config) => forbidden(),
|
|
37
|
-
getSessionId: () => snapshot().sessionId,
|
|
38
|
-
getContextUsage: () => snapshot().contextPercentage,
|
|
39
|
-
getStartupDialogs: () => originalStartup().map(dialog => {
|
|
40
|
-
// A pinned native resume may never answer the provider's generic picker by creating a fresh conversation.
|
|
41
|
-
if (provider === "claude-code" && snapshot().resumes && dialog.description === "Claude resume session picker — start fresh") {
|
|
42
|
-
return { ...dialog, keys: [], holdOnly: true, blocksDelivery: true };
|
|
43
|
-
}
|
|
44
|
-
return trustScope(dialog);
|
|
45
|
-
}),
|
|
46
|
-
getRuntimeDialogs: () => [...originalRuntime().map(trustScope), ...(provider === "claude-code" ? [{
|
|
47
|
-
// Windows uses a PowerShell permission shape distinct from the audited four-choice Unix Bash card. Never
|
|
48
|
-
// auto-answer it: expose its actual numbered choices through the ordinary stepwise human-card path.
|
|
49
|
-
pattern: /^[ \t]*Do you want to proceed\?[ \t]*$/m, isActive: (pane) => shellCard(pane) !== null,
|
|
50
|
-
// The request's own identity (as the Linux Bash card's is), not the whole pane: a repainted status row is the same
|
|
51
|
-
// request, so its episode and parked clock are not restarted by every capture.
|
|
52
|
-
remoteCard: shellCard, requestIdentity: (pane) => shellCard(pane)?.identity ?? null,
|
|
53
|
-
interactionKind: "permission", keys: [], holdOnly: true, blocksDelivery: true,
|
|
54
|
-
inputBlocked: true, description: "Claude Windows shell permission — waiting for a human choice, never auto-approving",
|
|
55
|
-
}] : [])],
|
|
56
|
-
});
|
|
57
|
-
return backend;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=native-pane.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"native-pane.js","sourceRoot":"","sources":["../../src/backend/native-pane.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import type { FleetConfig, InstanceConfig } from "./types.js";
|
|
2
|
-
import { type WindowsAgent, type WindowsAgents } from "./windows-agents.js";
|
|
3
|
-
import { type WindowsCliExecutor, type WindowsCliTask } from "./windows-cli.js";
|
|
4
|
-
import type { WebChatHistory } from "./web-chat-history.js";
|
|
5
|
-
import type { SettingsExecution } from "./settings-transaction.js";
|
|
6
|
-
import type { NativeMcpLease } from "./native-mcp.js";
|
|
7
|
-
import type { AgentRuntimeTarget, PreparedAgentRuntime } from "./agent-runtime-change.js";
|
|
8
|
-
export interface FleetWindowsRuntimeHost {
|
|
9
|
-
owner: object & {
|
|
10
|
-
dataDir?: string;
|
|
11
|
-
};
|
|
12
|
-
fleet(): FleetConfig | null;
|
|
13
|
-
save(): void;
|
|
14
|
-
emit(event: string, data: unknown): void;
|
|
15
|
-
stopping(): boolean;
|
|
16
|
-
history?: Pick<WebChatHistory, "findByMessageId"> & Partial<Pick<WebChatHistory, "reconcileNativeMessages">>;
|
|
17
|
-
openMcp?(instance: string, requestId: string, sandbox: WindowsAgent["sandbox"], stillCurrent: () => boolean): NativeMcpLease | null;
|
|
18
|
-
warn?(message: string, error: unknown): void;
|
|
19
|
-
removed?(name: string, config: InstanceConfig): void;
|
|
20
|
-
machineAvailable?(machineId: string): boolean;
|
|
21
|
-
paneCurrent?(name: string): boolean;
|
|
22
|
-
validateMachine?(machineId: string, cli: string, sandbox?: unknown): void;
|
|
23
|
-
machineGeneration?(machineId: string): string | null;
|
|
24
|
-
paneAvailable?(machineId: string): boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface NativeRuntimeDeliveryOptions {
|
|
27
|
-
/** The handoff fence: checked before the turn is journaled (it may include the sending request's own lifetime). */
|
|
28
|
-
stillCurrent?: () => boolean;
|
|
29
|
-
/**
|
|
30
|
-
* The sender's authority after the handoff — rechecked by the bridge before the Windows process is spawned and by the
|
|
31
|
-
* turn's MCP lease. It must not depend on the sending HTTP request still being open (that request is answered once
|
|
32
|
-
* the turn is journaled). Defaults to stillCurrent.
|
|
33
|
-
*/
|
|
34
|
-
authorityCurrent?: () => boolean;
|
|
35
|
-
/** A durable outbox fences its attempt immediately before the native task is claimed. */
|
|
36
|
-
beforeStart?: () => void;
|
|
37
|
-
}
|
|
38
|
-
export type NativeRuntimePatch = Pick<InstanceConfig, "display_name" | "description" | "systemPrompt" | "model" | "working_directory" | "native_sandbox" | "tags">;
|
|
39
|
-
export type NativeExecutionResult = WindowsCliTask & {
|
|
40
|
-
reportedCorrelationIds?: readonly string[];
|
|
41
|
-
};
|
|
42
|
-
export declare class FleetWindowsRuntime {
|
|
43
|
-
private readonly host;
|
|
44
|
-
private readonly mcpLeases;
|
|
45
|
-
private readonly store;
|
|
46
|
-
private readonly bridge;
|
|
47
|
-
constructor(host: FleetWindowsRuntimeHost, deps?: {
|
|
48
|
-
store?: WindowsAgents;
|
|
49
|
-
bridge?: WindowsCliExecutor;
|
|
50
|
-
});
|
|
51
|
-
private config;
|
|
52
|
-
has(name: string): boolean;
|
|
53
|
-
busy(name?: string): boolean;
|
|
54
|
-
private id;
|
|
55
|
-
private enabled;
|
|
56
|
-
private closeMcp;
|
|
57
|
-
private changed;
|
|
58
|
-
/** The host replaces this lightweight signal with the complete shared status frame. */
|
|
59
|
-
private statusFrame;
|
|
60
|
-
register(): boolean;
|
|
61
|
-
get(name: string): (WindowsAgent & {
|
|
62
|
-
blocked: boolean;
|
|
63
|
-
}) | null;
|
|
64
|
-
status(name: string): "running" | "paused" | "stopped" | "crashed";
|
|
65
|
-
execution(name: string): "working" | "idle" | null;
|
|
66
|
-
/** Prepare a separate, pre-bound profile. The old conversation remains intact; startup cannot import an orphan. */
|
|
67
|
-
prepareRuntimeChange(name: string, before: InstanceConfig, target: AgentRuntimeTarget, current: () => boolean): Promise<PreparedAgentRuntime>;
|
|
68
|
-
available(name: string): boolean;
|
|
69
|
-
create(input: Record<string, unknown>, authorized: () => boolean, transaction?: Pick<SettingsExecution, "mutate" | "complete">, binding?: {
|
|
70
|
-
native_adapter: "pane";
|
|
71
|
-
topic_id?: number | string;
|
|
72
|
-
channel_id?: string;
|
|
73
|
-
}): Promise<{
|
|
74
|
-
name: string;
|
|
75
|
-
runtime: "windows";
|
|
76
|
-
agent: WindowsAgent;
|
|
77
|
-
}>;
|
|
78
|
-
previewUpdate(name: string, patch: Partial<NativeRuntimePatch>): WindowsAgent;
|
|
79
|
-
update(name: string, patch: Partial<NativeRuntimePatch>, authorized: () => boolean, transaction?: Pick<SettingsExecution, "mutate" | "complete">): {
|
|
80
|
-
name: string;
|
|
81
|
-
agent: WindowsAgent;
|
|
82
|
-
};
|
|
83
|
-
remove(name: string, authorized: () => boolean, transaction?: Pick<SettingsExecution, "mutate" | "complete">): void;
|
|
84
|
-
setPaused(name: string, paused: boolean): void;
|
|
85
|
-
cancel(name: string): WindowsCliTask | null;
|
|
86
|
-
recover(name: string, confirmedStopped: unknown): WindowsAgent & {
|
|
87
|
-
blocked: boolean;
|
|
88
|
-
};
|
|
89
|
-
recoverAsync(name: string, confirmedStopped: unknown): Promise<WindowsAgent & {
|
|
90
|
-
blocked: boolean;
|
|
91
|
-
}>;
|
|
92
|
-
/** Idempotently bring existing native conversations into shared chat history and search. */
|
|
93
|
-
importHistory(instance?: string): void;
|
|
94
|
-
private claim;
|
|
95
|
-
deliver(name: string, payload: Record<string, unknown>, options?: NativeRuntimeDeliveryOptions): Promise<boolean>;
|
|
96
|
-
execute(name: string, payload: Record<string, unknown>, options?: NativeRuntimeDeliveryOptions): Promise<NativeExecutionResult>;
|
|
97
|
-
}
|
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
/** Windows execution adapter for the ordinary Fleet instance registry and delivery facade. */
|
|
2
|
-
import { addsSecondGeneral } from "./web-only-fleet.js";
|
|
3
|
-
import { randomUUID } from "node:crypto";
|
|
4
|
-
import { windowsAgentsFor } from "./windows-agents.js";
|
|
5
|
-
import { LOCAL_WINDOWS_CLI_OFF, windowsBridgeFor, windowsCliEnabled } from "./windows-cli.js";
|
|
6
|
-
import { localWindowsCliEnabled, remoteRuntimeEnabled } from "./runtime-switches.js";
|
|
7
|
-
/** M-2255: the switch for where this agent runs — this PC's Windows CLIs, or the other Windows computers. */
|
|
8
|
-
const switchedOn = (agent) => agent.machineId ? remoteRuntimeEnabled() : localWindowsCliEnabled();
|
|
9
|
-
import { isWindowsInstance, isNativeExecInstance, nativeAgentId, nativeInstanceConfig, nativeInstanceName, registerWindowsProfiles, previewWindowsProfile, syncWindowsProfile } from "./native-instance-registry.js";
|
|
10
|
-
import { validWindowsAgentId } from "./windows-cli-worker.js";
|
|
11
|
-
import { nativeProviderMcpSupported } from "./windows-cli-providers.js";
|
|
12
|
-
export class FleetWindowsRuntime {
|
|
13
|
-
host;
|
|
14
|
-
mcpLeases = new Map();
|
|
15
|
-
store;
|
|
16
|
-
bridge;
|
|
17
|
-
constructor(host, deps = {}) {
|
|
18
|
-
this.host = host;
|
|
19
|
-
this.bridge = deps.bridge ?? windowsBridgeFor(host.owner);
|
|
20
|
-
this.store = deps.store ?? windowsAgentsFor(host.owner, this.bridge);
|
|
21
|
-
}
|
|
22
|
-
config(name) { return this.host.fleet()?.instances[name] ?? null; }
|
|
23
|
-
has(name) { return isWindowsInstance(this.config(name)); }
|
|
24
|
-
busy(name) { return this.bridge.hasActiveTask(name ? this.config(name)?.machine_id : undefined); }
|
|
25
|
-
id(name) {
|
|
26
|
-
const id = nativeAgentId(this.config(name));
|
|
27
|
-
if (!id)
|
|
28
|
-
throw new Error("Instance does not name a valid Windows runtime agent");
|
|
29
|
-
return id;
|
|
30
|
-
}
|
|
31
|
-
enabled() { if (!windowsCliEnabled())
|
|
32
|
-
throw new Error("Windows runtime is disabled"); }
|
|
33
|
-
closeMcp(name) {
|
|
34
|
-
const active = this.mcpLeases.get(name);
|
|
35
|
-
this.mcpLeases.delete(name);
|
|
36
|
-
active?.lease.close();
|
|
37
|
-
}
|
|
38
|
-
changed(name) {
|
|
39
|
-
if (name)
|
|
40
|
-
this.host.emit("activity", { instance: name, state: this.execution(name) });
|
|
41
|
-
this.host.emit("status", this.statusFrame());
|
|
42
|
-
}
|
|
43
|
-
/** The host replaces this lightweight signal with the complete shared status frame. */
|
|
44
|
-
statusFrame() { return { runtimeChanged: true }; }
|
|
45
|
-
register() {
|
|
46
|
-
const fleet = this.host.fleet();
|
|
47
|
-
return !!fleet && windowsCliEnabled() && registerWindowsProfiles(fleet, this.store, this.host.save);
|
|
48
|
-
}
|
|
49
|
-
get(name) {
|
|
50
|
-
const config = this.config(name);
|
|
51
|
-
if (!isWindowsInstance(config))
|
|
52
|
-
return null;
|
|
53
|
-
const agent = this.store.get(this.id(name));
|
|
54
|
-
if (config.machine_id !== agent.machineId)
|
|
55
|
-
throw new Error("The instance machine does not match its saved conversation");
|
|
56
|
-
const blocked = config.native_adapter === "pane" && agent.paneLaunchId ? this.host.paneCurrent?.(name) !== true : agent.blocked;
|
|
57
|
-
return { ...agent, blocked, name: config.display_name ?? agent.name, description: config.description ?? "", instructions: config.systemPrompt ?? "", cwd: config.working_directory, model: config.model || undefined, sandbox: config.native_sandbox ?? agent.sandbox };
|
|
58
|
-
}
|
|
59
|
-
status(name) {
|
|
60
|
-
let agent;
|
|
61
|
-
try {
|
|
62
|
-
agent = this.get(name);
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
return "crashed";
|
|
66
|
-
}
|
|
67
|
-
if (!agent || !switchedOn(agent))
|
|
68
|
-
return "stopped";
|
|
69
|
-
return agent.blocked ? "crashed" : agent.paused ? "paused" : "running";
|
|
70
|
-
}
|
|
71
|
-
execution(name) {
|
|
72
|
-
let agent;
|
|
73
|
-
try {
|
|
74
|
-
agent = this.get(name);
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
return !agent || agent.paused || agent.blocked || !switchedOn(agent) ? null : agent.activeId ? "working" : "idle";
|
|
80
|
-
}
|
|
81
|
-
/** Prepare a separate, pre-bound profile. The old conversation remains intact; startup cannot import an orphan. */
|
|
82
|
-
async prepareRuntimeChange(name, before, target, current) {
|
|
83
|
-
const identity = target.machineId ? this.host.machineGeneration?.(target.machineId) : undefined;
|
|
84
|
-
let revoked = false;
|
|
85
|
-
const targetCurrent = () => {
|
|
86
|
-
if (revoked)
|
|
87
|
-
return false;
|
|
88
|
-
try {
|
|
89
|
-
if (target.machineId) {
|
|
90
|
-
if (!remoteRuntimeEnabled() || !this.host.validateMachine)
|
|
91
|
-
throw Error("Remote runtime is disabled");
|
|
92
|
-
this.host.validateMachine(target.machineId, target.backend, target.sandbox);
|
|
93
|
-
}
|
|
94
|
-
else if (!localWindowsCliEnabled())
|
|
95
|
-
throw Error(LOCAL_WINDOWS_CLI_OFF);
|
|
96
|
-
if (target.machineId && this.host.machineGeneration && (!identity || this.host.machineGeneration(target.machineId) !== identity))
|
|
97
|
-
throw Error("Runtime connection changed");
|
|
98
|
-
if (target.machineId && target.adapter === "pane" && this.host.paneAvailable?.(target.machineId) === false)
|
|
99
|
-
throw Error("This Runtime does not support persistent terminals; update it before switching");
|
|
100
|
-
return true;
|
|
101
|
-
}
|
|
102
|
-
catch {
|
|
103
|
-
revoked = true;
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const validate = () => { if (!current() || !targetCurrent())
|
|
108
|
-
throw Error("Selected Runtime is unavailable or changed during the operation"); };
|
|
109
|
-
validate();
|
|
110
|
-
if (!target.machineId) {
|
|
111
|
-
const inventory = await this.bridge.probe({ force: false });
|
|
112
|
-
validate();
|
|
113
|
-
if (!inventory.clis.some(cli => cli.id === target.backend && cli.runnable && cli.supports.resume))
|
|
114
|
-
throw Error("Choose an available CLI on the selected Windows computer");
|
|
115
|
-
}
|
|
116
|
-
const agent = await this.store.create({ name: before.display_name || name, cli: target.backend, model: target.model,
|
|
117
|
-
...(target.directory.trim() ? { cwd: target.directory.trim() } : {}), ...(target.machineId ? { machineId: target.machineId } : {}),
|
|
118
|
-
sandbox: target.sandbox, description: before.description ?? "", instructions: before.systemPrompt ?? "" }, () => { try {
|
|
119
|
-
validate();
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
catch {
|
|
123
|
-
return false;
|
|
124
|
-
} }, { instance: name });
|
|
125
|
-
const discard = () => { this.store.remove(agent.id); };
|
|
126
|
-
try {
|
|
127
|
-
validate();
|
|
128
|
-
if (target.adapter === "pane")
|
|
129
|
-
this.store.setPaused(agent.id, false);
|
|
130
|
-
const config = { ...before, runtime: "windows", native_agent_id: agent.id, native_adapter: target.adapter,
|
|
131
|
-
native_sandbox: agent.sandbox, working_directory: agent.cwd, backend: agent.cli, model: agent.model || "", agent_mode: "cli" };
|
|
132
|
-
if (agent.machineId)
|
|
133
|
-
config.machine_id = agent.machineId;
|
|
134
|
-
else
|
|
135
|
-
delete config.machine_id;
|
|
136
|
-
// A Windows Agent has no Linux credential profile or shell hook; #3036's General move drops the same three fields.
|
|
137
|
-
for (const key of ["backend_options", "credential_profile", "pre_task_command"])
|
|
138
|
-
delete config[key];
|
|
139
|
-
if (before.backend !== target.backend)
|
|
140
|
-
config.model_failover = [];
|
|
141
|
-
return { config, discard, current: targetCurrent };
|
|
142
|
-
}
|
|
143
|
-
catch (error) {
|
|
144
|
-
discard();
|
|
145
|
-
throw error;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
available(name) {
|
|
149
|
-
let agent;
|
|
150
|
-
try {
|
|
151
|
-
agent = this.get(name);
|
|
152
|
-
}
|
|
153
|
-
catch {
|
|
154
|
-
return false;
|
|
155
|
-
}
|
|
156
|
-
return !!agent && switchedOn(agent) && !this.host.stopping() && !agent.blocked && !agent.paused
|
|
157
|
-
&& (!agent.machineId || this.host.machineAvailable?.(agent.machineId) === true)
|
|
158
|
-
&& !this.bridge.hasActiveTask(agent.machineId);
|
|
159
|
-
}
|
|
160
|
-
async create(input, authorized, transaction, binding) {
|
|
161
|
-
this.enabled();
|
|
162
|
-
const fleet = this.host.fleet();
|
|
163
|
-
if (!fleet)
|
|
164
|
-
throw new Error("Fleet configuration is unavailable");
|
|
165
|
-
// #3021 review: a Windows agent inherits the defaults too — never a second General on a fleet with no chat connection.
|
|
166
|
-
if (addsSecondGeneral(fleet))
|
|
167
|
-
throw new Error("one_general: this fleet already has its General, and a new agent would inherit defaults.general_topic: true");
|
|
168
|
-
const { tags, ...profile } = input;
|
|
169
|
-
if (profile.machineId !== undefined) {
|
|
170
|
-
if (typeof profile.machineId !== "string" || !this.host.validateMachine)
|
|
171
|
-
throw new Error("Remote runtime is not enabled");
|
|
172
|
-
this.host.validateMachine(profile.machineId, String(profile.cli ?? "codex"), profile.sandbox);
|
|
173
|
-
}
|
|
174
|
-
else if (!localWindowsCliEnabled())
|
|
175
|
-
throw new Error(LOCAL_WINDOWS_CLI_OFF); // M-2255: refused before anything is made
|
|
176
|
-
const agent = await this.store.create(profile, authorized), name = nativeInstanceName(agent.id), before = fleet.instances[name];
|
|
177
|
-
try {
|
|
178
|
-
const persist = () => {
|
|
179
|
-
if (!authorized())
|
|
180
|
-
throw new Error("Authorization expired");
|
|
181
|
-
if (Object.hasOwn(fleet.instances, name))
|
|
182
|
-
throw new Error("Instance name already exists");
|
|
183
|
-
// #3021 review r2: asked again at the commit, after the profile's await — a create made meanwhile counts.
|
|
184
|
-
if (addsSecondGeneral(fleet))
|
|
185
|
-
throw new Error("one_general: this fleet already has its General, and a new agent would inherit defaults.general_topic: true");
|
|
186
|
-
fleet.instances[name] = { ...nativeInstanceConfig(agent), ...binding, ...(Array.isArray(tags) ? { tags: tags } : {}) };
|
|
187
|
-
this.host.save();
|
|
188
|
-
};
|
|
189
|
-
if (transaction)
|
|
190
|
-
transaction.mutate(persist);
|
|
191
|
-
else
|
|
192
|
-
persist();
|
|
193
|
-
}
|
|
194
|
-
catch (error) {
|
|
195
|
-
if (before)
|
|
196
|
-
fleet.instances[name] = before;
|
|
197
|
-
else
|
|
198
|
-
delete fleet.instances[name];
|
|
199
|
-
this.store.remove(agent.id);
|
|
200
|
-
throw error;
|
|
201
|
-
}
|
|
202
|
-
// Fleet configuration is the identity commit point. A crash before this best-effort backlink must leave
|
|
203
|
-
// an unbound profile that startup can repair, never a bound-but-unregistered conversation.
|
|
204
|
-
try {
|
|
205
|
-
this.store.bindInstance(agent.id, name);
|
|
206
|
-
}
|
|
207
|
-
catch (error) {
|
|
208
|
-
this.host.warn?.("Windows profile backlink will be repaired on the next registration", error);
|
|
209
|
-
}
|
|
210
|
-
transaction?.complete();
|
|
211
|
-
this.changed(name);
|
|
212
|
-
return { name, runtime: "windows", agent };
|
|
213
|
-
}
|
|
214
|
-
previewUpdate(name, patch) {
|
|
215
|
-
if (!patch || typeof patch !== "object" || Array.isArray(patch) || Object.keys(patch).some(key => !["display_name", "description", "systemPrompt", "model", "working_directory", "native_sandbox", "tags"].includes(key)))
|
|
216
|
-
throw Error("Unknown Windows instance setting");
|
|
217
|
-
if (Object.hasOwn(patch, "tags") && (!Array.isArray(patch.tags) || patch.tags.length > 32 || patch.tags.some(tag => typeof tag !== "string" || !tag || tag.length > 64)))
|
|
218
|
-
throw Error("Invalid Windows instance tags");
|
|
219
|
-
this.enabled();
|
|
220
|
-
const before = this.config(name);
|
|
221
|
-
if (!before || !this.has(name))
|
|
222
|
-
throw Error("Windows instance not found");
|
|
223
|
-
return previewWindowsProfile({ ...before, ...patch }, this.store);
|
|
224
|
-
}
|
|
225
|
-
update(name, patch, authorized, transaction) {
|
|
226
|
-
this.enabled();
|
|
227
|
-
const fleet = this.host.fleet(), before = this.config(name);
|
|
228
|
-
if (!fleet || !before || !this.has(name))
|
|
229
|
-
throw new Error("Windows instance not found");
|
|
230
|
-
const id = this.id(name), old = this.store.get(id);
|
|
231
|
-
const checked = this.previewUpdate(name, patch);
|
|
232
|
-
const next = { ...before, ...structuredClone(patch) };
|
|
233
|
-
// Persist the provider validator's canonical values as well as the profile: launch ownership compares both.
|
|
234
|
-
const fields = { display_name: "name", description: "description", systemPrompt: "instructions", model: "model", working_directory: "cwd", native_sandbox: "sandbox" };
|
|
235
|
-
for (const field of Object.keys(fields))
|
|
236
|
-
if (Object.hasOwn(patch, field))
|
|
237
|
-
next[field] = checked[fields[field]] ?? "";
|
|
238
|
-
const updated = syncWindowsProfile(next, this.store, authorized);
|
|
239
|
-
// #2942: a settings execution (an agent's confirmed request) writes through its transaction, like create does.
|
|
240
|
-
const write = () => { if (!authorized())
|
|
241
|
-
throw new Error("Authorization expired"); fleet.instances[name] = next; this.host.save(); };
|
|
242
|
-
try {
|
|
243
|
-
if (transaction)
|
|
244
|
-
transaction.mutate(write);
|
|
245
|
-
else
|
|
246
|
-
write();
|
|
247
|
-
}
|
|
248
|
-
catch (error) {
|
|
249
|
-
fleet.instances[name] = before;
|
|
250
|
-
this.store.update(id, { name: old.name, cwd: old.cwd, description: old.description, instructions: old.instructions, model: old.model ?? "", cli: old.cli, sandbox: old.sandbox });
|
|
251
|
-
throw error;
|
|
252
|
-
}
|
|
253
|
-
transaction?.complete();
|
|
254
|
-
this.changed(name);
|
|
255
|
-
return { name, agent: updated };
|
|
256
|
-
}
|
|
257
|
-
remove(name, authorized, transaction) {
|
|
258
|
-
this.enabled();
|
|
259
|
-
const fleet = this.host.fleet(), before = this.config(name);
|
|
260
|
-
if (!fleet || !before || !this.has(name))
|
|
261
|
-
throw new Error("Windows instance not found");
|
|
262
|
-
const id = this.id(name), teams = structuredClone(fleet.teams), snapshot = this.store.remove(id, authorized);
|
|
263
|
-
try {
|
|
264
|
-
const persist = () => {
|
|
265
|
-
if (!authorized())
|
|
266
|
-
throw new Error("Authorization expired");
|
|
267
|
-
delete fleet.instances[name];
|
|
268
|
-
for (const [key, team] of Object.entries(fleet.teams ?? {})) {
|
|
269
|
-
team.members = team.members.filter(member => member !== name);
|
|
270
|
-
if (!team.members.length)
|
|
271
|
-
delete fleet.teams[key];
|
|
272
|
-
}
|
|
273
|
-
this.host.save();
|
|
274
|
-
};
|
|
275
|
-
if (transaction)
|
|
276
|
-
transaction.mutate(persist);
|
|
277
|
-
else
|
|
278
|
-
persist();
|
|
279
|
-
}
|
|
280
|
-
catch (error) {
|
|
281
|
-
fleet.instances[name] = before;
|
|
282
|
-
fleet.teams = teams;
|
|
283
|
-
this.store.restore(snapshot);
|
|
284
|
-
throw error;
|
|
285
|
-
}
|
|
286
|
-
transaction?.complete();
|
|
287
|
-
this.closeMcp(name);
|
|
288
|
-
try {
|
|
289
|
-
this.host.removed?.(name, before);
|
|
290
|
-
}
|
|
291
|
-
catch (error) {
|
|
292
|
-
this.host.warn?.("Windows instance was removed but some shared metadata cleanup needs attention", error);
|
|
293
|
-
}
|
|
294
|
-
this.changed();
|
|
295
|
-
}
|
|
296
|
-
setPaused(name, paused) {
|
|
297
|
-
this.enabled();
|
|
298
|
-
this.store.setPaused(this.id(name), paused);
|
|
299
|
-
if (paused) {
|
|
300
|
-
this.closeMcp(name);
|
|
301
|
-
this.store.cancel(this.id(name));
|
|
302
|
-
}
|
|
303
|
-
this.changed(name);
|
|
304
|
-
}
|
|
305
|
-
cancel(name) { this.closeMcp(name); const result = this.store.cancel(this.id(name)); this.changed(name); return result; }
|
|
306
|
-
recover(name, confirmedStopped) {
|
|
307
|
-
const result = this.store.recover(this.id(name), confirmedStopped);
|
|
308
|
-
this.changed(name);
|
|
309
|
-
return result;
|
|
310
|
-
}
|
|
311
|
-
async recoverAsync(name, confirmedStopped) {
|
|
312
|
-
const agent = this.get(name);
|
|
313
|
-
if (!agent?.machineId)
|
|
314
|
-
return this.recover(name, confirmedStopped);
|
|
315
|
-
if (confirmedStopped !== true || !agent.activeId || !agent.blocked)
|
|
316
|
-
throw new Error("Confirm the remote execution stopped before recovery");
|
|
317
|
-
const bridge = this.bridge;
|
|
318
|
-
if (!bridge.recoverRemote)
|
|
319
|
-
throw new Error("Remote recovery is unavailable");
|
|
320
|
-
await bridge.recoverRemote(agent.machineId, agent.activeId);
|
|
321
|
-
const result = this.get(name);
|
|
322
|
-
this.changed(name);
|
|
323
|
-
return result;
|
|
324
|
-
}
|
|
325
|
-
/** Idempotently bring existing native conversations into shared chat history and search. */
|
|
326
|
-
importHistory(instance) {
|
|
327
|
-
if (!this.host.history)
|
|
328
|
-
return;
|
|
329
|
-
for (const [name, config] of Object.entries(this.host.fleet()?.instances ?? {})) {
|
|
330
|
-
if (instance && name !== instance)
|
|
331
|
-
continue;
|
|
332
|
-
if (!isWindowsInstance(config))
|
|
333
|
-
continue;
|
|
334
|
-
const agent = this.store.get(this.id(name));
|
|
335
|
-
const expected = [];
|
|
336
|
-
for (const turn of agent.turns) {
|
|
337
|
-
const userId = `native:${turn.id}:user`, replyId = `native:${turn.id}:reply`;
|
|
338
|
-
expected.push({ role: "user", sender: "You", text: turn.prompt, ts: new Date(turn.startedAt).toISOString(), messageId: userId });
|
|
339
|
-
if (turn.finishedAt)
|
|
340
|
-
expected.push({ role: turn.status === "completed" ? "agent" : "status", sender: agent.name, text: turn.output || turn.error || turn.status, ts: new Date(turn.finishedAt).toISOString(), messageId: replyId });
|
|
341
|
-
}
|
|
342
|
-
this.host.history.reconcileNativeMessages?.(name, expected);
|
|
343
|
-
for (const message of expected)
|
|
344
|
-
if (!this.host.history.findByMessageId(name, message.messageId))
|
|
345
|
-
this.host.emit("message", { instance: name, ...message });
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
claim(name, payload, options, settled) {
|
|
349
|
-
this.enabled();
|
|
350
|
-
if (this.host.stopping() || options.stillCurrent?.() === false)
|
|
351
|
-
throw new Error("Windows delivery is no longer current");
|
|
352
|
-
const config = this.config(name);
|
|
353
|
-
if (!config || !this.has(name))
|
|
354
|
-
throw new Error("Windows instance not found");
|
|
355
|
-
if (!isNativeExecInstance(config))
|
|
356
|
-
throw new Error("Persistent native panes use the ordinary daemon delivery path");
|
|
357
|
-
const agent = syncWindowsProfile(config, this.store);
|
|
358
|
-
if (!switchedOn(agent))
|
|
359
|
-
throw new Error(agent.machineId ? "Other Windows computers are turned off. Turn them on in Settings → Runtime." : LOCAL_WINDOWS_CLI_OFF);
|
|
360
|
-
if (agent.machineId && this.host.machineAvailable?.(agent.machineId) !== true)
|
|
361
|
-
throw new Error("This runtime machine is offline. Reconnect it before sending a message.");
|
|
362
|
-
const raw = typeof payload.content === "string" ? payload.content : typeof payload.text === "string" ? payload.text
|
|
363
|
-
: payload.payload && typeof payload.payload === "object" ? payload.payload.message : undefined;
|
|
364
|
-
if (typeof raw !== "string" || !raw.trim())
|
|
365
|
-
throw new Error("Windows delivery needs a text message");
|
|
366
|
-
if (["raw_paste", "steer"].includes(String(payload.type)))
|
|
367
|
-
throw new Error("This Windows runtime supports messages, not terminal input or steering");
|
|
368
|
-
const requestId = validWindowsAgentId(payload.requestId) ? payload.requestId : randomUUID();
|
|
369
|
-
options.beforeStart?.();
|
|
370
|
-
const meta = payload.meta && typeof payload.meta === "object" ? payload.meta : {};
|
|
371
|
-
const authority = options.authorityCurrent ?? options.stillCurrent;
|
|
372
|
-
const existing = agent.turns.some(turn => turn.id === requestId);
|
|
373
|
-
let lease = null;
|
|
374
|
-
if (!existing && nativeProviderMcpSupported(agent.cli) && this.host.openMcp) {
|
|
375
|
-
this.closeMcp(name);
|
|
376
|
-
lease = this.host.openMcp(name, requestId, agent.sandbox, () => {
|
|
377
|
-
if (this.host.stopping() || !switchedOn(agent) || authority?.() === false
|
|
378
|
-
|| agent.machineId && this.host.machineAvailable?.(agent.machineId) !== true)
|
|
379
|
-
return false;
|
|
380
|
-
try {
|
|
381
|
-
const current = this.get(name);
|
|
382
|
-
return !!current && current.activeId === requestId && !current.paused && !current.blocked;
|
|
383
|
-
}
|
|
384
|
-
catch {
|
|
385
|
-
return false;
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
if (lease)
|
|
389
|
-
this.mcpLeases.set(name, { requestId, lease });
|
|
390
|
-
}
|
|
391
|
-
const closeLease = () => { if (lease) {
|
|
392
|
-
lease.close();
|
|
393
|
-
if (this.mcpLeases.get(name)?.lease === lease)
|
|
394
|
-
this.mcpLeases.delete(name);
|
|
395
|
-
} };
|
|
396
|
-
const context = lease ? [
|
|
397
|
-
`Your AgEnD instance is ${name}. AgEnD tools query Fleet agents, tasks and delivery receipts. ${agent.sandbox === "read-only" ? "This turn permits queries only; delegation and task changes are unavailable." : "Send/delegate tools enqueue work and return a receipt; do not wait for another Windows agent while holding this turn."}`,
|
|
398
|
-
...(typeof meta.from_instance === "string" ? [`Incoming Fleet context: ${JSON.stringify({ from_instance: meta.from_instance.slice(0, 128), correlation_id: typeof meta.correlation_id === "string" ? meta.correlation_id.slice(0, 256) : undefined, requires_reply: meta.requires_reply === "true" })}`] : []),
|
|
399
|
-
].join("\n") : undefined;
|
|
400
|
-
let task;
|
|
401
|
-
try {
|
|
402
|
-
task = this.store.send(agent.id, { requestId, prompt: raw }, () => !this.host.stopping() && authority?.() !== false, { ...(lease ? { mcp: lease.connection, context } : {}), onSettled: task => {
|
|
403
|
-
const reportedCorrelationIds = lease?.reportedCorrelations(typeof meta.from_instance === "string" ? meta.from_instance : undefined) ?? [];
|
|
404
|
-
closeLease();
|
|
405
|
-
const replyId = `native:${task.id}:reply`;
|
|
406
|
-
if (!this.host.history?.findByMessageId(name, replyId))
|
|
407
|
-
this.host.emit("message", { instance: name, role: task.status === "completed" ? "agent" : "status", sender: this.config(name)?.display_name || agent.name, text: task.status === "completed" ? task.output || "(No text output)" : [task.output, task.error || task.status].filter(Boolean).join("\n"), ts: new Date(task.finishedAt ?? Date.now()).toISOString(), messageId: replyId });
|
|
408
|
-
this.changed(name);
|
|
409
|
-
settled({ ...task, reportedCorrelationIds });
|
|
410
|
-
} });
|
|
411
|
-
}
|
|
412
|
-
catch (error) {
|
|
413
|
-
closeLease();
|
|
414
|
-
throw error;
|
|
415
|
-
}
|
|
416
|
-
if (task.finishedAt)
|
|
417
|
-
closeLease();
|
|
418
|
-
if (meta.source !== "web") {
|
|
419
|
-
const userId = `native:${requestId}:user`;
|
|
420
|
-
if (!this.host.history?.findByMessageId(name, userId))
|
|
421
|
-
this.host.emit("message", { instance: name, role: "user", sender: String(meta.from_instance || meta.user || "Fleet"), text: raw, ts: new Date().toISOString(), messageId: userId });
|
|
422
|
-
}
|
|
423
|
-
this.changed(name);
|
|
424
|
-
return task;
|
|
425
|
-
}
|
|
426
|
-
async deliver(name, payload, options = {}) {
|
|
427
|
-
this.enabled();
|
|
428
|
-
if (this.host.stopping() || options.stillCurrent?.() === false)
|
|
429
|
-
throw new Error("Windows delivery is no longer current");
|
|
430
|
-
const current = this.get(name);
|
|
431
|
-
if (current?.paused)
|
|
432
|
-
this.setPaused(name, false);
|
|
433
|
-
this.claim(name, payload, options, () => { });
|
|
434
|
-
return true;
|
|
435
|
-
}
|
|
436
|
-
execute(name, payload, options = {}) {
|
|
437
|
-
return new Promise((resolve, reject) => {
|
|
438
|
-
try {
|
|
439
|
-
const task = this.claim(name, payload, options, resolve);
|
|
440
|
-
if (task.finishedAt)
|
|
441
|
-
resolve({ ...task, cli: this.get(name).cli, cwd: this.get(name).cwd, sandbox: this.get(name).sandbox });
|
|
442
|
-
}
|
|
443
|
-
catch (error) {
|
|
444
|
-
reject(error);
|
|
445
|
-
}
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
//# sourceMappingURL=fleet-windows-runtime.js.map
|