Commit Graph
15 Commits
Author SHA1 Message Date
Hermes c1c95f727a T4/Phase 2C-1: port search routes to Hono (3 routes) + new DB tables 2026-08-01 01:47:25 +00:00
Hermes fca56ab77e T1/Phase 1: scaffold Vite SPA + Hono API + Bun worker
- apps/web: Vite + React 19 + TanStack Router/Query + shadcn/ui
   - apps/api: Hono + Bun on :3001 with /api/health, /api/auth/*, /mcp stubs
   - apps/worker: Bun worker stub, DB connection, graceful SIGTERM
   - apps/web-legacy/: old Next.js code moved aside (preserved for T2-T8 reference)
   - Dockerfiles: api (Bun), worker (Bun), spa (multi-stage Caddy)
   - Caddyfile: serves dist + reverse-proxies /api/* + /mcp to api
   - docker-compose.yml: 4-service target (api, spa, db, worker)
   - packages/db/src/client.ts: shared Drizzle client for api + worker
   - db/client.ts: root-level alias for convenience

   Parent: t_e1cbd87d -> t_24c9c3fd (T0)
2026-08-01 01:15:31 +00:00
Hermes 59f7c768ca fix(build): use two-arg form for z.record in webhook headers schema 2026-07-31 00:02:25 +00:00
Hermes 304267199e fix(build): use zod v3 two-arg form for z.record across all shared schemas
Same fix as the agent schema commit — zod 3.25 (resolved by ^3.25.0)
requires z.record() to take both key and value schemas. The single-arg
form is v4 syntax.

Fixed 15 remaining call sites across canvas, project, report, common,
webhook, habit, task, note, and milestone schemas. Pure type-only fix —
runtime behavior identical.
2026-07-30 23:59:11 +00:00
Hermes f7e0915044 fix(build): use zod v3 two-arg form for z.record in agent schema
zod 3.25 (the version resolved by ^3.25.0) requires z.record() to take
both a key and a value schema. The single-arg form z.record(z.unknown())
is zod v4 syntax, which trips next build's typecheck.

Four call sites in packages/shared/src/schemas/agent.ts were written in
v4 form (lines 39, 41, 73, 74). This is a pure type-only fix — runtime
behavior is identical.
2026-07-30 23:56:38 +00:00
Hermes c3bce0b9e3 fix(p0): resolve active domain automatically when onboarding skipped
- New resolveActiveDomain() helper in apps/web/lib/auth.ts: returns the
  user's first existing domain (ordered by sort_order then created_at),
  or auto-creates a default 'Personal' domain if they have none.
- 7 affected API routes (agents, canvases, domains, habits, projects,
  search, tasks) now fall back to resolveActiveDomain when the request
  omits a domain param. This eliminates the UNDEFINED_VALUE on domain_id
  and 22P02 invalid uuid errors that broke 6+ UI flows.
- New POST /api/quick-capture route: switches on type=task|habit|note|project
  to create the right entity, after resolving the active domain. This is
  the API the dashboard quick-capture widget calls.
- packages/db/src/schema.ts: added ownerId: uuid('owner_id') to the
  domains table so each user owns their domains.
- drizzle/0004_add_owner_id_to_domains.sql: matching migration with
  column add + index.
- apps/web/__tests__/lib/auth.test.ts: unit tests for both branches of
  resolveActiveDomain (returns existing / creates Personal).
- apps/web/app/(dashboard)/canvas/page.tsx: removed hardcoded
  domain: 'personal' from the quick-create payload so server-side
  resolution can do its job.

This unblocks all of: /tasks, /habits, /projects, /search, /settings/agents,
/settings/domains, /canvas, and dashboard quick-capture.
2026-07-30 23:51:29 +00:00
Hermes Coding Manager d7320be5e3 chore(integration): drop broken @project-e/cli, add eslint config
- Remove packages/cli (referenced dropped v1 'records' table, broken since 6c438ea)
- Remove packages/cli from root workspaces
- Add eslint + eslint-config-next to apps/web so 'npm run lint' runs
- Regenerate package-lock.json

This unblocks typecheck/build/lint for the v2 rewrite.
2026-07-29 08:09:59 -04:00
mbatchelder e5b7d9e2ee feat: Phase 6 - MCP + Webhooks + Worker + Polish
- MCP server: stateless JSON-RPC 2.0 with 18 tools (tasks, habits, projects, notes, domains, search, activity)
- Webhooks API: CRUD routes under /api/domains/[domainId]/webhooks/ with test endpoint and deliveries log
- Webhook delivery: HMAC-SHA256 signed POST with retry (exponential backoff, max 6)
- Worker rewrite: Drizzle ORM instead of PocketBase, polls jobs table, handles webhook_delivery, recurring_spawn, ai_dispatch
- Rate limiting: token bucket per IP/API key (100 req/min REST, 300 req/min MCP)
- Keyboard help overlay: ? opens Radix Dialog with search/filter, Esc closes
- AI @mention stub: @agent in command palette dispatches CustomEvent
- Mobile responsive: bottom nav, single-column kanban, day view calendar, 44px touch targets
- Accessibility: skip-to-content link, focus rings, aria-labels, color contrast
- E2E tests: mcp.spec.ts, webhooks.spec.ts, realtime.spec.ts added
- Schema: api_keys and webhook_deliveries tables with migration
- Removed old PocketBase-style database.ts from worker
2026-07-29 08:03:28 -04:00
mbatchelder eba1d78fb9 feat: Phase 5 - Calendar + Dashboard + Search
Calendar:
- GET /api/domains/[domainId]/calendar/events?from=&to= — returns tasks, habits, projects, milestones
- PATCH /api/domains/[domainId]/tasks/[id]/schedule — drag-to-reschedule with activity feed
- Calendar UI with month/week/day views via react-big-calendar
- Drag-to-reschedule with SSE updates
- Filter by entity type and domain
- Keyboard shortcuts: t=today, m/w/d=view, ←/→=navigate
- Mobile: auto-switches to day view on small screens

Dashboard:
- GET/PUT /api/domains/[domainId]/dashboard — layout stored in domain custom_fields
- 8 per-widget data endpoints (today-tasks, habit-checklist, weekly-stats, project-progress, upcoming-calendar, recent-notes, activity-feed, quick-capture)
- react-grid-layout with responsive breakpoints (12/8/4 cols)
- Drag-to-reorder, resize, add/remove widgets
- Edit mode toggle, per-workspace layout persistence
- Widget error boundary

Search:
- tsvector columns + GIN indexes on tasks, notes, projects, habits, domains
- GET /api/search?q=&types=&domain= — ranked results with ts_headline snippets
- Dedicated search page with grouped results, filters, recent searches (localStorage)
- Empty state with hints

Schema:
- Added custom_fields jsonb column to domains table (migration 0002)
- Removed stale root app/ directory

Build: passes, typecheck: passes, tests: 18/18 wikilink-parser tests pass
2026-07-29 07:32:47 -04:00
mbatchelder b3ff23a5f0 feat: Phase 1 foundation - schema, auth, realtime, shell
- Rewrote Drizzle schema: 20 tables with enums, relations, indexes
- Generated migration with DROP TABLE records (v1 EAV removal)
- Added passkey auth routes (register/login)
- Added requireWorkspaceAccess helper
- Added seedDefaultData for Personal workspace + welcome note
- Updated SSE endpoint for v2 entities + workspace_id filtering
- Created recordActivity helper (insert + pg_notify)
- Updated sidebar: Graph replaces Reports, removed Analytics
- Updated command palette for v2 entities
- Created AGENTS.md with locked contract
- Created llm-wiki scaffold (5 stubs)
- Added inline AGENT INSTRUCTION comments to all 50 API route files
- Fixed globals.css border-border class conflict
- Updated database.ts stub for v1 compatibility
2026-07-29 05:53:13 -04:00
bot-hermes 945dd8904a fix: allow null due_date in task schema for PATCH updates 2026-07-28 14:20:03 +00:00
mbatchelder 73335484f8 feat: migrate from PocketBase to PostgreSQL with Drizzle ORM
- Add @project-e/db package with Drizzle schema and migrations
- Replace PocketBase client with PostgreSQL-based database client
- Migrate auth from custom to NextAuth.js
- Add Docker Compose with PostgreSQL container
- Update worker to use new database client
- Remove PocketBase-specific files and migrations
- Add drizzle config and initial migration
2026-07-24 07:08:29 -04:00
mbatchelder 6c438eab32 feat: add admin CLI for project management
- User management (list, create, delete, reset-password)
- Data CRUD for all 32 collections
- Import/export with JSON support
- Worker/queue management (status, jobs, retry, trigger)
- Webhook management (list, test, deliveries, retry)
- Agent management (list, CRUD, tasks, trigger, activity)
- Health diagnostics (check, errors, stats)
- JSON output mode (--json flag)
- Run via: npm run cli -- <command>
2026-07-24 07:02:11 -04:00
bot-hermes 301f4ea5ce fix: resolve Zod v4 record type error and worker TypeScript compilation
- packages/shared/src/schemas/agent.ts: z.record(z.unknown()) → z.record(z.string(), z.unknown())
- Dockerfile.worker: add TypeScript compilation support (tsx)

Fixes #build-web and #build-worker container failures.
2026-07-19 00:03:43 +00:00
mbatchelder 8f55626e03 refactor: migrate to monorepo structure with Docker, PocketBase, and e2e tests
- Reorganize into apps/, packages/, docs/, e2e/, pocketbase/ directories
- Add Dockerfiles for web, worker, and PocketBase services
- Add docker-compose.yml for local orchestration
- Add turbo.json for monorepo task management
- Add Playwright e2e test infrastructure
- Add PocketBase backend with migrations
- Remove Vite/Next.js/ESLint/PostCSS config files
- Update package.json with workspace dependencies
- Add .env.example and .dockerignore
2026-07-16 06:19:58 -04:00