/*
RFC-0896: Kernel module for custom domain and redirect management commands —
customdomain.register, redirect.register.
- Do not register leitstand or deployment commands here — those live in leitstand.module.ts.
- Do not register subdomain or DNS record commands — those live in subdomain.module.ts and dns.module.ts.
- RFC-0896: initial customdomain module with register and redirect.register commands.
- RFC-1231: step 1 — rename supportsAllSites to acceptsAllFlag
Mechanical sweep: the field only ever gated --all argv acceptance; fan-out
follows the parsed selector. Guard renamed assertAllSitesAllowed ->
assertAllFlagAccepted, message updated. 417 declaration sites + type
surfaces (KernelCommandMetadata, ForgeCommandMetadata) in one atomic pass.
- RFC-1248: VITE-CLIENT-DEP-02 lazy-import gate + SCAN-02 validator reads-root existence check (RFC-1248)
*/
import type { ModuleExport } from "@warpgogol/werkstatt-shared/kernel";
export async function createCustomdomainModule(): Promise {
const { runCustomdomainRegister } = await import("./customdomain-register.ts");
const { runRedirectRegister } = await import("./redirect-register.ts");
return {
name: "customdomain",
version: "0.1.0",
declarations: [],
commands: [
{
name: "customdomain.register",
coverage: "operator" as const,
modulePath: "packages/werkstatt-engine/src/customdomain/customdomain.module.ts",
description:
"Register proxied A record and Workers route for a site apex domain (RFC-0896). Idempotent. Flags: --site.",
scope: "workspace",
acceptsAllFlag: false,
mutatesState: false,
flags: {
site: {
kind: "string",
required: true,
description: "System id from systems-cache/{system}/system-config.yaml.",
},
system: {
kind: "string",
description: "Legacy alias for --site (flagSite fallback).",
},
},
reads: ["../systems-cache/{system}/system-config.yaml"],
cacheable: false,
execute: runCustomdomainRegister,
},
{
name: "redirect.register",
coverage: "operator" as const,
modulePath: "packages/werkstatt-engine/src/customdomain/customdomain.module.ts",
description:
"Register proxied CNAME and Redirect Rule (301) for www.{apex} → apex (RFC-0896). Idempotent. Flags: --site.",
scope: "workspace",
acceptsAllFlag: false,
mutatesState: false,
flags: {
site: {
kind: "string",
required: true,
description: "System id from systems-cache/{system}/system-config.yaml.",
},
system: {
kind: "string",
description: "Legacy alias for --site (flagSite fallback).",
},
},
reads: ["../systems-cache/{system}/system-config.yaml"],
cacheable: false,
execute: runRedirectRegister,
},
],
pipelines: [],
};
}