@microsoft/agents-a365-observability 0.1.0-preview.95 → 0.2.0-preview.1
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/cjs/ObservabilityBuilder.d.ts +24 -1
- package/dist/cjs/ObservabilityBuilder.d.ts.map +1 -1
- package/dist/cjs/ObservabilityBuilder.js +39 -12
- package/dist/cjs/ObservabilityBuilder.js.map +1 -1
- package/dist/cjs/ObservabilityManager.d.ts.map +1 -1
- package/dist/cjs/ObservabilityManager.js +3 -0
- package/dist/cjs/ObservabilityManager.js.map +1 -1
- package/dist/cjs/configuration/ObservabilityConfiguration.d.ts +19 -0
- package/dist/cjs/configuration/ObservabilityConfiguration.d.ts.map +1 -0
- package/dist/cjs/configuration/ObservabilityConfiguration.js +60 -0
- package/dist/cjs/configuration/ObservabilityConfiguration.js.map +1 -0
- package/dist/cjs/configuration/ObservabilityConfigurationOptions.d.ts +58 -0
- package/dist/cjs/configuration/ObservabilityConfigurationOptions.d.ts.map +1 -0
- package/dist/cjs/configuration/ObservabilityConfigurationOptions.js +5 -0
- package/dist/cjs/configuration/ObservabilityConfigurationOptions.js.map +1 -0
- package/dist/cjs/configuration/PerRequestSpanProcessorConfiguration.d.ts +22 -0
- package/dist/cjs/configuration/PerRequestSpanProcessorConfiguration.d.ts.map +1 -0
- package/dist/cjs/configuration/PerRequestSpanProcessorConfiguration.js +73 -0
- package/dist/cjs/configuration/PerRequestSpanProcessorConfiguration.js.map +1 -0
- package/dist/cjs/configuration/PerRequestSpanProcessorConfigurationOptions.d.ts +71 -0
- package/dist/cjs/configuration/PerRequestSpanProcessorConfigurationOptions.d.ts.map +1 -0
- package/dist/cjs/configuration/PerRequestSpanProcessorConfigurationOptions.js +5 -0
- package/dist/cjs/configuration/PerRequestSpanProcessorConfigurationOptions.js.map +1 -0
- package/dist/cjs/configuration/index.d.ts +16 -0
- package/dist/cjs/configuration/index.d.ts.map +1 -0
- package/dist/cjs/configuration/index.js +35 -0
- package/dist/cjs/configuration/index.js.map +1 -0
- package/dist/cjs/index.d.ts +11 -3
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +45 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internal/PerRequestProcessorInternalOverrides.d.ts +4 -0
- package/dist/cjs/internal/PerRequestProcessorInternalOverrides.d.ts.map +1 -0
- package/dist/cjs/internal/PerRequestProcessorInternalOverrides.js +15 -0
- package/dist/cjs/internal/PerRequestProcessorInternalOverrides.js.map +1 -0
- package/dist/cjs/tracing/PerRequestSpanProcessor.d.ts +10 -3
- package/dist/cjs/tracing/PerRequestSpanProcessor.d.ts.map +1 -1
- package/dist/cjs/tracing/PerRequestSpanProcessor.js +14 -23
- package/dist/cjs/tracing/PerRequestSpanProcessor.js.map +1 -1
- package/dist/cjs/tracing/constants.d.ts +35 -35
- package/dist/cjs/tracing/constants.d.ts.map +1 -1
- package/dist/cjs/tracing/constants.js +42 -40
- package/dist/cjs/tracing/constants.js.map +1 -1
- package/dist/cjs/tracing/context/parent-span-context.d.ts +11 -2
- package/dist/cjs/tracing/context/parent-span-context.d.ts.map +1 -1
- package/dist/cjs/tracing/context/parent-span-context.js +10 -5
- package/dist/cjs/tracing/context/parent-span-context.js.map +1 -1
- package/dist/cjs/tracing/context/token-context.d.ts +14 -0
- package/dist/cjs/tracing/context/token-context.d.ts.map +1 -1
- package/dist/cjs/tracing/context/token-context.js +35 -2
- package/dist/cjs/tracing/context/token-context.js.map +1 -1
- package/dist/cjs/tracing/context/trace-context-propagation.d.ts +68 -0
- package/dist/cjs/tracing/context/trace-context-propagation.d.ts.map +1 -0
- package/dist/cjs/tracing/context/trace-context-propagation.js +85 -0
- package/dist/cjs/tracing/context/trace-context-propagation.js.map +1 -0
- package/dist/cjs/tracing/contracts.d.ts +229 -62
- package/dist/cjs/tracing/contracts.d.ts.map +1 -1
- package/dist/cjs/tracing/contracts.js +39 -18
- package/dist/cjs/tracing/contracts.js.map +1 -1
- package/dist/cjs/tracing/exporter/Agent365Exporter.d.ts +9 -4
- package/dist/cjs/tracing/exporter/Agent365Exporter.d.ts.map +1 -1
- package/dist/cjs/tracing/exporter/Agent365Exporter.js +53 -46
- package/dist/cjs/tracing/exporter/Agent365Exporter.js.map +1 -1
- package/dist/cjs/tracing/exporter/Agent365ExporterOptions.d.ts +8 -5
- package/dist/cjs/tracing/exporter/Agent365ExporterOptions.d.ts.map +1 -1
- package/dist/cjs/tracing/exporter/Agent365ExporterOptions.js +11 -7
- package/dist/cjs/tracing/exporter/Agent365ExporterOptions.js.map +1 -1
- package/dist/cjs/tracing/exporter/ExporterEventNames.d.ts +20 -0
- package/dist/cjs/tracing/exporter/ExporterEventNames.d.ts.map +1 -0
- package/dist/cjs/tracing/exporter/ExporterEventNames.js +26 -0
- package/dist/cjs/tracing/exporter/ExporterEventNames.js.map +1 -0
- package/dist/cjs/tracing/exporter/utils.d.ts +24 -11
- package/dist/cjs/tracing/exporter/utils.d.ts.map +1 -1
- package/dist/cjs/tracing/exporter/utils.js +354 -33
- package/dist/cjs/tracing/exporter/utils.js.map +1 -1
- package/dist/cjs/tracing/message-utils.d.ts +36 -0
- package/dist/cjs/tracing/message-utils.d.ts.map +1 -0
- package/dist/cjs/tracing/message-utils.js +90 -0
- package/dist/cjs/tracing/message-utils.js.map +1 -0
- package/dist/cjs/tracing/middleware/BaggageBuilder.d.ts +32 -44
- package/dist/cjs/tracing/middleware/BaggageBuilder.d.ts.map +1 -1
- package/dist/cjs/tracing/middleware/BaggageBuilder.js +49 -62
- package/dist/cjs/tracing/middleware/BaggageBuilder.js.map +1 -1
- package/dist/cjs/tracing/processors/SpanProcessor.d.ts.map +1 -1
- package/dist/cjs/tracing/processors/SpanProcessor.js +12 -3
- package/dist/cjs/tracing/processors/SpanProcessor.js.map +1 -1
- package/dist/cjs/tracing/processors/util.d.ts.map +1 -1
- package/dist/cjs/tracing/processors/util.js +16 -22
- package/dist/cjs/tracing/processors/util.js.map +1 -1
- package/dist/cjs/tracing/scopes/ExecuteToolScope.d.ts +10 -11
- package/dist/cjs/tracing/scopes/ExecuteToolScope.d.ts.map +1 -1
- package/dist/cjs/tracing/scopes/ExecuteToolScope.js +26 -20
- package/dist/cjs/tracing/scopes/ExecuteToolScope.js.map +1 -1
- package/dist/cjs/tracing/scopes/InferenceScope.d.ts +20 -24
- package/dist/cjs/tracing/scopes/InferenceScope.d.ts.map +1 -1
- package/dist/cjs/tracing/scopes/InferenceScope.js +53 -48
- package/dist/cjs/tracing/scopes/InferenceScope.js.map +1 -1
- package/dist/cjs/tracing/scopes/InvokeAgentScope.d.ts +17 -12
- package/dist/cjs/tracing/scopes/InvokeAgentScope.d.ts.map +1 -1
- package/dist/cjs/tracing/scopes/InvokeAgentScope.js +55 -54
- package/dist/cjs/tracing/scopes/InvokeAgentScope.js.map +1 -1
- package/dist/cjs/tracing/scopes/OpenTelemetryScope.d.ts +43 -12
- package/dist/cjs/tracing/scopes/OpenTelemetryScope.d.ts.map +1 -1
- package/dist/cjs/tracing/scopes/OpenTelemetryScope.js +114 -30
- package/dist/cjs/tracing/scopes/OpenTelemetryScope.js.map +1 -1
- package/dist/cjs/tracing/scopes/OutputScope.d.ts +33 -0
- package/dist/cjs/tracing/scopes/OutputScope.d.ts.map +1 -0
- package/dist/cjs/tracing/scopes/OutputScope.js +80 -0
- package/dist/cjs/tracing/scopes/OutputScope.js.map +1 -0
- package/dist/cjs/tracing/util.d.ts +14 -1
- package/dist/cjs/tracing/util.d.ts.map +1 -1
- package/dist/cjs/tracing/util.js +38 -7
- package/dist/cjs/tracing/util.js.map +1 -1
- package/dist/cjs/utils/logging.d.ts +45 -2
- package/dist/cjs/utils/logging.d.ts.map +1 -1
- package/dist/cjs/utils/logging.js +53 -79
- package/dist/cjs/utils/logging.js.map +1 -1
- package/dist/cjs/version.d.ts +2 -0
- package/dist/cjs/version.d.ts.map +1 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/version.js.map +1 -0
- package/dist/esm/ObservabilityBuilder.d.ts +24 -1
- package/dist/esm/ObservabilityBuilder.d.ts.map +1 -1
- package/dist/esm/ObservabilityBuilder.js +41 -14
- package/dist/esm/ObservabilityBuilder.js.map +1 -1
- package/dist/esm/ObservabilityManager.d.ts.map +1 -1
- package/dist/esm/ObservabilityManager.js +3 -0
- package/dist/esm/ObservabilityManager.js.map +1 -1
- package/dist/esm/configuration/ObservabilityConfiguration.d.ts +19 -0
- package/dist/esm/configuration/ObservabilityConfiguration.d.ts.map +1 -0
- package/dist/esm/configuration/ObservabilityConfiguration.js +56 -0
- package/dist/esm/configuration/ObservabilityConfiguration.js.map +1 -0
- package/dist/esm/configuration/ObservabilityConfigurationOptions.d.ts +58 -0
- package/dist/esm/configuration/ObservabilityConfigurationOptions.d.ts.map +1 -0
- package/dist/esm/configuration/ObservabilityConfigurationOptions.js +4 -0
- package/dist/esm/configuration/ObservabilityConfigurationOptions.js.map +1 -0
- package/dist/esm/configuration/PerRequestSpanProcessorConfiguration.d.ts +22 -0
- package/dist/esm/configuration/PerRequestSpanProcessorConfiguration.d.ts.map +1 -0
- package/dist/esm/configuration/PerRequestSpanProcessorConfiguration.js +69 -0
- package/dist/esm/configuration/PerRequestSpanProcessorConfiguration.js.map +1 -0
- package/dist/esm/configuration/PerRequestSpanProcessorConfigurationOptions.d.ts +71 -0
- package/dist/esm/configuration/PerRequestSpanProcessorConfigurationOptions.d.ts.map +1 -0
- package/dist/esm/configuration/PerRequestSpanProcessorConfigurationOptions.js +4 -0
- package/dist/esm/configuration/PerRequestSpanProcessorConfigurationOptions.js.map +1 -0
- package/dist/esm/configuration/index.d.ts +16 -0
- package/dist/esm/configuration/index.d.ts.map +1 -0
- package/dist/esm/configuration/index.js +18 -0
- package/dist/esm/configuration/index.js.map +1 -0
- package/dist/esm/index.d.ts +11 -3
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +17 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/PerRequestProcessorInternalOverrides.d.ts +4 -0
- package/dist/esm/internal/PerRequestProcessorInternalOverrides.d.ts.map +1 -0
- package/dist/esm/internal/PerRequestProcessorInternalOverrides.js +11 -0
- package/dist/esm/internal/PerRequestProcessorInternalOverrides.js.map +1 -0
- package/dist/esm/tracing/PerRequestSpanProcessor.d.ts +10 -3
- package/dist/esm/tracing/PerRequestSpanProcessor.d.ts.map +1 -1
- package/dist/esm/tracing/PerRequestSpanProcessor.js +14 -23
- package/dist/esm/tracing/PerRequestSpanProcessor.js.map +1 -1
- package/dist/esm/tracing/constants.d.ts +35 -35
- package/dist/esm/tracing/constants.d.ts.map +1 -1
- package/dist/esm/tracing/constants.js +42 -40
- package/dist/esm/tracing/constants.js.map +1 -1
- package/dist/esm/tracing/context/parent-span-context.d.ts +11 -2
- package/dist/esm/tracing/context/parent-span-context.d.ts.map +1 -1
- package/dist/esm/tracing/context/parent-span-context.js +10 -5
- package/dist/esm/tracing/context/parent-span-context.js.map +1 -1
- package/dist/esm/tracing/context/token-context.d.ts +14 -0
- package/dist/esm/tracing/context/token-context.d.ts.map +1 -1
- package/dist/esm/tracing/context/token-context.js +34 -2
- package/dist/esm/tracing/context/token-context.js.map +1 -1
- package/dist/esm/tracing/context/trace-context-propagation.d.ts +68 -0
- package/dist/esm/tracing/context/trace-context-propagation.d.ts.map +1 -0
- package/dist/esm/tracing/context/trace-context-propagation.js +79 -0
- package/dist/esm/tracing/context/trace-context-propagation.js.map +1 -0
- package/dist/esm/tracing/contracts.d.ts +229 -62
- package/dist/esm/tracing/contracts.d.ts.map +1 -1
- package/dist/esm/tracing/contracts.js +38 -17
- package/dist/esm/tracing/contracts.js.map +1 -1
- package/dist/esm/tracing/exporter/Agent365Exporter.d.ts +9 -4
- package/dist/esm/tracing/exporter/Agent365Exporter.d.ts.map +1 -1
- package/dist/esm/tracing/exporter/Agent365Exporter.js +54 -47
- package/dist/esm/tracing/exporter/Agent365Exporter.js.map +1 -1
- package/dist/esm/tracing/exporter/Agent365ExporterOptions.d.ts +8 -5
- package/dist/esm/tracing/exporter/Agent365ExporterOptions.d.ts.map +1 -1
- package/dist/esm/tracing/exporter/Agent365ExporterOptions.js +11 -7
- package/dist/esm/tracing/exporter/Agent365ExporterOptions.js.map +1 -1
- package/dist/esm/tracing/exporter/ExporterEventNames.d.ts +20 -0
- package/dist/esm/tracing/exporter/ExporterEventNames.d.ts.map +1 -0
- package/dist/esm/tracing/exporter/ExporterEventNames.js +23 -0
- package/dist/esm/tracing/exporter/ExporterEventNames.js.map +1 -0
- package/dist/esm/tracing/exporter/utils.d.ts +24 -11
- package/dist/esm/tracing/exporter/utils.d.ts.map +1 -1
- package/dist/esm/tracing/exporter/utils.js +352 -32
- package/dist/esm/tracing/exporter/utils.js.map +1 -1
- package/dist/esm/tracing/message-utils.d.ts +36 -0
- package/dist/esm/tracing/message-utils.d.ts.map +1 -0
- package/dist/esm/tracing/message-utils.js +82 -0
- package/dist/esm/tracing/message-utils.js.map +1 -0
- package/dist/esm/tracing/middleware/BaggageBuilder.d.ts +32 -44
- package/dist/esm/tracing/middleware/BaggageBuilder.d.ts.map +1 -1
- package/dist/esm/tracing/middleware/BaggageBuilder.js +49 -62
- package/dist/esm/tracing/middleware/BaggageBuilder.js.map +1 -1
- package/dist/esm/tracing/processors/SpanProcessor.d.ts.map +1 -1
- package/dist/esm/tracing/processors/SpanProcessor.js +12 -3
- package/dist/esm/tracing/processors/SpanProcessor.js.map +1 -1
- package/dist/esm/tracing/processors/util.d.ts.map +1 -1
- package/dist/esm/tracing/processors/util.js +16 -22
- package/dist/esm/tracing/processors/util.js.map +1 -1
- package/dist/esm/tracing/scopes/ExecuteToolScope.d.ts +10 -11
- package/dist/esm/tracing/scopes/ExecuteToolScope.d.ts.map +1 -1
- package/dist/esm/tracing/scopes/ExecuteToolScope.js +26 -20
- package/dist/esm/tracing/scopes/ExecuteToolScope.js.map +1 -1
- package/dist/esm/tracing/scopes/InferenceScope.d.ts +20 -24
- package/dist/esm/tracing/scopes/InferenceScope.d.ts.map +1 -1
- package/dist/esm/tracing/scopes/InferenceScope.js +53 -48
- package/dist/esm/tracing/scopes/InferenceScope.js.map +1 -1
- package/dist/esm/tracing/scopes/InvokeAgentScope.d.ts +17 -12
- package/dist/esm/tracing/scopes/InvokeAgentScope.d.ts.map +1 -1
- package/dist/esm/tracing/scopes/InvokeAgentScope.js +55 -54
- package/dist/esm/tracing/scopes/InvokeAgentScope.js.map +1 -1
- package/dist/esm/tracing/scopes/OpenTelemetryScope.d.ts +43 -12
- package/dist/esm/tracing/scopes/OpenTelemetryScope.d.ts.map +1 -1
- package/dist/esm/tracing/scopes/OpenTelemetryScope.js +115 -31
- package/dist/esm/tracing/scopes/OpenTelemetryScope.js.map +1 -1
- package/dist/esm/tracing/scopes/OutputScope.d.ts +33 -0
- package/dist/esm/tracing/scopes/OutputScope.d.ts.map +1 -0
- package/dist/esm/tracing/scopes/OutputScope.js +76 -0
- package/dist/esm/tracing/scopes/OutputScope.js.map +1 -0
- package/dist/esm/tracing/util.d.ts +14 -1
- package/dist/esm/tracing/util.d.ts.map +1 -1
- package/dist/esm/tracing/util.js +37 -7
- package/dist/esm/tracing/util.js.map +1 -1
- package/dist/esm/utils/logging.d.ts +45 -2
- package/dist/esm/utils/logging.d.ts.map +1 -1
- package/dist/esm/utils/logging.js +52 -79
- package/dist/esm/utils/logging.js.map +1 -1
- package/dist/esm/version.d.ts +2 -0
- package/dist/esm/version.d.ts.map +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { context, propagation } from '@opentelemetry/api';
|
|
4
|
+
/**
|
|
5
|
+
* Type guard to distinguish a {@link ParentSpanRef} from an OTel {@link Context}.
|
|
6
|
+
*/
|
|
7
|
+
export function isParentSpanRef(value) {
|
|
8
|
+
if (typeof value !== 'object' || value === null)
|
|
9
|
+
return false;
|
|
10
|
+
const maybeCtx = value;
|
|
11
|
+
if (typeof maybeCtx.getValue === 'function' &&
|
|
12
|
+
typeof maybeCtx.setValue === 'function' &&
|
|
13
|
+
typeof maybeCtx.deleteValue === 'function') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const maybeRef = value;
|
|
17
|
+
return ('traceId' in maybeRef &&
|
|
18
|
+
typeof maybeRef.traceId === 'string' &&
|
|
19
|
+
'spanId' in maybeRef &&
|
|
20
|
+
typeof maybeRef.spanId === 'string');
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Injects the current trace context (`traceparent`/`tracestate` headers) into
|
|
24
|
+
* the provided headers object using the globally registered W3C propagator.
|
|
25
|
+
*
|
|
26
|
+
* @param headers Mutable object where trace context headers will be written.
|
|
27
|
+
* @param ctx Optional OTel Context to inject from. Defaults to the active context.
|
|
28
|
+
* @returns The same `headers` object, for chaining convenience.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const headers: Record<string, string> = {};
|
|
33
|
+
* injectContextToHeaders(headers);
|
|
34
|
+
* await fetch('http://service-b/process', { headers });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export function injectContextToHeaders(headers, ctx) {
|
|
38
|
+
propagation.inject(ctx ?? context.active(), headers);
|
|
39
|
+
return headers;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Extracts trace context from incoming HTTP headers using the globally
|
|
43
|
+
* registered W3C propagator. Returns an OTel {@link Context} that can be
|
|
44
|
+
* passed to scope classes as a {@link ParentContext}.
|
|
45
|
+
*
|
|
46
|
+
* @param headers The incoming HTTP request headers containing `traceparent`/`tracestate`.
|
|
47
|
+
* @param baseCtx Optional base context to extend. Defaults to the active context.
|
|
48
|
+
* @returns An OTel Context containing the extracted trace information.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const parentCtx = extractContextFromHeaders(req.headers);
|
|
53
|
+
* const scope = InvokeAgentScope.start(request, scopeDetails, agentDetails, undefined, { parentContext: parentCtx });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export function extractContextFromHeaders(headers, baseCtx) {
|
|
57
|
+
return propagation.extract(baseCtx ?? context.active(), headers);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Extracts trace context from incoming HTTP headers and runs the callback
|
|
61
|
+
* within that context. Any spans created inside the callback will be
|
|
62
|
+
* parented to the extracted trace.
|
|
63
|
+
*
|
|
64
|
+
* @param headers The incoming HTTP request headers containing `traceparent`/`tracestate`.
|
|
65
|
+
* @param callback The function to execute within the extracted context.
|
|
66
|
+
* @returns The result of the callback.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* runWithExtractedTraceContext(req.headers, () => {
|
|
71
|
+
* const scope = InvokeAgentScope.start(request, scopeDetails, agentDetails);
|
|
72
|
+
* scope.dispose();
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export function runWithExtractedTraceContext(headers, callback) {
|
|
77
|
+
return context.with(extractContextFromHeaders(headers), callback);
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=trace-context-propagation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-context-propagation.js","sourceRoot":"","sources":["../../../../src/tracing/context/trace-context-propagation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAW,MAAM,oBAAoB,CAAC;AAgBnE;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAoB;IAClD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAE9D,MAAM,QAAQ,GAAG,KAAgB,CAAC;IAClC,IACE,OAAO,QAAQ,CAAC,QAAQ,KAAK,UAAU;QACvC,OAAO,QAAQ,CAAC,QAAQ,KAAK,UAAU;QACvC,OAAO,QAAQ,CAAC,WAAW,KAAK,UAAU,EAC1C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,QAAQ,GAAG,KAAsB,CAAC;IACxC,OAAO,CACL,SAAS,IAAI,QAAQ;QACrB,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ;QACpC,QAAQ,IAAI,QAAQ;QACpB,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,CACpC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAA+B,EAC/B,GAAa;IAEb,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IACrD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAAuB,EACvB,OAAiB;IAEjB,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,4BAA4B,CAAI,OAAuB,EAAE,QAAiB;IACxF,OAAO,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
export declare enum ExecutionType {
|
|
5
|
-
/** Direct human-to-agent invocation (e.g., through UI, API call) */
|
|
6
|
-
HumanToAgent = "HumanToAgent",
|
|
7
|
-
/** Agent-to-agent invocation (e.g., one agent calling another) */
|
|
8
|
-
Agent2Agent = "Agent2Agent",
|
|
9
|
-
/** Event-driven agent invocation (e.g., scheduled, webhook, message queue) */
|
|
10
|
-
EventToAgent = "EventToAgent",
|
|
11
|
-
/** Unknown or unspecified invocation type */
|
|
12
|
-
Unknown = "Unknown"
|
|
13
|
-
}
|
|
1
|
+
import type { SpanKind, TimeInput, Link } from '@opentelemetry/api';
|
|
2
|
+
import type { ParentContext } from './context/trace-context-propagation';
|
|
14
3
|
/**
|
|
15
4
|
* Represents different roles that can invoke an agent
|
|
16
5
|
*/
|
|
@@ -33,39 +22,33 @@ export declare enum InferenceOperationType {
|
|
|
33
22
|
GENERATE_CONTENT = "GenerateContent"
|
|
34
23
|
}
|
|
35
24
|
/**
|
|
36
|
-
* Represents
|
|
25
|
+
* Represents channel for an invocation
|
|
37
26
|
*/
|
|
38
|
-
export interface
|
|
39
|
-
/** Unique identifier for the
|
|
27
|
+
export interface Channel {
|
|
28
|
+
/** Unique identifier for the channel (e.g., Teams channel ID, Slack workspace ID) */
|
|
40
29
|
id?: string;
|
|
41
|
-
/** Human-readable name of the
|
|
30
|
+
/** Human-readable name of the channel (e.g., "Teams", "Slack", "web") */
|
|
42
31
|
name?: string;
|
|
43
|
-
/** Optional icon identifier or URL for visual representation of the
|
|
32
|
+
/** Optional icon identifier or URL for visual representation of the channel */
|
|
44
33
|
iconUri?: string;
|
|
45
|
-
/** The role of the
|
|
34
|
+
/** The role of the entity invoking through this channel */
|
|
46
35
|
role?: InvocationRole;
|
|
47
|
-
/** Optional description providing additional context about the
|
|
36
|
+
/** Optional description or link providing additional context about the channel */
|
|
48
37
|
description?: string;
|
|
49
38
|
}
|
|
50
39
|
/**
|
|
51
|
-
* Represents a request
|
|
40
|
+
* Represents a request with telemetry context.
|
|
41
|
+
* Used across all scope types for channel and conversation tracking.
|
|
52
42
|
*/
|
|
53
|
-
export interface
|
|
54
|
-
/** The content of the request */
|
|
55
|
-
content?:
|
|
56
|
-
/** The type of invocation (how the agent was called) */
|
|
57
|
-
executionType?: ExecutionType;
|
|
43
|
+
export interface Request {
|
|
44
|
+
/** The content of the request. */
|
|
45
|
+
content?: InputMessagesParam;
|
|
58
46
|
/** Optional session identifier for grouping related requests */
|
|
59
47
|
sessionId?: string;
|
|
60
|
-
/** Optional
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
* Details about a tenant
|
|
65
|
-
*/
|
|
66
|
-
export interface TenantDetails {
|
|
67
|
-
/** The unique identifier for the tenant */
|
|
68
|
-
tenantId: string;
|
|
48
|
+
/** Optional channel for the invocation */
|
|
49
|
+
channel?: Channel;
|
|
50
|
+
/** Optional conversation identifier */
|
|
51
|
+
conversationId?: string;
|
|
69
52
|
}
|
|
70
53
|
/**
|
|
71
54
|
* Details about an AI agent
|
|
@@ -73,12 +56,8 @@ export interface TenantDetails {
|
|
|
73
56
|
export interface AgentDetails {
|
|
74
57
|
/** The unique identifier for the AI agent */
|
|
75
58
|
agentId: string;
|
|
76
|
-
/** The identifier for the conversation or session */
|
|
77
|
-
conversationId?: string;
|
|
78
59
|
/** The human-readable name of the AI agent */
|
|
79
60
|
agentName?: string;
|
|
80
|
-
/** Optional type of the AI agent */
|
|
81
|
-
agentType?: string;
|
|
82
61
|
/** A description of the AI agent's purpose or capabilities */
|
|
83
62
|
agentDescription?: string;
|
|
84
63
|
/** Optional icon identifier or URL for visual representation of the agent */
|
|
@@ -87,14 +66,16 @@ export interface AgentDetails {
|
|
|
87
66
|
platformId?: string;
|
|
88
67
|
/** The agent user ID (AUID) */
|
|
89
68
|
agentAUID?: string;
|
|
90
|
-
/** The agent
|
|
91
|
-
|
|
69
|
+
/** The agent email address */
|
|
70
|
+
agentEmail?: string;
|
|
92
71
|
/** The agent blueprint/application ID */
|
|
93
72
|
agentBlueprintId?: string;
|
|
94
73
|
/** The tenant ID for the agent */
|
|
95
74
|
tenantId?: string;
|
|
96
|
-
/** The
|
|
97
|
-
|
|
75
|
+
/** The provider name (e.g., az.ai.agent365, openai, anthropic) */
|
|
76
|
+
providerName?: string;
|
|
77
|
+
/** The version of the agent (e.g., '1.0.0', '2025-05-01') */
|
|
78
|
+
agentVersion?: string;
|
|
98
79
|
}
|
|
99
80
|
/**
|
|
100
81
|
* Details of a tool call made by an agent
|
|
@@ -102,8 +83,8 @@ export interface AgentDetails {
|
|
|
102
83
|
export interface ToolCallDetails {
|
|
103
84
|
/** The name of the tool being executed */
|
|
104
85
|
toolName: string;
|
|
105
|
-
/** Tool arguments/parameters */
|
|
106
|
-
arguments?: string;
|
|
86
|
+
/** Tool arguments/parameters. Objects are serialized to JSON automatically. */
|
|
87
|
+
arguments?: Record<string, unknown> | string;
|
|
107
88
|
/** The unique identifier for the tool call */
|
|
108
89
|
toolCallId?: string;
|
|
109
90
|
/** Optional description of the tool or its purpose */
|
|
@@ -114,22 +95,40 @@ export interface ToolCallDetails {
|
|
|
114
95
|
endpoint?: ServiceEndpoint;
|
|
115
96
|
}
|
|
116
97
|
/**
|
|
117
|
-
* Details about
|
|
98
|
+
* Details about the human user caller.
|
|
118
99
|
*/
|
|
119
|
-
export interface
|
|
100
|
+
export interface UserDetails {
|
|
120
101
|
/** The unique identifier for the caller */
|
|
121
|
-
|
|
122
|
-
/** The
|
|
123
|
-
|
|
102
|
+
userId?: string;
|
|
103
|
+
/** The email address of the caller */
|
|
104
|
+
userEmail?: string;
|
|
124
105
|
/** The display name of the caller */
|
|
125
|
-
|
|
126
|
-
/** The user ID of the caller */
|
|
127
|
-
callerUserId?: string;
|
|
106
|
+
userName?: string;
|
|
128
107
|
/** The tenant ID of the caller */
|
|
129
108
|
tenantId?: string;
|
|
130
109
|
/** The client IP address for the caller */
|
|
131
110
|
callerClientIp?: string;
|
|
132
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Caller details for scope creation.
|
|
114
|
+
* Supports human callers, agent callers, or both (A2A with a human in the chain).
|
|
115
|
+
*
|
|
116
|
+
* **Migration note:** In v1 the name `CallerDetails` referred to human caller
|
|
117
|
+
* identity (now {@link UserDetails}). In v2 it was repurposed as a wrapper that
|
|
118
|
+
* groups both human and agent caller information.
|
|
119
|
+
*
|
|
120
|
+
* @see {@link UserDetails} — human caller identity (previously `CallerDetails`)
|
|
121
|
+
* @see CHANGELOG.md — breaking changes section for migration guidance
|
|
122
|
+
*/
|
|
123
|
+
export interface CallerDetails {
|
|
124
|
+
/** Optional human caller identity */
|
|
125
|
+
userDetails?: UserDetails;
|
|
126
|
+
/** Optional calling agent identity for A2A (agent-to-agent) scenarios */
|
|
127
|
+
callerAgentDetails?: AgentDetails;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @deprecated Use AgentDetails. EnhancedAgentDetails is now an alias of AgentDetails.
|
|
131
|
+
*/
|
|
133
132
|
export type EnhancedAgentDetails = AgentDetails;
|
|
134
133
|
/**
|
|
135
134
|
* Represents an endpoint for agent invocation
|
|
@@ -143,18 +142,14 @@ export interface ServiceEndpoint {
|
|
|
143
142
|
protocol?: string;
|
|
144
143
|
}
|
|
145
144
|
/**
|
|
146
|
-
* Details for invoking
|
|
145
|
+
* Details for invoking agent scope.
|
|
147
146
|
*/
|
|
148
|
-
export interface
|
|
149
|
-
/** The request payload for the agent invocation */
|
|
150
|
-
request?: AgentRequest;
|
|
147
|
+
export interface InvokeAgentScopeDetails {
|
|
151
148
|
/** The endpoint for the agent invocation */
|
|
152
149
|
endpoint?: ServiceEndpoint;
|
|
153
|
-
/** Session ID for the invocation */
|
|
154
|
-
sessionId?: string;
|
|
155
150
|
}
|
|
156
151
|
/**
|
|
157
|
-
* Details for an inference call
|
|
152
|
+
* Details for an inference call
|
|
158
153
|
*/
|
|
159
154
|
export interface InferenceDetails {
|
|
160
155
|
/** The operation name/type for the inference */
|
|
@@ -169,8 +164,10 @@ export interface InferenceDetails {
|
|
|
169
164
|
outputTokens?: number;
|
|
170
165
|
/** Array of finish reasons */
|
|
171
166
|
finishReasons?: string[];
|
|
172
|
-
/**
|
|
173
|
-
|
|
167
|
+
/** The thought process used by the agent */
|
|
168
|
+
thoughtProcess?: string;
|
|
169
|
+
/** The endpoint for the inference call */
|
|
170
|
+
endpoint?: ServiceEndpoint;
|
|
174
171
|
}
|
|
175
172
|
/**
|
|
176
173
|
* Details for recording the response from an inference call
|
|
@@ -187,4 +184,174 @@ export interface InferenceResponse {
|
|
|
187
184
|
/** Number of output tokens generated */
|
|
188
185
|
outputTokens?: number;
|
|
189
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* Represents a response containing output messages from an agent.
|
|
189
|
+
* Used with OutputScope for output message tracing.
|
|
190
|
+
* Accepts plain strings, structured OTEL OutputMessage objects, or a raw dict
|
|
191
|
+
* (treated as a tool call result per OTEL spec).
|
|
192
|
+
*/
|
|
193
|
+
export interface OutputResponse {
|
|
194
|
+
/** The output messages from the agent */
|
|
195
|
+
messages: ResponseMessagesParam;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Span configuration details for scope creation.
|
|
199
|
+
* Groups OpenTelemetry span options into a single object so the scope
|
|
200
|
+
* method signature remains stable as new options are added.
|
|
201
|
+
*/
|
|
202
|
+
export interface SpanDetails {
|
|
203
|
+
/** Optional parent context for cross-async-boundary tracing.
|
|
204
|
+
* Accepts a ParentSpanRef (manual traceId/spanId) or an OTel Context
|
|
205
|
+
* (e.g. from extractContextFromHeaders). */
|
|
206
|
+
parentContext?: ParentContext;
|
|
207
|
+
/** Optional explicit start time (ms epoch, Date, or HrTime). */
|
|
208
|
+
startTime?: TimeInput;
|
|
209
|
+
/** Optional explicit end time (ms epoch, Date, or HrTime). */
|
|
210
|
+
endTime?: TimeInput;
|
|
211
|
+
/** Optional span kind override. */
|
|
212
|
+
spanKind?: SpanKind;
|
|
213
|
+
/** Optional span links to associate with this span. */
|
|
214
|
+
spanLinks?: Link[];
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Role of a message participant per OTEL gen-ai semantic conventions.
|
|
218
|
+
*/
|
|
219
|
+
export declare enum MessageRole {
|
|
220
|
+
SYSTEM = "system",
|
|
221
|
+
USER = "user",
|
|
222
|
+
ASSISTANT = "assistant",
|
|
223
|
+
TOOL = "tool"
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Reason a model stopped generating per OTEL gen-ai semantic conventions.
|
|
227
|
+
*/
|
|
228
|
+
export declare enum FinishReason {
|
|
229
|
+
STOP = "stop",
|
|
230
|
+
LENGTH = "length",
|
|
231
|
+
CONTENT_FILTER = "content_filter",
|
|
232
|
+
TOOL_CALL = "tool_call",
|
|
233
|
+
ERROR = "error"
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Media modality for blob, file, and URI parts.
|
|
237
|
+
*/
|
|
238
|
+
export declare enum Modality {
|
|
239
|
+
IMAGE = "image",
|
|
240
|
+
VIDEO = "video",
|
|
241
|
+
AUDIO = "audio"
|
|
242
|
+
}
|
|
243
|
+
/** Plain text content. */
|
|
244
|
+
export interface TextPart {
|
|
245
|
+
type: 'text';
|
|
246
|
+
content: string;
|
|
247
|
+
}
|
|
248
|
+
/** A tool call requested by the model. */
|
|
249
|
+
export interface ToolCallRequestPart {
|
|
250
|
+
type: 'tool_call';
|
|
251
|
+
name: string;
|
|
252
|
+
id?: string;
|
|
253
|
+
arguments?: Record<string, unknown> | unknown[];
|
|
254
|
+
}
|
|
255
|
+
/** Result of a tool call. */
|
|
256
|
+
export interface ToolCallResponsePart {
|
|
257
|
+
type: 'tool_call_response';
|
|
258
|
+
id?: string;
|
|
259
|
+
response?: unknown;
|
|
260
|
+
}
|
|
261
|
+
/** Model reasoning / chain-of-thought content. */
|
|
262
|
+
export interface ReasoningPart {
|
|
263
|
+
type: 'reasoning';
|
|
264
|
+
content: string;
|
|
265
|
+
}
|
|
266
|
+
/** Inline binary data (base64-encoded). */
|
|
267
|
+
export interface BlobPart {
|
|
268
|
+
type: 'blob';
|
|
269
|
+
modality: Modality | string;
|
|
270
|
+
mime_type?: string;
|
|
271
|
+
content: string;
|
|
272
|
+
}
|
|
273
|
+
/** Reference to a pre-uploaded file. */
|
|
274
|
+
export interface FilePart {
|
|
275
|
+
type: 'file';
|
|
276
|
+
modality: Modality | string;
|
|
277
|
+
mime_type?: string;
|
|
278
|
+
file_id: string;
|
|
279
|
+
}
|
|
280
|
+
/** External URI reference. */
|
|
281
|
+
export interface UriPart {
|
|
282
|
+
type: 'uri';
|
|
283
|
+
modality: Modality | string;
|
|
284
|
+
mime_type?: string;
|
|
285
|
+
uri: string;
|
|
286
|
+
}
|
|
287
|
+
/** Extensible server tool call details with a type discriminator. */
|
|
288
|
+
export interface GenericServerToolCall {
|
|
289
|
+
type: string;
|
|
290
|
+
[key: string]: unknown;
|
|
291
|
+
}
|
|
292
|
+
/** Extensible server tool call response with a type discriminator. */
|
|
293
|
+
export interface GenericServerToolCallResponse {
|
|
294
|
+
type: string;
|
|
295
|
+
[key: string]: unknown;
|
|
296
|
+
}
|
|
297
|
+
/** Server-side tool invocation. */
|
|
298
|
+
export interface ServerToolCallPart {
|
|
299
|
+
type: 'server_tool_call';
|
|
300
|
+
name: string;
|
|
301
|
+
id?: string;
|
|
302
|
+
server_tool_call: GenericServerToolCall;
|
|
303
|
+
}
|
|
304
|
+
/** Server-side tool response. */
|
|
305
|
+
export interface ServerToolCallResponsePart {
|
|
306
|
+
type: 'server_tool_call_response';
|
|
307
|
+
id?: string;
|
|
308
|
+
server_tool_call_response: GenericServerToolCallResponse;
|
|
309
|
+
}
|
|
310
|
+
/** Extensible part for custom / future types. */
|
|
311
|
+
export interface GenericPart {
|
|
312
|
+
type: string;
|
|
313
|
+
[key: string]: unknown;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Union of all message part types per OTEL gen-ai semantic conventions.
|
|
317
|
+
*
|
|
318
|
+
* Note: {@link GenericPart} acts as a catch-all for forward compatibility with
|
|
319
|
+
* custom or future part types. Because its `type` is `string` (not a literal),
|
|
320
|
+
* exhaustive `switch`/`case` on `part.type` will not produce compile-time errors
|
|
321
|
+
* for unhandled cases.
|
|
322
|
+
*/
|
|
323
|
+
export type MessagePart = TextPart | ToolCallRequestPart | ToolCallResponsePart | ReasoningPart | BlobPart | FilePart | UriPart | ServerToolCallPart | ServerToolCallResponsePart | GenericPart;
|
|
324
|
+
/**
|
|
325
|
+
* An input message sent to a model (OTEL gen-ai semantic conventions).
|
|
326
|
+
*/
|
|
327
|
+
export interface ChatMessage {
|
|
328
|
+
role: MessageRole | string;
|
|
329
|
+
parts: MessagePart[];
|
|
330
|
+
name?: string;
|
|
331
|
+
}
|
|
332
|
+
export interface InputMessages {
|
|
333
|
+
version: typeof A365_MESSAGE_SCHEMA_VERSION;
|
|
334
|
+
messages: ChatMessage[];
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* An output message produced by a model (OTEL gen-ai semantic conventions).
|
|
338
|
+
*/
|
|
339
|
+
export interface OutputMessage extends ChatMessage {
|
|
340
|
+
finish_reason?: FinishReason | string;
|
|
341
|
+
}
|
|
342
|
+
export interface OutputMessages {
|
|
343
|
+
version: typeof A365_MESSAGE_SCHEMA_VERSION;
|
|
344
|
+
messages: OutputMessage[];
|
|
345
|
+
}
|
|
346
|
+
export declare const A365_MESSAGE_SCHEMA_VERSION: "0.1.0";
|
|
347
|
+
/** Accepted input for `recordInputMessages`. Supports a single string, an array of strings (backward compat), or the versioned wrapper. */
|
|
348
|
+
export type InputMessagesParam = string | string[] | InputMessages;
|
|
349
|
+
/** Accepted input for `recordOutputMessages`. Supports a single string, an array of strings (backward compat), or the versioned wrapper. */
|
|
350
|
+
export type OutputMessagesParam = string | string[] | OutputMessages;
|
|
351
|
+
/**
|
|
352
|
+
* Accepted input for `OutputResponse.messages`.
|
|
353
|
+
* Supports plain strings, structured OutputMessages, or a raw dict (treated as a tool call result
|
|
354
|
+
* per OTEL spec and serialized directly via JSON.stringify).
|
|
355
|
+
*/
|
|
356
|
+
export type ResponseMessagesParam = OutputMessagesParam | Record<string, unknown>;
|
|
190
357
|
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/tracing/contracts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/tracing/contracts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAGzE;;GAEG;AACH,oBAAY,cAAc;IACxB,oCAAoC;IACpC,KAAK,UAAU;IAEf,wCAAwC;IACxC,KAAK,UAAU;IAEf,wEAAwE;IACxE,KAAK,UAAU;IAEf,kCAAkC;IAClC,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,sBAAsB;IAChC,IAAI,SAAS;IACb,eAAe,mBAAmB;IAClC,gBAAgB,oBAAoB;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,qFAAqF;IACrF,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,cAAc,CAAC;IAEtB,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,kCAAkC;IAClC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,uCAAuC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAEhB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,8DAA8D;IAC9D,gBAAgB,CAAC,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AAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,mBAAmB,GACnB,oBAAoB,GACpB,aAAa,GACb,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,kBAAkB,GAClB,0BAA0B,GAC1B,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,WAAW,GAAG,MAAM,CAAC;IAC3B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,2BAA2B,CAAC;IAC5C,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AACD;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,aAAa,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;CACvC;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,2BAA2B,CAAC;IAC5C,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,2BAA2B,EAAG,OAAgB,CAAC;AAE5D,2IAA2I;AAC3I,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,aAAa,CAAC;AAEnE,4IAA4I;AAC5I,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// ------------------------------------------------------------------------------
|
|
4
|
-
/**
|
|
5
|
-
* Represents different types of agent invocations
|
|
6
|
-
*/
|
|
7
|
-
export var ExecutionType;
|
|
8
|
-
(function (ExecutionType) {
|
|
9
|
-
/** Direct human-to-agent invocation (e.g., through UI, API call) */
|
|
10
|
-
ExecutionType["HumanToAgent"] = "HumanToAgent";
|
|
11
|
-
/** Agent-to-agent invocation (e.g., one agent calling another) */
|
|
12
|
-
ExecutionType["Agent2Agent"] = "Agent2Agent";
|
|
13
|
-
/** Event-driven agent invocation (e.g., scheduled, webhook, message queue) */
|
|
14
|
-
ExecutionType["EventToAgent"] = "EventToAgent";
|
|
15
|
-
/** Unknown or unspecified invocation type */
|
|
16
|
-
ExecutionType["Unknown"] = "Unknown";
|
|
17
|
-
})(ExecutionType || (ExecutionType = {}));
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
18
3
|
/**
|
|
19
4
|
* Represents different roles that can invoke an agent
|
|
20
5
|
*/
|
|
@@ -38,4 +23,40 @@ export var InferenceOperationType;
|
|
|
38
23
|
InferenceOperationType["TEXT_COMPLETION"] = "TextCompletion";
|
|
39
24
|
InferenceOperationType["GENERATE_CONTENT"] = "GenerateContent";
|
|
40
25
|
})(InferenceOperationType || (InferenceOperationType = {}));
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// OpenTelemetry Semantic Convention – Gen-AI Message Format
|
|
28
|
+
// https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-input-messages.json
|
|
29
|
+
// https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-output-messages.json
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
/**
|
|
32
|
+
* Role of a message participant per OTEL gen-ai semantic conventions.
|
|
33
|
+
*/
|
|
34
|
+
export var MessageRole;
|
|
35
|
+
(function (MessageRole) {
|
|
36
|
+
MessageRole["SYSTEM"] = "system";
|
|
37
|
+
MessageRole["USER"] = "user";
|
|
38
|
+
MessageRole["ASSISTANT"] = "assistant";
|
|
39
|
+
MessageRole["TOOL"] = "tool";
|
|
40
|
+
})(MessageRole || (MessageRole = {}));
|
|
41
|
+
/**
|
|
42
|
+
* Reason a model stopped generating per OTEL gen-ai semantic conventions.
|
|
43
|
+
*/
|
|
44
|
+
export var FinishReason;
|
|
45
|
+
(function (FinishReason) {
|
|
46
|
+
FinishReason["STOP"] = "stop";
|
|
47
|
+
FinishReason["LENGTH"] = "length";
|
|
48
|
+
FinishReason["CONTENT_FILTER"] = "content_filter";
|
|
49
|
+
FinishReason["TOOL_CALL"] = "tool_call";
|
|
50
|
+
FinishReason["ERROR"] = "error";
|
|
51
|
+
})(FinishReason || (FinishReason = {}));
|
|
52
|
+
/**
|
|
53
|
+
* Media modality for blob, file, and URI parts.
|
|
54
|
+
*/
|
|
55
|
+
export var Modality;
|
|
56
|
+
(function (Modality) {
|
|
57
|
+
Modality["IMAGE"] = "image";
|
|
58
|
+
Modality["VIDEO"] = "video";
|
|
59
|
+
Modality["AUDIO"] = "audio";
|
|
60
|
+
})(Modality || (Modality = {}));
|
|
61
|
+
export const A365_MESSAGE_SCHEMA_VERSION = '0.1.0';
|
|
41
62
|
//# sourceMappingURL=contracts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/tracing/contracts.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/tracing/contracts.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAMlC;;GAEG;AACH,MAAM,CAAN,IAAY,cAYX;AAZD,WAAY,cAAc;IACxB,oCAAoC;IACpC,iCAAe,CAAA;IAEf,wCAAwC;IACxC,iCAAe,CAAA;IAEf,wEAAwE;IACxE,iCAAe,CAAA;IAEf,kCAAkC;IAClC,qCAAmB,CAAA;AACrB,CAAC,EAZW,cAAc,KAAd,cAAc,QAYzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAChC,uCAAa,CAAA;IACb,4DAAkC,CAAA;IAClC,8DAAoC,CAAA;AACtC,CAAC,EAJW,sBAAsB,KAAtB,sBAAsB,QAIjC;AA4PD,8EAA8E;AAC9E,4DAA4D;AAC5D,gFAAgF;AAChF,iFAAiF;AACjF,8EAA8E;AAE9E;;GAEG;AACH,MAAM,CAAN,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,4BAAa,CAAA;IACb,sCAAuB,CAAA;IACvB,4BAAa,CAAA;AACf,CAAC,EALW,WAAW,KAAX,WAAW,QAKtB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,iCAAiB,CAAA;IACjB,iDAAiC,CAAA;IACjC,uCAAuB,CAAA;IACvB,+BAAe,CAAA;AACjB,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,2BAAe,CAAA;AACjB,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB;AAqID,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAgB,CAAC"}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import { ExportResult } from '@opentelemetry/core';
|
|
2
2
|
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
3
|
+
import { IConfigurationProvider } from '@microsoft/agents-a365-runtime';
|
|
4
|
+
import type { ObservabilityConfiguration } from '../../configuration';
|
|
3
5
|
import { Agent365ExporterOptions } from './Agent365ExporterOptions';
|
|
4
6
|
/**
|
|
5
7
|
* Observability span exporter for Agent365:
|
|
6
8
|
* - Partitions spans by (tenantId, agentId)
|
|
7
9
|
* - Builds OTLP-like JSON: resourceSpans -> scopeSpans -> spans
|
|
8
|
-
* - POSTs per group to https://{endpoint}/
|
|
9
|
-
* or, when useS2SEndpoint is true, https://{endpoint}/
|
|
10
|
+
* - POSTs per group to https://{endpoint}/observability/tenants/{tenantId}/otlp/agents/{agentId}/traces?api-version=1
|
|
11
|
+
* or, when useS2SEndpoint is true, https://{endpoint}/observabilityService/tenants/{tenantId}/otlp/agents/{agentId}/traces?api-version=1
|
|
10
12
|
* - Adds Bearer token via token_resolver(agentId, tenantId)
|
|
11
13
|
*/
|
|
12
14
|
export declare class Agent365Exporter implements SpanExporter {
|
|
13
15
|
private closed;
|
|
14
16
|
private readonly options;
|
|
17
|
+
private readonly configProvider?;
|
|
15
18
|
/**
|
|
16
19
|
* Initialize exporter with a fully constructed options instance.
|
|
17
|
-
*
|
|
20
|
+
* @param options Exporter options controlling batching, timeouts, token acquisition and endpoint shape.
|
|
21
|
+
* @param configProvider Optional configuration provider. When supplied, the exporter uses it for
|
|
22
|
+
* configuration lookups (custom domain, domain override) instead of the default env-based provider.
|
|
18
23
|
*/
|
|
19
|
-
constructor(options: Agent365ExporterOptions);
|
|
24
|
+
constructor(options: Agent365ExporterOptions, configProvider?: IConfigurationProvider<ObservabilityConfiguration>);
|
|
20
25
|
/**
|
|
21
26
|
* Export spans to Agent365 service
|
|
22
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agent365Exporter.d.ts","sourceRoot":"","sources":["../../../../src/tracing/exporter/Agent365Exporter.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAoB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"Agent365Exporter.d.ts","sourceRoot":"","sources":["../../../../src/tracing/exporter/Agent365Exporter.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAoB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAmB,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAetE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAuDpE;;;;;;;GAOG;AACH,qBAAa,gBAAiB,YAAW,YAAY;IACnD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0B;IAClD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAqD;IAErF;;;;;OAKG;gBACS,OAAO,EAAE,uBAAuB,EAAE,cAAc,CAAC,EAAE,sBAAsB,CAAC,0BAA0B,CAAC;IAYjH;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA+ClG;;OAEG;YACW,WAAW;IAuEzB;;OAEG;YACW,eAAe;IA8C7B;;OAEG;IACH,OAAO,CAAC,KAAK;IAIb;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA4C1B;;OAEG;IACH,OAAO,CAAC,OAAO;IAqFf;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAIlC"}
|