import { n as Principal } from "./context-Ewez0LPe.js"; import { i as AnyAction } from "./agent-l2XeyIGm.js"; import { r as FileStore } from "./agent-files-C7oZVYjV.js"; import { AuthorizeAnswer, ChannelPolicy, InboundEvent, InputAnnouncement, ProactiveTrigger, Tool, TurnEvent } from "./agent-runtime.js"; import { n as ConnectionReport, t as Connection } from "./connections-C_A_Pask.js"; //#region src/agent-config.d.ts export type Skill = { name: string; description: string; whenToUse?: string; body: string; }; export declare function parseSkill(name: string, text: string): Skill; export type ChannelContext = { agent: AgentDefinition; run: (message: string, opts?: { session?: string; turnId?: string; event?: InboundEvent; trigger?: ProactiveTrigger; replace?: boolean; }) => Promise; runStream?: (message: string, opts?: { session?: string; turnId?: string; event?: InboundEvent; trigger?: ProactiveTrigger; replace?: boolean; }) => AsyncIterable; runDetached?: (message: string, opts?: { session?: string; turnId?: string; event?: InboundEvent; trigger?: ProactiveTrigger; replace?: boolean; ifSuspended?: "reject" | "queue"; }) => Promise<{ turnId: string; queued?: true; }>; runDelivered?: (message: string, opts?: { session?: string; turnId?: string; event?: InboundEvent; trigger?: ProactiveTrigger; replace?: boolean; ifSuspended?: "reject" | "queue"; }) => Promise<{ turnId: string; queued?: true; }>; resumeStream?: (opts: { session?: string; turnId: string; inputId: string; input: unknown; by?: string; principal?: Principal; }) => AsyncIterable; resumeDelivered?: (opts: { session?: string; turnId: string; inputId: string; input: unknown; by?: string; principal?: Principal; source: string; target: ResumeDeliveryTarget; }) => Promise<{ turnId: string; }>; resetSession?: (opts?: { session?: string; }) => Promise<{ previousSession: string; generation: number; }>; waitUntil?: (p: Promise) => void; files?: FileStore; services?: unknown; }; export declare class DeliverUnsupportedError extends Error { constructor(message: string); } export type DeliveryTarget = { channelId: string; threadId?: string; recipientUserId?: string; recipientTeamId?: string; }; export type ResumeDeliveryTarget = { channelId: string; threadId?: string; messageTs: string; }; export type PostContent = string | { text?: string; blocks?: unknown[]; note?: boolean; }; export type PostedMessage = { channelId: string; threadId?: string; ts: string; }; export type Channel = { name: string; start?: (ctx: ChannelContext) => Promise | void; deliver?: (target: DeliveryTarget, events: AsyncIterable, opts?: { session?: string; files?: FileStore; }) => Promise; deliverResume?: (target: ResumeDeliveryTarget, events: AsyncIterable, opts?: { session?: string; files?: FileStore; }) => Promise; post?: (target: DeliveryTarget, content: PostContent) => Promise; fetch?: (ctx: ChannelContext) => (req: Request) => Promise; path?: string; webhook?: (req: Request, ctx: ChannelContext) => Promise; tools?: () => Tool[]; }; export declare function defineChannel(channel: Channel): Channel; export type ChannelFactory = (env: any) => Channel; export type SurfaceConfig = { mode?: "append" | "replace"; denyTools?: string[]; }; export declare function surfacePolicies(opts: { agent?: string; surfaces?: Record; surfaceInstructions?: Record; channelInstructions?: Record; channelNames?: string[]; }): Record | undefined; export declare function resolveChannel(channel: Channel | ChannelFactory, env: unknown): Channel; export type AgentConfigFile = { name: string; model?: string; description?: string; instructions?: string; surfaces?: Record; authorizeAnswer?: AuthorizeAnswer; onInputAnnouncement?: (a: InputAnnouncement) => void | Promise; }; export type AgentDefinition = { name: string; model?: string; description?: string; instructions: string; tools: Tool[]; skills: Skill[]; channels: Channel[]; channelInstructions?: Record; connections: ConnectionReport[]; authorizeAnswer?: AuthorizeAnswer; onInputAnnouncement?: (a: InputAnnouncement) => void | Promise; }; export declare function actionToTool(action: AnyAction): Tool; export type ToolEntry = AnyAction | Tool | (AnyAction | Tool)[]; export declare function readSkillTool(skills: Skill[]): Tool; export declare function defineAgent(config: { name: string; model?: string; description?: string; instructions?: string; tools?: ToolEntry[]; skills?: Skill[]; channels?: Channel[]; surfaces?: Record; surfaceInstructions?: Record; channelInstructions?: Record; connections?: ConnectionReport[]; authorizeAnswer?: AuthorizeAnswer; onInputAnnouncement?: (a: InputAnnouncement) => void | Promise; }): AgentDefinition; export declare function channelFetch(agent: AgentDefinition, ctx: ChannelContext): (req: Request) => Promise; export declare function channelDispatch(channels: Channel[], ctx: ChannelContext): (req: Request) => Promise; export declare function buildSystemPrompt(agent: Pick): string; export type AgentModule = { config: AgentConfigFile; instructions: string; tools: ToolEntry[]; skills: Skill[]; channels: Record; surfaceInstructions?: Record; channelInstructions: Record; connections: Connection[]; }; export declare function assembleAgent(mod: AgentModule, env?: unknown): Promise; export declare function assembleDurable(mod: AgentModule): { name: string; tools: Tool[]; instructions: string; channelInstructions?: Record; channels: (Channel | ChannelFactory)[]; connections: Connection[]; authorizeAnswer?: AuthorizeAnswer; onInputAnnouncement?: (a: InputAnnouncement) => void | Promise; }; //#endregion export type { ChannelPolicy, InboundEvent };