UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

25 lines (24 loc) • 1.01 kB
import { s as redactSensitiveText } from "./redact-Mj7pppxC.mjs"; import "./diagnostic-events-BjAH1Kbx.mjs"; import "./diagnostics-timeline-CSwiG24r.mjs"; import "./subsystem-BHJiy01V.mjs"; import "./diagnostic-llm-content-CvUZCA61.mjs"; //#region src/plugin-sdk/diagnostic-runtime.ts const LOW_CARDINALITY_DIAGNOSTIC_VALUE_RE = /^[A-Za-z0-9_.:-]{1,120}$/u; function normalizeDiagnosticValue(e, t = "unknown") { if (!e) return t; const n = redactSensitiveText(e.trim()); const r = n.toLowerCase(); if (r.startsWith("agent:") || r.includes(":agent:")) return t; return LOW_CARDINALITY_DIAGNOSTIC_VALUE_RE.test(n) ? n : t; } function normalizeDiagnosticLane(e, t = "unknown") { if (!e) return t; const n = redactSensitiveText(e.trim()); if (n.toLowerCase().startsWith("agent:")) return t; const r = n.indexOf(":"); const i = r >= 0 ? n.slice(0, r) : n; return LOW_CARDINALITY_DIAGNOSTIC_VALUE_RE.test(i) ? i : t; } //#endregion export { normalizeDiagnosticValue as n, normalizeDiagnosticLane as t };