@memberjunction/ai-agent-manager-actions
Version:
Agent Management actions for creating and managing AI agents in MemberJunction
65 lines • 2.31 kB
TypeScript
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
import { BaseAction } from "@memberjunction/actions";
import { Metadata, UserInfo } from "@memberjunction/core";
import { AIAgentEntity, AIAgentTypeEntity } from "@memberjunction/core-entities";
/**
* Abstract base class for agent management actions.
* Provides common functionality for validating permissions, loading entities,
* and managing agent metadata. Only the Agent Manager agent should be able
* to execute these actions.
*/
export declare abstract class BaseAgentManagementAction extends BaseAction {
/**
* Validates that the action is being called by the Agent Manager agent
*/
protected validateAgentManagerPermission(params: RunActionParams): Promise<ActionResultSimple | null>;
/**
* Extract and validate a string parameter
*/
protected getStringParam(params: RunActionParams, paramName: string, required?: boolean): {
value?: string;
error?: ActionResultSimple;
};
/**
* Extract and validate an object parameter
*/
protected getObjectParam(params: RunActionParams, paramName: string, required?: boolean): {
value?: Record<string, any>;
error?: ActionResultSimple;
};
/**
* Get metadata instance
*/
protected getMetadata(): Metadata;
/**
* Load an AI Agent entity by ID
*/
protected loadAgent(agentID: string, contextUser: any): Promise<{
agent?: AIAgentEntity;
error?: ActionResultSimple;
}>;
/**
* Validate agent type exists
*/
protected validateAgentType(typeID: string, contextUser: any): Promise<{
type?: AIAgentTypeEntity;
error?: ActionResultSimple;
}>;
/**
* Common error handler
*/
protected handleError(error: any, operation: string): ActionResultSimple;
/**
* Creates a prompt and associates it with an agent
*/
protected createAndAssociatePrompt(agent: AIAgentEntity, promptText: string, contextUser: UserInfo): Promise<{
success: boolean;
promptId?: string;
error?: string;
}>;
/**
* Gets the prompt type ID for a given type name
*/
private getPromptTypeID;
}
//# sourceMappingURL=base-agent-management.action.d.ts.map