mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-04 15:34:39 +00:00
feat(plugin): provider plugins declare option controls and receive option changes
A provider plugin reports `controls` and the `providerOptions` it runs in `session.config`, and receives running-session changes as `session.configure` `changes.providerOptions` (null returns a key to its default), under the same apply-or-throw contract as built-in providers. A control may declare a `defaultValue`; a value a plugin reports at that default for a key nobody set stays unset instead of being pinned to the agent. A plugin that still reports `settings` keeps working: the daemon reads each setting as a control plus an option and sends changes in both shapes (COMPAT(plugin-provider-settings)). The app resolves a control's icon as a Lucide name when it is not one of the built-in kebab-case names, so a plugin's icon shows live and in drafts. Public docs and the provider-direct example use only `providerOptions` and controls; the migration doc gains the rows.
This commit is contained in:
@@ -206,14 +206,14 @@ Receives `{ request: { config, env? } }`. Config changes are saved and remain af
|
||||
|
||||
**`agent.create.before.config`** uses `AgentSessionConfig`:
|
||||
|
||||
| Fields | Constraint |
|
||||
| --------------------------------------------- | -------------------------------------------------------------------------- |
|
||||
| `provider`, `model` | Separate fields; changing provider may require changing model/mode/options |
|
||||
| `modeId`, `thinkingOptionId`, `featureValues` | Provider-specific selections |
|
||||
| `title`, `systemPrompt` | Agent configuration |
|
||||
| `providerOptions` | Opaque provider-specific options |
|
||||
| `mcpServers`, `toolPolicy` | MCP configuration and exact-tool preapprovals |
|
||||
| `cwd` | Cannot change |
|
||||
| Fields | Constraint |
|
||||
| ---------------------------- | -------------------------------------------------------------------------- |
|
||||
| `provider`, `model` | Separate fields; changing provider may require changing model/mode/options |
|
||||
| `modeId`, `thinkingOptionId` | Provider-specific selections |
|
||||
| `title`, `systemPrompt` | Agent configuration |
|
||||
| `providerOptions` | Provider options, including speed and auto-accept selections |
|
||||
| `mcpServers`, `toolPolicy` | MCP configuration and exact-tool preapprovals |
|
||||
| `cwd` | Cannot change |
|
||||
|
||||
### Change saved configuration
|
||||
|
||||
|
||||
@@ -203,14 +203,14 @@ server.addHook("worktree.create.after", async ({ worktree }) => {
|
||||
|
||||
**`agent.create.before.config`** 使用 `AgentSessionConfig`:
|
||||
|
||||
| 字段 | 约束 |
|
||||
| --------------------------------------------- | -------------------------------------------------------- |
|
||||
| `provider`, `model` | 独立的字段;修改 Provider 可能需要同时修改模型/模式/选项 |
|
||||
| `modeId`, `thinkingOptionId`, `featureValues` | 特定于 Provider 的选择 |
|
||||
| `title`, `systemPrompt` | Agent 配置 |
|
||||
| `providerOptions` | 不透明的、特定于 Provider 的选项 |
|
||||
| `mcpServers`, `toolPolicy` | MCP 配置和精确的工具预批准 |
|
||||
| `cwd` | 不能修改 |
|
||||
| 字段 | 约束 |
|
||||
| ---------------------------- | -------------------------------------------------------- |
|
||||
| `provider`, `model` | 独立的字段;修改 Provider 可能需要同时修改模型/模式/选项 |
|
||||
| `modeId`, `thinkingOptionId` | 特定于 Provider 的选择 |
|
||||
| `title`, `systemPrompt` | Agent 配置 |
|
||||
| `providerOptions` | Provider 选项,包括速度和自动批准的选择 |
|
||||
| `mcpServers`, `toolPolicy` | MCP 配置和精确的工具预批准 |
|
||||
| `cwd` | 不能修改 |
|
||||
|
||||
### 修改已保存的配置 {#change-saved-configuration}
|
||||
|
||||
|
||||
@@ -184,6 +184,26 @@ For paced timeline text, replace `useRevealedText(text, phase)` and the surround
|
||||
`<StreamedText text={text} phase={phase} style={style} />` from `/client/ui`.
|
||||
Use `SettingsSection` for plugin settings headings; `SettingsGroup` is deprecated.
|
||||
|
||||
### Provider options in v0.15
|
||||
|
||||
A provider plugin has one configuration record, `providerOptions`, and describes which keys get a
|
||||
composer control. A provider that still reports `settings` keeps working through v0.15: Paseo reads each
|
||||
setting `id` as an option key and each `value` as that option, and sends changes in both
|
||||
`changes.providerOptions` and `changes.settings`. Remove `settings` before the shim is deleted after
|
||||
2027-05-01.
|
||||
|
||||
| Previous API | Replacement |
|
||||
| ---------------------------------------------- | -------------------------------------------------------------------------- |
|
||||
| `session.config` `settings: ProviderSetting[]` | `controls: ProviderOptionControl[]` plus `providerOptions` |
|
||||
| Setting `id` | Control `key` |
|
||||
| Setting `value` | `providerOptions[key]`; the control holds no value |
|
||||
| Select setting `options: { label, value }[]` | Select control `choices: { value, label, description? }[]` |
|
||||
| Setting with no icon or default | Control `icon` (a Lucide name) and `defaultValue` |
|
||||
| `session.configure` `changes.settings` | `changes.providerOptions`; `null` returns a key to its default |
|
||||
| `session.open` `config.settings` | `config.providerOptions` |
|
||||
| `ProviderSetting` type | `ProviderOptionControl` |
|
||||
| `agent.create.before` `config.featureValues` | `config.providerOptions`; a returned `featureValues` edit is still applied |
|
||||
|
||||
## 5. Recognize half-migration errors
|
||||
|
||||
| Compiler or load error | Meaning and fix |
|
||||
|
||||
@@ -152,6 +152,22 @@ pill.remove();
|
||||
|
||||
对于逐步显示的时间线文本,把 `useRevealedText(text, phase)` 及其外层的 `Text` 换成 `/client/ui` 中的 `<StreamedText text={text} phase={phase} style={style} />`。插件设置的标题使用 `SettingsSection`;`SettingsGroup` 已弃用。
|
||||
|
||||
### v0.15 中的 Provider 选项 {#provider-options-in-v015}
|
||||
|
||||
Provider 插件只有一个配置记录 `providerOptions`,并用控件描述哪些键显示在 Composer 中。仍然报告 `settings` 的 Provider 在 v0.15 中继续可用:Paseo 把每个 setting 的 `id` 当作选项键,把 `value` 当作该选项的值,并同时在 `changes.providerOptions` 和 `changes.settings` 中发送修改。请在 2027-05-01 之后兼容层被删除之前移除 `settings`。
|
||||
|
||||
| 之前的 API | 替代方式 |
|
||||
| ------------------------------------------------- | --------------------------------------------------------------- |
|
||||
| `session.config` 的 `settings: ProviderSetting[]` | `controls: ProviderOptionControl[]` 加 `providerOptions` |
|
||||
| Setting 的 `id` | 控件的 `key` |
|
||||
| Setting 的 `value` | `providerOptions[key]`;控件本身不保存值 |
|
||||
| 选择类 setting 的 `options: { label, value }[]` | 选择类控件的 `choices: { value, label, description? }[]` |
|
||||
| 没有图标或默认值的 setting | 控件的 `icon`(Lucide 名称)和 `defaultValue` |
|
||||
| `session.configure` 的 `changes.settings` | `changes.providerOptions`;`null` 表示恢复该键的默认值 |
|
||||
| `session.open` 的 `config.settings` | `config.providerOptions` |
|
||||
| `ProviderSetting` 类型 | `ProviderOptionControl` |
|
||||
| `agent.create.before` 的 `config.featureValues` | `config.providerOptions`;返回的 `featureValues` 修改仍会被应用 |
|
||||
|
||||
## 5. 识别只迁移了一半的错误 {#5-recognize-half-migration-errors}
|
||||
|
||||
| 编译器或加载错误 | 含义与修复方法 |
|
||||
|
||||
@@ -22,7 +22,7 @@ Choose one implementation path:
|
||||
|
||||
The examples are:
|
||||
|
||||
- [`provider-direct`](https://github.com/getpaseo/paseo/tree/main/plugin-examples/provider-direct): sessions, settings, prompts, persistence, child sessions, and a provider-owned timeline renderer;
|
||||
- [`provider-direct`](https://github.com/getpaseo/paseo/tree/main/plugin-examples/provider-direct): sessions, option controls, prompts, persistence, child sessions, and a provider-owned timeline renderer;
|
||||
- [`provider-acp-transformer`](https://github.com/getpaseo/paseo/tree/main/plugin-examples/provider-acp-transformer): an ACP command template with a Zod-validated vendor edit transformer. Replace `example-acp --stdio` with an installed ACP agent before loading it;
|
||||
- [`inline-thinking`](https://github.com/getpaseo/paseo/tree/main/plugin-examples/inline-thinking): a renderer-only plugin that does not implement a provider.
|
||||
|
||||
@@ -138,7 +138,7 @@ later through `session.config`.
|
||||
## Open a session
|
||||
|
||||
`session.open` contains the complete launch configuration: working directory, environment, system
|
||||
prompt, MCP servers, tool policy, model, mode, settings, opaque provider options, and persistence
|
||||
prompt, MCP servers, tool policy, model, mode, `providerOptions`, and persistence
|
||||
preference.
|
||||
|
||||
For persisted host-scoped plugin settings, use the handle returned by `server.registerSettings()`.
|
||||
@@ -177,7 +177,8 @@ emit({
|
||||
models,
|
||||
modes,
|
||||
thinkingOptions,
|
||||
settings: [],
|
||||
controls: [],
|
||||
providerOptions: {},
|
||||
},
|
||||
});
|
||||
emit({ type: "session.ready", requestId: input.requestId, sessionId: input.sessionId });
|
||||
@@ -229,10 +230,16 @@ terminal `completed`, `failed`, or `canceled` event.
|
||||
At this point the provider is usable: users can select a model, open a session, send a message, and
|
||||
see the response.
|
||||
|
||||
## Add session-specific composer controls
|
||||
## Add composer controls for provider options
|
||||
|
||||
Add `session.configure` only when the native agent has settings users should change after opening a
|
||||
session. Publish them in `session.config` as toggle or select controls:
|
||||
`providerOptions` is the provider's own configuration: one record of JSON values that Paseo
|
||||
stores per agent and hands to `session.open`. It includes the defaults a user set in `config.json`
|
||||
for your provider. Validate every key you read.
|
||||
|
||||
Add `controls` only when users should see and change some of those options in the composer. A
|
||||
control draws one top-level key of `providerOptions` as a toggle or a select. It holds no value:
|
||||
Paseo reads the value from `providerOptions`. Publish the controls and the values you run with in
|
||||
`session.config`:
|
||||
|
||||
```ts
|
||||
emit({
|
||||
@@ -243,35 +250,44 @@ emit({
|
||||
models: [{ id: "agent-large", label: "Agent Large" }],
|
||||
modes: [],
|
||||
thinkingOptions: [],
|
||||
settings: [
|
||||
{
|
||||
type: "toggle",
|
||||
id: "fast",
|
||||
label: "Fast mode",
|
||||
value: nativeSession.fast,
|
||||
},
|
||||
controls: [
|
||||
{ type: "toggle", key: "fast", label: "Fast mode", icon: "Zap", defaultValue: false },
|
||||
{
|
||||
type: "select",
|
||||
id: "approval",
|
||||
key: "approval",
|
||||
label: "Approvals",
|
||||
value: nativeSession.approval,
|
||||
options: [
|
||||
{ label: "Ask", value: "ask" },
|
||||
{ label: "Auto accept", value: "auto" },
|
||||
icon: "Shield",
|
||||
defaultValue: "ask",
|
||||
choices: [
|
||||
{ value: "ask", label: "Ask" },
|
||||
{ value: "auto", label: "Auto accept" },
|
||||
],
|
||||
},
|
||||
],
|
||||
providerOptions: { fast: nativeSession.fast, approval: nativeSession.approval },
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Paseo renders these controls in the composer. A user change arrives as `session.configure`; apply it
|
||||
and publish the committed `session.config` before `request.completed`. The provider may change the
|
||||
available controls at runtime, including after a model change.
|
||||
`icon` is a Lucide icon name. `defaultValue` is what an unset key shows. A key you report at its
|
||||
`defaultValue` that nobody set stays unset, so the agent keeps following the default; report any
|
||||
other value and Paseo stores it. The same controls appear in the New workspace screen, in draft
|
||||
tabs, and on running agents. Offer a control only for a key you can change on a running session.
|
||||
The provider may change its controls at runtime, including after a model change.
|
||||
|
||||
`settings` are user-facing controls. `providerOptions` is opaque JSON supplied at session creation
|
||||
for provider-specific configuration that Paseo does not render. A provider-specific token budget
|
||||
belongs in one of those two places; it is not a dedicated prompt field.
|
||||
A user change arrives as `session.configure` with `changes.providerOptions` holding only the keys
|
||||
that changed. Apply the change and publish the committed `session.config` before
|
||||
`request.completed`, or fail the request with `request.failed` and leave every key as it was. A
|
||||
value of `null` returns that key to the provider's default. Publish what the session ended up
|
||||
with, not a copy of the request: Paseo stores your published values so the stored options match
|
||||
what runs.
|
||||
|
||||
If the provider changes an option on its own, for example a model switch turns Fast off, publish
|
||||
a new `session.config` with the new values. Paseo stores them and does not set the old ones
|
||||
back.
|
||||
|
||||
Keys without a control are still delivered in `session.open` and stored. A provider-specific
|
||||
token budget, for example, belongs in `providerOptions` and is not a dedicated prompt field.
|
||||
|
||||
## Add persistence and replay
|
||||
|
||||
@@ -467,7 +483,7 @@ export const vendorEdits: AcpTransformer = {
|
||||
Test the provider against the real agent, not only mocked frames:
|
||||
|
||||
1. install the plugin as a directory source;
|
||||
2. confirm its SVG, models, modes, and settings appear;
|
||||
2. confirm its SVG, models, modes, and option controls appear;
|
||||
3. create a session and complete a real prompt;
|
||||
4. exercise permissions, steering, cancellation, persistence, and replay when supported;
|
||||
5. render every custom timeline item on desktop and mobile-width layouts;
|
||||
|
||||
@@ -19,7 +19,7 @@ Provider 插件把一个编程 Agent 接入 Paseo,而无需把它加入 Paseo
|
||||
|
||||
示例有:
|
||||
|
||||
- [`provider-direct`](https://github.com/getpaseo/paseo/tree/main/plugin-examples/provider-direct):会话、设置、提示词、持久化、子会话,以及一个由 Provider 拥有的时间线渲染器;
|
||||
- [`provider-direct`](https://github.com/getpaseo/paseo/tree/main/plugin-examples/provider-direct):会话、选项控件、提示词、持久化、子会话,以及一个由 Provider 拥有的时间线渲染器;
|
||||
- [`provider-acp-transformer`](https://github.com/getpaseo/paseo/tree/main/plugin-examples/provider-acp-transformer):一个 ACP 命令模板,带有一个用 Zod 校验的厂商编辑转换器。加载之前,请把 `example-acp --stdio` 替换为一个已安装的 ACP Agent;
|
||||
- [`inline-thinking`](https://github.com/getpaseo/paseo/tree/main/plugin-examples/inline-thinking):一个只包含渲染器、不实现 Provider 的插件。
|
||||
|
||||
@@ -125,7 +125,7 @@ if (input.type === "catalog") {
|
||||
|
||||
## 打开会话 {#open-a-session}
|
||||
|
||||
`session.open` 包含完整的启动配置:工作目录、环境变量、系统提示词、MCP 服务器、工具策略、模型、模式、设置、不透明的 Provider 选项以及持久化偏好。
|
||||
`session.open` 包含完整的启动配置:工作目录、环境变量、系统提示词、MCP 服务器、工具策略、模型、模式、`providerOptions` 以及持久化偏好。
|
||||
|
||||
对于持久化的、作用于主机的插件设置,请使用 `server.registerSettings()` 返回的句柄。在目录和会话回调中读取它;当 Provider 在内存中保留配置时,订阅它。`read()` 和 `subscribe()` 的契约见[设置](./reference.md#persisted-values)。
|
||||
|
||||
@@ -160,7 +160,8 @@ emit({
|
||||
models,
|
||||
modes,
|
||||
thinkingOptions,
|
||||
settings: [],
|
||||
controls: [],
|
||||
providerOptions: {},
|
||||
},
|
||||
});
|
||||
emit({ type: "session.ready", requestId: input.requestId, sessionId: input.sessionId });
|
||||
@@ -207,9 +208,11 @@ emit({ type: "session.turn", sessionId, turnId, state: "completed" });
|
||||
|
||||
到这一步,Provider 已经可用:用户可以选择模型、打开会话、发送消息并看到回复。
|
||||
|
||||
## 添加会话专属的 Composer 控件 {#add-session-specific-composer-controls}
|
||||
## 为 Provider 选项添加 Composer 控件 {#add-composer-controls-for-provider-options}
|
||||
|
||||
只有当原生 Agent 有用户在打开会话后需要修改的设置时,才添加 `session.configure`。在 `session.config` 中以开关或选择控件的形式发布它们:
|
||||
`providerOptions` 是 Provider 自己的配置:一个由 JSON 值组成的记录,Paseo 按 Agent 保存它,并在 `session.open` 中交给你。它包含用户在 `config.json` 中为你的 Provider 设置的默认值。请校验你读取的每个键。
|
||||
|
||||
只有当用户需要在 Composer 中查看并修改其中一部分选项时,才添加 `controls`。一个控件把 `providerOptions` 的一个顶层键绘制为开关或选择器。控件本身不保存值:Paseo 从 `providerOptions` 读取值。在 `session.config` 中发布控件,以及你正在使用的值:
|
||||
|
||||
```ts
|
||||
emit({
|
||||
@@ -220,31 +223,32 @@ emit({
|
||||
models: [{ id: "agent-large", label: "Agent Large" }],
|
||||
modes: [],
|
||||
thinkingOptions: [],
|
||||
settings: [
|
||||
{
|
||||
type: "toggle",
|
||||
id: "fast",
|
||||
label: "Fast mode",
|
||||
value: nativeSession.fast,
|
||||
},
|
||||
controls: [
|
||||
{ type: "toggle", key: "fast", label: "Fast mode", icon: "Zap", defaultValue: false },
|
||||
{
|
||||
type: "select",
|
||||
id: "approval",
|
||||
key: "approval",
|
||||
label: "Approvals",
|
||||
value: nativeSession.approval,
|
||||
options: [
|
||||
{ label: "Ask", value: "ask" },
|
||||
{ label: "Auto accept", value: "auto" },
|
||||
icon: "Shield",
|
||||
defaultValue: "ask",
|
||||
choices: [
|
||||
{ value: "ask", label: "Ask" },
|
||||
{ value: "auto", label: "Auto accept" },
|
||||
],
|
||||
},
|
||||
],
|
||||
providerOptions: { fast: nativeSession.fast, approval: nativeSession.approval },
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
Paseo 会在 Composer 中渲染这些控件。用户的修改会以 `session.configure` 的形式到达;应用它,并在 `request.completed` 之前发布已确定的 `session.config`。Provider 可以在运行时改变可用的控件,包括在模型变化之后。
|
||||
`icon` 是 Lucide 图标名称。`defaultValue` 是键未设置时显示的值。如果你为一个无人设置过的键报告了它的 `defaultValue`,该键保持未设置,Agent 继续跟随默认值;报告其他任何值,Paseo 都会保存它。相同的控件会出现在“新建工作区”界面、草稿标签页和运行中的 Agent 上。只为你能在运行中的会话里修改的键提供控件。Provider 可以在运行时改变控件,包括在模型变化之后。
|
||||
|
||||
`settings` 是面向用户的控件。`providerOptions` 是在创建会话时提供的不透明 JSON,用于 Paseo 不会渲染的 Provider 专属配置。Provider 专属的 token 预算应放在这两处之一;它不是一个专门的提示词字段。
|
||||
用户的修改会以 `session.configure` 的形式到达,`changes.providerOptions` 只包含发生变化的键。应用它,并在 `request.completed` 之前发布已确定的 `session.config`;或者用 `request.failed` 使请求失败,并让每个键保持原样。值为 `null` 表示把该键恢复为 Provider 的默认值。请发布会话最终实际使用的值,而不是请求的副本:Paseo 会保存你发布的值,使保存的选项与实际运行的一致。
|
||||
|
||||
如果 Provider 自行改变了某个选项(例如切换模型后关闭了 Fast),请发布带有新值的 `session.config`。Paseo 会保存它们,不会把旧值设置回去。
|
||||
|
||||
没有控件的键仍会在 `session.open` 中交付并被保存。例如 Provider 专属的 token 预算应放在 `providerOptions` 中,它不是一个专门的提示词字段。
|
||||
|
||||
## 添加持久化与重放 {#add-persistence-and-replay}
|
||||
|
||||
@@ -405,7 +409,7 @@ export const vendorEdits: AcpTransformer = {
|
||||
用真实的 Agent 测试 Provider,而不只是模拟的数据帧:
|
||||
|
||||
1. 以目录来源安装插件;
|
||||
2. 确认它的 SVG、模型、模式和设置都会显示;
|
||||
2. 确认它的 SVG、模型、模式和选项控件都会显示;
|
||||
3. 创建会话并完成一段真实的提示词;
|
||||
4. 在支持的情况下,试用权限、引导、取消、持久化和重放;
|
||||
5. 在桌面和移动端宽度的布局中渲染每一种自定义时间线条目;
|
||||
|
||||
@@ -409,7 +409,7 @@ process, credential, and other machine-local work under `server/`. A plugin with
|
||||
### Providers
|
||||
|
||||
Follow [Build a provider plugin](/docs/plugins/providers) for direct and ACP implementations,
|
||||
session lifecycle, composer settings, timeline renderers, testing, and distribution.
|
||||
session lifecycle, option controls, timeline renderers, testing, and distribution.
|
||||
|
||||
Call `server.registerProvider()` with a `ProviderRegistration` from
|
||||
`@getpaseo/plugin/server/provider`. Its connection accepts inputs with `send()` and emits complete state
|
||||
@@ -420,10 +420,12 @@ Use the single `session.prompt` input for messages, structured commands, steerin
|
||||
effects. Repeat `clientMessageId` on the live user timeline item and publish exactly one matching
|
||||
`session.prompt_result`. Publish provider-created children as sessions with `parentSessionId`.
|
||||
|
||||
Provider settings are toggle/select descriptors that Paseo renders in the composer. Keep
|
||||
provider-private options under `ProviderSessionConfig.providerOptions` on `session.open`.
|
||||
This record includes configured defaults and per-agent overrides; validate and apply it in your
|
||||
provider. See [Provider options](/docs/sdk/provider-options) for configuration and merge semantics.
|
||||
Provider options are one record, `ProviderSessionConfig.providerOptions` on `session.open`. It
|
||||
includes configured defaults and per-agent overrides; validate and apply it in your provider. Report
|
||||
`controls` in `session.config` for the top-level keys that get a toggle or select in the composer,
|
||||
with the values the session runs under `providerOptions`. A running-session change arrives as
|
||||
`session.configure` with `changes.providerOptions`. See [Provider options](/docs/sdk/provider-options)
|
||||
for configuration and merge semantics.
|
||||
Host tools arrive as MCP servers in the complete
|
||||
session config.
|
||||
|
||||
|
||||
@@ -353,13 +353,13 @@ Paseo 为服务端代码提供 `@getpaseo/plugin`、`@getpaseo/plugin/server`、
|
||||
|
||||
### Provider {#providers}
|
||||
|
||||
直接实现和 ACP 实现、会话生命周期、Composer 设置、时间线渲染器、测试和分发,见[构建 Provider 插件](/docs/plugins/providers)。
|
||||
直接实现和 ACP 实现、会话生命周期、选项控件、时间线渲染器、测试和分发,见[构建 Provider 插件](/docs/plugins/providers)。
|
||||
|
||||
使用来自 `@getpaseo/plugin/server/provider` 的 `ProviderRegistration` 调用 `server.registerProvider()`。它的连接通过 `send()` 接收输入,并通过 `onEvent()` 发出完整的状态快照。`send()` 只报告是否接受;提示词的处理结果、轮次、配置、持久化、权限和失败都是事件。
|
||||
|
||||
消息、结构化命令、引导和命令副作用都使用同一个 `session.prompt` 输入。在实时的用户时间线条目上重复 `clientMessageId`,并恰好发布一个与之匹配的 `session.prompt_result`。把 Provider 创建的子会话发布为带有 `parentSessionId` 的会话。
|
||||
|
||||
Provider 设置是 Paseo 在 Composer 中渲染的开关/选择描述符。把 Provider 私有的选项保留在 `session.open` 的 `ProviderSessionConfig.providerOptions` 中。这个记录包含配置的默认值和针对单个 Agent 的覆盖值;请在你的 Provider 中校验并应用它。配置和合并语义见 [Provider 选项](/docs/sdk/provider-options)。宿主工具以 MCP 服务器的形式出现在完整的会话配置中。
|
||||
Provider 选项是一个记录,即 `session.open` 中的 `ProviderSessionConfig.providerOptions`。它包含配置的默认值和针对单个 Agent 的覆盖值;请在你的 Provider 中校验并应用它。在 `session.config` 中为需要在 Composer 里显示开关或选择器的顶层键报告 `controls`,并在 `providerOptions` 下报告会话正在使用的值。运行中会话的修改会以 `session.configure` 的形式到达,内容在 `changes.providerOptions` 中。配置和合并语义见 [Provider 选项](/docs/sdk/provider-options)。宿主工具以 MCP 服务器的形式出现在完整的会话配置中。
|
||||
|
||||
Paseo 刷新 Agent 的方式是关闭它当前的 Provider 会话,再用当前的配置和持久化值打开它。Provider 在 `session.open` 期间重新读取外部状态。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user