feat(prometheus): real providers (Gemini/fal/Pollinations…) + secure key store

- Secure secrets: gitignored ~/pyre/.env (chmod 600) loaded into the API via
  `node --env-file-if-exists`; keys never committed/logged/returned. .env.example
  documents the vars. Free-first default (text=gemini, image=pollinations).
- @pyre/config: provider selection + key fields.
- @pyre/prometheus: real providers via fetch (no SDK deps) — Gemini/Anthropic/
  OpenAI text, Pollinations(free)/fal/DeepInfra/Replicate image, OpenAI moderation;
  `createProviders()` factory selects by config + key presence, falls back to stub.
  29 tests.
- @pyre/api: /api/prometheus/generate builds providers from config; keys never logged.

Live-verified end-to-end: admin-gated generate returned a real Spawn ("Ashen
Golem"/$AGOL) with a Pollinations image on the $0 stub-text+free-image stack;
.env-loaded admin token enforced. typecheck 8/8, 150 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-31 07:23:18 +00:00
parent 8b58faf7c1
commit 6ab0f02d06
9 changed files with 745 additions and 14 deletions

View File

@@ -150,7 +150,7 @@
<span class="overall-pct">74%</span>
</div>
<div class="bar"><span style="width: 74%"></span></div>
<p class="count">39 of 53 phase deliverables complete</p>
<p class="count">40 of 54 phase deliverables complete</p>
</section>
<h2 class="section">Development Phases</h2>
@@ -224,14 +224,15 @@
<h3><span class="phase-id">Phase 4</span> Prometheus Generator</h3>
<span class="badge in_progress">IN PROGRESS</span>
</header>
<p class="count">4 / 6 complete</p>
<p class="count">5 / 7 complete</p>
<ul class="checklist">
<li class="item done"><span class="mark"></span><span>Meta mixer (deterministic influence model)</span></li>
<li class="item done"><span class="mark"></span><span>Spawn name/ticker/lore generation (provider-abstracted)</span></li>
<li class="item done"><span class="mark"></span><span>Image prompt generation</span></li>
<li class="item done"><span class="mark"></span><span>Safety checks (denylist + moderation)</span></li>
<li class="item done"><span class="mark"></span><span>Real AI providers wired (Gemini/Anthropic/OpenAI + Pollinations/fal/DeepInfra/Replicate) + secure key store</span></li>
<li class="item"><span class="mark"></span><span>Generation input from receipt</span></li>
<li class="item"><span class="mark"></span><span>Wire real providers (keys) + admin approval UI</span></li>
<li class="item"><span class="mark"></span><span>Admin review &amp; generate UI</span></li>
</ul>
</article>
<article class="card in_progress">

View File

@@ -70,8 +70,9 @@
{ "label": "Spawn name/ticker/lore generation (provider-abstracted)", "done": true },
{ "label": "Image prompt generation", "done": true },
{ "label": "Safety checks (denylist + moderation)", "done": true },
{ "label": "Real AI providers wired (Gemini/Anthropic/OpenAI + Pollinations/fal/DeepInfra/Replicate) + secure key store", "done": true },
{ "label": "Generation input from receipt", "done": false },
{ "label": "Wire real providers (keys) + admin approval UI", "done": false }
{ "label": "Admin review & generate UI", "done": false }
]
},
{