Addon registry with runtime introspection API #253

Closed
opened 2026-02-16 17:13:19 +00:00 by forbes · 0 comments
Owner

Summary

Expose a runtime addon registry that tracks loaded addons, their versions, status, and registered contexts. This is the data layer that a future Addon Manager UI (ROADMAP Tier 2) will consume.

Proposed API

import FreeCAD

# Get all loaded addons
registry = FreeCAD.getAddonRegistry()

# Query a specific addon
info = registry.get("ztools")
# AddonInfo(name="ztools", version="0.3.0", sdk_version="0.1.0",
#           status="loaded", contexts=["partdesign.body", ...],
#           path=Path("mods/ztools"), load_time_ms=45)

# List all registered contexts and which addons own them
registry.contexts()
# {"partdesign.body": ["builtin", "ztools"], "silo.tracked": ["silo"], ...}

# Check if an addon is available
registry.is_loaded("silo")  # True/False

Implementation

  • The registry is a singleton populated by the manifest-driven loader (#1) as each addon loads
  • Stored in FreeCADApp module namespace so it's globally accessible
  • Each entry tracks: name, version, path, load status (loaded/skipped/error), load time, error message if failed, list of registered contexts
  • The registry is read-only after startup (addons don't hot-load)

Affected files

  • src/Mod/Create/Init.py — populate registry during load
  • src/Mod/Create/InitGui.py — populate GUI-side registry entries
  • mods/sdk/kindred_sdk/registry.py — AddonInfo dataclass, registry class

Acceptance criteria

  • FreeCAD.getAddonRegistry() returns registry object after startup
  • Registry contains entries for SDK, ztools, and Silo with correct metadata
  • Skipped/errored addons appear in registry with status and error message
  • Registry is queryable by addon name and by context ID
  • Info available in Python console for debugging (FreeCAD.getAddonRegistry())

Dependencies

  • Depends on: #1 (manifest loader populates registry), #5 (schema defines metadata)

Notes

This is the foundation for the Theme & Addon Manager UI on the ROADMAP Tier 2. The UI will read from this registry to display addon status, versions, and allow enable/disable toggling in a future iteration.

## Summary Expose a runtime addon registry that tracks loaded addons, their versions, status, and registered contexts. This is the data layer that a future Addon Manager UI (ROADMAP Tier 2) will consume. ## Proposed API ```python import FreeCAD # Get all loaded addons registry = FreeCAD.getAddonRegistry() # Query a specific addon info = registry.get("ztools") # AddonInfo(name="ztools", version="0.3.0", sdk_version="0.1.0", # status="loaded", contexts=["partdesign.body", ...], # path=Path("mods/ztools"), load_time_ms=45) # List all registered contexts and which addons own them registry.contexts() # {"partdesign.body": ["builtin", "ztools"], "silo.tracked": ["silo"], ...} # Check if an addon is available registry.is_loaded("silo") # True/False ``` ## Implementation - The registry is a singleton populated by the manifest-driven loader (#1) as each addon loads - Stored in `FreeCADApp` module namespace so it's globally accessible - Each entry tracks: name, version, path, load status (loaded/skipped/error), load time, error message if failed, list of registered contexts - The registry is read-only after startup (addons don't hot-load) ## Affected files - `src/Mod/Create/Init.py` — populate registry during load - `src/Mod/Create/InitGui.py` — populate GUI-side registry entries - `mods/sdk/kindred_sdk/registry.py` — AddonInfo dataclass, registry class ## Acceptance criteria - [ ] `FreeCAD.getAddonRegistry()` returns registry object after startup - [ ] Registry contains entries for SDK, ztools, and Silo with correct metadata - [ ] Skipped/errored addons appear in registry with status and error message - [ ] Registry is queryable by addon name and by context ID - [ ] Info available in Python console for debugging (`FreeCAD.getAddonRegistry()`) ## Dependencies - **Depends on:** #1 (manifest loader populates registry), #5 (schema defines metadata) ## Notes This is the foundation for the Theme & Addon Manager UI on the ROADMAP Tier 2. The UI will read from this registry to display addon status, versions, and allow enable/disable toggling in a future iteration.
forbes added the enhancement label 2026-02-16 17:13:19 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#253