Commit graph

14 commits

Author SHA1 Message Date
Randall Stillwell
5f2f1e34c0 ai: add code-review graph runtime and prompts
Introduces a small graph executor under packages/ai/src/graph and a
code-review pipeline (analyze, summarize, compose) wired through new
prompt builders. Re-exported from the package index.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 22:14:21 -05:00
Randall Stillwell
456fdd4595 docs: add AGENTS.md and Cursor rules
Repo-wide agent guide at the root plus path-scoped Cursor rules for
the web app, database/migrations, and the plans/ markdown backlog.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 22:14:16 -05:00
Randall Stillwell
b992db5b3e collab: replace createRequire shim with normal imports
The collab server was using createRequire() with hardcoded relative paths
(../../../packages/database/package.json, ../node_modules/@hocuspocus/server/...)
to grab `eq` from drizzle-orm and `Forbidden` from @hocuspocus/common. That
worked under tsx in dev but fell apart in the bundled prod image because
those paths don't exist there and pnpm's symlink topology in the runtime
node_modules wasn't reachable from inside the bundled dist file.

Result at runtime: Cannot find module '@hocuspocus/common' on every
collab restart, infinite crash loop.

Switch both to plain ESM imports — tsup bundles them into dist/index.mjs
directly, no runtime resolution needed. Add @hocuspocus/common and
drizzle-orm as explicit deps so they're properly tracked.

Verified locally: bundle now resolves cleanly with no createRequire calls
(actually shrinks from 304 KB to 102 KB after dead-code elimination).

Made-with: Cursor
2026-04-28 15:14:03 -05:00
Randall Stillwell
3856d11944 docker: raise web build V8 heap to 5 GB to match 8 GB host
CT 107 bumped to 8 GB RAM. Capping the heap below the available memory
makes V8 GC-thrash near the limit and contributes to oom-kills. Set
--max-old-space-size to 5120 MB (~60% of host) so the compile has real
headroom while leaving room for kernel + dockerd + buildkit + tsup workers.

Made-with: Cursor
2026-04-28 13:33:46 -05:00
Randall Stillwell
829cbdc899 collab/mcp: bundle workspace deps so runtime doesn't import .ts files
@tasks/database (and @tasks/shared) export raw .ts files via "main" /
"exports", which works fine for tsx/dev but blows up at runtime in the
production image:

  ERR_UNKNOWN_FILE_EXTENSION: Unknown file extension ".ts" for
  /app/packages/database/src/client.ts

