-
Notifications
You must be signed in to change notification settings - Fork 100
POC: support for Python package-based plugin loading #1399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
POC: support for Python package-based plugin loading #1399
Conversation
This commit adds the ability to load skills from installed OpenHands skill packages, enabling reusable skill distribution across projects. Features: - Package discovery using Python entry points - Configuration via .openhands/packages.yaml - Functions to list, load, and inspect skill packages - Integration with existing skill loading infrastructure - Comprehensive tests and documentation - Example demonstrating all features New files: - openhands-sdk/openhands/sdk/context/skills/package_loader.py - tests/sdk/context/skill/test_package_loader.py - examples/01_standalone_sdk/04_use_skill_packages.py - docs/skill-packages.md - .openhands/packages.yaml (template) Related to: https://github.com/OpenHands/package-poc
Update the OpenHands SDK package loader to support both manifest.json (Claude Desktop Extensions-aligned) and skill-package.yaml (legacy) formats. Key Changes: - Add _load_descriptor() helper that tries JSON first, falls back to YAML - Update list_skill_packages() to use new descriptor loader - Update get_skill_package() to use new descriptor loader - Update load_skills_from_package() to handle both descriptor formats - Add comprehensive documentation on Claude Code alignment Features: - Full backwards compatibility with existing YAML packages - Cross-platform package support (OpenHands + Claude Desktop) - Automatic format detection and handling - No changes required to existing code using package_loader Documentation: - New claude-code-alignment.md guide - Usage examples for both formats - Migration strategies for existing packages - Integration guidelines This change aligns with OpenHands/package-poc PR #17 which implements the manifest.json format in the ohp package management tool. Related to OpenHands/package-poc#16 Co-authored-by: openhands <openhands@all-hands.dev>
- Removed YAML fallback logic from _load_descriptor() - Updated docstrings to reflect JSON-only support - Simplified load_skills_from_package() to handle only flat JSON structure - Removed dual-format handling code This is a clean break for Scenario 1 - packages must use manifest.json. Co-authored-by: openhands <openhands@all-hands.dev>
- Removed backwards compatibility mentions - Updated usage examples to show flat JSON structure - Clarified manifest.json is required for Scenario 1 - Updated migration section - Simplified benefits section Co-authored-by: openhands <openhands@all-hands.dev>
- Convert test fixtures from YAML to JSON format - Update descriptor access to use flat structure (no metadata/spec nesting) - Fix mock setup for manifest.json instead of skill-package.yaml - Keep yaml import for packages.yaml configuration support - Fix line length issues for ruff compliance - All 13 tests passing Co-authored-by: openhands <openhands@all-hands.dev>
Coverage Report •
|
||||||||||||||||||||
…ll_packages.py - Updated example code to access flat manifest.json structure instead of nested metadata/spec - Fixed descriptor access patterns: descriptor['displayName'] instead of descriptor['metadata']['displayName'] - Renamed from 04_use_skill_packages.py to 31_use_skill_packages.py to match PR #1378 - Updated documentation reference to point to new filename - Added defensive handling for author and repository fields that can be string or object Co-authored-by: openhands <openhands@all-hands.dev>
Add isinstance check before passing triggers to KeywordTrigger to handle untyped frontmatter metadata. This ensures type safety and prevents passing non-list objects. Co-authored-by: openhands <openhands@all-hands.dev>
Automated formatting by yamlfmt to add standard YAML document delimiter. Co-authored-by: openhands <openhands@all-hands.dev>
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
This adds comprehensive documentation for the new skill packages feature, covering installation, loading, configuration, and package creation. Related to: OpenHands/software-agent-sdk#1399 Co-authored-by: openhands <openhands@all-hands.dev>
|
📚 Documentation PR Created The documentation for the skill packages example has been added to the docs repository: This resolves the failing check requiring documentation for The documentation covers:
|
|
[Automatic Post]: It has been a while since there was any activity on this PR. @jpshackelford, are you still working on it? If so, please go ahead, if not then please request review, close it, or request that someone else follow up. |
Description
This PR provides initial proof-of-concept support for distributing OpenHands plugins as Python packages with a
manifest.jsondescriptor. This implementation enables early experimentation with package-based plugin distribution but is expected to be superseded by a more comprehensive implementation that fully aligns with the broader plugin architecture vision outlined in #1440, #1452, and OpenHands#12085.Plugin Distribution Context
OpenHands supports two complementary forms of plugin distribution, each with distinct advantages:
Bare Git Repository Marketplaces (See [TODO: add PR/issue reference])
Python Package Distribution (This PR - POC: support for Python package-based plugin loading #1399)
Status & Future Work
Important: This PR implements an initial proof of concept that:
manifest.jsonformat aligned with Claude Desktop ExtensionsExpected to be superseded by: A future PR that implements the full plugin architecture from #1440 and #1452, including:
.plugin/directory structure withplugin.jsonmanifestsSKILL.mdformat with frontmatter validationKey Changes in This PR
Type of Change
manifest.json Format Example
{ "name": "simple-code-review", "version": "1.0.0", "displayName": "Simple Code Review", "description": "Basic code review skills", "author": { "name": "OpenHands Team", "email": "team@openhands.ai" }, "keywords": ["code-review", "security"], "license": "MIT", "skills": [ { "name": "code-review", "description": "Guidelines for thorough code review", "path": "skills/code_review.md", "type": "keyword-triggered", "triggers": ["codereview", "review-code"] } ] }Testing
✅ All 13 package loader tests passing
✅ Ruff format and lint checks passing
Related