@codingame/monaco-vscode-telemetry-service-override 36.2.7 → 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.
Files changed (46) hide show
  1. package/index.js +2 -1
  2. package/package.json +2 -2
  3. package/vscode/src/vs/base/common/editArcTracker.d.ts +29 -0
  4. package/vscode/src/vs/base/common/editArcTracker.js +291 -0
  5. package/vscode/src/vs/platform/agentHost/common/diffComputeService.d.ts +19 -0
  6. package/vscode/src/vs/platform/agentHost/common/fileEditAttribution.d.ts +107 -0
  7. package/vscode/src/vs/platform/agentHost/common/fileEditAttribution.js +59 -0
  8. package/vscode/src/vs/platform/agentHost/common/fileEditAttribution.service.d.ts +12 -0
  9. package/vscode/src/vs/platform/telemetry/browser/errorTelemetry.js +5 -5
  10. package/vscode/src/vs/platform/telemetry/common/1dsAppender.d.ts +2 -0
  11. package/vscode/src/vs/platform/telemetry/common/1dsAppender.js +12 -10
  12. package/vscode/src/vs/platform/telemetry/common/editArcTelemetry.d.ts +141 -0
  13. package/vscode/src/vs/platform/telemetry/common/editArcTelemetry.js +5 -0
  14. package/vscode/src/vs/platform/telemetry/common/editTelemetry.d.ts +49 -0
  15. package/vscode/src/vs/platform/telemetry/common/editTelemetry.js +10 -0
  16. package/vscode/src/vs/platform/telemetry/common/telemetryLogAppender.d.ts +5 -2
  17. package/vscode/src/vs/platform/telemetry/common/telemetryLogAppender.js +4 -3
  18. package/vscode/src/vs/platform/telemetry/common/telemetryService.d.ts +14 -4
  19. package/vscode/src/vs/platform/telemetry/common/telemetryService.js +50 -34
  20. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/editStats/aiStatsChart.js +1 -1
  21. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/editStats/aiStatsStatusBar.js +8 -8
  22. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/editTelemetry.contribution.js +12 -7
  23. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/editTelemetryContribution.js +2 -1
  24. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/helpers/documentWithAnnotatedEdits.d.ts +7 -1
  25. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/helpers/documentWithAnnotatedEdits.js +15 -2
  26. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/settingIds.d.ts +1 -1
  27. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/settingIds.js +1 -2
  28. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/agentHostEditMarkerService.d.ts +83 -0
  29. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/agentHostEditMarkerService.js +690 -0
  30. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/arcTelemetryReporter.d.ts +2 -2
  31. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/arcTelemetrySender.d.ts +3 -3
  32. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/arcTelemetrySender.js +3 -0
  33. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/editSourceTrackingFeature.js +11 -4
  34. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/editSourceTrackingImpl.d.ts +15 -4
  35. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/editSourceTrackingImpl.js +185 -83
  36. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/editTracker.d.ts +21 -5
  37. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/editTracker.js +128 -12
  38. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/scmAdapter.d.ts +7 -2
  39. package/vscode/src/vs/workbench/contrib/editTelemetry/common/arcTracker.d.ts +3 -11
  40. package/vscode/src/vs/workbench/contrib/editTelemetry/common/arcTracker.js +17 -47
  41. package/vscode/src/vs/workbench/contrib/telemetry/browser/telemetry.contribution.js +13 -2
  42. package/vscode/src/vs/workbench/services/policies/browser/policyTelemetry.contribution.d.ts +14 -0
  43. package/vscode/src/vs/workbench/services/policies/browser/policyTelemetry.contribution.js +134 -0
  44. package/vscode/src/vs/workbench/services/telemetry/browser/telemetryService.d.ts +1 -1
  45. package/vscode/src/vs/workbench/services/dataChannel/browser/dataChannelService.d.ts +0 -10
  46. package/vscode/src/vs/workbench/services/dataChannel/browser/dataChannelService.js +0 -30
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
3
3
  import { EditTelemetryContribution } from './editTelemetryContribution.js';
4
- import { AI_STATS_SETTING_ID, EDIT_TELEMETRY_SETTING_ID } from './settingIds.js';
4
+ import { AI_STATS_SETTING_ID } from './settingIds.js';
5
5
  import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
