Files
loki/scripts/test/loki-prefetch.ts
T
CatoandClaude Fable 5.1 95c40a9cd8 refactor: rename the product from FleetCrown to Loki (#695)
The product, its assistant, the repo, the host and every unit on the box now
share one name. 638 files, ~3,000 mentions: UI copy, config, env keys
(FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs,
articles, the deploy workflow other repos reuse, and nine file names.

- Three article slugs carried the old name and had been shared; permanent
  redirects keep those links alive (next.config.ts).
- test-no-retired-name.sh now also forbids the old product name across the
  whole repo, so the rename cannot creep back through templates and examples.
- ASSISTANT_STACK collapses the product and the assistant into one entry,
  because they are now the same name.

Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki`
database and role, loki.orangecat.ch (old host 308s to it; /api, /widget,
/embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases.
The Resend sending domain stays fleetcrown.orangecat.ch until the new domain
is verified in DNS.


Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:13:10 -07:00

24 lines
855 B
TypeScript

/**
* Inline tests for Loki project selection helper.
* Run: npx tsx scripts/test/loki-prefetch.ts
*/
import { resolveLokiProjectSelection } from "@/lib/loki/project-selection";
import type { LokiProject } from "@/components/loki/types";
const projects: LokiProject[] = [
{ id: "1", name: "loki", topGoal: null },
{ id: "2", name: "kivvi", topGoal: null },
];
if (JSON.stringify(resolveLokiProjectSelection(projects, "loki")) !== JSON.stringify(["loki"])) {
throw new Error("named project select");
}
if (JSON.stringify(resolveLokiProjectSelection(projects, null)) !== JSON.stringify([])) {
throw new Error("multi project no auto select");
}
if (JSON.stringify(resolveLokiProjectSelection([projects[0]], null)) !== JSON.stringify(["loki"])) {
throw new Error("single project auto select");
}
console.log("✓ loki-prefetch tests passed");