GitHubCommencer

La référence API provient des commentaires de documentation Go du code source et est rédigée en anglais.

package editor

import "github.com/nsgo-dev/game/pkg/editor"

Vue d’ensemble

Package editor implements the NSGo Scene Editor over pkg/sceneformat.

It provides:

  • Command-pattern undo/redo history (History, Command) covering every scene edit.
  • Scene document loading, saving, object placement, selection, transform editing, and deletion (Editor, PlaceObject, MoveObject, RotateObject, ScaleObject, DeleteObject).
  • Inline tilemap editing with paint, erase, BFS flood fill, autotiled Terrain brush painting (PaintTile, EraseTile, FloodFillTile, PaintTerrain, EraseTerrain, ToolTerrain, TileStrokeTerrain, TileStrokeEraseTerrain), rectangle, Bresenham line, stamp (with palette rectangle selection and map region copy/cut/paste), and deterministic seeded weighted random brushes with live viewport preview, Escape cancel, and single-step undo (FillTileRect, DrawTileLine, StampTiles, CopyTileRegion, CutTileRegion, PasteTileRegion, BeginTileStroke), paired with a docked Tileset Editor for defining 4-bit cardinal and 8-bit blob terrain sets and assigning tiles to neighbor bitmasks by clicking edges and corners (OpenTilesetFile, OpenActiveLayerTileset, AddTilesetTerrain, ToggleTilesetEdgeOrCorner, TilesetEditorPanelView).
  • A layers panel that picks the active layer and adds, removes, renames, reorders, hides and locks layers, each edit but the session's lock undoable (Layers, AddLayer, RemoveLayer, RenameLayer, MoveLayer, SetLayerVisible, SetLayerSpace, SetLayerLocked, LayersView), paired with undoable layer parallax and repeat editing in the inspector (SetLayerParallax, SetLayerRepeat) and live parallax/repeat preview in the 2D viewport.
  • Typed property, component, and scene settings inspection and editing (SetProperty, SetComponentField, SetSceneName, SetVirtualSize, SetBackground, SetCamera, SetCameraPosition, SetCameraZoom, SetCameraRotation, SetCameraBounds, ClearCameraBounds, InspectorView), including draggable 2D camera position and camera.bounds resize/move handles when scene settings are active, and side-by-side *.rooms.yaml room-map editing in the 2D viewport with tile-grid snapping and room inspection (OpenRoomsFile, NewRoomMap, AddRoom, DeleteRoom, SetRoomRect, SetRoomID, SetRoomName, SetRoomTransition, SaveRoomsFile).
  • Play-in-editor preview powered by game.Loop with exact pre-play YAML snapshot restoration (Play, PlayIn, Stop).
  • An animation editor that keys any registered property on a timeline, previews the clip with animclip and saves it as an animation resource file (NewClip, KeyProperty, SeekClip, PlayClip, SaveClipFile, AnimationPanelView).
  • A Data Table editor that opens versioned datatable YAML files from the file browser as a sortable, filterable grid with inferred value kinds, undo/redo, lossless round-trip saves and optional per-pattern Go row-type validation (OpenDataTableFile, RegisterDataTableType, SetDataTableCellText, DataTablePanelView).
  • Atlas asset browsing and drop-to-place sprite creation (Assets, DropAtlasFrame, AssetBrowserView).
  • Placing models in 3D: the asset browser lists the built-in primitives and the project's glTF models with thumbnails rendered offscreen, and the Place tool, a drag from the browser or a .glb dropped from another app adds an object drawing one where the pointer's ray meets the scene's geometry or the ground plane, optionally snapped to the grid and aligned to the surface, as one undoable step; the 3D inspector's Model field picks a project model (Models, ModelThumbnail, SelectModel, PlacementAt3D, PlaceModel3D, PlaceModelAt3D, DropModelFiles, SetObjectModel).
  • Projects that bring their own assets: with ProjectAssets set, an opened project's scenes draw its atlases, the asset browser lists them and its scene files place as instances, through a project.Resolver over its directory, and OpenProjectScene opens a project on any of its scenes (ProjectAssets, OpenProjectScene; package editorcmd is the command line that sets them up).
  • Editor plugins built into the editor binary and turned on by the project's game.yaml, which add docked panels, inspectors for their component types, 2D and 3D viewport tools (with camera pick ray and 3D projection overlays via Press3D, Draw3D, OnDragBegin3D/Move3D/End3D/Cancel3D, OnHover3D), and per-component 3D gizmos with object-space point/line/box handles that commit as one undo step (Plugin, ComponentGizmo3D, GizmoHandle3D, Projection3D, RegisterPlugin, SetPluginEnabled).
  • A file browser that lists the open project's files and moves or renames them with every reference to them rewritten, on disk and in the open scene and project, as one undoable step (ProjectFiles, MoveFile through package refs, FilesView).
  • A Project Settings panel over game.yaml editing general metadata, window, display, autoload scenes/resources and main scene, and editor plugins through EditProject with inline validation errors, canonical-save notice, undo/redo, and synced nsgo.yaml saving (ProjectSettingsPanelView, SetProjectSettingsOpen).
  • A 2D viewport that pans, zooms and frames through the editor's own view, separate from the scene's camera, whose frame it outlines (View2D, PanView2D, ZoomView2DAt, FrameSelection2D, FrameAll2D, ResetView2D).
  • A 2D transform gizmo that drags an object to move it, keeping the grab offset, moves it along its own axes, turns it with a ring and scales it with corner and edge handles (Shift keeps the aspect ratio), each drag one undoable step that Escape or a cancelled gesture puts back (BeginDrag2D, UpdateDrag2D, EndDrag2D, CancelDrag2D, PickGizmo2D).
  • Interactive 2D viewport shape handles for registered point, rect, circle and polygon component fields (with a ShowAllShapes toggle, optional SnapToGrid snapping, polygon vertex add/remove, and undoable SetComponentField commits via BeginShapeDrag2D, UpdateShapeDrag2D, EndShapeDrag2D, CancelShapeDrag2D, AddPolygonVertex, RemovePolygonVertex), plus drag (OnDragBegin, OnDragMove, OnDragEnd, OnDragCancel) and hover (OnHover) callbacks on PluginTool.
  • An audio bus mixer over game.yaml's audio section with undoable bus and effect-chain editing and live audition through sound.Mixer (AudioMixerPanelView, AddAudioBus, AddAudioBusEffect, AuditionAudioBus).
  • A Problems panel that runs assetcheck.CheckWith (with the editor's component registry) and project.Check over the open project off the UI goroutine on open, save and file move, shows one row per problem with file, line and message, navigates to scenes or selects files on press, and displays the live problem count in the status bar (CheckProblems, Problems, OpenProblem, ProblemsView).
  • An Export & Release panel over game.yaml's export section with undoable preset and target editing, pre-flight asset credits verification, streaming dry-run and release builds, and automatic output folder opening (ExportPanelView, AddExportPreset, CheckExportCredits, StartExportBuild), plus a full-window Build and Release screen (BuildReleaseScreenView, OpenBuildReleaseScreen, CloseBuildReleaseScreen, BuildReleaseScreenOpen, StartReleaseBuild, StopReleaseBuild, ResumeReleaseBuild, SetBuildPresetIncluded, SetBuildPresetFixProposal, ApplyBuildPresetFixAndRebuild) showing BEFORE EVERY BUILD checks (`nsgo check`, smoke playtest, and `game.yaml` budgets), per-preset ordered steps (`Check project`, `Compile Go`, `Pack assets`, `Sign`, `Smoke playtest`, `Measure`) with `build/<platform>.log` streaming, failure isolation with agent preset fix diffs, finished size breakdowns against the last release, and platform readiness checks.
  • Project-wide Search and Find References covering file names and paths, file UIDs, scene object IDs and names, component types, and prefab/scene references, plus incoming file references powered by refs.Scan with file and line numbers and jump-to-file/scene-object navigation (Search, FindReferences, ShowReferences, OpenSearchResult, OpenReference, RefreshSearch, SearchPanelView).
  • Running the open project with `go tool game dev` (optionally starting at the open scene or with `-automation`) from the toolbar or F5 shortcut with full process-tree cleanup on Stop, paired with a docked Output / Log panel that streams stdout and stderr, keeps a timestamped history of editor status and error messages, supports Clear and Errors-only filtering, and opens clicked `file:line` scene links (RunGame, RunGameWith, StopGame, Close, OutputPanelView, OpenOutputEntry).
  • A Remote scene tree tab and live inspector connected to the running game over MCP (`go tool nsgo mcp` or an injected transport via `github.com/modelcontextprotocol/go-sdk/mcp`), listing live scenes, layers, and entities with hierarchy (`game_scenes_list`, `game_layers_list`, `game_entities_list`), inspecting and editing live components (`game_entity_inspect`, `game_component_set`) with tracked Live Changes that can be reverted, discarded, or kept in the open scene as a single undo step, plus live Pause/Resume/Step N/Time Scale controls (`game_loop_*`), tunables (`game_tunable_*`), and a debug console line (`game_console_exec`) (ConnectRemote, ConnectRemoteCommand, DisconnectRemote, RefreshRemote, SelectRemoteEntity, SetRemoteComponentField, KeepRemoteLiveChangesInScene, DiscardRemoteLiveChanges, RemotePause, RemoteResume, RemoteStep, RemoteSetTimeScale, RemoteSetTunable, RemoteExecConsole, NewRemoteBridgeServer).
  • A Profiler for the running game: a Play-mode "FRAME TIME · LAST 60 S" strip under the viewport (ProfilerStripView) showing avg, p99, allocs/frame, 8.3 ms / 16.7 ms thresholds, time axis and labelled spikes, plus a full docked Profiler panel (ProfilerPanelView) opened from the strip, toolbar or command registry that polls game_perf_readout and game_perf_zones over MCP (ConnectProfiler, ConnectProfilerMCP, ConnectProfilerCommand, ConnectProfilerScope, PollProfiler), charts frame/update/draw time, FPS, allocations/GC and asset memory, lists zones sorted by cost with Reset (game_perf_reset), and exports recorded frames as Chrome/Perfetto trace JSON through debug.Profiler.WriteChromeTrace (ExportProfilerTrace, ExportProfilerTraceFile).
  • A unified command registry driving platform-aware keyboard shortcuts (guarded against firing while text fields have focus), a desktop application menu bar (File, Edit, View, Project), a searchable Command Palette (ui.CommandDialog) covering built-in commands, plugin commands, plugin tools, plugin panels and project scenes/files, and clash-checked plugin command registration (EditorCommand, PluginCommand, RegisterCommand, ApplicationMenu, CommandPaletteView).
  • Scene tabs and scene files: a tab bar above the viewport (SceneTabsView) keeping each open scene's document, undo/redo history, selection, 2D/3D view transform and dirty marker separate while sharing the project file across tabs (Tabs, ActiveTab, TabCount, SelectTab, SaveTab, CloseTab, RequestCloseTab, OpenInstancedScene, OpenBaseScene); opening an already-open scene switches to its tab, saving a scene rebuilds other open tabs that instance or inherit it, closing a dirty tab prompts to save, discard or cancel, and New Scene, Save As and Revert operate on scenes (OpenScene, NewScene, SaveSceneAs, RevertScene, SceneDirty, AnySceneDirty, HasUnsavedChanges, Save, SaveAll).
  • Asset import settings inspection and rebuilding: selecting an image, sound, font, or 3D model in the file browser displays its kind-specific import settings (inheriting target defaults from game.yaml with per-field Reset), an interactive image slice-grid preview with draggable default and per-cell pivot markers, and the credit section in the inspector, writes validated *.import.yaml sidecars through importsettings.Encode as undoable steps, and runs `go tool game assets` via Reimport or Build Assets off the UI goroutine with Output panel streaming and live atlas/texture reloading in the asset browser and viewport (InspectAssetImport, EditAssetImportSettings, SetImageImportPivot, SetImageImportDefaultPivot, SetImageImportCellPivot, BeginImagePivotDrag, DrawImageImportPreview, SetAssetImportCredit, ResetAssetImportField, ReimportAsset, BuildAssets, ReloadAssets).
  • A Start Screen (StartScreenView) with per-user strict versioned YAML recent projects persistence (RecentProjects, ParseRecentProjects, EncodeRecentProjects, DefaultRecentProjectsPath) marking missing folders, folder-picker opening (BrowseAndOpenProject, PickProjectFolder), dynamic template gallery and `game new` project creation with live name validation and streaming output (ProjectTemplates, StartCreateProject), Open Demo (OpenDemo, NewDemo), and clean project switching with unsaved-edits confirmation (HasUnsavedChanges, RequestOpenProject, ConfirmSaveAndSwitch, ConfirmDiscardAndSwitch).
  • Localized editor UI (English and Simplified Chinese via embedded versioned l10n YAML catalogs) with live language switching without restart, plugin translation catalogs (Plugin.Catalog, Plugin.LocaleYAML, Editor.PluginT, Editor.PluginPlural), and per-user versioned YAML Editor Settings (language and light/dark/system appearance via core.Scope.SetAppearance) stored outside any project (EditorSettings, ParseEditorSettings, EncodeEditorSettings, Editor.LoadSettings, Editor.SetLanguage, Editor.SetAppearance, EditorSettingsDialogView).
  • A HUD and menu layout screen (HUDLayoutView, OpenHUDScreen, OpenHUDScreenFile, OpenHUDScreenDoc) that previews every *.screen.yaml file simultaneously across Phone 19.5:9 with notch, Tablet 4:3, Desktop 16:9 and Ultrawide 21:9 in any project language (SetHUDLocale), displays Safe areas / Anchors / Touch areas / Focus order overlays, compares localized widths in a TEXT WIDTH, PX table, inspects anchors (3×3 grid plus fill), safe-area placement, Fixed / Fit text sizing, localized text with 1.5× overflow zoom, and live GAME CHECK diagnostics backed by gameui.CheckScreen, and supports undoable container reordering, spacing edits, and direct touch-control dragging written back to the screen file in one undo step.
  • Object-by-object scene merge conflict resolution (MergeConflictView, OpenMergeConflict, OpenMergeConflictSession, ResolveMergeConflict, TakeAllAgentMergeSuggestions, ApplyMergeCustomYAML, FinishMerge, AbortMerge) displaying MINE, THEIRS, and live RESULT scene previews, auto-merged items (MERGED BY ID), per-object Agent/Mine/Theirs options with reasons, hand YAML editing, game check and short playtest verification, Git merge commit creation, and clean merge abort.
  • A dockable, resizable panel workspace built on NSGo's ui.DockArea with drag-to-move, drag-to-tab, resize handles, View > Panels visibility toggles, Reset Layout (CmdResetLayout, ResetLayout), and per-user strict versioned YAML persistence outside any project (LayoutFile, ParseLayout, EncodeLayout, DefaultLayoutPath, SetLayoutPath, DockLayout, PanelVisible, SetPanelVisible, TogglePanel, MovePanel, Panels), placing plugin panels at their declared Dock on first use and remembering where the user moved them afterwards.
  • A native NSGo UI root view (EditorView) combining the start screen, scene merge conflict resolver, HUD layout screen, toolbar, dockable panel workspace, command palette, unsaved-edits dialog, and editor settings dialog.

Index

Constantes

const (
	// RightTabInspector shows the property / scene / layer inspector (default).
	RightTabInspector RightRailTab = "inspector"
	// RightTabAgent shows the Agent panel with status chip, threads, and composer.
	RightTabAgent RightRailTab = "agent"
	// RightTabHistory shows the unified timeline of agent and manual steps.
	RightTabHistory RightRailTab = "history"

	// RightRailInspector, RightRailAgent, and RightRailHistory alias the right-rail tabs.
	RightRailInspector = RightTabInspector
	RightRailAgent     = RightTabAgent
	RightRailHistory   = RightTabHistory
)
const (
	// AgentAPIKeySecretAccount is the account name under NSGo's core.Secrets where the built-in agent's API key is stored.
	// It is never written to project files, EditorSettings YAML, or logs.
	AgentAPIKeySecretAccount = "agent.anthropic.api_key"

	// DefaultBuiltInAgentEndpoint is the default Anthropic Messages API endpoint used by the built-in agent.
	DefaultBuiltInAgentEndpoint = "https://api.anthropic.com/v1/messages"

	// DefaultBuiltInModel is the default model used for "Anthropic API · default".
	DefaultBuiltInModel = "claude-sonnet-4-6"

	// DefaultBuiltInFastModel is the default model used for "Anthropic API · fast".
	DefaultBuiltInFastModel = "claude-haiku-4-5"
)
const (
	// AgentKeychainServiceName is the system keychain service identifier used to store
	// built-in model API keys outside any game project or settings file.
	AgentKeychainServiceName = "dev.nsgo.game.agent"
	// DefaultAgentAPIKeyAccount is the default keychain account for the built-in API connection.
	DefaultAgentAPIKeyAccount = "anthropic"
	// DefaultBuiltInProviderName is the display name of the built-in API connection shown in Settings › Models and connections.
	DefaultBuiltInProviderName = "Anthropic API"
	// ToolNameGameDeleteFile is the MCP tool name for deleting a file, which is turned off by default.
	ToolNameGameDeleteFile = "game_delete_file"
	// DefaultRunningGameMCPServerName is the MCP server identifier for the running game via `nsgo dev`.
	DefaultRunningGameMCPServerName = "nsgo-game"
	// DefaultWeeklyRequestLimit is the default weekly agent request budget shown in Settings › Usage and privacy.
	DefaultWeeklyRequestLimit = 300
)
const (
	// DefaultAutoSaveDelay is how long kept edits wait before saving automatically.
	DefaultAutoSaveDelay = 2 * time.Second
	// DefaultSavingIndicatorDelay is how long a save must stay in flight before the status bar shows "Saving…", avoiding flicker on quick saves.
	DefaultSavingIndicatorDelay = 300 * time.Millisecond
)
const (
	DefaultDownloadSizeBudgetMB = 80.0
	DefaultFrameTimeP95BudgetMs = 16.7
	DefaultBudgetQualityProfile = "low"
)

Default build budget thresholds used when game.yaml does not declare export.budgets.

const (
	CmdNewProject             = "file.newProject"
	CmdOpenProject            = "file.openProject"
	CmdStartScreen            = "file.startScreen"
	CmdSave                   = "file.save"
	CmdCloseTab               = "file.closeTab"
	CmdNextTab                = "view.nextTab"
	CmdPrevTab                = "view.prevTab"
	CmdOpenInstancedScene     = "scene.openInstanced"
	CmdOpenBaseScene          = "scene.openBase"
	CmdUndo                   = "edit.undo"
	CmdRedo                   = "edit.redo"
	CmdCopy                   = "edit.copy"
	CmdCut                    = "edit.cut"
	CmdPaste                  = "edit.paste"
	CmdPasteInto              = "edit.pasteInto"
	CmdDelete                 = "edit.delete"
	CmdDuplicate              = "edit.duplicate"
	CmdGroup                  = "edit.group"
	CmdUngroup                = "edit.ungroup"
	CmdToolSelect             = "tool.select"
	CmdToolMove               = "tool.move"
	CmdToolRotate             = "tool.rotate"
	CmdToolScale              = "tool.scale"
	CmdToolPan                = "tool.pan"
	CmdToolPlace              = "tool.place"
	CmdToolPaintTile          = "tool.paint"
	CmdToolEraseTile          = "tool.erase"
	CmdToolFillTile           = "tool.fill"
	CmdToolTerrain            = "tool.terrain"
	CmdToolRectTile           = "tool.rect"
	CmdToolLineTile           = "tool.line"
	CmdToolStampTile          = "tool.stamp"
	CmdToolRandomTile         = "tool.random"
	CmdCopyTileRegion         = "tile.copy"
	CmdCutTileRegion          = "tile.cut"
	CmdPasteTileRegion        = "tile.paste"
	CmdToolNavTestPath        = "tool.navTestPath"
	CmdGizmoTranslate         = "gizmo.translate"
	CmdGizmoRotate            = "gizmo.rotate"
	CmdGizmoScale             = "gizmo.scale"
	CmdGizmoCollider          = "gizmo.collider"
	CmdFitCollider3D          = "edit.fitCollider3d"
	CmdView2D                 = "view.mode2d"
	CmdView3D                 = "view.mode3d"
	CmdShadingLit             = "view.shading.lit"
	CmdShadingUnlit           = "view.shading.unlit"
	CmdShadingWire            = "view.shading.wireframe"
	CmdNavMeshPanel           = "view.navmesh"
	CmdNavMeshOverlay         = "view.navmesh.overlay"
	CmdBakeNavMesh3D          = "project.bakeNavMesh3D"
	CmdFrameSelection         = "view.frame"
	CmdToggleLightingPreview  = "view.lighting"
	CmdToggleAllShapes        = "view.shapes"
	CmdToggleSnapGrid         = "view.snap"
	CmdToggleShowGrid         = "view.grid"
	CmdToggleSnapPixel        = "view.snap.pixel"
	CmdToggleSnapRotation     = "view.snap.rotation"
	CmdToggleSnapScale        = "view.snap.scale"
	CmdToggleNavMesh2D        = "view.navmesh2d"
	CmdViewportOverlays       = "view.overlays"
	CmdAskAgent               = "agent.askInPlace"
	CmdAgentTab               = "view.agentTab"
	CmdInspectorTab           = "view.inspectorTab"
	CmdCommandPalette         = "view.palette"
	CmdShortcutsSheet         = "view.shortcuts"
	CmdToggleTasks            = "agent.tasks"
	CmdHistoryPanel           = "view.history"
	CmdResetLayout            = "view.resetLayout"
	CmdPlayStop               = "project.play"
	CmdRunGame                = "project.run"
	CmdProjectSettings        = "project.settings"
	CmdAudioMixer             = "project.mixer"
	CmdInputMap               = "project.inputMap"
	CmdLocalization           = "project.l10n"
	CmdParticleEditor         = "project.particles"
	CmdHUDLayout              = "project.hud"
	CmdMaterialEditor         = "project.material"
	CmdExport                 = "project.export"
	CmdBuildRelease           = "project.buildRelease"
	CmdProfiler               = "project.profiler"
	CmdOutputPanel            = "view.output"
	CmdProblemsPanel          = "view.problems"
	CmdSearchPanel            = "view.search"
	CmdDataTable              = "project.dataTable"
	CmdLibraryPanel           = "view.library"
	CmdAnimate                = "project.animate"
	CmdBuildAssets            = "project.buildAssets"
	CmdStopGame               = "project.stopGame"
	CmdRunOpenScene           = "project.runOpenScene"
	CmdLayersPanel            = "view.layers"
	CmdFileBrowser            = "view.fileBrowser"
	CmdAssetBrowser           = "view.assetBrowser"
	CmdTerrainEditor          = "project.terrain"
	CmdCheckProblems          = "project.check"
	CmdFindUsages             = "project.findUsages"
	CmdEditorSettings         = "editor.settings"
	CmdShortcutsSettings      = "editor.shortcuts"
	CmdChanges                = "git.changes"
	CmdMergeConflicts         = "git.mergeConflicts"
	CmdPlaytestReport         = "project.playtestReport"
	CmdToggleAssetsMode       = "view.assets"
	CmdMakeInstanceLocal      = "scene.makeLocal"
	CmdApplyOverridesToSource = "scene.applyOverridesToSource"
	CmdRevertOverrides        = "scene.revertOverrides"
	CmdGeneratedAssets        = "project.generatedAssets"
	CmdConnectAgent           = "agent.connect"
	CmdReviewCode             = "agent.reviewCode"
	CmdAgentPanel             = "view.agent"
	CmdAttachReferenceImage   = "agent.attachImage"
	CmdPlayMark               = "play.mark"
	CmdAskFrozenFrame         = "play.askFrozenFrame"
	CmdPermissionsSettings    = "settings.permissions"
	// The 3D viewport's axis views and projection: each axis view looks at the camera's Target along a world axis (SetView3D), and the orthographic command switches between perspective and orthographic (SetOrthographic3D).
	CmdView3DFront        = "view.3d.front"
	CmdView3DBack         = "view.3d.back"
	CmdView3DRight        = "view.3d.right"
	CmdView3DLeft         = "view.3d.left"
	CmdView3DTop          = "view.3d.top"
	CmdView3DBottom       = "view.3d.bottom"
	CmdView3DOrthographic = "view.3d.orthographic"
	CmdView3DCamera       = "view.3d.camera"
	CmdGizmoSpace3D       = "gizmo.3d.space"
	CmdEnvironmentPanel   = "scene.environment"
	CmdAddReflectionProbe = "scene.addReflectionProbe"
	CmdAddLightProbeGrid  = "scene.addLightProbeGrid"
	CmdBakeProbes3D       = "project.bakeProbes3D"
	CmdReplayTips         = "help.replayTips"
	CmdReviewNext         = "review.next"
	CmdReviewPrev         = "review.prev"
	CmdReviewNote         = "review.note"
	CmdReviewToggleRevert = "review.toggleRevert"
	CmdReviewPeekBefore   = "review.peekBefore"
	CmdReviewKeep         = "review.keep"
	CmdReviewRevertAll    = "review.revertAll"
	CmdNewAgentThread     = "agent.newThread"
	// Viewport sketch layer commands (issue #1025).
	CmdSketchToggle              = "sketch.toggle"
	CmdSketchToolPen             = "sketch.tool.pen"
	CmdSketchToolArrow           = "sketch.tool.arrow"
	CmdSketchToolBox             = "sketch.tool.box"
	CmdSketchToolText            = "sketch.tool.text"
	CmdSketchAddMarkAtCursor     = "sketch.addMarkAtCursor"
	CmdSketchUndoMark            = "sketch.undoMark"
	CmdSketchToggleMarks         = "sketch.toggleMarks"
	CmdSketchClear               = "sketch.clear"
	CmdSketchDone                = "sketch.done"
	CmdSketchSend                = "sketch.send"
	CmdSketchApproveReading      = "sketch.approveReading"
	CmdSketchCorrectMark         = "sketch.correctMark"
	CmdSketchToggleReviewOverlay = "sketch.toggleReviewOverlay"
	CmdSketchKeepReview          = "sketch.keepReview"
	CmdSketchRevertReview        = "sketch.revertReview"
	CmdKeepAgentTurn             = "agent.turn.keep"
	CmdRevertAgentTurn           = "agent.turn.revert"
	CmdStopAgentTurn             = "agent.turn.stop"
)

Built-in editor command IDs registered in the unified command registry.

const (
	PanelViewport     = "viewport"
	PanelSceneTree    = "scene_tree"
	PanelLayers       = "layers"
	PanelAssets       = "assets"
	PanelFiles        = "files"
	PanelLibrary      = "library"
	PanelInspector    = "inspector"
	PanelProblems     = "problems"
	PanelOutput       = "output"
	PanelProfiler     = "profiler"
	PanelAnimation    = "animation"
	PanelSearch       = "search"
	PanelStates       = "states"
	PanelTileset      = "tileset"
	PanelTerrain      = "terrain"
	PanelRig          = "rig"
	PanelParticles    = "particles"
	PanelMaterial     = "material"
	PanelEnvironment  = "environment"
	PanelDataTable    = "datatable"
	PanelNavMesh      = "navmesh"
	PanelLocalization = "localization"
)

Built-in dock panel keys stored in LayoutFile and used by ui.DockArea.

const (
	FirstRunTipKeepRevert   = "first_review.keep_revert"
	FirstRunTipHoldB        = "first_review.hold_b"
	FirstRunTipAskSelection = "first_review.ask_selection"
)

Onboarding tip IDs persisted in EditorSettings.SeenTips so each first-review tip shows once per person and returns when the user triggers Help › Replay tips.

const (
	FirstRunAPIKeyKeychainService = "dev.nsgo.game.agent"
	FirstRunAPIKeyKeychainAccount = "api_key"
)

First-run API key system keychain service and account identifiers (never written to YAML).

const (
	// OverlayCollisionShapes draws registered non-trigger component shape fields and 2D physics colliders.
	OverlayCollisionShapes = "collision_shapes"
	// OverlayTriggers draws trigger/sensor/area component shape fields and 2D physics trigger volumes.
	OverlayTriggers = "triggers"
	// OverlayConnections draws curved arrows labelled "event → handler" between connected objects.
	OverlayConnections = "connections"
	// OverlayPatrolPaths draws enemy/actor patrol ranges and waypoint paths.
	OverlayPatrolPaths = "patrol_paths"
	// OverlayNavigation draws the built 2D navigation mesh polygons, portals, and navregion2d outlines.
	OverlayNavigation = "navigation"
	// OverlayCameraBounds draws the scene camera bounds rectangle and its size caption.
	OverlayCameraBounds = "camera_bounds"
	// OverlayLabels draws object name/ID labels below visible objects.
	OverlayLabels = "labels"
)

Built-in 2D viewport overlay IDs, shared between the editor's Overlays popover, EditorSettings.ViewportOverlays, and editormcp's viewport_image tool.

const (
	PermissionRunGameCheck = "game check"
	PermissionRunPlaytests = "playtests"
	PermissionRunShell     = "shell"
)

Well-known run target names matched by PermissionActionRun rules.

const (
	FixKindUpdateConnection  = "update_connection"
	FixKindRemoveConnection  = "remove_connection"
	FixKindSetSprite         = "set_sprite"
	FixKindSetMaterial       = "set_material"
	FixKindSetObjectID       = "set_object_id"
	FixKindSetComponentField = "set_component_field"
	FixKindRemoveComponent   = "remove_component"
	FixKindReplaceLine       = "replace_line"
)

Supported ProblemFixEdit.Kind values for agent-proposed problem fixes.

const (
	ScopeGlobal     = "global"
	ScopeViewport   = "viewport"
	ScopeViewport2D = "viewport2d"
	ScopeViewport3D = "viewport3d"
	ScopeSceneTree  = "sceneTree"
	ScopeTile       = "tile"
	ScopeSketch     = "sketch"
	ScopeAnimation  = "animation"
	ScopePlay       = "play"
	ScopeReview     = "review"
	ScopeAgent      = "agent"
)

Keyboard scope identifiers for editor and plugin commands. Rebinding checks for conflicts only within the same scope; the same key in different scopes is allowed.

const (
	SpecFontFamilySans = "Inter"
	SpecFontFamilyMono = "JetBrains Mono"

	SpecFontTitleSize     core.Points     = 14
	SpecFontTitleWeight   core.FontWeight = core.FontWeightSemibold // 600
	SpecFontBodySize      core.Points     = 12.5
	SpecFontBodyWeight    core.FontWeight = core.FontWeightNormal // 400
	SpecFontSectionSize   core.Points     = 11
	SpecFontSectionWeight core.FontWeight = core.FontWeightSemibold // 600
	SpecFontSectionTrack  core.Points     = 0.66                    // +6% tracking on 11 px
	SpecFontCodeSize      core.Points     = 11.5
	SpecFontCodeWeight    core.FontWeight = core.FontWeightNormal // 400
)

Typography tokens from docs/design/editor/Spec.dc.html ("Type, space, shape").

const (
	SpecSpace4  core.Points = 4
	SpecSpace8  core.Points = 8
	SpecSpace12 core.Points = 12
	SpecSpace16 core.Points = 16
	SpecSpace24 core.Points = 24
)

Spacing scale tokens from docs/design/editor/Spec.dc.html: 4, 8, 12, 16, 24 px only.

const (
	SpecRadiusControl core.Points = 6  // Controls, inputs, tree rows, pills
	SpecRadiusButton  core.Points = 8  // Buttons
	SpecRadiusCard    core.Points = 12 // Cards, popovers, toasts
	SpecRadiusDialog  core.Points = 18 // Dialogs
)

Corner radius tokens from docs/design/editor/Spec.dc.html.

const (
	SpecRowHeight        core.Points = 28 // Rows and tool buttons
	SpecMinHitSize       core.Points = 28 // Minimum interactive hit area (28 x 28)
	SpecButtonHeight     core.Points = 30 // Standard button height (30-32 px)
	SpecButtonTallHeight core.Points = 32 // Tall button height (30-32 px)
	SpecHeaderHeight     core.Points = 44 // Header / toolbar height
	SpecBorderWidth      core.Points = 1  // 1 px inner borders in Line or LineRaised
	SpecIconSize         core.Points = 15 // Inline stroke icon size
	SpecIconStrokeWidth  float32     = 1.8
)

Height, border, and icon geometry tokens from docs/design/editor/Spec.dc.html.

const (
	SpecMotionHover      = 120 * time.Millisecond  // Hover and press transitions
	SpecMotionPanel      = 180 * time.Millisecond  // Panels, popovers, and toasts
	SpecMotionOverlay    = 240 * time.Millisecond  // Agent change overlays fading in
	SpecMotionAgentPulse = 1600 * time.Millisecond // Agent outline pulse (100% <-> 45% opacity)

	SpecAgentPulseMinOpacity float32 = 0.45
	SpecAgentPulseMaxOpacity float32 = 1.0
)

Motion tokens from docs/design/editor/Spec.dc.html ("Motion"). All durations drop to 0 under Env.ReduceMotion (see SpecMotionDuration).

const (
	MinView2DZoom float32 = 1.0 / 64
	MaxView2DZoom float32 = 64
)

The range View2D.Zoom is clamped to.

const (
	// OverlayChangeFadeDuration is the fade-in duration for Added, Changed, and Removed overlays.
	OverlayChangeFadeDuration = 240 * time.Millisecond
	// OverlayAgentPulsePeriod is the full pulse cycle duration for the Agent working outline.
	OverlayAgentPulsePeriod = 1600 * time.Millisecond
	// OverlayAgentPulseMinAlpha is the minimum opacity reached during an Agent working pulse (45%).
	OverlayAgentPulseMinAlpha float32 = 0.45

	// OverlayBaseOffset is the default gap in points between an object's bounds and its overlay outline.
	OverlayBaseOffset float32 = 3
	// OverlaySelectionAgentGap is how much further out the Agent working outline sits when
	// paired with the person's Selection on the same object.
	OverlaySelectionAgentGap float32 = 3
)

Spec viewport overlay timing and geometry constants (docs/design/editor/Spec.dc.html).

const (
	// AgentBriefPreviewID is the preview target ID used when hovering or focusing the brief.yaml Always chip.
	AgentBriefPreviewID = "brief"
)
const AgentInstallCommand = "go tool game mcp install"

AgentInstallCommand is the one-time command shown in the Connect dialog and copied by its Copy button.

const AgentStuckFailureThreshold = 3

AgentStuckFailureThreshold is the number of consecutive failures of the same tool that pauses a request.

const AgentThreadFileVersion = 1

AgentThreadFileVersion is the YAML schema version of per-thread files under .nsgo/threads/<id>.yaml.

const AgentThreadSchemaComment = "# yaml-language-server: $schema=" + AgentThreadSchemaURL

AgentThreadSchemaComment is the first line EncodeAgentThreadYAML writes: a YAML comment pointing a YAML language server at AgentThreadSchemaURL. ParseAgentThreadYAML ignores it like any other comment.

const AgentThreadSchemaURL = "https://game.nsgo.dev/schemas/agent-thread.v1.json"

AgentThreadSchemaURL is where the JSON Schema of version 1 agent thread files is published.

const AgentThreadVersion = 1

AgentThreadVersion is the schema version of *.thread.yaml files stored under .nsgo/threads/.

const AgentThreadsDir = ".nsgo/threads"

AgentThreadsDir is the project-relative directory where the editor stores one versioned YAML file per agent thread. Creating it writes a .gitignore in .nsgo/ so threads stay local and ignored by git.

const AgentWaitingNotifyDelay = 30 * time.Second

AgentWaitingNotifyDelay is how long an unanswered Waiting-for-you permission or question request stays open in the foreground before also sending a system notification (docs/design/editor/AgentStates.dc.html).

const AutomationsCheckpointsDir = ".nsgo/checkpoints"

AutomationsCheckpointsDir is the git-ignored project-relative directory storing pre-run automation checkpoints.

const AutomationsFileName = "automations.yaml"

AutomationsFileName is the shared project-root YAML file holding agent automations beside game.yaml.

const AutomationsSchemaComment = "# yaml-language-server: $schema=" + AutomationsSchemaURL

AutomationsSchemaComment is the first line EncodeAutomations writes: a YAML comment pointing a YAML language server at AutomationsSchemaURL. ParseAutomations ignores it like any other comment.

const AutomationsSchemaURL = "https://game.nsgo.dev/schemas/automations.v1.json"

AutomationsSchemaURL is where the JSON Schema of version 1 automations files is published. EncodeAutomations writes it in a yaml-language-server comment on the first line so editors and AI tools validate and complete automations.yaml as it is written.

const AutomationsStateFile = ".nsgo/automations-state.yaml"

AutomationsStateFile is the git-ignored project-relative YAML file storing local weekly run history, daily trigger watermarks, and pause-for-today state.

const AutomationsVersion = 1

AutomationsVersion is the YAML schema version of project automations files (automations.yaml).

const BuildFailureNotice = "Other platforms keep building. Nothing was uploaded."

BuildFailureNotice is shown on every failed preset to reassure the author that remaining targets continue and nothing is uploaded.

const CheckpointManifestFile = "manifest.yaml"

CheckpointManifestFile is the manifest filename inside each checkpoint directory under CheckpointsDir.

const CheckpointSchemaURL = "https://game.nsgo.dev/schemas/checkpoint.v1.json"

CheckpointSchemaURL is the published JSON Schema URL for checkpoint manifests.

const CheckpointVersion = 1

CheckpointVersion is the schema version of checkpoint manifest YAML files stored under .nsgo/checkpoints/.

const CheckpointsDir = ".nsgo/checkpoints"

CheckpointsDir is the slash-separated path from a project root where persistent turn checkpoints are stored.

const DefaultAgentThreadID = "default"

DefaultAgentThreadID is the filename stem of the default project thread file (.nsgo/threads/default.thread.yaml).

const DefaultCheckpointMaxBytes int64 = 128 << 20

DefaultCheckpointMaxBytes is the default total disk budget for .nsgo/checkpoints before the oldest checkpoints are pruned (128 MiB).

const DefaultReleaseNotesFile = "release-notes.md"

DefaultReleaseNotesFile is the project-relative Markdown file written by the Build and Release screen's RELEASE NOTES editor when no explicit -release-notes path has been configured in the Export panel.

const KeychainServiceName = "dev.nsgo.game.publish"

KeychainServiceName is the system keychain service identifier used to store release upload credentials outside any game project directory.

const LayoutFileName = "layout.yaml"

LayoutFileName is the filename of the per-user editor dock layout stored in the OS user config directory.

const LayoutVersion = 1

LayoutVersion is the schema version of the per-user editor dock layout YAML file.

const MaterialPreviewSize = 128

MaterialPreviewSize is the width and height in pixels of the Material Editor's rendered 3D preview.

const MaxRecentProjects = 20

MaxRecentProjects caps how many recent project entries are retained.

const ModelThumbnailSize = 64

ModelThumbnailSize is the width and height in pixels of the thumbnails ModelThumbnail renders.

const PermissionsFileName = "permissions.yaml"

PermissionsFileName is the tracked project file beside game.yaml that stores shared MCP agent permission profiles and rules. Per-machine editor state stays under git-ignored .nsgo/ and .game/, while shared project permissions live beside game.yaml so teams track and review them in Git.

const PermissionsSchemaComment = "# yaml-language-server: $schema=" + PermissionsSchemaURL

PermissionsSchemaComment is the first line EncodePermissions writes: a YAML comment pointing a YAML language server at PermissionsSchemaURL. ParsePermissions ignores it like any other comment.

const PermissionsSchemaURL = "https://game.nsgo.dev/schemas/permissions.v1.json"

PermissionsSchemaURL is where the JSON Schema of version 1 project permission rules files is published. EncodePermissions writes it in a yaml-language-server comment on the first line so editors and AI tools validate and complete permissions.yaml as it is edited.

const PermissionsVersion = 1

PermissionsVersion is the YAML schema version of project permission rules files (permissions.yaml).

const ProjectRulesFileName = "AGENTS.md"

ProjectRulesFileName is the shared Markdown instructions file at a project's root read by Claude Code, Codex, and the built-in editor agent.

const RecentProjectsFileName = "recent-projects.yaml"

RecentProjectsFileName is the filename of the per-user recent projects list.

const RecentProjectsVersion = 1

RecentProjectsVersion is the schema version of the per-user recent projects YAML file.

const SettingsSchemaComment = "# yaml-language-server: $schema=" + SettingsSchemaURL

SettingsSchemaComment is the first line EncodeEditorSettings writes: a YAML comment pointing a YAML language server at SettingsSchemaURL. ParseEditorSettings ignores it like any other comment.

const SettingsSchemaURL = "https://game.nsgo.dev/schemas/editor-settings.v1.json"

SettingsSchemaURL is where the JSON Schema of version 1 editor settings files is published. EncodeEditorSettings names it in a yaml-language-server comment on the first line so editors and AI tools validate and complete editor settings files as they are written.

const SettingsVersion = 1

SettingsVersion is the YAML schema version of per-user editor settings files.

const ViewStateFile = ".game/editor.yaml"

ViewStateFile is where the editor keeps its view of each scene of a project, the 3D viewport's camera among it, as a slash-separated path from the project's root: a file of the editor's own, under the .game folder a project leaves out of version control, so moving the camera never changes a file anyone reviews.

Variables

var (
	// ErrAgentLimitReached is returned when a request cannot run immediately because the weekly request limit has been reached.
	ErrAgentLimitReached = errors.New("editor: weekly agent request limit reached")

	// ErrAgentAPIKeyMissing is returned when the built-in agent has no API key stored in NSGo secrets or the system keychain.
	ErrAgentAPIKeyMissing = errors.New("editor: built-in agent API key is not configured in system keychain")

	// ErrBuiltInEndpointInsecure is returned when BuiltInAgentEndpoint is not an https:// URL (or loopback http:// URL for local testing).
	ErrBuiltInEndpointInsecure = errors.New("editor: built-in agent endpoint must use https:// (or loopback http://)")
)
var (
	// ErrNonLANAddress is returned when the web build server is asked to bind to or advertise a non-local/non-LAN IP.
	ErrNonLANAddress = errors.New("editor: web build server refuses non-LAN address")
	// ErrNoWebBuildDir is returned when no built web directory or archive can be located to serve.
	ErrNoWebBuildDir = errors.New("editor: no web build directory found to serve")
	// ErrWebBridgeSessionNotFound is returned when calling a tool on an unknown or disconnected phone session.
	ErrWebBridgeSessionNotFound = errors.New("editor: web MCP bridge session not found")
	// ErrNoAndroidDevice is returned when running an Android build on USB without a connected Android device.
	ErrNoAndroidDevice = errors.New("editor: no connected Android USB device")
	// ErrAndroidBuildNotReady is returned when attempting to run on an Android USB device before the Android build succeeds.
	ErrAndroidBuildNotReady = errors.New("editor: Android build has not finished yet")
)
var (
	// ErrNoChangesSession is returned when a Changes action runs while the Changes panel has no active session.
	ErrNoChangesSession = errors.New("editor: changes panel is not open")
	// ErrMergeConflictInProgress is returned when a Changes action is blocked by an unresolved Git merge conflict.
	ErrMergeConflictInProgress = errors.New("editor: resolve the active Git merge conflict before using Changes")
	// ErrUnsavedChanges is returned when switching branches or pulling while open editor files have unsaved changes.
	ErrUnsavedChanges = errors.New("editor: save or discard unsaved changes before switching branches or pulling")
	// ErrChangesBusy is returned when an asynchronous Changes operation is already running.
	ErrChangesBusy = errors.New("editor: a Git or check operation is already in progress")
)
var (
	// ErrNoCodeReview is returned when a Go code review action runs with no active review session.
	ErrNoCodeReview = errors.New("editor: no active Go code review")
	// ErrCodeReviewChecksNotPassed is returned when attempting to confirm a Go file before nsgo check and nsgo test pass for the current pending code.
	ErrCodeReviewChecksNotPassed = errors.New("editor: cannot confirm Go file until nsgo check and nsgo test pass")
	// ErrCodeReviewNotGoFile is returned when ConfirmCodeReviewFile targets a non-Go file.
	ErrCodeReviewNotGoFile = errors.New("editor: only Go files require per-file confirmation")
	// ErrCodeReviewNothingToKeep is returned when KeepCodeReview has no pending YAML files and no confirmed Go files to write.
	ErrCodeReviewNothingToKeep = errors.New("editor: no YAML changes or confirmed Go files ready to keep")
	// ErrCodeReviewPathOutsideProject is returned when a proposed file path escapes the open project root.
	ErrCodeReviewPathOutsideProject = errors.New("editor: path escapes the project root")
)
var (
	// ErrCommandNotFound is returned by ExecuteCommand when no active command has the requested ID.
	ErrCommandNotFound = errors.New("editor: command not found")
	// ErrCommandDisabled is returned by ExecuteCommand when the target command is currently disabled.
	ErrCommandDisabled = errors.New("editor: command is disabled")
)
var (
	// ErrProfilerNotConnected is returned by PollProfiler when no running game profiler client is connected.
	ErrProfilerNotConnected = errors.New("editor: profiler is not connected to a running game")
	// ErrNoProfilerFrames is returned by ExportProfilerTrace when no frames have been recorded yet.
	ErrNoProfilerFrames = errors.New("editor: no profiler frames recorded to export")
)
var (
	// ErrNoReview is returned by review actions when no agent turn review is pending.
	ErrNoReview = errors.New("editor: no agent turn review is open")
	// ErrReviewBlocked is returned by KeepTurnReview when an unresolved blocker prevents keeping.
	ErrReviewBlocked = errors.New("editor: review has an unresolved blocker")
	// ErrReviewReadOnlyRound is returned when trying to edit, revert, or add notes while viewing an earlier round.
	ErrReviewReadOnlyRound = errors.New("editor: earlier review rounds are read-only")
	// ErrReviewNoteEmpty is returned when saving or sending an empty note.
	ErrReviewNoteEmpty = errors.New("editor: review note cannot be empty")
	// ErrReviewNoteTooLong is returned when a review note exceeds maxReviewNoteLen runes.
	ErrReviewNoteTooLong = errors.New("editor: review note exceeds maximum length")
	// ErrReviewNotesLimit is returned when a review exceeds maxReviewNotesCount simultaneous notes.
	ErrReviewNotesLimit = errors.New("editor: review has too many active notes")
	// ErrReviewNoNotesToSend is returned by SendReviewNotes when no unsent notes exist.
	ErrReviewNoNotesToSend = errors.New("editor: no unsent review notes to send")
	// ErrReviewChangeNotFound is returned when a change ID does not exist in the active review.
	ErrReviewChangeNotFound = errors.New("editor: review change not found")
	// ErrReviewChangeNotNoted is returned by ApplyReviewRedo when targeting a change that was not noted and sent.
	ErrReviewChangeNotNoted = errors.New("editor: review_redo can modify only changes you left notes on")
	// ErrReviewMaxRounds is returned when a review reaches maxReviewRounds.
	ErrReviewMaxRounds = errors.New("editor: review reached maximum number of rounds")
	// ErrReviewInvalidRound is returned when selecting an out-of-range review round.
	ErrReviewInvalidRound = errors.New("editor: invalid review round")
	// ErrReviewYAMLInvalid is returned by FinishReviewYAMLEdit when the hand-edited YAML does not parse or validate.
	ErrReviewYAMLInvalid = errors.New("editor: review YAML is invalid")
)
var (
	// ErrSketchEmpty is returned when sending or reading a sketch with no marks.
	ErrSketchEmpty = errors.New("editor: no sketch marks on the viewport")
	// ErrSketchHoldActive is returned when a mutating agent edit runs while a sent sketch awaits confirmation.
	ErrSketchHoldActive = errors.New("editor: sent sketch is waiting for confirmation (Go ahead or Correct a mark)")
	// ErrNoSketchReview is returned when Keep or Revert is invoked without an open sketch review.
	ErrNoSketchReview = errors.New("editor: no sketch review is open")
)
var AgentModelRetryDelays = []time.Duration{
	4 * time.Second,
	8 * time.Second,
	16 * time.Second,
	32 * time.Second,
}

AgentModelRetryDelays is the exponential backoff schedule used when a model endpoint returns a retryable error (429, 5xx, 529 overloaded): try 1 = 4 s, try 2 = 8 s, try 3 = 16 s, try 4 = 32 s (matching docs/design/editor/AgentStates.dc.html: "Retrying in 8 s · try 2 of 4").

var AgentReconnectDelays = []time.Duration{
	1 * time.Second,
	2 * time.Second,
	4 * time.Second,
	8 * time.Second,
	16 * time.Second,
}

AgentReconnectDelays is the exponential backoff schedule used when an MCP connection drops (1, 2, 4, 8, and 16 seconds).

var AllAgentTaskKinds = []AgentTaskKind{
	AgentTaskSceneEdit,
	AgentTaskPlaytest,
	AgentTaskProblems,
	AgentTaskAskInPlace,
	AgentTaskArtSound,
}

AllAgentTaskKinds lists the WHO DOES WHAT rows in the canonical order of docs/design/editor/Settings.dc.html.

var AudioEffectKinds = []AudioEffectKind{
	AudioEffectLowPass,
	AudioEffectHighPass,
	AudioEffectDelay,
	AudioEffectReverb,
	AudioEffectGain,
	AudioEffectBitcrush,
}

AudioEffectKinds lists every effect kind supported by the audio bus mixer in display order.

var ErrAgentSettingsYouOnly = errors.New("editor: agent settings are You only and cannot be changed by an agent")

ErrAgentSettingsYouOnly is returned when an agent attempts to change a You-only agent setting (models, tool switches, external MCP servers, weekly usage limit, or privacy switches).

var ErrAgentTouchingObject = errors.New("editor: object is currently being edited by the agent")

ErrAgentTouchingObject is returned when a manual edit attempts to modify an object that the agent is currently touching during an active step.

var ErrAssetsBuildUnsupported = errors.New("editor: building assets is only supported on desktop")

ErrAssetsBuildUnsupported is returned by BuildAssets and ReimportAsset on non-desktop targets when AssetsCommandRunner is nil.

var ErrAssetsBuilding = errors.New("editor: asset build is already running")

ErrAssetsBuilding is returned by BuildAssets and ReimportAsset when an asset build is already running.

var ErrAutomationYouOnly = errors.New("editor: automations cannot apply You-only drafts or modify automation settings")

ErrAutomationYouOnly is returned when an agent actor or automation attempts to apply a You-only draft, keep/dismiss its own review, mutate automations.yaml, or restore a checkpoint.

var ErrCreateProjectRunning = errors.New("editor: project creation is already running")

ErrCreateProjectRunning is returned by StartCreateProject when a project creation command is already running.

var ErrCredentialNotFound = errors.New("editor: credential not found in system keychain")

ErrCredentialNotFound is returned by Keychain.Get when no credential is stored for the requested account.

var ErrDiskConflict = errors.New("editor: file changed on disk since it was opened or last saved")

ErrDiskConflict is returned by Save, SaveFile, SaveProject, and SaveClipFile when the target file on disk changed since the editor opened or last saved it, refusing to overwrite external changes until the user confirms.

var ErrExportRunning = errors.New("editor: an export build is already running")

ErrExportRunning is returned by StartExportBuild when a release build or dry run is already running.

var ErrFileExists = errors.New("editor: a file already exists at that path")

ErrFileExists is returned by NewScene and SaveSceneAs for a path where the project already holds a file, which they never overwrite.

var ErrGameRunning = errors.New("editor: game is already running")

ErrGameRunning is returned by RunGame and RunGameWith when a game process is already running.

var ErrHistoryPreview = errors.New("editor: cannot edit while previewing history")

ErrHistoryPreview is returned when an edit is attempted while read-only History point-in-time preview is active.

var ErrInvalidPublishDestination = errors.New("editor: unknown publish destination")

ErrInvalidPublishDestination is returned when an unknown store destination is supplied.

var ErrKeychainUnavailable = errors.New("editor: system keychain unavailable on this platform")

ErrKeychainUnavailable is returned when the host platform does not expose a desktop system keychain.

var ErrNoAgentTurn = errors.New("editor: no pending agent turn")

ErrNoAgentTurn is returned when KeepAgentTurn or RevertAgentTurn is called without a pending agent turn.

var ErrNoClip = errors.New("editor: no animation clip is open")

ErrNoClip is returned by animation edits when no clip is open.

var ErrNoCutscene = errors.New("editor: no cutscene is open")

ErrNoCutscene is returned by cutscene timeline edits when no cutscene document is open.

var ErrNoCutsceneReview = errors.New("editor: no cutscene review is open")

ErrNoCutsceneReview is returned by cutscene review actions when no review is open.

var ErrNoDataTable = errors.New("editor: no data table is open")

ErrNoDataTable is returned by data table edits when no data table is open.

var ErrNoDataTableReview = errors.New("editor: no data table review is open")

ErrNoDataTableReview is returned by data table review actions when no data table review is active.

var ErrNoDraftRulesTicked = errors.New("editor: tick at least one rule before applying the permissions draft")

ErrNoDraftRulesTicked is returned when ApplyPermissionsDraft is called with zero rules ticked.

var ErrNoGridMap = errors.New("editor: no grid map is open")

ErrNoGridMap is returned when a GridMap operation is called while no GridMap is open in the editor.

var ErrNoGridMapFile = errors.New("editor: the grid map has no file; save it under a path first")

ErrNoGridMapFile is returned by SaveGridMap while the open GridMap has no file path and no OnSaveGridMap callback.

var ErrNoHUDScreen = errors.New("editor: no HUD screen open")

ErrNoHUDScreen is returned by HUD layout edits when no screen document is currently open.

var ErrNoLocalization = errors.New("editor: no localization tables open")

ErrNoLocalization is returned by localization edits when the Localization panel has no tables open.

var ErrNoMaterial = errors.New("editor: no material is open")

ErrNoMaterial is returned by material editor operations when no material is open.

var ErrNoMergeConflict = errors.New("editor: no active scene merge conflict session")

ErrNoMergeConflict is returned when a merge resolution operation is called without an active conflict session.

var ErrNoParticleEmitter = errors.New("editor: no particle emitter is open")

ErrNoParticleEmitter is returned by particle emitter edits when no emitter is open.

var ErrNoPermissionsDraft = errors.New("editor: no permissions draft is open")

ErrNoPermissionsDraft is returned when applying a draft while none is open.

var ErrNoProject = errors.New("editor: no project open")

ErrNoProject is returned by EditProject and SaveProject before OpenProject has opened a game.yaml.

var ErrNoReleasePresetsIncluded = errors.New("editor: no buildable export presets are included in this release")

ErrNoReleasePresetsIncluded is returned by StartReleaseBuild when no ready preset is checked for inclusion.

var ErrNoRig = errors.New("editor: no skeletal rig is open")

ErrNoRig is returned by skeletal rig editor operations when no rig is open.

var ErrNoRooms = errors.New("editor: no room map is open")

ErrNoRooms is returned by room-map edits and saves when no room map is open.

var ErrNoRoomsFile = errors.New("editor: the room map has no file; save it under a path first")

ErrNoRoomsFile is returned by SaveRooms when the open room map has no file path and no OnSaveRooms callback.

var ErrNoSceneFile = errors.New("editor: the scene has no file; save it under a path first")

ErrNoSceneFile is returned by Save and RevertScene while the open scene has no file to write to or read back: it was never opened from or saved to one, and no OnSave persists it.

var ErrNoStates = errors.New("editor: no sprite state machine is open")

ErrNoStates is returned by state machine edits when no *.states.yaml document is open.

var ErrNoTerrain = errors.New("editor: no terrain is open")

ErrNoTerrain is returned by terrain operations when no terrain is open in the editor.

var ErrNoTerrainPath = errors.New("editor: the terrain has no file path; use SaveTerrainTo first")

ErrNoTerrainPath is returned by SaveTerrain when the open terrain has no file path yet.

var ErrNoTileReview = errors.New("editor: no tile edit review is open")

ErrNoTileReview is returned by tile review actions when no tile edit review is open.

var ErrNoTileset = errors.New("editor: no tileset is open")

ErrNoTileset is returned by tileset editor operations when no YAML tileset is open.

var ErrNoUploadsSelected = errors.New("editor: no artifacts are selected to upload")

ErrNoUploadsSelected is returned when confirming Review uploads with no included artifacts.

var ErrPlaying = errors.New("editor: cannot edit scene while playing")

ErrPlaying is returned when an edit operation is attempted while Play mode is active.

var ErrProjectDirty = errors.New("editor: save the project before installing or removing a pack")

ErrProjectDirty is returned by InstallPack and RemovePack while the open project has edits that are not saved: installing writes game.yaml, so the edits must be saved or undone first.

var ErrReleaseBuildRunning = errors.New("editor: a release build is already running")

ErrReleaseBuildRunning is returned by StartReleaseBuild or ResumeReleaseBuild when a build is already active.

var ErrReleaseUploadRunning = errors.New("editor: a store upload is already running")

ErrReleaseUploadRunning is returned when starting or mutating upload selections while an upload batch is running.

var ErrRemoteNotConnected = errors.New("editor: not connected to a running game")

ErrRemoteNotConnected is returned by remote inspection and live-control operations when the editor has no active MCP connection to a running game.

var ErrRemoteUnsupported = errors.New("editor: remote MCP command transport is only supported on desktop")

ErrRemoteUnsupported is returned by ConnectRemoteCommand on non-desktop targets where launching `go tool nsgo mcp` is unavailable.

var ErrRunGameUnsupported = errors.New("editor: running the game is only supported on desktop")

ErrRunGameUnsupported is returned by RunGame and RunGameWith on non-desktop targets when RunGameCommand is nil.

var ErrUploadRequiresConfirmation = errors.New("editor: store uploads always require confirmation in Review uploads")

ErrUploadRequiresConfirmation is returned whenever code attempts to start a store upload without an active, user-confirmed Review uploads session.

var ErrUploadRequiresPersonConfirmation = errors.New("editor: store uploads require the person's confirmation in Review uploads, whatever the permission profile")

ErrUploadRequiresPersonConfirmation is returned when an agent attempts to confirm or trigger a store upload. Store uploads always require explicit human confirmation, whatever the permission profile.

var FirstRunBuildStageNames = [5]string{"Template", "Project", "First scene", "Check", "Playtest"}

FirstRunBuildStageNames are the 5 stage labels from FirstRun.dc.html.

Fonctions

func AgentComposerView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AgentComposerView renders the agent composer card with:

  • @-mention picker popover (match count, group tabs, ↑↓/↵/Tab/Esc)
  • Context chips (attached, suggested selection chip, Always chips, toggleable Viewport image)
  • Hover preview showing the exact text/YAML or image sent to the agent
  • Context usage ring (normal / over 70% / compact now) and 6-row breakdown popover with Compact & Start fresh
func AgentHistoryView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AgentHistoryView renders the right-rail History timeline combining agent steps and manual edits, highlighting the step opened via "Open this step in History".

func AgentPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AgentPanelView renders the Agent tab panel: 44 pt header with tabs and status chip, scene-grouped thread header and switcher popover, scrollable thread of persisted requests / live user turns / streamed steps / permission cards / review summaries or empty-thread orientation, and AgentComposerView (@-mentions, context chips, hover preview, and context meter) or the working "Add to this request" + Stop footer.

func AgentReviewPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AgentReviewPanelView renders the Review changes panel including proposed file deletions that Keep all never applies (matching docs/design/editor/Permissions.dc.html "Proposed deletion") using strictly SpecPalette tokens in both Dark and Light appearances.

func AgentStatusChipView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AgentStatusChipView renders the status chip for the Agent panel header matching docs/design/editor/AgentStates.dc.html using exclusively Spec.dc.html tokens and announcing state transitions through LiveRegionPolite.

func AgentTaskNotificationCard(p SpecPalette, n AgentTaskNotification, when string) core.Node

AgentTaskNotificationCard renders one Spec-styled preview card for an AgentTaskNotification matching docs/design/editor/Tasks.dc.html ("SYSTEM NOTIFICATIONS · ONLY THESE THREE") using exclusively tokens from p.

func AgentThreadsView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AgentThreadsView renders the Agent panel for the open scene's thread: status chip, thread switcher header (with ⌘N new thread and grouped scene switcher popover), folded earlier requests with History links, Jump to latest pill, empty-thread view with always-read context and brief suggestions, live turns, and the prompt composer.

func AnimationPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AnimationPanelView renders the animation editor below the viewport while a clip is open: the clip's name, length, loop, playback and Save and Close; a scrubber for the playhead; a property picker that keys the chosen property at the playhead; one lane per track with its keys, which select a key to edit its time, value and interpolation; and a lane of the clip's events.

func AskInPlaceComposerView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AskInPlaceComposerView renders the anchored ⌘L in-place agent composer inside the editor viewport using exclusively SpecPalette tokens (matching docs/design/editor/AskInPlace.dc.html and Spec.dc.html).

func AssetBrowserView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AssetBrowserView renders the left-side Asset Browser panel listing all available atlases, their frames with canvas thumbnails, and click-to-select / quick-place actions, then the models to place in 3D (Models), the built-in primitives and the project's glTF files, with thumbnails rendered offscreen (ModelThumbnail). Pressing a model selects it for the Place tool (SelectModel) and turns the tool on; dragging it onto the 3D viewport places it where it is dropped (PlaceModelAt3D). It updates reactively whenever atlases, frames or models change (for example after ReloadAssets).

func AssetDrawerView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AssetDrawerView renders the bottom asset drawer below the viewport in Assets mode: kind tabs, name/path filter, sort toggle, Import & Generate actions, asset cards (draggable to the viewport), empty states, and the "N assets · M shown" + missing-problem footer.

func AssetGeneratorView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AssetGeneratorView renders the full-window Generated Assets screen matching docs/design/editor/Assets.dc.html Screen 2 ("generate, pick, check style and license") using strictly Spec.dc.html color, spacing, radius, and type tokens.

func AssetInspectorView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AssetInspectorView renders the 380 pt right panel for the selected asset in Assets mode: preview (clips playable frame-by-frame, sounds playable), missing-file actions, import settings, and USED BY from refs.

func AssetsLeftRailView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AssetsLeftRailView renders the 232 pt left rail when Assets mode is active: Scene / Assets switch, FOLDERS with counts, SHOW ONLY filters with counts, and a drop zone.

func AudioMixerPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

AudioMixerPanelView renders the Audio Bus Mixer panel below the viewport while a project is open and AudioMixerOpen reports true. It edits game.yaml's audio section through EditProject and auditions project audio files through sound.Mixer configured by project.File.ConfigureMixer.

func BotProfileDefaultStrategy(bot playtest.BotConfig) string

BotProfileDefaultStrategy returns a concise one-sentence strategy fallback when report.Bot.Strategy is empty.

func BotProfileDisplayName(profile string) string

BotProfileDisplayName maps a registered playtest bot profile ID to its human-readable label matching Playtest.dc.html.

func BuildGoOverlay(projectDir string, pending map[string]PendingGoOverlayFile) (string, func(), error)

BuildGoOverlay writes a temporary Go build overlay JSON file mapping each pending Go file inside projectDir to its staged content in a temporary directory, leaving projectDir on disk untouched. Both the cleaned path and EvalSymlinks-resolved path (for example /var vs /private/var on macOS) are mapped.

func BuildReleaseScreenView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

BuildReleaseScreenView renders the full-window Build and Release screen matching docs/design/editor/Build.dc.html using exclusively Spec color, spacing, radius, typography, and focus-ring tokens from docs/design/editor/Spec.dc.html.

func ChangesPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ChangesPanelView renders the full-window Changes & Commit screen matching docs/design/editor/VersionControl.dc.html (screen 1) using only Spec.dc.html tokens.

func ClampAudioEffect(fx project.Effect) project.Effect

ClampAudioEffect returns a copy of fx with every parameter clamped into project.Validate's valid range.

func CodeReviewView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

CodeReviewView renders the full-window Go code review screen matching docs/design/editor/ReviewCode.dc.html using exclusively SpecPalette tokens (Dark & Light).

func CommandPaletteView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

CommandPaletteView renders the editor's Command Palette modal using ui.CommandDialog.

func CompositeOver(fg, bg core.Color) core.Color

CompositeOver alpha-blends fg over an opaque background bg in sRGB space.

func ConnectAgentDialogView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ConnectAgentDialogView renders the "Connect an agent" modal dialog matching docs/design/editor/Connect.dc.html using exclusively Spec.dc.html tokens: three choices, the one-time `go tool game mcp install` command with Copy, a live waiting state that turns to connected when the first MCP client attaches, four starting permission checkboxes, Later, Done, and targeted step troubleshooting when reopened from Disconnected.

func ContrastRatio(a, b core.Color) float64

ContrastRatio returns the WCAG 2.1 / 2.2 contrast ratio between foreground a and background b, in [1, 21]. If a is translucent (alpha < 1), it is composited over b first.

func CutscenePanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

CutscenePanelView renders the full-workspace cutscene timeline and agent review screen (matching docs/design/editor/Animation.dc.html Screen 2 and Spec.dc.html tokens) whenever a cutscene is open and Play mode is not active.

func DataTablePanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

DataTablePanelView renders the Data Table editor below the viewport while a YAML data table is open: table path and row-type badge, filter input, Add Row / Save Table / Close buttons, validation error banner, sortable column headers with inferred kinds, and a scrollable grid of rows with move up/down, delete, and kind-aware cell editors.

func DataTableReviewView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

DataTableReviewView renders the full-window row-by-row Data Table review screen matching docs/design/editor/ReviewData.dc.html using exclusively SpecPalette tokens (Dark & Light).

func DefaultAudioEffect(kind AudioEffectKind) (project.Effect, error)

DefaultAudioEffect returns a valid project.Effect with practical defaults within project.Validate's ranges.

func DefaultCatalog() *l10n.Catalog

DefaultCatalog returns a copy of the editor's built-in localization catalog (English and Simplified Chinese).

func DefaultLayoutPath() (string, error)

DefaultLayoutPath returns the default per-user path for layout.yaml under the OS user config directory.

func DefaultLights3D() render3d.LightRig

DefaultLights3D returns the lights the 3D viewport draws the scene's geometry with when the editor has no Lights3D: a cool ambient fill like the sky's and a warm key light from above, to the front and right of the default camera.

func DefaultOverlayLegendKinds() []string

DefaultOverlayLegendKinds returns the canonical sorted IDs of all six legend kinds enabled by default.

func DefaultRecentProjectsPath() (string, error)

DefaultRecentProjectsPath returns the default per-user path for recent-projects.yaml under the OS user config directory.

func DefaultSceneDoc() *sceneformat.SceneDoc

DefaultSceneDoc returns a valid starter SceneDoc suitable for a new editor session.

func DefaultSettingsPath() (string, error)

DefaultSettingsPath returns the per-user path outside any project where editor settings are stored (for example "$UserConfigDir/nsgo-game/editor.yaml").

func DefaultViewportOverlays() []string

DefaultViewportOverlays returns the canonical sorted list of viewport overlays enabled by default.

func DefaultWatchRunIndex(rep *playtest.Report) int

DefaultWatchRunIndex picks the most informative 1-based run index for the "Watch run N" button: first non-finished run with a saved recording, then first run with a recording, then first non-finished run, then the first run.

func DemoAtlasMap() sceneformat.AtlasMap

DemoAtlasMap returns the sprite atlases used by the editor's built-in Demo Room scene.

func DemoComponentRegistry() *sceneformat.ComponentRegistry

DemoComponentRegistry returns the built-in 2D and 3D physics component registry used by the Demo Room scene.

func DemoSceneDoc() *sceneformat.SceneDoc

DemoSceneDoc returns a fresh copy of the editor's built-in Demo Room scene document.

func DrawObjectOverlay(d *core.Drawing, p SpecPalette, ov ObjectOverlay) core.Bounds

DrawObjectOverlay is the single Spec viewport overlay drawing helper in editor. It draws any of the seven Spec overlay kinds (Selection, Agent working, Added, Changed, Removed, Problem, Focused change in Review) using exclusively SpecPalette tokens at the Spec's exact line widths, dash patterns, offsets, handles, ghosts, and pills, and returns the canvas rectangle occupied by the drawn tag/pill (if any).

func DrawPlaytestChart(d *core.Drawing, size core.Size, spec PlaytestChartSpec, scene *sceneformat.SceneDoc)

DrawPlaytestChart renders spec onto d using exclusively Spec.dc.html color tokens. Exported so tests can verify all 4 chart kinds directly against core.Drawing as well as through EditorView.

func EditorSettingsDialogView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

EditorSettingsDialogView renders the per-user Editor Settings view when mounted standalone. EditorView mounts SettingsView instead, which hosts the General, Viewport, and Shortcuts pages alongside the Agent and Project pages.

func EditorView(cx *core.Scope, ed *Editor) core.Node

EditorView returns the root NSGo UI node for ed, composing:

  • Top toolbar (scene title, the open scene's path with a marker while edits are unsaved, New, Save As and Revert, tool selector, Undo/Redo, Run/Stop Game, Play/Stop, Save)
  • Scene tree panel listing the layers and their nested objects (SceneTreeView), over the layers panel that picks the active layer and adds, removes, renames, reorders, hides and locks layers (LayersView)
  • Left Asset Browser panel, with the file browser below it while a project is open (FilesView)
  • Center interactive Canvas viewport
  • Tile palette right of the viewport while a tile tool is active in 2D (TilePaletteView)
  • Right Property Inspector panel
  • The library panel, when Editor.Library is set (LibraryView)
  • The panels of the plugins that are on (Plugin), docked left or right of the viewport or below it
  • Animation panel below them while a clip is open (AnimationPanelView)
  • Project Settings panel below them while open (ProjectSettingsPanelView)
  • Search & References panel below them when toggled or showing references (SearchPanelView)
  • Problems panel below them while a project is open (ProblemsView)
  • Output / Log panel below them (OutputPanelView)
  • Bottom status bar (including the live problem count while a project is open)

Mod+S saves (Editor.Save), and the window title follows the open scene and its unsaved marker (Editor.WindowTitle). Opening a scene from the file browser, the Problems panel or the Search and References panel, New Scene, a user's request to quit and closing the window ask first while the scene or project has unsaved edits (Editor.HasUnsavedChanges): Save saves them and goes on, Discard drops them and goes on, and Cancel keeps them.

func EncodeAgentThread(doc *AgentThreadDoc) ([]byte, error)

EncodeAgentThread encodes doc as deterministic plain-text YAML with fixed field order and 2-space indent.

func EncodeAgentThreadYAML(t *AgentThread) ([]byte, error)

EncodeAgentThreadYAML validates t and encodes it as deterministic 2-space YAML prefixed with AgentThreadSchemaComment so loading and saving changes nothing.

func EncodeAutomations(f *AutomationsFile) ([]byte, error)

EncodeAutomations validates f and writes deterministic 2-space YAML prefixed with AutomationsSchemaComment.

func EncodeBuildQR(rawURL string) (*qrcode.Code, error)

EncodeBuildQR encodes rawURL as a deterministic ISO/IEC 18004 QR Code (EC level M) suitable for scanning on a phone camera on the local Wi-Fi.

func EncodeCheckpointManifest(m *CheckpointManifest) ([]byte, error)

EncodeCheckpointManifest validates m and encodes it as deterministic 2-space YAML with files sorted by path.

func EncodeEditorSettings(s *EditorSettings) ([]byte, error)

EncodeEditorSettings validates s and writes deterministic 2-space YAML prefixed with SettingsSchemaComment.

func EncodeLayout(f *LayoutFile) ([]byte, error)

EncodeLayout validates f and encodes it as deterministic 2-space YAML that ParseLayout reads back unchanged.

func EncodePermissions(f *PermissionsFile) ([]byte, error)

EncodePermissions validates f and writes deterministic 2-space YAML prefixed with PermissionsSchemaComment.

func EncodeRecentProjects(f *RecentProjectsFile) ([]byte, error)

EncodeRecentProjects validates f and encodes it as deterministic 2-space YAML that ParseRecentProjects reads back unchanged.

func EnvironmentPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

EnvironmentPanelView renders the docked Scene Environment settings panel (sky color/gradient/HDR, ambient & IBL intensity, distance & height fog, tonemapping, and exposure) while open.

func ExportPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ExportPanelView renders the Export & Release panel below the viewport while a project is open and ExportPanelOpen reports true. It edits game.yaml's export section through EditProject, shows any pre-flight asset credits problems, runs release builds or dry runs off the UI goroutine, and streams their output into the Output view.

func FilesView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

FilesView renders the file browser: the files and directories of the open project (ProjectFiles), an Open button that opens the selected scene in the editor (OpenScene), and a path field with a Move button that renames or moves the selected file through MoveFile, so every reference to it follows and Undo moves it back. Pressing a row selects it and puts its path in the field, and pressing a scene file (*.scene.yaml, *.scene.yml, or one listed under autoload.scenes, as OpenProblem names scenes) twice opens it as Open does; while the scene or project has unsaved edits, opening asks first in EditorView, which shows the prompt, and is refused elsewhere. Refresh lists the files again after something outside the editor changed them. It renders nothing while no project is open.

func FirstRunScreenView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

FirstRunScreenView renders the active full-window First Run stage (Step 3 Plan, Step 4 Building, or Step 5 Review) using exclusively SpecPalette tokens (Dark & Light) matching docs/design/editor/FirstRun.dc.html.

func FirstRunTipIDs() []string

FirstRunTipIDs returns the three first-review tip IDs in presentation order.

func FocusTheme() *core.Theme

FocusTheme returns the editor's unified Spec *core.Theme (SpecTheme), mapping focus, info, and ring roles to Spec accent (#3B7BFF in Dark, #1D5CE6 in Light) so every ui component calling ui.FocusRing draws the Spec 2 px focus ring on :focus-visible while preserving both Spec Dark and Spec Light surfaces.

NSGo gap (v0.3.0): ui.FocusRing reads Palette.Colors["info"] rather than a dedicated focus-ring token, ui.Switch carries no FocusVisible style, ui.IconButton hardcodes offset -2 on ghost buttons (and omits FocusVisible on circular variants), ui.Input uses only a 1 px border color change without an inset outline, and core.Modal / ui.Dialog do not restore focus to the opener on close. Editor-level helpers in this file bridge each gap.

func FormatHistoryEntryHeadline(entry HistoryEntry) string

FormatHistoryEntryHeadline formats the primary line of an entry, matching AskInPlace.dc.html (for example "Agent · slimes and coins", "You · moved Knight", or "Saved").

func FormatHistoryEntrySubtitle(entry HistoryEntry, relTime string) string

FormatHistoryEntrySubtitle formats the secondary metadata line of an entry with its relative time (for example "6 changes · kept 5 · 2 min ago", "x 416 → 452 · 4 min ago", or "level_01.scene.yaml · 15 min ago").

func FormatPermissionPatterns(action PermissionAction, patterns []string) string

FormatPermissionPatterns formats a rule's pattern list for human-readable UI and error messages.

func FormatPlaytestRunsSummary(rep *playtest.Report) string

FormatPlaytestRunsSummary builds the header runs summary such as "20 headless runs by the agent · 1 m 40 s".

func FormatReviewCellValue(v datatable.Value) string

FormatReviewCellValue formats a cell value for display in the Data Table review grid: numeric zero displays as "—" (em dash), matching ReviewData.dc.html.

func FormatReviewDeltaPct(pct int) string

FormatReviewDeltaPct formats a percentage delta (e.g. "+33%", "−42%", or "" when 0).

func FormatShortcut(shortcut string, targetOS core.OS) string

FormatShortcut formats shortcut for display on targetOS using NSGo's platform conventions (for example "mod+s" renders as "⌘S" on macOS and "Ctrl+S" on Windows and Linux).

func FriendlyAgentName(raw string) string

FriendlyAgentName turns a raw MCP ClientInfo.Name into a human-friendly agent label.

func GridMapPaletteView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

GridMapPaletteView renders the 3D GridMap item palette panel right of the viewport while a GridMap tool is active in 3D view: floor height controls, orientation controls (24 orientations), and a grid of the mesh library's items with 3D thumbnails.

func HUDLayoutView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

HUDLayoutView renders the full-window HUD and menu layout screen matching docs/design/editor/HUDLayout.dc.html using exclusively Spec color, spacing, radius, type, and focus-ring tokens from docs/design/editor/Spec.dc.html.

func HistoryPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

HistoryPanelView renders the unified History timeline right-side panel (AskInPlace.dc.html and Checkpoints.dc.html) using exclusively SpecPalette tokens:

  • Header with All / You / Agent filter segmented control and close button
  • Active point-in-time preview bar ("Previewing … · editing is off") with Restore and Back (Esc)
  • Top "Now" row showing unsaved/saved status (clicking exits preview)
  • Newest-first timeline entries grouped by day (TODAY / YESTERDAY / date), with author badges, detail, touched files, relative times, and saved-point markers
  • Footer explaining non-destructive preview and Restore

Outer panel chrome, header controls, core.Scroll ("history-panel-list"), and footer are mounted once and react through narrow memos so unrelated rev bumps never remount the scroll container or drop scroll offset / keyboard focus.

func InputMapPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

InputMapPanelView renders the Input Map panel below the viewport while a project is open and InputMapOpen reports true. It edits game.yaml's input section (actions, key/keyCode/gamepad/mouse/touch bindings, regions over display size, axes, motion axes and gamepad stick axes) through EditProject.

func InspectorView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

InspectorView renders the right-side Property Inspector panel for the selected asset import settings, the selected object, the selected layer (parallax/repeat settings), or the Scene Settings inspector (name, virtual size, background color and camera) when nothing else is selected. A component that a plugin which is on has an Inspector for is drawn by that inspector instead of the generic fields.

func LayersView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

LayersView renders the layers panel: the open scene's layers in draw order, the first drawn at the top, each with its space, its tilemap, an eye button that shows or hides it (SetLayerVisible, written to the scene file) and a lock button that locks it against the viewports for the session (SetLayerLocked). Pressing a layer's row makes it the active layer, which placing and painting target and the status bar names. The Add button adds a world layer drawn over the others (AddLayer) and makes it active, and the Remove button removes the active layer with its objects (RemoveLayer). Dragging a row above or below another moves the layer there in the draw order (MoveLayer). A row's context menu, or a double press, renames it in place (RenameLayer); the menu also moves it up or down, sets its space (SetLayerSpace), hides, locks or removes it. On the row of a layer that extends one of the base scene's, the eye, renaming, moving, dragging and the space items are off, since that scene owns them. Every edit but the lock goes through History.

func LeftRailSwitchView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

LeftRailSwitchView renders the Scene / Assets segmented switch at the top of the left rail, matching docs/design/editor/Assets.dc.html screen 1 with Spec.dc.html tokens.

func LibraryView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

LibraryView renders the library panel: every pack of Editor.Library with its kind, version and description, the version the open project has installed, and buttons to install, update and remove it. It renders nothing while Library is nil.

func LocalizationPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

LocalizationPanelView renders the Localization table editor below the viewport while a localization workspace is open: keys as rows, project locales as columns, missing translation highlights, CLDR plural form editors, adding/removing keys and locales, and saving each locale's YAML file.

func MatchAutomationGlob(pattern, relPath string) bool

MatchAutomationGlob reports whether project-relative slash-separated relPath matches pattern. Pattern supports * (single path segment wildcard), ? (single non-slash character), and ** (zero or more path segments).

func MatchPermissionPattern(action PermissionAction, pattern, target string) bool

MatchPermissionPattern reports whether target matches pattern for action. For file actions, "**" matches zero or more path segments (so "**/*.go" matches both "main.go" and "scripts/slime.go", and "scenes/**" matches everything under "scenes/"), and empty, absolute, or ".."-escaping targets never match any pattern (including "**" and "*"). For run actions, matching is case-insensitive and supports target prefixes such as "shell" matching "shell: go generate ./assets", as well as "*" and "**" wildcards.

func MaterialEditorPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

MaterialEditorPanelView renders the Material Editor panel docked below the viewport while a material file is open: a live preview canvas (3D sphere or cube rendered with render3d, or 2D sprite preview), and undoable controls for every field of resource.Material (name, baseColor, emissive, texture, metallic, roughness, opacity, blend, doubleSided, unlit).

func MergeConflictView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

MergeConflictView renders the full-window Scene Merge Conflict screen matching docs/design/editor/VersionControl.dc.html (screen 2) and using only Spec.dc.html tokens.

func NavMeshPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

NavMeshPanelView renders the docked 3D Navigation Mesh bake settings panel below the viewport while Editor.NavMeshPanelOpen is true: agent radius, height, step height (max climb), max slope, cell size, cell height, agent name, output .navmesh.yaml path, overlay toggle, and Bake button.

func NewRemoteBridgeServer(bridge *gamemcp.Bridge, run func(func())) *sdkmcp.Server

NewRemoteBridgeServer wraps a live game *mcp.Bridge as a *sdkmcp.Server so the editor (or a test) can connect over an in-memory or pipe MCP transport with the exact same JSON tool wire format as `go tool nsgo mcp`. When run is non-nil (for example a game's core.Scope.Post), each tool handler runs on that goroutine and waits for completion.

func NormalizeShortcut(raw string) (string, error)

NormalizeShortcut validates and normalizes raw into NSGo's canonical shortcut form (modifiers in order mod, ctrl, alt, shift, meta followed by the lowercase key name). An empty or whitespace-only string returns "", nil.

func OutputPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

OutputPanelView renders the docked Output / Log panel below the viewport when OutputPanelOpen reports true. It displays the editor's timestamped status and error history alongside live stdout and stderr lines streamed from the running game, with Clear and Errors-only filter controls and clickable file:line navigation.

func OverlayAgentPulseAlpha(elapsed time.Duration, reduceMotion bool) float32

OverlayAgentPulseAlpha returns the outline opacity in [0.45, 1.0] for an active Agent working overlay pulsing on a 1.6 s period. With reduceMotion enabled, it stays solid at 1.0.

func OverlayFadeAlpha(elapsed time.Duration, reduceMotion bool) float32

OverlayFadeAlpha returns the opacity in [0, 1] for a change overlay (Added, Changed, Removed) elapsed after it appeared. With reduceMotion enabled, it returns 1 immediately without fading.

func ParsePatternList(action PermissionAction, raw string) []string

ParsePatternList splits a comma-separated (or whitespace-separated for file globs) user input into trimmed patterns.

func ParticleEditorPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ParticleEditorPanelView renders the Particle Emitter editor panel docked below the viewport while an emitter is open: a live preview canvas with Play/Pause, Restart, Step and Burst controls, an interactive curve widget for Size/Alpha/Rotation/Color/Trail curves, an atlas frame picker, and undoable controls for every field of particles.Config.

func PermissionsDraftCardView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

PermissionsDraftCardView renders the You-only permissions draft modal card matching docs/design/editor/Permissions.dc.html ("You only · A draft the agent cannot approve") inside a real ui.Dialog / core.Modal with Tab/Shift-Tab focus trapping and opener focus restoration, using strictly SpecPalette tokens in both Dark and Light appearances. Nothing is ticked by default; ⌘↵, Keep all, automations, and every profile cannot apply it.

func PermissionsFilePath(projectDir string) string

PermissionsFilePath returns the canonical path to permissions.yaml beside game.yaml in projectDir.

func PermissionsSettingsView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

PermissionsSettingsView renders the standalone full-window Settings › Permissions screen matching docs/design/editor/Settings.dc.html and docs/design/editor/Permissions.dc.html using SpecPalette tokens.

func PermissionsToastView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

PermissionsToastView renders the floating bottom-center "Always permission rule saved" toast with Show and Undo actions. It memoizes on permissionsStateRev, language, and appearance so 60 Hz frame ticks never remount it.

func PermissionsWorkspaceOverlayView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

PermissionsWorkspaceOverlayView surfaces the latest blocked MCP step link or pending Ask request in the main editor workspace while Settings › Permissions is closed, so clicking a blocked step link opens Settings › Permissions with the matching rule focused. It memoizes on permissionsStateRev, PermissionsSettingsOpen, language, and appearance so 60 Hz frame ticks never remount it.

func PlayTaskDotView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

PlayTaskDotView renders the single corner dot shown over the viewport during Play mode when one or more agent tasks need attention (failed, waiting for permission, or ready to review), matching docs/design/editor/Tasks.dc.html ("DURING PLAY") using exclusively Spec.dc.html tokens.

Nothing pops over the running game: only the 8 pt dot with its subtle 3 pt halo is drawn, colored for the most urgent state (TaskFailed > TaskNeedsYou > TaskReadyToReview). The label pill (for example "1 task needs you · stop Play to open") shows only while hovered or keyboard-focused.

func PlaytestReportView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

PlaytestReportView renders the full-window Playtest Report screen matching docs/design/editor/Playtest.dc.html and strictly using docs/design/editor/Spec.dc.html color, spacing, radius, type, and WCAG contrast tokens (including Spec Accent.OnFill on solid Accent.Fg primary buttons).

func PluginPanelKey(plugin, id string) string

PluginPanelKey returns the stable dock panel key for panel id of plugin.

func PrivacyRefusalError(kind PrivacyContentKind, subject string) error

PrivacyRefusalError builds an actionable error message explaining why an MCP call was refused because kind is switched off in Settings › Usage and privacy.

func ProblemAgentPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ProblemAgentPanelView renders the right-hand Agent problem card matching docs/design/editor/Problem.dc.html and Spec.dc.html when ProblemAgentPanelOpen is true: problem location card (file:line:col), agent explanation, before/after diff card with Apply fix, Show me and Ignore, footer note, and the "Ask about this problem…" composer. Styled exclusively with SpecPalette tokens. The outer panel chrome, ScrollView, and ask input composer remain mounted across rev updates so typing and background checks never lose focus or scroll.

func ProblemsView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ProblemsView renders the Problems panel below the viewport while a project is open: one row per live (non-ignored) problem found by assetcheck.CheckWith (over disk plus unsaved open documents) and project.Check, showing its file:line:col location, severity pill, message, proposed-fix badge, and Ignore action. Problems use the Spec removed/problem token with the alert icon and warnings use the Spec warning token with its fill, edge, and alert icon. Pressing or activating a row via keyboard opens the scene or selects the file in the file browser. It renders nothing while no project is open.

func ProfilerPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ProfilerPanelView renders the full docked Profiler panel below the viewport when Editor.ProfilerOpen reports true. It charts frame, update and draw time, FPS, allocations per frame, GC and asset memory over time, lists profiler zones from game_perf_zones sorted by cost, and provides Reset (game_perf_reset) and Chrome/Perfetto trace export through debug.Profiler.WriteChromeTrace.

func ProfilerStripView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ProfilerStripView renders the Play-mode "FRAME TIME · LAST 60 S" strip directly below the game view while Play mode is active or a running game is connected to the profiler, matching docs/design/editor/PlayMode.dc.html. Pressing the strip's Profiler button opens the full Profiler panel.

func ProjectSettingsPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ProjectSettingsPanelView renders the Project Settings panel below the viewport while a project is open and ProjectSettingsOpen reports true. Every edit runs through Editor.EditProject (or SetPluginEnabled), validates with project.Validate with inline field errors, participates in Undo/Redo, and writes game.yaml + synced nsgo.yaml on Save.

func ReconcileExternalPermissions(prev, incoming PermissionsFile, source string) (effective PermissionsFile, held []HeldPermissionLoosening, tightened int)

ReconcileExternalPermissions reconciles an externally loaded PermissionsFile (from git pull, cloning a repo, or an external editor) against prev:

  • Tightened profiles and rules apply at once (counted in tightened).
  • Loosened profiles (e.g. Balanced -> Autonomous), loosened rules (Deny -> Ask/Allow, Ask -> Allow), and removed/narrowed stricter rules are HELD in held while effective continues enforcing the stricter decision until the person explicitly confirms each entry in Settings › Permissions.
func ReferencesScreenView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ReferencesScreenView renders the full-window Find Usages and Safe Rename review screen matching docs/design/editor/References.dc.html using only Spec.dc.html tokens.

func RegisterDataTableType[T any](e *Editor, pattern string) error

RegisterDataTableType registers Go struct row type T for datatable YAML files matching pattern (a slash-separated path or glob relative to the project root, or a filename glob such as "enemies.yaml" or "data/*.yaml"). While a matching table is open in the Data Table panel, cells are checked with datatable.LoadYAML's rules and invalid edits are refused.

func RelativeLuminance(c core.Color) float64

RelativeLuminance returns the WCAG 2.1 / 2.2 relative luminance of c in [0, 1].

func ResolvePermissionFileTarget(projectRoot, raw string) (string, error)

ResolvePermissionFileTarget canonicalizes raw against projectRoot, refusing control characters, absolute paths, ".." escapes, and symlinks pointing outside projectRoot. When a symlink inside projectRoot resolves to another location inside projectRoot (for example "scenes/link.scene.yaml" -> "../game.yaml"), the real project-relative target ("game.yaml") is returned so permission rules match the actual file being touched.

func ReviewScreenView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ReviewScreenView renders the full-window change-by-change agent turn Review screen matching docs/design/editor/Review.dc.html and docs/design/editor/Spec.dc.html using exclusively SpecPalette tokens (supporting both Dark and Light appearances).

func RigPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

RigPanelView renders the 2D skeletal rig editor panel below the viewport while a rig is open: an interactive canvas showing attachments, bones, bone handles and attachment-origin handles; bone, slot, skin and animation controls; and a keyframe timeline with play and crossfade preview driven directly by the runtime skeletal package.

func RightPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

RightPanelView delegates to RightRailView for callers referencing the right-hand Agent / Inspector panel.

func RightRailView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

RightRailView renders the editor's right sidebar: TasksPanelView when Background Tasks are open, InspectorView alone when AgentModeNone is chosen, or the Agent / Inspector / History tab bar keeping InspectorView active by default at 272 pt and showing AgentPanelView or AgentHistoryView (380 pt) when selected.

func SaveAgentThreadFile(filePath string, t *AgentThread) error

SaveAgentThreadFile encodes t and atomically writes it to filePath, creating parent directories if needed.

func SaveAutomationsFile(filePath string, f *AutomationsFile) error

SaveAutomationsFile encodes f in canonical YAML and writes it atomically to filePath.

func SaveEditorSettings(path string, s *EditorSettings) error

SaveEditorSettings validates and atomically writes s as deterministic YAML to path, creating parent directories as needed.

func SaveLayoutFile(path string, f *LayoutFile) error

SaveLayoutFile encodes f and atomically writes it to path, creating parent directories if needed.

func SavePermissions(path string, f *PermissionsFile) error

SavePermissions validates and atomically writes f as deterministic YAML to path, creating parent directories as needed.

func SaveRecentProjectsFile(path string, f *RecentProjectsFile) error

SaveRecentProjectsFile encodes f and atomically writes it to path, creating parent directories if needed.

func SceneTabsView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

SceneTabsView renders the horizontal tab bar above the viewport: one tab per open scene showing its name, a dirty marker when it has unsaved edits, and a close button. Pressing a tab switches to it without clearing any undo history; closing a dirty tab prompts to save, discard or cancel.

func SceneTreeView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

SceneTreeView renders the scene tree panel: the open scene's layers and, under each, its objects with their children nested, kept in step with the editor's revision. Pressing an object's row selects it, and selecting an object in a viewport selects and reveals its row, expanding the rows above it; pressing a layer's row makes it the active layer. Dragging a row onto another makes it that object's child, or its sibling before or after it when dropped near the row's top or bottom edge (DropObject), and dropping it on a layer's row moves it to the top level of that layer (MoveObjectToLayer); both keep its world transform. A row's context menu renames it, changes its ID, moves it up, down, into the sibling above or out of its parent, to another layer, hides or locks it, or deletes it, and F2 renames the selected object in its row. The eye and lock buttons of a row hide the object in the viewports or lock it against picking for this session (SetObjectHidden, SetObjectLocked). Every edit goes through History.

func SearchPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

SearchPanelView renders the Project Search and Find References panel below the viewport while a project is open and the panel is toggled on (via FilesView's Search or Find Refs buttons, SetSearchOpen, SetSearchQuery, or ShowReferences).

func SettingsView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

SettingsView renders the unified Settings screen matching docs/design/editor/Settings.dc.html and strictly using SpecPalette color, spacing, radius, type, and contrast tokens in both Dark and Light appearances. It hosts AGENT (Models and connections, Permissions, Game brief, Project rules, Tools, Automations, Usage and privacy), PROJECT · game.yaml (Project, Input map, Audio buses, Export), and EDITOR · THIS COMPUTER (General, Viewport, Shortcuts), keeping every control reachable with Tab, arrow keys, and focus rings.

func ShortcutFromKeyEvent(ev core.KeyEvent, targetOS core.OS) (string, bool)

ShortcutFromKeyEvent converts a hardware KeyEvent captured during rebinding into NSGo's canonical portable shortcut form (converting Meta to "mod" on Apple platforms and Ctrl to "mod" on Windows and Linux). Returns "", false for bare modifier presses or unsupported empty events.

func ShortcutsSheetView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ShortcutsSheetView renders the ⌘/ Keyboard Shortcuts reference sheet grouped by keyboard scope, styled strictly with Spec color tokens from docs/design/editor/Spec.dc.html.

func SketchPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

SketchPanelView renders the right-side Agent / Sketch panel matching docs/design/editor/Sketch.dc.html using exclusively Spec tokens: Agent header, post-sketch Review card (with Sketch overlay toggle, Keep, Revert), Agent Reading card ("I read your sketch as:" with numbered items, assumptions warning box, Go ahead, Correct a mark), "Sent with this request" scene-coordinate preview, and composer with the "Sketch · N marks" chip.

func SpecAgentPulseOpacity(cx *core.Scope, elapsed time.Duration) float32

SpecAgentPulseOpacity returns the Spec agent-working outline opacity in [0.45, 1.0] for elapsed time since the pulse began. Under Env.ReduceMotion it stays solid at 1.0.

func SpecMotionDuration(cx *core.Scope, d time.Duration) time.Duration

SpecMotionDuration returns d when motion is enabled, or 0 when cx is non-nil and cx.Env().ReduceMotion() is true.

func SpecOverlayLegendView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

SpecOverlayLegendView renders the complete Spec.dc.html Overlay Legend board (Selection, Agent working, Added, Changed, Removed, Problem, and Focused change in Review) on the active theme's viewport surround, drawing every card through DrawObjectOverlay using exclusively SpecPalette tokens so Dark and Light appearances can be inspected side by side.

func SpecTheme() *core.Theme

SpecTheme returns a clone of the editor's Spec *core.Theme containing both dark and light palettes, mapped onto every NSGo core.Palette and ui.Colors role as well as all Spec-specific tokens.

func SpecThemeYAML() []byte

SpecThemeYAML returns a copy of the embedded YAML theme file parsed by core.ParseTheme.

func SpecToastCard(p SpecPalette, t Toast, waiting int, onDismiss func()) core.Node

SpecToastCard renders a single Spec toast pill (40 pt tall, 12 pt radius, single line, semantic icon, optional waiting count badge, optional action button with shortcut, optional dismiss button) using exclusively tokens from p.

func StartScreenView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

StartScreenView renders the editor's Start Screen matching Start.dc.html, step 1 of FirstRun.dc.html, and the Spec.dc.html design tokens (Dark & Light): left sidebar with navigation and conditional RECENT list, right pane with "What do you want to make?", dynamically populated template cards with filter chips, live-validated New Project bar with a single primary Create button, and streaming `game new` output.

func StatesPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

StatesPanelView renders the sprite state machine graph editor panel (matching Animation.dc.html Screen 1) whenever a *.states.yaml document is open: header with file info, Play/Pause, Drive with keys toggle + interactive key pills, Save and Close; state graph canvas with state nodes (sprite thumbnail, name, clip meta), Any state badge, directed transition arrows and condition labels; right sidebar with live animated sprite preview card and LEAVING <STATE> outgoing transition list.

func StoreUploadRequiresConfirmation(AgentPermissionProfile) bool

StoreUploadRequiresConfirmation reports whether store publishing requires explicit confirmation in Review uploads for the given permission profile. It always returns true.

func TasksPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

TasksPanelView renders the Agent right panel with its collapsible Tasks list (grouped under Needs you, Running, Ready to review, Queued, and Failed), bulk Dismiss for Ready to review, focused task detail with live steps & review actions, and Queue / Run in parallel composer, matching docs/design/editor/Tasks.dc.html using exclusively SpecPalette tokens. The panel container, ScrollViews, and composer input remain stably mounted across task updates so background progress never steals typing focus or resets scroll position.

func TerrainPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

TerrainPanelView renders the docked Terrain Sculpt & Paint panel below the viewport while a terrain is open: brush mode selector (Raise, Lower, Smooth, Flatten, Set Height, Paint Layer, Paint Foliage), falloff selector (Smooth, Linear, Flat), numeric inputs for radius, strength, target height, and target foliage density, active material/foliage layer pickers, and Save/Close actions.

func TilePaletteView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

TilePaletteView renders the tile palette panel, shown right of the viewport while a tile tool is active in 2D: the active layer's tileset (Editor.TilePalette) as a grid of its tiles in ID order at the tilemap's tile size, scaled down only when a tile is wider than the panel. Pressing a tile, or moving between tiles with the arrow keys, makes it the tile Paint, Fill, Rect and Line use (Editor.SetActiveTileID); as in base.RadioGroup, every arrow key steps through the tiles in ID order rather than by rows. With Stamp active, pressing tiles selects a 1x1 or rectangular pattern (Shift or the Rect toggle extends from the anchor tile) alongside Copy/Cut/Paste controls; with Random active, pressing tiles toggles them in the weighted random pool alongside Seed and weight controls. A layer without tiles to pick shows why instead of an empty grid.

func TileReviewPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

TileReviewPanelView renders the region-based tile edit review panel right of the viewport while a tile review is active in 2D, styled exclusively with Spec.dc.html tokens and matching docs/design/editor/Tiles.dc.html.

func TilesetEditorPanelView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

TilesetEditorPanelView renders the docked Tileset Editor below the viewport while a YAML tileset (*.tileset.yaml) is open: terrain set management, a visual tile grid with collision/shape/animation/terrain indicators, and tabbed per-tile editors for Terrain masks, Collision flags and shapes (drawn over the tile), Animation (with live preview), and Custom Data.

func TilesetTileDisplayName(doc *tilemap.TilesetDoc, tileID int) string

TilesetTileDisplayName returns tileID's human-readable name from doc: TileDoc.Name when set, else the atlas frame name, else "tile_<id>".

func TilesetTileSource(doc *tilemap.TilesetDoc, tileID int) string

TilesetTileSource formats where tileID comes from in doc, e.g. "art/tiles/dungeon.png · cell 2, 1" or "atlas: props · frame torch_1".

func ToastDuration(t Toast) time.Duration

ToastDuration returns the Spec auto-dismiss timeout for t (docs/design/editor/Toasts.dc.html):

  • ToastSuccess and ToastInfo: 4 s without an action, 6 s with an action
  • ToastWarning: 8 s
  • ToastError and ToastProgress: 0 (stays until retried, dismissed, canceled, or completed)
func ToastView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ToastView renders the editor's active toast at the bottom center of the viewport (8 px above the viewport bar in edit mode, never over the scene tree, inspector, or agent panel) while the viewport is on screen, using exclusively SpecPalette tokens (docs/design/editor/Toasts.dc.html).

func ValidateAgentThread(t *AgentThread) error

ValidateAgentThread checks that t conforms to version 1 of the agent thread schema.

func ValidateAutomations(f *AutomationsFile) error

ValidateAutomations checks f against the version 1 automations schema.

func ValidateCheckpointManifest(m *CheckpointManifest) error

ValidateCheckpointManifest checks that m conforms to version 1 of the checkpoint manifest schema.

func ValidateEditorSettings(s *EditorSettings) error

ValidateEditorSettings checks s against the version 1 editor settings schema.

func ValidateLayout(f *LayoutFile) error

ValidateLayout checks that f conforms to version 1 of the editor dock layout schema.

func ValidatePermissions(f *PermissionsFile) error

ValidatePermissions checks f against the version 1 permissions schema.

func ValidateRecentProjects(f *RecentProjectsFile) error

ValidateRecentProjects checks that f conforms to version 1 of the recent projects schema.

func ValidateReleaseNotes(notes string) error

ValidateReleaseNotes reports whether notes is safe and within the size budget for release notes Markdown.

func Viewport3DModelsStripView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

Viewport3DModelsStripView renders the bottom MODELS strip along the 3D viewport (docs/design/editor/Viewport3D.dc.html), showing offscreen-rendered thumbnails of the project's models and built-in primitives with drag-into-viewport placement, tooltips, an "Or ask for one" button, and an inline agent prompt bar when opened. All surfaces, borders, text, focus rings, and icons come strictly from SpecPalette tokens.

func ViewportView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

ViewportView renders the center interactive core.Canvas viewport panel, which fills the panel.

In 2D, with the Select or Move tool, a drag on an object moves it, and a drag on the selection's gizmo moves it along one of its axes, turns it with the ring or scales it with a corner or edge handle (Shift keeps the aspect ratio), each recorded as one undoable step when the drag ends; Escape or a cancelled gesture puts the object back (BeginDrag2D). A mouse wheel, a pinch or a touchpad scroll with Control or Command held zooms the 2D view (View2D) about the pointer, and a touchpad's scroll, a mouse wheel's sideways scroll, a middle-button drag, a drag with Space held or a two-finger drag pans it; while the scene plays the view is the scene camera's and does not move; F frames the selection (FrameSelection2D), Home frames everything (FrameAll2D) and Mod+0 returns to the scene camera's view (ResetView2D). With a tile tool a drag with the mouse or one finger is a tile stroke (BeginTileStroke) over every cell it crosses, recorded as one undo step: Paint paints and Erase erases, a right-button drag erases with Paint, Alt with any tile tool picks the tile under the pointer, and Pick picks and hands over to Paint; the cell under the resting mouse is outlined (HoveredTile). In 3D a drag orbits the camera or drags the gizmo; a middle-button drag, a Shift-drag, a touchpad's scroll and a two-finger drag pan it; the wheel and a pinch zoom it; holding the right button flies it, the pointer turning it and W, A, S, D, Q and E moving it (BeginFly3D); F frames the selection; and a bar, an axis widget and the controls' help line over the scene switch the projection, turn to the axis views, orbit by 15 degrees and reset the view.

func WindowToastView(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node

WindowToastView renders the editor's active toast at the bottom center of the window, 24 px up, whenever no viewport is on screen (Start screen, Settings, Export, and other full-window screens), using exclusively SpecPalette tokens (docs/design/editor/Toasts.dc.html).

Types

type AgentChangeKind string

AgentChangeKind classifies how an object differs in a pending agent turn.

const (
	AgentChangeAdded   AgentChangeKind = "added"
	AgentChangeChanged AgentChangeKind = "changed"
	AgentChangeRemoved AgentChangeKind = "removed"
)
type AgentChipPayload struct {
	Chip      AgentContextChip
	Header    string
	Text      string
	ImagePNG  []byte
	ImageSrc  core.ImageSource
	ImageW    int
	ImageH    int
	StartLine int
	EndLine   int
	Tokens    int
}

AgentChipPayload is the exact content shown on chip hover AND assembled into the request sent to the agent. Both the hover preview and AssembleAgentRequest resolve every chip through ResolveChipPayload so they can never diverge.

func (p AgentChipPayload) Formatted() string

Formatted returns the exact text payload sent to the agent and shown on hover.

type AgentClientInfo struct {
	// ID uniquely identifies the session on the server.
	ID string
	// Name is the client's raw MCP implementation name (for example "claude-code" or "codex").
	Name string
	// DisplayName is the friendly display name shown in tooltips and Settings (for example "Claude Code").
	DisplayName string
	// Transport names how the client reaches the server (for example "stdio" or "unix").
	Transport string
}

AgentClientInfo identifies one connected MCP client session attached to the editor's MCP server.

func (c AgentClientInfo) HoverLabel() string

HoverLabel formats the status chip hover text, such as "Claude Code over stdio".

type AgentContextChip struct {
	ID        string
	Kind      ContextChipKind
	Name      string
	Target    string
	SceneFile string
	Layer     string
	Line      int
	Detail    string
	Icon      MentionIconKind
	ColorRole string
	Always    bool
	Suggested bool
}

AgentContextChip is one chip shown above the composer.

type AgentContextItem struct {
	ID      string
	Label   string
	Primary bool
	Locked  bool
}

AgentContextItem describes one item listed under "The agent reads these with every request:".

type AgentEvent struct {
	Kind         AgentEventKind
	SessionID    string
	StepID       string
	StepTitle    string
	StepDetail   string
	StepStatus   AgentStepStatus
	StepIndex    int
	StepTotal    int
	ToolName     string
	CallSummary  string
	PlannedSteps []string
	Partial      *AgentPartialState
	Lost         *AgentLostState
	Text         string
	InputTokens  int
	OutputTokens int
	Err          string
}

AgentEvent is one incremental update streamed by an AgentRunner.

func ParseClaudeStreamLine(line []byte) ([]AgentEvent, bool)

ParseClaudeStreamLine decodes one JSONL line from `claude --print --output-format=stream-json --verbose` into incremental AgentEvents.

func ParseCodexStreamLine(line []byte) ([]AgentEvent, bool)

ParseCodexStreamLine decodes one JSONL line from `codex exec --json` into incremental AgentEvents.

type AgentEventKind string

AgentEventKind classifies one streamed event from an AgentRunner.

const (
	AgentEventSession        AgentEventKind = "session"
	AgentEventStep           AgentEventKind = "step"
	AgentEventMessage        AgentEventKind = "message"
	AgentEventUsage          AgentEventKind = "usage"
	AgentEventDone           AgentEventKind = "done"
	AgentEventError          AgentEventKind = "error"
	AgentEventModelRecovered AgentEventKind = "model_recovered"
)
type AgentFailedCall struct {
	ToolName string
	Call     string
	Error    string
}

AgentFailedCall records one refused tool call listed in the Stuck card.

type AgentFieldDiff struct {
	Component string `json:"component,omitempty"`
	Field     string `json:"field"`
	OldValue  string `json:"oldValue"`
	NewValue  string `json:"newValue"`
}

AgentFieldDiff records one changed object, component, or property field in a pending agent turn.

type AgentFollowUp struct {
	Text   string    `json:"text"`
	SentAt time.Time `json:"sentAt"`
}

AgentFollowUp is an additional instruction sent via "Add to this request" while an agent request is running.

type AgentHistoryEntry struct {
	ID          string
	Kind        string // "agent", "person", "saved"
	Title       string
	Meta        string
	ThreadID    string
	RequestID   string
	StepID      string
	Timestamp   string
	Highlighted bool
}

AgentHistoryEntry is one item in the History timeline (agent steps and manual undo commands).

type AgentHistorySelection struct {
	ThreadID  string
	RequestID string
	StepID    string
}

AgentHistorySelection identifies the step focused when "Open this step in History" is clicked.

type AgentImageFormat string

AgentImageFormat identifies one of the three supported reference image formats for agent requests.

const (
	AgentImagePNG  AgentImageFormat = "png"
	AgentImageJPEG AgentImageFormat = "jpeg"
	AgentImageWebP AgentImageFormat = "webp"
)
func (f AgentImageFormat) Extension() string

Extension returns the canonical lowercase file extension (including the leading dot) for f.

func (f AgentImageFormat) Label() string

Label returns the human-readable format name shown in previews and errors.

func (f AgentImageFormat) MIMEType() string

MIMEType returns the standard MIME type for f.

type AgentLostKind string

AgentLostKind classifies whether a request was interrupted by a lost MCP connection or a model API error.

const (
	AgentLostConnection AgentLostKind = "connection"
	AgentLostModelError AgentLostKind = "model_error"
)
type AgentLostState struct {
	Kind             AgentLostKind
	AgentName        string
	LostAt           time.Time
	AfterStep        int
	DuringStep       int
	Title            string
	Detail           string
	RetryAttempt     int
	RetryTotal       int
	RetryIn          time.Duration
	FallbackAgent    string
	Reconnected      bool
	AskResumePending bool
	Resumed          bool
}

AgentLostState holds the state when the connection or model fails mid-request.

func (l AgentLostState) EffectiveBody() string

EffectiveBody returns the Lost card description with timestamp and interrupted step.

func (l AgentLostState) EffectiveTitle() string

EffectiveTitle returns the Lost card heading.

type AgentMCPServer struct {
	// Name is the unique MCP server identifier (letters, digits, '_', '-').
	Name string `yaml:"name" schema:"required"`
	// Title is the display name shown in Settings › Tools (for example "Running game · nsgo dev").
	Title string `yaml:"title,omitempty"`
	// Description briefly describes what the server offers (for example "inspect and drive the live game").
	Description string `yaml:"description,omitempty"`
	// Command is the executable launched over stdio (for example "go").
	Command string `yaml:"command" schema:"required"`
	// Args are optional arguments passed to Command (for example ["tool", "nsgo", "mcp"]).
	Args []string `yaml:"args,omitempty"`
	// Enabled controls whether this server is included in the agent's MCP configuration (default true when omitted).
	Enabled *bool `yaml:"enabled,omitempty"`
}

AgentMCPServer configures an external MCP server the agent may use alongside the editor's server. Entries configured here are written into the project's agent MCP configuration (.mcp.json and .codex/config.toml).

func DefaultAgentMCPServers() []AgentMCPServer

DefaultAgentMCPServers returns the default external MCP server list starting with the running game via `nsgo dev`.

func (s AgentMCPServer) CommandLine() string

CommandLine formats Command and Args for display in Settings › Tools.

func (s AgentMCPServer) DisplayTitle() string

DisplayTitle returns Title when set, falling back to Name.

func (s AgentMCPServer) IsEnabled() bool

IsEnabled reports whether s is enabled (true when Enabled is nil).

type AgentMismatchReport struct {
	Title       string
	ClaimedText string
	Rows        []AgentMismatchRow
	Reason      string
	AskedWhy    bool
}

AgentMismatchReport describes a disagreement between an agent's summary text and the actual diff in its review.

func CheckAgentSummaryAgainstDiff(summary string, review *AgentTurnReview, mutations []agentObjectMutation) *AgentMismatchReport

CheckAgentSummaryAgainstDiff compares every numeric and untouched claim in summary against the actual scene diff in review. When any claim disagrees with review, it returns a populated AgentMismatchReport (including the known reason when an object was added and later removed during the turn).

type AgentMismatchRow struct {
	What      string
	Summary   string
	Review    string
	Disagrees bool
}

AgentMismatchRow is one comparison row in the Summary-vs-Review mismatch table.

type AgentMode string

AgentMode selects how the editor connects to an AI agent.

const (
	// AgentModeUnconfigured is the initial state before the user completes the Connect dialog.
	AgentModeUnconfigured AgentMode = ""
	// AgentModeLocal connects to an external MCP agent running on this computer (Claude Code, Codex, or any MCP client).
	AgentModeLocal AgentMode = "local"
	// AgentModeAPIKey selects the built-in model path using an API key stored in NSGo's core.Secrets / system keychain.
	AgentModeAPIKey AgentMode = "apikey"
	// AgentModeNone disables agent features and keeps the Agent panel closed.
	AgentModeNone AgentMode = "none"
)
type AgentModelErrorState struct {
	Provider         string
	StatusCode       int
	Headline         string
	Message          string
	RetryDelay       time.Duration
	RetryAttempt     int
	RetryTotal       int
	Retrying         bool
	Task             AgentTaskKind
	AlternativeAgent string
	AlternativeRoute AgentModelRoute
}

AgentModelErrorState describes a live model API error card (such as HTTP 529 overloaded) with retry progress and an optional switch to another connected agent.

func (m AgentModelErrorState) Body() string

Body formats the model error card body text matching docs/design/editor/AgentStates.dc.html, for example "Retrying in 8 s · try 2 of 4. Playtest analysis can switch to Claude Code for now."

type AgentModelRoute string

AgentModelRoute classifies which execution backend handles a WHO DOES WHAT route label.

const (
	// AgentRouteLocal routes work to the connected local MCP agent (for example Claude Code or Codex).
	AgentRouteLocal AgentModelRoute = "local"
	// AgentRouteBuiltInDefault routes work to the built-in Anthropic API default model.
	AgentRouteBuiltInDefault AgentModelRoute = "builtin_default"
	// AgentRouteBuiltInFast routes work to the built-in Anthropic API fast model.
	AgentRouteBuiltInFast AgentModelRoute = "builtin_fast"
	// AgentRouteNone leaves a task kind unassigned (for example Art and sound when no generator server is connected).
	AgentRouteNone AgentModelRoute = "none"
)
func (r AgentModelRoute) IsBuiltIn() bool

IsBuiltIn reports whether r uses the built-in API key runner rather than a local MCP CLI agent.

func (r AgentModelRoute) Valid() bool

Valid reports whether r is a recognized task route.

type AgentObjectAttribution struct {
	ThreadID     string
	ThreadTitle  string
	RequestID    string
	RequestTitle string
	ScenePath    string
	Timestamp    string
	AgeLabel     string
}

AgentObjectAttribution identifies the agent thread request that last changed an object, displayed in the Inspector footer ("Changed in ‘…’ · 2 min ago").

type AgentObjectChange struct {
	ObjectID   string                 `json:"objectId"`
	Name       string                 `json:"name"`
	Layer      string                 `json:"layer"`
	ParentID   string                 `json:"parentId,omitempty"`
	Kind       AgentChangeKind        `json:"kind"`
	Detail     string                 `json:"detail"`
	Fields     []AgentFieldDiff       `json:"fields,omitempty"`
	RemovedDoc *sceneformat.ObjectDoc `json:"-"`
}

AgentObjectChange describes one object added, changed, or removed during the pending agent turn.

type AgentOpenRequest struct {
	ID       string
	Title    string
	Body     string
	OpenedAt time.Time
}

AgentOpenRequest represents a pending permission prompt or question waiting on the user.

type AgentPartialState struct {
	DoneCount     int
	TotalCount    int
	Target        string
	Title         string
	Reason        string
	PointPrompt   string
	Pointing      bool
	HasPoint      bool
	PointedX      float32
	PointedY      float32
	Kept          bool
	TryingAnother bool
}

AgentPartialState holds the panel state when only part of a request could be completed.

func (p AgentPartialState) EffectivePointPrompt() string

EffectivePointPrompt returns the inline viewport pointing instruction.

func (p AgentPartialState) EffectiveTitle() string

EffectiveTitle returns the card heading, defaulting to "Done N of M · couldn't place <target>".

type AgentPendingReview struct {
	StepsDone     int      `json:"stepsDone"`
	ChangesCount  int      `json:"changesCount"`
	Summary       string   `json:"summary,omitempty"`
	NotChecked    []string `json:"notChecked,omitempty"`
	Stopped       bool     `json:"stopped,omitempty"`
	StoppedBefore string   `json:"stoppedBefore,omitempty"`
	Kept          bool     `json:"kept,omitempty"`
	Reverted      bool     `json:"reverted,omitempty"`
}

AgentPendingReview summarizes completed steps and edits left pending for review after a turn finishes or is stopped.

type AgentPermissionDecision string

AgentPermissionDecision is the starting decision for an agent permission rule.

const (
	AgentPermissionAllow AgentPermissionDecision = "allow"
	AgentPermissionAsk   AgentPermissionDecision = "ask"
	AgentPermissionDeny  AgentPermissionDecision = "deny"
)
type AgentPermissionOutcome string

AgentPermissionOutcome is the person's answer to an interactive Agent panel permission card (or Stop interrupting it).

const (
	PermissionOutcomeAllowOnce   AgentPermissionOutcome = "allow_once"
	PermissionOutcomeAllowAlways AgentPermissionOutcome = "allow_always"
	PermissionOutcomeDeny        AgentPermissionOutcome = "deny"
	PermissionOutcomeStopped     AgentPermissionOutcome = "stopped"
)
type AgentPermissionProfile = PermissionProfile

AgentPermissionProfile aliases PermissionProfile from Settings -> Permissions. Store uploads ALWAYS ask first in Review uploads regardless of profile (including Autonomous).

type AgentPermissionPrompt struct {
	ID            string
	StepID        string
	Title         string
	ShortAction   string
	Why           string
	Effect        string
	RuleSource    string
	RulePreview   string
	AlwaysLabel   string
	Tool          string
	PermissionKey string
	Evaluation    PermissionEvaluation
	AskedAt       time.Time
}

AgentPermissionPrompt describes an open interactive permission card rendered inside the Agent panel.

type AgentPermissionRule struct {
	Action   string
	Files    string
	Decision AgentPermissionDecision
}

AgentPermissionRule is one starting rule produced from the Connect dialog's four checkboxes.

type AgentPermissions struct {
	EditScenesAndData    bool
	RunGameCheck         bool
	RunHeadlessPlaytests bool
	EditGoCode           bool
}

AgentPermissions holds the four starting permission toggles in the Connect dialog.

func DefaultAgentPermissions() AgentPermissions

DefaultAgentPermissions matches Connect.dc.html: scenes/data and game check ticked, playtests and Go code unticked.

func (p AgentPermissions) Rules() []AgentPermissionRule

Rules translates the four checkboxes into starting ordered permission rules (first match wins).

type AgentPlan struct {
	ID               string         `json:"id"`
	TurnID           string         `json:"turnId,omitempty"`
	Prompt           string         `json:"prompt,omitempty"`
	Title            string         `json:"title"`
	Summary          string         `json:"summary,omitempty"`
	Estimate         PlanEstimate   `json:"estimate,omitempty"`
	Reason           string         `json:"reason,omitempty"`
	Questions        []PlanQuestion `json:"questions,omitempty"`
	Steps            []PlanStep     `json:"steps"`
	Files            []PlanFile     `json:"files,omitempty"`
	GhostsVisible    bool           `json:"ghostsVisible"`
	Phase            PlanPhase      `json:"phase"`
	ActiveStep       int            `json:"activeStep,omitempty"`
	EditingStep      int            `json:"editingStep,omitempty"`
	ReopenedQuestion string         `json:"reopenedQuestion,omitempty"`
	PickedForYou     bool           `json:"pickedForYou,omitempty"`
	NothingWritten   bool           `json:"nothingWritten,omitempty"`
	WrittenSteps     int            `json:"writtenSteps,omitempty"`
}

AgentPlan is an agent-proposed plan shown in the Agent panel, Scene Tree, and 2D viewport before edits begin.

func (p *AgentPlan) Clone() *AgentPlan

Clone returns a deep copy of p.

type AgentPlanDecision struct {
	PlanID         string               `json:"planId"`
	Decision       string               `json:"decision"` // "approved", "stopped", or "pending"
	PickedForYou   bool                 `json:"pickedForYou,omitempty"`
	NothingWritten bool                 `json:"nothingWritten,omitempty"`
	Summary        string               `json:"summary,omitempty"`
	Answers        []PlanAnswerDecision `json:"answers,omitempty"`
	Steps          []PlanStepDecision   `json:"steps,omitempty"`
	RemovedSteps   []int                `json:"removedSteps,omitempty"`
	ActiveFiles    []string             `json:"activeFiles,omitempty"`
}

AgentPlanDecision is the structured response returned by plan_propose once the person decides.

type AgentPlanReview struct {
	PlanID         string           `json:"planId"`
	Title          string           `json:"title"`
	Phase          PlanPhase        `json:"phase"`
	PickedForYou   bool             `json:"pickedForYou,omitempty"`
	NothingWritten bool             `json:"nothingWritten,omitempty"`
	Steps          []PlanReviewStep `json:"steps"`
}

AgentPlanReview is attached to an AgentTurn so the turn's review lists the plan's steps and marks which were done.

func (r *AgentPlanReview) Clone() *AgentPlanReview

Clone returns a deep copy of r.

func (r *AgentPlanReview) DoneCount() (done, total int)

DoneCount returns how many non-removed steps in r are marked done and the total non-removed step count.

type AgentPrivacyPolicy struct {
	SceneAndData   bool
	ViewportImages bool
	GoSource       bool
	ArtAndAudio    bool
}

AgentPrivacyPolicy is the resolved boolean policy for what content may leave this computer through MCP tools.

func DefaultAgentPrivacyPolicy() AgentPrivacyPolicy

DefaultAgentPrivacyPolicy returns the default privacy policy matching Settings.dc.html: scene/data files and viewport images on; Go source code and art/audio files off.

func (p AgentPrivacyPolicy) Allows(kind PrivacyContentKind) bool

Allows reports whether content of kind may leave this computer under p.

type AgentPrivacySettings struct {
	// SceneAndData allows MCP tools to return scene, prefab, data table, and project YAML files (default true).
	SceneAndData *bool `yaml:"sceneAndData,omitempty"`
	// ViewportImages allows viewport_image and frozen-frame tools to return PNG images (default true).
	ViewportImages *bool `yaml:"viewportImages,omitempty"`
	// GoSource allows MCP tools to return Go source code and go.mod files (default false).
	GoSource *bool `yaml:"goSource,omitempty"`
	// ArtAndAudio allows MCP tools to return art and audio assets or metadata files (default false).
	ArtAndAudio *bool `yaml:"artAndAudio,omitempty"`
}

AgentPrivacySettings is the YAML representation of WHAT MAY LEAVE THIS COMPUTER in EditorSettings. Omitted fields fall back to DefaultAgentPrivacyPolicy (SceneAndData=true, ViewportImages=true, GoSource=false, ArtAndAudio=false).

func (s *AgentPrivacySettings) Resolve() AgentPrivacyPolicy

Resolve returns the concrete AgentPrivacyPolicy with defaults applied for omitted fields.

type AgentPromptRequest struct {
	ObjectID   string
	ObjectName string
	Layer      string
	ScenePath  string
	Draft      string
}

AgentPromptRequest describes a prompt draft sent from the editor to an attached agent composer (for example "Ask the agent about this" in the object context menu).

type AgentQueuedRequest struct {
	ID       string
	Task     AgentTaskKind
	Prompt   string
	QueuedAt time.Time
	Offline  bool
}

AgentQueuedRequest is a prompt queued while offline or while the weekly request limit is reached (waiting for explicit user send).

type AgentReferenceImage struct {
	// ID uniquely identifies this image within the current composer draft (or "brief:<path>" for pinned brief references).
	ID string
	// Name is the display file name (for example "spikes_ref.png").
	Name string
	// Path is the project-relative slash path when pinned or read from brief.yaml (for example "art/reference/spikes_ref.png"),
	// or empty for a one-shot ephemeral composer attachment.
	Path string
	// Format is AgentImagePNG, AgentImageJPEG, or AgentImageWebP.
	Format AgentImageFormat
	// MIMEType is "image/png", "image/jpeg", or "image/webp".
	MIMEType string
	// Data holds the raw encoded image bytes sent to the agent.
	Data []byte
	// Width and Height are the decoded pixel dimensions.
	Width  int
	Height int
	// Pinned reports whether this image has been copied to art/reference/ and added to brief.yaml.
	Pinned bool
	// FromBrief reports whether this image joined the request through brief.yaml (the Always chip).
	FromBrief bool
	// Note is an optional short description recorded alongside path in brief.yaml.
	Note string
	// Pixels holds the decoded RGBA image for in-memory thumbnail and hover preview rendering.
	Pixels *image.RGBA
	// ImageVersion uniquely keys core.ImageSource pixel uploads.
	ImageVersion uint64
}

AgentReferenceImage is a validated PNG, JPEG, or WebP reference image attached to a single composer request or pinned to brief.yaml for every request in the project.

func DecodeAgentReferenceImage(name string, data []byte) (AgentReferenceImage, error)

DecodeAgentReferenceImage validates that data is a well-formed PNG, JPEG, or WebP image within safe bounds and decodes its pixels into an RGBA image for thumbnails and hover previews. Unsupported file types (such as GIF, SVG, BMP, text, or YAML) are refused with a clear reason.

type AgentRemovedNode struct {
	ObjectID string
	Name     string
	Layer    string
	ParentID string
	Doc      *sceneformat.ObjectDoc
}

AgentRemovedNode represents an object removed during the pending agent turn so the scene tree and viewport can show its removed marker and ghost until Keep or Revert.

type AgentRequest struct {
	ThreadID         string
	SessionID        string
	Prompt           string
	ProjectRoot      string
	ScenePath        string
	SelectedID       string
	AgentKind        ExternalAgentKind
	Permissions      AgentPermissions
	Task             AgentTaskKind
	Route            AgentModelRoute
	Model            string
	PriorTurns       []AgentTurnSummary
	AutomationID     string
	AutomationName   string
	TriggerKind      AutomationTriggerKind
	TriggerDetail    string
	CheckpointID     string
	AttachedImages   []AgentReferenceImage // one-shot reference images dropped or pasted for this request only
	BriefImages      []AgentReferenceImage // project-wide reference images joined through brief.yaml's Always chip
	Images           []AgentReferenceImage // deduplicated union of AttachedImages and BriefImages sent with this request
	ResumeFromStep   int
	CompletedSteps   []string
	RemainingSteps   []string
	Hint             string
	PointedWorld     *[2]float32
	PointedTarget    string
	TryAnotherWay    bool
	SummarySeed      string
	Attachments      []AgentChipPayload
	ViewportImage    []byte
	ViewportWidth    int
	ViewportHeight   int
	HasViewportImg   bool
	AssembledContext string
}

AgentRequest is passed to an AgentRunner or Editor.OnSendAgentComposerRequest when the user submits text from the composer or an automation triggers, carrying both runner/automation metadata and the exact context assembled from the active composer chips (and nothing else).

type AgentResponse struct {
	Reply string
	Usage *AgentTokenUsage
}

AgentResponse is returned by Editor.OnSendAgentComposerRequest when a scripted or connected agent handles a request.

type AgentReviewChange struct {
	ID       string                `json:"id"`
	ObjectID string                `json:"object_id,omitempty"`
	Path     string                `json:"path"`
	Kind     AgentReviewChangeKind `json:"kind"`
	Title    string                `json:"title"`
	Detail   string                `json:"detail"`
	Reverted bool                  `json:"reverted,omitempty"`
	Kept     bool                  `json:"kept,omitempty"`
	OnKeep   func() error          `json:"-"`
	OnRevert func() error          `json:"-"`
}

AgentReviewChange is one non-deletion file change listed in the Review changes panel.

type AgentReviewChangeKind = ReviewChangeKind

AgentReviewChangeKind classifies a regular (non-deletion) entry in an agent review.

const (
	ReviewChangeModified AgentReviewChangeKind = "modified"
)
type AgentReviewSnapshot struct {
	Open      bool                `json:"open"`
	Prompt    string              `json:"prompt,omitempty"`
	Changes   []AgentReviewChange `json:"changes,omitempty"`
	Deletions []ProposedDeletion  `json:"deletions,omitempty"`
}

AgentReviewSnapshot is a read-only view of the active Review changes panel.

type AgentReviewState string

AgentReviewState tracks the review lifecycle of an automation (or background) turn in the Agent panel.

const (
	// AgentReviewNone is the default for ordinary interactive chat turns.
	AgentReviewNone AgentReviewState = ""
	// AgentReviewRunning indicates a background automation task is currently executing.
	AgentReviewRunning AgentReviewState = "running"
	// AgentReviewNeedsYou indicates the background task is waiting on a permission prompt or user question.
	AgentReviewNeedsYou AgentReviewState = "needs_you"
	// AgentReviewReady indicates the automation finished and its result is in Ready to review (never unreviewed).
	AgentReviewReady AgentReviewState = "ready_to_review"
	// AgentReviewKept indicates the author reviewed and kept the automation's result.
	AgentReviewKept AgentReviewState = "kept"
	// AgentReviewDismissed indicates the author dismissed the Ready-to-review result (reverting nothing that was never kept).
	AgentReviewDismissed AgentReviewState = "dismissed"
	// AgentReviewFailed indicates the automation failed or was blocked by permissions.
	AgentReviewFailed AgentReviewState = "failed"
)
type AgentRewindMode string

AgentRewindMode selects what RewindAgentTurn restores when rewinding to before a message.

const (
	// AgentRewindBoth restores files from the turns' checkpoints and drops the target and later turns from the thread.
	AgentRewindBoth AgentRewindMode = "both"
	// AgentRewindFilesOnly restores files from the turns' checkpoints while keeping the conversation thread unchanged.
	AgentRewindFilesOnly AgentRewindMode = "files"
	// AgentRewindConversationOnly drops the target and later turns from the thread while keeping all files as they are.
	AgentRewindConversationOnly AgentRewindMode = "conversation"
)
type AgentRewindPreview struct {
	TurnID       string
	TurnIndex    int
	Prompt       string
	ChangedFiles []string
	DroppedTurns int
}

AgentRewindPreview describes the files and replies that rewinding to before a message will affect.

type AgentRewindState struct {
	TurnID        string
	TurnIndex     int
	Mode          AgentRewindMode
	Prompt        string
	FilesRestored []string
	TurnsDropped  int
}

AgentRewindState describes the most recent rewind shown in the post-rewind banner above the composer with Redo.

type AgentRunner interface {
	Run(ctx context.Context, req AgentRequest, emit func(AgentEvent)) error
}

AgentRunner executes a composer request against an external agent (such as Claude Code or Codex) and streams incremental events to emit until the turn completes or ctx is canceled.

type AgentRunnerFunc func(ctx context.Context, req AgentRequest, emit func(AgentEvent)) error

AgentRunnerFunc adapts a function to AgentRunner.

func (f AgentRunnerFunc) Run(ctx context.Context, req AgentRequest, emit func(AgentEvent)) error

Run calls f.

type AgentSecretStore interface {
	Get(account string) (string, bool, error)
	Set(account, value string) error
	Delete(account string) error
}

AgentSecretStore matches NSGo's core.Secrets interface (Get/Set/Delete by account) so the editor uses cx.Secrets() directly in apps and nsgotest, or a test store when headless.

type AgentSendRequest struct {
	Prompt       string
	Title        string
	SessionID    string
	Reply        string
	Outcome      AgentThreadOutcome
	ChangesTotal int
	ChangesKept  int
	Files        []string
	Objects      []string
	Detail       string
	HistoryStep  string
	HistoryIndex int
	Steps        []AgentThreadStep
}

AgentSendRequest describes a request submitted to the active agent thread via SendAgentRequestWith.

type AgentSessionSnapshot struct {
	RequestID       uint64
	TurnID          string
	Status          AgentStatus
	Stopped         bool
	Prompt          string
	Steps           []AgentStep
	PendingAsk      *AgentPermissionPrompt
	FollowUps       []AgentFollowUp
	Review          *AgentPendingReview
	Activity        string
	StartedAt       time.Time
	Elapsed         time.Duration
	WaitingElapsed  time.Duration
	DeniedKeysCount int
}

AgentSessionSnapshot is an immutable snapshot of the active or most recent Agent panel turn and live permission card.

type AgentSettings struct {
	// BuiltInProvider names the built-in API connection configured in the system keychain (for example "Anthropic API"); never stores an API key.
	BuiltInProvider string `yaml:"builtInProvider,omitempty"`
	// Routes maps task keys ("scene_edits", "playtest_analysis", "problems_fixes", "ask_in_place", "art_and_sound") to preferred model labels.
	Routes map[string]string `yaml:"routes,omitempty"`
	// Tools overrides per-tool MCP enabled state keyed by tool name (for example "game_delete_file": false).
	Tools map[string]bool `yaml:"tools,omitempty"`
	// MCPServers configures other MCP servers the agent may use alongside the editor's own server.
	MCPServers []AgentMCPServer `yaml:"mcpServers,omitempty"`
	// WeeklyRequestLimit sets the weekly agent request budget (0 disables the limit; omitted defaults to 300).
	WeeklyRequestLimit *int `yaml:"weeklyRequestLimit,omitempty"`
	// Privacy controls WHAT MAY LEAVE THIS COMPUTER across every connected agent.
	Privacy *AgentPrivacySettings `yaml:"privacy,omitempty"`
	// Usage stores local usage counters (requests this week, kept review share, and local playtest runs).
	Usage *AgentUsageStats `yaml:"usage,omitempty"`
}

AgentSettings stores per-computer AI agent preferences in editor.yaml (Settings › Agent group). Secrets such as API keys are NEVER stored in this struct or any file; they live exclusively in the OS keychain.

type AgentState string

AgentState describes the agent's live state reflected in the editor header pill (docs/design/editor/Working.dc.html).

const (
	// AgentStateIdle means no agent turn is active and no live step is running.
	AgentStateIdle AgentState = "idle"
	// AgentStateWorking means the agent is actively executing a step or running a tool.
	AgentStateWorking AgentState = "working"
	// AgentStateWaiting means the agent is paused waiting for the person (for example a permission ask).
	AgentStateWaiting AgentState = "waiting"
	// AgentStatePendingReview means the agent finished its current step and pending turn changes await Keep or Revert.
	AgentStatePendingReview AgentState = "pending_review"
)
func (s AgentState) Valid() bool

Valid reports whether s is a recognized AgentState.

type AgentStatus string

AgentStatus is the live connection and work state shown by the Agent panel header's status chip.

const (
	// AgentStatusNotConnected indicates no agent has connected yet.
	AgentStatusNotConnected AgentStatus = "not_connected"
	// AgentStatusConnected indicates an MCP client or built-in API key agent is attached and idle.
	AgentStatusConnected AgentStatus = "connected"
	// AgentStatusWorking indicates the agent is actively executing a request.
	AgentStatusWorking AgentStatus = "working"
	// AgentStatusWaitingForYou indicates a permission ask or clarifying question is open.
	AgentStatusWaitingForYou AgentStatus = "waiting"
	// AgentStatusReconnecting indicates the MCP connection dropped and retries are underway.
	AgentStatusReconnecting AgentStatus = "reconnecting"
	// AgentStatusDisconnected indicates all reconnect retries failed.
	AgentStatusDisconnected AgentStatus = "disconnected"
	// AgentStatusLimitReached indicates the weekly request limit set on Usage and privacy has been reached and requests queue until reset or until the person raises it.
	AgentStatusLimitReached AgentStatus = "limit_reached"
	// AgentStatusOffline indicates there is no network connection and requests wait in a queue.
	AgentStatusOffline AgentStatus = "offline"
)
type AgentStep struct {
	ID          string
	Title       string
	Detail      string
	ToolName    string
	Objects     []string
	Status      AgentStepStatus
	CanAllowNow bool

	PermissionKey string
	RuleSummary   string
	RuleIndex     int
	UncheckedNote string
	StartedAt     time.Time
	// contains filtered or unexported fields
}

AgentStep is a single visible step in an agent turn's progress list.

type AgentStepStatus string

AgentStepStatus is the lifecycle state of one step streamed in an AgentTurn.

const (
	// AgentStepPlaceholder is the gray placeholder step shown immediately upon starting a request (within 300 ms) before the first real step arrives.
	AgentStepPlaceholder AgentStepStatus = "placeholder"
	AgentStepPending     AgentStepStatus = "pending"
	AgentStepRunning     AgentStepStatus = "running"
	AgentStepDone        AgentStepStatus = "done"
	AgentStepWaiting     AgentStepStatus = "waiting"
	AgentStepWarning     AgentStepStatus = "warning"
	AgentStepInterrupted AgentStepStatus = "interrupted"
	// AgentStepDenied is a step the user denied, shown with "You denied … · continued without it" and an explicit Allow now action.
	AgentStepDenied AgentStepStatus = "denied"
	// AgentStepBlocked is a step stopped by a Deny permission rule without prompting.
	AgentStepBlocked AgentStepStatus = "blocked"
	// AgentStepStopped is the terminal row added when the user stops the agent with Stop or Mod+.
	AgentStepStopped AgentStepStatus = "stopped"
	AgentStepFailed  AgentStepStatus = "failed"
)
type AgentStoppedState struct {
	AtStep         int
	TotalSteps     int
	Resumed        bool
	ResumedAtTitle string
}

AgentStoppedState holds the summary of a user-stopped turn and whether Resume has picked it up.

func (s AgentStoppedState) EffectiveTitle() string

EffectiveTitle returns the Stopped card heading.

type AgentStuckResolution string

AgentStuckResolution tracks whether a paused Stuck card is waiting, continued with a hint, or stopped.

const (
	AgentStuckWaiting   AgentStuckResolution = ""
	AgentStuckContinued AgentStuckResolution = "continued"
	AgentStuckStopped   AgentStuckResolution = "stopped"
)
type AgentStuckState struct {
	ToolName       string
	Failures       []AgentFailedCall
	HintDraft      string
	SubmittedHint  string
	Resolution     AgentStuckResolution
	NothingChanged bool
}

AgentStuckState holds the state when the same tool fails three times in a row and pauses the request.

type AgentTask struct {
	ID                  string        `yaml:"id" json:"id"`
	Number              int           `yaml:"number,omitempty" json:"number,omitempty"`
	Title               string        `yaml:"title" json:"title"`
	Prompt              string        `yaml:"prompt,omitempty" json:"prompt,omitempty"`
	Source              TaskSource    `yaml:"source" json:"source"`
	PlanStep            int           `yaml:"planStep,omitempty" json:"planStep,omitempty"`
	PlanTotal           int           `yaml:"planTotal,omitempty" json:"planTotal,omitempty"`
	StartMode           TaskStartMode `yaml:"startMode" json:"startMode"`
	State               TaskState     `yaml:"state" json:"state"`
	ScenePath           string        `yaml:"scene,omitempty" json:"scene,omitempty"`
	StepSummary         string        `yaml:"stepSummary,omitempty" json:"stepSummary,omitempty"`
	StepIndex           int           `yaml:"stepIndex,omitempty" json:"stepIndex,omitempty"`
	StepTotal           int           `yaml:"stepTotal,omitempty" json:"stepTotal,omitempty"`
	Steps               []TaskStep    `yaml:"steps,omitempty" json:"steps,omitempty"`
	PermissionPrompt    string        `yaml:"permissionPrompt,omitempty" json:"permissionPrompt,omitempty"`
	PermissionDetail    string        `yaml:"permissionDetail,omitempty" json:"permissionDetail,omitempty"`
	Error               string        `yaml:"error,omitempty" json:"error,omitempty"`
	BlockedOn           string        `yaml:"blockedOn,omitempty" json:"blockedOn,omitempty"`
	BlockedByTaskID     string        `yaml:"blockedByTaskId,omitempty" json:"blockedByTaskId,omitempty"`
	BlockedByTaskNumber int           `yaml:"blockedByTaskNumber,omitempty" json:"blockedByTaskNumber,omitempty"`
	EditingObjects      []string      `yaml:"editingObjects,omitempty" json:"editingObjects,omitempty"`
	HoldingObjects      []string      `yaml:"holdingObjects,omitempty" json:"holdingObjects,omitempty"`
	StartsAfterTaskID   string        `yaml:"startsAfterTaskId,omitempty" json:"startsAfterTaskId,omitempty"`
	SessionID           string        `yaml:"sessionId,omitempty" json:"sessionId,omitempty"`
	Review              *TaskReview   `yaml:"review,omitempty" json:"review,omitempty"`
	CreatedAt           string        `yaml:"createdAt,omitempty" json:"createdAt,omitempty"`
	StartedAt           string        `yaml:"startedAt,omitempty" json:"startedAt,omitempty"`
	FinishedAt          string        `yaml:"finishedAt,omitempty" json:"finishedAt,omitempty"`
	TimeLabel           string        `yaml:"timeLabel,omitempty" json:"timeLabel,omitempty"`
	ElapsedSeconds      int           `yaml:"elapsedSeconds,omitempty" json:"elapsedSeconds,omitempty"`
	Dismissed           bool          `yaml:"dismissed,omitempty" json:"dismissed,omitempty"`
}

AgentTask is one background task entry kept in the editor's Tasks tab and persisted in thread YAML files.

func (t AgentTask) Holding() bool

Holding reports whether t is running in parallel and currently waiting on an object held by another task.

func (t AgentTask) Visible() bool

Visible reports whether t should appear in one of the five active groups in the Tasks tab.

type AgentTaskCounts struct {
	Waiting       int
	ReadyToReview int
	Failed        int
	Running       int
	Queued        int
}

AgentTaskCounts summarizes active agent tasks by state across both background tasks (#1022) and foreground Agent panel turns.

func (c AgentTaskCounts) BadgeCount() int

BadgeCount returns the Dock badge count: waiting + ready to review + failed. Running and queued tasks never add to the badge.

type AgentTaskKind string

AgentTaskKind identifies one row of the WHO DOES WHAT routing table on Settings › Models and connections. Its string values match AgentTaskRoutesDefs keys persisted in EditorSettings (editor.yaml).

const (
	// AgentTaskSceneEdit routes general scene and data edit requests.
	AgentTaskSceneEdit AgentTaskKind = "scene_edits"
	// AgentTaskPlaytest routes playtest replay and heatmap analysis requests.
	AgentTaskPlaytest AgentTaskKind = "playtest_analysis"
	// AgentTaskProblems routes Problems panel explanation and fix proposals.
	AgentTaskProblems AgentTaskKind = "problems_fixes"
	// AgentTaskAskInPlace routes quick in-place (⌘L) requests.
	AgentTaskAskInPlace AgentTaskKind = "ask_in_place"
	// AgentTaskArtSound routes sprite, texture, and sound generation requests.
	AgentTaskArtSound AgentTaskKind = "art_and_sound"
)
func (k AgentTaskKind) Label() string

Label returns the human-readable task title shown in model error cards and errors.

func (k AgentTaskKind) Valid() bool

Valid reports whether k is a recognized WHO DOES WHAT task kind.

type AgentTaskNotification struct {
	ID              string
	TaskID          string
	State           TaskState
	Header          string
	Title           string
	Body            string
	PrimaryAction   string
	SecondaryAction string
	ScenePath       string
}

AgentTaskNotification is the structured payload built for one of the three allowed system notifications (waiting for permission, ready to review, or failed).

func (n AgentTaskNotification) CoreNotification() core.Notification

CoreNotification converts n into the NSGo core.Notification passed to cx.ShowNotification.

type AgentTaskRouteDef struct {
	Key          string
	LabelKey     string
	NoteKey      string
	DefaultModel string
	CostHintKey  string
}

AgentTaskRouteDef describes one task row under "WHO DOES WHAT" in Settings › Models and connections.

func AgentTaskRoutesDefs() []AgentTaskRouteDef

AgentTaskRoutesDefs returns the canonical ordered task routing rows from Settings.dc.html.

type AgentThread struct {
	// Version is the schema version; it must equal AgentThreadFileVersion (1).
	Version int `yaml:"version" schema:"required"`
	// ID is the stable filename-safe identifier for this thread (stored as .nsgo/threads/<id>.yaml).
	ID string `yaml:"id" schema:"required"`
	// Title is the thread's display name, automatically set from its first request.
	Title string `yaml:"title,omitempty"`
	// ScenePath is the slash-separated project-relative scene path this thread belongs to, or empty for Project · no scene.
	ScenePath string `yaml:"scenePath,omitempty"`
	// SessionID is the external agent's session identifier so follow-up requests continue the same agent session.
	SessionID string `yaml:"sessionId,omitempty"`
	// CreatedAt is the RFC3339 UTC timestamp when the thread was created.
	CreatedAt string `yaml:"createdAt" schema:"required"`
	// UpdatedAt is the RFC3339 UTC timestamp of the thread's latest activity.
	UpdatedAt string `yaml:"updatedAt" schema:"required"`
	// Requests lists the thread's requests in chronological order (oldest first, latest last).
	Requests []AgentThreadRequest `yaml:"requests,omitempty"`
}

AgentThread is the strict versioned YAML document stored per line of work under .nsgo/threads/<id>.yaml. A file looks like this:

# yaml-language-server: $schema=https://game.nsgo.dev/schemas/agent-thread.v1.json
version: 1
id: door-lever-pulls
title: Door opens after two lever pulls
scenePath: scenes/level_01.scene.yaml
sessionId: sess_claude_01
createdAt: "2026-11-26T13:40:00Z"
updatedAt: "2026-11-26T14:18:00Z"

ParseAgentThreadYAML decodes it strictly and EncodeAgentThreadYAML writes it back in canonical form so loading and saving a thread file changes nothing.

func LoadAgentThreadFile(filePath string) (*AgentThread, error)

LoadAgentThreadFile reads and strictly parses an agent thread YAML file at filePath.

func ParseAgentThreadYAML(data []byte) (*AgentThread, error)

ParseAgentThreadYAML strictly decodes and validates a versioned agent thread YAML document, refusing unknown fields, duplicate keys, YAML anchors/aliases/merge keys, trailing YAML documents, and unsupported versions.

func (t *AgentThread) Clone() *AgentThread

Clone returns a deep copy of t.

type AgentThreadDoc struct {
	Version int         `yaml:"version"`
	ID      string      `yaml:"id"`
	Title   string      `yaml:"title,omitempty"`
	Scene   string      `yaml:"scene,omitempty"`
	Tasks   []AgentTask `yaml:"tasks,omitempty"`
}

AgentThreadDoc is the plain-text YAML format persisted under .nsgo/threads/<id>.thread.yaml.

func ParseAgentThread(data []byte) (*AgentThreadDoc, error)

ParseAgentThread decodes a *.thread.yaml document, refusing unknown fields, duplicate keys, YAML aliases/merge keys, and invalid versions or enum values.

type AgentThreadGroup struct {
	ScenePath string
	Heading   string
	OpenScene bool
	Project   bool
	Threads   []AgentThreadListItem
}

AgentThreadGroup is one scene (or Project · no scene) section in the thread switcher.

type AgentThreadListItem struct {
	ID        string
	Title     string
	ScenePath string
	SessionID string
	Meta      string
	Current   bool
	UpdatedAt string
}

AgentThreadListItem is one selectable row inside an AgentThreadGroup in the thread switcher.

type AgentThreadOutcome string

AgentThreadOutcome records how a thread request's proposed changes were resolved.

const (
	// AgentThreadOutcomePending marks an in-progress or awaiting-review request.
	AgentThreadOutcomePending AgentThreadOutcome = "pending"
	// AgentThreadOutcomeKept marks a reviewed request whose changes (all or some) were kept.
	AgentThreadOutcomeKept AgentThreadOutcome = "kept"
	// AgentThreadOutcomeReverted marks a reviewed request whose changes were reverted.
	AgentThreadOutcomeReverted AgentThreadOutcome = "reverted"
)
func (o AgentThreadOutcome) Valid() bool

Valid reports whether o is a recognized AgentThreadOutcome value.

type AgentThreadRequest struct {
	// ID uniquely identifies this request within its thread.
	ID string `yaml:"id" schema:"required"`
	// Title is the short single-line summary shown when the request is folded or referenced in the Inspector footer.
	Title string `yaml:"title,omitempty"`
	// Prompt is the full request text sent to the agent.
	Prompt string `yaml:"prompt" schema:"required"`
	// CreatedAt is the RFC3339 UTC timestamp when the request was sent.
	CreatedAt string `yaml:"createdAt" schema:"required"`
	// UpdatedAt is the RFC3339 UTC timestamp when the request last changed state.
	UpdatedAt string `yaml:"updatedAt,omitempty"`
	// Reply is the agent's short completion message shown under the steps.
	Reply string `yaml:"reply,omitempty"`
	// Outcome records whether the request is "pending", "kept", or "reverted".
	Outcome AgentThreadOutcome `yaml:"outcome" schema:"required,enum=pending|kept|reverted"`
	// ChangesTotal is the total number of proposed changes in this request.
	ChangesTotal int `yaml:"changesTotal,omitempty"`
	// ChangesKept is the number of proposed changes kept during review (0..ChangesTotal).
	ChangesKept int `yaml:"changesKept,omitempty"`
	// Files lists project-relative slash paths of files changed by this request.
	Files []string `yaml:"files,omitempty"`
	// Objects lists scene object IDs changed by this request (used for Inspector footer attribution).
	Objects []string `yaml:"objects,omitempty"`
	// Detail is a compact human-readable summary of changed fields/assets shown when expanded.
	Detail string `yaml:"detail,omitempty"`
	// HistoryStep names the undo step label in History linked to this request.
	HistoryStep string `yaml:"historyStep,omitempty"`
	// HistoryIndex records the 1-based undo stack index in History linked to this request, when known.
	HistoryIndex int `yaml:"historyIndex,omitempty"`
	// Steps lists the recorded agent steps for this request in execution order.
	Steps []AgentThreadStep `yaml:"steps,omitempty"`
}

AgentThreadRequest is one author request and its streamed steps, changed objects/files, and review outcome.

type AgentThreadStep struct {
	// ID uniquely identifies this step within its request.
	ID string `yaml:"id" schema:"required"`
	// Label is the short human-readable description shown in the thread and History.
	Label string `yaml:"label" schema:"required"`
	// Status is the step's state ("pending", "running", "done", or "failed").
	Status AgentThreadStepStatus `yaml:"status" schema:"required,enum=pending|running|done|failed"`
	// Detail holds optional extra context for the step (for example changed fields or files).
	Detail string `yaml:"detail,omitempty"`
	// HistoryStep names the corresponding editor History label, when this step edited the scene.
	HistoryStep string `yaml:"historyStep,omitempty"`
	// HistoryIndex records the 1-based History stack index created by this step, when known.
	HistoryIndex int `yaml:"historyIndex,omitempty"`
	// Objects lists the IDs of scene objects modified by this step.
	Objects []string `yaml:"objects,omitempty"`
	// Files lists project-relative slash paths of files touched by this step.
	Files []string `yaml:"files,omitempty"`
}

AgentThreadStep is one recorded action taken by the agent while handling a request.

type AgentThreadStepStatus string

AgentThreadStepStatus records the execution state of one step inside an agent request.

const (
	// AgentThreadStepPending marks a queued step that has not started yet.
	AgentThreadStepPending AgentThreadStepStatus = "pending"
	// AgentThreadStepRunning marks a step currently executing.
	AgentThreadStepRunning AgentThreadStepStatus = "running"
	// AgentThreadStepDone marks a completed step.
	AgentThreadStepDone AgentThreadStepStatus = "done"
	// AgentThreadStepFailed marks a step that failed.
	AgentThreadStepFailed AgentThreadStepStatus = "failed"
)
func (s AgentThreadStepStatus) Valid() bool

Valid reports whether s is a recognized AgentThreadStepStatus value.

type AgentThreadTurn struct {
	ID        string
	Prompt    string
	Reply     string
	Chips     []string
	Tokens    int
	Timestamp time.Time
	Outcome   string // e.g. "kept", "reverted", "sent"
}

AgentThreadTurn records one request/response turn in the active agent thread.

type AgentTileAutotileRequest struct {
	Layer       string
	TileLayer   string
	Terrain     string
	Cells       []TileCoord
	Rects       []TileRect
	Place       *bool
	Label       string
	TrackReview bool
}

AgentTileAutotileRequest re-edges or places a terrain set on a tile layer using YAML tileset autotile rules.

type AgentTileCell struct {
	Col      int
	Row      int
	TileID   int
	TileName string
	Flip     uint32
}

AgentTileCell specifies one cell to paint in AgentTilePaintRequest.

type AgentTileEditResult struct {
	Layer        string `json:"layer"`
	TileLayer    string `json:"tileLayer,omitempty"`
	ChangedCells int    `json:"changedCells"`
	UndoLabel    string `json:"undo,omitempty"`
	ReviewOpen   bool   `json:"reviewOpen"`
	RegionCount  int    `json:"regionCount,omitempty"`
	KeptRegions  int    `json:"keptRegions,omitempty"`
	ReviewCells  int    `json:"reviewCells,omitempty"`
}

AgentTileEditResult reports the outcome of an agent tile edit or review commit.

type AgentTileEraseRequest struct {
	Layer       string
	TileLayer   string
	Cells       []TileCoord
	Rects       []TileRect
	Label       string
	TrackReview bool
}

AgentTileEraseRequest clears explicit cells or rectangles on a tile layer.

type AgentTilePaintRequest struct {
	Layer                string
	TileLayer            string
	TileID               int
	TileName             string
	Flip                 uint32
	Weighted             []AgentTileWeighted
	Seed                 uint64
	NoAdjacentDuplicates bool
	Cells                []AgentTileCell
	Rects                []AgentTileRect
	Label                string
	TrackReview          bool
}

AgentTilePaintRequest paints explicit cells, rectangles, or weighted random picks on a tile layer.

type AgentTileRect struct {
	Col0     int
	Row0     int
	Col1     int
	Row1     int
	TileID   int
	TileName string
	Flip     uint32
}

AgentTileRect specifies an inclusive rectangle to paint in AgentTilePaintRequest.

type AgentTileWeighted struct {
	TileID   int
	TileName string
	Weight   float64
}

AgentTileWeighted specifies one weighted tile entry for deterministic random picks in AgentTilePaintRequest.

type AgentTokenUsage struct {
	Limit         int
	Conversation  int
	OpenScene     int
	Attached      int
	Always        int
	ToolsAndInstr int
	ViewportImage int
}

AgentTokenUsage reports token usage across the 6 context breakdown categories shown in Threads.dc.html.

func (u AgentTokenUsage) Total() int

Total returns the sum of used tokens across all categories.

type AgentToolCallRecord struct {
	ClientName  string
	ToolName    string
	StepTitle   string
	CallSummary string
	ErrorText   string
	IsError     bool
	File        string
}

AgentToolCallRecord carries structured metadata from an MCP tool execution into the Agent panel.

type AgentToolCallResult struct {
	Text    string
	PNG     []byte
	IsError bool
}

AgentToolCallResult holds the text, optional PNG, and error flag returned by executing one editor MCP tool.

type AgentToolExecutor interface {
	ListTools(ctx context.Context) ([]AgentToolSpec, error)
	CallTool(ctx context.Context, name string, args json.RawMessage) (AgentToolCallResult, error)
}

AgentToolExecutor lists and invokes the editor's MCP tools for the built-in agent. editormcp.Server wires itself onto Editor.AgentTools automatically in editormcp.New.

type AgentToolInfo struct {
	Name        string
	Title       string
	Description string
	DefaultOff  bool
}

AgentToolInfo describes one tool registered on the editor's MCP server for Settings › Tools.

func DefaultAgentMCPTools() []AgentToolInfo

DefaultAgentMCPTools returns the baseline catalog of editor MCP tools shown in Settings › Tools before a live editormcp.Server publishes its full registered tool list.

func (t AgentToolInfo) ShortDescription() string

ShortDescription returns Title when set, or the first sentence of Description.

type AgentToolSpec struct {
	Name        string          `json:"name"`
	Title       string          `json:"title,omitempty"`
	Description string          `json:"description"`
	InputSchema json.RawMessage `json:"input_schema"`
}

AgentToolSpec describes one editor MCP tool offered to the built-in agent model.

type AgentTurn struct {
	ID              string                `json:"id"`
	Prompt          string                `json:"prompt"`
	Images          []AgentReferenceImage `json:"-"`                  // reference images sent with this turn (one-shot attachments and pinned brief references)
	Source          string                `json:"source,omitempty"`   // "in_place", "panel", "external", or "automation"
	SkipPlan        bool                  `json:"skipPlan,omitempty"` // true for small in-place ⌘L edits per Plan.dc.html
	Status          string                `json:"status,omitempty"`   // "pending", "running", "done", "stopped"
	External        bool                  `json:"external,omitempty"` // true for turns started by a terminal MCP client rather than the composer
	AgentName       string                `json:"agentName,omitempty"`
	Task            AgentTaskKind         `json:"task,omitempty"`
	Route           AgentModelRoute       `json:"route,omitempty"`
	Model           string                `json:"model,omitempty"`
	Steps           []AgentStep           `json:"steps,omitempty"`
	PlannedSteps    []string              `json:"plannedSteps,omitempty"`
	FollowUps       []AgentFollowUp       `json:"followUps,omitempty"`
	NotChecked      []string              `json:"notChecked,omitempty"`
	StoppedBefore   string                `json:"stoppedBefore,omitempty"`
	PendingReview   *AgentPendingReview   `json:"pendingReview,omitempty"`
	Summary         string                `json:"summary,omitempty"`
	Reply           string                `json:"reply,omitempty"`
	Error           string                `json:"error,omitempty"`
	ModelError      *AgentModelErrorState `json:"modelError,omitempty"`
	Stopped         bool                  `json:"stopped,omitempty"`
	Done            bool                  `json:"done,omitempty"`
	Partial         *AgentPartialState    `json:"partial,omitempty"`
	Stuck           *AgentStuckState      `json:"stuck,omitempty"`
	Lost            *AgentLostState       `json:"lost,omitempty"`
	StoppedState    *AgentStoppedState    `json:"stoppedState,omitempty"`
	Mismatch        *AgentMismatchReport  `json:"mismatch,omitempty"`
	Review          *AgentTurnReview      `json:"review,omitempty"`
	InputTokens     int                   `json:"inputTokens,omitempty"`
	OutputTokens    int                   `json:"outputTokens,omitempty"`
	CreatedAt       time.Time             `json:"createdAt"`
	StartedAt       time.Time             `json:"startedAt"`
	FinishedAt      time.Time             `json:"finishedAt"`
	Context         AgentTurnContext      `json:"context"`
	ChangedFiles    []string              `json:"changedFiles,omitempty"`
	ThreadID        string                `json:"threadId,omitempty"`
	SessionIDBefore string                `json:"sessionIdBefore,omitempty"`
	SessionIDAfter  string                `json:"sessionIdAfter,omitempty"`
	Automation      bool                  `json:"automation,omitempty"`     // true for turns started by an automation trigger
	AutomationID    string                `json:"automationId,omitempty"`   // rule ID from automations.yaml when Automation is true
	AutomationName  string                `json:"automationName,omitempty"` // WHEN summary of the triggering automation rule
	TriggerSummary  string                `json:"triggerSummary,omitempty"` // concrete trigger description, e.g. "File changed · scenes/level_01.scene.yaml"
	CheckpointID    string                `json:"checkpointId,omitempty"`   // checkpoint captured before the automation started
	ReviewState     AgentReviewState      `json:"reviewState,omitempty"`    // lifecycle state for Ready to review / Kept / Dismissed / Failed
	Plan            *AgentPlanReview      `json:"plan,omitempty"`
	// contains filtered or unexported fields
}

AgentTurn is one user request (in-place ⌘L, Agent panel composer, terminal-initiated MCP turn, or background automation run) and its attached context, streamed steps, follow-ups, pending review, and reply.

type AgentTurnChange struct {
	// ID uniquely identifies this change within the turn (for example "scenes/level_01.scene.yaml::obj:slime_01").
	ID string `json:"id"`
	// Kind is "added", "changed", or "removed".
	Kind AgentChangeKind `json:"kind"`
	// Title is the short name of the affected object, record, key, or track.
	Title string `json:"title"`
	// Detail is a concise summary of the change (for example "z 10 → 12" or "patrol").
	Detail string `json:"detail,omitempty"`
	// File is the project-relative slash-separated path of the touched file (or open scene label).
	File string `json:"file"`
	// Line is the 1-based line number in the current YAML (or pre-turn YAML for removed items).
	Line int `json:"line,omitempty"`
	// Reason is the agent's optional "why" explanation when supplied on an MCP edit tool.
	Reason string `json:"reason,omitempty"`
	// ObjectID names the scene/prefab object ID when applicable.
	ObjectID string `json:"objectId,omitempty"`
	// Field names the specific object field, component field, property, or key when applicable.
	Field string `json:"field,omitempty"`
	// Layer names the scene layer when applicable.
	Layer string `json:"layer,omitempty"`
	// Reverted reports whether the person reverted this change while the turn is pending.
	Reverted bool `json:"reverted,omitempty"`
}

AgentTurnChange is one derived structural change inside a pending or finished agent turn. Changes are derived from the diff between pre-turn and post-turn state rather than a raw command log.

type AgentTurnContext struct {
	ScenePath      string   `json:"scenePath,omitempty"`
	SceneName      string   `json:"sceneName,omitempty"`
	SceneYAML      string   `json:"sceneYaml,omitempty"`
	SelectionIDs   []string `json:"selectionIds,omitempty"`
	SelectionNames []string `json:"selectionNames,omitempty"`
	Layer          string   `json:"layer,omitempty"`
	ViewportPNG    []byte   `json:"-"`
	ViewportWidth  int      `json:"viewportWidth,omitempty"`
	ViewportHeight int      `json:"viewportHeight,omitempty"`
	ViewMode       string   `json:"viewMode,omitempty"`
}

AgentTurnContext captures the editor context attached to an agent request: the selection (object IDs and names), the open scene (path, name, and YAML), and a rendered viewport PNG.

type AgentTurnFileKind string

AgentTurnFileKind identifies the structured format of a file touched by an agent turn.

const (
	TurnFileScene     AgentTurnFileKind = "scene"
	TurnFilePrefab    AgentTurnFileKind = "prefab"
	TurnFileDataTable AgentTurnFileKind = "datatable"
	TurnFileProject   AgentTurnFileKind = "project"
	TurnFileClip      AgentTurnFileKind = "clip"
	TurnFileOther     AgentTurnFileKind = "other"
)
type AgentTurnFileSummary struct {
	File          string            `json:"file"`
	Kind          AgentTurnFileKind `json:"kind"`
	ChangeCount   int               `json:"changeCount"`
	ActiveCount   int               `json:"activeCount"`
	RevertedCount int               `json:"revertedCount"`
	AddedLines    int               `json:"addedLines"`
	RemovedLines  int               `json:"removedLines"`
}

AgentTurnFileSummary summarizes derived changes for one file touched by an agent turn.

type AgentTurnOptions struct {
	// Title is the concise request title shown in the History panel (for example "slimes and coins").
	Title string
	// Summary optionally overrides the headline (defaults to Title).
	Summary string
	// Detail optionally adds context before the change/kept counts (for example "from the template").
	Detail string
	// ChangeCount is the total number of changes proposed during this turn (0 uses the executed sub-command count).
	ChangeCount int
	// KeptCount is the number of changes kept during this turn (0 defaults to ChangeCount).
	KeptCount int
	// Files lists additional project-relative file paths touched by this turn (outside the active scene).
	Files []string
	// UndoLabel optionally overrides History.UndoLabel() for the grouped undo step.
	UndoLabel string
}

AgentTurnOptions configures metadata for an agent turn recorded on the unified History timeline.

type AgentTurnReview struct {
	TurnID       string
	File         string
	Added        []SceneObjectChange
	Changed      []SceneObjectChange
	Removed      []SceneObjectChange
	PlusLines    int
	MinusLines   int
	HistoryStart int
	HistoryEnd   int
	Kept         bool
	Discarded    bool
}

AgentTurnReview captures the actual scene diff produced during one agent turn. The review, never the agent's prose summary, is what Keep applies.

func (r *AgentTurnReview) Clone() *AgentTurnReview

Clone returns a shallow-slice copy of r safe to inspect outside Editor state.

func (r *AgentTurnReview) Count() int

Count returns the total number of added, changed, and removed scene objects in the review.

type AgentTurnSnapshot struct {
	ID            uint64                 `json:"id"`
	Status        AgentTurnStatus        `json:"status"`
	Prompt        string                 `json:"prompt"`
	Summary       string                 `json:"summary,omitempty"`
	Steps         []AgentTurnStep        `json:"steps,omitempty"`
	Files         []AgentTurnFileSummary `json:"files,omitempty"`
	Changes       []AgentTurnChange      `json:"changes,omitempty"`
	TotalChanges  int                    `json:"totalChanges"`
	ActiveChanges int                    `json:"activeChanges"`
	RevertedCount int                    `json:"revertedCount"`
	AddedLines    int                    `json:"addedLines"`
	RemovedLines  int                    `json:"removedLines"`
	ReviewOpen    bool                   `json:"reviewOpen,omitempty"`
}

AgentTurnSnapshot is a read-only view of the current agent turn for UI and MCP inspection.

func (s AgentTurnSnapshot) IsOpen() bool

IsOpen reports whether the turn is working, pending, or stopped (not yet kept or reverted).

func (s AgentTurnSnapshot) IsPending() bool

IsPending reports whether the turn has finished or stopped and is awaiting Keep or Revert.

type AgentTurnStatus string

AgentTurnStatus describes the lifecycle state of an agent request turn.

const (
	// AgentTurnWorking means the agent is actively making edits in this request.
	AgentTurnWorking AgentTurnStatus = "working"
	// AgentTurnPending means the agent finished the request and edits await Keep or Revert.
	AgentTurnPending AgentTurnStatus = "pending"
	// AgentTurnStopped means the person stopped the agent mid-request; partial edits stay pending and reviewable.
	AgentTurnStopped AgentTurnStatus = "stopped"
	// AgentTurnKept means the person kept the remaining changes as one History undo step.
	AgentTurnKept AgentTurnStatus = "kept"
	// AgentTurnReverted means the person reverted all touched files to their pre-request state.
	AgentTurnReverted AgentTurnStatus = "reverted"
)
type AgentTurnStep struct {
	Label string `json:"label"`
	Done  bool   `json:"done"`
}

AgentTurnStep is one progress line shown in the Agent panel for the turn.

type AgentTurnSummary struct {
	ID           string
	Prompt       string
	Summary      string
	ChangedFiles []string
}

AgentTurnSummary carries a concise summary of a prior turn still in the thread when dispatching the next AgentRequest.

type AgentUsageStats struct {
	// WeekStart is the UTC Monday date (YYYY-MM-DD) for WeeklyRequests, when recorded.
	WeekStart string `yaml:"weekStart,omitempty"`
	// WeeklyRequests is the number of agent requests made during WeekStart's week.
	WeeklyRequests int `yaml:"weeklyRequests,omitempty"`
	// ReviewedChanges is the total number of agent change reviews resolved (kept or reverted).
	ReviewedChanges int `yaml:"reviewedChanges,omitempty"`
	// KeptChanges is the number of reviewed agent changes kept by the person.
	KeptChanges int `yaml:"keptChanges,omitempty"`
	// PlaytestRuns is the number of local headless playtest runs recorded on this computer.
	PlaytestRuns int `yaml:"playtestRuns,omitempty"`
}

AgentUsageStats records per-computer local agent usage metrics persisted in editor.yaml. No prompts, file contents, or secrets are stored here.

func (u AgentUsageStats) KeptPercent() (int, bool)

KeptPercent returns the rounded percentage of reviewed changes kept and whether any review has been resolved.

type Appearance string

Appearance selects the editor's color scheme.

const (
	// AppearanceSystem follows the operating system's light or dark appearance.
	AppearanceSystem Appearance = "system"
	// AppearanceLight forces the light appearance regardless of the system setting.
	AppearanceLight Appearance = "light"
	// AppearanceDark forces the dark appearance regardless of the system setting.
	AppearanceDark Appearance = "dark"
)
func (a Appearance) CoreAppearance() core.Appearance

CoreAppearance converts a to NSGo's core.Appearance for Scope.SetAppearance.

func (a Appearance) Valid() bool

Valid reports whether a is a recognized editor appearance choice.

type AskFrozenFrameRequest struct {
	Frame        int                   `json:"frame"`
	Seconds      float64               `json:"seconds"`
	Scene        string                `json:"scene,omitempty"`
	Prompt       string                `json:"prompt"`
	FramePNG     []byte                `json:"-"`
	FrameWidth   int                   `json:"frameWidth"`
	FrameHeight  int                   `json:"frameHeight"`
	ReplayPath   string                `json:"replayPath,omitempty"`
	ReplayAbs    string                `json:"replayAbs,omitempty"`
	ReplayFrames int                   `json:"replayFrames"`
	SelectedID   string                `json:"selectedId,omitempty"`
	LiveEntities []PlayLiveEntityState `json:"liveEntities,omitempty"`
	LiveChanges  []RemoteLiveChange    `json:"liveChanges,omitempty"`
	CreatedAt    time.Time             `json:"createdAt"`
}

AskFrozenFrameRequest carries everything attached when the author asks the agent about a frozen Play frame (⌘L).

type AskInPlacePlacement struct {
	Left               float32
	Top                float32
	Width              float32
	Height             float32
	AnchorX            float32
	AnchorY            float32
	SelectionBounds    [4]float32 // minX, minY, maxX, maxY in viewport points
	HasSelectionBounds bool
}

AskInPlacePlacement holds the computed viewport-local coordinates of the anchored ⌘L composer card and the selection bounds it anchors to, clamped to stay on screen and clear of the right panel.

func ComputeAskInPlacePlacement(vw, vh float32, selBounds [4]float32, hasSel bool, cardW, cardH float32) AskInPlacePlacement

ComputeAskInPlacePlacement anchors a cardW x cardH composer card to selBounds inside a vw x vh viewport, flipping above the selection if there is not enough room below, and clamping strictly inside [margin, vw-margin] x [margin, vh-margin] so it stays on screen and never overlaps the right panel.

type AskInPlaceSnapshot struct {
	Open               bool
	Draft              string
	TargetIDs          []string
	TargetNames        []string
	SceneLabel         string
	ChipSummary        string
	ChipAnnouncement   string
	InputLabel         string
	Placeholder        string
	Suggestions        []AskInPlaceSuggestion
	SelectedSuggestion int
	Placement          AskInPlacePlacement
}

AskInPlaceSnapshot is a read-only view of the in-place ⌘L composer state for UI and tests.

type AskInPlaceSuggestion struct {
	ID     string
	Label  string
	Prompt string
}

AskInPlaceSuggestion is one contextual suggestion chip shown under the ⌘L in-place composer.

type AssetClipPreview struct {
	Name    string
	FrameMS int
	Frames  []AssetEntry
}

AssetClipPreview describes one playable frame sequence for a sprite asset in the right panel.

type AssetDragState struct {
	Active           bool
	HoveringViewport bool
	Drag             AssetDrawerDrag
	CanvasX, CanvasY float32
	LayerX, LayerY   float32
	SnapPx           float32
	TargetObjectID   string
	TargetObjectName string
	PillName         string
	PillDetail       string
}

AssetDragState describes an active sprite drag from the asset drawer over the 2D viewport.

type AssetDrawerCounts struct {
	Unused    int
	Missing   int
	Generated int
	Proposed  int
}

AssetDrawerCounts summarizes the SHOW ONLY counts across the full asset catalog.

type AssetDrawerDrag struct {
	Path  string
	Name  string
	Atlas string
	Frame string
	Image core.ImageSource
	Rect  sprite.Frame
}

AssetDrawerDrag is the drag payload carried from an asset card to the 2D viewport.

type AssetDrawerItem struct {
	Path          string
	Name          string
	Folder        string
	Kind          AssetDrawerKind
	KindLabel     string
	Meta          string
	Dims          string
	Badge         string
	Unused        bool
	Missing       bool
	Generated     bool
	Proposed      bool
	ModTime       time.Time
	Atlas         string
	Frame         string
	Image         core.ImageSource
	Rect          sprite.Frame
	ImageWidth    int
	ImageHeight   int
	Clips         []AssetClipPreview
	AudioWave     []float32
	AudioDuration time.Duration
	AudioRate     int
	AudioChannels int
	FontSample    string
	UsedBy        []AssetRefEntry
	UseCount      int
}

AssetDrawerItem describes one asset card in the drawer and its right-panel metadata.

type AssetDrawerKind string

AssetDrawerKind selects the kind tab in the asset drawer header.

const (
	AssetKindAll     AssetDrawerKind = "all"
	AssetKindSprites AssetDrawerKind = "sprites"
	AssetKindTiles   AssetDrawerKind = "tiles"
	AssetKindAudio   AssetDrawerKind = "audio"
	AssetKindFonts   AssetDrawerKind = "fonts"
)
type AssetDrawerSnapshot struct {
	AllItems      []AssetDrawerItem
	VisibleItems  []AssetDrawerItem
	Folders       []AssetFolderEntry
	Counts        AssetDrawerCounts
	MissingNames  []string
	Selected      *AssetDrawerItem
	EmptyFolder   string
	ActiveFolder  string
	ActiveStatus  AssetStatusFilter
	ActiveKind    AssetDrawerKind
	Query         string
	Sort          AssetSortMode
	ProposedCount int
}

AssetDrawerSnapshot is the immutable view model rendered by the Assets left rail, drawer, and right panel.

type AssetEntry struct {
	Atlas string
	Frame string
	Image core.ImageSource
	Rect  sprite.Frame
}

AssetEntry describes one selectable/droppable frame from a registered sprite.Atlas.

func (a AssetEntry) Key() string

Key uniquely identifies the asset entry as "atlas/frame".

type AssetFolderEntry struct {
	Path  string // "" for "All assets"
	Label string
	Depth int
	Count int
}

AssetFolderEntry describes one folder row in the Assets left rail's FOLDERS list.

type AssetGenerationRequest struct {
	ID                  string
	TargetPath          string
	Kind                AssetGeneratorKind
	Generator           string
	Model               string
	Prompt              string
	UserPrompt          string
	References          []string
	ReferenceAsset      string
	RefWidth            int
	RefHeight           int
	RefPixels           *image.RGBA
	RefImage            core.ImageSource
	RefLoudDB           *float64
	RefSoundName        string
	Count               int
	Elapsed             time.Duration
	License             string
	CommercialUse       bool
	Status              AssetGenerationStatus
	UsageCount          int
	PickedCandidateID   string
	SelectedCandidateID string
	Candidates          []GeneratedCandidate
	LastNote            string
}

AssetGenerationRequest holds one image or sound generation request and its in-memory candidates.

type AssetGenerationStatus string

AssetGenerationStatus classifies the lifecycle state of a generated asset entry in the GENERATED rail.

const (
	AssetGenPending        AssetGenerationStatus = "pending"
	AssetGenPicked         AssetGenerationStatus = "picked"
	AssetGenInUse          AssetGenerationStatus = "in_use"
	AssetGenLicenseUnknown AssetGenerationStatus = "license_unknown"
)
type AssetGeneratorKind string

AssetGeneratorKind classifies the media type an MCP generator server produces.

const (
	// AssetGenImages produces image candidates (PNG/JPEG/GIF decoded strictly to pixels in memory).
	AssetGenImages AssetGeneratorKind = "images"
	// AssetGenSound produces audio candidates (WAV/OGG decoded strictly in memory).
	AssetGenSound AssetGeneratorKind = "sound"
)
func (k AssetGeneratorKind) Valid() bool

Valid reports whether k is a supported asset generator kind.

type AssetGeneratorServer struct {
	Config    GeneratorServerConfig
	Connected bool
	ToolName  string
	Error     string
}

AssetGeneratorServer describes the live status of a configured or connected MCP generator server.

type AssetImportInfo struct {
	// Path is the clean slash-separated asset path relative to the project root.
	Path string
	// SidecarPath is the slash-separated path of the asset's *.import.yaml sidecar.
	SidecarPath string
	// Kind is the asset's import kind (image, audio, font, or model).
	Kind AssetImportKind
	// SidecarExists reports whether SidecarPath currently exists on disk.
	SidecarExists bool
	// Sidecar holds the parsed *.import.yaml sidecar overrides, or nil when absent or unparseable.
	Sidecar *importsettings.File
	// SidecarErr holds any read or parse error from an existing sidecar on disk.
	SidecarErr error

	// Matched targets from game.yaml's assets section (nil when no target reads this asset).
	AtlasTarget   *project.AtlasTarget
	TextureTarget *project.TextureTarget
	AudioTarget   *project.AudioTarget
	FontTarget    *project.FontTarget
	ModelTarget   *project.ModelTarget

	// Inherited defaults resolved from the matched target in game.yaml (or the tool's defaults).
	DefaultImageFilter  string
	DefaultImageFormat  string
	DefaultImageMipmaps bool
	DefaultImageSRGB    bool
	// ImageWidth and ImageHeight are the decoded source pixel dimensions when Kind is AssetImportImage (0 if unreadable).
	ImageWidth  int
	ImageHeight int

	DefaultAudioFormat   string
	DefaultAudioRate     int
	DefaultAudioChannels int
	DefaultAudioBitrate  int
	DefaultAudioPeakDB   *float64
	DefaultAudioRMSDB    *float64

	DefaultFontSize    int
	DefaultFontChars   string
	DefaultFontPadding int

	DefaultModelScale      float64
	DefaultModelAnimations bool
}

AssetImportInfo describes the current import settings, sidecar state, and inherited game.yaml target defaults for one asset in the open project.

func (info AssetImportInfo) EffectiveAudioBitrate() (int, bool)

EffectiveAudioBitrate returns the effective bitrate in kbps and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveAudioChannels() (int, bool)

EffectiveAudioChannels returns the effective channel count (0 keeps source, 1 mono, 2 stereo) and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveAudioFormat() (string, bool)

EffectiveAudioFormat returns the effective audio format and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveAudioLoop() (*importsettings.Loop, bool)

EffectiveAudioLoop returns a copy of the sidecar's loop region (nil when unset) and whether it is set.

func (info AssetImportInfo) EffectiveAudioNormalization() (mode string, db float64, overridden bool)

EffectiveAudioNormalization returns the active normalization mode ("none", "peakDB", or "rmsDB"), its dBFS level, and whether the sidecar overrides normalization.

func (info AssetImportInfo) EffectiveAudioRate() (int, bool)

EffectiveAudioRate returns the effective sample rate in Hz (0 keeps source) and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveCellImagePivot(cell int) (pt importsettings.PivotPoint, overridden bool, inherited bool)

EffectiveCellImagePivot returns the effective normalized pivot for 0-based cell, whether the cell has its own per-cell override in pivot.cells, and whether it inherits pivot.default.

func (info AssetImportInfo) EffectiveCredit() *importsettings.Credit

EffectiveCredit returns a copy of the sidecar's credit section, or nil when unset.

func (info AssetImportInfo) EffectiveDefaultImagePivot() (importsettings.PivotPoint, bool)

EffectiveDefaultImagePivot returns the effective default normalized pivot ([0, 0] when unset) and whether the sidecar explicitly sets it.

func (info AssetImportInfo) EffectiveFontChars() (string, bool)

EffectiveFontChars returns the effective character set and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveFontPadding() (int, bool)

EffectiveFontPadding returns the effective glyph padding in pixels and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveFontSize() (int, bool)

EffectiveFontSize returns the effective font pixel size and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveImageFilter() (string, bool)

EffectiveImageFilter returns the effective sampling filter and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveImageFormat() (string, bool)

EffectiveImageFormat returns the effective KTX2 texture format and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveImageMipmaps() (bool, bool)

EffectiveImageMipmaps returns whether mipmaps are enabled and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveImagePivot() (*importsettings.Pivot, bool)

EffectiveImagePivot returns a deep copy of the sidecar's pivot settings (nil when unset) and whether it is set.

func (info AssetImportInfo) EffectiveImageSRGB() (bool, bool)

EffectiveImageSRGB returns whether sRGB is enabled and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveImageSlice() (*importsettings.Slice, bool)

EffectiveImageSlice returns a copy of the sidecar's sprite-sheet slice grid (nil when unsliced) and whether it is set.

func (info AssetImportInfo) EffectiveModelAnimations() (bool, bool)

EffectiveModelAnimations returns whether animations are kept and whether the sidecar overrides it.

func (info AssetImportInfo) EffectiveModelLODHysteresis() (float32, bool)

EffectiveModelLODHysteresis returns the model LOD hysteresis deadband [0, 0.5] and whether the sidecar sets it.

func (info AssetImportInfo) EffectiveModelLODs() ([]importsettings.ModelLOD, bool)

EffectiveModelLODs returns a copy of the sidecar's declared model LOD levels and whether any are set.

func (info AssetImportInfo) EffectiveModelScale() (float64, bool)

EffectiveModelScale returns the effective model scale multiplier and whether the sidecar overrides it.

func (info AssetImportInfo) TargetSummary() string

TargetSummary returns a short human-readable summary of the game.yaml target(s) reading this asset.

type AssetImportKind string

AssetImportKind identifies which importsettings section applies to an asset file.

const (
	// AssetImportNone indicates that a file is not an importable asset (for example a scene, YAML file, directory, or sidecar).
	AssetImportNone AssetImportKind = ""
	// AssetImportImage identifies an image asset (.png, .jpg, .jpeg, .webp).
	AssetImportImage AssetImportKind = "image"
	// AssetImportAudio identifies a sound asset (.wav, .ogg, .mp3, .flac).
	AssetImportAudio AssetImportKind = "audio"
	// AssetImportFont identifies a font asset (.ttf, .otf).
	AssetImportFont AssetImportKind = "font"
	// AssetImportModel identifies a 3D model asset (.gltf, .glb).
	AssetImportModel AssetImportKind = "model"
)
func AssetImportKindFor(relPath string) AssetImportKind

AssetImportKindFor classifies a project-relative file path by its extension, returning AssetImportNone for sidecars and non-asset files.

type AssetPreviewBackground struct {
	ID      string
	Label   string
	Color   core.Color
	Checker bool
}

AssetPreviewBackground defines one selectable preview backdrop for image candidates (such as a level floor or checkerboard).

type AssetRefEntry struct {
	File string
	What string
	Line int
	Ref  refs.Ref
}

AssetRefEntry summarizes one incoming reference to an asset in the right panel's USED BY list.

type AssetReloader interface {
	ReloadAssets(root string, changed []string) error
}

AssetReloader may optionally be implemented by a sceneformat.AssetResolver to reload built atlases and textures after BuildAssets or ReimportAsset writes new outputs.

type AssetSortMode int

AssetSortMode selects how cards in the asset drawer are sorted.

const (
	// AssetSortRecent sorts by file modification time descending, breaking ties by path.
	AssetSortRecent AssetSortMode = iota
	// AssetSortName sorts alphabetically by display name, then path.
	AssetSortName
)
type AssetStatusFilter string

AssetStatusFilter selects an optional SHOW ONLY filter in the Assets left rail.

const (
	AssetFilterNone      AssetStatusFilter = ""
	AssetFilterUnused    AssetStatusFilter = "unused"
	AssetFilterMissing   AssetStatusFilter = "missing"
	AssetFilterGenerated AssetStatusFilter = "generated"
	AssetFilterProposed  AssetStatusFilter = "proposed"
)
type AssetStyleBrief struct {
	// Summary is the short style description shown in the inspector's STYLE AGAINST THE BRIEF section.
	Summary string
	// PixelGrid is the base pixel art grid size in pixels (for example 16); 0 disables grid checks.
	PixelGrid int
	// MaxColors is the maximum shading color count allowed before outline colors (for example 4); 0 disables palette checks.
	MaxColors int
	// OutlineColors is the number of extra outline colors allowed alongside MaxColors (default 1).
	OutlineColors int
	// MinContrast is the minimum WCAG luminance contrast ratio against the preview background (default 3.0).
	MinContrast float64
	// TargetLoudDB is the target RMS loudness in dBFS for generated sound effects (default -14.0).
	TargetLoudDB float64
	// MaxPeakDB is the maximum allowed peak amplitude in dBFS for generated sounds (default -0.5).
	MaxPeakDB float64
	// LoudnessTolDB is the allowed loudness deviation from TargetLoudDB or reference sound in dB (default 3.0).
	LoudnessTolDB float64
	// Backgrounds are the selectable preview backdrops shown in PREVIEW ON.
	Backgrounds []AssetPreviewBackground
}

AssetStyleBrief holds the art and audio rules read from brief.yaml (or defaults) used to check generated candidates.

func DefaultAssetStyleBrief() AssetStyleBrief

DefaultAssetStyleBrief returns default art and audio brief checks matching a 16 px pixel-art game.

type AssetStyleCheck struct {
	Pass    bool
	Title   string
	Summary string
	Detail  string
}

AssetStyleCheck is one pass/fail style verification result shown on a candidate card and inspector.

type AssetsBuildOptions struct {
	// Force passes -force to `game assets`, rebuilding every target even when the cache says it is up to date.
	Force bool
}

AssetsBuildOptions configures one `go tool game assets` run started by BuildAssetsWith.

type AssetsBuildSpec struct {
	// Dir is the open project's root directory where the command executes.
	Dir string
	// Name is the executable to run ("go").
	Name string
	// Args are the command arguments (for example ["tool", "game", "assets"]).
	Args []string
	// Asset is the project-relative path being reimported when launched by ReimportAsset, or empty for BuildAssets.
	Asset string
	// Force reports whether -force was requested.
	Force bool
}

AssetsBuildSpec describes one `go tool game assets` command executed by BuildAssets or ReimportAsset.

type AtlasLister interface {
	AtlasNames() []string
}

AtlasLister may optionally be implemented by a sceneformat.AssetResolver to advertise available atlas names to the Asset Browser, as project.Resolver does. sceneformat.AtlasMap is supported automatically.

type AudioChangeInfo struct {
	SizeBytes  int64         `json:"sizeBytes"`
	Format     string        `json:"format"`
	SampleRate int           `json:"sampleRate,omitempty"`
	Channels   int           `json:"channels,omitempty"`
	Duration   time.Duration `json:"duration,omitempty"`
	Waveform   []float32     `json:"waveform,omitempty"`
	UsedBy     []string      `json:"usedBy,omitempty"`
}

AudioChangeInfo holds audition metadata, waveform bars, and incoming project references for a changed audio file.

type AudioEffectKind string

AudioEffectKind identifies one DSP effect type supported by project.Effect in game.yaml.

const (
	AudioEffectLowPass  AudioEffectKind = "lowPass"
	AudioEffectHighPass AudioEffectKind = "highPass"
	AudioEffectDelay    AudioEffectKind = "delay"
	AudioEffectReverb   AudioEffectKind = "reverb"
	AudioEffectGain     AudioEffectKind = "gain"
	AudioEffectBitcrush AudioEffectKind = "bitcrush"
)
func AudioEffectKindOf(fx project.Effect) AudioEffectKind

AudioEffectKindOf returns the AudioEffectKind configured on fx, or empty when none or more than one is set.

func (k AudioEffectKind) Label() string

Label returns a human-readable display name for kind.

type AutomationCheckpoint struct {
	ID           string
	AutomationID string
	Trigger      string
	Label        string
	CreatedAt    time.Time
	Dir          string
	Files        map[string][]byte
}

AutomationCheckpoint records a pre-run snapshot captured before an automation task starts. When a project directory exists, snapshots are also written under .nsgo/checkpoints/<ID>/ (ignored by git).

type AutomationDraft struct {
	Words string
	Rule  AutomationRule
	YAML  string
}

AutomationDraft holds a candidate AutomationRule drafted from natural language ("+ New automation, in words") waiting for the author to keep or discard.

type AutomationFileKind string

AutomationFileKind classifies a newly added project file for file_added triggers.

const (
	AutomationFileKindPrefab    AutomationFileKind = "prefab"
	AutomationFileKindScene     AutomationFileKind = "scene"
	AutomationFileKindTileset   AutomationFileKind = "tileset"
	AutomationFileKindCutscene  AutomationFileKind = "cutscene"
	AutomationFileKindMaterial  AutomationFileKind = "material"
	AutomationFileKindParticles AutomationFileKind = "particles"
	AutomationFileKindRig       AutomationFileKind = "rig"
	AutomationFileKindScreen    AutomationFileKind = "screen"
	AutomationFileKindDataTable AutomationFileKind = "datatable"
	AutomationFileKindScript    AutomationFileKind = "script"
	AutomationFileKindAsset     AutomationFileKind = "asset"
	AutomationFileKindAny       AutomationFileKind = "any"
)
func ClassifyAutomationFileKind(relPath string) AutomationFileKind

ClassifyAutomationFileKind infers the AutomationFileKind of a project-relative slash-separated file path.

func (k AutomationFileKind) Valid() bool

Valid reports whether k is a recognized file kind for file_added triggers.

type AutomationRule struct {
	// ID uniquely identifies the automation inside automations.yaml (lowercase letters, digits, hyphens, or underscores).
	ID string `yaml:"id" schema:"required"`
	// Name is the short human-readable WHEN summary shown in Settings › Automations. When omitted, the editor derives one from Trigger.
	Name string `yaml:"name,omitempty"`
	// Enabled controls whether the automation is active.
	Enabled bool `yaml:"enabled"`
	// Trigger defines the event that starts the automation.
	Trigger AutomationTrigger `yaml:"trigger" schema:"required"`
	// Instruction is the work the agent performs when Trigger fires; its result always lands in Ready to review.
	Instruction string `yaml:"instruction" schema:"required"`
}

AutomationRule defines one WHEN -> THE AGENT automation entry in automations.yaml.

func (r AutomationRule) DisplayName() string

DisplayName returns the human-readable WHEN summary for r, deriving one from r.Trigger when Name is empty.

type AutomationTrigger struct {
	// Event selects the trigger event ("file_changed", "review_kept", "file_added", "before_export", or "daily").
	Event AutomationTriggerKind `yaml:"event" schema:"required,enum=file_changed|review_kept|file_added|before_export|daily"`
	// Glob matches slash-separated project-relative file paths using *, **, and ?. Required for file_changed and optional for review_kept and file_added.
	Glob string `yaml:"glob,omitempty"`
	// Kind selects the kind of added file for file_added triggers ("prefab", "scene", "tileset", "cutscene", "material", "particles", "rig", "screen", "datatable", "script", "asset", or "any").
	Kind AutomationFileKind `yaml:"kind,omitempty" schema:"enum=prefab|scene|tileset|cutscene|material|particles|rig|screen|datatable|script|asset|any"`
	// Platform optionally restricts before_export triggers to a target platform such as "ios", "android", "web", "macos", "windows", or "linux".
	Platform string `yaml:"platform,omitempty"`
	// Time is the 24-hour local clock time ("HH:MM") when a daily trigger runs while the editor is open.
	Time string `yaml:"time,omitempty"`
}

AutomationTrigger describes when an automation starts.

func (t AutomationTrigger) Summary() string

Summary returns a concise human-readable WHEN description for t.

type AutomationTriggerKind string

AutomationTriggerKind selects the event that starts an automation.

const (
	// AutomationTriggerFileChanged fires when a project file matching Trigger.Glob is saved or changes on disk.
	AutomationTriggerFileChanged AutomationTriggerKind = "file_changed"
	// AutomationTriggerReviewKept fires when the author keeps an edit review (optionally filtered by Trigger.Glob).
	AutomationTriggerReviewKept AutomationTriggerKind = "review_kept"
	// AutomationTriggerFileAdded fires when a new project file of Trigger.Kind is created or appears on disk.
	AutomationTriggerFileAdded AutomationTriggerKind = "file_added"
	// AutomationTriggerBeforeExport fires before an export or release build starts (optionally filtered by Trigger.Platform).
	AutomationTriggerBeforeExport AutomationTriggerKind = "before_export"
	// AutomationTriggerDaily fires once per calendar day at or after Trigger.Time ("HH:MM") while the editor is open.
	AutomationTriggerDaily AutomationTriggerKind = "daily"
)
func (k AutomationTriggerKind) Valid() bool

Valid reports whether k is a recognized automation trigger kind.

type AutomationsFile struct {
	// Version is the schema version; it must equal AutomationsVersion (1).
	Version int `yaml:"version" schema:"required"`
	// Automations lists the project's configured automations in display order.
	Automations []AutomationRule `yaml:"automations,omitempty"`
}

AutomationsFile holds a project's shared agent automations in versioned YAML (automations.yaml beside game.yaml). A file looks like this:

# yaml-language-server: $schema=https://game.nsgo.dev/schemas/automations.v1.json
version: 1
automations:
  - id: level-check
    name: A level file changes
    enabled: true
    trigger:
      event: file_changed
      glob: scenes/level_*.scene.yaml
    instruction: runs game check and 5 playtests, reports only problems

ParseAutomations decodes it strictly and EncodeAutomations writes it back in canonical form, so a file EncodeAutomations wrote survives a load and save byte for byte.

func DefaultAutomations() *AutomationsFile

DefaultAutomations returns the five starter automations shown in docs/design/editor/Settings.dc.html.

func LoadAutomationsFile(filePath string) (*AutomationsFile, error)

LoadAutomationsFile reads and parses automations.yaml at path. When the file does not exist, it returns (nil, fs.ErrNotExist) so callers can decide whether to fall back to defaults.

func ParseAutomations(data []byte) (*AutomationsFile, error)

ParseAutomations decodes and validates a versioned YAML automations document. Unknown fields, trailing YAML documents, YAML anchors/aliases/merge keys, duplicate keys, missing or unsupported versions, duplicate IDs, and invalid trigger configurations are refused.

Errors are *loaderr.Error values carrying the line, column, field path, and fix; a caller that read data from a file names it with loaderr.WithFile.

type BlockedPermissionStep struct {
	ID         string               `json:"id"`
	Summary    string               `json:"summary"`
	Command    string               `json:"command,omitempty"`
	Evaluation PermissionEvaluation `json:"evaluation"`
}

BlockedPermissionStep records an MCP tool call stopped by a Deny rule so the editor can show the blocked step and link directly to its rule in Settings › Permissions.

type BriefPinDiffLine struct {
	Sign    string
	Text    string
	Added   bool
	Removed bool
}

BriefPinDiffLine is one formatted line in the Pin to brief confirmation card's YAML diff.

type BriefPinNotice struct {
	ImageID string
	Name    string
	RelPath string
	Note    string
	Diff    []BriefPinDiffLine
}

BriefPinNotice describes the most recent Pin to brief action shown in the composer confirmation card with Undo.

type BriefReference struct {
	// Path is the project-relative slash path to the reference image (for example "art/reference/spikes_ref.png").
	Path string
	// Note is an optional short description for the agent.
	Note string
}

BriefReference is one entry listed under art.references in brief.yaml.

type BuildArtifactResult struct {
	ArtifactPath         string             `json:"artifactPath"`
	ArtifactName         string             `json:"artifactName"`
	SizeBytes            int64              `json:"sizeBytes"`
	DeltaBytes           int64              `json:"deltaBytes"`
	HasLastRelease       bool               `json:"hasLastRelease"`
	Breakdown            BuildSizeBreakdown `json:"breakdown"`
	FrameTimeP95Ms       float64            `json:"frameTimeP95Ms"`
	DownloadBudgetMet    bool               `json:"downloadBudgetMet"`
	FrameTimeBudgetMet   bool               `json:"frameTimeBudgetMet"`
	SmokePlaytestWhere   string             `json:"smokePlaytestWhere,omitempty"`
	SmokePlaytestSummary string             `json:"smokePlaytestSummary,omitempty"`
	TestURL              string             `json:"testUrl,omitempty"`
	WebBuildDir          string             `json:"webBuildDir,omitempty"`
}

BuildArtifactResult holds the finished artifact path, size delta against the last release, category breakdown, budget outcomes, smoke playtest summary, and optional local test URL.

type BuildDeviceEntry struct {
	ID         string           `json:"id"`
	Name       string           `json:"name"`
	Kind       string           `json:"kind,omitempty"`
	Serial     string           `json:"serial,omitempty"`
	State      BuildDeviceState `json:"state,omitempty"`
	Note       string           `json:"note"`
	Available  bool             `json:"available"`
	Actionable bool             `json:"actionable"`
}

BuildDeviceEntry describes one selectable run-on-device target on the finished build view.

type BuildDeviceState string

BuildDeviceState reports the live readiness or execution state of a RUN ON DEVICE target.

const (
	BuildDeviceReady        BuildDeviceState = "ready"
	BuildDeviceServing      BuildDeviceState = "serving"
	BuildDeviceConnected    BuildDeviceState = "connected"
	BuildDeviceStopped      BuildDeviceState = "stopped"
	BuildDeviceInstalling   BuildDeviceState = "installing"
	BuildDeviceRunning      BuildDeviceState = "running"
	BuildDeviceDisconnected BuildDeviceState = "disconnected"
	BuildDeviceUnavailable  BuildDeviceState = "unavailable"
	BuildDeviceFailed       BuildDeviceState = "failed"
)
type BuildDiffLine struct {
	LineNumber int    `json:"lineNumber,omitempty"`
	Kind       string `json:"kind"` // "context", "remove", "add"
	Text       string `json:"text"`
}

BuildDiffLine is one line in an agent-proposed preset fix diff.

type BuildFailureInfo struct {
	Headline    string                  `json:"headline"`
	StepID      BuildStepID             `json:"stepId"`
	StepIndex   int                     `json:"stepIndex"`
	TotalSteps  int                     `json:"totalSteps"`
	StepLabel   string                  `json:"stepLabel"`
	Elapsed     time.Duration           `json:"elapsed"`
	Commands    []string                `json:"commands"`
	ErrorLine   string                  `json:"errorLine"`
	ExitLine    string                  `json:"exitLine"`
	Notice      string                  `json:"notice"`
	FixProposal *BuildPresetFixProposal `json:"fixProposal,omitempty"`
}

BuildFailureInfo captures structured details of a failed preset step.

type BuildPreflightSummary struct {
	CheckRan             bool          `json:"checkRan"`
	CheckProblems        int           `json:"checkProblems"`
	CheckElapsed         time.Duration `json:"checkElapsed"`
	CheckErr             string        `json:"checkErr,omitempty"`
	SmokeSummary         string        `json:"smokeSummary"`
	QualityProfile       string        `json:"qualityProfile"`
	DownloadSizeBudgetMB float64       `json:"downloadSizeBudgetMB"`
	FrameTimeP95BudgetMs float64       `json:"frameTimeP95BudgetMs"`
	BudgetsFromProject   bool          `json:"budgetsFromProject"`
}

BuildPreflightSummary holds the BEFORE EVERY BUILD cards: nsgo check, smoke playtest, and budgets from game.yaml.

type BuildPresetEntry struct {
	Platform     string                   `json:"platform"`
	Name         string                   `json:"name"`
	IconKind     string                   `json:"iconKind"` // "desktop", "web", "phone"
	File         string                   `json:"file"`
	Summary      string                   `json:"summary"`
	Targets      []string                 `json:"targets,omitempty"`
	Included     bool                     `json:"included"`
	Status       BuildPresetStatus        `json:"status"`
	StatusText   string                   `json:"statusText"`
	SizeText     string                   `json:"sizeText"`
	DeltaText    string                   `json:"deltaText"`
	Steps        []BuildStep              `json:"steps"`
	LogFile      string                   `json:"logFile"`
	LogLines     []string                 `json:"logLines"`
	PlanCommands []string                 `json:"planCommands"`
	Signing      BuildPresetSigningConfig `json:"signing"`
	Failure      *BuildFailureInfo        `json:"failure,omitempty"`
	Result       *BuildArtifactResult     `json:"result,omitempty"`
	Readiness    []BuildReadinessItem     `json:"readiness,omitempty"`
	NextStepIdx  int                      `json:"nextStepIdx"`
	StoppedAt    bool                     `json:"stoppedAt,omitempty"`
}

BuildPresetEntry holds the live state of one platform preset in the Build and Release screen.

type BuildPresetFixProposal struct {
	Platform     string                    `json:"platform"`
	Title        string                    `json:"title"`
	Summary      string                    `json:"summary"`
	FilePath     string                    `json:"filePath"`
	Footnote     string                    `json:"footnote,omitempty"`
	Diff         []BuildDiffLine           `json:"diff"`
	TargetPatch  []string                  `json:"targetPatch,omitempty"`
	SigningPatch *BuildPresetSigningConfig `json:"signingPatch,omitempty"`
	Apply        func(ed *Editor) error    `json:"-"`
}

BuildPresetFixProposal describes an agent-proposed fix diff shown when a preset build fails.

type BuildPresetSigningConfig struct {
	Keystore string `yaml:"keystore,omitempty" json:"keystore,omitempty"`
	Alias    string `yaml:"alias,omitempty" json:"alias,omitempty"`
	Identity string `yaml:"identity,omitempty" json:"identity,omitempty"`
	Notarize bool   `yaml:"notarize,omitempty" json:"notarize,omitempty"`
}

BuildPresetSigningConfig holds per-preset signing settings loaded from export/<platform>.export.yaml or configured in memory.

type BuildPresetStatus string

BuildPresetStatus reports the current lifecycle state of one platform preset on the Build and Release screen.

const (
	BuildPresetQueued     BuildPresetStatus = "queued"
	BuildPresetBuilding   BuildPresetStatus = "building"
	BuildPresetNotarizing BuildPresetStatus = "notarizing"
	BuildPresetDone       BuildPresetStatus = "done"
	BuildPresetFailed     BuildPresetStatus = "failed"
	BuildPresetSetup      BuildPresetStatus = "setup"
)
type BuildReadinessItem struct {
	ID             string               `json:"id"`
	Label          string               `json:"label"`
	Detail         string               `json:"detail"`
	Status         BuildReadinessStatus `json:"status"`
	ActionLabel    string               `json:"actionLabel,omitempty"`
	AgentCanHandle bool                 `json:"agentCanHandle,omitempty"`
	RequiresPerson bool                 `json:"requiresPerson,omitempty"`
}

BuildReadinessItem describes one readiness check for a platform that may require setup before building.

type BuildReadinessStatus string

BuildReadinessStatus indicates whether a platform readiness requirement passes, warns, or blocks building.

const (
	BuildReadinessOK   BuildReadinessStatus = "ok"
	BuildReadinessWarn BuildReadinessStatus = "warn"
	BuildReadinessFail BuildReadinessStatus = "fail"
)
type BuildReleaseOptions struct {
	DryRun       bool
	Channel      string
	ReleaseNotes string
}

BuildReleaseOptions configures one StartReleaseBuild invocation.

type BuildReleaseSnapshot struct {
	Open                   bool                        `json:"open"`
	ProjectName            string                      `json:"projectName"`
	Version                string                      `json:"version"`
	GitCommit              string                      `json:"gitCommit"`
	GitBranch              string                      `json:"gitBranch"`
	LastReleaseVersion     string                      `json:"lastReleaseVersion"`
	CommitsSinceRelease    int                         `json:"commitsSinceRelease"`
	ReleaseNotes           string                      `json:"releaseNotes"`
	ReleaseNotesFile       string                      `json:"releaseNotesFile"`
	ReleaseNotesProvenance string                      `json:"releaseNotesProvenance"`
	ReleaseNotesSinceRef   string                      `json:"releaseNotesSinceRef"`
	PermissionProfile      AgentPermissionProfile      `json:"permissionProfile"`
	UploadReview           ReleaseUploadReviewSnapshot `json:"uploadReview"`
	Preflight              BuildPreflightSummary       `json:"preflight"`
	Presets                []BuildPresetEntry          `json:"presets"`
	SelectedPlatform       string                      `json:"selectedPlatform"`
	ActivePlatform         string                      `json:"activePlatform"`
	SelectedDeviceID       string                      `json:"selectedDeviceId"`
	Devices                []BuildDeviceEntry          `json:"devices"`
	WebServer              WebBuildServerSnapshot      `json:"webServer"`
	Running                bool                        `json:"running"`
	Stopped                bool                        `json:"stopped"`
	DryRun                 bool                        `json:"dryRun"`
	FollowLog              bool                        `json:"followLog"`
	ShowWholeLog           bool                        `json:"showWholeLog"`
	EditingPreset          bool                        `json:"editingPreset"`
	PlanCommandLine        string                      `json:"planCommandLine"`
	DryRunOutput           string                      `json:"dryRunOutput"`
	LastErr                string                      `json:"lastErr,omitempty"`
}

BuildReleaseSnapshot is a thread-safe value copy of the Build and Release screen state.

func (s BuildReleaseSnapshot) SelectedPreset() *BuildPresetEntry

SelectedPreset returns the currently selected preset from the snapshot, or nil if no presets exist.

type BuildSizeBreakdown struct {
	CodeBytes     int64  `yaml:"codeBytes" json:"codeBytes"`
	TexturesBytes int64  `yaml:"texturesBytes" json:"texturesBytes"`
	AudioBytes    int64  `yaml:"audioBytes" json:"audioBytes"`
	OtherBytes    int64  `yaml:"otherBytes" json:"otherBytes"`
	GrowthSummary string `yaml:"growthSummary,omitempty" json:"growthSummary,omitempty"`
}

BuildSizeBreakdown splits a finished release artifact into code, textures, audio, and other bytes.

type BuildSmokePlaytestResult struct {
	Where          string        `json:"where,omitempty"`
	Summary        string        `json:"summary"`
	Duration       time.Duration `json:"duration"`
	FrameTimeP95Ms float64       `json:"frameTimeP95Ms,omitempty"`
}

BuildSmokePlaytestResult summarizes the per-build smoke playtest step.

type BuildStep struct {
	ID       BuildStepID     `json:"id"`
	Label    string          `json:"label"`
	Detail   string          `json:"detail"`
	Status   BuildStepStatus `json:"status"`
	Elapsed  time.Duration   `json:"elapsed"`
	Commands []string        `json:"commands,omitempty"`
	Err      string          `json:"err,omitempty"`
}

BuildStep represents one ordered step in a preset's build pipeline.

type BuildStepID string

BuildStepID identifies each ordered step executed for a release preset build.

const (
	BuildStepCheck         BuildStepID = "check"
	BuildStepCompile       BuildStepID = "compile"
	BuildStepPack          BuildStepID = "pack"
	BuildStepSign          BuildStepID = "sign"
	BuildStepSmokePlaytest BuildStepID = "smoke_playtest"
	BuildStepMeasure       BuildStepID = "measure"
)
type BuildStepStatus string

BuildStepStatus reports the state of one step within a preset build.

const (
	BuildStepPending BuildStepStatus = "pending"
	BuildStepRunning BuildStepStatus = "running"
	BuildStepDone    BuildStepStatus = "done"
	BuildStepFailed  BuildStepStatus = "failed"
)

type CLIAgentRunner

Uniquement sur linux, macos, windowsSource
type CLIAgentRunner struct {
	// ClaudeBinary overrides the "claude" executable path (defaults to PATH lookup).
	ClaudeBinary string
	// CodexBinary overrides the "codex" executable path (defaults to PATH lookup).
	CodexBinary string
}

CLIAgentRunner runs an external agent CLI (Claude Code or Codex) non-interactively per composer request with streamed JSON output and the project's MCP config.

func (*CLIAgentRunner) Run

Uniquement sur linux, macos, windowsSource
func (r *CLIAgentRunner) Run(ctx context.Context, req AgentRequest, emit func(AgentEvent)) error

Run executes req against Claude Code (`claude --print --output-format=stream-json --verbose`) or Codex (`codex exec --json`), streaming parsed AgentEvents to emit.

type ChangedFile struct {
	Path        string            `json:"path"`
	OldPath     string            `json:"oldPath,omitempty"`
	ProjectPath string            `json:"projectPath,omitempty"`
	DisplayName string            `json:"displayName"`
	Category    ChangesCategory   `json:"category"`
	Status      ChangesFileStatus `json:"status"`
	StatusCode  string            `json:"statusCode"`
	Included    bool              `json:"included"`
	Binary      bool              `json:"binary,omitempty"`
	Detail      string            `json:"detail,omitempty"`
	PlusLines   int               `json:"plusLines,omitempty"`
	MinusLines  int               `json:"minusLines,omitempty"`
	Diff        []DiffLine        `json:"diff,omitempty"`
	Scene       *SceneComparison  `json:"scene,omitempty"`
	Audio       *AudioChangeInfo  `json:"audio,omitempty"`
}

ChangedFile represents one modified, added, deleted, renamed, or untracked file compared with HEAD.

type ChangesCategory string

ChangesCategory groups changed working-tree files in the Changes panel.

const (
	ChangesCategoryScenes ChangesCategory = "SCENES"
	ChangesCategoryData   ChangesCategory = "DATA"
	ChangesCategoryCode   ChangesCategory = "CODE"
	ChangesCategoryAssets ChangesCategory = "ASSETS"
)
type ChangesCheckStatus struct {
	Ran          bool      `json:"ran"`
	RanAt        time.Time `json:"ranAt,omitempty"`
	CheckPassed  bool      `json:"checkPassed"`
	CheckSummary string    `json:"checkSummary,omitempty"`
	CheckOutput  string    `json:"checkOutput,omitempty"`
	TestPassed   bool      `json:"testPassed"`
	TestCount    int       `json:"testCount,omitempty"`
	TestSummary  string    `json:"testSummary,omitempty"`
	TestOutput   string    `json:"testOutput,omitempty"`
}

ChangesCheckStatus records the latest nsgo check and nsgo test outcomes shown in the Changes panel.

type ChangesFileStatus string

ChangesFileStatus describes a file's Git working-tree state compared with HEAD.

const (
	ChangesStatusModified  ChangesFileStatus = "modified"
	ChangesStatusAdded     ChangesFileStatus = "added"
	ChangesStatusDeleted   ChangesFileStatus = "deleted"
	ChangesStatusUntracked ChangesFileStatus = "untracked"
	ChangesStatusRenamed   ChangesFileStatus = "renamed"
)
type ChangesSceneViewMode string

ChangesSceneViewMode controls whether a changed scene renders HEAD and Now side by side, HEAD only, or Now only.

const (
	ChangesSceneViewSideBySide ChangesSceneViewMode = "side-by-side"
	ChangesSceneViewHead       ChangesSceneViewMode = "head"
	ChangesSceneViewNow        ChangesSceneViewMode = "now"
)
type ChangesSession struct {
	RepoDir       string
	ProjectDir    string
	ProjectPrefix string
	ProjectName   string
	SceneName     string

	Branch     string
	Branches   []string
	HeadSHA    string
	HasHead    bool
	Upstream   string
	BaseBranch string
	Ahead      int
	Behind     int

	Files        []ChangedFile
	SelectedPath string
	SceneView    ChangesSceneViewMode
	Checks       ChangesCheckStatus

	DraftSummary      string
	DraftDescription  string
	DraftProvenance   string
	DraftAttribution  string
	ReviewCount       int
	PlaytestSummary   string
	AgentRequestCount int

	Committed  bool
	LastCommit *CommitMilestone
	Milestones []CommitMilestone

	GHAvailable       bool
	LastPRDescription string
	LastPRURL         string
	LastErr           string
	LastNotice        string
	// contains filtered or unexported fields
}

ChangesSession holds the live state of the Changes & Commit screen.

func (s *ChangesSession) IncludedSummary() (included, total, plus, minus int)

IncludedSummary returns the included file count, total file count, included added lines, and included deleted lines.

func (s *ChangesSession) SelectedChangedFile() *ChangedFile

SelectedChangedFile returns a pointer to the currently selected ChangedFile in the active session, or nil.

type CheckpointFile struct {
	// Path is the slash-separated path from the project root (for example "scenes/level_01.scene.yaml").
	Path string `yaml:"path"`
	// Existed reports whether the file existed before the turn wrote it; false means restoring deletes the file.
	Existed bool `yaml:"existed"`
	// Size is the saved file size in bytes when Existed is true.
	Size int64 `yaml:"size,omitempty"`
	// SHA256 is the lowercase hex SHA-256 digest of the saved bytes when Existed is true.
	SHA256 string `yaml:"sha256,omitempty"`
	// Mode is the optional 4-digit octal Unix file mode (for example "0755") when non-default.
	Mode string `yaml:"mode,omitempty"`
}

CheckpointFile records one project file captured before its first write in a checkpoint.

type CheckpointKind string

CheckpointKind identifies why a persistent checkpoint was created.

const (
	// CheckpointKindTurn marks a checkpoint created for an agent turn's edits.
	CheckpointKindTurn CheckpointKind = "turn"
	// CheckpointKindTask marks a checkpoint taken before an autonomous background task starts.
	CheckpointKindTask CheckpointKind = "task"
	// CheckpointKindAutomation marks a checkpoint taken before an automation run starts.
	CheckpointKindAutomation CheckpointKind = "automation"
)
type CheckpointManifest struct {
	// Version is the schema version; it must equal CheckpointVersion (1).
	Version int `yaml:"version"`
	// ID is the unique checkpoint directory name (for example "20261126T144100Z-0001").
	ID string `yaml:"id"`
	// CreatedAt is the RFC3339 UTC timestamp when the checkpoint was started.
	CreatedAt string `yaml:"createdAt"`
	// Who identifies who initiated the checkpoint ("agent", "you", or "git").
	Who HistoryAuthor `yaml:"who"`
	// Kind identifies why the checkpoint was taken ("turn", "task", or "automation").
	Kind CheckpointKind `yaml:"kind"`
	// Title is the short human-readable summary shown in the History panel.
	Title string `yaml:"title"`
	// Detail is optional secondary context (such as change counts or trigger details).
	Detail string `yaml:"detail,omitempty"`
	// Files lists every project file captured before its first write in this checkpoint, sorted by path.
	Files []CheckpointFile `yaml:"files,omitempty"`
}

CheckpointManifest is the strict versioned YAML manifest stored at .nsgo/checkpoints/<id>/manifest.yaml.

func ParseCheckpointManifest(data []byte) (*CheckpointManifest, error)

ParseCheckpointManifest strictly decodes and validates a versioned checkpoint manifest YAML document, refusing empty documents, duplicate keys, unknown fields, trailing documents, and unsupported versions.

type CheckpointOptions struct {
	// Who defaults to HistoryAuthorAgent when empty.
	Who HistoryAuthor
	// Kind defaults to CheckpointKindTurn when empty.
	Kind CheckpointKind
	// Title is shown in the History panel; defaults to a descriptive label when empty.
	Title string
	// Detail is optional secondary context shown alongside the title.
	Detail string
	// PreCaptureFiles lists project-relative paths to snapshot immediately before work starts.
	PreCaptureFiles []string
}

CheckpointOptions configures a new turn, task, or automation checkpoint.

type CheckpointSummary struct {
	CheckpointManifest
	// TotalBytes is the total size on disk of the checkpoint directory (manifest plus saved files).
	TotalBytes int64
}

CheckpointSummary pairs a loaded CheckpointManifest with its total on-disk footprint in bytes.

type CodePreviewLine struct {
	LineNumber int    `json:"lineNumber,omitempty"`
	Sign       string `json:"sign,omitempty"` // "", "-", "+"
	Kind       string `json:"kind,omitempty"` // "", "hit", "del", "add", "warn", "gap", "note"
	Text       string `json:"text"`
	Focused    bool   `json:"focused,omitempty"`
}

CodePreviewLine is one rendered line in the right-hand code or diff preview pane.

type CodeReviewCheckPhase string

CodeReviewCheckPhase tracks the lifecycle of nsgo check and nsgo test for pending Go files.

const (
	CodeReviewChecksIdle    CodeReviewCheckPhase = "idle"
	CodeReviewChecksRunning CodeReviewCheckPhase = "running"
	CodeReviewChecksFixing  CodeReviewCheckPhase = "fixing"
	CodeReviewChecksPassed  CodeReviewCheckPhase = "passed"
	CodeReviewChecksFailed  CodeReviewCheckPhase = "failed"
)
type CodeReviewCheckProgress struct {
	Completed   int    `json:"completed"`
	Total       int    `json:"total"`
	CurrentTest string `json:"currentTest,omitempty"`
}

CodeReviewCheckProgress reports live test execution progress while nsgo test runs.

type CodeReviewCheckRequest struct {
	ProjectDir    string
	Packages      []string
	PendingGo     map[string]PendingGoOverlayFile
	OverlayPath   string
	PreviousTotal int
}

CodeReviewCheckRequest supplies the pending Go overlay and target packages to Editor.CodeReviewCheckRunner.

type CodeReviewCheckResult struct {
	Phase          CodeReviewCheckPhase    `json:"phase"`
	CheckPassed    bool                    `json:"checkPassed"`
	CheckOutput    string                  `json:"checkOutput,omitempty"`
	CheckError     string                  `json:"checkError,omitempty"`
	TestPassed     bool                    `json:"testPassed"`
	PassedCount    int                     `json:"passedCount"`
	FailedCount    int                     `json:"failedCount"`
	TotalCount     int                     `json:"totalCount"`
	Duration       time.Duration           `json:"duration"`
	Packages       []string                `json:"packages,omitempty"`
	TestOutput     string                  `json:"testOutput,omitempty"`
	Failures       []CodeReviewTestFailure `json:"failures,omitempty"`
	Completed      int                     `json:"completed"`
	ExpectedTotal  int                     `json:"expectedTotal"`
	AgentEditBadge string                  `json:"agentEditBadge,omitempty"`
	Generation     uint64                  `json:"generation"`
}

CodeReviewCheckResult records the latest nsgo check and nsgo test outcomes against the pending Go overlay.

func (r CodeReviewCheckResult) AllPassed(editGen uint64) bool

AllPassed reports whether both nsgo check and nsgo test passed for editGen.

func (r CodeReviewCheckResult) PrimaryFailure() *CodeReviewTestFailure

PrimaryFailure returns the first failing test, or nil when none failed.

type CodeReviewCheckRun struct {
	// contains filtered or unexported fields
}

CodeReviewCheckRun captures a snapshot of a pending Go code review so callers (such as editormcp) can execute nsgo check and nsgo test off the editor's UI goroutine and apply the result back on it.

type CodeReviewDiffLayout string

CodeReviewDiffLayout selects how Go diffs are displayed in CodeReviewView.

const (
	// CodeReviewDiffUnified shows old and new lines in a single stream with two line-number columns.
	CodeReviewDiffUnified CodeReviewDiffLayout = "unified"
	// CodeReviewDiffSplit shows old and new lines side by side.
	CodeReviewDiffSplit CodeReviewDiffLayout = "split"
)
type CodeReviewDiffLine struct {
	OldLine int               `json:"oldLine,omitempty"`
	NewLine int               `json:"newLine,omitempty"`
	Sign    string            `json:"sign,omitempty"`
	Text    string            `json:"text"`
	Kind    DiffLineKind      `json:"kind"`
	Tag     CodeReviewLineTag `json:"tag,omitempty"`
}

CodeReviewDiffLine is one line in a unified diff computed between Original and Pending.

type CodeReviewFile struct {
	Path          string               `json:"path"`
	Kind          CodeReviewFileKind   `json:"kind"`
	Original      string               `json:"-"`
	Existed       bool                 `json:"existed"`
	PreviousRound string               `json:"-"`
	Pending       string               `json:"-"`
	Delete        bool                 `json:"delete,omitempty"`
	Note          string               `json:"note,omitempty"`
	AddedLines    int                  `json:"addedLines"`
	RemovedLines  int                  `json:"removedLines"`
	Confirmed     bool                 `json:"confirmed"`
	Applied       bool                 `json:"applied"`
	EditedInRound int                  `json:"editedInRound"`
	Diff          []CodeReviewDiffLine `json:"diff,omitempty"`
}

CodeReviewFile holds one pending file proposed during an agent turn. Until confirmed (for Go files) and kept, Pending is held strictly in memory so disk and Play keep the old code.

func (f *CodeReviewFile) BaseName() string

BaseName returns the file's base name (for example "patrol.go").

type CodeReviewFileKind string

CodeReviewFileKind separates Keep-included data/YAML files from per-file confirmed Go files.

const (
	// CodeReviewFileYAML is a scene, prefab, data table, or other text file included in Keep.
	CodeReviewFileYAML CodeReviewFileKind = "yaml"
	// CodeReviewFileGo is a Go source or test file that requires passing checks and per-file confirmation.
	CodeReviewFileGo CodeReviewFileKind = "go"
)
type CodeReviewFixRequest struct {
	TurnID     string
	Round      int
	Prompt     string
	Failure    *CodeReviewTestFailure
	CheckError string
	Files      []string
}

CodeReviewFixRequest is delivered to Editor.OnAskCodeReviewFix when the author clicks "Ask the agent to fix".

type CodeReviewLineTag string

CodeReviewLineTag annotates notable diff lines (failing line, agent edit, round 2).

const (
	CodeReviewTagNone        CodeReviewLineTag = ""
	CodeReviewTagFailsTest   CodeReviewLineTag = "fails test"
	CodeReviewTagFailedHere  CodeReviewLineTag = "failed here"
	CodeReviewTagAgentEdited CodeReviewLineTag = "agent edited"
	CodeReviewTagRound2      CodeReviewLineTag = "round 2"
)
type CodeReviewProposeRequest struct {
	TurnID             string
	Prompt             string
	Round              int
	RoundSummary       string
	FailureExplanation string
	SuspectFile        string
	SuspectLine        int
	PlayImpact         string
	Files              []CodeReviewProposedFile
	Open               bool
	// PreserveTurn keeps the existing review's TurnID and advances Round when updating an active review.
	PreserveTurn bool
}

CodeReviewProposeRequest stages or updates pending Go (and optional companion YAML) files for review.

type CodeReviewProposedFile struct {
	Path    string `json:"path"`
	Content string `json:"content"`
	Delete  bool   `json:"delete,omitempty"`
	Note    string `json:"note,omitempty"`
}

CodeReviewProposedFile is one file staged into the Go code review via ProposeCodeReviewFiles or MCP.

type CodeReviewSession struct {
	TurnID             string
	Prompt             string
	Round              int
	RoundSummary       string
	PlayImpact         string
	FailureExplanation string
	FailureSuspectFile string
	FailureSuspectLine int
	Files              []*CodeReviewFile
	SelectedPath       string
	Layout             CodeReviewDiffLayout
	Checks             CodeReviewCheckResult
	EditGen            uint64
	Open               bool
	Paused             bool
	KeptYAML           bool
	FixRequested       bool
	LastErr            string
	LastKeepSummary    string
	LastRevertSummary  string
}

CodeReviewSession holds the live state of reviewing an agent turn's Go and companion YAML changes.

func (s *CodeReviewSession) ConfirmedGoFiles() []*CodeReviewFile

ConfirmedGoFiles returns Go files confirmed by the author and ready to write on Keep.

func (s *CodeReviewSession) FindFile(relPath string) *CodeReviewFile

FindFile returns the file matching relPath, or nil.

func (s *CodeReviewSession) GoFiles() []*CodeReviewFile

GoFiles returns all Go files in the review that have not yet been applied to disk.

func (s *CodeReviewSession) SelectedFile() *CodeReviewFile

SelectedFile returns the currently focused file in the review, falling back to the first Go or YAML file.

func (s *CodeReviewSession) WaitingGoFiles() []*CodeReviewFile

WaitingGoFiles returns Go files that are neither confirmed nor applied.

func (s *CodeReviewSession) YAMLFiles() []*CodeReviewFile

YAMLFiles returns the pending/unapplied YAML/prefab/data files included in Keep.

type CodeReviewSplitRow struct {
	OldLine   int
	LeftText  string
	LeftKind  DiffLineKind
	NewLine   int
	RightText string
	RightKind DiffLineKind
	RightTag  CodeReviewLineTag
}

CodeReviewSplitRow pairs one left (old) slot and one right (new) slot for Split diff layout.

func BuildCodeReviewSplitRows(lines []CodeReviewDiffLine) []CodeReviewSplitRow

BuildCodeReviewSplitRows transforms unified diff lines into side-by-side Split rows matching ReviewCode.dc.html.

type CodeReviewTestFailure struct {
	Package     string `json:"package,omitempty"`
	TestName    string `json:"testName"`
	File        string `json:"file,omitempty"`
	Line        int    `json:"line,omitempty"`
	Message     string `json:"message"`
	Explanation string `json:"explanation,omitempty"`
	SuspectFile string `json:"suspectFile,omitempty"`
	SuspectLine int    `json:"suspectLine,omitempty"`
}

CodeReviewTestFailure describes a failing Go test (or check diagnostic) surfaced in the failure card.

type ColliderHandle3D struct {
	// Component is "collider3d" or "trigger3d".
	Component string
	// Shape is "box", "sphere", "capsule", or "cylinder".
	Shape string
	// Field is the component field adjusted by dragging this handle: "width", "height", "depth", or "radius".
	Field string
	// Axis is the 3D gizmo axis (Axis3DX, Axis3DY, or Axis3DZ) mapped to this handle.
	Axis GizmoAxis3D
	// Sign is +1 for the positive local axis end and -1 for the negative end.
	Sign float32
	// Pos is the handle's world-space position on the collider surface.
	Pos [3]float32
	// Dir is the handle's world-space outward unit direction.
	Dir [3]float32
}

ColliderHandle3D describes one draggable size handle of a 3D collider or trigger component in world space, edited through the 3D gizmo API in Gizmo3DCollider mode.

type Command interface {
	Do()
	Undo()
	Label() string
}

Command is a reversible edit executed through History: a change to the open scene, project or clip, or a move of the project's files (MoveFile).

type CommandAuthor string

CommandAuthor identifies who originated a History command (used by agent turns and UndoAuthor/RedoAuthor).

const (
	// AuthorPerson is an ordinary edit made directly by the person in the editor.
	AuthorPerson CommandAuthor = "person"
	// AuthorAgent is an agent turn kept as one undo step.
	AuthorAgent CommandAuthor = "agent"
	// AuthorExternal is a change observed outside the editor (for example a git checkout or external reload).
	AuthorExternal CommandAuthor = "external"
)
type CommitDraft struct {
	Summary     string `json:"summary"`
	Description string `json:"description"`
	Provenance  string `json:"provenance,omitempty"`
	Attribution string `json:"attribution,omitempty"`
}

CommitDraft is a drafted commit message and provenance metadata for the Changes commit card.

func DefaultCommitDraft(req CommitDraftRequest) CommitDraft

DefaultCommitDraft builds a deterministic, human-readable commit summary and description from the included files.

type CommitDraftRequest struct {
	RepoDir         string
	Branch          string
	HeadSHA         string
	Files           []ChangedFile
	Reviews         int
	PlaytestSummary string
	AgentRequests   int
	Checks          ChangesCheckStatus
}

CommitDraftRequest supplies the included files and review/playtest context to Editor.CommitMessageDrafter.

type CommitMilestone struct {
	SHA             string    `json:"sha"`
	Summary         string    `json:"summary"`
	Description     string    `json:"description,omitempty"`
	Branch          string    `json:"branch,omitempty"`
	Files           []string  `json:"files,omitempty"`
	Timestamp       time.Time `json:"timestamp,omitempty"`
	Pushed          bool      `json:"pushed,omitempty"`
	AgentRequests   int       `json:"agentRequests,omitempty"`
	PlaytestSummary string    `json:"playtestSummary,omitempty"`
}

CommitMilestone records a commit created from the Changes panel so History and the Changes panel can display it.

type ComponentCategory string

ComponentCategory groups registered component types in the Inspector's Add component picker.

const (
	ComponentCategoryGameplay    ComponentCategory = "GAMEPLAY"
	ComponentCategoryPhysics     ComponentCategory = "PHYSICS"
	ComponentCategoryAudioVisual ComponentCategory = "AUDIO AND VISUAL"
)
func ComponentCategoryOf(name string) ComponentCategory

ComponentCategoryOf assigns a registered component type name to one of the inspector's three Add component groups: GAMEPLAY, PHYSICS, or AUDIO AND VISUAL.

type ComponentGizmo3D struct {
	// Component is the component type name this gizmo handles (as keyed in ObjectDoc.Components), with no control characters.
	Component string
	// Handles returns the object-space handles and visual primitives for objectID.
	Handles func(ed *Editor, objectID string) []GizmoHandle3D
	// Drag applies a handle drag in object space. Because each move rolls back the previous
	// preview before calling Drag, ed.ComponentField reads the exact pre-drag field values, and
	// all edits made through Editor or Editor.History during the drag commit as one undo step.
	Drag func(ed *Editor, drag GizmoDrag3D) error
	// ShowUnselected, when true, also draws this gizmo's primitives on visible unselected objects
	// (only the selected object's non-DisplayOnly handles can be dragged).
	ShowUnselected bool
}

ComponentGizmo3D registers 3D viewport handles and drag editing for one component type. Handles returns object-space primitives (points, lines, boxes) for objectID when it carries Component. Drag applies a handle drag by writing component fields through Editor (such as SetComponentField or Editor.History); the editor previews each move live, rolls back cleanly on Escape or cancel, and commits the whole drag as a single undo step in Editor.History.

type ComponentGroup struct {
	Category ComponentCategory
	Names    []string
}

ComponentGroup is one titled section of the Add component picker.

type ComposerPlaytestRun struct {
	ID      string
	Name    string
	Summary string
	Detail  string
}

ComposerPlaytestRun is a lightweight playtest run entry surfaced in the @-mention Playtest runs group.

type ConnectStep string

ConnectStep identifies a specific step inside the Connect an agent dialog so Troubleshoot reopens directly at the step that failed.

const (
	// ConnectStepChoice is the initial connection-mode selection step.
	ConnectStepChoice ConnectStep = "choice"
	// ConnectStepInstall is the project MCP install step (`go tool game mcp install`).
	ConnectStepInstall ConnectStep = "install"
	// ConnectStepWaiting is the waiting-for-MCP-connection step.
	ConnectStepWaiting ConnectStep = "waiting"
	// ConnectStepAPIKey is the built-in API key configuration step.
	ConnectStepAPIKey ConnectStep = "apikey"
)
type ConnectedDevice struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Platform  string `json:"platform"`
	Transport string `json:"transport"`
	Online    bool   `json:"online"`
}

ConnectedDevice describes one physical or emulated USB device reported by `adb` / DeviceDiscoverer.

type ConnectionEntry struct {
	Index int
	Conn  sceneformat.ConnectionDoc
}

ConnectionEntry pairs a scene connection with its index in Doc.Connections.

type ContextBreakdownRow struct {
	Key       string
	Label     string
	Tokens    int
	Percent   int
	Highlight bool // true when Percent > 30 (Threads.dc.html)
}

ContextBreakdownRow is one bar in the context meter breakdown popover.

type ContextChipKind string

ContextChipKind distinguishes what kind of context item a chip represents.

const (
	ChipKindObject        ContextChipKind = "object"
	ChipKindWholeScene    ContextChipKind = "scene"
	ChipKindFile          ContextChipKind = "file"
	ChipKindPrefab        ContextChipKind = "prefab"
	ChipKindAsset         ContextChipKind = "asset"
	ChipKindProblem       ContextChipKind = "problem"
	ChipKindPlaytestRun   ContextChipKind = "playtest"
	ChipKindHistoryStep   ContextChipKind = "history"
	ChipKindRule          ContextChipKind = "rule"
	ChipKindAlways        ContextChipKind = "always"
	ChipKindViewportImage ContextChipKind = "viewport_image"
)
type ContextMeterLevel int

ContextMeterLevel classifies the context ring visual state (Threads.dc.html).

const (
	// ContextMeterNormal is used at <= 70% context usage (muted ring, strong text).
	ContextMeterNormal ContextMeterLevel = iota
	// ContextMeterWarning is used at 71–89% context usage (changed/amber ring and percentage).
	ContextMeterWarning
	// ContextMeterCritical is used at >= 90% context usage ("compact now", warning fill/edge/fg).
	ContextMeterCritical
)
type ContextMeterSnapshot struct {
	UsedTokens          int
	LimitTokens         int
	Percent             int
	Level               ContextMeterLevel
	Rows                []ContextBreakdownRow
	CompactableRequests int
	HasCompactedSummary bool
	CompactedSummary    string
}

ContextMeterSnapshot is the computed state for the context ring and breakdown popover.

type CreateProjectRequest struct {
	// Name is the project name (also used as the directory name inside ParentDir when Dir is empty).
	Name string
	// ParentDir is the parent folder containing the new project folder (defaults to ~/games when Dir is empty).
	ParentDir string
	// Dir is the explicit target directory; when empty, filepath.Join(ParentDir, Name) is used.
	Dir string
	// Module is the optional Go module path passed to `game new -module`.
	Module string
	// Template is the template identifier passed to `game new -template` (defaults to the first registered template).
	Template string
}

CreateProjectRequest describes a new project to scaffold from a template and open in the editor.

func (r CreateProjectRequest) TargetDir() string

TargetDir returns the full directory path where the new project will be created.

type CutsceneChange struct {
	ID         string
	Kind       CutsceneChangeKind
	Sign       string // "+", "~", or "-"
	Title      string
	Detail     string
	TrackKey   string
	ClipKeys   []string
	FocusTrack int
	FocusClip  int
	MetaChange bool
	Reverted   bool
}

CutsceneChange is one independently revertible/restorable change inside an open cutscene review.

func DiffCutsceneChanges(before, after *cutscene.Cutscene) []CutsceneChange

DiffCutsceneChanges computes the ordered, independently revertible changes between before and after cutscenes. Adjacent or overlapping timing edits on the same non-sound track are grouped into one atomic change so reverting any subset always leaves a valid, non-overlapping cutscene.

type CutsceneChangeKind int

CutsceneChangeKind classifies how an agent review changed a cutscene track or clip.

const (
	CutsceneChangeNone CutsceneChangeKind = iota
	CutsceneChangeAdded
	CutsceneChangeChanged
	CutsceneChangeRemoved
)
type CutsceneEntry struct {
	Path     string
	Name     string
	Kind     cutscene.Kind
	Length   time.Duration
	InReview bool
}

CutsceneEntry describes one cutscene file shown in the cutscene timeline's left rail.

type CutsceneLineEntry struct {
	ID    string
	En    string
	Zh    string
	Added bool
}

CutsceneLineEntry describes one localized dialogue line shown in the left rail and dialogue inspector.

type CutsceneReviewRequest struct {
	// Prompt is the user request that produced the agent's changes (for example "make the floor 1 intro reveal a slime and hint at the lever").
	Prompt string
	// Path is the file path on disk (or empty for an in-memory cutscene).
	Path string
	// Base is the cutscene before the agent's changes; when nil, the currently open cutscene is used.
	Base *cutscene.Cutscene
	// Proposed is the agent's proposed cutscene document (required).
	Proposed *cutscene.Cutscene
	// Changes optionally supplies custom grouped changes; when empty, DiffCutsceneChanges computes them automatically.
	Changes []CutsceneChange
}

CutsceneReviewRequest opens an agent cutscene review comparing Base against Proposed.

type CutsceneReviewView int

CutsceneReviewView selects whether the cutscene review displays the Before or After state.

const (
	CutsceneReviewAfter CutsceneReviewView = iota
	CutsceneReviewBefore
)
type CutsceneThumbActor struct {
	ID   string
	X, Y float32
}

CutsceneThumbActor is one actor's sampled position in a timeline strip thumbnail.

type CutsceneThumbSample struct {
	Time   time.Duration
	CamX   float32
	CamY   float32
	Zoom   float32
	Actors []CutsceneThumbActor
}

CutsceneThumbSample holds the sampled camera and actor poses for one frame in the timeline thumbnail strip.

type DataTableColumn struct {
	Name string
	Kind datatable.ValueKind
}

DataTableColumn describes a column shown in the Data Table panel grid.

type DataTableReviewCellDiff struct {
	Column      string
	Kind        datatable.ValueKind
	Base        datatable.Value
	HasBase     bool
	Proposed    datatable.Value
	HasProposed bool
	Current     datatable.Value
	HasCurrent  bool
	Changed     bool
	DeltaPct    int
	HasDeltaPct bool
	UserEdited  bool
}

DataTableReviewCellDiff describes the original, proposed, and active value of one cell in a reviewed record.

type DataTableReviewCheck struct {
	Label  string `json:"label"`
	Value  string `json:"value"`
	Before string `json:"before,omitempty"`
	Basis  string `json:"basis,omitempty"`
}

DataTableReviewCheck is one named check figure attached by the agent to a data table review turn (for example "Over 12 min, floors 1–3": "none", before "9", basis "Coin rate from 20 playtests of floor 3: 30 coins a minute.").

type DataTableReviewColumn struct {
	Name      string
	Label     string
	Kind      datatable.ValueKind
	HasDelta  bool
	IsPrimary bool
}

DataTableReviewColumn describes one visible column in the Data Table review table.

type DataTableReviewFileSpec struct {
	// Path is the absolute or disk file path written on Keep (empty for in-memory-only tables).
	Path string
	// RelPath is the display / project-relative slash-separated path (for example "data/items.yaml").
	RelPath string
	// Base is the original parsed datatable.Document before the agent's request (nil for a new file).
	Base *datatable.Document
	// Proposed is the agent's proposed datatable.Document (must be non-nil; may have 0 rows).
	Proposed *datatable.Document
	// IsNew marks a file that did not exist before the agent's request.
	IsNew bool
}

DataTableReviewFileSpec describes one data table file included in an agent review turn.

type DataTableReviewFileSummary struct {
	RelPath           string `json:"relPath"`
	Name              string `json:"name"`
	Path              string `json:"path,omitempty"`
	IsNew             bool   `json:"isNew,omitempty"`
	TotalRecords      int    `json:"totalRecords"`
	ChangedRecords    int    `json:"changedRecords"`
	KeptRecords       int    `json:"keptRecords"`
	RevertedRecords   int    `json:"revertedRecords"`
	UserEditedRecords int    `json:"userEditedRecords"`
	Meta              string `json:"meta"`
}

DataTableReviewFileSummary summarizes one file in the active Data Table review turn.

type DataTableReviewFilter string

DataTableReviewFilter selects which rows are visible in the Data Table review table.

const (
	DataTableReviewFilterAll       DataTableReviewFilter = "all"
	DataTableReviewFilterChanged   DataTableReviewFilter = "changed"
	DataTableReviewFilterUnchanged DataTableReviewFilter = "unchanged"
	DataTableReviewFilterReverted  DataTableReviewFilter = "reverted"
	DataTableReviewFilterYours     DataTableReviewFilter = "yours"
)
type DataTableReviewRecord struct {
	Key           string
	BaseIndex     int
	ProposedIndex int
	FileOrder     int
	DisplayName   string
	KindTag       string
	Changed       bool
	Added         bool
	Removed       bool
	Reverted      bool
	UserEdited    bool
	UserReordered bool
	Cells         map[string]DataTableReviewCellDiff
}

DataTableReviewRecord is a read-only view of one row in the active Data Table review file.

type DataTableReviewRequest struct {
	Prompt string
	Files  []DataTableReviewFileSpec
	Checks []DataTableReviewCheck
}

DataTableReviewRequest opens a full-window row-by-row Data Table review for one agent turn.

type DataTableReviewSnapshot struct {
	Open            bool                         `json:"open"`
	Paused          bool                         `json:"paused,omitempty"`
	Prompt          string                       `json:"prompt,omitempty"`
	ActiveFile      string                       `json:"activeFile,omitempty"`
	ActiveFileIndex int                          `json:"activeFileIndex"`
	FocusKey        string                       `json:"focusKey,omitempty"`
	Filter          DataTableReviewFilter        `json:"filter"`
	SearchQuery     string                       `json:"searchQuery,omitempty"`
	SortColumn      string                       `json:"sortColumn,omitempty"`
	SortOrder       string                       `json:"sortOrder,omitempty"`
	AriaSort        string                       `json:"ariaSort,omitempty"`
	KeptCount       int                          `json:"keptCount"`
	TotalChanged    int                          `json:"totalChanged"`
	UserEditedCount int                          `json:"userEditedCount"`
	Files           []DataTableReviewFileSummary `json:"files,omitempty"`
	Checks          []DataTableReviewCheck       `json:"checks,omitempty"`
	ChecksOutOfDate bool                         `json:"checksOutOfDate,omitempty"`
}

DataTableReviewSnapshot is a read-only summary of the active Data Table review for UI and MCP.

type DataTableReviewYAMLLine struct {
	Line int
	Sign string // "", "+", or "-"
	Text string
	Tag  string // "" or "you"
}

DataTableReviewYAMLLine is one line in the focused record's right-hand YAML diff pane.

type DeviceCommandRequest struct {
	Dir          string          `json:"dir"`
	Platform     string          `json:"platform"`
	Device       ConnectedDevice `json:"device"`
	ArtifactPath string          `json:"artifactPath,omitempty"`
	Args         []string        `json:"args"`
}

DeviceCommandRequest describes an install-and-run command dispatched through `go tool nsgo`.

type DiffLine struct {
	OldLine int          `json:"oldLine,omitempty"`
	NewLine int          `json:"newLine,omitempty"`
	Sign    string       `json:"sign,omitempty"`
	Text    string       `json:"text"`
	Kind    DiffLineKind `json:"kind"`
}

DiffLine is one line in a unified diff preview against HEAD.

type DiffLineKind string

DiffLineKind identifies the role of one unified diff line.

const (
	DiffLineContext DiffLineKind = "context"
	DiffLineAdd     DiffLineKind = "add"
	DiffLineDel     DiffLineKind = "del"
	DiffLineHunk    DiffLineKind = "hunk"
	DiffLineMeta    DiffLineKind = "meta"
)
type DiskConflict struct {
	Kind        DiskFileKind
	Path        string
	Label       string
	Source      string
	Summary     string
	Overlap     int
	DiskObjects int
	Entries     []SceneConflictEntry
}

DiskConflict describes an open file that changed on disk while the editor holds unsaved edits for it.

type DiskConflictError struct {
	Kind DiskFileKind
	Path string
}

DiskConflictError wraps ErrDiskConflict with the conflicting file's kind and path.

func (e *DiskConflictError) Error() string
func (e *DiskConflictError) Unwrap() error
type DiskFileKind string

DiskFileKind identifies which open editor file changed on disk outside the editor.

const (
	DiskFileScene       DiskFileKind = "scene"
	DiskFileProject     DiskFileKind = "project"
	DiskFileClip        DiskFileKind = "clip"
	DiskFilePermissions DiskFileKind = "permissions"
)
type DiskMergeChoice string

DiskMergeChoice selects which side to keep for an object when resolving an external scene conflict.

const (
	DiskMergeMine DiskMergeChoice = "mine"
	DiskMergeDisk DiskMergeChoice = "disk"
)
type DiskPollResult struct {
	Reloaded    []DiskFileKind
	Conflicts   []DiskFileKind
	TreeChanged bool
}

DiskPollResult summarizes what PollDiskChanges observed and did.

type DiskReloadNotice struct {
	Kind    DiskFileKind
	Path    string
	Label   string
	Source  string
	Summary string
	Diffs   []SceneObjectDiff
}

DiskReloadNotice describes a clean file that reloaded automatically from disk.

type DocReview struct {
	ID        string          `json:"id"`
	Target    DocReviewTarget `json:"target"`
	Summary   string          `json:"summary"`
	Rationale string          `json:"rationale,omitempty"`
	Source    string          `json:"source,omitempty"` // "agent" or "suggestion"
	Before    string          `json:"before"`
	After     string          `json:"after"`
	Diff      string          `json:"diff"`
	Status    string          `json:"status"` // "pending", "kept", "reverted"
}

DocReview is one pending or resolved reviewable change to brief.yaml or AGENTS.md. Files on disk are never modified until the person keeps the review.

type DocReviewTarget string

DocReviewTarget identifies a shared project document whose agent or suggested edits go through review.

const (
	// DocReviewBrief targets the project root brief.yaml file.
	DocReviewBrief DocReviewTarget = project.BriefFileName
	// DocReviewRules targets the project root AGENTS.md file.
	DocReviewRules DocReviewTarget = ProjectRulesFileName
)
type Dock int

Dock is where a plugin's Panel sits in the editor window.

const (
	// DockLeft places the panel in a column between the asset browser and the viewport.
	DockLeft Dock = iota
	// DockRight places the panel in a column after the inspector.
	DockRight
	// DockBottom places the panel in a row below the viewport, above the animation panel.
	DockBottom
)
func (d Dock) String() string

String returns the dock's name: "left", "right" or "bottom".

type DrawnShape2D struct {
	ObjectID  string
	Component string
	Field     string
	Kind      sceneformat.FieldKind
	Selected  bool
	Value     any
	// Points holds the shape's canvas-space control points: 1 point for FieldPoint, 4 corners for FieldRect, center + rim sample points for FieldCircle, or all vertices for FieldPolygon.
	Points []math2d.Vec2
}

DrawnShape2D describes one component shape field rendered in the 2D viewport.

type DropPlace int

DropPlace says where DropObject puts an object relative to the object it is dropped on.

const (
	// DropInto makes the object the last child of the target.
	DropInto DropPlace = iota
	// DropBefore makes the object the target's sibling just before it.
	DropBefore
	// DropAfter makes the object the target's sibling just after it.
	DropAfter
)
type Editor struct {
	Doc           *sceneformat.SceneDoc
	Built         *sceneformat.BuiltScene
	BuildErr      error
	History       *History
	Resolver      sceneformat.AssetResolver
	ModelResolver scenemodel.ModelResolver
	Prefabs       map[string]Prefab
	SelectedID    string
	ActiveLayer   string
	Tool          Tool
	ViewMode      ViewMode
	GizmoMode     GizmoMode3D
	GizmoSpace3D  GizmoSpace3D
	Camera3D      OrbitCamera3D
	ActiveTileID  int
	// ActiveTileLayer names the tile layer of a layered grid (sceneformat.TilemapDoc.TileLayers) that PaintTile, EraseTile and FloodFillTile change, empty for its first. A single grid has no tile layers and ignores it.
	ActiveTileLayer string
	// ActiveTileFlip holds the flip bits (tilemap.FlipHorizontal, FlipVertical and FlipDiagonal) that the Paint and Fill tools place tiles of a layered grid with.
	ActiveTileFlip uint32
	// ActiveTerrain names the terrain set of a layered grid's YAML tileset that ToolTerrain paints and erases, empty for its first.
	ActiveTerrain string
	SelectedAsset *AssetEntry
	// SelectedPrefab names the registered prefab selected in the asset browser for the Place tool, or empty when none is selected.
	SelectedPrefab string
	// SelectedModel is the model the Place tool adds in the 3D viewport (SelectModel), chosen in the asset browser's Models list; nil places nothing in 3D, where a press then selects.
	SelectedModel *ModelEntry
	// PlaceHeight3D is the height of the ground plane, the horizontal plane the Place tool puts a model on in 3D where the pointer's ray hits no geometry (PlacementAt3D).
	PlaceHeight3D float32
	// PlaceSnap3D snaps where the Place tool puts a model on the ground plane in 3D to the 3D grid's spacing along X and Z; a model placed on the scene's geometry stays where the pointer's ray hits it (PlacementAt3D).
	PlaceSnap3D bool
	// PlaceAlign3D turns a model the Place tool puts on the scene's geometry in 3D so that its +Y axis follows the surface's normal.
	PlaceAlign3D bool
	Status       string
	FilePath     string
	// Shading3D is how the 3D viewport shades the scene's geometry on the GPU (SetShading3D).
	Shading3D Shading3D
	// Lights3D are the lights the 3D viewport draws the scene's geometry with, such as the rig the game lights the scene with, over the scene's background color; nil draws it with DefaultLights3D under a gradient sky. Scene files do not hold lights, so an editor built on this package that knows its game's lights sets them with SetLights3D, which redraws the viewport; assigning the field directly does not.
	Lights3D *render3d.LightRig
	// FlySpeed3D is how fast the 3D viewport's camera flies (BeginFly3D), in world units a second; the wheel changes it while flying (AdjustFlySpeed3D), and the first flight sets it from the camera's Distance when it is not positive.
	FlySpeed3D float32
	// Project is the game's project file (game.yaml) OpenProject opened, nil without one; EditProject changes it undoably and SaveProject writes it.
	Project *project.File
	// ProjectPath is the game.yaml path OpenProject opened Project from.
	ProjectPath string
	// ScenePath is the open scene's slash-separated path from the project root, as Resolver names scene files (for example "scenes/level.scene.yaml"), or empty when the scene has no such path. PlaceObject and PlaceScene resolve the edited scene under this path, so they refuse an instance that would lead back to the open scene and make the saved file instance itself. OpenFile, SaveFile and OpenProject set it when FilePath lies in the open project's directory and clear it otherwise; OpenYAML clears it, since the loaded scene may come from another file.
	ScenePath string
	// SelectedFile is the slash-separated path of the file selected in the file browser (FilesView), relative to the open project's root, or empty when none is selected.
	SelectedFile string
	// Library is the pack library the library panel lists and installs from into the open project (InstallPack); nil hides the panel.
	Library *library.Library
	// ProjectAssets makes the editor load its assets from the open project: OpenProject and OpenProjectScene make Resolver a project.Resolver over the project's directory, so the scene draws the project's atlases, the asset browser lists them (Assets), PlaceScene instances its scene files and materials and Tiled maps load from it. Atlases are found nearest the open scene (ScenePath), as `game check` finds them, and listed again whenever the editor changes the project's files. Set it before opening a project; editorcmd sets it.
	ProjectAssets bool
	// AppName is the editor's name, which the window title EditorView sets ends with (WindowTitle); empty means "NSGo Scene Editor". An editor built on this package, such as a game's own, sets it to its own name, since EditorView owns the window title.
	AppName string
	// SettingsPath is the per-user editor settings YAML file path outside the project (set by LoadSettings or LoadUserSettings). When non-empty, SetLanguage and SetAppearance persist changes to it.
	SettingsPath string

	// OnSave is invoked by the UI Save button with the encoded YAML bytes.
	OnSave func(data []byte) error
	// OnRunGame is invoked by the Run Game command (shortcut, menu bar, or command palette).
	// When nil, RunGame starts play-in-editor if a UI scope is attached.
	OnRunGame func() error
	// OnPlayUpdate runs on every fixed simulation step while Play mode is active.
	OnPlayUpdate func(scene *sceneformat.BuiltScene, dt time.Duration)
	// OnPlayDraw runs on every render frame while Play mode is active.
	OnPlayDraw func(scene *sceneformat.BuiltScene, alpha float64)
	// OnPlayTrigger runs whenever a built-in 2D or 3D physics trigger fires enter, stay, or exit during Play mode.
	OnPlayTrigger func(ev sceneformat.PhysicsTriggerEvent)
	// OnPlayReset, when set, is called when Play mode starts or resets for replay playback with the recording's seed so game state resets deterministically.
	OnPlayReset func(seed uint64) error
	// PlayInputSource supplies live action/axis input sampled into the 60-second rolling replay buffer during Play mode.
	PlayInputSource replay.ActionSource
	// PlayInputActions lists the watched action names recorded in Play mode's rolling replay buffer. When empty and Project defines input actions, those action names are used in sorted order.
	PlayInputActions []string
	// PlayInputAxes lists the watched axis names recorded in Play mode's rolling replay buffer.
	PlayInputAxes []string
	// PlaySeed is the random seed written into Play mode's rolling replay recordings.
	PlaySeed uint64
	// ReplayDir optionally overrides the root directory under which replays/<scene>-<frame>.replay.yaml files are written when no project is open.
	ReplayDir string
	// OnPlayMarksThread, when set, is called when unsent Play mode marks are dispatched as one thread (via SendPlayMarks or automatically when Play stops).
	OnPlayMarksThread func(PlayMarksThread)
	// OnAskFrozenFrame, when set, is called when the author submits a prompt from Play mode's "Ask about frame N" dialog.
	OnAskFrozenFrame func(AskFrozenFrameRequest)
	// OnAskPanicFix, when set, is called when the author clicks "Ask the agent to fix" on a panic card in the Output panel.
	OnAskPanicFix func(PanicReport)
	// ShowPhysicsDebug controls whether 2D and 3D physics collider and trigger outlines draw in the viewport. New initializes it to true.
	ShowPhysicsDebug bool
	// ShowLightingPreview controls whether 2D lights, occluder shadows, and ambient darkness draw live in the 2D edit viewport. New initializes it to true.
	ShowLightingPreview bool
	// ShowNavMesh2D controls whether the built 2D navigation mesh overlay and authored navregion2d outlines draw in the 2D edit viewport. New initializes it to true.
	ShowNavMesh2D bool
	// ShowNavMesh3D controls whether the baked 3D navigation mesh overlay draws in the 3D viewport. New initializes it to true.
	ShowNavMesh3D bool
	// OnBakeNavMesh3DGeometry, when set, is called by BakeNavMesh3D after collecting the open scene's static geometry so games can add programmatic terrain, GridMaps, or physics colliders.
	OnBakeNavMesh3DGeometry func(g *navbake3d.Geometry) error
	// NavMesh3DAssetFS is an optional fallback file system used by BakeNavMesh3D and LoadNavMesh3D to resolve glTF models and instanced scenes when no project directory is open.
	NavMesh3DAssetFS fs.FS
	// ShowLODOverlay controls whether per-object active LOD labels and color-coding draw in the 3D viewport. New initializes it to true.
	ShowLODOverlay bool
	// ShowOccluders controls whether 3D occluder volumes draw in the 3D viewport. New initializes it to true.
	ShowOccluders bool
	// ShowRenderStats controls whether the RenderStats HUD overlay shows in the 3D viewport. New initializes it to true.
	ShowRenderStats bool
	// ShowAllShapes controls whether the 2D viewport draws component shape fields of every visible object (true) or only the selected object (false).
	ShowAllShapes bool
	// SnapToGrid snaps object placement, drags, 2D handles, and 3D translate gizmos to EffectiveGridStep increments when true.
	SnapToGrid bool
	// GridSize is an explicit grid spacing in world/layer units used when SnapToGrid is true; 0 follows the active layer's tilemap tile size (or 8 when it has none).
	GridSize float32
	// SnapToPixel snaps positions to whole points (1-unit increments) when SnapToGrid is false.
	SnapToPixel bool
	// SnapRotation snaps 2D and 3D rotation drags to RotationSnapDeg-degree increments.
	SnapRotation bool
	// RotationSnapDeg is the rotation snap step in degrees. New initializes it to 15.
	RotationSnapDeg float32
	// SnapScale snaps 2D and 3D scale drags to ScaleSnapStep increments.
	SnapScale bool
	// ScaleSnapStep is the scale snap increment. New initializes it to 0.25.
	ScaleSnapStep float32
	// ShowGrid draws an optional 2D grid overlay at the active snap step in the 2D edit viewport.
	ShowGrid bool
	// PlayRate is the fixed update rate in Hz during Play mode and clip playback (defaults to 60 when <= 0).
	PlayRate int
	// OnSaveClip is invoked by the animation panel's Save button with the encoded clip YAML; when nil the button writes to ClipPath.
	OnSaveClip func(data []byte) error
	// OnSaveStates is invoked by the state machine panel's Save button with the encoded *.states.yaml bytes; when nil the button writes to StatesPath.
	OnSaveStates func(data []byte) error
	// OnSaveCutscene is invoked by the cutscene timeline panel's Save button with the encoded *.cutscene.yaml bytes; when nil the button writes to CutscenePath.
	OnSaveCutscene func(data []byte) error
	// CutsceneCatalog optionally provides localized strings for cutscene dialogue previews when no localization files are loaded from the project.
	CutsceneCatalog *l10n.Catalog
	// Clips optionally resolves animation clips for the open sprite state machine when no project directory holds them on disk.
	Clips animclip.ClipResolver
	// OnSaveDataTable is invoked by the Data Table panel's Save button with the encoded table YAML; when nil the button writes to DataTablePath.
	OnSaveDataTable func(data []byte) error
	// OnSaveGridMap is invoked by SaveGridMap (and Save when a GridMap has unsaved edits) with the encoded canonical .gridmap.yaml bytes; when nil SaveGridMap writes to the GridMap's file path.
	OnSaveGridMap func(data []byte) error
	// GridMapFS optionally provides a filesystem for loading GridMap files and their glTF mesh libraries when no project is open on disk.
	GridMapFS fs.FS
	// OnSaveTileset is invoked by the Tileset Editor panel's Save button with the encoded tileset YAML; when nil the button writes to TilesetPath.
	OnSaveTileset func(data []byte) error
	// OnSaveParticleEmitter is invoked by the Particle Emitter panel's Save button with the encoded emitter YAML; when nil the button writes to ParticleEmitterPath.
	OnSaveParticleEmitter func(data []byte) error
	// OnSaveMaterial is invoked by the Material Editor panel's Save button with the encoded material YAML (resource.Encode); when nil the button writes to MaterialPath.
	OnSaveMaterial func(data []byte) error
	// OnSaveRooms is invoked by SaveRooms / Save with the encoded *.rooms.yaml bytes; when nil SaveRooms writes to RoomsPath.
	OnSaveRooms func(data []byte) error
	// OnSaveRig is invoked by the Rig Editor panel's Save Rig button with the encoded .skel.yaml bytes; when nil the button writes to RigPath.
	OnSaveRig func(data []byte) error
	// OnAskAgentUpdateRef, when set, is called when the author clicks "Ask the agent to update it" for a non-rewritten reference (such as a Go string constant) in the References / Safe Rename review.
	OnAskAgentUpdateRef func(req SafeRenameAgentRequest) error
	// OnOpenSourceFile, when set, is called when the author clicks "Open <file>" for a non-scene source file (such as a Go file) in the References screen.
	OnOpenSourceFile func(file string, line int) error
	// ExportCommandRunner runs `go` with args for the Export panel's release builds, streaming output to stdout and stderr; when nil the editor invokes `go` via os/exec.
	ExportCommandRunner func(ctx context.Context, args []string, stdout, stderr io.Writer) error
	// ReleaseCheckRunner overrides `nsgo check` for the Build and Release screen's preflight and Check project step; when nil, runProjectCheck runs over the project directory.
	ReleaseCheckRunner func(ctx context.Context, dir string) ([]assetcheck.Problem, time.Duration, error)
	// ReleaseStepRunner optionally overrides execution of each Build and Release step (Check project, Compile Go, Pack assets, Sign, Smoke playtest, Measure).
	ReleaseStepRunner func(ctx context.Context, req ReleaseStepRequest, stdout, stderr io.Writer) error
	// ReleasePlaytestRunner overrides the Smoke playtest step of a Build and Release run; when nil, a default summary is produced.
	ReleasePlaytestRunner func(ctx context.Context, platform string, dir string) (BuildSmokePlaytestResult, error)
	// ReleaseMeasureRunner overrides the Measure step of a Build and Release run; when nil, artifact size and category breakdown are measured from disk and compared against the last release baseline.
	ReleaseMeasureRunner func(ctx context.Context, platform string, plan *releaseplan.Plan) (BuildArtifactResult, error)
	// ReleaseReadinessInspector overrides platform readiness evaluation on the Build and Release screen; when nil, built-in readiness checks (including iOS bundle id, icon, certificate, provisioning profile, privacy manifest, and touch controls) are used.
	ReleaseReadinessInspector func(platform string, dir string, f *project.File) []BuildReadinessItem
	// OnReleaseReadinessPersonAction is called when the author clicks a readiness action that requires the person (such as signing in to Apple for a provisioning profile).
	OnReleaseReadinessPersonAction func(platform string, item BuildReadinessItem) error
	// OnReviewReleaseUploads is called when the author presses "Review uploads..." on the Build and Release screen; nothing is uploaded automatically.
	OnReviewReleaseUploads func(snapshot BuildReleaseSnapshot) error
	// ReleaseNotesDrafter generates player-facing Markdown release notes from commits since the last release,
	// kept reviews, and changelog fragments; when nil, DefaultReleaseNotesDraft is used.
	ReleaseNotesDrafter func(ctx context.Context, req ReleaseNotesDraftRequest) (ReleaseNotesDraft, error)
	// ReleaseUploader uploads a single user-confirmed artifact to a store destination (itch.io, Google Play internal testing, or TestFlight).
	// It is never invoked until the person confirms in Review uploads, whatever the permission profile.
	ReleaseUploader ReleaseUploader
	// Keychain stores and retrieves store upload credentials and built-in agent API keys outside project files; when nil, DefaultKeychain() is used.
	Keychain Keychain
	// SyncMCPConfig, when set (automatically wired by editormcp.New), writes configured external MCP servers into the open project's agent MCP configuration (.mcp.json and .codex/config.toml).
	SyncMCPConfig func(root string, servers []AgentMCPServer, removed []string) error
	// OpenOutputFolder opens the release output directory in the OS file manager after a successful non-dry-run build; when nil the editor uses the host platform's default opener.
	OpenOutputFolder func(dir string) error
	// OpenBrowserURL opens a local/LAN web build URL in this computer's browser from the Build and Release screen's RUN ON DEVICE list; when nil the editor uses the host platform's default browser opener.
	OpenBrowserURL func(rawURL string) error
	// LANAddressResolver returns the local/LAN IPv4 address the web build test server binds to and advertises in the QR code; when nil the editor picks a private RFC 1918 LAN interface address (falling back to 127.0.0.1). Non-LAN public IP addresses are always refused.
	LANAddressResolver func() (string, error)
	// WebBuildServePort optionally pins the TCP port used by StartWebBuildServer; 0 (the default) allocates an ephemeral free port on the LAN interface.
	WebBuildServePort int
	// DeviceDiscoverer probes connected USB devices (such as Android phones over adb) for the Build and Release screen's RUN ON DEVICE list; when nil the editor queries `adb devices -l` on desktop.
	DeviceDiscoverer func(ctx context.Context, dir string) ([]ConnectedDevice, error)
	// DeviceCommandRunner executes `go tool nsgo build -target ... -run -device ...` when launching a finished Android build on a connected USB device; when nil the editor invokes `go` via os/exec on desktop.
	DeviceCommandRunner func(ctx context.Context, req DeviceCommandRequest, stdout, stderr io.Writer) error
	// WebBridgeHandler optionally handles JSON-RPC 2.0 requests received on `/__nsgo_mcp/rpc` from a served web build in Play mode; when nil, built-in bridge discovery/status methods are served.
	WebBridgeHandler func(ctx context.Context, method string, params json.RawMessage) (any, error)
	// RunGameCommand starts the child game process for RunGame / RunGameWith, streaming output to stdout and stderr; when nil the editor launches `go tool game dev` in the open project directory in its own process group on desktop.
	RunGameCommand func(spec RunGameSpec, stdout, stderr io.Writer) (GameProcess, error)
	// RemoteTransport, when set, supplies the MCP client transport used to connect to a running game launched with RunGameOptions.Automation; when nil the editor spawns `go tool nsgo mcp` in the project directory on desktop.
	RemoteTransport func(ctx context.Context, spec RunGameSpec) (mcp.Transport, error)
	// RemoteRefreshInterval controls how often the remote scene tree and inspector poll the running game while unpaused (defaults to 250ms when <= 0).
	RemoteRefreshInterval time.Duration
	// AssetsCommandRunner runs `go tool game assets` for BuildAssets and ReimportAsset, streaming output to stdout and stderr; when nil the editor invokes `go` in the open project directory on desktop.
	AssetsCommandRunner func(ctx context.Context, spec AssetsBuildSpec, stdout, stderr io.Writer) error
	// OnReloadAssets, when set, is called after ReloadAssets reloads changed atlases or textures from disk.
	OnReloadAssets func(result ReloadAssetsResult)
	// OnExportProfilerTrace is invoked by the Profiler panel's Export Trace button with the Chrome/Perfetto Trace Event Format JSON bytes; when nil the button opens a Save File dialog.
	OnExportProfilerTrace func(data []byte) error
	// ProfilerPollInterval configures how often the editor polls game_perf_readout and game_perf_zones while connected to a running game (defaults to 250ms when <= 0).
	ProfilerPollInterval time.Duration
	// RecentProjectsPath is the per-user YAML file where recently opened projects are stored outside any project directory. When empty, recent projects stay in memory without writing to disk.
	RecentProjectsPath string
	// LayoutPath is the per-user YAML file where the editor's dock panel layout is stored outside any project directory. When empty, layout edits stay in memory without writing to disk.
	LayoutPath string
	// Now returns the current time for recent-project timestamps and relative-time labels; when nil, time.Now is used.
	Now func() time.Time
	// PickProjectFolder prompts the user to choose a project folder (for Open Project and New Project's parent folder). When nil and a UI scope is attached, the editor invokes cx.PickDirectories.
	PickProjectFolder func(title, startDir string, done func(dir string, ok bool, err error))
	// CreateProject runs project creation from a template (such as `game new`), streaming its output to stdout and stderr. When nil on desktop, the editor invokes `go tool game new`.
	CreateProject func(ctx context.Context, req CreateProjectRequest, stdout, stderr io.Writer) error
	// OnOpenDemo overrides the Start Screen's Open Demo action when non-nil; when nil, OpenDemo loads the built-in Demo Room.
	OnOpenDemo func() error
	// OnSaveScreen, when set, is called with the screen path and canonical *.screen.yaml bytes whenever a HUD layout edit writes or reverts a screen.
	OnSaveScreen func(path string, data []byte) error
	// OnHUDPrompt, when set, is called when the author submits a prompt from the HUD layout screen's composer or "Ask the agent to fix N" button.
	OnHUDPrompt func(HUDPromptRequest)
	// OnOpenFileAtLine, when set, is called by OpenSelectedObjectYAML with the file path and 1-based line number of the selected object in the scene YAML.
	OnOpenFileAtLine func(path string, line int)
	// OnComposerPrompt, when set, is called when the inspector (such as Ask to add) sends or stages a prompt for the agent composer.
	OnComposerPrompt func(prompt string)
	// GitRunner invokes git with args in dir for scene merge conflict inspection, commit, and abort; when nil, os/exec runs git.
	GitRunner func(dir string, args ...string) (string, error)
	// MergeSuggester generates the agent's suggested resolution and reason for each conflicted scene item; when nil, DefaultMergeSuggestion is used.
	MergeSuggester func(ctx context.Context, req MergeSuggestRequest) (MergeSuggestion, error)
	// MergeCheckRunner overrides `game check` during FinishMerge; when nil, runProjectCheck runs over the project directory.
	MergeCheckRunner func(dir, scenePath string, doc *sceneformat.SceneDoc) ([]assetcheck.Problem, error)
	// MergePlaytestRunner overrides the short playtest run during FinishMerge; when nil, a deterministic 10 s headless Build/Update/Physics step runs.
	MergePlaytestRunner func(dir, scenePath string, doc *sceneformat.SceneDoc) (MergePlaytestResult, error)
	// WriteClipboard, when set, overrides writing text to the system clipboard (used by Copy and Cut); when nil and a UI scope is attached, core.Scope.SetClipboard is used.
	WriteClipboard func(text string)
	// ReadClipboard, when set, overrides reading text from the system clipboard (used by Paste); when nil and a UI scope is attached, core.Scope.ReadClipboard is used.
	ReadClipboard func(done func(text string))
	// ReadClipboardImage, when set, overrides reading an image from the system clipboard (used by PasteAgentReferenceImage); when nil and a UI scope is attached, core.Scope.ReadClipboardImage is used.
	ReadClipboardImage func(done func(img core.ClipboardImage, ok bool, err error))
	// ReadClipboardFiles, when set, overrides reading copied file URLs from the system clipboard (used by PasteAgentReferenceImage); when nil and a UI scope is attached, core.Scope.ReadClipboardFiles is used.
	ReadClipboardFiles func(done func(uris []string))
	// PickAgentReferenceFiles, when set, overrides the native file picker opened by the Agent composer's Attach an image button.
	PickAgentReferenceFiles func(done func(uris []string))
	// DiskWatchInterval controls how often the editor polls watched open files (scene, clip, game.yaml) and the project tree for external changes while a UI scope is attached (defaults to 250ms when <= 0).
	DiskWatchInterval time.Duration
	// OnPlaytestPrompt, when set, is called when the author presses "Ask the agent to tune it" or clicks an actionable suggestion in the Playtest Report screen.
	OnPlaytestPrompt func(PlaytestPromptRequest)
	// OnOpenPlaytestConfig, when set, overrides the BOT PROFILE card's "Open" action for playtest.yaml; when nil, the editor opens an inline playtest.yaml preview drawer.
	OnOpenPlaytestConfig func(configPath string) error
	// OnPlayReplayStep runs on every fixed simulation step during Play mode when watching a saved replay recording (after player.Step() and before OnPlayUpdate).
	OnPlayReplayStep func(player *replay.Player, scene *sceneformat.BuiltScene, dt time.Duration)
	// OnAssetImport, when set, handles the Asset Drawer's Import action for folder instead of opening the native file picker.
	OnAssetImport func(folder string)
	// OnAssetGenerate, when set, handles the Asset Drawer's Generate action for folder.
	OnAssetGenerate func(folder string)
	// OnAssetReplaceMissing, when set, handles the selected missing asset's "Replace with a file" action.
	OnAssetReplaceMissing func(missingPath string)
	// OnAssetAskAgent, when set, handles "Ask the agent" actions from the Asset Drawer and selected-asset inspector.
	OnAssetAskAgent func(assetPath, prompt string)
	// OnAskAgent3D, when set, handles "Or ask for one" (3D MODELS strip) and "Ask to add a component…" (3D inspector) prompts.
	OnAskAgent3D func(req Viewport3DAgentRequest)
	// ChangesCheckRunner overrides `nsgo check` and `nsgo test` in the Changes panel; when nil, the editor invokes `go tool nsgo check` and `go tool nsgo test`.
	ChangesCheckRunner func(dir string) (ChangesCheckStatus, error)
	// CodeReviewCheckRunner overrides `nsgo check` and `nsgo test` for pending Go code review (receiving the built Go overlay path and reporting live test progress); when nil, the editor runs `go tool nsgo check` and `go tool nsgo test -json` with GOFLAGS=-overlay=... on desktop.
	CodeReviewCheckRunner func(ctx context.Context, req CodeReviewCheckRequest, onProgress func(CodeReviewCheckProgress)) (CodeReviewCheckResult, error)
	// OnAskCodeReviewFix, when set, is called when the author clicks "Ask the agent to fix" on a failed test card in Go code review.
	OnAskCodeReviewFix func(CodeReviewFixRequest)
	// ExternalEditorName optionally names the external IDE shown in Go code review (for example "GoLand"); when empty, a localized default label is shown.
	ExternalEditorName string
	// CommitMessageDrafter generates the commit summary and description for the Changes panel; when nil, DefaultCommitDraft is used.
	CommitMessageDrafter func(ctx context.Context, req CommitDraftRequest) (CommitDraft, error)
	// GHRunner invokes the GitHub CLI (`gh`) with args in dir for OpenPullRequest; when nil, os/exec runs `gh` when installed on PATH.
	GHRunner func(dir string, args ...string) (string, error)
	// ChangesClipboard overrides clipboard writes from CopyPRDescription; when nil, falls back to WriteClipboard or core.Scope.SetClipboard.
	ChangesClipboard func(text string)
	// OnAskAgent, when set, is called when the author triggers "Ask the agent about this" (AskAgentAboutObject / mod+l) on an object.
	OnAskAgent func(AgentPromptRequest)
	// OnStopAgent is invoked by Mod+. (even while a modal dialog is open, per Spec rule 04) to stop an active agent run without disturbing reviewable changes.
	OnStopAgent func()
	// OnStartAgentRequest, when set, is called when the author starts a new agent request via StartAgentRequest.
	OnStartAgentRequest func(prompt string)
	// OnAddToAgentRequest, when set, is called when the author adds follow-up instructions via "Add to this request" while an agent request is running.
	OnAddToAgentRequest func(text string)
	// AgentRunner runs a composer request against an external agent (such as Claude Code or Codex) and streams incremental steps; when nil on desktop, CLIAgentRunner is used.
	AgentRunner AgentRunner
	// AutomationDrafter optionally turns plain words from "+ New automation, in words" into a candidate AutomationRule; when nil, a built-in English/Chinese drafter is used.
	AutomationDrafter func(ctx context.Context, words string) (AutomationRule, error)
	// AgentTools lists and executes the editor's MCP tools for the built-in agent; editormcp.New wires this automatically.
	AgentTools AgentToolExecutor
	// AgentSecretStore optionally overrides secret storage for the built-in agent's API key; when nil and Keychain is nil, cx.Secrets() is used whenever a core.Scope is attached (backed by the OS keychain in production and nsgotest.Secrets in tests) so keys never touch project files.
	AgentSecretStore AgentSecretStore
	// BuiltInAgentEndpoint optionally overrides the HTTP endpoint used by the built-in agent (defaults to DefaultBuiltInAgentEndpoint). Only https:// URLs or loopback http:// URLs are permitted.
	BuiltInAgentEndpoint string
	// BuiltInHTTPClient optionally overrides the *http.Client used by the built-in agent.
	BuiltInHTTPClient *http.Client
	// AgentReconnectProbe checks whether an MCP agent session is reachable during a reconnect attempt; wired automatically by editormcp.Server and replaceable in tests.
	AgentReconnectProbe func(ctx context.Context) (AgentClientInfo, error)
	// AgentScheduleAfter schedules fn to run after d and returns a cancel function; when nil, time.AfterFunc posting onto the editor's UI scope is used. Tests replace this to verify the 1, 2, 4, 8, 16 s reconnect backoff without real sleeps.
	AgentScheduleAfter func(d time.Duration, fn func()) (cancel func())
	// OnFocusAgentRequest, when set, is called when the user clicks the "Waiting for you" status chip to focus the open request.
	OnFocusAgentRequest func(req AgentOpenRequest)
	// OnAgentTurn, when set, is called whenever the author sends a request from the ⌘L in-place composer or Agent panel.
	OnAgentTurn func(AgentTurn)
	// OnSendAgentRequest, when set, is called after SendAgentRequest / SendAgentRequestWith appends and persists a request on the active agent thread.
	OnSendAgentRequest func(thread *AgentThread, req AgentThreadRequest)
	// OnOpenHistoryStep, when set, is called when the author clicks "Open this step in History" on a folded request or step.
	OnOpenHistoryStep func(sel AgentHistorySelection)
	// OnAgentPointPicked, when set, is called when the user clicks a world coordinate in the viewport during Partial "Let me point".
	OnAgentPointPicked func(turnID, target string, worldX, worldY float32)
	// OnOpenAgentReview, when set, is called when the user opens a turn's Review from Partial, Lost, Stopped, or Mismatch cards.
	OnOpenAgentReview func(review AgentTurnReview)
	// OnSendAgentComposerRequest, when set, receives each request assembled from the agent composer's active chips (and nothing else) and returns the agent's reply and optional reported token usage.
	OnSendAgentComposerRequest func(AgentRequest) (AgentResponse, error)
	// OnCompactAgentThread, when set, overrides how CompactAgentThread summarizes earlier turns and updates token usage.
	OnCompactAgentThread func(earlier, kept []AgentThreadTurn) (summary string, usage *AgentTokenUsage, err error)
	// OnStartFreshAgentThread, when set, is called when StartFreshAgentThread starts a new thread seeded with summary.
	OnStartFreshAgentThread func(summary string) error
	// OnPlanDecision, when set, is called whenever the author approves, chooses Just do it on, or stops an agent-proposed plan.
	OnPlanDecision func(AgentPlanDecision)
	// ProblemCheckDebounce controls the debounce delay before live problem checks run after edits (defaults to 80ms when <= 0).
	ProblemCheckDebounce time.Duration
	// OnAskAboutProblem, when set, is called when the author submits a question from "Ask about this problem…" with the problem attached.
	OnAskAboutProblem func(ProblemQuestionRequest)
	// AutoSaveDelay configures the debounce delay after kept edits before automatic saving runs (defaults to DefaultAutoSaveDelay = 2s when <= 0).
	AutoSaveDelay time.Duration
	// SavingIndicatorDelay configures how long an automatic save must stay in flight before the status bar shows "Saving…" (defaults to DefaultSavingIndicatorDelay = 300ms when <= 0).
	SavingIndicatorDelay time.Duration
	// SaveFileWriter optionally overrides the atomic file writer used when saving scenes and project files (defaults to writeFileAtomic when nil), allowing deterministic slow-write or error tests.
	SaveFileWriter func(path string, data []byte) error
	// FreeSpaceBytes optionally overrides available-disk-space lookup for path when formatting disk-full save errors (for example "Couldn't save: disk is full · 12 MB free"). When nil, the OS filesystem free space is queried.
	FreeSpaceBytes func(path string) (uint64, bool)
	// AgentTaskRunner, when set, executes each background agent task started by SubmitTask or the queue scheduler in its own goroutine.
	AgentTaskRunner func(ctx context.Context, task AgentTask) error
	// OnTaskPermissionDecision, when set, is called when the user clicks Allow once or Deny on a TaskNeedsYou task.
	OnTaskPermissionDecision func(taskID string, allow bool)
	// ThreadsDir optionally overrides where *.thread.yaml background task files are persisted; when empty, <projectDir>/.nsgo/threads is used while a project is open.
	ThreadsDir string
	// OnSettingsAgentRequest, when set, is called when the author clicks a suggested ask or submits an agent prompt on a Settings page or in the Settings search bar.
	OnSettingsAgentRequest func(SettingsAgentRequest)
	// OnSaveBrief, when set, overrides writing brief.yaml on disk when the game brief is edited or saved.
	OnSaveBrief func(data []byte) error
	// OnSaveProjectRules, when set, overrides writing AGENTS.md on disk when project rules are edited or saved.
	OnSaveProjectRules func(data []byte) error
	// FirstRunDetectAgents overrides local agent discovery (claude, codex, API key) for the Start with AI Connect step.
	FirstRunDetectAgents func() []FirstRunAgentOption
	// FirstRunConnectAgent overrides the agent handshake during Start with AI Connect (returning connected tool count or an error/timeout).
	FirstRunConnectAgent func(ctx context.Context, kind string, projectDisplayPath string) (tools int, err error)
	// FirstRunValidateAPIKey overrides immediate validation of a pasted API key in Start with AI Connect.
	FirstRunValidateAPIKey func(ctx context.Context, key string) FirstRunAPIKeyStatus
	// FirstRunPlanner overrides generating the first plan from the author's idea and selected project name.
	FirstRunPlanner func(ctx context.Context, req FirstRunPlanRequest) (*FirstRunPlan, error)
	// FirstRunBuilder overrides executing the approved first-run plan after the project folder is created.
	FirstRunBuilder func(ctx context.Context, req FirstRunBuildRequest, emit func(FirstRunBuildEvent)) (*FirstRunBuildResult, error)
	// FirstRunConnectTimeout bounds the Start with AI agent handshake before showing the no-answer checklist (defaults to 30s when <= 0).
	FirstRunConnectTimeout time.Duration
	// OnFocusWindow, when set, is called when clicking a system notification brings the editor window to the front.
	OnFocusWindow func()
	// OnOpenAgentTask, when set, is called after OpenAgentTask opens a task's scene and switches to the Tasks or Agent panel.
	OnOpenAgentTask func(task AgentTask)
	// OnSendSketch, when set, is called when the author sends a viewport sketch to the agent (SendSketch).
	OnSendSketch func(SketchAgentRequest)
	// OnReplySketchReading, when set, is called when the author answers an agent sketch reading card (Go ahead, Correct a mark, or a text reply).
	OnReplySketchReading func(SketchReadingReply)
	// CheckpointMaxBytes caps the total disk size under .nsgo/checkpoints/ before the oldest checkpoints are pruned (defaults to DefaultCheckpointMaxBytes when <= 0).
	CheckpointMaxBytes int64
	// contains filtered or unexported fields
}

Editor owns the editable SceneDoc, its resolved BuiltScene, undo/redo History, viewport tool/selection state, asset browser selection, and play-mode lifecycle.

func New(doc *sceneformat.SceneDoc, resolver sceneformat.AssetResolver) (*Editor, error)

New constructs an Editor over doc and resolver. If doc is nil, DefaultSceneDoc() is used.

func NewDemo() (*Editor, error)

NewDemo constructs an Editor preloaded with the built-in Demo Room scene, atlases, component registry, and play update callback.

func (e *Editor) AbortCheckpointTurn()

AbortCheckpointTurn cancels the currently active checkpoint turn and removes its incomplete checkpoint directory.

func (e *Editor) AbortMerge() error

AbortMerge aborts the active Git merge (restoring the branch and working tree as they were) and closes the Scene Merge Conflict screen.

func (e *Editor) AcceptActiveMention() (AgentContextChip, bool)

AcceptActiveMention adds the currently highlighted picker item as a context chip, removes the trailing "@<query>" trigger from the composer draft, and closes the picker.

func (e *Editor) AcceptMentionItem(id string) (AgentContextChip, bool)

AcceptMentionItem adds the picker item with id as an attached chip, strips any active "@<query>" trigger from the draft, and closes the picker.

func (e *Editor) AcceptSuggestedChip() (AgentContextChip, bool)

AcceptSuggestedChip promotes the currently suggested selection chip into an attached chip.

func (e *Editor) ActiveAgentReview() *AgentTurnReview

ActiveAgentReview returns a copy of the currently open agent turn review, or nil.

func (e *Editor) ActiveAgentThread() *AgentThread

ActiveAgentThread returns a deep copy of the currently active thread (creating an empty draft for the open scene on demand when none exists yet).

func (e *Editor) ActiveComponentGizmo3D() (PickedComponentGizmo3D, bool)

ActiveComponentGizmo3D returns the currently dragged 3D component gizmo handle, or false when idle.

func (e *Editor) ActiveFrozenFrameContext() *AskFrozenFrameRequest

ActiveFrozenFrameContext returns a snapshot of the active frozen-frame Ask request (or the current live Play frame context when no Ask dialog has been submitted yet).

func (e *Editor) ActiveGizmoAxis3D() GizmoAxis3D

ActiveGizmoAxis3D returns the currently dragged 3D gizmo axis, or Axis3DNone.

func (e *Editor) ActiveGridMapTile() uint16

ActiveGridMapTile returns the currently selected MeshLibrary tile ID for GridMap painting, or 0 when none is selected.

func (e *Editor) ActiveHandle3D() Handle3DKind

ActiveHandle3D returns the currently dragged light/camera handle kind, or Handle3DNone.

func (e *Editor) ActiveInspectorScrub() (InspectorScrubField, bool)

ActiveInspectorScrub returns the currently scrubbing field spec and whether a scrub is active.

func (e *Editor) ActiveLayerTilesetPath() string

ActiveLayerTilesetPath returns the active layer's YAML tileset path (TilesetFile), or "" when the active layer does not use a YAML tileset file.

func (e *Editor) ActiveOverlayLegendKinds() []OverlayKind

ActiveOverlayLegendKinds returns the enabled legend kinds in Spec display order.

func (e *Editor) ActivePlan() *AgentPlan

ActivePlan returns a deep copy of the currently active agent plan, or nil when none is active.

func (e *Editor) ActivePlaytestReport() *playtest.Report

ActivePlaytestReport returns the currently active playtest.Report, or nil when none is loaded.

func (e *Editor) ActivePlugins() []string

ActivePlugins returns the names of the plugins that are on: those the open project names under editor.plugins that are registered, in the project's order. Without a project, no plugin is on.

func (e *Editor) ActiveProblem() (assetcheck.Problem, bool)

ActiveProblem returns the problem currently focused in the Agent problem panel.

func (e *Editor) ActiveProposedFix() (ProposedProblemFix, bool)

ActiveProposedFix returns the pending proposed fix for the currently active problem, or the first pending proposed fix if any.

func (e *Editor) ActiveRegion() EditorRegion

ActiveRegion returns the keyboard region that currently holds focus, or RegionNone.

func (e *Editor) ActiveRegionRing() EditorRegion

ActiveRegionRing returns the keyboard region currently displaying its F6 inset ring, or RegionNone when no F6 region ring is shown.

func (e *Editor) ActiveScene() *sceneformat.BuiltScene

ActiveScene returns the live play scene when playing, the read-only history preview scene when previewing a timeline step, the scene posed by the open state machine or animation clip when previewing, or the edit BuiltScene otherwise.

func (e *Editor) ActiveSceneCamera3D(w, h float32) (*scene3d.Camera, string, bool)

ActiveSceneCamera3D returns the scene's active 3D camera (the visible camera with Current true, or the first visible 3D camera) as a scene3d.Camera for a viewport of size w by h, together with its object ID.

func (e *Editor) ActiveShapeHandle2D() (ShapeHandle2D, bool)

ActiveShapeHandle2D returns the handle currently being dragged, or false if no shape drag is active.

func (e *Editor) ActiveTab() int

ActiveTab returns the 0-based index of the active scene tab.

func (e *Editor) ActiveTileLayerCaption() (layerName, dims string, ok bool)

ActiveTileLayerCaption returns the active layer's display name and tile grid dimensions (for example "World", "24 × 20 cells · 16 px") when the active layer has an inline tilemap.

func (e *Editor) ActiveToast() (Toast, bool)

ActiveToast returns the currently visible toast at the head of the queue, if any.

func (e *Editor) ActiveTurnFileCount() int

ActiveTurnFileCount reports how many files have been recorded into the currently active checkpoint turn.

func (e *Editor) ActiveTurnID() string

ActiveTurnID returns the checkpoint ID of the currently active agent turn, or "" when no turn is active.

func (e *Editor) ActiveViewportOverlayCount() int

ActiveViewportOverlayCount returns how many available viewport overlays are currently turned on.

func (e *Editor) ActiveViewportOverlays() []string

ActiveViewportOverlays returns the sorted IDs of all available viewport overlays currently enabled.

func (e *Editor) AddAgentMCPServer(srv AgentMCPServer) error

AddAgentMCPServer adds or updates an external MCP server, persists editor.yaml, and updates the open project's agent MCP configuration (.mcp.json and .codex/config.toml). Refused when invoked by an agent.

func (e *Editor) AddAgentThreadTurn(turn AgentThreadTurn)

AddAgentThreadTurn appends a turn to the active thread (useful for hydrating thread state or tests).

func (e *Editor) AddAudioBus(name string) error

AddAudioBus appends a new audio bus to game.yaml's audio.buses through EditProject and selects it.

func (e *Editor) AddAudioBusEffect(bus string, fx project.Effect) (int, error)

AddAudioBusEffect appends fx to the named bus's DSP effect chain through EditProject and returns the new effect index.

func (e *Editor) AddAudioBusEffectKind(bus string, kind AudioEffectKind) (int, error)

AddAudioBusEffectKind appends a default effect of kind to the named bus's effect chain through EditProject.

func (e *Editor) AddAutomationRule(rule AutomationRule) error

AddAutomationRule validates and appends rule to automations.yaml. Refuses agent actors (ErrAutomationYouOnly); agents must draft entries via DraftAutomationFromWords for the author to keep.

func (e *Editor) AddBriefGenre(label string) error

AddBriefGenre appends a genre label to brief.yaml as one undoable step.

func (e *Editor) AddBriefPlatform(platform string) error

AddBriefPlatform appends a platform to brief.yaml as one undoable step.

func (e *Editor) AddBriefPlaytestTarget(target project.BriefPlaytestTarget) error

AddBriefPlaytestTarget adds a playtest target to brief.yaml's feel.targets as one undoable step.

func (e *Editor) AddCamera3D(proj sceneformat.ProjectionKind) (string, error)

AddCamera3D places a new 3D camera object of projection kind (perspective or orthographic) on the active world layer as an undoable command, selects it, and returns its ID. When the scene has no 3D camera yet, the new camera is marked current.

func (e *Editor) AddClipEvent(at time.Duration, name string) error

AddClipEvent adds an event named name at time at to the open clip, after any events already at that time, as an undoable command.

func (e *Editor) AddComponent(objectID, component string) error

AddComponent adds the component named component to objectID through History. With a component registry set (SetComponentRegistry), component must be a registered type and is added holding every registered field at its default, so the scene file shows what the component does; it is refused when the added component would declare an event or handler that one of the scene's connections names bare and another of the object's components declares too, since the connection would no longer say which one it means. Without a registry the component is added with no fields. It is refused for an empty name, one with leading or trailing whitespace or a '.', which connections use to qualify an event or handler with its component, and for a component the object already has.

func (e *Editor) AddComposerPlaytestRun(run ComposerPlaytestRun)

AddComposerPlaytestRun registers a playtest run summary in the composer's @-mention Playtest runs group.

func (e *Editor) AddConnection(conn sceneformat.ConnectionDoc) (int, error)

AddConnection appends conn to Doc.Connections as an undoable command after validating the resulting scene with sceneformat.Validate and, when a component registry is set, sceneformat.ValidateConnections. Invalid connections are refused before reaching History, with the reason reported in Status.

func (e *Editor) AddDataTableRow(cells ...datatable.Cell) (int, error)

AddDataTableRow appends a new row to the open data table as an undoable command and returns its 0-based index. When cells is empty, it fills each column with the deterministic zero value of its registered or inferred kind.

func (e *Editor) AddExportPreset(platform string, targets ...string) error

AddExportPreset appends a new export preset for platform (with optional targets chosen from project.TargetsOf(platform)) through EditProject as one undoable step.

func (e *Editor) AddInputAction(name string) error

AddInputAction appends a new named action to game.yaml's input.actions through EditProject and selects it.

func (e *Editor) AddInputAxis(ax project.Axis) error

AddInputAxis appends an action axis to game.yaml's input.axes through EditProject.

func (e *Editor) AddInputBinding(action string, b project.Binding) (int, error)

AddInputBinding appends binding b to action through EditProject and returns its index.

func (e *Editor) AddInputGamepadAxis(g project.GamepadAxis) error

AddInputGamepadAxis appends a gamepad stick axis to game.yaml's input.gamepadAxes through EditProject.

func (e *Editor) AddInputMotionAxis(m project.MotionAxis) error

AddInputMotionAxis appends a motion axis to game.yaml's input.motionAxes through EditProject.

func (e *Editor) AddLayer(name string, space sceneformat.Space) error

AddLayer adds a layer named name in space (SpaceWorld or SpaceScreen; empty leaves the field unset, which is world) to the open scene as an undoable command. The new layer comes last in the file and draws over every other layer: its order is the highest order of the layers the scene draws, those of the scene it inherits included, which is left unset when that is 0. It refuses an empty name, a name another layer of the scene has, and a name of a layer of the scene the open scene inherits, which a layer of that name would extend rather than add. It does not change ActiveLayer.

func (e *Editor) AddLayerTilemap(layerName, tileset string, tileWidth, tileHeight, width, height int) error

AddLayerTilemap attaches a new empty inline single-grid tilemap to layerName (or ActiveLayer when empty) with tileset, tile size (tileWidth x tileHeight), and grid size (width x height) as an undoable command. It refuses a layer that already has a tilemap, an inherited base-owned layer, non-positive or overflowing sizes, an empty tileset name, or a tileset that the Resolver cannot resolve. When the added tilemap is on ActiveLayer, ActiveTileID is kept in the new tileset's palette.

func (e *Editor) AddLight3D(kind sceneformat.LightKind) (string, error)

AddLight3D places a new 3D light object of kind (directional, point, or spot) with sensible defaults on the active world layer as an undoable command, selects it, and returns its ID.

func (e *Editor) AddLightProbeGrid3D() (string, error)

AddLightProbeGrid3D places a new 3D light probe grid object with sensible defaults on the active world layer as an undoable command, selects it, and returns its ID.

func (e *Editor) AddLocalizationKey(key string, plural bool) error

AddLocalizationKey adds a message key row to the Localization panel (plain string when plural is false, CLDR plural forms when true) as an undoable command.

func (e *Editor) AddLocalizationLocale(locale string) error

AddLocalizationLocale adds a normalized BCP-47 locale column to the Localization panel as an undoable command.

func (e *Editor) AddParticleBurst(b particles.Burst) error
func (e *Editor) AddParticleColorStop(kind ParticleCurveKind, t float32, col core.Color) (int, error)

AddParticleColorStop inserts a color stop (t, col) into the named color curve in T order and returns its index.

func (e *Editor) AddParticleFloatStop(kind ParticleCurveKind, t, val float32) (int, error)

AddParticleFloatStop inserts a control point (t, val) into the named float curve in T order and returns its index.

func (e *Editor) AddParticleSubEmitter(rule particles.SubEmitterRule) error
func (e *Editor) AddPermissionRule(rule PermissionRule) error

AddPermissionRule appends rule to the table, focuses the new row, and persists permissions.yaml.

func (e *Editor) AddPlayMark() (PlayMark, error)

AddPlayMark adds a mark at the current Play frame without stopping or pausing Play, saving the rolling input recording under replays/<scene>-<frame>.replay.yaml.

func (e *Editor) AddPlaytestProposal(p PlaytestProposal) string

AddPlaytestProposal adds (or updates by ID) a pending metric proposal from playtest_define so it appears as a banner with Review on the Playtest Report screen.

func (e *Editor) AddPolygonVertex(objectID, component, field string, afterIndex int, pt sceneformat.Point) error

AddPolygonVertex inserts pt into the FieldPolygon component field after afterIndex (or appends when afterIndex < 0 or >= len(poly)) as one undoable SetComponentField step.

func (e *Editor) AddProjectAutoloadResource(name, relPath string) error

AddProjectAutoloadResource appends a resource entry to game.yaml's autoload.resources through EditProject.

func (e *Editor) AddProjectAutoloadScene(name, relPath string) error

AddProjectAutoloadScene appends a scene entry to game.yaml's autoload.scenes through EditProject.

func (e *Editor) AddProjectPhysicsLayer(name string, bit int) error

AddProjectPhysicsLayer appends a named collision layer to game.yaml's physics.layers through EditProject.

func (e *Editor) AddProperty(objectID, key string, kind sceneformat.FieldKind) error

AddProperty adds the custom property key to objectID through History, holding the zero value of kind: false, 0, 0.0 or "". It is refused for an empty or blank key, one with leading or trailing whitespace, a key the object already has and an unknown kind.

func (e *Editor) AddReflectionProbe3D() (string, error)

AddReflectionProbe3D places a new 3D reflection probe object with sensible defaults on the active world layer as an undoable command, selects it, and returns its ID.

func (e *Editor) AddReleaseKeptReview(summary string)

AddReleaseKeptReview appends one kept review summary to the inputs used when drafting release notes.

func (e *Editor) AddReviewChange(change AgentReviewChange)

AddReviewChange appends a non-deletion change to the active agent review (opening it if closed).

func (e *Editor) AddRigAnimation(name string, duration time.Duration, loop bool) error

AddRigAnimation adds a new animation named name to the open rig and selects it as an undoable command.

func (e *Editor) AddRigBone(name, parent string, x, y, rotation, length float32) error

AddRigBone adds a new bone with unit scale (1, 1) to the open rig as an undoable command.

func (e *Editor) AddRigSkin(name string) error

AddRigSkin adds a new skin named name to the open rig and selects it as an undoable command.

func (e *Editor) AddRigSlot(name, bone, defaultAttachment string, alpha float32) error

AddRigSlot adds a draw slot bound to bone as an undoable command.

func (e *Editor) AddRoom(r rooms.Room) (string, error)

AddRoom appends r to the open room map as an undoable command, generating a unique ID when r.ID is empty, validating the map with rooms.Validate, and selecting the new room.

func (e *Editor) AddRoomAtViewCenter() (string, error)

AddRoomAtViewCenter adds a new room centered on the current 2D viewport view, sized to the scene's virtual viewport (or snapped to the tile grid), as an undoable command.

func (e *Editor) AddSceneOverlay(entry SceneOverlayEntry)

AddSceneOverlay appends (or replaces by matching non-empty ID) one live scene overlay entry.

func (e *Editor) AddSceneRailLayer() (string, error)

AddSceneRailLayer creates a uniquely named world-space layer through History and makes it active.

func (e *Editor) AddSceneRailObject(kind string) (string, error)

AddSceneRailObject creates a new object of kind ("empty", "trigger", or "light") on the active layer at the current 2D view center (or world origin in 3D), selects it, and switches the right rail to Inspector.

func (e *Editor) AddSketchArrow(x0, y0, x1, y1 float32, label string) SketchMark

AddSketchArrow adds a numbered Arrow mark strictly in scene coordinates without mutating SceneDoc or History.

func (e *Editor) AddSketchBox(x, y, width, height float32, label string) SketchMark

AddSketchBox adds a numbered Box mark strictly in scene coordinates without mutating SceneDoc or History.

func (e *Editor) AddSketchMarkAtCursor(label string) SketchMark

AddSketchMarkAtCursor places a new mark using the active sketch tool at the current pointer or view center in scene coordinates, providing a full keyboard path for creating marks without pointer dragging.

func (e *Editor) AddSketchPen(points []SketchPoint, label string) SketchMark

AddSketchPen adds a numbered Pen polyline mark strictly in scene coordinates without mutating SceneDoc or History.

func (e *Editor) AddSketchText(x, y float32, label string) SketchMark

AddSketchText adds a numbered Text mark strictly in scene coordinates without mutating SceneDoc or History.

func (e *Editor) AddStatesParam(p animclip.ParamDoc) error

AddStatesParam adds a parameter to the open state machine as an undoable command.

func (e *Editor) AddStatesState(st animclip.StateDoc) error

AddStatesState appends a state to the open state machine as an undoable command.

func (e *Editor) AddStatesTransition(tr animclip.TransitionDoc) error

AddStatesTransition appends a transition to the open state machine as an undoable command.

func (e *Editor) AddTaskStep(id string, summary string, done bool) error

AddTaskStep appends a step entry to task id's detail log (marking previous active steps done when done is false).

func (e *Editor) AddTilesetDraftPolygonPoint(x, y float32)

AddTilesetDraftPolygonPoint appends a vertex (x, y) in tile coordinates to the draft polygon being drawn.

func (e *Editor) AddTilesetTerrain(name, mode string) error

AddTilesetTerrain adds a new terrain set (mode "cardinal" for 4-bit or "blob" for 8-bit) to the open tileset as an undoable edit and selects it.

func (e *Editor) AddTilesetTileAnimFrame(tileID int, frame tilemap.TileFrameDoc) error

AddTilesetTileAnimFrame appends an animation frame to tileID as an undoable edit.

func (e *Editor) AddTilesetTileShape(tileID int, shape tilemap.TileShapeDoc) error

AddTilesetTileShape appends a collision shape (rect, ellipse, polygon, or polyline) to tileID as an undoable edit and selects it.

func (e *Editor) AddToAgentRequest(text string) error

AddToAgentRequest appends additional instructions to the running or waiting request and queues them for the MCP client.

func (e *Editor) AddToSelection(ids ...string) bool

AddToSelection adds one or more existing object IDs to the current selection set, making the last valid ID the primary SelectedID. Returns true if at least one ID existed in the scene.

func (e *Editor) AddableComponentGroups(objectID, query string) []ComponentGroup

AddableComponentGroups returns the registered component types objectID lacks whose names match query, grouped in fixed order under GAMEPLAY, PHYSICS, and AUDIO AND VISUAL (omitting empty groups).

func (e *Editor) AdjustCutsceneClipDuration(delta time.Duration) error

AdjustCutsceneClipDuration nudges the selected clip's Duration by delta (clamped to >= 0.1 s).

func (e *Editor) AdjustCutsceneClipStart(delta time.Duration) error

AdjustCutsceneClipStart nudges the selected clip's Start by delta (rounded to 0.1 s increments when delta is ±100ms).

func (e *Editor) AdjustFlySpeed3D(deltaY float32)

AdjustFlySpeed3D changes the fly speed by a wheel's turn while flying: each 200 points of deltaY, down, halves it and, up, doubles it, within 0.1 to 100000 world units a second.

func (e *Editor) AdjustPlanStepField(stepNumber int, fieldKey string, delta int) error

AdjustPlanStepField steps fieldKey on stepNumber by delta*Step, clamping to [Min, Max].

func (e *Editor) AgentAPIKey(account string) (string, error)

AgentAPIKey retrieves the built-in model API key from NSGo's core.Secrets / system keychain. Refused when invoked by an agent actor so secrets can never leak through MCP tools.

func (e *Editor) AgentActiveConnectionCount() int

AgentActiveConnectionCount returns the number of active agent connections (connected local MCP client + built-in API key in keychain).

func (e *Editor) AgentActorActive() bool

AgentActorActive reports whether the current call is executing on behalf of an agent.

func (e *Editor) AgentAlwaysReadItems() []AgentContextItem

AgentAlwaysReadItems returns the context items shown in the empty-thread view and composer ("The agent reads these with every request:").

func (e *Editor) AgentAttachError() string

AgentAttachError returns the latest refusal reason shown in the composer when an unsupported file is dropped or pasted.

func (e *Editor) AgentAttachedImages() []AgentReferenceImage

AgentAttachedImages returns a copy of the one-shot reference images currently attached to the composer draft.

func (e *Editor) AgentAutotile(req AgentTileAutotileRequest) (AgentTileEditResult, error)

AgentAutotile re-edges a region (or places terrain and re-edges) using a terrain set from the layer's YAML tileset.

func (e *Editor) AgentBriefSuggestions() []string

AgentBriefSuggestions returns up to three starter prompts for the empty-thread view, extracted from the open project's brief.yaml (refusing symlinks outside the project root) or falling back to scene-aware starter suggestions.

func (e *Editor) AgentBuiltInModelForRoute(route AgentModelRoute) string

AgentBuiltInModelForRoute returns the Anthropic model ID for route.

func (e *Editor) AgentClients() []AgentClientInfo

AgentClients returns a copy of currently connected MCP clients.

func (e *Editor) AgentComposerDragOver() bool

AgentComposerDragOver reports whether files are currently dragged over the Agent composer drop target.

func (e *Editor) AgentComposerRewound() bool

AgentComposerRewound reports whether the composer currently holds a freshly rewound message highlighted with the Spec accent ring.

func (e *Editor) AgentComposerText() string

AgentComposerText returns the current multi-line draft in the Agent composer.

func (e *Editor) AgentDockBadgeCount() int

AgentDockBadgeCount returns the Dock badge count (waiting + ready to review + failed). Running and queued tasks never add to the badge.

func (e *Editor) AgentDocsRevision() uint64

AgentDocsRevision returns a monotonic revision counter incremented whenever game brief, project rules, pending document reviews, or review outcomes change.

func (e *Editor) AgentEraseTiles(req AgentTileEraseRequest) (AgentTileEditResult, error)

AgentEraseTiles clears explicit cells or rectangles on a tile layer in one undoable step.

func (e *Editor) AgentFailedCause() string

AgentFailedCause returns a short explanation of why the connection failed.

func (e *Editor) AgentFailedStep() ConnectStep

AgentFailedStep returns the Connect dialog step that failed when disconnected.

func (e *Editor) AgentFocusRequestCount() int

AgentFocusRequestCount returns how many times FocusOpenAgentRequest has been triggered (useful for tests).

func (e *Editor) AgentHeaderPillText() string

AgentHeaderPillText returns the localized text shown in the header pill for the current agent state, or "" when the agent is idle.

func (e *Editor) AgentHistoryEntries() []AgentHistoryEntry

AgentHistoryEntries builds the unified timeline for the History panel: agent thread steps for the active scene (most recent first), manual undo steps from History, and git commit milestones.

func (e *Editor) AgentImagePreviewID() string

AgentImagePreviewID returns the ID of the attached image chip currently hovered/previewed (or AgentBriefPreviewID when previewing brief.yaml's pinned references), or "".

func (e *Editor) AgentLastPinNotice() *BriefPinNotice

AgentLastPinNotice returns the confirmation card state for the most recent Pin to brief action, or nil.

func (e *Editor) AgentLiveAnnouncement() string

AgentLiveAnnouncement returns the latest aria-live="polite" status announcement text.

func (e *Editor) AgentMCPServers() []AgentMCPServer

AgentMCPServers returns the external MCP servers configured for agents, starting with "Running game · nsgo dev" when no custom server list has been saved yet.

func (e *Editor) AgentMode() AgentMode

AgentMode returns the configured agent connection mode.

func (e *Editor) AgentMutating() bool

AgentMutating reports whether the editor is currently executing an agent-originated mutation.

func (e *Editor) AgentObjectChange(objectID string) (AgentObjectChange, bool)

AgentObjectChange returns the pending turn change for objectID, if any.

func (e *Editor) AgentOffline() bool

AgentOffline reports whether the editor's Agent panel is currently in offline mode.

func (e *Editor) AgentOpenRequest() *AgentOpenRequest

AgentOpenRequest returns the currently open permission/question request, or nil.

func (e *Editor) AgentPaintTiles(req AgentTilePaintRequest) (AgentTileEditResult, error)

AgentPaintTiles paints explicit cells, rectangles, or weighted random tile picks in one undoable step. When req.TrackReview is true, the changes are also tracked in the active region-based tile review.

func (e *Editor) AgentPanelOpen() bool

AgentPanelOpen reports whether the Agent tab is currently active in the right sidebar.

func (e *Editor) AgentPermissionProfile() AgentPermissionProfile

AgentPermissionProfile returns the active agent permission profile (defaulting to PermissionProfileBalanced).

func (e *Editor) AgentPermissionRules() []AgentPermissionRule

AgentPermissionRules returns the ordered starting permission rules derived from AgentPermissions.

func (e *Editor) AgentPermissions() AgentPermissions

AgentPermissions returns the active starting permission checkboxes.

func (e *Editor) AgentPointingActive() bool

AgentPointingActive reports whether the editor is currently waiting for a viewport click from "Let me point".

func (e *Editor) AgentPointingPrompt() string

AgentPointingPrompt returns the active pointing instruction shown in the card and viewport pill.

func (e *Editor) AgentPrimaryClient() (AgentClientInfo, bool)

AgentPrimaryClient returns the primary connected MCP client (or the last known client when reconnecting/disconnected) and whether one is known.

func (e *Editor) AgentPrivacy() AgentPrivacyPolicy

AgentPrivacy returns the resolved privacy policy controlling what kinds of content may leave this computer.

func (e *Editor) AgentPulseOpacity() float32

AgentPulseOpacity returns the current opacity of the Agent working outline in [0.45, 1.0]. Under reduced motion (or when no pulse timer is running), it stays solid at 1.0 (Spec.dc.html).

func (e *Editor) AgentPulseRevision() uint64

AgentPulseRevision returns a monotonically increasing counter bumped on viewport-only agent pulse ticks without bumping Editor.Revision().

func (e *Editor) AgentQueuedRequests() []AgentQueuedRequest

AgentQueuedRequests returns a copy of requests waiting in the Agent panel queue.

func (e *Editor) AgentReconnectProgress() (attempt, total int)

AgentReconnectProgress returns the current 1-based retry attempt and total attempts (5) while reconnecting.

func (e *Editor) AgentRemovedNodes(layer, parentID string) []AgentRemovedNode

AgentRemovedNodes returns pending removed nodes belonging to layer and parentID (empty parentID for top-level layer children).

func (e *Editor) AgentReview() *AgentReviewSnapshot

AgentReview returns a read-only copy of the current Review changes state, or nil when closed.

func (e *Editor) AgentReviewOpen() bool

AgentReviewOpen reports whether the Review changes panel is currently open.

func (e *Editor) AgentRewindBanner() (AgentRewindState, bool)

AgentRewindBanner returns the active post-rewind banner state (shown above the composer with Redo), if any.

func (e *Editor) AgentRewindMode() AgentRewindMode

AgentRewindMode returns the currently selected radio option in the rewind popover.

func (e *Editor) AgentRewindOpenTurnID() string

AgentRewindOpenTurnID returns the turn ID whose rewind popover is currently open, or empty.

func (e *Editor) AgentRewindPreview(turnID string) (AgentRewindPreview, bool)

AgentRewindPreview computes the distinct files and dropped turn count for rewinding to before turnID.

func (e *Editor) AgentSession() AgentSessionSnapshot

AgentSession returns an immutable snapshot of the active or latest live Agent panel turn and permission state.

func (e *Editor) AgentSessionID() string

AgentSessionID returns the external CLI session ID tracked for the current thread.

func (e *Editor) AgentState() (AgentState, string)

AgentState returns the current live agent state and detail text.

func (e *Editor) AgentStatus() AgentStatus

AgentStatus returns the current status chip state.

func (e *Editor) AgentStatusBarText() string

AgentStatusBarText returns the bottom status-bar message describing what the agent is currently doing while reminding the person that manual edits stay available, or empty when the agent is idle.

func (e *Editor) AgentStatusTooltip() string

AgentStatusTooltip returns the hover text for the Connected status chip, naming the agent and transport (for example "Claude Code over stdio" or "Anthropic API (built in)").

func (e *Editor) AgentStepPlayReplay(fromFrame, toFrame int, note string) (int, error)

AgentStepPlayReplay steps Play mode across frames [fromFrame, toFrame] on behalf of the agent (via MCP), updates the viewport agent pill ("agent stepping frames A–B") and Agent tab step log ("Stepped frames A–B with game_loop_step…"), and keeps the game paused until the person explicitly resumes.

func (e *Editor) AgentStepPlayReplayFile(absPath string, fromFrame, toFrame int, note string) (int, error)

AgentStepPlayReplayFile loads a replay file from absPath (optional) and runs AgentStepPlayReplay on it.

func (e *Editor) AgentStopped() bool

AgentStopped reports whether the most recent live request was stopped by the user and has not yet been superseded by a new request.

func (e *Editor) AgentSwitcherOpen() bool

AgentSwitcherOpen reports whether the thread switcher popover is open.

func (e *Editor) AgentSwitcherQuery() string

AgentSwitcherQuery returns the active search filter inside the thread switcher popover.

func (e *Editor) AgentTaskByID(id string) (AgentTask, bool)

AgentTaskByID looks up one active agent task by ID across both the background task list (#1022) and ephemeral Agent panel turns.

func (e *Editor) AgentTaskCounts() AgentTaskCounts

AgentTaskCounts returns counts of active non-dismissed tasks grouped by state across both the background task list (#1022) and ephemeral Agent panel turns (deduplicated by ID).

func (e *Editor) AgentTaskRoute(taskKey string) string

AgentTaskRoute returns the selected model/connection label for taskKey under WHO DOES WHAT.

func (e *Editor) AgentThread(id string) *AgentThread

AgentThread returns a deep copy of the thread with id (persisted or active draft), or nil.

func (e *Editor) AgentThreadDoc() *AgentThreadDoc

AgentThreadDoc returns a snapshot of the editor's current background tasks as an AgentThreadDoc.

func (e *Editor) AgentThreadFilePath() string

AgentThreadFilePath returns the current thread's YAML file path under .nsgo/threads/, or "" when no project or ThreadsDir is set.

func (e *Editor) AgentThreadGroups(query string) []AgentThreadGroup

AgentThreadGroups returns persisted threads grouped by:

  1. the open scene ("<SCENE> · OPEN SCENE"),
  2. other scenes ("<SCENE>"), ordered by most recent thread activity,
  3. project-level threads with no scene ("PROJECT · NO SCENE").

When query is non-empty, only threads matching query (case-insensitive substring over title, scene name/path, request titles/prompts, or changed files) are returned, omitting empty groups.

func (e *Editor) AgentThreadID() string

AgentThreadID returns the active agent thread identifier.

func (e *Editor) AgentThreadSummary() string

AgentThreadSummary returns the compacted summary or fresh-thread summary seed, if any.

func (e *Editor) AgentThreadTurns() []AgentThreadTurn

AgentThreadTurns returns a copy of the turns currently held in the active thread.

func (e *Editor) AgentThreads() []*AgentThread

AgentThreads returns a deep-copied snapshot of all persisted threads, most recently updated first.

func (e *Editor) AgentTouchedObjects() []string

AgentTouchedObjects returns a copy of the object IDs the agent is currently touching.

func (e *Editor) AgentTouchingObject(objectID string) bool

AgentTouchingObject reports whether the agent is currently touching objectID during an active step.

func (e *Editor) AgentTurn(id string) (AgentTurn, bool)

AgentTurn returns the recorded turn matching id, or false when not found.

func (e *Editor) AgentTurnChanges() []AgentObjectChange

AgentTurnChanges returns a copy of the derived object changes in the pending agent turn.

func (e *Editor) AgentTurnPending() bool

AgentTurnPending reports whether the active scene currently has an open pending agent turn.

func (e *Editor) AgentTurnReviewOpen() bool

AgentTurnReviewOpen reports whether the pending turn's review view is currently expanded/active.

func (e *Editor) AgentTurnSeq() uint64

AgentTurnSeq returns a monotonically increasing sequence number bumped whenever an agent turn is added or updated.

func (e *Editor) AgentTurnWorking() bool

AgentTurnWorking reports whether an agent turn is currently open and actively editing.

func (e *Editor) AgentTurns() []AgentTurn

AgentTurns returns a deep-enough copy of the turns in the active Agent panel thread, oldest first.

func (e *Editor) AgentUsage() AgentUsageStats

AgentUsage returns the current local usage counters (weekly requests, reviewed/kept changes, playtest runs).

func (e *Editor) AgentUsageResetAt() time.Time

AgentUsageResetAt returns the next weekly usage reset boundary (Monday 00:00 in the editor's clock location).

func (e *Editor) AgentUsageResetLabel() string

AgentUsageResetLabel returns the formatted reset time shown in the Limit reached chip (for example "00:00").

func (e *Editor) AgentWaitingElapsed() string

AgentWaitingElapsed returns how long the current Waiting-for-you request has been open, formatted as "m:ss".

func (e *Editor) AgentWeeklyLimitReached() bool

AgentWeeklyLimitReached reports whether a finite weekly request limit is set and has been reached for the current week.

func (e *Editor) AgentWorking() bool

AgentWorking reports whether an agent request (composer runner or live MCP session) is currently working or waiting for permission.

func (e *Editor) AgentWorkingActivity() string

AgentWorkingActivity returns the pill text for the agent's active step (for example "placing slime_02").

func (e *Editor) AgentWorkingProgress() (step, total int)

AgentWorkingProgress returns the current 1-based step index and total step count (0 if unknown) while working.

func (e *Editor) AllowDeniedStepNow(stepID string) bool

AllowDeniedStepNow lets the person explicitly approve and run a previously denied step from its step row.

func (e *Editor) AllowPermissionAlways() bool

AllowPermissionAlways inserts and persists the concrete Allow rule into permissions.yaml via ApproveAlwaysPermission (which also displays the "Always permission rule saved" toast with Show and Undo) and approves the waiting call.

func (e *Editor) AllowPermissionOnce() bool

AllowPermissionOnce approves the open permission card for this single call only.

func (e *Editor) AlwaysChips() []AgentContextChip

AlwaysChips returns the always-included project files (brief.yaml, AGENTS.md) present in the open project.

func (e *Editor) AmbientColor() string

AmbientColor returns the scene's 2D lighting ambient color CSS string, or empty when unset.

func (e *Editor) AnswerPlanQuestion(questionID, optionID string) error

AnswerPlanQuestion selects optionID for questionID in the active draft plan. It collapses the answered question row and immediately updates planned ghosts and step titles.

func (e *Editor) AnySceneDirty() bool

AnySceneDirty reports whether any open scene tab has unsaved edits.

func (e *Editor) Appearance() Appearance

Appearance returns the editor's configured appearance setting (AppearanceSystem, AppearanceLight, or AppearanceDark).

func (e *Editor) ApplicationMenu() []desktop.MenuItem

ApplicationMenu builds the desktop application menu bar (File, Edit, View, Project) directly from the editor's unified command registry, keeping labels, shortcuts, enabled/checked states, and actions identical to keyboard shortcuts and the command palette. Every shortcut uses core.MenuNotEditing so text fields never lose editing keys.

func (e *Editor) ApplyBuildPresetFixAndRebuild(platform string) error

ApplyBuildPresetFixAndRebuild applies the agent-proposed fix diff on platform (updating signing config, preset targets, and/or export/<platform>.export.yaml), clears the failure, and rebuilds platform.

func (e *Editor) ApplyCodeReviewCheckRun(run *CodeReviewCheckRun, res CodeReviewCheckResult, runErr error) error

ApplyCodeReviewCheckRun commits the check result onto the editor goroutine if the review has not been edited since PrepareCodeReviewCheckRun.

func (e *Editor) ApplyFirstRunFix() error

ApplyFirstRunFix applies the agent's proposed fix after a failed Check stage and advances into First Review.

func (e *Editor) ApplyMergeCustomYAML(id, raw string) error

ApplyMergeCustomYAML parses, validates, and applies hand-edited result YAML for conflict item id.

func (e *Editor) ApplyOverridesToSource(objectID string) error

ApplyOverridesToSource writes the overrides of a scene instance (objectID, its owning instance if objectID is an instanced child, or SelectedID when empty) into its source scene file on disk and clears those overrides on the instance as one undoable step. Undo restores both the source file on disk and the instance's overrides.

func (e *Editor) ApplyPermissionsDraft() (int, error)

ApplyPermissionsDraft applies ONLY the rules explicitly ticked by the person in the open draft card. It refuses when zero rules are ticked, records the change in History as the person's (HistoryActorPerson), persists permissions.yaml when a project is open, and never runs from ⌘↵, Keep all, or automations.

func (e *Editor) ApplyPlaytestProposal(id string) error

ApplyPlaytestProposal applies a pending playtest_define proposal (invoking ApplyFunc if provided, or writing After to playtest.yaml after verifying Before matches disk).

func (e *Editor) ApplyProposedFix(fixID string) error

ApplyProposedFix applies the pending proposed fix identified by fixID (or the active/first pending fix when fixID is empty) as ONE undoable History step, displays a Spec toast with an Undo action, and re-runs the project check. This method is called only by user actions in the editor UI — never by MCP.

func (e *Editor) ApplyReviewRedo(redos []ReviewRedoChange) error

ApplyReviewRedo atomically validates and applies the agent's second-round (or later) revisions strictly for changes that were noted and sent by the author.

Invariants enforced:

  • Any change_id not in the sent pending batch is refused atomically (no partial state changes).
  • Earlier rounds remain intact and read-only.
  • Un-noted changes in the same file cannot be altered even if FileContent is supplied.
  • Redone changes become unseen again with "Redone from your note: <note>" as their Why.
  • Keep still applies the latest round as ONE History undo step restoring exact pre-request bytes.
func (e *Editor) ApplyReviewYAMLFix(changeID string) error

ApplyReviewYAMLFix applies the offered one-step fix (such as "Add the colon") to the failing YAML draft.

func (e *Editor) ApplySafeRename() error

ApplySafeRename applies the current validated safe-rename plan through MoveFile as one undoable History step and enters the Done review state.

func (e *Editor) ApplySceneConflictMerge() error

ApplySceneConflictMerge merges the editor's open scene with the conflicting on-disk scene according to each entry's Choice (overlapping objects use their selected Mine/Disk pick; objects touched on only one side take that side), records the merged scene as one undoable History step, and acknowledges the on-disk snapshot so Save can persist the merged result.

func (e *Editor) ApplySettings(s EditorSettings) error

ApplySettings validates and applies s to the editor without writing to disk. Refused when invoked on behalf of an agent because EditorSettings includes You-only agent limits and privacy switches.

func (e *Editor) ApproveAgentPlan() (AgentPlanDecision, error)

ApproveAgentPlan approves the active draft (or stopped) plan once all clarifying questions are answered, transitioning the plan to Running and delivering the decision to the waiting plan_propose MCP call. It refuses with an error if any question is still unanswered or if all steps were removed.

func (e *Editor) ApproveAlwaysPermission(eval PermissionEvaluation) (int, error)

ApproveAlwaysPermission inserts an Allow rule for eval ahead of its current asking rule (so first-match-wins lets future matching calls through immediately), saves permissions.yaml when a project is open, and shows the "Always permission rule saved" toast with Show and Undo. It re-evaluates eval against the live rule table so a stale RuleIndex can never insert Allow ahead of a Deny rule, refuses empty/escaping targets, and refuses when permissions.yaml failed to load. It returns the 0-based index of the newly inserted (or already matching) rule.

func (e *Editor) ApproveFirstRunPlan() error

ApproveFirstRunPlan approves the first plan, creates the brand-new target project folder on disk (recording folder ownership exclusively for this flow), and transitions into Step 4 (Building).

func (e *Editor) ApproveSketchReading() error

ApproveSketchReading answers "Go ahead" on the active sketch reading, releasing the hold gate so scene_edit can proceed and preparing a pre-edit review snapshot for Keep / Revert.

func (e *Editor) AskAboutProblem(p assetcheck.Problem, question string) error

AskAboutProblem submits a question from "Ask about this problem…" with the problem (and any attributed object / proposed fix) attached.

func (e *Editor) AskAgentAboutAsset(assetPath, prompt string)

AskAgentAboutAsset notifies OnAssetAskAgent (when configured) and updates status with the asset prompt.

func (e *Editor) AskAgentAboutObject(id string) (AgentPromptRequest, error)

AskAgentAboutObject builds an AgentPromptRequest draft for object id, invokes Editor.OnAskAgent if set, stores it as LastAgentPrompt, opens the anchored ⌘L in-place composer for the target (or the current multi-selection when id is part of it), updates Status, and returns the request.

func (e *Editor) AskAgentFromSettings(source, prompt string) SettingsAgentRequest

AskAgentFromSettings dispatches an agent request from the Settings dialog ("Agent on this page" card or the top Settings search bar) with the current Settings page as context, updating ComposerDraft and invoking OnSettingsAgentRequest and OnComposerPrompt when set.

func (e *Editor) AskAgentToFixCodeReview() error

AskAgentToFixCodeReview asks the agent to fix the failing Go test/check within the same turn (round 2). It switches the review into the fixing state, focuses the suspect Go file, notifies Editor.OnAskCodeReviewFix (or starts a fix prompt via Editor.AgentRunner if configured), and awaits the agent's updated files.

func (e *Editor) AskAgentToFixHUDProblems() HUDPromptRequest

AskAgentToFixHUDProblems submits an agent prompt asking to fix all active GAME CHECK problems in the active screen and language.

func (e *Editor) AskAgentToFixPanic() error

AskAgentToFixPanic sends the detected panic report (message, stack frames, and attached replay) to the agent via Editor.OnAskPanicFix and displays the task in the Play mode Agent tab.

func (e *Editor) AskAgentToTunePlaytest() PlaytestPromptRequest

AskAgentToTunePlaytest creates and dispatches a tuning request for the active playtest report's missed goals.

func (e *Editor) AskAgentToUpdateUsage(file string, line int) error

AskAgentToUpdateUsage triggers the optional OnAskAgentUpdateRef callback for a non-rewritten reference (such as a Go string constant) and marks it as requested in the review UI.

func (e *Editor) AskAgentWhyMismatch(turnID string) error

AskAgentWhyMismatch sends a follow-up question asking why the summary disagrees with the actual review diff.

func (e *Editor) AskFrozenFrameDraft() string

AskFrozenFrameDraft returns the current prompt text typed into the "Ask about frame N" dialog.

func (e *Editor) AskFrozenFrameNumber() int

AskFrozenFrameNumber returns the frozen frame number shown in the "Ask about frame N" dialog.

func (e *Editor) AskFrozenFrameOpen() bool

AskFrozenFrameOpen reports whether Play mode's "Ask about frame N" dialog is currently open.

func (e *Editor) AskFrozenFramePNG() []byte

AskFrozenFramePNG returns a copy of the PNG captured when "Ask about frame N" was opened.

func (e *Editor) AskInPlaceOpen() bool

AskInPlaceOpen reports whether the anchored ⌘L in-place agent composer is currently open.

func (e *Editor) AskInPlacePlacement() AskInPlacePlacement

AskInPlacePlacement computes the current clamped placement of the in-place composer inside the viewport.

func (e *Editor) AskInPlaceSelectedSuggestion() int

AskInPlaceSelectedSuggestion returns the currently keyboard-highlighted suggestion index, or -1 when none is highlighted.

func (e *Editor) AskInPlaceSnapshot() AskInPlaceSnapshot

AskInPlaceSnapshot returns the full view-model snapshot for the anchored ⌘L in-place composer.

func (e *Editor) AskToAddComponent(objectID string) string

AskToAddComponent populates the agent composer draft with "Add a component to <object> that " for objectID (defaulting to the selected object when empty), invokes Editor.OnComposerPrompt when set, updates the status bar, and returns the prompt string.

func (e *Editor) AskToAddSelectedComponent() string

AskToAddSelectedComponent is AskToAddComponent for the currently selected object.

func (e *Editor) AssembleAgentRequest(prompt string) AgentRequest

AssembleAgentRequest assembles the exact request sent to the agent from the active chips (Always chips + explicitly attached chips + Viewport image if toggled on) and NOTHING else. Suggested selection chips are never included unless explicitly added.

func (e *Editor) AssetApprovalAuthor() string

AssetApprovalAuthor returns the author name recorded in approvedBy when picking a generated candidate.

func (e *Editor) AssetAudioPlayingPath() string

AssetAudioPlayingPath returns the project-relative path of the audio asset currently playing in the right panel, or "".

func (e *Editor) AssetBrowserOpen() bool

AssetBrowserOpen reports whether the Asset Browser panel is open.

func (e *Editor) AssetDragActive() bool

AssetDragActive reports whether a sprite drag from the asset drawer is currently in progress.

func (e *Editor) AssetDragState() AssetDragState

AssetDragState returns a copy of the active asset drag preview state.

func (e *Editor) AssetDrawerFolder() string

AssetDrawerFolder returns the currently selected folder filter ("" for "All assets").

func (e *Editor) AssetDrawerKind() AssetDrawerKind

AssetDrawerKind returns the active kind tab in the asset drawer.

func (e *Editor) AssetDrawerQuery() string

AssetDrawerQuery returns the name/path filter text in the asset drawer.

func (e *Editor) AssetDrawerSnapshot() AssetDrawerSnapshot

AssetDrawerSnapshot returns the current filtered, sorted asset catalog, folder counts, SHOW ONLY counts, missing-file problem list, and selected asset metadata.

func (e *Editor) AssetDrawerSort() AssetSortMode

AssetDrawerSort returns the current asset drawer sort mode.

func (e *Editor) AssetDrawerStatusFilter() AssetStatusFilter

AssetDrawerStatusFilter returns the active SHOW ONLY filter.

func (e *Editor) AssetGenBusy() (bool, string)

AssetGenBusy reports whether an asynchronous UI generation request is currently in flight and its status label.

func (e *Editor) AssetGenPreviewBackground() AssetPreviewBackground

AssetGenPreviewBackground returns the currently selected preview backdrop for generated image candidates.

func (e *Editor) AssetGeneratorOpen() bool

AssetGeneratorOpen reports whether the full-window Generated Assets screen is open.

func (e *Editor) AssetGenerators() []AssetGeneratorServer

AssetGenerators returns all connected and configured MCP generator servers in deterministic order.

func (e *Editor) AssetImportKind(relPath string) AssetImportKind

AssetImportKind returns the import asset kind of relPath in the open project, or AssetImportNone when no project is open, relPath is a directory, missing, a sidecar, a generated target output, or not an importable asset.

func (e *Editor) AssetImportSettings(relPath string) (*importsettings.File, bool, error)

AssetImportSettings reads and parses the *.import.yaml sidecar beside relPath in the open project. It returns (nil, false, nil) when no sidecar file exists on disk.

func (e *Editor) AssetPreviewClip() string

AssetPreviewClip returns the active clip name in the selected asset's right-panel preview.

func (e *Editor) AssetPreviewFrame() int

AssetPreviewFrame returns the active 0-based frame index in the selected asset's right-panel preview.

func (e *Editor) AssetPreviewPlaying() bool

AssetPreviewPlaying reports whether the selected asset's clip preview is playing frame-by-frame.

func (e *Editor) AssetSnapStep() float32

AssetSnapStep returns the snap grid spacing in pixels used when dragging a sprite asset onto the 2D viewport. When SnapToGrid is enabled, it uses EffectiveGridSize; otherwise it uses the active layer's tile width if present or 16 px.

func (e *Editor) AssetStyleBrief() AssetStyleBrief

AssetStyleBrief returns the currently active style brief.

func (e *Editor) Assets() []AssetEntry

Assets returns all available atlas frames in deterministic sorted order (by Atlas, then Frame).

func (e *Editor) AssetsBuildLastError() error

AssetsBuildLastError returns the error from the most recent completed BuildAssets or ReimportAsset run, or nil.

func (e *Editor) AssetsBuilding() bool

AssetsBuilding reports whether a BuildAssets or ReimportAsset command is currently in flight. It is safe to call from any goroutine.

func (e *Editor) AttachAgentReferenceBytes(name string, data []byte) (AgentReferenceImage, error)

AttachAgentReferenceBytes validates raw PNG, JPEG, or WebP bytes and attaches the image to the next composer request only.

func (e *Editor) AttachAgentReferenceFile(pathOrURI string) (AgentReferenceImage, error)

AttachAgentReferenceFile reads a local file path or file:// URL, validates it as PNG, JPEG, or WebP, and attaches it to the current composer request only.

func (e *Editor) AttachDeniedStepAllowNow(stepID string, fn func())

AttachDeniedStepAllowNow binds the on-demand "Allow now" callback for a denied step.

func (e *Editor) AttachFileChip(relPath string) (AgentContextChip, error)

AttachFileChip explicitly attaches a project-relative file as a context chip.

func (e *Editor) AttachObjectChip(id string) (AgentContextChip, error)

AttachObjectChip explicitly attaches scene object id as a context chip.

func (e *Editor) AttachRigFrame(skin, slot, frame string, originX, originY float32) error

AttachRigFrame attaches atlas frame frame to slot in skin with pivot (originX, originY) as an undoable command. If skin[slot] already exists, its offset, rotation and scale are kept; otherwise scale defaults to (1, 1).

func (e *Editor) AttachScope(cx *core.Scope)

AttachScope binds a core.Scope to the editor so Play() can launch game.Loop from UI controls and background checks or game runs can post updates to the UI goroutine.

func (e *Editor) AttachWholeSceneChip() (AgentContextChip, error)

AttachWholeSceneChip explicitly attaches the entire open scene as a context chip (used by ⌘L with nothing selected).

func (e *Editor) AudioBusVolume(name string) (float32, bool)

AudioBusVolume returns bus's configured volume (defaulting to 1 when nil) and whether the bus exists.

func (e *Editor) AudioBuses() []project.Bus

AudioBuses returns a cloned copy of the open project's audio buses in declaration order.

func (e *Editor) AudioMasterVolume() float32

AudioMasterVolume returns the project's configured master volume in [0, 1], defaulting to 1 when unset.

func (e *Editor) AudioMixerOpen() bool

AudioMixerOpen reports whether the Settings view is open on the Audio buses page.

func (e *Editor) AuditionAudioBus(bus, relPath string) error

AuditionAudioBus loads relPath from the open project and plays it through bus using the editor's sound.Mixer configured by project.File.ConfigureMixer. Changes to master volume, bus volume, or the bus's effect chain update live while auditioning.

func (e *Editor) AuditionBus() string

AuditionBus returns the bus name currently being auditioned, or empty when idle.

func (e *Editor) AuditionChangedAudio(filePath string) error

AuditionChangedAudio plays the selected sound asset from the Changes panel (reusing sound.Mixer when a UI scope is attached).

func (e *Editor) AuditionFile() string

AuditionFile returns the project-relative path currently being auditioned, or empty when idle.

func (e *Editor) AuditionGain() float32

AuditionGain returns the effective playback gain (master * bus volume) for the active audition bus, or 0 when not auditioning.

func (e *Editor) AuditionLoop() bool

AuditionLoop reports whether audition playback loops.

func (e *Editor) AuditionMixer() *sound.Mixer

AuditionMixer returns the editor's sound.Mixer configured via project.File.ConfigureMixer, initializing it on the attached core.Scope when available.

func (e *Editor) AuditionSource() audio.Source

AuditionSource returns the processed audio.Source currently playing through the audition mixer.

func (e *Editor) Auditioning() bool

Auditioning reports whether the mixer panel is actively auditioning a sound through a bus.

func (e *Editor) AutoSave() bool

AutoSave reports whether kept edits save automatically after AutoSaveDelay (default 2 s).

func (e *Editor) AutoSaveInFlight() bool

AutoSaveInFlight reports whether an autosave write is currently executing.

func (e *Editor) AutoSavePending() bool

AutoSavePending reports whether an autosave debounce timer is currently armed.

func (e *Editor) AutomationCheckpointByID(id string) (AutomationCheckpoint, bool)

AutomationCheckpointByID returns the checkpoint with id, or (zero, false) if not found.

func (e *Editor) AutomationCheckpoints() []AutomationCheckpoint

AutomationCheckpoints returns a copy of checkpoints taken before automation runs.

func (e *Editor) AutomationDraftError() string

AutomationDraftError returns any validation/drafting error in "+ New automation, in words".

func (e *Editor) AutomationDraftOpen() bool

AutomationDraftOpen reports whether the "+ New automation, in words" form is open in Settings › Automations.

func (e *Editor) AutomationDraftText() string

AutomationDraftText returns the current natural-language input in "+ New automation, in words".

func (e *Editor) AutomationRunningCount() int

AutomationRunningCount returns the number of background automation tasks currently running.

func (e *Editor) AutomationWeeklyRuns(id string) int

AutomationWeeklyRuns returns how many times the automation with id ran during the last 7 days.

func (e *Editor) Automations() *AutomationsFile

Automations returns a deep copy of the active project's AutomationsFile.

func (e *Editor) AutomationsLoadError() error

AutomationsLoadError returns any parse/validation error encountered when loading the open project's automations.yaml.

func (e *Editor) AutomationsPath() string

AutomationsPath returns the OS path of the open project's automations.yaml, or empty without an open project.

func (e *Editor) AutomationsPausedToday() bool

AutomationsPausedToday reports whether automations are currently paused for today. When the clock advances to a later calendar day, AutomationsPausedToday returns false automatically.

func (e *Editor) AvailableExportPlatforms() []string

AvailableExportPlatforms returns the platforms from project.Platforms that do not yet have an export preset in the open project.

func (e *Editor) BackToCommitDraft()

BackToCommitDraft switches the right pane from the post-commit milestone view back to the editable commit draft.

func (e *Editor) BackToStartFromPlan()

BackToStartFromPlan returns from Step 3 (The first plan) back to the Start Screen, preserving idea and name.

func (e *Editor) BakeAllProbes3D() (int, error)

BakeAllProbes3D bakes every reflection probe and light probe grid in the open scene, writing their .hdr cubemaps and .probes.yaml files to disk and linking any unset paths in a single undoable History group. Returns the number of probes baked.

func (e *Editor) BakeLightProbeGrid3D(id string) (string, error)

BakeLightProbeGrid3D renders the open 3D scene at every sample point of object id's light probe grid, encodes the resulting L2 spherical harmonic irradiance coefficients as versioned canonical YAML, writes it atomically to disk, links LightProbeGrid.Data via History when unset or changed, and refreshes the 3D scene build. Returns the slash-separated output path relative to the project root.

func (e *Editor) BakeNavMesh3D() (*navbake3d.File, error)

BakeNavMesh3D bakes a 3D navigation mesh from the open scene's static geometry (glTF models, built-in 3D primitives, static 3D physics colliders, and any geometry supplied by OnBakeNavMesh3DGeometry) using the current NavMeshBakeConfig.

When an output path resolves inside the open project (or beside FilePath), the deterministic .navmesh.yaml file is written atomically and SceneDoc.NavMesh is linked via History as an undoable edit when unset or changed. The baked file is loaded into the 3D viewport preview overlay immediately.

func (e *Editor) BakeReflectionProbe3D(id string) (string, error)

BakeReflectionProbe3D renders the open 3D scene from object id's reflection probe position into a 6-face Radiance HDR cubemap strip, writes it atomically to disk, links ReflectionProbe.Cubemap via History when unset or changed, and refreshes the 3D scene build so the viewport shows the baked reflection immediately. Returns the slash-separated output path relative to the project root.

func (e *Editor) BeginAgentPermissionAsk(ask AgentPermissionPrompt) (respCh <-chan AgentPermissionOutcome, stopCh <-chan struct{}, alreadyDenied bool)

BeginAgentPermissionAsk installs an open permission card inside the Agent panel for ask. If ask.PermissionKey was already denied in the active request, it returns (nil, stopCh, true) immediately without showing a card so denials are never retried automatically.

func (e *Editor) BeginAgentStep(objectIDs []string, activity string)

BeginAgentStep marks objectIDs as currently being touched by the agent with the human-readable activity pill label (for example "placing slime_02"). While marked, manual edits to those objects are refused in the viewport, inspector, scene tree, and direct Editor edit methods while keeping selection handles visible.

func (e *Editor) BeginAgentToolStep(tool, text, activity string, objects []string) string

BeginAgentToolStep appends a new active running step (with spinner) for a tool call, removing the initial placeholder step and enforcing at most one running spinner at a time.

func (e *Editor) BeginAgentTurn(label string)

BeginAgentTurn opens a pending agent turn for the active scene if none is open yet, snapshotting the current scene as the structural diff baseline and recording the current history index. When a turn is already open, it preserves the existing baseline and updates the label if empty.

func (e *Editor) BeginAssetDrag(assetPath string) error

BeginAssetDrag starts dragging the sprite asset at assetPath from the asset drawer.

func (e *Editor) BeginCameraBoundsDrag(canvasX, canvasY float32) RectHandle

BeginCameraBoundsDrag starts dragging a resize handle or the body/border of camera.bounds in the 2D viewport if scene settings are active, the tool is Select or Move, and (canvasX, canvasY) hits camera.bounds. View2D stays anchored at its pre-drag state while dragging so clamping changes do not feed back into pointer coordinates.

func (e *Editor) BeginCameraDrag(canvasX, canvasY float32) bool

BeginCameraDrag starts dragging the scene camera's position handle in the 2D viewport if scene settings are active, the tool is Select or Move, and (canvasX, canvasY) hits the handle. The 2D view stays anchored at its pre-drag state while dragging so the handle moves smoothly under the pointer without feedback loops.

func (e *Editor) BeginCheckpointTurn(title string) (string, error)

BeginCheckpointTurn starts an agent turn checkpoint over the open project. Before the turn first writes any file (scene, prefab, data, game.yaml, Go code, or binary media), its original bytes are stored under .nsgo/checkpoints/<id>/. Call EndCheckpointTurn when the turn finishes.

func (e *Editor) BeginCheckpointTurnWith(opts CheckpointOptions) (string, error)

BeginCheckpointTurnWith starts a persistent checkpoint turn configured by opts.

func (e *Editor) BeginComponentGizmoDrag3D(sx, sy, w, h float32) (PickedComponentGizmo3D, bool)

BeginComponentGizmoDrag3D hit-tests the selected object's 3D component gizmo handles at (sx, sy) and begins dragging the hit handle. Edits made during the drag are previewed live and committed as one undo step in Editor.History on EndComponentGizmoDrag3D (or rolled back on CancelComponentGizmoDrag3D).

func (e *Editor) BeginConnectionPick(onPick func(targetID string))

BeginConnectionPick starts viewport and scene-tree target picking for the connections panel: the next object pressed in the 2D viewport, 3D viewport or scene tree is passed to onPick without changing SelectedID. Ignored while playing or when onPick is nil.

func (e *Editor) BeginDrag2D(x, y float32) GizmoHandle2D

BeginDrag2D starts a drag in the 2D viewport at the canvas point (x, y), where the pointer went down, with the Select or Move tool: on a handle of the selected object's gizmo (PickGizmo2D) it takes that handle, and on another object it selects that object and moves it. A nested child is dragged in its parent's space, so it follows the pointer under a turned or scaled parent. It returns the handle taken, Handle2DNone when the press is on nothing, another drag is under way, the tool or view mode is another, the scene plays, or the object is hidden or locked in the editor or under one that is. The drag changes the object as UpdateDrag2D says and is recorded by EndDrag2D as one undoable step.

func (e *Editor) BeginEditGeneratedLicense(assetPath string)

BeginEditGeneratedLicense opens the inline license editor for assetPath without fabricating a license value.

func (e *Editor) BeginFly3D() bool

BeginFly3D starts flying the 3D viewport's camera, as holding the right mouse button does: FlyLook3D then turns it about its eye and FlyMove3D moves it, until EndFly3D. Flying looks in perspective, so an orthographic camera switches to perspective, and back when the flight ends without having turned or moved it; and the first flight without a FlySpeed3D sets it to the camera's Distance a second. It reports whether it started: not while playing, and not during a gizmo or camera drag.

func (e *Editor) BeginGizmoDrag3D(sx, sy, w, h float32) GizmoAxis3D

BeginGizmoDrag3D attempts to pick a 3D gizmo handle on the selected object at (sx, sy) and start dragging it. Returns the picked GizmoAxis3D (Axis3DNone if no handle was hit).

func (e *Editor) BeginGizmoDragAxis3D(axis GizmoAxis3D, sx, sy, w, h float32) bool

BeginGizmoDragAxis3D begins a 3D gizmo drag constrained to axis starting from viewport pixel (sx, sy).

func (e *Editor) BeginGridMapStroke(tool GridMapTool, sx, sy, w, h float32) bool

BeginGridMapStroke starts an interactive GridMap stroke (Paint, Erase, Pick, or Box Fill) at viewport pixel (sx, sy) on the current floor height. Call ContinueGridMapStroke as the pointer moves and EndGridMapStroke on release to commit the entire stroke as a single undoable History step.

func (e *Editor) BeginHUDTouchDrag(canvasX, canvasY, canvasW, canvasH float32) bool

BeginHUDTouchDrag starts dragging a touch control under (canvasX, canvasY) on a touch device preview. It returns true when a touch control was grabbed.

func (e *Editor) BeginHandleDrag3D(sx, sy, w, h float32) Handle3DKind

BeginHandleDrag3D picks an interactive light/camera handle at (sx, sy) and begins dragging it.

func (e *Editor) BeginHandleDragKind3D(kind Handle3DKind, sx, sy, w, h float32) bool

BeginHandleDragKind3D starts dragging handle kind on the selected object from viewport pixel (sx, sy).

func (e *Editor) BeginImagePivotDrag(relPath string, canvasX, canvasY, canvasW, canvasH float32) bool

BeginImagePivotDrag starts dragging a pivot marker (or clicking inside a cell to place and drag its pivot) on the image import preview canvas for relPath. For a sliced sheet it drags that cell's per-cell pivot override; for an unsliced image it drags the default pivot.

func (e *Editor) BeginInspectorScrub(spec InspectorScrubField) error

BeginInspectorScrub starts a live interactive scrub on spec. Updates preview immediately in the scene, EndInspectorScrub records the entire scrub as one undo step, and CancelInspectorScrub (or pressing Escape) restores the original value and records nothing.

func (e *Editor) BeginKeyCapture(action, kind string) error

BeginKeyCapture enters "press a key" capture mode for action. kind must be project.KindKey (or empty, which defaults to KindKey) or project.KindKeyCode.

func (e *Editor) BeginMarquee2D(x, y float32) bool

BeginMarquee2D starts a 2D marquee box selection drag at canvas point (x, y) in enclose mode, replacing the current selection when the drag ends.

func (e *Editor) BeginMarquee2DWith(x, y float32, add, toggle bool, mode MarqueeMode) bool

BeginMarquee2DWith starts a 2D marquee box selection drag at canvas point (x, y). When add is true (Shift), matched objects are added to the existing selection; when toggle is true (Mod), matched objects are toggled in the existing selection; otherwise the marquee replaces the selection. mode chooses enclose vs touch matching.

func (e *Editor) BeginNewAutomationDraft()

BeginNewAutomationDraft opens the "+ New automation, in words" composer in Settings › Automations.

func (e *Editor) BeginPluginDrag2D(x, y float32) bool

BeginPluginDrag2D starts a drag on the active plugin tool at canvas coordinates (x, y), returning true if the tool claimed the drag via OnDragBegin.

func (e *Editor) BeginPluginDrag3D(sx, sy, w, h float32) bool

BeginPluginDrag3D starts a drag on the active 3D plugin tool at viewport pixel (sx, sy), returning true if the tool claimed the drag via OnDragBegin3D.

func (e *Editor) BeginRegionDrag(x, y float32)

BeginRegionDrag begins dragging, resizing, or drawing a touch/mouse region at virtual display coordinates (x, y).

func (e *Editor) BeginReview()

BeginReview marks an interactive edit review as open so automatic saving pauses until EndReview or KeepReview is called.

func (e *Editor) BeginReviewYAMLEdit(changeID string) error

BeginReviewYAMLEdit switches the review's right YAML pane into in-place editing for an added or changed scene object.

func (e *Editor) BeginRigDrag(x, y float32) RigHandle

BeginRigDrag begins dragging a rig handle at rig canvas point (x, y). If no handle of the current selection is hit, pressing on another bone selects it and starts moving it. Pass a handle directly via BeginRigHandleDrag to test or force a specific handle (such as RigHandleAttachmentOrigin when overlapping a bone joint).

func (e *Editor) BeginRigHandleDrag(h RigHandle, x, y float32) RigHandle

BeginRigHandleDrag begins dragging a specific handle h at rig canvas point (x, y), useful when the attachment origin handle sits on top of the selected bone's joint.

func (e *Editor) BeginRoomDrag(canvasX, canvasY float32) bool

BeginRoomDrag starts dragging a room handle, moving a room, or drawing a new room (when RoomCreateMode is active) in the 2D viewport.

func (e *Editor) BeginShapeDrag2D(x, y float32) (ShapeHandle2D, bool)

BeginShapeDrag2D starts dragging a component shape handle at canvas point (x, y). Dragging a polygon edge midpoint inserts a new vertex at that edge and drags it as a single undoable SetComponentField step.

func (e *Editor) BeginSketchDrag(canvasX, canvasY float32) bool

BeginSketchDrag starts drawing a sketch mark from canvas point (canvasX, canvasY) using the active sketch tool. Coordinates are converted immediately via CanvasToWorld so all stored geometry is in scene coordinates.

func (e *Editor) BeginTerrainStroke(worldX, worldZ float32) bool

BeginTerrainStroke starts a brush stroke at world coordinates (worldX, worldZ) using the active TerrainBrush, applying the initial dab immediately. ContinueTerrainStroke extends the stroke along pointer movement, and EndTerrainStroke commits the entire stroke as one undo step in History.

func (e *Editor) BeginTerrainStrokeAt(sx, sy, w, h float32) bool

BeginTerrainStrokeAt raycasts pixel (sx, sy) against the open terrain in the 3D viewport and starts a brush stroke at the hit point.

func (e *Editor) BeginTileStroke(mode TileStrokeMode, x, y float32) bool

BeginTileStroke starts a stroke of mode on the active layer's inline tilemap at the canvas point (x, y). Freehand Paint, Erase, and Terrain strokes apply live; Rect, Line, Stamp, Random and SelectRegion accumulate a live preview (TilePreview) without mutating the document until EndTileStroke records every changed cell as one undo step. CancelTileStroke discards the preview or restores live-painted cells without recording history.

It returns false and starts nothing while playing, in 3D, while another stroke is under way, for non-finite coordinates, when the active layer has no inline tilemap to edit, for an edit stroke on a locked or hidden layer (reporting why in the status bar), for a terrain stroke without a valid terrain set, and when required tile/stamp/random parameters are invalid.

func (e *Editor) BeginViewport3DDrag(sx, sy, w, h float32, pan bool)

BeginViewport3DDrag starts a terrain brush stroke (if a terrain brush is active and hits the terrain and !pan), an active 3D plugin tool drag (if OnDragBegin3D claims it and !pan), a light/camera handle drag, a 3D component gizmo handle drag, a 3D transform gizmo drag, or a camera orbit/pan drag. It does nothing while the camera flies (BeginFly3D).

func (e *Editor) BlockedPermissions() []BlockedPermissionStep

BlockedPermissions returns the recorded blocked permission steps in chronological order.

func (e *Editor) Brief() *project.Brief

Brief returns a deep copy of the project's brief.yaml document, or nil when no brief exists yet.

func (e *Editor) BriefAgentNote() (note string, suggestions []string)

BriefAgentNote computes the contextual note and suggested asks for the "Agent on this page" card on Settings › Game brief.

func (e *Editor) BriefDirty() bool

BriefDirty reports whether the in-memory game brief differs from the last saved canonical brief.yaml bytes.

func (e *Editor) BriefExists() bool

BriefExists reports whether the open project has a game brief (loaded from brief.yaml or created in the editor).

func (e *Editor) BriefFileExists() bool

BriefFileExists reports whether brief.yaml exists as a regular confined file at the open project root.

func (e *Editor) BriefGaps() []project.BriefSection

BriefGaps returns the missing sections of brief.yaml in canonical order. When no brief exists yet, every section in project.BriefSections is returned.

func (e *Editor) BriefLoadErr() error

BriefLoadErr returns any parse error encountered when loading brief.yaml from disk.

func (e *Editor) BriefPath() string

BriefPath returns the path to brief.yaml in the open project, or empty when no project is open.

func (e *Editor) BriefPlaytestTargets(scene string) []project.BriefPlaytestTarget

BriefPlaytestTargets returns the structured playtest targets defined in brief.yaml for scene (empty scene returns all targets).

func (e *Editor) BriefReferenceImages() []AgentReferenceImage

BriefReferenceImages loads and validates all pinned PNG/JPEG/WebP reference images listed in brief.yaml. Valid images are cached by file modtime and size so repeated UI renders do not re-decode from disk.

func (e *Editor) BriefReferences() []BriefReference

BriefReferences reads the list of pinned reference images under art.references in <projectRoot>/brief.yaml.

func (e *Editor) BriefYAML() ([]byte, error)

BriefYAML returns the canonical YAML encoding of the current brief, or nil when no brief exists.

func (e *Editor) BrowseAndOpenProject() error

BrowseAndOpenProject opens the folder picker and switches to the chosen project (asking about unsaved edits first).

func (e *Editor) BrowseStartProjectParentDir() error

BrowseStartProjectParentDir opens the folder picker to choose the parent directory for a new project.

func (e *Editor) BuildAgentTaskNotification(task AgentTask) (AgentTaskNotification, bool)

BuildAgentTaskNotification builds the system notification for task when task.State is one of the three notifiable states (TaskNeedsYou, TaskReadyToReview, or TaskFailed). It returns (_, false) for running, queued, stopped, done, dismissed, or empty-ID tasks.

func (e *Editor) BuildAssets() error

BuildAssets runs `go tool game assets` for the open project off the UI goroutine, streaming stdout and stderr into the Output panel, and reloads changed atlases and textures once the build succeeds.

func (e *Editor) BuildAssetsWith(opts AssetsBuildOptions) error

BuildAssetsWith runs `go tool game assets` with opts for the open project off the UI goroutine, streaming stdout and stderr into the Output panel, and reloads changed atlases and textures once the build succeeds.

func (e *Editor) BuildInputActions() *input.Actions

BuildInputActions builds a fresh input.Actions populated from the open project's input map via project.File.BindInput.

func (e *Editor) BuildPRDescription() string

BuildPRDescription formats a structured Markdown pull request description from the active Changes session (summary, plan/description, changed files & scene object deltas, verification checks, and playtest numbers).

func (e *Editor) BuildReleaseScreenOpen() bool

BuildReleaseScreenOpen reports whether the full-window Build and Release screen is open.

func (e *Editor) BuildReleaseSnapshot() BuildReleaseSnapshot

BuildReleaseSnapshot returns a thread-safe deep snapshot of the Build and Release screen state.

func (e *Editor) BuiltInAgentProvider() string

BuiltInAgentProvider returns the display label for the built-in API connection (default "Anthropic API").

func (e *Editor) BurstParticlePreview(count int)

BurstParticlePreview emits count particles immediately into the live preview emitter.

func (e *Editor) CallWebBridgeTool(ctx context.Context, sessionID, toolName string, args any) (json.RawMessage, error)

CallWebBridgeTool dispatches an MCP inspection/debug tool call to a connected web Play-mode client (such as a phone that scanned the QR code) and waits for its JSON reply.

func (e *Editor) CameraBoundsHandleCanvasPos(h RectHandle) (x, y float32, ok bool)

CameraBoundsHandleCanvasPos returns the canvas coordinates of handle h on the scene camera's bounds rectangle when scene settings are active, bounds are set, and the editor is in 2D edit mode.

func (e *Editor) CameraHandleCanvasPos() (x, y float32, ok bool)

CameraHandleCanvasPos returns the canvas coordinates of the draggable camera position handle when scene settings are active in 2D edit mode.

func (e *Editor) CanApprovePlan() (bool, string)

CanApprovePlan reports whether Approve is currently enabled and why not when disabled.

func (e *Editor) CanAutoMoveFocus() bool

CanAutoMoveFocus reports whether background UI activity is allowed to move focus (false during any drag/scrub or while the person is typing in a text field).

func (e *Editor) CanConfirmCodeReviewFile(relPath string) bool

CanConfirmCodeReviewFile reports whether relPath is a Go file whose checks have passed for the current pending code.

func (e *Editor) CanDeleteFirstRunFolder() bool

CanDeleteFirstRunFolder reports whether "Stop and delete the folder" is permitted right now: ONLY true when this flow itself created a brand-new folder after Approve.

func (e *Editor) CanPasteObject() bool

CanPasteObject reports whether PasteObject has an object YAML payload available from either the editor's clipboard cache or an injectable ReadClipboard hook.

func (e *Editor) CanRedoAgentRewind() bool

CanRedoAgentRewind reports whether a rewound turn can currently be restored with RedoAgentRewind.

func (e *Editor) CanReturnToEditor() bool

CanReturnToEditor reports whether the user can dismiss the Start Screen and return to an open project or demo session.

func (e *Editor) CanUndoLastBriefPin() bool

CanUndoLastBriefPin reports whether the most recent Pin to brief command is currently at the top of Editor.History and can be undone safely without reverting unrelated later edits.

func (e *Editor) CanUndoSketchMark() bool

CanUndoSketchMark reports whether the sketch layer has a previous mark state to undo.

func (e *Editor) CancelAgentPointing() bool

CancelAgentPointing exits viewport pointing mode cleanly (invoked on Esc).

func (e *Editor) CancelAgentReconnect()

CancelAgentReconnect stops any pending reconnect backoff timer without changing the current status.

func (e *Editor) CancelAssetDrag()

CancelAssetDrag cancels any in-progress sprite drag cleanly without mutating the scene.

func (e *Editor) CancelAssetsBuild()

CancelAssetsBuild cancels an in-flight BuildAssets or ReimportAsset run, if any.

func (e *Editor) CancelCameraBoundsDrag()

CancelCameraBoundsDrag aborts any active camera.bounds handle drag and restores the pre-drag camera bounds without modifying History.

func (e *Editor) CancelCameraDrag()

CancelCameraDrag aborts any active camera handle drag and restores the pre-drag camera.

func (e *Editor) CancelComponentGizmoDrag3D() bool

CancelComponentGizmoDrag3D aborts an active 3D component gizmo drag, rolling back all previewed edits and recording nothing in Editor.History.

func (e *Editor) CancelConnectionPick()

CancelConnectionPick exits connection target pick mode without selecting a target.

func (e *Editor) CancelDrag2D() bool

CancelDrag2D ends the drag in progress, as Escape or a cancelled gesture does, putting the object back as it was before the drag and recording nothing. It reports false when no drag is under way.

func (e *Editor) CancelEditGeneratedLicense()

CancelEditGeneratedLicense closes the inline license editor without writing anything.

func (e *Editor) CancelExportBuild()

CancelExportBuild cancels an in-flight release build, if any.

func (e *Editor) CancelGizmoDrag3D()

CancelGizmoDrag3D aborts any active 3D gizmo or light/camera handle drag and restores the object's pre-drag state.

func (e *Editor) CancelGridMapStroke()

CancelGridMapStroke aborts an active GridMap stroke and restores every cell it modified without recording history.

func (e *Editor) CancelHUDTouchDrag()

CancelHUDTouchDrag aborts an active touch control drag and restores the node's original offset without recording undo history.

func (e *Editor) CancelHandleDrag3D()

CancelHandleDrag3D aborts any active light/camera/probe handle drag and restores the pre-drag values.

func (e *Editor) CancelImagePivotDrag()

CancelImagePivotDrag aborts an active pivot drag without modifying the sidecar or History.

func (e *Editor) CancelInspectorScrub() bool

CancelInspectorScrub aborts the active scrub, restoring the original pre-scrub value without recording an undo step. It returns false when no scrub is active.

func (e *Editor) CancelKeyCapture()

CancelKeyCapture exits "press a key" capture mode without modifying the project.

func (e *Editor) CancelMarquee2D() bool

CancelMarquee2D aborts an active 2D marquee drag without changing the selection.

func (e *Editor) CancelNewAutomationDraft()

CancelNewAutomationDraft closes and clears the pending "+ New automation, in words" draft.

func (e *Editor) CancelPendingAgentPermissionAsk(askID string)

CancelPendingAgentPermissionAsk dismisses the open permission card if its ID still matches askID (used when an MCP client cancels or disconnects while waiting on a permission card).

func (e *Editor) CancelPendingSwitch()

CancelPendingSwitch closes the unsaved-edits prompt without switching projects.

func (e *Editor) CancelPendingTurnPrompt()

CancelPendingTurnPrompt dismisses the pending-turn prompt and leaves the turn pending.

func (e *Editor) CancelPluginDrag2D() bool

CancelPluginDrag2D aborts an active plugin tool drag, calling OnDragCancel when set.

func (e *Editor) CancelPluginDrag3D() bool

CancelPluginDrag3D aborts an active 3D plugin tool drag, calling OnDragCancel3D when set.

func (e *Editor) CancelReleaseUpload()

CancelReleaseUpload cancels any in-flight store upload batch.

func (e *Editor) CancelReviewNoteComposer()

CancelReviewNoteComposer closes the inline note composer without modifying any saved note.

func (e *Editor) CancelReviewRevertAllDialog()

CancelReviewRevertAllDialog closes the Revert All confirmation dialog without reverting.

func (e *Editor) CancelRigDrag() bool

CancelRigDrag aborts the active rig handle drag and restores the rig to its pre-drag state without recording history.

func (e *Editor) CancelRoomDrag()

CancelRoomDrag aborts any active room drag or room-create drag and restores the pre-drag room.

func (e *Editor) CancelSafeRename()

CancelSafeRename leaves safe-rename review mode without modifying any file on disk.

func (e *Editor) CancelSaveConflict()

CancelSaveConflict dismisses the save-conflict confirmation prompt without overwriting the file on disk.

func (e *Editor) CancelShapeDrag2D() bool

CancelShapeDrag2D aborts any active shape handle drag, restoring the pre-drag component value and recording nothing.

func (e *Editor) CancelSketchDrag()

CancelSketchDrag cancels an in-progress sketch mark drag without creating a mark.

func (e *Editor) CancelTerrainStroke()

CancelTerrainStroke aborts the active terrain brush stroke and restores all modified samples without recording a History entry.

func (e *Editor) CancelTileStroke()

CancelTileStroke ends the stroke under way without recording it, discarding any live preview or putting back every cell a live stroke changed, as on Escape or when a second finger turns a one-finger stroke into a two-finger pan. It does nothing when no stroke is under way.

func (e *Editor) CancelViewport3DDrag()

CancelViewport3DDrag aborts any active 3D drag (terrain stroke, 3D handle drag, 3D plugin tool drag, 3D component gizmo drag, 3D transform gizmo drag, or camera drag).

func (e *Editor) CanvasSize() (float32, float32)

CanvasSize returns the size in points of the viewport's canvas, which fills its panel. The viewport sets it as it lays out (SetCanvasSize); until then it is the scene's virtual size (ViewportSize).

func (e *Editor) CanvasSizeRevision() uint64

CanvasSizeRevision returns a counter incremented whenever the viewport canvas dimensions change.

func (e *Editor) CanvasToScreen(x, y float32) (float32, float32)

CanvasToScreen converts a point on the viewport's canvas into the scene's virtual screen, the space screen-space layers draw in, through the 2D view and back out through the scene's camera.

func (e *Editor) CanvasToTile(layer string, canvasX, canvasY float32) (col, row int, ok bool)

CanvasToTile converts a point on the viewport's canvas into (col, row) on layer's inline tilemap.

func (e *Editor) CanvasToWorld(x, y float32) (float32, float32)

CanvasToWorld converts a point on the viewport's canvas into world coordinates through the 2D view (View2D), which the author pans and zooms independently of the scene's camera.

func (e *Editor) CaptureKeyAction() string

CaptureKeyAction returns the action name waiting for a captured key, or empty when not capturing.

func (e *Editor) CaptureKeyEvent(ev core.KeyEvent) (bool, error)

CaptureKeyEvent handles a hardware key press while key capture is active, adding the captured key or keyCode binding to the target action through EditProject and ending capture mode.

func (e *Editor) CaptureKeyKind() string

CaptureKeyKind returns the binding kind being captured ("key" or "keyCode"), or empty when not capturing.

func (e *Editor) CapturingKey() bool

CapturingKey reports whether the Input Map panel is waiting for a key press to bind.

func (e *Editor) Catalog() *l10n.Catalog

Catalog returns the editor's active localization catalog.

func (e *Editor) ChangesAuditioningPath() string

ChangesAuditioningPath returns the repo-relative path of the audio file currently auditioning in the Changes panel, or empty when idle.

func (e *Editor) ChangesBusy() bool

ChangesBusy reports whether an asynchronous Changes operation (checks, pull, push, or PR creation) is running.

func (e *Editor) ChangesBusyLabel() string

ChangesBusyLabel returns a short status label for the currently running asynchronous Changes operation, or empty when idle.

func (e *Editor) ChangesCount() int

ChangesCount returns the last observed number of changed working-tree files in the open project's Git repository.

func (e *Editor) ChangesGHAvailable() bool

ChangesGHAvailable reports whether the GitHub CLI (`gh`) is available (or Editor.GHRunner is injected), using the cached value from the active session when open.

func (e *Editor) ChangesOpen() bool

ChangesOpen reports whether the Changes & Commit screen is currently active.

func (e *Editor) ChangesSession() *ChangesSession

ChangesSession returns the active Changes & Commit session, or nil when closed.

func (e *Editor) CheckAgentUsageReset()

CheckAgentUsageReset checks whether the weekly reset boundary has passed and clears Limit reached if so.

func (e *Editor) CheckAutomationActionPermission(action, targetPath string) AgentPermissionDecision

CheckAutomationActionPermission evaluates action (e.g. "Edit", "Create", "Run", "Code", "Delete") and targetPath against the project's You-only trust boundary and active MCP permission rules (permissions.yaml, first match wins).

func (e *Editor) CheckExportCredits() ExportCreditsReport

CheckExportCredits runs the same credits check as `game release` against the open project's assets section, caches the result for the Export panel, and returns it.

func (e *Editor) CheckProblems()

CheckProblems runs assetcheck.CheckWith (using the editor's component registry and any unsaved open documents) and project.Check over the open project asynchronously off the UI goroutine. Each call supersedes any in-flight or pending debounced check so stale results never overwrite newer ones. It is a no-op when no project is open.

func (e *Editor) CheckYouOnlyTarget(rawPath string) (YouOnlyDomain, bool)

CheckYouOnlyTarget reports whether rawPath (relative to the project root or absolute) resolves to a You-only file, including Editor.SettingsPath, case-insensitive host aliases, macOS /var -> /private/var, and symlinked ancestor directories.

func (e *Editor) CheckingProblems() bool

CheckingProblems reports whether a background or debounced project check is in flight. It is safe to call from any goroutine.

func (e *Editor) CheckpointFileBytes(id, relPath string) ([]byte, bool, error)

CheckpointFileBytes returns the saved pre-turn bytes of relPath from checkpoint id, whether it existed before the turn, and any error (including size or SHA-256 mismatch).

func (e *Editor) CheckpointManifest(id string) (*CheckpointManifest, error)

CheckpointManifest loads and validates the manifest of checkpoint id from .nsgo/checkpoints/<id>/manifest.yaml.

func (e *Editor) Checkpoints() []CheckpointSummary

Checkpoints returns the open project's persisted checkpoints, newest first.

func (e *Editor) CheckpointsDir() string

CheckpointsDir returns the OS path to the open project's .nsgo/checkpoints directory, or "" without a project.

func (e *Editor) ChipPayloadByID(chipID string) (AgentChipPayload, bool)

ChipPayloadByID finds chipID among attached, always, viewport image, or suggested chips and resolves its exact payload via ResolveChipPayload.

func (e *Editor) ClearAgentAttachedImages()

ClearAgentAttachedImages removes all one-shot reference image attachments from the current composer draft.

func (e *Editor) ClearAgentTasks()

ClearAgentTasks clears ephemeral Agent panel turn notifications, cancels waiting timers, closes shown task notifications, and updates the Dock badge.

func (e *Editor) ClearAgentWaitingForYou()

ClearAgentWaitingForYou clears the open waiting request and restores Working or Connected status.

func (e *Editor) ClearAssetDragHover()

ClearAssetDragHover hides the viewport ghost preview while keeping the drag alive until dropped or cancelled.

func (e *Editor) ClearAssetDrawerFilters()

ClearAssetDrawerFilters resets kind, query, status, and folder filters so all assets show.

func (e *Editor) ClearCameraBounds() error

ClearCameraBounds removes the open scene camera's clamp bounds through History.

func (e *Editor) ClearDataTableError()

ClearDataTableError clears the open data table's validation error banner.

func (e *Editor) ClearExportOutput()

ClearExportOutput clears the Export panel's Output log.

func (e *Editor) ClearExportSelectedTargets()

ClearExportSelectedTargets resets the build scope to all presets.

func (e *Editor) ClearGridMapHover()

ClearGridMapHover hides the 3D GridMap cell preview overlay when the pointer leaves the viewport.

func (e *Editor) ClearIgnoredProblems()

ClearIgnoredProblems restores all ignored problems immediately.

func (e *Editor) ClearLocalizationError()

ClearLocalizationError clears any error banner currently displayed in the Localization panel.

func (e *Editor) ClearNavPathPreview2D()

ClearNavPathPreview2D clears the active 2D navigation test-path endpoints and preview line.

func (e *Editor) ClearOutput()

ClearOutput removes all recorded entries and any panic card from the Output panel.

func (e *Editor) ClearPlayAgentActivity()

ClearPlayAgentActivity clears the viewport agent stepping pill.

func (e *Editor) ClearPluginHover2D()

ClearPluginHover2D notifies the hovered plugin tool's OnHover callback with active=false when the pointer leaves the viewport or the tool changes.

func (e *Editor) ClearPluginHover3D()

ClearPluginHover3D notifies the hovered 3D plugin tool's OnHover3D callback with active=false when the pointer leaves the viewport or the tool changes.

func (e *Editor) ClearReduceMotion()

ClearReduceMotion clears any explicit SetReduceMotion override so ReduceMotion follows the platform environment.

func (e *Editor) ClearReferences()

ClearReferences clears the active Find References target and results.

func (e *Editor) ClearRemoteConsole()

ClearRemoteConsole clears the remote console command output history.

func (e *Editor) ClearSceneOpenError()

ClearSceneOpenError dismisses the active scene-open error state.

func (e *Editor) ClearSceneOverlays()

ClearSceneOverlays removes all live scene overlay entries.

func (e *Editor) ClearSelection() bool

ClearSelection clears the entire object selection set.

func (e *Editor) ClearSketch()

ClearSketch clears all sketch marks, any pending reading card, and any active confirmation hold. It never modifies SceneDoc or Editor.History.

func (e *Editor) ClearTaskHoldState(id string)

ClearTaskHoldState clears editing/holding/blocked state on task id and triggers the hold release hook.

func (e *Editor) ClearTerrainHover()

ClearTerrainHover hides the 3D terrain brush cursor preview.

func (e *Editor) ClearTileHover()

ClearTileHover records that the mouse left the viewport, which hides the hover outline.

func (e *Editor) ClearTileSelection()

ClearTileSelection clears the active map tile region selection.

func (e *Editor) ClearTileStamp()

ClearTileStamp clears the active stamp pattern.

func (e *Editor) ClearTilesetDraftPolygon()

ClearTilesetDraftPolygon discards any in-progress polygon vertices.

func (e *Editor) ClearTilesetTileTerrain(tileID int) error

ClearTilesetTileTerrain removes local tile tileID from its terrain set as an undoable edit.

func (e *Editor) ClearToasts()

ClearToasts removes all active and queued toasts.

func (e *Editor) ClearViewportPointer()

ClearViewportPointer clears any recorded viewport pointer position.

func (e *Editor) Clip() *resource.Animation

Clip returns a copy of the animation clip open in the animation editor, or nil.

func (e *Editor) ClipDirty() bool

ClipDirty reports whether the open animation clip differs from when it was opened or last saved.

func (e *Editor) ClipError() error

ClipError returns why the open clip cannot be previewed on the scene, such as a track naming an object the scene does not have, or nil.

func (e *Editor) ClipFrameEntry(target, frame string) (AssetEntry, bool)

ClipFrameEntry resolves the atlas entry (image and source rectangle) for frame on target's sprite atlas (using ClipTarget when target is empty), for rendering timeline frame thumbnails.

func (e *Editor) ClipLoading() bool

ClipLoading reports whether the animation panel is currently loading a clip.

func (e *Editor) ClipPath() string

ClipPath returns the file the open clip was opened from or last saved to, or "".

func (e *Editor) ClipPlaying() bool

ClipPlaying reports whether the animation editor is playing the clip.

func (e *Editor) ClipTarget() string

ClipTarget returns the ID of the object the open clip plays on: its tracks with an empty target drive it.

func (e *Editor) ClipTargetAsepriteTags(target string) []string

ClipTargetAsepriteTags returns the sorted Aseprite tag names defined on target's sprite atlas (using ClipTarget when target is empty).

func (e *Editor) ClipTargetFrames(target string) []AssetEntry

ClipTargetFrames returns the frames of target's sprite atlas in sorted order (using ClipTarget when target is empty), or nil when the object has no sprite or its atlas cannot be resolved.

func (e *Editor) ClipTime() time.Duration

ClipTime returns the animation editor's playhead.

func (e *Editor) ClipTrack(target, property string) int

ClipTrack returns the index of the open clip's track for target and property, or -1.

func (e *Editor) Close() error

Close releases background resources owned by the editor, stopping any running game process, profiler client, export build, clip playback, audio audition, or play-in-editor loop.

func (e *Editor) CloseAgentReview()

CloseAgentReview closes the Review changes panel without deleting any unconfirmed files.

func (e *Editor) CloseAgentRewindPopover()

CloseAgentRewindPopover closes the rewind popover without rewinding.

func (e *Editor) CloseAgentTurnReview()

CloseAgentTurnReview closes the open inline agent turn review drawer.

func (e *Editor) CloseAskFrozenFrame()

CloseAskFrozenFrame closes the "Ask about frame N" dialog while keeping the game paused.

func (e *Editor) CloseAskInPlace()

CloseAskInPlace closes the anchored ⌘L in-place composer without sending and restores prior focus.

func (e *Editor) CloseAssetGenerator()

CloseAssetGenerator closes the Generated Assets screen and returns to the scene editor.

func (e *Editor) CloseBuildReleaseScreen()

CloseBuildReleaseScreen closes the Build and Release screen and returns to the scene editor.

func (e *Editor) CloseChangesPanel()

CloseChangesPanel closes the Changes & Commit screen and stops any audio audition started from it.

func (e *Editor) CloseClip() error

CloseClip closes the open clip as an undoable command.

func (e *Editor) CloseCodeReview()

CloseCodeReview pauses the Go code review and returns to the editor (Esc), keeping pending changes and leaving a card in the Agent panel.

func (e *Editor) CloseCommandPalette()

CloseCommandPalette closes the Command Palette dialog.

func (e *Editor) CloseConnectDialog()

CloseConnectDialog closes the Connect dialog without committing draft changes ("Later").

func (e *Editor) CloseCutscene() error

CloseCutscene closes the open cutscene timeline editor (and any open review) as an undoable command.

func (e *Editor) CloseDataTable() error

CloseDataTable closes the open data table as an undoable command.

func (e *Editor) CloseGridMap()

CloseGridMap closes the active GridMap editing session.

func (e *Editor) CloseKeychainCredentialEditor()

CloseKeychainCredentialEditor closes the inline keychain credential form inside Review uploads.

func (e *Editor) CloseLocalizations() error

CloseLocalizations closes the Localization panel as an undoable command.

func (e *Editor) CloseMaterial() error

CloseMaterial closes the Material Editor panel as an undoable command.

func (e *Editor) CloseMentionPicker()

CloseMentionPicker closes the @-mention picker without altering the composer draft.

func (e *Editor) CloseMergeConflict()

CloseMergeConflict closes the Scene Merge Conflict screen without aborting Git state (for example after FinishMerge completes or to inspect the scene).

func (e *Editor) CloseObjectContextMenu()

CloseObjectContextMenu closes the viewport/keyboard object context menu if open.

func (e *Editor) CloseParticleEmitter() error

CloseParticleEmitter closes the open particle emitter panel as an undoable command.

func (e *Editor) ClosePermissionsSettings()

ClosePermissionsSettings closes Settings › Permissions.

func (e *Editor) ClosePlaytestConfigPreview()

ClosePlaytestConfigPreview closes the inline playtest.yaml viewer drawer.

func (e *Editor) ClosePlaytestProposalReview()

ClosePlaytestProposalReview closes the inline proposal review drawer.

func (e *Editor) ClosePlaytestReport()

ClosePlaytestReport closes the Playtest Report screen and returns to the scene editor.

func (e *Editor) CloseReviewUploads()

CloseReviewUploads closes the Review uploads confirmation dialog without starting any upload.

func (e *Editor) CloseRig() error

CloseRig closes the open skeletal rig as an undoable command.

func (e *Editor) CloseRooms()

CloseRooms closes the open room map beside the scene.

func (e *Editor) CloseSettings()

CloseSettings closes the unified Settings view, cancelling any active input key capture/drag and stopping audio audition when leaving the Audio buses page.

func (e *Editor) CloseStates() error

CloseStates closes the open state machine as an undoable command.

func (e *Editor) CloseTab(index int) error

CloseTab closes the scene tab at index immediately without prompting. Closing the last remaining tab replaces it with a fresh clean untitled scene tab. It returns ErrPlaying while Play mode is active.

func (e *Editor) CloseTerrain()

CloseTerrain closes the active terrain editing session.

func (e *Editor) CloseTileset() error

CloseTileset closes the Tileset Editor panel.

func (e *Editor) CloseUsagesScreen()

CloseUsagesScreen closes the full-window Find Usages / Safe Rename screen and returns to the editor.

func (e *Editor) CloseViewport3DAgentPrompt()

CloseViewport3DAgentPrompt closes the 3D inline agent prompt.

func (e *Editor) CodeReviewHasWaitingCard() bool

CodeReviewHasWaitingCard reports whether the Agent panel should display the unconfirmed-Go waiting card (after Keep wrote YAML changes while Go files remained unconfirmed) or paused-review card.

func (e *Editor) CodeReviewOpen() bool

CodeReviewOpen reports whether the full-window Go code review screen is currently visible.

func (e *Editor) CodeReviewSession() *CodeReviewSession

CodeReviewSession returns the active Go code review session, or nil when none is active.

func (e *Editor) CodeReviewWaitingGoFiles() []string

CodeReviewWaitingGoFiles returns the project-relative paths of Go files still waiting for confirmation.

func (e *Editor) ColliderHandles3D(o *sceneformat.ObjectDoc) []ColliderHandle3D

ColliderHandles3D returns the world-space size handles of object o's 3D collider (or trigger3d if it has no collider3d). Geometry-derived shapes (convex, trimesh, heightfield) and objects without a 3D collider return nil.

func (e *Editor) Command(id string) (EditorCommand, bool)

Command returns the active command with ID id, or false if no active command has that ID.

func (e *Editor) CommandPaletteOpen() bool

CommandPaletteOpen reports whether the Command Palette dialog is currently open.

func (e *Editor) CommandScopeLabel(scope string) string

CommandScopeLabel returns the localized display name for a command scope.

func (e *Editor) Commands() []EditorCommand

Commands returns all currently active commands in deterministic order: built-in and custom commands followed by the commands of active plugins, with each command's normalized Scope and effective user shortcut applied.

func (e *Editor) CommitAndPushSelectedChanges() (CommitMilestone, error)

CommitAndPushSelectedChanges commits the currently included files and immediately pushes the branch.

func (e *Editor) CommitAndPushSelectedChangesAsync(cx *core.Scope) error

CommitAndPushSelectedChangesAsync commits locally and pushes the branch off the UI thread.

func (e *Editor) CommitMilestones() []CommitMilestone

CommitMilestones returns a copy of all commit milestones recorded during this editor session, most recent first.

func (e *Editor) CommitReviewNote() error

CommitReviewNote saves the open inline note composer's draft text onto its target change.

func (e *Editor) CommitSelectedChanges() (CommitMilestone, error)

CommitSelectedChanges stages ONLY the checked/included files and commits ONLY those paths, leaving every unchecked file untouched and uncommitted, then records a CommitMilestone in History.

func (e *Editor) CommitTilesetDraftPolygon() error

CommitTilesetDraftPolygon turns the draft polygon (at least 3 points) into a collision shape on the selected tile as one undoable edit.

func (e *Editor) CompactAgentThread() (string, error)

CompactAgentThread folds earlier requests into a concise summary while keeping the last request whole, and drops conversation token usage so the context ring reflects the compaction.

func (e *Editor) CompleteAgentPlan() error

CompleteAgentPlan finishes the active plan, attaches its step checklist to the linked AgentTurn's review, and restores the idle agent status.

func (e *Editor) CompleteAgentRequest(summary string)

CompleteAgentRequest finishes the active live request and prepares the summary/review card, explicitly noting anything that was skipped because the user denied it.

func (e *Editor) CompleteConnectDialog()

CompleteConnectDialog commits the Connect dialog choices and starting permission rules ("Done"). Choosing AgentModeNone keeps the Agent panel closed; otherwise the Agent panel opens.

func (e *Editor) CompleteTaskTurn(id string, review TaskReview) error

CompleteTaskTurn finishes task id's running turn, releases its object holds, and moves it to TaskReadyToReview with its own separate TaskReview. Queued tasks do NOT start yet; they wait until this task is kept or reverted.

func (e *Editor) ComponentConnections(objectID, component string) []int

ComponentConnections returns the indexes, in ascending order, of the scene's connections that need objectID's component: those RemoveComponent removes with it. A connection that names an event or handler bare is listed only when the component's registered type declares it.

func (e *Editor) ComponentField(objectID, component, field string) (any, bool)

ComponentField returns the value of field in the component on objectID: the value the scene sets, or else the field's registered default when a component registry is set (SetComponentRegistry). It returns false when the object does not exist, when the object has no such component, or when the field is neither set nor registered.

func (e *Editor) ComponentGizmoHandles3D(objectID string) []PickedComponentGizmo3D

ComponentGizmoHandles3D returns all 3D component gizmo handles registered for objectID's components.

func (e *Editor) ComponentRegistry() *sceneformat.ComponentRegistry

ComponentRegistry returns the registry set by SetComponentRegistry, or nil.

func (e *Editor) ComposerChips() []AgentContextChip

ComposerChips returns the currently attached context chips (excluding suggested and always chips).

func (e *Editor) ComposerDraft() string

ComposerDraft returns the current draft text staged for the agent composer (for example via Ask to add in the inspector).

func (e *Editor) ConfirmAgentRewind() error

ConfirmAgentRewind executes the rewind selected in the currently open rewind popover.

func (e *Editor) ConfirmCodeReviewFile(relPath string, confirmed bool) error

ConfirmCodeReviewFile confirms or unconfirms one Go file in the review. Confirming is refused with ErrCodeReviewChecksNotPassed until both nsgo check and nsgo test pass for the latest pending code. A confirmed file is not written to disk until KeepCodeReview runs, so it lands and undoes with the rest of the review.

func (e *Editor) ConfirmDiscardAndSwitch() error

ConfirmDiscardAndSwitch discards unsaved edits and executes the pending project switch.

func (e *Editor) ConfirmHeldPermissionLoosening(id string) error

ConfirmHeldPermissionLoosening confirms one externally loosened rule or profile change by ID in Settings › Permissions (person-only). Only that entry is loosened in effective permissions, recorded in History as the person's.

func (e *Editor) ConfirmKeepPendingTurnPrompt() error

ConfirmKeepPendingTurnPrompt keeps the pending agent turn and runs the waiting action.

func (e *Editor) ConfirmOverwriteSave() error

ConfirmOverwriteSave confirms overwriting the file that triggered SaveConflictPromptOpen.

func (e *Editor) ConfirmProposedDeletion(relPath string) error

ConfirmProposedDeletion handles the person clicking "Delete this file" on a proposed deletion. If unkept regular changes remain in the review, it marks the deletion as DeletionConfirmed ("Deletion confirmed · happens with Keep") so pressing Keep applies both together. If no unkept regular changes remain (for example after Keep all already kept the other changes), it deletes the file immediately through a reversible checkpoint command so ⌘Z restores it.

func (e *Editor) ConfirmReleaseUploads(sessionID uint64) error

ConfirmReleaseUploads starts uploading the selected artifacts from the open Review uploads dialog. Strict trust boundary:

  • Always refuses when called by an agent actor (AgentActorActive() == true), whatever the permission profile.
  • Always refuses while playing or while Start Screen / Merge Conflict screens are active.
  • Always refuses unless Review uploads is currently open and sessionID matches the active review session.
  • Validates every selected artifact path stays within the open project directory.
  • Consumes sessionID immediately so confirmation can never be replayed.
func (e *Editor) ConfirmResumeLostAgentTurn(turnID string) error

ConfirmResumeLostAgentTurn resumes a reconnected Lost turn starting at its interrupted/next step.

func (e *Editor) ConfirmRevertPendingTurnPrompt() error

ConfirmRevertPendingTurnPrompt reverts the pending agent turn and runs the waiting action.

func (e *Editor) ConfirmReviewRevertAll() error

ConfirmReviewRevertAll reverts all changes in the pending review as one reversible step so that ⌘Z (or the toast's Undo button) brings the review back.

func (e *Editor) ConfirmSaveAndSwitch() error

ConfirmSaveAndSwitch saves all unsaved edits and, if saving succeeds, executes the pending project switch.

func (e *Editor) ConnectAssetGenerator(ctx context.Context, cfg GeneratorServerConfig, transport sdkmcp.Transport) error

ConnectAssetGenerator connects an MCP asset generator server over transport (for example an in-memory transport in tests or stdio CommandTransport on desktop) and discovers its generation tool.

func (e *Editor) ConnectAssetGeneratorCommand(ctx context.Context, cfg GeneratorServerConfig) error

ConnectAssetGeneratorCommand connects a configured stdio MCP generator server process on desktop platforms.

func (e *Editor) ConnectDialogAPIKey() string

ConnectDialogAPIKey returns the draft API key entered in the Connect dialog.

func (e *Editor) ConnectDialogChoice() AgentMode

ConnectDialogChoice returns the radio choice currently highlighted inside the Connect dialog.

func (e *Editor) ConnectDialogCopied() bool

ConnectDialogCopied reports whether the install command was recently copied.

func (e *Editor) ConnectDialogOpen() bool

ConnectDialogOpen reports whether the Connect an agent dialog is open.

func (e *Editor) ConnectDialogPermissions() AgentPermissions

ConnectDialogPermissions returns the draft checkbox state inside the Connect dialog.

func (e *Editor) ConnectDialogStep() ConnectStep

ConnectDialogStep returns the step the Connect dialog is focused on.

func (e *Editor) ConnectDialogTroubleshooting() bool

ConnectDialogTroubleshooting reports whether the Connect dialog was reopened from Troubleshoot at a failed step.

func (e *Editor) ConnectProfiler(client ProfilerClient)

ConnectProfiler connects the editor's profiler to client, polling game_perf_readout and game_perf_zones while connected. Any previously connected profiler client is closed first. Passing nil disconnects the profiler.

func (e *Editor) ConnectRemote(ctx context.Context, transport sdkmcp.Transport) error

ConnectRemote connects the editor as an MCP client over transport, performs an initial refresh of scenes, layers, entities, loop status, and tunables, switches the scene tree to the Remote tab, and starts background refreshing while connected.

func (e *Editor) ConnectRemoteCommand(ctx context.Context, dir string, extraArgs ...string) error

ConnectRemoteCommand connects the editor to a running game via `go tool nsgo mcp` in dir (defaulting to the open project's directory when dir is empty).

func (e *Editor) ContextBreakdownOpen() bool

ContextBreakdownOpen reports whether the context ring breakdown popover is open.

func (e *Editor) ContextMeter() ContextMeterSnapshot

ContextMeter computes the live context ring percentage, warning level, and 6-category breakdown.

func (e *Editor) ContinueAgentWithHint(turnID string) error

ContinueAgentWithHint resumes a paused Stuck turn with the user's hint.

func (e *Editor) ContinueGridMapStroke(sx, sy float32)

ContinueGridMapStroke extends an active GridMap stroke to viewport pixel (sx, sy).

func (e *Editor) ContinueTerrainStroke(worldX, worldZ float32)

ContinueTerrainStroke extends the active terrain brush stroke from its previous world position to (worldX, worldZ), interpolating dabs along the segment so fast drags remain smooth without gaps.

func (e *Editor) ContinueTerrainStrokeAt(sx, sy, w, h float32)

ContinueTerrainStrokeAt raycasts pixel (sx, sy) against the open terrain and extends the active brush stroke to the hit point.

func (e *Editor) ContinueTileStroke(x, y float32)

ContinueTileStroke carries the stroke under way on from the pointer's last point to the canvas point (x, y). For Paint, Erase and Terrain it edits every cell the straight line crosses; for Rect, Line, Stamp, Random and SelectRegion it updates the live preview without mutating the scene document; for Pick it picks the tile at (x, y).

func (e *Editor) ConvertOccluderToPolygon(objectID string) error

ConvertOccluderToPolygon converts objectID's occluder2d component to shape "polygon", seeding its points from the current rect dimensions when points is empty, in one undoable step.

func (e *Editor) CopyConnectInstallCommand()

CopyConnectInstallCommand copies `go tool game mcp install` to the clipboard.

func (e *Editor) CopyFirstRunDiagnostics() string

CopyFirstRunDiagnostics copies a safe diagnostic report (never containing any API key) to the clipboard and marks the Copy diagnostics button as Copied in place.

func (e *Editor) CopyObjectYAML(id string) (string, int, error)

CopyObjectYAML serializes object id in canonical sceneformat YAML, writes it to the clipboard (via WriteClipboard when set, otherwise the attached scope's system clipboard), caches it for Paste, updates Status, and displays the toast "Copied <name> as YAML · N lines".

func (e *Editor) CopyObjects(ids ...string) (string, error)

CopyObjects encodes the objects named by ids (with their children, components, properties, and the connections among them) as valid scene-format YAML, writes it to the system clipboard, and returns the YAML string.

func (e *Editor) CopyPRDescription() (string, error)

CopyPRDescription builds the structured PR description and places it on the clipboard (or Editor.ChangesClipboard / WriteClipboard when set).

func (e *Editor) CopySelected() (string, error)

CopySelected copies the currently selected object(s) to the system clipboard as scene-format YAML.

func (e *Editor) CopySelectedTileRegion() (TileStamp, error)

CopySelectedTileRegion copies the active TileSelection on ActiveLayer into the tile clipboard and active stamp.

func (e *Editor) CopySelectedYAML() (string, int, error)

CopySelectedYAML copies the currently selected object as canonical sceneformat YAML.

func (e *Editor) CopyTileRegion(layer string, col0, row0, col1, row1 int) (TileStamp, error)

CopyTileRegion copies the inclusive rectangle from (col0, row0) to (col1, row1) on layer's inline tilemap into the editor's tile clipboard and active stamp, returning a copy of the captured TileStamp.

func (e *Editor) CopyWebBuildURL() (string, error)

CopyWebBuildURL copies the active LAN web build URL (or web preset TestURL) to the clipboard.

func (e *Editor) CorrectSketchMark(number int) error

CorrectSketchMark answers "Correct a mark" on the active sketch reading, reopening sketch mode with that exact mark selected (defaulting to mark 1 if number <= 0) while keeping the hold gate active.

func (e *Editor) CountSceneInstances(scenePath string) (instances, scenes int)

CountSceneInstances counts how many objects across the open project (or open tabs when no project is open) instance scenePath, returning (totalInstances, affectedScenes). Disk-backed scene files are scanned once per (ProjectPath, filesRev, scenesRev) and overlaid with all open tabs' live in-memory documents.

func (e *Editor) CreateBrief(b project.Brief) error

CreateBrief creates or replaces brief.yaml with b as one undoable step.

func (e *Editor) CreateMaterialFile(relPath string) (string, error)

CreateMaterialFile writes a new canonical *.material.yaml file at relPath inside the open project (appending ".material.yaml" when needed), refuses to overwrite an existing file (ErrFileExists), and opens it in the Material Editor panel. It returns the written project-relative path.

func (e *Editor) CreateObjectMaterial(objectID, relPath string) (string, error)

CreateObjectMaterial creates a new *.material.yaml file in the open project (picking a free materials/<objectID>.material.yaml path when relPath is empty), assigns it to objectID when the resolver can load materials, and opens it in the Material Editor panel. It returns the created project-relative path.

func (e *Editor) CreateProjectErr() error

CreateProjectErr returns any error from the latest Start Screen project creation run.

func (e *Editor) CreateProjectFromStartScreen() error

CreateProjectFromStartScreen starts project creation using the current Start Screen form values, asking about unsaved edits first when another project or scene has unsaved changes.

func (e *Editor) CreateProjectOutput() []string

CreateProjectOutput returns the streamed output lines from the latest Start Screen project creation run.

func (e *Editor) CreatingProject() bool

CreatingProject reports whether a Start Screen `game new` command is currently running.

func (e *Editor) CrossfadeRig(toAnim string, duration time.Duration) error

CrossfadeRig initiates a smooth crossfade into toAnim over duration through the runtime skeletal.Skeleton.Crossfade.

func (e *Editor) CurrentAgentTurn() (AgentTurnSnapshot, bool)

CurrentAgentTurn returns a read-only snapshot of the current (or most recently kept/reverted) multi-file agent turn.

func (e *Editor) CustomShortcutCount() int

CustomShortcutCount returns the number of user shortcut overrides that differ from command defaults.

func (e *Editor) CutObjects(ids ...string) (string, error)

CutObjects copies the objects named by ids to the system clipboard as scene-format YAML and removes the originals (with their connections) in one undoable step.

func (e *Editor) CutSelected() (string, error)

CutSelected cuts the currently selected object(s) to the system clipboard in one undoable step.

func (e *Editor) CutSelectedTileRegion() (TileStamp, error)

CutSelectedTileRegion cuts the active TileSelection on ActiveLayer into the tile clipboard and active stamp as one undoable step.

func (e *Editor) CutTileRegion(layer string, col0, row0, col1, row1 int) (TileStamp, error)

CutTileRegion copies the inclusive rectangle from (col0, row0) to (col1, row1) into the tile clipboard and active stamp, and clears those cells on layer's inline tilemap in one undoable command.

func (e *Editor) Cutscene() *cutscene.Cutscene

Cutscene returns a copy of the cutscene currently displayed by the timeline editor (the effective Before/After/edited review document while a review is open, or the open cutscene otherwise), or nil when none is open.

func (e *Editor) CutsceneActiveDialogue() cutscene.DialogueLine

CutsceneActiveDialogue returns the dialogue line active at the current playhead time.

func (e *Editor) CutsceneBase() *cutscene.Cutscene

CutsceneBase returns a copy of the underlying cutscene document before any uncommitted review changes, or nil.

func (e *Editor) CutsceneCameraLabel() string

CutsceneCameraLabel returns the preview stage's camera caption (for example "Camera · pan to knight · 640 × 360").

func (e *Editor) CutsceneChangeFocused(index int) bool

CutsceneChangeFocused reports whether change index owns the currently selected clip.

func (e *Editor) CutsceneClipManuallyEdited(trackIdx, clipIdx int) bool

CutsceneClipManuallyEdited reports whether the clip at (trackIdx, clipIdx) has a manual edit joined to the open review.

func (e *Editor) CutsceneClipReviewStatus(trackIdx, clipIdx int) CutsceneChangeKind

CutsceneClipReviewStatus returns whether the clip at (trackIdx, clipIdx) was added, changed, or unchanged in the active review view.

func (e *Editor) CutsceneDirty() bool

CutsceneDirty reports whether the open cutscene differs from its last opened or saved YAML bytes, or has an uncommitted agent review open.

func (e *Editor) CutsceneError() error

CutsceneError returns why the open cutscene cannot be previewed on the scene, or nil.

func (e *Editor) CutsceneHandleKeyEvent(ev core.KeyEvent, down bool) bool

CutsceneHandleKeyEvent handles cutscene timeline keyboard shortcuts: hold B to peek Before during an open review, Space to play/pause, Left/Right arrows to scrub ±0.1 s (Shift ±0.5 s). It ignores events during Play mode and never swallows modifier chords (Cmd/Ctrl/Alt).

func (e *Editor) CutsceneLength() time.Duration

CutsceneLength returns the length of the currently displayed timeline cutscene, or 0 for none/video.

func (e *Editor) CutsceneLineText(id string) (en, zh string)

CutsceneLineText resolves the English and Chinese text for a dialogue line ID from the localization catalog.

func (e *Editor) CutsceneLines() []CutsceneLineEntry

CutsceneLines returns the localized dialogue lines referenced by the open cutscene (or its active review), each with its ID, English text, Chinese text, and whether it was added by the open review.

func (e *Editor) CutsceneLocPaths() (enPath, zhPath string)

CutsceneLocPaths returns the display paths for English and Chinese localization tables (defaulting to "loc/en.yaml" and "loc/zh.yaml").

func (e *Editor) CutsceneOpen() bool

CutsceneOpen reports whether a cutscene document is open in the cutscene timeline editor.

func (e *Editor) CutscenePath() string

CutscenePath returns the file path the open cutscene was loaded from or saved to, or "".

func (e *Editor) CutscenePlaying() bool

CutscenePlaying reports whether cutscene timeline preview playback is active.

func (e *Editor) CutscenePreviewPlayer() *cutscene.TimelinePlayer

CutscenePreviewPlayer returns the active cutscene.TimelinePlayer used to pose the preview scene, or nil.

func (e *Editor) CutscenePreviewScene() *sceneformat.BuiltScene

CutscenePreviewScene returns the BuiltScene posed by the cutscene TimelinePlayer at CutsceneTime, or nil.

func (e *Editor) CutsceneReviewChanges() []CutsceneChange

CutsceneReviewChanges returns a copy of the changes in the open cutscene review.

func (e *Editor) CutsceneReviewHasManualEdits() bool

CutsceneReviewHasManualEdits reports whether the person has edited any clip during the open review.

func (e *Editor) CutsceneReviewKeptCount() (kept, total int)

CutsceneReviewKeptCount returns how many changes are currently kept out of total in the open review.

func (e *Editor) CutsceneReviewOpen() bool

CutsceneReviewOpen reports whether a cutscene agent review is currently open.

func (e *Editor) CutsceneReviewPeekingBefore() bool

CutsceneReviewPeekingBefore reports whether the user is holding B to peek at Before.

func (e *Editor) CutsceneReviewPrompt() string

CutsceneReviewPrompt returns the prompt string associated with the open cutscene review, or "".

func (e *Editor) CutsceneReviewShowingBefore() bool

CutsceneReviewShowingBefore reports whether the cutscene preview and timeline are currently displaying the Before state (either toggled to Before or peeking with B).

func (e *Editor) CutsceneReviewViewMode() CutsceneReviewView

CutsceneReviewViewMode returns whether the review toggle is set to Before or After.

func (e *Editor) CutsceneThumbs() []CutsceneThumbSample

CutsceneThumbs returns the sampled thumbnail frames across the cutscene timeline for the scrub strip.

func (e *Editor) CutsceneTime() time.Duration

CutsceneTime returns the cutscene timeline's current playhead position.

func (e *Editor) CycleDataTableReviewSort(col string) SortOrder

CycleDataTableReviewSort cycles col through ascending -> descending -> file order (none).

func (e *Editor) CycleMentionPickerGroup(delta int) MentionGroup

CycleMentionPickerGroup advances (+1) or rewinds (-1) the active group tab (Tab / Shift+Tab).

func (e *Editor) CycleRegion(delta int) EditorRegion

CycleRegion moves keyboard focus to the next (+1) or previous (-1) visible editor region in Spec order (Header -> Scene tree -> Viewport -> Inspector -> Status bar -> Toast), drawing the region's inset ring and restoring its last focused control.

func (e *Editor) Dark() bool

Dark reports whether the editor is currently shown in dark appearance: when a UI scope is attached it reflects cx.Dark() (combining SetAppearance, SetSubtreeAppearance, and the system appearance); otherwise it reports Appearance() == AppearanceDark.

func (e *Editor) DataTable() *datatable.Document

DataTable returns a copy of the YAML data table open in the Data Table panel, or nil.

func (e *Editor) DataTableColumns() []DataTableColumn

DataTableColumns returns the grid columns for the open data table: the union of all rows' keys in deterministic first-appearance order, followed by any columns declared by the registered Go row type that no row currently sets.

func (e *Editor) DataTableDirty() bool

DataTableDirty reports whether the open data table differs from when it was opened or last saved.

func (e *Editor) DataTableError() error

DataTableError returns the most recent validation error from editing the open data table, or nil.

func (e *Editor) DataTableFilter() string

DataTableFilter returns the current grid view filter query.

func (e *Editor) DataTableLoading() bool

DataTableLoading reports whether the Data Table panel is currently loading.

func (e *Editor) DataTablePath() string

DataTablePath returns the file path or name of the open data table, or "".

func (e *Editor) DataTableReviewActiveFileIndex() int

DataTableReviewActiveFileIndex returns the 0-based index of the currently selected file in the review.

func (e *Editor) DataTableReviewAllRecords() []DataTableReviewRecord

DataTableReviewAllRecords returns all records in the active review file in current file order, ignoring the UI filter chip, search query, and sort order.

func (e *Editor) DataTableReviewAriaSort(col string) string

DataTableReviewAriaSort returns the WAI-ARIA aria-sort value ("ascending", "descending", or "none") for col.

func (e *Editor) DataTableReviewChecks() []DataTableReviewCheck

DataTableReviewChecks returns a copy of the agent's named check figures on the active review.

func (e *Editor) DataTableReviewChecksOutOfDate() bool

DataTableReviewChecksOutOfDate reports whether the person has reverted, edited, or reordered records since the agent's check figures were last attached or refreshed.

func (e *Editor) DataTableReviewChipCounts() (all, changed, unchanged, reverted, yours int)

DataTableReviewChipCounts returns counts for All, Changed, Unchanged, Reverted, and Yours in the active file.

func (e *Editor) DataTableReviewColumns() []DataTableReviewColumn

DataTableReviewColumns returns the display columns for the active review file. When both `id` and `name` exist and `id` has no changes, `name` serves as the primary display column (and `kind`, when unchanged, is folded alongside `name` as in ReviewData.dc.html); any changed column is always kept visible.

func (e *Editor) DataTableReviewEditDraft() string

DataTableReviewEditDraft returns the in-progress text in the active inline cell editor.

func (e *Editor) DataTableReviewError() error

DataTableReviewError returns the most recent inline validation error in the active review file, if any.

func (e *Editor) DataTableReviewFiles() []DataTableReviewFileSummary

DataTableReviewFiles returns summaries of all data table files in the active review turn.

func (e *Editor) DataTableReviewFilter() DataTableReviewFilter

DataTableReviewFilter returns the active filter chip for the selected file.

func (e *Editor) DataTableReviewFocusKey() string

DataTableReviewFocusKey returns the focused record key in the active file, or "".

func (e *Editor) DataTableReviewFocusedYAML() (string, []DataTableReviewYAMLLine)

DataTableReviewFocusedYAML returns the header title and +/- YAML diff lines for the focused record (or the empty file's YAML lines when the active file has 0 records).

func (e *Editor) DataTableReviewKeptCount() (kept, total int)

DataTableReviewKeptCount returns the total kept changed records and total changed records across all files in the review.

func (e *Editor) DataTableReviewOpen() bool

DataTableReviewOpen reports whether the full-window Data Table review screen is currently visible.

func (e *Editor) DataTableReviewPaused() bool

DataTableReviewPaused reports whether a Data Table review is currently paused in the background.

func (e *Editor) DataTableReviewPending() bool

DataTableReviewPending reports whether a Data Table review is active (either open or paused with Esc).

func (e *Editor) DataTableReviewPrompt() string

DataTableReviewPrompt returns the quoted request prompt of the active review, or "".

func (e *Editor) DataTableReviewSearch() string

DataTableReviewSearch returns the text filter query for the active file.

func (e *Editor) DataTableReviewSnapshot() DataTableReviewSnapshot

DataTableReviewSnapshot returns a full read-only snapshot of the active Data Table review.

func (e *Editor) DataTableReviewSort() (string, SortOrder)

DataTableReviewSort returns the active file's sort column and direction.

func (e *Editor) DataTableReviewUserEditCount() int

DataTableReviewUserEditCount returns the total number of records edited or reordered by the person across all files.

func (e *Editor) DataTableReviewVisibleRecords() []DataTableReviewRecord

DataTableReviewVisibleRecords returns the records visible in the active file after applying the active chip filter, text search query, and sort column/direction.

func (e *Editor) DataTableRowType() *datatable.RowType

DataTableRowType returns the registered Go row type active for the open data table, or nil.

func (e *Editor) DataTableRowTypeFor(path string) *datatable.RowType

DataTableRowTypeFor returns the registered RowType matching path, or nil.

func (e *Editor) DataTableSort() (string, SortOrder)

DataTableSort returns the grid view's current sort column and direction.

func (e *Editor) DataTableViewRows() []int

DataTableViewRows returns the 0-based document row indices currently visible after applying the active filter and sort without mutating the document's row order.

func (e *Editor) DefaultInputBinding(kind string) (project.Binding, error)

DefaultInputBinding returns a valid default project.Binding of kind sized sensibly for the project's virtual display.

func (e *Editor) DefaultShortcut(cmdID string) string

DefaultShortcut returns the registered default primary shortcut for cmdID.

func (e *Editor) DeferFirstRunConnect()

DeferFirstRunConnect handles the Later button on Connect in place, returning to Start while keeping idea and name.

func (e *Editor) DeleteAgentAPIKey(account string) error

DeleteAgentAPIKey removes the built-in model API key from NSGo's core.Secrets / system keychain. Refused when invoked by an agent.

func (e *Editor) DeleteAgentFile(relPath string) error

DeleteAgentFile records relPath's pre-turn bytes into the active checkpoint (if any) before removing relPath from the open project. Refuses You-only files, symlinks, paths outside the project root, and edits while playing or previewing history.

func (e *Editor) DeleteAudioBus(name string) error

DeleteAudioBus removes the named bus from game.yaml's audio.buses through EditProject.

func (e *Editor) DeleteClipEvent(i int) error

DeleteClipEvent deletes event i of the open clip as an undoable command.

func (e *Editor) DeleteDataTableRow(row int) error

DeleteDataTableRow deletes row (0-based) from the open data table as an undoable command.

func (e *Editor) DeleteInputAction(name string) error

DeleteInputAction removes an action from game.yaml's input.actions through EditProject. If an axis still reads the action, project.Validate refuses the edit and nothing changes.

func (e *Editor) DeleteInputAxis(index int) error

DeleteInputAxis removes input.axes[index] through EditProject.

func (e *Editor) DeleteInputGamepadAxis(index int) error

DeleteInputGamepadAxis removes input.gamepadAxes[index] through EditProject.

func (e *Editor) DeleteInputMotionAxis(index int) error

DeleteInputMotionAxis removes input.motionAxes[index] through EditProject.

func (e *Editor) DeleteKey(track, key int) error

DeleteKey deletes key key on track track as an undoable command; deleting a track's last key removes the track.

func (e *Editor) DeleteObject(id string) error

DeleteObject removes the object with ID id, a top-level object or a nested child, from the scene as an undoable command, together with the scene's connections from or to it, its descendants or the objects of scenes they instance; undoing it puts them back where they were.

func (e *Editor) DeleteProperty(objectID, key string) error

DeleteProperty removes key from objectID's Properties map through History.

func (e *Editor) DeletePublishCredential(dest PublishDestination) error

DeletePublishCredential removes the stored credential for dest from the system keychain.

func (e *Editor) DeleteRigAnimation(name string) error

DeleteRigAnimation removes animation name from the open rig as an undoable command.

func (e *Editor) DeleteRigBone(name string) error

DeleteRigBone deletes bone name from the open rig as an undoable command. Child bones are reparented to name's parent and bone timelines for name are removed. It refuses to delete a bone that still has slots bound to it.

func (e *Editor) DeleteRigBoneKeyframe(anim, bone, track string, index int) error

DeleteRigBoneKeyframe deletes keyframe index from bone's track ("translate", "rotate", or "scale") in anim as an undoable command.

func (e *Editor) DeleteRigSkin(name string) error

DeleteRigSkin deletes skin name from the open rig as an undoable command.

func (e *Editor) DeleteRigSlot(name string) error

DeleteRigSlot removes slot name and its entries in skins and animations as an undoable command.

func (e *Editor) DeleteRigSlotKeyframe(anim, slot, track string, index int) error

DeleteRigSlotKeyframe deletes keyframe index from slot's track ("attachment" or "alpha") in anim as an undoable command.

func (e *Editor) DeleteRoom(id string) error

DeleteRoom removes the room with ID id from the open room map as an undoable command.

func (e *Editor) DeleteSelected() error

DeleteSelected deletes the currently selected object(s) as one undoable step. When nothing is selected, it returns nil without modifying history.

func (e *Editor) DeleteSketchMark(number int) bool

DeleteSketchMark removes the 1-based mark and renumbers remaining marks sequentially.

func (e *Editor) DeleteTilesetTileProperty(tileID int, key string) error

DeleteTilesetTileProperty removes custom property key from tileID as an undoable edit.

func (e *Editor) DeniedPermissionKeys() []string

DeniedPermissionKeys returns a sorted copy of permission keys denied in the current request.

func (e *Editor) DenyPermission() bool

DenyPermission denies the open permission card, records the denial for this request so the agent will never retry it automatically, marks the step with "Allow now", and lets the agent continue.

func (e *Editor) DetectSceneMergeConflicts() ([]string, error)

DetectSceneMergeConflicts checks the open project's Git repository (or dir when given) for an in-progress merge with unmerged scene YAML files, returning their slash-separated paths relative to the Git repository root.

func (e *Editor) DetectedLocalAgents() []FirstRunAgentOption

DetectedLocalAgents returns the cached list of local agent detection results (Claude Code, Codex, API key), running detection lazily on first call without notifying listeners (safe to read inside render closures). Call RefreshDetectedLocalAgents to re-scan the machine and notify UI listeners.

func (e *Editor) DetectedMergeConflicts() []string

DetectedMergeConflicts returns the slash-separated paths of unmerged scene files last detected in the open project's Git repository.

func (e *Editor) DiscardAgentTurnReview(turnID string) bool

DiscardAgentTurnReview reverts all unkept undo steps recorded since the turn began and marks the review discarded.

func (e *Editor) DiscardEmptyAgentTurn()

DiscardEmptyAgentTurn closes an active agent turn when it has recorded no scene changes (for example after a refused MCP edit).

func (e *Editor) DiscardPermissionsDraft()

DiscardPermissionsDraft closes the open permissions draft card without modifying any rule or file on disk.

func (e *Editor) DiscardRemoteLiveChanges() error

DiscardRemoteLiveChanges reverts every pending live change in the running game (when connected) and clears the RemoteLiveChanges list.

func (e *Editor) DisconnectAllAssetGenerators()

DisconnectAllAssetGenerators closes every connected MCP generator server session.

func (e *Editor) DisconnectAssetGenerator(name string) error

DisconnectAssetGenerator closes and disconnects the named MCP generator server.

func (e *Editor) DisconnectProfiler() error

DisconnectProfiler stops live polling and closes the connected profiler client, preserving recorded frames so the user can inspect or export them.

func (e *Editor) DisconnectRemote() error

DisconnectRemote closes any active remote MCP client session and stops background polling. Any unkept RemoteLiveChanges are preserved so the author can still keep them in the scene or discard them after stopping.

func (e *Editor) DiskCompareOpen() bool

DiskCompareOpen reports whether the per-object Compare merge picker is open for an external scene conflict.

func (e *Editor) DiskConflicts() []DiskConflict

DiskConflicts returns all currently unresolved external-change conflicts in deterministic order (scene, project, clip).

func (e *Editor) DiskReloadDiffOpen() bool

DiskReloadDiffOpen reports whether the quiet reload diff drawer is expanded.

func (e *Editor) DiskReloadNotice() (DiskReloadNotice, bool)

DiskReloadNotice returns the latest quiet external reload notice, if not dismissed.

func (e *Editor) DismissAgentAttachError()

DismissAgentAttachError clears the composer's attachment refusal banner.

func (e *Editor) DismissAgentPinNotice()

DismissAgentPinNotice hides the Pin to brief confirmation card without undoing the pin.

func (e *Editor) DismissAgentPlan()

DismissAgentPlan clears any active plan without writing any files.

func (e *Editor) DismissAgentRewindBanner()

DismissAgentRewindBanner hides the post-rewind banner without redoing.

func (e *Editor) DismissAgentTurnReview(turnID string) error

DismissAgentTurnReview dismisses a Ready-to-review automation turn without reverting anything that was never kept. Refuses agent actors (ErrAutomationYouOnly).

func (e *Editor) DismissBlockedPermission(id string)

DismissBlockedPermission removes the blocked step with id from the editor's list.

func (e *Editor) DismissDiskReloadNotice()

DismissDiskReloadNotice clears the quiet external reload notice.

func (e *Editor) DismissPermissionToast()

DismissPermissionToast hides the active permission toast without changing saved rules.

func (e *Editor) DismissPlaytestProposal(id string) error

DismissPlaytestProposal dismisses a pending playtest_define proposal without modifying playtest.yaml.

func (e *Editor) DismissProposedFix(fixID string)

DismissProposedFix removes a pending proposed fix without applying it.

func (e *Editor) DismissResumeLostAgentTurn(turnID string)

DismissResumeLostAgentTurn declines resuming a reconnected Lost turn while keeping its review intact.

func (e *Editor) DismissSelectedTasks() int

DismissSelectedTasks dismisses every checked Ready to review task together, reverting nothing that was kept.

func (e *Editor) DismissSuggestedRule(id string)

DismissSuggestedRule hides suggestion id from SuggestedProjectRules.

func (e *Editor) DismissTasks(ids []string) int

DismissTasks dismisses one or more Ready to review or Failed tasks from the list. Dismissing NEVER reverts anything that was kept (nor mutates kept scene edits or undo history).

func (e *Editor) DismissToast()

DismissToast removes the currently visible toast and advances the queue.

func (e *Editor) DismissToastByID(id string)

DismissToastByID removes the toast with id from the visible slot or waiting queue.

func (e *Editor) DocReviews() []DocReview

DocReviews returns a copy of all DocReviews (pending, kept, and reverted).

func (e *Editor) DockAreaRef() *dock.AreaRef

DockAreaRef returns the mounted ui.DockArea's AreaRef, or nil when EditorView is not mounted.

func (e *Editor) DockLayout() dock.Layout

DockLayout returns the effective dock.Layout currently displayed by ui.DockArea.

func (e *Editor) DraftAutomationFromWords(words string) (*AutomationDraft, error)

DraftAutomationFromWords asks the agent/drafter to turn plain words into a reviewable AutomationRule draft. The draft is never written to automations.yaml until the author calls KeepAutomationDraft.

func (e *Editor) DraftReleaseNotes() (ReleaseNotesDraft, error)

DraftReleaseNotes reads git commits since the last release tag (or initial commit), kept reviews, and changelog fragments, drafts player-facing Markdown via Editor.ReleaseNotesDrafter or DefaultReleaseNotesDraft, and writes the result directly to the release notes Markdown file read by `game release -release-notes`.

func (e *Editor) Dragging2D() GizmoHandle2D

Dragging2D returns the handle a 2D viewport drag in progress holds, or Handle2DNone when none is.

func (e *Editor) DraggingCameraBounds() RectHandle

DraggingCameraBounds reports the camera.bounds handle currently being dragged, or RectHandleNone.

func (e *Editor) DraggingComponentGizmo3D() bool

DraggingComponentGizmo3D reports whether a 3D component gizmo handle drag is currently in progress.

func (e *Editor) DraggingGizmo3D() bool

DraggingGizmo3D reports whether a 3D gizmo drag is currently in progress.

func (e *Editor) DraggingHandle3D() bool

DraggingHandle3D reports whether an interactive light/camera handle drag is in progress.

func (e *Editor) DraggingRig() RigHandle

DraggingRig returns the active rig handle drag, or RigHandleNone.

func (e *Editor) DraggingRoom() (string, RectHandle)

DraggingRoom reports the room ID and handle currently being dragged, or ("", RectHandleNone).

func (e *Editor) DraggingShape2D() bool

DraggingShape2D reports whether a 2D viewport component shape handle drag is currently active.

func (e *Editor) DrainAgentFollowUps() []string

DrainAgentFollowUps returns and clears any instructions added via "Add to this request" since the last drain.

func (e *Editor) DrawImageImportPreview(d *core.Drawing, size core.Size, relPath string)

DrawImageImportPreview draws the image asset, checkerboard background, slice grid overlay, and interactive pivot markers for relPath.

func (e *Editor) DrawInputRegionCanvas(d *core.Drawing, size core.Size)

DrawInputRegionCanvas draws the virtual display frame and all touch/mouse input regions scaled to size.

func (e *Editor) DrawModelPreview(d *core.Drawing, size core.Size, relPath string)

DrawModelPreview draws the 3D orbit-camera model preview for relPath onto d, including a corner orientation triad.

func (e *Editor) DrawRigViewport(d *core.Drawing, size core.Size)

DrawRigViewport draws the open skeletal rig's attachments (via the runtime skeletal.Skeleton.Draw), bone hierarchy shapes, and interactive bone and attachment-origin handles into d.

func (e *Editor) DrawTileLine(layer string, col0, row0, col1, row1, tileID int) error

DrawTileLine draws a Bresenham line from (col0, row0) to (col1, row1) on layer's inline tilemap with tileID (0 erases) as one undoable command.

func (e *Editor) DrawViewport(d *core.Drawing, size core.Size)

DrawViewport renders the active scene in 2D or 3D mode and, when in edit mode, the appropriate editor overlays (the scene camera's frame and bounds, tile grid, selection outline, the selection's transform gizmo and the active plugin tool's Draw in 2D; grid, axes, boxes and gizmo in 3D). In 2D edit mode the scene draws through the 2D view (View2D) over the whole canvas, previewing each world-space layer's parallax offset and repeat tiling as the 2D view pans; in Play mode the player's frame, the scene's virtual screen, is all that shows. size is the canvas's size, which it records (SetCanvasSize).

func (e *Editor) DrawViewport3D(d *core.Drawing, size core.Size)

DrawViewport3D renders the 3D scene view onto d. Without the GPU view (Viewport3DOnGPU) it draws the whole view: the scene's background, the XZ ground grid, the world origin axes, a depth-sorted wireframe box for every visible object (the bounds of its geometry when it draws a mesh or model, ObjectCorners3D) and the active 3D gizmo. While the GPU view draws the scene's geometry under it, d is an overlay: it leaves the background clear and draws the grid, the axes, a box for each object that draws no geometry, the selected object's box as its selection outline, the edges of the geometry's triangles in Shading3DWireframe, and the gizmo.

func (e *Editor) DrawViewportWithOverlays(d *core.Drawing, size core.Size, overlayIDs []string) error

DrawViewportWithOverlays renders the viewport like DrawViewport, temporarily using overlayIDs as the active overlay set without changing the editor's persisted overlay settings. When overlayIDs is nil, the editor's active overlay set is used; an explicit empty slice disables all viewport overlays for this draw call. Unknown overlay IDs return an error.

func (e *Editor) DropAgentReferenceFiles(uris []string) ([]AgentReferenceImage, error)

DropAgentReferenceFiles attaches one or more dropped file paths or file:// URLs onto the Agent composer. Valid PNG/JPEG/WebP files are attached as chips; unsupported files are refused with a clear reason.

func (e *Editor) DropAssetAt(assetPath string, canvasX, canvasY float32) (objectID string, swapped bool, err error)

DropAssetAt drops the sprite asset at assetPath onto viewport canvas point (canvasX, canvasY). If an existing visible unlocked object lies under (canvasX, canvasY), its sprite is swapped in one undo step and swapped is true. Otherwise, a new sprite object is placed on the active layer, snapped to AssetSnapStep, in one undo step and swapped is false.

func (e *Editor) DropAtlasFrame(atlasName, frameName string, x, y float32) (string, error)

DropAtlasFrame places a new sprite object referencing (atlasName, frameName) at world/layer coordinates (x, y) on the active layer as an undoable PlaceObject command.

func (e *Editor) DropModelFiles(uris []string, sx, sy, w, h float32) ([]string, error)

DropModelFiles places the glTF files a drop from another app names (core.View.OnFileDrop's URLs) in the 3D viewport, as the Place tool would at viewport pixel (sx, sy) of a viewport w by h, all in one undoable step, and returns the new objects' IDs. Only .gltf and .glb files inside the open project's folder, outside the folders ProjectFiles leaves out, are placed, by their paths from its root; it fails without placing anything when a URL names no such file, such as a file outside the project, a file of another kind or a web drop, which names no path.

func (e *Editor) DropObject(id, targetID string, place DropPlace) error

DropObject moves the object id, with its descendants, into the object targetID or beside it as place says, as one undoable command: what dragging a row of the scene tree onto another does. It is ReparentObject with the parent and index place names, so the object keeps its world transform and the same moves are refused.

func (e *Editor) DuplicateObject(id string) (string, error)

DuplicateObject clones object id on the same layer (and under the same parent) next to the original with fresh unique IDs for it and its descendants, rewriting internal connections and overrides to the new IDs, selects the duplicate, and returns its new ID as one undoable command.

func (e *Editor) DuplicateObjects(ids ...string) ([]string, error)

DuplicateObjects clones all objects named by ids (with their children, components, properties, internal connections, and scene overrides) next to the originals in one undoable step, allocating fresh unique IDs and rewriting connections among the duplicated objects to point at the copies. It selects the duplicates and returns their new root IDs.

func (e *Editor) DuplicateSelected() (string, error)

DuplicateSelected duplicates the currently selected object(s) in one undoable step and returns the primary duplicate's ID.

func (e *Editor) DuplicateSelectedObjects() ([]string, error)

DuplicateSelectedObjects duplicates all currently selected objects in one undoable step and returns the new root IDs.

func (e *Editor) EditAssetImportSettings(relPath, label string, edit func(f *importsettings.File)) error

EditAssetImportSettings reads the sidecar for relPath (creating an empty version 1 file when absent), applies edit, prunes empty sections, validates and encodes the result through importsettings.Encode (or removes the sidecar when every section is cleared), and writes it on disk as one undoable History step. Undo restores the exact previous sidecar bytes, or removes a sidecar that did not exist before.

func (e *Editor) EditBrief(label string, edit func(b *project.Brief)) error

EditBrief applies edit to a copy of the project's brief (creating version 1 when none exists yet), validates and encodes it in canonical YAML, writes brief.yaml when a project is open, and records the change as one undoable step in Editor.History.

func (e *Editor) EditFirstRunFromConnect()

EditFirstRunFromConnect returns from Connect in place back to Step 1 on the Start Screen, keeping idea and name.

func (e *Editor) EditMaterial(label string, edit func(m *resource.Material) error) error

EditMaterial applies edit to a copy of the open resource.Material, validates it with resource.Encode, records an undoable command on Editor.History, and applies the change live through resource.Library.Reload so the preview and every viewport object using that material update immediately.

func (e *Editor) EditParticleEmitter(label string, edit func(cfg *particles.Config) error) error

EditParticleEmitter applies edit to a copy of the currently targeted particle emitter config (root or active sub-emitter), validates it, records an undoable command, and reloads the live preview without resetting running particles.

func (e *Editor) EditPlanStep(stepNumber int) error

EditPlanStep opens (or toggles closed) the inline editor for stepNumber (1-based). Passing 0 closes the editor.

func (e *Editor) EditProject(label string, edit func(f *project.File)) error

EditProject applies edit to a copy of the open project file and, when the result passes project.Validate, makes it the project as one undoable step labeled label. An edit Validate refuses changes nothing and returns its error; so does any edit while playing (ErrPlaying) or without a project (ErrNoProject).

func (e *Editor) EditSelected(label string, fn func(id string) error) error

EditSelected executes fn for every currently selected object inside a single History.Group step labeled label, so one Undo reverts every object to its own prior state. If any call returns an error, all earlier edits in the group are rolled back and the error is returned.

func (e *Editor) EditStoppedPlan() error

EditStoppedPlan returns a stopped plan to Draft phase so the person can revise answers or steps.

func (e *Editor) EditingDataTableReviewCell() (key, col string, ok bool)

EditingDataTableReviewCell returns the record key and column currently being edited inline, if any.

func (e *Editor) EditorSettingsOpen() bool

EditorSettingsOpen reports whether the Settings view is currently open on an Editor or Agent page (General, Viewport, Shortcuts, Game brief, or Project rules).

func (e *Editor) EditorSettingsTab() EditorSettingsTab

EditorSettingsTab returns the active page in the Editor Settings dialog.

func (e *Editor) EffectiveCamera3D(w, h float32) *scene3d.Camera

EffectiveCamera3D returns the scene3d.Camera the 3D viewport currently draws through: the scene's active 3D camera when LookThroughCamera3D is true, and Camera3D.SceneCamera otherwise.

func (e *Editor) EffectiveExportTargets() []string

EffectiveExportTargets returns the build targets that an "all presets" build targets for the open project: game.yaml's BuildTargets when presets are configured, otherwise SteamPlatforms for the steam channel or DefaultPlatforms.

func (e *Editor) EffectiveGridSize() float32

EffectiveGridSize returns the active grid snap step along X, defaulting to the active layer's tile width when it has a tilemap, or 8 otherwise.

func (e *Editor) EffectiveGridStep() (stepX, stepY float32)

EffectiveGridStep returns the active (X, Y) grid snap step: GridSize when explicitly set (> 0), else the active layer's tilemap tile size when it has one, else (8, 8).

func (e *Editor) EffectiveRotationSnapDeg() float32

EffectiveRotationSnapDeg returns the active rotation snap step in degrees, defaulting to 15 when unset or non-positive.

func (e *Editor) EffectiveScaleSnapStep() float32

EffectiveScaleSnapStep returns the active scale snap step, defaulting to 0.25 when unset or non-positive.

func (e *Editor) EffectiveShortcut(cmdID string) string

EffectiveShortcut returns the active canonical shortcut for cmdID, applying any user override stored in EditorSettings.Shortcuts on top of the command's registered default.

func (e *Editor) EmitToastEvent(ev ToastEvent) *ToastHandle

EmitToastEvent routes a canonical event from the Spec's Feedback channels table to the editor's toast queue and returns a *ToastHandle for updating progress, transitioning a progress toast to success or error, canceling associated work, or dismissing it.

func (e *Editor) EnabledAutomationsCount() int

EnabledAutomationsCount returns how many automations are currently enabled.

func (e *Editor) EnabledMCPToolCount() (enabled, total int)

EnabledMCPToolCount returns how many registered MCP tools are enabled and the total registered count.

func (e *Editor) EndAgentStep()

EndAgentStep clears the objects currently touched by the agent so manual edits to them are allowed again, and moves the header state to AgentStatePendingReview when pending turn changes exist, or AgentStateIdle otherwise.

func (e *Editor) EndAgentTurn(summary string) error

EndAgentTurn marks the currently working agent turn as finished (AgentTurnPending) so the person can review, revert/restore individual changes, Keep as one undo step, or Revert.

func (e *Editor) EndCameraBoundsDrag() bool

EndCameraBoundsDrag finishes an active camera.bounds drag and commits the new bounds as a single undoable command on History. Returns true when a change was committed.

func (e *Editor) EndCameraDrag() bool

EndCameraDrag finishes an active camera handle drag and commits the new position as a single undoable command on History. It returns true when a change was committed.

func (e *Editor) EndCheckpointTurn(detail string) (*CheckpointSummary, error)

EndCheckpointTurn finalizes the currently active checkpoint turn, persists its manifest (or cleans up an empty regular turn that touched no files), enforces the checkpoint size cap, and refreshes History.

func (e *Editor) EndComponentGizmoDrag3D() bool

EndComponentGizmoDrag3D finishes an active 3D component gizmo drag and commits all edits made during the drag as one undoable step in Editor.History. Returns true when a step was committed.

func (e *Editor) EndDrag2D() bool

EndDrag2D finishes the drag in progress and records what it changed as one undoable step, which Undo takes back to the object as it was before the drag. It reports false, recording nothing, when no drag is under way or the drag changed nothing.

func (e *Editor) EndFly3D()

EndFly3D stops flying (BeginFly3D); the camera stays where it flew to. A flight that neither turned nor moved the camera, such as a plain right-click, puts back the orthographic projection it started from.

func (e *Editor) EndGizmoDrag3D() bool

EndGizmoDrag3D finishes an active 3D gizmo drag and commits a single undoable command to History. Returns true if a transform change was committed. A drag that would shear a descendant's sprite is dropped, restoring the pre-drag transform.

func (e *Editor) EndGridMapStroke()

EndGridMapStroke finishes an active GridMap stroke and commits all modified cells as one undoable History step.

func (e *Editor) EndHUDTouchDrag() error

EndHUDTouchDrag finishes an active touch control drag and writes the new offset to the screen file in one undo step.

func (e *Editor) EndHandleDrag3D() bool

EndHandleDrag3D commits an active light/camera handle drag as a single undoable History step.

func (e *Editor) EndImagePivotDrag() error

EndImagePivotDrag commits an active pivot drag to the image's *.import.yaml sidecar as one undoable History step.

func (e *Editor) EndInspectorScrub() bool

EndInspectorScrub finishes the active scrub and commits the net change as one undo step. It returns false (recording nothing) when no scrub is active or the value did not change.

func (e *Editor) EndMarquee2D() []string

EndMarquee2D finishes an active 2D marquee drag, applies the selection, and returns the resulting selected object IDs.

func (e *Editor) EndPluginDrag2D(x, y float32) bool

EndPluginDrag2D finishes an active plugin tool drag at canvas coordinates (x, y), calling OnDragEnd.

func (e *Editor) EndPluginDrag3D(sx, sy float32) bool

EndPluginDrag3D finishes an active 3D plugin tool drag at viewport pixel (sx, sy), calling OnDragEnd3D with the final pick ray.

func (e *Editor) EndRegionDrag() error

EndRegionDrag commits the dragged, resized, or newly drawn region as a single undoable EditProject step.

func (e *Editor) EndReview(kept bool)

EndReview closes the general interactive edit review. When kept is true and AutoSave is enabled, any dirty changes schedule automatic saving after AutoSaveDelay (2 s).

func (e *Editor) EndRigDrag() bool

EndRigDrag commits the active rig handle drag as a single undoable command on Editor.History.

func (e *Editor) EndRoomDrag() bool

EndRoomDrag finishes the active room drag and commits the move, resize, or newly created room as a single undoable History step. Returns true when a change was committed.

func (e *Editor) EndShapeDrag2D() bool

EndShapeDrag2D finishes the active shape drag and commits it via SetComponentField as one undoable step. It returns true when a change was recorded.

func (e *Editor) EndSketchDrag() (SketchMark, bool)

EndSketchDrag commits the in-progress sketch drag as a numbered mark in scene coordinates, or selects the clicked badge when no drag occurred.

func (e *Editor) EndTerrainStroke() bool

EndTerrainStroke completes the active terrain brush stroke and records all modified samples as a single undoable command in History. Returns true when a history entry was recorded.

func (e *Editor) EndTileStroke()

EndTileStroke ends the stroke under way, recording every cell it changed as one undo step; a stroke that changed nothing records none. A pick stroke made with the Pick tool that picked a tile makes Paint the active tool, so the picked tile paints next. A SelectRegion stroke updates TileSelection without recording an undo step.

func (e *Editor) EndViewport3DDrag()

EndViewport3DDrag finishes any active terrain brush stroke, 3D plugin tool drag, 3D handle drag, 3D component gizmo drag, 3D transform gizmo drag, or camera drag.

func (e *Editor) EnqueuePermissionRequest(eval PermissionEvaluation, summary string, onResolve func(PermissionResponse)) PendingPermissionRequest

EnqueuePermissionRequest adds a pending Ask permission request to the editor so the person can answer Allow once, Always, or Deny.

func (e *Editor) EnsureAgentRequest(prompt string) (uint64, <-chan struct{})

EnsureAgentRequest returns the active request ID and stop channel, or starts an implicit live request when an external MCP client begins calling tools while the editor is idle.

func (e *Editor) EnterAgentContext()

EnterAgentContext marks subsequent History edits executed on the editor's goroutine as authored by the agent until the matching LeaveAgentContext call. Used by editormcp while executing agent tool calls.

func (e *Editor) EnvironmentPanelOpen() bool

EnvironmentPanelOpen reports whether the Scene Environment panel is open.

func (e *Editor) EraseGridMapCell(c world3d.GridCoord) error

EraseGridMapCell clears cell c in the open GridMap as an undoable command.

func (e *Editor) EraseTerrain(layer string, col, row int, terrainName string) error

EraseTerrain removes terrain at (col, row) on layer's layered tilemap and updates its neighbors through the same autotile rules as tilemap.Tilemap.SetAutotile, as one undoable command.

func (e *Editor) EraseTile(layer string, col, row int) error

EraseTile clears the tile at (col, row) (setting its ID to 0) on layer's inline tilemap as an undoable command, on a layered grid in the tile layer ActiveTileLayer names.

func (e *Editor) EraseTileLine(layer string, col0, row0, col1, row1 int) error

EraseTileLine erases a Bresenham line from (col0, row0) to (col1, row1) as one undoable command.

func (e *Editor) EraseTileRect(layer string, col0, row0, col1, row1 int) error

EraseTileRect erases the inclusive rectangle from (col0, row0) to (col1, row1) as one undoable command.

func (e *Editor) EvaluateBuildReadiness(platform string) []BuildReadinessItem

EvaluateBuildReadiness computes and returns the readiness checklist for platform against the open project.

func (e *Editor) EvaluatePermission(req PermissionRequest) PermissionEvaluation

EvaluatePermission evaluates req against the editor's current permission rules (including held external loosenings). If the project's permissions.yaml failed to load, EvaluatePermission fails closed with PermissionDeny.

func (e *Editor) EvaluatePlanPermissions(p *AgentPlan) PlanPermissionSummary

EvaluatePlanPermissions inspects plan's live steps against the editor's active permission settings and produces the human-readable footer reason (for example "Planned because it edits Go and 3 files").

func (e *Editor) ExecuteCodeReviewCheckRun(ctx context.Context, run *CodeReviewCheckRun) (CodeReviewCheckResult, error)

ExecuteCodeReviewCheckRun runs nsgo check and nsgo test against the pending Go overlay for run. Safe to call off the editor's UI goroutine.

func (e *Editor) ExecuteCommand(id string) error

ExecuteCommand runs the active command with ID id. It returns ErrCommandNotFound if id is not active and ErrCommandDisabled if the command is disabled.

func (e *Editor) ExecutePaletteItem(id string) error

ExecutePaletteItem runs the item identified by a palette item ID returned by PaletteItems.

func (e *Editor) ExitHistoryPreview()

ExitHistoryPreview leaves point-in-time preview mode and returns the viewport to live editing.

func (e *Editor) ExpandedAgentRequestID() string

ExpandedAgentRequestID returns the ID of the folded earlier request currently expanded, or "".

func (e *Editor) ExportBuildOptionsFromPanel() ExportBuildOptions

ExportBuildOptionsFromPanel returns the ExportBuildOptions currently configured in the Export panel controls.

func (e *Editor) ExportChannel() string

ExportChannel returns the distribution channel selected in the Export panel ("" means nsgo.yaml's default).

func (e *Editor) ExportCredits() ExportCreditsReport

ExportCredits returns the most recent pre-flight credits check report.

func (e *Editor) ExportDryRun() bool

ExportDryRun reports whether the Export panel's Dry Run toggle is enabled.

func (e *Editor) ExportLastCommandLine() string

ExportLastCommandLine returns the exact POSIX-quoted `go ... tool nsgo build ...` command line from the most recent build or dry run.

func (e *Editor) ExportLastError() error

ExportLastError returns the error from the last completed or rejected release build, or nil.

func (e *Editor) ExportLastOutputDir() string

ExportLastOutputDir returns the resolved output directory of the last planned or completed build.

func (e *Editor) ExportNavWarningMeta() string

ExportNavWarningMeta returns the warning badge label for the Export page in the Settings navigation sidebar (for example "iOS" when an iOS preset needs a team ID, or "Credits" when asset credits are missing), or empty when every configured preset is ready.

func (e *Editor) ExportOutput() string

ExportOutput returns the open project's export.output directory, or empty when unset.

func (e *Editor) ExportOutputLines() []string

ExportOutputLines returns a copy of every line currently in the Export panel's Output log.

func (e *Editor) ExportOutputText() string

ExportOutputText returns the Export panel's Output log joined with newlines.

func (e *Editor) ExportPanelOpen() bool

ExportPanelOpen reports whether the Settings view is open on the Export page.

func (e *Editor) ExportPresetReadiness(platform string) (ready bool, detail string)

ExportPresetReadiness reports whether a platform export preset is ready to build ("Ready") or needs setup ("Set up"), along with a concise detail string matching docs/design/editor/Settings.dc.html.

func (e *Editor) ExportPresets() []project.Preset

ExportPresets returns a cloned slice of the open project's export presets in build order.

func (e *Editor) ExportProfilerTrace(w io.Writer) error

ExportProfilerTrace exports all recorded frames (and their zones) as Chrome/Perfetto Trace Event Format JSON through debug.Profiler.WriteChromeTrace.

func (e *Editor) ExportProfilerTraceFile(path string) error

ExportProfilerTraceFile writes the recorded profiler frames as Chrome/Perfetto Trace Event Format JSON to path.

func (e *Editor) ExportReleaseNotes() string

ExportReleaseNotes returns the release notes file path configured in the Export panel.

func (e *Editor) ExportRunning() bool

ExportRunning reports whether a release build or dry run is currently in flight.

func (e *Editor) ExportSelectedTargets() []string

ExportSelectedTargets returns the subset of targets chosen for building in the Export panel, or nil when building all presets.

func (e *Editor) ExportToastHandle() *ToastHandle

ExportToastHandle returns the active export build's *ToastHandle, or nil when no non-dry-run export is running.

func (e *Editor) ExternalEditorLabel() string

ExternalEditorLabel returns the button label for opening a file externally, such as "Open in GoLand".

func (e *Editor) ExtractLayerTilemap(layerName, refName string) error

ExtractLayerTilemap moves layerName's direct tilemap into top-level SceneDoc.Tilemaps[refName] and replaces the layer's tilemap with a Ref pointing to refName, as an undoable command. It refuses a layer without a tilemap, a layer already using Ref, an inherited base-owned layer, an empty or whitespace-padded refName, or a refName already present in SceneDoc.Tilemaps.

func (e *Editor) FailTask(id, errMsg string) error

FailTask moves task id to TaskFailed, releases its holds, and keeps it visible until opened, retried, or dismissed.

func (e *Editor) FetchingPack() string

FetchingPack names the pack the library panel is fetching from a remote library, or is empty.

func (e *Editor) FileBrowserOpen() bool

FileBrowserOpen reports whether the full Project Files browser panel is open.

func (e *Editor) FillGridMapBox(minC, maxC world3d.GridCoord, tileID uint16, orient uint8) error

FillGridMapBox fills every cell in the inclusive box [minC, maxC] with tileID and orient (0..23) in a single undoable command. Setting tileID to 0 clears the box.

func (e *Editor) FillTileRect(layer string, col0, row0, col1, row1, tileID int) error

FillTileRect fills the inclusive rectangle from (col0, row0) to (col1, row1) on layer's inline tilemap with tileID (0 erases) as one undoable command.

func (e *Editor) FilterShortcutCommands(query string, targetOS core.OS) []EditorCommand

FilterShortcutCommands returns active commands matching query across command label, description, ID, category, keywords, scope name, and effective shortcut (both canonical and platform-formatted).

func (e *Editor) FilteredHistoryEntries(filter HistoryFilter) []HistoryEntry

FilteredHistoryEntries returns the entries matching filter (or the panel's active filter when empty), newest first.

func (e *Editor) FilteredOutputEntries() []OutputEntry

FilteredOutputEntries returns the Output panel entries visible under the current Errors-only filter. It is safe to call from any goroutine.

func (e *Editor) FilteredProjectTemplates() []ProjectTemplate

FilteredProjectTemplates returns the templates matching the active Start Screen filter chip ("all", "2d", or "3d").

func (e *Editor) FindObject(id string) (*sceneformat.ObjectDoc, int, int)

FindObject locates the object with ID id anywhere in the scene, nested children included, returning it with its layer index and its index among its siblings (the children of its parent, or its layer's top-level objects). It returns nil, -1, -1 when the open scene does not hold id, as for an object only an instanced or inherited scene adds.

func (e *Editor) FindObjectUsages(id string) (ObjectUsagesResult, error)

FindObjectUsages searches the open project for usages of object id: references to its instanced Scene (when obj.Scene is set), usages of its Prefab (when obj.Prefab is set), or occurrences of its ID. Returns ErrNoProject when no project is open.

func (e *Editor) FindObjectYAMLLine(objectID string) (string, int, error)

FindObjectYAMLLine locates the 1-based line number where objectID begins in the open scene's YAML and returns (path, line, nil). When objectID is empty, it returns line 1 of the open scene. While the open scene has no unsaved edits and a file on disk, line numbers match the file on disk (preserving hand-written comments and layout); otherwise they match Editor.SaveYAML.

func (e *Editor) FindReferences(target string) ([]refs.Ref, error)

FindReferences returns every reference to target across the open project as refs.Scan reports them, preserving file, 1-based line, column, field and value. target is a slash-separated path from the project root (or a directory path, matching references to that directory or files inside it). It returns ErrNoProject when no project is open.

func (e *Editor) FindResolvedObject(id string) (*sceneformat.ObjectDoc, string)

FindResolvedObject locates object id in Editor.Doc or, for instanced and inherited objects, in the resolved BuiltScene document, returning the ObjectDoc and its layer name.

func (e *Editor) FindUsages(target string) (*UsagesReport, error)

FindUsages scans the open project for every usage of target across scenes, prefab variants, data tables, Go source files (via go/parser), and other project files.

func (e *Editor) FinishAgentToolStep(stepID, text, detail string, objects []string, failed bool)

FinishAgentToolStep marks stepID done (or failed) with its plain-words result summary.

func (e *Editor) FinishCheckpointTurnOnError(detail string) (*CheckpointSummary, error)

FinishCheckpointTurnOnError finalizes the active checkpoint turn after a failure or panic: if no files were captured (and the turn is not a pre-start task/automation checkpoint), it discards the empty checkpoint; otherwise it persists the checkpoint with detail so partial edits stay restorable.

func (e *Editor) FinishDataTableReviewCellEdit()

FinishDataTableReviewCellEdit closes the active inline cell editor.

func (e *Editor) FinishFirstRunConnect() error

FinishFirstRunConnect completes Connect in place once an agent has answered or an API key is verified, syncs the #1200 Agent mode (and persists a validated API key via Editor.Keychain when available), and immediately opens Step 3 (The first plan) without creating any project folder on disk.

func (e *Editor) FinishMerge() error

FinishMerge validates and writes the resolved scene, runs game check and a short playtest, stages the resolved scene, and commits the merge when backed by Git.

func (e *Editor) FinishReviewYAMLEdit(changeID string) error

FinishReviewYAMLEdit exits in-place YAML editing (Done). Refused with ErrReviewYAMLInvalid while the YAML does not parse.

func (e *Editor) FinishSketch()

FinishSketch exits sketch drawing mode (Done / Esc) while keeping all drawn marks on the viewport until they are sent, cleared, or kept.

func (e *Editor) FirstRunAPIKey() string

FirstRunAPIKey returns the in-memory API key input (never written to disk).

func (e *Editor) FirstRunAPIKeyStoredInKeychain() bool

FirstRunAPIKeyStoredInKeychain reports whether the validated Start with AI API key was persisted to Editor.Keychain.

func (e *Editor) FirstRunAgentConnected() bool

FirstRunAgentConnected reports whether an agent is currently connected for Start with AI, including an active MCP client or configured API-key mode from the editor's Connect an agent flow.

func (e *Editor) FirstRunAgentOptions() []FirstRunAgentOption

FirstRunAgentOptions returns the agent choices displayed in Connect in place.

func (e *Editor) FirstRunBuildState() FirstRunBuildSnapshot

FirstRunBuildState returns a snapshot of the active Building screen state.

func (e *Editor) FirstRunConnectCanFinish() bool

FirstRunConnectCanFinish reports whether the Done button on Connect in place is enabled.

func (e *Editor) FirstRunConnectStatus() FirstRunConnectStatus

FirstRunConnectStatus returns the active Connect in place status.

func (e *Editor) FirstRunConnectSteps() []FirstRunConnectStep

FirstRunConnectSteps returns the progress checklist rows for the Connect in place card.

func (e *Editor) FirstRunConnectedAgent() (kind, name string, tools int)

FirstRunConnectedAgent returns the connected agent's kind, display name, and tool count, reflecting both Start with AI Connect and active #1200 Agent/MCP connections.

func (e *Editor) FirstRunDiagnosticsCopied() bool

FirstRunDiagnosticsCopied reports whether Copy diagnostics has been clicked in the current Connect view.

func (e *Editor) FirstRunFullScreenOpen() bool

FirstRunFullScreenOpen reports whether a full-window first-run screen (Plan, Building, or Review) is active.

func (e *Editor) FirstRunPlan() *FirstRunPlan

FirstRunPlan returns a copy of the active first plan, or nil when none is active.

func (e *Editor) FirstRunPlanCanApprove() bool

FirstRunPlanCanApprove reports whether Approve is currently enabled on the first plan.

func (e *Editor) FirstRunReviewState() FirstRunReviewSnapshot

FirstRunReviewState returns a read-only snapshot of the active First Review screen.

func (e *Editor) FirstRunSelectedAgent() string

FirstRunSelectedAgent returns the selected agent kind ("claude", "codex", or "apikey") in Connect in place.

func (e *Editor) FirstRunStage() FirstRunStage

FirstRunStage returns the active stage of the Start with AI first-run flow.

func (e *Editor) FitCollider3DToBounds(objectID string) error

FitCollider3DToBounds sizes objectID's 3D collider component (collider3d, or trigger3d if it has no collider3d; creating collider3d as a box if neither is present) to match the local-space bounds of the object's 3D mesh or glTF model geometry as a single undo step.

func (e *Editor) FloodFillTile(layer string, col, row, tileID int) error

FloodFillTile runs a 4-connected BFS flood fill starting at (col, row), replacing all contiguous matching tiles with tileID in a single undoable command. On a layered grid it fills the tile layer ActiveTileLayer names, where tiles match when their IDs and flips both do, and paints tileID as PaintTile does.

func (e *Editor) FlyLook3D(dx, dy float32)

FlyLook3D turns the flying camera about its eye by a pointer's movement of dx and dy points right and down (OrbitCamera3D.Look). It does nothing unless flying, or for a movement that is not finite.

func (e *Editor) FlyMove3D(right, up, forward float32, fast bool, dt time.Duration)

FlyMove3D moves the flying camera for dt at FlySpeed3D, flyBoost3D times as fast when fast is set: right, up and forward are each -1, 0 or 1, as the held D and A, E and Q, and W and S keys say, and a diagonal moves no faster than a straight line. It does nothing unless flying, or for a direction that is not finite.

func (e *Editor) Flying3D() bool

Flying3D reports whether the 3D viewport's camera is flying (BeginFly3D).

func (e *Editor) FocusAgentTurnReview()

FocusAgentTurnReview opens the Agent panel and focuses the pending review card.

func (e *Editor) FocusComposer()

FocusComposer switches the right rail to the Agent panel and requests keyboard focus for the composer input.

func (e *Editor) FocusCutsceneReviewChange(index int)

FocusCutsceneReviewChange selects the primary clip of change index and scrubs the playhead to its start time.

func (e *Editor) FocusDataTableReviewRecord(key string)

FocusDataTableReviewRecord focuses record key in the active file so the right-hand YAML pane shows its diff.

func (e *Editor) FocusInAgentPanel() bool

FocusInAgentPanel reports whether keyboard focus is currently inside the agent panel.

func (e *Editor) FocusMergeConflict(id string) error

FocusMergeConflict focuses the conflict item with id.

func (e *Editor) FocusOpenAgentRequest()

FocusOpenAgentRequest opens the Agent panel and focuses the open waiting request or permission card.

func (e *Editor) FocusPermissionCard()

FocusPermissionCard opens the Agent panel and requests keyboard focus for the active permission card (for example when clicking the header "Waiting for you" chip).

func (e *Editor) FocusPermissionRule(index int)

FocusPermissionRule moves focus to the 0-based rule index in Settings › Permissions.

func (e *Editor) FocusPluginPanel(plugin, id string) error

FocusPluginPanel focuses and highlights the docked panel id of the active plugin.

func (e *Editor) FocusReviewChange(changeID string) bool

FocusReviewChange focuses changeID (full change ID or object ID), expands its file/kind groups if collapsed, marks it seen, and frames it.

func (e *Editor) FocusReviewFileRow(filePath string) bool

FocusReviewFileRow focuses a file header row in the left list so pressing X reverts/restores that file group.

func (e *Editor) FocusReviewKindRow(filePath string, kind ReviewChangeKind) bool

FocusReviewKindRow focuses a kind subheader row in the left list so pressing X reverts/restores that kind group.

func (e *Editor) FocusTask(id string)

FocusTask sets the focused task in the Tasks panel.

func (e *Editor) FocusTileReviewRegion(regionID string) bool

FocusTileReviewRegion focuses regionID, switches the view to After, and highlights it in the viewport.

func (e *Editor) FocusUsage(file string, refIdx int)

FocusUsage selects a file (or the MOVED entry during rename review) and reference index in the References screen.

func (e *Editor) FocusedAgentTaskID() string

FocusedAgentTaskID returns the ID of the agent task most recently opened or focused (for example by clicking a system notification).

func (e *Editor) FocusedPluginPanel() (plugin, id string, ok bool)

FocusedPluginPanel returns the plugin and ID of the last focused plugin panel, or "", "", false when none is active.

func (e *Editor) FocusedTask() (AgentTask, bool)

FocusedTask returns the currently focused task in the Tasks panel.

func (e *Editor) FocusedTaskID() string

FocusedTaskID returns the ID of the currently focused task, or empty string.

func (e *Editor) ForceSave() error

ForceSave writes dirty changes (project and scene) to disk even when the target file changed externally since it was opened or last saved.

func (e *Editor) FormatHistoryDayLabel(ts time.Time) string

FormatHistoryDayLabel returns the uppercase day group header for ts ("TODAY", "YESTERDAY", or "YYYY-MM-DD").

func (e *Editor) FormatHistoryRelativeTime(ts time.Time) string

FormatHistoryRelativeTime formats ts relative to the editor's current History clock (for example "just now", "2 min ago", "2 hr ago", "yesterday 18:12", or "2026-11-23 14:20").

func (e *Editor) FormatTaskMeta(t AgentTask) string

FormatTaskMeta builds the secondary metadata line for a task row matching Tasks.dc.html.

func (e *Editor) FrameAll2D() bool

FrameAll2D pans and zooms the 2D view to show every object of the visible layers, their inline tilemaps and the scene camera's frame, centered with a margin, keeping the view's rotation. It reports false while the scene plays.

func (e *Editor) FrameDuration(track, key int) (time.Duration, bool)

FrameDuration returns how long frame key key on track track stays visible before the next frame key (or the end of the clip for the last frame key).

func (e *Editor) FrameSelection() bool

FrameSelection centers the active 2D or 3D viewport camera on the selected object, or on all scene objects (or the origin) when nothing is selected. In 2D mode it delegates to FrameSelection2D, moving the independent editor View2D without mutating SceneDoc.Camera.

func (e *Editor) FrameSelection2D() bool

FrameSelection2D pans and zooms the 2D view to show the selected object(s) whole, centered with a margin, keeping the view's rotation. It frames everything (FrameAll2D) when nothing is selected, and reports false when there is nothing to frame or the scene plays.

func (e *Editor) GameRunning() bool

GameRunning reports whether a game child process started by RunGame or RunGameWith is currently running. It is safe to call from any goroutine.

func (e *Editor) GenerateAsset(ctx context.Context, params GenerateAssetParams) (*AssetGenerationRequest, error)

GenerateAsset invokes a connected MCP generator server, strictly decodes untrusted candidate payloads as pixels or audio in memory ONLY (writing NOTHING to disk), runs style and audio checks against brief.yaml and references, and adds or updates the request in the Generated Assets view.

func (e *Editor) GeneratedAssetLicenseError() string

GeneratedAssetLicenseError returns the last scan/parse error from RefreshGeneratedAssetLicenses, if any.

func (e *Editor) GeneratedAssetLicenses() []credits.GeneratedAssetLicense

GeneratedAssetLicenses returns the last scanned *.source.yaml license entries for the open project.

func (e *Editor) GeneratedAssetRequests() []AssetGenerationRequest

GeneratedAssetRequests returns a snapshot of all active generation requests in order.

func (e *Editor) GitPull() error

GitPull pulls from the upstream branch using fast-forward only (never creating an unintended merge commit), reloads open scenes/project state from disk, and refreshes Changes.

func (e *Editor) GitPullAsync(cx *core.Scope) error

GitPullAsync runs `git pull --ff-only` off the UI thread and posts the result back to the editor scope.

func (e *Editor) GitSwitchBranch(branch string) error

GitSwitchBranch checks out branch in the active Changes repository and reloads open scenes and project state.

func (e *Editor) Gizmo2DShown() bool

Gizmo2DShown reports whether the 2D viewport shows the transform gizmo: on the selected object(s), nested children included, in 2D, with the Select, Move, Rotate, or Scale tool, outside Play. Objects hidden or locked in the editor (SetObjectHidden, SetObjectLocked), or under one that is, have no gizmo.

func (e *Editor) GizmoDragDelta3D() string

GizmoDragDelta3D returns the formatted live drag delta shown in the status bar while a 3D transform gizmo drag is active, or empty when idle.

func (e *Editor) GizmoLength3D(pos [3]float32) float32

GizmoLength3D returns the world-space arm length / ring radius for a 3D gizmo placed at pos.

func (e *Editor) GizmoOrientation3D() math3d.Quat

GizmoOrientation3D returns the active 3D transform gizmo's world-space orientation quaternion: identity in Global space, or the primary draggable selected object's orthonormalized world orientation (including its ancestors) in Local space.

func (e *Editor) GridMap() *world3d.GridMap

GridMap returns the active editable *world3d.GridMap, or nil when none is open.

func (e *Editor) GridMapBoxPreview() (minC, maxC world3d.GridCoord, ok bool)

GridMapBoxPreview returns the inclusive [minC, maxC] cell bounds of an active Box Fill drag, if any.

func (e *Editor) GridMapDirty() bool

GridMapDirty reports whether the open GridMap differs from what it was opened from or last saved to.

func (e *Editor) GridMapDoc() (*world3d.GridMapDoc, error)

GridMapDoc exports the active editable GridMap as a canonical *world3d.GridMapDoc.

func (e *Editor) GridMapFloor() int

GridMapFloor returns the active integer floor height (Y coordinate) edited by GridMap tools.

func (e *Editor) GridMapMeshLibrary() string

GridMapMeshLibrary returns the mesh library path of the open GridMap, or empty when none is open.

func (e *Editor) GridMapOrientation() uint8

GridMapOrientation returns the currently active 3D orientation index in 0..23 for GridMap painting.

func (e *Editor) GridMapPalette() GridMapPalette

GridMapPalette returns the palette of the active editable GridMap's mesh library.

func (e *Editor) GridMapPath() string

GridMapPath returns the project-relative path (or OS file path) of the open GridMap, or empty when none is open.

func (e *Editor) GridMapStrokeActive() (GridMapTool, bool)

GridMapStrokeActive reports whether a GridMap pointer stroke is in progress and returns its tool mode.

func (e *Editor) GridMapTool() GridMapTool

GridMapTool returns the active 3D GridMap editing tool.

func (e *Editor) GridMapYAML() ([]byte, error)

GridMapYAML encodes the active editable GridMap as deterministic canonical YAML that round-trips byte-for-byte.

func (e *Editor) GroupObjects(ids ...string) (string, error)

GroupObjects wraps the objects named by ids under a new empty parent object placed at their common centre without moving any of them on screen, as one undoable step. It selects and returns the new group parent's ID.

func (e *Editor) GroupSelected() (string, error)

GroupSelected wraps the currently selected object(s) under a new empty parent object at their common centre without moving them on screen, as one undoable step.

func (e *Editor) HUDActiveScreen() *gameui.ScreenDoc

HUDActiveScreen returns a deep clone of the active ScreenDoc, or nil if no valid screen is open.

func (e *Editor) HUDActiveScreenPath() string

HUDActiveScreenPath returns the active screen's project-relative path, or "".

func (e *Editor) HUDLayoutFrames(canvasW, canvasH float32) []HUDFrameLayout

HUDLayoutFrames computes the four side-by-side device frames (Phone 19.5:9 with notch, Tablet 4:3, Desktop 16:9, Ultrawide 21:9) scaled to fit inside canvasW×canvasH, each built via gameui.BuildScreen in the active language.

func (e *Editor) HUDLayoutOpen() bool

HUDLayoutOpen reports whether the HUD and menu layout screen is currently active in EditorView.

func (e *Editor) HUDLoadErr() error

HUDLoadErr returns the parse/validation error of the active screen, or nil.

func (e *Editor) HUDLocale() string

HUDLocale returns the currently selected language tag in the HUD layout screen.

func (e *Editor) HUDLocaleStrings(locale string) map[string]string

HUDLocaleStrings returns a copy of the string map for locale.

func (e *Editor) HUDLocales() []string

HUDLocales returns the sorted list of available locales in the HUD layout screen.

func (e *Editor) HUDOverlays() HUDOverlays

HUDOverlays returns the active viewport overlay toggles.

func (e *Editor) HUDProblems() []HUDProblem

HUDProblems returns the active screen's GAME CHECK diagnostics in the active language, backed by gameui.CheckScreen.

func (e *Editor) HUDProjectName() string

HUDProjectName returns the project name displayed at the start of the HUD layout breadcrumb.

func (e *Editor) HUDScreens() []HUDScreenEntry

HUDScreens returns the list of project screens shown in the left rail's SCREENS section.

func (e *Editor) HUDSelectedNodeID() string

HUDSelectedNodeID returns the currently selected node's ID in the active screen, or "".

func (e *Editor) HUDTextWidths() []HUDTextWidthRow

HUDTextWidths computes the TEXT WIDTH, PX table for every text-bearing node in the active screen across all project locales.

func (e *Editor) HUDTouchDragActive() bool

HUDTouchDragActive reports whether a touch control drag is currently in progress.

func (e *Editor) HUDTree() []HUDTreeRow

HUDTree returns the flattened node tree for the active screen's NODES rail.

func (e *Editor) HandleAgentComposerPaste(ev core.PasteEvent) ([]AgentReferenceImage, bool, error)

HandleAgentComposerPaste processes a core.PasteEvent from the Agent composer input. Returns (attached, handled, err). Plain text pastes return (nil, false, nil) so the input inserts text normally.

func (e *Editor) HandleCanvasPress(x, y float32)

HandleCanvasPress dispatches a click/tap at canvas coordinates (x, y) according to the active ViewMode and Tool. On a locked active layer (SetLayerLocked) the Place, Paint, Erase and Fill tools change nothing and the status bar says why. With the Pick tool, a press on a painted cell makes its tile the active tile and Paint the active tool.

func (e *Editor) HandleCanvasPressWith(x, y float32, shift, mod bool)

HandleCanvasPressWith dispatches a click/tap at canvas coordinates (x, y) with optional Shift (add to selection) and Mod (toggle selection membership) modifiers.

func (e *Editor) HandleCanvasPressWithModifiers(x, y float32, shift, mod, alt bool)

HandleCanvasPressWithModifiers dispatches a click/tap at canvas coordinates (x, y) with optional Shift (add), Mod (toggle), and Alt/Option (in 3D, select the hit child's parent or instance root) modifiers.

func (e *Editor) HandleCanvasSecondaryPress(x, y float32) bool

HandleCanvasSecondaryPress handles a secondary (right-button) press at canvas coordinates (x, y) in 2D edit mode. When the press hits a polygon vertex handle on the selected object with the Select or Move tool, it removes that vertex as one undoable step and reports true.

func (e *Editor) HandleNotificationPress(id string) bool

HandleNotificationPress handles an NSGo notification press callback ID. It returns true when id names an agent task notification and opens that task in its scene.

func (e *Editor) HandlePosition3D(kind Handle3DKind) ([3]float32, bool)

HandlePosition3D returns the world-space position of handle kind on the currently selected light or 3D camera object, or false when the selected object does not expose that handle.

func (e *Editor) HandleViewport3DPress(sx, sy, w, h float32)

HandleViewport3DPress handles a click/tap in the 3D viewport: with a terrain brush active it applies a dab, with an active 3D plugin tool it calls Press3D with the camera pick ray, with the Place tool and a model selected in the asset browser (SelectedModel) it places the model where the press lands (PlaceModelAt3D), otherwise it picks the deepest closest 3D object (stepping up to parent/instance root on a repeated press) or clears selection.

func (e *Editor) HandleViewport3DPressWith(sx, sy, w, h float32, shift, mod bool)

HandleViewport3DPressWith handles a click/tap in the 3D viewport with optional Shift (add) and Mod (toggle) modifiers.

func (e *Editor) HandleViewport3DPressWithModifiers(sx, sy, w, h float32, shift, mod, alt bool)

HandleViewport3DPressWithModifiers handles a click/tap in the 3D viewport with optional Shift (add), Mod (toggle), and Alt/Option (pick parent or owning scene instance root) modifiers.

func (e *Editor) HandleViewport3DWheel(deltaY float32)

HandleViewport3DWheel zooms the 3D orbit camera proportionally to deltaY, or while the camera flies (Flying3D) changes its fly speed (AdjustFlySpeed3D).

func (e *Editor) HasActiveLiveAgentRequest() bool

HasActiveLiveAgentRequest reports whether an interactive agent request (started via StartAgentRequest or SubmitAgentPrompt) is currently active.

func (e *Editor) HasActiveToast() bool

HasActiveToast reports whether a toast is currently shown and therefore part of the F6 region cycle (RegionToast).

func (e *Editor) HasAgentAPIKey(account string) bool

HasAgentAPIKey reports whether a built-in API key is currently stored in NSGo's core.Secrets / system keychain.

func (e *Editor) HasAgentLiveOverlays() bool

HasAgentLiveOverlays reports whether any live agent change overlay or agent-working overlay is active.

func (e *Editor) HasAgentPanelCard() bool

HasAgentPanelCard reports whether the editor has a pending, kept, or reverted agent turn card to show in the right rail.

func (e *Editor) HasCustomShortcuts() bool

HasCustomShortcuts reports whether any command currently has a user shortcut override.

func (e *Editor) HasLayerOverride(layerName, fieldKey string) bool

HasLayerOverride reports whether fieldKey is overridden on inherited layerName.

func (e *Editor) HasObjectOverride(objectID, fieldKey string) bool

HasObjectOverride reports whether fieldKey is currently overridden on objectID.

func (e *Editor) HasOpenReview() bool

HasOpenReview reports whether any interactive review (scene/agent review, background task review, cutscene review, playtest proposal review, safe rename review, scene merge conflict, or unresolved external disk conflict) is currently open. Edits made inside an open review are not kept yet and are not automatically saved.

func (e *Editor) HasOpenTaskReview() bool

HasOpenTaskReview reports whether any non-dismissed background agent task is waiting in TaskReadyToReview with an unkept review. Autosave pauses while this is true so unkept task edits are never flushed to disk prematurely.

func (e *Editor) HasPendingAgentTurn() bool

HasPendingAgentTurn reports whether an agent turn is waiting for the person to Keep or Revert (including a stopped turn with partial changes, or a working turn with edits).

func (e *Editor) HasPendingAgentTurnReview() bool

HasPendingAgentTurnReview reports whether the latest agent turn left unkept, unreverted scene edits pending review.

func (e *Editor) HasPendingCodeReview() bool

HasPendingCodeReview reports whether a Go code review is open, paused, or waiting on unconfirmed Go files after Keep.

func (e *Editor) HasPendingReview() bool

HasPendingReview reports whether an agent turn review is pending (either open full-window or paused via Esc).

func (e *Editor) HasProbes3D() bool

HasProbes3D reports whether the open scene contains at least one reflection probe or light probe grid.

func (e *Editor) HasPublishCredential(dest PublishDestination) bool

HasPublishCredential reports whether a credential for dest is stored in the system keychain.

func (e *Editor) HasSceneCamera3D() bool

HasSceneCamera3D reports whether the open scene defines at least one visible 3D camera object.

func (e *Editor) HasScope() bool

HasScope reports whether a UI core.Scope is currently attached to the editor.

func (e *Editor) HasSeenTip(tipID string) bool

HasSeenTip reports whether tipID has been seen or skipped in EditorSettings.

func (e *Editor) HasUnkeptAgentTurnReview() bool

HasUnkeptAgentTurnReview reports whether an active agent run, an open inline turn review drawer, or an unkept review from a partial, lost, stopped, or mismatched turn should pause automatic saving.

func (e *Editor) HasUnsavedChanges() bool

HasUnsavedChanges reports whether any open scene tab, the shared project, GridMap, terrain, room map, tileset, localization workspace, animation clip, cutscene, data table, skeletal rig, material, or kept multi-file agent turn file has edits that are not saved (or an active failed save), which switching projects or quitting would lose.

func (e *Editor) HeldAgentNotifications() []core.Notification

HeldAgentNotifications returns a snapshot of system notifications currently held until Play stops.

func (e *Editor) HeldPermissionLoosenings() []HeldPermissionLoosening

HeldPermissionLoosenings returns a copy of externally loosened permission rules/profile changes currently held until confirmed by the person in Settings › Permissions.

func (e *Editor) HighlightedProblemLine() (loc, snippet string)

HighlightedProblemLine returns the file:line:col label and YAML line snippet highlighted by ShowProblem, or empty strings when none is highlighted.

func (e *Editor) HistoryEntries() []HistoryEntry

HistoryEntries returns all entries on the active scene's unified History timeline, newest first.

func (e *Editor) HistoryEntryByID(id uint64) (HistoryEntry, bool)

HistoryEntryByID returns the timeline entry with ID id, or false when absent.

func (e *Editor) HistoryFilter() HistoryFilter

HistoryFilter returns the active filter tab in the History panel (All, You, or Agent).

func (e *Editor) HistoryNow() time.Time

HistoryNow returns the current time according to the editor's configured History clock, Editor.Now, or time.Now.

func (e *Editor) HistoryPanelOpen() bool

HistoryPanelOpen reports whether the History timeline panel is open.

func (e *Editor) HistoryPreviewActive() bool

HistoryPreviewActive reports whether the viewport is currently showing a read-only point-in-time history preview.

func (e *Editor) HistoryPreviewCheckpointID() string

HistoryPreviewCheckpointID returns the checkpoint ID currently being previewed read-only, or "".

func (e *Editor) HistoryPreviewDoc() *sceneformat.SceneDoc

HistoryPreviewDoc returns the read-only SceneDoc currently being previewed, or nil when not previewing.

func (e *Editor) HistoryPreviewEntry() (HistoryEntry, bool)

HistoryPreviewEntry returns the entry currently being previewed read-only, if any.

func (e *Editor) HistoryPreviewScene() *sceneformat.BuiltScene

HistoryPreviewScene returns the built read-only preview scene, or nil when not previewing.

func (e *Editor) HitTest(canvasX, canvasY float32) string

HitTest returns the ID of the topmost visible object under the point (canvasX, canvasY) on the viewport's canvas, seen through the 2D view, nested, instanced and inherited objects included, or "" if no object is hit. Objects hidden or locked in the editor (SetObjectHidden, SetObjectLocked), with their descendants, and the objects of hidden and locked layers (SetLayerVisible, SetLayerLocked) are passed over, so the press reaches what lies under them.

func (e *Editor) HitTestCameraBoundsHandle(canvasX, canvasY float32) RectHandle

HitTestCameraBoundsHandle tests canvas point (canvasX, canvasY) against the 8 resize handles and perimeter border (or empty interior) of camera.bounds when scene settings are active in 2D edit mode. Resize handles are checked before the border, and the interior yields to objects and rooms so objects inside camera.bounds remain clickable.

func (e *Editor) HitTestCameraHandle(canvasX, canvasY float32) bool

HitTestCameraHandle reports whether canvas point (canvasX, canvasY) falls on the 2D viewport's camera position handle.

func (e *Editor) HitTestHUDCanvas(canvasX, canvasY, canvasW, canvasH float32) (nodeID, deviceID string)

HitTestHUDCanvas returns the topmost visible node ID and device profile ID under (canvasX, canvasY) on the multi-size canvas.

func (e *Editor) HitTestRigBone(x, y float32) string

HitTestRigBone returns the name of the bone under rig canvas point (x, y), or "".

func (e *Editor) HitTestRoom(canvasX, canvasY float32) string

HitTestRoom returns the ID of the first room in list order containing canvas point (canvasX, canvasY), matching rooms.Map.RoomAt semantics, or "" if none does.

func (e *Editor) HitTestRoomHandle(canvasX, canvasY float32) (string, RectHandle)

HitTestRoomHandle tests canvas point (canvasX, canvasY) against the selected room's 8 resize handles, then its interior/border, then any other room's interior.

func (e *Editor) HitTestSketchMark(canvasX, canvasY float32) int

HitTestSketchMark returns the 1-based mark number whose badge or geometry lies under (canvasX, canvasY), or 0 if none is hit.

func (e *Editor) HoveredChipID() string

HoveredChipID returns the chip ID currently showing its exact-payload hover popover, or "".

func (e *Editor) HoveredChipPayload() (AgentChipPayload, bool)

HoveredChipPayload resolves the exact sent payload for the currently hovered chip.

func (e *Editor) HoveredGridMapCell() (world3d.GridCoord, bool)

HoveredGridMapCell returns the GridMap cell currently under the pointer on the active floor, or false when no GridMap tool is active, in 2D, while playing, or when the ray misses the floor plane.

func (e *Editor) HoveredTile() (col, row int, ok bool)

HoveredTile returns the cell of the active layer's inline tilemap under the mouse (SetTileHover), which the viewport outlines, snapped to the grid. It reports false while no tile tool is active, in 3D, while playing, when the mouse is not over the viewport and when the cell under it is off the map.

func (e *Editor) IgnoreProblem(p assetcheck.Problem)

IgnoreProblem hides p from the Problems panel, status bar count, scene tree badges, and viewport problem overlay until p.File changes again (in the editor or on disk). If p still holds after a subsequent edit to p.File, it reappears.

func (e *Editor) ImageImportPreviewCellPoint(relPath string, cell int, pt importsettings.PivotPoint, canvasW, canvasH float32) (x, y float32, ok bool)

ImageImportPreviewCellPoint maps a normalized pivot pt inside cell (-1 for the whole image, or 0..n-1 for a sliced cell) of relPath to canvas coordinates within canvasW x canvasH.

func (e *Editor) ImagePivotDragging() bool

ImagePivotDragging reports whether an interactive pivot drag on the image import preview is currently active.

func (e *Editor) ImportAssetFiles(srcPaths []string) ([]string, error)

ImportAssetFiles copies external files (OS paths or file:// URIs) into the active asset folder (or an inferred folder such as art/props, audio/sfx, or fonts), marks them as proposed imports, and refreshes the asset drawer.

func (e *Editor) InitNavRegionPolygon(objectID string) error

InitNavRegionPolygon seeds objectID's navregion2d component with a default 128x128 square polygon through History.

func (e *Editor) InlineLayerTilemap(layerName string) error

InlineLayerTilemap moves layerName's Ref tilemap back inline onto the layer as an undoable command. When no other layer or layerOverride in the scene references the same top-level tilemap, the top-level entry in SceneDoc.Tilemaps is removed (and restored by Undo); when another layer still references it, the top-level entry is kept and this layer receives an independent inline copy.

func (e *Editor) InputActions() []project.Action

InputActions returns a deep copy of the open project's declared input actions in order.

func (e *Editor) InputAxes() []project.Axis

InputAxes returns a copy of the open project's declared action axes in order.

func (e *Editor) InputGamepadAxes() []project.GamepadAxis

InputGamepadAxes returns a copy of the open project's declared gamepad stick axes in order.

func (e *Editor) InputMapDisplaySize() (width, height float32)

InputMapDisplaySize returns the virtual display size the Input Map's region canvas maps onto: Project.Display when set, else Project.Window, else 640x360.

func (e *Editor) InputMapOpen() bool

InputMapOpen reports whether the Settings view is open on the Input map page.

func (e *Editor) InputMapRegionDrawKind() string

InputMapRegionDrawKind returns the binding kind created when dragging a new region on empty space ("touchRegion" or "mouseRegion").

func (e *Editor) InputMapTab() InputMapTab

InputMapTab returns the active tab of the Input Map panel, defaulting to InputMapTabActions.

func (e *Editor) InputMotionAxes() []project.MotionAxis

InputMotionAxes returns a copy of the open project's declared motion axes in order.

func (e *Editor) InsertAgentComposerNewline()

InsertAgentComposerNewline appends a newline to the composer draft (used by Shift+Enter).

func (e *Editor) InsertAskInPlaceNewline()

InsertAskInPlaceNewline inserts a newline into the open in-place composer draft (⇧↵).

func (e *Editor) InsertNavRegionVertex(objectID string, afterIndex int, x, y float64) error

InsertNavRegionVertex inserts a new local vertex (x, y) after vertex index afterIndex in objectID's navregion2d polygon through History.

func (e *Editor) InsertOccluderVertex(objectID string, afterIndex int, x, y float64) error

InsertOccluderVertex inserts a new local vertex (x, y) after vertex index afterIndex in objectID's polygon occluder2d component through History.

func (e *Editor) InspectAssetImport(relPath string) (AssetImportInfo, error)

InspectAssetImport returns the resolved import settings and game.yaml target defaults for relPath in the open project.

func (e *Editor) InspectModelImport(relPath string) (ModelPreviewInfo, error)

InspectModelImport loads (or reads from cache) the glTF/GLB model at relPath and returns its node hierarchy, meshes, materials, animations, bounds, and triangle counts.

func (e *Editor) InspectorFieldProblems() []InspectorFieldProblem

InspectorFieldProblems returns explicit field-level problems recorded via SetInspectorFieldProblems.

func (e *Editor) InspectorFilter() string

InspectorFilter returns the active inspector field filter query.

func (e *Editor) InspectorReviewChanges() []InspectorReviewChange

InspectorReviewChanges returns a copy of the active review changes shown in the inspector.

func (e *Editor) InspectorScrubbing() bool

InspectorScrubbing reports whether an interactive inspector label scrub is currently in progress.

func (e *Editor) InspectorSectionCollapsed(sectionID string) bool

InspectorSectionCollapsed reports whether the titled inspector section id is currently collapsed.

func (e *Editor) InstallPack(p *library.Pack) error

InstallPack installs the fetched pack p into the open project, as library.PlanInstall describes: it writes the pack's files beside game.yaml, records the pack, its autoload entries and its plugins in the project, and saves the project (SaveProject). The registered plugins a plugin pack names turn on, and the status bar names those this editor was built without.

Installing writes files the undo history cannot take back, so it empties the history, as OpenProject does; RemovePack undoes it. It refuses while playing (ErrPlaying), without a project (ErrNoProject) and while the project has unsaved edits (ErrProjectDirty), and on any error leaves the project and its files as they were.

func (e *Editor) InstanceOverrideCount(objectID string) int

InstanceOverrideCount returns the total number of overridden fields across all targets of a local scene instance root (or on the owning instance of an instanced child).

func (e *Editor) InterfaceScale() float32

InterfaceScale returns the active typography and control scale multiplier (0.9, 1.0, or 1.15).

func (e *Editor) InterfaceSize() InterfaceSize

InterfaceSize returns the configured editor interface size ("compact", "default", or "large").

func (e *Editor) IsDragging() bool

IsDragging reports whether any interactive drag, scrub, marquee, gizmo, camera drag/flight, or paint stroke is currently active in the editor. Nothing may move focus while true.

func (e *Editor) IsMCPToolEnabled(name string) bool

IsMCPToolEnabled reports whether the MCP tool named name is currently enabled for connected agents. game_delete_file is off by default; all other tools are on by default unless overridden in editor.yaml.

func (e *Editor) IsObjectPausedByPlan(id string) bool

IsObjectPausedByPlan reports whether manual edits to scene object id are paused while the agent executes a plan.

func (e *Editor) IsObjectProposedNew(id string) bool

IsObjectProposedNew reports whether object id is proposed as a new object by a pending review.

func (e *Editor) IsObjectSelected(id string) bool

IsObjectSelected reports whether id is in the current object selection.

func (e *Editor) IsPermissionDenied(permissionKey string) bool

IsPermissionDenied reports whether permissionKey was already denied in the current active request.

func (e *Editor) IsPlanRunning() bool

IsPlanRunning reports whether an approved plan is currently executing.

func (e *Editor) IsProblemIgnored(p assetcheck.Problem) bool

IsProblemIgnored reports whether p is currently ignored.

func (e *Editor) IsSelected(id string) bool

IsSelected reports whether object id is part of the current selection set.

func (e *Editor) IsTyping() bool

IsTyping reports whether keyboard focus is currently inside a text field. Nothing may steal focus while true.

func (e *Editor) JumpToConnectionOtherEnd(index int) bool

JumpToConnectionOtherEnd selects the other endpoint of Doc.Connections[index] relative to SelectedID (To when From is selected, From when To is selected, or To otherwise). If the endpoint is an object inside an instanced scene (such as "door_1/door"), it selects its owning instance in Doc.

func (e *Editor) JumpToLatestAgentRequest()

JumpToLatestAgentRequest collapses any expanded earlier request and focuses the latest request.

func (e *Editor) JumpToReviewBlocker() string

JumpToReviewBlocker focuses the first active blocker change and returns its ID (or "" if none).

func (e *Editor) JustDoItAgentPlan() (AgentPlanDecision, error)

JustDoItAgentPlan picks the suggested option for every unanswered clarifying question, records that the agent picked them ("Picked for you: ..."), and starts executing the plan.

func (e *Editor) JustDoItFirstRunPlan() error

JustDoItFirstRunPlan picks the suggested answer (when a clarifying question is unanswered) and immediately approves and starts building.

func (e *Editor) KeepAgentPartial(turnID string)

KeepAgentPartial keeps the partial turn's changes as undoable edits and dismisses the partial prompt card.

func (e *Editor) KeepAgentRequest(threadID, requestID string) error

KeepAgentRequest marks requestID in threadID as kept (keeping all proposed changes).

func (e *Editor) KeepAgentTurn() error

KeepAgentTurn commits all non-reverted changes in the pending (or working/stopped) agent turn as ONE History command labelled with the request, marks the turn Kept, and displays a Spec toast with Undo. Edits remain in memory until the person saves. When no multi-file agent turn is open, it falls back to keeping an active single-scene live agent turn (BeginAgentTurn).

func (e *Editor) KeepAgentTurnDiffReview(turnID string) bool

KeepAgentTurnDiffReview keeps the actual diff in turnID's review (never the summary) and closes the review drawer.

func (e *Editor) KeepAgentTurnReview(turnID string) error

KeepAgentTurnReview marks an automation turn's Ready-to-review result as kept by the author. Refuses agent actors (ErrAutomationYouOnly) so automations can never auto-keep or apply You-only drafts.

func (e *Editor) KeepAllReviewChanges() (KeepAllResult, error)

KeepAllReviewChanges applies Keep all (and ⌘↵) to the open review. Invariants enforced by the trust boundary (#1015):

  • NEVER applies an open You-only PermissionsDraft (regardless of profile, Autonomous included).
  • NEVER deletes any DeletionPending file; unconfirmed deletions remain on disk and stay pending for explicit confirmation.
  • Keeps all non-reverted regular changes (and any open tile review) and applies ONLY deletions the person explicitly confirmed.
func (e *Editor) KeepAutomationDraft() error

KeepAutomationDraft commits the pending natural-language automation draft into automations.yaml. Refuses agent actors (ErrAutomationYouOnly) so an automation can never apply a You-only draft.

func (e *Editor) KeepBuildingFirstRun()

KeepBuildingFirstRun dismisses the Cancel confirmation dialog and resumes building.

func (e *Editor) KeepCodeReview() error

KeepCodeReview writes all unapplied YAML files plus all confirmed Go files to disk atomically as one undo step. Unconfirmed Go files are NEVER included in Keep: if any Go files remain unconfirmed, Keep writes only the YAML (and any confirmed Go) files, closes the review screen, and leaves a waiting card in the Agent panel.

func (e *Editor) KeepCutsceneReview() error

KeepCutsceneReview applies all kept review changes (and any manual edits joined to the review) in one undo step, writing the cutscene file to disk when CutscenePath is set and closing the review.

func (e *Editor) KeepDataTableReview() error

KeepDataTableReview commits all kept record changes and user edits across every file in the active Data Table review as ONE atomic undo step, preserving untouched lines byte for byte.

func (e *Editor) KeepDocReview(id string) error

KeepDocReview accepts the pending DocReview with id, applying the change as one undoable step in Editor.History and writing the file when a project is open.

func (e *Editor) KeepFirstRunReview() error

KeepFirstRunReview finalizes the First Review, applying any reverted object removals to the open scene, saving, relinquishing temporary folder-delete ownership, and entering the normal working editor.

func (e *Editor) KeepLocalVersion(kind DiskFileKind) error

KeepLocalVersion resolves an external disk conflict for kind by keeping the editor's current in-memory document, acknowledging the current on-disk file so a subsequent Save will succeed, and recording the disk version in History as "Changed outside the editor" so Undo can inspect or revert to it.

func (e *Editor) KeepPendingAgentTurnReview()

KeepPendingAgentTurnReview keeps the latest turn's pending agent changes, resumes autosave, and shows a confirmation toast with Undo.

func (e *Editor) KeepProposedAssets()

KeepProposedAssets approves all pending proposed imports, clearing their "new" / Proposed badge.

func (e *Editor) KeepProposedFile(relPath string) error

KeepProposedFile marks a proposed deletion as DeletionKept ("The file stays · the rest of the review is unchanged").

func (e *Editor) KeepRemoteLiveChangesInScene() (int, error)

KeepRemoteLiveChangesInScene writes every live change whose entity maps to an object in the open scene (via sceneformat.ObjectRef or matching object ID) into e.Doc as a single undoable History group. One Undo restores every kept change. Applied changes are removed from RemoteLiveChanges; changes on runtime-spawned entities with no scene object remain untouched.

func (e *Editor) KeepReview()

KeepReview closes the general interactive edit review as kept and schedules automatic saving of kept changes after AutoSaveDelay (2 s).

func (e *Editor) KeepSketchReview() error

KeepSketchReview keeps the agent's scene edits from the active sketch review, closes the review, and clears the sketch layer (marks, reading card, and hold).

func (e *Editor) KeepTask(id string) error

KeepTask accepts a TaskReadyToReview turn, marks its review kept, transitions it to TaskDone, and starts the next queued task waiting for it.

func (e *Editor) KeepTileReview() (AgentTileEditResult, error)

KeepTileReview commits all non-reverted regions of the active tile review as ONE undoable step on History and closes the review. Undoing that single step restores the exact pre-review tilemap cleanly.

func (e *Editor) KeepTurnReview() error

KeepTurnReview applies all non-reverted changes across every touched file as ONE History undo step, saves them cleanly, shows a Toast with Undo, and updates the Agent panel summary. When any blocker is active, KeepTurnReview jumps to the first blocker and returns *ReviewBlockedError (which wraps ErrReviewBlocked).

func (e *Editor) KeyProperty(target, property string, at time.Duration) (track, key int, err error)

KeyProperty keys property at time at with the value it has in the scene, as an undoable command: the object's own field, its sprite frame for "sprite.frame", or a component field's value with its registered default when unset. Target is an object ID, or empty for the clip's target; a track that names the clip's target explicitly is the same track as one left empty. A track is added for a property the clip does not key yet, and a key already at that time takes the new value. A bool property's new key holds its value until the next key (resource.InterpStep). It returns the track and key indexes.

func (e *Editor) KeyRigBoneRotate(anim, bone string, at time.Duration, angle float32, curve skeletal.CurveType, bezier [4]float32) error

KeyRigBoneRotate keys bone's relative rotation angle (radians) at time at in animation anim as an undoable command.

func (e *Editor) KeyRigBoneScale(anim, bone string, at time.Duration, scaleX, scaleY float32, curve skeletal.CurveType, bezier [4]float32) error

KeyRigBoneScale keys bone's relative scale (scaleX, scaleY) at time at in animation anim as an undoable command.

func (e *Editor) KeyRigBoneTranslate(anim, bone string, at time.Duration, x, y float32, curve skeletal.CurveType, bezier [4]float32) error

KeyRigBoneTranslate keys bone's relative translation (x, y) at time at in animation anim as an undoable command.

func (e *Editor) KeyRigSlotAlpha(anim, slot string, at time.Duration, alpha float32, curve skeletal.CurveType, bezier [4]float32) error

KeyRigSlotAlpha keys slot's opacity alpha in [0, 1] at time at in animation anim as an undoable command.

func (e *Editor) KeyRigSlotAttachment(anim, slot string, at time.Duration, frame string) error

KeyRigSlotAttachment keys slot's active atlas frame (empty hides the slot) at time at in animation anim as an undoable command.

func (e *Editor) KeySpriteFrame(target, frame string, at time.Duration) (track, key int, err error)

KeySpriteFrame keys the discrete sprite.frame property on target (empty for the clip's target) with atlas frame name frame at time at, as an undoable command. When a resolver is configured, frame must exist in target's atlas.

func (e *Editor) Language() Language

Language returns the editor's configured language setting (LanguageSystem, LanguageEnglish, or LanguageChinese).

func (e *Editor) LastAgentChangeForObject(objectID string) (AgentObjectAttribution, bool)

LastAgentChangeForObject returns the most recent non-reverted agent request that modified objectID in the open scene (or a project-level thread), for the Inspector footer link.

func (e *Editor) LastAgentPrompt() AgentPromptRequest

LastAgentPrompt returns the most recent AgentPromptRequest initiated by AskAgentAboutObject.

func (e *Editor) LastHUDPrompt() HUDPromptRequest

LastHUDPrompt returns the most recent prompt submitted from the HUD layout screen.

func (e *Editor) LastPlayMarksThread() *PlayMarksThread

LastPlayMarksThread returns a copy of the most recently dispatched PlayMarksThread, or nil if none has been sent.

func (e *Editor) LastSentAgentRequest() *AgentRequest

LastSentAgentRequest returns a copy of the last request assembled and sent by SendComposerPrompt, or nil.

func (e *Editor) LastSettingsAgentRequest() SettingsAgentRequest

LastSettingsAgentRequest returns the most recent request dispatched via AskAgentFromSettings.

func (e *Editor) LastSketchRequest() (SketchAgentRequest, bool)

LastSketchRequest returns the most recent SketchAgentRequest sent via SendSketch.

func (e *Editor) LastViewport3DAgentRequest() (Viewport3DAgentRequest, bool)

LastViewport3DAgentRequest returns the most recent request submitted from the 3D MODELS strip or 3D inspector agent prompt.

func (e *Editor) LatestAgentTurn() (AgentTurn, bool)

LatestAgentTurn returns the most recent agent turn and true, or zero and false when none exists.

func (e *Editor) LaunchBuildOnDevice(deviceID string) error

LaunchBuildOnDevice runs the selected RUN ON DEVICE target:

  • "browser": opens the served web build URL in this Mac/computer's browser via OpenBrowserURL.
  • "phone-wifi": selects the phone QR target and starts serving the web build if stopped.
  • "android-usb": installs and runs the finished Android build on the connected USB Android device via `go tool nsgo`.
func (e *Editor) LayerBaseValue(layerName, fieldKey string) string

LayerBaseValue returns a short human-readable summary of the un-overridden base value of fieldKey on layerName.

func (e *Editor) LayerKindColor(p SpecPalette, layerName string) core.Color

LayerKindColor maps a layer's kind to a SpecPalette token color.

func (e *Editor) LayerKindLabel(layerName string) string

LayerKindLabel returns the concise Spec kind tag for a layer row in the scene rail ("tiles", "screen", or "layer").

func (e *Editor) LayerLocked(name string) bool

LayerLocked reports whether the layer name is locked against the viewports (SetLayerLocked).

func (e *Editor) LayerOverrideFields(layerName string) []string

LayerOverrideFields returns the sorted list of overridden fields in SceneDoc.LayerOverrides[layerName].

func (e *Editor) Layers() []LayerInfo

Layers returns the open scene's layers in draw order, the first drawn first, with what the layers panel shows of each. In a scene that inherits another the space, order and visibility are those the resolved scene gives a layer, so a layer that extends one of the base's shows the base's, as its layer overrides change them.

func (e *Editor) LayersPanelOpen() bool

LayersPanelOpen reports whether the docked Layers panel is open.

func (e *Editor) LayoutFile() *LayoutFile

LayoutFile returns a canonical copy of the editor's current persisted dock layout.

func (e *Editor) LeaveAgentContext()

LeaveAgentContext ends a scope opened by EnterAgentContext.

func (e *Editor) LeftRailMode() LeftRailMode

LeftRailMode returns whether the editor's left rail is in Scene mode or Assets mode.

func (e *Editor) LibraryPanelOpen() bool

LibraryPanelOpen reports whether the Asset Pack Library panel is open.

func (e *Editor) LoadAgentThread(filePath string) error

LoadAgentThread loads tasks from path (a *.thread.yaml file) into the editor.

func (e *Editor) LoadAssetStyleBrief() AssetStyleBrief

LoadAssetStyleBrief reads brief.yaml from the open project root when present, falling back to DefaultAssetStyleBrief for omitted fields.

func (e *Editor) LoadCheckpoints() ([]CheckpointSummary, error)

LoadCheckpoints scans .nsgo/checkpoints/ in the open project, parses each manifest, sorts newest first, and updates the editor's cached checkpoint list. Invalid, symlinked, or non-checkpoint directories are skipped.

func (e *Editor) LoadLayout() error

LoadLayout loads the dock layout from Editor.LayoutPath when set, dropping any panels that no longer exist.

func (e *Editor) LoadNavMesh3D() (*navbake3d.File, error)

LoadNavMesh3D reads and parses the scene's navMesh file (SceneDoc.NavMesh) from the open project (or scene directory / NavMesh3DAssetFS) and loads it into the 3D viewport preview overlay.

func (e *Editor) LoadPlaytestReport(cfg PlaytestReportOpenConfig) error

LoadPlaytestReport loads a playtest report into the editor without forcing the Playtest Report screen open.

func (e *Editor) LoadProjectPermissions(path string) error

LoadProjectPermissions loads permissions.yaml from path (falling back to DefaultPermissions when the file does not exist yet). When permissions.yaml exists but fails to parse or validate, the editor fails closed: it records PermissionsErr(), loads PermissionProfileCautious into memory, and EvaluatePermission denies all mutating/running calls until fixed.

func (e *Editor) LoadRecentProjects() error

LoadRecentProjects loads the recent projects list from Editor.RecentProjectsPath when set.

func (e *Editor) LoadSettings(path string) error

LoadSettings sets SettingsPath to path and loads per-user editor settings from it. If path does not exist yet, default settings are applied without error; if the file exists and is invalid, an error is returned without changing the current settings.

func (e *Editor) LoadUserSettings() error

LoadUserSettings loads per-user editor settings from DefaultSettingsPath(), creating no file until a setting is changed or saved.

func (e *Editor) LocalizationDir() string

LocalizationDir returns the directory where the open localization YAML files live, or "".

func (e *Editor) LocalizationDirty() bool

LocalizationDirty reports whether any locale table in the open workspace differs from what was opened or last saved.

func (e *Editor) LocalizationError() error

LocalizationError returns the most recent error encountered in the Localization panel, or nil.

func (e *Editor) LocalizationIsMissing(locale, key string) bool

LocalizationIsMissing reports whether (locale, key) has a missing translation (an empty string for a simple key, or a missing "other" form for a plural key).

func (e *Editor) LocalizationKeyPlural(key string) bool

LocalizationKeyPlural reports whether key is edited as CLDR plural forms.

func (e *Editor) LocalizationKeys() []string

LocalizationKeys returns the sorted message key rows of the open localization workspace.

func (e *Editor) LocalizationLoading() bool

LocalizationLoading reports whether the Localization panel is currently loading tables.

func (e *Editor) LocalizationLocales() []string

LocalizationLocales returns the sorted BCP-47 locale columns of the open localization workspace.

func (e *Editor) LocalizationMissing() []MissingTranslation

LocalizationMissing returns every missing (locale, key) translation in deterministic key-then-locale order.

func (e *Editor) LocalizationMissingCount() int

LocalizationMissingCount returns the number of missing translations across all keys and locales.

func (e *Editor) LocalizationOpen() bool

LocalizationOpen reports whether the Localization panel currently has a workspace open.

func (e *Editor) LocalizationPlural(locale, key string) (l10n.PluralForms, bool)

LocalizationPlural returns the CLDR plural forms for (locale, key) and whether any form is set.

func (e *Editor) LocalizationTable(locale string) (*l10n.StringTable, error)

LocalizationTable returns the canonical l10n.StringTable snapshot for locale.

func (e *Editor) LocalizationValue(locale, key string) (string, bool)

LocalizationValue returns the plain string translation for (locale, key) and whether it is present.

func (e *Editor) LookThroughCamera3D() bool

LookThroughCamera3D reports whether the 3D viewport is currently looking through the scene's active 3D camera.

func (e *Editor) MakeInstanceLocal(objectID string) error

MakeInstanceLocal replaces a scene instance object (objectID, its owning instance if objectID is an instanced child, or SelectedID when empty) with a local copy of its resolved objects and connections in one undoable step.

func (e *Editor) MarkAgentTurnPartial(turnID string, partial AgentPartialState)

MarkAgentTurnPartial attaches a partial completion card to turnID (or the latest turn when turnID is empty).

func (e *Editor) MarkTipsSeen(ids ...string) error

MarkTipsSeen records one or more tip IDs in EditorSettings.SeenTips, saving to SettingsPath when set.

func (e *Editor) MarqueeActive() bool

MarqueeActive reports whether a 2D viewport marquee box selection drag is in progress.

func (e *Editor) MarqueeRect() (MarqueeRect, bool)

MarqueeRect returns the active marquee rectangle in normalized canvas coordinates (X0<=X1, Y0<=Y1) and true, or the zero rect and false when no marquee drag is active.

func (e *Editor) Material() *resource.Material

Material returns a deep copy of the resource.Material open in the Material Editor panel, or nil when closed.

func (e *Editor) MaterialDirty() bool

MaterialDirty reports whether the open material differs from the canonical resource.Encode bytes it was opened from or last saved to.

func (e *Editor) MaterialOpen() bool

MaterialOpen reports whether the Material Editor panel has a material open.

func (e *Editor) MaterialPath() string

MaterialPath returns the disk path of the open material file, or "" for an unsaved or in-memory material.

func (e *Editor) MaterialPreviewImage(size int) (*image.RGBA, error)

MaterialPreviewImage renders the open material's live 3D preview (sphere or cube) with render3d on a software GPU into a square RGBA image of size pixels, caching the image until the material, shape, size, lighting, or project assets change. Returns (nil, nil) when no material is open or the preview shape is MaterialPreviewSprite.

func (e *Editor) MaterialPreviewShape() MaterialPreviewShape

MaterialPreviewShape returns the active preview shape (Sphere, Cube, or Sprite).

func (e *Editor) MaterialRelPath() string

MaterialRelPath returns the slash-separated project-relative path of the open material, used for Library.Reload live updates, or "".

func (e *Editor) MentionPickerActiveIndex() int

MentionPickerActiveIndex returns the 0-based index of the highlighted item in MentionPickerItems().

func (e *Editor) MentionPickerGroup() MentionGroup

MentionPickerGroup returns the active group tab in the @-mention picker.

func (e *Editor) MentionPickerItems() []MentionItem

MentionPickerItems returns the filtered, ranked items currently shown in the @-mention picker for the active query and group tab, excluding items already attached as chips.

func (e *Editor) MentionPickerOpen() bool

MentionPickerOpen reports whether the @-mention picker popover is currently open.

func (e *Editor) MentionPickerQuery() string

MentionPickerQuery returns the current @-mention filter query (without the leading '@').

func (e *Editor) MergeConflictOpen() bool

MergeConflictOpen reports whether the Scene Merge Conflict resolution screen is currently active.

func (e *Editor) MergeSession() *MergeConflictSession

MergeSession returns the active scene merge conflict session, or nil when closed.

func (e *Editor) MissingPlugins() []string

MissingPlugins returns the names the open project lists under editor.plugins that no registered plugin has, in the project's order: plugins this editor binary was built without.

func (e *Editor) ModelPreviewAnimation() int

ModelPreviewAnimation returns the 0-based index of the active animation in the model import preview, or -1 when the model has no animations.

func (e *Editor) ModelPreviewCamera() OrbitCamera3D

ModelPreviewCamera returns the current orbit camera of the model import preview.

func (e *Editor) ModelPreviewDuration() time.Duration

ModelPreviewDuration returns the duration of the active animation in the model import preview, or 0 when none is active.

func (e *Editor) ModelPreviewLoop() bool

ModelPreviewLoop reports whether model preview animation playback wraps at the end of the clip.

func (e *Editor) ModelPreviewNodeWorldTransform(nodeIndex int) (math3d.Mat4, bool)

ModelPreviewNodeWorldTransform returns the current evaluated world matrix of glTF node nodeIndex from the active model preview pose.

func (e *Editor) ModelPreviewPlaying() bool

ModelPreviewPlaying reports whether the model import preview is actively playing an animation.

func (e *Editor) ModelPreviewTime() time.Duration

ModelPreviewTime returns the current animation playhead timestamp in the model import preview.

func (e *Editor) ModelThumbnail(m ModelEntry) (*image.RGBA, error)

ModelThumbnail returns a picture of m, ModelThumbnailSize pixels square: its geometry framed from above, in front and to the right, lit by DefaultLights3D on a transparent background. The first call for a model loads it on the calling goroutine, the UI goroutine, as everything the Resolver serves loads, and leaves the rendering, through scenemodel on NSGo's software GPU (gpu.SoftwareRenderer), to a worker goroutine: it returns nil and no error, and the asset browser redraws when the picture is ready. The model loads apart from the 3D build's cache, which keeps only what the scene uses. It returns an error when m's model does not load or draws no geometry. The thumbnails are kept until the open project changes or its built assets reload (ReloadAssets).

func (e *Editor) Models() []ModelEntry

Models returns what the asset browser offers to place in 3D: the built-in primitives in sceneformat.MeshPrimitives order, then the open project's models (ProjectModels) by path, each output of a model target marked Output.

func (e *Editor) MoveAudioBus(from, to int) error

MoveAudioBus moves the bus at index from to index to through EditProject.

func (e *Editor) MoveAudioBusEffect(bus string, from, to int) error

MoveAudioBusEffect moves an effect on bus from index from to index to through EditProject.

func (e *Editor) MoveDataTableRow(from, to int) error

MoveDataTableRow moves row from to to (both 0-based) as an undoable command.

func (e *Editor) MoveExportPreset(platform string, delta int) error

MoveExportPreset moves platform's export preset by delta positions (-1 up, +1 down) through EditProject.

func (e *Editor) MoveFile(from, to string) error

MoveFile moves or renames the file or directory from to to, both slash-separated paths from the root of the open project (the directory of ProjectPath), and rewrites every reference to what it moves across the project, as refs.PlanMove plans and `game mv` does: in the scenes, resource files, game.yaml, Tiled and LDtk files on disk, and in the open scene, project and clip, which keep their unsaved edits. When the open scene, or the open clip's file, is among the files moved, FilePath, ScenePath and ClipPath follow it.

The move is one undoable step. Undo moves the files back and puts back, byte for byte, each file the move rewrote, the project index included, and removes an index the move created and the directories it created when they are left empty; a file changed since the move has its references rewritten back as a move from to to from would, and a file the move left alone, such as one that already named to, stays as it is. Redo moves the files once more. A step that something on disk now blocks, such as a new file where the move would put one, fails and stays where it was, and the status bar says why. MoveFile refuses while playing (ErrPlaying) or without a project (ErrNoProject), and changes nothing when the plan fails.

func (e *Editor) MoveKey(track, key int, to time.Duration) (int, error)

MoveKey moves key key on track track to time to, as an undoable command, and returns the key's index after the track's keys are put back in time order. It refuses a time outside the clip or one another key on the track already has.

func (e *Editor) MoveLayer(name string, index int) error

MoveLayer moves the layer name to position index of the draw order Layers lists, 0 drawing first, as an undoable command; an index below 0 puts it first and one past the end last. It moves the layer in the file next to the layer it is to draw after or before and changes its order only when the order it has would not draw it there, to the order of that neighbour, so the other layers keep their place and their orders. In a scene that inherits another it refuses to move a layer that extends one of the base's, whose order the base owns, and a move the resolved scene would not draw as asked.

func (e *Editor) MoveMentionSelection(delta int) int

MoveMentionSelection moves the highlighted row in the @-mention picker by delta (+1 down, -1 up).

func (e *Editor) MoveObject(id string, x, y float32) error

MoveObject sets object id's position to (x, y) as an undoable command. When id names an instanced or inherited object, it records an override on its instance or inheriting scene.

func (e *Editor) MoveObject3D(id string, x, y, posZ float32) error

MoveObject3D sets object id's 3D position (x, y, posZ) as an undoable command.

func (e *Editor) MoveObjectToLayer(id, layer string, index int) error

MoveObjectToLayer moves the object id, with its descendants, to the top level of layer at index among its objects, as one undoable command; an index below 0 or past the last object puts it last. The object keeps its world transform within the layer's coordinate space, as ReparentObject does: a child taken out of its parent gets the local transform that leaves it where it was drawn. A move between a world and a screen layer keeps the numbers, not where the object appears on screen.

func (e *Editor) MoveObjectUnder(id, parentID string) error

MoveObjectUnder reparents object id under parentID (or to the top level of its layer when parentID is "") at the end of parentID's children as ONE undoable History step, preserving its world transform.

func (e *Editor) MovePanel(key, targetPanel string) bool

MovePanel moves panel key into the same tab group as targetPanel, updates and persists the layout, and returns whether the move succeeded.

func (e *Editor) MovePermissionRule(index, delta int) error

MovePermissionRule moves rule at index by delta (-1 up, +1 down), keeps focus on the moved rule, and persists permissions.yaml.

func (e *Editor) MoveRigBone(name string, x, y float32) error

MoveRigBone sets bone name's bind-pose local offset (x, y) as an undoable command.

func (e *Editor) MoveRigSlotOrder(slot string, newIndex int) error

MoveRigSlotOrder moves slot to newIndex in draw order (back to front) as an undoable command.

func (e *Editor) MoveUnderCandidates(id string) []MoveUnderCandidate

MoveUnderCandidates returns every valid target parent that object id can be moved under via MoveObjectUnder / ReparentObject, excluding id itself, its descendants (preventing cycles), and any candidate that would exceed sceneformat.MaxObjectDepth. Each entry carries a descriptive note (current parent, locked status, child count, or layer).

func (e *Editor) NavMesh3DError() string

NavMesh3DError returns the error message from the most recent failed navmesh bake or load, or empty.

func (e *Editor) NavMesh3DFile() *navbake3d.File

NavMesh3DFile returns the currently loaded or baked 3D navigation mesh file, or nil.

func (e *Editor) NavMesh3DMesh() *navbake3d.Mesh

NavMesh3DMesh returns the active preview mesh from NavMesh3DFile: the mesh matching NavMeshBakeConfig().AgentName when present, or the first mesh in the file.

func (e *Editor) NavMeshBakeConfig() NavMeshBakeConfig

NavMeshBakeConfig returns the editor's current 3D navigation mesh bake settings.

func (e *Editor) NavMeshPanelOpen() bool

NavMeshPanelOpen reports whether the 3D NavMesh bake settings panel is visible.

func (e *Editor) NavPathPreview2D() NavPathPreview2D

NavPathPreview2D returns a snapshot of the active 2D test-path endpoints and computed path.

func (e *Editor) Navigation3D() Navigation3D

Navigation3D returns the configured 3D viewport mouse navigation mapping ("default", "blender", or "maya").

func (e *Editor) NewAgentThread() *AgentThread

NewAgentThread starts a new empty thread for the currently open scene (⌘N) and activates it.

func (e *Editor) NewClip(target, name string, length time.Duration) error

NewClip opens a new, empty clip named name and length long that plays on the object target (the selected object when target is empty), as an undoable command.

func (e *Editor) NewClipFromAsepriteTag(target, tag string) error

NewClipFromAsepriteTag creates and opens an animation clip from the named Aseprite tag on target's atlas (the selected object when target is empty), matching the tag's frames, exact durations and loop setting, as an undoable command.

func (e *Editor) NewClipFromFrames(target, name string, frames []string, fps float64, loop bool) error

NewClipFromFrames creates and opens an animation clip on target (the selected object when target is empty) that steps through frames at fixed frame rate fps (frames per second), as an undoable command. When a resolver is configured, every frame must exist in target's atlas.

func (e *Editor) NewGridMap(relPath, meshLibrary string, cellSize math3d.Vec3) error

NewGridMap creates a new empty GridMap using meshLibrary and cellSize, ready to paint and save to relPath.

func (e *Editor) NewLocalizations(dir string, locales ...string) error

NewLocalizations opens a fresh localization workspace targeting dir with the given BCP-47 locales (sorted and deduplicated) as an undoable command.

func (e *Editor) NewMaterial() error

NewMaterial opens a new unsaved starter material in the Material Editor panel as an undoable command.

func (e *Editor) NewParticleEmitter() error

NewParticleEmitter opens a new starter 2D particle emitter in the Particle Emitter panel as an undoable command.

func (e *Editor) NewProjectAgentThread() *AgentThread

NewProjectAgentThread starts a new empty project-level thread (Project · no scene) and activates it.

func (e *Editor) NewRig(name, atlasName string) error

NewRig creates and opens a new minimal skeletal rig with one root bone as an undoable command.

func (e *Editor) NewRoomMap(filePath string) error

NewRoomMap creates a new valid room map beside the current scene with one starter room sized to the scene's virtual viewport (snapped to the tile grid when present) and selects it.

func (e *Editor) NewScene(rel string) (string, error)

NewScene writes a new, minimal valid scene to rel, a slash-separated path from the root of the open project, and opens it as OpenScene does. A path without a .yaml or .yml extension gets ".scene.yaml" (one ending in ".scene" gets ".yaml"), the name `game check` and `game index` find scenes by, and NewScene returns the path it wrote. The scene is named after the file and is as large as the project's display, or its window without one, with one world layer, "main". It refuses the names of the project's own files, game.yaml and nsgo.yaml, makes the directories the path needs, never overwrites a file (ErrFileExists), and returns ErrNoProject without a project. Like OpenScene, it loses the open scene's unsaved edits.

func (e *Editor) NewTerrain(opts NewTerrainOptions) error

NewTerrain creates a flat editable terrain with 16-bit heightmap precision, per-layer weight maps, and optional foliage layers, opens it in the editor, and switches the viewport to 3D mode.

func (e *Editor) NextFirstRunTip() error

NextFirstRunTip marks the active first-review tip as seen in EditorSettings and advances to the next unseen tip.

func (e *Editor) NoteAgentEditedObjects(objectIDs, files []string, label string)

NoteAgentEditedObjects records object IDs and files modified by an agent edit (for example through editormcp's scene_edit) on the active thread's pending latest request when present.

func (e *Editor) NotifyAgentMCPConnected(client AgentClientInfo)

NotifyAgentMCPConnected records that an MCP client session attached to the editor's MCP server. Transitions waiting/reconnecting/disconnected states immediately to AgentStatusConnected.

func (e *Editor) NotifyAgentMCPDisconnected(clientID, reason string)

NotifyAgentMCPDisconnected records that an MCP client session closed or dropped. When the last connected client drops, the editor enters AgentStatusReconnecting and runs the 1, 2, 4, 8, 16 s retry schedule before transitioning to AgentStatusDisconnected.

func (e *Editor) NotifyAutomationFileAdded(relPath string) int

NotifyAutomationFileAdded fires any enabled file_added automations matching relPath's kind (and optional glob). Returns the number of background automation tasks started.

func (e *Editor) NotifyAutomationFileChanged(relPath string) int

NotifyAutomationFileChanged fires any enabled file_changed automations whose glob matches relPath. Returns the number of background automation tasks started.

func (e *Editor) NotifyAutomationReviewKept(relPath string) int

NotifyAutomationReviewKept fires any enabled review_kept automations (filtered by Trigger.Glob when set). Returns the number of background automation tasks started.

func (e *Editor) NudgeSelectedSketchMark(dx, dy float32) bool

NudgeSelectedSketchMark translates the selected sketch mark by (dx, dy) in scene coordinates.

func (e *Editor) ObjectAABB3D(o *sceneformat.ObjectDoc) (boxMin, boxMax [3]float32)

ObjectAABB3D returns the world-space axis-aligned bounding box (min, max) enclosing object o's 3D box.

func (e *Editor) ObjectBaseValue(objectID, fieldKey string) string

ObjectBaseValue returns a short human-readable string of the un-overridden source value for fieldKey on objectID.

func (e *Editor) ObjectChildrenSummary3D(id string) (ObjectChildrenSummary3D, bool)

ObjectChildrenSummary3D returns a summary of object id's direct children, or false when id has no children.

func (e *Editor) ObjectColliderSummary3D(id string) (ObjectColliderSummary3D, bool)

ObjectColliderSummary3D returns the 3D collider shape and body kind summary for object id, or false when id has no collider3d or trigger3d component.

func (e *Editor) ObjectConnections(objectID string) (outgoing, incoming []ConnectionEntry)

ObjectConnections returns the outgoing (From == objectID) and incoming (To == objectID) connections of objectID in document order. Each ConnectionEntry carries a deep copy of its connection so callers cannot mutate Doc directly.

func (e *Editor) ObjectContextMenuOpen() bool

ObjectContextMenuOpen reports whether the viewport/keyboard object context menu is currently open.

func (e *Editor) ObjectContextMenuTarget() string

ObjectContextMenuTarget returns the object ID currently targeted by the viewport/keyboard object context menu.

func (e *Editor) ObjectContextSubtitle(id string) string

ObjectContextSubtitle returns the subtitle shown under an object's title in the object context menu, such as "Sprite · layer Actors".

func (e *Editor) ObjectCorners3D(o *sceneformat.ObjectDoc) [8][3]float32

ObjectCorners3D returns the 8 world-space corners of object o's oriented 3D bounding box: the bounds of the geometry it draws when the scene's 3D build (Scene3D) gives it a mesh or model, and otherwise a box the size of its sprite frame, or of a marker without one, as deep as its depth. A nested child's box is placed by the transforms of its ancestors too.

func (e *Editor) ObjectEvents(objectID string) []ObjectEvent

ObjectEvents returns the events declared by objectID's registered components, ordered by component name ascending and then each component type's Events order. It returns nil when no component registry is set or objectID is not found.

func (e *Editor) ObjectHandlers(objectID string) []ObjectHandler

ObjectHandlers returns the handlers declared by objectID's registered components, ordered by component name ascending and then each component type's Handlers order. It returns nil when no component registry is set or objectID is not found.

func (e *Editor) ObjectHasAnyOverride(objectID string) bool

ObjectHasAnyOverride reports whether objectID (an instanced/inherited object, or a local scene instance root) has any overrides recorded.

func (e *Editor) ObjectHidden(id string) bool

ObjectHidden reports whether the object id itself is hidden in the viewports (SetObjectHidden); a descendant of a hidden object is hidden too without being marked.

func (e *Editor) ObjectKindColor(p SpecPalette, id string) core.Color

ObjectKindColor maps an object's kind or pending-new state to a SpecPalette token color.

func (e *Editor) ObjectKindLabel(id string) string

ObjectKindLabel returns a short human-readable kind label for object id (such as "Sprite", "Prefab instance", "Scene instance", "3D Model", "3D Mesh", "Light", "Camera", "Particles", "Group", or "Object").

func (e *Editor) ObjectLOD3D(id string) (int, bool)

ObjectLOD3D returns the currently selected LOD index (0 for finest, 1 for _LOD1, ...) drawn for scene object id in the 3D viewport, or (-1, false) when id has no LODs or is not currently visible.

func (e *Editor) ObjectLODCount3D(id string) int

ObjectLODCount3D returns how many LOD levels scene object id has in the built 3D scene (0 when it has only one detail level or no 3D geometry).

func (e *Editor) ObjectLocked(id string) bool

ObjectLocked reports whether the object id itself is locked (SetObjectLocked); a descendant of a locked object is locked too without being marked.

func (e *Editor) ObjectMaterialSummary3D(id string) (ObjectMaterialSummary3D, bool)

ObjectMaterialSummary3D returns the material file and roughness/metallic summary for object id, or false when id has neither a material nor 3D model/mesh geometry.

func (e *Editor) ObjectModelSummary3D(id string) (ObjectModelSummary3D, bool)

ObjectModelSummary3D returns the model path or primitive name, total triangle count, and distinct material count for object id, or false when id has no 3D model or mesh.

func (e *Editor) ObjectOccluded3D(id string) bool

ObjectOccluded3D reports whether scene object id is currently culled behind an occluder in the 3D viewport.

func (e *Editor) ObjectOrigin(id string) ObjectOrigin

ObjectOrigin returns whether id is a local, instanced, or inherited object.

func (e *Editor) ObjectOverrideFields(objectID string) []string

ObjectOverrideFields returns the sorted list of overridden field keys on objectID (such as "x", "y", "name", "sprite", "property:speed", "component:health.hp"). When objectID is a local scene instance root, it returns all override target keys ("body", ...).

func (e *Editor) ObjectOverrideInfo(id string) ObjectOverrideInfo

ObjectOverrideInfo returns origin and override routing metadata for object id. If id does not exist in either Editor.Doc or the resolved scene, the returned info has an empty ID.

func (e *Editor) ObjectProblemCount(objectID string) int

ObjectProblemCount returns how many live visible problems are attributed to objectID in the currently open scene. Call on the editor goroutine.

func (e *Editor) ObjectProblems(objectID string) []assetcheck.Problem

ObjectProblems returns the live visible problems attributed to objectID in the currently open scene. Call on the editor goroutine.

func (e *Editor) ObjectTaskBadge(objectID string) (ObjectTaskOverlay, bool)

ObjectTaskBadge returns the active numbered overlay for objectID in the open scene (editing takes precedence over holding).

func (e *Editor) ObjectYAML(id string) (string, int, error)

ObjectYAML serializes object id as a canonical single-object sceneformat YAML document that sceneformat.Parse parses back to the exact same ObjectDoc. It returns the YAML text and its line count.

func (e *Editor) Objects3D() []Object3DRef

Objects3D returns the objects of every layer, nested, instanced and inherited children included, depth first in document order with each parent before its children, with sequential flat indices (Pick3D's).

func (e *Editor) OpenActiveLayerTileset() error

OpenActiveLayerTileset opens the active layer's YAML tileset (whether layered or single-grid with TilesetFile) in the Tileset Editor panel.

func (e *Editor) OpenAgentRequest(threadID, requestID string) error

OpenAgentRequest switches the right rail to the Agent panel, activates threadID (opening its scene if needed), and expands requestID when it is folded as an earlier request.

func (e *Editor) OpenAgentReview(prompt string, changes []AgentReviewChange)

OpenAgentReview opens (or updates) the Review changes panel with prompt and non-deletion changes.

func (e *Editor) OpenAgentRewindPopover(turnID string) bool

OpenAgentRewindPopover opens the "Rewind to before this message" popover for turnID.

func (e *Editor) OpenAgentTask(id string) error

OpenAgentTask focuses the editor window, stops Play if running, dismisses obstructing overlays/panels (Settings, History, Problem agent panel, Ask-in-place, Assets mode), opens the task's scene (strictly confined inside the open project root), switches to the Tasks or Agent panel, and focuses the task (and its open request card when waiting).

func (e *Editor) OpenAgentTurnReview(turnID string) *AgentTurnReview

OpenAgentTurnReview opens the inline review for turnID (or latest turn with a review) so the author can inspect the actual diff and Keep or Discard it.

func (e *Editor) OpenAskFrozenFrame() error

OpenAskFrozenFrame pauses Play mode, captures the current viewport frame PNG, and opens the "Ask about frame N" dialog.

func (e *Editor) OpenAskInPlace() error

OpenAskInPlace opens the anchored in-place composer targeting the current object selection, or targeting the open scene when nothing is selected.

func (e *Editor) OpenAskInPlaceFor(ids ...string) error

OpenAskInPlaceFor opens the anchored in-place composer targeting ids (or the open scene when ids is empty).

func (e *Editor) OpenBaseScene() error

OpenBaseScene opens the base scene that the active scene inherits (SceneDoc.Inherits) in a tab, switching to its tab if it is already open.

func (e *Editor) OpenBlockedPermissionRule(id string) bool

OpenBlockedPermissionRule opens Settings › Permissions with the matching rule for blocked step id focused.

func (e *Editor) OpenBriefSettings()

OpenBriefSettings opens the Settings view directly to Agent › Game brief (brief.yaml).

func (e *Editor) OpenBuildReleaseScreen() error

OpenBuildReleaseScreen opens the full-window Build and Release screen for the open project, refreshing project metadata, BEFORE EVERY BUILD checks, presets, and platform readiness.

func (e *Editor) OpenChangedFileInEditor(filePath string) error

OpenChangedFileInEditor closes the Changes panel and opens the changed project file in the editor when supported.

func (e *Editor) OpenChangesPanel() error

OpenChangesPanel opens the Changes & Commit screen for the open project's Git repository and refreshes its working-tree diff against HEAD.

func (e *Editor) OpenChangesPanelIn(dir string) error

OpenChangesPanelIn opens the Changes & Commit screen for the Git repository containing dir.

func (e *Editor) OpenClipFile(path, target string) error

OpenClipFile reads the animation resource file at path and opens it as OpenClipYAML does; the panel's Save Clip button, or SaveClipFile(ClipPath()), then writes back to path.

func (e *Editor) OpenClipYAML(data []byte, target string) error

OpenClipYAML parses data as an animation resource file, checks it against the component registry and opens it to play on target (the selected object when empty), as an undoable command.

func (e *Editor) OpenCodeReview(selectPath string)

OpenCodeReview opens or resumes the full-window Go code review screen. When selectPath is non-empty and exists in the session, it focuses that file; otherwise it focuses the first unconfirmed Go file.

func (e *Editor) OpenCodeReviewInExternalEditor(relPath string, line int) error

OpenCodeReviewInExternalEditor opens relPath (at 1-based line when > 0) in the author's external IDE/editor. Containment inside the project root is enforced.

func (e *Editor) OpenCodeReviewTestFile() error

OpenCodeReviewTestFile focuses the failing test file in the review if present, or opens it in the external editor.

func (e *Editor) OpenCommandPalette()

OpenCommandPalette opens the Command Palette dialog.

func (e *Editor) OpenComponentAgentPrompt(objectID string)

OpenComponentAgentPrompt opens the 3D viewport's inline agent prompt to add a component to objectID ("Ask to add a component…").

func (e *Editor) OpenConnectDialog()

OpenConnectDialog opens the Connect an agent dialog at the starting step.

func (e *Editor) OpenConnectDialogAt(step ConnectStep)

OpenConnectDialogAt opens the Connect an agent dialog focused directly on step (used by Troubleshoot so it lands on the step that failed, not the start).

func (e *Editor) OpenConnectDialogForMode(mode AgentMode)

OpenConnectDialogForMode opens the Connect an agent dialog pre-selected on mode (for example AgentModeAPIKey).

func (e *Editor) OpenCutsceneFile(filePath string) error

OpenCutsceneFile reads a *.cutscene.yaml file from disk and opens it in the cutscene timeline editor.

func (e *Editor) OpenCutsceneProjectFile(relPath string) error

OpenCutsceneProjectFile opens a project-relative *.cutscene.yaml file in the cutscene timeline editor.

func (e *Editor) OpenCutsceneReview(req CutsceneReviewRequest) error

OpenCutsceneReview opens a review of an agent's proposed changes to a cutscene without writing to disk until KeepCutsceneReview is called.

func (e *Editor) OpenCutsceneYAML(data []byte) error

OpenCutsceneYAML parses data as a cutscene YAML document and opens it in the cutscene timeline editor as an undoable command.

func (e *Editor) OpenDataTableFile(path string) error

OpenDataTableFile reads the YAML data table at path and opens it in the Data Table panel as an undoable command. If a Go row type is registered for path, the table is checked against it before opening.

func (e *Editor) OpenDataTableProjectFile(relPath string) error

OpenDataTableProjectFile opens relPath (slash-separated from the open project's root) in the Data Table panel.

func (e *Editor) OpenDataTableReview(req DataTableReviewRequest) error

OpenDataTableReview opens a full-window row-by-row review for an agent's data table changes without modifying files on disk until KeepDataTableReview is called.

func (e *Editor) OpenDataTableYAML(name string, data []byte) error

OpenDataTableYAML parses data as a versioned YAML data table named name (used for error messages and row-type pattern matching) and opens it in the Data Table panel as an undoable command.

func (e *Editor) OpenDemo() error

OpenDemo replaces the current project or scene with the built-in Demo Room (or invokes Editor.OnOpenDemo when configured), clearing project state and undo history and closing the Start Screen.

func (e *Editor) OpenExportOutputFolder() error

OpenExportOutputFolder opens the open project's resolved release output folder using OpenOutputFolder (or the OS file manager when nil).

func (e *Editor) OpenFile(path string) error

OpenFile reads a YAML scene file from path and opens it in a tab, or switches to its existing tab when that file is already open, preserving every open tab's undo history. A scene that does not parse returns sceneformat.Parse's *loaderr.Error, naming path.

func (e *Editor) OpenFirstRunPlan() error

OpenFirstRunPlan generates the agent's first plan for the current Start Screen idea and name, and transitions to Step 3 (The first plan). No project folder is created on disk until Approve.

func (e *Editor) OpenFirstRunReviewFromStopped()

OpenFirstRunReviewFromStopped opens the First Review for the partial files kept after StopFirstRunKeepFiles.

func (e *Editor) OpenFocusedReviewNoteComposer() error

OpenFocusedReviewNoteComposer implements the C shortcut in Review scope.

func (e *Editor) OpenFocusedUsage() error

OpenFocusedUsage activates the currently focused usage (Enter): closes the References screen, opens the scene with the instanced object selected and framed (or opens the data table / Go source file).

func (e *Editor) OpenGridMap(relOrPath string) error

OpenGridMap opens a *.gridmap.yaml file by its slash-separated path from the open project root (or from GridMapFS, or an OS path on disk when no project is open), loads its glTF mesh library, and prepares it for painting in the 3D viewport.

func (e *Editor) OpenGridMapDoc(doc *world3d.GridMapDoc, lib *world3d.MeshLibrary, filePath string) error

OpenGridMapDoc opens doc with lib as the active editable GridMap in memory, optionally associated with filePath for saving.

func (e *Editor) OpenGridMapFS(fsys fs.FS, name string) error

OpenGridMapFS loads the GridMap at name from fsys and makes it the active editable GridMap.

func (e *Editor) OpenHUDScreen(relPath string) error

OpenHUDScreen opens the screen at relPath (relative to the open project root, or matching an already-loaded screen path) and activates the HUD and menu layout screen.

func (e *Editor) OpenHUDScreenDoc(name string, doc *gameui.ScreenDoc, locales map[string]map[string]string) error

OpenHUDScreenDoc opens an in-memory ScreenDoc (and optional locale string tables) in the HUD layout screen. If locales is nil, existing locale tables are kept (or defaulted to an empty "en" table).

func (e *Editor) OpenHUDScreenFile(absPath string) error

OpenHUDScreenFile opens a standalone *.screen.yaml file from disk (scanning sibling *.screen.yaml files and a nearby locales/ folder if present).

func (e *Editor) OpenHistoryStep(threadID, requestID, stepID string) error

OpenHistoryStep opens the right-rail History timeline focused on the given thread request/step and invokes Editor.OnOpenHistoryStep when configured.

func (e *Editor) OpenInstancedScene(objectID string) error

OpenInstancedScene opens the scene file instanced by objectID (or its owning instance if objectID is an instanced child, or SelectedID when empty) in a tab, switching to its tab if it is already open.

func (e *Editor) OpenKeychainCredentialEditor(dest PublishDestination)

OpenKeychainCredentialEditor opens the inline keychain credential form inside Review uploads for dest.

func (e *Editor) OpenLocalizations(dir string) error

OpenLocalizations reads all *.yaml string table files in dir with l10n.ParseYAML and opens them in the Localization panel as an undoable command. A missing directory opens an empty workspace targeting dir so saving creates it.

func (e *Editor) OpenMaterial(relPath string) error

OpenMaterial opens the material at relPath: from the open project's file when a project is open, or through the editor's MaterialResolver / 3D assets otherwise, so edits reload live into Library.

func (e *Editor) OpenMaterialFile(filePath string) error

OpenMaterialFile reads a *.material.yaml file from filePath and opens it in the Material Editor panel as an undoable command.

func (e *Editor) OpenMaterialProjectFile(relPath string) error

OpenMaterialProjectFile opens relPath (slash-separated from the open project's root) in the Material Editor panel as an undoable command so edits reload live through Library.Reload.

func (e *Editor) OpenMaterialYAML(data []byte) error

OpenMaterialYAML parses data as a resource.Material YAML file and opens it in the Material Editor panel as an undoable command.

func (e *Editor) OpenMentionPicker(query string)

OpenMentionPicker opens the @-mention picker (with optional initial query).

func (e *Editor) OpenMergeConflict(scenePath string) error

OpenMergeConflict opens the object-by-object Scene Merge Conflict screen for an unmerged scene file in a Git repository. scenePath may be empty to open the first conflicted scene detected in the open project, a slash-separated path relative to the repository/project root, or an absolute OS path inside the repository.

func (e *Editor) OpenMergeConflictSession(cfg MergeConflictSessionConfig) error

OpenMergeConflictSession opens the object-by-object Scene Merge Conflict screen from three parsed SceneDoc versions.

func (e *Editor) OpenModelAgentPrompt()

OpenModelAgentPrompt opens the 3D viewport's inline agent prompt to describe and request a new model ("Or ask for one").

func (e *Editor) OpenObjectContextMenu(id string) bool

OpenObjectContextMenu opens the viewport/keyboard object context menu targeting object id (defaulting to SelectedID). Returns false when playing, blocked by a modal screen, or when id does not name an existing local or resolved scene object.

func (e *Editor) OpenObjectYAML(objectID string) (string, int, bool, error)

OpenObjectYAML locates objectID's 1-based line in the scene YAML (or line 1 when empty), verifies project-root containment, invokes Editor.OnOpenFileAtLine(path, line) when set, updates Editor.Status, and reports whether OnOpenFileAtLine actually ran.

func (e *Editor) OpenOutputEntry(entry OutputEntry) error

OpenOutputEntry navigates to the file:line location carried by entry: if it names a scene file (*.scene.yaml, *.scene.yml, or a scene listed under Project.Autoload.Scenes), it opens that scene in the editor (and updates ScenePath and SelectedFile when a project is open); otherwise it selects the file in the file browser when a project is open. Entries without a file:line location are a no-op.

func (e *Editor) OpenParticleEmitterFile(filePath string) error

OpenParticleEmitterFile reads a versioned 2D particle emitter YAML file from path and opens it in the Particle Emitter panel as an undoable command.

func (e *Editor) OpenParticleEmitterProjectFile(relPath string) error

OpenParticleEmitterProjectFile opens relPath (slash-separated from the open project's root) in the Particle Emitter panel as an undoable command.

func (e *Editor) OpenParticleEmitterYAML(data []byte) error

OpenParticleEmitterYAML parses data as a versioned 2D particle emitter YAML file and opens it in the Particle Emitter panel as an undoable command.

func (e *Editor) OpenPermissionsSettings(focusRule int)

OpenPermissionsSettings opens Settings › Permissions and optionally focuses rule index focusRule (0-based; pass -1 to keep or clear rule focus).

func (e *Editor) OpenPlaytestConfigPreview() error

OpenPlaytestConfigPreview invokes Editor.OnOpenPlaytestConfig if set, or loads the active report's playtest.yaml into the inline preview drawer.

func (e *Editor) OpenPlaytestProposalReview(id string)

OpenPlaytestProposalReview opens the inline review panel for the proposed playtest_define metric with ID id.

func (e *Editor) OpenPlaytestReport(cfg PlaytestReportOpenConfig) error

OpenPlaytestReport loads a playtest report into the editor and opens the full-window Playtest Report screen.

func (e *Editor) OpenPlaytestReportFile(reportPath string) error

OpenPlaytestReportFile reads a YAML playtest report from disk and opens it in the Playtest Report screen. Relative paths are resolved against the open project's root directory and guarded against path traversal.

func (e *Editor) OpenProblem(p assetcheck.Problem) error

OpenProblem navigates to problem p in the open project: if p.File names a scene file (*.scene.yaml, *.scene.yml, or a scene listed under Project.Autoload.Scenes), it opens that scene with OpenScene (and updates ScenePath and SelectedFile, and clears OnSave), unless it is the scene already open (ScenePath), which keeps its edits and undo history and is only selected; if opening the scene fails (for example because the YAML does not parse), it still selects p.File in the file browser and returns the error. For any non-scene file, it selects p.File in the file browser. It returns ErrNoProject when no project is open. Opening another scene opens it in a tab without losing unsaved edits in other tabs.

func (e *Editor) OpenProject(path string) error

OpenProject opens the game's project file: path is a game.yaml or the directory holding one. When the project names a main scene (project.Autoload.MainScene), it opens that scene too, as OpenFile does, with the view the project's ViewStateFile keeps for it. It empties the undo history either way, so no step can bring back a project opened before. The registered plugins the project names under editor.plugins turn on, and the status bar names those it lists that this editor was built without (MissingPlugins). With ProjectAssets set, Resolver becomes a project.Resolver over the project's directory before the scene opens, and a scene left open when the project names no main scene is built again against it. On an error it leaves the editor as it was.

func (e *Editor) OpenProjectFile(relPath string) error

OpenProjectFile opens or selects relPath, a slash-separated path relative to the open project root: scene files open in the scene editor through OpenScene (updating ScenePath and SelectedFile, clearing OnSave and losing the open scene's unsaved edits; CommandPaletteView asks first), game.yaml opens Project Settings and selects the file, and other files are selected in the file browser.

func (e *Editor) OpenProjectScene(path, scene string) error

OpenProjectScene opens the project file at path, a game.yaml or the directory holding one, as OpenProject does, and the scene file at scene, an OS path such as one inside the project's directory, in place of the project's main scene. A scene inside the project's directory gets its path from the project root as ScenePath, which Resolver names scene files by, so PlaceScene refuses an instance that leads back to it. On an error it leaves the editor as it was.

func (e *Editor) OpenPullRequest() (string, error)

OpenPullRequest creates a pull request with `gh pr create` (or Editor.GHRunner) using the drafted title and PR description.

func (e *Editor) OpenPullRequestAsync(cx *core.Scope) error

OpenPullRequestAsync runs `gh pr create` off the UI thread and posts the result back to the editor scope.

func (e *Editor) OpenReference(r refs.Ref) error

OpenReference navigates to a Find References result r: if r.File is a scene file, it opens that scene (unless already open), selects the top-level object at r.Line when one owns that line, and selects r.File in the file browser; otherwise it selects r.File in the file browser. It returns ErrNoProject when no project is open. Opening another scene goes through OpenScene, as OpenSearchResult does, and SearchPanelView asks first while edits are unsaved.

func (e *Editor) OpenReviewNoteComposer(changeID string) error

OpenReviewNoteComposer opens the inline note composer ("Note for the agent · not sent") under changeID.

func (e *Editor) OpenReviewRevertAllDialog()

OpenReviewRevertAllDialog opens the Revert All confirmation dialog (⌘⌫).

func (e *Editor) OpenReviewUploads() error

OpenReviewUploads opens the Review uploads confirmation dialog listing every artifact, its destination, size, and version before anything is sent. It never starts an upload.

func (e *Editor) OpenRigFile(filePath, atlasName string) error

OpenRigFile reads the .skel.yaml rig file at filePath and opens it in the rig editor as an undoable command.

func (e *Editor) OpenRigProjectFile(relPath, atlasName string) error

OpenRigProjectFile opens relPath (slash-separated from the open project's root) in the rig editor.

func (e *Editor) OpenRigYAML(name string, data []byte, atlasName string) error

OpenRigYAML parses data as a .skel.yaml rig named name and opens it in the rig editor as an undoable command. Opening and saving without edits returns the exact original bytes unchanged.

func (e *Editor) OpenRoomsFile(filePath string) error

OpenRoomsFile reads a *.rooms.yaml file from path, parses it with rooms.Parse, and opens it beside the current scene in the 2D viewport.

func (e *Editor) OpenRoomsProjectFile(relPath string) error

OpenRoomsProjectFile opens relPath (slash-separated from the open project's root) beside the scene.

func (e *Editor) OpenRoomsYAML(name string, data []byte) error

OpenRoomsYAML parses data with rooms.Parse and opens the room map beside the current scene.

func (e *Editor) OpenRulesSettings()

OpenRulesSettings opens the Settings view directly to Agent › Project rules (AGENTS.md).

func (e *Editor) OpenScene(rel string) error

OpenScene opens the scene file at rel, a slash-separated path from the root of the open project (the directory of ProjectPath), in a tab with ScenePath set to rel, or switches to its tab when it is already open. Switching or opening tabs never clears any tab's undo history; the newly opened tab starts with OnSave nil while previously open tabs keep theirs. It returns ErrNoProject without a project.

func (e *Editor) OpenSearchResult(r SearchResult) error

OpenSearchResult activates a search result: if it refers to a scene file (or an object inside one), it opens that scene when it is not already open (preserving unsaved edits when it is already open), updates ScenePath and SelectedFile, and selects the matching object, nested children included, or its top-level ancestor when the child cannot be selected. For any non-scene file, it selects the file in the file browser. It returns ErrNoProject when no project is open. Opening another scene goes through OpenScene, which clears OnSave and loses the open scene's unsaved edits; SearchPanelView asks first (HasUnsavedChanges).

func (e *Editor) OpenSelectedObjectYAML() error

OpenSelectedObjectYAML locates the selected object's 1-based line in the scene YAML (or line 1 when no object is selected), invokes Editor.OnOpenFileAtLine(path, line) when set, and updates Editor.Status with "Opened <path>:<line>".

func (e *Editor) OpenSettingsPage(page SettingsPage)

OpenSettingsPage opens the unified Settings view on page (or switches to page if already open).

func (e *Editor) OpenShortcutsSettings()

OpenShortcutsSettings opens the Settings view directly to the Shortcuts page.

func (e *Editor) OpenSourceScene(objectID string) error

OpenSourceScene opens the source scene file of objectID (or SelectedID when empty) in a tab: for a scene instance root or instanced child it opens the instanced scene, and for an inherited object it opens the base scene.

func (e *Editor) OpenStatesFile(path, target string) error

OpenStatesFile reads a *.states.yaml file from disk and opens it in the state machine editor.

func (e *Editor) OpenStatesProjectFile(relPath string) error

OpenStatesProjectFile opens a project-relative *.states.yaml file in the state machine editor.

func (e *Editor) OpenStatesYAML(data []byte, target string) error

OpenStatesYAML parses data as a *.states.yaml document and opens it to preview on target (selected object, or an object with an animator component, when empty) as an undoable command.

func (e *Editor) OpenTask(id string) error

OpenTask opens the Tasks panel focused on id and, when possible, switches to or opens its target scene (strictly confined inside the open project root) and selects its first edited/blocked object.

func (e *Editor) OpenTerrain(doc *world3d.TerrainDoc, hm *world3d.Heightmap, foliageDensities map[string]*world3d.DensityMap) error

OpenTerrain opens an already-constructed TerrainDoc and Heightmap in the editor for sculpting and painting without requiring files on disk.

func (e *Editor) OpenTerrainFile(yamlPath string) error

OpenTerrainFile reads a *.terrain.yaml file and its referenced heightmap, splat/weight maps, and foliage density maps from disk and opens them for sculpting and painting in the 3D viewport.

func (e *Editor) OpenTerrainProjectFile(relPath string) error

OpenTerrainProjectFile opens relPath (slash-separated from the open project's root) in the terrain editor.

func (e *Editor) OpenTilesetFile(filePath string) error

OpenTilesetFile reads the YAML tileset at filePath and opens it in the Tileset Editor panel.

func (e *Editor) OpenTilesetProjectFile(relPath string) error

OpenTilesetProjectFile opens relPath (slash-separated from the open project's root, or read via Resolver's FileResolver when no project is open) in the Tileset Editor panel.

func (e *Editor) OpenTilesetYAML(name string, data []byte) error

OpenTilesetYAML parses data as a version 1 YAML tileset named name and opens it in the Tileset Editor panel.

func (e *Editor) OpenUsageItem(item UsageItem) error

OpenUsageItem navigates to a specific UsageItem: scenes open with the referencing object selected and framed; data tables open in the Data Table panel; Go files invoke OnOpenSourceFile and select the file.

func (e *Editor) OpenUsagesScreen(targetPath string) error

OpenUsagesScreen opens the full-window Find Usages screen for targetPath (or the current selection/file/scene when empty).

func (e *Editor) OpenViewportSettings()

OpenViewportSettings opens the Settings view directly to the Viewport page.

func (e *Editor) OpenYAML(data []byte) error

OpenYAML parses data as a sceneformat.SceneDoc, replaces the active document, clears undo/redo history, and rebuilds the scene.

func (e *Editor) OrbitModelPreview(dyaw, dpitch float32)

OrbitModelPreview rotates the model preview orbit camera by dyaw and dpitch in radians.

func (e *Editor) OrbitView3D(dyaw, dpitch float32)

OrbitView3D orbits the 3D viewport's camera about its Target by dyaw and dpitch radians, as a drag does; the viewport's Orbit buttons turn it 15 degrees left or right. Looking straight down or up from an axis view, a tilt first brings the view back within Orbit's range. A turn that is not finite changes nothing.

func (e *Editor) Orthographic3D() bool

Orthographic3D reports whether the 3D viewport's camera projects in orthographic.

func (e *Editor) OutputEntries() []OutputEntry

OutputEntries returns a snapshot of every entry recorded in the Output panel in chronological order. It is safe to call from any goroutine.

func (e *Editor) OutputErrorsOnly() bool

OutputErrorsOnly reports whether the Output panel is filtered to error entries only.

func (e *Editor) OutputPanelOpen() bool

OutputPanelOpen reports whether the Output panel is visible below the viewport.

func (e *Editor) OutputPanic() *PanicReport

OutputPanic returns a copy of the latest detected panic report in the Output panel, or nil when none is present.

func (e *Editor) OutputPanicRuntimeExpanded() bool

OutputPanicRuntimeExpanded reports whether the panic card's folded runtime frames are expanded.

func (e *Editor) OverlayKindVisible(kind OverlayKind) bool

OverlayKindVisible reports whether overlay kind is currently enabled in the top-left viewport legend. For OverlayKindFocusedChange, it reports whether any change kind is enabled (callers with a specific ChangeKind should pass that ChangeKind).

func (e *Editor) OverlayLegendKindEnabled(kind OverlayLegendKind) bool

OverlayLegendKindEnabled reports whether the Spec overlay legend row kind is currently toggled on. All kinds default to enabled unless persisted in EditorSettings.OverlayLegend / HiddenOverlayKinds.

func (e *Editor) OverlayLegendOpen() bool

OverlayLegendOpen reports whether the compact viewport overlay legend is visible (true by default in edit mode).

func (e *Editor) OverlaysPopoverOpen() bool

OverlaysPopoverOpen reports whether the viewport Overlays popover is currently open.

func (e *Editor) PaintGridMapCell(c world3d.GridCoord, tileID uint16, orient uint8) error

PaintGridMapCell sets cell c in the open GridMap to tileID with orientation orient (0..23) as an undoable command.

func (e *Editor) PaintTerrain(layer string, col, row int, terrainName string) error

PaintTerrain places a cell of terrainName (or ActiveTerrain / the tileset's first terrain when empty) at (col, row) on layer's layered tilemap and updates the cell and its neighbors through the same autotile rules as tilemap.Tilemap.SetAutotile, as one undoable command.

func (e *Editor) PaintTile(layer string, col, row, tileID int) error

PaintTile sets the tile at (col, row) on layer's inline tilemap to tileID as an undoable command. On a layered grid it paints the tile layer ActiveTileLayer names, and tileID is the tile's local ID in the tileset plus 1, as the tile palette numbers tiles, placed with the flips ActiveTileFlip holds; 0 empties the cell.

func (e *Editor) PaletteItems() []base.CommandItem

PaletteItems returns all items shown in the Command Palette: registered editor commands (built-in, custom, and active plugins'), active plugin tools, active plugin panels, and the open project's scenes and files.

func (e *Editor) PaletteRecent() []string

PaletteRecent returns a copy of the most recently executed Command Palette item IDs (newest first).

func (e *Editor) PanModelPreview(dx, dy, canvasH float32)

PanModelPreview translates the model preview camera target parallel to the view plane by (dx, dy) pixels in a canvas canvasH pixels tall.

func (e *Editor) PanRigView(dx, dy float32)

PanRigView pans the rig editor canvas by (dx, dy) canvas points.

func (e *Editor) PanView2D(dx, dy float32) bool

PanView2D moves what the 2D viewport shows by (dx, dy) canvas points, as a drag that grabs the world does: a positive dx brings into view what was to the left. It reports false for a zero or non-finite move and while the scene plays.

func (e *Editor) PanView3D(dx, dy, h float32)

PanView3D moves the 3D viewport's camera parallel to the view so the scene follows the pointer: dx and dy are how far it moved, in points, right and down, on a viewport h points high. What lies at Target moves by exactly that much, in perspective and in orthographic. A move that is not finite changes nothing.

func (e *Editor) PanelVisible(key string) bool

PanelVisible reports whether panel key is currently shown in the dock area.

func (e *Editor) Panels() []PanelInfo

Panels returns the list of user-toggleable dock panels (built-in panels and active plugin panels) in menu order.

func (e *Editor) ParticleActiveConfig() *particles.Config

ParticleActiveConfig returns a deep copy of the currently targeted emitter Config (the root config or the selected nested sub-emitter), or nil when closed.

func (e *Editor) ParticleActiveCurve() ParticleCurveKind
func (e *Editor) ParticleAtlasFrames(atlasName string) []AssetEntry

ParticleAtlasFrames returns the frames of atlasName in sorted order (or of ParticlePreviewAtlas when atlasName is empty).

func (e *Editor) ParticleAtlasNames() []string

ParticleAtlasNames returns all atlas names available through the editor's Resolver in sorted order.

func (e *Editor) ParticleEmitter() *particles.Config

ParticleEmitter returns a deep copy of the root particles.Config open in the Particle Emitter panel, or nil when closed.

func (e *Editor) ParticleEmitterDirty() bool

ParticleEmitterDirty reports whether the open particle emitter differs from the YAML bytes it was opened from or last saved to.

func (e *Editor) ParticleEmitterOpen() bool

ParticleEmitterOpen reports whether the Particle Emitter panel has an emitter open.

func (e *Editor) ParticleEmitterPath() string

ParticleEmitterPath returns the disk path of the open particle emitter file, or "".

func (e *Editor) ParticlePreview() *particles.Emitter

ParticlePreview returns the live preview particles.Emitter for the open emitter, or nil when closed.

func (e *Editor) ParticlePreviewAtlas() string

ParticlePreviewAtlas returns the atlas name bound to the live particle preview and atlas frame picker.

func (e *Editor) ParticlePreviewElapsed() time.Duration

ParticlePreviewElapsed returns the elapsed simulation time of the live particle preview since its last Restart.

func (e *Editor) ParticlePreviewFloor() bool

ParticlePreviewFloor reports whether the preview includes a test floor collider below the emitter.

func (e *Editor) ParticlePreviewPlaying() bool

ParticlePreviewPlaying reports whether the live particle preview is currently running.

func (e *Editor) ParticleSelectedStop() int
func (e *Editor) ParticleTargetPath() []int

ParticleTargetPath returns a copy of the nested sub-emitter index path currently edited (empty for the root emitter).

func (e *Editor) Paste() ([]string, error)

Paste reads scene-format YAML from the system clipboard and pastes its objects into the active layer (at the viewport pointer when hovering, or with an offset when pasting into a scene where original IDs are already taken) in one undoable step.

func (e *Editor) PasteAgentReferenceImage() ([]AgentReferenceImage, bool, error)

PasteAgentReferenceImage reads an image or copied file(s) from the clipboard (via Editor.ReadClipboardImage / Editor.ReadClipboardFiles when set, or the attached UI scope) and attaches them to the composer.

func (e *Editor) PasteInto(parentID string) ([]string, error)

PasteInto reads scene-format YAML from the system clipboard and pastes its objects as children of parentID in one undoable step.

func (e *Editor) PasteObject() (string, error)

PasteObject pastes the object YAML currently on the clipboard (reading from ReadClipboard when set, otherwise the cached object clipboard) onto the selected object's layer or the active layer.

func (e *Editor) PasteObjectYAML(yamlText, layerName string) (string, error)

PasteObjectYAML parses yamlText (either a canonical sceneformat SceneDoc as CopyObjectYAML writes, or a standalone ObjectDoc mapping) through sceneformat, assigns fresh unique IDs to the object and its descendants, and places it on layerName (or the active/source layer when empty) as one undoable step.

func (e *Editor) PasteTileRegion(layer string, col, row int) error

PasteTileRegion pastes the tile clipboard with its top-left corner at (col, row) on layer's inline tilemap in one undoable command.

func (e *Editor) PasteWith(opts PasteOptions) ([]string, error)

PasteWith reads scene-format YAML from the system clipboard and pastes its objects according to opts.

func (e *Editor) PasteYAML(data []byte) ([]string, error)

PasteYAML parses data as scene-format YAML and pastes its objects into the active layer in one undoable step. Invalid YAML or validation failures are refused without mutating the scene or undo history.

func (e *Editor) PasteYAMLWith(data []byte, opts PasteOptions) ([]string, error)

PasteYAMLWith parses data as scene-format YAML and pastes its objects according to opts in one undoable step.

func (e *Editor) PauseAutomationsForToday() error

PauseAutomationsForToday pauses every automation trigger until the next calendar day (relative to Editor.Now / time.Now). Refuses agent actors (ErrAutomationYouOnly).

func (e *Editor) PauseClip()

PauseClip stops clip playback at the playhead.

func (e *Editor) PauseCutscene()

PauseCutscene pauses fixed-step preview playback of the open timeline cutscene.

func (e *Editor) PauseDataTableReview()

PauseDataTableReview exits the full-window review screen while keeping the review pending and shows the "Review paused" toast with a Resume action.

func (e *Editor) PauseModelPreviewAnimation()

PauseModelPreviewAnimation halts model preview animation playback at the current playhead and pose.

func (e *Editor) PauseParticlePreview()

PauseParticlePreview pauses the live particle preview while keeping all live particles visible.

func (e *Editor) PausePlay()

PausePlay pauses local Play mode at the current frame.

func (e *Editor) PauseReview()

PauseReview (Esc / Back to editor) leaves the full-window Review screen while keeping the turn pending, preserving the exact focused change, seen state, filter, and reverted set.

func (e *Editor) PauseRig()

PauseRig pauses rig animation playback at the current playhead.

func (e *Editor) PauseStates()

PauseStates pauses fixed-step preview playback of the open state machine.

func (e *Editor) PendingAgentPermissionAsk() *AgentPermissionPrompt

PendingAgentPermissionAsk returns a copy of the currently open interactive permission card, or nil.

func (e *Editor) PendingAgentPermissionCardFocused() bool

PendingAgentPermissionCardFocused reports whether keyboard focus is currently inside the Agent panel's live permission card.

func (e *Editor) PendingAutomationDraft() *AutomationDraft

PendingAutomationDraft returns a copy of the currently drafted automation waiting to be kept, or nil.

func (e *Editor) PendingDocReviews(target DocReviewTarget) []DocReview

PendingDocReviews returns all pending DocReviews matching target (or all targets when target is empty).

func (e *Editor) PendingPermissionRequests() []PendingPermissionRequest

PendingPermissionRequests returns all currently pending Ask permission requests.

func (e *Editor) PendingProjectAction() (PendingProjectAction, bool)

PendingProjectAction returns the pending project switch awaiting unsaved-edits confirmation, if any.

func (e *Editor) PendingReviewNotes() *ReviewNoteBatch

PendingReviewNotes returns a deep copy of the notes explicitly sent by the author and waiting for the agent's next round redo, or nil if no notes have been sent.

func (e *Editor) PendingSaveConflict() (*DiskConflictError, bool)

PendingSaveConflict returns the pending save conflict error, if any.

func (e *Editor) PendingTurnPromptOpen() bool

PendingTurnPromptOpen reports whether the pending-turn Keep/Revert/Cancel confirmation dialog is open.

func (e *Editor) PendingTurnPromptSummary() string

PendingTurnPromptSummary describes the blocked action waiting on Keep, Revert, or Cancel.

func (e *Editor) PermissionToast() (PermissionToast, bool)

PermissionToast returns the currently visible "Always permission rule saved" toast, if any.

func (e *Editor) Permissions() PermissionsFile

Permissions returns a copy of the editor's active project permission profile and rules (defaulting to the Balanced preset).

func (e *Editor) PermissionsDraft() *PermissionsDraft

PermissionsDraft returns a copy of the currently open permissions draft, or nil.

func (e *Editor) PermissionsDraftOpen() bool

PermissionsDraftOpen reports whether an agent-submitted You-only permissions draft card is currently open.

func (e *Editor) PermissionsDraftPreviewYAML() []PermissionsDraftYAMLLine

PermissionsDraftPreviewYAML returns the diff lines showing what permissions.yaml will change for the currently ticked rules.

func (e *Editor) PermissionsDraftTickedCount() int

PermissionsDraftTickedCount returns how many rules are currently ticked in the open permissions draft.

func (e *Editor) PermissionsErr() error

PermissionsErr returns the parse/load error if the project's permissions.yaml was invalid when opened.

func (e *Editor) PermissionsFocusedRule() int

PermissionsFocusedRule returns the 0-based index of the currently focused rule in Settings › Permissions, or -1 if none.

func (e *Editor) PermissionsPath() string

PermissionsPath returns the path of permissions.yaml for the open project (or an explicit path loaded via LoadProjectPermissions), or "" when no project is open.

func (e *Editor) PermissionsSettingsOpen() bool

PermissionsSettingsOpen reports whether the Settings › Permissions page is open.

func (e *Editor) PhysicsLayers() *sceneformat.PhysicsLayerTable

PhysicsLayers returns the active named collision layer table: the open project's physics.layers when present, otherwise the table set by SetPhysicsLayers, or nil.

func (e *Editor) Pick3D(sx, sy, w, h float32) (objectIndex int, ok bool)

Pick3D casts the camera's ray (ScreenRay), in perspective or in orthographic, through viewport pixel (sx, sy) and returns the flat index (Objects3D's) of the deepest closest visible scene object it hits, nested and instanced children included. An object that draws a mesh or model in the scene's 3D build (Scene3D) is hit on the triangles of its geometry, through the build's scene3d picking, and any other object on its world-space 3D AABB (ObjectAABB3D); when a ray hits both an ancestor and one of its descendants without a nearer unrelated object between them, the deepest hit descendant wins. A press that hits geometry picks the geometry's object even when the box of an object without geometry is nearer, since such boxes are a fixed size whatever the scene's scale and may enclose the camera or the whole level; the boxes are picked only where no geometry is hit. Objects hidden or locked in the editor (SetObjectHidden, SetObjectLocked), with their descendants, and the objects of hidden and locked layers (SetLayerVisible, SetLayerLocked) are passed over.

func (e *Editor) Pick3DObject(sx, sy, w, h float32) (string, bool)

Pick3DObject returns the ID of the deepest closest visible 3D object hit at viewport pixel (sx, sy).

func (e *Editor) PickAgentPointWorld(wx, wy float32) bool

PickAgentPointWorld completes "Let me point" with the clicked world coordinate (wx, wy).

func (e *Editor) PickAndAttachAgentReferenceImages()

PickAndAttachAgentReferenceImages opens the native file picker (or Editor.PickAgentReferenceFiles in tests) for PNG, JPEG, and WebP images and attaches any chosen files to the next request.

func (e *Editor) PickAskInPlaceSuggestion(index int) (AgentTurn, error)

PickAskInPlaceSuggestion selects suggestion index and immediately starts an in-place agent turn with it.

func (e *Editor) PickComponentGizmo3D(sx, sy, w, h float32) (PickedComponentGizmo3D, bool)

PickComponentGizmo3D hit-tests the selected object's 3D component gizmo handles at viewport pixel (sx, sy).

func (e *Editor) PickGeneratedCandidate(requestID, candidateID string) error

PickGeneratedCandidate writes EXACTLY the picked media file and its <file>.source.yaml sidecar to the open project atomically as ONE undoable History step. Calling Editor.Undo() once removes both files (or restores prior bytes if overwriting).

func (e *Editor) PickGizmo2D(x, y float32) GizmoHandle2D

PickGizmo2D returns the part of the selected object's 2D gizmo under the canvas point (x, y), Handle2DBody over the selected object away from its handles, or Handle2DNone. It is Handle2DNone whenever the gizmo is not shown (Gizmo2DShown).

func (e *Editor) PickGizmo3D(sx, sy, w, h float32) GizmoAxis3D

PickGizmo3D hit-tests the active 3D gizmo handles on the currently selected object(s) using render3d.Gizmo in the active Global or Local coordinate frame.

func (e *Editor) PickGridMapCell(c world3d.GridCoord) bool

PickGridMapCell makes the item and orientation stored at cell c active, returning true if the cell was occupied.

func (e *Editor) PickHandle3D(sx, sy, w, h float32) Handle3DKind

PickHandle3D hit-tests interactive light and 3D camera handles on the currently selected object.

func (e *Editor) PickNavRegionEdge2D(x, y float32) int

PickNavRegionEdge2D returns the polygon edge index whose midpoint handle lies under the canvas point (x, y) on the selected object's navregion2d polygon, or -1 if none.

func (e *Editor) PickNavRegionVertex2D(x, y float32) int

PickNavRegionVertex2D returns the polygon vertex index under the canvas point (x, y) on the selected object's navregion2d polygon, or -1 if none.

func (e *Editor) PickOccluderEdge2D(x, y float32) int

PickOccluderEdge2D returns the polygon edge index whose midpoint handle lies under the canvas point (x, y) on the selected object's occluder2d polygon, or -1 if none.

func (e *Editor) PickOccluderVertex2D(x, y float32) int

PickOccluderVertex2D returns the polygon vertex index under the canvas point (x, y) on the selected object's occluder2d polygon, or -1 if none.

func (e *Editor) PickRay3D(sx, sy, w, h float32) math3d.Ray

PickRay3D returns the world-space ray from the editor's 3D camera through viewport pixel (sx, sy).

func (e *Editor) PickRigHandle(x, y float32) RigHandle

PickRigHandle returns the rig editor handle under canvas point (x, y). Priority: attachment origin when a slot is selected and either the slot/attachment focus is active or the attachment origin is offset from the selected bone's joint; otherwise bone move joint, bone length tip, bone rotation ring, then attachment origin.

func (e *Editor) PickShapeHandle2D(x, y float32) (ShapeHandle2D, bool)

PickShapeHandle2D returns the interactive shape handle under canvas point (x, y), or false when none is hit.

func (e *Editor) PickTile(layer string, col, row int) bool

PickTile makes the tile in cell (col, row) of layer's inline tilemap (the active layer's when layer is empty) the active tile, as SetActiveTileID does, and reports whether the cell held one; an empty cell, one off the map, or a call while the scene plays leaves the active tile as it was and reports false. On a layered grid it picks from ActiveTileLayer (or the first tile layer) and copies the cell's flips into ActiveTileFlip.

func (e *Editor) PickingConnectionTarget() bool

PickingConnectionTarget reports whether connection target pick mode is active.

func (e *Editor) PinAgentReferenceImage(id, note string) (BriefPinNotice, error)

PinAgentReferenceImage copies the attached image with the given ID to art/reference/<name> and adds it to art.references in brief.yaml as one atomic, undoable Editor.History step. Undo removes both the copied file and the YAML entry cleanly.

func (e *Editor) PlaceModel3D(m ModelEntry, p Placement3D) (string, error)

PlaceModel3D adds an object that draws m to the active layer as one undoable step, resting on p: the object is placed so that the bounds of its geometry touch p from the side the surface faces (Placement3D.Normal), raised along the normal by how far the geometry reaches below its origin, so a unit box on the ground sits on it rather than half under it. With PlaceAlign3D and p on the scene's geometry, the object turns so that its +Y axis follows the surface's normal. The object is named after m (ModelEntry.Name), gets a new ID from it and is selected; placing a glTF model in a version 1 scene raises it to sceneformat.CurrentVersion, as PlaceObject does. It returns the new object's ID.

It refuses while playing, when the active layer is locked (SetLayerLocked) or draws in screen space, and when m's model does not load.

func (e *Editor) PlaceModelAt3D(m ModelEntry, sx, sy, w, h float32) (string, error)

PlaceModelAt3D places m where the Place tool puts it for viewport pixel (sx, sy) of a viewport w by h (PlacementAt3D, PlaceModel3D), and returns the new object's ID. It fails when the pixel's ray hits neither the scene's geometry nor the ground plane.

func (e *Editor) PlaceNavRegion2D(layer string, points [][2]float64) (string, error)

PlaceNavRegion2D places a new object with a built-in navregion2d component on layer (or ActiveLayer when empty) through History. When points is empty, a default 128x128 square centered on the object origin is used; otherwise points must contain at least 3 finite [x, y] vertices.

func (e *Editor) PlaceObject(layerName string, obj sceneformat.ObjectDoc) (string, error)

PlaceObject adds obj to layerName (or ActiveLayer when empty) as an undoable command, merging defaults from e.Prefabs when obj.Prefab matches a registered prefab. Returns the placed object's unique ID. It refuses a tree that nests deeper than sceneformat.MaxObjectDepth levels or holds a sheared sprite (see sceneformat.CheckObjectTree), or that reuses an ID, including one the scene gets from a scene it inherits or instances, and an object whose mesh and model fields sceneformat.CheckObjectModel refuses. Placing an object that draws a glTF model in a version 1 scene raises it to sceneformat.CurrentVersion, which Undo restores. A tree that instances a scene file (sceneformat.ObjectDoc.Scene) needs a Resolver that implements sceneformat.SceneResolver, and is refused unless the scene still resolves with it placed: see checkPlacedInstances.

func (e *Editor) PlaceOpenRig(layer string, x, y float32) (string, error)

PlaceOpenRig places the rig currently open in the rig editor into layer (active layer when empty) at (x, y), using its project-relative path (or RigPath), active atlas, active skin, and active animation.

func (e *Editor) PlaceParticles(layer, file, atlas string, x, y float32) (string, error)

PlaceParticles places a new object with the given particle emitter file and optional atlas at (x, y) on layer (ActiveLayer when empty) as an undoable command.

func (e *Editor) PlacePrefab(layerName, prefabName string, x, y float32) (string, error)

PlacePrefab instantiates a registered prefab at (x, y) on layerName as an undoable command.

func (e *Editor) PlaceRig(layer, rigPath, atlas, skin, animation string, x, y float32) (string, error)

PlaceRig places a new object with the built-in "skeletal" component referencing rigPath, atlas, skin and animation at (x, y) on layer (active layer when empty) as an undoable PlaceObject command.

func (e *Editor) PlaceScene(layerName, scenePath string, x, y float32) (string, error)

PlaceScene places an instance of the scene file at scenePath, a slash-separated path from the project root such as "scenes/enemy.scene.yaml", at (x, y) on layerName (or ActiveLayer when empty) as an undoable command, and returns the new object's ID, derived from the file's name. The saved scene keeps the reference (sceneformat.ObjectDoc.Scene), not a copy of the instanced objects, and the viewport draws them through sceneformat.Build. The editor's Resolver must implement sceneformat.SceneResolver; PlaceScene, through PlaceObject, refuses a file that fails to load or resolve, and one that leads back to the open scene (ScenePath). Placing an instance in a version 1 scene raises it to sceneformat.CurrentVersion, which Undo restores.

func (e *Editor) PlacementAt3D(sx, sy, w, h float32) (Placement3D, bool)

PlacementAt3D returns where the Place tool puts a model for viewport pixel (sx, sy) of a viewport w by h: the nearest point where the camera's ray through the pixel (ScreenRay) hits the scene's geometry, passing over the objects hidden or locked in the editor as picking does, or where it crosses the ground plane, the horizontal plane at PlaceHeight3D, when it hits none. With PlaceSnap3D a point on the ground plane has its X and Z snapped to the 3D grid's spacing, which follows the camera's distance as the grid the viewport draws does; a point on the scene's geometry is not snapped, since the grid's spacing can far exceed the object under the pointer and a snapped point would leave its surface. It reports false when the ray hits no geometry and runs parallel to the ground plane or away from it.

func (e *Editor) PlanGhostsVisible() bool

PlanGhostsVisible reports whether planned viewport ghosts are currently toggled on.

func (e *Editor) PlanHeaderPillText() string

PlanHeaderPillText returns the top header pill label for the active plan phase.

func (e *Editor) PlanNeededForEdit(files []string, actions []PermissionAction) (bool, string)

PlanNeededForEdit evaluates files and actions against the project's active permissions.yaml rules to determine whether a request should propose a plan first and why.

func (e *Editor) PlanPickedLine() string

PlanPickedLine formats the answer summary banner shown once the plan leaves Draft ("Picked for you: ..." or "Your answers: ...").

func (e *Editor) PlanSeq() uint64

PlanSeq returns a monotonically increasing sequence number for plan state changes.

func (e *Editor) PlanStatusBarLine() string

PlanStatusBarLine returns the compact status-bar summary for the active plan (for example "Plan · 5 steps · 10 objects").

func (e *Editor) PlanStepBadgeForNode(name string) int

PlanStepBadgeForNode returns the 1-based plan step number badge for an existing Scene Tree layer or object, or 0 if none.

func (e *Editor) PlanSummaryLine() string

PlanSummaryLine returns the live plan card summary (for example "5 steps · 3 files · 10 objects · about 2 min · ~35k tokens").

func (e *Editor) PlannedNewTreeNodeCount() int

PlannedNewTreeNodeCount returns how many non-existing planned nodes are scheduled in the active plan.

func (e *Editor) Play() error

Play snapshots the current SceneDoc and starts a live game.Loop on the editor's attached core.Scope. Call EditorView(cx, ed) or AttachScope(cx) beforehand, or call PlayIn(cx) with an explicit scope.

func (e *Editor) PlayActiveInput() replay.ActionSource

PlayActiveInput returns the active replay.ActionSource for the running Play session: the replay.Player while replaying a recording, otherwise the 60-second rolling recorder wrapping PlayInputSource.

func (e *Editor) PlayAgentActive() bool

PlayAgentActive reports whether the Play mode Agent tab has an active question, sent marks thread, or stepping progress.

func (e *Editor) PlayAgentPill() string

PlayAgentPill returns the viewport agent status pill text (e.g. "agent stepping frames 4 800–4 812"), or "".

func (e *Editor) PlayAgentSteps() []PlayAgentStep

PlayAgentSteps returns a copy of the step rows shown in the Play mode Agent tab.

func (e *Editor) PlayClip() error

PlayClip plays the open clip on the scene from the playhead (from the start when a clip that does not loop is at its end). With a scope attached (EditorView or AttachScope) a game.Loop at PlayRate advances it; otherwise call StepClip.

func (e *Editor) PlayCutscene() error

PlayCutscene starts fixed-step preview playback of the open timeline cutscene on game.Loop.

func (e *Editor) PlayFrames() int

PlayFrames returns the number of draw frames executed in the current or last Play session.

func (e *Editor) PlayGeneratedSoundCandidate(requestID, candidateID string) error

PlayGeneratedSoundCandidate auditions an in-memory generated sound candidate without writing anything to disk.

func (e *Editor) PlayIn(cx *core.Scope) error

PlayIn snapshots the current SceneDoc (as deterministic YAML), builds an isolated runtime copy, and starts a live game.Loop on cx calling OnPlayUpdate and OnPlayDraw. Calling Stop stops the loop, dispatches any unsent Play marks as one thread, and restores the exact pre-play SceneDoc snapshot.

func (e *Editor) PlayInspectorTab() PlayInspectorTab

PlayInspectorTab returns the active right-panel tab during Play mode (PlayTabInspector or PlayTabAgent).

func (e *Editor) PlayLastReplayPath() string

PlayLastReplayPath returns the project-relative path of the most recently saved Play replay file, or empty.

func (e *Editor) PlayMarks() []PlayMark

PlayMarks returns a copy of all marks recorded in the current or most recent Play session.

func (e *Editor) PlayModelPreviewAnimation(relPath string, index int) error

PlayModelPreviewAnimation starts or resumes playback of animation index (or the active animation when index < 0) on relPath.

func (e *Editor) PlayParticlePreview() error

PlayParticlePreview starts or resumes the live particle preview loop.

func (e *Editor) PlayPaused() bool

PlayPaused reports whether Play mode is currently paused (frozen).

func (e *Editor) PlayPhysics() *sceneformat.PhysicsScene

PlayPhysics returns the active runtime PhysicsScene constructed from built-in physics components while playing, or nil when stopped.

func (e *Editor) PlayRateHz() int

PlayRateHz returns the fixed update rate in Hz used by Play mode (60 when PlayRate <= 0).

func (e *Editor) PlayReplay() *replay.Recording

PlayReplay returns the active replay.Recording while watching a playtest run in Play mode, or nil otherwise.

func (e *Editor) PlayReplayIn(cx *core.Scope, rec *replay.Recording, recordingPath string, runIndex int) error

PlayReplayIn starts Play mode on cx driven by rec (such as a recording opened from the Playtest Report screen's "Watch run N" button).

func (e *Editor) PlayReplayPath() string

PlayReplayPath returns the slash-separated path of the recording currently playing in Play mode, or empty.

func (e *Editor) PlayReplayPlayer() *replay.Player

PlayReplayPlayer returns the active replay.Player driving Play mode while watching a recording, or nil otherwise.

func (e *Editor) PlayReplayRunIndex() int

PlayReplayRunIndex returns the 1-based playtest run index being watched in Play mode, or 0.

func (e *Editor) PlayRig() error

PlayRig starts playing the active rig animation through the runtime skeletal.Skeleton. With a core.Scope attached (EditorView or AttachScope), a game.Loop advances it; otherwise call StepRig.

func (e *Editor) PlayRollingFrameCount() int

PlayRollingFrameCount returns how many input frames are currently kept in Play mode's rolling 60-second buffer.

func (e *Editor) PlayRollingMaxFrames() int

PlayRollingMaxFrames returns the maximum rolling replay buffer capacity in frames (60 * PlayRateHz, 3,600 at 60 Hz).

func (e *Editor) PlayRollingRecording() *replay.Recording

PlayRollingRecording returns a snapshot copy of Play mode's current rolling replay.Recording (version 2).

func (e *Editor) PlayRollingSummary() string

PlayRollingSummary returns the Play-mode replay sidebar summary text, e.g. "Last 60 s kept · 3 600 frames".

func (e *Editor) PlayRollingWindowStart() int

PlayRollingWindowStart returns the first absolute Play frame retained in the rolling 60-second window.

func (e *Editor) PlayScene() *sceneformat.BuiltScene

PlayScene returns the active runtime BuiltScene while playing, or nil when stopped.

func (e *Editor) PlayStates() error

PlayStates starts fixed-step preview playback of the open state machine on game.Loop.

func (e *Editor) PlaySteps() int

PlaySteps returns the number of fixed simulation updates executed in the current or last Play session.

func (e *Editor) PlayTaskDot() PlayTaskDotState

PlayTaskDot returns the Play-mode corner dot state: visible only when at least one failed, waiting, or ready-to-review task exists, colored by the most urgent state (TaskFailed > TaskNeedsYou > TaskReadyToReview), with a hover label naming the count and reminding the person to stop Play to open it.

func (e *Editor) PlayTick(dt time.Duration)

PlayTick advances local Play mode by one fixed simulation step of duration dt, recording input into the 60-second rolling buffer and recovering panics into the Output panel.

func (e *Editor) PlayTimeScale() float64

PlayTimeScale returns the current Play mode time scale (1 when unset).

func (e *Editor) PlayTriggerEvents() []sceneformat.PhysicsTriggerEvent

PlayTriggerEvents returns a copy of all built-in physics trigger events recorded during the current or last Play session.

func (e *Editor) Playing() bool

Playing reports whether Play mode is currently active.

func (e *Editor) PlayingGeneratedSound() (string, string)

PlayingGeneratedSound returns the currently auditioning (requestID, candidateID), or ("", "") when idle.

func (e *Editor) PlaytestReportOpen() bool

PlaytestReportOpen reports whether the full-window Playtest Report screen is currently active.

func (e *Editor) PlaytestSession() *PlaytestReportSession

PlaytestSession returns the active PlaytestReportSession (even while the screen is closed), or nil if no report has been loaded.

func (e *Editor) PluginDragging2D() bool

PluginDragging2D reports whether a plugin tool currently owns a 2D viewport drag.

func (e *Editor) PluginDragging3D() bool

PluginDragging3D reports whether a plugin tool currently owns a 3D viewport drag.

func (e *Editor) PluginEnabled(name string) bool

PluginEnabled reports whether the plugin name is on.

func (e *Editor) PluginPlural(pluginName, key string, count int, args ...l10n.Arg) string

PluginPlural translates a pluralized key from the named registered plugin's localization catalog in the editor's active language. If the plugin is not registered or has no catalog, key is returned.

func (e *Editor) PluginT(pluginName, key string, args ...l10n.Arg) string

PluginT translates key from the named registered plugin's localization catalog in the editor's active language. If the plugin is not registered or has no catalog, key is returned.

func (e *Editor) PluginTool() (plugin, id string, ok bool)

PluginTool returns the plugin and ID of the active plugin tool, and false when the active tool is not a plugin's.

func (e *Editor) Plural(key string, count int, args ...l10n.Arg) string

Plural translates a pluralized key in the editor's active language using the editor's localization catalog.

func (e *Editor) PointerRevision() uint64

PointerRevision returns a counter incremented whenever the viewport pointer position changes.

func (e *Editor) PollDiskChanges() DiskPollResult

PollDiskChanges checks the open scene, open clip, game.yaml, and the project tree for changes made on disk outside the editor. Clean files reload automatically (as an undoable History step with a quiet reload notice); dirty files are never overwritten under the author and instead raise a conflict offering Compare, Reload from disk, and Keep mine. The file browser refreshes automatically whenever the project tree changes.

func (e *Editor) PollProfiler(ctx context.Context) error

PollProfiler queries game_perf_readout (including frame history) and game_perf_zones from the connected game, updates the recorded frame history and zone table, and refreshes the UI.

func (e *Editor) Post(fn func())

Post schedules fn onto the editor's UI scope when attached, or invokes fn inline otherwise.

func (e *Editor) PostSketchReading(reading SketchReading) error

PostSketchReading records the agent's restatement of the active sketch marks and assumptions, opening the reading card in the Sketch/Agent panel while keeping the scene_edit hold gate active until the user answers Go ahead, Correct a mark, or replies in words.

func (e *Editor) PrefabNames() []string

PrefabNames returns the names of all registered prefabs in Editor.Prefabs, sorted alphabetically.

func (e *Editor) PrepareCodeReviewCheckRun() (*CodeReviewCheckRun, error)

PrepareCodeReviewCheckRun snapshots the active code review and marks checks running on the editor goroutine.

func (e *Editor) PrepareExternalAgentBaseline()

PrepareExternalAgentBaseline snapshots the scene before an external MCP tool mutates it so the turn's review diff includes the very first edit of a terminal/scripted MCP session.

func (e *Editor) PressStatesAction(action string)

PressStatesAction holds a named input action (such as "move_left", "move_right", "jump", "attack", "hurt") while Drive with keys is enabled.

func (e *Editor) PreviewCheckpoint(id string) error

PreviewCheckpoint enters read-only History preview mode for persistent checkpoint id without mutating Doc or History. When the checkpoint contains the open scene, ActiveScene() renders its pre-turn scene snapshot read-only in the viewport.

func (e *Editor) PreviewHistoryEntry(id uint64) error

PreviewHistoryEntry renders the scene snapshot recorded at timeline entry id read-only in the viewport without mutating Editor.Doc or moving Editor.History's undo cursor.

func (e *Editor) PreviewSafeRename(oldRel, newName string) (*SafeRenamePlan, error)

PreviewSafeRename opens the References screen in safe-rename review mode for oldRel -> newName (either a bare stem such as "slime_green" or a full slash-separated project path), computing the exact dry-run line diffs and non-rewritten Go warnings WITHOUT writing any file to disk.

func (e *Editor) PrimaryDiskConflict() (DiskConflict, bool)

PrimaryDiskConflict returns the highest-priority active external-change conflict (scene, then project, then clip), if any.

func (e *Editor) PrioritizeBuildPreset(platform string)

PrioritizeBuildPreset moves platform to be the next queued preset in build order.

func (e *Editor) ProblemAgentPanelOpen() bool

ProblemAgentPanelOpen reports whether the right-hand Agent problem panel is visible.

func (e *Editor) ProblemCount() int

ProblemCount returns the number of visible (non-ignored) problems found by the last completed project check. It is safe to call from any goroutine.

func (e *Editor) ProblemErr() error

ProblemErr returns any fatal error that prevented checking the open project's root directory, or nil. It is safe to call from any goroutine.

func (e *Editor) ProblemOverlayVisible() bool

ProblemOverlayVisible reports whether the Spec Problem overlay is drawn on live objects in the viewport (true by default, synchronized with the Problem legend toggle).

func (e *Editor) ProblemQuestions() []ProblemQuestionRecord

ProblemQuestions returns a copy of questions asked via AskAboutProblem.

func (e *Editor) Problems() []assetcheck.Problem

Problems returns a copy of the visible (non-ignored) problems found by the last completed project check, sorted by file, line, column and message. It is safe to call from any goroutine.

func (e *Editor) ProfilerConnected() bool

ProfilerConnected reports whether the editor's profiler is currently connected to a running game (remote MCP client or active Play-in-editor session).

func (e *Editor) ProfilerMetric() ProfilerMetric

ProfilerMetric returns the currently active chart metric in the full Profiler panel.

func (e *Editor) ProfilerOpen() bool

ProfilerOpen reports whether the full Profiler panel is currently visible below the viewport.

func (e *Editor) ProfilerSnapshot() ProfilerSnapshot

ProfilerSnapshot returns an immutable snapshot of the editor's current profiler readout, recorded frames, sorted zones, and highlighted spike. It is safe to call from any goroutine.

func (e *Editor) ProjectAudioFiles() ([]string, error)

ProjectAudioFiles lists slash-separated relative paths of audio files (.wav, .ogg, .mp3, .m4a, .flac, .aac, .opus) inside the open project.

func (e *Editor) ProjectCanonicalSavePending() bool

ProjectCanonicalSavePending reports whether the open project has not yet been saved in canonical YAML form by SaveProject during this session.

func (e *Editor) ProjectCutscenes() []CutsceneEntry

ProjectCutscenes returns all *.cutscene.yaml / *.cutscene.yml files discovered in the open project (plus the currently open cutscene if it has no project file), with name, kind, length and review status. Disk scanning is cached by (ProjectPath, filesRev) so high-frequency timeline playback never walks or parses project files on disk.

func (e *Editor) ProjectDirty() bool

ProjectDirty reports whether the open project differs from the game.yaml it was opened from or last saved to.

func (e *Editor) ProjectDisplayName() string

ProjectDisplayName returns the human-readable project name for the header breadcrumb.

func (e *Editor) ProjectFiles() ([]ProjectFile, error)

ProjectFiles lists the files and directories of the open project, the directory of ProjectPath, in the order fs.WalkDir visits them: by name, each directory followed by what it holds. It leaves out the directories refs.Scan skips, those whose names start with "." or "_" and those named testdata, with what they hold, and like Scan it passes over a directory below the root that it cannot read. It returns ErrNoProject without a project.

func (e *Editor) ProjectHDRs() []string

ProjectHDRs lists the slash-separated paths of Radiance HDR (.hdr, .pic) environment files in the open project, sorted alphabetically.

func (e *Editor) ProjectLoading() bool

ProjectLoading reports whether the editor is currently loading a project.

func (e *Editor) ProjectLoadingPath() string

ProjectLoadingPath returns the project path currently being loaded, if any.

func (e *Editor) ProjectModels() []string

ProjectModels returns the slash-separated paths of the open project's glTF models, sorted: every .gltf and .glb file ProjectFiles lists, and the output of every model target of game.yaml's assets section (project.ModelTarget.Out), whether or not `game assets` has built it yet. It returns nil without a project. The files are listed again only when the editor changes which files the project holds or reloads its built assets (ReloadAssets), or after RefreshSearch.

func (e *Editor) ProjectResourceFiles() ([]string, error)

ProjectResourceFiles lists slash-separated relative paths of files inside the open project (excluding game.yaml and nsgo.yaml) suitable for autoload.resources.

func (e *Editor) ProjectRoomsFiles() []string

ProjectRoomsFiles lists all *.rooms.yaml and *.rooms.yml files in the open project.

func (e *Editor) ProjectRules() string

ProjectRules returns the plain Markdown contents of the project's AGENTS.md file.

func (e *Editor) ProjectRulesCount() int

ProjectRulesCount returns the number of Markdown list-item rules (lines starting with "- " or "* ") in AGENTS.md.

func (e *Editor) ProjectRulesDirty() bool

ProjectRulesDirty reports whether the in-memory AGENTS.md content differs from disk.

func (e *Editor) ProjectRulesExists() bool

ProjectRulesExists reports whether the project has an AGENTS.md file on disk or authored in the editor.

func (e *Editor) ProjectRulesPath() string

ProjectRulesPath returns the path to AGENTS.md in the open project, or empty when no project is open.

func (e *Editor) ProjectSceneFiles() ([]string, error)

ProjectSceneFiles lists slash-separated relative paths of .yaml/.yml files inside the open project (excluding game.yaml and nsgo.yaml) suitable for autoload.scenes.

func (e *Editor) ProjectSettingsOpen() bool

ProjectSettingsOpen reports whether the Settings view is open on the Project page.

func (e *Editor) ProjectSettingsSection() ProjectSettingsSection

ProjectSettingsSection returns the active section in the Project Settings panel, defaulting to ProjectSectionGeneral.

func (e *Editor) ProjectTemplates() []ProjectTemplate

ProjectTemplates returns the project templates configured on the Start Screen (from `game new`'s template registry).

func (e *Editor) ProjectTextures() []string

ProjectTextures returns the slash-separated paths of image files in the open project that can be assigned to Material.Texture, sorted.

func (e *Editor) Projection3D(w, h float32) Projection3D

Projection3D returns the camera projection and drawing helpers for a 3D viewport of size w x h. When w or h is non-positive, it falls back to the editor's current canvas or virtual viewport size.

func (e *Editor) ProposeAgentPlan(proposal AgentPlan) (*AgentPlan, <-chan AgentPlanDecision, error)

ProposeAgentPlan stages a proposed plan in Draft phase without modifying any scene or file, switches the right rail to the Agent tab, and returns a channel that receives the person's decision (approved with answers/edited steps, or stopped).

func (e *Editor) ProposeAssetImports(paths []string)

ProposeAssetImports marks the given project-relative asset paths as newly proposed imports awaiting review.

func (e *Editor) ProposeBriefReview(next *project.Brief, summary, rationale, source string) (*DocReview, error)

ProposeBriefReview validates next, builds a canonical YAML diff against the current brief.yaml, and queues a pending DocReview without modifying the open brief or disk until KeepDocReview is called.

func (e *Editor) ProposeCodeReviewFiles(req CodeReviewProposeRequest) error

ProposeCodeReviewFiles stages or updates pending Go and companion YAML files for review without writing them to disk. Calling it while a review is already active updates the existing turn in place (advancing Round for round 2 fixes) rather than creating a second turn, resets Go confirmations for modified code, and recomputes line-tagged diffs.

func (e *Editor) ProposeFileDeletion(relPath, reason string) (*ProposedDeletion, error)

ProposeFileDeletion adds a proposed file deletion to the Review changes panel WITHOUT deleting the file on disk. It inspects the file's line count, preview lines, and scene usages via FindUsages, and refuses You-only files, symlinks, .git/**, game.yaml, open scene tabs, and files larger than 1 MiB.

func (e *Editor) ProposeProblemFix(prob assetcheck.Problem, explanation string, edit ProblemFixEdit) (ProposedProblemFix, error)

ProposeProblemFix stages a validated, non-mutating proposed fix from an agent for a live problem. It simulates the edit on a clone of the target scene to verify validity and compute the exact before/after YAML diff, then opens the Agent problem card. It NEVER modifies any open document, history, or file.

func (e *Editor) ProposeProjectRulesReview(nextMarkdown, summary, rationale, source string) (*DocReview, error)

ProposeProjectRulesReview builds a line diff against the current AGENTS.md and queues a pending DocReview without modifying AGENTS.md or disk until KeepDocReview is called.

func (e *Editor) ProposeSuggestedRule(id string) (*DocReview, error)

ProposeSuggestedRule turns suggested rule id into a reviewable DocReview targeting AGENTS.md. AGENTS.md is not modified until the person keeps the review.

func (e *Editor) ProposedFixFor(p assetcheck.Problem) (ProposedProblemFix, bool)

ProposedFixFor returns the pending proposed fix matching p, if any.

func (e *Editor) ProposedFixes() []ProposedProblemFix

ProposedFixes returns a copy of all pending agent-proposed fixes.

func (e *Editor) PruneCheckpoints() (int, error)

PruneCheckpoints drops the oldest completed checkpoints under .nsgo/checkpoints/ until total storage is within CheckpointMaxBytes (defaulting to DefaultCheckpointMaxBytes), keeping at least the newest checkpoint and never deleting an active turn. Returns the number of dropped checkpoints.

func (e *Editor) PublishCredentialAccount(dest PublishDestination) string

PublishCredentialAccount returns the non-secret display label for dest's keychain entry.

func (e *Editor) PushCommits() error

PushCommits pushes local commits on the current branch to its upstream (or sets upstream on origin when none is configured).

func (e *Editor) PushCommitsAsync(cx *core.Scope) error

PushCommitsAsync pushes commits off the UI thread and posts the result back to the editor scope.

func (e *Editor) QueryTiles(opts TileQueryOptions) (TileQueryResult, error)

QueryTiles finds matching cells and groups them into connected regions on an inline tilemap layer.

func (e *Editor) QueueAgentRequest(prompt string) AgentQueuedRequest

QueueAgentRequest appends a request to the queue with its timestamp without executing it.

func (e *Editor) QueuedToastCount() int

QueuedToastCount returns how many additional toasts are waiting behind the visible toast.

func (e *Editor) QueuedToasts() []Toast

QueuedToasts returns a snapshot of the waiting toasts behind the active toast, in FIFO order.

func (e *Editor) RandomBrushSeed() uint64

RandomBrushSeed returns the fixed seed used by ToolRandomTile.

func (e *Editor) RandomBrushTiles() []WeightedTile

RandomBrushTiles returns a copy of the weighted tiles used by ToolRandomTile.

func (e *Editor) RaycastTerrain3D(sx, sy, w, h float32) (world3d.TerrainHit, bool)

RaycastTerrain3D casts a ray from the 3D viewport camera through pixel (sx, sy) and intersects it against the open terrain's Heightmap.

func (e *Editor) ReadSceneYAMLForLocate() ([]byte, error)

ReadSceneYAMLForLocate returns the open scene's YAML bytes for line/snippet inspection: when the scene is clean on disk it reads the verified, size-capped disk file (preserving comments); otherwise it returns Editor.SaveYAML.

func (e *Editor) ReadyToReviewTurns() []AgentTurn

ReadyToReviewTurns returns all automation/background AgentTurns currently waiting in Ready to review.

func (e *Editor) ReassignTilesetEditMask() error

ReassignTilesetEditMask commits the pending conflicting mask (TilesetEditMask) to the selected tile, clearing the previous owner in the same undo step.

func (e *Editor) RebindShortcut(cmdID, newShortcut string) error

RebindShortcut binds cmdID to newShortcut (or unbinds it when newShortcut is empty). It checks for conflicts ONLY within cmdID's scope, returning *ShortcutConflictError if another command in the same scope already owns newShortcut. Keys used only in a different scope bind immediately. When Editor.SettingsPath is set, the change is persisted to disk.

func (e *Editor) Rebuild()

Rebuild resolves e.Doc against e.Resolver into e.Built. The scene's 3D build (Scene3D) is brought up to date the next time the 3D viewport draws or picks; a 3D gizmo drag in progress changes only the dragged object's transform, which moves its built node in place.

func (e *Editor) RecallLastComposerPrompt() bool

RecallLastComposerPrompt restores the most recently sent prompt into an empty composer (Spec: ↑ in empty composer).

func (e *Editor) RecentProjects() []RecentProjectEntry

RecentProjects returns the editor's recent projects in most-recently-opened order, marking each entry whose directory or game.yaml is currently missing on disk.

func (e *Editor) ReconnectAgent()

ReconnectAgent restarts the reconnect sequence from try 1 of 5 (used by the Disconnected chip's Reconnect button).

func (e *Editor) RecordAgentFileEdit(file string, yamlData []byte, why string) error

RecordAgentFileEdit validates and applies raw YAML content to file (game.yaml, data table, clip, prefab, or scene) in memory inside the currently working agent turn without writing to disk.

func (e *Editor) RecordAgentRequest(count int)

RecordAgentRequest increments this week's local agent request counter.

func (e *Editor) RecordAgentReviewOutcome(kept bool, count int)

RecordAgentReviewOutcome records whether reviewed agent changes were kept or reverted.

func (e *Editor) RecordAgentStep(threadID, requestID string, step AgentThreadStep) error

RecordAgentStep appends or updates a step on requestID in threadID, merges its Objects/Files onto the request for Inspector attribution, and persists the thread.

func (e *Editor) RecordAgentToolCall(rec AgentToolCallRecord)

RecordAgentToolCall records one MCP tool call into the Agent panel, tracking consecutive failures of the same tool and pausing the request automatically after AgentStuckFailureThreshold (3) consecutive failures.

func (e *Editor) RecordAgentTurn(opts AgentTurnOptions, fn func() error) error

RecordAgentTurn executes fn as a single undoable agent turn on History, recording the agent's request title, change/kept counts, and any extra touched project files so the turn appears as one entry on the History timeline and can be undone or restored atomically.

func (e *Editor) RecordAgentTurnStep(label string)

RecordAgentTurnStep appends a short progress step to the active agent turn (shown in the Agent panel).

func (e *Editor) RecordAgentTurnSummary(turnID, summary string) *AgentMismatchReport

RecordAgentTurnSummary sets the summary on turnID (or latest turn) and runs the editor's automatic summary-vs-diff mismatch check against the turn's actual review.

func (e *Editor) RecordBlockedAgentStep(tool, text string, eval PermissionEvaluation) string

RecordBlockedAgentStep records a step stopped by a Deny permission rule in the live Agent panel thread, keeping its RuleIndex so clicking it opens Settings › Permissions at the exact matching rule.

func (e *Editor) RecordBlockedPermission(eval PermissionEvaluation, summary string) BlockedPermissionStep

RecordBlockedPermission records a step blocked by a Deny rule so the UI can show it and link directly to its rule in Settings › Permissions.

func (e *Editor) RecordCheckpointFile(relPath string) error

RecordCheckpointFile snapshots the pre-turn bytes of relPath into the active checkpoint before the turn first modifies relPath. Repeated calls for the same path in the same turn are no-ops, preserving the original pre-turn bytes. Binary files are stored verbatim. Refuses paths outside the project root, symlinks, .nsgo/, .git/, and You-only files.

func (e *Editor) RecordExternalAgentToolCall(clientName, toolName, summary string, isErr bool)

RecordExternalAgentToolCall records a tool call executed by a terminal-started MCP session so its work appears as an agent turn in the panel.

func (e *Editor) RecordPlayAgentStep(text, status string)

RecordPlayAgentStep appends a custom progress step to the Play mode Agent tab.

func (e *Editor) RecordPlaytestRun(runs int)

RecordPlaytestRun increments the local headless playtest run counter shown in Settings › Usage and privacy.

func (e *Editor) RecordRecentProject(name, dir string) error

RecordRecentProject adds or moves the project at dir to the top of the recent projects list with the current UTC timestamp, and persists the list to Editor.RecentProjectsPath when set.

func (e *Editor) RecordReviewOutcome(rec ReviewOutcomeRecord)

RecordReviewOutcome records a kept or reverted review outcome for rule suggestion detection.

func (e *Editor) RecordReviewOutcomes(recs ...ReviewOutcomeRecord)

RecordReviewOutcomes appends multiple review outcomes at once.

func (e *Editor) RecordSketchReviewEdits(label string, addedIDs, changedIDs, removedIDs []string)

RecordSketchReviewEdits records scene edits performed by the agent after the user approved a sketch, opening the review card with the Sketch overlay toggle enabled so the person can Keep or Revert.

func (e *Editor) Redo() bool

Redo re-applies the last undone edit in History (or the last undone manual edit in an open cutscene review; no-op while playing). A step that fails to re-apply stays undone, and the status bar says why.

func (e *Editor) RedoAgentRewind() error

RedoAgentRewind restores the files, conversation turns, session ID, and composer draft from the last RewindAgentTurn.

func (e *Editor) RedraftCommitMessage() error

RedraftCommitMessage regenerates the commit summary and description from the currently included files using Editor.CommitMessageDrafter or DefaultCommitDraft.

func (e *Editor) RedraftReleaseNotes() (ReleaseNotesDraft, error)

RedraftReleaseNotes regenerates the release notes from git commits and kept reviews, overwriting the release notes Markdown file on disk.

func (e *Editor) ReduceMotion() bool

ReduceMotion reports whether reduced motion is active for viewport overlays and animations: it honors an explicit SetReduceMotion override when set, otherwise follows the attached UI scope's Environment.ReduceMotion().

func (e *Editor) References() []refs.Ref

References returns a copy of the Find References results for ReferencesTarget.

func (e *Editor) ReferencesScreen() *ReferencesScreenState

ReferencesScreen returns a snapshot of the active References screen state, or nil when closed.

func (e *Editor) ReferencesTarget() string

ReferencesTarget returns the slash-separated project path currently inspected in the Find References view, or empty when none is active.

func (e *Editor) RefineGeneratedAsset(ctx context.Context, requestID, words string) (*AssetGenerationRequest, error)

RefineGeneratedAsset re-invokes the generator with additional refinement words while keeping the exact same references. Nothing is written to disk.

func (e *Editor) RefreshAgentAPIKeyStatus() bool

RefreshAgentAPIKeyStatus queries NSGo's core.Secrets / system keychain for the built-in API key and caches whether one is present.

func (e *Editor) RefreshAssetDrawer()

RefreshAssetDrawer invalidates the cached asset drawer scan and forces a fresh rescan from disk and refs.

func (e *Editor) RefreshBuildPreflight() error

RefreshBuildPreflight runs the BEFORE EVERY BUILD checks (nsgo check, smoke playtest summary, budgets from game.yaml) and re-evaluates readiness for every preset.

func (e *Editor) RefreshChanges() error

RefreshChanges reloads Git branch, upstream ahead/behind counts, changed files, diffs, and scene comparisons for the active Changes session.

func (e *Editor) RefreshChangesCount()

RefreshChangesCount updates the lightweight working-tree changed-file count displayed in the status bar.

func (e *Editor) RefreshConnectedDevices() ([]ConnectedDevice, error)

RefreshConnectedDevices queries connected USB devices via Editor.DeviceDiscoverer (or `adb devices -l` on desktop) and updates the RUN ON DEVICE Android USB state.

func (e *Editor) RefreshDetectedLocalAgents() []FirstRunAgentOption

RefreshDetectedLocalAgents re-scans locally installed agent CLIs (respecting FirstRunDetectAgents if set), caches the result, and if Step 2 Connect is currently active with "apikey" selected only because no local agent was previously found, auto-selects the first newly detected local agent.

func (e *Editor) RefreshGeneratedAssetLicenses() []credits.GeneratedAssetLicense

RefreshGeneratedAssetLicenses scans every *.source.yaml in the open project and updates the LICENSES · CHECKED AT EXPORT list.

func (e *Editor) RefreshHUDScreens() error

RefreshHUDScreens rescans *.screen.yaml files and locales/*.yaml string tables from the open project directory.

func (e *Editor) RefreshRemote() error

RefreshRemote queries the connected running game for its latest scenes, layers, live entities, selected entity components, loop state, and tunables.

func (e *Editor) RefreshSearch() error

RefreshSearch rescans the open project from disk, refreshes the file browser listing and updates any active search or Find References results. It returns ErrNoProject when no project is open.

func (e *Editor) RegenerateAsset(ctx context.Context, requestID string) (*AssetGenerationRequest, error)

RegenerateAsset re-invokes the generator for N fresh candidates with the same prompt and references. Nothing is written to disk.

func (e *Editor) RegisterCommand(cmd EditorCommand) error

RegisterCommand adds a custom command to the editor's unified command registry. It refuses an empty or invalid ID, missing Label or Run, a duplicate ID, an invalid shortcut, or any shortcut that clashes with an existing built-in, custom, or plugin shortcut.

func (e *Editor) RegisterDataTableRowType(pattern string, rt *datatable.RowType) error

RegisterDataTableRowType registers rt for datatable YAML files matching pattern. If a matching table is already open, it is validated against rt before the registration takes effect.

func (e *Editor) RegisterPlugin(p Plugin) error

RegisterPlugin makes p available to the editor. It is on while the open project names it under editor.plugins in game.yaml, or after SetPluginEnabled turns it on. RegisterPlugin refuses a name that is empty, has spaces or control characters or is already registered, a panel, inspector, tool or command without its ID, title, label, component or function, a panel or tool ID or component name with control characters, a command ID with spaces or control characters, a panel with an unknown dock, two panels, inspectors, tools or commands of p with the same ID or component, and any command whose shortcut is invalid or clashes with an already-registered shortcut. The editor keeps a copy of p's lists.

func (e *Editor) RegisterViewportOverlay(o ViewportOverlay) error

RegisterViewportOverlay registers a custom viewport overlay directly on the editor. It refuses an empty or invalid ID, missing name or Draw function, or an ID that clashes with a built-in or previously registered overlay.

func (e *Editor) RegisteredMCPTools() []AgentToolInfo

RegisteredMCPTools returns the tools registered on the editor's MCP server (or DefaultAgentMCPTools before a server attaches), sorted by name.

func (e *Editor) RegisteredPlugins() []string

RegisteredPlugins returns the names of the registered plugins in the order they were registered.

func (e *Editor) ReimportAsset(relPath string) error

ReimportAsset runs `go tool game assets` for relPath (or Editor.SelectedFile when relPath is empty) off the UI goroutine, streaming output into the Output panel, and reloads changed atlases and textures once the build succeeds.

func (e *Editor) RejectHeldPermissionLoosening(id string) error

RejectHeldPermissionLoosening rejects an externally loosened rule or profile change, keeping the stricter rule active and writing the stricter effective permissions back to permissions.yaml so disk matches.

func (e *Editor) ReleaseAllStatesActions()

ReleaseAllStatesActions releases every held movement/action input so the character returns to idle.

func (e *Editor) ReleaseBuildRunning() bool

ReleaseBuildRunning reports whether a Build and Release screen run is active.

func (e *Editor) ReleaseBuildStopped() bool

ReleaseBuildStopped reports whether the last release build was stopped mid-run and can be resumed.

func (e *Editor) ReleaseDryRun() bool

ReleaseDryRun reports whether the Build and Release screen is configured for dry-run builds.

func (e *Editor) ReleaseDryRunOutput() string

ReleaseDryRunOutput returns the exact `releaseplan.WriteDryRun` output for the latest release build.

func (e *Editor) ReleaseNotesAbsPath() (string, error)

ReleaseNotesAbsPath resolves and validates the absolute path of the release notes Markdown file inside the open project.

func (e *Editor) ReleaseNotesFile() string

ReleaseNotesFile returns the project-relative Markdown file path used for RELEASE NOTES and read by `game release -release-notes`. It uses ExportReleaseNotes() when set, otherwise DefaultReleaseNotesFile.

func (e *Editor) ReleasePlanCommandLine() string

ReleasePlanCommandLine returns the combined POSIX-quoted `go ... tool nsgo build ...` command line matching `game release -dry-run` for the included presets of the latest build.

func (e *Editor) ReleaseStatesAction(action string)

ReleaseStatesAction releases a held input action in Drive with keys mode.

func (e *Editor) ReleaseUploadRunning() bool

ReleaseUploadRunning reports whether a user-confirmed store upload batch is currently running.

func (e *Editor) ReloadAssets() (ReloadAssetsResult, error)

ReloadAssets scans the open project's built atlas and texture outputs declared in game.yaml, reloads any that changed on disk into Editor.Resolver (updating AtlasMap entries or existing *sprite.Atlas values in place and invoking AssetReloader when implemented), rebuilds the open scene so the viewport reflects the new frames immediately, refreshes the asset browser and tile palette, and re-runs Problems check.

func (e *Editor) ReloadBrief() error

ReloadBrief reloads brief.yaml from disk for the open project.

func (e *Editor) ReloadFromDisk(kind DiskFileKind) error

ReloadFromDisk reloads the open file identified by kind from disk, recording the author's previous edits in History as "Unsaved edits before reload" so Undo restores them.

func (e *Editor) ReloadProjectRules() error

ReloadProjectRules reloads AGENTS.md from disk for the open project.

func (e *Editor) RemoteConnected() bool

RemoteConnected reports whether the editor currently has an active MCP client session to a running game.

func (e *Editor) RemoteConnecting() bool

RemoteConnecting reports whether the editor is currently waiting to establish a remote MCP connection to a running game.

func (e *Editor) RemoteConsoleHistory() []RemoteConsoleEntry

RemoteConsoleHistory returns the history of commands run through RemoteExecConsole.

func (e *Editor) RemoteExecConsole(command string) (gamemcp.ConsoleExecResult, error)

RemoteExecConsole executes a command line on the running game's debug console via game_console_exec, appends the result to RemoteConsoleHistory, and refreshes remote state.

func (e *Editor) RemoteLiveChanges() []RemoteLiveChange

RemoteLiveChanges returns a copy of all pending live component edits made through the remote inspector.

func (e *Editor) RemotePause() error

RemotePause pauses the running game's fixed-step loop via game_loop_pause.

func (e *Editor) RemoteResume() error

RemoteResume resumes the running game's fixed-step loop via game_loop_resume.

func (e *Editor) RemoteSetTimeScale(scale float64) error

RemoteSetTimeScale sets the running game's simulation time scale via game_loop_time_scale.

func (e *Editor) RemoteSetTunable(name string, value any, clamp bool) (gamemcp.TunableSetResult, error)

RemoteSetTunable updates a registered debug console tunable on the running game via game_tunable_set.

func (e *Editor) RemoteSnapshot() RemoteSnapshot

RemoteSnapshot returns a deep-enough copy of the latest remote game snapshot for UI rendering and inspection.

func (e *Editor) RemoteStep(count int) (gamemcp.LoopStepResult, error)

RemoteStep synchronously advances the running game by count fixed updates via game_loop_step, then refreshes the remote tree and selected entity inspection.

func (e *Editor) RemoveAgentMCPServer(name string) error

RemoveAgentMCPServer deletes a user-added external MCP server, persists editor.yaml, and removes it from the open project's agent MCP configuration. Refused when invoked by an agent.

func (e *Editor) RemoveAgentReferenceImage(id string) bool

RemoveAgentReferenceImage removes an attached one-shot image chip from the current composer draft.

func (e *Editor) RemoveAudioBusEffect(bus string, index int) error

RemoveAudioBusEffect deletes the effect at index from bus's effect chain through EditProject.

func (e *Editor) RemoveAutomationRule(id string) error

RemoveAutomationRule removes the automation with id and saves automations.yaml. Refuses agent actors (ErrAutomationYouOnly).

func (e *Editor) RemoveBriefGenre(label string) error

RemoveBriefGenre removes a genre label from brief.yaml as one undoable step.

func (e *Editor) RemoveBriefPlatform(platform string) error

RemoveBriefPlatform removes a platform from brief.yaml as one undoable step.

func (e *Editor) RemoveBriefPlaytestTarget(index int) error

RemoveBriefPlaytestTarget removes the playtest target at index from brief.yaml as one undoable step.

func (e *Editor) RemoveClipTrack(track int) error

RemoveClipTrack removes track track and all its keys from the open clip as an undoable command.

func (e *Editor) RemoveComponent(objectID, component string) error

RemoveComponent removes the component named component from objectID through History, together with every connection of the scene that needs it: one from objectID whose event the component declares, or one to objectID whose handler it declares, named either bare ("pressed") or with the component ("button.pressed"). A bare name is attributed to the component through its registered type, so without a component registry, or for a component the registry does not know, only connections that name the component ("button.pressed") are removed. Undo puts the component and those connections back where they were. Removing a component the object does not have is refused.

func (e *Editor) RemoveComposerChip(id string) bool

RemoveComposerChip removes an attached chip by ID. Returns true if a chip was removed.

func (e *Editor) RemoveConnection(index int) error

RemoveConnection removes Doc.Connections[index] as an undoable command. Undo puts it back at its original index.

func (e *Editor) RemoveExportPreset(platform string) error

RemoveExportPreset deletes the export preset for platform through EditProject as one undoable step. Removing the last preset when export.output is empty removes the empty export section.

func (e *Editor) RemoveFromSelection(ids ...string) bool

RemoveFromSelection removes ids from the current selection set. If SelectedID is removed, the last remaining selected object becomes primary (or selection clears when empty).

func (e *Editor) RemoveInputBinding(action string, index int) error

RemoveInputBinding removes binding index from action through EditProject.

func (e *Editor) RemoveLastComposerChip() bool

RemoveLastComposerChip removes the rightmost attached chip (triggered by Backspace in an empty composer).

func (e *Editor) RemoveLayer(name string) error

RemoveLayer removes the layer name, with its objects and its tilemap, from the open scene as an undoable command, together with the scene's connections from or to its objects, their descendants or the objects of scenes they instance; Undo puts the layer back where it was, with them. When the layer is the active one, the layer that takes its place in the file, or the one before it, becomes active.

func (e *Editor) RemoveLayerTilemap(layerName string) error

RemoveLayerTilemap removes the tilemap attached to layerName (or ActiveLayer when empty) as an undoable command. If the layer referenced a top-level tilemap via Ref, only the layer's reference is removed and the top-level entry in SceneDoc.Tilemaps is kept.

func (e *Editor) RemoveLocalizationKey(key string) error

RemoveLocalizationKey removes key from every locale in the Localization panel as an undoable command.

func (e *Editor) RemoveLocalizationLocale(locale string) error

RemoveLocalizationLocale removes locale and all its translations from the Localization panel as an undoable command.

func (e *Editor) RemoveNavRegionVertex(objectID string, index int) error

RemoveNavRegionVertex removes the vertex at index from objectID's navregion2d polygon through History. Removing below 3 vertices is refused.

func (e *Editor) RemoveOccluderVertex(objectID string, index int) error

RemoveOccluderVertex removes the vertex at index from objectID's polygon occluder2d component through History. Removing below 3 vertices is refused.

func (e *Editor) RemovePack(name string) error

RemovePack removes the installed pack called name from the open project, as library.PlanRemove describes, and saves the project. It empties the undo history and refuses as InstallPack does.

func (e *Editor) RemoveParticleBurst(index int) error
func (e *Editor) RemoveParticleColorStop(kind ParticleCurveKind, index int) error

RemoveParticleColorStop removes the color stop at index from the named color curve.

func (e *Editor) RemoveParticleFloatStop(kind ParticleCurveKind, index int) error

RemoveParticleFloatStop removes the control point at index from the named float curve.

func (e *Editor) RemoveParticleSubEmitter(index int) error
func (e *Editor) RemovePermissionRule(index int) error

RemovePermissionRule removes rule at index and persists permissions.yaml.

func (e *Editor) RemovePlanStep(stepNumber int) error

RemovePlanStep marks stepNumber as removed in Draft phase, hiding its ghosts and planned nodes and striking out any files exclusive to that step.

func (e *Editor) RemovePolygonVertex(objectID, component, field string, index int) error

RemovePolygonVertex removes the vertex at index from a FieldPolygon component field as one undoable SetComponentField step. Removing a vertex that would leave fewer than 3 vertices is refused.

func (e *Editor) RemoveProjectAutoloadResource(index int) error

RemoveProjectAutoloadResource removes the autoload resource entry at index through EditProject.

func (e *Editor) RemoveProjectAutoloadScene(index int) error

RemoveProjectAutoloadScene removes the autoload scene entry at index through EditProject. When the removed scene was autoload.mainScene, mainScene is cleared.

func (e *Editor) RemoveProjectPhysicsLayer(index int) error

RemoveProjectPhysicsLayer removes the physics layer at index through EditProject.

func (e *Editor) RemoveQueuedAgentRequest(id string) bool

RemoveQueuedAgentRequest removes one queued request by ID.

func (e *Editor) RemoveRecentProject(dir string) error

RemoveRecentProject removes the project at dir from the recent projects list and persists the change when RecentProjectsPath is set.

func (e *Editor) RemoveReviewNote(changeID string) error

RemoveReviewNote removes an unsent draft note from changeID. A note added and removed before SendReviewNotes never enters the pending batch and never reaches the agent.

func (e *Editor) RemoveRigAttachment(skin, slot string) error

RemoveRigAttachment removes slot's attachment entry from skin as an undoable command.

func (e *Editor) RemoveSceneOverlay(id string)

RemoveSceneOverlay removes all live scene overlay entries matching id.

func (e *Editor) RemoveStatesParam(name string) error

RemoveStatesParam removes parameter name from the open state machine as an undoable command.

func (e *Editor) RemoveStatesState(name string) error

RemoveStatesState removes a state (and transitions touching it) from the open state machine as an undoable command.

func (e *Editor) RemoveStatesTransition(index int) error

RemoveStatesTransition deletes transition index from the open state machine as an undoable command.

func (e *Editor) RemoveTilesetTerrain(name string) error

RemoveTilesetTerrain deletes terrain name and clears all tile mask assignments belonging to it as one undoable edit.

func (e *Editor) RemoveTilesetTileAnimFrame(tileID, frameIndex int) error

RemoveTilesetTileAnimFrame deletes animation frame frameIndex from tileID as an undoable edit.

func (e *Editor) RemoveTilesetTileShape(tileID, shapeIndex int) error

RemoveTilesetTileShape deletes collision shape shapeIndex from tileID as an undoable edit.

func (e *Editor) RenameAudioBus(oldName, newName string) error

RenameAudioBus renames an existing audio bus through EditProject.

func (e *Editor) RenameInputAction(oldName, newName string) error

RenameInputAction renames an existing action and updates every axis in input.axes whose negative or positive action references oldName, all in one undoable EditProject step.

func (e *Editor) RenameLayer(oldName, newName string) error

RenameLayer renames the layer oldName to newName as an undoable command, and with it the ActiveLayer and the layer's lock. It refuses an empty name and one another layer has, and, in a scene that inherits another, renaming a layer that extends one of the base's or to the name of one of them, since the name is what ties the layer to the base and its layer overrides. Other scene files that inherit the open one and name the layer are not rewritten.

func (e *Editor) RenameRigBone(oldName, newName string) error

RenameRigBone renames bone oldName to newName across parent references, slots, and animations as an undoable command.

func (e *Editor) RenderModelPreview(relPath string, width, height int) (*image.RGBA, error)

RenderModelPreview renders relPath at width x height pixels with the current orbit camera, effective import scale, and active animation pose using NSGo's software GPU renderer.

func (e *Editor) RenderSketchViewportPNG(scale float32) ([]byte, int, int, error)

RenderSketchViewportPNG renders the 2D viewport with the numbered sketch marks overlaid as a PNG image at scale pixels per point (defaulting to 1 when scale <= 0).

func (e *Editor) RenderStats3D() render3d.RenderStats

RenderStats3D returns the latest render3d.RenderStats evaluated for the 3D viewport at the current Camera3D and canvas size.

func (e *Editor) RenderViewportPNG(scale float64) ([]byte, int, int, error)

RenderViewportPNG renders the editor's current viewport (2D or 3D) into a PNG image at scale pixels per point, clamping non-finite scales and oversized pixel dimensions (max 1280 px on the longest edge), and returning the encoded PNG bytes and its pixel dimensions.

func (e *Editor) ReopenPlanQuestion(questionID string) error

ReopenPlanQuestion expands an already-answered question so the person can change their pick.

func (e *Editor) ReorderDataTableReviewRecord(key string, toIndex int) error

ReorderDataTableReviewRecord moves record key to 0-based position toIndex in the active file's row order. The reorder joins the review as the person's edit (filtered by Yours and tagged `you` in the YAML) and marks the agent's checks out of date.

func (e *Editor) ReorderHUDNode(nodeID string, delta int) error

ReorderHUDNode moves nodeID by delta (-1 for earlier, +1 for later) within its parent container in one undo step and saves the screen file.

func (e *Editor) ReorderObject(id string, index int) error

ReorderObject moves the object id to index among its siblings (the children of its parent, or its layer's top-level objects), as one undoable command; an index below 0 or past the last sibling puts it last. Its transform does not change.

func (e *Editor) ReorderQueuedTask(id string, delta int) error

ReorderQueuedTask moves queued task id earlier (delta < 0) or later (delta > 0) among queued tasks.

func (e *Editor) ReparentObject(id, parentID string, index int) error

ReparentObject moves the object id, with its descendants, under the object parentID at index among its children, or to the top level of its own layer at index when parentID is empty, as one undoable command; an index below 0 or past the last sibling puts it last. A child belongs to its parent's layer, so moving under an object of another layer moves it to that layer. The object keeps its world transform: its local transform is recomputed under the new parent in 2D, its depth too when the object or an old or new ancestor sets a 3D field, and its whole 3D world transform instead when one of them sets a 3D rotation (see keepWorldTransform); Undo restores the fields exactly. It refuses to move an object under itself or one of its descendants, a move that would nest deeper than sceneformat.MaxObjectDepth, and a move whose new world transform could not be written as a local one or would shear a sprite.

func (e *Editor) ReparentRigBone(name, newParent string, keepWorld bool) error

ReparentRigBone sets bone name's parent to newParent (empty for a root bone) as an undoable command. Cycles and unknown parents are refused. When keepWorld is true, local X, Y, Rotation, ScaleX and ScaleY are recomputed so the bone keeps its bind-pose world transform under newParent.

func (e *Editor) ReplaceMissingAsset(missingPath, srcFilePath string) error

ReplaceMissingAsset replaces a missing asset path by copying srcFilePath to missingPath on disk, refreshing refs and the asset drawer so the missing problem resolves immediately.

func (e *Editor) ReplayTips() error

ReplayTips clears the first-run review tip IDs from EditorSettings.SeenTips so each tip shows again (wired to Help › Replay tips and the first review's Replay tips button).

func (e *Editor) ReplayUpToFrame(rec *replay.Recording, stopFrame int) error

ReplayUpToFrame starts (or restarts) Play mode from the clean initial scene snapshot using rec as the input source, steps deterministically to stopFrame, and pauses Play mode there.

func (e *Editor) ReplayUpToPanic() error

ReplayUpToPanic replays the saved input recording for the latest panic in Play mode and stops and pauses one frame before the panic frame (panicFrame - 1) so the panic is not triggered.

func (e *Editor) ReplyAgentTurn(turnID, reply, status string) error

ReplyAgentTurn records an agent reply and/or status ("pending", "running", "done", "stopped") on turnID (defaulting to the latest turn when turnID is empty) so the Agent panel's thread updates live.

func (e *Editor) ReplyToSketchReading(message string) error

ReplyToSketchReading answers an agent sketch reading in words. It forwards the message through Editor.OnReplySketchReading and releases the hold gate so the agent can apply the clarified edits.

func (e *Editor) Report(err error)

Report shows err in the status bar as the editor's own panels show an edit it refuses, so a plugin's control does not drop the error silently; a nil err does nothing.

func (e *Editor) ReportAgentModelError(turnID string, state AgentLostState)

ReportAgentModelError attaches a model error card (such as Anthropic API 529 overloaded) to turnID.

func (e *Editor) ReportAgentStep(text string, objects []string, running bool) string

ReportAgentStep records a step reported directly by the agent in its own words (via agent_report_step), along with the scene object IDs it touches.

func (e *Editor) RequestCancelFirstRunBuild()

RequestCancelFirstRunBuild pauses building and opens the "Stop building?" confirmation dialog (triggered by Cancel or Esc during Building).

func (e *Editor) RequestCloseTab(index int) error

RequestCloseTab closes tab index immediately when clean; when the tab has unsaved edits, it prompts in EditorView to save, discard or cancel (leaving the shared project file untouched), or reports errUnsaved when no EditorView is mounted.

func (e *Editor) RequestCreateProject(req CreateProjectRequest) error

RequestCreateProject creates and opens the project described by req, asking first if there are unsaved edits.

func (e *Editor) RequestOpenDemo() error

RequestOpenDemo opens the built-in Demo Room, asking first if there are unsaved edits.

func (e *Editor) RequestOpenProject(path string) error

RequestOpenProject opens the project at path, replacing the current project cleanly. When the current session has unsaved edits, it opens the unsaved-edits confirmation prompt instead of replacing immediately.

func (e *Editor) RequestOpenScene(rel string) error

RequestOpenScene opens rel in a tab. When no agent turn is pending, it opens immediately (matching existing tab behavior). When an agent turn is pending, it asks to Keep, Revert, or Cancel first.

func (e *Editor) RequestPlaytestSuggestion(index int) (PlaytestPromptRequest, error)

RequestPlaytestSuggestion sends suggestion index i from Agent's read as an agent request that comes back as a review.

func (e *Editor) RequestRenameObject(id string) error

RequestRenameObject selects object id and asks the Scene Tree panel to start inline renaming of its row.

func (e *Editor) RequestSelectTab(index int) error

RequestSelectTab switches to open scene tab index, prompting Keep / Revert / Cancel first when switching away from the active tab while an agent turn is pending.

func (e *Editor) RequestTaskPermission(id, prompt, detail string) error

RequestTaskPermission transitions task id to TaskNeedsYou with the given permission prompt.

func (e *Editor) ResetAllShortcuts() error

ResetAllShortcuts removes all custom shortcut overrides, restoring every command to its default.

func (e *Editor) ResetAssetImportField(relPath, field string) error

ResetAssetImportField resets one overridden field of relPath's sidecar back to its inherited game.yaml default, removing the sidecar file when no overrides or credit remain.

func (e *Editor) ResetGridSize()

ResetGridSize clears any explicit GridSize override so the grid step defaults to the active layer's tilemap tile size (or 8 when it has none).

func (e *Editor) ResetLayout()

ResetLayout restores the default dock panel arrangement, clears hidden panels, persists to LayoutPath when set, and notifies subscribers.

func (e *Editor) ResetModelPreviewCamera(relPath string)

ResetModelPreviewCamera frames the model preview orbit camera on relPath's bounds from the default angle.

func (e *Editor) ResetPermissionsToPreset() error

ResetPermissionsToPreset resets the current profile's rules back to PermissionPreset(currentProfile).

func (e *Editor) ResetProfiler(ctx context.Context) error

ResetProfiler resets accumulated performance counters in the connected game via game_perf_reset (when connected) and clears the editor's recorded profiler timeline and zone table.

func (e *Editor) ResetProposedDeletion(relPath string)

ResetProposedDeletion returns a confirmed or kept proposed deletion back to DeletionPending.

func (e *Editor) ResetRigView()

ResetRigView centers the rig editor canvas on the rig origin at 2x zoom.

func (e *Editor) ResetShortcut(cmdID string) error

ResetShortcut restores cmdID to its default shortcut. If another command in the same scope currently holds cmdID's default shortcut, that command receives cmdID's previous shortcut so both remain bound without conflict.

func (e *Editor) ResetView2D() bool

ResetView2D returns the 2D view to the scene camera's view, which it then follows as the camera is edited. It reports false when the view already follows the camera or the scene plays.

func (e *Editor) ResetView3D()

ResetView3D puts the 3D viewport's camera back to DefaultOrbitCamera3D, looking at the world origin, keeping the projection. It ends a flight and cancels a gizmo or camera drag.

func (e *Editor) ResizeLayerTilemap(layerName string, left, right, top, bottom int) error

ResizeLayerTilemap grows (positive) or shrinks (negative) layerName's inline tilemap (single or layered, direct or referenced by Ref) from its left, right, top and bottom edges as an undoable command.

Painted cells keep their world positions: growing or shrinking from the left or top shifts cells inside the grid and adjusts OffsetX/OffsetY by -left*TileWidth and -top*TileHeight so every remaining painted tile stays at its exact world coordinates. Writing a non-zero offset on a version 1 or version 2 scene raises SceneDoc.Version to sceneformat.CurrentVersion (which Undo restores). It refuses non-positive resulting dimensions, grids exceeding the scene format's cell cap, layers without an inline tilemap, and inherited base-owned layers.

func (e *Editor) ResolveAgentModelRoute(task AgentTaskKind) AgentModelRoute

ResolveAgentModelRoute resolves the configured WHO DOES WHAT route label for task into an execution route.

func (e *Editor) ResolveChipPayload(chip AgentContextChip) AgentChipPayload

ResolveChipPayload computes the exact header, text, and/or image bytes for chip. Both the hover preview card and AssembleAgentRequest call this exact function.

func (e *Editor) ResolveMergeConflict(id string, choice MergeChoice) error

ResolveMergeConflict picks choice (MergeChoiceAgent, MergeChoiceMine, MergeChoiceTheirs, or MergeChoiceUnresolved) for conflict item id.

func (e *Editor) ResolveReviewConflict(changeID string, choice ReviewConflictChoice) error

ResolveReviewConflict sets how a conflicting change merges (Mine, Agent's, Both, or Unresolved).

func (e *Editor) ResolveTaskPermission(id string, allow bool) error

ResolveTaskPermission resolves a TaskNeedsYou permission ask, resuming the task when allowed or recording the refusal and resuming/notifying the optional callback.

func (e *Editor) ResolvedLanguage() string

ResolvedLanguage returns the active BCP-47 locale ("en" or "zh") used to render the editor UI and plugins. When Language() is LanguageSystem, it follows the attached scope's environment locale, resolving Simplified Chinese locales ("zh", "zh-CN", "zh-Hans", etc.) to "zh" and all others to "en".

func (e *Editor) ResolvedPlanFiles() []ResolvedPlanFile

ResolvedPlanFiles returns every file in the active plan with InPlan set to false when all steps touching it were removed.

func (e *Editor) ResolvedPlanGhosts() []ResolvedPlanGhost

ResolvedPlanGhosts returns the concrete viewport ghosts for all non-removed steps of the active plan, applying selected question option overrides and numeric repeat fields. Returns nil when ghosts are toggled off.

func (e *Editor) ResolvedPlanTreeNodes() []ResolvedPlanTreeNode

ResolvedPlanTreeNodes returns planned Scene Tree nodes for non-removed steps with interpolated names.

func (e *Editor) RespondPermissionRequest(id string, resp PermissionResponse) error

RespondPermissionRequest resolves the pending Ask permission request id with resp. When resp is PermissionResponseAlways, it also inserts and persists the new Allow rule and opens the "Always permission rule saved" toast with Show and Undo.

func (e *Editor) RestartParticlePreview()

RestartParticlePreview resets the live preview emitter and its PRNG so playback replays from t=0.

func (e *Editor) RestoreAgentTurnChange(changeID string) error

RestoreAgentTurnChange restores a previously reverted changeID inside the pending turn and immediately brings it back in live in-memory state.

func (e *Editor) RestoreAgentTurnFile(file string) error

RestoreAgentTurnFile restores every reverted change in file in memory.

func (e *Editor) RestoreAllFirstRunReview()

RestoreAllFirstRunReview restores every change in the First Review to kept.

func (e *Editor) RestoreAutomationCheckpoint(id string) error

RestoreAutomationCheckpoint restores the files captured in checkpoint id. Refuses agent actors (ErrAutomationYouOnly), Play mode (ErrPlaying), History preview (ErrHistoryPreview), symlink escapes, internal paths, and You-only targets.

func (e *Editor) RestoreCheckpoint(id string) error

RestoreCheckpoint restores every file recorded in checkpoint id back to its pre-turn bytes (removing files that did not exist before the turn) as one undoable step in History. Calling Undo reverts every file and open editor tab back to the state right before Restore. Refuses You-only files, symlinks, and restores while playing, on full-window screens, or during an active turn.

func (e *Editor) RestoreDataTableReviewRecord(key string) error

RestoreDataTableReviewRecord restores a reverted record key and marks the agent's checks out of date.

func (e *Editor) RestoreHistoryEntry(id uint64) error

RestoreHistoryEntry non-destructively rolls the open scene, project, and any touched extra files back to the state recorded at timeline entry id as ONE new undoable History step. Earlier and later entries remain in History and can still be previewed or restored; ONE Undo immediately returns to the state right before Restore.

func (e *Editor) RestorePlanStep(stepNumber int) error

RestorePlanStep restores a previously removed step in Draft phase.

func (e *Editor) RestorePreviewedHistory() error

RestorePreviewedHistory restores whichever History entry or persistent checkpoint is currently being previewed as ONE undoable step.

func (e *Editor) RestoreTileReviewRegionByIndex(index int) error

RestoreTileReviewRegionByIndex restores the 0-based region index.

func (e *Editor) ResumeAgentTurn(turnID string) error

ResumeAgentTurn resumes a stopped turn starting strictly at the first step not done. Steps already marked AgentStepDone are skipped and never redone.

func (e *Editor) ResumeAutomations() error

ResumeAutomations clears any active pause-for-today state so triggers fire normally again. Refuses agent actors (ErrAutomationYouOnly).

func (e *Editor) ResumeDataTableReview()

ResumeDataTableReview reopens a paused Data Table review at the exact file, focus, filter, and sort state.

func (e *Editor) ResumePlay()

ResumePlay resumes local Play mode from a paused state.

func (e *Editor) ResumeReleaseBuild() error

ResumeReleaseBuild resumes a previously stopped release build, keeping completed presets and continuing the interrupted preset from the step that was running.

func (e *Editor) ResumeReview() error

ResumeReview re-opens the full-window Review screen at the exact focused change and seen state left by PauseReview.

func (e *Editor) RetryAgentModelErrorNow(turnID string) error

RetryAgentModelErrorNow immediately retries a turn that failed with a model error.

func (e *Editor) RetryAgentTurn(turnID string) error

RetryAgentTurn immediately retries a turn waiting in model-error backoff (or re-runs a failed turn).

func (e *Editor) RetryFirstRunConnect()

RetryFirstRunConnect retries connecting the currently selected CLI agent.

func (e *Editor) RetryOpenScene() error

RetryOpenScene retries opening the scene recorded in SceneOpenError.

func (e *Editor) RetrySave() error

RetrySave retries saving after an autosave failure (or saves dirty auto-saveable targets immediately). On success it clears the failure state and updates the Saved timestamp; on failure it keeps the error in the status bar.

func (e *Editor) RetryTask(id string) error

RetryTask retries a failed task, starting it immediately if unblocked or queuing it cleanly.

func (e *Editor) ReturnToStartFromFirstRun()

ReturnToStartFromFirstRun returns to the Start Screen after Stop and delete the folder, keeping the author's idea and project name intact.

func (e *Editor) RevertAgentRequest(threadID, requestID string) error

RevertAgentRequest marks requestID in threadID as reverted (kept 0 changes).

func (e *Editor) RevertAgentTurn() error

RevertAgentTurn restores every touched file back to its exact pre-request state, marks the turn Reverted, and displays a Spec toast whose Undo action brings the turn back as pending. When no multi-file agent turn is open, it falls back to reverting an active single-scene live agent turn (BeginAgentTurn).

func (e *Editor) RevertAgentTurnChange(changeID string) error

RevertAgentTurnChange marks changeID as reverted inside the pending turn and immediately removes that change from live in-memory state.

func (e *Editor) RevertAgentTurnFile(file string) error

RevertAgentTurnFile marks every change in file as reverted and restores that file in memory.

func (e *Editor) RevertAllCutsceneReview() error

RevertAllCutsceneReview discards all pending review changes and manual review edits, closing the review and keeping the original cutscene untouched.

func (e *Editor) RevertAllDataTableReview() error

RevertAllDataTableReview discards all pending changes in the active Data Table review without modifying files on disk, closing the review with a one-step Undo toast that restores the review.

func (e *Editor) RevertAllFirstRunReview()

RevertAllFirstRunReview marks every change in the First Review as reverted.

func (e *Editor) RevertAllReviewChanges() error

RevertAllReviewChanges reverts all regular changes in the open review and dismisses all unapplied proposed deletions without touching disk.

func (e *Editor) RevertAllTileReview() error

RevertAllTileReview discards every pending region of the active tile review, restoring the exact pre-review tilemap.

func (e *Editor) RevertAndRedoReviewChange(changeID, note string) (ReviewNoteBatch, error)

RevertAndRedoReviewChange marks changeID reverted (for non-Go changes) and immediately sends this note (along with any other unsent draft notes) to the agent with RevertFirst=true.

func (e *Editor) RevertCodeReview() error

RevertCodeReview discards all unapplied pending YAML and Go changes and closes the review without touching disk.

func (e *Editor) RevertDataTableReviewRecord(key string) error

RevertDataTableReviewRecord marks record key as reverted and marks the agent's checks out of date.

func (e *Editor) RevertDocReview(id string) error

RevertDocReview dismisses the pending DocReview with id without modifying the document or disk.

func (e *Editor) RevertLayerOverrideField(layerName, fieldKey string) error

RevertLayerOverrideField removes one overridden field from SceneDoc.LayerOverrides[layerName] as one undoable step.

func (e *Editor) RevertLayerOverrides(layerName string) error

RevertLayerOverrides removes all overrides for layerName from SceneDoc.LayerOverrides as one undoable step.

func (e *Editor) RevertObjectOverrideField(objectID, fieldKey string) error

RevertObjectOverrideField removes one overridden field from objectID's override entry as one undoable step, pruning empty maps so the saved YAML stays clean.

func (e *Editor) RevertObjectOverrides(objectID string) error

RevertObjectOverrides removes all overrides for objectID as one undoable step. When objectID is a local scene instance root, it removes all entries in its Overrides map. When objectID is an instanced child or inherited object, it removes that object's override entry (and clears the owning Overrides map when it becomes empty).

func (e *Editor) RevertPendingAgentTurnReview()

RevertPendingAgentTurnReview undoes scene edits made during the latest agent turn back to its starting history index.

func (e *Editor) RevertProposedAssets()

RevertProposedAssets clears pending proposed imports from review state.

func (e *Editor) RevertRemoteLiveChange(index int) error

RevertRemoteLiveChange puts back the baseline scene value for live change index (sending game_component_set if still connected) and removes it from RemoteLiveChanges.

func (e *Editor) RevertReviewChange(id string) error

RevertReviewChange marks one non-deletion review item as reverted and runs its OnRevert hook if present.

func (e *Editor) RevertScene() error

RevertScene puts back the open scene as its file (FilePath) holds it now, as one undoable step, so Undo brings the reverted edits back. The scene is then clean, until Undo. It refuses while playing (ErrPlaying) and returns ErrNoSceneFile for a scene without a file, and the error of a file that no longer reads or parses, changing nothing then.

func (e *Editor) RevertSketchReview() error

RevertSketchReview reverts the agent's scene edits back to the pre-approval scene snapshot, closes the review, and KEEPS the sketch marks intact so the user can send them again.

func (e *Editor) RevertTask(id string) error

RevertTask reverts an unkept TaskReadyToReview turn (patching only objects touched by this task so edits from other parallel tasks or human edits are preserved), marks it TaskStopped, and starts the next queued task waiting for it. A turn already kept is never reverted by RevertTask.

func (e *Editor) RevertTileReviewRegionByIndex(index int) error

RevertTileReviewRegionByIndex marks the 0-based region index reverted.

func (e *Editor) ReviewBlockers() []ReviewBlocker

ReviewBlockers returns all active blockers on non-reverted changes in priority order: active YAML parse errors first ("Fix YAML on line N"), then unresolved merge conflicts ("Choose how <title> merges"), then any custom blockers.

func (e *Editor) ReviewChipCount(f ReviewFilter) int

ReviewChipCount returns the count for filter chip f.

func (e *Editor) ReviewDataTablePreviewFor(filePath string) *ReviewDataTablePreview

ReviewDataTablePreviewFor returns the small-table preview model for a focused data table file.

func (e *Editor) ReviewDraftNoteCount() int

ReviewDraftNoteCount returns how many changes currently have an unsent draft note.

func (e *Editor) ReviewEffectiveSceneDoc(filePath string) *sceneformat.SceneDoc

ReviewEffectiveSceneDoc returns a cloned copy of the live merged SceneDoc for filePath in the active review (applying non-reverted agent changes, auto-merged person edits, resolved conflicts, and valid hand edits).

func (e *Editor) ReviewFirstRunAsIs()

ReviewFirstRunAsIs bypasses the failed check fix proposal and enters First Review with the current files.

func (e *Editor) ReviewNoteComposerChangeID() string

ReviewNoteComposerChangeID returns the change ID whose inline note composer is currently open (or "").

func (e *Editor) ReviewNoteDraft() string

ReviewNoteDraft returns the live unsent draft text currently in the inline note composer.

func (e *Editor) ReviewObjectDocForChange(changeID string, round int) (*sceneformat.ObjectDoc, string, bool)

ReviewObjectDocForChange returns a deep clone of the change's scene ObjectDoc and layer for round (used by editormcp's review_redo to apply coordinate/field updates cleanly).

func (e *Editor) ReviewOpen() bool

ReviewOpen reports whether the full-window change-by-change Review screen is currently open.

func (e *Editor) ReviewOutcome() ReviewOutcome

ReviewOutcome returns the lifecycle status of the most recent agent turn review.

func (e *Editor) ReviewOutcomes() []ReviewOutcomeRecord

ReviewOutcomes returns a copy of all recorded review outcomes.

func (e *Editor) ReviewOverlays() []ReviewSceneOverlay

ReviewOverlays returns the inspectable list of change overlays for the focused review scene (or for the editor's open scene when the review is paused/pending in the editor).

func (e *Editor) ReviewPeekingBefore() bool

ReviewPeekingBefore reports whether the Review viewport is currently peeking at the pre-request scene.

func (e *Editor) ReviewReleaseUploads() error

ReviewReleaseUploads opens the Review uploads confirmation dialog listing every artifact, its size, destination (itch.io, Google Play internal testing, TestFlight), and version before anything is sent, and invokes OnReviewReleaseUploads (if set). It NEVER starts an upload automatically.

func (e *Editor) ReviewRevertAllDialogOpen() bool

ReviewRevertAllDialogOpen reports whether the Revert All confirmation dialog is currently shown.

func (e *Editor) ReviewRevertAllFileList() string

ReviewRevertAllFileList returns a human-readable list of files affected by Revert All for the confirmation dialog.

func (e *Editor) ReviewRound() int

ReviewRound returns the latest 1-based round number of the pending review (0 when none is pending).

func (e *Editor) ReviewRoundBannerText() string

ReviewRoundBannerText returns the banner copy shown beneath the filter chips once Round 2+ exists.

func (e *Editor) ReviewStatus() ReviewSnapshot

ReviewStatus returns a complete read-only snapshot of the current or most recent turn review.

func (e *Editor) ReviewUnsentOrPendingNoteCount() int

ReviewUnsentOrPendingNoteCount returns how many distinct changes currently have either an unsent draft note or a sent note awaiting redo (used by the Revert all warning dialog).

func (e *Editor) ReviewViewRound() int

ReviewViewRound returns the 1-based round currently being inspected in the Review screen.

func (e *Editor) ReviewViewingReadOnlyRound() bool

ReviewViewingReadOnlyRound reports whether the author is currently inspecting an earlier read-only round (for example Round 1 once Round 2 exists).

func (e *Editor) ReviewViewportPins() []ReviewViewportPin

ReviewViewportPins returns inspectable note pins for visible non-reverted scene objects in the focused review scene (when Review is open) or the open editor scene (when Review is paused).

func (e *Editor) ReviewViewportView2D() View2D

ReviewViewportView2D returns the Review center viewport's current 2D camera view for the focused scene.

func (e *Editor) ReviewVisibleRows() []ReviewVisibleRow

ReviewVisibleRows returns the flattened visible rows (file headers, kind headers, change cards) honoring the active filter chip, search query, and collapsed file/kind groups.

func (e *Editor) Revision() uint64

Revision returns a monotonically increasing counter bumped on every state change.

func (e *Editor) RewindAgentTurn(turnID string, mode AgentRewindMode) error

RewindAgentTurn rewinds the active agent thread to before turnID using mode:

  • AgentRewindBoth restores files from the turns' checkpoints and drops the target and later turns (restoring the session ID from before turnID).
  • AgentRewindFilesOnly restores files from the turns' checkpoints while keeping the conversation thread and session unchanged.
  • AgentRewindConversationOnly drops the target and later turns (and restores the session ID from before turnID) while keeping all files untouched.

In all modes, the rewound message returns to the composer and a post-rewind banner with Redo is shown.

func (e *Editor) RigAnimation() string

RigAnimation returns the active animation name in the rig editor, or "" for bind pose.

func (e *Editor) RigAnimationNames() []string

RigAnimationNames returns the sorted animation names defined in the open rig.

func (e *Editor) RigAtlas() string

RigAtlas returns the name of the atlas currently used to preview the open rig.

func (e *Editor) RigAtlasFrames() []string

RigAtlasFrames returns the sorted frame names in the rig editor's active atlas.

func (e *Editor) RigAttachmentOriginCanvasPos(slot string) (math2d.Vec2, bool)

RigAttachmentOriginCanvasPos returns the canvas position of slot's attachment origin handle (drawn offset along the attachment's local axes from the frame's top-left corner at the pivot), or false when the slot has no skin attachment.

func (e *Editor) RigBlending() bool

RigBlending reports whether the rig editor's runtime skeleton is currently crossfading.

func (e *Editor) RigBoneHandlePos(bone string) (origin, tip math2d.Vec2, ringRadius float32, ok bool)

RigBoneHandlePos returns the canvas positions of bone's origin joint, length tip handle, and rotation ring radius, or false when the bone is not found.

func (e *Editor) RigBoneSummary() string

RigBoneSummary returns a formatted readout for the rig status bar.

func (e *Editor) RigCanvasToWorld(cx, cy float32) (float32, float32)

RigCanvasToWorld converts a point on the rig editor canvas to rig world coordinates.

func (e *Editor) RigData() *skeletal.SkeletonData

RigData returns a deep copy of the open skeletal rig data, or nil when no rig is open.

func (e *Editor) RigDirty() bool

RigDirty reports whether the open rig has been edited since it was opened or last saved.

func (e *Editor) RigError() error

RigError returns the last rig preview or validation error, or nil.

func (e *Editor) RigOpen() bool

RigOpen reports whether a 2D skeletal rig is open in the rig editor.

func (e *Editor) RigPath() string

RigPath returns the file path or name of the open rig, or "".

func (e *Editor) RigPlaying() bool

RigPlaying reports whether the rig editor is currently playing an animation.

func (e *Editor) RigSkeleton() *skeletal.Skeleton

RigSkeleton returns the live runtime skeletal.Skeleton used by the rig editor preview, or nil.

func (e *Editor) RigSkin() string

RigSkin returns the active preview skin name in the rig editor, or "".

func (e *Editor) RigSkinNames() []string

RigSkinNames returns the sorted skin names defined in the open rig.

func (e *Editor) RigTime() time.Duration

RigTime returns the current playhead time in the rig editor.

func (e *Editor) RigWorldToCanvas(wx, wy float32) (float32, float32)

RigWorldToCanvas converts a point in rig world coordinates to rig editor canvas points.

func (e *Editor) RightPanelTab() RightPanelTab

RightPanelTab returns the currently visible tab of the editor's right-hand panel ("inspector" or "agent").

func (e *Editor) RightRailMode() RightRailMode

RightRailMode returns which panel currently occupies the right rail.

func (e *Editor) RightRailTab() RightRailTab

RightRailTab returns the active tab in the right sidebar (RightTabInspector, RightTabAgent, or RightTabHistory).

func (e *Editor) RoomCreateMode() bool

RoomCreateMode reports whether dragging in the 2D viewport draws a new room rectangle.

func (e *Editor) RoomGridSize() (w, h float32, ok bool)

RoomGridSize returns the active tile grid step (w, h) used to snap room edges: an explicit override set by SetRoomGridSize, else the active/first inline tilemap's tile size, else the first built external tilemap's tile size. Returns (0, 0, false) when neither an explicit grid nor a tilemap is present.

func (e *Editor) RoomHandleCanvasPos(roomID string, h RectHandle) (x, y float32, ok bool)

RoomHandleCanvasPos returns the canvas coordinates of handle h on roomID in the open room map.

func (e *Editor) RoomSnapToGrid() bool

RoomSnapToGrid reports whether moving, resizing, and drawing rooms in the 2D viewport snaps room edges to the scene's tile grid (default true).

func (e *Editor) Rooms() *rooms.Map

Rooms returns a deep copy of the currently open room map, or nil when none is open.

func (e *Editor) RoomsDirty() bool

RoomsDirty reports whether an open room map differs from what it was opened from or last saved to.

func (e *Editor) RoomsError() error

RoomsError returns the most recent validation error from editing the open room map, or nil.

func (e *Editor) RoomsLabel() string

RoomsLabel returns a short display label for the open room map (project-relative path when inside the open project, else file path, else "Untitled rooms").

func (e *Editor) RoomsPath() string

RoomsPath returns the file path or logical name of the open room map, or "".

func (e *Editor) RotateGridMapCell(c world3d.GridCoord, axis world3d.GridAxis, quarterTurns int) error

RotateGridMapCell rotates the occupied cell at c by quarterTurns 90-degree steps around axis as an undoable command.

func (e *Editor) RotateGridMapOrientation(axis world3d.GridAxis, quarterTurns int) error

RotateGridMapOrientation rotates the active GridMap item orientation by quarterTurns 90-degree steps around axis (world X, Y, or Z) through all 24 cube orientations, recorded as an undoable command.

func (e *Editor) RotateObject(id string, radians float32) error

RotateObject sets object id's rotation (in radians) as an undoable command. It refuses a rotation under which the object's or a descendant's sprite would be sheared by a non-uniformly scaled ancestor (see sceneformat.CheckObjectTree). When id names an instanced or inherited object, it records an override on its instance or inheriting scene.

func (e *Editor) RotateObject3D(id string, rotX, rotY, rotZ float32) error

RotateObject3D sets object id's 3D Euler rotation (rotX, rotY, rotZ) in radians as an undoable command.

func (e *Editor) RotateRigBone(name string, rotation float32) error

RotateRigBone sets bone name's bind-pose local rotation (radians, clockwise) as an undoable command.

func (e *Editor) RulesAgentNote() (note string, suggestions []string)

RulesAgentNote computes the contextual note and suggested asks for the "Agent on this page" card on Settings › Project rules.

func (e *Editor) RunAgentSceneEdit(file string, reasons map[string]string, fn func(target *Editor) error) error

RunAgentSceneEdit executes fn on the scene or prefab named by file (empty for the active open scene) inside the currently working agent turn. Edits apply in memory immediately without pushing onto History and without writing to disk. If fn returns an error, all mutations from fn are rolled back. Optional reasons (keyed by object ID, "obj:<id>", "obj:<id>::<field>", or "*") attach why notes to the derived structural changes.

func (e *Editor) RunAsAgent(fn func() error) error

RunAsAgent executes fn while marking edits as originating from the agent rather than manual UI input, so agent-initiated MCP calls can edit objects the agent is currently touching while manual edits stay blocked.

func (e *Editor) RunAutomationWithCheckpoint(title string, files []string, fn func() error) (*CheckpointSummary, error)

RunAutomationWithCheckpoint takes a pre-start checkpoint before running automation fn, keeps it active so every additional file fn touches is captured before its first write, and finalizes it.

func (e *Editor) RunBuildOnAndroidDevice() error

RunBuildOnAndroidDevice installs and launches the finished Android build onto the connected USB Android device using `go -C <dir> tool nsgo build -target <android-target> -run -device <serial>` (or Editor.DeviceCommandRunner).

func (e *Editor) RunBuildReadinessAction(platform, itemID string) error

RunBuildReadinessAction executes the fix/action for one readiness item on platform. Agent-capable items (such as writing PrivacyInfo.xcprivacy or adding touch controls) are performed directly on disk/project; person-required items invoke OnReleaseReadinessPersonAction.

func (e *Editor) RunBuildReadinessAgentSetup(platform string) error

RunBuildReadinessAgentSetup performs every agent-handleable readiness fix on platform, then hands off any remaining person-required items to OnReleaseReadinessPersonAction.

func (e *Editor) RunChangesChecks() error

RunChangesChecks runs nsgo check and nsgo test (or Editor.ChangesCheckRunner when set) and records the result and timestamp.

func (e *Editor) RunChangesChecksAsync(cx *core.Scope) error

RunChangesChecksAsync runs nsgo check and nsgo test off the UI thread and posts the result back to the editor scope.

func (e *Editor) RunCheckpointTurn(title string, fn func() error) (*CheckpointSummary, error)

RunCheckpointTurn runs fn inside BeginCheckpointTurn / EndCheckpointTurn, recording every file fn touches into one persistent checkpoint. If fn returns an error or panics and no files were modified, the empty checkpoint is discarded; if files were already modified, the checkpoint is kept so the partial turn remains restorable.

func (e *Editor) RunCodeReviewChecks(ctx context.Context) error

RunCodeReviewChecks synchronously runs nsgo check and nsgo test against the pending Go files via a Go build overlay, leaving every file on disk untouched.

func (e *Editor) RunCodeReviewChecksAsync() error

RunCodeReviewChecksAsync runs nsgo check and nsgo test off the UI thread and posts progress and final results back to the UI scope.

func (e *Editor) RunExportBuild() error

RunExportBuild launches a release build (or dry run) using the Export panel's current options.

func (e *Editor) RunGame() error

RunGame launches `go tool game dev` in the open project's directory using the editor's RunStartAtOpenScene and RunWithAutomation settings.

func (e *Editor) RunGameWith(opts RunGameOptions) error

RunGameWith launches `go tool game dev` in the open project's directory as a child process on desktop (or through Editor.RunGameCommand when set), streaming its standard output and error into the Output panel off the UI goroutine. Call StopGame or Close to terminate it and every process it started.

func (e *Editor) RunStartAtOpenScene() bool

RunStartAtOpenScene reports whether RunGame (and the toolbar Run button / F5 shortcut) starts the game at the currently open scene when one is open inside the project.

func (e *Editor) RunStoppedPlanAgain() (AgentPlanDecision, error)

RunStoppedPlanAgain restarts a stopped plan (same validation as ApproveAgentPlan).

func (e *Editor) RunTaskWithCheckpoint(title string, files []string, fn func() error) (*CheckpointSummary, error)

RunTaskWithCheckpoint takes a pre-start checkpoint before running autonomous task fn, keeps it active so every additional file fn touches is captured before its first write, and finalizes it.

func (e *Editor) RunWithAutomation() bool

RunWithAutomation reports whether RunGame passes `-automation` and connects the editor's Remote tab and inspector to the running game over MCP.

func (e *Editor) Save() error

Save saves what has unsaved edits, as the toolbar's Save button and Mod+S do, and records the open scene's view in the project's ViewStateFile (SaveViewState). An edited project file is saved first (SaveProject), whether or not the scene can be; an unedited one is left as written, comments included. An edited scene then goes to OnSave when it is set, else to FilePath (SaveFile), and an unedited one is left as written too, unless FilePath names no file yet. A scene with neither OnSave nor FilePath returns ErrNoSceneFile, unless it is unedited. It refuses while playing (ErrPlaying).

func (e *Editor) SaveAgentThread() error

SaveAgentThread writes the current task list to its plain-text YAML thread file when a project or ThreadsDir is set.

func (e *Editor) SaveAll() error

SaveAll persists all currently dirty editors (project, every dirty open scene tab, GridMap, terrain, room map, localizations, clip, cutscene, data table, skeletal rig, material, and kept multi-file agent turn files) that have a save destination configured.

func (e *Editor) SaveBrief() error

SaveBrief writes the current game brief to brief.yaml in canonical YAML form.

func (e *Editor) SaveClipFile(path string) error

SaveClipFile writes the open clip to path, replacing the file atomically, and remembers path as ClipPath.

func (e *Editor) SaveClipYAML() ([]byte, error)

SaveClipYAML encodes the open clip as deterministic YAML.

func (e *Editor) SaveConflictPromptOpen() bool

SaveConflictPromptOpen reports whether a Save operation hit an external disk conflict and is waiting for the author to confirm overwrite, reload, or cancel.

func (e *Editor) SaveCutsceneFile(filePath string) error

SaveCutsceneFile writes the open cutscene atomically to filePath and updates CutscenePath.

func (e *Editor) SaveCutsceneYAML() ([]byte, error)

SaveCutsceneYAML encodes the open cutscene as canonical deterministic YAML.

func (e *Editor) SaveDataTableFile(path string) error

SaveDataTableFile writes the open data table to path atomically and remembers path.

func (e *Editor) SaveDataTableYAML() ([]byte, error)

SaveDataTableYAML encodes the open data table to YAML, preserving exact bytes when unedited and changing only edited lines for single-cell updates.

func (e *Editor) SaveEditedGeneratedLicense() error

SaveEditedGeneratedLicense commits the user-entered license string and commercialUse flag to <asset>.source.yaml.

func (e *Editor) SaveFailed() bool

SaveFailed reports whether an automatic save is currently in a failed state.

func (e *Editor) SaveFailedForTab(tabID uint64) bool

SaveFailedForTab reports whether tabID currently has an active save failure.

func (e *Editor) SaveFile(path string) error

SaveFile encodes the scene to YAML and writes it to path, then rebuilds any other open tabs that instance or inherit scenes.

func (e *Editor) SaveGridMap() error

SaveGridMap encodes the open GridMap as canonical YAML and writes it through OnSaveGridMap when set, or atomically to its file path otherwise.

func (e *Editor) SaveGridMapFile(p string) error

SaveGridMapFile encodes the open GridMap as canonical YAML and writes it atomically to p.

func (e *Editor) SaveLayout() error

SaveLayout encodes the editor's current dock layout (dropping any non-existent panels) and writes it atomically to Editor.LayoutPath when set.

func (e *Editor) SaveLocalizationYAML(locale string) ([]byte, error)

SaveLocalizationYAML encodes locale's string table as deterministic canonical YAML.

func (e *Editor) SaveLocalizations() error

SaveLocalizations writes each locale's canonical YAML file to <LocalizationDir>/<locale>.yaml and removes files for locales that were loaded from disk and subsequently removed.

func (e *Editor) SaveLocalizationsTo(dir string) error

SaveLocalizationsTo writes each locale's canonical YAML file to <dir>/<locale>.yaml and sets dir as the workspace's localization directory.

func (e *Editor) SaveMaterial() error

SaveMaterial persists the open material via OnSaveMaterial when set, or to MaterialPath via SaveMaterialFile.

func (e *Editor) SaveMaterialFile(filePath string) error

SaveMaterialFile encodes the open material with resource.Encode, writes it atomically to filePath, remembers filePath, and reloads live resource libraries.

func (e *Editor) SaveMaterialYAML() ([]byte, error)

SaveMaterialYAML encodes the open material with resource.Encode.

func (e *Editor) SaveParticleEmitterFile(filePath string) error

SaveParticleEmitterFile encodes the open particle emitter to deterministic YAML, writes it atomically to filePath, remembers filePath, and hot-reloads matching live scene emitters.

func (e *Editor) SaveParticleEmitterYAML() ([]byte, error)

SaveParticleEmitterYAML encodes the open particle emitter as deterministic versioned YAML.

func (e *Editor) SavePlayRollingReplay() (relPath, absPath string, rec *replay.Recording, err error)

SavePlayRollingReplay atomically encodes and writes Play mode's rolling recording under replays/<scene>-<frame>.replay.yaml using replay version 2 YAML.

func (e *Editor) SaveProject() error

SaveProject writes the open project to ProjectPath in the canonical form project.Encode writes, which keeps no comments, and writes the fields game.yaml owns into the nsgo.yaml beside it when there is one (project.File.SyncNSGo), so the two never disagree.

func (e *Editor) SaveProjectPermissions() error

SaveProjectPermissions writes the editor's active permission rules to PermissionsPath().

func (e *Editor) SaveProjectRules() error

SaveProjectRules writes the current AGENTS.md content to disk.

func (e *Editor) SaveReleaseNotes() error

SaveReleaseNotes writes the current RELEASE NOTES text atomically to the exact Markdown file read by `game release -release-notes`, modifying ONLY that file.

func (e *Editor) SaveRigFile(filePath string) error

SaveRigFile writes the open rig atomically to filePath and remembers filePath as RigPath.

func (e *Editor) SaveRigYAML() ([]byte, error)

SaveRigYAML encodes the open rig as deterministic .skel.yaml bytes. When the rig was opened from existing YAML and has not been modified (or all edits were undone), SaveRigYAML returns the exact original bytes unchanged.

func (e *Editor) SaveRooms() error

SaveRooms persists the open room map to OnSaveRooms (when set) or its file path.

func (e *Editor) SaveRoomsFile(filePath string) error

SaveRoomsFile encodes the open room map to deterministic YAML and writes it atomically to filePath.

func (e *Editor) SaveRoomsYAML() ([]byte, error)

SaveRoomsYAML validates and encodes the open room map to deterministic YAML using rooms.Encode.

func (e *Editor) SaveSceneAs(rel string) (string, error)

SaveSceneAs writes the open scene to rel, a slash-separated path from the root of the open project, and makes that file the scene's: FilePath and ScenePath name it, Save writes there and OnSave, which persisted the scene before, is cleared. A path without a .yaml or .yml extension gets ".scene.yaml" (one ending in ".scene" gets ".yaml"), and SaveSceneAs returns the path it wrote. It refuses the names of the project's own files, game.yaml and nsgo.yaml, makes the directories the path needs and never overwrites another file (ErrFileExists); saving to the scene's own path saves it. It refuses while playing (ErrPlaying) and returns ErrNoProject without a project.

func (e *Editor) SaveSettings() error

SaveSettings persists the editor's current settings to SettingsPath (or DefaultSettingsPath() when SettingsPath is empty).

func (e *Editor) SaveStatesFile(path string) error

SaveStatesFile writes the open state machine atomically to path and updates StatesPath.

func (e *Editor) SaveStatesYAML() ([]byte, error)

SaveStatesYAML encodes the open state machine as canonical deterministic YAML.

func (e *Editor) SaveStatus() SaveStatus

SaveStatus returns the current save status for the status bar, unsaved dot, and editormcp tool warnings.

func (e *Editor) SaveStatusTooltip() string

SaveStatusTooltip returns the hover tooltip text for the Saved indicator in the status bar.

func (e *Editor) SaveTab(index int) error

SaveTab saves the scene in tab index to its OnSave callback or FilePath, leaving other tabs and the project file unchanged, and rebuilds any other open tabs that instance or inherit scenes.

func (e *Editor) SaveTerrain() error

SaveTerrain writes the open terrain's 16-bit PNG heightmap, weight/splat maps, foliage density maps, and deterministic *.terrain.yaml back to disk.

func (e *Editor) SaveTerrainTo(yamlPath string) error

SaveTerrainTo writes the open terrain's 16-bit grayscale PNG heightmap, weight/splat maps, foliage density maps, and deterministic *.terrain.yaml to yamlPath (creating parent directories as needed).

func (e *Editor) SaveTileset() error

SaveTileset writes the open tileset via OnSaveTileset if set, or atomically to its file path on disk.

func (e *Editor) SaveTilesetYAML() ([]byte, error)

SaveTilesetYAML validates and encodes the open tileset document to deterministic YAML.

func (e *Editor) SaveViewState() error

SaveViewState records the open scene's view, the 3D viewport's camera, in the open project's ViewStateFile, so opening the scene again shows it as it is now. The editor saves it itself as another scene opens, as the scene is saved and as the window closes; an app that ends the editor another way calls it first. It writes nothing without a project or for a scene outside it, and leaves the file as it is when it already holds this view. Creating the .game folder, it writes a .gitignore there that ignores everything in it, unless one is there already. Scenes the file lists whose files are gone are dropped from it, and a file that does not parse is written afresh; a file that does not read, or that a newer editor wrote, is left as it is and reported. A camera holding a value that is not finite is saved as DefaultOrbitCamera3D, so the file always loads.

func (e *Editor) SaveYAML() ([]byte, error)

SaveYAML encodes the current edit SceneDoc to deterministic YAML. If Play mode is active, it returns a copy of the pre-play snapshot so runtime simulation state never leaks into saved YAML.

func (e *Editor) ScaleObject(id string, sx, sy float32) error

ScaleObject sets object id's scale to (sx, sy) as an undoable command. It refuses a scale under which the object's or a descendant's sprite would be sheared, taking its ancestors' transforms into account (see sceneformat.CheckObjectTree). When id names an instanced or inherited object, it records an override on its instance or inheriting scene.

func (e *Editor) ScaleObject3D(id string, sx, sy, sz float32) error

ScaleObject3D sets object id's 3D scale (sx, sy, sz) as an undoable command. It refuses a scale under which the object's or a descendant's sprite would be sheared, taking its ancestors' transforms into account (see sceneformat.CheckObjectTree).

func (e *Editor) ScaleRigBone(name string, scaleX, scaleY float32) error

ScaleRigBone sets bone name's bind-pose local scale (scaleX, scaleY) as an undoable command.

func (e *Editor) Scene3D() (*scenemodel.Built, error)

Scene3D returns the open scene built in 3D by scenemodel.Build, the geometry and materials the 3D viewport draws and picks by, with its nodes posed as the viewport shows them: by the open animation clip at the playhead, by the running game while playing, and with the objects hidden in the editor (SetObjectHidden) and screen-space layers invisible. It returns nil and the error when the scene does not build, such as when a model it names does not load.

Models, material files and images load through the editor's Resolver when it implements scenemodel.ModelResolver, sceneformat.MaterialResolver or scenemodel.ImageResolver, and from the open project's files otherwise. A scene that instances or inherits other scene files is resolved first (sceneformat.Resolve), with the Resolver as its sceneformat.SceneResolver. The scene is built again only when what it looks like changes, not when an object moves, so the result stays the same between such edits and its nodes move in place.

func (e *Editor) SceneBreadcrumbName() string

SceneBreadcrumbName returns a concise scene label for the header breadcrumb.

func (e *Editor) SceneDirty() bool

SceneDirty reports whether the open scene differs from what it was opened from or last saved to. It compares encodings, as ProjectDirty does, so undoing back to the saved state makes the scene clean again. While playing it compares the scene as it was before Play.

func (e *Editor) SceneInstances(scenePath string) []string

SceneInstances returns the IDs of all local objects in the active scene that instance scenePath, in document order.

func (e *Editor) SceneLabel() string

SceneLabel names the open scene as the toolbar and window title show it: its path from the project root (ScenePath) when it has one, else its file's path (FilePath), else "Untitled".

func (e *Editor) SceneNodeCount() int

SceneNodeCount returns the total number of nodes (layers + all nested objects) in the open scene.

func (e *Editor) SceneObjectIDs() []string

SceneObjectIDs returns the IDs of every object in the open scene (including nested children and, when resolved, instanced or inherited objects) in document order.

func (e *Editor) SceneOpenError() *SceneOpenError

SceneOpenError returns a copy of the active scene-open error state, or nil when none.

func (e *Editor) SceneOverlays() []SceneOverlayEntry

SceneOverlays returns a deep copy of the active live scene overlay entries.

func (e *Editor) SceneRailObjectKind(id string) string

SceneRailObjectKind returns the concise Spec kind tag for an object row in the scene rail (e.g. "prefab", "sprite", "trigger", "group", "mesh", "light", "camera", "node").

func (e *Editor) SceneTaskOverlays() []ObjectTaskOverlay

SceneTaskOverlays returns all active numbered overlays (editing and holding) for running tasks in the open scene.

func (e *Editor) SceneTreeFilter() string

SceneTreeFilter returns the current left-rail Scene Tree search query.

func (e *Editor) SceneTreeFilterOpen() bool

SceneTreeFilterOpen reports whether the left-rail Scene Tree filter bar is visible.

func (e *Editor) SceneTreeTab() SceneTreeTab

SceneTreeTab returns whether the scene tree panel is showing the local scene document or the live remote tree.

func (e *Editor) SceneUsedPrefabs() []string

SceneUsedPrefabs returns the sorted, deduplicated project-relative paths of prefabs and instanced scenes referenced by objects in the open scene.

func (e *Editor) ScreenToCanvas(x, y float32) (float32, float32)

ScreenToCanvas converts a point on the scene's virtual screen, where screen-space layers draw, into a point on the viewport's canvas.

func (e *Editor) ScreenToGridMapCell(sx, sy, w, h float32) (world3d.GridCoord, bool)

ScreenToGridMapCell intersects the 3D camera ray at viewport pixel (sx, sy) with the active GridMap's current floor plane (Y = Origin.Y + floor*CellSize.Y) and returns the integer GridCoord on that floor.

func (e *Editor) ScreenToWorld(x, y float32) (float32, float32)

ScreenToWorld converts a point on the scene's virtual screen into world coordinates by inverting the scene's camera, as the game sees the world.

func (e *Editor) Search(query string) ([]SearchResult, error)

Search searches the open project for query across file names and paths, file UIDs, and inside scene files: scene names, inherits paths, object IDs and names, component types, and prefab or scene references. Matching is case-insensitive; space-separated terms must all match the same file or object. It returns ErrNoProject when no project is open.

func (e *Editor) SearchErr() error

SearchErr returns the last error encountered while indexing or searching the project.

func (e *Editor) SearchLoading() bool

SearchLoading reports whether the Search & References panel is currently scanning or searching.

func (e *Editor) SearchMentions(query string, group MentionGroup) []MentionItem

SearchMentions queries the @-mention index for query and group without mutating picker UI state.

func (e *Editor) SearchOpen() bool

SearchOpen reports whether the Project Search and References panel is open.

func (e *Editor) SearchQuery() string

SearchQuery returns the current query string in the project search field.

func (e *Editor) SearchResults() []SearchResult

SearchResults returns a copy of the current search panel results.

func (e *Editor) SearchTab() SearchTab

SearchTab returns the active tab of the Project Search and References panel.

func (e *Editor) SeekClip(at time.Duration)

SeekClip moves the playhead to at, clamped to the clip, and shows the scene posed by the clip there.

func (e *Editor) SeekCutscene(at time.Duration)

SeekCutscene scrubs the cutscene timeline playhead to at (clamped to [0, Length]) and poses the preview scene deterministically using cutscene.TimelinePlayer.

func (e *Editor) SeekModelPreviewAnimation(relPath string, t time.Duration) error

SeekModelPreviewAnimation scrubs the active model preview animation on relPath to timestamp t and evaluates the pose immediately.

func (e *Editor) SeekRig(at time.Duration)

SeekRig moves the rig editor's playhead to at and evaluates the pose through the runtime skeletal.Skeleton.

func (e *Editor) SeenTips() []string

SeenTips returns a sorted copy of the onboarding tip IDs already seen or skipped in EditorSettings.

func (e *Editor) Select3DAt(sx, sy, w, h float32) bool

Select3DAt picks the deepest closest 3D object under (sx, sy) and selects it (stepping up to its parent or instance root on a second press when already selected), or clears selection on empty space.

func (e *Editor) Select3DAtWith(sx, sy, w, h float32, shift, mod bool) bool

Select3DAtWith picks the deepest closest 3D object under (sx, sy) and applies selection with optional Shift (add) and Mod (toggle) modifiers.

func (e *Editor) Select3DAtWithModifiers(sx, sy, w, h float32, shift, mod, alt bool) bool

Select3DAtWithModifiers picks the deepest closest 3D object under (sx, sy) and applies selection with optional Shift (add), Mod (toggle), and Alt/Option (pick parent or owning scene instance root) modifiers. A repeated plain press on an already-selected nested child steps selection up to its parent (and instance root) before cycling back to the child.

func (e *Editor) SelectAgentThread(id string) error

SelectAgentThread switches to thread id. When id belongs to a different scene in the open project, SelectAgentThread opens or activates that scene's tab before entering thread id.

func (e *Editor) SelectAsset(atlasName, frameName string) bool

SelectAsset marks the named atlas frame as selected in the Asset Browser.

func (e *Editor) SelectAssetPath(relPath string)

SelectAssetPath selects the asset at relPath in the asset drawer and resets frame preview state.

func (e *Editor) SelectAudioBus(name string) bool

SelectAudioBus selects bus in the mixer panel when it exists in the open project.

func (e *Editor) SelectAudioFile(relPath string)

SelectAudioFile sets the project-relative audio file path selected for auditioning.

func (e *Editor) SelectBuildDevice(deviceID string)

SelectBuildDevice selects a run-on-device entry on the finished build view.

func (e *Editor) SelectBuildPreset(platform string)

SelectBuildPreset selects platform in the Build and Release screen's preset list.

func (e *Editor) SelectChangedFile(filePath string) error

SelectChangedFile selects the changed file at repo-relative path for preview in the Review layout.

func (e *Editor) SelectClipKey(track, key int)

SelectClipKey selects key key on track track in the animation editor; an index out of range clears the selection.

func (e *Editor) SelectCodeReviewFile(relPath string)

SelectCodeReviewFile switches the focused file in the Go code review screen.

func (e *Editor) SelectCutsceneClip(trackIdx, clipIdx int)

SelectCutsceneClip selects the clip at (trackIdx, clipIdx) on the displayed cutscene timeline.

func (e *Editor) SelectCutsceneClipByID(clipID string) bool

SelectCutsceneClipByID selects the clip with the given clip ID on the displayed cutscene timeline.

func (e *Editor) SelectDataTableReviewFile(index int) error

SelectDataTableReviewFile switches the active file in the Data Table review by 0-based index.

func (e *Editor) SelectDataTableReviewFileByPath(relOrName string) error

SelectDataTableReviewFileByPath switches the active file in the review by project-relative or base path.

func (e *Editor) SelectExportPlatform(platform string)

SelectExportPlatform selects platform in the Export panel when it has a preset in the open project.

func (e *Editor) SelectFile(relPath string)

SelectFile selects relPath, a slash-separated path from the open project's root, in the file browser.

func (e *Editor) SelectFirstRunAgent(kind string) error

SelectFirstRunAgent selects kind ("claude", "codex", or "apikey") in Connect in place.

func (e *Editor) SelectFirstRunPlanAnswer(optionID string) bool

SelectFirstRunPlanAnswer selects an answer option for the first plan's clarifying question, updating the affected step description live.

func (e *Editor) SelectGeneratedCandidate(requestID, candidateID string)

SelectGeneratedCandidate selects candidateID inside requestID for detailed style and source inspection.

func (e *Editor) SelectGeneratedRequest(requestID string)

SelectGeneratedRequest activates requestID in the Generated Assets screen.

func (e *Editor) SelectHUDNode(id string)

SelectHUDNode selects the node with id in the active screen.

func (e *Editor) SelectImportSliceCell(cell int)

SelectImportSliceCell selects the 0-based slice cell in the image import preview for per-cell pivot inspection and editing.

func (e *Editor) SelectInputAction(name string) bool

SelectInputAction selects action in the Input Map panel when it exists.

func (e *Editor) SelectInputBinding(index int) bool

SelectInputBinding selects binding index within the currently selected action.

func (e *Editor) SelectMarquee2D(x0, y0, x1, y1 float32, add, toggle bool, mode MarqueeMode) []string

SelectMarquee2D selects visible, unlocked objects matching the canvas rectangle from (x0, y0) to (x1, y1) directly (without an interactive drag) and returns the resulting selected object IDs.

func (e *Editor) SelectModel(m ModelEntry) error

SelectModel makes m the model the Place tool adds in the 3D viewport (SelectedModel), or with an empty entry clears it. It refuses an entry that names neither or both of a primitive and a file, or one of a kind an object cannot draw.

func (e *Editor) SelectModelPreviewAnimation(relPath string, index int) error

SelectModelPreviewAnimation selects animation index on relPath and evaluates its pose at time 0 (continuing playback if already playing, or remaining paused otherwise).

func (e *Editor) SelectNextObject() string

SelectNextObject selects the next visible, unlocked object in scene order (wrapping around to the first), returning the newly selected ID or "" when the scene has none. Used by Tab in the viewport region.

func (e *Editor) SelectObject(id string) bool

SelectObject selects the object with ID id (or clears selection if id == ""). Returns true if selection succeeded (or cleared).

func (e *Editor) SelectObjects(ids []string) bool

SelectObjects selects all valid existing objects in ids (deduplicated, preserving order). The last valid ID becomes SelectedID. Passing an empty slice clears the selection.

func (e *Editor) SelectObjectsWithPrimary(ids []string, primary string) bool

SelectObjectsWithPrimary replaces the current selection with the unique existing object IDs in ids. primary sets SelectedID when it appears in the resulting set; otherwise the first ID becomes primary. Passing an empty slice clears selection and returns true; passing only unknown IDs leaves selection unchanged and returns false.

func (e *Editor) SelectPaletteStamp(col0, row0, col1, row1 int) (TileStamp, error)

SelectPaletteStamp selects an inclusive rectangle of tiles from the active layer's tile palette grid (using TilePalette().Columns columns per row), sets it as the active stamp pattern, and returns it.

func (e *Editor) SelectPaletteStampRange(fromTileID, toTileID int) (TileStamp, error)

SelectPaletteStampRange selects the rectangle in the active tile palette spanning fromTileID to toTileID as the active stamp pattern.

func (e *Editor) SelectParticleStop(index int)
func (e *Editor) SelectPermissionProfile(profile PermissionProfile) error

SelectPermissionProfile switches to profile and fills the rule table with PermissionPreset(profile), persisting permissions.yaml when a project is open.

func (e *Editor) SelectPlaytestReportIndex(idx int)

SelectPlaytestReportIndex switches the active entry in the Playtest Report session (used by the BOT PROFILE switcher when multiple reports are loaded).

func (e *Editor) SelectPrefab(name string) bool

SelectPrefab marks the named registered prefab as selected in the Asset Browser (clearing SelectedAsset), or clears it when name is empty.

func (e *Editor) SelectPreviousObject() string

SelectPreviousObject selects the previous visible, unlocked object in scene order (wrapping around to the last), returning the newly selected ID or "" when the scene has none. Used by Shift-Tab in the viewport region.

func (e *Editor) SelectProjectTemplate(name string) bool

SelectProjectTemplate selects the template named name on the Start Screen when it exists in ProjectTemplates.

func (e *Editor) SelectRemoteEntity(ref string) error

SelectRemoteEntity selects a live entity by ref in the Remote tab and inspects its live components via game_entity_inspect. Passing an empty ref clears the remote selection.

func (e *Editor) SelectRemoteScene(name string) error

SelectRemoteScene chooses which remote scene's layers are shown in the Remote tab and refreshes layers immediately.

func (e *Editor) SelectRigAnimation(name string) error

SelectRigAnimation selects animation name in the rig editor (empty returns to bind pose) and updates the live preview.

func (e *Editor) SelectRigBone(name string)

SelectRigBone selects bone name in the rig editor, or clears the selection when empty.

func (e *Editor) SelectRigSkin(name string) error

SelectRigSkin switches the preview skin in the rig editor.

func (e *Editor) SelectRigSlot(name string)

SelectRigSlot selects slot name in the rig editor, or clears the selection when empty.

func (e *Editor) SelectRoom(id string) bool

SelectRoom selects the room with ID id in the open room map (or clears room selection when id == ""). Selecting a room deselects any scene object, layer, or asset file so the inspector displays the room's properties.

func (e *Editor) SelectSamePrefab(id string) ([]string, error)

SelectSamePrefab selects every object in the open scene that shares the same Prefab (or instanced Scene) reference as object id (defaulting to SelectedID). Returns an error if the object has neither Prefab nor Scene.

func (e *Editor) SelectSketchMark(number int)

SelectSketchMark selects the 1-based mark number (or clears mark selection when number <= 0).

func (e *Editor) SelectStatesNode(name string)

SelectStatesNode selects state name in the graph and switches the live preview to it.

func (e *Editor) SelectTab(index int) error

SelectTab activates the open scene tab at index without clearing any tab's undo history. It returns ErrPlaying while Play mode is active.

func (e *Editor) SelectTabByID(id uint64) error

SelectTabByID activates the open scene tab with ID id.

func (e *Editor) SelectedAssetPath() string

SelectedAssetPath returns the currently selected asset path in the asset drawer.

func (e *Editor) SelectedAudioBus() string

SelectedAudioBus returns the currently selected audio bus name in the mixer panel, falling back to the first declared bus when the selection is unset or no longer exists.

func (e *Editor) SelectedAudioFile() string

SelectedAudioFile returns the project-relative audio file path selected for auditioning.

func (e *Editor) SelectedClipKey() (track, key int, ok bool)

SelectedClipKey returns the key selected in the animation editor and whether one is.

func (e *Editor) SelectedCutsceneClip() (trackIdx, clipIdx int, clip cutscene.Clip, track cutscene.Track, ok bool)

SelectedCutsceneClip returns the currently selected track index, clip index, clip, and track on the displayed cutscene.

func (e *Editor) SelectedDismissTaskIDs() []string

SelectedDismissTaskIDs returns the IDs of all Ready to review tasks currently checked for bulk dismissal, in list order.

func (e *Editor) SelectedExportPlatform() string

SelectedExportPlatform returns the currently selected preset platform in the Export panel, falling back to the first declared preset.

func (e *Editor) SelectedHistoryStep() AgentHistorySelection

SelectedHistoryStep returns the step currently highlighted in the History view.

func (e *Editor) SelectedIDs() []string

SelectedIDs returns the IDs of all currently selected objects in selection order, or nil when no object is selected. When SelectedID was set directly without SelectObjects, it returns a single-element slice holding SelectedID if that object exists in Doc or the resolved scene.

func (e *Editor) SelectedImportSliceCell() int

SelectedImportSliceCell returns the 0-based slice cell currently selected in the image import preview (0 by default).

func (e *Editor) SelectedInputAction() string

SelectedInputAction returns the selected action name in the Input Map panel, falling back to the first declared action when unset or missing.

func (e *Editor) SelectedInputBinding() int

SelectedInputBinding returns the selected binding index within the selected action, or -1 when the selected action has no bindings.

func (e *Editor) SelectedObject() (*sceneformat.ObjectDoc, string)

SelectedObject returns the currently selected ObjectDoc (local, instanced, or inherited) and its layer name, or nil, "".

func (e *Editor) SelectedObjects() []*sceneformat.ObjectDoc

SelectedObjects returns the ObjectDoc pointers for every selected object currently present in e.Doc or the resolved scene, in selection order.

func (e *Editor) SelectedProjectTemplate() string

SelectedProjectTemplate returns the currently selected template name on the Start Screen.

func (e *Editor) SelectedRemoteEntity() string

SelectedRemoteEntity returns the stable entity ref currently selected in the Remote tab, or "".

func (e *Editor) SelectedRigBone() string

SelectedRigBone returns the name of the currently selected bone in the rig editor, or "".

func (e *Editor) SelectedRigSlot() string

SelectedRigSlot returns the name of the currently selected slot in the rig editor, or "".

func (e *Editor) SelectedRoom() *rooms.Room

SelectedRoom returns a copy of the currently selected room, or nil when none is selected.

func (e *Editor) SelectedRoomID() string

SelectedRoomID returns the ID of the currently selected room in the open room map, or "".

func (e *Editor) SelectedSketchMark() int

SelectedSketchMark returns the 1-based number of the currently selected sketch mark, or 0 when none is selected.

func (e *Editor) SelectedStatesNode() string

SelectedStatesNode returns the currently selected (or active preview) state name in the graph.

func (e *Editor) SelectionCount() int

SelectionCount returns the number of currently selected objects.

func (e *Editor) SelectionViewportBounds(ids ...string) ([4]float32, bool)

SelectionViewportBounds computes the union axis-aligned bounding box [minX, minY, maxX, maxY] in viewport canvas points for ids (defaulting to the current selection).

func (e *Editor) SendAgentRequest(prompt string) (*AgentThreadRequest, error)

SendAgentRequest appends a new request to the active thread (naming an unnamed thread after its first request), persists the thread to .nsgo/threads/<id>.yaml when a project is open, and invokes Editor.OnSendAgentRequest if set.

func (e *Editor) SendAgentRequestWith(in AgentSendRequest) (*AgentThreadRequest, error)

SendAgentRequestWith appends a configured request to the active thread, persists it to .nsgo/threads/<id>.yaml when a project is open, and invokes Editor.OnSendAgentRequest if set.

func (e *Editor) SendComposerPrompt() (AgentRequest, error)

SendComposerPrompt assembles the request from the current draft and active chips (and nothing else), delivers it to Editor.OnSendAgentComposerRequest when set, records the turn in the active thread, updates token usage from the agent's reported usage (or estimates it), and clears the draft.

func (e *Editor) SendPlayMarks() (PlayMarksThread, bool)

SendPlayMarks bundles all unsent marks into one PlayMarksThread, stores it in LastPlayMarksThread, invokes Editor.OnPlayMarksThread if set, and updates the Agent tab. Returns (zero, false) when no unsent marks exist.

func (e *Editor) SendQueuedAgentRequest(id string) error

SendQueuedAgentRequest dispatches one queued request once back online and below the weekly limit. While offline or while the weekly limit is still reached, it returns an error and leaves the item queued.

func (e *Editor) SendReviewNotes() (ReviewNoteBatch, error)

SendReviewNotes dispatches all remaining unsent draft notes to the agent over MCP (review_notes_get). Notes added and removed before calling SendReviewNotes never appear in the sent batch.

func (e *Editor) SendSketch(prompt string) (SketchAgentRequest, error)

SendSketch packages the active sketch marks (in exact scene coordinates), the rendered viewport PNG with numbered marks overlaid, and prompt into a SketchAgentRequest, arms the confirmation hold gate so scene_edit refuses mutations until the person confirms, and invokes Editor.OnSendSketch if set.

func (e *Editor) SetActiveGridMapTile(tileID uint16)

SetActiveGridMapTile selects the MeshLibrary tile ID used by GridMap Paint and Box Fill tools.

func (e *Editor) SetActiveGridMapTileByName(name string) bool

SetActiveGridMapTileByName selects the MeshLibrary item named name and reports whether it was found.

func (e *Editor) SetActiveLayer(name string) bool

SetActiveLayer selects the layer targeted by object placement and tile painting. When the layer's tileset (TilePalette) has no tile with ActiveTileID, its first tile becomes the active tile.

func (e *Editor) SetActiveTerrain(name string)

SetActiveTerrain sets the terrain set name used by ToolTerrain, PaintTerrain and EraseTerrain; choosing a terrain is view state and does not enter undo history.

func (e *Editor) SetActiveTileFlip(flip uint32)

SetActiveTileFlip sets the flip bits the Paint and Fill tools place tiles of a layered grid with (ActiveTileFlip); bits other than tilemap.FlipMask are dropped.

func (e *Editor) SetActiveTileID(id int)

SetActiveTileID sets the tile GID used by PaintTile and FloodFillTile tools, which the tile palette (TilePaletteView) sets when a tile is pressed.

func (e *Editor) SetActiveTileLayer(name string) bool

SetActiveTileLayer selects the tile layer of the active layer's layered grid that tile painting changes, as ActiveTileLayer describes; empty selects its first. It reports false, changing nothing, when the active layer's tilemap is not a layered grid with a tile layer of that name.

func (e *Editor) SetAgentComposerDragOver(active bool)

SetAgentComposerDragOver sets whether the Agent composer shows its "Drop to attach" drop overlay.

func (e *Editor) SetAgentComposerText(text string)

SetAgentComposerText updates the multi-line draft in the Agent composer.

func (e *Editor) SetAgentImagePreviewID(id string)

SetAgentImagePreviewID sets which image chip (or AgentBriefPreviewID) is showing its hover preview above the composer.

func (e *Editor) SetAgentMCPConnected(connected bool, label string)

SetAgentMCPConnected updates the live MCP connection status shown in the Agent panel header.

func (e *Editor) SetAgentMCPServerEnabled(name string, enabled bool) error

SetAgentMCPServerEnabled toggles an external MCP server on or off, persists editor.yaml, and syncs the open project's agent MCP configuration. Refused when invoked by an agent.

func (e *Editor) SetAgentOffline(offline bool)

SetAgentOffline switches the Agent panel into or out of offline mode. Manual tools (select, move, inspector, game check, Play) keep working in offline mode. Returning online never auto-runs queued requests; each queued request waits to be sent explicitly.

func (e *Editor) SetAgentPanelOpen(open bool)

SetAgentPanelOpen opens or closes the Agent panel tab.

func (e *Editor) SetAgentPanelRef(ref *core.Ref)

SetAgentPanelRef registers the agent panel container ref so focus-stability rules can check whether keyboard focus is already inside the agent panel before focusing a newly arrived permission card or question.

func (e *Editor) SetAgentPermissionProfile(profile AgentPermissionProfile) error

SetAgentPermissionProfile sets the editor's agent permission profile in Settings -> Permissions (permissions.yaml). Store uploads always ask first in Review uploads regardless of profile.

func (e *Editor) SetAgentPrivacy(kind PrivacyContentKind, allowed bool) error

SetAgentPrivacy updates one outbound privacy switch under WHAT MAY LEAVE THIS COMPUTER and persists editor.yaml. Refused when invoked by an agent.

func (e *Editor) SetAgentRewindMode(mode AgentRewindMode)

SetAgentRewindMode selects one of the three choices in the rewind popover.

func (e *Editor) SetAgentState(state AgentState, detail string)

SetAgentState updates the agent's live state and optional detail text shown in the header pill.

func (e *Editor) SetAgentStuckHint(turnID, hint string)

SetAgentStuckHint updates the draft hint text inside a Stuck card.

func (e *Editor) SetAgentSwitcherOpen(open bool)

SetAgentSwitcherOpen opens or closes the thread switcher popover.

func (e *Editor) SetAgentSwitcherQuery(q string)

SetAgentSwitcherQuery updates the thread switcher search filter.

func (e *Editor) SetAgentTaskRoute(taskKey, model string) error

SetAgentTaskRoute updates which connection/model handles taskKey and persists editor.yaml. Refused when invoked by an agent.

func (e *Editor) SetAgentThreadSessionID(threadID, sessionID string) error

SetAgentThreadSessionID records the external agent's session ID on threadID and persists it, so follow-up requests continue the same external agent session.

func (e *Editor) SetAgentTokenUsage(usage AgentTokenUsage)

SetAgentTokenUsage updates the context meter from the agent's reported token usage.

func (e *Editor) SetAgentTurnReviewOpen(open bool)

SetAgentTurnReviewOpen opens or closes the turn review state for the current pending turn.

func (e *Editor) SetAgentWaitingForYou(req AgentOpenRequest)

SetAgentWaitingForYou transitions the status chip to "Waiting for you · elapsed" with an open request card.

func (e *Editor) SetAmbientColor(color string) error

SetAmbientColor sets the scene's 2D lighting ambient color (SceneDoc.AmbientColor) through History. Empty clears it; any non-empty value must be a CSS color accepted by core.ParseColor.

func (e *Editor) SetAppearance(appearance Appearance) error

SetAppearance updates the editor's appearance setting live through NSGo's Scope.SetAppearance. When SettingsPath is non-empty, the updated settings are saved to SettingsPath.

func (e *Editor) SetAskFrozenFrameDraft(text string)

SetAskFrozenFrameDraft updates the prompt draft in the "Ask about frame N" dialog.

func (e *Editor) SetAskInPlaceDraft(text string)

SetAskInPlaceDraft updates the multi-line text draft of the open in-place composer and clears any highlighted suggestion so free typing is never blocked.

func (e *Editor) SetAssetApprovalAuthor(author string)

SetAssetApprovalAuthor sets the author name written to approvedBy in <file>.source.yaml when picking a candidate.

func (e *Editor) SetAssetBrowserOpen(open bool)

SetAssetBrowserOpen opens or closes the Asset Browser panel.

func (e *Editor) SetAssetDrawerFolder(folder string)

SetAssetDrawerFolder selects a folder in the Assets left rail ("" for "All assets") and clears any active SHOW ONLY status filter, matching Assets.dc.html. Invalid, absolute, or parent-traversing paths are ignored.

func (e *Editor) SetAssetDrawerKind(kind AssetDrawerKind)

SetAssetDrawerKind sets the kind tab filter in the asset drawer.

func (e *Editor) SetAssetDrawerQuery(query string)

SetAssetDrawerQuery sets the name/path filter text in the asset drawer.

func (e *Editor) SetAssetDrawerSort(sort AssetSortMode)

SetAssetDrawerSort sets the asset drawer sort mode.

func (e *Editor) SetAssetDrawerStatusFilter(filter AssetStatusFilter)

SetAssetDrawerStatusFilter sets or toggles a SHOW ONLY filter in the Assets left rail.

func (e *Editor) SetAssetGenPreviewBackground(bgID string)

SetAssetGenPreviewBackground switches the active preview backdrop (for example "floor3", "floor1", "checker") and updates contrast checks.

func (e *Editor) SetAssetGeneratorOpen(open bool)

SetAssetGeneratorOpen opens or closes the full-window Generated Assets screen.

func (e *Editor) SetAssetImportCredit(relPath string, credit *importsettings.Credit) error

SetAssetImportCredit sets or clears (when nil) the credit section in relPath's sidecar.

func (e *Editor) SetAssetPreviewClip(clipName string)

SetAssetPreviewClip picks a clip in the selected asset's right-panel preview and resets to frame 0.

func (e *Editor) SetAssetPreviewFrame(idx int)

SetAssetPreviewFrame selects a specific frame index and pauses auto-playback.

func (e *Editor) SetAssetPreviewPlaying(playing bool)

SetAssetPreviewPlaying starts or pauses frame-by-frame clip preview playback for the selected asset.

func (e *Editor) SetAssetStyleBrief(brief AssetStyleBrief)

SetAssetStyleBrief overrides the active style brief used to check generated candidates and re-evaluates all in-memory candidates.

func (e *Editor) SetAudioBusEffect(bus string, index int, fx project.Effect) error

SetAudioBusEffect replaces the effect at index on bus through EditProject.

func (e *Editor) SetAudioBusVolume(name string, volume float32) error

SetAudioBusVolume updates the named bus's volume in [0, 1] through EditProject.

func (e *Editor) SetAudioImportBitrate(relPath string, bitrate int) error

SetAudioImportBitrate sets or clears (when 0) the audio bitrate override in kbps in relPath's sidecar.

func (e *Editor) SetAudioImportChannels(relPath string, channels int) error

SetAudioImportChannels sets or clears (when 0) the audio channel count override (1 mono, 2 stereo) in relPath's sidecar.

func (e *Editor) SetAudioImportFormat(relPath, format string) error

SetAudioImportFormat sets or clears (when empty) the audio output format override ("wav", "aac", or "mp3") in relPath's sidecar.

func (e *Editor) SetAudioImportLoop(relPath string, loop *importsettings.Loop) error

SetAudioImportLoop sets or clears (when nil) the audio loop region in relPath's sidecar.

func (e *Editor) SetAudioImportPeakDB(relPath string, peakDB *float64) error

SetAudioImportPeakDB sets or clears (when nil) the peak normalization override in dBFS, clearing rmsDB when non-nil.

func (e *Editor) SetAudioImportRMSDB(relPath string, rmsDB *float64) error

SetAudioImportRMSDB sets or clears (when nil) the RMS normalization override in dBFS, clearing peakDB when non-nil.

func (e *Editor) SetAudioImportRate(relPath string, rate int) error

SetAudioImportRate sets or clears (when 0) the audio sample rate override in Hz in relPath's sidecar.

func (e *Editor) SetAudioMasterVolume(volume float32) error

SetAudioMasterVolume updates game.yaml's audio.master volume through EditProject (validated by project.Validate and undoable).

func (e *Editor) SetAudioMixerOpen(open bool)

SetAudioMixerOpen opens the Settings view on the Audio buses page, or closes Settings when open is false and the Audio buses page is active. Closing stops any active audition.

func (e *Editor) SetAuditionLoop(loop bool)

SetAuditionLoop controls whether audition playback loops.

func (e *Editor) SetAutoSave(enabled bool) error

SetAutoSave updates the per-user automatic saving preference live. When SettingsPath is non-empty, the updated settings are persisted to SettingsPath.

func (e *Editor) SetAutomationDraftText(text string)

SetAutomationDraftText updates the natural-language description in "+ New automation, in words".

func (e *Editor) SetAutomationEnabled(id string, enabled bool) error

SetAutomationEnabled toggles the enabled state of the automation with id and writes automations.yaml when a project is open. Refuses agent actors (ErrAutomationYouOnly).

func (e *Editor) SetAutomations(f *AutomationsFile) error

SetAutomations replaces the open project's automation list and writes automations.yaml when a project is open. Refuses agent actors (ErrAutomationYouOnly).

func (e *Editor) SetBackground(color string) error

SetBackground updates the open scene's BackgroundColor CSS string (or clears it when empty) through History, validated by sceneformat.Validate.

func (e *Editor) SetBriefArtDirection(art string) error

SetBriefArtDirection updates brief.yaml's artDirection field as one undoable step.

func (e *Editor) SetBriefFeelSummary(summary string) error

SetBriefFeelSummary updates brief.yaml's feel.summary field as one undoable step.

func (e *Editor) SetBriefGenre(genre []string) error

SetBriefGenre updates brief.yaml's genre list as one undoable step.

func (e *Editor) SetBriefPitch(pitch string) error

SetBriefPitch updates brief.yaml's pitch field as one undoable step.

func (e *Editor) SetBriefPlatforms(platforms []string) error

SetBriefPlatforms updates brief.yaml's platforms list as one undoable step.

func (e *Editor) SetBriefPlaytestTargets(targets []project.BriefPlaytestTarget) error

SetBriefPlaytestTargets replaces brief.yaml's feel.targets slice as one undoable step.

func (e *Editor) SetBriefTags(tags []string) error

SetBriefTags updates brief.yaml's tags list as one undoable step.

func (e *Editor) SetBriefToneAndAudio(tone string) error

SetBriefToneAndAudio updates brief.yaml's toneAndAudio field as one undoable step.

func (e *Editor) SetBuildPresetFixProposal(platform string, proposal *BuildPresetFixProposal) error

SetBuildPresetFixProposal attaches an agent-proposed preset fix diff to a failed (or selected) preset.

func (e *Editor) SetBuildPresetIncluded(platform string, included bool) error

SetBuildPresetIncluded checks or unchecks platform for inclusion in the release build.

func (e *Editor) SetBuildPresetSigning(platform string, cfg BuildPresetSigningConfig)

SetBuildPresetSigning configures signing settings (such as keystore path, alias, identity, or notarization) for platform on the Build and Release screen.

func (e *Editor) SetCamera(cam *sceneformat.CameraDoc) error

SetCamera replaces the open scene's Camera (or clears it when nil) through History, validated by sceneformat.Validate.

func (e *Editor) SetCameraBounds(bounds *sceneformat.BoundsDoc) error

SetCameraBounds sets or clears (when bounds is nil) the open scene camera's world-space clamp rectangle through History, validated by sceneformat.Validate.

func (e *Editor) SetCameraPosition(x, y float32) error

SetCameraPosition updates the open scene camera's world-space (X, Y) position through History, initializing Camera from the scene's default center if it was previously unset.

func (e *Editor) SetCameraRotation(radians float32) error

SetCameraRotation updates the open scene camera's rotation in radians through History.

func (e *Editor) SetCameraZoom(zoom float32) error

SetCameraZoom updates the open scene camera's zoom factor through History. Non-positive or non-finite values are refused by sceneformat.Validate.

func (e *Editor) SetCanvasSize(w, h float32)

SetCanvasSize records the size in points of the viewport's canvas, which CanvasToWorld and the 3D viewport map presses through. The viewport calls it as it lays out; a size that is not positive and finite is ignored.

func (e *Editor) SetChangeIncluded(filePath string, included bool) error

SetChangeIncluded includes or excludes the changed file at path from the next commit.

func (e *Editor) SetChangesContext(reviews int, playtestSummary string, agentRequests int)

SetChangesContext records review, playtest, and agent-request provenance metadata used when drafting commit messages and PR descriptions.

func (e *Editor) SetChangesSceneView(mode ChangesSceneViewMode)

SetChangesSceneView switches the scene diff preview mode between side-by-side, HEAD, and Now.

func (e *Editor) SetClipLength(length time.Duration) error

SetClipLength sets the open clip's length as an undoable command. It refuses a length that would leave a key or event past the end.

func (e *Editor) SetClipLoading(loading bool)

SetClipLoading sets the animation panel's loading state and notifies listeners.

func (e *Editor) SetClipLoop(loop bool) error

SetClipLoop sets whether the open clip loops, as an undoable command.

func (e *Editor) SetClipName(name string) error

SetClipName renames the open clip as an undoable command.

func (e *Editor) SetClipTarget(id string) error

SetClipTarget makes the open clip play on the object id, as an undoable command.

func (e *Editor) SetCodeReviewFailureExplanation(explanation, suspectFile string, suspectLine int)

SetCodeReviewFailureExplanation attaches or updates the agent's explanation and optional suspect source line for the current failing check/test.

func (e *Editor) SetCodeReviewLayout(layout CodeReviewDiffLayout)

SetCodeReviewLayout switches the Go diff layout between Unified and Split.

func (e *Editor) SetCommandPaletteOpen(open bool)

SetCommandPaletteOpen sets whether the Command Palette dialog is open.

func (e *Editor) SetCommitDescription(description string)

SetCommitDescription updates the editable commit description field in the Changes panel without rebuilding the input widgets.

func (e *Editor) SetCommitSummary(summary string)

SetCommitSummary updates the editable commit summary field in the Changes panel without rebuilding the input widgets.

func (e *Editor) SetComponentField(objectID, componentName, field string, value any) error

SetComponentField sets a typed field inside objectID.Components[componentName][field] through History. With a component registry set, or for a built-in physics or 2D lighting component without one, the field must be registered and value of its kind and within its range; it is stored normalized to bool, int, float64, string, []string, or [][2]float64.

func (e *Editor) SetComponentRegistry(reg *sceneformat.ComponentRegistry) error

SetComponentRegistry makes the editor check components against reg: every open scene's components and connections must already conform, later opens refuse files whose components or connections do not, SetComponentField and PlaceObject refuse unregistered fields, and the inspector lists every registered field of a component. Nil turns the checks off. Changing the registry clears undo/redo history across open tabs, since commands recorded under the old registry could bring back components the new one refuses.

func (e *Editor) SetComposerDraft(text string)

SetComposerDraft updates the agent composer draft text, refreshes @-mention trigger detection, and notifies listeners.

func (e *Editor) SetConnectAPIKey(key string)

SetConnectAPIKey updates the draft API key in the Connect dialog.

func (e *Editor) SetConnectChoice(mode AgentMode)

SetConnectChoice selects one of the three choices inside the Connect dialog.

func (e *Editor) SetConnectPermissions(perms AgentPermissions)

SetConnectPermissions updates the draft permission checkboxes inside the Connect dialog.

func (e *Editor) SetContextBreakdownOpen(open bool)

SetContextBreakdownOpen opens or closes the context ring breakdown popover.

func (e *Editor) SetCutsceneClipEasing(trackIdx, clipIdx int, easing cutscene.Easing) error

SetCutsceneClipEasing updates the Easing of the clip at (trackIdx, clipIdx) on a camera or actor track.

func (e *Editor) SetCutsceneClipTiming(trackIdx, clipIdx int, start, dur time.Duration) error

SetCutsceneClipTiming updates the Start and Duration of the clip at (trackIdx, clipIdx). While a review is open, the edit joins the review and can be undone with Undo (⌘Z); otherwise it executes an ordinary undoable command on History.

func (e *Editor) SetCutsceneReviewPeekBefore(peek bool)

SetCutsceneReviewPeekBefore sets the temporary hold-B peek state during an open review.

func (e *Editor) SetCutsceneReviewViewMode(mode CutsceneReviewView)

SetCutsceneReviewViewMode switches the open review between Before and After.

func (e *Editor) SetDataTableCell(row int, col string, val datatable.Value) error

SetDataTableCell updates or inserts cell (row, col) with val as an undoable command. When a Go row type is registered for the open table, the resulting row is checked with LoadYAML's rules and refused on error.

func (e *Editor) SetDataTableCellText(row int, col, text string) error

SetDataTableCellText parses text using the column's registered Go type (if any) or its inferred ValueKind (string, number, bool, duration, list), and applies it as an undoable cell edit. Invalid values are refused and reported via DataTableError and Status.

func (e *Editor) SetDataTableFilter(query string)

SetDataTableFilter sets the case-insensitive substring filter applied to the grid view.

func (e *Editor) SetDataTableLoading(loading bool)

SetDataTableLoading updates the open data table's loading state and notifies listeners.

func (e *Editor) SetDataTableReviewCellText(key, col, text string) error

SetDataTableReviewCellText edits cell (key, col) in place as the person's edit. It joins the active review (filtered by Yours and tagged `you` in the YAML) and marks the agent's checks out of date.

func (e *Editor) SetDataTableReviewChecks(checks []DataTableReviewCheck) error

SetDataTableReviewChecks attaches or refreshes the agent's named check figures on the active review, clearing the out-of-date flag.

func (e *Editor) SetDataTableReviewEditDraft(text string)

SetDataTableReviewEditDraft updates the in-progress text in the active inline cell editor without triggering a table remount.

func (e *Editor) SetDataTableReviewFilter(filter DataTableReviewFilter)

SetDataTableReviewFilter switches the active row filter chip (All, Changed, Unchanged, Reverted, Yours).

func (e *Editor) SetDataTableReviewSearch(query string)

SetDataTableReviewSearch updates the case-insensitive text filter query for the active file.

func (e *Editor) SetDataTableReviewSort(col string, order SortOrder)

SetDataTableReviewSort sets the active file's sort column and direction without mutating file row order.

func (e *Editor) SetDataTableSort(col string, order SortOrder)

SetDataTableSort sets the grid view's sort column and direction without modifying the document.

func (e *Editor) SetDiskCompareOpen(open bool)

SetDiskCompareOpen opens or closes the per-object Compare merge picker for an active scene conflict.

func (e *Editor) SetDiskReloadDiffOpen(open bool)

SetDiskReloadDiffOpen opens or closes the quiet reload diff details.

func (e *Editor) SetDockLayout(l dock.Layout)

SetDockLayout applies a dock.Layout edit (from ui.DockArea drag/drop, resize, tab switch, or close), reconciles it with the blueprint, persists to LayoutPath when set, and notifies subscribers.

func (e *Editor) SetEditorSettingsOpen(open bool)

SetEditorSettingsOpen opens the Settings view on the General page, or closes Settings when open is false and an editor preferences page is active.

func (e *Editor) SetEditorSettingsTab(tab EditorSettingsTab)

SetEditorSettingsTab switches the active page in the Editor Settings dialog.

func (e *Editor) SetEnvironment(env *sceneformat.EnvironmentDoc) error

SetEnvironment replaces the open scene's 3D environment (sky, ambient/IBL, fog, tonemapping, exposure) as an undoable command on History, checked by sceneformat.Validate. Setting an environment on a scene below version 4 raises its version to sceneformat.CurrentVersion, which Undo restores.

func (e *Editor) SetEnvironmentPanelOpen(open bool)

SetEnvironmentPanelOpen opens or closes the Scene Environment panel.

func (e *Editor) SetExpandedAgentRequestID(reqID string)

SetExpandedAgentRequestID expands reqID (or collapses all folded requests when empty).

func (e *Editor) SetExportChannel(channel string) error

SetExportChannel sets the distribution channel in the Export panel ("", "direct", "store", "steam", or "none").

func (e *Editor) SetExportDryRun(dryRun bool)

SetExportDryRun toggles dry-run mode in the Export panel.

func (e *Editor) SetExportOutput(output string) error

SetExportOutput sets game.yaml's export.output directory through EditProject as one undoable step. Clearing it when no presets are configured removes the empty export section.

func (e *Editor) SetExportPanelOpen(open bool)

SetExportPanelOpen opens the Settings view on the Export page (refreshing the pre-flight credits check), or closes Settings when open is false and the Export page is active.

func (e *Editor) SetExportPresetTargets(platform string, targets []string) error

SetExportPresetTargets replaces platform's target list through EditProject. An empty slice builds the platform's default targets. Every target must belong to project.TargetsOf(platform).

func (e *Editor) SetExportReleaseNotes(path string)

SetExportReleaseNotes sets the release notes Markdown file path in the Export panel.

func (e *Editor) SetExportSelectedTargets(targets []string)

SetExportSelectedTargets restricts builds from the Export panel to targets; an empty slice builds all presets.

func (e *Editor) SetFileBrowserOpen(open bool)

SetFileBrowserOpen opens or closes the full Project Files browser panel.

func (e *Editor) SetFirstRunAPIKey(key string)

SetFirstRunAPIKey updates the in-memory API key and immediately validates it without holding firstRun.mu.

func (e *Editor) SetFirstRunAgentConnected(connected bool, kind, name string, tools int)

SetFirstRunAgentConnected configures whether an agent is already connected (for example when an MCP session is active before pressing Start with AI).

func (e *Editor) SetFirstRunReviewBefore(before bool)

SetFirstRunReviewBefore toggles the Before/After segmented button in the First Review.

func (e *Editor) SetFirstRunReviewPeekBefore(peek bool)

SetFirstRunReviewPeekBefore controls the temporary hold-B Before peek in the First Review.

func (e *Editor) SetFontImportChars(relPath, chars string) error

SetFontImportChars sets or clears (when empty) the baked font character set override in relPath's sidecar.

func (e *Editor) SetFontImportPadding(relPath string, padding *int) error

SetFontImportPadding sets or clears (when nil) the baked font glyph padding override in pixels in relPath's sidecar.

func (e *Editor) SetFontImportSize(relPath string, size int) error

SetFontImportSize sets or clears (when 0) the baked font pixel size override in relPath's sidecar.

func (e *Editor) SetFrameDuration(track, key int, dur time.Duration) error

SetFrameDuration sets the duration that frame key key on sprite.frame track track holds before the next frame (or the clip's end), shifting subsequent frame keys and adjusting the clip's length accordingly, as an undoable command.

func (e *Editor) SetGeneratedAssetLicense(relPath, license string, commercialUse bool) error

SetGeneratedAssetLicense updates license and commercialUse in <relPath>.source.yaml as one undoable History step.

func (e *Editor) SetGeneratedLicenseCommercial(on bool)

SetGeneratedLicenseCommercial toggles the commercialUse flag in the inline license editor.

func (e *Editor) SetGeneratedLicenseDraft(val string)

SetGeneratedLicenseDraft updates the in-memory license text being typed in the inline editor without bumping assetGen.rev so the active text input never remounts or loses focus.

func (e *Editor) SetGeneratorServerConfigs(servers []GeneratorServerConfig) error

SetGeneratorServerConfigs updates the configured MCP generator servers shown under Settings > Tools and GENERATORS · MCP.

func (e *Editor) SetGizmoMode3D(mode GizmoMode3D)

SetGizmoMode3D switches the active 3D transform gizmo mode (Translate, Rotate, or Scale) and leaves any active GridMap tool.

func (e *Editor) SetGizmoSpace3D(space GizmoSpace3D)

SetGizmoSpace3D switches the 3D transform gizmo between Global (world) and Local (object) axes. It cancels any active 3D gizmo drag so no drag mixes spaces, is not undoable, and ignores unknown values.

func (e *Editor) SetGridMapFloor(y int)

SetGridMapFloor sets the current floor height (integer Y coordinate) used by GridMap painting, erasing, picking, and box fill.

func (e *Editor) SetGridMapHover(sx, sy, w, h float32, picking bool)

SetGridMapHover updates the pointer location used for the 3D GridMap cell preview overlay.

func (e *Editor) SetGridMapOrientation(orient uint8) error

SetGridMapOrientation sets the active GridMap item orientation (0..23) as an undoable command.

func (e *Editor) SetGridMapTool(tool GridMapTool)

SetGridMapTool switches the active 3D GridMap tool. Choosing a paint, erase, pick, or box-fill tool finishes any active stroke, cancels any 3D gizmo drag, and automatically opens the selected object's GridMap (or the first GridMap object in the scene) when no GridMap is open yet.

func (e *Editor) SetGridSize(size float32) bool

SetGridSize sets an explicit grid spacing in world/layer units used when grid snapping is active. Non-positive or non-finite values are refused; call ResetGridSize to follow the active layer's tilemap tile size again.

func (e *Editor) SetHUDLayoutOpen(open bool)

SetHUDLayoutOpen opens or closes the HUD and menu layout screen. Opening it while a project is open automatically scans project *.screen.yaml files and locales/*.yaml tables.

func (e *Editor) SetHUDLocale(locale string)

SetHUDLocale switches the preview language across all four screen sizes, the text width table, inspector, and GAME CHECK.

func (e *Editor) SetHUDNodeAnchor(nodeID string, anchor gameui.ScreenAnchor) error

SetHUDNodeAnchor changes nodeID's anchor point (one of the 9 anchor positions or fill) in one undo step and saves the screen file.

func (e *Editor) SetHUDNodeOffset(nodeID string, x, y float32) error

SetHUDNodeOffset updates nodeID's anchor offset (x, y) in one undo step and saves the screen file.

func (e *Editor) SetHUDNodeSafeArea(nodeID string, keepInSafeArea bool) error

SetHUDNodeSafeArea sets whether nodeID stays inside the display safe area in one undo step and saves the screen file.

func (e *Editor) SetHUDNodeSizeMode(nodeID string, mode gameui.SizeMode) error

SetHUDNodeSizeMode toggles nodeID's sizing mode between fixed and fit_text in one undo step and saves the screen file.

func (e *Editor) SetHUDNodeSpacing(nodeID string, spacing float32) error

SetHUDNodeSpacing updates the child spacing of a container (vbox, hbox, sprite_row) in one undo step and saves the screen file.

func (e *Editor) SetHUDOverlays(ov HUDOverlays)

SetHUDOverlays replaces the active viewport overlay toggles.

func (e *Editor) SetHistoryClock(fn func() time.Time)

SetHistoryClock sets the clock used to timestamp History timeline entries across all open tabs. Passing nil restores Editor.Now or time.Now.

func (e *Editor) SetHistoryFilter(filter HistoryFilter)

SetHistoryFilter switches the active filter tab in the History panel.

func (e *Editor) SetHistoryPanelOpen(open bool)

SetHistoryPanelOpen opens or closes the History timeline panel. Closing the panel also exits any active point-in-time preview.

func (e *Editor) SetHoveredChip(chipID string)

SetHoveredChip sets or clears which chip's exact-payload hover preview is open.

func (e *Editor) SetImageImportCellPivot(relPath string, cell int, pt *importsettings.PivotPoint) error

SetImageImportCellPivot sets or clears (when nil) the normalized pivot override for 0-based cell in relPath's sidecar, keeping cells in ascending order.

func (e *Editor) SetImageImportDefaultPivot(relPath string, pt *importsettings.PivotPoint) error

SetImageImportDefaultPivot sets or clears (when nil) the default normalized pivot in relPath's sidecar without disturbing per-cell overrides.

func (e *Editor) SetImageImportFilter(relPath, filter string) error

SetImageImportFilter sets or clears (when empty) the image sampling filter override ("linear" or "nearest") in relPath's sidecar.

func (e *Editor) SetImageImportFormat(relPath, format string) error

SetImageImportFormat sets or clears (when empty) the image KTX2 format override ("rgba8", "bc1", "bc3", or "etc2") in relPath's sidecar.

func (e *Editor) SetImageImportMipmaps(relPath string, mipmaps *bool) error

SetImageImportMipmaps sets or clears (when nil) the image mipmaps override in relPath's sidecar.

func (e *Editor) SetImageImportPivot(relPath string, pivot *importsettings.Pivot) error

SetImageImportPivot sets or clears (when nil) the image pivot block in relPath's sidecar, sorting per-cell overrides by ascending cell index.

func (e *Editor) SetImageImportSRGB(relPath string, srgb *bool) error

SetImageImportSRGB sets or clears (when nil) the image sRGB override in relPath's sidecar.

func (e *Editor) SetImageImportSlice(relPath string, slice *importsettings.Slice) error

SetImageImportSlice sets or clears (when nil) the image sprite-sheet slice grid in relPath's sidecar. Clearing the slice also removes per-cell pivot overrides (which require image.slice), and setting a positive Count prunes per-cell pivot overrides at or above Count.

func (e *Editor) SetInputAxis(index int, ax project.Axis) error

SetInputAxis replaces input.axes[index] through EditProject.

func (e *Editor) SetInputBinding(action string, index int, b project.Binding) error

SetInputBinding replaces binding index on action through EditProject.

func (e *Editor) SetInputGamepadAxis(index int, g project.GamepadAxis) error

SetInputGamepadAxis replaces input.gamepadAxes[index] through EditProject.

func (e *Editor) SetInputMapOpen(open bool)

SetInputMapOpen opens the Settings view on the Input map page, or closes Settings when open is false and the Input map page is active. Closing cancels any active key capture or region drag.

func (e *Editor) SetInputMapRegionDrawKind(kind string)

SetInputMapRegionDrawKind sets the binding kind ("touchRegion" or "mouseRegion") created when drawing a new region on the canvas.

func (e *Editor) SetInputMapTab(tab InputMapTab)

SetInputMapTab switches the active tab of the Input Map panel.

func (e *Editor) SetInputMotionAxis(index int, m project.MotionAxis) error

SetInputMotionAxis replaces input.motionAxes[index] through EditProject.

func (e *Editor) SetInputRegion(action string, index int, r project.Rect) error

SetInputRegion updates the rectangle of a touchRegion or mouseRegion binding through EditProject.

func (e *Editor) SetInspectorFieldProblems(problems []InspectorFieldProblem)

SetInspectorFieldProblems records explicit field-level problems shown as problem pills in the inspector alongside live project-check problems (Editor.Problems) and component range checks.

func (e *Editor) SetInspectorFilter(query string)

SetInspectorFilter sets the inspector field filter query, narrowing visible sections and fields to those whose label, component name, or section title matches (case-insensitive substring).

func (e *Editor) SetInspectorReviewChanges(changes []InspectorReviewChange)

SetInspectorReviewChanges records the active agent review field changes shown in the inspector ("was <old> · in review"). Pass nil to clear them once a review is kept or reverted.

func (e *Editor) SetInspectorSectionCollapsed(sectionID string, collapsed bool)

SetInspectorSectionCollapsed expands or collapses the titled inspector section id.

func (e *Editor) SetInterfaceSize(size InterfaceSize) error

SetInterfaceSize updates the per-user editor interface size live. When SettingsPath is non-empty, the updated settings are persisted to SettingsPath.

func (e *Editor) SetKeyFrame(track, key int, frame string) error

SetKeyFrame sets the atlas frame name of key key on sprite.frame track track as an undoable command.

func (e *Editor) SetKeyInterp(track, key int, interp resource.Interp) error

SetKeyInterp sets how key key on track track moves to the next key, as an undoable command.

func (e *Editor) SetKeyValue(track, key int, value float64) error

SetKeyValue sets the value of key key on track track as an undoable command. The value must suit the track's property: 0 or 1 for a bool, a whole number for an int, inside the range.

func (e *Editor) SetLanguage(lang Language) error

SetLanguage updates the editor's language setting live without a restart. When SettingsPath is non-empty, the updated settings are saved to SettingsPath.

func (e *Editor) SetLastReleaseBaseline(baseline LastReleaseBaseline)

SetLastReleaseBaseline sets the previous release's version and per-platform artifact sizes for delta comparison.

func (e *Editor) SetLayerLocked(name string, locked bool) error

SetLayerLocked locks the layer name against the viewports, or unlocks it: a press in either viewport passes over its objects, so it picks what lies under them, its objects are not moved there (no gizmo, no Move-tool drag), and the Place, Paint, Erase and Fill tools do nothing while it is the active layer. Like SetObjectLocked, the lock belongs to the editing session: it is not an edit, is not undone, and is never written to the scene file; opening another scene clears it. The layers panel and the scene tree still select and edit the layer and its objects.

func (e *Editor) SetLayerParallax(layerName string, parallaxX, parallaxY float32) error

SetLayerParallax sets the horizontal and vertical parallax scroll factors of layerName (or ActiveLayer when empty) as an undoable command. Both factors must be finite. Setting a non-default parallax factor on a version 1 or version 2 scene raises the scene to sceneformat.CurrentVersion, which Undo restores. In a scene that inherits another, editing an inherited layer records the change under SceneDoc.LayerOverrides.

func (e *Editor) SetLayerRepeat(layerName string, repeatX, repeatY bool, repeatWidth, repeatHeight float32) error

SetLayerRepeat sets the repeat flags and periods of layerName (or ActiveLayer when empty) as an undoable command. RepeatWidth and RepeatHeight must be finite and non-negative (0 uses the layer's tilemap pixel size or the scene's virtual size). Enabling repeat or setting a positive period on a version 1 or version 2 scene raises the scene to sceneformat.CurrentVersion, which Undo restores. In a scene that inherits another, editing an inherited layer records the change under SceneDoc.LayerOverrides.

func (e *Editor) SetLayerSpace(name string, space sceneformat.Space) error

SetLayerSpace sets the space the layer name draws and hit-tests in, SpaceWorld (under the scene's camera) or SpaceScreen (at virtual screen coordinates, as a HUD), as an undoable command; its objects keep their coordinates. It changes nothing when the layer already has that space, its field left unset included for SpaceWorld. In a scene that inherits another, changing an inherited layer records the change under SceneDoc.LayerOverrides.

func (e *Editor) SetLayerTilemapTileSize(layerName string, tileWidth, tileHeight int) error

SetLayerTilemapTileSize changes the tile dimensions (tileWidth x tileHeight in points) of layerName's inline tilemap (following Ref into SceneDoc.Tilemaps when referenced) as an undoable command. It refuses non-positive sizes, layers without an inline tilemap, and inherited base-owned layers.

func (e *Editor) SetLayerTilemapTileset(layerName, tileset string) error

SetLayerTilemapTileset changes the tileset atlas of layerName's inline single-grid tilemap (following Ref into SceneDoc.Tilemaps when referenced) as an undoable command. It refuses a layer without an inline single-grid tilemap, an inherited base-owned layer, an empty or unresolved tileset atlas, or an atlas missing frames for any painted tile ID in the grid.

func (e *Editor) SetLayerVisible(name string, visible bool) error

SetLayerVisible shows or hides the layer name as an undoable command, writing its visible field: hiding writes visible: false, and showing leaves the field unset, its default, so hiding and showing a layer whose field was unset gives back the same file. Unlike the session's lock (SetLayerLocked), this is the scene's own setting: the game does not draw a hidden layer either. In a scene that inherits another, changing an inherited layer records the change under SceneDoc.LayerOverrides.

func (e *Editor) SetLayersPanelOpen(open bool)

SetLayersPanelOpen opens or closes the docked Layers panel.

func (e *Editor) SetLayoutPath(path string) error

SetLayoutPath configures where the editor persists its per-user dock layout YAML file and loads any existing layout from path (an absent file keeps the default layout). Panels in the saved file that no longer exist are dropped.

func (e *Editor) SetLeftRailMode(mode LeftRailMode)

SetLeftRailMode switches the left rail between Scene mode and Assets mode.

func (e *Editor) SetLibraryPanelOpen(open bool)

SetLibraryPanelOpen opens or closes the Asset Pack Library panel.

func (e *Editor) SetLights3D(lights *render3d.LightRig)

SetLights3D sets the lights the 3D viewport draws the scene's geometry with (Lights3D) and redraws it; nil goes back to DefaultLights3D under a gradient sky. Like Shading3D, the lights are a view setting: setting them is not undoable and changes nothing in the scene file.

func (e *Editor) SetLocalizationKeyPlural(key string, plural bool) error

SetLocalizationKeyPlural switches key between plain string mode and CLDR plural mode as an undoable command, preserving text in the "other" plural form (and vice versa).

func (e *Editor) SetLocalizationLoading(loading bool)

SetLocalizationLoading updates the Localization panel's loading state and notifies listeners.

func (e *Editor) SetLocalizationPlural(locale, key string, forms l10n.PluralForms) error

SetLocalizationPlural sets the CLDR plural forms for (locale, key) as an undoable command. Setting an empty PluralForms clears the translation so it is flagged as missing and omitted on save.

func (e *Editor) SetLocalizationPluralForm(locale, key, category, value string) error

SetLocalizationPluralForm sets one CLDR plural category ("zero", "one", "two", "few", "many", or "other") of (locale, key) as an undoable command.

func (e *Editor) SetLocalizationString(locale, key, value string) error

SetLocalizationString sets the localized string for (locale, key) as an undoable command. Setting an empty string clears the translation so it is flagged as missing and omitted on save (allowing runtime fallback).

func (e *Editor) SetLookThroughCamera3D(on bool) error

SetLookThroughCamera3D toggles whether the 3D viewport renders and projects through the scene's active 3D camera (matching the game's first frame). Enabling it without a 3D camera in the scene returns an error.

func (e *Editor) SetMCPToolEnabled(name string, enabled bool) error

SetMCPToolEnabled toggles an MCP tool on or off in per-user editor settings. Turning a tool off removes it from the MCP server's tool list and refuses calls to it. Refused when invoked by an agent.

func (e *Editor) SetMaterialBaseColor(color string) error

SetMaterialBaseColor updates the open material's BaseColor CSS color string (empty for default white) through History.

func (e *Editor) SetMaterialBlend(blend string) error

SetMaterialBlend updates the open material's 2D Blend mode (empty or "sourceOver" for default) through History.

func (e *Editor) SetMaterialDoubleSided(on bool) error

SetMaterialDoubleSided updates the open material's DoubleSided flag through History.

func (e *Editor) SetMaterialEmissive(color string) error

SetMaterialEmissive updates the open material's Emissive CSS color string (empty for none) through History.

func (e *Editor) SetMaterialMetallic(v float32) error

SetMaterialMetallic updates the open material's Metallic factor in [0, 1] through History.

func (e *Editor) SetMaterialName(name string) error

SetMaterialName updates the open material's Name through History.

func (e *Editor) SetMaterialOpacity(v float32) error

SetMaterialOpacity updates the open material's Opacity factor in [0, 1] through History.

func (e *Editor) SetMaterialPreviewShape(shape MaterialPreviewShape)

SetMaterialPreviewShape switches the Material Editor's live preview between Sphere, Cube (render3d), and Sprite (2D). It is a view setting, not an edit.

func (e *Editor) SetMaterialRoughness(v float32) error

SetMaterialRoughness updates the open material's Roughness factor in [0, 1] through History.

func (e *Editor) SetMaterialTexture(texturePath string) error

SetMaterialTexture updates the open material's Texture path (slash-separated from project root, or empty for none) through History.

func (e *Editor) SetMaterialUnlit(on bool) error

SetMaterialUnlit updates the open material's Unlit flag through History.

func (e *Editor) SetMentionPickerGroup(group MentionGroup)

SetMentionPickerGroup switches the active tab of the @-mention picker.

func (e *Editor) SetMergeAgentSuggestion(id string, sug MergeSuggestion) error

SetMergeAgentSuggestion updates the agent's suggestion for conflict item id (for example from an MCP agent tool).

func (e *Editor) SetMergeCustomEditing(id string, open bool) error

SetMergeCustomEditing toggles the inline "Edit the result YAML by hand" editor for conflict item id.

func (e *Editor) SetMergeCustomYAML(id, raw string)

SetMergeCustomYAML updates the live hand-edited YAML text draft for conflict item id without applying it yet.

func (e *Editor) SetModelImportAnimations(relPath string, animations *bool) error

SetModelImportAnimations sets or clears (when nil) the model animations override in relPath's sidecar.

func (e *Editor) SetModelImportLODHysteresis(relPath string, hysteresis float32) error

SetModelImportLODHysteresis sets or clears (when 0) the model's LOD hysteresis deadband in relPath's sidecar.

func (e *Editor) SetModelImportLODs(relPath string, lods []importsettings.ModelLOD) error

SetModelImportLODs sets or clears (when empty) the model's declared LOD levels in relPath's sidecar.

func (e *Editor) SetModelImportScale(relPath string, scale float64) error

SetModelImportScale sets or clears (when 0) the model scale multiplier override in relPath's sidecar.

func (e *Editor) SetModelPreviewLoop(loop bool)

SetModelPreviewLoop sets whether model preview animation playback loops.

func (e *Editor) SetNavMesh3DFile(f *navbake3d.File)

SetNavMesh3DFile sets the 3D navigation mesh file previewed in the 3D viewport.

func (e *Editor) SetNavMeshBakeConfig(cfg NavMeshBakeConfig)

SetNavMeshBakeConfig updates the editor's 3D navigation mesh bake settings.

func (e *Editor) SetNavMeshPanelOpen(open bool)

SetNavMeshPanelOpen shows or hides the 3D NavMesh bake settings panel.

func (e *Editor) SetNavRegionPoints(objectID string, points [][2]float64) error

SetNavRegionPoints replaces the local polygon vertices of objectID's navregion2d component through History (at least 3 finite points).

func (e *Editor) SetNavTestPathPoints(start, end core.Point) ([]core.Point, bool)

SetNavTestPathPoints sets both endpoints of the 2D navigation test path in world space and immediately evaluates ai.NavMesh.FindPath on the active built scene.

func (e *Editor) SetNavigation3D(mode Navigation3D) error

SetNavigation3D updates the 3D viewport mouse navigation mapping live. When SettingsPath is non-empty, the updated settings are persisted to SettingsPath.

func (e *Editor) SetObjectAlpha(id string, alpha float32) error

SetObjectAlpha sets object id's opacity in [0, 1] as an undoable command. When id names an instanced or inherited object, it records an override on its instance or inheriting scene.

func (e *Editor) SetObjectCamera3D(id string, cam *sceneformat.Camera3DDoc) error

SetObjectCamera3D sets or clears object id's 3D camera definition as an undoable command on History. When cam has Current set to true, any other 3D camera in the scene with Current true is cleared atomically in the same undo step so the scene stays valid. Setting a 3D camera on a scene below version 4 raises its version to sceneformat.CurrentVersion, which Undo restores.

func (e *Editor) SetObjectDepth(id string, depth float32) error

SetObjectDepth sets object id's 3D depth extent as an undoable command.

func (e *Editor) SetObjectFlip(objectID string, flipX, flipY bool) error

SetObjectFlip sets whether objectID's sprite is mirrored horizontally (flipX) and vertically (flipY) inside its frame, through History.

func (e *Editor) SetObjectGridMap(id, gridMapPath string) error

SetObjectGridMap sets the 3D grid map file (*.gridmap.yaml or *.gridmap.yml) object id draws, or "" to clear it, as an undoable command. It refuses a path sceneformat refuses, or combining a GridMap with Mesh or Model, and raises a version 1 scene to version 2 (restored on Undo).

func (e *Editor) SetObjectHidden(id string, hidden bool) error

SetObjectHidden hides the object id, and with it its descendants, in the editor's 2D and 3D viewports, or shows it again. The toggle belongs to the editing session, like the camera of the 3D view: it is not an edit, is not undone, and is never written to the scene file, and Play draws every object. A hidden object cannot be picked or manipulated in a viewport either (no gizmo, no Move-tool drag), though the scene tree still selects it and the inspector edits it.

func (e *Editor) SetObjectID(oldID, newID string) error

SetObjectID changes the ID of the object oldID to newID as one undoable command, rewriting in the same step every connection (sceneformat.ConnectionDoc) and scene override (sceneformat.SceneDoc.Overrides) that names it, and, when the object instances a scene, the objects that scene adds ("enemy_1/body" becomes "boss/body"). The selection, the open clip's target and the targets of its tracks, and the object's hidden and locked toggles follow it. It refuses an empty ID and one any object of the scene already has, including one an instanced or inherited scene adds, and an ID under which the scene would no longer resolve.

func (e *Editor) SetObjectLight(id string, light *sceneformat.LightDoc) error

SetObjectLight sets or clears object id's 3D light definition as an undoable command on History. Setting a light on a scene below version 4 raises its version to sceneformat.CurrentVersion, which Undo restores.

func (e *Editor) SetObjectLightProbeGrid(id string, grid *sceneformat.LightProbeGridDoc) error

SetObjectLightProbeGrid sets or clears object id's light probe grid definition as an undoable command on History. Setting a light probe grid on a scene below version 4 raises its version to sceneformat.CurrentVersion, which Undo restores.

func (e *Editor) SetObjectLocked(id string, locked bool) error

SetObjectLocked locks the object id, and with it its descendants, against picking in the editor's 2D and 3D viewports, or unlocks it, so a click goes to what lies under it, and against manipulation there: its gizmo is not shown and the Move tool does not move it. Like SetObjectHidden, the toggle belongs to the editing session and is never written to the scene file. A locked object can still be selected and edited from the scene tree and the inspector.

func (e *Editor) SetObjectMaterial(objectID, material string) error

SetObjectMaterial names the material resource file objectID's sprite draws with, by its slash-separated path from the project root such as "materials/stone.material.yaml", or with an empty path names none, through History. A named material must load through the editor's Resolver, which must therefore implement sceneformat.MaterialResolver, as sceneformat.Build needs to draw the scene.

func (e *Editor) SetObjectMesh(id, mesh string) error

SetObjectMesh sets the built-in primitive object id draws in 3D, one of sceneformat.MeshPrimitives or "" for none, as an undoable command. It refuses any other name, and a primitive on an object that names a model.

func (e *Editor) SetObjectModel(id, model string) error

SetObjectModel names the glTF model object id draws in 3D, by its slash-separated path from the project root, such as "models/crate.glb", or with an empty path names none, as one undoable step. A named model must load through the 3D build's assets (the Resolver when it is a scenemodel.ModelResolver, the project's files otherwise). Changing the model clears the object's modelNode and modelMesh, which name parts of the model it drew; naming a model in a version 1 scene raises it to version 2, the first that has models, which Undo restores. It refuses a model on an object that draws a built-in primitive, as SetObjectMesh refuses the reverse.

func (e *Editor) SetObjectName(id, name string) error

SetObjectName sets object id's display name as an undoable command. When id names an instanced or inherited object, it records an override on its instance or inheriting scene.

func (e *Editor) SetObjectOccluder(id string, occ *sceneformat.OccluderDoc) error

SetObjectOccluder sets or clears (when nil) object id's 3D occluder definition through History. Setting an occluder on a version 1 scene raises it to version 2.

func (e *Editor) SetObjectOrigin(objectID string, x, y float32) error

SetObjectOrigin sets objectID's pivot inside its sprite's untrimmed frame (originX and originY) through History. Both must be finite.

func (e *Editor) SetObjectParticles(objectID string, ref *sceneformat.ParticlesRef) error

SetObjectParticles binds objectID to a 2D particle emitter YAML file and optional atlas (or clears it when ref is nil) through History.

func (e *Editor) SetObjectReflectionProbe(id string, probe *sceneformat.ReflectionProbeDoc) error

SetObjectReflectionProbe sets or clears object id's reflection probe definition as an undoable command on History. Setting a reflection probe on a scene below version 4 raises its version to sceneformat.CurrentVersion, which Undo restores.

func (e *Editor) SetObjectSprite(objectID string, ref *sceneformat.SpriteRef) error

SetObjectSprite binds objectID to the atlas frame ref names, or with a nil ref unbinds it, through History. ref needs both an atlas and a frame; with a Resolver set the atlas must resolve and hold the frame, as the asset browser lists them (Assets).

func (e *Editor) SetObjectZ(id string, z int) error

SetObjectZ sets object id's within-layer draw order Z as an undoable command. When id names an instanced or inherited object, it records an override on its instance or inheriting scene.

func (e *Editor) SetOccluderPolygonPoints(objectID string, points [][2]float64) error

SetOccluderPolygonPoints replaces the local polygon vertices of objectID's occluder2d component through History (at least 3 finite points).

func (e *Editor) SetOrthographic3D(on bool)

SetOrthographic3D switches the 3D viewport's camera between perspective and orthographic (OrbitCamera3D.Orthographic), keeping what lies at its Target the same size. It ends a flight and cancels a gizmo or camera drag.

func (e *Editor) SetOutputErrorsOnly(errorsOnly bool)

SetOutputErrorsOnly toggles the Output panel's Errors-only filter.

func (e *Editor) SetOutputPanelOpen(open bool)

SetOutputPanelOpen shows or hides the Output panel below the viewport.

func (e *Editor) SetOutputPanic(report *PanicReport)

SetOutputPanic sets or clears the Output panel's panic card report.

func (e *Editor) SetOutputPanicRuntimeExpanded(expanded bool)

SetOutputPanicRuntimeExpanded shows or folds runtime stack frames inside the Output panel's panic card.

func (e *Editor) SetOverlayClock(fn func() time.Time)

SetOverlayClock sets a custom clock function for overlay fade-in and pulse animation timing (used in deterministic tests; pass nil to restore time.Now).

func (e *Editor) SetOverlayKindVisible(kind OverlayKind, visible bool) error

SetOverlayKindVisible shows or hides one legend kind across all viewports (2D and 3D) and persists the choice per person in Editor.SettingsPath when configured (never touching project files).

func (e *Editor) SetOverlayLegendKind(kind OverlayLegendKind, on bool) error

SetOverlayLegendKind turns the Spec overlay legend row kind on or off and persists the choice in the editor's settings file when SettingsPath is configured.

func (e *Editor) SetOverlayLegendKinds(kinds []OverlayKind) error

SetOverlayLegendKinds replaces the enabled legend kinds and persists to SettingsPath when set.

func (e *Editor) SetOverlayLegendOpen(open bool)

SetOverlayLegendOpen shows or hides the compact viewport overlay legend in the viewport top-left corner.

func (e *Editor) SetOverlaysPopoverOpen(open bool)

SetOverlaysPopoverOpen opens or closes the viewport Overlays popover.

func (e *Editor) SetPanelVisible(key string, visible bool)

SetPanelVisible shows or hides panel key, persisting the layout when LayoutPath is set.

func (e *Editor) SetParticleActiveCurve(kind ParticleCurveKind)
func (e *Editor) SetParticleAlphaCurve(c particles.FloatCurve) error
func (e *Editor) SetParticleAngle(minAngle, maxAngle float32) error
func (e *Editor) SetParticleBurst(index int, b particles.Burst) error
func (e *Editor) SetParticleCollision(col particles.CollisionConfig) error
func (e *Editor) SetParticleColorCurve(c particles.ColorCurve) error
func (e *Editor) SetParticleColorStop(kind ParticleCurveKind, index int, t float32, col core.Color) (int, error)

SetParticleColorStop updates the color stop at index in the named color curve, keeping stops sorted by T, and returns its new index.

func (e *Editor) SetParticleFloatStop(kind ParticleCurveKind, index int, t, val float32) (int, error)

SetParticleFloatStop updates the control point at index in the named float curve, keeping stops sorted by T, and returns its new index.

func (e *Editor) SetParticleFrameNames(names []string) error
func (e *Editor) SetParticleGravity(gx, gy float32) error
func (e *Editor) SetParticleInitialRotation(minRot, maxRot float32) error
func (e *Editor) SetParticleLifetime(minLife, maxLife time.Duration) error
func (e *Editor) SetParticleMaxParticles(n int) error
func (e *Editor) SetParticlePosition(x, y float32) error
func (e *Editor) SetParticlePreviewAtlas(atlasName string)

SetParticlePreviewAtlas binds the named atlas from the editor's Resolver to the live particle preview and atlas frame picker.

func (e *Editor) SetParticlePreviewFloor(on bool)

SetParticlePreviewFloor toggles the preview's horizontal test floor collider for inspecting collision response.

func (e *Editor) SetParticleRate(rate float32) error
func (e *Editor) SetParticleRotation(rot float32) error
func (e *Editor) SetParticleRotationCurve(c particles.FloatCurve) error
func (e *Editor) SetParticleRotationSpeed(minSpeed, maxSpeed float32) error
func (e *Editor) SetParticleSeed(seed uint64) error
func (e *Editor) SetParticleShape(shape particles.Shape) error
func (e *Editor) SetParticleSizeCurve(c particles.FloatCurve) error
func (e *Editor) SetParticleSpace(space particles.SimulationSpace) error
func (e *Editor) SetParticleSpeed(minSpeed, maxSpeed float32) error
func (e *Editor) SetParticleSubEmitter(index int, trigger particles.SubEmitterTrigger, burstCount int, inheritVelocity float32) error
func (e *Editor) SetParticleTargetPath(subPath []int) error

SetParticleTargetPath selects either the root emitter (empty path) or a nested sub-emitter config by index path for editing in the panel.

func (e *Editor) SetParticleTrail(trail *particles.TrailConfig) error
func (e *Editor) SetParticleTrailEnabled(enabled bool) error
func (e *Editor) SetParticleZ(z int) error
func (e *Editor) SetPermissionRuleAction(index int, action PermissionAction) error

SetPermissionRuleAction updates the action of rule index and persists permissions.yaml.

func (e *Editor) SetPermissionRuleDecision(index int, decision PermissionDecision) error

SetPermissionRuleDecision updates the decision (allow, ask, deny) of rule index, keeping the active profile name (so IsModified marks it as changed when it differs from the preset), and persists permissions.yaml.

func (e *Editor) SetPermissionRulePatterns(index int, patterns []string) error

SetPermissionRulePatterns updates the file globs / run targets of rule index and persists permissions.yaml.

func (e *Editor) SetPermissions(f PermissionsFile) error

SetPermissions validates, persists permissions.yaml when a project path is available, and atomically applies f to the editor. If writing permissions.yaml fails, in-memory rules remain unchanged so disk and memory never diverge.

func (e *Editor) SetPermissionsDraftRuleTicked(index int, ticked bool)

SetPermissionsDraftRuleTicked sets the checkbox state of rule index in the open permissions draft (person-only).

func (e *Editor) SetPermissionsSettingsOpen(open bool)

SetPermissionsSettingsOpen opens or closes Settings › Permissions.

func (e *Editor) SetPhysicsLayers(layers *sceneformat.PhysicsLayerTable)

SetPhysicsLayers configures the named collision layer table used when validating and playing scenes without an open project. When a project with physics settings is open, the project's physics.layers take precedence.

func (e *Editor) SetPlaceOptions3D(height float32, snap, align bool) error

SetPlaceOptions3D sets how the Place tool puts models in the 3D viewport: the ground plane's height (PlaceHeight3D), snapping to the grid (PlaceSnap3D) and aligning to the surface's normal (PlaceAlign3D). Like the camera, they are a view setting, not an edit: not undoable and not saved. It refuses a height that is not finite.

func (e *Editor) SetPlanGhostsVisible(visible bool)

SetPlanGhostsVisible turns planned viewport ghosts on or off without altering the plan or scene.

func (e *Editor) SetPlanStepField(stepNumber int, fieldKey string, value int) error

SetPlanStepField updates numeric fieldKey on stepNumber, clamping value to [Min, Max].

func (e *Editor) SetPlanStepNote(stepNumber int, note string) error

SetPlanStepNote stores a free-text note telling the agent how to change stepNumber.

func (e *Editor) SetPlayInspectorTab(tab PlayInspectorTab)

SetPlayInspectorTab switches between the Inspector and Agent tabs during Play mode.

func (e *Editor) SetPlayPaused(paused bool)

SetPlayPaused pauses or resumes local Play mode. Resuming clears the viewport agent stepping pill.

func (e *Editor) SetPlayTimeScale(scale float64)

SetPlayTimeScale updates the Play mode simulation time scale (such as 0.25, 0.5, 1, or 2).

func (e *Editor) SetPlaytestAgentRead(read string, suggestions []string) error

SetPlaytestAgentRead replaces the Agent's read text and actionable suggestions on the active playtest report entry.

func (e *Editor) SetPlaytestReportOpen(open bool)

SetPlaytestReportOpen opens or closes the Playtest Report screen. Opening while Play mode is active is ignored. If no report is loaded yet and an open project contains playtest.report.yaml, it loads it automatically.

func (e *Editor) SetPluginEnabled(name string, on bool) error

SetPluginEnabled turns the registered plugin name on or off for the open project by adding it to or removing it from editor.plugins in game.yaml, as one undoable step that SaveProject writes. A plugin turned on goes last; turning off the last one removes the editor section when nothing else is left in it, including a section the author wrote, and Undo puts it back. It returns ErrNoProject without a project, ErrPlaying while playing, and an error for a name that is not registered when turning it on; turning off a plugin the project names but this editor lacks is allowed.

func (e *Editor) SetPluginHover2D(x, y float32)

SetPluginHover2D notifies the active plugin tool's OnHover callback of pointer motion at canvas coordinates (x, y) in 2D edit mode.

func (e *Editor) SetPluginHover3D(sx, sy, w, h float32)

SetPluginHover3D notifies the active plugin tool's OnHover3D callback of pointer motion at viewport pixel (sx, sy) in 3D edit mode.

func (e *Editor) SetPluginTool(plugin, id string) error

SetPluginTool makes the tool id of the plugin that is on the active viewport tool; Tool becomes ToolPlugin. Choosing another tool with SetTool, or turning the plugin off, ends it.

func (e *Editor) SetProblemAgentPanelOpen(open bool)

SetProblemAgentPanelOpen shows or hides the right-hand Agent problem panel.

func (e *Editor) SetProblemOverlayVisible(visible bool)

SetProblemOverlayVisible toggles the Spec Problem overlay in the viewport (synchronized with the Problem legend toggle and persisted when SettingsPath is set).

func (e *Editor) SetProfilerMetric(metric ProfilerMetric)

SetProfilerMetric selects the active time-series chart in the full Profiler panel.

func (e *Editor) SetProfilerOpen(open bool)

SetProfilerOpen opens or closes the full Profiler panel below the viewport.

func (e *Editor) SetProjectAppVersion(version string) error

SetProjectAppVersion updates game.yaml's appVersion through EditProject (validated and undoable).

func (e *Editor) SetProjectDisplayBarColor(barColor string) error

SetProjectDisplayBarColor updates game.yaml's display.barColor through EditProject (validated and undoable).

func (e *Editor) SetProjectDisplayEnabled(enabled bool) error

SetProjectDisplayEnabled enables or disables game.yaml's virtual display section through EditProject. Enabling initializes display.width and display.height from the project's window size.

func (e *Editor) SetProjectDisplayIntegerScale(on bool) error

SetProjectDisplayIntegerScale updates game.yaml's display.integerScale through EditProject (validated and undoable).

func (e *Editor) SetProjectDisplayMode(mode string) error

SetProjectDisplayMode updates game.yaml's display.mode through EditProject (validated and undoable).

func (e *Editor) SetProjectDisplayPixelSnap(on bool) error

SetProjectDisplayPixelSnap updates game.yaml's display.pixelSnap through EditProject (validated and undoable).

func (e *Editor) SetProjectDisplaySize(width, height float32) error

SetProjectDisplaySize updates game.yaml's display.width and display.height through EditProject (creating display if nil).

func (e *Editor) SetProjectID(id string) error

SetProjectID updates game.yaml's id through EditProject (validated and undoable).

func (e *Editor) SetProjectLoading(loading bool, projectPath string)

SetProjectLoading sets the project-loading state so every region displays its designed loading state.

func (e *Editor) SetProjectMainScene(name string) error

SetProjectMainScene updates game.yaml's autoload.mainScene through EditProject (validated and undoable).

func (e *Editor) SetProjectName(name string) error

SetProjectName updates game.yaml's name through EditProject (validated and undoable).

func (e *Editor) SetProjectPhysicsGravity2D(x, y float32) error

SetProjectPhysicsGravity2D updates game.yaml's physics.gravity2D through EditProject.

func (e *Editor) SetProjectPhysicsGravity3D(x, y, z float32) error

SetProjectPhysicsGravity3D updates game.yaml's physics.gravity3D through EditProject.

func (e *Editor) SetProjectPhysicsSolverIterations(iter2D, iter3D int) error

SetProjectPhysicsSolverIterations updates game.yaml's physics.solverIterations2D and solverIterations3D through EditProject.

func (e *Editor) SetProjectRules(label, content string) error

SetProjectRules updates AGENTS.md as plain Markdown in one undoable step in Editor.History, writing the file when a project is open.

func (e *Editor) SetProjectSettingsOpen(open bool)

SetProjectSettingsOpen opens the Settings view on the Project page, or closes Settings when open is false and the Project page is active.

func (e *Editor) SetProjectSettingsSection(section ProjectSettingsSection)

SetProjectSettingsSection switches the active section in the Project Settings panel.

func (e *Editor) SetProjectTemplates(tmpls []ProjectTemplate)

SetProjectTemplates sets the project templates displayed on the Start Screen.

func (e *Editor) SetProjectWindowAppearance(appearance string) error

SetProjectWindowAppearance updates game.yaml's window.appearance through EditProject (validated and undoable).

func (e *Editor) SetProjectWindowLimits(minWidth, minHeight, maxWidth, maxHeight float32) error

SetProjectWindowLimits updates game.yaml's window min/max width and height limits through EditProject (validated and undoable).

func (e *Editor) SetProjectWindowResizable(resizable bool) error

SetProjectWindowResizable updates game.yaml's window.resizable through EditProject (validated and undoable).

func (e *Editor) SetProjectWindowSize(width, height float32) error

SetProjectWindowSize updates game.yaml's window.width and window.height through EditProject (validated and undoable).

func (e *Editor) SetProjectWindowTitle(title string) error

SetProjectWindowTitle updates game.yaml's window.title through EditProject (validated and undoable).

func (e *Editor) SetProperty(objectID, key string, value any) error

SetProperty sets a typed custom property on objectID through History. Supported value types include string, int, float64, float32, and bool.

func (e *Editor) SetProposedNewObjectIDs(ids []string)

SetProposedNewObjectIDs marks object IDs proposed by a pending review so the scene rail displays a NEW tag.

func (e *Editor) SetRandomBrushSeed(seed uint64)

SetRandomBrushSeed sets the deterministic seed used by ToolRandomTile.

func (e *Editor) SetRandomBrushTileWeight(tileID int, weight float64) error

SetRandomBrushTileWeight adds tileID to the random brush pool with weight, or updates its weight when already present.

func (e *Editor) SetRandomBrushTiles(entries []WeightedTile) error

SetRandomBrushTiles configures the weighted tile pool for ToolRandomTile. Each entry must have a positive TileID and a positive finite Weight; duplicate tile IDs and overflowing weight sums are refused.

func (e *Editor) SetRecentProjectsPath(path string) error

SetRecentProjectsPath configures where the editor persists its per-user recent projects YAML file and loads any existing entries from path (an absent file starts with an empty list).

func (e *Editor) SetReduceMotion(on bool)

SetReduceMotion forces reduced motion on or off on the editor (overriding the platform environment).

func (e *Editor) SetReducedMotionOverride(v *bool)

SetReducedMotionOverride overrides reduced-motion detection for deterministic testing. Pass nil to follow core.Scope.Env().ReducedMotion.

func (e *Editor) SetRegisteredMCPTools(tools []AgentToolInfo)

SetRegisteredMCPTools publishes the sorted list of tools registered on the editor's MCP server so Settings › Tools shows every tool with its name, description, and on/off switch.

func (e *Editor) SetReleaseDryRun(dryRun bool)

SetReleaseDryRun toggles dry-run mode on the Build and Release screen.

func (e *Editor) SetReleaseEditingPreset(editing bool)

SetReleaseEditingPreset toggles the inline preset editor drawer for the selected preset.

func (e *Editor) SetReleaseFollowLog(follow bool)

SetReleaseFollowLog toggles log auto-following on the Build and Release screen.

func (e *Editor) SetReleaseKeptReviews(reviews []string)

SetReleaseKeptReviews sets the kept review summaries included when drafting player-facing release notes.

func (e *Editor) SetReleaseNotesFile(relPath string) error

SetReleaseNotesFile sets the project-relative Markdown file path for RELEASE NOTES (syncing ExportReleaseNotes). Paths escaping the project directory or pointing through symlinks are refused.

func (e *Editor) SetReleaseNotesText(notes string)

SetReleaseNotesText updates the release notes shown in the Build and Release screen and saves them directly to the exact Markdown file that `game release -release-notes` reads, touching ONLY that file.

func (e *Editor) SetReleaseShowWholeLog(show bool)

SetReleaseShowWholeLog toggles expanding the full log view on a failed preset.

func (e *Editor) SetReleaseUploadDestination(platform string, dest PublishDestination) error

SetReleaseUploadDestination changes the target store destination for platform inside Review uploads.

func (e *Editor) SetReleaseUploadItemIncluded(platform string, included bool) error

SetReleaseUploadItemIncluded toggles whether platform's artifact is included in the Review uploads batch.

func (e *Editor) SetReleaseVersion(version string) error

SetReleaseVersion updates the open project's appVersion through EditProject.

func (e *Editor) SetRemoteComponentField(ref, component, field string, value any) error

SetRemoteComponentField patches one field of component on the live entity ref via game_component_set, records or updates the edit in RemoteLiveChanges, and updates the cached inspection snapshot.

func (e *Editor) SetRemoteComponentValue(ref, component string, value any, replace bool) error

SetRemoteComponentValue sets or replaces a scalar or structured component value on the live entity ref via game_component_set.

func (e *Editor) SetReviewChangeBlocker(changeID, reason string)

SetReviewChangeBlocker sets or clears a blocker reason on changeID (plug-in hook for Conflicts / YAML errors).

func (e *Editor) SetReviewChangeNote(changeID, note string)

SetReviewChangeNote sets or clears an unsent annotation note on changeID.

func (e *Editor) SetReviewFilter(f ReviewFilter)

SetReviewFilter switches the active left-list filter chip (All, Added, Changed, Removed, Unseen, Notes).

func (e *Editor) SetReviewNote(changeID, note string) error

SetReviewNote saves an unsent turn-scoped note on changeID. Notes live only in memory on the active turn and are never written to any scene, prefab, or data file.

func (e *Editor) SetReviewNoteDraft(text string)

SetReviewNoteDraft updates the live composer draft without trimming spaces or triggering a full Review UI remount so typing stays completely smooth and focus-stable.

func (e *Editor) SetReviewPeekBefore(peek bool)

SetReviewPeekBefore switches Before-request peek mode (holding B).

func (e *Editor) SetReviewSearch(q string)

SetReviewSearch updates the left-list filter query (matching change name, field, detail, or file path).

func (e *Editor) SetReviewViewRound(round int) error

SetReviewViewRound switches the Review screen between Round 1 (read-only once Round 2+ exists) and the latest round. Keep always applies the latest round.

func (e *Editor) SetReviewYAMLDraft(changeID, raw string) error

SetReviewYAMLDraft updates the in-place YAML text for changeID, parses and validates it live (refusing unknown fields and duplicate keys), updates the Review viewport immediately when valid, or records a line-specific error with a one-step fix when the parser reports what is missing.

func (e *Editor) SetRigAnimationDuration(name string, duration time.Duration) error

SetRigAnimationDuration sets animation name's duration as an undoable command.

func (e *Editor) SetRigAnimationLoop(name string, loop bool) error

SetRigAnimationLoop sets animation name's default loop flag as an undoable command.

func (e *Editor) SetRigAtlas(atlasName string) error

SetRigAtlas selects which sprite.Atlas supplies attachment frames for the rig editor preview.

func (e *Editor) SetRigAttachment(skin, slot string, att skeletal.Attachment) error

SetRigAttachment sets the full skeletal.Attachment for slot in skin (creating skin if needed) as an undoable command.

func (e *Editor) SetRigAttachmentOrigin(skin, slot string, originX, originY float32) error

SetRigAttachmentOrigin sets the pivot (originX, originY) of slot's attachment in skin as an undoable command.

func (e *Editor) SetRigAttachmentTransform(skin, slot string, x, y, rotation, scaleX, scaleY float32) error

SetRigAttachmentTransform sets the local offset, rotation and scale of slot's attachment in skin as an undoable command.

func (e *Editor) SetRigBoneLength(name string, length float32) error

SetRigBoneLength sets bone name's length (non-negative, finite) as an undoable command.

func (e *Editor) SetRigCanvasSize(w, h float32)

SetRigCanvasSize records the rig editor canvas's laid-out size in points.

func (e *Editor) SetRigName(name string) error

SetRigName sets the open rig's name as an undoable command.

func (e *Editor) SetRigSlotAlpha(slot string, alpha float32) error

SetRigSlotAlpha sets slot's bind-pose opacity in [0, 1] as an undoable command.

func (e *Editor) SetRigSlotBone(slot, bone string) error

SetRigSlotBone rebinds slot to bone as an undoable command.

func (e *Editor) SetRightPanelTab(tab RightPanelTab)

SetRightPanelTab switches the right-hand panel between Inspector and Agent.

func (e *Editor) SetRightRailMode(mode RightRailMode)

SetRightRailMode switches the right rail tab (RightRailInspector, RightRailAgent, or RightRailHistory).

func (e *Editor) SetRightRailTab(tab RightRailTab)

SetRightRailTab switches the right sidebar between Inspector, Agent, and History. When AgentModeNone is active, the Agent panel stays closed.

func (e *Editor) SetRoomCreateMode(on bool)

SetRoomCreateMode toggles viewport drag-to-create mode for rooms in the open room map.

func (e *Editor) SetRoomGridSize(w, h float32)

SetRoomGridSize sets an explicit tile-grid snap size (w, h) for rooms when the scene has no tilemap or to override the tilemap's tile size; pass (0, 0) to follow the scene's tilemap.

func (e *Editor) SetRoomID(oldID, newID string) error

SetRoomID renames room oldID to newID as an undoable command, refusing empty, whitespace-padded, or duplicate IDs via rooms.Validate.

func (e *Editor) SetRoomMapTransition(tr *rooms.Transition) error

SetRoomMapTransition sets or clears (when tr is nil) the open room map's default transition as an undoable command, checked by rooms.Validate.

func (e *Editor) SetRoomName(id, name string) error

SetRoomName updates room id's display name or localization key as an undoable command.

func (e *Editor) SetRoomRect(id string, x, y, w, h float32) error

SetRoomRect updates room id's rectangle (x, y, w, h) in world points as an undoable command.

func (e *Editor) SetRoomSnapToGrid(on bool)

SetRoomSnapToGrid enables or disables snapping room edges to the tile grid.

func (e *Editor) SetRoomTransition(id string, tr *rooms.Transition) error

SetRoomTransition sets or clears (when tr is nil) room id's transition override as an undoable command, checked by rooms.Validate.

func (e *Editor) SetRotationSnapDeg(deg float32) bool

SetRotationSnapDeg sets the rotation snap step in degrees. Non-positive or non-finite values are refused.

func (e *Editor) SetRunStartAtOpenScene(startAtOpen bool)

SetRunStartAtOpenScene toggles whether RunGame starts the game at the currently open scene.

func (e *Editor) SetRunWithAutomation(on bool)

SetRunWithAutomation toggles whether RunGame launches the game with `-automation` and connects the editor's Remote inspector.

func (e *Editor) SetSafeRenameInput(newName string) error

SetSafeRenameInput updates the NEW NAME field in safe-rename mode, validating live and computing the dry-run plan without writing any file.

func (e *Editor) SetScaleSnapStep(step float32) bool

SetScaleSnapStep sets the scale snap increment. Non-positive or non-finite values are refused.

func (e *Editor) SetSceneConflictChoice(objectID string, choice DiskMergeChoice) error

SetSceneConflictChoice sets whether objectID uses the editor's version (DiskMergeMine) or the disk version (DiskMergeDisk) when resolving an active external scene conflict.

func (e *Editor) SetSceneName(name string) error

SetSceneName updates the open scene's Name through History, checked by sceneformat.Validate.

func (e *Editor) SetSceneNavMesh(navPath string) error

SetSceneNavMesh updates SceneDoc.NavMesh through History as one undoable step, validated by sceneformat.Validate.

func (e *Editor) SetSceneOverlays(entries []SceneOverlayEntry)

SetSceneOverlays replaces the active live scene overlays (agent working, added, changed, removed, focused review change) drawn over the open scene in both 2D and 3D viewports.

func (e *Editor) SetSceneTreeFilter(query string)

SetSceneTreeFilter updates the left-rail Scene Tree search query.

func (e *Editor) SetSceneTreeFilterOpen(open bool)

SetSceneTreeFilterOpen shows or hides the left-rail Scene Tree filter bar. Closing the filter bar clears any active filter so hidden nodes are not left obscured.

func (e *Editor) SetSceneTreeTab(tab SceneTreeTab)

SetSceneTreeTab switches the scene tree panel between SceneTreeLocal and SceneTreeRemote.

func (e *Editor) SetSearchLoading(loading bool)

SetSearchLoading updates the Search & References panel loading state and notifies listeners.

func (e *Editor) SetSearchOpen(open bool)

SetSearchOpen shows or hides the Project Search and References panel.

func (e *Editor) SetSearchQuery(query string) error

SetSearchQuery updates the project search field, opens the search panel on the Search tab when query is non-empty, runs Search, and notifies listeners.

func (e *Editor) SetSearchTab(tab SearchTab)

SetSearchTab switches the Project Search and References panel between Search and References.

func (e *Editor) SetSelectedAlpha(alpha float32) error

SetSelectedAlpha sets Alpha on every selected object in one undo step.

func (e *Editor) SetSelectedComponentField(componentName, field string, value any) error

SetSelectedComponentField sets componentName.field to value on every selected object in one undo step, so one Undo restores each object's own prior value.

func (e *Editor) SetSelectedDepth(depth float32) error

SetSelectedDepth sets Depth on every selected object in one undo step.

func (e *Editor) SetSelectedFlipX(flipX bool) error

SetSelectedFlipX sets FlipX on every selected object in one undo step.

func (e *Editor) SetSelectedFlipY(flipY bool) error

SetSelectedFlipY sets FlipY on every selected object in one undo step.

func (e *Editor) SetSelectedMaterial(material string) error

SetSelectedMaterial sets Material on every selected object in one undo step.

func (e *Editor) SetSelectedMesh(mesh string) error

SetSelectedMesh sets Mesh on every selected object in one undo step.

func (e *Editor) SetSelectedName(name string) error

SetSelectedName sets the display Name on every selected object in one undo step.

func (e *Editor) SetSelectedOriginX(ox float32) error

SetSelectedOriginX sets OriginX on every selected object in one undo step.

func (e *Editor) SetSelectedOriginY(oy float32) error

SetSelectedOriginY sets OriginY on every selected object in one undo step.

func (e *Editor) SetSelectedPosZ(posZ float32) error

SetSelectedPosZ sets PosZ on every selected object in one undo step, preserving X and Y.

func (e *Editor) SetSelectedProperty(key string, value any) error

SetSelectedProperty sets custom property key to value on every selected object in one undo step.

func (e *Editor) SetSelectedRotX(rotX float32) error

SetSelectedRotX sets RotX on every selected object in one undo step.

func (e *Editor) SetSelectedRotY(rotY float32) error

SetSelectedRotY sets RotY on every selected object in one undo step.

func (e *Editor) SetSelectedRotZ(rotZ float32) error

SetSelectedRotZ sets RotZ on every selected object in one undo step.

func (e *Editor) SetSelectedRotation(radians float32) error

SetSelectedRotation sets the 2D rotation (radians) on every selected object in one undo step.

func (e *Editor) SetSelectedScaleX(sx float32) error

SetSelectedScaleX sets ScaleX on every selected object in one undo step, preserving each object's ScaleY.

func (e *Editor) SetSelectedScaleY(sy float32) error

SetSelectedScaleY sets ScaleY on every selected object in one undo step, preserving each object's ScaleX.

func (e *Editor) SetSelectedScaleZ(sz float32) error

SetSelectedScaleZ sets ScaleZ on every selected object in one undo step.

func (e *Editor) SetSelectedSprite(sprite *sceneformat.SpriteRef) error

SetSelectedSprite sets Sprite on every selected object in one undo step.

func (e *Editor) SetSelectedX(x float32) error

SetSelectedX sets the X position on every selected object in one undo step, preserving each object's Y.

func (e *Editor) SetSelectedY(y float32) error

SetSelectedY sets the Y position on every selected object in one undo step, preserving each object's X.

func (e *Editor) SetSelectedZ(z int) error

SetSelectedZ sets within-layer draw order Z on every selected object in one undo step.

func (e *Editor) SetSettingsOpen(open bool)

SetSettingsOpen opens or closes the unified Settings view. Opening shows the previously active page (or SettingsPageProject when a project is open and no page has been selected yet).

func (e *Editor) SetShading3D(mode Shading3D)

SetShading3D switches how the 3D viewport shades the scene's geometry on the GPU. It is a view setting, not an edit, so it is not undoable and is not saved with the scene; an unknown mode is ignored.

func (e *Editor) SetShortcutsSheetOpen(open bool)

SetShortcutsSheetOpen opens or closes the ⌘/ Keyboard Shortcuts reference sheet.

func (e *Editor) SetShowAgentChanges(show bool) error

SetShowAgentChanges updates whether viewport outlines highlight agent changes while a review is open. When SettingsPath is non-empty, the updated settings are persisted to SettingsPath.

func (e *Editor) SetShowAllShapes(show bool)

SetShowAllShapes toggles whether the 2D viewport draws shape component fields of all visible objects (true) or only the selected object (false).

func (e *Editor) SetShowGrid(show bool)

SetShowGrid toggles the optional 2D snap grid overlay in the 2D edit viewport.

func (e *Editor) SetShowLODOverlay(show bool)

SetShowLODOverlay toggles per-object active LOD labels and color-coding in the 3D viewport.

func (e *Editor) SetShowLightingPreview(show bool)

SetShowLightingPreview toggles live 2D lighting and shadow preview in the 2D edit viewport.

func (e *Editor) SetShowNavMesh2D(show bool)

SetShowNavMesh2D toggles drawing the built 2D navigation mesh overlay in the 2D edit viewport.

func (e *Editor) SetShowNavMesh3D(show bool)

SetShowNavMesh3D toggles drawing the baked 3D navigation mesh overlay in the 3D viewport.

func (e *Editor) SetShowOccluders(show bool)

SetShowOccluders toggles occluder volume wireframes in the 3D viewport.

func (e *Editor) SetShowPhysicsDebug(show bool)

SetShowPhysicsDebug toggles collider and trigger debug drawing in the 2D and 3D viewports.

func (e *Editor) SetShowRenderStats(show bool)

SetShowRenderStats toggles the RenderStats HUD overlay in the 3D viewport.

func (e *Editor) SetSketchActive(on bool)

SetSketchActive turns viewport sketch drawing mode on or off. Turning sketch mode off keeps existing marks on the layer until sent, cleared, or kept.

func (e *Editor) SetSketchAttached(attached bool)

SetSketchAttached attaches or detaches the sketch chip from the agent composer without erasing marks.

func (e *Editor) SetSketchMarkLabel(number int, label string) bool

SetSketchMarkLabel updates the optional text label on the 1-based sketch mark.

func (e *Editor) SetSketchMarksHidden(hidden bool)

SetSketchMarksHidden hides or shows sketch marks on the viewport without clearing them.

func (e *Editor) SetSketchPanelOpen(open bool)

SetSketchPanelOpen shows or hides the right-side Sketch / Agent panel.

func (e *Editor) SetSketchPreviewOpen(open bool)

SetSketchPreviewOpen opens or closes the "Sent with this request" preview card.

func (e *Editor) SetSketchPromptDraft(text string)

SetSketchPromptDraft updates the Sketch/Agent composer draft text.

func (e *Editor) SetSketchReviewOverlayVisible(on bool)

SetSketchReviewOverlayVisible toggles the Sketch overlay in review (laying the faint dotted sketch over the result).

func (e *Editor) SetSketchTool(tool SketchTool)

SetSketchTool switches the active sketch tool and ensures sketch mode is active.

func (e *Editor) SetSnapInvert(invert bool)

SetSnapInvert sets whether snapping is temporarily inverted (as when holding Ctrl or Cmd during a drag).

func (e *Editor) SetSnapRotation(on bool)

SetSnapRotation toggles rotation snapping in 2D and 3D rotation drags.

func (e *Editor) SetSnapScale(on bool)

SetSnapScale toggles scale snapping in 2D and 3D scale drags.

func (e *Editor) SetSnapSettings(s SnapSettings) bool

SetSnapSettings applies s to the editor, refusing non-finite or negative step values. Zero step values for RotationStepDeg and ScaleStep restore their defaults (15° and 0.25); GridSize 0 follows the active layer's tilemap tile size (or 8 when it has none).

func (e *Editor) SetSnapToGrid(on bool)

SetSnapToGrid toggles grid snapping for object placement, drags, 2D handles, and 3D translate gizmos.

func (e *Editor) SetSnapToPixel(on bool)

SetSnapToPixel toggles pixel snapping (whole 1-point increments) when grid snapping is off.

func (e *Editor) SetStartProjectIdea(idea string)

SetStartProjectIdea updates the draft game idea text on the Start Screen.

func (e *Editor) SetStartProjectModule(module string)

SetStartProjectModule updates the draft Go module path and re-runs live validation.

func (e *Editor) SetStartProjectName(name string)

SetStartProjectName updates the draft project name and re-runs live validation.

func (e *Editor) SetStartProjectParentDir(dir string)

SetStartProjectParentDir updates the draft parent folder and re-runs live validation.

func (e *Editor) SetStartScreenOpen(open bool)

SetStartScreenOpen shows or hides the Start Screen.

func (e *Editor) SetStartTemplateFilter(filter string)

SetStartTemplateFilter sets the Start Screen template filter ("all", "2d", or "3d").

func (e *Editor) SetStatesDoc(label string, doc *animclip.StateMachineDoc) error

SetStatesDoc replaces the open state machine's document with doc as one undoable command.

func (e *Editor) SetStatesDriveWithKeys(on bool)

SetStatesDriveWithKeys enables or disables Drive with keys in the state machine preview.

func (e *Editor) SetStatesEntry(name string) error

SetStatesEntry sets the entry state of the open state machine as an undoable command.

func (e *Editor) SetStatesNodePos(name string, x, y float32) error

SetStatesNodePos updates the graph layout coordinates of state name as an undoable command.

func (e *Editor) SetTaskComposerDraft(draft string)

SetTaskComposerDraft updates the prompt draft in the Tasks panel composer.

func (e *Editor) SetTaskComposerMode(mode TaskStartMode)

SetTaskComposerMode sets the selected start mode (Queue or Run in parallel) in the Tasks composer.

func (e *Editor) SetTaskDismissSelected(id string, selected bool)

SetTaskDismissSelected sets whether a Ready to review task is checked for bulk dismissal.

func (e *Editor) SetTaskHoldReleaseHook(fn func(taskID string))

SetTaskHoldReleaseHook registers a callback invoked whenever a task stops or finishes and releases its object holds (used by editormcp to wake waiting parallel sessions).

func (e *Editor) SetTaskHoldState(id string, editing []string, holding []string, blockedOn string, blockedByTaskID string) error

SetTaskHoldState updates which objects task id is actively editing or holding/waiting on. When blockedOn is non-empty, the task shows "waiting on <blockedOn>" in the task list and viewport overlay.

func (e *Editor) SetTasksListExpanded(expanded bool)

SetTasksListExpanded expands or collapses the Tasks list inside the Agent panel.

func (e *Editor) SetTasksPanelOpen(open bool)

SetTasksPanelOpen opens or closes the Agent / Background Tasks panel.

func (e *Editor) SetTerrainBrush(b TerrainBrush)

SetTerrainBrush updates the active terrain brush configuration, ending any in-progress stroke first.

func (e *Editor) SetTerrainBrushMode(mode TerrainBrushMode)

SetTerrainBrushMode selects the active terrain brush mode while keeping the other brush parameters.

func (e *Editor) SetTerrainHoverAt(sx, sy, w, h float32)

SetTerrainHoverAt updates the 3D terrain brush cursor preview at viewport pixel (sx, sy).

func (e *Editor) SetTileHover(x, y float32, picking bool)

SetTileHover records that the mouse rests at the canvas point (x, y), which the hover outline of a tile tool follows (HoveredTile); picking says it would pick rather than paint there, as with Alt held. The viewport redraws only when the cell under the pointer changes.

func (e *Editor) SetTileReviewPeekBefore(peeking bool)

SetTileReviewPeekBefore sets temporary hold-B Before peek mode during an open tile review.

func (e *Editor) SetTileReviewRegionReverted(regionID string, reverted bool) error

SetTileReviewRegionReverted marks regionID reverted (true) or kept/restored (false) and updates the live viewport.

func (e *Editor) SetTileReviewViewMode(view TileReviewView)

SetTileReviewViewMode switches between Before and After views during an open tile review.

func (e *Editor) SetTileSelection(col0, row0, col1, row1 int) bool

SetTileSelection selects the inclusive cell rectangle on the active layer's inline tilemap for Copy/Cut.

func (e *Editor) SetTileStamp(stamp TileStamp) error

SetTileStamp sets the active stamp pattern painted by ToolStampTile.

func (e *Editor) SetTilesetAnimPlaying(playing bool)

SetTilesetAnimPlaying toggles live animation preview playback in the Tileset Editor.

func (e *Editor) SetTilesetSelectedShape(index int)

SetTilesetSelectedShape selects collision shape index on the selected tile (-1 clears selection).

func (e *Editor) SetTilesetSelectedTerrain(name string) bool

SetTilesetSelectedTerrain selects terrain name in the Tileset Editor (and syncs ActiveTerrain for painting).

func (e *Editor) SetTilesetSelectedTile(tileID int) bool

SetTilesetSelectedTile selects local tile tileID in the Tileset Editor and syncs the 3x3 edge/corner view, shape selection, and animation preview.

func (e *Editor) SetTilesetShapeTool(tool TilesetShapeTool)

SetTilesetShapeTool selects the collision shape drawing tool (rect or polygon).

func (e *Editor) SetTilesetTab(tab TilesetEditorTab)

SetTilesetTab switches the active per-tile editing tab in the Tileset Editor panel.

func (e *Editor) SetTilesetTerrainDefault(name string, tileID *int) error

SetTilesetTerrainDefault sets (or clears when tileID == nil) the explicit default local tile ID of terrain name as an undoable edit.

func (e *Editor) SetTilesetTerrainMode(name, mode string) error

SetTilesetTerrainMode changes terrain name's mode between "cardinal" (4-bit) and "blob" (8-bit) as an undoable edit. Switching from "blob" to "cardinal" strips diagonal bits from tiles of that terrain, refusing if two tiles would then share the same 4-bit mask.

func (e *Editor) SetTilesetTileAnimation(tileID int, frames []tilemap.TileFrameDoc) error

SetTilesetTileAnimation replaces tileID's full animation frame sequence as one undoable edit (nil or empty clears animation).

func (e *Editor) SetTilesetTileCollision(tileID int, mode string) error

SetTilesetTileCollision sets tileID's primary collision mode ("solid", "one-way", or "none") as an undoable edit, preserving any custom flags bits.

func (e *Editor) SetTilesetTileFlags(tileID int, solid, oneWay bool, customFlags tilemap.TileFlags) error

SetTilesetTileFlags sets tileID's solid, one-way, and custom flag bits in one undoable edit.

func (e *Editor) SetTilesetTileMask(tileID int, terrainName string, mask uint8, reassign bool) error

SetTilesetTileMask assigns local tile tileID to terrainName with neighbor bitmask mask as an undoable edit. When reassign is true and another tile in terrainName already owns mask, that other tile's terrain assignment is cleared in the same undo step; when reassign is false, a collision returns an error without modifying the tileset.

func (e *Editor) SetTilesetTileName(tileID int, name string) error

SetTilesetTileName sets tileID's optional name as an undoable edit.

func (e *Editor) SetTilesetTileProperty(tileID int, key string, value any) error

SetTilesetTileProperty sets a typed custom property (bool, int, float64, or string) on tileID as an undoable edit.

func (e *Editor) SetTilesetTileWeight(tileID int, weight *float64) error

SetTilesetTileWeight sets (or clears when weight == nil) tileID's variant selection weight as an undoable edit.

func (e *Editor) SetTool(t Tool)

SetTool switches the active viewport tool. A plugin's tool is chosen with SetPluginTool instead, so SetTool(ToolPlugin) is ignored.

func (e *Editor) SetToolEnabled(toolName string, enabled bool)

SetToolEnabled toggles an MCP tool in Settings › Tools (person-only).

func (e *Editor) SetView2D(v View2D) bool

SetView2D sets the 2D viewport's view, its zoom clamped to [MinView2DZoom, MaxView2DZoom]. It reports false, and changes nothing, for a non-finite value, a zoom that is not positive or while the scene plays, when the view is the scene camera's.

func (e *Editor) SetView3D(v View3D)

SetView3D turns the 3D viewport's camera to the axis view v, as the axis widget, the number-key shortcuts and the View commands do, keeping what it looks at and how far away. It ends a flight and cancels a gizmo or camera drag, whose rays came from the old camera. It does not change the projection; with Orthographic3D the view is then a true elevation or plan. The camera jumps there without animating.

func (e *Editor) SetViewMode(mode ViewMode)

SetViewMode switches the editor viewport between 2D and 3D modes.

func (e *Editor) SetViewportImageIncluded(on bool)

SetViewportImageIncluded toggles whether the Viewport image chip is included in assembled requests.

func (e *Editor) SetViewportOverlay(id string, on bool) error

SetViewportOverlay turns overlay id on or off and persists the updated per-user overlay set to SettingsPath when configured. It never modifies any project or scene file.

func (e *Editor) SetViewportOverlays(ids []string) error

SetViewportOverlays replaces the enabled viewport overlay set with ids and persists to SettingsPath when set. Unknown overlay IDs are refused without changing the current set.

func (e *Editor) SetViewportPointer2D(canvasX, canvasY float32)

SetViewportPointer2D records the mouse pointer's canvas position over the 2D viewport so Paste can place copied objects at the pointer and the status bar can display live coordinates.

func (e *Editor) SetViewportPointer3D(canvasX, canvasY float32)

SetViewportPointer3D records the mouse pointer's canvas position over the 3D viewport so Paste can place copied objects at the pointer in 3D view.

func (e *Editor) SetVirtualSize(width, height float32) error

SetVirtualSize updates the open scene's VirtualWidth and VirtualHeight through History. Both dimensions must be finite and positive; non-positive sizes are refused before modifying the document or History.

func (e *Editor) SetWeeklyRequestLimit(limit int) error

SetWeeklyRequestLimit sets the user's weekly agent request budget (0 disables the limit) and persists editor.yaml. Refused when invoked by an agent.

func (e *Editor) Settings() EditorSettings

Settings returns the editor's current per-user settings.

func (e *Editor) SettingsFilePath() string

SettingsFilePath returns the resolved settings file path used for persistence (for diagnostics/tests).

func (e *Editor) SettingsOpen() bool

SettingsOpen reports whether the unified Settings view is currently open.

func (e *Editor) SettingsPage() SettingsPage

SettingsPage returns the active page of the unified Settings view, defaulting to SettingsPageGeneral.

func (e *Editor) SettingsPageContext() (pageID, title, scope, file string)

SettingsPageContext returns the page ID, display title, scope pill, and associated project file for the active Settings page.

func (e *Editor) ShapeHandles2D() []ShapeHandle2D

ShapeHandles2D returns all interactive 2D viewport handles for the selected object's component shape fields.

func (e *Editor) ShortcutConflict(cmdID, newShortcut string) (conflictID, conflictLabel string, ok bool)

ShortcutConflict reports whether binding cmdID to newShortcut conflicts with another active command in the SAME scope. Keys used only in a different scope do NOT conflict.

func (e *Editor) ShortcutOverridden(cmdID string) bool

ShortcutOverridden reports whether cmdID currently has a custom shortcut differing from its default.

func (e *Editor) ShortcutsSheetOpen() bool

ShortcutsSheetOpen reports whether the ⌘/ Keyboard Shortcuts reference sheet is open.

func (e *Editor) ShouldFocusAgentPrompt() bool

ShouldFocusAgentPrompt reports whether a newly arrived agent permission card or question may take keyboard focus: true only when focus is already in the agent panel and no drag or text typing is in progress (Spec rule 05).

func (e *Editor) ShowAgentChanges() bool

ShowAgentChanges reports whether viewport outlines highlight agent changes while a review is open.

func (e *Editor) ShowBuildArtifactInFinder(platform string) error

ShowBuildArtifactInFinder opens the build output folder (or artifact's parent directory) using OpenOutputFolder.

func (e *Editor) ShowObjectUsages(id string) (ObjectUsagesResult, error)

ShowObjectUsages runs FindObjectUsages for id and opens the Find Usages review screen (for scene or path-valued prefab targets) or the Project Search & References panel with the results.

func (e *Editor) ShowPermissionToastRule()

ShowPermissionToastRule opens Settings › Permissions with the newly saved "Always" rule focused.

func (e *Editor) ShowProblem(p assetcheck.Problem) error

ShowProblem navigates to p, opens its scene (keeping other tabs' unsaved edits intact), selects and frames the offending object in the viewport when known, and highlights the exact file:line:col and YAML line in the Agent card.

func (e *Editor) ShowReferences(target string) ([]refs.Ref, error)

ShowReferences runs FindReferences for target, opens the Search & References panel on the References tab with the results, and returns them.

func (e *Editor) ShowSelectedFileReferences() ([]refs.Ref, error)

ShowSelectedFileReferences runs ShowReferences for Editor.SelectedFile.

func (e *Editor) ShowToast(t Toast)

ShowToast appends t to the editor's FIFO toast queue, merging duplicates with the same non-empty ID into the existing queued entry, and repaints the editor.

func (e *Editor) ShowToastHandle(t Toast) *ToastHandle

ShowToastHandle appends t to the editor's FIFO toast queue and returns a *ToastHandle for updating or dismissing it.

func (e *Editor) ShowingSceneSettings() bool

ShowingSceneSettings reports whether the inspector is showing the open scene's own settings (a scene document is loaded, no object, room, or layer is selected for inspection, and no asset file's import settings are being inspected).

func (e *Editor) SketchActive() bool

SketchActive reports whether viewport sketch drawing mode is currently active.

func (e *Editor) SketchApproved() bool

SketchApproved reports whether the user clicked Go ahead on the active sketch and allowed agent edits.

func (e *Editor) SketchAttached() bool

SketchAttached reports whether the active sketch marks are attached to the next agent request chip.

func (e *Editor) SketchBarCountLabel() string

SketchBarCountLabel returns the sketch toolbar count text, e.g. "3 marks not saved".

func (e *Editor) SketchChipLabel() string

SketchChipLabel returns the composer context chip label, e.g. "Sketch · 3 marks".

func (e *Editor) SketchDragging() bool

SketchDragging reports whether a sketch mark drag is currently in progress on the viewport.

func (e *Editor) SketchHoldActive() bool

SketchHoldActive reports whether mutating scene MCP edits must hold until the user confirms the sent sketch.

func (e *Editor) SketchHoldState() SketchHoldState

SketchHoldState returns the current confirmation hold state of the sketch layer.

func (e *Editor) SketchMarkByNumber(number int) (SketchMark, bool)

SketchMarkByNumber returns the 1-based numbered sketch mark, if present.

func (e *Editor) SketchMarkCount() int

SketchMarkCount returns the number of marks currently on the viewport sketch layer.

func (e *Editor) SketchMarks() []SketchMark

SketchMarks returns a deep copy of all marks currently on the viewport sketch layer, in sequential badge order.

func (e *Editor) SketchMarksHidden() bool

SketchMarksHidden reports whether the sketch layer marks are temporarily hidden via the eye button.

func (e *Editor) SketchPanelOpen() bool

SketchPanelOpen reports whether the right-side Sketch / Agent panel should be shown.

func (e *Editor) SketchPreviewOpen() bool

SketchPreviewOpen reports whether the "Sent with this request" sketch preview card is open.

func (e *Editor) SketchPromptDraft() string

SketchPromptDraft returns the current text in the Sketch/Agent composer field.

func (e *Editor) SketchReading() *SketchReading

SketchReading returns a copy of the agent's posted sketch reading card, or nil when none is open.

func (e *Editor) SketchReviewChanges() []SketchReviewChange

SketchReviewChanges returns the changes recorded in the active post-sketch review.

func (e *Editor) SketchReviewOpen() bool

SketchReviewOpen reports whether a post-sketch agent edit review is open.

func (e *Editor) SketchReviewOverlayVisible() bool

SketchReviewOverlayVisible reports whether the Sketch overlay toggle is enabled during review.

func (e *Editor) SketchStatusSceneCoords() (float32, float32)

SketchStatusSceneCoords returns the live scene coordinates shown in the status bar while sketching (the pointer position in scene space when hovering the viewport, otherwise the selected/last mark or view center).

func (e *Editor) SketchTool() SketchTool

SketchTool returns the active sketch drawing tool (Pen, Arrow, Box, or Text).

func (e *Editor) SkipFirstRunTips() error

SkipFirstRunTips marks all three first-review tips as seen in EditorSettings and dismisses them.

func (e *Editor) SnapAxis2D(v float64, axis int) float64

SnapAxis2D snaps a 2D coordinate along axis (0 for X, 1 for Y) according to the active grid/pixel snap settings and temporary inversion.

func (e *Editor) SnapInvert() bool

SnapInvert reports whether temporary snap inversion is currently active.

func (e *Editor) SnapPosition2D(x, y float64) (float64, float64)

SnapPosition2D snaps (x, y) according to the active grid/pixel snap settings and temporary inversion.

func (e *Editor) SnapPosition3D(x, y, z float64) (float64, float64, float64)

SnapPosition3D snaps a 3D coordinate (x, y, z) according to the active grid/pixel snap settings and temporary inversion.

func (e *Editor) SnapRotationRadians(rad float64) float64

SnapRotationRadians snaps rad to multiples of EffectiveRotationSnapDeg in radians when rotation snap (XOR temporary inversion) is active.

func (e *Editor) SnapScaleFactor(s float64) float64

SnapScaleFactor snaps s to multiples of EffectiveScaleSnapStep when scale snap (XOR temporary inversion) is active, avoiding collapse to zero.

func (e *Editor) SnapSettings() SnapSettings

SnapSettings returns a snapshot of the editor's current snapping and grid overlay preferences.

func (e *Editor) SnapValue(v float64) float64

SnapValue snaps v to the active grid step (or whole points when pixel snap is active), respecting temporary snap inversion, and normalizes -0 to 0.

func (e *Editor) SpecPalette(cx *core.Scope) SpecPalette

SpecPalette returns the active SpecPalette for cx when non-nil (following cx.Dark(), which tracks Scope.SetAppearance, Scope.SetSubtreeAppearance, and live system appearance changes), or e.Dark() otherwise.

func (e *Editor) StagedFileYAML(rel string) ([]byte, bool)

StagedFileYAML returns the live in-memory YAML bytes for rel (a slash-separated project path) if rel is currently open in a non-active scene tab or held in memory by an active/kept agent turn.

func (e *Editor) StampTiles(layer string, col, row int, stamp TileStamp) error

StampTiles places stamp with its top-left corner at (col, row) on layer's inline tilemap as one undoable command. Cells falling outside the map are clipped.

func (e *Editor) StartAgentRequest(prompt string) uint64

StartAgentRequest begins a new live agent request in the Agent panel, clears prior per-request denials so the agent may ask again on a new request, and immediately displays a gray placeholder step (within 300 ms).

func (e *Editor) StartAgentTurn(prompt string) error

StartAgentTurn begins a new pending agent turn labelled with prompt. Every edit made through the editor's MCP server until EndAgentTurn or StopAgentTurn is grouped into this one turn across all touched files, applied in memory immediately with zero disk writes.

func (e *Editor) StartCreateProject(req CreateProjectRequest) error

StartCreateProject creates a new project using req via Editor.CreateProject (or `go tool game new` by default) off the UI goroutine, streaming its output to CreateProjectOutput, and opens the created project when it succeeds.

func (e *Editor) StartDataTableReviewCellEdit(key, col string)

StartDataTableReviewCellEdit opens the inline value editor for (key, col) in the active file.

func (e *Editor) StartExportBuild(opts ExportBuildOptions) error

StartExportBuild validates the open project's release settings and asset credits, then executes `nsgo build` (or prints the exact dry-run command) off the UI goroutine, streaming output lines into the Output log and opening the output folder when a non-dry-run build succeeds.

func (e *Editor) StartFreshAgentThread() (string, error)

StartFreshAgentThread starts a new thread seeded with a summary of the current thread, clears the old turns and transient attached chips, and drops context usage.

func (e *Editor) StartNameStatus() StartNameValidation

StartNameStatus returns the live validation result for the Start Screen's New Project inputs.

func (e *Editor) StartProjectIdea() string

StartProjectIdea returns the draft game idea text on the Start Screen.

func (e *Editor) StartProjectModule() string

StartProjectModule returns the draft Go module path in the Start Screen form.

func (e *Editor) StartProjectName() string

StartProjectName returns the draft project name in the Start Screen form.

func (e *Editor) StartProjectParentDir() string

StartProjectParentDir returns the draft parent folder in the Start Screen form.

func (e *Editor) StartReleaseBuild(opts ...BuildReleaseOptions) error

StartReleaseBuild starts building every included, ready preset one at a time on a background goroutine. Pass an optional BuildReleaseOptions to override DryRun, Channel, or ReleaseNotes; omitting it uses the screen's settings.

func (e *Editor) StartReleaseUpload() error

StartReleaseUpload unconditionally refuses to upload directly without confirmation in Review uploads. Callers must open Review uploads (ReviewReleaseUploads) and have the person confirm via ConfirmReleaseUploads.

func (e *Editor) StartSafeRename() error

StartSafeRename switches the open References screen into safe-rename mode (F2).

func (e *Editor) StartScreenOpen() bool

StartScreenOpen reports whether the Start Screen is currently displayed in EditorView.

func (e *Editor) StartSketch()

StartSketch activates viewport sketch mode and opens the Sketch/Agent panel.

func (e *Editor) StartTemplateFilter() string

StartTemplateFilter returns the active Start Screen template filter ("all", "2d", or "3d").

func (e *Editor) StartTurnReview(input ReviewTurnInput) error

StartTurnReview analyzes the agent turn's before/after file snapshots into grouped file/kind changes and opens the full-window Review screen (or leaves it pending when input.StartPending is true).

func (e *Editor) StartWebBuildServer(servePath string) (WebBuildServerSnapshot, error)

StartWebBuildServer starts serving servePath (a built web directory or .zip archive containing index.html) strictly on the local network (LAN IP or loopback, never public), exposing the LAN URL, QR code payload, and /__nsgo_mcp/* Play-mode debug bridge endpoints. If servePath is empty, the editor locates the latest web build output directory automatically.

func (e *Editor) StartWithAI() error

StartWithAI begins the Start with AI journey from the Start Screen. When no agent is connected yet, it opens Connect in place on the Start Screen while keeping the idea and project name intact; when an agent is already connected, it opens the first plan directly. No project folder is created until the author approves the plan.

func (e *Editor) States() *animclip.StateMachineDoc

States returns a copy of the sprite state machine open in the editor, or nil.

func (e *Editor) StatesActionHeld(action string) bool

StatesActionHeld reports whether action is currently held in Drive with keys mode.

func (e *Editor) StatesActiveFrame() string

StatesActiveFrame returns the current sprite frame name shown on the preview target object, or "".

func (e *Editor) StatesClipMetaFor(name string) (StatesClipMeta, bool)

StatesClipMetaFor returns cached clip metadata for state name.

func (e *Editor) StatesClipResolver() animclip.ClipResolver

StatesClipResolver returns the ClipResolver used to load clips for the open state machine.

func (e *Editor) StatesCurrentState() string

StatesCurrentState returns the state currently active in the runtime preview, or SelectedStatesNode when no preview player is active.

func (e *Editor) StatesDirty() bool

StatesDirty reports whether the open state machine differs from its last opened or saved YAML bytes.

func (e *Editor) StatesDriveWithKeys() bool

StatesDriveWithKeys reports whether Drive with keys is enabled in the state machine preview.

func (e *Editor) StatesDriverPosY() float64

StatesDriverPosY returns the simulated vertical jump offset of the Drive with keys preview (<= 0).

func (e *Editor) StatesError() error

StatesError returns why the open state machine cannot be previewed on the scene, or nil.

func (e *Editor) StatesHandleKeyEvent(ev core.KeyEvent, down bool) bool

StatesHandleKeyEvent forwards a hardware key event to the Drive with keys input actions when active. It ignores events during Play mode, never swallows modifier shortcuts (Cmd/Ctrl/Alt) or unbound keys, and treats Escape as releasing keys and exiting Drive with keys.

func (e *Editor) StatesOutgoingFor(state string) []StatesOutgoing

StatesOutgoingFor returns the transitions leaving state name (including Any-state transitions to other states), formatted for the LEAVING <STATE> panel.

func (e *Editor) StatesPath() string

StatesPath returns the file path the open state machine was loaded from or saved to, or "".

func (e *Editor) StatesPlaying() bool

StatesPlaying reports whether the state machine preview is running on game.Loop.

func (e *Editor) StatesPreviousState() string

StatesPreviousState returns the state active before the most recent preview transition, or "".

func (e *Editor) StatesTarget() string

StatesTarget returns the object ID the open state machine previews on.

func (e *Editor) StatesTransitionTrace() []string

StatesTransitionTrace returns a copy of the state sequence observed since the preview started or reset.

func (e *Editor) StepAskInPlaceSuggestion(delta int)

StepAskInPlaceSuggestion moves the highlighted contextual suggestion by delta (+1 for Down, -1 for Up), keeping -1 ("free typing") in the cycle so arrows never trap or block typing.

func (e *Editor) StepAssetPreviewFrame(delta int)

StepAssetPreviewFrame advances or rewinds the selected asset's preview frame by delta (wrapping around).

func (e *Editor) StepAutoSave() bool

StepAutoSave advances autosave timers and applies any finished background write against the editor's clock (Editor.Now or time.Now). Primarily used by deterministic headless tests; returns true if an autosave state transition occurred.

func (e *Editor) StepAutomations() int

StepAutomations checks all enabled daily automations against the editor's clock (Editor.Now or time.Now) and starts any whose scheduled HH:MM has been reached today and has not yet run today. Returns the number of background automation tasks started.

func (e *Editor) StepClip(dt time.Duration)

StepClip advances clip playback by dt, as the loop PlayClip starts does on every fixed step. A clip that does not loop pauses at its end.

func (e *Editor) StepCodeReviewFile(delta int)

StepCodeReviewFile moves selection forward (+1) or backward (-1) across visible files in the Go review sidebar.

func (e *Editor) StepCutscene(dt time.Duration)

StepCutscene advances the cutscene timeline preview by one fixed step dt.

func (e *Editor) StepDataTableReviewCellNumber(key, col string, delta float64) error

StepDataTableReviewCellNumber increments or decrements a numeric cell by delta in place.

func (e *Editor) StepDataTableReviewFocus(delta int)

StepDataTableReviewFocus moves focus to the next (+1) or previous (-1) visible record (J / K keys).

func (e *Editor) StepGridMapFloor(delta int)

StepGridMapFloor raises or lowers the active GridMap floor height by delta.

func (e *Editor) StepGridMapOrientation(delta int) error

StepGridMapOrientation advances the active GridMap item orientation modulo 24 by delta as an undoable command.

func (e *Editor) StepMergeConflictFocus(delta int)

StepMergeConflictFocus moves focus by delta (+1 next, -1 previous), wrapping cleanly.

func (e *Editor) StepModelPreviewAnimation(dt time.Duration)

StepModelPreviewAnimation advances active model preview animation playback by dt and updates the posed scene.

func (e *Editor) StepParticlePreview(dt time.Duration)

StepParticlePreview advances the live preview emitter by dt (even while paused).

func (e *Editor) StepPlay(n int) int

StepPlay synchronously advances local Play mode by n fixed simulation steps (even while paused) and returns the number of steps actually executed.

func (e *Editor) StepReviewChange(delta int) string

StepReviewChange moves focus to the next (+1, J) or previous (-1, K) visible change card, marks it seen, and frames it in the viewport. When filtering by Unseen, stepping advances cleanly through the remaining unseen items even after the previously focused item becomes seen.

func (e *Editor) StepReviewRow(delta int) string

StepReviewRow moves keyboard row focus up (-1) or down (+1) across all visible rows (file headers, kind headers, and change cards).

func (e *Editor) StepRig(dt time.Duration)

StepRig advances the rig preview's live runtime skeletal.Skeleton by dt.

func (e *Editor) StepSceneEmitters(dt time.Duration)

StepSceneEmitters advances every placed particle emitter in the edit BuiltScene by dt so the editor viewport previews them live without entering Play mode.

func (e *Editor) StepStates(dt time.Duration)

StepStates advances the state machine preview by one fixed step dt, feeding project input actions through animclip.InputDriver when Drive with keys is active.

func (e *Editor) StepTileAnimations(dt time.Duration)

StepTileAnimations advances animated tiles in the edit viewport and the Tileset Editor's animation preview by dt.

func (e *Editor) StepUsageFocus(delta int)

StepUsageFocus moves keyboard focus forward (+1) or backward (-1) through all usages in the References screen.

func (e *Editor) Stop() error

Stop halts the running Play loop, sends any unsent Play marks as one thread, and restores the exact pre-play SceneDoc snapshot, discarding any runtime mutations made during Play mode.

func (e *Editor) StopAgent() bool

StopAgent stops the running or waiting agent request (triggered by the Stop button or Mod+. from anywhere, including inside modal dialogs). Completed steps and edits stay pending for review, and the "Agent stopped" toast offers Review. Esc never calls StopAgent.

func (e *Editor) StopAgentPlan() (AgentPlanDecision, error)

StopAgentPlan stops the active draft or running plan. When stopped before step 1 writes anything, NothingWritten remains true, every file stays unchanged, and Edit plan / Run again are offered.

func (e *Editor) StopAgentRun()

StopAgentRun cancels the currently running agent request or active running plan, keeping completed steps visible, recording done and not-done steps for Resume, and leaving changes unkept until reviewed.

func (e *Editor) StopAgentTurn() error

StopAgentTurn stops a working agent turn (⌘. or Stop button). Any edits made so far remain live in memory and pending as AgentTurnStopped so they can still be reviewed, kept, or reverted.

func (e *Editor) StopAndroidDeviceRun()

StopAndroidDeviceRun cancels any in-flight Android USB install/run command.

func (e *Editor) StopAssetAudioPreview()

StopAssetAudioPreview stops any active right-panel sound preview.

func (e *Editor) StopAudition()

StopAudition stops any active audio bus audition playback.

func (e *Editor) StopChangedAudio()

StopChangedAudio stops any audio asset audition playing from the Changes panel.

func (e *Editor) StopFirstRunDeleteFolder() error

StopFirstRunDeleteFolder stops building and removes ONLY the brand-new folder created by this flow after Approve. It refuses to delete any folder that was not created by this flow, and never deletes sibling or parent directories.

func (e *Editor) StopFirstRunKeepFiles()

StopFirstRunKeepFiles stops building while preserving all files created so far on disk, offering "Review them" to inspect what was built.

func (e *Editor) StopGame() error

StopGame stops the running game child process and every process it started, waiting until the process exits and all streamed output has been flushed. It is safe to call when no game is running.

func (e *Editor) StopGeneratedSoundCandidate()

StopGeneratedSoundCandidate stops any currently auditioning generated sound candidate.

func (e *Editor) StopModelPreviewAnimation()

StopModelPreviewAnimation halts model preview animation playback, resets the playhead to 0, and restores the model's bind pose.

func (e *Editor) StopReleaseBuild()

StopReleaseBuild cancels an in-flight release build while keeping every completed step intact so ResumeReleaseBuild can continue from the interrupted step.

func (e *Editor) StopRig()

StopRig stops rig playback and rewinds the playhead to 0.

func (e *Editor) StopRunningTasks()

StopRunningTasks stops every currently running background task without disturbing reviewable turns.

func (e *Editor) StopStuckAgentTurn(turnID string)

StopStuckAgentTurn stops a paused Stuck turn cleanly without modifying any file.

func (e *Editor) StopTask(id string) error

StopTask cancels a running, waiting, or queued task, releases any object holds, and advances the queue.

func (e *Editor) StopWebBuildServer() error

StopWebBuildServer closes the LAN web build HTTP listener and all active connections, immediately freeing the TCP port before returning.

func (e *Editor) StoreAgentAPIKey(account, apiKey string) error

StoreAgentAPIKey saves the built-in model API key exclusively in NSGo's core.Secrets / system keychain (never in editor.yaml or any project file). Refused when invoked by an agent.

func (e *Editor) StorePublishCredential(dest PublishDestination, account, secret string) error

StorePublishCredential stores a store upload token/key in the system keychain (never in project files).

func (e *Editor) StripModels() []ModelEntry

StripModels returns the models offered in the 3D viewport's bottom MODELS strip: the open project's models first (in ProjectModels order, with model target outputs marked Output), followed by the built-in primitives in sceneformat.MeshPrimitives order.

func (e *Editor) SubmitAgentPrompt(prompt string) error

SubmitAgentPrompt submits prompt (or the current composer text when prompt is empty) to the agent routed for Scene and data edits and streams its steps into the Agent panel.

func (e *Editor) SubmitAgentTaskPrompt(task AgentTaskKind, prompt string) error

SubmitAgentTaskPrompt submits prompt for task, routing according to WHO DOES WHAT. When the weekly request limit is reached, the prompt is queued instead of executed and status shows Limit reached.

func (e *Editor) SubmitAskFrozenFrame(prompt string) (AskFrozenFrameRequest, error)

SubmitAskFrozenFrame saves the rolling replay under replays/, attaches the captured frame image and live state snapshot, switches to the Agent tab, invokes Editor.OnAskFrozenFrame if set, and keeps the game paused.

func (e *Editor) SubmitAskInPlace() (AgentTurn, error)

SubmitAskInPlace sends the active in-place composer request (or the currently arrow-highlighted suggestion), attaching selection IDs, open scene, and rendered viewport PNG context, flagging SkipPlan=true per Plan.dc.html, recording the turn in the Agent panel, and closing the in-place composer.

func (e *Editor) SubmitComposerTask() (AgentTask, error)

SubmitComposerTask submits the current composer draft using TaskComposerMode and clears the draft.

func (e *Editor) SubmitHUDPrompt(prompt string) HUDPromptRequest

SubmitHUDPrompt records a prompt from the HUD layout composer (and invokes Editor.OnHUDPrompt when set).

func (e *Editor) SubmitPermissionsDraft(req PermissionsDraftRequest) (*PermissionsDraft, error)

SubmitPermissionsDraft opens the You-only Permissions Draft card with every rule unticked by default. Submitting a draft never changes effective rules or permissions.yaml on disk.

func (e *Editor) SubmitTask(req TaskRequest) (AgentTask, error)

SubmitTask adds a new background agent request according to req.StartMode:

  • TaskStartQueue starts immediately only when no blocking turn is running, waiting on you, or unreviewed; otherwise it enters TaskQueued and starts only after the blocking task is kept or reverted.
  • TaskStartParallel starts immediately as a separate session with its own numbered overlay.
func (e *Editor) SubmitViewport3DAgentPrompt(text string) (Viewport3DAgentRequest, error)

SubmitViewport3DAgentPrompt dispatches text as a Viewport3DAgentRequest to OnAskAgent3D (falling back to OnAssetAskAgent when configured), updates the status bar, and closes the inline prompt.

func (e *Editor) Subscribe(fn func()) func()

Subscribe registers fn to run whenever editor state changes and returns an unsubscribe function.

func (e *Editor) SubscribeAgentPulse(fn func()) func()

SubscribeAgentPulse registers fn to run on viewport-only agent pulse ticks and returns an unsubscribe function.

func (e *Editor) SubscribeCanvasSize(fn func()) func()

SubscribeCanvasSize registers fn to run whenever SetCanvasSize records new viewport dimensions, returning an unsubscribe function. Unlike Subscribe, it fires without bumping Editor.Revision.

func (e *Editor) SubscribePointer(fn func()) func()

SubscribePointer registers fn to run when the viewport pointer coordinate changes and returns an unsubscribe func.

func (e *Editor) SubscribeTileAnim(fn func()) func()

SubscribeTileAnim registers fn to run on edit-mode tile animation ticks and returns an unsubscribe function.

func (e *Editor) SuggestedChip() (AgentContextChip, bool)

SuggestedChip returns a suggested chip for the currently selected object when one is selected and not yet attached, or (zero, false). Selecting an object ONLY suggests a chip; nothing joins the request unless the person explicitly adds it.

func (e *Editor) SuggestedProjectRules() []SuggestedProjectRule

SuggestedProjectRules analyzes patterns in the last 30 review outcomes and returns suggested rules for actions that the author consistently reverted and has not yet added to AGENTS.md or dismissed.

func (e *Editor) SwapShortcut(cmdID, newShortcut string) error

SwapShortcut binds cmdID to newShortcut and, if another command in the same scope already owns newShortcut, assigns cmdID's previous shortcut to that conflicting command so both remain bound. When Editor.SettingsPath is set, the updated bindings are persisted to disk.

func (e *Editor) SwitchAgentFallback(turnID string) error

SwitchAgentFallback switches a model-error turn to its fallback agent (e.g. Claude Code) and retries.

func (e *Editor) SwitchAgentTurnToAlternative(turnID string) error

SwitchAgentTurnToAlternative switches the task kind of a turn experiencing a model error to another connected agent (updating WHO DOES WHAT in EditorSettings) and immediately runs the request on that agent. Refused with ErrAgentSettingsYouOnly if invoked by an agent.

func (e *Editor) SyncReviewPersonEdits()

SyncReviewPersonEdits explicitly synchronizes the pending review turn against the editor's open scene Doc (useful after direct in-memory edits or external disk reloads).

func (e *Editor) T(key string, args ...l10n.Arg) string

T translates key in the editor's active language using the editor's localization catalog.

func (e *Editor) TabCount() int

TabCount returns the number of open scene tabs.

func (e *Editor) TabDirty(index int) bool

TabDirty reports whether the scene in tab index has unsaved edits.

func (e *Editor) Tabs() []SceneTab

Tabs returns a snapshot of all open scene tabs in display order.

func (e *Editor) TakeAllAgentMergeSuggestions() error

TakeAllAgentMergeSuggestions selects MergeChoiceAgent for every conflict item in the active session.

func (e *Editor) TakeCheckpointBeforeAutomation(title string, files ...string) (*CheckpointSummary, error)

TakeCheckpointBeforeAutomation takes a persistent checkpoint under .nsgo/checkpoints/ immediately before an automation runs. When files is empty, the open scene(s) and game.yaml are captured.

func (e *Editor) TakeCheckpointBeforeTask(title string, files ...string) (*CheckpointSummary, error)

TakeCheckpointBeforeTask takes a persistent checkpoint under .nsgo/checkpoints/ immediately before an autonomous background task starts. When files is empty, the open scene(s) and game.yaml are captured. Any active turn must be ended first.

func (e *Editor) Task(id string) (AgentTask, bool)

Task returns the task with id, if present.

func (e *Editor) TaskComposerDraft() string

TaskComposerDraft returns the current prompt draft in the Tasks panel composer.

func (e *Editor) TaskComposerHint() string

TaskComposerHint returns the contextual Queue / Run in parallel hint shown under the composer.

func (e *Editor) TaskComposerMode() TaskStartMode

TaskComposerMode returns the selected start mode (Queue or Run in parallel) in the Tasks composer.

func (e *Editor) TaskDismissSelected(id string) bool

TaskDismissSelected reports whether task id is currently checked for bulk dismissal.

func (e *Editor) TaskDockBadgeCount() int

TaskDockBadgeCount returns NeedsYou + ReadyToReview + Failed (running and queued never add to it).

func (e *Editor) TaskElapsedString(t AgentTask) string

TaskElapsedString formats a task's elapsed time (e.g. "0:38") or fixed TimeLabel (e.g. "02:00").

func (e *Editor) TaskStatusParts() []TaskStatusPart

TaskStatusParts builds the exact status bar indicator segments defined in docs/design/editor/Tasks.dc.html:

  • Idle: "No tasks"
  • Single running task (and nothing else active): "1 running · M:SS"
  • Mixed: non-zero counts in urgency order (Failed, Needs you, Running, Ready to review, Queued); zero counts drop out.
func (e *Editor) TaskSummary() TaskSummary

TaskSummary returns the live counts across the five task groups plus the DockBadge count (NeedsYou + ReadyToReview + Failed; running and queued never add to the badge) and MostUrgent state.

func (e *Editor) Tasks() []AgentTask

Tasks returns a snapshot copy of all tasks in creation/queue order.

func (e *Editor) TasksInState(state TaskState) []AgentTask

TasksInState returns all visible (non-dismissed) tasks currently in state.

func (e *Editor) TasksListExpanded() bool

TasksListExpanded reports whether the Tasks section inside the Agent panel is expanded.

func (e *Editor) TasksPanelOpen() bool

TasksPanelOpen reports whether the Agent / Background Tasks panel is currently open.

func (e *Editor) Terrain() *world3d.Heightmap

Terrain returns the open runtime *world3d.Heightmap, or nil when no terrain is open.

func (e *Editor) TerrainBrush() TerrainBrush

TerrainBrush returns the current terrain brush configuration.

func (e *Editor) TerrainDirty() bool

TerrainDirty reports whether the open terrain has unsaved sculpt, paint, or metadata edits.

func (e *Editor) TerrainDoc() *world3d.TerrainDoc

TerrainDoc returns the open *world3d.TerrainDoc, or nil when no terrain is open.

func (e *Editor) TerrainFoliageDensity(name string) *world3d.DensityMap

TerrainFoliageDensity returns the current *world3d.DensityMap for the named foliage layer, or nil.

func (e *Editor) TerrainOpen() bool

TerrainOpen reports whether a terrain is currently open for sculpting and painting.

func (e *Editor) TerrainPath() string

TerrainPath returns the OS file path of the open *.terrain.yaml, or "" when unsaved/in-memory.

func (e *Editor) TerrainSplatMaps() (splat0, splat1 *image.NRGBA)

TerrainSplatMaps returns RGBA *image.NRGBA splat map images reflecting the current painted weights.

func (e *Editor) TerrainStrokeActive() bool

TerrainStrokeActive reports whether a terrain brush stroke is currently in progress.

func (e *Editor) TerrainWeightMap(layer int) *image.Gray

TerrainWeightMap returns an 8-bit grayscale image of layer's current painted weights, or nil.

func (e *Editor) TileAnimRevision() uint64

TileAnimRevision returns a monotonically increasing counter bumped on edit-mode tile animation ticks without bumping Revision.

func (e *Editor) TileAtlasNames() []string

TileAtlasNames returns the names of atlases advertised by the editor's Resolver that contain at least one canonical positive integer tile frame ("1", "2", ...), in sorted order.

func (e *Editor) TileClipboard() (TileStamp, bool)

TileClipboard returns a copy of the tile region clipboard (set by CopyTileRegion or CutTileRegion), and whether it is non-empty.

func (e *Editor) TilePalette() TilePalette

TilePalette returns the palette of the active layer: the frames of its inline tilemap's tileset atlas whose names are tile IDs, or for a layered grid the tiles of its YAML tileset (up to the first 16384), in ID order, at the tilemap's tile size. A layer with no inline tilemap (none, or an external Tiled or LDtk map, which the editor does not paint), a tileset the Resolver cannot resolve and a tileset with no tile frames give a palette with no tiles and a Message saying so. A layered grid's tileset is read through the Resolver's sceneformat.FileResolver, and its image through its sceneformat.ImageResolver when it has one.

func (e *Editor) TilePreview() []TilePreviewCell

TilePreview returns the cells currently previewed by an in-progress brush stroke before release, in deterministic row-major order.

func (e *Editor) TileReviewFocusedRegion() string

TileReviewFocusedRegion returns the ID of the currently focused tile review region, or "".

func (e *Editor) TileReviewHandleKeyEvent(ev core.KeyEvent, down bool) bool

TileReviewHandleKeyEvent handles keyboard shortcuts for an open tile review: hold B to peek Before (ignoring modifier chords and Play mode).

func (e *Editor) TileReviewKeptCount() (kept, total int)

TileReviewKeptCount returns how many regions are currently marked kept and the total number of regions.

func (e *Editor) TileReviewLayer() (layer, tileLayer string)

TileReviewLayer returns the scene layer and layered tile sub-layer currently under review.

func (e *Editor) TileReviewOpen() bool

TileReviewOpen reports whether a region-based tile edit review is currently open.

func (e *Editor) TileReviewPeekingBefore() bool

TileReviewPeekingBefore reports whether hold-B Before peek is active.

func (e *Editor) TileReviewRegions() []TileReviewRegion

TileReviewRegions returns a copy of the pending tile review regions in deterministic order.

func (e *Editor) TileReviewShowingBefore() bool

TileReviewShowingBefore reports whether the viewport is currently showing the pre-review Before state (either because Before is selected or because B is held to peek).

func (e *Editor) TileReviewSteps() []TileReviewStep

TileReviewSteps returns a copy of the agent steps recorded in the active tile review.

func (e *Editor) TileReviewTotalCells() int

TileReviewTotalCells returns the total number of changed cells across all pending review regions.

func (e *Editor) TileSelection() (TileRect, bool)

TileSelection returns the currently selected tile region on the active layer, and whether one is active.

func (e *Editor) TileStamp() (TileStamp, bool)

TileStamp returns a copy of the active stamp pattern, and whether one is set.

func (e *Editor) TileStrokeActive() (TileStrokeMode, bool)

TileStrokeActive reports whether a tile stroke is under way, and its mode.

func (e *Editor) TilesetAnimPlaying() bool

TilesetAnimPlaying reports whether the Tileset Editor's tile animation preview is currently playing.

func (e *Editor) TilesetAnimPreviewTile() int

TilesetAnimPreviewTile returns the local tile ID currently displayed by the Tileset Editor's animation preview for the selected tile.

func (e *Editor) TilesetDirty() bool

TilesetDirty reports whether the open tileset differs from what it was opened from or last saved to.

func (e *Editor) TilesetDoc() *tilemap.TilesetDoc

TilesetDoc returns a deep copy of the tileset document open in the Tileset Editor, or nil.

func (e *Editor) TilesetDraftPolygon() [][2]float32

TilesetDraftPolygon returns a copy of the polygon vertices currently being drawn over the tile canvas.

func (e *Editor) TilesetEditMask() uint8

TilesetEditMask returns the 8-bit neighbor mask currently shown in the Tileset Editor's 3x3 edge/corner editor for the selected tile.

func (e *Editor) TilesetError() error

TilesetError returns the most recent validation or save error from the Tileset Editor, or nil.

func (e *Editor) TilesetMaskConflictTile() int

TilesetMaskConflictTile returns the local tile ID that already owns TilesetEditMask in the selected terrain, or -1 when there is no conflict.

func (e *Editor) TilesetOpen() bool

TilesetOpen reports whether the Tileset Editor panel has a YAML tileset open.

func (e *Editor) TilesetPath() string

TilesetPath returns the file path or name of the open tileset, or "".

func (e *Editor) TilesetSelectedShape() int

TilesetSelectedShape returns the index of the selected collision shape on the selected tile, or -1.

func (e *Editor) TilesetSelectedTerrain() string

TilesetSelectedTerrain returns the name of the terrain set currently selected in the Tileset Editor, or "".

func (e *Editor) TilesetSelectedTile() int

TilesetSelectedTile returns the local tile ID currently selected in the Tileset Editor, or -1 when closed.

func (e *Editor) TilesetShapeTool() TilesetShapeTool

TilesetShapeTool returns the active collision shape drawing tool (rect or polygon).

func (e *Editor) TilesetTab() TilesetEditorTab

TilesetTab returns the active tab of the Tileset Editor panel.

func (e *Editor) TilesetTileInfo(tileID int) (tilemap.TileDoc, bool)

TilesetTileInfo returns a deep copy of tileID's TileDoc in the open tileset and whether the tileset has explicit data for it.

func (e *Editor) ToastMessage() string

ToastMessage returns the currently displayed viewport toast message, or "" when hidden.

func (e *Editor) ToastRemaining() time.Duration

ToastRemaining returns the active toast's remaining auto-dismiss duration, or 0 if no toast is active or the active toast stays until dismissed/retried/completed (error or progress).

func (e *Editor) ToastTimerPaused() bool

ToastTimerPaused reports whether the active toast's auto-dismiss countdown is currently paused due to pointer hover, touch, keyboard focus inside the toast, or the window going to the background/inactive state.

func (e *Editor) ToggleAgentPointing(turnID string)

ToggleAgentPointing enters or exits viewport pointing mode ("Let me point") for turnID.

func (e *Editor) ToggleAgentRequestExpanded(reqID string)

ToggleAgentRequestExpanded expands reqID if collapsed, or collapses it if already expanded.

func (e *Editor) ToggleAgentRewindPopover(turnID string) bool

ToggleAgentRewindPopover opens the rewind popover for turnID, or closes it if already open for turnID.

func (e *Editor) ToggleAgentSwitcher()

ToggleAgentSwitcher toggles the thread switcher popover.

func (e *Editor) ToggleAgentTurnChange(changeID string) error

ToggleAgentTurnChange reverts changeID if active, or restores it if reverted.

func (e *Editor) ToggleAssetAudioPreview(relPath string) error

ToggleAssetAudioPreview plays or stops the audio asset at relPath in the right-panel preview.

func (e *Editor) ToggleAssetDrawerStatusFilter(filter AssetStatusFilter)

ToggleAssetDrawerStatusFilter toggles filter on or off.

func (e *Editor) ToggleChangeIncluded(filePath string) error

ToggleChangeIncluded toggles whether the changed file at path is included in the next commit.

func (e *Editor) ToggleCommandPalette()

ToggleCommandPalette toggles the Command Palette dialog open or closed.

func (e *Editor) ToggleContextBreakdown() bool

ToggleContextBreakdown toggles the context ring breakdown popover.

func (e *Editor) ToggleCutsceneReviewChange(index int) error

ToggleCutsceneReviewChange toggles change index between kept (Revert button) and reverted (Restore button).

func (e *Editor) ToggleDataTableReviewRecord(key string) error

ToggleDataTableReviewRecord toggles record key between reverted and kept, marking the agent's checks out of date.

func (e *Editor) ToggleEditorSettings()

ToggleEditorSettings toggles the Settings view's General (editor preferences) page open or closed.

func (e *Editor) ToggleEnvironmentPanel() bool

ToggleEnvironmentPanel toggles the Scene Environment panel and reports its new open state.

func (e *Editor) ToggleExportBuildTarget(target string)

ToggleExportBuildTarget toggles target in the Export panel's chosen build target subset.

func (e *Editor) ToggleExportPresetTarget(platform, target string) error

ToggleExportPresetTarget adds or removes target on platform's export preset in canonical project.TargetsOf(platform) order through EditProject.

func (e *Editor) ToggleFirstRunReviewChange(id string) bool

ToggleFirstRunReviewChange toggles a single change entry between kept and reverted in the First Review.

func (e *Editor) ToggleFocusedReviewRevert() bool

ToggleFocusedReviewRevert implements the X shortcut in Review scope: reverts or restores the focused file group, kind group, or change card.

func (e *Editor) ToggleGizmoSpace3D() GizmoSpace3D

ToggleGizmoSpace3D switches the 3D transform gizmo between Global (world) and Local (object) axes and returns the active space.

func (e *Editor) ToggleHUDOverlay(name string)

ToggleHUDOverlay flips one overlay by name ("safe", "anchors", "touch", or "focus").

func (e *Editor) ToggleHistoryPanel()

ToggleHistoryPanel toggles the History timeline panel open or closed.

func (e *Editor) ToggleInspectorSection(sectionID string) bool

ToggleInspectorSection flips the collapsed state of the titled inspector section id and reports whether the section is now expanded.

func (e *Editor) ToggleLookThroughCamera3D() bool

ToggleLookThroughCamera3D switches between the orbit camera and the scene's active 3D camera. Returns true if looking through the scene camera afterwards.

func (e *Editor) ToggleMentionPicker()

ToggleMentionPicker toggles the @-mention picker open or closed (clicking the @ button).

func (e *Editor) ToggleObjectHidden(id string) (bool, error)

ToggleObjectHidden toggles whether object id is hidden in the 2D and 3D viewports for this session.

func (e *Editor) ToggleObjectLocked(id string) (bool, error)

ToggleObjectLocked toggles whether object id is locked against picking and manipulation in the viewports.

func (e *Editor) ToggleOverlayKind(kind OverlayKind) error

ToggleOverlayKind flips one legend kind between visible and hidden and persists to SettingsPath when set.

func (e *Editor) ToggleOverlayLegendKind(kind OverlayLegendKind) error

ToggleOverlayLegendKind flips the Spec overlay legend row kind between shown and hidden and persists the choice in the editor's settings file when SettingsPath is configured.

func (e *Editor) ToggleOverlaysPopover()

ToggleOverlaysPopover toggles the viewport Overlays popover open or closed.

func (e *Editor) TogglePanel(key string)

TogglePanel toggles panel key's visibility in the dock area.

func (e *Editor) ToggleParticleFrame(frameName string) error
func (e *Editor) TogglePermissionsDraftRule(index int)

TogglePermissionsDraftRule toggles the checkbox state of rule index in the open permissions draft (person-only).

func (e *Editor) TogglePlanGhosts()

TogglePlanGhosts flips the viewport's "Plan ghosts" toggle.

func (e *Editor) TogglePlay() error

TogglePlay starts play-in-editor if stopped, or stops it and restores the pre-play snapshot if playing.

func (e *Editor) ToggleRandomBrushTile(tileID int)

ToggleRandomBrushTile adds tileID (with weight 1) to the random brush pool if absent, or removes it if present.

func (e *Editor) ToggleReviewChangeReverted(changeID string) bool

ToggleReviewChangeReverted toggles reverted state on one change card.

func (e *Editor) ToggleReviewFileCollapsed(filePath string)

ToggleReviewFileCollapsed folds or unfolds filePath in the left list.

func (e *Editor) ToggleReviewFileReverted(filePath string) bool

ToggleReviewFileReverted reverts all revertable changes in filePath (or restores them all if already all reverted).

func (e *Editor) ToggleReviewKindCollapsed(filePath string, kind ReviewChangeKind)

ToggleReviewKindCollapsed folds or unfolds kind within filePath in the left list.

func (e *Editor) ToggleReviewKindReverted(filePath string, kind ReviewChangeKind) bool

ToggleReviewKindReverted reverts (or restores) all changes of kind within filePath.

func (e *Editor) ToggleReviewOverlayLegend(kind string)

ToggleReviewOverlayLegend toggles visibility of one overlay kind ("added", "changed", "removed", "selected") in the Review viewport legend.

func (e *Editor) ToggleReviewPeekBefore()

ToggleReviewPeekBefore flips Before-request peek mode.

func (e *Editor) ToggleSelectObject(id string) bool

ToggleSelectObject adds id to the current object selection if absent, or removes it if present.

func (e *Editor) ToggleSelection(id string) bool

ToggleSelection removes id if it is currently selected, or adds it (as primary) if it exists.

func (e *Editor) ToggleShortcutsSheet()

ToggleShortcutsSheet toggles the ⌘/ Keyboard Shortcuts reference sheet open or closed.

func (e *Editor) ToggleSketch()

ToggleSketch toggles viewport sketch drawing mode on or off.

func (e *Editor) ToggleSketchMarksHidden()

ToggleSketchMarksHidden flips whether sketch marks are temporarily hidden on the viewport.

func (e *Editor) ToggleSketchPreview()

ToggleSketchPreview toggles the "Sent with this request" preview card.

func (e *Editor) ToggleSketchReviewOverlay()

ToggleSketchReviewOverlay flips the Sketch overlay visibility during review.

func (e *Editor) ToggleTaskDismissSelection(id string)

ToggleTaskDismissSelection toggles whether a Ready to review task is checked for bulk dismissal.

func (e *Editor) ToggleTasksListExpanded()

ToggleTasksListExpanded flips the expanded state of the Tasks list inside the Agent panel.

func (e *Editor) ToggleTasksPanel()

ToggleTasksPanel toggles the Agent / Background Tasks panel open or closed.

func (e *Editor) ToggleTileReviewRegion(regionID string) error

ToggleTileReviewRegion flips whether regionID is reverted or restored in the active tile review.

func (e *Editor) ToggleTilesetEdgeOrCorner(bit uint8) error

ToggleTilesetEdgeOrCorner toggles one edge or corner bit (tilemap.MaskNorth .. MaskNorthWest) on the currently selected tile in the selected terrain, maintaining corner-gating rules. If the resulting mask is free (or already owned by the selected tile), it is committed immediately as an undoable edit. If another tile in the same terrain already owns the resulting mask, the editor keeps that other tile untouched, records the conflict (TilesetMaskConflictTile), and updates TilesetEditMask so the user can toggle additional edges/corners or call ReassignTilesetEditMask.

func (e *Editor) ToggleTilesetTileCenter() error

ToggleTilesetTileCenter toggles whether the currently selected tile belongs to the selected terrain: if it does, removes it from the terrain; if it does not, assigns it with mask 0 (or flags a conflict if another tile owns mask 0).

func (e *Editor) ToggleTilesetTileFlagBit(tileID int, bit uint) error

ToggleTilesetTileFlagBit toggles bit (2..31 for custom bits, 0 for solid, 1 for one-way) on tileID as an undoable edit.

func (e *Editor) ToggleViewportImage() bool

ToggleViewportImage flips the Viewport image chip toggle and returns the new state.

func (e *Editor) ToggleViewportOverlay(id string) error

ToggleViewportOverlay flips overlay id between on and off and persists to SettingsPath when set.

func (e *Editor) ToolEnabled(toolName string) bool

ToolEnabled reports whether the named MCP tool is enabled in Settings › Tools (You-only). Tools not explicitly disabled default to true; game_delete_file defaults to false.

func (e *Editor) TriggerAskAgentShortcut() error

TriggerAskAgentShortcut implements ⌘L for the panel composer (Spec.dc.html & Threads.dc.html):

  • When an object is selected, attaches that object as a chip, focuses the agent composer, and updates AskAgentAboutObject.
  • When nothing is selected, attaches the whole open scene as a chip and focuses the agent composer.
func (e *Editor) TriggerAssetGenerate()

TriggerAssetGenerate invokes OnAssetGenerate when configured, or reports ready status.

func (e *Editor) TriggerAssetImport()

TriggerAssetImport runs OnAssetImport when configured, or opens a native file picker when a scope is attached.

func (e *Editor) TriggerBeforeExportAutomations(platforms ...string) int

TriggerBeforeExportAutomations fires any enabled before_export automations matching platforms (or all when none specified). Returns the number of background automation tasks started.

func (e *Editor) TriggerReplaceMissingAsset(missingPath string)

TriggerReplaceMissingAsset invokes OnAssetReplaceMissing when configured, or opens a native file picker to replace missingPath.

func (e *Editor) TriggerShortcut(shortcut string) bool

TriggerShortcut finds the highest-priority enabled active command bound to shortcut and runs it. It returns true if a matching enabled command executed.

func (e *Editor) TriggerStatesAction(action string)

TriggerStatesAction pulses a one-shot action (such as "jump", "attack", "hurt") for the next fixed step.

func (e *Editor) TroubleshootAgentConnection()

TroubleshootAgentConnection reopens the Connect dialog at the step that failed rather than at the start.

func (e *Editor) TryAnotherWayAgentTurn(turnID string) error

TryAnotherWayAgentTurn asks the agent to try an alternative placement/strategy for a partial turn.

func (e *Editor) UnansweredPlanQuestions() int

UnansweredPlanQuestions returns how many clarifying questions in the active plan have no selected option yet.

func (e *Editor) Undo() bool

Undo reverts the last edit in History (or follows Checkpoints.dc.html rules during an active agent turn/review, or the last manual edit joined to an open cutscene review; no-op while playing). A step that fails to revert, such as a file move (MoveFile) that something now on disk blocks, stays in place, and the status bar says why.

func (e *Editor) UndoLastBriefPin() bool

UndoLastBriefPin undoes the Pin to brief step via Editor.Undo() only when it is still the latest command in Editor.History, never silently undoing unrelated later edits.

func (e *Editor) UndoLastSketchMark() bool

UndoLastSketchMark restores the previous sketch mark list without touching SceneDoc or Editor.History.

func (e *Editor) UndoPermissionToast() error

UndoPermissionToast reverts the last "Always" permission rule addition, restores permissions.yaml (or removes it if it did not exist before), and clears the toast.

func (e *Editor) UndoPickedCandidate(requestID, candidateID string) error

UndoPickedCandidate reverts a previously picked generated asset cleanly. When the pick is still the most recent command in History, it invokes Editor.Undo() directly; otherwise it executes a targeted undoable revert of ONLY that picked asset and its .source.yaml without touching unrelated edits on History.

func (e *Editor) UndoRevertAgentTurn() bool

UndoRevertAgentTurn brings the most recently reverted agent turn back as pending, re-applying all non-reverted changes in memory across every touched file.

func (e *Editor) UndoReviewYAMLTyping(changeID string) error

UndoReviewYAMLTyping discards the in-progress YAML typing and restores the pre-edit snapshot.

func (e *Editor) UndoSafeRename() bool

UndoSafeRename undoes the applied safe rename in one History step, restoring every moved and rewritten file on disk and in open tabs.

func (e *Editor) UngroupObject(id string) ([]string, error)

UngroupObject lifts every direct child out of object id into id's parent (or layer) while preserving each child's world transform, as one undoable step. When id is an empty group container with no connections of its own, id itself is removed; otherwise id is kept and its children are placed immediately after it. It selects and returns the lifted child IDs.

func (e *Editor) UngroupSelected() ([]string, error)

UngroupSelected ungroups the currently selected object as one undoable step.

func (e *Editor) UnifiedHistoryEntries(filter HistoryFilter) []HistoryEntry

UnifiedHistoryEntries returns the merged History panel timeline combining the active scene's session entries, persisted project checkpoints from .nsgo/checkpoints/, and Git milestones, filtered by filter and sorted newest first. Session sub-commands captured inside a persisted checkpoint are folded into that checkpoint row so turns are never duplicated.

func (e *Editor) UnsavedPromptOpen() bool

UnsavedPromptOpen reports whether the unsaved-edits confirmation dialog is open before switching projects.

func (e *Editor) UnsentPlayMarks() []PlayMark

UnsentPlayMarks returns a copy of marks that have not yet been sent to the agent.

func (e *Editor) UpdateAgentPlanStep(stepNumber int, status PlanStepStatus) error

UpdateAgentPlanStep updates stepNumber's execution status while a plan is running, advancing ActiveStep to the next pending step and syncing the turn's review checklist.

func (e *Editor) UpdateAgentRequestOutcome(threadID, requestID string, outcome AgentThreadOutcome, kept, total int, detail, reply string) error

UpdateAgentRequestOutcome updates a request's review outcome ("pending", "kept", "reverted"), change counts, detail summary, and optional agent reply, and persists the thread.

func (e *Editor) UpdateAssetDrag(canvasX, canvasY float32)

UpdateAssetDrag updates the active sprite drag preview position in viewport canvas coordinates, detecting whether the pointer is over an existing object (swap mode) or empty space (snapped placement).

func (e *Editor) UpdateCameraBoundsDrag(canvasX, canvasY float32) bool

UpdateCameraBoundsDrag updates camera.bounds live to follow the pointer at (canvasX, canvasY) during an active camera.bounds drag.

func (e *Editor) UpdateCameraDrag(canvasX, canvasY float32) bool

UpdateCameraDrag moves the scene camera live to follow the pointer at (canvasX, canvasY) during an active camera handle drag.

func (e *Editor) UpdateComponentGizmoDrag3D(sx, sy float32)

UpdateComponentGizmoDrag3D updates an active 3D component gizmo handle drag to viewport pixel (sx, sy).

func (e *Editor) UpdateConnection(index int, conn sceneformat.ConnectionDoc) error

UpdateConnection replaces Doc.Connections[index] with conn as an undoable command after validating the resulting scene with sceneformat.Validate and, when a component registry is set, sceneformat.ValidateConnections. Invalid connections are refused before reaching History, with the reason reported in Status.

func (e *Editor) UpdateDrag2D(x, y float32, keepAspect bool)

UpdateDrag2D moves the drag in progress to the canvas point (x, y) and changes the object to match, from how it was when the drag began:

  • the body and the move square move it by the distance the pointer travelled in its parent's space (its layer's space for a top-level object), which under a rotated or zoomed view or camera is the world distance, and the X and Y arrows by that distance along the object's own axis;
  • the ring turns it about its origin by the angle the pointer turned there;
  • an edge handle scales its X or Y, and a corner both, about its origin, so the point grabbed follows the pointer; keepAspect (Shift) scales both by the same factor, keeping the aspect ratio.

A scale that would be zero or close to it, or a scale or rotation that would shear a sprite in the object's tree, its ancestors taken into account (as ScaleObject and RotateObject refuse), is not taken: the object keeps its last valid transform and the status bar says why. It does nothing without a drag.

func (e *Editor) UpdateGizmoDrag3D(sx, sy float32)

UpdateGizmoDrag3D updates the selected object's (or objects') 3D transform live during an active gizmo drag.

func (e *Editor) UpdateHUDTouchDrag(canvasX, canvasY float32) bool

UpdateHUDTouchDrag previews the dragged touch control's anchor-relative offset across all four device frames.

func (e *Editor) UpdateHandleDrag3D(sx, sy float32)

UpdateHandleDrag3D updates the light or 3D camera live during an active handle drag.

func (e *Editor) UpdateImagePivotDrag(canvasX, canvasY float32)

UpdateImagePivotDrag moves the active dragged pivot marker to canvas coordinates (canvasX, canvasY) without writing the sidecar until EndImagePivotDrag.

func (e *Editor) UpdateInspectorScrub(deltaPx float64, shift bool) (float64, error)

UpdateInspectorScrub updates the active scrub from the cumulative horizontal drag distance deltaPx (in points) since BeginInspectorScrub. When shift is true, 3D view scrubs in 0.01 fine steps (for non-integer fields) while 2D view steps ×10.

func (e *Editor) UpdateMarquee2D(x, y float32, mode MarqueeMode)

UpdateMarquee2D updates the live corner and matching mode of an active 2D marquee drag.

func (e *Editor) UpdatePluginDrag2D(x, y float32)

UpdatePluginDrag2D delivers drag movement at canvas coordinates (x, y) to the active plugin tool's OnDragMove callback.

func (e *Editor) UpdatePluginDrag3D(sx, sy float32)

UpdatePluginDrag3D delivers drag movement at viewport pixel (sx, sy) to the active plugin tool's OnDragMove3D callback as a camera pick ray.

func (e *Editor) UpdateProjectAutoloadResource(index int, name, relPath string) error

UpdateProjectAutoloadResource updates the autoload resource entry at index through EditProject.

func (e *Editor) UpdateProjectAutoloadScene(index int, name, relPath string) error

UpdateProjectAutoloadScene updates the autoload scene entry at index through EditProject. When the renamed scene was autoload.mainScene, mainScene follows the new name.

func (e *Editor) UpdateRegionDrag(x, y float32)

UpdateRegionDrag updates the live preview rectangle during a region drag in virtual display coordinates (x, y).

func (e *Editor) UpdateRigDrag(x, y float32)

UpdateRigDrag updates the active rig handle drag to rig canvas point (x, y).

func (e *Editor) UpdateRoomDrag(canvasX, canvasY float32) bool

UpdateRoomDrag updates the live room move/resize or room-creation preview to follow canvas point (canvasX, canvasY), snapping room edges to the tile grid when enabled.

func (e *Editor) UpdateShapeDrag2D(x, y float32)

UpdateShapeDrag2D updates the active shape handle drag to canvas point (x, y), applying grid snapping when SnapToGrid is enabled.

func (e *Editor) UpdateSketchDrag(canvasX, canvasY float32) bool

UpdateSketchDrag extends the in-progress sketch mark to canvas point (canvasX, canvasY).

func (e *Editor) UpdateTaskStep(id string, stepIndex, stepTotal int, summary string) error

UpdateTaskStep updates the current step progress text and step numbers on task id.

func (e *Editor) UpdateTilesetTileAnimFrame(tileID, frameIndex int, frame tilemap.TileFrameDoc) error

UpdateTilesetTileAnimFrame updates animation frame frameIndex of tileID as an undoable edit.

func (e *Editor) UpdateTilesetTileShape(tileID, shapeIndex int, shape tilemap.TileShapeDoc) error

UpdateTilesetTileShape replaces collision shape shapeIndex on tileID as an undoable edit.

func (e *Editor) UpdateViewport3DDrag(sx, sy float32)

UpdateViewport3DDrag advances the active terrain brush stroke, 3D plugin tool drag, 3D handle drag, 3D component gizmo drag, 3D transform gizmo drag, or camera orbit/pan drag.

func (e *Editor) UsagesScreenOpen() bool

UsagesScreenOpen reports whether the full-window Find Usages / Safe Rename screen is open.

func (e *Editor) VaryGeneratedCandidate(ctx context.Context, requestID, candidateID string) (*AssetGenerationRequest, error)

VaryGeneratedCandidate asks the generator for new variations of candidateID while preserving the request's references and seed context. Nothing is written to disk.

func (e *Editor) View2D() View2D

View2D returns the 2D viewport's view. Until the author pans or zooms (or after ResetView2D) it is the scene camera's view: the scene's virtual screen centered on the canvas at the camera's zoom (clamped to [MinView2DZoom, MaxView2DZoom]) and rotation, following the camera as it is edited. While the scene plays it is the scene camera's view too, so Play shows the player's frame as the game does; the author's own view comes back on Stop.

func (e *Editor) View2DFollowsCamera() bool

View2DFollowsCamera reports whether the 2D view is the scene camera's view, which it is until the author pans or zooms, again after ResetView2D, and always while the scene plays.

func (e *Editor) ViewName3D() string

ViewName3D names the 3D viewport's view as its bar and the status bar show it: the active scene camera when looking through it, the axis view's name (Front, Top, ...) or Perspective, with " · ortho" in orthographic, where a view along no axis is "User · ortho".

func (e *Editor) Viewport3DAgentPromptKind() Viewport3DAgentPromptKind

Viewport3DAgentPromptKind returns the active 3D inline agent prompt kind.

func (e *Editor) Viewport3DAgentPromptObjectID() string

Viewport3DAgentPromptObjectID returns the target object ID for a component prompt, or "".

func (e *Editor) Viewport3DAgentPromptOpen() bool

Viewport3DAgentPromptOpen reports whether the 3D inline agent prompt is currently open.

func (e *Editor) Viewport3DAgentPromptPlaceholder() string

Viewport3DAgentPromptPlaceholder returns the contextual placeholder text for the open 3D inline agent prompt.

func (e *Editor) Viewport3DError() error

Viewport3DError returns why the 3D viewport cannot show the scene's geometry, or nil: the scene's 3D build failed (Scene3D), such as on a model that does not load, or the GPU view failed to draw it.

func (e *Editor) Viewport3DOnGPU() bool

Viewport3DOnGPU reports whether the 3D viewport's GPU view drew the scene's geometry the last frame, so the canvas over it draws only the overlays (DrawViewport3D). It is false on a target without GPU support, before the GPU view's first frame, after a device loss and when it cannot draw, and the canvas then draws the whole wireframe view.

func (e *Editor) ViewportImageChip() AgentContextChip

ViewportImageChip returns the chip descriptor for the Viewport image toggle.

func (e *Editor) ViewportImageIncluded() bool

ViewportImageIncluded reports whether the toggleable Viewport image chip is enabled.

func (e *Editor) ViewportLiveOverlays() []ViewportLiveOverlay

ViewportLiveOverlays returns the inspectable list of every live overlay item present in the viewport (Selection, Added, Changed, Removed, Agent working, and Problem), each carrying its visibility according to the Overlay Legend toggles.

func (e *Editor) ViewportOverlayCount(id string) int

ViewportOverlayCount returns the live item count in the current scene for overlay id, or 0 if unknown or uncounted.

func (e *Editor) ViewportOverlayEnabled(id string) bool

ViewportOverlayEnabled reports whether overlay id is currently enabled in the editor.

func (e *Editor) ViewportOverlays() []ViewportOverlay

ViewportOverlays returns all currently available viewport overlays in display order: the built-in overlays first, followed by directly registered custom overlays and overlays contributed by active plugins.

func (e *Editor) ViewportPointer2DWorld() (x, y float32, ok bool)

ViewportPointer2DWorld returns the current 2D viewport pointer coordinates in world space, or (0, 0, false) when none.

func (e *Editor) ViewportSize() (float32, float32)

ViewportSize returns the scene's virtual viewport size in points, defaulting to 640x360 when unset.

func (e *Editor) VisibleShapes2D() []DrawnShape2D

VisibleShapes2D returns the component shapes currently drawn in the 2D viewport in draw order.

func (e *Editor) VisibleTasks() []AgentTask

VisibleTasks returns all non-dismissed tasks belonging to the five active groups.

func (e *Editor) VisibleViewportLiveOverlays() []ViewportLiveOverlay

VisibleViewportLiveOverlays returns only the live viewport overlays whose legend kind is currently enabled.

func (e *Editor) WaitAndroidDeviceRun() error

WaitAndroidDeviceRun blocks until any in-flight Android USB install/run command finishes and returns its error.

func (e *Editor) WaitAssetsBuild() error

WaitAssetsBuild blocks until any in-flight BuildAssets or ReimportAsset run finishes and returns its final error.

func (e *Editor) WaitAutoSave()

WaitAutoSave blocks until any in-flight autosave disk write finishes and applies its completion on the caller's goroutine (for headless tests).

func (e *Editor) WaitAutomations(timeout time.Duration) bool

WaitAutomations blocks briefly until all active background automation runs finish (for headless tests). Returns true if all active runs completed within timeout.

func (e *Editor) WaitChangesOp()

WaitChangesOp blocks until any in-flight asynchronous Changes operation completes (primarily for tests).

func (e *Editor) WaitCodeReviewChecks()

WaitCodeReviewChecks blocks until any in-flight asynchronous code review check completes (primarily for tests).

func (e *Editor) WaitExportBuild() error

WaitExportBuild blocks until any in-flight release build finishes and returns its final error.

func (e *Editor) WaitForCreateProject()

WaitForCreateProject blocks until any active Start Screen project creation run finishes.

func (e *Editor) WaitForFirstRunBuild()

WaitForFirstRunBuild blocks until any active first-run build goroutine finishes or stops.

func (e *Editor) WaitForProblems()

WaitForProblems blocks until any pending debounced or in-flight project check (including newer checks started while waiting) finishes. It returns immediately when idle.

func (e *Editor) WaitGame() error

WaitGame blocks until the currently running game process exits and returns its exit error (nil when stopped via StopGame or when idle).

func (e *Editor) WaitModelThumbnails()

WaitModelThumbnails blocks until all model thumbnails queued so far have finished rendering offscreen.

func (e *Editor) WaitReleaseBuild() error

WaitReleaseBuild blocks until any in-flight release build finishes and returns its final error.

func (e *Editor) WaitReleaseUpload() error

WaitReleaseUpload blocks until any in-flight store upload batch finishes and returns its first error, if any.

func (e *Editor) WatchPlaytestRun(runIndex int) error

WatchPlaytestRun opens the specified 1-based run's .replay.yaml recording in Play mode using the editor's attached core.Scope. When runIndex <= 0, the active entry's default WatchRunIndex is used.

func (e *Editor) WatchPlaytestRunIn(cx *core.Scope, runIndex int) error

WatchPlaytestRunIn opens the specified 1-based run's .replay.yaml recording in Play mode on cx.

func (e *Editor) WebBridgeSessions() []WebBridgeSession

WebBridgeSessions returns all phone/browser Play-mode sessions currently connected to the LAN MCP bridge.

func (e *Editor) WebBuildServerState() WebBuildServerSnapshot

WebBuildServerState returns a thread-safe snapshot of the LAN web build server and connected phone MCP sessions.

func (e *Editor) WeeklyRequestLimit() int

WeeklyRequestLimit returns the weekly agent request limit (defaults to DefaultWeeklyRequestLimit = 300; 0 means no limit).

func (e *Editor) WindowTitle() string

WindowTitle is the title EditorView gives the window: SceneLabel, followed by "*" while HasUnsavedChanges, then the editor's name (AppName, or the localized default app name while it is empty), as in "scenes/level.scene.yaml* - NSGo Scene Editor".

func (e *Editor) WithAgentActor(fn func() error) error

WithAgentActor runs fn marked as an agent actor so strict human-only boundaries (such as confirming store uploads in Review uploads) are enforced regardless of permission profile.

func (e *Editor) WorkspaceState() WorkspaceState

WorkspaceState returns the active high-level state of the editor workspace.

func (e *Editor) WorldToCanvas(wx, wy float32) (float32, float32)

WorldToCanvas converts a world-space coordinate into a point on the viewport's canvas through the 2D view (View2D).

func (e *Editor) WorldToScreen(wx, wy float32) (float32, float32)

WorldToScreen converts a world-space coordinate into a point on the scene's virtual screen through the scene's camera, as the game draws world-space layers.

func (e *Editor) WriteAgentFile(relPath string, data []byte) error

WriteAgentFile records relPath's pre-turn bytes into the active checkpoint (if any) before writing data atomically to relPath inside the open project. Open scene tabs or game.yaml matching relPath are reloaded cleanly to stay synchronized with disk. Refuses You-only files, symlinks, paths outside the project root, and edits while playing or previewing history.

func (e *Editor) ZoomModelPreview(factor float32)

ZoomModelPreview scales the model preview camera distance by dividing by factor (>1 zooms in, <1 zooms out), clamped relative to the model's size so models of any scale stay comfortably inspectable.

func (e *Editor) ZoomRigView(factor float32)

ZoomRigView scales the rig editor canvas zoom by factor, clamped to [0.25, 16].

func (e *Editor) ZoomView2DAt(x, y, factor float32) bool

ZoomView2DAt multiplies the 2D view's zoom by factor about the canvas point (x, y), which keeps showing the same world point, as a wheel or pinch zooms about the pointer. The zoom stays within [MinView2DZoom, MaxView2DZoom]; it reports false when factor is not positive and finite, the zoom is already at the limit it moves toward or the scene plays.

func (e *Editor) ZoomView3D(factor float32)

ZoomView3D zooms the 3D viewport's camera by factor toward its Target (OrbitCamera3D.ZoomBy): above 1 zooms in, below 1 out, as a pinch does.

type EditorCommand struct {
	// ID uniquely identifies the command (for example "file.save" or "plugin.health.heal-all").
	ID string
	// Label is the display title shown in menus and the command palette.
	Label string
	// Description is optional explanatory text shown in the command palette.
	Description string
	// Category groups the command in the command palette (for example "File", "Edit", "Tools", "View", "Project").
	Category string
	// Keywords are extra search terms matched by the command palette.
	Keywords []string
	// Scope identifies the keyboard scope this command belongs to (for example ScopeGlobal, ScopeViewport, ScopeViewport2D, ScopeViewport3D, ScopeTile, ScopeSceneTree, ScopeAnimation, ScopePlay). Empty defaults to ScopeGlobal.
	Scope string
	// Shortcut is the canonical primary NSGo key shortcut (using "mod" for Command on Apple platforms and Ctrl elsewhere), or empty when unbound.
	Shortcut string
	// AlternateShortcuts are optional additional shortcuts that invoke the same command (such as "backspace" alongside "delete").
	AlternateShortcuts []string
	// Enabled reports whether the command can run right now; nil means always enabled.
	Enabled func() bool
	// Checked reports whether the command represents an active mode or open toggle; nil for non-toggle commands.
	Checked func() bool
	// Run executes the command.
	Run func() error
}

EditorCommand describes an invocable command in the editor's unified command registry, shared by keyboard shortcuts, the desktop menu bar, and the command palette.

type EditorRegion string

EditorRegion identifies a fixed-order keyboard landmark region in the editor, cycled with F6 (next) and Shift-F6 (previous) per docs/design/editor/Spec.dc.html.

const (
	// RegionNone indicates no region currently holds focus or an F6 region ring.
	RegionNone EditorRegion = ""
	// RegionHeader is the top toolbar / header region.
	RegionHeader EditorRegion = "header"
	// RegionSceneTree is the left rail region (scene tree, layers, asset and file browsers, or Assets rail).
	RegionSceneTree EditorRegion = "scene-tree"
	// RegionViewport is the central 2D/3D viewport region where focus is the selection.
	RegionViewport EditorRegion = "viewport"
	// RegionInspector is the right rail region (Agent and Inspector).
	RegionInspector EditorRegion = "inspector"
	// RegionStatusBar is the bottom status bar region.
	RegionStatusBar EditorRegion = "status-bar"
	// RegionToast is the floating toast region, participating in F6 order only while a toast is shown.
	RegionToast EditorRegion = "toast"
)
func EditorRegionOrder() []EditorRegion

EditorRegionOrder returns the fixed Spec order for F6 / Shift-F6 region cycling.

type EditorSettings struct {
	// Version is the schema version; it must equal SettingsVersion (1).
	Version int `yaml:"version" schema:"required"`
	// Language selects the editor UI language ("system", "en", or "zh").
	Language Language `yaml:"language" schema:"required,enum=system|en|zh"`
	// Appearance selects the editor color scheme ("system", "light", or "dark").
	Appearance Appearance `yaml:"appearance" schema:"required,enum=system|light|dark"`
	// AutoSave controls whether kept edits save automatically after 2 seconds.
	// When omitted, autosave is enabled by default.
	AutoSave *bool `yaml:"autoSave,omitempty"`
	// InterfaceSize scales editor text and controls together ("compact", "default", or "large").
	// When omitted, "default" is used.
	InterfaceSize InterfaceSize `yaml:"interfaceSize,omitempty" schema:"enum=compact|default|large"`
	// Snap holds per-user viewport snapping and 2D snap grid preferences (step in px, rotation step in degrees, grid overlay).
	Snap *SnapSettings `yaml:"snap,omitempty"`
	// ShowAgentChanges controls whether viewport outlines highlight agent changes while a review is open.
	// When omitted, outlines are shown by default.
	ShowAgentChanges *bool `yaml:"showAgentChanges,omitempty"`
	// Navigation3D selects the 3D viewport's mouse navigation mapping ("default", "blender", or "maya").
	// When omitted, "default" is used.
	Navigation3D Navigation3D `yaml:"navigation3D,omitempty" schema:"enum=default|blender|maya"`
	// ViewportOverlays lists the enabled 2D viewport overlay IDs in canonical sorted order.
	// When omitted, the editor uses DefaultViewportOverlays(); an empty list disables all overlays.
	ViewportOverlays *[]string `yaml:"viewportOverlays,omitempty"`
	// HiddenOverlayKinds lists Spec overlay legend kinds toggled off by the user
	// ("selection", "agent", "added", "changed", "removed", "problem") in canonical sorted order.
	HiddenOverlayKinds []string `yaml:"hiddenOverlayKinds,omitempty"`
	// OverlayLegend lists the enabled Spec viewport overlay legend kinds
	// ("selection", "agent", "added", "changed", "removed", "problem") in canonical sorted order.
	// When omitted, all six legend kinds are enabled by default; an empty list hides all six kinds.
	OverlayLegend *[]string `yaml:"overlayLegend,omitempty"`
	// Shortcuts overrides default command shortcuts keyed by command ID (for example "view.frame": "g"). An empty string explicitly unbinds a command.
	Shortcuts map[string]string `yaml:"shortcuts,omitempty"`
	// SeenTips lists the onboarding tip IDs already seen or skipped by this user in canonical sorted order.
	// Help › Replay tips clears the first-run review tip IDs so each tip shows again.
	SeenTips []string `yaml:"seenTips,omitempty"`
	// Agent stores per-computer preferences for connected models, MCP tools, external MCP servers, weekly usage limit, and outbound privacy rules. Secrets such as API keys are never stored here.
	Agent *AgentSettings `yaml:"agent,omitempty"`
}

EditorSettings holds per-user editor preferences saved outside any game project as versioned YAML. A file looks like this:

# yaml-language-server: $schema=https://game.nsgo.dev/schemas/editor-settings.v1.json
version: 1
language: system
appearance: system

ParseEditorSettings decodes it strictly and EncodeEditorSettings writes it back in canonical form, so a file EncodeEditorSettings wrote survives a load and save byte for byte.

func DefaultEditorSettings() EditorSettings

DefaultEditorSettings returns the default per-user editor settings: version 1, following the system language and appearance.

func LoadEditorSettings(path string) (*EditorSettings, error)

LoadEditorSettings reads and parses per-user editor settings from path.

func ParseEditorSettings(data []byte) (*EditorSettings, error)

ParseEditorSettings decodes and validates a versioned YAML editor settings document. Unknown fields, trailing YAML documents, YAML anchors/aliases/merge keys, missing or unsupported versions, and unknown language or appearance values are refused.

Errors are *loaderr.Error values carrying the line, column, field path and fix; a caller that read data from a file names it with loaderr.WithFile.

func (s EditorSettings) AutoSaveEnabled() bool

AutoSaveEnabled reports whether automatic saving of kept changes is enabled (true when AutoSave is nil).

func (s EditorSettings) EffectiveInterfaceSize() InterfaceSize

EffectiveInterfaceSize returns the active interface size, defaulting to InterfaceSizeDefault when unset.

func (s EditorSettings) EffectiveNavigation3D() Navigation3D

EffectiveNavigation3D returns the active 3D mouse navigation mapping, defaulting to Navigation3DDefault when unset.

func (s EditorSettings) ShowAgentChangesEnabled() bool

ShowAgentChangesEnabled reports whether agent change outlines are drawn in the viewport while a review is open (true when ShowAgentChanges is nil).

type EditorSettingsTab int

EditorSettingsTab selects which page is active in EditorSettingsDialogView.

const (
	// EditorSettingsTabGeneral shows language, appearance, saving, and interface size settings.
	EditorSettingsTabGeneral EditorSettingsTab = iota
	// EditorSettingsTabViewport shows snapping, grid, agent change outlines, 3D navigation, and overlay legend choices.
	EditorSettingsTabViewport
	// EditorSettingsTabShortcuts shows searchable, scope-aware shortcut rebinding.
	EditorSettingsTabShortcuts
	// EditorSettingsTabBrief shows the Agent › Game brief (brief.yaml) page.
	EditorSettingsTabBrief
	// EditorSettingsTabRules shows the Agent › Project rules (AGENTS.md) page.
	EditorSettingsTabRules
)
type ExportBuildOptions struct {
	// Targets restricts the build to the chosen targets; empty builds all presets in game.yaml (or game release's defaults when no presets are defined).
	Targets []string
	// Channel selects the distribution channel ("", "direct", "store", "steam", "none"). Empty uses nsgo.yaml's updates.channel.
	Channel string
	// ReleaseNotes is an optional path (project-relative or absolute) to a Markdown file passed to -release-notes.
	ReleaseNotes string
	// DryRun prints the nsgo build command without running nsgo build or writing CREDITS.md.
	DryRun bool
}

ExportBuildOptions configures one release build or dry run launched from the Export panel.

type ExportCreditsReport struct {
	// Configured reports whether game.yaml declares an assets section.
	Configured bool
	// Entries are the credited assets found.
	Entries []credits.Entry
	// Missing are the slash-separated paths of assets without a credit, sorted.
	Missing []string
	// Err is any non-missing error encountered while scanning assets or parsing sidecars.
	Err error
}

ExportCreditsReport summarizes the pre-flight credits check for the open project's assets section.

func (r ExportCreditsReport) OK() bool

OK reports whether the credits pre-flight check permits a release build.

type ExternalAgentKind string

ExternalAgentKind identifies a supported external agent CLI invoked non-interactively by the composer.

const (
	ExternalAgentAuto       ExternalAgentKind = ""
	ExternalAgentClaudeCode ExternalAgentKind = "claude"
	ExternalAgentCodex      ExternalAgentKind = "codex"
)
func DetectExternalAgentKind(clientName string) ExternalAgentKind

DetectExternalAgentKind infers which CLI to invoke from a connected MCP client name.

type FeedbackChannel string

FeedbackChannel identifies the canonical home of an editor feedback event in docs/design/editor/Spec.dc.html ("Feedback channels"). Decisions never go in a toast.

const (
	FeedbackChannelToast              FeedbackChannel = "toast"
	FeedbackChannelProgressToast      FeedbackChannel = "progress_toast"
	FeedbackChannelAgentCard          FeedbackChannel = "agent_card"
	FeedbackChannelReview             FeedbackChannel = "review"
	FeedbackChannelProblems           FeedbackChannel = "problems"
	FeedbackChannelSystemNotification FeedbackChannel = "system_notification"
)
type FeedbackChannelEntry struct {
	Event     string
	Channel   FeedbackChannel
	Action    string
	EventKind ToastEventKind
	Stays     bool
}

FeedbackChannelEntry describes one row of the Spec Feedback channels table (docs/design/editor/Spec.dc.html).

func SpecFeedbackChannels() []FeedbackChannelEntry

SpecFeedbackChannels returns the complete Spec Feedback channels table mapping each editor event to its single home.

type FirstRunAPIKeyStatus string

FirstRunAPIKeyStatus is returned by Editor.FirstRunValidateAPIKey.

const (
	FirstRunAPIKeyEmpty       FirstRunAPIKeyStatus = ""
	FirstRunAPIKeyWorks       FirstRunAPIKeyStatus = "works"
	FirstRunAPIKeyNotAccepted FirstRunAPIKeyStatus = "not_accepted"
	FirstRunAPIKeyNoNetwork   FirstRunAPIKeyStatus = "no_network"
	FirstRunAPIKeyNoQuota     FirstRunAPIKeyStatus = "no_quota"
)
type FirstRunAgentOption struct {
	// Kind is "claude", "codex", or "apikey".
	Kind string
	// Name is the display label (such as "Claude Code", "Codex", or "An API key").
	Name string
	// Description is the short subtitle shown beneath Name.
	Description string
	// Detected reports whether a local CLI agent was found on PATH (ignored for "apikey").
	Detected bool
	// ExecutablePath holds the resolved binary path when Detected is true.
	ExecutablePath string
}

FirstRunAgentOption describes one agent choice shown in Connect in place.

type FirstRunBuildEvent struct {
	StageIndex   int
	StageStatus  FirstRunBuildStageStatus
	LogTitle     string
	LogSubtitle  string
	ObjectsDone  int
	ObjectsTotal int
	PlacingLabel string
	PlacedShapes []FirstRunPreviewShape
}

FirstRunBuildEvent is emitted by FirstRunBuilder as stages and object placements advance.

type FirstRunBuildFixProposal struct {
	ProblemSummary string
	ObjectID       string
	ObjectBadge    string
	FixDescription string
	ApplyFix       func(ctx context.Context, projectDir string) error
}

FirstRunBuildFixProposal is shown when the Check stage fails before entering the first review.

type FirstRunBuildLogEntry struct {
	StageIndex int
	Status     FirstRunBuildStageStatus
	Title      string
	Subtitle   string
	DoneCount  int
	TotalCount int
}

FirstRunBuildLogEntry is one item in the Building agent panel log.

type FirstRunBuildOutcome string

FirstRunBuildOutcome identifies the current mode of the Building stage.

const (
	FirstRunBuildRunning        FirstRunBuildOutcome = "running"
	FirstRunBuildCancelPrompt   FirstRunBuildOutcome = "cancel_prompt"
	FirstRunBuildCheckFailed    FirstRunBuildOutcome = "check_failed"
	FirstRunBuildStoppedKept    FirstRunBuildOutcome = "stopped_kept"
	FirstRunBuildStoppedDeleted FirstRunBuildOutcome = "stopped_deleted"
)
type FirstRunBuildRequest struct {
	Plan         FirstRunPlan
	ProjectDir   string
	Answer       string
	WaitIfPaused func(context.Context) error
}

FirstRunBuildRequest is passed to Editor.FirstRunBuilder after the target project folder is created.

type FirstRunBuildResult struct {
	SceneRelPath   string
	PlanStepsDone  int
	PlanStepsTotal int
	Deviations     []FirstRunPlanDeviation
	Changes        []FirstRunReviewChange
	Shapes         []FirstRunPreviewShape
	CheckFailure   *FirstRunBuildFixProposal
}

FirstRunBuildResult is returned by Editor.FirstRunBuilder when building finishes or pauses on a check failure.

type FirstRunBuildSnapshot struct {
	ProjectName       string
	SceneName         string
	DisplayPath       string
	Outcome           FirstRunBuildOutcome
	Stages            [5]FirstRunBuildStageStatus
	Log               []FirstRunBuildLogEntry
	ObjectsDone       int
	ObjectsTotal      int
	PlacingLabel      string
	Shapes            []FirstRunPreviewShape
	Elapsed           time.Duration
	CreatedByFlow     bool
	CanDeleteFolder   bool
	CreatedAgeSeconds int
	CheckFailure      *FirstRunBuildFixProposal
	StatusPill        string
}

FirstRunBuildSnapshot is a read-only copy of the active Building screen state.

type FirstRunBuildStageStatus string

FirstRunBuildStageStatus describes the status of one stage in the 5-stage progress bar.

const (
	FirstRunBuildStageTodo   FirstRunBuildStageStatus = "todo"
	FirstRunBuildStageActive FirstRunBuildStageStatus = "active"
	FirstRunBuildStageDone   FirstRunBuildStageStatus = "done"
	FirstRunBuildStageFail   FirstRunBuildStageStatus = "fail"
)
type FirstRunConnectStatus string

FirstRunConnectStatus describes the current state of the Connect in place card.

const (
	FirstRunConnectIdle         FirstRunConnectStatus = "idle"
	FirstRunConnectConnecting   FirstRunConnectStatus = "connecting"
	FirstRunConnectConnected    FirstRunConnectStatus = "connected"
	FirstRunConnectTimeout      FirstRunConnectStatus = "timeout"
	FirstRunConnectKeyIdle      FirstRunConnectStatus = "key_idle"
	FirstRunConnectKeyValid     FirstRunConnectStatus = "key_valid"
	FirstRunConnectKeyInvalid   FirstRunConnectStatus = "key_invalid"
	FirstRunConnectKeyNoNetwork FirstRunConnectStatus = "key_no_network"
	FirstRunConnectKeyNoQuota   FirstRunConnectStatus = "key_no_quota"
)
type FirstRunConnectStep struct {
	Text    string
	Done    bool
	Waiting bool
	Strong  bool
}

FirstRunConnectStep is one checklist row inside the Connect in place card.

type FirstRunGhost struct {
	ID    string
	Step  int
	Label string
	Kind  string // "room", "floor", "slime", "coin", "lever", "door"
	X, Y  float32
	W, H  float32
}

FirstRunGhost marks a planned addition on the read-only template preview viewport.

type FirstRunPlan struct {
	ProjectName      string
	TargetDir        string
	DisplayPath      string
	Module           string
	Idea             string
	Template         string
	TemplateTitle    string
	SceneName        string
	EstimatedFiles   int
	EstimatedObjects int
	EstimatedMinutes int
	Question         *FirstRunPlanQuestion
	SelectedAnswer   string
	Steps            []FirstRunPlanStep
	TemplateShapes   []FirstRunPreviewShape
	Ghosts           []FirstRunGhost
	Approved         bool
}

FirstRunPlan is the agent's proposed plan shown before Approve creates the project folder.

func DefaultFirstRunPlan(req FirstRunPlanRequest) *FirstRunPlan

DefaultFirstRunPlan picks the closest template for req.Idea and returns a deterministic, reviewable first plan matching docs/design/editor/FirstRun.dc.html.

type FirstRunPlanDeviation struct {
	Summary string
}

FirstRunPlanDeviation describes an intentional difference between the approved plan and the built result, displayed in amber on top of the first review.

type FirstRunPlanOption struct {
	ID        string
	Label     string
	Note      string
	Suggested bool
	Verb      string
}

FirstRunPlanOption is one answer card for a clarifying question in the first plan.

type FirstRunPlanQuestion struct {
	Prompt  string
	Options []FirstRunPlanOption
}

FirstRunPlanQuestion is an optional clarifying question asked in the first plan before building.

type FirstRunPlanRequest struct {
	Idea        string
	ProjectName string
	ParentDir   string
	TargetDir   string
	DisplayPath string
	Module      string
	Templates   []ProjectTemplate
	Selected    string
}

FirstRunPlanRequest carries the Start Screen's idea, validated project name, and available templates to Editor.FirstRunPlanner before any project folder is created.

type FirstRunPlanStep struct {
	Number     int
	Title      string
	FilesLabel string
	Permission string
}

FirstRunPlanStep is one numbered step in the first plan card.

type FirstRunPreviewShape struct {
	ID       string
	ChangeID string
	Kind     string // "room", "floor", "platform", "divider", "knight", "slime", "coin", "lever", "door"
	X, Y     float32
	W, H     float32
	Outline  string // "", "added", "agent", "problem", "planned"
	Badge    string
}

FirstRunPreviewShape is a schematic 2D preview box rendered in the read-only template preview, live building viewport, or first-review viewport.

type FirstRunReviewChange struct {
	ID        string
	Sign      string // "+"
	Title     string
	Detail    string
	ObjectIDs []string
	Reverted  bool
}

FirstRunReviewChange is one grouped change entry in the first review's left list.

type FirstRunReviewSnapshot struct {
	ProjectName    string
	ProjectDir     string
	SceneRelPath   string
	PlanStepsDone  int
	PlanStepsTotal int
	Deviations     []FirstRunPlanDeviation
	Changes        []FirstRunReviewChange
	Shapes         []FirstRunPreviewShape
	BeforeMode     bool
	PeekBefore     bool
	ShowingBefore  bool
	KeptCount      int
	TotalCount     int
	ActiveTipIndex int
	ActiveTipID    string
}

FirstRunReviewSnapshot is a read-only copy of the active First Review screen state.

type FirstRunStage int

FirstRunStage identifies the active stage of the Start with AI first-run journey (docs/design/editor/FirstRun.dc.html).

const (
	// FirstRunStageNone means no first-run flow step is active (normal Start Screen or working editor).
	FirstRunStageNone FirstRunStage = iota
	// FirstRunStageConnect shows Connect an agent in place on the Start Screen while preserving idea and name.
	FirstRunStageConnect
	// FirstRunStagePlan shows the read-only template preview with planned ghosts and the agent's first plan before any folder is created.
	FirstRunStagePlan
	// FirstRunStageBuilding shows the working layout with the 5-stage bar, live object counts, Esc/Cancel confirmation, and check-failure fix proposal.
	FirstRunStageBuilding
	// FirstRunStageReview shows the first review with the plan summary, amber deviations, Before/After peek, per-change toggles, and one-time onboarding tips.
	FirstRunStageReview
)
func (s FirstRunStage) String() string

String returns a human-readable stage name.

type GameProcess interface {
	// Wait blocks until the process exits and returns its exit error, if any.
	Wait() error
	// Stop terminates the process and every child process it started.
	Stop() error
}

GameProcess represents a running child game process owned by the editor.

type GenerateAssetParams struct {
	// TargetPath is the project-relative slash path where the asset will be written once picked (for example "art/characters/slime_frost.png").
	TargetPath string
	// Generator names the connected MCP generator server to invoke; empty picks the first connected server matching Kind.
	Generator string
	// Kind selects images or sound; empty is inferred from TargetPath's extension or Generator's kind.
	Kind AssetGeneratorKind
	// Model optionally requests a specific generator model.
	Model string
	// Prompt is the generation prompt sent to the MCP server.
	Prompt string
	// UserPrompt is an optional human-facing summary quote shown in the request header (defaults to Prompt).
	UserPrompt string
	// References lists project-relative asset or brief references sent to the generator (for example "art/characters/slime.png", "brief.yaml#art").
	References []string
	// Count is the number of candidates to request (defaults to 4 for images and 3 for sounds).
	Count int
	// BaseSeed optionally suggests a starting seed.
	BaseSeed *int64
	// VaryFromSeed optionally requests variations anchored on an earlier candidate's seed.
	VaryFromSeed *int64
	// Refine optionally adds refinement words while keeping the same references.
	Refine string
}

GenerateAssetParams configures an MCP asset generation call.

type GeneratedCandidate struct {
	ID                    string
	Seed                  *int64
	MimeType              string
	CleanBytes            []byte
	Width                 int
	Height                int
	Pixels                *image.RGBA
	Image                 core.ImageSource
	ColorCount            int
	HasAntiAliasing       bool
	ContrastRatio         float64
	Duration              time.Duration
	SampleRate            int
	Channels              int
	LoudnessDBFS          float64
	PeakDBFS              float64
	AudioLoudnessMeasured bool
	Waveform              []float32
	AudioCheckPass        bool
	AudioCheckText        string
	Checks                []AssetStyleCheck
	License               string
	CommercialUse         bool
}

GeneratedCandidate holds one untrusted candidate decoded strictly in memory (never written to disk before Pick).

type GeneratorServerConfig struct {
	// Name uniquely identifies the generator server (for example "pixel-gen" or "sfx-gen").
	Name string `yaml:"name" schema:"required,minLength=1"`
	// Kind declares what kind of assets the generator produces ("images" or "sound").
	Kind AssetGeneratorKind `yaml:"kind" schema:"required,enum=images|sound"`
	// Command is the executable launched over stdio MCP transport when connecting from Settings > Tools.
	Command string `yaml:"command,omitempty"`
	// Args are command-line arguments passed to Command.
	Args []string `yaml:"args,omitempty"`
	// Tool optionally names the specific MCP tool to invoke; empty selects the first matching generate tool advertised by the server.
	Tool string `yaml:"tool,omitempty"`
}

GeneratorServerConfig describes one MCP generator server configured under Settings > Tools.

type GizmoAxis3D int

GizmoAxis3D identifies an axis, plane, or center handle on a 3D transform gizmo.

const (
	Axis3DNone GizmoAxis3D = iota
	Axis3DX
	Axis3DY
	Axis3DZ
	Axis3DXY
	Axis3DXZ
	Axis3DYZ
	Axis3DAll
)
func (a GizmoAxis3D) String() string

String returns a human-readable label for the gizmo axis.

type GizmoDrag3D struct {
	// ObjectID is the ID of the object carrying Component.
	ObjectID string
	// Component is the component type name being edited.
	Component string
	// Handle is the picked handle in object space as it was when the drag began.
	Handle GizmoHandle3D
	// StartRay and Ray are the camera pick rays in world space at drag start and the current pointer position.
	StartRay math3d.Ray
	Ray      math3d.Ray
	// StartLocalRay and LocalRay are StartRay and Ray transformed into the object's local space.
	StartLocalRay math3d.Ray
	LocalRay      math3d.Ray
	// ObjectToWorld and WorldToObject transform between object space and world space at drag start.
	ObjectToWorld math3d.Mat4
	WorldToObject math3d.Mat4
	// StartPoint is the handle's object-space reference point at drag start (Position for point/box, midpoint for line).
	StartPoint math3d.Vec3
	// ScreenStart and ScreenCurrent are the viewport pixel coordinates at drag start and now.
	ScreenStart   [2]float32
	ScreenCurrent [2]float32
	// ViewportWidth and ViewportHeight are the 3D viewport's size in points.
	ViewportWidth  float32
	ViewportHeight float32
	// Camera is the editor's 3D camera for the drag.
	Camera OrbitCamera3D
	// contains filtered or unexported fields
}

GizmoDrag3D describes an in-progress drag of a 3D component gizmo handle.

func (d GizmoDrag3D) AxisDelta(axis math3d.Vec3) (float32, bool)

AxisDelta computes the signed displacement along object-space axis from the drag start to the current pointer ray, falling back to screen-space projection when the axis is nearly parallel to the view ray.

func (d GizmoDrag3D) PlaneDelta(planeNormal math3d.Vec3) (math3d.Vec3, bool)

PlaneDelta returns the object-space displacement between StartLocalRay and LocalRay intersected with the plane passing through StartPoint with planeNormal.

func (d GizmoDrag3D) PlanePoint(planePoint, planeNormal math3d.Vec3) (math3d.Vec3, bool)

PlanePoint intersects LocalRay with the object-space plane passing through planePoint with planeNormal.

func (d GizmoDrag3D) ViewPlaneDelta() (math3d.Vec3, bool)

ViewPlaneDelta returns the object-space displacement across the camera-facing plane passing through StartPoint.

type GizmoHandle2D int

GizmoHandle2D names a part of the 2D transform gizmo drawn on the selected object, or the object itself, that a drag in the 2D viewport takes.

const (
	// Handle2DNone is no handle: a drag that starts away from the gizmo and every object.
	Handle2DNone GizmoHandle2D = iota
	// Handle2DBody is the object itself: a drag moves it freely, keeping the offset from where it was grabbed.
	Handle2DBody
	// Handle2DMove is the square at the object's origin: a drag moves it freely.
	Handle2DMove
	// Handle2DMoveX is the arrow along the object's own X axis: a drag moves it along that axis only.
	Handle2DMoveX
	// Handle2DMoveY is the arrow along the object's own Y axis: a drag moves it along that axis only.
	Handle2DMoveY
	// Handle2DRotate is the ring around the object: a drag turns it about its origin.
	Handle2DRotate
	// Handle2DScaleN is the middle of the outline's top edge, its local -Y side: a drag scales the object's Y about its origin.
	Handle2DScaleN
	// Handle2DScaleE is the middle of the outline's right edge, its local +X side: a drag scales the object's X about its origin.
	Handle2DScaleE
	// Handle2DScaleS is the middle of the outline's bottom edge, its local +Y side: a drag scales the object's Y about its origin.
	Handle2DScaleS
	// Handle2DScaleW is the middle of the outline's left edge, its local -X side: a drag scales the object's X about its origin.
	Handle2DScaleW
	// Handle2DScaleNE is the outline's top right corner: a drag scales the object's X and Y about its origin.
	Handle2DScaleNE
	// Handle2DScaleSE is the outline's bottom right corner: a drag scales the object's X and Y about its origin.
	Handle2DScaleSE
	// Handle2DScaleSW is the outline's bottom left corner: a drag scales the object's X and Y about its origin.
	Handle2DScaleSW
	// Handle2DScaleNW is the outline's top left corner: a drag scales the object's X and Y about its origin.
	Handle2DScaleNW
	// Handle2DLightRadius is the radius handle on a selected object with a light2d component: a drag adjusts light2d.radius.
	Handle2DLightRadius
	// Handle2DLightSpotAngle is either cone-edge handle on a selected spotlight (light2d kind "spot"): a drag adjusts light2d.angle.
	Handle2DLightSpotAngle
	// Handle2DLightSpotDirection is the aim handle along a selected spotlight's center ray: a drag adjusts light2d.direction.
	Handle2DLightSpotDirection
	// Handle2DOccluderVertex is a vertex handle on a selected polygon occluder2d: a drag moves that vertex in local space.
	Handle2DOccluderVertex
	// Handle2DOccluderEdgeMid is an edge-midpoint handle on a selected polygon occluder2d: a drag inserts a new vertex on that edge and moves it.
	Handle2DOccluderEdgeMid
	// Handle2DOccluderRectN is the top edge handle on a selected rect occluder2d: a drag resizes occluder2d.height.
	Handle2DOccluderRectN
	// Handle2DOccluderRectE is the right edge handle on a selected rect occluder2d: a drag resizes occluder2d.width.
	Handle2DOccluderRectE
	// Handle2DOccluderRectS is the bottom edge handle on a selected rect occluder2d: a drag resizes occluder2d.height.
	Handle2DOccluderRectS
	// Handle2DOccluderRectW is the left edge handle on a selected rect occluder2d: a drag resizes occluder2d.width.
	Handle2DOccluderRectW
	// Handle2DNavRegionVertex is a vertex handle on a selected navregion2d polygon: a drag moves that vertex in local space.
	Handle2DNavRegionVertex
	// Handle2DNavRegionEdgeMid is an edge-midpoint handle on a selected navregion2d polygon: a drag inserts a new vertex on that edge and moves it.
	Handle2DNavRegionEdgeMid
)
func (h GizmoHandle2D) IsComponentHandle() bool

IsComponentHandle reports whether h edits a component (light2d, occluder2d, or navregion2d) rather than the object's 2D transform.

func (h GizmoHandle2D) IsLight() bool

IsLight reports whether h is one of the 2D light radius, spot-angle, or direction handles.

func (h GizmoHandle2D) IsNavRegion() bool

IsNavRegion reports whether h is one of the 2D navigation region polygon vertex or edge-midpoint handles.

func (h GizmoHandle2D) IsOccluder() bool

IsOccluder reports whether h is one of the 2D occluder polygon or rect shape handles.

func (h GizmoHandle2D) IsScale() bool

IsScale reports whether h is one of the corner or edge scale handles.

func (h GizmoHandle2D) String() string

String returns a human-readable label for the handle.

type GizmoHandle3D struct {
	// ID identifies the handle within its ComponentGizmo3D and is passed to ComponentGizmo3D.Drag.
	// A handle with an empty ID or DisplayOnly=true is drawn as visual feedback and is not pickable.
	ID string
	// Kind selects whether the handle is a point, line segment, or wireframe box.
	Kind GizmoHandleKind3D
	// Position is the object-space location of a GizmoHandlePoint3D or center of a GizmoHandleBox3D.
	Position math3d.Vec3
	// Start and End are the object-space endpoints of a GizmoHandleLine3D.
	Start math3d.Vec3
	End   math3d.Vec3
	// Size holds the object-space full extents (width, height, depth) of a GizmoHandleBox3D.
	Size math3d.Vec3
	// Color is the handle's stroke/fill color; zero uses the editor's default accent color.
	Color core.Color
	// Radius is the screen-space marker radius in points for GizmoHandlePoint3D (defaults to 5 when <= 0).
	Radius float32
	// LineWidth is the stroke width in points for GizmoHandleLine3D and GizmoHandleBox3D (defaults to 1.75 when <= 0).
	LineWidth float32
	// DisplayOnly marks a visual-only primitive that draws over the 3D view without intercepting drags.
	DisplayOnly bool
	// Axis optionally records the handle's primary object-space direction for drag helpers (for example math3d.Vec3{X: 1}).
	Axis math3d.Vec3
	// Label is an optional short label drawn beside the handle while active.
	Label string
}

GizmoHandle3D describes one visual or interactive 3D gizmo handle in object space.

type GizmoHandleKind3D int

GizmoHandleKind3D identifies the object-space geometry of a 3D gizmo handle.

const (
	// GizmoHandlePoint3D is a point handle at Position in object space.
	GizmoHandlePoint3D GizmoHandleKind3D = iota
	// GizmoHandleLine3D is a line segment handle from Start to End in object space.
	GizmoHandleLine3D
	// GizmoHandleBox3D is a wireframe box handle centered at Position with full extents Size in object space.
	GizmoHandleBox3D
)
func (k GizmoHandleKind3D) String() string

String returns a human-readable name for k.

type GizmoMode3D int

GizmoMode3D selects the active 3D transform gizmo operation.

const (
	Gizmo3DTranslate GizmoMode3D = iota
	Gizmo3DRotate
	Gizmo3DScale
	// Gizmo3DCollider shows draggable size handles on the selected object's 3D collider or trigger.
	Gizmo3DCollider
)
func (m GizmoMode3D) String() string

String returns a human-readable label for the 3D gizmo mode.

type GizmoSpace3D int

GizmoSpace3D selects whether the 3D transform gizmo aligns with world axes (Global) or the selected object's world orientation (Local).

const (
	// GizmoSpaceGlobal aligns 3D transform gizmo axes with world X, Y, Z.
	GizmoSpaceGlobal GizmoSpace3D = iota
	// GizmoSpaceLocal aligns 3D transform gizmo axes with the selected object's orientation.
	GizmoSpaceLocal
)
func (s GizmoSpace3D) String() string

String returns "Global" or "Local".

type GridMapPalette struct {
	// Path is the open GridMap's path (or name).
	Path string
	// MeshLibrary is the glTF mesh library path referenced by the GridMap.
	MeshLibrary string
	// Floor is the active integer floor height (Y coordinate).
	Floor int
	// Orientation is the active orientation index in 0..23.
	Orientation uint8
	// Items are the mesh library's items in ascending ID order.
	Items []GridMapPaletteItem
	// Message explains why Items is empty, or is empty when Items is non-empty.
	Message string
}

GridMapPalette is what the 3D GridMap palette shows for the active GridMap: every item in its mesh library with bounds/geometry for its thumbnail, plus the current floor height and orientation, or a Message explaining why none are available.

func (p GridMapPalette) Has(id uint16) bool

Has reports whether p contains an item with the given tile ID.

type GridMapPaletteItem struct {
	// ID is the MeshLibrary tile ID written into GridMap cells.
	ID uint16
	// Name is the tile's name in the MeshLibrary and YAML file.
	Name string
	// MeshID is the glTF mesh index in the mesh library.
	MeshID uint32
	// LocalBounds is the tile's local axis-aligned bounding box.
	LocalBounds math3d.AABB
	// Thumbnail holds pre-extracted isometric 3D triangles for rendering the item's thumbnail.
	Thumbnail []gridMapThumbTri
}

GridMapPaletteItem is one selectable mesh tile in a GridMapPalette.

type GridMapTool int

GridMapTool selects the active 3D GridMap editing tool in the 3D viewport.

const (
	// GridMapToolNone leaves the 3D viewport in normal object selection and transform gizmo mode.
	GridMapToolNone GridMapTool = iota
	// GridMapToolPaint paints the active mesh library item at the active orientation onto cells on the current floor height.
	GridMapToolPaint
	// GridMapToolErase clears cells on the current floor height.
	GridMapToolErase
	// GridMapToolPick picks the tile item and orientation from the cell under the pointer and switches to Paint.
	GridMapToolPick
	// GridMapToolBoxFill drags a box on the current floor height and fills it with the active item and orientation.
	GridMapToolBoxFill
)
func (t GridMapTool) String() string

String returns a human-readable label for the GridMap tool.

type HUDFrameLayout struct {
	Device gameui.DeviceProfile
	Label  string
	Scale  float32
	X, Y   float32
	W, H   float32
	Bezel  float32
	Built  *gameui.BuiltScreen
}

HUDFrameLayout describes one of the four simultaneous reference device previews on the multi-size canvas.

type HUDOverlays struct {
	SafeAreas  bool
	Anchors    bool
	TouchAreas bool
	FocusOrder bool
}

HUDOverlays controls the four diagnostic overlays shown on the HUD layout multi-size canvas.

func DefaultHUDOverlays() HUDOverlays

DefaultHUDOverlays returns the default overlay set with all four overlays enabled, matching docs/design/editor/HUDLayout.dc.html.

type HUDProblem struct {
	Code   gameui.ScreenIssueCode
	NodeID string
	Title  string
	Detail string
	Locale string
	OverPx float32
	Issue  gameui.ScreenIssue
}

HUDProblem is one diagnostic listed under GAME CHECK for the active screen and language.

type HUDPromptRequest struct {
	Prompt     string
	ScreenPath string
	ScreenName string
	SelectedID string
	Locale     string
	Problems   []HUDProblem
}

HUDPromptRequest captures an agent prompt submitted from the HUD layout composer or "Ask the agent to fix N" button.

type HUDScreenEntry struct {
	// Path is the screen's slash-separated path from the project root (or file path for standalone screens).
	Path string
	// Name is the human-readable screen name (typically the file stem without .screen.yaml).
	Name string
	// NodeCount is the total number of UI nodes in the screen tree.
	NodeCount int
	// ProblemCount is the number of GAME CHECK problems for this screen in the active language.
	ProblemCount int
	// LoadErr holds any parse or validation error encountered when reading this screen file.
	LoadErr error
}

HUDScreenEntry summarizes one *.screen.yaml file listed in the left rail's SCREENS section.

type HUDTextWidthRow struct {
	NodeID   string
	TextKey  string
	BoxLabel string
	FitsText bool
	BoxWidth float32
	Widths   map[string]float32
	Overflow map[string]float32
}

HUDTextWidthRow is one row of the TEXT WIDTH, PX table comparing a text node's box against its width in every project locale.

type HUDTreeRow struct {
	// ID is the ScreenNodeDoc.ID, or "" for the synthetic root screen row.
	ID string
	// Name is the displayed label (node ID, or screen name on the root row).
	Name string
	// Type is the ScreenNodeDoc.Type (empty on the synthetic root row).
	Type gameui.ScreenNodeType
	// Depth is 0 for the root row and 1+ for nodes in the screen tree.
	Depth int
	// AnchorTag is the short monospace tag shown on the right ("screen", "TL", "TC", "TR", "CL", "C", "CR", "BL", "BC", "BR", "FILL", or "").
	AnchorTag string
	// HasProblem reports whether GAME CHECK found a problem on this node in the active language.
	HasProblem bool
	// ParentID is the containing node's ID, or "" for top-level screen nodes.
	ParentID string
	// Index is the node's position inside its parent's children slice (or doc.Nodes).
	Index int
	// SiblingLen is the total number of siblings in the parent container.
	SiblingLen int
}

HUDTreeRow is one flattened row of the active screen's NODES tree in the left rail.

type Handle3DKind int

Handle3DKind identifies an interactive 3D viewport handle for editing a selected light or 3D camera.

const (
	Handle3DNone Handle3DKind = iota
	// Handle3DLightDirection aims a directional or spot light along the dragged direction.
	Handle3DLightDirection
	// Handle3DLightRange edits a point or spot light's range radius/distance.
	Handle3DLightRange
	// Handle3DLightOuterCone edits a spot light's outer cone half-angle (degrees).
	Handle3DLightOuterCone
	// Handle3DLightInnerCone edits a spot light's inner cone half-angle (degrees).
	Handle3DLightInnerCone
	// Handle3DCameraFOV edits a 3D camera's vertical FOV (perspective, degrees) or OrthoHeight (orthographic).
	Handle3DCameraFOV
	// Handle3DCameraFar edits a 3D camera's far clip plane distance.
	Handle3DCameraFar
	// Handle3DProbeBoundsPosX edits the +X face of a selected reflection probe or light probe grid's bounds box.
	Handle3DProbeBoundsPosX
	// Handle3DProbeBoundsNegX edits the -X face of a selected reflection probe or light probe grid's bounds box.
	Handle3DProbeBoundsNegX
	// Handle3DProbeBoundsPosY edits the +Y face of a selected reflection probe or light probe grid's bounds box.
	Handle3DProbeBoundsPosY
	// Handle3DProbeBoundsNegY edits the -Y face of a selected reflection probe or light probe grid's bounds box.
	Handle3DProbeBoundsNegY
	// Handle3DProbeBoundsPosZ edits the +Z face of a selected reflection probe or light probe grid's bounds box.
	Handle3DProbeBoundsPosZ
	// Handle3DProbeBoundsNegZ edits the -Z face of a selected reflection probe or light probe grid's bounds box.
	Handle3DProbeBoundsNegZ
)
func (h Handle3DKind) String() string

String returns a human-readable label for the handle kind.

type HeldPermissionLoosening struct {
	ID               string                      `json:"id"`
	Kind             HeldPermissionLooseningKind `json:"kind"`
	RuleIndex        int                         `json:"ruleIndex"`
	Action           PermissionAction            `json:"action,omitempty"`
	Patterns         []string                    `json:"patterns,omitempty"`
	CurrentProfile   PermissionProfile           `json:"currentProfile,omitempty"`
	IncomingProfile  PermissionProfile           `json:"incomingProfile,omitempty"`
	CurrentDecision  PermissionDecision          `json:"currentDecision"`
	IncomingDecision PermissionDecision          `json:"incomingDecision"`
	Source           string                      `json:"source,omitempty"`
	Summary          string                      `json:"summary"`
}

HeldPermissionLoosening represents one loosened rule or profile from an external permissions.yaml change that is held (not used) until the person explicitly confirms it in Settings › Permissions.

type HeldPermissionLooseningKind string

HeldPermissionLooseningKind classifies how an external permissions.yaml change loosened effective permissions.

const (
	// HeldLooseningRuleRelaxed marks a rule whose decision became looser (e.g. Deny -> Allow or Ask -> Allow).
	HeldLooseningRuleRelaxed HeldPermissionLooseningKind = "rule_relaxed"
	// HeldLooseningRuleRemoved marks a stricter rule that was removed or narrowed externally, loosening effective evaluation.
	HeldLooseningRuleRemoved HeldPermissionLooseningKind = "rule_removed"
	// HeldLooseningProfileRelaxed marks a base profile change to a looser preset (e.g. Balanced -> Autonomous).
	HeldLooseningProfileRelaxed HeldPermissionLooseningKind = "profile_relaxed"
)
type History struct {
	// contains filtered or unexported fields
}

History records executed Commands and supports linear undo and redo, a unified timeline of manual edits, agent turns, and saved points, plus non-destructive commit milestones.

func NewHistory() *History

NewHistory returns an empty undo/redo History.

func (h *History) CanRedo() bool

CanRedo reports whether Redo has a command to re-apply.

func (h *History) CanUndo() bool

CanUndo reports whether Undo has a command to revert.

func (h *History) Clear()

Clear empties the command stack and timeline entries.

func (h *History) Entries() []HistoryEntry

Entries returns a copy of all recorded timeline entries, newest first.

func (h *History) Entry(id uint64) (HistoryEntry, bool)

Entry returns the timeline entry with ID id, or false when not found.

func (h *History) Execute(cmd Command)

Execute runs cmd.Do(), discards any redo tail beyond the current cursor, pushes cmd onto the stack, and notifies any change hook.

func (h *History) FilteredEntries(filter HistoryFilter) []HistoryEntry

FilteredEntries returns a copy of recorded timeline entries matching filter, newest first.

func (h *History) Group(label string, fn func() error) error

Group runs fn and records every command fn executes through h as one step labeled label, so that one Undo reverts them all, last first, and one Redo applies them again. When fn returns an error, Group undoes the commands fn executed, last first, records nothing and returns the error, leaving the history as it was. A group in which fn executes nothing records nothing. While fn runs, a nested Group joins the outer one, and a Clear drops what the group collected, since it belonged to the document the clear left behind; fn must not call Undo or Redo.

func (h *History) Index() int

Index returns the number of currently applied commands.

func (h *History) Len() int

Len returns the total number of commands retained in history (applied plus redoable).

func (h *History) MarkBranchPushed(branch string)

MarkBranchPushed marks all recorded milestones on branch as pushed.

func (h *History) Milestones() []CommitMilestone

Milestones returns a copy of all recorded commit milestones, most recent first.

func (h *History) RecordMilestone(m CommitMilestone)

RecordMilestone records a Git commit milestone in history without altering the undo/redo command stack or rebuilding the scene.

func (h *History) RecordSaved(files []string, detail string, snap historySnapshot) HistoryEntry

RecordSaved appends a saved-point marker to the timeline without altering the undo/redo stack.

func (h *History) Redo() bool

Redo re-applies the most recently undone command and returns true. It returns false when there is nothing to redo, and also when the command is one whose step can fail, such as a file move (MoveFile) that something on disk now blocks, and it failed; the command then stays undone. Editor.Redo reports why in the status bar.

func (h *History) RedoAuthor() CommandAuthor

RedoAuthor returns the author of the next command Redo would re-apply, or "" when nothing can be redone.

func (h *History) RedoLabel() string

RedoLabel returns the label of the next command Redo would re-apply, or "".

func (h *History) SetClock(fn func() time.Time)

SetClock sets the time source used to timestamp newly recorded history entries. Passing nil restores time.Now.

func (h *History) Undo() bool

Undo reverts the most recently executed command and returns true. It returns false when there is nothing to undo, and also when the command is one whose step can fail, such as a file move (MoveFile) that something on disk now blocks, and it failed; the command then stays applied. Editor.Undo reports why in the status bar.

func (h *History) UndoActor() HistoryActor

UndoActor returns who initiated the next command Undo would revert, or "" when nothing can be undone.

func (h *History) UndoAuthor() CommandAuthor

UndoAuthor returns the author of the next command Undo would revert, or "" when nothing can be undone.

func (h *History) UndoLabel() string

UndoLabel returns the label of the next command Undo would revert, or "".

type HistoryActor string

HistoryActor identifies whether a History step was initiated by the person using the editor or by an AI agent.

const (
	// HistoryActorPerson attributes a command to the person using the editor.
	HistoryActorPerson HistoryActor = "person"
	// HistoryActorAgent attributes a command to an AI agent.
	HistoryActorAgent HistoryActor = "agent"
)
type HistoryAuthor string

HistoryAuthor identifies who produced a timeline entry in History.

const (
	// HistoryAuthorYou marks edits made directly by the person in the editor.
	HistoryAuthorYou HistoryAuthor = "you"
	// HistoryAuthorAgent marks turns made by an AI agent (through MCP or kept reviews).
	HistoryAuthorAgent HistoryAuthor = "agent"
	// HistoryAuthorGit marks external Git working-tree transitions (such as switching branches).
	HistoryAuthorGit HistoryAuthor = "git"
)
func (a HistoryAuthor) Label() string

Label returns the human-readable author prefix used in the History panel and MCP readouts.

type HistoryEntry struct {
	// ID uniquely identifies this entry within the current History instance.
	ID uint64
	// Kind is HistoryEntryEdit or HistoryEntrySaved.
	Kind HistoryEntryKind
	// Author is who produced the step (HistoryAuthorYou, HistoryAuthorAgent, or HistoryAuthorGit; empty for saved markers).
	Author HistoryAuthor
	// Summary is the concise headline (for example "moved Knight", "slimes and coins", or "Saved").
	Summary string
	// Detail is the secondary description (for example "x 416 → 452", "6 changes · kept 5", or "level_01.scene.yaml").
	Detail string
	// Files lists the project-relative (or base) file paths touched by this entry.
	Files []string
	// Timestamp is when the step was recorded.
	Timestamp time.Time
	// ChangeCount is the number of individual changes proposed in an agent turn (0 when not applicable).
	ChangeCount int
	// KeptCount is the number of changes kept in an agent turn (0 when not applicable).
	KeptCount int
	// CommandIndex is the 1-based History command index right after this step ran, or 0 for saved markers and superseded steps.
	CommandIndex int
	// Undone reports whether this step is currently undone (ahead of the History undo cursor or superseded).
	Undone bool
	// RestoredFromID is non-zero when this step was created by restoring an earlier HistoryEntry.
	RestoredFromID uint64
	// CheckpointID is non-empty when this entry is backed by or belongs to a persistent checkpoint under .nsgo/checkpoints/.
	CheckpointID string
	// CheckpointKind identifies why a persistent checkpoint was created ("turn", "task", or "automation").
	CheckpointKind CheckpointKind
	// Persistent reports whether this entry is stored in .nsgo/checkpoints/ and survives editor restarts.
	Persistent bool
}

HistoryEntry is one visible row on the unified History timeline: a manual edit, an agent turn, a Git/external reload, a non-destructive restore, or a saved-point marker.

func (e HistoryEntry) Clone() HistoryEntry

Clone returns a deep copy of e so callers cannot mutate History's internal slice.

type HistoryEntryKind string

HistoryEntryKind distinguishes undoable edit steps from saved-point markers on the History timeline.

const (
	// HistoryEntryEdit is a recorded manual edit, agent turn, external reload, or restore step.
	HistoryEntryEdit HistoryEntryKind = "edit"
	// HistoryEntrySaved is a saved-point marker recorded when files are persisted to disk or OnSave.
	HistoryEntrySaved HistoryEntryKind = "saved"
	// HistoryEntryCheckpoint is a persistent per-turn, task, or automation checkpoint stored under .nsgo/checkpoints/.
	HistoryEntryCheckpoint HistoryEntryKind = "checkpoint"
)
type HistoryFilter string

HistoryFilter filters which entries the History panel or MCP history_list returns.

const (
	HistoryFilterAll   HistoryFilter = "all"
	HistoryFilterYou   HistoryFilter = "you"
	HistoryFilterAgent HistoryFilter = "agent"
)
type HistoryMeta struct {
	Author         HistoryAuthor
	Summary        string
	Detail         string
	Files          []string
	ChangeCount    int
	KeptCount      int
	RestoredFromID uint64
	BeforeFiles    map[string]historyFileSnapshot
	AfterFiles     map[string]historyFileSnapshot
}

HistoryMeta provides rich timeline metadata for a Command executed through History.

type InputMapTab string

InputMapTab selects which page of the Input Map panel is visible.

const (
	// InputMapTabActions shows actions, bindings, key capture and the region canvas.
	InputMapTabActions InputMapTab = "actions"
	// InputMapTabAxes shows action axes, motion axes and gamepad stick axes.
	InputMapTabAxes InputMapTab = "axes"
)
type Inspector struct {
	// Component is the component type name the inspector draws, as it is keyed under an object's components, with no control characters; its container has the test ID "inspector-plugin-<plugin>-<component>", which can collide as Panel.ID's can.
	Component string
	// View builds the section's controls for the object objectID once when the inspector shows it, below the component's title. It reads rev inside reactive functions to follow the editor's state, and edits the component through Editor.SetComponentField; Editor.ComponentField reads a field with its registered default. As the generic fields do, its controls should be disabled while Editor.Playing reports true, and an edit the editor refuses should be shown with Editor.Report rather than dropped.
	View func(cx *core.Scope, ed *Editor, rev *core.Signal[uint64], objectID string) core.Node
}

Inspector draws the inspector's section for one component type in place of its generic fields.

type InspectorFieldProblem struct {
	ObjectID  string
	Component string // empty for top-level object field or custom property
	Field     string // e.g. "alpha", "coyote", or "prop:<key>"
	Message   string
}

InspectorFieldProblem records a validation or project-check problem attached to a specific object field so the inspector can show a problem pill beside the control and its section header.

type InspectorReviewChange struct {
	ObjectID  string
	Component string // empty for top-level object field or custom property
	Field     string // e.g. "x", "speed", or "prop:<key>"
	OldValue  string
	NewValue  string
}

InspectorReviewChange records a field value modified in an open agent review so the inspector can highlight the field and display "was <OldValue> · in review".

type InspectorScrubField struct {
	ObjectID string
	Field    string
	Step     float64
	Min      *float64
	Max      *float64
	Integer  bool
}

InspectorScrubField identifies one numeric field of an object that can be scrubbed by dragging its label.

Field names either a built-in object field ("x", "y", "z", "rotation", "scaleX", "scaleY", "alpha", "originX", "originY", "posZ", "rotX", "rotY", "rotZ", "scaleZ", "depth"), a custom property ("prop:<key>"), or a component field ("comp:<component>.<field>").

type InterfaceSize string

InterfaceSize scales the editor's typography and controls together.

const (
	// InterfaceSizeCompact uses a slightly denser 90% scale for text and controls.
	InterfaceSizeCompact InterfaceSize = "compact"
	// InterfaceSizeDefault uses the standard 100% Spec scale.
	InterfaceSizeDefault InterfaceSize = "default"
	// InterfaceSizeLarge uses a roomier 115% scale for text and controls.
	InterfaceSizeLarge InterfaceSize = "large"
)
func (s InterfaceSize) Scale() float32

Scale returns the multiplier applied to editor typography and control sizes.

func (s InterfaceSize) Valid() bool

Valid reports whether s is a recognized interface size choice.

type KeepAllResult struct {
	KeptChanges          int      `json:"keptChanges"`
	DeletedFiles         []string `json:"deletedFiles,omitempty"`
	LeftPendingDeletions []string `json:"leftPendingDeletions,omitempty"`
	LeftPermissionsDraft bool     `json:"leftPermissionsDraft,omitempty"`
	ReviewStillOpen      bool     `json:"reviewStillOpen"`
}

KeepAllResult reports what KeepAllReviewChanges did.

type Keychain interface {
	Set(service, account, secret string) error
	Get(service, account string) (string, error)
	Delete(service, account string) error
}

Keychain stores, retrieves, and removes store upload credentials in the host OS keychain (macOS Keychain, Linux Secret Service, Windows Credential Manager) or an in-memory test store. Credentials must never be written into project files.

func DefaultKeychain() Keychain

DefaultKeychain returns the platform's native system keychain implementation.

type KeychainCredential struct {
	Destination PublishDestination `yaml:"-" json:"-"`
	Account     string             `yaml:"-" json:"-"`
	Secret      string             `yaml:"-" json:"-"`
}

KeychainCredential holds a store upload credential retrieved from the system keychain just before upload. Its fields carry `yaml:"-" json:"-"` and redacted String/GoString methods so secrets are never serialized into project files, snapshots, or logs.

func (c KeychainCredential) GoString() string

GoString redacts the credential secret for %#v formatting.

func (c KeychainCredential) String() string

String redacts the credential secret for safe logging.

type Language string

Language selects the editor UI language.

const (
	// LanguageSystem follows the operating system's locale (falling back to English when not Simplified Chinese).
	LanguageSystem Language = "system"
	// LanguageEnglish shows the editor UI in English.
	LanguageEnglish Language = "en"
	// LanguageChinese shows the editor UI in Simplified Chinese.
	LanguageChinese Language = "zh"
)
func (l Language) Valid() bool

Valid reports whether l is a recognized editor language choice.

type LastReleaseArtifact struct {
	SizeBytes  int64              `yaml:"sizeBytes" json:"sizeBytes"`
	Breakdown  BuildSizeBreakdown `yaml:"breakdown" json:"breakdown"`
	AssetSizes map[string]int64   `yaml:"assetSizes,omitempty" json:"assetSizes,omitempty"`
}

LastReleaseArtifact records one platform's size and breakdown from the previous release.

type LastReleaseBaseline struct {
	Version   string                         `yaml:"version" json:"version"`
	Artifacts map[string]LastReleaseArtifact `yaml:"artifacts,omitempty" json:"artifacts,omitempty"`
}

LastReleaseBaseline holds the previous release's version and per-platform artifact sizes for delta comparison.

type LayerInfo struct {
	// Name is the layer's name.
	Name string
	// Space is the layer's effective space, SpaceWorld or SpaceScreen.
	Space sceneformat.Space
	// Order is the layer's draw order value.
	Order int
	// Visible reports whether the layer draws, as its visible field says.
	Visible bool
	// Locked reports whether the layer is locked against picking and painting in the viewports for the session (SetLayerLocked).
	Locked bool
	// Active reports whether the layer is the editor's ActiveLayer.
	Active bool
	// Tilemap describes the layer's tilemap: the tileset and size of an inline grid ("tiles 16x12"), the name of the top-level tilemap it refers to, or the path of an external Tiled map; it is empty for a layer without a tilemap.
	Tilemap string
	// Objects is the number of objects on the layer, nested children included.
	Objects int
	// Inherited reports whether the layer extends a layer of the scene the open scene inherits (SceneDoc.Inherits), whose space, order, visibility and name that scene owns.
	Inherited bool
}

LayerInfo is what the layers panel shows for one layer of the open scene (Layers).

type LayoutFile struct {
	// Version is the schema version; it must equal LayoutVersion (1).
	Version int `yaml:"version"`
	// Center is the center region's split/tab tree (always containing the viewport panel).
	Center LayoutNode `yaml:"center"`
	// Left is the optional left dock region.
	Left *LayoutRegion `yaml:"left,omitempty"`
	// Right is the optional right dock region.
	Right *LayoutRegion `yaml:"right,omitempty"`
	// Bottom is the optional bottom dock region.
	Bottom *LayoutRegion `yaml:"bottom,omitempty"`
	// Hidden lists panel keys explicitly hidden by the user, sorted lexicographically.
	Hidden []string `yaml:"hidden,omitempty"`
}

LayoutFile is the strict versioned YAML document storing a user's dock panel arrangement outside any project directory.

func DefaultLayoutFile() *LayoutFile

DefaultLayoutFile returns the canonical default editor dock layout document.

func LoadLayoutFile(path string) (*LayoutFile, error)

LoadLayoutFile reads and parses the layout YAML file at path. When the file does not exist, it returns DefaultLayoutFile() and a nil error.

func ParseLayout(data []byte) (*LayoutFile, error)

ParseLayout strictly decodes and validates a versioned editor dock layout YAML document, refusing unknown fields, duplicate keys, trailing YAML documents, invalid nodes, and unsupported versions.

type LayoutNode struct {
	Panels   []string     `yaml:"panels,omitempty"`
	Active   int          `yaml:"active,omitempty"`
	Axis     string       `yaml:"axis,omitempty"`
	Sizes    []float32    `yaml:"sizes,omitempty,flow"`
	Children []LayoutNode `yaml:"children,omitempty"`
}

LayoutNode is either a tab group (Panels + optional Active index) or a split (Axis + Children + optional Sizes).

type LayoutRegion struct {
	Size   float32    `yaml:"size"`
	Closed bool       `yaml:"closed,omitempty"`
	Root   LayoutNode `yaml:"root"`
}

LayoutRegion describes one edge dock (left, right, or bottom): its size across its edge in points, whether it is collapsed, and its container tree.

type LeftRailMode int

LeftRailMode selects whether the editor's left rail shows the Scene tree or the Assets drawer browser.

const (
	// LeftRailScene shows the Scene tree, layers, and standard scene inspector.
	LeftRailScene LeftRailMode = iota
	// LeftRailAssets shows asset folders, SHOW ONLY filters, the bottom asset drawer, and the selected-asset inspector.
	LeftRailAssets
)
type MarqueeMode int

MarqueeMode selects whether a marquee box matches objects it fully encloses or objects it touches.

const (
	// MarqueeEnclose selects objects whose 2D canvas bounding box lies completely inside the marquee.
	MarqueeEnclose MarqueeMode = iota
	// MarqueeTouch selects objects whose 2D canvas bounding box intersects (touches) the marquee.
	MarqueeTouch
)
type MarqueeRect struct {
	X0, Y0, X1, Y1 float32
	Mode           MarqueeMode
}

MarqueeRect is the normalized canvas-space rectangle of an active 2D marquee selection drag.

type MaterialPreviewShape int

MaterialPreviewShape selects what the Material Editor's live preview renders.

const (
	// MaterialPreviewSphere renders a 3D UV sphere with render3d.
	MaterialPreviewSphere MaterialPreviewShape = iota
	// MaterialPreviewCube renders a 3D unit cube with render3d.
	MaterialPreviewCube
	// MaterialPreviewSprite renders a 2D sprite preview with base color, texture, opacity and blend mode.
	MaterialPreviewSprite
)
func (s MaterialPreviewShape) String() string

String returns a human-readable label for s.

type MemoryKeychain struct {
	// contains filtered or unexported fields
}

MemoryKeychain is a thread-safe in-memory Keychain implementation for tests and sandboxed tooling.

func NewMemoryKeychain() *MemoryKeychain

NewMemoryKeychain constructs an empty in-memory Keychain.

func (m *MemoryKeychain) Delete(service, account string) error

Delete removes any secret stored under (service, account) in memory.

func (m *MemoryKeychain) Get(service, account string) (string, error)

Get retrieves the secret stored under (service, account) in memory.

func (m *MemoryKeychain) Len() int

Len returns the number of entries currently stored in memory.

func (m *MemoryKeychain) Set(service, account, secret string) error

Set stores secret under (service, account) in memory.

type MemorySecretStore struct {
	// contains filtered or unexported fields
}

MemorySecretStore is an in-memory AgentSecretStore for headless tests without a core.Scope.

func NewMemorySecretStore(initial map[string]string) *MemorySecretStore

NewMemorySecretStore returns an initialized MemorySecretStore optionally seeded with values.

func (m *MemorySecretStore) Delete(account string) error

Delete removes account from the store.

func (m *MemorySecretStore) Get(account string) (string, bool, error)

Get returns the secret stored under account.

func (m *MemorySecretStore) GoString() string

GoString redacts stored secret values.

func (m *MemorySecretStore) Set(account, value string) error

Set stores value under account.

func (m *MemorySecretStore) String() string

String redacts stored secret values so they can never leak into logs or test output.

type MentionGroup string

MentionGroup classifies items in the composer's @-mention picker (Threads.dc.html).

const (
	MentionGroupAll       MentionGroup = "all"
	MentionGroupObjects   MentionGroup = "objects"
	MentionGroupFiles     MentionGroup = "files"
	MentionGroupPrefabs   MentionGroup = "prefabs"
	MentionGroupAssets    MentionGroup = "assets"
	MentionGroupProblems  MentionGroup = "problems"
	MentionGroupPlaytests MentionGroup = "playtests"
	MentionGroupHistory   MentionGroup = "history"
	MentionGroupRules     MentionGroup = "rules"
)
type MentionIconKind string

MentionIconKind identifies the visual icon rendered for a picker row or chip.

const (
	MentionIconObject   MentionIconKind = "obj"
	MentionIconFile     MentionIconKind = "file"
	MentionIconPrefab   MentionIconKind = "prefab"
	MentionIconImage    MentionIconKind = "thumb"
	MentionIconSound    MentionIconKind = "sound"
	MentionIconProblem  MentionIconKind = "problem"
	MentionIconPlaytest MentionIconKind = "run"
	MentionIconHistory  MentionIconKind = "history"
	MentionIconRule     MentionIconKind = "rule"
	MentionIconScene    MentionIconKind = "scene"
	MentionIconViewport MentionIconKind = "viewport"
)
type MentionItem struct {
	ID       string
	Group    MentionGroup
	ChipKind ContextChipKind
	Icon     MentionIconKind
	Name     string
	Meta     string
	// Target references the underlying entity: object ID, project-relative file path, problem key, etc.
	Target string
	// SceneFile is the project-relative scene path for object mentions.
	SceneFile string
	// Layer is the scene layer name for object mentions.
	Layer string
	// Line is the 1-based line number when known (such as a problem or object start line).
	Line int
	// Detail holds structured summary text for non-file entities (problems, playtests, history steps).
	Detail string
	// ColorSwatch is an optional hex tint for object/asset dots (using Spec tokens when 0).
	ColorRole string
}

MentionItem is one selectable entry in the composer's @-mention picker.

type MergeAutoItem struct {
	Scope     string `json:"scope"`
	ObjectID  string `json:"objectId,omitempty"`
	Name      string `json:"name"`
	Side      string `json:"side"`
	Action    string `json:"action"`
	SideLabel string `json:"sideLabel"`
}

MergeAutoItem describes one scene item joined cleanly by identity in MERGED BY ID.

type MergeChoice string

MergeChoice records which resolution the author picked for one scene merge conflict item.

const (
	// MergeChoiceUnresolved indicates the author has not yet chosen a resolution.
	MergeChoiceUnresolved MergeChoice = ""
	// MergeChoiceAgent selects the agent's suggested resolution.
	MergeChoiceAgent MergeChoice = "agent"
	// MergeChoiceMine selects the current branch's (ours) version.
	MergeChoiceMine MergeChoice = "mine"
	// MergeChoiceTheirs selects the incoming branch's (theirs) version.
	MergeChoiceTheirs MergeChoice = "theirs"
	// MergeChoiceCustom selects hand-edited YAML entered by the author.
	MergeChoiceCustom MergeChoice = "custom"
)
type MergeConflictItem struct {
	ID           string                      `json:"id"`
	Scope        string                      `json:"scope"`
	Layer        string                      `json:"layer,omitempty"`
	ObjectID     string                      `json:"objectId,omitempty"`
	Target       string                      `json:"target,omitempty"`
	Name         string                      `json:"name"`
	Kind         string                      `json:"kind"`
	Summary      string                      `json:"summary"`
	Conflicts    []sceneformat.MergeConflict `json:"conflicts"`
	BaseObj      *sceneformat.ObjectDoc      `json:"-"`
	MineObj      *sceneformat.ObjectDoc      `json:"-"`
	TheirsObj    *sceneformat.ObjectDoc      `json:"-"`
	MineLayer    string                      `json:"mineLayer,omitempty"`
	TheirsLayer  string                      `json:"theirsLayer,omitempty"`
	MineParent   string                      `json:"mineParent,omitempty"`
	TheirsParent string                      `json:"theirsParent,omitempty"`

	Agent  MergeOption `json:"agent"`
	Mine   MergeOption `json:"mine"`
	Theirs MergeOption `json:"theirs"`

	Choice        MergeChoice `json:"choice"`
	EditingCustom bool        `json:"editingCustom,omitempty"`
	CustomYAML    string      `json:"customYaml,omitempty"`
	CustomErr     string      `json:"customErr,omitempty"`
	// contains filtered or unexported fields
}

MergeConflictItem groups all sceneformat.MergeConflict entries that belong to one scene item (normally one object ID, or a layer/scene/connection/tilemap/override entry) so conflicts are resolved object by object.

type MergeConflictSession struct {
	RepoDir       string
	ScenePath     string
	ProjectName   string
	SceneName     string
	Mine          MergeSideMeta
	Theirs        MergeSideMeta
	BaseDoc       *sceneformat.SceneDoc
	MineDoc       *sceneformat.SceneDoc
	TheirsDoc     *sceneformat.SceneDoc
	BaseMergedDoc *sceneformat.SceneDoc
	Conflicts     []MergeConflictItem
	AutoMerged    []MergeAutoItem
	FocusedID     string
	Finished      bool
	CommitSHA     string
	VerifySummary string
	VerifyErr     string
	// contains filtered or unexported fields
}

MergeConflictSession holds the live state of an object-by-object scene merge conflict screen.

func (s *MergeConflictSession) AllResolved() bool

AllResolved reports whether every conflict item has a chosen resolution.

func (s *MergeConflictSession) BuildResultDoc() (*sceneformat.SceneDoc, error)

BuildResultDoc constructs a fresh SceneDoc by starting from BaseMergedDoc and applying every chosen conflict item.

func (s *MergeConflictSession) FocusedItem() *MergeConflictItem

FocusedItem returns a pointer to the currently focused conflict item, or nil when empty.

func (s *MergeConflictSession) RemainingCount() int

RemainingCount returns how many conflict items in s are still unresolved.

func (s *MergeConflictSession) ResolvedCount() int

ResolvedCount returns how many conflict items in s currently have a valid resolution chosen.

func (s *MergeConflictSession) ResultDoc() (*sceneformat.SceneDoc, error)

ResultDoc returns the current assembled SceneDoc reflecting every resolved conflict choice.

type MergeConflictSessionConfig struct {
	RepoDir     string
	ScenePath   string
	ProjectName string
	SceneName   string
	Mine        MergeSideMeta
	Theirs      MergeSideMeta
	BaseDoc     *sceneformat.SceneDoc
	MineDoc     *sceneformat.SceneDoc
	TheirsDoc   *sceneformat.SceneDoc
}

MergeConflictSessionConfig configures OpenMergeConflictSession for in-memory or fixture merges.

type MergeOption struct {
	Choice  MergeChoice            `json:"choice"`
	Title   string                 `json:"title"`
	Meta    string                 `json:"meta"`
	YAML    string                 `json:"yaml"`
	Reason  string                 `json:"reason,omitempty"`
	Deleted bool                   `json:"deleted,omitempty"`
	Object  *sceneformat.ObjectDoc `json:"-"`
	// contains filtered or unexported fields
}

MergeOption describes one selectable resolution card (Agent's suggestion, Mine, or Theirs).

type MergePlaytestResult struct {
	Duration time.Duration `json:"duration"`
	Steps    int           `json:"steps"`
	Summary  string        `json:"summary"`
}

MergePlaytestResult summarizes the short playtest run executed by FinishMerge.

type MergeSideMeta struct {
	Branch  string `json:"branch"`
	Author  string `json:"author,omitempty"`
	Commit  string `json:"commit,omitempty"`
	Message string `json:"message,omitempty"`
}

MergeSideMeta describes one branch participating in a scene merge.

type MergeSuggestRequest struct {
	ScenePath  string
	Item       MergeConflictItem
	Mine       MergeSideMeta
	Theirs     MergeSideMeta
	BaseDoc    *sceneformat.SceneDoc
	MineDoc    *sceneformat.SceneDoc
	TheirsDoc  *sceneformat.SceneDoc
	MergedDoc  *sceneformat.SceneDoc
	AutoMerged []MergeAutoItem
}

MergeSuggestRequest provides full three-way context to Editor.MergeSuggester for one conflicted item.

type MergeSuggestion struct {
	Meta      string
	YAML      string
	Reason    string
	Deleted   bool
	Object    *sceneformat.ObjectDoc
	FieldSide map[string]MergeChoice
}

MergeSuggestion is the agent's suggested resolution for one MergeConflictItem.

func DefaultMergeSuggestion(req MergeSuggestRequest) MergeSuggestion

DefaultMergeSuggestion produces a deterministic, reasoned suggestion for req without requiring an external LLM.

type MissingTranslation struct {
	Locale string
	Key    string
	Plural bool
}

MissingTranslation identifies a (locale, key) cell that lacks a translation in the Localization panel.

type ModelAnimationInfo struct {
	// Index is the 0-based index of the animation in gltf.Document.Animations.
	Index int
	// Name is the authored glTF animation name (may be empty).
	Name string
	// Duration is the clip's duration.
	Duration time.Duration
	// Channels is the number of animation channels in the clip.
	Channels int
}

ModelAnimationInfo describes one glTF animation clip shown in the model import preview.

func (a ModelAnimationInfo) DisplayName() string

DisplayName returns Name when non-empty, or "Animation <Index>".

type ModelEntry struct {
	// Mesh names the built-in primitive, one of sceneformat.MeshPrimitives, or is empty for a file.
	Mesh string
	// Path is the slash-separated path of the .gltf or .glb file from the project root, such as "models/crate.glb", or is empty for a primitive.
	Path string
	// Output says Path is what a model target of game.yaml's assets section writes (project.ModelTarget.Out), which `game assets` builds and the asset browser lists before it has been built.
	Output bool
}

ModelEntry is one model the asset browser lists for placing in 3D (Models): a built-in primitive, which an object draws through sceneformat.ObjectDoc.Mesh, or a glTF file of the open project, which it draws through sceneformat.ObjectDoc.Model. Exactly one of Mesh and Path is set.

func (m ModelEntry) FileLabel() string

FileLabel is the concise filename label shown on 3D MODELS strip cards and tooltips: the file's basename ("fountain.glb") for glTF models, or the primitive's name ("box") for built-in primitives.

func (m ModelEntry) Key() string

Key identifies the entry among those Models returns: "mesh:" and the primitive's name, or the file's path.

func (m ModelEntry) Name() string

Name is what the asset browser shows for the entry and what a placed object is named after: the primitive's name, or the file's name without its extension ("crate" for "models/crate.glb").

type ModelMaterialInfo struct {
	// Index is the 0-based index of the material in gltf.Document.Materials.
	Index int
	// Name is the authored glTF material name (may be empty).
	Name string
	// AlphaMode is the glTF alpha mode (OPAQUE, MASK, or BLEND).
	AlphaMode gltf.AlphaMode
	// Metallic and Roughness are the PBR metallic-roughness factors.
	Metallic, Roughness float32
	// DoubleSided reports whether back-face culling is disabled.
	DoubleSided bool
	// Unlit reports whether KHR_materials_unlit is enabled.
	Unlit bool
	// HasBaseColorTexture reports whether the material binds a base color texture.
	HasBaseColorTexture bool
	// BaseColor is the linear RGBA base color factor.
	BaseColor math3d.Vec4
}

ModelMaterialInfo describes one glTF material shown in the model import preview.

func (m ModelMaterialInfo) DisplayName() string

DisplayName returns Name when non-empty, or "Material <Index>".

type ModelMeshInfo struct {
	// Index is the 0-based index of the mesh in gltf.Document.Meshes.
	Index int
	// Name is the authored glTF mesh name (may be empty).
	Name string
	// Primitives is the number of primitives in the mesh.
	Primitives int
	// Triangles is the total triangle count across all triangle primitives of the mesh.
	Triangles int
	// Vertices is the total vertex count across all primitives of the mesh.
	Vertices int
	// MorphTargets is the maximum number of morph targets on any primitive of the mesh.
	MorphTargets int
	// Bounds is the local-space axis-aligned bounding box of the mesh.
	Bounds math3d.AABB
}

ModelMeshInfo describes one glTF mesh shown in the model import preview.

func (m ModelMeshInfo) DisplayName() string

DisplayName returns Name when non-empty, or "Mesh <Index>".

type ModelNodeInfo struct {
	// Index is the 0-based index of the node in gltf.Document.Nodes.
	Index int
	// Name is the authored glTF node name (may be empty).
	Name string
	// Parent is the parent node index, or -1 for a root node.
	Parent int
	// Depth is the nesting depth in the scene graph (0 for root nodes).
	Depth int
	// Mesh is the referenced mesh index, or -1 when the node has no mesh.
	Mesh int
	// MeshName is the referenced mesh's name (or empty).
	MeshName string
	// Skin is the referenced skin index, or -1 when unskinned.
	Skin int
	// Triangles is the triangle count of the node's mesh, or 0 when Mesh < 0.
	Triangles int
	// Bounds is the world-space axis-aligned bounding box of this node's mesh in rest pose, or empty when Mesh < 0.
	Bounds math3d.AABB
}

ModelNodeInfo describes one glTF node shown in the model import preview.

func (n ModelNodeInfo) DisplayName() string

DisplayName returns Name when non-empty, or "Node <Index>".

type ModelPreviewInfo struct {
	// Path is the clean slash-separated model path relative to the project root.
	Path string
	// Scale is the effective import scale from game.yaml or the sidecar.
	Scale float64
	// Bounds is the axis-aligned bounding box of the model in unscaled space.
	Bounds math3d.AABB
	// ScaledBounds is Bounds multiplied by Scale.
	ScaledBounds math3d.AABB
	// TotalTriangles is the total rendered triangle count across the model's active scene.
	TotalTriangles int
	// TotalVertices is the total rendered vertex count across the model's active scene.
	TotalVertices int

	Nodes      []ModelNodeInfo
	Meshes     []ModelMeshInfo
	Materials  []ModelMaterialInfo
	Animations []ModelAnimationInfo
}

ModelPreviewInfo summarizes a glTF or GLB model's contents, geometry counts, and bounds (both unscaled and at the effective import scale).

type MoveUnderCandidate struct {
	// ID is the target parent object's ID, or "" for moving to the top level of Layer.
	ID string
	// Name is the target's display name (or ID when Name is empty, or the layer name for a top-level entry).
	Name string
	// Layer is the scene layer containing this target.
	Layer string
	// Note is the secondary hint shown beside the entry (such as "layer Actors", "2 children", "current", or "locked").
	Note string
	// Current reports that this entry is already the object's current parent.
	Current bool
	// Locked reports that this candidate object is locked in the session.
	Locked bool
	// IsLayerRoot reports that choosing this entry moves the object to the top level of Layer.
	IsLayerRoot bool
	// ChildCount is how many direct children the candidate object currently has.
	ChildCount int
	// Depth is the candidate's nesting depth (0 for a layer root, 1 for a top-level object).
	Depth int
}

MoveUnderCandidate describes one valid target parent in the "Move under" submenu of an object's context menu.

type NavMeshBakeConfig struct {
	// AgentName names the baked agent type; empty defaults to project.DefaultNavAgent ("default").
	AgentName string
	// Radius is how far the baked mesh keeps from walls and ledges.
	Radius float32
	// Height is the minimum ceiling clearance the agent needs.
	Height float32
	// MaxClimb is the highest step (riser) the agent can climb.
	MaxClimb float32
	// MaxSlope is the steepest walkable slope in degrees, below 90.
	MaxSlope float32
	// CellSize is the horizontal (XZ) voxel size of the heightfield.
	CellSize float32
	// CellHeight is the vertical (Y) voxel size of the heightfield.
	CellHeight float32
	// OutputPath is the slash-separated project-relative path (or file path when no project is open)
	// where the deterministic .navmesh.yaml file is written. Empty uses SceneDoc.NavMesh or derives
	// a sibling .navmesh.yaml path from the open scene's path.
	OutputPath string
}

NavMeshBakeConfig holds the 3D navigation mesh bake parameters edited in the editor's NavMesh panel and used by Editor.BakeNavMesh3D. Zero numeric fields take navbake3d's defaults.

func DefaultNavMeshBakeConfig() NavMeshBakeConfig

DefaultNavMeshBakeConfig returns NavMeshBakeConfig populated with navbake3d's defaults.

type NavPathPreview2D struct {
	HasStart bool
	HasEnd   bool
	Start    core.Point
	End      core.Point
	Path     []core.Point
	Found    bool
}

NavPathPreview2D holds the active 2D navigation test-path endpoints and the latest path returned by ai.NavMesh.FindPath.

type Navigation3D string

Navigation3D selects the 3D viewport's mouse navigation mapping.

const (
	// Navigation3DDefault orbits on left-drag, pans on Shift+left-drag or middle-drag, and flies on right-drag.
	Navigation3DDefault Navigation3D = "default"
	// Navigation3DBlender orbits on middle-drag, pans on Shift+middle-drag, and flies on right-drag.
	Navigation3DBlender Navigation3D = "blender"
	// Navigation3DMaya orbits on Alt+left-drag, pans on middle-drag (or Alt+middle-drag), and flies on right-drag.
	Navigation3DMaya Navigation3D = "maya"
)
func (n Navigation3D) Valid() bool

Valid reports whether n is a recognized 3D mouse navigation mapping.

type NewTerrainOptions struct {
	// Name is the human-readable terrain name (defaults to "Terrain").
	Name string
	// Path is the optional file path where SaveTerrain writes the *.terrain.yaml (project-relative when a project is open, or OS path).
	Path string
	// Cols and Rows set the heightmap grid dimensions (each defaults to 33 when < 2).
	Cols int
	Rows int
	// CellSize is the XZ spacing between samples in world units (defaults to 2 when <= 0).
	CellSize float32
	// HeightScale is the world-space Y scale for normalized [0, 1] heights (defaults to 32 when <= 0).
	HeightScale float32
	// Origin is the world-space origin of sample (0, 0).
	Origin [3]float32
	// Layers optionally provides the initial material layers (defaults to grass and rock when empty).
	Layers []world3d.TerrainLayerDoc
	// Foliage optionally provides the initial foliage layers.
	Foliage []world3d.FoliageLayerDoc
}

NewTerrainOptions configures Editor.NewTerrain.

type Object3DRef struct {
	Index      int
	LayerIndex int
	// ObjectIndex is the object's index among its siblings: the children of its parent, or its layer's top-level objects.
	ObjectIndex int
	ID          string
	// ParentID is the ID of the object's parent, or empty for a top-level object.
	ParentID string
	Doc      *sceneformat.ObjectDoc
}

Object3DRef identifies a scene object by its flat 3D index, layer/object indices, and ID.

type ObjectChildrenSummary3D struct {
	// Count is the number of direct children.
	Count int
	// IDs are the child IDs (or names when an ID is empty) in document order.
	IDs []string
	// SharedRef is the shared prefab, model, or scene path when every child references the same one.
	SharedRef string
	// Summary is the formatted single-line summary (e.g. "wall_n · wall_e · wall_w · wall_s_l · wall_s_r" or "bench_01 … bench_06 · prefabs/bench.prefab.yaml").
	Summary string
}

ObjectChildrenSummary3D summarizes the direct children of a group object for the 3D inspector's CHILDREN section.

type ObjectColliderSummary3D struct {
	// ShapeKey is the canonical component shape value (e.g. "convex", "box", "sphere", "capsule", "cylinder", "trimesh", "heightfield").
	ShapeKey string
	// Shape is the localized human-readable shape name (e.g. "Convex hull", "Box").
	Shape string
	// BodyKind is the effective 3D body kind ("static", "dynamic", "kinematic", or "trigger").
	BodyKind string
	// IsTrigger reports whether the collider behaves as a non-solid trigger sensor.
	IsTrigger bool
}

ObjectColliderSummary3D summarizes an object's 3D collider and physics body kind for the 3D inspector's COLLIDER section.

func (s ObjectColliderSummary3D) Text() string

Text formats the collider summary as "<Shape> · <BodyKind>" (for example, "Convex hull · static").

type ObjectEvent struct {
	// Component is the component type name on the object.
	Component string
	// Event is the event declaration from the component registry.
	Event sceneformat.Event
	// Ref is the shortest unambiguous name to write in ConnectionDoc.Event: the bare event name when unique on the object, or "component.event" when several of its registered components declare the same name.
	Ref string
}

ObjectEvent is an event declared by one of an object's registered components.

type ObjectHandler struct {
	// Component is the component type name on the object.
	Component string
	// Handler is the handler declaration (including Params and Doc) from the component registry.
	Handler sceneformat.Handler
	// Ref is the shortest unambiguous name to write in ConnectionDoc.Handler: the bare handler name when unique on the object, or "component.handler" when several of its registered components declare the same name.
	Ref string
}

ObjectHandler is a handler declared by one of an object's registered components.

type ObjectMaterialSummary3D struct {
	// Path is the project-relative *.material.yaml path, or empty when the object uses the model's embedded glTF material or default primitive surface.
	Path string
	// FileName is the basename of Path (e.g. "stone.material.yaml"), or empty when no external material file is assigned.
	FileName string
	// Roughness is the PBR roughness in [0, 1].
	Roughness float32
	// Metallic is the PBR metallic factor in [0, 1].
	Metallic float32
	// HasValues reports whether Roughness and Metallic were resolved from a material file or built 3D drawable.
	HasValues bool
}

ObjectMaterialSummary3D summarizes the 3D surface material (material file name, roughness, and metallic) for the 3D inspector's MATERIAL section.

type ObjectModelSummary3D struct {
	// Path is the project-relative glTF model path (e.g. "models/fountain.glb"), or empty for a built-in primitive.
	Path string
	// Mesh is the built-in primitive name (e.g. "box"), or empty for a glTF model file.
	Mesh string
	// Triangles is the total triangle count across all drawables belonging to the object.
	Triangles int
	// MaterialCount is the number of distinct materials used by the object's drawables.
	MaterialCount int
}

ObjectModelSummary3D summarizes the 3D geometry drawn by an object for the 3D inspector's MODEL card.

func (s ObjectModelSummary3D) Entry() ModelEntry

Entry returns the ModelEntry for rendering the object's offscreen thumbnail.

func (s ObjectModelSummary3D) StatsText() string

StatsText formats triangle and material counts concisely (for example, "1,284 tris · 2 materials").

type ObjectOrigin int

ObjectOrigin identifies where an object in the active scene originates.

const (
	// ObjectLocal is an object defined directly in Editor.Doc.
	ObjectLocal ObjectOrigin = iota
	// ObjectInstanced is an object brought in by a local scene instance (ObjectDoc.Scene) in Editor.Doc.
	ObjectInstanced
	// ObjectInherited is an object brought in by the scene's base scene (SceneDoc.Inherits), including any instanced objects inside that base scene.
	ObjectInherited
)
func (o ObjectOrigin) String() string

String returns a human-readable label for the object origin.

type ObjectOverlay struct {
	// Kind selects which of the seven Spec overlay styles to draw.
	Kind OverlayKind
	// ChangeKind, when Kind is OverlayKindFocusedChange, chooses the underlying change kind
	// (OverlayKindAdded, OverlayKindChanged, or OverlayKindRemoved; defaults to OverlayKindAdded).
	// Focused changes always keep their own semantic color and dash at 2.5 px — never Accent.
	ChangeKind OverlayKind
	// Label is the primary text shown in the overlay's tag or pill:
	//   - Selection: object name (for example "Knight")
	//   - Agent: what the agent is doing (for example "placing slime_02")
	//   - Added: object name (prefixed with "+ " automatically if absent)
	//   - Changed: field old → new value (for example "z 10 → 12")
	//   - Removed: removed object name (drawn struck-through beside SecondaryLabel)
	//   - Problem: alert message (for example "door: lever_02 is missing")
	Label string
	// SecondaryLabel optionally overrides the trailing text on Removed pills (defaults to "removed").
	SecondaryLabel string
	// TaskNumber, when > 0 on OverlayKindAgent, draws the numbered task badge inside the agent pill.
	TaskNumber int
	// Holding, when true on OverlayKindAgent, renders the holding (45% dashed + clock glyph) variant.
	Holding bool
	// Bounds is the object's axis-aligned bounding box in canvas points.
	Bounds core.Bounds
	// Corners optionally supplies the exact transformed 4-corner quad in canvas points for
	// rotated 2D selection outlines. When empty, Bounds is used.
	Corners []math2d.Vec2
	// CanvasSize optionally clamps pill placement inside the viewport canvas.
	CanvasSize core.Size
	// PairedWithSelection, when true on OverlayKindAgent, places the agent outline 3 px further
	// out than Selection's outline so Selection keeps its handles inside.
	PairedWithSelection bool
	// PillStackOffset shifts the pill upward in points to clear another pill on the same object.
	PillStackOffset float32
	// Elapsed is the time since this overlay appeared (change fade-in) or started (agent pulse).
	// When HasElapsed is false, the overlay renders at full opacity (1.0).
	Elapsed    time.Duration
	HasElapsed bool
	// ReduceMotion disables fade-in (instant 100%) and agent outline pulsing (solid 100%).
	ReduceMotion bool
}

ObjectOverlay describes one Spec viewport overlay drawn over an object's canvas bounds.

type ObjectOverrideInfo struct {
	// ID is the object's full ID in the resolved scene (for example "enemy_1/body" or "hero").
	ID string
	// Origin is ObjectLocal, ObjectInstanced, or ObjectInherited.
	Origin ObjectOrigin
	// Layer is the name of the layer holding the object in the resolved scene.
	Layer string
	// InstanceID is the ID of the owning local scene-instancing object in Editor.Doc when Origin is ObjectInstanced, or "" otherwise.
	InstanceID string
	// Key is the override map key: the object's ID inside the instanced scene when Origin is ObjectInstanced, or the full ID when Origin is ObjectInherited.
	Key string
	// SourceScene is the slash-separated path of the scene file that defines this object (instance.Scene or Editor.Doc.Inherits).
	SourceScene string
}

ObjectOverrideInfo describes an object's origin and where edits to it record overrides.

type ObjectTaskOverlay struct {
	TaskID              string
	TaskNumber          int
	ObjectID            string
	Holding             bool
	BlockedOn           string
	BlockedByTaskNumber int
	Label               string
}

ObjectTaskOverlay describes a numbered overlay drawn on an object in the viewport and scene tree.

type ObjectUsagesResult struct {
	// Target is the scene path, prefab name, or object ID that was searched.
	Target string
	// Kind is "references" when FindReferences ran for a project file path, or "search" when Search ran.
	Kind string
	// References holds matching file references when Kind == "references".
	References []refs.Ref
	// SearchResults holds matching project search hits when Kind == "search".
	SearchResults []SearchResult
	// Count is the total number of usages found.
	Count int
}

ObjectUsagesResult reports project references or search matches found for an object by FindObjectUsages.

type OrbitCamera3D struct {
	Target   [3]float32
	Yaw      float32
	Pitch    float32
	Distance float32
	FOV      float32
	Near     float32
	Far      float32
	// Orthographic projects the view in parallel instead of in perspective. The view is OrthoHeight high, the height the perspective view shows at Target, so switching keeps what lies at Target the same size; Distance still zooms it, and the eye moves back along the view so the clip planes take in the scene in front of Target and behind it.
	Orthographic bool
}

OrbitCamera3D is a pure-Go right-handed (Y-up) orbit camera for the 3D scene view: it looks at Target from Distance away, turned by Yaw about the vertical axis and tilted by Pitch, through a perspective projection or, with Orthographic, a parallel one.

func DefaultOrbitCamera3D() OrbitCamera3D

DefaultOrbitCamera3D returns a perspective orbit camera framed on the world origin.

func (c OrbitCamera3D) AxisView() (View3D, bool)

AxisView returns the axis view the camera looks along, and false when it looks along none, as after an orbit.

func (c OrbitCamera3D) Basis() (right, up, forward [3]float32)

Basis returns the camera's orthonormal right, up, and forward (eye-to-target) unit vectors in world space.

func (c OrbitCamera3D) Eye() [3]float32

Eye returns the camera's world-space position derived from Target, Yaw, Pitch and Distance, moved back along the view in orthographic (Orthographic).

func (c *OrbitCamera3D) Fly(right, up, forward float32)

Fly moves the camera, eye and Target together, by right along the view's right direction, up along the world's up axis and forward along the direction the view looks. A move that is not finite changes nothing.

func (c *OrbitCamera3D) Look(dyaw, dpitch float32)

Look turns the camera about its eye, as a first-person camera turns its head: dyaw turns it left (positive) or right and dpitch tilts it down (positive) or up, in radians; a turn that is not finite changes nothing. Target moves to stay Distance in front of the eye, and the tilt stops short of straight up or down, as Orbit's does.

func (c *OrbitCamera3D) Orbit(dyaw, dpitch float32)

Orbit rotates the camera around Target by dyaw (azimuth) and dpitch (elevation) in radians.

func (c OrbitCamera3D) OrthoHeight() float32

OrthoHeight returns the world height the view shows at Target: the whole height of the orthographic view, and the height of the perspective view's slice through Target.

func (c *OrbitCamera3D) Pan(dx, dy float32)

Pan translates Target parallel to the camera image plane by dx along camera right and dy along camera up.

func (c OrbitCamera3D) Project(world [3]float32, w, h float32) (sx, sy, depth float32, visible bool)

Project transforms a world-space 3D point into viewport pixel coordinates (sx, sy) and camera depth, in perspective or in orthographic (Orthographic). visible is true when the point lies strictly between Near and Far in front of the camera.

func (c OrbitCamera3D) Ray(sx, sy, w, h float32) math3d.Ray

Ray returns the world-space pick ray passing through viewport pixel (sx, sy) for a viewport of size w x h.

func (c OrbitCamera3D) SceneCamera(w, h float32) *scene3d.Camera

SceneCamera returns c as a scene3d.Camera for a viewport w by h, with the same eye, view direction, projection (perspective, or orthographic with OrthoHeight) and clip planes that Project and ScreenRay use, which the 3D viewport draws the scene's geometry through.

func (c OrbitCamera3D) ScreenRay(sx, sy, w, h float32) (origin, dir [3]float32)

ScreenRay returns the world-space ray (origin, unit direction) passing through viewport pixel (sx, sy). In perspective every ray starts at the eye; in orthographic (Orthographic) every ray runs along the view's forward direction from the point of the eye's plane under the pixel.

func (c *OrbitCamera3D) SetView(v View3D)

SetView turns the camera to look at Target along the axis view v, keeping Target, Distance and the projection. A value that names no view changes nothing.

func (c OrbitCamera3D) ViewProj(w, h float32) math3d.Mat4

ViewProj returns the right-handed Y-up [0, 1] NDC view-projection matrix matching OrbitCamera3D.SceneCamera (perspective or orthographic) for a viewport of size w x h.

func (c *OrbitCamera3D) Zoom(delta float32)

Zoom adjusts camera Distance by subtracting delta (positive zooms in, negative zooms out), clamped to a safe positive range.

func (c *OrbitCamera3D) ZoomBy(factor float32)

ZoomBy divides Distance by factor, so a factor of 2 shows the view twice as large, clamped as Zoom clamps it. A factor that is not positive and finite changes nothing.

type OutputEntry struct {
	Time   time.Time
	Source OutputSource
	Level  OutputLevel
	Text   string
	// File is the parsed file path when Text contains a file:line location, or empty.
	File string
	// Line is the 1-based line number paired with File, or 0 when none was parsed.
	Line int
}

OutputEntry is one timestamped line in the editor's Output panel history.

type OutputLevel int

OutputLevel classifies the severity of an Output panel entry.

const (
	// OutputInfo is a normal status message or game stdout line.
	OutputInfo OutputLevel = iota
	// OutputError is an error reported by the editor or streamed from game stderr.
	OutputError
)
func (l OutputLevel) String() string

String returns a short label for the output level ("info" or "error").

type OutputSource int

OutputSource identifies where a line in the Output panel originated.

const (
	// OutputEditor is a status or error message produced by the editor itself.
	OutputEditor OutputSource = iota
	// OutputStdout is a line streamed from the running game's standard output.
	OutputStdout
	// OutputStderr is a line streamed from the running game's standard error.
	OutputStderr
)
func (s OutputSource) String() string

String returns a short label for the output source ("editor", "stdout", or "stderr").

type OverlayKind string

OverlayKind identifies one of the seven Spec viewport overlay styles defined in docs/design/editor/Spec.dc.html ("Overlay legend").

const (
	// OverlayKindSelection is the person's selection: accent, 1.5 px solid, four corner handles, name tag.
	OverlayKindSelection OverlayKind = "selection"
	// OverlayKindAgent is the agent working overlay: agent violet, 1.5 px solid, no handles,
	// pulsing 1.6 s between 100% and 45%, pill with agent glyph saying what it is doing.
	OverlayKindAgent OverlayKind = "agent"
	// OverlayKindAdded marks a newly added object: added green, 1.5 px dashed, "+ name" pill.
	OverlayKindAdded OverlayKind = "added"
	// OverlayKindChanged marks an edited object: changed amber, 1.5 px dashed, "field old → new" pill.
	OverlayKindChanged OverlayKind = "changed"
	// OverlayKindRemoved marks a removed object: removed red, 1.5 px solid around a 25% grey ghost,
	// pill with struck-through name.
	OverlayKindRemoved OverlayKind = "removed"
	// OverlayKindProblem marks a live object with a problem: problem red, 2 px solid on the live object,
	// filled pill with alert triangle icon and message (never like a removed ghost).
	OverlayKindProblem OverlayKind = "problem"
	// OverlayKindFocusedChange highlights the focused change in a Review: its own color and dash at 2.5 px
	// with an outlined pill, never accent.
	OverlayKindFocusedChange OverlayKind = "focused"
)
func OverlayLegendKinds() []OverlayKind

OverlayLegendKinds returns the six toggleable Spec overlay legend kinds in display order: Selection, Agent working, Added, Changed, Removed, Problem.

func (k OverlayKind) IsChangeKind() bool

IsChangeKind reports whether k is a diff/review change kind (Added, Changed, or Removed).

func (k OverlayKind) IsLegendKind() bool

IsLegendKind reports whether k is one of the six toggleable rows in the viewport overlay legend.

func (k OverlayKind) Valid() bool

Valid reports whether k is any of the seven Spec overlay kinds.

type OverlayLegendKind string

OverlayLegendKind identifies one toggleable row of the Spec viewport overlay legend (docs/design/editor/Spec.dc.html): Selection, Agent working, Added, Changed, Removed, Problem.

const (
	OverlayLegendSelection OverlayLegendKind = "selection"
	OverlayLegendAgent     OverlayLegendKind = "agent"
	OverlayLegendAdded     OverlayLegendKind = "added"
	OverlayLegendChanged   OverlayLegendKind = "changed"
	OverlayLegendRemoved   OverlayLegendKind = "removed"
	OverlayLegendProblem   OverlayLegendKind = "problem"
)
func AllOverlayLegendKinds() []OverlayLegendKind

AllOverlayLegendKinds returns every Spec overlay legend kind in canonical display order.

func (k OverlayLegendKind) Valid() bool

Valid reports whether k is a recognized Spec overlay legend kind.

type PaletteTerrain struct {
	Name string
	Mode string
}

PaletteTerrain describes one terrain set shown in the tile palette for a layered grid's YAML tileset.

type PaletteTile struct {
	// ID is the tile ID painting writes: the value in a single grid's data, or a layered grid's tile's local ID plus 1, as PaintTile takes it.
	ID int
	// Number is the tile's number as the scene file writes it, which the palette and the status bar show: ID for a single grid, and the local ID (ID less 1) for a layered grid.
	Number int
	// Name is the tile's human-readable name from the YAML tileset (or atlas frame name), or empty when unnamed.
	Name string
	// Col and Row are the tile's 0-based atlas/sheet cell coordinates.
	Col, Row int
	// Collision summarizes the tile's collision rule ("solid", "one-way top", "shapes", or "none") for YAML tilesets.
	Collision string
	// Terrain names the terrain set this tile belongs to in a YAML tileset, if any.
	Terrain string
	// Image is the image the tile is drawn from: the tileset atlas's image, or a YAML tileset's grid image.
	Image core.ImageSource
	// Frame is the tile's frame in Image.
	Frame sprite.Frame
}

PaletteTile is one tile of a TilePalette: for a single grid, a frame of the tileset atlas whose name is its tile ID ("1", "2", ...), as sceneformat looks tiles up; for a layered grid, a tile of its YAML tileset.

type Panel struct {
	// ID identifies the panel within its plugin and has no control characters. The panel's container has the test ID "plugin-panel-<plugin>-<id>"; as the parts are joined with '-', a plugin whose name or IDs contain '-' can share a test ID with another, so name plugins that are used together so that their test IDs differ.
	ID string
	// Title is shown above the panel.
	Title string
	// TitleKey is an optional localization key in the plugin's catalog used in place of Title when present.
	TitleKey string
	// Dock is where the panel sits.
	Dock Dock
	// View builds the panel's content once when the panel appears; the panel stays mounted, keeping its scope and state, while its plugin is on, whatever other panels come and go in its dock. It reads rev, which changes on every editor state change, inside reactive functions to follow the editor's state, as the editor's own panels do.
	View func(cx *core.Scope, ed *Editor, rev *core.Signal[uint64]) core.Node
}

Panel is a view a plugin docks in the editor window.

type PanelInfo struct {
	// Key is the stable panel key (such as PanelInspector or PluginPanelKey("health", "overview")).
	Key string
	// Title is the human-readable title shown on tabs and in the View > Panels menu.
	Title string
	// DefaultDock is where the panel docks by default.
	DefaultDock Dock
	// Visible reports whether the panel is currently shown in the dock area.
	Visible bool
	// Available reports whether the panel can currently be toggled or shown (for example Files requires an open project).
	Available bool
	// Closable reports whether the user can hide or close the panel (false for PanelViewport).
	Closable bool
	// Plugin and PluginID identify the owning plugin when this entry represents a plugin panel.
	Plugin   string
	PluginID string
}

PanelInfo describes one dockable editor panel for menus, commands, and layout inspection.

type PanicReport struct {
	RunNumber  int               `json:"runNumber"`
	Time       time.Time         `json:"time"`
	Frame      int               `json:"frame"`
	Message    string            `json:"message"`
	Frames     []PanicStackFrame `json:"frames"`
	ReplayPath string            `json:"replayPath,omitempty"`
	ReplayAbs  string            `json:"replayAbs,omitempty"`
}

PanicReport captures a panic detected in a game run or Play session, with separated game and runtime frames.

func ParsePanicTrace(lines []string, projectDir string) (*PanicReport, bool)

ParsePanicTrace detects a Go panic message and stack trace in lines, normalizing paths relative to projectDir and separating game frames from runtime/engine frames.

func (p *PanicReport) Clone() *PanicReport

Clone returns an independent copy of p.

func (p *PanicReport) GameFrames() []PanicStackFrame

GameFrames returns the user/game stack frames (non-runtime) in call order.

func (p *PanicReport) RuntimeFrames() []PanicStackFrame

RuntimeFrames returns the folded game-runtime and Go-runtime stack frames in call order.

type PanicStackFrame struct {
	Function string `json:"function"`
	File     string `json:"file"`
	Line     int    `json:"line"`
	Runtime  bool   `json:"runtime"`
}

PanicStackFrame represents one parsed stack frame from a Go panic trace.

type ParticleCurveKind string

ParticleCurveKind selects which curve the Particle Emitter panel's curve widget edits.

const (
	ParticleCurveSize       ParticleCurveKind = "size"
	ParticleCurveAlpha      ParticleCurveKind = "alpha"
	ParticleCurveRotation   ParticleCurveKind = "rotation"
	ParticleCurveColor      ParticleCurveKind = "color"
	ParticleCurveTrailWidth ParticleCurveKind = "trailWidth"
	ParticleCurveTrailColor ParticleCurveKind = "trailColor"
)
type PasteOptions struct {
	// Layer names the target layer; empty uses ActiveLayer (or ParentID's layer when ParentID is set).
	Layer string
	// ParentID optionally names an existing object to paste under as children.
	ParentID string
	// At optionally places the pasted objects' 2D centroid at this layer-space point.
	At *[2]float32
	// At3D optionally places the pasted objects' 3D centroid at this world-space point.
	At3D *[3]float32
	// Offset optionally shifts every pasted root by (dx, dy) in 2D.
	Offset *[2]float32
	// Offset3D optionally shifts every pasted root by (dx, dy, dz) in 3D.
	Offset3D *[3]float32
}

PasteOptions configures where PasteWith and PasteYAMLWith place pasted objects.

type PendingGoOverlayFile struct {
	Content string
	Delete  bool
}

PendingGoOverlayFile represents one pending Go file included in a Go build overlay JSON.

type PendingPermissionRequest struct {
	ID         string               `json:"id"`
	Summary    string               `json:"summary"`
	Evaluation PermissionEvaluation `json:"evaluation"`
	Status     string               `json:"status"` // "pending", "allowed_once", "allowed_always", "denied"
	// contains filtered or unexported fields
}

PendingPermissionRequest represents an MCP tool call paused on an Ask rule awaiting the person's answer.

type PendingProjectAction struct {
	// Kind is "open", "create", or "demo".
	Kind string
	// Target is the path or name being opened (project directory or "Demo Room").
	Target string
	// Summary is a human-readable description shown in the confirmation dialog.
	Summary string
}

PendingProjectAction describes a project switch waiting for confirmation because the open session has unsaved edits.

type PermissionAction string

PermissionAction is the kind of mutating or running work a permission rule governs.

const (
	// PermissionActionEdit modifies existing project files or open editor documents.
	PermissionActionEdit PermissionAction = "edit"
	// PermissionActionCreate creates new files anywhere in the project.
	PermissionActionCreate PermissionAction = "create"
	// PermissionActionDelete deletes files from the project.
	PermissionActionDelete PermissionAction = "delete"
	// PermissionActionRun runs project work such as game check, headless playtests, or shell commands.
	PermissionActionRun PermissionAction = "run"
	// PermissionActionCode edits Go source code (such as **/*.go).
	PermissionActionCode PermissionAction = "code"
)
func (a PermissionAction) DisplayName() string

DisplayName returns the English label for a.

func (a PermissionAction) Valid() bool

Valid reports whether a is a recognized permission action.

type PermissionDecision string

PermissionDecision is what the MCP server does when a rule matches a tool call.

const (
	// PermissionAllow runs the tool call immediately.
	PermissionAllow PermissionDecision = "allow"
	// PermissionAsk opens a permission request for the person to allow once, always allow, or deny.
	PermissionAsk PermissionDecision = "ask"
	// PermissionDeny refuses the tool call before running it and returns an error naming the rule.
	PermissionDeny PermissionDecision = "deny"
)
func (d PermissionDecision) DisplayName() string

DisplayName returns the English label for d.

func (d PermissionDecision) Strictness() int

Strictness ranks decisions from loosest (0 = Allow) to strictest (2 = Deny; invalid = 3 fail-closed).

func (d PermissionDecision) Valid() bool

Valid reports whether d is a recognized permission decision.

type PermissionEvaluation struct {
	// Decision is PermissionAllow, PermissionAsk, or PermissionDeny.
	Decision PermissionDecision `json:"decision"`
	// Profile is the active base profile name.
	Profile PermissionProfile `json:"profile"`
	// Modified reports whether the active rule table differs from PermissionPreset(Profile).
	Modified bool `json:"modified,omitempty"`
	// RuleIndex is the 0-based index of the first matching rule, or -1 when no rule matched and the profile default decided.
	RuleIndex int `json:"ruleIndex"`
	// RuleNumber is the 1-based rule number (RuleIndex + 1), or 0 when no rule matched.
	RuleNumber int `json:"ruleNumber,omitempty"`
	// RuleTotal is the total number of rules in the table.
	RuleTotal int `json:"ruleTotal,omitempty"`
	// Rule is a copy of the matched rule, or nil when no rule matched.
	Rule *PermissionRule `json:"rule,omitempty"`
	// Reason is a clear, readable explanation naming the rule and/or profile that caused Decision.
	Reason string `json:"reason"`
	// Link is the Settings navigation label for this decision, such as "Settings › Permissions · rule 7 of 7".
	Link string `json:"link"`
	// HeldByDisk reports that an external permissions.yaml change tried to loosen this rule or profile,
	// and the editor is holding the stricter decision until the person confirms it in Settings › Permissions.
	HeldByDisk bool `json:"heldByDisk,omitempty"`
	// Tool, Action, and Target echo the evaluated request.
	Tool   string           `json:"tool,omitempty"`
	Action PermissionAction `json:"action"`
	Target string           `json:"target,omitempty"`
}

PermissionEvaluation is the result of evaluating a PermissionRequest against a PermissionsFile. Every decision identifies which rule index or base profile produced it.

type PermissionProfile string

PermissionProfile selects a preset rule table for what the editor's MCP server lets an agent do on its own. Profiles are presets of rules; the rules themselves decide every tool call.

const (
	// PermissionProfileCautious asks before every edit, creation, game check, and playtest, and denies deleting files or running shell commands.
	PermissionProfileCautious PermissionProfile = "cautious"
	// PermissionProfileBalanced edits content (scenes/**, prefabs/**, data/**) and runs game check and playtests on its own, asks before game.yaml, brief.yaml, Go code, and file creation, and denies deleting files or running shell commands.
	PermissionProfileBalanced PermissionProfile = "balanced"
	// PermissionProfileAutonomous does whole tasks end to end while keeping reviewable editor undo steps; deletes and shell commands remain denied unless explicitly allowed.
	PermissionProfileAutonomous PermissionProfile = "autonomous"
)
func (p PermissionProfile) DisplayName() string

DisplayName returns the English label for p.

func (p PermissionProfile) Valid() bool

Valid reports whether p is a recognized permission profile name.

type PermissionRequest struct {
	// Tool is the MCP tool name (for example "scene_edit", "game_playtest", or "shell_run").
	Tool string
	// Action is the mutating or running operation category.
	Action PermissionAction
	// Target is a slash-separated project-relative file path (such as "scenes/level_01.scene.yaml") or a run target (such as "game check", "playtests", or "shell: go generate ./assets").
	Target string
	// Summary optionally provides a short human-readable description of the call for UI cards and logs.
	Summary string
}

PermissionRequest describes an MCP tool call to evaluate against a PermissionsFile.

type PermissionResponse int

PermissionResponse is the person's answer to a pending Ask permission request.

const (
	// PermissionResponseAllowOnce allows this one request without modifying permissions.yaml.
	PermissionResponseAllowOnce PermissionResponse = iota + 1
	// PermissionResponseAlways adds an Allow rule to permissions.yaml, persists it, and shows the "Always permission rule saved" toast with Show and Undo.
	PermissionResponseAlways
	// PermissionResponseDeny refuses the request without modifying permissions.yaml.
	PermissionResponseDeny
)
type PermissionRule struct {
	// Action is the kind of operation this rule matches ("edit", "create", "delete", "run", or "code").
	Action PermissionAction `yaml:"action" json:"action" schema:"required,enum=edit|create|delete|run|code"`
	// Patterns lists slash-separated file globs (such as "scenes/**", "game.yaml", "**/*.go", "**") or run targets (such as "game check", "playtests", "shell").
	Patterns []string `yaml:"patterns" json:"patterns" schema:"required,minItems=1"`
	// Decision is what happens when this rule is the first match ("allow", "ask", or "deny").
	Decision PermissionDecision `yaml:"decision" json:"decision" schema:"required,enum=allow|ask|deny"`
}

PermissionRule is one row in the first-match-wins permission rule table.

func AlwaysRuleForEvaluation(eval PermissionEvaluation) PermissionRule

AlwaysRuleForEvaluation constructs the specific Allow rule added when a person chooses "Always" on eval. Returns a rule with empty Patterns when eval lacks a safe, concrete target (callers must refuse to persist it).

func (r PermissionRule) Clone() PermissionRule

Clone returns a deep copy of r.

func (r PermissionRule) Summary() string

Summary formats r as a compact readable string such as "Run · shell commands → Deny".

type PermissionToast struct {
	Message   string
	RuleIndex int
	Rule      PermissionRule
	// contains filtered or unexported fields
}

PermissionToast holds the active "Always permission rule saved" confirmation toast state, with enough state to Show the saved rule or Undo it byte-for-byte.

type PermissionsDraft struct {
	ID      string                 `json:"id"`
	Request string                 `json:"request,omitempty"`
	Domain  YouOnlyDomain          `json:"domain"`
	Rules   []PermissionsDraftRule `json:"rules"`
}

PermissionsDraft holds an agent-submitted draft awaiting explicit per-rule ticks and Apply from the person.

func (d *PermissionsDraft) Clone() *PermissionsDraft

Clone returns a deep copy of d.

type PermissionsDraftRequest struct {
	Request string                     `json:"request,omitempty"`
	Rules   []PermissionsDraftRuleSpec `json:"rules"`
}

PermissionsDraftRequest is submitted by the agent (e.g. via permissions_draft MCP tool) to open a You-only draft card.

type PermissionsDraftRule struct {
	ID              string             `json:"id"`
	RuleIndex       int                `json:"ruleIndex"` // >= 0 if updating an existing rule; -1 if adding a new rule
	Action          PermissionAction   `json:"action"`
	Patterns        []string           `json:"patterns"`
	CurrentDecision PermissionDecision `json:"currentDecision"`
	DraftDecision   PermissionDecision `json:"draftDecision"`
	Ticked          bool               `json:"ticked"`
}

PermissionsDraftRule is one row in the open Permissions Draft card. Ticked is always false when a draft opens; only the person may tick a rule.

type PermissionsDraftRuleSpec struct {
	Action   PermissionAction   `json:"action"`
	Patterns []string           `json:"patterns"`
	Decision PermissionDecision `json:"decision"`
}

PermissionsDraftRuleSpec describes one rule change an agent proposes in a permissions draft.

type PermissionsDraftYAMLLine struct {
	Kind string // "", "-", "+"
	Text string
}

PermissionsDraftYAMLLine is one line in the "permissions.yaml · if applied" diff preview of the draft card.

type PermissionsFile struct {
	// Version is the schema version; it must equal PermissionsVersion (1).
	Version int `yaml:"version" json:"version" schema:"required"`
	// Profile names the base preset ("cautious", "balanced", or "autonomous").
	// Editing individual rules keeps Profile so the editor can mark the profile as changed from its preset.
	Profile PermissionProfile `yaml:"profile" json:"profile" schema:"required,enum=cautious|balanced|autonomous"`
	// Rules is the ordered first-match-wins permission table checked before every mutating or running MCP tool call.
	Rules []PermissionRule `yaml:"rules" json:"rules" schema:"required"`
}

PermissionsFile is the versioned YAML document stored in permissions.yaml beside game.yaml. Rules are evaluated from top to bottom and the first matching rule decides. A file looks like this:

# yaml-language-server: $schema=https://game.nsgo.dev/schemas/permissions.v1.json
version: 1
profile: balanced
rules:
  - action: edit
    patterns:
      - scenes/**
      - prefabs/**
      - data/**
    decision: allow
func DefaultPermissions() PermissionsFile

DefaultPermissions returns the editor's default project permissions: version 1 with the Balanced profile preset.

func LoadPermissions(filePath string) (*PermissionsFile, error)

LoadPermissions reads and parses permissions.yaml from path.

func ParsePermissions(data []byte) (*PermissionsFile, error)

ParsePermissions decodes and validates a versioned YAML permissions.yaml document. Unknown fields, trailing YAML documents, YAML anchors/aliases/merge keys, duplicate mapping keys, missing or unsupported versions, and invalid profiles, actions, patterns, or decisions are refused.

Errors are *loaderr.Error values carrying the line, column, field path and fix; a caller that read data from a file names it with loaderr.WithFile.

func PermissionPreset(profile PermissionProfile) PermissionsFile

PermissionPreset returns the canonical rule table for profile (defaulting to Balanced for an unknown profile).

func (f PermissionsFile) Clone() PermissionsFile

Clone returns a deep copy of f.

func (f PermissionsFile) Evaluate(req PermissionRequest) PermissionEvaluation

Evaluate checks req against f's rules from top to bottom (first match wins). When no rule matches, the active profile's default decision applies. Unrecognized actions or escaping file paths fail closed (PermissionDeny).

func (f PermissionsFile) IsModified() bool

IsModified reports whether f's rules differ from PermissionPreset(f.Profile).

type PickedComponentGizmo3D struct {
	ObjectID  string
	Component string
	Handle    GizmoHandle3D
}

PickedComponentGizmo3D identifies a picked or active 3D component gizmo handle on a scene object.

type Placement3D struct {
	// Point is the world-space point the model rests on.
	Point [3]float32
	// Normal is the outward unit normal of the surface at Point, straight up on the ground plane.
	Normal [3]float32
	// OnSurface says Point lies on the scene's geometry rather than on the ground plane.
	OnSurface bool
}

Placement3D is where the Place tool puts a model in the 3D viewport (PlacementAt3D): a point on the geometry under the pointer, or on the ground plane where it hits none.

type PlanAnswerDecision struct {
	QuestionID   string `json:"questionId"`
	Label        string `json:"label,omitempty"`
	OptionID     string `json:"optionId"`
	OptionLabel  string `json:"optionLabel"`
	PickedForYou bool   `json:"pickedForYou,omitempty"`
}

PlanAnswerDecision records the person's final answer to one clarifying question.

type PlanEstimate struct {
	Duration string `json:"duration,omitempty"`
	Tokens   string `json:"tokens,omitempty"`
}

PlanEstimate holds optional human-readable duration and token budget estimates for a plan.

type PlanFile struct {
	Path string      `json:"path"`
	Tag  PlanFileTag `json:"tag,omitempty"`
}

PlanFile lists one file touched by the plan for the "FILES IN THIS PLAN" panel.

type PlanFileTag string

PlanFileTag classifies how a file in a plan will be changed.

const (
	PlanFileEdit   PlanFileTag = "edit"
	PlanFileNew    PlanFileTag = "new"
	PlanFileDelete PlanFileTag = "delete"
)
type PlanGhost struct {
	ID          string   `json:"id,omitempty"`
	Step        int      `json:"step,omitempty"`
	X           float32  `json:"x"`
	Y           float32  `json:"y"`
	Width       float32  `json:"width"`
	Height      float32  `json:"height"`
	Radius      float32  `json:"radius,omitempty"`
	Label       string   `json:"label,omitempty"`
	ActiveLabel string   `json:"activeLabel,omitempty"`
	LabelX      *float32 `json:"labelX,omitempty"`
	LabelY      *float32 `json:"labelY,omitempty"`
	// RepeatField optionally names a PlanStepField.Key on the owning step so changing a count stepper
	// updates how many ghost boxes are drawn across SpanWidth (or stepped by StepX / StaggerY).
	RepeatField string  `json:"repeatField,omitempty"`
	SpanWidth   float32 `json:"spanWidth,omitempty"`
	StepX       float32 `json:"stepX,omitempty"`
	StaggerY    float32 `json:"staggerY,omitempty"`
	// ObjectID optionally links this ghost to a planned or existing scene object whose manual edits pause while running.
	ObjectID string `json:"objectId,omitempty"`
}

PlanGhost describes a planned rectangle or object ghost drawn in the 2D viewport for a plan step.

type PlanGhostOverride struct {
	Step        int         `json:"step"`
	GhostID     string      `json:"ghostId,omitempty"`
	X           *float32    `json:"x,omitempty"`
	Y           *float32    `json:"y,omitempty"`
	Width       *float32    `json:"width,omitempty"`
	Height      *float32    `json:"height,omitempty"`
	Label       string      `json:"label,omitempty"`
	LabelX      *float32    `json:"labelX,omitempty"`
	LabelY      *float32    `json:"labelY,omitempty"`
	ReplaceWith []PlanGhost `json:"replaceWith,omitempty"`
}

PlanGhostOverride adjusts or replaces planned viewport ghosts when a clarifying question option is selected.

type PlanOption struct {
	ID                 string              `json:"id"`
	Label              string              `json:"label"`
	Note               string              `json:"note,omitempty"`
	Suggested          bool                `json:"suggested,omitempty"`
	Preview            *PlanOptionPreview  `json:"preview,omitempty"`
	StepTitleOverrides map[int]string      `json:"stepTitleOverrides,omitempty"`
	GhostOverrides     []PlanGhostOverride `json:"ghostOverrides,omitempty"`
}

PlanOption is one selectable choice in a clarifying question on a proposed plan.

type PlanOptionPreview struct {
	// Kind selects the visual style: "room" (mini room sketch with gate & lever markers) or "strip" (timing/state bar).
	Kind             string             `json:"kind"`
	RoomSplitPercent float32            `json:"roomSplitPercent,omitempty"` // default 46
	GatePercent      float32            `json:"gatePercent,omitempty"`      // 0..100 horizontal position of gate marker
	LeverPercent     float32            `json:"leverPercent,omitempty"`     // 0..100 horizontal position of lever marker
	Segments         []PlanStripSegment `json:"segments,omitempty"`         // for kind == "strip"
}

PlanOptionPreview describes an optional visual thumbnail shown on a clarifying question option card.

type PlanPermissionSummary struct {
	Needed     bool
	EditsGo    bool
	RunsGame   bool
	FileCount  int
	AskReasons []string
	Reason     string
}

PlanPermissionSummary explains why a plan was requested based on the active permissions.yaml rules.

type PlanPhase string

PlanPhase is the lifecycle state of an agent-proposed plan.

const (
	// PlanPhaseNone indicates no plan is active.
	PlanPhaseNone PlanPhase = ""
	// PlanPhaseDraft indicates the agent proposed a plan and is waiting for the person to answer questions, edit steps, and approve.
	PlanPhaseDraft PlanPhase = "draft"
	// PlanPhaseRunning indicates the person approved (or chose Just do it) and the agent is executing steps.
	PlanPhaseRunning PlanPhase = "running"
	// PlanPhaseStopped indicates the person stopped the plan before completion.
	PlanPhaseStopped PlanPhase = "stopped"
	// PlanPhaseDone indicates the plan finished and its step checklist was attached to the turn's review.
	PlanPhaseDone PlanPhase = "done"
)
type PlanQuestion struct {
	ID         string       `json:"id"`
	Label      string       `json:"label,omitempty"`
	Prompt     string       `json:"prompt"`
	Options    []PlanOption `json:"options"`
	SelectedID string       `json:"selectedId,omitempty"`
}

PlanQuestion is a clarifying question the person answers before approving a plan.

func (q PlanQuestion) SelectedOption() (PlanOption, bool)

SelectedOption returns the currently chosen option, if answered.

func (q PlanQuestion) SuggestedOption() (PlanOption, bool)

SuggestedOption returns the option marked Suggested (falling back to an option noted "Suggested" or index 0).

type PlanReviewStep struct {
	Number  int            `json:"number"`
	ID      string         `json:"id"`
	Title   string         `json:"title"`
	Files   []string       `json:"files,omitempty"`
	Removed bool           `json:"removed,omitempty"`
	Status  PlanStepStatus `json:"status"`
	Note    string         `json:"note,omitempty"`
}

PlanReviewStep records one step of a plan inside an AgentTurn's review checklist.

type PlanStep struct {
	Number           int              `json:"number"`
	ID               string           `json:"id,omitempty"`
	Title            string           `json:"title"`
	Files            []string         `json:"files,omitempty"`
	FilesLabel       string           `json:"filesLabel,omitempty"`
	Adds             string           `json:"adds,omitempty"`
	Objects          int              `json:"objects,omitempty"`
	Permission       string           `json:"permission,omitempty"`
	PermissionAction PermissionAction `json:"permissionAction,omitempty"`
	PermissionTarget string           `json:"permissionTarget,omitempty"`
	Fields           []PlanStepField  `json:"fields,omitempty"`
	Note             string           `json:"note,omitempty"`
	NotePlaceholder  string           `json:"notePlaceholder,omitempty"`
	Removed          bool             `json:"removed,omitempty"`
	Status           PlanStepStatus   `json:"status,omitempty"`
	Ghosts           []PlanGhost      `json:"ghosts,omitempty"`
	Nodes            []PlanTreeNode   `json:"nodes,omitempty"`
}

PlanStep is one numbered step in an agent-proposed plan.

type PlanStepDecision struct {
	Number     int            `json:"number"`
	ID         string         `json:"id"`
	Title      string         `json:"title"`
	Files      []string       `json:"files,omitempty"`
	Adds       string         `json:"adds,omitempty"`
	Objects    int            `json:"objects,omitempty"`
	Permission string         `json:"permission,omitempty"`
	Removed    bool           `json:"removed,omitempty"`
	Fields     map[string]int `json:"fields,omitempty"`
	Note       string         `json:"note,omitempty"`
	Status     PlanStepStatus `json:"status,omitempty"`
}

PlanStepDecision records the finalized state of one step returned to the agent after approval or stop.

type PlanStepField struct {
	Key           string `json:"key"`
	Label         string `json:"label"`
	Value         int    `json:"value"`
	Min           int    `json:"min"`
	Max           int    `json:"max"`
	Step          int    `json:"step,omitempty"`
	Hint          string `json:"hint,omitempty"`
	CountsObjects bool   `json:"countsObjects,omitempty"`
}

PlanStepField is one editable numeric parameter on a plan step (rendered with - / value / + steppers and limits).

type PlanStepStatus string

PlanStepStatus tracks execution progress of one step in an active or reviewed plan.

const (
	PlanStepPending PlanStepStatus = "pending"
	PlanStepRunning PlanStepStatus = "running"
	PlanStepDone    PlanStepStatus = "done"
	PlanStepFailed  PlanStepStatus = "failed"
	PlanStepSkipped PlanStepStatus = "skipped"
)
type PlanStripSegment struct {
	From   float32 `json:"from"`   // 0..100 percentage
	To     float32 `json:"to"`     // 0..100 percentage
	Active bool    `json:"active"` // true = lit segment, false = recessed track
}

PlanStripSegment is one segment in a horizontal timing/state strip preview on a question option.

type PlanTreeNode struct {
	Name     string `json:"name"`
	Layer    string `json:"layer,omitempty"`
	Existing bool   `json:"existing,omitempty"`
	Step     int    `json:"step,omitempty"`
	ObjectID string `json:"objectId,omitempty"`
}

PlanTreeNode describes a planned node shown in the Scene Tree with a dashed marker and step badge, or an existing layer/object annotated with a step badge when Existing is true.

type PlayAgentStep struct {
	Text   string `json:"text"`
	Status string `json:"status"` // "done", "active", or "pending"
}

PlayAgentStep is one progress row displayed in the Play mode Agent tab while the agent inspects a replay.

type PlayInspectorTab int

PlayInspectorTab selects between the Inspector and Agent tabs in the right panel during Play mode.

const (
	// PlayTabInspector shows the normal or live remote entity inspector.
	PlayTabInspector PlayInspectorTab = iota
	// PlayTabAgent shows the Play mode Agent tab with MARKS · N and agent replay stepping progress.
	PlayTabAgent
)
type PlayLiveEntityState struct {
	ID         string         `json:"id"`
	Name       string         `json:"name,omitempty"`
	Layer      string         `json:"layer,omitempty"`
	X          float32        `json:"x"`
	Y          float32        `json:"y"`
	Components map[string]any `json:"components,omitempty"`
	Properties map[string]any `json:"properties,omitempty"`
}

PlayLiveEntityState captures a live scene entity's runtime transform and components at a frozen frame.

type PlayMark struct {
	ID         int       `json:"id"`
	Frame      int       `json:"frame"`
	Seconds    float64   `json:"seconds"`
	TimeLabel  string    `json:"timeLabel"`
	ReplayPath string    `json:"replayPath"`
	AbsPath    string    `json:"absPath,omitempty"`
	Scene      string    `json:"scene,omitempty"`
	CreatedAt  time.Time `json:"createdAt"`
	Sent       bool      `json:"sent,omitempty"`
}

PlayMark records one moment marked during Play mode (⌥F / AddPlayMark) with its saved input recording.

type PlayMarksThread struct {
	Scene     string     `json:"scene,omitempty"`
	Marks     []PlayMark `json:"marks"`
	Summary   string     `json:"summary"`
	CreatedAt time.Time  `json:"createdAt"`
}

PlayMarksThread bundles all unsent marks from a Play session into one thread sent to the agent.

type PlayTaskDotState struct {
	// Visible reports whether any attention-needing task (failed, waiting, or ready to review) exists.
	Visible bool
	// UrgentState is the highest-urgency active state (TaskFailed > TaskNeedsYou > TaskReadyToReview).
	UrgentState TaskState
	// UrgentCount is the number of tasks in UrgentState.
	UrgentCount int
	// AriaLabel is the accessible label for the corner dot (for example "1 task needs you").
	AriaLabel string
	// HoverLabel is the tooltip pill shown only on hover or keyboard focus
	// (for example "1 task needs you · stop Play to open").
	HoverLabel string
}

PlayTaskDotState describes the single corner dot shown during Play mode (docs/design/editor/Tasks.dc.html: "Nothing pops over a running game. One dot in the corner, in the color of the most urgent state; the label shows only on hover.").

func (d PlayTaskDotState) Color(p SpecPalette) core.Color

Color returns the Spec token color for the dot's most urgent state (never raw hex).

type PlaytestChartKind string

PlaytestChartKind identifies which single chart visualization the Playtest Report screen renders for a report.

const (
	// PlaytestChartHeatMap renders a spatial heat map (deaths or time per tile) over the level.
	PlaytestChartHeatMap PlaytestChartKind = "heat"
	// PlaytestChartBars renders labeled vertical bars per wave/bucket against an optional dashed goal line.
	PlaytestChartBars PlaytestChartKind = "bars"
	// PlaytestChartLine renders a per-level line progression chart highlighting dips, spikes or flagged levels.
	PlaytestChartLine PlaytestChartKind = "line"
	// PlaytestChartMatrix renders a row-vs-column win-rate matrix with cells above the threshold (default 60%) flagged.
	PlaytestChartMatrix PlaytestChartKind = "matrix"
)
func (k PlaytestChartKind) String() string

String returns a human-readable name for the chart kind.

type PlaytestChartSpec struct {
	Kind     PlaytestChartKind
	Title    string
	Subtitle string
	HeatMap  *PlaytestHeatChart
	Bars     *PlaytestSeriesChart
	Line     *PlaytestSeriesChart
	Matrix   *PlaytestMatrixChart
}

PlaytestChartSpec is the single chart selected for a playtest report.

func SelectPlaytestChart(rep *playtest.Report) PlaytestChartSpec

SelectPlaytestChart chooses the single best chart visualization for rep from its metrics and data:

  1. Win-rate matrix (PlaytestChartMatrix) when Matrices is non-empty,
  2. Spatial level heat map (PlaytestChartHeatMap) when HeatMaps is non-empty,
  3. Bars per wave against a goal line (PlaytestChartBars) or line per level (PlaytestChartLine) when Series is non-empty,
  4. Fallback to positioned run events (heat map) or per-run progression (line).
type PlaytestHeatChart struct {
	Metric        string
	Event         string
	IsTimePerTile bool
	Points        []playtest.HeatPoint
	Clusters      []PlaytestHeatCluster
	Chips         []PlaytestHeatChip
	MinX, MaxX    float64
	MinY, MaxY    float64
}

PlaytestHeatChart holds the spatial data rendered by PlaytestChartHeatMap.

type PlaytestHeatChip struct {
	X       float64
	Y       float64
	Text    string
	Problem bool
}

PlaytestHeatChip is a concise pill annotation placed over a notable cluster on the level heat map.

type PlaytestHeatCluster struct {
	X       float64
	Y       float64
	Count   int
	Share   float64 // 0..1 share of total points
	Tag     string
	Problem bool
}

PlaytestHeatCluster is a clustered density hotspot drawn as a radial heat blob on the level heat map.

type PlaytestMatrixChart struct {
	Name      string
	Unit      string
	FlagAbove float64
	Labels    []string
	Cells     [][]*float64
	Caption   string
}

PlaytestMatrixChart holds the grid data rendered by PlaytestChartMatrix.

type PlaytestMetricCard struct {
	Name      string
	Label     string
	ValueText string
	Foot      string
	GoalText  string
	Source    string
	Status    string // "met", "missed", or "info"
	Badge     string // "Met", "Missed", or "Info"
	Met       bool
	Missed    bool
}

PlaytestMetricCard is one summary card rendered in the top grid of the Playtest Report screen.

func BuildPlaytestMetricCards(rep *playtest.Report) []PlaytestMetricCard

BuildPlaytestMetricCards converts report.Metrics into display-ready metric cards with Met/Missed badges, foot lines, goals, and source files.

type PlaytestPromptRequest struct {
	Kind            string   `json:"kind"` // "tune" or "suggestion"
	Prompt          string   `json:"prompt"`
	Project         string   `json:"project,omitempty"`
	Scope           string   `json:"scope,omitempty"`
	ReportPath      string   `json:"reportPath,omitempty"`
	ConfigPath      string   `json:"configPath,omitempty"`
	SuggestionID    string   `json:"suggestionId,omitempty"`
	SuggestionIndex int      `json:"suggestionIndex,omitempty"`
	MissedMetrics   []string `json:"missedMetrics,omitempty"`
}

PlaytestPromptRequest captures a tuning or suggestion request sent from the Playtest Report screen to the agent.

type PlaytestProposal struct {
	ID          string       `json:"id"`
	File        string       `json:"file"`
	MetricName  string       `json:"metricName"`
	MetricLabel string       `json:"metricLabel,omitempty"`
	Rationale   string       `json:"rationale,omitempty"`
	Summary     string       `json:"summary,omitempty"`
	Replace     bool         `json:"replace,omitempty"`
	Before      string       `json:"before,omitempty"`
	After       string       `json:"after,omitempty"`
	Diff        string       `json:"diff,omitempty"`
	Status      string       `json:"status"` // "pending", "applied", "dismissed"
	ApplyFunc   func() error `json:"-"`
	DismissFunc func() error `json:"-"`
}

PlaytestProposal represents a metric proposed by the agent with playtest_define awaiting a person's review.

func (p PlaytestProposal) BannerText() string

BannerText formats the single-line summary shown in the BOT PROFILE proposal banner.

type PlaytestReportEntry struct {
	ID            string
	Report        *playtest.Report
	ReportPath    string
	ConfigPath    string
	BaseDir       string
	RunsSummary   string
	WatchRunIndex int
	WatchLabel    string
	AgentRead     string
	Suggestions   []PlaytestSuggestion
	Cards         []PlaytestMetricCard
	Chart         PlaytestChartSpec
}

PlaytestReportEntry holds one loaded report and its derived UI view-model.

type PlaytestReportOpenConfig struct {
	// Report is the validated playtest.Report to display (required unless Entries is non-empty).
	Report *playtest.Report
	// ReportPath is the slash-separated path to the report file relative to the project root (or absolute path).
	ReportPath string
	// ConfigPath is the slash-separated path to playtest.yaml (defaults to "playtest.yaml").
	ConfigPath string
	// BaseDir is the base directory used to resolve relative recording paths and playtest.yaml when no project is open.
	BaseDir string
	// RunsSummary optionally overrides the formatted runs summary in the header.
	RunsSummary string
	// WatchRunIndex optionally selects which 1-based run Watch run N opens (0 chooses automatically).
	WatchRunIndex int
	// WatchLabel optionally overrides the Watch button label (e.g. "Watch match 38").
	WatchLabel string
	// AgentRead optionally overrides the synthesized Agent's read summary paragraph.
	AgentRead string
	// Suggestions optionally overrides the synthesized actionable suggestions list.
	Suggestions []string
	// Proposals optionally seeds pending playtest_define metric proposals for the session.
	Proposals []PlaytestProposal
	// AdditionalEntries optionally attaches extra reports so the BOT PROFILE strip can switch between multiple reports.
	AdditionalEntries []PlaytestReportOpenConfig
}

PlaytestReportOpenConfig supplies a playtest.Report and optional presentation metadata to OpenPlaytestReport / LoadPlaytestReport.

type PlaytestReportSession struct {
	Entries           []*PlaytestReportEntry
	ActiveIndex       int
	Proposals         []PlaytestProposal
	ReviewProposalID  string
	ConfigPreviewOpen bool
	ConfigPreviewPath string
	ConfigPreviewText string
	ConfigPreviewErr  string
	LastPrompt        PlaytestPromptRequest
	Notice            string
}

PlaytestReportSession holds the state of the Editor's Playtest Report screen.

func (s *PlaytestReportSession) ActiveEntry() *PlaytestReportEntry

ActiveEntry returns the currently displayed report entry, or nil when none is loaded.

func (s *PlaytestReportSession) FirstPendingProposal() *PlaytestProposal

FirstPendingProposal returns the first pending playtest_define proposal, if any.

func (s *PlaytestReportSession) ProposalByID(id string) *PlaytestProposal

ProposalByID returns the proposal with ID id, or nil.

type PlaytestSeriesChart struct {
	Name       string
	Unit       string
	Entries    []playtest.SeriesEntry
	TargetMax  *float64
	TargetText string
	MaxVal     float64
	Decimals   int
}

PlaytestSeriesChart holds the bucketed data rendered by PlaytestChartBars or PlaytestChartLine.

type PlaytestSuggestion struct {
	ID           string `json:"id"`
	Text         string `json:"text"`
	Requested    bool   `json:"requested,omitempty"`
	ReviewStatus string `json:"reviewStatus,omitempty"` // "", "requested", "pending_review", "applied"
}

PlaytestSuggestion is one actionable tuning suggestion under Agent's read.

func DefaultPlaytestAgentRead(rep *playtest.Report) (string, []PlaytestSuggestion)

DefaultPlaytestAgentRead synthesizes a concise multi-sentence diagnostic read and actionable suggestions from rep.

type Plugin struct {
	// Name identifies the plugin in game.yaml; it is unique among the editor's plugins and has no spaces or control characters.
	Name string
	// Panels are docked around the viewport while the plugin is on.
	Panels []Panel
	// Inspectors replace the inspector's generic fields of the components they name.
	Inspectors []Inspector
	// Tools are added to the 2D and/or 3D viewport's tool bar according to which hooks they set.
	Tools []PluginTool
	// Gizmos3D register 3D viewport handles and drag editors per component type while the plugin is on.
	Gizmos3D []ComponentGizmo3D
	// Overlays are custom 2D viewport overlays added to the Overlays popover and editormcp's viewport_image tool while the plugin is on.
	Overlays []ViewportOverlay
	// Commands are added to the editor's command registry, desktop menu bar, command palette, and keyboard shortcuts while the plugin is on.
	Commands []PluginCommand
	// Catalog optionally supplies localized strings for this plugin (for example English and Simplified Chinese) resolved in the editor's active language via Editor.PluginT, Editor.PluginPlural, and panel/tool/command TitleKey/LabelKey fields.
	Catalog *l10n.Catalog
	// LocaleYAML optionally supplies versioned l10n YAML string table documents (such as embedded locales/*.yaml files) merged into the plugin's localization catalog at RegisterPlugin time.
	LocaleYAML [][]byte
	// contains filtered or unexported fields
}

Plugin extends the scene editor with panels, component inspectors and viewport tools, as Godot's EditorPlugin does. Go has no portable way to load code at run time, so a plugin is Go code built into the editor binary: the binary registers it with Editor.RegisterPlugin, and a project turns it on by naming it under editor.plugins in its game.yaml (project.Editor). A registered plugin the open project does not name stays off.

A plugin changes the scene only through the editor's methods, such as SetComponentField and MoveObject, or by executing its own Command on Editor.History, so every edit it makes can be undone.

type PluginCommand struct {
	// ID identifies the command within its plugin (registered globally as "plugin.<plugin>.<id>") and has no spaces or control characters.
	ID string
	// Label is the display name shown in the command palette and menu bar.
	Label string
	// LabelKey is an optional localization key in the plugin's catalog used in place of Label when present.
	LabelKey string
	// Description is optional explanatory text shown in the command palette.
	Description string
	// DescriptionKey is an optional localization key in the plugin's catalog used in place of Description when present.
	DescriptionKey string
	// Category groups the command in the command palette (defaults to the plugin's name when empty).
	Category string
	// CategoryKey is an optional localization key in the plugin's catalog used in place of Category when present.
	CategoryKey string
	// Keywords are extra search terms matched by the command palette.
	Keywords []string
	// Scope names the keyboard scope for shortcut conflict checks (for example ScopeGlobal, ScopeViewport, ScopeTile, ScopeViewport3D). Empty defaults to ScopeGlobal.
	Scope string
	// Shortcut is an optional NSGo key shortcut (such as "mod+shift+h" or "alt+h"). Clashing with any built-in, custom, or other registered plugin shortcut is refused at RegisterPlugin time.
	Shortcut string
	// Enabled, when set, reports whether the command can run right now; nil means always enabled.
	Enabled func(ed *Editor) bool
	// Run executes the command.
	Run func(ed *Editor) error
}

PluginCommand is a command a plugin adds to the editor's command registry, command palette, desktop menu bar, and optional keyboard shortcut.

type PluginTool struct {
	// ID identifies the tool within its plugin and has no control characters; its tool bar button has the test ID "tool-<plugin>-<id>", which can collide as Panel.ID's can.
	ID string
	// Label is the tool's button text and its name in the status bar.
	Label string
	// LabelKey is an optional localization key in the plugin's catalog used in place of Label when present.
	LabelKey string
	// Press, when set, handles a press at canvas coordinates (x, y), which go through the editor's 2D view (View2D) rather than the scene camera: Editor.CanvasToWorld converts them to world coordinates for a world-space layer, and Editor.CanvasToScreen to the scene's screen coordinates for a screen-space layer. It is not called while playing. At least one of Press, OnDragBegin, Press3D, or OnDragBegin3D must be set.
	Press func(ed *Editor, x, y float32)
	// Draw, when set, draws over the scene in canvas coordinates while the tool is active and the editor is not playing. Canvas coordinates follow the 2D view: Editor.WorldToCanvas places a world point and Editor.ScreenToCanvas a screen-space layer's point.
	Draw func(ed *Editor, d *core.Drawing)
	// OnDragBegin, when set, is called when a primary drag begins at canvas coordinates (x, y) while the tool is active in 2D edit mode. Returning true claims the drag so subsequent motion calls OnDragMove and release calls OnDragEnd (or OnDragCancel if cancelled).
	OnDragBegin func(ed *Editor, x, y float32) bool
	// OnDragMove, when set, is called as a claimed drag moves to canvas coordinates (x, y).
	OnDragMove func(ed *Editor, x, y float32)
	// OnDragEnd, when set, is called when a claimed drag finishes at canvas coordinates (x, y).
	OnDragEnd func(ed *Editor, x, y float32)
	// OnDragCancel, when set, is called when a claimed drag is cancelled by Escape, a cancelled gesture, a second finger, Play, Undo/Redo, Save, or changing tools, view mode or scene.
	OnDragCancel func(ed *Editor)
	// OnHover, when set, is called as the pointer moves across the 2D viewport at canvas coordinates (x, y) while the tool is active in edit mode, and with active=false when the pointer leaves the viewport or the tool becomes inactive.
	OnHover func(ed *Editor, x, y float32, active bool)
	// Press3D, when set, handles a press in the 3D viewport with the world-space pick ray from the editor's 3D camera. Not called while playing.
	Press3D func(ed *Editor, ray math3d.Ray)
	// Draw3D, when set, draws over the 3D viewport while the tool is active in 3D edit mode using proj's camera projection and helpers.
	Draw3D func(ed *Editor, d *core.Drawing, proj Projection3D)
	// OnDragBegin3D, when set, is called when a primary drag begins in the 3D viewport with the pick ray. Returning true claims the drag so subsequent motion calls OnDragMove3D and release calls OnDragEnd3D (or OnDragCancel3D if cancelled), instead of orbiting the camera.
	OnDragBegin3D func(ed *Editor, ray math3d.Ray) bool
	// OnDragMove3D, when set, is called as a claimed 3D drag moves with the updated pick ray.
	OnDragMove3D func(ed *Editor, ray math3d.Ray)
	// OnDragEnd3D, when set, is called when a claimed 3D drag finishes with the final pick ray.
	OnDragEnd3D func(ed *Editor, ray math3d.Ray)
	// OnDragCancel3D, when set, is called when a claimed 3D drag is cancelled by Escape, a cancelled gesture, a second finger, Play, Undo/Redo, Save, or changing tools, view mode or scene.
	OnDragCancel3D func(ed *Editor)
	// OnHover3D, when set, is called as the pointer moves across the 3D viewport with the pick ray while the tool is active in 3D edit mode, and with active=false when the pointer leaves the viewport or the tool becomes inactive.
	OnHover3D func(ed *Editor, ray math3d.Ray, active bool)
}

PluginTool is a 2D and/or 3D viewport tool a plugin adds. While it is the active tool (Editor.SetPluginTool), in 2D a press calls Press, drags call OnDragBegin/OnDragMove/OnDragEnd/OnDragCancel, pointer motion calls OnHover, and Draw draws over the scene in edit mode; in 3D a press calls Press3D with the camera's pick ray, drags call OnDragBegin3D/OnDragMove3D/OnDragEnd3D/OnDragCancel3D, pointer motion calls OnHover3D, and Draw3D draws over the 3D view with the camera's Projection3D.

type Prefab struct {
	Name       string
	Sprite     *sceneformat.SpriteRef
	PosZ       float32
	OriginX    float32
	OriginY    float32
	RotX       float32
	RotY       float32
	RotZ       float32
	ScaleX     *float32
	ScaleY     *float32
	ScaleZ     *float32
	Depth      float32
	Mesh       string
	FlipX      bool
	FlipY      bool
	Alpha      *float32
	Z          int
	Components map[string]any
	Properties map[string]any
}

Prefab is a reusable object template that PlaceObject and PlacePrefab can instantiate.

type PrivacyContentKind string

PrivacyContentKind identifies one of the four outbound content categories controlled under Settings › Usage and privacy ("WHAT MAY LEAVE THIS COMPUTER").

const (
	// PrivacySceneAndData covers scene, prefab, data table, tileset, state machine, cutscene, and project YAML/text files.
	PrivacySceneAndData PrivacyContentKind = "scene_and_data"
	// PrivacyViewportImages covers PNG viewport captures and frozen play-mode frame images.
	PrivacyViewportImages PrivacyContentKind = "viewport_images"
	// PrivacyGoSource covers Go source code and Go module/workspace files (.go, go.mod, go.sum, go.work).
	PrivacyGoSource PrivacyContentKind = "go_source"
	// PrivacyArtAndAudio covers images, audio files, 3D models, fonts, atlases, materials, particles, rigs, and import sidecars.
	PrivacyArtAndAudio PrivacyContentKind = "art_and_audio"
)
func ClassifyProjectFilePrivacy(relPath string) PrivacyContentKind

ClassifyProjectFilePrivacy classifies a project-relative file path into one of the four outbound privacy content categories controlled under Settings › Usage and privacy.

func (k PrivacyContentKind) DisplayName() string

DisplayName returns the human-readable Settings label for k.

type ProblemDiffLine struct {
	Kind string `json:"kind"` // "removed", "added", or "context"
	Line int    `json:"line,omitempty"`
	Text string `json:"text"`
}

ProblemDiffLine is one line of the before/after YAML diff shown on a proposed fix card.

type ProblemFixEdit struct {
	// Kind selects the edit operation (update_connection, remove_connection,
	// set_sprite, set_material, set_object_id, set_component_field,
	// remove_component, or replace_line).
	Kind string `json:"kind"`
	// File is the slash-separated project path to edit; defaults to Problem.File.
	File string `json:"file,omitempty"`

	// Connection edit fields (update_connection, remove_connection).
	ConnectionIndex int            `json:"connectionIndex,omitempty"`
	From            string         `json:"from,omitempty"`
	Event           string         `json:"event,omitempty"`
	To              string         `json:"to,omitempty"`
	Handler         string         `json:"handler,omitempty"`
	Once            *bool          `json:"once,omitempty"`
	Args            map[string]any `json:"args,omitempty"`

	// Object/component edit fields.
	ObjectID  string `json:"objectId,omitempty"`
	NewID     string `json:"newId,omitempty"`
	Atlas     string `json:"atlas,omitempty"`
	Frame     string `json:"frame,omitempty"`
	Component string `json:"component,omitempty"`
	Field     string `json:"field,omitempty"`
	Value     any    `json:"value,omitempty"`

	// Line-level YAML replacement (replace_line), validated against sceneformat.
	Line        int    `json:"line,omitempty"`
	OldText     string `json:"oldText,omitempty"`
	Replacement string `json:"replacement,omitempty"`
}

ProblemFixEdit describes one structured edit inside an agent's proposed fix for a problem. Proposals are validated on a cloned document without mutating the editor or disk; only ApplyProposedFix applies them as one undoable step.

type ProblemQuestionRecord struct {
	Problem  assetcheck.Problem
	Question string
	ObjectID string
}

ProblemQuestionRecord stores a submitted "Ask about this problem…" question shown in the Agent problem panel.

type ProblemQuestionRequest struct {
	Problem  assetcheck.Problem
	Question string
	ObjectID string
	Fix      *ProposedProblemFix
}

ProblemQuestionRequest is delivered to Editor.OnAskAboutProblem when the person submits a question from "Ask about this problem…" with the problem attached.

type ProfilerClient interface {
	CallTool(ctx context.Context, name string, args json.RawMessage) (json.RawMessage, error)
	Close() error
}

ProfilerClient invokes a running game's MCP performance tools (game_perf_readout, game_perf_zones, game_perf_reset). Implementations must be safe to Close more than once.

func ConnectProfilerCommand(ctx context.Context, dir string, args ...string) (ProfilerClient, error)

ConnectProfilerCommand connects to the running game in dir by launching `go tool nsgo mcp` (or custom args when provided) over an MCP stdio CommandTransport.

func ConnectProfilerMCP(ctx context.Context, transport sdkmcp.Transport) (ProfilerClient, error)

ConnectProfilerMCP connects to a running game's MCP server over transport using the official MCP Go SDK. Use it with &sdkmcp.CommandTransport{Command: ...}, &sdkmcp.IOTransport{...}, or sdkmcp.NewInMemoryTransports().

func ConnectProfilerScope(cx *core.Scope) ProfilerClient

ConnectProfilerScope returns a ProfilerClient that calls game_perf_* tools registered on cx via github.com/nsgo-dev/nsgo/automation. Call PollProfiler on cx's graph goroutine when invoking manually; background polling dispatches automatically onto cx.

func NewBridgeProfilerClient(b *mcp.Bridge) ProfilerClient

NewBridgeProfilerClient returns a ProfilerClient backed directly by b's tool handlers without registering tools on a core.Scope.

type ProfilerFrame struct {
	Timestamp          time.Time
	FrameMs            float64
	UpdateMs           float64
	DrawMs             float64
	FPS                float64
	AllocsPerFrame     float64
	AllocBytesPerFrame float64
	HeapBytes          uint64
	GCCount            uint64
	GCLastPauseMs      float64
	GCMaxPauseMs       float64
	GCRecentHitches    int
	GCHitch            bool
	AssetMemoryBytes   int64
	AssetMemoryBudget  int64
	AssetOverBudget    bool
	Cause              string
	Zones              []mcp.PerfZoneInfo
}

ProfilerFrame is one chronological sample recorded by the editor's profiler from game_perf_readout and game_perf_zones.

type ProfilerMetric int

ProfilerMetric selects which time-series chart is shown in the full Profiler panel.

const (
	// ProfilerMetricFrame charts total frame, update, and draw times in milliseconds.
	ProfilerMetricFrame ProfilerMetric = iota
	// ProfilerMetricFPS charts frames per second over time.
	ProfilerMetricFPS
	// ProfilerMetricAllocsGC charts allocations per frame, live heap bytes, and GC hitches over time.
	ProfilerMetricAllocsGC
	// ProfilerMetricMemory charts tracked asset memory against budgets over time.
	ProfilerMetricMemory
)
func (m ProfilerMetric) String() string

String returns the human-readable label for m.

type ProfilerSnapshot struct {
	Connected      bool
	InEditorPlay   bool
	SourceLabel    string
	Open           bool
	Metric         ProfilerMetric
	HasReadout     bool
	Readout        mcp.PerfReadoutResult
	Zones          []mcp.PerfZoneInfo
	Recording      bool
	RecordedFrames int
	Frames         []ProfilerFrame
	Spike          *ProfilerSpike
	LastError      string
}

ProfilerSnapshot is an immutable snapshot of the editor's profiler state for UI rendering and tests.

type ProfilerSpike struct {
	// FrameIndex is the index into ProfilerSnapshot.Frames.
	FrameIndex int
	// BarIndex is the index within the visible strip bars (0 .. profilerStripBars-1).
	BarIndex int
	// PositionFrac is the horizontal fraction [0, 1] of the spike bar across the strip chart.
	PositionFrac float64
	// FrameMs is the spike frame duration in milliseconds.
	FrameMs float64
	// Cause is the game-supplied spike explanation or "GC pause" when known, or empty.
	Cause string
	// Label is the formatted callout pill text, such as "18.2 ms · first use of torch_glow compiled its shader".
	Label string
}

ProfilerSpike describes the most prominent frame-time spike in the 60 s strip window.

type ProjectFile struct {
	// Path is the slash-separated path from the project root.
	Path string
	// Dir reports whether Path is a directory.
	Dir bool
}

ProjectFile is a file or directory of the open project, as the file browser lists it.

type ProjectSettingsSection string

ProjectSettingsSection identifies a category tab in the Project Settings panel.

const (
	ProjectSectionGeneral  ProjectSettingsSection = "general"
	ProjectSectionWindow   ProjectSettingsSection = "window"
	ProjectSectionDisplay  ProjectSettingsSection = "display"
	ProjectSectionPhysics  ProjectSettingsSection = "physics"
	ProjectSectionAutoload ProjectSettingsSection = "autoload"
	ProjectSectionPlugins  ProjectSettingsSection = "plugins"
)
type ProjectTemplate struct {
	// Name is the template identifier passed to `game new -template` (such as "starter").
	Name string
	// Title is the human-readable card title; derived from Name when empty.
	Title string
	// Summary is the one-line description shown on the template card.
	Summary string
	// Dimension classifies the template for Start Screen filter chips: "2d" or "3d" (inferred when empty).
	Dimension string
	// Default marks the template selected initially.
	Default bool
}

ProjectTemplate describes one project template offered on the editor's Start Screen, populated dynamically from `game new`'s template registry.

func (t ProjectTemplate) DisplayTitle() string

DisplayTitle returns Title when set, or a readable title derived from Name.

func (t ProjectTemplate) EffectiveDimension() string

EffectiveDimension returns "3d" or "2d" for Start Screen template filtering.

type Projection3D struct {
	Camera OrbitCamera3D
	Width  float32
	Height float32
	// ViewProj is the right-handed Y-up [0, 1] NDC view-projection matrix for Camera at Width x Height.
	ViewProj math3d.Mat4
	// contains filtered or unexported fields
}

Projection3D carries the 3D viewport's camera projection and world-to-screen drawing helpers for a single frame of size Width x Height in viewport points.

func (p Projection3D) DrawBox(d *core.Drawing, center, size math3d.Vec3, mat math3d.Mat4, color core.Color, width float32)

DrawBox draws a wireframe 3D box centered at center with full extents size, transformed by mat (use math3d.Mat4Identity() when center and size are already in world space).

func (p Projection3D) DrawLine(d *core.Drawing, a, b math3d.Vec3, color core.Color, width float32)

DrawLine draws a near-clipped world-space 3D segment from a to b.

func (p Projection3D) DrawPoint(d *core.Drawing, world math3d.Vec3, radius float32, fill core.Color)

DrawPoint draws a filled screen-space circular marker at the projection of world.

func (p Projection3D) GizmoLength(world math3d.Vec3) float32

GizmoLength returns a camera-distance-scaled world length suitable for 3D handles placed at world.

func (p Projection3D) Project(world math3d.Vec3) (sx, sy, depth float32, visible bool)

Project transforms a world-space 3D point into viewport pixel coordinates (sx, sy) and camera depth. visible is true when the point lies strictly between Near and Far in front of the camera.

func (p Projection3D) ProjectSegment(a, b math3d.Vec3) (x0, y0, x1, y1 float32, visible bool)

ProjectSegment clips a world-space 3D segment against the camera's near plane and projects both endpoints to viewport pixel coordinates.

func (p Projection3D) ScreenRay(sx, sy float32) math3d.Ray

ScreenRay returns the world-space pick ray passing through viewport pixel (sx, sy).

type ProposedDeletion struct {
	ID             string                 `json:"id"`
	Path           string                 `json:"path"`
	AbsPath        string                 `json:"-"`
	LineCount      int                    `json:"lineCount"`
	SceneUsages    []string               `json:"sceneUsages,omitempty"`
	UsedByAnyScene bool                   `json:"usedByAnyScene"`
	UsageSummary   string                 `json:"usageSummary"`
	Detail         string                 `json:"detail"`
	PreviewLines   []string               `json:"previewLines,omitempty"`
	MoreLines      int                    `json:"moreLines,omitempty"`
	Reason         string                 `json:"reason,omitempty"`
	Status         ProposedDeletionStatus `json:"status"`
}

ProposedDeletion describes one file deletion proposed by the agent (e.g. via game_delete_file). Keep all never applies a pending deletion; it requires explicit per-file confirmation, and ⌘Z restores the file from its checkpoint.

type ProposedDeletionStatus string

ProposedDeletionStatus tracks the person's explicit decision on a proposed file deletion.

const (
	// DeletionPending means the deletion has not been confirmed yet; Keep all NEVER applies it.
	DeletionPending ProposedDeletionStatus = "pending"
	// DeletionConfirmed means the person explicitly clicked "Delete this file" while other review items remain.
	DeletionConfirmed ProposedDeletionStatus = "confirmed"
	// DeletionKept means the person explicitly clicked "Keep the file".
	DeletionKept ProposedDeletionStatus = "kept"
	// DeletionApplied means the file was deleted from disk via a reversible checkpoint command (⌘Z restores it).
	DeletionApplied ProposedDeletionStatus = "applied"
)
type ProposedProblemFix struct {
	ID          string             `json:"id"`
	Problem     assetcheck.Problem `json:"problem"`
	Explanation string             `json:"explanation"`
	Edit        ProblemFixEdit     `json:"edit"`
	Diff        []ProblemDiffLine  `json:"diff"`
	ObjectID    string             `json:"objectId,omitempty"`
	Summary     string             `json:"summary,omitempty"`
	// contains filtered or unexported fields
}

ProposedProblemFix is a fix proposed by an agent (for example via MCP problem_propose_fix) for a live problem. Creating a proposal never mutates any document or file; only ApplyProposedFix applies it as one undoable step.

type PublishDestination string

PublishDestination identifies a supported store upload destination on the Build and Release screen.

const (
	// PublishDestItchIO publishes desktop or web packages to itch.io.
	PublishDestItchIO PublishDestination = "itch.io"
	// PublishDestGooglePlay publishes Android App Bundles (.aab) to Google Play internal testing.
	PublishDestGooglePlay PublishDestination = "google_play_internal"
	// PublishDestTestFlight publishes iOS builds (.ipa) to Apple TestFlight.
	PublishDestTestFlight PublishDestination = "testflight"
)
func AllPublishDestinations() []PublishDestination

AllPublishDestinations returns every supported store upload destination in display order.

func DefaultPublishDestinationForPlatform(platform string) (PublishDestination, string)

DefaultPublishDestinationForPlatform returns the default store destination and track label for platform.

func (d PublishDestination) DisplayName() string

DisplayName returns the user-facing store destination label shown in Review uploads.

func (d PublishDestination) Valid() bool

Valid reports whether d is a recognized PublishDestination.

type RecentProject struct {
	// Name is the project's display name (from game.yaml or its folder name).
	Name string `yaml:"name"`
	// Path is the absolute path to the project directory.
	Path string `yaml:"path"`
	// LastOpened is the RFC3339 UTC timestamp when the project was last opened.
	LastOpened string `yaml:"lastOpened"`
}

RecentProject records one project opened in the editor.

type RecentProjectEntry struct {
	RecentProject
	// Missing reports whether the project directory or its game.yaml no longer exists on disk.
	Missing bool
}

RecentProjectEntry pairs a persisted RecentProject with whether its project folder is missing on disk.

type RecentProjectsFile struct {
	// Version is the schema version; it must equal RecentProjectsVersion (1).
	Version int `yaml:"version"`
	// Projects lists recently opened projects, most recently opened first.
	Projects []RecentProject `yaml:"projects,omitempty"`
}

RecentProjectsFile is the strict versioned YAML document storing projects recently opened by a user outside any project directory.

func LoadRecentProjectsFile(path string) (*RecentProjectsFile, error)

LoadRecentProjectsFile reads and parses the recent projects YAML file at path. When the file does not exist, it returns an empty version 1 RecentProjectsFile and a nil error.

func ParseRecentProjects(data []byte) (*RecentProjectsFile, error)

ParseRecentProjects strictly decodes and validates a versioned recent-projects YAML document, refusing unknown fields, duplicate keys, trailing YAML documents, and unsupported versions.

type RectHandle int

RectHandle names an interactive handle on a world-space axis-aligned rectangle in the 2D viewport, shared by camera.bounds and room-map rectangles.

const (
	// RectHandleNone means no handle was hit.
	RectHandleNone RectHandle = iota
	// RectHandleBody moves the entire rectangle without changing its size.
	RectHandleBody
	// RectHandleN resizes the top (-Y) edge.
	RectHandleN
	// RectHandleE resizes the right (+X) edge.
	RectHandleE
	// RectHandleS resizes the bottom (+Y) edge.
	RectHandleS
	// RectHandleW resizes the left (-X) edge.
	RectHandleW
	// RectHandleNE resizes the top-right corner.
	RectHandleNE
	// RectHandleSE resizes the bottom-right corner.
	RectHandleSE
	// RectHandleSW resizes the bottom-left corner.
	RectHandleSW
	// RectHandleNW resizes the top-left corner.
	RectHandleNW
)
func (h RectHandle) IsResize() bool

IsResize reports whether h is one of the 8 edge or corner resize handles.

func (h RectHandle) String() string

String returns a human-readable label for h.

type ReferencesScreenMode string

ReferencesScreenMode selects which workflow stage the full-window References screen displays.

const (
	// ReferencesModeUsages lists grouped usages of a prefab, scene, or project file.
	ReferencesModeUsages ReferencesScreenMode = "usages"
	// ReferencesModeRename previews a safe YAML-only rename with exact line diffs and non-rewritten warnings.
	ReferencesModeRename ReferencesScreenMode = "rename"
	// ReferencesModeDone displays the post-rename summary with one-step Undo and Back to the scene.
	ReferencesModeDone ReferencesScreenMode = "done"
)
type ReferencesScreenState struct {
	Open            bool                 `json:"open"`
	Mode            ReferencesScreenMode `json:"mode"`
	Target          string               `json:"target"`
	SourceObjectID  string               `json:"sourceObjectId,omitempty"`
	ReturnSceneName string               `json:"returnSceneName,omitempty"`
	Report          *UsagesReport        `json:"report,omitempty"`
	FocusedFile     string               `json:"focusedFile,omitempty"`
	FocusedRefIdx   int                  `json:"focusedRefIdx"`
	RenameInput     string               `json:"renameInput,omitempty"`
	FolderPrefix    string               `json:"folderPrefix,omitempty"`
	OldStem         string               `json:"oldStem,omitempty"`
	Suffix          string               `json:"suffix,omitempty"`
	Plan            *SafeRenamePlan      `json:"plan,omitempty"`
	AppliedFrom     string               `json:"appliedFrom,omitempty"`
	AppliedTo       string               `json:"appliedTo,omitempty"`
	AppliedFiles    int                  `json:"appliedFiles,omitempty"`
	CheckProblems   []SafeRenameProblem  `json:"checkProblems,omitempty"`
	AskSentFiles    map[string]bool      `json:"askSentFiles,omitempty"`
}

ReferencesScreenState is a read-only snapshot of the full-window Find Usages and Safe Rename screen.

type ReleaseNotesDraft struct {
	Markdown   string `json:"markdown"`
	Provenance string `json:"provenance"`
}

ReleaseNotesDraft is the player-facing Markdown and provenance badge produced for RELEASE NOTES.

func DefaultReleaseNotesDraft(req ReleaseNotesDraftRequest) ReleaseNotesDraft

DefaultReleaseNotesDraft builds clean, deterministic, player-facing Markdown release notes from git commits since the last release tag (or initial commit), kept reviews, and changelog entries.

type ReleaseNotesDraftRequest struct {
	ProjectName      string   `json:"projectName"`
	Version          string   `json:"version"`
	LastReleaseTag   string   `json:"lastReleaseTag,omitempty"`
	SinceRef         string   `json:"sinceRef"`
	CommitCount      int      `json:"commitCount"`
	CommitSubjects   []string `json:"commitSubjects,omitempty"`
	KeptReviews      []string `json:"keptReviews,omitempty"`
	ChangelogEntries []string `json:"changelogEntries,omitempty"`
}

ReleaseNotesDraftRequest holds the git history, kept reviews, and changelog entries passed to Editor.ReleaseNotesDrafter or DefaultReleaseNotesDraft.

type ReleaseStepRequest struct {
	Platform string
	StepID   BuildStepID
	Step     BuildStep
	Dir      string
	DryRun   bool
	Plan     *releaseplan.Plan
	Signing  BuildPresetSigningConfig
}

ReleaseStepRequest provides full context to Editor.ReleaseStepRunner when overriding a release build step.

type ReleaseUploadItem struct {
	Platform          string              `json:"platform"`
	PlatformName      string              `json:"platformName"`
	Destination       PublishDestination  `json:"destination"`
	DestinationLabel  string              `json:"destinationLabel"`
	Track             string              `json:"track,omitempty"`
	Version           string              `json:"version"`
	ArtifactName      string              `json:"artifactName"`
	ArtifactPath      string              `json:"artifactPath"`
	ArtifactRelPath   string              `json:"artifactRelPath"`
	SizeBytes         int64               `json:"sizeBytes"`
	Included          bool                `json:"included"`
	HasCredential     bool                `json:"hasCredential"`
	CredentialAccount string              `json:"credentialAccount,omitempty"`
	Status            ReleaseUploadStatus `json:"status"`
	Progress          float64             `json:"progress"`
	StatusMessage     string              `json:"statusMessage,omitempty"`
	ResultURL         string              `json:"resultUrl,omitempty"`
	Err               string              `json:"err,omitempty"`
}

ReleaseUploadItem describes one artifact queued for user confirmation in Review uploads. It never stores credential secrets.

type ReleaseUploadProgress struct {
	Fraction float64
	Message  string
}

ReleaseUploadProgress reports incremental upload progress for one artifact.

type ReleaseUploadRequest struct {
	Platform         string
	Destination      PublishDestination
	DestinationLabel string
	Track            string
	Version          string
	ArtifactPath     string
	ArtifactName     string
	SizeBytes        int64
	ReleaseNotesPath string
	Credential       KeychainCredential
}

ReleaseUploadRequest describes one user-confirmed artifact upload passed to ReleaseUploader.

type ReleaseUploadResult struct {
	Destination PublishDestination
	Platform    string
	Version     string
	URL         string
	Message     string
}

ReleaseUploadResult describes the outcome of uploading one artifact to a store destination.

type ReleaseUploadReviewSnapshot struct {
	Open                bool                   `json:"open"`
	SessionID           uint64                 `json:"sessionId"`
	PermissionProfile   AgentPermissionProfile `json:"permissionProfile"`
	ReleaseNotesFile    string                 `json:"releaseNotesFile"`
	ReleaseNotesPreview string                 `json:"releaseNotesPreview,omitempty"`
	Items               []ReleaseUploadItem    `json:"items"`
	Running             bool                   `json:"running"`
	Completed           bool                   `json:"completed"`
	KeychainEditorOpen  bool                   `json:"keychainEditorOpen"`
	KeychainDest        PublishDestination     `json:"keychainDest,omitempty"`
	LastErr             string                 `json:"lastErr,omitempty"`
}

ReleaseUploadReviewSnapshot is a thread-safe value copy of the Review uploads confirmation dialog state.

type ReleaseUploadStatus string

ReleaseUploadStatus reports the lifecycle state of one upload item in Review uploads.

const (
	UploadStatusPending   ReleaseUploadStatus = "pending"
	UploadStatusUploading ReleaseUploadStatus = "uploading"
	UploadStatusDone      ReleaseUploadStatus = "done"
	UploadStatusFailed    ReleaseUploadStatus = "failed"
	UploadStatusCancelled ReleaseUploadStatus = "cancelled"
)
type ReleaseUploader interface {
	Upload(ctx context.Context, req ReleaseUploadRequest, progress func(ReleaseUploadProgress)) (ReleaseUploadResult, error)
}

ReleaseUploader uploads a single user-confirmed release artifact to a store destination.

type ReleaseUploaderFunc func(ctx context.Context, req ReleaseUploadRequest, progress func(ReleaseUploadProgress)) (ReleaseUploadResult, error)

ReleaseUploaderFunc adapts a plain function to ReleaseUploader.

func (f ReleaseUploaderFunc) Upload(ctx context.Context, req ReleaseUploadRequest, progress func(ReleaseUploadProgress)) (ReleaseUploadResult, error)

Upload calls f(ctx, req, progress).

type ReloadAssetsResult struct {
	// Atlases lists the names of sprite atlases reloaded from disk, sorted.
	Atlases []string
	// Textures lists the project-relative paths of texture outputs that changed on disk, sorted.
	Textures []string
}

ReloadAssetsResult summarizes which built atlases and textures changed on disk and were reloaded by ReloadAssets.

type RemoteConsoleEntry struct {
	Time    time.Time
	Command string
	OK      bool
	Output  string
	Lines   []string
	Error   string
}

RemoteConsoleEntry records one command executed against the running game's debug console via game_console_exec.

type RemoteLiveChange struct {
	EntityRef  string
	EntityName string
	ObjectID   string
	Component  string
	Field      string
	From       any
	To         any
}

RemoteLiveChange records one live component field edit made through game_component_set during a remote session. Stopping or disconnecting keeps the list until the author keeps the changes in the scene or discards them.

type RemoteSnapshot struct {
	Connected    bool
	Connecting   bool
	Error        string
	Scenes       gamemcp.ScenesListResult
	ActiveScene  string
	Layers       []gamemcp.LayerInfo
	Entities     []gamemcp.EntitySummary
	SelectedRef  string
	Inspected    *gamemcp.EntityInspectResult
	Loop         *gamemcp.LoopStatusResult
	FPS          float64
	HasFPS       bool
	Tunables     []gamemcp.TunableResult
	HasConsole   bool
	Taken        []RemoteTakenEntity
	RefreshCount uint64
}

RemoteSnapshot is a point-in-time snapshot of the connected game's live scenes, layers, entities, selected entity inspection, loop state, tunables, and taken scene objects.

type RemoteTakenEntity struct {
	ObjectID    string
	Name        string
	Layer       string
	TakenAtStep uint64
}

RemoteTakenEntity records an object present in the open scene that was alive in the running game and is no longer alive (for example a collected pickup or destroyed enemy).

type ResolvedPlanFile struct {
	Path   string
	Tag    PlanFileTag
	InPlan bool
}

ResolvedPlanFile is one row in the "FILES IN THIS PLAN" panel, with InPlan false when every referencing step was removed.

type ResolvedPlanGhost struct {
	ID       string
	Step     int
	X        float32
	Y        float32
	Width    float32
	Height   float32
	Radius   float32
	Label    string
	LabelX   float32
	LabelY   float32
	HasLabel bool
	Active   bool
	ObjectID string
}

ResolvedPlanGhost is a concrete ghost rectangle ready to draw in the 2D viewport.

type ResolvedPlanTreeNode struct {
	Name     string
	Layer    string
	Existing bool
	Step     int
	ObjectID string
}

ResolvedPlanTreeNode is a planned Scene Tree node after applying field interpolation and removed-step filtering.

type ReviewAgentNote struct {
	ChangeID    string           `json:"change_id"`
	File        string           `json:"file"`
	FileKind    ReviewFileKind   `json:"file_kind"`
	Kind        ReviewChangeKind `json:"kind"`
	Object      string           `json:"object,omitempty"`
	Field       string           `json:"field,omitempty"`
	Title       string           `json:"title"`
	Note        string           `json:"note"`
	RevertFirst bool             `json:"revert_first,omitempty"`
}

ReviewAgentNote is one change-scoped author note explicitly sent to the agent over MCP. Notes live strictly in memory on the active turn and are never written to project files.

type ReviewBlockedError struct {
	Blocker ReviewBlocker
}

ReviewBlockedError describes why KeepTurnReview refused to land the turn.

func (e *ReviewBlockedError) Error() string
func (e *ReviewBlockedError) Unwrap() error
type ReviewBlocker struct {
	Kind     string `json:"kind,omitempty"` // "yaml_error", "conflict", or "custom"
	ChangeID string `json:"changeId"`
	ObjectID string `json:"objectId,omitempty"`
	Line     int    `json:"line,omitempty"`
	Reason   string `json:"reason"`
}

ReviewBlocker describes an active blocker preventing Keep until resolved.

type ReviewChange struct {
	ID                string                `json:"id"`
	File              string                `json:"file"`
	FileKind          ReviewFileKind        `json:"fileKind"`
	Kind              ReviewChangeKind      `json:"kind"`
	Title             string                `json:"title"`
	Detail            string                `json:"detail"`
	Why               string                `json:"why"`
	ObjectID          string                `json:"objectId,omitempty"`
	Layer             string                `json:"layer,omitempty"`
	ParentID          string                `json:"parentId,omitempty"`
	Field             string                `json:"field,omitempty"`
	OldValue          string                `json:"oldValue,omitempty"`
	NewValue          string                `json:"newValue,omitempty"`
	DeltaPct          string                `json:"deltaPct,omitempty"`
	PrefabImpact      string                `json:"prefabImpact,omitempty"`
	RowID             string                `json:"rowId,omitempty"`
	Line              int                   `json:"line,omitempty"`
	YAMLLines         []ReviewYAMLLine      `json:"yamlLines,omitempty"`
	Seen              bool                  `json:"seen"`
	Reverted          bool                  `json:"reverted"`
	Note              string                `json:"note,omitempty"`
	SentNote          string                `json:"sentNote,omitempty"`
	RedoneInRound     int                   `json:"redoneInRound,omitempty"`
	RedoneNote        string                `json:"redoneNote,omitempty"`
	Versions          []ReviewChangeVersion `json:"versions,omitempty"`
	Blocker           string                `json:"blocker,omitempty"`
	GoRequiresConfirm bool                  `json:"goRequiresConfirm,omitempty"`
	GoConfirmed       bool                  `json:"goConfirmed,omitempty"`
	Author            ReviewLineAuthor      `json:"author,omitempty"`
	Conflicts         []ReviewConflict      `json:"conflicts,omitempty"`
	ConflictChoice    ReviewConflictChoice  `json:"conflictChoice,omitempty"`
	AutoMergedFields  []string              `json:"autoMergedFields,omitempty"`
	EditingYAML       bool                  `json:"editingYaml,omitempty"`
	HandEdited        bool                  `json:"handEdited,omitempty"`
	HandEditBy        ReviewLineAuthor      `json:"handEditBy,omitempty"`
	HandEditFields    []string              `json:"handEditFields,omitempty"`
	HandEditLines     []ReviewYAMLLine      `json:"handEditLines,omitempty"`
	HandEditYAML      string                `json:"handEditYaml,omitempty"`
	YAMLError         *ReviewYAMLError      `json:"yamlError,omitempty"`
	// contains filtered or unexported fields
}

ReviewChange is one reviewable change inside an agent turn.

func (c *ReviewChange) CanEditYAML() bool

CanEditYAML reports whether this change can be hand-edited in place in the review's right YAML pane.

func (c *ReviewChange) HasUnresolvedConflict() bool

HasUnresolvedConflict reports whether this non-reverted change has overlapping edits awaiting a choice.

func (c ReviewChange) VersionFor(round int) ReviewChangeVersion

VersionFor returns the immutable snapshot of c for the given 1-based review round.

type ReviewChangeKind string

ReviewChangeKind classifies an individual change in an agent turn review.

const (
	ReviewChangeAdded   ReviewChangeKind = "added"
	ReviewChangeChanged ReviewChangeKind = "changed"
	ReviewChangeRemoved ReviewChangeKind = "removed"
)
type ReviewChangeVersion struct {
	Round     int              `json:"round"`
	Detail    string           `json:"detail"`
	Why       string           `json:"why"`
	OldValue  string           `json:"oldValue,omitempty"`
	NewValue  string           `json:"newValue,omitempty"`
	DeltaPct  string           `json:"deltaPct,omitempty"`
	Line      int              `json:"line,omitempty"`
	X         float32          `json:"x,omitempty"`
	Y         float32          `json:"y,omitempty"`
	YAMLLines []ReviewYAMLLine `json:"yamlLines,omitempty"`
	// contains filtered or unexported fields
}

ReviewChangeVersion holds one round's immutable snapshot of a ReviewChange (1-based).

type ReviewConflict struct {
	Field      string               `json:"field"`
	IsList     bool                 `json:"isList,omitempty"`
	Base       any                  `json:"base,omitempty"`
	Mine       any                  `json:"mine,omitempty"`
	Agent      any                  `json:"agent,omitempty"`
	MineLines  []ReviewConflictLine `json:"mineLines,omitempty"`
	AgentLines []ReviewConflictLine `json:"agentLines,omitempty"`
}

ReviewConflict describes one overlapping field or list edit on a reviewed object.

type ReviewConflictChoice string

ReviewConflictChoice selects how an overlapping edit between the person and the agent merges.

const (
	// ReviewConflictUnresolved indicates the person has not yet chosen Mine, Agent's, or Both.
	ReviewConflictUnresolved ReviewConflictChoice = ""
	// ReviewConflictMine keeps the person's edit for the conflicting field or list.
	ReviewConflictMine ReviewConflictChoice = "mine"
	// ReviewConflictAgent keeps the agent's edit for the conflicting field or list.
	ReviewConflictAgent ReviewConflictChoice = "agent"
	// ReviewConflictBoth keeps both sides' entries for a conflicting list (or map), yours first.
	ReviewConflictBoth ReviewConflictChoice = "both"
)
type ReviewConflictLine struct {
	Author ReviewLineAuthor `json:"author"`
	Sign   string           `json:"sign"`
	Text   string           `json:"text"`
}

ReviewConflictLine is one side's preview line inside a conflict card ("you" or "agent").

type ReviewDataCellDiff struct {
	Column   string `json:"column"`
	OldValue string `json:"oldValue"`
	NewValue string `json:"newValue"`
	DeltaPct string `json:"deltaPct,omitempty"`
}

ReviewDataCellDiff describes a changed cell in a data table row.

type ReviewDataRow struct {
	ID        string                        `json:"id"`
	ChangeID  string                        `json:"changeId,omitempty"`
	Values    map[string]string             `json:"values"`
	Changed   bool                          `json:"changed,omitempty"`
	Added     bool                          `json:"added,omitempty"`
	Removed   bool                          `json:"removed,omitempty"`
	Focused   bool                          `json:"focused,omitempty"`
	CellDiffs map[string]ReviewDataCellDiff `json:"cellDiffs,omitempty"`
}

ReviewDataRow is one row in the center small-data-table preview.

type ReviewDataTablePreview struct {
	File         string          `json:"file"`
	Columns      []string        `json:"columns"`
	TotalRows    int             `json:"totalRows"`
	ChangedCount int             `json:"changedCount"`
	Rows         []ReviewDataRow `json:"rows"`
}

ReviewDataTablePreview holds the center-pane table view model for a small data table file.

type ReviewFileInput struct {
	// Path is the slash-separated path relative to the project root (for example "scenes/level_01.scene.yaml").
	Path string
	// FileKind optionally overrides automatic detection from Path.
	FileKind ReviewFileKind
	// BeforeYAML is the exact file content before the agent turn (empty/nil when newly created).
	BeforeYAML []byte
	// AfterYAML is the exact file content after the agent turn (empty/nil when deleted).
	AfterYAML []byte
	// PersonYAML optionally supplies concurrent manual edits made by the person to this file.
	PersonYAML []byte
	// ExistedBefore explicitly records whether the file existed on disk before the turn.
	// When nil, it defaults to len(BeforeYAML) > 0.
	ExistedBefore *bool
	// Reasons maps a change target key (object ID, prefab field path, data row ID, or "*" default) to the agent's Why explanation.
	Reasons map[string]string
	// Details maps a change target key to an optional custom detail line shown on its card.
	Details map[string]string
	// Notes maps a change target key to an optional review note.
	Notes map[string]string
	// Blockers maps a change target key to an optional blocker reason that disables Keep until cleared.
	Blockers map[string]string
}

ReviewFileInput specifies one touched file when opening a turn review.

type ReviewFileKind string

ReviewFileKind classifies the kind of file touched by an agent turn.

const (
	ReviewFileScene  ReviewFileKind = "scene"
	ReviewFilePrefab ReviewFileKind = "prefab"
	ReviewFileData   ReviewFileKind = "data"
	ReviewFileGo     ReviewFileKind = "go"
	ReviewFileOther  ReviewFileKind = "other"
)
type ReviewFileSummary struct {
	Path        string         `json:"path"`
	Name        string         `json:"name"`
	FileKind    ReviewFileKind `json:"fileKind"`
	Added       int            `json:"added"`
	Changed     int            `json:"changed"`
	Removed     int            `json:"removed"`
	AllReverted bool           `json:"allReverted"`
	Collapsed   bool           `json:"collapsed"`
}

ReviewFileSummary summarizes one file group in the review.

type ReviewFilter string

ReviewFilter selects which changes appear in the left review list.

const (
	ReviewFilterAll     ReviewFilter = "all"
	ReviewFilterAdded   ReviewFilter = "added"
	ReviewFilterChanged ReviewFilter = "changed"
	ReviewFilterRemoved ReviewFilter = "removed"
	ReviewFilterUnseen  ReviewFilter = "unseen"
	ReviewFilterNotes   ReviewFilter = "notes"
)
type ReviewLineAuthor string

ReviewLineAuthor tags who wrote a line in the review YAML pane or conflict card.

const (
	ReviewAuthorNone  ReviewLineAuthor = ""
	ReviewAuthorAgent ReviewLineAuthor = "agent"
	ReviewAuthorYou   ReviewLineAuthor = "you"
)
type ReviewNoteBatch struct {
	Round int               `json:"round"`
	Notes []ReviewAgentNote `json:"notes"`
}

ReviewNoteBatch is a batch of change-scoped notes explicitly dispatched via "Send N notes" or "Revert and redo with this note".

type ReviewOutcome string

ReviewOutcome reports the lifecycle status of the most recent agent turn review.

const (
	ReviewOutcomeNone     ReviewOutcome = ""
	ReviewOutcomePending  ReviewOutcome = "pending"
	ReviewOutcomeKept     ReviewOutcome = "kept"
	ReviewOutcomeReverted ReviewOutcome = "reverted"
)
type ReviewOutcomeRecord struct {
	ReviewID string `json:"reviewId,omitempty"`
	// Action describes the normalized kind of change, such as "moved the camera bounds".
	Action  string `json:"action"`
	Field   string `json:"field,omitempty"`
	File    string `json:"file,omitempty"`
	Summary string `json:"summary,omitempty"`
	Kept    bool   `json:"kept"`
}

ReviewOutcomeRecord records whether a reviewed agent change was kept or reverted, used to detect repeated revert patterns for Settings › Project rules suggestions.

type ReviewOverlayVisibility struct {
	Added    bool `json:"added"`
	Changed  bool `json:"changed"`
	Removed  bool `json:"removed"`
	Selected bool `json:"selected"`
}

ReviewOverlayVisibility controls which overlay kinds are visible in the Review viewport legend.

type ReviewRedoChange struct {
	ChangeID    string
	Detail      string
	X           *float32
	Y           *float32
	ObjectDoc   *sceneformat.ObjectDoc
	LayerName   string
	FileContent []byte
	OldValue    string
	NewValue    string
	DeltaPct    string
	YAMLLines   []ReviewYAMLLine
}

ReviewRedoChange describes the agent's second-round (or later) revision for one noted change.

type ReviewRowKind string

ReviewRowKind identifies a visible row in the grouped left change list.

const (
	ReviewRowFile       ReviewRowKind = "file"
	ReviewRowKindHeader ReviewRowKind = "kind"
	ReviewRowCard       ReviewRowKind = "card"
)
type ReviewSceneOverlay struct {
	ChangeID    string           `json:"changeId"`
	File        string           `json:"file"`
	ObjectID    string           `json:"objectId"`
	Kind        ReviewChangeKind `json:"kind"`
	ColorRole   string           `json:"colorRole"` // "added", "changed", "removed" (never "accent")
	Focused     bool             `json:"focused"`
	StrokeWidth float32          `json:"strokeWidth"` // 2.5 when focused, 1.5 otherwise
	Dashed      bool             `json:"dashed"`
	PillText    string           `json:"pillText"`
	X           float32          `json:"x"`
	Y           float32          `json:"y"`
	W           float32          `json:"w"`
	H           float32          `json:"h"`
}

ReviewSceneOverlay is an inspectable overlay entry drawn in the Review viewport or main editor viewport.

type ReviewSnapshot struct {
	Active               bool                    `json:"active"`
	Open                 bool                    `json:"open"`
	Outcome              ReviewOutcome           `json:"outcome"`
	Request              string                  `json:"request,omitempty"`
	Round                int                     `json:"round,omitempty"`
	ViewRound            int                     `json:"viewRound,omitempty"`
	ViewingReadOnlyRound bool                    `json:"viewingReadOnlyRound,omitempty"`
	DraftNoteCount       int                     `json:"draftNoteCount,omitempty"`
	ComposingChangeID    string                  `json:"composingChangeId,omitempty"`
	PendingBatch         *ReviewNoteBatch        `json:"pendingBatch,omitempty"`
	RoundBanner          string                  `json:"roundBanner,omitempty"`
	TotalChanges         int                     `json:"totalChanges"`
	SeenCount            int                     `json:"seenCount"`
	KeptCount            int                     `json:"keptCount"`
	RevertedCount        int                     `json:"revertedCount"`
	FileCount            int                     `json:"fileCount"`
	FocusedID            string                  `json:"focusedId,omitempty"`
	FocusedRowKey        string                  `json:"focusedRowKey,omitempty"`
	Filter               ReviewFilter            `json:"filter,omitempty"`
	Search               string                  `json:"search,omitempty"`
	PeekBefore           bool                    `json:"peekBefore"`
	RevertConfirm        bool                    `json:"revertConfirm"`
	Blockers             []ReviewBlocker         `json:"blockers,omitempty"`
	OverlayLegend        ReviewOverlayVisibility `json:"overlayLegend"`
	Files                []ReviewFileSummary     `json:"files,omitempty"`
	Changes              []ReviewChange          `json:"changes,omitempty"`
	LastRounds           int                     `json:"lastRounds,omitempty"`
	LastOutcomeMsg       string                  `json:"lastOutcomeMsg,omitempty"`
}

ReviewSnapshot is the read-only state returned by Editor.ReviewStatus and editormcp's review_status tool.

type ReviewTurnInput struct {
	// Request is the quoted user request displayed in the Review header and Agent panel.
	Request string
	// Files are the project files touched by this agent turn, in presentation order.
	Files []ReviewFileInput
	// DefaultWhy is used when a change has no per-target or per-file reason.
	DefaultWhy string
	// StartPending leaves the review pending in the Agent panel instead of opening full-window immediately.
	StartPending bool
}

ReviewTurnInput configures Editor.StartTurnReview.

type ReviewViewportPin struct {
	ChangeID string  `json:"changeId"`
	File     string  `json:"file"`
	ObjectID string  `json:"objectId"`
	Note     string  `json:"note"`
	Redone   bool    `json:"redone,omitempty"`
	X        float32 `json:"x"`
	Y        float32 `json:"y"`
}

ReviewViewportPin represents a note pin positioned beside a noted scene object in the Review viewport or the paused 2D editor viewport.

type ReviewVisibleRow struct {
	Key            string           `json:"key"`
	RowKind        ReviewRowKind    `json:"rowKind"`
	File           string           `json:"file"`
	FileName       string           `json:"fileName,omitempty"`
	FileKind       ReviewFileKind   `json:"fileKind,omitempty"`
	Kind           ReviewChangeKind `json:"kind,omitempty"`
	ChangeID       string           `json:"changeId,omitempty"`
	Count          int              `json:"count,omitempty"`
	Added          int              `json:"added,omitempty"`
	Changed        int              `json:"changed,omitempty"`
	Removed        int              `json:"removed,omitempty"`
	Collapsed      bool             `json:"collapsed,omitempty"`
	AllReverted    bool             `json:"allReverted,omitempty"`
	CanRevertGroup bool             `json:"canRevertGroup,omitempty"`
}

ReviewVisibleRow represents one rendered row in the left grouped change list.

type ReviewYAMLError struct {
	Line        int            `json:"line"`
	LocalLine   int            `json:"localLine"`
	Title       string         `json:"title"`
	Message     string         `json:"message"`
	Fix         *ReviewYAMLFix `json:"fix,omitempty"`
	RawParseErr string         `json:"rawParseErr,omitempty"`
}

ReviewYAMLError describes a syntax or validation error while hand-editing YAML in a review.

type ReviewYAMLFix struct {
	Label       string `json:"label"`
	Description string `json:"description,omitempty"`
	PatchedYAML string `json:"patchedYaml"`
}

ReviewYAMLFix is a mechanical one-step fix offered when a YAML parse error names what is missing.

type ReviewYAMLLine struct {
	Line   int              `json:"line"`
	Sign   string           `json:"sign,omitempty"` // "", "+", "-"
	Text   string           `json:"text"`
	Tag    string           `json:"tag,omitempty"`
	Author ReviewLineAuthor `json:"author,omitempty"`
	Error  bool             `json:"error,omitempty"`
}

ReviewYAMLLine is one line in the right-hand YAML/code diff view.

type RigHandle int

RigHandle identifies an interactive handle in the 2D skeletal rig editor canvas.

const (
	// RigHandleNone is no handle.
	RigHandleNone RigHandle = iota
	// RigHandleBoneMove is the joint circle at the selected bone's origin: dragging moves the bone in its parent's space.
	RigHandleBoneMove
	// RigHandleBoneRotate is the rotation ring around the selected bone's origin: dragging rotates the bone.
	RigHandleBoneRotate
	// RigHandleBoneLength is the diamond at the selected bone's tip: dragging sets the bone's length.
	RigHandleBoneLength
	// RigHandleAttachmentOrigin is the pivot crosshair on the selected slot's active attachment: dragging edits OriginX and OriginY.
	RigHandleAttachmentOrigin
)
func (h RigHandle) String() string

String returns a human-readable label for h.

type RightPanelTab string

RightPanelTab selects which tab is visible in the editor's right-hand panel.

const (
	RightPanelInspector RightPanelTab = "inspector"
	RightPanelAgent     RightPanelTab = "agent"
)
type RightRailMode = RightRailTab

RightRailMode aliases RightRailTab for callers selecting which panel occupies the editor's right rail.

type RightRailTab string

RightRailTab selects which panel is shown in the right sidebar.

type RunGameOptions struct {
	// StartAtOpenScene passes the currently open scene (when it belongs to the open project) to `game dev -scene <path>` and sets hotreload.SceneEnv in the child environment.
	StartAtOpenScene bool
	// Automation passes `-automation` to `game dev` and connects the editor's remote scene tree and inspector to the running game over MCP.
	Automation bool
	// ExtraArgs are optional extra arguments appended after `go tool game dev` (and `-scene <path>` when set).
	ExtraArgs []string
}

RunGameOptions configures launching the open project with `go tool game dev`.

type RunGameSpec struct {
	// Dir is the open project's root directory where the command executes.
	Dir string
	// Name is the executable to run ("go").
	Name string
	// Args are the command arguments (for example ["tool", "game", "dev"]).
	Args []string
	// Env is the full process environment passed to the child process.
	Env []string
	// Scene is the slash-separated project-relative path of the open scene when StartAtOpenScene is active, or empty.
	Scene string
}

RunGameSpec describes the child process started by RunGame / RunGameWith.

type SafeRenameAgentRequest struct {
	File    string
	Line    int
	Ident   string
	OldPath string
	NewPath string
}

SafeRenameAgentRequest is passed to Editor.OnAskAgentUpdateRef when the author asks the agent to update a non-rewritten reference.

type SafeRenameFileDiff struct {
	Path               string               `json:"path"`
	OldPath            string               `json:"oldPath"`
	Group              UsageGroupKind       `json:"group"`
	ChangeCount        int                  `json:"changeCount"`
	Diffs              []SafeRenameLineDiff `json:"diffs"`
	PreviewLines       []CodePreviewLine    `json:"previewLines,omitempty"`
	PreservedOverrides []string             `json:"preservedOverrides,omitempty"`
}

SafeRenameFileDiff describes the planned changes to one YAML file in a safe rename review.

type SafeRenameLineDiff struct {
	Line    int    `json:"line"`
	OldText string `json:"oldText"`
	NewText string `json:"newText"`
}

SafeRenameLineDiff records one rewritten line pair (old -> new) inside a YAML file.

type SafeRenamePlan struct {
	From               string               `json:"from"`
	To                 string               `json:"to"`
	FolderPrefix       string               `json:"folderPrefix"`
	OldStem            string               `json:"oldStem"`
	NewStem            string               `json:"newStem"`
	Suffix             string               `json:"suffix"`
	Valid              bool                 `json:"valid"`
	ValidationMsg      string               `json:"validationMsg"`
	MovedContentLines  []CodePreviewLine    `json:"movedContentLines,omitempty"`
	Files              []SafeRenameFileDiff `json:"files,omitempty"`
	Problems           []SafeRenameProblem  `json:"problems,omitempty"`
	RewrittenFileCount int                  `json:"rewrittenFileCount"`
	TotalTouchedFiles  int                  `json:"totalTouchedFiles"`
	RewrittenRefCount  int                  `json:"rewrittenRefCount"`
	IndexUpdated       bool                 `json:"indexUpdated,omitempty"`
	PreservedObjects   []string             `json:"preservedObjects,omitempty"`
}

SafeRenamePlan is the dry-run result of PreviewSafeRename before any file is written to disk.

func (p *SafeRenamePlan) FileDiff(filePath string) *SafeRenameFileDiff

FileDiff returns the SafeRenameFileDiff for the given old or new project path, or nil.

type SafeRenameProblem struct {
	File         string `json:"file"`
	Line         int    `json:"line"`
	Ident        string `json:"ident,omitempty"`
	OldPath      string `json:"oldPath"`
	NewPath      string `json:"newPath,omitempty"`
	Message      string `json:"message"`
	NotRewritten bool   `json:"notRewritten"`
	AskSent      bool   `json:"askSent,omitempty"`
}

SafeRenameProblem describes a non-YAML reference (such as a Go string constant) that safe rename intentionally does not rewrite.

type SaveErrorKind string

SaveErrorKind classifies common filesystem save errors for status bar messages.

const (
	SaveErrorNone     SaveErrorKind = ""
	SaveErrorReadOnly SaveErrorKind = "read_only"
	SaveErrorDiskFull SaveErrorKind = "disk_full"
	SaveErrorOther    SaveErrorKind = "other"
)
type SaveStatus struct {
	// Kind is SaveStatusSaved, SaveStatusSaving (only after 300 ms in flight), or SaveStatusFailed.
	Kind SaveStatusKind
	// LastSavedAt is when the last save succeeded (zero if none yet in this session).
	LastSavedAt time.Time
	// HasSaved reports whether a save has succeeded during this session.
	HasSaved bool
	// ErrorKind classifies the active save failure when Kind == SaveStatusFailed.
	ErrorKind SaveErrorKind
	// ErrorMessage is the localized status-bar message when Kind == SaveStatusFailed
	// (for example "Couldn't save: folder is read-only" or "Couldn't save: disk is full · 12 MB free").
	ErrorMessage string
	// RawError is the underlying error string for diagnostics and MCP warnings.
	RawError string
	// TargetPath is the file path that failed to save (project-relative when inside the project, or OS path).
	TargetPath string
	// FailedTabID is the scene tab ID associated with a failed scene save, or 0 for non-tab saves.
	FailedTabID uint64
	// FailedAt is when the active save failure occurred.
	FailedAt time.Time
	// AutoSaveFailure reports whether the active failure came from an automatic save (kept in the status bar, never toasted).
	AutoSaveFailure bool
}

SaveStatus describes the current save state shown in the status bar and reported to editormcp.

type SaveStatusKind int

SaveStatusKind identifies the save indicator state shown in the status bar.

const (
	// SaveStatusSaved indicates the document is saved (or a save is under the 300 ms indicator threshold).
	SaveStatusSaved SaveStatusKind = iota
	// SaveStatusSaving indicates a save has been running for at least SavingIndicatorDelay (300 ms).
	SaveStatusSaving
	// SaveStatusFailed indicates an autosave failed and remains in the status bar with Retry and Save as… until fixed.
	SaveStatusFailed
)
func (k SaveStatusKind) String() string

String returns a lowercase name for k.

type SceneComparison struct {
	HeadDoc   *sceneformat.SceneDoc   `json:"-"`
	NowDoc    *sceneformat.SceneDoc   `json:"-"`
	HeadBuilt *sceneformat.BuiltScene `json:"-"`
	NowBuilt  *sceneformat.BuiltScene `json:"-"`
	Added     []SceneObjectChange     `json:"added,omitempty"`
	Changed   []SceneObjectChange     `json:"changed,omitempty"`
	Removed   []SceneObjectChange     `json:"removed,omitempty"`
	HeadErr   string                  `json:"headErr,omitempty"`
	NowErr    string                  `json:"nowErr,omitempty"`
}

SceneComparison holds the parsed HEAD and working-tree versions of a changed scene along with per-object deltas.

type SceneConflictEntry struct {
	ObjectID    string
	ObjectName  string
	Layer       string
	MineChanged bool
	DiskChanged bool
	Overlap     bool
	MineSummary string
	DiskSummary string
	Note        string
	Choice      DiskMergeChoice
}

SceneConflictEntry describes one object touched in the editor, on disk, or on both sides during an external scene conflict.

type SceneObjectChange struct {
	ID      string                 `json:"id"`
	Name    string                 `json:"name"`
	Layer   string                 `json:"layer,omitempty"`
	Kind    SceneObjectChangeKind  `json:"kind"`
	Summary string                 `json:"summary,omitempty"`
	HeadObj *sceneformat.ObjectDoc `json:"-"`
	NowObj  *sceneformat.ObjectDoc `json:"-"`
}

SceneObjectChange describes one added, changed, or removed object in a scene compared with HEAD.

type SceneObjectChangeKind string

SceneObjectChangeKind classifies how a scene object differs from HEAD.

const (
	SceneObjectAdded   SceneObjectChangeKind = "added"
	SceneObjectChanged SceneObjectChangeKind = "changed"
	SceneObjectRemoved SceneObjectChangeKind = "removed"
)
type SceneObjectDiff struct {
	ObjectID   string
	ObjectName string
	Layer      string
	Action     string // "added", "removed", "changed"
	Detail     string
}

SceneObjectDiff summarizes one object-level change from a quiet external scene reload.

type SceneOpenError struct {
	Path    string
	Line    int
	Column  int
	Message string
	Fix     string
	Err     error
	// contains filtered or unexported fields
}

SceneOpenError captures the structured details of a failed scene open (covering missing files and YAML/schema errors from open_errors_test.go).

type SceneOverlayEntry struct {
	// ID optionally identifies this entry for targeted updates or removal.
	ID string
	// ObjectID names the scene object this overlay attaches to.
	ObjectID string
	// Kind selects which Spec overlay style to draw (Agent, Added, Changed, Removed, or FocusedChange).
	Kind OverlayKind
	// ChangeKind selects the base change kind when Kind is OverlayKindFocusedChange.
	ChangeKind OverlayKind
	// Label is the pill text (action text for Agent, object name for Added/Removed, "field old → new" for Changed).
	Label string
	// SecondaryLabel optionally overrides "removed" on Removed pills.
	SecondaryLabel string
	// GhostBounds optionally supplies 2D world bounds for a Removed object that is no longer in the scene.
	GhostBounds *core.Bounds
	// GhostPos3D and GhostSize3D optionally supply 3D world center & extents for a Removed object in 3D view.
	GhostPos3D  *[3]float32
	GhostSize3D *[3]float32
	// StartedAt records when the overlay appeared; automatically stamped with the editor clock when zero.
	StartedAt time.Time
}

SceneOverlayEntry attaches a live Spec overlay (Agent working, Added, Changed, Removed, or Focused change in Review) to an object in the open scene (or world ghost bounds for Removed).

type SceneTab struct {
	// ID is a stable identifier unique within this Editor session.
	ID uint64
	// Index is the tab's 0-based position in Tabs().
	Index int
	// Label is the display name shown in the tab bar (the file's base name, disambiguated when two open tabs share a base name, or "Untitled").
	Label string
	// Path is the scene's slash-separated path from the project root (ScenePath), or FilePath when outside a project, or empty for an untitled scene.
	Path string
	// FilePath is the OS path of the scene file, or empty.
	FilePath string
	// ScenePath is the slash-separated project-relative path, or empty.
	ScenePath string
	// Name is SceneDoc.Name.
	Name string
	// Dirty reports whether this tab's scene differs from what it was opened from or last saved to.
	Dirty bool
	// SaveFailed reports whether an automatic save for this tab is currently in a failed state.
	SaveFailed bool
	// Active reports whether this tab is the currently active tab.
	Active bool
}

SceneTab describes one open scene tab in the editor's tab bar.

type SceneTreeTab int

SceneTreeTab selects whether the left scene tree panel displays the open scene document or the live remote game tree.

const (
	// SceneTreeLocal shows the editable scene document layers and objects.
	SceneTreeLocal SceneTreeTab = iota
	// SceneTreeRemote shows the running game's live scenes, layers, and entities over MCP.
	SceneTreeRemote
)
func (t SceneTreeTab) String() string

String returns "Scene" or "Remote".

type SearchKind string

SearchKind classifies what kind of project entity a SearchResult matched.

const (
	// SearchFile matched a project file's name, path, or scene name.
	SearchFile SearchKind = "file"
	// SearchUID matched a file's stable UID header or project index UID.
	SearchUID SearchKind = "uid"
	// SearchObject matched a scene object's ID or display name.
	SearchObject SearchKind = "object"
	// SearchComponent matched a component type on a scene object or override.
	SearchComponent SearchKind = "component"
	// SearchPrefab matched a prefab name referenced by a scene object or override.
	SearchPrefab SearchKind = "prefab"
	// SearchSceneRef matched an instanced scene (object.scene) or inherited scene (inherits) path.
	SearchSceneRef SearchKind = "scene"
)
type SearchResult struct {
	// Kind says which kind of entity or field matched.
	Kind SearchKind
	// File is the slash-separated path of the file from the open project's root.
	File string
	// UID is the file's stable UID when present.
	UID string
	// Layer is the scene layer name for object-level hits.
	Layer string
	// ObjectID is the matching object's ID inside a scene file, or empty for file-level hits.
	ObjectID string
	// TopObjectID is the top-level ancestor object's ID selectable in the editor (equal to ObjectID for top-level objects).
	TopObjectID string
	// ObjectName is the matching object's display name when set.
	ObjectName string
	// Match is the specific matched token or value (such as a UID, component type, prefab, or scene path).
	Match string
	// Detail is a human-readable summary of why the result matched.
	Detail string
}

SearchResult is one hit returned by Editor.Search.

type SearchTab int

SearchTab selects which view the Project Search and References panel displays.

const (
	// SearchTabSearch displays the project-wide search field and results.
	SearchTabSearch SearchTab = iota
	// SearchTabReferences displays incoming references to a selected project file.
	SearchTabReferences
)
type SettingsAgentRequest struct {
	Page          string `json:"page"`
	PageTitle     string `json:"pageTitle"`
	Scope         string `json:"scope,omitempty"`
	File          string `json:"file,omitempty"`
	Source        string `json:"source"` // "suggestion", "page_composer", or "search"
	Prompt        string `json:"prompt"`
	ContextPrompt string `json:"contextPrompt"`
}

SettingsAgentRequest captures a request sent from a Settings page ("Agent on this page" card or the Settings search bar) to the Agent panel with the active Settings page as context.

type SettingsPage string

SettingsPage identifies a page in the unified Settings view (docs/design/editor/Settings.dc.html).

const (
	// SettingsPageModels configures connected agents, built-in keychain API connection, and task routing (This computer, You only).
	SettingsPageModels SettingsPage = "models"
	// SettingsPageTools toggles every tool registered on the editor's MCP server and configures external MCP servers (This computer, You only).
	SettingsPageTools SettingsPage = "tools"
	// SettingsPageUsage tracks weekly agent requests against a limit, kept review share, local playtest runs, and outbound privacy switches (This computer, You only).
	SettingsPageUsage SettingsPage = "usage"
	// SettingsPageAutomations edits the project's shared automations.yaml rules, pause-for-today state, and natural-language drafts.
	SettingsPageAutomations SettingsPage = "automations"
	// SettingsPageProject edits game.yaml's project metadata, window, display, physics, autoload, and plugins.
	SettingsPageProject SettingsPage = "project"
	// SettingsPageInput edits game.yaml's input actions, bindings, touch/mouse regions, and axes.
	SettingsPageInput SettingsPage = "input"
	// SettingsPageAudio edits game.yaml's audio master level, buses, DSP effect chains, and live audition.
	SettingsPageAudio SettingsPage = "audio"
	// SettingsPageExport edits game.yaml's export output, platform presets, credits pre-flight, and release builds.
	SettingsPageExport SettingsPage = "export"
	// SettingsPagePermissions edits permissions.yaml's MCP agent permission profile and first-match-wins rules.
	SettingsPagePermissions SettingsPage = "permissions"
	// SettingsPageGeneral edits per-computer editor language, appearance, saving, and interface size preferences.
	SettingsPageGeneral SettingsPage = "general"
	// SettingsPageViewport edits per-computer snapping, grid, agent change outlines, 3D navigation, and overlay legend choices.
	SettingsPageViewport SettingsPage = "viewport"
	// SettingsPageShortcuts edits per-computer command keyboard shortcuts within a scope.
	SettingsPageShortcuts SettingsPage = "shortcuts"
	// SettingsPageBrief edits the project's brief.yaml game brief read by the agent.
	SettingsPageBrief SettingsPage = "brief"
	// SettingsPageRules edits the project's AGENTS.md rules read by the agent.
	SettingsPageRules SettingsPage = "rules"
)
func (p SettingsPage) IsAgentPage() bool

IsAgentPage reports whether p is one of the per-computer Agent Settings pages (Models and connections, Tools, Usage and privacy).

func (p SettingsPage) IsProjectPage() bool

IsProjectPage reports whether p edits the open project's game.yaml rather than per-computer editor preferences.

func (p SettingsPage) Valid() bool

Valid reports whether p is a recognized Settings page.

type Shading3D int

Shading3D selects how the 3D viewport shades the scene's geometry when it draws it on the GPU (Viewport3DOnGPU).

const (
	// Shading3DLit lights the geometry with Lights3D, or with DefaultLights3D under a gradient sky when Lights3D is nil.
	Shading3DLit Shading3D = iota
	// Shading3DUnlit draws the geometry at its textured base color plus its emissive color, ignoring the lights.
	Shading3DUnlit
	// Shading3DWireframe lights the geometry as Shading3DLit does and draws the edges of its triangles over it.
	Shading3DWireframe
)
func (s Shading3D) String() string

String returns a human-readable label for the shading mode.

type ShapeHandle2D struct {
	ObjectID  string
	Component string
	Field     string
	Kind      ShapeHandleKind
	// Index is the vertex index for ShapeHandlePolygonVertex, the starting vertex index for ShapeHandlePolygonMidpoint, or 0..3 for cardinal circle radius handles (+X, +Y, -X, -Y).
	Index int
	// Pos is the handle's position in canvas points.
	Pos math2d.Vec2
}

ShapeHandle2D describes one interactive handle on a component shape field of the selected object.

type ShapeHandleKind int

ShapeHandleKind identifies what part of a component shape field a 2D viewport handle edits.

const (
	// ShapeHandleNone is no handle.
	ShapeHandleNone ShapeHandleKind = iota
	// ShapeHandlePoint moves a FieldPoint's (x, y).
	ShapeHandlePoint
	// ShapeHandleRectCenter moves a FieldRect's position without resizing it.
	ShapeHandleRectCenter
	// ShapeHandleRectN moves the top edge of a FieldRect.
	ShapeHandleRectN
	// ShapeHandleRectE moves the right edge of a FieldRect.
	ShapeHandleRectE
	// ShapeHandleRectS moves the bottom edge of a FieldRect.
	ShapeHandleRectS
	// ShapeHandleRectW moves the left edge of a FieldRect.
	ShapeHandleRectW
	// ShapeHandleRectNE moves the top-right corner of a FieldRect.
	ShapeHandleRectNE
	// ShapeHandleRectSE moves the bottom-right corner of a FieldRect.
	ShapeHandleRectSE
	// ShapeHandleRectSW moves the bottom-left corner of a FieldRect.
	ShapeHandleRectSW
	// ShapeHandleRectNW moves the top-left corner of a FieldRect.
	ShapeHandleRectNW
	// ShapeHandleCircleCenter moves a FieldCircle's center.
	ShapeHandleCircleCenter
	// ShapeHandleCircleRadius adjusts a FieldCircle's radius from a cardinal rim handle.
	ShapeHandleCircleRadius
	// ShapeHandlePolygonVertex moves vertex Index of a FieldPolygon.
	ShapeHandlePolygonVertex
	// ShapeHandlePolygonMidpoint inserts a new vertex on the edge from Index to (Index+1)%N of a FieldPolygon.
	ShapeHandlePolygonMidpoint
)
func (k ShapeHandleKind) String() string

String returns a human-readable name for k.

type ShortcutConflictError struct {
	CommandID     string
	Scope         string
	Shortcut      string
	ConflictID    string
	ConflictLabel string
}

ShortcutConflictError is returned by RebindShortcut when another command in the same scope already owns the requested shortcut. Callers can resolve it in place with SwapShortcut.

func (e *ShortcutConflictError) Error() string
type SketchAgentRequest struct {
	Scene     string       `json:"scene"`
	ChipLabel string       `json:"chipLabel"`
	Prompt    string       `json:"prompt,omitempty"`
	View      View2D       `json:"view"`
	Marks     []SketchMark `json:"marks"`
	PNG       []byte       `json:"-"`
	Width     int          `json:"width,omitempty"`
	Height    int          `json:"height,omitempty"`
}

SketchAgentRequest is the structured payload sent to the agent when the author sends a viewport sketch.

type SketchHoldState string

SketchHoldState describes the confirmation hold lifecycle for a sent viewport sketch.

const (
	// SketchHoldNone means no sent sketch is currently awaiting confirmation or editing.
	SketchHoldNone SketchHoldState = "none"
	// SketchHoldPending means a sketch was sent to the agent; mutating scene MCP tools hold until confirmed.
	SketchHoldPending SketchHoldState = "pending"
	// SketchHoldReading means the agent posted its restatement card; mutating scene MCP tools still hold until Go ahead or a reply.
	SketchHoldReading SketchHoldState = "reading"
	// SketchHoldApproved means the user answered Go ahead (or replied approvingly) and the agent may now edit the scene.
	SketchHoldApproved SketchHoldState = "approved"
)
type SketchMark struct {
	ID     string        `json:"id"`
	Number int           `json:"number"`
	Kind   SketchTool    `json:"kind"`
	Label  string        `json:"label,omitempty"`
	Points []SketchPoint `json:"points,omitempty"`
	Start  *SketchPoint  `json:"start,omitempty"`
	End    *SketchPoint  `json:"end,omitempty"`
	Rect   *SketchRect   `json:"rect,omitempty"`
	At     *SketchPoint  `json:"at,omitempty"`
}

SketchMark is one numbered annotation drawn on the viewport sketch layer in scene coordinates. Sketch marks live solely in editor session state and are never written into SceneDoc or *.scene.yaml.

func (m SketchMark) AnchorScenePoint() SketchPoint

AnchorScenePoint returns the primary anchor point of m in scene coordinates, where its numbered badge attaches.

func (m SketchMark) Clone() SketchMark

Clone returns a deep copy of m.

func (m SketchMark) GeometrySummary() string

GeometrySummary formats m's geometry concisely in scene coordinates for the preview popover and reading card.

func (m SketchMark) ReadingHeading() string

ReadingHeading formats the compact mark caption shown above an agent restatement row (for example `Box · “3 spikes”`).

type SketchPoint struct {
	X float32 `json:"x"`
	Y float32 `json:"y"`
}

SketchPoint is a 2D point stored strictly in scene (world) coordinates.

type SketchReading struct {
	Summary     string              `json:"summary,omitempty"`
	Items       []SketchReadingItem `json:"items"`
	Assumptions []string            `json:"assumptions,omitempty"`
	PostedAt    time.Time           `json:"postedAt,omitempty"`
}

SketchReading is the reading card posted by the agent via MCP before scene_edit is allowed.

func (r *SketchReading) Clone() *SketchReading

Clone returns a deep copy of r.

type SketchReadingItem struct {
	Number int    `json:"number"`
	Mark   string `json:"mark,omitempty"`
	Text   string `json:"text"`
}

SketchReadingItem is the agent's restatement of one numbered sketch mark before editing.

type SketchReadingReply struct {
	Action     string `json:"action"` // "approve", "correct", or "reply"
	MarkNumber int    `json:"markNumber,omitempty"`
	Message    string `json:"message,omitempty"`
}

SketchReadingReply describes the user's answer to an agent sketch reading card.

type SketchRect struct {
	X      float32 `json:"x"`
	Y      float32 `json:"y"`
	Width  float32 `json:"width"`
	Height float32 `json:"height"`
}

SketchRect is an axis-aligned rectangle stored strictly in scene (world) coordinates.

type SketchReviewChange struct {
	Kind   SketchReviewChangeKind `json:"kind"`
	ID     string                 `json:"id"`
	Detail string                 `json:"detail,omitempty"`
}

SketchReviewChange describes one object added, changed, or removed by the agent after approving a sketch.

type SketchReviewChangeKind string

SketchReviewChangeKind classifies one scene edit tracked by a post-sketch review.

const (
	SketchChangeAdded   SketchReviewChangeKind = "added"
	SketchChangeChanged SketchReviewChangeKind = "changed"
	SketchChangeRemoved SketchReviewChangeKind = "removed"
)
type SketchTool string

SketchTool selects one of the four viewport sketch drawing tools.

const (
	// SketchToolPen draws a freehand polyline in scene coordinates.
	SketchToolPen SketchTool = "pen"
	// SketchToolArrow draws a directed arrow from start to end in scene coordinates.
	SketchToolArrow SketchTool = "arrow"
	// SketchToolBox draws a rectangular region in scene coordinates.
	SketchToolBox SketchTool = "box"
	// SketchToolText places a labelled anchor point in scene coordinates.
	SketchToolText SketchTool = "text"
)
func (t SketchTool) Hint() string

Hint returns the short status hint displayed below the floating sketch toolbar.

func (t SketchTool) String() string

String returns the human-readable tool label.

func (t SketchTool) Valid() bool

Valid reports whether t is one of the four built-in sketch tools.

type SnapSettings struct {
	// Grid snaps object placement, drags, 2D handles, and 3D translate gizmos to EffectiveGridStep.
	Grid bool `yaml:"grid,omitempty"`
	// GridSize is an explicit grid step in world/layer units; 0 means follow the active layer's tilemap tile size (or 8 when it has none).
	GridSize float32 `yaml:"gridSize,omitempty"`
	// Pixel snaps positions to whole points (1-unit increments) when Grid is off.
	Pixel bool `yaml:"pixel,omitempty"`
	// Rotation snaps 2D and 3D rotation drags to RotationStepDeg-degree increments.
	Rotation bool `yaml:"rotation,omitempty"`
	// RotationStepDeg is the rotation snap step in degrees (defaults to 15 when <= 0).
	RotationStepDeg float32 `yaml:"rotationStepDeg,omitempty"`
	// Scale snaps 2D and 3D scale drags to ScaleStep increments.
	Scale bool `yaml:"scale,omitempty"`
	// ScaleStep is the scale snap step (defaults to 0.25 when <= 0).
	ScaleStep float32 `yaml:"scaleStep,omitempty"`
	// ShowGrid draws a 2D grid overlay at the active snap step in the 2D edit viewport, following View2D.
	ShowGrid bool `yaml:"showGrid,omitempty"`
}

SnapSettings holds the editor's snapping and 2D grid overlay preferences. They are editor preferences persisted per project in ViewStateFile (.game/editor.yaml), never in scene files.

func DefaultSnapSettings() SnapSettings

DefaultSnapSettings returns the default snapping preferences (all snaps and grid overlay off, auto grid size, 15° rotation step, 0.25 scale step).

type SortOrder int

SortOrder selects how the Data Table panel sorts visible rows.

const (
	SortNone SortOrder = iota
	SortAsc
	SortDesc
)
func (s SortOrder) String() string

String returns the human-readable sort direction.

type SpecContrastPair struct {
	Name       string
	Foreground core.Color
	Background core.Color
	MinRatio   float64
	Usage      string
}

SpecContrastPair is one foreground/background measurement row in the Spec's WCAG 2.2 contrast table.

func SpecContrastTable(p SpecPalette) []SpecContrastPair

SpecContrastTable returns every foreground/background and overlay contrast pair required by docs/design/editor/Spec.dc.html for palette p (Dark or Light), with its WCAG 2.2 minimum threshold.

func (p SpecContrastPair) Ratio() float64

Ratio returns the measured WCAG 2.2 contrast ratio for this pair.

type SpecFocusWithinCard struct {
	Ref      *core.Ref
	TestID   string
	Style    core.Style
	Children []core.Node
}

SpecFocusWithinCard wraps a composer or card container so keyboard focus on any control inside it draws the 2 px accent ring (+2 px offset) on the card itself via :focus-within in both Spec Dark and Spec Light appearances.

func (c SpecFocusWithinCard) Render(cx *core.Scope) core.Node

Render implements core.Node.

type SpecIconButton struct {
	Ref      *core.Ref
	Icon     func() *core.SVG
	Label    string
	Tooltip  string
	Size     core.Points
	IconSize core.Points
	Tint     func() core.Color
	Selected func() bool
	Disabled func() bool
	OnPress  func()
	TestID   string
}

SpecIconButton is a Spec-compliant icon-only button with a 2 px accent focus ring at +2 px offset on :focus-visible only in both Spec Dark and Spec Light appearances, and a tooltip that opens on hover and focus.

NSGo gap (v0.3.0): ui.IconButton hardcodes FocusRing(cx, -2) on ghost buttons and omits FocusVisible on circular variants.

func (b SpecIconButton) Render(cx *core.Scope) core.Node

Render implements core.Node.

type SpecPalette struct {
	// Dark reports whether this palette is the dark appearance.
	Dark bool

	// Surfaces.
	Bg          core.Color // Window and outer background (`bg`).
	Panel       core.Color // Side panels, inspector, agent panel (`panel`).
	Raised      core.Color // Cards, composer, toasts, popovers (`raised`).
	Inset       core.Color // Recessed wells, tracks, sidebar rails (`inset`).
	Viewport    core.Color // Viewport canvas surround (`.vp`).
	ViewportDot core.Color // Viewport dot grid mark.
	PillBg      core.Color // Floating overlay pill background.

	// Borders.
	Line       core.Color // Dividers between regions (`line`).
	LineRaised core.Color // Edges of raised surfaces and quiet button fills (`line raised`).

	// Four text levels, all meeting WCAG 2.2 AA (>= 4.5:1) on Bg, Panel, and Raised.
	TextPrimary   core.Color // Spec `text strong`: titles, selected rows, primary button fill.
	TextSecondary core.Color // Spec `text`: body, messages, values.
	TextMuted     core.Color // Spec `text secondary`: labels, tree rows, file names.
	TextFaint     core.Color // Spec `text muted`: hints, placeholders, meta, section labels.
	OnTextPrimary core.Color // Ink drawn on a solid TextPrimary primary button fill (Play, Send, Create).

	// Semantic roles, each carrying Fg, Fill, Edge, and OnFill.
	Accent  SpecRole // Selection, focus ring, Keep; solid.
	Agent   SpecRole // Agent working; solid violet, never blue.
	Added   SpecRole // New objects and lines; dashed.
	Changed SpecRole // Edited objects and values; dashed.
	Removed SpecRole // Deleted objects and problems/errors; solid.
	Warning SpecRole // Permission asks, waiting, warning toasts (with dedicated Fill and Edge).

	// Surface interaction overlays and 3D viewport / axis tokens (docs/design/editor/Viewport3D.dc.html).
	HoverOverlay     core.Color // Subtle hover wash over surfaces (`surfaceHover`).
	ActiveOverlay    core.Color // Subtle pressed wash over surfaces (`surfacePressed`).
	PrimaryHover     core.Color // Hover fill for solid TextPrimary buttons (`specPrimaryHover`).
	AccentHover      core.Color // Hover fill for solid Accent buttons (`accentHover`).
	AccentPressed    core.Color // Pressed fill for solid Accent buttons (`accentPressed`).
	Viewport3DGround core.Color // 3D viewport ground plane (`specViewport3DGround`).
	Viewport3DGrid   core.Color // 3D viewport grid line (`specViewport3DGrid`).
	AxisX            core.Color // 3D X axis token (`specAxisX`, #FF6B6B dark / #C92A2A light).
	AxisY            core.Color // 3D Y axis token (`specAxisY`, #4FD38A dark / #0D7A43 light).
	AxisZ            core.Color // 3D Z axis token (`specAxisZ`, #3B7BFF dark / #1D5CE6 light).
}

SpecPalette holds every color token defined by docs/design/editor/Spec.dc.html in either the Dark or Light appearance.

func DarkSpecPalette() SpecPalette

DarkSpecPalette returns the dark Spec token palette from docs/design/editor/Spec.dc.html.

func LightSpecPalette() SpecPalette

LightSpecPalette returns the light Spec token palette measured against the same WCAG 2.2 contrast table.

func SpecPaletteFor(dark bool) SpecPalette

SpecPaletteFor returns DarkSpecPalette when dark is true and LightSpecPalette otherwise.

func (p SpecPalette) FocusRing(offset core.Points) *core.Style

FocusRing returns the Spec keyboard focus ring style (2 px Accent.Edge outline with the given offset).

func (p SpecPalette) Problem() SpecRole

Problem returns the semantic role shared by removed objects and problems/errors (Spec `removed · problem`).

type SpecRole struct {
	// Fg is the foreground text, icon, glyph, or solid badge fill color.
	Fg core.Color
	// Fill is the tinted surface or pill fill color behind Fg or body text.
	Fill core.Color
	// Edge is the border, focus ring, or viewport overlay outline stroke color.
	Edge core.Color
	// OnFill is the high-contrast ink drawn directly on a solid Fg fill (>= 4.5:1 AA).
	// It is never white on a fill that fails WCAG AA (for example dark Accent #3B7BFF or dark Agent #9B7BFF).
	OnFill core.Color
}

SpecRole holds the coordinated colors for a semantic Spec token role (Accent, Agent, Added, Changed, Removed/Problem, or Warning).

type SpecSwitch struct {
	Ref      *core.Ref
	Checked  func() bool
	Disabled func() bool
	Invalid  func() bool
	OnChange func(bool)
	Label    string
	Size     ui.Size
	TestID   string
}

SpecSwitch is a Spec-compliant on/off switch (RoleSwitch, aria-checked) with a 2 px accent focus ring at +2 px offset on :focus-visible only in both Spec Dark and Spec Light appearances. Mouse clicks toggle without drawing the ring.

NSGo gap (v0.3.0): ui.Switch does not set FocusVisible on its pressable view or track.

func (s SpecSwitch) Render(cx *core.Scope) core.Node

Render implements core.Node.

type StartNameValidation struct {
	// OK reports whether the current inputs are valid and ready to create a project.
	OK bool
	// TargetDir is the resolved full target directory path.
	TargetDir string
	// DisplayPath is TargetDir shortened with "~" when inside the user's home directory.
	DisplayPath string
	// Exists reports whether TargetDir already exists on disk.
	Exists bool
	// SuggestedName is the next free sibling folder name (such as "dungeon-run-2") when Exists is true.
	SuggestedName string
	// InvalidChars reports whether Name violates the lowercase a-z, 0-9, and - rule.
	InvalidChars bool
	// NotWritable reports whether the target parent directory is not writable.
	NotWritable bool
	// Message is the human-readable validation status or error text.
	Message string
}

StartNameValidation summarizes live validation of the Start Screen's New Project name, folder, and module inputs.

func ValidateNewProjectInputs(name, parentDir, module string) StartNameValidation

ValidateNewProjectInputs checks name, parentDir, and optional module path according to the Start Screen rules: lowercase a-z, 0-9, and - starting with a letter; target folder does not exist (suggesting <name>-2 etc.); parent folder has write access; optional module path is a valid Go module path.

type StatesClipMeta struct {
	Frames     int
	Loop       bool
	Summary    string
	FirstFrame string
}

StatesClipMeta summarizes a state's animation clip for the graph node card and thumbnail.

type StatesOutgoing struct {
	Index   int
	To      string
	Detail  string
	FromAny bool
}

StatesOutgoing describes one row in the LEAVING <STATE> list.

type SuggestedProjectRule struct {
	ID            string `json:"id"`
	Pattern       string `json:"pattern"`
	Reason        string `json:"reason"`
	Rule          string `json:"rule"`
	RevertedCount int    `json:"revertedCount"`
	TotalMatches  int    `json:"totalMatches"`
	WindowSize    int    `json:"windowSize"`
}

SuggestedProjectRule is a project rule suggested from repeated reverted reviews.

type TaskRequest struct {
	ID                string
	Number            int
	Title             string
	Prompt            string
	Source            TaskSource
	PlanStep          int
	PlanTotal         int
	StartMode         TaskStartMode
	ScenePath         string
	StepSummary       string
	StepIndex         int
	StepTotal         int
	Steps             []TaskStep
	PermissionPrompt  string
	PermissionDetail  string
	Error             string
	EditingObjects    []string
	HoldingObjects    []string
	BlockedOn         string
	BlockedByTaskID   string
	StartsAfterTaskID string
	Review            *TaskReview
	TimeLabel         string
	ElapsedSeconds    int
	// InitialState optionally seeds the task directly into a specific state (for automations,
	// plan steps, tests, or restored entries) without automatically launching AgentTaskRunner.
	InitialState TaskState
}

TaskRequest configures a new background task submitted to Editor.SubmitTask.

type TaskReview struct {
	ID              string             `yaml:"id" json:"id"`
	TaskID          string             `yaml:"taskId,omitempty" json:"taskId,omitempty"`
	ScenePath       string             `yaml:"scene,omitempty" json:"scene,omitempty"`
	Summary         string             `yaml:"summary,omitempty" json:"summary,omitempty"`
	ChangeCount     int                `yaml:"changeCount,omitempty" json:"changeCount,omitempty"`
	Changes         []TaskReviewChange `yaml:"changes,omitempty" json:"changes,omitempty"`
	BeforeSceneYAML string             `yaml:"beforeSceneYaml,omitempty" json:"beforeSceneYaml,omitempty"`
	AfterSceneYAML  string             `yaml:"afterSceneYaml,omitempty" json:"afterSceneYaml,omitempty"`
	Kept            bool               `yaml:"kept,omitempty" json:"kept,omitempty"`
	Reverted        bool               `yaml:"reverted,omitempty" json:"reverted,omitempty"`
	Dismissed       bool               `yaml:"dismissed,omitempty" json:"dismissed,omitempty"`
}

TaskReview records the separate review turn produced by one completed background task.

func (r *TaskReview) EffectiveChangeCount() int

EffectiveChangeCount returns len(Changes) when populated, else ChangeCount.

type TaskReviewChange struct {
	ObjectID   string `yaml:"objectId,omitempty" json:"objectId,omitempty"`
	File       string `yaml:"file,omitempty" json:"file,omitempty"`
	Kind       string `yaml:"kind,omitempty" json:"kind,omitempty"` // "added", "changed", "removed"
	Summary    string `yaml:"summary,omitempty" json:"summary,omitempty"`
	BeforeYAML string `yaml:"beforeYaml,omitempty" json:"beforeYaml,omitempty"`
	AfterYAML  string `yaml:"afterYaml,omitempty" json:"afterYaml,omitempty"`
	Kept       bool   `yaml:"kept,omitempty" json:"kept,omitempty"`
	Reverted   bool   `yaml:"reverted,omitempty" json:"reverted,omitempty"`
}

TaskReviewChange describes one object or file change belonging to a task's turn review.

type TaskSource string

TaskSource identifies what initiated a background task (requests, plan steps, and automations share one list).

const (
	TaskSourceUser       TaskSource = "you"
	TaskSourcePlan       TaskSource = "plan"
	TaskSourceAutomation TaskSource = "automation"
)
func (s TaskSource) Valid() bool

Valid reports whether s is a known TaskSource.

type TaskStartMode string

TaskStartMode chooses whether a new request queues behind the current turn or runs in parallel.

const (
	// TaskStartQueue starts the request only after the running task is kept or reverted, so it builds on the reviewed scene.
	TaskStartQueue TaskStartMode = "queue"
	// TaskStartParallel starts immediately as a separate agent session with its own numbered overlay.
	TaskStartParallel TaskStartMode = "parallel"
)
func (m TaskStartMode) Valid() bool

Valid reports whether m is a known TaskStartMode.

type TaskState string

TaskState identifies where a background agent task sits in its lifecycle.

const (
	// TaskNeedsYou means the task is paused waiting for a person's permission or input.
	TaskNeedsYou TaskState = "needs_you"
	// TaskRunning means the task is actively running (or holding on an object another task is editing).
	TaskRunning TaskState = "running"
	// TaskReadyToReview means the task finished its turn and waits for Keep, Revert, or Dismiss.
	TaskReadyToReview TaskState = "ready_to_review"
	// TaskQueued means the task waits for the running/unreviewed task ahead of it to be kept or reverted.
	TaskQueued TaskState = "queued"
	// TaskFailed means the task exited with an error and stays visible until opened, retried, or dismissed.
	TaskFailed TaskState = "failed"
	// TaskStopped means the task was stopped/cancelled or reverted.
	TaskStopped TaskState = "stopped"
	// TaskDone means the task's turn was kept and completed.
	TaskDone TaskState = "done"
)
func (s TaskState) ActiveGroup() bool

ActiveGroup reports whether s belongs to one of the five visible groups in the Tasks tab.

func (s TaskState) IsNotifiable() bool

IsNotifiable reports whether s is one of the three states allowed to reach the person outside the editor (waiting for permission, ready to review, or failed). Running, queued, stopped, and done never send system notifications and never add to the Dock badge.

func (s TaskState) Valid() bool

Valid reports whether s is a known TaskState.

type TaskStatusPart struct {
	State TaskState
	Label string
}

TaskStatusPart is one colored dot + label segment rendered in the status bar indicator.

type TaskStep struct {
	Summary string `yaml:"summary" json:"summary"`
	Done    bool   `yaml:"done,omitempty" json:"done,omitempty"`
	Active  bool   `yaml:"active,omitempty" json:"active,omitempty"`
	Blocked bool   `yaml:"blocked,omitempty" json:"blocked,omitempty"`
}

TaskStep is one step entry shown in the focused task detail area.

type TaskSummary struct {
	NeedsYou      int `json:"needsYou"`
	Running       int `json:"running"`
	Blocked       int `json:"blocked"`
	ReadyToReview int `json:"readyToReview"`
	Queued        int `json:"queued"`
	Failed        int `json:"failed"`
	// DockBadge equals NeedsYou + ReadyToReview + Failed; Running and Queued never add to it.
	DockBadge int `json:"dockBadge"`
	// MostUrgent is the highest-priority active state (Failed > NeedsYou > ReadyToReview > Running > Queued), or empty when idle.
	MostUrgent TaskState `json:"mostUrgent,omitempty"`
}

TaskSummary aggregates active task counts and Dock badge totals for the status bar, Tasks panel, and downstream notification/Dock badge consumers (#1023).

type TerrainBrush struct {
	// Mode selects the brush operation (TerrainBrushNone disables terrain brushing).
	Mode TerrainBrushMode
	// Radius is the world-space XZ radius of the brush in meters (> 0; defaults to 8 when <= 0).
	Radius float32
	// Strength controls the per-dab brush intensity in (0, 1] (defaults to 0.5 when <= 0).
	Strength float32
	// Falloff controls how strength decays from center to radius.
	Falloff TerrainBrushFalloff
	// TargetHeight is the world-space Y elevation used by TerrainBrushSetHeight (and TerrainBrushFlatten when UseTargetHeight is true).
	TargetHeight float32
	// UseTargetHeight makes TerrainBrushFlatten target TargetHeight instead of sampling the terrain height where the stroke starts.
	UseTargetHeight bool
	// TargetDensity is the target foliage density in [0, 1] for TerrainBrushPaintFoliage (1 paints full density, 0 erases).
	TargetDensity float32
	// LayerIndex selects the material layer (0..len(doc.Layers)-1) painted by TerrainBrushPaintLayer.
	LayerIndex int
	// FoliageIndex selects the foliage layer (0..len(doc.Foliage)-1) painted by TerrainBrushPaintFoliage.
	FoliageIndex int
}

TerrainBrush configures the active terrain sculpt or paint tool.

func DefaultTerrainBrush() TerrainBrush

DefaultTerrainBrush returns sensible defaults for terrain sculpting and painting.

type TerrainBrushFalloff int

TerrainBrushFalloff selects how a terrain brush's influence decays from its center to its radius.

const (
	// TerrainFalloffSmooth uses a C1 smoothstep curve (1 at center, 0 at edge, flat derivatives at both ends).
	TerrainFalloffSmooth TerrainBrushFalloff = iota
	// TerrainFalloffLinear decays linearly from 1 at the center to 0 at the edge.
	TerrainFalloffLinear
	// TerrainFalloffFlat applies uniform weight 1 everywhere inside the brush radius.
	TerrainFalloffFlat
)
func (f TerrainBrushFalloff) String() string

String returns a human-readable label for f.

type TerrainBrushMode int

TerrainBrushMode selects the active terrain sculpting or painting brush in the 3D viewport.

const (
	// TerrainBrushNone leaves normal 3D object picking, gizmos, and camera orbiting active.
	TerrainBrushNone TerrainBrushMode = iota
	// TerrainBrushRaise raises heightmap vertices within the brush radius.
	TerrainBrushRaise
	// TerrainBrushLower lowers heightmap vertices within the brush radius.
	TerrainBrushLower
	// TerrainBrushSmooth blends heightmap vertices toward their local neighborhood average.
	TerrainBrushSmooth
	// TerrainBrushFlatten levels heightmap vertices toward the height sampled at the start of the stroke (or TargetHeight when UseTargetHeight is true).
	TerrainBrushFlatten
	// TerrainBrushSetHeight moves heightmap vertices toward TerrainBrush.TargetHeight.
	TerrainBrushSetHeight
	// TerrainBrushPaintLayer increases the weight of TerrainBrush.LayerIndex and renormalizes the remaining material layers.
	TerrainBrushPaintLayer
	// TerrainBrushPaintFoliage blends the density of TerrainBrush.FoliageIndex toward TerrainBrush.TargetDensity.
	TerrainBrushPaintFoliage
)
func (m TerrainBrushMode) String() string

String returns a human-readable label for m.

type TileCoord struct {
	Col int `json:"col"`
	Row int `json:"row"`
}

TileCoord is a 0-based (Col, Row) cell coordinate on an inline tilemap.

type TilePalette struct {
	// Layer is the active layer's name.
	Layer string
	// Tileset is the atlas a single grid names, or the YAML tileset file a layered grid names; empty when the layer has no inline tilemap.
	Tileset string
	// TileWidth and TileHeight are the tilemap's tile size in points, which the palette shows each tile at.
	TileWidth, TileHeight int
	// Columns is the number of tiles per row in the palette grid (the YAML tileset's Columns when set, otherwise the panel's wrapped row width).
	Columns int
	// TileLayers are the names of a layered grid's tile layers, in order, and TileLayer the one tile tools change (Editor.ActiveTileLayer, or the first); both are empty for a single grid.
	TileLayers []string
	TileLayer  string
	// Terrains are the terrain sets defined in a layered grid's YAML tileset, and ActiveTerrain the one ToolTerrain paints (Editor.ActiveTerrain, or the first).
	Terrains      []PaletteTerrain
	ActiveTerrain string
	// Tiles are the tileset's tiles in ascending ID order.
	Tiles []PaletteTile
	// Message says why Tiles is empty, such as a layer without an inline tilemap or a tileset that does not resolve; it is empty when Tiles is not.
	Message string
}

TilePalette is what the tile palette shows for the active layer: the tiles of the tileset its inline tilemap names, in tile ID order, or, when there are none to pick, why.

func (p TilePalette) Has(id int) bool

Has reports whether p holds a tile with the given ID.

func (p TilePalette) Tile(id int) (PaletteTile, bool)

Tile returns the tile of p with the given ID, and whether p holds one.

type TilePreviewCell struct {
	Col   int
	Row   int
	Tile  int
	Flip  uint32
	Erase bool
}

TilePreviewCell is one cell in an in-progress brush stroke's live preview before release.

type TileQueryOptions struct {
	// Layer names the scene layer to query; empty uses ActiveLayer or the first layer with an inline tilemap.
	Layer string
	// TileLayer names the tile layer of a layered tilemap; empty uses ActiveTileLayer or its first tile layer.
	TileLayer string
	// TileIDs filters cells matching any of these tile IDs (0 = empty, >0 = tile ID as PaintTile takes it).
	TileIDs []int
	// TileNames filters cells matching any of these named tiles in the layer's YAML tileset.
	TileNames []string
	// EmptyOnly matches only empty cells (tile ID 0) when true.
	EmptyOnly bool
	// Rect, when non-nil, restricts the query to an inclusive sub-rectangle clamped to the map bounds.
	Rect *TileRect
	// MinCells filters out connected regions smaller than MinCells.
	MinCells int
	// Diagonal uses 8-connected neighbors instead of the default 4-connected grid neighbors.
	Diagonal bool
	// IncludeCells controls whether each region includes its explicit Cells list.
	// When nil, cells are included automatically when total matched cells <= 512.
	IncludeCells *bool
}

TileQueryOptions configures Editor.QueryTiles.

type TileQueryRegion struct {
	Bounds      TileRect    `json:"bounds"`
	Width       int         `json:"width"`
	Height      int         `json:"height"`
	CellCount   int         `json:"cellCount"`
	Rectangular bool        `json:"rectangular"`
	TileIDs     []int       `json:"tileIds,omitempty"`
	TileNames   []string    `json:"tileNames,omitempty"`
	Summary     string      `json:"summary"`
	Cells       []TileCoord `json:"cells,omitempty"`
}

TileQueryRegion is one connected region of matching cells found by Editor.QueryTiles.

type TileQueryResult struct {
	Layer        string            `json:"layer"`
	TileLayer    string            `json:"tileLayer,omitempty"`
	Tileset      string            `json:"tileset,omitempty"`
	Width        int               `json:"width"`
	Height       int               `json:"height"`
	TileWidth    int               `json:"tileWidth"`
	TileHeight   int               `json:"tileHeight"`
	MatchedCells int               `json:"matchedCells"`
	Regions      []TileQueryRegion `json:"regions"`
}

TileQueryResult is what Editor.QueryTiles returns.

type TileRect struct {
	Col0, Row0 int
	Col1, Row1 int
}

TileRect is an inclusive cell rectangle on an inline tilemap, with Col0 <= Col1 and Row0 <= Row1.

func (r TileRect) Height() int

Height returns the number of rows in r (0 when invalid).

func (r TileRect) Width() int

Width returns the number of columns in r (0 when invalid).

type TileReviewCell struct {
	Col    int   `json:"col"`
	Row    int   `json:"row"`
	OldGID int64 `json:"oldTile"`
	NewGID int64 `json:"newTile"`
}

TileReviewCell is one changed cell belonging to a TileReviewRegion.

type TileReviewKind string

TileReviewKind classifies how a tile review region differs from the pre-review tilemap.

const (
	// TileReviewPainted marks cells that were empty before and now hold a tile.
	TileReviewPainted TileReviewKind = "painted"
	// TileReviewReplaced marks cells that held a tile before and now hold a different tile or flip.
	TileReviewReplaced TileReviewKind = "replaced"
	// TileReviewErased marks cells that held a tile before and are now empty.
	TileReviewErased TileReviewKind = "erased"
)
type TileReviewRegion struct {
	ID       string           `json:"id"`
	Kind     TileReviewKind   `json:"kind"`
	Sign     string           `json:"sign"`
	Title    string           `json:"title"`
	Detail   string           `json:"detail"`
	Bounds   TileRect         `json:"bounds"`
	Cells    []TileReviewCell `json:"cells,omitempty"`
	Reverted bool             `json:"reverted"`
}

TileReviewRegion is one connected region of pending agent tile edits that can be reverted or restored independently.

type TileReviewStep struct {
	Tool         string `json:"tool"`
	Summary      string `json:"summary"`
	ChangedCells int    `json:"changedCells"`
}

TileReviewStep records one agent tile tool step inside the active tile review.

type TileReviewView int

TileReviewView selects whether the viewport shows the Before or After state during a tile review.

const (
	TileReviewAfter TileReviewView = iota
	TileReviewBefore
)
type TileStamp struct {
	Width  int
	Height int
	Tiles  []int
	Flips  []uint32
}

TileStamp is a rectangular pattern of tiles painted by the Stamp brush or held by the tile region clipboard. Tiles is row-major of length Width*Height: 0 is an empty cell, and a positive integer is a tile ID (as PaintTile takes it). Flips, when non-empty (length Width*Height), carries per-cell flip bits (tilemap.FlipHorizontal, FlipVertical, FlipDiagonal) for layered tilemaps.

func (s TileStamp) Cell(col, row int) (int, uint32)

Cell returns the tile ID and flip bits at (col, row) within s, or (0, 0) out of bounds.

func (s TileStamp) Clone() TileStamp

Clone returns an independent copy of s.

func (s TileStamp) Empty() bool

Empty reports whether s holds no cells.

type TileStrokeMode int

TileStrokeMode says what a tile stroke (Editor.BeginTileStroke) does to the cells under the pointer.

const (
	// TileStrokePaint writes the active tile (ActiveTileID) into every cell the stroke crosses.
	TileStrokePaint TileStrokeMode = iota
	// TileStrokeErase clears every cell the stroke crosses.
	TileStrokeErase
	// TileStrokePick makes the tile in the cell under the pointer the active tile, as the pointer moves, and edits nothing.
	TileStrokePick
	// TileStrokeTerrain places terrain tiles from the active terrain set into every cell the stroke crosses and updates neighbors with SetAutotile rules.
	TileStrokeTerrain
	// TileStrokeEraseTerrain removes terrain from every cell the stroke crosses and updates neighbors with SetAutotile rules.
	TileStrokeEraseTerrain
	// TileStrokeRect fills the dragged rectangle with ActiveTileID, previewed live and committed on EndTileStroke.
	TileStrokeRect
	// TileStrokeRectErase clears every cell in the dragged rectangle, previewed live and committed on EndTileStroke.
	TileStrokeRectErase
	// TileStrokeLine draws a Bresenham line of ActiveTileID between the start and end cells, previewed live and committed on EndTileStroke.
	TileStrokeLine
	// TileStrokeLineErase clears every cell along a Bresenham line between the start and end cells, previewed live and committed on EndTileStroke.
	TileStrokeLineErase
	// TileStrokeStamp paints the active TileStamp pattern along the stroke, pattern-aligned to the start cell, previewed live and committed on EndTileStroke.
	TileStrokeStamp
	// TileStrokeRandom paints deterministic weighted picks from the random brush pool along the stroke, previewed live and committed on EndTileStroke.
	TileStrokeRandom
	// TileStrokeSelectRegion selects a rectangular region of cells on the active tilemap for Copy or Cut.
	TileStrokeSelectRegion
)
func (m TileStrokeMode) String() string

String returns a human-readable label for the mode.

type TilesetEditorTab string

TilesetEditorTab selects which per-tile editing tab is shown in the Tileset Editor panel.

const (
	// TilesetTabTerrain edits 4-bit cardinal and 8-bit blob autotile masks.
	TilesetTabTerrain TilesetEditorTab = "terrain"
	// TilesetTabCollision edits per-tile solid/one-way/custom flags and rect/polygon collision shapes.
	TilesetTabCollision TilesetEditorTab = "collision"
	// TilesetTabAnimation edits per-tile animation frames, durations, and live playback preview.
	TilesetTabAnimation TilesetEditorTab = "animation"
	// TilesetTabData edits per-tile name, variant weight, and typed custom properties.
	TilesetTabData TilesetEditorTab = "data"
)
type TilesetShapeTool string

TilesetShapeTool selects the interactive collision shape drawing tool on the tile canvas.

const (
	// TilesetShapeToolRect adds or edits rectangular collision shapes over the tile.
	TilesetShapeToolRect TilesetShapeTool = "rect"
	// TilesetShapeToolPolygon clicks vertices over the tile to construct a polygon collision shape.
	TilesetShapeToolPolygon TilesetShapeTool = "polygon"
)
type Toast struct {
	// ID optionally deduplicates repeated identical events in the toast queue.
	ID string
	// Kind selects the icon shape and surface styling (ToastWarning uses Spec Warning.Fill and Warning.Edge).
	Kind ToastKind
	// Message is the single-line feedback text.
	Message string
	// ActionLabel is an optional short verb button label (for example "Undo", "Show", "Retry", or "Cancel").
	ActionLabel string
	// ActionShortcut is an optional keyboard shortcut hint shown next to ActionLabel (for example "⌘Z").
	ActionShortcut string
	// OnAction runs when the user activates the toast's action button.
	OnAction func()
	// Progress is the 0..1 completion fraction for ToastProgress toasts.
	Progress float32
	// Dismissible reports whether a Dismiss button is shown; defaults to true when Kind != ToastProgress.
	Dismissible *bool
}

Toast describes a transient feedback message shown at the bottom center of the editor viewport (or bottom center of the window when no viewport is on screen, per docs/design/editor/Toasts.dc.html). Decisions never go in a toast; at most one action button is shown.

type ToastEvent struct {
	// Kind selects canonical Spec defaults (toast tone, action label, shortcut, timeout,
	// and default deduplication key).
	Kind ToastEventKind
	// ID optionally overrides the default deduplication key derived from Kind and Target.
	ID string
	// Target optionally identifies the subject (for example a file path or export preset)
	// used to scope the default deduplication key when ID is empty.
	Target string
	// Message is the single-line feedback text displayed in the toast.
	Message string
	// ActionLabel optionally overrides the canonical verb button label for Kind.
	ActionLabel string
	// ActionShortcut optionally overrides the canonical keyboard shortcut hint for Kind
	// (for example "⌘Z" or "Ctrl+Z").
	ActionShortcut string
	// OnAction runs when the user activates the toast's action button.
	OnAction func()
	// OnCancel runs when the user activates Cancel on a ToastEventExportRunning toast or
	// calls ToastHandle.Cancel. If OnAction is nil on a progress event, Cancel runs OnCancel.
	OnCancel func()
	// Progress is the initial 0..1 completion fraction for ToastEventExportRunning toasts.
	Progress float32
}

ToastEvent describes a Spec feedback-channel event routed to the editor's toast queue via Editor.EmitToastEvent.

type ToastEventKind string

ToastEventKind identifies a canonical passing-feedback event from the Spec's Feedback channels table (docs/design/editor/Spec.dc.html). Screens emit events through Editor.EmitToastEvent instead of inventing ad-hoc tones, durations, or queue keys.

const (
	ToastEventReviewKept      ToastEventKind = "review.kept"
	ToastEventReviewReverted  ToastEventKind = "review.reverted"
	ToastEventFixApplied      ToastEventKind = "problem.fix_applied"
	ToastEventAgentStopped    ToastEventKind = "agent.stopped"
	ToastEventPermissionSaved ToastEventKind = "permission.rule_saved"
	ToastEventCopied          ToastEventKind = "clipboard.copied"
	ToastEventDiskChanged     ToastEventKind = "disk.file_changed"
	ToastEventSaveFailed      ToastEventKind = "save.failed"
	ToastEventExportRunning   ToastEventKind = "export.running"
	ToastEventExportFailed    ToastEventKind = "export.failed"
)
type ToastHandle struct {
	// contains filtered or unexported fields
}

ToastHandle tracks a toast emitted into an Editor so long-running work (such as an export) can update its percent, transition in place into a success or error toast when the work finishes, cancel that work, or dismiss the toast. All methods are safe on a nil handle.

func (h *ToastHandle) Active() bool

Active reports whether this toast is currently visible or waiting in the editor's queue.

func (h *ToastHandle) Cancel()

Cancel invokes the toast's cancellation callback (if any) once and dismisses the toast.

func (h *ToastHandle) Complete(message, actionLabel, actionShortcut string, onAction func())

Complete transitions a running progress (or active) toast in place into a ToastSuccess toast (for example "Exported build/macos/dungeon-run.app" with "Show in Finder"), starting its Spec auto-dismiss timer (4 s, or 6 s when actionLabel is non-empty).

func (h *ToastHandle) Dismiss()

Dismiss removes this specific toast from the visible slot or waiting queue.

func (h *ToastHandle) Fail(message, actionLabel string, onRetry func())

Fail transitions a running progress (or active) toast in place into a persistent ToastError toast (staying until retried or dismissed) with an optional Retry action.

func (h *ToastHandle) ID() string

ID returns the toast's queue/deduplication identifier.

func (h *ToastHandle) SetProgress(progress float32, message string)

SetProgress updates a running progress toast's 0..1 completion fraction and optional message in place without disturbing its queue position, motion state, or keyboard focus.

type ToastKind string

ToastKind identifies the visual tone and semantic icon of an editor toast (docs/design/editor/Toasts.dc.html).

const (
	ToastSuccess  ToastKind = "success"
	ToastInfo     ToastKind = "info"
	ToastWarning  ToastKind = "warning"
	ToastError    ToastKind = "error"
	ToastProgress ToastKind = "progress"
)
type Tool int

Tool selects the active viewport interaction mode.

const (
	ToolSelect Tool = iota
	ToolMove
	ToolPlace
	ToolPaintTile
	ToolEraseTile
	ToolFillTile
	// ToolPlugin is a plugin's tool, chosen with Editor.SetPluginTool; SetTool(ToolPlugin) is ignored.
	ToolPlugin
	// ToolPickTile takes the tile under the pointer as the active tile (Editor.PickTile), then hands over to ToolPaintTile.
	ToolPickTile
	// ToolTerrain paints or erases autotiled terrain sets from a layered grid's YAML tileset, updating each cell and its neighbors through the same rules as tilemap.Tilemap.SetAutotile.
	ToolTerrain
	// ToolRectTile fills or erases a dragged rectangle of tiles on the active layer's inline tilemap.
	ToolRectTile
	// ToolLineTile draws or erases a Bresenham line of tiles between two cells.
	ToolLineTile
	// ToolStampTile paints a rectangular TileStamp pattern (selected from the palette or copied/cut from the map).
	ToolStampTile
	// ToolRandomTile paints a deterministic weighted random pick from selected tiles.
	ToolRandomTile
	// ToolNavTestPath sets start and end world points on click to preview the path ai.NavMesh.FindPath finds on the built 2D navigation mesh.
	ToolNavTestPath
	// ToolRotate rotates the selected object in 2D (and sets 3D Gizmo3DRotate).
	ToolRotate
	// ToolScale scales the selected object in 2D (and sets 3D Gizmo3DScale).
	ToolScale
	// ToolPan pans the viewport camera on drag.
	ToolPan
)
func (t Tool) String() string

String returns a human-readable label for the tool.

type Transform3D struct {
	X, Y, PosZ       float32
	RotX, RotY, RotZ float32
	ScaleX           *float32
	ScaleY           *float32
	ScaleZ           *float32
}

Transform3D snapshots an object's 3D transform fields (preserving nil Scale pointers so Undo restores unset YAML fields byte-for-byte).

type UsageFileGroup struct {
	File            string         `json:"file"`
	Name            string         `json:"name"`
	Group           UsageGroupKind `json:"group"`
	NotRewritten    bool           `json:"notRewritten,omitempty"`
	VirtualWidth    float32        `json:"virtualWidth,omitempty"`
	VirtualHeight   float32        `json:"virtualHeight,omitempty"`
	BackgroundColor string         `json:"backgroundColor,omitempty"`
	Refs            []UsageItem    `json:"refs"`
}

UsageFileGroup groups all usages inside one project file.

type UsageGroupKind string

UsageGroupKind classifies a usage into one of the four primary References screen categories (plus Other).

const (
	// UsageGroupScenes lists scene instances referencing the target file, with override counts.
	UsageGroupScenes UsageGroupKind = "scenes"
	// UsageGroupVariants lists prefab or scene variants that inherit the target file.
	UsageGroupVariants UsageGroupKind = "variants"
	// UsageGroupDataTables lists data table rows referencing the target file.
	UsageGroupDataTables UsageGroupKind = "data"
	// UsageGroupGoCode lists Go string literals or constants holding the target path (not rewritten).
	UsageGroupGoCode UsageGroupKind = "go"
	// UsageGroupOther lists references in other YAML/JSON project files (such as game.yaml, cutscenes, or screens).
	UsageGroupOther UsageGroupKind = "other"
)
type UsageItem struct {
	File          string         `json:"file"`
	Line          int            `json:"line"`
	Column        int            `json:"column,omitempty"`
	Group         UsageGroupKind `json:"group"`
	Label         string         `json:"label"`
	Field         string         `json:"field"`
	Value         string         `json:"value"`
	ObjectID      string         `json:"objectId,omitempty"`
	TopObjectID   string         `json:"topObjectId,omitempty"`
	RowID         string         `json:"rowId,omitempty"`
	GoIdent       string         `json:"goIdent,omitempty"`
	X             float32        `json:"x,omitempty"`
	Y             float32        `json:"y,omitempty"`
	HasPos        bool           `json:"hasPos,omitempty"`
	OverrideCount int            `json:"overrideCount,omitempty"`
	Overrides     []string       `json:"overrides,omitempty"`
	NotRewritten  bool           `json:"notRewritten,omitempty"`
}

UsageItem is one occurrence of a reference to the target file.

type UsagesReport struct {
	Target      string           `json:"target"`
	TotalUsages int              `json:"totalUsages"`
	TotalFiles  int              `json:"totalFiles"`
	Scenes      []UsageFileGroup `json:"scenes,omitempty"`
	Variants    []UsageFileGroup `json:"variants,omitempty"`
	DataTables  []UsageFileGroup `json:"dataTables,omitempty"`
	GoCode      []UsageFileGroup `json:"goCode,omitempty"`
	Other       []UsageFileGroup `json:"other,omitempty"`
}

UsagesReport is the grouped result of Editor.FindUsages across scenes, prefab variants, data tables, Go code, and other files.

func (r *UsagesReport) AllFiles() []UsageFileGroup

AllFiles returns all grouped files in display order: Scenes, Prefab Variants, Data Tables, Go Code, Other.

func (r *UsagesReport) FileByPath(p string) *UsageFileGroup

FileByPath looks up a UsageFileGroup by its slash-separated project path.

type View2D struct {
	// X and Y are the world point shown at the center of the viewport's canvas.
	X, Y float32
	// Zoom is how many canvas points one world unit spans, between MinView2DZoom and MaxView2DZoom.
	Zoom float32
	// Rotation turns the view in radians, as CameraDoc.Rotation turns the scene's camera: the world turns by -Rotation on the canvas. Panning and zooming keep it; only the scene camera's view (ResetView2D) sets it.
	Rotation float32
}

View2D is the 2D viewport's own view of the world: the editor's camera, which the author pans and zooms to reach any part of a level. It is separate from the scene's camera (SceneDoc.Camera), which says what the player sees, and is never saved to the scene nor recorded in History.

type View3D int

View3D names one of the six axis-aligned views of the 3D viewport, each looking at Target from one end of a world axis.

const (
	// View3DFront looks from +Z toward -Z.
	View3DFront View3D = iota
	// View3DBack looks from -Z toward +Z.
	View3DBack
	// View3DRight looks from +X toward -X.
	View3DRight
	// View3DLeft looks from -X toward +X.
	View3DLeft
	// View3DTop looks straight down from +Y, with -Z at the top of the view.
	View3DTop
	// View3DBottom looks straight up from -Y, with +Z at the top of the view.
	View3DBottom
)
func (v View3D) String() string

String returns the view's name: Front, Back, Right, Left, Top or Bottom.

type ViewMode int

ViewMode selects whether the editor viewport renders and edits in 2D or 3D.

const (
	ViewMode2D ViewMode = iota
	ViewMode3D
)
func (m ViewMode) String() string

String returns a human-readable label for the view mode.

type Viewport3DAgentPromptKind int

Viewport3DAgentPromptKind identifies what the 3D viewport's inline agent prompt is asking for.

const (
	// Viewport3DAgentPromptNone means the 3D inline agent prompt is closed.
	Viewport3DAgentPromptNone Viewport3DAgentPromptKind = iota
	// Viewport3DAgentPromptModel asks the agent for a new 3D model ("Or ask for one").
	Viewport3DAgentPromptModel
	// Viewport3DAgentPromptComponent asks the agent to add a component to the selected object ("Ask to add a component…").
	Viewport3DAgentPromptComponent
)
type Viewport3DAgentRequest struct {
	Kind     Viewport3DAgentPromptKind
	ObjectID string
	Prompt   string
}

Viewport3DAgentRequest is dispatched when the author submits a prompt from the 3D MODELS strip ("Or ask for one") or from the 3D inspector ("Ask to add a component…").

type ViewportLiveOverlay struct {
	Kind     OverlayLegendKind `json:"kind"`
	ObjectID string            `json:"objectId"`
	Label    string            `json:"label"`
	Detail   string            `json:"detail,omitempty"`
	Dashed   bool              `json:"dashed"`
	OutsetPx float32           `json:"outsetPx"`
	Ghost    bool              `json:"ghost,omitempty"`
	Visible  bool              `json:"visible"`
	ReadOnly bool              `json:"readOnly,omitempty"`
}

ViewportLiveOverlay describes one inspectable overlay drawn in the viewport for the current editor state.

type ViewportOverlay struct {
	// ID uniquely identifies the overlay in editor settings and editormcp's viewport_overlays list.
	// It must be non-empty with no spaces or control characters.
	ID string
	// Name is the human-readable label shown in the Overlays popover (for example "Patrol paths").
	Name string
	// NameKey is an optional localization key resolved in the editor's or owning plugin's catalog.
	NameKey string
	// DefaultOn sets whether the overlay starts enabled when EditorSettings.ViewportOverlays is nil.
	DefaultOn bool
	// Color is the swatch color (from Spec tokens for built-in overlays).
	Color core.Color
	// Swatch selects the swatch style rendered beside Name in the Overlays popover.
	Swatch ViewportOverlaySwatch
	// Count optionally returns the live item count in the current scene for the Overlays popover.
	Count func(ed *Editor) int
	// CountUnit optionally formats a count with a unit noun (for example "5 shapes" or "2 regions").
	CountUnit func(ed *Editor, n int) string
	// Draw renders the overlay onto d in canvas coordinates (using Editor.WorldToCanvas or Editor.layerAffineFor).
	Draw func(ed *Editor, d *core.Drawing, scene *sceneformat.BuiltScene)
	// contains filtered or unexported fields
}

ViewportOverlay describes a toggleable 2D viewport overlay drawn in both the live editor viewport and the editor MCP server's viewport_image tool. Plugins can register custom overlays via Plugin.Overlays or Editor.RegisterViewportOverlay.

type ViewportOverlaySwatch int

ViewportOverlaySwatch selects the visual legend swatch shown beside an overlay row in the Overlays popover.

const (
	// OverlaySwatchBox draws a solid rectangular outline swatch.
	OverlaySwatchBox ViewportOverlaySwatch = iota
	// OverlaySwatchDashedBox draws a dotted/dashed rectangular outline with subtle tinted fill.
	OverlaySwatchDashedBox
	// OverlaySwatchLine draws a solid horizontal line swatch.
	OverlaySwatchLine
	// OverlaySwatchDashedLine draws a dotted/dashed horizontal line swatch.
	OverlaySwatchDashedLine
	// OverlaySwatchRegion draws a shaded region swatch with a top edge line.
	OverlaySwatchRegion
	// OverlaySwatchLabel draws an underline bar representing text labels.
	OverlaySwatchLabel
)
type WebBridgeInfo struct {
	Protocol          string `json:"protocol"`
	Project           string `json:"project"`
	PlayMode          bool   `json:"playMode"`
	SessionEndpoint   string `json:"sessionEndpoint"`
	RPCEndpoint       string `json:"rpcEndpoint"`
	PollEndpoint      string `json:"pollEndpoint"`
	ReplyEndpoint     string `json:"replyEndpoint"`
	BridgeScript      string `json:"bridgeScript"`
	Token             string `json:"token"`
	ConnectedClients  int    `json:"connectedClients"`
	EditorBridgeReady bool   `json:"editorBridgeReady"`
}

WebBridgeInfo is returned by GET /__nsgo_mcp/info so a served web build in Play mode can connect back to the editor's MCP bridge.

type WebBridgeSession struct {
	SessionID    string    `json:"sessionId"`
	ClientID     string    `json:"clientId,omitempty"`
	Device       string    `json:"device"`
	RemoteIP     string    `json:"remoteIp"`
	PlayMode     bool      `json:"playMode"`
	Capabilities []string  `json:"capabilities,omitempty"`
	ConnectedAt  time.Time `json:"connectedAt"`
}

WebBridgeSession records one phone or browser Play-mode client connected back to the editor's MCP bridge.

type WebBuildServerSnapshot struct {
	Serving          bool               `json:"serving"`
	StoppedByUser    bool               `json:"stoppedByUser"`
	URL              string             `json:"url,omitempty"`
	ListenAddr       string             `json:"listenAddr,omitempty"`
	Host             string             `json:"host,omitempty"`
	Port             int                `json:"port,omitempty"`
	ServeDir         string             `json:"serveDir,omitempty"`
	BridgeInfoURL    string             `json:"bridgeInfoUrl,omitempty"`
	BridgeToken      string             `json:"bridgeToken,omitempty"`
	ConnectedClients []WebBridgeSession `json:"connectedClients,omitempty"`
	LastErr          string             `json:"lastErr,omitempty"`
}

WebBuildServerSnapshot is a thread-safe value copy of the LAN web build server state.

type WeightedTile struct {
	TileID int
	Weight float64
}

WeightedTile is one weighted entry in the Random brush's tile pool.

type WorkspaceState uint8

WorkspaceState classifies the high-level state of the main editor workspace so every region (header, left rail, viewport, right panel, status bar) can render a designed empty, loading, error, or active editing state.

const (
	// WorkspaceReady means an editable scene is open and ready.
	WorkspaceReady WorkspaceState = iota
	// WorkspaceNoProject means no project and no real scene have been opened yet.
	WorkspaceNoProject
	// WorkspaceNoScene means a project is open, but no scene is currently open.
	WorkspaceNoScene
	// WorkspaceLoading means a project is currently being loaded.
	WorkspaceLoading
	// WorkspaceSceneError means opening a scene failed (missing file, malformed YAML, etc.).
	WorkspaceSceneError
)
type YouOnlyDomain string

YouOnlyDomain names one of the four You-only settings domains that the agent may never write directly.

const (
	// YouOnlyPermissions protects permissions.yaml and .nsgo/permissions.yaml.
	YouOnlyPermissions YouOnlyDomain = "permissions"
	// YouOnlyTools protects the MCP tool list and external server list (tools.yaml, mcp.yaml).
	YouOnlyTools YouOnlyDomain = "tools"
	// YouOnlyModels protects model connections and routing settings (models.yaml).
	YouOnlyModels YouOnlyDomain = "models"
	// YouOnlyUsage protects usage limits and privacy toggles (usage.yaml).
	YouOnlyUsage YouOnlyDomain = "usage"
	// YouOnlyAutomations protects automations.yaml and .nsgo/automations-state.yaml so agents can only draft automations for the person to keep.
	YouOnlyAutomations YouOnlyDomain = "automations"
)
func MatchYouOnlyPath(filePath string) (YouOnlyDomain, bool)

MatchYouOnlyPath reports whether filePath targets a You-only configuration file (permissions, tools, models, usage, or automations) that the MCP server refuses every agent write to, regardless of profile or rules.

func (d YouOnlyDomain) DisplayName() string

DisplayName returns the human-readable Settings page name for d.