Commit graph

1864 commits

Author SHA1 Message Date
94a7c723de docs(21-02): complete chat-foundation plan 02 — ChatMarkdownMessage + ChatInput components
- SUMMARY.md created with task commits, deviations, decisions
- STATE.md advanced to plan 2, 50% progress recorded
- ROADMAP.md updated with phase 21 plan progress (2/4 summaries)
- REQUIREMENTS.md: CHAT-02, CHAT-03, INPUT-01, INPUT-07, THEME-01, THEME-02 marked complete
2026-04-01 13:05:49 +02:00
252dc9a814 docs(21-01): complete chat foundation plan — schema, types, service, routes
- 24 tests passing (service + routes)
- 9 new files created, 6 modified
- Requirements HIST-01, HIST-05, HIST-06, CHAT-04, CHAT-05, CHAT-06 marked complete

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-01 13:05:44 +02:00
5c969bb9da feat(21-01): REST API routes and route tests for chat conversations
- Add chatRoutes factory with 11 endpoints (conversations + messages)
- Mount chatRoutes in app.ts after activityRoutes
- Export chatRoutes from routes/index.ts
- Add chat-routes test suite (12 tests, all passing)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-01 13:05:40 +02:00
8e16cec7a9 feat(21-02): add ChatInput component with auto-resize and keyboard shortcuts
- Auto-resize textarea from 1 to 6 lines (max-height 160px)
- Enter sends message and clears input
- Shift+Enter inserts newline without sending
- Escape clears input when non-empty, calls onClose when empty
- Disabled state and loading spinner when isSubmitting=true
- Accessible: aria-label on textarea and send button
- 9 tests green (jsdom environment)
2026-04-01 13:02:34 +02:00
c7e0d9361f feat(21-02): add ChatMarkdownMessage component with syntax highlighting and copy button
- Renders full GFM markdown (headings, bold, italic, links, lists, tables, images)
- Code blocks use rehype-highlight for syntax highlighting
- CodeBlock sub-component shows language label and copy-to-clipboard button
- Inline code renders without copy button
- 10 tests green (jsdom environment)
2026-04-01 13:01:41 +02:00
0152d95865 feat(21-01): DB schema, shared types, validators, and chat service with tests
- Add chat_conversations and chat_messages Drizzle schema tables
- Generate migration 0047 with cascade FK and indexes
- Add ChatConversation, ChatMessage, ChatConversationListResponse types
- Add createConversationSchema, updateConversationSchema, createMessageSchema Zod validators
- Implement chatService factory with CRUD, auto-title on first message, updatedAt bump
- Add chat-service test suite (12 tests, all passing)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-01 13:01:28 +02:00
c6ae93da52 chore(21-02): update pnpm lockfile for rehype-highlight
- Add rehype-highlight 7.0.2, lowlight 3.3.0 to lockfile
2026-04-01 13:00:33 +02:00
acab737dab feat(21-02): install rehype-highlight and add theme-aware hljs CSS
- Add rehype-highlight ^7.0.2 to ui dependencies
- Add .dark, .theme-tokyo-night, :root:not(.dark) hljs token overrides to index.css
- Covers catppuccin-mocha (default dark), tokyo-night, catppuccin-latte themes
- Uses var(--card) for background consistency with theme system
2026-04-01 13:00:25 +02:00
d5934b743f [nexus] docs(21): add CHAT-04/05/06 to Plan 03 requirements frontmatter 2026-04-01 12:56:09 +02:00
af211e6a39 [nexus] docs(21-chat-foundation): create phase plan
4 plans across 3 waves for Chat Foundation phase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:52:49 +02:00
3f14268682 [nexus] docs(21): add validation strategy 2026-04-01 12:43:14 +02:00
08d01f89c9 [nexus] docs(21): fix UI-SPEC checker issues — copywriting, typography, spacing
- Replace "Cancel" with "Keep conversation" in delete confirmation (Dimension 1)
- Drop font-weight 500 (medium); consolidate to 400 + 600 only (Dimension 4)
- Fix ChatInput padding from py-2.5 (10px) to py-2 (8px) (Dimension 5)
- Name 12px as sm+ token with justification for conversation list item padding (Dimension 5)
- Add noun suffix to all dropdown action labels ("Archive conversation", etc.)
- Add focal point statement to contract

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 12:40:17 +02:00
181af7b00d [nexus] docs(21): UI design contract 2026-04-01 12:36:12 +02:00
72764b1e93 [nexus] docs: log upstream rebase status — 0 behind, build verified 2026-04-01 12:26:31 +02:00
63636228d3 [nexus] chore: migrate .planning/ from agent repo to nexus repo
Planning artifacts (milestones v1.0-v1.2.1, v1.3 queue, PROJECT.md,
STATE.md, config) now live alongside the code they describe.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:24:31 +02:00
579efec891 feat(20-02): add compatibleAdapters prop to SkillCard and wire Browse/Trending tabs
- Add optional compatibleAdapters prop to SkillCardProps interface
- Render 'Works with: ...' line when compatibleAdapters is provided and non-empty
- Pass COMPATIBLE_ADAPTER_LABELS to all Browse tab SkillCard renders
- Pass COMPATIBLE_ADAPTER_LABELS to all Trending tab SkillCard renders (gainingTraction, recentlyUpdated, youMightLike)
- Installed tab SkillCards intentionally omit compatibleAdapters (already agent-scoped)
2026-04-01 12:04:17 +02:00
46a448eb33 feat(20-02): add adapter labels and unsupported install guard to SkillBrowser
- Import getUIAdapter and resolveAdapterSkillConfig/listAdapterSkillConfigs
- Show adapter type label in parentheses next to agent name in Installed tab selector
- Show adapter type label in install dialog agent list
- Guard handleInstallForAgent: show unsupportedMessage if adapter does not support install
- Dismissible error alert in install dialog for unsupported adapter attempts
- Clear unsupportedMessage on dialog open/close
- Compute COMPATIBLE_ADAPTER_LABELS at module level for Task 2
2026-04-01 12:03:11 +02:00
223188a3c2 [nexus] feat(20-01): expand HermesLocalConfigFields with model, toolsets, persistSession, timeoutSec
- Add Model field (both create + edit modes) using CreateConfigValues.model
- Add Toolsets field (both create + edit modes) using extraArgs in create, adapterConfig.toolsets in edit
- Add Persist Session checkbox (edit mode only) wired to adapterConfig.persistSession
- Add Timeout (seconds) field (edit mode only) wired to adapterConfig.timeoutSec
- Restructure component to use fragment with conditional hideInstructionsFile guard
- TypeScript compiles cleanly
2026-04-01 12:00:30 +02:00
6e93e12750 [nexus] feat(20-01): add gemini_local to AGENT_ADAPTER_TYPES constant
- Add gemini_local to AGENT_ADAPTER_TYPES array after hermes_local
- Closes TypeScript gap where gemini_local was valid in UI adapter registry but missing from AgentAdapterType union type
- TypeScript compiles cleanly for @paperclipai/shared and @paperclipai/ui
2026-04-01 11:59:50 +02:00
79d2d3a485 [nexus] feat(19-03): dual-section Installed tab and read-only SkillCard for native skills
- SkillCard: add isReadOnly and source props; hide update/rollback/install when isReadOnly
- SkillCard: show Native badge when isReadOnly or source=native
- SkillBrowser: remove agentSkillsDir state and text input from install dialog
- SkillBrowser: add selectedAgentId state for per-agent installed skills view
- SkillBrowser: add agentInstalledSkills query using skillGroupsApi.listAgentSkills
- SkillBrowser: split installed skills into managedSkills/nativeSkills sections
- SkillBrowser: render Managed/Native section headings when nativeSkills.length > 0
- SkillBrowser: uninstall dialog now carries agentId and calls skillRegistryApi.uninstall
- SkillBrowser: install dialog sends agentId directly (no agentSkillsDir text input)
2026-04-01 11:38:08 +02:00
b69b8ceaff [nexus] feat(19-03): update API client to use agentId instead of agentSkillsDir
- Add AgentSkillEntry type with skillId, source, installedAt fields
- install() now sends agentId in body not agentSkillsDir
- uninstall() new function that sends agentId as query param
- rollback() now sends agentId in body not agentSkillsDir
- skillGroups.assignGroup/removeGroup no longer accept agentSkillsDir param
- listAgentSkills now returns AgentSkillEntry[] not string[]
- Fix AgentDetail.tsx callers and entry rendering for new AgentSkillEntry type
- Fix SkillDetail.tsx callers to use agentId param
2026-04-01 11:35:40 +02:00
12c3565a13 [nexus] test(19-02): route-level integration tests for adapter-aware skill routes
- Add 18 supertest tests covering install/uninstall/rollback/group routes
- Verify 400 (missing agentId), 404 (unknown agent), 422 (unsupported adapter)
- Verify 403 for native skill deletion
- Verify hermes_local agents trigger syncHermesNativeSkills before list
- Verify group assign resolves dir from URL agentId param
- Fix wildcard route syntax from :skillId(*) to *skillId (Express 5 / path-to-regexp v8)
  resolves pre-existing TS errors for these routes too
