/** Editor and document automation over the shared session command wire. * Modeling executes in the editor tab; this client owns no model state. */ import type { ActiveDocumentCapture, AssetKind, AssetPreviewCapture, AssetPreviewOptions, AssetPreviewShotSetDefinition, AssetPreviewSource, CaptureDimensions, DocumentLookOutcome, StageFrameCostReading, EditorChromeCapture, EditorChromeCaptureOptions, EditorState, EditorView, EditorWorkspaceName, InspectedFieldWrite, InspectedHierarchy, InspectedInspection, LabeledShotSetCapture, PresentedEditorView, ShadingMode, StructureOp, StructureOpOptions, StructureOpResult, ViewPreset, ViewportCapture } from '@volter/sdk'; import type { EditorClient, HistoryStep, OpenedDocument } from './client.js'; import { LiveAssetLibrary } from './asset-library.js'; import { LiveEditorDocument } from './editor-document.js'; /** A panel `showPanel` can focus: the console, the build surface, or any key * the editor's own static-panel registry holds (`hierarchy`, `asset-library`, * `inspector`, `history`, …) — which is why this is open: the registry, not * this union, is the vocabulary. */ export type PanelName = 'console' | (string & {}); /** * Lightweight extension-based `AssetKind` guess for `openAsset`'s optional * `kind` argument. Callers with an unusual extension can always pass `kind` * explicitly. */ export declare function inferAssetKind(path: string): AssetKind; export declare class LiveEditor { #private; /** Read and drive DOM within a named scope: the active document by default, or editor chrome * such as header, shelf, rail, outliner, utility and area. Targets outside the scope are refused. * See `@volter/sdk`'s editor-document-probe for scope and gesture contracts. */ readonly document: LiveEditorDocument; /** The asset library: search a source, list an asset's files, download one into the project with its license * recorded (`asset-library.ts`). */ readonly assetLibrary: LiveAssetLibrary; constructor(client: EditorClient); /** A verb a composed package contributes (`-`), waited on for its own row's budget. */ contributedVerb>(type: string, fields?: Record): Promise; /** * The active authoring adapter's persistence destination — where a save would * land (`status().savePath`). A read only: a stage root has no scene document * to open, and its root is activated instead. */ scene(): Promise; /** * Make the connected human editor show the same subject/view as the agent. * The returned URL is a compact, shareable projection — not a serialized * workspace or document payload. */ present(view: EditorView): Promise; /** The human editor's actual active document, selection, camera and utility. */ currentView(): Promise; /** Capture the active document's render without viewport navigation gizmos or readouts. * A number requests a square; `{width, height}` requests a shaped frame, bounded by * `CaptureDimensions`. Supply a view to present and capture it in one request. * Use `captureEditorChrome({ region: 'document' })` to include viewport chrome. */ captureActiveDocument(size?: CaptureDimensions, view?: EditorView): Promise; /** * Photograph the editor PAGE — every panel, tab strip and viewport as the * person sees it. the editor's `screenshot editor` command is this verb from the shell. The * one door for judging chrome sighted: a skin, a workspace arrangement or a * contributed panel is looked at through this, never guessed at from DOM * probes. The page at its own layout, `scale` output pixels per CSS pixel * (default `devicePixelRatio`) — a 1 px border or a glyph stroke is only * judgeable at the scale the reference it is compared against was captured * at, and the result reports its own `size` and `scale`. */ captureEditorChrome(options?: EditorChromeCaptureOptions): Promise; /** `'all'` -> `EditorClient.selectAll()` (mirrors `volter select --all`); otherwise `EditorClient.select(id)` (mirrors `volter select `). */ select(id: string | 'all'): Promise; /** Mirrors `volter deselect`. */ deselect(): Promise; /** No `id` -> focus the current selection (mirrors bare `volter focus`); `id` given -> focus that entity. */ focus(id?: string): Promise; /** * Frame the edit viewport camera on one entity. Same framing as * `focus(id)`, but an entity id the scene does not know THROWS, naming the * id — where `focus` quietly does nothing. Reach for this whenever the next * step reads the viewport (`screenshot()`, an * `assetPreview(..., { stage: 'scene' })`): a framing that silently missed * would otherwise be indistinguishable from one that worked. */ frame(entityId: string): Promise; /** * Bare `frame()` frames the OPEN asset document's subject instead — its * selection if it has one, else the whole model: the toolbar's own Frame * button, reachable from a script. `fit` scales the fitted distance (1 is * that button's tight fit, 1.5 stands back a little for a shot). */ frame(options?: { readonly fit?: number; }): Promise; /** * WATCH THE AGENT LOOK AROUND THE MODEL. * * Swings the open asset document's camera — the camera the human's tab is * showing — around the framed subject by `azimuth`/`elevation` RADIANS, * animated over `duration` seconds (default 0.6), and resolves when the move * ends. This is deliberately not a jump cut: the point of the verb is that a * person watching sees the agent walk around the thing it is working on. * * `await editor.orbit({ azimuth: Math.PI / 2 })` — a quarter turn to the right. * * There is ONE camera, and the human owns it: a drag during the move cancels * it exactly where it is, and the resolved outcome says `cancelledBy: * 'human'` rather than throwing. A second look verb supersedes the first. * The move is drawn by the document's own frame loop, so a document that * isn't being drawn (background tab, inactive panel) doesn't orbit. */ orbit(options: { /** RADIANS, relative to where the camera is now. `Math.PI / 2` is a * quarter turn; degrees are not accepted and `90` is fourteen turns. */ readonly azimuth?: number; /** RADIANS, relative to where the camera is now. */ readonly elevation?: number; /** SECONDS the move takes (default 0.6). */ readonly duration?: number; }): Promise; /** * A slow full revolution of the open document's subject — {@link orbit} with * the turns spelled out and a constant angular rate. Resolves at the end of * the last revolution. */ turntable(options?: { readonly seconds?: number; readonly revolutions?: number; }): Promise; /** * What a frame of the open 3D document's stage costs when nothing caps it: `frames` of the * stage's own frame back to back, each waited out on the GPU (median, p95, min ms), the canvas * with its device pixel ratio, what was drawn after culling against what the scene holds, and * the draw mode. `stage` names another stage by its id (a split's second area, * `#area-2`). */ frameCost(options?: { readonly frames?: number; readonly stage?: string; readonly quality?: 'full' | 'navigation'; }): Promise; view(preset: ViewPreset): Promise; workspace(id: EditorWorkspaceName): Promise<{ readonly workspace: EditorWorkspaceName; readonly applied: boolean; }>; /** * Apply a STYLE BUNDLE by id — the chrome's palette, material and icon set in * one gesture, the session door beside * `View →