From 5cfcf68e0c66595be52e5ff6b1aee39f3e0dd10d Mon Sep 17 00:00:00 2001 From: Kaito Date: Tue, 12 May 2026 09:34:29 +0700 Subject: [PATCH 1/7] build(monorepo): split web and cli workspaces --- .dockerignore | 2 + .gitignore | 1 + Dockerfile | 21 +- README.md | 24 +- .../app}/api/agent/agents/[agentId]/route.ts | 0 .../web/app}/api/agent/agents/route.ts | 0 .../api/agent/projects/[projectId]/route.ts | 0 .../web/app}/api/agent/projects/route.ts | 0 {app => apps/web/app}/api/agent/route.ts | 0 .../app}/api/agent/tasks/[taskId]/route.ts | 2 +- .../web/app}/api/agent/tasks/route.ts | 2 +- .../api/internal/account/password/route.ts | 0 .../api/internal/account/username/route.ts | 0 .../api/internal/agents/[agentId]/route.ts | 0 .../web/app}/api/internal/agents/route.ts | 0 .../web/app}/api/internal/audit-logs/route.ts | 0 .../internal/companies/[companyId]/route.ts | 0 .../web/app}/api/internal/companies/route.ts | 0 .../api/internal/dashboard/brief/route.ts | 0 .../api/internal/dashboard/summary/route.ts | 0 .../api/internal/notes/[taskId]/read/route.ts | 0 .../web/app}/api/internal/notes/route.ts | 0 .../projects/[projectId]/agents/route.ts | 2 +- .../[projectId]/archive-done/route.ts | 0 .../internal/projects/[projectId]/route.ts | 0 .../web/app}/api/internal/projects/route.ts | 0 .../app}/api/internal/tasks/[taskId]/route.ts | 2 +- .../web/app}/api/internal/tasks/route.ts | 0 {app => apps/web/app}/api/openapi/route.ts | 2 +- {app => apps/web/app}/api/swagger/route.ts | 0 .../dashboard/agents/agent-row-actions.tsx | 0 .../app}/dashboard/agents/agents-table.tsx | 0 .../web/app}/dashboard/agents/page.tsx | 0 .../dashboard/audit-logs/audit-log-list.tsx | 0 .../web/app}/dashboard/audit-logs/page.tsx | 0 .../web/app}/dashboard/brief/brief-client.tsx | 0 .../web/app}/dashboard/brief/page.tsx | 0 .../web/app}/dashboard/dashboard-summary.tsx | 0 {app => apps/web/app}/dashboard/docs/page.tsx | 0 .../web/app}/dashboard/notes/note-list.tsx | 0 .../web/app}/dashboard/notes/page.tsx | 0 {app => apps/web/app}/dashboard/page.tsx | 0 .../[projectId]/create-task-dialog.tsx | 0 .../dashboard/projects/[projectId]/page.tsx | 0 .../[projectId]/project-agents-manager.tsx | 0 .../[projectId]/project-detail-client.tsx | 0 .../projects/[projectId]/project-overview.tsx | 0 .../projects/[projectId]/task-kanban.tsx | 0 .../dashboard/projects/[projectId]/types.ts | 0 .../projects/create-project-dialog.tsx | 0 .../web/app}/dashboard/projects/page.tsx | 0 .../app}/dashboard/projects/projects-list.tsx | 0 .../settings/company-settings-form.tsx | 0 .../web/app}/dashboard/settings/page.tsx | 0 {app => apps/web/app}/favicon.ico | Bin {app => apps/web/app}/globals.css | 0 {app => apps/web/app}/layout.tsx | 0 {app => apps/web/app}/login/actions.ts | 0 {app => apps/web/app}/login/login-form.tsx | 0 {app => apps/web/app}/login/page.tsx | 0 {app => apps/web/app}/logout/route.ts | 0 {app => apps/web/app}/page.tsx | 0 components.json => apps/web/components.json | 0 {components => apps/web/components}/.gitkeep | 0 .../dashboard/change-password-dialog.tsx | 0 .../dashboard/change-username-dialog.tsx | 0 .../dashboard/create-company-dialog.tsx | 0 .../web/components}/dashboard/shell.tsx | 0 .../web/components}/dashboard/sidebar.tsx | 0 .../web/components}/query-provider.tsx | 0 .../web/components}/theme-provider.tsx | 0 .../web/components}/ui/alert-dialog.tsx | 0 .../web/components}/ui/badge.tsx | 0 .../web/components}/ui/button.tsx | 0 .../web/components}/ui/card.tsx | 0 .../web/components}/ui/context-menu.tsx | 0 .../web/components}/ui/dialog.tsx | 0 .../web/components}/ui/dropdown-menu.tsx | 0 .../web/components}/ui/input.tsx | 0 .../web/components}/ui/label.tsx | 0 .../web/components}/ui/select.tsx | 0 .../web/components}/ui/table.tsx | 0 .../web/components}/ui/textarea.tsx | 0 .../web/eslint.config.mjs | 0 {hooks => apps/web/hooks}/.gitkeep | 0 {lib => apps/web/lib}/.gitkeep | 0 {lib => apps/web/lib}/agent-auth.ts | 0 {lib => apps/web/lib}/api/audit-log.ts | 0 {lib => apps/web/lib}/api/client.ts | 0 {lib => apps/web/lib}/api/internal.ts | 0 {lib => apps/web/lib}/api/project-agents.ts | 0 {lib => apps/web/lib}/api/review-reader.ts | 0 .../web/lib}/api/task-dependencies.ts | 0 .../web/lib}/api/task-read-markers.ts | 0 {lib => apps/web/lib}/api/task-updater.ts | 0 {lib => apps/web/lib}/auth.ts | 0 {lib => apps/web/lib}/dashboard/companies.ts | 0 {lib => apps/web/lib}/prisma.ts | 4 +- {lib => apps/web/lib}/token.ts | 0 {lib => apps/web/lib}/utils.ts | 0 middleware.ts => apps/web/middleware.ts | 0 next.config.mjs => apps/web/next.config.mjs | 0 apps/web/package.json | 49 +++ .../web/postcss.config.mjs | 0 {public => apps/web/public}/.gitkeep | 0 .../public}/readme/agentbridge-preview-1.jpg | Bin .../public}/readme/agentbridge-preview-2.jpg | Bin .../public}/readme/agentbridge-preview-3.jpg | Bin apps/web/tsconfig.json | 44 +++ package.json | 50 +-- {cli => packages/cli}/.gitignore | 0 {cli => packages/cli}/README.md | 2 +- {cli => packages/cli}/package.json | 2 +- {cli => packages/cli}/src/index.ts | 0 {cli => packages/cli}/tsconfig.json | 2 +- pnpm-lock.yaml | 318 ++---------------- pnpm-workspace.yaml | 3 +- prisma/schema.prisma | 2 +- tsconfig.base.json | 8 + tsconfig.json | 43 +-- 120 files changed, 199 insertions(+), 386 deletions(-) rename {app => apps/web/app}/api/agent/agents/[agentId]/route.ts (100%) rename {app => apps/web/app}/api/agent/agents/route.ts (100%) rename {app => apps/web/app}/api/agent/projects/[projectId]/route.ts (100%) rename {app => apps/web/app}/api/agent/projects/route.ts (100%) rename {app => apps/web/app}/api/agent/route.ts (100%) rename {app => apps/web/app}/api/agent/tasks/[taskId]/route.ts (99%) rename {app => apps/web/app}/api/agent/tasks/route.ts (99%) rename {app => apps/web/app}/api/internal/account/password/route.ts (100%) rename {app => apps/web/app}/api/internal/account/username/route.ts (100%) rename {app => apps/web/app}/api/internal/agents/[agentId]/route.ts (100%) rename {app => apps/web/app}/api/internal/agents/route.ts (100%) rename {app => apps/web/app}/api/internal/audit-logs/route.ts (100%) rename {app => apps/web/app}/api/internal/companies/[companyId]/route.ts (100%) rename {app => apps/web/app}/api/internal/companies/route.ts (100%) rename {app => apps/web/app}/api/internal/dashboard/brief/route.ts (100%) rename {app => apps/web/app}/api/internal/dashboard/summary/route.ts (100%) rename {app => apps/web/app}/api/internal/notes/[taskId]/read/route.ts (100%) rename {app => apps/web/app}/api/internal/notes/route.ts (100%) rename {app => apps/web/app}/api/internal/projects/[projectId]/agents/route.ts (97%) rename {app => apps/web/app}/api/internal/projects/[projectId]/archive-done/route.ts (100%) rename {app => apps/web/app}/api/internal/projects/[projectId]/route.ts (100%) rename {app => apps/web/app}/api/internal/projects/route.ts (100%) rename {app => apps/web/app}/api/internal/tasks/[taskId]/route.ts (99%) rename {app => apps/web/app}/api/internal/tasks/route.ts (100%) rename {app => apps/web/app}/api/openapi/route.ts (99%) rename {app => apps/web/app}/api/swagger/route.ts (100%) rename {app => apps/web/app}/dashboard/agents/agent-row-actions.tsx (100%) rename {app => apps/web/app}/dashboard/agents/agents-table.tsx (100%) rename {app => apps/web/app}/dashboard/agents/page.tsx (100%) rename {app => apps/web/app}/dashboard/audit-logs/audit-log-list.tsx (100%) rename {app => apps/web/app}/dashboard/audit-logs/page.tsx (100%) rename {app => apps/web/app}/dashboard/brief/brief-client.tsx (100%) rename {app => apps/web/app}/dashboard/brief/page.tsx (100%) rename {app => apps/web/app}/dashboard/dashboard-summary.tsx (100%) rename {app => apps/web/app}/dashboard/docs/page.tsx (100%) rename {app => apps/web/app}/dashboard/notes/note-list.tsx (100%) rename {app => apps/web/app}/dashboard/notes/page.tsx (100%) rename {app => apps/web/app}/dashboard/page.tsx (100%) rename {app => apps/web/app}/dashboard/projects/[projectId]/create-task-dialog.tsx (100%) rename {app => apps/web/app}/dashboard/projects/[projectId]/page.tsx (100%) rename {app => apps/web/app}/dashboard/projects/[projectId]/project-agents-manager.tsx (100%) rename {app => apps/web/app}/dashboard/projects/[projectId]/project-detail-client.tsx (100%) rename {app => apps/web/app}/dashboard/projects/[projectId]/project-overview.tsx (100%) rename {app => apps/web/app}/dashboard/projects/[projectId]/task-kanban.tsx (100%) rename {app => apps/web/app}/dashboard/projects/[projectId]/types.ts (100%) rename {app => apps/web/app}/dashboard/projects/create-project-dialog.tsx (100%) rename {app => apps/web/app}/dashboard/projects/page.tsx (100%) rename {app => apps/web/app}/dashboard/projects/projects-list.tsx (100%) rename {app => apps/web/app}/dashboard/settings/company-settings-form.tsx (100%) rename {app => apps/web/app}/dashboard/settings/page.tsx (100%) rename {app => apps/web/app}/favicon.ico (100%) rename {app => apps/web/app}/globals.css (100%) rename {app => apps/web/app}/layout.tsx (100%) rename {app => apps/web/app}/login/actions.ts (100%) rename {app => apps/web/app}/login/login-form.tsx (100%) rename {app => apps/web/app}/login/page.tsx (100%) rename {app => apps/web/app}/logout/route.ts (100%) rename {app => apps/web/app}/page.tsx (100%) rename components.json => apps/web/components.json (100%) rename {components => apps/web/components}/.gitkeep (100%) rename {components => apps/web/components}/dashboard/change-password-dialog.tsx (100%) rename {components => apps/web/components}/dashboard/change-username-dialog.tsx (100%) rename {components => apps/web/components}/dashboard/create-company-dialog.tsx (100%) rename {components => apps/web/components}/dashboard/shell.tsx (100%) rename {components => apps/web/components}/dashboard/sidebar.tsx (100%) rename {components => apps/web/components}/query-provider.tsx (100%) rename {components => apps/web/components}/theme-provider.tsx (100%) rename {components => apps/web/components}/ui/alert-dialog.tsx (100%) rename {components => apps/web/components}/ui/badge.tsx (100%) rename {components => apps/web/components}/ui/button.tsx (100%) rename {components => apps/web/components}/ui/card.tsx (100%) rename {components => apps/web/components}/ui/context-menu.tsx (100%) rename {components => apps/web/components}/ui/dialog.tsx (100%) rename {components => apps/web/components}/ui/dropdown-menu.tsx (100%) rename {components => apps/web/components}/ui/input.tsx (100%) rename {components => apps/web/components}/ui/label.tsx (100%) rename {components => apps/web/components}/ui/select.tsx (100%) rename {components => apps/web/components}/ui/table.tsx (100%) rename {components => apps/web/components}/ui/textarea.tsx (100%) rename eslint.config.mjs => apps/web/eslint.config.mjs (100%) rename {hooks => apps/web/hooks}/.gitkeep (100%) rename {lib => apps/web/lib}/.gitkeep (100%) rename {lib => apps/web/lib}/agent-auth.ts (100%) rename {lib => apps/web/lib}/api/audit-log.ts (100%) rename {lib => apps/web/lib}/api/client.ts (100%) rename {lib => apps/web/lib}/api/internal.ts (100%) rename {lib => apps/web/lib}/api/project-agents.ts (100%) rename {lib => apps/web/lib}/api/review-reader.ts (100%) rename {lib => apps/web/lib}/api/task-dependencies.ts (100%) rename {lib => apps/web/lib}/api/task-read-markers.ts (100%) rename {lib => apps/web/lib}/api/task-updater.ts (100%) rename {lib => apps/web/lib}/auth.ts (100%) rename {lib => apps/web/lib}/dashboard/companies.ts (100%) rename {lib => apps/web/lib}/prisma.ts (83%) rename {lib => apps/web/lib}/token.ts (100%) rename {lib => apps/web/lib}/utils.ts (100%) rename middleware.ts => apps/web/middleware.ts (100%) rename next.config.mjs => apps/web/next.config.mjs (100%) create mode 100644 apps/web/package.json rename postcss.config.mjs => apps/web/postcss.config.mjs (100%) rename {public => apps/web/public}/.gitkeep (100%) rename {public => apps/web/public}/readme/agentbridge-preview-1.jpg (100%) rename {public => apps/web/public}/readme/agentbridge-preview-2.jpg (100%) rename {public => apps/web/public}/readme/agentbridge-preview-3.jpg (100%) create mode 100644 apps/web/tsconfig.json rename {cli => packages/cli}/.gitignore (100%) rename {cli => packages/cli}/README.md (96%) rename {cli => packages/cli}/package.json (97%) rename {cli => packages/cli}/src/index.ts (100%) rename {cli => packages/cli}/tsconfig.json (88%) create mode 100644 tsconfig.base.json diff --git a/.dockerignore b/.dockerignore index a51fe5e..8e5297f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,6 @@ .git .next +apps/*/.next coverage node_modules Dockerfile @@ -10,3 +11,4 @@ docker-compose.yml *.log *.tsbuildinfo generated/prisma +apps/*/generated/prisma diff --git a/.gitignore b/.gitignore index ac80358..3484d8a 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ pnpm-debug.log* /prisma/dev.db /prisma/dev.db-journal /generated/prisma +/apps/web/generated/prisma # typescript *.tsbuildinfo diff --git a/Dockerfile b/Dockerfile index 0c8cc75..ba90b5a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,29 +7,36 @@ RUN corepack enable WORKDIR /app FROM base AS deps -COPY package.json pnpm-lock.yaml ./ +COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ +COPY apps/web/package.json ./apps/web/package.json +COPY packages/cli/package.json ./packages/cli/package.json RUN pnpm install --frozen-lockfile FROM base AS builder ENV AUTH_SECRET="docker-build-placeholder" ENV DATABASE_URL="postgresql://agentbridge:agentbridge@localhost:5432/agentbridge?schema=public" COPY --from=deps /app/node_modules ./node_modules +COPY --from=deps /app/apps/web/node_modules ./apps/web/node_modules +COPY --from=deps /app/packages/cli/node_modules ./packages/cli/node_modules COPY . . RUN pnpm prisma generate -RUN pnpm build +RUN pnpm build:web FROM base AS runner ENV NODE_ENV="production" ENV NEXT_TELEMETRY_DISABLED="1" COPY --from=deps /app/node_modules ./node_modules -COPY --from=builder /app/.next ./.next -COPY --from=builder /app/generated ./generated -COPY --from=builder /app/public ./public +COPY --from=deps /app/apps/web/node_modules ./apps/web/node_modules +COPY --from=builder /app/apps/web/.next ./apps/web/.next +COPY --from=builder /app/apps/web/public ./apps/web/public +COPY --from=builder /app/apps/web/generated ./apps/web/generated COPY --from=builder /app/prisma ./prisma COPY --from=builder /app/package.json ./package.json +COPY --from=builder /app/pnpm-workspace.yaml ./pnpm-workspace.yaml +COPY --from=builder /app/apps/web/package.json ./apps/web/package.json +COPY --from=builder /app/apps/web/next.config.mjs ./apps/web/next.config.mjs COPY --from=builder /app/prisma.config.ts ./prisma.config.ts -COPY --from=builder /app/next.config.mjs ./next.config.mjs COPY docker-entrypoint.sh ./docker-entrypoint.sh RUN chmod +x ./docker-entrypoint.sh @@ -37,4 +44,4 @@ RUN chmod +x ./docker-entrypoint.sh EXPOSE 3000 ENTRYPOINT ["./docker-entrypoint.sh"] -CMD ["pnpm", "start", "--", "-H", "0.0.0.0"] +CMD ["pnpm", "--filter", "@agentbridge/web", "start", "--", "-H", "0.0.0.0"] diff --git a/README.md b/README.md index 73ca69e..60caaca 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,11 @@ Another fun detail: **Kaito is currently the most frequent code pusher in this r ## Preview -![AgentBridge project dashboard preview](public/readme/agentbridge-preview-1.jpg) +![AgentBridge project dashboard preview](apps/web/public/readme/agentbridge-preview-1.jpg) -![AgentBridge task board preview](public/readme/agentbridge-preview-2.jpg) +![AgentBridge task board preview](apps/web/public/readme/agentbridge-preview-2.jpg) -![AgentBridge agent coordination preview](public/readme/agentbridge-preview-3.jpg) +![AgentBridge agent coordination preview](apps/web/public/readme/agentbridge-preview-3.jpg) ## Current capabilities @@ -142,7 +142,7 @@ You can generate a new company bearer token later from dashboard company setting ## OpenClaw setup with the CLI -The repository includes a publish-ready `cli/` workspace package for setting up AgentBridge in OpenClaw workspaces. +The repository includes a publish-ready `packages/cli/` workspace package for setting up AgentBridge in OpenClaw workspaces. After the CLI is published to npm, the intended install-free usage is: @@ -164,7 +164,7 @@ corepack pnpm --filter agentbridge dev -- openclaw status --workspace ~/.opencla `openclaw init` detects local OpenClaw agent candidates first, fetches company agents from `/api/agent/agents`, matches by `AgentId` or normalized name, and asks for confirmation before writing files. Manual AgentId entry is fallback only. -The default installed workflow is heartbeat-based, not cron-based. The CLI writes/copies: +The current installed workflow is heartbeat-based, not cron-based. The CLI writes/copies: - `skills/agent-ops/SKILL.md` - `.openclaw/agentbridge/config.json` for non-secret config @@ -265,6 +265,15 @@ Useful Agent API resources: - The current implementation exposes dashboard read-review state through task read marker fields documented in `/api/openapi` and `agent-skill/SKILL.md`. - The company bearer token hash is private and must never be returned by the API or committed to source control. +## Repository layout + +AgentBridge is organized as a pnpm workspace: + +- `apps/web/` contains the Next.js dashboard and API routes. +- `packages/cli/` contains the publishable `agentbridge` CLI package. +- `prisma/` and Prisma scripts stay at the repository root; Prisma client output is generated into `apps/web/generated/prisma`. +- Root `package.json` scripts orchestrate workspace commands with pnpm filters. + ## Development commands Run these from the repository root: @@ -283,8 +292,11 @@ corepack pnpm prisma:generate corepack pnpm prisma:migrate corepack pnpm prisma:studio corepack pnpm format +corepack pnpm build:web corepack pnpm cli:dev -- openclaw init +corepack pnpm cli:typecheck corepack pnpm cli:build +corepack pnpm cli:pack ``` For contribution conventions, branch expectations, and QA checklist, see [CONTRIBUTING.md](CONTRIBUTING.md). @@ -312,7 +324,7 @@ For production-like environments: 1. Provide a managed PostgreSQL `DATABASE_URL`. 2. Set a strong `AUTH_SECRET`. 3. Run migrations with `prisma migrate deploy` as part of release startup or deployment automation. -4. Generate Prisma client code before building, or use the existing `build` script. +4. Generate Prisma client code before building, or use the existing root `build`/`build:web` scripts. 5. Seed or create the first operator account through an approved operational process. 6. Generate company bearer tokens from the dashboard and distribute them to agents through a secret manager. diff --git a/app/api/agent/agents/[agentId]/route.ts b/apps/web/app/api/agent/agents/[agentId]/route.ts similarity index 100% rename from app/api/agent/agents/[agentId]/route.ts rename to apps/web/app/api/agent/agents/[agentId]/route.ts diff --git a/app/api/agent/agents/route.ts b/apps/web/app/api/agent/agents/route.ts similarity index 100% rename from app/api/agent/agents/route.ts rename to apps/web/app/api/agent/agents/route.ts diff --git a/app/api/agent/projects/[projectId]/route.ts b/apps/web/app/api/agent/projects/[projectId]/route.ts similarity index 100% rename from app/api/agent/projects/[projectId]/route.ts rename to apps/web/app/api/agent/projects/[projectId]/route.ts diff --git a/app/api/agent/projects/route.ts b/apps/web/app/api/agent/projects/route.ts similarity index 100% rename from app/api/agent/projects/route.ts rename to apps/web/app/api/agent/projects/route.ts diff --git a/app/api/agent/route.ts b/apps/web/app/api/agent/route.ts similarity index 100% rename from app/api/agent/route.ts rename to apps/web/app/api/agent/route.ts diff --git a/app/api/agent/tasks/[taskId]/route.ts b/apps/web/app/api/agent/tasks/[taskId]/route.ts similarity index 99% rename from app/api/agent/tasks/[taskId]/route.ts rename to apps/web/app/api/agent/tasks/[taskId]/route.ts index df5fb1a..5148ce5 100644 --- a/app/api/agent/tasks/[taskId]/route.ts +++ b/apps/web/app/api/agent/tasks/[taskId]/route.ts @@ -350,7 +350,7 @@ export async function PATCH(request: NextRequest, { params }: RouteContext) { data.summaryUpdatedAt = data.note ? new Date() : null } const shouldClearNextStatusReads = !hasReadBy && (statusChanged || noteChanged) - const updatedTask = await prisma.$transaction(async (tx) => { + const updatedTask = await prisma.$transaction(async (tx: typeof prisma) => { if (hasReadBy) { await tx.taskReadMarker.deleteMany({ where: { diff --git a/app/api/agent/tasks/route.ts b/apps/web/app/api/agent/tasks/route.ts similarity index 99% rename from app/api/agent/tasks/route.ts rename to apps/web/app/api/agent/tasks/route.ts index 5019e5e..713d346 100644 --- a/app/api/agent/tasks/route.ts +++ b/apps/web/app/api/agent/tasks/route.ts @@ -297,7 +297,7 @@ export async function POST(request: NextRequest) { ) } - const task = await prisma.$transaction(async (tx) => { + const task = await prisma.$transaction(async (tx: typeof prisma) => { await tx.projectAgent.createMany({ data: [{ projectId: project.id, agentId: assignedAgentId }], skipDuplicates: true, diff --git a/app/api/internal/account/password/route.ts b/apps/web/app/api/internal/account/password/route.ts similarity index 100% rename from app/api/internal/account/password/route.ts rename to apps/web/app/api/internal/account/password/route.ts diff --git a/app/api/internal/account/username/route.ts b/apps/web/app/api/internal/account/username/route.ts similarity index 100% rename from app/api/internal/account/username/route.ts rename to apps/web/app/api/internal/account/username/route.ts diff --git a/app/api/internal/agents/[agentId]/route.ts b/apps/web/app/api/internal/agents/[agentId]/route.ts similarity index 100% rename from app/api/internal/agents/[agentId]/route.ts rename to apps/web/app/api/internal/agents/[agentId]/route.ts diff --git a/app/api/internal/agents/route.ts b/apps/web/app/api/internal/agents/route.ts similarity index 100% rename from app/api/internal/agents/route.ts rename to apps/web/app/api/internal/agents/route.ts diff --git a/app/api/internal/audit-logs/route.ts b/apps/web/app/api/internal/audit-logs/route.ts similarity index 100% rename from app/api/internal/audit-logs/route.ts rename to apps/web/app/api/internal/audit-logs/route.ts diff --git a/app/api/internal/companies/[companyId]/route.ts b/apps/web/app/api/internal/companies/[companyId]/route.ts similarity index 100% rename from app/api/internal/companies/[companyId]/route.ts rename to apps/web/app/api/internal/companies/[companyId]/route.ts diff --git a/app/api/internal/companies/route.ts b/apps/web/app/api/internal/companies/route.ts similarity index 100% rename from app/api/internal/companies/route.ts rename to apps/web/app/api/internal/companies/route.ts diff --git a/app/api/internal/dashboard/brief/route.ts b/apps/web/app/api/internal/dashboard/brief/route.ts similarity index 100% rename from app/api/internal/dashboard/brief/route.ts rename to apps/web/app/api/internal/dashboard/brief/route.ts diff --git a/app/api/internal/dashboard/summary/route.ts b/apps/web/app/api/internal/dashboard/summary/route.ts similarity index 100% rename from app/api/internal/dashboard/summary/route.ts rename to apps/web/app/api/internal/dashboard/summary/route.ts diff --git a/app/api/internal/notes/[taskId]/read/route.ts b/apps/web/app/api/internal/notes/[taskId]/read/route.ts similarity index 100% rename from app/api/internal/notes/[taskId]/read/route.ts rename to apps/web/app/api/internal/notes/[taskId]/read/route.ts diff --git a/app/api/internal/notes/route.ts b/apps/web/app/api/internal/notes/route.ts similarity index 100% rename from app/api/internal/notes/route.ts rename to apps/web/app/api/internal/notes/route.ts diff --git a/app/api/internal/projects/[projectId]/agents/route.ts b/apps/web/app/api/internal/projects/[projectId]/agents/route.ts similarity index 97% rename from app/api/internal/projects/[projectId]/agents/route.ts rename to apps/web/app/api/internal/projects/[projectId]/agents/route.ts index d9963aa..bca31eb 100644 --- a/app/api/internal/projects/[projectId]/agents/route.ts +++ b/apps/web/app/api/internal/projects/[projectId]/agents/route.ts @@ -69,7 +69,7 @@ export async function PUT(request: Request, { params }: RouteContext) { .filter((agent) => !previousAgentIds.has(agent.id)) .map((agent) => agent.name) - const projectAgents = await prisma.$transaction(async (tx) => { + const projectAgents = await prisma.$transaction(async (tx: typeof prisma) => { await tx.projectAgent.deleteMany({ where: { projectId: project.id, diff --git a/app/api/internal/projects/[projectId]/archive-done/route.ts b/apps/web/app/api/internal/projects/[projectId]/archive-done/route.ts similarity index 100% rename from app/api/internal/projects/[projectId]/archive-done/route.ts rename to apps/web/app/api/internal/projects/[projectId]/archive-done/route.ts diff --git a/app/api/internal/projects/[projectId]/route.ts b/apps/web/app/api/internal/projects/[projectId]/route.ts similarity index 100% rename from app/api/internal/projects/[projectId]/route.ts rename to apps/web/app/api/internal/projects/[projectId]/route.ts diff --git a/app/api/internal/projects/route.ts b/apps/web/app/api/internal/projects/route.ts similarity index 100% rename from app/api/internal/projects/route.ts rename to apps/web/app/api/internal/projects/route.ts diff --git a/app/api/internal/tasks/[taskId]/route.ts b/apps/web/app/api/internal/tasks/[taskId]/route.ts similarity index 99% rename from app/api/internal/tasks/[taskId]/route.ts rename to apps/web/app/api/internal/tasks/[taskId]/route.ts index 4f2a115..e8092e8 100644 --- a/app/api/internal/tasks/[taskId]/route.ts +++ b/apps/web/app/api/internal/tasks/[taskId]/route.ts @@ -238,7 +238,7 @@ export async function PATCH(request: Request, { params }: RouteContext) { const statusChanged = nextStatus !== task.status const noteChanged = note !== undefined && (note || null) !== task.note const shouldClearNextStatusReads = !hasReadByAgentIds && (statusChanged || noteChanged) - const updatedTask = await prisma.$transaction(async (tx) => { + const updatedTask = await prisma.$transaction(async (tx: typeof prisma) => { if (hasReadByAgentIds) { await tx.taskReadMarker.deleteMany({ where: { diff --git a/app/api/internal/tasks/route.ts b/apps/web/app/api/internal/tasks/route.ts similarity index 100% rename from app/api/internal/tasks/route.ts rename to apps/web/app/api/internal/tasks/route.ts diff --git a/app/api/openapi/route.ts b/apps/web/app/api/openapi/route.ts similarity index 99% rename from app/api/openapi/route.ts rename to apps/web/app/api/openapi/route.ts index 6b557c4..5194b46 100644 --- a/app/api/openapi/route.ts +++ b/apps/web/app/api/openapi/route.ts @@ -405,7 +405,7 @@ const openApiDocument = swaggerJsdoc({ }, security: [{ bearerAuth: [] }], }, - apis: ["./app/api/agent/**/*.ts", "./app/api/agent/route.ts"], + apis: ["./apps/web/app/api/agent/**/*.ts", "./apps/web/app/api/agent/route.ts"], }) export function GET() { diff --git a/app/api/swagger/route.ts b/apps/web/app/api/swagger/route.ts similarity index 100% rename from app/api/swagger/route.ts rename to apps/web/app/api/swagger/route.ts diff --git a/app/dashboard/agents/agent-row-actions.tsx b/apps/web/app/dashboard/agents/agent-row-actions.tsx similarity index 100% rename from app/dashboard/agents/agent-row-actions.tsx rename to apps/web/app/dashboard/agents/agent-row-actions.tsx diff --git a/app/dashboard/agents/agents-table.tsx b/apps/web/app/dashboard/agents/agents-table.tsx similarity index 100% rename from app/dashboard/agents/agents-table.tsx rename to apps/web/app/dashboard/agents/agents-table.tsx diff --git a/app/dashboard/agents/page.tsx b/apps/web/app/dashboard/agents/page.tsx similarity index 100% rename from app/dashboard/agents/page.tsx rename to apps/web/app/dashboard/agents/page.tsx diff --git a/app/dashboard/audit-logs/audit-log-list.tsx b/apps/web/app/dashboard/audit-logs/audit-log-list.tsx similarity index 100% rename from app/dashboard/audit-logs/audit-log-list.tsx rename to apps/web/app/dashboard/audit-logs/audit-log-list.tsx diff --git a/app/dashboard/audit-logs/page.tsx b/apps/web/app/dashboard/audit-logs/page.tsx similarity index 100% rename from app/dashboard/audit-logs/page.tsx rename to apps/web/app/dashboard/audit-logs/page.tsx diff --git a/app/dashboard/brief/brief-client.tsx b/apps/web/app/dashboard/brief/brief-client.tsx similarity index 100% rename from app/dashboard/brief/brief-client.tsx rename to apps/web/app/dashboard/brief/brief-client.tsx diff --git a/app/dashboard/brief/page.tsx b/apps/web/app/dashboard/brief/page.tsx similarity index 100% rename from app/dashboard/brief/page.tsx rename to apps/web/app/dashboard/brief/page.tsx diff --git a/app/dashboard/dashboard-summary.tsx b/apps/web/app/dashboard/dashboard-summary.tsx similarity index 100% rename from app/dashboard/dashboard-summary.tsx rename to apps/web/app/dashboard/dashboard-summary.tsx diff --git a/app/dashboard/docs/page.tsx b/apps/web/app/dashboard/docs/page.tsx similarity index 100% rename from app/dashboard/docs/page.tsx rename to apps/web/app/dashboard/docs/page.tsx diff --git a/app/dashboard/notes/note-list.tsx b/apps/web/app/dashboard/notes/note-list.tsx similarity index 100% rename from app/dashboard/notes/note-list.tsx rename to apps/web/app/dashboard/notes/note-list.tsx diff --git a/app/dashboard/notes/page.tsx b/apps/web/app/dashboard/notes/page.tsx similarity index 100% rename from app/dashboard/notes/page.tsx rename to apps/web/app/dashboard/notes/page.tsx diff --git a/app/dashboard/page.tsx b/apps/web/app/dashboard/page.tsx similarity index 100% rename from app/dashboard/page.tsx rename to apps/web/app/dashboard/page.tsx diff --git a/app/dashboard/projects/[projectId]/create-task-dialog.tsx b/apps/web/app/dashboard/projects/[projectId]/create-task-dialog.tsx similarity index 100% rename from app/dashboard/projects/[projectId]/create-task-dialog.tsx rename to apps/web/app/dashboard/projects/[projectId]/create-task-dialog.tsx diff --git a/app/dashboard/projects/[projectId]/page.tsx b/apps/web/app/dashboard/projects/[projectId]/page.tsx similarity index 100% rename from app/dashboard/projects/[projectId]/page.tsx rename to apps/web/app/dashboard/projects/[projectId]/page.tsx diff --git a/app/dashboard/projects/[projectId]/project-agents-manager.tsx b/apps/web/app/dashboard/projects/[projectId]/project-agents-manager.tsx similarity index 100% rename from app/dashboard/projects/[projectId]/project-agents-manager.tsx rename to apps/web/app/dashboard/projects/[projectId]/project-agents-manager.tsx diff --git a/app/dashboard/projects/[projectId]/project-detail-client.tsx b/apps/web/app/dashboard/projects/[projectId]/project-detail-client.tsx similarity index 100% rename from app/dashboard/projects/[projectId]/project-detail-client.tsx rename to apps/web/app/dashboard/projects/[projectId]/project-detail-client.tsx diff --git a/app/dashboard/projects/[projectId]/project-overview.tsx b/apps/web/app/dashboard/projects/[projectId]/project-overview.tsx similarity index 100% rename from app/dashboard/projects/[projectId]/project-overview.tsx rename to apps/web/app/dashboard/projects/[projectId]/project-overview.tsx diff --git a/app/dashboard/projects/[projectId]/task-kanban.tsx b/apps/web/app/dashboard/projects/[projectId]/task-kanban.tsx similarity index 100% rename from app/dashboard/projects/[projectId]/task-kanban.tsx rename to apps/web/app/dashboard/projects/[projectId]/task-kanban.tsx diff --git a/app/dashboard/projects/[projectId]/types.ts b/apps/web/app/dashboard/projects/[projectId]/types.ts similarity index 100% rename from app/dashboard/projects/[projectId]/types.ts rename to apps/web/app/dashboard/projects/[projectId]/types.ts diff --git a/app/dashboard/projects/create-project-dialog.tsx b/apps/web/app/dashboard/projects/create-project-dialog.tsx similarity index 100% rename from app/dashboard/projects/create-project-dialog.tsx rename to apps/web/app/dashboard/projects/create-project-dialog.tsx diff --git a/app/dashboard/projects/page.tsx b/apps/web/app/dashboard/projects/page.tsx similarity index 100% rename from app/dashboard/projects/page.tsx rename to apps/web/app/dashboard/projects/page.tsx diff --git a/app/dashboard/projects/projects-list.tsx b/apps/web/app/dashboard/projects/projects-list.tsx similarity index 100% rename from app/dashboard/projects/projects-list.tsx rename to apps/web/app/dashboard/projects/projects-list.tsx diff --git a/app/dashboard/settings/company-settings-form.tsx b/apps/web/app/dashboard/settings/company-settings-form.tsx similarity index 100% rename from app/dashboard/settings/company-settings-form.tsx rename to apps/web/app/dashboard/settings/company-settings-form.tsx diff --git a/app/dashboard/settings/page.tsx b/apps/web/app/dashboard/settings/page.tsx similarity index 100% rename from app/dashboard/settings/page.tsx rename to apps/web/app/dashboard/settings/page.tsx diff --git a/app/favicon.ico b/apps/web/app/favicon.ico similarity index 100% rename from app/favicon.ico rename to apps/web/app/favicon.ico diff --git a/app/globals.css b/apps/web/app/globals.css similarity index 100% rename from app/globals.css rename to apps/web/app/globals.css diff --git a/app/layout.tsx b/apps/web/app/layout.tsx similarity index 100% rename from app/layout.tsx rename to apps/web/app/layout.tsx diff --git a/app/login/actions.ts b/apps/web/app/login/actions.ts similarity index 100% rename from app/login/actions.ts rename to apps/web/app/login/actions.ts diff --git a/app/login/login-form.tsx b/apps/web/app/login/login-form.tsx similarity index 100% rename from app/login/login-form.tsx rename to apps/web/app/login/login-form.tsx diff --git a/app/login/page.tsx b/apps/web/app/login/page.tsx similarity index 100% rename from app/login/page.tsx rename to apps/web/app/login/page.tsx diff --git a/app/logout/route.ts b/apps/web/app/logout/route.ts similarity index 100% rename from app/logout/route.ts rename to apps/web/app/logout/route.ts diff --git a/app/page.tsx b/apps/web/app/page.tsx similarity index 100% rename from app/page.tsx rename to apps/web/app/page.tsx diff --git a/components.json b/apps/web/components.json similarity index 100% rename from components.json rename to apps/web/components.json diff --git a/components/.gitkeep b/apps/web/components/.gitkeep similarity index 100% rename from components/.gitkeep rename to apps/web/components/.gitkeep diff --git a/components/dashboard/change-password-dialog.tsx b/apps/web/components/dashboard/change-password-dialog.tsx similarity index 100% rename from components/dashboard/change-password-dialog.tsx rename to apps/web/components/dashboard/change-password-dialog.tsx diff --git a/components/dashboard/change-username-dialog.tsx b/apps/web/components/dashboard/change-username-dialog.tsx similarity index 100% rename from components/dashboard/change-username-dialog.tsx rename to apps/web/components/dashboard/change-username-dialog.tsx diff --git a/components/dashboard/create-company-dialog.tsx b/apps/web/components/dashboard/create-company-dialog.tsx similarity index 100% rename from components/dashboard/create-company-dialog.tsx rename to apps/web/components/dashboard/create-company-dialog.tsx diff --git a/components/dashboard/shell.tsx b/apps/web/components/dashboard/shell.tsx similarity index 100% rename from components/dashboard/shell.tsx rename to apps/web/components/dashboard/shell.tsx diff --git a/components/dashboard/sidebar.tsx b/apps/web/components/dashboard/sidebar.tsx similarity index 100% rename from components/dashboard/sidebar.tsx rename to apps/web/components/dashboard/sidebar.tsx diff --git a/components/query-provider.tsx b/apps/web/components/query-provider.tsx similarity index 100% rename from components/query-provider.tsx rename to apps/web/components/query-provider.tsx diff --git a/components/theme-provider.tsx b/apps/web/components/theme-provider.tsx similarity index 100% rename from components/theme-provider.tsx rename to apps/web/components/theme-provider.tsx diff --git a/components/ui/alert-dialog.tsx b/apps/web/components/ui/alert-dialog.tsx similarity index 100% rename from components/ui/alert-dialog.tsx rename to apps/web/components/ui/alert-dialog.tsx diff --git a/components/ui/badge.tsx b/apps/web/components/ui/badge.tsx similarity index 100% rename from components/ui/badge.tsx rename to apps/web/components/ui/badge.tsx diff --git a/components/ui/button.tsx b/apps/web/components/ui/button.tsx similarity index 100% rename from components/ui/button.tsx rename to apps/web/components/ui/button.tsx diff --git a/components/ui/card.tsx b/apps/web/components/ui/card.tsx similarity index 100% rename from components/ui/card.tsx rename to apps/web/components/ui/card.tsx diff --git a/components/ui/context-menu.tsx b/apps/web/components/ui/context-menu.tsx similarity index 100% rename from components/ui/context-menu.tsx rename to apps/web/components/ui/context-menu.tsx diff --git a/components/ui/dialog.tsx b/apps/web/components/ui/dialog.tsx similarity index 100% rename from components/ui/dialog.tsx rename to apps/web/components/ui/dialog.tsx diff --git a/components/ui/dropdown-menu.tsx b/apps/web/components/ui/dropdown-menu.tsx similarity index 100% rename from components/ui/dropdown-menu.tsx rename to apps/web/components/ui/dropdown-menu.tsx diff --git a/components/ui/input.tsx b/apps/web/components/ui/input.tsx similarity index 100% rename from components/ui/input.tsx rename to apps/web/components/ui/input.tsx diff --git a/components/ui/label.tsx b/apps/web/components/ui/label.tsx similarity index 100% rename from components/ui/label.tsx rename to apps/web/components/ui/label.tsx diff --git a/components/ui/select.tsx b/apps/web/components/ui/select.tsx similarity index 100% rename from components/ui/select.tsx rename to apps/web/components/ui/select.tsx diff --git a/components/ui/table.tsx b/apps/web/components/ui/table.tsx similarity index 100% rename from components/ui/table.tsx rename to apps/web/components/ui/table.tsx diff --git a/components/ui/textarea.tsx b/apps/web/components/ui/textarea.tsx similarity index 100% rename from components/ui/textarea.tsx rename to apps/web/components/ui/textarea.tsx diff --git a/eslint.config.mjs b/apps/web/eslint.config.mjs similarity index 100% rename from eslint.config.mjs rename to apps/web/eslint.config.mjs diff --git a/hooks/.gitkeep b/apps/web/hooks/.gitkeep similarity index 100% rename from hooks/.gitkeep rename to apps/web/hooks/.gitkeep diff --git a/lib/.gitkeep b/apps/web/lib/.gitkeep similarity index 100% rename from lib/.gitkeep rename to apps/web/lib/.gitkeep diff --git a/lib/agent-auth.ts b/apps/web/lib/agent-auth.ts similarity index 100% rename from lib/agent-auth.ts rename to apps/web/lib/agent-auth.ts diff --git a/lib/api/audit-log.ts b/apps/web/lib/api/audit-log.ts similarity index 100% rename from lib/api/audit-log.ts rename to apps/web/lib/api/audit-log.ts diff --git a/lib/api/client.ts b/apps/web/lib/api/client.ts similarity index 100% rename from lib/api/client.ts rename to apps/web/lib/api/client.ts diff --git a/lib/api/internal.ts b/apps/web/lib/api/internal.ts similarity index 100% rename from lib/api/internal.ts rename to apps/web/lib/api/internal.ts diff --git a/lib/api/project-agents.ts b/apps/web/lib/api/project-agents.ts similarity index 100% rename from lib/api/project-agents.ts rename to apps/web/lib/api/project-agents.ts diff --git a/lib/api/review-reader.ts b/apps/web/lib/api/review-reader.ts similarity index 100% rename from lib/api/review-reader.ts rename to apps/web/lib/api/review-reader.ts diff --git a/lib/api/task-dependencies.ts b/apps/web/lib/api/task-dependencies.ts similarity index 100% rename from lib/api/task-dependencies.ts rename to apps/web/lib/api/task-dependencies.ts diff --git a/lib/api/task-read-markers.ts b/apps/web/lib/api/task-read-markers.ts similarity index 100% rename from lib/api/task-read-markers.ts rename to apps/web/lib/api/task-read-markers.ts diff --git a/lib/api/task-updater.ts b/apps/web/lib/api/task-updater.ts similarity index 100% rename from lib/api/task-updater.ts rename to apps/web/lib/api/task-updater.ts diff --git a/lib/auth.ts b/apps/web/lib/auth.ts similarity index 100% rename from lib/auth.ts rename to apps/web/lib/auth.ts diff --git a/lib/dashboard/companies.ts b/apps/web/lib/dashboard/companies.ts similarity index 100% rename from lib/dashboard/companies.ts rename to apps/web/lib/dashboard/companies.ts diff --git a/lib/prisma.ts b/apps/web/lib/prisma.ts similarity index 83% rename from lib/prisma.ts rename to apps/web/lib/prisma.ts index 83a8a06..a77b713 100644 --- a/lib/prisma.ts +++ b/apps/web/lib/prisma.ts @@ -9,8 +9,10 @@ if (!connectionString) { throw new Error("DATABASE_URL is not set") } +type AgentBridgePrismaClient = InstanceType + const globalForPrisma = globalThis as unknown as { - prisma?: PrismaClient + prisma?: AgentBridgePrismaClient } const adapter = new PrismaPg({ connectionString }) diff --git a/lib/token.ts b/apps/web/lib/token.ts similarity index 100% rename from lib/token.ts rename to apps/web/lib/token.ts diff --git a/lib/utils.ts b/apps/web/lib/utils.ts similarity index 100% rename from lib/utils.ts rename to apps/web/lib/utils.ts diff --git a/middleware.ts b/apps/web/middleware.ts similarity index 100% rename from middleware.ts rename to apps/web/middleware.ts diff --git a/next.config.mjs b/apps/web/next.config.mjs similarity index 100% rename from next.config.mjs rename to apps/web/next.config.mjs diff --git a/apps/web/package.json b/apps/web/package.json new file mode 100644 index 0000000..7a8a72f --- /dev/null +++ b/apps/web/package.json @@ -0,0 +1,49 @@ +{ + "name": "@agentbridge/web", + "version": "0.0.1", + "type": "module", + "private": true, + "scripts": { + "dev": "next dev --turbopack", + "build": "next build --webpack", + "start": "next start", + "lint": "eslint", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "@prisma/adapter-pg": "^7.8.0", + "@prisma/client": "^7.8.0", + "@tanstack/react-query": "^5.100.9", + "bcryptjs": "^3.0.3", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "dotenv": "^17.4.2", + "jose": "^6.2.3", + "lucide-react": "^1.14.0", + "next": "16.1.7", + "next-themes": "^0.4.6", + "pg": "^8.20.0", + "radix-ui": "^1.4.3", + "react": "^19.2.4", + "react-dom": "^19.2.4", + "shadcn": "^4.7.0", + "swagger-jsdoc": "^6.2.8", + "swagger-ui-dist": "^5.32.5", + "tailwind-merge": "^3.5.0", + "tw-animate-css": "^1.4.0" + }, + "devDependencies": { + "@eslint/eslintrc": "^3", + "@tailwindcss/postcss": "^4.2.1", + "@types/node": "^25.5.0", + "@types/pg": "^8.20.0", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "@types/swagger-jsdoc": "^6.0.4", + "eslint": "^9.39.4", + "eslint-config-next": "16.1.7", + "postcss": "^8", + "tailwindcss": "^4.2.1", + "typescript": "^5.9.3" + } +} diff --git a/postcss.config.mjs b/apps/web/postcss.config.mjs similarity index 100% rename from postcss.config.mjs rename to apps/web/postcss.config.mjs diff --git a/public/.gitkeep b/apps/web/public/.gitkeep similarity index 100% rename from public/.gitkeep rename to apps/web/public/.gitkeep diff --git a/public/readme/agentbridge-preview-1.jpg b/apps/web/public/readme/agentbridge-preview-1.jpg similarity index 100% rename from public/readme/agentbridge-preview-1.jpg rename to apps/web/public/readme/agentbridge-preview-1.jpg diff --git a/public/readme/agentbridge-preview-2.jpg b/apps/web/public/readme/agentbridge-preview-2.jpg similarity index 100% rename from public/readme/agentbridge-preview-2.jpg rename to apps/web/public/readme/agentbridge-preview-2.jpg diff --git a/public/readme/agentbridge-preview-3.jpg b/apps/web/public/readme/agentbridge-preview-3.jpg similarity index 100% rename from public/readme/agentbridge-preview-3.jpg rename to apps/web/public/readme/agentbridge-preview-3.jpg diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json new file mode 100644 index 0000000..88a313a --- /dev/null +++ b/apps/web/tsconfig.json @@ -0,0 +1,44 @@ +{ + "compilerOptions": { + "target": "ES2017", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "strictFunctionTypes": false, + "noImplicitAny": false, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "react-jsx", + "incremental": true, + "plugins": [ + { + "name": "next" + } + ], + "baseUrl": ".", + "paths": { + "@/*": [ + "./*" + ] + } + }, + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts", + ".next/dev/types/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} diff --git a/package.json b/package.json index 557a0ed..3dd8935 100644 --- a/package.json +++ b/package.json @@ -1,61 +1,33 @@ { - "name": "AgentBridge", + "name": "agentbridge-monorepo", "version": "0.0.1", "type": "module", "private": true, "scripts": { - "dev": "next dev --turbopack", - "build": "prisma generate && next build", - "start": "next start", - "lint": "eslint", + "dev": "corepack pnpm --filter @agentbridge/web dev", + "build": "corepack pnpm prisma:generate && corepack pnpm --filter @agentbridge/web build && corepack pnpm --filter agentbridge build", + "build:web": "corepack pnpm prisma:generate && corepack pnpm --filter @agentbridge/web build", + "start": "corepack pnpm --filter @agentbridge/web start", + "lint": "corepack pnpm --filter @agentbridge/web lint", + "lint:web": "corepack pnpm --filter @agentbridge/web lint", "format": "prettier --write \"**/*.{ts,tsx}\"", "prisma:generate": "prisma generate", "prisma:migrate": "prisma migrate dev", "prisma:seed": "tsx scripts/seed-admin.ts", "prisma:studio": "prisma studio", - "pretypecheck": "prisma generate", - "typecheck": "tsc --noEmit", + "typecheck": "corepack pnpm prisma:generate && corepack pnpm --filter @agentbridge/web typecheck && corepack pnpm --filter agentbridge typecheck", + "typecheck:web": "corepack pnpm prisma:generate && corepack pnpm --filter @agentbridge/web typecheck", "cli:dev": "corepack pnpm --filter agentbridge dev", "cli:build": "corepack pnpm --filter agentbridge build", + "cli:typecheck": "corepack pnpm --filter agentbridge typecheck", "cli:pack": "corepack pnpm --filter agentbridge pack:dry-run" }, - "dependencies": { - "@prisma/adapter-pg": "^7.8.0", - "@prisma/client": "^7.8.0", - "@tanstack/react-query": "^5.100.9", - "bcryptjs": "^3.0.3", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "dotenv": "^17.4.2", - "jose": "^6.2.3", - "lucide-react": "^1.14.0", - "next": "16.1.7", - "next-themes": "^0.4.6", - "pg": "^8.20.0", - "radix-ui": "^1.4.3", - "react": "^19.2.4", - "react-dom": "^19.2.4", - "shadcn": "^4.7.0", - "swagger-jsdoc": "^6.2.8", - "swagger-ui-dist": "^5.32.5", - "tailwind-merge": "^3.5.0", - "tw-animate-css": "^1.4.0" - }, "devDependencies": { - "@eslint/eslintrc": "^3", - "@tailwindcss/postcss": "^4.2.1", "@types/node": "^25.5.0", - "@types/pg": "^8.20.0", - "@types/react": "^19.2.14", - "@types/react-dom": "^19.2.3", - "@types/swagger-jsdoc": "^6.0.4", - "eslint": "^9.39.4", - "eslint-config-next": "16.1.7", - "postcss": "^8", + "dotenv": "^17.4.2", "prettier": "^3.8.1", "prettier-plugin-tailwindcss": "^0.7.2", "prisma": "^7.8.0", - "tailwindcss": "^4.2.1", "tsx": "^4.21.0", "typescript": "^5.9.3" }, diff --git a/cli/.gitignore b/packages/cli/.gitignore similarity index 100% rename from cli/.gitignore rename to packages/cli/.gitignore diff --git a/cli/README.md b/packages/cli/README.md similarity index 96% rename from cli/README.md rename to packages/cli/README.md index 6ec8470..d9ce7c5 100644 --- a/cli/README.md +++ b/packages/cli/README.md @@ -33,7 +33,7 @@ Before publish, test the built package locally: ```bash corepack pnpm --filter agentbridge build -node cli/dist/index.js openclaw status --workspace ~/.openclaw +node packages/cli/dist/index.js openclaw status --workspace ~/.openclaw ``` ## OpenClaw init behavior diff --git a/cli/package.json b/packages/cli/package.json similarity index 97% rename from cli/package.json rename to packages/cli/package.json index 2760d38..56beeee 100644 --- a/cli/package.json +++ b/packages/cli/package.json @@ -33,7 +33,7 @@ "repository": { "type": "git", "url": "git+https://github.com/Vann-Dev/AgentBridge.git", - "directory": "cli" + "directory": "packages/cli" }, "bugs": { "url": "https://github.com/Vann-Dev/AgentBridge/issues" diff --git a/cli/src/index.ts b/packages/cli/src/index.ts similarity index 100% rename from cli/src/index.ts rename to packages/cli/src/index.ts diff --git a/cli/tsconfig.json b/packages/cli/tsconfig.json similarity index 88% rename from cli/tsconfig.json rename to packages/cli/tsconfig.json index acabc5a..e25096d 100644 --- a/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "dist", "rootDir": "src", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7198406..8430023 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,13 +7,37 @@ settings: importers: .: + devDependencies: + '@types/node': + specifier: ^25.5.0 + version: 25.6.2 + dotenv: + specifier: ^17.4.2 + version: 17.4.2 + prettier: + specifier: ^3.8.1 + version: 3.8.3 + prettier-plugin-tailwindcss: + specifier: ^0.7.2 + version: 0.7.4(prettier@3.8.3) + prisma: + specifier: ^7.8.0 + version: 7.8.0(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.9.3) + tsx: + specifier: ^4.21.0 + version: 4.21.0 + typescript: + specifier: ^5.9.3 + version: 5.9.3 + + apps/web: dependencies: '@prisma/adapter-pg': specifier: ^7.8.0 version: 7.8.0 '@prisma/client': specifier: ^7.8.0 - version: 7.8.0(prisma@7.8.0(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(better-sqlite3@12.9.0)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.9.3))(typescript@5.9.3) + version: 7.8.0(prisma@7.8.0(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.9.3))(typescript@5.9.3) '@tanstack/react-query': specifier: ^5.100.9 version: 5.100.9(react@19.2.6) @@ -99,26 +123,14 @@ importers: postcss: specifier: ^8 version: 8.5.14 - prettier: - specifier: ^3.8.1 - version: 3.8.3 - prettier-plugin-tailwindcss: - specifier: ^0.7.2 - version: 0.7.4(prettier@3.8.3) - prisma: - specifier: ^7.8.0 - version: 7.8.0(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(better-sqlite3@12.9.0)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.9.3) tailwindcss: specifier: ^4.2.1 version: 4.3.0 - tsx: - specifier: ^4.21.0 - version: 4.21.0 typescript: specifier: ^5.9.3 version: 5.9.3 - cli: {} + packages/cli: {} packages: @@ -2065,9 +2077,6 @@ packages: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - baseline-browser-mapping@2.10.28: resolution: {integrity: sha512-Ic44hnOtFIgravCunj1ifSoQPSUrkNiJuH9Mf6jr2jjoA74icqV8wU0KuadXeOR8zuIJMOoTv0GuQjZ9ZYNMeA==} engines: {node: '>=6.0.0'} @@ -2080,16 +2089,6 @@ packages: better-result@2.9.2: resolution: {integrity: sha512-WIFoBPCdnTOdk9inkE1ZRvCZ4P0CpSkAiLlchC65N7n9DcjZ3NhqkBOlafzpOVnO8ixyi37kicmSJ3ENhPZl7Q==} - better-sqlite3@12.9.0: - resolution: {integrity: sha512-wqUv4Gm3toFpHDQmaKD4QhZm3g1DjUBI0yzS4UBl6lElUmXFYdTQmmEDpAFa5o8FiFiymURypEnfVHzILKaxqQ==} - engines: {node: 20.x || 22.x || 23.x || 24.x || 25.x} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - body-parser@2.2.2: resolution: {integrity: sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==} engines: {node: '>=18'} @@ -2110,9 +2109,6 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - bundle-name@4.1.0: resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} engines: {node: '>=18'} @@ -2167,9 +2163,6 @@ packages: resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} engines: {node: '>= 20.19.0'} - chownr@1.1.4: - resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} - class-variance-authority@0.7.1: resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==} @@ -2312,10 +2305,6 @@ packages: supports-color: optional: true - decompress-response@6.0.0: - resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} - engines: {node: '>=10'} - dedent@1.7.2: resolution: {integrity: sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==} peerDependencies: @@ -2324,10 +2313,6 @@ packages: babel-plugin-macros: optional: true - deep-extend@0.6.0: - resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} - engines: {node: '>=4.0.0'} - deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -2430,9 +2415,6 @@ packages: resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} engines: {node: '>= 0.8'} - end-of-stream@1.4.5: - resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} - enhanced-resolve@5.21.2: resolution: {integrity: sha512-xe9vQb5kReirPUxgQrXA3ihgbCqssmTiM7cOZ+Gzu+VeGWgpV98lLZvp0dl4yriyAePcewxGUs9UpKD8PET9KQ==} engines: {node: '>=10.13.0'} @@ -2641,10 +2623,6 @@ packages: resolution: {integrity: sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==} engines: {node: ^18.19.0 || >=20.5.0} - expand-template@2.0.3: - resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} - engines: {node: '>=6'} - express-rate-limit@8.5.1: resolution: {integrity: sha512-5O6KYmyJEpuPJV5hNTXKbAHWRqrzyu+OI3vUnSd2kXFubIVpG7ezpgxQy76Zo5GQZtrQBg86hF+CM/NX+cioiQ==} engines: {node: '>= 16'} @@ -2715,9 +2693,6 @@ packages: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -2757,9 +2732,6 @@ packages: resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} engines: {node: '>= 0.8'} - fs-constants@1.0.0: - resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} - fs-extra@11.3.5: resolution: {integrity: sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg==} engines: {node: '>=14.14'} @@ -2842,9 +2814,6 @@ packages: resolution: {integrity: sha512-GvHTWcykIR/fP8cj8dMpuMMkvaeJfPvYnhq0oW+chSeIr+ldX21ifU2Ms6KBoyKZQZmVaUAAhQ2EZ68KJF8a7A==} hasBin: true - github-from-package@0.0.0: - resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} - glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -2949,9 +2918,6 @@ packages: resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==} engines: {node: '>=0.10.0'} - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -2975,9 +2941,6 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - ini@1.3.8: - resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - internal-slot@1.1.0: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} @@ -3408,10 +3371,6 @@ packages: resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} engines: {node: '>=18'} - mimic-response@3.1.0: - resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} - engines: {node: '>=10'} - minimatch@10.2.5: resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} engines: {node: 18 || 20 || >=22} @@ -3422,9 +3381,6 @@ packages: minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - mkdirp-classic@0.5.3: - resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} - ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -3455,9 +3411,6 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - napi-build-utils@2.0.0: - resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} - napi-postinstall@0.3.4: resolution: {integrity: sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -3497,10 +3450,6 @@ packages: sass: optional: true - node-abi@3.92.0: - resolution: {integrity: sha512-KdHvFWZjEKDf0cakgFjebl371GPsISX2oZHcuyKqM7DtogIsHrqKeLTo8wBHxaXRAQlY2PsPlZmfo+9ZCxEREQ==} - engines: {node: '>=10'} - node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} @@ -3755,12 +3704,6 @@ packages: resolution: {integrity: sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==} engines: {node: '>=20'} - prebuild-install@7.1.3: - resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==} - engines: {node: '>=10'} - deprecated: No longer maintained. Please contact the author of the relevant native addon; alternatives are available. - hasBin: true - prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -3856,9 +3799,6 @@ packages: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} - pump@3.0.4: - resolution: {integrity: sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==} - punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -3897,10 +3837,6 @@ packages: rc9@3.0.1: resolution: {integrity: sha512-gMDyleLWVE+i6Sgtc0QbbY6pEKqYs97NGi6isHQPqYlLemPoO8dxQ3uGi0f4NiP98c+jMW6cG1Kx9dDwfvqARQ==} - rc@1.2.8: - resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} - hasBin: true - react-dom@19.2.6: resolution: {integrity: sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==} peerDependencies: @@ -3943,10 +3879,6 @@ packages: resolution: {integrity: sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q==} engines: {node: '>=0.10.0'} - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - readdirp@5.0.0: resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==} engines: {node: '>= 20.19.0'} @@ -4016,9 +3948,6 @@ packages: resolution: {integrity: sha512-wtZlHyOje6OZTGqAoaDKxFkgRtkF9CnHAVnCHKfuj200wAgL+bSJhdsCD2l0Qx/2ekEXjPWcyKkfGb5CPboslg==} engines: {node: '>=0.4'} - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - safe-push-apply@1.0.0: resolution: {integrity: sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==} engines: {node: '>= 0.4'} @@ -4110,12 +4039,6 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - simple-concat@1.0.1: - resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} - - simple-get@4.0.1: - resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} - sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -4187,9 +4110,6 @@ packages: resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} engines: {node: '>= 0.4'} - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - stringify-object@5.0.0: resolution: {integrity: sha512-zaJYxz2FtcMb4f+g60KsRNFOpVMUyuJgA51Zi5Z1DOTC3S59+OQiVOzE9GZt0x72uBGWKsQIuBKeF9iusmKFsg==} engines: {node: '>=14.16'} @@ -4214,10 +4134,6 @@ packages: resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} engines: {node: '>=18'} - strip-json-comments@2.0.1: - resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} - engines: {node: '>=0.10.0'} - strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -4269,13 +4185,6 @@ packages: resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} - tar-fs@2.1.4: - resolution: {integrity: sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==} - - tar-stream@2.2.0: - resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} - engines: {node: '>=6'} - tiny-invariant@1.3.3: resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==} @@ -4326,9 +4235,6 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - tunnel-agent@0.6.0: - resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} - tw-animate-css@1.4.0: resolution: {integrity: sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==} @@ -5237,11 +5143,11 @@ snapshots: '@prisma/client-runtime-utils@7.8.0': {} - '@prisma/client@7.8.0(prisma@7.8.0(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(better-sqlite3@12.9.0)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.9.3))(typescript@5.9.3)': + '@prisma/client@7.8.0(prisma@7.8.0(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.9.3))(typescript@5.9.3)': dependencies: '@prisma/client-runtime-utils': 7.8.0 optionalDependencies: - prisma: 7.8.0(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(better-sqlite3@12.9.0)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.9.3) + prisma: 7.8.0(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.9.3) typescript: 5.9.3 '@prisma/config@7.8.0': @@ -6493,33 +6399,12 @@ snapshots: balanced-match@4.0.4: {} - base64-js@1.5.1: - optional: true - baseline-browser-mapping@2.10.28: {} bcryptjs@3.0.3: {} better-result@2.9.2: {} - better-sqlite3@12.9.0: - dependencies: - bindings: 1.5.0 - prebuild-install: 7.1.3 - optional: true - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - optional: true - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - optional: true - body-parser@2.2.2: dependencies: bytes: 3.1.2 @@ -6555,12 +6440,6 @@ snapshots: node-releases: 2.0.38 update-browserslist-db: 1.2.3(browserslist@4.28.2) - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - optional: true - bundle-name@4.1.0: dependencies: run-applescript: 7.1.0 @@ -6620,9 +6499,6 @@ snapshots: dependencies: readdirp: 5.0.0 - chownr@1.1.4: - optional: true - class-variance-authority@0.7.1: dependencies: clsx: 2.1.1 @@ -6732,16 +6608,8 @@ snapshots: dependencies: ms: 2.1.3 - decompress-response@6.0.0: - dependencies: - mimic-response: 3.1.0 - optional: true - dedent@1.7.2: {} - deep-extend@0.6.0: - optional: true - deep-is@0.1.4: {} deepmerge-ts@7.1.5: {} @@ -6825,11 +6693,6 @@ snapshots: encodeurl@2.0.0: {} - end-of-stream@1.4.5: - dependencies: - once: 1.4.0 - optional: true - enhanced-resolve@5.21.2: dependencies: graceful-fs: 4.2.11 @@ -6984,7 +6847,7 @@ snapshots: '@next/eslint-plugin-next': 16.1.7 eslint: 9.39.4(jiti@2.7.0) eslint-import-resolver-node: 0.3.10 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.4(jiti@2.7.0)) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)) eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4(jiti@2.7.0)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.39.4(jiti@2.7.0)) eslint-plugin-react: 7.37.5(eslint@9.39.4(jiti@2.7.0)) @@ -7007,7 +6870,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.4(jiti@2.7.0)): + eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.4.3 @@ -7022,14 +6885,14 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4(jiti@2.7.0)): + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3) eslint: 9.39.4(jiti@2.7.0) eslint-import-resolver-node: 0.3.10 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@9.39.4(jiti@2.7.0)) + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)) transitivePeerDependencies: - supports-color @@ -7044,7 +6907,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.39.4(jiti@2.7.0) eslint-import-resolver-node: 0.3.10 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4(jiti@2.7.0)) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-node@0.3.10)(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)) hasown: 2.0.3 is-core-module: 2.16.2 is-glob: 4.0.3 @@ -7221,9 +7084,6 @@ snapshots: strip-final-newline: 4.0.0 yoctocolors: 2.1.2 - expand-template@2.0.3: - optional: true - express-rate-limit@8.5.1(express@5.2.1): dependencies: express: 5.2.1 @@ -7323,9 +7183,6 @@ snapshots: dependencies: flat-cache: 4.0.1 - file-uri-to-path@1.0.0: - optional: true - fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -7370,9 +7227,6 @@ snapshots: fresh@2.0.0: {} - fs-constants@1.0.0: - optional: true - fs-extra@11.3.5: dependencies: graceful-fs: 4.2.11 @@ -7454,9 +7308,6 @@ snapshots: giget@3.2.0: {} - github-from-package@0.0.0: - optional: true - glob-parent@5.1.2: dependencies: is-glob: 4.0.3 @@ -7553,9 +7404,6 @@ snapshots: dependencies: safer-buffer: 2.1.2 - ieee754@1.2.1: - optional: true - ignore@5.3.2: {} ignore@7.0.5: {} @@ -7574,9 +7422,6 @@ snapshots: inherits@2.0.4: {} - ini@1.3.8: - optional: true - internal-slot@1.1.0: dependencies: es-errors: 1.3.0 @@ -7927,9 +7772,6 @@ snapshots: mimic-function@5.0.1: {} - mimic-response@3.1.0: - optional: true - minimatch@10.2.5: dependencies: brace-expansion: 5.0.6 @@ -7940,9 +7782,6 @@ snapshots: minimist@1.2.8: {} - mkdirp-classic@0.5.3: - optional: true - ms@2.1.3: {} msw@2.14.5(@types/node@25.6.2)(typescript@5.9.3): @@ -7990,9 +7829,6 @@ snapshots: nanoid@3.3.12: {} - napi-build-utils@2.0.0: - optional: true - napi-postinstall@0.3.4: {} natural-compare@1.4.0: {} @@ -8028,11 +7864,6 @@ snapshots: - '@babel/core' - babel-plugin-macros - node-abi@3.92.0: - dependencies: - semver: 7.8.0 - optional: true - node-domexception@1.0.0: {} node-exports-info@1.6.0: @@ -8288,22 +8119,6 @@ snapshots: powershell-utils@0.1.0: {} - prebuild-install@7.1.3: - dependencies: - detect-libc: 2.1.2 - expand-template: 2.0.3 - github-from-package: 0.0.0 - minimist: 1.2.8 - mkdirp-classic: 0.5.3 - napi-build-utils: 2.0.0 - node-abi: 3.92.0 - pump: 3.0.4 - rc: 1.2.8 - simple-get: 4.0.1 - tar-fs: 2.1.4 - tunnel-agent: 0.6.0 - optional: true - prelude-ls@1.2.1: {} prettier-plugin-tailwindcss@0.7.4(prettier@3.8.3): @@ -8316,7 +8131,7 @@ snapshots: dependencies: parse-ms: 4.0.0 - prisma@7.8.0(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(better-sqlite3@12.9.0)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.9.3): + prisma@7.8.0(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6)(typescript@5.9.3): dependencies: '@prisma/config': 7.8.0 '@prisma/dev': 0.24.3(typescript@5.9.3) @@ -8325,7 +8140,6 @@ snapshots: mysql2: 3.15.3 postgres: 3.4.7 optionalDependencies: - better-sqlite3: 12.9.0 typescript: 5.9.3 transitivePeerDependencies: - '@types/react' @@ -8356,12 +8170,6 @@ snapshots: forwarded: 0.2.0 ipaddr.js: 1.9.1 - pump@3.0.4: - dependencies: - end-of-stream: 1.4.5 - once: 1.4.0 - optional: true - punycode@2.3.1: {} pure-rand@6.1.0: {} @@ -8449,14 +8257,6 @@ snapshots: defu: 6.1.7 destr: 2.0.5 - rc@1.2.8: - dependencies: - deep-extend: 0.6.0 - ini: 1.3.8 - minimist: 1.2.8 - strip-json-comments: 2.0.1 - optional: true - react-dom@19.2.6(react@19.2.6): dependencies: react: 19.2.6 @@ -8493,13 +8293,6 @@ snapshots: react@19.2.6: {} - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - optional: true - readdirp@5.0.0: {} recast@0.23.11: @@ -8584,9 +8377,6 @@ snapshots: has-symbols: 1.1.0 isarray: 2.0.5 - safe-buffer@5.2.1: - optional: true - safe-push-apply@1.0.0: dependencies: es-errors: 1.3.0 @@ -8772,16 +8562,6 @@ snapshots: signal-exit@4.1.0: {} - simple-concat@1.0.1: - optional: true - - simple-get@4.0.1: - dependencies: - decompress-response: 6.0.0 - once: 1.4.0 - simple-concat: 1.0.1 - optional: true - sisteransi@1.0.5: {} source-map-js@1.2.1: {} @@ -8869,11 +8649,6 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.1.1 - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - optional: true - stringify-object@5.0.0: dependencies: get-own-enumerable-keys: 1.0.0 @@ -8894,9 +8669,6 @@ snapshots: strip-final-newline@4.0.0: {} - strip-json-comments@2.0.1: - optional: true - strip-json-comments@3.1.1: {} styled-jsx@5.1.6(@babel/core@7.29.0)(react@19.2.6): @@ -8941,23 +8713,6 @@ snapshots: tapable@2.3.3: {} - tar-fs@2.1.4: - dependencies: - chownr: 1.1.4 - mkdirp-classic: 0.5.3 - pump: 3.0.4 - tar-stream: 2.2.0 - optional: true - - tar-stream@2.2.0: - dependencies: - bl: 4.1.0 - end-of-stream: 1.4.5 - fs-constants: 1.0.0 - inherits: 2.0.4 - readable-stream: 3.6.2 - optional: true - tiny-invariant@1.3.3: {} tinyglobby@0.2.16: @@ -9012,11 +8767,6 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - tunnel-agent@0.6.0: - dependencies: - safe-buffer: 5.2.1 - optional: true - tw-animate-css@1.4.0: {} type-check@0.4.0: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index e59c66c..2c408bd 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -8,4 +8,5 @@ allowBuilds: sharp: true unrs-resolver: true packages: - - cli + - apps/* + - packages/* diff --git a/prisma/schema.prisma b/prisma/schema.prisma index f25b04b..2735eae 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1,6 +1,6 @@ generator client { provider = "prisma-client" - output = "../generated/prisma" + output = "../apps/web/generated/prisma" moduleFormat = "esm" } diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..eb2322c --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "strict": true, + "skipLibCheck": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/tsconfig.json b/tsconfig.json index 247f602..d390453 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,42 +1,7 @@ { - "compilerOptions": { - "target": "ES2017", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "strict": true, - "noEmit": true, - "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "bundler", - "resolveJsonModule": true, - "isolatedModules": true, - "jsx": "react-jsx", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ], - "baseUrl": ".", - "paths": { - "@/*": [ - "./*" - ] - } - }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx", - ".next/types/**/*.ts", - ".next/dev/types/**/*.ts" - ], - "exclude": [ - "node_modules" + "files": [], + "references": [ + { "path": "apps/web" }, + { "path": "packages/cli" } ] } From 6b27b40a819f0861a8c7003861678b2e5e5ee53b Mon Sep 17 00:00:00 2001 From: Kaito Date: Tue, 12 May 2026 09:54:29 +0700 Subject: [PATCH 2/7] fix(web): type theme provider props --- apps/web/components/theme-provider.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/web/components/theme-provider.tsx b/apps/web/components/theme-provider.tsx index 3d44f48..25f9f30 100644 --- a/apps/web/components/theme-provider.tsx +++ b/apps/web/components/theme-provider.tsx @@ -1,12 +1,13 @@ "use client" import * as React from "react" -import { ThemeProvider as NextThemesProvider, useTheme } from "next-themes" +import { + ThemeProvider as NextThemesProvider, + type ThemeProviderProps, + useTheme, +} from "next-themes" -function ThemeProvider({ - children, - ...props -}: React.ComponentProps) { +function ThemeProvider({ children, ...props }: ThemeProviderProps) { return ( Date: Tue, 12 May 2026 10:39:03 +0700 Subject: [PATCH 3/7] fix(prisma): update seed script for monorepo --- .gitignore | 3 +++ package.json | 4 ++++ pnpm-lock.yaml | 18 +++++++++++++++--- scripts/seed-admin.ts | 26 +++++++++++++++----------- 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 3484d8a..a4c4faf 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ pnpm-debug.log* # typescript *.tsbuildinfo next-env.d.ts + +# workspace package installs +node_modules/ diff --git a/package.json b/package.json index 3dd8935..7e48e58 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,12 @@ "cli:pack": "corepack pnpm --filter agentbridge pack:dry-run" }, "devDependencies": { + "@prisma/adapter-pg": "^7.8.0", "@types/node": "^25.5.0", + "@types/pg": "^8.20.0", + "bcryptjs": "^3.0.3", "dotenv": "^17.4.2", + "pg": "^8.20.0", "prettier": "^3.8.1", "prettier-plugin-tailwindcss": "^0.7.2", "prisma": "^7.8.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8430023..c2cd390 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,12 +8,24 @@ importers: .: devDependencies: + '@prisma/adapter-pg': + specifier: ^7.8.0 + version: 7.8.0 '@types/node': specifier: ^25.5.0 version: 25.6.2 + '@types/pg': + specifier: ^8.20.0 + version: 8.20.0 + bcryptjs: + specifier: ^3.0.3 + version: 3.0.3 dotenv: specifier: ^17.4.2 version: 17.4.2 + pg: + specifier: ^8.20.0 + version: 8.20.0 prettier: specifier: ^3.8.1 version: 3.8.3 @@ -6848,7 +6860,7 @@ snapshots: eslint: 9.39.4(jiti@2.7.0) eslint-import-resolver-node: 0.3.10 eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4(jiti@2.7.0)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.39.4(jiti@2.7.0)) eslint-plugin-react: 7.37.5(eslint@9.39.4(jiti@2.7.0)) eslint-plugin-react-hooks: 7.1.1(eslint@9.39.4(jiti@2.7.0)) @@ -6881,7 +6893,7 @@ snapshots: tinyglobby: 0.2.16 unrs-resolver: 1.11.1 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4(jiti@2.7.0)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)) transitivePeerDependencies: - supports-color @@ -6896,7 +6908,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4(jiti@2.7.0)): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.59.2(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)))(eslint@9.39.4(jiti@2.7.0)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 diff --git a/scripts/seed-admin.ts b/scripts/seed-admin.ts index bbdeb75..a150b83 100644 --- a/scripts/seed-admin.ts +++ b/scripts/seed-admin.ts @@ -2,7 +2,8 @@ import "dotenv/config" import bcrypt from "bcryptjs" import { PrismaPg } from "@prisma/adapter-pg" -import { PrismaClient } from "../generated/prisma/client" +import pg from "pg" +import { PrismaClient } from "../apps/web/generated/prisma/client" const connectionString = process.env.DATABASE_URL @@ -10,17 +11,20 @@ if (!connectionString) { throw new Error("DATABASE_URL is not set") } +const pool = new pg.Pool({ connectionString, connectionTimeoutMillis: 5_000 }) const prisma = new PrismaClient({ - adapter: new PrismaPg({ connectionString }), + adapter: new PrismaPg(pool, { disposeExternalPool: true }), }) -const username = "admin" -const passwordHash = await bcrypt.hash("12345678", 12) +try { + const username = "admin" + const passwordHash = await bcrypt.hash("12345678", 12) -await prisma.user.upsert({ - where: { username }, - update: { passwordHash }, - create: { username, passwordHash }, -}) - -await prisma.$disconnect() + await prisma.user.upsert({ + where: { username }, + update: { passwordHash }, + create: { username, passwordHash }, + }) +} finally { + await prisma.$disconnect() +} From 37bef1d3c6c9d98fd49ffc65eb97abbb30eee321 Mon Sep 17 00:00:00 2001 From: Kaito Date: Tue, 12 May 2026 11:26:47 +0700 Subject: [PATCH 4/7] build(vercel): configure web workspace deployment --- vercel.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 vercel.json diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..67a3b5a --- /dev/null +++ b/vercel.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://openapi.vercel.sh/vercel.json", + "framework": "nextjs", + "installCommand": "corepack pnpm install --frozen-lockfile", + "buildCommand": "corepack pnpm build:web", + "outputDirectory": "apps/web/.next" +} From a72b4f32f21322832d9eff853e83519686cfc7e2 Mon Sep 17 00:00:00 2001 From: Kaito Date: Tue, 12 May 2026 11:32:57 +0700 Subject: [PATCH 5/7] build(vercel): pin repository root --- vercel.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index 67a3b5a..3c11afe 100644 --- a/vercel.json +++ b/vercel.json @@ -3,5 +3,6 @@ "framework": "nextjs", "installCommand": "corepack pnpm install --frozen-lockfile", "buildCommand": "corepack pnpm build:web", - "outputDirectory": "apps/web/.next" + "outputDirectory": "apps/web/.next", + "rootDirectory": "." } From cc5e25817c171431e2dd8abe1b629021659f0c75 Mon Sep 17 00:00:00 2001 From: Kaito Date: Tue, 12 May 2026 11:34:17 +0700 Subject: [PATCH 6/7] build(vercel): remove unsupported root setting --- vercel.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vercel.json b/vercel.json index 3c11afe..67a3b5a 100644 --- a/vercel.json +++ b/vercel.json @@ -3,6 +3,5 @@ "framework": "nextjs", "installCommand": "corepack pnpm install --frozen-lockfile", "buildCommand": "corepack pnpm build:web", - "outputDirectory": "apps/web/.next", - "rootDirectory": "." + "outputDirectory": "apps/web/.next" } From 6e004c13a6386f5643c6b83540e17453415baa7f Mon Sep 17 00:00:00 2001 From: Kaito Date: Tue, 12 May 2026 16:21:26 +0700 Subject: [PATCH 7/7] fix(docker): avoid missing workspace node_modules --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b3885aa..1620b6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,6 @@ ENV AUTH_SECRET="docker-build-placeholder" ENV DATABASE_URL="postgresql://agentbridge:agentbridge@localhost:5432/agentbridge?schema=public" COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/apps/web/node_modules ./apps/web/node_modules -COPY --from=deps /app/packages/cli/node_modules ./packages/cli/node_modules COPY . . RUN pnpm prisma generate RUN pnpm build:web @@ -39,7 +38,6 @@ RUN addgroup --system --gid 1001 nodejs \ && adduser --system --uid 1001 nextjs COPY --from=prod-deps --chown=nextjs:nodejs /app/node_modules ./node_modules -COPY --from=prod-deps --chown=nextjs:nodejs /app/apps/web/node_modules ./apps/web/node_modules COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next ./apps/web/.next COPY --from=builder --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public COPY --from=builder --chown=nextjs:nodejs /app/apps/web/generated ./apps/web/generated