openclaw/scripts/generate-base-config-schema.ts
Peter Steinberger 7cbaa6b36f
refactor(scripts): deslop shared tooling flows (#162824)
Consolidate script lifecycle and helper ownership while preserving CLI, generated-output, cleanup, and guard contracts. Reject inherited object keys in model-matrix option admission with the existing unknown-argument diagnostic.

Validation: 90 full sibling suites; original-fails parser regression; byte-identical native outputs; changed checks; SDK surface and API comparison; both zero-cycle checks; independent isolated review.
2026-10-01 21:30:19 +00:00

20 lines
715 B
JavaScript

#!/usr/bin/env node
// Generate Base Config Schema script supports OpenClaw repository automation.
import { pathToFileURL } from "node:url";
import { computeBaseConfigSchemaResponse } from "../src/config/schema-base.js";
const args = new Set(process.argv.slice(2));
if (args.has("--check") && args.has("--write")) {
throw new Error("Use either --check or --write, not both.");
}
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
computeBaseConfigSchemaResponse({
generatedAt: "2026-05-05T00:00:00.000Z",
});
if (args.has("--write")) {
console.log("[base-config-schema] runtime-computed; no generated file to write");
} else {
console.log("[base-config-schema] ok");
}
}