import type { ImageContent, TextContent } from "@bastani/pi-ai/compat"; import type { AgentMessage } from "@earendil-works/pi-agent-core"; import type { AgentSessionInternalSurface as AgentSession } from "./agent-session-methods.ts"; import type { PromptDisposition, PromptOptions, QueuedInputDisposition } from "./agent-session-types.js"; import type { CustomMessage } from "./messages.ts"; export declare function waitForCustomMessagePreparation(session: AgentSession): Promise; type UserMessageDeliveryAction = "prompt" | "steer" | "followUp" | "handled"; type PromptOptionsWithWorkflowDelivery = PromptOptions & { readonly __workflowDelivery?: { readonly beforeDelivery?: () => void; /** Called only after an idle prompt has synchronously entered the agent turn. */ readonly promptStarted?: () => void; readonly delivered?: (action: UserMessageDeliveryAction) => void; }; }; /** Dispatch registered extension slash commands without changing the raw queue pause gate. */ export declare function tryExecuteSessionSlashCommand(session: Pick, text: string): Promise; export declare function prompt(this: AgentSession, text: string, options?: PromptOptions): Promise; export declare function _runAgentPrompt(this: AgentSession, messages: AgentMessage | AgentMessage[], promptStarted?: () => void, reportDispatch?: (disposition: PromptDisposition) => void, prepared?: boolean, customStarter?: CustomMessage): Promise; export declare function _runAgentContinue(this: AgentSession): Promise; export declare function _continueQueuedAgentMessages(this: AgentSession): Promise; /** * Try to execute an extension command. Returns true if command was found and executed. */ export declare function _tryExecuteExtensionCommand(this: AgentSession, text: string): Promise; /** * Expand skill commands (/skill:name args) to their full content. * Returns the expanded text, or the original text if not a skill command or skill not found. * Emits errors via extension runner if file read fails. */ export declare function _expandSkillCommand(this: AgentSession, text: string): string; /** * Queue a steering message while the agent is running. * Delivered after the current assistant turn finishes executing its tool calls, * before the next LLM call. * Expands skill commands and prompt templates. Errors on extension commands. * @param images Optional image attachments to include with the message * @throws Error if text is an extension command */ export declare function steer(this: AgentSession, text: string, images?: ImageContent[], options?: Pick): Promise; /** * Queue a follow-up message to be processed after the agent finishes. * Delivered only when agent has no more tool calls or steering messages. * Expands skill commands and prompt templates. Errors on extension commands. * @param images Optional image attachments to include with the message * @throws Error if text is an extension command */ export declare function followUp(this: AgentSession, text: string, images?: ImageContent[], options?: Pick): Promise; /** * Send a user message and trigger a turn. * * By default the text is delivered literally: extension commands are not * dispatched and skill commands / prompt templates are not expanded. Set * `expandPromptTemplates: true` to dispatch a registered extension or skill * command (or expand a prompt template) instead of sending the raw text — * with that option the message may DISPATCH a command rather than be sent. * * @param content User message content (string or content array) * @param options.deliverAs Delivery mode when streaming: "steer" or "followUp" * @param options.expandPromptTemplates Whether to dispatch extension commands and expand skill commands and prompt templates. Default: false. */ export declare function sendUserMessage(this: AgentSession, content: string | (TextContent | ImageContent)[], options?: { deliverAs?: "steer" | "followUp"; expandPromptTemplates?: boolean; __workflowDelivery?: PromptOptionsWithWorkflowDelivery["__workflowDelivery"]; }): Promise; /** * Clear all queued messages and return them. * Useful for restoring to editor when user aborts. * @returns Object with steering and followUp arrays */ export declare const agentSessionPromptMethods: { prompt: typeof prompt; _runAgentPrompt: typeof _runAgentPrompt; _runAgentContinue: typeof _runAgentContinue; _continueQueuedAgentMessages: typeof _continueQueuedAgentMessages; _tryExecuteExtensionCommand: typeof _tryExecuteExtensionCommand; _expandSkillCommand: typeof _expandSkillCommand; steer: typeof steer; followUp: typeof followUp; sendUserMessage: typeof sendUserMessage; }; export {}; //# sourceMappingURL=agent-session-prompt.d.ts.map