import type { ReviewAuthorizing, ReviewAuthorizingAuthorizedAction } from "./types.js"; export type ReviewAuthorizingIssueCode = "not-an-object" | "missing-kind" | "unknown-kind" | "missing-statement" | "invalid-source" | "missing-prompt" | "missing-response" | "missing-prompt-ref" | "missing-rendered-prompt" | "missing-action" | "invalid-action" | "missing-authority-ref"; export interface ReviewAuthorizingIssue { readonly code: ReviewAuthorizingIssueCode; readonly message: string; } /** * Validates an `authorizing` block on a ReviewOutcome for admissibility. * * Per-kind required fields: * explicit-statement — `statement` (string, non-empty) * exchange — `prompt` and `response` (both strings, non-empty; * both halves required for self-contained testimony) * authorized-action — `promptRef`, `renderedPrompt`, `action`, and * `authorityRef` (all required; action must be * "affirmed-control" or "typed") * * Returns an empty array when the block is valid. */ export declare function validateAuthorizing(block: unknown): ReviewAuthorizingIssue[]; /** * Type guard: returns true if a ReviewAuthorizing block passes all validation checks. */ export declare function isValidAuthorizing(block: unknown): block is ReviewAuthorizing; export interface BuildAuthorizedActionAuthorizingInput { readonly promptRef: string; readonly renderedPrompt: string; readonly action: ReviewAuthorizingAuthorizedAction["action"]; readonly authorityRef: string; } /** * Helper for consumers building `authorized-action` authorizing blocks outside * the workbench. Constructs the block and validates it; throws if the result * would be invalid so callers catch configuration errors at build time. * * For workbench-internal construction, use the workbench path directly — it * runs validateAuthorizing and degrades gracefully instead of throwing. */ export declare function buildAuthorizedActionAuthorizing(input: BuildAuthorizedActionAuthorizingInput): ReviewAuthorizingAuthorizedAction; export interface BuildPromptRefInput { readonly module: string; readonly component: string; readonly version?: string; readonly scheme?: string; } /** * Builds a well-formed `promptRef` for an `authorized-action` authorizing block, * generalizing the workbench's `/@` convention. * * Without a `scheme` the result is bare (`"review-workbench/decision-card@v1"`), * matching the workbench's own internal prompt refs. With a `scheme` the result * is prefixed (`"survey://rules-admin/keep-current@v1"`) for producers that * namespace their prompt refs. `version` defaults to `"v1"`. * * The returned string is a valid `promptRef` input to * {@link buildAuthorizedActionAuthorizing}. Throws on an empty `module` or * `component`, mirroring that helper's throw-on-invalid-input style. */ export declare function buildPromptRef(input: BuildPromptRefInput): string;