@glodon-aiot/bot-client-ui 3.25.1-alpha.7 → 3.26.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +20 -0
  2. package/dist/es/index.mjs +150716 -94338
  3. package/dist/lib/index.js +1107 -334
  4. package/package.json +2 -2
package/README.md CHANGED
@@ -84,6 +84,7 @@ new BotClientUI({
84
84
  | ------- | ------------- | ---- | ------ | ----------------------------------------------------------------------------------------------------------------- |
85
85
  | plugins | PluginsConfig | 否 | - | Agent 应用适用。<br/>插件列表,`pluginCode`与`functionCode`要与平台中注册的插件标识和 API 名称保持一致 |
86
86
  | mcp | McpConfig | 否 | - | Agent 应用适用。<br/>这里注册的 MCP 作用到每个会话中。<br/>如果希望特定会话才可注册 MCP,则在会话加载后动态注册。 |
87
+ | builtinPlugins | `{ localFiles?: LocalFilesConfig; localPython?: LocalPythonConfig }` | 否 | - | Agent 应用适用。<br/>工作区、命令和技能工具注册到平台插件 `builtin_tools`,不用传 `pluginCode`。开启 `localFiles` 后对话左侧出现工作区目录树,详见[本地工作文件夹接入说明](./docs/local-workspace-integration.md) |
87
88
 
88
89
  # BotClientUI 实例 API
89
90
 
@@ -94,6 +95,7 @@ new BotClientUI({
94
95
  | input | `(message:string) => void` | 填充输入框内容 |
95
96
  | send | `(text: string) => Promise<void>` | 与输入框发送同等能力:走 `beforemessagesend`、用户气泡、思考中、文件/图片。被拦截或校验失败时 Promise reject |
96
97
  | getMessageList | `(sessionId?: string) => Promise<Message[]>` | 获取历史对话列表 |
98
+ | localWorkspace | `LocalWorkspace \| undefined` | 启用 `builtinPlugins.localFiles` 后可用,用于自定义选目录入口 |
97
99
 
98
100
  # 类型定义
99
101
 
@@ -387,6 +389,24 @@ new BotClientUI({
387
389
  });
388
390
  ```
389
391
 
392
+ ## 本地工作文件夹
393
+
394
+ 开启内置插件后,Agent 可在用户授权的本地文件夹内读取、搜索、修改文件,并在端侧宿主里执行命令和技能脚本。工具注册在平台插件 `builtin_tools` 里,不用传 `pluginCode`。
395
+
396
+ ```ts
397
+ new BotClientUI({
398
+ token,
399
+ env: 'dev',
400
+ builtinPlugins: {
401
+ localFiles: { enabled: true },
402
+ // run_python 只在 host-bridge 下可用,网页选目录时不要启用
403
+ // localPython: { enabled: true },
404
+ },
405
+ });
406
+ ```
407
+
408
+ 平台注册、安全规则与已知限制见[本地工作文件夹接入说明](./docs/local-workspace-integration.md)。
409
+
390
410
  ## MCP 注册
391
411
 
392
412
  MCP Server 信息可以在[行业 AI 平台](https://copilot.glodon.com/)的【MCP 管理 - MCP 详情】中获得。