UNPKG

eve

Version:

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

1 lines 1.08 kB
const AGENT_TRACE_SCHEMA_VERSION=4,AGENT_SPAN_NAMES={action:`agent.action`,approval:`agent.approval`,channelRequest:`agent.channel.request`,step:`agent.step`},AGENT_USAGE_ATTRIBUTES={inputTokens:`agent.usage.input_tokens`,outputTokens:`agent.usage.output_tokens`,cacheReadTokens:`agent.usage.cache_read_tokens`,cacheWriteTokens:`agent.usage.cache_write_tokens`};function agentInvocationSpanName(e){return e===void 0?`invoke_agent`:`invoke_agent ${e}`}function workflowInvocationSpanName(e){return`invoke_workflow ${e}`}function isAgentActivationSpan(e){return e.name===`agent.turn`||e.attributes[`gen_ai.operation.name`]===`invoke_agent`&&e.attributes[`agent.invocation.role`]!==`caller`&&typeof e.attributes[`agent.turn.id`]==`string`}function agentTurnIdentity(e){let t=e.attributes[`gen_ai.conversation.id`],n=e.attributes[`agent.turn.id`];return typeof n==`string`?`${typeof t==`string`?t:``}\0${n}`:void 0}export{AGENT_SPAN_NAMES,AGENT_TRACE_SCHEMA_VERSION,AGENT_USAGE_ATTRIBUTES,agentInvocationSpanName,agentTurnIdentity,isAgentActivationSpan,workflowInvocationSpanName};