@opensumi/ide-core-common 2.27.3-next-1711421139.0 → 2.27.3-next-1711507853.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/lib/index.d.ts CHANGED
@@ -17,6 +17,7 @@ export * from './json-schema';
17
17
  export * from './reporter';
18
18
  export * from './connection';
19
19
  export * from './comparers';
20
+ export * from './range';
20
21
  export * from './problem-pattern';
21
22
  export * from './problem-matcher';
22
23
  export * from './task-definition';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC"}
package/lib/index.js CHANGED
@@ -20,6 +20,7 @@ tslib_1.__exportStar(require("./json-schema"), exports);
20
20
  tslib_1.__exportStar(require("./reporter"), exports);
21
21
  tslib_1.__exportStar(require("./connection"), exports);
22
22
  tslib_1.__exportStar(require("./comparers"), exports);
23
+ tslib_1.__exportStar(require("./range"), exports);
23
24
  tslib_1.__exportStar(require("./problem-pattern"), exports);
24
25
  tslib_1.__exportStar(require("./problem-matcher"), exports);
25
26
  tslib_1.__exportStar(require("./task-definition"), exports);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,sDAA4B;AAC5B,kEAAwC;AACxC,oDAA0B;AAC1B,mDAAyB;AACzB,sDAA4B;AAC5B,mDAAyB;AACzB,oDAA0B;AAC1B,iDAAuB;AACvB,qDAA2B;AAC3B,kDAAwB;AACxB,wDAA8B;AAC9B,oDAA0B;AAC1B,oDAA0B;AAC1B,gDAAsB;AACtB,wDAA8B;AAC9B,qDAA2B;AAC3B,uDAA6B;AAC7B,sDAA4B;AAC5B,4DAAkC;AAClC,4DAAkC;AAClC,4DAAkC;AAClC,sDAA4B;AAC5B,qDAA2B;AAC3B,kDAAwB;AACxB,gDAAsB;AACtB,uDAA6B;AAC7B,mDAAyB;AACzB,qDAA2B;AAC3B,qDAA2B;AAC3B,kDAAwB;AACxB,sDAA4B;AAC5B,iDAAuB;AACvB,kEAAwC;AACxC,6DAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,sDAA4B;AAC5B,kEAAwC;AACxC,oDAA0B;AAC1B,mDAAyB;AACzB,sDAA4B;AAC5B,mDAAyB;AACzB,oDAA0B;AAC1B,iDAAuB;AACvB,qDAA2B;AAC3B,kDAAwB;AACxB,wDAA8B;AAC9B,oDAA0B;AAC1B,oDAA0B;AAC1B,gDAAsB;AACtB,wDAA8B;AAC9B,qDAA2B;AAC3B,uDAA6B;AAC7B,sDAA4B;AAC5B,kDAAwB;AACxB,4DAAkC;AAClC,4DAAkC;AAClC,4DAAkC;AAClC,sDAA4B;AAC5B,qDAA2B;AAC3B,kDAAwB;AACxB,gDAAsB;AACtB,uDAA6B;AAC7B,mDAAyB;AACzB,qDAA2B;AAC3B,qDAA2B;AAC3B,kDAAwB;AACxB,sDAA4B;AAC5B,iDAAuB;AACvB,kEAAwC;AACxC,6DAAmC"}
