@yeaft/webchat-agent 0.1.932 → 0.1.933
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/engine.js +32 -1
- package/yeaft/web-bridge.js +11 -0
package/package.json
CHANGED
package/yeaft/engine.js
CHANGED
|
@@ -612,6 +612,7 @@ export class Engine {
|
|
|
612
612
|
* ownVpId: string|null,
|
|
613
613
|
* scopes: string[],
|
|
614
614
|
* snapshotBlock: string,
|
|
615
|
+
* residentEntries: Array<{scope:string, summary:string}>,
|
|
615
616
|
* } | null}
|
|
616
617
|
*/
|
|
617
618
|
#prepareAms(args) {
|
|
@@ -650,7 +651,7 @@ export class Engine {
|
|
|
650
651
|
vpId: ownVpId,
|
|
651
652
|
});
|
|
652
653
|
|
|
653
|
-
return { ams, groupKey, ownVpId, scopes, snapshotBlock };
|
|
654
|
+
return { ams, groupKey, ownVpId, scopes, snapshotBlock, residentEntries };
|
|
654
655
|
}
|
|
655
656
|
|
|
656
657
|
/**
|
|
@@ -1475,6 +1476,25 @@ export class Engine {
|
|
|
1475
1476
|
memoryInjection = amsContext.snapshotBlock;
|
|
1476
1477
|
}
|
|
1477
1478
|
|
|
1479
|
+
// Diagnostic payload for the Dream debug panel. The full AMS Resident
|
|
1480
|
+
// layer can include user and per-VP summaries, but the browser-facing
|
|
1481
|
+
// Dream prompt-load view only needs to prove the active group Dream
|
|
1482
|
+
// summary entered `system_prompt.memory`. Keep the payload scoped to the
|
|
1483
|
+
// exact group resident to avoid leaking unrelated resident summaries into
|
|
1484
|
+
// frontend state. The full system prompt remains visible in the existing
|
|
1485
|
+
// debug-only system-prompt panel.
|
|
1486
|
+
const activeGroupDreamScope = sessionId ? `group/${sessionId}` : null;
|
|
1487
|
+
const dreamResidentLoaded = amsContext && Array.isArray(amsContext.residentEntries)
|
|
1488
|
+
? amsContext.residentEntries
|
|
1489
|
+
.filter(e => e && e.scope === activeGroupDreamScope && e.summary)
|
|
1490
|
+
.map(e => ({
|
|
1491
|
+
scope: e.scope,
|
|
1492
|
+
summary: String(e.summary).slice(0, 4000),
|
|
1493
|
+
truncated: String(e.summary).length > 4000,
|
|
1494
|
+
source: 'resident-summary',
|
|
1495
|
+
}))
|
|
1496
|
+
: [];
|
|
1497
|
+
|
|
1478
1498
|
// ─── Active Scope (DESIGN-PROMPT §3 ④) ──────────────────────
|
|
1479
1499
|
// Structured per-turn scope summary: group + vp + envelope routing
|
|
1480
1500
|
// info. Long-form scope content lives in AMS — this block carries
|
|
@@ -1652,6 +1672,17 @@ export class Engine {
|
|
|
1652
1672
|
};
|
|
1653
1673
|
}
|
|
1654
1674
|
|
|
1675
|
+
if (dreamResidentLoaded.length > 0) {
|
|
1676
|
+
yield {
|
|
1677
|
+
type: 'dream_memory_loaded',
|
|
1678
|
+
turnId: queryTurnId,
|
|
1679
|
+
vpId: queryVpId,
|
|
1680
|
+
sessionId: sessionId || null,
|
|
1681
|
+
loadedInto: 'system_prompt.memory',
|
|
1682
|
+
resident: dreamResidentLoaded,
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1655
1686
|
const toolDefs = this.#getToolDefs();
|
|
1656
1687
|
let turnNumber = 0;
|
|
1657
1688
|
let continueTurns = 0; // auto-continue counter
|
package/yeaft/web-bridge.js
CHANGED
|
@@ -2212,6 +2212,17 @@ function handleEngineEvent(event, hctx) {
|
|
|
2212
2212
|
}, envelope);
|
|
2213
2213
|
break;
|
|
2214
2214
|
|
|
2215
|
+
case 'dream_memory_loaded':
|
|
2216
|
+
sendYeaftEvent({
|
|
2217
|
+
type: 'dream_memory_loaded',
|
|
2218
|
+
turnId: event.turnId,
|
|
2219
|
+
vpId: event.vpId || null,
|
|
2220
|
+
sessionId: event.sessionId || null,
|
|
2221
|
+
loadedInto: event.loadedInto || 'system_prompt.memory',
|
|
2222
|
+
resident: Array.isArray(event.resident) ? event.resident : [],
|
|
2223
|
+
}, envelope);
|
|
2224
|
+
break;
|
|
2225
|
+
|
|
2215
2226
|
case 'memory_adjust':
|
|
2216
2227
|
sendYeaftEvent({
|
|
2217
2228
|
type: 'memory_adjust',
|