@vscode/chat-lib 0.4.1-9 → 0.5.1-0
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/src/_internal/extension/byok/node/openAIEndpoint.d.ts +2 -1
- package/dist/src/_internal/extension/byok/node/openAIEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/extension/byok/node/openAIEndpoint.js +6 -7
- package/dist/src/_internal/extension/byok/node/openAIEndpoint.js.map +1 -1
- package/dist/src/_internal/extension/common/constants.d.ts +0 -1
- package/dist/src/_internal/extension/common/constants.d.ts.map +1 -1
- package/dist/src/_internal/extension/common/constants.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/networking.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/networking.js +6 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/networking.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/model.d.ts +4 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/model.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/model.js +4 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/openai/model.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/snippy/connectionState.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/snippy/connectionState.js +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/snippy/connectionState.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/snippy/network.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/snippy/network.js +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/snippy/network.js.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts +9 -0
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js +71 -11
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js +6 -3
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts +17 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js +373 -57
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcherTelemetry.d.ts +6 -3
- package/dist/src/_internal/extension/prompt/node/chatMLFetcherTelemetry.d.ts.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcherTelemetry.js +9 -3
- package/dist/src/_internal/extension/prompt/node/chatMLFetcherTelemetry.js.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabEndpoint.d.ts +2 -1
- package/dist/src/_internal/extension/xtab/node/xtabEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabEndpoint.js +6 -3
- package/dist/src/_internal/extension/xtab/node/xtabEndpoint.js.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabNextCursorPredictor.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabNextCursorPredictor.js +1 -0
- package/dist/src/_internal/extension/xtab/node/xtabNextCursorPredictor.js.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts +2 -0
- package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js +24 -3
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js.map +1 -1
- package/dist/src/_internal/platform/authentication/node/copilotTokenManager.d.ts.map +1 -1
- package/dist/src/_internal/platform/authentication/node/copilotTokenManager.js +3 -0
- package/dist/src/_internal/platform/authentication/node/copilotTokenManager.js.map +1 -1
- package/dist/src/_internal/platform/chat/common/commonTypes.d.ts +2 -1
- package/dist/src/_internal/platform/chat/common/commonTypes.d.ts.map +1 -1
- package/dist/src/_internal/platform/chat/common/commonTypes.js +61 -17
- package/dist/src/_internal/platform/chat/common/commonTypes.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +18 -36
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +37 -51
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/capiClient.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/capiClient.js +1 -0
- package/dist/src/_internal/platform/endpoint/common/capiClient.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts +2 -1
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js +26 -7
- package/dist/src/_internal/platform/endpoint/common/chatModelCapabilities.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/endpointProvider.d.ts +3 -1
- package/dist/src/_internal/platform/endpoint/common/endpointProvider.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/endpointProvider.js +1 -0
- package/dist/src/_internal/platform/endpoint/common/endpointProvider.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.d.ts +2 -1
- package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.js +6 -3
- package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts +6 -2
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.js +34 -12
- package/dist/src/_internal/platform/endpoint/node/chatEndpoint.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/copilotChatEndpoint.d.ts +2 -1
- package/dist/src/_internal/platform/endpoint/node/copilotChatEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/copilotChatEndpoint.js +5 -3
- package/dist/src/_internal/platform/endpoint/node/copilotChatEndpoint.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/messagesApi.d.ts +1 -1
- package/dist/src/_internal/platform/endpoint/node/messagesApi.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/messagesApi.js +61 -7
- package/dist/src/_internal/platform/endpoint/node/messagesApi.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/proxyXtabEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/proxyXtabEndpoint.js +1 -0
- package/dist/src/_internal/platform/endpoint/node/proxyXtabEndpoint.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/responsesApi.d.ts +1 -0
- package/dist/src/_internal/platform/endpoint/node/responsesApi.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/responsesApi.js +14 -10
- package/dist/src/_internal/platform/endpoint/node/responsesApi.js.map +1 -1
- package/dist/src/_internal/platform/git/common/gitService.d.ts +9 -1
- package/dist/src/_internal/platform/git/common/gitService.d.ts.map +1 -1
- package/dist/src/_internal/platform/git/common/gitService.js +17 -5
- package/dist/src/_internal/platform/git/common/gitService.js.map +1 -1
- package/dist/src/_internal/platform/github/common/githubAPI.d.ts +12 -2
- package/dist/src/_internal/platform/github/common/githubAPI.d.ts.map +1 -1
- package/dist/src/_internal/platform/github/common/githubAPI.js +23 -12
- package/dist/src/_internal/platform/github/common/githubAPI.js.map +1 -1
- package/dist/src/_internal/platform/github/common/githubService.d.ts +11 -1
- package/dist/src/_internal/platform/github/common/githubService.d.ts.map +1 -1
- package/dist/src/_internal/platform/github/common/githubService.js +52 -14
- package/dist/src/_internal/platform/github/common/githubService.js.map +1 -1
- package/dist/src/_internal/platform/github/common/nullOctokitServiceImpl.d.ts +5 -2
- package/dist/src/_internal/platform/github/common/nullOctokitServiceImpl.d.ts.map +1 -1
- package/dist/src/_internal/platform/github/common/nullOctokitServiceImpl.js +4 -1
- package/dist/src/_internal/platform/github/common/nullOctokitServiceImpl.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.d.ts +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.js +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts +3 -0
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js +5 -0
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js.map +1 -1
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.d.ts.map +1 -1
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.js +1 -0
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/anthropic.d.ts +10 -11
- package/dist/src/_internal/platform/networking/common/anthropic.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/anthropic.js +28 -23
- package/dist/src/_internal/platform/networking/common/anthropic.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.d.ts +29 -0
- package/dist/src/_internal/platform/networking/common/fetcherService.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.js +29 -1
- package/dist/src/_internal/platform/networking/common/fetcherService.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.d.ts +7 -0
- package/dist/src/_internal/platform/networking/common/networking.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.js +5 -5
- package/dist/src/_internal/platform/networking/common/networking.js.map +1 -1
- package/dist/src/_internal/platform/networking/node/chatWebSocketManager.d.ts +83 -0
- package/dist/src/_internal/platform/networking/node/chatWebSocketManager.d.ts.map +1 -0
- package/dist/src/_internal/platform/networking/node/chatWebSocketManager.js +496 -0
- package/dist/src/_internal/platform/networking/node/chatWebSocketManager.js.map +1 -0
- package/dist/src/_internal/platform/networking/node/chatWebSocketTelemetry.d.ts +89 -0
- package/dist/src/_internal/platform/networking/node/chatWebSocketTelemetry.d.ts.map +1 -0
- package/dist/src/_internal/platform/networking/node/chatWebSocketTelemetry.js +269 -0
- package/dist/src/_internal/platform/networking/node/chatWebSocketTelemetry.js.map +1 -0
- package/dist/src/_internal/platform/otel/common/genAiAttributes.d.ts +104 -0
- package/dist/src/_internal/platform/otel/common/genAiAttributes.d.ts.map +1 -0
- package/dist/src/_internal/platform/otel/common/genAiAttributes.js +124 -0
- package/dist/src/_internal/platform/otel/common/genAiAttributes.js.map +1 -0
- package/dist/src/_internal/platform/otel/common/genAiEvents.d.ts +28 -0
- package/dist/src/_internal/platform/otel/common/genAiEvents.d.ts.map +1 -0
- package/dist/src/_internal/platform/otel/common/genAiEvents.js +91 -0
- package/dist/src/_internal/platform/otel/common/genAiEvents.js.map +1 -0
- package/dist/src/_internal/platform/otel/common/genAiMetrics.d.ts +30 -0
- package/dist/src/_internal/platform/otel/common/genAiMetrics.d.ts.map +1 -0
- package/dist/src/_internal/platform/otel/common/genAiMetrics.js +68 -0
- package/dist/src/_internal/platform/otel/common/genAiMetrics.js.map +1 -0
- package/dist/src/_internal/platform/otel/common/index.d.ts +8 -0
- package/dist/src/_internal/platform/otel/common/index.d.ts.map +1 -0
- package/dist/src/_internal/platform/otel/common/index.js +35 -0
- package/dist/src/_internal/platform/otel/common/index.js.map +1 -0
- package/dist/src/_internal/platform/otel/common/messageFormatters.d.ts +85 -0
- package/dist/src/_internal/platform/otel/common/messageFormatters.d.ts.map +1 -0
- package/dist/src/_internal/platform/otel/common/messageFormatters.js +122 -0
- package/dist/src/_internal/platform/otel/common/messageFormatters.js.map +1 -0
- package/dist/src/_internal/platform/otel/common/noopOtelService.d.ts +26 -0
- package/dist/src/_internal/platform/otel/common/noopOtelService.d.ts.map +1 -0
- package/dist/src/_internal/platform/otel/common/noopOtelService.js +51 -0
- package/dist/src/_internal/platform/otel/common/noopOtelService.js.map +1 -0
- package/dist/src/_internal/platform/otel/common/otelConfig.d.ts +35 -0
- package/dist/src/_internal/platform/otel/common/otelConfig.d.ts.map +1 -0
- package/dist/src/_internal/platform/otel/common/otelConfig.js +140 -0
- package/dist/src/_internal/platform/otel/common/otelConfig.js.map +1 -0
- package/dist/src/_internal/platform/otel/common/otelService.d.ts +160 -0
- package/dist/src/_internal/platform/otel/common/otelService.d.ts.map +1 -0
- package/dist/src/_internal/platform/otel/common/otelService.js +10 -0
- package/dist/src/_internal/platform/otel/common/otelService.js.map +1 -0
- package/dist/src/_internal/platform/proxyModels/node/proxyModelsService.d.ts.map +1 -1
- package/dist/src/_internal/platform/proxyModels/node/proxyModelsService.js +1 -0
- package/dist/src/_internal/platform/proxyModels/node/proxyModelsService.js.map +1 -1
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +10 -0
- package/dist/src/main.js.map +1 -1
- package/dist/src/package.json +267 -91
- package/package.json +4 -3
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ChatWebSocketTelemetrySender = void 0;
|
|
8
|
+
class ChatWebSocketTelemetrySender {
|
|
9
|
+
static sendConnectedTelemetry(telemetryService, properties) {
|
|
10
|
+
/* __GDPR__
|
|
11
|
+
"websocket.connected" : {
|
|
12
|
+
"owner": "chrmarti",
|
|
13
|
+
"comment": "Report a successful WebSocket connection.",
|
|
14
|
+
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
15
|
+
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
16
|
+
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
17
|
+
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
18
|
+
"connectDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Time to establish the WebSocket connection in milliseconds", "isMeasurement": true }
|
|
19
|
+
}
|
|
20
|
+
*/
|
|
21
|
+
telemetryService.sendTelemetryEvent('websocket.connected', { github: true, microsoft: true }, {
|
|
22
|
+
conversationId: properties.conversationId,
|
|
23
|
+
turnId: properties.turnId,
|
|
24
|
+
requestId: properties.requestId,
|
|
25
|
+
gitHubRequestId: properties.gitHubRequestId,
|
|
26
|
+
}, {
|
|
27
|
+
connectDurationMs: properties.connectDurationMs,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
static sendConnectErrorTelemetry(telemetryService, properties) {
|
|
31
|
+
/* __GDPR__
|
|
32
|
+
"websocket.connectError" : {
|
|
33
|
+
"owner": "chrmarti",
|
|
34
|
+
"comment": "Report a failed WebSocket connection attempt.",
|
|
35
|
+
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
36
|
+
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
37
|
+
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
38
|
+
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
39
|
+
"error": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Error message for the failed connection" },
|
|
40
|
+
"connectDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Time until the connection error in milliseconds", "isMeasurement": true }
|
|
41
|
+
}
|
|
42
|
+
*/
|
|
43
|
+
telemetryService.sendTelemetryErrorEvent('websocket.connectError', { github: true, microsoft: true }, {
|
|
44
|
+
conversationId: properties.conversationId,
|
|
45
|
+
turnId: properties.turnId,
|
|
46
|
+
requestId: properties.requestId,
|
|
47
|
+
gitHubRequestId: properties.gitHubRequestId,
|
|
48
|
+
error: properties.error,
|
|
49
|
+
}, {
|
|
50
|
+
connectDurationMs: properties.connectDurationMs,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
static sendCloseTelemetry(telemetryService, properties) {
|
|
54
|
+
/* __GDPR__
|
|
55
|
+
"websocket.close" : {
|
|
56
|
+
"owner": "chrmarti",
|
|
57
|
+
"comment": "Report a WebSocket connection close event.",
|
|
58
|
+
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
59
|
+
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
60
|
+
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
61
|
+
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
62
|
+
"closeReason": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Human-readable description of the close code" },
|
|
63
|
+
"closeEventReason": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Close event reason string from server" },
|
|
64
|
+
"closeEventWasClean": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the connection closed cleanly" },
|
|
65
|
+
"closeCode": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "WebSocket close code", "isMeasurement": true },
|
|
66
|
+
"totalSentMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages sent over this connection", "isMeasurement": true },
|
|
67
|
+
"totalReceivedMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages received over this connection", "isMeasurement": true },
|
|
68
|
+
"totalSentCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters sent over this connection", "isMeasurement": true },
|
|
69
|
+
"totalReceivedCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters received over this connection", "isMeasurement": true },
|
|
70
|
+
"connectionDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "How long the connection was open in milliseconds", "isMeasurement": true }
|
|
71
|
+
}
|
|
72
|
+
*/
|
|
73
|
+
telemetryService.sendTelemetryEvent('websocket.close', { github: true, microsoft: true }, {
|
|
74
|
+
conversationId: properties.conversationId,
|
|
75
|
+
turnId: properties.turnId,
|
|
76
|
+
requestId: properties.requestId,
|
|
77
|
+
gitHubRequestId: properties.gitHubRequestId,
|
|
78
|
+
closeReason: properties.closeReason,
|
|
79
|
+
closeEventReason: properties.closeEventReason,
|
|
80
|
+
closeEventWasClean: properties.closeEventWasClean,
|
|
81
|
+
}, {
|
|
82
|
+
closeCode: properties.closeCode,
|
|
83
|
+
totalSentMessageCount: properties.totalSentMessageCount,
|
|
84
|
+
totalReceivedMessageCount: properties.totalReceivedMessageCount,
|
|
85
|
+
totalSentCharacters: properties.totalSentCharacters,
|
|
86
|
+
totalReceivedCharacters: properties.totalReceivedCharacters,
|
|
87
|
+
connectionDurationMs: properties.connectionDurationMs,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
static sendErrorTelemetry(telemetryService, properties) {
|
|
91
|
+
/* __GDPR__
|
|
92
|
+
"websocket.error" : {
|
|
93
|
+
"owner": "chrmarti",
|
|
94
|
+
"comment": "Report a runtime error on an established WebSocket connection.",
|
|
95
|
+
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
96
|
+
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
97
|
+
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
98
|
+
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
99
|
+
"error": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Error message" },
|
|
100
|
+
"totalSentMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages sent over this connection", "isMeasurement": true },
|
|
101
|
+
"totalReceivedMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages received over this connection", "isMeasurement": true },
|
|
102
|
+
"totalSentCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters sent over this connection", "isMeasurement": true },
|
|
103
|
+
"totalReceivedCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters received over this connection", "isMeasurement": true },
|
|
104
|
+
"connectionDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "How long the connection was open before the error in milliseconds", "isMeasurement": true }
|
|
105
|
+
}
|
|
106
|
+
*/
|
|
107
|
+
telemetryService.sendTelemetryErrorEvent('websocket.error', { github: true, microsoft: true }, {
|
|
108
|
+
conversationId: properties.conversationId,
|
|
109
|
+
turnId: properties.turnId,
|
|
110
|
+
requestId: properties.requestId,
|
|
111
|
+
gitHubRequestId: properties.gitHubRequestId,
|
|
112
|
+
error: properties.error,
|
|
113
|
+
}, {
|
|
114
|
+
totalSentMessageCount: properties.totalSentMessageCount,
|
|
115
|
+
totalReceivedMessageCount: properties.totalReceivedMessageCount,
|
|
116
|
+
totalSentCharacters: properties.totalSentCharacters,
|
|
117
|
+
totalReceivedCharacters: properties.totalReceivedCharacters,
|
|
118
|
+
connectionDurationMs: properties.connectionDurationMs,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
static sendCloseDuringSetupTelemetry(telemetryService, properties) {
|
|
122
|
+
/* __GDPR__
|
|
123
|
+
"websocket.closeDuringSetup" : {
|
|
124
|
+
"owner": "chrmarti",
|
|
125
|
+
"comment": "Report when a WebSocket connection is closed during setup before fully opening.",
|
|
126
|
+
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
127
|
+
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
128
|
+
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
129
|
+
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
130
|
+
"closeReason": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Human-readable description of the close code" },
|
|
131
|
+
"closeEventReason": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Close event reason string from server" },
|
|
132
|
+
"closeEventWasClean": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the connection closed cleanly" },
|
|
133
|
+
"closeCode": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "WebSocket close code", "isMeasurement": true },
|
|
134
|
+
"connectDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Time until the connection was closed during setup in milliseconds", "isMeasurement": true }
|
|
135
|
+
}
|
|
136
|
+
*/
|
|
137
|
+
telemetryService.sendTelemetryErrorEvent('websocket.closeDuringSetup', { github: true, microsoft: true }, {
|
|
138
|
+
conversationId: properties.conversationId,
|
|
139
|
+
turnId: properties.turnId,
|
|
140
|
+
requestId: properties.requestId,
|
|
141
|
+
gitHubRequestId: properties.gitHubRequestId,
|
|
142
|
+
closeReason: properties.closeReason,
|
|
143
|
+
closeEventReason: properties.closeEventReason,
|
|
144
|
+
closeEventWasClean: properties.closeEventWasClean,
|
|
145
|
+
}, {
|
|
146
|
+
closeCode: properties.closeCode,
|
|
147
|
+
connectDurationMs: properties.connectDurationMs,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
static sendRequestSentTelemetry(telemetryService, properties) {
|
|
151
|
+
/* __GDPR__
|
|
152
|
+
"websocket.requestSent" : {
|
|
153
|
+
"owner": "chrmarti",
|
|
154
|
+
"comment": "Report when a request is sent over the WebSocket connection.",
|
|
155
|
+
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
156
|
+
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
157
|
+
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
158
|
+
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
159
|
+
"statefulMarkerMatched": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the connection stateful marker matched the previous_response_id sent in the request", "isMeasurement": true },
|
|
160
|
+
"totalSentMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages sent over this connection", "isMeasurement": true },
|
|
161
|
+
"totalReceivedMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages received over this connection", "isMeasurement": true },
|
|
162
|
+
"sentMessageCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Character count of this sent message payload", "isMeasurement": true },
|
|
163
|
+
"totalSentCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters sent over this connection", "isMeasurement": true },
|
|
164
|
+
"totalReceivedCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters received over this connection", "isMeasurement": true },
|
|
165
|
+
"connectionDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "How long the connection has been open when the request is sent in milliseconds", "isMeasurement": true }
|
|
166
|
+
}
|
|
167
|
+
*/
|
|
168
|
+
telemetryService.sendTelemetryEvent('websocket.requestSent', { github: true, microsoft: true }, {
|
|
169
|
+
conversationId: properties.conversationId,
|
|
170
|
+
turnId: properties.turnId,
|
|
171
|
+
requestId: properties.requestId,
|
|
172
|
+
gitHubRequestId: properties.gitHubRequestId,
|
|
173
|
+
}, {
|
|
174
|
+
statefulMarkerMatched: properties.statefulMarkerMatched ? 1 : 0,
|
|
175
|
+
totalSentMessageCount: properties.totalSentMessageCount,
|
|
176
|
+
totalReceivedMessageCount: properties.totalReceivedMessageCount,
|
|
177
|
+
sentMessageCharacters: properties.sentMessageCharacters,
|
|
178
|
+
totalSentCharacters: properties.totalSentCharacters,
|
|
179
|
+
totalReceivedCharacters: properties.totalReceivedCharacters,
|
|
180
|
+
connectionDurationMs: properties.connectionDurationMs,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
static sendMessageParseErrorTelemetry(telemetryService, properties) {
|
|
184
|
+
/* __GDPR__
|
|
185
|
+
"websocket.messageParseError" : {
|
|
186
|
+
"owner": "chrmarti",
|
|
187
|
+
"comment": "Report when a received websocket message fails JSON parsing.",
|
|
188
|
+
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
189
|
+
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
190
|
+
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
191
|
+
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
192
|
+
"error": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Parse error message" },
|
|
193
|
+
"totalSentMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages sent over this connection", "isMeasurement": true },
|
|
194
|
+
"totalReceivedMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages received over this connection", "isMeasurement": true },
|
|
195
|
+
"receivedMessageCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Character count of the received message that failed parsing", "isMeasurement": true },
|
|
196
|
+
"totalSentCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters sent over this connection", "isMeasurement": true },
|
|
197
|
+
"totalReceivedCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters received over this connection", "isMeasurement": true },
|
|
198
|
+
"connectionDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "How long the connection has been open when parsing fails in milliseconds", "isMeasurement": true }
|
|
199
|
+
}
|
|
200
|
+
*/
|
|
201
|
+
telemetryService.sendTelemetryErrorEvent('websocket.messageParseError', { github: true, microsoft: true }, {
|
|
202
|
+
conversationId: properties.conversationId,
|
|
203
|
+
turnId: properties.turnId,
|
|
204
|
+
requestId: properties.requestId,
|
|
205
|
+
gitHubRequestId: properties.gitHubRequestId,
|
|
206
|
+
error: properties.error,
|
|
207
|
+
}, {
|
|
208
|
+
totalSentMessageCount: properties.totalSentMessageCount,
|
|
209
|
+
totalReceivedMessageCount: properties.totalReceivedMessageCount,
|
|
210
|
+
receivedMessageCharacters: properties.receivedMessageCharacters,
|
|
211
|
+
totalSentCharacters: properties.totalSentCharacters,
|
|
212
|
+
totalReceivedCharacters: properties.totalReceivedCharacters,
|
|
213
|
+
connectionDurationMs: properties.connectionDurationMs,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
static sendRequestOutcomeTelemetry(telemetryService, properties) {
|
|
217
|
+
/* __GDPR__
|
|
218
|
+
"websocket.requestOutcome" : {
|
|
219
|
+
"owner": "chrmarti",
|
|
220
|
+
"comment": "Report terminal outcome for a websocket request.",
|
|
221
|
+
"conversationId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the conversation" },
|
|
222
|
+
"turnId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the turn" },
|
|
223
|
+
"requestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Id of the current turn request" },
|
|
224
|
+
"gitHubRequestId": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "GitHub request id if available" },
|
|
225
|
+
"requestOutcome": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Terminal outcome of the websocket request" },
|
|
226
|
+
"statefulMarkerMatched": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Whether the connection stateful marker matched the previous_response_id sent in the request", "isMeasurement": true },
|
|
227
|
+
"totalSentMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages sent over this connection", "isMeasurement": true },
|
|
228
|
+
"totalReceivedMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages received over this connection", "isMeasurement": true },
|
|
229
|
+
"totalSentCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters sent over this connection", "isMeasurement": true },
|
|
230
|
+
"totalReceivedCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Total characters received over this connection", "isMeasurement": true },
|
|
231
|
+
"requestSentMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages sent during this request", "isMeasurement": true },
|
|
232
|
+
"requestReceivedMessageCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of messages received during this request", "isMeasurement": true },
|
|
233
|
+
"requestSentCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of characters sent during this request", "isMeasurement": true },
|
|
234
|
+
"requestReceivedCharacters": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Number of characters received during this request", "isMeasurement": true },
|
|
235
|
+
"connectionDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "How long the connection has been open when the request ended in milliseconds", "isMeasurement": true },
|
|
236
|
+
"requestDurationMs": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "How long the request took before terminal outcome in milliseconds", "isMeasurement": true },
|
|
237
|
+
"closeCode": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "WebSocket close code when outcome is connection_closed", "isMeasurement": true },
|
|
238
|
+
"closeReason": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "WebSocket close reason when outcome is connection_closed" },
|
|
239
|
+
"serverErrorMessage": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Error message from server error event when outcome is server_error" },
|
|
240
|
+
"serverErrorCode": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "comment": "Error code from server error event when outcome is server_error" }
|
|
241
|
+
}
|
|
242
|
+
*/
|
|
243
|
+
telemetryService.sendTelemetryEvent('websocket.requestOutcome', { github: true, microsoft: true }, {
|
|
244
|
+
conversationId: properties.conversationId,
|
|
245
|
+
turnId: properties.turnId,
|
|
246
|
+
requestId: properties.requestId,
|
|
247
|
+
gitHubRequestId: properties.gitHubRequestId,
|
|
248
|
+
requestOutcome: properties.requestOutcome,
|
|
249
|
+
closeReason: properties.closeReason,
|
|
250
|
+
serverErrorMessage: properties.serverErrorMessage,
|
|
251
|
+
serverErrorCode: properties.serverErrorCode,
|
|
252
|
+
}, {
|
|
253
|
+
statefulMarkerMatched: properties.statefulMarkerMatched ? 1 : 0,
|
|
254
|
+
totalSentMessageCount: properties.totalSentMessageCount,
|
|
255
|
+
totalReceivedMessageCount: properties.totalReceivedMessageCount,
|
|
256
|
+
totalSentCharacters: properties.totalSentCharacters,
|
|
257
|
+
totalReceivedCharacters: properties.totalReceivedCharacters,
|
|
258
|
+
requestSentMessageCount: properties.requestSentMessageCount,
|
|
259
|
+
requestReceivedMessageCount: properties.requestReceivedMessageCount,
|
|
260
|
+
requestSentCharacters: properties.requestSentCharacters,
|
|
261
|
+
requestReceivedCharacters: properties.requestReceivedCharacters,
|
|
262
|
+
connectionDurationMs: properties.connectionDurationMs,
|
|
263
|
+
requestDurationMs: properties.requestDurationMs,
|
|
264
|
+
closeCode: properties.closeCode,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
exports.ChatWebSocketTelemetrySender = ChatWebSocketTelemetrySender;
|
|
269
|
+
//# sourceMappingURL=chatWebSocketTelemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatWebSocketTelemetry.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/networking/node/chatWebSocketTelemetry.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AA0FhG,MAAa,4BAA4B;IAEjC,MAAM,CAAC,sBAAsB,CACnC,gBAAmC,EACnC,UAAsD;QAEtD;;;;;;;;;;UAUE;QACF,gBAAgB,CAAC,kBAAkB,CAAC,qBAAqB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;YAC7F,cAAc,EAAE,UAAU,CAAC,cAAc;YACzC,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,eAAe,EAAE,UAAU,CAAC,eAAe;SAC3C,EAAE;YACF,iBAAiB,EAAE,UAAU,CAAC,iBAAiB;SAC/C,CAAC,CAAC;IACJ,CAAC;IAEM,MAAM,CAAC,yBAAyB,CACtC,gBAAmC,EACnC,UAAyD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T: "chat";
|
|
3
|
+
readonly INVOKE_AGENT: "invoke_agent";
|
|
4
|
+
readonly EXECUTE_TOOL: "execute_tool";
|
|
5
|
+
readonly EMBEDDINGS: "embeddings";
|
|
6
|
+
/** Extension-specific: standalone markdown content event */
|
|
7
|
+
readonly CONTENT_EVENT: "content_event";
|
|
8
|
+
};
|
|
9
|
+
export declare const GenAiProviderName: {
|
|
10
|
+
readonly GITHUB: "github";
|
|
11
|
+
readonly OPENAI: "openai";
|
|
12
|
+
readonly ANTHROPIC: "anthropic";
|
|
13
|
+
readonly AZURE_AI_OPENAI: "azure.ai.openai";
|
|
14
|
+
};
|
|
15
|
+
export declare const GenAiTokenType: {
|
|
16
|
+
readonly INPUT: "input";
|
|
17
|
+
readonly OUTPUT: "output";
|
|
18
|
+
};
|
|
19
|
+
export declare const GenAiToolType: {
|
|
20
|
+
readonly FUNCTION: "function";
|
|
21
|
+
readonly EXTENSION: "extension";
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* OTel GenAI semantic convention attribute keys.
|
|
25
|
+
* @see https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-spans.md
|
|
26
|
+
*/
|
|
27
|
+
export declare const GenAiAttr: {
|
|
28
|
+
readonly OPERATION_NAME: "gen_ai.operation.name";
|
|
29
|
+
readonly PROVIDER_NAME: "gen_ai.provider.name";
|
|
30
|
+
readonly REQUEST_MODEL: "gen_ai.request.model";
|
|
31
|
+
readonly REQUEST_TEMPERATURE: "gen_ai.request.temperature";
|
|
32
|
+
readonly REQUEST_MAX_TOKENS: "gen_ai.request.max_tokens";
|
|
33
|
+
readonly REQUEST_TOP_P: "gen_ai.request.top_p";
|
|
34
|
+
readonly REQUEST_FREQUENCY_PENALTY: "gen_ai.request.frequency_penalty";
|
|
35
|
+
readonly REQUEST_PRESENCE_PENALTY: "gen_ai.request.presence_penalty";
|
|
36
|
+
readonly REQUEST_SEED: "gen_ai.request.seed";
|
|
37
|
+
readonly REQUEST_STOP_SEQUENCES: "gen_ai.request.stop_sequences";
|
|
38
|
+
readonly RESPONSE_MODEL: "gen_ai.response.model";
|
|
39
|
+
readonly RESPONSE_ID: "gen_ai.response.id";
|
|
40
|
+
readonly RESPONSE_FINISH_REASONS: "gen_ai.response.finish_reasons";
|
|
41
|
+
readonly USAGE_INPUT_TOKENS: "gen_ai.usage.input_tokens";
|
|
42
|
+
readonly USAGE_OUTPUT_TOKENS: "gen_ai.usage.output_tokens";
|
|
43
|
+
readonly USAGE_CACHE_READ_INPUT_TOKENS: "gen_ai.usage.cache_read.input_tokens";
|
|
44
|
+
readonly USAGE_CACHE_CREATION_INPUT_TOKENS: "gen_ai.usage.cache_creation.input_tokens";
|
|
45
|
+
/** Custom: reasoning/thinking token count (not yet standardized in GenAI conventions) */
|
|
46
|
+
readonly USAGE_REASONING_TOKENS: "gen_ai.usage.reasoning_tokens";
|
|
47
|
+
readonly CONVERSATION_ID: "gen_ai.conversation.id";
|
|
48
|
+
readonly OUTPUT_TYPE: "gen_ai.output.type";
|
|
49
|
+
readonly TOKEN_TYPE: "gen_ai.token.type";
|
|
50
|
+
readonly AGENT_NAME: "gen_ai.agent.name";
|
|
51
|
+
readonly AGENT_ID: "gen_ai.agent.id";
|
|
52
|
+
readonly AGENT_VERSION: "gen_ai.agent.version";
|
|
53
|
+
readonly AGENT_DESCRIPTION: "gen_ai.agent.description";
|
|
54
|
+
readonly TOOL_NAME: "gen_ai.tool.name";
|
|
55
|
+
readonly TOOL_TYPE: "gen_ai.tool.type";
|
|
56
|
+
readonly TOOL_CALL_ID: "gen_ai.tool.call.id";
|
|
57
|
+
readonly TOOL_DESCRIPTION: "gen_ai.tool.description";
|
|
58
|
+
readonly TOOL_CALL_ARGUMENTS: "gen_ai.tool.call.arguments";
|
|
59
|
+
readonly TOOL_CALL_RESULT: "gen_ai.tool.call.result";
|
|
60
|
+
readonly INPUT_MESSAGES: "gen_ai.input.messages";
|
|
61
|
+
readonly OUTPUT_MESSAGES: "gen_ai.output.messages";
|
|
62
|
+
readonly SYSTEM_INSTRUCTIONS: "gen_ai.system_instructions";
|
|
63
|
+
readonly TOOL_DEFINITIONS: "gen_ai.tool.definitions";
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Extension-specific attribute keys (custom namespace).
|
|
67
|
+
*/
|
|
68
|
+
export declare const CopilotChatAttr: {
|
|
69
|
+
readonly LOCATION: "copilot_chat.location";
|
|
70
|
+
readonly INTENT: "copilot_chat.intent";
|
|
71
|
+
readonly TURN_INDEX: "copilot_chat.turn.index";
|
|
72
|
+
readonly TURN_COUNT: "copilot_chat.turn_count";
|
|
73
|
+
readonly TOOL_CALL_ROUND: "copilot_chat.tool_call_round";
|
|
74
|
+
readonly API_TYPE: "copilot_chat.api_type";
|
|
75
|
+
readonly FETCHER: "copilot_chat.fetcher";
|
|
76
|
+
readonly DEBUG_NAME: "copilot_chat.debug_name";
|
|
77
|
+
readonly ENDPOINT_TYPE: "copilot_chat.endpoint_type";
|
|
78
|
+
readonly MAX_PROMPT_TOKENS: "copilot_chat.request.max_prompt_tokens";
|
|
79
|
+
readonly TIME_TO_FIRST_TOKEN: "copilot_chat.time_to_first_token";
|
|
80
|
+
readonly SESSION_ID: "copilot_chat.session_id";
|
|
81
|
+
readonly SERVER_REQUEST_ID: "copilot_chat.server_request_id";
|
|
82
|
+
readonly CANCELED: "copilot_chat.canceled";
|
|
83
|
+
/** Extended thinking/reasoning content (content-gated) */
|
|
84
|
+
readonly REASONING_CONTENT: "copilot_chat.reasoning_content";
|
|
85
|
+
/** User's actual typed message text, extracted from prompt context */
|
|
86
|
+
readonly USER_REQUEST: "copilot_chat.user_request";
|
|
87
|
+
/** Resolved context section (code snippets, file contents, etc.) */
|
|
88
|
+
readonly PROMPT_CONTEXT: "copilot_chat.prompt_context";
|
|
89
|
+
/** Custom instructions section */
|
|
90
|
+
readonly PROMPT_INSTRUCTIONS: "copilot_chat.prompt_instructions";
|
|
91
|
+
/** VS Code chat session ID from CapturingToken — the definitive session identifier */
|
|
92
|
+
readonly CHAT_SESSION_ID: "copilot_chat.chat_session_id";
|
|
93
|
+
/** Markdown content for standalone content events */
|
|
94
|
+
readonly MARKDOWN_CONTENT: "copilot_chat.markdown_content";
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Standard OTel attributes used alongside GenAI attributes.
|
|
98
|
+
*/
|
|
99
|
+
export declare const StdAttr: {
|
|
100
|
+
readonly ERROR_TYPE: "error.type";
|
|
101
|
+
readonly SERVER_ADDRESS: "server.address";
|
|
102
|
+
readonly SERVER_PORT: "server.port";
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=genAiAttributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genAiAttributes.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/genAiAttributes.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB;;;;;IAK9B,4DAA4D;;CAEnD,CAAC;AAGX,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAGX,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAGX,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;IAyBrB,yFAAyF;;;;;;;;;;;;;;;;;;;CA6BhF,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;IAe3B,0DAA0D;;IAE1D,sEAAsE;;IAEtE,oEAAoE;;IAEpE,kCAAkC;;IAElC,sFAAsF;;IAEtF,qDAAqD;;CAE5C,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,OAAO;;;;CAIV,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.StdAttr = exports.CopilotChatAttr = exports.GenAiAttr = exports.GenAiToolType = exports.GenAiTokenType = exports.GenAiProviderName = exports.GenAiOperationName = void 0;
|
|
8
|
+
// gen_ai.operation.name values
|
|
9
|
+
exports.GenAiOperationName = {
|
|
10
|
+
CHAT: 'chat',
|
|
11
|
+
INVOKE_AGENT: 'invoke_agent',
|
|
12
|
+
EXECUTE_TOOL: 'execute_tool',
|
|
13
|
+
EMBEDDINGS: 'embeddings',
|
|
14
|
+
/** Extension-specific: standalone markdown content event */
|
|
15
|
+
CONTENT_EVENT: 'content_event',
|
|
16
|
+
};
|
|
17
|
+
// gen_ai.provider.name values
|
|
18
|
+
exports.GenAiProviderName = {
|
|
19
|
+
GITHUB: 'github',
|
|
20
|
+
OPENAI: 'openai',
|
|
21
|
+
ANTHROPIC: 'anthropic',
|
|
22
|
+
AZURE_AI_OPENAI: 'azure.ai.openai',
|
|
23
|
+
};
|
|
24
|
+
// gen_ai.token.type values
|
|
25
|
+
exports.GenAiTokenType = {
|
|
26
|
+
INPUT: 'input',
|
|
27
|
+
OUTPUT: 'output',
|
|
28
|
+
};
|
|
29
|
+
// gen_ai.tool.type values
|
|
30
|
+
exports.GenAiToolType = {
|
|
31
|
+
FUNCTION: 'function',
|
|
32
|
+
EXTENSION: 'extension',
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* OTel GenAI semantic convention attribute keys.
|
|
36
|
+
* @see https://github.com/open-telemetry/semantic-conventions/blob/main/docs/gen-ai/gen-ai-spans.md
|
|
37
|
+
*/
|
|
38
|
+
exports.GenAiAttr = {
|
|
39
|
+
// Core
|
|
40
|
+
OPERATION_NAME: 'gen_ai.operation.name',
|
|
41
|
+
PROVIDER_NAME: 'gen_ai.provider.name',
|
|
42
|
+
// Request
|
|
43
|
+
REQUEST_MODEL: 'gen_ai.request.model',
|
|
44
|
+
REQUEST_TEMPERATURE: 'gen_ai.request.temperature',
|
|
45
|
+
REQUEST_MAX_TOKENS: 'gen_ai.request.max_tokens',
|
|
46
|
+
REQUEST_TOP_P: 'gen_ai.request.top_p',
|
|
47
|
+
REQUEST_FREQUENCY_PENALTY: 'gen_ai.request.frequency_penalty',
|
|
48
|
+
REQUEST_PRESENCE_PENALTY: 'gen_ai.request.presence_penalty',
|
|
49
|
+
REQUEST_SEED: 'gen_ai.request.seed',
|
|
50
|
+
REQUEST_STOP_SEQUENCES: 'gen_ai.request.stop_sequences',
|
|
51
|
+
// Response
|
|
52
|
+
RESPONSE_MODEL: 'gen_ai.response.model',
|
|
53
|
+
RESPONSE_ID: 'gen_ai.response.id',
|
|
54
|
+
RESPONSE_FINISH_REASONS: 'gen_ai.response.finish_reasons',
|
|
55
|
+
// Usage
|
|
56
|
+
USAGE_INPUT_TOKENS: 'gen_ai.usage.input_tokens',
|
|
57
|
+
USAGE_OUTPUT_TOKENS: 'gen_ai.usage.output_tokens',
|
|
58
|
+
USAGE_CACHE_READ_INPUT_TOKENS: 'gen_ai.usage.cache_read.input_tokens',
|
|
59
|
+
USAGE_CACHE_CREATION_INPUT_TOKENS: 'gen_ai.usage.cache_creation.input_tokens',
|
|
60
|
+
/** Custom: reasoning/thinking token count (not yet standardized in GenAI conventions) */
|
|
61
|
+
USAGE_REASONING_TOKENS: 'gen_ai.usage.reasoning_tokens',
|
|
62
|
+
// Conversation
|
|
63
|
+
CONVERSATION_ID: 'gen_ai.conversation.id',
|
|
64
|
+
OUTPUT_TYPE: 'gen_ai.output.type',
|
|
65
|
+
// Token type (for metrics)
|
|
66
|
+
TOKEN_TYPE: 'gen_ai.token.type',
|
|
67
|
+
// Agent
|
|
68
|
+
AGENT_NAME: 'gen_ai.agent.name',
|
|
69
|
+
AGENT_ID: 'gen_ai.agent.id',
|
|
70
|
+
AGENT_VERSION: 'gen_ai.agent.version',
|
|
71
|
+
AGENT_DESCRIPTION: 'gen_ai.agent.description',
|
|
72
|
+
// Tool
|
|
73
|
+
TOOL_NAME: 'gen_ai.tool.name',
|
|
74
|
+
TOOL_TYPE: 'gen_ai.tool.type',
|
|
75
|
+
TOOL_CALL_ID: 'gen_ai.tool.call.id',
|
|
76
|
+
TOOL_DESCRIPTION: 'gen_ai.tool.description',
|
|
77
|
+
TOOL_CALL_ARGUMENTS: 'gen_ai.tool.call.arguments',
|
|
78
|
+
TOOL_CALL_RESULT: 'gen_ai.tool.call.result',
|
|
79
|
+
// Content (opt-in)
|
|
80
|
+
INPUT_MESSAGES: 'gen_ai.input.messages',
|
|
81
|
+
OUTPUT_MESSAGES: 'gen_ai.output.messages',
|
|
82
|
+
SYSTEM_INSTRUCTIONS: 'gen_ai.system_instructions',
|
|
83
|
+
TOOL_DEFINITIONS: 'gen_ai.tool.definitions',
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Extension-specific attribute keys (custom namespace).
|
|
87
|
+
*/
|
|
88
|
+
exports.CopilotChatAttr = {
|
|
89
|
+
LOCATION: 'copilot_chat.location',
|
|
90
|
+
INTENT: 'copilot_chat.intent',
|
|
91
|
+
TURN_INDEX: 'copilot_chat.turn.index',
|
|
92
|
+
TURN_COUNT: 'copilot_chat.turn_count',
|
|
93
|
+
TOOL_CALL_ROUND: 'copilot_chat.tool_call_round',
|
|
94
|
+
API_TYPE: 'copilot_chat.api_type',
|
|
95
|
+
FETCHER: 'copilot_chat.fetcher',
|
|
96
|
+
DEBUG_NAME: 'copilot_chat.debug_name',
|
|
97
|
+
ENDPOINT_TYPE: 'copilot_chat.endpoint_type',
|
|
98
|
+
MAX_PROMPT_TOKENS: 'copilot_chat.request.max_prompt_tokens',
|
|
99
|
+
TIME_TO_FIRST_TOKEN: 'copilot_chat.time_to_first_token',
|
|
100
|
+
SESSION_ID: 'copilot_chat.session_id',
|
|
101
|
+
SERVER_REQUEST_ID: 'copilot_chat.server_request_id',
|
|
102
|
+
CANCELED: 'copilot_chat.canceled',
|
|
103
|
+
/** Extended thinking/reasoning content (content-gated) */
|
|
104
|
+
REASONING_CONTENT: 'copilot_chat.reasoning_content',
|
|
105
|
+
/** User's actual typed message text, extracted from prompt context */
|
|
106
|
+
USER_REQUEST: 'copilot_chat.user_request',
|
|
107
|
+
/** Resolved context section (code snippets, file contents, etc.) */
|
|
108
|
+
PROMPT_CONTEXT: 'copilot_chat.prompt_context',
|
|
109
|
+
/** Custom instructions section */
|
|
110
|
+
PROMPT_INSTRUCTIONS: 'copilot_chat.prompt_instructions',
|
|
111
|
+
/** VS Code chat session ID from CapturingToken — the definitive session identifier */
|
|
112
|
+
CHAT_SESSION_ID: 'copilot_chat.chat_session_id',
|
|
113
|
+
/** Markdown content for standalone content events */
|
|
114
|
+
MARKDOWN_CONTENT: 'copilot_chat.markdown_content',
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Standard OTel attributes used alongside GenAI attributes.
|
|
118
|
+
*/
|
|
119
|
+
exports.StdAttr = {
|
|
120
|
+
ERROR_TYPE: 'error.type',
|
|
121
|
+
SERVER_ADDRESS: 'server.address',
|
|
122
|
+
SERVER_PORT: 'server.port',
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=genAiAttributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genAiAttributes.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/genAiAttributes.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG,+BAA+B;AAClB,QAAA,kBAAkB,GAAG;IACjC,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,4DAA4D;IAC5D,aAAa,EAAE,eAAe;CACrB,CAAC;AAEX,8BAA8B;AACjB,QAAA,iBAAiB,GAAG;IAChC,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,eAAe,EAAE,iBA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yB;IAE3C,mBAAmB;IACnB,cAAc,EAAE,uBAAuB;IACvC,eAAe,EAAE,wBAAwB;IACzC,mBAAmB,EAAE,4BAA4B;IACjD,gBAAgB,EAAE,yBAAyB;CAClC,CAAC;AAEX;;GAEG;AACU,QAAA,eAAe,GAAG;IAC9B,QAAQ,EAAE,uBAAuB;IACjC,MAAM,EAAE,qBAAqB;IAC7B,UAAU,EAAE,yBAAyB;IACrC,UAAU,EAAE,yBAAyB;IACrC,eAAe,EAAE,8BAA8B;IAC/C,QAAQ,EAAE,uBAAuB;IACjC,OAAO,EAAE,sBAAsB;IAC/B,UAAU,EAAE,yBAAyB;IACrC,aAAa,EAAE,4BAA4B;IAC3C,iBAAiB,EAAE,wCAAwC;IAC3D,mBAAmB,EAAE,kCAAkC;IACvD,UAAU,EAAE,yBAAyB;IACrC,iBAAiB,EAAE,gCAAgC;IACnD,QAAQ,EAAE,uBAAuB;IACjC,0DAA0D;IAC1D,iBAAiB,EAAE,gCAAgC;IACnD,sEAAsE;IACtE,YAAY,EAAE,2BAA2B;IACzC,oEAAoE;IACpE,cAAc,EAAE,6BAA6B;IAC7C,kCAAkC;IAClC,mBAAmB,EAAE,kCAAkC;IACvD,sFAAsF;IACtF,eAAe,EAAE,8BAA8B;IAC/C,qDAAqD;IACrD,gBAAgB,EAAE,+BAA+B;CACxC,CAAC;AAEX;;GAEG;AACU,QAAA,OAAO,GAAG;IACtB,UAAU,EAAE,YAAY;IACxB,cAAc,EAAE,gBAAgB;IAChC,WAAW,EAAE,aAAa;CACjB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { IOTelService } from './otelService';
|
|
2
|
+
/**
|
|
3
|
+
* Emit OTel GenAI standard events via the IOTelService abstraction.
|
|
4
|
+
*/
|
|
5
|
+
export declare function emitInferenceDetailsEvent(otel: IOTelService, request: {
|
|
6
|
+
model: string;
|
|
7
|
+
temperature?: number;
|
|
8
|
+
maxTokens?: number;
|
|
9
|
+
messages?: unknown;
|
|
10
|
+
systemMessage?: unknown;
|
|
11
|
+
tools?: unknown;
|
|
12
|
+
}, response: {
|
|
13
|
+
id?: string;
|
|
14
|
+
model?: string;
|
|
15
|
+
finishReasons?: string[];
|
|
16
|
+
inputTokens?: number;
|
|
17
|
+
outputTokens?: number;
|
|
18
|
+
} | undefined, error?: {
|
|
19
|
+
type: string;
|
|
20
|
+
message: string;
|
|
21
|
+
}): void;
|
|
22
|
+
/**
|
|
23
|
+
* Emit extension-specific events.
|
|
24
|
+
*/
|
|
25
|
+
export declare function emitSessionStartEvent(otel: IOTelService, sessionId: string, model: string, participant: string): void;
|
|
26
|
+
export declare function emitToolCallEvent(otel: IOTelService, toolName: string, durationMs: number, success: boolean, error?: string): void;
|
|
27
|
+
export declare function emitAgentTurnEvent(otel: IOTelService, turnIndex: number, inputTokens: number, outputTokens: number, toolCallCount: number): void;
|
|
28
|
+
//# sourceMappingURL=genAiEvents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genAiEvents.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/otel/common/genAiEvents.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;GAEG;AACH,wBAAgB,yBAAyB,CACxC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE;IACR,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB,EACD,QAAQ,EAAE;IACT,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,EACb,KAAK,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACvC,IAAI,CAoCN;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,GACjB,IAAI,CAON;AAED,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,CAAC,EAAE,MAAM,GACZ,IAAI,CAQN;AAED,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,GACnB,IAAI,CAQN"}
|