@yeaft/webchat-agent 1.0.45 → 1.0.47
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/package.json +1 -1
- package/yeaft/tools/registry.js +8 -16
package/package.json
CHANGED
package/yeaft/tools/registry.js
CHANGED
|
@@ -12,24 +12,16 @@
|
|
|
12
12
|
import { formatSize } from '../archive/tool-results.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Collaboration tools are
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* Collaboration tools are gated only where the session shape makes a tool
|
|
16
|
+
* invalid. Single-VP sessions cannot forward to peers because no peers exist.
|
|
17
|
+
* Multi-VP sessions keep the full tool surface, including background tasks and
|
|
18
|
+
* sub-agents, and additionally expose VP-to-VP forwarding.
|
|
19
19
|
*/
|
|
20
20
|
export const COLLAB_TOOL_POLICY = Object.freeze({
|
|
21
21
|
SINGLE_VP: 'single-vp',
|
|
22
22
|
MULTI_VP: 'multi-vp',
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
export const SUB_AGENT_TOOL_NAMES = Object.freeze([
|
|
26
|
-
'SpawnAgent',
|
|
27
|
-
'PromptAgent',
|
|
28
|
-
'WaitAgent',
|
|
29
|
-
'CloseAgent',
|
|
30
|
-
'ListAgents',
|
|
31
|
-
]);
|
|
32
|
-
|
|
33
25
|
export const FORWARD_TOOL_NAMES = Object.freeze(['RouteForward']);
|
|
34
26
|
|
|
35
27
|
/**
|
|
@@ -261,8 +253,7 @@ export function normalizeCollabToolPolicy(policy) {
|
|
|
261
253
|
export function isToolHiddenByCollabPolicy(toolName, policy) {
|
|
262
254
|
const normalized = normalizeCollabToolPolicy(policy);
|
|
263
255
|
if (!normalized) return false;
|
|
264
|
-
|
|
265
|
-
return SUB_AGENT_TOOL_NAMES.includes(toolName);
|
|
256
|
+
return normalized === COLLAB_TOOL_POLICY.SINGLE_VP && FORWARD_TOOL_NAMES.includes(toolName);
|
|
266
257
|
}
|
|
267
258
|
|
|
268
259
|
export class ToolRegistry {
|
|
@@ -350,8 +341,9 @@ export class ToolRegistry {
|
|
|
350
341
|
|
|
351
342
|
/**
|
|
352
343
|
* Get tool definitions for the LLM adapter.
|
|
353
|
-
* Returns all registered tools unless
|
|
354
|
-
*
|
|
344
|
+
* Returns all registered tools unless the current session shape makes a
|
|
345
|
+
* specific collaboration tool invalid, such as RouteForward in single-VP
|
|
346
|
+
* sessions.
|
|
355
347
|
* @param {string} [language='en']
|
|
356
348
|
* @param {{ collabToolPolicy?: string }} [opts]
|
|
357
349
|
* @returns {{ name: string, description: string, parameters: object }[]}
|