Implement @mosaic/brain — typed structured data service with MCP + REST API, JSON file backend, and schema validation via Zod. Collections: tasks, projects, events, agents, tickets, appreciations, missions, mission_tasks. MCP tools: brain_tasks, brain_projects, brain_events, brain_agents, brain_tickets, brain_today, brain_stale, brain_stats, brain_search, brain_audit, brain_missions, brain_mission, brain_mission_tasks, plus mutation tools for all collections. REST API mirrors MCP 1:1 at /v1/*. Bearer token auth with timing-safe comparison. Fastify server with per-request MCP instances (stateless HTTP transport). JSON file storage with proper-lockfile for concurrent access. Also adds Brain* types to @mosaic/types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
471 B
Docker
19 lines
471 B
Docker
FROM node:22-alpine AS builder
|
|
WORKDIR /app
|
|
COPY package.json tsconfig.json ./
|
|
COPY src/ src/
|
|
# In standalone mode, @mosaic/types is bundled or installed from registry
|
|
RUN npm install && npm run build
|
|
|
|
FROM node:22-alpine
|
|
WORKDIR /app
|
|
COPY --from=builder /app/dist/ dist/
|
|
COPY --from=builder /app/node_modules/ node_modules/
|
|
COPY package.json ./
|
|
ENV NODE_ENV=production
|
|
ENV PORT=8100
|
|
ENV MOSAIC_BRAIN_DATA_DIR=/data
|
|
EXPOSE 8100
|
|
VOLUME /data
|
|
CMD ["node", "dist/index.js"]
|