Changeset 0.21.1 (#86)

This commit is contained in:
2026-03-01 14:44:55 +00:00
parent 817062e5fc
commit 70aa78e486
18 changed files with 3778 additions and 29 deletions

View File

@@ -78,7 +78,19 @@ v0.19.2 Project Persona Default + Archive + Reorder ✅
v0.20.0 Notifications + @mention Routing + Multi-model ✅
v0.21.0 Extension Surfaces + Modes (depends on CM6 from v0.17.2)
v0.21.0 Workspace Storage Primitive ✅
┌───────┴──────────────┐
│ │
v0.21.1 Workspace v0.21.3 Surface Infra
Tools + Bindings + REPL (parallel)
│ │
v0.21.2 Workspace v0.21.5 Editor Surface
Indexing + Search (Development Mode)
│ │
v0.21.4 Git v0.21.6 Article Surface
Integration + Document Output
└───────┬──────────────┘
v0.22.0 Smart Routing + Provider Extensions
@@ -300,7 +312,7 @@ step runs in Docker (esbuild → single IIFE bundle). No change to dev
experience for non-editor code — the rest of `src/js/` stays vanilla.
Depends on: nothing (frontend-only). Prerequisite for: extension surfaces
(v0.21.0 editor mode). See [DESIGN-CM6.md](DESIGN-CM6.md) for full spec.
(v0.21.5 editor surface). See [DESIGN-CM6.md](DESIGN-CM6.md) for full spec.
**Build Pipeline**
- [x] `src/editor/` directory: `package.json`, `build.mjs`, `index.mjs`, language/theme modules
@@ -654,35 +666,96 @@ Depends on: v0.19.2 (Projects complete), EventBus + WebSocket hub (v0.9.x),
---
## v0.21.0 — Extension Surfaces + Modes
## v0.21.x Workspace Platform + Extension Surfaces
Depends on: extension foundation (v0.11.0), CodeMirror 6 (v0.17.2).
See [EXTENSIONS.md §6](EXTENSIONS.md#6-surfaces-modes).
Seven-release series decomposing workspace storage, tools, indexing, git,
surface infrastructure, and editor/article modes. Full specification in
[DESIGN-0.21.0.md](DESIGN-0.21.0.md).
_(Shifted from v0.18.0 — no content changes)_
Depends on: file storage (v0.12.0), extension foundation (v0.11.0),
CodeMirror 6 (v0.17.2), knowledge base embedding pipeline (v0.14.0).
- [ ] Surface registration and activation API
- [ ] Mode selector in sidebar (below brand, above chat history)
- [ ] `ctx.ui.replace()` / `ctx.ui.restore()` for region management
### v0.21.0 — Workspace Storage Primitive ✅
Pure backend foundation. Workspaces as a polymorphic platform primitive
owned by users, projects, channels, or teams. Dual-layer storage: PVC
filesystem (source of truth) + DB metadata index (queryable cache).
- [x] `workspaces` table: polymorphic owner (user/project/channel/team), root_path, max_bytes quota, status
- [x] `workspace_files` table: metadata index (path, MIME type, size, sha256, is_directory)
- [x] `WorkspaceStore` interface: CRUD, file index (upsert/delete/list/prefix), ownership lookup, stats
- [x] Postgres + SQLite store implementations with upsert-on-conflict for file index
- [x] `workspace.FS` package: read, write (atomic via temp+rename), delete, mkdir, stat, list, reconcile (FS→DB sync)
- [x] `workspace.Archive`: zip/tar.gz extract + create with archive bomb protection (10K file limit, 100MB single file, quota enforcement), common-prefix stripping
- [x] Content type detection: extension-based (40+ source code types) with http.DetectContentType fallback
- [x] SHA256 computed during write via tee reader (enables content-addressed skip in v0.21.2)
- [x] Path traversal guards: cleanPath + absPath validation, symlink rejection
- [x] 15 API endpoints: workspace CRUD, file CRUD, archive upload/download, reconcile, stats
- [x] Owner-based authorization: user=self, channel=owner, project=member, team=member
- [x] Unit tests: path cleaning, traversal detection, MIME detection, unsafe path filtering, write/read round-trip, delete, mkdir
### v0.21.1 — Workspace Tools + Channel/Project Binding
Make workspaces useful in chat mode via tool calls.
- [ ] Workspace tools (category: workspace): `workspace_ls`, `workspace_read` (50KB soft limit), `workspace_write` (auto-mkdir), `workspace_rm` (recursive guard), `workspace_mv`, `workspace_patch` (find/replace)
- [ ] `channels.workspace_id` FK, `projects.workspace_id` FK
- [ ] Workspace resolution: channel workspace → project workspace (override pattern)
- [ ] Archive upload flow: detect archive MIME + workspace binding → extract to workspace
- [ ] Frontend: channel settings workspace toggle, project Files tab with tree view, chat bar workspace indicator
### v0.21.2 — Workspace Indexing + Semantic Search
Embed text files for semantic search. Reuses `knowledge.SplitText` + `knowledge.Embedder`.
- [ ] `workspace_chunks` table: workspace_id, file_id, chunk_index, content, embedding, metadata
- [ ] `workspace_files` additions: index_status, chunk_count
- [ ] Indexable types: text MIME types + 30+ code extensions
- [ ] Code-aware chunking: larger chunks (1500 chars), function/class boundary separators
- [ ] Content-addressed skip: sha256 check before re-chunking/re-embedding
- [ ] Background indexing: async goroutine with shared semaphore
- [ ] `workspace_search` tool: semantic search with optional glob filtering
### v0.21.3 — Surface Infrastructure + REPL
Pure UI architecture. No workspace dependency (parallel development).
- [ ] Surface registration: `ctx.surfaces.register()` with label, icon, regions, activate/deactivate
- [ ] Region management: `ctx.ui.replace()` / `ctx.ui.restore()` for CM6 state preservation
- [ ] Mode selector in sidebar when ≥1 extension surface registered
- [ ] `surface.activated` / `surface.deactivated` events
- [ ] Editor mode (extension: file tree + CM6 code editor + AI chat split pane)
- [ ] Article mode (extension: outline + rich text + AI assistant panel)
- [ ] Document generation output storage: extension → attachment → download pipeline _(prerequisite for editor/article output)_
- [ ] REPL console ([#70](https://git.gobha.me/xcaliber/chat-switchboard/issues/70)): fourth debug modal tab, AsyncFunction wrapper, injected globals, command history, tab-completion, admin-gated
**REPL / Debug Console** ([#70](https://git.gobha.me/xcaliber/chat-switchboard/issues/70))
- [ ] Fourth tab in debug modal (Ctrl+Shift+L): `[ Console | Network | State | REPL ⚠ ]`
- [ ] `AsyncFunction` wrapper for top-level `await` — injects `API`, `Events`, `Extensions`, `DebugLog` as globals
- [ ] Pretty-print results: collapsible JSON (reuse State tab renderer), errors in red with stack
- [ ] Command history: ↑/↓ navigation, `sessionStorage` (not `localStorage` — no stale credentials across sessions)
- [ ] Tab-completion on live object graphs: walk `Object.getOwnPropertyNames` + prototype chain, own-first sort
- [ ] Event label hints: secondary completion when typing `Events.publish('` or `Events.on('` — sourced from routeTable constants
- [ ] Every executed command echoed as `REPL:EXEC` entry in Console tab (trace of what ran)
- [ ] Toolbar: Clear (output only), Copy session (full transcript), Help (available globals guide)
- [ ] Multi-line input: Shift+Enter for newline, Enter to run
- [ ] Access gate: admin-role only (same `isAdmin` check as admin panel) OR `?debug=1` URL param
- [ ] _Nice-to-have_: snippets library dropdown ("List channels", "Show current user", "Ping WebSocket", "List loaded extensions")
- [ ] _Nice-to-have_: method signature tooltip from `fn.toString()` parsing on autocomplete selection
- [ ] Files: `index.html` (tab markup), `debug.js` (ReplRunner object), `debug.css` (output, input, suggestion dropdown)
### v0.21.4 — Git Integration
Layer git operations onto workspaces.
- [ ] `workspaces` additions: git_remote_url, git_branch, git_credential_id, git_last_sync
- [ ] `git_credentials` table: auth_type (https_pat/https_basic/ssh_key), encrypted_data (AES-256-GCM)
- [ ] Git operations via exec: clone, pull, push, status, diff, commit, log, branch, checkout
- [ ] Workspace tools (git-aware): `git_status`, `git_diff`, `git_commit`, `git_log`, `git_branch`
- [ ] Post-operation hooks: clone/pull/checkout trigger reconcile + re-index changed files
### v0.21.5 — Editor Surface (Development Mode)
IDE-like experience. Browser-tier extension consuming workspace primitives.
- [ ] Layout: file tree (sidebar), code editor (CM6, main), AI chat panel (resizable split), status bar
- [ ] File tree: workspace_ls backed, git status indicators, context menu, drag-drop
- [ ] Code editor: CM6 codeEditor() factory, language auto-detection, tab bar, Ctrl+S save
- [ ] AI chat panel: same channel context, workspace tools auto-injected, live update via EventBus
- [ ] Keyboard shortcuts: Ctrl+P quick open, Ctrl+Shift+F workspace search
### v0.21.6 — Article Surface + Document Output Pipeline
Writing-focused surface. Document is artifact, conversation is secondary.
- [ ] Document output pipeline: write → workspace → export (markdown → HTML/PDF/DOCX via pandoc)
- [ ] Layout: outline (sidebar top), AI assistant (sidebar bottom), rich text editor (CM6 markdown, main)
- [ ] Outline: auto-generated from headings, click-to-scroll, drag to reorder
- [ ] AI assistant: lightweight chat with article-specific tools (suggest_outline, expand_section, check_citations)
- [ ] Rich text editor: CM6 noteEditor() with enhanced live preview, focus mode
- [ ] Export: download as markdown/HTML/PDF, copy to clipboard
---
@@ -721,7 +794,7 @@ The channel foundation for workflows and real-time collaboration. Today
channels are single-user direct chats. This release makes channels a
shared space that multiple actors can inhabit.
Depends on: extension surfaces (v0.21.0), WebSocket infrastructure (already exists).
Depends on: extension surfaces (v0.21.3), WebSocket infrastructure (already exists).
_(Shifted from v0.20.0 — no content changes)_