feat(manifest): un plugin peut contribuer des commandes slash via callback — #165 (QA verte)
Étend le manifeste et la validation SDK : un plugin déclare des commandes slash (contributes.slashCommands) adossées à une callback (command id enregistré via ctx.commands.registerCommand). Métadonnées UI exposées : name, shortDescription, requiresConfirmation, when. Exemple hello-plugin mis à jour avec une commande /hello. Ces commandes transitent ensuite par le registry/contrat unifié (#162). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -5,14 +5,20 @@ background work.
|
||||
|
||||
## Contract
|
||||
|
||||
Every human menu click follows this sequence:
|
||||
Every menu click or plugin slash command follows this sequence:
|
||||
|
||||
```text
|
||||
menu item -> command id -> registered command handler -> optional task -> feedback surfaces
|
||||
manifest contribution -> command id -> registered command handler -> optional task -> feedback surfaces
|
||||
```
|
||||
|
||||
- A manifest menu item declares a `command` id; it does not run tools directly.
|
||||
- A manifest slash command declares a slash `name`, autocomplete metadata and a
|
||||
`command` id; it does not run tools directly.
|
||||
- Menu items and slash commands may share the same `command` id, or point to
|
||||
different handlers. The plugin owns that choice.
|
||||
- The command handler is the only place that decides whether work should start.
|
||||
- The host slash-command registry only lists/filters metadata and returns a
|
||||
callback dispatch effect. The plugin handler decides what the command does.
|
||||
- A launched process is represented by a background task returned from
|
||||
`ctx.services.tasks.runCommand()`.
|
||||
- A skipped command is represented by the command handler return value and logs,
|
||||
|
||||
Reference in New Issue
Block a user