Архитектура: протянуть shared root-frame authority в assistantService follow-up glue
This commit is contained in:
+7
-20
@@ -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)
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user