import { type SchemaManifest } from "@aotter/mantle-spec"; import type { HandlerContext } from "../model/HandlerContext.js"; /** * Builtin op input projection + `x-mantle-bind` stamping (POC ADR-0014). * * Two transforms applied to `Procedure.input` before it lands in * `EntryRepository`: * * 1. **Projection**: copy only the keys declared on the target * Schema's `spec.schema.properties`. Side-channel fields (CAPTCHA * tokens, hCaptcha challenges, etc.) declared in the Procedure's * input but not in the Schema's properties are silently dropped * from the row. They remain available as the input to matching * synchronous `before_*` lifecycle hooks only. * * 2. **Stamping**: any Schema property carrying `x-mantle-bind: ` * gets its value computed at write time: * - `ctx.user` → `ctx.user?.id ?? null` * - `ctx.staff` → `ctx.staff?.id ?? null` * - `now` → `clockNow` (caller-supplied; lets the use case * share its `Clock` so created/updated stamps line up) * * Stamping overrides whatever the caller passed for that key — * declarative server-stamping is the contract. * * Pure stateless service — no I/O. Lives in `domain/service/`. */ export interface ProjectAndStampArgs { readonly schema: SchemaManifest; readonly input: Record; readonly ctx: HandlerContext; readonly clockNow: number; } export declare function projectAndStamp(args: ProjectAndStampArgs): Record; export interface ProjectUpdateAndStampArgs { readonly schema: SchemaManifest; readonly existing: Record; readonly patch: Record; readonly ctx: HandlerContext; readonly clockNow: number; } /** * Project update data through the same Schema-declared field allowlist * while preserving existing server-stamped values. This keeps direct * authoring paths (MCP/admin) from accepting arbitrary blob keys, but * avoids turning `x-mantle-bind: now` fields into "update timestamp" * fields on every draft edit. */ export declare function projectUpdateAndStamp(args: ProjectUpdateAndStampArgs): Record; //# sourceMappingURL=BuiltinProjector.d.ts.map