@microsoft/agents-a365-observability-hosting 0.1.0-preview.103
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/LICENSE.md +21 -0
- package/dist/cjs/caching/AgenticTokenCache.d.ts +55 -0
- package/dist/cjs/caching/AgenticTokenCache.d.ts.map +1 -0
- package/dist/cjs/caching/AgenticTokenCache.js +214 -0
- package/dist/cjs/caching/AgenticTokenCache.js.map +1 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +28 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/utils/BaggageBuilderUtils.d.ts +57 -0
- package/dist/cjs/utils/BaggageBuilderUtils.d.ts.map +1 -0
- package/dist/cjs/utils/BaggageBuilderUtils.js +93 -0
- package/dist/cjs/utils/BaggageBuilderUtils.js.map +1 -0
- package/dist/cjs/utils/ScopeUtils.d.ts +83 -0
- package/dist/cjs/utils/ScopeUtils.d.ts.map +1 -0
- package/dist/cjs/utils/ScopeUtils.js +198 -0
- package/dist/cjs/utils/ScopeUtils.js.map +1 -0
- package/dist/cjs/utils/TurnContextUtils.d.ts +38 -0
- package/dist/cjs/utils/TurnContextUtils.d.ts.map +1 -0
- package/dist/cjs/utils/TurnContextUtils.js +144 -0
- package/dist/cjs/utils/TurnContextUtils.js.map +1 -0
- package/dist/esm/caching/AgenticTokenCache.d.ts +55 -0
- package/dist/esm/caching/AgenticTokenCache.d.ts.map +1 -0
- package/dist/esm/caching/AgenticTokenCache.js +210 -0
- package/dist/esm/caching/AgenticTokenCache.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/utils/BaggageBuilderUtils.d.ts +57 -0
- package/dist/esm/utils/BaggageBuilderUtils.d.ts.map +1 -0
- package/dist/esm/utils/BaggageBuilderUtils.js +89 -0
- package/dist/esm/utils/BaggageBuilderUtils.js.map +1 -0
- package/dist/esm/utils/ScopeUtils.d.ts +83 -0
- package/dist/esm/utils/ScopeUtils.d.ts.map +1 -0
- package/dist/esm/utils/ScopeUtils.js +194 -0
- package/dist/esm/utils/ScopeUtils.js.map +1 -0
- package/dist/esm/utils/TurnContextUtils.d.ts +38 -0
- package/dist/esm/utils/TurnContextUtils.d.ts.map +1 -0
- package/dist/esm/utils/TurnContextUtils.js +136 -0
- package/dist/esm/utils/TurnContextUtils.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// ------------------------------------------------------------------------------
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
// ------------------------------------------------------------------------------
|
|
5
|
+
import { InvokeAgentScope, InferenceScope, ExecuteToolScope } from '@microsoft/agents-a365-observability';
|
|
6
|
+
import { getExecutionTypePair, } from './TurnContextUtils';
|
|
7
|
+
/**
|
|
8
|
+
* Unified utilities to populate scope tags from a TurnContext.
|
|
9
|
+
* Provides common tag population and scope-specific helpers.
|
|
10
|
+
*/
|
|
11
|
+
export class ScopeUtils {
|
|
12
|
+
static setInputMessageTags(scope, turnContext) {
|
|
13
|
+
if (turnContext?.activity?.text) {
|
|
14
|
+
scope.recordInputMessages([turnContext.activity.text]);
|
|
15
|
+
}
|
|
16
|
+
return scope;
|
|
17
|
+
}
|
|
18
|
+
// ----------------------
|
|
19
|
+
// Context-derived helpers
|
|
20
|
+
// ----------------------
|
|
21
|
+
/**
|
|
22
|
+
* Derive tenant details from the TurnContext.
|
|
23
|
+
* @param turnContext Activity context
|
|
24
|
+
* @returns Tenant details if a recipient tenant id is present; otherwise undefined.
|
|
25
|
+
*/
|
|
26
|
+
static deriveTenantDetails(turnContext) {
|
|
27
|
+
const tenantId = turnContext?.activity?.recipient?.tenantId;
|
|
28
|
+
return tenantId ? { tenantId } : undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Derive target agent details from the activity recipient.
|
|
32
|
+
* @param turnContext Activity context
|
|
33
|
+
* @returns Agent details built from recipient properties; otherwise undefined.
|
|
34
|
+
*/
|
|
35
|
+
static deriveAgentDetails(turnContext) {
|
|
36
|
+
const recipient = turnContext?.activity?.recipient;
|
|
37
|
+
if (!recipient)
|
|
38
|
+
return undefined;
|
|
39
|
+
return {
|
|
40
|
+
agentId: recipient.agenticAppId,
|
|
41
|
+
agentName: recipient.name,
|
|
42
|
+
agentAUID: recipient.aadObjectId,
|
|
43
|
+
agentDescription: recipient.role,
|
|
44
|
+
tenantId: recipient.tenantId
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Derive caller agent details from the activity from.
|
|
49
|
+
* @param turnContext Activity context
|
|
50
|
+
* @returns Agent details built from caller (from) properties; otherwise undefined.
|
|
51
|
+
*/
|
|
52
|
+
static deriveCallerAgent(turnContext) {
|
|
53
|
+
const from = turnContext?.activity?.from;
|
|
54
|
+
if (!from)
|
|
55
|
+
return undefined;
|
|
56
|
+
return {
|
|
57
|
+
agentBlueprintId: from.agenticAppBlueprintId,
|
|
58
|
+
agentName: from.name,
|
|
59
|
+
agentAUID: from.aadObjectId,
|
|
60
|
+
agentDescription: from.role,
|
|
61
|
+
tenantId: from.tenantId,
|
|
62
|
+
agentId: from.agenticAppId
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Derive caller identity details (id, upn, name, tenant, client ip) from the activity from.
|
|
67
|
+
* @param turnContext Activity context
|
|
68
|
+
* @returns Caller details when available; otherwise undefined.
|
|
69
|
+
*/
|
|
70
|
+
static deriveCallerDetails(turnContext) {
|
|
71
|
+
const from = turnContext?.activity?.from;
|
|
72
|
+
if (!from)
|
|
73
|
+
return undefined;
|
|
74
|
+
return {
|
|
75
|
+
callerId: from.aadObjectId,
|
|
76
|
+
callerUpn: from.agenticUserId,
|
|
77
|
+
callerName: from.name,
|
|
78
|
+
tenantId: from.tenantId,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Derive conversation id from the TurnContext.
|
|
83
|
+
* @param turnContext Activity context
|
|
84
|
+
* @returns Conversation id when present; otherwise undefined.
|
|
85
|
+
*/
|
|
86
|
+
static deriveConversationId(turnContext) {
|
|
87
|
+
return turnContext?.activity?.conversation?.id;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Derive source metadata (channel name and description/link) from the TurnContext.
|
|
91
|
+
* @param turnContext Activity context
|
|
92
|
+
* @returns Object with optional name and description fields.
|
|
93
|
+
*/
|
|
94
|
+
static deriveSourceMetadataObject(turnContext) {
|
|
95
|
+
return {
|
|
96
|
+
name: turnContext?.activity?.channelId,
|
|
97
|
+
description: turnContext?.activity?.channelIdSubChannel
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Create an `InferenceScope` using `details` and values derived from the provided `TurnContext`.
|
|
102
|
+
* Derives `agentDetails`, `tenantDetails`, `conversationId`, and `sourceMetadata` (channel name/link) from context.
|
|
103
|
+
* Also records input messages from the context if present.
|
|
104
|
+
* @param details The inference call details (model, provider, tokens, etc.).
|
|
105
|
+
* @param turnContext The current activity context to derive scope parameters from.
|
|
106
|
+
* @returns A started `InferenceScope` enriched with context-derived parameters.
|
|
107
|
+
*/
|
|
108
|
+
static populateInferenceScopeFromTurnContext(details, turnContext) {
|
|
109
|
+
const agent = ScopeUtils.deriveAgentDetails(turnContext);
|
|
110
|
+
const tenant = ScopeUtils.deriveTenantDetails(turnContext);
|
|
111
|
+
const conversationId = ScopeUtils.deriveConversationId(turnContext);
|
|
112
|
+
const sourceMetadata = ScopeUtils.deriveSourceMetadataObject(turnContext);
|
|
113
|
+
if (!agent) {
|
|
114
|
+
throw new Error('populateInferenceScopeFromTurnContext: Missing agent details on TurnContext (recipient)');
|
|
115
|
+
}
|
|
116
|
+
if (!tenant) {
|
|
117
|
+
throw new Error('populateInferenceScopeFromTurnContext: Missing tenant details on TurnContext (recipient)');
|
|
118
|
+
}
|
|
119
|
+
const scope = InferenceScope.start(details, agent, tenant, conversationId, sourceMetadata);
|
|
120
|
+
this.setInputMessageTags(scope, turnContext);
|
|
121
|
+
return scope;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Create an `InvokeAgentScope` using `details` and values derived from the provided `TurnContext`.
|
|
125
|
+
* Populates `conversationId` and `request.sourceMetadata` (channel name/link) in `details` from the `TurnContext`, overriding any existing values.
|
|
126
|
+
* Derives `tenantDetails`, `callerAgentDetails` (from caller), and `callerDetails` (from user).
|
|
127
|
+
* Also sets execution type and input messages from the context if present.
|
|
128
|
+
* @param details The invoke-agent call details to be augmented and used for the scope.
|
|
129
|
+
* @param turnContext The current activity context to derive scope parameters from.
|
|
130
|
+
* @returns A started `InvokeAgentScope` enriched with context-derived parameters.
|
|
131
|
+
*/
|
|
132
|
+
static populateInvokeAgentScopeFromTurnContext(details, turnContext) {
|
|
133
|
+
const tenant = ScopeUtils.deriveTenantDetails(turnContext);
|
|
134
|
+
const callerAgent = ScopeUtils.deriveCallerAgent(turnContext);
|
|
135
|
+
const caller = ScopeUtils.deriveCallerDetails(turnContext);
|
|
136
|
+
const invokeAgentDetails = ScopeUtils.buildInvokeAgentDetails(details, turnContext);
|
|
137
|
+
if (!tenant) {
|
|
138
|
+
throw new Error('populateInvokeAgentScopeFromTurnContext: Missing tenant details on TurnContext (recipient)');
|
|
139
|
+
}
|
|
140
|
+
const scope = InvokeAgentScope.start(invokeAgentDetails, tenant, callerAgent, caller);
|
|
141
|
+
this.setInputMessageTags(scope, turnContext);
|
|
142
|
+
return scope;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Build InvokeAgentDetails by merging provided details with agent info, conversation id and source metadata from the TurnContext.
|
|
146
|
+
* @param details Base invoke-agent details to augment
|
|
147
|
+
* @param turnContext Activity context
|
|
148
|
+
* @returns New InvokeAgentDetails suitable for starting an InvokeAgentScope.
|
|
149
|
+
*/
|
|
150
|
+
static buildInvokeAgentDetails(details, turnContext) {
|
|
151
|
+
const agent = ScopeUtils.deriveAgentDetails(turnContext);
|
|
152
|
+
const srcMetaFromContext = ScopeUtils.deriveSourceMetadataObject(turnContext);
|
|
153
|
+
const executionTypePair = getExecutionTypePair(turnContext);
|
|
154
|
+
const baseRequest = details.request ?? {};
|
|
155
|
+
const baseSource = baseRequest.sourceMetadata ?? {};
|
|
156
|
+
const mergedSourceMetadata = {
|
|
157
|
+
...baseSource,
|
|
158
|
+
...(srcMetaFromContext.name !== undefined ? { name: srcMetaFromContext.name } : {}),
|
|
159
|
+
...(srcMetaFromContext.description !== undefined ? { description: srcMetaFromContext.description } : {}),
|
|
160
|
+
};
|
|
161
|
+
return {
|
|
162
|
+
...details,
|
|
163
|
+
...agent,
|
|
164
|
+
conversationId: ScopeUtils.deriveConversationId(turnContext),
|
|
165
|
+
request: {
|
|
166
|
+
...baseRequest,
|
|
167
|
+
executionType: executionTypePair.length > 0 ? executionTypePair[0][1] : baseRequest.executionType,
|
|
168
|
+
sourceMetadata: mergedSourceMetadata
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Create an `ExecuteToolScope` using `details` and values derived from the provided `TurnContext`.
|
|
174
|
+
* Derives `agentDetails`, `tenantDetails`, `conversationId`, and `sourceMetadata` (channel name/link) from context.
|
|
175
|
+
* @param details The tool call details (name, type, args, call id, etc.).
|
|
176
|
+
* @param turnContext The current activity context to derive scope parameters from.
|
|
177
|
+
* @returns A started `ExecuteToolScope` enriched with context-derived parameters.
|
|
178
|
+
*/
|
|
179
|
+
static populateExecuteToolScopeFromTurnContext(details, turnContext) {
|
|
180
|
+
const agent = ScopeUtils.deriveAgentDetails(turnContext);
|
|
181
|
+
const tenant = ScopeUtils.deriveTenantDetails(turnContext);
|
|
182
|
+
const conversationId = ScopeUtils.deriveConversationId(turnContext);
|
|
183
|
+
const sourceMetadata = ScopeUtils.deriveSourceMetadataObject(turnContext);
|
|
184
|
+
if (!agent) {
|
|
185
|
+
throw new Error('populateExecuteToolScopeFromTurnContext: Missing agent details on TurnContext (recipient)');
|
|
186
|
+
}
|
|
187
|
+
if (!tenant) {
|
|
188
|
+
throw new Error('populateExecuteToolScopeFromTurnContext: Missing tenant details on TurnContext (recipient)');
|
|
189
|
+
}
|
|
190
|
+
const scope = ExecuteToolScope.start(details, agent, tenant, conversationId, sourceMetadata);
|
|
191
|
+
return scope;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=ScopeUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScopeUtils.js","sourceRoot":"","sources":["../../../src/utils/ScopeUtils.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,uCAAuC;AACvC,kCAAkC;AAClC,iFAAiF;AAGjF,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAQjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAE5B;;;GAGG;AACH,MAAM,OAAO,UAAU;IAGb,MAAM,CAAC,mBAAmB,CAAC,KAAwC,EAAE,WAAwB;QACnG,IAAI,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;YAChC,KAAK,CAAC,mBAAmB,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,yBAAyB;IACzB,0BAA0B;IAC1B,yBAAyB;IACzB;;;;OAIG;IACI,MAAM,CAAC,mBAAmB,CAAC,WAAwB;QACxD,MAAM,QAAQ,GAAG,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;QAC5D,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;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YACR,cAAc,EAAE,UAAU,CAAC,oBAAoB,CAAC,WAAW,CAAC;YAC5D,OAAO,EAAE;gBACP,GAAG,WAAW;gBACd,aAAa,EAAE,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAmB,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa;gBACpH,cAAc,EAAE,oBAAoB;aACrC;SACF,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,uCAAuC,CAC5C,OAAwB,EACxB,WAAwB;QAExB,MAAM,KAAK,GAAG,UAAU,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACzD,MAAM,MAAM,GAAG,UAAU,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;QAC3D,MAAM,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;QACpE,MAAM,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC1E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,2FAA2F,CAAC,CAAC;QAC/G,CAAC;QACD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,4FAA4F,CAAC,CAAC;QAChH,CAAC;QACD,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;QAC7F,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TurnContext } from '@microsoft/agents-hosting';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts caller-related OpenTelemetry baggage pairs from the TurnContext.
|
|
4
|
+
* @param turnContext The current TurnContext (activity context)
|
|
5
|
+
* @returns Array of [key, value] pairs for caller identity and tenant
|
|
6
|
+
*/
|
|
7
|
+
export declare function getCallerBaggagePairs(turnContext: TurnContext): Array<[string, string]>;
|
|
8
|
+
/**
|
|
9
|
+
* Extracts the execution type baggage key-value pair based on caller and recipient agentic status.
|
|
10
|
+
* @param turnContext The current TurnContext (activity context)
|
|
11
|
+
* @returns Array of [key, value] for execution type
|
|
12
|
+
*/
|
|
13
|
+
export declare function getExecutionTypePair(turnContext: TurnContext): Array<[string, string]>;
|
|
14
|
+
/**
|
|
15
|
+
* Extracts agent/recipient-related OpenTelemetry baggage pairs from the TurnContext.
|
|
16
|
+
* @param turnContext The current TurnContext (activity context)
|
|
17
|
+
* @returns Array of [key, value] pairs for agent identity and description
|
|
18
|
+
*/
|
|
19
|
+
export declare function getTargetAgentBaggagePairs(turnContext: TurnContext): Array<[string, string]>;
|
|
20
|
+
/**
|
|
21
|
+
* Extracts the tenant ID baggage key-value pair, attempting to retrieve from ChannelData if necessary.
|
|
22
|
+
* @param turnContext The current TurnContext (activity context)
|
|
23
|
+
* @returns Array of [key, value] for tenant ID
|
|
24
|
+
*/
|
|
25
|
+
export declare function getTenantIdPair(turnContext: TurnContext): Array<[string, string]>;
|
|
26
|
+
/**
|
|
27
|
+
* Extracts source metadata baggage pairs from the TurnContext.
|
|
28
|
+
* @param turnContext The current TurnContext (activity context)
|
|
29
|
+
* @returns Array of [key, value] pairs for channel name and link
|
|
30
|
+
*/
|
|
31
|
+
export declare function getSourceMetadataBaggagePairs(turnContext: TurnContext): Array<[string, string]>;
|
|
32
|
+
/**
|
|
33
|
+
* Extracts conversation ID and item link baggage key-value pairs from the provided turn context.
|
|
34
|
+
* @param turnContext The current TurnContext (activity context)
|
|
35
|
+
* @returns Array of [key, value] pairs for conversation ID and item link
|
|
36
|
+
*/
|
|
37
|
+
export declare function getConversationIdAndItemLinkPairs(turnContext: TurnContext): Array<[string, string]>;
|
|
38
|
+
//# sourceMappingURL=TurnContextUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurnContextUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/TurnContextUtils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAcxD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAevF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkBtF;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAgB5F;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAoBjF;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAS/F;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,WAAW,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAWnG"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// ------------------------------------------------------------------------------
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
// ------------------------------------------------------------------------------
|
|
5
|
+
import { ExecutionType, OpenTelemetryConstants } from '@microsoft/agents-a365-observability';
|
|
6
|
+
import { RoleTypes } from '@microsoft/agents-activity';
|
|
7
|
+
/**
|
|
8
|
+
* TurnContext utility methods.
|
|
9
|
+
*/
|
|
10
|
+
function normalizePairs(pairs) {
|
|
11
|
+
return pairs
|
|
12
|
+
.filter(([, v]) => v != null && String(v).trim() !== '')
|
|
13
|
+
.map(([k, v]) => [k, String(v)]);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Extracts caller-related OpenTelemetry baggage pairs from the TurnContext.
|
|
17
|
+
* @param turnContext The current TurnContext (activity context)
|
|
18
|
+
* @returns Array of [key, value] pairs for caller identity and tenant
|
|
19
|
+
*/
|
|
20
|
+
export function getCallerBaggagePairs(turnContext) {
|
|
21
|
+
if (!turnContext || !turnContext.activity?.from) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
const from = turnContext.activity.from;
|
|
25
|
+
const upn = from.agenticUserId;
|
|
26
|
+
const pairs = [
|
|
27
|
+
[OpenTelemetryConstants.GEN_AI_CALLER_ID_KEY, from.aadObjectId],
|
|
28
|
+
[OpenTelemetryConstants.GEN_AI_CALLER_NAME_KEY, from.name],
|
|
29
|
+
[OpenTelemetryConstants.GEN_AI_CALLER_UPN_KEY, upn],
|
|
30
|
+
[OpenTelemetryConstants.GEN_AI_CALLER_TENANT_ID_KEY, from.tenantId],
|
|
31
|
+
[OpenTelemetryConstants.GEN_AI_AGENT_BLUEPRINT_ID_KEY, from.agenticAppBlueprintId]
|
|
32
|
+
];
|
|
33
|
+
return normalizePairs(pairs);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Extracts the execution type baggage key-value pair based on caller and recipient agentic status.
|
|
37
|
+
* @param turnContext The current TurnContext (activity context)
|
|
38
|
+
* @returns Array of [key, value] for execution type
|
|
39
|
+
*/
|
|
40
|
+
export function getExecutionTypePair(turnContext) {
|
|
41
|
+
if (!turnContext || !turnContext.activity?.from || !turnContext.activity?.recipient) {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
const from = turnContext.activity.from;
|
|
45
|
+
let executionType = ExecutionType.HumanToAgent;
|
|
46
|
+
if (from.role) {
|
|
47
|
+
switch (from.role) {
|
|
48
|
+
case RoleTypes.AgenticUser:
|
|
49
|
+
executionType = ExecutionType.Agent2Agent;
|
|
50
|
+
break;
|
|
51
|
+
case RoleTypes.User:
|
|
52
|
+
executionType = ExecutionType.HumanToAgent;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return [[OpenTelemetryConstants.GEN_AI_EXECUTION_TYPE_KEY, executionType]];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Extracts agent/recipient-related OpenTelemetry baggage pairs from the TurnContext.
|
|
60
|
+
* @param turnContext The current TurnContext (activity context)
|
|
61
|
+
* @returns Array of [key, value] pairs for agent identity and description
|
|
62
|
+
*/
|
|
63
|
+
export function getTargetAgentBaggagePairs(turnContext) {
|
|
64
|
+
if (!turnContext || !turnContext.activity?.recipient) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
const recipient = turnContext.activity.recipient;
|
|
68
|
+
const agentId = recipient.agenticAppId;
|
|
69
|
+
const agentName = recipient.name;
|
|
70
|
+
const aadObjectId = recipient.aadObjectId;
|
|
71
|
+
const agentDescription = recipient.role;
|
|
72
|
+
const pairs = [
|
|
73
|
+
[OpenTelemetryConstants.GEN_AI_AGENT_ID_KEY, agentId],
|
|
74
|
+
[OpenTelemetryConstants.GEN_AI_AGENT_NAME_KEY, agentName],
|
|
75
|
+
[OpenTelemetryConstants.GEN_AI_AGENT_DESCRIPTION_KEY, agentDescription],
|
|
76
|
+
[OpenTelemetryConstants.GEN_AI_AGENT_AUID_KEY, aadObjectId],
|
|
77
|
+
];
|
|
78
|
+
return normalizePairs(pairs);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Extracts the tenant ID baggage key-value pair, attempting to retrieve from ChannelData if necessary.
|
|
82
|
+
* @param turnContext The current TurnContext (activity context)
|
|
83
|
+
* @returns Array of [key, value] for tenant ID
|
|
84
|
+
*/
|
|
85
|
+
export function getTenantIdPair(turnContext) {
|
|
86
|
+
let tenantId = turnContext.activity?.recipient?.tenantId;
|
|
87
|
+
// If not found, try to extract from channelData. Accepts both object and JSON string.
|
|
88
|
+
if (!tenantId && turnContext.activity?.channelData) {
|
|
89
|
+
try {
|
|
90
|
+
let channelData = turnContext.activity.channelData;
|
|
91
|
+
if (typeof channelData === 'string') {
|
|
92
|
+
channelData = JSON.parse(channelData);
|
|
93
|
+
}
|
|
94
|
+
if (typeof channelData === 'object' && channelData !== null) {
|
|
95
|
+
tenantId = channelData?.tenant?.id;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch (_err) {
|
|
99
|
+
// ignore JSON parse errors
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return tenantId ? [[OpenTelemetryConstants.TENANT_ID_KEY, tenantId]] : [];
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Extracts source metadata baggage pairs from the TurnContext.
|
|
106
|
+
* @param turnContext The current TurnContext (activity context)
|
|
107
|
+
* @returns Array of [key, value] pairs for channel name and link
|
|
108
|
+
*/
|
|
109
|
+
export function getSourceMetadataBaggagePairs(turnContext) {
|
|
110
|
+
if (!turnContext) {
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
const pairs = [
|
|
114
|
+
[OpenTelemetryConstants.GEN_AI_EXECUTION_SOURCE_NAME_KEY, turnContext.activity?.channelId],
|
|
115
|
+
[OpenTelemetryConstants.GEN_AI_EXECUTION_SOURCE_DESCRIPTION_KEY, turnContext.activity?.channelIdSubChannel]
|
|
116
|
+
];
|
|
117
|
+
return normalizePairs(pairs);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Extracts conversation ID and item link baggage key-value pairs from the provided turn context.
|
|
121
|
+
* @param turnContext The current TurnContext (activity context)
|
|
122
|
+
* @returns Array of [key, value] pairs for conversation ID and item link
|
|
123
|
+
*/
|
|
124
|
+
export function getConversationIdAndItemLinkPairs(turnContext) {
|
|
125
|
+
if (!turnContext) {
|
|
126
|
+
return [];
|
|
127
|
+
}
|
|
128
|
+
const conversationId = turnContext.activity?.conversation?.id;
|
|
129
|
+
const itemLink = turnContext.activity?.serviceUrl;
|
|
130
|
+
const pairs = [
|
|
131
|
+
[OpenTelemetryConstants.GEN_AI_CONVERSATION_ID_KEY, conversationId],
|
|
132
|
+
[OpenTelemetryConstants.GEN_AI_CONVERSATION_ITEM_LINK_KEY, itemLink]
|
|
133
|
+
];
|
|
134
|
+
return normalizePairs(pairs);
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=TurnContextUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TurnContextUtils.js","sourceRoot":"","sources":["../../../src/utils/TurnContextUtils.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,uCAAuC;AACvC,kCAAkC;AAClC,iFAAiF;AAGjF,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC7F,OAAO,EAAC,SAAS,EAAC,MAAM,4BAA4B,CAAC;AAErD;;GAEG;AAEH,SAAS,cAAc,CAAC,KAA0C;IAChE,OAAO,KAAK;SACT,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;SACvD,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,WAAwB;IAC5D,IAAI,CAAC,WAAW,IAAG,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC/C,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;IAEvC,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC;IAC/B,MAAM,KAAK,GAAwC;Q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CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAAC,WAAwB;IACpE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,KAAK,GAAwC;QACjD,CAAC,sBAAsB,CAAC,gCAAgC,EAAE,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC;QAC1F,CAAC,sBAAsB,CAAC,uCAAuC,EAAE,WAAW,CAAC,QAAQ,EAAE,mBAAyC,CAAC;KAClI,CAAC;IACF,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAAC,WAAwB;IACxE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,cAAc,GAAG,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,CAAC;IAC9D,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,UAAU,CAAC;IAClD,MAAM,KAAK,GAAwC;QACjD,CAAC,sBAAsB,CAAC,0BAA0B,EAAE,cAAc,CAAC;QACnE,CAAC,sBAAsB,CAAC,iCAAiC,EAAE,QAAQ,CAAC;KACrE,CAAC;IACF,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@microsoft/agents-a365-observability-hosting",
|
|
3
|
+
"version": "0.1.0-preview.103",
|
|
4
|
+
"description": "Hosting & Observability utilities for Agent365 (Node.js): token caching, baggage builder, hosting registration.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"agent365",
|
|
7
|
+
"observability",
|
|
8
|
+
"telemetry",
|
|
9
|
+
"token",
|
|
10
|
+
"cache"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/microsoft/Agent365-nodejs",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/microsoft/Agent365-nodejs/issues"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/microsoft/Agent365-nodejs.git",
|
|
19
|
+
"directory": "packages/agents-a365-observability-hosting"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "Microsoft",
|
|
23
|
+
"main": "./dist/cjs/index.js",
|
|
24
|
+
"module": "./dist/esm/index.js",
|
|
25
|
+
"types": "./dist/cjs/index.d.ts",
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md",
|
|
29
|
+
"CHANGELOG.md"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@microsoft/agents-a365-observability": "0.1.0-preview.103",
|
|
33
|
+
"@microsoft/agents-a365-runtime": "0.1.0-preview.103",
|
|
34
|
+
"@microsoft/agents-hosting": "^1.1.0-alpha.85"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@eslint/js": "^9.39.1",
|
|
38
|
+
"@types/jest": "^30.0.0",
|
|
39
|
+
"@types/node": "^20.17.0",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^8.47.0",
|
|
41
|
+
"@typescript-eslint/parser": "^8.47.0",
|
|
42
|
+
"eslint": "^9.39.1",
|
|
43
|
+
"jest": "^30.2.0",
|
|
44
|
+
"rimraf": "^6.0.0",
|
|
45
|
+
"ts-jest": "^29.4.5",
|
|
46
|
+
"typescript": "^5.9.3",
|
|
47
|
+
"typescript-eslint": "^8.47.0"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=18.0.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "npm run build:cjs && npm run build:esm",
|
|
54
|
+
"build:cjs": "npx tsc --project tsconfig.cjs.json",
|
|
55
|
+
"build:esm": "npx tsc --project tsconfig.esm.json",
|
|
56
|
+
"build:watch": "npx tsc --watch",
|
|
57
|
+
"clean": "npx rimraf dist",
|
|
58
|
+
"lint": "eslint src",
|
|
59
|
+
"lint:fix": "eslint src --fix",
|
|
60
|
+
"test": "jest --passWithNoTests",
|
|
61
|
+
"test:watch": "jest --watch",
|
|
62
|
+
"test:coverage": "jest --coverage",
|
|
63
|
+
"pack": "node ../../copyFiles.js . && pnpm pack --pack-destination=../"
|
|
64
|
+
}
|
|
65
|
+
}
|