@comate/zulu 1.1.0 → 1.2.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/README.md +8 -0
- package/comate-engine/assets/skills/auto-commit/SKILL.md +386 -0
- package/comate-engine/assets/skills/auto-commit/references/issue_type_mapping.json +19 -0
- package/comate-engine/assets/skills/auto-commit/references/new_version_instruction.md +196 -0
- package/comate-engine/assets/skills/auto-commit/references/old_version_instruction.md +189 -0
- package/comate-engine/assets/skills/auto-commit/references/query_reference.md +176 -0
- package/comate-engine/assets/skills/auto-commit/scripts/compat.py +86 -0
- package/comate-engine/assets/skills/auto-commit/scripts/create_card_cli.py +67 -0
- package/comate-engine/assets/skills/auto-commit/scripts/git_diff_cli.py +195 -0
- package/comate-engine/assets/skills/auto-commit/scripts/git_utils.py +225 -0
- package/comate-engine/assets/skills/auto-commit/scripts/icafe/__init__.py +66 -0
- package/comate-engine/assets/skills/auto-commit/scripts/icafe/client.py +444 -0
- package/comate-engine/assets/skills/auto-commit/scripts/icafe/farseer.py +53 -0
- package/comate-engine/assets/skills/auto-commit/scripts/icafe/matching.py +778 -0
- package/comate-engine/assets/skills/auto-commit/scripts/logger.py +32 -0
- package/comate-engine/assets/skills/auto-commit/scripts/recognize_card_cli.py +63 -0
- package/comate-engine/assets/skills/automation-browser-comate/SKILL.md +193 -90
- package/comate-engine/assets/skills/figma2code-comate/SKILL.md +2 -2
- package/comate-engine/assets/skills/figma2code-comate/references/codeConnect.md +7 -10
- package/comate-engine/assets/skills/smart-commit/SKILL.md +646 -0
- package/comate-engine/assets/skills/smart-commit/references/issue_type_mapping.json +19 -0
- package/comate-engine/assets/skills/smart-commit/references/query_reference.md +176 -0
- package/comate-engine/assets/skills/smart-commit/scripts/compat.py +86 -0
- package/comate-engine/assets/skills/smart-commit/scripts/create_card_cli.py +67 -0
- package/comate-engine/assets/skills/smart-commit/scripts/git_utils.py +220 -0
- package/comate-engine/assets/skills/smart-commit/scripts/icafe/__init__.py +66 -0
- package/comate-engine/assets/skills/smart-commit/scripts/icafe/client.py +444 -0
- package/comate-engine/assets/skills/smart-commit/scripts/icafe/farseer.py +53 -0
- package/comate-engine/assets/skills/smart-commit/scripts/icafe/matching.py +728 -0
- package/comate-engine/assets/skills/smart-commit/scripts/logger.py +32 -0
- package/comate-engine/assets/skills/smart-commit/scripts/recognize_card_cli.py +63 -0
- package/comate-engine/node_modules/@comate/plugin-engine/dist/index.js +7 -7
- package/comate-engine/node_modules/@comate/plugin-host/dist/index.js +1 -1
- package/comate-engine/node_modules/@comate/plugin-host/dist/main.js +1 -1
- package/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.js +8 -8
- package/comate-engine/node_modules/@comate/preview-proxy/package.json +2 -2
- package/comate-engine/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/comate-engine/package.json +2 -2
- package/comate-engine/server.js +61 -44
- package/dist/bundle/index.js +8 -8
- package/package.json +1 -1
- package/comate-engine/node_modules/@comate/plugin-engine/dist/index.d.ts +0 -188
- package/comate-engine/node_modules/@comate/plugin-host/dist/main.d.ts +0 -14
- package/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.d.ts +0 -4817
- package/comate-engine/node_modules/better-sqlite3/README.md +0 -99
- package/comate-engine/node_modules/bindings/LICENSE.md +0 -22
- package/comate-engine/node_modules/bindings/README.md +0 -98
- package/comate-engine/node_modules/compare-versions/README.md +0 -133
- package/comate-engine/node_modules/compare-versions/lib/esm/compare.d.ts +0 -19
- package/comate-engine/node_modules/compare-versions/lib/esm/compareVersions.d.ts +0 -8
- package/comate-engine/node_modules/compare-versions/lib/esm/index.d.ts +0 -5
- package/comate-engine/node_modules/compare-versions/lib/esm/satisfies.d.ts +0 -14
- package/comate-engine/node_modules/compare-versions/lib/esm/utils.d.ts +0 -7
- package/comate-engine/node_modules/compare-versions/lib/esm/validate.d.ts +0 -28
- package/comate-engine/node_modules/file-uri-to-path/History.md +0 -21
- package/comate-engine/node_modules/file-uri-to-path/README.md +0 -74
- package/comate-engine/node_modules/file-uri-to-path/index.d.ts +0 -2
- package/comate-engine/node_modules/pkce-challenge/README.md +0 -55
- package/comate-engine/node_modules/pkce-challenge/dist/index.browser.d.ts +0 -19
- package/comate-engine/node_modules/pkce-challenge/dist/index.node.d.ts +0 -19
- package/comate-engine/node_modules/sqlite-vec/README.md +0 -1
- package/comate-engine/node_modules/sqlite-vec/index.d.ts +0 -17
- package/comate-engine/node_modules/sqlite-vec-darwin-arm64/README.md +0 -1
- package/comate-engine/node_modules/sqlite-vec-darwin-x64/README.md +0 -1
- package/comate-engine/node_modules/sqlite-vec-linux-arm64/README.md +0 -1
- package/comate-engine/node_modules/sqlite-vec-linux-x64/README.md +0 -1
- package/comate-engine/node_modules/sqlite-vec-windows-x64/README.md +0 -1
- package/comate-engine/node_modules/tree-sitter-bash/README.md +0 -44
- package/comate-engine/node_modules/tree-sitter-bash/bindings/node/binding_test.js +0 -9
- package/comate-engine/node_modules/tree-sitter-bash/bindings/node/index.d.ts +0 -28
- package/comate-engine/node_modules/tree-sitter-bash/bindings/node/index.js +0 -11
- package/comate-engine/node_modules/tree-sitter-bash/prebuilds/darwin-arm64/tree-sitter-bash.node +0 -0
- package/comate-engine/node_modules/tree-sitter-bash/prebuilds/darwin-x64/tree-sitter-bash.node +0 -0
- package/comate-engine/node_modules/tree-sitter-bash/prebuilds/linux-arm64/tree-sitter-bash.node +0 -0
- package/comate-engine/node_modules/tree-sitter-bash/prebuilds/linux-x64/tree-sitter-bash.node +0 -0
- package/comate-engine/node_modules/tree-sitter-bash/prebuilds/win32-arm64/tree-sitter-bash.node +0 -0
- package/comate-engine/node_modules/tree-sitter-bash/prebuilds/win32-x64/tree-sitter-bash.node +0 -0
- package/comate-engine/node_modules/tree-sitter-bash/src/grammar.json +0 -7145
- package/comate-engine/node_modules/tree-sitter-bash/src/node-types.json +0 -2894
- package/comate-engine/node_modules/web-streams-polyfill/README.md +0 -119
- package/comate-engine/node_modules/web-streams-polyfill/types/polyfill.d.ts +0 -28
- package/comate-engine/node_modules/web-streams-polyfill/types/ponyfill.d.ts +0 -809
- package/comate-engine/node_modules/web-tree-sitter/README.md +0 -269
- package/comate-engine/node_modules/web-tree-sitter/debug/tree-sitter.cjs +0 -4558
- package/comate-engine/node_modules/web-tree-sitter/debug/tree-sitter.js +0 -4516
- package/comate-engine/node_modules/web-tree-sitter/debug/tree-sitter.wasm +0 -0
- package/comate-engine/node_modules/web-tree-sitter/web-tree-sitter.d.ts +0 -1030
- package/comate-engine/node_modules/win-ca/README.md +0 -648
|
@@ -1,4817 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { JSONSchema7Definition } from 'json-schema';
|
|
3
|
-
import { WorkspaceFolder } from 'vscode-languageserver-types';
|
|
4
|
-
import * as axios from 'axios';
|
|
5
|
-
import { CreateAxiosDefaults } from 'axios';
|
|
6
|
-
export { axios as Axios };
|
|
7
|
-
import fse__default from 'fs-extra';
|
|
8
|
-
import * as fse from 'fs-extra';
|
|
9
|
-
export { fse as TypeFSE };
|
|
10
|
-
import { IncomingMessage } from 'http';
|
|
11
|
-
import * as vscode from 'vscode';
|
|
12
|
-
import { Change } from 'diff';
|
|
13
|
-
import { interfaces } from 'inversify';
|
|
14
|
-
|
|
15
|
-
declare const ACTION_INFORMATION_QUERY = "INFORMATION_QUERY";
|
|
16
|
-
interface Information {
|
|
17
|
-
uuid: string;
|
|
18
|
-
type: ContextType$1 | string;
|
|
19
|
-
name?: string;
|
|
20
|
-
content?: string;
|
|
21
|
-
contentStart?: Position$2;
|
|
22
|
-
contentEnd?: Position$2;
|
|
23
|
-
path?: string;
|
|
24
|
-
}
|
|
25
|
-
declare enum ContextType$1 {
|
|
26
|
-
/** 当前文件 */
|
|
27
|
-
CURRENT_FILE = "CURRENT_FILE",
|
|
28
|
-
/** 文件 */
|
|
29
|
-
FILE = "FILE",
|
|
30
|
-
/** 目录 */
|
|
31
|
-
FOLDER = "FOLDER",
|
|
32
|
-
/** 代码库 */
|
|
33
|
-
REPO = "REPO",
|
|
34
|
-
/** 系统知识集 */
|
|
35
|
-
SYSTEM = "SYSTEM",
|
|
36
|
-
/** 普通知识集 */
|
|
37
|
-
NORMAL = "NORMAL",
|
|
38
|
-
/** 网页 */
|
|
39
|
-
URL = "URL",
|
|
40
|
-
/** Web,网络搜索 */
|
|
41
|
-
WEB = "WEB",
|
|
42
|
-
/** 单个 API 链接 */
|
|
43
|
-
API = "API",
|
|
44
|
-
/** API 的项目 */
|
|
45
|
-
API_PROJECT = "API_PROJECT",
|
|
46
|
-
/** 用户划选的代码,理论上不会放到 context 里 */
|
|
47
|
-
CODE = "CODE",
|
|
48
|
-
/** 历史存在,先保留该类型 */
|
|
49
|
-
TEMP = "TEMP",
|
|
50
|
-
/** 终端,暂时只有autoDebug在用 */
|
|
51
|
-
TERMINAL = "TERMINAL"
|
|
52
|
-
}
|
|
53
|
-
interface Position$2 {
|
|
54
|
-
line: number;
|
|
55
|
-
column: number;
|
|
56
|
-
}
|
|
57
|
-
declare enum InformationQueryType {
|
|
58
|
-
Text = "TEXT",
|
|
59
|
-
Code = "CODE",
|
|
60
|
-
File = "FILE"
|
|
61
|
-
}
|
|
62
|
-
interface InformationPayload {
|
|
63
|
-
pluginName: string;
|
|
64
|
-
informationList: Information[];
|
|
65
|
-
query: string;
|
|
66
|
-
type: InformationQueryType;
|
|
67
|
-
options?: KnowledgeOptions;
|
|
68
|
-
}
|
|
69
|
-
interface IdeSideInformationPayload {
|
|
70
|
-
pluginName: string;
|
|
71
|
-
result: string[];
|
|
72
|
-
}
|
|
73
|
-
interface IdeSideInformationResponse {
|
|
74
|
-
action: typeof ACTION_INFORMATION_QUERY;
|
|
75
|
-
payload: IdeSideInformationPayload;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* 表示一个用户的信息
|
|
80
|
-
*/
|
|
81
|
-
interface UserDetail {
|
|
82
|
-
/** 用户名,如邮箱前缀 */
|
|
83
|
-
readonly name: string;
|
|
84
|
-
/** 用户显示的名称,如中文姓名 */
|
|
85
|
-
readonly displayName: string;
|
|
86
|
-
/** 用户的完整电子邮件地址 */
|
|
87
|
-
readonly email: string;
|
|
88
|
-
/** 用户license,saas才有 */
|
|
89
|
-
readonly license?: string;
|
|
90
|
-
}
|
|
91
|
-
interface SystemInfoParsed {
|
|
92
|
-
userId: string;
|
|
93
|
-
userDetail: UserDetail;
|
|
94
|
-
cwd: string;
|
|
95
|
-
repoId?: string;
|
|
96
|
-
}
|
|
97
|
-
interface Range$1 {
|
|
98
|
-
/** 起始位置,包含 */
|
|
99
|
-
start: number;
|
|
100
|
-
/** 结束位置,不包含 */
|
|
101
|
-
end: number;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
declare const ACTION_CHAT_QUERY = "CHAT_QUERY";
|
|
105
|
-
/** @deprecate */
|
|
106
|
-
interface ChatQueryParsed {
|
|
107
|
-
messageId: string;
|
|
108
|
-
pluginName: string;
|
|
109
|
-
capability?: string | undefined;
|
|
110
|
-
query: string;
|
|
111
|
-
data?: any;
|
|
112
|
-
informationList: Information[];
|
|
113
|
-
enableSmartApply?: boolean;
|
|
114
|
-
modelKey?: string;
|
|
115
|
-
}
|
|
116
|
-
/** @deprecate */
|
|
117
|
-
declare enum ContextType {
|
|
118
|
-
/** 当前文件 */
|
|
119
|
-
CURRENT_FILE = "CURRENT_FILE",
|
|
120
|
-
/** 文件 */
|
|
121
|
-
FILE = "FILE",
|
|
122
|
-
/** 目录 */
|
|
123
|
-
FOLDER = "FOLDER",
|
|
124
|
-
/** 代码库 */
|
|
125
|
-
REPO = "REPO",
|
|
126
|
-
/** 系统知识集 */
|
|
127
|
-
SYSTEM = "SYSTEM",
|
|
128
|
-
/** 普通知识集 */
|
|
129
|
-
NORMAL = "NORMAL",
|
|
130
|
-
/** 网页 */
|
|
131
|
-
URL = "URL",
|
|
132
|
-
/** Web,网络搜索 */
|
|
133
|
-
WEB = "WEB",
|
|
134
|
-
/** 用户划选的代码,理论上不会放到 context 里 */
|
|
135
|
-
CODE = "CODE",
|
|
136
|
-
/** 历史存在,先保留该类型 */
|
|
137
|
-
TEMP = "TEMP",
|
|
138
|
-
/** 终端,暂时只有autoDebug在用 */
|
|
139
|
-
TERMINAL = "TERMINAL",
|
|
140
|
-
IMAGE = "IMAGE",
|
|
141
|
-
/** 规则 */
|
|
142
|
-
RULE = "RULE",
|
|
143
|
-
/** 编码区右键添加的代码块 */
|
|
144
|
-
CODE_SELECTION = "CODE_SELECTION",
|
|
145
|
-
/** 终端右键添加的信息 */
|
|
146
|
-
TERMINAL_SELECTION = "TERMINAL_SELECTION",
|
|
147
|
-
/** diff */
|
|
148
|
-
DIFF = "DIFF",
|
|
149
|
-
/** 预览添加的代码块 */
|
|
150
|
-
PREVIEW_CODE_SNIPPET = "PREVIEW_CODE_SNIPPET",
|
|
151
|
-
PREVIEW_CONSOLE_ERROR_SNIPPET = "PREVIEW_CONSOLE_ERROR_SNIPPET",
|
|
152
|
-
PREVIEW_TEXT_SELECTION_SNIPPET = "PREVIEW_TEXT_SELECTION_SNIPPET",
|
|
153
|
-
/** FIGMA设计稿 */
|
|
154
|
-
FIGMA = "FIGMA",
|
|
155
|
-
DIAGNOSTIC = "DIAGNOSTIC",
|
|
156
|
-
/** 外部知识 DevOps */
|
|
157
|
-
EXTERNAL_KNOWLEDGE_TEXT = "EXTERNAL_KNOWLEDGE_TEXT"
|
|
158
|
-
}
|
|
159
|
-
declare enum RoleType {
|
|
160
|
-
CHAT = "chat",
|
|
161
|
-
ZULU = "zulu"
|
|
162
|
-
}
|
|
163
|
-
interface KnowledgeList {
|
|
164
|
-
id: string;
|
|
165
|
-
name: string;
|
|
166
|
-
content?: string;
|
|
167
|
-
/** IMAGE 图片类型的在用 */
|
|
168
|
-
contents?: string[];
|
|
169
|
-
url?: string;
|
|
170
|
-
retrievalType?: 'LOCAL_CODE' | 'TEXT';
|
|
171
|
-
/** 当type为TERMINAL时,path代表终端路径 */
|
|
172
|
-
path?: string;
|
|
173
|
-
/** 当type为CODE_SELECTION时,selection代表选中代码的行号范围 */
|
|
174
|
-
selection?: [number, number];
|
|
175
|
-
type: ContextType;
|
|
176
|
-
knowledgeId?: string;
|
|
177
|
-
/** 当type为diff,且文件是已经存储到暂存区域的时候 */
|
|
178
|
-
staged?: boolean;
|
|
179
|
-
/** 当从自研IDE中的入口进行codeReview时,尽量返回结果 */
|
|
180
|
-
isPartSelect?: boolean;
|
|
181
|
-
/** 当type为CODE_SELECTION时,filePath代表文件路径 */
|
|
182
|
-
filePath?: string;
|
|
183
|
-
}
|
|
184
|
-
interface InputBoxMessageHistory {
|
|
185
|
-
value: string;
|
|
186
|
-
agent?: string | undefined;
|
|
187
|
-
slash?: string | undefined;
|
|
188
|
-
/** 原始的带mention的文本,优先使用这个 */
|
|
189
|
-
rawMessage?: string;
|
|
190
|
-
knowledgeList?: KnowledgeList[];
|
|
191
|
-
repoName?: string;
|
|
192
|
-
role?: RoleType;
|
|
193
|
-
}
|
|
194
|
-
interface ChatQueryPayload {
|
|
195
|
-
pluginName: string;
|
|
196
|
-
input: ChatQueryParsed;
|
|
197
|
-
context: ActivationContext;
|
|
198
|
-
systemInfo: SystemInfoParsed;
|
|
199
|
-
isRegenerated?: boolean;
|
|
200
|
-
sessionUuid?: string;
|
|
201
|
-
}
|
|
202
|
-
declare const ACTION_CHAT_TASK_PROGRESS = "CHAT_TASK_PROGRESS";
|
|
203
|
-
|
|
204
|
-
declare const ACTION_LOG = "LOG";
|
|
205
|
-
type UserLogLevel = 'verbose' | 'info' | 'warn' | 'error';
|
|
206
|
-
type LogLevel = UserLogLevel | 'system';
|
|
207
|
-
interface LogPayload {
|
|
208
|
-
level: LogLevel;
|
|
209
|
-
source: string;
|
|
210
|
-
action: string;
|
|
211
|
-
detail: Record<string, any>;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
declare enum TaskStatus {
|
|
215
|
-
INIT = "INIT",
|
|
216
|
-
PROCESSING = "PROCESSING",
|
|
217
|
-
SUCCEED = "SUCCEED",
|
|
218
|
-
FAIL = "FAIL"
|
|
219
|
-
}
|
|
220
|
-
interface SubTask {
|
|
221
|
-
/** 任务描述 */
|
|
222
|
-
desc: string;
|
|
223
|
-
status: TaskStatus;
|
|
224
|
-
/** 任务详情 */
|
|
225
|
-
detail?: string[];
|
|
226
|
-
/** type 决定当前思考过程的 tag 的显示 */
|
|
227
|
-
taskType: 'SEARCH' | 'PLAN' | 'REASONING' | 'THOUGHT' | 'CODE_GENERATE' | 'ANSWER' | 'ANALYZE';
|
|
228
|
-
}
|
|
229
|
-
interface Task extends SubTask {
|
|
230
|
-
/** 二级子任务 */
|
|
231
|
-
subTasks?: SubTask[];
|
|
232
|
-
}
|
|
233
|
-
interface BaseDynamicSection {
|
|
234
|
-
label: string;
|
|
235
|
-
done: boolean;
|
|
236
|
-
collapsible: boolean;
|
|
237
|
-
}
|
|
238
|
-
interface DynamicActionItems extends BaseDynamicSection {
|
|
239
|
-
type: 'actionItems';
|
|
240
|
-
tasks: Task[];
|
|
241
|
-
relevantFiles?: string[];
|
|
242
|
-
}
|
|
243
|
-
interface CodeChunk$1 {
|
|
244
|
-
filePath: string;
|
|
245
|
-
code: string;
|
|
246
|
-
language: string;
|
|
247
|
-
startLine: number;
|
|
248
|
-
endLine: number;
|
|
249
|
-
}
|
|
250
|
-
interface KnowledgeChunk$1 {
|
|
251
|
-
id: string;
|
|
252
|
-
content: string;
|
|
253
|
-
url: string;
|
|
254
|
-
title: string;
|
|
255
|
-
}
|
|
256
|
-
interface WebChunk {
|
|
257
|
-
id: number;
|
|
258
|
-
title: string;
|
|
259
|
-
url: string;
|
|
260
|
-
}
|
|
261
|
-
interface DynamicCodeChunks extends BaseDynamicSection {
|
|
262
|
-
type: 'codeChunks';
|
|
263
|
-
codeChunks?: CodeChunk$1[];
|
|
264
|
-
knowledgeChunks?: KnowledgeChunk$1[];
|
|
265
|
-
webChunks?: WebChunk[];
|
|
266
|
-
}
|
|
267
|
-
interface DynamicRelativeFiles extends BaseDynamicSection {
|
|
268
|
-
type: 'relativeFiles';
|
|
269
|
-
files: string[];
|
|
270
|
-
}
|
|
271
|
-
interface Step {
|
|
272
|
-
id: number;
|
|
273
|
-
desc: string;
|
|
274
|
-
status: TaskStatus;
|
|
275
|
-
tasks: Task[];
|
|
276
|
-
}
|
|
277
|
-
interface DynamicCodeGenSteps extends BaseDynamicSection {
|
|
278
|
-
type: 'codeGenSteps';
|
|
279
|
-
steps: Step[];
|
|
280
|
-
}
|
|
281
|
-
interface DynamicReminder extends BaseDynamicSection {
|
|
282
|
-
type: 'reminder';
|
|
283
|
-
reminder: string;
|
|
284
|
-
}
|
|
285
|
-
interface Notification {
|
|
286
|
-
notificationType: 'info' | 'fail' | 'success';
|
|
287
|
-
title: string;
|
|
288
|
-
path?: string;
|
|
289
|
-
}
|
|
290
|
-
interface DynamicNotification extends BaseDynamicSection {
|
|
291
|
-
type: 'notification';
|
|
292
|
-
notifications: Notification[];
|
|
293
|
-
}
|
|
294
|
-
type DynamicSection = DynamicActionItems | DynamicCodeChunks | DynamicCodeGenSteps | DynamicRelativeFiles | DynamicReminder | DynamicNotification;
|
|
295
|
-
|
|
296
|
-
interface WorkspaceEditEntryMetadata {
|
|
297
|
-
/** A flag which indicates that user confirmation is needed. */
|
|
298
|
-
needsConfirmation: boolean;
|
|
299
|
-
/** A human-readable string which is rendered prominent. */
|
|
300
|
-
label: string;
|
|
301
|
-
/** A human-readable string which is rendered less prominent on the same line. */
|
|
302
|
-
description?: string;
|
|
303
|
-
}
|
|
304
|
-
interface Position$1 {
|
|
305
|
-
line: number;
|
|
306
|
-
character: number;
|
|
307
|
-
}
|
|
308
|
-
interface AcceptByReplace {
|
|
309
|
-
type: 'replace';
|
|
310
|
-
path: string;
|
|
311
|
-
range: {
|
|
312
|
-
start: Position$1;
|
|
313
|
-
end: Position$1;
|
|
314
|
-
};
|
|
315
|
-
newText: string;
|
|
316
|
-
oldText?: string;
|
|
317
|
-
metadata?: WorkspaceEditEntryMetadata;
|
|
318
|
-
}
|
|
319
|
-
interface AcceptByInsert {
|
|
320
|
-
type: 'insert';
|
|
321
|
-
path: string;
|
|
322
|
-
position: Position$1;
|
|
323
|
-
newText: string;
|
|
324
|
-
metadata?: WorkspaceEditEntryMetadata;
|
|
325
|
-
}
|
|
326
|
-
type AcceptByType = AcceptByReplace | AcceptByInsert;
|
|
327
|
-
type Accept = AcceptByType[];
|
|
328
|
-
declare const ACTION_BATCH_ACCEPT = "ACCEPT_DIR";
|
|
329
|
-
interface BatchAcceptPayload {
|
|
330
|
-
/** 批量采纳文件列表 */
|
|
331
|
-
paths: string[];
|
|
332
|
-
}
|
|
333
|
-
interface BatchAcceptPluginPayload {
|
|
334
|
-
pluginName: string;
|
|
335
|
-
capabilityName?: string;
|
|
336
|
-
batchAcceptPayload: BatchAcceptPayload;
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
type ActionType = 'regenerate' | 'enhancedGenerate' | 'batchAccept';
|
|
340
|
-
type Actions = Partial<Record<string, (content?: any, language?: string, extra?: any) => void>>;
|
|
341
|
-
interface ActionDataTypes {
|
|
342
|
-
regenerate: any;
|
|
343
|
-
enhancedGenerate: any;
|
|
344
|
-
batchAccept: Accept;
|
|
345
|
-
}
|
|
346
|
-
interface ActionConfig<T> {
|
|
347
|
-
/** action 文本 */
|
|
348
|
-
name: string;
|
|
349
|
-
/** action 图标 */
|
|
350
|
-
icon?: string;
|
|
351
|
-
/** action 类型 用于颜色渲染 */
|
|
352
|
-
type?: 'primary' | 'normal';
|
|
353
|
-
/** action 描述,hover时展示 */
|
|
354
|
-
description?: string;
|
|
355
|
-
/** 二级描述信息,hover时展示 */
|
|
356
|
-
subDescription?: string;
|
|
357
|
-
/** 成功反馈信息 */
|
|
358
|
-
successLabel?: string;
|
|
359
|
-
/** action对应数据 */
|
|
360
|
-
data?: T extends ActionType ? ActionDataTypes[T] : never;
|
|
361
|
-
/** 位置 */
|
|
362
|
-
position?: 'foot-left' | 'foot-left-before' | 'foot-left-after';
|
|
363
|
-
}
|
|
364
|
-
/** action的其他信息配置集合 */
|
|
365
|
-
type ActionConfigs = Partial<Record<string, ActionConfig<ActionType>>>;
|
|
366
|
-
interface ActionSet {
|
|
367
|
-
actions: Actions;
|
|
368
|
-
actionConfigs: ActionConfigs;
|
|
369
|
-
activeActionKeys?: string[];
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
type ChunkContent = string | string[] | DrawElement | DrawElement[];
|
|
373
|
-
/**
|
|
374
|
-
* 更新用户看到的消息内容
|
|
375
|
-
*/
|
|
376
|
-
interface DrawChunk {
|
|
377
|
-
/** 指定更新用户的回复信息 */
|
|
378
|
-
command: 'draw';
|
|
379
|
-
/** 重绘后的内容 */
|
|
380
|
-
content: ChunkContent;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* 更新用户看到的动态section
|
|
384
|
-
*/
|
|
385
|
-
interface SectionChunk {
|
|
386
|
-
/** 指定更新用户的section */
|
|
387
|
-
command: 'section';
|
|
388
|
-
/** 重绘后的section */
|
|
389
|
-
sections: {
|
|
390
|
-
dynamicSections: DynamicSection[];
|
|
391
|
-
dynamicFooterSections: DynamicSection[];
|
|
392
|
-
};
|
|
393
|
-
/** 重绘后的content */
|
|
394
|
-
content: string;
|
|
395
|
-
/** 重绘后的action及配置 */
|
|
396
|
-
/** NOTE: 仅用于更新整个消息的action,不包括代码块内的action */
|
|
397
|
-
actionSet?: ActionSet;
|
|
398
|
-
}
|
|
399
|
-
/**
|
|
400
|
-
* 告知用户执行失败
|
|
401
|
-
*/
|
|
402
|
-
interface FailChunk {
|
|
403
|
-
/** 指定告知用户任务失败 */
|
|
404
|
-
command: 'fail';
|
|
405
|
-
/** 失败的提示信息 */
|
|
406
|
-
content: ChunkContent;
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* 任务处理过程的反馈片段
|
|
410
|
-
*/
|
|
411
|
-
type TaskProgressChunk = DrawChunk | FailChunk | SectionChunk | ChunkContent;
|
|
412
|
-
interface TaskProgressPayload {
|
|
413
|
-
messageId?: number;
|
|
414
|
-
taskId: string;
|
|
415
|
-
chunk: TaskProgressChunk;
|
|
416
|
-
capabilityName?: string;
|
|
417
|
-
enableSmartApply?: boolean;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
type PrimitiveChildren = string | number | Array<string | number>;
|
|
421
|
-
type ElementChildren = DrawElement | string | number | Array<DrawElement | string | number>;
|
|
422
|
-
type CodeBlockActions = 'replaceToFile' | 'insertToFile' | 'copy' | 'accept' | 'diff' | 'showFileInsertDiff' | 'showFileReplaceDiff' | 'newFile' | 'insertIntoTerminal' | 'viewFile' | 'smartApply' | 'newFile';
|
|
423
|
-
interface FileLink {
|
|
424
|
-
type: 'file-link';
|
|
425
|
-
/** 指向项目中的具体文件,不能以`/`或`..`开始 */
|
|
426
|
-
to: string;
|
|
427
|
-
/** 指定跳转到的行号,行号以1起始 */
|
|
428
|
-
line?: number;
|
|
429
|
-
/** 可选的显示内容,不提供则使用`to`属性 */
|
|
430
|
-
children?: PrimitiveChildren;
|
|
431
|
-
/** 是否展示文件图标 */
|
|
432
|
-
showIcon?: boolean;
|
|
433
|
-
}
|
|
434
|
-
interface Markdown {
|
|
435
|
-
type: 'markdown';
|
|
436
|
-
/** 具体的Markdown内容 */
|
|
437
|
-
children: PrimitiveChildren;
|
|
438
|
-
}
|
|
439
|
-
/** 指代时替换选中代码(或插入到光标位置) */
|
|
440
|
-
interface ReplaceSelectionAcceptMethod {
|
|
441
|
-
method: 'replaceSelection';
|
|
442
|
-
/** 按当前选中还是按触发时选中 */
|
|
443
|
-
cursorMode: 'current' | 'trigger';
|
|
444
|
-
}
|
|
445
|
-
/** 采纳时替换编辑器中的指定代码 */
|
|
446
|
-
interface ReplaceContentAcceptMethod {
|
|
447
|
-
method: 'replaceContent';
|
|
448
|
-
/** 找到替换的代码 */
|
|
449
|
-
from: string;
|
|
450
|
-
/** 替换为该代码 */
|
|
451
|
-
to: string;
|
|
452
|
-
}
|
|
453
|
-
/** 采纳到终端,可选直接执行 */
|
|
454
|
-
interface ToTerminalAcceptMethod {
|
|
455
|
-
method: 'toTerminal';
|
|
456
|
-
/** 是否直接执行 */
|
|
457
|
-
run?: boolean;
|
|
458
|
-
}
|
|
459
|
-
/** 采纳时复制到剪贴板 */
|
|
460
|
-
interface CopyAcceptMethod {
|
|
461
|
-
method: 'copy';
|
|
462
|
-
/** 定制复制的内容,不设置则使用代码块的内容 */
|
|
463
|
-
content?: string;
|
|
464
|
-
}
|
|
465
|
-
type AcceptMethod = ReplaceSelectionAcceptMethod | ReplaceContentAcceptMethod | ToTerminalAcceptMethod | CopyAcceptMethod;
|
|
466
|
-
interface SimpleCodeBlock {
|
|
467
|
-
type: 'code-block';
|
|
468
|
-
language?: string;
|
|
469
|
-
hidden?: boolean;
|
|
470
|
-
acceptMethods?: AcceptMethod[];
|
|
471
|
-
/** 代码块是否已经闭合 */
|
|
472
|
-
closed: boolean;
|
|
473
|
-
/** 默认展示几行,剩下的处于收起状态 */
|
|
474
|
-
visibleLines?: number;
|
|
475
|
-
/** 是否是只读代码块(不包含action但可以进行代码块跳转) */
|
|
476
|
-
readonly?: boolean;
|
|
477
|
-
readonlyFileData?: {
|
|
478
|
-
filePath: string;
|
|
479
|
-
startLine: number;
|
|
480
|
-
endLine: number;
|
|
481
|
-
};
|
|
482
|
-
actions?: CodeBlockActions[];
|
|
483
|
-
replaceToFileData?: {
|
|
484
|
-
filePath: string;
|
|
485
|
-
from: string;
|
|
486
|
-
to: string;
|
|
487
|
-
replaceAll?: boolean;
|
|
488
|
-
acceptCommandData?: any;
|
|
489
|
-
};
|
|
490
|
-
insertToFileData?: {
|
|
491
|
-
filePath: string;
|
|
492
|
-
position: {
|
|
493
|
-
line: number;
|
|
494
|
-
character: number;
|
|
495
|
-
};
|
|
496
|
-
newText: string;
|
|
497
|
-
metadata?: {
|
|
498
|
-
needsConfirmation: boolean;
|
|
499
|
-
};
|
|
500
|
-
};
|
|
501
|
-
smartApplyData?: {
|
|
502
|
-
filePath: string;
|
|
503
|
-
};
|
|
504
|
-
children: PrimitiveChildren;
|
|
505
|
-
}
|
|
506
|
-
interface Suggestion {
|
|
507
|
-
type: 'suggestion';
|
|
508
|
-
acceptMethods: AcceptMethod[];
|
|
509
|
-
title?: string;
|
|
510
|
-
content: string;
|
|
511
|
-
children: ElementChildren;
|
|
512
|
-
}
|
|
513
|
-
interface CopyFile {
|
|
514
|
-
/** 文件或目录的绝对路径 */
|
|
515
|
-
fromPath: string;
|
|
516
|
-
/** 目标位置 */
|
|
517
|
-
toPath: string;
|
|
518
|
-
}
|
|
519
|
-
interface AcceptWithDependentFiles {
|
|
520
|
-
method: 'acceptWithDependentFiles';
|
|
521
|
-
/** 主文件的内容以及路径 */
|
|
522
|
-
entry: {
|
|
523
|
-
filePath: string;
|
|
524
|
-
content: string;
|
|
525
|
-
};
|
|
526
|
-
/** 被引用的文件会以 cp 的方式复制到目标目录,如果目标位置已存在时不会覆盖 */
|
|
527
|
-
dependencies: CopyFile[];
|
|
528
|
-
}
|
|
529
|
-
type Action = 'copy' | 'insertIntoTerminal' | 'detail' | 'execute' | 'acceptDir' | 'acceptDependentFiles' | 'acceptWithDependentFiles' | 'insertToFile' | 'openZulu' | 'viewHtml' | 'batchAccept' | 'replaceToFile' | 'showFileReplaceDiff' | 'newFile';
|
|
530
|
-
interface CommandButton {
|
|
531
|
-
type: 'command-button';
|
|
532
|
-
variant?: 'primary' | 'default' | 'text';
|
|
533
|
-
commandName: string;
|
|
534
|
-
data: any;
|
|
535
|
-
replyText?: string;
|
|
536
|
-
action?: Action;
|
|
537
|
-
propagation?: boolean;
|
|
538
|
-
tooltipText?: string;
|
|
539
|
-
actionData?: any;
|
|
540
|
-
children: string;
|
|
541
|
-
}
|
|
542
|
-
interface ButtonGroup {
|
|
543
|
-
type: 'button-group';
|
|
544
|
-
children: CommandButton | CommandButton[];
|
|
545
|
-
}
|
|
546
|
-
interface AlertTag {
|
|
547
|
-
type: 'alert-tag';
|
|
548
|
-
level: 'normal' | 'low' | 'medium' | 'high' | 'critical';
|
|
549
|
-
children: PrimitiveChildren;
|
|
550
|
-
}
|
|
551
|
-
interface Loading {
|
|
552
|
-
type: 'loading';
|
|
553
|
-
children: string;
|
|
554
|
-
}
|
|
555
|
-
interface Flex {
|
|
556
|
-
type: 'flex';
|
|
557
|
-
children: ElementChildren;
|
|
558
|
-
/** 是否居中,为true时,默认带上align-items: center */
|
|
559
|
-
centered?: boolean;
|
|
560
|
-
/** 是否修改 flex-direction 为 column */
|
|
561
|
-
vertical?: boolean;
|
|
562
|
-
/** 是否垂直布局并且居中, 如果 true,默认开启 justify-content: center */
|
|
563
|
-
verticalCentered?: boolean;
|
|
564
|
-
/** 是否设置为 inline-flex */
|
|
565
|
-
inline?: boolean;
|
|
566
|
-
/** 是否要保留换行 */
|
|
567
|
-
keepWrap?: boolean;
|
|
568
|
-
/** 是否水平居中,如果 true,默认开启 justify-content: center */
|
|
569
|
-
horizontalCentered?: boolean;
|
|
570
|
-
/** 是否垂直方向左边对齐,如果 true,默认开启 align-items: flex-start */
|
|
571
|
-
verticalStartAlign?: boolean;
|
|
572
|
-
/** 是否两端对齐,如果 true,默认开启 justify-content: space-between */
|
|
573
|
-
betweenCentered?: boolean;
|
|
574
|
-
/** 是否尾端对齐,如果 true,默认开启 justify-content: flex-end */
|
|
575
|
-
flexEndCentered?: boolean;
|
|
576
|
-
/** 是否均摊分布对齐,如果 true,默认开启 justify-content: space-around */
|
|
577
|
-
aroundCentered?: boolean;
|
|
578
|
-
/** 尺寸参考 renderJsx */
|
|
579
|
-
gap?: 'sm' | 's' | 'm' | 'l' | 'xl';
|
|
580
|
-
}
|
|
581
|
-
interface Card {
|
|
582
|
-
type: 'card';
|
|
583
|
-
color: 'blue' | 'red' | 'yellow' | 'orange' | 'gray' | 'green';
|
|
584
|
-
children: ElementChildren;
|
|
585
|
-
}
|
|
586
|
-
interface CollapsePanel {
|
|
587
|
-
type: 'collapse-panel';
|
|
588
|
-
collapsible: boolean;
|
|
589
|
-
title: string;
|
|
590
|
-
loading?: boolean;
|
|
591
|
-
loadingText?: string;
|
|
592
|
-
extra?: ElementChildren;
|
|
593
|
-
onChange?: (collapsible: boolean) => void;
|
|
594
|
-
children: ElementChildren;
|
|
595
|
-
}
|
|
596
|
-
type NativeElementType = 'p' | 'span' | 'ul' | 'ol' | 'em' | 'strong' | 'code' | 'blockquote' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'li' | 'br' | 'hr' | 'img' | 'a' | 'table' | 'thead' | 'tbody' | 'tr' | 'th' | 'td' | 'div';
|
|
597
|
-
interface NativeElement {
|
|
598
|
-
[key: string]: any;
|
|
599
|
-
type: NativeElementType;
|
|
600
|
-
}
|
|
601
|
-
type DrawElement = NativeElement | SimpleCodeBlock | FileLink | Markdown | Suggestion | CommandButton | ButtonGroup | AlertTag | Loading | Flex | Card | CollapsePanel;
|
|
602
|
-
declare const allowedNativeElement: Record<string, string[]>;
|
|
603
|
-
declare function isNativeElement(element: DrawElement): element is NativeElement;
|
|
604
|
-
declare function isInteractiveContent(content: ChunkContent | null | undefined): boolean;
|
|
605
|
-
declare function isWrappedChunk(chunk: TaskProgressChunk): chunk is DrawChunk | FailChunk;
|
|
606
|
-
declare function isSectionChunk(chunk: TaskProgressChunk): chunk is SectionChunk;
|
|
607
|
-
declare function extractChunkContent(chunk: TaskProgressChunk): ChunkContent | null;
|
|
608
|
-
|
|
609
|
-
declare const ACTION_SESSION_START = "SESSION_START";
|
|
610
|
-
declare const ACTION_SESSION_FINISH = "SESSION_FINISH";
|
|
611
|
-
interface ChannelImplement {
|
|
612
|
-
on(type: 'message', listener: NodeJS.MessageListener): void;
|
|
613
|
-
send(message: any, callback?: (error: Error | null) => void): void;
|
|
614
|
-
}
|
|
615
|
-
interface Execution {
|
|
616
|
-
executionId: number;
|
|
617
|
-
segmentOrder: number;
|
|
618
|
-
done: boolean;
|
|
619
|
-
}
|
|
620
|
-
type Listener<P> = (payload: P, execution?: Execution) => Promise<void>;
|
|
621
|
-
type SessionAssociation = Session | string;
|
|
622
|
-
interface SessionOptions {
|
|
623
|
-
/** 是否将生命周期与父`Session`对象链接,默认为`true`,关闭时关闭当前`Session`对象不会同步给父对象关闭 */
|
|
624
|
-
lifeCycleConnected?: boolean;
|
|
625
|
-
}
|
|
626
|
-
interface SessionInit {
|
|
627
|
-
association: SessionAssociation;
|
|
628
|
-
options?: SessionOptions | undefined;
|
|
629
|
-
}
|
|
630
|
-
declare class Session<M extends Record<string, any> = Record<string, any>> {
|
|
631
|
-
readonly sessionId: string;
|
|
632
|
-
protected readonly parent: Session | null;
|
|
633
|
-
private readonly lifeCycleConnected;
|
|
634
|
-
private readonly listeners;
|
|
635
|
-
private readonly channel;
|
|
636
|
-
private readonly timeoutTimer;
|
|
637
|
-
private readonly executions;
|
|
638
|
-
private readonly streams;
|
|
639
|
-
private readonly incrementer;
|
|
640
|
-
constructor(init: SessionInit, channel: ChannelImplement);
|
|
641
|
-
handleMessage<A extends keyof M>(action: A, payload: M[A], execution?: Execution): Promise<void>;
|
|
642
|
-
start(data: any): void;
|
|
643
|
-
finish(): void;
|
|
644
|
-
log(level: LogLevel, source: string, action: string, detail?: Record<string, any>): void;
|
|
645
|
-
send(data: any, execution?: Execution): Promise<any>;
|
|
646
|
-
sendStreaming<T>(data: any, execution?: Execution): AsyncIterable<T>;
|
|
647
|
-
protected setListener<A extends keyof M>(action: A, listener: Listener<M[A]>): void;
|
|
648
|
-
protected forwardMessageToParent<A extends keyof M>(action: A): void;
|
|
649
|
-
protected initializeListeners(): void;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
interface ChannelImplementMaybe {
|
|
653
|
-
on: ChannelImplement['on'];
|
|
654
|
-
send?: ChannelImplement['send'];
|
|
655
|
-
}
|
|
656
|
-
declare abstract class Channel<S extends Session> {
|
|
657
|
-
protected readonly implement: ChannelImplement;
|
|
658
|
-
protected readonly sessions: Map<string, S>;
|
|
659
|
-
private readonly tasks;
|
|
660
|
-
constructor(implement: ChannelImplementMaybe);
|
|
661
|
-
start(): void;
|
|
662
|
-
startSession(association: Session | string, data: any, options?: SessionOptions): Promise<void>;
|
|
663
|
-
send(sessionId: string, message: any, execution?: Execution): Promise<any> | undefined;
|
|
664
|
-
log(source: string, action: string, detail?: Record<string, any>): void;
|
|
665
|
-
protected abstract createSession(init: SessionInit): S;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
declare const ACTION_REQUEST_PERMISSION = "REQUEST_PERMISSION";
|
|
669
|
-
declare enum PermissionType {
|
|
670
|
-
WorkspaceFileSystem = "WorkspaceFileSystem",
|
|
671
|
-
FullDiskFileSystem = "FullDiskFileSystem",
|
|
672
|
-
CodeSecurity = "CodeSecurity",
|
|
673
|
-
UserDetail = "UserDetail"
|
|
674
|
-
}
|
|
675
|
-
interface RequestPermissionPayload {
|
|
676
|
-
pluginName: string;
|
|
677
|
-
type: PermissionType;
|
|
678
|
-
}
|
|
679
|
-
interface IdeSidePermissionPayload {
|
|
680
|
-
pluginName: string;
|
|
681
|
-
type: PermissionType;
|
|
682
|
-
granted: boolean;
|
|
683
|
-
}
|
|
684
|
-
interface IdeSidePermissionResponse {
|
|
685
|
-
action: typeof ACTION_REQUEST_PERMISSION;
|
|
686
|
-
payload: IdeSidePermissionPayload;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
declare const ACTION_ASK_LLM = "ASK_LLM";
|
|
690
|
-
declare const ACTION_ASK_LLM_STREAMING = "ASK_LLM_STREAMING";
|
|
691
|
-
declare enum LlmType {
|
|
692
|
-
Text = 0,
|
|
693
|
-
Code = 1,
|
|
694
|
-
Function = 2,
|
|
695
|
-
ExplainCode = 3,
|
|
696
|
-
DocCommentForCode = 4,
|
|
697
|
-
CommentForCode = 5
|
|
698
|
-
}
|
|
699
|
-
interface FunctionCall {
|
|
700
|
-
name: string;
|
|
701
|
-
arguments: string;
|
|
702
|
-
thoughts?: string;
|
|
703
|
-
}
|
|
704
|
-
interface LlmResponseTypes {
|
|
705
|
-
[LlmType.Text]: string;
|
|
706
|
-
[LlmType.Code]: string;
|
|
707
|
-
[LlmType.Function]: FunctionCall | null;
|
|
708
|
-
[LlmType.ExplainCode]: string;
|
|
709
|
-
[LlmType.DocCommentForCode]: string;
|
|
710
|
-
[LlmType.CommentForCode]: string;
|
|
711
|
-
}
|
|
712
|
-
interface PayloadBase {
|
|
713
|
-
promptTemplate: string;
|
|
714
|
-
args?: Record<string, unknown>;
|
|
715
|
-
pluginName: string;
|
|
716
|
-
}
|
|
717
|
-
interface CodePayload {
|
|
718
|
-
code: string;
|
|
719
|
-
filePath: string;
|
|
720
|
-
pluginName: string;
|
|
721
|
-
}
|
|
722
|
-
declare enum TextModel {
|
|
723
|
-
Default = "default-model",
|
|
724
|
-
ErnieBot = "ernie-bot",
|
|
725
|
-
ErnieBot128 = "ernie-bot-3-128",
|
|
726
|
-
ErnieBot4 = "ernie-bot-4",
|
|
727
|
-
ErnieBot4Turbo = "ernie-bot-4-turbo",
|
|
728
|
-
ErnieBot4Turbo128 = "ernie-bot-4-turbo-128"
|
|
729
|
-
}
|
|
730
|
-
interface ModelOptions {
|
|
731
|
-
openMaxOutput?: boolean;
|
|
732
|
-
temperature?: number;
|
|
733
|
-
topP?: number;
|
|
734
|
-
penaltyScore?: number;
|
|
735
|
-
/**
|
|
736
|
-
* 是否通过插件启用
|
|
737
|
-
* @example byPlugin true // 表示以插件维度缓存多轮对话,false 表示以skill维度,默认skill维度
|
|
738
|
-
* @example onlyQuery // 传一个字符串,例如直接把query传进来,防止query合并knownledge后太长
|
|
739
|
-
*/
|
|
740
|
-
enableMultiturnDialogue?: boolean | {
|
|
741
|
-
byPlugin?: boolean;
|
|
742
|
-
onlyQuery?: string;
|
|
743
|
-
};
|
|
744
|
-
}
|
|
745
|
-
declare enum FunctionModel {
|
|
746
|
-
Default = "default-model",
|
|
747
|
-
ErnieBot = "ernie-bot",
|
|
748
|
-
ErnieBot4 = "ernie-bot-4"
|
|
749
|
-
}
|
|
750
|
-
interface LlmPayloadTypes {
|
|
751
|
-
[LlmType.Text]: PayloadBase & {
|
|
752
|
-
model?: TextModel;
|
|
753
|
-
modelOptions?: ModelOptions;
|
|
754
|
-
};
|
|
755
|
-
[LlmType.Code]: PayloadBase & {
|
|
756
|
-
model?: TextModel;
|
|
757
|
-
modelOptions?: ModelOptions;
|
|
758
|
-
};
|
|
759
|
-
[LlmType.Function]: PayloadBase & {
|
|
760
|
-
functions: FunctionDefinition[];
|
|
761
|
-
model?: FunctionModel;
|
|
762
|
-
};
|
|
763
|
-
[LlmType.ExplainCode]: CodePayload;
|
|
764
|
-
[LlmType.DocCommentForCode]: CodePayload;
|
|
765
|
-
[LlmType.CommentForCode]: CodePayload;
|
|
766
|
-
}
|
|
767
|
-
interface IdeSideLlmPayload {
|
|
768
|
-
pluginName: string;
|
|
769
|
-
type: LlmType;
|
|
770
|
-
result: LlmResponseTypes[LlmType];
|
|
771
|
-
}
|
|
772
|
-
interface IdeSideLlmResponse {
|
|
773
|
-
action: typeof ACTION_ASK_LLM;
|
|
774
|
-
payload: IdeSideLlmPayload;
|
|
775
|
-
}
|
|
776
|
-
interface IdeSideLlmStreamingResponse {
|
|
777
|
-
action: typeof ACTION_ASK_LLM_STREAMING;
|
|
778
|
-
payload: IdeSideLlmPayload;
|
|
779
|
-
}
|
|
780
|
-
type GenerateLlmPayload<T extends LlmType> = T extends LlmType ? {
|
|
781
|
-
type: T;
|
|
782
|
-
} & LlmPayloadTypes[T] : never;
|
|
783
|
-
type LlmPayload = GenerateLlmPayload<LlmType>;
|
|
784
|
-
|
|
785
|
-
declare const ACTION_GET_PLUGIN_CONFIG = "GET_PLUGIN_CONFIG";
|
|
786
|
-
declare const ACTION_UPDATE_ENGINE_CONFIG = "UPDATE_ENGINE_CONFIG";
|
|
787
|
-
declare const ACTION_PLUS_MODULE_LIST_FETCH = "PLUS_MODULE_LIST_FETCH";
|
|
788
|
-
interface GetPluginConfigPayload {
|
|
789
|
-
pluginName: string;
|
|
790
|
-
key: string;
|
|
791
|
-
}
|
|
792
|
-
interface IdeSideConfigPayload {
|
|
793
|
-
pluginName: string;
|
|
794
|
-
key: string;
|
|
795
|
-
value: any;
|
|
796
|
-
}
|
|
797
|
-
interface IdeSideConfigResponse {
|
|
798
|
-
action: typeof ACTION_GET_PLUGIN_CONFIG;
|
|
799
|
-
payload: IdeSideConfigPayload;
|
|
800
|
-
}
|
|
801
|
-
interface PlusConfigPayload {
|
|
802
|
-
pluginName: string;
|
|
803
|
-
systemInfo: SystemInfoParsed;
|
|
804
|
-
type: 'modelList';
|
|
805
|
-
}
|
|
806
|
-
interface Model {
|
|
807
|
-
modelId: string;
|
|
808
|
-
modelName: string;
|
|
809
|
-
displayName: string;
|
|
810
|
-
isDefault: boolean;
|
|
811
|
-
}
|
|
812
|
-
declare const ACTION_PLUS_MODULE_LIST_RESULT = "PLUS_MODULE_LIST_RESULT";
|
|
813
|
-
interface PlusModuleListResultPayload {
|
|
814
|
-
chunk: Model[];
|
|
815
|
-
capabilityName?: string;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
/** IDE 发起的获取 DIAGNOSTIC */
|
|
819
|
-
declare const ACTION_COMATE_PLUS_DIAGNOSTIC_SCAN = "COMATE_PLUS_DIAGNOSTIC_SCAN";
|
|
820
|
-
/** 诊断扫描任务进展上报 */
|
|
821
|
-
declare const ACTION_DIAGNOSTIC_SCAN_TASK_PROGRESS = "DIAGNOSTIC_SCAN_TASK_PROGRESS";
|
|
822
|
-
/** 向plugin发起诊断扫描 */
|
|
823
|
-
declare const ACTION_DIAGNOSTIC_SCAN = "DIAGNOSTIC_SCAN";
|
|
824
|
-
/** 获取诊断扫描问题数量 */
|
|
825
|
-
declare const ACTION_DIAGNOSTIC_SCAN_TASK_COUNT = "DIAGNOSTIC_SCAN_TASK_COUNT";
|
|
826
|
-
interface DiagnosticScanPayload {
|
|
827
|
-
pluginName: string;
|
|
828
|
-
capabilityName: string;
|
|
829
|
-
systemInfo: SystemInfoParsed;
|
|
830
|
-
}
|
|
831
|
-
interface DiagnosticScanInvokePayload {
|
|
832
|
-
pluginName: string;
|
|
833
|
-
capabilityName: string;
|
|
834
|
-
diagnosticScanId: string;
|
|
835
|
-
scanType: DiagnosticScanTypes;
|
|
836
|
-
systemInfo: SystemInfoParsed;
|
|
837
|
-
changedFiles?: DiagnosticScanChangedFiles;
|
|
838
|
-
context?: ActivationContext;
|
|
839
|
-
}
|
|
840
|
-
interface DiagnosticScanChangedFiles {
|
|
841
|
-
added: string[];
|
|
842
|
-
deleted: string[];
|
|
843
|
-
modified: string[];
|
|
844
|
-
}
|
|
845
|
-
type DiagnosticScanTypes = 'init' | 'change' | 'open' | 'count';
|
|
846
|
-
/** 诊断信息,触发侧边栏后对话的依据,data针对插件变化 */
|
|
847
|
-
interface RepairData {
|
|
848
|
-
/** 负责处理的插件 */
|
|
849
|
-
pluginName?: string;
|
|
850
|
-
/** 负责处理的能力 */
|
|
851
|
-
capability?: string;
|
|
852
|
-
/** 触发来源 */
|
|
853
|
-
source?: string;
|
|
854
|
-
query: string;
|
|
855
|
-
data: any;
|
|
856
|
-
}
|
|
857
|
-
interface Range {
|
|
858
|
-
startLine: number;
|
|
859
|
-
startCharacter: number;
|
|
860
|
-
endLine: number;
|
|
861
|
-
endCharacter: number;
|
|
862
|
-
}
|
|
863
|
-
interface DiagnosticCacheValue {
|
|
864
|
-
hash?: string;
|
|
865
|
-
diagnostics: DiagnosticInfo[];
|
|
866
|
-
}
|
|
867
|
-
interface DiagnosticInfo {
|
|
868
|
-
/** 错误的位置,Range {startLine: number, startCharacter: number, endLine: number, endCharacter: number} */
|
|
869
|
-
range: Range;
|
|
870
|
-
/** 诊断信息的具体内容,描述,可以写多一点,for vscode */
|
|
871
|
-
textMessage: string;
|
|
872
|
-
/** html版,诊断信息的具体内容,描述,可以写多一点,for jetbrains */
|
|
873
|
-
htmlMessage?: string;
|
|
874
|
-
/** vscode:vscode.DiagnosticSeverity.Error、vscode.DiagnosticSeverity.Warning */
|
|
875
|
-
/** IDEA支持:ERROR、WARNING */
|
|
876
|
-
severity: 'ERROR' | 'WARNING';
|
|
877
|
-
/** 用于触发侧边栏对话 */
|
|
878
|
-
repairData: RepairData;
|
|
879
|
-
/** 错误的源码,必须,否则无法定位错误 */
|
|
880
|
-
sourceCode: string;
|
|
881
|
-
/** 上下文,辅助定位错误位置 */
|
|
882
|
-
contextCode: string[];
|
|
883
|
-
/**
|
|
884
|
-
* A code or identifier for this diagnostic.
|
|
885
|
-
* Should be used for later processing, e.g. when providing {@link CodeActionContext code actions}.
|
|
886
|
-
*/
|
|
887
|
-
/** 可选的诊断代码,包含规则标识符和相关文档链接。for vscode */
|
|
888
|
-
code?: {
|
|
889
|
-
value: string | number;
|
|
890
|
-
target: string;
|
|
891
|
-
};
|
|
892
|
-
/** source: 诊断信息的来源(通常是插件的名称)。for vscode */
|
|
893
|
-
source?: string;
|
|
894
|
-
}
|
|
895
|
-
interface DiagnosticScanTaskProgressChunk {
|
|
896
|
-
filename: string;
|
|
897
|
-
hash?: string;
|
|
898
|
-
diagnostics: DiagnosticInfo[];
|
|
899
|
-
}
|
|
900
|
-
interface DiagnosticScanTaskProgressPayload {
|
|
901
|
-
chunk: DiagnosticScanTaskProgressChunk;
|
|
902
|
-
capabilityName?: string;
|
|
903
|
-
}
|
|
904
|
-
interface DiagnosticScanCountPayload {
|
|
905
|
-
chunk: number;
|
|
906
|
-
capabilityName?: string;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
/** IDE侧发起的完整的扫描任务 */
|
|
910
|
-
declare const ACTION_SCAN_QUERY = "SCAN_QUERY";
|
|
911
|
-
declare const ACTION_WILL_SCAN = "WILL_SCAN";
|
|
912
|
-
declare const ACTION_SCAN_TASK = "SCAN_TASK";
|
|
913
|
-
declare const ACTION_RELEASE_SCAN_TASK = "RELEASE_SCAN_TASK";
|
|
914
|
-
declare const ACTION_SCAN_TASK_PROGRESS = "SCAN_TASK_PROGRESS";
|
|
915
|
-
/** 获取是否存在存量扫描结果 */
|
|
916
|
-
declare const ACTION_SCAN_CACHE_COUNT = "SCAN_CACHE_COUNT";
|
|
917
|
-
/** 初始化拉起SA扫描server */
|
|
918
|
-
declare const ACTION_COMATE_PLUS_SA_SCAN_INIT = "COMATE_PLUS_SA_SCAN_INIT";
|
|
919
|
-
/** IDE发起扫描任务获取SA扫描结果 */
|
|
920
|
-
declare const ACTION_COMATE_PLUS_SA_SCAN_DIAGNOSTIC = "COMATE_PLUS_SA_SCAN_DIAGNOSTIC";
|
|
921
|
-
/** SA扫描结果 */
|
|
922
|
-
declare const ACTION_SA_SCAN_DIAGNOSTIC = "SA_SCAN_DIAGNOSTIC";
|
|
923
|
-
/** 获取三方插件返回的SA扫描结果 */
|
|
924
|
-
declare const ACTION_SA_SCAN_DIAGNOSTIC_RESULT = "SA_SCAN_DIAGNOSTIC_RESULT";
|
|
925
|
-
/** 构建AISA扫描payload */
|
|
926
|
-
declare const ACTION_COMATE_PLUS_AISA_BUILD_PAYLOAD = "COMATE_PLUS_AISA_BUILD_PAYLOAD";
|
|
927
|
-
interface ScanQueryPayload {
|
|
928
|
-
scanId: string;
|
|
929
|
-
context: ActivationContext;
|
|
930
|
-
systemInfo: SystemInfoParsed;
|
|
931
|
-
}
|
|
932
|
-
interface WillScanPayload extends ScanQueryPayload {
|
|
933
|
-
pluginName: string;
|
|
934
|
-
capabilityName: string;
|
|
935
|
-
}
|
|
936
|
-
interface ReleaseScanTaskPayload {
|
|
937
|
-
scanId: string;
|
|
938
|
-
pluginName: string;
|
|
939
|
-
capabilityName: string;
|
|
940
|
-
}
|
|
941
|
-
interface ScanTaskPayload {
|
|
942
|
-
scanId: string;
|
|
943
|
-
pluginName: string;
|
|
944
|
-
capabilityName: string;
|
|
945
|
-
description: string;
|
|
946
|
-
ranges: Range$1[];
|
|
947
|
-
}
|
|
948
|
-
/** 表达参与扫描任务的目标 */
|
|
949
|
-
interface ScanHandleGoal {
|
|
950
|
-
/** 说明本次处理的目标 */
|
|
951
|
-
description: string;
|
|
952
|
-
/** 是否独占处理,如果独占并被选中,则其它插件能力都不会处理本次扫描 */
|
|
953
|
-
exclusive?: boolean;
|
|
954
|
-
/** 计划处理和修改的代码块 */
|
|
955
|
-
ranges: Range$1[];
|
|
956
|
-
}
|
|
957
|
-
/** 扫描意愿结果 */
|
|
958
|
-
interface ReportWillScanPayload {
|
|
959
|
-
scanId: string;
|
|
960
|
-
pluginName: string;
|
|
961
|
-
capabilityName: string;
|
|
962
|
-
goal: ScanHandleGoal | false;
|
|
963
|
-
}
|
|
964
|
-
interface SAScanDiagnosticResult {
|
|
965
|
-
absolutePath: string;
|
|
966
|
-
diagnostics: DiagnosticInfo[];
|
|
967
|
-
}
|
|
968
|
-
interface SAScanDiagnosticConfig {
|
|
969
|
-
scanEnabled: boolean;
|
|
970
|
-
intervalMinute: number;
|
|
971
|
-
}
|
|
972
|
-
/** SA扫描初始化数据 */
|
|
973
|
-
interface SAScanInitData {
|
|
974
|
-
/** 扫描类型: AISR 表示 AI 安全审查 */
|
|
975
|
-
type?: 'AISR' | string;
|
|
976
|
-
}
|
|
977
|
-
type SADiagnosticScanResultChunk = SAScanDiagnosticResult | boolean | SAScanDiagnosticConfig;
|
|
978
|
-
interface SADiagnosticScanResultPayload {
|
|
979
|
-
chunk: SADiagnosticScanResultChunk;
|
|
980
|
-
capabilityName?: string;
|
|
981
|
-
}
|
|
982
|
-
type ScanTypes = 'init' | 'getResult' | 'destroy' | 'config';
|
|
983
|
-
interface SADiagnosticScanInvokePayload {
|
|
984
|
-
pluginName: string;
|
|
985
|
-
capabilityName: string;
|
|
986
|
-
systemInfo: SystemInfoParsed;
|
|
987
|
-
scanType: ScanTypes;
|
|
988
|
-
absolutePath?: string;
|
|
989
|
-
context?: ActivationContext;
|
|
990
|
-
data?: SAScanInitData;
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
declare const ACTION_START_BACKGROUND_SERVICE = "ACTION_START_BACKGROUND_SERVICE";
|
|
994
|
-
interface StartBackgroundServicePayload {
|
|
995
|
-
pluginName: string;
|
|
996
|
-
systemInfo: SystemInfoParsed;
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
declare const ACTION_QUERY_SELECTOR = "QUERY_SELECTOR";
|
|
1000
|
-
interface QuerySelectorPayload {
|
|
1001
|
-
context: ActivationContext;
|
|
1002
|
-
systemInfo: SystemInfoParsed;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
declare const ACTION_CUSTOM_COMMAND = "ACTION_CUSTOM_COMMAND";
|
|
1006
|
-
interface CustomCommandPayload {
|
|
1007
|
-
pluginName: string;
|
|
1008
|
-
taskId: string;
|
|
1009
|
-
commandName: string;
|
|
1010
|
-
data: any;
|
|
1011
|
-
replyText: string;
|
|
1012
|
-
}
|
|
1013
|
-
type CustomCommandInvokePayload = CustomCommandPayload & {
|
|
1014
|
-
messageId: number;
|
|
1015
|
-
commandContext: ActivationContext;
|
|
1016
|
-
};
|
|
1017
|
-
interface UserDefinedCommandConfig {
|
|
1018
|
-
commandId: number;
|
|
1019
|
-
commandName: string;
|
|
1020
|
-
displayName: string;
|
|
1021
|
-
description: string;
|
|
1022
|
-
prompt: string;
|
|
1023
|
-
visibility: 'SELF' | 'WORKSPACE';
|
|
1024
|
-
isProjectCommand?: boolean;
|
|
1025
|
-
relativePath?: string;
|
|
1026
|
-
absolutePath?: string;
|
|
1027
|
-
errors?: string[];
|
|
1028
|
-
}
|
|
1029
|
-
interface UserDefinedCommandFormValues {
|
|
1030
|
-
commandName: string;
|
|
1031
|
-
displayName: string;
|
|
1032
|
-
description: string;
|
|
1033
|
-
prompt: string;
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
interface UserMessage {
|
|
1037
|
-
id: string;
|
|
1038
|
-
role: 'user';
|
|
1039
|
-
content: string;
|
|
1040
|
-
/** 消息的总结摘要 */
|
|
1041
|
-
summary?: string;
|
|
1042
|
-
code?: string;
|
|
1043
|
-
payload: Record<string, any>;
|
|
1044
|
-
/** 是否被回滚了 */
|
|
1045
|
-
discard?: boolean;
|
|
1046
|
-
/** 是否禁用回滚 */
|
|
1047
|
-
disabledRollback?: boolean;
|
|
1048
|
-
}
|
|
1049
|
-
declare enum AgentMessageStatus {
|
|
1050
|
-
Failed = "failed",
|
|
1051
|
-
Success = "success",
|
|
1052
|
-
InProgress = "inProgress",
|
|
1053
|
-
Cancelled = "cancelled",
|
|
1054
|
-
Compressing = "compressing"
|
|
1055
|
-
}
|
|
1056
|
-
declare enum WorkflowStatus {
|
|
1057
|
-
UNREADY = "unready",
|
|
1058
|
-
READY = "ready",
|
|
1059
|
-
RUNNING = "running",
|
|
1060
|
-
SUCCESS = "success",
|
|
1061
|
-
FAILED = "failed",
|
|
1062
|
-
CANCELLED = "cancelled"
|
|
1063
|
-
}
|
|
1064
|
-
interface AgentTextElement {
|
|
1065
|
-
id: string;
|
|
1066
|
-
discard?: boolean;
|
|
1067
|
-
type: 'TEXT';
|
|
1068
|
-
status: AgentMessageStatus;
|
|
1069
|
-
content: string;
|
|
1070
|
-
composer: {
|
|
1071
|
-
markdown: string;
|
|
1072
|
-
tasks: AgentComposerTask[];
|
|
1073
|
-
};
|
|
1074
|
-
isErrorMessage?: boolean;
|
|
1075
|
-
parentMessageId: string;
|
|
1076
|
-
retryMessageId: string;
|
|
1077
|
-
}
|
|
1078
|
-
interface AgentComposerTask {
|
|
1079
|
-
filePath: string;
|
|
1080
|
-
absolutePath: string;
|
|
1081
|
-
status: string;
|
|
1082
|
-
accepted: 0 | 1 | 2;
|
|
1083
|
-
action: string;
|
|
1084
|
-
basename: string;
|
|
1085
|
-
addLineCount: number;
|
|
1086
|
-
removeLineCount: number;
|
|
1087
|
-
}
|
|
1088
|
-
declare enum CommandExecutionStatus {
|
|
1089
|
-
UNREADY = "unready",
|
|
1090
|
-
READY = "ready",
|
|
1091
|
-
RUNNING = "running",
|
|
1092
|
-
SUCCESS = "success",
|
|
1093
|
-
FAILED = "failed",
|
|
1094
|
-
/** 执行前点击跳过 */
|
|
1095
|
-
SKIPPED = "skipped",
|
|
1096
|
-
/** 命令执行后点击取消 */
|
|
1097
|
-
CANCELLED = "cancelled"
|
|
1098
|
-
}
|
|
1099
|
-
interface CommandExecutionResult {
|
|
1100
|
-
status: CommandExecutionStatus;
|
|
1101
|
-
output: string;
|
|
1102
|
-
exitCode?: number;
|
|
1103
|
-
}
|
|
1104
|
-
type AgentToolCallType = 'search_files' | 'read_image' | 'list_files' | 'keyword_search' | 'codebase_search' | 'web_search' | 'knowledge_search' | 'preview_page' | 'ask_followup_question' | 'attempt_completion' | 'run_command' | 'read_file' | 'list_code_definition_names' | 'write_file' | 'delete_file' | 'patch_file' | 'run_debug_command' | 'mcp_tool' | 'f2c_tool' | 'extract_content_blocks' | 'subtask' | 'compress_message' | 'update_memory' | 'unknown';
|
|
1105
|
-
type EmptyObject = Record<string, never>;
|
|
1106
|
-
interface ToolCallMessageSpec {
|
|
1107
|
-
search_files: {
|
|
1108
|
-
displayParams: {
|
|
1109
|
-
path: string;
|
|
1110
|
-
regex?: string;
|
|
1111
|
-
};
|
|
1112
|
-
displayResult: {
|
|
1113
|
-
searchFiles: DisplayFileInfo[];
|
|
1114
|
-
};
|
|
1115
|
-
};
|
|
1116
|
-
read_image: {
|
|
1117
|
-
displayParams: {
|
|
1118
|
-
path: string;
|
|
1119
|
-
id: string;
|
|
1120
|
-
};
|
|
1121
|
-
displayResult: {
|
|
1122
|
-
lineCount?: number;
|
|
1123
|
-
readFile?: DisplayFileInfo;
|
|
1124
|
-
};
|
|
1125
|
-
};
|
|
1126
|
-
list_files: {
|
|
1127
|
-
displayParams: {
|
|
1128
|
-
path: string;
|
|
1129
|
-
};
|
|
1130
|
-
displayResult: {
|
|
1131
|
-
fileCount: number;
|
|
1132
|
-
};
|
|
1133
|
-
};
|
|
1134
|
-
keyword_search: {
|
|
1135
|
-
displayParams: {
|
|
1136
|
-
path: string;
|
|
1137
|
-
regex?: string;
|
|
1138
|
-
};
|
|
1139
|
-
displayResult: {
|
|
1140
|
-
searchFiles: DisplayFileInfo[];
|
|
1141
|
-
};
|
|
1142
|
-
};
|
|
1143
|
-
codebase_search: {
|
|
1144
|
-
displayParams: {
|
|
1145
|
-
query: string;
|
|
1146
|
-
};
|
|
1147
|
-
displayResult: {
|
|
1148
|
-
searchFiles: DisplayFileInfo[];
|
|
1149
|
-
};
|
|
1150
|
-
};
|
|
1151
|
-
knowledge_search: {
|
|
1152
|
-
displayParams: {
|
|
1153
|
-
query: string;
|
|
1154
|
-
};
|
|
1155
|
-
displayResult: {
|
|
1156
|
-
uris: Array<{
|
|
1157
|
-
path: string;
|
|
1158
|
-
url: string;
|
|
1159
|
-
retrievalType: 'LOCAL_CODE' | 'TEXT' | 'CODE';
|
|
1160
|
-
startLine?: number;
|
|
1161
|
-
endLine?: number;
|
|
1162
|
-
}>;
|
|
1163
|
-
};
|
|
1164
|
-
};
|
|
1165
|
-
preview_page: {
|
|
1166
|
-
displayParams: {
|
|
1167
|
-
url?: string;
|
|
1168
|
-
previewLoading?: boolean;
|
|
1169
|
-
};
|
|
1170
|
-
displayResult: EmptyObject;
|
|
1171
|
-
};
|
|
1172
|
-
ask_followup_question: {
|
|
1173
|
-
displayParams: {
|
|
1174
|
-
followupQuestion?: string;
|
|
1175
|
-
};
|
|
1176
|
-
displayResult: EmptyObject;
|
|
1177
|
-
};
|
|
1178
|
-
attempt_completion: {
|
|
1179
|
-
displayParams: {
|
|
1180
|
-
path: string;
|
|
1181
|
-
command?: string;
|
|
1182
|
-
summary?: string;
|
|
1183
|
-
displaySkipButton?: boolean;
|
|
1184
|
-
autoRun?: boolean;
|
|
1185
|
-
};
|
|
1186
|
-
displayResult: {
|
|
1187
|
-
commandResult: CommandExecutionResult;
|
|
1188
|
-
};
|
|
1189
|
-
};
|
|
1190
|
-
run_command: {
|
|
1191
|
-
displayParams: {
|
|
1192
|
-
path: string;
|
|
1193
|
-
command?: string;
|
|
1194
|
-
displaySkipButton: boolean;
|
|
1195
|
-
autoRun?: boolean;
|
|
1196
|
-
};
|
|
1197
|
-
displayResult: {
|
|
1198
|
-
commandResult: CommandExecutionResult;
|
|
1199
|
-
};
|
|
1200
|
-
};
|
|
1201
|
-
read_file: {
|
|
1202
|
-
displayParams: {
|
|
1203
|
-
path: string;
|
|
1204
|
-
};
|
|
1205
|
-
displayResult: {
|
|
1206
|
-
lineCount: number;
|
|
1207
|
-
readFile?: DisplayFileInfo;
|
|
1208
|
-
};
|
|
1209
|
-
};
|
|
1210
|
-
list_code_definition_names: {
|
|
1211
|
-
displayParams: {
|
|
1212
|
-
path?: string;
|
|
1213
|
-
};
|
|
1214
|
-
displayResult: EmptyObject;
|
|
1215
|
-
};
|
|
1216
|
-
write_file: {
|
|
1217
|
-
displayParams: {
|
|
1218
|
-
path: string;
|
|
1219
|
-
content?: string;
|
|
1220
|
-
askApproval?: boolean;
|
|
1221
|
-
};
|
|
1222
|
-
displayResult: {
|
|
1223
|
-
failureReason?: 'conflict';
|
|
1224
|
-
};
|
|
1225
|
-
};
|
|
1226
|
-
delete_file: {
|
|
1227
|
-
displayParams: {
|
|
1228
|
-
path: string;
|
|
1229
|
-
askApproval?: boolean;
|
|
1230
|
-
};
|
|
1231
|
-
displayResult: EmptyObject;
|
|
1232
|
-
};
|
|
1233
|
-
patch_file: {
|
|
1234
|
-
displayParams: {
|
|
1235
|
-
path: string;
|
|
1236
|
-
askApproval?: boolean;
|
|
1237
|
-
};
|
|
1238
|
-
displayResult: {
|
|
1239
|
-
failureReason?: 'conflict';
|
|
1240
|
-
};
|
|
1241
|
-
};
|
|
1242
|
-
run_debug_command: {
|
|
1243
|
-
displayParams: {
|
|
1244
|
-
path: string;
|
|
1245
|
-
command?: string;
|
|
1246
|
-
displaySkipButton: boolean;
|
|
1247
|
-
autoRun?: boolean;
|
|
1248
|
-
};
|
|
1249
|
-
displayResult: {
|
|
1250
|
-
commandResult: CommandExecutionResult;
|
|
1251
|
-
};
|
|
1252
|
-
};
|
|
1253
|
-
mcp_tool: {
|
|
1254
|
-
displayParams: {
|
|
1255
|
-
serverName?: string;
|
|
1256
|
-
toolName?: string;
|
|
1257
|
-
args?: string;
|
|
1258
|
-
autoRun?: boolean;
|
|
1259
|
-
};
|
|
1260
|
-
displayResult: {
|
|
1261
|
-
mcpResult?: {
|
|
1262
|
-
content?: any;
|
|
1263
|
-
errorMsg?: string;
|
|
1264
|
-
};
|
|
1265
|
-
};
|
|
1266
|
-
};
|
|
1267
|
-
f2c_tool: {
|
|
1268
|
-
displayParams: {
|
|
1269
|
-
content?: string;
|
|
1270
|
-
url?: string;
|
|
1271
|
-
toolName?: string;
|
|
1272
|
-
images?: Array<{
|
|
1273
|
-
path: string;
|
|
1274
|
-
name: string;
|
|
1275
|
-
}>;
|
|
1276
|
-
};
|
|
1277
|
-
displayResult: EmptyObject;
|
|
1278
|
-
};
|
|
1279
|
-
extract_content_blocks: {
|
|
1280
|
-
displayParams: {
|
|
1281
|
-
firstFilePath: string;
|
|
1282
|
-
};
|
|
1283
|
-
displayResult: {
|
|
1284
|
-
fileBlocks: DisplayFileInfo[];
|
|
1285
|
-
};
|
|
1286
|
-
};
|
|
1287
|
-
web_search: {
|
|
1288
|
-
displayParams: {
|
|
1289
|
-
query: string;
|
|
1290
|
-
};
|
|
1291
|
-
displayResult: {
|
|
1292
|
-
uris: AgentWebSearchSite[];
|
|
1293
|
-
};
|
|
1294
|
-
};
|
|
1295
|
-
subtask: {
|
|
1296
|
-
displayParams: {
|
|
1297
|
-
title: string;
|
|
1298
|
-
subTaskId: string;
|
|
1299
|
-
query: string;
|
|
1300
|
-
subagent: string;
|
|
1301
|
-
};
|
|
1302
|
-
displayResult: EmptyObject;
|
|
1303
|
-
};
|
|
1304
|
-
compress_message: {
|
|
1305
|
-
displayParams: EmptyObject;
|
|
1306
|
-
displayResult: {
|
|
1307
|
-
status: string;
|
|
1308
|
-
};
|
|
1309
|
-
};
|
|
1310
|
-
update_memory: {
|
|
1311
|
-
displayParams: {
|
|
1312
|
-
action?: string;
|
|
1313
|
-
memory_id?: string;
|
|
1314
|
-
topic?: string;
|
|
1315
|
-
memory_to_store?: string;
|
|
1316
|
-
};
|
|
1317
|
-
displayResult: {
|
|
1318
|
-
memory_to_store?: string;
|
|
1319
|
-
};
|
|
1320
|
-
};
|
|
1321
|
-
unknown: {
|
|
1322
|
-
displayParams: EmptyObject;
|
|
1323
|
-
displayResult: EmptyObject;
|
|
1324
|
-
};
|
|
1325
|
-
}
|
|
1326
|
-
interface DisplayFileInfo {
|
|
1327
|
-
path: string;
|
|
1328
|
-
startLine?: number;
|
|
1329
|
-
/** 如果是知识集的文件,需要增加外链跳转 */
|
|
1330
|
-
url?: string;
|
|
1331
|
-
endLine?: number;
|
|
1332
|
-
}
|
|
1333
|
-
type ToolCallMessageDisplayResult<T extends AgentToolCallType = AgentToolCallType> = ToolCallMessageSpec[T]['displayResult'];
|
|
1334
|
-
type ToolCallMessageDisplayParams<T extends AgentToolCallType = AgentToolCallType> = ToolCallMessageSpec[T]['displayParams'];
|
|
1335
|
-
interface AgentToolCallElement<T extends AgentToolCallType = AgentToolCallType> {
|
|
1336
|
-
id: string;
|
|
1337
|
-
type: 'TOOL_CALL';
|
|
1338
|
-
discard?: boolean;
|
|
1339
|
-
status: AgentMessageStatus;
|
|
1340
|
-
composer: {
|
|
1341
|
-
markdown: string;
|
|
1342
|
-
tasks: AgentComposerTask[];
|
|
1343
|
-
};
|
|
1344
|
-
toolName: T;
|
|
1345
|
-
workflowStatus: WorkflowStatus;
|
|
1346
|
-
displayParams?: ToolCallMessageDisplayParams<T>;
|
|
1347
|
-
displayResult?: ToolCallMessageDisplayResult<T>;
|
|
1348
|
-
parentMessageId: string;
|
|
1349
|
-
retryMessageId: string;
|
|
1350
|
-
}
|
|
1351
|
-
interface AgentReasonElement {
|
|
1352
|
-
type: 'REASON';
|
|
1353
|
-
id: number;
|
|
1354
|
-
discard?: boolean;
|
|
1355
|
-
text: string;
|
|
1356
|
-
startTime: number;
|
|
1357
|
-
lastModifiedTime: number;
|
|
1358
|
-
status: AgentMessageStatus;
|
|
1359
|
-
parentMessageId: string;
|
|
1360
|
-
retryMessageId: string;
|
|
1361
|
-
}
|
|
1362
|
-
interface SubAgentConfig {
|
|
1363
|
-
name: string;
|
|
1364
|
-
mcpServers: string[];
|
|
1365
|
-
}
|
|
1366
|
-
interface AgentConfig {
|
|
1367
|
-
name: string;
|
|
1368
|
-
agentId: number;
|
|
1369
|
-
avatar: string;
|
|
1370
|
-
mcpServers: string[];
|
|
1371
|
-
subAgentList: SubAgentConfig[];
|
|
1372
|
-
}
|
|
1373
|
-
interface TodoNode {
|
|
1374
|
-
title: string;
|
|
1375
|
-
completed?: boolean;
|
|
1376
|
-
children: TodoNode[];
|
|
1377
|
-
}
|
|
1378
|
-
interface AgentTodoElement {
|
|
1379
|
-
type: 'TODO';
|
|
1380
|
-
id: number;
|
|
1381
|
-
discard?: boolean;
|
|
1382
|
-
elements: TodoNode[];
|
|
1383
|
-
status: AgentMessageStatus;
|
|
1384
|
-
parentMessageId: string;
|
|
1385
|
-
retryMessageId: string;
|
|
1386
|
-
}
|
|
1387
|
-
interface AgentWebSearchSite {
|
|
1388
|
-
url: string;
|
|
1389
|
-
source: string;
|
|
1390
|
-
content: string;
|
|
1391
|
-
favicon: string;
|
|
1392
|
-
title: string;
|
|
1393
|
-
}
|
|
1394
|
-
type AgentElements = AgentTextElement | AgentToolCallElement | AgentReasonElement | AgentTodoElement;
|
|
1395
|
-
interface AssistantMessage {
|
|
1396
|
-
id: string;
|
|
1397
|
-
v2?: boolean;
|
|
1398
|
-
role: 'assistant';
|
|
1399
|
-
quotaExceedMessage?: string;
|
|
1400
|
-
status: AgentMessageStatus;
|
|
1401
|
-
/** 是否被回滚了 */
|
|
1402
|
-
discard?: boolean;
|
|
1403
|
-
reportedId?: string;
|
|
1404
|
-
userMessageId?: string;
|
|
1405
|
-
agentInfo?: Pick<AgentConfig, 'name' | 'avatar'>;
|
|
1406
|
-
content: any;
|
|
1407
|
-
tokenUsage?: {
|
|
1408
|
-
contextUsed: number;
|
|
1409
|
-
contextLimit: number;
|
|
1410
|
-
usagePercentage: number;
|
|
1411
|
-
/** 压缩后减少的百分比 */
|
|
1412
|
-
savedPercentage: number;
|
|
1413
|
-
needCompression: boolean;
|
|
1414
|
-
/** 失败的原因 */
|
|
1415
|
-
failReason?: string;
|
|
1416
|
-
};
|
|
1417
|
-
elements: AgentElements[];
|
|
1418
|
-
}
|
|
1419
|
-
type Message = UserMessage | AssistantMessage;
|
|
1420
|
-
declare enum AgentConversationType {
|
|
1421
|
-
/** 安全智能体 */
|
|
1422
|
-
SecuBotConversation = "SecuBotConversation",
|
|
1423
|
-
/** Debug智能体 */
|
|
1424
|
-
DebugBotConversation = "DebugBotConversation",
|
|
1425
|
-
/** 端到端智能体 */
|
|
1426
|
-
E2EBotConversation = "E2EBotConversation",
|
|
1427
|
-
/** F2C智能体 */
|
|
1428
|
-
F2cBotConversation = "F2cBotConversation",
|
|
1429
|
-
/** 重构后的新智能体 */
|
|
1430
|
-
AgentConversation = "AgentConversation"
|
|
1431
|
-
}
|
|
1432
|
-
declare enum AgentConversationStatus {
|
|
1433
|
-
/** 创建但未发生内容变化 */
|
|
1434
|
-
Ready = "Ready",
|
|
1435
|
-
/** 进行中 */
|
|
1436
|
-
Running = "Running",
|
|
1437
|
-
/** 失败 */
|
|
1438
|
-
Failed = "Failed",
|
|
1439
|
-
/** 完成 */
|
|
1440
|
-
Completed = "Completed",
|
|
1441
|
-
/** 停止生成 */
|
|
1442
|
-
Cancelled = "Cancelled"
|
|
1443
|
-
}
|
|
1444
|
-
interface AgentConversationInfo {
|
|
1445
|
-
id: string;
|
|
1446
|
-
status: AgentConversationStatus;
|
|
1447
|
-
type: AgentConversationType;
|
|
1448
|
-
lastQuery?: string;
|
|
1449
|
-
}
|
|
1450
|
-
type AgentPayloadMessageType = 'message-operation' | 'stop-generating' | 'add-conversation' | 'rebuild-conversation' | 'add-message' | 'quota-exceed' | 'refresh-messages';
|
|
1451
|
-
interface AgentPayload<T = any> {
|
|
1452
|
-
payload: T;
|
|
1453
|
-
conversationId: string;
|
|
1454
|
-
conversationType?: AgentConversationType;
|
|
1455
|
-
messageType: AgentPayloadMessageType;
|
|
1456
|
-
}
|
|
1457
|
-
declare const ACTION_DEBUG_TASK_PROCESS = "ACTION_DEBUG_TASK_PROCESS";
|
|
1458
|
-
interface DebugAgentPayload {
|
|
1459
|
-
query: string;
|
|
1460
|
-
code?: string;
|
|
1461
|
-
triggerType?: string;
|
|
1462
|
-
platform?: string;
|
|
1463
|
-
ideVersion?: string;
|
|
1464
|
-
command?: {
|
|
1465
|
-
commandLine: string;
|
|
1466
|
-
pwd: string;
|
|
1467
|
-
};
|
|
1468
|
-
customPrompt?: string;
|
|
1469
|
-
cwd?: string;
|
|
1470
|
-
contexts?: Record<string, any>;
|
|
1471
|
-
needsValidation?: boolean;
|
|
1472
|
-
}
|
|
1473
|
-
interface DebugAgentCodeContextItem {
|
|
1474
|
-
type: 'errorCode' | 'relatedCode';
|
|
1475
|
-
filePath: string;
|
|
1476
|
-
startLineNum: number;
|
|
1477
|
-
endLineNum: number;
|
|
1478
|
-
}
|
|
1479
|
-
interface BlockItem {
|
|
1480
|
-
type: 'text' | 'code';
|
|
1481
|
-
content: string;
|
|
1482
|
-
replaceToFileData?: {
|
|
1483
|
-
filePath: string;
|
|
1484
|
-
from: string;
|
|
1485
|
-
to: string;
|
|
1486
|
-
};
|
|
1487
|
-
}
|
|
1488
|
-
interface DebugAgentResponse {
|
|
1489
|
-
errorReason?: string;
|
|
1490
|
-
contexts?: DebugAgentCodeContextItem[];
|
|
1491
|
-
content?: string;
|
|
1492
|
-
blocks?: BlockItem[];
|
|
1493
|
-
}
|
|
1494
|
-
interface DebugAgentPluginPayload {
|
|
1495
|
-
pluginName: string;
|
|
1496
|
-
capabilityName?: string;
|
|
1497
|
-
debugAgentPayload: DebugAgentPayload;
|
|
1498
|
-
}
|
|
1499
|
-
declare const ACTION_ASK_RAG = "ACTION_ASK_RAG";
|
|
1500
|
-
interface RAGPayload {
|
|
1501
|
-
pluginName: string;
|
|
1502
|
-
capabilityName?: string;
|
|
1503
|
-
prompt: string;
|
|
1504
|
-
}
|
|
1505
|
-
interface RollbackMessageFileInfo {
|
|
1506
|
-
relativePath: string;
|
|
1507
|
-
absolutePath: string;
|
|
1508
|
-
action: 'willCreate' | 'willDelete' | 'willChange';
|
|
1509
|
-
selected?: boolean;
|
|
1510
|
-
conflict?: boolean;
|
|
1511
|
-
}
|
|
1512
|
-
/** Agent 上报数据的维度 */
|
|
1513
|
-
interface AgentMetrics {
|
|
1514
|
-
path?: string;
|
|
1515
|
-
model: string;
|
|
1516
|
-
modelKey?: string;
|
|
1517
|
-
function: string;
|
|
1518
|
-
}
|
|
1519
|
-
interface ChatAgentFormValues {
|
|
1520
|
-
agentName: string;
|
|
1521
|
-
enable?: boolean;
|
|
1522
|
-
agentImage: string;
|
|
1523
|
-
description: string;
|
|
1524
|
-
agentPrompt: string;
|
|
1525
|
-
parentAgents?: string[];
|
|
1526
|
-
subAgents: number[];
|
|
1527
|
-
tools: string[];
|
|
1528
|
-
mcpInfos: any;
|
|
1529
|
-
}
|
|
1530
|
-
interface ChatAgentConfig {
|
|
1531
|
-
agentId: number;
|
|
1532
|
-
agentName: string;
|
|
1533
|
-
agentImage: string;
|
|
1534
|
-
/** 项目集Agent配置报错 */
|
|
1535
|
-
errors?: string[];
|
|
1536
|
-
/** 是否在输入框选择时可见 */
|
|
1537
|
-
/** 智能体上报代码采纳率的分类 */
|
|
1538
|
-
reportAgentName: string;
|
|
1539
|
-
description: string;
|
|
1540
|
-
/** agent可见范围,枚举PUBLIC(内置请求agent)、SELF(个人自定义agent)、INVISIBLE(不可见内置智能体) */
|
|
1541
|
-
visibility: 'PUBLIC' | 'SELF' | 'INVISIBLE';
|
|
1542
|
-
/** 是否能被配置为子智能体 */
|
|
1543
|
-
/** 是否能配置子智能体 */
|
|
1544
|
-
subAgents: number[] | undefined;
|
|
1545
|
-
mcpInfos?: string[];
|
|
1546
|
-
/** 问答时是否使用 mcp, 如果是个人自定义智能体还需要和 mcpInfos 取交集 */
|
|
1547
|
-
/** 项目级agent独有的字段,需用通过这个合并为subagent */
|
|
1548
|
-
parentAgents?: string[];
|
|
1549
|
-
/** 项目级agent独有的字段,表示文件路径,编辑agent时的索引key */
|
|
1550
|
-
relativePath?: string;
|
|
1551
|
-
/** 项目级agent独有的字段,表示工具列表 */
|
|
1552
|
-
/** 项目级agent独有的字段,表示自定义指令 */
|
|
1553
|
-
agentPrompt?: string;
|
|
1554
|
-
/** 项目级agent独有的字段,表示策略 */
|
|
1555
|
-
/** 项目级agent独有的字段,表示是否是项目级agent */
|
|
1556
|
-
isProjectAgent?: boolean;
|
|
1557
|
-
/** 必须包含,用户定位agent配置文件的位置 */
|
|
1558
|
-
absolutePath?: string;
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
declare const ACTION_GENERATE_MESSAGE = "ACTION_GENERATE_MESSAGE";
|
|
1562
|
-
declare const ACTION_GENERATE_MESSAGE_REPORT = "ACTION_GENERATE_MESSAGE_REPORT";
|
|
1563
|
-
declare const ACTION_BRANCH_CHANGE = "ACTION_BRANCH_CHANGE";
|
|
1564
|
-
interface GenerateMessageResponse {
|
|
1565
|
-
message: string;
|
|
1566
|
-
status: 'success' | 'error';
|
|
1567
|
-
errorMessage?: string;
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1570
|
-
declare const ACTION_SECUBOT = "ACTION_SECUBOT";
|
|
1571
|
-
declare const ACTION_SECUBOT_TASK_PROGRESS = "ACTION_SECUBOT_TASK_PROGRESS";
|
|
1572
|
-
declare const SECUBOT_DEFAULT_QUERY = "\u4E3A\u6211\u7684\u4EE3\u7801\u5E93\u626B\u63CF\u53EF\u80FD\u7684\u5B89\u5168\u6F0F\u6D1E";
|
|
1573
|
-
interface SecubotQueryPayload {
|
|
1574
|
-
pluginName: string;
|
|
1575
|
-
capabilityName: string;
|
|
1576
|
-
systemInfo: SystemInfoParsed;
|
|
1577
|
-
input?: SecubotAgentParsed;
|
|
1578
|
-
context?: secubotAgentContext;
|
|
1579
|
-
}
|
|
1580
|
-
interface secubotAgentContext {
|
|
1581
|
-
query?: string;
|
|
1582
|
-
selectedCode?: string;
|
|
1583
|
-
activeFileContent?: string;
|
|
1584
|
-
activeFileLineContent?: string;
|
|
1585
|
-
activeFilePath?: string;
|
|
1586
|
-
activeFileName?: string;
|
|
1587
|
-
activeFileLanguage?: string;
|
|
1588
|
-
data?: any;
|
|
1589
|
-
}
|
|
1590
|
-
interface SecubotAgentParsed {
|
|
1591
|
-
messageId: string;
|
|
1592
|
-
pluginName: string;
|
|
1593
|
-
capability?: string | undefined;
|
|
1594
|
-
query: string;
|
|
1595
|
-
data?: any;
|
|
1596
|
-
informationList: Information[];
|
|
1597
|
-
}
|
|
1598
|
-
interface SecubotFileFlaw {
|
|
1599
|
-
description: string;
|
|
1600
|
-
type: string;
|
|
1601
|
-
fixStatus: 'none' | 'repairing' | 'verifying' | 'success' | 'fail';
|
|
1602
|
-
fileName: string;
|
|
1603
|
-
filePath: string;
|
|
1604
|
-
content?: string;
|
|
1605
|
-
children: SecubotFlaw[];
|
|
1606
|
-
action?: string;
|
|
1607
|
-
status?: string;
|
|
1608
|
-
accepted?: number;
|
|
1609
|
-
hasContent?: boolean;
|
|
1610
|
-
cancellationToken?: boolean;
|
|
1611
|
-
}
|
|
1612
|
-
interface SecubotFlaw {
|
|
1613
|
-
title: string;
|
|
1614
|
-
start: number;
|
|
1615
|
-
end: number;
|
|
1616
|
-
flawType: 'C' | 'H' | 'M' | 'L' | 'none';
|
|
1617
|
-
fixStatus: 'none' | 'true' | 'false';
|
|
1618
|
-
details: SecubotFlawDetail;
|
|
1619
|
-
}
|
|
1620
|
-
interface SecubotFlawDetail {
|
|
1621
|
-
title: string;
|
|
1622
|
-
id?: string;
|
|
1623
|
-
flawType?: 'C' | 'H' | 'M' | 'L' | 'none';
|
|
1624
|
-
importPath?: string;
|
|
1625
|
-
description?: string;
|
|
1626
|
-
advice?: string;
|
|
1627
|
-
references?: SecubotLink[];
|
|
1628
|
-
codeFlows?: SecubotCodeFlow[];
|
|
1629
|
-
}
|
|
1630
|
-
interface SecubotLink {
|
|
1631
|
-
url: string;
|
|
1632
|
-
title: string;
|
|
1633
|
-
}
|
|
1634
|
-
interface SecubotFixData {
|
|
1635
|
-
data: any;
|
|
1636
|
-
query: string;
|
|
1637
|
-
action: 'fix-common' | 'fix-hardcode';
|
|
1638
|
-
}
|
|
1639
|
-
interface SecubotCodeFlow {
|
|
1640
|
-
filePath: string;
|
|
1641
|
-
codeLines: CodeLine[];
|
|
1642
|
-
}
|
|
1643
|
-
interface CodeLine {
|
|
1644
|
-
line: number;
|
|
1645
|
-
code: string;
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
declare const ACTION_CODE_SEARCH = "CODE_SEARCH";
|
|
1649
|
-
interface CodeSearchPayload {
|
|
1650
|
-
/** 检索query */
|
|
1651
|
-
queries: string[];
|
|
1652
|
-
/** 检索范围 */
|
|
1653
|
-
path?: string[];
|
|
1654
|
-
/** 是否需要关键字搜索 */
|
|
1655
|
-
needKeywordSearch?: boolean;
|
|
1656
|
-
/** 是否需要重建索引后再进行检索(重建索引会有一定耗时) */
|
|
1657
|
-
needRecreateIndex?: boolean;
|
|
1658
|
-
/** 重建索引最大等待耗时,单位为秒 */
|
|
1659
|
-
maxDuration?: number;
|
|
1660
|
-
}
|
|
1661
|
-
interface ContextsConfig {
|
|
1662
|
-
code: string;
|
|
1663
|
-
group: string;
|
|
1664
|
-
value: string;
|
|
1665
|
-
}
|
|
1666
|
-
interface CodeSearchPluginPayload {
|
|
1667
|
-
pluginName: string;
|
|
1668
|
-
capabilityName?: string;
|
|
1669
|
-
codeSearchPayload: CodeSearchPayload;
|
|
1670
|
-
}
|
|
1671
|
-
interface Position {
|
|
1672
|
-
line: number;
|
|
1673
|
-
column: number;
|
|
1674
|
-
}
|
|
1675
|
-
type CodeChunkType = 'embedding' | 'keyword' | 'selection';
|
|
1676
|
-
interface CodeChunk {
|
|
1677
|
-
repo: string;
|
|
1678
|
-
type: CodeChunkType;
|
|
1679
|
-
path: string;
|
|
1680
|
-
content: string;
|
|
1681
|
-
commentContent?: string;
|
|
1682
|
-
contentStart: Position;
|
|
1683
|
-
contentEnd: Position;
|
|
1684
|
-
distance?: number;
|
|
1685
|
-
symbolName?: string;
|
|
1686
|
-
symbolType?: string;
|
|
1687
|
-
}
|
|
1688
|
-
declare enum IntentStrategyRule {
|
|
1689
|
-
/** 当前仓库关键词检索 */
|
|
1690
|
-
REPO_KEY = "REPO_KEY",
|
|
1691
|
-
/** 当前仓库向量检索 */
|
|
1692
|
-
REPO_VECTOR = "REPO_VECTOR",
|
|
1693
|
-
/** 当前代码库正则检索 */
|
|
1694
|
-
REPO_REGEX = "REPO_REGEX",
|
|
1695
|
-
/** 指令目录关键词检索 */
|
|
1696
|
-
FOLDER_KEY = "FOLDER_KEY",
|
|
1697
|
-
/** 指令目录向量检索 */
|
|
1698
|
-
FOLDER_VECTOR = "FOLDER_VECTOR",
|
|
1699
|
-
/** 当前目录正则检索 */
|
|
1700
|
-
FOLDER_REGEX = "FOLDER_REGEX",
|
|
1701
|
-
/** 指令目录读取 */
|
|
1702
|
-
FOLDER_READ = "FOLDER_READ",
|
|
1703
|
-
/** 指令文件读取 */
|
|
1704
|
-
FILE_READ = "FILE_READ",
|
|
1705
|
-
/** 当前文件读取 */
|
|
1706
|
-
CURRENT_FILE_READ = "CURRENT_FILE_READ",
|
|
1707
|
-
/** 读取当前代码库架构 */
|
|
1708
|
-
ARCHITECTURE_READ = "ARCHITECTURE_READ"
|
|
1709
|
-
}
|
|
1710
|
-
declare enum IntentStrategyContextType {
|
|
1711
|
-
REPO = "REPO",
|
|
1712
|
-
FOLDER = "FOLDER",
|
|
1713
|
-
FILE = "FILE",
|
|
1714
|
-
CURRENT_FILE = "CURRENT_FILE"
|
|
1715
|
-
}
|
|
1716
|
-
interface IntentContext<T extends IntentStrategyContextType> {
|
|
1717
|
-
type: T;
|
|
1718
|
-
id: string;
|
|
1719
|
-
name: string;
|
|
1720
|
-
site: null | string[];
|
|
1721
|
-
url: null | string;
|
|
1722
|
-
repo_id: string | null;
|
|
1723
|
-
}
|
|
1724
|
-
/** 字符串正则 */
|
|
1725
|
-
type StringRegexp = string;
|
|
1726
|
-
interface CoreIntentStrategy<R extends IntentStrategyRule, T> {
|
|
1727
|
-
/** 意图识别的检索规则 */
|
|
1728
|
-
rule: R;
|
|
1729
|
-
/** 意图识别的检索规则上下文的类型 */
|
|
1730
|
-
context: T;
|
|
1731
|
-
/** 改写后的 query */
|
|
1732
|
-
query: string;
|
|
1733
|
-
/** 正则检索的规则 */
|
|
1734
|
-
pattern: {
|
|
1735
|
-
file_name: StringRegexp[];
|
|
1736
|
-
file_content: StringRegexp[];
|
|
1737
|
-
};
|
|
1738
|
-
start: null;
|
|
1739
|
-
end: null;
|
|
1740
|
-
}
|
|
1741
|
-
type RepoKeyIntentStrategy = CoreIntentStrategy<IntentStrategyRule.REPO_KEY, IntentContext<IntentStrategyContextType.REPO>>;
|
|
1742
|
-
type RepoVectorIntentStrategy = CoreIntentStrategy<IntentStrategyRule.REPO_VECTOR, IntentContext<IntentStrategyContextType.REPO>>;
|
|
1743
|
-
type RepoRegexIntentStrategy = CoreIntentStrategy<IntentStrategyRule.REPO_REGEX, IntentContext<IntentStrategyContextType.REPO>>;
|
|
1744
|
-
type FolderVectorIntentStrategy = CoreIntentStrategy<IntentStrategyRule.FOLDER_VECTOR, IntentContext<IntentStrategyContextType.FOLDER>>;
|
|
1745
|
-
type FolderKeyIntentStrategy = CoreIntentStrategy<IntentStrategyRule.FOLDER_KEY, IntentContext<IntentStrategyContextType.FOLDER>>;
|
|
1746
|
-
type FolderRegexIntentStrategy = CoreIntentStrategy<IntentStrategyRule.FOLDER_REGEX, IntentContext<IntentStrategyContextType.FOLDER>>;
|
|
1747
|
-
type FolderReadIntentStrategy = CoreIntentStrategy<IntentStrategyRule.FOLDER_READ, IntentContext<IntentStrategyContextType.FOLDER>>;
|
|
1748
|
-
type FileReadIntentStrategy = CoreIntentStrategy<IntentStrategyRule.FILE_READ, IntentContext<IntentStrategyContextType.FILE>>;
|
|
1749
|
-
type CurrentFileReadIntentStrategy = CoreIntentStrategy<IntentStrategyRule.CURRENT_FILE_READ, IntentContext<IntentStrategyContextType.FILE>>;
|
|
1750
|
-
type ArchitectureReadIntentStrategy = CoreIntentStrategy<IntentStrategyRule.ARCHITECTURE_READ, IntentContext<IntentStrategyContextType.REPO>>;
|
|
1751
|
-
type IntentStrategy = RepoKeyIntentStrategy | RepoVectorIntentStrategy | RepoRegexIntentStrategy | FolderVectorIntentStrategy | FolderKeyIntentStrategy | FolderRegexIntentStrategy | FolderReadIntentStrategy | FileReadIntentStrategy | CurrentFileReadIntentStrategy | ArchitectureReadIntentStrategy;
|
|
1752
|
-
|
|
1753
|
-
interface BugDetail {
|
|
1754
|
-
rule_name: string;
|
|
1755
|
-
line_number: number;
|
|
1756
|
-
description: string;
|
|
1757
|
-
type: string;
|
|
1758
|
-
bug_es_id: string;
|
|
1759
|
-
}
|
|
1760
|
-
interface CodestyleBugs {
|
|
1761
|
-
[filePath: string]: BugDetail[];
|
|
1762
|
-
}
|
|
1763
|
-
interface SubIscanResult {
|
|
1764
|
-
bugs: CodestyleBugs;
|
|
1765
|
-
high: number;
|
|
1766
|
-
middle: number;
|
|
1767
|
-
low: number;
|
|
1768
|
-
report: string;
|
|
1769
|
-
bug_num: number;
|
|
1770
|
-
message: string;
|
|
1771
|
-
file_num: number;
|
|
1772
|
-
status: number;
|
|
1773
|
-
}
|
|
1774
|
-
interface IScanResult {
|
|
1775
|
-
status: string;
|
|
1776
|
-
bugbye: SubIscanResult | null;
|
|
1777
|
-
security: SubIscanResult | null;
|
|
1778
|
-
codestyle: SubIscanResult | null;
|
|
1779
|
-
searchIscanErrorMsg: string;
|
|
1780
|
-
}
|
|
1781
|
-
declare const ACTION_START_ISCAN_AND_GET_SEC_RESULT = "START_ISCAN_AND_GET_SEC_RESULT";
|
|
1782
|
-
declare const ACTION_START_ISCAN_BY_SAVE = "START_ISCAN_BY_SAVE";
|
|
1783
|
-
declare const ACTION_START_ISCAN = "START_ISCAN";
|
|
1784
|
-
declare const ACTION_ISCAN_RESULT = "ISCAN_RESULT";
|
|
1785
|
-
declare const ACTION_ISCAN_JOB_BUILD_ID = "ISCAN_JOB_BUILD_ID";
|
|
1786
|
-
declare const ACTION_SCAN_NOTIFICATION = "SCAN_NOTIFICATION";
|
|
1787
|
-
type IcScanTypes = 'init' | 'getResult';
|
|
1788
|
-
interface IScanInvokePayload {
|
|
1789
|
-
pluginName: string;
|
|
1790
|
-
capabilityName: string;
|
|
1791
|
-
scanType: IcScanTypes;
|
|
1792
|
-
systemInfo: SystemInfoParsed;
|
|
1793
|
-
jobBuildId?: string;
|
|
1794
|
-
context?: ActivationContext;
|
|
1795
|
-
}
|
|
1796
|
-
interface IScanResultPayload {
|
|
1797
|
-
chunk: IScanResult;
|
|
1798
|
-
capabilityName?: string;
|
|
1799
|
-
}
|
|
1800
|
-
interface IScanBuildResult {
|
|
1801
|
-
jobBuildId: string;
|
|
1802
|
-
errorMsg: string;
|
|
1803
|
-
status: 'SUCCESS' | 'ERROR';
|
|
1804
|
-
}
|
|
1805
|
-
interface IScanJobBuildPayload {
|
|
1806
|
-
chunk: IScanBuildResult;
|
|
1807
|
-
capabilityName?: string;
|
|
1808
|
-
}
|
|
1809
|
-
|
|
1810
|
-
declare const MCP_SETTINGS_DIR = ".comate";
|
|
1811
|
-
declare const MCP_SETTINGS_FILENAME = "mcp.json";
|
|
1812
|
-
declare const MCP_SETTINGS_LOCAL_FILENAME = "mcp.local.json";
|
|
1813
|
-
declare const MCP_SETTINGS_FILE_PATH = ".comate/mcp.json";
|
|
1814
|
-
declare const MCP_LOCAL_SETTINGS_FILE_PATH = ".comate/mcp.local.json";
|
|
1815
|
-
declare const MCP_PROJECT_SETTINGS_RELATIVE_PATH = ".comate/mcp.json";
|
|
1816
|
-
declare const MCP_LOCAL_SETTINGS_RELATIVE_PATH = ".comate/mcp.local.json";
|
|
1817
|
-
declare const MCP_GLOBAL_SETTINGS_FILE_PATH = "~/.comate/mcp.json";
|
|
1818
|
-
declare function getMcpSettingsFilePath(source: McpConfigSource, workspaceRoot?: string): string;
|
|
1819
|
-
type McpConnectionStatus = 'connected' | 'connecting' | 'disconnected';
|
|
1820
|
-
type McpConfigSource = 'global' | 'project' | 'local';
|
|
1821
|
-
type McpTransportType = 'stdio' | 'sse' | 'streamableHttp';
|
|
1822
|
-
interface McpTool {
|
|
1823
|
-
name: string;
|
|
1824
|
-
description?: string;
|
|
1825
|
-
inputSchema?: object;
|
|
1826
|
-
autoApprove?: boolean;
|
|
1827
|
-
}
|
|
1828
|
-
interface McpServerInfo {
|
|
1829
|
-
name: string;
|
|
1830
|
-
version: string;
|
|
1831
|
-
description?: string;
|
|
1832
|
-
instructions?: string;
|
|
1833
|
-
}
|
|
1834
|
-
interface McpServerBaseConfigRaw {
|
|
1835
|
-
description?: string;
|
|
1836
|
-
disabled?: boolean;
|
|
1837
|
-
timeout?: number;
|
|
1838
|
-
transportType?: McpTransportType;
|
|
1839
|
-
type?: McpTransportType;
|
|
1840
|
-
}
|
|
1841
|
-
interface StdioMcpServerConfigRaw extends McpServerBaseConfigRaw {
|
|
1842
|
-
command: string;
|
|
1843
|
-
transportType?: 'stdio';
|
|
1844
|
-
type?: 'stdio';
|
|
1845
|
-
args?: string[];
|
|
1846
|
-
env?: Record<string, string>;
|
|
1847
|
-
cwd?: string;
|
|
1848
|
-
}
|
|
1849
|
-
interface HttpMcpServerConfigBaseRaw extends McpServerBaseConfigRaw {
|
|
1850
|
-
url: string;
|
|
1851
|
-
headers?: HeadersInit;
|
|
1852
|
-
requestInit?: RequestInit;
|
|
1853
|
-
}
|
|
1854
|
-
interface SseMcpServerConfigRaw extends HttpMcpServerConfigBaseRaw {
|
|
1855
|
-
transportType?: 'sse';
|
|
1856
|
-
type?: 'sse';
|
|
1857
|
-
}
|
|
1858
|
-
interface StreamableHttpMcpServerConfigRaw extends HttpMcpServerConfigBaseRaw {
|
|
1859
|
-
transportType?: 'streamableHttp';
|
|
1860
|
-
type?: 'streamableHttp';
|
|
1861
|
-
}
|
|
1862
|
-
type McpServerConfigRaw = StdioMcpServerConfigRaw | SseMcpServerConfigRaw | StreamableHttpMcpServerConfigRaw;
|
|
1863
|
-
interface MCPServerForWebview {
|
|
1864
|
-
name: string;
|
|
1865
|
-
disabled?: boolean;
|
|
1866
|
-
status: McpConnectionStatus;
|
|
1867
|
-
error?: string;
|
|
1868
|
-
tools?: McpTool[];
|
|
1869
|
-
serverInfo?: McpServerInfo;
|
|
1870
|
-
logPath: string;
|
|
1871
|
-
source: McpConfigSource;
|
|
1872
|
-
}
|
|
1873
|
-
interface MCPTextContent {
|
|
1874
|
-
type: 'text';
|
|
1875
|
-
text: string;
|
|
1876
|
-
}
|
|
1877
|
-
interface MCPImageContent {
|
|
1878
|
-
type: 'image';
|
|
1879
|
-
data: string;
|
|
1880
|
-
mimeType: string;
|
|
1881
|
-
}
|
|
1882
|
-
interface MCPAudioContent {
|
|
1883
|
-
type: 'audio';
|
|
1884
|
-
data: string;
|
|
1885
|
-
mimeType: string;
|
|
1886
|
-
}
|
|
1887
|
-
interface MCPResourceContent {
|
|
1888
|
-
type: 'resource';
|
|
1889
|
-
resource: {
|
|
1890
|
-
uri: string;
|
|
1891
|
-
mimeType?: string;
|
|
1892
|
-
text?: string;
|
|
1893
|
-
blob?: string;
|
|
1894
|
-
};
|
|
1895
|
-
}
|
|
1896
|
-
interface McpServerConfigParsedBase {
|
|
1897
|
-
description?: string;
|
|
1898
|
-
disabled: boolean;
|
|
1899
|
-
timeout: number;
|
|
1900
|
-
transportType: McpTransportType;
|
|
1901
|
-
source: McpConfigSource;
|
|
1902
|
-
}
|
|
1903
|
-
interface StdioMcpServerConfigParsed extends McpServerConfigParsedBase {
|
|
1904
|
-
transportType: 'stdio';
|
|
1905
|
-
command: string;
|
|
1906
|
-
args: string[];
|
|
1907
|
-
env: Record<string, string>;
|
|
1908
|
-
cwd: string;
|
|
1909
|
-
}
|
|
1910
|
-
interface SseMcpServerConfigParsed extends McpServerConfigParsedBase {
|
|
1911
|
-
transportType: 'sse';
|
|
1912
|
-
url: string;
|
|
1913
|
-
requestInit: RequestInit;
|
|
1914
|
-
}
|
|
1915
|
-
interface StreamableHttpMcpServerConfigParsed extends McpServerConfigParsedBase {
|
|
1916
|
-
transportType: 'streamableHttp';
|
|
1917
|
-
url: string;
|
|
1918
|
-
requestInit: RequestInit;
|
|
1919
|
-
}
|
|
1920
|
-
type McpServerConfigParsed = StdioMcpServerConfigParsed | SseMcpServerConfigParsed | StreamableHttpMcpServerConfigParsed;
|
|
1921
|
-
type RawSettings = Record<string, McpServerConfigRaw>;
|
|
1922
|
-
type ParsedSettings = Record<string, McpServerConfigParsed>;
|
|
1923
|
-
interface SettingsSnapshot {
|
|
1924
|
-
raw: RawSettings;
|
|
1925
|
-
parsed: ParsedSettings;
|
|
1926
|
-
}
|
|
1927
|
-
interface LayeredSnapshot {
|
|
1928
|
-
global: SettingsSnapshot;
|
|
1929
|
-
project: SettingsSnapshot;
|
|
1930
|
-
local: SettingsSnapshot;
|
|
1931
|
-
}
|
|
1932
|
-
interface McpConfigResult {
|
|
1933
|
-
filePath: string;
|
|
1934
|
-
startLine: number;
|
|
1935
|
-
endLine: number;
|
|
1936
|
-
snapshot?: SettingsSnapshot;
|
|
1937
|
-
config?: ParsedSettings;
|
|
1938
|
-
}
|
|
1939
|
-
type McpConfigUpdatePayload = {
|
|
1940
|
-
layered: LayeredSnapshot;
|
|
1941
|
-
error?: never;
|
|
1942
|
-
} | {
|
|
1943
|
-
layered?: never;
|
|
1944
|
-
error: string;
|
|
1945
|
-
};
|
|
1946
|
-
type McpConfigUpdateRequest = {
|
|
1947
|
-
serverName: string;
|
|
1948
|
-
type: 'add' | 'update';
|
|
1949
|
-
config: McpServerConfigRaw;
|
|
1950
|
-
source: McpConfigSource;
|
|
1951
|
-
} | {
|
|
1952
|
-
serverName: string;
|
|
1953
|
-
type: 'delete';
|
|
1954
|
-
source: McpConfigSource;
|
|
1955
|
-
};
|
|
1956
|
-
|
|
1957
|
-
/**
|
|
1958
|
-
* 触发源类型
|
|
1959
|
-
*/
|
|
1960
|
-
declare enum TriggerSource {
|
|
1961
|
-
/** 文件保存时触发 */
|
|
1962
|
-
FileSave = "file-save",
|
|
1963
|
-
/** Git HEAD 变更时触发 */
|
|
1964
|
-
GitHeadChanged = "git-head-changed",
|
|
1965
|
-
/** Git 合并操作时触发 */
|
|
1966
|
-
GitMerge = "git-merge",
|
|
1967
|
-
/** Git rebase操作时触发 */
|
|
1968
|
-
GitRebase = "git-rebase",
|
|
1969
|
-
/** IDE 启动时触发 */
|
|
1970
|
-
IdeStartup = "ide-startup",
|
|
1971
|
-
/** 定时触发 */
|
|
1972
|
-
Interval = "interval",
|
|
1973
|
-
/** 配置变更时触发 */
|
|
1974
|
-
ConfigChange = "config-change",
|
|
1975
|
-
/** 手动触发 */
|
|
1976
|
-
Manual = "manual",
|
|
1977
|
-
/** 远程强制触发 */
|
|
1978
|
-
RemoteForce = "remote-force"
|
|
1979
|
-
}
|
|
1980
|
-
/**
|
|
1981
|
-
* 扫描范围(文件/全库)
|
|
1982
|
-
*/
|
|
1983
|
-
type ScopeType = 'files' | 'workspace';
|
|
1984
|
-
/**
|
|
1985
|
-
* 扫描类型(本地/服务端)
|
|
1986
|
-
*/
|
|
1987
|
-
type ScanType = 'local' | 'server';
|
|
1988
|
-
/**
|
|
1989
|
-
* 扫描跳过原因
|
|
1990
|
-
*/
|
|
1991
|
-
declare enum SkipReason {
|
|
1992
|
-
/** 任务被禁用 */
|
|
1993
|
-
TaskDisabled = "task_disabled",
|
|
1994
|
-
/** 触发器未启用 */
|
|
1995
|
-
TriggerNotEnabled = "trigger_not_enabled",
|
|
1996
|
-
/** 扫描范围不匹配 */
|
|
1997
|
-
ScopeNotMatched = "scope_not_matched",
|
|
1998
|
-
/** 触发间隔限制(最小时间间隔) */
|
|
1999
|
-
RateLimitInterval = "rate_limit_interval",
|
|
2000
|
-
/** 触发次数限制(单位时间次数) */
|
|
2001
|
-
RateLimitCount = "rate_limit_count",
|
|
2002
|
-
/** 任务正在运行 */
|
|
2003
|
-
TaskRunning = "task_running",
|
|
2004
|
-
/** 重复事件 */
|
|
2005
|
-
DuplicateEvent = "duplicate_event"
|
|
2006
|
-
}
|
|
2007
|
-
/**
|
|
2008
|
-
* 触发事件
|
|
2009
|
-
*/
|
|
2010
|
-
interface TriggerEvent {
|
|
2011
|
-
eventId: string;
|
|
2012
|
-
/** 触发源类型 */
|
|
2013
|
-
source: TriggerSource;
|
|
2014
|
-
/** 扫描范围(文件/全库) */
|
|
2015
|
-
scopeType: ScopeType;
|
|
2016
|
-
/** 扫描范围(具体文件路径) */
|
|
2017
|
-
scope?: string[];
|
|
2018
|
-
timestamp: number;
|
|
2019
|
-
metadata?: Record<string, any>;
|
|
2020
|
-
}
|
|
2021
|
-
/**
|
|
2022
|
-
* 本地扫描模式类型
|
|
2023
|
-
*/
|
|
2024
|
-
type LocalMode = 'single' | 'multi' | 'mock' | 'icr';
|
|
2025
|
-
/**
|
|
2026
|
-
* 扫描计划
|
|
2027
|
-
*/
|
|
2028
|
-
interface ScanPlan {
|
|
2029
|
-
id: string;
|
|
2030
|
-
/** 关联的触发事件id */
|
|
2031
|
-
eventId: string;
|
|
2032
|
-
/** 扫描任务id 用于后端数据串联和日志上报 */
|
|
2033
|
-
taskId: string;
|
|
2034
|
-
/** 关联的任务配置id(TaskConfig.id) */
|
|
2035
|
-
configTaskId: string;
|
|
2036
|
-
taskName: string;
|
|
2037
|
-
timestamp: number;
|
|
2038
|
-
/** 扫描触发源 */
|
|
2039
|
-
source: TriggerSource;
|
|
2040
|
-
/** 扫描范围(文件/全库) */
|
|
2041
|
-
scopeType: ScopeType;
|
|
2042
|
-
/** 扫描类型(本地/服务端) */
|
|
2043
|
-
scanType: ScanType;
|
|
2044
|
-
/** 本地扫描模式(mock/icr/single/multi) */
|
|
2045
|
-
localMode?: LocalMode;
|
|
2046
|
-
/** 本地规则集 */
|
|
2047
|
-
localRuleset?: string;
|
|
2048
|
-
/** 扫描范围(具体文件路径) */
|
|
2049
|
-
scope: string[];
|
|
2050
|
-
skill?: string;
|
|
2051
|
-
serverTargets?: string[];
|
|
2052
|
-
}
|
|
2053
|
-
/**
|
|
2054
|
-
* 扫描请求 包含一次扫描请求的所有触发事件
|
|
2055
|
-
*/
|
|
2056
|
-
interface ScanRequest {
|
|
2057
|
-
events: TriggerEvent[];
|
|
2058
|
-
timestamp: number;
|
|
2059
|
-
}
|
|
2060
|
-
/**
|
|
2061
|
-
* 扫描请求结果,包含生成的扫描计划数量、事件结果和计划列表
|
|
2062
|
-
*/
|
|
2063
|
-
interface ScanRequestResult {
|
|
2064
|
-
totalPlansGenerated: number;
|
|
2065
|
-
eventResults: EventResult[];
|
|
2066
|
-
plans: ScanPlan[];
|
|
2067
|
-
}
|
|
2068
|
-
/**
|
|
2069
|
-
* 单次扫描事件处理结果
|
|
2070
|
-
*/
|
|
2071
|
-
interface EventResult {
|
|
2072
|
-
eventId: string;
|
|
2073
|
-
source: TriggerSource;
|
|
2074
|
-
/** 匹配的扫描任务数量 */
|
|
2075
|
-
matchedTaskCount: number;
|
|
2076
|
-
/** 生成的扫描计划数量 */
|
|
2077
|
-
plansGenerated: number;
|
|
2078
|
-
/** 被跳过的任务信息 */
|
|
2079
|
-
skippedTasks: SkippedTaskInfo[];
|
|
2080
|
-
/** 是否被跳过 */
|
|
2081
|
-
skipped?: boolean;
|
|
2082
|
-
/** 跳过原因 */
|
|
2083
|
-
skipReason?: SkipReason;
|
|
2084
|
-
}
|
|
2085
|
-
/**
|
|
2086
|
-
* 被跳过的任务信息
|
|
2087
|
-
*/
|
|
2088
|
-
interface SkippedTaskInfo {
|
|
2089
|
-
taskId: string;
|
|
2090
|
-
taskName: string;
|
|
2091
|
-
skipReason: SkipReason;
|
|
2092
|
-
}
|
|
2093
|
-
/**
|
|
2094
|
-
* 触发器配置
|
|
2095
|
-
*/
|
|
2096
|
-
interface TriggerConfig {
|
|
2097
|
-
enabled: boolean;
|
|
2098
|
-
/** 两次扫描之间的最小间隔(分钟) */
|
|
2099
|
-
minInterval: number;
|
|
2100
|
-
/** 每小时最大扫描次数 */
|
|
2101
|
-
maxScansPerHour: number;
|
|
2102
|
-
}
|
|
2103
|
-
/**
|
|
2104
|
-
* 扫描配置(用于IDE扫描频率控制)
|
|
2105
|
-
*/
|
|
2106
|
-
interface AggregatedScanConfig {
|
|
2107
|
-
enabled: boolean;
|
|
2108
|
-
ignoreDirs: string[];
|
|
2109
|
-
debounceDelay: number;
|
|
2110
|
-
/** 检查并移除已修复诊断的节流时间(毫秒) */
|
|
2111
|
-
checkFixedDiagnosticsThrottle: number;
|
|
2112
|
-
/** 各触发器分别的扫描配置 */
|
|
2113
|
-
triggers: Partial<Record<TriggerSource, TriggerConfig>>;
|
|
2114
|
-
}
|
|
2115
|
-
/**
|
|
2116
|
-
* 扫描调度器协议 包括请求和通知
|
|
2117
|
-
*/
|
|
2118
|
-
interface ScanSchedulerProtocol {
|
|
2119
|
-
requests: {
|
|
2120
|
-
/** 获取扫描配置 */
|
|
2121
|
-
'scan/get-config': {
|
|
2122
|
-
params: void;
|
|
2123
|
-
result: AggregatedScanConfig;
|
|
2124
|
-
};
|
|
2125
|
-
/** 请求扫描执行 */
|
|
2126
|
-
'scan/request-scan': {
|
|
2127
|
-
params: ScanRequest;
|
|
2128
|
-
result: ScanRequestResult;
|
|
2129
|
-
};
|
|
2130
|
-
/** 取消扫描任务 */
|
|
2131
|
-
'scan/cancel-task': {
|
|
2132
|
-
params: {
|
|
2133
|
-
planId: string;
|
|
2134
|
-
taskId: string;
|
|
2135
|
-
};
|
|
2136
|
-
result: {
|
|
2137
|
-
success: boolean;
|
|
2138
|
-
error?: string;
|
|
2139
|
-
};
|
|
2140
|
-
};
|
|
2141
|
-
};
|
|
2142
|
-
notifications: {
|
|
2143
|
-
/** 扫描计划就绪 */
|
|
2144
|
-
'scan/plan-ready': ScanPlan;
|
|
2145
|
-
/** 扫描配置更新 */
|
|
2146
|
-
'scan/config-updated': AggregatedScanConfig;
|
|
2147
|
-
/** 扫描开始 */
|
|
2148
|
-
'scan/started': {
|
|
2149
|
-
planId: string;
|
|
2150
|
-
taskId: string;
|
|
2151
|
-
};
|
|
2152
|
-
/** 扫描结果(流式通知,每发现一个问题发送一次) */
|
|
2153
|
-
'scan/result': ScanExecutionResult;
|
|
2154
|
-
/** 扫描失败 */
|
|
2155
|
-
'scan/failed': {
|
|
2156
|
-
planId: string;
|
|
2157
|
-
taskId: string;
|
|
2158
|
-
error: string;
|
|
2159
|
-
};
|
|
2160
|
-
};
|
|
2161
|
-
}
|
|
2162
|
-
/**
|
|
2163
|
-
* 扫描任务状态
|
|
2164
|
-
*/
|
|
2165
|
-
interface TaskState {
|
|
2166
|
-
taskId: string;
|
|
2167
|
-
lastScanTime: number;
|
|
2168
|
-
lastIntervalFireTime: number;
|
|
2169
|
-
scanHistory: ScanRecord[];
|
|
2170
|
-
runningPlans: Set<string>;
|
|
2171
|
-
}
|
|
2172
|
-
/**
|
|
2173
|
-
* 扫描记录
|
|
2174
|
-
*/
|
|
2175
|
-
interface ScanRecord {
|
|
2176
|
-
planId: string;
|
|
2177
|
-
eventId: string;
|
|
2178
|
-
timestamp: number;
|
|
2179
|
-
source: TriggerSource;
|
|
2180
|
-
duration?: number;
|
|
2181
|
-
startedAt?: number;
|
|
2182
|
-
}
|
|
2183
|
-
/**
|
|
2184
|
-
* 扫描任务配置
|
|
2185
|
-
*/
|
|
2186
|
-
interface TaskConfig {
|
|
2187
|
-
id: string;
|
|
2188
|
-
name: string;
|
|
2189
|
-
enabled: boolean;
|
|
2190
|
-
triggers: TriggerSource[];
|
|
2191
|
-
intervalMs?: number;
|
|
2192
|
-
taskRateLimit: {
|
|
2193
|
-
/** 两次扫描之间的最小间隔(分钟) */
|
|
2194
|
-
minInterval: number;
|
|
2195
|
-
/** 每小时最大扫描次数 */
|
|
2196
|
-
maxScansPerHour: number;
|
|
2197
|
-
};
|
|
2198
|
-
scopeFilter: {
|
|
2199
|
-
watchExtensions: string[];
|
|
2200
|
-
watchDirs: string[];
|
|
2201
|
-
};
|
|
2202
|
-
planTemplate: {
|
|
2203
|
-
localMode: LocalMode;
|
|
2204
|
-
ruleset: string;
|
|
2205
|
-
skill?: string;
|
|
2206
|
-
};
|
|
2207
|
-
}
|
|
2208
|
-
/**
|
|
2209
|
-
* 扫描问题严重程度(兼容 VSCode 和 JetBrains)
|
|
2210
|
-
*/
|
|
2211
|
-
type ScanIssueSeverity = 'ERROR' | 'WARNING';
|
|
2212
|
-
/**
|
|
2213
|
-
* 位置范围
|
|
2214
|
-
*/
|
|
2215
|
-
interface ScanIssueRange {
|
|
2216
|
-
startLine: number;
|
|
2217
|
-
startCharacter: number;
|
|
2218
|
-
endLine: number;
|
|
2219
|
-
endCharacter: number;
|
|
2220
|
-
}
|
|
2221
|
-
/**
|
|
2222
|
-
* 修复数据,用于触发侧边栏对话
|
|
2223
|
-
*/
|
|
2224
|
-
interface ScanIssueRepairData {
|
|
2225
|
-
/** 规则ID */
|
|
2226
|
-
ruleId: string;
|
|
2227
|
-
/** 规则名称 */
|
|
2228
|
-
ruleName?: string;
|
|
2229
|
-
/** 修复建议 */
|
|
2230
|
-
suggestion?: string;
|
|
2231
|
-
}
|
|
2232
|
-
/**
|
|
2233
|
-
* 扫描发现的问题(兼容 VSCode 和 JetBrains)
|
|
2234
|
-
*/
|
|
2235
|
-
interface ScanIssue {
|
|
2236
|
-
/** 问题ID */
|
|
2237
|
-
id: string;
|
|
2238
|
-
/** 文件路径 */
|
|
2239
|
-
filePath: string;
|
|
2240
|
-
/** 错误的位置 */
|
|
2241
|
-
range: ScanIssueRange;
|
|
2242
|
-
/** 诊断信息的具体内容,描述,for vscode */
|
|
2243
|
-
textMessage: string;
|
|
2244
|
-
/** html版,诊断信息的具体内容,for jetbrains */
|
|
2245
|
-
htmlMessage?: string;
|
|
2246
|
-
/** 严重程度:ERROR、WARNING */
|
|
2247
|
-
severity: ScanIssueSeverity;
|
|
2248
|
-
/** 用于触发侧边栏对话 */
|
|
2249
|
-
repairData: ScanIssueRepairData;
|
|
2250
|
-
/** 错误的源码,必须,否则无法定位错误 */
|
|
2251
|
-
sourceCode: string;
|
|
2252
|
-
/** 上下文,辅助定位错误位置 */
|
|
2253
|
-
contextCode: string[];
|
|
2254
|
-
/** 诊断代码,包含规则标识符和相关文档链接,for vscode */
|
|
2255
|
-
code?: {
|
|
2256
|
-
value: string | number;
|
|
2257
|
-
target: string;
|
|
2258
|
-
};
|
|
2259
|
-
/** 诊断信息的来源,for vscode */
|
|
2260
|
-
source?: string;
|
|
2261
|
-
}
|
|
2262
|
-
/**
|
|
2263
|
-
* 按文件分组的扫描问题
|
|
2264
|
-
*/
|
|
2265
|
-
interface ScanIssuesByFile {
|
|
2266
|
-
/** 文件路径 */
|
|
2267
|
-
filePath: string;
|
|
2268
|
-
/** 该文件的问题列表 */
|
|
2269
|
-
issues: ScanIssue[];
|
|
2270
|
-
}
|
|
2271
|
-
/**
|
|
2272
|
-
* 扫描执行结果
|
|
2273
|
-
*/
|
|
2274
|
-
interface ScanExecutionResult {
|
|
2275
|
-
/** 扫描计划ID */
|
|
2276
|
-
planId: string;
|
|
2277
|
-
/** 任务ID */
|
|
2278
|
-
taskId: string;
|
|
2279
|
-
/** 扫描的文件列表 */
|
|
2280
|
-
scannedFiles: string[];
|
|
2281
|
-
/** 发现的问题列表(按文件分组) */
|
|
2282
|
-
issuesByFile: ScanIssuesByFile[];
|
|
2283
|
-
/** 问题总数 */
|
|
2284
|
-
totalIssueCount: number;
|
|
2285
|
-
/** 扫描耗时(毫秒) */
|
|
2286
|
-
duration: number;
|
|
2287
|
-
/** 扫描时间戳 */
|
|
2288
|
-
timestamp: number;
|
|
2289
|
-
}
|
|
2290
|
-
/**
|
|
2291
|
-
* 远端扫描配置 - 全局配置部分
|
|
2292
|
-
*/
|
|
2293
|
-
interface RemoteScanGlobalConfig {
|
|
2294
|
-
enabled: boolean;
|
|
2295
|
-
ignoreDirs: string[];
|
|
2296
|
-
debounceDelay: number;
|
|
2297
|
-
checkFixedDiagnosticsThrottle: number;
|
|
2298
|
-
triggerConfigs: Record<string, TriggerConfig>;
|
|
2299
|
-
}
|
|
2300
|
-
/**
|
|
2301
|
-
* 远端扫描配置响应
|
|
2302
|
-
*/
|
|
2303
|
-
interface RemoteScanConfigResponse {
|
|
2304
|
-
status: 'OK' | 'UNAUTHORIZED';
|
|
2305
|
-
message: string;
|
|
2306
|
-
data?: {
|
|
2307
|
-
global: RemoteScanGlobalConfig;
|
|
2308
|
-
tasks: TaskConfig[];
|
|
2309
|
-
};
|
|
2310
|
-
}
|
|
2311
|
-
|
|
2312
|
-
type PluginCapabilityType = 'Prompt' | 'Skill' | 'Fallback' | 'Background' | 'Config';
|
|
2313
|
-
interface VisibilitySelector {
|
|
2314
|
-
/** 当前激活文件的语言 */
|
|
2315
|
-
language?: string[];
|
|
2316
|
-
/** 当前激活文件的路径,使用Glob语法 */
|
|
2317
|
-
activeFilePath?: string[];
|
|
2318
|
-
/** 当前激活文件的内容包含关键字 */
|
|
2319
|
-
activeFileContent?: string[];
|
|
2320
|
-
/** 当前用户选中内容包含关键字 */
|
|
2321
|
-
selectedContent?: string[];
|
|
2322
|
-
/** 工作台包含指定文件,使用Glob语法 */
|
|
2323
|
-
workspaceFile?: string[];
|
|
2324
|
-
}
|
|
2325
|
-
interface ConfigObjectBase {
|
|
2326
|
-
title: string;
|
|
2327
|
-
description?: string;
|
|
2328
|
-
}
|
|
2329
|
-
interface ConfigStringObject {
|
|
2330
|
-
type: 'string';
|
|
2331
|
-
enum?: string[];
|
|
2332
|
-
default?: string;
|
|
2333
|
-
}
|
|
2334
|
-
interface ConfigNumberObject {
|
|
2335
|
-
type: 'number' | 'integer';
|
|
2336
|
-
default?: number;
|
|
2337
|
-
}
|
|
2338
|
-
interface ConfigBooleanObject {
|
|
2339
|
-
type: 'boolean';
|
|
2340
|
-
default?: boolean;
|
|
2341
|
-
}
|
|
2342
|
-
type ConfigPrimitiveObject = ConfigStringObject | ConfigNumberObject | ConfigBooleanObject;
|
|
2343
|
-
interface ConfigArrayObject {
|
|
2344
|
-
type: 'array';
|
|
2345
|
-
items: Omit<ConfigPrimitiveObject, 'default'>;
|
|
2346
|
-
}
|
|
2347
|
-
type ConfigSchemaObject = ConfigObjectBase & (ConfigPrimitiveObject | ConfigArrayObject);
|
|
2348
|
-
interface ProviderCapabilityInfo {
|
|
2349
|
-
owner: PluginDescription;
|
|
2350
|
-
type: PluginCapabilityType;
|
|
2351
|
-
name: string;
|
|
2352
|
-
displayName?: string;
|
|
2353
|
-
placeholder?: string;
|
|
2354
|
-
defaultUserMessage?: string;
|
|
2355
|
-
displayTag?: string;
|
|
2356
|
-
enableSmartApply?: boolean;
|
|
2357
|
-
visibilitySelector?: VisibilitySelector;
|
|
2358
|
-
querySelector?: VisibilitySelector;
|
|
2359
|
-
queryScore?: number;
|
|
2360
|
-
}
|
|
2361
|
-
interface PluginConfigSection {
|
|
2362
|
-
title: string;
|
|
2363
|
-
properties: Record<string, ConfigSchemaObject>;
|
|
2364
|
-
required?: string[];
|
|
2365
|
-
}
|
|
2366
|
-
interface PluginConfig {
|
|
2367
|
-
sections: PluginConfigSection[];
|
|
2368
|
-
}
|
|
2369
|
-
interface CapabilityDescription {
|
|
2370
|
-
name: string;
|
|
2371
|
-
type: PluginCapabilityType;
|
|
2372
|
-
displayName: string;
|
|
2373
|
-
description: string;
|
|
2374
|
-
placeholder?: string;
|
|
2375
|
-
defaultUserMessage?: string;
|
|
2376
|
-
displayTag?: string;
|
|
2377
|
-
enableSmartApply?: boolean;
|
|
2378
|
-
visibilitySelector?: VisibilitySelector;
|
|
2379
|
-
querySelector?: VisibilitySelector;
|
|
2380
|
-
}
|
|
2381
|
-
interface PluginDescription {
|
|
2382
|
-
name: string;
|
|
2383
|
-
version: string;
|
|
2384
|
-
icon: string;
|
|
2385
|
-
entry: string;
|
|
2386
|
-
displayName: string;
|
|
2387
|
-
description: string;
|
|
2388
|
-
enableModelSelect?: boolean;
|
|
2389
|
-
keywords: string[];
|
|
2390
|
-
capabilities: CapabilityDescription[];
|
|
2391
|
-
configSchema: PluginConfig;
|
|
2392
|
-
}
|
|
2393
|
-
interface ActivationContext {
|
|
2394
|
-
query: string;
|
|
2395
|
-
data?: any;
|
|
2396
|
-
selectedCode: string;
|
|
2397
|
-
activeFileContent: string;
|
|
2398
|
-
activeFileLineContent: string;
|
|
2399
|
-
activeFilePath: string;
|
|
2400
|
-
activeFileName: string;
|
|
2401
|
-
activeFileLanguage: string;
|
|
2402
|
-
selectedRange?: [{
|
|
2403
|
-
line: number;
|
|
2404
|
-
character: number;
|
|
2405
|
-
}, {
|
|
2406
|
-
line: number;
|
|
2407
|
-
character: number;
|
|
2408
|
-
}] | [];
|
|
2409
|
-
}
|
|
2410
|
-
interface FunctionParameterDefinition {
|
|
2411
|
-
type: 'object';
|
|
2412
|
-
properties: Record<string, JSONSchema7Definition>;
|
|
2413
|
-
required?: string[] | undefined;
|
|
2414
|
-
}
|
|
2415
|
-
interface FunctionDefinition {
|
|
2416
|
-
name: string;
|
|
2417
|
-
description: string;
|
|
2418
|
-
parameters: FunctionParameterDefinition;
|
|
2419
|
-
}
|
|
2420
|
-
|
|
2421
|
-
declare function readPluginDescription(directory: string): Promise<PluginDescription>;
|
|
2422
|
-
|
|
2423
|
-
interface PluignConfigSetSchema {
|
|
2424
|
-
id: string;
|
|
2425
|
-
enabled: boolean;
|
|
2426
|
-
sections: Array<Record<string, any>>;
|
|
2427
|
-
}
|
|
2428
|
-
interface PluginConfigSetValue {
|
|
2429
|
-
enabled: boolean;
|
|
2430
|
-
values: Record<string, any>;
|
|
2431
|
-
}
|
|
2432
|
-
interface PluginConfigSet {
|
|
2433
|
-
pluginId: string;
|
|
2434
|
-
logo: string;
|
|
2435
|
-
pluginName: string;
|
|
2436
|
-
displayName: string;
|
|
2437
|
-
description: string;
|
|
2438
|
-
tags: string[];
|
|
2439
|
-
capability: string;
|
|
2440
|
-
version: string;
|
|
2441
|
-
createTime: string;
|
|
2442
|
-
updateTime: string;
|
|
2443
|
-
creator: string[];
|
|
2444
|
-
admin: string[];
|
|
2445
|
-
configSchema: PluignConfigSetSchema;
|
|
2446
|
-
configValues: PluginConfigSetValue;
|
|
2447
|
-
official: boolean;
|
|
2448
|
-
}
|
|
2449
|
-
interface PluginMeta {
|
|
2450
|
-
independentProcess: boolean;
|
|
2451
|
-
enableBackgroundService: boolean;
|
|
2452
|
-
defaultPermissions: Array<'FileSystem' | 'User'>;
|
|
2453
|
-
onlyBusinesses: boolean;
|
|
2454
|
-
enableDiagnostic: boolean;
|
|
2455
|
-
diagnosticCapabilityName: string;
|
|
2456
|
-
}
|
|
2457
|
-
declare function mergePluginConfig(objectA?: Record<string, any>, objectB?: Record<string, any>, depth?: number): Record<string, any>;
|
|
2458
|
-
declare function getCurrentUserPluginConfigSet(userName: string): Promise<PluginConfigSet[]>;
|
|
2459
|
-
declare function localPluginConfig(workspaceFolders?: WorkspaceFolder[] | readonly WorkspaceFolder[] | null): Promise<Record<string, any>>;
|
|
2460
|
-
declare function pluginConfigDetail(pluginName: string, configSet: PluginConfigSet[], localPluginConfig: Record<string, any>): Promise<Record<string, any>>;
|
|
2461
|
-
|
|
2462
|
-
declare enum PLATFORM {
|
|
2463
|
-
SAAS = "saas",
|
|
2464
|
-
INTERNAL = "internal",
|
|
2465
|
-
POC = "poc"
|
|
2466
|
-
}
|
|
2467
|
-
declare enum ENVIRONMENT {
|
|
2468
|
-
PRODUCTION = "production",
|
|
2469
|
-
DEVELOPMENT = "development",
|
|
2470
|
-
TEST = "test"
|
|
2471
|
-
}
|
|
2472
|
-
declare enum WEBVIEW_CONSUMER {
|
|
2473
|
-
VSCODE = "vscode",
|
|
2474
|
-
JETBRAINS = "jetbrains"
|
|
2475
|
-
}
|
|
2476
|
-
interface $features {
|
|
2477
|
-
PLATFORM: PLATFORM;
|
|
2478
|
-
WEBVIEW_CONSUMER: WEBVIEW_CONSUMER;
|
|
2479
|
-
ENVIRONMENT: ENVIRONMENT;
|
|
2480
|
-
}
|
|
2481
|
-
|
|
2482
|
-
declare const SAAS_API_HOST = "https://comate.baidu.com";
|
|
2483
|
-
declare const INTERNAL_API_HOST = "https://comate.baidu-int.com";
|
|
2484
|
-
declare const SAAS_TEST_API_HOST = "https://comate-external-test.now.baidu.com";
|
|
2485
|
-
declare const INTERNAL_TEST_API_HOST = "https://comate-test.now.baidu.com";
|
|
2486
|
-
declare function setPlatform(newPlatform: PLATFORM): void;
|
|
2487
|
-
declare function setPlatformAndEnvironment(newPlatform: PLATFORM, newEnvironment: ENVIRONMENT): void;
|
|
2488
|
-
declare function setApiHost(newHttpHost: string): void;
|
|
2489
|
-
declare const getApiHost: () => string;
|
|
2490
|
-
declare const setLanguage: (language: 'en' | 'zh' | 'zh-cn' | undefined) => void;
|
|
2491
|
-
declare const axiosInstance: axios.AxiosInstance;
|
|
2492
|
-
declare const createAxiosInstance: (config?: CreateAxiosDefaults) => axios.AxiosInstance;
|
|
2493
|
-
declare const createAxiosCancelTokenSource: () => axios.CancelTokenSource;
|
|
2494
|
-
declare const CanceledError: typeof axios.CanceledError;
|
|
2495
|
-
|
|
2496
|
-
type ToolAcceptState = 'accepted' | 'rejected' | 'untouched';
|
|
2497
|
-
type ToolState = 'pending' | 'beforeExecute' | 'executing' | 'executed' | 'failed' | 'cancelled' | 'skipped';
|
|
2498
|
-
type CommandExecutionState = 'pending' | 'rejected' | 'running' | 'success' | 'failed' | 'aborted';
|
|
2499
|
-
type McpToolExecutionState = 'pending' | 'running' | 'success' | 'failed' | 'rejected';
|
|
2500
|
-
type AutomationBrowserExecutionState = 'pending' | 'skipped' | 'running' | 'success' | 'failed' | 'aborted';
|
|
2501
|
-
declare namespace ITool {
|
|
2502
|
-
interface RelevantFile {
|
|
2503
|
-
path: string;
|
|
2504
|
-
/** 如果是个远程的文件,则会有预览 url, 目前只在远端知识集的场景用到了 */
|
|
2505
|
-
url?: string;
|
|
2506
|
-
startLine?: number;
|
|
2507
|
-
endLine?: number;
|
|
2508
|
-
match?: string;
|
|
2509
|
-
}
|
|
2510
|
-
/**
|
|
2511
|
-
* 新的工具结果接口,用于替代 ToolResult 类
|
|
2512
|
-
*/
|
|
2513
|
-
interface Result<M extends object = Record<string, any>> {
|
|
2514
|
-
output: string;
|
|
2515
|
-
metadata: M;
|
|
2516
|
-
}
|
|
2517
|
-
interface ToolParams {
|
|
2518
|
-
read_file: {
|
|
2519
|
-
target_file: string;
|
|
2520
|
-
offset?: number;
|
|
2521
|
-
limit?: number;
|
|
2522
|
-
};
|
|
2523
|
-
write_file: {
|
|
2524
|
-
path: string;
|
|
2525
|
-
content: string;
|
|
2526
|
-
ask_review?: boolean;
|
|
2527
|
-
};
|
|
2528
|
-
edit_file: {
|
|
2529
|
-
file_path: string;
|
|
2530
|
-
old_string: string;
|
|
2531
|
-
new_string: string;
|
|
2532
|
-
replace_all?: boolean;
|
|
2533
|
-
ask_review?: boolean;
|
|
2534
|
-
};
|
|
2535
|
-
delete_file: {
|
|
2536
|
-
file_path: string;
|
|
2537
|
-
};
|
|
2538
|
-
run_command: {
|
|
2539
|
-
command: string;
|
|
2540
|
-
path?: string;
|
|
2541
|
-
};
|
|
2542
|
-
list_dir: {
|
|
2543
|
-
target_directory: string;
|
|
2544
|
-
ignore_globs?: string[] | string;
|
|
2545
|
-
depth?: number;
|
|
2546
|
-
};
|
|
2547
|
-
web_search: {
|
|
2548
|
-
query: string;
|
|
2549
|
-
max_results?: number;
|
|
2550
|
-
};
|
|
2551
|
-
web_fetch: {
|
|
2552
|
-
url: string;
|
|
2553
|
-
prompt: string;
|
|
2554
|
-
};
|
|
2555
|
-
grep_content: {
|
|
2556
|
-
pattern: string;
|
|
2557
|
-
path?: string;
|
|
2558
|
-
glob?: string;
|
|
2559
|
-
output_mode?: 'content' | 'files_with_matches' | 'count';
|
|
2560
|
-
'-B'?: number;
|
|
2561
|
-
'-A'?: number;
|
|
2562
|
-
'-C'?: number;
|
|
2563
|
-
'-n'?: boolean;
|
|
2564
|
-
'-i'?: boolean;
|
|
2565
|
-
type?: string;
|
|
2566
|
-
head_limit?: number;
|
|
2567
|
-
offset?: number;
|
|
2568
|
-
multiline?: boolean;
|
|
2569
|
-
};
|
|
2570
|
-
todo_write: {
|
|
2571
|
-
todos: Array<{
|
|
2572
|
-
content: string;
|
|
2573
|
-
status: 'pending' | 'in_progress' | 'completed';
|
|
2574
|
-
}>;
|
|
2575
|
-
};
|
|
2576
|
-
update_memory: {
|
|
2577
|
-
action: 'create' | 'update' | 'delete';
|
|
2578
|
-
memory_id?: string;
|
|
2579
|
-
memory_to_store?: string;
|
|
2580
|
-
topic?: string;
|
|
2581
|
-
};
|
|
2582
|
-
skill: {
|
|
2583
|
-
name: string;
|
|
2584
|
-
};
|
|
2585
|
-
glob_path: {
|
|
2586
|
-
pattern: string;
|
|
2587
|
-
target_directory?: string;
|
|
2588
|
-
};
|
|
2589
|
-
codebase_search: {
|
|
2590
|
-
query: string;
|
|
2591
|
-
};
|
|
2592
|
-
delegate_subtask: {
|
|
2593
|
-
agent_type: string;
|
|
2594
|
-
description: string;
|
|
2595
|
-
query: string;
|
|
2596
|
-
resume?: string;
|
|
2597
|
-
};
|
|
2598
|
-
use_mcp_tool: {
|
|
2599
|
-
[key: string]: any;
|
|
2600
|
-
};
|
|
2601
|
-
read_lints: {
|
|
2602
|
-
paths: string[];
|
|
2603
|
-
};
|
|
2604
|
-
compress_message: {
|
|
2605
|
-
status: string;
|
|
2606
|
-
};
|
|
2607
|
-
ask_user_question: {
|
|
2608
|
-
title?: string;
|
|
2609
|
-
questions: Array<{
|
|
2610
|
-
id: string;
|
|
2611
|
-
prompt: string;
|
|
2612
|
-
options: Array<{
|
|
2613
|
-
id: string;
|
|
2614
|
-
label: string;
|
|
2615
|
-
}>;
|
|
2616
|
-
allow_multiple?: boolean;
|
|
2617
|
-
}>;
|
|
2618
|
-
};
|
|
2619
|
-
create_plan: {
|
|
2620
|
-
name: string;
|
|
2621
|
-
plan: string;
|
|
2622
|
-
};
|
|
2623
|
-
doc_read: {
|
|
2624
|
-
target_file: string;
|
|
2625
|
-
offset?: number;
|
|
2626
|
-
limit?: number;
|
|
2627
|
-
};
|
|
2628
|
-
doc_list: {
|
|
2629
|
-
target_directory: string;
|
|
2630
|
-
depth?: number;
|
|
2631
|
-
};
|
|
2632
|
-
doc_search: {
|
|
2633
|
-
query: string;
|
|
2634
|
-
};
|
|
2635
|
-
automation_browser: {
|
|
2636
|
-
command: string;
|
|
2637
|
-
};
|
|
2638
|
-
unknown: any;
|
|
2639
|
-
}
|
|
2640
|
-
interface ResultMetadata {
|
|
2641
|
-
read_file: {
|
|
2642
|
-
absolutePath: string;
|
|
2643
|
-
relativePath: string;
|
|
2644
|
-
startLine: number;
|
|
2645
|
-
endLine: number;
|
|
2646
|
-
};
|
|
2647
|
-
write_file: {
|
|
2648
|
-
relativePath: string;
|
|
2649
|
-
absolutePath: string;
|
|
2650
|
-
originalContent: string | null;
|
|
2651
|
-
content: string;
|
|
2652
|
-
diff: {
|
|
2653
|
-
add: number;
|
|
2654
|
-
remove: number;
|
|
2655
|
-
};
|
|
2656
|
-
askReview?: boolean;
|
|
2657
|
-
};
|
|
2658
|
-
edit_file: {
|
|
2659
|
-
relativePath: string;
|
|
2660
|
-
absolutePath: string;
|
|
2661
|
-
originalContent: string | null;
|
|
2662
|
-
content: string;
|
|
2663
|
-
diff: {
|
|
2664
|
-
add: number;
|
|
2665
|
-
remove: number;
|
|
2666
|
-
};
|
|
2667
|
-
askReview?: boolean;
|
|
2668
|
-
};
|
|
2669
|
-
delete_file: {
|
|
2670
|
-
relativePath: string;
|
|
2671
|
-
absolutePath: string;
|
|
2672
|
-
originalContent: string | null;
|
|
2673
|
-
content: null;
|
|
2674
|
-
diff: {
|
|
2675
|
-
add: number;
|
|
2676
|
-
remove: number;
|
|
2677
|
-
};
|
|
2678
|
-
};
|
|
2679
|
-
run_command: {
|
|
2680
|
-
output: string;
|
|
2681
|
-
exitCode?: number;
|
|
2682
|
-
state: CommandExecutionState;
|
|
2683
|
-
autoRun: boolean;
|
|
2684
|
-
};
|
|
2685
|
-
list_dir: {
|
|
2686
|
-
relativePath: string;
|
|
2687
|
-
absolutePath: string;
|
|
2688
|
-
targetDirectory: string;
|
|
2689
|
-
totalCount: number;
|
|
2690
|
-
isTruncated: boolean;
|
|
2691
|
-
};
|
|
2692
|
-
web_search: {
|
|
2693
|
-
sites: Array<{
|
|
2694
|
-
url: string;
|
|
2695
|
-
source: string;
|
|
2696
|
-
content: string;
|
|
2697
|
-
favicon: string;
|
|
2698
|
-
title: string;
|
|
2699
|
-
}>;
|
|
2700
|
-
};
|
|
2701
|
-
web_fetch: {
|
|
2702
|
-
site: {
|
|
2703
|
-
url: string;
|
|
2704
|
-
source: string;
|
|
2705
|
-
content: string;
|
|
2706
|
-
title: string;
|
|
2707
|
-
};
|
|
2708
|
-
};
|
|
2709
|
-
grep_content: {
|
|
2710
|
-
pattern: string;
|
|
2711
|
-
relevantFiles: RelevantFile[];
|
|
2712
|
-
};
|
|
2713
|
-
todo_write: {
|
|
2714
|
-
todos: Array<{
|
|
2715
|
-
content: string;
|
|
2716
|
-
status: 'pending' | 'in_progress' | 'completed';
|
|
2717
|
-
}>;
|
|
2718
|
-
};
|
|
2719
|
-
update_memory: {
|
|
2720
|
-
memoryId: string;
|
|
2721
|
-
topic: string;
|
|
2722
|
-
originalContent: string | null;
|
|
2723
|
-
content: string;
|
|
2724
|
-
};
|
|
2725
|
-
skill: {
|
|
2726
|
-
relativePath: string;
|
|
2727
|
-
skillName: string;
|
|
2728
|
-
skillPath: string;
|
|
2729
|
-
};
|
|
2730
|
-
glob_path: {
|
|
2731
|
-
relativePath: string;
|
|
2732
|
-
absolutePath: string;
|
|
2733
|
-
pattern: string;
|
|
2734
|
-
relevantFiles: RelevantFile[];
|
|
2735
|
-
};
|
|
2736
|
-
codebase_search: {
|
|
2737
|
-
relevantFiles: RelevantFile[];
|
|
2738
|
-
};
|
|
2739
|
-
delegate_subtask: object;
|
|
2740
|
-
use_mcp_tool: {
|
|
2741
|
-
toolName: string;
|
|
2742
|
-
args: string;
|
|
2743
|
-
state: McpToolExecutionState;
|
|
2744
|
-
autoRun: boolean;
|
|
2745
|
-
output: string;
|
|
2746
|
-
};
|
|
2747
|
-
read_lints: {
|
|
2748
|
-
targetPath: string;
|
|
2749
|
-
lintCount: number;
|
|
2750
|
-
diagnostics?: Record<string, Array<{
|
|
2751
|
-
line: number;
|
|
2752
|
-
char: number;
|
|
2753
|
-
message: string;
|
|
2754
|
-
severity: string;
|
|
2755
|
-
source?: string;
|
|
2756
|
-
code?: number | string;
|
|
2757
|
-
}>>;
|
|
2758
|
-
};
|
|
2759
|
-
compress_message: {
|
|
2760
|
-
status: string;
|
|
2761
|
-
};
|
|
2762
|
-
ask_user_question: {
|
|
2763
|
-
title?: string;
|
|
2764
|
-
state: 'pending' | 'completed';
|
|
2765
|
-
questions: Array<{
|
|
2766
|
-
id: string;
|
|
2767
|
-
prompt: string;
|
|
2768
|
-
options: Array<{
|
|
2769
|
-
id: string;
|
|
2770
|
-
label: string;
|
|
2771
|
-
}>;
|
|
2772
|
-
allow_multiple?: boolean;
|
|
2773
|
-
selectedOptionIds: string[];
|
|
2774
|
-
}>;
|
|
2775
|
-
};
|
|
2776
|
-
create_plan: {
|
|
2777
|
-
absolutePath: string;
|
|
2778
|
-
originalContent: null;
|
|
2779
|
-
overview: string;
|
|
2780
|
-
state: 'pending' | 'running' | 'completed';
|
|
2781
|
-
name: string;
|
|
2782
|
-
};
|
|
2783
|
-
doc_read: {
|
|
2784
|
-
url: string;
|
|
2785
|
-
relativePath: string;
|
|
2786
|
-
startLine: number;
|
|
2787
|
-
endLine: number;
|
|
2788
|
-
};
|
|
2789
|
-
doc_list: {
|
|
2790
|
-
relativePath: string;
|
|
2791
|
-
totalCount: number;
|
|
2792
|
-
isTruncated: boolean;
|
|
2793
|
-
};
|
|
2794
|
-
doc_search: {
|
|
2795
|
-
relevantFiles: RelevantFile[];
|
|
2796
|
-
};
|
|
2797
|
-
automation_browser: {
|
|
2798
|
-
output: string;
|
|
2799
|
-
state: AutomationBrowserExecutionState;
|
|
2800
|
-
screenshot?: string;
|
|
2801
|
-
screenshotPath?: string;
|
|
2802
|
-
autoRun: boolean;
|
|
2803
|
-
};
|
|
2804
|
-
unknown: any;
|
|
2805
|
-
}
|
|
2806
|
-
type ToolName = keyof ResultMetadata;
|
|
2807
|
-
/**
|
|
2808
|
-
* 工具名称或别名的联合类型
|
|
2809
|
-
*
|
|
2810
|
-
* 在运行时,可以使用别名调用工具,但类型系统仍然使用规范名(ToolName)
|
|
2811
|
-
* 别名映射在 kernel 层的 toolAliases.ts 中定义
|
|
2812
|
-
*/
|
|
2813
|
-
type ToolNameOrAlias = ToolName | string;
|
|
2814
|
-
type ToolPromptActionName = 'skip' | 'reject' | 'confirm' | 'stop' | 'autoRun';
|
|
2815
|
-
}
|
|
2816
|
-
declare namespace IToolTurn {
|
|
2817
|
-
interface Element {
|
|
2818
|
-
id: string;
|
|
2819
|
-
error?: string;
|
|
2820
|
-
type: 'TEXT' | 'REASON' | 'TOOL' | 'EXCEPTION';
|
|
2821
|
-
}
|
|
2822
|
-
interface TextElement extends Element {
|
|
2823
|
-
type: 'TEXT';
|
|
2824
|
-
content: string;
|
|
2825
|
-
end: boolean;
|
|
2826
|
-
}
|
|
2827
|
-
interface ThinkElement extends Element {
|
|
2828
|
-
type: 'REASON';
|
|
2829
|
-
content: string;
|
|
2830
|
-
startTime: number;
|
|
2831
|
-
lastModifiedTime: number;
|
|
2832
|
-
end: boolean;
|
|
2833
|
-
}
|
|
2834
|
-
interface ExceptionElement extends Element {
|
|
2835
|
-
type: 'EXCEPTION';
|
|
2836
|
-
content: string;
|
|
2837
|
-
}
|
|
2838
|
-
interface ToolElement<K extends ITool.ToolName = ITool.ToolName> extends Element {
|
|
2839
|
-
type: 'TOOL';
|
|
2840
|
-
toolName: string;
|
|
2841
|
-
params: ITool.ToolParams[K];
|
|
2842
|
-
toolState: ToolState;
|
|
2843
|
-
result: ITool.Result<ITool.ResultMetadata[K]>;
|
|
2844
|
-
children?: Snapshot[];
|
|
2845
|
-
accepted?: boolean;
|
|
2846
|
-
}
|
|
2847
|
-
interface SubtaskElement extends ToolElement {
|
|
2848
|
-
type: 'TOOL';
|
|
2849
|
-
children: NonNullable<ToolElement['children']>;
|
|
2850
|
-
}
|
|
2851
|
-
type Elements = Array<TextElement | ThinkElement | ExceptionElement | ToolElement | SubtaskElement>;
|
|
2852
|
-
interface Snapshot {
|
|
2853
|
-
id: string;
|
|
2854
|
-
/**
|
|
2855
|
-
* 是否被 Checkpoint 裁切了
|
|
2856
|
-
*/
|
|
2857
|
-
discard: boolean;
|
|
2858
|
-
children: Elements;
|
|
2859
|
-
}
|
|
2860
|
-
}
|
|
2861
|
-
|
|
2862
|
-
interface FeedbackOptions {
|
|
2863
|
-
isLike?: '0' | '1' | '2';
|
|
2864
|
-
userFeedback?: {
|
|
2865
|
-
otherFeedback: string;
|
|
2866
|
-
incompleteContent: boolean;
|
|
2867
|
-
incorrectFormat: boolean;
|
|
2868
|
-
irrelevantAnswer: boolean;
|
|
2869
|
-
notHelpful: boolean;
|
|
2870
|
-
};
|
|
2871
|
-
}
|
|
2872
|
-
interface WorkflowCustomActionPayload {
|
|
2873
|
-
action: 'enableAutoRun';
|
|
2874
|
-
autoRun: boolean;
|
|
2875
|
-
}
|
|
2876
|
-
type AgentEvents = {
|
|
2877
|
-
action: 'file-view';
|
|
2878
|
-
absolutePath: string;
|
|
2879
|
-
} | {
|
|
2880
|
-
action: 'file-diff';
|
|
2881
|
-
absolutePath: string;
|
|
2882
|
-
} | {
|
|
2883
|
-
action: 'file-reject' | 'file-accept';
|
|
2884
|
-
filePath: string;
|
|
2885
|
-
} | {
|
|
2886
|
-
action: 'file-tool-result-view';
|
|
2887
|
-
absolutePath: string;
|
|
2888
|
-
/** 如果是单个工具的 diff 查看需要提供 tool 的信息 */
|
|
2889
|
-
tool?: {
|
|
2890
|
-
toolId: string;
|
|
2891
|
-
toolTurnId: string;
|
|
2892
|
-
};
|
|
2893
|
-
} | {
|
|
2894
|
-
action: 'inquire-rollback-message';
|
|
2895
|
-
userMessageId?: string;
|
|
2896
|
-
retryMessageId?: string;
|
|
2897
|
-
} | {
|
|
2898
|
-
action: 'open-rollback-file-diff';
|
|
2899
|
-
absolutePath: string;
|
|
2900
|
-
} | {
|
|
2901
|
-
action: 'rollback-message';
|
|
2902
|
-
userMessageId?: string;
|
|
2903
|
-
retryMessageId?: string;
|
|
2904
|
-
selectedAbsolutePaths: string[];
|
|
2905
|
-
} | {
|
|
2906
|
-
action: 'file-accept-all' | 'file-reject-all';
|
|
2907
|
-
id: string;
|
|
2908
|
-
} | {
|
|
2909
|
-
action: 'execute-shell' | 'insert-shell';
|
|
2910
|
-
shell: string;
|
|
2911
|
-
id: string;
|
|
2912
|
-
elementId: string;
|
|
2913
|
-
} | {
|
|
2914
|
-
action: 'copy-code';
|
|
2915
|
-
content: string;
|
|
2916
|
-
id: string;
|
|
2917
|
-
} | {
|
|
2918
|
-
action: 'tool-call-accept' | 'tool-call-reject';
|
|
2919
|
-
id: string;
|
|
2920
|
-
toolId: string;
|
|
2921
|
-
name: ITool.ToolPromptActionName;
|
|
2922
|
-
} | {
|
|
2923
|
-
action: 'tool-call-action';
|
|
2924
|
-
id: string;
|
|
2925
|
-
toolId: string;
|
|
2926
|
-
name: ITool.ToolPromptActionName;
|
|
2927
|
-
payload: WorkflowCustomActionPayload;
|
|
2928
|
-
} | {
|
|
2929
|
-
action: 'copy-all';
|
|
2930
|
-
id: string;
|
|
2931
|
-
} | {
|
|
2932
|
-
action: 'user-feedback';
|
|
2933
|
-
id: string;
|
|
2934
|
-
options: FeedbackOptions;
|
|
2935
|
-
} | {
|
|
2936
|
-
action: 'compress-token-usage';
|
|
2937
|
-
} | {
|
|
2938
|
-
action: 'quota-exceed';
|
|
2939
|
-
quotaAction: string;
|
|
2940
|
-
};
|
|
2941
|
-
|
|
2942
|
-
declare function readFileOrNull(filename: string): Promise<string>;
|
|
2943
|
-
declare function getOsAppDataPath(): string;
|
|
2944
|
-
/**
|
|
2945
|
-
* 确定文件夹是否存在,不存在则创建
|
|
2946
|
-
* @param path 检查的文件夹路径
|
|
2947
|
-
* @returns boolean
|
|
2948
|
-
*/
|
|
2949
|
-
declare function ensureDirectoryExist(path: string): Promise<boolean>;
|
|
2950
|
-
declare const emptyDir: typeof fse__default.emptyDir;
|
|
2951
|
-
declare const remove: typeof fse__default.remove;
|
|
2952
|
-
declare const readJson: typeof fse__default.readJSON;
|
|
2953
|
-
declare const writeJSON: typeof fse__default.writeJSON;
|
|
2954
|
-
|
|
2955
|
-
interface Deferred {
|
|
2956
|
-
promise: Promise<void>;
|
|
2957
|
-
resolve: () => void;
|
|
2958
|
-
reject: (error: any) => void;
|
|
2959
|
-
}
|
|
2960
|
-
declare function createDeferred(): Deferred;
|
|
2961
|
-
|
|
2962
|
-
interface LogUploaderEvent {
|
|
2963
|
-
category: string;
|
|
2964
|
-
label?: string;
|
|
2965
|
-
content?: any;
|
|
2966
|
-
action?: string;
|
|
2967
|
-
source?: string;
|
|
2968
|
-
}
|
|
2969
|
-
interface LogInitParams {
|
|
2970
|
-
platform: string;
|
|
2971
|
-
ideVersion: string;
|
|
2972
|
-
version: string;
|
|
2973
|
-
license: string;
|
|
2974
|
-
username: string;
|
|
2975
|
-
}
|
|
2976
|
-
interface PerformanceLogUploaderEvent {
|
|
2977
|
-
plugin: string;
|
|
2978
|
-
skill: string;
|
|
2979
|
-
duration: number;
|
|
2980
|
-
type?: string;
|
|
2981
|
-
uuid?: string;
|
|
2982
|
-
}
|
|
2983
|
-
type LogType = 'event' | 'error';
|
|
2984
|
-
declare class LogUploaderProvider {
|
|
2985
|
-
private readonly initParams;
|
|
2986
|
-
constructor(initParams: LogInitParams);
|
|
2987
|
-
logError(category: string, content: string): Promise<void>;
|
|
2988
|
-
logUserAction(event: LogUploaderEvent, type?: LogType): Promise<void>;
|
|
2989
|
-
performanceLog(event: PerformanceLogUploaderEvent): Promise<void>;
|
|
2990
|
-
}
|
|
2991
|
-
|
|
2992
|
-
declare class SSEProcessor<T> {
|
|
2993
|
-
private readonly body;
|
|
2994
|
-
private readonly parse;
|
|
2995
|
-
private readonly cancellationToken?;
|
|
2996
|
-
error: boolean;
|
|
2997
|
-
errorMsg: string;
|
|
2998
|
-
constructor(body: IncomingMessage, parse?: (chunk: string) => T, cancellationToken?: vscode.CancellationToken | undefined);
|
|
2999
|
-
processSSE(): AsyncGenerator<T, void, void>;
|
|
3000
|
-
maybeCancel(): boolean;
|
|
3001
|
-
cancel(): void;
|
|
3002
|
-
}
|
|
3003
|
-
|
|
3004
|
-
interface KnowledgeChunk {
|
|
3005
|
-
id: number;
|
|
3006
|
-
workspaceType: string;
|
|
3007
|
-
workspaceUUID: string;
|
|
3008
|
-
knowledgeType: string;
|
|
3009
|
-
knowledgeUUID: string;
|
|
3010
|
-
knowledgeName: string;
|
|
3011
|
-
content: string;
|
|
3012
|
-
source: string;
|
|
3013
|
-
status: string;
|
|
3014
|
-
keys: any[];
|
|
3015
|
-
score?: number | null;
|
|
3016
|
-
hits?: number | null;
|
|
3017
|
-
creator?: string | null;
|
|
3018
|
-
}
|
|
3019
|
-
interface KnowledgeQueryWorkspace {
|
|
3020
|
-
type: string;
|
|
3021
|
-
uuid: string;
|
|
3022
|
-
}
|
|
3023
|
-
interface User {
|
|
3024
|
-
name: string;
|
|
3025
|
-
chineseName: string;
|
|
3026
|
-
email: string;
|
|
3027
|
-
}
|
|
3028
|
-
interface KnowledgeSet {
|
|
3029
|
-
name: string;
|
|
3030
|
-
type: 'NORMAL' | 'SYSTEM' | 'FILE' | 'TEMP';
|
|
3031
|
-
/** 知识集的类型,文本还是代码 */
|
|
3032
|
-
fileContentType: 'TEXT' | 'LOCAL_CODE';
|
|
3033
|
-
uuid: string;
|
|
3034
|
-
origin: string;
|
|
3035
|
-
description: string;
|
|
3036
|
-
status: string;
|
|
3037
|
-
permission: string;
|
|
3038
|
-
iCodeCount: number;
|
|
3039
|
-
localCount: number;
|
|
3040
|
-
kuCount: number;
|
|
3041
|
-
creator: User;
|
|
3042
|
-
createAt: string;
|
|
3043
|
-
updater: User;
|
|
3044
|
-
updateAt: string;
|
|
3045
|
-
}
|
|
3046
|
-
interface KnowledgeSetBase {
|
|
3047
|
-
id: string;
|
|
3048
|
-
uuid?: string;
|
|
3049
|
-
type: string;
|
|
3050
|
-
}
|
|
3051
|
-
interface KnowledgeOptions {
|
|
3052
|
-
knowledgeSets?: KnowledgeQueryWorkspace[];
|
|
3053
|
-
mergeUserKnowledge?: boolean;
|
|
3054
|
-
additionalQueries?: string[];
|
|
3055
|
-
queryRewrite?: boolean;
|
|
3056
|
-
withSource?: boolean;
|
|
3057
|
-
topK?: number;
|
|
3058
|
-
score?: number;
|
|
3059
|
-
checkPermission?: boolean;
|
|
3060
|
-
}
|
|
3061
|
-
declare function getKnowledgeQueryResult(userName: string, query: string, retrievalType: InformationQueryType, localWorkspaces: KnowledgeQueryWorkspace[], options?: KnowledgeOptions, knowledgeUUIDs?: string[], baseURL?: string): Promise<{
|
|
3062
|
-
chunks: KnowledgeChunk[];
|
|
3063
|
-
}>;
|
|
3064
|
-
declare function getCurrentUserKnowledgeSet(userName: string, baseURL?: string, cloudUserName?: string, query?: string): Promise<KnowledgeSet[]>;
|
|
3065
|
-
declare function knowledgeServiceHealthy(baseURL?: string): Promise<void>;
|
|
3066
|
-
|
|
3067
|
-
/**
|
|
3068
|
-
* Knowledge 相关共用类型定义
|
|
3069
|
-
*/
|
|
3070
|
-
/** 知识类型 */
|
|
3071
|
-
type CloudKnowledgeType = 'PERSONAL' | 'DEPARTMENT' | 'NORMAL' | 'SYSTEM';
|
|
3072
|
-
/** 检索类型 */
|
|
3073
|
-
type CloudKnowledgeRetrievalType = 'TEXT' | 'LOCAL_CODE' | 'CODE';
|
|
3074
|
-
/** 知识检索块 */
|
|
3075
|
-
interface CloudKnowledgeChunk {
|
|
3076
|
-
workspaceId: string;
|
|
3077
|
-
workspaceName: string;
|
|
3078
|
-
knowledgeId: string;
|
|
3079
|
-
knowledgeName: string;
|
|
3080
|
-
retrievalType: CloudKnowledgeRetrievalType;
|
|
3081
|
-
type: CloudKnowledgeType;
|
|
3082
|
-
startLine: number;
|
|
3083
|
-
endLine: number;
|
|
3084
|
-
content: string;
|
|
3085
|
-
url: string;
|
|
3086
|
-
}
|
|
3087
|
-
/** 知识项基础信息 */
|
|
3088
|
-
interface CloudKnowledgeItem {
|
|
3089
|
-
workspaceId: string;
|
|
3090
|
-
workspaceName: string;
|
|
3091
|
-
knowledgeId: string;
|
|
3092
|
-
knowledgeName: string;
|
|
3093
|
-
type: CloudKnowledgeType;
|
|
3094
|
-
retrievalType: CloudKnowledgeRetrievalType;
|
|
3095
|
-
}
|
|
3096
|
-
/** 知识集信息 */
|
|
3097
|
-
interface CloudKnowledgeWorkspace {
|
|
3098
|
-
name: string;
|
|
3099
|
-
type: CloudKnowledgeType;
|
|
3100
|
-
uuid: string;
|
|
3101
|
-
fileContentType: CloudKnowledgeRetrievalType;
|
|
3102
|
-
}
|
|
3103
|
-
/** 合并知识和知识集的选项 */
|
|
3104
|
-
interface CloudKnowledgeSelectOption {
|
|
3105
|
-
id: string;
|
|
3106
|
-
name: string;
|
|
3107
|
-
workspaceId: string;
|
|
3108
|
-
workspaceName: string;
|
|
3109
|
-
knowledgeId?: string;
|
|
3110
|
-
knowledgeName?: string;
|
|
3111
|
-
type: 'KNOWLEDGE';
|
|
3112
|
-
permissionType: CloudKnowledgeType;
|
|
3113
|
-
retrievalType: CloudKnowledgeRetrievalType;
|
|
3114
|
-
}
|
|
3115
|
-
|
|
3116
|
-
type FileCacheSource = 'extract_content_blocks' | 'write_file' | 'patch_file' | 'edit_file' | 'delete_file' | 'create_plan' | 'read_file' | 'check_file' | 'code_selection' | 'file_reference';
|
|
3117
|
-
interface FileCacheEntry {
|
|
3118
|
-
absolutePath: string;
|
|
3119
|
-
content: string;
|
|
3120
|
-
source: FileCacheSource;
|
|
3121
|
-
deleted: boolean;
|
|
3122
|
-
time: string;
|
|
3123
|
-
}
|
|
3124
|
-
interface ChatSession {
|
|
3125
|
-
/** chat的来源,合并后仅包含智能体(AgentConversationType、spec模式下为新版给 SpecConversation 旧版为Spec)和开放平台(Addon),向前兼容默认为Chat,各个智能体,用户区分唯一id */
|
|
3126
|
-
source: 'Spec' | 'SpecConversation' | 'Chat' | 'Addon' | AgentConversationType;
|
|
3127
|
-
/** 从头到尾的一次对话 */
|
|
3128
|
-
sessionUuid: string;
|
|
3129
|
-
/** spec 模式下 用于和tab交互的唯一id */
|
|
3130
|
-
specSessionId?: string;
|
|
3131
|
-
/** 一次对话的第一条消息的内容 */
|
|
3132
|
-
title: string;
|
|
3133
|
-
/** 创建时间 */
|
|
3134
|
-
ctime: number;
|
|
3135
|
-
/** 最后一次修改时间 */
|
|
3136
|
-
utime: number;
|
|
3137
|
-
/** 会话当次的工作区目录 */
|
|
3138
|
-
workspaceDirectory: string;
|
|
3139
|
-
/** 是否有运行中的 Command 任务,不一定准,需要点开详情看一下才会更新 */
|
|
3140
|
-
hasRunningTask?: boolean;
|
|
3141
|
-
/** 回滚消息的ID */
|
|
3142
|
-
rollbackMessageId?: string;
|
|
3143
|
-
}
|
|
3144
|
-
interface ChatSessionDetail extends ChatSession {
|
|
3145
|
-
messages: any[];
|
|
3146
|
-
/** 文件内容缓存 */
|
|
3147
|
-
fileCache?: FileCacheEntry[];
|
|
3148
|
-
}
|
|
3149
|
-
interface ConversationTabModelConfig {
|
|
3150
|
-
modelId: string;
|
|
3151
|
-
enableMaxMode: boolean;
|
|
3152
|
-
}
|
|
3153
|
-
/** Conversation Tab 相关类型定义 */
|
|
3154
|
-
interface ConversationTab {
|
|
3155
|
-
/** Tab 唯一标识 */
|
|
3156
|
-
id: string;
|
|
3157
|
-
/** Tab 标题 */
|
|
3158
|
-
title: string;
|
|
3159
|
-
/** 是否为临时 Tab(未激活为真实对话前) */
|
|
3160
|
-
isTemporary?: boolean;
|
|
3161
|
-
/** 关联的对话 ID */
|
|
3162
|
-
conversationId?: string;
|
|
3163
|
-
isSpec?: boolean;
|
|
3164
|
-
agentId?: number;
|
|
3165
|
-
chatModelConfig?: ConversationTabModelConfig;
|
|
3166
|
-
specModelConfig?: ConversationTabModelConfig;
|
|
3167
|
-
}
|
|
3168
|
-
/** 单个工作区的 Tabs 数据 */
|
|
3169
|
-
interface TabsWorkspaceData {
|
|
3170
|
-
/** Tab 列表 */
|
|
3171
|
-
tabs: ConversationTab[];
|
|
3172
|
-
/** 当前激活的 Tab ID */
|
|
3173
|
-
activeTabId: string | null;
|
|
3174
|
-
/** 最后更新时间 */
|
|
3175
|
-
utime?: number;
|
|
3176
|
-
}
|
|
3177
|
-
/** 按工作区组织的 Tabs 存储结构 */
|
|
3178
|
-
interface TabsStorageData {
|
|
3179
|
-
[workspaceDirectory: string]: TabsWorkspaceData;
|
|
3180
|
-
}
|
|
3181
|
-
|
|
3182
|
-
declare function formatPrompt(promptTemplate: string, args?: Record<string, unknown>): string;
|
|
3183
|
-
declare const PROMPTTEMPLATE_ROOT_PATH: ".comate/prompt";
|
|
3184
|
-
declare const getPromptTemplateRootPath: (workspacePath: string) => string;
|
|
3185
|
-
declare const getPromptTemplatePath: (workspacePath: string, fileName: string) => string;
|
|
3186
|
-
declare const getPromptTemplateUuidFromPath: (filePath: string, workspacePath: string) => string;
|
|
3187
|
-
|
|
3188
|
-
interface LanguageConfiguration {
|
|
3189
|
-
extensions?: string[];
|
|
3190
|
-
names?: string[];
|
|
3191
|
-
patterns?: string[];
|
|
3192
|
-
firstLine?: string;
|
|
3193
|
-
}
|
|
3194
|
-
declare class LanguageDetector {
|
|
3195
|
-
static readonly default: LanguageDetector;
|
|
3196
|
-
private readonly entries;
|
|
3197
|
-
registerLanguage(id: string, configuration: LanguageConfiguration): void;
|
|
3198
|
-
detect(name: string, content: string): string | null;
|
|
3199
|
-
}
|
|
3200
|
-
|
|
3201
|
-
declare class VisibilitySelectorMatcher {
|
|
3202
|
-
private readonly selector;
|
|
3203
|
-
private readonly languageDetector;
|
|
3204
|
-
private readonly globWeights;
|
|
3205
|
-
constructor(selector: VisibilitySelector, languageDetector: LanguageDetector);
|
|
3206
|
-
/**
|
|
3207
|
-
* 根据当前工作目录和激活上下文进行匹配
|
|
3208
|
-
*
|
|
3209
|
-
* @param cwd 当前工作目录
|
|
3210
|
-
* @param context 激活上下文
|
|
3211
|
-
* @returns 返回匹配得分,为`0`表示不匹配(隐藏插件),`-1`表示没有任何规则(不隐藏),正数则数字越大匹配度越高
|
|
3212
|
-
*/
|
|
3213
|
-
match(cwd: string, context: ActivationContext): Promise<number>;
|
|
3214
|
-
private matchLanguage;
|
|
3215
|
-
private matchActiveFilePath;
|
|
3216
|
-
private matchActiveFileContent;
|
|
3217
|
-
private matchSelectedContent;
|
|
3218
|
-
private matchWorkspaceFile;
|
|
3219
|
-
}
|
|
3220
|
-
|
|
3221
|
-
interface CapabilityIdentity {
|
|
3222
|
-
pluginName: string;
|
|
3223
|
-
capabilityName: string;
|
|
3224
|
-
}
|
|
3225
|
-
declare function isCapabilityMatch(x: CapabilityIdentity, y: CapabilityIdentity): boolean;
|
|
3226
|
-
/**
|
|
3227
|
-
* 判断插件是否可以处理聊天请求
|
|
3228
|
-
*
|
|
3229
|
-
* @param capabilityType 插件能力类型
|
|
3230
|
-
* @returns 如果插件能力类型为可以处理对话请求返回`true`
|
|
3231
|
-
*/
|
|
3232
|
-
declare function canHandleChatQuery(capabilityType: PluginCapabilityType): boolean;
|
|
3233
|
-
/**
|
|
3234
|
-
* 判断插件能力是否可以展示给用户
|
|
3235
|
-
* @param capabilityType 插件能力类型
|
|
3236
|
-
* @returns 如果插件能力类型为可以展示返回`true`
|
|
3237
|
-
*/
|
|
3238
|
-
declare function canShowToUser(capabilityType: PluginCapabilityType): boolean;
|
|
3239
|
-
/**
|
|
3240
|
-
* 判断插件是否能够进行querySelector
|
|
3241
|
-
*
|
|
3242
|
-
* @param capabilityType 插件能力类型
|
|
3243
|
-
* @returns 如果插件能力可以querySelector返回`true`
|
|
3244
|
-
*/
|
|
3245
|
-
declare function canHandleQuerySelector(capabilityType: PluginCapabilityType): boolean;
|
|
3246
|
-
declare function patchEnvPath(): void;
|
|
3247
|
-
|
|
3248
|
-
declare const ACTION_COMATE_PLUS_CHAT_QUERY = "COMATE_PLUS_CHAT_QUERY";
|
|
3249
|
-
declare const ACTION_COMATE_PLUS_CHAT_CANCEL = "COMATE_PLUS_CHAT_CANCEL";
|
|
3250
|
-
declare const ACTION_COMATE_PLUS_CUSTOM_COMMAND = "COMATE_PLUS_CUSTOM_COMMAND";
|
|
3251
|
-
declare const ACTION_COMATE_PLUS_AGENT_COMMAND = "COMATE_PLUS_AGENT_COMMAND";
|
|
3252
|
-
declare const ACTION_COMATE_PLUS_WEBVIEW_INIT_DATA = "COMATE_PLUS_WEBVIEW_INIT_DATA";
|
|
3253
|
-
declare const ACTION_COMATE_PLUS_DRAW_CHAT_UPDATE = "COMATE_PLUS_DRAW_CHAT_UPDATE";
|
|
3254
|
-
declare const ACTION_COMATE_PLUS_DRAW_CHAT_APPEND = "COMATE_PLUS_DRAW_CHAT_APPEND";
|
|
3255
|
-
declare const ACTION_COMATE_PLUS_DRAW_CHAT_FINISH = "COMATE_PLUS_DRAW_CHAT_FINISH";
|
|
3256
|
-
declare const ACTION_COMATE_PLUS_DRAW_CHAT_FAIL = "COMATE_PLUS_DRAW_CHAT_FAIL";
|
|
3257
|
-
declare const ACTION_COMATE_PLUS_REQUEST_PERMISSION = "REQUEST_PERMISSION";
|
|
3258
|
-
declare const ACTION_COMATE_PLUS_QUERY_SELECTOR = "COMATE_PLUS_QUERY_SELECTOR";
|
|
3259
|
-
declare const ACTION_USER_DETAIL = "USER_DETAIL";
|
|
3260
|
-
declare const ACTION_COMATE_PLUS_INITIALIZED = "COMATE_PLUS_INITIALIZED";
|
|
3261
|
-
declare const ACTION_ENGINE_PROCESS_START_SUCCESS = "ENGINE_PROCESS_START_SUCCESS";
|
|
3262
|
-
declare const ACTION_USER_DETAIL_ERROR = "USER_DETAIL_ERROR";
|
|
3263
|
-
declare const ACTION_COMATE_PLUS_AGENT_NOTIFICATION = "COMATE_PLUS_AGENT_NOTIFICATION";
|
|
3264
|
-
declare const ACTION_COMATE_LSP_WORKSPACE_FOLDERS = "COMATE_LSP_WORKSPACE_FOLDERS";
|
|
3265
|
-
declare const ACTION_COMATE_LSP_REMOTE_CONSOLE = "COMATE_LSP_REMOTE_CONSOLE";
|
|
3266
|
-
declare const ACTION_COMATE_PLUS_SECTION_CHAT_UPDATE = "COMATE_PLUS_SECTION_CHAT_UPDATE";
|
|
3267
|
-
declare const ACTION_COMATE_PLUS_RECREATE_INDEX = "COMATE_PLUS_RECREATE_INDEX";
|
|
3268
|
-
declare const ACTION_COMATE_PLUS_CODE_SEARCH = "COMATE_PLUS_CODE_SEARCH";
|
|
3269
|
-
declare const ACTION_COMATE_PLUS_BATCH_ACCEPT = "COMATE_PLUS_ACCEPT_DIR";
|
|
3270
|
-
declare const ACTION_COMATE_SMART_APPLY = "ACTION_COMATE_SMART_APPLY";
|
|
3271
|
-
declare const ACTION_COMATE_SMART_APPLY_CANCEL = "ACTION_COMATE_SMART_APPLY_CANCEL";
|
|
3272
|
-
declare const ACTION_CHAT_SESSION_LIST = "kernel/chatSession/list";
|
|
3273
|
-
declare const ACTION_CHAT_SESSION_SAVE = "kernel/chatSession/save";
|
|
3274
|
-
declare const ACTION_CHAT_SESSION_DELETE = "kernel/chatSession/delete";
|
|
3275
|
-
declare const ACTION_CHAT_SESSION_FIND = "kernel/chatSession/find";
|
|
3276
|
-
/** 获取全部智能体任务 */
|
|
3277
|
-
declare const ACTION_COMATE_GET_AGENT_TASKS = "COMATE_GET_AGENT_TASKS";
|
|
3278
|
-
/** 新增智能体任务 */
|
|
3279
|
-
declare const ACTION_COMATE_ADD_AGENT_TASK = "COMATE_ADD_AGENT_TASK";
|
|
3280
|
-
/** 设置某个智能体任务到前台 */
|
|
3281
|
-
declare const ACTION_COMATE_SET_FOREGROUND_TASK = "COMATE_SET_FOREGROUND_TASK";
|
|
3282
|
-
/** 更新前台智能体消息 */
|
|
3283
|
-
declare const ACTION_COMATE_UPDATE_AGENT_TASK_MESSAGES = "COMATE_UPDATE_AGENT_TASK_MESSAGES";
|
|
3284
|
-
declare const ACTION_COMPOSER = "ACTION_COMPOSER";
|
|
3285
|
-
/** Debug 智能体自定义事件 */
|
|
3286
|
-
declare const AGENT_DEBUG_CUSTOM_ACTION = "COMATE_AGENT_DEBUG_CUSTOM_ACTION";
|
|
3287
|
-
/** 增加缓存 */
|
|
3288
|
-
declare const ACTION_COMATE_ADD_CACHE = "COMATE_ADD_CACHE";
|
|
3289
|
-
/** 获取缓存数据 */
|
|
3290
|
-
declare const ACTION_COMATE_GET_CACHE = "COMATE_GET_CACHE";
|
|
3291
|
-
declare const ACTION_PROMPTTEMPLATE_LIST = "kernel/promptTemplate/list";
|
|
3292
|
-
declare const ACTION_PROMPTTEMPLATE_CREATE = "kernel/promptTemplate/create";
|
|
3293
|
-
declare const ACTION_PROMPTTEMPLATE_UPDATE = "kernel/promptTemplate/update";
|
|
3294
|
-
declare const ACTION_PROMPTTEMPLATE_DELETE = "kernel/promptTemplate/delete";
|
|
3295
|
-
/** 规则面板触发的操作的事件 */
|
|
3296
|
-
declare const RULE_PANEL_ACTION_EVENT = "RULE_PANEL_ACTION_EVENT";
|
|
3297
|
-
/** 更新规则面板界面的事件 */
|
|
3298
|
-
declare const UPDATE_RULE_PANEL_EVENT = "UPDATE_RULE_PANEL_EVENT";
|
|
3299
|
-
/** 获取持久存储的事件 */
|
|
3300
|
-
declare const PERSISTENT_STORAGE_EVENT = "PERSISTENT_STORAGE_EVENT";
|
|
3301
|
-
|
|
3302
|
-
declare const replacePathTextInMarkdown: (content: string, paths: string[]) => Promise<string>;
|
|
3303
|
-
interface Node {
|
|
3304
|
-
title: string;
|
|
3305
|
-
completed?: boolean;
|
|
3306
|
-
children: Node[];
|
|
3307
|
-
}
|
|
3308
|
-
declare const trimIllegalMarkdownTodo: (content: string) => string;
|
|
3309
|
-
/**
|
|
3310
|
-
* 将 Markdown 字符串转换成树结构
|
|
3311
|
-
* @param content markdown 字符串
|
|
3312
|
-
* @param depthLimit 遍历深度,如果保留2级,就传2,不传就是递归到底
|
|
3313
|
-
* @returns
|
|
3314
|
-
*/
|
|
3315
|
-
declare const extractListFromMarkdown: (content: string, depthLimit?: number) => Node[];
|
|
3316
|
-
/**
|
|
3317
|
-
* 正则匹配 markdown 中的 code-blocks 并返回所有代码块中的内容
|
|
3318
|
-
*/
|
|
3319
|
-
declare function extractCodeBlocks(markdown: string): Promise<{
|
|
3320
|
-
content: string;
|
|
3321
|
-
lang: string;
|
|
3322
|
-
}[]>;
|
|
3323
|
-
declare function replaceFilePathInCodeSpan(markdown: string, absolutePaths: string[]): Promise<string>;
|
|
3324
|
-
|
|
3325
|
-
/**
|
|
3326
|
-
* vpcConfig字段不为空且status=true时,表明license所在企业为vpc环境部署,此时需要将endpoint字段设置为插件端访问的endpoint
|
|
3327
|
-
* status=true时,若intranetDomain字段不为空,那么在涉及autowork相关功能使用时需要进行内网环境校验,
|
|
3328
|
-
* 该字段内容为一个域名,具体校验方式为解析该域名,若解析得到的ip属于intranetSubnets列表中的任一个子网,
|
|
3329
|
-
* 则说明用户处于内网环境,用户可继续进行操作,否则说明不在内网环境,此时展示报错信息intranetErrorMsg
|
|
3330
|
-
*/
|
|
3331
|
-
interface LicenseFullDetail {
|
|
3332
|
-
key: string;
|
|
3333
|
-
typeId: number;
|
|
3334
|
-
typeCode: 'INDIVIDUAL' | 'TRIAL_INDIVIDUAL' | 'ENTERPRISE' | 'TRIAL_ENTERPRISE' | 'PLUS_ENTERPRISE' | 'PRO_ENTERPRISE' | 'PRIVATE_ENTERPRISE';
|
|
3335
|
-
type: string;
|
|
3336
|
-
customized: boolean;
|
|
3337
|
-
customizedUrl: string;
|
|
3338
|
-
orgId?: string;
|
|
3339
|
-
vpcConfig: {
|
|
3340
|
-
status: boolean;
|
|
3341
|
-
endpoint: string;
|
|
3342
|
-
intranetDomain: string;
|
|
3343
|
-
intranetSubnets: string[];
|
|
3344
|
-
intranetErrorMsg: string;
|
|
3345
|
-
};
|
|
3346
|
-
features: {
|
|
3347
|
-
enableUploadKnowledgeFromIDE: boolean;
|
|
3348
|
-
customFeedbackURL: string;
|
|
3349
|
-
};
|
|
3350
|
-
commonConfig: {
|
|
3351
|
-
diffTrackerRateSeconds: number;
|
|
3352
|
-
effectiveInputLines: number;
|
|
3353
|
-
uploadFilesBranchChangeMonitoringInterval: number;
|
|
3354
|
-
gitPollingInterval?: number;
|
|
3355
|
-
};
|
|
3356
|
-
}
|
|
3357
|
-
declare function getUserLicenseType(license: string): Promise<LicenseFullDetail>;
|
|
3358
|
-
|
|
3359
|
-
interface NotificationMessage {
|
|
3360
|
-
type: 'error' | 'info' | 'warning';
|
|
3361
|
-
reason: string;
|
|
3362
|
-
}
|
|
3363
|
-
|
|
3364
|
-
interface Option {
|
|
3365
|
-
eol: string;
|
|
3366
|
-
/** 设置为`true`时,只要diff行遍历结束,就立刻返回内容,不生成全部的代码 */
|
|
3367
|
-
returnContentWhenDiffLineLoopFinish?: boolean;
|
|
3368
|
-
/** 设置为`true`时,匹配行时忽略缩进 */
|
|
3369
|
-
skipIndentWhenMatchDiffLine?: boolean;
|
|
3370
|
-
throwErrorWhenLineCanNotMathced?: boolean;
|
|
3371
|
-
}
|
|
3372
|
-
/**
|
|
3373
|
-
* 将 diff 应用到原始内容上, 生成新的内容,具体可看测试用例
|
|
3374
|
-
* @param originalContent 原始内容
|
|
3375
|
-
* @param diffWithoutLineSeq diff 内容,但是没有行序号,起止的标识 `@@ ... @@`
|
|
3376
|
-
*/
|
|
3377
|
-
declare function applyDiff(originalContent: string, diffWithoutLineSeq: string, opts: Option): string;
|
|
3378
|
-
|
|
3379
|
-
/**
|
|
3380
|
-
* 找到代码块在原内容中的起始行号
|
|
3381
|
-
* @param codeChunk 代码块
|
|
3382
|
-
* @param originalContent 原代码块
|
|
3383
|
-
* @returns
|
|
3384
|
-
*/
|
|
3385
|
-
declare const findCodeChunkStartLineIndex: (codeChunk: string, originalContent: string) => number;
|
|
3386
|
-
declare const fixUdiffLineMarker: (diff: string, originalContent: string) => string;
|
|
3387
|
-
|
|
3388
|
-
interface ParsedPatch {
|
|
3389
|
-
search: string[];
|
|
3390
|
-
replace: string[];
|
|
3391
|
-
}
|
|
3392
|
-
declare class PatchFileDelimiterError extends Error {
|
|
3393
|
-
constructor(reason: string);
|
|
3394
|
-
}
|
|
3395
|
-
declare class PatchContentConflictError extends Error {
|
|
3396
|
-
private readonly failedPatchIndex;
|
|
3397
|
-
constructor(failedPatchIndex: number);
|
|
3398
|
-
get result(): {
|
|
3399
|
-
failedPatchIndex: number;
|
|
3400
|
-
};
|
|
3401
|
-
}
|
|
3402
|
-
interface Opts {
|
|
3403
|
-
/** 是否流式,流式过程中只会做简单的搜索替换,结束或会做更详细的相似度匹配 */
|
|
3404
|
-
stream?: boolean;
|
|
3405
|
-
/** 是否忽略最后一个补丁块缺少的 END 分隔符 */
|
|
3406
|
-
ignoreLastEndDelimiter?: boolean;
|
|
3407
|
-
cache?: {
|
|
3408
|
-
finishedPatchIndex: number;
|
|
3409
|
-
diff: {
|
|
3410
|
-
added: number;
|
|
3411
|
-
removed: number;
|
|
3412
|
-
};
|
|
3413
|
-
patchedContent: string;
|
|
3414
|
-
};
|
|
3415
|
-
}
|
|
3416
|
-
declare class SearchReplacePatchError extends Error {
|
|
3417
|
-
readonly patchIndex: number;
|
|
3418
|
-
readonly patches: ParsedPatch[];
|
|
3419
|
-
readonly content: string;
|
|
3420
|
-
result: {
|
|
3421
|
-
failedPatchIndex: number;
|
|
3422
|
-
patches: ParsedPatch[];
|
|
3423
|
-
similiarBlock: string;
|
|
3424
|
-
similarity: number | undefined;
|
|
3425
|
-
};
|
|
3426
|
-
constructor(patchIndex: number, patches: ParsedPatch[], content: string);
|
|
3427
|
-
private getResult;
|
|
3428
|
-
}
|
|
3429
|
-
/**
|
|
3430
|
-
* 1. 去除检索时,模型多生成行首换行
|
|
3431
|
-
* 2. 增加模型生成时,行不完整的匹配
|
|
3432
|
-
* 3. 增加通过匹配首尾行收窄范围的匹配
|
|
3433
|
-
* 4. 增加相似度 n+4 行的相似度匹配
|
|
3434
|
-
* 5. 以上策略均为匹配时,返回修改失败,并提供最相似代码上下2行代码,进行二次修改
|
|
3435
|
-
*/
|
|
3436
|
-
declare const applySearchReplaceChunk: (originalContent: string, searchReplaceChunk: string, opts?: Opts) => {
|
|
3437
|
-
diff: {
|
|
3438
|
-
added: number;
|
|
3439
|
-
removed: number;
|
|
3440
|
-
};
|
|
3441
|
-
error: any;
|
|
3442
|
-
patchedContent: any;
|
|
3443
|
-
patches: ParsedPatch[];
|
|
3444
|
-
missingEndDelimiter: boolean;
|
|
3445
|
-
};
|
|
3446
|
-
|
|
3447
|
-
declare const DEFAULT_WORKSPACE_MEMORY_FILE = "memory.json";
|
|
3448
|
-
/**
|
|
3449
|
-
* Memory数据结构
|
|
3450
|
-
*/
|
|
3451
|
-
interface Memory {
|
|
3452
|
-
/** 唯一标识 */
|
|
3453
|
-
memory_id: string;
|
|
3454
|
-
/** 记忆主题 */
|
|
3455
|
-
topic: string;
|
|
3456
|
-
/** 记忆内容 */
|
|
3457
|
-
memory_to_store: string;
|
|
3458
|
-
}
|
|
3459
|
-
declare const MemorySchema: {
|
|
3460
|
-
type: string;
|
|
3461
|
-
items: {
|
|
3462
|
-
type: string;
|
|
3463
|
-
properties: {
|
|
3464
|
-
topic: {
|
|
3465
|
-
type: string;
|
|
3466
|
-
};
|
|
3467
|
-
memory_id: {
|
|
3468
|
-
type: string;
|
|
3469
|
-
};
|
|
3470
|
-
memory_to_store: {
|
|
3471
|
-
type: string;
|
|
3472
|
-
};
|
|
3473
|
-
};
|
|
3474
|
-
required: string[];
|
|
3475
|
-
};
|
|
3476
|
-
};
|
|
3477
|
-
declare const MEMORY_FORMAT_VALIDATION_TOOLTIP_FOR_API = " \u6587\u4EF6JSON\u683C\u5F0F\u6821\u9A8C\u5931\u8D25\uFF0C\u8BF7\u786E\u4FDD\u4F7F\u7528\u6B63\u786E\u7684JSON\u6570\u7EC4\u683C\u5F0F\u4E14\u5305\u542B\u5FC5\u9700\u7684\u5B57\u6BB5\u3002\n\n\u8BF7\u6309\u7167\u4EE5\u4E0B\u6807\u51C6\u683C\u5F0F\u4FEE\u6539\uFF1A\n\n1. \u5FC5\u987B\u662F\u6709\u6548\u7684JSON\u6570\u7EC4\u683C\u5F0F\n2. \u6BCF\u4E2Amemory\u5BF9\u8C61\u5FC5\u987B\u5305\u542B\u4EE5\u4E0B\u5B57\u6BB5\uFF1A\n - \"topic\": string (\u9009\u586B\uFF0C\u8BB0\u5FC6\u4E3B\u9898)\n - \"memory_to_store\": string (\u5FC5\u586B\uFF0C\u8BB0\u5FC6\u5185\u5BB9)\n - \"memory_id\": string (\u5FC5\u586B\uFF0C4\u4F4D\u5341\u516D\u8FDB\u5236\u5B57\u7B26\uFF0C\u5982\uFF1A\"3eb6\")\n\n\u6B63\u786E\u683C\u5F0F\u793A\u4F8B\uFF1A\n[\n {\n \"topic\": \"\u56DE\u7B54\u8BED\u8A00\u504F\u597D\",\n \"memory_to_store\": \"\u7528\u6237\u8981\u6C42\u6240\u6709\u56DE\u7B54\u90FD\u7528\u4E2D\u82F1\u6587\u5404\u56DE\u7B54\u4E00\u6B21\",\n \"memory_id\": \"3eb6\"\n },\n {\n \"topic\": \"\u4EE3\u7801\u98CE\u683C\u504F\u597D\",\n \"memory_to_store\": \"\u7528\u6237\u504F\u597D\u4F7F\u75284\u7A7A\u683C\u7F29\u8FDB\u548C\u9A7C\u5CF0\u547D\u540D\u6CD5\",\n \"memory_id\": \"a1f2\"\n }\n]\n\n\u5E38\u89C1\u9519\u8BEF\uFF1A\n- JSON\u8BED\u6CD5\u9519\u8BEF\uFF08\u7F3A\u5C11\u5F15\u53F7\u3001\u9017\u53F7\u3001\u62EC\u53F7\u7B49\uFF09\n- \u7F3A\u5C11\u5FC5\u9700\u5B57\u6BB5\n- memory_id\u683C\u5F0F\u4E0D\u6B63\u786E\uFF08\u5E94\u4E3A4\u4F4D\u5341\u516D\u8FDB\u5236\u5B57\u7B26\uFF09\n- \u6570\u636E\u7C7B\u578B\u4E0D\u5339\u914D\uFF08\u5982\u6570\u5B57\u4EE3\u66FF\u5B57\u7B26\u4E32\uFF09\n\n\u8BF7\u68C0\u67E5\u5E76\u4FEE\u6B63JSON\u683C\u5F0F\u540E\u91CD\u8BD5\u3002";
|
|
3478
|
-
declare const MEMORY_FORMAT_VALIDATION_TOOLTIP_FOR_WEBVIEW = " \u6587\u4EF6JSON\u683C\u5F0F\u6821\u9A8C\u5931\u8D25\uFF0C\u6B63\u786E\u683C\u5F0F\u793A\u4F8B\uFF1A\n[\n {\n \"topic\": \"\u56DE\u7B54\u8BED\u8A00\u504F\u597D\",\n \"memory_to_store\": \"\u7528\u6237\u8981\u6C42\u6240\u6709\u56DE\u7B54\u90FD\u7528\u4E2D\u82F1\u6587\u5404\u56DE\u7B54\u4E00\u6B21\",\n \"memory_id\": \"3eb6\"\n },\n {\n \"topic\": \"\u4EE3\u7801\u98CE\u683C\u504F\u597D\",\n \"memory_to_store\": \"\u7528\u6237\u504F\u597D\u4F7F\u75284\u7A7A\u683C\u7F29\u8FDB\u548C\u9A7C\u5CF0\u547D\u540D\u6CD5\",\n \"memory_id\": \"a1f2\"\n }\n]\n";
|
|
3479
|
-
declare const MEMORY_FORMAT_ERROR_CAUSE = "MEMORY_FORMAT_ERROR_CAUSE";
|
|
3480
|
-
|
|
3481
|
-
interface FigmaSelection {
|
|
3482
|
-
files: FigmaFileItem[];
|
|
3483
|
-
name: string;
|
|
3484
|
-
thumbnail: string;
|
|
3485
|
-
url: string;
|
|
3486
|
-
}
|
|
3487
|
-
interface FigmaFileItem {
|
|
3488
|
-
content: string;
|
|
3489
|
-
path: string;
|
|
3490
|
-
}
|
|
3491
|
-
|
|
3492
|
-
declare const DEFAULT_WORKSPACE_CONFIG_FOLDER = ".comate";
|
|
3493
|
-
declare const DEFAULT_RULE_CONFIG_FOLDER = "rules";
|
|
3494
|
-
declare const DEFAULT_WORKSPACE_RULE_FILE = "default.mdr";
|
|
3495
|
-
interface RuleMetadata {
|
|
3496
|
-
description?: string;
|
|
3497
|
-
globs?: string;
|
|
3498
|
-
alwaysApply?: boolean;
|
|
3499
|
-
}
|
|
3500
|
-
interface RuleItem {
|
|
3501
|
-
name: string;
|
|
3502
|
-
/** 相对路径:workspace rules 相对于 workspaceRoot,personal rules 相对于 ~/.comate */
|
|
3503
|
-
path: string;
|
|
3504
|
-
metadata: RuleMetadata;
|
|
3505
|
-
firstLine: string;
|
|
3506
|
-
scope: 'personal' | 'workspace';
|
|
3507
|
-
}
|
|
3508
|
-
interface RulePanelActionParamsMap {
|
|
3509
|
-
getRuleList: Record<string, never>;
|
|
3510
|
-
createRule: {
|
|
3511
|
-
name: string;
|
|
3512
|
-
metadata?: RuleMetadata;
|
|
3513
|
-
scope?: 'personal' | 'workspace';
|
|
3514
|
-
};
|
|
3515
|
-
deleteRule: {
|
|
3516
|
-
path: string;
|
|
3517
|
-
scope?: 'personal' | 'workspace';
|
|
3518
|
-
};
|
|
3519
|
-
updateRule: {
|
|
3520
|
-
path: string;
|
|
3521
|
-
name: string;
|
|
3522
|
-
metadata: RuleMetadata;
|
|
3523
|
-
scope?: 'personal' | 'workspace';
|
|
3524
|
-
};
|
|
3525
|
-
openRuleFile: {
|
|
3526
|
-
path: string;
|
|
3527
|
-
scope?: 'personal' | 'workspace';
|
|
3528
|
-
};
|
|
3529
|
-
isRuleNameExist: {
|
|
3530
|
-
name: string;
|
|
3531
|
-
};
|
|
3532
|
-
checkFilePatternMatch: {
|
|
3533
|
-
globs: string;
|
|
3534
|
-
};
|
|
3535
|
-
}
|
|
3536
|
-
type RulePanelAction = keyof RulePanelActionParamsMap;
|
|
3537
|
-
declare function extractMentionFilesFromRuleConfig(content: string): {
|
|
3538
|
-
files: string[];
|
|
3539
|
-
matches: RegExpMatchArray[];
|
|
3540
|
-
};
|
|
3541
|
-
|
|
3542
|
-
interface DocumentPosition {
|
|
3543
|
-
line: number;
|
|
3544
|
-
column: number;
|
|
3545
|
-
}
|
|
3546
|
-
interface ChunkSelection {
|
|
3547
|
-
start: DocumentPosition;
|
|
3548
|
-
end: DocumentPosition;
|
|
3549
|
-
}
|
|
3550
|
-
interface VirtualDocument {
|
|
3551
|
-
existed: boolean;
|
|
3552
|
-
content: string;
|
|
3553
|
-
absolutePath: string;
|
|
3554
|
-
scheme?: 'file' | 'diff';
|
|
3555
|
-
isDirty?: boolean;
|
|
3556
|
-
isPreview?: boolean;
|
|
3557
|
-
selections?: ChunkSelection[];
|
|
3558
|
-
}
|
|
3559
|
-
interface ReplaceVirtualDiffDocumentParams {
|
|
3560
|
-
absolutePath: string;
|
|
3561
|
-
content: string;
|
|
3562
|
-
stream: boolean;
|
|
3563
|
-
scrollToLine?: number;
|
|
3564
|
-
elementId?: string;
|
|
3565
|
-
source: string;
|
|
3566
|
-
conversationId?: string;
|
|
3567
|
-
}
|
|
3568
|
-
interface DebugCommandResult {
|
|
3569
|
-
status: 'success' | 'error' | 'fail' | 'timeout' | 'unknown' | 'killed';
|
|
3570
|
-
matchError?: string;
|
|
3571
|
-
}
|
|
3572
|
-
declare enum VirtualDocumentAction {
|
|
3573
|
-
EDIT = "edit",
|
|
3574
|
-
PREVIEW = "preview"
|
|
3575
|
-
}
|
|
3576
|
-
declare enum SpecEditorIconState {
|
|
3577
|
-
DEFAULT = "default",// 默认兜底,终止都是default
|
|
3578
|
-
LOADING = "loading",// 正在生成加载中
|
|
3579
|
-
PENDING = "pending",// 正在等待确认
|
|
3580
|
-
COMPLETED = "completed"
|
|
3581
|
-
}
|
|
3582
|
-
declare enum SpecEditorSessionStatus {
|
|
3583
|
-
/** 加载中/处理中 */
|
|
3584
|
-
Loading = "loading",
|
|
3585
|
-
/** 等待确认 */
|
|
3586
|
-
Pending = "pending",
|
|
3587
|
-
/** 已完成 */
|
|
3588
|
-
Completed = "completed",
|
|
3589
|
-
/** 失败 */
|
|
3590
|
-
Error = "error"
|
|
3591
|
-
}
|
|
3592
|
-
interface SpecSessionWithStatus {
|
|
3593
|
-
sessionUuid: string;
|
|
3594
|
-
specSessionId?: string;
|
|
3595
|
-
title: string;
|
|
3596
|
-
ctime: number;
|
|
3597
|
-
utime: number;
|
|
3598
|
-
status: SpecEditorSessionStatus;
|
|
3599
|
-
}
|
|
3600
|
-
declare enum SpecEditorTabType {
|
|
3601
|
-
DOC = "doc",
|
|
3602
|
-
TASKS = "tasks",
|
|
3603
|
-
SUMMARY = "summary",
|
|
3604
|
-
CHANGES = "changes"
|
|
3605
|
-
}
|
|
3606
|
-
declare enum SpecEditorTabStatus {
|
|
3607
|
-
LOADING = "loading",
|
|
3608
|
-
WAIT_CONFIRM = "waitConfirm",
|
|
3609
|
-
END = "end",
|
|
3610
|
-
COMPLETED = "completed"
|
|
3611
|
-
}
|
|
3612
|
-
interface SpecEditorDiff {
|
|
3613
|
-
absolutePath: string;
|
|
3614
|
-
source: string;
|
|
3615
|
-
content: string;
|
|
3616
|
-
}
|
|
3617
|
-
interface SpecEditorTabDetail {
|
|
3618
|
-
status?: SpecEditorTabStatus;
|
|
3619
|
-
path?: string;
|
|
3620
|
-
}
|
|
3621
|
-
interface SpecEditorChangesTabDetail {
|
|
3622
|
-
status?: SpecEditorTabStatus;
|
|
3623
|
-
diffInfo?: SpecEditorDiff[];
|
|
3624
|
-
}
|
|
3625
|
-
interface SpecEditorTabInfo {
|
|
3626
|
-
doc: SpecEditorTabDetail;
|
|
3627
|
-
tasks: SpecEditorTabDetail;
|
|
3628
|
-
changes: SpecEditorChangesTabDetail;
|
|
3629
|
-
summary: SpecEditorTabDetail;
|
|
3630
|
-
preview?: {
|
|
3631
|
-
path?: string;
|
|
3632
|
-
};
|
|
3633
|
-
}
|
|
3634
|
-
interface ExecuteTerminalShellParams {
|
|
3635
|
-
cmd: string;
|
|
3636
|
-
cwd?: string;
|
|
3637
|
-
duration?: number;
|
|
3638
|
-
run?: boolean;
|
|
3639
|
-
/** 运行前生成的标识 ID 终止任务时传给 IDE 找到对应 terminal */
|
|
3640
|
-
commandId?: string;
|
|
3641
|
-
}
|
|
3642
|
-
declare class VirtualEditor {
|
|
3643
|
-
private readonly config;
|
|
3644
|
-
static event: string;
|
|
3645
|
-
protected readonly promiseMap: Map<string, (res: any) => void>;
|
|
3646
|
-
/** 这个 resolver 可以多次调用,是否结束并删除由 resolver 决定,返回 true 表示结束,返回 false 表示继续监听 */
|
|
3647
|
-
protected readonly customResolverMap: Map<string, (res: any) => boolean>;
|
|
3648
|
-
constructor(config: {
|
|
3649
|
-
send: (event: string, args: any, opts?: {
|
|
3650
|
-
skipWriteLog?: boolean;
|
|
3651
|
-
}) => Promise<any>;
|
|
3652
|
-
logger: {
|
|
3653
|
-
verbose: (...args: any) => void;
|
|
3654
|
-
};
|
|
3655
|
-
});
|
|
3656
|
-
resolve({ uuid, ...res }: {
|
|
3657
|
-
uuid: string;
|
|
3658
|
-
}): void;
|
|
3659
|
-
/**
|
|
3660
|
-
* 打开一个指定绝对路径的文档,如果文档存在,右侧文件区域第一列会打开Tab并激活
|
|
3661
|
-
*/
|
|
3662
|
-
openDocument(params: {
|
|
3663
|
-
absolutePath: string;
|
|
3664
|
-
selection?: ChunkSelection;
|
|
3665
|
-
}): Promise<void>;
|
|
3666
|
-
/**
|
|
3667
|
-
* 打开 Plan 文档编辑器(仅 Comate IDE)
|
|
3668
|
-
*/
|
|
3669
|
-
openPlanDocument(params: {
|
|
3670
|
-
filePath: string;
|
|
3671
|
-
conversationId: string;
|
|
3672
|
-
status: string;
|
|
3673
|
-
isOpen: boolean;
|
|
3674
|
-
toolId: string;
|
|
3675
|
-
}): Promise<void>;
|
|
3676
|
-
/**
|
|
3677
|
-
* 关闭 Plan 文档编辑器(仅 Comate IDE)
|
|
3678
|
-
*/
|
|
3679
|
-
closePlanDocument(params: {
|
|
3680
|
-
conversationId: string;
|
|
3681
|
-
toolId: string;
|
|
3682
|
-
}): Promise<void>;
|
|
3683
|
-
/**
|
|
3684
|
-
* 关闭一个指定绝对路径的文档Tab
|
|
3685
|
-
*/
|
|
3686
|
-
closeDocument(params: {
|
|
3687
|
-
absolutePath: string;
|
|
3688
|
-
}): Promise<void>;
|
|
3689
|
-
/**
|
|
3690
|
-
* 删除一个指定绝对路径的文档
|
|
3691
|
-
*/
|
|
3692
|
-
deleteDocument(params: {
|
|
3693
|
-
absolutePath: string;
|
|
3694
|
-
}): Promise<void>;
|
|
3695
|
-
/**
|
|
3696
|
-
* 刷新文件树(只用于JetBrains)
|
|
3697
|
-
*/
|
|
3698
|
-
refreshProjectTree(): Promise<void>;
|
|
3699
|
-
/**
|
|
3700
|
-
* 获取右侧光标所在的文档Tab, 返回绝对路径、内容、scheme,如果未打开任何文档,existed为false
|
|
3701
|
-
*/
|
|
3702
|
-
getActiveDocument(): Promise<VirtualDocument>;
|
|
3703
|
-
/**
|
|
3704
|
-
* 获取指定绝对路径的文档, 返回绝对路径、内容、如果文档不存在,existed为false
|
|
3705
|
-
*/
|
|
3706
|
-
getDocument(params: {
|
|
3707
|
-
absolutePath: string;
|
|
3708
|
-
}): Promise<VirtualDocument>;
|
|
3709
|
-
/**
|
|
3710
|
-
* 在编辑区打开一个Diff视图,并填充左右的内容,左侧diff文件的来源路径为absolutePath, 左侧基准文件不可编辑
|
|
3711
|
-
*/
|
|
3712
|
-
openVirtualDiffDocument(params: {
|
|
3713
|
-
absolutePath: string;
|
|
3714
|
-
content: string;
|
|
3715
|
-
modified: string;
|
|
3716
|
-
elementId?: string;
|
|
3717
|
-
conversationId?: string;
|
|
3718
|
-
source: string;
|
|
3719
|
-
action: VirtualDocumentAction;
|
|
3720
|
-
/** 是否展示采纳的按钮 */
|
|
3721
|
-
acceptable?: boolean;
|
|
3722
|
-
stream?: boolean;
|
|
3723
|
-
}): Promise<void>;
|
|
3724
|
-
/**
|
|
3725
|
-
* 以文件绝对路径为索引,关闭一个Diff视图
|
|
3726
|
-
*/
|
|
3727
|
-
closeVirtualDiffDocument(params: {
|
|
3728
|
-
absolutePath: string;
|
|
3729
|
-
}): Promise<void>;
|
|
3730
|
-
/**
|
|
3731
|
-
* 以全文替换的方式,更新diff视图右侧的文件内容,如果Diff不存在,则无效果
|
|
3732
|
-
*/
|
|
3733
|
-
replaceVirtualDiffModifiedDocument(params: ReplaceVirtualDiffDocumentParams): Promise<void>;
|
|
3734
|
-
/**
|
|
3735
|
-
* 获取以绝对路径为索引的diff视图右侧最新的内容,如果不存在,则existed为false
|
|
3736
|
-
*/
|
|
3737
|
-
getVirtualDiffDocument(params: {
|
|
3738
|
-
absolutePath: string;
|
|
3739
|
-
}): Promise<VirtualDocument>;
|
|
3740
|
-
/**
|
|
3741
|
-
* 以全文替换的形式,覆盖指定绝对路径的文件并保存
|
|
3742
|
-
*/
|
|
3743
|
-
saveDocumentWithReplaceContent(params: {
|
|
3744
|
-
absolutePath: string;
|
|
3745
|
-
content: string;
|
|
3746
|
-
source?: string;
|
|
3747
|
-
}): Promise<any>;
|
|
3748
|
-
/**
|
|
3749
|
-
* 以全文替换的形式,覆盖指定绝对路径的文件并保存并打开文件
|
|
3750
|
-
*/
|
|
3751
|
-
saveDocumentWithReplaceContentAndOpen(params: {
|
|
3752
|
-
absolutePath: string;
|
|
3753
|
-
content: string;
|
|
3754
|
-
source?: string;
|
|
3755
|
-
}): Promise<any>;
|
|
3756
|
-
/**
|
|
3757
|
-
* 静默保存文件,不会打开或显示文档,直接在后台写入文件内容
|
|
3758
|
-
*/
|
|
3759
|
-
saveDocumentSilently(params: {
|
|
3760
|
-
absolutePath: string;
|
|
3761
|
-
content: string;
|
|
3762
|
-
source?: string;
|
|
3763
|
-
}): Promise<any>;
|
|
3764
|
-
executeTerminalShell(params: ExecuteTerminalShellParams, onUpdate?: (result: {
|
|
3765
|
-
output: string;
|
|
3766
|
-
}) => void): Promise<{
|
|
3767
|
-
completed: boolean;
|
|
3768
|
-
output: string;
|
|
3769
|
-
isEnd?: boolean;
|
|
3770
|
-
failed?: boolean;
|
|
3771
|
-
exitCode?: number;
|
|
3772
|
-
}>;
|
|
3773
|
-
/**
|
|
3774
|
-
* 执行 Debug 智能体的特殊命令,并对结果进行 Debug 分析(解析的逻辑没挪到 kernel 只能现在 IDE 处理了)
|
|
3775
|
-
* vscode 里边是执行一个特殊的 terminal 命令(pty是自定义的)
|
|
3776
|
-
* jetbrains 是执行的 IDE 调试指令
|
|
3777
|
-
*/
|
|
3778
|
-
executeDebugCommand(params: {
|
|
3779
|
-
cmd: string;
|
|
3780
|
-
cwd: string;
|
|
3781
|
-
duration?: number;
|
|
3782
|
-
}): Promise<DebugCommandResult>;
|
|
3783
|
-
/**
|
|
3784
|
-
* 获取当前激活的终端,最新一条输出, 任何其余情况,都将output设置为空返回
|
|
3785
|
-
*/
|
|
3786
|
-
getLatestOutputFromActiveTerminal(): Promise<{
|
|
3787
|
-
output: string;
|
|
3788
|
-
}>;
|
|
3789
|
-
openUrlInEditorWebview(params: {
|
|
3790
|
-
url: string;
|
|
3791
|
-
title: string;
|
|
3792
|
-
image?: boolean;
|
|
3793
|
-
}): Promise<void>;
|
|
3794
|
-
endConversationEditSession(params: {
|
|
3795
|
-
conversationId: string;
|
|
3796
|
-
}): Promise<void>;
|
|
3797
|
-
startConversationEditSession(params: {
|
|
3798
|
-
conversationId: string;
|
|
3799
|
-
source: AgentConversationType;
|
|
3800
|
-
}): Promise<void>;
|
|
3801
|
-
getDocumentDiagnostics(params: {
|
|
3802
|
-
absolutePath: string;
|
|
3803
|
-
elementId?: string;
|
|
3804
|
-
conversationId?: string;
|
|
3805
|
-
}): Promise<{
|
|
3806
|
-
originalDiagnostics?: any[];
|
|
3807
|
-
modifiedDiagnostics?: any[];
|
|
3808
|
-
fileDiagnostics?: any[];
|
|
3809
|
-
}>;
|
|
3810
|
-
/**
|
|
3811
|
-
* 终止正在执行的 terminal 命令
|
|
3812
|
-
*/
|
|
3813
|
-
stopTerminalShellCommand(params: {
|
|
3814
|
-
commandId: string;
|
|
3815
|
-
}): Promise<{}>;
|
|
3816
|
-
/**
|
|
3817
|
-
* 显示系统级别通知
|
|
3818
|
-
* @param notificationId 通知的唯一标识符
|
|
3819
|
-
* @param options 通知选项
|
|
3820
|
-
*/
|
|
3821
|
-
showSystemNotification(params: {
|
|
3822
|
-
notificationId: string;
|
|
3823
|
-
options: {
|
|
3824
|
-
title: string;
|
|
3825
|
-
body: string;
|
|
3826
|
-
severity?: number;
|
|
3827
|
-
silent?: boolean;
|
|
3828
|
-
playSound?: boolean;
|
|
3829
|
-
};
|
|
3830
|
-
}): Promise<void>;
|
|
3831
|
-
private sendToIDE;
|
|
3832
|
-
private withReceivePromise;
|
|
3833
|
-
private withReceiveEndPromise;
|
|
3834
|
-
}
|
|
3835
|
-
type VirtualEditMethod = Exclude<keyof VirtualEditor, 'resolve'>;
|
|
3836
|
-
type VirtualEditorMethodCall = {
|
|
3837
|
-
[K in keyof VirtualEditor as VirtualEditor[K] extends Function ? K : never]: {
|
|
3838
|
-
action: K;
|
|
3839
|
-
payload: Parameters<VirtualEditor[K]>[0] & {
|
|
3840
|
-
uuid: string;
|
|
3841
|
-
};
|
|
3842
|
-
response: ReturnType<VirtualEditor[K]>;
|
|
3843
|
-
};
|
|
3844
|
-
}[VirtualEditMethod];
|
|
3845
|
-
|
|
3846
|
-
/**
|
|
3847
|
-
* 统计由智能体写入的代码留存数据
|
|
3848
|
-
*/
|
|
3849
|
-
declare class CodeWrittenMetric {
|
|
3850
|
-
/**
|
|
3851
|
-
* 变更记录 Record<relativePath,{content: 文件内容, codeWrittenLineNums: 留存行数的所有版本,用于revert}>
|
|
3852
|
-
* codeWrittenLineNums 支持压缩格式:连续行号用 "start-end" 表示,如 [1, "5-8", 10] 表示 [1,5,6,7,8,10]
|
|
3853
|
-
*/
|
|
3854
|
-
private histories;
|
|
3855
|
-
/**
|
|
3856
|
-
* 生成行的内容, Record<relativePath, string[]>
|
|
3857
|
-
*/
|
|
3858
|
-
private generateLines;
|
|
3859
|
-
/**
|
|
3860
|
-
* 缓存,Record<fromHash, Record<toHash, number[]>>, 如果文件先采纳,再放弃,则逻辑为一次 agentEdit + 一次 userEdit
|
|
3861
|
-
*/
|
|
3862
|
-
private agentEditsCache;
|
|
3863
|
-
/**
|
|
3864
|
-
* 用户编辑的缓存,只需要记录回退到哪个节点即可,比如对于 A 文件,从任意编辑结果的分支节点回到历史版本,还原的留存行应该总是一样的
|
|
3865
|
-
*/
|
|
3866
|
-
private userEditsCache;
|
|
3867
|
-
get data(): {
|
|
3868
|
-
histories: Record<string, {
|
|
3869
|
-
content: string;
|
|
3870
|
-
codeWrittenLineNums: (string | number)[];
|
|
3871
|
-
lastModifiedTime: number;
|
|
3872
|
-
}>;
|
|
3873
|
-
generateLines: Record<string, string[]>;
|
|
3874
|
-
};
|
|
3875
|
-
/**
|
|
3876
|
-
* 将压缩的行号数组解析为完整的行号数组
|
|
3877
|
-
* @param compressedLines 压缩格式的行号数组,如 [1, "5-8", 10]
|
|
3878
|
-
* @returns 完整的行号数组,如 [1, 5, 6, 7, 8, 10]
|
|
3879
|
-
*/
|
|
3880
|
-
static parseLineNumbers(compressedLines: Array<number | string>): number[];
|
|
3881
|
-
/**
|
|
3882
|
-
* 将行号数组压缩为紧凑格式
|
|
3883
|
-
* @param lines 行号数组,如 [1, 5, 6, 7, 8, 10]
|
|
3884
|
-
* @returns 压缩格式的行号数组,如 [1, "5-8", 10]
|
|
3885
|
-
*/
|
|
3886
|
-
static compressLineNumbers(lines: number[]): Array<number | string>;
|
|
3887
|
-
isEmpty(data?: typeof this.data): boolean;
|
|
3888
|
-
init(data?: typeof this.data): void;
|
|
3889
|
-
/**
|
|
3890
|
-
* 计算由user/agent修改后的文件内容,最终AI生成的留存行数。如果新增/删除行在留存行之上,修正偏移行
|
|
3891
|
-
* @param originalContent 原始文件内容
|
|
3892
|
-
* @param modifiedContent 修改后的文件内容
|
|
3893
|
-
* @param writtenLineNum 上一次计算的留存行号
|
|
3894
|
-
* @param writtenType 是由用户写还是agent写,如果是用户写,则原新增行作为交集要剔除,如果是agent写,则新的新增行要推入
|
|
3895
|
-
* @returns
|
|
3896
|
-
*/
|
|
3897
|
-
computeCodeWrittenMetric(writtenLineNum: Array<number | string>, changes: Change[], writtenType: 'user' | 'agent'): (string | number)[];
|
|
3898
|
-
agentEdit(files: Array<{
|
|
3899
|
-
filePath: string;
|
|
3900
|
-
originalContent: string;
|
|
3901
|
-
modifiedContent: string;
|
|
3902
|
-
}>, opts?: {
|
|
3903
|
-
ignoreWhiteSpace: boolean;
|
|
3904
|
-
}): void;
|
|
3905
|
-
/**
|
|
3906
|
-
* 续写场景,仅传行号,因为文件内容会存在无关变更行,所以直接执行一次 userEdit 更新最新的内容,然后把 codeWrittenLineNums 插入对应的行号即可
|
|
3907
|
-
* @param files 行号从1开始
|
|
3908
|
-
*/
|
|
3909
|
-
completionEdit(file: {
|
|
3910
|
-
filePath: string;
|
|
3911
|
-
addLines: number[];
|
|
3912
|
-
deleteLines: number[];
|
|
3913
|
-
originalContent: string;
|
|
3914
|
-
modifiedContent: string;
|
|
3915
|
-
}): void;
|
|
3916
|
-
userEdit(files: Array<{
|
|
3917
|
-
filePath: string;
|
|
3918
|
-
originalContent: string;
|
|
3919
|
-
modifiedContent: string;
|
|
3920
|
-
}>, opts?: {
|
|
3921
|
-
ignoreWhiteSpace?: boolean;
|
|
3922
|
-
skipCache?: boolean;
|
|
3923
|
-
}): void;
|
|
3924
|
-
clear(filePaths?: string[]): void;
|
|
3925
|
-
}
|
|
3926
|
-
|
|
3927
|
-
/** 成功定位后的结果 */
|
|
3928
|
-
interface NarrowBlockResult {
|
|
3929
|
-
/** 起始行号(0-based,包含) */
|
|
3930
|
-
start: number;
|
|
3931
|
-
/** 结束行号(0-based,**不含**) */
|
|
3932
|
-
end: number;
|
|
3933
|
-
/** 提取出的完整代码块(以 \n 拼接) */
|
|
3934
|
-
block: string;
|
|
3935
|
-
}
|
|
3936
|
-
/**
|
|
3937
|
-
* 根据“从头/从尾逐行收窄”的策略,在 `content` 中定位与 `snippet`
|
|
3938
|
-
* 最相关的连续区段。
|
|
3939
|
-
*
|
|
3940
|
-
* - 当 `snippet` 行数 ≤ 2 时直接返回 `null`(规则失效)。
|
|
3941
|
-
* - 若首行或末行无法命中,也返回 `null`。
|
|
3942
|
-
*/
|
|
3943
|
-
declare function searchNarrowedCode(content: string, snippet: string): NarrowBlockResult | null;
|
|
3944
|
-
|
|
3945
|
-
/** 允许调用方自定义的可选参数 */
|
|
3946
|
-
interface FindClosestBlockOptions {
|
|
3947
|
-
/** 锚点行与目标首行之间允许的最大行距(默认 4) */
|
|
3948
|
-
maxLineGap?: number;
|
|
3949
|
-
/** 接受匹配结果的最低相似度阈值(默认 0.92) */
|
|
3950
|
-
threshold?: number;
|
|
3951
|
-
}
|
|
3952
|
-
/** 匹配结果 */
|
|
3953
|
-
interface MatchResult {
|
|
3954
|
-
/** 代码块在原文件中起止行号 */
|
|
3955
|
-
start: number;
|
|
3956
|
-
end: number;
|
|
3957
|
-
/** `stringSimilarity` 计算得到的分数 ∈ [0, 1] */
|
|
3958
|
-
score: number;
|
|
3959
|
-
/** 实际匹配到的代码片段 */
|
|
3960
|
-
block: string;
|
|
3961
|
-
}
|
|
3962
|
-
/**
|
|
3963
|
-
* 在给定代码文本 `content` 中查找与 `targetCode` 最相似的代码块。
|
|
3964
|
-
* @returns 当找到相似度 ≥ threshold 的片段时返回其信息;否则返回 null。
|
|
3965
|
-
*/
|
|
3966
|
-
declare function searchSimiliarCode(sourceCode: string, searchCodeSnippet: string, opts?: FindClosestBlockOptions): MatchResult | null;
|
|
3967
|
-
|
|
3968
|
-
declare const SUPPORTED_SUFFIX_CONFIG: Record<string, string[]>;
|
|
3969
|
-
declare const SUFFIX_LANG_MAP: Record<any, string>;
|
|
3970
|
-
|
|
3971
|
-
declare const ACTION_V8_SNAP_SHOT = "ACTION_V8_SNAP_SHOT";
|
|
3972
|
-
|
|
3973
|
-
/** Spec 会话状态 */
|
|
3974
|
-
type SpecSessionStatus = 'loading' | 'pending' | 'completed' | 'error';
|
|
3975
|
-
/** Spec 会话信息 */
|
|
3976
|
-
interface SpecSessionInfo {
|
|
3977
|
-
sessionUuid: string;
|
|
3978
|
-
specSessionId: string;
|
|
3979
|
-
title: string;
|
|
3980
|
-
ctime: number;
|
|
3981
|
-
utime: number;
|
|
3982
|
-
status: SpecSessionStatus;
|
|
3983
|
-
}
|
|
3984
|
-
/** Tab 类型 */
|
|
3985
|
-
type SpecTabType = 'doc' | 'tasks' | 'changes' | 'summary';
|
|
3986
|
-
/** Tab 状态枚举 */
|
|
3987
|
-
declare enum SpecTabStatus {
|
|
3988
|
-
IDLE = "idle",
|
|
3989
|
-
GENERATING = "generating",
|
|
3990
|
-
PENDING = "pending",
|
|
3991
|
-
QUEUED = "queued",
|
|
3992
|
-
EXECUTING = "executing",
|
|
3993
|
-
DONE = "done"
|
|
3994
|
-
}
|
|
3995
|
-
/** 文件 Diff 信息 */
|
|
3996
|
-
interface SpecDiff {
|
|
3997
|
-
absolutePath: string;
|
|
3998
|
-
source: string;
|
|
3999
|
-
content: string;
|
|
4000
|
-
}
|
|
4001
|
-
/** 图标状态枚举 */
|
|
4002
|
-
declare enum SpecIconState {
|
|
4003
|
-
GENERATING = "generating",
|
|
4004
|
-
PENDING = "pending",
|
|
4005
|
-
CANCELLED = "cancelled",
|
|
4006
|
-
ERROR = "error",
|
|
4007
|
-
COMPLETED = "completed"
|
|
4008
|
-
}
|
|
4009
|
-
/** 任务执行记录 */
|
|
4010
|
-
interface SpecTaskRecord {
|
|
4011
|
-
userMessageId: string;
|
|
4012
|
-
tasks: string[];
|
|
4013
|
-
}
|
|
4014
|
-
/** 回滚文件信息 */
|
|
4015
|
-
interface SpecRollbackFileInfo {
|
|
4016
|
-
relativePath: string;
|
|
4017
|
-
absolutePath: string;
|
|
4018
|
-
action: 'willCreate' | 'willDelete' | 'willChange';
|
|
4019
|
-
selected?: boolean;
|
|
4020
|
-
conflict?: boolean;
|
|
4021
|
-
}
|
|
4022
|
-
/** Tab 详情信息 */
|
|
4023
|
-
interface SpecTabDetail {
|
|
4024
|
-
status: SpecTabStatus;
|
|
4025
|
-
path?: string;
|
|
4026
|
-
}
|
|
4027
|
-
/** Changes Tab 详情信息 */
|
|
4028
|
-
interface SpecChangesTabDetail {
|
|
4029
|
-
status: SpecTabStatus;
|
|
4030
|
-
diffInfo?: SpecDiff[];
|
|
4031
|
-
}
|
|
4032
|
-
/** Tab 信息集合 */
|
|
4033
|
-
interface SpecTabInfo {
|
|
4034
|
-
doc: SpecTabDetail;
|
|
4035
|
-
tasks: SpecTabDetail;
|
|
4036
|
-
changes: SpecChangesTabDetail;
|
|
4037
|
-
summary: SpecTabDetail;
|
|
4038
|
-
preview?: {
|
|
4039
|
-
path?: string;
|
|
4040
|
-
};
|
|
4041
|
-
}
|
|
4042
|
-
|
|
4043
|
-
declare namespace AgentModel {
|
|
4044
|
-
interface Item {
|
|
4045
|
-
modelId: string;
|
|
4046
|
-
modelName: string;
|
|
4047
|
-
displayName: string;
|
|
4048
|
-
isDefault: boolean;
|
|
4049
|
-
requestType?: 'COMATE_DEFAULT_MODE' | 'COMATE_MULTIPLE_MODE';
|
|
4050
|
-
callProtocol?: 'TEXT' | 'FC' | 'BOTH';
|
|
4051
|
-
modes?: string[];
|
|
4052
|
-
supportImage?: boolean;
|
|
4053
|
-
supportThinking?: boolean;
|
|
4054
|
-
modelDescription?: string;
|
|
4055
|
-
maxContextWindow?: string;
|
|
4056
|
-
ratio?: string;
|
|
4057
|
-
enableMaxMode?: boolean;
|
|
4058
|
-
}
|
|
4059
|
-
/** PT_WEBVIEW_GET_MODEL_LIST 请求参数 */
|
|
4060
|
-
interface ListQuery {
|
|
4061
|
-
loopVersion?: 'v2';
|
|
4062
|
-
}
|
|
4063
|
-
}
|
|
4064
|
-
|
|
4065
|
-
/**
|
|
4066
|
-
* 解析shell命令字符串,提取其中的命令名称
|
|
4067
|
-
*
|
|
4068
|
-
* 该函数会解析给定的shell命令字符串,识别其中的命令名称
|
|
4069
|
-
* 比如: 'cd /path/to/dir && ls -l' 会返回 ['cd', 'ls']
|
|
4070
|
-
*
|
|
4071
|
-
* @param command - 要解析的shell命令字符串
|
|
4072
|
-
* @returns 包含命令名称的字符串数组,按命令在原始字符串中的出现顺序排列
|
|
4073
|
-
*/
|
|
4074
|
-
declare function parseShellCommandName(command: string): string[];
|
|
4075
|
-
|
|
4076
|
-
declare function getDeviceDisplayName(): string;
|
|
4077
|
-
|
|
4078
|
-
var bundle_l10n_zhCn = {
|
|
4079
|
-
"version.update.title": "发现新版本,是否安装?",
|
|
4080
|
-
"version.update.install": "安装最新版本",
|
|
4081
|
-
"version.update.ignore": "不再提醒",
|
|
4082
|
-
"statusBar.not.support.text": "暂不支持该语言",
|
|
4083
|
-
"statusBar.enable.text": "启用",
|
|
4084
|
-
"statusBar.title": "文心快码",
|
|
4085
|
-
"statusBar.nosuggestions": "文心快码: 无建议",
|
|
4086
|
-
"statusBar.ide.loading": "内联建议生成中",
|
|
4087
|
-
"statusBar.ide.complete": "已生成内联建议",
|
|
4088
|
-
"statusBar.ide.nosuggestions": "无内联建议",
|
|
4089
|
-
"statusBar.ide.pause": "暂停补全({0} 后自动开启)",
|
|
4090
|
-
"statusBar.ide.close": "补全已关闭",
|
|
4091
|
-
"completion.panel.accept.text": "采纳此推荐",
|
|
4092
|
-
"completion.panel.accept.tooltip": "将此次推荐结果应用到代码中",
|
|
4093
|
-
"completion.panel.codelens.disabled.text": "Baidu Comate 补全生成面板需要启用 Code Lens 功能,请在设置中启用此功能后重试~",
|
|
4094
|
-
"completion.panel.title": "补全生成面板",
|
|
4095
|
-
"completion.panel.empty.text": "暂无结果",
|
|
4096
|
-
"completion.panel.hidden.text": "重复项隐藏",
|
|
4097
|
-
"completion.panel.synthesizing.text": "生成补全",
|
|
4098
|
-
"completion.decoration.basic": "💡 Tab 采纳, Esc 取消",
|
|
4099
|
-
"completion.decoration.widget.text": "💡 Tab 采纳 Comate 推荐, Enter 采纳 IDE 推荐",
|
|
4100
|
-
"completion.decoration.acceptLine.text": "💡 {0} + ↓ 逐行采纳",
|
|
4101
|
-
"command.openLicenseConfigEvent.placeholder": "填写已有的 License",
|
|
4102
|
-
"nl2code.empty.text": "抱歉,我无法回答这个问题,您可以试着向我提问其他编程问题",
|
|
4103
|
-
"nl2code.no.selection.text": "请先选中一段代码,再试一次",
|
|
4104
|
-
"optimize.codelens.title": "调优建议",
|
|
4105
|
-
"optimize.codeActions.title": "使用 Comate 调优",
|
|
4106
|
-
"optimize.codelens.tooltip": "Comate 优化该函数",
|
|
4107
|
-
"optimize.error": "未能优化函数",
|
|
4108
|
-
"optimize.code.prompt": "请优化下面的代码:",
|
|
4109
|
-
"optimize.no.selection.text": "请框选要优化的代码",
|
|
4110
|
-
"optimize.function.prompt": "请优化下面的函数:",
|
|
4111
|
-
"chatTrial.codelens.title": "打开侧边栏",
|
|
4112
|
-
"chatTips.selectedCode.title": "{0} + Y 添加选中代码到对话",
|
|
4113
|
-
"chatTips.blankRow.title": "{0} 打开对话,{1} 快速编辑",
|
|
4114
|
-
"decorations.generating.title": "Comate 正在生成中",
|
|
4115
|
-
"decorations.lineComent.trigger.title": "{0} + P 触发注释生成代码",
|
|
4116
|
-
"comment.prompt": "请为下面的函数增加行间注释:",
|
|
4117
|
-
"comment.codelens.title": "行间注释",
|
|
4118
|
-
"comment.codelens.tooltip": "Comate 为该函数增加行间注释",
|
|
4119
|
-
"comment.inlinechat.title": "/行间注释",
|
|
4120
|
-
"comment.generate.error": "未能生成行间注释",
|
|
4121
|
-
"docstring.prompt": "为下面的函数生成注释:",
|
|
4122
|
-
"docstring.codelens.title": "函数注释",
|
|
4123
|
-
"docstring.codelens.tooltip": "Comate 生成该函数注释",
|
|
4124
|
-
"docstring.inlinechat.title": "/函数注释",
|
|
4125
|
-
"docstring.generate.error": "未能生成注释",
|
|
4126
|
-
"split.prompt": "请拆分下面的函数:",
|
|
4127
|
-
"split.codelens.title": "函数拆分",
|
|
4128
|
-
"split.codelens.tooltip": "Comate 拆分该函数",
|
|
4129
|
-
"split.generate.error": "未能拆分函数",
|
|
4130
|
-
"explain.codelens.title": "代码解释",
|
|
4131
|
-
"explain.codeActions.title": "使用 Comate 解释",
|
|
4132
|
-
"explain.codelens.tooltip": "Comate 生成该函数的解释",
|
|
4133
|
-
"explain.generate.error": "未能生成代码解释",
|
|
4134
|
-
"explain.no.selection.text": "请框选要解释的代码",
|
|
4135
|
-
"codeReview.no.selection.text": "仅支持针对代码文件、代码#diff,代码块进行规范性审查,请选择指定内容",
|
|
4136
|
-
"codeReview.query.text": "请帮我审查这段代码,并提出改进建议。",
|
|
4137
|
-
"codeReview.notIn.whiteList": "仅支持评审'.java', '.py', '.js', '.jsx', '.ts', '.tsx', '.vue', '.go', '.c', '.h', '.cpp', '.hpp', '.cc', '.cxx', '.hxx', '.hh'结尾的文件",
|
|
4138
|
-
"explain.prompt": "解释下面的{0}:",
|
|
4139
|
-
"unitTest.codelens.title": "生成单测",
|
|
4140
|
-
"unitTest.codelens.tooltip": "Comate 生成该函数的单测",
|
|
4141
|
-
"unitTest.generate.error": "未能生成单测",
|
|
4142
|
-
"unitTest.accept.error": "Comate 采纳单元测试用例失败:",
|
|
4143
|
-
"unitTest.prompt": "请为下面的{0}生成单测{1}:",
|
|
4144
|
-
"inlinechat.placeholder.generate": "提交",
|
|
4145
|
-
"inlinechat.placeholder.selected": "输入自然语言修改代码(Enter键提交,Esc键取消)",
|
|
4146
|
-
"inlinechat.placeholder.unselected": "输入自然语言生成代码(Enter键提交,Esc键取消)",
|
|
4147
|
-
"inlinechat.title": "{0} Comate 正在生成代码 {1}",
|
|
4148
|
-
"inlinechat.accept": "采纳 {0}",
|
|
4149
|
-
"inlinechat.reject": "放弃 {0}",
|
|
4150
|
-
"inlinechat.placeholder.error": "请先采纳或放弃上一次代码",
|
|
4151
|
-
"inlinechat.codelens.title": "修改代码",
|
|
4152
|
-
"inlinechat.codeActions.title": "使用 Comate 编辑",
|
|
4153
|
-
"inlineLog.prompt": "请为下面的函数添加日志输出:",
|
|
4154
|
-
"inlineLog.codelens.title": "添加日志",
|
|
4155
|
-
"inlineLog.codelens.tooltip": "Comate 为该函数添加日志输出",
|
|
4156
|
-
"inlineLog.generate.error": "未能添加日志输出",
|
|
4157
|
-
"codelensClose.codelens.title": "关闭",
|
|
4158
|
-
"codelensClose.codelens.tooltip": "关闭Codelens",
|
|
4159
|
-
"diff.title": "查看变更",
|
|
4160
|
-
"diff.accept": "采纳 {0}",
|
|
4161
|
-
"diff.reject": "放弃 {0}",
|
|
4162
|
-
"diff.dualScreenDiff.open": "查看变更 {0}",
|
|
4163
|
-
"chat.webview.title": "Comate 对话",
|
|
4164
|
-
"chat.no.insertPosition.text": "请选择插入位置",
|
|
4165
|
-
"accept.path.error": "请输入正确的文件路径",
|
|
4166
|
-
"quickFix.action.text": "Comate 错误修复",
|
|
4167
|
-
"quickFix.prompt": "请根据以下的提示信息修复代码{0}:",
|
|
4168
|
-
"quickFix.generate.error": "未能修复代码",
|
|
4169
|
-
"quickFix.prompt.suffix": ",请告诉我修复后的代码,不要行间解释",
|
|
4170
|
-
"regexHover.tooltip": "查看正则解释",
|
|
4171
|
-
"regexHover.prompt": "请解释这个正则表达式的含义:",
|
|
4172
|
-
"embeddings.maximum.files.message": "无法创建向量索引:当前工作区已超过{0}个文件上限",
|
|
4173
|
-
"embeddings.error.invalidRepo": "抱歉,当前目录不是一个有效的 Git/SVN 仓库,暂不支持更新代码索引!",
|
|
4174
|
-
"embeddings.regenerate.message": "Comate 正在为当前代码库更新索引,完成后可增强生成质量",
|
|
4175
|
-
"embeddings.progress.message": "更新索引中",
|
|
4176
|
-
"embeddings.progress.tooltip.message": "Comate正在为当前代码库更新索引,完成后可增强生成质量",
|
|
4177
|
-
"openPlatform.title.text": "Comate 开放平台",
|
|
4178
|
-
"openPlatform.webview.title": "Comate 插件配置中心",
|
|
4179
|
-
"messageGenerate.generate.error": "生成失败:{0}",
|
|
4180
|
-
"messageGenerate.noDiff.error": "未检测到变更内容",
|
|
4181
|
-
"messageGenerate.getDiff.error": "获取变更内容失败:{0}",
|
|
4182
|
-
"messageGenerate.emptyContent.error": "未能生成commit message",
|
|
4183
|
-
"autoWork.auth.modal.title": "代码授权",
|
|
4184
|
-
"autoWork.indexing.message": "向量索引创建中, 请耐心等待",
|
|
4185
|
-
"autoWork.connection.interrupt.message": "连接已中断,请重试",
|
|
4186
|
-
"autoWork.indexing.reminder.text": "Comate 正在理解你的代码库,索引创建进度 {0}%;索引创建完成后点击重新生成,可获得更符合业务场景的答案。",
|
|
4187
|
-
"autoWork.error": "AutoWork 生成失败",
|
|
4188
|
-
"autoWork.task.thought": "分析您的目标",
|
|
4189
|
-
"autoWork.task.answer": "构建您的答案",
|
|
4190
|
-
"autoWork.autoDebug": "Comate分析与修复",
|
|
4191
|
-
"autoWork.autoDebug.prompt": "请帮我分析终端的报错日志,并提供解决方案。只解决第一个报错",
|
|
4192
|
-
"autoWork.autoDebug.thought": "分析您的报错信息",
|
|
4193
|
-
"autoWork.autoDebug.search": "检索报错相关信息",
|
|
4194
|
-
"autoWork.autoDebug.answer": "生成修复方案",
|
|
4195
|
-
"comatePlus.permission.workspace.text": "工作区文件读写",
|
|
4196
|
-
"comatePlus.permission.disk.text": "全盘文件读写",
|
|
4197
|
-
"comatePlus.permission.user.text": "获取用户详细信息",
|
|
4198
|
-
"comatePlus.auth.message": "是否授权插件 {0} 【{1}】的权限",
|
|
4199
|
-
"comatePlus.userInfo.error": "获取用户信息失败,请检查 Comate 配置中的用户名是否正确",
|
|
4200
|
-
"comatePlus.clear.permission": "已清除所有插件权限",
|
|
4201
|
-
"comatePlus.split.error": "已选择的函数足够精简,不符合拆分条件,请重新选择",
|
|
4202
|
-
"comatePlus.noSelection": "请在编辑区选择代码",
|
|
4203
|
-
"comatePlus.not.function.text": "已选择的代码中不包含函数声明,请重新选择",
|
|
4204
|
-
"common.generate.error": "生成失败:{0}",
|
|
4205
|
-
"common.unknown.error": "未知错误",
|
|
4206
|
-
"common.request.error": "请求失败:{0}",
|
|
4207
|
-
"common.code": "代码",
|
|
4208
|
-
"common.function": "函数",
|
|
4209
|
-
"common.authorize": "授权",
|
|
4210
|
-
"common.using": "使用",
|
|
4211
|
-
"common.without": "不使用",
|
|
4212
|
-
"common.comma": ",",
|
|
4213
|
-
"common.semicolon": ";",
|
|
4214
|
-
"common.framework": "框架",
|
|
4215
|
-
"common.related": "关联",
|
|
4216
|
-
"common.prompt": "提示",
|
|
4217
|
-
"common.thinking": "思考过程",
|
|
4218
|
-
"common.searchResult": "搜索结果",
|
|
4219
|
-
"common.deny": "拒绝",
|
|
4220
|
-
"common.navigateToSetting": "前往配置",
|
|
4221
|
-
"common.customize.error": "混合云用户请到插件配置-服务配置中检查调试",
|
|
4222
|
-
"common.private.error": "私有域用户请到插件配置-服务配置中检查调试",
|
|
4223
|
-
"log.level.placeholder": "请选择日志等级",
|
|
4224
|
-
"do.not.show.again": "不再提示",
|
|
4225
|
-
"login.message": "Hi Mate,我是你的智能编码助手文心快码({0})。快来登录,和我一起享受编程的乐趣吧!",
|
|
4226
|
-
"login.action.text": "登录",
|
|
4227
|
-
"login.action.withLicense.text": "配置License",
|
|
4228
|
-
"login.device.error": "获取设备 ID 失败,无法绑定设备",
|
|
4229
|
-
"login.loggingIn.text": "正在登录文心快码 ( Baidu Comate )...",
|
|
4230
|
-
"login.autoLogin": "已使用来自{0}的凭据自动登录文心快码 ( Baidu Comate )",
|
|
4231
|
-
"login.success": "文心快码 ( Baidu Comate )登录成功!",
|
|
4232
|
-
"login.ide.success": "文心快码 AI IDE: 登录成功!",
|
|
4233
|
-
"login.failed": "登录失败:{0}",
|
|
4234
|
-
"login.token.error": "获取 Token 失败",
|
|
4235
|
-
"login.key.error": "获取 key 失败",
|
|
4236
|
-
"login.license.error": "获取 License 失败",
|
|
4237
|
-
"login.timeout.error": "登录超时,请重试",
|
|
4238
|
-
"login.install.internal": "去下载内部版本",
|
|
4239
|
-
"login.internalUser.message": "检测到您是百度内部用户,建议使用内部版本Comate(需要卸载当前插件并下载内部版本)",
|
|
4240
|
-
"login.agreement.message": "尊敬的文心快码 ( Baidu Comate )用户,为了提供更好的服务,我们将于2024年4月17日更新[用户服务协议](https://comate.baidu.com/zh/userAgreement)。请您关注并查看更新条款。感谢您的支持!",
|
|
4241
|
-
"renew.action.text": "前往续费",
|
|
4242
|
-
"command.quick.pick.placeholder": "请选择快捷指令",
|
|
4243
|
-
"onboarding.import.title": "从 {0} 导入中",
|
|
4244
|
-
"onboarding.importResult.title": "{0} 配置导入完成:",
|
|
4245
|
-
"onboarding.importResult.settings.failed": "设置、快捷键等导入失败",
|
|
4246
|
-
"onboarding.importResult.settings.succeed": "设置、快捷键等导入成功",
|
|
4247
|
-
"onboarding.importResult.extensions.failed": "插件导入异常",
|
|
4248
|
-
"onboarding.importResult.extensions.succeed": "插件导入成功",
|
|
4249
|
-
"onboarding.importResult.failedExtensions": "未能导入以下插件 {0}",
|
|
4250
|
-
"onboarding.importResult.unsupportedExtensions": "不支持导入以下插件 {0}",
|
|
4251
|
-
"review.codelens.title": "代码审查",
|
|
4252
|
-
"review.codelens.tooltip": "Comate 审查该函数",
|
|
4253
|
-
"review.error": "代码审查失败",
|
|
4254
|
-
"review.loading": "正在审查代码...",
|
|
4255
|
-
"kernel.zulu.error": "当前服务响应异常,建议稍后重试。",
|
|
4256
|
-
"kernel.zulu.error.network": "网络连接失败,无法访问 {0},请检查 DNS 或稍后重试",
|
|
4257
|
-
"kernel.zulu.error.connAborted": "连接被中断,请检查网络或稍后重试",
|
|
4258
|
-
"kernel.zulu.error.connTimeout": "连接超时,请检查网络或稍后重试",
|
|
4259
|
-
"kernel.zulu.error.tls": "安全连接失败,请检查系统时间、代理或 TLS 配置",
|
|
4260
|
-
"kernel.zulu.error.certificate": "证书链中包含自签名证书,请关闭代理、防火墙尝试重试",
|
|
4261
|
-
"kernel.zulu.error.aborted": "请求被中断,请稍后重试",
|
|
4262
|
-
"promotion.zuluBenefitGranted": "已送您价值 30 元的 Zulu 权益,[点击查看](https://comate.baidu.com/zh/user)权益详情。",
|
|
4263
|
-
"preview.browser.downloadError": "资源加载失败",
|
|
4264
|
-
"preview.browser.downloadCancel": "资源加载已取消",
|
|
4265
|
-
"preview.browser.openBrowser": "打开",
|
|
4266
|
-
"preview.browser.downloadSuccess": "资源加载完成",
|
|
4267
|
-
"preview.browser.downloadProgress": "正在加载预览所需资源...{0}%",
|
|
4268
|
-
"preview.browser.downloadInit": "准备加载资源中...",
|
|
4269
|
-
"preview.browser.opening": "正在打开浏览器...",
|
|
4270
|
-
"setting.previewMode.title": "预览模式",
|
|
4271
|
-
"setting.previewMode.description": "启用预览模式以访问实验性功能",
|
|
4272
|
-
"fileDiff.showDiff.treeItem": "查看文件 diff",
|
|
4273
|
-
"fileDiff.multiFile.title": "文件变更 ({0})",
|
|
4274
|
-
"fileDiff.treeView.description": "点击文件查看详情",
|
|
4275
|
-
"fileDiff.noWorkspace.error": "未找到工作区",
|
|
4276
|
-
"fileDiff.fileNotFound.error": "文件不存在: {0}",
|
|
4277
|
-
"fileDiff.showDiff.error": "打开文件 diff 失败: {0}",
|
|
4278
|
-
"fileDiff.noFiles.error": "没有需要展示的文件",
|
|
4279
|
-
"fileDiff.allAccepted.message": "已采纳 {0} 个文件的修改",
|
|
4280
|
-
"fileDiff.allRejected.message": "已取消所有修改",
|
|
4281
|
-
"fileDiff.acceptCurrent.message": "已采纳: {0}",
|
|
4282
|
-
"fileDiff.rejectCurrent.message": "已拒绝: {0}",
|
|
4283
|
-
"fileDiff.allChangesAccepted.title": "已采纳: {0},所有文件已处理完成",
|
|
4284
|
-
"fileDiff.preview.title": "正在展示 {0} 个文件的修改预览",
|
|
4285
|
-
"fileDiff.acceptAll.text": "全部采纳",
|
|
4286
|
-
"fileDiff.rejectAll.text": "全部拒绝",
|
|
4287
|
-
"fileDiff.newFile.titleSuffix": " (新增文件)"
|
|
4288
|
-
};
|
|
4289
|
-
|
|
4290
|
-
declare namespace _________vscode_l10n_bundle_l10n_zh_cn_json {
|
|
4291
|
-
export { bundle_l10n_zhCn as default };
|
|
4292
|
-
}
|
|
4293
|
-
|
|
4294
|
-
var bundle_l10n = {
|
|
4295
|
-
"version.update.title": "New version is available. Would you like to install?",
|
|
4296
|
-
"version.update.install": "Install Latest Version",
|
|
4297
|
-
"version.update.ignore": "Don't Show Again",
|
|
4298
|
-
"statusBar.not.support.text": "Unsupported language",
|
|
4299
|
-
"statusBar.enable.text": "Enable",
|
|
4300
|
-
"statusBar.title": "Baidu Comate",
|
|
4301
|
-
"statusBar.nosuggestions": "Baidu Comate: No Suggestion",
|
|
4302
|
-
"statusBar.ide.loading": "Suggestion Generating",
|
|
4303
|
-
"statusBar.ide.complete": "Suggestion Generated",
|
|
4304
|
-
"statusBar.ide.nosuggestions": "No Suggestion",
|
|
4305
|
-
"statusBar.ide.pause": "Pause completion (automatically resumes after 10:40)",
|
|
4306
|
-
"statusBar.ide.close": "Completion is closed",
|
|
4307
|
-
"completion.panel.accept.text": "Accept Solution",
|
|
4308
|
-
"completion.panel.accept.tooltip": "Replace code with this solution",
|
|
4309
|
-
"completion.panel.codelens.disabled.text": "Please enable CodeLens in settings to use the Baidu Comate Completion panel.",
|
|
4310
|
-
"completion.panel.title": "Completion panel",
|
|
4311
|
-
"completion.panel.empty.text": "No synthesized solutions found.",
|
|
4312
|
-
"completion.panel.hidden.text": "Duplicates hidden",
|
|
4313
|
-
"completion.panel.synthesizing.text": "Synthesizing solutions",
|
|
4314
|
-
"completion.decoration.basic": "💡 Tab to accept, Esc to hidden",
|
|
4315
|
-
"completion.decoration.widget.text": "💡 Tab to accept Comate inline suggestion, Enter to accept IDE suggestion",
|
|
4316
|
-
"completion.decoration.acceptLine.text": "💡 {0} + ↓ to accept line",
|
|
4317
|
-
"command.openLicenseConfigEvent.placeholder": "Fill in the existing License",
|
|
4318
|
-
"nl2code.empty.text": "Sorry, I can't answer this question. Feel free to ask me other programming-related questions.",
|
|
4319
|
-
"nl2code.no.selection.text": "Code selection required. Please try again after selecting code",
|
|
4320
|
-
"optimize.codelens.title": "Optimize",
|
|
4321
|
-
"optimize.codeActions.title": "Ask Comate to optimize",
|
|
4322
|
-
"optimize.codelens.tooltip": "Comate optimize this function",
|
|
4323
|
-
"optimize.error": "Failed to optimize",
|
|
4324
|
-
"optimize.code.prompt": "Please optimize the following code:",
|
|
4325
|
-
"optimize.no.selection.text": "Please select the code to be optimized",
|
|
4326
|
-
"optimize.function.prompt": "Please optimize the following function:",
|
|
4327
|
-
"chatTrial.codelens.title": "Chat",
|
|
4328
|
-
"chatTips.selectedCode.title": "Press {0} + Y to add selected code to chat",
|
|
4329
|
-
"chatTips.blankRow.title": "{0} Open Chat, {1} Quick Edit",
|
|
4330
|
-
"decorations.generating.title": "Comate is generating...",
|
|
4331
|
-
"decorations.lineComent.trigger.title": "{0} + P to trigger code generation based on this comment",
|
|
4332
|
-
"comment.prompt": "Please add inline comments to the following function:",
|
|
4333
|
-
"comment.codelens.title": "Add Comments",
|
|
4334
|
-
"comment.codelens.tooltip": "Comate add inline comments to this function",
|
|
4335
|
-
"comment.inlinechat.title": "/Add Comments",
|
|
4336
|
-
"comment.generate.error": "Failed to add inline comments.",
|
|
4337
|
-
"docstring.prompt": "Please add docstring to the following function:",
|
|
4338
|
-
"docstring.codelens.title": "Add Docstring",
|
|
4339
|
-
"docstring.codelens.tooltip": "Comate add docstring to this function",
|
|
4340
|
-
"docstring.inlinechat.title": "/Add Docstring",
|
|
4341
|
-
"docstring.generate.error": "Failed to add docstring.",
|
|
4342
|
-
"split.prompt": "Please split the following function:",
|
|
4343
|
-
"split.codelens.title": "Split",
|
|
4344
|
-
"split.codelens.tooltip": "Comate split this function",
|
|
4345
|
-
"split.generate.error": "Failed to split function",
|
|
4346
|
-
"explain.codelens.title": "Explain",
|
|
4347
|
-
"explain.codeActions.title": "Ask Comate to explain",
|
|
4348
|
-
"explain.codelens.tooltip": "Comate explain this function",
|
|
4349
|
-
"explain.generate.error": "Failed to generate explanation.",
|
|
4350
|
-
"explain.no.selection.text": "Please select the code to be explained.",
|
|
4351
|
-
"codeReview.no.selection.text": "Only supports normative review of code files, code #diff, and code blocks. Please select the specified content.",
|
|
4352
|
-
"codeReview.query.text": "Please help me review this code and suggest improvements.",
|
|
4353
|
-
"codeReview.notIn.whiteList": "Only supports reviewing files ending with '.java', '.py', '.js', '.jsx', '.ts', '.tsx', '.vue', '.go', '.c', '.h', '.cpp', '.hpp', '.cc', '.cxx', '.hxx', '.hh'",
|
|
4354
|
-
"explain.prompt": "Please explain the following {0}:",
|
|
4355
|
-
"unitTest.codelens.title": "Generate UT",
|
|
4356
|
-
"unitTest.codelens.tooltip": "Comate generate unit test for this function",
|
|
4357
|
-
"unitTest.generate.error": "Failed to generate unit test.",
|
|
4358
|
-
"unitTest.accept.error": "Failed to accept unit test:",
|
|
4359
|
-
"unitTest.prompt": "Please generate unit test for the following {0}{1}:",
|
|
4360
|
-
"inlinechat.placeholder.generate": "Code Generation from Natural Language",
|
|
4361
|
-
"inlinechat.placeholder.selected": "Enter Natural Language to Modify Code or Select Recommended Items (Enter to Submit, Esc to Cancel)",
|
|
4362
|
-
"inlinechat.placeholder.unselected": "Enter Natural Language to Generate Code or Select Recommended Items (Enter to Submit, Esc to Cancel)",
|
|
4363
|
-
"inlinechat.title": "{0} Comate is generating code",
|
|
4364
|
-
"inlinechat.accept": "Accept {0}",
|
|
4365
|
-
"inlinechat.reject": "Reject {0}",
|
|
4366
|
-
"inlinechat.placeholder.error": "Please accept or reject the previous changes",
|
|
4367
|
-
"inlinechat.codelens.title": "Inline Chat",
|
|
4368
|
-
"inlinechat.codeActions.title": "Inline Chat",
|
|
4369
|
-
"inlineLog.prompt": "Please add log statements for the following function:",
|
|
4370
|
-
"inlineLog.codelens.title": "Add Logs",
|
|
4371
|
-
"inlineLog.codelens.tooltip": "Comate add log statements for this function",
|
|
4372
|
-
"inlineLog.generate.error": "Failed to add log statements",
|
|
4373
|
-
"codelensClose.codelens.title": "Close",
|
|
4374
|
-
"codelensClose.codelens.tooltip": "Close Codelens",
|
|
4375
|
-
"diff.title": "View Changes",
|
|
4376
|
-
"diff.accept": "Accept {0}",
|
|
4377
|
-
"diff.reject": "Reject {0}",
|
|
4378
|
-
"diff.dualScreenDiff.open": "Open Diff {0}",
|
|
4379
|
-
"chat.webview.title": "Comate Chat",
|
|
4380
|
-
"chat.no.insertPosition.text": "Please specify the insertion position first.",
|
|
4381
|
-
"accept.path.error": "Please enter the correct file path.",
|
|
4382
|
-
"quickFix.action.text": "Ask comate to fix",
|
|
4383
|
-
"quickFix.prompt": "Fix these problems according to the diagnostic information{0}:",
|
|
4384
|
-
"quickFix.generate.error": "Failed to problems",
|
|
4385
|
-
"quickFix.prompt.suffix": ", just provide the fixed code without inline comment",
|
|
4386
|
-
"regexHover.tooltip": "Explain this regular expression",
|
|
4387
|
-
"regexHover.prompt": "Please explain this regular expression: ",
|
|
4388
|
-
"embeddings.maximum.files.message": "Indexing failed: The number of files in the workspace has exceeded the maximum limit of {0}.",
|
|
4389
|
-
"embeddings.error.invalidRepo": "Recreate workspace Index failed, because current directory is not a valid git/svn repo!",
|
|
4390
|
-
"embeddings.regenerate.message": "Comate is updating embeddings, which will enhance the quality of the generation!",
|
|
4391
|
-
"embeddings.progress.message": "Update Embeddings",
|
|
4392
|
-
"embeddings.progress.tooltip.message": "Comate is updating embeddings, which will enhance the quality of the generation",
|
|
4393
|
-
"openPlatform.title.text": "Comate Open Platform",
|
|
4394
|
-
"openPlatform.webview.title": "Comate Docs Management",
|
|
4395
|
-
"messageGenerate.generate.error": "Failed to generate: {0}",
|
|
4396
|
-
"messageGenerate.noDiff.error": "Failed to retrieve any content changes.",
|
|
4397
|
-
"messageGenerate.getDiff.error": "Failed to retrieve diff content: {0}",
|
|
4398
|
-
"messageGenerate.emptyContent.error": "Failed to generate commit message.",
|
|
4399
|
-
"autoWork.auth.modal.title": "Authorization Confirmation",
|
|
4400
|
-
"autoWork.indexing.message": "Indexing in progress. Please wait.",
|
|
4401
|
-
"autoWork.connection.interrupt.message": "Connection interrupted. Please try again.",
|
|
4402
|
-
"autoWork.indexing.reminder.text": "Comate is analyzing your codebase, progress {0}%. For more context-specific solutions, wait for indexing to complete before regenerating.",
|
|
4403
|
-
"autoWork.error": "AutoWork generation failed",
|
|
4404
|
-
"autoWork.task.thought": "Analyze the goal",
|
|
4405
|
-
"autoWork.task.answer": "Frame the answer",
|
|
4406
|
-
"autoWork.autoDebug": "Analyze and fix this with Comate",
|
|
4407
|
-
"autoWork.autoDebug.prompt": "Please analyze the terminal's error logs and provide a solution. Only resolve the first error",
|
|
4408
|
-
"autoWork.autoDebug.thought": "Analyze your terminal output",
|
|
4409
|
-
"autoWork.autoDebug.search": "Retrieve information related to the output",
|
|
4410
|
-
"autoWork.autoDebug.answer": "Generate solution",
|
|
4411
|
-
"comatePlus.permission.workspace.text": "read and write workspace files",
|
|
4412
|
-
"comatePlus.permission.disk.text": "read and write disk files",
|
|
4413
|
-
"comatePlus.permission.user.text": "get user information",
|
|
4414
|
-
"comatePlus.auth.message": "Grant permission for the plugin {0} to {1}?",
|
|
4415
|
-
"comatePlus.userInfo.error": "Failed to fetch user information. Please verify that the username in the configuration is correct.",
|
|
4416
|
-
"comatePlus.clear.permission": "All plugin permissions have been successfully revoked.",
|
|
4417
|
-
"comatePlus.split.error": "The selected function is already compact, no need for further splitting. You can select another function.",
|
|
4418
|
-
"comatePlus.noSelection": "Please select code in the editor",
|
|
4419
|
-
"comatePlus.not.function.text": "The selected code is not a function. Please make a new selection.",
|
|
4420
|
-
"common.generate.error": "Failed to generate: {0}",
|
|
4421
|
-
"common.unknown.error": "unknown error",
|
|
4422
|
-
"common.request.error": "Failed to request: {0}",
|
|
4423
|
-
"common.code": "code",
|
|
4424
|
-
"common.function": "function",
|
|
4425
|
-
"common.authorize": "Authorize",
|
|
4426
|
-
"common.using": "using",
|
|
4427
|
-
"common.without": "without",
|
|
4428
|
-
"common.comma": ", ",
|
|
4429
|
-
"common.semicolon": "; ",
|
|
4430
|
-
"common.framework": "framework",
|
|
4431
|
-
"common.related": "Related",
|
|
4432
|
-
"common.prompt": "Prompt",
|
|
4433
|
-
"common.thinking": "Thinking",
|
|
4434
|
-
"common.searchResult": "Search Result",
|
|
4435
|
-
"common.deny": "拒绝",
|
|
4436
|
-
"common.navigateToSetting": "Go to Setting",
|
|
4437
|
-
"common.customize.error": "Hybrid Cloud users, please go to Plugin Configuration - Service Configuration to check and debug.",
|
|
4438
|
-
"common.private.error": "Private Service users, please go to Plugin Configuration - Service Configuration to check and debug.",
|
|
4439
|
-
"log.level.placeholder": "Set log level",
|
|
4440
|
-
"do.not.show.again": "Don't show again",
|
|
4441
|
-
"login.message": "Hi there! I'm {0}, your AI coding assistant. Ready to log in and dive into the joy of coding together?",
|
|
4442
|
-
"login.action.text": "Login",
|
|
4443
|
-
"login.action.withLicense.text": "Login with license",
|
|
4444
|
-
"login.device.error": "Device fingerprint retrieval failed. Unable to proceed with login.",
|
|
4445
|
-
"login.loggingIn.text": "Baidu Comate is logging in...",
|
|
4446
|
-
"login.autoLogin": "Login successful using credential from {0}",
|
|
4447
|
-
"login.success": "Baidu Comate login successful!",
|
|
4448
|
-
"login.ide.success": "Baidu Comate AI IDE: login successful!",
|
|
4449
|
-
"login.failed": "Failed to login: {0}",
|
|
4450
|
-
"login.token.error": "Failed to get token",
|
|
4451
|
-
"login.key.error": "Failed to get key",
|
|
4452
|
-
"login.license.error": "Failed to get license",
|
|
4453
|
-
"login.timeout.error": "Login timeout. Please try again.",
|
|
4454
|
-
"login.install.internal": "Install Internal Version",
|
|
4455
|
-
"login.internalUser.message": "Welcome! Switch to Baidu's internal version for an enhanced experience? (Uninstall the current extension and download the internal version).",
|
|
4456
|
-
"login.agreement.message": "Dear Baidu Comate User, to enhance our service, we will update the user service agreement on April 17, 2024. Please [click here](https://comate.baidu.com/en/userAgreement) for the updates. Thank you for your support!",
|
|
4457
|
-
"renew.action.text": "Renew Now",
|
|
4458
|
-
"command.quick.pick.placeholder": "Select command to execute",
|
|
4459
|
-
"onboarding.import.title": "Importing from {0}",
|
|
4460
|
-
"onboarding.importResult.title": "Imported from {0}: ",
|
|
4461
|
-
"onboarding.importResult.settings.failed": "error importing settings, keybindings, or snippets",
|
|
4462
|
-
"onboarding.importResult.settings.succeed": "settings, keybindings, and snippets are all set",
|
|
4463
|
-
"onboarding.importResult.extensions.failed": "error importing extensions",
|
|
4464
|
-
"onboarding.importResult.extensions.succeed": "extensions are all set",
|
|
4465
|
-
"onboarding.importResult.failedExtensions": "failed to import {0}",
|
|
4466
|
-
"onboarding.importResult.unsupportedExtensions": "ignored unsupported extensions {0}",
|
|
4467
|
-
"review.codelens.title": "Code Review",
|
|
4468
|
-
"review.codelens.tooltip": "Comate review this function",
|
|
4469
|
-
"review.error": "Failed to review code",
|
|
4470
|
-
"review.loading": "Reviewing code...",
|
|
4471
|
-
"kernel.zulu.error": "The current service response is abnormal. It is recommended to try again later.",
|
|
4472
|
-
"kernel.zulu.error.network": "Network connection failed. Cannot reach {0}. Please check DNS or try again later.",
|
|
4473
|
-
"kernel.zulu.error.connAborted": "Connection aborted. Please check network or try again later.",
|
|
4474
|
-
"kernel.zulu.error.connTimeout": "Connection timed out. Please check network or try again later.",
|
|
4475
|
-
"kernel.zulu.error.tls": "Secure connection failed. Please check system time, proxy, or TLS settings.",
|
|
4476
|
-
"kernel.zulu.error.certificate": "The certificate chain contains a self-signed certificate. Please disable your proxy and firewall and try again.",
|
|
4477
|
-
"kernel.zulu.error.aborted": "Request aborted. Please try again later.",
|
|
4478
|
-
"promotion.zuluBenefitGranted": "¥30 Zulu credit has been added to your account. [Click here](https://comate.baidu.com/en/user) to view details.",
|
|
4479
|
-
"preview.browser.downloadError": "Failed to load browser",
|
|
4480
|
-
"preview.browser.downloadCancel": "Cancel downloading the browser",
|
|
4481
|
-
"preview.browser.downloadSuccess": "Browser loaded successfully",
|
|
4482
|
-
"preview.browser.openBrowser": "Open",
|
|
4483
|
-
"preview.browser.downloadProgress": "Downloading browser...{0}%",
|
|
4484
|
-
"preview.browser.downloadInit": "Downloading browser...",
|
|
4485
|
-
"preview.browser.opening": "Opening browser...",
|
|
4486
|
-
"setting.previewMode.title": "Preview Mode",
|
|
4487
|
-
"setting.previewMode.description": "Enable preview mode to access experimental features",
|
|
4488
|
-
"fileDiff.showDiff.treeItem": "View File Diff",
|
|
4489
|
-
"fileDiff.multiFile.title": "File Changes ({0})",
|
|
4490
|
-
"fileDiff.treeView.description": "Click file to view details",
|
|
4491
|
-
"fileDiff.noWorkspace.error": "Workspace not found",
|
|
4492
|
-
"fileDiff.fileNotFound.error": "File not found: {0}",
|
|
4493
|
-
"fileDiff.showDiff.error": "Failed to open file diff: {0}",
|
|
4494
|
-
"fileDiff.noFiles.error": "No files to display",
|
|
4495
|
-
"fileDiff.allAccepted.message": "Accepted changes in {0} files",
|
|
4496
|
-
"fileDiff.allRejected.message": "All changes rejected",
|
|
4497
|
-
"fileDiff.acceptCurrent.message": "Accepted: {0}",
|
|
4498
|
-
"fileDiff.rejectCurrent.message": "Rejected: {0}",
|
|
4499
|
-
"fileDiff.allChangesAccepted.title": "Accepted: {0}, all files processed",
|
|
4500
|
-
"fileDiff.preview.title": "Previewing changes in {0} files",
|
|
4501
|
-
"fileDiff.acceptAll.text": "Accept All",
|
|
4502
|
-
"fileDiff.rejectAll.text": "Reject All",
|
|
4503
|
-
"fileDiff.newFile.titleSuffix": " (New File)"
|
|
4504
|
-
};
|
|
4505
|
-
|
|
4506
|
-
declare namespace _________vscode_l10n_bundle_l10n_json {
|
|
4507
|
-
export { bundle_l10n as default };
|
|
4508
|
-
}
|
|
4509
|
-
|
|
4510
|
-
type EnKeyType = typeof _________vscode_l10n_bundle_l10n_json;
|
|
4511
|
-
type ZhKeyType = typeof _________vscode_l10n_bundle_l10n_zh_cn_json;
|
|
4512
|
-
type TranslationKey = keyof EnKeyType & keyof ZhKeyType;
|
|
4513
|
-
declare enum GlobalText {
|
|
4514
|
-
VERSION_UPDATE_TITLE = "version.update.title",
|
|
4515
|
-
VERSION_UPDATE_INSTALL = "version.update.install",
|
|
4516
|
-
VERSION_UPDATE_IGNORE = "version.update.ignore",
|
|
4517
|
-
COMMON_GENERATE_ERROR = "common.generate.error",
|
|
4518
|
-
COMMON_UNKNOWN_ERROR = "common.unknown.error",
|
|
4519
|
-
COMMON_REQUEST_ERROR = "common.request.error",
|
|
4520
|
-
COMMON_CODE = "common.code",
|
|
4521
|
-
COMMON_FUNCTION = "common.function",
|
|
4522
|
-
COMMON_USING = "common.using",
|
|
4523
|
-
COMMON_WITHOUT = "common.without",
|
|
4524
|
-
COMMON_COMMA = "common.comma",
|
|
4525
|
-
COMMON_FRAMEWORK = "common.framework",
|
|
4526
|
-
COMMON_RELATED = "common.related",
|
|
4527
|
-
COMMON_PROMPT = "common.prompt",
|
|
4528
|
-
COMMON_THINKING = "common.thinking",
|
|
4529
|
-
COMMON_SEARCH_RESULT = "common.searchResult",
|
|
4530
|
-
COMMON_AUTHORIZE = "common.authorize",
|
|
4531
|
-
COMMON_DENY = "common.deny",
|
|
4532
|
-
COMMON_NAVIGATE_TO_SETTING = "common.navigateToSetting",
|
|
4533
|
-
COMMON_CUSTOMIZE_ERROR = "common.customize.error",
|
|
4534
|
-
COMMON_PRIVATE_ERROR = "common.private.error",
|
|
4535
|
-
LOG_LEVEL_PLACEHOLDER = "log.level.placeholder",
|
|
4536
|
-
DO_NOT_SHOW_AGAIN = "do.not.show.again"
|
|
4537
|
-
}
|
|
4538
|
-
declare enum StatusBarText {
|
|
4539
|
-
NOT_SUPPORT = "statusBar.not.support.text",
|
|
4540
|
-
ENABLE = "statusBar.enable.text",
|
|
4541
|
-
NO_SUGGESTIONS = "statusBar.nosuggestions",
|
|
4542
|
-
TITLE = "statusBar.title"
|
|
4543
|
-
}
|
|
4544
|
-
declare enum CompletionText {
|
|
4545
|
-
PANEL_ACCEPT = "completion.panel.accept.text",
|
|
4546
|
-
PANEL_ACCEPT_TOOLTIP = "completion.panel.accept.tooltip",
|
|
4547
|
-
PANEL_CODELENS_DISABLED = "completion.panel.codelens.disabled.text",
|
|
4548
|
-
PANEL_TITLE = "completion.panel.title",
|
|
4549
|
-
PANEL_EMPTY = "completion.panel.empty.text",
|
|
4550
|
-
PANEL_HIDDEN = "completion.panel.hidden.text",
|
|
4551
|
-
PANEL_SYNTHESIZING = "completion.panel.synthesizing.text",
|
|
4552
|
-
DECORATION_BASIC = "completion.decoration.basic",
|
|
4553
|
-
DECORATION_WITH_WIDGET = "completion.decoration.widget.text",
|
|
4554
|
-
DECORATION_ACCEPT_LINE = "completion.decoration.acceptLine.text"
|
|
4555
|
-
}
|
|
4556
|
-
declare enum Nl2codeProviderText {
|
|
4557
|
-
EMPTY_TEXT = "nl2code.empty.text",
|
|
4558
|
-
NO_SELECTION = "nl2code.no.selection.text"
|
|
4559
|
-
}
|
|
4560
|
-
declare enum OptimizeProviderText {
|
|
4561
|
-
CODELENS_TITLE = "optimize.codelens.title",
|
|
4562
|
-
CODELENS_TOOLTIP = "optimize.codelens.tooltip",
|
|
4563
|
-
OPTIMIZE_ERROR = "optimize.error",
|
|
4564
|
-
OPTIMIZE_CODE_PROMPT = "optimize.code.prompt",
|
|
4565
|
-
NO_SELECTION = "optimize.no.selection.text",
|
|
4566
|
-
OPTIMIZE_FUNCTION_PROMPT = "optimize.function.prompt"
|
|
4567
|
-
}
|
|
4568
|
-
declare enum CodeSelectionActionsProviderText {
|
|
4569
|
-
EXPLAIN_SELECTED_CODE = "explain.codeActions.title",
|
|
4570
|
-
OPTIMIZE_SELECTED_CODE = "optimize.codeActions.title",
|
|
4571
|
-
INLINECHAT_SELECTED_CODE = "inlinechat.codeActions.title"
|
|
4572
|
-
}
|
|
4573
|
-
declare enum ChatTrialProviderText {
|
|
4574
|
-
CODELENS_TITLE = "chatTrial.codelens.title"
|
|
4575
|
-
}
|
|
4576
|
-
declare enum InlineChatTrialProviderText {
|
|
4577
|
-
CODELENS_TITLE = "inlinechat.codelens.title"
|
|
4578
|
-
}
|
|
4579
|
-
declare enum ChatTipsProviderText {
|
|
4580
|
-
CHAT_TIPS_TITLE = "chatTips.selectedCode.title",
|
|
4581
|
-
CHAT_TIPS_CODE_BLANK_ROW_TITLE = "chatTips.blankRow.title"
|
|
4582
|
-
}
|
|
4583
|
-
declare enum DecorationsText {
|
|
4584
|
-
GENERATING_TITLE = "decorations.generating.title",
|
|
4585
|
-
LINE_COMMENT_CODE_TRIGGER_TITLE = "decorations.lineComent.trigger.title"
|
|
4586
|
-
}
|
|
4587
|
-
declare enum CommentProviderText {
|
|
4588
|
-
PROMPT = "comment.prompt",
|
|
4589
|
-
CODELENS_TITLE = "comment.codelens.title",
|
|
4590
|
-
CODELENS_TOOLTIP = "comment.codelens.tooltip",
|
|
4591
|
-
INLINECHAT_TITLE = "comment.inlinechat.title",
|
|
4592
|
-
GENERATE_ERROR = "comment.generate.error"
|
|
4593
|
-
}
|
|
4594
|
-
declare enum DocstringProviderText {
|
|
4595
|
-
PROMPT = "docstring.prompt",
|
|
4596
|
-
CODELENS_TITLE = "docstring.codelens.title",
|
|
4597
|
-
CODELENS_TOOLTIP = "docstring.codelens.tooltip",
|
|
4598
|
-
INLINECHAT_TITLE = "docstring.inlinechat.title",
|
|
4599
|
-
GENERATE_ERROR = "docstring.generate.error"
|
|
4600
|
-
}
|
|
4601
|
-
declare enum SplitProviderText {
|
|
4602
|
-
PROMPT = "split.prompt",
|
|
4603
|
-
CODELENS_TITLE = "split.codelens.title",
|
|
4604
|
-
CODELENS_TOOLTIP = "split.codelens.tooltip",
|
|
4605
|
-
GENERATE_ERROR = "split.generate.error"
|
|
4606
|
-
}
|
|
4607
|
-
declare enum ExplainProviderText {
|
|
4608
|
-
CODELENS_TITLE = "explain.codelens.title",
|
|
4609
|
-
CODELENS_TOOLTIP = "explain.codelens.tooltip",
|
|
4610
|
-
GENERATE_ERROR = "explain.generate.error",
|
|
4611
|
-
NO_SELECTION = "explain.no.selection.text",
|
|
4612
|
-
PROMPT = "explain.prompt"
|
|
4613
|
-
}
|
|
4614
|
-
declare enum UnitTestProviderText {
|
|
4615
|
-
CODELENS_TITLE = "unitTest.codelens.title",
|
|
4616
|
-
CODELENS_TOOLTIP = "unitTest.codelens.tooltip",
|
|
4617
|
-
GENERATE_ERROR = "unitTest.generate.error",
|
|
4618
|
-
ACCEPT_ERROR = "unitTest.accept.error",
|
|
4619
|
-
PROMPT = "unitTest.prompt"
|
|
4620
|
-
}
|
|
4621
|
-
declare enum InlineLogProviderText {
|
|
4622
|
-
PROMPT = "inlineLog.prompt",
|
|
4623
|
-
CODELENS_TITLE = "inlineLog.codelens.title",
|
|
4624
|
-
CODELENS_TOOLTIP = "inlineLog.codelens.tooltip",
|
|
4625
|
-
GENERATE_ERROR = "inlineLog.generate.error"
|
|
4626
|
-
}
|
|
4627
|
-
declare enum DiffProviderText {
|
|
4628
|
-
TITLE = "diff.title",
|
|
4629
|
-
ACCEPT = "diff.accept",
|
|
4630
|
-
REJECT = "diff.reject",
|
|
4631
|
-
OPEN_DUAL_SCREEN_DIFF = "diff.dualScreenDiff.open"
|
|
4632
|
-
}
|
|
4633
|
-
declare enum ChatProviderText {
|
|
4634
|
-
WEBVIEW_TITLE = "chat.webview.title",
|
|
4635
|
-
NO_INSERT_POSITION = "chat.no.insertPosition.text"
|
|
4636
|
-
}
|
|
4637
|
-
declare enum AcceptProviderText {
|
|
4638
|
-
PATH_ERROR = "accept.path.error"
|
|
4639
|
-
}
|
|
4640
|
-
declare enum QuickFixText {
|
|
4641
|
-
ACTION = "quickFix.action.text",
|
|
4642
|
-
PROMPT = "quickFix.prompt",
|
|
4643
|
-
PROMPT_SUFFIX = "quickFix.prompt.suffix",
|
|
4644
|
-
GENERATE_ERROR = "quickFix.generate.error",
|
|
4645
|
-
FIX_MAX_LEN = "quickFix.fix.maxLen.text"
|
|
4646
|
-
}
|
|
4647
|
-
declare enum ExtensionText {
|
|
4648
|
-
LOGIN_MESSAGE = "login.message",
|
|
4649
|
-
LOGIN_ACTION_TEXT = "login.action.text",
|
|
4650
|
-
LOGIN_ACTION_WITH_LICENSE = "login.action.withLicense.text",
|
|
4651
|
-
LOGIN_DEVICE_ERROR = "login.device.error",
|
|
4652
|
-
LOGIN_LOGGING_IN = "login.loggingIn.text",
|
|
4653
|
-
LOGIN_SUCCESS = "login.success",
|
|
4654
|
-
LOGIN_IDE_SUCCESS = "login.ide.success",
|
|
4655
|
-
LOGIN_FAILED = "login.failed",
|
|
4656
|
-
LOGIN_TOKEN_ERROR = "login.token.error",
|
|
4657
|
-
LOGIN_KEY_ERROR = "login.key.error",
|
|
4658
|
-
LOGIN_LICENSE_ERROR = "login.license.error",
|
|
4659
|
-
LOGIN_INTERNAL_USER = "login.internalUser.message",
|
|
4660
|
-
LOGIN_INSTALL_INTERNAL = "login.install.internal",
|
|
4661
|
-
LOGIN_AGREEMENT = "login.agreement.message",
|
|
4662
|
-
RENEW_ACTION = "renew.action.text",
|
|
4663
|
-
QUICK_PICK_PLACEHOLDER = "command.quick.pick.placeholder"
|
|
4664
|
-
}
|
|
4665
|
-
declare enum RegexHoverText {
|
|
4666
|
-
TOOLTIP = "regexHover.tooltip",
|
|
4667
|
-
PROMPT = "regexHover.prompt"
|
|
4668
|
-
}
|
|
4669
|
-
declare enum EmbeddingsServiceText {
|
|
4670
|
-
MAXIMUM_FILES = "embeddings.maximum.files.message",
|
|
4671
|
-
PROGRESS = "embeddings.progress.message",
|
|
4672
|
-
PROGRESS_TOOLTIP = "embeddings.progress.tooltip.message"
|
|
4673
|
-
}
|
|
4674
|
-
declare enum OpenPlatformText {
|
|
4675
|
-
TITLE = "openPlatform.title.text",
|
|
4676
|
-
WEBVIEW_TITLE = "openPlatform.webview.title"
|
|
4677
|
-
}
|
|
4678
|
-
declare enum AutoWorkText {
|
|
4679
|
-
MODAL_AUTH_TITLE = "autoWork.auth.modal.title",
|
|
4680
|
-
INDEXING_MESSAGE = "autoWork.indexing.message",
|
|
4681
|
-
CONNECTION_INTERRUPT = "autoWork.connection.interrupt.message",
|
|
4682
|
-
INDEXING_REMINDER = "autoWork.indexing.reminder.text",
|
|
4683
|
-
ERROR = "autoWork.error",
|
|
4684
|
-
TASK_THOUGHT = "autoWork.task.thought",
|
|
4685
|
-
TASK_ANSWER = "autoWork.task.answer",
|
|
4686
|
-
AUTO_DEBUG = "autoWork.autoDebug",
|
|
4687
|
-
AUTO_DEBUG_PROMPT = "autoWork.autoDebug.prompt",
|
|
4688
|
-
AUTO_DEBUG_STAGE_THOUGHT = "autoWork.autoDebug.thought",
|
|
4689
|
-
AUTO_DEBUG_STAGE_SEARCH = "autoWork.autoDebug.search",
|
|
4690
|
-
AUTO_DEBUG_STAGE_ANSWER = "autoWork.autoDebug.answer"
|
|
4691
|
-
}
|
|
4692
|
-
declare enum ComatePlusText {
|
|
4693
|
-
PERMISSION_WORKSPACE = "comatePlus.permission.workspace.text",
|
|
4694
|
-
PERMISSION_DISK = "comatePlus.permission.disk.text",
|
|
4695
|
-
PERMISSION_USER = "comatePlus.permission.user.text",
|
|
4696
|
-
AUTH_MESSAGE = "comatePlus.auth.message",
|
|
4697
|
-
USER_INFO_ERROR = "comatePlus.userInfo.error",
|
|
4698
|
-
CLEAR_PERMISSION = "comatePlus.clear.permission",
|
|
4699
|
-
SPLIT_ERROR = "comatePlus.split.error",
|
|
4700
|
-
NO_SELECTION = "comatePlus.noSelection",
|
|
4701
|
-
NOT_A_FUNCTION = "comatePlus.not.function.text"
|
|
4702
|
-
}
|
|
4703
|
-
declare enum InlineChatText {
|
|
4704
|
-
INLINECHAT_GENERATE = "inlinechat.placeholder.generate",
|
|
4705
|
-
INLINECHAT_SELECTED = "inlinechat.placeholder.selected",
|
|
4706
|
-
INLINECHAT_UNSELECTED = "inlinechat.placeholder.unselected",
|
|
4707
|
-
INLINECHAT_TITLE = "inlinechat.title",
|
|
4708
|
-
INLINCHAT_ERROR = "inlinechat.placeholder.error"
|
|
4709
|
-
}
|
|
4710
|
-
declare enum MessageGenerateText {
|
|
4711
|
-
GENERATE_ERROR = "messageGenerate.generate.error",
|
|
4712
|
-
NO_DIFF_ERROR = "messageGenerate.noDiff.error",
|
|
4713
|
-
GET_DIFF_ERROR = "messageGenerate.getDiff.error",
|
|
4714
|
-
EMPTY_CONTENT_ERROR = "messageGenerate.emptyContent.error"
|
|
4715
|
-
}
|
|
4716
|
-
declare enum ZuluText {
|
|
4717
|
-
GENERATE_ERROR = "kernel.zulu.error"
|
|
4718
|
-
}
|
|
4719
|
-
|
|
4720
|
-
declare const LSP_ERROR_CODE: {
|
|
4721
|
-
ServerError: number;
|
|
4722
|
-
ParseError: number;
|
|
4723
|
-
InvalidRequest: number;
|
|
4724
|
-
MethodNotFound: number;
|
|
4725
|
-
InvalidParams: number;
|
|
4726
|
-
InternalError: number;
|
|
4727
|
-
/**
|
|
4728
|
-
* The client has canceled a request and a server has detected
|
|
4729
|
-
* the cancel.
|
|
4730
|
-
*/
|
|
4731
|
-
RequestCancelled: number;
|
|
4732
|
-
DeviceFlowFailed: number;
|
|
4733
|
-
ContextNotInitialized: number;
|
|
4734
|
-
AbortedByServer: number;
|
|
4735
|
-
CancelledByServer: number;
|
|
4736
|
-
GetGitRepoIdError: number;
|
|
4737
|
-
};
|
|
4738
|
-
declare const SUCCESS_CODE = 0;
|
|
4739
|
-
|
|
4740
|
-
declare class FixedLengthArray<T> {
|
|
4741
|
-
private items;
|
|
4742
|
-
private readonly maxLength;
|
|
4743
|
-
constructor(maxLength: number);
|
|
4744
|
-
/**
|
|
4745
|
-
* 获取当前长度
|
|
4746
|
-
*/
|
|
4747
|
-
get length(): number;
|
|
4748
|
-
/**
|
|
4749
|
-
* 获取最大长度
|
|
4750
|
-
*/
|
|
4751
|
-
get capacity(): number;
|
|
4752
|
-
/**
|
|
4753
|
-
* 添加元素到数组开头,如果超过最大长度则移除最后一个元素
|
|
4754
|
-
*/
|
|
4755
|
-
push(item: T): void;
|
|
4756
|
-
/**
|
|
4757
|
-
* 添加元素到数组末尾,如果超过最大长度则移除第一个元素
|
|
4758
|
-
*/
|
|
4759
|
-
append(item: T): void;
|
|
4760
|
-
/**
|
|
4761
|
-
* 获取所有元素
|
|
4762
|
-
*/
|
|
4763
|
-
getAll(): T[];
|
|
4764
|
-
/**
|
|
4765
|
-
* 获取指定索引的元素
|
|
4766
|
-
*/
|
|
4767
|
-
get(index: number): T | undefined;
|
|
4768
|
-
/**
|
|
4769
|
-
* 清空数组
|
|
4770
|
-
*/
|
|
4771
|
-
clear(): void;
|
|
4772
|
-
/**
|
|
4773
|
-
* 判断是否已满
|
|
4774
|
-
*/
|
|
4775
|
-
isFull(): boolean;
|
|
4776
|
-
/**
|
|
4777
|
-
* 转换为字符串
|
|
4778
|
-
*/
|
|
4779
|
-
toString(): string;
|
|
4780
|
-
}
|
|
4781
|
-
|
|
4782
|
-
interface Logger {
|
|
4783
|
-
log: (message: string, context?: Record<string, any>) => void;
|
|
4784
|
-
error: (message: string, context?: Record<string, any>) => void;
|
|
4785
|
-
}
|
|
4786
|
-
declare function loggingMiddleware(logger: Logger): interfaces.Middleware;
|
|
4787
|
-
interface LogEntry {
|
|
4788
|
-
timestamp: string;
|
|
4789
|
-
level: 'log' | 'error';
|
|
4790
|
-
message: string;
|
|
4791
|
-
context?: Record<string, any>;
|
|
4792
|
-
}
|
|
4793
|
-
declare const logStorage: FixedLengthArray<LogEntry>;
|
|
4794
|
-
declare const customLogger: {
|
|
4795
|
-
log: (message: string, context?: Record<string, any>) => void;
|
|
4796
|
-
error: (message: string, context?: Record<string, any>) => void;
|
|
4797
|
-
};
|
|
4798
|
-
|
|
4799
|
-
declare function detectEncoding(fileBuffer: Buffer): string;
|
|
4800
|
-
declare function decodeBuffer(fileBuffer: Buffer): string;
|
|
4801
|
-
declare function decodeFile(fileBuffer: Buffer): Promise<string>;
|
|
4802
|
-
declare function encodeWithFileEncoding(content: string, absolutePath: string): Promise<Buffer>;
|
|
4803
|
-
|
|
4804
|
-
declare const AUTOMATION_BROWSER_PICK_PREFIX = "comate-browser:";
|
|
4805
|
-
declare const AUTOMATION_BROWSER_PICK_SEPARATOR = "--";
|
|
4806
|
-
type AutomationBrowserPickType = 'file' | 'browser';
|
|
4807
|
-
interface ParsedAutomationBrowserPick {
|
|
4808
|
-
filePath: string;
|
|
4809
|
-
type: AutomationBrowserPickType;
|
|
4810
|
-
}
|
|
4811
|
-
declare function isAutomationBrowserPick(filePick: string): boolean;
|
|
4812
|
-
declare function normalizeAutomationBrowserFile(filePick: string): string;
|
|
4813
|
-
declare function normalizeAutomationBrowserPick(filePick: string): string;
|
|
4814
|
-
declare function parseAutomationBrowserPick(filePick: string): ParsedAutomationBrowserPick;
|
|
4815
|
-
declare function parseAutomationBrowserPicks(filePicks?: string[]): string[];
|
|
4816
|
-
|
|
4817
|
-
export { type $features, ACTION_ASK_LLM, ACTION_ASK_LLM_STREAMING, ACTION_ASK_RAG, ACTION_BATCH_ACCEPT, ACTION_BRANCH_CHANGE, ACTION_CHAT_QUERY, ACTION_CHAT_SESSION_DELETE, ACTION_CHAT_SESSION_FIND, ACTION_CHAT_SESSION_LIST, ACTION_CHAT_SESSION_SAVE, ACTION_CHAT_TASK_PROGRESS, ACTION_CODE_SEARCH, ACTION_COMATE_ADD_AGENT_TASK, ACTION_COMATE_ADD_CACHE, ACTION_COMATE_GET_AGENT_TASKS, ACTION_COMATE_GET_CACHE, ACTION_COMATE_LSP_REMOTE_CONSOLE, ACTION_COMATE_LSP_WORKSPACE_FOLDERS, ACTION_COMATE_PLUS_AGENT_COMMAND, ACTION_COMATE_PLUS_AGENT_NOTIFICATION, ACTION_COMATE_PLUS_AISA_BUILD_PAYLOAD, ACTION_COMATE_PLUS_BATCH_ACCEPT, ACTION_COMATE_PLUS_CHAT_CANCEL, ACTION_COMATE_PLUS_CHAT_QUERY, ACTION_COMATE_PLUS_CODE_SEARCH, ACTION_COMATE_PLUS_CUSTOM_COMMAND, ACTION_COMATE_PLUS_DIAGNOSTIC_SCAN, ACTION_COMATE_PLUS_DRAW_CHAT_APPEND, ACTION_COMATE_PLUS_DRAW_CHAT_FAIL, ACTION_COMATE_PLUS_DRAW_CHAT_FINISH, ACTION_COMATE_PLUS_DRAW_CHAT_UPDATE, ACTION_COMATE_PLUS_INITIALIZED, ACTION_COMATE_PLUS_QUERY_SELECTOR, ACTION_COMATE_PLUS_RECREATE_INDEX, ACTION_COMATE_PLUS_REQUEST_PERMISSION, ACTION_COMATE_PLUS_SA_SCAN_DIAGNOSTIC, ACTION_COMATE_PLUS_SA_SCAN_INIT, ACTION_COMATE_PLUS_SECTION_CHAT_UPDATE, ACTION_COMATE_PLUS_WEBVIEW_INIT_DATA, ACTION_COMATE_SET_FOREGROUND_TASK, ACTION_COMATE_SMART_APPLY, ACTION_COMATE_SMART_APPLY_CANCEL, ACTION_COMATE_UPDATE_AGENT_TASK_MESSAGES, ACTION_COMPOSER, ACTION_CUSTOM_COMMAND, ACTION_DEBUG_TASK_PROCESS, ACTION_DIAGNOSTIC_SCAN, ACTION_DIAGNOSTIC_SCAN_TASK_COUNT, ACTION_DIAGNOSTIC_SCAN_TASK_PROGRESS, ACTION_ENGINE_PROCESS_START_SUCCESS, ACTION_GENERATE_MESSAGE, ACTION_GENERATE_MESSAGE_REPORT, ACTION_GET_PLUGIN_CONFIG, ACTION_INFORMATION_QUERY, ACTION_ISCAN_JOB_BUILD_ID, ACTION_ISCAN_RESULT, ACTION_LOG, ACTION_PLUS_MODULE_LIST_FETCH, ACTION_PLUS_MODULE_LIST_RESULT, ACTION_PROMPTTEMPLATE_CREATE, ACTION_PROMPTTEMPLATE_DELETE, ACTION_PROMPTTEMPLATE_LIST, ACTION_PROMPTTEMPLATE_UPDATE, ACTION_QUERY_SELECTOR, ACTION_RELEASE_SCAN_TASK, ACTION_REQUEST_PERMISSION, ACTION_SA_SCAN_DIAGNOSTIC, ACTION_SA_SCAN_DIAGNOSTIC_RESULT, ACTION_SCAN_CACHE_COUNT, ACTION_SCAN_NOTIFICATION, ACTION_SCAN_QUERY, ACTION_SCAN_TASK, ACTION_SCAN_TASK_PROGRESS, ACTION_SECUBOT, ACTION_SECUBOT_TASK_PROGRESS, ACTION_SESSION_FINISH, ACTION_SESSION_START, ACTION_START_BACKGROUND_SERVICE, ACTION_START_ISCAN, ACTION_START_ISCAN_AND_GET_SEC_RESULT, ACTION_START_ISCAN_BY_SAVE, ACTION_UPDATE_ENGINE_CONFIG, ACTION_USER_DETAIL, ACTION_USER_DETAIL_ERROR, ACTION_V8_SNAP_SHOT, ACTION_WILL_SCAN, AGENT_DEBUG_CUSTOM_ACTION, AUTOMATION_BROWSER_PICK_PREFIX, AUTOMATION_BROWSER_PICK_SEPARATOR, type Accept, type AcceptMethod, AcceptProviderText, type AcceptWithDependentFiles, type ActionConfig, type ActionConfigs, type ActionSet, type ActionType, type Actions, type ActivationContext, type AssistantMessage as AgentAssistantMessage, type AgentComposerTask, type AgentConversationInfo, AgentConversationStatus, AgentConversationType, type AgentElements, type AgentEvents, type Message as AgentMessage, AgentMessageStatus, type AgentMetrics, AgentModel, type AgentPayload, type AgentReasonElement, type AgentTextElement, type AgentTodoElement, type AgentToolCallElement, type AgentToolCallType, type UserMessage as AgentUserMessage, type AgentWebSearchSite, type AggregatedScanConfig, type AlertTag, type ArchitectureReadIntentStrategy, AutoWorkText, type AutomationBrowserExecutionState, type AutomationBrowserPickType, type BatchAcceptPayload, type BatchAcceptPluginPayload, type BlockItem, type ButtonGroup, CanceledError, type CapabilityDescription, type Card, Channel, type ChannelImplement, type ChannelImplementMaybe, type ChatAgentConfig, type ChatAgentFormValues, ChatProviderText, type ChatQueryParsed, type ChatQueryPayload, type ChatSession, type ChatSessionDetail, ChatTipsProviderText, ChatTrialProviderText, type ChunkContent, type ChunkSelection, type CloudKnowledgeChunk, type CloudKnowledgeItem, type CloudKnowledgeRetrievalType, type CloudKnowledgeSelectOption, type CloudKnowledgeType, type CloudKnowledgeWorkspace, type CodeChunk, type CodeChunkType, type CodeSearchPayload, type CodeSearchPluginPayload, CodeSelectionActionsProviderText, CodeWrittenMetric, type CollapsePanel, ComatePlusText, type CommandButton, type CommandExecutionResult, type CommandExecutionState, CommandExecutionStatus, CommentProviderText, CompletionText, type ConfigSchemaObject, ContextType, type ContextsConfig, type ConversationTab, type CopyAcceptMethod, type CopyFile, type CurrentFileReadIntentStrategy, type CustomCommandInvokePayload, type CustomCommandPayload, DEFAULT_RULE_CONFIG_FOLDER, DEFAULT_WORKSPACE_CONFIG_FOLDER, DEFAULT_WORKSPACE_MEMORY_FILE, DEFAULT_WORKSPACE_RULE_FILE, type DebugAgentCodeContextItem, type DebugAgentPayload, type DebugAgentPluginPayload, type DebugAgentResponse, DecorationsText, type Deferred, type DiagnosticCacheValue, type DiagnosticInfo, type DiagnosticScanChangedFiles, type DiagnosticScanCountPayload, type DiagnosticScanInvokePayload, type DiagnosticScanPayload, type DiagnosticScanTaskProgressChunk, type DiagnosticScanTaskProgressPayload, type DiagnosticScanTypes, DiffProviderText, DocstringProviderText, type DocumentPosition, type DrawChunk, type DrawElement, type DynamicActionItems, type DynamicCodeChunks, type DynamicCodeGenSteps, type DynamicNotification, type DynamicRelativeFiles, type DynamicReminder, type DynamicSection, ENVIRONMENT, EmbeddingsServiceText, type EventResult, type Execution, ExplainProviderText, ExtensionText, type FailChunk, type FigmaFileItem, type FigmaSelection, type FileCacheEntry, type FileLink, type FileReadIntentStrategy, FixedLengthArray, type Flex, type FolderKeyIntentStrategy, type FolderReadIntentStrategy, type FolderRegexIntentStrategy, type FolderVectorIntentStrategy, type FunctionCall, type FunctionDefinition, FunctionModel, type FunctionParameterDefinition, type GenerateMessageResponse, type GetPluginConfigPayload, GlobalText, INTERNAL_API_HOST, INTERNAL_TEST_API_HOST, type IScanBuildResult, type IScanInvokePayload, type IScanJobBuildPayload, type IScanResult, type IScanResultPayload, ITool, IToolTurn, type IdeSideConfigPayload, type IdeSideConfigResponse, type IdeSideInformationPayload, type IdeSideInformationResponse, type IdeSideLlmPayload, type IdeSideLlmResponse, type IdeSideLlmStreamingResponse, type IdeSidePermissionPayload, type IdeSidePermissionResponse, type Information, type InformationPayload, InformationQueryType, InlineChatText, InlineChatTrialProviderText, InlineLogProviderText, type InputBoxMessageHistory, type IntentStrategy, IntentStrategyContextType, IntentStrategyRule, type KnowledgeChunk, type KnowledgeList, type KnowledgeOptions, type KnowledgeQueryWorkspace, type KnowledgeSet, type KnowledgeSetBase, LSP_ERROR_CODE, LanguageDetector, type LayeredSnapshot, type LicenseFullDetail, type LlmPayload, type LlmPayloadTypes, type LlmResponseTypes, LlmType, type Loading, type LocalMode, type LogEntry, type LogLevel, type LogPayload, LogUploaderProvider, type MCPAudioContent, type MCPImageContent, type MCPResourceContent, type MCPServerForWebview, type MCPTextContent, MCP_GLOBAL_SETTINGS_FILE_PATH, MCP_LOCAL_SETTINGS_FILE_PATH, MCP_LOCAL_SETTINGS_RELATIVE_PATH, MCP_PROJECT_SETTINGS_RELATIVE_PATH, MCP_SETTINGS_DIR, MCP_SETTINGS_FILENAME, MCP_SETTINGS_FILE_PATH, MCP_SETTINGS_LOCAL_FILENAME, MEMORY_FORMAT_ERROR_CAUSE, MEMORY_FORMAT_VALIDATION_TOOLTIP_FOR_API, MEMORY_FORMAT_VALIDATION_TOOLTIP_FOR_WEBVIEW, type Markdown, type McpConfigResult, type McpConfigSource, type McpConfigUpdatePayload, type McpConfigUpdateRequest, type McpConnectionStatus, type McpServerBaseConfigRaw, type McpServerConfigParsed, type McpServerConfigParsedBase, type McpServerConfigRaw, type McpServerInfo, type McpTool, type McpToolExecutionState, type McpTransportType, type Memory, MemorySchema, MessageGenerateText, type Model, type ModelOptions, Nl2codeProviderText, type NotificationMessage, OpenPlatformText, OptimizeProviderText, PERSISTENT_STORAGE_EVENT, PLATFORM, PROMPTTEMPLATE_ROOT_PATH, type ParsedAutomationBrowserPick, type ParsedSettings, PatchContentConflictError, PatchFileDelimiterError, PermissionType, type PluginCapabilityType, type PluginConfig, type PluginConfigSection, type PluginConfigSet, type PluginDescription, type PluginMeta, type PlusConfigPayload, type PlusModuleListResultPayload, type Position, type ProviderCapabilityInfo, type QuerySelectorPayload, QuickFixText, type RAGPayload, RULE_PANEL_ACTION_EVENT, type Range$1 as Range, type RawSettings, RegexHoverText, type ReleaseScanTaskPayload, type RemoteScanConfigResponse, type RemoteScanGlobalConfig, type RepairData, type ReplaceContentAcceptMethod, type ReplaceSelectionAcceptMethod, type RepoKeyIntentStrategy, type RepoRegexIntentStrategy, type RepoVectorIntentStrategy, type ReportWillScanPayload, type RequestPermissionPayload, RoleType, type RollbackMessageFileInfo, type RuleItem, type RuleMetadata, type RulePanelAction, type RulePanelActionParamsMap, SAAS_API_HOST, SAAS_TEST_API_HOST, type SADiagnosticScanInvokePayload, type SADiagnosticScanResultChunk, type SADiagnosticScanResultPayload, type SAScanDiagnosticConfig, type SAScanDiagnosticResult, type SAScanInitData, SECUBOT_DEFAULT_QUERY, SSEProcessor, SUCCESS_CODE, SUFFIX_LANG_MAP, SUPPORTED_SUFFIX_CONFIG, type ScanExecutionResult, type ScanHandleGoal, type ScanIssue, type ScanIssueRange, type ScanIssueRepairData, type ScanIssueSeverity, type ScanIssuesByFile, type ScanPlan, type ScanQueryPayload, type ScanRecord, type ScanRequest, type ScanRequestResult, type ScanSchedulerProtocol, type ScanTaskPayload, type ScanType, type ScopeType, SearchReplacePatchError, type SectionChunk, type SecubotAgentParsed, type SecubotFileFlaw, type SecubotFixData, type SecubotFlaw, type SecubotFlawDetail, type SecubotLink, type SecubotQueryPayload, Session, type SessionAssociation, type SessionInit, type SessionOptions, type SettingsSnapshot, type SimpleCodeBlock, SkipReason, type SkippedTaskInfo, type SpecChangesTabDetail, type SpecDiff, SpecEditorIconState, SpecEditorSessionStatus, type SpecEditorTabInfo, SpecEditorTabStatus, SpecEditorTabType, SpecIconState, type SpecRollbackFileInfo, type SpecSessionInfo, type SpecSessionStatus, type SpecSessionWithStatus, type SpecTabDetail, type SpecTabInfo, SpecTabStatus, type SpecTabType, type SpecTaskRecord, SplitProviderText, type SseMcpServerConfigParsed, type SseMcpServerConfigRaw, type StartBackgroundServicePayload, StatusBarText, type StdioMcpServerConfigParsed, type StdioMcpServerConfigRaw, type StreamableHttpMcpServerConfigParsed, type StreamableHttpMcpServerConfigRaw, type AgentConfig as SubAgentConfig, type Suggestion, type SystemInfoParsed, type TabsStorageData, type TabsWorkspaceData, type TaskConfig, type TaskProgressChunk, type TaskProgressPayload, type TaskState, TaskStatus, TextModel, type ToTerminalAcceptMethod, type TodoNode, type ToolAcceptState, type ToolCallMessageDisplayParams, type ToolCallMessageDisplayResult, type ToolState, type TranslationKey, type TriggerConfig, type TriggerEvent, TriggerSource, UPDATE_RULE_PANEL_EVENT, UnitTestProviderText, type UserDefinedCommandConfig, type UserDefinedCommandFormValues, type UserDetail, type UserLogLevel, type VirtualDocument, VirtualDocumentAction, type VirtualEditMethod, VirtualEditor, type VirtualEditorMethodCall, type VisibilitySelector, VisibilitySelectorMatcher, WEBVIEW_CONSUMER, type WillScanPayload, WorkflowStatus, ZuluText, allowedNativeElement, applyDiff, applySearchReplaceChunk, axiosInstance, canHandleChatQuery, canHandleQuerySelector, canShowToUser, createAxiosCancelTokenSource, createAxiosInstance, createDeferred, customLogger, decodeBuffer, decodeFile, detectEncoding, emptyDir, encodeWithFileEncoding, ensureDirectoryExist, extractChunkContent, extractCodeBlocks, extractListFromMarkdown, extractMentionFilesFromRuleConfig, findCodeChunkStartLineIndex, fixUdiffLineMarker, formatPrompt, getApiHost, getCurrentUserKnowledgeSet, getCurrentUserPluginConfigSet, getDeviceDisplayName, getKnowledgeQueryResult, getMcpSettingsFilePath, getOsAppDataPath, getPromptTemplatePath, getPromptTemplateRootPath, getPromptTemplateUuidFromPath, getUserLicenseType, isAutomationBrowserPick, isCapabilityMatch, isInteractiveContent, isNativeElement, isSectionChunk, isWrappedChunk, knowledgeServiceHealthy, localPluginConfig, logStorage, loggingMiddleware, mergePluginConfig, normalizeAutomationBrowserFile, normalizeAutomationBrowserPick, parseAutomationBrowserPick, parseAutomationBrowserPicks, parseShellCommandName, patchEnvPath, pluginConfigDetail, readFileOrNull, readJson, readPluginDescription, remove, replaceFilePathInCodeSpan, replacePathTextInMarkdown, searchNarrowedCode, searchSimiliarCode, setApiHost, setLanguage, setPlatform, setPlatformAndEnvironment, trimIllegalMarkdownTodo, writeJSON };
|