Prox OS Internal Docs
PlatformPackagesFrontendInteraction

Editor Package

@prox-os/editor is the shared editing surface package for Prox OS apps. It

@prox-os/editor is the shared editing surface package for Prox OS apps. It defines an editor value contract, document model, provider boundary, toolbar action shape, React primitives, Tiptap rich text adapter, CodeMirror markdown/code/prompt adapter, and Storybook examples.

It is not a Notion clone, Google Docs clone, collaborative document backend, or single-editor lock-in. Apps own domain content, persistence, permissions, and AI side effects.

Package Scope

The package provides:

  • editor value, document, mode, format, provider, selection, and status types;
  • helper functions for editor values, documents, serialization, counts, and empty checks;
  • editor action helpers aligned with @prox-os/actions;
  • Tiptap-backed OsRichTextEditor;
  • CodeMirror-backed OsMarkdownEditor, OsCodeEditor, and OsPromptEditor;
  • lightweight OsCommentEditor;
  • shell, toolbar, status, preview, read-only, and empty-state primitives;
  • demo documents for dream notes, founder memos, app descriptions, prompts, comment drafts, and code snippets.

Core Types

  • OsEditorValue
  • OsEditorDocument
  • OsEditorFormat
  • OsEditorMode
  • OsEditorProvider
  • OsEditorSelectionSummary
  • OsEditorToolbarItem
  • OsEditorStatus
  • OsEditorChangeHandler

Core Components

  • OsEditorShell
  • OsRichTextEditor
  • OsMarkdownEditor
  • OsCodeEditor
  • OsPromptEditor
  • OsCommentEditor
  • OsEditorToolbar
  • OsEditorStatusBar
  • OsEditorPreview
  • OsEditorEmptyState
  • OsEditorReadOnly
  • OsEditorFormatBadge
  • OsEditorWordCount

Phase 1 Adapters

Tiptap is the Phase 1 rich text adapter because it gives Prox OS a pragmatic React editing surface with StarterKit, links, placeholders, and character count without building a custom rich text engine.

CodeMirror is the Phase 1 structured text adapter because markdown, code, prompt text, JSON snippets, and developer-facing configuration are better served by a focused text editor than by a document editor.

The public API is still OsEditor*. Apps should not couple themselves to Tiptap or CodeMirror internals unless they are writing an adapter.

Future Adapter Candidates

CandidateFuture rolePhase 1 stance
LexicalHigh-performance lower-level rich text adapter.Documented only.
PlateBlock/rich text UI composition candidate.Documented only.
MonacoHeavy developer IDE/code workspace adapter.Not installed in Phase 1.
YjsCollaboration/CRDT foundation.Future @prox-os/collaboration, not editor Phase 1.

Storybook

Open UI Workshop and browse:

  • Editor / OsEditorShell
  • Editor / OsRichTextEditor
  • Editor / OsMarkdownEditor
  • Editor / OsCodeEditor
  • Editor / OsPromptEditor
  • Editor / OsCommentEditor
  • Editor / OsEditorPreview
  • Editor / Integration

These stories cover rich text, markdown preview placeholders, JSON and JavaScript snippets, prompt variables, comment drafts, read-only preview, status states, action toolbar, forms integration, and AI rewrite placeholders.

Package Relationships

PackageRelationship
@prox-os/actionsEditor toolbar items use action intent for save draft, copy markdown, ask AI, improve writing, and insert media.
@prox-os/formsEditor primitives can become custom form fields for descriptions, prompt config, notes, and metadata.
@prox-os/mediaFuture insert media, pasted image handling, media cards, and alt text editing should use media resources.
@prox-os/commandFuture slash commands, selection-aware commands, and command palette editor actions can consume editor context.
Future AI UIPrompt editing, rewrite, summarize, improve writing, and AI-generated content review should reuse editor values.
Future collaborationPresence, cursors, comments, suggestions, version history, and CRDT state belong to a later collaboration layer.
Future backend packagesapi-contract, storage, search-service, audit, and agents-runtime can provide persistence, attachments, indexing, audit, and AI tool execution later.

Current Boundaries

  • Primitive package only.
  • No Notion-style block editor.
  • No Google Docs-style collaboration.
  • No Monaco runtime dependency.
  • No paste upload, file upload, or media persistence.
  • No real AI rewrite calls.
  • No backend save/load API.
  • No OS Shell private imports.

See docs/platform/architecture/capabilities/editor-system.md for the architecture roadmap.

On this page