import { z } from 'zod'; /** * License values accepted by template metadata. * * CC-BY-4.0 and CC0-1.0 templates may be redistributed as OpenAgreements * content. CC-BY-ND-4.0 templates are vendored only when unmodified and must * declare `allow_derivatives: false`. */ export declare const LicenseEnum: z.ZodEnum<{ "CC-BY-4.0": "CC-BY-4.0"; "CC0-1.0": "CC0-1.0"; "CC-BY-ND-4.0": "CC-BY-ND-4.0"; }>; export type License = z.infer; /** Field kinds supported by template, external-template, and recipe metadata. */ declare const FieldTypeEnum: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; date: "date"; enum: "enum"; array: "array"; multiselect: "multiselect"; }>; export type FieldType = z.infer; /** * Metadata definition for a fillable field. * * `name`, `type`, and `description` are required. `enum` and `multiselect` * fields must declare non-empty `options`; `array` fields may declare nested * `items`; `display_label` is a presentation hint and never replaces `name`. */ export interface FieldDefinition { name: string; type: FieldType; description: string; display_label?: string; default?: string; default_value_rationale?: string; options?: string[]; derive_booleans?: boolean; section?: string; items?: FieldDefinition[]; /** * Marks this boolean field as a *statutory compliance representation*: its * `true` value asserts a past real-world fact that is a statutory precondition * to the agreement's enforceability/validity (e.g. a required advance notice * or written advisal that must actually have been given before signing). * * Deliberately NARROW — opt-in per field and reserved for the few reps that * gate enforceability, NOT general representations (a purchase agreement may * carry dozens of ordinary reps that should not all demand per-rep * confirmation). When set, the field MUST be boolean with `default: 'false'` * and MUST declare `authority_url`. A template clause references it via the * renderer's `confirm=` directive, which renders the recital clean when the * field is true and as a highlighted `[CONFIRM …]` bracket when it is false * (never silently dropped). The broad confirmation warning rides in * `description`; the short reason shown inside the rendered bracket rides in * `confirm_note`. */ statutory_compliance_representation?: boolean; /** * Statute / practice-note link used as the learn-more reference for a * `statutory_compliance_representation` field (surfaced in the field * description and the rendered `[CONFIRM …; see ]` bracket). * Only valid on a `statutory_compliance_representation` field. */ authority_url?: string; /** * Short, human-readable reason rendered inside the * `[CONFIRM before signing: ; see ]` bracket of a * `statutory_compliance_representation` field. This is the single source of * truth for the bracket note — a `confirm=` clause directive resolves * it from here rather than restating it. Only valid on (and required for) a * `statutory_compliance_representation` field. */ confirm_note?: string; } export declare const FieldDefinitionSchema: z.ZodType; export declare const TemplateMetadataSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional; category: z.ZodOptional; source_url: z.ZodString; version: z.ZodString; license: z.ZodEnum<{ "CC-BY-4.0": "CC-BY-4.0"; "CC0-1.0": "CC0-1.0"; "CC-BY-ND-4.0": "CC-BY-ND-4.0"; }>; allow_derivatives: z.ZodBoolean; attribution_text: z.ZodString; fields: z.ZodArray>>; priority_fields: z.ZodDefault>; credits: z.ZodDefault; profile_url: z.ZodOptional; }, z.core.$strip>>>; derived_from: z.ZodOptional; }, z.core.$strip>; export type TemplateMetadata = z.infer; /** * Metadata for vendored external templates. * * `source_sha256` records the checksum of the unmodified upstream document so * validation can verify provenance for no-derivatives templates before local * transient fills or CI license checks rely on that source. */ export declare const ExternalMetadataSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional; category: z.ZodOptional; source_url: z.ZodString; version: z.ZodString; license: z.ZodEnum<{ "CC-BY-4.0": "CC-BY-4.0"; "CC0-1.0": "CC0-1.0"; "CC-BY-ND-4.0": "CC-BY-ND-4.0"; }>; allow_derivatives: z.ZodBoolean; attribution_text: z.ZodString; fields: z.ZodArray>>; priority_fields: z.ZodDefault>; credits: z.ZodDefault; profile_url: z.ZodOptional; }, z.core.$strip>>>; derived_from: z.ZodOptional; source_sha256: z.ZodString; }, z.core.$strip>; export type ExternalMetadata = z.infer; /** Declarative cleaner configuration for recipe DOCX preprocessing. */ export declare const CleanConfigSchema: z.ZodObject<{ removeFootnotes: z.ZodDefault; removeBeforePattern: z.ZodOptional; removeParagraphPatterns: z.ZodDefault>; removeRanges: z.ZodDefault>>; clearParts: z.ZodDefault>; }, z.core.$strip>; export type CleanConfig = z.infer; export declare const DeclarativeParagraphNormalizeRuleSchema: z.ZodObject<{ id: z.ZodString; section_heading: z.ZodString; section_heading_any: z.ZodOptional>; ignore_heading: z.ZodOptional; paragraph_contains: z.ZodString; paragraph_end_contains: z.ZodOptional; replacements: z.ZodOptional>; trim_unmatched_trailing_bracket: z.ZodOptional; expected_min_matches: z.ZodOptional; }, z.core.$strip>; export type DeclarativeParagraphNormalizeRule = z.infer; export declare const NormalizeConfigSchema: z.ZodObject<{ paragraph_rules: z.ZodDefault>; ignore_heading: z.ZodOptional; paragraph_contains: z.ZodString; paragraph_end_contains: z.ZodOptional; replacements: z.ZodOptional>; trim_unmatched_trailing_bracket: z.ZodOptional; expected_min_matches: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; export type NormalizeConfig = z.infer; export declare const GuidanceEntrySchema: z.ZodObject<{ source: z.ZodEnum<{ pattern: "pattern"; footnote: "footnote"; range: "range"; }>; part: z.ZodString; index: z.ZodNumber; text: z.ZodString; groupId: z.ZodOptional; }, z.core.$strip>; export type GuidanceEntry = z.infer; /** Machine-readable guidance artifact produced from recipe cleaning inputs. */ export declare const GuidanceOutputSchema: z.ZodObject<{ extractedFrom: z.ZodObject<{ sourceHash: z.ZodString; configHash: z.ZodString; }, z.core.$strip>; entries: z.ZodArray; part: z.ZodString; index: z.ZodNumber; text: z.ZodString; groupId: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; export type GuidanceOutput = z.infer; /** * Metadata required for recipe-based templates. * * Recipes point at non-redistributable upstream source DOCX files and ship only * transformation instructions. Required fields are `name`, `source_url`, * `source_version`, and `license_note`; `fields` and `priority_fields` reuse * the same field-definition semantics as template metadata and default to * empty arrays. `optional` defaults to `false`. `source_sha256` verifies * provenance for upstream sources when present. `market_data_citations` * records optional external citation metadata used by recipe guidance. */ export declare const RecipeMetadataSchema: z.ZodObject<{ name: z.ZodString; category: z.ZodOptional; description: z.ZodOptional; source_url: z.ZodString; source_version: z.ZodString; license_note: z.ZodString; optional: z.ZodDefault; source_sha256: z.ZodOptional; fields: z.ZodDefault>>>; priority_fields: z.ZodDefault>; market_data_citations: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; export type RecipeMetadata = z.infer; export declare function loadMetadata(templateDir: string): TemplateMetadata; export declare function validateMetadata(templateDir: string): { valid: boolean; errors: string[]; }; export declare function loadExternalMetadata(externalDir: string): ExternalMetadata; export declare function validateExternalMetadata(externalDir: string): { valid: boolean; errors: string[]; }; export declare function loadRecipeMetadata(recipeDir: string): RecipeMetadata; export declare function loadCleanConfig(recipeDir: string): CleanConfig; export declare function loadNormalizeConfig(recipeDir: string): NormalizeConfig; export declare function validateRecipeMetadata(recipeDir: string): { valid: boolean; errors: string[]; }; export {}; //# sourceMappingURL=metadata.d.ts.map