@introspection-sdk/introspection-node 0.4.1 → 0.4.3

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 (166) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-check-types.log +4 -0
  3. package/.turbo/turbo-lint.log +5 -0
  4. package/dist/ai-sdk-integration.d.ts.map +1 -1
  5. package/dist/ai-sdk-integration.js +2 -2
  6. package/dist/claude-hooks.d.ts.map +1 -1
  7. package/dist/claude-hooks.js +3 -3
  8. package/dist/client.d.ts +42 -132
  9. package/dist/client.d.ts.map +1 -1
  10. package/dist/client.js +66 -365
  11. package/dist/client.js.map +1 -0
  12. package/dist/converters/claude.d.ts +5 -1
  13. package/dist/converters/claude.d.ts.map +1 -1
  14. package/dist/converters/claude.js +7 -0
  15. package/dist/converters/claude.js.map +1 -0
  16. package/dist/converters/gemini.d.ts +90 -0
  17. package/dist/converters/gemini.d.ts.map +1 -0
  18. package/dist/converters/gemini.js +171 -0
  19. package/dist/converters/gemini.js.map +1 -0
  20. package/dist/converters/index.d.ts +1 -1
  21. package/dist/converters/index.d.ts.map +1 -1
  22. package/dist/converters/index.js +2 -1
  23. package/dist/converters/index.js.map +1 -0
  24. package/dist/converters/openai.js +1 -0
  25. package/dist/converters/openai.js.map +1 -0
  26. package/dist/converters/openclaw.d.ts +16 -0
  27. package/dist/converters/openclaw.d.ts.map +1 -0
  28. package/dist/converters/openclaw.js +49 -0
  29. package/dist/converters/openinference.js +1 -0
  30. package/dist/converters/openinference.js.map +1 -0
  31. package/dist/converters/vercel.d.ts.map +1 -1
  32. package/dist/converters/vercel.js +31 -3
  33. package/dist/converters/vercel.js.map +1 -0
  34. package/dist/http.d.ts +36 -0
  35. package/dist/http.d.ts.map +1 -0
  36. package/dist/http.js +145 -0
  37. package/dist/http.js.map +1 -0
  38. package/dist/index.d.ts +24 -27
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +22 -32
  41. package/dist/index.js.map +1 -0
  42. package/dist/langchain-handler.d.ts.map +1 -1
  43. package/dist/langchain-handler.js +2 -2
  44. package/dist/mastra-exporter.d.ts.map +1 -1
  45. package/dist/mastra-exporter.js +2 -2
  46. package/dist/otel/anthropic.d.ts +62 -0
  47. package/dist/otel/anthropic.d.ts.map +1 -0
  48. package/dist/otel/anthropic.js +425 -0
  49. package/dist/otel/anthropic.js.map +1 -0
  50. package/dist/otel/claude-hooks.d.ts +346 -0
  51. package/dist/otel/claude-hooks.d.ts.map +1 -0
  52. package/dist/otel/claude-hooks.js +645 -0
  53. package/dist/otel/claude-hooks.js.map +1 -0
  54. package/dist/otel/claude-wrapper.d.ts +93 -0
  55. package/dist/otel/claude-wrapper.d.ts.map +1 -0
  56. package/dist/otel/claude-wrapper.js +155 -0
  57. package/dist/otel/claude-wrapper.js.map +1 -0
  58. package/dist/otel/gemini.d.ts +48 -0
  59. package/dist/otel/gemini.d.ts.map +1 -0
  60. package/dist/otel/gemini.js +297 -0
  61. package/dist/otel/gemini.js.map +1 -0
  62. package/dist/otel/index.d.ts +27 -0
  63. package/dist/otel/index.d.ts.map +1 -0
  64. package/dist/otel/index.js +33 -0
  65. package/dist/otel/index.js.map +1 -0
  66. package/dist/otel/langchain-handler.d.ts +112 -0
  67. package/dist/otel/langchain-handler.d.ts.map +1 -0
  68. package/dist/otel/langchain-handler.js +555 -0
  69. package/dist/otel/langchain-handler.js.map +1 -0
  70. package/dist/otel/logs.d.ts +82 -0
  71. package/dist/otel/logs.d.ts.map +1 -0
  72. package/dist/otel/logs.js +271 -0
  73. package/dist/otel/logs.js.map +1 -0
  74. package/dist/otel/mastra-exporter.d.ts +87 -0
  75. package/dist/otel/mastra-exporter.d.ts.map +1 -0
  76. package/dist/otel/mastra-exporter.js +525 -0
  77. package/dist/otel/mastra-exporter.js.map +1 -0
  78. package/dist/otel/pi.d.ts +59 -0
  79. package/dist/otel/pi.d.ts.map +1 -0
  80. package/dist/otel/pi.js +67 -0
  81. package/dist/otel/pi.js.map +1 -0
  82. package/dist/otel/setup.d.ts +23 -0
  83. package/dist/otel/setup.d.ts.map +1 -0
  84. package/dist/otel/setup.js +127 -0
  85. package/dist/otel/setup.js.map +1 -0
  86. package/dist/otel/span-processor.d.ts +62 -0
  87. package/dist/otel/span-processor.d.ts.map +1 -0
  88. package/dist/otel/span-processor.js +319 -0
  89. package/dist/otel/span-processor.js.map +1 -0
  90. package/dist/otel/tracing-processor.d.ts +139 -0
  91. package/dist/otel/tracing-processor.d.ts.map +1 -0
  92. package/dist/otel/tracing-processor.js +418 -0
  93. package/dist/otel/tracing-processor.js.map +1 -0
  94. package/dist/resources/experiments.d.ts +31 -0
  95. package/dist/resources/experiments.d.ts.map +1 -0
  96. package/dist/resources/experiments.js +133 -0
  97. package/dist/resources/experiments.js.map +1 -0
  98. package/dist/resources/recipes.d.ts +22 -0
  99. package/dist/resources/recipes.d.ts.map +1 -0
  100. package/dist/resources/recipes.js +61 -0
  101. package/dist/resources/recipes.js.map +1 -0
  102. package/dist/resources/runtimes.d.ts +76 -0
  103. package/dist/resources/runtimes.d.ts.map +1 -0
  104. package/dist/resources/runtimes.js +179 -0
  105. package/dist/resources/runtimes.js.map +1 -0
  106. package/dist/runner-resources/files.d.ts +35 -0
  107. package/dist/runner-resources/files.d.ts.map +1 -0
  108. package/dist/runner-resources/files.js +131 -0
  109. package/dist/runner-resources/files.js.map +1 -0
  110. package/dist/runner-resources/tasks.d.ts +39 -0
  111. package/dist/runner-resources/tasks.d.ts.map +1 -0
  112. package/dist/runner-resources/tasks.js +129 -0
  113. package/dist/runner-resources/tasks.js.map +1 -0
  114. package/dist/runner.d.ts +80 -0
  115. package/dist/runner.d.ts.map +1 -0
  116. package/dist/runner.js +159 -0
  117. package/dist/runner.js.map +1 -0
  118. package/dist/span-processor.d.ts.map +1 -1
  119. package/dist/span-processor.js +3 -3
  120. package/dist/streaming.d.ts +8 -0
  121. package/dist/streaming.d.ts.map +1 -0
  122. package/dist/streaming.js +67 -0
  123. package/dist/streaming.js.map +1 -0
  124. package/dist/tracing-processor.d.ts.map +1 -1
  125. package/dist/tracing-processor.js +3 -3
  126. package/dist/types/genai.d.ts +165 -0
  127. package/dist/types/genai.d.ts.map +1 -0
  128. package/dist/types/genai.js +82 -0
  129. package/dist/types.js +1 -0
  130. package/dist/types.js.map +1 -0
  131. package/dist/utils.d.ts +1 -0
  132. package/dist/utils.d.ts.map +1 -1
  133. package/dist/utils.js +14 -0
  134. package/dist/utils.js.map +1 -0
  135. package/dist/version.js +1 -0
  136. package/dist/version.js.map +1 -0
  137. package/package.json +83 -25
  138. package/src/client.ts +76 -471
  139. package/src/converters/claude.ts +11 -1
  140. package/src/converters/gemini.ts +243 -0
  141. package/src/converters/index.ts +13 -7
  142. package/src/converters/vercel.ts +41 -3
  143. package/src/http.ts +163 -0
  144. package/src/index.ts +110 -75
  145. package/src/{anthropic.ts → otel/anthropic.ts} +95 -8
  146. package/src/{claude-hooks.ts → otel/claude-hooks.ts} +125 -24
  147. package/src/{claude-wrapper.ts → otel/claude-wrapper.ts} +1 -1
  148. package/src/otel/gemini.ts +397 -0
  149. package/src/otel/index.ts +80 -0
  150. package/src/{langchain-handler.ts → otel/langchain-handler.ts} +56 -7
  151. package/src/otel/logs.ts +394 -0
  152. package/src/{mastra-exporter.ts → otel/mastra-exporter.ts} +86 -23
  153. package/src/otel/pi.ts +88 -0
  154. package/src/otel/setup.ts +174 -0
  155. package/src/{span-processor.ts → otel/span-processor.ts} +17 -10
  156. package/src/{tracing-processor.ts → otel/tracing-processor.ts} +100 -23
  157. package/src/resources/experiments.ts +170 -0
  158. package/src/resources/recipes.ts +73 -0
  159. package/src/resources/runtimes.ts +231 -0
  160. package/src/runner-resources/files.ts +163 -0
  161. package/src/runner-resources/tasks.ts +156 -0
  162. package/src/runner.ts +194 -0
  163. package/src/streaming.ts +57 -0
  164. package/src/utils.ts +15 -0
  165. package/src/ai-sdk-integration.ts +0 -689
  166. package/src/converters/ai-sdk.ts +0 -323
