open-agreements
Version:
Open-source legal template filling CLI and library
52 lines • 2.44 kB
TypeScript
/**
* Memo family dispatch.
*
* `--memo` used to be gated on a hardcoded three-element set of template ids.
* That set is why every state variant of the employment offer letter
* (`openagreements-employment-offer-letter-new-york`, ...) was rejected as
* "not an employment template" even though it is a pure projection of the
* master offer letter that the set did contain (legal-explainer#2569), and why
* every founder-separation template failed as employment-only
* (legal-explainer#2572).
*
* The supported set is now DERIVED from the templates on disk rather than
* transcribed, so a new state variant is supported the moment it ships. A
* declared profile owns the family rules; a variant inherits the profile of the
* base template it projects from. `integration-tests/memo-families.test.ts`
* asserts that every id this module claims to support actually produces a memo,
* so the derivation cannot advertise a capability the runtime does not have.
*/
export type MemoFamily = 'employment' | 'founder-separation';
export interface MemoDispatch {
/** Family whose generator handles this template. */
family: MemoFamily;
/** The template the user asked to fill. */
templateId: string;
/**
* Template id whose family rules (clause signals, jurisdiction rules,
* source dates) apply. For a state variant this is the base template it
* projects from; otherwise it equals `templateId`.
*/
profileId: string;
}
export declare function resolveMemoDispatch(templateId: string): MemoDispatch | undefined;
export declare function isMemoSupportedTemplateId(templateId: string): boolean;
export interface MemoFamilySupport {
family: MemoFamily;
label: string;
templateIds: string[];
}
/**
* Every template on disk that `--memo` supports, grouped by family. Derived
* from the installed templates directory, so this can never advertise a
* template that is not present.
*/
export declare function listMemoSupportedTemplates(): MemoFamilySupport[];
/**
* The actionable error a user gets when `--memo` is asked for on a template no
* memo family covers. It names what IS supported rather than only what is not,
* which is the whole point of legal-explainer#2572: a precise capability error
* plus a route the user can actually take.
*/
export declare function buildUnsupportedMemoFamilyMessage(templateId: string): string;
//# sourceMappingURL=families.d.ts.map