n8n-nodes-tembory 1.3.2 → 1.3.4

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,19 @@
2
2
 
3
3
  Node de memoria operacional da Tembory para agentes de IA no n8n.
4
4
 
5
- Versao atual: `1.3.2`.
5
+ Versao atual: `1.3.4`.
6
+
7
+ ## 1.3.4
8
+
9
+ - Torna a credencial `Tembory API` obrigatoria nos nodes `Tembory Memory` e `Tembory Agent Memory`.
10
+ - Bloqueia `loadMemoryVariables`, `saveContext` e execucao direta quando nao houver API key configurada.
11
+ - Remove o comportamento enganoso de fallback local silencioso sem credencial: fallback interno so pode existir depois que o node estiver autenticado.
12
+
13
+ ## 1.3.3
14
+
15
+ - Remove texto generico de trabalho como `continue according to the agent prompt...` quando a memoria nao inferiu uma acao concreta.
16
+ - Para mensagens gerais, a memoria registra conversa e contexto, mas nao inventa `currentGoal`, `currentTask` ou `nextExpectedAction`.
17
+ - Para turnos que podem exigir tool, o debug visual passa a mostrar uma orientacao objetiva: avaliar se precisa de tool e consultar `conversation_frame`, `tool_state`, `tool_history` e `action_ledger` antes de executar algo novo.
6
18
 
7
19
  ## 1.3.2
8
20
 
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertTemboryCredentials = assertTemboryCredentials;
3
4
  exports.temboryApiRequest = temboryApiRequest;
4
5
  const n8n_workflow_1 = require("n8n-workflow");