6
6
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
7
7
  import { EDIT_TELEMETRY_SHOW_DECORATIONS, EDIT_TELEMETRY_SHOW_STATUS_BAR, EDIT_TELEMETRY_DETAILS_SETTING_ID } from './settings.js';
@@ -10,6 +10,8 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/ext
10
10
  import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
11
11
  import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl';
12
12
  import '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
13
+ import { AgentHostEditTelemetryEnabledConfigKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostSchema';
14
+ import { EDIT_TELEMETRY_SETTING_ID } from '../../../../platform/telemetry/common/editArcTelemetry.js';
13
15
 
14
16
  registerWorkbenchContribution2(
15
17
  "EditTelemetryContribution",
@@ -20,12 +22,12 @@ const configurationRegistry = ( Registry.as(Extensions.Configuration));
20
22
  configurationRegistry.registerConfiguration({
21
23
  id: "task",
22
24
  order: 100,
23
- title: ( localize(10225, "Edit Telemetry")),
25
+ title: ( localize(12161, "Edit Telemetry")),
24
26
  type: "object",
25
27
  properties: {
26
28
  [EDIT_TELEMETRY_SETTING_ID]: {
27
29
  markdownDescription: ( localize(
28
- 10226,
30
+ 12162,
29
31
  "Controls whether to enable telemetry for edit statistics (only sends statistics if general telemetry is enabled)."
30
32
  )),
31
33
  type: "boolean",
@@ -33,11 +35,14 @@ configurationRegistry.registerConfiguration({
33
35
  tags: ["experimental"],
34
36
  experiment: {
35
37
  mode: "auto"
38
+ },
39
+ agentHost: {
40
+ key: AgentHostEditTelemetryEnabledConfigKey
36
41
  }
37
42
  },
38
43
  [AI_STATS_SETTING_ID]: {
39
44
  markdownDescription: ( localize(
40
- 10227,
45
+ 12163,
41
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."
42
47
  )),
43
48
  type: "boolean",
@@ -49,7 +54,7 @@ configurationRegistry.registerConfiguration({
49
54
  },
50
55
  [EDIT_TELEMETRY_DETAILS_SETTING_ID]: {
51
56
  markdownDescription: ( localize(
52
- 10228,
57
+ 12164,
53
58
  "Controls whether to enable telemetry for detailed edit statistics (only sends statistics if general telemetry is enabled)."
54
59
  )),
55
60
  type: "boolean",
@@ -60,13 +65,13 @@ configurationRegistry.registerConfiguration({
60
65
  }
61
66
  },
62
67
  [EDIT_TELEMETRY_SHOW_STATUS_BAR]: {
63
- markdownDescription: ( localize(10229, "Controls whether to show the status bar for edit telemetry.")),
68
+ markdownDescription: ( localize(12165, "Controls whether to show the status bar for edit telemetry.")),
64
69
  type: "boolean",
65
70
  default: false,
66
71
  tags: ["experimental"]
67
72
  },
68
73
  [EDIT_TELEMETRY_SHOW_DECORATIONS]: {
69
- markdownDescription: ( localize(10230, "Controls whether to show decorations for edit telemetry.")),
74
+ markdownDescription: ( localize(12166, "Controls whether to show decorations for edit telemetry.")),
70
75
  type: "boolean",
71
76
  default: false,
72
77
  tags: ["experimental"]
@@ -12,10 +12,11 @@ import { AnnotatedDocuments } from './helpers/annotatedDocuments.js';
12
12
  import { EditTrackingFeature } from './telemetry/editSourceTrackingFeature.js';
13
13
  import { VSCodeWorkspace } from './helpers/vscodeObservableWorkspace.js';
14
14
  import { AiStatsFeature } from './editStats/aiStatsFeature.js';
15
- import { EDIT_TELEMETRY_SETTING_ID, AI_STATS_SETTING_ID } from './settingIds.js';
15
+ import { AI_STATS_SETTING_ID } from './settingIds.js';
16
16
  import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
17
17
  import { AiContributionFeature } from './aiContributionFeature.js';
18
18
  import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
19
+ import { EDIT_TELEMETRY_SETTING_ID } from '../../../../platform/telemetry/common/editArcTelemetry.js';
19
20
  import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
20
21
 
21
22
  let EditTelemetryContribution = class EditTelemetryContribution extends Disposable {
@@ -47,7 +47,7 @@ export declare abstract class EditSourceBase {
47
47
  static create(reason: TextModelEditSource): EditSource;
48
48
  abstract getColor(): string;
49
49
  }
50
- export type EditSource = InlineSuggestEditSource | ChatEditSource | IdeEditSource | UserEditSource | UnknownEditSource | ExternalEditSource;
50
+ export type EditSource = InlineSuggestEditSource | ChatEditSource | AgentHostEditSource | IdeEditSource | UserEditSource | UnknownEditSource | ExternalEditSource;
51
51
  export declare class InlineSuggestEditSource extends EditSourceBase {
52
52
  readonly kind: "completion" | "nes";
53
53
  readonly extensionId: string;
@@ -67,6 +67,12 @@ declare class ChatEditSource extends EditSourceBase {
67
67
  toString(): string;
68
68
  getColor(): string;
69
69
  }
70
+ declare class AgentHostEditSource extends EditSourceBase {
71
+ readonly category = "agentHost";
72
+ readonly feature = "chat";
73
+ toString(): string;
74
+ getColor(): string;
75
+ }
70
76
  declare class IdeEditSource extends EditSourceBase {
71
77
  readonly feature: "suggest" | "format" | string;
72
78
  readonly category = "ide";
@@ -94,7 +94,7 @@ class EditSourceBase {
94
94
  }
95
95
  return this._cache.get(( new UnknownEditSource()));
96
96
  case "Chat.applyEdits":
97
- return this._cache.get(( new ChatEditSource("sidebar")));
97
+ return "$origin" in data && data.$origin === "agentHost" ? this._cache.get(( new AgentHostEditSource())) : this._cache.get(( new ChatEditSource("sidebar")));
98
98
  case "inlineChat.applyEdits":
99
99
  return this._cache.get(( new ChatEditSource("inline")));
100
100
  case "cursor":
@@ -115,7 +115,7 @@ class InlineSuggestEditSource extends EditSourceBase {
115
115
  this.feature = "inlineSuggest";
116
116
  }
117
117
  toString() {
118
- return `${this.category}/${this.feature}/${this.kind}/${this.extensionId}/${this.type}`;
118
+ return `${this.category}/${this.feature}/${this.kind}/${this.extensionId}/${this.providerId}/${this.type}`;
119
119
  }
120
120
  getColor() {
121
121
  return "#00ff0033";
@@ -135,6 +135,19 @@ class ChatEditSource extends EditSourceBase {
135
135
  return "#00ff0066";
136
136
  }
137
137
  }
138
+ class AgentHostEditSource extends EditSourceBase {
139
+ constructor() {
140
+ super(...arguments);
141
+ this.category = "agentHost";
142
+ this.feature = "chat";
143
+ }
144
+ toString() {
145
+ return `${this.category}/${this.feature}`;
146
+ }
147
+ getColor() {
148
+ return "#00ff0066";
149
+ }
150
+ }
138
151
  class IdeEditSource extends EditSourceBase {
139
152
  constructor(feature) {
140
153
  super();
@@ -1,2 +1,2 @@
1
- export declare const EDIT_TELEMETRY_SETTING_ID = "telemetry.editStats.enabled";
1
+ export { EDIT_TELEMETRY_SETTING_ID } from "../../../../platform/telemetry/common/editArcTelemetry.js";
2
2
  export declare const AI_STATS_SETTING_ID = "editor.aiStats.enabled";
@@ -1,6 +1,5 @@
1
1
 
2
2
 
3
- const EDIT_TELEMETRY_SETTING_ID = 'telemetry.editStats.enabled';
4
3
  const AI_STATS_SETTING_ID = 'editor.aiStats.enabled';
5
4
 
6
- export { AI_STATS_SETTING_ID, EDIT_TELEMETRY_SETTING_ID };
5
+ export { AI_STATS_SETTING_ID };
@@ -0,0 +1,83 @@
1
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
2
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
3
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
4
+ import { IAgentHostConnectionsService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostConnectionsService.service";
5
+ import { IUriIdentityService } from "@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service";
6
+ import { EditTelemetryTrigger } from "../../../../../platform/telemetry/common/editTelemetry.js";
7
+ import { TextModelEditSource } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/textModelEditSource";
8
+ export interface IAgentHostEditAttributionCoverageGap {
9
+ readonly editCount: number;
10
+ readonly insertedCount: number;
11
+ }
12
+ export interface IPreparedAgentHostEditAttributionFlush {
13
+ readonly flushToken: string;
14
+ readonly agentModifiedCount: number;
15
+ readonly lastSequence?: number;
16
+ readonly coverageGapThroughSequence?: number;
17
+ readonly deferCoverageGap?: boolean;
18
+ commit(totalModifiedCount: number): Promise<void>;
19
+ }
20
+ export declare class AgentHostEditAttributionUnknownOutcomeError extends Error {
21
+ constructor(cause: unknown);
22
+ }
23
+ export declare class AgentHostEditAttributionDeferredError extends Error {
24
+ constructor(cause: unknown);
25
+ }
26
+ export interface IAgentHostEditMarkerService {
27
+ createCorrelation(resource: URI): IExternalEditCorrelation;
28
+ takeCoverageGap?(resource: URI, throughSequence?: number): IAgentHostEditAttributionCoverageGap | undefined;
29
+ prepareFlush(resource: URI, trigger: EditTelemetryTrigger, statsUuid: string, isDirty: boolean, languageId?: string): Promise<IPreparedAgentHostEditAttributionFlush | undefined>;
30
+ }
31
+ export interface IExternalEditCorrelation {
32
+ readonly onDidSuppress: Event<string>;
33
+ readonly onDidResolve?: Event<IExternalEditCorrelationResolution>;
34
+ readonly onDidInvalidate: Event<string>;
35
+ register(before: string, after: string): string;
36
+ isSuppressed(id: string): boolean;
37
+ getResolution?(id: string): IExternalEditCorrelationResolution | undefined;
38
+ waitForResolution?(ids: readonly string[], timeoutMs: number): Promise<void>;
39
+ release(id: string): void;
40
+ }
41
+ export interface IExternalEditCorrelationResolution {
42
+ readonly id: string;
43
+ readonly source?: TextModelEditSource;
44
+ }
45
+ export declare class AgentHostEditMarkerService extends Disposable implements IAgentHostEditMarkerService {
46
+ private readonly _connectionsService;
47
+ private readonly _uriIdentityService;
48
+ private readonly _markers;
49
+ private readonly _observations;
50
+ private readonly _routes;
51
+ private readonly _coverageGaps;
52
+ private readonly _acknowledgedCoverageGapIds;
53
+ private readonly _pendingCoverageGapAcknowledgements;
54
+ private readonly _onDidSuppress;
55
+ private readonly _onDidResolve;
56
+ private readonly _onDidInvalidate;
57
+ private readonly _onDidReceiveMarker;
58
+ private readonly _connectionListeners;
59
+ constructor(_connectionsService: IAgentHostConnectionsService, _uriIdentityService: IUriIdentityService);
60
+ createCorrelation(resource: URI): IExternalEditCorrelation;
61
+ takeCoverageGap(resource: URI, throughSequence?: number): IAgentHostEditAttributionCoverageGap | undefined;
62
+ prepareFlush(resource: URI, trigger: EditTelemetryTrigger, statsUuid: string, isDirty: boolean, languageId?: string): Promise<IPreparedAgentHostEditAttributionFlush | undefined>;
63
+ private _recoverFailedPrepare;
64
+ private _waitForMarker;
65
+ private _resourceRead;
66
+ private _readOutcome;
67
+ private _updateConnectionListeners;
68
+ private _recordCoverageGap;
69
+ private _acknowledgeCoverageGaps;
70
+ private _recordCoverageGapAcknowledgement;
71
+ private _queuePendingCoverageGapAcknowledgements;
72
+ private _applyPendingCoverageGapAcknowledgements;
73
+ private _registerObservation;
74
+ private _recordMarker;
75
+ private _tryResolve;
76
+ private _retainObservation;
77
+ private _releaseObservation;
78
+ private _invalidateObservations;
79
+ private _prune;
80
+ private _key;
81
+ private _getObservation;
82
+ private _waitForResolution;
83
+ }