# vark-debug/rocx architecture

> Architecture diagram of the GitHub repository vark-debug/rocx, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vark-debug/rocx
- Repository: https://github.com/vark-debug/rocx

## Overview

RocX is a Premiere Pro UXP panel for generating MiniMax videos from prompts and optional project references, then previewing and managing results in Premiere. The main flow runs from the Webview through a Comlink bridge to UXP APIs; generation is handled in the Webview, while capture, file operations, persistence, and project import run in the host. The README also documents frame/work-area capture, record management, and optional webhook reporting. Some subsystem links are based on indexed references or README descriptions because their source was not excerpted.

Main entry points: [`src/api/api.ts`](https://github.com/vark-debug/rocx/blob/main/src/api/api.ts) (Host API), [`webview-ui/src/main-webview.vue`](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/main-webview.vue) (Panel composition), [`webview-ui/src/services/bridge.ts`](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/services/bridge.ts) (Host API bridge), [`webview-ui/src/composables/useGenerationTasks.ts`](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/useGenerationTasks.ts) (Generation lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_webview["Panel UI"]
  node_panel["Panel composition<br/>[main-webview.vue]"]
  node_prompt["Prompt and settings<br/>[PromptInput.vue]"]
  node_references["Reference controls<br/>[useReferences.ts]"]
  node_recordsui["Record management"]
  node_preview["Result preview"]
  node_bridge["Host API bridge<br/>[bridge.ts]"]
end

subgraph group_generation["Video generation"]
  node_tasks["Generation lifecycle"]
  node_polling["Task polling<br/>[usePolling.ts]"]
  node_minimaxservice["MiniMax API service<br/>[MiniMax.ts]"]
  node_providerregistry["Provider registry<br/>[registry.ts]"]
  node_minimaxprovider["MiniMax provider<br/>[MiniMaxProvider.ts]"]
end

subgraph group_host["Premiere host"]
  node_hostsetup["UXP Webview host"]
  node_api["Host API<br/>[api.ts]"]
  node_captureframes["Frame capture<br/>[frames.ts]"]
  node_capturevideo["Work-area capture<br/>[captureVideo.ts]"]
  node_timeline["Timeline import<br/>[timeline.ts]"]
  node_project["Project state<br/>[project.ts]"]
end

subgraph group_data["Files and records"]
  node_files["File operations<br/>[files.ts]"]
  node_records["Generation records<br/>[records.ts]"]
  node_storage[("Settings storage<br/>[storage.ts]")]
end

subgraph group_integrations["External services"]
  node_upload["Reference upload<br/>[upload.ts]"]
  node_provideruxp["UXP AI provider"]
  node_download["Result download<br/>[download.ts]"]
  node_webhook["Webhook reporting<br/>[webhook.ts]"]
end

node_user(("Premiere user"))
node_minimax["MiniMax service"]
node_premiere["Premiere Pro"]
node_webhookdest["Webhook destination"]

node_user -->|"uses"| node_panel
node_panel -->|"renders"| node_prompt
node_panel -->|"uses"| node_references
node_panel -->|"uses"| node_tasks
node_panel -->|"uses"| node_recordsui
node_panel -->|"uses"| node_preview
node_references -->|"calls"| node_bridge
node_recordsui -->|"calls"| node_bridge
node_preview -->|"calls"| node_bridge
node_tasks -->|"submits tasks"| node_minimaxservice
node_tasks -->|"starts polling"| node_polling
node_tasks -->|"imports results"| node_bridge
node_polling -->|"queries tasks"| node_minimaxservice
node_minimaxservice -->|"selects provider"| node_providerregistry
node_providerregistry -->|"registers"| node_minimaxprovider
node_minimaxprovider -->|"sends requests"| node_minimax
node_hostsetup -->|"exposes API"| node_api
node_hostsetup -.->|"bridges calls"| node_bridge
node_bridge -.->|"forwards calls"| node_api
node_api -->|"reads settings"| node_storage
node_api -->|"reads and writes"| node_records
node_api -->|"handles files"| node_files
node_api -->|"captures frames"| node_captureframes
node_api -->|"captures work area"| node_capturevideo
node_api -->|"imports to timeline"| node_timeline
node_api -->|"queries project"| node_project
node_api -->|"reports results"| node_webhook
node_captureframes -->|"writes capture"| node_files
node_captureframes -->|"uploads capture"| node_upload
node_upload -->|"delegates upload"| node_provideruxp
node_provideruxp -->|"uses file access"| node_files
node_timeline -.->|"inserts media"| node_premiere
node_files -.->|"stores project media"| node_project
node_tasks -.->|"downloads results"| node_download
node_webhook -->|"reads configuration"| node_storage
node_webhook -->|"gets project details"| node_project
node_webhook -->|"posts report"| node_webhookdest
node_minimaxservice -->|"requests generation"| node_minimax

click node_panel "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/main-webview.vue"
click node_prompt "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/components/PromptInput.vue"
click node_references "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/useReferences.ts"
click node_recordsui "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/useRecordActions.ts"
click node_preview "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/useRecordPreview.ts"
click node_bridge "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/services/bridge.ts"
click node_tasks "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/useGenerationTasks.ts"
click node_polling "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/usePolling.ts"
click node_minimaxservice "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/services/MiniMax.ts"
click node_providerregistry "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/providers/core/registry.ts"
click node_minimaxprovider "https://github.com/vark-debug/rocx/blob/main/webview-ui/src/providers/minimax/MiniMaxProvider.ts"
click node_hostsetup "https://github.com/vark-debug/rocx/blob/main/src/webview-setup-host.ts"
click node_api "https://github.com/vark-debug/rocx/blob/main/src/api/api.ts"
click node_captureframes "https://github.com/vark-debug/rocx/blob/main/src/core/frames.ts"
click node_capturevideo "https://github.com/vark-debug/rocx/blob/main/src/core/captureVideo.ts"
click node_timeline "https://github.com/vark-debug/rocx/blob/main/src/core/timeline.ts"
click node_project "https://github.com/vark-debug/rocx/blob/main/src/core/project.ts"
click node_files "https://github.com/vark-debug/rocx/blob/main/src/core/files.ts"
click node_records "https://github.com/vark-debug/rocx/blob/main/src/core/records.ts"
click node_storage "https://github.com/vark-debug/rocx/blob/main/src/core/storage.ts"
click node_upload "https://github.com/vark-debug/rocx/blob/main/src/core/ai/upload.ts"
click node_provideruxp "https://github.com/vark-debug/rocx/blob/main/src/core/ai/providers/minimax/MiniMaxUxPProvider.ts"
click node_download "https://github.com/vark-debug/rocx/blob/main/src/core/ai/download.ts"
click node_webhook "https://github.com/vark-debug/rocx/blob/main/src/core/webhook.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_panel,node_prompt,node_references,node_recordsui,node_preview,node_bridge,node_user toneBlue
class node_tasks,node_polling,node_minimaxservice,node_providerregistry,node_minimaxprovider toneAmber
class node_hostsetup,node_api,node_captureframes,node_capturevideo,node_timeline,node_project,node_webhookdest toneMint
class node_files,node_records,node_storage toneRose
class node_upload,node_provideruxp,node_download,node_webhook,node_minimax,node_premiere toneIndigo
```

## Components

### Panel UI

- [Panel composition](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/main-webview.vue): `webview-ui/src/main-webview.vue`
- [Prompt and settings](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/components/PromptInput.vue): `webview-ui/src/components/PromptInput.vue`
- [Reference controls](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/useReferences.ts): `webview-ui/src/composables/useReferences.ts`
- [Record management](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/useRecordActions.ts): `webview-ui/src/composables/useRecordActions.ts`
- [Result preview](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/useRecordPreview.ts): `webview-ui/src/composables/useRecordPreview.ts`
- [Host API bridge](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/services/bridge.ts): `webview-ui/src/services/bridge.ts`

### Video generation

- [Generation lifecycle](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/useGenerationTasks.ts): `webview-ui/src/composables/useGenerationTasks.ts`
- [Task polling](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/composables/usePolling.ts): `webview-ui/src/composables/usePolling.ts`
- [MiniMax API service](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/services/MiniMax.ts): `webview-ui/src/services/MiniMax.ts`
- [Provider registry](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/providers/core/registry.ts): `webview-ui/src/providers/core/registry.ts`
- [MiniMax provider](https://github.com/vark-debug/rocx/blob/main/webview-ui/src/providers/minimax/MiniMaxProvider.ts): `webview-ui/src/providers/minimax/MiniMaxProvider.ts`

### Premiere host

- [UXP Webview host](https://github.com/vark-debug/rocx/blob/main/src/webview-setup-host.ts): `src/webview-setup-host.ts`
- [Host API](https://github.com/vark-debug/rocx/blob/main/src/api/api.ts): `src/api/api.ts`
- [Frame capture](https://github.com/vark-debug/rocx/blob/main/src/core/frames.ts): `src/core/frames.ts`
- [Work-area capture](https://github.com/vark-debug/rocx/blob/main/src/core/captureVideo.ts): `src/core/captureVideo.ts`
- [Timeline import](https://github.com/vark-debug/rocx/blob/main/src/core/timeline.ts): `src/core/timeline.ts`
- [Project state](https://github.com/vark-debug/rocx/blob/main/src/core/project.ts): `src/core/project.ts`

### Files and records

- [File operations](https://github.com/vark-debug/rocx/blob/main/src/core/files.ts): `src/core/files.ts`
- [Generation records](https://github.com/vark-debug/rocx/blob/main/src/core/records.ts): `src/core/records.ts`
- [Settings storage](https://github.com/vark-debug/rocx/blob/main/src/core/storage.ts): `src/core/storage.ts`

### External services

- [Reference upload](https://github.com/vark-debug/rocx/blob/main/src/core/ai/upload.ts): `src/core/ai/upload.ts`
- [UXP AI provider](https://github.com/vark-debug/rocx/blob/main/src/core/ai/providers/minimax/MiniMaxUxPProvider.ts): `src/core/ai/providers/minimax/MiniMaxUxPProvider.ts`
- [Result download](https://github.com/vark-debug/rocx/blob/main/src/core/ai/download.ts): `src/core/ai/download.ts`
- [Webhook reporting](https://github.com/vark-debug/rocx/blob/main/src/core/webhook.ts): `src/core/webhook.ts`

### Other components

- **Premiere user**
- **MiniMax service**
- **Premiere Pro**
- **Webhook destination**

## Connections

- Premiere user → Panel composition: uses (evidence: `README.md`)
- Panel composition → Prompt and settings: renders (evidence: `webview-ui/src/main-webview.vue`)
- Panel composition → Reference controls: uses (evidence: `webview-ui/src/main-webview.vue`)
- Panel composition → Generation lifecycle: uses (evidence: `webview-ui/src/main-webview.vue`)
- Panel composition → Record management: uses (evidence: `webview-ui/src/main-webview.vue`)
- Panel composition → Result preview: uses (evidence: `webview-ui/src/main-webview.vue`)
- Reference controls → Host API bridge: calls (evidence: `webview-ui/src/composables/useReferences.ts`)
- Record management → Host API bridge: calls (evidence: `webview-ui/src/composables/useRecordActions.ts`)
- Result preview → Host API bridge: calls (evidence: `webview-ui/src/composables/useRecordPreview.ts`)
- Generation lifecycle → MiniMax API service: submits tasks (evidence: `webview-ui/src/composables/useGenerationTasks.ts`)
- Generation lifecycle → Task polling: starts polling (evidence: `webview-ui/src/composables/useGenerationTasks.ts`)
- Generation lifecycle → Host API bridge: imports results (evidence: `webview-ui/src/composables/useGenerationTasks.ts`)
- Task polling → MiniMax API service: queries tasks (evidence: `webview-ui/src/composables/usePolling.ts`)
- MiniMax API service → Provider registry: selects provider (evidence: `webview-ui/src/services/MiniMax.ts`)
- Provider registry → MiniMax provider: registers (evidence: `webview-ui/src/providers/core/registry.ts`)
- MiniMax provider → MiniMax service: sends requests (evidence: `webview-ui/src/providers/minimax/MiniMaxProvider.ts`)
- UXP Webview host → Host API: exposes API (evidence: `src/webview-setup-host.ts`)
- UXP Webview host → Host API bridge: bridges calls
- Host API bridge → Host API: forwards calls
- Host API → Settings storage: reads settings (evidence: `src/api/api.ts`)
- Host API → Generation records: reads and writes (evidence: `src/api/api.ts`)
- Host API → File operations: handles files (evidence: `src/api/api.ts`)
- Host API → Frame capture: captures frames (evidence: `src/api/api.ts`)
- Host API → Work-area capture: captures work area (evidence: `src/api/api.ts`)
- Host API → Timeline import: imports to timeline (evidence: `src/api/api.ts`)
- Host API → Project state: queries project (evidence: `src/api/api.ts`)
- Host API → Webhook reporting: reports results (evidence: `src/api/api.ts`)
- Frame capture → File operations: writes capture (evidence: `src/core/frames.ts`)
- Frame capture → Reference upload: uploads capture (evidence: `src/core/frames.ts`)
- Reference upload → UXP AI provider: delegates upload (evidence: `src/core/ai/upload.ts`)
- UXP AI provider → File operations: uses file access (evidence: `src/core/ai/providers/minimax/MiniMaxUxPProvider.ts`)
- Timeline import → Premiere Pro: inserts media (evidence: `README.md`)
- File operations → Project state: stores project media (evidence: `README.md`)
- Generation lifecycle → Result download: downloads results
- Webhook reporting → Settings storage: reads configuration (evidence: `src/core/webhook.ts`)
- Webhook reporting → Project state: gets project details (evidence: `src/core/webhook.ts`)
- Webhook reporting → Webhook destination: posts report (evidence: `src/core/webhook.ts`)
- MiniMax API service → MiniMax service: requests generation (evidence: `webview-ui/src/services/MiniMax.ts`)
