@yeaft/webchat-agent 0.1.28 → 0.1.29

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.
@@ -6,6 +6,7 @@ import { query, Stream } from '../sdk/index.js';
6
6
  import { promises as fs } from 'fs';
7
7
  import { join } from 'path';
8
8
  import { getMessages } from '../crew-i18n.js';
9
+ import ctx from '../context.js';
9
10
 
10
11
  /** Format role label */
11
12
  function roleLabel(r) {
@@ -104,12 +105,16 @@ export async function createRoleQuery(session, roleName) {
104
105
  // cwd 设为角色目录
105
106
  const roleCwd = join(session.sharedDir, 'roles', roleName);
106
107
 
108
+ // 继承全局 MCP disallowedTools,避免不必要的 tool schema token 消耗
109
+ const globalDisallowed = ctx.CONFIG?.disallowedTools || [];
110
+
107
111
  const queryOptions = {
108
112
  cwd: roleCwd,
109
113
  permissionMode: 'bypassPermissions',
110
114
  abort: abortController.signal,
111
115
  model: role.model || undefined,
112
- appendSystemPrompt: systemPrompt
116
+ appendSystemPrompt: systemPrompt,
117
+ ...(globalDisallowed.length > 0 && { disallowedTools: globalDisallowed })
113
118
  };
114
119
 
115
120
  if (savedSessionId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "Remote agent for Yeaft WebChat — connects worker machines to the central server",
5
5
  "main": "index.js",
6
6
  "type": "module",