@memberjunction/ai-agents 5.0.0 → 5.2.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/agent-types/base-agent-type.d.ts +3 -3
- package/dist/agent-types/base-agent-type.d.ts.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 +1 -1
- package/dist/agent-types/loop-agent-type.d.ts +3 -3
- package/dist/agent-types/loop-agent-type.d.ts.map +1 -1
- package/dist/agent-types/loop-agent-type.js +1 -1
- package/dist/base-agent.d.ts +43 -43
- package/dist/base-agent.d.ts.map +1 -1
- package/dist/base-agent.js +15 -15
- package/dist/base-agent.js.map +1 -1
- package/dist/memory-cleanup-agent.d.ts.map +1 -1
- package/dist/memory-cleanup-agent.js.map +1 -1
- package/dist/memory-manager-agent.d.ts.map +1 -1
- package/dist/memory-manager-agent.js.map +1 -1
- package/package.json +12 -12
- package/dist/__tests__/action-changes.test.d.ts +0 -15
- package/dist/__tests__/action-changes.test.d.ts.map +0 -1
- package/dist/__tests__/action-changes.test.js +0 -394
- package/dist/__tests__/action-changes.test.js.map +0 -1
- package/dist/__tests__/agent-memory-features.test.d.ts +0 -123
- package/dist/__tests__/agent-memory-features.test.d.ts.map +0 -1
- package/dist/__tests__/agent-memory-features.test.js +0 -596
- package/dist/__tests__/agent-memory-features.test.js.map +0 -1
- package/dist/__tests__/agent-type-prompt-params.test.d.ts +0 -14
- package/dist/__tests__/agent-type-prompt-params.test.d.ts.map +0 -1
- package/dist/__tests__/agent-type-prompt-params.test.js +0 -583
- package/dist/__tests__/agent-type-prompt-params.test.js.map +0 -1
- package/dist/__tests__/chat-handling-option.test.d.ts +0 -54
- package/dist/__tests__/chat-handling-option.test.d.ts.map +0 -1
- package/dist/__tests__/chat-handling-option.test.js +0 -222
- package/dist/__tests__/chat-handling-option.test.js.map +0 -1
- package/dist/services/AgentEmbeddingService.d.ts +0 -16
- package/dist/services/AgentEmbeddingService.d.ts.map +0 -1
- package/dist/services/AgentEmbeddingService.js +0 -158
- package/dist/services/AgentEmbeddingService.js.map +0 -1
- package/dist/types/AgentMatchResult.d.ts +0 -18
- package/dist/types/AgentMatchResult.d.ts.map +0 -1
- package/dist/types/AgentMatchResult.js +0 -3
- package/dist/types/AgentMatchResult.js.map +0 -1
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unit tests for ChatHandlingOption functionality in sub-agent execution.
|
|
3
|
-
*
|
|
4
|
-
* These tests verify that when a sub-agent returns FinalStep='Chat',
|
|
5
|
-
* the parent agent's ChatHandlingOption is respected and the Chat step
|
|
6
|
-
* is remapped to Success/Failed/Retry as configured.
|
|
7
|
-
*
|
|
8
|
-
* To run these tests:
|
|
9
|
-
* npx ts-node src/__tests__/chat-handling-option.test.ts
|
|
10
|
-
*
|
|
11
|
-
* @since 3.1.1
|
|
12
|
-
*/
|
|
13
|
-
declare let testCount: number;
|
|
14
|
-
declare let passCount: number;
|
|
15
|
-
declare let failCount: number;
|
|
16
|
-
declare function assert(condition: boolean, message: string): void;
|
|
17
|
-
declare function assertDeepEqual(actual: any, expected: any, message: string): void;
|
|
18
|
-
declare function testGroup(description: string, testFn: () => void): void;
|
|
19
|
-
declare function printSummary(): void;
|
|
20
|
-
/**
|
|
21
|
-
* Mock agent entity for testing
|
|
22
|
-
*/
|
|
23
|
-
interface MockAgent {
|
|
24
|
-
ID: string;
|
|
25
|
-
Name: string;
|
|
26
|
-
ChatHandlingOption: 'Success' | 'Failed' | 'Retry' | null;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Mock next step structure
|
|
30
|
-
*/
|
|
31
|
-
interface MockNextStep {
|
|
32
|
-
step: 'Success' | 'Failed' | 'Chat' | 'Retry';
|
|
33
|
-
terminate?: boolean;
|
|
34
|
-
message?: string | null;
|
|
35
|
-
previousPayload?: any;
|
|
36
|
-
newPayload?: any;
|
|
37
|
-
responseForm?: any;
|
|
38
|
-
actionableCommands?: any[];
|
|
39
|
-
automaticCommands?: any[];
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Mock params structure
|
|
43
|
-
*/
|
|
44
|
-
interface MockParams {
|
|
45
|
-
agent: MockAgent;
|
|
46
|
-
verbose?: boolean;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Validates that the Chat next step is valid and can be executed by the current agent.
|
|
50
|
-
* Implements ChatHandlingOption remapping logic - if the agent has ChatHandlingOption set,
|
|
51
|
-
* the Chat step is remapped to the specified value (Success, Failed, or Retry).
|
|
52
|
-
*/
|
|
53
|
-
declare function validateChatNextStep(params: MockParams, nextStep: MockNextStep): MockNextStep;
|
|
54
|
-
//# sourceMappingURL=chat-handling-option.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-handling-option.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/chat-handling-option.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,QAAA,IAAI,SAAS,QAAI,CAAC;AAClB,QAAA,IAAI,SAAS,QAAI,CAAC;AAClB,QAAA,IAAI,SAAS,QAAI,CAAC;AAElB,iBAAS,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CASzD;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAI1E;AAED,iBAAS,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI,CAGhE;AAED,iBAAS,YAAY,IAAI,IAAI,CAW5B;AAMD;;GAEG;AACH,UAAU,SAAS;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAC;CAC7D;AAED;;GAEG;AACH,UAAU,YAAY;IAClB,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,kBAAkB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC3B,iBAAiB,CAAC,EAAE,GAAG,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,UAAU,UAAU;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAOD;;;;GAIG;AACH,iBAAS,oBAAoB,CACzB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,YAAY,GACvB,YAAY,CAuCd"}
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unit tests for ChatHandlingOption functionality in sub-agent execution.
|
|
3
|
-
*
|
|
4
|
-
* These tests verify that when a sub-agent returns FinalStep='Chat',
|
|
5
|
-
* the parent agent's ChatHandlingOption is respected and the Chat step
|
|
6
|
-
* is remapped to Success/Failed/Retry as configured.
|
|
7
|
-
*
|
|
8
|
-
* To run these tests:
|
|
9
|
-
* npx ts-node src/__tests__/chat-handling-option.test.ts
|
|
10
|
-
*
|
|
11
|
-
* @since 3.1.1
|
|
12
|
-
*/
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// Test Helpers - Simple assertion and test runner
|
|
15
|
-
// ============================================================================
|
|
16
|
-
let testCount = 0;
|
|
17
|
-
let passCount = 0;
|
|
18
|
-
let failCount = 0;
|
|
19
|
-
function assert(condition, message) {
|
|
20
|
-
testCount++;
|
|
21
|
-
if (condition) {
|
|
22
|
-
passCount++;
|
|
23
|
-
console.log(` ✓ ${message}`);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
failCount++;
|
|
27
|
-
console.log(` ✗ FAILED: ${message}`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function assertDeepEqual(actual, expected, message) {
|
|
31
|
-
const actualStr = JSON.stringify(actual, null, 2);
|
|
32
|
-
const expectedStr = JSON.stringify(expected, null, 2);
|
|
33
|
-
assert(actualStr === expectedStr, message);
|
|
34
|
-
}
|
|
35
|
-
function testGroup(description, testFn) {
|
|
36
|
-
console.log(`\n${description}:`);
|
|
37
|
-
testFn();
|
|
38
|
-
}
|
|
39
|
-
function printSummary() {
|
|
40
|
-
console.log('\n' + '='.repeat(70));
|
|
41
|
-
console.log('Test Summary');
|
|
42
|
-
console.log('='.repeat(70));
|
|
43
|
-
console.log(`Total: ${testCount} | Passed: ${passCount} | Failed: ${failCount}`);
|
|
44
|
-
if (failCount === 0) {
|
|
45
|
-
console.log('\n✅ All tests passed!\n');
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
console.log(`\n❌ ${failCount} test(s) failed\n`);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
// ============================================================================
|
|
53
|
-
// Standalone Implementation of validateChatNextStep for Testing
|
|
54
|
-
// This mirrors the BaseAgent.validateChatNextStep() implementation
|
|
55
|
-
// ============================================================================
|
|
56
|
-
/**
|
|
57
|
-
* Validates that the Chat next step is valid and can be executed by the current agent.
|
|
58
|
-
* Implements ChatHandlingOption remapping logic - if the agent has ChatHandlingOption set,
|
|
59
|
-
* the Chat step is remapped to the specified value (Success, Failed, or Retry).
|
|
60
|
-
*/
|
|
61
|
-
function validateChatNextStep(params, nextStep) {
|
|
62
|
-
// Check if the agent has ChatHandlingOption configured
|
|
63
|
-
const chatHandlingOption = params.agent.ChatHandlingOption;
|
|
64
|
-
if (chatHandlingOption) {
|
|
65
|
-
// Use a switch to validate and map the ChatHandlingOption value
|
|
66
|
-
let mappedStep;
|
|
67
|
-
switch (chatHandlingOption) {
|
|
68
|
-
case 'Success':
|
|
69
|
-
mappedStep = 'Success';
|
|
70
|
-
break;
|
|
71
|
-
case 'Failed':
|
|
72
|
-
mappedStep = 'Failed';
|
|
73
|
-
break;
|
|
74
|
-
case 'Retry':
|
|
75
|
-
mappedStep = 'Retry';
|
|
76
|
-
break;
|
|
77
|
-
default:
|
|
78
|
-
// Invalid option - treat as null and allow Chat to propagate
|
|
79
|
-
console.error(`Invalid ChatHandlingOption value: ${chatHandlingOption}`);
|
|
80
|
-
return nextStep;
|
|
81
|
-
}
|
|
82
|
-
// Remap the Chat step to the configured option
|
|
83
|
-
const remappedStep = {
|
|
84
|
-
...nextStep,
|
|
85
|
-
step: mappedStep
|
|
86
|
-
};
|
|
87
|
-
if (params.verbose) {
|
|
88
|
-
console.log(` [DEBUG] Remapping Chat step to ${chatHandlingOption}`);
|
|
89
|
-
}
|
|
90
|
-
return remappedStep;
|
|
91
|
-
}
|
|
92
|
-
// Default behavior: let Chat propagate up (no remapping)
|
|
93
|
-
return nextStep;
|
|
94
|
-
}
|
|
95
|
-
// ============================================================================
|
|
96
|
-
// Tests for ChatHandlingOption with Sub-Agent Execution
|
|
97
|
-
// ============================================================================
|
|
98
|
-
testGroup('ChatHandlingOption = null (default behavior)', () => {
|
|
99
|
-
const parentAgent = {
|
|
100
|
-
ID: 'parent-1',
|
|
101
|
-
Name: 'Parent Agent',
|
|
102
|
-
ChatHandlingOption: null
|
|
103
|
-
};
|
|
104
|
-
const params = { agent: parentAgent };
|
|
105
|
-
const chatStep = {
|
|
106
|
-
step: 'Chat',
|
|
107
|
-
terminate: true,
|
|
108
|
-
message: 'Need user input',
|
|
109
|
-
newPayload: { someData: 'test' }
|
|
110
|
-
};
|
|
111
|
-
const result = validateChatNextStep(params, chatStep);
|
|
112
|
-
assert(result.step === 'Chat', 'Chat step is not remapped when ChatHandlingOption is null');
|
|
113
|
-
assert(result.message === 'Need user input', 'Message is preserved');
|
|
114
|
-
assert(result.terminate === true, 'Terminate flag is preserved');
|
|
115
|
-
});
|
|
116
|
-
testGroup('ChatHandlingOption = "Success" (remap Chat to Success)', () => {
|
|
117
|
-
const parentAgent = {
|
|
118
|
-
ID: 'parent-2',
|
|
119
|
-
Name: 'Parent Agent with Success Override',
|
|
120
|
-
ChatHandlingOption: 'Success'
|
|
121
|
-
};
|
|
122
|
-
const params = { agent: parentAgent };
|
|
123
|
-
const chatStep = {
|
|
124
|
-
step: 'Chat',
|
|
125
|
-
terminate: true,
|
|
126
|
-
message: 'Need user input',
|
|
127
|
-
newPayload: { someData: 'test' },
|
|
128
|
-
responseForm: { type: 'form' },
|
|
129
|
-
actionableCommands: [{ command: 'approve' }]
|
|
130
|
-
};
|
|
131
|
-
const result = validateChatNextStep(params, chatStep);
|
|
132
|
-
assert(result.step === 'Success', 'Chat step is remapped to Success');
|
|
133
|
-
assert(result.message === 'Need user input', 'Message is preserved');
|
|
134
|
-
assert(result.terminate === true, 'Terminate flag is preserved');
|
|
135
|
-
assertDeepEqual(result.newPayload, { someData: 'test' }, 'Payload is preserved');
|
|
136
|
-
assertDeepEqual(result.responseForm, { type: 'form' }, 'Response form is preserved');
|
|
137
|
-
});
|
|
138
|
-
testGroup('ChatHandlingOption = "Failed" (remap Chat to Failed)', () => {
|
|
139
|
-
const parentAgent = {
|
|
140
|
-
ID: 'parent-3',
|
|
141
|
-
Name: 'Parent Agent with Failed Override',
|
|
142
|
-
ChatHandlingOption: 'Failed'
|
|
143
|
-
};
|
|
144
|
-
const params = { agent: parentAgent };
|
|
145
|
-
const chatStep = {
|
|
146
|
-
step: 'Chat',
|
|
147
|
-
terminate: true,
|
|
148
|
-
message: 'Cannot proceed without user input',
|
|
149
|
-
newPayload: { someData: 'test' }
|
|
150
|
-
};
|
|
151
|
-
const result = validateChatNextStep(params, chatStep);
|
|
152
|
-
assert(result.step === 'Failed', 'Chat step is remapped to Failed');
|
|
153
|
-
assert(result.message === 'Cannot proceed without user input', 'Message is preserved');
|
|
154
|
-
});
|
|
155
|
-
testGroup('ChatHandlingOption = "Retry" (remap Chat to Retry)', () => {
|
|
156
|
-
const parentAgent = {
|
|
157
|
-
ID: 'parent-4',
|
|
158
|
-
Name: 'Parent Agent with Retry Override',
|
|
159
|
-
ChatHandlingOption: 'Retry'
|
|
160
|
-
};
|
|
161
|
-
const params = { agent: parentAgent };
|
|
162
|
-
const chatStep = {
|
|
163
|
-
step: 'Chat',
|
|
164
|
-
terminate: true,
|
|
165
|
-
message: 'Need clarification',
|
|
166
|
-
newPayload: { someData: 'test' }
|
|
167
|
-
};
|
|
168
|
-
const result = validateChatNextStep(params, chatStep);
|
|
169
|
-
assert(result.step === 'Retry', 'Chat step is remapped to Retry');
|
|
170
|
-
assert(result.message === 'Need clarification', 'Message is preserved');
|
|
171
|
-
});
|
|
172
|
-
testGroup('Sub-Agent Chat Bubbling (Real-World Scenario)', () => {
|
|
173
|
-
// Scenario: Child agent returns Chat, parent has ChatHandlingOption = "Success"
|
|
174
|
-
// Expected: Parent should remap Chat to Success and continue execution
|
|
175
|
-
const childAgent = {
|
|
176
|
-
ID: 'child-1',
|
|
177
|
-
Name: 'Software Architect',
|
|
178
|
-
ChatHandlingOption: null // Child allows Chat to propagate
|
|
179
|
-
};
|
|
180
|
-
const parentAgent = {
|
|
181
|
-
ID: 'parent-5',
|
|
182
|
-
Name: 'Technical Product Manager',
|
|
183
|
-
ChatHandlingOption: 'Success' // Parent remaps Chat to Success
|
|
184
|
-
};
|
|
185
|
-
// Step 1: Child agent returns Chat (simulated)
|
|
186
|
-
const childFinalStep = {
|
|
187
|
-
step: 'Chat',
|
|
188
|
-
terminate: true,
|
|
189
|
-
message: 'Need design approval',
|
|
190
|
-
newPayload: { technicalDesign: 'Component architecture' }
|
|
191
|
-
};
|
|
192
|
-
// Step 2: Parent receives child's Chat and validates through its ChatHandlingOption
|
|
193
|
-
const parentParams = { agent: parentAgent };
|
|
194
|
-
const parentResult = validateChatNextStep(parentParams, childFinalStep);
|
|
195
|
-
assert(parentResult.step === 'Success', 'Parent remaps child Chat to Success');
|
|
196
|
-
assert(parentResult.message === 'Need design approval', 'Message from child is preserved');
|
|
197
|
-
assertDeepEqual(parentResult.newPayload, { technicalDesign: 'Component architecture' }, 'Payload from child is preserved');
|
|
198
|
-
});
|
|
199
|
-
testGroup('Verbose Logging', () => {
|
|
200
|
-
const parentAgent = {
|
|
201
|
-
ID: 'parent-6',
|
|
202
|
-
Name: 'Verbose Agent',
|
|
203
|
-
ChatHandlingOption: 'Success'
|
|
204
|
-
};
|
|
205
|
-
const params = {
|
|
206
|
-
agent: parentAgent,
|
|
207
|
-
verbose: true
|
|
208
|
-
};
|
|
209
|
-
const chatStep = {
|
|
210
|
-
step: 'Chat',
|
|
211
|
-
terminate: true,
|
|
212
|
-
message: 'Test'
|
|
213
|
-
};
|
|
214
|
-
console.log(' Expected debug output:');
|
|
215
|
-
const result = validateChatNextStep(params, chatStep);
|
|
216
|
-
assert(result.step === 'Success', 'Chat remapped with verbose logging');
|
|
217
|
-
});
|
|
218
|
-
// ============================================================================
|
|
219
|
-
// Run Tests and Print Summary
|
|
220
|
-
// ============================================================================
|
|
221
|
-
printSummary();
|
|
222
|
-
//# sourceMappingURL=chat-handling-option.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-handling-option.test.js","sourceRoot":"","sources":["../../src/__tests__/chat-handling-option.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,+EAA+E;AAC/E,kDAAkD;AAClD,+EAA+E;AAE/E,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB,SAAS,MAAM,CAAC,SAAkB,EAAE,OAAe;IAC/C,SAAS,EAAE,CAAC;IACZ,IAAI,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,OAAO,CAAC,GAAG,CAAC,O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,IAAI,EAAE,eAAe;QACrB,kBAAkB,EAAE,SAAS;KAChC,CAAC;IAEF,MAAM,MAAM,GAAe;QACvB,KAAK,EAAE,WAAW;QAClB,OAAO,EAAE,IAAI;KAChB,CAAC;IAEF,MAAM,QAAQ,GAAiB;QAC3B,IAAI,EAAE,MAAM;QACZ,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,MAAM;KAClB,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,oBAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEtD,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,oCAAoC,CAAC,CAAC;AAC5E,CAAC,CAAC,CAAC;AAEH,+EAA+E;AAC/E,8BAA8B;AAC9B,+EAA+E;AAE/E,YAAY,EAAE,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AgentMatchResult } from '../types/AgentMatchResult.js';
|
|
2
|
-
export declare class AgentEmbeddingService {
|
|
3
|
-
private vectorService;
|
|
4
|
-
private aiEngine;
|
|
5
|
-
private initialized;
|
|
6
|
-
private agentCount;
|
|
7
|
-
constructor();
|
|
8
|
-
initialize(contextUser?: any, includeInactive?: boolean): Promise<void>;
|
|
9
|
-
findSimilarAgents(taskDescription: string, topK?: number, minSimilarity?: number): Promise<AgentMatchResult[]>;
|
|
10
|
-
findRelatedAgents(agentId: string, topK?: number, minSimilarity?: number): Promise<AgentMatchResult[]>;
|
|
11
|
-
getSimilarity(agentId1: string, agentId2: string): number;
|
|
12
|
-
get isInitialized(): boolean;
|
|
13
|
-
get loadedAgentCount(): number;
|
|
14
|
-
private createEmbeddingText;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=AgentEmbeddingService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgentEmbeddingService.d.ts","sourceRoot":"","sources":["../../src/services/AgentEmbeddingService.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAA0B,MAAM,2BAA2B,CAAC;AAoBrF,qBAAa,qBAAqB;IAC9B,OAAO,CAAC,aAAa,CAA8C;IACnE,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,UAAU,CAAa;;IAgBlB,UAAU,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,eAAe,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAoF9E,iBAAiB,CAC1B,eAAe,EAAE,MAAM,EACvB,IAAI,GAAE,MAAU,EAChB,aAAa,GAAE,MAAY,GAC5B,OAAO,CAAC,gBAAgB,EAAE,CAAC;IA4DjB,iBAAiB,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAU,EAChB,aAAa,GAAE,MAAY,GAC5B,OAAO,CAAC,gBAAgB,EAAE,CAAC;IA0CvB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAmBhE,IAAW,aAAa,IAAI,OAAO,CAElC;IAKD,IAAW,gBAAgB,IAAI,MAAM,CAEpC;IAMD,OAAO,CAAC,mBAAmB;CAW9B"}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgentEmbeddingService = void 0;
|
|
4
|
-
const ai_vectors_memory_1 = require("@memberjunction/ai-vectors-memory");
|
|
5
|
-
const aiengine_1 = require("@memberjunction/aiengine");
|
|
6
|
-
const core_1 = require("@memberjunction/core");
|
|
7
|
-
class AgentEmbeddingService {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.initialized = false;
|
|
10
|
-
this.agentCount = 0;
|
|
11
|
-
this.vectorService = new ai_vectors_memory_1.SimpleVectorService();
|
|
12
|
-
this.aiEngine = aiengine_1.AIEngine.Instance;
|
|
13
|
-
}
|
|
14
|
-
async initialize(contextUser, includeInactive = false) {
|
|
15
|
-
if (this.initialized) {
|
|
16
|
-
console.log('AgentEmbeddingService already initialized');
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const startTime = Date.now();
|
|
20
|
-
console.log('AgentEmbeddingService: Initializing agent embeddings...');
|
|
21
|
-
try {
|
|
22
|
-
const rv = new core_1.RunView();
|
|
23
|
-
const filter = includeInactive ? '' : "Status = 'Active'";
|
|
24
|
-
const result = await rv.RunView({
|
|
25
|
-
EntityName: 'AI Agents',
|
|
26
|
-
ExtraFilter: filter,
|
|
27
|
-
OrderBy: 'Name',
|
|
28
|
-
MaxRows: 10000,
|
|
29
|
-
ResultType: 'entity_object'
|
|
30
|
-
}, contextUser);
|
|
31
|
-
if (!result.Success || !result.Results) {
|
|
32
|
-
throw new Error(`Failed to load agents: ${result.ErrorMessage || 'Unknown error'}`);
|
|
33
|
-
}
|
|
34
|
-
const agents = result.Results;
|
|
35
|
-
const entries = [];
|
|
36
|
-
for (const agent of agents) {
|
|
37
|
-
try {
|
|
38
|
-
const embeddingText = this.createEmbeddingText(agent);
|
|
39
|
-
const embeddingResult = await this.aiEngine.EmbedTextLocal(embeddingText);
|
|
40
|
-
if (!embeddingResult || !embeddingResult.result || embeddingResult.result.vector.length === 0) {
|
|
41
|
-
console.error(`Failed to generate embedding for agent ${agent.Name}`);
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
entries.push({
|
|
45
|
-
key: agent.ID,
|
|
46
|
-
vector: embeddingResult.result.vector,
|
|
47
|
-
metadata: {
|
|
48
|
-
id: agent.ID,
|
|
49
|
-
name: agent.Name,
|
|
50
|
-
description: agent.Description || '',
|
|
51
|
-
systemPrompt: '',
|
|
52
|
-
typeName: agent.Type || '',
|
|
53
|
-
status: agent.Status || 'Active'
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
catch (error) {
|
|
58
|
-
console.error(`Error generating embedding for agent ${agent.Name}: ${error instanceof Error ? error.message : String(error)}`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
this.vectorService.LoadVectors(entries);
|
|
62
|
-
this.agentCount = entries.length;
|
|
63
|
-
this.initialized = true;
|
|
64
|
-
const duration = Date.now() - startTime;
|
|
65
|
-
console.log(`AgentEmbeddingService: Loaded embeddings for ${this.agentCount} agents in ${duration}ms`);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
console.error(`Failed to initialize AgentEmbeddingService: ${error instanceof Error ? error.message : String(error)}`);
|
|
69
|
-
throw error;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
async findSimilarAgents(taskDescription, topK = 5, minSimilarity = 0.5) {
|
|
73
|
-
if (!this.initialized) {
|
|
74
|
-
throw new Error('AgentEmbeddingService not initialized. Call initialize() first.');
|
|
75
|
-
}
|
|
76
|
-
if (!taskDescription || taskDescription.trim().length === 0) {
|
|
77
|
-
throw new Error('taskDescription cannot be empty');
|
|
78
|
-
}
|
|
79
|
-
if (topK < 1) {
|
|
80
|
-
throw new Error('topK must be at least 1');
|
|
81
|
-
}
|
|
82
|
-
if (minSimilarity < 0 || minSimilarity > 1) {
|
|
83
|
-
throw new Error('minSimilarity must be between 0 and 1');
|
|
84
|
-
}
|
|
85
|
-
try {
|
|
86
|
-
const queryEmbedding = await this.aiEngine.EmbedTextLocal(taskDescription);
|
|
87
|
-
if (!queryEmbedding || !queryEmbedding.result || queryEmbedding.result.vector.length === 0) {
|
|
88
|
-
throw new Error('Failed to generate embedding for task description');
|
|
89
|
-
}
|
|
90
|
-
const results = this.vectorService.FindNearest(queryEmbedding.result.vector, topK, minSimilarity, 'cosine');
|
|
91
|
-
return results.map(r => ({
|
|
92
|
-
agentId: r.key,
|
|
93
|
-
agentName: r.metadata?.name || 'Unknown',
|
|
94
|
-
description: r.metadata?.description || '',
|
|
95
|
-
similarityScore: r.score,
|
|
96
|
-
systemPrompt: r.metadata?.systemPrompt,
|
|
97
|
-
typeName: r.metadata?.typeName,
|
|
98
|
-
status: r.metadata?.status
|
|
99
|
-
}));
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
console.error(`Error finding similar agents: ${error instanceof Error ? error.message : String(error)}`);
|
|
103
|
-
throw error;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
async findRelatedAgents(agentId, topK = 5, minSimilarity = 0.5) {
|
|
107
|
-
if (!this.initialized) {
|
|
108
|
-
throw new Error('AgentEmbeddingService not initialized. Call initialize() first.');
|
|
109
|
-
}
|
|
110
|
-
if (!this.vectorService.Has(agentId)) {
|
|
111
|
-
throw new Error(`Agent ${agentId} not found in embeddings`);
|
|
112
|
-
}
|
|
113
|
-
try {
|
|
114
|
-
const results = this.vectorService.FindSimilar(agentId, topK, minSimilarity, 'cosine');
|
|
115
|
-
return results.map(r => ({
|
|
116
|
-
agentId: r.key,
|
|
117
|
-
agentName: r.metadata?.name || 'Unknown',
|
|
118
|
-
description: r.metadata?.description || '',
|
|
119
|
-
similarityScore: r.score,
|
|
120
|
-
systemPrompt: r.metadata?.systemPrompt,
|
|
121
|
-
typeName: r.metadata?.typeName,
|
|
122
|
-
status: r.metadata?.status
|
|
123
|
-
}));
|
|
124
|
-
}
|
|
125
|
-
catch (error) {
|
|
126
|
-
console.error(`Error finding related agents: ${error instanceof Error ? error.message : String(error)}`);
|
|
127
|
-
throw error;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
getSimilarity(agentId1, agentId2) {
|
|
131
|
-
if (!this.initialized) {
|
|
132
|
-
throw new Error('AgentEmbeddingService not initialized. Call initialize() first.');
|
|
133
|
-
}
|
|
134
|
-
if (!this.vectorService.Has(agentId1)) {
|
|
135
|
-
throw new Error(`Agent ${agentId1} not found in embeddings`);
|
|
136
|
-
}
|
|
137
|
-
if (!this.vectorService.Has(agentId2)) {
|
|
138
|
-
throw new Error(`Agent ${agentId2} not found in embeddings`);
|
|
139
|
-
}
|
|
140
|
-
return this.vectorService.Similarity(agentId1, agentId2);
|
|
141
|
-
}
|
|
142
|
-
get isInitialized() {
|
|
143
|
-
return this.initialized;
|
|
144
|
-
}
|
|
145
|
-
get loadedAgentCount() {
|
|
146
|
-
return this.agentCount;
|
|
147
|
-
}
|
|
148
|
-
createEmbeddingText(agent) {
|
|
149
|
-
const parts = [
|
|
150
|
-
agent.Name,
|
|
151
|
-
agent.Name,
|
|
152
|
-
agent.Description || ''
|
|
153
|
-
];
|
|
154
|
-
return parts.filter(p => p.trim().length > 0).join('. ');
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
exports.AgentEmbeddingService = AgentEmbeddingService;
|
|
158
|
-
//# sourceMappingURL=AgentEmbeddingService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgentEmbeddingService.js","sourceRoot":"","sources":["../../src/services/AgentEmbeddingService.ts"],"names":[],"mappings":";;;AAAA,yEAAqF;AACrF,uDAAoD;AACpD,+CAA+C;AAsB/C,MAAa,qBAAqB;IAM9B;QAHQ,gBAAW,GAAY,KAAK,CAAC;QAC7B,eAAU,GAAW,CAAC,CAAC;QAG3B,IAAI,CAAC,aAAa,GAAG,IAAI,uCAAmB,EAAE,CAAC;QAC/C,IAAI,CAAC,QAAQ,GAAG,mBAAQ,CAAC,QAAQ,CAAC;IACtC,CAAC;IAWM,KAAK,CAAC,UAAU,CAAC,WAAiB,EAAE,kBAA2B,KAAK;QACvE,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;YACzD,OAAO;QACX,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;QAEvE,IAAI,CAAC;YAED,MAAM,EAAE,GAAG,IAAI,cAAO,EAAE,CAAC;YACzB,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,m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;
|
|
6
|
-
systemPrompt?: string;
|
|
7
|
-
typeName?: string;
|
|
8
|
-
status?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface AgentEmbeddingMetadata {
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
systemPrompt?: string;
|
|
15
|
-
typeName?: string;
|
|
16
|
-
status?: string;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=AgentMatchResult.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgentMatchResult.d.ts","sourceRoot":"","sources":["../../src/types/AgentMatchResult.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAI7B,OAAO,EAAE,MAAM,CAAC;IAKhB,SAAS,EAAE,MAAM,CAAC;IAKlB,WAAW,EAAE,MAAM,CAAC;IAKpB,eAAe,EAAE,MAAM,CAAC;IAKxB,YAAY,CAAC,EAAE,MAAM,CAAC;IAKtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAKD,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgentMatchResult.js","sourceRoot":"","sources":["../../src/types/AgentMatchResult.ts"],"names":[],"mappings":""}
|