Planner Autonomy: вынести catalog chain matches в контракт
This commit is contained in:
@@ -345,6 +345,20 @@ function budgetOverrideFor(input, recipe) {
|
||||
}
|
||||
return {};
|
||||
}
|
||||
function catalogChainTemplateMatchesForContract(input, recipe) {
|
||||
const dataNeedGraph = input.dataNeedGraph ?? null;
|
||||
if (!dataNeedGraph) {
|
||||
return [];
|
||||
}
|
||||
return (0, assistantMcpCatalogIndex_1.searchAssistantMcpCatalogChainTemplatesByFactAxis)({
|
||||
business_fact_family: dataNeedGraph.business_fact_family,
|
||||
action_family: toNonEmptyString(input.turnMeaning?.asked_action_family) ?? dataNeedGraph.action_family,
|
||||
required_axes: recipe.axes,
|
||||
comparison_need: dataNeedGraph.comparison_need,
|
||||
ranking_need: dataNeedGraph.ranking_need,
|
||||
aggregation_need: dataNeedGraph.aggregation_need
|
||||
});
|
||||
}
|
||||
function routeFamilyFromThinMetadataSurfaceInput(input) {
|
||||
const surface = input.metadataSurface ?? null;
|
||||
const surfaceRouteFamily = routeFamilyFromMetadataSurfaceRef(surface);
|
||||
@@ -956,6 +970,7 @@ function planAssistantMcpDiscovery(input) {
|
||||
const semanticDataNeed = toNonEmptyString(input.semanticDataNeed) ?? recipe.semanticDataNeed;
|
||||
const dataNeedGraph = input.dataNeedGraph ?? null;
|
||||
const metadataSurface = input.metadataSurface ?? null;
|
||||
const catalogChainTemplateMatches = catalogChainTemplateMatchesForContract(input, recipe);
|
||||
const reasonCodes = [];
|
||||
pushReason(reasonCodes, recipe.reason);
|
||||
for (const reason of recipe.extraReasons ?? []) {
|
||||
@@ -1018,6 +1033,7 @@ function planAssistantMcpDiscovery(input) {
|
||||
metadata_surface_ref: metadataSurface,
|
||||
selected_chain_id: recipe.chainId,
|
||||
selected_chain_summary: recipe.chainSummary,
|
||||
catalog_chain_template_matches: catalogChainTemplateMatches,
|
||||
proposed_primitives: recipe.primitives,
|
||||
required_axes: recipe.axes,
|
||||
discovery_plan: plan,
|
||||
|
||||
Reference in New Issue
Block a user