@comate/zulu 0.7.1 → 0.7.3
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/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.d.ts +1 -0
- package/comate-engine/server.js +3 -3
- package/dist/bundle/index.js +2 -2
- package/package.json +1 -1
- package/comate-engine/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/comate-engine/plugins/aiscan/assets/icon.svg +0 -12
- package/comate-engine/plugins/aiscan/dist/index.js +0 -54426
- package/comate-engine/plugins/aiscan/package.json +0 -67
- package/comate-engine/plugins/appdev/assets/icon.png +0 -0
- package/comate-engine/plugins/appdev/dist/help.md +0 -12
- package/comate-engine/plugins/appdev/dist/index.d.ts +0 -2
- package/comate-engine/plugins/appdev/dist/index.js +0 -194
- package/comate-engine/plugins/appdev/dist/providers/err.d.ts +0 -8
- package/comate-engine/plugins/appdev/dist/providers/err.js +0 -37
- package/comate-engine/plugins/appdev/dist/providers/fallback.d.ts +0 -5
- package/comate-engine/plugins/appdev/dist/providers/fallback.js +0 -28
- package/comate-engine/plugins/appdev/dist/providers/help.d.ts +0 -8
- package/comate-engine/plugins/appdev/dist/providers/help.js +0 -19
- package/comate-engine/plugins/appdev/dist/providers/medusa.d.ts +0 -8
- package/comate-engine/plugins/appdev/dist/providers/medusa.js +0 -39
- package/comate-engine/plugins/appdev/dist/providers/qa.d.ts +0 -8
- package/comate-engine/plugins/appdev/dist/providers/qa.js +0 -33
- package/comate-engine/plugins/appdev/package.json +0 -67
- package/comate-engine/plugins/bfc/assets/bfc-icon.png +0 -0
- package/comate-engine/plugins/bfc/dist/config/config.d.ts +0 -4
- package/comate-engine/plugins/bfc/dist/config/config.js +0 -4
- package/comate-engine/plugins/bfc/dist/help.md +0 -11
- package/comate-engine/plugins/bfc/dist/index.d.ts +0 -2
- package/comate-engine/plugins/bfc/dist/index.js +0 -452
- package/comate-engine/plugins/bfc/dist/providers/bfcInstructMode.d.ts +0 -8
- package/comate-engine/plugins/bfc/dist/providers/bfcInstructMode.js +0 -77
- package/comate-engine/plugins/bfc/dist/providers/genAbnormalCode.d.ts +0 -8
- package/comate-engine/plugins/bfc/dist/providers/genAbnormalCode.js +0 -71
- package/comate-engine/plugins/bfc/dist/providers/genBfcCode.d.ts +0 -8
- package/comate-engine/plugins/bfc/dist/providers/genBfcCode.js +0 -74
- package/comate-engine/plugins/bfc/dist/providers/getBatchCases.d.ts +0 -10
- package/comate-engine/plugins/bfc/dist/providers/getBatchCases.js +0 -71
- package/comate-engine/plugins/bfc/dist/providers/help.d.ts +0 -8
- package/comate-engine/plugins/bfc/dist/providers/help.js +0 -19
- package/comate-engine/plugins/bfc/dist/service/generateService.d.ts +0 -14
- package/comate-engine/plugins/bfc/dist/service/generateService.js +0 -27
- package/comate-engine/plugins/bfc/package.json +0 -85
- package/comate-engine/plugins/bpm/assets/bpm.png +0 -0
- package/comate-engine/plugins/bpm/dist/index.js +0 -313
- package/comate-engine/plugins/bpm/package.json +0 -65
- package/comate-engine/plugins/casebuilder/assets/icon.svg +0 -1
- package/comate-engine/plugins/casebuilder/dist/help.md +0 -33
- package/comate-engine/plugins/casebuilder/dist/index.js +0 -837
- package/comate-engine/plugins/casebuilder/package.json +0 -80
- package/comate-engine/plugins/centrino/assets/icon.png +0 -0
- package/comate-engine/plugins/centrino/dist/help.md +0 -30
- package/comate-engine/plugins/centrino/dist/index.js +0 -1046
- package/comate-engine/plugins/centrino/package.json +0 -68
- package/comate-engine/plugins/cnap/assets/cnap.png +0 -0
- package/comate-engine/plugins/cnap/dist/help.md +0 -11
- package/comate-engine/plugins/cnap/dist/index.js +0 -171
- package/comate-engine/plugins/cnap/package.json +0 -65
- package/comate-engine/plugins/demo-timer/assets/icon.svg +0 -2
- package/comate-engine/plugins/demo-timer/dist/index.js +0 -463
- package/comate-engine/plugins/demo-timer/package.json +0 -73
- package/comate-engine/plugins/dev-tools/assets/icon.png +0 -0
- package/comate-engine/plugins/dev-tools/dist/help.md +0 -18
- package/comate-engine/plugins/dev-tools/dist/index.js +0 -166160
- package/comate-engine/plugins/dev-tools/package.json +0 -95
- package/comate-engine/plugins/devaux/assets/icon.svg +0 -1
- package/comate-engine/plugins/devaux/dist/help.md +0 -41
- package/comate-engine/plugins/devaux/dist/index.js +0 -75551
- package/comate-engine/plugins/devaux/dist/static/tree-sitter-cpp.wasm +0 -0
- package/comate-engine/plugins/devaux/dist/static/tree-sitter-go.wasm +0 -0
- package/comate-engine/plugins/devaux/dist/static/tree-sitter.wasm +0 -0
- package/comate-engine/plugins/devaux/dist/tree-sitter.wasm +0 -0
- package/comate-engine/plugins/devaux/package.json +0 -82
- package/comate-engine/plugins/f2c/assets/icon.svg +0 -11
- package/comate-engine/plugins/f2c/dist/help.md +0 -13
- package/comate-engine/plugins/f2c/dist/index.js +0 -101649
- package/comate-engine/plugins/f2c/package.json +0 -56
- package/comate-engine/plugins/fcnap/assets/icon.png +0 -0
- package/comate-engine/plugins/fcnap/dist/help.md +0 -9
- package/comate-engine/plugins/fcnap/dist/index.js +0 -105
- package/comate-engine/plugins/fcnap/package.json +0 -50
- package/comate-engine/plugins/front-end-skills/assets/icon.svg +0 -1
- package/comate-engine/plugins/front-end-skills/dist/help.md +0 -17
- package/comate-engine/plugins/front-end-skills/dist/index.js +0 -8172
- package/comate-engine/plugins/front-end-skills/package.json +0 -79
- package/comate-engine/plugins/gdp/assets/icon.png +0 -0
- package/comate-engine/plugins/gdp/dist/help.md +0 -11
- package/comate-engine/plugins/gdp/dist/index.js +0 -70806
- package/comate-engine/plugins/gdp/package.json +0 -80
- package/comate-engine/plugins/git/assets/git.svg +0 -1
- package/comate-engine/plugins/git/assets/icon.svg +0 -1
- package/comate-engine/plugins/git/dist/help.md +0 -7
- package/comate-engine/plugins/git/dist/index.js +0 -32765
- package/comate-engine/plugins/git/package.json +0 -91
- package/comate-engine/plugins/harmonyos/assets/harmonyos.png +0 -0
- package/comate-engine/plugins/harmonyos/dist/index.js +0 -78
- package/comate-engine/plugins/harmonyos/package.json +0 -37
- package/comate-engine/plugins/iapi/assets/icon.png +0 -0
- package/comate-engine/plugins/iapi/dist/help.md +0 -13
- package/comate-engine/plugins/iapi/dist/index.js +0 -458
- package/comate-engine/plugins/iapi/dist/static/lang/tree-sitter-go.wasm +0 -0
- package/comate-engine/plugins/iapi/dist/static/lang/tree-sitter-java.wasm +0 -0
- package/comate-engine/plugins/iapi/dist/static/tree-sitter-go.wasm +0 -0
- package/comate-engine/plugins/iapi/dist/static/tree-sitter-java.wasm +0 -0
- package/comate-engine/plugins/iapi/dist/tree-sitter.wasm +0 -0
- package/comate-engine/plugins/iapi/package.json +0 -102
- package/comate-engine/plugins/icafe/assets/icafe.svg +0 -1
- package/comate-engine/plugins/icafe/dist/help.md +0 -5
- package/comate-engine/plugins/icafe/dist/index.js +0 -885
- package/comate-engine/plugins/icafe/package.json +0 -74
- package/comate-engine/plugins/ievalue/assets/iEValue.svg +0 -10
- package/comate-engine/plugins/ievalue/dist/index.js +0 -2920
- package/comate-engine/plugins/ievalue/package.json +0 -88
- package/comate-engine/plugins/ipipe/assets/iPipePlugin.png +0 -0
- package/comate-engine/plugins/ipipe/dist/help.md +0 -15
- package/comate-engine/plugins/ipipe/dist/index.js +0 -7268
- package/comate-engine/plugins/ipipe/package.json +0 -62
- package/comate-engine/plugins/jarvis/assets/icon.svg +0 -1
- package/comate-engine/plugins/jarvis/dist/help.md +0 -17
- package/comate-engine/plugins/jarvis/dist/index.js +0 -140473
- package/comate-engine/plugins/jarvis/package.json +0 -93
- package/comate-engine/plugins/mapsearch/assets/mapsearchicon.png +0 -0
- package/comate-engine/plugins/mapsearch/dist/help.md +0 -4
- package/comate-engine/plugins/mapsearch/dist/index.js +0 -145
- package/comate-engine/plugins/mapsearch/package.json +0 -53
- package/comate-engine/plugins/paddle/assets/icon.png +0 -0
- package/comate-engine/plugins/paddle/assets/paconvert-3.0.1-py3-none-any.whl +0 -0
- package/comate-engine/plugins/paddle/dist/help.md +0 -31
- package/comate-engine/plugins/paddle/dist/index.js +0 -1011
- package/comate-engine/plugins/paddle/package.json +0 -129
- package/comate-engine/plugins/robot/assets/Robot.png +0 -0
- package/comate-engine/plugins/robot/dist/index.js +0 -476
- package/comate-engine/plugins/robot/package.json +0 -91
- package/comate-engine/plugins/security/assets/comate.png +0 -0
- package/comate-engine/plugins/security/dist/index.js +0 -18434
- package/comate-engine/plugins/security/package.json +0 -82
- package/comate-engine/plugins/smartapp/assets/icon.png +0 -0
- package/comate-engine/plugins/smartapp/dist/help.md +0 -4
- package/comate-engine/plugins/smartapp/dist/index.js +0 -113
- package/comate-engine/plugins/smartapp/package.json +0 -54
- package/comate-engine/plugins/testmate/assets/icon.svg +0 -1
- package/comate-engine/plugins/testmate/dist/help.md +0 -62
- package/comate-engine/plugins/testmate/dist/index.js +0 -21483
- package/comate-engine/plugins/testmate/package.json +0 -85
- package/comate-engine/plugins/tor/assets/TorPlugin.png +0 -0
- package/comate-engine/plugins/tor/dist/help.md +0 -22
- package/comate-engine/plugins/tor/dist/index.js +0 -807
- package/comate-engine/plugins/tor/package.json +0 -99
- package/comate-engine/plugins/weiyun/assets/icon.png +0 -0
- package/comate-engine/plugins/weiyun/dist/help.md +0 -11
- package/comate-engine/plugins/weiyun/dist/index.js +0 -100495
- package/comate-engine/plugins/weiyun/package.json +0 -55
- package/comate-engine/plugins/workcard/assets/favicon.png +0 -0
- package/comate-engine/plugins/workcard/dist/help.md +0 -30
- package/comate-engine/plugins/workcard/dist/index.js +0 -547
- package/comate-engine/plugins/workcard/package.json +0 -102
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"private": true,
|
|
3
|
-
"name": "@comate-plugin/aiscan",
|
|
4
|
-
"version": "0.8.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"clean": "rm -rf dist",
|
|
8
|
-
"dev": "cpd dev",
|
|
9
|
-
"build": "tsc && cpd build"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@gitbeaker/rest": "^39.34.3",
|
|
13
|
-
"hosted-git-info": "^7.0.1",
|
|
14
|
-
"octokit": "^3.1.2",
|
|
15
|
-
"simple-git": "^3.22.0"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@comate/plugin-cli": "^0.9.2",
|
|
19
|
-
"@comate/plugin-host": "^0.9.2",
|
|
20
|
-
"@types/vscode": "1.60.0",
|
|
21
|
-
"typescript": "^5.3.2",
|
|
22
|
-
"tar": "^7.4.3",
|
|
23
|
-
"@baiducloud/sdk": "1.0.1-beta.3",
|
|
24
|
-
"@comate/plugin-shared-internals": "^0.9.2"
|
|
25
|
-
},
|
|
26
|
-
"comate": {
|
|
27
|
-
"name": "aiscan",
|
|
28
|
-
"version": "1.0.0",
|
|
29
|
-
"icon": "./assets/icon.svg",
|
|
30
|
-
"entry": "./dist/index.js",
|
|
31
|
-
"displayName": "代码扫描",
|
|
32
|
-
"description": "代码扫描插件,用于扫描代码中的潜在问题。",
|
|
33
|
-
"keyword": [],
|
|
34
|
-
"capabilities": [
|
|
35
|
-
{
|
|
36
|
-
"type": "Fallback",
|
|
37
|
-
"name": "hello",
|
|
38
|
-
"displayName": "插件介绍",
|
|
39
|
-
"description": "确认插件成功运行并介绍开发方式"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"type": "Skill",
|
|
43
|
-
"name": "codeStyleCheck",
|
|
44
|
-
"displayName": "触发扫描任务",
|
|
45
|
-
"description": "包括代码规范检测、缺陷检测等",
|
|
46
|
-
"placeholder": "包括代码规范检测、缺陷检测等"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"type": "Skill",
|
|
50
|
-
"name": "iscanResult",
|
|
51
|
-
"displayName": "查看最近一次本地扫描结果",
|
|
52
|
-
"description": "包括代码规范检测、缺陷检测等",
|
|
53
|
-
"placeholder": "查看最近一次本地扫描结果"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"type": "Skill",
|
|
57
|
-
"name": "checkResultById",
|
|
58
|
-
"displayName": "查询iCode代码规范扫描结果",
|
|
59
|
-
"description": "查询iCode代码规范扫描结果",
|
|
60
|
-
"placeholder": "请输入代码规范扫描的jobId"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"configSchema": {
|
|
64
|
-
"sections": []
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
Binary file
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
您好,我是您的 AppDev 智能助手,我对移动端通用组件、工具、平台、端组件负责人信息,版本日历以及研发过程构建错误进行了深入的学习和掌握,我可以为您提供移动开发领域智能问答,提供构建过程中错误优化建议。
|
|
2
|
-
|
|
3
|
-
**智能问答**
|
|
4
|
-
* 提供 9 大类百度App研发过程文档知识, UBC、EasyBox、AppDev(Tekes)、研发规范 等知识问答,可准确回答您移动研发领域的相关知识,7x24小时实时响应
|
|
5
|
-
|
|
6
|
-
**智能析错**
|
|
7
|
-
* 智能析错主要提供研发阶段的各种错误分析,如环境错误、编译链接错误、构建错误等。面向所有研发工程师,但对移动端工程师增加了 MGIT、EasyBox、AppDev 等工具和平台错误的私域数据。
|
|
8
|
-
|
|
9
|
-
**Medusa(OC转JS)**
|
|
10
|
-
* Medusa 是百度 APP 自研的引擎与 PMS 插件平台面向 iOS 平台的热修复解决方案。
|
|
11
|
-
|
|
12
|
-
此外,如果您对 AppDev 智能助手插件还有其他使用需求或意见,可以进入《端研发大模型应用服务群》 **8785082** 反馈给我们。
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { SkillProvider, TaskProgressChunkStream, StringChunkStream, FallbackProvider } from '@comate/plugin-host';
|
|
2
|
-
import { readFileSync } from 'fs';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { dirname } from 'path';
|
|
5
|
-
|
|
6
|
-
class HelpSkillProvider extends SkillProvider {
|
|
7
|
-
static{
|
|
8
|
-
this.skillName = 'appdev-help';
|
|
9
|
-
}
|
|
10
|
-
static{
|
|
11
|
-
this.description = '插件介绍';
|
|
12
|
-
}
|
|
13
|
-
static{
|
|
14
|
-
this.parameters = {
|
|
15
|
-
type: 'object',
|
|
16
|
-
properties: {}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
async *execute() {
|
|
20
|
-
const stream = new TaskProgressChunkStream();
|
|
21
|
-
const filename = fileURLToPath(import.meta.url);
|
|
22
|
-
const content = readFileSync(`${dirname(filename)}/help.md`, 'utf8');
|
|
23
|
-
yield stream.flush(content);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
class qaProvider extends SkillProvider {
|
|
28
|
-
static{
|
|
29
|
-
this.skillName = 'qa';
|
|
30
|
-
}
|
|
31
|
-
static{
|
|
32
|
-
this.displayName = '智能问答';
|
|
33
|
-
}
|
|
34
|
-
static{
|
|
35
|
-
this.description = '智能问答';
|
|
36
|
-
}
|
|
37
|
-
static{
|
|
38
|
-
this.parameters = {
|
|
39
|
-
type: 'object',
|
|
40
|
-
properties: {}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
async *execute() {
|
|
44
|
-
const stream = new TaskProgressChunkStream();
|
|
45
|
-
const user = await this.currentUser.requestDetail();
|
|
46
|
-
const body = {
|
|
47
|
-
prompt: this.currentContext.query,
|
|
48
|
-
username: user ? user.name : '',
|
|
49
|
-
source: process.env.COMATE_ENGINE_APP_NAME
|
|
50
|
-
};
|
|
51
|
-
try {
|
|
52
|
-
const response = await fetch('http://tekes.baidu-int.com/devops/api/open/llm/doc/answer', {
|
|
53
|
-
method: 'POST',
|
|
54
|
-
headers: {
|
|
55
|
-
'Content-Type': 'application/json;charset=UTF-8'
|
|
56
|
-
},
|
|
57
|
-
body: JSON.stringify(body)
|
|
58
|
-
});
|
|
59
|
-
const result = await response.json();
|
|
60
|
-
yield stream.flushReplaceLast(result?.data?.text);
|
|
61
|
-
} catch (error) {
|
|
62
|
-
yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
class errProvider extends SkillProvider {
|
|
68
|
-
static{
|
|
69
|
-
this.skillName = 'err';
|
|
70
|
-
}
|
|
71
|
-
static{
|
|
72
|
-
this.displayName = '智能析错';
|
|
73
|
-
}
|
|
74
|
-
static{
|
|
75
|
-
this.description = '智能析错';
|
|
76
|
-
}
|
|
77
|
-
static{
|
|
78
|
-
this.parameters = {
|
|
79
|
-
type: 'object',
|
|
80
|
-
properties: {}
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
async *execute() {
|
|
84
|
-
const stream = new TaskProgressChunkStream();
|
|
85
|
-
const user = await this.currentUser.requestDetail();
|
|
86
|
-
const body = {
|
|
87
|
-
// eslint-disable-next-line
|
|
88
|
-
['err_msg']: this.currentContext.query,
|
|
89
|
-
ide: process.env.COMATE_ENGINE_APP_NAME,
|
|
90
|
-
username: user ? user.name : '',
|
|
91
|
-
platform: '',
|
|
92
|
-
// eslint-disable-next-line
|
|
93
|
-
['plugin_name']: ''
|
|
94
|
-
};
|
|
95
|
-
try {
|
|
96
|
-
const response = await fetch('http://10.11.173.7:8001/api/ai/compile', {
|
|
97
|
-
method: 'POST',
|
|
98
|
-
headers: {
|
|
99
|
-
'Content-Type': 'application/json'
|
|
100
|
-
},
|
|
101
|
-
body: JSON.stringify(body)
|
|
102
|
-
});
|
|
103
|
-
const result = await response.json();
|
|
104
|
-
yield stream.flushReplaceLast(JSON.parse(result)?.data?.content); // markdown字符串
|
|
105
|
-
} catch (error) {
|
|
106
|
-
yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
class medusaProvider extends SkillProvider {
|
|
112
|
-
static{
|
|
113
|
-
this.skillName = 'medusa';
|
|
114
|
-
}
|
|
115
|
-
static{
|
|
116
|
-
this.displayName = 'Medusa(OC转JS)';
|
|
117
|
-
}
|
|
118
|
-
static{
|
|
119
|
-
this.description = 'Medusa(OC转JS)';
|
|
120
|
-
}
|
|
121
|
-
static{
|
|
122
|
-
this.parameters = {
|
|
123
|
-
type: 'object',
|
|
124
|
-
properties: {}
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
async *execute() {
|
|
128
|
-
const stream = new StringChunkStream();
|
|
129
|
-
const user = await this.currentUser.requestDetail();
|
|
130
|
-
const { query, selectedCode, activeFileLanguage, activeFilePath } = this.currentContext;
|
|
131
|
-
const body = {
|
|
132
|
-
code: query || selectedCode,
|
|
133
|
-
language: activeFileLanguage,
|
|
134
|
-
ide: process.env.COMATE_ENGINE_APP_NAME,
|
|
135
|
-
username: user ? user.name : '',
|
|
136
|
-
filepath: activeFilePath
|
|
137
|
-
};
|
|
138
|
-
try {
|
|
139
|
-
const response = await fetch('http://tekes.baidu-int.com/devops/api/open/llm/medusa/tojs', {
|
|
140
|
-
method: 'POST',
|
|
141
|
-
headers: {
|
|
142
|
-
'Content-Type': 'application/json'
|
|
143
|
-
},
|
|
144
|
-
body: JSON.stringify(body)
|
|
145
|
-
});
|
|
146
|
-
const result = await response.json();
|
|
147
|
-
yield stream.flushReplaceLast(result?.data?.js); // markdown字符串
|
|
148
|
-
if (result?.code !== 0) {
|
|
149
|
-
yield stream.flushReplaceLast('执行失败,请检查语法或联系负责人。');
|
|
150
|
-
}
|
|
151
|
-
} catch (error) {
|
|
152
|
-
yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
class fallbackProvider extends FallbackProvider {
|
|
158
|
-
static{
|
|
159
|
-
this.description = '智能问答';
|
|
160
|
-
}
|
|
161
|
-
async *handleQuery() {
|
|
162
|
-
const stream = new TaskProgressChunkStream();
|
|
163
|
-
const user = await this.currentUser.requestDetail();
|
|
164
|
-
const host = await this.retriever.hostInfo();
|
|
165
|
-
const body = {
|
|
166
|
-
prompt: this.currentContext.query,
|
|
167
|
-
username: user ? user.name : '',
|
|
168
|
-
source: host.appName
|
|
169
|
-
};
|
|
170
|
-
try {
|
|
171
|
-
const response = await fetch('http://tekes.baidu-int.com/devops/api/open/llm/doc/answer', {
|
|
172
|
-
method: 'POST',
|
|
173
|
-
headers: {
|
|
174
|
-
'Content-Type': 'application/json;charset=UTF-8'
|
|
175
|
-
},
|
|
176
|
-
body: JSON.stringify(body)
|
|
177
|
-
});
|
|
178
|
-
const result = await response.json();
|
|
179
|
-
yield stream.flushReplaceLast(result?.data?.text);
|
|
180
|
-
} catch (error) {
|
|
181
|
-
yield stream.fail(`请求出错,请联系负责人或稍后再试。${error}`);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function setup({ registry }) {
|
|
187
|
-
registry.registerSkillProvider('appdev-help', HelpSkillProvider);
|
|
188
|
-
registry.registerSkillProvider('qa', qaProvider);
|
|
189
|
-
registry.registerSkillProvider('err', errProvider);
|
|
190
|
-
registry.registerSkillProvider('medusa', medusaProvider);
|
|
191
|
-
registry.registerFallbackProvider('fallback', fallbackProvider);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export { setup };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SkillProvider, FunctionParameterDefinition, TaskProgressChunk } from '@comate/plugin-host';
|
|
2
|
-
export declare class errProvider extends SkillProvider {
|
|
3
|
-
static skillName: string;
|
|
4
|
-
static displayName: string;
|
|
5
|
-
static description: string;
|
|
6
|
-
static parameters: FunctionParameterDefinition;
|
|
7
|
-
execute(): AsyncIterableIterator<TaskProgressChunk>;
|
|
8
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { SkillProvider, TaskProgressChunkStream, } from '@comate/plugin-host';
|
|
2
|
-
export class errProvider extends SkillProvider {
|
|
3
|
-
static skillName = 'err';
|
|
4
|
-
static displayName = '智能析错';
|
|
5
|
-
static description = '智能析错';
|
|
6
|
-
static parameters = {
|
|
7
|
-
type: 'object',
|
|
8
|
-
properties: {},
|
|
9
|
-
};
|
|
10
|
-
async *execute() {
|
|
11
|
-
const stream = new TaskProgressChunkStream();
|
|
12
|
-
const user = await this.currentUser.requestDetail();
|
|
13
|
-
const body = {
|
|
14
|
-
// eslint-disable-next-line
|
|
15
|
-
['err_msg']: this.currentContext.query,
|
|
16
|
-
ide: process.env.COMATE_ENGINE_APP_NAME,
|
|
17
|
-
username: user ? user.name : '',
|
|
18
|
-
platform: '',
|
|
19
|
-
// eslint-disable-next-line
|
|
20
|
-
['plugin_name']: '',
|
|
21
|
-
};
|
|
22
|
-
try {
|
|
23
|
-
const response = await fetch('http://10.11.173.7:8001/api/ai/compile', {
|
|
24
|
-
method: 'POST',
|
|
25
|
-
headers: {
|
|
26
|
-
'Content-Type': 'application/json',
|
|
27
|
-
},
|
|
28
|
-
body: JSON.stringify(body),
|
|
29
|
-
});
|
|
30
|
-
const result = await response.json();
|
|
31
|
-
yield stream.flushReplaceLast(JSON.parse(result)?.data?.content); // markdown字符串
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { TaskProgressChunkStream, FallbackProvider, } from '@comate/plugin-host';
|
|
2
|
-
export class fallbackProvider extends FallbackProvider {
|
|
3
|
-
static description = '智能问答';
|
|
4
|
-
async *handleQuery() {
|
|
5
|
-
const stream = new TaskProgressChunkStream();
|
|
6
|
-
const user = await this.currentUser.requestDetail();
|
|
7
|
-
const host = await this.retriever.hostInfo();
|
|
8
|
-
const body = {
|
|
9
|
-
prompt: this.currentContext.query,
|
|
10
|
-
username: user ? user.name : '',
|
|
11
|
-
source: host.appName,
|
|
12
|
-
};
|
|
13
|
-
try {
|
|
14
|
-
const response = await fetch('http://tekes.baidu-int.com/devops/api/open/llm/doc/answer', {
|
|
15
|
-
method: 'POST',
|
|
16
|
-
headers: {
|
|
17
|
-
'Content-Type': 'application/json;charset=UTF-8',
|
|
18
|
-
},
|
|
19
|
-
body: JSON.stringify(body),
|
|
20
|
-
});
|
|
21
|
-
const result = await response.json();
|
|
22
|
-
yield stream.flushReplaceLast(result?.data?.text);
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
yield stream.fail(`请求出错,请联系负责人或稍后再试。${error}`);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FunctionParameterDefinition, SkillProvider, TaskProgressChunk } from '@comate/plugin-host';
|
|
2
|
-
export declare class HelpSkillProvider extends SkillProvider {
|
|
3
|
-
static skillName: string;
|
|
4
|
-
static displayName: '插件介绍';
|
|
5
|
-
static description: string;
|
|
6
|
-
static parameters: FunctionParameterDefinition;
|
|
7
|
-
execute(): AsyncIterableIterator<TaskProgressChunk>;
|
|
8
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SkillProvider, TaskProgressChunkStream, } from '@comate/plugin-host';
|
|
2
|
-
import { readFileSync } from 'fs';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { dirname } from 'path';
|
|
5
|
-
export class HelpSkillProvider extends SkillProvider {
|
|
6
|
-
static skillName = 'appdev-help';
|
|
7
|
-
static displayName;
|
|
8
|
-
static description = '插件介绍';
|
|
9
|
-
static parameters = {
|
|
10
|
-
type: 'object',
|
|
11
|
-
properties: {},
|
|
12
|
-
};
|
|
13
|
-
async *execute() {
|
|
14
|
-
const stream = new TaskProgressChunkStream();
|
|
15
|
-
const filename = fileURLToPath(import.meta.url);
|
|
16
|
-
const content = readFileSync(`${dirname(filename)}/help.md`, 'utf8');
|
|
17
|
-
yield stream.flush(content);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SkillProvider, FunctionParameterDefinition, TaskProgressChunk } from '@comate/plugin-host';
|
|
2
|
-
export declare class medusaProvider extends SkillProvider {
|
|
3
|
-
static skillName: string;
|
|
4
|
-
static displayName: string;
|
|
5
|
-
static description: string;
|
|
6
|
-
static parameters: FunctionParameterDefinition;
|
|
7
|
-
execute(): AsyncIterableIterator<TaskProgressChunk>;
|
|
8
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { SkillProvider, StringChunkStream, } from '@comate/plugin-host';
|
|
2
|
-
export class medusaProvider extends SkillProvider {
|
|
3
|
-
static skillName = 'medusa';
|
|
4
|
-
static displayName = 'Medusa(OC转JS)';
|
|
5
|
-
static description = 'Medusa(OC转JS)';
|
|
6
|
-
static parameters = {
|
|
7
|
-
type: 'object',
|
|
8
|
-
properties: {},
|
|
9
|
-
};
|
|
10
|
-
async *execute() {
|
|
11
|
-
const stream = new StringChunkStream();
|
|
12
|
-
const user = await this.currentUser.requestDetail();
|
|
13
|
-
const { query, selectedCode, activeFileLanguage, activeFilePath } = this.currentContext;
|
|
14
|
-
const body = {
|
|
15
|
-
code: query || selectedCode,
|
|
16
|
-
language: activeFileLanguage,
|
|
17
|
-
ide: process.env.COMATE_ENGINE_APP_NAME,
|
|
18
|
-
username: user ? user.name : '',
|
|
19
|
-
filepath: activeFilePath,
|
|
20
|
-
};
|
|
21
|
-
try {
|
|
22
|
-
const response = await fetch('http://tekes.baidu-int.com/devops/api/open/llm/medusa/tojs', {
|
|
23
|
-
method: 'POST',
|
|
24
|
-
headers: {
|
|
25
|
-
'Content-Type': 'application/json',
|
|
26
|
-
},
|
|
27
|
-
body: JSON.stringify(body),
|
|
28
|
-
});
|
|
29
|
-
const result = await response.json();
|
|
30
|
-
yield stream.flushReplaceLast(result?.data?.js); // markdown字符串
|
|
31
|
-
if (result?.code !== 0) {
|
|
32
|
-
yield stream.flushReplaceLast('执行失败,请检查语法或联系负责人。');
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SkillProvider, FunctionParameterDefinition, TaskProgressChunk } from '@comate/plugin-host';
|
|
2
|
-
export declare class qaProvider extends SkillProvider {
|
|
3
|
-
static skillName: string;
|
|
4
|
-
static displayName: string;
|
|
5
|
-
static description: string;
|
|
6
|
-
static parameters: FunctionParameterDefinition;
|
|
7
|
-
execute(): AsyncIterableIterator<TaskProgressChunk>;
|
|
8
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { SkillProvider, TaskProgressChunkStream, } from '@comate/plugin-host';
|
|
2
|
-
export class qaProvider extends SkillProvider {
|
|
3
|
-
static skillName = 'qa';
|
|
4
|
-
static displayName = '智能问答';
|
|
5
|
-
static description = '智能问答';
|
|
6
|
-
static parameters = {
|
|
7
|
-
type: 'object',
|
|
8
|
-
properties: {},
|
|
9
|
-
};
|
|
10
|
-
async *execute() {
|
|
11
|
-
const stream = new TaskProgressChunkStream();
|
|
12
|
-
const user = await this.currentUser.requestDetail();
|
|
13
|
-
const body = {
|
|
14
|
-
prompt: this.currentContext.query,
|
|
15
|
-
username: user ? user.name : '',
|
|
16
|
-
source: process.env.COMATE_ENGINE_APP_NAME,
|
|
17
|
-
};
|
|
18
|
-
try {
|
|
19
|
-
const response = await fetch('http://tekes.baidu-int.com/devops/api/open/llm/doc/answer', {
|
|
20
|
-
method: 'POST',
|
|
21
|
-
headers: {
|
|
22
|
-
'Content-Type': 'application/json;charset=UTF-8',
|
|
23
|
-
},
|
|
24
|
-
body: JSON.stringify(body),
|
|
25
|
-
});
|
|
26
|
-
const result = await response.json();
|
|
27
|
-
yield stream.flushReplaceLast(result?.data?.text);
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"private": true,
|
|
3
|
-
"name": "@comate-plugin/appdev",
|
|
4
|
-
"version": "0.8.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"clean": "rm -rf dist",
|
|
8
|
-
"dev": "cpd dev",
|
|
9
|
-
"build": "tsc && cpd build",
|
|
10
|
-
"lint": "eslint --max-warnings=0 src"
|
|
11
|
-
},
|
|
12
|
-
"dependencies": {},
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"@comate/plugin-cli": "^0.9.2",
|
|
15
|
-
"@comate/plugin-host": "^0.9.2",
|
|
16
|
-
"eslint": "^8.54.0",
|
|
17
|
-
"typescript": "^5.3.3"
|
|
18
|
-
},
|
|
19
|
-
"comate": {
|
|
20
|
-
"name": "appdev",
|
|
21
|
-
"version": "1.0.0",
|
|
22
|
-
"icon": "./assets/icon.png",
|
|
23
|
-
"entry": "./dist/index.js",
|
|
24
|
-
"displayName": "AppDev",
|
|
25
|
-
"description": "移动端智能问答,智能析错",
|
|
26
|
-
"keyword": [
|
|
27
|
-
"AppDev",
|
|
28
|
-
"appdev"
|
|
29
|
-
],
|
|
30
|
-
"capabilities": [
|
|
31
|
-
{
|
|
32
|
-
"type": "Skill",
|
|
33
|
-
"name": "appdev-help",
|
|
34
|
-
"displayName": "插件介绍",
|
|
35
|
-
"description": "插件介绍",
|
|
36
|
-
"placeholder": "无需输入内容,回车获得插件介绍"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"type": "Skill",
|
|
40
|
-
"name": "qa",
|
|
41
|
-
"displayName": "智能问答",
|
|
42
|
-
"description": "智能问答"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"type": "Skill",
|
|
46
|
-
"name": "err",
|
|
47
|
-
"displayName": "智能析错",
|
|
48
|
-
"description": "智能析错"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"type": "Skill",
|
|
52
|
-
"name": "medusa",
|
|
53
|
-
"displayName": "Medusa(OC转JS)",
|
|
54
|
-
"description": "Medusa(OC转JS)"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"type": "Fallback",
|
|
58
|
-
"name": "fallback",
|
|
59
|
-
"displayName": "智能问答",
|
|
60
|
-
"description": "智能问答"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"configSchema": {
|
|
64
|
-
"sections": []
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
Binary file
|