@volter/editor-game 0.5.65
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/LICENSE +661 -0
- package/NOTICE +23 -0
- package/contributions/asset-budget-asset.menu.ts +26 -0
- package/contributions/asset-budget.action.ts +18 -0
- package/contributions/asset-budget.document.tsx +21 -0
- package/contributions/asset-budget.menu.ts +22 -0
- package/contributions/audio-unlock.service.ts +17 -0
- package/contributions/audio.utility.tsx +15 -0
- package/contributions/autoplay.service.ts +48 -0
- package/contributions/bridge.command.ts +172 -0
- package/contributions/build-profiles.document.tsx +21 -0
- package/contributions/build-progress.status.tsx +45 -0
- package/contributions/build.action.ts +26 -0
- package/contributions/build.command.ts +27 -0
- package/contributions/build.header.tsx +37 -0
- package/contributions/build.menu.ts +31 -0
- package/contributions/build.service.ts +31 -0
- package/contributions/connection.status.tsx +43 -0
- package/contributions/coverage.service.ts +118 -0
- package/contributions/edit-mode-audio.service.ts +23 -0
- package/contributions/edit-mode-networking.service.ts +30 -0
- package/contributions/game-document.service.ts +25 -0
- package/contributions/game-eval.command.ts +210 -0
- package/contributions/game.layout.ts +19 -0
- package/contributions/gameplay.command.ts +255 -0
- package/contributions/generation.service.ts +96 -0
- package/contributions/generations.status.tsx +53 -0
- package/contributions/ingest.service.ts +80 -0
- package/contributions/instances.command.ts +75 -0
- package/contributions/navmesh.menu.ts +39 -0
- package/contributions/navmesh.service.ts +19 -0
- package/contributions/network.utility.tsx +17 -0
- package/contributions/play.command.ts +355 -0
- package/contributions/profiler.action.ts +16 -0
- package/contributions/profiler.menu.ts +22 -0
- package/contributions/profiler.utility.tsx +17 -0
- package/contributions/react/component-board.service.ts +21 -0
- package/contributions/react/design-time-mount.service.ts +60 -0
- package/contributions/react/pasteboard.action.ts +41 -0
- package/contributions/react/react-inspector.service.ts +85 -0
- package/contributions/react/story-documents.service.ts +44 -0
- package/contributions/scene-document.service.ts +32 -0
- package/contributions/state-watch.action.ts +17 -0
- package/contributions/state-watch.menu.ts +23 -0
- package/contributions/state-watch.utility.tsx +20 -0
- package/contributions/team-playtest.service.ts +124 -0
- package/contributions/three/camera-runtime.inspector.tsx +34 -0
- package/contributions/three/component-board.service.ts +24 -0
- package/contributions/three/component-verbs.command.ts +110 -0
- package/contributions/three/component-verbs.service.ts +92 -0
- package/contributions/three/constraints.inspector.tsx +34 -0
- package/contributions/three/model-asset-sections.service.ts +26 -0
- package/contributions/three/reflection-probe-capture.inspector.tsx +32 -0
- package/contributions/three/story-documents.service.ts +31 -0
- package/contributions/three/three-authoring.service.ts +66 -0
- package/contributions/transport.header.tsx +19 -0
- package/contributions/xstate-behavior.action.ts +42 -0
- package/contributions/xstate-behavior.document.tsx +73 -0
- package/contributions/xstate-behavior.inspector.tsx +28 -0
- package/contributions/xstate-behavior.menu.ts +23 -0
- package/package.json +144 -0
- package/src/asset-budget/AssetBudgetPanel.tsx +1172 -0
- package/src/asset-budget/asset-budget-model.ts +799 -0
- package/src/asset-budget/basis-encoder.ts +165 -0
- package/src/asset-budget/gltf-io.ts +154 -0
- package/src/asset-budget/gltf-optimize.ts +384 -0
- package/src/asset-budget/image-dims.ts +78 -0
- package/src/asset-budget/optimize-apply.ts +221 -0
- package/src/audio/AudioDebuggerPanel.tsx +457 -0
- package/src/audio/audio-debugger-model.ts +87 -0
- package/src/bridge/call.ts +60 -0
- package/src/bridge/dispatch.ts +459 -0
- package/src/bridge/live-frames.ts +25 -0
- package/src/bridge/screenshot.ts +316 -0
- package/src/build/BuildProfilesPanel.tsx +476 -0
- package/src/build/build-session.ts +247 -0
- package/src/build/format-bytes.ts +14 -0
- package/src/command-results.ts +36 -0
- package/src/coverage/live-authoring-surface.ts +30 -0
- package/src/coverage/live-project-verbs.ts +162 -0
- package/src/coverage/native-system-coverage.ts +143 -0
- package/src/coverage/root-coverage.ts +79 -0
- package/src/coverage/session-coverage.ts +193 -0
- package/src/design-system-stories/ApplicationChrome.stories.tsx +100 -0
- package/src/design-system-stories/InspectorNarrowBodies.stories.tsx +406 -0
- package/src/edit-mode/edit-mode-audio.ts +56 -0
- package/src/edit-mode/edit-mode-networking.ts +112 -0
- package/src/game-document/DevicePresetPicker.tsx +84 -0
- package/src/game-document/GameCaptureFrameButton.tsx +45 -0
- package/src/game-document/GameDocument.tsx +215 -0
- package/src/game-document/GamePanel.tsx +662 -0
- package/src/game-document/InstanceInspectorPicker.tsx +183 -0
- package/src/game-document/crowd-debug.ts +183 -0
- package/src/game-document/device-preview.ts +336 -0
- package/src/game-document/game-view-store.ts +107 -0
- package/src/game-document/physics-debug.ts +187 -0
- package/src/generation/GenerationActivity.tsx +421 -0
- package/src/generation/GenerationGallery.css +231 -0
- package/src/generation/generation-documents.tsx +338 -0
- package/src/generation/generation-jobs.ts +128 -0
- package/src/generation/generation-presentation.ts +257 -0
- package/src/host/adapter-reach.ts +445 -0
- package/src/host/adapter-runtime-bindings.ts +303 -0
- package/src/host/after-paint.ts +112 -0
- package/src/host/api/configurations.ts +66 -0
- package/src/host/authoring/babylon-authoring-adapter.ts +703 -0
- package/src/host/authoring/canvas-runtime-recognition.ts +50 -0
- package/src/host/authoring/contract-hierarchy-authoring.ts +144 -0
- package/src/host/authoring/contract-scenes-stories.ts +204 -0
- package/src/host/authoring/creation-site-related.ts +55 -0
- package/src/host/authoring/ephemeral-persistence.ts +29 -0
- package/src/host/authoring/gesture-persist.ts +84 -0
- package/src/host/authoring/ingest-data-writer.ts +232 -0
- package/src/host/authoring/ingest-source-persistence.ts +826 -0
- package/src/host/authoring/mount-isolated-pixi-screen.ts +250 -0
- package/src/host/authoring/mounted-authoring.ts +41 -0
- package/src/host/authoring/owned-pixi-ticker-listeners.ts +96 -0
- package/src/host/authoring/phaser-live-authoring-adapter.ts +265 -0
- package/src/host/authoring/pixi-authoring-adapter.ts +1554 -0
- package/src/host/authoring/pixi-creation-site-write-target.ts +60 -0
- package/src/host/authoring/pixi-isolation-assets.ts +25 -0
- package/src/host/authoring/pixi-live-write-target.ts +979 -0
- package/src/host/authoring/pixi-source-identity.ts +141 -0
- package/src/host/authoring/pixi-still-presentation.ts +71 -0
- package/src/host/authoring/pixi-structure-history.ts +237 -0
- package/src/host/authoring/pixi-transform-channels.ts +205 -0
- package/src/host/authoring/selection-remount-handoff.ts +23 -0
- package/src/host/authoring/source-persistence-backend.ts +373 -0
- package/src/host/authoring/source-refresh-revisions.ts +81 -0
- package/src/host/authoring/struct-write-pipe.ts +143 -0
- package/src/host/auto-frame-window.ts +89 -0
- package/src/host/binding-resolver.ts +393 -0
- package/src/host/browser-transpile.ts +631 -0
- package/src/host/canvas-entry-runtime.ts +95 -0
- package/src/host/components/CameraAuthoringOverlay.tsx +216 -0
- package/src/host/components/HeaderTelemetry.tsx +341 -0
- package/src/host/components/PixiIsolationSceneContent.tsx +280 -0
- package/src/host/components/ResolutionPicker.tsx +89 -0
- package/src/host/components/ThreeIsolationSceneContent.tsx +180 -0
- package/src/host/components/frame-debugger-model.ts +579 -0
- package/src/host/components/header-telemetry-model.ts +74 -0
- package/src/host/components/scene-document.tsx +447 -0
- package/src/host/components/utility-view-state.ts +87 -0
- package/src/host/components/world-root-stage-binding.tsx +133 -0
- package/src/host/components/world-root-stage.ts +1046 -0
- package/src/host/coverage/authoring-read-probe.ts +583 -0
- package/src/host/coverage/capability-coverage.ts +1587 -0
- package/src/host/coverage/coverage-accounting.ts +261 -0
- package/src/host/coverage/game-contract-seam-evidence.ts +82 -0
- package/src/host/coverage/project-verb-coverage.ts +148 -0
- package/src/host/coverage/system-adapter-coverage.ts +373 -0
- package/src/host/design-system-stories/StoryLayout.tsx +104 -0
- package/src/host/design-system-stories/fixtures/authoring.ts +247 -0
- package/src/host/design-system-stories/fixtures/editor-runtime.tsx +115 -0
- package/src/host/document-preview-three.ts +110 -0
- package/src/host/entry-adjudication.ts +89 -0
- package/src/host/game-location-guard.ts +150 -0
- package/src/host/game-module-access.ts +196 -0
- package/src/host/game-realm-page.ts +358 -0
- package/src/host/game-realm-reclaim.ts +55 -0
- package/src/host/game-realm-storage.ts +104 -0
- package/src/host/gameplay-export.ts +288 -0
- package/src/host/gameplay-recording.ts +717 -0
- package/src/host/gated-globals.ts +1511 -0
- package/src/host/history/json-history-resource.ts +254 -0
- package/src/host/ingest/registry.ts +261 -0
- package/src/host/instance-extract-actions.ts +120 -0
- package/src/host/instance-fork-actions.ts +120 -0
- package/src/host/play-control-hook.ts +26 -0
- package/src/host/playwright-shim.ts +479 -0
- package/src/host/projection/dom.ts +295 -0
- package/src/host/projection/pixi.ts +288 -0
- package/src/host/r3f-entry-runtime.ts +77 -0
- package/src/host/react-mount-runtime.ts +162 -0
- package/src/host/realm-services.ts +148 -0
- package/src/host/recording-preview.ts +106 -0
- package/src/host/roots/module-root.ts +203 -0
- package/src/host/roots/react-root.ts +181 -0
- package/src/host/same-realm-loop-gate.ts +544 -0
- package/src/host/scene-view-drawability.ts +69 -0
- package/src/host/sdk/tools.ts +31 -0
- package/src/host/served-bundle-runtime-modules.ts +331 -0
- package/src/host/server-log-bridge.ts +60 -0
- package/src/host/staged-projects.ts +24 -0
- package/src/host/stories/mounted-story-viewport-source.ts +64 -0
- package/src/host/stories/story-arg-descriptors.ts +50 -0
- package/src/host/stories/story-media-presence.ts +152 -0
- package/src/host/surface-content.ts +87 -0
- package/src/host/take-named-export.ts +23 -0
- package/src/host/three-ingest-runtime.ts +76 -0
- package/src/host/types-fastnoise-lite.d.ts +7 -0
- package/src/host/types-mikktspace.d.ts +20 -0
- package/src/host/types-troika-three-text.d.ts +7 -0
- package/src/host/use-active-performance-source.ts +53 -0
- package/src/host/viewport-pose-memory.ts +48 -0
- package/src/host/viewport-root-presentation.ts +40 -0
- package/src/ingest/active-ingest.ts +251 -0
- package/src/ingest/active-scene-navigation.ts +43 -0
- package/src/ingest/authoring/ingest-dom-surface-authoring.ts +191 -0
- package/src/ingest/authoring/ingest-root-adapter.ts +897 -0
- package/src/ingest/capture-wait-report.ts +122 -0
- package/src/ingest/deferred-ingest-play.ts +216 -0
- package/src/ingest/deferred-ingest-session.ts +23 -0
- package/src/ingest/discovery-public-ingest.ts +242 -0
- package/src/ingest/dom-stub-mark.ts +7 -0
- package/src/ingest/entry-load.ts +56 -0
- package/src/ingest/game-contract-realm.ts +34 -0
- package/src/ingest/game-pointer-lock.ts +89 -0
- package/src/ingest/held-scene-repaint.ts +73 -0
- package/src/ingest/host-surface-box.ts +174 -0
- package/src/ingest/ingest-boot-viewport.ts +54 -0
- package/src/ingest/ingest-canvas-scene-document.tsx +177 -0
- package/src/ingest/ingest-canvas-scene.ts +50 -0
- package/src/ingest/ingest-evidence-hook.ts +131 -0
- package/src/ingest/ingest-frame-snapshot.ts +183 -0
- package/src/ingest/ingest-play-commands.ts +134 -0
- package/src/ingest/ingest-play-control.ts +299 -0
- package/src/ingest/ingest-render-debug.ts +320 -0
- package/src/ingest/ingest-siblings.ts +487 -0
- package/src/ingest/ingest-status.ts +62 -0
- package/src/ingest/live-ingest-facet.ts +46 -0
- package/src/ingest/module-mode.ts +229 -0
- package/src/ingest/mount-canvas-ingest-root.ts +899 -0
- package/src/ingest/mount-coverage.ts +296 -0
- package/src/ingest/mount-dom-ingest-root.ts +282 -0
- package/src/ingest/mount-ingest-root.ts +744 -0
- package/src/ingest/mount-three-ingest-root.ts +366 -0
- package/src/ingest/resolve-canvas.ts +47 -0
- package/src/ingest/resolve-three.ts +123 -0
- package/src/ingest/served-bundle.ts +109 -0
- package/src/ingest/served-html-boot.ts +292 -0
- package/src/ingest/surface-canvas.ts +84 -0
- package/src/ingest/surface-dom.ts +84 -0
- package/src/ingest/surface-three.ts +128 -0
- package/src/ingest/types.ts +76 -0
- package/src/ingest/unmount-ingest-root.ts +224 -0
- package/src/navmesh/navmesh-actions.ts +27 -0
- package/src/navmesh/navmesh-handler.ts +237 -0
- package/src/navmesh/navmesh-workflow-store.ts +78 -0
- package/src/network/NetworkInspectorPanel.tsx +644 -0
- package/src/network/network-inspector-model.ts +225 -0
- package/src/play/play-boot-stall.ts +118 -0
- package/src/play/play-log-events.ts +26 -0
- package/src/play/play-mode.ts +2553 -0
- package/src/play/play-recording.ts +335 -0
- package/src/play/react-play-live-authoring.ts +165 -0
- package/src/play-bar/PlayBar.tsx +488 -0
- package/src/play-bar/PlayerCountPicker.tsx +100 -0
- package/src/profiler/FrameDebuggerPanel.tsx +458 -0
- package/src/profiler/PerformancePanel.tsx +1068 -0
- package/src/profiler/ProfilerPanel.tsx +53 -0
- package/src/profiler/frame-debugger-store.ts +97 -0
- package/src/profiler/main-thread-busy.ts +90 -0
- package/src/react/design-time-react-mount.ts +782 -0
- package/src/react/dom-authoring-adapter.ts +764 -0
- package/src/react/pasteboard-materialize.ts +154 -0
- package/src/react/react-inspector-section.tsx +2496 -0
- package/src/react/react-world-authoring-adapter.ts +3795 -0
- package/src/react/story-documents/story-args-section.ts +19 -0
- package/src/react/story-documents/story-documents.tsx +1380 -0
- package/src/react/story-paint-bounds.ts +94 -0
- package/src/react/ui-board-document.tsx +101 -0
- package/src/react/ui-board-title.ts +9 -0
- package/src/react/ui-component-board.ts +72 -0
- package/src/services/audio-pose-guard.ts +81 -0
- package/src/services/game-audio-unlock.ts +48 -0
- package/src/state-watch/StateWatchPanel.tsx +535 -0
- package/src/three/authoring/camera-runtime-inspector-section.tsx +135 -0
- package/src/three/authoring/constraint-inspector-section.tsx +189 -0
- package/src/three/authoring/design-time-renderer.ts +189 -0
- package/src/three/authoring/model-asset-inspector-section.css +41 -0
- package/src/three/authoring/model-asset-inspector-section.tsx +869 -0
- package/src/three/authoring/oid-source-persistence.ts +557 -0
- package/src/three/authoring/r3f-design-session.ts +1174 -0
- package/src/three/authoring/r3f-source-authoring-adapter.ts +5949 -0
- package/src/three/authoring/reflection-probe-inspector-section.tsx +76 -0
- package/src/three/authoring/spatial-audio-handles.ts +215 -0
- package/src/three/authoring/spatial-collider-handles.ts +229 -0
- package/src/three/authoring/spatial-joint-handles.ts +114 -0
- package/src/three/authoring/spatial-light-handles.ts +178 -0
- package/src/three/authoring/spatial-lod-handles.ts +93 -0
- package/src/three/authoring/spatial-particle-handles.ts +368 -0
- package/src/three/authoring/three-authoring-adapter.ts +1953 -0
- package/src/three/authoring/three-scene-identity.ts +19 -0
- package/src/three/authoring/three-spatial-handles.ts +161 -0
- package/src/three/authoring/typed-three-inspector.ts +528 -0
- package/src/three/component-verbs/extract-menu.ts +71 -0
- package/src/three/component-verbs/fork-menu.ts +78 -0
- package/src/three/component-verbs/internals-menu.ts +91 -0
- package/src/three/story-documents/three-story-documents.tsx +607 -0
- package/src/three/three-board/ThreeBoardDocument.tsx +888 -0
- package/src/three/three-board/board-framing.ts +412 -0
- package/src/three/three-board/board-layout.ts +401 -0
- package/src/three/three-board/board-scene.ts +901 -0
- package/src/three/three-board/three-component-board.ts +62 -0
- package/src/xstate/XStateBehaviorSection.tsx +130 -0
- package/src/xstate/XStateMachineInspector.tsx +566 -0
- package/src/xstate/character-animation-machine.fixture.ts +74 -0
- package/src/xstate/live-behaviors.ts +106 -0
- package/src/xstate/use-live-actor-state.ts +44 -0
- package/src/xstate/xstate-graph.ts +235 -0
- package/src/xstate/xstate-layout.ts +76 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE THREE SURFACE'S DESIGN-TIME AUTHORING (`@volter/editor-sdk/services`, a
|
|
3
|
+
* `workspace.service` contribution): the two registrations that make a `three`
|
|
4
|
+
* root editable, and the reason the kit names no medium.
|
|
5
|
+
*
|
|
6
|
+
* 1. THE LIVE ADAPTER for a declared `three` world
|
|
7
|
+
* (`@editor/authoring/active-adapter`'s `setBaseAuthoringFactory`). The
|
|
8
|
+
* edit-mode installer used to build this one adapter itself, by picking
|
|
9
|
+
* the project's three root by name; it asks by SURFACE now, and a world
|
|
10
|
+
* whose surface nobody claims keeps its honest Boundary disclosure.
|
|
11
|
+
* 2. THE DESIGN SESSION on the world root's 3D stage
|
|
12
|
+
* (`@editor/authoring/design-time-mount-registry`'s `kind: 'three'`),
|
|
13
|
+
* beside `@volter/editor-game`'s `kind: 'dom'` and the canvas medium's. Those two
|
|
14
|
+
* mount into a LAYER over the artboard; this one adopts the stage's own
|
|
15
|
+
* renderer and scene, which is why the registry carries two mount shapes.
|
|
16
|
+
*
|
|
17
|
+
* ARRIVING LATE IS ORDINARY. The contribution pass is deferred behind the
|
|
18
|
+
* first viewport frame, so the edit-mode composite is routinely installed
|
|
19
|
+
* before this runs. `queueEditModeRebuild()` is the kit's own door for that —
|
|
20
|
+
* the same one a source change uses — so the adapter seam needs no
|
|
21
|
+
* notification of its own, and the stage's mount is re-asked on the rebuild.
|
|
22
|
+
*
|
|
23
|
+
* THE SESSION CHUNK IS WARMED HERE, at registration, because the stage used
|
|
24
|
+
* to warm it when it began building and the wait it hides is real. Only a
|
|
25
|
+
* product that composes this package pays for it.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
import { setBaseAuthoringFactory } from '@volter/editor-core/authoring/active-adapter';
|
|
29
|
+
import { registerDesignTimeMount } from '@volter/editor-core/authoring/design-time-mount-registry';
|
|
30
|
+
import { queueEditModeRebuild } from '@volter/editor-core/authoring/edit-mode-authoring';
|
|
31
|
+
import { authoringJournal } from '../../src/host/history/json-history-resource';
|
|
32
|
+
import { oidThree } from '../../src/three/authoring/three-authoring-adapter';
|
|
33
|
+
|
|
34
|
+
export const point = 'workspace.service';
|
|
35
|
+
|
|
36
|
+
export function start(): () => void {
|
|
37
|
+
// Warm the session chunk with the pass, not with the first mount.
|
|
38
|
+
const session = import('../../src/three/authoring/r3f-design-session');
|
|
39
|
+
void session.catch(() => {
|
|
40
|
+
// The mount below awaits the same promise and reports its own failure;
|
|
41
|
+
// this early start must not create a second unhandled rejection.
|
|
42
|
+
});
|
|
43
|
+
const stopFactory = setBaseAuthoringFactory('three', (store, worldId) =>
|
|
44
|
+
// The store's scene is the subject: whatever has been mounted into it (the
|
|
45
|
+
// R3F design session's fiber scene, once it adopts) is what the hierarchy
|
|
46
|
+
// shows, and an unmounted world honestly shows nothing rather than a
|
|
47
|
+
// fabricated document.
|
|
48
|
+
oidThree(store, () => store.scene, worldId, authoringJournal(worldId)),
|
|
49
|
+
);
|
|
50
|
+
const stopMount = registerDesignTimeMount({
|
|
51
|
+
kind: 'three',
|
|
52
|
+
owner: '@volter/editor-game/three/three-authoring',
|
|
53
|
+
mountWorldRootSession: async (context) => {
|
|
54
|
+
const { mountR3FDesignSession } = await session;
|
|
55
|
+
return mountR3FDesignSession(context.store, context.composite, context.renderer);
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
// The composite that is already installed was built before this package's
|
|
59
|
+
// factory existed, so its three world is a Boundary node. Ask for the one
|
|
60
|
+
// rebuild that turns it live.
|
|
61
|
+
queueEditModeRebuild();
|
|
62
|
+
return () => {
|
|
63
|
+
stopMount();
|
|
64
|
+
stopFactory();
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Play TRANSPORT in the project header (`@volter/editor-sdk/chrome`, a
|
|
3
|
+
* `workspace.header` contribution): play, pause, step, restart, stop, the
|
|
4
|
+
* run-configuration picker and the instance count. Only for a project that
|
|
5
|
+
* declares something to run (ARCHITECTURE-CORE §Roots); a folder of models
|
|
6
|
+
* renders nothing here.
|
|
7
|
+
*/
|
|
8
|
+
import { editorHost } from '@volter/editor-sdk/host';
|
|
9
|
+
import { useSyncExternalStore } from 'react';
|
|
10
|
+
import { PlayBar } from '../src/play-bar/PlayBar';
|
|
11
|
+
|
|
12
|
+
export const point = 'workspace.header';
|
|
13
|
+
export const order = 0;
|
|
14
|
+
|
|
15
|
+
export default function TransportHeader() {
|
|
16
|
+
const { project } = editorHost();
|
|
17
|
+
const mounts = useSyncExternalStore(project.subscribe, project.mounts, project.mounts);
|
|
18
|
+
return mounts ? <PlayBar /> : null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Behavior debugger's palette actions (`@volter/editor-sdk/chrome`, a
|
|
3
|
+
* `workspace.action` contribution) — a LIVE set: `Inspect Behavior` (the
|
|
4
|
+
* first truthful live actor, the same reveal as Debug ▸ Inspect Behavior)
|
|
5
|
+
* plus one `Inspect Behavior: <machine>` per running XState actor. The host
|
|
6
|
+
* asks `actions` when the palette opens and re-lists on `subscribe`: an
|
|
7
|
+
* actor registering or a hierarchy change (any shell-store notification, so
|
|
8
|
+
* the listing walks the object map only while a palette is open).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { ActionContribution } from '@volter/editor-sdk/chrome';
|
|
12
|
+
import { editorHost } from '@volter/editor-sdk/host';
|
|
13
|
+
import { subscribeXStateBehaviorInspections } from '@volter/threejs-runtime/behavior/xstate-inspection';
|
|
14
|
+
import {
|
|
15
|
+
listLiveBehaviors,
|
|
16
|
+
openBehaviorDocument,
|
|
17
|
+
openFirstBehaviorDocument,
|
|
18
|
+
} from '../src/xstate/live-behaviors';
|
|
19
|
+
|
|
20
|
+
export const point = 'workspace.action';
|
|
21
|
+
|
|
22
|
+
export const actions: ActionContribution['actions'] = () => [
|
|
23
|
+
{
|
|
24
|
+
id: 'inspect-behavior',
|
|
25
|
+
label: 'Inspect Behavior',
|
|
26
|
+
execute: () => void openFirstBehaviorDocument(),
|
|
27
|
+
},
|
|
28
|
+
...listLiveBehaviors().map((entry) => ({
|
|
29
|
+
id: `xstate-machine:${entry.machineId}:${entry.nodeId}`,
|
|
30
|
+
label: `Inspect Behavior: ${entry.machineId}`,
|
|
31
|
+
execute: () => void openBehaviorDocument(entry.nodeId),
|
|
32
|
+
})),
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export const subscribe: ActionContribution['subscribe'] = (listener) => {
|
|
36
|
+
const stopInspections = subscribeXStateBehaviorInspections(listener);
|
|
37
|
+
const stopHierarchy = editorHost().hierarchy.subscribe(listener);
|
|
38
|
+
return () => {
|
|
39
|
+
stopInspections();
|
|
40
|
+
stopHierarchy();
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE BEHAVIOR DOCUMENT (`workspace.document`): the REAL live actor of the
|
|
3
|
+
* machine you asked to inspect, drawn as its graph — the same asset-document
|
|
4
|
+
* pattern the animation and model editors use, inspect-only.
|
|
5
|
+
*
|
|
6
|
+
* Its subject is `live-behaviors.ts`'s (`openBehaviorDocument(nodeId)` sets it
|
|
7
|
+
* and opens this tab, from the section's button, the Debug menu and each
|
|
8
|
+
* `Inspect Behavior: <id>` palette action). With no live actor for that node —
|
|
9
|
+
* the game stopped, the actor detached — the document says so rather than
|
|
10
|
+
* drawing a machine nothing is running.
|
|
11
|
+
*
|
|
12
|
+
* No `tool`: it drives no registered callable.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type { ToolContributionProps, ToolDocumentToolbar } from '@volter/editor-sdk/contributions';
|
|
16
|
+
import {
|
|
17
|
+
subscribeXStateBehaviorInspections,
|
|
18
|
+
xstateBehaviorInspectionsVersion,
|
|
19
|
+
} from '@volter/threejs-runtime/behavior/xstate-inspection';
|
|
20
|
+
import { useSyncExternalStore } from 'react';
|
|
21
|
+
import {
|
|
22
|
+
behaviorSubject,
|
|
23
|
+
behaviorSubjectVersion,
|
|
24
|
+
liveBehaviorFor,
|
|
25
|
+
subscribeBehaviorSubject,
|
|
26
|
+
} from '../src/xstate/live-behaviors';
|
|
27
|
+
import { XStateMachineInspector } from '../src/xstate/XStateMachineInspector';
|
|
28
|
+
|
|
29
|
+
export const point = 'workspace.document';
|
|
30
|
+
export const title = 'Behavior';
|
|
31
|
+
|
|
32
|
+
/** Re-render on both live facts this document draws: which node it is on, and
|
|
33
|
+
* whether that node still carries an inspection. */
|
|
34
|
+
function useSubjectBehavior() {
|
|
35
|
+
useSyncExternalStore(subscribeBehaviorSubject, behaviorSubjectVersion, behaviorSubjectVersion);
|
|
36
|
+
useSyncExternalStore(
|
|
37
|
+
subscribeXStateBehaviorInspections,
|
|
38
|
+
xstateBehaviorInspectionsVersion,
|
|
39
|
+
xstateBehaviorInspectionsVersion,
|
|
40
|
+
);
|
|
41
|
+
const nodeId = behaviorSubject();
|
|
42
|
+
return nodeId ? liveBehaviorFor(nodeId) : undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The document's header, in the host's own strip: which machine, and that it
|
|
46
|
+
* is a live actor you may read but not edit. */
|
|
47
|
+
export const Toolbar: ToolDocumentToolbar = () => {
|
|
48
|
+
const behavior = useSubjectBehavior();
|
|
49
|
+
return (
|
|
50
|
+
<span data-testid="xstate-behavior-toolbar" style={{ fontSize: 11 }}>
|
|
51
|
+
{behavior ? `${behavior.machine.id} · Live actor · inspect-only` : 'Behavior unavailable'}
|
|
52
|
+
</span>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default function XStateBehaviorDocument(_props: ToolContributionProps) {
|
|
57
|
+
const behavior = useSubjectBehavior();
|
|
58
|
+
return (
|
|
59
|
+
<div className="vgai-behavior-document" data-testid="xstate-behavior-document">
|
|
60
|
+
{behavior ? (
|
|
61
|
+
<XStateMachineInspector
|
|
62
|
+
machine={behavior.machine}
|
|
63
|
+
actor={behavior.actor}
|
|
64
|
+
title={behavior.machine.id}
|
|
65
|
+
/>
|
|
66
|
+
) : (
|
|
67
|
+
<div className="vgai-behavior-document__empty">
|
|
68
|
+
This live behavior is no longer registered.
|
|
69
|
+
</div>
|
|
70
|
+
)}
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Behavior Inspector section (`selection.inspector`, §4.3): the machine a
|
|
3
|
+
* selected entity is actually running.
|
|
4
|
+
*
|
|
5
|
+
* `match` reads the hierarchy door for the node's own live inspection mark, so
|
|
6
|
+
* it matches ONLY a real live actor — a template entity (no machine) never
|
|
7
|
+
* matches, and the section cannot render for it.
|
|
8
|
+
*/
|
|
9
|
+
import type {
|
|
10
|
+
ToolContributionNode,
|
|
11
|
+
ToolInspectorContributionProps,
|
|
12
|
+
} from '@volter/editor-sdk/contributions';
|
|
13
|
+
import { liveBehaviorFor } from '../src/xstate/live-behaviors';
|
|
14
|
+
import { XStateMachineSection } from '../src/xstate/XStateBehaviorSection';
|
|
15
|
+
|
|
16
|
+
export const point = 'selection.inspector';
|
|
17
|
+
export const title = 'Behavior';
|
|
18
|
+
/** Where the host registered it before the move: the contributed band's own
|
|
19
|
+
* base, ahead of modules that claim no place. */
|
|
20
|
+
export const order = 0;
|
|
21
|
+
|
|
22
|
+
export function match(node: ToolContributionNode | null): boolean {
|
|
23
|
+
return node !== null && liveBehaviorFor(node.id) !== undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default function XStateBehaviorInspector({ nodeId }: ToolInspectorContributionProps) {
|
|
27
|
+
return <XStateMachineSection nodeId={nodeId} />;
|
|
28
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug ▸ Inspect Behavior — opens the first truthful live actor as the
|
|
3
|
+
* Behavior document. Disabled while no live actor is registered, which is the
|
|
4
|
+
* same predicate the open path itself refuses on; `disabled` is asked at
|
|
5
|
+
* render, so it follows the session.
|
|
6
|
+
*/
|
|
7
|
+
import type { MenuContribution } from '@volter/editor-sdk/chrome';
|
|
8
|
+
import { listLiveBehaviors, openFirstBehaviorDocument } from '../src/xstate/live-behaviors';
|
|
9
|
+
|
|
10
|
+
export const point = 'workspace.menu';
|
|
11
|
+
|
|
12
|
+
export const menu: MenuContribution = {
|
|
13
|
+
menu: 'debug',
|
|
14
|
+
items: [
|
|
15
|
+
{
|
|
16
|
+
id: 'inspect-behavior',
|
|
17
|
+
label: 'Inspect Behavior',
|
|
18
|
+
testId: 'menu-inspect-behavior',
|
|
19
|
+
disabled: () => listLiveBehaviors().length === 0,
|
|
20
|
+
execute: () => void openFirstBehaviorDocument(),
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@volter/editor-game",
|
|
3
|
+
"author": "Volter AI, Inc.",
|
|
4
|
+
"license": "AGPL-3.0-only",
|
|
5
|
+
"version": "0.5.65",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"description": "The game side of Volter Editor: play, the game document, build, ingest, instruments over a running game, and the three.js and React/DOM authoring surfaces.",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/volter-ai/editor.git",
|
|
14
|
+
"directory": "packages/editor-game"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"src",
|
|
18
|
+
"contributions",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"NOTICE"
|
|
21
|
+
],
|
|
22
|
+
"exports": {
|
|
23
|
+
"./contributions/*": "./contributions/*",
|
|
24
|
+
"./*": "./src/*",
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"vgai": {
|
|
28
|
+
"contributions": [
|
|
29
|
+
"./contributions/asset-budget-asset.menu.ts",
|
|
30
|
+
"./contributions/asset-budget.action.ts",
|
|
31
|
+
"./contributions/asset-budget.document.tsx",
|
|
32
|
+
"./contributions/asset-budget.menu.ts",
|
|
33
|
+
"./contributions/audio-unlock.service.ts",
|
|
34
|
+
"./contributions/audio.utility.tsx",
|
|
35
|
+
"./contributions/autoplay.service.ts",
|
|
36
|
+
"./contributions/bridge.command.ts",
|
|
37
|
+
"./contributions/build-profiles.document.tsx",
|
|
38
|
+
"./contributions/build-progress.status.tsx",
|
|
39
|
+
"./contributions/build.action.ts",
|
|
40
|
+
"./contributions/build.command.ts",
|
|
41
|
+
"./contributions/build.header.tsx",
|
|
42
|
+
"./contributions/build.menu.ts",
|
|
43
|
+
"./contributions/build.service.ts",
|
|
44
|
+
"./contributions/connection.status.tsx",
|
|
45
|
+
"./contributions/coverage.service.ts",
|
|
46
|
+
"./contributions/edit-mode-audio.service.ts",
|
|
47
|
+
"./contributions/edit-mode-networking.service.ts",
|
|
48
|
+
"./contributions/game-document.service.ts",
|
|
49
|
+
"./contributions/game-eval.command.ts",
|
|
50
|
+
"./contributions/game.layout.ts",
|
|
51
|
+
"./contributions/gameplay.command.ts",
|
|
52
|
+
"./contributions/generation.service.ts",
|
|
53
|
+
"./contributions/generations.status.tsx",
|
|
54
|
+
"./contributions/ingest.service.ts",
|
|
55
|
+
"./contributions/instances.command.ts",
|
|
56
|
+
"./contributions/navmesh.menu.ts",
|
|
57
|
+
"./contributions/navmesh.service.ts",
|
|
58
|
+
"./contributions/network.utility.tsx",
|
|
59
|
+
"./contributions/play.command.ts",
|
|
60
|
+
"./contributions/profiler.action.ts",
|
|
61
|
+
"./contributions/profiler.menu.ts",
|
|
62
|
+
"./contributions/profiler.utility.tsx",
|
|
63
|
+
"./contributions/scene-document.service.ts",
|
|
64
|
+
"./contributions/state-watch.action.ts",
|
|
65
|
+
"./contributions/state-watch.menu.ts",
|
|
66
|
+
"./contributions/state-watch.utility.tsx",
|
|
67
|
+
"./contributions/team-playtest.service.ts",
|
|
68
|
+
"./contributions/transport.header.tsx",
|
|
69
|
+
"./contributions/xstate-behavior.action.ts",
|
|
70
|
+
"./contributions/xstate-behavior.document.tsx",
|
|
71
|
+
"./contributions/xstate-behavior.inspector.tsx",
|
|
72
|
+
"./contributions/xstate-behavior.menu.ts",
|
|
73
|
+
"./contributions/react/component-board.service.ts",
|
|
74
|
+
"./contributions/react/design-time-mount.service.ts",
|
|
75
|
+
"./contributions/react/pasteboard.action.ts",
|
|
76
|
+
"./contributions/react/react-inspector.service.ts",
|
|
77
|
+
"./contributions/react/story-documents.service.ts",
|
|
78
|
+
"./contributions/three/camera-runtime.inspector.tsx",
|
|
79
|
+
"./contributions/three/component-board.service.ts",
|
|
80
|
+
"./contributions/three/component-verbs.command.ts",
|
|
81
|
+
"./contributions/three/component-verbs.service.ts",
|
|
82
|
+
"./contributions/three/constraints.inspector.tsx",
|
|
83
|
+
"./contributions/three/model-asset-sections.service.ts",
|
|
84
|
+
"./contributions/three/reflection-probe-capture.inspector.tsx",
|
|
85
|
+
"./contributions/three/story-documents.service.ts",
|
|
86
|
+
"./contributions/three/three-authoring.service.ts"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
"dependencies": {
|
|
90
|
+
"@volter/editor-core": "0.5.65",
|
|
91
|
+
"@volter/editor-sdk": "0.5.65",
|
|
92
|
+
"@volter/editor-project": "0.5.65",
|
|
93
|
+
"@volter/editor-threejs": "0.5.65",
|
|
94
|
+
"@volter/threejs-runtime": "0.5.65",
|
|
95
|
+
"@volter/game-runtime": "0.5.65",
|
|
96
|
+
"@colyseus/schema": "^4.0.14",
|
|
97
|
+
"@colyseus/sdk": "^0.17.34",
|
|
98
|
+
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
99
|
+
"@gltf-transform/core": "^4.4.1",
|
|
100
|
+
"@gltf-transform/extensions": "^4.4.1",
|
|
101
|
+
"@gltf-transform/functions": "^4.4.2",
|
|
102
|
+
"@react-three/drei": "^10.7.7",
|
|
103
|
+
"@react-three/fiber": "^9.6.1",
|
|
104
|
+
"@storybook/react": "10.6.0",
|
|
105
|
+
"axe-core": "^4.12.1",
|
|
106
|
+
"draco3d": "^1.5.7",
|
|
107
|
+
"esbuild-wasm": "0.25.12",
|
|
108
|
+
"fastnoise-lite": "^1.1.1",
|
|
109
|
+
"mediabunny": "1.56.2",
|
|
110
|
+
"meshoptimizer": "^1.2.0",
|
|
111
|
+
"three": "^0.180.0",
|
|
112
|
+
"three-bvh-csg": "^0.0.18",
|
|
113
|
+
"three-mesh-bvh": "^0.9.12",
|
|
114
|
+
"troika-three-text": "^0.52.4",
|
|
115
|
+
"pixi.js": "^8.6.0",
|
|
116
|
+
"es-module-lexer": "^1.7.0",
|
|
117
|
+
"postprocessing": "6.38.3",
|
|
118
|
+
"@dimforge/rapier2d-compat": "^0.14.0",
|
|
119
|
+
"@dimforge/rapier3d-compat": "^0.14.0",
|
|
120
|
+
"@pixi/react": "8.0.5",
|
|
121
|
+
"@react-three/rapier": "2.2.0",
|
|
122
|
+
"recast-navigation": "^0.43.0",
|
|
123
|
+
"xstate": "^5.32.4",
|
|
124
|
+
"zod": "^4.3.6",
|
|
125
|
+
"@fortawesome/fontawesome-svg-core": "^7.2.0"
|
|
126
|
+
},
|
|
127
|
+
"peerDependencies": {
|
|
128
|
+
"@sparkjsdev/spark": "^2.1.0",
|
|
129
|
+
"react": "^19.0.0",
|
|
130
|
+
"react-dom": "^19.0.0",
|
|
131
|
+
"@playwright/test": ">=1.58"
|
|
132
|
+
},
|
|
133
|
+
"devDependencies": {
|
|
134
|
+
"@playwright/test": "^1.58.2"
|
|
135
|
+
},
|
|
136
|
+
"scripts": {
|
|
137
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
138
|
+
},
|
|
139
|
+
"peerDependenciesMeta": {
|
|
140
|
+
"@playwright/test": {
|
|
141
|
+
"optional": true
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|