feat: external blueprint registration#2517
Conversation
Greptile SummaryThis PR adds dynamic discovery of externally packaged DimOS blueprints via Python package entry points (
Confidence Score: 5/5Safe to merge. The change is well-contained: external resolution only activates for dotted names, bare built-in names are unaffected, and all error paths exit cleanly. The core _collect_external_blueprints loop handles invalid entry point names gracefully per-distribution, so a misconfigured third-party package never blocks discovery of other packages. The three issues raised in previous review threads have all been resolved in this version. Test coverage is thorough, including edge cases for colliding namespaces, empty distributions, missing metadata, and load failures. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["dimos run name"] --> B{is_namespaced_blueprint_name?}
B -- "No (bare name)" --> C{in all_blueprints?}
C -- Yes --> D[get_blueprint_by_name]
C -- No --> E{in all_modules?}
E -- Yes --> F[get_module_by_name]
E -- No --> G[_fail_or_exit / ValueError]
B -- "Yes (has dot)" --> H[resolve_external_blueprint_by_name]
H --> I[_collect_external_blueprints via importlib.metadata]
I --> J{valid local name?}
J -- No --> K[ExternalBlueprintError: invalid local name]
J -- Yes --> L{namespace found?}
L -- "No, invalid entries exist" --> M[ExternalBlueprintError: invalid entry point name in dist]
L -- No --> N[ExternalBlueprintError: namespace not found]
L -- Yes --> O{local name found?}
O -- No --> P[ExternalBlueprintError: local name not found]
O -- Yes --> Q[entry_point.load]
Q -- ImportError --> R[ExternalBlueprintError: load failure]
Q -- Success --> S{isinstance Blueprint?}
S -- Yes --> T[return Blueprint]
S -- No --> U{is_module_type?}
U -- Yes --> V[Module.blueprint then return]
U -- No --> W[ExternalBlueprintError: unsupported target]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A["dimos run name"] --> B{is_namespaced_blueprint_name?}
B -- "No (bare name)" --> C{in all_blueprints?}
C -- Yes --> D[get_blueprint_by_name]
C -- No --> E{in all_modules?}
E -- Yes --> F[get_module_by_name]
E -- No --> G[_fail_or_exit / ValueError]
B -- "Yes (has dot)" --> H[resolve_external_blueprint_by_name]
H --> I[_collect_external_blueprints via importlib.metadata]
I --> J{valid local name?}
J -- No --> K[ExternalBlueprintError: invalid local name]
J -- Yes --> L{namespace found?}
L -- "No, invalid entries exist" --> M[ExternalBlueprintError: invalid entry point name in dist]
L -- No --> N[ExternalBlueprintError: namespace not found]
L -- Yes --> O{local name found?}
O -- No --> P[ExternalBlueprintError: local name not found]
O -- Yes --> Q[entry_point.load]
Q -- ImportError --> R[ExternalBlueprintError: load failure]
Q -- Success --> S{isinstance Blueprint?}
S -- Yes --> T[return Blueprint]
S -- No --> U{is_module_type?}
U -- Yes --> V[Module.blueprint then return]
U -- No --> W[ExternalBlueprintError: unsupported target]
Reviews (8): Last reviewed commit: "fix: address external blueprint review c..." | Re-trigger Greptile |
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
Summary
Adds dynamic discovery for externally packaged DimOS blueprints via Python package entry points.
External packages can expose runnable blueprints with:
Users can then run them by namespaced name:
Changes
importlib.metadata.<canonical-distribution-namespace>.<local-kebab-name>.BlueprintobjectsModuleclasses converted with.blueprint()dimos list.Testing
dimos listdimos run my-test-stack.demo --daemondimos run demo-mcp-stress-test my-test-stack.demo --daemon