/** * OTel attribute keys used by the SDK 2.0 observability layer. * * Mirrors QAR's `src/qar/observability/attributes.py` discipline: every attribute * string lives here, never inline. Per-attribute notes record the rationale so * future implementers don't accidentally re-add keys that were * intentionally skipped on the SDK side. * * Span emission lives in `src/observability/spans.ts` (per-public-API, * client-side) and `src/tracing/SdkTracer.ts` (observer-side). Attribute * strings are read from this module exclusively — grep for `qar.` / * `gen_ai.` outside this file fails the audit test. */ export declare const SERVICE_NAME: "service.name"; export declare const SERVICE_VERSION: "service.version"; export declare const SERVICE_NAMESPACE: "service.namespace"; /** Stamped on every SDK-side span. QAR's spans carry `service.name = "qar"`; correlation across the wire is by `trace_id`, never service identity. */ export declare const SERVICE_NAME_VALUE: "@qodo/sdk"; /** Same `qodo` namespace QAR uses, so a Phoenix query filtering `service.namespace = "qodo"` returns SDK + runtime spans. */ export declare const SERVICE_NAMESPACE_VALUE: "qodo"; export declare const QAR_SESSION_ID: "qar.session_id"; export declare const QAR_MESSAGE_ID: "qar.message_id"; export declare const QAR_PARENT_MESSAGE_ID: "qar.parent_message_id"; export declare const QAR_TASK_ID: "qar.task_id"; export declare const QAR_ENVELOPE_KIND: "qar.envelope.kind"; export declare const QAR_TOOL_NAME: "qar.tool_name"; export declare const QAR_TOOL_CALL_ID: "qar.tool_call_id"; /** `"sdk-side"` on every tool span the SDK opens; QAR sets `"runtime-side"` / `"mcp:"` on its own. */ export declare const QAR_TOOL_ORIGIN: "qar.tool_origin"; export declare const QAR_TOOL_OUTCOME: "qar.tool_outcome"; /** * Originating node name for parallel-batched tool calls. Set on every * `qar.client.tool.handler` and `qar.client.tool.respond` span: * `default` (or the configured agent * identifier) for single-agent Pattern A/B, the graph node id for Pattern C. * Without this, multi-node graphs with parallel in-flight tool calls couldn't * be disambiguated in traces. */ export declare const QAR_NODE_NAME: "qar.node_name"; /** MCP server name on MCP-projection telemetry (e.g. the `qar.client.mcp.tool_dropped` span). */ export declare const QAR_MCP_NAME: "qar.mcp.name"; /** Why a tool was dropped from the projection: `"unregistered_mcp"` or `"unknown_tool"`. */ export declare const QAR_MCP_DROP_REASON: "qar.mcp.drop_reason"; export declare const QAR_SKILL_NAME: "qar.skill_name"; export declare const QAR_AGENT_ID: "qar.agent_id"; /** * Inline-graph attributes. Set on the `qar.client.task.start` span the * SDK opens for an inline-graph dispatch. * * - `qar.graph.entry` — entry-point node name (`graph.entry`). * - `qar.graph.depth` — longest acyclic path length from `entry`, computed * client-side at validate-time. Lets traces distinguish flat fan-outs * (depth 1) from deeply-nested chains without re-parsing the spec. * - `qar.agent.kind` — closed value set `"inline" | "agent_id"`. The * SDK stamps the parent `qar.client.task.start` span with `"inline"` * when *any* node carries an inline `AgentSpec` and `"agent_id"` when * every node is a server-static reference. QAR's per-node spans use * the same vocabulary, set per-node from each agent's shape. */ export declare const QAR_GRAPH_ENTRY: "qar.graph.entry"; export declare const QAR_GRAPH_DEPTH: "qar.graph.depth"; export declare const QAR_AGENT_KIND: "qar.agent.kind"; /** * Evaluator attributes. Set on per-node spans QAR emits when the runtime * dispatches an evaluator node and a `VerdictResult` returns. * * - `qar.agent.role` — closed enum from `InlineGraphRole`. * - `qar.evaluator.verdict` — `verdict` from the returned `VerdictResult`. * - `qar.evaluator.confidence` — `confidence` from the same (if present). * * SDK-side these are exported strings; QAR's `dispatch_evaluator` stamps * them on the matching server-side span. The SDK never sees the verdict * payload directly — it surfaces through QAR's runtime trace. */ export declare const QAR_AGENT_ROLE: "qar.agent.role"; export declare const QAR_EVALUATOR_VERDICT: "qar.evaluator.verdict"; export declare const QAR_EVALUATOR_CONFIDENCE: "qar.evaluator.confidence"; export declare const GEN_AI_CONVERSATION_ID: "gen_ai.conversation.id"; export declare const GEN_AI_OPERATION_NAME: "gen_ai.operation.name"; /** Sub-agent activation reports `"invoke_agent"`; the spawn-vs-invoke nuance lives on `qar.spawn_protocol`, not by overloading the operation name. */ export declare const GEN_AI_OP_INVOKE_AGENT: "invoke_agent"; /** Per OTel GenAI semconv: tool execution. */ export declare const GEN_AI_OP_EXECUTE_TOOL: "execute_tool"; /** * Tuple of attribute strings the SDK is intentionally NOT setting on its own * spans. Tests + audits import this; emission code never does. * * Rationale per entry: * - `qar.tenant_id` — resolved by QAR via `/platform/v2/users`. SDK never sees the tenant id. * - `qar.principal_id` — same: resolved server-side from the bearer token. * - `qar.deployment_kind` — server-side concept (`qodo-cloud` vs `self-tenant`); the SDK is identical across both. * - `qar.skill_version` — bound at task-start by QAR's skill registry. * - `qar.skill_state_schema_v` — same: resolved by the server's skill loader. * - `qar.skill_invocation_id` — minted by QAR per skill activation. * - `qar.skill_activation` — `"agent" | "user" | "always"`; server-side bookkeeping. * - `gen_ai.provider.name` — provider chosen by QAR's gateway/router; SDK never sees model details. * - `gen_ai.request.model` — same: chosen at dispatch time. * - `gen_ai.request.temperature`, `gen_ai.request.top_p`, `gen_ai.request.max_tokens` — request params QAR sends to the LLM provider. * - `gen_ai.response.model` — model that actually answered (provider may downgrade); only QAR sees it. * - `gen_ai.response.finish_reason` / `gen_ai.response.finish_reasons` — emitted by the LLM provider span. * - `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens`, `gen_ai.usage.total_tokens` — token accounting attached to the LLM-provider span. * - `qar.usage.cost_usd` — cost rollup computed by QAR over the LLM response. * - `qar.bulletin.topic`, `qar.bulletin.from_agent`, `qar.bulletin.to_agent` — server-emitted on `bulletin.post` envelopes; the SDK forwards as wire payloads, doesn't attach to its own spans. * - `qar.state.skill`, `qar.state.op`, `qar.state.size_bytes`, `qar.state.schema_version` — server-emitted on `state.update` envelopes; same forwarding rule. * * (Order: server-only identity first (tenant / principal / deployment), * then skill bookkeeping, then `gen_ai.*` LLM-call detail, then * per-envelope server-side attrs.) */ export declare const SKIPPED_ATTRIBUTES: readonly ["qar.tenant_id", "qar.principal_id", "qar.deployment_kind", "qar.skill_version", "qar.skill_state_schema_v", "qar.skill_invocation_id", "qar.skill_activation", "gen_ai.provider.name", "gen_ai.request.model", "gen_ai.request.temperature", "gen_ai.request.top_p", "gen_ai.request.max_tokens", "gen_ai.response.model", "gen_ai.response.finish_reason", "gen_ai.response.finish_reasons", "gen_ai.usage.input_tokens", "gen_ai.usage.output_tokens", "gen_ai.usage.total_tokens", "qar.usage.cost_usd", "qar.bulletin.topic", "qar.bulletin.from_agent", "qar.bulletin.to_agent", "qar.state.skill", "qar.state.op", "qar.state.size_bytes", "qar.state.schema_version"]; export type SkippedAttribute = (typeof SKIPPED_ATTRIBUTES)[number]; /** Observer-side span name — used by `SdkTracer.onEvent` for the per-task lifecycle it stitches from inbound envelopes. Distinct from the per-public-API `qar.client.task.start`. */ export declare const SPAN_TASK_OBSERVED: "qar.client.task.observed"; export declare const SPAN_TASK_START: "qar.client.task.start"; export declare const SPAN_TASK_CONTINUE: "qar.client.task.continue"; export declare const SPAN_TASK_CANCEL: "qar.client.task.cancel"; export declare const SPAN_TASK_RESUBSCRIBE: "qar.client.task.resubscribe"; export declare const SPAN_TOOL_REQUEST: "qar.client.tool.request"; export declare const SPAN_TOOL_RESPOND: "qar.client.tool.respond"; /** Span around an inbound `tool.request` → registered handler invocation. Distinct from `tool.respond` (which covers the WS write). */ export declare const SPAN_TOOL_HANDLER: "qar.client.tool.handler"; /** Short-lived span emitted once per tool soft-dropped during MCP projection (`onMissing: 'drop'`). */ export declare const SPAN_MCP_TOOL_DROPPED: "qar.client.mcp.tool_dropped"; export declare const SPAN_CONNECT: "qar.client.connect"; export declare const SPAN_DISCONNECT: "qar.client.disconnect"; export declare const SPAN_PIPELINE: "qar.client.pipeline"; export declare const SPAN_PIPELINE_STEP: "qar.client.pipeline.step"; /** Pipeline child-span attribute — name of the executed step (or gate). */ export declare const QAR_PIPELINE_STEP_NAME: "qar.pipeline.step_name"; /** Pipeline gate child-span attribute — whether the predicate evaluated truthy. */ export declare const QAR_PIPELINE_GATE_PASSED: "qar.pipeline.gate_passed"; /** Pipeline root-span attribute — count of errors aggregated under `collect` strategy. */ export declare const QAR_PIPELINE_COLLECTED_ERRORS: "qar.pipeline.collected_errors"; /** Pipeline root-span attribute — `true` when a gate short-circuited the run. */ export declare const QAR_PIPELINE_GATED: "qar.pipeline.gated"; /** Constant value the SDK stamps on tool spans so server-side tools are distinguishable. */ export declare const TOOL_ORIGIN_SDK_SIDE: "sdk-side"; /** Tool-outcome value enums — the SDK reports one of these on every closed tool span. */ export declare const TOOL_OUTCOME_SUCCESS: "success"; export declare const TOOL_OUTCOME_ERROR: "error"; export declare const TOOL_OUTCOME_DENIED: "denied"; //# sourceMappingURL=attributes.d.ts.map