refactor: remove unused support exports
This commit is contained in:
parent
55849f3907
commit
b888d4eda1
@ -8,7 +8,6 @@ export const coveragePolicyKeys = [
|
||||
"requirements"
|
||||
];
|
||||
|
||||
export const primaryCoveragePolicyKeys = ["platforms", "requirements"];
|
||||
export const derivedCoveragePolicyKeys = ["surfaces", "scenarios", "states", "traits", "stateSurfaces"];
|
||||
|
||||
export function normalizeCoveragePolicy(coverage) {
|
||||
|
||||
@ -1,22 +1,6 @@
|
||||
import { pathToFileURL } from "node:url";
|
||||
import path from "node:path";
|
||||
import { dirname } from "node:path";
|
||||
import { execFileSync } from "node:child_process";
|
||||
|
||||
export async function importOpenClawDistModule(relativePath) {
|
||||
const packageRoot = process.cwd();
|
||||
const absolutePath = path.join(packageRoot, "dist", ...relativePath.split("/"));
|
||||
try {
|
||||
return await import(pathToFileURL(absolutePath).href);
|
||||
} catch (error) {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
throw new Error(
|
||||
`failed to import OpenClaw runtime module ${relativePath} from ${packageRoot}: ${message}. ` +
|
||||
"Kova user-message scenarios require a built/release-shaped OpenClaw runtime."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function prepareOpenClawRuntimeFromOcmEnv(envName) {
|
||||
if (!envName) {
|
||||
throw new Error("--env is required");
|
||||
@ -96,18 +80,6 @@ export function runOcmJson(args) {
|
||||
}
|
||||
}
|
||||
|
||||
export function runOcmText(args) {
|
||||
try {
|
||||
return execFileSync("ocm", args, {
|
||||
encoding: "utf8",
|
||||
stdio: ["ignore", "pipe", "pipe"]
|
||||
});
|
||||
} catch (error) {
|
||||
const stderr = error?.stderr ? String(error.stderr) : "";
|
||||
throw new Error(`ocm ${args.join(" ")} failed: ${stderr.trim() || error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
function readRequiredString(value, label) {
|
||||
if (typeof value !== "string" || value.trim().length === 0) {
|
||||
throw new Error(`${label} missing`);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user