@codingame/monaco-vscode-telemetry-service-override 37.0.0 → 37.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/index.js CHANGED
@@ -8,6 +8,7 @@ import { DataChannelService } from '@codingame/monaco-vscode-api/vscode/vs/workb
8
8
  import './vscode/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.js';
9
9
  import './vscode/src/vs/workbench/contrib/editTelemetry/browser/editTelemetry.contribution.js';
10
10
  import './vscode/src/vs/workbench/contrib/bracketPairColorizer2Telemetry/browser/bracketPairColorizer2Telemetry.contribution.js';
11
+ import './vscode/src/vs/workbench/services/policies/browser/policyTelemetry.contribution.js';
11
12
 
12
13
  function getServiceOverride() {
13
14
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-telemetry-service-override",
3
- "version": "37.0.0",
3
+ "version": "37.1.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - telemetry service-override",
6
6
  "keywords": [],
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "37.0.0",
18
+ "@codingame/monaco-vscode-api": "37.1.0",
19
19
  "@microsoft/1ds-core-js": "3.2.18",
20
20
  "@microsoft/1ds-post-js": "3.2.18"
21
21
  },
@@ -20,7 +20,7 @@ let TelemetryLogAppender = class TelemetryLogAppender extends Disposable {
20
20
  const justLoggingAndNotSending = isLoggingOnly(productService, environmentService);
21
21
  const logSuffix = justLoggingAndNotSending ? " (Not Sent)" : "";
22
22
  this.logger = this._register(loggerService.createLogger(id, {
23
- name: ( localize(2423, "Telemetry{0}", logSuffix)),
23
+ name: ( localize(2469, "Telemetry{0}", logSuffix)),
24
24
  group: TelemetryLogGroup,
25
25
  hidden: true
26
26
  }));
@@ -180,28 +180,28 @@ let TelemetryService = class TelemetryService {
180
180
  TelemetryService = TelemetryService_1 = ( __decorate([( __param(1, IConfigurationService)), ( __param(2, IProductService))], TelemetryService));
181
181
  function getTelemetryLevelSettingDescription() {
182
182
  const telemetryText = ( localize(
183
- 2424,
183
+ 2470,
184
184
  "Controls {0} telemetry, first-party extension telemetry, and participating third-party extension telemetry. Some third party extensions might not respect this setting. Consult the specific extension's documentation to be sure. Telemetry helps us better understand how {0} is performing, where improvements need to be made, and how features are being used.",
185
185
  product.nameLong
186
186
  ));
187
187
  const externalLinksStatement = !product.privacyStatementUrl ? ( localize(
188
- 2425,
188
+ 2471,
189
189
  "Read more about the [data we collect]({0}).",
190
190
  "https://aka.ms/vscode-telemetry"
191
191
  )) : ( localize(
192
- 2426,
192
+ 2472,
193
193
  "Read more about the [data we collect]({0}) and our [privacy statement]({1}).",
194
194
  "https://aka.ms/vscode-telemetry",
195
195
  product.privacyStatementUrl
196
196
  ));
197
197
  const restartString = !isWeb ? ( localize(
198
- 2427,
198
+ 2473,
199
199
  "A full restart of the application is necessary for crash reporting changes to take effect."
200
200
  )) : "";
201
- const crashReportsHeader = ( localize(2428, "Crash Reports"));
202
- const errorsHeader = ( localize(2429, "Error Telemetry"));
203
- const usageHeader = ( localize(2430, "Usage Data"));
204
- const telemetryTableDescription = ( localize(2431, "The following table outlines the data sent with each setting:"));
201
+ const crashReportsHeader = ( localize(2474, "Crash Reports"));
202
+ const errorsHeader = ( localize(2475, "Error Telemetry"));
203
+ const usageHeader = ( localize(2476, "Usage Data"));
204
+ const telemetryTableDescription = ( localize(2477, "The following table outlines the data sent with each setting:"));
205
205
  const telemetryTable = `
206
206
  | | ${crashReportsHeader} | ${errorsHeader} | ${usageHeader} |
207
207
  |:------|:-------------:|:---------------:|:----------:|
@@ -211,7 +211,7 @@ function getTelemetryLevelSettingDescription() {
211
211
  | off | - | - | - |
212
212
  `;
213
213
  const deprecatedSettingNote = ( localize(
214
- 2432,
214
+ 2478,
215
215
  "****Note:*** If this setting is 'off', no telemetry will be sent regardless of other telemetry settings. If this setting is set to anything except 'off' and telemetry is disabled with deprecated settings, no telemetry will be sent.*"
216
216
  ));
217
217
  const telemetryDescription = `
@@ -233,7 +233,7 @@ configurationRegistry.registerConfiguration({
233
233
  "id": TELEMETRY_SECTION_ID,
234
234
  "order": 1,
235
235
  "type": "object",
236
- "title": ( localize(2433, "Telemetry")),
236
+ "title": ( localize(2479, "Telemetry")),
237
237
  "properties": {
238
238
  [TELEMETRY_SETTING_ID]: {
239
239
  "type": "string",
@@ -243,7 +243,7 @@ configurationRegistry.registerConfiguration({
243
243
  TelemetryConfiguration.CRASH,
244
244
  TelemetryConfiguration.OFF
245
245
  ],
246
- "enumDescriptions": [( localize(2434, "Sends usage data, errors, and crash reports.")), ( localize(2435, "Sends general error telemetry and crash reports.")), ( localize(2436, "Sends OS level crash reports.")), ( localize(2437, "Disables all product telemetry."))],
246
+ "enumDescriptions": [( localize(2480, "Sends usage data, errors, and crash reports.")), ( localize(2481, "Sends general error telemetry and crash reports.")), ( localize(2482, "Sends OS level crash reports.")), ( localize(2483, "Disables all product telemetry."))],
247
247
  "markdownDescription": getTelemetryLevelSettingDescription(),
248
248
  "default": TelemetryConfiguration.ON,
249
249
  "restricted": true,
@@ -256,20 +256,20 @@ configurationRegistry.registerConfiguration({
256
256
  localization: {
257
257
  description: {
258
258
  key: "telemetry.telemetryLevel.policyDescription",
259
- value: ( localize(2438, "Controls the level of telemetry."))
259
+ value: ( localize(2484, "Controls the level of telemetry."))
260
260
  },
261
261
  enumDescriptions: [{
262
262
  key: "telemetry.telemetryLevel.default",
263
- value: ( localize(2434, "Sends usage data, errors, and crash reports."))
263
+ value: ( localize(2480, "Sends usage data, errors, and crash reports."))
264
264
  }, {
265
265
  key: "telemetry.telemetryLevel.error",
266
- value: ( localize(2435, "Sends general error telemetry and crash reports."))
266
+ value: ( localize(2481, "Sends general error telemetry and crash reports."))
267
267
  }, {
268
268
  key: "telemetry.telemetryLevel.crash",
269
- value: ( localize(2436, "Sends OS level crash reports."))
269
+ value: ( localize(2482, "Sends OS level crash reports."))
270
270
  }, {
271
271
  key: "telemetry.telemetryLevel.off",
272
- value: ( localize(2437, "Disables all product telemetry."))
272
+ value: ( localize(2483, "Disables all product telemetry."))
273
273
  }]
274
274
  }
275
275
  }
@@ -278,7 +278,7 @@ configurationRegistry.registerConfiguration({
278
278
  type: "boolean",
279
279
  default: true,
280
280
  description: ( localize(
281
- 2439,
281
+ 2485,
282
282
  "Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."
283
283
  )),
284
284
  policy: {
@@ -289,7 +289,7 @@ configurationRegistry.registerConfiguration({
289
289
  description: {
290
290
  key: "telemetry.feedback.enabled",
291
291
  value: ( localize(
292
- 2439,
292
+ 2485,
293
293
  "Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."
294
294
  ))
295
295
  }
@@ -299,11 +299,11 @@ configurationRegistry.registerConfiguration({
299
299
  [TELEMETRY_OLD_SETTING_ID]: {
300
300
  "type": "boolean",
301
301
  "markdownDescription": !product.privacyStatementUrl ? ( localize(
302
- 2440,
302
+ 2486,
303
303
  "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made.",
304
304
  product.nameLong
305
305
  )) : ( localize(
306
- 2441,
306
+ 2487,
307
307
  "Enable diagnostic data to be collected. This helps us to better understand how {0} is performing and where improvements need to be made. [Read more]({1}) about what we collect and our privacy statement.",
308
308
  product.nameLong,
309
309
  product.privacyStatementUrl
@@ -311,7 +311,7 @@ configurationRegistry.registerConfiguration({
311
311
  "default": true,
312
312
  "restricted": true,
313
313
  "markdownDeprecationMessage": ( localize(
314
- 2442,
314
+ 2488,
315
315
  "If this setting is false, no telemetry will be sent regardless of the new setting's value. Deprecated in favor of the {0} setting.",
316
316
  `\`#${TELEMETRY_SETTING_ID}#\``
317
317
  )),
@@ -82,7 +82,7 @@ function createAiStatsChart(options) {
82
82
  text.setAttribute("text-anchor", "middle");
83
83
  text.setAttribute("fill", asCssVariable(chartsForeground));
84
84
  text.setAttribute("font-size", "11px");
85
- text.textContent = ( localize(11955, "No data yet"));
85
+ text.textContent = ( localize(12150, "No data yet"));
86
86
  g.appendChild(text);
87
87
  return container;
88
88
  }
@@ -36,8 +36,8 @@ let AiStatsStatusBar = class AiStatsStatusBar extends Disposable {
36
36
  const statusBarItem = this._createStatusBar().keepUpdated(reader.store);
37
37
  const store = this._register(( new DisposableStore()));
38
38
  reader.store.add(this._statusbarService.addEntry({
39
- name: ( localize(11956, "Inline Suggestions")),
40
- ariaLabel: ( localize(11957, "Inline suggestions status bar")),
39
+ name: ( localize(12151, "Inline Suggestions")),
40
+ ariaLabel: ( localize(12152, "Inline suggestions status bar")),
41
41
  text: "",
42
42
  tooltip: {
43
43
  element: async _token => {
@@ -140,7 +140,7 @@ function createAiStatsHover(options) {
140
140
  style: {
141
141
  flex: 1
142
142
  }
143
- }, [( localize(11958, "AI Usage Statistics"))]), n.div({
143
+ }, [( localize(12153, "AI Usage Statistics"))]), n.div({
144
144
  style: {
145
145
  marginLeft: "auto"
146
146
  }
@@ -151,7 +151,7 @@ function createAiStatsHover(options) {
151
151
  enabled: true,
152
152
  run: options.onOpenSettings,
153
153
  class: ThemeIcon.asClassName(Codicon.gear),
154
- tooltip: ( localize(11959, "Configure"))
154
+ tooltip: ( localize(12154, "Configure"))
155
155
  },
156
156
  options: {
157
157
  icon: true,
@@ -167,13 +167,13 @@ function createAiStatsHover(options) {
167
167
  flex: 1,
168
168
  paddingRight: "4px"
169
169
  }
170
- }, [( localize(11960, "AI vs Typing Average: {0}", aiRatePercent.get()))])]), n.div({
170
+ }, [( localize(12155, "AI vs Typing Average: {0}", aiRatePercent.get()))])]), n.div({
171
171
  style: {
172
172
  flex: 1,
173
173
  paddingRight: "4px"
174
174
  }
175
175
  }, [( localize(
176
- 11961,
176
+ 12156,
177
177
  "Accepted inline suggestions today: {0}",
178
178
  options.data.acceptedInlineSuggestionsToday.get()
179
179
  ))]),
@@ -195,14 +195,14 @@ function createAiStatsHover(options) {
195
195
  style: {
196
196
  flex: 1
197
197
  }
198
- }, [( chartViewMode.map(mode => mode === "days" ? ( localize(11962, "AI Rate by Day")) : ( localize(11963, "AI Rate by Session"))))]), n.div({
198
+ }, [( chartViewMode.map(mode => mode === "days" ? ( localize(12157, "AI Rate by Day")) : ( localize(12158, "AI Rate by Session"))))]), n.div({
199
199
  class: "chart-view-toggle",
200
200
  style: {
201
201
  marginLeft: "auto",
202
202
  display: "flex",
203
203
  gap: "2px"
204
204
  }
205
- }, [createToggleButton("days", ( localize(11964, "Days")), Codicon.calendar), createToggleButton("sessions", ( localize(11965, "Sessions")), Codicon.listFlat)])]),
205
+ }, [createToggleButton("days", ( localize(12159, "Days")), Codicon.calendar), createToggleButton("sessions", ( localize(12160, "Sessions")), Codicon.listFlat)])]),
206
206
  derived(reader => {
207
207
  const sessions = options.data.sessions.read(reader);
208
208
  const viewMode = chartViewMode.read(reader);
@@ -22,12 +22,12 @@ const configurationRegistry = ( Registry.as(Extensions.Configuration));
22
22
  configurationRegistry.registerConfiguration({
23
23
  id: "task",
24
24
  order: 100,
25
- title: ( localize(11966, "Edit Telemetry")),
25
+ title: ( localize(12161, "Edit Telemetry")),
26
26
  type: "object",
27
27
  properties: {
28
28
  [EDIT_TELEMETRY_SETTING_ID]: {
29
29
  markdownDescription: ( localize(
30
- 11967,
30
+ 12162,
31
31
  "Controls whether to enable telemetry for edit statistics (only sends statistics if general telemetry is enabled)."
32
32
  )),
33
33
  type: "boolean",
@@ -42,7 +42,7 @@ configurationRegistry.registerConfiguration({
42
42
  },
43
43
  [AI_STATS_SETTING_ID]: {
44
44
  markdownDescription: ( localize(
45
- 11968,
45
+ 12163,
46
46
  "Controls whether to enable AI statistics in the editor. The gauge shows the average AI rate across 5-minute sessions, where each session's rate is calculated as AI-inserted characters divided by total inserted characters."
47
47
  )),
48
48
  type: "boolean",
@@ -54,7 +54,7 @@ configurationRegistry.registerConfiguration({
54
54
  },
55
55
  [EDIT_TELEMETRY_DETAILS_SETTING_ID]: {
56
56
  markdownDescription: ( localize(
57
- 11969,
57
+ 12164,
58
58
  "Controls whether to enable telemetry for detailed edit statistics (only sends statistics if general telemetry is enabled)."
59
59
  )),
60
60
  type: "boolean",
@@ -65,13 +65,13 @@ configurationRegistry.registerConfiguration({
65
65
  }
66
66
  },
67
67
  [EDIT_TELEMETRY_SHOW_STATUS_BAR]: {
68
- markdownDescription: ( localize(11970, "Controls whether to show the status bar for edit telemetry.")),
68
+ markdownDescription: ( localize(12165, "Controls whether to show the status bar for edit telemetry.")),
69
69
  type: "boolean",
70
70
  default: false,
71
71
  tags: ["experimental"]
72
72
  },
73
73
  [EDIT_TELEMETRY_SHOW_DECORATIONS]: {
74
- markdownDescription: ( localize(11971, "Controls whether to show decorations for edit telemetry.")),
74
+ markdownDescription: ( localize(12166, "Controls whether to show decorations for edit telemetry.")),
75
75
  type: "boolean",
76
76
  default: false,
77
77
  tags: ["experimental"]
@@ -176,7 +176,7 @@ let TelemetryContribution = class TelemetryContribution extends Disposable {
176
176
  constructor() {
177
177
  super({
178
178
  id: "workbench.action.showTelemetry",
179
- title: ( localize2(16498, "Show Telemetry")),
179
+ title: ( localize2(16803, "Show Telemetry")),
180
180
  category: Categories.Developer,
181
181
  f1: true
182
182
  });
@@ -0,0 +1,14 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IPolicyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/policy/common/policy.service";
3
+ import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
4
+ import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
5
+ export declare class PolicyTelemetryContribution extends Disposable implements IWorkbenchContribution {
6
+ private readonly policyService;
7
+ private readonly telemetryService;
8
+ static readonly ID = "workbench.contrib.policyTelemetry";
9
+ private lastSignature;
10
+ private readonly scheduler;
11
+ constructor(policyService: IPolicyService, telemetryService: ITelemetryService);
12
+ private report;
13
+ private buildEvent;
14
+ }
@@ -0,0 +1,134 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { PolicyValueSource } from '@codingame/monaco-vscode-api/vscode/vs/platform/policy/common/policy';
6
+ import { IPolicyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/policy/common/policy.service';
7
+ import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
8
+ import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
9
+
10
+ var PolicyNames;
11
+ (function(PolicyNames) {
12
+ PolicyNames["DefaultModel"] = "ChatDefaultModel";
13
+ PolicyNames["ToolsAutoApprove"] = "ChatToolsAutoApprove";
14
+ PolicyNames["EnabledPlugins"] = "ChatEnabledPlugins";
15
+ PolicyNames["ExtraMarketplaces"] = "ChatExtraMarketplaces";
16
+ PolicyNames["StrictMarketplaces"] = "ChatStrictMarketplaces";
17
+ PolicyNames["ApprovedOrgs"] = "ChatApprovedAccountOrganizations";
18
+ PolicyNames["OtelEnabled"] = "CopilotOtelEnabled";
19
+ PolicyNames["TelemetryLevel"] = "TelemetryLevel";
20
+ PolicyNames["EnableFeedback"] = "EnableFeedback";
21
+ })(PolicyNames || (PolicyNames = {}));
22
+ let PolicyTelemetryContribution = class PolicyTelemetryContribution extends Disposable {
23
+ static {
24
+ this.ID = "workbench.contrib.policyTelemetry";
25
+ }
26
+ constructor(policyService, telemetryService) {
27
+ super();
28
+ this.policyService = policyService;
29
+ this.telemetryService = telemetryService;
30
+ this.scheduler = this._register(( new RunOnceScheduler(() => this.report(), 500)));
31
+ this.scheduler.schedule();
32
+ this._register(this.policyService.onDidChange(() => this.scheduler.schedule()));
33
+ }
34
+ report() {
35
+ const event = this.buildEvent();
36
+ const signature = JSON.stringify(event);
37
+ if (signature === this.lastSignature) {
38
+ return;
39
+ }
40
+ this.lastSignature = signature;
41
+ this.telemetryService.publicLog2("policy.applied", event);
42
+ }
43
+ buildEvent() {
44
+ const value = name => this.policyService.getPolicyValue(name);
45
+ let devicePolicyCount = 0;
46
+ let nativeMdmPolicyCount = 0;
47
+ let serverManagedSettingsPolicyCount = 0;
48
+ let fileManagedSettingsPolicyCount = 0;
49
+ let mixedManagedSettingsPolicyCount = 0;
50
+ let accountPolicyCount = 0;
51
+ let accountGatePolicyCount = 0;
52
+ for (const name in this.policyService.policyDefinitions) {
53
+ if (value(name) !== undefined) {
54
+ switch (this.policyService.getPolicyValueSource(name) ?? PolicyValueSource.Device) {
55
+ case PolicyValueSource.Device:
56
+ devicePolicyCount++;
57
+ break;
58
+ case PolicyValueSource.NativeMdm:
59
+ nativeMdmPolicyCount++;
60
+ break;
61
+ case PolicyValueSource.ServerManagedSettings:
62
+ serverManagedSettingsPolicyCount++;
63
+ break;
64
+ case PolicyValueSource.FileManagedSettings:
65
+ fileManagedSettingsPolicyCount++;
66
+ break;
67
+ case PolicyValueSource.MixedManagedSettings:
68
+ mixedManagedSettingsPolicyCount++;
69
+ break;
70
+ case PolicyValueSource.Account:
71
+ accountPolicyCount++;
72
+ break;
73
+ case PolicyValueSource.AccountGate:
74
+ accountGatePolicyCount++;
75
+ break;
76
+ }
77
+ }
78
+ }
79
+ const defaultModel = value(PolicyNames.DefaultModel);
80
+ const toolsAutoApprove = value(PolicyNames.ToolsAutoApprove);
81
+ const strictMarketplaces = value(PolicyNames.StrictMarketplaces);
82
+ const otel = value(PolicyNames.OtelEnabled);
83
+ const telemetryLevel = value(PolicyNames.TelemetryLevel);
84
+ return {
85
+ devicePolicyCount,
86
+ nativeMdmPolicyCount,
87
+ serverManagedSettingsPolicyCount,
88
+ fileManagedSettingsPolicyCount,
89
+ mixedManagedSettingsPolicyCount,
90
+ accountPolicyCount,
91
+ accountGatePolicyCount,
92
+ defaultModelSet: defaultModel !== undefined,
93
+ toolsAutoApproveSet: toolsAutoApprove !== undefined,
94
+ enabledPluginsSet: value(PolicyNames.EnabledPlugins) !== undefined,
95
+ extraMarketplacesSet: value(PolicyNames.ExtraMarketplaces) !== undefined,
96
+ strictMarketplacesSet: strictMarketplaces !== undefined,
97
+ approvedOrgsSet: value(PolicyNames.ApprovedOrgs) !== undefined,
98
+ otelSet: otel !== undefined,
99
+ telemetryLevelSet: telemetryLevel !== undefined,
100
+ enableFeedbackSet: value(PolicyNames.EnableFeedback) !== undefined,
101
+ defaultModelForcedToAuto: defaultModel === "auto",
102
+ toolsAutoApproveForcedOff: toolsAutoApprove === false,
103
+ strictMarketplacesLockdown: isEmptyMarketplaceAllowlist(strictMarketplaces),
104
+ otelForcedEnabled: otel === true,
105
+ telemetryLevel: telemetryLevelBucket(telemetryLevel)
106
+ };
107
+ }
108
+ };
109
+ PolicyTelemetryContribution = ( __decorate([( __param(0, IPolicyService)), ( __param(1, ITelemetryService))], PolicyTelemetryContribution));
110
+ function isEmptyMarketplaceAllowlist(rawValue) {
111
+ if (typeof rawValue !== "string") {
112
+ return false;
113
+ }
114
+ try {
115
+ const parsed = JSON.parse(rawValue);
116
+ return Array.isArray(parsed) && parsed.length === 0;
117
+ } catch {
118
+ return false;
119
+ }
120
+ }
121
+ const KNOWN_TELEMETRY_LEVELS = ( new Set(["off", "crash", "error", "all"]));
122
+ function telemetryLevelBucket(rawValue) {
123
+ if (rawValue === undefined) {
124
+ return undefined;
125
+ }
126
+ return typeof rawValue === "string" && ( KNOWN_TELEMETRY_LEVELS.has(rawValue)) ? rawValue : "unknown";
127
+ }
128
+ registerWorkbenchContribution2(
129
+ PolicyTelemetryContribution.ID,
130
+ PolicyTelemetryContribution,
131
+ WorkbenchPhase.AfterRestored
132
+ );
133
+
134
+ export { PolicyTelemetryContribution };