Automated Video Generator

Architecture

This document describes the current code organization of the project after the multi-runtime refactor.

Overview

The project supports multiple runtimes that all share one application core:

The guiding rule is:

all runtime inputs -> PipelineAppService -> shared job orchestration -> consistent output

No runtime should implement its own pipeline lifecycle.

Current Structure

src/
  adapters/
    cli/
      cli-runner.ts
      batch-queue.ts
    http/
      agentic-controller.ts
      ai-controller.ts
      api-helpers.ts
      api-routes.ts
      file-routes.ts
      files-controller.ts
      free-video-controller.ts
      jobs-controller.ts
      scenes-controller.ts
      server-bootstrap.ts
      setup-controller.ts
      social-download-controller.ts
      video-download-controller.ts
      videos-controller.ts
      view-controller.ts
      view-routes.ts
    mcp/
      driver-llm.ts
      env-tools.ts
      input-store.ts
      output-store.ts
      pipeline-commands.ts
      register-admin-tools.ts
      register-agentic-tools.ts
      register-free-video-tools.ts
      register-input-tools.ts
      register-job-tools.ts
      register-operations-tools.ts
      register-output-tools.ts
      responses.ts
  application/
    ai-app.service.ts
    diagnostics.service.ts
    filesystem-app.service.ts
    free-video-app.service.ts
    media-app.service.ts
    pipeline-app.service.ts
    portal-app.service.ts
    scene-app.service.ts
    setup.service.ts
    social-download-app.service.ts
    video-download-app.service.ts
  infrastructure/
    filesystem/
      local-filesystem.ts
    persistence/
      job-store.ts
    pipeline/
      scene-editor.ts
  shared/
    capabilities.ts
    contracts/
      job.contract.ts
    http/
      public-url.ts
    logging/
      runtime-logging.ts
    runtime/
      paths.ts
  services/
    ai.service.ts
    env.service.ts
    health.service.ts
    job.service.ts
    video.service.ts
  app.ts
  cli.ts
  mcp-env-init.ts
  mcp-prompts.ts
  mcp-resources.ts
  mcp-server.ts
  pipeline-workspace.ts
  render.ts
  runtime-safety.test.ts
  runtime.ts
  server.ts
  video-generator.ts

electron/
  dependency-service.ts
  electron-main.ts
  electron-preload.ts
  ipc.ts
  server-manager.ts
  window-manager.ts

Layer Responsibilities

application/

This is the shared application layer.

adapters/

These modules translate runtime-specific inputs and outputs.

Adapters should validate input, call shared services, and format output. They should not own business logic.

infrastructure/

This contains runtime-independent implementation details that back the application layer.

shared/

This is the cross-runtime foundation.

Main Entry Points

HTTP

CLI

MCP

Electron

Shared Pipeline Entry

The central application facade is src/application/pipeline-app.service.ts.

Current core operations:

Runtime Safety Rules

What Changed

These major cleanup steps have already happened:

Remaining Low-Priority Cleanup

The architecture is now stable. Remaining cleanup is optional and lower priority:

Prefer:

Avoid adding new logic to:

Those should stay as thin composition or compatibility layers.