@yeaft/webchat-agent 1.0.644 → 1.0.646

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.
@@ -8,6 +8,20 @@ import { yeaftAssetStore } from '../yeaft-asset-store.js';
8
8
  import { recordPerfTraceEvent } from '../perf-trace.js';
9
9
 
10
10
 
11
+ /** Keep Skill detail read-only and browser-safe, including replies from newer Agents. */
12
+ function projectPluginSkillDetail(detail) {
13
+ if (!detail || typeof detail !== 'object' || Array.isArray(detail)) return null;
14
+ const out = {};
15
+ for (const field of ['name', 'description', 'trigger', 'category', 'tier', 'content']) {
16
+ if (typeof detail[field] === 'string' || detail[field] === null) out[field] = detail[field];
17
+ }
18
+ for (const field of ['keywords', 'references', 'templates']) {
19
+ if (Array.isArray(detail[field])) out[field] = detail[field].filter(item => typeof item === 'string');
20
+ }
21
+ if (detail.contentTruncated === true) out.contentTruncated = true;
22
+ return out;
23
+ }
24
+
11
25
  // Older Dream bridges reused the ordinary debug lifecycle with a reserved
12
26
  // dream- turn id. Drop these before projection/relay, not only named Dream events.
13
27
  function isRetiredDreamEvent(event) {
@@ -903,6 +917,8 @@ export async function handleAgentOutput(agentId, agent, msg) {
903
917
  agentId,
904
918
  requestId: msg.requestId || null,
905
919
  catalog: msg.catalog || { tools: [], skills: [], mcpServers: [] },
920
+ ...(Object.prototype.hasOwnProperty.call(msg, 'skillDetail')
921
+ ? { skillDetail: projectPluginSkillDetail(msg.skillDetail) } : {}),
906
922
  error: msg.error || null,
907
923
  });
908
924
  }
@@ -1 +1 @@
1
- {"version":"1.0.644"}
1
+ {"version":"1.0.646"}