mirror of
https://github.com/bitbaum/causius.git
synced 2026-12-05 18:57:30 +01:00
* Build out Causius: case intake, case file, helper marketplace Replace the day-zero page with the product: a landing page, letter intake with env-gated AI analysis, a case view (deadline, checklist, translations, draft reply), browser-only case storage with export/import, and the helper marketplace rules for legal assistants and licensed lawyers. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ * Put Causius on the fleet's stack and its three planes - AI: replace the hand-rolled single-vendor fetch with @bitbaum/ai-kit complete() over the shared free chain; no pinned model id. Add the fleet's own-model flow (ai-kit byok + probe), key kept in the browser. - Validation with zod, rate limits with limitkit, tests with Vitest. - Identity rendered from the Loki fleet map; ROADMAP.md and CHANGELOG.md as the public record, shown through bip-kit. - Helpers live on OrangeCat as services; OrangeCat and Solon links appear only when the fleet map reports the profiles exist. - Nav contract: routes constant, aria-current, 44px targets. Beta label. - CI and auto-merge from the current site template; TypeScript 6, ESLint 10, Node 24; AGENTS.md from the fleet template. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ * Speak English, German and French; make intake work end to end - next-intl with locale routing (en unprefixed, /de, /fr), every string in the message catalogues, a parity test, Swiss German spelling. - The analysis is written in the reader's language. - Several pages per letter; photos are shrunk in the browser so a phone picture fits. - The deadline is shown with the sentence it was read from, and the model is told never to compute a date the letter does not state. - /api/health, and the intake page says up front what the free models can do. `pnpm run check:analyze` runs the sample letter through a real model. - A down fleet map no longer stalls on-demand pages. - Refuse the two build scripts next-intl brought, so installs stay clean. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012EJFFkKhmaVnnH8E3mHnaZ --------- Co-authored-by: Claude <noreply@anthropic.com>
34 lines
1.2 KiB
TypeScript
34 lines
1.2 KiB
TypeScript
import { hasLocale } from "next-intl";
|
|
import { getRequestConfig } from "next-intl/server";
|
|
import en from "../messages/en.json";
|
|
import { defaultLocale, routing } from "./routing";
|
|
|
|
type Messages = Record<string, unknown>;
|
|
|
|
/**
|
|
* English underneath, the requested language on top. A key a translation has
|
|
* not reached yet falls back to the English sentence — never to a raw key name.
|
|
* The parity test (i18n/parity.test.ts) keeps such gaps from reaching main.
|
|
*/
|
|
export function withFallback(base: Messages, over: Messages): Messages {
|
|
const out: Messages = { ...base };
|
|
for (const [key, value] of Object.entries(over)) {
|
|
const b = base[key];
|
|
out[key] =
|
|
value && typeof value === "object" && !Array.isArray(value) && b && typeof b === "object"
|
|
? withFallback(b as Messages, value as Messages)
|
|
: value;
|
|
}
|
|
return out;
|
|
}
|
|
|
|
export default getRequestConfig(async ({ requestLocale }) => {
|
|
const requested = await requestLocale;
|
|
const locale = hasLocale(routing.locales, requested) ? requested : defaultLocale;
|
|
const messages =
|
|
locale === defaultLocale
|
|
? en
|
|
: withFallback(en, (await import(`../messages/${locale}.json`)).default);
|
|
return { locale, messages };
|
|
});
|