Commit graph

6 commits

Author SHA1 Message Date
Paperclip FoundingEngineer
c84de0f4f4 fix(agenthub): Compile migrations and expose postgres port for diagnosis
Some checks are pending
CI / lint + typecheck + tests (push) Waiting to run
CI / docker build + push (push) Blocked by required conditions
Fixes BARAAA-64 DB migration and auth issues:

- Update tsconfig.build.json to compile scripts/migrate.ts (was excluded)
- Create entrypoint.sh to run migrations before server start
- Update Dockerfile to build migrate.ts and use migration entrypoint
- Expose postgres port 15432 temporarily for password diagnosis

This ensures tables are created before app starts and allows connecting
to postgres from host to diagnose 28P01 auth errors.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 10:41:21 +00:00
34afb8d729 fix(docker): force NODE_ENV=development in build stage to include devDependencies
Some checks are pending
CI / lint + typecheck + tests (push) Waiting to run
CI / docker build + push (push) Blocked by required conditions
Coolify auto-injects ARG NODE_ENV into all Dockerfile stages and passes
NODE_ENV=production as a build arg. This causes npm ci to skip devDependencies
(including typescript), making tsc not found (exit 127) at npm run build.

Fix: prefix the npm ci call with NODE_ENV=development to override the injected
env var only for the install step, ensuring TypeScript and other build tools
are always installed.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 10:13:17 +00:00
6fcb5cbc1d fix(docker): remove --prefer-offline from build stage to fix npm ci in CI/CD
Some checks are pending
CI / lint + typecheck + tests (push) Waiting to run
CI / docker build + push (push) Blocked by required conditions
Coolify's build environment has no npm cache populated, so --prefer-offline
causes npm ci to fail to install devDependencies (incl. typescript).
Removing the flag ensures npm always fetches from registry during builds.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 10:10:55 +00:00
Paperclip FoundingEngineer
f490152172 fix(agenthub): Apply J5 deployment fixes discovered during LAN rollout
Some checks are pending
CI / lint + typecheck + tests (push) Waiting to run
CI / docker build + push (push) Blocked by required conditions
Five critical fixes discovered and patched on production (192.168.9.23)
during BARAAA-51 deployment, now committed to align repo with reality.

1. tsconfig.build.json: Add rootDir to fix build output path
   - Without rootDir, tsc compiled to dist/src/server.js
   - Dockerfile CMD expected dist/server.js
   - Now builds correctly to dist/server.js

2. Dockerfile: Correct CMD path back to dist/server.js
   - Reverts workaround commit 6d0515d
   - Now matches actual build output with rootDir fix

3. src/routes/sessions.ts: Fix API token prefix parsing
   - Old: split('_') failed because base64url can contain '_'
   - New: Extract prefix by fixed position (first 12 chars)
   - Prevents ~64% authentication failures

4. src/routes/rooms.ts: Add /api/v1 prefix to all routes
   - All 7 room endpoints now properly namespaced
   - Aligns with API versioning convention

5. .env.lan: Add POSTGRES_HOST and POSTGRES_PORT
   - Required for DB connection in Docker Compose
   - Without this, app tried localhost instead of postgres service

6. test/j5-messaging-validation.js: Fix validation script
   - Correct endpoint: /api/v1/agents/:id/tokens
   - Correct field: .secret (not .token)
   - Alexia role: admin (needed for room creation)

All fixes verified with clean build and dist/server.js output check.

Related: BARAAA-63, BARAAA-51

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-05-02 09:46:43 +00:00
Paperclip FoundingEngineer
6d0515da8e fix(agenthub): Correct Docker CMD path for compiled TypeScript
TypeScript builds to dist/src/server.js, not dist/server.js
because tsconfig preserves source directory structure.

Fixes MODULE_NOT_FOUND error on container startup.

Related to BARAAA-50.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-02 00:40:41 +00:00
Paperclip FoundingEngineer
bdd5d92ba7 Initial AgentHub codebase for Coolify deployment
Complete implementation ready for Coolify:
- Node.js 22 + Fastify + socket.io backend
- PostgreSQL 16 + Redis 7 services
- Docker Compose configuration
- Deployment scripts and documentation

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-01 21:25:57 +00:00