import type { AgentProposal, ClaimedExecution, DownstreamTarget, EffectAdapter, EffectObservation, EffectPreparedAction, ExecutionCapability, ExecutionEffect, ExecutorScope, JsonObject, NativeExecutor, PlatformId, PreparedAction, ProviderResult, ReconcileContext, ReconcileResult } from "@decionis/agent-safe-pipeline"; import type { RegisteredEffect } from "./EffectEvidenceRegister.js"; /** How an adapter's action is described to the authority: what `prepare` binds beyond the effect. */ export interface ActionDescription { readonly proposal: AgentProposal; readonly downstreamTarget: DownstreamTarget; readonly idempotencyKey: string; readonly facts: JsonObject; } export interface EffectAdapterExecutorOptions { readonly adapter: EffectAdapter; readonly platform: PlatformId; /** How the action reads as an intent; the adapter itself only knows its effect. */ readonly describe: (action: TAction, prepared: EffectPreparedAction) => ActionDescription; /** What the connection can execute; absent, every action type is stated as live. */ readonly capabilities?: (scope: ExecutorScope) => Promise; readonly clock?: () => Date; } /** What the adapter's dispatch left for `observe`: everything the effect record is built from. */ export interface AdapterDispatchReceipt { readonly prepared: EffectPreparedAction; readonly result: ProviderResult | null; readonly indeterminate: { readonly reason: string; readonly providerStatus: string | null; } | null; readonly correlationId: string; readonly idempotencyKey: string; } /** What `observe` reads a dispatch as: the effect record, and the attempt it was observed for. */ export interface AdapterObservation { readonly record: RegisteredEffect; readonly indeterminate: AdapterDispatchReceipt["indeterminate"]; readonly correlationId: string; } /** * Any `EffectAdapter` as a dispatch-style `NativeExecutor` * (`agent-safe.executors.native/1`): the adapter keeps its four methods and * this class says them in the contract's terms. `prepare` is the adapter's, * plus how the action reads as an intent; `execute` is the adapter's write, * inside the dispatch the caller opened and within its deadline; `observe` * is the adapter's projection turned into the effect record, field by field * against what was authorised; `reconcile` is the adapter's read-only * lookup, complete only on a matching read-back. * * The record is evidence, so it rides on the observation for whoever * finalizes the grant — the runtime registers it for its verifier — and its * wire form rides as `evidence` for a runner that finalizes directly. */ export declare class EffectAdapterExecutor implements NativeExecutor { private readonly options; readonly platform: PlatformId; readonly version: string; readonly style: "dispatch"; private readonly clock; /** The adapter's own preparation of each prepared action, so a write never prepares twice. */ private readonly effects; constructor(options: EffectAdapterExecutorOptions); get actionTypes(): readonly string[]; /** The adapter's observer identity, as the effect record and the authority name it. */ get observer(): { readonly id: string; readonly version: string; }; capabilities(scope: ExecutorScope): Promise; prepare(action: TAction): Promise; /** `prepare`, synchronously: the adapter reaches nothing, so neither does this. */ prepareNow(action: TAction): PreparedAction; /** * The adapter's write, once, inside the caller's dispatch. A provider that * neither committed nor refused is carried as indeterminate, with any * receipt it gave; any other error after the dispatch began propagates, so * the caller reports an outcome nobody knows. */ execute(run: ClaimedExecution): Promise>; /** * The provider's answer as the effect record: the adapter's projection, * compared with what was authorised. An outcome nobody can determine stays * undetermined; a provider that was reached and said no is a refusal, not * a success whose effect block says otherwise. */ observe(effect: ExecutionEffect): Promise>; /** * The adapter's read-only lookup. Absence of an error is not success: only * a read-back whose projection matches what was authorised completes a * reconciliation. */ reconcile(context: ReconcileContext): Promise>; /** The adapter's preparation of a prepared action: remembered from `prepare`, or made again. */ private effectOf; private evidenceOf; } //# sourceMappingURL=EffectAdapterExecutor.d.ts.map