From 4cefd3e17f0ce1b833503d3e767eb5fa2b256a4a Mon Sep 17 00:00:00 2001 From: Anais Saraiva Date: Mon, 21 Sep 2026 21:10:09 +0200 Subject: [PATCH] :3 --- .env.example | 19 +- AGENTS.md | 4 +- README.md | 6 +- docs/ARCHITECTURE.md | 36 +-- docs/NIXOS-HOSTING.md | 30 +- frontend/src/components/AccessRequests.tsx | 52 +++- frontend/src/components/AdminCenter.tsx | 38 ++- frontend/src/components/Chat.tsx | 7 +- frontend/src/components/ReviewPage.tsx | 39 ++- frontend/src/lib/types.ts | 1 + module.nix | 14 +- scripts/poc-chatgpt.ts | 36 ++- src/access.ts | 67 +++++ src/config.ts | 13 +- src/drivers/{puppeteer.ts => arcaic.ts} | 88 ++++-- src/drivers/browser.ts | 321 ++++++++++++++------- src/drivers/registry.ts | 21 +- src/drivers/types.ts | 2 + 18 files changed, 577 insertions(+), 217 deletions(-) rename src/drivers/{puppeteer.ts => arcaic.ts} (65%) diff --git a/.env.example b/.env.example index b162157..3d64f8b 100644 --- a/.env.example +++ b/.env.example @@ -43,7 +43,7 @@ RATE_LIMIT_MAX=5 RATE_LIMIT_WINDOW_MIN=10 # --- drivers --- -# Priority (global): ollama -> mistral -> glm -> puppeteer-openai(stub) -> deepseek -> anthropic -> openai +# Priority (global): ollama -> mistral -> glm -> arcaic -> deepseek -> anthropic -> openai OLLAMA_HOST=http://10.66.66.4:11434 OLLAMA_ENABLED=true # Stubs below: leave empty to keep disabled. Implemented last per spec. @@ -60,11 +60,12 @@ ANTHROPIC_API_KEY= ANTHROPIC_ENABLED=false OPENAI_API_KEY= OPENAI_ENABLED=false -# ChatGPT web driver (puppeteer-core + Firefox via WebDriver BiDi). POC. -# Every process launch creates a throwaway Firefox profile (deleted on exit); -# the first request opens a window where you log in manually while it waits. -PUPPETEER_ENABLED=false -PUPPETEER_EXECUTABLE=firefox -PUPPETEER_HEADLESS=false -PUPPETEER_LOGIN_TIMEOUT_S=300 -PUPPETEER_RESPONSE_TIMEOUT_S=300 +# Arcaic backend (headless browser, throwaway profile per process). +# Every process launch creates a throwaway Firefox profile (deleted on exit). +ARCAIC_ENABLED=false +ARCAIC_EXECUTABLE=firefox +# Headless by default; set to false to watch the window (debugging, or if a +# manual login is ever required). +ARCAIC_HEADLESS=true +ARCAIC_LOGIN_TIMEOUT_S=300 +ARCAIC_RESPONSE_TIMEOUT_S=300 diff --git a/AGENTS.md b/AGENTS.md index a133161..ecc84f1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,7 +26,7 @@ src/config.ts env parsing (PORT, HOST, APP_PASSWORD=admin key, OLLAMA_HO src/db.ts SQLite store: users, sessions, conversations, messages, shares (+ admin row bootstrap) src/auth.ts login(username,key), hashed Bearer sessions, sliding-window login rate limit src/static.ts static file server + SPA fallback (covers /share/:id) -src/drivers/ LLMDriver interface, OllamaDriver, ApiDriverBase, Mistral/DeepSeek/Anthropic/OpenAI, puppeteer stub, DriverRegistry +src/drivers/ LLMDriver interface, OllamaDriver, ApiDriverBase, Mistral/DeepSeek/Anthropic/OpenAI, arcaic browser sub-drivers (arcaic-openai/gemini/qwen), DriverRegistry frontend/src/ App.tsx (routing+state), lib/api.ts (fetch wrapper), components/ public/ BUILD OUTPUT (Vite). Never hand-edit; rebuild instead. Not committed (see .gitignore) flake.nix/module.nix NixOS packaging + service module @@ -46,7 +46,7 @@ flake.nix/module.nix NixOS packaging + service module - Icons: lucide-react only. **Never use native `