feat: add file editing/opening, embedded terminal, and model capability checks - #577
feat: add file editing/opening, embedded terminal, and model capability checks#577yn-lo wants to merge 3 commits into
Conversation
1. add acceptsImages field to model related type definitions
2. detect model image input support via m.input.includes("image") in model loading
3. add i18n messages for disabled image input and reasoning
4. add runtime checks to disable image attach and reasoning controls when unsupported
Add complete terminal integration, including: 1. Backend session management based on node-pty 2. Server-Sent Events for real-time data streaming 3. Multi-tab terminal panel with drag-to-resize 4. xterm.js terminal UI with light/dark theme support 5. Automatic detection of Windows Git Bash, plus a custom shell environment variable override New dependencies: `node-pty`, `@xterm/xterm`, `@xterm/addon-fit`
|
Summary Key Changes Embedded Terminal: Implemented a real-time Web Terminal using SSE for streaming output, supported by endpoints for input, resizing, and session lifecycle management (TerminalPanel & TerminalTabs). Model Capability Checks: Updated model metadata with acceptsImages to dynamically detect and toggle Vision/image-input UI features. UI & i18n: Added localized strings (EN/ZH) and integrated terminal tabs into the main shell layout. |
Summary of Changes
In-browser Text File Editing:
Added inline editing capabilities for text files in
TextFileViewer.tsx.Integrated a textarea editor with support for keyboard shortcuts (
Cmd/Ctrl+Sto save,Escapeto cancel).Added backend save API (
POST /api/files/[...path]?type=save) with path validation, symlink authorization, and a 256KB file size limit check.System File Manager Integration:
Added a button in
SessionSidebar.tsxto open the current working directory in the OS file manager.Implemented backend handler (
POST /api/files/[...path]?type=open-directory) using cross-platform system commands (explorer,open,xdg-open).Localization:
Added corresponding i18n keys and translations in
en.tsandzh-CN.tsfor file editing, saving, and opening directory actions.