UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.03 kB
import{l as isRecord}from"./record-coerce-BTbqdJ3-.mjs"; //!src/infra/diagnostic-llm-content.ts const NO_MODEL_CONTENT_CAPTURE=Object.freeze({inputMessages:false,outputMessages:false,toolInputs:false,toolOutputs:false,systemPrompt:false,toolDefinitions:false,anyModelContent:false});function cloneDiagnosticContentValue(e){try{return structuredClone(e)}catch{try{const t=JSON.stringify(e);return t===void 0?null:JSON.parse(t)}catch{return String(e)}}}function resolveDiagnosticModelContentCapturePolicy(e){if(!isRecord(e))return NO_MODEL_CONTENT_CAPTURE;const t=e.diagnostics;if(!isRecord(t)||t.enabled===false)return NO_MODEL_CONTENT_CAPTURE;const n=t.otel;if(!isRecord(n)||n.enabled!==true||n.traces===false)return NO_MODEL_CONTENT_CAPTURE;if(n.captureContent===true)return{inputMessages:true,outputMessages:true,toolInputs:true,toolOutputs:true,systemPrompt:false,toolDefinitions:true,anyModelContent:true};return NO_MODEL_CONTENT_CAPTURE}export{resolveDiagnosticModelContentCapturePolicy as n,cloneDiagnosticContentValue as t};