1.7 KiB
1.7 KiB
ctx.userInteraction
UserInteractionService — provided by @deepseek-ai/dsh-user-interaction.
ctx.userInteraction: one active UI provider plus an ask() surface.
ctx.userInteraction.registerProvider(provider)
/**
* Register the UI provider. Only one provider may be active in a context.
*
* @param provider UI-side implementation that collects answers.
* @returns Disposer that unregisters this provider.
*/
registerProvider(provider: UserInteractionProvider): () => void
Register the UI provider. Only one provider may be active in a context.
provider— UI-side implementation that collects answers.
Returns Disposer that unregisters this provider.
ctx.userInteraction.ask(request)
/**
* Ask the active UI provider and wait for the user's answer.
*
* @param request Questions, owner agent, and abort signal.
* @returns The answer chosen or typed by the human.
*/
async ask(request: AskUserQuestionRequest): Promise<AskUserQuestionAnswer>
Ask the active UI provider and wait for the user's answer.
request— Questions, owner agent, and abort signal.
Returns The answer chosen or typed by the human.