@peopl-health/nexus 5.10.0-dev.1044 → 5.10.0-dev.1047

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.
@@ -207,4 +207,4 @@ class DefaultMemoryManager extends MemoryManager {
207
207
  }
208
208
  }
209
209
 
210
- module.exports = { DefaultMemoryManager };
210
+ module.exports = { DefaultMemoryManager, OPERATOR_TURN_PREFIX };
@@ -1,5 +1,6 @@
1
1
  const { Anthropic } = require('@anthropic-ai/sdk');
2
2
 
3
+ const { OPERATOR_TURN_PREFIX } = require('../memory/DefaultMemoryManager');
3
4
  const { appendCall } = require('../services/llmAuditService');
4
5
  const { composePrompt } = require('../services/promptComposerService');
5
6
  const { retryWithBackoff } = require('../../utils/retryUtils');
@@ -384,6 +385,15 @@ class AnthropicProvider extends BaseLLMProvider {
384
385
  return typeof output === 'string' ? output : JSON.stringify(output ?? '');
385
386
  }
386
387
 
388
+ // Split placement: the inline copy carries recency on single-round turns, the hoisted developer
389
+ // turn persists once tool results are appended after it on multi-round turns.
390
+ _buildInput({ additionalInstructions, ...rest }) {
391
+ const input = super._buildInput({ additionalInstructions, ...rest });
392
+ if (!additionalInstructions) return input;
393
+ const { content } = this._operatorInstructionTurn(additionalInstructions);
394
+ return [...input, { role: 'user', content: `${OPERATOR_TURN_PREFIX} ${content}`, type: 'message' }];
395
+ }
396
+
387
397
  _mapModelConfig(modelConfig) {
388
398
  const mapped = { ...(modelConfig || {}) };
389
399
  if (mapped.max_tokens == null && mapped.max_output_tokens != null) mapped.max_tokens = mapped.max_output_tokens;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "5.10.0-dev.1044",
3
+ "version": "5.10.0-dev.1047",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",