import { z } from 'zod'; /** * LoopBeeRelation — spec §4.6. * * The loop↔bee coupling row. M2 scope: * - four roles: main / supporting / candidate / retired. * - exactly one main per loop (enforced by partial unique index + service). * - FK to loop_release (TEXT id) and bee_release (INTEGER id). * - cannot link to a retired loop (enforced in service). * * Out of scope (deferred to later slices): * - share/desktop fields on the relation itself (none in spec §4.6). * - evolution evidence references (M4). * * Field semantics — see the spec for full prose. Highlights: * * - `id` is the autoincrement row id; storage key. * - `loop_release_id` is the FK to loop_release.id (TEXT). * - `bee_release_id` is the FK to bee_release.id (INTEGER). Note that * `bee_release.id` is an autoincrement INTEGER (not bee_name) — this * matches the existing 4.x schema convention used by bee_manifest, * bee_segment_ref, bee_file, bee_change. * - `role` is the four-value union. A loop can have at most one `main` * row; multiple supporting / candidate / retired rows are allowed. * - `reason` is an NL string the LLM authors at crystallization time * (e.g. "primary bee — implements the loop's success_criteria"). * - `created_at` is server-stamped from the system clock; the input * schema does not let clients supply it (would be a backdate hole). */ export declare const LoopBeeRelationRoleSchema: z.ZodEnum<{ main: "main"; candidate: "candidate"; retired: "retired"; supporting: "supporting"; }>; export type LoopBeeRelationRole = z.infer; export declare const LOOP_BEE_RELATION_ROLES: readonly LoopBeeRelationRole[]; /** * Zod schema for the create payload (LoopBeeRelationInput). * * `loop_release_id` must match the same kebab-case pattern as * `LoopRelease.id` — this is a defensive duplicate of the FK target's * shape, but the authoritative check is the FK constraint at insert * time (with `foreign_keys = ON`, which `openStateDb` applies). * * `bee_release_id` is a positive integer; matching the * `bee_release.id` autoincrement INTEGER PK. */ export declare const LoopBeeRelationInputSchema: z.ZodObject<{ loop_release_id: z.ZodString; bee_release_id: z.ZodNumber; role: z.ZodEnum<{ main: "main"; candidate: "candidate"; retired: "retired"; supporting: "supporting"; }>; reason: z.ZodString; }, z.core.$strip>; export type LoopBeeRelationInput = z.input; /** * Full Zod schema for a LoopBeeRelation row as persisted. Differs from * the input schema only in that `schema_version` is exposed (and * defaulted to the fixed literal). The literal constraint still rejects * any client-supplied value other than `"peaks.loop-bee-relation/1"`; * the default means omitting the key is fine and the output always * carries the constant. * * We expose this as the canonical "row schema" used by service.create / * read paths. */ export declare const LoopBeeRelationSchema: z.ZodObject<{ loop_release_id: z.ZodString; bee_release_id: z.ZodNumber; role: z.ZodEnum<{ main: "main"; candidate: "candidate"; retired: "retired"; supporting: "supporting"; }>; reason: z.ZodString; id: z.ZodNumber; schema_version: z.ZodDefault>; created_at: z.ZodString; }, z.core.$strip>; export type LoopBeeRelation = z.infer; /** * Convenience: strict-parse an unknown payload into a LoopBeeRelation * row. Throws ZodError on failure. This is the public validation * boundary. */ export declare function parseLoopBeeRelation(input: unknown): LoopBeeRelation; /** * Convenience: safe-parse that returns a Result-like shape so callers * can render findings without try/catch noise. */ export declare function safeParseLoopBeeRelation(input: unknown): { ok: true; row: LoopBeeRelation; } | { ok: false; findings: Array<{ path: string; message: string; }>; };