import { d as AgentToolProgress, f as AgentToolResult, l as AgentTool, p as AgentToolUpdateCallback } from "./types-D0CdrmU4.js"; import { TSchema } from "typebox"; //#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; prepareBeforeToolCallParams?: (params: unknown, ctx: { toolCallId?: string; hookContext?: unknown; signal?: AbortSignal; }) => unknown; finalizeBeforeToolCallParams?: (params: unknown, preparedParams: unknown) => unknown; }; type ErasedAgentToolExecute = { execute(this: void, toolCallId: string, params: unknown, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback): Promise>; }; type AnyAgentTool = Omit & ErasedAgentToolExecute & { displaySummary?: string; prepareBeforeToolCallParams?: AgentToolWithMeta["prepareBeforeToolCallParams"]; finalizeBeforeToolCallParams?: AgentToolWithMeta["finalizeBeforeToolCallParams"]; }; 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; positiveInteger?: boolean; nonNegativeInteger?: boolean; }): number | undefined; declare function readPositiveIntegerParam(params: Record, key: string, options?: { message?: string; max?: number; }): number | undefined; declare function readNonNegativeIntegerParam(params: Record, key: string, options?: { message?: string; max?: number; }): number | undefined; declare function readFiniteNumberParam(params: Record, key: string, options?: { message?: string; min?: number; max?: number; minExclusive?: boolean; maxExclusive?: 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 failedTextResult(text: string, details: TDetails): AgentToolResult; declare function payloadTextResult(payload: TDetails): AgentToolResult; type PublicToolProgress = Pick; declare function toolProgressResult(progress: PublicToolProgress): AgentToolResult; declare function emitToolProgress(onUpdate: AgentToolUpdateCallback | undefined, progress: PublicToolProgress): void; declare function scheduleToolProgress(onUpdate: AgentToolUpdateCallback | undefined, progress: PublicToolProgress, delayMs: number, options?: { signal?: AbortSignal; }): () => void; 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 { readReactionParams as C, scheduleToolProgress as D, readStringParam as E, stringifyToolPayload as O, readPositiveIntegerParam as S, readStringOrNumberParam as T, parseAvailableTags as _, PublicToolProgress as a, readNonNegativeIntegerParam as b, ToolAuthorizationError as c, createActionGate as d, emitToolProgress as f, normalizeToolModelOverride as g, imageResultFromFile as h, AvailableTag as i, toolProgressResult as k, ToolInputError as l, imageResult as m, AgentToolWithMeta as n, ReactionParams as o, failedTextResult as p, AnyAgentTool as r, StringParamOptions as s, ActionGate as t, asToolParamsRecord as u, payloadTextResult as v, readStringArrayParam as w, readNumberParam as x, readFiniteNumberParam as y };