@quenty/studio-bridge 0.21.0 → 0.22.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 +12 -0
- package/README.md +109 -17
- package/build-scripts/transform-add-session-attribute.lua +1 -0
- package/deploy.nevermore.json +10 -0
- package/dist/src/bridge/bridge-connection.d.ts +26 -2
- package/dist/src/bridge/bridge-connection.d.ts.map +1 -1
- package/dist/src/bridge/bridge-connection.js +159 -14
- package/dist/src/bridge/bridge-connection.js.map +1 -1
- package/dist/src/bridge/bridge-connection.test.js +81 -0
- package/dist/src/bridge/bridge-connection.test.js.map +1 -1
- package/dist/src/bridge/bridge-session.d.ts +35 -2
- package/dist/src/bridge/bridge-session.d.ts.map +1 -1
- package/dist/src/bridge/bridge-session.js +185 -28
- package/dist/src/bridge/bridge-session.js.map +1 -1
- package/dist/src/bridge/bridge-session.test.js +6 -4
- package/dist/src/bridge/bridge-session.test.js.map +1 -1
- package/dist/src/bridge/index.d.ts +1 -1
- package/dist/src/bridge/index.d.ts.map +1 -1
- package/dist/src/bridge/index.js.map +1 -1
- package/dist/src/bridge/internal/bridge-client.d.ts +4 -0
- package/dist/src/bridge/internal/bridge-client.d.ts.map +1 -1
- package/dist/src/bridge/internal/bridge-client.js +20 -7
- package/dist/src/bridge/internal/bridge-client.js.map +1 -1
- package/dist/src/bridge/internal/bridge-client.test.js +18 -0
- package/dist/src/bridge/internal/bridge-client.test.js.map +1 -1
- package/dist/src/bridge/internal/bridge-host.d.ts +13 -1
- package/dist/src/bridge/internal/bridge-host.d.ts.map +1 -1
- package/dist/src/bridge/internal/bridge-host.js +35 -0
- package/dist/src/bridge/internal/bridge-host.js.map +1 -1
- package/dist/src/bridge/internal/bridge-host.test.js +31 -0
- package/dist/src/bridge/internal/bridge-host.test.js.map +1 -1
- package/dist/src/bridge/internal/hand-off.d.ts.map +1 -1
- package/dist/src/bridge/internal/hand-off.js +4 -1
- package/dist/src/bridge/internal/hand-off.js.map +1 -1
- package/dist/src/bridge/internal/host-protocol.d.ts +8 -0
- package/dist/src/bridge/internal/host-protocol.d.ts.map +1 -1
- package/dist/src/bridge/internal/host-protocol.js +120 -13
- package/dist/src/bridge/internal/host-protocol.js.map +1 -1
- package/dist/src/bridge/internal/host-protocol.test.js +13 -0
- package/dist/src/bridge/internal/host-protocol.test.js.map +1 -1
- package/dist/src/bridge/internal/instance-state.d.ts +9 -0
- package/dist/src/bridge/internal/instance-state.d.ts.map +1 -0
- package/dist/src/bridge/internal/instance-state.js +28 -0
- package/dist/src/bridge/internal/instance-state.js.map +1 -0
- package/dist/src/bridge/internal/transport-client.d.ts.map +1 -1
- package/dist/src/bridge/internal/transport-client.js +2 -1
- package/dist/src/bridge/internal/transport-client.js.map +1 -1
- package/dist/src/bridge/internal/transport-server.d.ts.map +1 -1
- package/dist/src/bridge/internal/transport-server.js +5 -1
- package/dist/src/bridge/internal/transport-server.js.map +1 -1
- package/dist/src/bridge/types.d.ts +43 -4
- package/dist/src/bridge/types.d.ts.map +1 -1
- package/dist/src/bridge/types.js.map +1 -1
- package/dist/src/cli/adapters/cli-command-adapter-handler.test.js +24 -0
- package/dist/src/cli/adapters/cli-command-adapter-handler.test.js.map +1 -1
- package/dist/src/cli/adapters/cli-command-adapter.d.ts +6 -0
- package/dist/src/cli/adapters/cli-command-adapter.d.ts.map +1 -1
- package/dist/src/cli/adapters/cli-command-adapter.js +107 -11
- package/dist/src/cli/adapters/cli-command-adapter.js.map +1 -1
- package/dist/src/cli/adapters/group-builder.d.ts +3 -0
- package/dist/src/cli/adapters/group-builder.d.ts.map +1 -1
- package/dist/src/cli/adapters/group-builder.js +34 -15
- package/dist/src/cli/adapters/group-builder.js.map +1 -1
- package/dist/src/cli/adapters/group-builder.test.js +26 -2
- package/dist/src/cli/adapters/group-builder.test.js.map +1 -1
- package/dist/src/cli/adapters/help-formatter.d.ts.map +1 -1
- package/dist/src/cli/adapters/help-formatter.js +4 -3
- package/dist/src/cli/adapters/help-formatter.js.map +1 -1
- package/dist/src/cli/adapters/help-formatter.test.js +1 -1
- package/dist/src/cli/adapters/help-formatter.test.js.map +1 -1
- package/dist/src/cli/adapters/playtest-edit-guard.test.d.ts +2 -0
- package/dist/src/cli/adapters/playtest-edit-guard.test.d.ts.map +1 -0
- package/dist/src/cli/adapters/playtest-edit-guard.test.js +28 -0
- package/dist/src/cli/adapters/playtest-edit-guard.test.js.map +1 -0
- package/dist/src/cli/args/global-args.d.ts +1 -1
- package/dist/src/cli/args/global-args.d.ts.map +1 -1
- package/dist/src/cli/cli-output-context.d.ts +14 -0
- package/dist/src/cli/cli-output-context.d.ts.map +1 -0
- package/dist/src/cli/cli-output-context.js +39 -0
- package/dist/src/cli/cli-output-context.js.map +1 -0
- package/dist/src/cli/cli-output-context.test.d.ts +2 -0
- package/dist/src/cli/cli-output-context.test.d.ts.map +1 -0
- package/dist/src/cli/cli-output-context.test.js +38 -0
- package/dist/src/cli/cli-output-context.test.js.map +1 -0
- package/dist/src/cli/cli.js +40 -17
- package/dist/src/cli/cli.js.map +1 -1
- package/dist/src/cli/managed-studio-run.d.ts +21 -0
- package/dist/src/cli/managed-studio-run.d.ts.map +1 -0
- package/dist/src/cli/managed-studio-run.js +75 -0
- package/dist/src/cli/managed-studio-run.js.map +1 -0
- package/dist/src/cli/managed-studio-run.test.d.ts +2 -0
- package/dist/src/cli/managed-studio-run.test.d.ts.map +1 -0
- package/dist/src/cli/managed-studio-run.test.js +52 -0
- package/dist/src/cli/managed-studio-run.test.js.map +1 -0
- package/dist/src/cli/resolve-session.js +1 -1
- package/dist/src/cli/resolve-session.js.map +1 -1
- package/dist/src/cli/resolve-session.test.js +1 -1
- package/dist/src/cli/resolve-session.test.js.map +1 -1
- package/dist/src/cli/script-executor.d.ts +13 -1
- package/dist/src/cli/script-executor.d.ts.map +1 -1
- package/dist/src/cli/script-executor.js +77 -47
- package/dist/src/cli/script-executor.js.map +1 -1
- package/dist/src/commands/console/exec/exec.d.ts +17 -0
- package/dist/src/commands/console/exec/exec.d.ts.map +1 -1
- package/dist/src/commands/console/exec/exec.js +39 -7
- package/dist/src/commands/console/exec/exec.js.map +1 -1
- package/dist/src/commands/console/exec/exec.test.js +62 -3
- package/dist/src/commands/console/exec/exec.test.js.map +1 -1
- package/dist/src/commands/console/logs/logs.d.ts +30 -2
- package/dist/src/commands/console/logs/logs.d.ts.map +1 -1
- package/dist/src/commands/console/logs/logs.js +82 -7
- package/dist/src/commands/console/logs/logs.js.map +1 -1
- package/dist/src/commands/console/logs/logs.test.js +63 -4
- package/dist/src/commands/console/logs/logs.test.js.map +1 -1
- package/dist/src/commands/explorer/export/export.d.ts +19 -0
- package/dist/src/commands/explorer/export/export.d.ts.map +1 -0
- package/dist/src/commands/explorer/export/export.js +37 -0
- package/dist/src/commands/explorer/export/export.js.map +1 -0
- package/dist/src/commands/explorer/export/export.test.d.ts +2 -0
- package/dist/src/commands/explorer/export/export.test.d.ts.map +1 -0
- package/dist/src/commands/explorer/export/export.test.js +25 -0
- package/dist/src/commands/explorer/export/export.test.js.map +1 -0
- package/dist/src/commands/explorer/find/find.d.ts +28 -0
- package/dist/src/commands/explorer/find/find.d.ts.map +1 -0
- package/dist/src/commands/explorer/find/find.js +75 -0
- package/dist/src/commands/explorer/find/find.js.map +1 -0
- package/dist/src/commands/explorer/find/find.test.d.ts +2 -0
- package/dist/src/commands/explorer/find/find.test.d.ts.map +1 -0
- package/dist/src/commands/explorer/find/find.test.js +44 -0
- package/dist/src/commands/explorer/find/find.test.js.map +1 -0
- package/dist/src/commands/explorer/grep/grep.d.ts +24 -0
- package/dist/src/commands/explorer/grep/grep.d.ts.map +1 -0
- package/dist/src/commands/explorer/grep/grep.js +63 -0
- package/dist/src/commands/explorer/grep/grep.js.map +1 -0
- package/dist/src/commands/explorer/grep/grep.test.d.ts +2 -0
- package/dist/src/commands/explorer/grep/grep.test.d.ts.map +1 -0
- package/dist/src/commands/explorer/grep/grep.test.js +42 -0
- package/dist/src/commands/explorer/grep/grep.test.js.map +1 -0
- package/dist/src/commands/explorer/import/import.d.ts +21 -0
- package/dist/src/commands/explorer/import/import.d.ts.map +1 -0
- package/dist/src/commands/explorer/import/import.js +37 -0
- package/dist/src/commands/explorer/import/import.js.map +1 -0
- package/dist/src/commands/explorer/import/import.test.d.ts +2 -0
- package/dist/src/commands/explorer/import/import.test.d.ts.map +1 -0
- package/dist/src/commands/explorer/import/import.test.js +45 -0
- package/dist/src/commands/explorer/import/import.test.js.map +1 -0
- package/dist/src/commands/formatters.test.js +7 -1
- package/dist/src/commands/formatters.test.js.map +1 -1
- package/dist/src/commands/framework/action-loader.d.ts +5 -1
- package/dist/src/commands/framework/action-loader.d.ts.map +1 -1
- package/dist/src/commands/framework/action-loader.js +9 -2
- package/dist/src/commands/framework/action-loader.js.map +1 -1
- package/dist/src/commands/framework/action-loader.test.js +23 -0
- package/dist/src/commands/framework/action-loader.test.js.map +1 -1
- package/dist/src/commands/framework/arg-builder.d.ts +15 -2
- package/dist/src/commands/framework/arg-builder.d.ts.map +1 -1
- package/dist/src/commands/framework/arg-builder.js +22 -2
- package/dist/src/commands/framework/arg-builder.js.map +1 -1
- package/dist/src/commands/framework/define-command.d.ts +19 -3
- package/dist/src/commands/framework/define-command.d.ts.map +1 -1
- package/dist/src/commands/framework/define-command.js.map +1 -1
- package/dist/src/commands/framework/index.d.ts +1 -1
- package/dist/src/commands/framework/index.d.ts.map +1 -1
- package/dist/src/commands/framework/index.js.map +1 -1
- package/dist/src/commands/index.d.ts +11 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +11 -0
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/linux/inject-credentials/inject-credentials.d.ts.map +1 -1
- package/dist/src/commands/linux/inject-credentials/inject-credentials.js +1 -3
- package/dist/src/commands/linux/inject-credentials/inject-credentials.js.map +1 -1
- package/dist/src/commands/linux/setup/setup.d.ts.map +1 -1
- package/dist/src/commands/linux/setup/setup.js +1 -3
- package/dist/src/commands/linux/setup/setup.js.map +1 -1
- package/dist/src/commands/linux/status/status.d.ts +9 -1
- package/dist/src/commands/linux/status/status.d.ts.map +1 -1
- package/dist/src/commands/linux/status/status.js +66 -86
- package/dist/src/commands/linux/status/status.js.map +1 -1
- package/dist/src/commands/playtest/player/add/add.d.ts +17 -0
- package/dist/src/commands/playtest/player/add/add.d.ts.map +1 -0
- package/dist/src/commands/playtest/player/add/add.js +45 -0
- package/dist/src/commands/playtest/player/add/add.js.map +1 -0
- package/dist/src/commands/playtest/player/list/list.d.ts +13 -0
- package/dist/src/commands/playtest/player/list/list.d.ts.map +1 -0
- package/dist/src/commands/playtest/player/list/list.js +33 -0
- package/dist/src/commands/playtest/player/list/list.js.map +1 -0
- package/dist/src/commands/playtest/player/playtest-players.d.ts +36 -0
- package/dist/src/commands/playtest/player/playtest-players.d.ts.map +1 -0
- package/dist/src/commands/playtest/player/playtest-players.js +187 -0
- package/dist/src/commands/playtest/player/playtest-players.js.map +1 -0
- package/dist/src/commands/playtest/player/playtest-players.test.d.ts +2 -0
- package/dist/src/commands/playtest/player/playtest-players.test.d.ts.map +1 -0
- package/dist/src/commands/playtest/player/playtest-players.test.js +89 -0
- package/dist/src/commands/playtest/player/playtest-players.test.js.map +1 -0
- package/dist/src/commands/playtest/player/remove/remove.d.ts +17 -0
- package/dist/src/commands/playtest/player/remove/remove.d.ts.map +1 -0
- package/dist/src/commands/playtest/player/remove/remove.js +42 -0
- package/dist/src/commands/playtest/player/remove/remove.js.map +1 -0
- package/dist/src/commands/playtest/playtest-sessions.d.ts +49 -0
- package/dist/src/commands/playtest/playtest-sessions.d.ts.map +1 -0
- package/dist/src/commands/playtest/playtest-sessions.js +283 -0
- package/dist/src/commands/playtest/playtest-sessions.js.map +1 -0
- package/dist/src/commands/playtest/playtest-sessions.test.d.ts +2 -0
- package/dist/src/commands/playtest/playtest-sessions.test.d.ts.map +1 -0
- package/dist/src/commands/playtest/playtest-sessions.test.js +87 -0
- package/dist/src/commands/playtest/playtest-sessions.test.js.map +1 -0
- package/dist/src/commands/playtest/restart/restart.d.ts +23 -0
- package/dist/src/commands/playtest/restart/restart.d.ts.map +1 -0
- package/dist/src/commands/playtest/restart/restart.js +105 -0
- package/dist/src/commands/playtest/restart/restart.js.map +1 -0
- package/dist/src/commands/playtest/run/run.d.ts +47 -0
- package/dist/src/commands/playtest/run/run.d.ts.map +1 -0
- package/dist/src/commands/playtest/run/run.js +137 -0
- package/dist/src/commands/playtest/run/run.js.map +1 -0
- package/dist/src/commands/playtest/start/start.d.ts +42 -0
- package/dist/src/commands/playtest/start/start.d.ts.map +1 -0
- package/dist/src/commands/playtest/start/start.js +70 -0
- package/dist/src/commands/playtest/start/start.js.map +1 -0
- package/dist/src/commands/playtest/stop/stop.d.ts +15 -0
- package/dist/src/commands/playtest/stop/stop.d.ts.map +1 -0
- package/dist/src/commands/playtest/stop/stop.js +24 -0
- package/dist/src/commands/playtest/stop/stop.js.map +1 -0
- package/dist/src/commands/process/close/close.d.ts +19 -10
- package/dist/src/commands/process/close/close.d.ts.map +1 -1
- package/dist/src/commands/process/close/close.js +118 -15
- package/dist/src/commands/process/close/close.js.map +1 -1
- package/dist/src/commands/process/close/close.test.d.ts +2 -0
- package/dist/src/commands/process/close/close.test.d.ts.map +1 -0
- package/dist/src/commands/process/close/close.test.js +190 -0
- package/dist/src/commands/process/close/close.test.js.map +1 -0
- package/dist/src/commands/process/info/info.d.ts +45 -5
- package/dist/src/commands/process/info/info.d.ts.map +1 -1
- package/dist/src/commands/process/info/info.js +117 -13
- package/dist/src/commands/process/info/info.js.map +1 -1
- package/dist/src/commands/process/info/info.test.js +140 -38
- package/dist/src/commands/process/info/info.test.js.map +1 -1
- package/dist/src/commands/process/launch/launch.d.ts +11 -1
- package/dist/src/commands/process/launch/launch.d.ts.map +1 -1
- package/dist/src/commands/process/launch/launch.js +37 -7
- package/dist/src/commands/process/launch/launch.js.map +1 -1
- package/dist/src/commands/process/launch/launch.test.js +99 -20
- package/dist/src/commands/process/launch/launch.test.js.map +1 -1
- package/dist/src/commands/process/list/list.d.ts +2 -1
- package/dist/src/commands/process/list/list.d.ts.map +1 -1
- package/dist/src/commands/process/list/list.js +9 -6
- package/dist/src/commands/process/list/list.js.map +1 -1
- package/dist/src/commands/process/list/list.test.js +1 -0
- package/dist/src/commands/process/list/list.test.js.map +1 -1
- package/dist/src/commands/process/run/run.d.ts +9 -0
- package/dist/src/commands/process/run/run.d.ts.map +1 -1
- package/dist/src/commands/process/run/run.js +15 -5
- package/dist/src/commands/process/run/run.js.map +1 -1
- package/dist/src/commands/serve/serve.d.ts +2 -0
- package/dist/src/commands/serve/serve.d.ts.map +1 -1
- package/dist/src/commands/serve/serve.js +17 -4
- package/dist/src/commands/serve/serve.js.map +1 -1
- package/dist/src/commands/serve/serve.test.js +9 -2
- package/dist/src/commands/serve/serve.test.js.map +1 -1
- package/dist/src/commands/viewport/screenshot/screenshot.d.ts.map +1 -1
- package/dist/src/commands/viewport/screenshot/screenshot.js +4 -1
- package/dist/src/commands/viewport/screenshot/screenshot.js.map +1 -1
- package/dist/src/commands/viewport/screenshot/screenshot.test.js +5 -9
- package/dist/src/commands/viewport/screenshot/screenshot.test.js.map +1 -1
- package/dist/src/deploy/deploy-places.d.ts +39 -0
- package/dist/src/deploy/deploy-places.d.ts.map +1 -0
- package/dist/src/deploy/deploy-places.js +162 -0
- package/dist/src/deploy/deploy-places.js.map +1 -0
- package/dist/src/deploy/deploy-places.test.d.ts +2 -0
- package/dist/src/deploy/deploy-places.test.d.ts.map +1 -0
- package/dist/src/deploy/deploy-places.test.js +96 -0
- package/dist/src/deploy/deploy-places.test.js.map +1 -0
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/linux/linux-studio-launcher.d.ts.map +1 -1
- package/dist/src/linux/linux-studio-launcher.js +10 -0
- package/dist/src/linux/linux-studio-launcher.js.map +1 -1
- package/dist/src/linux/linux-studio-launcher.test.d.ts +2 -0
- package/dist/src/linux/linux-studio-launcher.test.d.ts.map +1 -0
- package/dist/src/linux/linux-studio-launcher.test.js +68 -0
- package/dist/src/linux/linux-studio-launcher.test.js.map +1 -0
- package/dist/src/plugin/persistent-plugin-installer.d.ts.map +1 -1
- package/dist/src/plugin/persistent-plugin-installer.js +2 -1
- package/dist/src/plugin/persistent-plugin-installer.js.map +1 -1
- package/dist/src/plugin/persistent-plugin-installer.test.js +3 -0
- package/dist/src/plugin/persistent-plugin-installer.test.js.map +1 -1
- package/dist/src/plugin/plugin-build-version.d.ts +7 -0
- package/dist/src/plugin/plugin-build-version.d.ts.map +1 -0
- package/dist/src/plugin/plugin-build-version.js +42 -0
- package/dist/src/plugin/plugin-build-version.js.map +1 -0
- package/dist/src/plugin/plugin-build-version.test.d.ts +2 -0
- package/dist/src/plugin/plugin-build-version.test.d.ts.map +1 -0
- package/dist/src/plugin/plugin-build-version.test.js +41 -0
- package/dist/src/plugin/plugin-build-version.test.js.map +1 -0
- package/dist/src/plugin/plugin-injector.d.ts.map +1 -1
- package/dist/src/plugin/plugin-injector.js +7 -1
- package/dist/src/plugin/plugin-injector.js.map +1 -1
- package/dist/src/process/studio-process-closer.d.ts +35 -0
- package/dist/src/process/studio-process-closer.d.ts.map +1 -0
- package/dist/src/process/studio-process-closer.js +129 -0
- package/dist/src/process/studio-process-closer.js.map +1 -0
- package/dist/src/process/studio-process-closer.test.d.ts +2 -0
- package/dist/src/process/studio-process-closer.test.d.ts.map +1 -0
- package/dist/src/process/studio-process-closer.test.js +80 -0
- package/dist/src/process/studio-process-closer.test.js.map +1 -0
- package/dist/src/process/studio-settings.d.ts +14 -0
- package/dist/src/process/studio-settings.d.ts.map +1 -0
- package/dist/src/process/studio-settings.js +50 -0
- package/dist/src/process/studio-settings.js.map +1 -0
- package/dist/src/process/studio-settings.test.d.ts +2 -0
- package/dist/src/process/studio-settings.test.d.ts.map +1 -0
- package/dist/src/process/studio-settings.test.js +16 -0
- package/dist/src/process/studio-settings.test.js.map +1 -0
- package/dist/src/process/studio-window-state.d.ts +13 -0
- package/dist/src/process/studio-window-state.d.ts.map +1 -0
- package/dist/src/process/studio-window-state.js +48 -0
- package/dist/src/process/studio-window-state.js.map +1 -0
- package/dist/src/server/studio-bridge-server.d.ts +3 -1
- package/dist/src/server/studio-bridge-server.d.ts.map +1 -1
- package/dist/src/server/studio-bridge-server.js +12 -4
- package/dist/src/server/studio-bridge-server.js.map +1 -1
- package/dist/src/server/web-socket-protocol.d.ts +173 -6
- package/dist/src/server/web-socket-protocol.d.ts.map +1 -1
- package/dist/src/server/web-socket-protocol.js +244 -1
- package/dist/src/server/web-socket-protocol.js.map +1 -1
- package/dist/src/server/web-socket-protocol.test.js +48 -0
- package/dist/src/server/web-socket-protocol.test.js.map +1 -1
- package/dist/src/test/e2e/persistent-session.test.js +121 -0
- package/dist/src/test/e2e/persistent-session.test.js.map +1 -1
- package/dist/src/test/e2e/split-server.test.d.ts +3 -5
- package/dist/src/test/e2e/split-server.test.d.ts.map +1 -1
- package/dist/src/test/e2e/split-server.test.js +3 -5
- package/dist/src/test/e2e/split-server.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docker/Dockerfile +3 -0
- package/package.json +8 -6
- package/src/bridge/bridge-connection.test.ts +126 -0
- package/src/bridge/bridge-connection.ts +217 -22
- package/src/bridge/bridge-session.test.ts +6 -4
- package/src/bridge/bridge-session.ts +273 -28
- package/src/bridge/index.ts +3 -0
- package/src/bridge/internal/bridge-client.test.ts +23 -0
- package/src/bridge/internal/bridge-client.ts +25 -7
- package/src/bridge/internal/bridge-host.test.ts +38 -0
- package/src/bridge/internal/bridge-host.ts +47 -0
- package/src/bridge/internal/hand-off.ts +4 -1
- package/src/bridge/internal/host-protocol.test.ts +15 -0
- package/src/bridge/internal/host-protocol.ts +148 -37
- package/src/bridge/internal/instance-state.ts +34 -0
- package/src/bridge/internal/transport-client.ts +2 -1
- package/src/bridge/internal/transport-server.ts +5 -1
- package/src/bridge/types.ts +47 -2
- package/src/cli/adapters/cli-command-adapter-handler.test.ts +28 -0
- package/src/cli/adapters/cli-command-adapter.ts +150 -18
- package/src/cli/adapters/group-builder.test.ts +34 -2
- package/src/cli/adapters/group-builder.ts +52 -20
- package/src/cli/adapters/help-formatter.test.ts +1 -1
- package/src/cli/adapters/help-formatter.ts +4 -3
- package/src/cli/adapters/playtest-edit-guard.test.ts +54 -0
- package/src/cli/args/global-args.ts +1 -1
- package/src/cli/cli-output-context.test.ts +55 -0
- package/src/cli/cli-output-context.ts +50 -0
- package/src/cli/cli.ts +49 -17
- package/src/cli/managed-studio-run.test.ts +71 -0
- package/src/cli/managed-studio-run.ts +135 -0
- package/src/cli/resolve-session.test.ts +1 -1
- package/src/cli/resolve-session.ts +1 -1
- package/src/cli/script-executor.ts +99 -51
- package/src/commands/console/exec/exec.test.ts +96 -3
- package/src/commands/console/exec/exec.ts +59 -6
- package/src/commands/console/exec/execute.lua +356 -240
- package/src/commands/console/exec/execute.spec.lua +286 -0
- package/src/commands/console/logs/logs.test.ts +76 -4
- package/src/commands/console/logs/logs.ts +132 -17
- package/src/commands/console/logs/query-logs.lua +85 -52
- package/src/commands/console/logs/query-logs.spec.lua +132 -0
- package/src/commands/explorer/export/export-instances.lua +108 -0
- package/src/commands/explorer/export/export-instances.spec.lua +87 -0
- package/src/commands/explorer/export/export.test.ts +27 -0
- package/src/commands/explorer/export/export.ts +60 -0
- package/src/commands/explorer/find/find-instances.lua +174 -0
- package/src/commands/explorer/find/find-instances.spec.lua +122 -0
- package/src/commands/explorer/find/find.test.ts +53 -0
- package/src/commands/explorer/find/find.ts +113 -0
- package/src/commands/explorer/grep/grep-scripts.lua +214 -0
- package/src/commands/explorer/grep/grep-scripts.spec.lua +130 -0
- package/src/commands/explorer/grep/grep.test.ts +45 -0
- package/src/commands/explorer/grep/grep.ts +93 -0
- package/src/commands/explorer/import/import-instances.lua +106 -0
- package/src/commands/explorer/import/import-instances.spec.lua +84 -0
- package/src/commands/explorer/import/import.test.ts +60 -0
- package/src/commands/explorer/import/import.ts +66 -0
- package/src/commands/explorer/query/query-data-model.lua +124 -152
- package/src/commands/explorer/query/query-data-model.spec.lua +150 -0
- package/src/commands/formatters.test.ts +7 -1
- package/src/commands/framework/action-loader.test.ts +28 -0
- package/src/commands/framework/action-loader.ts +10 -2
- package/src/commands/framework/arg-builder.ts +26 -3
- package/src/commands/framework/define-command.ts +32 -3
- package/src/commands/framework/index.ts +1 -0
- package/src/commands/index.ts +50 -0
- package/src/commands/linux/inject-credentials/inject-credentials.ts +1 -3
- package/src/commands/linux/setup/setup.ts +1 -3
- package/src/commands/linux/status/status.ts +105 -98
- package/src/commands/playtest/player/add/add.ts +85 -0
- package/src/commands/playtest/player/list/list.ts +57 -0
- package/src/commands/playtest/player/playtest-players.test.ts +146 -0
- package/src/commands/playtest/player/playtest-players.ts +270 -0
- package/src/commands/playtest/player/remove/remove.ts +78 -0
- package/src/commands/playtest/playtest-sessions.test.ts +143 -0
- package/src/commands/playtest/playtest-sessions.ts +417 -0
- package/src/commands/playtest/restart/restart.ts +199 -0
- package/src/commands/playtest/run/playtest-runner.luau +264 -0
- package/src/commands/playtest/run/playtest-runner.spec.lua +71 -0
- package/src/commands/playtest/run/run-playtest-script.lua +139 -0
- package/src/commands/playtest/run/run-playtest-script.spec.lua +43 -0
- package/src/commands/playtest/run/run.ts +239 -0
- package/src/commands/playtest/start/start-playtest.lua +108 -0
- package/src/commands/playtest/start/start.ts +138 -0
- package/src/commands/playtest/stop/end-playtest.lua +47 -0
- package/src/commands/playtest/stop/stop.ts +51 -0
- package/src/commands/process/close/close.test.ts +250 -0
- package/src/commands/process/close/close.ts +183 -17
- package/src/commands/process/info/info.test.ts +198 -44
- package/src/commands/process/info/info.ts +204 -15
- package/src/commands/process/info/query-state.lua +42 -29
- package/src/commands/process/info/query-state.spec.lua +39 -0
- package/src/commands/process/launch/launch.test.ts +138 -21
- package/src/commands/process/launch/launch.ts +69 -9
- package/src/commands/process/list/list.test.ts +1 -0
- package/src/commands/process/list/list.ts +14 -6
- package/src/commands/process/run/run.ts +26 -5
- package/src/commands/serve/serve.test.ts +17 -2
- package/src/commands/serve/serve.ts +25 -6
- package/src/commands/viewport/screenshot/capture-screenshot.lua +175 -182
- package/src/commands/viewport/screenshot/capture-screenshot.spec.lua +129 -0
- package/src/commands/viewport/screenshot/screenshot.test.ts +7 -10
- package/src/commands/viewport/screenshot/screenshot.ts +6 -1
- package/src/deploy/deploy-places.test.ts +127 -0
- package/src/deploy/deploy-places.ts +229 -0
- package/src/index.ts +11 -0
- package/src/linux/linux-studio-launcher.test.ts +89 -0
- package/src/linux/linux-studio-launcher.ts +11 -0
- package/src/plugin/persistent-plugin-installer.test.ts +4 -0
- package/src/plugin/persistent-plugin-installer.ts +2 -1
- package/src/plugin/plugin-build-version.test.ts +55 -0
- package/src/plugin/plugin-build-version.ts +53 -0
- package/src/plugin/plugin-injector.ts +7 -1
- package/src/process/studio-process-closer.test.ts +107 -0
- package/src/process/studio-process-closer.ts +187 -0
- package/src/process/studio-settings.test.ts +18 -0
- package/src/process/studio-settings.ts +61 -0
- package/src/process/studio-window-state.ts +65 -0
- package/src/server/studio-bridge-server.ts +15 -4
- package/src/server/web-socket-protocol.test.ts +55 -0
- package/src/server/web-socket-protocol.ts +468 -8
- package/src/test/e2e/persistent-session.test.ts +137 -0
- package/src/test/e2e/split-server.test.ts +3 -5
- package/templates/studio-bridge-plugin/default.project.json +3 -0
- package/templates/studio-bridge-plugin/src/Shared/ActionRouter.lua +208 -159
- package/templates/studio-bridge-plugin/src/Shared/ActionRouter.spec.lua +418 -0
- package/templates/studio-bridge-plugin/src/Shared/BuiltInActions.lua +94 -0
- package/templates/studio-bridge-plugin/src/Shared/BuiltInActions.spec.lua +166 -0
- package/templates/studio-bridge-plugin/src/Shared/DiscoveryStateMachine.lua +118 -137
- package/templates/studio-bridge-plugin/src/Shared/DiscoveryStateMachine.spec.lua +228 -0
- package/templates/studio-bridge-plugin/src/Shared/MessageBuffer.lua +80 -109
- package/templates/studio-bridge-plugin/src/Shared/MessageBuffer.spec.lua +116 -0
- package/templates/studio-bridge-plugin/src/Shared/StudioBridgeConnection.lua +233 -0
- package/templates/studio-bridge-plugin/src/Shared/StudioBridgeConnection.spec.lua +239 -0
- package/templates/studio-bridge-plugin/src/Shared/StudioBridgeLogUtils.lua +53 -0
- package/templates/studio-bridge-plugin/src/Shared/StudioBridgeLogUtils.spec.lua +27 -0
- package/templates/studio-bridge-plugin/src/Shared/StudioBridgeSessionUtils.lua +164 -0
- package/templates/studio-bridge-plugin/src/Shared/StudioBridgeSessionUtils.spec.lua +159 -0
- package/templates/studio-bridge-plugin/src/StudioBridgePlugin.server.lua +266 -368
- package/templates/studio-bridge-plugin/src/Vendor/png.lua +8 -2
- package/test/default.project.json +41 -0
- package/test/jest.config.lua +3 -0
- package/test/scripts/Server/ServerMain.server.lua +10 -0
- package/tsconfig.json +1 -0
- package/templates/studio-bridge-plugin/src/Shared/Protocol.lua +0 -132
- package/templates/studio-bridge-plugin-test/test/actions.test.lua +0 -580
- package/templates/studio-bridge-plugin-test/test/discovery.test.lua +0 -622
- package/templates/studio-bridge-plugin-test/test/execute-handler.test.lua +0 -517
- package/templates/studio-bridge-plugin-test/test/hash-lifecycle.test.lua +0 -814
- package/templates/studio-bridge-plugin-test/test/integration.test.lua +0 -1020
- package/templates/studio-bridge-plugin-test/test/new-actions.test.lua +0 -339
- package/templates/studio-bridge-plugin-test/test/plugin-entry.test.lua +0 -493
- package/templates/studio-bridge-plugin-test/test/protocol.test.lua +0 -506
- package/templates/studio-bridge-plugin-test/test/roblox-mocks.lua +0 -108
- package/templates/studio-bridge-plugin-test/test/test-runner.lua +0 -112
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-formatter.test.js","sourceRoot":"","sources":["../../../../src/cli/adapters/help-formatter.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,E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,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playtest-edit-guard.test.d.ts","sourceRoot":"","sources":["../../../../src/cli/adapters/playtest-edit-guard.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { assertNotEditingDuringPlaytest } from './cli-command-adapter.js';
|
|
3
|
+
function createSession(context, instanceId = 'test-place-3f9a') {
|
|
4
|
+
return {
|
|
5
|
+
context,
|
|
6
|
+
info: { instanceId, placeName: 'test-place.rbxl', context },
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function createConnection(contexts) {
|
|
10
|
+
return {
|
|
11
|
+
listSessions: () => contexts.map((context) => ({ instanceId: 'test-place-3f9a', context })),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
describe('assertNotEditingDuringPlaytest', () => {
|
|
15
|
+
it('refuses to change Edit while its playtest runs', () => {
|
|
16
|
+
expect(() => assertNotEditingDuringPlaytest(createConnection(['edit', 'server', 'client']), createSession('edit'))).toThrow(/playtest of 'test-place.rbxl' is running/);
|
|
17
|
+
});
|
|
18
|
+
it('allows changing Edit with no playtest running', () => {
|
|
19
|
+
expect(() => assertNotEditingDuringPlaytest(createConnection(['edit']), createSession('edit'))).not.toThrow();
|
|
20
|
+
});
|
|
21
|
+
it('allows changing the playtest itself', () => {
|
|
22
|
+
expect(() => assertNotEditingDuringPlaytest(createConnection(['edit', 'server']), createSession('server'))).not.toThrow();
|
|
23
|
+
});
|
|
24
|
+
it('ignores playtests of other Studios', () => {
|
|
25
|
+
expect(() => assertNotEditingDuringPlaytest(createConnection(['edit', 'server']), createSession('edit', 'other-place-1111'))).not.toThrow();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=playtest-edit-guard.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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CACV,8BAA8B,CAC5B,gBAAgB,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,EACpC,aAAa,CAAC,QAAQ,CAAC,CACxB,CACF,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,GAAG,EAAE,CACV,8BAA8B,CAC5B,gBAAgB,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,EACpC,aAAa,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAC1C,CACF,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-args.d.ts","sourceRoot":"","sources":["../../../../src/cli/args/global-args.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"global-args.d.ts","sourceRoot":"","sources":["../../../../src/cli/args/global-args.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process-wide output state: whether stdout carries JSON, and warnings about
|
|
3
|
+
* the CLI's own setup (outdated CLI, stale Studio plugin). Text output prints
|
|
4
|
+
* warnings to stderr as they come up. JSON output carries them in the
|
|
5
|
+
* result's `_warnings` field instead, so they are not lost.
|
|
6
|
+
*/
|
|
7
|
+
import type { SessionInfo } from '../bridge/index.js';
|
|
8
|
+
export declare function setJsonOutput(json: boolean): void;
|
|
9
|
+
export declare function isJsonOutputEnabled(): boolean;
|
|
10
|
+
export declare function addWarning(message: string): void;
|
|
11
|
+
export declare function getWarnings(): readonly string[];
|
|
12
|
+
export declare function clearWarnings(): void;
|
|
13
|
+
export declare function warnIfPluginStaleAsync(sessions: SessionInfo[]): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=cli-output-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-output-context.d.ts","sourceRoot":"","sources":["../../../src/cli/cli-output-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMtD,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAEjD;AAED,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAMhD;AAED,wBAAgB,WAAW,IAAI,SAAS,MAAM,EAAE,CAE/C;AAED,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,WAAW,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CASf"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process-wide output state: whether stdout carries JSON, and warnings about
|
|
3
|
+
* the CLI's own setup (outdated CLI, stale Studio plugin). Text output prints
|
|
4
|
+
* warnings to stderr as they come up. JSON output carries them in the
|
|
5
|
+
* result's `_warnings` field instead, so they are not lost.
|
|
6
|
+
*/
|
|
7
|
+
import { OutputHelper } from '@quenty/cli-output-helpers';
|
|
8
|
+
import { getPluginBuildVersionAsync } from '../plugin/plugin-build-version.js';
|
|
9
|
+
let isJsonOutput = false;
|
|
10
|
+
const warnings = [];
|
|
11
|
+
export function setJsonOutput(json) {
|
|
12
|
+
isJsonOutput = json;
|
|
13
|
+
}
|
|
14
|
+
export function isJsonOutputEnabled() {
|
|
15
|
+
return isJsonOutput;
|
|
16
|
+
}
|
|
17
|
+
export function addWarning(message) {
|
|
18
|
+
if (warnings.includes(message))
|
|
19
|
+
return;
|
|
20
|
+
warnings.push(message);
|
|
21
|
+
if (!isJsonOutput) {
|
|
22
|
+
OutputHelper.warn(message);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export function getWarnings() {
|
|
26
|
+
return warnings;
|
|
27
|
+
}
|
|
28
|
+
export function clearWarnings() {
|
|
29
|
+
warnings.length = 0;
|
|
30
|
+
}
|
|
31
|
+
export async function warnIfPluginStaleAsync(sessions) {
|
|
32
|
+
const expected = await getPluginBuildVersionAsync();
|
|
33
|
+
for (const session of sessions) {
|
|
34
|
+
if (session.pluginVersion !== expected) {
|
|
35
|
+
addWarning(`The studio-bridge plugin in '${session.placeName}' (${session.sessionId}) is out of date. Run 'studio-bridge plugin install' to update it.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=cli-output-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-output-context.js","sourceRoot":"","sources":["../../../src/cli/cli-output-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAE/E,IAAI,YAAY,GAAG,KAAK,CAAC;AACzB,MAAM,QAAQ,GAAa,EAAE,CAAC;AAE9B,MAAM,UAAU,aAAa,CAAC,IAAa;IACzC,YAAY,GAAG,IAAI,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,IAAI,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO;IACvC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvB,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,QAAuB;IAEvB,MAAM,QAAQ,GAAG,MAAM,0BAA0B,EAAE,CAAC;IACpD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,CAAC,aAAa,KAAK,QAAQ,EAAE,CAAC;YACvC,UAAU,CACR,gCAAgC,OAAO,CAAC,SAAS,MAAM,OAAO,CAAC,SAAS,oEAAoE,CAC7I,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-output-context.test.d.ts","sourceRoot":"","sources":["../../../src/cli/cli-output-context.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { describe, it, expect, afterEach, vi } from 'vitest';
|
|
2
|
+
vi.mock('../plugin/plugin-build-version.js', () => ({
|
|
3
|
+
getPluginBuildVersionAsync: async () => 'current',
|
|
4
|
+
}));
|
|
5
|
+
import { OutputHelper } from '@quenty/cli-output-helpers';
|
|
6
|
+
import { addWarning, clearWarnings, getWarnings, setJsonOutput, warnIfPluginStaleAsync, } from './cli-output-context.js';
|
|
7
|
+
describe('cli-output-context', () => {
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
clearWarnings();
|
|
10
|
+
setJsonOutput(false);
|
|
11
|
+
vi.restoreAllMocks();
|
|
12
|
+
});
|
|
13
|
+
it('prints warnings right away in text mode', () => {
|
|
14
|
+
const warn = vi.spyOn(OutputHelper, 'warn').mockImplementation(() => { });
|
|
15
|
+
addWarning('careful');
|
|
16
|
+
expect(warn).toHaveBeenCalledWith('careful');
|
|
17
|
+
expect(getWarnings()).toEqual(['careful']);
|
|
18
|
+
});
|
|
19
|
+
it('only collects warnings in JSON mode', () => {
|
|
20
|
+
const warn = vi.spyOn(OutputHelper, 'warn').mockImplementation(() => { });
|
|
21
|
+
setJsonOutput(true);
|
|
22
|
+
addWarning('careful');
|
|
23
|
+
addWarning('careful');
|
|
24
|
+
expect(warn).not.toHaveBeenCalled();
|
|
25
|
+
expect(getWarnings()).toEqual(['careful']);
|
|
26
|
+
});
|
|
27
|
+
it('warns about plugins built from a different template', async () => {
|
|
28
|
+
setJsonOutput(true);
|
|
29
|
+
await warnIfPluginStaleAsync([
|
|
30
|
+
{ sessionId: 'a-edit', placeName: 'A', pluginVersion: 'current' },
|
|
31
|
+
{ sessionId: 'b-edit', placeName: 'B', pluginVersion: 'old' },
|
|
32
|
+
]);
|
|
33
|
+
expect(getWarnings()).toEqual([
|
|
34
|
+
expect.stringContaining("'B' (b-edit) is out of date"),
|
|
35
|
+
]);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=cli-output-context.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-output-context.test.js","sourceRoot":"","sources":["../../../src/cli/cli-output-context.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE7D,EAAE,CAAC,IAAI,CAAC,mCAAmC,EAAE,GAAG,EAAE,CAAC,CAAC;IAClD,0BAA0B,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS;CAClD,CAAC,CAAC,CAAC;AAEJ,OAAO,EAA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QACnE,aAAa,CAAC,IAAI,CAAC,CAAC;QAEpB,MAAM,sBAAsB,CAAC;YAC3B,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE;YACjE,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE;SACvD,CAAC,CAAC;QAEV,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC;YAC5B,MAAM,CAAC,gBAAgB,CAAC,6BAA6B,CAAC;SACvD,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/src/cli/cli.js
CHANGED
|
@@ -16,18 +16,30 @@ import { fileURLToPath } from 'url';
|
|
|
16
16
|
import { dirname, join } from 'path';
|
|
17
17
|
import { OutputHelper } from '@quenty/cli-output-helpers';
|
|
18
18
|
import { VersionChecker } from '@quenty/nevermore-cli-helpers';
|
|
19
|
+
import { addWarning, setJsonOutput } from './cli-output-context.js';
|
|
19
20
|
import { CommandRegistry } from '../commands/framework/command-registry.js';
|
|
20
21
|
import { buildGroupCommands } from './adapters/group-builder.js';
|
|
21
22
|
// Command definitions (explicit imports for deterministic ordering)
|
|
22
23
|
import { execCommand } from '../commands/console/exec/exec.js';
|
|
23
24
|
import { logsCommand } from '../commands/console/logs/logs.js';
|
|
24
25
|
import { queryCommand } from '../commands/explorer/query/query.js';
|
|
26
|
+
import { exportCommand } from '../commands/explorer/export/export.js';
|
|
27
|
+
import { importCommand } from '../commands/explorer/import/import.js';
|
|
28
|
+
import { findCommand } from '../commands/explorer/find/find.js';
|
|
29
|
+
import { grepCommand } from '../commands/explorer/grep/grep.js';
|
|
25
30
|
import { screenshotCommand } from '../commands/viewport/screenshot/screenshot.js';
|
|
26
31
|
import { infoCommand } from '../commands/process/info/info.js';
|
|
27
32
|
import { listCommand } from '../commands/process/list/list.js';
|
|
28
33
|
import { launchCommand } from '../commands/process/launch/launch.js';
|
|
29
34
|
import { processRunCommand } from '../commands/process/run/run.js';
|
|
30
35
|
import { processCloseCommand } from '../commands/process/close/close.js';
|
|
36
|
+
import { playtestStartCommand } from '../commands/playtest/start/start.js';
|
|
37
|
+
import { playtestStopCommand } from '../commands/playtest/stop/stop.js';
|
|
38
|
+
import { playtestRunCommand } from '../commands/playtest/run/run.js';
|
|
39
|
+
import { playtestRestartCommand } from '../commands/playtest/restart/restart.js';
|
|
40
|
+
import { playtestPlayerListCommand } from '../commands/playtest/player/list/list.js';
|
|
41
|
+
import { playtestPlayerAddCommand } from '../commands/playtest/player/add/add.js';
|
|
42
|
+
import { playtestPlayerRemoveCommand } from '../commands/playtest/player/remove/remove.js';
|
|
31
43
|
import { installCommand } from '../commands/plugin/install/install.js';
|
|
32
44
|
import { uninstallCommand } from '../commands/plugin/uninstall/uninstall.js';
|
|
33
45
|
import { serveCommand } from '../commands/serve/serve.js';
|
|
@@ -39,13 +51,24 @@ const registry = new CommandRegistry();
|
|
|
39
51
|
registry.register(execCommand);
|
|
40
52
|
registry.register(logsCommand);
|
|
41
53
|
registry.register(queryCommand);
|
|
54
|
+
registry.register(exportCommand);
|
|
55
|
+
registry.register(importCommand);
|
|
56
|
+
registry.register(findCommand);
|
|
57
|
+
registry.register(grepCommand);
|
|
42
58
|
registry.register(screenshotCommand);
|
|
43
|
-
registry.register(
|
|
59
|
+
registry.register(launchCommand);
|
|
60
|
+
registry.register(playtestStartCommand);
|
|
61
|
+
registry.register(playtestStopCommand);
|
|
62
|
+
registry.register(playtestRunCommand);
|
|
63
|
+
registry.register(playtestRestartCommand);
|
|
64
|
+
registry.register(playtestPlayerListCommand);
|
|
65
|
+
registry.register(playtestPlayerAddCommand);
|
|
66
|
+
registry.register(playtestPlayerRemoveCommand);
|
|
44
67
|
// Infrastructure commands
|
|
45
|
-
registry.register(infoCommand);
|
|
46
68
|
registry.register(listCommand);
|
|
47
|
-
registry.register(
|
|
69
|
+
registry.register(infoCommand);
|
|
48
70
|
registry.register(processCloseCommand);
|
|
71
|
+
registry.register(processRunCommand);
|
|
49
72
|
registry.register(installCommand);
|
|
50
73
|
registry.register(uninstallCommand);
|
|
51
74
|
registry.register(serveCommand);
|
|
@@ -54,10 +77,11 @@ registry.register(linuxSetupCommand);
|
|
|
54
77
|
registry.register(linuxInjectCredentialsCommand);
|
|
55
78
|
registry.register(linuxStatusCommand);
|
|
56
79
|
const { groups, topLevel } = buildGroupCommands(registry);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
80
|
+
OutputHelper.setDiagnosticsToStderr(true);
|
|
81
|
+
const formatIndex = process.argv.indexOf('--format');
|
|
82
|
+
const isMachineReadable = process.argv.includes('--format=json') ||
|
|
83
|
+
(formatIndex !== -1 && process.argv[formatIndex + 1] === 'json');
|
|
84
|
+
setJsonOutput(isMachineReadable);
|
|
61
85
|
const versionData = await VersionChecker.checkForUpdatesAsync({
|
|
62
86
|
humanReadableName: 'Studio Bridge',
|
|
63
87
|
packageName: '@quenty/studio-bridge',
|
|
@@ -65,17 +89,12 @@ const versionData = await VersionChecker.checkForUpdatesAsync({
|
|
|
65
89
|
packageJsonPath: join(dirname(fileURLToPath(import.meta.url)), '../../../package.json'),
|
|
66
90
|
silent: isMachineReadable,
|
|
67
91
|
});
|
|
68
|
-
// Expose version metadata so the adapter can inject it into JSON output
|
|
69
92
|
if (isMachineReadable && versionData) {
|
|
70
|
-
const warnings = [];
|
|
71
93
|
if (versionData.isLocalDev) {
|
|
72
|
-
|
|
94
|
+
addWarning(`Studio Bridge is running in local development mode. Run 'npm install -g @quenty/studio-bridge@latest' to switch to production copy.`);
|
|
73
95
|
}
|
|
74
96
|
else if (versionData.updateAvailable) {
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
if (warnings.length > 0) {
|
|
78
|
-
globalThis.__studioBridgeWarnings = warnings;
|
|
97
|
+
addWarning(`Studio Bridge update available: ${VersionChecker.getVersionDisplayName(versionData)} → ${versionData.latestVersion}. Run 'npm install -g @quenty/studio-bridge@latest' to update.`);
|
|
79
98
|
}
|
|
80
99
|
}
|
|
81
100
|
const cli = yargs(hideBin(process.argv))
|
|
@@ -84,9 +103,8 @@ const cli = yargs(hideBin(process.argv))
|
|
|
84
103
|
? VersionChecker.getVersionDisplayName(versionData)
|
|
85
104
|
: undefined))
|
|
86
105
|
.option('timeout', {
|
|
87
|
-
description: '
|
|
106
|
+
description: 'How long to wait for a Studio session to connect, in milliseconds',
|
|
88
107
|
type: 'number',
|
|
89
|
-
default: 120_000,
|
|
90
108
|
global: true,
|
|
91
109
|
})
|
|
92
110
|
.option('verbose', {
|
|
@@ -110,7 +128,11 @@ const cli = yargs(hideBin(process.argv))
|
|
|
110
128
|
.middleware((argv) => {
|
|
111
129
|
OutputHelper.setVerbose(argv.verbose);
|
|
112
130
|
})
|
|
113
|
-
.usage(OutputHelper.formatInfo('Usage: $0 <command> [options]'))
|
|
131
|
+
.usage(OutputHelper.formatInfo('Usage: $0 <command> [options]'))
|
|
132
|
+
.example('$0 process launch', "Open the place of the nearest deploy.nevermore.json's default target in Studio")
|
|
133
|
+
.example('$0 process list', 'List the connected Studio sessions')
|
|
134
|
+
.example("$0 console exec 'return workspace:GetChildren()'", 'Run Luau in Studio and print what it returns')
|
|
135
|
+
.example('$0 playtest start', 'Start a playtest');
|
|
114
136
|
// Register grouped commands (console, explorer, viewport, process, plugin)
|
|
115
137
|
for (const group of groups) {
|
|
116
138
|
cli.command(group);
|
|
@@ -123,5 +145,6 @@ cli
|
|
|
123
145
|
.recommendCommands()
|
|
124
146
|
.demandCommand(1, OutputHelper.formatHint("Hint: See 'studio-bridge help' for more help"))
|
|
125
147
|
.wrap(null)
|
|
148
|
+
.parserConfiguration({ 'populate--': true })
|
|
126
149
|
.strict().argv;
|
|
127
150
|
//# sourceMappingURL=cli.js.map
|
package/dist/src/cli/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":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AU,CAAC,CAAC;AAC1B,CAAC;AAED,GAAG;KACA,iBAAiB,EAAE;KACnB,aAAa,CACZ,CAAC,EACD,YAAY,CAAC,UAAU,CAAC,8CAA8C,CAAC,CACxE;KACA,IAAI,CAAC,IAAI,CAAC;KACV,mBAAmB,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;KAC3C,MAAM,EAAE,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a script in a Studio launched for the run, through the regular bridge.
|
|
3
|
+
* The place copy carries a launch id that the persistent plugin reports when
|
|
4
|
+
* it registers, so the script runs in that Studio and no other. While the run
|
|
5
|
+
* lasts, the launched Studio is an ordinary session other commands can target.
|
|
6
|
+
*/
|
|
7
|
+
import { BridgeConnection } from '../bridge/index.js';
|
|
8
|
+
import type { BridgeSession, ExecResult } from '../bridge/index.js';
|
|
9
|
+
import type { StudioBridgePhase } from '../server/studio-bridge-server.js';
|
|
10
|
+
export interface ManagedStudioRunOptions {
|
|
11
|
+
scriptContent: string;
|
|
12
|
+
placePath?: string;
|
|
13
|
+
timeoutMs: number;
|
|
14
|
+
launchTimeoutMs?: number;
|
|
15
|
+
onPhase?: (phase: StudioBridgePhase) => void;
|
|
16
|
+
/** Passed to the script as `...`. */
|
|
17
|
+
args?: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare function runInManagedStudioAsync(options: ManagedStudioRunOptions): Promise<ExecResult>;
|
|
20
|
+
export declare function waitForLaunchedSessionAsync(connection: BridgeConnection, launchId: string, timeoutMs: number): Promise<BridgeSession>;
|
|
21
|
+
//# sourceMappingURL=managed-studio-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-studio-run.d.ts","sourceRoot":"","sources":["../../../src/cli/managed-studio-run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAgB3E,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7C,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,UAAU,CAAC,CAsDrB;AAED,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,gBAAgB,EAC5B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,CAAC,CA8BxB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs a script in a Studio launched for the run, through the regular bridge.
|
|
3
|
+
* The place copy carries a launch id that the persistent plugin reports when
|
|
4
|
+
* it registers, so the script runs in that Studio and no other. While the run
|
|
5
|
+
* lasts, the launched Studio is an ordinary session other commands can target.
|
|
6
|
+
*/
|
|
7
|
+
import { randomUUID } from 'crypto';
|
|
8
|
+
import * as path from 'path';
|
|
9
|
+
import { BuildContext, resolvePackagePath, resolveTemplatePath, } from '@quenty/nevermore-template-helpers';
|
|
10
|
+
import { BridgeConnection } from '../bridge/index.js';
|
|
11
|
+
import { launchStudioAsync } from '../process/studio-process-manager.js';
|
|
12
|
+
const DEFAULT_LAUNCH_TIMEOUT_MS = 120_000;
|
|
13
|
+
const defaultProjectPath = resolveTemplatePath(import.meta.url, path.join('default-test-place', 'default.project.json'));
|
|
14
|
+
const launchIdTransformScript = resolvePackagePath(import.meta.url, 'build-scripts', 'transform-add-session-attribute.lua');
|
|
15
|
+
export async function runInManagedStudioAsync(options) {
|
|
16
|
+
const launchId = randomUUID();
|
|
17
|
+
const buildContext = await BuildContext.createAsync({
|
|
18
|
+
prefix: 'studio-bridge-run-',
|
|
19
|
+
});
|
|
20
|
+
// Kept alive while Studio boots, which takes longer than the idle shutdown
|
|
21
|
+
const connection = await BridgeConnection.connectAsync({ keepAlive: true });
|
|
22
|
+
let killStudioAsync;
|
|
23
|
+
try {
|
|
24
|
+
let sourcePlacePath = options.placePath;
|
|
25
|
+
if (!sourcePlacePath) {
|
|
26
|
+
options.onPhase?.('building');
|
|
27
|
+
sourcePlacePath = buildContext.resolvePath('minimal.rbxl');
|
|
28
|
+
await buildContext.rojoBuildAsync({
|
|
29
|
+
projectPath: defaultProjectPath,
|
|
30
|
+
output: sourcePlacePath,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
// Keep the place's file name, which is what its session id is made from
|
|
34
|
+
const launchedPlacePath = buildContext.resolvePath(options.placePath ? path.basename(options.placePath) : 'place.rbxl');
|
|
35
|
+
await buildContext.executeLuneTransformScriptAsync(launchIdTransformScript, sourcePlacePath, launchedPlacePath, launchId);
|
|
36
|
+
options.onPhase?.('launching');
|
|
37
|
+
const sessionPromise = waitForLaunchedSessionAsync(connection, launchId, options.launchTimeoutMs ?? DEFAULT_LAUNCH_TIMEOUT_MS);
|
|
38
|
+
const studio = await launchStudioAsync(launchedPlacePath);
|
|
39
|
+
killStudioAsync = studio.killAsync;
|
|
40
|
+
options.onPhase?.('connecting');
|
|
41
|
+
const session = await sessionPromise;
|
|
42
|
+
options.onPhase?.('executing');
|
|
43
|
+
return await session.execAsync(options.scriptContent, options.timeoutMs, options.args);
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
await killStudioAsync?.();
|
|
47
|
+
await connection.disconnectAsync();
|
|
48
|
+
await buildContext.cleanupAsync();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export function waitForLaunchedSessionAsync(connection, launchId, timeoutMs) {
|
|
52
|
+
return new Promise((resolve, reject) => {
|
|
53
|
+
const findSession = () => {
|
|
54
|
+
const info = connection
|
|
55
|
+
.listSessions()
|
|
56
|
+
.find((s) => s.launchId === launchId && s.context === 'edit');
|
|
57
|
+
return info ? connection.getSession(info.sessionId) : undefined;
|
|
58
|
+
};
|
|
59
|
+
const onSession = () => {
|
|
60
|
+
const session = findSession();
|
|
61
|
+
if (session) {
|
|
62
|
+
clearTimeout(timer);
|
|
63
|
+
connection.off('session-connected', onSession);
|
|
64
|
+
resolve(session);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const timer = setTimeout(() => {
|
|
68
|
+
connection.off('session-connected', onSession);
|
|
69
|
+
reject(new Error(`The launched Studio did not connect within ${timeoutMs}ms. Is the studio-bridge plugin installed?`));
|
|
70
|
+
}, timeoutMs);
|
|
71
|
+
connection.on('session-connected', onSession);
|
|
72
|
+
onSession();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=managed-studio-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-studio-run.js","sourceRoot":"","sources":["../../../src/cli/managed-studio-run.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,MAAM,yBAAyB,GAAG,OAAO,CAAC;AAE1C,MAAM,kBAAkB,GAAG,mBAAmB,CAC5C,MAAM,CAAC,IAAI,CAAC,GAAG,EACf,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAA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AAmB,EAAE,SAAS,CAAC,CAAC;gBAC/C,OAAO,CAAC,OAAO,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;YAC/C,MAAM,CACJ,IAAI,KAAK,CACP,8CAA8C,SAAS,4CAA4C,CACpG,CACF,CAAC;QACJ,CAAC,EAAE,SAAS,CAAC,CAAC;QAEd,UAAU,CAAC,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;QAC9C,SAAS,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-studio-run.test.d.ts","sourceRoot":"","sources":["../../../src/cli/managed-studio-run.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import { waitForLaunchedSessionAsync } from './managed-studio-run.js';
|
|
4
|
+
function createConnection() {
|
|
5
|
+
const emitter = new EventEmitter();
|
|
6
|
+
const sessions = [];
|
|
7
|
+
const connection = Object.assign(emitter, {
|
|
8
|
+
listSessions: () => sessions,
|
|
9
|
+
getSession: (id) => sessions.some((s) => s.sessionId === id) ? { id } : undefined,
|
|
10
|
+
});
|
|
11
|
+
return {
|
|
12
|
+
connection: connection,
|
|
13
|
+
addSession(session) {
|
|
14
|
+
sessions.push(session);
|
|
15
|
+
emitter.emit('session-connected');
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
describe('waitForLaunchedSessionAsync', () => {
|
|
20
|
+
it('resolves with the edit session carrying the launch id', async () => {
|
|
21
|
+
const { connection, addSession } = createConnection();
|
|
22
|
+
const promise = waitForLaunchedSessionAsync(connection, 'launch-1', 1_000);
|
|
23
|
+
addSession({ sessionId: 'other-edit', context: 'edit' });
|
|
24
|
+
addSession({
|
|
25
|
+
sessionId: 'run-server',
|
|
26
|
+
launchId: 'launch-1',
|
|
27
|
+
context: 'server',
|
|
28
|
+
});
|
|
29
|
+
addSession({
|
|
30
|
+
sessionId: 'run-edit',
|
|
31
|
+
launchId: 'launch-1',
|
|
32
|
+
context: 'edit',
|
|
33
|
+
});
|
|
34
|
+
await expect(promise).resolves.toEqual({ id: 'run-edit' });
|
|
35
|
+
});
|
|
36
|
+
it('resolves right away when the session already connected', async () => {
|
|
37
|
+
const { connection, addSession } = createConnection();
|
|
38
|
+
addSession({
|
|
39
|
+
sessionId: 'run-edit',
|
|
40
|
+
launchId: 'launch-1',
|
|
41
|
+
context: 'edit',
|
|
42
|
+
});
|
|
43
|
+
await expect(waitForLaunchedSessionAsync(connection, 'launch-1', 1_000)).resolves.toEqual({ id: 'run-edit' });
|
|
44
|
+
});
|
|
45
|
+
it('rejects when the launched Studio never connects', async () => {
|
|
46
|
+
const { connection, addSession } = createConnection();
|
|
47
|
+
const promise = waitForLaunchedSessionAsync(connection, 'launch-1', 50);
|
|
48
|
+
addSession({ sessionId: 'other-edit', context: 'edit' });
|
|
49
|
+
await expect(promise).rejects.toThrow(/did not connect/);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=managed-studio-run.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"managed-studio-run.test.js","sourceRoot":"","sources":["../../../src/cli/managed-studio-run.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,SAAS,gBAAgB;IACvB,MAAM,OAAO,GAAG,IAAI,YAAY,EAAE,CAAC;IACnC,MAAM,Q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,CAAC,wDAAwD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,gBAAgB,EAAE,CAAC;QACtD,UAAU,CAAC;YACT,SAAS,EAAE,UAAU;YACrB,QAAQ,EAAE,UAAU;YACpB,OAAO,EAAE,MAAM;SAChB,CAAC,CAAC;QAEH,MAAM,MAAM,CACV,2BAA2B,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,CAC3D,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,KAAK,IAAI,EAAE;QAC/D,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,gBAAgB,EAAE,CAAC;QACtD,MAAM,OAAO,GAAG,2BAA2B,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;QAExE,UAAU,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QAEzD,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -35,6 +35,6 @@ export async function resolveSessionAsync(connection, options = {}) {
|
|
|
35
35
|
const listing = sessions
|
|
36
36
|
.map((s) => ` - ${s.sessionId} (instance=${s.instanceId}, context=${s.context})`)
|
|
37
37
|
.join('\n');
|
|
38
|
-
throw new Error(`Multiple sessions found. Use --
|
|
38
|
+
throw new Error(`Multiple sessions found. Use --target <id> to select one:\n${listing}`);
|
|
39
39
|
}
|
|
40
40
|
//# sourceMappingURL=resolve-session.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-session.js","sourceRoot":"","sources":["../../../src/cli/resolve-session.ts"],"names":[],"mappings":"AAAA;;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AAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,QAAQ;SACrB,GAAG,CACF,CAAC,CAAC,EAAE,EAAE,CACJ,OAAO,CAAC,CAAC,SAAS,cAAc,CAAC,CAAC,UAAU,aAAa,CAAC,CAAC,OAAO,GAAG,CACxE;SACA,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,MAAM,IAAI,KAAK,CACb,8DAA8D,OAAO,EAAE,CACxE,CAAC;AACJ,CAAC"}
|
|
@@ -52,7 +52,7 @@ describe('resolveSessionAsync', () => {
|
|
|
52
52
|
createSessionInfo({ sessionId: 'ses-2', instanceId: 'inst-b' }),
|
|
53
53
|
];
|
|
54
54
|
const conn = createMockConnection(sessions);
|
|
55
|
-
await expect(resolveSessionAsync(conn)).rejects.toThrow(/Multiple sessions found.*--
|
|
55
|
+
await expect(resolveSessionAsync(conn)).rejects.toThrow(/Multiple sessions found.*--target/s);
|
|
56
56
|
});
|
|
57
57
|
it('filters by instanceId', async () => {
|
|
58
58
|
const sessions = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-session.test.js","sourceRoot":"","sources":["../../../src/cli/resolve-session.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,SAAS,iBAAiB,CAAC,YAAkC,EAAE;IAC7D,OAAO;QACL,SAAS,EAAE,WAAW;QACtB,SAAS,EAAE,WAAW;QACtB,KAAK,EAAE,MAAM;QACb,aAAa,EAAE,OAAO;QACtB,YAAY,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC;QACvC,WAAW,EAAE,IAAI,IAAI,EAAE;QACvB,MAAM,EA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AAS,EAAE,IAAI;gBACf,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,MAAM;aAChB,CAAC;SACH,CAAC;QACF,MAAM,IAAI,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAE5C,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE;YAC7C,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,QAAQ;SAClB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,QAAQ,GAAG;YACf,iBAAiB,CAAC;gBAChB,SAAS,EAAE,OAAO;gBAClB,UAAU,EAAE,QAAQ;gBACpB,OAAO,EAAE,MAAM;aAChB,CAAC;SACH,CAAC;QACF,MAAM,IAAI,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QAE5C,MAAM,MAAM,CACV,mBAAmB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CACjD,CAAC,OAAO,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Shared script execution lifecycle — reporter + server setup used by
|
|
3
3
|
* both the `run` and `exec` commands.
|
|
4
4
|
*/
|
|
5
|
+
import type { SerializedReturnValue } from '../server/web-socket-protocol.js';
|
|
5
6
|
export interface ExecuteScriptOptions {
|
|
6
7
|
scriptContent: string;
|
|
7
8
|
packageName: string;
|
|
@@ -10,6 +11,17 @@ export interface ExecuteScriptOptions {
|
|
|
10
11
|
verbose: boolean;
|
|
11
12
|
showLogs: boolean;
|
|
12
13
|
filePath?: string;
|
|
14
|
+
/** Skip the progress reporter, for when stdout carries JSON. */
|
|
15
|
+
quiet?: boolean;
|
|
16
|
+
/** Passed to the script as `...`. */
|
|
17
|
+
args?: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface ExecuteScriptResult {
|
|
20
|
+
success: boolean;
|
|
21
|
+
output: string[];
|
|
22
|
+
error?: string;
|
|
23
|
+
returnValues?: SerializedReturnValue[];
|
|
24
|
+
durationMs: number;
|
|
13
25
|
}
|
|
14
26
|
/**
|
|
15
27
|
* Resolves and validates a place file path. Returns undefined if no place
|
|
@@ -20,5 +32,5 @@ export declare function resolvePlacePathAsync(place: string | undefined): Promis
|
|
|
20
32
|
* Runs a Luau script through the StudioBridgeServer with full reporter
|
|
21
33
|
* lifecycle (spinner or simple output).
|
|
22
34
|
*/
|
|
23
|
-
export declare function executeScriptAsync(options: ExecuteScriptOptions): Promise<
|
|
35
|
+
export declare function executeScriptAsync(options: ExecuteScriptOptions): Promise<ExecuteScriptResult>;
|
|
24
36
|
//# sourceMappingURL=script-executor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-executor.d.ts","sourceRoot":"","sources":["../../../src/cli/script-executor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"script-executor.d.ts","sourceRoot":"","sources":["../../../src/cli/script-executor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,kCAAkC,CAAC;AAI1C,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAW7B;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CA6I9B"}
|