eve 0.54.0 → 0.54.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/src/chunks/{use-eve-agent-BR8EpIOX.js → use-eve-agent-CxPlg0KL.js} +0 -1
  3. package/dist/src/chunks/{use-eve-agent-XnfjQt1Z.js → use-eve-agent-D-KQzzyW.js} +0 -1
  4. package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
  5. package/dist/src/cli/dev/tui/traces/trace-content.d.ts +1 -3
  6. package/dist/src/cli/dev/tui/traces/trace-content.js +2 -2
  7. package/dist/src/cli/dev/tui/traces/trace-conversation.js +1 -1
  8. package/dist/src/cli/dev/tui/traces/trace-view.js +1 -1
  9. package/dist/src/client/agent-info-schema.d.ts +0 -1
  10. package/dist/src/client/agent-info-schema.js +1 -1
  11. package/dist/src/compiled/.vendor-stamp.json +1 -1
  12. package/dist/src/compiler/default-tool-policy.js +1 -1
  13. package/dist/src/compiler/manifest.js +1 -1
  14. package/dist/src/context/memory-event-lifecycle.d.ts +2 -0
  15. package/dist/src/context/memory-event-lifecycle.js +1 -1
  16. package/dist/src/context/memory-lifecycle.d.ts +5 -0
  17. package/dist/src/context/memory-lifecycle.js +1 -1
  18. package/dist/src/execution/coordination-dispatch-step.js +1 -1
  19. package/dist/src/execution/create-session-step.js +1 -1
  20. package/dist/src/execution/parked-delivery-wait.js +1 -1
  21. package/dist/src/execution/session.d.ts +0 -2
  22. package/dist/src/execution/session.js +1 -1
  23. package/dist/src/execution/tasks/parent/dispatch.d.ts +1 -12
  24. package/dist/src/execution/tasks/parent/dispatch.js +1 -1
  25. package/dist/src/execution/tools/sleep-workflow.js +1 -1
  26. package/dist/src/execution/tools/subagent/invoke-agent.d.ts +1 -2
  27. package/dist/src/execution/tools/subagent/invoke-agent.js +1 -1
  28. package/dist/src/execution/tools/tasks.d.ts +1 -8
  29. package/dist/src/execution/tools/tasks.js +1 -1
  30. package/dist/src/execution/workflow-steps.js +1 -1
  31. package/dist/src/framework/sources/registry.js +1 -1
  32. package/dist/src/harness/coordination.js +1 -1
  33. package/dist/src/harness/emission.js +1 -1
  34. package/dist/src/harness/execute-tool.d.ts +2 -4
  35. package/dist/src/harness/model-call-error.d.ts +5 -0
  36. package/dist/src/harness/model-call-error.js +1 -1
  37. package/dist/src/harness/semantic-errors/rules/model-provider.js +1 -1
  38. package/dist/src/harness/step-hooks.d.ts +2 -1
  39. package/dist/src/harness/step-hooks.js +1 -1
  40. package/dist/src/harness/tool-loop.js +2 -2
  41. package/dist/src/instrumentation/content.js +1 -1
  42. package/dist/src/instrumentation/dispatch.js +1 -1
  43. package/dist/src/instrumentation/lifecycle.d.ts +7 -3
  44. package/dist/src/instrumentation/memory.d.ts +72 -0
  45. package/dist/src/instrumentation/memory.js +1 -0
  46. package/dist/src/instrumentation/native-events.js +1 -1
  47. package/dist/src/instrumentation/provider.d.ts +1 -0
  48. package/dist/src/instrumentation/runtime.d.ts +3 -0
  49. package/dist/src/instrumentation/runtime.js +1 -1
  50. package/dist/src/internal/application/package.js +1 -1
  51. package/dist/src/setup/scaffold/create/project.js +1 -1
  52. package/dist/src/shared/action-types.d.ts +4 -0
  53. package/dist/src/shared/action-types.js +1 -1
  54. package/dist/src/shared/dispatch-action.d.ts +1 -1
  55. package/dist/src/subagents/callback-route.js +1 -1
  56. package/dist/src/subagents/callback-step.d.ts +0 -8
  57. package/dist/src/subagents/callback-step.js +1 -1
  58. package/dist/src/svelte/index.js +1 -1
  59. package/dist/src/svelte/use-eve-agent.js +1 -1
  60. package/dist/src/tasks/delivery-context.d.ts +2 -2
  61. package/dist/src/tasks/delivery-context.js +2 -2
  62. package/dist/src/tasks/session-index.d.ts +6 -3
  63. package/dist/src/tasks/session-index.js +1 -1
  64. package/dist/src/tasks/session-task-cohorts.d.ts +10 -2
  65. package/dist/src/tasks/session-task-cohorts.js +1 -1
  66. package/dist/src/tools/behavior.d.ts +1 -3
  67. package/dist/src/tools/framework/task-contract.d.ts +0 -4
  68. package/dist/src/tools/framework/task-contract.js +1 -1
  69. package/dist/src/tracing/agent-action-instrumentation.js +1 -1
  70. package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
  71. package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -1
  72. package/dist/src/tracing/agent-memory-instrumentation.d.ts +13 -0
  73. package/dist/src/tracing/agent-memory-instrumentation.js +1 -0
  74. package/dist/src/tracing/agent-otel-content.d.ts +4 -12
  75. package/dist/src/tracing/agent-otel-content.js +3 -3
  76. package/dist/src/tracing/agent-otel-provider.js +2 -2
  77. package/dist/src/tracing/agent-span-contract.d.ts +1 -0
  78. package/dist/src/tracing/agent-span-contract.js +1 -1
  79. package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
  80. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  81. package/dist/src/tracing/agent-trace-context-store.js +1 -1
  82. package/dist/src/tracing/agent-trace-state.d.ts +3 -1
  83. package/dist/src/tracing/content-attributes.js +1 -1
  84. package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
  85. package/dist/src/vue/index.js +1 -1
  86. package/dist/src/vue/use-eve-agent.js +1 -1
  87. package/docs/concepts/built-in-tools.md +0 -20
  88. package/docs/concepts/sessions-runs-and-streaming.md +9 -1
  89. package/docs/guides/frontend/overview.mdx +1 -1
  90. package/docs/guides/instrumentation.md +56 -30
  91. package/docs/reference/cli.md +9 -9
  92. package/docs/subagents/index.mdx +15 -10
  93. package/package.json +1 -6
  94. package/dist/src/execution/tasks/child/update-step.d.ts +0 -6
  95. package/dist/src/execution/tasks/child/update-step.js +0 -1
  96. package/dist/src/execution/tasks/child/update.d.ts +0 -8
  97. package/dist/src/execution/tasks/child/update.js +0 -1
  98. package/dist/src/public/tools/task-update.d.ts +0 -1
  99. package/dist/src/public/tools/task-update.js +0 -1
  100. package/dist/src/tools/framework/task-update.d.ts +0 -5
  101. package/dist/src/tools/framework/task-update.js +0 -1
