UNPKG

eve

Version:

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

1 lines 800 B
import{shouldCaptureInstrumentationContent}from"#shared/instrumentation-content.js";import{DROP_INSTRUMENTATION}from"#shared/instrumentation-decision.js";function resolveTracePolicy(e,t,n){try{let n=e?.(t);return resolveTracePolicyDecision(n??{emit:!0,recordInputs:t.audience===`public`||t.environment===`development`,recordOutputs:t.audience===`public`||t.environment===`development`},t)}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{resolveTracePolicy,resolveTracePolicyDecision};