Skip to content

advanced-ai-character-generator-terminal-access - Action Report

Project: /home/user/Projects/advanced-ai-character-generator-terminal-access Created: 2026-07-23


Web char-gen: fixed blank page (offline Vite build) + Pollinations authenticated (2026-07-23 21:37)

Status: ✅ TESTED — build clean, all assets serve 200, endpoints verified in bundle.

What: Fixed the blank-page bug in the React/Vite 'terminal-access' web char-gen and made it a fully-offline build; upgraded Pollinations (text+image) from the old keyless endpoints to the authenticated gen.pollinations.ai API with the user's key + referrer (doubled-credit attribution).

Why: Page loaded blank+unstyled (unusable). Root cause: AI-Studio 'no-build' scaffolding fighting Vite. Also user wanted Pollinations working with their key for both text and images.

How / blank-page fix: index.html carried (a) an esm.sh importmap -> 2 React copies, (b) in-browser Babel + a DOUBLED index.tsx load -> double mount, (c) Tailwind only via CDN -> unstyled when blocked. Rewrote index.html to a clean Vite entry (single module + local CSS). Vendored Tailwind locally: tailwind.config.js + postcss.config.js + @tailwind directives in index.css (theme ported from old inline config). Imported index.css via index.tsx. npm i -D tailwindcss@3 postcss autoprefixer. Also vendored the Inter font via @fontsource/inter (28 woff2 bundled) replacing the Google Fonts @import. Result: npm run build -> dist/ (40KB CSS all-themes + 685KB JS react+genai+jszip). Verified ZERO esm.sh/unpkg/cdn.tailwindcss.com/fonts.googleapis in dist.

How / Pollinations: services/geminiService.ts — streamPollinationsChatResponse now POSTs https://gen.pollinations.ai/v1/chat/completions with Authorization: Bearer + body referrer=nexus-char-gen; generatePollinationsImage now GETs https://gen.pollinations.ai/image/{prompt}?...&referrer=nexus-char-gen with Bearer header when settings.apiKey set. components/CharacterForm.tsx — pollinations preset endpoint -> gen.pollinations.ai, requiresKey:true (key field now shows), models updated (openai/openai-fast/mistral/deepseek/gemini/llama/claude). App already had AI Horde image + multi-provider (kobold/groq/mistral/openrouter/hf/openai/gemini) — left intact.

Files: MODIFIED index.html, index.css, index.tsx, services/geminiService.ts, components/CharacterForm.tsx; NEW tailwind.config.js, postcss.config.js; package.json (+tailwindcss/postcss/autoprefixer/@fontsource/inter). Backups: index.html.bak-, services/geminiService.ts.bak-, components/CharacterForm.tsx.bak-*.

Testing: ✅ vite build succeeds; dist served via vite preview -> index.html/CSS/JS all HTTP 200; endpoint swap grep-verified. NOT yet done: live Pollinations call with real key (user pastes key in UI); visual browser confirm of styling (user opens http://localhost:4173). Key stored at ~/.config/nexus/secrets/pollinations.key (chmod 600) — entered via UI, NOT hardcoded.

Dependencies: node/npm; deps in node_modules (react19, vite6, @google/genai, tailwind3, @fontsource/inter). Run: npm run dev (hot, :3000) OR npm run build + npm run preview -- --port 4173 (offline dist).


Web char-gen: removed Google from all defaults; Mistral as default embed (2026-07-23 21:45)

Status: ✅ TESTED — build clean, defaults grep-verified.

What: Took Google/Gemini out of every DEFAULT in the web char-gen (kept it as a selectable choice); set Mistral as the default embedding provider.

Why: User wants Pollinations-first / non-Google defaults, Gemini only 'as a choice', and Mistral for embeddings.

How: defaultApiConfig -> service 'pollinations' (gen.pollinations.ai, model openai). selectedPreset initial -> 'pollinations'. geminiService: chat fallback {service:'default'} -> {service:'pollinations',model:'openai'}; image fallback ||'default' -> ||'pollinations'. defaultEmbeddingConfig + DocumentLibrary RAG tempConfig -> service 'openai' + api.mistral.ai/v1/embeddings + model mistral-embed. Embedding UI fallback ||'gemini' -> ||'openai'. CharacterForm preset-detect fallback + PluginManager model-list fallback ||'default' -> 'pollinations'. Gemini stays via the 'Default (Gemini)' and 'Google Gemini (Custom Key)' presets + type unions.

Files: components/CharacterForm.tsx, components/DocumentLibrary.tsx, components/PluginManager.tsx, services/geminiService.ts (all have .bak-* from earlier).

Testing: ✅ vite build succeeds; grep confirms no ||'default'/||'gemini' provider fallbacks remain (only type-union + preset labels). NOT live-tested: Mistral embed needs the user's Mistral key entered in the embedding config UI.

Dependencies: Mistral API key for embeddings; Pollinations key for default chat/image (entered in UI, not hardcoded).