From 32e5eb8906432a3fb1892b23e68202e9426d6eef Mon Sep 17 00:00:00 2001 From: gabspereira Date: Sun, 5 Apr 2026 18:19:34 +0000 Subject: [PATCH] chore(opencode-sandbox): add SSH auth and workspace mount for Gitea - Mount host workspace at /home/ga/workspace - Add SSH key and known_hosts for Gitea auth - Configure git user identity in container --- .opencode-sandbox/docker-compose.yml | 5 ++++- .opencode-sandbox/entrypoint.sh | 3 +++ AGENTS.md | 14 ++++---------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.opencode-sandbox/docker-compose.yml b/.opencode-sandbox/docker-compose.yml index fa18545..062d004 100644 --- a/.opencode-sandbox/docker-compose.yml +++ b/.opencode-sandbox/docker-compose.yml @@ -10,7 +10,10 @@ services: - NET_RAW volumes: # Your monorepo — opencode's working directory - - ../:/workspace + - /home/ga/workspace:/workspace + # SSH key for Gitea auth + - ~/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro + - ~/.ssh/known_hosts:/root/.ssh/known_hosts:ro # Persist opencode auth so you don't re-login every time - opencode-auth:/root/.local/share/opencode environment: diff --git a/.opencode-sandbox/entrypoint.sh b/.opencode-sandbox/entrypoint.sh index 8697c91..f4ca2c1 100644 --- a/.opencode-sandbox/entrypoint.sh +++ b/.opencode-sandbox/entrypoint.sh @@ -1,2 +1,5 @@ #!/bin/bash +export GIT_SSH_COMMAND="ssh -i /root/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new" +git config --global user.email "gabriel.pereira@protonmail.com" +git config --global user.name "gabspereira" exec opencode diff --git a/AGENTS.md b/AGENTS.md index 14fdd98..5fccf4e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -9,7 +9,7 @@ This workspace is a monorepo containing data engineering projects and WhatsApp C ``` workspace/ ├── apps/ -│ ├── whatsapp-crm/ # Next.js CRM with Kanban board +│ ├── whatsapp-crm/ # Next.js CRM with Kanban board (primary app) │ ├── whatsapp-sync/ # WhatsApp message sync service │ ├── whatsapp-reader/ # WhatsApp message reader │ └── timesfm-forecast/ # Time series forecasting app @@ -52,6 +52,7 @@ npm run dev # node --watch src/index.js npm run sync # node src/sync.js npm run test # Jest npm run test:watch # Jest watch mode +npm run test:coverage # Jest with coverage ``` ### whatsapp-reader @@ -113,7 +114,6 @@ export async function POST(request: Request) { try { const body = await request.json() const validated = CreateContactInput.parse(body) - // ... process } catch (error) { if (error instanceof ZodError) { return Response.json({ error: error.errors }, { status: 400 }) @@ -138,14 +138,9 @@ interface Props { } export default function ComponentName({ contacts, onContactClick }: Props) { - // hooks first, then effects, then render const [state, setState] = useState(false) - return ( -
- {/* JSX */} -
- ) + return
{/* JSX */}
} ``` @@ -166,7 +161,6 @@ test('should update contact stage', async () => { render() await user.click(screen.getByText('Move to Next Stage')) - expect(onStageChange).toHaveBeenCalledWith(1, 'DECIDINDO') }) ``` @@ -188,4 +182,4 @@ test('should update contact stage', async () => { - whatsapp-crm uses Next.js 14 App Router - Database is sql.js (WebAssembly SQLite) - runs in browser - Authentication uses WhatsApp Web.js QR code scanning -- STAGES constant defines the Kanban pipeline (defined in `src/lib/types.ts`) +- STAGES constant defines the Kanban pipeline (defined in `src/lib/types.ts`) \ No newline at end of file