import { type ImageMetadata, type SerializedSchema, type Source } from "@valbuild/core"; import { Patch } from "../zod/Patch.js"; import type { ToolName } from "./toolNames.js"; export type CombinedImageMetadata = ImageMetadata; type GalleryArgs = { filePath: string; imageKey: string; metadata: CombinedImageMetadata; }; type RemoveGalleryArgs = { filePath: string; }; export type BuildResult = { kind: "ok"; patch: Patch; } | { kind: "wrong-tool"; suggestedTool: ToolName; reason: string; } | { kind: "error"; message: string; }; export declare function buildFileRefValue(filePath: string, metadata: Record): Record; export declare function getSourceAt(source: Source | undefined, path: string[]): Source | undefined; export type ResolveResult = { kind: "leaf"; schema: SerializedSchema; } | { kind: "richtext"; schema: SerializedSchema; remainingPath: string[]; } | { kind: "gallery-traversed"; schema: SerializedSchema; } | { kind: "unresolved"; }; /** * Walks `schema` along `path`, returning a structured result: * - `leaf`: walked the full path; resolved schema at the end. * - `richtext`: hit a richtext mid-walk; richtext is the resolved schema. * - `gallery-traversed`: hit an `s.imagedir()` record and walked past it (i.e. the * path tries to address an entry inside the gallery — a clue the AI should * have used the gallery tool instead). * - `unresolved`: the path could not be walked. */ export declare function resolveSerializedSchemaAtPath(schema: SerializedSchema, path: string[]): ResolveResult; export type InlineImgInfo = { kind: "not-allowed"; } | { kind: "allowed"; remote: boolean; }; export declare function getInlineImgInfo(richtextSchema: SerializedSchema): InlineImgInfo; export declare function isRemoteSchema(schema: SerializedSchema): boolean; export declare function safeParsePatch(patch: unknown[]): BuildResult; export declare function buildImageGalleryPatch(args: GalleryArgs, moduleSchema: SerializedSchema): BuildResult; export declare function buildRemoveImageGalleryEntryPatch(args: RemoveGalleryArgs, moduleSchema: SerializedSchema, moduleSource: Source | undefined): BuildResult; export {};