tsup was leaving those workspace imports as externals in the output, so
the deployed dist/index.mjs still tried to resolve them at startup.
Switch each app to a tsup.config.ts that sets noExternal: [/^@tasks\\//],
which inlines workspace packages into the bundle while keeping
node_modules deps (postgres, drizzle-orm, hocuspocus, mcp-sdk, etc.)
external.

Verified locally: collab-server bundle size goes from 7 KB to 304 KB,
confirming @tasks/database is now compiled in. Also fixed the collab
start script to point at index.mjs (tsup ESM output) instead of .js.

Made-with: Cursor
2026-04-27 16:47:17 -05:00
Randall Stillwell
403437dafc docker: bump web build heap to 2.5GB and serialize behind collab/mcp
The 1.5GB heap cap was actually too aggressive for the Next 15 webpack
compile on this monorepo: V8 spirals into GC churn near the cap, runs
the host out of free memory, and oom-killer SIGKILLs the build (exit 255).

With 4GB on the host now:
  - Cap V8 heap at 2.5GB (~70% of host RAM) — gives the compile real
    headroom while leaving room for kernel + dockerd + concurrent COPY
    layers from the collab/mcp runtime stages.
  - Add depends_on so the lighter collab + mcp services finish building
    before the web target starts its peak-memory compile, instead of
    fighting it for memory in parallel.

Made-with: Cursor
2026-04-27 15:49:41 -05:00
Randall Stillwell
70c9bbf1e5 docker: skip type-check + lint during prod web build
next build was OOM-killed (exit 255) on the Coolify host during
'Linting and checking validity of types' — tsc pulls the whole type graph
into memory and pushes the build past available RAM.

Type-checking and linting belong in CI / pre-commit, not in the prod
container build. Skip them via next.config and cap the Node heap to 1.5 GB
so any future memory blow-up surfaces as a JS OOM instead of a SIGKILL.

Made-with: Cursor
2026-04-27 14:58:12 -05:00
Randall Stillwell
3fa891bf08 docker: ensure apps/web/public exists so web runtime COPY succeeds
The Next.js standalone runtime stage copies apps/web/public into the image,
but the directory was never committed since the project hasn't shipped any
static assets. BuildKit fails with "not found" on the COPY. Adding an empty
.gitkeep guarantees the directory exists at build time and lets future static
assets drop in without further build changes.

Made-with: Cursor
2026-04-27 14:46:47 -05:00
Randall Stillwell
9cdee7f84e docker: unify per-service Dockerfiles into one multi-stage file
Collapse Dockerfile.web / Dockerfile.collab / Dockerfile.mcp into a single
docker/Dockerfile with shared `deps` stage and `web` / `collab` / `mcp`
runtime targets. BuildKit hashes the deps stage identically for all three
targets, so `pnpm install` runs once instead of three times in parallel —
fixes the OOM kill on the Coolify host (CT 107) during `docker compose build`.

Both docker-compose.yml (local dev) and docker-compose.coolify.yml now
select services via `target:` instead of separate dockerfile paths.

Made-with: Cursor
2026-04-27 14:38:39 -05:00
Randall Stillwell
ba519a8b78 fix(web): import @tasks/ai via workspace alias instead of relative path
Two AI components were importing from ../../../../packages/ai/src using
relative paths that escape the workspace root. This worked locally because
all packages are siblings on disk, but failed in Docker where Dockerfile.web
only copies apps/web, packages/database, and packages/shared into the
build context — packages/ai never made it in.

Changes:
- Add @tasks/ai as a workspace dependency in apps/web/package.json
- Switch both imports (command-palette.tsx, ai-block.tsx) to "@tasks/ai"
- Add @tasks/ai to transpilePackages in next.config.ts and the docker variant
- Copy packages/ai into the Docker build context (Dockerfile.web)
- Refresh pnpm-lock.yaml for the new workspace edge

Verified locally: web builds compile cleanly past the previously failing
"Module not found" errors. (Local final step hits an unrelated ENOSPC on
the dev disk; Coolify's volume has plenty of headroom.)

Made-with: Cursor
2026-04-27 12:57:27 -05:00
Randall Stillwell
3ddbb4fb83 fix(deploy): preserve pnpm per-package node_modules in docker builds
The previous multi-stage `deps` → `builder` split copied only the root
/app/node_modules from the deps stage, but pnpm workspaces also create
per-package node_modules directories (e.g. apps/web/node_modules) that
contain the .bin symlinks for `next`, `tsup`, etc. Without those, the
builder stage failed with `sh: tsup: not found` and `sh: next: not found`.

Collapse `deps` and `builder` into a single stage so the per-package
node_modules survive intact. pnpm's content-addressable store keeps
re-installs nearly free on cache hits, and Docker layer caching still
short-circuits the install step when only source files change.

For collab and mcp runner stages, also copy the per-app node_modules
so runtime dependency resolution works.

Made-with: Cursor
2026-04-26 22:52:04 -05:00
Randall Stillwell
0cf1e6f317 fix(deploy): use repo-root build context in coolify compose
Coolify invokes `docker compose` with --project-directory set to the
repository root, not this file's directory. Previous `context: ..` was
resolving to /artifacts (one level above the repo) and failing with
`resolve : lstat /artifacts/docker: no such file or directory`.

Switch all three services (web, collab, mcp) to `context: .` so the
build context is the repo root and `dockerfile: docker/Dockerfile.X`
resolves correctly.

Made-with: Cursor
2026-04-26 21:52:29 -05:00
Randall Stillwell
663bc77afe feat: ECHODO app shell, Coolify deploy, Authentik + Umami
Bundles in-flight ECHODO work with the Coolify deployment configuration:

App
- New routes: ai, forms, planner, settings (templates/types), teams,
  doc detail, whiteboard detail
- New components: app shell rework (icon-rail, top-header), forms
  builder/renderer/responses, types manager, objects creation dialog,
  card primitive, form + overview views
- New tRPC routers: favorites, forms, types, workspaces; updates to
  health and objects routers
- Markdown backlog sync (packages/database) + cursor-sync schema/migrations
- Schema additions: forms, types, favorites, markdown_backlog, cursor_sync
- Initial Drizzle migrations checked in

Deployment
- docker/docker-compose.coolify.yml: drops bundled Postgres/Redis
  (uses CT 102 shared services), removes host port mappings, adds
  Coolify SERVICE_FQDN_* magic vars for web + collab
- .env.example rewritten as the full ECHODO/Coolify variable manifest
- NextAuth gains an Authentik OIDC provider (gated on env presence)
- Root layout injects Umami tracking script when configured;
  metadata title flipped to ECHODO

Security
- .gitignore expanded to exclude AGENT-DEPLOY.md, .env.*, secrets/,
  credentials.*, *.key, *.crt, *.pem, ssh keys

Made-with: Cursor
2026-04-26 14:34:34 -05:00
Randall Stillwell
a508ece6e7 feat: Full project management application scaffold
Complete architecture for a ClickUp/Notion/Miro-class project management app:

- Turborepo monorepo with Next.js 15, TypeScript, PostgreSQL (Drizzle ORM)
- Object-centered database schema (everything is an Object: tasks, projects, docs, whiteboards)
- NextAuth v5 authentication with credentials + OAuth providers
- tRPC v11 API layer with full CRUD for objects, properties, relations, templates, search
- Three-panel UI: collapsible sidebar, center content area, push-in right panel
- Purple/teal theme with light/dark mode via Shadcn/ui + Tailwind CSS
- Multiple views: List, Kanban board (dnd-kit), Table (spreadsheet), Embedded iframe
- TipTap rich text editor with slash commands, custom blocks (callout, toggle, mention, embed, divider), AI block
- Real-time collaboration via Yjs + Hocuspocus with presence/cursors
- tldraw whiteboard with custom shape cards (task, document, project)
- MCP server exposing all app data/tools for AI agents
- AI chat panel, editor AI slash commands, Cmd+K command palette
- Template system with built-in templates (Bug Report, Meeting Notes, Sprint)
- Full-text search with result highlighting
- Docker Compose for full-stack deployment (web + collab + postgres + redis)

Made-with: Cursor
2026-03-26 22:39:16 -05:00