@quenty/studio-bridge 0.21.1 → 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 +6 -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/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/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
|
@@ -7,6 +7,8 @@ import * as path from 'path';
|
|
|
7
7
|
import { OutputHelper } from '@quenty/cli-output-helpers';
|
|
8
8
|
import { CompositeReporter, SimpleReporter, SpinnerReporter, } from '@quenty/cli-output-helpers/reporting';
|
|
9
9
|
import { StudioBridgeServer, } from '../server/studio-bridge-server.js';
|
|
10
|
+
import { isPersistentPluginInstalled } from '../plugin/plugin-discovery.js';
|
|
11
|
+
import { runInManagedStudioAsync } from './managed-studio-run.js';
|
|
10
12
|
/**
|
|
11
13
|
* Resolves and validates a place file path. Returns undefined if no place
|
|
12
14
|
* was specified, or the resolved absolute path if it exists.
|
|
@@ -33,10 +35,10 @@ export async function executeScriptAsync(options) {
|
|
|
33
35
|
if (await shouldDelegateToDockerAsync()) {
|
|
34
36
|
OutputHelper.verbose('[StudioBridge] No Wine detected, delegating to Docker');
|
|
35
37
|
await delegateToDockerAsync(options);
|
|
36
|
-
|
|
38
|
+
throw new Error('delegateToDockerAsync returned without exiting');
|
|
37
39
|
}
|
|
38
|
-
const { scriptContent, packageName, placePath, timeoutMs, verbose, showLogs, } = options;
|
|
39
|
-
const useSpinner = !!process.stdout.isTTY && !verbose;
|
|
40
|
+
const { scriptContent, packageName, placePath, timeoutMs, verbose, showLogs, quiet = false, } = options;
|
|
41
|
+
const useSpinner = !quiet && !!process.stdout.isTTY && !verbose;
|
|
40
42
|
const reporter = new CompositeReporter([packageName], (state) => [
|
|
41
43
|
useSpinner
|
|
42
44
|
? new SpinnerReporter(state, {
|
|
@@ -44,57 +46,77 @@ export async function executeScriptAsync(options) {
|
|
|
44
46
|
actionVerb: 'Running',
|
|
45
47
|
})
|
|
46
48
|
: new SimpleReporter(state, {
|
|
47
|
-
alwaysShowLogs:
|
|
49
|
+
alwaysShowLogs: false,
|
|
48
50
|
successMessage: 'Script completed successfully.',
|
|
49
51
|
failureMessage: 'Script failed.',
|
|
50
52
|
}),
|
|
51
53
|
]);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
if (!quiet) {
|
|
55
|
+
await reporter.startAsync();
|
|
56
|
+
reporter.onPackageStart(packageName);
|
|
57
|
+
}
|
|
54
58
|
const startTime = performance.now();
|
|
55
59
|
// Suppress verbose output during spinner rendering
|
|
56
60
|
if (useSpinner) {
|
|
57
61
|
OutputHelper.setVerbose(false);
|
|
58
62
|
}
|
|
59
63
|
const outputLines = [];
|
|
64
|
+
const onOutput = (level, body) => {
|
|
65
|
+
// Filter internal plugin messages that leak through LogService
|
|
66
|
+
if (body.startsWith('[StudioBridge]')) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
// Collect output for the result logs
|
|
70
|
+
outputLines.push(body);
|
|
71
|
+
// In verbose/simple mode, print output in real-time
|
|
72
|
+
if (!useSpinner && !quiet) {
|
|
73
|
+
switch (level) {
|
|
74
|
+
case 'Warning':
|
|
75
|
+
OutputHelper.warn(body);
|
|
76
|
+
break;
|
|
77
|
+
case 'Error':
|
|
78
|
+
OutputHelper.error(body);
|
|
79
|
+
break;
|
|
80
|
+
default:
|
|
81
|
+
console.log(body);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const onPhase = (phase) => {
|
|
87
|
+
if (phase === 'done' || quiet)
|
|
88
|
+
return;
|
|
89
|
+
reporter.onPackagePhaseChange(packageName, phase);
|
|
90
|
+
};
|
|
60
91
|
let server;
|
|
61
92
|
let result;
|
|
62
93
|
try {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
OutputHelper.error(body);
|
|
90
|
-
break;
|
|
91
|
-
default:
|
|
92
|
-
console.log(body);
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
});
|
|
94
|
+
if (isPersistentPluginInstalled()) {
|
|
95
|
+
const execResult = await runInManagedStudioAsync({
|
|
96
|
+
scriptContent,
|
|
97
|
+
placePath,
|
|
98
|
+
timeoutMs,
|
|
99
|
+
onPhase,
|
|
100
|
+
args: options.args,
|
|
101
|
+
});
|
|
102
|
+
for (const entry of execResult.output) {
|
|
103
|
+
onOutput(entry.level, entry.body);
|
|
104
|
+
}
|
|
105
|
+
result = {
|
|
106
|
+
success: execResult.success,
|
|
107
|
+
logs: execResult.error ?? '',
|
|
108
|
+
returnValues: execResult.returnValues,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
server = new StudioBridgeServer({ placePath, timeoutMs, onPhase });
|
|
113
|
+
await server.startAsync();
|
|
114
|
+
result = await server.executeAsync({
|
|
115
|
+
scriptContent,
|
|
116
|
+
onOutput,
|
|
117
|
+
args: options.args,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
98
120
|
}
|
|
99
121
|
catch (error) {
|
|
100
122
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -107,13 +129,21 @@ export async function executeScriptAsync(options) {
|
|
|
107
129
|
await server?.stopAsync();
|
|
108
130
|
}
|
|
109
131
|
const elapsed = performance.now() - startTime;
|
|
110
|
-
|
|
111
|
-
|
|
132
|
+
if (!quiet) {
|
|
133
|
+
reporter.onPackageResult({
|
|
134
|
+
packageName,
|
|
135
|
+
success: result.success,
|
|
136
|
+
logs: outputLines.length > 0 ? outputLines.join('\n') : result.logs,
|
|
137
|
+
durationMs: elapsed,
|
|
138
|
+
});
|
|
139
|
+
await reporter.stopAsync();
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
112
142
|
success: result.success,
|
|
113
|
-
|
|
143
|
+
output: outputLines,
|
|
144
|
+
error: result.success || !result.logs ? undefined : result.logs,
|
|
145
|
+
returnValues: result.returnValues,
|
|
114
146
|
durationMs: elapsed,
|
|
115
|
-
}
|
|
116
|
-
await reporter.stopAsync();
|
|
117
|
-
process.exit(result.success ? 0 : 1);
|
|
147
|
+
};
|
|
118
148
|
}
|
|
119
149
|
//# sourceMappingURL=script-executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"script-executor.js","sourceRoot":"","sources":["../../../src/cli/script-executor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EACL,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AAU,EAAE,OAAO;KACpB,CAAC;AACJ,CAAC"}
|
|
@@ -5,14 +5,19 @@
|
|
|
5
5
|
* This unifies the old `exec` and `run` commands.
|
|
6
6
|
*/
|
|
7
7
|
import type { BridgeSession } from '../../../bridge/index.js';
|
|
8
|
+
import type { SerializedReturnValue } from '../../../server/web-socket-protocol.js';
|
|
8
9
|
export interface ExecOptions {
|
|
9
10
|
scriptContent: string;
|
|
10
11
|
timeout?: number;
|
|
12
|
+
/** Passed to the script as `...`. */
|
|
13
|
+
args?: string[];
|
|
11
14
|
}
|
|
12
15
|
export interface ExecResult {
|
|
13
16
|
success: boolean;
|
|
14
17
|
output: string[];
|
|
15
18
|
error?: string;
|
|
19
|
+
traceback?: string;
|
|
20
|
+
returnValues?: SerializedReturnValue[];
|
|
16
21
|
summary: string;
|
|
17
22
|
}
|
|
18
23
|
export interface RunOptions {
|
|
@@ -23,12 +28,15 @@ export interface RunResult {
|
|
|
23
28
|
success: boolean;
|
|
24
29
|
output: string[];
|
|
25
30
|
error?: string;
|
|
31
|
+
traceback?: string;
|
|
32
|
+
returnValues?: SerializedReturnValue[];
|
|
26
33
|
summary: string;
|
|
27
34
|
}
|
|
28
35
|
interface ConsoleExecArgs {
|
|
29
36
|
code?: string;
|
|
30
37
|
file?: string;
|
|
31
38
|
timeout?: number;
|
|
39
|
+
scriptArgs?: string[];
|
|
32
40
|
}
|
|
33
41
|
/**
|
|
34
42
|
* Execute inline Luau code in a connected Studio session.
|
|
@@ -38,6 +46,15 @@ export declare function execHandlerAsync(session: BridgeSession, options: ExecOp
|
|
|
38
46
|
* Read a Luau script file and execute it in a connected Studio session.
|
|
39
47
|
*/
|
|
40
48
|
export declare function runHandlerAsync(session: BridgeSession, options: RunOptions): Promise<RunResult>;
|
|
49
|
+
export declare function formatReturnValues(returnValues: SerializedReturnValue[]): string;
|
|
50
|
+
/** Render an exec result as its output, then its return values, then its error. */
|
|
51
|
+
export declare function formatExecText(result: {
|
|
52
|
+
output: string[];
|
|
53
|
+
returnValues?: SerializedReturnValue[];
|
|
54
|
+
error?: string;
|
|
55
|
+
traceback?: string;
|
|
56
|
+
summary: string;
|
|
57
|
+
}): string;
|
|
41
58
|
export declare const execCommand: import("../../framework/define-command.js").CommandDefinition<ConsoleExecArgs, ExecResult>;
|
|
42
59
|
export {};
|
|
43
60
|
//# sourceMappingURL=exec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../../../src/commands/console/exec/exec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../../../src/commands/console/exec/exec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAEpF,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAqBrB;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,SAAS,CAAC,CAkBpB;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,qBAAqB,EAAE,GACpC,MAAM,CAeR;AAED,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,MAAM,EAAE;IACrC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,CAST;AAED,eAAO,MAAM,WAAW,4FAsCtB,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* This unifies the old `exec` and `run` commands.
|
|
6
6
|
*/
|
|
7
7
|
import * as fs from 'fs/promises';
|
|
8
|
+
import { OutputHelper } from '@quenty/cli-output-helpers';
|
|
8
9
|
import { defineCommand } from '../../framework/define-command.js';
|
|
9
10
|
import { arg } from '../../framework/arg-builder.js';
|
|
10
11
|
import { resolveScriptContentAsync } from '../../../cli/resolve-script-content.js';
|
|
@@ -12,12 +13,14 @@ import { resolveScriptContentAsync } from '../../../cli/resolve-script-content.j
|
|
|
12
13
|
* Execute inline Luau code in a connected Studio session.
|
|
13
14
|
*/
|
|
14
15
|
export async function execHandlerAsync(session, options) {
|
|
15
|
-
const result = await session.execAsync(options.scriptContent, options.timeout);
|
|
16
|
+
const result = await session.execAsync(options.scriptContent, options.timeout, options.args);
|
|
16
17
|
const output = (result.output ?? []).map((entry) => typeof entry === 'string' ? entry : entry.body);
|
|
17
18
|
return {
|
|
18
19
|
success: result.success,
|
|
19
20
|
output,
|
|
20
21
|
error: result.error,
|
|
22
|
+
traceback: result.traceback,
|
|
23
|
+
returnValues: result.returnValues,
|
|
21
24
|
summary: result.success
|
|
22
25
|
? 'Script executed successfully'
|
|
23
26
|
: `Script failed: ${result.error}`,
|
|
@@ -34,17 +37,47 @@ export async function runHandlerAsync(session, options) {
|
|
|
34
37
|
success: result.success,
|
|
35
38
|
output,
|
|
36
39
|
error: result.error,
|
|
40
|
+
traceback: result.traceback,
|
|
41
|
+
returnValues: result.returnValues,
|
|
37
42
|
summary: result.success
|
|
38
43
|
? `Script ${options.scriptPath} executed successfully`
|
|
39
44
|
: `Script ${options.scriptPath} failed: ${result.error}`,
|
|
40
45
|
};
|
|
41
46
|
}
|
|
47
|
+
export function formatReturnValues(returnValues) {
|
|
48
|
+
return returnValues
|
|
49
|
+
.map((value) => {
|
|
50
|
+
if (typeof value === 'string')
|
|
51
|
+
return value;
|
|
52
|
+
if (typeof value === 'object' &&
|
|
53
|
+
value !== null &&
|
|
54
|
+
!Array.isArray(value) &&
|
|
55
|
+
value.type === 'Nil') {
|
|
56
|
+
return 'nil';
|
|
57
|
+
}
|
|
58
|
+
return JSON.stringify(value);
|
|
59
|
+
})
|
|
60
|
+
.join('\t');
|
|
61
|
+
}
|
|
62
|
+
/** Render an exec result as its output, then its return values, then its error. */
|
|
63
|
+
export function formatExecText(result) {
|
|
64
|
+
const lines = [...result.output];
|
|
65
|
+
if (result.returnValues && result.returnValues.length > 0) {
|
|
66
|
+
lines.push(formatReturnValues(result.returnValues));
|
|
67
|
+
}
|
|
68
|
+
if (result.error)
|
|
69
|
+
lines.push(result.error);
|
|
70
|
+
if (result.traceback)
|
|
71
|
+
lines.push(OutputHelper.formatDim(result.traceback.trimEnd()));
|
|
72
|
+
return lines.length > 0 ? lines.join('\n') : result.summary;
|
|
73
|
+
}
|
|
42
74
|
export const execCommand = defineCommand({
|
|
43
75
|
group: 'console',
|
|
44
76
|
name: 'exec',
|
|
45
77
|
description: 'Execute Luau code in a connected Studio session',
|
|
46
78
|
category: 'execution',
|
|
47
79
|
safety: 'mutate',
|
|
80
|
+
changesDataModel: true,
|
|
48
81
|
scope: 'session',
|
|
49
82
|
args: {
|
|
50
83
|
code: arg.positional({
|
|
@@ -59,20 +92,19 @@ export const execCommand = defineCommand({
|
|
|
59
92
|
description: 'Execution timeout in milliseconds',
|
|
60
93
|
type: 'number',
|
|
61
94
|
}),
|
|
95
|
+
scriptArgs: arg.passthrough({
|
|
96
|
+
description: 'Arguments after --, passed to the script as ... (all strings)',
|
|
97
|
+
}),
|
|
62
98
|
},
|
|
63
99
|
cli: {
|
|
64
|
-
format:
|
|
65
|
-
const lines = result.output.join('\n');
|
|
66
|
-
if (result.error)
|
|
67
|
-
return lines + (lines ? '\n' : '') + result.error;
|
|
68
|
-
return lines || result.summary;
|
|
69
|
-
},
|
|
100
|
+
format: formatExecText,
|
|
70
101
|
},
|
|
71
102
|
handler: async (session, args) => {
|
|
72
103
|
const { scriptContent } = await resolveScriptContentAsync(args);
|
|
73
104
|
return execHandlerAsync(session, {
|
|
74
105
|
scriptContent,
|
|
75
106
|
timeout: args.timeout,
|
|
107
|
+
args: args.scriptArgs,
|
|
76
108
|
});
|
|
77
109
|
},
|
|
78
110
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../../../../src/commands/console/exec/exec.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC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IAAI,EAAE,QAAQ;SACf,CAAC;QACF,UAAU,EAAE,GAAG,CAAC,WAAW,CAAC;YAC1B,WAAW,EACT,+DAA+D;SAClE,CAAC;KACH;IACD,GAAG,EAAE;QACH,MAAM,EAAE,cAAc;KACvB;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAC/B,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,yBAAyB,CAAC,IAAI,CAAC,CAAC;QAEhE,OAAO,gBAAgB,CAAC,OAAO,EAAE;YAC/B,aAAa;YACb,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,UAAU;SACtB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Unit tests for the unified exec command handler.
|
|
3
3
|
*/
|
|
4
4
|
import { describe, it, expect, vi } from 'vitest';
|
|
5
|
-
import { execHandlerAsync, runHandlerAsync } from './exec.js';
|
|
5
|
+
import { execCommand, execHandlerAsync, runHandlerAsync, } from './exec.js';
|
|
6
6
|
// Mock fs/promises.readFile for runHandlerAsync
|
|
7
7
|
vi.mock('fs/promises', () => ({
|
|
8
8
|
readFile: vi.fn(),
|
|
@@ -50,7 +50,21 @@ describe('execHandlerAsync', () => {
|
|
|
50
50
|
scriptContent: 'print("test")',
|
|
51
51
|
timeout: 5000,
|
|
52
52
|
});
|
|
53
|
-
expect(session.execAsync).toHaveBeenCalledWith('print("test")', 5000);
|
|
53
|
+
expect(session.execAsync).toHaveBeenCalledWith('print("test")', 5000, undefined);
|
|
54
|
+
});
|
|
55
|
+
it('forwards script args to session.execAsync', async () => {
|
|
56
|
+
const session = createMockSession({
|
|
57
|
+
success: true,
|
|
58
|
+
output: [],
|
|
59
|
+
});
|
|
60
|
+
await execHandlerAsync(session, {
|
|
61
|
+
scriptContent: 'return ...',
|
|
62
|
+
args: ['Player1', '3'],
|
|
63
|
+
});
|
|
64
|
+
expect(session.execAsync).toHaveBeenCalledWith('return ...', undefined, [
|
|
65
|
+
'Player1',
|
|
66
|
+
'3',
|
|
67
|
+
]);
|
|
54
68
|
});
|
|
55
69
|
it('passes undefined timeout when not specified', async () => {
|
|
56
70
|
const session = createMockSession({
|
|
@@ -60,7 +74,7 @@ describe('execHandlerAsync', () => {
|
|
|
60
74
|
await execHandlerAsync(session, {
|
|
61
75
|
scriptContent: 'print("test")',
|
|
62
76
|
});
|
|
63
|
-
expect(session.execAsync).toHaveBeenCalledWith('print("test")', undefined);
|
|
77
|
+
expect(session.execAsync).toHaveBeenCalledWith('print("test")', undefined, undefined);
|
|
64
78
|
});
|
|
65
79
|
it('captures multiple output lines', async () => {
|
|
66
80
|
const session = createMockSession({
|
|
@@ -104,6 +118,51 @@ describe('execHandlerAsync', () => {
|
|
|
104
118
|
};
|
|
105
119
|
await expect(execHandlerAsync(session, { scriptContent: 'print("test")' })).rejects.toThrow('Connection lost');
|
|
106
120
|
});
|
|
121
|
+
it('carries the return values through', async () => {
|
|
122
|
+
const session = {
|
|
123
|
+
execAsync: vi.fn().mockResolvedValue({
|
|
124
|
+
success: true,
|
|
125
|
+
output: [],
|
|
126
|
+
returnValues: [12345, { type: 'Nil' }],
|
|
127
|
+
}),
|
|
128
|
+
};
|
|
129
|
+
const result = await execHandlerAsync(session, {
|
|
130
|
+
scriptContent: 'return game.PlaceId, nil',
|
|
131
|
+
});
|
|
132
|
+
expect(result.returnValues).toEqual([12345, { type: 'Nil' }]);
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
describe('execCommand text format', () => {
|
|
136
|
+
const format = execCommand.cli.format;
|
|
137
|
+
function formatResult(result) {
|
|
138
|
+
return format({
|
|
139
|
+
success: true,
|
|
140
|
+
output: [],
|
|
141
|
+
summary: 'Script executed successfully',
|
|
142
|
+
...result,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
it('prints a returned string raw so returned JSON stays parseable', () => {
|
|
146
|
+
expect(formatResult({ returnValues: ['{"ok":true}'] })).toBe('{"ok":true}');
|
|
147
|
+
});
|
|
148
|
+
it('prints output lines before the return values', () => {
|
|
149
|
+
expect(formatResult({ output: ['hello'], returnValues: [42, true] })).toBe('hello\n42\ttrue');
|
|
150
|
+
});
|
|
151
|
+
it('spells a returned nil and JSON-encodes tables and datatypes', () => {
|
|
152
|
+
expect(formatResult({
|
|
153
|
+
returnValues: [
|
|
154
|
+
{ type: 'Nil' },
|
|
155
|
+
[1, 2],
|
|
156
|
+
{ type: 'Vector3', value: [1, 2, 3] },
|
|
157
|
+
],
|
|
158
|
+
})).toBe('nil\t[1,2]\t{"type":"Vector3","value":[1,2,3]}');
|
|
159
|
+
});
|
|
160
|
+
it('falls back to the summary when nothing was printed or returned', () => {
|
|
161
|
+
expect(formatResult({ returnValues: [] })).toBe('Script executed successfully');
|
|
162
|
+
});
|
|
163
|
+
it('appends the error after any output', () => {
|
|
164
|
+
expect(formatResult({ success: false, output: ['before'], error: 'boom' })).toBe('before\nboom');
|
|
165
|
+
});
|
|
107
166
|
});
|
|
108
167
|
describe('runHandlerAsync', () => {
|
|
109
168
|
it('reads file and delegates to session.execAsync', async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.test.js","sourceRoot":"","sources":["../../../../../src/commands/console/exec/exec.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,
|
|
1
|
+
{"version":3,"file":"exec.test.js","sourceRoot":"","sources":["../../../../../src/commands/console/exec/exec.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,eAAe,GAEhB,MAAM,WAAW,CAAC;AAEnB,gDAAgD;AAChD,E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IAAI;YACb,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,OAAO,EAAE;YAC5C,UAAU,EAAE,iBAAiB;SAC9B,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAC9C,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;QAE1D,MAAM,OAAO,GAAG;YACd,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;SAC5D,CAAC;QAET,MAAM,MAAM,CACV,eAAe,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,CAC1D,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
* `console logs` — retrieve buffered log history from a connected
|
|
3
3
|
* Studio session's ring buffer.
|
|
4
4
|
*/
|
|
5
|
-
import type { BridgeSession } from '../../../bridge/index.js';
|
|
5
|
+
import type { BridgeConnection, BridgeSession } from '../../../bridge/index.js';
|
|
6
6
|
import type { LogEntry } from '../../../bridge/index.js';
|
|
7
7
|
import type { OutputLevel } from '../../../server/web-socket-protocol.js';
|
|
8
8
|
export interface LogsResult {
|
|
9
|
+
/** With repeats grouped, a run of identical entries is one with `repeats` and `lastTimestamp`. */
|
|
9
10
|
entries: LogEntry[];
|
|
10
11
|
total: number;
|
|
11
12
|
bufferCapacity: number;
|
|
13
|
+
/** The cutoff `--since` or `--since-restart` applied, in epoch seconds. */
|
|
14
|
+
since?: number;
|
|
12
15
|
summary: string;
|
|
13
16
|
}
|
|
14
17
|
export interface LogsOptions {
|
|
@@ -16,8 +19,33 @@ export interface LogsOptions {
|
|
|
16
19
|
direction?: 'head' | 'tail';
|
|
17
20
|
levels?: OutputLevel[];
|
|
18
21
|
includeInternal?: boolean;
|
|
22
|
+
/** Only entries logged at or after this time, in epoch seconds. */
|
|
23
|
+
since?: number;
|
|
24
|
+
/** Collapse identical consecutive entries. Defaults to true. */
|
|
25
|
+
groupRepeats?: boolean;
|
|
19
26
|
}
|
|
27
|
+
interface ConsoleLogsArgs {
|
|
28
|
+
count?: number;
|
|
29
|
+
direction?: 'head' | 'tail';
|
|
30
|
+
levels?: OutputLevel[];
|
|
31
|
+
includeInternal?: boolean;
|
|
32
|
+
since?: string;
|
|
33
|
+
sinceRestart?: boolean;
|
|
34
|
+
groupRepeats?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The time `--since` names, in epoch seconds: a duration back from `nowMs`
|
|
38
|
+
* (`30s`, `5m`, `2h`, `1d`) or a date (`2026-10-27T18:00:00`).
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseSince(value: string, nowMs?: number): number;
|
|
41
|
+
/**
|
|
42
|
+
* The `--since-restart` cutoff for `session`, in epoch seconds: none for a
|
|
43
|
+
* playtest's own session, whose log began with the playtest, and otherwise a
|
|
44
|
+
* little before the running playtest's server started.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getSinceRestartCutoffAsync(connection: BridgeConnection, session: BridgeSession): Promise<number | undefined>;
|
|
20
47
|
export declare function queryLogsHandlerAsync(session: BridgeSession, options?: LogsOptions): Promise<LogsResult>;
|
|
21
48
|
export declare function formatLogsText(result: LogsResult): string;
|
|
22
|
-
export declare const logsCommand: import("../../framework/define-command.js").CommandDefinition<
|
|
49
|
+
export declare const logsCommand: import("../../framework/define-command.js").CommandDefinition<ConsoleLogsArgs, LogsResult>;
|
|
50
|
+
export {};
|
|
23
51
|
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../../../src/commands/console/logs/logs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../../../src/commands/console/logs/logs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,KAAK,EACV,QAAQ,EAET,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E,MAAM,WAAW,UAAU;IACzB,kGAAkG;IAClG,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,UAAU,eAAe;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO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