package/lib/range.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import type { IPosition, IRange } from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
2
+ /**
3
+ * position 转换 range
4
+ * @param position
5
+ */
6
+ export declare function positionToRange(position: IPosition | number): IRange;
7
+ //# sourceMappingURL=range.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../src/range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,uDAAuD,CAAC;AAE/F;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAiBpE"}
package/lib/range.js ADDED
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.positionToRange = void 0;
4
+ /**
5
+ * position 转换 range
6
+ * @param position
7
+ */
8
+ function positionToRange(position) {
9
+ if (typeof position === 'number') {
10
+ return {
11
+ startLineNumber: position,
12
+ endLineNumber: position,
13
+ startColumn: 1,
14
+ endColumn: 1,
15
+ };
16
+ }
17
+ else {
18
+ const { lineNumber } = position;
19
+ return {
20
+ startLineNumber: lineNumber,
21
+ endLineNumber: lineNumber,
22
+ startColumn: 1,
23
+ endColumn: 1,
24
+ };
25
+ }
26
+ }
27
+ exports.positionToRange = positionToRange;
28
+ //# sourceMappingURL=range.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"range.js","sourceRoot":"","sources":["../src/range.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,SAAgB,eAAe,CAAC,QAA4B;IAC1D,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,OAAO;YACL,eAAe,EAAE,QAAQ;YACzB,aAAa,EAAE,QAAQ;YACvB,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,CAAC;SACb,CAAC;KACH;SAAM;QACL,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;QAChC,OAAO;YACL,eAAe,EAAE,UAAU;YAC3B,aAAa,EAAE,UAAU;YACzB,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,CAAC;SACb,CAAC;KACH;AACH,CAAC;AAjBD,0CAiBC"}
@@ -0,0 +1,74 @@
1
+ /// <reference types="node" />
2
+ import { CancellationToken } from '../utils';
3
+ export interface IAINativeCapabilities {
4
+ /**
5
+ * Use opensumi design UI style
6
+ */
7
+ supportsOpenSumiDesign?: boolean;
8
+ /**
9
+ * Problem panel uses ai capabilities
10
+ */
11
+ supportsMarkers?: boolean;
12
+ /**
13
+ * Use ai chat capabilities
14
+ */
15
+ supportsChatAssistant?: boolean;
16
+ /**
17
+ * Use inline chat capabilities
18
+ */
19
+ supportsInlineChat?: boolean;
20
+ /**
21
+ * Use code intelligent completion capabilities
22
+ */
23
+ supportsInlineCompletion?: boolean;
24
+ /**
25
+ * Use ai to intelligently resolve conflicts
26
+ */
27
+ supportsConflictResolve?: boolean;
28
+ }
29
+ export interface IAINativeConfig {
30
+ capabilities?: IAINativeCapabilities;
31
+ }
32
+ export interface IAICompletionResultModel {
33
+ sessionId: string;
34
+ codeModelList: Array<{
35
+ content: string;
36
+ }>;
37
+ isCancel?: boolean;
38
+ }
39
+ export declare const AIBackSerivceToken: unique symbol;
40
+ export declare const AIBackSerivcePath = "AIBackSerivcePath";
41
+ export interface IAIBackServiceResponse<T = string> {
42
+ errorCode?: number;
43
+ errorMsg?: string;
44
+ isCancel?: boolean;
45
+ data?: T;
46
+ }
47
+ export interface IAIBackServiceOption {
48
+ type?: string;
49
+ model?: string;
50
+ enableGptCache?: boolean;
51
+ }
52
+ export interface IAICompletionOption {
53
+ prompt: string;
54
+ suffix?: string;
55
+ language?: string;
56
+ fileUrl?: string;
57
+ sessionId?: string;
58
+ }
59
+ export interface IAIReportCompletionOption {
60
+ relationId: string;
61
+ sessionId: string;
62
+ accept: boolean;
63
+ repo?: string;
64
+ completionUseTime?: number;
65
+ renderingTime?: number;
66
+ }
67
+ export interface IAIBackService<BaseResponse extends IAIBackServiceResponse = IAIBackServiceResponse, StreamResponse extends NodeJS.ReadableStream = NodeJS.ReadableStream, CompletionResponse = IAICompletionResultModel> {
68
+ request<O extends IAIBackServiceOption>(input: string, options: O, cancelToken?: CancellationToken): Promise<BaseResponse>;
69
+ requestStream<O extends IAIBackServiceOption>(input: string, options: O, cancelToken?: CancellationToken): Promise<StreamResponse>;
70
+ requestCompletion<I extends IAICompletionOption>(input: I, cancelToken?: CancellationToken): Promise<CompletionResponse>;
71
+ reportCompletion<I extends IAIReportCompletionOption>(input: I): Promise<void>;
72
+ destroyStreamRequest?: (sessionId: string) => Promise<void>;
73
+ }
74
+ //# sourceMappingURL=ai-native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-native.d.ts","sourceRoot":"","sources":["../../src/types/ai-native.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;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ACzB,aAAa,CAAC,CAAC,SAAS,oBAAoB,EAC1C,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,CAAC,EACV,WAAW,CAAC,EAAE,iBAAiB,GAC9B,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3B,iBAAiB,CAAC,CAAC,SAAS,mBAAmB,EAC7C,KAAK,EAAE,CAAC,EACR,WAAW,CAAC,EAAE,iBAAiB,GAC9B,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC/B,gBAAgB,CAAC,CAAC,SAAS,yBAAyB,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,oBAAoB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AIBackSerivcePath = exports.AIBackSerivceToken = void 0;
4
+ exports.AIBackSerivceToken = Symbol('AIBackSerivceToken');
5
+ exports.AIBackSerivcePath = 'AIBackSerivcePath';
6
+ //# sourceMappingURL=ai-native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-native.js","sourceRoot":"","sources":["../../src/types/ai-native.ts"],"names":[],"mappings":";;;AAuCa,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAClD,QAAA,iBAAiB,GAAG,mBAAmB,CAAC"}
@@ -1,2 +1,12 @@
1
- export type { IMarkdownString } from '@opensumi/monaco-editor-core/esm/vs/base/common/htmlContent';
1
+ import { UriComponents } from '@opensumi/ide-utils';
2
+ export interface IMarkdownString {
3
+ value: string;
4
+ isTrusted?: boolean;
5
+ supportThemeIcons?: boolean;
6
+ supportHtml?: boolean;
7
+ baseUri?: UriComponents;
8
+ uris?: {
9
+ [href: string]: UriComponents;
10
+ };
11
+ }
2
12
  //# sourceMappingURL=markdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/types/markdown.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC"}
