import type { Params } from '@feathersjs/feathers'; import { KnexAdapter } from '@feathersjs/knex'; import type { KnexAdapterParams, KnexAdapterOptions } from '@feathersjs/knex'; import type { Application } from '../../declarations'; import type { Agent, AgentData, AgentPatch, AgentQuery } from './agents.schema'; import { EventPayload, ISeraphEvent } from '@magickml/shared-services'; import { AgentCommandData } from '@magickml/agent-commander'; import { AgentInterface } from '@magickml/agent-server-schemas'; export type AgentParams = KnexAdapterParams; type MessagePayload = EventPayload & { agentId: string; }; /** * Default AgentService class. * Calls the standard Knex adapter service methods but can be customized with your own functionality. * * @template ServiceParams - The input params for the service * @extends KnexService */ export declare class AgentService extends KnexAdapter { app: Application; constructor(options: KnexAdapterOptions, app: Application); authorizeAgentPermissions(agentId: string, params?: ServiceParams): Promise; message(data: MessagePayload, params?: ServiceParams): Promise<{ data: { success: boolean; }; }>; syncState(agentId: string, params?: ServiceParams): Promise<{ data: { success: boolean; }; }>; ping(agentId: string, params?: ServiceParams): Promise<{ data: { success: boolean; }; }>; processSeraphEvent(seraphEvent: ISeraphEvent, params?: ServiceParams): Promise<{ data: { success: boolean; }; }>; get(agentId: string, params?: ServiceParams): Promise<{ description?: string | null | undefined; createdAt?: string | undefined; worldId?: string | undefined; updatedAt?: string | undefined; enabled?: boolean | undefined; currentSpellReleaseId?: string | null | undefined; isDraft?: boolean | undefined; draftAgentId?: string | undefined; image?: string | null | undefined; id: string; projectId: string; name: string; version: string; }>; find(params?: ServiceParams): Promise | { description?: string | null | undefined; createdAt?: string | undefined; worldId?: string | undefined; updatedAt?: string | undefined; enabled?: boolean | undefined; currentSpellReleaseId?: string | null | undefined; isDraft?: boolean | undefined; draftAgentId?: string | undefined; image?: string | null | undefined; id: string; projectId: string; name: string; version: string; }[]>; update(id: string, data: AgentInterface, params?: ServiceParams): Promise<{ description?: string | null | undefined; createdAt?: string | undefined; worldId?: string | undefined; updatedAt?: string | undefined; enabled?: boolean | undefined; currentSpellReleaseId?: string | null | undefined; isDraft?: boolean | undefined; draftAgentId?: string | undefined; image?: string | null | undefined; id: string; projectId: string; name: string; version: string; }>; /**p * Executes a command on the agent. * @param data - The data required to execute the command. * @returns An object containing the response from the agent. */ command(data: AgentCommandData, params?: ServiceParams): Promise<{ response: string | null; }>; subscribe(agentId: string, params?: ServiceParams): Promise; getSeraphEvents(params?: ServiceParams): Promise; createSeraphEvent(data: ISeraphEvent): Promise; deleteSeraphEvent(data: any): Promise; createRelease({ agentId, description, agentToCopyId, }: { agentId: string; description: string; agentToCopyId: string; }): Promise<{ spellReleaseId: string; }>; create(data: AgentData | AgentData[] | any): Promise; patch(agentId: string, params: AgentPatch): Promise<{ description?: string | null | undefined; createdAt?: string | undefined; worldId?: string | undefined; updatedAt?: string | undefined; enabled?: boolean | undefined; currentSpellReleaseId?: string | null | undefined; isDraft?: boolean | undefined; draftAgentId?: string | undefined; image?: string | null | undefined; id: string; projectId: string; name: string; version: string; }>; remove(agentId: string, params?: ServiceParams): Promise<{ description?: string | null | undefined; createdAt?: string | undefined; worldId?: string | undefined; updatedAt?: string | undefined; enabled?: boolean | undefined; currentSpellReleaseId?: string | null | undefined; isDraft?: boolean | undefined; draftAgentId?: string | undefined; image?: string | null | undefined; id: string; projectId: string; name: string; version: string; }>; } /** * Returns options needed to initialize the AgentService. * * @param app - the Feathers application * @returns KnexAdapterOptions - options for initializing the Knex adapter */ export declare const getOptions: (app: Application) => KnexAdapterOptions; export {};