feat: allow to register skills by extensions#1195
Conversation
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Florent Benoit <fbenoit@redhat.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThe PR adds skill registration capability to the Provider API by introducing a Changes
Sequence DiagramsequenceDiagram
actor Extension
participant Provider as ProviderImpl
participant SkillManager
participant Backend as Skill Registration<br/>Backend
Extension->>Provider: registerSkill({label, path})
activate Provider
Provider->>SkillManager: registerSkillFolder({<br/>label,<br/>baseDirectory: path,<br/>badge: extensionDisplayName<br/>})
activate SkillManager
SkillManager->>Backend: register skill folder
activate Backend
Backend-->>SkillManager: Disposable
deactivate Backend
SkillManager-->>Provider: Disposable
deactivate SkillManager
Provider-->>Extension: Disposable
deactivate Provider
Extension->>Provider: disposable.dispose()
activate Provider
Provider->>SkillManager: inner disposable.dispose()
SkillManager->>Backend: cleanup
deactivate Provider
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/extension-api/src/extension-api.d.ts (1)
943-946: Consider documenting path expectations onCreateSkillParams.path.Since this is public API, a short TSDoc note (absolute vs relative, expected directory shape) would reduce extension-author ambiguity.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/extension-api/src/extension-api.d.ts` around lines 943 - 946, Add a short TSDoc comment to the CreateSkillParams.path declaration describing expected format and semantics: state whether path is absolute or relative to the extension root, whether it should point to a directory or a manifest file, and any required directory structure or naming conventions; update the declaration for the interface CreateSkillParams and specifically document the path property so extension authors know the expected input for path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/extension-api/src/extension-api.d.ts`:
- Around line 943-946: Add a short TSDoc comment to the CreateSkillParams.path
declaration describing expected format and semantics: state whether path is
absolute or relative to the extension root, whether it should point to a
directory or a manifest file, and any required directory structure or naming
conventions; update the declaration for the interface CreateSkillParams and
specifically document the path property so extension authors know the expected
input for path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 52cdf950-a063-4a97-b7b2-e93b15044397
📒 Files selected for processing (5)
packages/extension-api/src/extension-api.d.tspackages/main/src/plugin/provider-impl.spec.tspackages/main/src/plugin/provider-impl.tspackages/main/src/plugin/provider-registry.spec.tspackages/main/src/plugin/provider-registry.ts
jeffmaury
left a comment
There was a problem hiding this comment.
Seems to me the implementation of the extension API is missing ?
AFAIK it's there. It's adding a new entry inside a provider so it's modifying ProviderImpl and reusing existing methods where we could add a folder and gets a Disposable |
fixes #1031