//#region src/constants/otel-attributes.ts
const DELEGATION_FROM_SUB_AGENT_ID = "delegation.from_sub_agent_id";
const DELEGATION_TO_SUB_AGENT_ID = "delegation.to_sub_agent_id";
const DELEGATION_ID = "delegation.id";
const TRANSFER_FROM_SUB_AGENT_ID = "transfer.from_sub_agent_id";
const TRANSFER_TO_SUB_AGENT_ID = "transfer.to_sub_agent_id";
const SPAN_NAMES = {
	AI_TOOL_CALL: "ai.toolCall",
	CONTEXT_RESOLUTION: "context-resolver.resolve_single_fetch_definition",
	CONTEXT_HANDLE: "context.handle_context_resolution",
	AGENT_GENERATION: "agent.generate",
	CONTEXT_FETCHER: "context-fetcher.http-request",
	ARTIFACT_PROCESSING: "agent_session.process_artifact",
	TOOL_APPROVAL_REQUESTED: "tool.approval_requested",
	TOOL_APPROVAL_APPROVED: "tool.approval_approved",
	TOOL_APPROVAL_DENIED: "tool.approval_denied",
	COMPRESSOR_SAFE_COMPRESS: "compressor.safe_compress",
	AGENT_MAX_STEPS_REACHED: "agent.max_steps_reached",
	STREAM_FORCE_CLEANUP: "stream.force_cleanup",
	DURABLE_TOOL_EXECUTION: "durable.tool_execution",
	EXECUTION_HANDLER_EXECUTE: "execution_handler.execute"
};
const AI_OPERATIONS = {
	GENERATE_TEXT: "ai.generateText.doGenerate",
	STREAM_TEXT: "ai.streamText.doStream"
};
/** OpenTelemetry span attribute keys used for tracing */
const SPAN_KEYS = {
	SPAN_ID: "spanID",
	TRACE_ID: "traceID",
	DURATION_NANO: "durationNano",
	TIMESTAMP: "timestamp",
	HAS_ERROR: "hasError",
	STATUS_MESSAGE: "status_message",
	OTEL_STATUS_CODE: "otel.status_code",
	OTEL_STATUS_DESCRIPTION: "otel.status_description",
	AGENT_ID: "agent.id",
	AGENT_NAME: "agent.name",
	TENANT_ID: "tenant.id",
	PROJECT_ID: "project.id",
	SUB_AGENT_NAME: "subAgent.name",
	SUB_AGENT_ID: "subAgent.id",
	AI_OPERATION_ID: "ai.operationId",
	AI_RESPONSE_TIMESTAMP: "ai.response.timestamp",
	AI_RESPONSE_CONTENT: "ai.response.content",
	AI_RESPONSE_TEXT: "ai.response.text",
	AI_RESPONSE_OBJECT: "ai.response.object",
	AI_RESPONSE_MODEL: "ai.response.model",
	AI_RESPONSE_TOOL_CALLS: "ai.response.toolCalls",
	AI_PROMPT_MESSAGES: "ai.prompt.messages",
	AI_MODEL_PROVIDER: "ai.model.provider",
	AI_TELEMETRY_FUNCTION_ID: "ai.telemetry.functionId",
	AI_TELEMETRY_SUB_AGENT_ID: "ai.telemetry.metadata.subAgentId",
	AI_TELEMETRY_SUB_AGENT_NAME: "ai.telemetry.metadata.subAgentName",
	AI_TELEMETRY_METADATA_PHASE: "ai.telemetry.metadata.phase",
	AI_TELEMETRY_GENERATION_TYPE: "ai.telemetry.metadata.generationType",
	AI_TELEMETRY_TENANT_ID: "ai.telemetry.metadata.tenantId",
	AI_TELEMETRY_PROJECT_ID: "ai.telemetry.metadata.projectId",
	AI_TELEMETRY_AGENT_ID: "ai.telemetry.metadata.agentId",
	AI_TELEMETRY_CONVERSATION_ID: "ai.telemetry.metadata.conversationId",
	AI_TELEMETRY_SESSION_ID: "ai.telemetry.metadata.sessionId",
	AI_MODEL_ID: "ai.model.id",
	AI_RESPONSE_FINISH_REASON: "ai.response.finishReason",
	AI_USAGE_PROMPT_TOKENS: "ai.usage.promptTokens",
	AI_USAGE_COMPLETION_TOKENS: "ai.usage.completionTokens",
	AI_TOOL_CALL_NAME: "ai.toolCall.name",
	AI_TOOL_CALL_RESULT: "ai.toolCall.result",
	AI_TOOL_CALL_ARGS: "ai.toolCall.args",
	AI_TOOL_CALL_ID: "ai.toolCall.id",
	AI_TOOL_TYPE: "ai.toolType",
	AI_TOOL_CALL_MCP_SERVER_ID: "ai.toolCall.mcpServerId",
	AI_TOOL_CALL_MCP_SERVER_NAME: "ai.toolCall.mcpServerName",
	TOOL_PURPOSE: "tool.purpose",
	TOOL_NAME: "tool.name",
	TOOL_CALL_ID: "tool.callId",
	TOOL_APPROVAL_REASON: "tool.approval.reason",
	TOOL_RESPONSE_CONTENT: "tool.response.content",
	TOOL_RESPONSE_TIMESTAMP: "tool.response.timestamp",
	GEN_AI_USAGE_INPUT_TOKENS: "gen_ai.usage.input_tokens",
	GEN_AI_USAGE_OUTPUT_TOKENS: "gen_ai.usage.output_tokens",
	GEN_AI_COST_ESTIMATED_USD: "gen_ai.cost.estimated_usd",
	GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS: "gen_ai.usage.cache_read.input_tokens",
	GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS: "gen_ai.usage.cache_creation.input_tokens",
	CACHE_INTENT_MARKER_COUNT: "cache.intent.marker_count",
	CACHE_INTENT_PREFIX_SIGNATURE: "cache.intent.prefix_signature",
	CACHE_INTENT_HISTORY_MARKER_COUNT: "cache.intent.history_marker_count",
	GEN_AI_REQUEST_PROVIDER: "gen_ai.request.provider",
	GEN_AI_RESPONSE_PROVIDER: "gen_ai.response.provider",
	CONTEXT_URL: "context.url",
	CONTEXT_CONFIG_ID: "context.context_config_id",
	CONTEXT_AGENT_ID: "context.agent_id",
	CONTEXT_HEADERS_KEYS: "context.headers_keys",
	MESSAGE_ID: "message.id",
	MESSAGE_CONTENT: "message.content",
	MESSAGE_PARTS: "message.parts",
	MESSAGE_TIMESTAMP: "message.timestamp",
	MCP_TOOL_DESCRIPTION: "mcp.tool.description",
	DELEGATION_FROM_SUB_AGENT_ID,
	DELEGATION_TO_SUB_AGENT_ID,
	DELEGATION_ID,
	DELEGATION_TYPE: "delegation.type",
	TRANSFER_FROM_SUB_AGENT_ID,
	TRANSFER_TO_SUB_AGENT_ID,
	HTTP_URL: "http.url",
	HTTP_STATUS_CODE: "http.status_code",
	HTTP_RESPONSE_BODY_SIZE: "http.response.body_size",
	NAME: "name",
	PARENT_SPAN_ID: "parentSpanID",
	PARENT_SPAN_ID_V5: "parent_span_id",
	CONVERSATION_ID: "conversation.id",
	INVOCATION_TYPE: "invocation.type",
	INVOCATION_ENTRY_POINT: "invocation.entryPoint",
	TRIGGER_ID: "trigger.id",
	TRIGGER_INVOCATION_ID: "trigger.invocation.id",
	TRIGGER_RUN_AS_USER_ID: "trigger.run_as_user_id",
	TRIGGER_BATCH_ID: "trigger.batch_id",
	ARTIFACT_ID: "artifact.id",
	ARTIFACT_TYPE: "artifact.type",
	ARTIFACT_TOOL_CALL_ID: "artifact.tool_call_id",
	ARTIFACT_DATA: "artifact.data",
	ARTIFACT_NAME: "artifact.name",
	ARTIFACT_DESCRIPTION: "artifact.description",
	ARTIFACT_IS_OVERSIZED: "artifact.is_oversized",
	ARTIFACT_RETRIEVAL_BLOCKED: "artifact.retrieval_blocked",
	ARTIFACT_ORIGINAL_TOKEN_SIZE: "artifact.original_token_size",
	ARTIFACT_CONTEXT_WINDOW_SIZE: "artifact.context_window_size",
	CONTEXT_BREAKDOWN_SYSTEM_TEMPLATE: "context.breakdown.system_template_tokens",
	CONTEXT_BREAKDOWN_CORE_INSTRUCTIONS: "context.breakdown.core_instructions_tokens",
	CONTEXT_BREAKDOWN_AGENT_PROMPT: "context.breakdown.agent_prompt_tokens",
	CONTEXT_BREAKDOWN_TOOLS: "context.breakdown.tools_tokens",
	CONTEXT_BREAKDOWN_ARTIFACTS: "context.breakdown.artifacts_tokens",
	CONTEXT_BREAKDOWN_DATA_COMPONENTS: "context.breakdown.data_components_tokens",
	CONTEXT_BREAKDOWN_ARTIFACT_COMPONENTS: "context.breakdown.artifact_components_tokens",
	CONTEXT_BREAKDOWN_TRANSFER_INSTRUCTIONS: "context.breakdown.transfer_instructions_tokens",
	CONTEXT_BREAKDOWN_DELEGATION_INSTRUCTIONS: "context.breakdown.delegation_instructions_tokens",
	CONTEXT_BREAKDOWN_THINKING_PREPARATION: "context.breakdown.thinking_preparation_tokens",
	CONTEXT_BREAKDOWN_CONVERSATION_HISTORY: "context.breakdown.conversation_history_tokens",
	CONTEXT_BREAKDOWN_TOTAL: "context.breakdown.total_tokens",
	CONTEXT_BREAKDOWN_ACTUAL_INPUT_TOKENS: "context.breakdown.actual_input_tokens",
	COMPRESSION_TYPE: "compression.type",
	COMPRESSION_SESSION_ID: "compression.session_id",
	COMPRESSION_MESSAGE_COUNT: "compression.message_count",
	COMPRESSION_BASE_CONTEXT_TOKENS: "compression.base_context_tokens",
	COMPRESSION_GENERATED_TOKENS: "compression.generated_tokens",
	COMPRESSION_TOTAL_CONTEXT_TOKENS: "compression.total_context_tokens",
	COMPRESSION_HARD_LIMIT: "compression.hard_limit",
	COMPRESSION_TRIGGER_AT: "compression.trigger_at",
	COMPRESSION_SAFETY_BUFFER: "compression.safety_buffer",
	COMPRESSION_OVERAGE: "compression.overage",
	COMPRESSION_SUCCESS: "compression.success",
	COMPRESSION_ERROR: "compression.error",
	COMPRESSION_RESULT_ARTIFACT_COUNT: "compression.result.artifact_count",
	COMPRESSION_RESULT_ARTIFACT_IDS: "compression.result.artifact_ids",
	COMPRESSION_RESULT_OUTPUT_TOKENS: "compression.result.output_tokens",
	COMPRESSION_RESULT_COMPRESSION_RATIO: "compression.result.compression_ratio",
	COMPRESSION_RESULT_HIGH_LEVEL: "compression.result.high_level",
	COMPRESSION_RESULT_USER_INTENT: "compression.result.user_intent",
	COMPRESSION_RESULT_DECISIONS_COUNT: "compression.result.decisions_count",
	COMPRESSION_RESULT_NEXT_STEPS_FOR_AGENT_COUNT: "compression.result.next_steps_for_agent_count",
	COMPRESSION_RESULT_OPEN_QUESTIONS_COUNT: "compression.result.open_questions_count",
	COMPRESSION_RESULT_RELATED_ARTIFACT_COUNT: "compression.result.related_artifact_count",
	AGENT_MAX_STEPS_REACHED: "agent.max_steps_reached",
	AGENT_STEPS_COMPLETED: "agent.steps_completed",
	AGENT_MAX_STEPS: "agent.max_steps",
	GENERATION_TIMEOUT_MS: "generation.timeout_ms",
	STREAM_CLEANUP_REASON: "stream.cleanup.reason",
	STREAM_MAX_LIFETIME_MS: "stream.max_lifetime_ms",
	STREAM_BUFFER_SIZE_BYTES: "stream.buffer_size_bytes",
	STREAM_SENT_ITEMS_COUNT: "stream.sent_items_count",
	STREAM_COMPLETED_ITEMS_COUNT: "stream.completed_items_count",
	TTFT_MODEL_TOKEN: "inkeep.agent.time_to_first_model_token",
	TTFT_VISIBLE_TOKEN: "inkeep.agent.time_to_first_visible_token",
	TTFT_VISIBLE_PART: "inkeep.agent.time_to_first_visible_part"
};
const UNKNOWN_VALUE = "unknown";
/** Activity Types */
const ACTIVITY_TYPES = {
	TOOL_CALL: "tool_call",
	AI_GENERATION: "ai_generation",
	AGENT_GENERATION: "agent_generation",
	CONTEXT_FETCH: "context_fetch",
	CONTEXT_RESOLUTION: "context_resolution",
	USER_MESSAGE: "user_message",
	AI_ASSISTANT_MESSAGE: "ai_assistant_message",
	AI_MODEL_STREAMED_TEXT: "ai_model_streamed_text",
	TOOL_APPROVAL_REQUESTED: "tool_approval_requested",
	TOOL_APPROVAL_APPROVED: "tool_approval_approved",
	TOOL_APPROVAL_DENIED: "tool_approval_denied",
	COMPRESSION: "compression",
	MAX_STEPS_REACHED: "max_steps_reached",
	STREAM_LIFETIME_EXCEEDED: "stream_lifetime_exceeded",
	DURABLE_TOOL_EXECUTION: "durable_tool_execution"
};
/** Activity Status Values */
const ACTIVITY_STATUS = {
	SUCCESS: "success",
	ERROR: "error",
	PENDING: "pending",
	WARNING: "warning"
};
/** Generation type constants for usage tracking telemetry */
const GENERATION_TYPES = {
	SUB_AGENT_GENERATION: "sub_agent_generation",
	CONVERSATION_COMPRESSION: "conversation_compression",
	MID_GENERATION_COMPRESSION: "mid_generation_compression",
	ARTIFACT_METADATA: "artifact_metadata",
	STATUS_UPDATE: "status_update",
	EVAL_SCORING: "eval_scoring",
	COMPONENT_RENDER: "component_render"
};
/** Valid generation types for usage tracking */
const USAGE_GENERATION_TYPES = Object.values(GENERATION_TYPES);
const EVAL_GENERATION_TYPES = [GENERATION_TYPES.EVAL_SCORING];
const EVAL_GENERATION_TYPE_SET = new Set(EVAL_GENERATION_TYPES);
const isEvalGenerationType = (generationType) => EVAL_GENERATION_TYPE_SET.has(generationType);
const NON_EVAL_USAGE_GENERATION_TYPES = USAGE_GENERATION_TYPES.filter((generationType) => !isEvalGenerationType(generationType));
/** Agent IDs */
const AGENT_IDS = {
	USER: "user",
	AI_ASSISTANT: "ai-assistant"
};
/** Activity Names */
const ACTIVITY_NAMES = {
	CONTEXT_FETCH: "Context Fetch",
	USER_MESSAGE: "User Message",
	AI_ASSISTANT_MESSAGE: "AI Assistant Message",
	AI_TEXT_GENERATION: "AI Text Generation",
	AI_STREAMING_TEXT: "AI Streaming Text",
	UNKNOWN_AGENT: "Unknown Agent",
	USER: "User"
};
/** AI Tool Types */
const AI_TOOL_TYPES = {
	MCP: "mcp",
	TRANSFER: "transfer",
	DELEGATION: "delegation"
};

//#endregion
export { ACTIVITY_NAMES, ACTIVITY_STATUS, ACTIVITY_TYPES, AGENT_IDS, AI_OPERATIONS, AI_TOOL_TYPES, DELEGATION_FROM_SUB_AGENT_ID, DELEGATION_ID, DELEGATION_TO_SUB_AGENT_ID, EVAL_GENERATION_TYPES, GENERATION_TYPES, NON_EVAL_USAGE_GENERATION_TYPES, SPAN_KEYS, SPAN_NAMES, TRANSFER_FROM_SUB_AGENT_ID, TRANSFER_TO_SUB_AGENT_ID, UNKNOWN_VALUE, USAGE_GENERATION_TYPES, isEvalGenerationType };