Log inGet started
What it does

text_editor_window

Desktop Text Editor window — a multi-file code editor with an integrated coding agent. Owns its own in-memory virtual file set (defined in INITIAL_FILES) and registers a suite of file tools (file_create/file_delete/file_edit/file_read/file_list/file_search) against tools.registry so the agent can mutate the editor's files.

Exports

  • M.createState() -> EditorApp — build a fresh app state with the default initial files and register the file tools (idempotent across the process).
  • M.update(app: EditorApp?) -> any — per-frame agent poll; truthy when the agent UI requested a re-render.
  • M.buildScreen(app: EditorApp, desktopState: DesktopState?) -> any — build the editor window widget tree. desktopState.text_editor_maximized controls full-screen layout.
  • M.handleCallback(app: EditorApp?, callbackId: string, data: any) -> boolean — dispatch a UI callback. Returns true when consumed.

Types:

  • EditorFile = { path, language, text }
  • EditorApp = { files, file_buffers, file_languages, selected_file_path, file_query, language_index, line_numbers, folding, editor_text, agent_state }
  • DesktopState = { text_editor_maximized? }

Usage

local TextEditorWindow = require("@builtin::modules.text_editor_window")

local app = TextEditorWindow.createState()
-- Per frame:
TextEditorWindow.update(app)
local widget = TextEditorWindow.buildScreen(app, desktopState)
-- In your router:
TextEditorWindow.handleCallback(app, callbackId, data)

Notes

  • The agent's file tools target a single live app at a time, tracked via the module-local ACTIVE_APP upvalue. The most recent createState call wins — open the text editor once per desktop session.
  • LANGUAGE_OPTIONS is fixed at {"lua","yaml","json"}. zui emits a 1-based dropdown index; storage stays 0-based and the callback bridge converts at the boundary.
  • File-buffer / file-languages dictionaries shadow the per-file text so unsaved edits aren't lost when switching files in the explorer.
  • The agent panel is built from editor_agent_ui with a fixed agent_id_prefix = "editor-agent"; the callback handler forwards any callback id starting with editor-agent- to the agent UI.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

This asset doesn't declare a schema or structured payload.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

0items
This part has no composite children. See the Files segment for its leaf payloads.
This part has no leaf payloads.

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.