/** * Vector Action Manager * * Manages reusable vector database actions (query templates). * Actions allow defining common vector operations that can be * executed with different input parameters. * * Uses ProductBuilder for persistence to the backend. */ import { IVectorActionDefinition, IVectorActionTemplate, IVectorActionCreateOptions, IVectorActionUpdateOptions, IVectorActionExecuteOptions, IVectorActionFetchOptions, IVectorActionDeleteOptions, IVectorActionParam, VectorActionTypes } from '../types/action.interface'; import { IProductVectorAction } from '../../types'; /** * VectorDatabaseService reference type (to avoid circular imports) */ interface IVectorServiceRef { getConfig(): { workspace_id: string; public_key: string; user_id: string; token: string; env_type: string; access_key?: string; } | null; } /** * Vector Action Manager for managing reusable vector actions * Uses ProductBuilder for persistent storage */ export declare class VectorActionManager { private vectorService; private productBuilders; constructor(vectorService: IVectorServiceRef); /** * Create a new ProductBuilder instance */ private createNewProductBuilder; /** * Get or create a ProductBuilder instance for the given product tag */ private getProductBuilder; /** * Create a new vector action * @param options Action creation options */ create(options: IVectorActionCreateOptions): Promise; /** * Update an existing vector action * @param options Action update options */ update(options: IVectorActionUpdateOptions): Promise; /** * Fetch a specific vector action * @param options Fetch options * @returns Action definition or null */ fetch(options: IVectorActionFetchOptions & { actionTag: string; }): Promise; /** * Fetch all vector actions for a vector database * @param options Fetch options * @returns Array of action definitions */ fetchAll(options: IVectorActionFetchOptions): Promise; /** * Delete a vector action * @param options Delete options */ delete(options: IVectorActionDeleteOptions): Promise; /** * Execute a vector action * * This method resolves the template placeholders and returns * the resolved options for the caller to execute through * the VectorDatabaseService. * * @param options Execution options * @returns Resolved template ready for execution */ resolve(options: IVectorActionExecuteOptions): Promise; /** * Extract parameters from a template */ extractParametersFromTemplate(template: IVectorActionTemplate): IVectorActionParam[]; /** * Map operation type to ProductVectorActionTypes */ private mapOperationType; /** * Convert IProductVectorAction to IVectorActionDefinition */ private convertToActionDefinition; } /** * Vector Action Builder for fluent action creation */ export declare class VectorActionBuilder { private options; /** * Set product tag */ product(product: string): this; /** * Set vector database tag */ vector(vector: string): this; /** * Set action name */ name(name: string): this; /** * Set action tag */ tag(actionTag: string): this; /** * Set operation type */ operation(operation: VectorActionTypes | string): this; /** * Set description */ description(description: string): this; /** * Set template */ template(template: IVectorActionTemplate): this; /** * Set parameters */ parameters(parameters: IVectorActionParam[]): this; /** * Build the action options */ build(): IVectorActionCreateOptions; } /** * Create a new vector action builder */ export declare function createVectorAction(): VectorActionBuilder; export {};