Antiprism is a local-first research workspace for scientific writing, compilation, collaboration, Git history, and in-browser AI. It is the client-side counterpart to Prism: where Prism leans on cloud infrastructure, Antiprism keeps the core experience in your browser with WebRTC, IndexedDB, WebAssembly, and WebGPU.
The README is intentionally more technical than the product tour on /features. The landing page explains the experience in a user-friendly way; this document explains how the app is structured, which models power it, which routes exist, and how the browser-native stack fits together.
/ Dashboard: Project and room management, search, import flows, view modes, and entry into local or shared workspaces./project/[id] Workspace: CodeMirror editor, PDF preview, AI chat, tools/logging, Git panel, file tree, and collaboration state./features Product Tour: Marketing and storytelling surface with Framer Motion and AnimatedHero.tsx to visualize model selection, streaming text, PDF preview, multimodal prompting, and WebRTC sync./document-parser and /git: Focused utility/demo routes for parser and Git-oriented flows.| Component | Prism (cloud) | Antiprism (client-side) |
|---|---|---|
| Realtime collaboration | WebSockets via central server | WebRTC + Yjs (peer-to-peer) |
| AI assistant | OpenAI API (datacenter) | Multiple ONNX models (WebGPU) |
| LaTeX rendering | Cloud compilation | Client-side WASM (texlyre-busytex) |
| Data storage | Server-side | IndexedDB, local-first |
.tex, compile locally, inspect logs, preview PDFs, and keep supporting assets in the same workspace./features route uses Framer Motion and a custom animated hero to show real workflows without needing a live backend.| Mode | Purpose | Context | Model Used |
|---|---|---|---|
| Ask | Document-aware Q&A, edits, and LaTeX assistance | Active document + conversation history | Active text model (LFM2.5 Instruct, LFM2.5 Thinking, Nanbeige4.1-3B, or Nemotron 3 Nano 4B) |
| Agent | Generate or restructure papers through a markdown-first workflow | Conversation history + structured agent prompts | Active text model with pandoc-wasm conversion back to LaTeX |
| Vision | Image + text analysis inside the chat workflow | Uploaded image + prompt | Active vision-capable model |
| Multimodal | Higher-fidelity visual reasoning and image-grounded explanations | Uploaded image + prompt + conversation context | Typically Qwen3.5-0.8B, or another selected vision-capable model |
Antiprism currently defines seven local model profiles in lib/modelConfig.ts. They are downloaded on demand, cached with the Cache API, and executed through ONNX Runtime Web + WebGPU:
1. LFM2.5-1.2B Q4 (Instruct Model)
q4, maxContextTokens: 32,768, maxNewTokens: 5122. LFM2.5-VL-1.6B (Vision Model)
q4, maxContextTokens: 32,768, maxNewTokens: 64pixel_values: [num_tiles, 1024, 768], attention_mask: [num_tiles, 1024]3. LFM2.5-1.2B (Thinking Model)
q4, maxContextTokens: 32,768, maxNewTokens: 512, thinking: true4. Nanbeige4.1-3B (Advanced Thinking & Agentic Model)
q4, maxContextTokens: 262,144, maxNewTokens: 2,048, hiddenSize: 2,5605. Qwen3.5-0.8B (Alibaba Multimodal Model)
q4f16, maxContextTokens: 262,144, maxNewTokens: 32,7686. Nemotron 3 Nano 4B (NVIDIA Reasoning Model)
q4f16, maxContextTokens: 262,144, maxNewTokens: 2,048<think>...</think> reasoning blocks alongside final answers7. Gemma 4 E2B (Google DeepMind Multimodal Model)
q4f16, maxContextTokens: 128,000, maxNewTokens: 2,048All seven model definitions share the same runtime infrastructure, but they do not all execute through the exact same path:
lib/modelConfig.ts centralizes Hugging Face IDs, dtypes, KV-cache geometry, context windows, and generation limits.
lib/localModelRuntime.ts handles text-only generation, model switching, download progress, and streamed tokens.
lib/vlModelRuntime.ts handles session-style vision execution for image-capable models.
ONNX Runtime Web + WebGPU execute model graphs directly in the browser GPU.
Transformers.js provides tokenizer/model loading and per-component optimization.
Cache API keeps downloaded model artifacts local after first use.
Thinking-aware rendering uses ThinkingRenderer when models emit structured reasoning blocks.
Model switching UI exposes these profiles in the workspace and in the Framer Motion demo on /features.
Ask: Uses the open document as context. Good for editing, debugging, and explaining LaTeX.
Agent: Model outputs markdown; pandoc-wasm converts to LaTeX. New files are named from the first # heading. Conversation history uses markdown (not LaTeX) so the model stays in its trained format.
Vision: Attach images to chat messages for multimodal understanding. The vision encoder processes images alongside text for comprehensive analysis.
Multimodal: Advanced Qwen3.5 model processes images and text with enhanced reasoning. Supports complex visual understanding, mathematical figure analysis, and detailed image-to-LaTeX conversion with built-in thinking capabilities.
/features page: A narrative overview of the product that stays friendly and visual while still reflecting real capabilities.AnimatedHero.tsx simulates model selection, downloads, streaming responses, PDF appearance, image prompting, and realtime collaboration.yjs-orderedtree to store the project's folder/file structure in a shared Y.Map. This means:
main.tex, images, and supporting files live in one local workspace.Cmd+B: Toggle sidebarCmd+Shift+T: Toggle tools panelCmd+Shift+F: Format documentCmd+1/2/3: Switch sidebar tabs# Install dependencies
npm install
# Download LaTeX WASM assets (~175MB)
npm run download-latex-assets
# Optional: copy additional wasm-latex-tools assets
npm run download-wasm-assets
# Start dev server
npm run dev
Open http://localhost:3000.
If you want to test peer discovery with your own signaling service, run this in a separate terminal:
npm run signaling
| Script | Description |
|---|---|
npm run dev | Start Next.js dev server |
npm run build | Build for production (webpack) |
npm run start | Start production server |
npm run signaling | Start the local signaling server |
npm run download-latex-assets | Download texlyre-busytex WASM assets to ./public/core |
npm run download-wasm-assets | Copy wasm-latex-tools assets into ./public/core |
npm run test | Run the Vitest suite |
npm run test:watch | Run Vitest in watch mode |
npm run test:wasm | Run WASM integration tests |
npm run test:wasm:basic | Run the basic WASM smoke test |
npm run test:wasm:realworld | Run the heavier real-world WASM scenario |
The workflow in .github/workflows/nextjs.yml builds and deploys the static Next.js app to GitHub Pages on push to main. The editor, dashboard, and /features route are all designed to work in a static-hosted environment because the heavy lifting happens client-side.
You must enable Pages first:
After enabling, push to main or run the workflow manually from the Actions tab. The site will be available at https://<username>.github.io/antiprism/.
If you want collaboration outside a public/default signaling setup, deploy signaling-server.js separately and point clients at that server.
├── app/
│ ├── layout.tsx # Root layout and global metadata
│ ├── page.tsx # Dashboard
│ ├── features/page.tsx # Landing page + product storytelling
│ ├── document-parser/page.tsx # Document parsing route
│ ├── git/page.tsx # Git-focused route/demo
│ ├── new/page.tsx # New project entry flow
│ ├── project/[id]/page.tsx # Main workspace route
│ └── globals.css
├── components/
│ ├── AnimatedHero.tsx # Framer Motion product demo on /features
│ ├── DashboardHeader.tsx # Search, import, creation actions
│ ├── DashboardSidebar.tsx # Project / room navigation
│ ├── ProjectList.tsx # Dashboard list and grid rendering
│ ├── FileTree.tsx # Workspace file browser
│ ├── FileTabs.tsx # Multi-tab editing surface
│ ├── EditorPanel.tsx # CodeMirror + collaborative editing
│ ├── PdfPreview.tsx # React-PDF based preview
│ ├── ChatInput.tsx # Prompting UI and attachments
│ ├── ModelDropdown.tsx # Local model selection and download UI
│ ├── ThinkingRenderer.tsx # Structured reasoning display
│ ├── ToolsPanel.tsx # Logging and diagnostics surface
│ ├── GitPanelReal.tsx # Git status, commits, branches, diffs
│ ├── GitDiffView.tsx # Unified diff viewer
│ ├── SideBySideDiffView.tsx # Side-by-side diff comparison
│ ├── ResizableDivider.tsx # Resizable panel layout support
│ └── Icons.tsx # Shared iconography
├── hooks/
│ ├── useKeyboardShortcuts.ts # Keyboard shortcut handling
│ └── useResponsive.ts # Responsive UI helpers
├── lib/
│ ├── agent/ # Ask/agent message construction and parsing
│ ├── modelConfig.ts # Model definitions, limits, runtime metadata
│ ├── localModelRuntime.ts # Text-model runtime
│ ├── vlModelRuntime.ts # Vision-model runtime
│ ├── localModel.ts # High-level model API facade
│ ├── latexCompiler.ts # BusyTeX wrapper and compile orchestration
│ ├── gitStore.ts # IndexedDB-backed git storage
│ ├── logger.ts # AI / LaTeX / system logging
│ ├── projects.ts # Project and room CRUD
│ ├── fileTreeManager.ts # CRDT file tree using yjs-orderedtree
│ ├── chatStore.ts # Chat session persistence
│ ├── chatTreeManager.ts # Chat tree structure management
│ ├── wasmLatexTools.ts # Formatting and statistics helpers
│ ├── settings.ts # Persisted app and model settings
│ └── idbfsAdapter.ts # Filesystem helper layer
├── public/
│ ├── main.tex # Default LaTeX document
│ ├── diagram.jpg # Sample image asset
│ ├── templates/ # User-facing starter templates
│ └── core/ # Downloaded WASM assets
├── scripts/ # Test and WASM utility scripts
├── signaling-server.js # Optional signaling server for WebRTC setup
├── PACKAGES.md # Package docs and library notes
└── package.json
| Category | Packages |
|---|---|
| Framework | Next.js 16, React 19 |
| Animation | Framer Motion |
| Collaboration | Yjs, y-webrtc, y-codemirror.next, y-indexeddb, yjs-orderedtree |
| Editor | CodeMirror 6, codemirror-lang-latex |
| Storage | @wwog/idbfs (IndexedDB filesystem) |
| Version Control | Custom git implementation with IndexedDB |
| LaTeX | texlyre-busytex (WASM), pandoc-wasm (md→tex), wasm-latex-tools |
| AI | @huggingface/transformers (LFM2.5-1.2B Q4 ONNX, LFM2.5-VL-1.6B, Nanbeige4.1-3B, Qwen3.5-0.8B, Gemma 4 E2B) |
| Markdown / Math Rendering | streamdown, KaTeX, react-katex |
| react-pdf | |
| Styling | Tailwind CSS |
| Testing | Vitest, jsdom |
| Utilities | diff (for git diffs), exifreader (image metadata) |
sequenceDiagram
autonumber
actor Visitor
participant Features as /features
participant Hero as AnimatedHero
participant FM as Framer Motion
Visitor->>Features: Open product page
Features->>Hero: Mount technical storytelling scene
Hero->>FM: Animate workspace, model selection, and chat states
FM-->>Visitor: Show local AI + PDF + collaboration narrative
Visitor-->>Features: Understand core workflow before entering app
sequenceDiagram
autonumber
actor User
participant Browser
participant IDB as IndexedDB
participant WGPU as WebGPU
User->>Browser: Open Application
Browser->>IDB: Load user preferences & recent projects
IDB-->>Browser: State restored
Browser->>WGPU: Warm up local AI models (lazy)
User->>Browser: Click "New Project"
Browser->>IDB: Initialize project database structure
Browser->>IDB: Seed default files (main.tex, etc.)
Browser-->>User: Render Editor Interface
User->>Browser: Modify document
Browser->>IDB: Auto-save document changes
sequenceDiagram
autonumber
actor PeerA as User A
participant EditorA as Browser A (Yjs)
participant FileTreeA as FileTree CRDT
participant Signal as Signaling Server
participant EditorB as Browser B (Yjs)
participant FileTreeB as FileTree CRDT
actor PeerB as User B
PeerA->>EditorA: Click "Share"
EditorA->>Signal: Register room ID & listening
EditorA-->>PeerA: Generate Share Link
PeerA->>PeerB: Send Share Link
PeerB->>EditorB: Open Link
EditorB->>Signal: Request connection to room ID
Signal-->>EditorA: WebRTC connection request
EditorA->>EditorB: Establish P2P Connection
Note over EditorA, EditorB: P2P Channel Established (Signaling Server no longer needed)
EditorA->>EditorB: Sync initial Yjs CRDT state
FileTreeA->>FileTreeB: Sync file tree hierarchy via yjs-orderedtree
PeerA->>EditorA: Type text + create/move files
EditorA->>EditorB: Stream CRDT delta updates
FileTreeA->>FileTreeB: Sync file tree operations
EditorB-->>PeerB: Render text changes + file tree instantly
sequenceDiagram
autonumber
actor User
participant Editor as UI / Editor
participant Model as Local AI (WebGPU)
participant WASM as texlyre-busytex
participant Img as Image Attachment
User->>Editor: Ask AI to format text or explain a figure
User->>Img: Attach image when needed
Editor->>Model: Send context + prompt (no network)
Model-->>Editor: Stream generated response
Editor-->>User: Display AI suggestion
User->>Editor: Apply changes to document
User->>Editor: Trigger compilation
Editor->>WASM: Send document files (.tex, .jpg)
Note over WASM: WebAssembly executes TeX engine locally
WASM-->>Editor: Return compiled PDF binary
Editor-->>User: Render PDF Preview
See PACKAGES.md for deeper notes on the libraries behind Antiprism, including Yjs, WebRTC collaboration bindings, CodeMirror integrations, and other browser-native building blocks used throughout the app.
189 commits
TypeScript
64.1%
TeX
18.2%
JavaScript
12.2%
HTML
2.6%
CSS
2.6%
Antiprism is a local-first research workspace for scientific writing, compilation, collaboration, Git history, and in-browser AI. It is the client-side counterpart to Prism: where Prism leans on cloud infrastructure, Antiprism keeps the core experience in your browser with WebRTC, IndexedDB, WebAssembly, and WebGPU.
The README is intentionally more technical than the product tour on /features. The landing page explains the experience in a user-friendly way; this document explains how the app is structured, which models power it, which routes exist, and how the browser-native stack fits together.
/ Dashboard: Project and room management, search, import flows, view modes, and entry into local or shared workspaces./project/[id] Workspace: CodeMirror editor, PDF preview, AI chat, tools/logging, Git panel, file tree, and collaboration state./features Product Tour: Marketing and storytelling surface with Framer Motion and AnimatedHero.tsx to visualize model selection, streaming text, PDF preview, multimodal prompting, and WebRTC sync./document-parser and /git: Focused utility/demo routes for parser and Git-oriented flows.| Component | Prism (cloud) | Antiprism (client-side) |
|---|---|---|
| Realtime collaboration | WebSockets via central server | WebRTC + Yjs (peer-to-peer) |
| AI assistant | OpenAI API (datacenter) | Multiple ONNX models (WebGPU) |
| LaTeX rendering | Cloud compilation | Client-side WASM (texlyre-busytex) |
| Data storage | Server-side | IndexedDB, local-first |
.tex, compile locally, inspect logs, preview PDFs, and keep supporting assets in the same workspace./features route uses Framer Motion and a custom animated hero to show real workflows without needing a live backend.| Mode | Purpose | Context | Model Used |
|---|---|---|---|
| Ask | Document-aware Q&A, edits, and LaTeX assistance | Active document + conversation history | Active text model (LFM2.5 Instruct, LFM2.5 Thinking, Nanbeige4.1-3B, or Nemotron 3 Nano 4B) |
| Agent | Generate or restructure papers through a markdown-first workflow | Conversation history + structured agent prompts | Active text model with pandoc-wasm conversion back to LaTeX |
| Vision | Image + text analysis inside the chat workflow | Uploaded image + prompt | Active vision-capable model |
| Multimodal | Higher-fidelity visual reasoning and image-grounded explanations | Uploaded image + prompt + conversation context | Typically Qwen3.5-0.8B, or another selected vision-capable model |
Antiprism currently defines seven local model profiles in lib/modelConfig.ts. They are downloaded on demand, cached with the Cache API, and executed through ONNX Runtime Web + WebGPU:
1. LFM2.5-1.2B Q4 (Instruct Model)
q4, maxContextTokens: 32,768, maxNewTokens: 5122. LFM2.5-VL-1.6B (Vision Model)
q4, maxContextTokens: 32,768, maxNewTokens: 64pixel_values: [num_tiles, 1024, 768], attention_mask: [num_tiles, 1024]3. LFM2.5-1.2B (Thinking Model)
q4, maxContextTokens: 32,768, maxNewTokens: 512, thinking: true4. Nanbeige4.1-3B (Advanced Thinking & Agentic Model)
q4, maxContextTokens: 262,144, maxNewTokens: 2,048, hiddenSize: 2,5605. Qwen3.5-0.8B (Alibaba Multimodal Model)
q4f16, maxContextTokens: 262,144, maxNewTokens: 32,7686. Nemotron 3 Nano 4B (NVIDIA Reasoning Model)
q4f16, maxContextTokens: 262,144, maxNewTokens: 2,048<think>...</think> reasoning blocks alongside final answers7. Gemma 4 E2B (Google DeepMind Multimodal Model)
q4f16, maxContextTokens: 128,000, maxNewTokens: 2,048All seven model definitions share the same runtime infrastructure, but they do not all execute through the exact same path:
lib/modelConfig.ts centralizes Hugging Face IDs, dtypes, KV-cache geometry, context windows, and generation limits.
lib/localModelRuntime.ts handles text-only generation, model switching, download progress, and streamed tokens.
lib/vlModelRuntime.ts handles session-style vision execution for image-capable models.
ONNX Runtime Web + WebGPU execute model graphs directly in the browser GPU.
Transformers.js provides tokenizer/model loading and per-component optimization.
Cache API keeps downloaded model artifacts local after first use.
Thinking-aware rendering uses ThinkingRenderer when models emit structured reasoning blocks.
Model switching UI exposes these profiles in the workspace and in the Framer Motion demo on /features.
Ask: Uses the open document as context. Good for editing, debugging, and explaining LaTeX.
Agent: Model outputs markdown; pandoc-wasm converts to LaTeX. New files are named from the first # heading. Conversation history uses markdown (not LaTeX) so the model stays in its trained format.
Vision: Attach images to chat messages for multimodal understanding. The vision encoder processes images alongside text for comprehensive analysis.
Multimodal: Advanced Qwen3.5 model processes images and text with enhanced reasoning. Supports complex visual understanding, mathematical figure analysis, and detailed image-to-LaTeX conversion with built-in thinking capabilities.
/features page: A narrative overview of the product that stays friendly and visual while still reflecting real capabilities.AnimatedHero.tsx simulates model selection, downloads, streaming responses, PDF appearance, image prompting, and realtime collaboration.yjs-orderedtree to store the project's folder/file structure in a shared Y.Map. This means:
main.tex, images, and supporting files live in one local workspace.Cmd+B: Toggle sidebarCmd+Shift+T: Toggle tools panelCmd+Shift+F: Format documentCmd+1/2/3: Switch sidebar tabs# Install dependencies
npm install
# Download LaTeX WASM assets (~175MB)
npm run download-latex-assets
# Optional: copy additional wasm-latex-tools assets
npm run download-wasm-assets
# Start dev server
npm run dev
Open http://localhost:3000.
If you want to test peer discovery with your own signaling service, run this in a separate terminal:
npm run signaling
| Script | Description |
|---|---|
npm run dev | Start Next.js dev server |
npm run build | Build for production (webpack) |
npm run start | Start production server |
npm run signaling | Start the local signaling server |
npm run download-latex-assets | Download texlyre-busytex WASM assets to ./public/core |
npm run download-wasm-assets | Copy wasm-latex-tools assets into ./public/core |
npm run test | Run the Vitest suite |
npm run test:watch | Run Vitest in watch mode |
npm run test:wasm | Run WASM integration tests |
npm run test:wasm:basic | Run the basic WASM smoke test |
npm run test:wasm:realworld | Run the heavier real-world WASM scenario |
The workflow in .github/workflows/nextjs.yml builds and deploys the static Next.js app to GitHub Pages on push to main. The editor, dashboard, and /features route are all designed to work in a static-hosted environment because the heavy lifting happens client-side.
You must enable Pages first:
After enabling, push to main or run the workflow manually from the Actions tab. The site will be available at https://<username>.github.io/antiprism/.
If you want collaboration outside a public/default signaling setup, deploy signaling-server.js separately and point clients at that server.
├── app/
│ ├── layout.tsx # Root layout and global metadata
│ ├── page.tsx # Dashboard
│ ├── features/page.tsx # Landing page + product storytelling
│ ├── document-parser/page.tsx # Document parsing route
│ ├── git/page.tsx # Git-focused route/demo
│ ├── new/page.tsx # New project entry flow
│ ├── project/[id]/page.tsx # Main workspace route
│ └── globals.css
├── components/
│ ├── AnimatedHero.tsx # Framer Motion product demo on /features
│ ├── DashboardHeader.tsx # Search, import, creation actions
│ ├── DashboardSidebar.tsx # Project / room navigation
│ ├── ProjectList.tsx # Dashboard list and grid rendering
│ ├── FileTree.tsx # Workspace file browser
│ ├── FileTabs.tsx # Multi-tab editing surface
│ ├── EditorPanel.tsx # CodeMirror + collaborative editing
│ ├── PdfPreview.tsx # React-PDF based preview
│ ├── ChatInput.tsx # Prompting UI and attachments
│ ├── ModelDropdown.tsx # Local model selection and download UI
│ ├── ThinkingRenderer.tsx # Structured reasoning display
│ ├── ToolsPanel.tsx # Logging and diagnostics surface
│ ├── GitPanelReal.tsx # Git status, commits, branches, diffs
│ ├── GitDiffView.tsx # Unified diff viewer
│ ├── SideBySideDiffView.tsx # Side-by-side diff comparison
│ ├── ResizableDivider.tsx # Resizable panel layout support
│ └── Icons.tsx # Shared iconography
├── hooks/
│ ├── useKeyboardShortcuts.ts # Keyboard shortcut handling
│ └── useResponsive.ts # Responsive UI helpers
├── lib/
│ ├── agent/ # Ask/agent message construction and parsing
│ ├── modelConfig.ts # Model definitions, limits, runtime metadata
│ ├── localModelRuntime.ts # Text-model runtime
│ ├── vlModelRuntime.ts # Vision-model runtime
│ ├── localModel.ts # High-level model API facade
│ ├── latexCompiler.ts # BusyTeX wrapper and compile orchestration
│ ├── gitStore.ts # IndexedDB-backed git storage
│ ├── logger.ts # AI / LaTeX / system logging
│ ├── projects.ts # Project and room CRUD
│ ├── fileTreeManager.ts # CRDT file tree using yjs-orderedtree
│ ├── chatStore.ts # Chat session persistence
│ ├── chatTreeManager.ts # Chat tree structure management
│ ├── wasmLatexTools.ts # Formatting and statistics helpers
│ ├── settings.ts # Persisted app and model settings
│ └── idbfsAdapter.ts # Filesystem helper layer
├── public/
│ ├── main.tex # Default LaTeX document
│ ├── diagram.jpg # Sample image asset
│ ├── templates/ # User-facing starter templates
│ └── core/ # Downloaded WASM assets
├── scripts/ # Test and WASM utility scripts
├── signaling-server.js # Optional signaling server for WebRTC setup
├── PACKAGES.md # Package docs and library notes
└── package.json
| Category | Packages |
|---|---|
| Framework | Next.js 16, React 19 |
| Animation | Framer Motion |
| Collaboration | Yjs, y-webrtc, y-codemirror.next, y-indexeddb, yjs-orderedtree |
| Editor | CodeMirror 6, codemirror-lang-latex |
| Storage | @wwog/idbfs (IndexedDB filesystem) |
| Version Control | Custom git implementation with IndexedDB |
| LaTeX | texlyre-busytex (WASM), pandoc-wasm (md→tex), wasm-latex-tools |
| AI | @huggingface/transformers (LFM2.5-1.2B Q4 ONNX, LFM2.5-VL-1.6B, Nanbeige4.1-3B, Qwen3.5-0.8B, Gemma 4 E2B) |
| Markdown / Math Rendering | streamdown, KaTeX, react-katex |
| react-pdf | |
| Styling | Tailwind CSS |
| Testing | Vitest, jsdom |
| Utilities | diff (for git diffs), exifreader (image metadata) |
sequenceDiagram
autonumber
actor Visitor
participant Features as /features
participant Hero as AnimatedHero
participant FM as Framer Motion
Visitor->>Features: Open product page
Features->>Hero: Mount technical storytelling scene
Hero->>FM: Animate workspace, model selection, and chat states
FM-->>Visitor: Show local AI + PDF + collaboration narrative
Visitor-->>Features: Understand core workflow before entering app
sequenceDiagram
autonumber
actor User
participant Browser
participant IDB as IndexedDB
participant WGPU as WebGPU
User->>Browser: Open Application
Browser->>IDB: Load user preferences & recent projects
IDB-->>Browser: State restored
Browser->>WGPU: Warm up local AI models (lazy)
User->>Browser: Click "New Project"
Browser->>IDB: Initialize project database structure
Browser->>IDB: Seed default files (main.tex, etc.)
Browser-->>User: Render Editor Interface
User->>Browser: Modify document
Browser->>IDB: Auto-save document changes
sequenceDiagram
autonumber
actor PeerA as User A
participant EditorA as Browser A (Yjs)
participant FileTreeA as FileTree CRDT
participant Signal as Signaling Server
participant EditorB as Browser B (Yjs)
participant FileTreeB as FileTree CRDT
actor PeerB as User B
PeerA->>EditorA: Click "Share"
EditorA->>Signal: Register room ID & listening
EditorA-->>PeerA: Generate Share Link
PeerA->>PeerB: Send Share Link
PeerB->>EditorB: Open Link
EditorB->>Signal: Request connection to room ID
Signal-->>EditorA: WebRTC connection request
EditorA->>EditorB: Establish P2P Connection
Note over EditorA, EditorB: P2P Channel Established (Signaling Server no longer needed)
EditorA->>EditorB: Sync initial Yjs CRDT state
FileTreeA->>FileTreeB: Sync file tree hierarchy via yjs-orderedtree
PeerA->>EditorA: Type text + create/move files
EditorA->>EditorB: Stream CRDT delta updates
FileTreeA->>FileTreeB: Sync file tree operations
EditorB-->>PeerB: Render text changes + file tree instantly
sequenceDiagram
autonumber
actor User
participant Editor as UI / Editor
participant Model as Local AI (WebGPU)
participant WASM as texlyre-busytex
participant Img as Image Attachment
User->>Editor: Ask AI to format text or explain a figure
User->>Img: Attach image when needed
Editor->>Model: Send context + prompt (no network)
Model-->>Editor: Stream generated response
Editor-->>User: Display AI suggestion
User->>Editor: Apply changes to document
User->>Editor: Trigger compilation
Editor->>WASM: Send document files (.tex, .jpg)
Note over WASM: WebAssembly executes TeX engine locally
WASM-->>Editor: Return compiled PDF binary
Editor-->>User: Render PDF Preview
See PACKAGES.md for deeper notes on the libraries behind Antiprism, including Yjs, WebRTC collaboration bindings, CodeMirror integrations, and other browser-native building blocks used throughout the app.
189 commits
TypeScript
64.1%
TeX
18.2%
JavaScript
12.2%
HTML
2.6%
CSS
2.6%