Skip to content

Architecture

Pane Model

Ghosted has six panes, all always mounted and shown/hidden via CSS (never unmounted). This preserves terminal state and graph positions across pane switches.

PaneDescription
EditorMonaco multi-tab + TerminalPane split (default view)
TerminalStandalone TerminalPane
GraphForce-directed WebGL knowledge graph, scans [[wikilinks]]
Canvas@xyflow/react agent workflow editor
Kanbandnd-kit + GitHub Projects v2 GraphQL
File Treereact-arborist, Electron IPC filesystem

Active pane is stored in Zustand + localStorage.

IPC Architecture

All filesystem and PTY operations go through Electron IPC. The renderer never touches Node APIs directly.

ChannelDirectionPurpose
fs:readdirinvokeList directory
fs:readfileinvokeRead file as UTF-8
fs:writefileinvokeWrite file
fs:homedirinvokeGet home directory
dialog:openFolderinvokeNative folder picker
shell:openExternalinvokeOpen URL in browser
pty:createinvokeSpawn PTY shell
pty:writeinvokeSend input to PTY
pty:resizeinvokeResize PTY cols/rows
pty:killinvokeKill PTY process
pty:data:{id}on (push)PTY output data
pty:exit:{id}on (push)PTY process exited

State Management

Zustand store at src/store/index.ts:

  • workspacePath — currently open folder
  • openFiles — array of {path, name, content, isDirty}
  • activeFilePath — currently focused tab
  • activePane — which pane is visible
  • paneOrder — tab order (persisted to localStorage)
  • githubToken — PAT for Kanban GitHub Projects API

GhostedDB

In-memory markdown index that watches your workspace with chokidar, parses YAML frontmatter with gray-matter, extracts [[wikilinks]], and exposes a query API. The knowledge graph and agent canvas both read from it.