n8n-nodes-tembory 1.1.42 → 1.1.43

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.
package/README.md CHANGED
@@ -2,7 +2,13 @@
2
2
 
3
3
  Node de memoria operacional da Tembory para agentes de IA no n8n.
4
4
 
5
- Versao atual: `1.1.42`.
5
+ Versao atual: `1.1.43`.
6
+
7
+ ## 1.1.43
8
+
9
+ - Adiciona `toolCapture` no payload visual de `saveContext`, deixando explicito quando nenhuma execucao de tool chegou para a memoria.
10
+ - Suporta tambem `intermediate_steps` em snake case, alem de `intermediateSteps`.
11
+ - Quando `toolCallsCaptured` for `0`, o payload informa que e necessario o AI Agent entregar `intermediateSteps`, `__temboryToolCalls` ou tool messages para a memoria conseguir salvar a tool.
6
12
 
7
13
  ## 1.1.42
8
14
 
@@ -1210,9 +1210,14 @@ const extractToolCalls = (outputValues = {}) => {
1210
1210
  source: 'tool_object',
1211
1211
  });
1212
1212
  }
1213
- if (Array.isArray(obj.intermediateSteps)) {
1214
- for (let index = 0; index < obj.intermediateSteps.length; index++) {
1215
- const step = obj.intermediateSteps[index];
1213
+ const intermediateSteps = Array.isArray(obj.intermediateSteps)
1214
+ ? obj.intermediateSteps
1215
+ : Array.isArray(obj.intermediate_steps)
1216
+ ? obj.intermediate_steps
1217
+ : undefined;
1218
+ if (Array.isArray(intermediateSteps)) {
1219
+ for (let index = 0; index < intermediateSteps.length; index++) {
1220
+ const step = intermediateSteps[index];
1216
1221
  if (Array.isArray(step) && step.length >= 1) {
1217
1222
  const action = step[0] || {};
1218
1223
  push(action.tool || action.name, action.toolInput || action.input || action.args, step[1], true, {
@@ -3187,6 +3192,36 @@ const conversationTimelineFromMessagesForSideChannel = (messages = [], maxItems
3187
3192
  preview: truncate(message.content, 180),
3188
3193
  }));
3189
3194
  };
3195
+ const hasToolCaptureSignal = (output = {}) => {
3196
+ let hasIntermediateSteps = false;
3197
+ let hasExplicitToolCalls = false;
3198
+ let hasToolObject = false;
3199
+ readDeep(output || {}, (obj) => {
3200
+ if (Array.isArray(obj.intermediateSteps) || Array.isArray(obj.intermediate_steps))
3201
+ hasIntermediateSteps = true;
3202
+ if (Array.isArray(obj.__temboryToolCalls) || Array.isArray(obj.toolCalls) || Array.isArray(obj.tool_calls))
3203
+ hasExplicitToolCalls = true;
3204
+ const name = obj.tool || obj.toolName || obj.name;
3205
+ const hasInput = obj.toolInput !== undefined || obj.input !== undefined || obj.args !== undefined;
3206
+ const hasResult = obj.observation !== undefined || obj.result !== undefined || obj.output !== undefined || obj.error !== undefined;
3207
+ if (name && hasInput && hasResult)
3208
+ hasToolObject = true;
3209
+ });
3210
+ return { hasIntermediateSteps, hasExplicitToolCalls, hasToolObject };
3211
+ };
3212
+ const summarizeToolCaptureForSideChannel = (output = {}, toolCalls = []) => {
3213
+ const signals = hasToolCaptureSignal(output);
3214
+ const sources = Array.from(new Set((toolCalls || []).map((tool) => tool.source).filter(Boolean)));
3215
+ return cleanContextValue({
3216
+ status: toolCalls.length ? 'captured' : 'no_tool_payload_received',
3217
+ captured: toolCalls.length,
3218
+ sources,
3219
+ signals,
3220
+ note: toolCalls.length
3221
+ ? undefined
3222
+ : 'No tool execution data was received by memory in this saveContext call. If a tool ran, enable AI Agent Return Intermediate Steps or pass tool messages to memory.',
3223
+ });
3224
+ };
3190
3225
  const summarizeSaveContextForSideChannel = (input = {}, output = {}, chatHistory = []) => {
3191
3226
  const inputMessage = input?.input || input?.chatInput || input?.query || input?.question || input?.text || input?.message || '';
3192
3227
  const outputMessage = output?.output || output?.response || output?.text || output?.message || output?.answer || '';
@@ -3204,6 +3239,7 @@ const summarizeSaveContextForSideChannel = (input = {}, output = {}, chatHistory
3204
3239
  assistantOutput: outputMessage ? truncate(String(outputMessage), 700) : undefined,
3205
3240
  toolCallsCaptured: toolCalls.length,
3206
3241
  toolNames: toolEvents.map((tool) => tool.name).filter(Boolean),
3242
+ toolCapture: summarizeToolCaptureForSideChannel(output, toolCalls),
3207
3243
  toolLog: buildToolLogForSideChannel(toolEvents, toolCalls.length, SIDE_CHANNEL_SAVE_TOOL_EVENT_MAX),
3208
3244
  toolEvents,
3209
3245
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-tembory",
3
- "version": "1.1.42",
3
+ "version": "1.1.43",
4
4
  "description": "Tembory node for n8n AI Agents with operational memory, tool history and decision state",
5
5
  "license": "MIT",
6
6
  "homepage": "https://tembory.com",