UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

1 lines 971 B
import{shouldCaptureInstrumentationContent}from"#shared/instrumentation-content.js";import{DROP_INSTRUMENTATION}from"#shared/instrumentation-decision.js";function legacyCaptureTracePolicy(e){if(e===void 0)return;let t=e===`content`;return()=>({emit:!0,recordInputs:t,recordOutputs:t})}function resolveTracePolicy(e,t,n){try{let n=e?.({agentName:t.agentName,audience:t.audience,channelType:t.channelType});return resolveTracePolicyDecision(n??{emit:!0,recordInputs:t.audience===`public`,recordOutputs:t.audience===`public`},t.audience)}catch(e){try{n?.(e)}catch{}return DROP_INSTRUMENTATION}}function resolveTracePolicyDecision(e,t){if(e===!1)return DROP_INSTRUMENTATION;if(e===!0){let e=shouldCaptureInstrumentationContent(t);return{action:`record`,recordInputs:e,recordOutputs:e}}return e.emit?{action:`record`,recordInputs:e.recordInputs,recordOutputs:e.recordOutputs}:DROP_INSTRUMENTATION}export{legacyCaptureTracePolicy,resolveTracePolicy,resolveTracePolicyDecision};