import type { AFSOptions } from "@aigne/afs"; import { type ZodType, z } from "zod"; import type { AgentHooks, TaskRenderMode } from "../agents/agent.js"; import type { LoadOptions } from "./index.js"; import { chatModelSchema, imageModelSchema } from "./schema.js"; export interface HooksSchema { priority?: AgentHooks["priority"]; onStart?: NestAgentSchema; onSuccess?: NestAgentSchema; onError?: NestAgentSchema; onEnd?: NestAgentSchema; onSkillStart?: NestAgentSchema; onSkillEnd?: NestAgentSchema; onHandoff?: NestAgentSchema; } export type NestAgentSchema = string | { url: string; defaultInput?: Record; hooks?: HooksSchema | HooksSchema[]; } | AgentSchema; export type AFSModuleSchema = string | { module: string; options?: Record; }; export interface AFSContextPresetSchema { view?: string; select?: { agent: NestAgentSchema; }; per?: { agent: NestAgentSchema; }; dedupe?: { agent: NestAgentSchema; }; } export interface AFSContextSchema { search?: { presets?: Record; }; list?: { presets?: Record; }; } export interface AgentSchema { type: string; name?: string; description?: string; model?: z.infer; imageModel?: z.infer; taskTitle?: string; taskRenderMode?: TaskRenderMode; inputSchema?: ZodType>; defaultInput?: Record; outputSchema?: ZodType>; includeInputInOutput?: boolean; skills?: NestAgentSchema[]; hooks?: HooksSchema | HooksSchema[]; memory?: boolean | { provider: string; subscribeTopic?: string[]; }; afs?: boolean | (Omit & { modules?: AFSModuleSchema[]; context?: AFSContextSchema; }); shareAFS?: boolean; [key: string]: unknown; } export declare function parseAgentFile(path: string, data: any, options: LoadOptions): Promise; export declare function loadAgentFromYamlFile(path: string, options: LoadOptions): Promise; export declare const getAgentSchema: ({ filepath }: { filepath: string; options?: LoadOptions; }) => ZodType; export declare const getNestAgentSchema: ({ filepath, }: { filepath: string; }) => ZodType;