@opensumi/ide-core-common 2.27.3-rc-1708399099.0 → 2.27.3-rc-1710489030.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 (128) hide show
  1. package/lib/codicons.d.ts +687 -0
  2. package/lib/codicons.d.ts.map +1 -0
  3. package/lib/codicons.js +735 -0
  4. package/lib/codicons.js.map +1 -0
  5. package/lib/command.d.ts.map +1 -1
  6. package/lib/const/application.d.ts +4 -4
  7. package/lib/const/application.d.ts.map +1 -1
  8. package/lib/const/application.js +7 -7
  9. package/lib/const/application.js.map +1 -1
  10. package/lib/contribution-provider.d.ts +1 -1
  11. package/lib/contribution-provider.d.ts.map +1 -1
  12. package/lib/di-helper/domain-helper.d.ts +0 -6
  13. package/lib/di-helper/domain-helper.d.ts.map +1 -1
  14. package/lib/di-helper/domain-helper.js +1 -33
  15. package/lib/di-helper/domain-helper.js.map +1 -1
  16. package/lib/electron.d.ts +1 -1
  17. package/lib/electron.d.ts.map +1 -1
  18. package/lib/event-bus/event-bus.d.ts +1 -1
  19. package/lib/event-bus/event-bus.d.ts.map +1 -1
  20. package/lib/hash-calculate/WASMInterface.d.ts.map +1 -1
  21. package/lib/hash-calculate/lockedCreate.d.ts.map +1 -1
  22. package/lib/index.d.ts +0 -1
  23. package/lib/index.d.ts.map +1 -1
  24. package/lib/index.js +0 -1
  25. package/lib/index.js.map +1 -1
  26. package/lib/json-schema.d.ts +25 -1
  27. package/lib/json-schema.d.ts.map +1 -1
  28. package/lib/line-text.d.ts.map +1 -1
  29. package/lib/localize.d.ts.map +1 -1
  30. package/lib/module.d.ts +7 -1
  31. package/lib/module.d.ts.map +1 -1
  32. package/lib/module.js.map +1 -1
  33. package/lib/network.d.ts +1 -0
  34. package/lib/network.d.ts.map +1 -1
  35. package/lib/network.js +1 -0
  36. package/lib/network.js.map +1 -1
  37. package/lib/problem-matcher.d.ts +2 -2
  38. package/lib/problem-matcher.d.ts.map +1 -1
  39. package/lib/problem-pattern.d.ts.map +1 -1
  40. package/lib/problem-pattern.js.map +1 -1
  41. package/lib/reference.d.ts +1 -1
  42. package/lib/reference.d.ts.map +1 -1
  43. package/lib/reporter.d.ts +1 -1
  44. package/lib/reporter.d.ts.map +1 -1
  45. package/lib/settings/ai-native.d.ts +5 -0
  46. package/lib/settings/ai-native.d.ts.map +1 -0
  47. package/lib/settings/ai-native.js +9 -0
  48. package/lib/settings/ai-native.js.map +1 -0
  49. package/lib/settings/general.d.ts +2 -1
  50. package/lib/settings/general.d.ts.map +1 -1
  51. package/lib/settings/index.d.ts +1 -0
  52. package/lib/settings/index.d.ts.map +1 -1
  53. package/lib/settings/index.js +1 -0
  54. package/lib/settings/index.js.map +1 -1
  55. package/lib/storage.d.ts +1 -1
  56. package/lib/storage.d.ts.map +1 -1
  57. package/lib/task-definition.d.ts +1 -1
  58. package/lib/task-definition.d.ts.map +1 -1
  59. package/lib/theme.d.ts +23 -0
  60. package/lib/theme.d.ts.map +1 -1
  61. package/lib/theme.js +82 -1
  62. package/lib/theme.js.map +1 -1
  63. package/lib/types/ai-native/index.d.ts +169 -0
  64. package/lib/types/ai-native/index.d.ts.map +1 -0
  65. package/lib/types/ai-native/index.js +23 -0
  66. package/lib/types/ai-native/index.js.map +1 -0
  67. package/lib/types/ai-native/reporter.d.ts +95 -0
  68. package/lib/types/ai-native/reporter.d.ts.map +1 -0
  69. package/lib/types/ai-native/reporter.js +21 -0
  70. package/lib/types/ai-native/reporter.js.map +1 -0
  71. package/lib/types/application.d.ts +1 -2
  72. package/lib/types/application.d.ts.map +1 -1
  73. package/lib/types/authentication.d.ts +1 -5
  74. package/lib/types/authentication.d.ts.map +1 -1
  75. package/lib/types/authentication.js.map +1 -1
  76. package/lib/types/file.d.ts +6 -0
  77. package/lib/types/file.d.ts.map +1 -1
  78. package/lib/types/file.js.map +1 -1
  79. package/lib/types/index.d.ts +1 -0
  80. package/lib/types/index.d.ts.map +1 -1
  81. package/lib/types/index.js +1 -0
  82. package/lib/types/index.js.map +1 -1
  83. package/lib/types/markdown.d.ts +1 -11
  84. package/lib/types/markdown.d.ts.map +1 -1
  85. package/lib/types/markers/markers-manager.d.ts.map +1 -1
  86. package/lib/types/markers/markers-manager.js +3 -4
  87. package/lib/types/markers/markers-manager.js.map +1 -1
  88. package/lib/types/markers/markers.d.ts.map +1 -1
  89. package/lib/types/rpc.d.ts +1 -5
  90. package/lib/types/rpc.d.ts.map +1 -1
  91. package/package.json +3 -3
  92. package/src/codicons.ts +751 -0
  93. package/src/command.ts +1 -1
  94. package/src/comparers.ts +1 -1
  95. package/src/const/application.ts +4 -4
  96. package/src/contribution-provider.ts +1 -1
  97. package/src/di-helper/domain-helper.ts +1 -34
  98. package/src/electron.ts +2 -2
  99. package/src/event-bus/event-bus.ts +2 -2
  100. package/src/hash-calculate/WASMInterface.ts +1 -1
  101. package/src/hash-calculate/lockedCreate.ts +1 -1
  102. package/src/index.ts +0 -1
  103. package/src/json-schema.ts +34 -10
  104. package/src/line-text.ts +1 -1
  105. package/src/localize.ts +1 -1
  106. package/src/module.ts +8 -1
  107. package/src/network.ts +2 -0
  108. package/src/problem-matcher.ts +5 -5
  109. package/src/problem-pattern.ts +2 -1
  110. package/src/reference.ts +1 -1
  111. package/src/reporter.ts +4 -4
  112. package/src/settings/ai-native.ts +4 -0
  113. package/src/settings/general.ts +1 -0
  114. package/src/settings/index.ts +1 -0
  115. package/src/storage.ts +2 -2
  116. package/src/task-definition.ts +2 -2
  117. package/src/theme.ts +92 -0
  118. package/src/types/ai-native/index.ts +205 -0
  119. package/src/types/ai-native/reporter.ts +109 -0
  120. package/src/types/application.ts +1 -2
  121. package/src/types/authentication.ts +1 -6
  122. package/src/types/file.ts +8 -0
  123. package/src/types/index.ts +1 -0
  124. package/src/types/markdown.ts +1 -10
  125. package/src/types/markers/markers-manager.ts +1 -2
  126. package/src/types/markers/markers.ts +1 -1
  127. package/src/types/rpc.ts +1 -5
  128. package/src/utils/ipc.ts +2 -2
