2.2 KiB
ctx.subagents
SubagentService — provided by @deepseek-ai/dsh-subagent.
Named provider registry and capability-checked start surface.
ctx.subagents.registerProvider(provider)
registerProvider(provider: SubagentProvider): () => void
Register a provider under its name. Registration is effect-scoped and HMR safe; removing a provider blocks new starts but does not revoke runs that were already returned to their holders.
provider— the trusted provider implementation.
Returns the exact Cordis effect disposer.
ctx.subagents.getProvider(name)
getProvider(name: string): SubagentProvider | undefined
Look up a provider by name.
name— the provider name.
Returns the provider, or undefined when absent.
ctx.subagents.list()
list(): string[]
List registered provider names in insertion order.
Returns the registered names.
ctx.subagents.start(name, request)
async start(name: string, request: SubagentStartRequest): Promise<SubagentRun>
Establish a ready child on the named provider. Capability and semantic checks run before delegation. Provider ownership lasts until its promise fulfills; a rejection therefore has no run for the caller to dispose and emits no run lifecycle events.
name— the provider to use.request— child prompt, parent, signal, and optional capabilities.
Returns the ready holder-owned run.