/** * fields.ts, the mechanical field registry. * * These are the ONLY lines parsed into typed values (docs/owner-profile.md §4.3). * Everything else in the document is prose: preserved verbatim, served as prose. * `People` and `Places` have no mechanical fields at all, the owner asked for * notes, and notes are what they are. * * A validator NEVER rejects a line. It answers "does this value look like what * it claims to be", and a `false` answer is recorded alongside the value with a * reason. Deleting or rewriting a line because the parser disliked it would be * the worst possible behaviour in a file the owner owns. */ import type { ProfileTier } from './types.js'; /** The canonical section headings, in document order. */ export declare const PROFILE_SECTIONS: readonly ["Identity", "Contact", "Location", "Commerce", "Preferences", "Contacting me", "Style", "Defaults", "People", "Places", "Work", "Important dates", "Plans", "Notes"]; export type ProfileSectionName = (typeof PROFILE_SECTIONS)[number]; /** * Sections that hold notes rather than records. An autonomous write into one of * these appends a bullet; nothing turns them into records. * * `Important dates` and `Plans` are here for a reason worth stating, because at * a glance they look like the most record-shaped sections in the document. A * birthday is a REPEATED record and the field registry maps one section-plus- * label to one value, it can hold `commerce.shippingAddress` and cannot hold * twenty birthdays. So each occasion is a prose line, preserved verbatim by * this parser exactly like any other bullet, and typed by a reader layered on * top of it (`platform/occasions/grammar.ts`). The profile's guarantee that a * validator never rewrites a line he wrote survives unchanged, and a date line * this parser cannot make sense of is reported with a reason rather than * corrected. */ export declare const PROSE_ONLY_SECTIONS: readonly ProfileSectionName[]; /** Field names and headings match case-insensitively with whitespace collapsed. */ export declare function normalizeProfileKey(value: string): string; /** The canonical section a heading names, or `null` when it is one of his own. */ export declare function canonicalProfileSection(heading: string): ProfileSectionName | null; /** A validator's answer. `reason` is present exactly when `valid` is false. */ export interface ProfileFieldValidation { readonly valid: boolean; readonly reason?: string | undefined; } export type ProfileFieldValidator = (value: string) => ProfileFieldValidation; export interface ProfileFieldDef { /** Stable id used by every caller, e.g. `location.timezone`. */ readonly id: string; readonly section: ProfileSectionName; /** The label written in the file, e.g. `shipping address`. */ readonly label: string; /** Open tier is injectable as context; closed tier needs a named call. */ readonly tier: ProfileTier; readonly validate: ProfileFieldValidator; } /** * Every mechanical field, with its tier from §11.2. * * `location.city` is open deliberately and `location.homeAddress` is closed: the * failure that prompted this work was an agent guessing a metro area, and a city * is not a doorstep. */ export declare const PROFILE_FIELDS: readonly ProfileFieldDef[]; export declare function profileFieldById(fieldId: string): ProfileFieldDef | undefined; /** * The refusal text for an unrecognised field id. * * Names every valid id compactly instead of pointing at docs/owner-profile.md * §4.3, a doc citation reads fine to a person but is useless to a model at * runtime, which cannot open the file and retry. One formatter, used by every * "not a profile field" refusal in the gateway route and the writer, so the * enumerated list can never drift between call sites. */ export declare function unknownProfileFieldMessage(fieldId: string): string; /** The field a `key:` names under a canonical section, or `undefined` for prose. */ export declare function profileFieldForLabel(section: ProfileSectionName, label: string): ProfileFieldDef | undefined; export declare function profileFieldsForSection(section: ProfileSectionName): readonly ProfileFieldDef[]; /** * The tier of a whole section's PROSE. * * §11.2 puts "all `Style` content" in the open tier and names no other section's * prose, so every other section's prose is closed. That is the safest reading: * `Notes` holds "allergic to shellfish" and `People` holds facts about people * who never agreed to be in a database. */ export declare function profileSectionTier(heading: string): ProfileTier; /** Open-tier field ids, for the short system-context block. */ export declare function openTierFieldIds(): readonly string[]; /** Closed-tier field ids, reachable only by an explicit named call. */ export declare function closedTierFieldIds(): readonly string[]; //# sourceMappingURL=fields.d.ts.map