import { t as TUnsafe } from "../../unsafe-C_mX8nG4.mjs"; import { t as TOptional } from "../../optional-Bis1WTKK.mjs"; //#region extensions/crypto/src/lib/tool-helpers.d.ts /** * Tool helper utilities — matches OpenClaw's AnyAgentTool patterns. * * These mirror the helpers from openclaw/plugin-sdk but are self-contained * so the extension can work without a direct import dependency on openclaw internals. */ /** * Create a string enum schema (required). * Matches OpenClaw's `stringEnum()` from src/agents/schema/typebox.ts */ declare function stringEnum(values: T, options?: Record): TUnsafe; /** * Create an optional string enum schema. */ declare function optionalStringEnum(values: T, options?: Record): TOptional>; /** * Wrap a value as a JSON tool result. * Matches OpenClaw's `jsonResult()` from src/agents/tools/common.ts * Returns AgentToolResult shape: { content: [...], details: T } */ declare function jsonResult(data: unknown): { content: Array<{ type: 'text'; text: string; }>; details: unknown; }; /** * Wrap a plain text string as a tool result. */ declare function textResult(text: string): { content: Array<{ type: 'text'; text: string; }>; details: unknown; }; /** * Create an error result. */ declare function errorResult(message: string): { content: Array<{ type: 'text'; text: string; }>; details: unknown; isError: true; }; /** * Read a string parameter, supporting both camelCase and snake_case keys. * Matches OpenClaw's `readStringParam()`. */ declare function readStringParam(params: Record, key: string, opts?: { required?: boolean; }): string | undefined; /** * Read a number parameter. */ declare function readNumberParam(params: Record, key: string, opts?: { required?: boolean; }): number | undefined; declare class ToolInputError extends Error { constructor(message: string); } declare class ToolAuthorizationError extends Error { constructor(message: string); } //#endregion export { ToolAuthorizationError, ToolInputError, errorResult, jsonResult, optionalStringEnum, readNumberParam, readStringParam, stringEnum, textResult }; //# sourceMappingURL=tool-helpers.d.mts.map