@@ -1 +1 @@
1
- import{normalizeChannelAudience}from"#shared/channel-audience.js";import{isInstrumentationPrincipalType}from"#instrumentation/lifecycle.js";import{boundedPrincipalId}from"#tracing/telemetry-budget.js";import{readInstrumentationDecision}from"#shared/instrumentation-decision.js";import{boundedTraceError}from"#tracing/bounded-error.js";const AGENT_TRACE_CONTEXT_KEY=`eve.harness.agentTrace`;function emptyAgentTraceContextState(){return{actionAnchors:{},actions:{},invocations:{},sessions:{},turns:{}}}function serializeAgentTraceContextState(e){return{actionAnchors:e.actionAnchors,actions:e.actions,invocations:Object.fromEntries(Object.entries(e.invocations).map(([e,t])=>[e,{...t,terminal:t.terminal===void 0?void 0:{...t.terminal,error:t.recordOutputs===!0?serializeError(t.terminal.error):void 0}}])),sessions:Object.fromEntries(Object.entries(e.sessions).map(([e,t])=>[e,{...t,context:serializeSpanContext(t.context)}])),turns:Object.fromEntries(Object.entries(e.turns).map(([e,t])=>[e,{...t,caller:t.caller===void 0?void 0:serializeSpanContext(t.caller),channelDelivery:t.channelDelivery===void 0?void 0:{...t.channelDelivery,requestTraceContext:t.channelDelivery.requestTraceContext===void 0?void 0:serializeSpanContext(t.channelDelivery.requestTraceContext)},context:serializeSpanContext(t.context),terminal:t.terminal===void 0?void 0:t.terminal.type===`turn.failed`?{error:serializeError(t.terminal.error),type:t.terminal.type}:{type:t.terminal.type}}]))}}function deserializeAgentTraceContextState(e){return isRecord(e)?{actionAnchors:deserializeRecord(e.actionAnchors,deserializeAction),actions:deserializeRecord(e.actions,deserializeAction),invocations:deserializeRecord(e.invocations,deserializeInvocation),sessions:deserializeRecord(e.sessions,deserializeSession),turns:deserializeRecord(e.turns,deserializeTurn)}:emptyAgentTraceContextState()}function deserializeSession(e){if(isRecord(e)&&isSpanContext(e.context))return{agentName:typeof e.agentName==`string`?e.agentName:void 0,channelAudience:normalizeChannelAudience(e.channelAudience),channelKind:typeof e.channelKind==`string`?e.channelKind:void 0,context:e.context,decision:readInstrumentationDecision(e.decision),parentLineage:deserializeParentLineage(e.parentLineage),rootSessionId:typeof e.rootSessionId==`string`?e.rootSessionId:``}}function deserializeTurn(e){if(isRecord(e)&&isSpanContext(e.context)&&typeof e.startTimeMs==`number`)return{caller:isSpanContext(e.caller)?e.caller:void 0,channelDelivery:deserializeTurnChannelDelivery(e.channelDelivery),context:e.context,currentPrincipal:deserializePrincipalSummary(e.currentPrincipal),initiatorPrincipal:deserializePrincipalSummary(e.initiatorPrincipal),modelUsage:deserializeModelUsage(e.modelUsage),parentLineage:deserializeParentLineage(e.parentLineage),rootSessionId:typeof e.rootSessionId==`string`?e.rootSessionId:``,sequence:typeof e.sequence==`number`?e.sequence:0,startTimeMs:e.startTimeMs,subagentName:typeof e.subagentName==`string`?e.subagentName:void 0,terminal:deserializeTurnTerminal(e.terminal)}}function deserializeTurnChannelDelivery(e){if(isRecord(e)&&typeof e.channelKind==`string`&&typeof e.channelName==`string`&&typeof e.deliveryId==`string`)return{channelKind:e.channelKind,channelName:e.channelName,deliveryId:e.deliveryId,inputAttribute:typeof e.inputAttribute==`string`?e.inputAttribute:void 0,requestId:typeof e.requestId==`string`?e.requestId:void 0,requestTraceContext:isSpanContext(e.requestTraceContext)?e.requestTraceContext:void 0}}function deserializePrincipalSummary(e){if(!isRecord(e)||!isInstrumentationPrincipalType(e.type))return;let t=e.type===`none`?void 0:boundedPrincipalId(e.id);return t===void 0?{type:e.type}:{id:t,type:e.type}}function deserializeAction(e){if(isRecord(e)&&typeof e.attemptIndex==`number`&&typeof e.callId==`string`&&isActionKind(e.kind)&&typeof e.name==`string`&&isSpanContext(e.parent)&&typeof e.rootSessionId==`string`&&typeof e.sessionId==`string`&&typeof e.spanId==`string`&&typeof e.startTimeMs==`number`&&typeof e.stepIndex==`number`&&typeof e.turnId==`string`)return{attemptIndex:e.attemptIndex,callId:e.callId,channelAudience:normalizeChannelAudience(e.channelAudience),inputAttribute:typeof e.inputAttribute==`string`?e.inputAttribute:void 0,kind:e.kind,name:e.name,parent:e.parent,rootSessionId:e.rootSessionId,sessionId:e.sessionId,spanId:e.spanId,startTimeMs:e.startTimeMs,stepIndex:e.stepIndex,turnId:e.turnId}}function deserializeInvocation(e){let t=deserializeAction(e);if(!(t===void 0||t.kind!==`subagent-call`&&t.kind!==`remote-agent-call`||!isRecord(e)||typeof e.parentActionCallId!=`string`))return{attemptIndex:t.attemptIndex,callId:t.callId,channelAudience:t.channelAudience,kind:t.kind,name:t.name,parent:t.parent,parentActionCallId:e.parentActionCallId,recordOutputs:e.recordOutputs===!0,rootSessionId:t.rootSessionId,sessionId:t.sessionId,spanId:t.spanId,startTimeMs:t.startTimeMs,stepIndex:t.stepIndex,terminal:deserializeActionTerminal(e.terminal),turnId:t.turnId}}function deserializeActionTerminal(e){if(isRecord(e)&&isActionOutcome(e.outcome))return{acceptedAtMs:typeof e.acceptedAtMs==`number`?e.acceptedAtMs:void 0,error:deserializeError(e.error),outcome:e.outcome,usage:isRecord(e.usage)?e.usage:void 0}}function deserializeModelUsage(e){if(!isRecord(e))return;let t=typeof e.inputTokens==`number`?e.inputTokens:void 0,n=typeof e.outputTokens==`number`?e.outputTokens:void 0;return t===void 0&&n===void 0?void 0:{inputTokens:t,outputTokens:n}}function deserializeParentLineage(e){if(isRecord(e)&&typeof e.callId==`string`&&typeof e.sessionId==`string`&&typeof e.turnId==`string`)return{callId:e.callId,sessionId:e.sessionId,subagentName:typeof e.subagentName==`string`?e.subagentName:void 0,turnId:e.turnId}}function deserializeTurnTerminal(e){if(isRecord(e)&&isTurnTerminalType(e.type))return e.type===`turn.failed`?{error:deserializeError(e.error),type:e.type}:{type:e.type}}function deserializeRecord(e,t){if(!isRecord(e))return{};let n={};for(let[r,i]of Object.entries(e)){let e=t(i);e!==void 0&&(n[r]=e)}return n}function serializeSpanContext(e){return{isRemote:e.isRemote,spanId:e.spanId,traceFlags:e.traceFlags,traceId:e.traceId}}function serializeError(e){if(!(e instanceof Error))return;let t=boundedTraceError(e);return{message:t.message,name:t.name,stack:t.stack}}function deserializeError(e){if(!isRecord(e)||typeof e.message!=`string`)return;let t=Error(e.message);return typeof e.name==`string`&&(t.name=e.name),typeof e.stack==`string`&&(t.stack=e.stack),t}function isActionKind(e){return e===`load-skill`||e===`remote-agent-call`||e===`subagent-call`||e===`tool-call`}function isActionOutcome(e){return e===`abandoned`||e===`cancelled`||e===`completed`||e===`failed`||e===`rejected`}function isTurnTerminalType(e){return e===`turn.cancelled`||e===`turn.completed`||e===`turn.failed`}function isSpanContext(e){return isRecord(e)&&typeof e.spanId==`string`&&typeof e.traceFlags==`number`&&typeof e.traceId==`string`}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{AGENT_TRACE_CONTEXT_KEY,deserializeAgentTraceContextState,emptyAgentTraceContextState,serializeAgentTraceContextState};
1
+ import{normalizeChannelAudience}from"#shared/channel-audience.js";import{isInstrumentationPrincipalType}from"#instrumentation/lifecycle.js";import{boundedPrincipalId}from"#tracing/telemetry-budget.js";import{readInstrumentationDecision}from"#shared/instrumentation-decision.js";import{boundedTraceError}from"#tracing/bounded-error.js";const AGENT_TRACE_CONTEXT_KEY=`eve.harness.agentTrace`;function emptyAgentTraceContextState(){return{actionAnchors:{},actions:{},invocations:{},sessions:{},turns:{}}}function serializeAgentTraceContextState(e){return{actionAnchors:e.actionAnchors,actions:e.actions,invocations:Object.fromEntries(Object.entries(e.invocations).map(([e,t])=>[e,{...t,terminal:t.terminal===void 0?void 0:{...t.terminal,error:t.recordOutputs===!0?serializeError(t.terminal.error):void 0}}])),sessions:Object.fromEntries(Object.entries(e.sessions).map(([e,t])=>[e,{...t,context:serializeSpanContext(t.context)}])),turns:Object.fromEntries(Object.entries(e.turns).map(([e,t])=>[e,{...t,caller:t.caller===void 0?void 0:serializeSpanContext(t.caller),channelDelivery:t.channelDelivery===void 0?void 0:{...t.channelDelivery,requestTraceContext:t.channelDelivery.requestTraceContext===void 0?void 0:serializeSpanContext(t.channelDelivery.requestTraceContext)},context:serializeSpanContext(t.context),terminal:t.terminal===void 0?void 0:t.terminal.type===`turn.failed`?{error:serializeError(t.terminal.error),type:t.terminal.type}:{type:t.terminal.type}}]))}}function deserializeAgentTraceContextState(e){return isRecord(e)?{actionAnchors:deserializeRecord(e.actionAnchors,deserializeAction),actions:deserializeRecord(e.actions,deserializeAction),invocations:deserializeRecord(e.invocations,deserializeInvocation),sessions:deserializeRecord(e.sessions,deserializeSession),turns:deserializeRecord(e.turns,deserializeTurn)}:emptyAgentTraceContextState()}function deserializeSession(e){if(isRecord(e)&&isSpanContext(e.context))return{agentName:typeof e.agentName==`string`?e.agentName:void 0,channelAudience:normalizeChannelAudience(e.channelAudience),channelKind:typeof e.channelKind==`string`?e.channelKind:void 0,context:e.context,decision:readInstrumentationDecision(e.decision),parentLineage:deserializeParentLineage(e.parentLineage),rootSessionId:typeof e.rootSessionId==`string`?e.rootSessionId:``}}function deserializeTurn(e){if(isRecord(e)&&isSpanContext(e.context)&&typeof e.startTimeMs==`number`)return{caller:isSpanContext(e.caller)?e.caller:void 0,channelDelivery:deserializeTurnChannelDelivery(e.channelDelivery),context:e.context,currentPrincipal:deserializePrincipalSummary(e.currentPrincipal),initiatorPrincipal:deserializePrincipalSummary(e.initiatorPrincipal),modelUsage:deserializeModelUsage(e.modelUsage),parentLineage:deserializeParentLineage(e.parentLineage),rootSessionId:typeof e.rootSessionId==`string`?e.rootSessionId:``,sequence:typeof e.sequence==`number`?e.sequence:0,startTimeMs:e.startTimeMs,subagentName:typeof e.subagentName==`string`?e.subagentName:void 0,terminal:deserializeTurnTerminal(e.terminal)}}function deserializeTurnChannelDelivery(e){if(isRecord(e)&&typeof e.channelKind==`string`&&typeof e.channelName==`string`&&typeof e.deliveryId==`string`)return{channelKind:e.channelKind,channelName:e.channelName,deliveryId:e.deliveryId,inputAttribute:typeof e.inputAttribute==`string`?e.inputAttribute:void 0,requestId:typeof e.requestId==`string`?e.requestId:void 0,requestTraceContext:isSpanContext(e.requestTraceContext)?e.requestTraceContext:void 0}}function deserializePrincipalSummary(e){if(!isRecord(e)||!isInstrumentationPrincipalType(e.type))return;let t=e.type===`none`?void 0:boundedPrincipalId(e.id);return t===void 0?{type:e.type}:{id:t,type:e.type}}function deserializeAction(e){if(isRecord(e)&&typeof e.attemptIndex==`number`&&typeof e.callId==`string`&&isActionKind(e.kind)&&typeof e.name==`string`&&isSpanContext(e.parent)&&typeof e.rootSessionId==`string`&&typeof e.sessionId==`string`&&typeof e.spanId==`string`&&typeof e.startTimeMs==`number`&&typeof e.stepIndex==`number`&&typeof e.turnId==`string`)return{attemptIndex:e.attemptIndex,callId:e.callId,channelAudience:normalizeChannelAudience(e.channelAudience),inputAttribute:typeof e.inputAttribute==`string`?e.inputAttribute:void 0,isWorkflowTool:e.isWorkflowTool===!0||void 0,kind:e.kind,name:e.name,parent:e.parent,rootSessionId:e.rootSessionId,sessionId:e.sessionId,spanId:e.spanId,startTimeMs:e.startTimeMs,stepIndex:e.stepIndex,turnId:e.turnId,workflowName:typeof e.workflowName==`string`?e.workflowName:void 0}}function deserializeInvocation(e){let t=deserializeAction(e);if(!(t===void 0||t.kind!==`subagent-call`&&t.kind!==`remote-agent-call`||!isRecord(e)||typeof e.parentActionCallId!=`string`))return{attemptIndex:t.attemptIndex,callId:t.callId,channelAudience:t.channelAudience,kind:t.kind,name:t.name,parent:t.parent,parentActionCallId:e.parentActionCallId,recordOutputs:e.recordOutputs===!0,rootSessionId:t.rootSessionId,sessionId:t.sessionId,spanId:t.spanId,startTimeMs:t.startTimeMs,stepIndex:t.stepIndex,terminal:deserializeActionTerminal(e.terminal),turnId:t.turnId}}function deserializeActionTerminal(e){if(isRecord(e)&&isActionOutcome(e.outcome))return{acceptedAtMs:typeof e.acceptedAtMs==`number`?e.acceptedAtMs:void 0,error:deserializeError(e.error),outcome:e.outcome,usage:isRecord(e.usage)?e.usage:void 0}}function deserializeModelUsage(e){if(!isRecord(e))return;let t=typeof e.inputTokens==`number`?e.inputTokens:void 0,n=typeof e.outputTokens==`number`?e.outputTokens:void 0;return t===void 0&&n===void 0?void 0:{inputTokens:t,outputTokens:n}}function deserializeParentLineage(e){if(isRecord(e)&&typeof e.callId==`string`&&typeof e.sessionId==`string`&&typeof e.turnId==`string`)return{callId:e.callId,sessionId:e.sessionId,subagentName:typeof e.subagentName==`string`?e.subagentName:void 0,turnId:e.turnId}}function deserializeTurnTerminal(e){if(isRecord(e)&&isTurnTerminalType(e.type))return e.type===`turn.failed`?{error:deserializeError(e.error),type:e.type}:{type:e.type}}function deserializeRecord(e,t){if(!isRecord(e))return{};let n={};for(let[r,i]of Object.entries(e)){let e=t(i);e!==void 0&&(n[r]=e)}return n}function serializeSpanContext(e){return{isRemote:e.isRemote,spanId:e.spanId,traceFlags:e.traceFlags,traceId:e.traceId}}function serializeError(e){if(!(e instanceof Error))return;let t=boundedTraceError(e);return{message:t.message,name:t.name,stack:t.stack}}function deserializeError(e){if(!isRecord(e)||typeof e.message!=`string`)return;let t=Error(e.message);return typeof e.name==`string`&&(t.name=e.name),typeof e.stack==`string`&&(t.stack=e.stack),t}function isActionKind(e){return e===`load-skill`||e===`remote-agent-call`||e===`subagent-call`||e===`tool-call`}function isActionOutcome(e){return e===`abandoned`||e===`cancelled`||e===`completed`||e===`failed`||e===`rejected`}function isTurnTerminalType(e){return e===`turn.cancelled`||e===`turn.completed`||e===`turn.failed`}function isSpanContext(e){return isRecord(e)&&typeof e.spanId==`string`&&typeof e.traceFlags==`number`&&typeof e.traceId==`string`}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}export{AGENT_TRACE_CONTEXT_KEY,deserializeAgentTraceContextState,emptyAgentTraceContextState,serializeAgentTraceContextState};
@@ -1 +1 @@
1
- import{createLogger}from"#internal/logging.js";import{contextStorage,loadContext}from"#context/container.js";import{SessionTraceSeedKey}from"#context/keys.js";import{ContextKey}from"#context/key.js";import{decisionToTraceContentCeiling,resolveForwardedTraceSeed}from"#shared/forwarded-trace-policy.js";import{getWorkflowToolRuns}from"#harness/workflow-tool-runs.js";import{getSessionTaskIndex}from"#tasks/session-index.js";import{deriveTaskId}from"#tasks/task-id.js";import{actionIdempotencyKey}from"#instrumentation/lifecycle.js";import{AGENT_TRACE_CONTEXT_KEY,deserializeAgentTraceContextState,emptyAgentTraceContextState,serializeAgentTraceContextState}from"#tracing/agent-trace-context-codec.js";const AgentTraceContextKey=new ContextKey(AGENT_TRACE_CONTEXT_KEY,{codec:{deserialize:deserializeAgentTraceContextState,serialize:serializeAgentTraceContextState}});function pruneAgentTraceState(e,t,n){try{pruneTraceOwnership(e,t,n)}catch(e){createLogger(`tracing.retention`).warn(`could not reconcile trace ownership; preserving trace state`,{error:e})}}function pruneTraceOwnership(e,t,n){let r=e.get(AgentTraceContextKey);if(r===void 0)return;let i=new Set(getWorkflowToolRuns(n).map(e=>e.callId)),a=new Set(getSessionTaskIndex(n).filter(e=>e.terminalView===void 0).map(e=>e.taskId)),o=Object.fromEntries(Object.entries(r.actionAnchors).filter(([e,n])=>n.sessionId!==t||r.actions[e]!==void 0||i.has(n.callId)||a.has(deriveTaskId({callId:n.callId,parentSessionId:t,parentTurnId:n.turnId})))),s=new Set(Object.values(o).filter(e=>e.sessionId===t).map(e=>e.callId)),c=Object.fromEntries(Object.entries(r.invocations).filter(([,e])=>e.sessionId!==t||e.terminal!==void 0||s.has(e.parentActionCallId)));e.set(AgentTraceContextKey,{...r,actionAnchors:o,invocations:c})}function readCurrentSessionTraceDecision(e){let t=contextStorage.getStore();return t===void 0?void 0:readSessionTraceDecision(t,e)}function readSessionTraceDecision(e,t){return e.get(AgentTraceContextKey)?.sessions[t]?.decision}function preserveSerializedAgentTraceState(e,t){let n=t[AgentTraceContextKey.name];return n===void 0?e:{...e,[AgentTraceContextKey.name]:n}}function readTurnTraceContext(e,t,n){let r=e[AgentTraceContextKey.name];if(r===void 0)return;let i=deserializeAgentTraceContextState(r),a=i.turns[turnKey(t,n)];return a===void 0?void 0:withTraceDecision(e,a.context,i.sessions[t]?.decision)}function readActionTraceContext(e,t,n,r){let i=e[AgentTraceContextKey.name];if(i===void 0)return;let a=deserializeAgentTraceContextState(i),o=actionIdempotencyKey(t,n,r),s=a.invocations[o]??a.actions[o]??a.actionAnchors[o];if(s!==void 0)return withTraceDecision(e,{isRemote:!1,spanId:s.spanId,traceFlags:s.parent.traceFlags,traceId:s.parent.traceId},a.sessions[s.sessionId]?.decision)}function readTaskActionTrace(e,t,n){let r=deserializeAgentTraceContextState(e[AgentTraceContextKey.name]);return Object.values(r.actionAnchors).find(e=>e.sessionId===t&&deriveTaskId({callId:e.callId,parentSessionId:t,parentTurnId:e.turnId})===n)}function recordNestedAgentInvocation(e){let t=e.serializedContext[AgentTraceContextKey.name];if(t===void 0)return e.serializedContext;let n=deserializeAgentTraceContextState(t),r=actionIdempotencyKey(e.sessionId,e.turnId,e.outerCallId),i=n.actions[r]??n.actionAnchors[r];if(i===void 0)return e.serializedContext;let a=actionIdempotencyKey(e.sessionId,e.turnId,e.callId);if(n.invocations[a]!==void 0)return e.serializedContext;let o={attemptIndex:i.attemptIndex,callId:e.callId,channelAudience:i.channelAudience,kind:e.kind,name:e.name,parent:{spanId:i.spanId,traceFlags:i.parent.traceFlags,traceId:i.parent.traceId},parentActionCallId:e.outerCallId,recordOutputs:e.recordOutputs===!0,rootSessionId:i.rootSessionId,sessionId:i.sessionId,spanId:e.spanId,startTimeMs:e.startTimeMs,stepIndex:i.stepIndex,turnId:i.turnId};return{...e.serializedContext,[AgentTraceContextKey.name]:serializeAgentTraceContextState({...n,invocations:{...n.invocations,[a]:o}})}}function recordActionInvocationKind(e){let t=e.serializedContext[AgentTraceContextKey.name];if(t===void 0)return e.serializedContext;let n=deserializeAgentTraceContextState(t),update=t=>t.sessionId===e.sessionId&&t.turnId===e.turnId&&t.callId===e.callId?{...t,kind:e.kind}:t;return{...e.serializedContext,[AgentTraceContextKey.name]:serializeAgentTraceContextState({...n,actionAnchors:Object.fromEntries(Object.entries(n.actionAnchors).map(([e,t])=>[e,update(t)])),actions:Object.fromEntries(Object.entries(n.actions).map(([e,t])=>[e,update(t)]))})}}function withTraceDecision(e,t,n){let r=e[SessionTraceSeedKey.name],i=resolveForwardedTraceSeed({decision:n??r?.decision,forwardedTracePolicy:r?.forwardedTracePolicy,traceFlags:t.traceFlags}),a=i.decision,o=i.forwardedTracePolicy,s=decisionToTraceContentCeiling(a),c={...t,traceFlags:i.traceFlags};if(o===void 0)return a===void 0?c:{...c,decision:a};let l=s===void 0?o:{...o,ceiling:s};return a===void 0?{...c,forwardedTracePolicy:l}:{...c,decision:a,forwardedTracePolicy:l}}var ContextAgentTraceStateStore=class{deleteAction(e){updateState(t=>{let n={...t.actions};return delete n[e],{...t,actions:n}})}deleteActionAnchors(e){updateState(t=>({...t,actionAnchors:Object.fromEntries(Object.entries(t.actionAnchors).filter(([,t])=>t.sessionId!==e))}))}deleteActions(e,t){updateState(n=>{let r={...n.actions};for(let[n,i]of Object.entries(r))i.sessionId===e&&(t===void 0||i.turnId===t)&&delete r[n];return{...n,actions:r}})}deleteInvocation(e){updateState(t=>{let n={...t.invocations};return delete n[e],{...t,invocations:n}})}deleteInvocations(e,t){updateState(n=>({...n,invocations:Object.fromEntries(Object.entries(n.invocations).filter(([,n])=>n.sessionId!==e||t!==void 0&&n.turnId!==t))}))}deleteSession(e){updateState(t=>{let n={...t.sessions};return delete n[e],{...t,sessions:n}})}deleteTurn(e,t){updateState(n=>{let r={...n.turns};return delete r[turnKey(e,t)],{...n,turns:r}})}findAction(e,t){return Object.values(contextStorage.getStore()?.get(AgentTraceContextKey)?.actions??{}).find(n=>n.sessionId===e&&n.callId===t)}findActionAnchor(e,t,n){return Object.values(contextStorage.getStore()?.get(AgentTraceContextKey)?.actionAnchors??{}).find(r=>r.sessionId===e&&r.turnId===t&&r.callId===n)}findInvocations(e,t,n){return Object.values(contextStorage.getStore()?.get(AgentTraceContextKey)?.invocations??{}).filter(r=>(e===void 0||r.sessionId===e)&&(t===void 0||r.turnId===t)&&(n===void 0||r.parentActionCallId===n))}getAction(e){return contextStorage.getStore()?.get(AgentTraceContextKey)?.actions[e]}getSession(e){return contextStorage.getStore()?.get(AgentTraceContextKey)?.sessions[e]}getTurn(e,t){return contextStorage.getStore()?.get(AgentTraceContextKey)?.turns[turnKey(e,t)]}setAction(e,t){updateState(n=>({...n,actions:{...n.actions,[e]:t}}))}setActionAnchor(e,t){updateState(n=>({...n,actionAnchors:{...n.actionAnchors,[e]:t}}))}setInvocation(e,t){updateState(n=>({...n,invocations:{...n.invocations,[e]:t}}))}setSession(e,t){updateState(n=>({...n,sessions:{...n.sessions,[e]:t}}))}setTurn(e,t,n){updateState(r=>({...r,turns:{...r.turns,[turnKey(e,t)]:n}}))}updateTurn(e,t,n){updateState(r=>{let i=turnKey(e,t),a=r.turns[i];return a===void 0?r:{...r,turns:{...r.turns,[i]:n(a)}}})}};function updateState(e){loadContext().set(AgentTraceContextKey,t=>e(t??emptyAgentTraceContextState()))}function turnKey(e,t){return`${e}\0${t}`}export{ContextAgentTraceStateStore,preserveSerializedAgentTraceState,pruneAgentTraceState,readActionTraceContext,readCurrentSessionTraceDecision,readSessionTraceDecision,readTaskActionTrace,readTurnTraceContext,recordActionInvocationKind,recordNestedAgentInvocation};
1
+ import{createLogger}from"#internal/logging.js";import{contextStorage,loadContext}from"#context/container.js";import{SessionTraceSeedKey}from"#context/keys.js";import{ContextKey}from"#context/key.js";import{decisionToTraceContentCeiling,resolveForwardedTraceSeed}from"#shared/forwarded-trace-policy.js";import{getWorkflowToolRuns}from"#harness/workflow-tool-runs.js";import{getSessionTaskIndex}from"#tasks/session-index.js";import{deriveTaskId}from"#tasks/task-id.js";import{actionIdempotencyKey}from"#instrumentation/lifecycle.js";import{AGENT_TRACE_CONTEXT_KEY,deserializeAgentTraceContextState,emptyAgentTraceContextState,serializeAgentTraceContextState}from"#tracing/agent-trace-context-codec.js";const AgentTraceContextKey=new ContextKey(AGENT_TRACE_CONTEXT_KEY,{codec:{deserialize:deserializeAgentTraceContextState,serialize:serializeAgentTraceContextState}});function pruneAgentTraceState(e,t,n){try{pruneTraceOwnership(e,t,n)}catch(e){createLogger(`tracing.retention`).warn(`could not reconcile trace ownership; preserving trace state`,{error:e})}}function pruneTraceOwnership(e,t,n){let r=e.get(AgentTraceContextKey);if(r===void 0)return;let i=new Set(getWorkflowToolRuns(n).map(e=>e.callId)),a=new Set(getSessionTaskIndex(n).filter(e=>e.terminalView===void 0).map(e=>e.taskId)),o=Object.fromEntries(Object.entries(r.actionAnchors).filter(([e,n])=>n.sessionId!==t||r.actions[e]!==void 0||i.has(n.callId)||a.has(deriveTaskId({callId:n.callId,parentSessionId:t,parentTurnId:n.turnId})))),s=new Set(Object.values(o).filter(e=>e.sessionId===t).map(e=>e.callId)),c=Object.fromEntries(Object.entries(r.invocations).filter(([,e])=>e.sessionId!==t||e.terminal!==void 0||s.has(e.parentActionCallId)));e.set(AgentTraceContextKey,{...r,actionAnchors:o,invocations:c})}function readCurrentSessionTraceDecision(e){let t=contextStorage.getStore();return t===void 0?void 0:readSessionTraceDecision(t,e)}function readSessionTraceDecision(e,t){return e.get(AgentTraceContextKey)?.sessions[t]?.decision}function preserveSerializedAgentTraceState(e,t){let n=t[AgentTraceContextKey.name];return n===void 0?e:{...e,[AgentTraceContextKey.name]:n}}function readTurnTraceContext(e,t,n){let r=e[AgentTraceContextKey.name];if(r===void 0)return;let i=deserializeAgentTraceContextState(r),a=i.turns[turnKey(t,n)];return a===void 0?void 0:withTraceDecision(e,a.context,i.sessions[t]?.decision)}function readActionTraceContext(e,t,n,r){let i=e[AgentTraceContextKey.name];if(i===void 0)return;let a=deserializeAgentTraceContextState(i),o=actionIdempotencyKey(t,n,r),s=a.invocations[o]??a.actions[o]??a.actionAnchors[o];if(s!==void 0)return withTraceDecision(e,{isRemote:!1,spanId:s.spanId,traceFlags:s.parent.traceFlags,traceId:s.parent.traceId},a.sessions[s.sessionId]?.decision)}function readTaskActionTrace(e,t,n){let r=deserializeAgentTraceContextState(e[AgentTraceContextKey.name]);return Object.values(r.actionAnchors).find(e=>e.sessionId===t&&deriveTaskId({callId:e.callId,parentSessionId:t,parentTurnId:e.turnId})===n)}function recordNestedAgentInvocation(e){let t=e.serializedContext[AgentTraceContextKey.name];if(t===void 0)return e.serializedContext;let n=deserializeAgentTraceContextState(t),r=actionIdempotencyKey(e.sessionId,e.turnId,e.outerCallId),i=n.actions[r]??n.actionAnchors[r];if(i===void 0)return e.serializedContext;let a=actionIdempotencyKey(e.sessionId,e.turnId,e.callId),promote=e=>e.isWorkflowTool===!0&&e.kind===`tool-call`?{...e,workflowName:e.name}:e,o=n.actions[r]===void 0?n.actions:{...n.actions,[r]:promote(n.actions[r])},s=n.actionAnchors[r]===void 0?n.actionAnchors:{...n.actionAnchors,[r]:promote(n.actionAnchors[r])};if(n.invocations[a]!==void 0)return{...e.serializedContext,[AgentTraceContextKey.name]:serializeAgentTraceContextState({...n,actionAnchors:s,actions:o})};let c={attemptIndex:i.attemptIndex,callId:e.callId,channelAudience:i.channelAudience,kind:e.kind,name:e.name,parent:{spanId:i.spanId,traceFlags:i.parent.traceFlags,traceId:i.parent.traceId},parentActionCallId:e.outerCallId,recordOutputs:e.recordOutputs===!0,rootSessionId:i.rootSessionId,sessionId:i.sessionId,spanId:e.spanId,startTimeMs:e.startTimeMs,stepIndex:i.stepIndex,turnId:i.turnId};return{...e.serializedContext,[AgentTraceContextKey.name]:serializeAgentTraceContextState({...n,actionAnchors:s,actions:o,invocations:{...n.invocations,[a]:c}})}}function recordActionInvocationKind(e){let t=e.serializedContext[AgentTraceContextKey.name];if(t===void 0)return e.serializedContext;let n=deserializeAgentTraceContextState(t),update=t=>t.sessionId===e.sessionId&&t.turnId===e.turnId&&t.callId===e.callId?{...t,isWorkflowTool:void 0,kind:e.kind,workflowName:void 0}:t;return{...e.serializedContext,[AgentTraceContextKey.name]:serializeAgentTraceContextState({...n,actionAnchors:Object.fromEntries(Object.entries(n.actionAnchors).map(([e,t])=>[e,update(t)])),actions:Object.fromEntries(Object.entries(n.actions).map(([e,t])=>[e,update(t)]))})}}function withTraceDecision(e,t,n){let r=e[SessionTraceSeedKey.name],i=resolveForwardedTraceSeed({decision:n??r?.decision,forwardedTracePolicy:r?.forwardedTracePolicy,traceFlags:t.traceFlags}),a=i.decision,o=i.forwardedTracePolicy,s=decisionToTraceContentCeiling(a),c={...t,traceFlags:i.traceFlags};if(o===void 0)return a===void 0?c:{...c,decision:a};let l=s===void 0?o:{...o,ceiling:s};return a===void 0?{...c,forwardedTracePolicy:l}:{...c,decision:a,forwardedTracePolicy:l}}var ContextAgentTraceStateStore=class{deleteAction(e){updateState(t=>{let n={...t.actions};return delete n[e],{...t,actions:n}})}deleteActionAnchors(e){updateState(t=>({...t,actionAnchors:Object.fromEntries(Object.entries(t.actionAnchors).filter(([,t])=>t.sessionId!==e))}))}deleteActions(e,t){updateState(n=>{let r={...n.actions};for(let[n,i]of Object.entries(r))i.sessionId===e&&(t===void 0||i.turnId===t)&&delete r[n];return{...n,actions:r}})}deleteInvocation(e){updateState(t=>{let n={...t.invocations};return delete n[e],{...t,invocations:n}})}deleteInvocations(e,t){updateState(n=>({...n,invocations:Object.fromEntries(Object.entries(n.invocations).filter(([,n])=>n.sessionId!==e||t!==void 0&&n.turnId!==t))}))}deleteSession(e){updateState(t=>{let n={...t.sessions};return delete n[e],{...t,sessions:n}})}deleteTurn(e,t){updateState(n=>{let r={...n.turns};return delete r[turnKey(e,t)],{...n,turns:r}})}findAction(e,t){return Object.values(contextStorage.getStore()?.get(AgentTraceContextKey)?.actions??{}).find(n=>n.sessionId===e&&n.callId===t)}findActionAnchor(e,t,n){return Object.values(contextStorage.getStore()?.get(AgentTraceContextKey)?.actionAnchors??{}).find(r=>r.sessionId===e&&r.turnId===t&&r.callId===n)}findInvocations(e,t,n){return Object.values(contextStorage.getStore()?.get(AgentTraceContextKey)?.invocations??{}).filter(r=>(e===void 0||r.sessionId===e)&&(t===void 0||r.turnId===t)&&(n===void 0||r.parentActionCallId===n))}getAction(e){return contextStorage.getStore()?.get(AgentTraceContextKey)?.actions[e]}getSession(e){return contextStorage.getStore()?.get(AgentTraceContextKey)?.sessions[e]}getTurn(e,t){return contextStorage.getStore()?.get(AgentTraceContextKey)?.turns[turnKey(e,t)]}setAction(e,t){updateState(n=>({...n,actions:{...n.actions,[e]:t}}))}setActionAnchor(e,t){updateState(n=>({...n,actionAnchors:{...n.actionAnchors,[e]:t}}))}setInvocation(e,t){updateState(n=>({...n,invocations:{...n.invocations,[e]:t}}))}setSession(e,t){updateState(n=>({...n,sessions:{...n.sessions,[e]:t}}))}setTurn(e,t,n){updateState(r=>({...r,turns:{...r.turns,[turnKey(e,t)]:n}}))}updateTurn(e,t,n){updateState(r=>{let i=turnKey(e,t),a=r.turns[i];return a===void 0?r:{...r,turns:{...r.turns,[i]:n(a)}}})}};function updateState(e){loadContext().set(AgentTraceContextKey,t=>e(t??emptyAgentTraceContextState()))}function turnKey(e,t){return`${e}\0${t}`}export{ContextAgentTraceStateStore,preserveSerializedAgentTraceState,pruneAgentTraceState,readActionTraceContext,readCurrentSessionTraceDecision,readSessionTraceDecision,readTaskActionTrace,readTurnTraceContext,recordActionInvocationKind,recordNestedAgentInvocation};
@@ -46,6 +46,7 @@ export interface AgentActionTraceState {
46
46
  readonly callId: string;
47
47
  readonly channelAudience?: ChannelAudience;
48
48
  readonly inputAttribute?: string;
49
+ readonly isWorkflowTool?: boolean;
49
50
  readonly kind: InstrumentationActionKind;
50
51
  readonly name: string;
51
52
  readonly parent: InstrumentationTraceContext;
@@ -55,8 +56,9 @@ export interface AgentActionTraceState {
55
56
  readonly startTimeMs: number;
56
57
  readonly stepIndex: number;
57
58
  readonly turnId: string;
59
+ readonly workflowName?: string;
58
60
  }
59
- export interface AgentInvocationTraceState extends Omit<AgentActionTraceState, "inputAttribute" | "kind"> {
61
+ export interface AgentInvocationTraceState extends Omit<AgentActionTraceState, "inputAttribute" | "isWorkflowTool" | "kind" | "workflowName"> {
60
62
  readonly kind: "remote-agent-call" | "subagent-call";
61
63
  readonly parentActionCallId: string;
62
64
  readonly recordOutputs?: boolean;
@@ -1 +1 @@
1
- const INPUT_CONTENT_ATTRIBUTES=new Set([`agent.channel.delivery.input`,`agent.approval.request`,`ai.documents`,`ai.prompt`,`ai.prompt.messages`,`ai.prompt.system`,`ai.prompt.toolChoice`,`ai.prompt.tools`,`ai.value`,`ai.values`,`gen_ai.input.messages`,`gen_ai.system_instructions`,`gen_ai.tool.call.arguments`,`gen_ai.tool.definitions`]),OUTPUT_CONTENT_ATTRIBUTES=new Set([`agent.approval.response`,`ai.embedding`,`ai.embeddings`,`ai.ranking`,`ai.response.files`,`ai.response.object`,`ai.response.reasoning`,`ai.response.text`,`ai.response.toolCalls`,`ai.response.tool_calls`,`ai.response.tool_results`,`ai.toolCall.args`,`ai.toolCall.result`,`gen_ai.output.messages`,`gen_ai.tool.call.result`]);function isDeclined(e,t){return!t.recordInputs&&INPUT_CONTENT_ATTRIBUTES.has(e)?!0:!t.recordOutputs&&OUTPUT_CONTENT_ATTRIBUTES.has(e)}function withoutDeclinedContent(e,t){let n=Object.keys(e);if(!n.some(e=>isDeclined(e,t)))return;let r={};for(let i of n)isDeclined(i,t)||(r[i]=e[i]);return r}export{withoutDeclinedContent};
1
+ const INPUT_CONTENT_ATTRIBUTES=new Set([`agent.channel.delivery.input`,`agent.approval.request`,`ai.documents`,`ai.prompt`,`ai.prompt.system`,`ai.prompt.toolChoice`,`ai.prompt.tools`,`ai.value`,`ai.values`,`gen_ai.input.messages`,`gen_ai.memory.records`,`gen_ai.system_instructions`,`gen_ai.tool.call.arguments`,`gen_ai.tool.definitions`]),OUTPUT_CONTENT_ATTRIBUTES=new Set([`agent.approval.response`,`ai.embedding`,`ai.embeddings`,`ai.ranking`,`ai.response.files`,`ai.response.object`,`ai.response.reasoning`,`ai.response.text`,`ai.response.toolCalls`,`ai.response.tool_calls`,`ai.response.tool_results`,`ai.toolCall.args`,`ai.toolCall.result`,`gen_ai.output.messages`,`gen_ai.tool.call.result`]);function isDeclined(e,t){return!t.recordInputs&&INPUT_CONTENT_ATTRIBUTES.has(e)?!0:!t.recordOutputs&&OUTPUT_CONTENT_ATTRIBUTES.has(e)}function withoutDeclinedContent(e,t){let n=Object.keys(e);if(!n.some(e=>isDeclined(e,t)))return;let r={};for(let i of n)isDeclined(i,t)||(r[i]=e[i]);return r}export{withoutDeclinedContent};
@@ -1 +1 @@
1
- import{createLogger,formatError}from"#internal/logging.js";import{contextStorage}from"#context/container.js";import{ConversationIdKey}from"#context/keys.js";import{readConversationId}from"#tracing/conversation-context.js";import{ContextAgentTraceStateStore}from"#tracing/agent-trace-context-store.js";import{registerInstrumentationRuntime}from"#instrumentation/runtime.js";import{trace}from"#compiled/@opentelemetry/api/index.js";import{createInstrumentationHooks}from"#instrumentation/lifecycle.js";import{AgentSpanIdGenerator}from"#tracing/agent-span-id-generator.js";import{hasConversationRelease}from"#tracing/local-traces.js";import{createAgentOtelInstrumentation}from"#tracing/agent-otel-provider.js";import{registerOtelPipeline}from"#tracing/otel-registration.js";const log=createLogger(`tracing.install-instrumentation-runtime`);function installInstrumentationRuntime(e){let t=[],n=[],r,flushSettledInvocations,i,a,runInContext=(e,t)=>t();if(e.collected.declared){r=registerOtelPipeline({pipeline:e.collected.pipeline,serviceName:e.serviceName});let o=createAgentOtelInstrumentation({frameworkVersion:e.frameworkVersion,idGenerator:r.idGenerator,recordInputs:e.collected.settings.recordInputs,recordOutputs:e.collected.settings.recordOutputs,samplesTrace:r.samplesTrace,stateStore:new ContextAgentTraceStateStore,tracer:trace.getTracer(`eve.agent`,e.frameworkVersion),tracePolicy:e.collected.settings.tracePolicy});t.push({...o.hook,stateNamespace:`internal:otel`}),flushSettledInvocations=async()=>{await o.hook.flush?.()},i=o.prepareSessionTrace,a=o.prepareTurnTrace,runInContext=o.runInContext;let s=e.collected.pipeline.spanProcessors.filter(isSpanProcessor).filter(hasConversationRelease);s.length>0&&n.push(sessionReleaseProvider(s))}let o=[...t,...e.providers,...n],s;return registerInstrumentationRuntime({flushSettledInvocations,forceFlush:async()=>{await settleAll(o.map(e=>()=>e.flush?.())),await settleAll(r===void 0?[]:[r.forceFlush])},hooks:createInstrumentationHooks({parallel:e.providers,serialAfter:n,serialBefore:t}),idGenerator:r?.idGenerator??new AgentSpanIdGenerator,instrumentationProviders:e.instrumentationProviders,otelSettings:e.collected.declared?e.collected.settings:void 0,ownsAgentSpans:r!==void 0,prepareSessionTrace:i,prepareTurnTrace:a,runtimeContextResolvers:e.runtimeContextResolvers,runInContext,samplesTrace:r?.samplesTrace,shutdown:()=>(s??=(async()=>{await settleAll(o.map(e=>()=>e.shutdown?.())),await settleAll(r===void 0?[]:[r.shutdown])})(),s)})}function isSpanProcessor(e){return e!==`auto`}function sessionReleaseProvider(e){let release=async t=>{let n=readConversationId(contextStorage.getStore()?.get(ConversationIdKey))??t.sessionId;n===t.sessionId&&await Promise.all(e.map(e=>e.releaseConversation(n)))};return{events:{"session.completed":release,"session.failed":release},name:`eve.conversation-release`,stateNamespace:`internal:conversation-release`}}async function settleAll(e){let t=await Promise.allSettled(e.map(async e=>e()));for(let e of t)e.status===`rejected`&&log.warn(`instrumentation drain failed`,{error:formatError(e.reason)})}export{installInstrumentationRuntime};
1
+ import{createLogger,formatError}from"#internal/logging.js";import{contextStorage}from"#context/container.js";import{ConversationIdKey}from"#context/keys.js";import{readConversationId}from"#tracing/conversation-context.js";import{ContextAgentTraceStateStore}from"#tracing/agent-trace-context-store.js";import{registerInstrumentationRuntime}from"#instrumentation/runtime.js";import{trace}from"#compiled/@opentelemetry/api/index.js";import{createInstrumentationHooks}from"#instrumentation/lifecycle.js";import{AgentSpanIdGenerator}from"#tracing/agent-span-id-generator.js";import{hasConversationRelease}from"#tracing/local-traces.js";import{createAgentOtelInstrumentation}from"#tracing/agent-otel-provider.js";import{registerOtelPipeline}from"#tracing/otel-registration.js";const log=createLogger(`tracing.install-instrumentation-runtime`);function installInstrumentationRuntime(e){let t=[],n=[],r,flushSettledInvocations,i,a,runInContext=(e,t)=>t();if(e.collected.declared){r=registerOtelPipeline({pipeline:e.collected.pipeline,serviceName:e.serviceName});let o=createAgentOtelInstrumentation({frameworkVersion:e.frameworkVersion,idGenerator:r.idGenerator,recordInputs:e.collected.settings.recordInputs,recordOutputs:e.collected.settings.recordOutputs,samplesTrace:r.samplesTrace,stateStore:new ContextAgentTraceStateStore,tracer:trace.getTracer(`eve.agent`,e.frameworkVersion),tracePolicy:e.collected.settings.tracePolicy});t.push({...o.hook,stateNamespace:`internal:otel`}),flushSettledInvocations=async()=>{await o.hook.flush?.()},i=o.prepareSessionTrace,a=o.prepareTurnTrace,runInContext=o.runInContext;let s=e.collected.pipeline.spanProcessors.filter(isSpanProcessor).filter(hasConversationRelease);s.length>0&&n.push(sessionReleaseProvider(s))}let o=[...t,...e.providers,...n],s;return registerInstrumentationRuntime({flushSettledInvocations,forceFlush:async()=>{await settleAll(o.map(e=>()=>e.flush?.())),await settleAll(r===void 0?[]:[r.forceFlush])},hooks:createInstrumentationHooks({parallel:e.providers,serialAfter:n,serialBefore:t}),idGenerator:r?.idGenerator??new AgentSpanIdGenerator,instrumentationProviders:e.instrumentationProviders,memoryOperations:r!==void 0||e.providers.some(hasMemoryOperationHandler),otelSettings:e.collected.declared?e.collected.settings:void 0,ownsAgentSpans:r!==void 0,prepareSessionTrace:i,prepareTurnTrace:a,runtimeContextResolvers:e.runtimeContextResolvers,runInContext,samplesTrace:r?.samplesTrace,shutdown:()=>(s??=(async()=>{await settleAll(o.map(e=>()=>e.shutdown?.())),await settleAll(r===void 0?[]:[r.shutdown])})(),s)})}function hasMemoryOperationHandler(e){return e.events?.[`memory.operation.started`]!==void 0||e.events?.[`memory.operation.completed`]!==void 0||e.events?.[`memory.operation.failed`]!==void 0}function isSpanProcessor(e){return e!==`auto`}function sessionReleaseProvider(e){let release=async t=>{let n=readConversationId(contextStorage.getStore()?.get(ConversationIdKey))??t.sessionId;n===t.sessionId&&await Promise.all(e.map(e=>e.releaseConversation(n)))};return{events:{"session.completed":release,"session.failed":release},name:`eve.conversation-release`,stateNamespace:`internal:conversation-release`}}async function settleAll(e){let t=await Promise.allSettled(e.map(async e=>e()));for(let e of t)e.status===`rejected`&&log.warn(`instrumentation drain failed`,{error:formatError(e.reason)})}export{installInstrumentationRuntime};
@@ -1,3 +1,3 @@
1
- import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-BR8EpIOX.js";
1
+ import { n as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-CxPlg0KL.js";
2
2
 
3
3
  export { defaultMessageReducer, useEveAgent };
@@ -1,3 +1,3 @@
1
- import { t as useEveAgent } from "../chunks/use-eve-agent-BR8EpIOX.js";
1
+ import { t as useEveAgent } from "../chunks/use-eve-agent-CxPlg0KL.js";
2
2
 
3
3
  export { useEveAgent };
@@ -319,26 +319,6 @@ import { disableTool } from "eve/tools";
319
319
  export default disableTool();
320
320
  ```
321
321
 
322
- ### `task_update`
323
-
324
- `task_update` lets a background task report progress to its parent. It appears only in delegated task sessions.
325
-
326
- ```sh
327
- eve add tool/task_update
328
- ```
329
-
330
- ```ts title="agent/tools/task_update.ts"
331
- export { default } from "eve/tools/task_update";
332
- ```
333
-
334
- The framework behavior cannot be overridden. Re-export the definition above to restore it, or disable it:
335
-
336
- ```ts title="agent/tools/task_update.ts"
337
- import { disableTool } from "eve/tools";
338
-
339
- export default disableTool();
340
- ```
341
-
342
322
  ### `load_skill`
343
323
 
344
324
  `load_skill` pulls an on-demand [skill](../skills)'s instructions into the current turn. It appears only when the agent declares skills and adds no execution surface by itself.
@@ -97,10 +97,18 @@ Note: consider the privacy, confidentiality, and user-experience implications fo
97
97
 
98
98
  When a task explicitly requires conditional delivery and there is nothing new to report, the agent can finish with exactly `<eve-empty-delivery/>`. eve emits `message.completed` with `message: null` for that intentional silence. The marker must be the entire response, apart from surrounding whitespace; the HTML-escaped form `&lt;eve-empty-delivery/&gt;` is also accepted. A response that quotes the marker in prose or code is delivered normally.
99
99
 
100
- A delegated subagent publishes progress on its own child-session stream. The parent emits `subagent.called` with a `childSessionId`, which a client uses to attach. `subagent.completed` carries a working task receipt after admission; later updates and outcomes arrive as task-triggered `message.received` notifications.
100
+ A delegated subagent publishes progress on its own child-session stream. The parent emits `subagent.called` with a `childSessionId`, which a client uses to attach. `subagent.completed` carries a working task receipt after admission; terminal outcomes arrive as task-triggered `message.received` notifications.
101
101
 
102
102
  `step.failed` and `turn.failed` carry `{ code, message, details? }` for the failed fragment or turn, and `session.failed` is the terminal session-level variant. `turn.cancelled` is not a failure: the cancelled turn ends without any failure event, `session.waiting` follows, and the session accepts the next message normally. Whatever the turn streamed before cancellation stays on the stream. Durable history keeps the accepted user input and previously settled work, but discards incomplete assistant output and unfinished tool state. When a turn requested an output schema, the finalized payload lands on `result.completed` as `data.result` before the turn boundary. `authorization.required` carries the sign-in challenge (`data.authorization` may include `url`, `userCode`, `expiresAt`, `instructions`), and `authorization.completed` carries `data.outcome` (`"authorized" | "declined" | "failed" | "timed-out"`).
103
103
 
104
+ A provider response ending with `content-filter` fails with `MODEL_CALL_FAILED`,
105
+ `details.semanticErrorId: "model-response-content-filtered"`, and
106
+ `details.finishReason: "content-filter"`. Details also include the Gateway
107
+ `generationId` when available. eve does not retry the filtered response or emit
108
+ `message.completed` for its partial text; deltas already streamed remain visible.
109
+ Conversation sessions wait for another user message, while task-mode runs return
110
+ a failed result.
111
+
104
112
  ## The event envelope
105
113
 
106
114
  Alongside `type` and `data`, every event carries a `meta` envelope:
@@ -87,7 +87,7 @@ Most chat UIs only need `data.messages` and `status`. Drop down to `events` when
87
87
 
88
88
  `data.messages` are eve-owned `EveMessage[]`. Common text, reasoning, file, and dynamic-tool parts follow the [AI SDK `UIMessage`](https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message) rendering convention, but the types are not interchangeable. eve also exposes authorization and HITL metadata, and a file part's URL can be absent. Adapt those parts before passing messages to an API typed as `UIMessage[]`.
89
89
 
90
- When the root agent delegates, its stream emits `subagent.called` with the child's `childSessionId`, then `subagent.completed` after admission with a working task receipt. Later task notifications wake the parent with updates or the final result. Detailed child progress lives on the child session's stream instead of being flattened into the root `data.messages`. Use the lower-level [TypeScript client](../client/overview#sessions) to attach to that ID when your UI needs live subagent activity. See [What the parent sees](../../subagents#what-the-parent-sees) for the complete contract.
90
+ When the root agent delegates, its stream emits `subagent.called` with the child's `childSessionId`, then `subagent.completed` after admission with a working task receipt. Later task notifications wake the parent with completion, failure, or cancellation. Detailed child progress lives on the child session's stream instead of being flattened into the root `data.messages`. Use the lower-level [TypeScript client](../client/overview#sessions) to attach to that ID when your UI needs live subagent activity. See [What the parent sees](../../subagents#what-the-parent-sees) for the complete contract.
91
91
 
92
92
  ## Sending and streaming
93
93
 
@@ -48,13 +48,13 @@ Use the `setup` callback to register your OTel provider (for example `registerOT
48
48
 
49
49
  Any OTel-compatible backend works (Braintrust, PostHog, Sentry, Raindrop, Arize, Honeycomb, Datadog, Jaeger). Install the exporter package you need and configure it in the callback. The [PostHog AI Observability integration](/integrations/posthog-instrumentation) provides a ready-to-install exporter and optional user identification. The [Sentry integration](/integrations/sentry-instrumentation) provides a ready-to-install OTLP exporter that sends traces to Sentry without a Sentry SDK.
50
50
 
51
- Three more fields control what the AI SDK records inside those spans (see the AI SDK's [telemetry reference](https://ai-sdk.dev/docs/ai-sdk-core/telemetry)):
51
+ Three more fields control what eve and the AI SDK record inside those spans (see the AI SDK's [telemetry reference](https://ai-sdk.dev/docs/ai-sdk-core/telemetry)):
52
52
 
53
- - `recordInputs` records full message history on each step span. It defaults to `false`; set it to `true` to include input content.
54
- - `recordOutputs` records model outputs on spans. It defaults to `false`; set it to `true` to include output content.
53
+ - `recordInputs` records full message history on each step span and recalled records on memory spans. It defaults to `false`; set it to `true` to include input content.
54
+ - `recordOutputs` records model outputs. It defaults to `false`; set it to `true` to include output content.
55
55
  - `functionId` overrides the function name on spans (defaults to the agent name).
56
56
 
57
- eve records metadata without model or tool inputs and outputs by default. Enable either content category only after reviewing the exporter and its data-retention path.
57
+ eve records metadata without model, tool, or memory-record content by default. Enable either content category only after reviewing the exporter and its data-retention path.
58
58
 
59
59
  In the provider layout, eve stamps each span with `gen_ai.conversation.id`, which stays fixed across local and remote activations, including independent remote root workflows. Query this attribute to find the conversation's exported, retained traces; it does not grant access or control trace parenting. On Vercel, `vercel.session_id` additionally identifies the current Workflow run. See [Query exported traces](#query-exported-traces) for the cross-backend workflow.
60
60
 
@@ -103,19 +103,28 @@ not mark the active span as failed.
103
103
  The built-in OpenTelemetry provider preserves each span's OTel name and adds
104
104
  `operation.name` and `resource.name` for Datadog's operation/resource mapping:
105
105
 
106
- | OTel span name | `operation.name` | `resource.name` |
107
- | ----------------------------------------------------------------------- | ----------------- | ---------------------- |
108
- | `invoke_agent weather` | `invoke_agent` | `invoke_agent weather` |
109
- | `execute_tool search` | `execute_tool` | `execute_tool search` |
110
- | `chat <model>` | `chat` | `chat <model>` |
111
- | `agent.step`, `agent.action`, `agent.approval`, `agent.channel.request` | Same as span name | Same as span name |
106
+ | OTel span name | `operation.name` | `resource.name` |
107
+ | ----------------------------------------------------------------------- | ----------------- | ------------------------ |
108
+ | `invoke_agent weather` | `invoke_agent` | `invoke_agent weather` |
109
+ | `invoke_workflow deploy` | `invoke_workflow` | `invoke_workflow deploy` |
110
+ | `execute_tool search` | `execute_tool` | `execute_tool search` |
111
+ | `chat <model>` | `chat` | `chat <model>` |
112
+ | `search_memory`, `upsert_memory` | Same as span name | Same as span name |
113
+ | `agent.step`, `agent.action`, `agent.approval`, `agent.channel.request` | Same as span name | Same as span name |
112
114
 
113
- These attributes apply to eve-owned spans in local tracing and the
115
+ These rows apply to eve-owned spans in local tracing and the
114
116
  [instrumentation provider layout](./instrumentation-providers). They do not
115
117
  rename Workflow, AI SDK, or other third-party spans, or change trace IDs,
116
- parenting, sampling, or session grouping. Legacy `instrumentation.ts` setup
117
- still owns its exporter configuration and [authored trace
118
- hierarchy](#authored-trace-hierarchy).
118
+ parenting, or session grouping. Legacy `instrumentation.ts` setup still owns
119
+ its exporter configuration and [authored trace hierarchy](#authored-trace-hierarchy).
120
+
121
+ Workflow action spans enter the sampler as `agent.action`, with
122
+ `gen_ai.operation.name` and `gen_ai.workflow.name` already present. After
123
+ sampling, eve changes the exported span name to `invoke_workflow <tool>`.
124
+ Existing name-based samplers therefore keep their `agent.action` behavior;
125
+ attribute-based samplers can select GenAI workflow operations explicitly.
126
+ Review custom attribute rules when upgrading because the new workflow
127
+ attributes may change their decisions.
119
128
 
120
129
  In Datadog APM, `operation_name:invoke_agent resource_name:"invoke_agent weather"`
121
130
  selects named agent invocations. Operation-based dashboards and monitors may
@@ -137,25 +146,38 @@ that discard span events, including Sentry's [direct OTLP
137
146
  intake](https://docs.sentry.io/concepts/otlp/direct/traces/). These attributes
138
147
  remain available when model and tool content is redacted.
139
148
 
149
+ ## Memory spans
150
+
151
+ eve records [OpenTelemetry GenAI memory spans](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#memory) for provider calls. Recalls at `turn.started` and `compaction.completed` use `search_memory`; capture handlers use `upsert_memory`. They are client spans, following the GenAI memory convention for a call to a memory system.
152
+
153
+ Every memory span includes `gen_ai.operation.name` and `gen_ai.memory.store.id`. The store ID is eve's opaque `memory.scope.key`, which identifies the resolved scope without exposing the namespace or scope values. Recall spans set `gen_ai.memory.record.count` to their result count.
154
+
155
+ `gen_ai.memory.records` contains recalled record content only when `recordInputs` is enabled. eve classifies recalled records as input content because they become part of the model context. eve does not set `gen_ai.memory.query.text` because a memory provider receives structured conversation messages, not a standalone search-query string. The `agent.memory.slot` and `agent.memory.phase` attributes identify the eve slot and lifecycle boundary without adding either to the span name.
156
+
140
157
  ## Agent trace contract
141
158
 
142
159
  The provider layout and zero-config local tracing emit the following spans.
143
160
  The legacy `instrumentation.ts` layout still uses its authored OTel setup.
144
161
 
145
- | Span | Meaning |
146
- | ----------------------- | -------------------------------------------------------- |
147
- | `invoke_agent <agent>` | One agent activation in its own trace |
148
- | `agent.step` | One model attempt |
149
- | `chat <model>` | One model call beneath its step |
150
- | `agent.action` | Durable action lifecycle, including dispatch and waiting |
151
- | `execute_tool <tool>` | In-process tool execution beneath its action |
152
- | `agent.approval` | Approval waiting beneath its action |
153
- | `agent.channel.request` | Optional HTTP request span in the provider layout |
162
+ | Span | Meaning |
163
+ | ------------------------ | -------------------------------------------------------- |
164
+ | `invoke_agent <agent>` | One agent activation in its own trace |
165
+ | `agent.step` | One model attempt |
166
+ | `chat <model>` | One model call beneath its step |
167
+ | `invoke_workflow <tool>` | One workflow tool run that coordinated a nested agent |
168
+ | `agent.action` | Durable action lifecycle, including dispatch and waiting |
169
+ | `execute_tool <tool>` | In-process tool execution beneath its action |
170
+ | `agent.approval` | Approval waiting beneath its action |
171
+ | `search_memory` | Recall memory records before a turn or after compaction |
172
+ | `upsert_memory` | Automatic memory capture |
173
+ | `agent.channel.request` | Optional HTTP request span in the provider layout |
154
174
 
155
175
  For background tools and subagents, the AI SDK's `execute_tool` span ends when
156
176
  the model receives the task receipt. The enclosing `agent.action` span remains
157
- open until the background task completes, fails, or is cancelled. Its duration,
158
- outcome, and usage describe the background task rather than the receipt.
177
+ open until the background task completes, fails, or is cancelled. When a
178
+ workflow tool coordinates a nested `ctx.agent()` call, eve exports that span as
179
+ `invoke_workflow` instead. Its duration, outcome, and usage describe the
180
+ background task rather than the receipt.
159
181
  Background tool results follow the output-content policy. Recorded task failure
160
182
  details become bounded exception and status messages; redacted spans retain only
161
183
  the failure outcome, error status, and error type. The initiating turn can
@@ -163,10 +185,14 @@ finish or be cancelled while the action remains open. Ending the session closes
163
185
  an action whose task never reported a terminal result.
164
186
 
165
187
  Schema v4 removes the session-long `agent.session` root and duplicate agent session and lineage attributes. Every eve span carries `agent.trace.schema.version=4` and `gen_ai.conversation.id`; Vercel deployments additionally carry `vercel.session_id`.
166
- Only activations use the `invoke_agent` operation. Dispatch lifecycle spans use
167
- `agent.action` with `agent.invocation.role=caller`; the built-in `agent` tool
168
- executes under `execute_tool agent`. Turn IDs such as `turn_0` are local to a session,
169
- so correlate turns by session ID and turn ID together.
188
+ Only activations use the `invoke_agent` operation. A workflow tool invocation
189
+ that coordinates at least one nested agent uses `invoke_workflow`, with its
190
+ path-derived tool name in `gen_ai.workflow.name`. Durable workflow tools without
191
+ agent operations, including `sleep`, remain `agent.action` spans. Dispatch
192
+ lifecycle spans use `agent.action` with
193
+ `agent.invocation.role=caller`; the built-in `agent` tool executes under
194
+ `execute_tool agent`. Turn IDs such as `turn_0` are local to a session, so
195
+ correlate turns by session ID and turn ID together.
170
196
 
171
197
  A conversation remains durable state; `gen_ai.conversation.id` joins the activations that operate on it.
172
198
 
@@ -373,7 +399,7 @@ Without an `instrumentation.ts`, `eve dev` records spans to disk with one bounde
373
399
  - [`/traces`](dev-tui#logs-and-traces) in the dev TUI: a live trace viewer that replays captured content as a conversation.
374
400
  - [`eve traces`](../reference/cli#eve-traces): a span tree in the terminal, `eve traces ls` to list. Works after `eve dev` exits.
375
401
 
376
- Local traces omit model and tool inputs and outputs by default. Set `EVE_TRACES_CONTENT=on` in `.env.local` to capture that content.
402
+ Local traces omit model, tool, and memory-record content by default. Set `EVE_TRACES_CONTENT=on` in `.env.local` to capture that content.
377
403
 
378
404
  Writing `instrumentation.ts` replaces this: your `setup` takes over and nothing is recorded locally. For span attributes, retention, and the `EVE_TRACES*` variables, see [`eve traces`](../reference/cli#eve-traces).
379
405
 
@@ -310,13 +310,13 @@ Span rows carry inline metrics when the span recorded them — `↑input`/`↓ou
310
310
 
311
311
  Every subagent activation starts its own trace. The first child's `invoke_agent` root links to the dispatching caller with `eve.link.type=agent.dispatch`; remote agents carry that caller context over `traceparent`. Later turns also start fresh traces without repeating the initial caller link. All related sessions retain the same `gen_ai.conversation.id`, and `agent.subagent.name` labels the child invocation.
312
312
 
313
- Each `agent()` call inside an authored workflow has its own `agent.action` caller span, including sequential, parallel, and background calls. The workflow tool keeps its own `agent.action` and `execute_tool` spans. Only agent execution uses `invoke_agent`.
313
+ Each `agent()` call inside an authored workflow has its own `agent.action` caller span, including sequential, parallel, and background calls. A workflow tool that coordinates one of those calls has an enclosing `invoke_workflow <tool>` span; a workflow tool without agent calls remains `agent.action`. The tool also keeps its `execute_tool <tool>` span. Only agent execution uses `invoke_agent`.
314
314
 
315
315
  A durable conversation produces one bounded trace per turn. Worker replacements reuse the prepared context for the same turn, while a later turn or an independently replayed attempt starts a fresh trace. Passing the conversation ID shows every trace it produced, oldest first.
316
316
 
317
317
  Every span carries a real duration. A turn's root `invoke_agent` span is written when the turn settles, so a running turn shows only its steps.
318
318
 
319
- Model and `execute_tool` spans omit their inputs and outputs by default. Set `EVE_TRACES_CONTENT=on` to capture system prompts, prompt messages, and response text for models, plus call arguments and results for tools. Each captured value is capped at 32 KB.
319
+ Model, `execute_tool`, and memory spans omit their content by default. Set `EVE_TRACES_CONTENT=on` to capture system prompts, prompt messages, and response text for models; call arguments and results for tools; and recalled memory records. Each captured value is capped at 32 KB.
320
320
 
321
321
  Step spans carry token counts under `agent.usage.*`, and cost when Vercel AI Gateway served the call. Model spans also expose `gen_ai.usage.*` token counters. The CLI sums step-level counters only, so model and delegated-call totals are not counted twice.
322
322
 
@@ -324,13 +324,13 @@ Step spans carry token counts under `agent.usage.*`, and cost when Vercel AI Gat
324
324
 
325
325
  eve sweeps the store when an activation's writes finish, when a session finishes, and when the dev server starts. An open conversation does not pin every completed turn's trace. Sweeps evict oldest-first past the bounds below, except that active traces, the newest traces, and anything written in the last five minutes are kept. A sweep can therefore exceed the size budget. Set the bounds in `.env.local`, which `eve dev` loads automatically; each accepts `off` to disable it individually.
326
326
 
327
- | Variable | Default | Effect |
328
- | ---------------------------- | -------------------- | ----------------------------------------------------------------------------------- |
329
- | `EVE_TRACES` | on | `off` stops writing traces and stops sweeping |
330
- | `EVE_TRACES_CONTENT` | off | `on` captures model prompt/response and tool input/output attributes on local spans |
331
- | `EVE_TRACES_MAX_AGE_MS` | `604800000` (7d) | Age after which a trace may be evicted |
332
- | `EVE_TRACES_MAX_TOTAL_BYTES` | `536870912` (512 MB) | Size budget for the whole store |
333
- | `EVE_TRACES_RETAIN_COUNT` | `20` | Newest traces kept regardless of age or size |
327
+ | Variable | Default | Effect |
328
+ | ---------------------------- | -------------------- | --------------------------------------------------------------------------------------------------- |
329
+ | `EVE_TRACES` | on | `off` stops writing traces and stops sweeping |
330
+ | `EVE_TRACES_CONTENT` | off | `on` captures model prompt/response, tool input/output, and memory-record attributes on local spans |
331
+ | `EVE_TRACES_MAX_AGE_MS` | `604800000` (7d) | Age after which a trace may be evicted |
332
+ | `EVE_TRACES_MAX_TOTAL_BYTES` | `536870912` (512 MB) | Size budget for the whole store |
333
+ | `EVE_TRACES_RETAIN_COUNT` | `20` | Newest traces kept regardless of age or size |
334
334
 
335
335
  ## `eve link`
336
336
 
@@ -7,13 +7,18 @@ eve supports two ways to delegate work: the root-only built-in `agent` tool, whi
7
7
 
8
8
  ## Completion batching
9
9
 
10
- eve automatically combines adjacent successful completions already queued from
11
- tasks launched in the same parent turn. Every result is retained, and the parent
12
- responds to the batch in one turn. No configuration is required.
13
-
14
- There is no debounce timer or waiting for unfinished tasks. Failures, input
15
- requests, explicit updates, user messages, and different task cohorts remain
16
- separate delivery boundaries.
10
+ Overlapping background work owned by a session forms a cohort. Tasks launched in
11
+ later user turns join the open cohort while earlier work is still pending or its
12
+ successful results await delivery. eve holds successful completion notifications
13
+ until every task in that cohort has completed, failed, or been cancelled, then
14
+ delivers the successful results together in one parent turn. Partial completions
15
+ do not invoke the parent model. Work started after the cohort settles forms a new
16
+ cohort. No configuration or debounce timer is required.
17
+
18
+ User messages, input requests, authorization events, failures, and cancellation
19
+ are handled without waiting for the cohort. Child lifecycle events are processed
20
+ before completion delivery so usage accounting and handle cleanup stay ordered.
21
+ To follow work in progress, subscribe to the child session streams.
17
22
 
18
23
  ## The built-in `agent` tool
19
24
 
@@ -27,7 +32,7 @@ The root session receives `agent` by default. The model calls it to delegate a t
27
32
  }
28
33
  ```
29
34
 
30
- The copy uses the root's instructions, connections, auth, and sandbox. It receives the same tools except for the root-only `agent` and `Workflow`, and starts with fresh conversation history and fresh state. Its file writes are immediately visible to the root. The built-in `agent` always runs in the background and needs no configuration: each call returns `{ status: "working", taskId, agentId }`, then task notifications wake the parent with updates or the final result. Give parallel children non-overlapping write scopes.
35
+ The copy uses the root's instructions, connections, auth, and sandbox. It receives the same tools except for the root-only `agent` and `Workflow`, and starts with fresh conversation history and fresh state. Its file writes are immediately visible to the root. The built-in `agent` always runs in the background and needs no configuration: each call returns `{ status: "working", taskId, agentId }`, then task notifications wake the parent with completion, failure, or cancellation. Give parallel children non-overlapping write scopes.
31
36
 
32
37
  `agent` is intentionally root-only. Copies created by it cannot call `agent`, and declared subagents never receive the built-in tool. If a stale or forced recursive call reaches execution, eve rejects it instead of starting another child session.
33
38
 
@@ -56,9 +61,9 @@ export default defineAgent({
56
61
  });
57
62
  ```
58
63
 
59
- `description` is required. The parent reads it to decide whether to delegate, so the compiler rejects any subagent whose `agent.ts` leaves it out. Every declared local or remote subagent runs as a durable background task: the call returns `{ status: "working", taskId, agentId }` immediately, then task notifications wake the parent with updates, completion, failure, or cancellation. Human input requests surface separately on the parent session.
64
+ `description` is required. The parent reads it to decide whether to delegate, so the compiler rejects any subagent whose `agent.ts` leaves it out. Every declared local or remote subagent runs as a durable background task: the call returns `{ status: "working", taskId, agentId }` immediately, then task notifications wake the parent with completion, failure, or cancellation. Human input requests surface separately on the parent session.
60
65
 
61
- A child running as a background task receives the framework `task_update` tool. It uses `task_update` to report progress to its parent. `task_cancel` is available to sessions that own background tasks, including a child that starts nested background work.
66
+ `task_cancel` is available to sessions that own background tasks, including a child that starts nested background work.
62
67
 
63
68
  A mounted extension can also contribute declared subagents from `extension/subagents/`. The mount namespace prefixes the subagent visible to the consuming agent node: mounting an extension as `crm` exposes its `reviewer` subagent as `crm__reviewer`. The contributed subagent keeps its own isolated tools, connections, skills, hooks, instructions, sandbox, and nested subagents, and its modules can read configuration from the extension handle. See [Extensions](./extensions#add-a-subagent) for the authoring and override behavior.
64
69
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eve",
3
- "version": "0.54.0",
3
+ "version": "0.54.2",
4
4
  "private": false,
5
5
  "description": "Filesystem-first framework for durable backend AI agents that run anywhere.",
6
6
  "keywords": [
@@ -186,11 +186,6 @@
186
186
  "import": "./dist/src/public/tools/task-cancel.js",
187
187
  "default": "./dist/src/public/tools/task-cancel.js"
188
188
  },
189
- "./tools/task_update": {
190
- "types": "./dist/src/public/tools/task-update.d.ts",
191
- "import": "./dist/src/public/tools/task-update.js",
192
- "default": "./dist/src/public/tools/task-update.js"
193
- },
194
189
  "./tools/glob": {
195
190
  "types": "./dist/src/public/tools/glob.d.ts",
196
191
  "import": "./dist/src/public/tools/glob.js",
@@ -1,6 +0,0 @@
1
- import type { TaskInboundUpdate } from "#tasks/types.js";
2
- /** Forwards a local task-owned child's progress update to its active parent hook. */
3
- export declare function forwardLocalTaskUpdateStep(input: {
4
- readonly parentContinuationToken: string;
5
- readonly update: TaskInboundUpdate;
6
- }): Promise<void>;
@@ -1 +0,0 @@
1
- import{resumeHook}from"#internal/workflow/runtime.js";async function forwardLocalTaskUpdateStep(e){"use step";await resumeHook(e.parentContinuationToken,e.update)}export{forwardLocalTaskUpdateStep};
@@ -1,8 +0,0 @@
1
- import type { ChannelAdapter } from "#channel/adapter.js";
2
- import type { TaskInboundUpdate } from "#tasks/types.js";
3
- /** Delivers a task update through the local child adapter or remote callback. */
4
- export declare function deliverTaskUpdate(input: {
5
- readonly adapter?: ChannelAdapter;
6
- readonly callback: unknown;
7
- readonly update: TaskInboundUpdate;
8
- }): Promise<string | undefined>;
@@ -1 +0,0 @@
1
- import{fireTaskUpdateCallbackStep}from"#subagents/callback-step.js";import{forwardLocalTaskUpdateStep}from"#execution/tasks/child/update-step.js";import{SUBAGENT_ADAPTER_KIND,isSubagentAdapterState}from"#subagents/adapter-state.js";async function deliverTaskUpdate(e){let t=e.adapter?.state;return e.adapter?.kind===SUBAGENT_ADAPTER_KIND&&isSubagentAdapterState(t)&&t.taskId!==void 0?(await forwardLocalTaskUpdateStep({parentContinuationToken:t.parentContinuationToken,update:e.update}),t.taskId):await fireTaskUpdateCallbackStep({callback:e.callback,callId:e.update.callId,message:e.update.message,updateEpoch:e.update.updateEpoch,updateIndex:e.update.updateIndex})}export{deliverTaskUpdate};
@@ -1 +0,0 @@
1
- export { taskUpdate, taskUpdate as default } from "#tools/framework/task-update.js";
@@ -1 +0,0 @@
1
- import{taskUpdate,taskUpdate as task_update_default}from"#tools/framework/task-update.js";export{task_update_default as default,taskUpdate};
@@ -1,5 +0,0 @@
1
- export declare const TASK_UPDATE_SESSION_INSTRUCTION = "Background task updates\nYou are running as a background task. For multi-step work, use `task_update` at meaningful milestones to briefly state what you are currently doing. Keep updates terse and activity-focused; do not include preliminary findings or results. Do not wait for a response, and return your final result normally.";
2
- export declare const taskUpdate: import("#tools/native-definition.js").NativeToolDefinition<{
3
- message: string;
4
- }, unknown>;
5
- export default taskUpdate;
@@ -1 +0,0 @@
1
- import{TASK_UPDATE_INPUT_SCHEMA}from"#tools/framework/task-contract.js";import{defineNativeTool}from"#tools/native-definition.js";const TASK_UPDATE_SESSION_INSTRUCTION="Background task updates\nYou are running as a background task. For multi-step work, use `task_update` at meaningful milestones to briefly state what you are currently doing. Keep updates terse and activity-focused; do not include preliminary findings or results. Do not wait for a response, and return your final result normally.",taskUpdate=defineNativeTool({description:`Briefly tell the parent agent what this background task is currently doing. Report activity, not preliminary findings or results.`,inputSchema:TASK_UPDATE_INPUT_SCHEMA},{availability:[`delegated-task-child`],handling:{action:`task-update`,kind:`dispatch`}});export{TASK_UPDATE_SESSION_INSTRUCTION,taskUpdate as default,taskUpdate};