@@ -0,0 +1,109 @@
1
+ export const AI_REPORTER_NAME = 'AI';
2
+
3
+ export enum AISerivceType {
4
+ SearchDoc = 'searchDoc',
5
+ SearchCode = 'searchCode',
6
+ Sumi = 'sumi',
7
+ GPT = 'chat',
8
+ Explain = 'explain',
9
+ Run = 'run',
10
+ Test = 'test',
11
+ Optimize = 'optimize',
12
+ Generate = 'generate',
13
+ Completion = 'completion',
14
+ Agent = 'agent',
15
+ MergeConflict = 'mergeConflict',
16
+ }
17
+
18
+ export interface CommonLogInfo {
19
+ msgType: AISerivceType;
20
+ relationId: string;
21
+ replytime: number;
22
+ success: boolean;
23
+ message: string;
24
+ isStart: boolean;
25
+ isLike: boolean;
26
+ // 是否有效
27
+ isValid: boolean;
28
+ model: string;
29
+ copy: boolean;
30
+ insert: boolean;
31
+ }
32
+
33
+ export interface QuestionRT extends Partial<CommonLogInfo> {
34
+ isRetry: boolean;
35
+ isStop: boolean;
36
+ }
37
+
38
+ export interface CodeRT extends Partial<CommonLogInfo> {
39
+ isReceive: boolean;
40
+ isDrop: boolean;
41
+ }
42
+
43
+ export interface GenerateRT extends Partial<CommonLogInfo> {
44
+ fileCount: number;
45
+ requirment: string;
46
+ }
47
+
48
+ export interface CommandRT extends Partial<CommonLogInfo> {
49
+ useCommand: boolean;
50
+ useCommandSuccess: boolean;
51
+ }
52
+
53
+ export interface RunRT extends Partial<CommonLogInfo> {
54
+ runSuccess: boolean;
55
+ }
56
+
57
+ export interface CompletionRT extends Partial<CommonLogInfo> {
58
+ isReceive?: boolean;
59
+ // 是否取消
60
+ isStop?: boolean;
61
+ // 补全条数
62
+ completionNum?: number;
63
+ // 渲染时长
64
+ renderingTime?: number;
65
+ }
66
+
67
+ export interface MergeConflictRT extends Partial<CommonLogInfo> {
68
+ // 解决冲突模式 (3-way 或 传统模式)
69
+ editorMode: '3way' | 'traditional';
70
+ // 冲突点数量(仅包含 AI 冲突点)
71
+ conflictPointNum: number;
72
+ // 使用了 ai 处理的冲突点数量
73
+ useAiConflictPointNum: number;
74
+ // 被用户采纳了的冲突点数量
75
+ receiveNum: number;
76
+ // 点击了 ai 解决冲突的数量
77
+ clickNum: number;
78
+ // 点击了一键解决的次数
79
+ clickAllNum: number;
80
+ // ai 成功输出了的数量
81
+ aiOutputNum: number;
82
+ // 取消次数
83
+ cancelNum: number;
84
+ }
85
+
86
+ export type ReportInfo =
87
+ | Partial<CommonLogInfo>
88
+ | ({ type: AISerivceType.GPT } & QuestionRT)
89
+ | ({ type: AISerivceType.Explain } & QuestionRT)
90
+ | ({ type: AISerivceType.SearchCode } & QuestionRT)
91
+ | ({ type: AISerivceType.SearchDoc } & QuestionRT)
92
+ | ({ type: AISerivceType.Test } & QuestionRT)
93
+ | ({ type: AISerivceType.Optimize } & CodeRT)
94
+ | ({ type: AISerivceType.Generate } & GenerateRT)
95
+ | ({ type: AISerivceType.Sumi } & CommandRT)
96
+ | ({ type: AISerivceType.Run } & RunRT)
97
+ | ({ type: AISerivceType.Completion } & CompletionRT)
98
+ | ({ type: AISerivceType.MergeConflict } & MergeConflictRT);
99
+
100
+ export const IAIReporter = Symbol('IAIReporter');
101
+
102
+ export interface IAIReporter {
103
+ getCommonReportInfo(): Record<string, unknown>;
104
+ getCacheReportInfo<T = ReportInfo>(relationId: string): T | undefined;
105
+ record(data: ReportInfo, relationId?: string): ReportInfo;
106
+ // 返回关联 ID
107
+ start(msg: string, data: ReportInfo): string;
108
+ end(relationId: string, data: ReportInfo): void;
109
+ }
@@ -4,8 +4,7 @@ export const IApplicationService = Symbol('IApplicationService');
4
4
 
