@yeaft/webchat-agent 0.1.368 → 0.1.370
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/crew/role-query.js +6 -2
- package/package.json +1 -1
package/crew/role-query.js
CHANGED
|
@@ -149,8 +149,8 @@ async function _createRoleQueryInner(session, roleName) {
|
|
|
149
149
|
|
|
150
150
|
// 继承全局 MCP disallowedTools,避免不必要的 tool schema token 消耗
|
|
151
151
|
const globalDisallowed = ctx.CONFIG?.disallowedTools || [];
|
|
152
|
-
// Crew 角色禁用 Agent
|
|
153
|
-
const crewDisallowed = ['Agent'
|
|
152
|
+
// Crew 角色禁用 Agent 工具,强制通过 ROUTE 块协作
|
|
153
|
+
const crewDisallowed = ['Agent'];
|
|
154
154
|
const effectiveDisallowed = [...globalDisallowed, ...crewDisallowed];
|
|
155
155
|
|
|
156
156
|
const queryOptions = {
|
|
@@ -164,10 +164,14 @@ async function _createRoleQueryInner(session, roleName) {
|
|
|
164
164
|
|
|
165
165
|
// Intercept AskUserQuestion for all roles — forward to Web UI for interactive answering.
|
|
166
166
|
// Without this, non-DM roles' AskCard buttons stay disabled (no askRequestId).
|
|
167
|
+
// Also block yeaft-skills in crew mode — they inject personas/workflows that interfere with role behavior.
|
|
167
168
|
queryOptions.canCallTool = async (toolName, input, toolCtx) => {
|
|
168
169
|
if (toolName === 'AskUserQuestion') {
|
|
169
170
|
return await handleAskUserQuestion(session.id, input, toolCtx);
|
|
170
171
|
}
|
|
172
|
+
if (toolName === 'Skill' && input?.skill && input.skill.startsWith('yeaft')) {
|
|
173
|
+
throw new Error('yeaft-skills are disabled in crew mode — crew roles use ROUTE protocol instead');
|
|
174
|
+
}
|
|
171
175
|
return input;
|
|
172
176
|
};
|
|
173
177
|
|