@opentiny/next-remoter 0.3.3 → 0.4.1

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.
package/README.md CHANGED
@@ -318,7 +318,7 @@ const deepSeekConfig = {
318
318
  baseURL: 'https://api.deepseek.com',
319
319
  providerType: 'deepseek',
320
320
  model: 'deepseek-chat',
321
- maxSteps: 15
321
+ maxSteps: 30
322
322
  }
323
323
  </script>
324
324
  ```
@@ -23,15 +23,24 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
23
23
  selectedModelId: import('vue').PropType<any>;
24
24
  genUiAble: import('vue').PropType<any>;
25
25
  enabledTools: import('vue').PropType<any>;
26
+ /** 后端的代理服务器地址 */
27
+ agentRoot: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
26
31
  /** 会话 id,可选;未传时仅显示「打开对话框」,不展示扫码等菜单 */
27
32
  sessionId: {
28
33
  type: StringConstructor;
29
34
  default: undefined;
30
35
  };
31
- /** 后端的代理服务器地址 */
32
- agentRoot: {
36
+ menuItems: {
37
+ type: () => MenuItemConfig[];
38
+ };
39
+ remoteUrl: {
40
+ type: StringConstructor;
41
+ };
42
+ qrCodeUrl: {
33
43
  type: StringConstructor;
34
- default: string;
35
44
  };
36
45
  /** 系统提示词 */
37
46
  systemPrompt: {
@@ -48,15 +57,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
48
57
  type: StringConstructor;
49
58
  default: string;
50
59
  };
51
- remoteUrl: {
52
- type: StringConstructor;
53
- };
54
- menuItems: {
55
- type: () => MenuItemConfig[];
56
- };
57
- qrCodeUrl: {
58
- type: StringConstructor;
59
- };
60
60
  /** 悬浮AI图标的地址 */
61
61
  AILogoUrl: {
62
62
  type: StringConstructor;
@@ -259,6 +259,11 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
259
259
  deletePlugin: (plugin: PluginInfo) => Promise<void>;
260
260
  /** 注册内容渲染器 */
261
261
  registerContentRenderer: typeof registerContentRenderer;
262
+ /**
263
+ * 刷新已安装插件的工具列表(从 agent.mcpTools 同步到 UI)
264
+ * 适用于 builtin client 工具变化后的快速刷新,避免 remove + reload 导致的 UI 闪烁
265
+ */
266
+ refreshPluginTools(): Promise<void>;
262
267
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
263
268
  "before-ai-render": (currMessage: {
264
269
  role: string;
@@ -272,15 +277,24 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
272
277
  selectedModelId: import('vue').PropType<any>;
273
278
  genUiAble: import('vue').PropType<any>;
274
279
  enabledTools: import('vue').PropType<any>;
280
+ /** 后端的代理服务器地址 */
281
+ agentRoot: {
282
+ type: StringConstructor;
283
+ default: string;
284
+ };
275
285
  /** 会话 id,可选;未传时仅显示「打开对话框」,不展示扫码等菜单 */
276
286
  sessionId: {
277
287
  type: StringConstructor;
278
288
  default: undefined;
279
289
  };
280
- /** 后端的代理服务器地址 */
281
- agentRoot: {
290
+ menuItems: {
291
+ type: () => MenuItemConfig[];
292
+ };
293
+ remoteUrl: {
294
+ type: StringConstructor;
295
+ };
296
+ qrCodeUrl: {
282
297
  type: StringConstructor;
283
- default: string;
284
298
  };
285
299
  /** 系统提示词 */
286
300
  systemPrompt: {
@@ -297,15 +311,6 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
297
311
  type: StringConstructor;
298
312
  default: string;
299
313
  };
300
- remoteUrl: {
301
- type: StringConstructor;
302
- };
303
- menuItems: {
304
- type: () => MenuItemConfig[];
305
- };
306
- qrCodeUrl: {
307
- type: StringConstructor;
308
- };
309
314
  /** 悬浮AI图标的地址 */
310
315
  AILogoUrl: {
311
316
  type: StringConstructor;
@@ -1,17 +1,17 @@
1
1
  import { AgentModelProvider } from '@opentiny/next-sdk';
2
2
 
3
3
  /**
4
- * 检测当前浏览器是否支持内置 WebMCP(`navigator.modelContextTesting`)。
4
+ * 检测当前浏览器是否支持内置 WebMCP(`document.modelContext`)。
5
5
  */
6
6
  export declare function isBuiltinMcpSupported(): boolean;
7
7
  /**
8
- * 将浏览器内置 WebMCP(`navigator.modelContextTesting`)作为一个 MCP Server
8
+ * 将浏览器内置 WebMCP(`document.modelContext`)作为一个 MCP Server
9
9
  * 注入到 AgentModelProvider,使 AI 可以调用浏览器原生工具。
10
10
  *
11
11
  * 特点:
12
- * - 类型为 `{ type: 'builtin', client: navigator.modelContextTesting }`
13
- * - 工具列表通过 `modelContextTesting.listTools()` / `getTools()` 获取
14
- * - 工具执行通过 `modelContextTesting.executeTool(name, input)` 代理
12
+ * - 类型为 `{ type: 'builtin', client: document.modelContext }`
13
+ * - 工具列表通过 `await document.modelContext.getTools()` 获取
14
+ * - 工具执行通过 `document.modelContext.executeTool(toolObj, input)` 代理
15
15
  *
16
16
  * @param agent - AgentModelProvider 实例
17
17
  * @param serverName - MCP server 名称,默认 'mcp-server-builtin-webmcp'
@@ -12,7 +12,7 @@ export declare function usePluginSession(options: {
12
12
  * - 后续变为非空字符串时:自动升级为带二维码 / 遥控器等完整菜单
13
13
  */
14
14
  sessionId: Ref<string | undefined>;
15
- agentRoot: string;
15
+ agentRoot: Ref<string>;
16
16
  mode: string;
17
17
  qrCodeUrl?: string;
18
18
  remoteUrl?: string;
@@ -18,5 +18,5 @@ export declare function useSkillWithTools(options: UseSkillWithToolsOptions): {
18
18
  }>;
19
19
  skillPromptPart: import('vue').ComputedRef<string>;
20
20
  skillTools: import('vue').ComputedRef<import('@opentiny/next-sdk').SkillToolsSet>;
21
- skillOverviews: import('vue').ComputedRef<SkillMeta[]>;
21
+ skillOverviews: import('vue').ShallowRef<SkillMeta[], SkillMeta[]>;
22
22
  };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { default as TinyRemoter } from './components/TinyRobotChat.vue';
2
- import { useNextAgent } from './composable/useNextAgent';
3
2
 
4
3
  export * from './types/type';
5
4
  export * from './types/model-config';
6
5
  export { default as useModel } from './composable/useModel';
7
- export { TinyRemoter, useNextAgent };
6
+ export { TinyRemoter };