Архитектура: протянуть shared root-frame authority в assistantService follow-up glue

This commit is contained in:
2026-04-19 09:01:28 +03:00
parent 62f9bad750
commit a71e1352be
4 changed files with 126 additions and 40 deletions
+7 -20
View File
@@ -2454,15 +2454,7 @@ function extractAddressCarryoverAnchor(addressDebug) {
anchorValue: null
};
}
return {
anchorType: toNonEmptyString(addressDebug.anchor_type),
anchorValue: toNonEmptyString(addressDebug.anchor_value_resolved) ??
toNonEmptyString(addressDebug.anchor_value_raw) ??
readAddressInventoryItemFilter(addressDebug) ??
readAddressFilterString(addressDebug, "counterparty") ??
readAddressFilterString(addressDebug, "contract") ??
readAddressFilterString(addressDebug, "account")
};
return (0, assistantContinuityPolicy_1.resolveAddressDebugAnchorContext)(addressDebug, toNonEmptyString);
}
function findRecentInventoryRootFrame(items) {
for (let index = items.length - 1; index >= 0; index -= 1) {
@@ -2474,20 +2466,15 @@ function findRecentInventoryRootFrame(items) {
if (!isAddressLaneDebugPayload(debug)) {
continue;
}
const detectedIntent = toNonEmptyString(debug.detected_intent);
if (!isInventoryRootFrameIntent(detectedIntent)) {
const rootFrame = (0, assistantContinuityPolicy_1.buildInventoryRootFrameFromAddressDebug)(debug, toNonEmptyString);
if (!rootFrame) {
continue;
}
const anchor = extractAddressCarryoverAnchor(debug);
const filtersRaw = debug.extracted_filters;
const filters = filtersRaw && typeof filtersRaw === "object"
? { ...filtersRaw }
: {};
return {
intent: detectedIntent,
filters,
anchorType: anchor.anchorType,
anchorValue: anchor.anchorValue,
intent: rootFrame.intent,
filters: { ...(rootFrame.filters ?? {}) },
anchorType: rootFrame.anchorType,
anchorValue: rootFrame.anchorValue,
messageId: toNonEmptyString(item.message_id)
};
}