@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
package/dist/base-agent.js
CHANGED
|
@@ -713,7 +713,7 @@ export class BaseAgent {
|
|
|
713
713
|
* all required metadata is present and handles errors gracefully.
|
|
714
714
|
*
|
|
715
715
|
* @param {ExecuteAgentParams} params - Parameters for agent execution
|
|
716
|
-
* @param {
|
|
716
|
+
* @param {MJAIAgentEntityExtended} params.agent - The agent entity to execute
|
|
717
717
|
* @param {ChatMessage[]} params.conversationMessages - Conversation history
|
|
718
718
|
* @param {UserInfo} [params.contextUser] - Optional user context
|
|
719
719
|
* @param {any} [params.context] - Optional context object passed to sub-agents and actions
|
|
@@ -1169,7 +1169,7 @@ export class BaseAgent {
|
|
|
1169
1169
|
/**
|
|
1170
1170
|
* Validates that the agent is active and ready for execution.
|
|
1171
1171
|
*
|
|
1172
|
-
* @param {
|
|
1172
|
+
* @param {MJAIAgentEntityExtended} agent - The agent to validate
|
|
1173
1173
|
* @returns {ExecuteAgentResult | null} Error result if validation fails, null if valid
|
|
1174
1174
|
* @protected
|
|
1175
1175
|
*/
|
|
@@ -1290,7 +1290,7 @@ export class BaseAgent {
|
|
|
1290
1290
|
/**
|
|
1291
1291
|
* Loads all required configuration for agent execution.
|
|
1292
1292
|
*
|
|
1293
|
-
* @param {
|
|
1293
|
+
* @param {MJAIAgentEntityExtended} agent - The agent to load configuration for
|
|
1294
1294
|
* @returns {Promise<AgentConfiguration>} Configuration object with loaded entities
|
|
1295
1295
|
* @protected
|
|
1296
1296
|
*/
|
|
@@ -1355,8 +1355,8 @@ export class BaseAgent {
|
|
|
1355
1355
|
* Prepares prompt parameters for hierarchical execution.
|
|
1356
1356
|
*
|
|
1357
1357
|
* @param {MJAIAgentTypeEntity} agentType - The agent type
|
|
1358
|
-
* @param {
|
|
1359
|
-
* @param {
|
|
1358
|
+
* @param {MJAIPromptEntityExtended} systemPrompt - The system prompt
|
|
1359
|
+
* @param {MJAIPromptEntityExtended} childPrompt - The child prompt
|
|
1360
1360
|
* @param {ExecuteAgentParams} params - Original execution parameters
|
|
1361
1361
|
* @returns {Promise<AIPromptParams>} Configured prompt parameters
|
|
1362
1362
|
* @protected
|
|
@@ -2823,7 +2823,7 @@ The context is now within limits. Please retry your request with the recovered c
|
|
|
2823
2823
|
* structured to provide the LLM with comprehensive context about the agent's
|
|
2824
2824
|
* capabilities and hierarchical relationships.
|
|
2825
2825
|
*
|
|
2826
|
-
* @param {
|
|
2826
|
+
* @param {MJAIAgentEntityExtended} agent - The agent to gather context for
|
|
2827
2827
|
* @param {UserInfo} [_contextUser] - Optional user context (reserved for future use)
|
|
2828
2828
|
* @param {any} [extraData] - Optional extra data to include in the context, if provided and keys conflict within the agent context data, the extraData will override the agent context data.
|
|
2829
2829
|
* @param {ActionChange[]} [actionChanges] - Optional runtime action modifications
|
|
@@ -3100,7 +3100,7 @@ The context is now within limits. Please retry your request with the recovered c
|
|
|
3100
3100
|
*
|
|
3101
3101
|
* @param {ExecuteAgentParams} params - Execution parameters with conversation history
|
|
3102
3102
|
* @param {AgentSubAgentRequest} subAgentRequest - Sub-agent request details
|
|
3103
|
-
* @param {
|
|
3103
|
+
* @param {MJAIAgentEntityExtended} subAgent - The sub-agent entity
|
|
3104
3104
|
* @param {ChatMessage | undefined} contextMessage - Optional context from SubAgentContextPaths
|
|
3105
3105
|
* @returns {ChatMessage[]} Prepared message array for sub-agent execution
|
|
3106
3106
|
*
|
|
@@ -3273,7 +3273,7 @@ The context is now within limits. Please retry your request with the recovered c
|
|
|
3273
3273
|
/**
|
|
3274
3274
|
* Formats sub-agent details for inclusion in prompt context.
|
|
3275
3275
|
*
|
|
3276
|
-
* @param {
|
|
3276
|
+
* @param {MJAIAgentEntityExtended[]} subAgents - Array of sub-agent entities
|
|
3277
3277
|
* @returns {string} JSON formatted string with sub-agent details
|
|
3278
3278
|
* @private
|
|
3279
3279
|
*/
|
|
@@ -3325,7 +3325,7 @@ The context is now within limits. Please retry your request with the recovered c
|
|
|
3325
3325
|
/**
|
|
3326
3326
|
* Formats action details for inclusion in prompt context.
|
|
3327
3327
|
*
|
|
3328
|
-
* @param {
|
|
3328
|
+
* @param {MJActionEntityExtended[]} actions - Array of action entities
|
|
3329
3329
|
* @returns {string} JSON formatted string with comprehensive action details
|
|
3330
3330
|
* @private
|
|
3331
3331
|
*/
|
|
@@ -3542,7 +3542,7 @@ The context is now within limits. Please retry your request with the recovered c
|
|
|
3542
3542
|
return 'General';
|
|
3543
3543
|
}
|
|
3544
3544
|
/**
|
|
3545
|
-
* Initializes the agent run tracking by creating
|
|
3545
|
+
* Initializes the agent run tracking by creating MJAIAgentRunEntityExtended and setting up context.
|
|
3546
3546
|
*
|
|
3547
3547
|
* @private
|
|
3548
3548
|
* @param {ExecuteAgentParams} params - The execution parameters
|
|
@@ -3703,7 +3703,7 @@ The context is now within limits. Please retry your request with the recovered c
|
|
|
3703
3703
|
* Validates the agent with tracking.
|
|
3704
3704
|
*
|
|
3705
3705
|
* @private
|
|
3706
|
-
* @param {
|
|
3706
|
+
* @param {MJAIAgentEntityExtended} agent - The agent to validate
|
|
3707
3707
|
* @returns {Promise<ExecuteAgentResult | null>} - Failure result if validation fails, null if successful
|
|
3708
3708
|
*/
|
|
3709
3709
|
async validateAgentWithTracking(agent, contextUser) {
|
|
@@ -3731,7 +3731,7 @@ The context is now within limits. Please retry your request with the recovered c
|
|
|
3731
3731
|
*
|
|
3732
3732
|
* @private
|
|
3733
3733
|
* @param params - Step creation parameters
|
|
3734
|
-
* @returns {Promise<
|
|
3734
|
+
* @returns {Promise<MJAIAgentRunStepEntityExtended>} - The created step entity
|
|
3735
3735
|
*/
|
|
3736
3736
|
async createStepEntity(params) {
|
|
3737
3737
|
const stepEntity = await this._metadata.GetEntityObject('MJ: AI Agent Run Steps', params.contextUser);
|
|
@@ -3779,7 +3779,7 @@ The context is now within limits. Please retry your request with the recovered c
|
|
|
3779
3779
|
* Finalizes a step entity with completion status.
|
|
3780
3780
|
*
|
|
3781
3781
|
* @private
|
|
3782
|
-
* @param {
|
|
3782
|
+
* @param {MJAIAgentRunStepEntityExtended} stepEntity - The step entity to finalize
|
|
3783
3783
|
* @param {boolean} success - Whether the step was successful
|
|
3784
3784
|
* @param {string} [errorMessage] - Optional error message
|
|
3785
3785
|
* @param {any} [outputData] - Optional output data to capture for this step
|
|
@@ -4284,7 +4284,7 @@ The context is now within limits. Please retry your request with the recovered c
|
|
|
4284
4284
|
finalPayload = updatedNextStep.newPayload || finalPayload;
|
|
4285
4285
|
// Prepare output data, these are simple elements of the state that are not typically
|
|
4286
4286
|
// included in payload but are helpful. We do not include the prompt result here
|
|
4287
|
-
// or the payload as those are stored already(prompt result via TargetLogID ->
|
|
4287
|
+
// or the payload as those are stored already(prompt result via TargetLogID -> MJAIPromptRunEntityExtended)
|
|
4288
4288
|
// and payload via the specialied PayloadAtStart/End fields on the step entity.
|
|
4289
4289
|
const outputData = {
|
|
4290
4290
|
nextStep: {
|
|
@@ -4643,7 +4643,7 @@ The context is now within limits. Please retry your request with the recovered c
|
|
|
4643
4643
|
// Prepare output data
|
|
4644
4644
|
const outputData = {
|
|
4645
4645
|
subAgentResult: {
|
|
4646
|
-
// we have a link to the
|
|
4646
|
+
// we have a link to the MJAIAgentRunEntityExtended via the TargetLogID above
|
|
4647
4647
|
// but we throw in just a few things here for convenience/summary that are
|
|
4648
4648
|
// light - we don't want to store the payload again for example
|
|
4649
4649
|
// that is stored in PayloadAtEnd on the step and also in PayloadAtEnd in the sub-agent's run
|