Commit graph

1983 commits

Author SHA1 Message Date
Nexus Dev
816945bfb5 docs(22-01): complete SSE streaming endpoint plan 2026-04-04 03:55:47 +00:00
Nexus Dev
0d876ced26 feat(22-01): add useStreamingChat hook, chat API stream method, and unit tests
- Add postMessageAndStream and savePartialMessage to chatApi (fetch ReadableStream for POST SSE)
- Create useStreamingChat hook with startStream, stop, streamingContent, isStreaming
- startTransition wraps token updates to avoid blocking user input (PERF-02)
- AbortController used for stop functionality (CHAT-12)
- stop() saves partial content with [stopped] suffix to DB
- Add @testing-library/react devDependency to enable renderHook testing
- 5 passing unit tests: token accumulation, lifecycle, stop/abort, error, null guard
2026-04-04 03:55:47 +00:00
Nexus Dev
fcc143cc44 feat(22-01): add SSE streaming endpoint and edit/truncate service methods
- Add editMessage, truncateMessagesAfter, streamEcho methods to chatService
- Add POST /conversations/:id/stream SSE endpoint with flushHeaders before loop (PERF-02)
- Add PATCH /conversations/:id/messages/:msgId for message editing
- Add DELETE /conversations/:id/messages/after/:msgId for message truncation
- Import gt from drizzle-orm for createdAt comparison in truncateMessagesAfter
- Guard all res.write() calls with res.writable check (prevents write-after-end)
2026-04-04 03:55:47 +00:00
Nexus Dev
5f646b7d9b docs(22-02): complete agent identity components plan — ChatMessageIdentityBar, ChatAgentSelector, agent-role-colors 2026-04-04 03:55:47 +00:00
Nexus Dev
ce0a2772be docs(22-00): complete Wave 0 foundation plan — migration, types, react-virtual, agent-role-colors, CSS, test stubs 2026-04-04 03:55:47 +00:00
Nexus Dev
b0b849fd62 test(22-00): add Wave 0 test stubs for Phase 22 components and hooks
- useStreamingChat.test.ts (5 todos)
- ChatAgentSelector.test.tsx (5 todos)
- ChatMessage.test.tsx (8 todos)
- ChatSlashCommandPopover.test.tsx (5 todos)
- ChatMentionPopover.test.tsx (4 todos)
- ChatMessageIdentityBar.test.tsx (4 todos)
- ChatMessageList.test.tsx (5 todos)
2026-04-04 03:55:47 +00:00
Nexus Dev
645535195b feat(22-00): DB migration, shared types, react-virtual, agent-role-colors, CSS animation
- Add updatedAt column to chat_messages schema (nullable)
- Create migration 0048_add_chat_messages_updated_at.sql
- Add updatedAt: string | null to ChatMessage shared type
- Install @tanstack/react-virtual in ui workspace
- Create agent-role-colors.ts with 11 distinct themed roles (THEME-03)
- Add agent-role-colors.test.ts (4 tests all passing)
- Add cursor-blink CSS animation with prefers-reduced-motion guard
2026-04-04 03:55:47 +00:00
Nexus Dev
ded9afbaed fix(22): revise plans based on checker feedback 2026-04-04 03:55:47 +00:00
Nexus Dev
9d1a91b4bc docs(22-agent-streaming): create phase plan — 6 plans in 4 waves 2026-04-04 03:55:47 +00:00
Nexus Dev
01bde5398c docs(phase-22): add validation strategy 2026-04-04 03:55:47 +00:00
Nexus Dev
6a5749e985 docs(22): research agent-streaming phase domain 2026-04-04 03:55:47 +00:00
Nexus Dev
3ab0955da9 docs(22): fix UI-SPEC checker blocks — copywriting, typography, spacing, color note
- Replace generic "Save"/"Cancel" with "Save edit"/"Discard edit" in inline edit controls
- Add solution path to agent load error: "Could not load agents. Refresh to try again."
- Eliminate 12px font size by using 13px + text-muted-foreground for slash command descriptions (4 sizes total: 11/13/15/20px)
- Replace gap-1.5 (6px) with gap-2 (8px) in identity bar — multiples-of-4 compliance
- Add theming note on bg-cyan-400 semantic token promotion path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 03:55:47 +00:00
Nexus Dev
cab661688e docs(22): UI design contract for agent-streaming phase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 03:55:47 +00:00
Nexus Dev
3488815a2b docs(22): auto-generated context (discuss skipped) 2026-04-04 03:55:47 +00:00
Nexus Dev
a6b2e0b695 docs(phase-21): mark phase complete — 7/7 plans, 13/13 must-haves verified 2026-04-04 03:55:47 +00:00
Nexus Dev
17726c4dc3 docs(21-06): complete chat search and Cmd+K gap closure plan
- Add 21-06-SUMMARY.md documenting search filtering and keyboard shortcut
- Advance STATE.md to ready_for_verification, 100% progress
- ROADMAP.md phase 21 marked Complete (7/7 summaries)
2026-04-04 03:55:47 +00:00
Nexus Dev
f6067ed749 feat(21-06): add conversation search input and Cmd+K shortcut
- Add Search/X icons and Input to ChatConversationList with 300ms debounce
- Listen for nexus:focus-chat-search event to focus search input
- Add onSearch handler to useKeyboardShortcuts (fires before input guard)
- Wire Layout Cmd+K to open chat panel and dispatch focus event
2026-04-04 03:55:47 +00:00
Nexus Dev
d6ff48c0f3 feat(21-06): add search and agentId filter to listConversations
- Add ilike import and search/agentId conditions in chatService.listConversations
- Extract search and agentId from req.query in GET /conversations route
- Extend chatApi.listConversations opts with search and agentId params
- Update useChatConversations to accept opts.search and include in queryKey
2026-04-04 03:55:47 +00:00
Nexus Dev
444a3476df docs(21): create gap closure plan for HIST-02 search + INPUT-07 Cmd+K 2026-04-04 03:55:47 +00:00
Nexus Dev
7460061877 docs(21-05): complete chat UI wiring plan — chatApi, TanStack Query hooks, conversation list, message thread
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 03:55:47 +00:00
Nexus Dev
fecab1bcc2 feat(21-05): wire full chat UI with conversation list, message thread, and ChatPanel integration
- Add ChatConversationItem with DropdownMenu actions (Rename, Pin/Unpin, Archive, Delete) and active highlight
- Add ChatConversationList with IntersectionObserver infinite scroll, loading skeletons, delete confirmation dialog, and CRUD handlers
- Add ChatMessageList with auto-scroll-to-bottom on new messages and empty state
- Update ChatPanel to render ChatConversationList (left column) and ChatMessageList (right column); handleSend uses two paths: direct chatApi for new conversations, hook mutation for existing ones
2026-04-04 03:55:47 +00:00
Nexus Dev
c268f2d03e feat(21-05): create chat API client and TanStack Query hooks
- Add ui/src/api/chat.ts with chatApi (7 methods: list/create/get/update/delete conversations + list/post messages)
- Add ui/src/hooks/useChatConversations.ts with useInfiniteQuery + placeholderData + CRUD mutations
- Add ui/src/hooks/useChatMessages.ts with useInfiniteQuery + sendMutation + flattened/reversed messages array
- Fix [Rule 3 - Blocking]: export ChatConversation, ChatMessage, ChatConversationListResponse, ChatMessageListResponse from packages/shared/src/index.ts (types existed in types/chat.ts but were not re-exported at package root)
2026-04-04 03:55:47 +00:00
Nexus Dev
de721ffc05 docs(21-03): complete chat service and REST API plan
- SUMMARY.md created with service/route implementation details
- STATE.md: advanced to plan 5/6, recorded 6min duration, added 3 decisions
- ROADMAP.md: updated phase 21 progress (5/6 summaries)
- REQUIREMENTS.md: marked CHAT-04, CHAT-05, CHAT-06, HIST-05 complete
2026-04-04 03:55:47 +00:00
Nexus Dev
528ad001b5 feat(21-03): add chatRoutes, mount in app.ts, export chat schemas from shared
- chatRoutes factory with 7 REST endpoints for conversations and messages
- All routes gated by assertBoard; company-scoped routes also use assertCompanyAccess
- Mounted as api.use(chatRoutes(db)) after activityRoutes in app.ts
- Export createConversationSchema/updateConversationSchema/createMessageSchema
  from @paperclipai/shared (were missing from main package index)
