Inspector CLI#18229
Conversation
…d Inspectable container that Inspector builds on top of
Exclude CLI source files from lib
|
Reviewer - this PR has made changes to one or more package.json files. |
|
You have changed file(s) that made possible changes to the sandbox. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18229/merge/ |
|
You have made possible changes to the playground. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18229/merge/ The snapshot playground with the CDN snapshot (only when available): Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly. |
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
|
Reviewer - this PR has made changes to one or more package.json files. |
|
You have made possible changes to the playground. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18229/merge/ The snapshot playground with the CDN snapshot (only when available): Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly. |
|
You have changed file(s) that made possible changes to the sandbox. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18229/merge/ |
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
sebavan
left a comment
There was a problem hiding this comment.
Just a tiny question but LGTM. Is the plan to provide a skill though another package or should it be available there ?
|
Reviewer - this PR has made changes to one or more package.json files. |
|
You have changed file(s) that made possible changes to the sandbox. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/SANDBOX/refs/pull/18229/merge/ |
|
You have made possible changes to the playground. https://snapshots-cvgtc2eugrd3cgfd.z01.azurefd.net/PLAYGROUND/refs/pull/18229/merge/ The snapshot playground with the CDN snapshot (only when available): Note that neither Babylon scenes nor textures are uploaded to the snapshot directory, so some playgrounds won't work correctly. |
|
Visualization tests for WebGPU |
|
WebGL2 visualization test reporter: |
The original squash branch carried 6 files for an older Inspector v2 CLI WIP that was independently superseded in master by PRs BabylonJS#18229, BabylonJS#18271, BabylonJS#18332, and BabylonJS#18337. Master never had these files; their import-path fixes in d204462 only existed to keep them building and were unrelated to the KHR_interactivity work. Removed: - packages/dev/inspector-v2/src/cli/protocol.ts - packages/dev/inspector-v2/src/services/cli/cliConnectionStatus.ts - packages/dev/inspector-v2/src/services/cli/inspectableBridgeService.ts - packages/dev/inspector-v2/src/services/cli/inspectableCommandRegistry.ts - packages/dev/inspector-v2/test/unit/modularity/serviceContainer.test.ts - packages/dev/inspector-v2/test/unit/services/inspectableBridgeService.test.ts These files have no consumers in master code (the live cliConnectionStatusService.tsx imports from shared-ui-components/modularTool/services/cli/bridgeConnectionStatus instead). Also fixes a strict-mode TS error in babylonScenePathToObjectConverter (narrowing IBabylonSceneObjectModelTree to a Record<string, ...> needs a double cast through unknown). Overview.glb regression: still 168 passing / 17 failing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This change introduces the Inspector CLI. High level, the CLI includes a long lived node process for the "bridge", a short lived node process for the CLI (which communicates with the bridge), and a new
StartInspectableAPI that runs in the browser/app side and connects to the bridge.StartInspectableuses parts of the Inspector framework, like the ServiceContainer for modularity/extensibility. Services can introduce additional commands, which are dynamically fetched from the CLI. The "inspectable" ServiceContainer is longer lived than the one in Inspector, and the one in Inspector is aware of the "inspectable" one, which means Inspector can launch the "inspectable" if needed, can expose bridge connection status, and even contribute more CLI commands.ServiceContainerto have a "parent"ServiceContainer(longer lived).StartInspectablethat sets up aServiceContainerwith a set of services that are browser independent and provide a set of CLI commands (query scene entities, query entity details, take a screenshot, get stats, get shader code, etc.).ShowInspectornow callsStartInspectable, which is ref counted so if it has already been called, it just returns the existing instance. The inspectableServiceContaineris used as a "parent" container for the InspectorServiceContainer.When developing the Inspector CLI, you can run
npm run babylon-inspector -- --help(or other commands) from thepackages/dev/inspector-v2directory.If you've built the full monorepo, you can also run
npx babylon-inspector --help(or other commands) from anywhere, which will pick up the final built CLI from the public package. This is the same way someone consuming the @babylonjs/inspector package would run the CLI.There is still an open question about whether we should have an Inspector MCP instead of or in addition to the CLI itself (most of the code would still stay the same though). Need to follow up with @RaananW on this.
After this PR, I will also explore more the idea of calling
StartInspectableby default in Sandbox and Playground, and also the idea of exposing additional tool specific CLI commands, like getting/setting Playground code for example. We need some more discussion around this to see how it relates to other tool MCP efforts, so this will be a possible future change.