/** * Schema-aware context extraction for intelligent prompt generation. * * Uses Sanity's schema introspection to read field validation rules, * descriptions, and sibling field values to generate richer, more * context-aware prompts. * * Closes #67. */ import type { SchemaType } from 'sanity'; export interface SchemaFieldMeta { /** The field name. */ name: string; /** The field title (human-readable). */ title: string; /** The schema-level description, if defined. */ description: string | null; /** The base type ('image' or 'file'). */ baseType: 'image' | 'file'; /** Whether hotspot/crop is enabled for the field. */ hasHotspot: boolean; /** Accept filter if defined on a file field (e.g. 'image/*', 'video/*'). */ acceptFilter: string | null; } /** * Extract metadata about a specific image/file field from the schema. */ export declare function getFieldMeta(schemaType: SchemaType | undefined, fieldName: string): SchemaFieldMeta | null; /** A key-value pair extracted from sibling fields. */ export interface SiblingValue { fieldName: string; title: string; value: string; } /** * Extract useful sibling field values from the document that could * enrich a media generation prompt. * * @param schemaType The document schema type. * @param getFieldValue A callback that reads a field value (typically from useFormValue). */ export declare function extractSiblingContext(schemaType: SchemaType | undefined, getFieldValue: (fieldName: string) => unknown): SiblingValue[]; /** * Build a context-rich prompt suggestion from schema metadata and * sibling field values. */ export declare function buildSchemaAwarePrompt(fieldMeta: SchemaFieldMeta | null, siblingValues: SiblingValue[], documentType: string | undefined, documentTitle: string | undefined): string | null;