# magic-garden-modding-group/starweaver-mod-catalog architecture

> Architecture diagram of the GitHub repository magic-garden-modding-group/starweaver-mod-catalog, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/magic-garden-modding-group/starweaver-mod-catalog
- Repository: https://github.com/magic-garden-modding-group/starweaver-mod-catalog

## Overview

Starweaver Mod Catalog maintains the volatile version metadata consumed by the Starweaver Mod Manager. On a scheduled or manual run, the updater reads the tracked-mod configuration, resolves each source repository’s selected release, tag, or branch, fetches the script, extracts its version and computes its hash, then updates the catalog index when needed. The extension periodically fetches that index and overlays its fields on baked-in baselines; permission governance remains in the extension. The updater’s implementation is excerpted; extension behavior and scheduling details are represented from README documentation.

Main entry points: [`scripts/update-index.ts`](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/scripts/update-index.ts) (Update Orchestrator), [`index.json`](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/index.json) (Catalog Index), [`.github/workflows/update-index.yml`](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/.github/workflows/update-index.yml) (Update Workflow), [`tracked-mods.json`](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/tracked-mods.json) (Tracked Mods)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Tracking Configuration"]
  node_tracked["Tracked Mods<br/>[tracked-mods.json]"]
  node_index["Catalog Index<br/>[index.json]"]
end

subgraph group_updater["Catalog Updater"]
  node_workflow["Update Workflow<br/>[update-index.yml]"]
  node_updater_main["Update Orchestrator<br/>[update-index.ts]"]
  node_resolver["Commit Resolver<br/>[update-index.ts]"]
  node_script_fetch["Script Fetcher<br/>[update-index.ts]"]
  node_metadata["Version and Hash Extraction<br/>[update-index.ts]"]
end

subgraph group_consumers["Catalog Consumption"]
end

node_scheduler(("Scheduled or Manual Run"))
node_github["GitHub Repositories"]
node_extension(("Starweaver Mod Manager"))

node_scheduler -->|"triggers"| node_workflow
node_workflow -->|"runs"| node_updater_main
node_updater_main -->|"reads"| node_tracked
node_updater_main -->|"reads"| node_index
node_updater_main -->|"resolves commits"| node_resolver
node_resolver -->|"queries"| node_github
node_updater_main -->|"fetches scripts"| node_script_fetch
node_script_fetch -->|"downloads from"| node_github
node_updater_main -->|"extracts metadata"| node_metadata
node_updater_main -->|"writes changes"| node_index
node_extension -->|"fetches periodically"| node_index

click node_workflow "https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/.github/workflows/update-index.yml"
click node_tracked "https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/tracked-mods.json"
click node_updater_main "https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/scripts/update-index.ts"
click node_resolver "https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/scripts/update-index.ts"
click node_script_fetch "https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/scripts/update-index.ts"
click node_metadata "https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/scripts/update-index.ts"
click node_index "https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/index.json"

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_tracked,node_index toneBlue
class node_workflow,node_updater_main,node_resolver,node_script_fetch,node_metadata toneAmber
class node_scheduler,node_github,node_extension toneIndigo
```

## Components

### Tracking Configuration

- [Tracked Mods](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/tracked-mods.json): `tracked-mods.json`
- [Catalog Index](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/index.json): `index.json`

### Catalog Updater

- [Update Workflow](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/.github/workflows/update-index.yml): `.github/workflows/update-index.yml`
- [Update Orchestrator](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/scripts/update-index.ts): `scripts/update-index.ts`
- [Commit Resolver](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/scripts/update-index.ts): `scripts/update-index.ts`
- [Script Fetcher](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/scripts/update-index.ts): `scripts/update-index.ts`
- [Version and Hash Extraction](https://github.com/magic-garden-modding-group/starweaver-mod-catalog/blob/main/scripts/update-index.ts): `scripts/update-index.ts`

### Other components

- **Scheduled or Manual Run**
- **GitHub Repositories**
- **Starweaver Mod Manager**

## Connections

- Scheduled or Manual Run → Update Workflow: triggers (evidence: `README.md`)
- Update Workflow → Update Orchestrator: runs (evidence: `README.md`)
- Update Orchestrator → Tracked Mods: reads (evidence: `scripts/update-index.ts`)
- Update Orchestrator → Catalog Index: reads (evidence: `scripts/update-index.ts`)
- Update Orchestrator → Commit Resolver: resolves commits (evidence: `scripts/update-index.ts`)
- Commit Resolver → GitHub Repositories: queries (evidence: `scripts/update-index.ts`)
- Update Orchestrator → Script Fetcher: fetches scripts (evidence: `scripts/update-index.ts`)
- Script Fetcher → GitHub Repositories: downloads from (evidence: `scripts/update-index.ts`)
- Update Orchestrator → Version and Hash Extraction: extracts metadata (evidence: `scripts/update-index.ts`)
- Update Orchestrator → Catalog Index: writes changes (evidence: `scripts/update-index.ts`)
- Starweaver Mod Manager → Catalog Index: fetches periodically (evidence: `README.md`)
