feat(sdk): pluginRoot officiel exposé dans activate(ctx) — #285 (src/runtime: champ pluginRoot = racine du package installé; docs activation-context/commands-and-feedback/services/manifest réécrits du constat d'absence vers le contrat d'usage officiel — runCommand reste project-scoped, pluginRoot utilisable dans command/args, substitution manifest ${pluginRoot}/${appDataDir} inchangée pour mcpServers; exemple hello-plugin: script packagé scripts/hello-task.mjs consommé via ctx.pluginRoot, packaging étendu; QA verte: npm run check — build, typecheck:examples, package:hello-plugin, artefact zip vérifié)
This commit is contained in:
@ -43,9 +43,10 @@ Check preconditions before calling `runCommand()`:
|
||||
- `ownerAgentId` is a real agent id when the work is owned by an agent workflow.
|
||||
Do not use all-zero placeholders in production.
|
||||
- `cwd` is relative to the project root.
|
||||
- `command`, `args` and `cwd` do not resolve package-relative plugin resources.
|
||||
Do not use `runCommand()` to launch scripts shipped inside the plugin package;
|
||||
there is no public runtime `pluginRoot` path in `activate(ctx)`.
|
||||
- `command` and `args` do not resolve package-relative plugin resources
|
||||
implicitly. Build an explicit absolute script path from `ctx.pluginRoot` when
|
||||
launching read-only files shipped in the installed package.
|
||||
- Do not use `ctx.pluginRoot` as `cwd`; `cwd` remains relative to the project root.
|
||||
- `command` and `args` are separate values. Do not shell-join user input.
|
||||
|
||||
If any required precondition fails, return a skipped result:
|
||||
|
||||
Reference in New Issue
Block a user