n8n-nodes-tembory 1.0.50 → 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.
@@ -2388,20 +2388,38 @@ const buildContextMessages = ({ payloadFormat, query, userId, profileFacts, work
2388
2388
  const found = sections.find((section) => section.section === name);
2389
2389
  return found ? found.value : undefined;
2390
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
+ });
2391
2402
  const compactJson = cleanContextValue({
2392
2403
  kind: 'tembory.agent_context.v1',
2393
2404
  instruction: includeHeader ? sectionValue('context_header') : undefined,
2394
2405
  conversation: sectionValue('conversation_frame'),
2395
- current_turn_focus: sectionValue('current_turn_focus'),
2396
- action_directive: sectionValue('action_directive'),
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,
2397
2416
  summary: {
2398
- vector_facts: sectionValue('summary'),
2399
- slm: sectionValue('connected_model_summary') || sectionValue('active_summary'),
2417
+ vector_facts: vectorFacts,
2418
+ slm: hasToolLedger ? undefined : slmSummary,
2400
2419
  },
2401
- working_memory: sectionValue('working_memory'),
2420
+ state: minimalState,
2402
2421
  profile: sectionValue('profile_facts'),
2403
- tools: sectionValue('tool_ledger'),
2404
- next_action: sectionValue('next_action'),
2422
+ tools: compactToolLedger,
2405
2423
  });
2406
2424
  const renderCompactSection = (section) => {
2407
2425
  if (section.value === null || section.value === undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-tembory",
3
- "version": "1.0.50",
3
+ "version": "1.0.51",
4
4
  "description": "Tembory node for n8n AI Agents with profile, tools, timeline, graph and semantic memory",
5
5
  "license": "MIT",
6
6
  "homepage": "https://tembory.com",