docs: record verified Skill.Info and Agent.Info typings from @opencode/plugin 2.0.29

This commit is contained in:
haylan committed 2026-10-14 11:39:52 +02:00
1 parent b635362171
commit d190ded022
2 files changed
+13 -5

No files matched your search

+9 -3
View File
@@ -45,9 +45,15 @@ safe intermediate work.
- Plugins: `Plugin.define({ id, setup(ctx) })` from `@opencode/plugin`; config key `plugins`;
npm package needs `type: module` + `exports["."]`.
- `ctx.skill.transform(editor)` **can add** skills programmatically (id, name, description, path,
content, autoinvoke, slash). `ctx.agent.transform(editor)` **cannot add** agents — only
list/get/update/remove/default. Hence: skills ship via plugin injection, agents via `init` copy.
- `ctx.skill.transform(editor)` **can add** skills programmatically. `Skill.Info` (verified in
`@opencode/plugin@2.0.29` typings) = `{ id, name, description?, autoinvoke?, path, content }` —
`path` must be absolute (we point it at the bundled SKILL.md so supporting files resolve); there is
**no `slash` field** in `Skill.Info` (slash is file-frontmatter only — verify `/name` exposure for
injected skills at runtime; fallback: document a `skills: ["<pkg>/skills"]` config entry).
`ctx.agent.transform(editor)` **cannot add** agents — only list/get/update/remove/default. Hence:
skills ship via plugin injection, agents via `init` copy.
- `Agent.Info` (verified): `{ id, name, mode: subagent|primary|all, description?, model?, system?,
hidden, color?, steps?, request{settings,headers,body}, permissions[{action,resource,effect}] }`.
- Skills frontmatter honored: `name`, `description`, `slash`, `disable-model-invocation` /
`metadata.opencode/autoinvoke` (hidden from model, still loadable by id/slash).
- Agent files: `.opencode/agents/<name>.md` (project), `~/.config/opencode/agents/` (global);