import { TSchema } from "typebox"; import { AgentTool, AgentToolResult, AgentToolUpdateCallback } from "@earendil-works/pi-agent-core"; //#region src/agents/image-sanitization.d.ts type ImageSanitizationLimits = { maxDimensionPx?: number; maxBytes?: number; }; //#endregion //#region src/agents/tools/common.d.ts type AgentToolWithMeta = AgentTool & { displaySummary?: string; }; type ErasedAgentToolExecute = { execute(this: void, toolCallId: string, params: unknown, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback): Promise>; }; type AnyAgentTool = Omit, "execute"> & ErasedAgentToolExecute & { displaySummary?: string; }; declare function asToolParamsRecord(params: unknown): Record; type StringParamOptions = { required?: boolean; trim?: boolean; label?: string; allowEmpty?: boolean; }; type ActionGate> = (key: keyof T, defaultValue?: boolean) => boolean; declare class ToolInputError extends Error { readonly status: number; constructor(message: string); } declare class ToolAuthorizationError extends ToolInputError { readonly status = 403; constructor(message: string); } declare function createActionGate>(actions: T | undefined): ActionGate; declare function readStringParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string; declare function readStringParam(params: Record, key: string, options?: StringParamOptions): string | undefined; /** * Normalize tool model override input. * - empty/whitespace => undefined * - "default" (case-insensitive) => undefined (sentinel: reset/fallback) * - otherwise returns trimmed explicit model string */ declare function normalizeToolModelOverride(value: string | undefined): string | undefined; declare function readStringOrNumberParam(params: Record, key: string, options?: { required?: boolean; label?: string; }): string | undefined; declare function readNumberParam(params: Record, key: string, options?: { required?: boolean; label?: string; integer?: boolean; strict?: boolean; }): number | undefined; declare function readStringArrayParam(params: Record, key: string, options: StringParamOptions & { required: true; }): string[]; declare function readStringArrayParam(params: Record, key: string, options?: StringParamOptions): string[] | undefined; type ReactionParams = { emoji: string; remove: boolean; isEmpty: boolean; }; declare function readReactionParams(params: Record, options: { emojiKey?: string; removeKey?: string; removeErrorMessage: string; }): ReactionParams; declare function stringifyToolPayload(payload: unknown): string; declare function textResult(text: string, details: TDetails): AgentToolResult; declare function failedTextResult(text: string, details: TDetails): AgentToolResult; declare function payloadTextResult(payload: TDetails): AgentToolResult; declare function jsonResult(payload: unknown): AgentToolResult; declare function imageResult(params: { label: string; path: string; base64: string; mimeType: string; extraText?: string; details?: Record; imageSanitization?: ImageSanitizationLimits; }): Promise>; declare function imageResultFromFile(params: { label: string; path: string; extraText?: string; details?: Record; imageSanitization?: ImageSanitizationLimits; }): Promise>; type AvailableTag = { id?: string; name: string; moderated?: boolean; emoji_id?: string | null; emoji_name?: string | null; }; /** * Validate and parse an `availableTags` parameter from untrusted input. * Returns `undefined` when the value is missing or not an array. * Entries that lack a string `name` are silently dropped. */ declare function parseAvailableTags(raw: unknown): AvailableTag[] | undefined; //#endregion export { stringifyToolPayload as C, readStringParam as S, payloadTextResult as _, ReactionParams as a, readStringArrayParam as b, ToolInputError as c, failedTextResult as d, imageResult as f, parseAvailableTags as g, normalizeToolModelOverride as h, AvailableTag as i, asToolParamsRecord as l, jsonResult as m, AgentToolWithMeta as n, StringParamOptions as o, imageResultFromFile as p, AnyAgentTool as r, ToolAuthorizationError as s, ActionGate as t, createActionGate as u, readNumberParam as v, textResult as w, readStringOrNumberParam as x, readReactionParams as y };