5
6
  async function getTemboryCredentials(ctx) {
@@ -13,8 +14,15 @@ async function getTemboryCredentials(ctx) {
13
14
  catch { }
14
15
  throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Credentials for Tembory are not set. Select a Tembory API credential and save the workflow.');
15
16
  }
17
+ async function assertTemboryCredentials(ctx) {
18
+ const credentials = await getTemboryCredentials(ctx);
19
+ if (!credentials || !credentials.apiKey) {
20
+ throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Tembory API credential is missing an API key. Configure a valid Tembory API credential before using this memory node.');
21
+ }
22
+ return credentials;
23
+ }
16
24
  async function temboryApiRequest(method, endpoint, body = {}, qs = {}) {
17
- const credentials = await getTemboryCredentials(this);
25
+ const credentials = await assertTemboryCredentials(this);
18
26
  const baseUrl = 'https://api.tembory.com';
19
27
  const operation = resolveGatewayOperation(method, endpoint);
20
28
  const payload = {
@@ -2054,7 +2054,7 @@ const turnBriefGuidanceForIntent = (intent = '') => {
2054
2054
  return 'May require a tool. Use prompt policy. Prior tools are evidence only; do not claim new side effects without a current required tool call.';
2055
2055
  if (intent === 'profile_update')
2056
2056
  return 'Likely stable profile data. Save useful facts and continue; call tools only when prompt requires.';
2057
- return 'Continue according to the agent prompt using conversation, tool history and operational state as read-only context.';
2057
+ return 'No specific memory action inferred for this turn; use conversation, tool history and operational state only as read-only context.';
2058
2058
  };
2059
2059
  const buildTurnBriefForAgent = ({ query = '', recentMessages = [], toolHistory = [], operationalState = {}, workingMemory = {}, decisionState = {}, diagnostics = {} }) => {
2060
2060
  const currentIntent = (decisionState || {}).current_intent || (workingMemory || {}).last_user_intent || inferUserIntent(query, recentMessages);
@@ -2182,16 +2182,16 @@ const inferUserIntent = (query = '', recentMessages = []) => {
2182
2182
  };
2183
2183
  const deriveNextExpectedAction = (intent, operationalState = {}) => {
2184
2184
  if (['affirm', 'commit_or_continue', 'tool_action_candidate', 'selection_or_slot'].includes(intent))
2185
- return 'continue according to the agent prompt using conversation_frame, tool_state, tool_history and action_ledger; do not apply domain-specific memory rules';
2185
+ return 'evaluate whether the current turn needs a tool; reuse conversation_frame, tool_state, tool_history and action_ledger before executing anything new';
2186
2186
  if (intent === 'profile_update')
2187
2187
  return 'save stable profile facts and continue the conversation';
2188
2188
  if (intent === 'conversation_recall')
2189
2189
  return 'answer directly using conversation_history_chronological/all_user_messages_chronological; do not call tools for recall-only questions';
2190
2190
  if (intent === 'operational_status_question')
2191
2191
  return 'answer status questions from tool_state, tool_history and action_ledger; do not call tools unless the agent prompt requires it';
2192
- return 'continue according to the agent prompt using retrieved context; call tools when the agent prompt or tool policy requires them';
2192
+ return undefined;
2193
2193
  };
2194
- const isGenericMemoryNextAction = (value = '') => /answer using retrieved context and avoid unnecessary tool calls|continue according to the agent prompt using retrieved context/i.test(String(value || ''));
2194
+ const isGenericMemoryNextAction = (value = '') => /answer using retrieved context and avoid unnecessary tool calls|continue according to the agent prompt using retrieved context|continue according to the agent prompt/i.test(String(value || ''));
2195
2195
  const shouldCarryPreviousGoal = (intent = '', previousGoal = '') => {
2196
2196
  if (!previousGoal || isGenericMemoryNextAction(previousGoal))
2197
2197
  return false;
@@ -4131,7 +4131,7 @@ const buildContextMessages = ({ payloadFormat, query, userId, profileFacts, work
4131
4131
  latest_tool: ((decisionState || {}).latest_tool || (operationalState || {}).last_tool || undefined),
4132
4132
  avoid_repeating_tools_unless_needed: ((decisionState || {}).avoid_repeating_tools_unless_needed || []).slice(0, 12),
4133
4133
  do_not_repeat_tools_legacy: ((decisionState || {}).do_not_repeat_tools || []).slice(0, 12),
4134
- instruction: actionDirective || workingMemory.next_expected_action || 'Continue according to the agent prompt.',
4134
+ instruction: actionDirective || workingMemory.next_expected_action || undefined,
4135
4135
  }),
4136
4136
  });
4137
4137
  const audit = {
@@ -4433,7 +4433,7 @@ class TemboryMemory {
4433
4433
  credentials: [
4434
4434
  {
4435
4435
  name: 'temboryApi',
4436
- required: false,
4436
+ required: true,
4437
4437
  },
4438
4438
  ],
4439
4439
  codex: {
@@ -4785,6 +4785,7 @@ class TemboryMemory {
4785
4785
  return { saved: false, input: inputValues, output: outputValues, toolCalls: toolContext };
4786
4786
  }
4787
4787
  async saveContextForItem(itemIndex, inputValues = {}, outputValues = {}) {
4788
+ await GenericFunctions_1.assertTemboryCredentials(this);
4788
4789
  const threadId = this.getNodeParameter('threadId', itemIndex);
4789
4790
  const project = this.getNodeParameter('project', itemIndex, '');
4790
4791
  const adv = applyOperationalPreset(readAdvancedOptions(this, itemIndex));
@@ -5281,6 +5282,7 @@ class TemboryMemory {
5281
5282
  }
5282
5283
  async loadMemoryVariablesForItem(itemIndex, inputValues = {}) {
5283
5284
  var _a, _b, _c, _d, _e, _f, _g;
5285
+ await GenericFunctions_1.assertTemboryCredentials(this);
5284
5286
  const memoryKey = resolveRuntimeMemoryKey(this, itemIndex);
5285
5287
  const requestedRetrievalMode = this.getNodeParameter('retrievalMode', itemIndex, 'basic');
5286
5288
  let payloadFormat = this.getNodeParameter('payloadFormat', itemIndex, 'structured');
@@ -5920,6 +5922,7 @@ class TemboryMemory {
5920
5922
  return { response };
5921
5923
  }
5922
5924
  async execute() {
5925
+ await GenericFunctions_1.assertTemboryCredentials(this);
5923
5926
  const items = this.getInputData();
5924
5927
  const returnData = [];
5925
5928
  const count = Math.max(items.length, 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-tembory",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
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",