/** * The canonical verb table: every verb the media DSL knows, with arg schemas, engine * requirements, format-family applicability, and output kinds. * * @remarks * Internal sibling of the `@nhtio/adk/batteries/media` entry. This table is the single source * of truth consumed by: * * - the pipe parser's semantic validator (unknown-verb/arg detection, did-you-mean), * - the plan compiler (arg coercion + constraint checks), * - the engine-narrowing pass (which verbs a deployment advertises), * - the forge (generating the `media_query` tool description and few-shot examples), * - the builder (typed front-end methods map 1:1 onto entries here). * * Frozen design decisions (design doc section 0): canonical verb ids are dot-namespaced * snake_case; verb matching is separator-insensitive (space/`_`/`.` fold); args are named-only; * indices are 1-based everywhere; arg names follow one-meaning-one-name (`to`, `with`, `match`, * `replace`, `order`, `pages`, `at`). */ /** The value type of a single declared arg. */ export type VerbArgType = 'string' | 'number' | 'boolean' | 'enum' | 'number-list' | 'string-list' | 'regex-or-string-list' | 'name-or-index' | 'media-ref' | 'media-ref-list' | 'json'; /** Declaration of one named arg on a verb. */ export interface VerbArgSpec { /** The arg's value type. */ type: VerbArgType; /** Whether the statement must supply this arg. */ required?: boolean; /** Legal values when `type === 'enum'` (or per-element for list types). */ values?: readonly string[]; /** Inclusive minimum for numbers / per-element for number lists. */ min?: number; /** Inclusive maximum for numbers / per-element for number lists. */ max?: number; /** Model-facing description used in generated tool grammar text. */ description: string; } /** * A verb's capability requirement against the deployment's engine registry. Verbs with no * requirement are always advertised; input-conditional engine needs (e.g. `extract.text` * needing OCR only for images) stay runtime checks inside the step implementation. */ export type VerbRequirement = { capability: 'convert'; from?: string; to?: string; } | { capability: 'mutate'; } | { capability: 'edit'; op?: string; }; /** Broad input families used for verb-applicability checks. */ export type FormatFamily = 'document' | 'spreadsheet' | 'presentation' | 'image' | 'audio' | 'any'; /** What awaiting a chain ending in this verb resolves to. */ export type VerbOutput = 'media' | 'media-list' | 'text' | 'json'; /** One verb table entry. */ export interface VerbSpec { /** Canonical id: dot-namespaced snake_case (`extract.text`, `sheet.update_cells`). */ id: string; /** Model-facing one-line description. */ description: string; /** Named args (named-only grammar; no positionals). */ args: Record; /** * Capability the verb always requires, if any — gates whether the verb is advertised and * accepted under a given engine configuration. Input-conditional needs are handled (and * error-messaged) by the step implementation at runtime. */ requires?: VerbRequirement; /** Input families the verb applies to. */ appliesTo: readonly FormatFamily[]; /** Output kind. May be refined by an `out`-style arg (documented per verb). */ output: VerbOutput; } /** Conversion targets supported by `convert` (the server's enum plus the SheetJS/data matrix). */ export declare const CONVERT_TARGETS: readonly [ "pdf", "html", "txt", "md", "csv", "json", "yaml", "docx", "doc", "rtf", "odt", "xlsx", "xls", "ods", "xlsm", "xlsb", "fods", "sylk", "dif", "dbf", "numbers", "pptx", "ppt", "odp" ]; /** Image output formats supported by `image.format`. */ export declare const IMAGE_FORMATS: readonly [ "png", "jpg", "jpeg", "webp", "tiff", "avif" ]; /** The canonical verb table. Order is presentation order in generated grammar text. */ export declare const VERBS: readonly VerbSpec[]; /** Map of canonical verb id → spec, for direct lookup. */ export declare const VERB_INDEX: ReadonlyMap; /** * Fold a verb token sequence to canonical form: lowercase, separators (space/`_`/`.`) * normalized so `extract_text` ≡ `extract text` ≡ `extract.text` all match `extract.text`. * * @param words - The verb word tokens as written (1 or 2 words, possibly containing `_`/`.`). * @returns The canonical verb id when a fold-match exists, otherwise `undefined`. */ export declare const foldVerb: (words: string[]) => string | undefined; /** * All folded verb word-sequences, for the parser's longest-match verb recognition and for * generated grammar text. */ export declare const FOLDED_VERBS: readonly string[]; /** * Suggest the nearest verbs to an unknown input, for did-you-mean errors. Matches whole folded * forms AND suffix words (`resize` suggests `image resize`), per the frozen error model. * * @param input - The unknown verb text as written. * @param candidates - The folded verb forms to search (pass the narrowed set to avoid * suggesting unconfigured verbs). * @returns Up to three suggestions, best first. */ export declare const suggestVerbs: (input: string, candidates: readonly string[]) => string[];