import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { ImageContent, TextContent } from "@oh-my-pi/pi-ai"; import { type CustomMessage, SKILL_PROMPT_MESSAGE_TYPE, type SkillPromptDetails } from "../session/messages.js"; import type { InteractiveModeContext } from "./types.js"; type SkillCommandHost = Pick & { session: Pick; }; type SkillPromptMessage = Pick, "customType" | "content" | "display" | "details" | "attribution"> & { customType: typeof SKILL_PROMPT_MESSAGE_TYPE; content: string | (TextContent | ImageContent)[]; display: true; details: SkillPromptDetails; attribution: "user"; }; type SkillPromptOptions = { streamingBehavior: "steer" | "followUp"; queueChipText: string; }; interface InvokeSkillCommandOptions { propagateErrors?: boolean; queueOnly?: boolean; images?: ImageContent[]; imageLinks?: (string | undefined)[]; /** * Paint the built row before the awaited dispatch so a slow preflight (memory * recall, `before_agent_start` hooks, auto-thinking, pre-prompt compaction) * does not leave the submission invisible (issue #8895). */ optimistic?: boolean; /** With `queueOnly`: called with the messages the skill prompt pushed onto a queue (see `PromptOptions.onPromptQueued`). */ onPromptQueued?: (queued: readonly AgentMessage[]) => void; /** * Without `queueOnly`: prompts that must run after the skill, in order (see `PromptOptions.followUps`). * If the skill fails before reaching the session, it goes back to the editor with them as one list. */ followUps?: string[]; } /** Built custom-message payload and delivery options for a `/skill:` command. */ export interface BuiltSkillCommandPrompt { message: SkillPromptMessage; options: SkillPromptOptions; } /** Return true when `text` invokes a registered `/skill:` command. */ export declare function isKnownSkillCommand(ctx: SkillCommandHost, text: string): boolean; /** Build the user-attributed custom message for a registered `/skill:` command. */ export declare function buildSkillCommandPrompt(ctx: SkillCommandHost, text: string, streamingBehavior: "steer" | "followUp", images?: ImageContent[]): Promise; /** Invoke a registered `/skill:` command as a user-attributed custom message. */ export declare function invokeSkillCommandFromText(ctx: SkillCommandHost, text: string, streamingBehavior: "steer" | "followUp", options?: InvokeSkillCommandOptions): Promise; export {};