/** The guard factories: each returns the authored Guard shape with its phase filled * AND compiles its own species semantics — a caller never hand-rolls them. A factory * derives rule and deny from the SAME parameters, so prose/check parity is * structural. A factory MINTS its guard's name as kind:tool. Author regex exists * ONLY inside blockPattern, purgePattern and maskPattern; argMatchesFormat evaluates the * schema's own declared pattern. */ import type { ConsentWhen, Denial, Json, ReadsView, ReportWord, ResultCtx, Rewrite, SurfaceFacts } from '../contract/vocabulary.js'; /** A read a law decides on, and — where the declaration says so — which of the act's own * arguments name the record it is about. */ export interface RecordSource { readonly read: string; readonly at: string; /** Each of the read's arguments, mapped to the name of one of the act's own. */ readonly args?: Readonly>; } import type { CompiledGuard, Guard } from './cards.js'; /** An authored guard that carries its own AgentFactory derivation. */ export interface SeedGuard extends Guard { readonly kind: string; compile(home: 'spec' | 'contract' | 'engine', facts: SurfaceFacts): CompiledGuard; } /** The one owed-read declaration: the gated tool runs only after its declared read * SUCCEEDED this conversation. The ENGINE fills and runs the read itself — each read arg a * declared rename of the held call's own values — so no model call is spent where * the relation is declared; the forced micro-step survives only for a read whose * args the declaration does not carry. A WRITE prerequisite denies, teaching the * order. A read already attempted this turn without success denies the same way — * the debt is paid at most once per turn. `when` consults the accumulation: false * stands the guard down, true binds, and null — the answers that would tell are * themselves unread — binds fail-closed, because a condition that cannot answer * never waives a read. Declared `args` (even empty) also serve the consent * disclosure: the relation lands on the act's binding under the read's alias. */ export interface NeedsSpec { readonly read: string; readonly args?: Readonly>; readonly pick?: { readonly list: string; readonly by: string; readonly key: string; }; readonly when?: (reads: ReadsView) => boolean | null; readonly rule?: string; } export declare function needs(tool: string, spec: NeedsSpec): SeedGuard; /** Consent, auto from the surface: a destructive call runs only on a consumed * licence — otherwise it HOLDS for approval with the tool's label as the sentence. * The desk owns the question lifecycle; the guard only declares. */ export declare function confirmFirst(tool: string, label: string, when?: ConsentWhen): SeedGuard; /** Auto from limits.destructive: done and unknown both count — fail-closed. */ export declare function maxDestructive(limit: number): SeedGuard; /** Schema-auto where the schema declares its own pattern: the declared pattern is * DATA; this factory is its one evaluator. */ export declare function argMatchesFormat(tool: string, arg: string, pattern: string): SeedGuard; export declare function isIdShaped(token: string): boolean; /** Every id-shaped token a text carries — the walk the routed door uses to mint * provenance from a sealed record's results, and the candidates the figure walks put * to the records before letting an identifier leave a text. */ export declare function carriedIds(text: string): readonly string[]; /** The always-on floor: an id-shaped argument value the conversation never produced is * a GUESS — a well-formed guess is still a fabrication. Grounded = the operator typed * it (any turn), a recorded act carried it (result or args), or the conversation's own * acts returned it at another desk (the engine-minted provenance the routed door * carries — never scraped from text). Enum words like a policy topic carry no digit * and stay untouched. */ export declare function groundedIds(): SeedGuard; /** A date on a WRITE must be one somebody gave the model: the operator's * messages or the recorded acts. A read may compute a range freely; a write * stamps only a date that exists somewhere. */ export declare function groundedDates(): SeedGuard; /** A user question is answered in words: a turn whose user text carries a * question mark never seals on an empty message or on a bare roll-call of tool * names ("Completed: getMember, fileClaim…"). The record lines state what ran; * the question still needs the reply's own words. The check reads punctuation * and the lane's own tool identifiers — never the language. */ export declare function questionAnswered(): SeedGuard; /** The always-on floor: structural reply damage — byte-identical line repetition, * engine-taught literals leaking as prose, tool markup, foreign chat-template * tokens. Structural, never linguistic. */ /** The act-log line a text carries, or null: a call with its dash-status * (`name(args) — done` / `— not-done`), or the completed prefix (`Completed: name.`). * The shape is markup, never vocabulary — naming a tool inside a sentence is speech * and carries neither the dash-status nor the log prefix. */ export declare function actLogLine(text: string): string | null; /** A pasted JSON pair a text carries, or null: a quoted key with its colon — * `"name":` — the shape a record wears in transit and a sentence never does. A quoted * word WITHOUT the colon right after it is speech and passes. */ export declare function jsonPairLine(text: string): string | null; /** A key of this turn's read answers spoken as a token of the reply, or null. Only the * camel-shaped keys count — a lowercase run followed by an uppercase letter is the * record's own naming, never a word a person says — so `depositFloatLimit` is caught * and `plan` stays sayable. */ export declare function spokenRecordKey(message: string, acts: readonly { readonly result: unknown; }[]): string | null; export declare function brokenReply(): SeedGuard; /** The always-on floor: the same call never executes twice — the first completed * act's result answers every identical re-proposal. */ export declare function noDuplicateCall(): SeedGuard; /** Schema-auto: the declared required arg must arrive, and a whitespace-only value * counts as MISSING. */ export declare function argRequired(tool: string, arg: string): SeedGuard; /** Declared on the schema, but forbidden to send. */ export declare function argForbidden(tool: string, arg: string): SeedGuard; /** The declared predicate over { args, reads } must hold before the call runs. The * condition is the AUTHOR's reading of their own surface's answers: it walks the * reads log with declared knowledge of the shapes that surface returns, and an * answer the conversation does not hold refuses in words — the row was not read * this conversation, so nothing here can decide on it. A predicate that answers * with WORDS instead of false refuses in those words. */ /** A law over what the conversation read, written in code: true lets the call run, false * refuses with the guard's rule, and words refuse in those words. */ export type Precondition = (ctx: { readonly args: Readonly>; readonly reads: ReadsView; }) => boolean | Denial; export declare function precondition(tool: string | readonly string[], check: Precondition, reason: string): SeedGuard; /** postTool: the author check runs over the result; a violation joins the reply * corrections — the call already ran, so it is never a veto. */ export declare function resultSatisfiesCondition(tool: string, check: (ctx: ResultCtx) => string | null): SeedGuard; /** The report must cover every named record at the declared status — whole-value * equality on the target, the polarity a FIELD, never parsed from prose. */ export declare function mustAccountFor(spec: { readonly records: readonly string[]; readonly status: ReportWord; }): SeedGuard; /** Every run of digits in a text, read with the separators a person writes inside an * amount: '.' or ',' between digits stays in the run, and a space stays only when a * three-digit group follows it. 'R$ 2.000,00' yields '2.000,00'; 'e2000,0' yields * '2000,0'; a currency mark, mistyped or not, is never part of the run. */ export declare function figureRuns(text: string): readonly string[]; /** ONE amount, canonically: grouping separators dropped, the decimal tail kept without * its trailing zeros. The last separator carrying one or two digits is the decimal * mark; a separator carrying three is grouping. '2.000,00', '2,000', '2000.0' and * '2000' are the same amount; '200' is a different one and never becomes it. */ export declare function canonicalAmount(run: string): string; /** The arg's value must appear VERBATIM in the user's own words, on ANY turn of the * conversation — contiguous whole tokens, whole-value equal; the guard searches, it * never interprets. A figure arg is searched in every standard spelling of the same * amount. A value stated on turn one and acted on later was still stated. A dotted * arg walks into the call's blocks — 'set.day' reads the day a set-form write * carries inside its 'set' argument. */ export declare function valueFromUser(tool: string, arg: string): SeedGuard; /** THE PERSON THE OPERATOR NAMED. An identifier argument that names a row of a list read * is licensed by the operator's own words in one of two ways: the id itself is written in * a message, or the row's label is written there and names that row alone. A label found * nowhere refuses — nobody the operator named is on the list — and a label that fits more * than one row refuses too: the desk asks which, it never picks. The list is the last valid * answer of the declared read; unread, the guard refuses in words. Every comparison is a * whole string against the operator's text — no word of any language is read. */ export declare function idNamedByUser(tool: string, spec: { readonly arg: string; readonly read: string; readonly list: string; readonly key: string; readonly label: string; }): SeedGuard; /** The engine's own marker for a listed token set inside a refusal sentence. The * delivery gate reads the list back through it and forces every token verbatim. */ export declare const TOKEN_MARK = "takes exactly one of: "; /** The tokens a schema declares for one argument of one tool, or none. */ export declare function declaredTokens(facts: SurfaceFacts, tool: string, arg: string): readonly string[]; /** A law over ONE argument the CALL itself carries: the value arriving under that name must * satisfy the declared check. The call's own args and the reads log ride along, so a law * may read the argument against the answers this conversation holds — but the argument is * what it decides on, and an argument that never arrived is a law with nothing to decide, * so the guard stands aside. A check that answers with WORDS refuses in those words. */ export declare function argSatisfiesCondition(tool: string | readonly string[], arg: string, check: (ctx: { readonly value: Json; readonly args: Readonly>; readonly reads: ReadsView; }) => boolean | string, reason: string): SeedGuard; export declare function valueFromUserOrRecord(tool: string, arg: string, source: RecordSource, reason: string): SeedGuard; /** The argument must be what a returned answer already says: the value arriving under that * name is compared, whole-value, with the declared path over the read's last valid answer. * An answer this conversation does not hold fixes nothing, so the call is refused — read it * first; a value that differs from the one on file is refused with both figures in the * sentence. */ export declare function argMatchesRecord(tool: string, arg: string, source: RecordSource, reason: string): SeedGuard; /** The declared pattern DENIES — on the arriving text by default, on the reply when * asked. The ONE lawful home of an author regex beside the two rewrite factories. */ export declare function blockPattern(name: string, pattern: RegExp, rule: string, opts?: { readonly on: 'input' | 'reply'; }): SeedGuard; export declare function injectionCheck(): Guard; /** DELETES the matched span from the outgoing reply. */ export declare function purgePattern(name: string, pattern: RegExp): Rewrite; /** Replaces every match with **** in the outgoing reply. */ export declare function maskPattern(name: string, pattern: RegExp): Rewrite; /** SPEAKS every ISO date in the outgoing reply the way the operator writes one: an instant in * the declared time zone and the language's short numeric form, a calendar date the same way. * Every number of the date stays, so the figures a record carries are the figures the reply * keeps. A value that is not a date, or not a real one, rides untouched. NO regex. */ export declare function spokenDates(locale: { readonly language: string; readonly timeZone: string; }): Rewrite; /** TRANSLATES a declared term — literal, word-boundary, NO regex. */ export declare function swapTerms(terms: Readonly>): Rewrite; /** At most n completed calls of the tool per scope; done and unknown both count. */ export declare function maxCalls(tool: string, n: number, opts: { readonly scope: 'conversation' | 'turn'; readonly reason: string; }): SeedGuard; //# sourceMappingURL=catalog.d.ts.map