2026-04-01 11:29:03 +02:00
1cae145533 [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-01 11:26:34 +02:00
e3f9302360 [nexus] feat(19-01): unit tests for adapter-aware install/uninstall and Hermes dual-source
- skill-registry-adapter-install.test.ts: 9 tests covering install/uninstall/rollback/assignGroup/removeGroup
- hermes-dual-source.test.ts: 7 tests covering syncHermesNativeSkills idempotency and listAgentSkills object shape
- Fix skill-registry-install.test.ts: update uninstall() callers to pass agentSkillsDir (new required param)
- Fix removeGroup() bug: removed incorrect 'individualSkills' guard that prevented file removal for group-installed skills
  (rule 1 auto-fix: group-installed skills were never removed because they appeared in agentSkills with no way to distinguish from direct installs)
- All 16 new tests pass, all existing tests still pass
2026-04-01 11:19:57 +02:00
256e263019 [nexus] feat(19-01): adapter-aware skill service layer — source column, uninstall file removal, syncHermesNativeSkills
- agentSkills schema gets source TEXT NOT NULL DEFAULT 'managed' column
- Migration guard in getSkillRegistryDb() handles existing DBs via ALTER TABLE
- uninstall() now accepts agentSkillsDir and removes files before soft-deleting
- syncHermesNativeSkills() reads ~/.hermes/skills/, creates stub rows with source='native'
- listAgentSkills() returns typed objects {skillId, source, installedAt} not string[]
- Interim uninstall route fix: reads agentSkillsDir from query param until Plan 02 wires agentId
2026-04-01 11:15:27 +02:00
34781b7ec5 [nexus] feat(18-01): implement adapter skill config resolver
- Static ADAPTER_SKILL_CONFIGS array with all 10 adapter types
- CONFIG_BY_TYPE Map for O(1) lookup by adapter type string
- FALLBACK_CONFIG for unknown types (supportsInstall: false, never throws)
- resolveAdapterSkillConfig returns correct config for all known adapters
- listAdapterSkillConfigs returns full readonly config array
- All 15 unit tests pass, no regressions in full test suite
2026-04-01 10:57:31 +02:00
b010708e00 [nexus] test(18-01): add failing tests for adapter skill config resolver
- Add AdapterSkillFormat type and AdapterSkillConfig interface to types.ts
- Create stub adapter-skill-config.ts (throws not implemented)
- Re-export new types and functions from index.ts
- Add comprehensive test file covering all 10 adapter types and fallback
2026-04-01 10:56:39 +02:00
f00a30ca21 [nexus] fix: restore upstream delegation and fact-extraction content lost during rebase 2026-04-01 07:54:09 +02:00
e05bf13d52 [nexus] chore: regenerate pnpm-lock.yaml after upstream rebase 2026-04-01 07:46:41 +02:00
bb7d84e34a feat(12-02): SkillDetail Ratings tab and Overview usage stats
- Add Ratings tab (4th tab) with rate form, personal history, community section
- Overview tab: conditionally render taskCount, avgCostUsd, lastUsedAt rows
- Import StarRating, Separator, Skeleton, Textarea, EmptyState, TooltipProvider
- saveRatingMutation calls addRating, invalidates ratings query on success
- ratingsQuery loads personal history with loading/empty/error states
2026-04-01 07:46:09 +02:00
6a79c8b004 feat(12-02): StarRating component, API extensions, DesignGuide entry
- Create StarRating component with interactive/readonly modes, amber stars, size sm/md
- Add PersonalRating type and taskCount/avgCostUsd/lastUsedAt to SkillListItem
- Add getRatings and addRating to skillRegistryApi
- Add Rating System section to DesignGuide with all variants
- Fix SkillCard fixture and DesignGuide examples to include new SkillListItem fields
2026-04-01 07:46:09 +02:00
2bb998a7b2 feat(12-01): ratings routes, community ratings in fetcher, list/getById JOIN, heartbeat hook
- Add POST/GET /skill-registry/skills/:sourceId/:slug/ratings routes
- Import skillRatingService in skill-registry routes
- Add upsertCommunityRatingsStub() in fetcher, called after each skill upsert
- Import communityRatings from schema in fetcher
- Update list() and getById() in skill-registry.ts to LEFT JOIN communityRatings
- Include averageRating, ratingCount, taskCount, avgCostUsd, lastUsedAt in SkillListItem
- Add agentSkills usage aggregation via LEFT JOIN + SUM/AVG/MAX
- Add fire-and-forget recordUsageForAgent call in heartbeat after finalizeAgentStatus
- Dynamic import keeps skill-registry-ratings off critical startup path
- All 44 skill-registry tests pass, full server suite (536) green
2026-04-01 07:46:09 +02:00
b38a230b77 feat(12-01): personalRatings schema, DB DDL, skillRatingService, and tests
- Add personalRatings table to skill-registry-schema.ts
- Add taskCount, avgCostUsd, lastUsedAt columns to agentSkills in schema
- Add CREATE_PERSONAL_RATINGS_TABLE DDL constant in skill-registry-db.ts
- Add ALTER TABLE statements for new agent_skills usage columns (idempotent)
- Create skill-registry-ratings.ts with skillRatingService factory
- rate() appends personal rating, validates stars 1-5
- getRatings() returns ratings ordered by createdAt DESC
- recordUsageForAgent() atomically updates task_count, avg_cost_usd, last_used_at
- All 8 tests pass
2026-04-01 07:46:09 +02:00
27237c32ee fix(11): default agentSkillsDir server-side — GROUP-03/GROUP-04 gap closure 2026-04-01 07:46:09 +02:00
e495d98e48 feat(11-04): extend AgentSkillsTab with groups section and dialogs
- Add imports: skillGroupsApi, SkillGroupRow, GroupBadge, Dialog, Separator, ScrollArea, Textarea
- Add agentGroups + allGroups + agentEffectiveSkills queries in AgentSkillsTab
- Add assignGroup + removeGroup + createGroup mutations
- Add state for add/create/remove dialogs, search, new group fields
- Insert Assigned Groups section with loading/empty/populated states
- Insert Combined Effective Skills collapsible section with ScrollArea
- Insert Additional Individual Skills label above existing skill list
- Add Add Skill Group, Create Skill Group, Remove group from agent dialogs
- Add Skill Groups section to DesignGuide with all GroupBadge variants
2026-04-01 07:46:09 +02:00
cb8423c400 feat(11-04): create GroupBadge component
- Built-in variant: Badge secondary, no dismiss, hover:bg-accent/30
- Custom variant: Badge outline, X dismiss button with spinner, hover:bg-accent/50
- Tooltip on both variants showing name · built-in · N skills or name · N skills
- text-sm font-semibold typography per UI-SPEC (no font-bold or font-medium)
2026-04-01 07:46:09 +02:00
63d303b32b feat(11-03): add skill groups frontend API client and query keys
- Create ui/src/api/skillGroups.ts with skillGroupsApi object
- All 14 methods covering group CRUD, members, export/import, agent assignments
- removeGroup uses raw fetch for DELETE-with-body (api.delete has no body support)
- Add skillGroups namespace to ui/src/lib/queryKeys.ts with 6 key factories
2026-04-01 07:46:09 +02:00
930d8cb114 feat(11-03): add skill group routes, mount in app.ts, startup reconciliation
- Create server/src/routes/skill-registry-groups.ts with skillGroupRoutes() factory
- All 14 REST routes for group CRUD, members, export/import, and agent assignments
- Import route registered before :groupId param to avoid route collision
- assertBoard on every handler, error classification (400/404/409/500)
- Mount skillGroupRoutes() in app.ts after skillRegistryRoutes()
- Add pendingSkillGroups fire-and-forget reconciliation in index.ts startup
2026-04-01 07:46:09 +02:00
b918c5e809 feat(11-02): skillGroupService() with CRUD, membership, inheritance, assignment, import/export
- Group CRUD: listGroups, getGroup, createGroup, updateGroup, deleteGroup (guards built-in)
- Member management: addMember, removeMember, listMembers
- Inheritance: addParent (with cycle detection BFS), removeParent, listParents
- resolveEffectiveSkills: BFS walk with visited-set guard for cycle safety
- assignGroup: installs all effective skills, tracks in agent_skills, returns installed/skipped/pendingPlugin
- removeGroup: set-difference uninstall with fs.rm() for file removal (not skillRegistryService.uninstall)
- listAgentGroups, listAgentSkills, getAgentEffectiveSkills
- exportGroup / importGroup: GroupExport v1 JSON with cycle check on import
2026-04-01 07:46:09 +02:00
43abc69fb5 feat(11-01): add group table DDL and built-in group seeding to skill-registry-db
- Import LibSQLClient type for seedBuiltinGroups parameter typing
- Add DDL constants for 5 new tables: skill_groups, skill_group_members,
  skill_group_inheritance, agent_skill_groups, agent_skills
- Add BUILTIN_GROUPS constant with 5 entries (pm-essentials, engineer-core,
  frontend, backend, creative)
- Add seedBuiltinGroups() using INSERT OR IGNORE for idempotent seeding
- Extend getSkillRegistryDb() to execute all 5 new DDL statements and seed
2026-04-01 07:46:09 +02:00
2a5bfc16e8 feat(11-01): add five Drizzle table definitions for skill groups
- Add primaryKey import from drizzle-orm/sqlite-core
- Add skillGroups table with id, name, description, isBuiltin, timestamps
- Add skillGroupMembers junction table with composite PK (groupId, skillId)
- Add skillGroupInheritance table with composite PK (childGroupId, parentGroupId)
- Add agentSkillGroups table with composite PK (agentId, groupId)
- Add agentSkills table with composite PK (agentId, skillId)
2026-04-01 07:46:09 +02:00
328e44b887 fix(10): correct toast error messages in SkillDetail — Update/Uninstall not Install/Rollback 2026-04-01 07:46:09 +02:00
530b94b2f7 feat(10-03): update DesignGuide SkillCard section with all 5 required variants
- Expand grid to lg:grid-cols-3 for 5-card layout
- Add Loading (updating) variant (5th card per UI-SPEC requirement)
- Add onRollback/onUninstall props to installed variants
- Add descriptive comments for each variant state
2026-04-01 07:46:09 +02:00
c6eaa25f28 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-01 07:46:09 +02:00
daef2c24cb test(10-02): add SkillBrowser SSR smoke tests
- 4 node-environment tests using renderToStaticMarkup
- Verifies page title, search input, refresh button, and tab labels render
- Mocks react-query, router, context providers for SSR compatibility
2026-04-01 07:46:05 +02:00
7ad2671252 feat(10-02): build SkillBrowser page with Browse tab, dialogs, and 5 mutations
- Replace stub with full three-tab page (Browse, Installed, Trending placeholders)
- Five separate mutations: fetch, install, update, rollback, remove with distinct toasts
- Agent selector dialog with skills directory input for install/update flow
- Uninstall confirmation dialog with destructive button
- Browse tab: search, source filter, category filter, sort, FilterBar, card grid, EmptyState
- Breadcrumbs wired via useBreadcrumbs, data via TanStack Query
2026-04-01 07:46:05 +02:00
eabddd3d9a feat(10-01): add SkillCard component, tests, route wiring, and design guide entry
- Create SkillCard.tsx with 3-row layout per UI-SPEC (name link, description, source/rating/actions)
- Create SkillCard.test.tsx with 8 passing unit tests using renderToStaticMarkup
- Create SkillBrowser.tsx and SkillDetail.tsx stub pages
- Update App.tsx: remove CompanySkills import, add skills and skills/detail/:skillId routes
- Add SkillCard to DesignGuide.tsx with 4 variants (default, installed, update available, loading)
2026-04-01 07:46:05 +02:00
2616f0e3fd feat(10-01): add skillRegistry API client and query keys
- Create ui/src/api/skillRegistry.ts with typed methods for all 7 endpoints
- Use two-segment URL paths (/sourceId/slug) for Express 5 compatibility
- Add skillRegistry namespace to queryKeys.ts (list/detail/versions)
2026-04-01 07:46:05 +02:00
dce7662b97 feat(09-04): implement skill registry REST routes and mount in app.ts (GREEN)
- Create skillRegistryRoutes() factory with 6 endpoints
- GET /api/skill-registry/skills (list, includeRemoved support)
- GET /api/skill-registry/skills/:sourceId/:slug (single skill, 404 on missing)
- GET /api/skill-registry/skills/:sourceId/:slug/versions (version history)
- POST /api/skill-registry/fetch (trigger fetchAllSources)
- POST /api/skill-registry/skills/:sourceId/:slug/install (copy to agent dir)
- POST /api/skill-registry/skills/:sourceId/:slug/rollback (restore prior version)
- DELETE /api/skill-registry/skills/:sourceId/:slug (soft-delete)
- assertBoard auth guard on every route
- Mount skillRegistryRoutes() in app.ts after companySkillRoutes
- Update tests to use two-segment path params (sourceId/slug) for Express 5 compatibility
- All 12 route tests pass
2026-04-01 07:46:05 +02:00
380f561963 test(09-04): add failing tests for skill registry routes (RED)
- Tests for GET /api/skill-registry/skills (list, includeRemoved param)
- Tests for GET /api/skill-registry/skills/:id (found, 404)
- Tests for GET /api/skill-registry/skills/:id/versions
- Tests for POST /api/skill-registry/fetch
- Tests for POST /api/skill-registry/skills/:id/install (success, 400)
- Tests for POST /api/skill-registry/skills/:id/rollback (success, 400)
- Tests for DELETE /api/skill-registry/skills/:id
2026-04-01 07:46:05 +02:00