@runtypelabs/flue-otel 0.5.10 → 0.5.11
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/dist/index.cjs +9 -17
- package/dist/index.d.cts +0 -12
- package/dist/index.d.ts +0 -12
- package/dist/index.mjs +9 -17
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
3
|
-
|
|
3
|
+
// src/compat.ts
|
|
4
4
|
/**
|
|
5
5
|
* Infer implementation class only from datastore semantics or the framework task tool. Origin
|
|
6
6
|
* identifies who initiated a call, not its tool type; unsupported classes remain undefined.
|
|
@@ -66,8 +66,7 @@ const ERROR_REASONS = /* @__PURE__ */ new Set([
|
|
|
66
66
|
function mapSettlementOutcome(outcome) {
|
|
67
67
|
if (outcome === "failed" || outcome === "aborted") return "error";
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
//#region src/messages.ts
|
|
69
|
+
// src/messages.ts
|
|
71
70
|
const ROLES = /* @__PURE__ */ new Set([
|
|
72
71
|
"system",
|
|
73
72
|
"user",
|
|
@@ -193,8 +192,7 @@ function contentMessageText(message) {
|
|
|
193
192
|
function isRecord(value) {
|
|
194
193
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
195
194
|
}
|
|
196
|
-
|
|
197
|
-
//#region src/content.ts
|
|
195
|
+
// src/content.ts
|
|
198
196
|
/**
|
|
199
197
|
* The default per-value ceiling: 64 KiB of ASCII. Large enough for any
|
|
200
198
|
* realistic tool argument object and most results, and small enough that
|
|
@@ -383,11 +381,9 @@ function truncationMarker(droppedChars) {
|
|
|
383
381
|
function isHighSurrogate(code) {
|
|
384
382
|
return code >= 55296 && code <= 56319;
|
|
385
383
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
//#endregion
|
|
390
|
-
//#region src/semconv.ts
|
|
384
|
+
// package.json
|
|
385
|
+
var version = "0.5.11";
|
|
386
|
+
// src/semconv.ts
|
|
391
387
|
/**
|
|
392
388
|
* GenAI semantic-convention attribute names. Mirrors the subset of
|
|
393
389
|
* `packages/shared/src/gen-ai-semconv.ts` this instrumentation can populate
|
|
@@ -516,8 +512,7 @@ const RUNTYPE_SCHEMA_VERSION = "1";
|
|
|
516
512
|
const ADAPTER_NAME = "@runtypelabs/flue-otel";
|
|
517
513
|
/** What this package reports itself as in `runtype.adapter.version`. */
|
|
518
514
|
const ADAPTER_VERSION = version;
|
|
519
|
-
|
|
520
|
-
//#region src/projection.ts
|
|
515
|
+
// src/projection.ts
|
|
521
516
|
/**
|
|
522
517
|
* Resource attributes for the customer's `Resource`. Exported rather than set
|
|
523
518
|
* internally because this package owns none of the SDK: the provider, the
|
|
@@ -1251,8 +1246,7 @@ function toolKey(value) {
|
|
|
1251
1246
|
function identityKey(kind, fields) {
|
|
1252
1247
|
return JSON.stringify([kind, ...fields.map((value) => value ?? null)]);
|
|
1253
1248
|
}
|
|
1254
|
-
|
|
1255
|
-
//#region src/spans.ts
|
|
1249
|
+
// src/spans.ts
|
|
1256
1250
|
function createSpanDriver(tracer) {
|
|
1257
1251
|
const live = /* @__PURE__ */ new Map();
|
|
1258
1252
|
function apply(intents) {
|
|
@@ -1315,8 +1309,7 @@ function toDate(value) {
|
|
|
1315
1309
|
const date = new Date(value);
|
|
1316
1310
|
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
1317
1311
|
}
|
|
1318
|
-
|
|
1319
|
-
//#region src/index.ts
|
|
1312
|
+
// src/index.ts
|
|
1320
1313
|
/**
|
|
1321
1314
|
* The instrumentation key. Distinct from stock's
|
|
1322
1315
|
* `Symbol.for('@flue/opentelemetry')` so `instrument()` treats the two as
|
|
@@ -1389,7 +1382,6 @@ function readIdField(operation, key) {
|
|
|
1389
1382
|
const value = operation[key];
|
|
1390
1383
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
1391
1384
|
}
|
|
1392
|
-
//#endregion
|
|
1393
1385
|
exports.ADAPTER_NAME = ADAPTER_NAME;
|
|
1394
1386
|
exports.ADAPTER_VERSION = ADAPTER_VERSION;
|
|
1395
1387
|
exports.DEFAULT_CONTENT_MAX_CHARS = DEFAULT_CONTENT_MAX_CHARS;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Tracer } from "@opentelemetry/api";
|
|
2
|
-
//#region src/flue-types.d.ts
|
|
3
2
|
/** Correlation fields stamped onto every delivered observation. */
|
|
4
3
|
interface FlueEventEnvelope {
|
|
5
4
|
/** Durable event-format version. `3` on both supported lines. */
|
|
@@ -236,8 +235,6 @@ interface FlueInstrumentation {
|
|
|
236
235
|
interceptor: FlueExecutionInterceptor;
|
|
237
236
|
dispose(): void | Promise<void>;
|
|
238
237
|
}
|
|
239
|
-
//#endregion
|
|
240
|
-
//#region src/messages.d.ts
|
|
241
238
|
/**
|
|
242
239
|
* One semconv structured message, the element shape of `gen_ai.input.messages`
|
|
243
240
|
* and `gen_ai.output.messages`. Text parts only; see the README's content section.
|
|
@@ -249,8 +246,6 @@ interface FlueContentMessage {
|
|
|
249
246
|
content: string;
|
|
250
247
|
}>;
|
|
251
248
|
}
|
|
252
|
-
//#endregion
|
|
253
|
-
//#region src/content.d.ts
|
|
254
249
|
/**
|
|
255
250
|
* What to emit. Every switch defaults to ON, so `{}` and an absent option both
|
|
256
251
|
* emit everything; set a switch to `false` to drop that one kind, or pass
|
|
@@ -322,8 +317,6 @@ export declare const DEFAULT_CONTENT_MAX_CHARS = 65536;
|
|
|
322
317
|
export declare const INGEST_CONTENT_ATTRIBUTE_CEILING = 262144;
|
|
323
318
|
/** The resolved, always-complete policy the projection consults. */
|
|
324
319
|
type FlueContentSetting = FlueContentOptions | false;
|
|
325
|
-
//#endregion
|
|
326
|
-
//#region src/projection.d.ts
|
|
327
320
|
/** Attribute values OTLP can carry. Deliberately narrower than OTel's type. */
|
|
328
321
|
type SpanAttributes = Record<string, string | number | boolean | string[]>;
|
|
329
322
|
/** Where a span sits relative to the process boundary. */
|
|
@@ -392,8 +385,6 @@ interface FlueProjectionOptions {
|
|
|
392
385
|
export declare function runtypeFlueResourceAttributes(resource?: {
|
|
393
386
|
agentId?: string | null;
|
|
394
387
|
}): SpanAttributes;
|
|
395
|
-
//#endregion
|
|
396
|
-
//#region src/semconv.d.ts
|
|
397
388
|
/**
|
|
398
389
|
* GenAI semantic-convention attribute names. Mirrors the subset of
|
|
399
390
|
* `packages/shared/src/gen-ai-semconv.ts` this instrumentation can populate
|
|
@@ -481,8 +472,6 @@ export declare const RUNTYPE_SCHEMA_VERSION = "1";
|
|
|
481
472
|
export declare const ADAPTER_NAME = "@runtypelabs/flue-otel";
|
|
482
473
|
/** What this package reports itself as in `runtype.adapter.version`. */
|
|
483
474
|
export declare const ADAPTER_VERSION: string;
|
|
484
|
-
//#endregion
|
|
485
|
-
//#region src/index.d.ts
|
|
486
475
|
/**
|
|
487
476
|
* The instrumentation key. Distinct from stock's
|
|
488
477
|
* `Symbol.for('@flue/opentelemetry')` so `instrument()` treats the two as
|
|
@@ -504,6 +493,5 @@ export interface RuntypeFlueInstrumentationOptions extends FlueProjectionOptions
|
|
|
504
493
|
* Runtype to avoid double counting.
|
|
505
494
|
*/
|
|
506
495
|
export declare function createRuntypeFlueInstrumentation(options?: RuntypeFlueInstrumentationOptions): FlueInstrumentation;
|
|
507
|
-
//#endregion
|
|
508
496
|
export type { FlueContentMessage, FlueContentOptions, FlueContentRedactContext, FlueContentSetting, FlueInstrumentation, FlueMessageContentKind, FlueProjectionOptions, RuntypeStopReason, RuntypeToolType, SpanAttributes, SpanIntent };
|
|
509
497
|
export {}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Tracer } from "@opentelemetry/api";
|
|
2
|
-
//#region src/flue-types.d.ts
|
|
3
2
|
/** Correlation fields stamped onto every delivered observation. */
|
|
4
3
|
interface FlueEventEnvelope {
|
|
5
4
|
/** Durable event-format version. `3` on both supported lines. */
|
|
@@ -236,8 +235,6 @@ interface FlueInstrumentation {
|
|
|
236
235
|
interceptor: FlueExecutionInterceptor;
|
|
237
236
|
dispose(): void | Promise<void>;
|
|
238
237
|
}
|
|
239
|
-
//#endregion
|
|
240
|
-
//#region src/messages.d.ts
|
|
241
238
|
/**
|
|
242
239
|
* One semconv structured message, the element shape of `gen_ai.input.messages`
|
|
243
240
|
* and `gen_ai.output.messages`. Text parts only; see the README's content section.
|
|
@@ -249,8 +246,6 @@ interface FlueContentMessage {
|
|
|
249
246
|
content: string;
|
|
250
247
|
}>;
|
|
251
248
|
}
|
|
252
|
-
//#endregion
|
|
253
|
-
//#region src/content.d.ts
|
|
254
249
|
/**
|
|
255
250
|
* What to emit. Every switch defaults to ON, so `{}` and an absent option both
|
|
256
251
|
* emit everything; set a switch to `false` to drop that one kind, or pass
|
|
@@ -322,8 +317,6 @@ export declare const DEFAULT_CONTENT_MAX_CHARS = 65536;
|
|
|
322
317
|
export declare const INGEST_CONTENT_ATTRIBUTE_CEILING = 262144;
|
|
323
318
|
/** The resolved, always-complete policy the projection consults. */
|
|
324
319
|
type FlueContentSetting = FlueContentOptions | false;
|
|
325
|
-
//#endregion
|
|
326
|
-
//#region src/projection.d.ts
|
|
327
320
|
/** Attribute values OTLP can carry. Deliberately narrower than OTel's type. */
|
|
328
321
|
type SpanAttributes = Record<string, string | number | boolean | string[]>;
|
|
329
322
|
/** Where a span sits relative to the process boundary. */
|
|
@@ -392,8 +385,6 @@ interface FlueProjectionOptions {
|
|
|
392
385
|
export declare function runtypeFlueResourceAttributes(resource?: {
|
|
393
386
|
agentId?: string | null;
|
|
394
387
|
}): SpanAttributes;
|
|
395
|
-
//#endregion
|
|
396
|
-
//#region src/semconv.d.ts
|
|
397
388
|
/**
|
|
398
389
|
* GenAI semantic-convention attribute names. Mirrors the subset of
|
|
399
390
|
* `packages/shared/src/gen-ai-semconv.ts` this instrumentation can populate
|
|
@@ -481,8 +472,6 @@ export declare const RUNTYPE_SCHEMA_VERSION = "1";
|
|
|
481
472
|
export declare const ADAPTER_NAME = "@runtypelabs/flue-otel";
|
|
482
473
|
/** What this package reports itself as in `runtype.adapter.version`. */
|
|
483
474
|
export declare const ADAPTER_VERSION: string;
|
|
484
|
-
//#endregion
|
|
485
|
-
//#region src/index.d.ts
|
|
486
475
|
/**
|
|
487
476
|
* The instrumentation key. Distinct from stock's
|
|
488
477
|
* `Symbol.for('@flue/opentelemetry')` so `instrument()` treats the two as
|
|
@@ -504,6 +493,5 @@ export interface RuntypeFlueInstrumentationOptions extends FlueProjectionOptions
|
|
|
504
493
|
* Runtype to avoid double counting.
|
|
505
494
|
*/
|
|
506
495
|
export declare function createRuntypeFlueInstrumentation(options?: RuntypeFlueInstrumentationOptions): FlueInstrumentation;
|
|
507
|
-
//#endregion
|
|
508
496
|
export type { FlueContentMessage, FlueContentOptions, FlueContentRedactContext, FlueContentSetting, FlueInstrumentation, FlueMessageContentKind, FlueProjectionOptions, RuntypeStopReason, RuntypeToolType, SpanAttributes, SpanIntent };
|
|
509
497
|
export {}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
2
|
-
|
|
2
|
+
// src/compat.ts
|
|
3
3
|
/**
|
|
4
4
|
* Infer implementation class only from datastore semantics or the framework task tool. Origin
|
|
5
5
|
* identifies who initiated a call, not its tool type; unsupported classes remain undefined.
|
|
@@ -65,8 +65,7 @@ const ERROR_REASONS = /* @__PURE__ */ new Set([
|
|
|
65
65
|
function mapSettlementOutcome(outcome) {
|
|
66
66
|
if (outcome === "failed" || outcome === "aborted") return "error";
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
//#region src/messages.ts
|
|
68
|
+
// src/messages.ts
|
|
70
69
|
const ROLES = /* @__PURE__ */ new Set([
|
|
71
70
|
"system",
|
|
72
71
|
"user",
|
|
@@ -192,8 +191,7 @@ function contentMessageText(message) {
|
|
|
192
191
|
function isRecord(value) {
|
|
193
192
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
194
193
|
}
|
|
195
|
-
|
|
196
|
-
//#region src/content.ts
|
|
194
|
+
// src/content.ts
|
|
197
195
|
/**
|
|
198
196
|
* The default per-value ceiling: 64 KiB of ASCII. Large enough for any
|
|
199
197
|
* realistic tool argument object and most results, and small enough that
|
|
@@ -382,11 +380,9 @@ function truncationMarker(droppedChars) {
|
|
|
382
380
|
function isHighSurrogate(code) {
|
|
383
381
|
return code >= 55296 && code <= 56319;
|
|
384
382
|
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
//#endregion
|
|
389
|
-
//#region src/semconv.ts
|
|
383
|
+
// package.json
|
|
384
|
+
var version = "0.5.11";
|
|
385
|
+
// src/semconv.ts
|
|
390
386
|
/**
|
|
391
387
|
* GenAI semantic-convention attribute names. Mirrors the subset of
|
|
392
388
|
* `packages/shared/src/gen-ai-semconv.ts` this instrumentation can populate
|
|
@@ -515,8 +511,7 @@ const RUNTYPE_SCHEMA_VERSION = "1";
|
|
|
515
511
|
const ADAPTER_NAME = "@runtypelabs/flue-otel";
|
|
516
512
|
/** What this package reports itself as in `runtype.adapter.version`. */
|
|
517
513
|
const ADAPTER_VERSION = version;
|
|
518
|
-
|
|
519
|
-
//#region src/projection.ts
|
|
514
|
+
// src/projection.ts
|
|
520
515
|
/**
|
|
521
516
|
* Resource attributes for the customer's `Resource`. Exported rather than set
|
|
522
517
|
* internally because this package owns none of the SDK: the provider, the
|
|
@@ -1250,8 +1245,7 @@ function toolKey(value) {
|
|
|
1250
1245
|
function identityKey(kind, fields) {
|
|
1251
1246
|
return JSON.stringify([kind, ...fields.map((value) => value ?? null)]);
|
|
1252
1247
|
}
|
|
1253
|
-
|
|
1254
|
-
//#region src/spans.ts
|
|
1248
|
+
// src/spans.ts
|
|
1255
1249
|
function createSpanDriver(tracer) {
|
|
1256
1250
|
const live = /* @__PURE__ */ new Map();
|
|
1257
1251
|
function apply(intents) {
|
|
@@ -1314,8 +1308,7 @@ function toDate(value) {
|
|
|
1314
1308
|
const date = new Date(value);
|
|
1315
1309
|
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
1316
1310
|
}
|
|
1317
|
-
|
|
1318
|
-
//#region src/index.ts
|
|
1311
|
+
// src/index.ts
|
|
1319
1312
|
/**
|
|
1320
1313
|
* The instrumentation key. Distinct from stock's
|
|
1321
1314
|
* `Symbol.for('@flue/opentelemetry')` so `instrument()` treats the two as
|
|
@@ -1388,6 +1381,5 @@ function readIdField(operation, key) {
|
|
|
1388
1381
|
const value = operation[key];
|
|
1389
1382
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
1390
1383
|
}
|
|
1391
|
-
//#endregion
|
|
1392
1384
|
export { ADAPTER_NAME, ADAPTER_VERSION, DEFAULT_CONTENT_MAX_CHARS, GEN_AI, GEN_AI_CONTENT, INGEST_CONTENT_ATTRIBUTE_CEILING, RUNTYPE, RUNTYPE_FLUE_INSTRUMENTATION_KEY, RUNTYPE_SCHEMA_VERSION, RUNTYPE_STOP_REASONS, RUNTYPE_TOOL_TYPES, createRuntypeFlueInstrumentation, runtypeFlueResourceAttributes };
|
|
1393
1385
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtypelabs/flue-otel",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"description": "OpenTelemetry instrumentation for Flue agents that emits GenAI semconv spans plus Runtype's runtype.* extension vocabulary, so a Flue run lands in Runtype at full fidelity.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"@opentelemetry/api": "^1.9.0",
|
|
33
33
|
"@opentelemetry/context-async-hooks": "^2.1.0",
|
|
34
34
|
"@opentelemetry/sdk-trace-base": "^2.12.0",
|
|
35
|
-
"@runtypelabs/execution-ingest": "0.16.
|
|
36
|
-
"@runtypelabs/shared": "3.
|
|
37
|
-
"tsdown": "^0.23.
|
|
35
|
+
"@runtypelabs/execution-ingest": "0.16.23",
|
|
36
|
+
"@runtypelabs/shared": "3.98.0",
|
|
37
|
+
"tsdown": "^0.23.2",
|
|
38
38
|
"typescript": "^6.0.3",
|
|
39
|
-
"vitest": "^5.0.
|
|
39
|
+
"vitest": "^5.0.5"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|