// AUTO-GENERATED FILE. DO NOT EDIT.
//
// Source: copilot/copilot/contracts/trace-spans-v1.schema.json
// Regenerate with: bun run trace-spans-contract:generate
//
// Canonical mothership OTel span names. Call sites should reference
// `TraceSpan.<Identifier>` (e.g. `TraceSpan.CopilotVfsReadFile`)
// rather than raw string literals, so the Go-side contract is the
// single source of truth and typos become compile errors.

export const TraceSpan = {
  AnthropicCountTokens: 'anthropic.count_tokens',
  AsyncToolStoreSet: 'async_tool_store.set',
  AuthRateLimitRecord: 'auth.rate_limit.record',
  AuthValidateKey: 'auth.validate_key',
  ChatContinueWithToolResults: 'chat.continue_with_tool_results',
  ChatExplicitAbortConsume: 'chat.explicit_abort.consume',
  ChatExplicitAbortFlushPausedBilling: 'chat.explicit_abort.flush_paused_billing',
  ChatExplicitAbortHandle: 'chat.explicit_abort.handle',
  ChatExplicitAbortMark: 'chat.explicit_abort.mark',
  ChatExplicitAbortPeek: 'chat.explicit_abort.peek',
  ChatGateAcquire: 'chat.gate.acquire',
  ChatPersistAfterDone: 'chat.persist_after_done',
  ChatSetup: 'chat.setup',
  ContextReduce: 'context.reduce',
  ContextSummarizeChunk: 'context.summarize_chunk',
  CopilotAnalyticsFlush: 'copilot.analytics.flush',
  CopilotAnalyticsSaveRequest: 'copilot.analytics.save_request',
  CopilotAnalyticsUpdateBilling: 'copilot.analytics.update_billing',
  CopilotAsyncRunsClaimCompleted: 'copilot.async_runs.claim_completed',
  CopilotAsyncRunsCreateRunCheckpoint: 'copilot.async_runs.create_run_checkpoint',
  CopilotAsyncRunsCreateRunSegment: 'copilot.async_runs.create_run_segment',
  CopilotAsyncRunsGetAsyncToolCall: 'copilot.async_runs.get_async_tool_call',
  CopilotAsyncRunsGetLatestForExecution: 'copilot.async_runs.get_latest_for_execution',
  CopilotAsyncRunsGetLatestForStream: 'copilot.async_runs.get_latest_for_stream',
  CopilotAsyncRunsGetMany: 'copilot.async_runs.get_many',
  CopilotAsyncRunsGetRunSegment: 'copilot.async_runs.get_run_segment',
  CopilotAsyncRunsListForRun: 'copilot.async_runs.list_for_run',
  CopilotAsyncRunsMarkAsyncToolStatus: 'copilot.async_runs.mark_async_tool_status',
  CopilotAsyncRunsReleaseClaim: 'copilot.async_runs.release_claim',
  CopilotAsyncRunsUpdateRunStatus: 'copilot.async_runs.update_run_status',
  CopilotAsyncRunsUpsertAsyncToolCall: 'copilot.async_runs.upsert_async_tool_call',
  CopilotAuthValidateApiKey: 'copilot.auth.validate_api_key',
  CopilotBillingUpdateCost: 'copilot.billing.update_cost',
  CopilotChatAbortActiveStream: 'copilot.chat.abort_active_stream',
  CopilotChatAbortStream: 'copilot.chat.abort_stream',
  CopilotChatAbortWaitSettle: 'copilot.chat.abort_wait_settle',
  CopilotChatAcquirePendingStreamLock: 'copilot.chat.acquire_pending_stream_lock',
  CopilotChatBuildExecutionContext: 'copilot.chat.build_execution_context',
  CopilotChatBuildPayload: 'copilot.chat.build_payload',
  CopilotChatBuildWorkspaceContext: 'copilot.chat.build_workspace_context',
  CopilotChatFinalizeAssistantTurn: 'copilot.chat.finalize_assistant_turn',
  CopilotChatPersistUserMessage: 'copilot.chat.persist_user_message',
  CopilotChatResolveAgentContexts: 'copilot.chat.resolve_agent_contexts',
  CopilotChatResolveBranch: 'copilot.chat.resolve_branch',
  CopilotChatResolveOrCreateChat: 'copilot.chat.resolve_or_create_chat',
  CopilotChatStopStream: 'copilot.chat.stop_stream',
  CopilotConfirmToolResult: 'copilot.confirm.tool_result',
  CopilotFinalizeStream: 'copilot.finalize_stream',
  CopilotRecoveryCheckReplayGap: 'copilot.recovery.check_replay_gap',
  CopilotResumeRequest: 'copilot.resume.request',
  CopilotSseReadLoop: 'copilot.sse.read_loop',
  CopilotSubagentExecute: 'copilot.subagent.execute',
  CopilotToolWaitForClientResult: 'copilot.tool.wait_for_client_result',
  CopilotToolsHandleResourceSideEffects: 'copilot.tools.handle_resource_side_effects',
  CopilotToolsWriteCsvToTable: 'copilot.tools.write_csv_to_table',
  CopilotToolsWriteOutputFile: 'copilot.tools.write_output_file',
  CopilotToolsWriteOutputTable: 'copilot.tools.write_output_table',
  CopilotVfsMaterialize: 'copilot.vfs.materialize',
  CopilotVfsPrepareImage: 'copilot.vfs.prepare_image',
  CopilotVfsReadFile: 'copilot.vfs.read_file',
  GenAiAgentExecute: 'gen_ai.agent.execute',
  LlmStream: 'llm.stream',
  ProviderRouterCountTokens: 'provider.router.count_tokens',
  ProviderRouterRoute: 'provider.router.route',
  SimUpdateCost: 'sim.update_cost',
  SimValidateApiKey: 'sim.validate_api_key',
  ToolAsyncWaiterWait: 'tool.async_waiter.wait',
  ToolExecute: 'tool.execute',
} as const

