> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# Interface: QueryDataTools

由宿主提供本地 Query 数据的 renderer 工具及生命周期控制。

## Properties

### tools

> **tools**: `Record`\<_typeof_ [`OPENUI_DATA_TOOL_NAMES`](/next/zh/api/genui/openui/data-tools/variables/OPENUI_DATA_TOOL_NAMES.md)\[`number`], (`args`: `Record`\<`string`, `unknown`>) => `Promise`\<`unknown`>>

已注册的本地工具，可展开到 renderer 的 toolProvider 中。

## Methods

### dispose()

> **dispose**(): `void`

重置作用域并拒绝等待中的调用；可通过 setScope 开始新的生命周期。不会中止已发出的宿主操作。

#### Returns

`void`

***

### publishDefaults()

> **publishDefaults**(`scope`: `string`, `defaults`: [`InitialQueryResults`](/next/zh/api/genui/openui/core/type-aliases/InitialQueryResults.md)): `void`

合并当前作用域的完整默认值并初始化宿主；忽略其他作用域和内容未变化的数据。

#### Parameters

| Parameter  | Type                                                                                        |
| ---------- | ------------------------------------------------------------------------------------------- |
| `scope`    | `string`                                                                                    |
| `defaults` | [`InitialQueryResults`](/next/zh/api/genui/openui/core/type-aliases/InitialQueryResults.md) |

#### Returns

`void`

***

### setScope()

> **setScope**(`scope`: `string`): `void`

选择数据作用域；作用域变化时重置默认值并拒绝等待中的调用。

#### Parameters

| Parameter | Type     |
| --------- | -------- |
| `scope`   | `string` |

#### Returns

`void`
