n8n-nodes-tembory 1.0.49 → 1.0.51
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.
|
@@ -1444,7 +1444,12 @@ const applyOperationalPreset = (advanced = {}) => {
|
|
|
1444
1444
|
payloadFormat: 'auditJson',
|
|
1445
1445
|
},
|
|
1446
1446
|
};
|
|
1447
|
-
const
|
|
1447
|
+
const presetKey = preset === 'lab' ? 'diagnostic' : preset;
|
|
1448
|
+
const resolved = { ...(presets[presetKey] || {}), ...advanced };
|
|
1449
|
+
if (/^production/i.test(presetKey)) {
|
|
1450
|
+
resolved.compactForAgent = true;
|
|
1451
|
+
resolved.compactStateSections = true;
|
|
1452
|
+
}
|
|
1448
1453
|
if (resolved.useVectorMemory === false) {
|
|
1449
1454
|
resolved.includeRelations = false;
|
|
1450
1455
|
resolved.includeEntityTimeline = false;
|
|
@@ -2383,20 +2388,38 @@ const buildContextMessages = ({ payloadFormat, query, userId, profileFacts, work
|
|
|
2383
2388
|
const found = sections.find((section) => section.section === name);
|
|
2384
2389
|
return found ? found.value : undefined;
|
|
2385
2390
|
};
|
|
2391
|
+
const compactToolLedger = sectionValue('tool_ledger');
|
|
2392
|
+
const compactToolItems = ((compactToolLedger || {}).items || []);
|
|
2393
|
+
const hasToolLedger = Array.isArray(compactToolItems) && compactToolItems.length > 0;
|
|
2394
|
+
const focus = sectionValue('current_turn_focus') || {};
|
|
2395
|
+
const vectorFacts = sectionValue('summary');
|
|
2396
|
+
const slmSummary = sectionValue('connected_model_summary') || sectionValue('active_summary');
|
|
2397
|
+
const directive = sectionValue('action_directive');
|
|
2398
|
+
const minimalState = cleanContextValue({
|
|
2399
|
+
intent: (decisionState || {}).current_intent || workingMemory.last_user_intent,
|
|
2400
|
+
next_expected_action: directive ? undefined : workingMemory.next_expected_action,
|
|
2401
|
+
});
|
|
2386
2402
|
const compactJson = cleanContextValue({
|
|
2387
2403
|
kind: 'tembory.agent_context.v1',
|
|
2388
2404
|
instruction: includeHeader ? sectionValue('context_header') : undefined,
|
|
2389
2405
|
conversation: sectionValue('conversation_frame'),
|
|
2390
|
-
current_turn_focus:
|
|
2391
|
-
|
|
2406
|
+
current_turn_focus: cleanContextValue({
|
|
2407
|
+
current_user_request: focus.current_user_request,
|
|
2408
|
+
intent: focus.intent,
|
|
2409
|
+
instruction: focus.instruction,
|
|
2410
|
+
}),
|
|
2411
|
+
action_directive: directive ? cleanContextValue({
|
|
2412
|
+
required_tool: directive.required_tool,
|
|
2413
|
+
next_expected_action: directive.next_expected_action,
|
|
2414
|
+
instruction: directive.instruction,
|
|
2415
|
+
}) : undefined,
|
|
2392
2416
|
summary: {
|
|
2393
|
-
vector_facts:
|
|
2394
|
-
slm:
|
|
2417
|
+
vector_facts: vectorFacts,
|
|
2418
|
+
slm: hasToolLedger ? undefined : slmSummary,
|
|
2395
2419
|
},
|
|
2396
|
-
|
|
2420
|
+
state: minimalState,
|
|
2397
2421
|
profile: sectionValue('profile_facts'),
|
|
2398
|
-
tools:
|
|
2399
|
-
next_action: sectionValue('next_action'),
|
|
2422
|
+
tools: compactToolLedger,
|
|
2400
2423
|
});
|
|
2401
2424
|
const renderCompactSection = (section) => {
|
|
2402
2425
|
if (section.value === null || section.value === undefined)
|
package/package.json
CHANGED