feat(addon-system): create kindred-addon-sdk package (#249) #259

Merged
forbes merged 1 commits from feat/kindred-addon-sdk into main 2026-02-17 14:49:34 +00:00
Owner

Summary

Create mods/sdk/ with the kindred_sdk Python package providing a stable API layer for addon integration with Kindred Create platform features. The SDK loads at priority 0 (before ztools and silo) via the existing manifest-driven loader.

Modules

  • context.py — Thin wrappers around FreeCADGui editing context/overlay bindings with argument validation and error handling
  • theme.py — YAML-driven palette system with Palette class supporting color tokens, semantic roles, QSS template formatting, and RGBA uint conversion
  • palettes/catppuccin-mocha.yaml — Single source of truth for all Catppuccin Mocha colors (replaces hardcoded dicts scattered across addons)
  • origin.py — FileOrigin registration helpers with duck-type validation
  • dock.py — Deferred dock panel registration replacing manual QTimer patterns
  • compat.py — Kindred Create and FreeCAD version detection

Key design decisions

  • Thin wrappers, not abstractions — pass-through to C++ bindings with validation/error handling
  • YAML palette as single source of truth — future themes are just new YAML files
  • Semantic roles — map meaningful names (accent.primary, background.toolbar) to palette colors
  • No FileOrigin base class — duck typing, same as current Silo pattern
  • YAML fallback parser — works without PyYAML dependency

Build integration

CMake install rules added to src/Mod/Create/CMakeLists.txt.

Verification

  • SDK appears first in FreeCAD.KindredAddons.loaded()
  • from kindred_sdk import get_theme_tokens, register_context, SDK_VERSION
  • get_theme_tokens()["blue"] returns "#89b4fa"
  • load_palette().format_qss("color: {text};") returns "color: #cdd6f4;"

Closes #249

## Summary Create `mods/sdk/` with the `kindred_sdk` Python package providing a stable API layer for addon integration with Kindred Create platform features. The SDK loads at priority 0 (before ztools and silo) via the existing manifest-driven loader. ## Modules - **context.py** — Thin wrappers around `FreeCADGui` editing context/overlay bindings with argument validation and error handling - **theme.py** — YAML-driven palette system with `Palette` class supporting color tokens, semantic roles, QSS template formatting, and RGBA uint conversion - **palettes/catppuccin-mocha.yaml** — Single source of truth for all Catppuccin Mocha colors (replaces hardcoded dicts scattered across addons) - **origin.py** — FileOrigin registration helpers with duck-type validation - **dock.py** — Deferred dock panel registration replacing manual QTimer patterns - **compat.py** — Kindred Create and FreeCAD version detection ## Key design decisions - **Thin wrappers, not abstractions** — pass-through to C++ bindings with validation/error handling - **YAML palette as single source of truth** — future themes are just new YAML files - **Semantic roles** — map meaningful names (`accent.primary`, `background.toolbar`) to palette colors - **No FileOrigin base class** — duck typing, same as current Silo pattern - **YAML fallback parser** — works without PyYAML dependency ## Build integration CMake install rules added to `src/Mod/Create/CMakeLists.txt`. ## Verification - SDK appears first in `FreeCAD.KindredAddons.loaded()` - `from kindred_sdk import get_theme_tokens, register_context, SDK_VERSION` - `get_theme_tokens()["blue"]` returns `"#89b4fa"` - `load_palette().format_qss("color: {text};")` returns `"color: #cdd6f4;"` Closes #249
forbes added 1 commit 2026-02-17 14:36:54 +00:00
feat(addon-system): create kindred-addon-sdk package (#249)
Some checks failed
Build and Test / build (pull_request) Failing after 1m40s
e667aceead
Add mods/sdk/ with the kindred_sdk Python package providing a stable
API layer for addon integration with Kindred Create platform features.

Modules:
- context: editing context/overlay registration wrappers
- theme: YAML-driven palette system (Catppuccin Mocha)
- origin: FileOrigin registration helpers
- dock: deferred dock panel registration
- compat: version detection utilities

The SDK loads at priority 0 (before all other addons) via the existing
manifest-driven loader. Theme colors are defined in a single YAML
palette file instead of hardcoded Python dicts, enabling future theme
support and eliminating color duplication across addons.

Closes #249
forbes merged commit 0ea1b1fde5 into main 2026-02-17 14:49:34 +00:00
forbes deleted branch feat/kindred-addon-sdk 2026-02-17 14:49:34 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#259