Skip to content

feat: Workspace Foundation#10

Merged
falfaddaghi merged 13 commits intomainfrom
adw/feature-workspace-foundation-616005e8
Apr 14, 2026
Merged

feat: Workspace Foundation#10
falfaddaghi merged 13 commits intomainfrom
adw/feature-workspace-foundation-616005e8

Conversation

@falfaddaghi
Copy link
Copy Markdown
Member

@falfaddaghi falfaddaghi commented Apr 10, 2026

Summary

Introduces the workspace foundation for Nexus Workflow Studio — server-side persistence for workspaces and workflows (mirroring the Brain file-store pattern), Hocuspocus-backed real-time collaboration with persistent rooms, Brain document versioning with history/restore, and the full infrastructure scaffolding (Docker Compose, startup scripts, collab server) needed to support multi-user workspace editing. This is the prerequisite layer for the workspace landing page, dashboard UI, and per-workflow Y.js collaboration wiring that build on top of it.

Plan: docs/tasks/feature-workspace-foundation-616005e8/plan-feature-workspace-foundation-616005e8.md

ADW ID: 616005e8

What was done

  • Phase 1 — Persistence foundation: src/lib/brain/server.ts, types.ts, config.ts, schemas.ts, client.ts implement the full Brain file-store: manifest-based JSON CRUD, nanoid IDs, nowIso() timestamps, ensureDir/readJsonFile/writeJsonFile helpers
  • Phase 1 — Brain API routes: POST/GET documents, GET/PUT/DELETE/PATCH per document, version history, feedback, restore, view, shares, and session routes all wired as Next.js Route Handlers following the established pattern
  • Phase 1 — Document version history: src/app/api/brain/documents/[id]/versions/route.ts + restore/route.ts + feedback/route.ts — documents now persist with full version history
  • Phase 2 — Collaboration persistence: src/lib/collaboration/collab-doc.ts refactored to support Hocuspocus persistent rooms; object-store.ts added for collaboration object persistence
  • Phase 2 — Infrastructure: docker-compose.yml updated with workspace/brain data volumes and collab server service; Dockerfile updated; scripts/start.sh and scripts/collab-server.ts added
  • Phase 2 — Specs committed: docs/spec/spec-workspace-foundation.md and docs/spec/spec-workspace-recent-changes.md define the full workspace feature surface
  • Phase 3 — Knowledge store: src/store/knowledge/store.ts and types.ts updated to align with persistent Brain API; src/types/knowledge.ts extended
  • Tests: src/lib/__tests__/brain-server.test.ts and collaboration-object-store.test.ts added covering persistence operations
  • Implementation plan: docs/tasks/feature-workspace-foundation-616005e8/plan-feature-workspace-foundation-616005e8.md committed for traceability

Latest update

  • Fixed share-link copy when the Clipboard API is unavailable in the browser context
  • Updated local startup to load .env.local before selecting collaboration server ports, so developers can avoid local port conflicts like lm-studio on 1234
  • Verified cross-browser collaboration with two isolated browser sessions showing Live · 2

falfaddaghi and others added 12 commits April 10, 2026 15:27
Check execCommand return value so the textarea fallback throws on
failure, and show a toast.error if copy fails on share-start instead
of swallowing the error silently.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add the feature doc for the workspace foundation work (ADW 616005e8)
and register it in the conditional docs index so future tasks touching
workspace routes, persistence, or share links pick it up.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add .nexus-brain/ and .nexus-collab/ to .gitignore so locally generated
Brain and collab runtime state does not get accidentally committed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@falfaddaghi falfaddaghi marked this pull request as ready for review April 14, 2026 20:26
…-foundation-616005e8

# Conflicts:
#	src/store/knowledge/store.ts
@falfaddaghi falfaddaghi merged commit c10b436 into main Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant