import type { OrgDef } from '../types.js'; import { DocAccess } from './access.js'; import { CheckJournal } from './check-journal.js'; import { type DocumentToolHost } from './host.js'; import { NoticeEngine } from './notices.js'; import { PartJournal } from './part-journal.js'; import { type ReworkFact } from './rework.js'; import { DocumentStore } from './store.js'; import type { TypeBinding } from './store-types.js'; export type { DocumentToolHost } from './host.js'; /** * One binding per declared document type: the publishing section's roles may publish it, and each consuming * section is a consumer decided by its lead. Throws on a type nothing publishes (validation reports it first). */ export declare function bindingsFromDef(def: OrgDef): TypeBinding[]; export declare class DocumentsRuntime { readonly dir: string; readonly run: string; readonly store: DocumentStore; readonly bindings: readonly TypeBinding[]; readonly access: DocAccess; /** Publication notices (P3.8); attached to the daemon's deliver path at org start. */ notices?: NoticeEngine; /** The record of org_doc_check calls (P3.11): `/checks.jsonl`, created at the first call. */ readonly checks: CheckJournal; /** Which parts of each version each role has read (P3.16b): `/part-reads.jsonl`, created at the first read. */ readonly reads: PartJournal; private isClosed; private reworkOn; private readonly def; constructor(dir: string, run: string, store: DocumentStore, bindings: readonly TypeBinding[], def: OrgDef); /** Where a producing role's own files are; bound by the org start, which knows the workspace mode. */ private workspaceOf?; bindWorkspaces(f: (role: string) => string | undefined): void; /** * `max_rework_rounds` enforcement (P4.7), installed once and only when some section declares a cap (at open, or * at a reload that adds the first): the freeze guard on the store and the exhaustion notice. The caps are read * from the live definition every time, so a reload that raises or lowers one thaws or freezes a thread. */ enableRework(): void; /** The review threads and whether each is frozen (a pure function of the store and the live caps). */ reworkReport(): ReworkFact[]; get closed(): boolean; /** The tool host of `role`: every call is made as that role, whatever the arguments say. */ forRole(role: string): DocumentToolHost; /** Stop accepting calls and write the store's snapshot. Idempotent; never throws. */ close(): void; } export interface OpenOptions { def: OrgDef; /** `.monomind/orgs/`. */ orgDir: string; run: string; now?: () => Date; } /** The documents runtime of a run, or undefined when the definition is off the sections surface. */ export declare function openDocumentsRuntime(o: OpenOptions): DocumentsRuntime | undefined; //# sourceMappingURL=runtime.d.ts.map