UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

42 lines (41 loc) • 1.66 kB
import { g as readStringValue } from "./string-coerce-CCIiB4H7.mjs"; import { o as normalizeCsvOrLooseStringList } from "./string-normalization-DLmfYZXI.mjs"; import "./frontmatter-CLR6jwh6.mjs"; import { a as resolveOpenClawManifestBlock, c as resolveOpenClawManifestRequires, i as parseOpenClawManifestInstallBase, o as resolveOpenClawManifestInstall, s as resolveOpenClawManifestOs, t as applyOpenClawManifestInstallCommonFields } from "./frontmatter-DZeA7qC4.mjs"; //#region src/hooks/frontmatter.ts function parseInstallSpec(e) { const t = parseOpenClawManifestInstallBase(e, [ "bundled", "npm", "git" ]); if (!t) return; const { raw: n } = t; const r = applyOpenClawManifestInstallCommonFields({ kind: t.kind }, t); if (typeof n.package === "string") r.package = n.package; if (typeof n.repository === "string") r.repository = n.repository; return r; } function resolveHookManifestMetadata(e) { const t = resolveOpenClawManifestBlock({ frontmatter: e }); if (!t) return; const n = resolveOpenClawManifestRequires(t); const r = resolveOpenClawManifestInstall(t, parseInstallSpec); const i = resolveOpenClawManifestOs(t); return { always: typeof t.always === "boolean" ? t.always : void 0, emoji: readStringValue(t.emoji), homepage: readStringValue(t.homepage), hookKey: readStringValue(t.hookKey), export: readStringValue(t.export), os: i.length > 0 ? i : void 0, events: normalizeCsvOrLooseStringList(t.events), requires: n, install: r.length > 0 ? r : void 0 }; } function resolveHookKey(e, t) { return t?.metadata?.hookKey ?? e; } //#endregion export { resolveHookManifestMetadata as n, resolveHookKey as t };