5
5
  export interface IApplicationService {
6
6
  /**
7
- * In Electron environment, if `isRemote` is not specified, use local connection by default: `electronEnv.metadata.windowClientId`
8
- * Otherwise, use WebSocket connection: `WSChannelHandler.clientId`
7
+ * equals to `WSChannelHandler.clientId`, which will be inited when create connection to backend
9
8
  */
10
9
  clientId: string;
11
10
  /**
@@ -1,15 +1,10 @@
1
- import { IDisposable, Event } from '@opensumi/ide-utils';
1
+ import { Event, IDisposable } from '@opensumi/ide-utils';
2
2
 
3
3
  export const noAccountsId = 'authentication.noAccounts';
4
4
 
5
5
  export const ACCOUNTS_MENU = ['accounts_menu'];
6
6
  export const ACCOUNTS_SUBMENU = [...ACCOUNTS_MENU, '1_accounts_submenu'];
7
7
 
8
- export interface AllowedExtension {
9
- id: string;
10
- name: string;
11
- }
12
-
13
8
  export interface AuthenticationSessionsChangeEvent {
14
9
  added: ReadonlyArray<AuthenticationSession>;
15
10
  removed: ReadonlyArray<AuthenticationSession>;
package/src/types/file.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Event, Uri } from '@opensumi/ide-utils';
2
+ import { IReadableStream } from '@opensumi/ide-utils/lib/stream';
2
3
 
3
4
  import { FileChangeEvent } from './file-watch';
4
5
 
@@ -123,6 +124,11 @@ export enum FileType {
123
124
  SymbolicLink = 64,
124
125
  }
125
126
 
127
+ export interface IReadFileStreamOptions {
128
+ position?: number;
129
+ length?: number;
130
+ }
131
+
126
132
  /**
127
133
  * Compatible with vscode.FileSystemProvider
128
134
  */
@@ -197,6 +203,8 @@ export interface FileSystemProvider {
197
203
  */
198
204
  readFile(uri: Uri, encoding?: string): Uint8Array | void | Promise<Uint8Array | void>;
199
205
 
206
+ readFileStream?(uri: Uri, opts?: IReadFileStreamOptions): Promise<IReadableStream<Uint8Array>>;
207
+
200
208
  /**
201
209
  * Write data to a file, replacing its entire contents.
202
210
  *
@@ -13,3 +13,4 @@ export * from './accessibility';
13
13
  export * from './statusbar';
14
14
  export * from './markdown';
15
15
  export * from './editor';
16
+ export * from './ai-native';
@@ -1,10 +1 @@
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
+ export type { IMarkdownString } from '@opensumi/monaco-editor-core/esm/vs/base/common/htmlContent';
@@ -3,8 +3,7 @@ import { Emitter, Event, IDisposable, arrays } from '@opensumi/ide-utils';
3
3
 
4
4
  import { WithEventBus } from '../../event-bus';
5
5
 
6
- import { MapMap } from './markers';
7
- import { IMarker, IMarkerData, MarkerStatistics, MarkerSeverity } from './markers';
6
+ import { IMarker, IMarkerData, MapMap, MarkerSeverity, MarkerStatistics } from './markers';
8
7
 
9
8
  const { isFalsyOrEmpty } = arrays;
10
9
 
@@ -1,4 +1,4 @@
1
- import { isEmptyObject, URI } from '@opensumi/ide-utils';
1
+ import { URI, isEmptyObject } from '@opensumi/ide-utils';
2
2
 
3
3
  export interface MapMap<V> {
4
4
  [key: string]: { [key: string]: V };
package/src/types/rpc.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  export interface Headers {
2
- transferEncoding?: 'chunked';
3
- /**
4
- * @default 4M
5
- */
6
- chunkSize?: number;
2
+ chunked?: boolean;
7
3
  }
8
4
 
9
5
  export interface Request<T> {
package/src/utils/ipc.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { tmpdir } from 'os';
2
- import { join, dirname } from 'path';
2
+ import { dirname, join } from 'path';
3
3
 
4
- import { ensureDirSync, ensureDir } from 'fs-extra';
4
+ import { ensureDir, ensureDirSync } from 'fs-extra';
5
5
 
6
6
  import { isWindows, uuid } from '@opensumi/ide-utils';
7
7