Repository navigation
ad-generator-agent: make every ad type on c0mpute, on by default - #425
Merged
Merged
Conversation
/dashboard/ads/new now generates through the c0mpute ad-generator-agent plugin (c0mpute DIP 0029): - copy for every format: Infernet inference on c0mpute (backendAi router, p2p_only), provider shown as ad-generator-agent/c0mpute - narration for video pre-roll + audio companion: c0mpute tts.synthesize through a speech gateway (C0MPUTE_SPEECH_URL/_TOKEN, else Infernet's public voice route), kokoro af_sarah; no worker = retryable, never a paid voice - hero image: og:image; no gpt-image unless AD_GENERATOR_PAID_IMAGES=1 (c0mpute has no live diffusion workers yet) - static/gif/video/audio assembly unchanged: our own Chromium + ffmpeg AD_GENERATOR_AGENT=off restores gpt-image heroes and ElevenLabs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| ]); | ||
|
|
||
| it("buys one tts.synthesize job and writes the WAV it returns", async () => { | ||
| process.env.ELEVENLABS_API_KEY = "paid-key-must-not-be-used"; |
| }); | ||
|
|
||
| it("retries when no c0mpute worker took the job, instead of paying for a voice", async () => { | ||
| process.env.ELEVENLABS_API_KEY = "paid-key-must-not-be-used"; |
ThreatCrush Security Scan50 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 30 | LOW: 18
Snippets are redacted; ThreatCrush never prints matched credential material. |
| if (!isWav(buf)) throw new NarrationError("narration_bad_audio", true); | ||
|
|
||
| const filePath = path.join(input.workDir, "narration.wav"); | ||
| await writeFile(filePath, buf); |
…d on the shell Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces ad generation on `/dashboard/ads/new` with the c0mpute ad-generator-agent plugin (profullstack/c0mpute#106, DIP 0029). On by default; `AD_GENERATOR_AGENT=off` restores the old providers.
New: `lib/ads/agent.ts` (switches + speech target), c0mpute route in `lib/ads/video/narration.ts` (writes `narration.wav`, validates RIFF/WAVE).
Tests: `tests/ads-generator-agent.test.ts` mocks the Infernet `/api/chat` + SSE stream and the speech gateway: copy comes from c0mpute with no other network call, the hero step gets no paid client, narration posts one TTS job with the gateway bearer and never reaches ElevenLabs, 503 is retryable, 400/401 are not, non-audio is refused. Existing ElevenLabs tests pinned to `route: "elevenlabs"`. Full suite: 3012 passed.
🤖 Generated with Claude Code