import { z } from 'zod'; import { type ConditionalRequirement } from './conditional-predicates.js'; import { type InputValueFormat } from './input-value-formats.js'; /** * 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; /** * How a managed artifact ships (S3 source/rights restructure, #1249): * `bundled` = the DOCX is committed in-repo; `linked` = only transformation * instructions ship and the source is fetched from its upstream URL. */ export declare const DistributionEnum: z.ZodEnum<{ bundled: "bundled"; linked: "linked"; }>; export type Distribution = z.infer; /** Whether a directory holds a fillable template or a field-selector. */ export declare const ArtifactTypeEnum: z.ZodEnum<{ template: "template"; "field-selector": "field-selector"; }>; export type ArtifactType = z.infer; /** * Maturity / support expectation for a first-party template (open-agreements#243). * * Distinct from the SemVer `version`, which signals the *past* (was a release a * breaking change?). `stability` signals the *future* support expectation: * - `experimental` — legal logic still settling; expect change. * - `beta` — schema and structure stable; legal text still hardening. * - `stable` — graduated (== SemVer 1.0): DTSA parity holds where applicable, * high-risk cover-term drafting notes are complete, and two consecutive * minor releases have shipped without legal-text rework. * * First-party (`openagreements-*`) templates declare this explicitly; it is * optional so vendored third-party templates (whose maturity is upstream-derived) * and any pre-existing metadata still validate. */ export declare const StabilityEnum: z.ZodEnum<{ experimental: "experimental"; beta: "beta"; stable: "stable"; }>; export type Stability = z.infer; /** Field kinds supported by template, external-template, and fieldSelector metadata. */ declare const FieldTypeEnum: z.ZodEnum<{ string: "string"; number: "number"; boolean: "boolean"; date: "date"; array: "array"; enum: "enum"; 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[]; /** Require an explicit, nonblank input when a top-level scalar field matches. */ required_when?: ConditionalRequirement; /** Explicit caller value shape; does not depend on field names or prose. */ value_format?: InputValueFormat; /** * 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; /** Optional template provenance entry surfaced by CLI discovery output. */ declare const TemplateCreditSchema: z.ZodObject<{ name: z.ZodString; role: z.ZodEnum<{ drafter: "drafter"; drafting_editor: "drafting_editor"; reviewer: "reviewer"; maintainer: "maintainer"; }>; profile_url: z.ZodOptional; }, z.core.$strip>; /** Structured credit entry (name/role, optional profile_url) — shared with the * template-listing projection so MCP/API output preserves the structure (#533). */ export type TemplateCredit = z.infer; export declare const TemplateCapabilityManifestSchema: z.ZodObject<{ artifact_kind: z.ZodDefault>; capabilities: z.ZodDefault>>; party_roles: z.ZodDefault>; signature_roles: z.ZodDefault>; mutation_policy: z.ZodDefault>; maturity: z.ZodDefault>; }, z.core.$strip>; export type TemplateCapabilityManifest = z.infer; export declare const TemplateMetadataSchema: z.ZodObject<{ artifact_kind: z.ZodDefault>; capabilities: z.ZodDefault>>; party_roles: z.ZodDefault>; signature_roles: z.ZodDefault>; mutation_policy: z.ZodDefault>; maturity: z.ZodDefault>; 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; distribution: z.ZodOptional>; artifact_type: z.ZodOptional>; stability: z.ZodOptional>; 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<{ artifact_kind: z.ZodDefault>; capabilities: z.ZodDefault>>; party_roles: z.ZodDefault>; signature_roles: z.ZodDefault>; mutation_policy: z.ZodDefault>; maturity: z.ZodDefault>; 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; distribution: z.ZodOptional>; artifact_type: z.ZodOptional>; stability: z.ZodOptional>; 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 fieldSelector DOCX preprocessing. */ export declare const CleanConfigSchema: z.ZodObject<{ removeFootnotes: z.ZodDefault; removeBeforePattern: z.ZodOptional; removeParagraphPatterns: z.ZodDefault>; removeRanges: z.ZodDefault>>; clearParts: z.ZodDefault>; removeStoryParagraphs: z.ZodOptional>>; removeHeaderFooterDrawings: z.ZodOptional; headerFooterDrawingMinBytes: z.ZodOptional; removeEmptyLeadingParagraphs: z.ZodOptional; }, z.core.$strip>; export type CleanConfig = z.infer; /** * Whether a clean config performs any operation capable of removing (or * exposing) body content — and can therefore strand a textless first body * paragraph (blank first page/section). Used to gate the verifier's * first-body-paragraph guard so cleaner capabilities and verifier coverage * cannot silently diverge. * * `removeFootnotes` is deliberately excluded: it removes footnote-reference * runs and footnote bodies, not body paragraphs; a first body paragraph whose * only content is a footnote reference marker does not occur in practice. * `clearParts` is excluded because it targets whole header/footer parts, not * the document body. */ export declare function cleanConfigRemovesBodyContent(config: CleanConfig): boolean; 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; expected_max_matches: z.ZodOptional; source_drift: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ stage: z.ZodLiteral<"post_transform">; prerequisites: z.ZodArray; }, z.core.$strict>], "stage">>; }, z.core.$strict>; export type DeclarativeParagraphNormalizeRule = z.infer; export declare const NumberingContinuationsSchema: z.ZodObject<{ source_sha256: z.ZodString; source_num_id: z.ZodString; headings: z.ZodArray; }, z.core.$strict>>; }, z.core.$strict>; export type NumberingContinuations = 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; expected_max_matches: z.ZodOptional; source_drift: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ stage: z.ZodLiteral<"post_transform">; prerequisites: z.ZodArray; }, z.core.$strict>], "stage">>; }, z.core.$strict>>>; numbering_continuations: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>>; }, z.core.$strict>; 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 fieldSelector 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 field-selector-based templates. * * FieldSelectors 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 fieldSelector guidance. */ export declare const StyleSeparatorSpacingProfileSchema: z.ZodObject<{ boundaries: z.ZodArray>; }, z.core.$strict>; export type StyleSeparatorSpacingProfile = z.infer; export declare const FieldSelectorMetadataSchema: z.ZodObject<{ artifact_kind: z.ZodDefault>; capabilities: z.ZodDefault>>; party_roles: z.ZodDefault>; signature_roles: z.ZodDefault>; mutation_policy: z.ZodDefault>; maturity: z.ZodDefault>; name: z.ZodString; category: z.ZodOptional; description: z.ZodOptional; source_url: z.ZodString; source_version: z.ZodString; license_note: z.ZodString; optional: z.ZodDefault; distribution: z.ZodOptional>; artifact_type: z.ZodOptional>; source_sha256: z.ZodOptional; rendering: z.ZodOptional>; }, z.core.$strict>; }, z.core.$strict>>; fields: z.ZodDefault>>>; priority_fields: z.ZodDefault>; market_data_citations: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; export type FieldSelectorMetadata = 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 loadFieldSelectorMetadata(fieldSelectorDir: string): FieldSelectorMetadata; export declare function loadCleanConfig(fieldSelectorDir: string): CleanConfig; export declare function loadNormalizeConfig(fieldSelectorDir: string): NormalizeConfig; export declare function validateFieldSelectorMetadata(fieldSelectorDir: string): { valid: boolean; errors: string[]; }; export {}; //# sourceMappingURL=metadata.d.ts.map