@yeaft/webchat-agent 1.0.45 → 1.0.46

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "description": "Remote worker agent for Yeaft Web Code Agent — connects the native Yeaft engine, CLI providers, and workbench tools",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -12,24 +12,16 @@
12
12
  import { formatSize } from '../archive/tool-results.js';
13
13
 
14
14
  /**
15
- * Collaboration tools are mutually exclusive per Yeaft group shape:
16
- * single-VP groups use sub-agents; multi-VP groups use VP-to-VP forwarding.
17
- * Keep the policy names close to the tool registry so LLM exposure and
18
- * execution gating use the same source of truth.
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
- if (normalized === COLLAB_TOOL_POLICY.SINGLE_VP) return FORWARD_TOOL_NAMES.includes(toolName);
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 a collaboration policy hides one of
354
- * the mutually-exclusive orchestration tool families.
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 }[]}