@opensumi/ide-core-common 3.3.1-next-1725499940.0 → 3.3.1-next-1725521092.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/node/index.d.ts +2 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +5 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/utils.d.ts +13 -0
- package/lib/node/utils.d.ts.map +1 -0
- package/lib/node/utils.js +51 -0
- package/lib/node/utils.js.map +1 -0
- package/lib/types/ai-native/reporter.d.ts +0 -33
- package/lib/types/ai-native/reporter.d.ts.map +1 -1
- package/lib/types/ai-native/reporter.js +1 -45
- package/lib/types/ai-native/reporter.js.map +1 -1
- package/package.json +4 -4
- package/src/node/index.ts +1 -0
- package/src/node/utils.ts +51 -0
- package/src/types/ai-native/reporter.ts +0 -61
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* modified from: https://github.com/mhart/epipebomb
|
|
4
|
+
*
|
|
5
|
+
* support EIO
|
|
6
|
+
*/
|
|
7
|
+
export declare function epipeBomb(stream: NodeJS.WriteStream, callback: (code?: number) => void): void;
|
|
8
|
+
/**
|
|
9
|
+
* 参考:https://github.com/camunda/camunda-modeler/pull/3314
|
|
10
|
+
* fix(app): suppress EPIPE errors for app output
|
|
11
|
+
*/
|
|
12
|
+
export declare function suppressNodeJSEpipeError(_process: NodeJS.Process, error: (msg: string) => void): void;
|
|
13
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,QA0BtF;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,QAa9F"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.suppressNodeJSEpipeError = exports.epipeBomb = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* modified from: https://github.com/mhart/epipebomb
|
|
6
|
+
*
|
|
7
|
+
* support EIO
|
|
8
|
+
*/
|
|
9
|
+
function epipeBomb(stream, callback) {
|
|
10
|
+
if (!stream) {
|
|
11
|
+
stream = process.stdout;
|
|
12
|
+
}
|
|
13
|
+
if (!callback) {
|
|
14
|
+
callback = process.exit;
|
|
15
|
+
}
|
|
16
|
+
function epipeFilter(err) {
|
|
17
|
+
if (err.code === 'EPIPE') {
|
|
18
|
+
return callback();
|
|
19
|
+
}
|
|
20
|
+
if (err.code === 'EIO') {
|
|
21
|
+
return callback();
|
|
22
|
+
}
|
|
23
|
+
// If there's more than one error handler (ie, us),
|
|
24
|
+
// then the error won't be bubbled up anyway
|
|
25
|
+
if (stream.listeners('error').length <= 1) {
|
|
26
|
+
stream.removeAllListeners('error'); // Pretend we were never here
|
|
27
|
+
stream.emit('error', err); // Then emit as if we were never here
|
|
28
|
+
stream.on('error', epipeFilter); // Then reattach, ready for the next error!
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
stream.on('error', epipeFilter);
|
|
32
|
+
}
|
|
33
|
+
exports.epipeBomb = epipeBomb;
|
|
34
|
+
/**
|
|
35
|
+
* 参考:https://github.com/camunda/camunda-modeler/pull/3314
|
|
36
|
+
* fix(app): suppress EPIPE errors for app output
|
|
37
|
+
*/
|
|
38
|
+
function suppressNodeJSEpipeError(_process, error) {
|
|
39
|
+
let suppressing = false;
|
|
40
|
+
const logEPIPEErrorOnce = () => {
|
|
41
|
+
if (suppressing) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
suppressing = true;
|
|
45
|
+
error('Detected EPIPE error; suppressing further EPIPE errors');
|
|
46
|
+
};
|
|
47
|
+
_process.stdout && epipeBomb(_process.stdout, logEPIPEErrorOnce);
|
|
48
|
+
_process.stderr && epipeBomb(_process.stderr, logEPIPEErrorOnce);
|
|
49
|
+
}
|
|
50
|
+
exports.suppressNodeJSEpipeError = suppressNodeJSEpipeError;
|
|
51
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/node/utils.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,SAAS,CAAC,MAA0B,EAAE,QAAiC;IACrF,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;KACzB;IACD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;KACzB;IAED,SAAS,WAAW,CAAC,GAAQ;QAC3B,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE;YACxB,OAAO,QAAQ,EAAE,CAAC;SACnB;QACD,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,EAAE;YACtB,OAAO,QAAQ,EAAE,CAAC;SACnB;QAED,mDAAmD;QACnD,4CAA4C;QAC5C,IAAI,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE;YACzC,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,6BAA6B;YACjE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,qCAAqC;YAChE,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,2CAA2C;SAC7E;IACH,CAAC;IAED,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAClC,CAAC;AA1BD,8BA0BC;AAED;;;GAGG;AACH,SAAgB,wBAAwB,CAAC,QAAwB,EAAE,KAA4B;IAC7F,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,IAAI,WAAW,EAAE;YACf,OAAO;SACR;QAED,WAAW,GAAG,IAAI,CAAC;QACnB,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAClE,CAAC,CAAC;IAEF,QAAQ,CAAC,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACjE,QAAQ,CAAC,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AACnE,CAAC;AAbD,4DAaC"}
|
|
@@ -2,7 +2,6 @@ export declare const AI_REPORTER_NAME = "AI";
|
|
|
2
2
|
export declare enum AISerivceType {
|
|
3
3
|
Chat = "chat",
|
|
4
4
|
InlineChat = "inlineChat",
|
|
5
|
-
CodeAction = "codeAction",
|
|
6
5
|
InlineChatInput = "inlineChatInput",
|
|
7
6
|
CustomReplay = "customReplay",
|
|
8
7
|
Completion = "completion",
|
|
@@ -11,28 +10,6 @@ export declare enum AISerivceType {
|
|
|
11
10
|
Rename = "rename",
|
|
12
11
|
TerminalAICommand = "terminalAICommand"
|
|
13
12
|
}
|
|
14
|
-
export declare enum ActionSourceEnum {
|
|
15
|
-
Chat = "chat",
|
|
16
|
-
InlineChat = "inlineChat",
|
|
17
|
-
CodeAction = "codeAction",
|
|
18
|
-
Terminal = "terminal",
|
|
19
|
-
Completion = "completion"
|
|
20
|
-
}
|
|
21
|
-
export declare enum ActionTypeEnum {
|
|
22
|
-
Completion = "completion",
|
|
23
|
-
DropdownCompletion = "dropdownCompletion",
|
|
24
|
-
Rename = "rename",
|
|
25
|
-
ChatInsertCode = "chatInsertCode",
|
|
26
|
-
ChatCopyCode = "chatCopyCode",
|
|
27
|
-
Welcome = "welcome",
|
|
28
|
-
Followup = "followup",
|
|
29
|
-
Send = "send",
|
|
30
|
-
Accept = "accept",
|
|
31
|
-
lineAccept = "lineAccept",
|
|
32
|
-
Discard = "discard",
|
|
33
|
-
LineDiscard = "lineDiscard",
|
|
34
|
-
Regenerate = "regenerate"
|
|
35
|
-
}
|
|
36
13
|
export interface CommonLogInfo {
|
|
37
14
|
msgType: AISerivceType | string;
|
|
38
15
|
relationId: string;
|
|
@@ -47,13 +24,6 @@ export interface CommonLogInfo {
|
|
|
47
24
|
insert: boolean;
|
|
48
25
|
isRetry: boolean;
|
|
49
26
|
isDrop: boolean;
|
|
50
|
-
language?: string;
|
|
51
|
-
code?: string;
|
|
52
|
-
originCode?: string;
|
|
53
|
-
fileUrl?: string;
|
|
54
|
-
repo?: string;
|
|
55
|
-
actionSource?: ActionSourceEnum | string;
|
|
56
|
-
actionType?: ActionTypeEnum | string;
|
|
57
27
|
}
|
|
58
28
|
export interface CompletionRT extends Partial<CommonLogInfo> {
|
|
59
29
|
isReceive?: boolean;
|
|
@@ -68,7 +38,6 @@ export interface IAIReportCompletionOption {
|
|
|
68
38
|
repo?: string;
|
|
69
39
|
completionUseTime?: number;
|
|
70
40
|
renderingTime?: number;
|
|
71
|
-
code?: string;
|
|
72
41
|
}
|
|
73
42
|
export declare enum MergeConflictEditorMode {
|
|
74
43
|
'3way' = "3way",
|
|
@@ -76,7 +45,6 @@ export declare enum MergeConflictEditorMode {
|
|
|
76
45
|
}
|
|
77
46
|
export interface ChatRT extends Partial<CommonLogInfo> {
|
|
78
47
|
agentId?: string;
|
|
79
|
-
command?: string;
|
|
80
48
|
userMessage?: string;
|
|
81
49
|
assistantMessage?: string;
|
|
82
50
|
}
|
|
@@ -134,7 +102,6 @@ export interface IAIReporter {
|
|
|
134
102
|
getCommonReportInfo(): Record<string, unknown>;
|
|
135
103
|
getCacheReportInfo<T = ReportInfo>(relationId: string): T | undefined;
|
|
136
104
|
record(data: ReportInfo, relationId?: string): ReportInfo;
|
|
137
|
-
getRelationId(): string;
|
|
138
105
|
start(msg: string, data: ReportInfo): string;
|
|
139
106
|
end(relationId: string, data: ReportInfo): void;
|
|
140
107
|
}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,eAAe,oBAAoB;IACnC,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,aAAa,kBAAkB;IAC/B,MAAM,WAAW;IACjB,iBAAiB,sBAAsB;CACxC;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,O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E,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;CACjD"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IAIReporter = exports.MergeConflictEditorMode = exports.
|
|
3
|
+
exports.IAIReporter = exports.MergeConflictEditorMode = exports.AISerivceType = exports.AI_REPORTER_NAME = void 0;
|
|
4
4
|
exports.AI_REPORTER_NAME = 'AI';
|
|
5
5
|
var AISerivceType;
|
|
6
6
|
(function (AISerivceType) {
|
|
7
7
|
AISerivceType["Chat"] = "chat";
|
|
8
8
|
AISerivceType["InlineChat"] = "inlineChat";
|
|
9
|
-
AISerivceType["CodeAction"] = "codeAction";
|
|
10
9
|
AISerivceType["InlineChatInput"] = "inlineChatInput";
|
|
11
10
|
AISerivceType["CustomReplay"] = "customReplay";
|
|
12
11
|
AISerivceType["Completion"] = "completion";
|
|
@@ -15,49 +14,6 @@ var AISerivceType;
|
|
|
15
14
|
AISerivceType["Rename"] = "rename";
|
|
16
15
|
AISerivceType["TerminalAICommand"] = "terminalAICommand";
|
|
17
16
|
})(AISerivceType = exports.AISerivceType || (exports.AISerivceType = {}));
|
|
18
|
-
var ActionSourceEnum;
|
|
19
|
-
(function (ActionSourceEnum) {
|
|
20
|
-
// 聊天面板
|
|
21
|
-
ActionSourceEnum["Chat"] = "chat";
|
|
22
|
-
// 编辑器内联 Chat
|
|
23
|
-
ActionSourceEnum["InlineChat"] = "inlineChat";
|
|
24
|
-
// 编辑器内 Action
|
|
25
|
-
ActionSourceEnum["CodeAction"] = "codeAction";
|
|
26
|
-
// 终端
|
|
27
|
-
ActionSourceEnum["Terminal"] = "terminal";
|
|
28
|
-
// 下拉补全 | 自动补全
|
|
29
|
-
ActionSourceEnum["Completion"] = "completion";
|
|
30
|
-
})(ActionSourceEnum = exports.ActionSourceEnum || (exports.ActionSourceEnum = {}));
|
|
31
|
-
var ActionTypeEnum;
|
|
32
|
-
(function (ActionTypeEnum) {
|
|
33
|
-
// 自动补全
|
|
34
|
-
ActionTypeEnum["Completion"] = "completion";
|
|
35
|
-
// 下拉补全
|
|
36
|
-
ActionTypeEnum["DropdownCompletion"] = "dropdownCompletion";
|
|
37
|
-
// ai重命名
|
|
38
|
-
ActionTypeEnum["Rename"] = "rename";
|
|
39
|
-
// Chat面板 插入代码
|
|
40
|
-
ActionTypeEnum["ChatInsertCode"] = "chatInsertCode";
|
|
41
|
-
// Chat面板 复制代码
|
|
42
|
-
ActionTypeEnum["ChatCopyCode"] = "chatCopyCode";
|
|
43
|
-
// Chat面板 欢迎语的Action
|
|
44
|
-
ActionTypeEnum["Welcome"] = "welcome";
|
|
45
|
-
// Chat面板 回复消息的Action
|
|
46
|
-
ActionTypeEnum["Followup"] = "followup";
|
|
47
|
-
// 发送消息
|
|
48
|
-
ActionTypeEnum["Send"] = "send";
|
|
49
|
-
// 生成代码后的行动点:全部采纳
|
|
50
|
-
ActionTypeEnum["Accept"] = "accept";
|
|
51
|
-
// 生成代码后的行动点:单模块采纳
|
|
52
|
-
ActionTypeEnum["lineAccept"] = "lineAccept";
|
|
53
|
-
// 生成代码后的行动点:全部拒绝
|
|
54
|
-
ActionTypeEnum["Discard"] = "discard";
|
|
55
|
-
// 生成代码后的行动点:全部拒绝
|
|
56
|
-
ActionTypeEnum["LineDiscard"] = "lineDiscard";
|
|
57
|
-
// 生成代码后的行动点:重新生成
|
|
58
|
-
ActionTypeEnum["Regenerate"] = "regenerate";
|
|
59
|
-
// 包含业务自定义的Action
|
|
60
|
-
})(ActionTypeEnum = exports.ActionTypeEnum || (exports.ActionTypeEnum = {}));
|
|
61
17
|
var MergeConflictEditorMode;
|
|
62
18
|
(function (MergeConflictEditorMode) {
|
|
63
19
|
MergeConflictEditorMode["3way"] = "3way";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../../src/types/ai-native/reporter.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,IAAI,CAAC;AAErC,IAAY,
|
|
1
|
+
{"version":3,"file":"reporter.js","sourceRoot":"","sources":["../../../src/types/ai-native/reporter.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,IAAI,CAAC;AAErC,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,0CAAyB,CAAA;IACzB,oDAAmC,CAAA;IACnC,8CAA6B,CAAA;IAC7B,0CAAyB,CAAA;IACzB,gCAAe,CAAA;IACf,gDAA+B,CAAA;IAC/B,kCAAiB,CAAA;IACjB,wDAAuC,CAAA;AACzC,CAAC,EAVW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAUxB;AAsCD,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,wCAAe,CAAA;IACf,sDAA6B,CAAA;AAC/B,CAAC,EAHW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAGlC;AAgEY,QAAA,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-core-common",
|
|
3
|
-
"version": "3.3.1-next-
|
|
3
|
+
"version": "3.3.1-next-1725521092.0",
|
|
4
4
|
"description": "@opensumi/ide-core-common",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@opensumi/di": "^1.8.0",
|
|
22
|
-
"@opensumi/ide-utils": "3.3.1-next-
|
|
22
|
+
"@opensumi/ide-utils": "3.3.1-next-1725521092.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@opensumi/ide-dev-tool": "3.3.1-next-
|
|
25
|
+
"@opensumi/ide-dev-tool": "3.3.1-next-1725521092.0"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "68c076414923186ea5f99696d5d23a2fb62a29e1"
|
|
28
28
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* modified from: https://github.com/mhart/epipebomb
|
|
3
|
+
*
|
|
4
|
+
* support EIO
|
|
5
|
+
*/
|
|
6
|
+
export function epipeBomb(stream: NodeJS.WriteStream, callback: (code?: number) => void) {
|
|
7
|
+
if (!stream) {
|
|
8
|
+
stream = process.stdout;
|
|
9
|
+
}
|
|
10
|
+
if (!callback) {
|
|
11
|
+
callback = process.exit;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function epipeFilter(err: any) {
|
|
15
|
+
if (err.code === 'EPIPE') {
|
|
16
|
+
return callback();
|
|
17
|
+
}
|
|
18
|
+
if (err.code === 'EIO') {
|
|
19
|
+
return callback();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// If there's more than one error handler (ie, us),
|
|
23
|
+
// then the error won't be bubbled up anyway
|
|
24
|
+
if (stream.listeners('error').length <= 1) {
|
|
25
|
+
stream.removeAllListeners('error'); // Pretend we were never here
|
|
26
|
+
stream.emit('error', err); // Then emit as if we were never here
|
|
27
|
+
stream.on('error', epipeFilter); // Then reattach, ready for the next error!
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
stream.on('error', epipeFilter);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 参考:https://github.com/camunda/camunda-modeler/pull/3314
|
|
36
|
+
* fix(app): suppress EPIPE errors for app output
|
|
37
|
+
*/
|
|
38
|
+
export function suppressNodeJSEpipeError(_process: NodeJS.Process, error: (msg: string) => void) {
|
|
39
|
+
let suppressing = false;
|
|
40
|
+
const logEPIPEErrorOnce = () => {
|
|
41
|
+
if (suppressing) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
suppressing = true;
|
|
46
|
+
error('Detected EPIPE error; suppressing further EPIPE errors');
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
_process.stdout && epipeBomb(_process.stdout, logEPIPEErrorOnce);
|
|
50
|
+
_process.stderr && epipeBomb(_process.stderr, logEPIPEErrorOnce);
|
|
51
|
+
}
|
|
@@ -3,7 +3,6 @@ export const AI_REPORTER_NAME = 'AI';
|
|
|
3
3
|
export enum AISerivceType {
|
|
4
4
|
Chat = 'chat',
|
|
5
5
|
InlineChat = 'inlineChat',
|
|
6
|
-
CodeAction = 'codeAction',
|
|
7
6
|
InlineChatInput = 'inlineChatInput',
|
|
8
7
|
CustomReplay = 'customReplay',
|
|
9
8
|
Completion = 'completion',
|
|
@@ -13,49 +12,6 @@ export enum AISerivceType {
|
|
|
13
12
|
TerminalAICommand = 'terminalAICommand',
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
export enum ActionSourceEnum {
|
|
17
|
-
// 聊天面板
|
|
18
|
-
Chat = 'chat',
|
|
19
|
-
// 编辑器内联 Chat
|
|
20
|
-
InlineChat = 'inlineChat',
|
|
21
|
-
// 编辑器内 Action
|
|
22
|
-
CodeAction = 'codeAction',
|
|
23
|
-
// 终端
|
|
24
|
-
Terminal = 'terminal',
|
|
25
|
-
// 下拉补全 | 自动补全
|
|
26
|
-
Completion = 'completion',
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export enum ActionTypeEnum {
|
|
30
|
-
// 自动补全
|
|
31
|
-
Completion = 'completion',
|
|
32
|
-
// 下拉补全
|
|
33
|
-
DropdownCompletion = 'dropdownCompletion',
|
|
34
|
-
// ai重命名
|
|
35
|
-
Rename = 'rename',
|
|
36
|
-
// Chat面板 插入代码
|
|
37
|
-
ChatInsertCode = 'chatInsertCode',
|
|
38
|
-
// Chat面板 复制代码
|
|
39
|
-
ChatCopyCode = 'chatCopyCode',
|
|
40
|
-
// Chat面板 欢迎语的Action
|
|
41
|
-
Welcome = 'welcome',
|
|
42
|
-
// Chat面板 回复消息的Action
|
|
43
|
-
Followup = 'followup',
|
|
44
|
-
// 发送消息
|
|
45
|
-
Send = 'send',
|
|
46
|
-
// 生成代码后的行动点:全部采纳
|
|
47
|
-
Accept = 'accept',
|
|
48
|
-
// 生成代码后的行动点:单模块采纳
|
|
49
|
-
lineAccept = 'lineAccept',
|
|
50
|
-
// 生成代码后的行动点:全部拒绝
|
|
51
|
-
Discard = 'discard',
|
|
52
|
-
// 生成代码后的行动点:全部拒绝
|
|
53
|
-
LineDiscard = 'lineDiscard',
|
|
54
|
-
// 生成代码后的行动点:重新生成
|
|
55
|
-
Regenerate = 'regenerate',
|
|
56
|
-
// 包含业务自定义的Action
|
|
57
|
-
}
|
|
58
|
-
|
|
59
15
|
export interface CommonLogInfo {
|
|
60
16
|
msgType: AISerivceType | string;
|
|
61
17
|
relationId: string;
|
|
@@ -71,20 +27,6 @@ export interface CommonLogInfo {
|
|
|
71
27
|
insert: boolean;
|
|
72
28
|
isRetry: boolean;
|
|
73
29
|
isDrop: boolean;
|
|
74
|
-
language?: string;
|
|
75
|
-
// 针对新版数据增加额外参数
|
|
76
|
-
// 采纳代码
|
|
77
|
-
code?: string;
|
|
78
|
-
// 原始代码
|
|
79
|
-
originCode?: string;
|
|
80
|
-
// 文件路径
|
|
81
|
-
fileUrl?: string;
|
|
82
|
-
// 仓库地址
|
|
83
|
-
repo?: string;
|
|
84
|
-
// 行动点来源
|
|
85
|
-
actionSource?: ActionSourceEnum | string;
|
|
86
|
-
// 行动点类型,内置通用,但是很多来自业务
|
|
87
|
-
actionType?: ActionTypeEnum | string;
|
|
88
30
|
}
|
|
89
31
|
|
|
90
32
|
export interface CompletionRT extends Partial<CommonLogInfo> {
|
|
@@ -104,7 +46,6 @@ export interface IAIReportCompletionOption {
|
|
|
104
46
|
repo?: string;
|
|
105
47
|
completionUseTime?: number;
|
|
106
48
|
renderingTime?: number;
|
|
107
|
-
code?: string;
|
|
108
49
|
}
|
|
109
50
|
|
|
110
51
|
export enum MergeConflictEditorMode {
|
|
@@ -114,7 +55,6 @@ export enum MergeConflictEditorMode {
|
|
|
114
55
|
|
|
115
56
|
export interface ChatRT extends Partial<CommonLogInfo> {
|
|
116
57
|
agentId?: string;
|
|
117
|
-
command?: string;
|
|
118
58
|
userMessage?: string;
|
|
119
59
|
assistantMessage?: string;
|
|
120
60
|
}
|
|
@@ -181,7 +121,6 @@ export interface IAIReporter {
|
|
|
181
121
|
getCommonReportInfo(): Record<string, unknown>;
|
|
182
122
|
getCacheReportInfo<T = ReportInfo>(relationId: string): T | undefined;
|
|
183
123
|
record(data: ReportInfo, relationId?: string): ReportInfo;
|
|
184
|
-
getRelationId(): string;
|
|
185
124
|
// 返回关联 ID
|
|
186
125
|
start(msg: string, data: ReportInfo): string;
|
|
187
126
|
end(relationId: string, data: ReportInfo): void;
|