@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,47 +0,0 @@
|
|
|
1
|
-
/** Read-only exact-ID evidence for the audited Codex local store. No vendor process, DB edits or sidecars. */
|
|
2
|
-
import { Worker } from "node:worker_threads";
|
|
3
|
-
import { pathToFileURL } from "node:url";
|
|
4
|
-
// Immutable mode cannot see WAL changes: callers must prove no WAL bytes before AND after this bounded query.
|
|
5
|
-
const QUERY = `
|
|
6
|
-
const {parentPort,workerData}=require('node:worker_threads');
|
|
7
|
-
let db;try{const {DatabaseSync}=require('node:sqlite');db=new DatabaseSync(workerData.uri,{readOnly:true});
|
|
8
|
-
db.exec('PRAGMA trusted_schema=OFF');const schema=db.prepare('PRAGMA table_info(threads)').all();
|
|
9
|
-
if(schema.length>128||!schema.some(c=>c.name==='id'&&c.type.toUpperCase()==='TEXT'&&c.pk===1))throw Error('Unknown schema');
|
|
10
|
-
const row=db.prepare("SELECT 1 AS present FROM threads WHERE typeof(id) <> 'text' OR id=? COLLATE NOCASE LIMIT 1").get(workerData.id);
|
|
11
|
-
parentPort.postMessage(row===undefined?'clear':'unknown');}catch{parentPort.postMessage('unknown');}finally{try{db?.close();}catch{}}
|
|
12
|
-
`;
|
|
13
|
-
let active = false;
|
|
14
|
-
export function codexIndexHasNoThread(path, id, current) {
|
|
15
|
-
const isCurrent = () => { try {
|
|
16
|
-
return current() === true;
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
return false;
|
|
20
|
-
} };
|
|
21
|
-
return new Promise(resolve => {
|
|
22
|
-
let worker, timer, done = false;
|
|
23
|
-
const finish = (clear) => { if (done)
|
|
24
|
-
return; done = true; clearTimeout(timer); if (worker)
|
|
25
|
-
void worker.terminate().then(() => resolve(clear && isCurrent()), () => resolve(false));
|
|
26
|
-
else
|
|
27
|
-
resolve(false); };
|
|
28
|
-
if (!isCurrent() || active)
|
|
29
|
-
return finish(false);
|
|
30
|
-
active = true;
|
|
31
|
-
try {
|
|
32
|
-
worker = new Worker(QUERY, { eval: true, workerData: { uri: pathToFileURL(path).href + "?immutable=1", id },
|
|
33
|
-
resourceLimits: { maxOldGenerationSizeMb: 16, maxYoungGenerationSizeMb: 4 }, stderr: true, stdout: true });
|
|
34
|
-
worker.stdout?.resume();
|
|
35
|
-
worker.stderr?.resume(); // The only result that leaves this worker is an exact-ID presence bit.
|
|
36
|
-
worker.once("message", value => finish(value === "clear"));
|
|
37
|
-
worker.once("error", () => finish(false));
|
|
38
|
-
worker.once("exit", () => { active = false; finish(false); });
|
|
39
|
-
timer = setTimeout(() => finish(false), 750);
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
active = false;
|
|
43
|
-
finish(false);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=runtime-pane-codex-index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-pane-codex-index.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EAAC,EAAC,GAAG,EAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,GAAC,cAAc,EAAC,EAAE,EAAC;gBAC5F,cAAc,EAAC,EAAC,sBAAsB,EAAC,EAAE,EAAC,wBAAwB,EAAC,CAAC,EAAC,EAAC,MAAM,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,CAAC,CAAC;YAClG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YAAA,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,uEAAuE;YACxH,MAAM,CAAC,IAAI,CAAC,SAAS,EAAC,KAAK,CAAA,EAAE,CAAA,MAAM,CAAC,KAAK,KAAG,OAAO,CAAC,CAAC,CAAC;YAAA,MAAM,CAAC,IAAI,CAAC,OAAO,EAAC,GAAE,EAAE,CAAA,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAAA,MAAM,CAAC,IAAI,CAAC,MAAM,EAAC,GAAE,EAAE,GAAC,MAAM,GAAC,KAAK,CAAC,CAAA,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC,CAAC,CAAC;YACnJ,KAAK,GAAC,UAAU,CAAC,GAAE,EAAE,CAAA,MAAM,CAAC,KAAK,CAAC,EAAC,GAAG,CAAC,CAAC;QAC1C,CAAC;QAAA,MAAK,CAAC;YAAA,MAAM,GAAC,KAAK,CAAC;YAAA,MAAM,CAAC,KAAK,CAAC,CAAC;QAAA,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { RuntimePaneLaunch } from "./runtime-pane-protocol.js";
|
|
2
|
-
import type { NativePaneOwner } from "./runtime-pane-native.js";
|
|
3
|
-
export interface NativePaneConfig {
|
|
4
|
-
sessionId?: string;
|
|
5
|
-
instructionsFile?: string;
|
|
6
|
-
mcp?: {
|
|
7
|
-
nodePath: string;
|
|
8
|
-
helperPath: string;
|
|
9
|
-
connectionPath: string;
|
|
10
|
-
configPath: string;
|
|
11
|
-
tools: string[];
|
|
12
|
-
serverName: string;
|
|
13
|
-
};
|
|
14
|
-
cleanup(): void;
|
|
15
|
-
}
|
|
16
|
-
export declare function prepareNativePaneConfig(launch: RuntimePaneLaunch, owner: NativePaneOwner, nodePath: string, helperPath: string): NativePaneConfig;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/** Launch-local files only. Provider account configuration and credentials are never copied or rewritten. */
|
|
2
|
-
import { lstatSync, mkdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { validateNativeMcpConnection } from "./windows-cli-providers.js";
|
|
5
|
-
import { validatePaneMcpOwner } from "./runtime-pane-mcp-protocol.js";
|
|
6
|
-
function realDirectory(path) { const stat = lstatSync(path); if (!stat.isDirectory() || stat.isSymbolicLink())
|
|
7
|
-
throw Error("Pane configuration must stay in its owned directory"); }
|
|
8
|
-
export function prepareNativePaneConfig(launch, owner, nodePath, helperPath) {
|
|
9
|
-
realDirectory(owner.directory);
|
|
10
|
-
const parent = join(owner.directory, "launches");
|
|
11
|
-
mkdirSync(parent, { recursive: true, mode: 0o700 });
|
|
12
|
-
realDirectory(parent);
|
|
13
|
-
const directory = join(parent, owner.launchId);
|
|
14
|
-
mkdirSync(directory, { mode: 0o700 });
|
|
15
|
-
const files = [];
|
|
16
|
-
const config = { ...(launch.cli === "claude-code" ? { sessionId: launch.sessionId ?? owner.launchId } : {}), cleanup: () => {
|
|
17
|
-
for (const file of files) {
|
|
18
|
-
try {
|
|
19
|
-
unlinkSync(file);
|
|
20
|
-
}
|
|
21
|
-
catch { /* Only exact files created by this launch. */ }
|
|
22
|
-
}
|
|
23
|
-
try {
|
|
24
|
-
rmdirSync(directory);
|
|
25
|
-
}
|
|
26
|
-
catch { /* Unknown extra files are never deleted. */ }
|
|
27
|
-
} };
|
|
28
|
-
const write = (name, value) => { const file = join(directory, name); writeFileSync(file, value, { encoding: "utf8", mode: 0o600, flag: "wx" }); files.push(file); return file; };
|
|
29
|
-
try {
|
|
30
|
-
if (launch.mcpTools) {
|
|
31
|
-
if (!owner.mcp)
|
|
32
|
-
throw Error("Persistent pane MCP scope was not prepared");
|
|
33
|
-
const identity = validatePaneMcpOwner(owner.mcp.owner), mcp = validateNativeMcpConnection({ endpoint: owner.mcp.endpoint, token: owner.mcp.token, tools: owner.mcp.tools });
|
|
34
|
-
if (identity.paneId !== launch.paneId || identity.launchId !== owner.launchId || identity.agentId !== launch.agentId || identity.instance !== launch.instance
|
|
35
|
-
|| JSON.stringify(mcp.tools) !== JSON.stringify(launch.mcpTools))
|
|
36
|
-
throw Error("Persistent pane MCP scope differs from its launch");
|
|
37
|
-
const connectionPath = write("mcp-connection.json", JSON.stringify({ ...mcp, owner: identity }));
|
|
38
|
-
const serverName = `agend_${launch.agentId.replace(/-/g, "")}`;
|
|
39
|
-
const server = { command: nodePath, args: [helperPath, "--connection-file", connectionPath] };
|
|
40
|
-
const configPath = write("mcp.json", JSON.stringify({ mcpServers: { [serverName]: server } }));
|
|
41
|
-
config.mcp = { nodePath, helperPath, connectionPath, configPath, serverName, tools: mcp.tools };
|
|
42
|
-
}
|
|
43
|
-
else if (owner.mcp)
|
|
44
|
-
throw Error("Unexpected pane MCP scope");
|
|
45
|
-
if (launch.cli === "claude-code" && launch.instructions)
|
|
46
|
-
config.instructionsFile = write("instructions.txt", launch.instructions);
|
|
47
|
-
return config;
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
config.cleanup();
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=runtime-pane-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-pane-config.js","sourceRoot":"","sources":["../src/runtime-pane-config.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE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import type { IPty } from "node-pty";
|
|
2
|
-
import { RuntimePaneStore } from "./runtime-pane-store.js";
|
|
3
|
-
import { type RuntimePaneLaunch, type RuntimePaneSnapshot } from "./runtime-pane-protocol.js";
|
|
4
|
-
import type { PaneMcpConnection } from "./windows-pane-mcp.js";
|
|
5
|
-
import type { NativePaneOwner } from "./runtime-pane-native.js";
|
|
6
|
-
import type { PaneMcpOwner } from "./runtime-pane-mcp-protocol.js";
|
|
7
|
-
import { NativePaneTranscriptReader, type NativeClaudeSessionState } from "./runtime-pane-transcript.js";
|
|
8
|
-
export { persistentNativeArguments } from "./runtime-pane-native.js";
|
|
9
|
-
export type RuntimePaneProcess = Pick<IPty, "pid" | "write" | "resize" | "kill" | "pause" | "resume" | "onData" | "onExit"> & {
|
|
10
|
-
onFailure?(listener: () => void): {
|
|
11
|
-
dispose(): void;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export interface RuntimePaneHostOptions {
|
|
15
|
-
store: RuntimePaneStore;
|
|
16
|
-
bootId: string;
|
|
17
|
-
systemBootId?: string;
|
|
18
|
-
online(): boolean;
|
|
19
|
-
maxAgents(): number;
|
|
20
|
-
/** Internal local launch factory, never a field in the remote request. */
|
|
21
|
-
spawn?(launch: RuntimePaneLaunch, owner: NativePaneOwner): Promise<RuntimePaneProcess>;
|
|
22
|
-
mcpConnection?(owner: PaneMcpOwner, tools: string[]): PaneMcpConnection;
|
|
23
|
-
/** Internal runner seam. A remote request never provides roots or a path. */
|
|
24
|
-
transcript?(launch: RuntimePaneLaunch, sessionId: string): (Pick<NativePaneTranscriptReader, "read" | "close"> & Partial<Pick<NativePaneTranscriptReader, "baseline">>);
|
|
25
|
-
sessionProof?(launch: RuntimePaneLaunch, sessionId: string, current: () => boolean): Promise<NativeClaudeSessionState>;
|
|
26
|
-
output?(snapshot: RuntimePaneSnapshot): void;
|
|
27
|
-
}
|
|
28
|
-
export declare class RuntimePaneHost {
|
|
29
|
-
private readonly options;
|
|
30
|
-
private readonly live;
|
|
31
|
-
private readonly queues;
|
|
32
|
-
private closing;
|
|
33
|
-
private readonly general;
|
|
34
|
-
constructor(options: RuntimePaneHostOptions);
|
|
35
|
-
list(): RuntimePaneSnapshot[];
|
|
36
|
-
/** Exact live reservation; no PID adoption or scans of other panes. */
|
|
37
|
-
owns(owner: PaneMcpOwner): boolean;
|
|
38
|
-
request(raw: unknown, current?: () => boolean): Promise<unknown>;
|
|
39
|
-
private open;
|
|
40
|
-
private recover;
|
|
41
|
-
private operate;
|
|
42
|
-
private readTranscript;
|
|
43
|
-
stop(): Promise<void>;
|
|
44
|
-
}
|
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
import { RuntimePaneOutputBuffer } from "./runtime-pane-output.js";
|
|
2
|
-
import { RuntimeGeneralWorkspace, loadGeneralKnowledge } from "./runtime-general-workspace.js";
|
|
3
|
-
import { GeneralManagedFileError } from "./runtime-general-protocol.js";
|
|
4
|
-
/** Runner-owned, persistent CLI panes. A coordinator reconnect neither launches nor replays anything. */
|
|
5
|
-
import { randomUUID } from "node:crypto";
|
|
6
|
-
import { RuntimePaneStore } from "./runtime-pane-store.js";
|
|
7
|
-
import { RuntimePaneScreen } from "./runtime-pane-screen.js";
|
|
8
|
-
import { PANE_EDIT_KEYS, validateRuntimePaneRequest } from "./runtime-pane-protocol.js";
|
|
9
|
-
import { spawnNativePane } from "./runtime-pane-process.js";
|
|
10
|
-
import { NativePaneTranscriptReader, nativeClaudeSessionState, nativeCodexSessionState } from "./runtime-pane-transcript.js";
|
|
11
|
-
import { validatePaneTranscriptBaseline, validatePaneTranscriptWireBatch } from "./runtime-pane-transcript-protocol.js";
|
|
12
|
-
export { persistentNativeArguments } from "./runtime-pane-native.js";
|
|
13
|
-
const KEYS = { Enter: "\r", Escape: "\x1b", Up: "\x1b[A", Down: "\x1b[B", Right: "\x1b[C", Left: "\x1b[D", "C-c": "\x03", "C-q": "\x11" };
|
|
14
|
-
export class RuntimePaneHost {
|
|
15
|
-
options;
|
|
16
|
-
live = new Map();
|
|
17
|
-
queues = new Map();
|
|
18
|
-
closing = false;
|
|
19
|
-
general;
|
|
20
|
-
constructor(options) {
|
|
21
|
-
this.options = options;
|
|
22
|
-
this.general = new RuntimeGeneralWorkspace(options.store.directory);
|
|
23
|
-
}
|
|
24
|
-
list() {
|
|
25
|
-
for (const row of this.options.store.list())
|
|
26
|
-
if (!this.live.has(row.launch.paneId))
|
|
27
|
-
this.options.store.reconcileExit(row.launch.paneId);
|
|
28
|
-
return this.options.store.list().map(row => structuredClone(this.live.get(row.launch.paneId)?.record.snapshot ?? row.snapshot));
|
|
29
|
-
}
|
|
30
|
-
/** Exact live reservation; no PID adoption or scans of other panes. */
|
|
31
|
-
owns(owner) {
|
|
32
|
-
if (this.closing || owner.hostBootId !== this.options.bootId)
|
|
33
|
-
return false;
|
|
34
|
-
try {
|
|
35
|
-
const pane = this.live.get(owner.paneId)?.record.snapshot ?? this.options.store.get(owner.paneId)?.snapshot;
|
|
36
|
-
return !!pane && pane.hostBootId === owner.hostBootId && pane.launchId === owner.launchId && pane.agentId === owner.agentId
|
|
37
|
-
&& pane.instance === owner.instance && (pane.state === "starting" || pane.state === "running");
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
async request(raw, current = () => true) {
|
|
44
|
-
const request = validateRuntimePaneRequest(raw);
|
|
45
|
-
if (request.action === "list")
|
|
46
|
-
return { hostBootId: this.options.bootId, capabilities: { openDisposition: true, recovery: true, claudeSessionProof: true, codexSessionProof: true, generalWorkspace: true }, panes: this.list() };
|
|
47
|
-
if (this.closing || !this.options.online() || !current())
|
|
48
|
-
throw Error("Pane runtime is disconnected");
|
|
49
|
-
if (request.action === "general-workspace") {
|
|
50
|
-
const installed = loadGeneralKnowledge(request.cli).hash;
|
|
51
|
-
if (installed !== request.packHash)
|
|
52
|
-
return { version: 1, bindingId: request.bindingId, instance: request.instance, cli: request.cli, packHash: installed, upgradeRequired: true };
|
|
53
|
-
try {
|
|
54
|
-
return this.general.prepare(request, current, cwd => !this.list().some(row => row.state !== "exited"
|
|
55
|
-
&& this.options.store.get(row.paneId)?.launch.cwd.toLowerCase() === cwd.toLowerCase()));
|
|
56
|
-
}
|
|
57
|
-
catch (err) {
|
|
58
|
-
// Closed, fixed-asset diagnostics cross the transport; raw errors, paths and file contents never do.
|
|
59
|
-
if (!(err instanceof GeneralManagedFileError))
|
|
60
|
-
throw err;
|
|
61
|
-
return { version: 1, bindingId: request.bindingId, instance: request.instance, cli: request.cli, packHash: request.packHash, managedFile: err.file };
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (request.action === "shutdown") {
|
|
65
|
-
// No await between the inventory, admission fence and reply. An accepted/queued launch or an unknown
|
|
66
|
-
// reservation prevents shutdown; disconnect/lease loss alone never tears down a persistent host.
|
|
67
|
-
if (request.hostBootId !== this.options.bootId || this.queues.size || this.list().some(pane => pane.state !== "exited"))
|
|
68
|
-
throw Error("Pane host still has live or unconfirmed work");
|
|
69
|
-
this.closing = true;
|
|
70
|
-
return { hostBootId: this.options.bootId, shutdown: true };
|
|
71
|
-
}
|
|
72
|
-
const id = request.action === "open" ? request.launch.paneId : request.paneId;
|
|
73
|
-
const queue = this.queues.get(id) ?? { tail: Promise.resolve(), count: 0 };
|
|
74
|
-
if (queue.count >= 16)
|
|
75
|
-
throw Error("Pane operation queue is full");
|
|
76
|
-
queue.count++;
|
|
77
|
-
this.queues.set(id, queue);
|
|
78
|
-
const operation = queue.tail.catch(() => { }).then(async () => {
|
|
79
|
-
if (this.closing || !this.options.online() || !current())
|
|
80
|
-
throw Error("Pane runtime is disconnected");
|
|
81
|
-
return request.action === "open" ? this.open(request) : request.action === "recover" ? this.recover(request) : this.operate(request, current);
|
|
82
|
-
});
|
|
83
|
-
queue.tail = operation;
|
|
84
|
-
try {
|
|
85
|
-
return await operation;
|
|
86
|
-
}
|
|
87
|
-
finally {
|
|
88
|
-
if (--queue.count === 0 && this.queues.get(id) === queue)
|
|
89
|
-
this.queues.delete(id);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
async open(request) {
|
|
93
|
-
const { launch, operationId } = request;
|
|
94
|
-
const digest = RuntimePaneStore.digest(launch);
|
|
95
|
-
const existing = this.options.store.get(launch.paneId);
|
|
96
|
-
if (existing) {
|
|
97
|
-
if (existing.openOperationId !== operationId || existing.openDigest !== digest)
|
|
98
|
-
throw Error("Pane id already belongs to another launch");
|
|
99
|
-
const live = this.live.get(launch.paneId);
|
|
100
|
-
if (!live && existing.snapshot.state !== "exited")
|
|
101
|
-
throw Error("Pane launch outcome is unknown; no replacement was started");
|
|
102
|
-
return { ...structuredClone(live?.record.snapshot ?? existing.snapshot), reattached: true };
|
|
103
|
-
}
|
|
104
|
-
this.list();
|
|
105
|
-
const rows = this.options.store.list();
|
|
106
|
-
const limit = this.options.maxAgents();
|
|
107
|
-
if (!Number.isInteger(limit) || limit < 1 || limit > 16)
|
|
108
|
-
throw Error("Invalid machine pane limit");
|
|
109
|
-
if (launch.launchId && rows.some(row => row.snapshot.launchId === launch.launchId))
|
|
110
|
-
throw Error("Pane launch identity already belongs to another pane");
|
|
111
|
-
const record = {
|
|
112
|
-
...(this.options.systemBootId ? { systemBootId: this.options.systemBootId } : {}),
|
|
113
|
-
launch, openDigest: digest, openOperationId: operationId, bootId: this.options.bootId,
|
|
114
|
-
snapshot: { hostBootId: this.options.bootId, paneId: launch.paneId, agentId: launch.agentId, instance: launch.instance, launchId: launch.launchId ?? randomUUID(), columns: launch.columns, rows: launch.rows,
|
|
115
|
-
state: "starting", seq: 0, outputAt: 0, commandSequence: 0 },
|
|
116
|
-
};
|
|
117
|
-
const sessionId = launch.sessionId ?? (launch.cli === "claude-code" ? record.snapshot.launchId : undefined);
|
|
118
|
-
if (sessionId)
|
|
119
|
-
record.snapshot.sessionId = sessionId;
|
|
120
|
-
if (rows.some(row => row.launch.agentId === launch.agentId && row.snapshot.state !== "exited")
|
|
121
|
-
|| rows.filter(row => row.snapshot.state !== "exited").length >= limit) {
|
|
122
|
-
// A durable tombstone consumes this open identity. Even a lost refusal ACK cannot turn its retry into a launch.
|
|
123
|
-
// Never issue this proof for a spawn exception: the factory may have created a child before throwing.
|
|
124
|
-
record.snapshot.state = "exited";
|
|
125
|
-
record.snapshot.noLaunch = true;
|
|
126
|
-
this.options.store.put(record);
|
|
127
|
-
return { ...structuredClone(record.snapshot), reattached: false };
|
|
128
|
-
}
|
|
129
|
-
if (launch.generalWorkspace)
|
|
130
|
-
this.general.verify({ action: "general-workspace", ...launch.generalWorkspace, instance: launch.instance, cli: launch.cli }, launch.cwd);
|
|
131
|
-
// Synchronous reservation before the first await: parallel opens cannot oversubscribe the machine.
|
|
132
|
-
this.options.store.put(record);
|
|
133
|
-
let process;
|
|
134
|
-
try {
|
|
135
|
-
const owner = { directory: this.options.store.directory, launchId: record.snapshot.launchId };
|
|
136
|
-
if (launch.mcpTools) {
|
|
137
|
-
if (!this.options.mcpConnection)
|
|
138
|
-
throw Error("Persistent pane MCP authority is unavailable");
|
|
139
|
-
owner.mcp = this.options.mcpConnection({ hostBootId: this.options.bootId, paneId: launch.paneId, launchId: record.snapshot.launchId, agentId: launch.agentId, instance: launch.instance }, launch.mcpTools);
|
|
140
|
-
}
|
|
141
|
-
process = await (this.options.spawn ? this.options.spawn(launch, owner) : spawnNativePane(launch, owner));
|
|
142
|
-
let finish;
|
|
143
|
-
const exited = new Promise(resolve => { finish = resolve; });
|
|
144
|
-
const screen = new RuntimePaneScreen(launch.columns, launch.rows, data => {
|
|
145
|
-
if (this.live.get(launch.paneId)?.record === record && record.snapshot.state === "running")
|
|
146
|
-
process.write(data);
|
|
147
|
-
});
|
|
148
|
-
const live = { record, process, screen, parsed: Promise.resolve(), output: new RuntimePaneOutputBuffer(), exited, finish };
|
|
149
|
-
this.live.set(launch.paneId, live);
|
|
150
|
-
record.pid = process.pid;
|
|
151
|
-
record.snapshot.state = "running";
|
|
152
|
-
process.onFailure?.(() => {
|
|
153
|
-
if (record.snapshot.state === "exited")
|
|
154
|
-
return;
|
|
155
|
-
record.snapshot.state = "unknown";
|
|
156
|
-
try {
|
|
157
|
-
this.options.store.put(record);
|
|
158
|
-
}
|
|
159
|
-
catch { /* retained on disk as unfinished */ }
|
|
160
|
-
});
|
|
161
|
-
process.onData(data => {
|
|
162
|
-
if (this.live.get(launch.paneId) !== live)
|
|
163
|
-
return;
|
|
164
|
-
live.output.append(data);
|
|
165
|
-
// Invalidate observations when bytes arrive, not later when the VT parser finishes. A queued repaint
|
|
166
|
-
// already makes an old composer proof unsafe, even while capture or parser completion is awaiting.
|
|
167
|
-
record.snapshot.seq++;
|
|
168
|
-
record.snapshot.outputAt = Date.now();
|
|
169
|
-
live.parsed = screen.write(data).then(() => {
|
|
170
|
-
try {
|
|
171
|
-
this.options.output?.(structuredClone(record.snapshot));
|
|
172
|
-
}
|
|
173
|
-
catch { /* observer backpressure cannot change process ownership */ }
|
|
174
|
-
}).catch(() => {
|
|
175
|
-
record.snapshot.state = "unknown";
|
|
176
|
-
try {
|
|
177
|
-
process.pause();
|
|
178
|
-
this.options.store.put(record);
|
|
179
|
-
}
|
|
180
|
-
catch { /* reserved until exit is proven */ }
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
process.onExit(({ exitCode }) => {
|
|
184
|
-
record.snapshot.state = "exited";
|
|
185
|
-
record.snapshot.exitCode = exitCode;
|
|
186
|
-
try {
|
|
187
|
-
this.options.store.put(record);
|
|
188
|
-
}
|
|
189
|
-
catch { /* an old live record stays reserved on restart */ }
|
|
190
|
-
finish();
|
|
191
|
-
try {
|
|
192
|
-
this.options.output?.(structuredClone(record.snapshot));
|
|
193
|
-
}
|
|
194
|
-
catch { /* process exit is independent of its observer */ }
|
|
195
|
-
const retired = [...this.live.values()].filter(row => row.record.snapshot.state === "exited");
|
|
196
|
-
for (const old of retired.slice(0, Math.max(0, retired.length - 16))) {
|
|
197
|
-
void old.transcript?.close().catch(() => { });
|
|
198
|
-
old.screen.dispose();
|
|
199
|
-
this.live.delete(old.record.launch.paneId);
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
this.options.store.put(record);
|
|
203
|
-
if (this.closing) {
|
|
204
|
-
process.kill();
|
|
205
|
-
throw Error("Pane host stopped during launch");
|
|
206
|
-
}
|
|
207
|
-
return { ...structuredClone(record.snapshot), reattached: false };
|
|
208
|
-
}
|
|
209
|
-
catch (error) {
|
|
210
|
-
if (process) {
|
|
211
|
-
try {
|
|
212
|
-
process.kill();
|
|
213
|
-
}
|
|
214
|
-
catch { /* retain uncertain reservation */ }
|
|
215
|
-
}
|
|
216
|
-
// A launch factory may fail after creating a native child. Only onExit proves there is no process.
|
|
217
|
-
if (record.snapshot.state !== "exited")
|
|
218
|
-
record.snapshot.state = "unknown";
|
|
219
|
-
this.options.store.put(record);
|
|
220
|
-
throw error;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
recover(request) {
|
|
224
|
-
const record = this.options.store.get(request.paneId);
|
|
225
|
-
if (!record || record.snapshot.launchId !== request.launchId || record.snapshot.hostBootId !== request.hostBootId)
|
|
226
|
-
throw Error("Recovery needs the exact retained pane with no live host owner");
|
|
227
|
-
if (record.snapshot.state === "exited")
|
|
228
|
-
return structuredClone(record.snapshot);
|
|
229
|
-
if (this.live.has(request.paneId) || record.snapshot.state !== "unknown" || record.bootId === this.options.bootId || request.confirmedStopped !== true)
|
|
230
|
-
throw Error("The retained pane is not eligible for stopped-process recovery");
|
|
231
|
-
record.snapshot.state = "exited";
|
|
232
|
-
record.snapshot.exitProof = "admin-confirmed";
|
|
233
|
-
delete record.snapshot.exitCode;
|
|
234
|
-
this.options.store.put(record);
|
|
235
|
-
return structuredClone(record.snapshot);
|
|
236
|
-
}
|
|
237
|
-
async operate(request, current) {
|
|
238
|
-
const live = this.live.get(request.paneId);
|
|
239
|
-
const stored = this.options.store.get(request.paneId);
|
|
240
|
-
if (!stored || stored.snapshot.launchId !== request.launchId)
|
|
241
|
-
throw Error("Pane launch identity is stale");
|
|
242
|
-
if (request.action === "snapshot")
|
|
243
|
-
return structuredClone(live?.record.snapshot ?? stored.snapshot);
|
|
244
|
-
if (request.action === "session-proof") {
|
|
245
|
-
const { launch, snapshot } = live?.record ?? stored;
|
|
246
|
-
if (!["claude-code", "codex"].includes(launch.cli) || snapshot.state !== "exited" || snapshot.noLaunch || !snapshot.sessionId)
|
|
247
|
-
throw Error("Session proof requires an exited supported pane");
|
|
248
|
-
let settled = false, timer;
|
|
249
|
-
const lease = () => !settled && !this.closing && this.options.online() && current();
|
|
250
|
-
const read = this.options.sessionProof
|
|
251
|
-
? this.options.sessionProof(launch, snapshot.sessionId, lease)
|
|
252
|
-
: (launch.cli === "codex" ? nativeCodexSessionState : nativeClaudeSessionState)(launch.cwd, snapshot.sessionId, lease);
|
|
253
|
-
try {
|
|
254
|
-
const state = await Promise.race([read, new Promise(done => { timer = setTimeout(() => done("unknown"), 1500); })]);
|
|
255
|
-
return { snapshot: structuredClone(snapshot), state: lease() && ["absent", "saved", "unknown"].includes(state) ? state : "unknown" };
|
|
256
|
-
}
|
|
257
|
-
catch {
|
|
258
|
-
return { snapshot: structuredClone(snapshot), state: "unknown" };
|
|
259
|
-
}
|
|
260
|
-
finally {
|
|
261
|
-
settled = true;
|
|
262
|
-
clearTimeout(timer);
|
|
263
|
-
void read.catch(() => { });
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
if (!live && request.action === "capture" && stored.snapshot.state === "exited")
|
|
267
|
-
return { snapshot: structuredClone(stored.snapshot), text: "" };
|
|
268
|
-
if (!live)
|
|
269
|
-
throw Error("Pane process is not owned by this runner; its reservation is retained");
|
|
270
|
-
const record = live.record;
|
|
271
|
-
if (request.action === "output")
|
|
272
|
-
return live.output.read(request.offset, record.snapshot.state === "exited");
|
|
273
|
-
await live.parsed;
|
|
274
|
-
if (request.action === "capture") {
|
|
275
|
-
const seq = record.snapshot.seq, text = await live.screen.capture(request);
|
|
276
|
-
if (seq !== record.snapshot.seq)
|
|
277
|
-
throw Error("Pane changed during capture; observe it again");
|
|
278
|
-
return { snapshot: structuredClone(record.snapshot), text };
|
|
279
|
-
}
|
|
280
|
-
if (request.action === "bind-session") {
|
|
281
|
-
const expected = record.snapshot.sessionId ?? record.launch.sessionId ?? (record.launch.cli === "claude-code" ? record.snapshot.launchId : undefined);
|
|
282
|
-
if (expected && expected !== request.sessionId)
|
|
283
|
-
throw Error("Pane conversation identity is already pinned elsewhere");
|
|
284
|
-
if (!expected) {
|
|
285
|
-
if (record.snapshot.state !== "running")
|
|
286
|
-
throw Error("An unowned pane cannot establish a conversation identity");
|
|
287
|
-
const text = await live.screen.capture({ history: 200, joined: true });
|
|
288
|
-
const ids = [...text.matchAll(/\bSession:\s*([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})\b/gi)].map(match => match[1]);
|
|
289
|
-
if (ids.length !== 1 || ids[0] !== request.sessionId)
|
|
290
|
-
throw Error("The owned pane has no unique matching status identity");
|
|
291
|
-
}
|
|
292
|
-
if (!current() || !this.options.online() || this.closing)
|
|
293
|
-
throw Error("Pane session binding lease expired");
|
|
294
|
-
if (record.snapshot.sessionId !== request.sessionId) {
|
|
295
|
-
record.snapshot.sessionId = request.sessionId;
|
|
296
|
-
try {
|
|
297
|
-
this.options.store.put(record);
|
|
298
|
-
}
|
|
299
|
-
catch (error) {
|
|
300
|
-
delete record.snapshot.sessionId;
|
|
301
|
-
throw error;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
return structuredClone(record.snapshot);
|
|
305
|
-
}
|
|
306
|
-
if (request.action === "transcript" || request.action === "transcript-baseline")
|
|
307
|
-
return this.readTranscript(live, request.cursor, current, request.action === "transcript-baseline");
|
|
308
|
-
if (request.action === "reconcile") {
|
|
309
|
-
if (record.snapshot.commandSequence !== request.sequence || record.lastCommand?.id !== request.operationId
|
|
310
|
-
|| record.lastCommand.digest !== request.digest || record.lastCommand.state !== "applied")
|
|
311
|
-
throw Error("Pane command outcome is unconfirmed");
|
|
312
|
-
return structuredClone(record.snapshot);
|
|
313
|
-
}
|
|
314
|
-
if (!current() || !this.options.online())
|
|
315
|
-
throw Error("Pane input lease expired");
|
|
316
|
-
const digest = RuntimePaneStore.digest(request);
|
|
317
|
-
if (request.sequence === record.snapshot.commandSequence) {
|
|
318
|
-
if (record.lastCommand?.id !== request.operationId || record.lastCommand.digest !== digest)
|
|
319
|
-
throw Error("Pane input sequence belongs to another command");
|
|
320
|
-
if (record.lastCommand.state !== "applied")
|
|
321
|
-
throw Error("Pane input outcome is unknown; it will not be replayed");
|
|
322
|
-
return structuredClone(record.snapshot);
|
|
323
|
-
}
|
|
324
|
-
if (request.sequence !== record.snapshot.commandSequence + 1)
|
|
325
|
-
throw Error("Pane input sequence is stale or has a gap");
|
|
326
|
-
if (record.lastCommand?.state === "prepared" && request.action !== "close")
|
|
327
|
-
throw Error("Previous pane input outcome is unknown");
|
|
328
|
-
if (record.snapshot.state !== "running" && request.action !== "close")
|
|
329
|
-
throw Error("Pane process is not confirmed running");
|
|
330
|
-
record.snapshot.commandSequence = request.sequence;
|
|
331
|
-
record.lastCommand = { id: request.operationId, digest, state: "prepared" };
|
|
332
|
-
delete record.snapshot.inputRefused;
|
|
333
|
-
if ((request.action === "input" || request.action === "key" || request.action === "edit") && request.expectedSeq !== record.snapshot.seq) {
|
|
334
|
-
// Positively no input. Consume this command identity: a lost refusal ACK must never become a later key.
|
|
335
|
-
record.snapshot.inputRefused = true;
|
|
336
|
-
record.lastCommand.state = "applied";
|
|
337
|
-
this.options.store.put(record);
|
|
338
|
-
return structuredClone(record.snapshot);
|
|
339
|
-
}
|
|
340
|
-
// Durable before input: a crash after this write must hold, never duplicate Enter.
|
|
341
|
-
this.options.store.put(record);
|
|
342
|
-
if (request.action === "input")
|
|
343
|
-
live.process.write(request.kind === "paste" ? live.screen.bracketedPaste(request.text) : request.text);
|
|
344
|
-
else if (request.action === "edit")
|
|
345
|
-
live.process.write(request.keys.map(key => PANE_EDIT_KEYS[key]).join("").repeat(request.repeat ?? 1));
|
|
346
|
-
else if (request.action === "key")
|
|
347
|
-
live.process.write(KEYS[request.key]);
|
|
348
|
-
else if (request.action === "resize") {
|
|
349
|
-
live.process.resize(request.columns, request.rows);
|
|
350
|
-
await live.screen.resize(request.columns, request.rows);
|
|
351
|
-
record.snapshot.columns = request.columns;
|
|
352
|
-
record.snapshot.rows = request.rows;
|
|
353
|
-
}
|
|
354
|
-
else {
|
|
355
|
-
live.process.kill();
|
|
356
|
-
let timer;
|
|
357
|
-
const stopped = await Promise.race([live.exited.then(() => true), new Promise(resolve => { timer = setTimeout(() => resolve(false), 10_000); })]);
|
|
358
|
-
clearTimeout(timer);
|
|
359
|
-
if (!stopped)
|
|
360
|
-
record.snapshot.state = "unknown";
|
|
361
|
-
}
|
|
362
|
-
record.lastCommand.state = "applied";
|
|
363
|
-
this.options.store.put(record);
|
|
364
|
-
return structuredClone(record.snapshot);
|
|
365
|
-
}
|
|
366
|
-
async readTranscript(live, cursor, current, baseline = false) {
|
|
367
|
-
const { launch, snapshot } = live.record;
|
|
368
|
-
if (!snapshot.sessionId || cursor.sessionId !== snapshot.sessionId)
|
|
369
|
-
throw Error("Transcript identity differs from its owned pane");
|
|
370
|
-
if (snapshot.state !== "running" && snapshot.state !== "exited")
|
|
371
|
-
throw Error("Transcript pane ownership is unconfirmed");
|
|
372
|
-
live.transcript ??= this.options.transcript?.(launch, snapshot.sessionId) ?? new NativePaneTranscriptReader(launch.cli, launch.cwd, snapshot.sessionId);
|
|
373
|
-
let settled = false, timer;
|
|
374
|
-
const lease = () => !settled && !this.closing && current() && this.options.online();
|
|
375
|
-
const read = baseline ? live.transcript.baseline?.(cursor, lease) ?? Promise.resolve({ state: "pending", cursor, complete: false, turnKnown: false, openTurn: null }) : live.transcript.read(cursor, lease);
|
|
376
|
-
try {
|
|
377
|
-
const batch = await Promise.race([read, new Promise((_resolve, reject) => { timer = setTimeout(() => reject(Error("Pane transcript read deadline exceeded")), 1000); })]);
|
|
378
|
-
if (!lease())
|
|
379
|
-
throw Error("Pane transcript read lease expired");
|
|
380
|
-
if (baseline)
|
|
381
|
-
return validatePaneTranscriptBaseline(batch, snapshot.sessionId);
|
|
382
|
-
if (!("data" in batch))
|
|
383
|
-
throw Error("Pane transcript response has no records");
|
|
384
|
-
return validatePaneTranscriptWireBatch({ state: batch.state, cursor: batch.cursor, data: batch.data, complete: batch.complete, gap: batch.gap }, snapshot.sessionId);
|
|
385
|
-
}
|
|
386
|
-
finally {
|
|
387
|
-
settled = true;
|
|
388
|
-
clearTimeout(timer);
|
|
389
|
-
void read.catch(() => { });
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
async stop() {
|
|
393
|
-
this.closing = true;
|
|
394
|
-
for (const live of this.live.values())
|
|
395
|
-
if (live.record.snapshot.state !== "exited") {
|
|
396
|
-
try {
|
|
397
|
-
live.process.kill();
|
|
398
|
-
}
|
|
399
|
-
catch {
|
|
400
|
-
live.record.snapshot.state = "unknown";
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
// Pending opens recheck admission and retire their own process; no new request can enter.
|
|
404
|
-
await Promise.allSettled([...this.queues.values()].map(queue => queue.tail));
|
|
405
|
-
// A request to close is not exit evidence. Keep native helpers alive until their job receipt or the bounded hold.
|
|
406
|
-
const remaining = [...this.live.values()].filter(live => live.record.snapshot.state !== "exited");
|
|
407
|
-
let timer;
|
|
408
|
-
if (remaining.length)
|
|
409
|
-
await Promise.race([Promise.all(remaining.map(live => live.exited)), new Promise(done => { timer = setTimeout(done, 10_000); })]);
|
|
410
|
-
clearTimeout(timer);
|
|
411
|
-
for (const live of this.live.values()) {
|
|
412
|
-
if (live.record.snapshot.state !== "exited")
|
|
413
|
-
live.record.snapshot.state = "unknown";
|
|
414
|
-
try {
|
|
415
|
-
this.options.store.put(live.record);
|
|
416
|
-
}
|
|
417
|
-
finally {
|
|
418
|
-
live.screen.dispose();
|
|
419
|
-
void live.transcript?.close().catch(() => { });
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
//# sourceMappingURL=runtime-pane-host.js.map
|