@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.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-check-types.log +4 -0
- package/.turbo/turbo-lint.log +5 -0
- package/dist/ai-sdk-integration.d.ts.map +1 -1
- package/dist/ai-sdk-integration.js +2 -2
- package/dist/claude-hooks.d.ts.map +1 -1
- package/dist/claude-hooks.js +3 -3
- package/dist/client.d.ts +42 -132
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +66 -365
- package/dist/client.js.map +1 -0
- package/dist/converters/claude.d.ts +5 -1
- package/dist/converters/claude.d.ts.map +1 -1
- package/dist/converters/claude.js +7 -0
- package/dist/converters/claude.js.map +1 -0
- package/dist/converters/gemini.d.ts +90 -0
- package/dist/converters/gemini.d.ts.map +1 -0
- package/dist/converters/gemini.js +171 -0
- package/dist/converters/gemini.js.map +1 -0
- package/dist/converters/index.d.ts +1 -1
- package/dist/converters/index.d.ts.map +1 -1
- package/dist/converters/index.js +2 -1
- package/dist/converters/index.js.map +1 -0
- package/dist/converters/openai.js +1 -0
- package/dist/converters/openai.js.map +1 -0
- package/dist/converters/openclaw.d.ts +16 -0
- package/dist/converters/openclaw.d.ts.map +1 -0
- package/dist/converters/openclaw.js +49 -0
- package/dist/converters/openinference.js +1 -0
- package/dist/converters/openinference.js.map +1 -0
- package/dist/converters/vercel.d.ts.map +1 -1
- package/dist/converters/vercel.js +31 -3
- package/dist/converters/vercel.js.map +1 -0
- package/dist/http.d.ts +36 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +145 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +24 -27
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -32
- package/dist/index.js.map +1 -0
- package/dist/langchain-handler.d.ts.map +1 -1
- package/dist/langchain-handler.js +2 -2
- package/dist/mastra-exporter.d.ts.map +1 -1
- package/dist/mastra-exporter.js +2 -2
- package/dist/otel/anthropic.d.ts +62 -0
- package/dist/otel/anthropic.d.ts.map +1 -0
- package/dist/otel/anthropic.js +425 -0
- package/dist/otel/anthropic.js.map +1 -0
- package/dist/otel/claude-hooks.d.ts +346 -0
- package/dist/otel/claude-hooks.d.ts.map +1 -0
- package/dist/otel/claude-hooks.js +645 -0
- package/dist/otel/claude-hooks.js.map +1 -0
- package/dist/otel/claude-wrapper.d.ts +93 -0
- package/dist/otel/claude-wrapper.d.ts.map +1 -0
- package/dist/otel/claude-wrapper.js +155 -0
- package/dist/otel/claude-wrapper.js.map +1 -0
- package/dist/otel/gemini.d.ts +48 -0
- package/dist/otel/gemini.d.ts.map +1 -0
- package/dist/otel/gemini.js +297 -0
- package/dist/otel/gemini.js.map +1 -0
- package/dist/otel/index.d.ts +27 -0
- package/dist/otel/index.d.ts.map +1 -0
- package/dist/otel/index.js +33 -0
- package/dist/otel/index.js.map +1 -0
- package/dist/otel/langchain-handler.d.ts +112 -0
- package/dist/otel/langchain-handler.d.ts.map +1 -0
- package/dist/otel/langchain-handler.js +555 -0
- package/dist/otel/langchain-handler.js.map +1 -0
- package/dist/otel/logs.d.ts +82 -0
- package/dist/otel/logs.d.ts.map +1 -0
- package/dist/otel/logs.js +271 -0
- package/dist/otel/logs.js.map +1 -0
- package/dist/otel/mastra-exporter.d.ts +87 -0
- package/dist/otel/mastra-exporter.d.ts.map +1 -0
- package/dist/otel/mastra-exporter.js +525 -0
- package/dist/otel/mastra-exporter.js.map +1 -0
- package/dist/otel/pi.d.ts +59 -0
- package/dist/otel/pi.d.ts.map +1 -0
- package/dist/otel/pi.js +67 -0
- package/dist/otel/pi.js.map +1 -0
- package/dist/otel/setup.d.ts +23 -0
- package/dist/otel/setup.d.ts.map +1 -0
- package/dist/otel/setup.js +127 -0
- package/dist/otel/setup.js.map +1 -0
- package/dist/otel/span-processor.d.ts +62 -0
- package/dist/otel/span-processor.d.ts.map +1 -0
- package/dist/otel/span-processor.js +319 -0
- package/dist/otel/span-processor.js.map +1 -0
- package/dist/otel/tracing-processor.d.ts +139 -0
- package/dist/otel/tracing-processor.d.ts.map +1 -0
- package/dist/otel/tracing-processor.js +418 -0
- package/dist/otel/tracing-processor.js.map +1 -0
- package/dist/resources/experiments.d.ts +31 -0
- package/dist/resources/experiments.d.ts.map +1 -0
- package/dist/resources/experiments.js +133 -0
- package/dist/resources/experiments.js.map +1 -0
- package/dist/resources/recipes.d.ts +22 -0
- package/dist/resources/recipes.d.ts.map +1 -0
- package/dist/resources/recipes.js +61 -0
- package/dist/resources/recipes.js.map +1 -0
- package/dist/resources/runtimes.d.ts +76 -0
- package/dist/resources/runtimes.d.ts.map +1 -0
- package/dist/resources/runtimes.js +179 -0
- package/dist/resources/runtimes.js.map +1 -0
- package/dist/runner-resources/files.d.ts +35 -0
- package/dist/runner-resources/files.d.ts.map +1 -0
- package/dist/runner-resources/files.js +131 -0
- package/dist/runner-resources/files.js.map +1 -0
- package/dist/runner-resources/tasks.d.ts +39 -0
- package/dist/runner-resources/tasks.d.ts.map +1 -0
- package/dist/runner-resources/tasks.js +129 -0
- package/dist/runner-resources/tasks.js.map +1 -0
- package/dist/runner.d.ts +80 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +159 -0
- package/dist/runner.js.map +1 -0
- package/dist/span-processor.d.ts.map +1 -1
- package/dist/span-processor.js +3 -3
- package/dist/streaming.d.ts +8 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/streaming.js +67 -0
- package/dist/streaming.js.map +1 -0
- package/dist/tracing-processor.d.ts.map +1 -1
- package/dist/tracing-processor.js +3 -3
- package/dist/types/genai.d.ts +165 -0
- package/dist/types/genai.d.ts.map +1 -0
- package/dist/types/genai.js +82 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +14 -0
- package/dist/utils.js.map +1 -0
- package/dist/version.js +1 -0
- package/dist/version.js.map +1 -0
- package/package.json +83 -25
- package/src/client.ts +76 -471
- package/src/converters/claude.ts +11 -1
- package/src/converters/gemini.ts +243 -0
- package/src/converters/index.ts +13 -7
- package/src/converters/vercel.ts +41 -3
- package/src/http.ts +163 -0
- package/src/index.ts +110 -75
- package/src/{anthropic.ts → otel/anthropic.ts} +95 -8
- package/src/{claude-hooks.ts → otel/claude-hooks.ts} +125 -24
- package/src/{claude-wrapper.ts → otel/claude-wrapper.ts} +1 -1
- package/src/otel/gemini.ts +397 -0
- package/src/otel/index.ts +80 -0
- package/src/{langchain-handler.ts → otel/langchain-handler.ts} +56 -7
- package/src/otel/logs.ts +394 -0
- package/src/{mastra-exporter.ts → otel/mastra-exporter.ts} +86 -23
- package/src/otel/pi.ts +88 -0
- package/src/otel/setup.ts +174 -0
- package/src/{span-processor.ts → otel/span-processor.ts} +17 -10
- package/src/{tracing-processor.ts → otel/tracing-processor.ts} +100 -23
- package/src/resources/experiments.ts +170 -0
- package/src/resources/recipes.ts +73 -0
- package/src/resources/runtimes.ts +231 -0
- package/src/runner-resources/files.ts +163 -0
- package/src/runner-resources/tasks.ts +156 -0
- package/src/runner.ts +194 -0
- package/src/streaming.ts +57 -0
- package/src/utils.ts +15 -0
- package/src/ai-sdk-integration.ts +0 -689
- package/src/converters/ai-sdk.ts +0 -323
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a `text/event-stream` Response into an async-iterable of SSE
|
|
3
|
+
* events. Minimal parser: handles `event:`, `data:` (multi-line),
|
|
4
|
+
* `id:`, `retry:`; ignores comments and unknown fields.
|
|
5
|
+
*/
|
|
6
|
+
export async function* parseSse(res) {
|
|
7
|
+
if (!res.body)
|
|
8
|
+
return;
|
|
9
|
+
const reader = res.body.getReader();
|
|
10
|
+
const decoder = new TextDecoder();
|
|
11
|
+
let buf = "";
|
|
12
|
+
let event = "message";
|
|
13
|
+
let data = [];
|
|
14
|
+
let id;
|
|
15
|
+
let retry;
|
|
16
|
+
const flush = () => {
|
|
17
|
+
if (data.length === 0 && event === "message" && id === undefined)
|
|
18
|
+
return null;
|
|
19
|
+
const ev = { event, data: data.join("\n") };
|
|
20
|
+
if (id !== undefined)
|
|
21
|
+
ev.id = id;
|
|
22
|
+
if (retry !== undefined)
|
|
23
|
+
ev.retry = retry;
|
|
24
|
+
event = "message";
|
|
25
|
+
data = [];
|
|
26
|
+
id = undefined;
|
|
27
|
+
retry = undefined;
|
|
28
|
+
return ev;
|
|
29
|
+
};
|
|
30
|
+
while (true) {
|
|
31
|
+
const { value, done } = await reader.read();
|
|
32
|
+
if (done)
|
|
33
|
+
break;
|
|
34
|
+
buf += decoder.decode(value, { stream: true });
|
|
35
|
+
let nl;
|
|
36
|
+
while ((nl = buf.indexOf("\n")) >= 0) {
|
|
37
|
+
const line = buf.slice(0, nl).replace(/\r$/, "");
|
|
38
|
+
buf = buf.slice(nl + 1);
|
|
39
|
+
if (line === "") {
|
|
40
|
+
const ev = flush();
|
|
41
|
+
if (ev)
|
|
42
|
+
yield ev;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (line.startsWith(":"))
|
|
46
|
+
continue;
|
|
47
|
+
const colon = line.indexOf(":");
|
|
48
|
+
const field = colon < 0 ? line : line.slice(0, colon);
|
|
49
|
+
const valueRaw = colon < 0 ? "" : line.slice(colon + 1).replace(/^ /, "");
|
|
50
|
+
if (field === "event")
|
|
51
|
+
event = valueRaw;
|
|
52
|
+
else if (field === "data")
|
|
53
|
+
data.push(valueRaw);
|
|
54
|
+
else if (field === "id")
|
|
55
|
+
id = valueRaw;
|
|
56
|
+
else if (field === "retry") {
|
|
57
|
+
const n = Number(valueRaw);
|
|
58
|
+
if (Number.isFinite(n))
|
|
59
|
+
retry = n;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const ev = flush();
|
|
64
|
+
if (ev)
|
|
65
|
+
yield ev;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=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eAAe,CAAsB;IAC7C,OAAO,CAAC,OAAO,CAA+C;IAC9D,OAAO,CAAC,MAAM,CAAoC;IAClD,OAAO,CAAC,gBAAgB,CAAkC;gBAE9C,OAAO,GAAE,oCAAyC;IA2F9D;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;;;OAIG;IACG,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAW/C;;;;OAIG;IACG,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAa7C;;;;OAIG;IACG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BtD;;;;;OAKG;IACG,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA6CpD;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA0BzB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgB5B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA0F5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAwC9B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGlC"}
|
|
@@ -11,7 +11,7 @@ import { ATTR_SERVICE_NAME } from "@opentelemetry/semantic-conventions";
|
|
|
11
11
|
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
|
|
12
12
|
import { randomUUID } from "crypto";
|
|
13
13
|
import { convertResponsesInputsToSemconv, convertResponsesOutputsToSemconv, convertResponsesToolsToSemconv, convertResponsesInstructionsToSemconv, } from "./converters/openai.js";
|
|
14
|
-
import { logger } from "./utils.js";
|
|
14
|
+
import { logger, withOtlpHttpsProxy } from "./utils.js";
|
|
15
15
|
import { VERSION } from "./version.js";
|
|
16
16
|
/**
|
|
17
17
|
* {@link TracingProcessor} that forwards OpenAI agent traces to the
|
|
@@ -63,10 +63,10 @@ export class IntrospectionTracingProcessor {
|
|
|
63
63
|
: `${baseUrl.replace(/\/$/, "")}/v1/traces`;
|
|
64
64
|
logger.info(`IntrospectionTracingProcessor initialized: endpoint=${endpoint}`);
|
|
65
65
|
// Setup OTLP exporter
|
|
66
|
-
const spanExporter = new OTLPTraceExporter({
|
|
66
|
+
const spanExporter = new OTLPTraceExporter(withOtlpHttpsProxy({
|
|
67
67
|
url: endpoint,
|
|
68
68
|
headers,
|
|
69
|
-
});
|
|
69
|
+
}));
|
|
70
70
|
// Use SimpleSpanProcessor for maxExportBatchSize=1 (sequential export),
|
|
71
71
|
// otherwise BatchSpanProcessor with configurable batch size.
|
|
72
72
|
// Default to sequential export for dev/staging tokens.
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OTel Gen AI Semantic Convention types.
|
|
3
|
+
*
|
|
4
|
+
* These types represent the standardized format for gen_ai.input.messages
|
|
5
|
+
* and gen_ai.output.messages attributes as per OpenTelemetry Gen AI semantic conventions.
|
|
6
|
+
*
|
|
7
|
+
* @see https://opentelemetry.io/docs/specs/semconv/gen-ai/
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A text content part in a message.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const part: TextPart = { type: "text", content: "Hello" };
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export interface TextPart {
|
|
18
|
+
/** Discriminator — always `"text"`. */
|
|
19
|
+
type: "text";
|
|
20
|
+
/** The text body of this part. */
|
|
21
|
+
content: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A tool / function-call request part in a message.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const part: ToolCallRequestPart = { type: "tool_call", name: "get_weather", arguments: { city: "SF" } };
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export interface ToolCallRequestPart {
|
|
32
|
+
/** Discriminator — always `"tool_call"`. */
|
|
33
|
+
type: "tool_call";
|
|
34
|
+
/** Function / tool name. */
|
|
35
|
+
name: string;
|
|
36
|
+
/** Correlation ID linking request to response. */
|
|
37
|
+
id?: string;
|
|
38
|
+
/** Arguments passed to the tool. */
|
|
39
|
+
arguments?: unknown;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A tool / function-call response part in a message.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const part: ToolCallResponsePart = { type: "tool_call_response", response: "72°F" };
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export interface ToolCallResponsePart {
|
|
50
|
+
/** Discriminator — always `"tool_call_response"`. */
|
|
51
|
+
type: "tool_call_response";
|
|
52
|
+
/** The value returned by the tool. */
|
|
53
|
+
response: unknown;
|
|
54
|
+
/** Correlation ID linking response to request. */
|
|
55
|
+
id?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A reasoning / thinking content part in a message.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const part: ReasoningPart = { type: "thinking", content: "Let me think through this..." };
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export interface ReasoningPart {
|
|
66
|
+
/** Discriminator — always `"thinking"`. */
|
|
67
|
+
type: "thinking";
|
|
68
|
+
/** The reasoning / thinking summary content. */
|
|
69
|
+
content?: string;
|
|
70
|
+
/** Encrypted reasoning signature (maps to OpenAI encrypted_content, Anthropic signature/redacted_thinking data). */
|
|
71
|
+
signature?: string;
|
|
72
|
+
/** Provider that produced this thinking block (e.g. `"anthropic"`, `"openai"`). Used to reconstruct the correct wire format on replay. */
|
|
73
|
+
provider_name?: string;
|
|
74
|
+
}
|
|
75
|
+
/** Union of all possible message-part shapes. */
|
|
76
|
+
export type MessagePart = TextPart | ToolCallRequestPart | ToolCallResponsePart | ReasoningPart;
|
|
77
|
+
/**
|
|
78
|
+
* A system instruction entry for `gen_ai.system_instructions`.
|
|
79
|
+
*/
|
|
80
|
+
export interface SystemInstruction {
|
|
81
|
+
/** Part type — always `"text"`. */
|
|
82
|
+
type: "text";
|
|
83
|
+
/** The instruction text content. */
|
|
84
|
+
content: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* An input message in OTel Gen AI semantic convention format.
|
|
88
|
+
*
|
|
89
|
+
* Used for the `gen_ai.input.messages` span attribute.
|
|
90
|
+
*/
|
|
91
|
+
export interface InputMessage {
|
|
92
|
+
/** The role of the message sender. */
|
|
93
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
94
|
+
/** Ordered content parts that compose this message. */
|
|
95
|
+
parts: MessagePart[];
|
|
96
|
+
/** Optional tool name when `role` is `"tool"`. */
|
|
97
|
+
name?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* An output message in OTel Gen AI semantic convention format.
|
|
101
|
+
*
|
|
102
|
+
* Used for the `gen_ai.output.messages` span attribute.
|
|
103
|
+
*/
|
|
104
|
+
export interface OutputMessage {
|
|
105
|
+
/** The role of the message sender. */
|
|
106
|
+
role: "system" | "user" | "assistant" | "tool";
|
|
107
|
+
/** Ordered content parts that compose this message. */
|
|
108
|
+
parts: MessagePart[];
|
|
109
|
+
/** Model-reported finish reason (e.g. `"stop"`, `"end_turn"`). */
|
|
110
|
+
finish_reason?: string;
|
|
111
|
+
/** Optional tool name when `role` is `"tool"`. */
|
|
112
|
+
name?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* A tool definition for the `gen_ai.tool.definitions` attribute.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* const def: ToolDefinition = { name: "get_weather", description: "Get current weather" };
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export interface ToolDefinition {
|
|
123
|
+
/** Tool / function name. */
|
|
124
|
+
name: string;
|
|
125
|
+
/** Human-readable description of what the tool does. */
|
|
126
|
+
description?: string;
|
|
127
|
+
/** JSON Schema describing the tool's parameters. */
|
|
128
|
+
parameters?: Record<string, unknown>;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* GenAI semantic convention attributes.
|
|
132
|
+
*
|
|
133
|
+
* This interface represents the standardized GenAI attributes that can be
|
|
134
|
+
* converted to OpenTelemetry semantic convention format (gen_ai.* with dots).
|
|
135
|
+
*
|
|
136
|
+
* All properties use camelCase following TypeScript conventions.
|
|
137
|
+
*/
|
|
138
|
+
export interface GenAiAttributes {
|
|
139
|
+
/** Model name (gen_ai.request.model) */
|
|
140
|
+
requestModel?: string;
|
|
141
|
+
/** System prompt (gen_ai.system) */
|
|
142
|
+
system?: string;
|
|
143
|
+
/** Operation name (gen_ai.operation.name) */
|
|
144
|
+
operationName?: string;
|
|
145
|
+
/** Tool definitions (gen_ai.tool.definitions) — serialized to JSON by {@link toAttributes}. */
|
|
146
|
+
toolDefinitions?: ToolDefinition[];
|
|
147
|
+
/** Input messages (gen_ai.input.messages) — serialized to JSON by {@link toAttributes}. */
|
|
148
|
+
inputMessages?: InputMessage[];
|
|
149
|
+
/** Output messages (gen_ai.output.messages) — serialized to JSON by {@link toAttributes}. */
|
|
150
|
+
outputMessages?: OutputMessage[];
|
|
151
|
+
/** System instructions (gen_ai.system_instructions) — serialized to JSON by {@link toAttributes}. */
|
|
152
|
+
systemInstructions?: SystemInstruction[];
|
|
153
|
+
/** Response ID (gen_ai.response.id) */
|
|
154
|
+
responseId?: string;
|
|
155
|
+
/** Input token count (gen_ai.usage.input_tokens) */
|
|
156
|
+
inputTokens?: number;
|
|
157
|
+
/** Output token count (gen_ai.usage.output_tokens) */
|
|
158
|
+
outputTokens?: number;
|
|
159
|
+
/** Cache creation input tokens (gen_ai.usage.cache_creation_input_tokens) */
|
|
160
|
+
cacheCreationInputTokens?: number;
|
|
161
|
+
/** Cache read input tokens (gen_ai.usage.cache_read_input_tokens) */
|
|
162
|
+
cacheReadInputTokens?: number;
|
|
163
|
+
}
|
|
164
|
+
export declare function toAttributes(attrs: GenAiAttributes): Record<string, string | number>;
|
|
165
|
+
//# sourceMappingURL=genai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genai.d.ts","sourceRoot":"","sources":["../../src/types/genai.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,4CAA4C;IAC5C,IAAI,EAAE,WAAW,CAAC;IAClB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,IAAI,EAAE,oBAAoB,CAAC;IAC3B,sCAAsC;IACtC,QAAQ,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,2CAA2C;IAC3C,IAAI,EAAE,UAAU,CAAC;IACjB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oHAAoH;IACpH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0IAA0I;IAC1I,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iDAAiD;AACjD,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,mBAAmB,G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CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,qGAAqG;IACrG,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACzC,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qEAAqE;IACrE,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAmCD,wBAAgB,YAAY,CAC1B,KAAK,EAAE,eAAe,GACrB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAkDjC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OTel Gen AI Semantic Convention types.
|
|
3
|
+
*
|
|
4
|
+
* These types represent the standardized format for gen_ai.input.messages
|
|
5
|
+
* and gen_ai.output.messages attributes as per OpenTelemetry Gen AI semantic conventions.
|
|
6
|
+
*
|
|
7
|
+
* @see https://opentelemetry.io/docs/specs/semconv/gen-ai/
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Convert a {@link GenAiAttributes} object to an OTel-compatible attributes
|
|
11
|
+
* dictionary with `gen_ai.*` dot-notation keys.
|
|
12
|
+
*
|
|
13
|
+
* Properties that are `undefined` are omitted from the result.
|
|
14
|
+
*
|
|
15
|
+
* @param attrs - The camelCase {@link GenAiAttributes} to convert.
|
|
16
|
+
* @returns A flat `Record<string, string | number>` with OTel semconv keys.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const otel = toAttributes({ requestModel: "gpt-4", inputTokens: 42 });
|
|
21
|
+
* // { "gen_ai.request.model": "gpt-4", "gen_ai.usage.input_tokens": 42 }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Recursively strip `undefined` and `null` values from an object before
|
|
26
|
+
* JSON serialization. Equivalent to Python's `model_dump(exclude_none=True)`.
|
|
27
|
+
*/
|
|
28
|
+
function stripNullish(obj) {
|
|
29
|
+
if (Array.isArray(obj))
|
|
30
|
+
return obj.map(stripNullish);
|
|
31
|
+
if (obj !== null && typeof obj === "object") {
|
|
32
|
+
const out = {};
|
|
33
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
34
|
+
if (value !== undefined && value !== null) {
|
|
35
|
+
out[key] = stripNullish(value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return out;
|
|
39
|
+
}
|
|
40
|
+
return obj;
|
|
41
|
+
}
|
|
42
|
+
export function toAttributes(attrs) {
|
|
43
|
+
const result = {};
|
|
44
|
+
if (attrs.requestModel !== undefined) {
|
|
45
|
+
result["gen_ai.request.model"] = attrs.requestModel;
|
|
46
|
+
}
|
|
47
|
+
if (attrs.system !== undefined) {
|
|
48
|
+
result["gen_ai.system"] = attrs.system;
|
|
49
|
+
}
|
|
50
|
+
if (attrs.operationName !== undefined) {
|
|
51
|
+
result["gen_ai.operation.name"] = attrs.operationName;
|
|
52
|
+
}
|
|
53
|
+
if (attrs.toolDefinitions !== undefined) {
|
|
54
|
+
result["gen_ai.tool.definitions"] = JSON.stringify(stripNullish(attrs.toolDefinitions));
|
|
55
|
+
}
|
|
56
|
+
if (attrs.inputMessages !== undefined) {
|
|
57
|
+
result["gen_ai.input.messages"] = JSON.stringify(stripNullish(attrs.inputMessages));
|
|
58
|
+
}
|
|
59
|
+
if (attrs.outputMessages !== undefined) {
|
|
60
|
+
result["gen_ai.output.messages"] = JSON.stringify(stripNullish(attrs.outputMessages));
|
|
61
|
+
}
|
|
62
|
+
if (attrs.systemInstructions !== undefined) {
|
|
63
|
+
result["gen_ai.system_instructions"] = JSON.stringify(stripNullish(attrs.systemInstructions));
|
|
64
|
+
}
|
|
65
|
+
if (attrs.responseId !== undefined) {
|
|
66
|
+
result["gen_ai.response.id"] = attrs.responseId;
|
|
67
|
+
}
|
|
68
|
+
if (attrs.inputTokens !== undefined) {
|
|
69
|
+
result["gen_ai.usage.input_tokens"] = attrs.inputTokens;
|
|
70
|
+
}
|
|
71
|
+
if (attrs.outputTokens !== undefined) {
|
|
72
|
+
result["gen_ai.usage.output_tokens"] = attrs.outputTokens;
|
|
73
|
+
}
|
|
74
|
+
if (attrs.cacheCreationInputTokens !== undefined) {
|
|
75
|
+
result["gen_ai.usage.cache_creation.input_tokens"] =
|
|
76
|
+
attrs.cacheCreationInputTokens;
|
|
77
|
+
}
|
|
78
|
+
if (attrs.cacheReadInputTokens !== undefined) {
|
|
79
|
+
result["gen_ai.usage.cache_read.input_tokens"] = attrs.cacheReadInputTokens;
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
package/dist/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/utils.d.ts
CHANGED
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAO9D,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAQlE;AAED;;;GAGG;AACH,cAAM,mBAAoB,YAAW,UAAU;IAC7C,OAAO,CAAC,QAAQ,CAAe;;IAS/B,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,SAAS;IAIjB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM9B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/B,OAAO,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAKlC;AAED,eAAO,MAAM,MAAM,qBAA4B,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import { DiagLogLevel } from "@opentelemetry/api";
|
|
2
|
+
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
3
|
+
function getHttpsProxyUrl() {
|
|
4
|
+
return process.env.HTTPS_PROXY || undefined;
|
|
5
|
+
}
|
|
6
|
+
export function withOtlpHttpsProxy(options) {
|
|
7
|
+
const proxyUrl = getHttpsProxyUrl();
|
|
8
|
+
if (!proxyUrl)
|
|
9
|
+
return options;
|
|
10
|
+
return {
|
|
11
|
+
...options,
|
|
12
|
+
httpAgentOptions: () => new HttpsProxyAgent(proxyUrl),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
2
15
|
/**
|
|
3
16
|
* Logger for introspection-sdk package.
|
|
4
17
|
* Uses OpenTelemetry's diagnostic logger.
|
|
@@ -55,3 +68,4 @@ class IntrospectionLogger {
|
|
|
55
68
|
}
|
|
56
69
|
}
|
|
57
70
|
export const logger = new IntrospectionLogger();
|
|
71
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAc,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,SAAS,gBAAgB;IACvB,OAAO,OAAO,CAAC,GAA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IAAI,CAAC,GAAG,IAAe;QACrB,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,IAAI,CAAC,GAAG,IAAe;QACrB,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG,IAAe;QACtB,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,IAAe;QACxB,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YACzC,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
|
package/dist/version.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@introspection-sdk/introspection-node",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Introspection observability SDK for Node.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,26 +11,42 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
13
|
},
|
|
14
|
+
"./otel": {
|
|
15
|
+
"types": "./dist/otel/index.d.ts",
|
|
16
|
+
"default": "./dist/otel/index.js"
|
|
17
|
+
},
|
|
14
18
|
"./mastra": {
|
|
15
|
-
"types": "./dist/mastra-exporter.d.ts",
|
|
16
|
-
"default": "./dist/mastra-exporter.js"
|
|
19
|
+
"types": "./dist/otel/mastra-exporter.d.ts",
|
|
20
|
+
"default": "./dist/otel/mastra-exporter.js"
|
|
17
21
|
},
|
|
18
22
|
"./langchain": {
|
|
19
|
-
"types": "./dist/langchain-handler.d.ts",
|
|
20
|
-
"default": "./dist/langchain-handler.js"
|
|
23
|
+
"types": "./dist/otel/langchain-handler.d.ts",
|
|
24
|
+
"default": "./dist/otel/langchain-handler.js"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"devDependencies": {
|
|
24
|
-
"@openai/agents": "^0.
|
|
25
|
-
"@
|
|
26
|
-
"
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
28
|
+
"@openai/agents": "^0.11.5",
|
|
29
|
+
"@opentelemetry/api-logs": "^0.218.0",
|
|
30
|
+
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
31
|
+
"@opentelemetry/core": "^2.7.1",
|
|
32
|
+
"@opentelemetry/exporter-logs-otlp-proto": "^0.218.0",
|
|
33
|
+
"@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
|
|
34
|
+
"@opentelemetry/resources": "^2.7.1",
|
|
35
|
+
"@opentelemetry/sdk-logs": "^0.218.0",
|
|
36
|
+
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
37
|
+
"@opentelemetry/sdk-trace-node": "^2.7.1",
|
|
38
|
+
"@opentelemetry/semantic-conventions": "^1.41.1",
|
|
39
|
+
"@types/node": "^22.19.19",
|
|
40
|
+
"eslint": "^9.39.4",
|
|
41
|
+
"@langchain/core": "^1.1.48",
|
|
42
|
+
"@mastra/core": "^1.37.1",
|
|
43
|
+
"@mastra/observability": "^1.14.0",
|
|
44
|
+
"@mariozechner/pi-agent-core": "^0.73.1",
|
|
45
|
+
"@mariozechner/pi-ai": "^0.73.1",
|
|
46
|
+
"openai": "^6.39.1",
|
|
31
47
|
"typescript": "5.9.3",
|
|
32
|
-
"@repo/
|
|
33
|
-
"@repo/
|
|
48
|
+
"@repo/typescript-config": "0.0.0",
|
|
49
|
+
"@repo/eslint-config": "0.0.0"
|
|
34
50
|
},
|
|
35
51
|
"peerDependencies": {
|
|
36
52
|
"@openai/agents": ">=0.0.1",
|
|
@@ -38,7 +54,19 @@
|
|
|
38
54
|
"ai": ">=4.0.0",
|
|
39
55
|
"@mastra/core": ">=1.0.0",
|
|
40
56
|
"@mastra/observability": ">=1.0.0",
|
|
41
|
-
"@langchain/core": ">=0.3.0"
|
|
57
|
+
"@langchain/core": ">=0.3.0",
|
|
58
|
+
"@mariozechner/pi-agent-core": ">=0.70.0",
|
|
59
|
+
"@mariozechner/pi-ai": ">=0.70.0",
|
|
60
|
+
"@opentelemetry/api-logs": ">=0.50.0",
|
|
61
|
+
"@opentelemetry/context-async-hooks": ">=1.20.0 || >=2.0.0",
|
|
62
|
+
"@opentelemetry/core": ">=1.20.0 || >=2.0.0",
|
|
63
|
+
"@opentelemetry/exporter-logs-otlp-proto": ">=0.50.0",
|
|
64
|
+
"@opentelemetry/exporter-trace-otlp-proto": ">=0.50.0",
|
|
65
|
+
"@opentelemetry/resources": ">=1.20.0 || >=2.0.0",
|
|
66
|
+
"@opentelemetry/sdk-logs": ">=0.50.0",
|
|
67
|
+
"@opentelemetry/sdk-trace-base": ">=1.20.0 || >=2.0.0",
|
|
68
|
+
"@opentelemetry/sdk-trace-node": ">=1.20.0 || >=2.0.0",
|
|
69
|
+
"@opentelemetry/semantic-conventions": ">=1.20.0"
|
|
42
70
|
},
|
|
43
71
|
"peerDependenciesMeta": {
|
|
44
72
|
"@openai/agents": {
|
|
@@ -58,19 +86,49 @@
|
|
|
58
86
|
},
|
|
59
87
|
"@langchain/core": {
|
|
60
88
|
"optional": true
|
|
89
|
+
},
|
|
90
|
+
"@mariozechner/pi-agent-core": {
|
|
91
|
+
"optional": true
|
|
92
|
+
},
|
|
93
|
+
"@mariozechner/pi-ai": {
|
|
94
|
+
"optional": true
|
|
95
|
+
},
|
|
96
|
+
"@opentelemetry/api-logs": {
|
|
97
|
+
"optional": true
|
|
98
|
+
},
|
|
99
|
+
"@opentelemetry/context-async-hooks": {
|
|
100
|
+
"optional": true
|
|
101
|
+
},
|
|
102
|
+
"@opentelemetry/core": {
|
|
103
|
+
"optional": true
|
|
104
|
+
},
|
|
105
|
+
"@opentelemetry/exporter-logs-otlp-proto": {
|
|
106
|
+
"optional": true
|
|
107
|
+
},
|
|
108
|
+
"@opentelemetry/exporter-trace-otlp-proto": {
|
|
109
|
+
"optional": true
|
|
110
|
+
},
|
|
111
|
+
"@opentelemetry/resources": {
|
|
112
|
+
"optional": true
|
|
113
|
+
},
|
|
114
|
+
"@opentelemetry/sdk-logs": {
|
|
115
|
+
"optional": true
|
|
116
|
+
},
|
|
117
|
+
"@opentelemetry/sdk-trace-base": {
|
|
118
|
+
"optional": true
|
|
119
|
+
},
|
|
120
|
+
"@opentelemetry/sdk-trace-node": {
|
|
121
|
+
"optional": true
|
|
122
|
+
},
|
|
123
|
+
"@opentelemetry/semantic-conventions": {
|
|
124
|
+
"optional": true
|
|
61
125
|
}
|
|
62
126
|
},
|
|
63
127
|
"dependencies": {
|
|
64
|
-
"@opentelemetry/api": "^1.9.
|
|
65
|
-
"
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@opentelemetry/exporter-trace-otlp-proto": "^0.213.0",
|
|
69
|
-
"@opentelemetry/resources": "^2.6.0",
|
|
70
|
-
"@opentelemetry/sdk-logs": "^0.213.0",
|
|
71
|
-
"@opentelemetry/sdk-trace-base": "^2.6.0",
|
|
72
|
-
"@opentelemetry/semantic-conventions": "^1.40.0",
|
|
73
|
-
"@introspection-sdk/types": "0.4.1"
|
|
128
|
+
"@opentelemetry/api": "^1.9.1",
|
|
129
|
+
"https-proxy-agent": "^7.0.6",
|
|
130
|
+
"@introspection-sdk/types": "0.4.3",
|
|
131
|
+
"@introspection-sdk/introspection-pi": "0.4.3"
|
|
74
132
|
},
|
|
75
133
|
"scripts": {
|
|
76
134
|
"lint": "eslint . --max-warnings 0",
|