Files
deepseek-harness/website/zh-CN/api/harness/user-interaction.md
lintianle efba9fab0a website: generate the API reference from source (cordis + all 15 harness services)
scripts/gen-website-api.ts renders website/zh-CN/api/{cordis,harness}/* and the
api-sidebar.json fragment the VitePress config imports, so pages and navigation
can never drift from the code: signatures, @param/@returns prose, dispatch
modes, and GitHub source links are extracted, never transcribed, and the
generator hard-errors on any rendered member missing docs. verify-website-api
(doc-sync + run-gates) is the freshness gate.

Replaces the hand-written zh api pages (7 pages covering 7 of 15 services,
with phantom APIs: Context.current/Context.events, agent/post-step, tool/call,
compact/*, llm/pre-request none of which exist) with generated English
references: 5 cordis pages, 15 per-service pages, and a 35-event catalog
grouped by scope. The hand-written hub api/index.md stays and now indexes the
full surface; zh for these pages arrives with the unified translation flow.
2026-07-16 18:13:34 +08:00

38 lines
1.3 KiB
Markdown

<!-- Generated by scripts/gen-website-api.ts — do not edit by hand. Run `pnpm run gen-website-api` to regenerate. -->
# ctx.userInteraction
`UserInteractionService` — provided by `@deepseek-ai/dsh-user-interaction`.
`ctx.userInteraction`: one active UI provider plus an `ask()` surface.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/ui/user-interaction/src/index.ts#L82)
### ctx.userInteraction.registerProvider(provider)
```ts website-api
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.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/ui/user-interaction/src/index.ts#L95)
### ctx.userInteraction.ask(request)
```ts website-api
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.
[Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/ui/user-interaction/src/index.ts#L114)