@quenty/studio-bridge 0.7.1 → 0.9.0
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/CHANGELOG.md +14 -42
- package/README.md +166 -115
- package/dist/src/bridge/bridge-connection-remote.test.d.ts +7 -0
- package/dist/src/bridge/bridge-connection-remote.test.d.ts.map +1 -0
- package/dist/src/bridge/bridge-connection-remote.test.js +144 -0
- package/dist/src/bridge/bridge-connection-remote.test.js.map +1 -0
- package/dist/src/bridge/bridge-connection.d.ts +112 -0
- package/dist/src/bridge/bridge-connection.d.ts.map +1 -0
- package/dist/src/bridge/bridge-connection.js +528 -0
- package/dist/src/bridge/bridge-connection.js.map +1 -0
- package/dist/src/bridge/bridge-connection.test.d.ts +6 -0
- package/dist/src/bridge/bridge-connection.test.d.ts.map +1 -0
- package/dist/src/bridge/bridge-connection.test.js +773 -0
- package/dist/src/bridge/bridge-connection.test.js.map +1 -0
- package/dist/src/bridge/bridge-session.d.ts +38 -0
- package/dist/src/bridge/bridge-session.d.ts.map +1 -0
- package/dist/src/bridge/bridge-session.js +259 -0
- package/dist/src/bridge/bridge-session.js.map +1 -0
- package/dist/src/bridge/bridge-session.test.d.ts +6 -0
- package/dist/src/bridge/bridge-session.test.d.ts.map +1 -0
- package/dist/src/bridge/bridge-session.test.js +264 -0
- package/dist/src/bridge/bridge-session.test.js.map +1 -0
- package/dist/src/bridge/index.d.ts +13 -0
- package/dist/src/bridge/index.d.ts.map +1 -0
- package/dist/src/bridge/index.js +13 -0
- package/dist/src/bridge/index.js.map +1 -0
- package/dist/src/bridge/internal/__tests__/failover-crash.test.d.ts +9 -0
- package/dist/src/bridge/internal/__tests__/failover-crash.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/__tests__/failover-crash.test.js +159 -0
- package/dist/src/bridge/internal/__tests__/failover-crash.test.js.map +1 -0
- package/dist/src/bridge/internal/__tests__/failover-graceful.test.d.ts +9 -0
- package/dist/src/bridge/internal/__tests__/failover-graceful.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/__tests__/failover-graceful.test.js +218 -0
- package/dist/src/bridge/internal/__tests__/failover-graceful.test.js.map +1 -0
- package/dist/src/bridge/internal/__tests__/failover-inflight.test.d.ts +9 -0
- package/dist/src/bridge/internal/__tests__/failover-inflight.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/__tests__/failover-inflight.test.js +246 -0
- package/dist/src/bridge/internal/__tests__/failover-inflight.test.js.map +1 -0
- package/dist/src/bridge/internal/__tests__/host-client-integration.test.d.ts +10 -0
- package/dist/src/bridge/internal/__tests__/host-client-integration.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/__tests__/host-client-integration.test.js +298 -0
- package/dist/src/bridge/internal/__tests__/host-client-integration.test.js.map +1 -0
- package/dist/src/bridge/internal/bridge-client.d.ts +70 -0
- package/dist/src/bridge/internal/bridge-client.d.ts.map +1 -0
- package/dist/src/bridge/internal/bridge-client.js +344 -0
- package/dist/src/bridge/internal/bridge-client.js.map +1 -0
- package/dist/src/bridge/internal/bridge-client.test.d.ts +7 -0
- package/dist/src/bridge/internal/bridge-client.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/bridge-client.test.js +301 -0
- package/dist/src/bridge/internal/bridge-client.test.js.map +1 -0
- package/dist/src/bridge/internal/bridge-host.d.ts +78 -0
- package/dist/src/bridge/internal/bridge-host.d.ts.map +1 -0
- package/dist/src/bridge/internal/bridge-host.js +383 -0
- package/dist/src/bridge/internal/bridge-host.js.map +1 -0
- package/dist/src/bridge/internal/bridge-host.test.d.ts +7 -0
- package/dist/src/bridge/internal/bridge-host.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/bridge-host.test.js +377 -0
- package/dist/src/bridge/internal/bridge-host.test.js.map +1 -0
- package/dist/src/bridge/internal/environment-detection.d.ts +44 -0
- package/dist/src/bridge/internal/environment-detection.d.ts.map +1 -0
- package/dist/src/bridge/internal/environment-detection.js +91 -0
- package/dist/src/bridge/internal/environment-detection.js.map +1 -0
- package/dist/src/bridge/internal/environment-detection.test.d.ts +7 -0
- package/dist/src/bridge/internal/environment-detection.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/environment-detection.test.js +150 -0
- package/dist/src/bridge/internal/environment-detection.test.js.map +1 -0
- package/dist/src/bridge/internal/hand-off.d.ts +69 -0
- package/dist/src/bridge/internal/hand-off.d.ts.map +1 -0
- package/dist/src/bridge/internal/hand-off.js +178 -0
- package/dist/src/bridge/internal/hand-off.js.map +1 -0
- package/dist/src/bridge/internal/hand-off.test.d.ts +7 -0
- package/dist/src/bridge/internal/hand-off.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/hand-off.test.js +325 -0
- package/dist/src/bridge/internal/hand-off.test.js.map +1 -0
- package/dist/src/bridge/internal/health-endpoint.d.ts +32 -0
- package/dist/src/bridge/internal/health-endpoint.d.ts.map +1 -0
- package/dist/src/bridge/internal/health-endpoint.js +73 -0
- package/dist/src/bridge/internal/health-endpoint.js.map +1 -0
- package/dist/src/bridge/internal/health-endpoint.test.d.ts +6 -0
- package/dist/src/bridge/internal/health-endpoint.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/health-endpoint.test.js +122 -0
- package/dist/src/bridge/internal/health-endpoint.test.js.map +1 -0
- package/dist/src/bridge/internal/host-protocol.d.ts +60 -0
- package/dist/src/bridge/internal/host-protocol.d.ts.map +1 -0
- package/dist/src/bridge/internal/host-protocol.js +184 -0
- package/dist/src/bridge/internal/host-protocol.js.map +1 -0
- package/dist/src/bridge/internal/host-protocol.test.d.ts +6 -0
- package/dist/src/bridge/internal/host-protocol.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/host-protocol.test.js +307 -0
- package/dist/src/bridge/internal/host-protocol.test.js.map +1 -0
- package/dist/src/bridge/internal/session-tracker.d.ts +67 -0
- package/dist/src/bridge/internal/session-tracker.d.ts.map +1 -0
- package/dist/src/bridge/internal/session-tracker.js +138 -0
- package/dist/src/bridge/internal/session-tracker.js.map +1 -0
- package/dist/src/bridge/internal/session-tracker.test.d.ts +6 -0
- package/dist/src/bridge/internal/session-tracker.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/session-tracker.test.js +342 -0
- package/dist/src/bridge/internal/session-tracker.test.js.map +1 -0
- package/dist/src/bridge/internal/transport-client.d.ts +43 -0
- package/dist/src/bridge/internal/transport-client.d.ts.map +1 -0
- package/dist/src/bridge/internal/transport-client.js +146 -0
- package/dist/src/bridge/internal/transport-client.js.map +1 -0
- package/dist/src/bridge/internal/transport-client.test.d.ts +6 -0
- package/dist/src/bridge/internal/transport-client.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/transport-client.test.js +176 -0
- package/dist/src/bridge/internal/transport-client.test.js.map +1 -0
- package/dist/src/bridge/internal/transport-server.d.ts +59 -0
- package/dist/src/bridge/internal/transport-server.d.ts.map +1 -0
- package/dist/src/bridge/internal/transport-server.js +189 -0
- package/dist/src/bridge/internal/transport-server.js.map +1 -0
- package/dist/src/bridge/internal/transport-server.test.d.ts +6 -0
- package/dist/src/bridge/internal/transport-server.test.d.ts.map +1 -0
- package/dist/src/bridge/internal/transport-server.test.js +171 -0
- package/dist/src/bridge/internal/transport-server.test.js.map +1 -0
- package/dist/src/bridge/types.d.ts +117 -0
- package/dist/src/bridge/types.d.ts.map +1 -0
- package/dist/src/bridge/types.js +68 -0
- package/dist/src/bridge/types.js.map +1 -0
- package/dist/src/cli/adapters/cli-command-adapter-handler.test.d.ts +6 -0
- package/dist/src/cli/adapters/cli-command-adapter-handler.test.d.ts.map +1 -0
- package/dist/src/cli/adapters/cli-command-adapter-handler.test.js +260 -0
- package/dist/src/cli/adapters/cli-command-adapter-handler.test.js.map +1 -0
- package/dist/src/cli/adapters/cli-command-adapter.d.ts +39 -0
- package/dist/src/cli/adapters/cli-command-adapter.d.ts.map +1 -0
- package/dist/src/cli/adapters/cli-command-adapter.js +241 -0
- package/dist/src/cli/adapters/cli-command-adapter.js.map +1 -0
- package/dist/src/cli/adapters/cli-command-adapter.test.d.ts +5 -0
- package/dist/src/cli/adapters/cli-command-adapter.test.d.ts.map +1 -0
- package/dist/src/cli/adapters/cli-command-adapter.test.js +188 -0
- package/dist/src/cli/adapters/cli-command-adapter.test.js.map +1 -0
- package/dist/src/cli/adapters/group-builder.d.ts +29 -0
- package/dist/src/cli/adapters/group-builder.d.ts.map +1 -0
- package/dist/src/cli/adapters/group-builder.js +54 -0
- package/dist/src/cli/adapters/group-builder.js.map +1 -0
- package/dist/src/cli/adapters/group-builder.test.d.ts +5 -0
- package/dist/src/cli/adapters/group-builder.test.d.ts.map +1 -0
- package/dist/src/cli/adapters/group-builder.test.js +108 -0
- package/dist/src/cli/adapters/group-builder.test.js.map +1 -0
- package/dist/src/cli/adapters/help-formatter.d.ts +11 -0
- package/dist/src/cli/adapters/help-formatter.d.ts.map +1 -0
- package/dist/src/cli/adapters/help-formatter.js +78 -0
- package/dist/src/cli/adapters/help-formatter.js.map +1 -0
- package/dist/src/cli/adapters/help-formatter.test.d.ts +5 -0
- package/dist/src/cli/adapters/help-formatter.test.d.ts.map +1 -0
- package/dist/src/cli/adapters/help-formatter.test.js +79 -0
- package/dist/src/cli/adapters/help-formatter.test.js.map +1 -0
- package/dist/src/cli/adapters/target-resolver.d.ts +54 -0
- package/dist/src/cli/adapters/target-resolver.d.ts.map +1 -0
- package/dist/src/cli/adapters/target-resolver.js +90 -0
- package/dist/src/cli/adapters/target-resolver.js.map +1 -0
- package/dist/src/cli/adapters/target-resolver.test.d.ts +5 -0
- package/dist/src/cli/adapters/target-resolver.test.d.ts.map +1 -0
- package/dist/src/cli/adapters/target-resolver.test.js +169 -0
- package/dist/src/cli/adapters/target-resolver.test.js.map +1 -0
- package/dist/src/cli/args/global-args.d.ts +2 -0
- package/dist/src/cli/args/global-args.d.ts.map +1 -1
- package/dist/src/cli/cli.d.ts +6 -3
- package/dist/src/cli/cli.d.ts.map +1 -1
- package/dist/src/cli/cli.js +82 -20
- package/dist/src/cli/cli.js.map +1 -1
- package/dist/src/cli/resolve-script-content.d.ts +19 -0
- package/dist/src/cli/resolve-script-content.d.ts.map +1 -0
- package/dist/src/cli/resolve-script-content.js +22 -0
- package/dist/src/cli/resolve-script-content.js.map +1 -0
- package/dist/src/cli/resolve-session.d.ts +21 -0
- package/dist/src/cli/resolve-session.d.ts.map +1 -0
- package/dist/src/cli/resolve-session.js +40 -0
- package/dist/src/cli/resolve-session.js.map +1 -0
- package/dist/src/cli/resolve-session.test.d.ts +5 -0
- package/dist/src/cli/resolve-session.test.d.ts.map +1 -0
- package/dist/src/cli/resolve-session.test.js +112 -0
- package/dist/src/cli/resolve-session.test.js.map +1 -0
- package/dist/src/cli/script-executor.d.ts +1 -0
- package/dist/src/cli/script-executor.d.ts.map +1 -1
- package/dist/src/cli/script-executor.js +7 -1
- package/dist/src/cli/script-executor.js.map +1 -1
- package/dist/src/cli/types.d.ts +11 -0
- package/dist/src/cli/types.d.ts.map +1 -0
- package/dist/src/cli/types.js +5 -0
- package/dist/src/cli/types.js.map +1 -0
- package/dist/src/commands/connect.d.ts +16 -0
- package/dist/src/commands/connect.d.ts.map +1 -0
- package/dist/src/commands/connect.js +15 -0
- package/dist/src/commands/connect.js.map +1 -0
- package/dist/src/commands/connect.test.d.ts +5 -0
- package/dist/src/commands/connect.test.d.ts.map +1 -0
- package/dist/src/commands/connect.test.js +46 -0
- package/dist/src/commands/connect.test.js.map +1 -0
- package/dist/src/commands/console/exec/exec.d.ts +43 -0
- package/dist/src/commands/console/exec/exec.d.ts.map +1 -0
- package/dist/src/commands/console/exec/exec.js +79 -0
- package/dist/src/commands/console/exec/exec.js.map +1 -0
- package/dist/src/commands/console/exec/exec.test.d.ts +5 -0
- package/dist/src/commands/console/exec/exec.test.d.ts.map +1 -0
- package/dist/src/commands/console/exec/exec.test.js +191 -0
- package/dist/src/commands/console/exec/exec.test.js.map +1 -0
- package/dist/src/commands/console/logs/logs.d.ts +23 -0
- package/dist/src/commands/console/logs/logs.d.ts.map +1 -0
- package/dist/src/commands/console/logs/logs.js +80 -0
- package/dist/src/commands/console/logs/logs.js.map +1 -0
- package/dist/src/commands/console/logs/logs.test.d.ts +5 -0
- package/dist/src/commands/console/logs/logs.test.d.ts.map +1 -0
- package/dist/src/commands/console/logs/logs.test.js +111 -0
- package/dist/src/commands/console/logs/logs.test.js.map +1 -0
- package/dist/src/commands/disconnect.d.ts +9 -0
- package/dist/src/commands/disconnect.d.ts.map +1 -0
- package/dist/src/commands/disconnect.js +8 -0
- package/dist/src/commands/disconnect.js.map +1 -0
- package/dist/src/commands/disconnect.test.d.ts +5 -0
- package/dist/src/commands/disconnect.test.d.ts.map +1 -0
- package/dist/src/commands/disconnect.test.js +17 -0
- package/dist/src/commands/disconnect.test.js.map +1 -0
- package/dist/src/commands/explorer/query/query.d.ts +31 -0
- package/dist/src/commands/explorer/query/query.d.ts.map +1 -0
- package/dist/src/commands/explorer/query/query.js +106 -0
- package/dist/src/commands/explorer/query/query.js.map +1 -0
- package/dist/src/commands/explorer/query/query.test.d.ts +5 -0
- package/dist/src/commands/explorer/query/query.test.d.ts.map +1 -0
- package/dist/src/commands/explorer/query/query.test.js +228 -0
- package/dist/src/commands/explorer/query/query.test.js.map +1 -0
- package/dist/src/commands/formatters.test.d.ts +6 -0
- package/dist/src/commands/formatters.test.d.ts.map +1 -0
- package/dist/src/commands/formatters.test.js +211 -0
- package/dist/src/commands/formatters.test.js.map +1 -0
- package/dist/src/commands/framework/action-loader.d.ts +25 -0
- package/dist/src/commands/framework/action-loader.d.ts.map +1 -0
- package/dist/src/commands/framework/action-loader.js +46 -0
- package/dist/src/commands/framework/action-loader.js.map +1 -0
- package/dist/src/commands/framework/action-loader.test.d.ts +5 -0
- package/dist/src/commands/framework/action-loader.test.d.ts.map +1 -0
- package/dist/src/commands/framework/action-loader.test.js +89 -0
- package/dist/src/commands/framework/action-loader.test.js.map +1 -0
- package/dist/src/commands/framework/arg-builder.d.ts +92 -0
- package/dist/src/commands/framework/arg-builder.d.ts.map +1 -0
- package/dist/src/commands/framework/arg-builder.js +137 -0
- package/dist/src/commands/framework/arg-builder.js.map +1 -0
- package/dist/src/commands/framework/arg-builder.test.d.ts +5 -0
- package/dist/src/commands/framework/arg-builder.test.d.ts.map +1 -0
- package/dist/src/commands/framework/arg-builder.test.js +246 -0
- package/dist/src/commands/framework/arg-builder.test.js.map +1 -0
- package/dist/src/commands/framework/command-registry.d.ts +23 -0
- package/dist/src/commands/framework/command-registry.d.ts.map +1 -0
- package/dist/src/commands/framework/command-registry.js +42 -0
- package/dist/src/commands/framework/command-registry.js.map +1 -0
- package/dist/src/commands/framework/command-registry.test.d.ts +5 -0
- package/dist/src/commands/framework/command-registry.test.d.ts.map +1 -0
- package/dist/src/commands/framework/command-registry.test.js +158 -0
- package/dist/src/commands/framework/command-registry.test.js.map +1 -0
- package/dist/src/commands/framework/define-command.d.ts +76 -0
- package/dist/src/commands/framework/define-command.d.ts.map +1 -0
- package/dist/src/commands/framework/define-command.js +28 -0
- package/dist/src/commands/framework/define-command.js.map +1 -0
- package/dist/src/commands/framework/define-command.test.d.ts +5 -0
- package/dist/src/commands/framework/define-command.test.d.ts.map +1 -0
- package/dist/src/commands/framework/define-command.test.js +135 -0
- package/dist/src/commands/framework/define-command.test.js.map +1 -0
- package/dist/src/commands/framework/index.d.ts +8 -0
- package/dist/src/commands/framework/index.d.ts.map +1 -0
- package/dist/src/commands/framework/index.js +8 -0
- package/dist/src/commands/framework/index.js.map +1 -0
- package/dist/src/commands/index.d.ts +20 -0
- package/dist/src/commands/index.d.ts.map +1 -0
- package/dist/src/commands/index.js +20 -0
- package/dist/src/commands/index.js.map +1 -0
- package/dist/src/commands/linux/inject-credentials/inject-credentials.d.ts +15 -0
- package/dist/src/commands/linux/inject-credentials/inject-credentials.d.ts.map +1 -0
- package/dist/src/commands/linux/inject-credentials/inject-credentials.js +88 -0
- package/dist/src/commands/linux/inject-credentials/inject-credentials.js.map +1 -0
- package/dist/src/commands/linux/setup/setup.d.ts +19 -0
- package/dist/src/commands/linux/setup/setup.d.ts.map +1 -0
- package/dist/src/commands/linux/setup/setup.js +107 -0
- package/dist/src/commands/linux/setup/setup.js.map +1 -0
- package/dist/src/commands/linux/status/status.d.ts +34 -0
- package/dist/src/commands/linux/status/status.d.ts.map +1 -0
- package/dist/src/commands/linux/status/status.js +134 -0
- package/dist/src/commands/linux/status/status.js.map +1 -0
- package/dist/src/commands/plugin/install/install.d.ts +10 -0
- package/dist/src/commands/plugin/install/install.d.ts.map +1 -0
- package/dist/src/commands/plugin/install/install.js +23 -0
- package/dist/src/commands/plugin/install/install.js.map +1 -0
- package/dist/src/commands/plugin/uninstall/uninstall.d.ts +9 -0
- package/dist/src/commands/plugin/uninstall/uninstall.d.ts.map +1 -0
- package/dist/src/commands/plugin/uninstall/uninstall.js +41 -0
- package/dist/src/commands/plugin/uninstall/uninstall.js.map +1 -0
- package/dist/src/commands/process/close/close.d.ts +22 -0
- package/dist/src/commands/process/close/close.d.ts.map +1 -0
- package/dist/src/commands/process/close/close.js +34 -0
- package/dist/src/commands/process/close/close.js.map +1 -0
- package/dist/src/commands/process/format-state.d.ts +7 -0
- package/dist/src/commands/process/format-state.d.ts.map +1 -0
- package/dist/src/commands/process/format-state.js +19 -0
- package/dist/src/commands/process/format-state.js.map +1 -0
- package/dist/src/commands/process/info/info.d.ts +17 -0
- package/dist/src/commands/process/info/info.d.ts.map +1 -0
- package/dist/src/commands/process/info/info.js +38 -0
- package/dist/src/commands/process/info/info.js.map +1 -0
- package/dist/src/commands/process/info/info.test.d.ts +5 -0
- package/dist/src/commands/process/info/info.test.d.ts.map +1 -0
- package/dist/src/commands/process/info/info.test.js +58 -0
- package/dist/src/commands/process/info/info.test.js.map +1 -0
- package/dist/src/commands/process/launch/launch.d.ts +17 -0
- package/dist/src/commands/process/launch/launch.d.ts.map +1 -0
- package/dist/src/commands/process/launch/launch.js +26 -0
- package/dist/src/commands/process/launch/launch.js.map +1 -0
- package/dist/src/commands/process/launch/launch.test.d.ts +5 -0
- package/dist/src/commands/process/launch/launch.test.d.ts.map +1 -0
- package/dist/src/commands/process/launch/launch.test.js +49 -0
- package/dist/src/commands/process/launch/launch.test.js.map +1 -0
- package/dist/src/commands/process/list/list.d.ts +16 -0
- package/dist/src/commands/process/list/list.d.ts.map +1 -0
- package/dist/src/commands/process/list/list.js +56 -0
- package/dist/src/commands/process/list/list.js.map +1 -0
- package/dist/src/commands/process/list/list.test.d.ts +5 -0
- package/dist/src/commands/process/list/list.test.d.ts.map +1 -0
- package/dist/src/commands/process/list/list.test.js +71 -0
- package/dist/src/commands/process/list/list.test.js.map +1 -0
- package/dist/src/commands/process/run/run.d.ts +31 -0
- package/dist/src/commands/process/run/run.d.ts.map +1 -0
- package/dist/src/commands/process/run/run.js +63 -0
- package/dist/src/commands/process/run/run.js.map +1 -0
- package/dist/src/commands/rgba-to-png.d.ts +17 -0
- package/dist/src/commands/rgba-to-png.d.ts.map +1 -0
- package/dist/src/commands/rgba-to-png.js +85 -0
- package/dist/src/commands/rgba-to-png.js.map +1 -0
- package/dist/src/commands/serve/serve.d.ts +17 -0
- package/dist/src/commands/serve/serve.d.ts.map +1 -0
- package/dist/src/commands/serve/serve.js +128 -0
- package/dist/src/commands/serve/serve.js.map +1 -0
- package/dist/src/commands/serve/serve.test.d.ts +5 -0
- package/dist/src/commands/serve/serve.test.d.ts.map +1 -0
- package/dist/src/commands/serve/serve.test.js +100 -0
- package/dist/src/commands/serve/serve.test.js.map +1 -0
- package/dist/src/commands/viewport/screenshot/screenshot.d.ts +17 -0
- package/dist/src/commands/viewport/screenshot/screenshot.d.ts.map +1 -0
- package/dist/src/commands/viewport/screenshot/screenshot.js +45 -0
- package/dist/src/commands/viewport/screenshot/screenshot.js.map +1 -0
- package/dist/src/commands/viewport/screenshot/screenshot.test.d.ts +5 -0
- package/dist/src/commands/viewport/screenshot/screenshot.test.d.ts.map +1 -0
- package/dist/src/commands/viewport/screenshot/screenshot.test.js +143 -0
- package/dist/src/commands/viewport/screenshot/screenshot.test.js.map +1 -0
- package/dist/src/docker/docker-delegator.d.ts +30 -0
- package/dist/src/docker/docker-delegator.d.ts.map +1 -0
- package/dist/src/docker/docker-delegator.js +201 -0
- package/dist/src/docker/docker-delegator.js.map +1 -0
- package/dist/src/docker/docker-delegator.test.d.ts +2 -0
- package/dist/src/docker/docker-delegator.test.d.ts.map +1 -0
- package/dist/src/docker/docker-delegator.test.js +132 -0
- package/dist/src/docker/docker-delegator.test.js.map +1 -0
- package/dist/src/index.d.ts +9 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.test.d.ts +2 -0
- package/dist/src/index.test.d.ts.map +1 -0
- package/dist/src/index.test.js +51 -0
- package/dist/src/index.test.js.map +1 -0
- package/dist/src/linux/index.d.ts +12 -0
- package/dist/src/linux/index.d.ts.map +1 -0
- package/dist/src/linux/index.js +11 -0
- package/dist/src/linux/index.js.map +1 -0
- package/dist/src/linux/linux-config.d.ts +37 -0
- package/dist/src/linux/linux-config.d.ts.map +1 -0
- package/dist/src/linux/linux-config.js +70 -0
- package/dist/src/linux/linux-config.js.map +1 -0
- package/dist/src/linux/linux-config.test.d.ts +2 -0
- package/dist/src/linux/linux-config.test.d.ts.map +1 -0
- package/dist/src/linux/linux-config.test.js +54 -0
- package/dist/src/linux/linux-config.test.js.map +1 -0
- package/dist/src/linux/linux-credential-writer.d.ts +35 -0
- package/dist/src/linux/linux-credential-writer.d.ts.map +1 -0
- package/dist/src/linux/linux-credential-writer.js +300 -0
- package/dist/src/linux/linux-credential-writer.js.map +1 -0
- package/dist/src/linux/linux-display-manager.d.ts +24 -0
- package/dist/src/linux/linux-display-manager.d.ts.map +1 -0
- package/dist/src/linux/linux-display-manager.js +92 -0
- package/dist/src/linux/linux-display-manager.js.map +1 -0
- package/dist/src/linux/linux-env-guard.d.ts +13 -0
- package/dist/src/linux/linux-env-guard.d.ts.map +1 -0
- package/dist/src/linux/linux-env-guard.js +31 -0
- package/dist/src/linux/linux-env-guard.js.map +1 -0
- package/dist/src/linux/linux-env-guard.test.d.ts +2 -0
- package/dist/src/linux/linux-env-guard.test.d.ts.map +1 -0
- package/dist/src/linux/linux-env-guard.test.js +48 -0
- package/dist/src/linux/linux-env-guard.test.js.map +1 -0
- package/dist/src/linux/linux-fflags.d.ts +17 -0
- package/dist/src/linux/linux-fflags.d.ts.map +1 -0
- package/dist/src/linux/linux-fflags.js +33 -0
- package/dist/src/linux/linux-fflags.js.map +1 -0
- package/dist/src/linux/linux-fflags.test.d.ts +2 -0
- package/dist/src/linux/linux-fflags.test.d.ts.map +1 -0
- package/dist/src/linux/linux-fflags.test.js +55 -0
- package/dist/src/linux/linux-fflags.test.js.map +1 -0
- package/dist/src/linux/linux-prerequisites.d.ts +24 -0
- package/dist/src/linux/linux-prerequisites.d.ts.map +1 -0
- package/dist/src/linux/linux-prerequisites.js +118 -0
- package/dist/src/linux/linux-prerequisites.js.map +1 -0
- package/dist/src/linux/linux-shader-patcher.d.ts +17 -0
- package/dist/src/linux/linux-shader-patcher.d.ts.map +1 -0
- package/dist/src/linux/linux-shader-patcher.js +48 -0
- package/dist/src/linux/linux-shader-patcher.js.map +1 -0
- package/dist/src/linux/linux-shader-patcher.test.d.ts +2 -0
- package/dist/src/linux/linux-shader-patcher.test.d.ts.map +1 -0
- package/dist/src/linux/linux-shader-patcher.test.js +55 -0
- package/dist/src/linux/linux-shader-patcher.test.js.map +1 -0
- package/dist/src/linux/linux-studio-installer.d.ts +10 -0
- package/dist/src/linux/linux-studio-installer.d.ts.map +1 -0
- package/dist/src/linux/linux-studio-installer.js +79 -0
- package/dist/src/linux/linux-studio-installer.js.map +1 -0
- package/dist/src/linux/linux-studio-launcher.d.ts +10 -0
- package/dist/src/linux/linux-studio-launcher.d.ts.map +1 -0
- package/dist/src/linux/linux-studio-launcher.js +73 -0
- package/dist/src/linux/linux-studio-launcher.js.map +1 -0
- package/dist/src/linux/linux-version-resolver.d.ts +18 -0
- package/dist/src/linux/linux-version-resolver.d.ts.map +1 -0
- package/dist/src/linux/linux-version-resolver.js +49 -0
- package/dist/src/linux/linux-version-resolver.js.map +1 -0
- package/dist/src/linux/linux-wine-env.d.ts +11 -0
- package/dist/src/linux/linux-wine-env.d.ts.map +1 -0
- package/dist/src/linux/linux-wine-env.js +33 -0
- package/dist/src/linux/linux-wine-env.js.map +1 -0
- package/dist/src/linux/linux-wine-env.test.d.ts +2 -0
- package/dist/src/linux/linux-wine-env.test.d.ts.map +1 -0
- package/dist/src/linux/linux-wine-env.test.js +47 -0
- package/dist/src/linux/linux-wine-env.test.js.map +1 -0
- package/dist/src/plugin/persistent-plugin-installer.d.ts +21 -0
- package/dist/src/plugin/persistent-plugin-installer.d.ts.map +1 -0
- package/dist/src/plugin/persistent-plugin-installer.js +69 -0
- package/dist/src/plugin/persistent-plugin-installer.js.map +1 -0
- package/dist/src/plugin/persistent-plugin-installer.test.d.ts +5 -0
- package/dist/src/plugin/persistent-plugin-installer.test.d.ts.map +1 -0
- package/dist/src/plugin/persistent-plugin-installer.test.js +119 -0
- package/dist/src/plugin/persistent-plugin-installer.test.js.map +1 -0
- package/dist/src/plugin/plugin-discovery.d.ts +7 -0
- package/dist/src/plugin/plugin-discovery.d.ts.map +1 -0
- package/dist/src/plugin/plugin-discovery.js +18 -0
- package/dist/src/plugin/plugin-discovery.js.map +1 -0
- package/dist/src/plugin/plugin-discovery.test.d.ts +5 -0
- package/dist/src/plugin/plugin-discovery.test.d.ts.map +1 -0
- package/dist/src/plugin/plugin-discovery.test.js +55 -0
- package/dist/src/plugin/plugin-discovery.test.js.map +1 -0
- package/dist/src/plugin/plugin-injector.js +1 -1
- package/dist/src/plugin/plugin-injector.js.map +1 -1
- package/dist/src/process/studio-process-manager.d.ts +7 -3
- package/dist/src/process/studio-process-manager.d.ts.map +1 -1
- package/dist/src/process/studio-process-manager.js +40 -11
- package/dist/src/process/studio-process-manager.js.map +1 -1
- package/dist/src/process/studio-process-manager.test.js +18 -1
- package/dist/src/process/studio-process-manager.test.js.map +1 -1
- package/dist/src/server/action-dispatcher.d.ts +35 -0
- package/dist/src/server/action-dispatcher.d.ts.map +1 -0
- package/dist/src/server/action-dispatcher.js +67 -0
- package/dist/src/server/action-dispatcher.js.map +1 -0
- package/dist/src/server/action-dispatcher.test.d.ts +6 -0
- package/dist/src/server/action-dispatcher.test.d.ts.map +1 -0
- package/dist/src/server/action-dispatcher.test.js +173 -0
- package/dist/src/server/action-dispatcher.test.js.map +1 -0
- package/dist/src/server/index.d.ts +1 -1
- package/dist/src/server/index.d.ts.map +1 -1
- package/dist/src/server/pending-request-map.d.ts +33 -0
- package/dist/src/server/pending-request-map.d.ts.map +1 -0
- package/dist/src/server/pending-request-map.js +69 -0
- package/dist/src/server/pending-request-map.js.map +1 -0
- package/dist/src/server/pending-request-map.test.d.ts +2 -0
- package/dist/src/server/pending-request-map.test.d.ts.map +1 -0
- package/dist/src/server/pending-request-map.test.js +192 -0
- package/dist/src/server/pending-request-map.test.js.map +1 -0
- package/dist/src/server/plugin-detection.test.d.ts +7 -0
- package/dist/src/server/plugin-detection.test.d.ts.map +1 -0
- package/dist/src/server/plugin-detection.test.js +154 -0
- package/dist/src/server/plugin-detection.test.js.map +1 -0
- package/dist/src/server/studio-bridge-server.d.ts +44 -7
- package/dist/src/server/studio-bridge-server.d.ts.map +1 -1
- package/dist/src/server/studio-bridge-server.js +341 -91
- package/dist/src/server/studio-bridge-server.js.map +1 -1
- package/dist/src/server/studio-bridge-server.test.js +231 -207
- package/dist/src/server/studio-bridge-server.test.js.map +1 -1
- package/dist/src/server/web-socket-protocol-basic.test.d.ts +2 -0
- package/dist/src/server/web-socket-protocol-basic.test.d.ts.map +1 -0
- package/dist/src/server/web-socket-protocol-basic.test.js +98 -0
- package/dist/src/server/web-socket-protocol-basic.test.js.map +1 -0
- package/dist/src/server/web-socket-protocol.d.ts +218 -20
- package/dist/src/server/web-socket-protocol.d.ts.map +1 -1
- package/dist/src/server/web-socket-protocol.js +346 -20
- package/dist/src/server/web-socket-protocol.js.map +1 -1
- package/dist/src/server/web-socket-protocol.test.js +572 -146
- package/dist/src/server/web-socket-protocol.test.js.map +1 -1
- package/dist/src/test/e2e/hand-off.test.d.ts +9 -0
- package/dist/src/test/e2e/hand-off.test.d.ts.map +1 -0
- package/dist/src/test/e2e/hand-off.test.js +274 -0
- package/dist/src/test/e2e/hand-off.test.js.map +1 -0
- package/dist/src/test/e2e/persistent-session.test.d.ts +11 -0
- package/dist/src/test/e2e/persistent-session.test.d.ts.map +1 -0
- package/dist/src/test/e2e/persistent-session.test.js +367 -0
- package/dist/src/test/e2e/persistent-session.test.js.map +1 -0
- package/dist/src/test/e2e/split-server.test.d.ts +14 -0
- package/dist/src/test/e2e/split-server.test.d.ts.map +1 -0
- package/dist/src/test/e2e/split-server.test.js +230 -0
- package/dist/src/test/e2e/split-server.test.js.map +1 -0
- package/dist/src/test/helpers/mock-plugin-client.d.ts +69 -0
- package/dist/src/test/helpers/mock-plugin-client.d.ts.map +1 -0
- package/dist/src/test/helpers/mock-plugin-client.js +213 -0
- package/dist/src/test/helpers/mock-plugin-client.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docker/.dockerignore +2 -0
- package/docker/Dockerfile +113 -0
- package/docker/docker-compose.yml +20 -0
- package/docker/entrypoint.sh +19 -0
- package/package.json +8 -6
- package/src/bridge/bridge-connection-remote.test.ts +189 -0
- package/src/bridge/bridge-connection.test.ts +1076 -0
- package/src/bridge/bridge-connection.ts +718 -0
- package/src/bridge/bridge-session.test.ts +336 -0
- package/src/bridge/bridge-session.ts +365 -0
- package/src/bridge/index.ts +42 -0
- package/src/bridge/internal/__tests__/failover-crash.test.ts +191 -0
- package/src/bridge/internal/__tests__/failover-graceful.test.ts +268 -0
- package/src/bridge/internal/__tests__/failover-inflight.test.ts +329 -0
- package/src/bridge/internal/__tests__/host-client-integration.test.ts +387 -0
- package/src/bridge/internal/bridge-client.test.ts +399 -0
- package/src/bridge/internal/bridge-client.ts +434 -0
- package/src/bridge/internal/bridge-host.test.ts +501 -0
- package/src/bridge/internal/bridge-host.ts +531 -0
- package/src/bridge/internal/environment-detection.test.ts +180 -0
- package/src/bridge/internal/environment-detection.ts +119 -0
- package/src/bridge/internal/hand-off.test.ts +408 -0
- package/src/bridge/internal/hand-off.ts +275 -0
- package/src/bridge/internal/health-endpoint.test.ts +147 -0
- package/src/bridge/internal/health-endpoint.ts +100 -0
- package/src/bridge/internal/host-protocol.test.ts +415 -0
- package/src/bridge/internal/host-protocol.ts +255 -0
- package/src/bridge/internal/session-tracker.test.ts +535 -0
- package/src/bridge/internal/session-tracker.ts +198 -0
- package/src/bridge/internal/transport-client.test.ts +241 -0
- package/src/bridge/internal/transport-client.ts +194 -0
- package/src/bridge/internal/transport-server.test.ts +220 -0
- package/src/bridge/internal/transport-server.ts +242 -0
- package/src/bridge/types.ts +161 -0
- package/src/cli/adapters/cli-command-adapter-handler.test.ts +318 -0
- package/src/cli/adapters/cli-command-adapter.test.ts +221 -0
- package/src/cli/adapters/cli-command-adapter.ts +342 -0
- package/src/cli/adapters/group-builder.test.ts +146 -0
- package/src/cli/adapters/group-builder.ts +81 -0
- package/src/cli/adapters/help-formatter.test.ts +97 -0
- package/src/cli/adapters/help-formatter.ts +86 -0
- package/src/cli/adapters/target-resolver.test.ts +222 -0
- package/src/cli/adapters/target-resolver.ts +144 -0
- package/src/cli/args/global-args.ts +2 -0
- package/src/cli/cli.ts +100 -21
- package/src/cli/resolve-script-content.ts +36 -0
- package/src/cli/resolve-session.test.ts +141 -0
- package/src/cli/resolve-session.ts +66 -0
- package/src/cli/script-executor.ts +22 -4
- package/src/cli/types.ts +11 -0
- package/src/commands/connect.test.ts +61 -0
- package/src/commands/connect.ts +32 -0
- package/src/commands/console/exec/exec.test.ts +258 -0
- package/src/commands/console/exec/exec.ts +130 -0
- package/src/commands/console/exec/execute.luau +202 -0
- package/src/commands/console/logs/logs.test.ts +138 -0
- package/src/commands/console/logs/logs.ts +115 -0
- package/src/commands/console/logs/query-logs.luau +76 -0
- package/src/commands/disconnect.test.ts +21 -0
- package/src/commands/disconnect.ts +12 -0
- package/src/commands/explorer/query/query-data-model.luau +206 -0
- package/src/commands/explorer/query/query.test.ts +297 -0
- package/src/commands/explorer/query/query.ts +157 -0
- package/src/commands/formatters.test.ts +237 -0
- package/src/commands/framework/action-loader.test.ts +118 -0
- package/src/commands/framework/action-loader.ts +65 -0
- package/src/commands/framework/arg-builder.test.ts +298 -0
- package/src/commands/framework/arg-builder.ts +203 -0
- package/src/commands/framework/command-registry.test.ts +204 -0
- package/src/commands/framework/command-registry.ts +51 -0
- package/src/commands/framework/define-command.test.ts +161 -0
- package/src/commands/framework/define-command.ts +114 -0
- package/src/commands/framework/index.ts +33 -0
- package/src/commands/index.ts +72 -0
- package/src/commands/linux/inject-credentials/inject-credentials.ts +118 -0
- package/src/commands/linux/setup/setup.ts +145 -0
- package/src/commands/linux/status/status.ts +180 -0
- package/src/commands/plugin/install/install.ts +31 -0
- package/src/commands/plugin/uninstall/uninstall.ts +54 -0
- package/src/commands/process/close/close.ts +52 -0
- package/src/commands/process/format-state.ts +21 -0
- package/src/commands/process/info/info.test.ts +76 -0
- package/src/commands/process/info/info.ts +54 -0
- package/src/commands/process/info/query-state.luau +48 -0
- package/src/commands/process/launch/launch.test.ts +65 -0
- package/src/commands/process/launch/launch.ts +45 -0
- package/src/commands/process/list/list.test.ts +82 -0
- package/src/commands/process/list/list.ts +75 -0
- package/src/commands/process/run/run.ts +98 -0
- package/src/commands/rgba-to-png.ts +98 -0
- package/src/commands/serve/serve.test.ts +139 -0
- package/src/commands/serve/serve.ts +161 -0
- package/src/commands/viewport/screenshot/capture-screenshot.luau +247 -0
- package/src/commands/viewport/screenshot/screenshot.test.ts +181 -0
- package/src/commands/viewport/screenshot/screenshot.ts +71 -0
- package/src/docker/docker-delegator.test.ts +159 -0
- package/src/docker/docker-delegator.ts +240 -0
- package/src/index.test.ts +58 -0
- package/src/index.ts +104 -3
- package/src/linux/README.md +130 -0
- package/src/linux/index.ts +25 -0
- package/src/linux/linux-config.test.ts +66 -0
- package/src/linux/linux-config.ts +102 -0
- package/src/linux/linux-credential-writer.ts +421 -0
- package/src/linux/linux-display-manager.ts +106 -0
- package/src/linux/linux-env-guard.test.ts +62 -0
- package/src/linux/linux-env-guard.ts +38 -0
- package/src/linux/linux-fflags.test.ts +78 -0
- package/src/linux/linux-fflags.ts +48 -0
- package/src/linux/linux-prerequisites.ts +152 -0
- package/src/linux/linux-shader-patcher.test.ts +76 -0
- package/src/linux/linux-shader-patcher.ts +56 -0
- package/src/linux/linux-studio-installer.ts +113 -0
- package/src/linux/linux-studio-launcher.ts +90 -0
- package/src/linux/linux-version-resolver.ts +74 -0
- package/src/linux/linux-wine-env.test.ts +56 -0
- package/src/linux/linux-wine-env.ts +38 -0
- package/src/linux/write-cred.c +48 -0
- package/src/plugin/persistent-plugin-installer.test.ts +171 -0
- package/src/plugin/persistent-plugin-installer.ts +90 -0
- package/src/plugin/plugin-discovery.test.ts +70 -0
- package/src/plugin/plugin-discovery.ts +21 -0
- package/src/plugin/plugin-injector.ts +1 -1
- package/src/process/studio-process-manager.test.ts +22 -1
- package/src/process/studio-process-manager.ts +59 -18
- package/src/server/action-dispatcher.test.ts +240 -0
- package/src/server/action-dispatcher.ts +89 -0
- package/src/server/index.ts +0 -3
- package/src/server/pending-request-map.test.ts +261 -0
- package/src/server/pending-request-map.ts +87 -0
- package/src/server/plugin-detection.test.ts +195 -0
- package/src/server/studio-bridge-server.test.ts +321 -283
- package/src/server/studio-bridge-server.ts +469 -111
- package/src/server/web-socket-protocol-basic.test.ts +131 -0
- package/src/server/web-socket-protocol.test.ts +658 -159
- package/src/server/web-socket-protocol.ts +668 -58
- package/src/test/e2e/hand-off.test.ts +338 -0
- package/src/test/e2e/persistent-session.test.ts +442 -0
- package/src/test/e2e/split-server.test.ts +290 -0
- package/src/test/helpers/mock-plugin-client.ts +276 -0
- package/templates/studio-bridge-plugin/src/Shared/ActionRouter.luau +245 -0
- package/templates/studio-bridge-plugin/src/Shared/DiscoveryStateMachine.luau +203 -0
- package/templates/studio-bridge-plugin/src/Shared/MessageBuffer.luau +144 -0
- package/templates/studio-bridge-plugin/src/Shared/Protocol.luau +132 -0
- package/templates/studio-bridge-plugin/src/StudioBridgePlugin.server.lua +364 -133
- package/templates/studio-bridge-plugin/src/Vendor/png.luau +1247 -0
- package/templates/studio-bridge-plugin-test/test/actions.test.luau +580 -0
- package/templates/studio-bridge-plugin-test/test/discovery.test.luau +622 -0
- package/templates/studio-bridge-plugin-test/test/execute-handler.test.luau +406 -0
- package/templates/studio-bridge-plugin-test/test/hash-lifecycle.test.luau +814 -0
- package/templates/studio-bridge-plugin-test/test/integration.test.luau +1020 -0
- package/templates/studio-bridge-plugin-test/test/new-actions.test.luau +339 -0
- package/templates/studio-bridge-plugin-test/test/plugin-entry.test.luau +493 -0
- package/templates/studio-bridge-plugin-test/test/protocol.test.luau +506 -0
- package/templates/studio-bridge-plugin-test/test/roblox-mocks.luau +108 -0
- package/templates/studio-bridge-plugin-test/test/test-runner.luau +112 -0
- package/dist/src/cli/commands/exec-command.d.ts +0 -15
- package/dist/src/cli/commands/exec-command.d.ts.map +0 -1
- package/dist/src/cli/commands/exec-command.js +0 -35
- package/dist/src/cli/commands/exec-command.js.map +0 -1
- package/dist/src/cli/commands/run-command.d.ts +0 -15
- package/dist/src/cli/commands/run-command.d.ts.map +0 -1
- package/dist/src/cli/commands/run-command.js +0 -47
- package/dist/src/cli/commands/run-command.js.map +0 -1
- package/dist/src/cli/commands/terminal/terminal-command.d.ts +0 -17
- package/dist/src/cli/commands/terminal/terminal-command.d.ts.map +0 -1
- package/dist/src/cli/commands/terminal/terminal-command.js +0 -41
- package/dist/src/cli/commands/terminal/terminal-command.js.map +0 -1
- package/dist/src/cli/commands/terminal/terminal-editor.d.ts +0 -43
- package/dist/src/cli/commands/terminal/terminal-editor.d.ts.map +0 -1
- package/dist/src/cli/commands/terminal/terminal-editor.js +0 -430
- package/dist/src/cli/commands/terminal/terminal-editor.js.map +0 -1
- package/dist/src/cli/commands/terminal/terminal-mode.d.ts +0 -13
- package/dist/src/cli/commands/terminal/terminal-mode.d.ts.map +0 -1
- package/dist/src/cli/commands/terminal/terminal-mode.js +0 -141
- package/dist/src/cli/commands/terminal/terminal-mode.js.map +0 -1
- package/dist/src/server/web-socket-protocol.smoke.test.d.ts +0 -6
- package/dist/src/server/web-socket-protocol.smoke.test.d.ts.map +0 -1
- package/dist/src/server/web-socket-protocol.smoke.test.js +0 -196
- package/dist/src/server/web-socket-protocol.smoke.test.js.map +0 -1
- package/src/cli/commands/exec-command.ts +0 -48
- package/src/cli/commands/run-command.ts +0 -63
- package/src/cli/commands/terminal/terminal-command.ts +0 -54
- package/src/cli/commands/terminal/terminal-editor.ts +0 -500
- package/src/cli/commands/terminal/terminal-mode.ts +0 -184
- package/src/server/web-socket-protocol.smoke.test.ts +0 -255
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public API surface for the bridge module.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports ONLY public types — nothing from internal/ leaks out.
|
|
5
|
+
* Consumers import from '@quenty/studio-bridge/bridge' (or this index)
|
|
6
|
+
* and get BridgeConnection, BridgeSession, typed results, and errors.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
// Classes
|
|
10
|
+
export { BridgeConnection } from './bridge-connection.js';
|
|
11
|
+
export type { BridgeConnectionOptions } from './bridge-connection.js';
|
|
12
|
+
export { BridgeSession } from './bridge-session.js';
|
|
13
|
+
|
|
14
|
+
// Types
|
|
15
|
+
export type {
|
|
16
|
+
SessionInfo,
|
|
17
|
+
InstanceInfo,
|
|
18
|
+
SessionContext,
|
|
19
|
+
SessionOrigin,
|
|
20
|
+
ExecResult,
|
|
21
|
+
StateResult,
|
|
22
|
+
ScreenshotResult,
|
|
23
|
+
LogsResult,
|
|
24
|
+
DataModelResult,
|
|
25
|
+
LogEntry,
|
|
26
|
+
LogOptions,
|
|
27
|
+
QueryDataModelOptions,
|
|
28
|
+
LogFollowOptions,
|
|
29
|
+
StudioState,
|
|
30
|
+
DataModelInstance,
|
|
31
|
+
OutputLevel,
|
|
32
|
+
} from './types.js';
|
|
33
|
+
|
|
34
|
+
// Error classes
|
|
35
|
+
export {
|
|
36
|
+
SessionNotFoundError,
|
|
37
|
+
ActionTimeoutError,
|
|
38
|
+
SessionDisconnectedError,
|
|
39
|
+
CapabilityNotSupportedError,
|
|
40
|
+
ContextNotFoundError,
|
|
41
|
+
HostUnreachableError,
|
|
42
|
+
} from './types.js';
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration tests for crash-recovery failover. Verifies that when a host
|
|
3
|
+
* process dies without sending a HostTransferNotice, clients detect the
|
|
4
|
+
* disconnect, apply random jitter, and race to bind the port.
|
|
5
|
+
*
|
|
6
|
+
* Uses real BridgeHost and HandOffManager instances with ephemeral ports.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { describe, it, expect, afterEach, vi } from 'vitest';
|
|
10
|
+
import { WebSocket } from 'ws';
|
|
11
|
+
import { BridgeHost } from '../bridge-host.js';
|
|
12
|
+
import { HandOffManager, computeTakeoverJitterMs } from '../hand-off.js';
|
|
13
|
+
|
|
14
|
+
function connectClientWsAsync(port: number): Promise<WebSocket> {
|
|
15
|
+
return new Promise<WebSocket>((resolve, reject) => {
|
|
16
|
+
const ws = new WebSocket(`ws://localhost:${port}/client`);
|
|
17
|
+
ws.on('open', () => resolve(ws));
|
|
18
|
+
ws.on('error', reject);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function waitForClose(ws: WebSocket, timeoutMs = 5_000): Promise<void> {
|
|
23
|
+
return new Promise<void>((resolve, reject) => {
|
|
24
|
+
if (ws.readyState === WebSocket.CLOSED) {
|
|
25
|
+
resolve();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const timer = setTimeout(() => {
|
|
29
|
+
reject(new Error('Timed out waiting for WebSocket close'));
|
|
30
|
+
}, timeoutMs);
|
|
31
|
+
ws.on('close', () => {
|
|
32
|
+
clearTimeout(timer);
|
|
33
|
+
resolve();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function delay(ms: number): Promise<void> {
|
|
39
|
+
return new Promise<void>((resolve) => setTimeout(resolve, ms));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
describe('Crash recovery failover', () => {
|
|
43
|
+
let host: BridgeHost | undefined;
|
|
44
|
+
let clientWs: WebSocket | undefined;
|
|
45
|
+
let newHost: BridgeHost | undefined;
|
|
46
|
+
|
|
47
|
+
afterEach(async () => {
|
|
48
|
+
if (clientWs) {
|
|
49
|
+
if (
|
|
50
|
+
clientWs.readyState === WebSocket.OPEN ||
|
|
51
|
+
clientWs.readyState === WebSocket.CONNECTING
|
|
52
|
+
) {
|
|
53
|
+
clientWs.terminate();
|
|
54
|
+
}
|
|
55
|
+
clientWs = undefined;
|
|
56
|
+
}
|
|
57
|
+
if (host) {
|
|
58
|
+
try {
|
|
59
|
+
await host.stopAsync();
|
|
60
|
+
} catch {
|
|
61
|
+
/* ignore */
|
|
62
|
+
}
|
|
63
|
+
host = undefined;
|
|
64
|
+
}
|
|
65
|
+
if (newHost) {
|
|
66
|
+
try {
|
|
67
|
+
await newHost.stopAsync();
|
|
68
|
+
} catch {
|
|
69
|
+
/* ignore */
|
|
70
|
+
}
|
|
71
|
+
newHost = undefined;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('client detects crash and takes over after jitter', async () => {
|
|
76
|
+
host = new BridgeHost();
|
|
77
|
+
const port = await host.startAsync({ port: 0 });
|
|
78
|
+
|
|
79
|
+
clientWs = await connectClientWsAsync(port);
|
|
80
|
+
|
|
81
|
+
// Force-close the host (simulates crash — no HostTransferNotice sent)
|
|
82
|
+
await host.stopAsync();
|
|
83
|
+
host = undefined;
|
|
84
|
+
|
|
85
|
+
// Wait for the client WebSocket to detect the close
|
|
86
|
+
await waitForClose(clientWs);
|
|
87
|
+
|
|
88
|
+
// Client did NOT receive a transfer notice, so this is a crash path
|
|
89
|
+
const handOff = new HandOffManager({ port });
|
|
90
|
+
// Do NOT call onHostTransferNotice — this is a crash
|
|
91
|
+
|
|
92
|
+
const outcome = await handOff.onHostDisconnectedAsync();
|
|
93
|
+
expect(outcome).toBe('promoted');
|
|
94
|
+
expect(handOff.state).toBe('promoted');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('crash jitter is in [0, 500ms] range', () => {
|
|
98
|
+
// Verify the jitter function produces values in the correct range
|
|
99
|
+
for (let i = 0; i < 200; i++) {
|
|
100
|
+
const jitter = computeTakeoverJitterMs({ graceful: false });
|
|
101
|
+
expect(jitter).toBeGreaterThanOrEqual(0);
|
|
102
|
+
expect(jitter).toBeLessThanOrEqual(500);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it('crash jitter is zero for graceful shutdowns', () => {
|
|
107
|
+
const jitter = computeTakeoverJitterMs({ graceful: true });
|
|
108
|
+
expect(jitter).toBe(0);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('multiple clients after crash: exactly one wins the port bind race', async () => {
|
|
112
|
+
host = new BridgeHost();
|
|
113
|
+
const port = await host.startAsync({ port: 0 });
|
|
114
|
+
|
|
115
|
+
// Connect two clients
|
|
116
|
+
const ws1 = await connectClientWsAsync(port);
|
|
117
|
+
const ws2 = await connectClientWsAsync(port);
|
|
118
|
+
|
|
119
|
+
// Force-close the host (crash)
|
|
120
|
+
await host.stopAsync();
|
|
121
|
+
host = undefined;
|
|
122
|
+
|
|
123
|
+
// Wait for both clients to detect the close
|
|
124
|
+
await Promise.all([waitForClose(ws1), waitForClose(ws2)]);
|
|
125
|
+
|
|
126
|
+
// Both clients attempt takeover without transfer notice (crash path).
|
|
127
|
+
// We need to coordinate: the first one to bind starts a new host so the
|
|
128
|
+
// second can fall back.
|
|
129
|
+
const handOff1 = new HandOffManager({ port });
|
|
130
|
+
const handOff2 = new HandOffManager({ port });
|
|
131
|
+
|
|
132
|
+
// Zero-jitter for determinism: mock Math.random to return 0
|
|
133
|
+
const randomSpy = vi.spyOn(Math, 'random').mockReturnValue(0);
|
|
134
|
+
|
|
135
|
+
const results = await Promise.allSettled([
|
|
136
|
+
(async () => {
|
|
137
|
+
const result = await handOff1.onHostDisconnectedAsync();
|
|
138
|
+
if (result === 'promoted') {
|
|
139
|
+
// Bind the port so the other client can fall back
|
|
140
|
+
newHost = new BridgeHost();
|
|
141
|
+
await newHost.startAsync({ port });
|
|
142
|
+
}
|
|
143
|
+
return result;
|
|
144
|
+
})(),
|
|
145
|
+
(async () => {
|
|
146
|
+
// Small delay so the first client binds first
|
|
147
|
+
await delay(100);
|
|
148
|
+
return handOff2.onHostDisconnectedAsync();
|
|
149
|
+
})(),
|
|
150
|
+
]);
|
|
151
|
+
|
|
152
|
+
randomSpy.mockRestore();
|
|
153
|
+
|
|
154
|
+
const fulfilled = results
|
|
155
|
+
.filter(
|
|
156
|
+
(r): r is PromiseFulfilledResult<'promoted' | 'fell-back-to-client'> =>
|
|
157
|
+
r.status === 'fulfilled'
|
|
158
|
+
)
|
|
159
|
+
.map((r) => r.value);
|
|
160
|
+
|
|
161
|
+
// At least one should be promoted
|
|
162
|
+
expect(fulfilled.filter((o) => o === 'promoted')).toHaveLength(1);
|
|
163
|
+
|
|
164
|
+
// Clean up
|
|
165
|
+
ws1.terminate();
|
|
166
|
+
ws2.terminate();
|
|
167
|
+
clientWs = undefined;
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it('takeover succeeds even when host port is briefly in TIME_WAIT', async () => {
|
|
171
|
+
// This test verifies that after a host stops, the port becomes available
|
|
172
|
+
// quickly enough for takeover. Node's SO_REUSEADDR helps here.
|
|
173
|
+
host = new BridgeHost();
|
|
174
|
+
const port = await host.startAsync({ port: 0 });
|
|
175
|
+
|
|
176
|
+
await host.stopAsync();
|
|
177
|
+
host = undefined;
|
|
178
|
+
|
|
179
|
+
// Immediately try to bind
|
|
180
|
+
const handOff = new HandOffManager({ port });
|
|
181
|
+
handOff.onHostTransferNotice(); // skip jitter
|
|
182
|
+
|
|
183
|
+
const outcome = await handOff.onHostDisconnectedAsync();
|
|
184
|
+
expect(outcome).toBe('promoted');
|
|
185
|
+
|
|
186
|
+
// Verify the port is actually usable
|
|
187
|
+
newHost = new BridgeHost();
|
|
188
|
+
const newPort = await newHost.startAsync({ port });
|
|
189
|
+
expect(newPort).toBe(port);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration tests for graceful host shutdown failover. Verifies that when
|
|
3
|
+
* a host calls shutdownAsync(), clients receive the HostTransferNotice and
|
|
4
|
+
* one of them successfully takes over as the new host.
|
|
5
|
+
*
|
|
6
|
+
* Uses real BridgeHost and HandOffManager instances with ephemeral ports.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { describe, it, expect, afterEach } from 'vitest';
|
|
10
|
+
import { WebSocket } from 'ws';
|
|
11
|
+
import { BridgeHost } from '../bridge-host.js';
|
|
12
|
+
import { HandOffManager } from '../hand-off.js';
|
|
13
|
+
import { decodeHostMessage } from '../host-protocol.js';
|
|
14
|
+
|
|
15
|
+
/** Wait for a WebSocket message matching a predicate. */
|
|
16
|
+
function waitForMessageAsync(
|
|
17
|
+
ws: WebSocket,
|
|
18
|
+
predicate: (data: string) => boolean,
|
|
19
|
+
timeoutMs = 5_000
|
|
20
|
+
): Promise<string> {
|
|
21
|
+
return new Promise<string>((resolve, reject) => {
|
|
22
|
+
const timer = setTimeout(() => {
|
|
23
|
+
ws.off('message', onMessage);
|
|
24
|
+
reject(new Error('Timed out waiting for message'));
|
|
25
|
+
}, timeoutMs);
|
|
26
|
+
|
|
27
|
+
const onMessage = (raw: Buffer | string) => {
|
|
28
|
+
const data = typeof raw === 'string' ? raw : raw.toString('utf-8');
|
|
29
|
+
if (predicate(data)) {
|
|
30
|
+
clearTimeout(timer);
|
|
31
|
+
ws.off('message', onMessage);
|
|
32
|
+
resolve(data);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
ws.on('message', onMessage);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Connect a raw WebSocket to the host's /client path. */
|
|
41
|
+
function connectClientWsAsync(port: number): Promise<WebSocket> {
|
|
42
|
+
return new Promise<WebSocket>((resolve, reject) => {
|
|
43
|
+
const ws = new WebSocket(`ws://localhost:${port}/client`);
|
|
44
|
+
ws.on('open', () => resolve(ws));
|
|
45
|
+
ws.on('error', reject);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function delay(ms: number): Promise<void> {
|
|
50
|
+
return new Promise<void>((resolve) => setTimeout(resolve, ms));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
describe('Graceful shutdown failover', () => {
|
|
54
|
+
let host: BridgeHost | undefined;
|
|
55
|
+
let clientWs: WebSocket | undefined;
|
|
56
|
+
let newHost: BridgeHost | undefined;
|
|
57
|
+
|
|
58
|
+
afterEach(async () => {
|
|
59
|
+
if (clientWs) {
|
|
60
|
+
if (
|
|
61
|
+
clientWs.readyState === WebSocket.OPEN ||
|
|
62
|
+
clientWs.readyState === WebSocket.CONNECTING
|
|
63
|
+
) {
|
|
64
|
+
clientWs.terminate();
|
|
65
|
+
}
|
|
66
|
+
clientWs = undefined;
|
|
67
|
+
}
|
|
68
|
+
if (host) {
|
|
69
|
+
try {
|
|
70
|
+
await host.stopAsync();
|
|
71
|
+
} catch {
|
|
72
|
+
/* ignore */
|
|
73
|
+
}
|
|
74
|
+
host = undefined;
|
|
75
|
+
}
|
|
76
|
+
if (newHost) {
|
|
77
|
+
try {
|
|
78
|
+
await newHost.stopAsync();
|
|
79
|
+
} catch {
|
|
80
|
+
/* ignore */
|
|
81
|
+
}
|
|
82
|
+
newHost = undefined;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('client receives host-transfer notice on graceful shutdown', async () => {
|
|
87
|
+
host = new BridgeHost();
|
|
88
|
+
const port = await host.startAsync({ port: 0 });
|
|
89
|
+
|
|
90
|
+
clientWs = await connectClientWsAsync(port);
|
|
91
|
+
|
|
92
|
+
// Start listening for the transfer notice BEFORE triggering shutdown
|
|
93
|
+
const noticePromise = waitForMessageAsync(clientWs, (data) => {
|
|
94
|
+
const msg = decodeHostMessage(data);
|
|
95
|
+
return msg?.type === 'host-transfer';
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// Trigger graceful shutdown
|
|
99
|
+
await host.shutdownAsync();
|
|
100
|
+
host = undefined;
|
|
101
|
+
|
|
102
|
+
// Client should have received the notice
|
|
103
|
+
const noticeData = await noticePromise;
|
|
104
|
+
const msg = decodeHostMessage(noticeData);
|
|
105
|
+
expect(msg).not.toBeNull();
|
|
106
|
+
expect(msg!.type).toBe('host-transfer');
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('client takes over as host after graceful shutdown', async () => {
|
|
110
|
+
host = new BridgeHost();
|
|
111
|
+
const port = await host.startAsync({ port: 0 });
|
|
112
|
+
|
|
113
|
+
clientWs = await connectClientWsAsync(port);
|
|
114
|
+
|
|
115
|
+
// Set up HandOffManager for this client
|
|
116
|
+
const handOff = new HandOffManager({ port });
|
|
117
|
+
|
|
118
|
+
// Start listening for transfer notice
|
|
119
|
+
const noticePromise = waitForMessageAsync(clientWs, (data) => {
|
|
120
|
+
const msg = decodeHostMessage(data);
|
|
121
|
+
return msg?.type === 'host-transfer';
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Trigger graceful shutdown
|
|
125
|
+
await host.shutdownAsync();
|
|
126
|
+
host = undefined;
|
|
127
|
+
|
|
128
|
+
// Wait for the notice to arrive
|
|
129
|
+
await noticePromise;
|
|
130
|
+
handOff.onHostTransferNotice();
|
|
131
|
+
|
|
132
|
+
// Client detects disconnect and runs takeover
|
|
133
|
+
const outcome = await handOff.onHostDisconnectedAsync();
|
|
134
|
+
expect(outcome).toBe('promoted');
|
|
135
|
+
expect(handOff.state).toBe('promoted');
|
|
136
|
+
|
|
137
|
+
// Verify the port is actually free — new host can bind
|
|
138
|
+
newHost = new BridgeHost();
|
|
139
|
+
const newPort = await newHost.startAsync({ port });
|
|
140
|
+
expect(newPort).toBe(port);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('multiple clients: exactly one becomes host, others fall back', async () => {
|
|
144
|
+
host = new BridgeHost();
|
|
145
|
+
const port = await host.startAsync({ port: 0 });
|
|
146
|
+
|
|
147
|
+
// Connect two clients
|
|
148
|
+
const ws1 = await connectClientWsAsync(port);
|
|
149
|
+
const ws2 = await connectClientWsAsync(port);
|
|
150
|
+
|
|
151
|
+
const notice1Promise = waitForMessageAsync(ws1, (data) => {
|
|
152
|
+
const msg = decodeHostMessage(data);
|
|
153
|
+
return msg?.type === 'host-transfer';
|
|
154
|
+
});
|
|
155
|
+
const notice2Promise = waitForMessageAsync(ws2, (data) => {
|
|
156
|
+
const msg = decodeHostMessage(data);
|
|
157
|
+
return msg?.type === 'host-transfer';
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// Graceful shutdown
|
|
161
|
+
await host.shutdownAsync();
|
|
162
|
+
host = undefined;
|
|
163
|
+
|
|
164
|
+
// Both clients should receive the notice
|
|
165
|
+
await Promise.all([notice1Promise, notice2Promise]);
|
|
166
|
+
|
|
167
|
+
// Both run the takeover state machine (one must bind, other must fall back)
|
|
168
|
+
const handOff1 = new HandOffManager({ port });
|
|
169
|
+
handOff1.onHostTransferNotice();
|
|
170
|
+
|
|
171
|
+
const handOff2 = new HandOffManager({ port });
|
|
172
|
+
handOff2.onHostTransferNotice();
|
|
173
|
+
|
|
174
|
+
// Simulate both clients starting takeover.
|
|
175
|
+
// One will bind the port and succeed, the other will fail to bind.
|
|
176
|
+
// We need to actually bind a host for the fallback client to connect to.
|
|
177
|
+
|
|
178
|
+
// Race them: first one to bind starts a new host
|
|
179
|
+
const results = await Promise.allSettled([
|
|
180
|
+
(async () => {
|
|
181
|
+
const result = await handOff1.onHostDisconnectedAsync();
|
|
182
|
+
if (result === 'promoted') {
|
|
183
|
+
newHost = new BridgeHost();
|
|
184
|
+
await newHost.startAsync({ port });
|
|
185
|
+
}
|
|
186
|
+
return result;
|
|
187
|
+
})(),
|
|
188
|
+
(async () => {
|
|
189
|
+
// Small delay to avoid thundering herd in test
|
|
190
|
+
await delay(50);
|
|
191
|
+
return handOff2.onHostDisconnectedAsync();
|
|
192
|
+
})(),
|
|
193
|
+
]);
|
|
194
|
+
|
|
195
|
+
const outcomes = results
|
|
196
|
+
.filter(
|
|
197
|
+
(r): r is PromiseFulfilledResult<'promoted' | 'fell-back-to-client'> =>
|
|
198
|
+
r.status === 'fulfilled'
|
|
199
|
+
)
|
|
200
|
+
.map((r) => r.value);
|
|
201
|
+
|
|
202
|
+
// Exactly one should be promoted
|
|
203
|
+
expect(outcomes.filter((o) => o === 'promoted')).toHaveLength(1);
|
|
204
|
+
// The other should fall back (or the second could also get promoted if the first
|
|
205
|
+
// hasn't bound yet, but with the delay this is deterministic)
|
|
206
|
+
|
|
207
|
+
// Clean up WebSockets
|
|
208
|
+
ws1.terminate();
|
|
209
|
+
ws2.terminate();
|
|
210
|
+
clientWs = undefined; // prevent double-cleanup
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it('plugin reconnects to the new host after failover', async () => {
|
|
214
|
+
host = new BridgeHost();
|
|
215
|
+
const port = await host.startAsync({ port: 0 });
|
|
216
|
+
|
|
217
|
+
clientWs = await connectClientWsAsync(port);
|
|
218
|
+
|
|
219
|
+
const noticePromise = waitForMessageAsync(clientWs, (data) => {
|
|
220
|
+
const msg = decodeHostMessage(data);
|
|
221
|
+
return msg?.type === 'host-transfer';
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
// Shutdown the original host
|
|
225
|
+
await host.shutdownAsync();
|
|
226
|
+
host = undefined;
|
|
227
|
+
await noticePromise;
|
|
228
|
+
|
|
229
|
+
// Start a new host on the same port
|
|
230
|
+
newHost = new BridgeHost();
|
|
231
|
+
const newPort = await newHost.startAsync({ port });
|
|
232
|
+
expect(newPort).toBe(port);
|
|
233
|
+
|
|
234
|
+
// Verify a plugin can connect to the new host
|
|
235
|
+
const pluginConnectedPromise = new Promise<string>((resolve) => {
|
|
236
|
+
newHost!.on('plugin-connected', (info: { sessionId: string }) => {
|
|
237
|
+
resolve(info.sessionId);
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
// Simulate a plugin connecting
|
|
242
|
+
const pluginWs = new WebSocket(`ws://localhost:${port}/plugin`);
|
|
243
|
+
await new Promise<void>((resolve, reject) => {
|
|
244
|
+
pluginWs.on('open', () => {
|
|
245
|
+
pluginWs.send(
|
|
246
|
+
JSON.stringify({
|
|
247
|
+
type: 'register',
|
|
248
|
+
sessionId: 'plugin-session-1',
|
|
249
|
+
payload: {
|
|
250
|
+
pluginVersion: '1.0.0',
|
|
251
|
+
instanceId: 'inst-1',
|
|
252
|
+
placeName: 'TestPlace',
|
|
253
|
+
state: 'Edit',
|
|
254
|
+
capabilities: ['execute'],
|
|
255
|
+
},
|
|
256
|
+
})
|
|
257
|
+
);
|
|
258
|
+
resolve();
|
|
259
|
+
});
|
|
260
|
+
pluginWs.on('error', reject);
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
const connectedSessionId = await pluginConnectedPromise;
|
|
264
|
+
expect(connectedSessionId).toBe('plugin-session-1');
|
|
265
|
+
|
|
266
|
+
pluginWs.terminate();
|
|
267
|
+
});
|
|
268
|
+
});
|