1
+ {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/types/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAA;KAAE,CAAC;CAC1C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/ide-core-common",
3
- "version": "2.27.3-next-1711421139.0",
3
+ "version": "2.27.3-next-1711507853.0",
4
4
  "description": "@opensumi/ide-core-common",
5
5
  "files": [
6
6
  "lib",
@@ -19,11 +19,11 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@opensumi/di": "^1.4.0",
22
- "@opensumi/ide-utils": "2.27.3-next-1711421139.0",
22
+ "@opensumi/ide-utils": "2.27.3-next-1711507853.0",
23
23
  "jschardet": "3.0.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@opensumi/ide-dev-tool": "2.27.3-next-1711421139.0"
26
+ "@opensumi/ide-dev-tool": "1.3.1"
27
27
  },
28
- "gitHead": "2e5376fa76415b0165d4f121a974a6ff36100e6a"
28
+ "gitHead": "1ac93d42302c5863fa68938d23b4b182f73c4e06"
29
29
  }
package/src/index.ts CHANGED
@@ -17,6 +17,7 @@ export * from './json-schema';
17
17
  export * from './reporter';
18
18
  export * from './connection';
19
19
  export * from './comparers';
20
+ export * from './range';
20
21
  export * from './problem-pattern';
21
22
  export * from './problem-matcher';
22
23
  export * from './task-definition';
