# pinokiofactory/frame-pack architecture

> Architecture diagram of the GitHub repository pinokiofactory/frame-pack, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pinokiofactory/frame-pack
- Repository: https://github.com/pinokiofactory/frame-pack

## Overview

##### Project type and purpose
- FramePack is not a full-stack web app but a Pinokio “plugin” or “script package” whose job is to orchestrate the installation, linking, resetting, starting, updating, and Torch-related commands for the upstream FramePack project.

##### File structure
- Top level:
- pinokio_meta.json – plugin metadata (name, commands exposed to Pinokio)
- pinokio.js – plugin entry point; reads the metadata and hooks the JS scripts into the Pinokio runtime
- install.js, link.js, reset.js, start.js, update.js, torch.js – each implements one Pinokio command
- No nested folders; this is a single-module plugin.
- No database or frontend. It’s purely a CLI-to-external-repo orchestrator.

##### README
- Confirms this is purely a Pinokio plugin.
- No extra architecture hints beyond pointing to FramePack’s GitHub.

##### Final advice
- Data/process flow clearly: user input triggers a chain through core → plugin → external.

[User CLI]
↓
[Pinokio Core]
↓
[Plugin Loader]
└─> pinokio_meta.json & pinokio.js
↓
[Command Modules]
├─ install.js → GitHub (FramePack) / npm
├─ link.js    → local FS link operations
├─ reset.js   → GitHub reset, FS cleanup
├─ start.js   → GitHub pull, init & run FramePack
├─ update.js  → GitHub pull, npm update
└─ torch.js   → Python/Torch environment
↑                              ↓
└────────── Console Output ──┘

## Diagram (Mermaid)

```mermaid
flowchart TD
    UserCLI["User CLI"]:::user
    PinokioCore["Pinokio Core"]:::framework

    subgraph "Plugin Loader"
        Meta["pinokio_meta.json"]:::plugin
        Entry["pinokio.js"]:::plugin
        Docs["README.md"]:::plugin
    end

    subgraph "Command Handlers"
        Install["install.js"]:::command
        Link["link.js"]:::command
        Reset["reset.js"]:::command
        Start["start.js"]:::command
        Update["update.js"]:::command
        Torch["torch.js"]:::command
    end

    GitHub["GitHub (FramePack Repo)"]:::external
    Python["Python/Torch Environment"]:::external
    Console["Console Output"]:::user

    UserCLI --> PinokioCore
    PinokioCore --> Meta
    PinokioCore --> Entry
    UserCLI --> Docs

    Entry --> Install
    Entry --> Link
    Entry --> Reset
    Entry --> Start
    Entry --> Update
    Entry --> Torch

    Install --> GitHub
    Reset --> GitHub
    Start --> GitHub
    Update --> GitHub

    Torch --> Python

    Install --> Console
    Link --> Console
    Reset --> Console
    Start --> Console
    Update --> Console
    Torch --> Console

    click Meta "https://github.com/pinokiofactory/frame-pack/blob/main/pinokio_meta.json"
    click Entry "https://github.com/pinokiofactory/frame-pack/blob/main/pinokio.js"
    click Install "https://github.com/pinokiofactory/frame-pack/blob/main/install.js"
    click Link "https://github.com/pinokiofactory/frame-pack/blob/main/link.js"
    click Reset "https://github.com/pinokiofactory/frame-pack/blob/main/reset.js"
    click Start "https://github.com/pinokiofactory/frame-pack/blob/main/start.js"
    click Update "https://github.com/pinokiofactory/frame-pack/blob/main/update.js"
    click Torch "https://github.com/pinokiofactory/frame-pack/blob/main/torch.js"
    click Docs "https://github.com/pinokiofactory/frame-pack/blob/main/README.md"

    classDef framework fill:#AED6F1,stroke:#2E86C1,color:#1B4F72,stroke-width:2px;
    classDef plugin fill:#ABEBC6,stroke:#28B463,color:#145A32,stroke-width:2px;
    classDef command fill:#F9E79F,stroke:#B7950B,color:#7D6608,stroke-width:2px;
    classDef external fill:#F5B7B1,stroke:#C0392B,color:#641E16,stroke-width:2px;
    classDef user fill:#D7BDE2,stroke:#8E44AD,color:#4A235A,stroke-width:2px;
```