export type TraceSpanKey = keyof typeof TraceSpan
export type TraceSpanValue = (typeof TraceSpan)[TraceSpanKey]

/** Readonly sorted list of every canonical span name. */
export const TraceSpanValues: readonly TraceSpanValue[] = [
  'anthropic.count_tokens',
  'async_tool_store.set',
  'auth.rate_limit.record',
  'auth.validate_key',
  'chat.continue_with_tool_results',
  'chat.explicit_abort.consume',
  'chat.explicit_abort.flush_paused_billing',
  'chat.explicit_abort.handle',
  'chat.explicit_abort.mark',
  'chat.explicit_abort.peek',
  'chat.gate.acquire',
  'chat.persist_after_done',
  'chat.setup',
  'context.reduce',
  'context.summarize_chunk',
  'copilot.analytics.flush',
  'copilot.analytics.save_request',
  'copilot.analytics.update_billing',
  'copilot.async_runs.claim_completed',
  'copilot.async_runs.create_run_checkpoint',
  'copilot.async_runs.create_run_segment',
  'copilot.async_runs.get_async_tool_call',
  'copilot.async_runs.get_latest_for_execution',
  'copilot.async_runs.get_latest_for_stream',
  'copilot.async_runs.get_many',
  'copilot.async_runs.get_run_segment',
  'copilot.async_runs.list_for_run',
  'copilot.async_runs.mark_async_tool_status',
  'copilot.async_runs.release_claim',
  'copilot.async_runs.update_run_status',
  'copilot.async_runs.upsert_async_tool_call',
  'copilot.auth.validate_api_key',
  'copilot.billing.update_cost',
  'copilot.chat.abort_active_stream',
  'copilot.chat.abort_stream',
  'copilot.chat.abort_wait_settle',
  'copilot.chat.acquire_pending_stream_lock',
  'copilot.chat.build_execution_context',
  'copilot.chat.build_payload',
  'copilot.chat.build_workspace_context',
  'copilot.chat.finalize_assistant_turn',
  'copilot.chat.persist_user_message',
  'copilot.chat.resolve_agent_contexts',
  'copilot.chat.resolve_branch',
  'copilot.chat.resolve_or_create_chat',
  'copilot.chat.stop_stream',
  'copilot.confirm.tool_result',
  'copilot.finalize_stream',
  'copilot.recovery.check_replay_gap',
  'copilot.resume.request',
  'copilot.sse.read_loop',
  'copilot.subagent.execute',
  'copilot.tool.wait_for_client_result',
  'copilot.tools.handle_resource_side_effects',
  'copilot.tools.write_csv_to_table',
  'copilot.tools.write_output_file',
  'copilot.tools.write_output_table',
  'copilot.vfs.materialize',
  'copilot.vfs.prepare_image',
  'copilot.vfs.read_file',
  'gen_ai.agent.execute',
  'llm.stream',
  'provider.router.count_tokens',
  'provider.router.route',
  'sim.update_cost',
  'sim.validate_api_key',
  'tool.async_waiter.wait',
  'tool.execute',
] as const
