/** * Tool result helpers — convenience functions for creating tool results. * * Reimplemented from OpenClaw's `common.ts` helpers. * Original source: openclaw/src/agents/tools/common.ts (MIT license) * * @module */ import type { ToolResult } from "../types.js"; /** * Create a tool result containing JSON text. * * This is the most common pattern for tool results — the payload is * serialized as pretty-printed JSON. * * @param payload - Any JSON-serializable value. * @returns A ToolResult with the payload as formatted JSON text. */ export declare function jsonResult(payload: unknown): ToolResult; /** * Create a tool result containing plain text. * * @param text - The text content. * @param details - Optional structured details. * @returns A ToolResult with the text content. */ export declare function textResult(text: string, details?: unknown): ToolResult; /** * Create a tool result containing an error. * * Error results follow OpenClaw's convention of returning a JSON object * with `status: "error"` so the LLM can distinguish errors from normal results. * * @param toolName - The tool that produced the error. * @param error - Error message or description. * @returns A ToolResult formatted as an error. */ export declare function errorResult(toolName: string, error: string): ToolResult; /** * Create a tool result containing an image. * * @param params - Image parameters. * @returns A ToolResult with both text and image content blocks. */ export declare function imageResult(params: { label: string; base64: string; mimeType: string; path?: string; extraText?: string; details?: Record; }): ToolResult; //# sourceMappingURL=helpers.d.ts.map