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
+16
View File
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: LicenseRef-ConusAI-Template-1.0
import type { Locale } from "@conusai-kit/i18n"
import { serviceNotice } from "@conusai-kit/ui/patterns"
import { ZodError } from "zod"
import type { en } from "../i18n/en.js"
export type Messages = { [K in keyof typeof en]: string }
/**
* What the loader hands the views: the module's messages, the reader's locale (money is formatted with it) and
* the kit's refusal sentences by problem code (`businessRefusalNotices` of `@conusai-kit/business/refusals`).
*/
export type Labels = Messages & { readonly locale: Locale; readonly refusals: Readonly<Record<string, string>> }
export function describeFailure(error: unknown, labels: Labels): string {
if (error instanceof ZodError) return labels.invalid
return serviceNotice(error, labels.refusals)?.text ?? labels.unavailable
}