Conflict resolution notes: - package.json/run-gates: both sides' new doc-sync gates kept (master's scoped-events/readme gates + this branch's website-api/website-yaml); js-yaml devDeps deduped (master added them independently). - pnpm-workspace/knip: website AND python/sdk-runtime entries kept. - doc-typecheck/verify-type-equiv: master's condensed headers kept, website glob retained in both scan scopes. - vendor/cordis/src/fiber.ts: master's lifecycle-hardening code taken; this branch's richer FiberState JSDoc reapplied on top. vendor/README.md logs both local modifications (hardening = 6, JSDoc enrichment = 7). - pnpm-lock: regenerated from master's side (pnpm install). Post-merge sync the gates forced (the system working as designed): - verify-website-yaml caught 4 stale plugin names from master's package reorg (dsh-stdio-agent -> dsh-stdio-demo, dsh-acp-agent -> dsh-acp-demo); 8 references fixed across guide/ and develop/. - gen-website-api picked up master's 6 new services automatically (ctx.approval/permission/sandbox/sessionQuery/skills/tasks -> 6 new pages + sidebar); api/index.md hub updated to list them. - AGENTS.md budget ceiling 1370 -> 1400: the website rows (layout line + two command lines) and master's own growth collided with the old ceiling; all three website rows are load-bearing (new top-level dir, new CI command).
3.0 KiB
ctx.skills
SkillService — provided by @deepseek-ai/dsh-skill.
Registry of skill providers. It merges provider catalogs with stable first-wins duplicate handling, exposes sorted model-visible summaries, and loads full skill bodies on demand.
ctx.skills.registerProvider(provider)
registerProvider(provider: SkillProvider): () => void
Register a borrowed same-process provider synchronously during plugin apply. Duplicate and reserved names throw; remote initialization belongs in list(). Fiber disposal unregisters the provider and invalidates catalog caches.
provider— the provider to register byprovider.name.
Returns the exact Cordis effect disposer that unregisters this provider; composite effects may yield it directly to preserve teardown ordering.
ctx.skills.register(skill)
register(skill: SkillRegistration): () => void
Register a borrowed readonly runtime skill. Project entries outrank runtime entries, which outrank user entries. Same-name runtime entries are first-wins; a duplicate logs a warning and receives a no-op disposer so it cannot remove the winner.
skill— the complete skill definition to expose for discovery.
Returns the exact Cordis effect disposer, preserving composite teardown order and invalidating caches.
ctx.skills.list(options?)
async list(options: SkillLookupOptions = {}): Promise<SkillSummary[]>
List model-invocable skill summaries for a workspace. Lookup options and provider candidates are readonly same-process values borrowed throughout discovery.
options— lookup options;cwdselects project roots andsignalcancels discovery.
Returns sorted summaries, excluding skills disabled for model invocation.
ctx.skills.get(name, options?)
async get(name: string, options: SkillLookupOptions = {}): Promise<SkillDefinition | undefined>
Load and validate the winning candidate, passing its opaque discovery locator back to the provider. Cancellation is rechecked after selection, including cache hits, and raced against loading so an uncooperative provider cannot hang the caller.
name— kebab-case skill name.options— lookup options;cwdselects workspace-sensitive skills andsignalcancels work.
Returns the full skill, including body content, or undefined.