@jgengine/editor 0.11.0 → 0.13.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 +52 -0
- package/README.md +12 -0
- package/dist/AssetBrowser.d.ts +33 -1
- package/dist/AssetBrowser.js +64 -2
- package/dist/AssetDropZone.d.ts +9 -0
- package/dist/AssetDropZone.js +65 -0
- package/dist/CatalogsPanel.d.ts +4 -2
- package/dist/CatalogsPanel.js +162 -9
- package/dist/CityPreview.d.ts +11 -0
- package/dist/CityPreview.js +45 -0
- package/dist/CollectionsPanel.js +5 -5
- package/dist/DebugDraw.d.ts +3 -1
- package/dist/DebugDraw.js +37 -19
- package/dist/EditorApp.d.ts +15 -1
- package/dist/EditorApp.js +147 -35
- package/dist/EditorChrome.d.ts +27 -6
- package/dist/EditorChrome.js +314 -130
- package/dist/InspectorPanel.d.ts +17 -7
- package/dist/InspectorPanel.js +173 -27
- package/dist/LightingPanel.d.ts +11 -0
- package/dist/LightingPanel.js +99 -0
- package/dist/MaterialsWorkspacePanel.d.ts +12 -0
- package/dist/MaterialsWorkspacePanel.js +86 -0
- package/dist/ParentPickerMenu.d.ts +13 -0
- package/dist/ParentPickerMenu.js +33 -0
- package/dist/PerfProbe.js +33 -0
- package/dist/PrefabsPanel.js +5 -5
- package/dist/RuntimePlayBridge.d.ts +5 -3
- package/dist/RuntimePlayBridge.js +6 -13
- package/dist/ScatterPreview.d.ts +3 -1
- package/dist/ScatterPreview.js +10 -7
- package/dist/SchemaInspector.js +21 -8
- package/dist/ScriptingPanel.d.ts +15 -0
- package/dist/ScriptingPanel.js +46 -0
- package/dist/SelectionGizmo.js +114 -30
- package/dist/StandaloneEditor.d.ts +16 -9
- package/dist/StandaloneEditor.js +19 -20
- package/dist/TerrainPanel.d.ts +3 -2
- package/dist/TerrainPanel.js +16 -5
- package/dist/TerrainSculpt.js +98 -59
- package/dist/agent/AgentPanel.d.ts +5 -2
- package/dist/agent/AgentPanel.js +11 -6
- package/dist/agent/toolBridge.js +5 -0
- package/dist/assetImport.d.ts +36 -0
- package/dist/assetImport.js +66 -0
- package/dist/authoredComponentMeta.d.ts +25 -0
- package/dist/authoredComponentMeta.js +65 -0
- package/dist/gizmoPivot.d.ts +4 -0
- package/dist/gizmoPivot.js +34 -0
- package/dist/handlers/catalogs.d.ts +3 -0
- package/dist/handlers/catalogs.js +137 -0
- package/dist/handlers/collections.d.ts +3 -0
- package/dist/handlers/collections.js +57 -0
- package/dist/handlers/context.d.ts +36 -0
- package/dist/handlers/context.js +1 -0
- package/dist/handlers/document.d.ts +3 -0
- package/dist/handlers/document.js +350 -0
- package/dist/handlers/grids.d.ts +3 -0
- package/dist/handlers/grids.js +142 -0
- package/dist/handlers/hierarchy.d.ts +3 -0
- package/dist/handlers/hierarchy.js +55 -0
- package/dist/handlers/index.d.ts +8 -0
- package/dist/handlers/index.js +25 -0
- package/dist/handlers/minimap.d.ts +9 -0
- package/dist/handlers/minimap.js +32 -0
- package/dist/handlers/runtime.d.ts +3 -0
- package/dist/handlers/runtime.js +191 -0
- package/dist/handlers/streets.d.ts +3 -0
- package/dist/handlers/streets.js +159 -0
- package/dist/handlers/terrain.d.ts +3 -0
- package/dist/handlers/terrain.js +204 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/listDocumentTriggers.d.ts +42 -0
- package/dist/listDocumentTriggers.js +49 -0
- package/dist/materialAssignments.d.ts +63 -0
- package/dist/materialAssignments.js +84 -0
- package/dist/mcp/fieldSpec.d.ts +32 -0
- package/dist/mcp/fieldSpec.js +174 -0
- package/dist/mcp/rpcRequest.d.ts +8 -5
- package/dist/mcp/rpcRequest.js +72 -93
- package/dist/mcp/tools.js +105 -912
- package/dist/networkSnapshot.d.ts +82 -0
- package/dist/networkSnapshot.js +73 -0
- package/dist/parentCandidates.d.ts +12 -0
- package/dist/parentCandidates.js +25 -0
- package/dist/session.d.ts +91 -4
- package/dist/session.js +36 -1017
- package/dist/shell/AnimationPanel.d.ts +17 -0
- package/dist/shell/AnimationPanel.js +134 -0
- package/dist/shell/AssetThumbnail.d.ts +12 -0
- package/dist/shell/AssetThumbnail.js +23 -0
- package/dist/shell/BottomDock.d.ts +25 -0
- package/dist/shell/BottomDock.js +40 -0
- package/dist/shell/CommandPalette.d.ts +12 -0
- package/dist/shell/CommandPalette.js +56 -0
- package/dist/shell/ConsolePanel.d.ts +8 -0
- package/dist/shell/ConsolePanel.js +45 -0
- package/dist/shell/ContentBrowser.d.ts +21 -0
- package/dist/shell/ContentBrowser.js +130 -0
- package/dist/shell/HierarchyPanel.d.ts +26 -0
- package/dist/shell/HierarchyPanel.js +387 -0
- package/dist/shell/NetworkWorkspacePanel.d.ts +11 -0
- package/dist/shell/NetworkWorkspacePanel.js +49 -0
- package/dist/shell/PlayModeBar.d.ts +12 -0
- package/dist/shell/PlayModeBar.js +27 -0
- package/dist/shell/ProfilerPanel.d.ts +10 -0
- package/dist/shell/ProfilerPanel.js +41 -0
- package/dist/shell/SceneToolbar.d.ts +43 -0
- package/dist/shell/SceneToolbar.js +122 -0
- package/dist/shell/StatusBar.d.ts +18 -0
- package/dist/shell/StatusBar.js +41 -0
- package/dist/shell/TopAppBar.d.ts +35 -0
- package/dist/shell/TopAppBar.js +64 -0
- package/dist/shell/ViewportOverlays.d.ts +23 -0
- package/dist/shell/ViewportOverlays.js +136 -0
- package/dist/shell/WorkspaceRail.d.ts +20 -0
- package/dist/shell/WorkspaceRail.js +31 -0
- package/dist/shell/cameraTelemetry.d.ts +27 -0
- package/dist/shell/cameraTelemetry.js +24 -0
- package/dist/shell/commandRegistry.d.ts +58 -0
- package/dist/shell/commandRegistry.js +133 -0
- package/dist/shell/consoleSink.d.ts +11 -0
- package/dist/shell/consoleSink.js +17 -0
- package/dist/shell/consoleStore.d.ts +27 -0
- package/dist/shell/consoleStore.js +43 -0
- package/dist/shell/fields.d.ts +39 -0
- package/dist/shell/fields.js +104 -0
- package/dist/shell/formatSavedRelative.d.ts +2 -0
- package/dist/shell/formatSavedRelative.js +14 -0
- package/dist/shell/glbThumbnailCache.d.ts +45 -0
- package/dist/shell/glbThumbnailCache.js +241 -0
- package/dist/shell/hierarchyA11y.d.ts +21 -0
- package/dist/shell/hierarchyA11y.js +35 -0
- package/dist/shell/icons.d.ts +13 -0
- package/dist/shell/icons.js +85 -0
- package/dist/shell/layoutStore.d.ts +68 -0
- package/dist/shell/layoutStore.js +156 -0
- package/dist/shell/pathFlythrough.d.ts +37 -0
- package/dist/shell/pathFlythrough.js +54 -0
- package/dist/shell/perfHistory.d.ts +70 -0
- package/dist/shell/perfHistory.js +130 -0
- package/dist/shell/renameObject.d.ts +3 -0
- package/dist/shell/renameObject.js +25 -0
- package/dist/shell/theme.d.ts +36 -0
- package/dist/shell/theme.js +37 -0
- package/dist/shell/ui.d.ts +84 -0
- package/dist/shell/ui.js +90 -0
- package/dist/shell/useGlbThumbnail.d.ts +8 -0
- package/dist/shell/useGlbThumbnail.js +19 -0
- package/dist/uiStore.d.ts +27 -0
- package/dist/uiStore.js +10 -0
- package/dist/viewportContextMenu.d.ts +4 -2
- package/dist/viewportContextMenu.js +5 -1
- package/package.json +4 -4
- package/skills/jgengine/SKILL.md +8 -4
- package/skills/jgengine/api.md +182 -81
- package/skills/jgengine/capabilities.md +104 -2
- package/skills/jgengine/recipes/minimal-game.md +88 -0
- package/skills/jgengine-editor/SKILL.md +18 -3
- package/skills/jgengine-editor/api.md +403 -20
- package/skills/jgengine-editor/capabilities.md +46 -0
- package/skills/jgengine-editor/reference.md +87 -0
- package/skills/level-design/SKILL.md +54 -0
- package/skills/level-design/agents/openai.yaml +4 -0
- package/skills/level-design/references/application-playbook.md +192 -0
- package/skills/level-design/references/field-guide.md +337 -0
- package/skills/level-design/references/live-editor-loop.md +179 -0
- package/dist/OutlinerPanel.d.ts +0 -14
- package/dist/OutlinerPanel.js +0 -84
- package/skills/jgengine/reference-cartridge.md +0 -72
|
@@ -11,17 +11,28 @@
|
|
|
11
11
|
- `CreateGridLayerInit` (interface): interface CreateGridLayerInit — Fields accepted when constructing a grid layer; sensible defaults fill the rest.
|
|
12
12
|
- `CsvGridExportOptions` (interface): interface CsvGridExportOptions — Options for exporting a grid layer as CSV.
|
|
13
13
|
- `CsvGridImportOptions` (interface): interface CsvGridImportOptions — Options for importing a CSV grid (one value id per cell).
|
|
14
|
+
- `DecodeWorldManifestResult` (type): type DecodeWorldManifestResult = | { ok: true; manifest: WorldManifest } | { ok: false; errors: EditorDocumentDiagnostic[] } — Result of {@link decodeWorldManifest}: a typed manifest, or every diagnostic collected decoding it.
|
|
15
|
+
- `DirectiveFootprint` (interface): interface DirectiveFootprint — A resolved directive footprint: the XZ bounds to scatter within, plus an optional clip polygon.
|
|
16
|
+
- `DirectiveInstancePatch` (interface): interface DirectiveInstancePatch — A per-instance hand-tweak over a materialized directive, keyed by the minted instance id.
|
|
17
|
+
- `DocumentBakeOptions` (interface): interface DocumentBakeOptions extends MinimapBakeOptions — Options for {@link bakeMinimapFromDocument}.
|
|
14
18
|
- `DocumentLiveEvent` (interface): interface DocumentLiveEvent — Event emitted when the authoritative document changes on a {@link DocumentLiveSync}.
|
|
15
19
|
- `DocumentLiveSync` (interface): interface DocumentLiveSync — Two-way live-sync bus: document patches out, runtime state deltas back.
|
|
16
20
|
- `DocumentPatch` (type): type DocumentPatch = | { type: "snapshot"; revision?: number; baseRevision: number; document: EditorDocument; } | { type: "commands"; revision?: number; baseRevision: number; commands: readonly EditorCommand[]; } — One versioned document mutation on the live-sync stream. `snapshot` replaces the whole document; `commands` replays structural editor commands onto the current document. `baseRevision` must match the receiver's current revision unless `force` is set (document authority from the editor).
|
|
21
|
+
- `ENTITY_CATALOG_ID` (const): const ENTITY_CATALOG_ID: "entities" — Well-known catalog id for authored entity definitions. A `mob`/`boss` marker's `catalogId` references an entry (row) in this catalog, and {@link entityEntryFromCatalog} turns that row into the runtime {@link GameContextEntityEntry} a spawn consumes — so an entity's stats and speed are authored in the editor Data tab, not hardcoded in game TS.
|
|
17
22
|
- `EditorCatalogData` (interface): interface EditorCatalogData — Persisted values for one gameplay data catalog (weapons, waves, economy, …). Schemas are not stored here — they come from the game's `editorCatalogs` export and drive SchemaInspector.
|
|
18
23
|
- `EditorCatalogDefinition` (interface): interface EditorCatalogDefinition — Game-exported catalog definition: a `ParamSchema` plus default entries. Schemas stay in code; entry values merge into `document.catalogs` and are what the editor/RPC edits and saves.
|
|
19
24
|
- `EditorCatalogEntry` (interface): interface EditorCatalogEntry — One row in a gameplay data catalog — id + optional label + a meta bag matching the catalog's `ParamSchema`. Values persist on the scene document; the schema lives in the game export.
|
|
20
25
|
- `EditorCatalogsInput` (type): type EditorCatalogsInput = | readonly EditorCatalogDefinition[] | (() => readonly EditorCatalogDefinition[]) — Accepted shape for a game's `editorCatalogs` export: definitions, or a factory.
|
|
21
26
|
- `EditorCollection` (interface): interface EditorCollection — A named, persisted list of object ids — a selection bookmark (restore, add-to) that can also double as a production group: `locked` blocks `translate`/`setTransform`/`remove`/`removeMany` on its members, `color`/`visible` are UI-only hints for the collections panel.
|
|
22
27
|
- `EditorCommand` (type): type EditorCommand = | { type: "select"; ids: readonly string[] } | { type: "clearSelection" } | { type: "setTransform"; id: string; position?: EditorVec3; rotationY?: number } | { type: "translate"; ids: readonly string[]; delta: EditorVec3 } | { type: "setParent"; ids: readonly string[]; parentId:… — A single editor mutation — select, move, add, remove, undo/redo — dispatched to a session.
|
|
28
|
+
- `EditorDirective` (type): type EditorDirective = EditorScatterDirective | EditorPopulationDirective — A procedural directive on the scene document: scatter props or a mob population.
|
|
29
|
+
- `EditorDirectiveArea` (interface): interface EditorDirectiveArea — XZ world-space bounds, `[minX, minZ]`..`[maxX, maxZ]`, for a directive that names no region.
|
|
30
|
+
- `EditorDirectiveKind` (type): type EditorDirectiveKind = EditorDirective["kind"] — The distinct directive kinds a materializer expands.
|
|
31
|
+
- `EditorDirectiveOverlay` (interface): interface EditorDirectiveOverlay — A sparse overlay over one directive's materialized instances — the "nudge *that one* rock" answer. Hand-edits are keyed by the stable instance id the materializer mints, so they survive re-bakes.
|
|
23
32
|
- `EditorDispatchOptions` (interface): interface EditorDispatchOptions — Per-dispatch options; `coalesce` merges consecutive same-key edits into one undo step.
|
|
24
33
|
- `EditorDocument` (interface): interface EditorDocument — The full authored scene: every marker, volume, path, note, and sculpted terrain for a game.
|
|
34
|
+
- `EditorEnvironment` (interface): interface EditorEnvironment — Scene-document environment/lighting authoring (#1110): sky preset, optional time-of-day drive, horizon/zenith tints, sun/ambient intensity, and fog. Serializable and genre-agnostic — games feed it into `environment({ sky: sky(skyFromDocument(doc)) })` (or leave world.ts sky as a fallback when the field is absent). Absent until the lighting workspace (or a seed layer) writes it, so existing documents load unchanged.
|
|
35
|
+
- `EditorFogConfig` (interface): interface EditorFogConfig — Linear distance fog authored on the scene document — serializable subset of sky/backdrop fog. Absent fields keep engine defaults when the document is applied at runtime.
|
|
25
36
|
- `EditorFragmentContent` (interface): interface EditorFragmentContent — The four placeable-object collections a prefab fragment or clipboard fragment carries.
|
|
26
37
|
- `EditorGridAxes` (type): type EditorGridAxes = "xz" | "xy" — How a grid layer's columns and rows map onto world axes. - `"xz"` (default): columns advance +X, rows advance +Z — a top-down floor plan / board. - `"xy"`: columns advance +X, rows advance +Y — a vertical slice / side-view board.
|
|
27
38
|
- `EditorGridCell` (interface): interface EditorGridCell — One resolved cell of a grid layer — its column, row, and value id.
|
|
@@ -31,19 +42,28 @@
|
|
|
31
42
|
- `EditorKindVisibility` (interface): interface EditorKindVisibility — Per-kind show/hide flags for the editor's layer panel.
|
|
32
43
|
- `EditorLayersInput` (type): type EditorLayersInput = | EditorDocument | Partial<Omit<EditorDocument, "version">> | (() => EditorDocument | Partial<Omit<EditorDocument, "version">>) — Accepted shape for a game's `editorLayers` export: a document, partial data, or a factory.
|
|
33
44
|
- `EditorMarker` (interface): interface EditorMarker — A placeable point object in the scene — spawn, mob, chest, POI, etc.
|
|
45
|
+
- `EditorMinimapBake` (interface): interface EditorMinimapBake — A baked top-down minimap stored on the scene document (#1036): the PNG the editor rasterized from the authored terrain (a `data:image/png;base64,…` URI) plus the world bounds it spans. Runtime feeds these straight into the `Minimap`/`WorldMap` `background`/`mapBounds` props — no re-raster.
|
|
34
46
|
- `EditorNote` (interface): interface EditorNote — A free-text annotation pinned to a world position for designers.
|
|
35
47
|
- `EditorPath` (interface): interface EditorPath — A polyline of points — road, corridor, patrol route — placed in the scene.
|
|
48
|
+
- `EditorPopulationDirective` (interface): interface EditorPopulationDirective extends EditorDirectiveBase — Populates a region with weighted, capped mob spawns — config for `ai/populationDirector`.
|
|
49
|
+
- `EditorPopulationSpecies` (interface): interface EditorPopulationSpecies — One weighted species in a population directive, with a hard instance cap.
|
|
36
50
|
- `EditorPrefab` (interface): interface EditorPrefab — A serializable, reusable stamp of authored objects — markers/volumes/paths/notes centered on their own centroid so the same prefab inserts consistently anywhere, in this scene or another game's. `insertPrefab` tags every inserted object's `meta.prefabId`/`meta.prefabInstanceId`; `detachPrefabInstance` strips those tags to break the link without touching the content.
|
|
51
|
+
- `EditorScatterDirective` (interface): interface EditorScatterDirective extends EditorDirectiveBase — Scatters catalog props (rocks/trees/foliage) across a region — feeds the existing scatter system.
|
|
37
52
|
- `EditorSession` (interface): interface EditorSession — Stateful, undoable handle for driving scene edits from UI or an MCP agent.
|
|
38
53
|
- `EditorSessionState` (interface): interface EditorSessionState — The document plus current selection at a point in editor history.
|
|
54
|
+
- `EditorSkyPreset` (type): type EditorSkyPreset = "day" | "dusk" | "night" — Named sky look stored on the scene document; matches runtime `SkyEnvironmentConfig.preset`.
|
|
39
55
|
- `EditorTerrain` (type): type EditorTerrain = TerraformSnapshot — A sculpted heightfield authored in the editor: the {@link TerraformSnapshot} of offset deltas over the game's base ground. Serializes with the scene; a game rebuilds the field with `editableTerrainFromSnapshot`.
|
|
40
56
|
- `EditorUiDocument` (interface): interface EditorUiDocument — Scene-document HUD section: panel id → layout. Single source of truth for placement.
|
|
41
57
|
- `EditorUiPanelLayout` (interface): interface EditorUiPanelLayout — Authored layout for one HUD panel inside `editor.scene.json` → `ui.panels`.
|
|
42
58
|
- `EditorVec3` (type): type EditorVec3 = { x: number; y: number; z: number } — A world-space point used across editor markers, volumes, and paths.
|
|
43
59
|
- `EditorVolume` (interface): interface EditorVolume — A spatial region — zone, aggro range, capture area — placed in the scene.
|
|
44
60
|
- `EditorVolumeShape` (type): type EditorVolumeShape = "sphere" | "cylinder" | "box" — Collision shape a volume is rendered and tested as.
|
|
61
|
+
- `EntityCatalogDocumentLike` (interface): interface EntityCatalogDocumentLike — Minimal document shape {@link entityEntryFromCatalog} reads — any `EditorDocument` satisfies it.
|
|
62
|
+
- `EnvironmentContent` (interface): interface EnvironmentContent — The coordinate/placement content of a world, derived from its scene document.
|
|
63
|
+
- `EnvironmentContentOptions` (interface): interface EnvironmentContentOptions extends ClearanceOptions — World-authoring convergence (#1018, epic #1006 Phase 4): derive the **coordinate/placement** content of an `environment()` world from the scene document, so a game with an authored document needs no coordinate arrays in `world.ts` — the remaining `world.ts` surface is engine tuning (noise, materials, sky preset, physics). Terrain footprint follows the authored objects, ground clearings come from authored spawns/POIs (`clearanceZonesFrom`), and the sculpt snapshot is the document's own terrain overlay. Pure and serializable; consumers pass the result straight to `environment({ terrain: terrain({ bounds }), clearings, sculpt })`.
|
|
45
64
|
- `HudPanelTypeDef` (interface): interface HudPanelTypeDef — Declared panel type: growable axes, size limits, optional ParamSchema for the editor.
|
|
46
65
|
- `HudResizeAxes` (type): type HudResizeAxes = "none" | "x" | "y" | "both" — Which axes a panel type may grow when resized in canvas mode. Resize is semantic — content reflows (longer track, more rows) — never a CSS scale of the whole panel.
|
|
66
|
+
- `MaterializedInstance` (interface): interface MaterializedInstance — The deterministic materializer for scene {@link EditorDirective}s — the bake side of the bake/patch seam in #985. A directive is one authored line ("scatter rocks across the north ridge"); this expands it into many placements with **stable per-instance ids** (`<directiveId># <index>`) so a sparse overlay can hand-tweak or delete individual instances by id without every re-materialize orphaning those edits. Fully deterministic: same directive + seed + region ⇒ the same field, every time (safe for verify/CI). Built on the existing `scatter` primitive.
|
|
47
67
|
- `RuntimeEntityState` (interface): interface RuntimeEntityState — One live entity row the runtime may stream to the editor (play-mode inspector feed).
|
|
48
68
|
- `RuntimeInspectorGetResult` (interface): interface RuntimeInspectorGetResult — One resolved runtime field returned by `runtime_get`.
|
|
49
69
|
- `RuntimeInspectorSetPlan` (interface): interface RuntimeInspectorSetPlan — Desired mutation from `runtime_set` before the host applies it.
|
|
@@ -51,19 +71,44 @@
|
|
|
51
71
|
- `RuntimePlayControl` (interface): interface RuntimePlayControl — Play-mode sim gate held by the editor host — pause freezes ticks; step runs N frames then re-pauses.
|
|
52
72
|
- `RuntimeStateDelta` (interface): interface RuntimeStateDelta — Incremental runtime state for the reverse channel. Entity rows upsert by id; `removeIds` drop rows; `tunables` shallow-merge. Ephemeral unless written back as a document patch.
|
|
53
73
|
- `RuntimeStateSnapshot` (interface): interface RuntimeStateSnapshot — Full ephemeral runtime view held on the reverse channel — never mutates the document.
|
|
74
|
+
- `SplitWorldOptions` (interface): interface SplitWorldOptions — Options controlling how a monolithic document is partitioned into shards.
|
|
75
|
+
- `SplitWorldResult` (interface): interface SplitWorldResult — The result of splitting a document: a manifest plus the shard documents keyed by their file path.
|
|
76
|
+
- `StreamUpdate` (interface): interface StreamUpdate — The residency change produced by one {@link WorldStreamer.update}.
|
|
77
|
+
- `StreamerShard` (interface): interface StreamerShard — The proximity streamer for a sharded world (#985 stage 3): a stateful scheduler that decides, as the camera moves, which shards enter and leave residency. It is pure scheduling — actually reading/merging the shard documents stays the caller's job (compose with `@jgengine/core/editor/world`'s `loadWorldDocument` on each returned delta) — so the streamer has no I/O and stays deterministic and testable. Hysteresis (`loadRadius` < `keepRadius`) stops a shard on a boundary from thrashing load/unload every frame.
|
|
54
78
|
- `WELL_KNOWN_MARKER_KINDS` (const): const WELL_KNOWN_MARKER_KINDS: readonly ["player_spawn", "mob", "boss", "vendor", "chest", "travel", "npc", "poi", "prop", "goal", "branch"] — Standard marker kinds recognized with default colors and behavior.
|
|
55
79
|
- `WELL_KNOWN_PATH_KINDS` (const): const WELL_KNOWN_PATH_KINDS: readonly ["road", "corridor", "branch", "route"] — Standard path kinds recognized with default colors and behavior.
|
|
56
80
|
- `WELL_KNOWN_VOLUME_KINDS` (const): const WELL_KNOWN_VOLUME_KINDS: readonly ["zone", "flatten", "cluster", "aggro", "leash", "discover", "capture", "prompt", "poi", "respawn_skip"] — Standard volume kinds recognized with default colors and behavior.
|
|
81
|
+
- `WORLD_BASE_SHARD_ID` (const): const WORLD_BASE_SHARD_ID: "base" — The always-resident base shard id used by {@link splitEditorDocumentIntoShards}.
|
|
82
|
+
- `WORLD_MANIFEST_KIND` (const): const WORLD_MANIFEST_KIND: "world" — A sharded **world**: a scene that is no longer one monolithic `editor.scene.json` but a manifest plus spatially-partitioned shard documents. A single-file game is the degenerate one-shard case, so nothing pays for scale it does not have. The shard/overlay documents are the exact {@link EditorDocument} format loaders already consume — this module is composition over `mergeEditorDocuments` / `extractEditorFragment` / `editorDocumentBounds`, not a new format.
|
|
83
|
+
- `WorldGrid` (interface): interface WorldGrid — The world grid the shards partition space on.
|
|
84
|
+
- `WorldManifest` (interface): interface WorldManifest — A world manifest — the `world.json` at the root of a world folder.
|
|
85
|
+
- `WorldManifestShard` (interface): interface WorldManifestShard — One entry in a world manifest: a shard document, its footprint, residency, and optional overlay.
|
|
86
|
+
- `WorldQuery` (interface): interface WorldQuery — A spatial query used to select which shards a neighborhood needs.
|
|
87
|
+
- `WorldShardBounds` (interface): interface WorldShardBounds — A shard's XZ world-space footprint, `[minX, minZ]`..`[maxX, maxZ]`, used to route/stream loads.
|
|
88
|
+
- `WorldShardResidency` (type): type WorldShardResidency = "always" | "streamed" — Whether a shard is always loaded (terrain, always-resident hero content) or streamed by proximity.
|
|
89
|
+
- `WorldShardResolver` (type): type WorldShardResolver = (file: string) => EditorDocument | null — Resolves a shard/overlay file path to a decoded document, or null when it cannot be read.
|
|
90
|
+
- `WorldStreamer` (interface): interface WorldStreamer — A stateful proximity streamer over a fixed shard set.
|
|
91
|
+
- `WorldStreamerConfig` (interface): interface WorldStreamerConfig — Configuration for {@link createWorldStreamer}.
|
|
92
|
+
- `WorldStreamingConfig` (interface): interface WorldStreamingConfig — Proximity streaming radii, in meters.
|
|
93
|
+
- `applyDirectiveOverlay` (function): function applyDirectiveOverlay(instances: readonly MaterializedInstance[], overlay: EditorDirectiveOverlay): MaterializedInstance[] — Applies a directive overlay to its materialized instances: patched fields override, `deleted` drops the instance. Instances with no patch pass through untouched.
|
|
57
94
|
- `applyDocumentPatch` (function): function applyDocumentPatch(document: EditorDocument, revision: number, patch: DocumentPatch, options?: { force?: boolean }): ApplyDocumentPatchResult — Applies a versioned document patch. Rejects base-revision mismatches unless `force` (document is authoritative — the editor forces when publishing its own session state).
|
|
58
95
|
- `applyRuntimeStateDelta` (function): function applyRuntimeStateDelta(snapshot: RuntimeStateSnapshot, delta: Omit<RuntimeStateDelta, "seq"> & { seq?: number }): { snapshot: RuntimeStateSnapshot; delta: RuntimeStateDelta } — Merges a runtime delta into a snapshot without touching the scene document — runtime overrides stay ephemeral until an explicit write-back produces a document patch.
|
|
96
|
+
- `bakeMinimapFromDocument` (function): function bakeMinimapFromDocument(doc: EditorDocument, sampleHeight: (x: number, z: number) => number, options: DocumentBakeOptions = {}): { background: string; mapBounds: MinimapBakeBounds } — Bakes a minimap image from a scene document plus a terrain height sampler: sizes the footprint to the authored objects (or an explicit `bounds`), tints biome-colored volumes, and rasterizes the terrain top-down. Returns `{ background, mapBounds }` for the `Minimap` props. The editor runs this as its bake action and stores the result on the document.
|
|
59
97
|
- `cloneGridLayer` (function): function cloneGridLayer(layer: EditorGridLayer): EditorGridLayer — Deep-clones a grid layer so authoring edits and history snapshots never alias source cells.
|
|
60
98
|
- `consumeRuntimePlayStep` (function): function consumeRuntimePlayStep(play: RuntimePlayControl): { runFrame: boolean; next: RuntimePlayControl; } — Advances the play-control step counter: when paused with pending steps, consumes one and reports whether the sim should run this frame. When not paused, always runs.
|
|
61
99
|
- `createDocumentLiveSync` (function): function createDocumentLiveSync(initial: EditorDocument): DocumentLiveSync — Creates an in-memory two-way live-sync bus seeded from an initial document. Document is authoritative; runtime overrides are ephemeral until {@link DocumentLiveSync.writeBackOverride}.
|
|
62
100
|
- `createGridLayer` (function): function createGridLayer(init: CreateGridLayerInit): EditorGridLayer — Creates a grid layer from a partial init, defaulting cell size to `1`, origin to the world origin, and axes to `"xz"`. Runs the result through {@link migrateGridLayer} so it is normalized and bounds-clean.
|
|
63
101
|
- `createRuntimePlayControl` (function): function createRuntimePlayControl(paused = false): RuntimePlayControl — Default play-control state when entering play mode (running).
|
|
102
|
+
- `createWorldStreamer` (function): function createWorldStreamer(config: WorldStreamerConfig): WorldStreamer — Creates a proximity streamer over a world's shards. Always-resident shards are resident from the first update onward; each bounded shard loads when the camera comes within `loadRadius` of its footprint and unloads only once the camera passes `keepRadius` (≥ `loadRadius`, clamped up), giving a hysteresis band that prevents boundary thrash. Purely spatial and deterministic; the caller wires each delta to `loadWorldDocument`.
|
|
103
|
+
- `decodeWorldManifest` (function): function decodeWorldManifest(raw: unknown): DecodeWorldManifestResult — The authoritative decoder for a `world.json` manifest arriving from disk or an agent: validates `kind`, the shard list, and each shard's fields with a path-specific diagnostic on failure, so a malformed manifest fails loudly at the boundary instead of streaming a broken world.
|
|
104
|
+
- `documentBakeZones` (function): function documentBakeZones(doc: EditorDocument): MinimapBakeZone[] — The biome-tint zones a document contributes to a bake: every volume carrying a `color` becomes a polygon tint over its footprint. (The optional stretch from #1036 — a bare bake still reads as terrain without any.)
|
|
105
|
+
- `entityDefinitionSchema` (const): const entityDefinitionSchema: ParamSchema — The default {@link ParamSchema} for an authored entity definition — role, health, movement speed, and visual scale. Drives the editor Data-tab inspector for the `entities` catalog and is the shape {@link entityEntryFromCatalog} reads. A game exports it as an `editorCatalogs` schema; the scaffold ships a starter one so the tab is never empty.
|
|
106
|
+
- `entityEntryFromCatalog` (function): function entityEntryFromCatalog(document: EntityCatalogDocumentLike, entityId: string, definitions?: readonly EditorCatalogDefinition[]): GameContextEntityEntry | null — Turns an authored entity row into the runtime {@link GameContextEntityEntry} a spawn consumes: looks up `entityId` in the document's {@link ENTITY_CATALOG_ID} catalog (falling back to the game-exported `definitions` defaults), parses it against {@link entityDefinitionSchema}, and maps the fields onto stats/movement/role. Returns `null` when no row defines the entity, so the default `content.ts` path can chain other resolvers. The single seam that makes "place a mob, tune its stats/speed in the editor, save — it spawns with those stats" work with zero game code.
|
|
107
|
+
- `environmentContentFromDocument` (function): function environmentContentFromDocument(doc: EditorDocument, options: EnvironmentContentOptions = {}): EnvironmentContent — Derives the coordinate/placement content of an `environment()` world from its scene document: terrain footprint (via {@link terrainBoundsFromDocument}), ground clearings under authored spawns/POIs (via `clearanceZonesFrom`), and the document's sculpt snapshot. This is the seam that lets a game author its world footprint and flatten regions in the editor instead of hardcoding them — the `world.ts` that consumes it carries only engine tuning.
|
|
64
108
|
- `eraseGridCell` (function): function eraseGridCell(layer: EditorGridLayer, col: number, row: number): EditorGridLayer — Erases `col,row` back to the layer's empty value — {@link setGridCell} with the empty value.
|
|
65
109
|
- `exportAsciiGrid` (function): function exportAsciiGrid(layer: EditorGridLayer, options: AsciiGridExportOptions = {}): string — Renders a grid layer back to an ASCII/glyph map (rows top to bottom). Value ids map to chars via the layer palette (or an override map); empty cells become `emptyGlyph`. Round-trips with {@link importAsciiGrid} when the glyph legend matches.
|
|
66
110
|
- `exportCsvGrid` (function): function exportCsvGrid(layer: EditorGridLayer, options: CsvGridExportOptions = {}): string — Renders a grid layer as CSV — one row per line, each cell's value id as a field, empty cells as `emptyField`. Round-trips with {@link importCsvGrid}.
|
|
111
|
+
- `exportWorldManifestJson` (function): function exportWorldManifestJson(manifest: WorldManifest, pretty = true): string — Serializes a world manifest to pretty JSON for writing `world.json`.
|
|
67
112
|
- `eyedropGridCell` (function): function eyedropGridCell(layer: EditorGridLayer, col: number, row: number): string — Samples the value id at `col,row` — the eyedropper. Identical to {@link getGridCell}, named for the authoring op that picks up a cell's value to paint with.
|
|
68
113
|
- `fillGridRect` (function): function fillGridRect(layer: EditorGridLayer, col0: number, row0: number, col1: number, row1: number, value: string): EditorGridLayer — Fills the inclusive rectangle spanning the two corners with `value` (the rectangle tool). Corners may be given in any order; the clamped in-bounds portion is painted.
|
|
69
114
|
- `findEditorCatalog` (function): function findEditorCatalog(doc: EditorDocument, id: string): EditorCatalogData | undefined — Looks up a gameplay data catalog by id on the scene document.
|
|
@@ -85,17 +130,31 @@
|
|
|
85
130
|
- `importCsvGrid` (function): function importCsvGrid(text: string, options: CsvGridImportOptions): EditorGridLayer — Parses a CSV grid — one row per line, one value id per comma-separated field — into a grid layer. Blank fields become the empty value. Unlike ASCII this carries multi-character value ids directly, so it suits grids whose cell values are names rather than single glyphs.
|
|
86
131
|
- `inGridBounds` (function): function inGridBounds(layer: EditorGridLayer, col: number, row: number): boolean — True when `col,row` falls inside the layer's declared bounds.
|
|
87
132
|
- `installDocumentLiveSync` (function): function installDocumentLiveSync(sync: DocumentLiveSync): () => void — Publishes a live-sync bus globally so AuthoredScene / games can subscribe without prop drilling.
|
|
133
|
+
- `loadWorldDocument` (function): function loadWorldDocument(manifest: WorldManifest, resolve: WorldShardResolver, query?: WorldQuery): EditorDocument — Loads the live neighborhood document for a query: reads each selected shard through `resolve`, applies its overlay (if any) on top, then merges them into one {@link EditorDocument} downstream consumers (`placeAuthoredObjects`, `collectAuthoredTriggers`, scatter, …) read unchanged. The monolith becomes an internal detail of the loader; a one-shard world yields exactly that shard.
|
|
134
|
+
- `materializeDirective` (function): function materializeDirective(doc: EditorDocument, directive: EditorDirective): MaterializedInstance[] — Materializes one directive against a document, resolving its footprint first. Returns an empty list when the region does not resolve.
|
|
135
|
+
- `materializeDirectives` (function): function materializeDirectives(doc: EditorDocument, overlays?: readonly EditorDirectiveOverlay[]): MaterializedInstance[] — Materializes every directive on a document into one flat instance list, applying each directive's overlay (matched by `over` === directive id) as it goes. The bulk-content counterpart to `resolveAuthoredObjects` / `resolveScatter`: games and headless tests read the same list.
|
|
136
|
+
- `materializePopulationDirective` (function): function materializePopulationDirective(directive: EditorPopulationDirective, footprint: DirectiveFootprint): MaterializedInstance[] — Materializes a population directive into deterministic mob spawn placements: at most `cap` of each weighted species, distributed across the footprint. Each placement carries a stable id and its species id in `asset`, ready to feed `ctx.scene.entity.spawn` / `ai/populationDirector`.
|
|
137
|
+
- `materializeScatterDirective` (function): function materializeScatterDirective(directive: EditorScatterDirective, footprint: DirectiveFootprint): MaterializedInstance[] — Materializes a scatter directive into deterministic catalog-prop placements across its footprint, clipped to the region polygon when one is present. Per-instance scale and yaw derive from the directive id + seed + point index, so ids are stable across re-materializes.
|
|
88
138
|
- `migrateGridLayer` (function): function migrateGridLayer(layer: EditorGridLayer): EditorGridLayer — Normalizes a grid layer forward to the current cell-schema version: clamps `cols`/`rows` to non-negative integers, drops out-of-bounds and empty-valued cells, and stamps `schemaVersion`. The single migration seam every loader and authoring op funnels new/old layers through, so a layer from an older document or an import adapter always lands in a valid, minimal shape.
|
|
89
139
|
- `paintGridCells` (function): function paintGridCells(layer: EditorGridLayer, edits: readonly EditorGridCellEdit[]): EditorGridLayer — Applies a batch of cell edits in one pass, returning the same layer when nothing changed. The op the editor uses for a drag stroke, a paste, or any multi-cell paint/erase.
|
|
90
140
|
- `parseGridCellKey` (function): function parseGridCellKey(key: string): { col: number; row: number } | null — Parses a `"col,row"` sparse-map key back into integer coordinates, or `null` when malformed.
|
|
91
141
|
- `planRuntimeInspectorSet` (function): function planRuntimeInspectorSet(document: EditorDocument, input: { id: string; path?: string; value?: unknown; position?: { x: number; y: number; z: number }; rotationY?: number; values?: Record<string, unknown>; writeBack?: boolean; }): RuntimeInspectorSetPlan — Plans a play-mode poke: builds the ephemeral entity/tunable override and, when `writeBack` is true, the undoable document commands that promote it into the scene document.
|
|
92
142
|
- `resizeGridLayer` (function): function resizeGridLayer(layer: EditorGridLayer, cols: number, rows: number): EditorGridLayer — Resizes the layer's bounds to `cols`×`rows`, dropping any cells that fall outside the new extent (values are anchored at the origin corner). Negative or fractional sizes are floored to `≥ 0`.
|
|
143
|
+
- `resolveCatalogDefinitions` (function): function resolveCatalogDefinitions(document: EntityCatalogDocumentLike, gameDefinitions: readonly EditorCatalogDefinition[]): EditorCatalogDefinition[] — Merges game-exported catalog definitions with editor-authored ones carried on the scene document. A document catalog that carries its own `schema` and has no matching game definition is synthesized into a full {@link EditorCatalogDefinition} (label falls back to the id) so the Data panel, the `list_catalogs` RPC, and the count all see it. A game definition always wins on id collision — its schema lives in code and is authoritative. Document catalogs without a schema (plain value bags for a game-declared catalog) are ignored here; they are addressed through their game definition.
|
|
144
|
+
- `resolveDirectiveFootprint` (function): function resolveDirectiveFootprint(doc: EditorDocument, directive: EditorDirective): DirectiveFootprint | null — Resolves the footprint a directive fills: an explicit `area`, else the footprint of the named `region` — a scatter/closed path (as a clip polygon) or a volume (its XZ AABB). Null when neither is present or the region id does not resolve.
|
|
93
145
|
- `runtimeEntityMetaWriteBackCommand` (function): function runtimeEntityMetaWriteBackCommand(document: EditorDocument, entity: RuntimeEntityState): EditorCommand | null — Promotes ephemeral runtime `values` into an undoable meta patch on a document-linked object. Returns null when the id is not in the document or there are no values.
|
|
94
146
|
- `runtimeEntityWriteBackCommand` (function): function runtimeEntityWriteBackCommand(document: EditorDocument, entity: RuntimeEntityState): EditorCommand | null — Builds an undoable document command from an ephemeral runtime entity row (write-back). Returns null when there is nothing to promote. Does not mutate document or clear the override — the caller dispatches the command and then clears the override.
|
|
95
147
|
- `seedEditorCatalogs` (function): function seedEditorCatalogs(doc: EditorDocument, definitions: readonly EditorCatalogDefinition[]): EditorDocument — Seeds default catalog rows from game-exported definitions into a document: missing catalogs and missing entries are filled from the definition; existing document values win (overlay already applied).
|
|
148
|
+
- `selectWorldShards` (function): function selectWorldShards(manifest: WorldManifest, query?: WorldQuery): WorldManifestShard[] — The shards a query needs — always-resident shards plus every bounded shard whose footprint the query disc overlaps, in manifest order. With no query every shard is selected (load the planet), so a one-shard game and an unqueried load behave exactly as a monolithic document does today.
|
|
96
149
|
- `setGridCell` (function): function setGridCell(layer: EditorGridLayer, col: number, row: number, value: string): EditorGridLayer — Returns a copy of the layer with `col,row` set to `value`, dropping the cell when `value` is the empty value (that is the erase op). Out-of-bounds writes and no-op writes return the layer unchanged, so callers can diff by identity.
|
|
150
|
+
- `shardDistance` (function): function shardDistance(shard: StreamerShard, center: { x: number; z: number }): number — Distance from a point to a shard's XZ footprint (0 when inside), or 0 for an always-resident shard.
|
|
151
|
+
- `shardMatchesQuery` (function): function shardMatchesQuery(shard: WorldManifestShard, query: WorldQuery): boolean — True when a shard should be resident for a query: always-resident shards always, bounded shards only when the query disc (`center` ± `radius`) overlaps their footprint.
|
|
152
|
+
- `singleShardWorldManifest` (function): function singleShardWorldManifest(file: string, shardId = WORLD_BASE_SHARD_ID): WorldManifest — The backward-compatible degenerate manifest: one always-resident shard pointing at a single scene document file. `loadWorldDocument(singleShardWorldManifest(file), resolve)` returns exactly that document — the migration path for a game that has one `editor.scene.json` and wants the world API without sharding yet.
|
|
153
|
+
- `skyFromDocument` (function): function skyFromDocument(doc: EditorDocument): SkyEnvironmentConfig | undefined — Maps the scene document's serializable environment bag onto the runtime sky config consumed by `sky()` / `environment({ sky })`. Returns `undefined` when the document has no environment field so callers can fall back to a world.ts default without inventing values.
|
|
154
|
+
- `splitEditorDocumentIntoShards` (function): function splitEditorDocumentIntoShards(doc: EditorDocument, options: SplitWorldOptions = {}): SplitWorldResult — Splits a monolithic document into a sharded world: placeable objects (markers, volumes, paths, notes) are bucketed into `cellSize`-meter grid cells by a representative point and extracted into per-cell shard documents; the non-placeable extras (terrain, catalogs, prefabs, collections, grids, HUD layout) go into one always-resident `base` shard. Round-trips through {@link loadWorldDocument} to the same object set — the reverse of monolith authoring, so a large scene can be sharded once and streamed thereafter. Cell shards carry their exact object footprint as bounds; empty cells are omitted; order is deterministic (row-major by grid coordinate).
|
|
97
155
|
- `subscribeDocumentLiveSyncInstall` (function): function subscribeDocumentLiveSyncInstall(listener: () => void): () => void — Subscribe to install/uninstall of the global live-sync bus (AuthoredScene re-attaches when the editor host mounts over a running game).
|
|
98
156
|
- `summarizeRuntimeInspector` (function): function summarizeRuntimeInspector(snapshot: RuntimeStateSnapshot, overrides: Readonly<Record<string, RuntimeEntityState>>, play: RuntimePlayControl): RuntimeInspectorSummary — Builds the compact reverse-channel summary used by the play-mode inspector panel and the `runtime_summary` bridge RPC.
|
|
157
|
+
- `terrainBoundsFromDocument` (function): function terrainBoundsFromDocument(doc: EditorDocument, options: EnvironmentContentOptions = {}): WorldBounds — The origin-centered terrain footprint that covers every authored object in a document, padded and floored to `minBounds`. An empty document yields exactly `minBounds`. Because `environment()` terrain is centered on the origin, the footprint is sized symmetrically to the farthest object on each axis, so no authored object falls off the ground.
|
|
99
158
|
- `worldToGridCell` (function): function worldToGridCell(layer: EditorGridLayer, x: number, y: number, z: number): { col: number; row: number } — Inverse of {@link gridCellToWorld}: the nearest cell to a world point (may be out of bounds). The shared world→cell map runtime uses to answer "which cell is the player standing on".
|
|
100
159
|
|
|
101
160
|
## @jgengine/core/editor/commands
|
|
@@ -105,12 +164,42 @@
|
|
|
105
164
|
- `EditorSession` (interface): interface EditorSession — Stateful, undoable handle for driving scene edits from UI or an MCP agent.
|
|
106
165
|
- `EditorSessionState` (interface): interface EditorSessionState — The document plus current selection at a point in editor history.
|
|
107
166
|
|
|
167
|
+
## @jgengine/core/editor/directives
|
|
168
|
+
|
|
169
|
+
- `DirectiveFootprint` (interface): interface DirectiveFootprint — A resolved directive footprint: the XZ bounds to scatter within, plus an optional clip polygon.
|
|
170
|
+
- `DirectiveInstancePatch` (interface): interface DirectiveInstancePatch — A per-instance hand-tweak over a materialized directive, keyed by the minted instance id.
|
|
171
|
+
- `EditorDirectiveOverlay` (interface): interface EditorDirectiveOverlay — A sparse overlay over one directive's materialized instances — the "nudge *that one* rock" answer. Hand-edits are keyed by the stable instance id the materializer mints, so they survive re-bakes.
|
|
172
|
+
- `MaterializedInstance` (interface): interface MaterializedInstance — The deterministic materializer for scene {@link EditorDirective}s — the bake side of the bake/patch seam in #985. A directive is one authored line ("scatter rocks across the north ridge"); this expands it into many placements with **stable per-instance ids** (`<directiveId># <index>`) so a sparse overlay can hand-tweak or delete individual instances by id without every re-materialize orphaning those edits. Fully deterministic: same directive + seed + region ⇒ the same field, every time (safe for verify/CI). Built on the existing `scatter` primitive.
|
|
173
|
+
- `applyDirectiveOverlay` (function): function applyDirectiveOverlay(instances: readonly MaterializedInstance[], overlay: EditorDirectiveOverlay): MaterializedInstance[] — Applies a directive overlay to its materialized instances: patched fields override, `deleted` drops the instance. Instances with no patch pass through untouched.
|
|
174
|
+
- `materializeDirective` (function): function materializeDirective(doc: EditorDocument, directive: EditorDirective): MaterializedInstance[] — Materializes one directive against a document, resolving its footprint first. Returns an empty list when the region does not resolve.
|
|
175
|
+
- `materializeDirectives` (function): function materializeDirectives(doc: EditorDocument, overlays?: readonly EditorDirectiveOverlay[]): MaterializedInstance[] — Materializes every directive on a document into one flat instance list, applying each directive's overlay (matched by `over` === directive id) as it goes. The bulk-content counterpart to `resolveAuthoredObjects` / `resolveScatter`: games and headless tests read the same list.
|
|
176
|
+
- `materializePopulationDirective` (function): function materializePopulationDirective(directive: EditorPopulationDirective, footprint: DirectiveFootprint): MaterializedInstance[] — Materializes a population directive into deterministic mob spawn placements: at most `cap` of each weighted species, distributed across the footprint. Each placement carries a stable id and its species id in `asset`, ready to feed `ctx.scene.entity.spawn` / `ai/populationDirector`.
|
|
177
|
+
- `materializeScatterDirective` (function): function materializeScatterDirective(directive: EditorScatterDirective, footprint: DirectiveFootprint): MaterializedInstance[] — Materializes a scatter directive into deterministic catalog-prop placements across its footprint, clipped to the region polygon when one is present. Per-instance scale and yaw derive from the directive id + seed + point index, so ids are stable across re-materializes.
|
|
178
|
+
- `resolveDirectiveFootprint` (function): function resolveDirectiveFootprint(doc: EditorDocument, directive: EditorDirective): DirectiveFootprint | null — Resolves the footprint a directive fills: an explicit `area`, else the footprint of the named `region` — a scatter/closed path (as a clip polygon) or a volume (its XZ AABB). Null when neither is present or the region id does not resolve.
|
|
179
|
+
|
|
108
180
|
## @jgengine/core/editor/document
|
|
109
181
|
|
|
110
182
|
- `findEditorCatalog` (function): function findEditorCatalog(doc: EditorDocument, id: string): EditorCatalogData | undefined — Looks up a gameplay data catalog by id on the scene document.
|
|
111
183
|
- `findEditorCatalogEntry` (function): function findEditorCatalogEntry(doc: EditorDocument, catalogId: string, entryId: string): EditorCatalogEntry | undefined — Looks up one entry inside a gameplay data catalog.
|
|
112
184
|
- `seedEditorCatalogs` (function): function seedEditorCatalogs(doc: EditorDocument, definitions: readonly EditorCatalogDefinition[]): EditorDocument — Seeds default catalog rows from game-exported definitions into a document: missing catalogs and missing entries are filled from the definition; existing document values win (overlay already applied).
|
|
113
185
|
|
|
186
|
+
## @jgengine/core/editor/entityCatalog
|
|
187
|
+
|
|
188
|
+
- `ENTITY_CATALOG_ID` (const): const ENTITY_CATALOG_ID: "entities" — Well-known catalog id for authored entity definitions. A `mob`/`boss` marker's `catalogId` references an entry (row) in this catalog, and {@link entityEntryFromCatalog} turns that row into the runtime {@link GameContextEntityEntry} a spawn consumes — so an entity's stats and speed are authored in the editor Data tab, not hardcoded in game TS.
|
|
189
|
+
- `EntityCatalogDocumentLike` (interface): interface EntityCatalogDocumentLike — Minimal document shape {@link entityEntryFromCatalog} reads — any `EditorDocument` satisfies it.
|
|
190
|
+
- `entityDefinitionSchema` (const): const entityDefinitionSchema: ParamSchema — The default {@link ParamSchema} for an authored entity definition — role, health, movement speed, and visual scale. Drives the editor Data-tab inspector for the `entities` catalog and is the shape {@link entityEntryFromCatalog} reads. A game exports it as an `editorCatalogs` schema; the scaffold ships a starter one so the tab is never empty.
|
|
191
|
+
- `entityEntryFromCatalog` (function): function entityEntryFromCatalog(document: EntityCatalogDocumentLike, entityId: string, definitions?: readonly EditorCatalogDefinition[]): GameContextEntityEntry | null — Turns an authored entity row into the runtime {@link GameContextEntityEntry} a spawn consumes: looks up `entityId` in the document's {@link ENTITY_CATALOG_ID} catalog (falling back to the game-exported `definitions` defaults), parses it against {@link entityDefinitionSchema}, and maps the fields onto stats/movement/role. Returns `null` when no row defines the entity, so the default `content.ts` path can chain other resolvers. The single seam that makes "place a mob, tune its stats/speed in the editor, save — it spawns with those stats" work with zero game code.
|
|
192
|
+
- `resolveCatalogDefinitions` (function): function resolveCatalogDefinitions(document: EntityCatalogDocumentLike, gameDefinitions: readonly EditorCatalogDefinition[]): EditorCatalogDefinition[] — Merges game-exported catalog definitions with editor-authored ones carried on the scene document. A document catalog that carries its own `schema` and has no matching game definition is synthesized into a full {@link EditorCatalogDefinition} (label falls back to the id) so the Data panel, the `list_catalogs` RPC, and the count all see it. A game definition always wins on id collision — its schema lives in code and is authoritative. Document catalogs without a schema (plain value bags for a game-declared catalog) are ignored here; they are addressed through their game definition.
|
|
193
|
+
|
|
194
|
+
## @jgengine/core/editor/environment
|
|
195
|
+
|
|
196
|
+
- `EnvironmentContent` (interface): interface EnvironmentContent — The coordinate/placement content of a world, derived from its scene document.
|
|
197
|
+
- `EnvironmentContentOptions` (interface): interface EnvironmentContentOptions extends ClearanceOptions — World-authoring convergence (#1018, epic #1006 Phase 4): derive the **coordinate/placement** content of an `environment()` world from the scene document, so a game with an authored document needs no coordinate arrays in `world.ts` — the remaining `world.ts` surface is engine tuning (noise, materials, sky preset, physics). Terrain footprint follows the authored objects, ground clearings come from authored spawns/POIs (`clearanceZonesFrom`), and the sculpt snapshot is the document's own terrain overlay. Pure and serializable; consumers pass the result straight to `environment({ terrain: terrain({ bounds }), clearings, sculpt })`.
|
|
198
|
+
- `environmentContentFromDocument` (function): function environmentContentFromDocument(doc: EditorDocument, options: EnvironmentContentOptions = {}): EnvironmentContent — Derives the coordinate/placement content of an `environment()` world from its scene document: terrain footprint (via {@link terrainBoundsFromDocument}), ground clearings under authored spawns/POIs (via `clearanceZonesFrom`), and the document's sculpt snapshot. This is the seam that lets a game author its world footprint and flatten regions in the editor instead of hardcoding them — the `world.ts` that consumes it carries only engine tuning.
|
|
199
|
+
- `lakebedFromWaterVolumes` (function): function lakebedFromWaterVolumes(doc: EditorDocument): TerraformSnapshot | undefined — Derives a terrain-depression sculpt snapshot from the document's authored `water` volumes: each water box carves a lake bed that ramps from the shoreline down to below the box's bottom face, so an editor-authored pond/lake sits *in* the ground instead of floating as a sheet on top of it (and ground-sampled vegetation sinks below the surface rather than growing through it). Returns `undefined` when the document has no water volumes.
|
|
200
|
+
- `skyFromDocument` (function): function skyFromDocument(doc: EditorDocument): SkyEnvironmentConfig | undefined — Maps the scene document's serializable environment bag onto the runtime sky config consumed by `sky()` / `environment({ sky })`. Returns `undefined` when the document has no environment field so callers can fall back to a world.ts default without inventing values.
|
|
201
|
+
- `terrainBoundsFromDocument` (function): function terrainBoundsFromDocument(doc: EditorDocument, options: EnvironmentContentOptions = {}): WorldBounds — The origin-centered terrain footprint that covers every authored object in a document, padded and floored to `minBounds`. An empty document yields exactly `minBounds`. Because `environment()` terrain is centered on the origin, the footprint is sized symmetrically to the farthest object on each axis, so no authored object falls off the ground.
|
|
202
|
+
|
|
114
203
|
## @jgengine/core/editor/grid
|
|
115
204
|
|
|
116
205
|
- `CURRENT_GRID_SCHEMA_VERSION` (const): const CURRENT_GRID_SCHEMA_VERSION: 1 — The grid-layer cell-schema version this build writes and migrates toward.
|
|
@@ -172,6 +261,12 @@
|
|
|
172
261
|
- `runtimeEntityWriteBackCommand` (function): function runtimeEntityWriteBackCommand(document: EditorDocument, entity: RuntimeEntityState): EditorCommand | null — Builds an undoable document command from an ephemeral runtime entity row (write-back). Returns null when there is nothing to promote. Does not mutate document or clear the override — the caller dispatches the command and then clears the override.
|
|
173
262
|
- `subscribeDocumentLiveSyncInstall` (function): function subscribeDocumentLiveSyncInstall(listener: () => void): () => void — Subscribe to install/uninstall of the global live-sync bus (AuthoredScene re-attaches when the editor host mounts over a running game).
|
|
174
263
|
|
|
264
|
+
## @jgengine/core/editor/minimap
|
|
265
|
+
|
|
266
|
+
- `DocumentBakeOptions` (interface): interface DocumentBakeOptions extends MinimapBakeOptions — Options for {@link bakeMinimapFromDocument}.
|
|
267
|
+
- `bakeMinimapFromDocument` (function): function bakeMinimapFromDocument(doc: EditorDocument, sampleHeight: (x: number, z: number) => number, options: DocumentBakeOptions = {}): { background: string; mapBounds: MinimapBakeBounds } — Bakes a minimap image from a scene document plus a terrain height sampler: sizes the footprint to the authored objects (or an explicit `bounds`), tints biome-colored volumes, and rasterizes the terrain top-down. Returns `{ background, mapBounds }` for the `Minimap` props. The editor runs this as its bake action and stores the result on the document.
|
|
268
|
+
- `documentBakeZones` (function): function documentBakeZones(doc: EditorDocument): MinimapBakeZone[] — The biome-tint zones a document contributes to a bake: every volume carrying a `color` becomes a polygon tint over its footprint. (The optional stretch from #1036 — a bare bake still reads as terrain without any.)
|
|
269
|
+
|
|
175
270
|
## @jgengine/core/editor/runtimeInspector
|
|
176
271
|
|
|
177
272
|
- `RuntimeInspectorGetResult` (interface): interface RuntimeInspectorGetResult — One resolved runtime field returned by `runtime_get`.
|
|
@@ -185,6 +280,15 @@
|
|
|
185
280
|
- `runtimeEntityMetaWriteBackCommand` (function): function runtimeEntityMetaWriteBackCommand(document: EditorDocument, entity: RuntimeEntityState): EditorCommand | null — Promotes ephemeral runtime `values` into an undoable meta patch on a document-linked object. Returns null when the id is not in the document or there are no values.
|
|
186
281
|
- `summarizeRuntimeInspector` (function): function summarizeRuntimeInspector(snapshot: RuntimeStateSnapshot, overrides: Readonly<Record<string, RuntimeEntityState>>, play: RuntimePlayControl): RuntimeInspectorSummary — Builds the compact reverse-channel summary used by the play-mode inspector panel and the `runtime_summary` bridge RPC.
|
|
187
282
|
|
|
283
|
+
## @jgengine/core/editor/streamer
|
|
284
|
+
|
|
285
|
+
- `StreamUpdate` (interface): interface StreamUpdate — The residency change produced by one {@link WorldStreamer.update}.
|
|
286
|
+
- `StreamerShard` (interface): interface StreamerShard — The proximity streamer for a sharded world (#985 stage 3): a stateful scheduler that decides, as the camera moves, which shards enter and leave residency. It is pure scheduling — actually reading/merging the shard documents stays the caller's job (compose with `@jgengine/core/editor/world`'s `loadWorldDocument` on each returned delta) — so the streamer has no I/O and stays deterministic and testable. Hysteresis (`loadRadius` < `keepRadius`) stops a shard on a boundary from thrashing load/unload every frame.
|
|
287
|
+
- `WorldStreamer` (interface): interface WorldStreamer — A stateful proximity streamer over a fixed shard set.
|
|
288
|
+
- `WorldStreamerConfig` (interface): interface WorldStreamerConfig — Configuration for {@link createWorldStreamer}.
|
|
289
|
+
- `createWorldStreamer` (function): function createWorldStreamer(config: WorldStreamerConfig): WorldStreamer — Creates a proximity streamer over a world's shards. Always-resident shards are resident from the first update onward; each bounded shard loads when the camera comes within `loadRadius` of its footprint and unloads only once the camera passes `keepRadius` (≥ `loadRadius`, clamped up), giving a hysteresis band that prevents boundary thrash. Purely spatial and deterministic; the caller wires each delta to `loadWorldDocument`.
|
|
290
|
+
- `shardDistance` (function): function shardDistance(shard: StreamerShard, center: { x: number; z: number }): number — Distance from a point to a shard's XZ footprint (0 when inside), or 0 for an always-resident shard.
|
|
291
|
+
|
|
188
292
|
## @jgengine/core/editor/types
|
|
189
293
|
|
|
190
294
|
- `EditorCatalogData` (interface): interface EditorCatalogData — Persisted values for one gameplay data catalog (weapons, waves, economy, …). Schemas are not stored here — they come from the game's `editorCatalogs` export and drive SchemaInspector.
|
|
@@ -192,14 +296,24 @@
|
|
|
192
296
|
- `EditorCatalogEntry` (interface): interface EditorCatalogEntry — One row in a gameplay data catalog — id + optional label + a meta bag matching the catalog's `ParamSchema`. Values persist on the scene document; the schema lives in the game export.
|
|
193
297
|
- `EditorCatalogsInput` (type): type EditorCatalogsInput = | readonly EditorCatalogDefinition[] | (() => readonly EditorCatalogDefinition[]) — Accepted shape for a game's `editorCatalogs` export: definitions, or a factory.
|
|
194
298
|
- `EditorCollection` (interface): interface EditorCollection — A named, persisted list of object ids — a selection bookmark (restore, add-to) that can also double as a production group: `locked` blocks `translate`/`setTransform`/`remove`/`removeMany` on its members, `color`/`visible` are UI-only hints for the collections panel.
|
|
299
|
+
- `EditorDirective` (type): type EditorDirective = EditorScatterDirective | EditorPopulationDirective — A procedural directive on the scene document: scatter props or a mob population.
|
|
300
|
+
- `EditorDirectiveArea` (interface): interface EditorDirectiveArea — XZ world-space bounds, `[minX, minZ]`..`[maxX, maxZ]`, for a directive that names no region.
|
|
301
|
+
- `EditorDirectiveKind` (type): type EditorDirectiveKind = EditorDirective["kind"] — The distinct directive kinds a materializer expands.
|
|
195
302
|
- `EditorDocument` (interface): interface EditorDocument — The full authored scene: every marker, volume, path, note, and sculpted terrain for a game.
|
|
303
|
+
- `EditorEnvironment` (interface): interface EditorEnvironment — Scene-document environment/lighting authoring (#1110): sky preset, optional time-of-day drive, horizon/zenith tints, sun/ambient intensity, and fog. Serializable and genre-agnostic — games feed it into `environment({ sky: sky(skyFromDocument(doc)) })` (or leave world.ts sky as a fallback when the field is absent). Absent until the lighting workspace (or a seed layer) writes it, so existing documents load unchanged.
|
|
304
|
+
- `EditorFogConfig` (interface): interface EditorFogConfig — Linear distance fog authored on the scene document — serializable subset of sky/backdrop fog. Absent fields keep engine defaults when the document is applied at runtime.
|
|
196
305
|
- `EditorFragmentContent` (interface): interface EditorFragmentContent — The four placeable-object collections a prefab fragment or clipboard fragment carries.
|
|
197
306
|
- `EditorKindVisibility` (interface): interface EditorKindVisibility — Per-kind show/hide flags for the editor's layer panel.
|
|
198
307
|
- `EditorLayersInput` (type): type EditorLayersInput = | EditorDocument | Partial<Omit<EditorDocument, "version">> | (() => EditorDocument | Partial<Omit<EditorDocument, "version">>) — Accepted shape for a game's `editorLayers` export: a document, partial data, or a factory.
|
|
199
308
|
- `EditorMarker` (interface): interface EditorMarker — A placeable point object in the scene — spawn, mob, chest, POI, etc.
|
|
309
|
+
- `EditorMinimapBake` (interface): interface EditorMinimapBake — A baked top-down minimap stored on the scene document (#1036): the PNG the editor rasterized from the authored terrain (a `data:image/png;base64,…` URI) plus the world bounds it spans. Runtime feeds these straight into the `Minimap`/`WorldMap` `background`/`mapBounds` props — no re-raster.
|
|
200
310
|
- `EditorNote` (interface): interface EditorNote — A free-text annotation pinned to a world position for designers.
|
|
201
311
|
- `EditorPath` (interface): interface EditorPath — A polyline of points — road, corridor, patrol route — placed in the scene.
|
|
312
|
+
- `EditorPopulationDirective` (interface): interface EditorPopulationDirective extends EditorDirectiveBase — Populates a region with weighted, capped mob spawns — config for `ai/populationDirector`.
|
|
313
|
+
- `EditorPopulationSpecies` (interface): interface EditorPopulationSpecies — One weighted species in a population directive, with a hard instance cap.
|
|
202
314
|
- `EditorPrefab` (interface): interface EditorPrefab — A serializable, reusable stamp of authored objects — markers/volumes/paths/notes centered on their own centroid so the same prefab inserts consistently anywhere, in this scene or another game's. `insertPrefab` tags every inserted object's `meta.prefabId`/`meta.prefabInstanceId`; `detachPrefabInstance` strips those tags to break the link without touching the content.
|
|
315
|
+
- `EditorScatterDirective` (interface): interface EditorScatterDirective extends EditorDirectiveBase — Scatters catalog props (rocks/trees/foliage) across a region — feeds the existing scatter system.
|
|
316
|
+
- `EditorSkyPreset` (type): type EditorSkyPreset = "day" | "dusk" | "night" — Named sky look stored on the scene document; matches runtime `SkyEnvironmentConfig.preset`.
|
|
203
317
|
- `EditorTerrain` (type): type EditorTerrain = TerraformSnapshot — A sculpted heightfield authored in the editor: the {@link TerraformSnapshot} of offset deltas over the game's base ground. Serializes with the scene; a game rebuilds the field with `editableTerrainFromSnapshot`.
|
|
204
318
|
- `EditorUiDocument` (interface): interface EditorUiDocument — Scene-document HUD section: panel id → layout. Single source of truth for placement.
|
|
205
319
|
- `EditorUiPanelLayout` (interface): interface EditorUiPanelLayout — Authored layout for one HUD panel inside `editor.scene.json` → `ui.panels`.
|
|
@@ -212,6 +326,29 @@
|
|
|
212
326
|
- `WELL_KNOWN_PATH_KINDS` (const): const WELL_KNOWN_PATH_KINDS: readonly ["road", "corridor", "branch", "route"] — Standard path kinds recognized with default colors and behavior.
|
|
213
327
|
- `WELL_KNOWN_VOLUME_KINDS` (const): const WELL_KNOWN_VOLUME_KINDS: readonly ["zone", "flatten", "cluster", "aggro", "leash", "discover", "capture", "prompt", "poi", "respawn_skip"] — Standard volume kinds recognized with default colors and behavior.
|
|
214
328
|
|
|
329
|
+
## @jgengine/core/editor/world
|
|
330
|
+
|
|
331
|
+
- `DecodeWorldManifestResult` (type): type DecodeWorldManifestResult = | { ok: true; manifest: WorldManifest } | { ok: false; errors: EditorDocumentDiagnostic[] } — Result of {@link decodeWorldManifest}: a typed manifest, or every diagnostic collected decoding it.
|
|
332
|
+
- `SplitWorldOptions` (interface): interface SplitWorldOptions — Options controlling how a monolithic document is partitioned into shards.
|
|
333
|
+
- `SplitWorldResult` (interface): interface SplitWorldResult — The result of splitting a document: a manifest plus the shard documents keyed by their file path.
|
|
334
|
+
- `WORLD_BASE_SHARD_ID` (const): const WORLD_BASE_SHARD_ID: "base" — The always-resident base shard id used by {@link splitEditorDocumentIntoShards}.
|
|
335
|
+
- `WORLD_MANIFEST_KIND` (const): const WORLD_MANIFEST_KIND: "world" — A sharded **world**: a scene that is no longer one monolithic `editor.scene.json` but a manifest plus spatially-partitioned shard documents. A single-file game is the degenerate one-shard case, so nothing pays for scale it does not have. The shard/overlay documents are the exact {@link EditorDocument} format loaders already consume — this module is composition over `mergeEditorDocuments` / `extractEditorFragment` / `editorDocumentBounds`, not a new format.
|
|
336
|
+
- `WorldGrid` (interface): interface WorldGrid — The world grid the shards partition space on.
|
|
337
|
+
- `WorldManifest` (interface): interface WorldManifest — A world manifest — the `world.json` at the root of a world folder.
|
|
338
|
+
- `WorldManifestShard` (interface): interface WorldManifestShard — One entry in a world manifest: a shard document, its footprint, residency, and optional overlay.
|
|
339
|
+
- `WorldQuery` (interface): interface WorldQuery — A spatial query used to select which shards a neighborhood needs.
|
|
340
|
+
- `WorldShardBounds` (interface): interface WorldShardBounds — A shard's XZ world-space footprint, `[minX, minZ]`..`[maxX, maxZ]`, used to route/stream loads.
|
|
341
|
+
- `WorldShardResidency` (type): type WorldShardResidency = "always" | "streamed" — Whether a shard is always loaded (terrain, always-resident hero content) or streamed by proximity.
|
|
342
|
+
- `WorldShardResolver` (type): type WorldShardResolver = (file: string) => EditorDocument | null — Resolves a shard/overlay file path to a decoded document, or null when it cannot be read.
|
|
343
|
+
- `WorldStreamingConfig` (interface): interface WorldStreamingConfig — Proximity streaming radii, in meters.
|
|
344
|
+
- `decodeWorldManifest` (function): function decodeWorldManifest(raw: unknown): DecodeWorldManifestResult — The authoritative decoder for a `world.json` manifest arriving from disk or an agent: validates `kind`, the shard list, and each shard's fields with a path-specific diagnostic on failure, so a malformed manifest fails loudly at the boundary instead of streaming a broken world.
|
|
345
|
+
- `exportWorldManifestJson` (function): function exportWorldManifestJson(manifest: WorldManifest, pretty = true): string — Serializes a world manifest to pretty JSON for writing `world.json`.
|
|
346
|
+
- `loadWorldDocument` (function): function loadWorldDocument(manifest: WorldManifest, resolve: WorldShardResolver, query?: WorldQuery): EditorDocument — Loads the live neighborhood document for a query: reads each selected shard through `resolve`, applies its overlay (if any) on top, then merges them into one {@link EditorDocument} downstream consumers (`placeAuthoredObjects`, `collectAuthoredTriggers`, scatter, …) read unchanged. The monolith becomes an internal detail of the loader; a one-shard world yields exactly that shard.
|
|
347
|
+
- `selectWorldShards` (function): function selectWorldShards(manifest: WorldManifest, query?: WorldQuery): WorldManifestShard[] — The shards a query needs — always-resident shards plus every bounded shard whose footprint the query disc overlaps, in manifest order. With no query every shard is selected (load the planet), so a one-shard game and an unqueried load behave exactly as a monolithic document does today.
|
|
348
|
+
- `shardMatchesQuery` (function): function shardMatchesQuery(shard: WorldManifestShard, query: WorldQuery): boolean — True when a shard should be resident for a query: always-resident shards always, bounded shards only when the query disc (`center` ± `radius`) overlaps their footprint.
|
|
349
|
+
- `singleShardWorldManifest` (function): function singleShardWorldManifest(file: string, shardId = WORLD_BASE_SHARD_ID): WorldManifest — The backward-compatible degenerate manifest: one always-resident shard pointing at a single scene document file. `loadWorldDocument(singleShardWorldManifest(file), resolve)` returns exactly that document — the migration path for a game that has one `editor.scene.json` and wants the world API without sharding yet.
|
|
350
|
+
- `splitEditorDocumentIntoShards` (function): function splitEditorDocumentIntoShards(doc: EditorDocument, options: SplitWorldOptions = {}): SplitWorldResult — Splits a monolithic document into a sharded world: placeable objects (markers, volumes, paths, notes) are bucketed into `cellSize`-meter grid cells by a representative point and extracted into per-cell shard documents; the non-placeable extras (terrain, catalogs, prefabs, collections, grids, HUD layout) go into one always-resident `base` shard. Round-trips through {@link loadWorldDocument} to the same object set — the reverse of monolith authoring, so a large scene can be sharded once and streamed thereafter. Cell shards carry their exact object footprint as bounds; empty cells are omitted; order is deterministic (row-major by grid coordinate).
|
|
351
|
+
|
|
215
352
|
## @jgengine/core/scene/sceneOwnership
|
|
216
353
|
|
|
217
354
|
- `AuthoredProvenance` (interface): interface AuthoredProvenance — A first-class entry in the scene document — the editor fully owns and persists it.
|
|
@@ -248,6 +385,7 @@
|
|
|
248
385
|
- `AgentTranscriptEntry` (type): type AgentTranscriptEntry = | { kind: "user"; id: string; content: string; at: number } | { kind: "assistant"; id: string; content: string; at: number } | { kind: "tool"; id: string; result: AgentToolResult; at: number } | { kind: "error"; id: string; content: string; at: number } | { kind: "patch";… — One rendered line in the agent panel transcript (user, assistant, tool, error, or patch).
|
|
249
386
|
- `AgentTurnResult` (interface): interface AgentTurnResult — Result of {@link runAgentTurn}: chat history, UI transcript, undoable patches, and packed context.
|
|
250
387
|
- `AssetBrowser` (function): function AssetBrowser({ assets, session, onPlace, }: { assets: readonly EditorAssetEntry[]; session: EditorSession; onPlace: (entry: EditorAssetEntry) => void; }): React.JSX.Element — Searchable panel for placing catalog assets or an empty marker into the scene.
|
|
388
|
+
- `AssetImporter` (type): type AssetImporter = (file: File) => Promise<StandaloneAsset | null> — Persists a dropped model file through the editor host so it survives reload as a durable catalog asset, returning the host-assigned id/url (which the manifest scan re-lists on reload). Resolves `null` when no host is listening — a plain browser mount with no dev server — so the caller can fall back to a blob URL.
|
|
251
389
|
- `BlankPlayableOptions` (interface): interface BlankPlayableOptions — Options for the blank, gameless world the standalone editor authors over.
|
|
252
390
|
- `DEFAULT_PAINT_SETTINGS` (const): const DEFAULT_PAINT_SETTINGS: PaintSettings — The terrain tool's default paint controls.
|
|
253
391
|
- `DEFAULT_SCULPT_SETTINGS` (const): const DEFAULT_SCULPT_SETTINGS: SculptSettings — The terrain tool's default brush controls.
|
|
@@ -255,7 +393,7 @@
|
|
|
255
393
|
- `EDITOR_AGENT_KEY_FALLBACK_ENV` (const): const EDITOR_AGENT_KEY_FALLBACK_ENV: "ANTHROPIC_API_KEY" — Fallback API-key env when `JGENGINE_EDITOR_AGENT_KEY` is unset (`ANTHROPIC_API_KEY`).
|
|
256
394
|
- `EDITOR_AGENT_URL_ENV` (const): const EDITOR_AGENT_URL_ENV: "JGENGINE_EDITOR_AGENT_URL" — Env var name for the remote agent HTTP URL (`JGENGINE_EDITOR_AGENT_URL`).
|
|
257
395
|
- `EDITOR_MCP_TOOLS` (const): const EDITOR_MCP_TOOLS: readonly EditorMcpTool[] — Full set of MCP tools an agent can call to drive the live scene editor.
|
|
258
|
-
- `EditorApp` (function): function EditorApp({ gameId, playable, layers, catalogs, save, modeChip }: EditorAppProps): React.JSX.Element — Top-level scene editor: author spawns/zones/paths/notes visually over edit, walk, or play modes.
|
|
396
|
+
- `EditorApp` (function): function EditorApp({ gameId, playable, layers, catalogs, save, modeChip, networkPresence, onExitEditor }: EditorAppProps): React.JSX.Element — Top-level scene editor: author spawns/zones/paths/notes visually over edit, walk, or play modes.
|
|
259
397
|
- `EditorAppProps` (interface): interface EditorAppProps — Props for mounting the scene editor over a playable game.
|
|
260
398
|
- `EditorAssetEntry` (interface): interface EditorAssetEntry — A searchable, placeable asset shown in the editor's asset browser panel.
|
|
261
399
|
- `EditorAssetInfo` (interface): interface EditorAssetInfo — A placeable asset entry offered in the editor's asset browser.
|
|
@@ -264,12 +402,17 @@
|
|
|
264
402
|
- `EditorBridgeServer` (interface): interface EditorBridgeServer — A running editor bridge server: its bound port, URL, and a stop handle.
|
|
265
403
|
- `EditorBridgeServerOptions` (interface): interface EditorBridgeServerOptions — Options for starting the editor's HTTP bridge server: host api, port, hostname.
|
|
266
404
|
- `EditorCameraDriver` (const): const EditorCameraDriver: React.MemoExoticComponent<({ api }: { api: EditorHostApi; }) => null> — Smoothly pans the orbit camera to the editor host's focus target when it changes.
|
|
267
|
-
- `EditorChrome` (function): function EditorChrome({ gameId, session, api, assets, ui,
|
|
405
|
+
- `EditorChrome` (function): function EditorChrome({ gameId, session, api, assets, ui, baselineDocument, save, networkSnapshot, importAsset = importAssetToHost, onRegisterAsset, onExitEditor, }: { gameId: string; session: EditorSession; api: EditorHostApi; assets: readonly EditorAssetEntry[]; ui: EditorUiStore; /** The document… — The full editor UI shell — global app bar, contextual scene toolbar, workspace rail, resizable hierarchy/inspector docks, tabbed bottom dock (content browser, console, profiler, AI assistant), viewport overlays, and status bar — wired to the session, UI store, layout store, and host RPC. Mounted by `EditorApp`; not a game-author entry point.
|
|
268
406
|
- `EditorHostApi` (interface): interface EditorHostApi — The live editor's global control surface — session, visibility, camera focus, assets, mode, RPC.
|
|
269
|
-
- `EditorLayerOverlays` (function): function EditorLayerOverlays({ document, visibility, selection, onSelect, activePathPoint, groundHeightAt, }: { document: EditorDocument; visibility: EditorKindVisibility; selection: readonly string[];
|
|
407
|
+
- `EditorLayerOverlays` (function): function EditorLayerOverlays({ document, visibility, selection, hoverId = null, onSelect, activePathPoint, groundHeightAt, }: { document: EditorDocument; visibility: EditorKindVisibility; selection: readonly string[]; /** Pre-selection hover id from viewport pointer pick; ignored when already select… — Renders every visible marker, volume, path, and note from a document as in-scene 3D gizmos.
|
|
270
408
|
- `EditorMcpTool` (interface): interface EditorMcpTool — One MCP tool descriptor — same verbs as the in-browser host RPC.
|
|
409
|
+
- `EditorNetworkAdapterKind` (type): type EditorNetworkAdapterKind = MultiplayerAdapterConfig["kind"] | "unknown" — Transport kind declared by the game, or `"unknown"` when the config is unreadable.
|
|
410
|
+
- `EditorNetworkPresenceActor` (interface): interface EditorNetworkPresenceActor — One online actor from a host-supplied presence feed. Fields mirror {@link PresencePoseRow} so hosts can forward backend rows without inventing shape.
|
|
411
|
+
- `EditorNetworkPresenceInput` (interface): interface EditorNetworkPresenceInput — Optional live presence/session injection from the editor host.
|
|
412
|
+
- `EditorNetworkSession` (interface): interface EditorNetworkSession — Optional live session identity when a multiplayer backend is attached. Omit entirely when the host has no session — the panel reports offline honestly.
|
|
413
|
+
- `EditorNetworkSnapshot` (interface): interface EditorNetworkSnapshot — Host-facing network inspection payload for the editor Network workspace.
|
|
271
414
|
- `EditorPerfSample` (interface): interface EditorPerfSample — Rolling frame-rate sample published by the in-canvas PerfProbe.
|
|
272
|
-
- `EditorRunMode` (type): type EditorRunMode = "edit" | "walk" | "play" — How the editor hosts the game: frozen placement view, roamable world,
|
|
415
|
+
- `EditorRunMode` (type): type EditorRunMode = "edit" | "walk" | "play" | "hud" — How the editor hosts the game: frozen placement view, roamable world, the real game, or HUD-layout authoring.
|
|
273
416
|
- `EditorSaveFn` (type): type EditorSaveFn = (json: string) => Promise<{ ok: boolean; path?: string; error?: string }> — Persists an exported document JSON; resolves with where it landed or why it failed.
|
|
274
417
|
- `EditorTool` (type): type EditorTool = "select" | "terrain" — Which top-level editor tool is active: object placement/selection, or terrain sculpting.
|
|
275
418
|
- `EditorUiState` (interface): interface EditorUiState — Transient editor UI state shared between chrome, viewport, and gizmos.
|
|
@@ -282,8 +425,8 @@
|
|
|
282
425
|
- `SculptSettings` (interface): interface SculptSettings — Live terrain-brush controls driven by the terrain tool panel.
|
|
283
426
|
- `SelectionGizmo` (const): const SelectionGizmo: React.MemoExoticComponent<({ session, ui, groundSnap, }: { session: EditorSession; ui: EditorUiStore; groundSnap?: ((x: number, z: number) => number) | undefined; }) => React.JSX.Element | null> — Drag-to-transform gizmo bound to the current selection, dispatching editor commands on release. Mounts the shared shell `TransformGizmo` and maps release poses onto editor commands (multi-select translate, volume scale, path vertex move).
|
|
284
427
|
- `SnapMode` (type): type SnapMode = "ground" | "grid" | "off" — How gizmo drags land: stick to terrain height, quantize to a grid, or free.
|
|
285
|
-
- `StandaloneAsset` (interface): interface StandaloneAsset —
|
|
286
|
-
- `StandaloneEditor` (function): function StandaloneEditor({ sceneId = "standalone", scene, assets, world, save, hidePickers = false, }: StandaloneEditorProps): React.JSX.Element — The scene editor, mounted over a blank gameless world instead of a game — the same `EditorApp` every jgengine game ships, usable standalone on the user's own project (CLI `jgengine editor`, desktop app, or any React host). Ships a slim strip to open a world file and pull in an asset folder; both are also settable up front through props.
|
|
428
|
+
- `StandaloneAsset` (interface): interface StandaloneAsset — Shared model-import helpers used by the standalone editor strip and the in-game Content Browser. Host-agnostic and free of React/shell so unit tests can exercise the importer without a DOM or three.
|
|
429
|
+
- `StandaloneEditor` (function): function StandaloneEditor({ sceneId = "standalone", scene, assets, world, save, importAsset = importAssetToHost, hidePickers = false, }: StandaloneEditorProps): React.JSX.Element — The scene editor, mounted over a blank gameless world instead of a game — the same `EditorApp` every jgengine game ships, usable standalone on the user's own project (CLI `jgengine editor`, desktop app, or any React host). Ships a slim strip to open a world file and pull in an asset folder; both are also settable up front through props.
|
|
287
430
|
- `StandaloneEditorProps` (interface): interface StandaloneEditorProps — Props for the gameless scene editor — everything optional so it boots on a blank world with nothing wired.
|
|
288
431
|
- `SubscribableStore` (interface): interface SubscribableStore<S> — The minimal external-store shape both the editor session and UI store satisfy.
|
|
289
432
|
- `TERRAIN_MATERIALS` (const): const TERRAIN_MATERIALS: readonly TerrainMaterial[] — The default terrain paint palette (surface id → color) shared by the panel and the mesh.
|
|
@@ -293,8 +436,8 @@
|
|
|
293
436
|
- `TerrainMode` (type): type TerrainMode = "sculpt" | "paint" — The terrain tool's active sub-mode: reshape the heightfield, or paint material layers onto it.
|
|
294
437
|
- `ViewportSelect` (const): const ViewportSelect: React.MemoExoticComponent<({ api, ui }: { api: EditorHostApi; ui: EditorUiStore; }) => null> — Canvas click-to-select and click-to-place. Document objects pick by screen proximity (registration always matches what you see) with click-cycling through stacked candidates and shift/ctrl additive selection; everything else picks by occlusion-ordered raycast against the tagged scene graph. When a placement tool is armed, clicks author new markers, volumes, notes, or path points at the ground hit instead of selecting.
|
|
295
438
|
- `VirtualWindow` (interface): interface VirtualWindow — The visible slice of a fixed-row-height list: which rows to mount and the spacer geometry.
|
|
296
|
-
- `assetsFromCatalog` (function): function assetsFromCatalog(ids: readonly string[], resolve?: (id: string) => { url?: string } | null): EditorAssetEntry[] — Turns a game's asset catalog ids into editor asset entries for the browser panel.
|
|
297
|
-
- `blankWorld` (function): function blankWorld(
|
|
439
|
+
- `assetsFromCatalog` (function): function assetsFromCatalog(ids: readonly string[], resolve?: (id: string) => { url?: string; clips?: readonly string[] } | null): EditorAssetEntry[] — Turns a game's asset catalog ids into editor asset entries for the browser panel.
|
|
440
|
+
- `blankWorld` (function): function blankWorld(_seed = "standalone"): EnvironmentWorldFeature — The default flat-ground authoring canvas the standalone editor opens on when the host supplies none. Deliberately thin — bare sculptable ground under a clear default sky. Dressing (sky look, foliage scatter, props) is what the author adds here, written into the scene document; it is never pre-baked into the canvas. The `seed` parameter is legacy and unused.
|
|
298
441
|
- `createBlankPlayable` (function): function createBlankPlayable(options: BlankPlayableOptions = {}): PlayableGame — Builds a minimal gameless `PlayableGame` — a flat world plus an asset catalog — for the editor to mount over.
|
|
299
442
|
- `createDefaultAgentEndpoint` (function): function createDefaultAgentEndpoint(config: AgentEndpointConfig = resolveAgentEndpointConfig()): AgentEndpoint — Picks HTTP endpoint when `JGENGINE_EDITOR_AGENT_URL` (or config.url) is set, otherwise the offline local agent.
|
|
300
443
|
- `createEditorUiStore` (function): function createEditorUiStore(): EditorUiStore — Creates the shared UI store the editor chrome and viewport both drive.
|
|
@@ -314,19 +457,20 @@
|
|
|
314
457
|
|
|
315
458
|
## @jgengine/editor/AssetBrowser
|
|
316
459
|
|
|
460
|
+
- `ASSET_DRAG_MIME` (const): const ASSET_DRAG_MIME: "application/x-jgengine-editor-asset" — Custom drag mime for placeable catalog assets. Payload is JSON `{ id, label, kind }` so the viewport can call `place_asset` without a registry round-trip.
|
|
317
461
|
- `AssetBrowser` (function): function AssetBrowser({ assets, session, onPlace, }: { assets: readonly EditorAssetEntry[]; session: EditorSession; onPlace: (entry: EditorAssetEntry) => void; }): React.JSX.Element — Searchable panel for placing catalog assets or an empty marker into the scene.
|
|
318
462
|
- `EditorAssetEntry` (interface): interface EditorAssetEntry — A searchable, placeable asset shown in the editor's asset browser panel.
|
|
319
|
-
- `MATERIAL_DRAG_MIME` (const): const MATERIAL_DRAG_MIME: "application/x-jgengine-material" — Custom drag mime carrying a material id — read by
|
|
320
|
-
- `assetsFromCatalog` (function): function assetsFromCatalog(ids: readonly string[], resolve?: (id: string) => { url?: string } | null): EditorAssetEntry[] — Turns a game's asset catalog ids into editor asset entries for the browser panel.
|
|
463
|
+
- `MATERIAL_DRAG_MIME` (const): const MATERIAL_DRAG_MIME: "application/x-jgengine-material" — Custom drag mime carrying a material id — read by hierarchy rows and the viewport drop zone.
|
|
464
|
+
- `assetsFromCatalog` (function): function assetsFromCatalog(ids: readonly string[], resolve?: (id: string) => { url?: string; clips?: readonly string[] } | null): EditorAssetEntry[] — Turns a game's asset catalog ids into editor asset entries for the browser panel.
|
|
321
465
|
|
|
322
466
|
## @jgengine/editor/DebugDraw
|
|
323
467
|
|
|
324
|
-
- `EditorLayerOverlays` (function): function EditorLayerOverlays({ document, visibility, selection, onSelect, activePathPoint, groundHeightAt, }: { document: EditorDocument; visibility: EditorKindVisibility; selection: readonly string[];
|
|
468
|
+
- `EditorLayerOverlays` (function): function EditorLayerOverlays({ document, visibility, selection, hoverId = null, onSelect, activePathPoint, groundHeightAt, }: { document: EditorDocument; visibility: EditorKindVisibility; selection: readonly string[]; /** Pre-selection hover id from viewport pointer pick; ignored when already select… — Renders every visible marker, volume, path, and note from a document as in-scene 3D gizmos.
|
|
325
469
|
- `PathDraftPreview` (function): function PathDraftPreview({ points }: { points: readonly EditorVec3[] }): React.JSX.Element — Live preview of an in-progress path drawing: placed points and the connecting line.
|
|
326
470
|
|
|
327
471
|
## @jgengine/editor/EditorApp
|
|
328
472
|
|
|
329
|
-
- `EditorApp` (function): function EditorApp({ gameId, playable, layers, catalogs, save, modeChip }: EditorAppProps): React.JSX.Element — Top-level scene editor: author spawns/zones/paths/notes visually over edit, walk, or play modes.
|
|
473
|
+
- `EditorApp` (function): function EditorApp({ gameId, playable, layers, catalogs, save, modeChip, networkPresence, onExitEditor }: EditorAppProps): React.JSX.Element — Top-level scene editor: author spawns/zones/paths/notes visually over edit, walk, or play modes.
|
|
330
474
|
- `EditorAppProps` (interface): interface EditorAppProps — Props for mounting the scene editor over a playable game.
|
|
331
475
|
- `EditorSaveFn` (type): type EditorSaveFn = (json: string) => Promise<{ ok: boolean; path?: string; error?: string }> — Persists an exported document JSON; resolves with where it landed or why it failed.
|
|
332
476
|
|
|
@@ -336,7 +480,7 @@
|
|
|
336
480
|
|
|
337
481
|
## @jgengine/editor/EditorChrome
|
|
338
482
|
|
|
339
|
-
- `EditorChrome` (function): function EditorChrome({ gameId, session, api, assets, ui,
|
|
483
|
+
- `EditorChrome` (function): function EditorChrome({ gameId, session, api, assets, ui, baselineDocument, save, networkSnapshot, importAsset = importAssetToHost, onRegisterAsset, onExitEditor, }: { gameId: string; session: EditorSession; api: EditorHostApi; assets: readonly EditorAssetEntry[]; ui: EditorUiStore; /** The document… — The full editor UI shell — global app bar, contextual scene toolbar, workspace rail, resizable hierarchy/inspector docks, tabbed bottom dock (content browser, console, profiler, AI assistant), viewport overlays, and status bar — wired to the session, UI store, layout store, and host RPC. Mounted by `EditorApp`; not a game-author entry point.
|
|
340
484
|
|
|
341
485
|
## @jgengine/editor/PerfProbe
|
|
342
486
|
|
|
@@ -354,17 +498,18 @@
|
|
|
354
498
|
|
|
355
499
|
## @jgengine/editor/StandaloneEditor
|
|
356
500
|
|
|
501
|
+
- `AssetImporter` (type): type AssetImporter = (file: File) => Promise<StandaloneAsset | null> — Persists a dropped model file through the editor host so it survives reload as a durable catalog asset, returning the host-assigned id/url (which the manifest scan re-lists on reload). Resolves `null` when no host is listening — a plain browser mount with no dev server — so the caller can fall back to a blob URL.
|
|
357
502
|
- `BlankPlayableOptions` (interface): interface BlankPlayableOptions — Options for the blank, gameless world the standalone editor authors over.
|
|
358
|
-
- `StandaloneAsset` (interface): interface StandaloneAsset —
|
|
359
|
-
- `StandaloneEditor` (function): function StandaloneEditor({ sceneId = "standalone", scene, assets, world, save, hidePickers = false, }: StandaloneEditorProps): React.JSX.Element — The scene editor, mounted over a blank gameless world instead of a game — the same `EditorApp` every jgengine game ships, usable standalone on the user's own project (CLI `jgengine editor`, desktop app, or any React host). Ships a slim strip to open a world file and pull in an asset folder; both are also settable up front through props.
|
|
503
|
+
- `StandaloneAsset` (interface): interface StandaloneAsset — Shared model-import helpers used by the standalone editor strip and the in-game Content Browser. Host-agnostic and free of React/shell so unit tests can exercise the importer without a DOM or three.
|
|
504
|
+
- `StandaloneEditor` (function): function StandaloneEditor({ sceneId = "standalone", scene, assets, world, save, importAsset = importAssetToHost, hidePickers = false, }: StandaloneEditorProps): React.JSX.Element — The scene editor, mounted over a blank gameless world instead of a game — the same `EditorApp` every jgengine game ships, usable standalone on the user's own project (CLI `jgengine editor`, desktop app, or any React host). Ships a slim strip to open a world file and pull in an asset folder; both are also settable up front through props.
|
|
360
505
|
- `StandaloneEditorProps` (interface): interface StandaloneEditorProps — Props for the gameless scene editor — everything optional so it boots on a blank world with nothing wired.
|
|
361
|
-
- `blankWorld` (function): function blankWorld(
|
|
506
|
+
- `blankWorld` (function): function blankWorld(_seed = "standalone"): EnvironmentWorldFeature — The default flat-ground authoring canvas the standalone editor opens on when the host supplies none. Deliberately thin — bare sculptable ground under a clear default sky. Dressing (sky look, foliage scatter, props) is what the author adds here, written into the scene document; it is never pre-baked into the canvas. The `seed` parameter is legacy and unused.
|
|
362
507
|
- `createBlankPlayable` (function): function createBlankPlayable(options: BlankPlayableOptions = {}): PlayableGame — Builds a minimal gameless `PlayableGame` — a flat world plus an asset catalog — for the editor to mount over.
|
|
363
508
|
- `downloadSaver` (function): function downloadSaver(filename = "editor.scene.json"): EditorSaveFn — A save fn that hands the scene JSON back to the browser as a downloaded file — the exit path when no dev server is listening.
|
|
364
509
|
|
|
365
510
|
## @jgengine/editor/TerrainPanel
|
|
366
511
|
|
|
367
|
-
- `TerrainPanel` (function): function TerrainPanel({ session, ui }: { session: EditorSession; ui: EditorUiStore }): React.JSX.Element — The terrain-tool panel: create/clear the heightfield and drive the sculpt/paint controls.
|
|
512
|
+
- `TerrainPanel` (function): function TerrainPanel({ session, ui, api }: { session: EditorSession; ui: EditorUiStore; api: EditorHostApi }): React.JSX.Element — The terrain-tool panel: create/clear the heightfield and drive the sculpt/paint controls.
|
|
368
513
|
|
|
369
514
|
## @jgengine/editor/TerrainReadout
|
|
370
515
|
|
|
@@ -412,6 +557,11 @@
|
|
|
412
557
|
- `runAgentTurn` (function): function runAgentTurn(options: { api: EditorHostApi; endpoint: AgentEndpoint; history: readonly AgentChatMessage[]; userMessage: string; maxRounds?: number; now?: () => number; }): Promise<AgentTurnResult> — Runs one user message against an agent endpoint: injects live editor context via `packAgentContext`, executes tool calls through `routeToolCall` (shared undo), and returns transcript + patch entries the human can reverse with `undoAgentPatch`.
|
|
413
558
|
- `undoAgentPatch` (function): function undoAgentPatch(api: EditorHostApi, patches: readonly AgentPatchEntry[], patchId: string): { ok: true; patches: AgentPatchEntry[] } | { ok: false; error: string } — Undoes one agent patch when it is still the top of the session undo stack. Newer live agent patches must be undone first; returns the updated list immutably.
|
|
414
559
|
|
|
560
|
+
## @jgengine/editor/assetImport
|
|
561
|
+
|
|
562
|
+
- `AssetImporter` (type): type AssetImporter = (file: File) => Promise<StandaloneAsset | null> — Persists a dropped model file through the editor host so it survives reload as a durable catalog asset, returning the host-assigned id/url (which the manifest scan re-lists on reload). Resolves `null` when no host is listening — a plain browser mount with no dev server — so the caller can fall back to a blob URL.
|
|
563
|
+
- `StandaloneAsset` (interface): interface StandaloneAsset — Shared model-import helpers used by the standalone editor strip and the in-game Content Browser. Host-agnostic and free of React/shell so unit tests can exercise the importer without a DOM or three.
|
|
564
|
+
|
|
415
565
|
## @jgengine/editor/chromeFields
|
|
416
566
|
|
|
417
567
|
- `NumberField` (function): function NumberField({ label, value, onCommit, step = 1, }: { label: string; value: number; onCommit: (value: number) => void; step?: number; }): React.JSX.Element — ⚠ undocumented
|
|
@@ -423,6 +573,67 @@
|
|
|
423
573
|
- `INPUT` (const): const INPUT: "rounded-md border border-white/10 bg-black/40 px-2 py-1 outline-none transition-colors placeholder:text-neutral-600 focus:border-cyan-400/60 focus:bg-black/60" — ⚠ undocumented
|
|
424
574
|
- `MICRO` (const): const MICRO: "text-[9px] font-semibold uppercase tracking-[0.14em] text-neutral-500" — ⚠ undocumented
|
|
425
575
|
|
|
576
|
+
## @jgengine/editor/handlers
|
|
577
|
+
|
|
578
|
+
- `EDITOR_RPC_HANDLERS` (const): const EDITOR_RPC_HANDLERS: HandlerTable — The complete method → handler dispatch table. Spreading the per-domain tables into a value typed `HandlerTable` is the compile-time completeness check: if any union method lacks a handler (or a domain misspells one), this assignment fails to type-check.
|
|
579
|
+
- `HandlerContext` (interface): interface HandlerContext — Everything a per-domain RPC handler needs from the host. Mutable host state (focus, mode, play control, assets, visibility, perf) is reached through `api`'s getters/setters so handlers stay closure-free and independently testable; `dispatchGuarded` and the catalog lookups are threaded in because they are built once when the host is constructed.
|
|
580
|
+
|
|
581
|
+
## @jgengine/editor/handlers/catalogs
|
|
582
|
+
|
|
583
|
+
- `catalogHandlers` (const): const catalogHandlers: Pick< HandlerTable, | "list_catalogs" | "get_catalog_entry" | "set_catalog_entry" | "add_catalog_entry" | "remove_catalog_entry" | "add_catalog" | "remove_catalog" | "set_catalog_schema" > — Gameplay data catalog verbs (list / get / merge-patch / add / remove rows).
|
|
584
|
+
|
|
585
|
+
## @jgengine/editor/handlers/collections
|
|
586
|
+
|
|
587
|
+
- `collectionHandlers` (const): const collectionHandlers: Pick< HandlerTable, | "list_collections" | "create_collection" | "rename_collection" | "delete_collection" | "set_collection_members" | "add_to_collection" | "remove_from_collection" | "set_collection_flags" | "select_collection" > — Named collection / selection-set verbs.
|
|
588
|
+
|
|
589
|
+
## @jgengine/editor/handlers/context
|
|
590
|
+
|
|
591
|
+
- `DispatchOutcome` (interface): interface DispatchOutcome — Outcome of a guarded dispatch: whether it mutated the session, plus the resulting state.
|
|
592
|
+
- `HandlerContext` (interface): interface HandlerContext — Everything a per-domain RPC handler needs from the host. Mutable host state (focus, mode, play control, assets, visibility, perf) is reached through `api`'s getters/setters so handlers stay closure-free and independently testable; `dispatchGuarded` and the catalog lookups are threaded in because they are built once when the host is constructed.
|
|
593
|
+
- `HandlerFor` (type): type HandlerFor<M extends EditorBridgeRequest["method"]> = ( ctx: HandlerContext, request: Extract<EditorBridgeRequest, { method: M }>, ) => EditorBridgeResponse — One method's handler, with `request` narrowed to that method's union member.
|
|
594
|
+
- `HandlerTable` (type): type HandlerTable = { [M in EditorBridgeRequest["method"]]: HandlerFor<M> } — The full method → handler map. Spreading the per-domain tables into a value of this type is the lockstep guarantee that every union method has exactly one handler: a missing verb fails to compile.
|
|
595
|
+
|
|
596
|
+
## @jgengine/editor/handlers/document
|
|
597
|
+
|
|
598
|
+
- `documentHandlers` (const): const documentHandlers: Pick< HandlerTable, | "editor_status" | "set_mode" | "perf_report" | "list_layers" | "list_selection" | "get_marker" | "get_volume" | "set_transform" | "set_volume" | "set_path" | "set_marker" | "set_note" | "set_meta" | "apply_preset" | "select" | "clear_selection" | "camera… — Document, selection, camera, mode, asset placement, and status verbs.
|
|
599
|
+
|
|
600
|
+
## @jgengine/editor/handlers/grids
|
|
601
|
+
|
|
602
|
+
- `gridHandlers` (const): const gridHandlers: Pick< HandlerTable, | "list_grids" | "get_grid_cell" | "add_grid_layer" | "remove_grid_layer" | "set_grid_layer" | "paint_grid_cells" | "fill_grid_rect" | "flood_fill_grid" | "resize_grid_layer" | "import_grid" > — Grid/tile layer verbs — create, edit, paint, fill, and import.
|
|
603
|
+
|
|
604
|
+
## @jgengine/editor/handlers/hierarchy
|
|
605
|
+
|
|
606
|
+
- `hierarchyHandlers` (const): const hierarchyHandlers: Pick< HandlerTable, | "set_parent" | "hierarchy" | "list_prefabs" | "create_prefab" | "insert_prefab" | "detach_prefab_instance" | "delete_prefab" > — Parent/child hierarchy and prefab library verbs.
|
|
607
|
+
|
|
608
|
+
## @jgengine/editor/handlers/minimap
|
|
609
|
+
|
|
610
|
+
- `minimapHandlers` (const): const minimapHandlers: Pick<HandlerTable, "bake_minimap"> — Bake the authored terrain into a stored minimap PNG (#1036). Composes the live viewport's base ground field with the document's sculpt snapshot, rasterizes it top-down via the pure core bake, and stores `{ background, bounds }` on `document.minimap` as an undoable edit — runtime then feeds those straight into the `Minimap`/`WorldMap` props with no re-raster. Needs the mounted viewport's composed sampler, so it is a live-editor-only action, not a headless CLI verb.
|
|
611
|
+
|
|
612
|
+
## @jgengine/editor/handlers/runtime
|
|
613
|
+
|
|
614
|
+
- `runtimeHandlers` (const): const runtimeHandlers: Pick< HandlerTable, | "push_document_patch" | "pull_document_patches" | "document_revision" | "push_runtime_delta" | "pull_runtime_deltas" | "runtime_snapshot" | "runtime_summary" | "runtime_get" | "runtime_set" | "runtime_pause" | "runtime_resume" | "runtime_step" | "set_runt… — Live-sync document patches, the ephemeral runtime reverse channel, and play-mode poke verbs.
|
|
615
|
+
|
|
616
|
+
## @jgengine/editor/handlers/streets
|
|
617
|
+
|
|
618
|
+
- `streetsHandlers` (const): const streetsHandlers: Pick<HandlerTable, "generate_streets"> — Document, selection, camera, mode, asset placement, and status verbs.
|
|
619
|
+
|
|
620
|
+
## @jgengine/editor/handlers/terrain
|
|
621
|
+
|
|
622
|
+
- `terrainHandlers` (const): const terrainHandlers: Pick< HandlerTable, | "create_terrain" | "sculpt_terrain" | "terrain_summary" | "paint_terrain" | "fill_terrain" | "auto_paint" | "terrain_materials" | "terrain_layers" | "set_terrain_layers" | "blend_terrain" | "convert_scatter" | "add_foliage" | "scatter_summary" > — Sculpt heightfield, material painting, terrain layers, and foliage/scatter verbs.
|
|
623
|
+
|
|
624
|
+
## @jgengine/editor/listDocumentTriggers
|
|
625
|
+
|
|
626
|
+
- `DocumentTriggerBinding` (interface): interface DocumentTriggerBinding — One on/action binding shown on a document trigger row.
|
|
627
|
+
- `DocumentTriggerEntry` (interface): interface DocumentTriggerEntry — A marker or volume that owns one or more authored triggers, with a display label for the scripting workspace list.
|
|
628
|
+
- `DocumentTriggersSource` (interface): interface DocumentTriggersSource — Document slice the list helper needs — `EditorDocument` satisfies this structurally.
|
|
629
|
+
|
|
630
|
+
## @jgengine/editor/materialAssignments
|
|
631
|
+
|
|
632
|
+
- `MaterialAssignmentFilter` (type): type MaterialAssignmentFilter = | "all" | "assigned" | "unassigned" | { materialId: string } — Filter for {@link filterMaterialAssignments}.
|
|
633
|
+
- `MaterialAssignmentRow` (interface): interface MaterialAssignmentRow — One object row in the materials workspace browser.
|
|
634
|
+
- `MaterialDocumentSlice` (interface): interface MaterialDocumentSlice — Minimal document slice the materials inventory needs.
|
|
635
|
+
- `MaterialObjectKind` (type): type MaterialObjectKind = "marker" | "volume" | "path" — Document-wide material assignment inventory for the Materials workspace. Reads real `meta.materialId` stamps from placeables — no thumbnails or faked previews.
|
|
636
|
+
|
|
426
637
|
## @jgengine/editor/mcp/bridgeServer
|
|
427
638
|
|
|
428
639
|
- `EditorBridgeServer` (interface): interface EditorBridgeServer — A running editor bridge server: its bound port, URL, and a stop handle.
|
|
@@ -434,7 +645,15 @@
|
|
|
434
645
|
|
|
435
646
|
## @jgengine/editor/mcp/cli
|
|
436
647
|
|
|
437
|
-
- `EditorCliOptions` (type): type EditorCliOptions = { gameId: string; port: number;
|
|
648
|
+
- `EditorCliOptions` (type): type EditorCliOptions = { gameId: string; port: number; rpcSources: RpcPayloadSource[]; save: boolean; serve: boolean; stdio: boolean; } — Parsed CLI flags for the headless editor control plane.
|
|
649
|
+
- `SaveSceneResult` (type): type SaveSceneResult = { ok: true; saved: string } | { ok: false; error: string } — Result of a `--save` write-back: the path written, or why nothing was written.
|
|
650
|
+
|
|
651
|
+
## @jgengine/editor/mcp/fieldSpec
|
|
652
|
+
|
|
653
|
+
- `RPC_FIELD_SCHEMAS` (const): const RPC_FIELD_SCHEMAS: Record<EditorBridgeRequest["method"], readonly RpcFieldSpec[]> — Per-method field type table — the single source of truth for the RPC boundary. A field listed here is type-checked when present (see `decodeEditorBridgeRequest`); existence is left to `EditorHostApi.handle` (whose per-method guards return honest `ok:false` diagnostics for missing/unknown targets). Type-checking presented fields is what keeps a fuzzed value — a string where a number belongs, a scalar where an object belongs — from reaching a live session uncoerced. Unknown extra fields are ignored so a superset payload stays forward-compatible.
|
|
654
|
+
- `RpcFieldKind` (type): type RpcFieldKind = "string" | "number" | "boolean" | "string[]" | "object" | "object[]" | "vec3" | "value" — The value type a request field is expected to carry.
|
|
655
|
+
- `RpcFieldSpec` (interface): interface RpcFieldSpec — One field's expected shape in a request; `oneOf`/`nullable`/`required`/`of` refine the check.
|
|
656
|
+
- `buildInputSchema` (function): function buildInputSchema(method: EditorBridgeRequest["method"]): Record<string, unknown> — Generates the MCP tool `inputSchema` for a method from its {@link RPC_FIELD_SCHEMAS} entry.
|
|
438
657
|
|
|
439
658
|
## @jgengine/editor/mcp/loadGameCatalogs
|
|
440
659
|
|
|
@@ -455,7 +674,7 @@
|
|
|
455
674
|
|
|
456
675
|
- `DecodeRpcRequestResult` (type): type DecodeRpcRequestResult = | { ok: true; request: EditorBridgeRequest } | { ok: false; errors: RpcRequestDiagnostic[] } — Result of {@link decodeEditorBridgeRequest}: a request whose `method` is a real one, or the diagnostic that rejected it.
|
|
457
676
|
- `RpcRequestDiagnostic` (interface): interface RpcRequestDiagnostic — One field-level failure surfaced while decoding an untrusted RPC request.
|
|
458
|
-
- `decodeEditorBridgeRequest` (function): function decodeEditorBridgeRequest(raw: unknown): DecodeRpcRequestResult — Validates an untrusted JSON-decoded RPC payload (from `--rpc
|
|
677
|
+
- `decodeEditorBridgeRequest` (function): function decodeEditorBridgeRequest(raw: unknown): DecodeRpcRequestResult — Validates an untrusted JSON-decoded RPC payload (from `--rpc`, the HTTP bridge, or an agent tool call) before it reaches `EditorHostApi.handle`: confirms it is a plain object carrying a known `method`, then type-checks every field the method understands against {@link RPC_FIELD_SCHEMAS}. A garbled method, or a field whose value is the wrong type (a string where a number belongs, a scalar where an object belongs), is rejected here with a path-specific diagnostic instead of flowing into a live session on a blind cast. Missing fields and unknown extra fields are left for `handle` to interpret so the boundary stays forward-compatible.
|
|
459
678
|
|
|
460
679
|
## @jgengine/editor/mcp/stdioServer
|
|
461
680
|
|
|
@@ -466,6 +685,14 @@
|
|
|
466
685
|
- `EDITOR_MCP_TOOLS` (const): const EDITOR_MCP_TOOLS: readonly EditorMcpTool[] — Full set of MCP tools an agent can call to drive the live scene editor.
|
|
467
686
|
- `EditorMcpTool` (interface): interface EditorMcpTool — One MCP tool descriptor — same verbs as the in-browser host RPC.
|
|
468
687
|
|
|
688
|
+
## @jgengine/editor/networkSnapshot
|
|
689
|
+
|
|
690
|
+
- `EditorNetworkAdapterKind` (type): type EditorNetworkAdapterKind = MultiplayerAdapterConfig["kind"] | "unknown" — Transport kind declared by the game, or `"unknown"` when the config is unreadable.
|
|
691
|
+
- `EditorNetworkPresenceActor` (interface): interface EditorNetworkPresenceActor — One online actor from a host-supplied presence feed. Fields mirror {@link PresencePoseRow} so hosts can forward backend rows without inventing shape.
|
|
692
|
+
- `EditorNetworkPresenceInput` (interface): interface EditorNetworkPresenceInput — Optional live presence/session injection from the editor host.
|
|
693
|
+
- `EditorNetworkSession` (interface): interface EditorNetworkSession — Optional live session identity when a multiplayer backend is attached. Omit entirely when the host has no session — the panel reports offline honestly.
|
|
694
|
+
- `EditorNetworkSnapshot` (interface): interface EditorNetworkSnapshot — Host-facing network inspection payload for the editor Network workspace.
|
|
695
|
+
|
|
469
696
|
## @jgengine/editor/outlinerModel
|
|
470
697
|
|
|
471
698
|
- `OutlinerFlatRow` (type): type OutlinerFlatRow = | { type: "group"; key: string; kind: string; total: number; collapsed: boolean } | { type: "kindItem"; key: string; kind: string; label: string; ids: string[] } | { type: "treeItem"; key: string; id: string; label: string; kind: string; depth: number; hasChildren: boolean } — One rendered outliner line — a kind header, a deduped kind row, or a hierarchy tree node.
|
|
@@ -494,11 +721,162 @@
|
|
|
494
721
|
- `EditorHostApi` (interface): interface EditorHostApi — The live editor's global control surface — session, visibility, camera focus, assets, mode, RPC.
|
|
495
722
|
- `EditorKindVisibility` (interface): interface EditorKindVisibility — Per-kind show/hide flags for the editor's layer panel.
|
|
496
723
|
- `EditorPerfSample` (interface): interface EditorPerfSample — Rolling frame-rate sample published by the in-canvas PerfProbe.
|
|
497
|
-
- `EditorRunMode` (type): type EditorRunMode = "edit" | "walk" | "play" — How the editor hosts the game: frozen placement view, roamable world,
|
|
724
|
+
- `EditorRunMode` (type): type EditorRunMode = "edit" | "walk" | "play" | "hud" — How the editor hosts the game: frozen placement view, roamable world, the real game, or HUD-layout authoring.
|
|
498
725
|
- `EditorSession` (interface): interface EditorSession — Stateful, undoable handle for driving scene edits from UI or an MCP agent.
|
|
499
726
|
- `EditorSessionState` (interface): interface EditorSessionState — The document plus current selection at a point in editor history.
|
|
500
727
|
- `installEditorHost` (function): function installEditorHost(api: EditorHostApi): () => void — Publishes an editor host globally so devtools and MCP agents can reach it; returns a cleanup fn.
|
|
501
728
|
|
|
729
|
+
## @jgengine/editor/shell/BottomDock
|
|
730
|
+
|
|
731
|
+
- `BottomDock` (function): function BottomDock({ tab, onSelectTab, onClose, assets, session, api, consoleStore, perfHistory, browserView, onSetBrowserView, onPlaceAsset, onImportModels, importBusy, }: { tab: BottomDockTab; onSelectTab: (tab: BottomDockTab) => void; onClose: () => void; assets: readonly EditorAssetEntry[]; ses… — Tabbed bottom dock: Content Browser, Console, Profiler, Animation (path flythrough scrub), and the AI Assistant. Only the active tab's panel mounts, so hidden tools cost nothing per frame.
|
|
732
|
+
|
|
733
|
+
## @jgengine/editor/shell/CommandPalette
|
|
734
|
+
|
|
735
|
+
- `CommandPalette` (function): function CommandPalette({ commands, onClose, initialQuery = "", }: { commands: readonly PaletteCommand[]; onClose: () => void; /** Pre-filled filter (e.g. "add " to open straight into placement commands). */ initialQuery?: string; }): React.JSX.Element — Modal command palette (Ctrl/Cmd+K): fuzzy-filters every executable editor command (plus scene object jump rows), surfaces recent commands when the query is empty, and runs the highlighted entry on Enter. Esc or backdrop click cancels without side effects.
|
|
736
|
+
|
|
737
|
+
## @jgengine/editor/shell/ConsolePanel
|
|
738
|
+
|
|
739
|
+
- `ConsolePanel` (function): function ConsolePanel({ store }: { store: EditorConsoleStore }): React.JSX.Element — Console dock tab over the real editor event log — notifications, save/import results, RPC and agent errors. Severity filters, counts, search, timestamps, and clear; no fabricated entries.
|
|
740
|
+
|
|
741
|
+
## @jgengine/editor/shell/ContentBrowser
|
|
742
|
+
|
|
743
|
+
- `ContentBrowser` (function): function ContentBrowser({ assets, session, onPlace, view, onSetView, onImportModels, importBusy = false, }: { assets: readonly EditorAssetEntry[]; session: EditorSession; onPlace: (entry: EditorAssetEntry) => void; view: BrowserViewMode; onSetView: (view: BrowserViewMode) => void; /** When set, enab… — Content Browser dock tab: folder rail + searchable asset grid/list over the game's real asset catalog, plus the terrain material palette (drag chips onto objects or the viewport). Assets are draggable into the viewport for placement (and still double-click / Place). Model cards with a URL get a real offscreen-GLB thumbnail (cached); catalog/marker rows and failed loads keep typed glyphs — never a fabricated screenshot. Import reuses the standalone editor's host importer.
|
|
744
|
+
|
|
745
|
+
## @jgengine/editor/shell/HierarchyPanel
|
|
746
|
+
|
|
747
|
+
- `HierarchyPanel` (const): const HierarchyPanel: React.MemoExoticComponent<({ session, api, onAdd, onRowContextMenu, }: { session: EditorSession; api: EditorHostApi; onAdd: () => void; onRowContextMenu?: ((event: { clientX: number; clientY: number; }, id: string) => void) | undefined; }) => React.JSX.Element> — Redesigned world outliner: searchable, virtualized, kind-iconed rows generated from the live document. Group headers carry real per-kind visibility toggles (the editor's layer system); rows expose per-object eye/lock toggles (`setObjectFlags` → document `hidden`/`locked`) and show a lock affordance when a locked collection also owns the id. Tree view supports drag-and-drop reparenting through the existing `set_parent` RPC. Keyboard navigation uses a single tab stop on the list (roving active row via `aria-activedescendant`; arrows / Home / End / Enter / F2), double-click rename, and row context menus (frame / duplicate / delete / prefab / parent to… / unparent) are supported. Selector-subscribed and memoized, so UI-only churn never rerenders it.
|
|
748
|
+
- `OBJECT_DRAG_MIME` (const): const OBJECT_DRAG_MIME: "application/x-jgengine-editor-object" — HTML5 drag payload for hierarchy reparenting via `set_parent`.
|
|
749
|
+
|
|
750
|
+
## @jgengine/editor/shell/ProfilerPanel
|
|
751
|
+
|
|
752
|
+
- `ProfilerPanel` (function): function ProfilerPanel({ history }: { history: PerfHistoryStore }): React.JSX.Element — Profiler dock tab over the real {@link PerfProbe} sample history: frame-time graph, current and average values, authoring-cost series when the probe reports one, sim/outside budget when `devtools.frame` has recorded frames, and JS heap memory when the browser exposes `performance.memory`. Series the host cannot measure are omitted entirely rather than fabricated.
|
|
753
|
+
|
|
754
|
+
## @jgengine/editor/shell/SceneToolbar
|
|
755
|
+
|
|
756
|
+
- `ADD_VOLUME_ENTRIES` (const): const ADD_VOLUME_ENTRIES: readonly { label: string; tool: PlacementTool }[] — Volume placement entries offered by the Add menu.
|
|
757
|
+
- `SceneToolbar` (function): function SceneToolbar({ tool, gizmoMode, gizmoSpace, gizmoPivot, snapMode, gridSize, rotationSnapDeg, scaleSnap, cameraProjection, showGrid, showContours, showSurfaceGrid, showElevation, placementActive, onSetTool, onSetGizmoMode, onSetGizmoSpace, onSetGizmoPivot, onSetSnapMode, onSetGridSize, onSet… — Contextual scene toolbar under the app bar: tools, gizmo modes, gizmo space, pivot, snapping, viewport overlays, framing, projection, and the Add menu.
|
|
758
|
+
|
|
759
|
+
## @jgengine/editor/shell/StatusBar
|
|
760
|
+
|
|
761
|
+
- `StatusBar` (function): function StatusBar({ api, history, objects, foliage, selectionCount, autosave, }: { api: EditorHostApi; history: PerfHistoryStore; objects: number; foliage: number; selectionCount: number; autosave: boolean; }): React.JSX.Element — Bottom status strip: readiness, scene stats, live perf pill, autosave state, and camera hints. Owns its own perf poll (and the profiler history feed) so the 500ms tick never rerenders the shell.
|
|
762
|
+
- `formatTriangles` (function): function formatTriangles(count: number): string — Compact triangle-count formatting (1.2M / 340k).
|
|
763
|
+
- `usePerfSample` (function): function usePerfSample(api: EditorHostApi, history?: PerfHistoryStore): EditorPerfSample | null — Shared editor-host perf poll: samples on an interval and feeds the profiler history.
|
|
764
|
+
|
|
765
|
+
## @jgengine/editor/shell/TopAppBar
|
|
766
|
+
|
|
767
|
+
- `TopAppBar` (function): function TopAppBar({ gameId, onExitToGame, dirty, saveState, lastSavedAt = null, saveAvailable, saveError, canUndo, canRedo, onUndo, onRedo, onSave, onPlay, onWalk, onHud, onImport, onExport, onCopyJson, onOpenPalette, onToggleHelp, onResetLayout, }: { gameId: string; /** When set (editor summoned o… — Global application bar: identity + save state on the left, command palette in the center, history / run controls / document actions on the right. Pause and Step stay disabled in edit mode; Play mode mounts {@link PlayModeBar}, which wires the same controls to the runtime pause/step RPCs so mode switches keep shell chrome.
|
|
768
|
+
- `TopBarSaveState` (type): type TopBarSaveState = "idle" | "saving" | "saved" | "error" — Document save lifecycle mirrored from `useDocumentSave`.
|
|
769
|
+
|
|
770
|
+
## @jgengine/editor/shell/ViewportOverlays
|
|
771
|
+
|
|
772
|
+
- `OrientationWidget` (const): const OrientationWidget: React.MemoExoticComponent<() => React.JSX.Element> — Bottom-left orientation axis widget. Reads the camera basis published by the in-canvas probe on its own rAF loop and mutates SVG attributes directly, so orbiting never rerenders React.
|
|
773
|
+
- `PerformanceOverlay` (const): const PerformanceOverlay: React.MemoExoticComponent<({ api }: { api: EditorHostApi; }) => React.JSX.Element | null> — Top-left viewport performance readout backed by the real in-canvas {@link PerfProbe} samples. Rows without data (no sample yet) simply don't render — nothing is fabricated.
|
|
774
|
+
- `ViewportUtilityPanel` (function): function ViewportUtilityPanel({ document, api, selectionCount, }: { document: EditorDocument; api: EditorHostApi; selectionCount: number; }): React.JSX.Element — Top-right collapsible viewport utility panel: real minimap from `document.minimap` when baked (via `bake_minimap` RPC — never a fake image), plus per-kind object counts and framing actions.
|
|
775
|
+
|
|
776
|
+
## @jgengine/editor/shell/WorkspaceRail
|
|
777
|
+
|
|
778
|
+
- `WORKSPACES` (const): const WORKSPACES: readonly RailEntry[] — Rail order and support map. Unsupported modes are visible but disabled — never fake panels.
|
|
779
|
+
- `WorkspaceRail` (function): function WorkspaceRail({ active, onSelect, }: { active: EditorWorkspace; onSelect: (workspace: EditorWorkspace) => void; }): React.JSX.Element — Narrow left workspace rail. Supported modes activate their home panels; planned modes are disabled with an explanatory tooltip so nothing pretends to work.
|
|
780
|
+
|
|
781
|
+
## @jgengine/editor/shell/cameraTelemetry
|
|
782
|
+
|
|
783
|
+
- `CameraTelemetry` (interface): interface CameraTelemetry — Per-frame camera orientation channel between the in-canvas probe and the DOM orientation widget. Deliberately a mutable record, not React state: the probe writes every frame and the widget reads on its own rAF loop, applying styles directly — zero shell rerenders.
|
|
784
|
+
- `createCameraTelemetry` (function): function createCameraTelemetry(): CameraTelemetry — Creates a telemetry record seeded at rest (identity basis).
|
|
785
|
+
- `getCameraTelemetry` (function): function getCameraTelemetry(): CameraTelemetry — Shared telemetry singleton — probe and widget may mount in different React trees.
|
|
786
|
+
|
|
787
|
+
## @jgengine/editor/shell/commandRegistry
|
|
788
|
+
|
|
789
|
+
- `PaletteCommand` (interface): interface PaletteCommand — One executable command-palette entry.
|
|
790
|
+
- `PaletteContext` (interface): interface PaletteContext — Everything the palette can drive — thin callbacks over existing editor systems.
|
|
791
|
+
- `PaletteObjectTarget` (interface): interface PaletteObjectTarget — A scene object the palette can jump to by name/id.
|
|
792
|
+
- `buildPaletteCommands` (function): function buildPaletteCommands(ctx: PaletteContext): PaletteCommand[] — Builds the full palette command list from live editor capabilities — no dead entries.
|
|
793
|
+
- `filterPaletteCommands` (function): function filterPaletteCommands(commands: readonly PaletteCommand[], query: string, recentIds: readonly string[] = []): PaletteCommand[] — Case-insensitive filter over title, group, and keywords. With an empty query, recent commands (that still exist) float to the top under a virtual order — the caller groups them visually.
|
|
794
|
+
|
|
795
|
+
## @jgengine/editor/shell/consoleStore
|
|
796
|
+
|
|
797
|
+
- `CONSOLE_CAPACITY` (const): const CONSOLE_CAPACITY: 500 — Entries kept before the oldest are dropped.
|
|
798
|
+
- `ConsoleEntry` (interface): interface ConsoleEntry — One recorded editor event.
|
|
799
|
+
- `ConsoleSeverity` (type): type ConsoleSeverity = "info" | "warning" | "error" — Bounded editor event log backing the Console dock tab. Only real editor events are recorded — notifications, save/import/export results, RPC and agent errors — never fabricated runtime logs.
|
|
800
|
+
- `EditorConsoleStore` (interface): interface EditorConsoleStore — Subscribable, bounded editor event log.
|
|
801
|
+
- `createEditorConsoleStore` (function): function createEditorConsoleStore(now: () => number = () => Date.now()): EditorConsoleStore — Creates the editor console store. `now` is injectable for tests.
|
|
802
|
+
|
|
803
|
+
## @jgengine/editor/shell/fields
|
|
804
|
+
|
|
805
|
+
- `AxisNumberField` (function): function AxisNumberField({ axis, label, value, onCommit, step = 0.1, precision = 3, disabled = false, mixed = false, }: { /** Axis coloring; omit for a neutral field. */ axis?: "x" | "y" | "z"; label: string; value: number; onCommit: (value: number) => void; step?: number; precision?: number; disabl… — Polished numeric field with an axis-colored label chip. The whole field is a drag-scrub surface (not just the chip): horizontal pointer-drag adjusts by `step` per few pixels while Alt/Option or double-click focuses the input for precise typing. The input commits finite values on change and re-normalizes its text on blur. Invalid text never commits.
|
|
806
|
+
- `FieldRow` (function): function FieldRow({ label, children, title }: { label: string; children: React.ReactNode; title?: string }): React.JSX.Element — Labeled row wrapper aligning a caption with one or more fields.
|
|
807
|
+
- `SectionAction` (function): function SectionAction({ label, onClick, active = false, disabled = false, children, }: { label: string; onClick: () => void; active?: boolean; disabled?: boolean; children: React.ReactNode; }): React.JSX.Element — Small ghost action used inside section headers (reset, link).
|
|
808
|
+
- `TextField` (function): function TextField({ label, value, placeholder, onCommit, }: { label: string; value: string; placeholder?: string; onCommit: (value: string) => void; }): React.JSX.Element — Compact text input row used by the inspector header and component cards.
|
|
809
|
+
|
|
810
|
+
## @jgengine/editor/shell/glbThumbnailCache
|
|
811
|
+
|
|
812
|
+
- `ThumbnailState` (interface): interface ThumbnailState — Cache entry for one asset's thumbnail: status plus the data URL when ready.
|
|
813
|
+
- `ThumbnailStatus` (type): type ThumbnailStatus = "idle" | "loading" | "ready" | "error" — Lifecycle of one GLB thumbnail render: idle → loading → ready, or error.
|
|
814
|
+
|
|
815
|
+
## @jgengine/editor/shell/icons
|
|
816
|
+
|
|
817
|
+
- `Icon` (function): function Icon({ name, size = 14, ...rest }: { name: IconName; size?: number } & SVGProps<SVGSVGElement>): React.JSX.Element — One 16px stroke icon from the shell's internal set; sized via the `size` prop.
|
|
818
|
+
- `IconName` (type): type IconName = | "cursor" | "move" | "rotate" | "scale" | "terrain" | "brush" | "grid" | "magnet" | "frame" | "camera" | "eye" | "eyeOff" | "lock" | "unlock" | "search" | "filter" | "plus" | "folder" | "folderOpen" | "cube" | "pin" | "sphere" | "spline" | "note" | "play" | "pause" | "step" | "stop"… — Internal editor icon set: compact 16px stroke glyphs drawn in-repo so the shell has one consistent icon language without adding a dependency. Every glyph is original geometry.
|
|
819
|
+
- `kindIcon` (function): function kindIcon(kind: string): IconName — Icon assigned to a scene-object kind for hierarchy rows and inspector headers.
|
|
820
|
+
|
|
821
|
+
## @jgengine/editor/shell/layoutStore
|
|
822
|
+
|
|
823
|
+
- `BottomDockTab` (type): type BottomDockTab = "content" | "console" | "profiler" | "animation" | "assistant" — Bottom dock tool tabs.
|
|
824
|
+
- `BrowserViewMode` (type): type BrowserViewMode = "grid" | "list" — Content-browser presentation density.
|
|
825
|
+
- `DEFAULT_LAYOUT` (const): const DEFAULT_LAYOUT: ShellLayoutState — Default shell layout, matching the reference composition.
|
|
826
|
+
- `EditorWorkspace` (type): type EditorWorkspace = | "scene" | "terrain" | "assets" | "materials" | "scripting" | "animation" | "audio" | "lighting" | "ai" | "multiplayer" — Persistent editor-shell layout state: which workspace is active, which panels are open, their sizes, and dock tab selections. Kept apart from `uiStore` (transient interaction state) so layout preferences survive reloads without entangling gizmo/placement churn. Persistence is throttled so drag-resizing never writes localStorage per pointer move.
|
|
827
|
+
- `InspectorTab` (type): type InspectorTab = "inspector" | "components" | "materials" — Inspector header tabs.
|
|
828
|
+
- `LAYOUT_LIMITS` (const): const LAYOUT_LIMITS: { readonly leftWidth: { readonly min: 220; readonly max: 420; }; readonly rightWidth: { readonly min: 260; readonly max: 460; }; readonly bottomHeight: { readonly min: 160; readonly max: 480; }; } — Bounds applied to persisted/live panel sizes so restored layouts can never crush the viewport.
|
|
829
|
+
- `LAYOUT_PERSIST_DELAY_MS` (const): const LAYOUT_PERSIST_DELAY_MS: 400 — How long resize/patch churn batches before one localStorage write.
|
|
830
|
+
- `LeftDockPage` (type): type LeftDockPage = "hierarchy" | "collections" | "prefabs" | "catalogs" — Left dock content pages (hierarchy plus the existing data panels).
|
|
831
|
+
- `ShellLayoutState` (interface): interface ShellLayoutState — The persisted + live shell layout state.
|
|
832
|
+
- `ShellLayoutStore` (interface): interface ShellLayoutStore — Subscribable store over {@link ShellLayoutState} with clamped resize helpers.
|
|
833
|
+
- `createShellLayoutStore` (function): function createShellLayoutStore(gameId: string): ShellLayoutStore — Creates the shell layout store, seeded from localStorage when available.
|
|
834
|
+
- `normalizeLayout` (function): function normalizeLayout(raw: unknown): ShellLayoutState — Normalizes any partially-persisted layout into a valid state (sizes clamped, unions guarded).
|
|
835
|
+
|
|
836
|
+
## @jgengine/editor/shell/pathFlythrough
|
|
837
|
+
|
|
838
|
+
- `ScrubbablePath` (interface): interface ScrubbablePath — A scrubbable scene path — real document polylines with enough points to sample.
|
|
839
|
+
|
|
840
|
+
## @jgengine/editor/shell/perfHistory
|
|
841
|
+
|
|
842
|
+
- `FrameBudgetFields` (interface): interface FrameBudgetFields — Optional sim / outside / phase fields derived from real frame-tracker stats (never invented).
|
|
843
|
+
- `FrameBudgetStatsInput` (interface): interface FrameBudgetStatsInput — Minimal frame-stats shape consumed when folding core `devtools.frame.stats()` into a sample.
|
|
844
|
+
- `PERF_HISTORY_CAPACITY` (const): const PERF_HISTORY_CAPACITY: 240 — Samples retained (~2 minutes at the 500ms poll).
|
|
845
|
+
- `PerfHistoryStore` (interface): interface PerfHistoryStore — Rolling history of real {@link EditorPerfSample}s for the Profiler dock tab's frame-time graph. Fed by the same 500ms host poll the toolbar pill uses; never fabricates values. Kept outside React state so recording continues while the profiler tab is closed without rerendering anything.
|
|
846
|
+
- `createPerfHistoryStore` (function): function createPerfHistoryStore(): PerfHistoryStore — Creates the rolling perf-sample history store.
|
|
847
|
+
- `seriesAverage` (function): function seriesAverage(values: readonly number[]): number — Mean of a numeric series, 0 for empty input.
|
|
848
|
+
- `sparklinePoints` (function): function sparklinePoints(values: readonly number[], width: number, height: number, maxValue: number): string — Builds an SVG polyline `points` string for a series scaled into a width×height box.
|
|
849
|
+
|
|
850
|
+
## @jgengine/editor/shell/theme
|
|
851
|
+
|
|
852
|
+
- `APP_BG` (const): const APP_BG: "bg-[#0b0d10]" — Editor shell design tokens as Tailwind class constants. One place owns the layered dark theme (app < panel < control elevation), text scale, and interaction states so every shell component reads identically. Class strings are complete literals so the host app's Tailwind scan keeps them.
|
|
853
|
+
- `AXIS_COLORS` (const): const AXIS_COLORS: Record<"x" | "y" | "z", { text: string; bar: string }> — Per-axis accent colors for transform fields (X red, Y green, Z blue — gizmo-matched).
|
|
854
|
+
- `BORDER` (const): const BORDER: "border-white/[0.07]" — Low-contrast neutral border used between shell regions.
|
|
855
|
+
- `CONTROL` (const): const CONTROL: "rounded-[5px] border border-white/[0.07] bg-[#191d24] text-neutral-300 transition-colors hover:bg-[#1f242d] hover:text-neutral-100 outline-none focus-visible:ring-2 focus-visible:ring-cyan-400/60 focus-visible:ring-offset-0" — Base interactive control: compact, subtle border, hover elevation.
|
|
856
|
+
- `CONTROL_ACTIVE` (const): const CONTROL_ACTIVE: "border-cyan-400/40 bg-cyan-500/15 text-cyan-200 hover:bg-cyan-500/20" — Active/selected control state — restrained cyan.
|
|
857
|
+
- `CONTROL_BG` (const): const CONTROL_BG: "bg-[#191d24]" — Elevated control surface — inputs, chips, dropdowns.
|
|
858
|
+
- `FLOAT_BG` (const): const FLOAT_BG: "bg-[#14171d]" — Floating layer surface — menus, palettes, popovers.
|
|
859
|
+
- `FOCUS_RING` (const): const FOCUS_RING: "outline-none focus-visible:ring-2 focus-visible:ring-cyan-400/60 focus-visible:ring-offset-0" — Shared focus ring for keyboard navigation on interactive controls.
|
|
860
|
+
- `INPUT_CLS` (const): const INPUT_CLS: "rounded-[5px] border border-white/[0.08] bg-black/40 text-[12px] text-neutral-200 outline-none transition-colors placeholder:text-neutral-600 focus:border-cyan-400/50 focus:bg-black/60 outline-none focus-visible:ring-2 focus-visible:ring-cyan-400/60 focus-visible:ring-offset-0" — Text input styling shared across shell panels.
|
|
861
|
+
- `MICRO_LABEL` (const): const MICRO_LABEL: "text-[10px] font-semibold uppercase tracking-[0.12em] text-neutral-500" — Micro uppercase section label.
|
|
862
|
+
- `NUMERIC` (const): const NUMERIC: "tabular-nums" — Tabular numerals for transforms, metrics, and timing readouts.
|
|
863
|
+
- `PANEL_BG` (const): const PANEL_BG: "bg-[#111318]" — Panel surface — one elevation step above the app background.
|
|
864
|
+
- `TEXT` (const): const TEXT: "text-[12px] text-neutral-300" — Standard control text row.
|
|
865
|
+
- `TEXT_MUTED` (const): const TEXT_MUTED: "text-[11px] text-neutral-500" — Muted metadata text.
|
|
866
|
+
|
|
867
|
+
## @jgengine/editor/shell/ui
|
|
868
|
+
|
|
869
|
+
- `CollapsibleSection` (function): function CollapsibleSection({ title, icon, open, onToggle, children, trailing, tone, }: { title: string; icon?: IconName; open: boolean; onToggle: () => void; children: ReactNode; trailing?: ReactNode; /** Optional accent color for the title icon. */ tone?: string; }): React.JSX.Element — Collapsible component card for the inspector and side panels.
|
|
870
|
+
- `EmptyState` (function): function EmptyState({ icon, title, description, badge, children, }: { icon: IconName; title: string; description: string; badge?: string; children?: ReactNode; }): React.JSX.Element — Polished empty state used by unsupported workspaces and empty docks.
|
|
871
|
+
- `IconButton` (function): function IconButton({ icon, label, onClick, active = false, disabled = false, size = 14, className = "", tone = "neutral", }: { icon: IconName; label: string; onClick?: () => void; active?: boolean; disabled?: boolean; size?: number; className?: string; tone?: "neutral" | "ghost"; }): React.JSX.Elem… — Icon-only control with a mandatory accessible name (tooltip + aria-label).
|
|
872
|
+
- `Kbd` (function): function Kbd({ children }: { children: ReactNode }): React.JSX.Element — Keyboard-shortcut chip rendered inside buttons and menus.
|
|
873
|
+
- `PanelHeading` (function): function PanelHeading({ children, trailing }: { children: ReactNode; trailing?: ReactNode }): React.JSX.Element — Micro uppercase heading used inside panels.
|
|
874
|
+
- `PanelResizer` (function): function PanelResizer({ orientation, label, onResize, sign = 1, }: { orientation: "vertical" | "horizontal"; label: string; onResize: (delta: number) => void; sign?: 1 | -1; }): React.JSX.Element — Drag handle between shell regions. Pointer-drag resizes continuously; arrow keys resize in 16px steps for keyboard access. `sign` maps a positive pointer delta to a size increase.
|
|
875
|
+
- `PanelTabs` (function): function PanelTabs<T extends string>({ tabs, active, onSelect, trailing, ariaLabel, }: { tabs: readonly { id: T; label: string; icon?: IconName; badge?: string | number }[]; active: T; onSelect: (id: T) => void; trailing?: ReactNode; ariaLabel: string; }): React.JSX.Element — Horizontal tab strip for dock panels (bottom dock, inspector tabs).
|
|
876
|
+
- `Segmented` (function): function Segmented<T extends string>({ options, value, onChange, ariaLabel, disabled = false, }: { options: readonly SegmentedOption<T>[]; value: T; onChange: (value: T) => void; ariaLabel: string; disabled?: boolean; }): React.JSX.Element — Compact segmented control on the elevated-control surface with a cyan active segment.
|
|
877
|
+
- `SegmentedOption` (interface): interface SegmentedOption<T extends string> — One choice within a {@link Segmented} control.
|
|
878
|
+
- `ToolbarDivider` (function): function ToolbarDivider(): React.JSX.Element — Thin vertical divider between toolbar clusters.
|
|
879
|
+
|
|
502
880
|
## @jgengine/editor/terrainReadoutStore
|
|
503
881
|
|
|
504
882
|
- `TerrainReadoutState` (interface): interface TerrainReadoutState — Live, transient terrain-readability feedback shared by the viewport overlay and the HUD legend.
|
|
@@ -507,14 +885,19 @@
|
|
|
507
885
|
|
|
508
886
|
## @jgengine/editor/uiStore
|
|
509
887
|
|
|
888
|
+
- `CameraProjectionMode` (type): type CameraProjectionMode = "perspective" | "orthographic" — Editor viewport camera projection — perspective (default) or orthographic top-down-friendly view.
|
|
510
889
|
- `DEFAULT_PAINT_SETTINGS` (const): const DEFAULT_PAINT_SETTINGS: PaintSettings — The terrain tool's default paint controls.
|
|
511
890
|
- `DEFAULT_SCULPT_SETTINGS` (const): const DEFAULT_SCULPT_SETTINGS: SculptSettings — The terrain tool's default brush controls.
|
|
512
891
|
- `EditorTool` (type): type EditorTool = "select" | "terrain" — Which top-level editor tool is active: object placement/selection, or terrain sculpting.
|
|
513
892
|
- `EditorUiState` (interface): interface EditorUiState — Transient editor UI state shared between chrome, viewport, and gizmos.
|
|
514
893
|
- `EditorUiStore` (interface): interface EditorUiStore — Subscribable store for the editor's transient UI state (gizmo, snapping, placement).
|
|
515
894
|
- `GizmoMode` (type): type GizmoMode = "translate" | "rotate" | "scale" — Which transform gizmo is active for the current selection.
|
|
895
|
+
- `GizmoPivot` (type): type GizmoPivot = "origin" | "center" | "median" — Where multi-select gizmo handles sit: - `origin` — primary selection (first selected id) - `center` — arithmetic mean of selected object positions - `median` — per-axis median of selected object positions
|
|
896
|
+
- `GizmoSpace` (type): type GizmoSpace = "world" | "local" — Gizmo handle orientation: world axes, or the selection's local (yaw-rotated) axes.
|
|
516
897
|
- `PaintSettings` (interface): interface PaintSettings — Live terrain material-paint controls driven by the terrain tool panel.
|
|
517
898
|
- `PlacementTool` (type): type PlacementTool = | { tool: "marker"; kind: string } | { tool: "volume"; kind: string; shape: EditorVolumeShape } | { tool: "note" } | { tool: "path"; kind: string } — The active creation tool — what a viewport click places next.
|
|
899
|
+
- `ROTATION_SNAP_CHOICES_DEG` (const): const ROTATION_SNAP_CHOICES_DEG: readonly number[] — Rotation snap increments (degrees) offered by the toolbar snap menu.
|
|
900
|
+
- `SCALE_SNAP_CHOICES` (const): const SCALE_SNAP_CHOICES: readonly number[] — Scale snap increments offered by the toolbar snap menu.
|
|
518
901
|
- `SculptSettings` (interface): interface SculptSettings — Live terrain-brush controls driven by the terrain tool panel.
|
|
519
902
|
- `SnapMode` (type): type SnapMode = "ground" | "grid" | "off" — How gizmo drags land: stick to terrain height, quantize to a grid, or free.
|
|
520
903
|
- `TERRAIN_MATERIALS` (const): const TERRAIN_MATERIALS: readonly TerrainMaterial[] — The default terrain paint palette (surface id → color) shared by the panel and the mesh.
|