@@ -0,0 +1,139 @@
1
+ /**
2
+ * OpenAI Agents TracingProcessor for Introspection SDK.
3
+ *
4
+ * Forwards OpenAI agent traces to the backend via OTLP with OTel Gen AI semantic
5
+ * convention attributes.
6
+ */
7
+ import { type SpanExporter, type IdGenerator } from "@opentelemetry/sdk-trace-base";
8
+ import type { TracingProcessor, Trace, Span, SpanData } from "@openai/agents";
9
+ /**
10
+ * Advanced options for testing and customization of
11
+ * {@link IntrospectionTracingProcessor}.
12
+ */
13
+ export interface TracingProcessorAdvancedOptions {
14
+ /** Custom span exporter (for testing - use InMemorySpanExporter) */
15
+ spanExporter?: SpanExporter;
16
+ /** Custom ID generator (for testing - use IncrementalIdGenerator) */
17
+ idGenerator?: IdGenerator;
18
+ /** Use SimpleSpanProcessor instead of BatchSpanProcessor (for testing) */
19
+ useSimpleSpanProcessor?: boolean;
20
+ /**
21
+ * Maximum number of spans to export in a single batch.
22
+ * Set to 1 to export each span individually on end, ensuring sequential
23
+ * processing by the backend (useful for multi-turn conversations where
24
+ * each turn must be ingested before the next arrives).
25
+ * Defaults to the OTel SDK default (512).
26
+ */
27
+ maxExportBatchSize?: number;
28
+ /**
29
+ * Delay interval in milliseconds between batch exports.
30
+ * Lower values reduce latency but increase network requests.
31
+ * Defaults to 1000.
32
+ */
33
+ scheduledDelayMillis?: number;
34
+ }
35
+ /** Configuration for {@link IntrospectionTracingProcessor}. */
36
+ export interface IntrospectionTracingProcessorOptions {
37
+ /** Authentication token (env: INTROSPECTION_TOKEN) */
38
+ token?: string;
39
+ /** Base URL for the API (env: INTROSPECTION_BASE_OTEL_URL, default: "https://otel.introspection.dev") */
40
+ baseUrl?: string;
41
+ /** Service name for telemetry (env: INTROSPECTION_SERVICE_NAME) */
42
+ serviceName?: string;
43
+ /** Additional headers to include in requests */
44
+ additionalHeaders?: Record<string, string>;
45
+ /** Advanced options for testing and customization */
46
+ advanced?: TracingProcessorAdvancedOptions;
47
+ }
48
+ /**
49
+ * {@link TracingProcessor} that forwards OpenAI agent traces to the
50
+ * Introspection backend via OTLP.
51
+ *
52
+ * Extracts OTel Gen AI semantic convention attributes from span data:
53
+ * - Agent spans: `gen_ai.agent.name`, `gen_ai.tool.definitions`, `gen_ai.agent.handoffs`
54
+ * - Function spans: `gen_ai.tool.name`, `gen_ai.tool.input`, `gen_ai.tool.output`
55
+ * - Response spans: `gen_ai.input/output.messages`, `gen_ai.usage.*`, `gen_ai.request.model`
56
+ * - Generation spans: `gen_ai.request.model`, `gen_ai.usage.*`
57
+ * - Handoff spans: `gen_ai.handoff.from_agent`, `gen_ai.handoff.to_agent`
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * import { IntrospectionTracingProcessor } from "@introspection-sdk/introspection-node";
62
+ *
63
+ * const processor = new IntrospectionTracingProcessor({ token: "sk-intro-…" });
64
+ * // pass processor to the OpenAI Agents SDK withTrace() or registerProcessor()
65
+ * ```
66
+ */
67
+ export declare class IntrospectionTracingProcessor implements TracingProcessor {
68
+ private _tracerProvider;
69
+ private _tracer;
70
+ private _spans;
71
+ private _conversationIds;
72
+ constructor(options?: IntrospectionTracingProcessorOptions);
73
+ /**
74
+ * Called when the processor is started. Optional lifecycle hook.
75
+ */
76
+ start(): void;
77
+ /**
78
+ * Called when a trace starts. Creates a root OTel span.
79
+ *
80
+ * @param trace - The OpenAI Agents SDK trace object.
81
+ */
82
+ onTraceStart(trace: Trace): Promise<void>;
83
+ /**
84
+ * Called when a trace ends. Closes the root OTel span.
85
+ *
86
+ * @param trace - The OpenAI Agents SDK trace object.
87
+ */
88
+ onTraceEnd(trace: Trace): Promise<void>;
89
+ /**
90
+ * Called when a span starts. Creates a child OTel span with parent context.
91
+ *
92
+ * @param span - The OpenAI Agents SDK span.
93
+ */
94
+ onSpanStart(span: Span<SpanData>): Promise<void>;
95
+ /**
96
+ * Called when a span ends. Extracts `gen_ai.*` attributes from the span
97
+ * data and sets them on the corresponding OTel span before ending it.
98
+ *
99
+ * @param span - The OpenAI Agents SDK span.
100
+ */
101
+ onSpanEnd(span: Span<SpanData>): Promise<void>;
102
+ /**
103
+ * Extract attributes from agent spans.
104
+ */
105
+ private _processAgentSpan;
106
+ /**
107
+ * Extract attributes from function/tool spans.
108
+ */
109
+ private _processFunctionSpan;
110
+ /**
111
+ * Extract attributes from response spans.
112
+ * Matches Python implementation - extracts from both spanData and _response object.
113
+ */
114
+ private _processResponseSpan;
115
+ /**
116
+ * Extract attributes from generation spans.
117
+ * Handles both structured GenerationUsageData (spanData.usage) and raw
118
+ * Chat Completions API responses stored in spanData.output[0] by
119
+ * OpenAIChatCompletionsModel.
120
+ */
121
+ private _processGenerationSpan;
122
+ /**
123
+ * Extract attributes from handoff spans.
124
+ */
125
+ private _processHandoffSpan;
126
+ /**
127
+ * Shut down the tracer provider, flushing all pending spans.
128
+ *
129
+ * @returns A promise that resolves once shutdown is complete.
130
+ */
131
+ shutdown(): Promise<void>;
132
+ /**
133
+ * Force-flush any buffered spans to the Introspection backend.
134
+ *
135
+ * @returns A promise that resolves once the flush completes.
136
+ */
137
+ forceFlush(): Promise<void>;
138
+ }
139
+ //# sourceMappingURL=tracing-processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing-processor.d.ts","sourceRoot":"","sources":["../../src/otel/tracing-processor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AAoBvC,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,IAAI,EACJ,QAAQ,EAMT,MAAM,gBAAgB,CAAC;AAExB;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C,oEAAoE;IACpE,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,qEAAqE;IACrE,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,0EAA0E;IAC1E,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,MAAM,CA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C,mBAAmB;IAY3B;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGlC"}
@@ -0,0 +1,418 @@
1
+ /**
2
+ * OpenAI Agents TracingProcessor for Introspection SDK.
3
+ *
4
+ * Forwards OpenAI agent traces to the backend via OTLP with OTel Gen AI semantic
5
+ * convention attributes.
6
+ */
7
+ import { context as otelContext, trace as otelTrace, } from "@opentelemetry/api";
8
+ import { BasicTracerProvider, BatchSpanProcessor, SimpleSpanProcessor, } from "@opentelemetry/sdk-trace-base";
9
+ import { resourceFromAttributes } from "@opentelemetry/resources";
10
+ import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
11
+ import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
12
+ import { randomUUID } from "crypto";
13
+ import { convertResponsesInputsToSemconv, convertResponsesOutputsToSemconv, convertResponsesToolsToSemconv, convertResponsesInstructionsToSemconv, } from "../converters/openai.js";
14
+ import { logger, withOtlpHttpsProxy } from "../utils.js";
15
+ import { VERSION } from "../version.js";
16
+ /**
17
+ * {@link TracingProcessor} that forwards OpenAI agent traces to the
18
+ * Introspection backend via OTLP.
19
+ *
20
+ * Extracts OTel Gen AI semantic convention attributes from span data:
21
+ * - Agent spans: `gen_ai.agent.name`, `gen_ai.tool.definitions`, `gen_ai.agent.handoffs`
22
+ * - Function spans: `gen_ai.tool.name`, `gen_ai.tool.input`, `gen_ai.tool.output`
23
+ * - Response spans: `gen_ai.input/output.messages`, `gen_ai.usage.*`, `gen_ai.request.model`
24
+ * - Generation spans: `gen_ai.request.model`, `gen_ai.usage.*`
25
+ * - Handoff spans: `gen_ai.handoff.from_agent`, `gen_ai.handoff.to_agent`
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * import { IntrospectionTracingProcessor } from "@introspection-sdk/introspection-node";
30
+ *
31
+ * const processor = new IntrospectionTracingProcessor({ token: "sk-intro-…" });
32
+ * // pass processor to the OpenAI Agents SDK withTrace() or registerProcessor()
33
+ * ```
34
+ */
35
+ export class IntrospectionTracingProcessor {
36
+ _tracerProvider;
37
+ _tracer;
38
+ _spans = new Map();
39
+ _conversationIds = new Map();
40
+ constructor(options = {}) {
41
+ const advanced = options.advanced;
42
+ const serviceName = options.serviceName || process.env.INTROSPECTION_SERVICE_NAME;
43
+ const resource = serviceName
44
+ ? resourceFromAttributes({ [ATTR_SERVICE_NAME]: serviceName })
45
+ : undefined;
46
+ // If custom exporter is provided (testing mode), skip token validation
47
+ if (!advanced?.spanExporter) {
48
+ const token = options.token || process.env.INTROSPECTION_TOKEN;
49
+ if (!token) {
50
+ throw new Error("INTROSPECTION_TOKEN is required");
51
+ }
52
+ const baseUrl = options.baseUrl ||
53
+ process.env.INTROSPECTION_BASE_OTEL_URL ||
54
+ "https://otel.introspection.dev";
55
+ const headers = {
56
+ "User-Agent": `introspection-sdk/${VERSION}`,
57
+ Authorization: `Bearer ${token}`,
58
+ ...options.additionalHeaders,
59
+ };
60
+ // Construct endpoint URL
61
+ const endpoint = baseUrl.endsWith("/v1/traces")
62
+ ? baseUrl
63
+ : `${baseUrl.replace(/\/$/, "")}/v1/traces`;
64
+ logger.info(`IntrospectionTracingProcessor initialized: endpoint=${endpoint}`);
65
+ // Setup OTLP exporter
66
+ const spanExporter = new OTLPTraceExporter(withOtlpHttpsProxy({
67
+ url: endpoint,
68
+ headers,
69
+ }));
70
+ // Use SimpleSpanProcessor for maxExportBatchSize=1 (sequential export),
71
+ // otherwise BatchSpanProcessor with configurable batch size.
72
+ // Default to sequential export for dev/staging tokens.
73
+ const effectiveBatchSize = advanced?.maxExportBatchSize ??
74
+ (token.startsWith("intro_dev") || token.startsWith("intro_staging")
75
+ ? 1
76
+ : undefined);
77
+ const useSimple = advanced?.useSimpleSpanProcessor || effectiveBatchSize === 1;
78
+ const scheduledDelayMillis = advanced?.scheduledDelayMillis ?? 1000;
79
+ const spanProcessor = useSimple
80
+ ? new SimpleSpanProcessor(spanExporter)
81
+ : new BatchSpanProcessor(spanExporter, {
82
+ scheduledDelayMillis,
83
+ ...(effectiveBatchSize
84
+ ? { maxExportBatchSize: effectiveBatchSize }
85
+ : {}),
86
+ });
87
+ this._tracerProvider = new BasicTracerProvider({
88
+ resource,
89
+ idGenerator: advanced?.idGenerator,
90
+ spanProcessors: [spanProcessor],
91
+ });
92
+ }
93
+ else {
94
+ // Testing mode: use provided exporter
95
+ logger.info(`IntrospectionTracingProcessor initialized in test mode with custom exporter`);
96
+ // Choose span processor based on options
97
+ const spanProcessor = advanced.useSimpleSpanProcessor
98
+ ? new SimpleSpanProcessor(advanced.spanExporter)
99
+ : new BatchSpanProcessor(advanced.spanExporter, {
100
+ scheduledDelayMillis: 100,
101
+ });
102
+ this._tracerProvider = new BasicTracerProvider({
103
+ resource,
104
+ idGenerator: advanced.idGenerator,
105
+ spanProcessors: [spanProcessor],
106
+ });
107
+ }
108
+ this._tracer = this._tracerProvider.getTracer("openai-agents", VERSION);
109
+ }
110
+ /**
111
+ * Called when the processor is started. Optional lifecycle hook.
112
+ */
113
+ start() {
114
+ // No-op - processor is ready after construction
115
+ }
116
+ /**
117
+ * Called when a trace starts. Creates a root OTel span.
118
+ *
119
+ * @param trace - The OpenAI Agents SDK trace object.
120
+ */
121
+ async onTraceStart(trace) {
122
+ logger.debug(`onTraceStart called: ${trace?.name} (${trace?.traceId})`);
123
+ if (trace) {
124
+ // Use groupId as conversationId when provided so callers can link
125
+ // multiple traces (e.g. multi-turn orchestrator runs) into one conversation.
126
+ const conversationId = trace.groupId ?? `intro_conv_${randomUUID().replace(/-/g, "")}`;
127
+ this._conversationIds.set(trace.traceId, conversationId);
128
+ const otelSpan = this._tracer.startSpan(trace.name);
129
+ this._spans.set(trace.traceId, otelSpan);
130
+ logger.debug(`Created root span for trace: ${trace.traceId}`);
131
+ }
132
+ }
133
+ /**
134
+ * Called when a trace ends. Closes the root OTel span.
135
+ *
136
+ * @param trace - The OpenAI Agents SDK trace object.
137
+ */
138
+ async onTraceEnd(trace) {
139
+ logger.debug(`onTraceEnd called: ${trace?.name} (${trace?.traceId})`);
140
+ if (trace) {
141
+ const otelSpan = this._spans.get(trace.traceId);
142
+ if (otelSpan) {
143
+ this._spans.delete(trace.traceId);
144
+ this._conversationIds.delete(trace.traceId);
145
+ otelSpan.end();
146
+ logger.debug(`Ended root span for trace: ${trace.traceId}`);
147
+ }
148
+ }
149
+ }
150
+ /**
151
+ * Called when a span starts. Creates a child OTel span with parent context.
152
+ *
153
+ * @param span - The OpenAI Agents SDK span.
154
+ */
155
+ async onSpanStart(span) {
156
+ logger.debug(`onSpanStart called: ${span?.spanId} (type: ${span?.spanData?.type})`);
157
+ if (span) {
158
+ const parentId = span.parentId || span.traceId;
159
+ const parent = this._spans.get(parentId);
160
+ const ctx = parent
161
+ ? otelTrace.setSpan(otelContext.active(), parent)
162
+ : undefined;
163
+ const spanData = span.spanData;
164
+ let name;
165
+ // Use name for agent and function spans, type for others
166
+ if (spanData.type === "agent") {
167
+ name = spanData.name;
168
+ }
169
+ else if (spanData.type === "function") {
170
+ name = spanData.name;
171
+ }
172
+ else {
173
+ name = spanData.type;
174
+ }
175
+ const otelSpan = this._tracer.startSpan(name, {}, ctx);
176
+ this._spans.set(span.spanId, otelSpan);
177
+ }
178
+ }
179
+ /**
180
+ * Called when a span ends. Extracts `gen_ai.*` attributes from the span
181
+ * data and sets them on the corresponding OTel span before ending it.
182
+ *
183
+ * @param span - The OpenAI Agents SDK span.
184
+ */
185
+ async onSpanEnd(span) {
186
+ if (!span)
187
+ return;
188
+ const otelSpan = this._spans.get(span.spanId);
189
+ if (!otelSpan) {
190
+ return;
191
+ }
192
+ this._spans.delete(span.spanId);
193
+ const spanData = span.spanData;
194
+ // Extract gen_ai.* attributes based on span type
195
+ switch (spanData.type) {
196
+ case "agent":
197
+ this._processAgentSpan(otelSpan, spanData);
198
+ break;
199
+ case "function":
200
+ this._processFunctionSpan(otelSpan, spanData);
201
+ break;
202
+ case "response":
203
+ this._processResponseSpan(otelSpan, spanData);
204
+ break;
205
+ case "generation":
206
+ this._processGenerationSpan(otelSpan, spanData);
207
+ break;
208
+ case "handoff":
209
+ this._processHandoffSpan(otelSpan, spanData);
210
+ break;
211
+ }
212
+ // Propagate conversation ID from trace
213
+ const conversationId = this._conversationIds.get(span.traceId);
214
+ if (conversationId) {
215
+ otelSpan.setAttribute("gen_ai.conversation.id", conversationId);
216
+ }
217
+ // Keep raw span data for debugging (matches Python attribute name)
218
+ otelSpan.setAttribute("openai_agents.span_data", JSON.stringify(spanData));
219
+ otelSpan.end();
220
+ }
221
+ /**
222
+ * Extract attributes from agent spans.
223
+ */
224
+ _processAgentSpan(otelSpan, spanData) {
225
+ otelSpan.setAttribute("gen_ai.agent.name", spanData.name);
226
+ otelSpan.setAttribute("gen_ai.system", "openai");
227
+ otelSpan.setAttribute("openinference.span.kind", "AGENT");
228
+ if (spanData.tools) {
229
+ // Wrap tool names as objects for ClickHouse Array(JSON) compatibility
230
+ const toolDefs = spanData.tools.map((t) => ({ name: t }));
231
+ otelSpan.setAttribute("gen_ai.tool.definitions", JSON.stringify(toolDefs));
232
+ }
233
+ if (spanData.handoffs) {
234
+ otelSpan.setAttribute("gen_ai.agent.handoffs", JSON.stringify(spanData.handoffs));
235
+ }
236
+ if (spanData.output_type) {
237
+ otelSpan.setAttribute("gen_ai.agent.output_type", spanData.output_type);
238
+ }
239
+ }
240
+ /**
241
+ * Extract attributes from function/tool spans.
242
+ */
243
+ _processFunctionSpan(otelSpan, spanData) {
244
+ otelSpan.setAttribute("gen_ai.tool.name", spanData.name);
245
+ otelSpan.setAttribute("openinference.span.kind", "TOOL");
246
+ if (spanData.input) {
247
+ otelSpan.setAttribute("gen_ai.tool.input", spanData.input);
248
+ }
249
+ if (spanData.output) {
250
+ otelSpan.setAttribute("gen_ai.tool.output", String(spanData.output));
251
+ }
252
+ }
253
+ /**
254
+ * Extract attributes from response spans.
255
+ * Matches Python implementation - extracts from both spanData and _response object.
256
+ */
257
+ _processResponseSpan(otelSpan, spanData) {
258
+ otelSpan.setAttribute("gen_ai.operation.name", "chat");
259
+ otelSpan.setAttribute("gen_ai.system", "openai");
260
+ otelSpan.setAttribute("openinference.span.kind", "LLM");
261
+ // Response ID (from span_data directly)
262
+ if (spanData.response_id) {
263
+ otelSpan.setAttribute("gen_ai.response.id", spanData.response_id);
264
+ }
265
+ // Input messages (from spanData._input)
266
+ if (spanData._input) {
267
+ const inputs = Array.isArray(spanData._input)
268
+ ? spanData._input
269
+ : [spanData._input];
270
+ const [inputMessages] = convertResponsesInputsToSemconv(inputs, undefined);
271
+ if (inputMessages.length > 0) {
272
+ otelSpan.setAttribute("gen_ai.input.messages", JSON.stringify(inputMessages));
273
+ }
274
+ }
275
+ // Extract from _response if available (full Response object)
276
+ const response = spanData._response;
277
+ if (!response)
278
+ return;
279
+ // System instructions
280
+ const sysInstructions = convertResponsesInstructionsToSemconv(response.instructions);
281
+ if (sysInstructions) {
282
+ otelSpan.setAttribute("gen_ai.system_instructions", JSON.stringify(sysInstructions));
283
+ }
284
+ // Tool definitions (with full details from Response object)
285
+ if (response.tools && response.tools.length > 0) {
286
+ const toolDefs = convertResponsesToolsToSemconv(response.tools);
287
+ otelSpan.setAttribute("gen_ai.tool.definitions", JSON.stringify(toolDefs));
288
+ }
289
+ // Token usage
290
+ const usage = response.usage;
291
+ if (usage) {
292
+ if (usage.input_tokens) {
293
+ otelSpan.setAttribute("gen_ai.usage.input_tokens", usage.input_tokens);
294
+ }
295
+ if (usage.output_tokens) {
296
+ otelSpan.setAttribute("gen_ai.usage.output_tokens", usage.output_tokens);
297
+ }
298
+ // OpenAI returns cached token count in input_tokens_details.cached_tokens
299
+ const cachedTokens = usage.input_tokens_details?.cached_tokens;
300
+ if (cachedTokens) {
301
+ otelSpan.setAttribute("gen_ai.usage.cache_read.input_tokens", cachedTokens);
302
+ }
303
+ }
304
+ // Model info
305
+ if (response.model) {
306
+ otelSpan.setAttribute("gen_ai.request.model", response.model);
307
+ }
308
+ // Response ID from response object (fallback if not in span_data)
309
+ if (!spanData.response_id && response.id) {
310
+ otelSpan.setAttribute("gen_ai.response.id", response.id);
311
+ }
312
+ // Output messages (from response.output)
313
+ if (response.output && response.output.length > 0) {
314
+ const outputMessages = convertResponsesOutputsToSemconv(response.output);
315
+ if (outputMessages.length > 0) {
316
+ otelSpan.setAttribute("gen_ai.output.messages", JSON.stringify(outputMessages));
317
+ }
318
+ }
319
+ }
320
+ /**
321
+ * Extract attributes from generation spans.
322
+ * Handles both structured GenerationUsageData (spanData.usage) and raw
323
+ * Chat Completions API responses stored in spanData.output[0] by
324
+ * OpenAIChatCompletionsModel.
325
+ */
326
+ _processGenerationSpan(otelSpan, spanData) {
327
+ otelSpan.setAttribute("gen_ai.operation.name", "chat");
328
+ otelSpan.setAttribute("gen_ai.system", "openai");
329
+ otelSpan.setAttribute("openinference.span.kind", "LLM");
330
+ if (spanData.model) {
331
+ otelSpan.setAttribute("gen_ai.request.model", spanData.model);
332
+ }
333
+ // GenerationUsageData uses snake_case: input_tokens / output_tokens.
334
+ if (spanData.usage?.input_tokens) {
335
+ otelSpan.setAttribute("gen_ai.usage.input_tokens", spanData.usage.input_tokens);
336
+ }
337
+ if (spanData.usage?.output_tokens) {
338
+ otelSpan.setAttribute("gen_ai.usage.output_tokens", spanData.usage.output_tokens);
339
+ }
340
+ // OpenAIChatCompletionsModel stores the raw ChatCompletion response object
341
+ // in spanData.output[0] (it never sets spanData.usage). Extract usage,
342
+ // response ID, response model, and the actual assistant message from it.
343
+ if (!spanData.usage) {
344
+ const rawResponse = spanData.output?.[0];
345
+ // Response ID — required by the backend processor to register this span
346
+ // as a conversation item (build_request returns None without it).
347
+ const responseId = rawResponse?.id;
348
+ if (typeof responseId === "string" && responseId) {
349
+ otelSpan.setAttribute("gen_ai.response.id", responseId);
350
+ }
351
+ // Resolved model name (e.g. "gpt-4o-mini-2024-07-18" vs "gpt-4o-mini").
352
+ const responseModel = rawResponse?.model;
353
+ if (typeof responseModel === "string" && responseModel) {
354
+ otelSpan.setAttribute("gen_ai.response.model", responseModel);
355
+ }
356
+ const rawUsage = rawResponse?.usage;
357
+ if (rawUsage) {
358
+ const promptTokens = rawUsage.prompt_tokens;
359
+ const completionTokens = rawUsage.completion_tokens;
360
+ if (typeof promptTokens === "number") {
361
+ otelSpan.setAttribute("gen_ai.usage.input_tokens", promptTokens);
362
+ }
363
+ if (typeof completionTokens === "number") {
364
+ otelSpan.setAttribute("gen_ai.usage.output_tokens", completionTokens);
365
+ }
366
+ const promptDetails = rawUsage.prompt_tokens_details;
367
+ const cachedTokens = promptDetails?.cached_tokens;
368
+ if (typeof cachedTokens === "number" && cachedTokens > 0) {
369
+ otelSpan.setAttribute("gen_ai.usage.cache_read.input_tokens", cachedTokens);
370
+ }
371
+ }
372
+ // Extract the actual assistant message from choices[0].message so that
373
+ // gen_ai.output.messages is a proper [{role, content}] array rather than
374
+ // the full ChatCompletion envelope (which the backend cannot parse).
375
+ const choices = rawResponse?.choices;
376
+ const assistantMessage = choices?.[0]?.message;
377
+ if (assistantMessage) {
378
+ otelSpan.setAttribute("gen_ai.output.messages", JSON.stringify([assistantMessage]));
379
+ }
380
+ }
381
+ if (spanData.input) {
382
+ otelSpan.setAttribute("gen_ai.input.messages", JSON.stringify(spanData.input));
383
+ }
384
+ // For non-Chat-Completions generation spans that do have usage set,
385
+ // still export output messages in the standard format if present.
386
+ if (spanData.usage && spanData.output) {
387
+ otelSpan.setAttribute("gen_ai.output.messages", JSON.stringify(spanData.output));
388
+ }
389
+ }
390
+ /**
391
+ * Extract attributes from handoff spans.
392
+ */
393
+ _processHandoffSpan(otelSpan, spanData) {
394
+ if (spanData.from_agent) {
395
+ otelSpan.setAttribute("gen_ai.handoff.from_agent", spanData.from_agent);
396
+ }
397
+ if (spanData.to_agent) {
398
+ otelSpan.setAttribute("gen_ai.handoff.to_agent", spanData.to_agent);
399
+ }
400
+ }
401
+ /**
402
+ * Shut down the tracer provider, flushing all pending spans.
403
+ *
404
+ * @returns A promise that resolves once shutdown is complete.
405
+ */
406
+ async shutdown() {
407
+ await this._tracerProvider.shutdown();
408
+ }
409
+ /**
410
+ * Force-flush any buffered spans to the Introspection backend.
411
+ *
412
+ * @returns A promise that resolves once the flush completes.
413
+ */
414
+ async forceFlush() {
415
+ await this._tracerProvider.forceFlush();
416
+ }
417
+ }
418
+ //# sourceMappingURL=tracing-processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing-processor.js","sourceRoot":"","sources":["../../src/otel/tracing-processor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,KAAK,IAAI,SAAS,GAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GAGpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,8BAA8B,EAC9B,qCAAqC,GACtC,MAAM,yBAAyB,CAAC;AAKjC,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAwDxC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,6BAA6B;IAChC,eAAe,CAAsB;IACrC,OAAO,CAA+C;IACtD,MAAM,GAA0B,IAAI,GAAG,EAAE,CAAC;IAC1C,gBAAgB,GAAwB,IAAI,GAAG,EAAE,CAAC;IAE1D,YAAY,UAAgD,EAAE;QAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,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IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;IAC1C,CAAC;CACF"}
@@ -0,0 +1,31 @@
1
+ import type { Experiment, ExperimentEndParams, ExperimentCreate, ExperimentListParams, ExperimentUpdate, Paginated, RunRequest, Uuid } from "@introspection-sdk/types";
2
+ import type { HttpClient } from "../http.js";
3
+ import type { IntrospectionClient } from "../client.js";
4
+ import { Runner } from "../runner.js";
5
+ export declare class ExperimentsApi {
6
+ private readonly http;
7
+ private readonly client;
8
+ constructor(http: HttpClient, client: IntrospectionClient);
9
+ list(params: ExperimentListParams): Promise<Paginated<Experiment>>;
10
+ listAll(params: ExperimentListParams): AsyncIterable<Experiment>;
11
+ get(id: Uuid): Promise<Experiment>;
12
+ create(input: ExperimentCreate): Promise<Experiment>;
13
+ update(id: Uuid, input: ExperimentUpdate): Promise<Experiment>;
14
+ delete(id: Uuid): Promise<void>;
15
+ startById(id: Uuid): Promise<Experiment>;
16
+ endById(id: Uuid, params?: ExperimentEndParams): Promise<Experiment>;
17
+ cancelById(id: Uuid): Promise<Experiment>;
18
+ runById(id: Uuid, opts?: RunRequest): Promise<Runner>;
19
+ }
20
+ export declare class ExperimentHandle {
21
+ private readonly api;
22
+ private readonly id;
23
+ constructor(api: ExperimentsApi, id: Uuid);
24
+ run(opts?: RunRequest): Promise<Runner>;
25
+ start(): Promise<Experiment>;
26
+ end(opts?: ExperimentEndParams): Promise<Experiment>;
27
+ cancel(): Promise<Experiment>;
28
+ }
29
+ export type ExperimentHandleFactory = (id: Uuid) => ExperimentHandle;
30
+ export declare function attachExperiments(client: IntrospectionClient, http: HttpClient): ExperimentsApi & ExperimentHandleFactory;
31
+ //# sourceMappingURL=experiments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experiments.d.ts","sourceRoot":"","sources":["../../src/resources/experiments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EA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