Plan: Merge Knowledge into Library
Context
The app has two overlapping top-level pages: Library (/content) shows pipeline content pieces in table/kanban views, and Knowledge (/workspace) is a filesystem file browser for reference docs, generated artifacts, and approved bundles. The user's intent: Library should be the single surface for everything the agent knows about and has produced — content pipeline items, reference materials, brand guidelines, workflow outputs, and workspace artifacts. Knowledge gets absorbed into Library and its route is removed.
Approach: Three-View Library
Expand the Library page from 2 views (Table, Kanban) to 3 views (Table, Kanban, Files). The Table view becomes the unified item list across all content types. The Files view absorbs the current workspace file browser.
View Modes
| View | Shows | Use case |
|---|---|---|
| Table | All items: pipeline pieces + reference docs from DB | Default. "Everything at a glance" |
| Kanban | Content pipeline items only (same as today) | Working the pipeline |
| Files | Workspace file tree (ported from Knowledge page) | Browsing raw artifacts, reading docs |
Data Model Extension
Extend ContentPiece with a kind discriminant to support reference documents alongside pipeline items:
1// Add to ContentPiece or create a wrapper
2kind: 'content' | 'reference'Reference documents come from listDocumentsByClass('our_page') — fetched server-side alongside existing pipeline queries. They appear in the Table view with appropriate columns (no keyword/priority for reference docs — show "—").
Header Action Bar (adapts per view)
- Table: Search + Kind filter (All / Content / References) + View toggle
- Kanban: Search + View toggle (same as today)
- Files: Search (BM25) + Section toggle (Library / Generated / Artifacts) + View toggle
Steps
1. Extend server data (frontend/app/(app)/content/page.tsx)
- Add
listDocumentsByClass('our_page')to the parallel query ingetContentPieces() - Map documents to
ContentPiece[]withkind: 'reference', sensible defaults for pipeline-specific fields - Pass combined array to
ContentLibraryClient
2. Update types (frontend/src/content-engine/types.ts)
- Add
kind?: 'content' | 'reference'toContentPiece(optional for backwards compat, default'content')
3. Extract Files view (frontend/components/content-engine/library-files-view.tsx)
- Port the file tree + preview + metadata layout from
workspace-page-client.tsxinto a standalone component - Remove its own
useHeaderSlot()call — parent manages the header - Props:
activeSection,onSectionChange,searchQuery
4. Rewrite Library client (frontend/components/content-engine/content-library-client.tsx)
- Add third view mode:
'table' | 'kanban' | 'files' - Add kind filter state for Table view
- Header slot renders different controls per view mode
- Lazy-load both
KanbanBoardandLibraryFilesView - Table columns: Title, Kind (badge), Type, Status, Keyword, Updated
- Reference doc rows show
kind: 'reference'badge, "—" for keyword/priority
5. Extend selection system (frontend/components/content-engine/content-provider.tsx)
- Add
{ type: 'document'; data: DocumentRow }toSelectedItemunion - Reference doc clicks open the context panel with doc metadata + content preview
6. Add document context panel (frontend/components/content-engine/context-panel.tsx)
- Add rendering branch for
type === 'document': title, class, source URL, word count, updated date, content preview
7. Update navigation (frontend/lib/app-navigation.ts)
- Move Library nav item from
Contentgroup toMaingroup (replace Knowledge's slot) - Change icon from
LibrarytoBookOpen(currently used by Knowledge) - Update route to
/library(cleaner URL for a top-level page) - Remove
KNOWLEDGE_BASE_PAGEconstant - Remove
/workspaceentries fromgetPageMeta()andAPP_NAV_ITEMS - Update
CONTENT_LIBRARY_PAGE.subtitleto:"Content pipeline, reference materials, and workspace artifacts"
8. Route changes
- Create
frontend/app/(app)/library/page.tsx(move from/content) - Delete
frontend/app/(app)/workspace/page.tsx - Delete
frontend/components/content-engine/workspace-page-client.tsx - Keep workspace API routes (
/api/harness/workspace/*) — Files view still needs them
9. Cleanup
- Remove unused imports and Knowledge-related constants
- Update any links that point to
/workspace
Key Files
| File | Action |
|---|---|
frontend/app/(app)/content/page.tsx | Extend with document queries |
frontend/components/content-engine/content-library-client.tsx | Major rewrite — 3 views, kind filter |
frontend/components/content-engine/workspace-page-client.tsx | Extract into library-files-view.tsx, then delete |
frontend/components/content-engine/content-provider.tsx | Add 'document' to SelectedItem |
frontend/components/content-engine/context-panel.tsx | Add document detail rendering |
frontend/src/content-engine/types.ts | Add kind to ContentPiece |
frontend/lib/app-navigation.ts | Restructure nav, remove Knowledge |
frontend/app/(app)/workspace/page.tsx | Delete |
New Files
| File | Purpose |
|---|---|
frontend/components/content-engine/library-files-view.tsx | Extracted file browser component |
Decisions
- Route:
/library(new top-level URL). Old/contentroute can redirect or be removed. - Reference docs: Intermixed with pipeline items in the Table view, filterable via Kind dropdown.
Verification
pnpm build— no type errors- Navigate to Library page — Table view shows both pipeline items and reference documents
- Kind filter works — can isolate content vs references
- Kanban view unchanged — shows only pipeline items
- Files view works — file tree loads, BM25 search works, file preview renders
- Click reference doc in Table — context panel shows document details
/workspaceroute is gone (404)- Sidebar shows Library in Main group with BookOpen icon