State snapshot
getState() returns a summary of the current scene as a single object. The AI console puts this whole thing into the system prompt, so the model can judge with knowledge of "what's loaded right now, where the view is, and what's selected".
oniyanma.getState()Since it's read-only, it's usable as-is even on the read-only surface.
Fields
Display
| Field | Type | Content |
|---|---|---|
backend | string | Render backend (webgl / webgpu) |
colorMode | string | Color mode (rgb / intensity / elevation / classification) |
navMode | string | Nav mode (orbit / walk) |
Layers
| Field | Type | Content |
|---|---|---|
sources | { id, name, url?, visible, pointCount }[] | Loaded point cloud sources |
surfaces | { id, name, visible }[] | Reference surfaces (TIN) |
id is what you pass to removeSource / setSourceVisible / setSurfaceVisible.
Selection and edits
| Field | Type | Content |
|---|---|---|
hasSelection | boolean | Whether there's a selection |
selectionCount | number | Selected point count (resident-based) |
editCount | number | Non-destructive edit count |
editsByActor | { human, ai, api, unknown } | Count per actor. unknown comes from an old save that didn't record an actor |
canUndo / canRedo | boolean | Whether your own edits can be undone / redone |
Note that canUndo is per user. It's false when there's a state with only other people's edits while collaborating. → Non-destructive editing
Coordinates
| Field | Type | Content |
|---|---|---|
alignedBounds | [minX,minY,minZ,maxX,maxY,maxZ] | null | The overall AABB in the aligned frame. null when nothing's loaded |
cameraReal | [x, y, z] | Camera position (real coordinates, m) |
frame | { offset: [x,y,z], alignYaw } | null | The coordinate frame. scene = Rz(-alignYaw)·(real - offset). null when nothing's loaded |
crs | { epsg?, name?, verticalDatum } | null | The coordinate reference system. null if it couldn't be determined |
verticalDatum is 'orthometric' (elevation) / 'ellipsoidal' (ellipsoidal height) / 'unknown'. CRS is recorded only — never reprojected. → Coordinate systems
alignedBounds is in the aligned frame; cameraReal is in real coordinates. Don't mix them.
Findings
| Field | Type | Content |
|---|---|---|
findings | { types, total, published } | Number of finding types / total findings (including drafts) / count visible to the client |
Counts only — no content. Since the snapshot rides in the system prompt on every request, this is kept from ballooning as findings accumulate. Get the content with listFindings.
On a build with no findings store, this key is omitted entirely (readable as "the findings feature isn't present"). → Filing findings
Example
{
"backend": "webgpu",
"colorMode": "elevation",
"navMode": "orbit",
"sources": [
{ "id": 1, "name": "kasado.copc.laz", "url": "https://data.oniyanma.jp/kasado.copc.laz",
"visible": true, "pointCount": 95169313 }
],
"surfaces": [],
"hasSelection": true,
"selectionCount": 128340,
"editCount": 12,
"editsByActor": { "human": 9, "ai": 3, "api": 0, "unknown": 0 },
"canUndo": true,
"canRedo": false,
"alignedBounds": [-142.3, -88.1, -12.4, 142.3, 88.1, 31.7],
"cameraReal": [-52341.2, 18904.7, 42.1],
"frame": { "offset": [-52400.0, 18850.0, 20.0], "alignYaw": 0 },
"crs": { "epsg": 6669, "verticalDatum": "orthometric" },
"findings": { "types": 1, "total": 4, "published": 2 }
}Querying individually
getState() is a summary — use query* when you need more detail.
| What you want | Command |
|---|---|
| Resident point count and extent per layer | queryLayers |
| The selection's AABB | querySelection |
| Elevation distribution | queryElevation |
| Classification histogram | queryClasses |
| CRS and coordinate frame | queryCrs |