import type { ActionHandler, EffectPreparedAction, JsonObject } from "@decionis/agent-safe-pipeline"; import type { z } from "zod"; import { type EffectAdapter } from "./EffectAdapter.js"; import { EffectAdapterExecutor, type ActionDescription } from "./EffectAdapterExecutor.js"; import type { EffectEvidenceRegister } from "./EffectEvidenceRegister.js"; /** What the executor reports about an adapter's attempt: statuses and digests only. */ export interface AdapterExecutionResult { readonly outcome: "COMMITTED" | "FAILED"; readonly confirmation: "PENDING" | "CONFIRMED" | "NOT_EFFECTED" | "REVERSED" | "UNKNOWN"; readonly comparison: "MATCH" | "MISMATCH" | "PENDING"; readonly mismatchedFields: readonly string[]; readonly observationMethod: string; readonly expectedEffectDigest: string; readonly observedEffectDigest: string | null; readonly responseDigest: string | null; readonly providerReference: string | null; readonly evidenceDigest: string; readonly reasonCodes: readonly string[]; /** How the provider's receipt, when it gave one, relates to this account. */ readonly receiptComparison: "MATCH" | "MISMATCH" | "SILENT" | "ABSENT"; /** What the receipt said it did, when it gave one. */ readonly receiptStatus: "EFFECTED" | "REFUSED" | "INDETERMINATE" | null; } export interface AdapterHandlerOptions { readonly adapter: EffectAdapter; readonly schema: z.ZodType; readonly register: EffectEvidenceRegister; readonly timeoutMs: number; /** Told when an observation did not match what was authorised. */ readonly onMismatch?: (mismatched: readonly string[]) => void; readonly clock?: () => Date; } export interface ExecutorHandlerOptions { readonly schema: z.ZodType; readonly register: EffectEvidenceRegister; readonly timeoutMs: number; /** Told when an observation did not match what was authorised. */ readonly onMismatch?: (mismatched: readonly string[]) => void; } /** * The bridge from any `EffectAdapter` to the pipeline's `ActionHandler`: the * adapter as a dispatch-style `NativeExecutor` (`EffectAdapterExecutor`), * bridged by `executorActionHandler`. Kept so every registration written * against it keeps its signature. */ export declare function adapterActionHandler(options: AdapterHandlerOptions): ActionHandler; /** * The bridge from a dispatch-style executor over an effect adapter to the * pipeline's `ActionHandler`, so the registry the runtime runs through * `GovernedExecutionRunner` reaches it. It keeps the shape the boundary * requires and adds the effect plane: * * the executor's `prepare`, which reaches nothing; then its write inside * `dispatch.run`, bounded by the smaller of the configured timeout and what * is left of the grant; then its observation, compared field by field * against what was authorised; then the record, registered against this * exact authorization for the verifier to finalize with. * * What the executor observed is said to the registry in the registry's own * terms: an outcome nobody can determine is re-raised as * `IndeterminateOutcome`, which the registry reports as unknown; a provider * that was reached and said no is a `ProviderRefusal`, which it reports as * definitely not executed; and a commit returns its effect block. */ export declare function executorActionHandler(executor: EffectAdapterExecutor, options: ExecutorHandlerOptions): ActionHandler; /** * How an adapter with no description of its own reads as an intent: its * effect's action type and resource, the action itself as the parameters, * and the canonical action's digest as the retry identity. The registry path * never asks, because the intent was captured before the handler ran; a * family that is submitted to the runner directly describes itself. */ export declare function describeByEffect(action: TAction, prepared: EffectPreparedAction): ActionDescription; /** The effect block a response carries, from the handler's own result. */ export declare function effectBlock(result: unknown): JsonObject | null; //# sourceMappingURL=AdapterActionHandler.d.ts.map