import { type KnowledgePrivateEditApproval, type KnowledgePrivateEditReviewer, type KnowledgePrivateReviewDescriptor, type KnowledgePrivateReviewer, type KnowledgePrivateReviewProof } from './guarded-review.js'; import { type CreateKnowledgeGuardedManifestOptions, type KnowledgeGuardedBinding, type KnowledgeGuardedBindingStateReadback, type KnowledgeGuardedBounds, type KnowledgeGuardedAdoptionReconciliation, type KnowledgeGuardedAdoptionReceipt, type KnowledgeGuardedAdoptionResult, type KnowledgeGuardedLegacyAdoptionOptions, type KnowledgeGuardedLegacyRollbackOptions, type KnowledgeGuardedLimits, type KnowledgeGuardedManifestReconciliation, type KnowledgeGuardedManifestSubmission, type KnowledgeGuardedReadback, type KnowledgeGuardedReceipt, type KnowledgeGuardedRollbackResult, type KnowledgeGuardedWriteResult, type KnowledgePrivateInputDescriptor, type KnowledgePrivateQueryBounds, type KnowledgePrivateQueryDescriptor, type KnowledgePrivateResultDescriptor, type KnowledgePrivateTitleLookupDescriptor, type KnowledgeTerminalReconciliation } from './guarded-write-contract.js'; export interface CreateKnowledgeGuardedWriterOptions { binding: KnowledgeGuardedBinding; env?: NodeJS.ProcessEnv; limits?: Partial; /** * Fail closed unless every executed descriptor names a pre-created manifest * step. Set this for every multi-record or multi-authority workflow. */ require_manifest?: boolean; } export interface KnowledgeGuardedWriter { readonly binding: KnowledgeGuardedBinding; readonly limits: KnowledgeGuardedLimits; readonly require_manifest: boolean; createManifest(manifest: CreateKnowledgeGuardedManifestOptions, bounds?: KnowledgeGuardedBounds): Promise; reconcileManifest(manifestId: string, bounds?: KnowledgeGuardedBounds): Promise; execute(descriptor: KnowledgePrivateInputDescriptor): Promise; executePrivate(descriptor: KnowledgePrivateInputDescriptor): Promise; lookupTitle(descriptor: KnowledgePrivateTitleLookupDescriptor): Promise; query(descriptor: KnowledgePrivateQueryDescriptor, bounds?: KnowledgePrivateQueryBounds): Promise; reconcile(deterministicKey: string, operationId: string, stepId: string, bounds?: KnowledgeGuardedBounds): Promise; readback(fullId: string, bounds?: KnowledgeGuardedBounds): Promise; readbackPrivate(fullId: string, bounds?: KnowledgeGuardedBounds): Promise; reviewPrivate(descriptor: KnowledgePrivateReviewDescriptor, reviewer: KnowledgePrivateReviewer, bounds?: KnowledgeGuardedBounds): Promise; approvePrivateEdit(descriptor: KnowledgePrivateReviewDescriptor, approvedBy: string, reviewer: KnowledgePrivateEditReviewer, bounds?: KnowledgeGuardedBounds): Promise; executeApproved(approval: KnowledgePrivateEditApproval): Promise; executeApprovedPrivate(approval: KnowledgePrivateEditApproval): Promise; readBindingState(fullId: string, bounds?: KnowledgeGuardedBounds): Promise; adoptLegacy(options: KnowledgeGuardedLegacyAdoptionOptions): Promise; rollbackLegacyAdoption(options: KnowledgeGuardedLegacyRollbackOptions): Promise; reconcileAdoption(deterministicKey: string, operationId: string, stepId: string, bounds?: KnowledgeGuardedBounds): Promise; } export declare class KnowledgeGuardedWriteRejectedError extends Error { readonly receipt: KnowledgeGuardedReceipt; readonly reconciliation: KnowledgeTerminalReconciliation; readonly code = "guarded_write_rejected"; constructor(receipt: KnowledgeGuardedReceipt, reconciliation: KnowledgeTerminalReconciliation); } export declare class KnowledgeGuardedOperationConflictError extends Error { readonly receipt: KnowledgeGuardedReceipt; readonly code = "guarded_operation_conflict"; constructor(receipt: KnowledgeGuardedReceipt); } export declare class KnowledgePrivateTitleLookupAmbiguousError extends Error { readonly code = "private_title_lookup_ambiguous"; constructor(); } export declare class KnowledgePrivateQueryResponseError extends Error { readonly code = "private_query_response_invalid"; constructor(); } export declare class KnowledgeGuardedReadbackError extends Error { readonly code = "guarded_readback_response_invalid"; constructor(); } export declare class KnowledgeGuardedManifestConflictError extends Error { readonly manifest: KnowledgeGuardedManifestSubmission['manifest']; readonly code = "guarded_manifest_conflict"; constructor(manifest: KnowledgeGuardedManifestSubmission['manifest']); } export declare class KnowledgeGuardedManifestStepRefusedError extends Error { readonly deterministic_key: string; readonly reason: string; readonly code = "guarded_manifest_step_refused"; constructor(deterministic_key: string, reason: string); } export declare class KnowledgeGuardedManifestUncertainError extends Error { readonly deterministic_key: string; readonly code = "guarded_manifest_terminal_state_unavailable"; constructor(deterministic_key: string); } export declare class KnowledgeGuardedWriteUncertainError extends Error { readonly deterministic_key: string; readonly code = "guarded_write_terminal_state_unavailable"; constructor(deterministic_key: string); } export declare class KnowledgeGuardedAdoptionRejectedError extends Error { readonly receipt: KnowledgeGuardedAdoptionReceipt; readonly reconciliation: KnowledgeGuardedAdoptionReconciliation; readonly code = "guarded_adoption_rejected"; constructor(receipt: KnowledgeGuardedAdoptionReceipt, reconciliation: KnowledgeGuardedAdoptionReconciliation); } export declare class KnowledgeGuardedAdoptionOperationConflictError extends Error { readonly receipt: KnowledgeGuardedAdoptionReceipt | null; readonly code = "guarded_adoption_operation_conflict"; constructor(receipt: KnowledgeGuardedAdoptionReceipt | null); } export declare class KnowledgeGuardedAdoptionUncertainError extends Error { readonly deterministic_key: string; readonly code = "guarded_adoption_terminal_state_unavailable"; constructor(deterministic_key: string); } export declare function createKnowledgeGuardedWriter(options: CreateKnowledgeGuardedWriterOptions): KnowledgeGuardedWriter;