ConusAI vendor v0.1.0-beta.114
ci / gate (push) Waiting to run

This commit is contained in:
ConusAI vendor v0.1.0-beta.114
2026-11-14 09:56:45 +00:00
commit 1ce8d23c35
867 changed files with 122104 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
import { describeError } from "@conusai-kit/ui/data"
import { serviceNotice } from "@conusai-kit/ui/patterns"
import { LEDGER_ERRORS } from "../contract/index.js"
import type { LedgerLabels } from "./labels.js"
/** What a form shows for a refused write: the module's drift fence, a Ledger refusal in the reader's words, or the kit's text. */
export function ledgerFailure(error: unknown, labels: LedgerLabels): string {
const code = (error as { problem?: { code?: unknown } } | null)?.problem?.code
if (code === LEDGER_ERRORS.drift) return labels.drift
return serviceNotice(error, labels.refusals)?.text ?? describeError(error)
}