- 11 vitest route tests passing
2026-04-04 03:55:47 +00:00
Nexus Dev
f4fc4ebf13 docs(21-04): complete chat panel shell plan
- 21-04-SUMMARY.md with task details, deviations, known stubs
- STATE.md: advanced to plan 4, updated progress 67%, added decisions
- ROADMAP.md: phase 21 updated (4/6 summaries)
- REQUIREMENTS.md: INPUT-01 and THEME-01 marked complete
2026-04-04 03:55:47 +00:00
Nexus Dev
036dee3ef1 feat(21-04): create ChatPanel shell and wire into Layout and main.tsx
- ChatPanel: 380px right-side drawer with transition-[width] and hidden md:flex
- Two-column skeleton: 160px conversation list + flex thread area with ChatInput
- Layout: import ChatPanel, MessageSquare, useChatPanel; add chat toggle button
- Layout: useEffect closes PropertiesPanel when chatOpen becomes true
- Layout: ChatPanel rendered before PropertiesPanel in flex row
- main.tsx: ChatPanelProvider wrapping app inside PanelProvider
2026-04-04 03:55:47 +00:00
Nexus Dev
fb423b4d66 feat(21-03): implement chatService with full conversation + message CRUD
- createConversation, listConversations, getConversation, updateConversation
- softDeleteConversation, listMessages, addMessage
- cursor-based pagination with hasMore for both conversations and messages
- Pitfall 3: addMessage bumps conversation updatedAt after insert
- Pitfall 5: addMessage auto-sets title from first user message (IS NULL guard)
- 21 vitest tests passing
2026-04-04 03:55:47 +00:00
Nexus Dev
cbce70a50a feat(21-04): create ChatPanelContext, ChatInput, and ChatMessage components
- ChatPanelContext with localStorage persistence (nexus:chat-panel-open)
- ChatInput with Enter/Shift+Enter/Escape keyboard shortcuts and auto-resize
- ChatMessage renders user bubbles (bg-secondary) and assistant markdown via ChatMarkdownMessage
- ChatInput.test.tsx with 6 passing tests (keyboard shortcuts, max-height, submit state)
2026-04-04 03:55:47 +00:00
Nexus Dev
fde1e0eacb feat(21-02): create ChatCodeBlock and ChatMarkdownMessage components
- ChatMarkdownMessage: renders markdown with rehype-highlight syntax highlighting
- ChatCodeBlock: pre override with language label and copy button (1500ms success state)
- Uses ExtraProps from react-markdown for correct TypeScript types
- All tests pass, TypeScript compiles without errors
2026-04-04 03:55:47 +00:00
Nexus Dev
df44e1eef7 test(21-02): add failing tests for ChatMarkdownMessage and ChatCodeBlock 2026-04-04 03:55:47 +00:00
Nexus Dev
d94879e85b feat(21-02): install rehype-highlight and add hljs theme CSS overrides
- Add rehype-highlight ^7.0.2 to ui/package.json dependencies
- Add highlight.js syntax theme CSS overrides to ui/src/index.css
- Cover Catppuccin Mocha (.dark), Tokyo Night (.theme-tokyo-night), Catppuccin Latte (:root)
2026-04-04 03:55:47 +00:00
Nexus Dev
ecc293a49c test(21-00): add Wave 0 test stubs for chat service, routes, markdown, and input 2026-04-04 03:55:47 +00:00
Nexus Dev
d72ccfbb2c docs(21-02): complete markdown renderer plan — ChatMarkdownMessage, ChatCodeBlock, hljs theme CSS 2026-04-04 03:55:47 +00:00
Nexus Dev
31aa9a07e2 docs(21-00): complete chat-foundation test stubs plan 2026-04-04 03:55:47 +00:00
Nexus Dev
de24f5f5a1 docs(21-01): complete chat schema and shared types plan
- SUMMARY.md with accomplishments, commits, and deviation notes
- STATE.md advanced to plan 2 of 6, 33% progress
- ROADMAP.md updated with plan progress
- REQUIREMENTS.md: marked HIST-01 and HIST-06 complete
2026-04-04 03:55:47 +00:00
Nexus Dev
a818abb004 feat(21-01): add shared chat types and Zod validators
- Create ChatConversation, ChatConversationListItem, ChatMessage, and list response types
- Create createConversationSchema, updateConversationSchema, createMessageSchema validators
- Re-export from @paperclipai/shared barrel files (types/index.ts, validators/index.ts)
2026-04-04 03:55:47 +00:00
Nexus Dev
138d7b6893 feat(21-01): add chat_conversations and chat_messages Drizzle schema + migration
- Create chatConversations table with companyId FK, agentId FK (set null), pinned/archived/deleted timestamps
- Create chatMessages table with conversationId FK (cascade delete), role, content, agentId
- Export both tables from packages/db/src/schema/index.ts
- Generate migration 0047_nebulous_klaw.sql with full DDL, FK constraints, and indexes
2026-04-04 03:55:47 +00:00
Nexus Dev
0de520b3b9 fix(21): revise plans based on checker feedback 2026-04-04 03:55:47 +00:00
Nexus Dev
4ee071ddb5 docs(21-chat-foundation): create phase plan — 5 plans across 3 waves 2026-04-04 03:55:47 +00:00
Nexus Dev
4cfb052646 docs(phase-21): add validation strategy 2026-04-04 03:55:47 +00:00
Nexus Dev
9ba641719b docs(21): fix Cancel → Keep conversation per copywriting rules 2026-04-04 03:55:47 +00:00
Nexus Dev
766069c00e docs(21): fix UI-SPEC typography, spacing, and visuals per checker 2026-04-04 03:55:47 +00:00
Nexus Dev
babff844e5 docs(21): UI design contract for chat-foundation phase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 03:55:47 +00:00
8489057f05 [nexus] feat(19-02): adapter-aware route handlers with agentId resolution
- Add resolveSkillsDirForAgent helper to skill-registry.ts and skill-registry-groups.ts
- Install route accepts agentId in body (not agentSkillsDir)
- Uninstall route accepts agentId as query param; returns 403 for native skills
- Rollback route accepts agentId in body (not agentSkillsDir)
- Group assign/remove routes resolve dir from URL agentId param
- List agent skills route calls syncHermesNativeSkills for hermes_local agents
- skillRegistryRoutes(db) and skillGroupRoutes(db) factory signatures updated
- app.ts passes db to both route factories
2026-04-04 03:55:47 +00:00
77b2dedaf0 [nexus] chore: regenerate pnpm-lock.yaml after upstream rebase 2026-04-04 03:55:47 +00:00
58d07637fa fix(11): default agentSkillsDir server-side — GROUP-03/GROUP-04 gap closure 2026-04-04 03:55:47 +00:00
974ce521db feat(10-03): implement SkillDetail page with Overview, Versions, Diff tabs
- Full SkillDetail.tsx replacing stub (Overview, Versions, Diff tabs)
- Separate installMutation and updateMutation with distinct toast messages
- VersionDiff component using diffLines from diff package
- Version selector with Select dropdowns in Diff tab
- ScrollArea for version list in Versions tab
- Install/Update/Uninstall dialogs with confirmation
- PageSkeleton variant=detail for loading state
- SkillDetail.test.tsx with 4 SSR smoke tests (all passing)
- diff + @types/diff packages installed in ui workspace
2026-04-04 03:55:47 +00:00
bcd5a391d7 feat(09-01): extract GitHub fetch helpers to shared module
- Create github-skill-helpers.ts with fetchText, fetchJson, resolveGitHubDefaultBranch, resolveGitHubCommitSha, parseGitHubSourceUrl, resolveGitHubPinnedRef, resolveRawGitHubUrl
- Update company-skills.ts to import from github-skill-helpers.js instead of defining locally
- All existing company-skill tests pass (15/15)
2026-04-04 03:55:47 +00:00
6812e5504f feat(06-02): replace Select a company empty states + CLI Paperclip strings
- 14 UI pages: all Select a company empty states use VOCAB.company.toLowerCase()
- AgentConfigForm: 3 error throws use VOCAB.company
- AgentDetail: additional Select a company upload error replaced
- CLI run.ts: Starting/Could not locate/failed to start messages use VOCAB.appName
- CLI deployment-auth-check: repairHint uses VOCAB.appName
- CLI agent-jwt-secret-check: repairHint uses VOCAB.appName
- CLI allowed-hostname: restart message uses VOCAB.appName
- Added VOCAB import to all files missing it
2026-04-04 03:55:47 +00:00
13fa9c3708 [nexus] fix(audit): resolve integration checker findings — straggler strings, query param pre-fill, orphaned import 2026-04-04 03:55:47 +00:00