| import type { ImageContent } from "@mariozechner/pi-ai"; |
| import type { ReasoningLevel, ThinkLevel, VerboseLevel } from "../../../auto-reply/thinking.js"; |
| import type { ReplyPayload } from "../../../auto-reply/types.js"; |
| import type { AgentStreamParams } from "../../../commands/agent/types.js"; |
| import type { OpenClawConfig } from "../../../config/config.js"; |
| import type { enqueueCommand } from "../../../process/command-queue.js"; |
| import type { InputProvenance } from "../../../sessions/input-provenance.js"; |
| import type { ExecElevatedDefaults, ExecToolDefaults } from "../../bash-tools.js"; |
| import type { BlockReplyPayload } from "../../pi-embedded-payloads.js"; |
| import type { BlockReplyChunking, ToolResultFormat } from "../../pi-embedded-subscribe.js"; |
| import type { SkillSnapshot } from "../../skills.js"; |
|
|
| |
| export type ClientToolDefinition = { |
| type: "function"; |
| function: { |
| name: string; |
| description?: string; |
| parameters?: Record<string, unknown>; |
| }; |
| }; |
|
|
| export type RunEmbeddedPiAgentParams = { |
| sessionId: string; |
| sessionKey?: string; |
| agentId?: string; |
| messageChannel?: string; |
| messageProvider?: string; |
| agentAccountId?: string; |
| |
| trigger?: string; |
| |
| memoryFlushWritePath?: string; |
| |
| messageTo?: string; |
| |
| messageThreadId?: string | number; |
| |
| groupId?: string | null; |
| |
| groupChannel?: string | null; |
| |
| groupSpace?: string | null; |
| |
| spawnedBy?: string | null; |
| senderId?: string | null; |
| senderName?: string | null; |
| senderUsername?: string | null; |
| senderE164?: string | null; |
| |
| senderIsOwner?: boolean; |
| |
| currentChannelId?: string; |
| |
| currentThreadTs?: string; |
| |
| currentMessageId?: string | number; |
| |
| replyToMode?: "off" | "first" | "all"; |
| |
| hasRepliedRef?: { value: boolean }; |
| |
| requireExplicitMessageTarget?: boolean; |
| |
| disableMessageTool?: boolean; |
| sessionFile: string; |
| workspaceDir: string; |
| agentDir?: string; |
| config?: OpenClawConfig; |
| skillsSnapshot?: SkillSnapshot; |
| prompt: string; |
| images?: ImageContent[]; |
| |
| clientTools?: ClientToolDefinition[]; |
| |
| disableTools?: boolean; |
| provider?: string; |
| model?: string; |
| authProfileId?: string; |
| authProfileIdSource?: "auto" | "user"; |
| thinkLevel?: ThinkLevel; |
| fastMode?: boolean; |
| verboseLevel?: VerboseLevel; |
| reasoningLevel?: ReasoningLevel; |
| toolResultFormat?: ToolResultFormat; |
| |
| suppressToolErrorWarnings?: boolean; |
| |
| bootstrapContextMode?: "full" | "lightweight"; |
| |
| bootstrapContextRunKind?: "default" | "heartbeat" | "cron"; |
| |
| bootstrapPromptWarningSignaturesSeen?: string[]; |
| |
| bootstrapPromptWarningSignature?: string; |
| execOverrides?: Pick<ExecToolDefaults, "host" | "security" | "ask" | "node">; |
| bashElevated?: ExecElevatedDefaults; |
| timeoutMs: number; |
| runId: string; |
| abortSignal?: AbortSignal; |
| shouldEmitToolResult?: () => boolean; |
| shouldEmitToolOutput?: () => boolean; |
| onPartialReply?: (payload: { text?: string; mediaUrls?: string[] }) => void | Promise<void>; |
| onAssistantMessageStart?: () => void | Promise<void>; |
| onBlockReply?: (payload: BlockReplyPayload) => void | Promise<void>; |
| onBlockReplyFlush?: () => void | Promise<void>; |
| blockReplyBreak?: "text_end" | "message_end"; |
| blockReplyChunking?: BlockReplyChunking; |
| onReasoningStream?: (payload: { text?: string; mediaUrls?: string[] }) => void | Promise<void>; |
| onReasoningEnd?: () => void | Promise<void>; |
| onToolResult?: (payload: ReplyPayload) => void | Promise<void>; |
| onAgentEvent?: (evt: { stream: string; data: Record<string, unknown> }) => void; |
| lane?: string; |
| enqueue?: typeof enqueueCommand; |
| extraSystemPrompt?: string; |
| inputProvenance?: InputProvenance; |
| streamParams?: AgentStreamParams; |
| ownerNumbers?: string[]; |
| enforceFinalTag?: boolean; |
| |
| |
| |
| |
| |
| |
| |
| allowTransientCooldownProbe?: boolean; |
| }; |
|
|