OpenPets fork with floating chat, memory, MCP toolkit and companion fixes
| config | ||
| docs/references | ||
| mirrors | ||
| public | ||
| scripts | ||
| src | ||
| tests/e2e | ||
| .env.example | ||
| .env.local | ||
| .env.production | ||
| .eslintrc.cjs | ||
| .gitignore | ||
| analyze-ast-sizes-try.ts | ||
| analyze-ast-sizes.ts | ||
| analyze-ast-sizes2.ts | ||
| analyze-contents.ts | ||
| analyze-contents2.ts | ||
| analyze-jsx.ts | ||
| analyze-massive-literals.ts | ||
| analyze-massive-literals2.ts | ||
| analyze-massive-literals3.ts | ||
| analyze-monster.ts | ||
| analyze-runboard.ts | ||
| analyze-runboard2.ts | ||
| analyze-runboard3.ts | ||
| analyze-size.ts | ||
| analyze-stmts.ts | ||
| analyze-test.ts | ||
| analyze-vars.ts | ||
| analyze.ts | ||
| analyze3.ts | ||
| apply_lazy.py | ||
| apply_suspense.py | ||
| build_banner_component.js | ||
| build_output_full.txt | ||
| check-runboard.ts | ||
| check.py | ||
| check_str.py | ||
| components.json | ||
| cookies.txt | ||
| cut_block.cjs | ||
| data_testids.txt | ||
| debug-ast.ts | ||
| dist-upload.tar.gz | ||
| do-extract-safe.ts | ||
| Dockerfile | ||
| domain-split.ts | ||
| extract-compare.ts | ||
| extract-fast.cjs | ||
| extract-fast.ts | ||
| extract-fixtures.ts | ||
| extract-payloads.ts | ||
| extract_banner.cjs | ||
| extract_header.py | ||
| extract_var1.js | ||
| find_banner.cjs | ||
| fix-exports.ts | ||
| fix-imports-final.ts | ||
| fix-imports.ts | ||
| fix-runboard-states.py | ||
| fix-ts.py | ||
| fix.js | ||
| fix.ts | ||
| fix2.js | ||
| fix3.js | ||
| fix4.py | ||
| fix5.js | ||
| fix6.py | ||
| fix7.py | ||
| fix8.py | ||
| fix_banner.cjs | ||
| fix_components.js | ||
| fix_components.py | ||
| fix_editor_errors.py | ||
| fix_editor_imports.py | ||
| fix_extra.js | ||
| fix_rb.js | ||
| fix_ts_issues.ts | ||
| index.html | ||
| isolated_metadata_tail.txt | ||
| LICENSE | ||
| lighthouserc.json | ||
| modify.py | ||
| nginx.conf | ||
| out.txt | ||
| output.txt | ||
| package-lock.json | ||
| package.json | ||
| perf-check.err.log | ||
| perf-check.out.log | ||
| plan.cjs | ||
| playwright.config.ts | ||
| postcss.config.js | ||
| prune-imports.ts | ||
| README.md | ||
| refactor.cjs | ||
| refactor2.cjs | ||
| refactor3.cjs | ||
| render_block.txt | ||
| replace_routers.cjs | ||
| replace_routers2.cjs | ||
| run_transform.cjs | ||
| runboard-states-direct.log | ||
| runboard-ts-morph-split.ts | ||
| runboard_states_full.txt | ||
| script_result.txt | ||
| scriptoriumai-ui.esproj | ||
| scriptoriumai-ui.njsproj | ||
| split-monster-test.ts | ||
| split-runboard.ts | ||
| split-tests.js | ||
| split-tests.ts | ||
| stat.txt | ||
| tailwind.config.js | ||
| temp_return.tsx | ||
| temp_var1.tsx | ||
| temp_vars.tsx | ||
| test-out.txt | ||
| test_out.log | ||
| test_out_inventory.log | ||
| tmp-perf-editor-debug-2.png | ||
| tmp-perf-editor-debug.png | ||
| tmp-playwright-run.log | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| tsconfig.node.tsbuildinfo | ||
| tsconfig.tsbuildinfo | ||
| type-check.log | ||
| type-check2.log | ||
| update_app_skeletons.py | ||
| update_dashboard_skeletons.py | ||
| update_editor.py | ||
| update_editor_conflict.py | ||
| update_editor_conflict_fix.py | ||
| update_editor_conflict_fix2.py | ||
| update_editor_conflict_fix3.py | ||
| update_editor_layout.py | ||
| update_editor_layout2.py | ||
| update_editor_linter.py | ||
| update_monaco.py | ||
| update_store.py | ||
| update_todo.py | ||
| update_todo2.py | ||
| update_todo_2.py | ||
| vite.config.d.ts | ||
| vite.config.js | ||
| vite.config.ts | ||
| vite.config.ts.timestamp-1773154688718-06627573d4d53.mjs | ||
| vite.stderr.log | ||
| vite.stdout.log | ||
| vitest_runboard_states_latest.txt | ||
ScriptoriumAI UI - Modern LaTeX Editor
AGPL-Compliant, Clean-Room Implementation
Overview
ScriptoriumAI UI is a modern, proprietary LaTeX editor with AI-powered visualization capabilities. It's designed to integrate with Overleaf Community Edition via API while maintaining strict license separation.
🎨 Design Philosophy
Overleaf-Inspired, Not Derived:
- Clean-room implementation (zero Overleaf code)
- Modern React + TypeScript architecture
- Original UI components and styling
- API-only integration with Overleaf
✨ Features
- 📝 LaTeX Editor - Monaco-based with syntax highlighting
- 🎬 Manim Visualization - Inline animation rendering
- 📸 OCR Integration - Image-to-LaTeX extraction
- 🔄 Real-time Preview - Live LaTeX compilation
- 🎨 Modern UI - Dark theme, smooth animations
- 🔗 Overleaf Integration - Optional backend sync
Tech Stack
Core
- React 18 - UI framework
- TypeScript - Type safety
- Vite - Build tool (fast HMR)
- TailwindCSS - Styling
- Zustand - State management
Key Libraries
- Monaco Editor - Code editing (VS Code engine)
- Framer Motion - Animations
- TanStack Query - Data fetching
- React Router - Routing
- KaTeX - Math rendering
- Axios - HTTP client
Architecture
┌──────────────────────────────────────┐
│ ScriptoriumAI UI (Port 5173) │
│ • PROPRIETARY │
│ • Clean-room implementation │
│ • No Overleaf code imports │
└────┬─────────────────────┬───────────┘
│ HTTP/REST │ HTTP/REST
▼ ▼
┌─────────────┐ ┌──────────────────┐
│ Overleaf │ │ ScriptoriumAI │
│ (Optional) │ │ Server │
│ AGPL-3.0 │ │ MIT/Proprietary │
└─────────────┘ └──────────────────┘
Key Compliance Points:
- ✅ No code imports from Overleaf
- ✅ API-only integration
- ✅ Independent deployment
- ✅ Original UI components
Project Structure
scriptoriumai-ui/
├── src/
│ ├── pages/
│ │ ├── Dashboard.tsx # Project dashboard
│ │ ├── Editor.tsx # Main editor with split panes
│ │ ├── Visualizations.tsx # Manim gallery
│ │ └── Settings.tsx # User settings
│ ├── components/
│ │ ├── LaTeXEditor.tsx # Monaco editor wrapper
│ │ ├── ManimPanel.tsx # Manim code + preview
│ │ ├── OCRUpload.tsx # Image OCR upload
│ │ ├── PreviewPanel.tsx # PDF/LaTeX preview
│ │ └── Toolbar.tsx # Navigation sidebar
│ ├── services/
│ │ ├── overleaf-client.ts # ✅ API client (AGPL-safe)
│ │ └── scriptorium-client.ts # ScriptoriumAI API client
│ ├── stores/
│ │ └── editorStore.ts # Zustand state
│ ├── layouts/
│ │ └── EditorLayout.tsx # Main layout
│ ├── styles/
│ │ └── global.css # TailwindCSS + custom
│ └── App.tsx # Root component
├── package.json
├── vite.config.ts
├── tailwind.config.js
├── tsconfig.json
└── README.md
Getting Started
Prerequisites
- Node.js 18+
- npm or pnpm
- ScriptoriumAI Server running (port 3000)
- (Optional) Overleaf CE running (port 3001)
Installation
cd scriptoriumai-ui
npm install
Development
npm run dev
# Opens on http://localhost:5173
Environment Variables
Create .env:
VITE_SCRIPTORIUM_URL=http://localhost:3000
VITE_OVERLEAF_URL=http://localhost:3001
Build
npm run build
# Output: dist/
Features Overview
1. LaTeX Editor
Monaco Editor Integration:
- Syntax highlighting for LaTeX
- Auto-completion
- Multi-cursor editing
- Keyboard shortcuts
- Line numbers & minimap
Capabilities:
- Write LaTeX documents
- Real-time preview (math expressions)
- PDF compilation via Overleaf API
- Save to Overleaf projects
2. Manim Panel
Features:
- Python code editor for Manim
- Scene name configuration
- Format selection (PNG/GIF/MP4/WebM/MOV)
- Quality settings (low/med/high)
- Inline preview
- Download rendered animations
Example Workflow:
- Write Manim code
- Configure format & quality
- Click "Render Animation"
- Preview inline
- Download artifact
3. OCR Integration
Features:
- Drag & drop image upload
- Support for PNG, JPEG, JPG, WebP
- LaTeX code extraction via pix2tex
- Live LaTeX preview (KaTeX)
- One-click insert into Manim editor
Workflow:
- Upload equation image
- OCR extracts LaTeX
- Preview rendered equation
- Insert into Manim or copy to clipboard
4. Overleaf Integration
API-Based Integration:
- List projects
- Create/delete projects
- Load documents
- Save changes
- Compile to PDF
Authentication:
- OAuth2 flow (planned)
- Session-based auth
- JWT tokens
License Compliance
✅ AGPL-Compliant Design
This codebase is 100% original and maintains strict separation from Overleaf:
Compliance Checklist:
- ✅ No imports from
@overleaf/* - ✅ No Overleaf code copied
- ✅ API-only integration
- ✅ Independent deployment
- ✅ Original UI components
- ✅ Clean-room design process
Integration Method:
- HTTP/REST API calls only
- No code-level dependencies
- Network boundary enforced
See LICENSE_COMPLIANCE.md for details.
Development Guidelines
Adding Features
- No Overleaf Code - Never import from Overleaf repo
- API Only - All Overleaf interaction via HTTP
- Original Design - Create components from scratch
- Document Decisions - Explain why design choices were made
Code Style
npm run lint # ESLint check
npm run format # Prettier format
npm run type-check # TypeScript validation
Testing
npm test # Vitest
Deployment
Docker
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Docker Compose
scriptorium-ui:
build: ./scriptoriumai-ui
ports:
- "5173:80"
environment:
- VITE_SCRIPTORIUM_URL=http://scriptorium-server:3000
- VITE_OVERLEAF_URL=http://overleaf:80
API Integration
Overleaf API Client
import { overleafClient } from '@/services/overleaf-client'
// List projects
const projects = await overleafClient.listProjects()
// Compile LaTeX
const { pdfUrl } = await overleafClient.compileProject(projectId)
ScriptoriumAI API Client
import { scriptoriumClient } from '@/services/scriptorium-client'
// Render Manim
const result = await scriptoriumClient.renderManim({
code: manimCode,
sceneName: 'MyScene',
format: 'mp4',
quality: 'high'
})
// OCR
const latex = await scriptoriumClient.extractLatexFromImage(imageFile)
Performance
Bundle Size (Target)
- Total: < 500 KB (gzipped)
- Initial: < 200 KB
- Vendor: < 150 KB
- Editor: < 100 KB (lazy loaded)
Optimization
- Code splitting by route
- Monaco Editor lazy-loaded
- TailwindCSS purge enabled
- Asset optimization
Browser Support
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
Contributing
See CONTRIBUTING.md for guidelines.
License Reminder:
- This codebase is PROPRIETARY
- No Overleaf code allowed
- API integration only
Support
- Documentation: docs/
- Issues: GitHub Issues
- License Questions: LICENSE_COMPLIANCE.md
Version: 2.0.0
Last Updated: October 6, 2025
License: PROPRIETARY
Status: Production Ready