package/src/range.ts ADDED
@@ -0,0 +1,24 @@
1
+ import type { IPosition, IRange } from '@opensumi/monaco-editor-core/esm/vs/editor/editor.api';
2
+
3
+ /**
4
+ * position 转换 range
5
+ * @param position
6
+ */
7
+ export function positionToRange(position: IPosition | number): IRange {
8
+ if (typeof position === 'number') {
9
+ return {
10
+ startLineNumber: position,
11
+ endLineNumber: position,
12
+ startColumn: 1,
13
+ endColumn: 1,
14
+ };
15
+ } else {
16
+ const { lineNumber } = position;
17
+ return {
18
+ startLineNumber: lineNumber,
19
+ endLineNumber: lineNumber,
20
+ startColumn: 1,
21
+ endColumn: 1,
22
+ };
23
+ }
24
+ }
@@ -0,0 +1,94 @@
1
+ import { CancellationToken } from '../utils';
2
+
3
+ export interface IAINativeCapabilities {
4
+ /**
5
+ * Use opensumi design UI style
6
+ */
7
+ supportsOpenSumiDesign?: boolean;
8
+ /**
9
+ * Problem panel uses ai capabilities
10
+ */
11
+ supportsMarkers?: boolean;
12
+ /**
13
+ * Use ai chat capabilities
14
+ */
15
+ supportsChatAssistant?: boolean;
16
+ /**
17
+ * Use inline chat capabilities
18
+ */
19
+ supportsInlineChat?: boolean;
20
+ /**
21
+ * Use code intelligent completion capabilities
22
+ */
23
+ supportsInlineCompletion?: boolean;
24
+ /**
25
+ * Use ai to intelligently resolve conflicts
26
+ */
27
+ supportsConflictResolve?: boolean;
28
+ }
29
+
30
+ export interface IAINativeConfig {
31
+ capabilities?: IAINativeCapabilities;
32
+ }
33
+
34
+ export interface IAICompletionResultModel {
35
+ sessionId: string;
36
+ codeModelList: Array<{ content: string }>;
37
+ isCancel?: boolean;
38
+ }
39
+
40
+ export const AIBackSerivceToken = Symbol('AIBackSerivceToken');
41
+ export const AIBackSerivcePath = 'AIBackSerivcePath';
42
+
43
+ export interface IAIBackServiceResponse<T = string> {
44
+ errorCode?: number;
45
+ errorMsg?: string;
46
+ isCancel?: boolean;
47
+ data?: T;
48
+ }
49
+
50
+ export interface IAIBackServiceOption {
51
+ type?: string;
52
+ model?: string;
53
+ enableGptCache?: boolean;
54
+ }
55
+
56
+ export interface IAICompletionOption {
57
+ prompt: string;
58
+ suffix?: string;
59
+ language?: string;
60
+ fileUrl?: string;
61
+ sessionId?: string;
62
+ }
63
+
64
+ export interface IAIReportCompletionOption {
65
+ relationId: string;
66
+ sessionId: string;
67
+ accept: boolean;
68
+ repo?: string;
69
+ completionUseTime?: number;
70
+ renderingTime?: number;
71
+ }
72
+
73
+ export interface IAIBackService<
74
+ BaseResponse extends IAIBackServiceResponse = IAIBackServiceResponse,
75
+ StreamResponse extends NodeJS.ReadableStream = NodeJS.ReadableStream,
76
+ CompletionResponse = IAICompletionResultModel,
77
+ > {
78
+ request<O extends IAIBackServiceOption>(
79
+ input: string,
80
+ options: O,
81
+ cancelToken?: CancellationToken,
82
+ ): Promise<BaseResponse>;
83
+ requestStream<O extends IAIBackServiceOption>(
84
+ input: string,
85
+ options: O,
86
+ cancelToken?: CancellationToken,
87
+ ): Promise<StreamResponse>;
88
+ requestCompletion<I extends IAICompletionOption>(
89
+ input: I,
90
+ cancelToken?: CancellationToken,
91
+ ): Promise<CompletionResponse>;
92
+ reportCompletion<I extends IAIReportCompletionOption>(input: I): Promise<void>;
93
+ destroyStreamRequest?: (sessionId: string) => Promise<void>;
94
+ }
@@ -1 +1,10 @@
1
- export type { IMarkdownString } from '@opensumi/monaco-editor-core/esm/vs/base/common/htmlContent';
1
+ import { UriComponents } from '@opensumi/ide-utils';
2
+
3
+ export interface IMarkdownString {
4
+ value: string;
5
+ isTrusted?: boolean;
6
+ supportThemeIcons?: boolean;
7
+ supportHtml?: boolean;
8
+ baseUri?: UriComponents;
9
+ uris?: { [href: string]: UriComponents };
10
+ }
@@ -1,134 +0,0 @@
1
- /// <reference types="node" />
2
- import { CancellationToken, MaybePromise } from '../../utils';
3
- import { IAIReportCompletionOption } from './reporter';
4
- export * from './reporter';
5
- export interface IAINativeCapabilities {
6
- /**
7
- * Use opensumi design UI style
8
- */
9
- supportsOpenSumiDesign?: boolean;
10
- /**
11
- * Problem panel uses ai capabilities
12
- */
13
- supportsMarkers?: boolean;
14
- /**
15
- * Use ai chat capabilities
16
- */
17
- supportsChatAssistant?: boolean;
18
- /**
19
- * Use inline chat capabilities
20
- */
21
- supportsInlineChat?: boolean;
22
- /**
23
- * Use code intelligent completion capabilities
24
- */
25
- supportsInlineCompletion?: boolean;
26
- /**
27
- * Use ai to intelligently resolve conflicts
28
- */
29
- supportsConflictResolve?: boolean;
30
- /**
31
- * Use ai to provide rename suggestions
32
- */
33
- supportsRenameSuggestions?: boolean;
34
- /**
35
- * Use ai terminal detection capabilities
36
- */
37
- supportsTerminalDetection?: boolean;
38
- /**
39
- * Use ai terminal command suggets capabilities
40
- */
41
- supportsTerminalCommandSuggest?: boolean;
42
- }
43
- export interface IAINativeLayout {
44
- useMergeRightWithLeftPanel?: boolean;
45
- useMenubarView?: boolean;
46
- }
47
- export interface IAINativeConfig {
48
- capabilities?: IAINativeCapabilities;
49
- layout?: IAINativeLayout;
50
- }
51
- export interface IAICompletionResultModel {
52
- sessionId: string;
53
- codeModelList: Array<{
54
- content: string;
55
- }>;
56
- isCancel?: boolean;
57
- }
58
- export declare const AIBackSerivceToken: unique symbol;
59
- export declare const AIBackSerivcePath = "AIBackSerivcePath";
60
- export interface IAIBackServiceResponse<T = string> {
61
- errorCode?: number;
62
- errorMsg?: string;
63
- isCancel?: boolean;
64
- data?: T;
65
- }
66
- export interface IAIBackServiceOption {
67
- type?: string;
68
- model?: string;
69
- enableGptCache?: boolean;
70
- sessionId?: string;
71
- }
72
- export interface IAICompletionOption {
73
- prompt: string;
74
- suffix?: string;
75
- language?: string;
76
- fileUrl?: string;
77
- sessionId?: string;
78
- }
79
- export interface IAIRenameSuggestionOption {
80
- prompt: string;
81
- language?: string;
82
- }
83
- export interface IAIBackService<BaseResponse extends IAIBackServiceResponse = IAIBackServiceResponse, StreamResponse extends NodeJS.ReadableStream = NodeJS.ReadableStream, CompletionResponse = IAICompletionResultModel> {
84
- request<O extends IAIBackServiceOption>(input: string, options: O, cancelToken?: CancellationToken): Promise<BaseResponse>;
85
- requestStream<O extends IAIBackServiceOption>(input: string, options: O, cancelToken?: CancellationToken): Promise<StreamResponse>;
86
- requestCompletion<I extends IAICompletionOption>(input: I, cancelToken?: CancellationToken): Promise<CompletionResponse>;
87
- reportCompletion<I extends IAIReportCompletionOption>(input: I): Promise<void>;
88
- destroyStreamRequest?: (sessionId: string) => Promise<void>;
89
- }
90
- export declare class ReplyResponse {
91
- readonly message: string;
92
- constructor(message: string);
93
- static is(response: any): boolean;
94
- }
95
- export declare class ErrorResponse {
96
- readonly error: any;
97
- readonly message?: string | undefined;
98
- constructor(error: any, message?: string | undefined);
99
- static is(response: any): boolean;
100
- }
101
- export declare class CancelResponse {
102
- readonly message?: string | undefined;
103
- readonly cancellation: boolean;
104
- constructor(message?: string | undefined);
105
- static is(response: any): boolean;
106
- }
107
- export type ChatResponse = ReplyResponse | ErrorResponse | CancelResponse;
108
- /**
109
- * DI Token
110
- */
111
- export declare const InlineChatFeatureRegistryToken: unique symbol;
112
- export declare const ChatFeatureRegistryToken: unique symbol;
113
- export declare const ResolveConflictRegistryToken: unique symbol;
114
- export declare const RenameCandidatesProviderRegistryToken: unique symbol;
115
- export declare const TerminalRegistryToken: unique symbol;
116
- export declare const ChatAgentViewServiceToken: unique symbol;
117
- /**
118
- * Contribute Registry
119
- */
120
- export interface IConflictContentMetadata {
121
- current: string;
122
- base: string;
123
- incoming: string;
124
- }
125
- export interface IResolveConflictHandler {
126
- providerRequest: (contentMetadata: IConflictContentMetadata, options: {
127
- isRegenerate: boolean;
128
- }, token: CancellationToken) => MaybePromise<ReplyResponse | ErrorResponse | CancelResponse>;
129
- }
130
- export interface IInternalResolveConflictRegistry {
131
- getThreeWayHandler(): IResolveConflictHandler | undefined;
132
- getTraditionalHandler(): IResolveConflictHandler | undefined;
133
- }
134
- //# sourceMappingURL=index.d.ts.map
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uB;IACtC,eAAe,EAAE,CACf,eAAe,EAAE,wBAAwB,EACzC,OAAO,EAAE;QAAE,YAAY,EAAE,OAAO,CAAA;KAAE,EAClC,KAAK,EAAE,iBAAiB,KACrB,YAAY,CAAC,aAAa,GAAG,aAAa,GAAG,cAAc,CAAC,CAAC;CACnE;AACD,MAAM,WAAW,gCAAgC;IAC/C,kBAAkB,IAAI,uBAAuB,GAAG,SAAS,CAAC;IAC1D,qBAAqB,IAAI,uBAAuB,GAAG,SAAS,CAAC;CAC9D"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChatAgentViewServiceToken = exports.TerminalRegistryToken = exports.RenameCandidatesProviderRegistryToken = exports.ResolveConflictRegistryToken = exports.ChatFeatureRegistryToken = exports.InlineChatFeatureRegistryToken = exports.CancelResponse = exports.ErrorResponse = exports.ReplyResponse = exports.AIBackSerivcePath = exports.AIBackSerivceToken = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./reporter"), exports);
6
- exports.AIBackSerivceToken = Symbol('AIBackSerivceToken');
7
- exports.AIBackSerivcePath = 'AIBackSerivcePath';
8
- class ReplyResponse {
9
- constructor(message) {
10
- this.message = message;
11
- }
12
- static is(response) {
13
- return response instanceof ReplyResponse || (typeof response === 'object' && response.message !== undefined);
14
- }
15
- }
16
- exports.ReplyResponse = ReplyResponse;
17
- class ErrorResponse {
18
- constructor(error, message) {
19
- this.error = error;
20
- this.message = message;
21
- }
22
- static is(response) {
23
- return response instanceof ErrorResponse || (typeof response === 'object' && response.error !== undefined);
24
- }
25
- }
26
- exports.ErrorResponse = ErrorResponse;
27
- class CancelResponse {
28
- constructor(message) {
29
- this.message = message;
30
- this.cancellation = true;
31
- }
32
- static is(response) {
33
- return response instanceof CancelResponse || (typeof response === 'object' && response.cancellation !== undefined);
34
- }
35
- }
36
- exports.CancelResponse = CancelResponse;
37
- /**
38
- * DI Token
39
- */
40
- exports.InlineChatFeatureRegistryToken = Symbol('InlineChatFeatureRegistryToken');
41
- exports.ChatFeatureRegistryToken = Symbol('ChatFeatureRegistryToken');
42
- exports.ResolveConflictRegistryToken = Symbol('ResolveConflictRegistryToken');
43
- exports.RenameCandidatesProviderRegistryToken = Symbol('RenameCandidatesProviderRegistryToken');
44
- exports.TerminalRegistryToken = Symbol('TerminalRegistryToken');
45
- exports.ChatAgentViewServiceToken = Symbol('ChatAgentViewServiceToken');
46
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/ai-native/index.ts"],"names":[],"mappings":";;;;AAGA,qDAA2B;AA2Dd,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AAClD,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAoDrD,MAAa,aAAa;IACxB,YAAqB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAAG,CAAC;IAExC,MAAM,CAAC,EAAE,CAAC,QAAa;QACrB,OAAO,QAAQ,YAAY,aAAa,IAAI,CAAC,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC;IAC/G,CAAC;CACF;AAND,sCAMC;AAED,MAAa,aAAa;IACxB,YAAqB,KAAU,EAAW,OAAgB;QAArC,UAAK,GAAL,KAAK,CAAK;QAAW,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;IAE9D,MAAM,CAAC,EAAE,CAAC,QAAa;QACrB,OAAO,QAAQ,YAAY,aAAa,IAAI,CAAC,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;IAC7G,CAAC;CACF;AAND,sCAMC;AAED,MAAa,cAAc;IAGzB,YAAqB,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;QAF5B,iBAAY,GAAY,IAAI,CAAC;IAEE,CAAC;IAEzC,MAAM,CAAC,EAAE,CAAC,QAAa;QACrB,OAAO,QAAQ,YAAY,cAAc,IAAI,CAAC,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC;IACrH,CAAC;CACF;AARD,wCAQC;AAID;;GAEG;AACU,QAAA,8BAA8B,GAAG,MAAM,CAAC,gCAAgC,CAAC,CAAC;AAC1E,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAC9D,QAAA,4BAA4B,GAAG,MAAM,CAAC,8BAA8B,CAAC,CAAC;AACtE,QAAA,qCAAqC,GAAG,MAAM,CAAC,uCAAuC,CAAC,CAAC;AACxF,QAAA,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAExD,QAAA,yBAAyB,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAC"}
@@ -1,62 +0,0 @@
1
- export declare const AI_REPORTER_NAME = "AI";
2
- export declare enum AISerivceType {
3
- Chat = "chat",
4
- Completion = "completion",
5
- Agent = "agent",
6
- MergeConflict = "mergeConflict"
7
- }
8
- export interface CommonLogInfo {
9
- msgType: AISerivceType | string;
10
- relationId: string;
11
- replytime: number;
12
- success: boolean;
13
- message: string;
14
- isStart: boolean;
15
- isLike: boolean;
16
- isValid: boolean;
17
- model: string;
18
- copy: boolean;
19
- insert: boolean;
20
- }
21
- export interface CompletionRT extends Partial<CommonLogInfo> {
22
- isReceive?: boolean;
23
- isStop?: boolean;
24
- completionNum?: number;
25
- renderingTime?: number;
26
- }
27
- export interface IAIReportCompletionOption {
28
- relationId: string;
29
- sessionId: string;
30
- accept: boolean;
31
- repo?: string;
32
- completionUseTime?: number;
33
- renderingTime?: number;
34
- }
35
- export declare enum MergeConflictEditorMode {
36
- '3way' = "3way",
37
- 'traditional' = "traditional"
38
- }
39
- export interface MergeConflictRT extends Partial<CommonLogInfo> {
40
- editorMode: MergeConflictEditorMode;
41
- conflictPointNum: number;
42
- useAiConflictPointNum: number;
43
- receiveNum: number;
44
- clickNum: number;
45
- clickAllNum: number;
46
- aiOutputNum: number;
47
- cancelNum: number;
48
- }
49
- export type ReportInfo = Partial<CommonLogInfo> | ({
50
- type: AISerivceType.Completion;
51
- } & CompletionRT) | ({
52
- type: AISerivceType.MergeConflict;
53
- } & MergeConflictRT);
54
- export declare const IAIReporter: unique symbol;
55
- export interface IAIReporter {
56
- getCommonReportInfo(): Record<string, unknown>;
57
- getCacheReportInfo<T = ReportInfo>(relationId: string): T | undefined;
58
- record(data: ReportInfo, relationId?: string): ReportInfo;
59
- start(msg: string, data: ReportInfo): string;
60
- end(relationId: string, data: ReportInfo): void;
61
- }
62
- //# sourceMappingURL=reporter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../../src/types/ai-native/reporter.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,aAAa,kBAAkB;CAChC;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,aAAa,GAAG,MAAM,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAEhB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,YAAa,SAAQ,OAAO,CAAC,aAAa,CAAC;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC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G,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CACjD"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IAIReporter = exports.MergeConflictEditorMode = exports.AISerivceType = exports.AI_REPORTER_NAME = void 0;
4
- exports.AI_REPORTER_NAME = 'AI';
5
- var AISerivceType;
6
- (function (AISerivceType) {
7
- AISerivceType["Chat"] = "chat";
8
- AISerivceType["Completion"] = "completion";
9
- AISerivceType["Agent"] = "agent";
10
- AISerivceType["MergeConflict"] = "mergeConflict";
11
- })(AISerivceType = exports.AISerivceType || (exports.AISerivceType = {}));
12
- var MergeConflictEditorMode;
13
- (function (MergeConflictEditorMode) {
14
- MergeConflictEditorMode["3way"] = "3way";
15
- MergeConflictEditorMode["traditional"] = "traditional";
16
- })(MergeConflictEditorMode = exports.MergeConflictEditorMode || (exports.MergeConflictEditorMode = {}));
17
- exports.IAIReporter = Symbol('IAIReporter');
18
- //# sourceMappingURL=reporter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../../src/types/ai-native/reporter.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,IAAI,CAAC;AAErC,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,0CAAyB,CAAA;IACzB,gCAAe,CAAA;IACf,gDAA+B,CAAA;AACjC,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB;AAoCD,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,wCAAe,CAAA;IACf,sDAA6B,CAAA;AAC/B,CAAC,EAHW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAGlC;AA0BY,QAAA,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC"}
@@ -1,173 +0,0 @@
1
- import { CancellationToken, MaybePromise } from '../../utils';
2
-
3
- import { IAIReportCompletionOption } from './reporter';
4
- export * from './reporter';
5
-
6
- export interface IAINativeCapabilities {
7
- /**
8
- * Use opensumi design UI style
9
- */
10
- supportsOpenSumiDesign?: boolean;
11
- /**
12
- * Problem panel uses ai capabilities
13
- */
14
- supportsMarkers?: boolean;
15
- /**
16
- * Use ai chat capabilities
17
- */
18
- supportsChatAssistant?: boolean;
19
- /**
20
- * Use inline chat capabilities
21
- */
22
- supportsInlineChat?: boolean;
23
- /**
24
- * Use code intelligent completion capabilities
25
- */
26
- supportsInlineCompletion?: boolean;
27
- /**
28
- * Use ai to intelligently resolve conflicts
29
- */
30
- supportsConflictResolve?: boolean;
31
- /**
32
- * Use ai to provide rename suggestions
33
- */
34
- supportsRenameSuggestions?: boolean;
35
- /**
36
- * Use ai terminal detection capabilities
37
- */
38
- supportsTerminalDetection?: boolean;
39
- /**
40
- * Use ai terminal command suggets capabilities
41
- */
42
- supportsTerminalCommandSuggest?: boolean;
43
- }
44
-
45
- export interface IAINativeLayout {
46
- // Use Merge right panel with left panel
47
- useMergeRightWithLeftPanel?: boolean;
48
- // Use ai manubar view
49
- useMenubarView?: boolean;
50
- }
51
-
52
- export interface IAINativeConfig {
53
- capabilities?: IAINativeCapabilities;
54
- layout?: IAINativeLayout;
55
- }
56
-
57
- export interface IAICompletionResultModel {
58
- sessionId: string;
59
- codeModelList: Array<{ content: string }>;
60
- isCancel?: boolean;
61
- }
62
-
63
- export const AIBackSerivceToken = Symbol('AIBackSerivceToken');
64
- export const AIBackSerivcePath = 'AIBackSerivcePath';
65
-
66
- export interface IAIBackServiceResponse<T = string> {
67
- errorCode?: number;
68
- errorMsg?: string;
69
- isCancel?: boolean;
70
- data?: T;
71
- }
72
-
73
- export interface IAIBackServiceOption {
74
- type?: string;
75
- model?: string;
76
- enableGptCache?: boolean;
77
- sessionId?: string;
78
- }
79
-
80
- export interface IAICompletionOption {
81
- prompt: string;
82
- suffix?: string;
83
- language?: string;
84
- fileUrl?: string;
85
- sessionId?: string;
86
- }
87
-
88
- export interface IAIRenameSuggestionOption {
89
- prompt: string;
90
- language?: string;
91
- }
92
-
93
- export interface IAIBackService<
94
- BaseResponse extends IAIBackServiceResponse = IAIBackServiceResponse,
95
- StreamResponse extends NodeJS.ReadableStream = NodeJS.ReadableStream,
96
- CompletionResponse = IAICompletionResultModel,
97
- > {
98
- request<O extends IAIBackServiceOption>(
99
- input: string,
100
- options: O,
101
- cancelToken?: CancellationToken,
102
- ): Promise<BaseResponse>;
103
- requestStream<O extends IAIBackServiceOption>(
104
- input: string,
105
- options: O,
106
- cancelToken?: CancellationToken,
107
- ): Promise<StreamResponse>;
108
- requestCompletion<I extends IAICompletionOption>(
109
- input: I,
110
- cancelToken?: CancellationToken,
111
- ): Promise<CompletionResponse>;
112
- reportCompletion<I extends IAIReportCompletionOption>(input: I): Promise<void>;
113
- destroyStreamRequest?: (sessionId: string) => Promise<void>;
114
- }
115
-
116
- export class ReplyResponse {
117
- constructor(readonly message: string) {}
118
-
119
- static is(response: any): boolean {
120
- return response instanceof ReplyResponse || (typeof response === 'object' && response.message !== undefined);
121
- }
122
- }
123
-
124
- export class ErrorResponse {
125
- constructor(readonly error: any, readonly message?: string) {}
126
-
127
- static is(response: any): boolean {
128
- return response instanceof ErrorResponse || (typeof response === 'object' && response.error !== undefined);
129
- }
130
- }
131
-
132
- export class CancelResponse {
133
- readonly cancellation: boolean = true;
134
-
135
- constructor(readonly message?: string) {}
136
-
137
- static is(response: any): boolean {
138
- return response instanceof CancelResponse || (typeof response === 'object' && response.cancellation !== undefined);
139
- }
140
- }
141
-
142
- export type ChatResponse = ReplyResponse | ErrorResponse | CancelResponse;
143
-
144
- /**
145
- * DI Token
146
- */
147
- export const InlineChatFeatureRegistryToken = Symbol('InlineChatFeatureRegistryToken');
148
- export const ChatFeatureRegistryToken = Symbol('ChatFeatureRegistryToken');
149
- export const ResolveConflictRegistryToken = Symbol('ResolveConflictRegistryToken');
150
- export const RenameCandidatesProviderRegistryToken = Symbol('RenameCandidatesProviderRegistryToken');
151
- export const TerminalRegistryToken = Symbol('TerminalRegistryToken');
152
-
153
- export const ChatAgentViewServiceToken = Symbol('ChatAgentViewServiceToken');
154
-
155
- /**
156
- * Contribute Registry
157
- */
158
- export interface IConflictContentMetadata {
159
- current: string;
160
- base: string;
161
- incoming: string;
162
- }
163
- export interface IResolveConflictHandler {
164
- providerRequest: (
165
- contentMetadata: IConflictContentMetadata,
166
- options: { isRegenerate: boolean },
167
- token: CancellationToken,
168
- ) => MaybePromise<ReplyResponse | ErrorResponse | CancelResponse>;
169
- }
170
- export interface IInternalResolveConflictRegistry {
171
- getThreeWayHandler(): IResolveConflictHandler | undefined;
172
- getTraditionalHandler(): IResolveConflictHandler | undefined;
173
- }
@@ -1,82 +0,0 @@
1
- export const AI_REPORTER_NAME = 'AI';
2
-
3
- export enum AISerivceType {
4
- Chat = 'chat',
5
- Completion = 'completion',
6
- Agent = 'agent',
7
- MergeConflict = 'mergeConflict',
8
- }
9
-
10
- export interface CommonLogInfo {
11
- msgType: AISerivceType | string;
12
- relationId: string;
13
- replytime: number;
14
- success: boolean;
15
- message: string;
16
- isStart: boolean;
17
- isLike: boolean;
18
- // 是否有效
19
- isValid: boolean;
20
- model: string;
21
- copy: boolean;
22
- insert: boolean;
23
- }
24
-
25
- export interface CompletionRT extends Partial<CommonLogInfo> {
26
- isReceive?: boolean;
27
- // 是否取消
28
- isStop?: boolean;
29
- // 补全条数
30
- completionNum?: number;
31
- // 渲染时长
32
- renderingTime?: number;
33
- }
34
-
35
- export interface IAIReportCompletionOption {
36
- relationId: string;
37
- sessionId: string;
38
- accept: boolean;
39
- repo?: string;
40
- completionUseTime?: number;
41
- renderingTime?: number;
42
- }
43
-
44
- export enum MergeConflictEditorMode {
45
- '3way' = '3way',
46
- 'traditional' = 'traditional',
47
- }
48
-
49
- export interface MergeConflictRT extends Partial<CommonLogInfo> {
50
- // 解决冲突模式 (3-way 或 传统模式)
51
- editorMode: MergeConflictEditorMode;
52
- // 冲突点数量(仅包含 AI 冲突点)
53
- conflictPointNum: number;
54
- // 使用了 ai 处理的冲突点数量
55
- useAiConflictPointNum: number;
56
- // 被用户采纳了的冲突点数量
57
- receiveNum: number;
58
- // 点击了 ai 解决冲突的数量
59
- clickNum: number;
60
- // 点击了一键解决的次数
61
- clickAllNum: number;
62
- // ai 成功输出了的数量
63
- aiOutputNum: number;
64
- // 取消次数
65
- cancelNum: number;
66
- }
67
-
68
- export type ReportInfo =
69
- | Partial<CommonLogInfo>
70
- | ({ type: AISerivceType.Completion } & CompletionRT)
71
- | ({ type: AISerivceType.MergeConflict } & MergeConflictRT);
72
-
73
- export const IAIReporter = Symbol('IAIReporter');
74
-
75
- export interface IAIReporter {
76
- getCommonReportInfo(): Record<string, unknown>;
77
- getCacheReportInfo<T = ReportInfo>(relationId: string): T | undefined;
78
- record(data: ReportInfo, relationId?: string): ReportInfo;
79
- // 返回关联 ID
80
- start(msg: string, data: ReportInfo): string;
81
- end(relationId: string, data: ReportInfo): void;
82
- }