Skip to Content
Core LoopGeneration Service

Generation Service

This page documents the OSS v1 generation surface tracked by #161.

Live Module Inventory

The generation story in the current repo spans a small set of stable entrypoints plus provider packages:

Stable Generation Surface

For v1, the important point is not every experimental flow. It is the stable path:

  1. API/controller accepts a generation or batch request.
  2. BatchGenerationService or another generation-facing service delegates into content generation.
  3. Model/provider selection is resolved from the catalog plus provider-specific discovery.
  4. Provider packages normalize discovered models into one Genfeed-facing shape.

Stable generate_* Tool Surface

The v1 stable generation tools are the agent-facing tools that create generation work or route users into a generation review flow. Their metadata is defined in packages/tools/src/registry/source.ts and rendered through the canonical registry in packages/tools/src/registry/tool-registry.ts.

ToolStable input contractExecution pathOutput contract
generate_imageprompt, optional aspectRatio; attachments may become reference imagesAgentToolExecutorService.generateImage -> POST /v1/images -> image provider selectionContent preview card with image ingredient id and gallery URL
generate_videoprompt, optional aspectRatio, duration, imageUrl, audioUrl; image + audio selects avatar modeAgentToolExecutorService.generateVideo -> POST /v1/videos -> video provider selectionContent preview card with video ingredient id and gallery URL
generate_musictext, optional durationAgentToolExecutorService.generateMusic -> POST /v1/musics -> music provider selectionContent preview card with music ingredient id and gallery URL
generate_voicetext, voiceIdAgentToolExecutorService.generateVoice -> POST /v1/voices/generate -> voice provider selectionContent preview card with voice id or audio URL
generate_content_batchcount, platforms, optional brandId, handle, dateRange, contentMix, style, topicsAgentToolExecutorService.generateContentBatch -> BatchGenerationService.createBatchBatch id plus review queue/status actions
generate_as_identitytext for the identity avatar to speakAgentToolExecutorService.generateAsIdentity -> POST /v1/videos/avatar with useIdentity: trueProcessing preview card for the avatar video generation

These are the stable tool names callers should depend on for v1. Lower-level workflow categories such as generate-image, generate-video, and generate-music remain workflow-engine step categories, not public agent tool names.

Step 3 Module -> Provider -> Tool Map

LayerFilesResponsibility
Tool metadatapackages/tools/src/registry/source.ts, packages/tools/src/registry/tool-registry.tsDefines tool names, parameters, categories, and UI action card types
Agent dispatchapps/server/api/src/services/agent-orchestrator/tools/agent-tool-executor.service.tsConverts tool calls into internal API requests and normalizes preview-card responses
Media APIs/v1/images, /v1/videos, /v1/musics, /v1/voices/generateOwn request validation, model selection, credits, persistence, and completion polling
Skill executionapps/server/api/src/services/skill-executor/*Runs content skills such as image-generation and records Content Runs
Provider accessapps/server/api/src/services/byok/*Resolves organization BYOK keys before hosted fallback
Provider adaptersapps/server/api/src/services/integrations/*, packages/services/ai/providers/*Call Replicate, fal.ai, Leonardo, ElevenLabs, HuggingFace, and related provider surfaces
Registry/discoverypackages/services/ai/enhanced-models.service.tsMerges base model catalog entries with provider-discovered models

Dataflow

Representative V1 End-to-End Path

The representative media verification path for v1 is in:

The test uses mocked provider services so it can run in CI without live credentials, but it keeps the production service wiring:

  • SkillExecutorService loads and validates the image-generation skill
  • a Content Run is created, marked running, and completed
  • the representative image path routes through ImageGenerationHandler
  • organization BYOK resolution selects fal.ai for the active organization
  • the fal.ai provider call receives the resolved server-side key and normalized image parameters
  • the completed run records source: byok, output metadata, and a generated variant

Run it with:

cd apps/server/api TZ=UTC bunx vitest run --config vitest.config.ts src/services/skill-executor/stable-provider-path.spec.ts

This keeps the v1 proof end-to-end at the application boundary without making CI depend on external provider availability.

Explicit V1 Gaps

  • The CI smoke path does not make a live fal.ai or Replicate request.
  • It verifies one representative image path, not every media type or provider.
  • Full provider billing, rate-limit, and callback behavior should stay covered by provider-specific tests and manual release checks.

V1 Boundary

This page documents the current registry and generation surface. It does not expand v1 to include every deferred model-registry or training-pipeline item by default.

For the OSS provider registry contract, see Provider Registry.