@memberjunction/ai-agents 4.4.0 → 5.0.0
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/dist/AgentDataPreloader.js.map +1 -1
- package/dist/AgentRunner.js +4 -4
- package/dist/AgentRunner.js.map +1 -1
- package/dist/__tests__/action-changes.test.d.ts +15 -0
- package/dist/__tests__/action-changes.test.d.ts.map +1 -0
- package/dist/__tests__/action-changes.test.js +394 -0
- package/dist/__tests__/action-changes.test.js.map +1 -0
- package/dist/__tests__/agent-memory-features.test.d.ts +123 -0
- package/dist/__tests__/agent-memory-features.test.d.ts.map +1 -0
- package/dist/__tests__/agent-memory-features.test.js +596 -0
- package/dist/__tests__/agent-memory-features.test.js.map +1 -0
- package/dist/__tests__/agent-type-prompt-params.test.d.ts +14 -0
- package/dist/__tests__/agent-type-prompt-params.test.d.ts.map +1 -0
- package/dist/__tests__/agent-type-prompt-params.test.js +583 -0
- package/dist/__tests__/agent-type-prompt-params.test.js.map +1 -0
- package/dist/__tests__/chat-handling-option.test.d.ts +54 -0
- package/dist/__tests__/chat-handling-option.test.d.ts.map +1 -0
- package/dist/__tests__/chat-handling-option.test.js +222 -0
- package/dist/__tests__/chat-handling-option.test.js.map +1 -0
- package/dist/agent-context-injector.d.ts +5 -5
- package/dist/agent-context-injector.d.ts.map +1 -1
- package/dist/agent-context-injector.js +1 -1
- package/dist/agent-context-injector.js.map +1 -1
- package/dist/agent-types/base-agent-type.d.ts +5 -5
- package/dist/agent-types/base-agent-type.d.ts.map +1 -1
- package/dist/agent-types/base-agent-type.js +2 -2
- package/dist/agent-types/base-agent-type.js.map +1 -1
- package/dist/agent-types/flow-agent-type.d.ts +3 -3
- package/dist/agent-types/flow-agent-type.d.ts.map +1 -1
- package/dist/agent-types/flow-agent-type.js.map +1 -1
- package/dist/base-agent.d.ts +12 -12
- package/dist/base-agent.d.ts.map +1 -1
- package/dist/base-agent.js +10 -5
- package/dist/base-agent.js.map +1 -1
- package/dist/memory-cleanup-agent.js +4 -4
- package/dist/memory-cleanup-agent.js.map +1 -1
- package/dist/memory-manager-agent.js +4 -4
- package/dist/memory-manager-agent.js.map +1 -1
- package/dist/services/AgentEmbeddingService.d.ts +16 -0
- package/dist/services/AgentEmbeddingService.d.ts.map +1 -0
- package/dist/services/AgentEmbeddingService.js +158 -0
- package/dist/services/AgentEmbeddingService.js.map +1 -0
- package/dist/types/AgentMatchResult.d.ts +18 -0
- package/dist/types/AgentMatchResult.d.ts.map +1 -0
- package/dist/types/AgentMatchResult.js +3 -0
- package/dist/types/AgentMatchResult.js.map +1 -0
- package/package.json +12 -12
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for Agent Memory Features (Phase 1-3 improvements).
|
|
3
|
+
*
|
|
4
|
+
* These tests verify:
|
|
5
|
+
* - PayloadFeedbackManager functionality
|
|
6
|
+
* - AgentContextInjector formatting with precedence instructions
|
|
7
|
+
* - Multi-tenant scope determination
|
|
8
|
+
*
|
|
9
|
+
* To run these tests:
|
|
10
|
+
* npx ts-node src/__tests__/agent-memory-features.test.ts
|
|
11
|
+
*
|
|
12
|
+
* @since 2.130.0
|
|
13
|
+
*/
|
|
14
|
+
// ============================================================================
|
|
15
|
+
// Test Helpers - Standalone implementations for testing
|
|
16
|
+
// ============================================================================
|
|
17
|
+
/**
|
|
18
|
+
* Determine MJ scope description for a note (mirrors AgentContextInjector)
|
|
19
|
+
*/
|
|
20
|
+
function determineNoteScope(note) {
|
|
21
|
+
if (note.AgentID && note.UserID && note.CompanyID) {
|
|
22
|
+
return 'Agent + User + Company specific';
|
|
23
|
+
}
|
|
24
|
+
if (note.AgentID && note.UserID) {
|
|
25
|
+
return 'Agent + User specific';
|
|
26
|
+
}
|
|
27
|
+
if (note.AgentID && note.CompanyID) {
|
|
28
|
+
return 'Agent + Company specific';
|
|
29
|
+
}
|
|
30
|
+
if (note.UserID && note.CompanyID) {
|
|
31
|
+
return 'User + Company specific';
|
|
32
|
+
}
|
|
33
|
+
if (note.AgentID) {
|
|
34
|
+
return 'Agent-specific';
|
|
35
|
+
}
|
|
36
|
+
if (note.UserID) {
|
|
37
|
+
return 'User-specific';
|
|
38
|
+
}
|
|
39
|
+
if (note.CompanyID) {
|
|
40
|
+
return 'Company-wide';
|
|
41
|
+
}
|
|
42
|
+
return 'Global';
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Determine secondary scope description for a note (multi-tenant feature)
|
|
46
|
+
*/
|
|
47
|
+
function determineSecondaryScope(note) {
|
|
48
|
+
if (!note.PrimaryScopeRecordID) {
|
|
49
|
+
return null; // No secondary scope
|
|
50
|
+
}
|
|
51
|
+
const hasSecondary = note.SecondaryScopes && note.SecondaryScopes !== '{}';
|
|
52
|
+
if (hasSecondary) {
|
|
53
|
+
return 'User-specific (most specific)';
|
|
54
|
+
}
|
|
55
|
+
return 'Company-level';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Format notes for injection with optional memory policy (mirrors AgentContextInjector)
|
|
59
|
+
*/
|
|
60
|
+
function formatNotesForInjection(notes, includeMemoryPolicy = true) {
|
|
61
|
+
if (notes.length === 0)
|
|
62
|
+
return '';
|
|
63
|
+
const lines = [];
|
|
64
|
+
if (includeMemoryPolicy) {
|
|
65
|
+
lines.push('<memory_policy>');
|
|
66
|
+
lines.push('Precedence (highest to lowest):');
|
|
67
|
+
lines.push('1) Current user message overrides all stored memory');
|
|
68
|
+
lines.push('2) User-specific notes override company-level');
|
|
69
|
+
lines.push('3) Company notes override global defaults');
|
|
70
|
+
lines.push('4) When same scope, prefer most recent by date');
|
|
71
|
+
lines.push('');
|
|
72
|
+
lines.push('Conflict resolution:');
|
|
73
|
+
lines.push('- If two notes contradict, prefer the more specific scope');
|
|
74
|
+
lines.push('- Ask clarifying question only if conflict materially affects response');
|
|
75
|
+
lines.push('</memory_policy>');
|
|
76
|
+
lines.push('');
|
|
77
|
+
}
|
|
78
|
+
lines.push(`📝 AGENT NOTES (${notes.length})`);
|
|
79
|
+
lines.push('');
|
|
80
|
+
for (const note of notes) {
|
|
81
|
+
lines.push(`[${note.Type}] ${note.Note}`);
|
|
82
|
+
const scope = determineNoteScope(note);
|
|
83
|
+
const secondaryScope = determineSecondaryScope(note);
|
|
84
|
+
if (secondaryScope) {
|
|
85
|
+
lines.push(` Scope: ${secondaryScope}`);
|
|
86
|
+
}
|
|
87
|
+
else if (scope) {
|
|
88
|
+
lines.push(` Scope: ${scope}`);
|
|
89
|
+
}
|
|
90
|
+
lines.push('');
|
|
91
|
+
}
|
|
92
|
+
lines.push('---');
|
|
93
|
+
return lines.join('\n');
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Generate feedback questions from warnings (mirrors PayloadFeedbackManager)
|
|
97
|
+
*/
|
|
98
|
+
function generateQuestions(warnings) {
|
|
99
|
+
const questions = [];
|
|
100
|
+
const feedbackWarnings = warnings.filter(w => w.requiresFeedback);
|
|
101
|
+
for (let i = 0; i < feedbackWarnings.length; i++) {
|
|
102
|
+
const warning = feedbackWarnings[i];
|
|
103
|
+
let question = '';
|
|
104
|
+
switch (warning.type) {
|
|
105
|
+
case 'content_truncation':
|
|
106
|
+
const truncDetails = warning.details;
|
|
107
|
+
question = `Did you intend to reduce the content at "${warning.path}" from ${truncDetails.originalLength} to ${truncDetails.newLength} characters (${truncDetails.reductionPercentage.toFixed(1)}% reduction)?`;
|
|
108
|
+
break;
|
|
109
|
+
case 'key_removal':
|
|
110
|
+
const removalDetails = warning.details;
|
|
111
|
+
question = `Did you intend to remove the non-empty key(s) at "${warning.path}": ${removalDetails.removedKeys.join(', ')}?`;
|
|
112
|
+
break;
|
|
113
|
+
case 'type_change':
|
|
114
|
+
const typeDetails = warning.details;
|
|
115
|
+
question = `Did you intend to change the type at "${warning.path}" from ${typeDetails.originalType} to ${typeDetails.newType}?`;
|
|
116
|
+
break;
|
|
117
|
+
case 'pattern_anomaly':
|
|
118
|
+
question = `Did you intend the following change at "${warning.path}": ${warning.message}?`;
|
|
119
|
+
break;
|
|
120
|
+
default:
|
|
121
|
+
question = `Did you intend the change at "${warning.path}": ${warning.message}?`;
|
|
122
|
+
}
|
|
123
|
+
questions.push({
|
|
124
|
+
id: `feedback_${i}_${Date.now()}`,
|
|
125
|
+
question,
|
|
126
|
+
warning,
|
|
127
|
+
context: {
|
|
128
|
+
path: warning.path,
|
|
129
|
+
changeType: warning.type,
|
|
130
|
+
details: warning.details
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
return questions;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Map LLM responses to feedback format (mirrors PayloadFeedbackManager)
|
|
138
|
+
*/
|
|
139
|
+
function mapLLMResponsesToFeedback(questions, llmResponses) {
|
|
140
|
+
return questions.map((q, index) => {
|
|
141
|
+
const questionNumber = index + 1;
|
|
142
|
+
const llmResponse = llmResponses.find(r => r.questionNumber === questionNumber);
|
|
143
|
+
if (llmResponse) {
|
|
144
|
+
return {
|
|
145
|
+
questionId: q.id,
|
|
146
|
+
intended: llmResponse.intended,
|
|
147
|
+
explanation: llmResponse.explanation
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
questionId: q.id,
|
|
152
|
+
intended: true,
|
|
153
|
+
explanation: 'No explicit response from LLM - assuming intended'
|
|
154
|
+
};
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
// ============================================================================
|
|
158
|
+
// Test Data
|
|
159
|
+
// ============================================================================
|
|
160
|
+
const mockNotes = [
|
|
161
|
+
{
|
|
162
|
+
ID: 'note-1',
|
|
163
|
+
Type: 'Preference',
|
|
164
|
+
Note: 'User prefers bullet points',
|
|
165
|
+
AgentID: 'agent-1',
|
|
166
|
+
UserID: 'user-1',
|
|
167
|
+
CompanyID: null,
|
|
168
|
+
PrimaryScopeRecordID: null,
|
|
169
|
+
SecondaryScopes: null
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
ID: 'note-2',
|
|
173
|
+
Type: 'Context',
|
|
174
|
+
Note: 'Company uses metric units',
|
|
175
|
+
AgentID: null,
|
|
176
|
+
UserID: null,
|
|
177
|
+
CompanyID: 'company-1',
|
|
178
|
+
PrimaryScopeRecordID: 'org-123',
|
|
179
|
+
SecondaryScopes: null
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
ID: 'note-3',
|
|
183
|
+
Type: 'Constraint',
|
|
184
|
+
Note: 'Never share PII',
|
|
185
|
+
AgentID: null,
|
|
186
|
+
UserID: null,
|
|
187
|
+
CompanyID: null,
|
|
188
|
+
PrimaryScopeRecordID: null,
|
|
189
|
+
SecondaryScopes: null
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
ID: 'note-4',
|
|
193
|
+
Type: 'Preference',
|
|
194
|
+
Note: 'John prefers formal tone',
|
|
195
|
+
AgentID: 'agent-1',
|
|
196
|
+
UserID: null,
|
|
197
|
+
CompanyID: null,
|
|
198
|
+
PrimaryScopeRecordID: 'org-123',
|
|
199
|
+
SecondaryScopes: '{"ContactID": "contact-456"}'
|
|
200
|
+
}
|
|
201
|
+
];
|
|
202
|
+
const mockWarnings = [
|
|
203
|
+
{
|
|
204
|
+
type: 'content_truncation',
|
|
205
|
+
path: 'response.body',
|
|
206
|
+
message: 'Content was significantly reduced',
|
|
207
|
+
severity: 'high',
|
|
208
|
+
details: { originalLength: 1000, newLength: 100, reductionPercentage: 90 },
|
|
209
|
+
requiresFeedback: true
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
type: 'key_removal',
|
|
213
|
+
path: 'data.metadata',
|
|
214
|
+
message: 'Keys were removed',
|
|
215
|
+
severity: 'medium',
|
|
216
|
+
details: { removedKeys: ['timestamp', 'version'] },
|
|
217
|
+
requiresFeedback: true
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
type: 'type_change',
|
|
221
|
+
path: 'config.enabled',
|
|
222
|
+
message: 'Type changed',
|
|
223
|
+
severity: 'low',
|
|
224
|
+
details: { originalType: 'boolean', newType: 'string' },
|
|
225
|
+
requiresFeedback: false // Should be filtered out
|
|
226
|
+
}
|
|
227
|
+
];
|
|
228
|
+
// ============================================================================
|
|
229
|
+
// Tests
|
|
230
|
+
// ============================================================================
|
|
231
|
+
let testsPassed = 0;
|
|
232
|
+
let testsFailed = 0;
|
|
233
|
+
function runTest(name, fn) {
|
|
234
|
+
try {
|
|
235
|
+
fn();
|
|
236
|
+
console.log(`✅ ${name}`);
|
|
237
|
+
testsPassed++;
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
console.error(`❌ ${name}`);
|
|
241
|
+
console.error(` Error: ${error instanceof Error ? error.message : error}`);
|
|
242
|
+
testsFailed++;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function assertEqual(actual, expected, message) {
|
|
246
|
+
if (actual !== expected) {
|
|
247
|
+
throw new Error(`${message || 'Assertion failed'}: expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function assertTrue(condition, message) {
|
|
251
|
+
if (!condition) {
|
|
252
|
+
throw new Error(message || 'Expected condition to be true');
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function assertContains(str, substring, message) {
|
|
256
|
+
if (!str.includes(substring)) {
|
|
257
|
+
throw new Error(`${message || 'String does not contain expected substring'}: "${substring}"`);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
console.log('\n=== Agent Memory Features Tests ===\n');
|
|
261
|
+
// ============================================================================
|
|
262
|
+
// Scope Determination Tests
|
|
263
|
+
// ============================================================================
|
|
264
|
+
console.log('--- Scope Determination Tests ---\n');
|
|
265
|
+
runTest('determineNoteScope: Agent + User specific', () => {
|
|
266
|
+
const note = mockNotes[0]; // has AgentID and UserID
|
|
267
|
+
const scope = determineNoteScope(note);
|
|
268
|
+
assertEqual(scope, 'Agent + User specific');
|
|
269
|
+
});
|
|
270
|
+
runTest('determineNoteScope: Company-wide', () => {
|
|
271
|
+
const note = mockNotes[1]; // has only CompanyID
|
|
272
|
+
const scope = determineNoteScope(note);
|
|
273
|
+
assertEqual(scope, 'Company-wide');
|
|
274
|
+
});
|
|
275
|
+
runTest('determineNoteScope: Global (all null)', () => {
|
|
276
|
+
const note = mockNotes[2]; // all nulls
|
|
277
|
+
const scope = determineNoteScope(note);
|
|
278
|
+
assertEqual(scope, 'Global');
|
|
279
|
+
});
|
|
280
|
+
runTest('determineSecondaryScope: Company-level (primary scope only)', () => {
|
|
281
|
+
const note = mockNotes[1]; // has PrimaryScopeRecordID but no SecondaryScopes
|
|
282
|
+
const scope = determineSecondaryScope(note);
|
|
283
|
+
assertEqual(scope, 'Company-level');
|
|
284
|
+
});
|
|
285
|
+
runTest('determineSecondaryScope: User-specific (has secondary scopes)', () => {
|
|
286
|
+
const note = mockNotes[3]; // has both primary and secondary scopes
|
|
287
|
+
const scope = determineSecondaryScope(note);
|
|
288
|
+
assertEqual(scope, 'User-specific (most specific)');
|
|
289
|
+
});
|
|
290
|
+
runTest('determineSecondaryScope: null when no secondary scope', () => {
|
|
291
|
+
const note = mockNotes[0]; // no PrimaryScopeRecordID
|
|
292
|
+
const scope = determineSecondaryScope(note);
|
|
293
|
+
assertEqual(scope, null);
|
|
294
|
+
});
|
|
295
|
+
// ============================================================================
|
|
296
|
+
// Format Notes with Precedence Tests
|
|
297
|
+
// ============================================================================
|
|
298
|
+
console.log('\n--- Format Notes Tests ---\n');
|
|
299
|
+
runTest('formatNotesForInjection: includes memory policy by default', () => {
|
|
300
|
+
const result = formatNotesForInjection(mockNotes);
|
|
301
|
+
assertContains(result, '<memory_policy>');
|
|
302
|
+
assertContains(result, 'Precedence (highest to lowest)');
|
|
303
|
+
assertContains(result, 'User-specific notes override company-level');
|
|
304
|
+
assertContains(result, '</memory_policy>');
|
|
305
|
+
});
|
|
306
|
+
runTest('formatNotesForInjection: excludes memory policy when disabled', () => {
|
|
307
|
+
const result = formatNotesForInjection(mockNotes, false);
|
|
308
|
+
assertTrue(!result.includes('<memory_policy>'), 'Should not contain memory_policy');
|
|
309
|
+
});
|
|
310
|
+
runTest('formatNotesForInjection: includes note count', () => {
|
|
311
|
+
const result = formatNotesForInjection(mockNotes);
|
|
312
|
+
assertContains(result, `📝 AGENT NOTES (${mockNotes.length})`);
|
|
313
|
+
});
|
|
314
|
+
runTest('formatNotesForInjection: includes note types and content', () => {
|
|
315
|
+
const result = formatNotesForInjection(mockNotes);
|
|
316
|
+
assertContains(result, '[Preference] User prefers bullet points');
|
|
317
|
+
assertContains(result, '[Context] Company uses metric units');
|
|
318
|
+
assertContains(result, '[Constraint] Never share PII');
|
|
319
|
+
});
|
|
320
|
+
runTest('formatNotesForInjection: shows secondary scope when available', () => {
|
|
321
|
+
const result = formatNotesForInjection(mockNotes);
|
|
322
|
+
assertContains(result, 'Company-level');
|
|
323
|
+
assertContains(result, 'User-specific (most specific)');
|
|
324
|
+
});
|
|
325
|
+
runTest('formatNotesForInjection: returns empty string for empty notes', () => {
|
|
326
|
+
const result = formatNotesForInjection([]);
|
|
327
|
+
assertEqual(result, '');
|
|
328
|
+
});
|
|
329
|
+
// ============================================================================
|
|
330
|
+
// Feedback Question Generation Tests
|
|
331
|
+
// ============================================================================
|
|
332
|
+
console.log('\n--- Feedback Question Tests ---\n');
|
|
333
|
+
runTest('generateQuestions: filters out non-feedback warnings', () => {
|
|
334
|
+
const questions = generateQuestions(mockWarnings);
|
|
335
|
+
assertEqual(questions.length, 2, 'Should only include warnings with requiresFeedback=true');
|
|
336
|
+
});
|
|
337
|
+
runTest('generateQuestions: formats content_truncation correctly', () => {
|
|
338
|
+
const questions = generateQuestions(mockWarnings);
|
|
339
|
+
const truncQuestion = questions[0];
|
|
340
|
+
assertContains(truncQuestion.question, 'reduce the content');
|
|
341
|
+
assertContains(truncQuestion.question, '1000 to 100');
|
|
342
|
+
assertContains(truncQuestion.question, '90.0%');
|
|
343
|
+
});
|
|
344
|
+
runTest('generateQuestions: formats key_removal correctly', () => {
|
|
345
|
+
const questions = generateQuestions(mockWarnings);
|
|
346
|
+
const removalQuestion = questions[1];
|
|
347
|
+
assertContains(removalQuestion.question, 'remove the non-empty key(s)');
|
|
348
|
+
assertContains(removalQuestion.question, 'timestamp');
|
|
349
|
+
assertContains(removalQuestion.question, 'version');
|
|
350
|
+
});
|
|
351
|
+
runTest('generateQuestions: includes context with path and type', () => {
|
|
352
|
+
const questions = generateQuestions(mockWarnings);
|
|
353
|
+
const question = questions[0];
|
|
354
|
+
assertTrue(question.context !== undefined, 'Should have context');
|
|
355
|
+
assertEqual(question.context?.path, 'response.body');
|
|
356
|
+
assertEqual(question.context?.changeType, 'content_truncation');
|
|
357
|
+
});
|
|
358
|
+
// ============================================================================
|
|
359
|
+
// LLM Response Mapping Tests
|
|
360
|
+
// ============================================================================
|
|
361
|
+
console.log('\n--- LLM Response Mapping Tests ---\n');
|
|
362
|
+
runTest('mapLLMResponsesToFeedback: maps responses correctly', () => {
|
|
363
|
+
const questions = generateQuestions(mockWarnings);
|
|
364
|
+
const llmResponses = [
|
|
365
|
+
{ questionNumber: 1, intended: false, explanation: 'This was a mistake' },
|
|
366
|
+
{ questionNumber: 2, intended: true, explanation: 'Intended cleanup' }
|
|
367
|
+
];
|
|
368
|
+
const result = mapLLMResponsesToFeedback(questions, llmResponses);
|
|
369
|
+
assertEqual(result.length, 2);
|
|
370
|
+
assertEqual(result[0].intended, false);
|
|
371
|
+
assertEqual(result[0].explanation, 'This was a mistake');
|
|
372
|
+
assertEqual(result[1].intended, true);
|
|
373
|
+
});
|
|
374
|
+
runTest('mapLLMResponsesToFeedback: defaults to intended when no response', () => {
|
|
375
|
+
const questions = generateQuestions(mockWarnings);
|
|
376
|
+
const llmResponses = [];
|
|
377
|
+
const result = mapLLMResponsesToFeedback(questions, llmResponses);
|
|
378
|
+
assertTrue(result.every(r => r.intended === true), 'All should default to intended');
|
|
379
|
+
assertContains(result[0].explanation || '', 'No explicit response');
|
|
380
|
+
});
|
|
381
|
+
// ============================================================================
|
|
382
|
+
// Memory Cleanup Agent Tests
|
|
383
|
+
// ============================================================================
|
|
384
|
+
console.log('\n--- Memory Cleanup Agent Tests ---\n');
|
|
385
|
+
/**
|
|
386
|
+
* Calculate cutoff date for retention (mirrors MemoryCleanupAgent)
|
|
387
|
+
*/
|
|
388
|
+
function getCutoffDate(retentionDays) {
|
|
389
|
+
const cutoff = new Date();
|
|
390
|
+
cutoff.setDate(cutoff.getDate() - retentionDays);
|
|
391
|
+
return cutoff.toISOString();
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Get note retention days with default (mirrors MemoryCleanupAgent)
|
|
395
|
+
*/
|
|
396
|
+
function getNoteRetentionDays(agent) {
|
|
397
|
+
const DEFAULT_NOTE_RETENTION_DAYS = 90;
|
|
398
|
+
if (typeof agent.NoteRetentionDays === 'number' && agent.NoteRetentionDays > 0) {
|
|
399
|
+
return agent.NoteRetentionDays;
|
|
400
|
+
}
|
|
401
|
+
return DEFAULT_NOTE_RETENTION_DAYS;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Get example retention days with default (mirrors MemoryCleanupAgent)
|
|
405
|
+
*/
|
|
406
|
+
function getExampleRetentionDays(agent) {
|
|
407
|
+
const DEFAULT_EXAMPLE_RETENTION_DAYS = 180;
|
|
408
|
+
if (typeof agent.ExampleRetentionDays === 'number' && agent.ExampleRetentionDays > 0) {
|
|
409
|
+
return agent.ExampleRetentionDays;
|
|
410
|
+
}
|
|
411
|
+
return DEFAULT_EXAMPLE_RETENTION_DAYS;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Check if auto-archive is enabled (mirrors MemoryCleanupAgent)
|
|
415
|
+
*/
|
|
416
|
+
function getAutoArchiveEnabled(agent) {
|
|
417
|
+
return agent.AutoArchiveEnabled !== false;
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Build cleanup summary message (mirrors MemoryCleanupAgent)
|
|
421
|
+
*/
|
|
422
|
+
function buildCleanupSummary(result) {
|
|
423
|
+
const parts = [];
|
|
424
|
+
if (result.notesArchived > 0) {
|
|
425
|
+
parts.push(`${result.notesArchived} stale notes archived`);
|
|
426
|
+
}
|
|
427
|
+
if (result.examplesArchived > 0) {
|
|
428
|
+
parts.push(`${result.examplesArchived} stale examples archived`);
|
|
429
|
+
}
|
|
430
|
+
if (result.notesExpired > 0) {
|
|
431
|
+
parts.push(`${result.notesExpired} expired notes archived`);
|
|
432
|
+
}
|
|
433
|
+
if (result.examplesExpired > 0) {
|
|
434
|
+
parts.push(`${result.examplesExpired} expired examples archived`);
|
|
435
|
+
}
|
|
436
|
+
if (parts.length === 0) {
|
|
437
|
+
parts.push('No items needed archiving');
|
|
438
|
+
}
|
|
439
|
+
if (result.errors.length > 0) {
|
|
440
|
+
parts.push(`${result.errors.length} errors encountered`);
|
|
441
|
+
}
|
|
442
|
+
return parts.join(', ');
|
|
443
|
+
}
|
|
444
|
+
runTest('getCutoffDate: calculates correct date for 90 days', () => {
|
|
445
|
+
const now = new Date();
|
|
446
|
+
const cutoffStr = getCutoffDate(90);
|
|
447
|
+
const cutoffDate = new Date(cutoffStr);
|
|
448
|
+
// Should be approximately 90 days ago (allow 1 second tolerance)
|
|
449
|
+
const expectedDate = new Date(now);
|
|
450
|
+
expectedDate.setDate(expectedDate.getDate() - 90);
|
|
451
|
+
const diff = Math.abs(cutoffDate.getTime() - expectedDate.getTime());
|
|
452
|
+
assertTrue(diff < 1000, 'Cutoff date should be approximately 90 days ago');
|
|
453
|
+
});
|
|
454
|
+
runTest('getNoteRetentionDays: returns agent value when set', () => {
|
|
455
|
+
const agent = { NoteRetentionDays: 60 };
|
|
456
|
+
assertEqual(getNoteRetentionDays(agent), 60);
|
|
457
|
+
});
|
|
458
|
+
runTest('getNoteRetentionDays: returns default when null', () => {
|
|
459
|
+
const agent = { NoteRetentionDays: null };
|
|
460
|
+
assertEqual(getNoteRetentionDays(agent), 90);
|
|
461
|
+
});
|
|
462
|
+
runTest('getNoteRetentionDays: returns default when not set', () => {
|
|
463
|
+
const agent = {};
|
|
464
|
+
assertEqual(getNoteRetentionDays(agent), 90);
|
|
465
|
+
});
|
|
466
|
+
runTest('getExampleRetentionDays: returns agent value when set', () => {
|
|
467
|
+
const agent = { ExampleRetentionDays: 120 };
|
|
468
|
+
assertEqual(getExampleRetentionDays(agent), 120);
|
|
469
|
+
});
|
|
470
|
+
runTest('getExampleRetentionDays: returns default when not set', () => {
|
|
471
|
+
const agent = {};
|
|
472
|
+
assertEqual(getExampleRetentionDays(agent), 180);
|
|
473
|
+
});
|
|
474
|
+
runTest('getAutoArchiveEnabled: returns true by default', () => {
|
|
475
|
+
const agent = {};
|
|
476
|
+
assertEqual(getAutoArchiveEnabled(agent), true);
|
|
477
|
+
});
|
|
478
|
+
runTest('getAutoArchiveEnabled: returns false when explicitly disabled', () => {
|
|
479
|
+
const agent = { AutoArchiveEnabled: false };
|
|
480
|
+
assertEqual(getAutoArchiveEnabled(agent), false);
|
|
481
|
+
});
|
|
482
|
+
runTest('getAutoArchiveEnabled: returns true when explicitly enabled', () => {
|
|
483
|
+
const agent = { AutoArchiveEnabled: true };
|
|
484
|
+
assertEqual(getAutoArchiveEnabled(agent), true);
|
|
485
|
+
});
|
|
486
|
+
runTest('buildCleanupSummary: reports stale notes', () => {
|
|
487
|
+
const result = { notesArchived: 5, examplesArchived: 0, notesExpired: 0, examplesExpired: 0, errors: [] };
|
|
488
|
+
const summary = buildCleanupSummary(result);
|
|
489
|
+
assertContains(summary, '5 stale notes archived');
|
|
490
|
+
});
|
|
491
|
+
runTest('buildCleanupSummary: reports expired items', () => {
|
|
492
|
+
const result = { notesArchived: 0, examplesArchived: 0, notesExpired: 2, examplesExpired: 3, errors: [] };
|
|
493
|
+
const summary = buildCleanupSummary(result);
|
|
494
|
+
assertContains(summary, '2 expired notes archived');
|
|
495
|
+
assertContains(summary, '3 expired examples archived');
|
|
496
|
+
});
|
|
497
|
+
runTest('buildCleanupSummary: reports errors', () => {
|
|
498
|
+
const result = { notesArchived: 1, examplesArchived: 0, notesExpired: 0, examplesExpired: 0, errors: ['error1', 'error2'] };
|
|
499
|
+
const summary = buildCleanupSummary(result);
|
|
500
|
+
assertContains(summary, '2 errors encountered');
|
|
501
|
+
});
|
|
502
|
+
runTest('buildCleanupSummary: reports nothing needed when all zero', () => {
|
|
503
|
+
const result = { notesArchived: 0, examplesArchived: 0, notesExpired: 0, examplesExpired: 0, errors: [] };
|
|
504
|
+
const summary = buildCleanupSummary(result);
|
|
505
|
+
assertEqual(summary, 'No items needed archiving');
|
|
506
|
+
});
|
|
507
|
+
// ============================================================================
|
|
508
|
+
// Extraction Guardrails Tests
|
|
509
|
+
// ============================================================================
|
|
510
|
+
console.log('\n--- Extraction Guardrails Tests ---\n');
|
|
511
|
+
/**
|
|
512
|
+
* Check if content contains ephemeral phrases (should not be stored)
|
|
513
|
+
*/
|
|
514
|
+
function containsEphemeralPhrase(content) {
|
|
515
|
+
const ephemeralPatterns = [
|
|
516
|
+
/this time/i,
|
|
517
|
+
/just for now/i,
|
|
518
|
+
/today only/i,
|
|
519
|
+
/for this call/i,
|
|
520
|
+
/temporarily/i,
|
|
521
|
+
/one-time/i,
|
|
522
|
+
/exception/i,
|
|
523
|
+
/just once/i
|
|
524
|
+
];
|
|
525
|
+
return ephemeralPatterns.some(pattern => pattern.test(content));
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Check if content contains durable phrases (should be stored at org/global scope)
|
|
529
|
+
*/
|
|
530
|
+
function containsDurablePhrase(content) {
|
|
531
|
+
const durablePatterns = [
|
|
532
|
+
/always/i,
|
|
533
|
+
/never/i,
|
|
534
|
+
/company policy/i,
|
|
535
|
+
/all customers/i,
|
|
536
|
+
/standard practice/i,
|
|
537
|
+
/we typically/i,
|
|
538
|
+
/our preference/i,
|
|
539
|
+
/every time/i,
|
|
540
|
+
/by default/i,
|
|
541
|
+
/as a rule/i
|
|
542
|
+
];
|
|
543
|
+
return durablePatterns.some(pattern => pattern.test(content));
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Check if content contains PII that should not be extracted
|
|
547
|
+
*/
|
|
548
|
+
function containsPII(content) {
|
|
549
|
+
const piiPatterns = [
|
|
550
|
+
/\b\d{3}-\d{2}-\d{4}\b/, // SSN pattern
|
|
551
|
+
/\b\d{16}\b/, // Credit card
|
|
552
|
+
/password[:\s]+\S+/i, // Password mention
|
|
553
|
+
/\bssn\b/i, // SSN mention
|
|
554
|
+
/passport\s*#?\s*\d+/i // Passport
|
|
555
|
+
];
|
|
556
|
+
return piiPatterns.some(pattern => pattern.test(content));
|
|
557
|
+
}
|
|
558
|
+
runTest('containsEphemeralPhrase: detects "just for now"', () => {
|
|
559
|
+
assertTrue(containsEphemeralPhrase('Just for now, use bullet points'));
|
|
560
|
+
});
|
|
561
|
+
runTest('containsEphemeralPhrase: detects "this time"', () => {
|
|
562
|
+
assertTrue(containsEphemeralPhrase('This time I want a shorter response'));
|
|
563
|
+
});
|
|
564
|
+
runTest('containsEphemeralPhrase: returns false for durable content', () => {
|
|
565
|
+
assertTrue(!containsEphemeralPhrase('We always use metric units'));
|
|
566
|
+
});
|
|
567
|
+
runTest('containsDurablePhrase: detects "always"', () => {
|
|
568
|
+
assertTrue(containsDurablePhrase('We always use formal tone'));
|
|
569
|
+
});
|
|
570
|
+
runTest('containsDurablePhrase: detects "company policy"', () => {
|
|
571
|
+
assertTrue(containsDurablePhrase('Company policy requires approval'));
|
|
572
|
+
});
|
|
573
|
+
runTest('containsDurablePhrase: returns false for ephemeral content', () => {
|
|
574
|
+
assertTrue(!containsDurablePhrase('Just this once, skip the greeting'));
|
|
575
|
+
});
|
|
576
|
+
runTest('containsPII: detects SSN pattern', () => {
|
|
577
|
+
assertTrue(containsPII('My SSN is 123-45-6789'));
|
|
578
|
+
});
|
|
579
|
+
runTest('containsPII: detects password mention', () => {
|
|
580
|
+
assertTrue(containsPII('The password is: secret123'));
|
|
581
|
+
});
|
|
582
|
+
runTest('containsPII: returns false for safe content', () => {
|
|
583
|
+
assertTrue(!containsPII('User prefers bullet points'));
|
|
584
|
+
});
|
|
585
|
+
// ============================================================================
|
|
586
|
+
// Summary
|
|
587
|
+
// ============================================================================
|
|
588
|
+
console.log('\n=== Test Summary ===\n');
|
|
589
|
+
console.log(`Total: ${testsPassed + testsFailed}`);
|
|
590
|
+
console.log(`Passed: ${testsPassed}`);
|
|
591
|
+
console.log(`Failed: ${testsFailed}`);
|
|
592
|
+
if (testsFailed > 0) {
|
|
593
|
+
process.exit(1);
|
|
594
|
+
}
|
|
595
|
+
console.log('\n✅ All tests passed!\n');
|
|
596
|
+
//# sourceMappingURL=agent-memory-features.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-memory-features.test.js","sourceRoot":"","sources":["../../src/__tests__/agent-memory-features.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAsCH,+EAA+E;AAC/E,wDAAwD;AACxD,+EAA+E;AAE/E;;GAEG;AACH,SAAS,kBAAkB,CAAC,IAAc;IACtC,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QAChD,OAAO,iCAAiC,CAAC;IAC7C,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9B,OAAO,uBAAuB,CAAC;IACnC,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACjC,OAAO,0BAA0B,CAAC;IACtC,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,yBAAyB,CAAC;IACrC,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;Q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C;AACtC,OAAO,CAAC,GAAG,CAAC,WAAW,WAAW,EAAE,CAAC,CAAC;AAEtC,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;IAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unit tests for Agent Type Prompt Parameters functionality.
|
|
3
|
+
*
|
|
4
|
+
* These tests verify the core logic for building and merging agent type prompt params:
|
|
5
|
+
* - extractSchemaDefaults(): Extracts default values from JSON Schema
|
|
6
|
+
* - buildAgentTypePromptParams(): Merges schema defaults, agent config, and runtime overrides
|
|
7
|
+
*
|
|
8
|
+
* To run these tests, you can use ts-node:
|
|
9
|
+
* npx ts-node src/__tests__/agent-type-prompt-params.test.ts
|
|
10
|
+
*
|
|
11
|
+
* @since 2.131.0
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=agent-type-prompt-params.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-type-prompt-params.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/agent-type-prompt-params.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|