@opensumi/ide-core-common 3.4.5-next-1730102270.0 → 3.4.5-next-1730119322.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/browser-fs/ensure-dir.js +1 -2
- package/lib/browser-fs/ensure-dir.js.map +1 -1
- package/lib/browser-fs/util.js +1 -2
- package/lib/browser-fs/util.js.map +1 -1
- package/lib/codicons.d.ts +70 -70
- package/lib/codicons.d.ts.map +1 -1
- package/lib/codicons.js +5 -5
- package/lib/codicons.js.map +1 -1
- package/lib/command.js +17 -9
- package/lib/command.js.map +1 -1
- package/lib/comparers.js +5 -6
- package/lib/comparers.js.map +1 -1
- package/lib/const/application.d.ts +1 -1
- package/lib/const/application.js +2 -2
- package/lib/const/application.js.map +1 -1
- package/lib/const/locale-types.d.ts.map +1 -1
- package/lib/contribution-provider.js +2 -2
- package/lib/contribution-provider.js.map +1 -1
- package/lib/devtools/index.js +2 -2
- package/lib/devtools/index.js.map +1 -1
- package/lib/di-helper/domain-helper.d.ts.map +1 -1
- package/lib/di-helper/domain-helper.js +1 -2
- package/lib/di-helper/domain-helper.js.map +1 -1
- package/lib/error.js +1 -2
- package/lib/error.js.map +1 -1
- package/lib/event-bus/event-bus.js +2 -2
- package/lib/event-bus/event-bus.js.map +1 -1
- package/lib/event-bus/event-decorator.d.ts.map +1 -1
- package/lib/event-bus/event-decorator.js +3 -3
- package/lib/event-bus/event-decorator.js.map +1 -1
- package/lib/hash-calculate/WASMInterface.d.ts +1 -1
- package/lib/hash-calculate/WASMInterface.js +2 -2
- package/lib/hash-calculate/WASMInterface.js.map +1 -1
- package/lib/hash-calculate/hash-calculate.js +2 -2
- package/lib/hash-calculate/hash-calculate.js.map +1 -1
- package/lib/hash-calculate/lockedCreate.js +1 -2
- package/lib/hash-calculate/lockedCreate.js.map +1 -1
- package/lib/hash-calculate/mutex.js.map +1 -1
- package/lib/hash-calculate/util.js +8 -8
- package/lib/hash-calculate/util.js.map +1 -1
- package/lib/keyboard/keymap.js +2 -2
- package/lib/keyboard/keymap.js.map +1 -1
- package/lib/line-text.js.map +1 -1
- package/lib/localize.js +13 -13
- package/lib/localize.js.map +1 -1
- package/lib/log.js +4 -4
- package/lib/log.js.map +1 -1
- package/lib/markdown.js +5 -3
- package/lib/markdown.js.map +1 -1
- package/lib/mime.js +3 -3
- package/lib/mime.js.map +1 -1
- package/lib/mocks/electron/browserMock.js +1 -2
- package/lib/mocks/electron/browserMock.js.map +1 -1
- package/lib/mocks/electron/ipcRenderer.d.ts +0 -1
- package/lib/mocks/electron/ipcRenderer.d.ts.map +1 -1
- package/lib/module.js +5 -5
- package/lib/module.js.map +1 -1
- package/lib/network.js +1 -1
- package/lib/network.js.map +1 -1
- package/lib/node/port.js +3 -4
- package/lib/node/port.js.map +1 -1
- package/lib/node/utils.d.ts +0 -1
- package/lib/node/utils.d.ts.map +1 -1
- package/lib/node/utils.js +2 -3
- package/lib/node/utils.js.map +1 -1
- package/lib/preferences/preference-schema.js +3 -3
- package/lib/preferences/preference-schema.js.map +1 -1
- package/lib/preferences/preference-scope.js +2 -2
- package/lib/preferences/preference-scope.js.map +1 -1
- package/lib/problem-matcher.js +3 -3
- package/lib/problem-matcher.js.map +1 -1
- package/lib/problem-pattern.d.ts +1 -1
- package/lib/problem-pattern.d.ts.map +1 -1
- package/lib/problem-pattern.js +20 -20
- package/lib/problem-pattern.js.map +1 -1
- package/lib/reference.js +2 -2
- package/lib/reference.js.map +1 -1
- package/lib/remote-service/README.md +9 -9
- package/lib/remote-service/data-store/decorators.d.ts +2 -2
- package/lib/remote-service/data-store/decorators.d.ts.map +1 -1
- package/lib/remote-service/data-store/decorators.js +23 -26
- package/lib/remote-service/data-store/decorators.js.map +1 -1
- package/lib/remote-service/data-store/select.d.ts +2 -2
- package/lib/remote-service/data-store/select.d.ts.map +1 -1
- package/lib/remote-service/data-store/select.js +1 -2
- package/lib/remote-service/data-store/select.js.map +1 -1
- package/lib/remote-service/data-store/store.d.ts +20 -17
- package/lib/remote-service/data-store/store.d.ts.map +1 -1
- package/lib/remote-service/data-store/store.js +32 -4
- package/lib/remote-service/data-store/store.js.map +1 -1
- package/lib/remote-service/index.d.ts +1 -1
- package/lib/remote-service/index.d.ts.map +1 -1
- package/lib/remote-service/index.js +4 -4
- package/lib/remote-service/index.js.map +1 -1
- package/lib/reporter.d.ts.map +1 -1
- package/lib/reporter.js +4 -4
- package/lib/reporter.js.map +1 -1
- package/lib/settings/ai-native.js +1 -1
- package/lib/settings/ai-native.js.map +1 -1
- package/lib/settings/general.js +1 -1
- package/lib/settings/general.js.map +1 -1
- package/lib/storage.js +3 -3
- package/lib/storage.js.map +1 -1
- package/lib/task-definition.d.ts.map +1 -1
- package/lib/task-definition.js +3 -3
- package/lib/task-definition.js.map +1 -1
- package/lib/theme.js +4 -4
- package/lib/theme.js.map +1 -1
- package/lib/types/ai-native/index.d.ts +4 -0
- package/lib/types/ai-native/index.d.ts.map +1 -1
- package/lib/types/ai-native/index.js +9 -2
- package/lib/types/ai-native/index.js.map +1 -1
- package/lib/types/ai-native/reporter.d.ts +21 -11
- package/lib/types/ai-native/reporter.d.ts.map +1 -1
- package/lib/types/ai-native/reporter.js +19 -18
- package/lib/types/ai-native/reporter.js.map +1 -1
- package/lib/types/authentication.d.ts +0 -8
- package/lib/types/authentication.d.ts.map +1 -1
- package/lib/types/editor.js +4 -4
- package/lib/types/editor.js.map +1 -1
- package/lib/types/extension.js +3 -3
- package/lib/types/extension.js.map +1 -1
- package/lib/types/file-watch.js +4 -4
- package/lib/types/file-watch.js.map +1 -1
- package/lib/types/file.d.ts +0 -1
- package/lib/types/file.d.ts.map +1 -1
- package/lib/types/file.js +2 -2
- package/lib/types/file.js.map +1 -1
- package/lib/types/markers/markers-manager.js +7 -4
- package/lib/types/markers/markers-manager.js.map +1 -1
- package/lib/types/markers/markers.js +3 -3
- package/lib/types/markers/markers.js.map +1 -1
- package/lib/types/message.js +1 -1
- package/lib/types/message.js.map +1 -1
- package/lib/types/reporter.js +3 -3
- package/lib/types/reporter.js.map +1 -1
- package/lib/utils/ipc.js +2 -3
- package/lib/utils/ipc.js.map +1 -1
- package/package.json +4 -4
- package/src/const/application.ts +1 -1
- package/src/problem-pattern.ts +2 -3
- package/src/remote-service/README.md +9 -9
- package/src/remote-service/data-store/decorators.ts +39 -25
- package/src/remote-service/data-store/select.ts +3 -3
- package/src/remote-service/data-store/store.ts +60 -21
- package/src/types/ai-native/index.ts +7 -0
- package/src/types/ai-native/reporter.ts +20 -9
- package/src/types/authentication.ts +0 -7
|
@@ -1,30 +1,37 @@
|
|
|
1
1
|
import extend from 'lodash/extend';
|
|
2
2
|
|
|
3
3
|
import { EventEmitter } from '@opensumi/events';
|
|
4
|
+
import { isUndefined } from '@opensumi/ide-utils';
|
|
4
5
|
|
|
5
6
|
import { select } from './select';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
remove(id: string): void;
|
|
14
|
-
}
|
|
8
|
+
/**
|
|
9
|
+
* The query looks like:
|
|
10
|
+
* { field: value }
|
|
11
|
+
* { field: conditions }
|
|
12
|
+
*/
|
|
13
|
+
export type Query = Record<string, any>;
|
|
15
14
|
|
|
16
|
-
export interface DataStoreEvent<Item>
|
|
15
|
+
export interface DataStoreEvent<Item> {
|
|
17
16
|
created: [item: Item];
|
|
18
17
|
updated: [oldItem: Item, newItem: Item];
|
|
19
18
|
removed: [item: Item];
|
|
19
|
+
|
|
20
|
+
[key: string]: any[];
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export interface DataStoreOptions {
|
|
23
24
|
id?: string;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
type MarkOptional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
|
|
28
|
+
|
|
29
|
+
export class InMemoryDataStore<
|
|
30
|
+
Item extends Record<any, any>,
|
|
31
|
+
PrimaryKey extends keyof Item = 'id',
|
|
32
|
+
PrimaryKeyType = Required<Item>[PrimaryKey],
|
|
33
|
+
> extends EventEmitter<DataStoreEvent<Item>> {
|
|
34
|
+
private store = new Map<PrimaryKeyType, Item>();
|
|
28
35
|
private _uid = 0;
|
|
29
36
|
/**
|
|
30
37
|
* primary key
|
|
@@ -36,8 +43,8 @@ export class InMemoryDataStore<Item> extends EventEmitter<DataStoreEvent<Item>>
|
|
|
36
43
|
this.id = options?.id || 'id';
|
|
37
44
|
}
|
|
38
45
|
|
|
39
|
-
create(item: Item): Item {
|
|
40
|
-
const id = item[this.id] ||
|
|
46
|
+
create(item: MarkOptional<Item, PrimaryKey>): Item {
|
|
47
|
+
const id = item[this.id] || (this._uid++ as PrimaryKeyType);
|
|
41
48
|
const result = extend({}, item, { [this.id]: id }) as Item;
|
|
42
49
|
|
|
43
50
|
this.store.set(id, result);
|
|
@@ -46,29 +53,32 @@ export class InMemoryDataStore<Item> extends EventEmitter<DataStoreEvent<Item>>
|
|
|
46
53
|
return result;
|
|
47
54
|
}
|
|
48
55
|
|
|
49
|
-
find(query
|
|
56
|
+
find(query?: Query): Item[] | undefined {
|
|
57
|
+
if (isUndefined(query)) {
|
|
58
|
+
return Array.from(this.store.values());
|
|
59
|
+
}
|
|
50
60
|
return select(this.store, query);
|
|
51
61
|
}
|
|
52
62
|
|
|
53
|
-
|
|
54
|
-
if (
|
|
63
|
+
count(query?: Query): number {
|
|
64
|
+
if (isUndefined(query)) {
|
|
55
65
|
return this.store.size;
|
|
56
66
|
}
|
|
57
67
|
|
|
58
68
|
return this.find(query)?.length || 0;
|
|
59
69
|
}
|
|
60
70
|
|
|
61
|
-
get(id:
|
|
71
|
+
get(id: PrimaryKeyType): Item | undefined {
|
|
62
72
|
return this.store.get(id);
|
|
63
73
|
}
|
|
64
74
|
|
|
65
|
-
has(id:
|
|
75
|
+
has(id: PrimaryKeyType): boolean {
|
|
66
76
|
return this.store.has(id);
|
|
67
77
|
}
|
|
68
78
|
|
|
69
|
-
update(id:
|
|
79
|
+
update(id: PrimaryKeyType, item: Partial<Item>): void {
|
|
70
80
|
const current = this.store.get(id);
|
|
71
|
-
if (
|
|
81
|
+
if (isUndefined(current)) {
|
|
72
82
|
return;
|
|
73
83
|
}
|
|
74
84
|
|
|
@@ -78,7 +88,7 @@ export class InMemoryDataStore<Item> extends EventEmitter<DataStoreEvent<Item>>
|
|
|
78
88
|
this.store.set(id, result);
|
|
79
89
|
}
|
|
80
90
|
|
|
81
|
-
remove(id:
|
|
91
|
+
remove(id: PrimaryKeyType): void {
|
|
82
92
|
const item = this.store.get(id);
|
|
83
93
|
if (item) {
|
|
84
94
|
this.emit('removed', item);
|
|
@@ -86,4 +96,33 @@ export class InMemoryDataStore<Item> extends EventEmitter<DataStoreEvent<Item>>
|
|
|
86
96
|
|
|
87
97
|
this.store.delete(id);
|
|
88
98
|
}
|
|
99
|
+
|
|
100
|
+
removeItem(item: Item): void {
|
|
101
|
+
const id = item[this.id] as PrimaryKeyType;
|
|
102
|
+
if (isUndefined(id)) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
this.remove(id);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
removeAll(query?: Query): void {
|
|
110
|
+
if (isUndefined(query)) {
|
|
111
|
+
const items = Array.from(this.store.values());
|
|
112
|
+
this.store.clear();
|
|
113
|
+
|
|
114
|
+
items.forEach((item) => {
|
|
115
|
+
this.emit('removed', item);
|
|
116
|
+
});
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const items = this.find(query);
|
|
121
|
+
if (items) {
|
|
122
|
+
items.forEach((item) => {
|
|
123
|
+
this.store.delete(item[this.id]);
|
|
124
|
+
this.emit('removed', item);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
89
128
|
}
|
|
@@ -349,3 +349,10 @@ export interface IHistoryChatMessage extends IChatMessage {
|
|
|
349
349
|
requestId?: string;
|
|
350
350
|
replyStartTime?: number;
|
|
351
351
|
}
|
|
352
|
+
|
|
353
|
+
// ## Code Edits start ##
|
|
354
|
+
export enum ECodeEditsSourceTyping {
|
|
355
|
+
LinterErrors = 'lint_errors',
|
|
356
|
+
LineChange = 'line_change',
|
|
357
|
+
}
|
|
358
|
+
// ## Code Edits ends ##
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ECodeEditsSourceTyping } from './index';
|
|
2
|
+
|
|
1
3
|
export const AI_REPORTER_NAME = 'AI';
|
|
2
4
|
|
|
3
|
-
export enum
|
|
5
|
+
export enum AIServiceType {
|
|
4
6
|
Chat = 'chat',
|
|
5
7
|
InlineChat = 'inlineChat',
|
|
6
8
|
CodeAction = 'codeAction',
|
|
@@ -12,6 +14,7 @@ export enum AISerivceType {
|
|
|
12
14
|
Rename = 'rename',
|
|
13
15
|
TerminalAICommand = 'terminalAICommand',
|
|
14
16
|
ProblemFix = 'problemFix',
|
|
17
|
+
CodeEdits = 'codeEdits',
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
export enum ActionSourceEnum {
|
|
@@ -64,7 +67,7 @@ export enum ActionTypeEnum {
|
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
export interface CommonLogInfo {
|
|
67
|
-
msgType:
|
|
70
|
+
msgType: AIServiceType | string;
|
|
68
71
|
relationId: string;
|
|
69
72
|
replytime: number;
|
|
70
73
|
success: boolean;
|
|
@@ -172,15 +175,23 @@ export interface InlineChatRT extends Partial<CommonLogInfo> {
|
|
|
172
175
|
runByCodeAction?: boolean;
|
|
173
176
|
}
|
|
174
177
|
|
|
178
|
+
export interface CodeEditsRT extends Partial<CommonLogInfo> {
|
|
179
|
+
actionSource?: ECodeEditsSourceTyping;
|
|
180
|
+
isCancel?: boolean;
|
|
181
|
+
accept?: boolean;
|
|
182
|
+
discard?: boolean;
|
|
183
|
+
}
|
|
184
|
+
|
|
175
185
|
export type ReportInfo =
|
|
176
186
|
| Partial<CommonLogInfo>
|
|
177
|
-
| ({ type:
|
|
178
|
-
| ({ type:
|
|
179
|
-
| ({ type:
|
|
180
|
-
| ({ type:
|
|
181
|
-
| ({ type:
|
|
182
|
-
| ({ type:
|
|
183
|
-
| ({ type:
|
|
187
|
+
| ({ type: AIServiceType.Completion } & CompletionRT)
|
|
188
|
+
| ({ type: AIServiceType.MergeConflict } & MergeConflictRT)
|
|
189
|
+
| ({ type: AIServiceType.Rename } & RenameRT)
|
|
190
|
+
| ({ type: AIServiceType.InlineChat } & InlineChatRT)
|
|
191
|
+
| ({ type: AIServiceType.InlineChatInput } & InlineChatRT)
|
|
192
|
+
| ({ type: AIServiceType.Chat } & ChatRT)
|
|
193
|
+
| ({ type: AIServiceType.Agent } & ChatRT)
|
|
194
|
+
| ({ type: AIServiceType.CodeEdits } & CodeEditsRT);
|
|
184
195
|
|
|
185
196
|
export const IAIReporter = Symbol('IAIReporter');
|
|
186
197
|
|
|
@@ -106,10 +106,3 @@ export interface SessionRequest {
|
|
|
106
106
|
export interface SessionRequestInfo {
|
|
107
107
|
[scopes: string]: SessionRequest;
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
export interface AuthenticationGetSessionOptions {
|
|
111
|
-
createIfNone: boolean;
|
|
112
|
-
clearSessionPreference: boolean;
|
|
113
|
-
forceNewSession?: boolean | { detail: string };
|
|
114
|
-
silent?: boolean;
|
|
115
|
-
}
|