refactor(agent): dedupe harness and command workflows

This commit is contained in:
Peter Steinberger
2026-02-16 14:52:09 +00:00
parent 04892ee230
commit f717a13039
204 changed files with 7366 additions and 11540 deletions

View File

@@ -10,6 +10,7 @@ import { parseFrontmatterBlock } from "../../markdown/frontmatter.js";
import {
getFrontmatterString,
normalizeStringList,
parseOpenClawManifestInstallBase,
parseFrontmatterBool,
resolveOpenClawManifestBlock,
resolveOpenClawManifestInstall,
@@ -22,30 +23,23 @@ export function parseFrontmatter(content: string): ParsedSkillFrontmatter {
}
function parseInstallSpec(input: unknown): SkillInstallSpec | undefined {
if (!input || typeof input !== "object") {
const parsed = parseOpenClawManifestInstallBase(input, ["brew", "node", "go", "uv", "download"]);
if (!parsed) {
return undefined;
}
const raw = input as Record<string, unknown>;
const kindRaw =
typeof raw.kind === "string" ? raw.kind : typeof raw.type === "string" ? raw.type : "";
const kind = kindRaw.trim().toLowerCase();
if (kind !== "brew" && kind !== "node" && kind !== "go" && kind !== "uv" && kind !== "download") {
return undefined;
}
const { raw } = parsed;
const spec: SkillInstallSpec = {
kind: kind,
kind: parsed.kind as SkillInstallSpec["kind"],
};
if (typeof raw.id === "string") {
spec.id = raw.id;
if (parsed.id) {
spec.id = parsed.id;
}
if (typeof raw.label === "string") {
spec.label = raw.label;
if (parsed.label) {
spec.label = parsed.label;
}
const bins = normalizeStringList(raw.bins);
if (bins.length > 0) {
spec.bins = bins;
if (parsed.bins) {
spec.bins = parsed.bins;
}
const osList = normalizeStringList(raw.os);
if (osList.length > 0) {