@comate/zulu 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.d.ts +1 -0
  2. package/comate-engine/server.js +3 -3
  3. package/dist/bundle/index.js +2 -2
  4. package/package.json +1 -1
  5. package/comate-engine/plugins/aiscan/assets/icon.svg +0 -12
  6. package/comate-engine/plugins/aiscan/dist/index.js +0 -54426
  7. package/comate-engine/plugins/aiscan/package.json +0 -67
  8. package/comate-engine/plugins/appdev/assets/icon.png +0 -0
  9. package/comate-engine/plugins/appdev/dist/help.md +0 -12
  10. package/comate-engine/plugins/appdev/dist/index.d.ts +0 -2
  11. package/comate-engine/plugins/appdev/dist/index.js +0 -194
  12. package/comate-engine/plugins/appdev/dist/providers/err.d.ts +0 -8
  13. package/comate-engine/plugins/appdev/dist/providers/err.js +0 -37
  14. package/comate-engine/plugins/appdev/dist/providers/fallback.d.ts +0 -5
  15. package/comate-engine/plugins/appdev/dist/providers/fallback.js +0 -28
  16. package/comate-engine/plugins/appdev/dist/providers/help.d.ts +0 -8
  17. package/comate-engine/plugins/appdev/dist/providers/help.js +0 -19
  18. package/comate-engine/plugins/appdev/dist/providers/medusa.d.ts +0 -8
  19. package/comate-engine/plugins/appdev/dist/providers/medusa.js +0 -39
  20. package/comate-engine/plugins/appdev/dist/providers/qa.d.ts +0 -8
  21. package/comate-engine/plugins/appdev/dist/providers/qa.js +0 -33
  22. package/comate-engine/plugins/appdev/package.json +0 -67
  23. package/comate-engine/plugins/bfc/assets/bfc-icon.png +0 -0
  24. package/comate-engine/plugins/bfc/dist/config/config.d.ts +0 -4
  25. package/comate-engine/plugins/bfc/dist/config/config.js +0 -4
  26. package/comate-engine/plugins/bfc/dist/help.md +0 -11
  27. package/comate-engine/plugins/bfc/dist/index.d.ts +0 -2
  28. package/comate-engine/plugins/bfc/dist/index.js +0 -452
  29. package/comate-engine/plugins/bfc/dist/providers/bfcInstructMode.d.ts +0 -8
  30. package/comate-engine/plugins/bfc/dist/providers/bfcInstructMode.js +0 -77
  31. package/comate-engine/plugins/bfc/dist/providers/genAbnormalCode.d.ts +0 -8
  32. package/comate-engine/plugins/bfc/dist/providers/genAbnormalCode.js +0 -71
  33. package/comate-engine/plugins/bfc/dist/providers/genBfcCode.d.ts +0 -8
  34. package/comate-engine/plugins/bfc/dist/providers/genBfcCode.js +0 -74
  35. package/comate-engine/plugins/bfc/dist/providers/getBatchCases.d.ts +0 -10
  36. package/comate-engine/plugins/bfc/dist/providers/getBatchCases.js +0 -71
  37. package/comate-engine/plugins/bfc/dist/providers/help.d.ts +0 -8
  38. package/comate-engine/plugins/bfc/dist/providers/help.js +0 -19
  39. package/comate-engine/plugins/bfc/dist/service/generateService.d.ts +0 -14
  40. package/comate-engine/plugins/bfc/dist/service/generateService.js +0 -27
  41. package/comate-engine/plugins/bfc/package.json +0 -85
  42. package/comate-engine/plugins/bpm/assets/bpm.png +0 -0
  43. package/comate-engine/plugins/bpm/dist/index.js +0 -313
  44. package/comate-engine/plugins/bpm/package.json +0 -65
  45. package/comate-engine/plugins/casebuilder/assets/icon.svg +0 -1
  46. package/comate-engine/plugins/casebuilder/dist/help.md +0 -33
  47. package/comate-engine/plugins/casebuilder/dist/index.js +0 -837
  48. package/comate-engine/plugins/casebuilder/package.json +0 -80
  49. package/comate-engine/plugins/centrino/assets/icon.png +0 -0
  50. package/comate-engine/plugins/centrino/dist/help.md +0 -30
  51. package/comate-engine/plugins/centrino/dist/index.js +0 -1046
  52. package/comate-engine/plugins/centrino/package.json +0 -68
  53. package/comate-engine/plugins/cnap/assets/cnap.png +0 -0
  54. package/comate-engine/plugins/cnap/dist/help.md +0 -11
  55. package/comate-engine/plugins/cnap/dist/index.js +0 -171
  56. package/comate-engine/plugins/cnap/package.json +0 -65
  57. package/comate-engine/plugins/demo-timer/assets/icon.svg +0 -2
  58. package/comate-engine/plugins/demo-timer/dist/index.js +0 -463
  59. package/comate-engine/plugins/demo-timer/package.json +0 -73
  60. package/comate-engine/plugins/dev-tools/assets/icon.png +0 -0
  61. package/comate-engine/plugins/dev-tools/dist/help.md +0 -18
  62. package/comate-engine/plugins/dev-tools/dist/index.js +0 -166160
  63. package/comate-engine/plugins/dev-tools/package.json +0 -95
  64. package/comate-engine/plugins/devaux/assets/icon.svg +0 -1
  65. package/comate-engine/plugins/devaux/dist/help.md +0 -41
  66. package/comate-engine/plugins/devaux/dist/index.js +0 -75551
  67. package/comate-engine/plugins/devaux/dist/static/tree-sitter-cpp.wasm +0 -0
  68. package/comate-engine/plugins/devaux/dist/static/tree-sitter-go.wasm +0 -0
  69. package/comate-engine/plugins/devaux/dist/static/tree-sitter.wasm +0 -0
  70. package/comate-engine/plugins/devaux/dist/tree-sitter.wasm +0 -0
  71. package/comate-engine/plugins/devaux/package.json +0 -82
  72. package/comate-engine/plugins/f2c/assets/icon.svg +0 -11
  73. package/comate-engine/plugins/f2c/dist/help.md +0 -13
  74. package/comate-engine/plugins/f2c/dist/index.js +0 -101649
  75. package/comate-engine/plugins/f2c/package.json +0 -56
  76. package/comate-engine/plugins/fcnap/assets/icon.png +0 -0
  77. package/comate-engine/plugins/fcnap/dist/help.md +0 -9
  78. package/comate-engine/plugins/fcnap/dist/index.js +0 -105
  79. package/comate-engine/plugins/fcnap/package.json +0 -50
  80. package/comate-engine/plugins/front-end-skills/assets/icon.svg +0 -1
  81. package/comate-engine/plugins/front-end-skills/dist/help.md +0 -17
  82. package/comate-engine/plugins/front-end-skills/dist/index.js +0 -8172
  83. package/comate-engine/plugins/front-end-skills/package.json +0 -79
  84. package/comate-engine/plugins/gdp/assets/icon.png +0 -0
  85. package/comate-engine/plugins/gdp/dist/help.md +0 -11
  86. package/comate-engine/plugins/gdp/dist/index.js +0 -70806
  87. package/comate-engine/plugins/gdp/package.json +0 -80
  88. package/comate-engine/plugins/git/assets/git.svg +0 -1
  89. package/comate-engine/plugins/git/assets/icon.svg +0 -1
  90. package/comate-engine/plugins/git/dist/help.md +0 -7
  91. package/comate-engine/plugins/git/dist/index.js +0 -32765
  92. package/comate-engine/plugins/git/package.json +0 -91
  93. package/comate-engine/plugins/harmonyos/assets/harmonyos.png +0 -0
  94. package/comate-engine/plugins/harmonyos/dist/index.js +0 -78
  95. package/comate-engine/plugins/harmonyos/package.json +0 -37
  96. package/comate-engine/plugins/iapi/assets/icon.png +0 -0
  97. package/comate-engine/plugins/iapi/dist/help.md +0 -13
  98. package/comate-engine/plugins/iapi/dist/index.js +0 -458
  99. package/comate-engine/plugins/iapi/dist/static/lang/tree-sitter-go.wasm +0 -0
  100. package/comate-engine/plugins/iapi/dist/static/lang/tree-sitter-java.wasm +0 -0
  101. package/comate-engine/plugins/iapi/dist/static/tree-sitter-go.wasm +0 -0
  102. package/comate-engine/plugins/iapi/dist/static/tree-sitter-java.wasm +0 -0
  103. package/comate-engine/plugins/iapi/dist/tree-sitter.wasm +0 -0
  104. package/comate-engine/plugins/iapi/package.json +0 -102
  105. package/comate-engine/plugins/icafe/assets/icafe.svg +0 -1
  106. package/comate-engine/plugins/icafe/dist/help.md +0 -5
  107. package/comate-engine/plugins/icafe/dist/index.js +0 -885
  108. package/comate-engine/plugins/icafe/package.json +0 -74
  109. package/comate-engine/plugins/ievalue/assets/iEValue.svg +0 -10
  110. package/comate-engine/plugins/ievalue/dist/index.js +0 -2920
  111. package/comate-engine/plugins/ievalue/package.json +0 -88
  112. package/comate-engine/plugins/ipipe/assets/iPipePlugin.png +0 -0
  113. package/comate-engine/plugins/ipipe/dist/help.md +0 -15
  114. package/comate-engine/plugins/ipipe/dist/index.js +0 -7268
  115. package/comate-engine/plugins/ipipe/package.json +0 -62
  116. package/comate-engine/plugins/jarvis/assets/icon.svg +0 -1
  117. package/comate-engine/plugins/jarvis/dist/help.md +0 -17
  118. package/comate-engine/plugins/jarvis/dist/index.js +0 -140473
  119. package/comate-engine/plugins/jarvis/package.json +0 -93
  120. package/comate-engine/plugins/mapsearch/assets/mapsearchicon.png +0 -0
  121. package/comate-engine/plugins/mapsearch/dist/help.md +0 -4
  122. package/comate-engine/plugins/mapsearch/dist/index.js +0 -145
  123. package/comate-engine/plugins/mapsearch/package.json +0 -53
  124. package/comate-engine/plugins/paddle/assets/icon.png +0 -0
  125. package/comate-engine/plugins/paddle/assets/paconvert-3.0.1-py3-none-any.whl +0 -0
  126. package/comate-engine/plugins/paddle/dist/help.md +0 -31
  127. package/comate-engine/plugins/paddle/dist/index.js +0 -1011
  128. package/comate-engine/plugins/paddle/package.json +0 -129
  129. package/comate-engine/plugins/robot/assets/Robot.png +0 -0
  130. package/comate-engine/plugins/robot/dist/index.js +0 -476
  131. package/comate-engine/plugins/robot/package.json +0 -91
  132. package/comate-engine/plugins/security/assets/comate.png +0 -0
  133. package/comate-engine/plugins/security/dist/index.js +0 -18434
  134. package/comate-engine/plugins/security/package.json +0 -82
  135. package/comate-engine/plugins/smartapp/assets/icon.png +0 -0
  136. package/comate-engine/plugins/smartapp/dist/help.md +0 -4
  137. package/comate-engine/plugins/smartapp/dist/index.js +0 -113
  138. package/comate-engine/plugins/smartapp/package.json +0 -54
  139. package/comate-engine/plugins/testmate/assets/icon.svg +0 -1
  140. package/comate-engine/plugins/testmate/dist/help.md +0 -62
  141. package/comate-engine/plugins/testmate/dist/index.js +0 -21483
  142. package/comate-engine/plugins/testmate/package.json +0 -85
  143. package/comate-engine/plugins/tor/assets/TorPlugin.png +0 -0
  144. package/comate-engine/plugins/tor/dist/help.md +0 -22
  145. package/comate-engine/plugins/tor/dist/index.js +0 -807
  146. package/comate-engine/plugins/tor/package.json +0 -99
  147. package/comate-engine/plugins/weiyun/assets/icon.png +0 -0
  148. package/comate-engine/plugins/weiyun/dist/help.md +0 -11
  149. package/comate-engine/plugins/weiyun/dist/index.js +0 -100495
  150. package/comate-engine/plugins/weiyun/package.json +0 -55
  151. package/comate-engine/plugins/workcard/assets/favicon.png +0 -0
  152. package/comate-engine/plugins/workcard/dist/help.md +0 -30
  153. package/comate-engine/plugins/workcard/dist/index.js +0 -547
  154. package/comate-engine/plugins/workcard/package.json +0 -102
@@ -1,55 +0,0 @@
1
- {
2
- "private": true,
3
- "name": "@comate-plugin/weiyun",
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
- "devDependencies": {
12
- "@comate/plugin-cli": "^0.9.2",
13
- "@comate/plugin-host": "^0.9.2",
14
- "form-data": "^4.0.0",
15
- "node-fetch": "^2.6.1",
16
- "@types/node-fetch": "^2.6.1"
17
- },
18
- "comate": {
19
- "name": "weiyun",
20
- "version": "1.0.0",
21
- "icon": "./assets/icon.png",
22
- "entry": "./dist/index.js",
23
- "displayName": "微云助手",
24
- "description": "微云助手",
25
- "keyword": [],
26
- "capabilities": [
27
- {
28
- "type": "Skill",
29
- "name": "weiyun-help",
30
- "displayName": "插件介绍",
31
- "description": "微云助手是什么"
32
- },
33
- {
34
- "type": "Skill",
35
- "name": "weiyunDeploy",
36
- "displayName": "应用部署",
37
- "description": "微云更新部署",
38
- "placeholder": "请输入部署应用对应的配置名"
39
- },
40
- {
41
- "type": "Fallback",
42
- "name": "fallback",
43
- "displayName": "对话框兜底",
44
- "description": "对话框兜底"
45
- }
46
- ],
47
- "configSchema": {
48
- "sections": []
49
- }
50
- },
51
- "dependencies": {
52
- "form-data": "^4.0.0",
53
- "simple-git": "^3.22.0"
54
- }
55
- }
@@ -1,30 +0,0 @@
1
- 您好,我是智能工作卡接入代码编写助手,提供卡片发送参数对象定义,修改卡片接口入参定义,回调接口入参和返回值定义,回调加解密方法等能力。
2
- 按照智卡能力接入习惯,可按照顺序依次使用一下能力,如无异常,可以点击『生成文件』按钮直接保存使用:
3
-
4
- **1. 生成可调试发卡框架**
5
- - 使用场景:业务接入工作卡时,发送卡片。
6
- - 指令描述:该指令会生成1个java类,包含了发送卡片方法以及所依赖的所有方法步骤。
7
- **2. 生成气泡卡可调试发卡框架**
8
- - 使用场景:业务接入群智能机器人发送的气泡卡时,发送卡片。
9
- - 指令描述:该指令会生成1个java类,包含了发送气泡卡方法以及所依赖的所有方法步骤。
10
- **3. 生成鉴权的appToken方法**
11
- - 使用场景:业务发送卡片时,调用卡片发送接口需要在请求头传入appToken字段,用于鉴权。
12
- - 指令描述:该指令会生成1个java类,包含了获取appToken方法以及发送post请求方法和调试使用的Main方法。
13
- **4. 生成卡片UserData对象**
14
- - 使用场景:业务在接入工作卡时,发送卡片,修改卡片,回调返回都会用到该对象
15
- - 指令描述:根据用户输入模板ID将卡片模板中绑定的动态变量转化为Java对象,并生成对应的代码;该指令生成一个java类。
16
- 其中类名:WorkCardUserData建议修改为业务相关名称
17
- **5. 生成卡片发送入参&返回值对象**
18
- - 使用场景:业务创建完卡片模板后,开发「卡片发送」代码逻辑时
19
- - 指令描述:该指令会生成2个java类,一个为发卡接口入参SendCardRequest,一个为发卡请求返回值SendCardResponse。
20
- **6. 生成卡片修改请求入参对象**
21
- - 使用场景:业务需要修改已发送卡片内容,开发「卡片修改」代码逻辑时
22
- - 指令描述:该指令会生成1个java类,根据用户输入模板ID自动生成卡片「修改接口」入参对应的Java对象ModifyCardRequest。
23
- **7. 生成卡片回调入参&返回值对象**
24
- - 使用场景:业务处理「卡片回调」逻辑时
25
- - 指令描述:该指令会生成3个java类,一个为回调入参解密后参数对象CallbackRequestMsgJson,一个为回调业务响应数据CallbackResponseMsgJson,一个为回调方法实际返回对象CallbackResponse(加密后)。
26
- **8. 回调加解密方法**
27
- - 使用场景:业务处理「卡片回调」逻辑时,处理接收参数(解密),以及处理返回值(加密)
28
- - 指令描述:该指令会生成1个java类,包含了回调入参解析解密方法,以及回调业务响应加密算法。
29
-
30
- 如果您在使用过程中发现问题或有其他需求、建议,欢迎加入我们的如流用户群 **5798923** 进行反馈。
@@ -1,547 +0,0 @@
1
- import { SkillProvider, StringChunkStream, TaskProgressChunkStream } 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 = 'workcard-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 StringChunkStream();
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
- const SEARCH_URL = 'https://uflow-gray.baidu-int.com/workflow/api/flow/v1/trigger-webhook/a072fd263b524206bb1a3f1b485a8bb9';
28
-
29
- class buildParamForUserDataProvider extends SkillProvider {
30
- static{
31
- this.skillName = 'buildParamForUserData';
32
- }
33
- static{
34
- this.displayName = '生成卡片模板UserData对象';
35
- }
36
- static{
37
- this.description = '构建卡片模板参数对应对象';
38
- }
39
- static{
40
- this.parameters = {
41
- type: 'object',
42
- properties: {}
43
- };
44
- }
45
- async *execute() {
46
- // 用户在输入框输入的问题
47
- const { query } = this.currentContext;
48
- const stream = new StringChunkStream();
49
- yield stream.flush('正在思考中,请耐心等候...');
50
- const userDetail = await this.currentUser.requestDetail();
51
- const realUserName = userDetail && userDetail.name || '未知用户';
52
- const codePath = this.currentContext.activeFilePath;
53
- const activeFileLanguage = this.currentContext.activeFileLanguage;
54
- const repository = await this.retriever.repositoryInfo();
55
- const raw = JSON.stringify({
56
- query,
57
- task_engine_userId: realUserName,
58
- codePath,
59
- activeFileLanguage,
60
- repository,
61
- source: 'comate',
62
- cmdType: 'buildParamForUserData'
63
- });
64
- const options = {
65
- method: 'POST',
66
- headers: {
67
- 'Content-Type': 'application/json'
68
- },
69
- body: raw
70
- };
71
- try {
72
- const response = await fetch(SEARCH_URL, options);
73
- const result = await response.json();
74
- yield stream.flushReplaceLast(result.content); // markdown字符串
75
- } catch (ex) {
76
- yield stream.flushReplaceLast(`请求出错,请联系负责人(wangjie66)或稍后再试。${ex instanceof Error ? ex.message : ''}`);
77
- }
78
- }
79
- defaultArgumentValue() {
80
- return {
81
- query: '任意代码'
82
- };
83
- }
84
- }
85
-
86
- class buildParamForSendCardProvider extends SkillProvider {
87
- static{
88
- this.skillName = 'buildParamForSendCard';
89
- }
90
- static{
91
- this.displayName = '生成卡片发送请求入参&返回值对象';
92
- }
93
- static{
94
- this.description = '生成卡片发送请求入参&返回值对象';
95
- }
96
- static{
97
- this.parameters = {
98
- type: 'object',
99
- properties: {}
100
- };
101
- }
102
- async *execute() {
103
- // 用户在输入框输入的问题
104
- const { query } = this.currentContext;
105
- const stream = new TaskProgressChunkStream();
106
- const userDetail = await this.currentUser.requestDetail();
107
- const realUserName = userDetail && userDetail.name || '未知用户';
108
- const codePath = this.currentContext.activeFilePath;
109
- const activeFileLanguage = this.currentContext.activeFileLanguage;
110
- const repository = await this.retriever.repositoryInfo();
111
- const raw = JSON.stringify({
112
- query,
113
- task_engine_userId: realUserName,
114
- codePath,
115
- activeFileLanguage,
116
- repository,
117
- source: 'comate',
118
- cmdType: 'buildParamForSendCard'
119
- });
120
- const options = {
121
- method: 'POST',
122
- headers: {
123
- 'Content-Type': 'application/json'
124
- },
125
- body: raw
126
- };
127
- try {
128
- const response = await fetch(SEARCH_URL, options);
129
- const result = await response.json();
130
- yield stream.flushReplaceLast(result.content); // markdown字符串
131
- } catch (ex) {
132
- yield stream.flushReplaceLast(`请求出错,请联系负责人(wangjie66)或稍后再试。${ex instanceof Error ? ex.message : ''}`);
133
- }
134
- }
135
- defaultArgumentValue() {
136
- return {
137
- query: '任意代码'
138
- };
139
- }
140
- }
141
-
142
- class buildParamForModifyCardProvider extends SkillProvider {
143
- static{
144
- this.skillName = 'buildParamForModifyCard';
145
- }
146
- static{
147
- this.displayName = '生成卡片修改请求对象';
148
- }
149
- static{
150
- this.description = '构建卡片修改请求对象';
151
- }
152
- static{
153
- this.parameters = {
154
- type: 'object',
155
- properties: {}
156
- };
157
- }
158
- async *execute() {
159
- // 用户在输入框输入的问题
160
- const { query } = this.currentContext;
161
- const stream = new TaskProgressChunkStream();
162
- const userDetail = await this.currentUser.requestDetail();
163
- const realUserName = userDetail && userDetail.name || '未知用户';
164
- const codePath = this.currentContext.activeFilePath;
165
- const activeFileLanguage = this.currentContext.activeFileLanguage;
166
- const repository = await this.retriever.repositoryInfo();
167
- const raw = JSON.stringify({
168
- query,
169
- task_engine_userId: realUserName,
170
- codePath,
171
- activeFileLanguage,
172
- repository,
173
- source: 'comate',
174
- cmdType: 'buildParamForModifyCard'
175
- });
176
- const options = {
177
- method: 'POST',
178
- headers: {
179
- 'Content-Type': 'application/json'
180
- },
181
- body: raw
182
- };
183
- try {
184
- const response = await fetch(SEARCH_URL, options);
185
- const result = await response.json();
186
- yield stream.flushReplaceLast(result.content); // markdown字符串
187
- } catch (ex) {
188
- yield stream.flushReplaceLast(`请求出错,请联系负责人(wangjie66)或稍后再试。${ex instanceof Error ? ex.message : ''}`);
189
- }
190
- }
191
- defaultArgumentValue() {
192
- return {
193
- query: '任意代码'
194
- };
195
- }
196
- }
197
-
198
- class buildParamForCallbackRequestProvider extends SkillProvider {
199
- static{
200
- this.skillName = 'buildParamForCallbackRequest';
201
- }
202
- static{
203
- this.displayName = '生成卡片回调请求入参&返回值对象';
204
- }
205
- static{
206
- this.description = '生成卡片回调请求入参&返回值对象';
207
- }
208
- static{
209
- this.parameters = {
210
- type: 'object',
211
- properties: {}
212
- };
213
- }
214
- async *execute() {
215
- // 用户在输入框输入的问题
216
- const { query } = this.currentContext;
217
- const stream = new TaskProgressChunkStream();
218
- const userDetail = await this.currentUser.requestDetail();
219
- const realUserName = userDetail && userDetail.name || '未知用户';
220
- const codePath = this.currentContext.activeFilePath;
221
- const activeFileLanguage = this.currentContext.activeFileLanguage;
222
- const repository = await this.retriever.repositoryInfo();
223
- const raw = JSON.stringify({
224
- query,
225
- task_engine_userId: realUserName,
226
- codePath,
227
- activeFileLanguage,
228
- repository,
229
- source: 'comate',
230
- cmdType: 'buildParamForCallbackRequest'
231
- });
232
- const options = {
233
- method: 'POST',
234
- headers: {
235
- 'Content-Type': 'application/json'
236
- },
237
- body: raw
238
- };
239
- try {
240
- const response = await fetch(SEARCH_URL, options);
241
- const result = await response.json();
242
- yield stream.flushReplaceLast(result.content); // markdown字符串
243
- } catch (ex) {
244
- yield stream.flushReplaceLast(`请求出错,请联系负责人(wangjie66)或稍后再试。${ex instanceof Error ? ex.message : ''}`);
245
- }
246
- }
247
- defaultArgumentValue() {
248
- return {
249
- query: '任意代码'
250
- };
251
- }
252
- }
253
-
254
- class MsgCipherUtilProvider extends SkillProvider {
255
- static{
256
- this.skillName = 'MsgCipherUtil';
257
- }
258
- static{
259
- this.displayName = '生成卡片回调加解密方法';
260
- }
261
- static{
262
- this.description = '构建卡片回调加解密方法';
263
- }
264
- static{
265
- this.parameters = {
266
- type: 'object',
267
- properties: {}
268
- };
269
- }
270
- async *execute() {
271
- // 用户在输入框输入的问题
272
- const { query } = this.currentContext;
273
- const stream = new TaskProgressChunkStream();
274
- const userDetail = await this.currentUser.requestDetail();
275
- const realUserName = userDetail && userDetail.name || '未知用户';
276
- const codePath = this.currentContext.activeFilePath;
277
- const activeFileLanguage = this.currentContext.activeFileLanguage;
278
- const repository = await this.retriever.repositoryInfo();
279
- const raw = JSON.stringify({
280
- query,
281
- task_engine_userId: realUserName,
282
- codePath,
283
- activeFileLanguage,
284
- repository,
285
- source: 'comate',
286
- cmdType: 'MsgCipherUtil'
287
- });
288
- const options = {
289
- method: 'POST',
290
- headers: {
291
- 'Content-Type': 'application/json'
292
- },
293
- body: raw
294
- };
295
- try {
296
- const response = await fetch(SEARCH_URL, options);
297
- const result = await response.json();
298
- yield stream.flushReplaceLast(result.content); // markdown字符串
299
- } catch (ex) {
300
- yield stream.flushReplaceLast(`请求出错,请联系负责人(wangjie66)或稍后再试。${ex instanceof Error ? ex.message : ''}`);
301
- }
302
- }
303
- defaultArgumentValue() {
304
- return {
305
- query: '任意代码'
306
- };
307
- }
308
- }
309
-
310
- class buildAuthMethodProvider extends SkillProvider {
311
- static{
312
- this.skillName = 'buildAuthMethod';
313
- }
314
- static{
315
- this.displayName = '生成卡片发送所需鉴权appToken';
316
- }
317
- static{
318
- this.description = '生成卡片发送所需鉴权appToken';
319
- }
320
- static{
321
- this.parameters = {
322
- type: 'object',
323
- properties: {}
324
- };
325
- }
326
- async *execute() {
327
- // 用户在输入框输入的问题
328
- const { query } = this.currentContext;
329
- const stream = new TaskProgressChunkStream();
330
- const userDetail = await this.currentUser.requestDetail();
331
- const realUserName = userDetail && userDetail.name || '未知用户';
332
- const codePath = this.currentContext.activeFilePath;
333
- const activeFileLanguage = this.currentContext.activeFileLanguage;
334
- const repository = await this.retriever.repositoryInfo();
335
- const raw = JSON.stringify({
336
- query,
337
- task_engine_userId: realUserName,
338
- codePath,
339
- activeFileLanguage,
340
- repository,
341
- source: 'comate',
342
- cmdType: 'buildAuthMethod'
343
- });
344
- const options = {
345
- method: 'POST',
346
- headers: {
347
- 'Content-Type': 'application/json'
348
- },
349
- body: raw
350
- };
351
- try {
352
- const response = await fetch(SEARCH_URL, options);
353
- const result = await response.json();
354
- yield stream.flushReplaceLast(result.content); // markdown字符串
355
- } catch (ex) {
356
- yield stream.flushReplaceLast(`请求出错,请联系负责人(wangjie66)或稍后再试。${ex instanceof Error ? ex.message : ''}`);
357
- }
358
- }
359
- defaultArgumentValue() {
360
- return {
361
- query: '任意代码'
362
- };
363
- }
364
- }
365
-
366
- class buildSendCardDemoProvider extends SkillProvider {
367
- static{
368
- this.skillName = 'buildSendCardDemo';
369
- }
370
- static{
371
- this.displayName = '生成可调试发卡框架';
372
- }
373
- static{
374
- this.description = '生成可调试发卡框架';
375
- }
376
- static{
377
- this.parameters = {
378
- type: 'object',
379
- properties: {}
380
- };
381
- }
382
- async *execute() {
383
- // 用户在输入框输入的问题
384
- const { query } = this.currentContext;
385
- const stream = new TaskProgressChunkStream();
386
- const userDetail = await this.currentUser.requestDetail();
387
- const realUserName = userDetail && userDetail.name || '未知用户';
388
- const codePath = this.currentContext.activeFilePath;
389
- const activeFileLanguage = this.currentContext.activeFileLanguage;
390
- const repository = await this.retriever.repositoryInfo();
391
- const raw = JSON.stringify({
392
- query,
393
- task_engine_userId: realUserName,
394
- codePath,
395
- activeFileLanguage,
396
- repository,
397
- source: 'comate',
398
- cmdType: 'buildSendCardDemo'
399
- });
400
- const options = {
401
- method: 'POST',
402
- headers: {
403
- 'Content-Type': 'application/json'
404
- },
405
- body: raw
406
- };
407
- try {
408
- const response = await fetch(SEARCH_URL, options);
409
- const result = await response.json();
410
- yield stream.flushReplaceLast(result.content); // markdown字符串
411
- } catch (ex) {
412
- yield stream.flushReplaceLast(`请求出错,请联系负责人(wangjie66)或稍后再试。${ex instanceof Error ? ex.message : ''}`);
413
- }
414
- }
415
- defaultArgumentValue() {
416
- return {
417
- query: '任意代码'
418
- };
419
- }
420
- }
421
-
422
- class buildBubbleCardDemoProvider extends SkillProvider {
423
- static{
424
- this.skillName = 'buildBubbleCardDemo';
425
- }
426
- static{
427
- this.displayName = '生成可调试气泡卡发卡框架';
428
- }
429
- static{
430
- this.description = '生成可调试气泡卡发卡框架';
431
- }
432
- static{
433
- this.parameters = {
434
- type: 'object',
435
- properties: {}
436
- };
437
- }
438
- async *execute() {
439
- // 用户在输入框输入的问题
440
- const { query } = this.currentContext;
441
- const stream = new TaskProgressChunkStream();
442
- const userDetail = await this.currentUser.requestDetail();
443
- const realUserName = userDetail && userDetail.name || '未知用户';
444
- const codePath = this.currentContext.activeFilePath;
445
- const activeFileLanguage = this.currentContext.activeFileLanguage;
446
- const repository = await this.retriever.repositoryInfo();
447
- const raw = JSON.stringify({
448
- query,
449
- task_engine_userId: realUserName,
450
- codePath,
451
- activeFileLanguage,
452
- repository,
453
- source: 'comate',
454
- cmdType: 'buildBubbleCardDemo'
455
- });
456
- const options = {
457
- method: 'POST',
458
- headers: {
459
- 'Content-Type': 'application/json'
460
- },
461
- body: raw
462
- };
463
- try {
464
- const response = await fetch(SEARCH_URL, options);
465
- const result = await response.json();
466
- yield stream.flushReplaceLast(result.content); // markdown字符串
467
- } catch (ex) {
468
- yield stream.flushReplaceLast(`请求出错,请联系负责人(wangjie66)或稍后再试。${ex instanceof Error ? ex.message : ''}`);
469
- }
470
- }
471
- defaultArgumentValue() {
472
- return {
473
- query: '任意代码'
474
- };
475
- }
476
- }
477
-
478
- class buildCardCallBackDemoProvider extends SkillProvider {
479
- static{
480
- this.skillName = 'buildCardCallBackDemo';
481
- }
482
- static{
483
- this.displayName = '生成可注册回调接口框架(推荐)';
484
- }
485
- static{
486
- this.description = '生成可注册回调接口框架';
487
- }
488
- static{
489
- this.parameters = {
490
- type: 'object',
491
- properties: {}
492
- };
493
- }
494
- async *execute() {
495
- // 用户在输入框输入的问题
496
- const { query } = this.currentContext;
497
- const stream = new TaskProgressChunkStream();
498
- const userDetail = await this.currentUser.requestDetail();
499
- const realUserName = userDetail && userDetail.name || '未知用户';
500
- const codePath = this.currentContext.activeFilePath;
501
- const activeFileLanguage = this.currentContext.activeFileLanguage;
502
- const repository = await this.retriever.repositoryInfo();
503
- const raw = JSON.stringify({
504
- query,
505
- task_engine_userId: realUserName,
506
- codePath,
507
- activeFileLanguage,
508
- repository,
509
- source: 'comate',
510
- cmdType: 'buildCardCallBackDemo'
511
- });
512
- const options = {
513
- method: 'POST',
514
- headers: {
515
- 'Content-Type': 'application/json'
516
- },
517
- body: raw
518
- };
519
- try {
520
- const response = await fetch(SEARCH_URL, options);
521
- const result = await response.json();
522
- yield stream.flushReplaceLast(result.content); // markdown字符串
523
- } catch (ex) {
524
- yield stream.flushReplaceLast(`请求出错,请联系负责人(wangjie66)或稍后再试。${ex instanceof Error ? ex.message : ''}`);
525
- }
526
- }
527
- defaultArgumentValue() {
528
- return {
529
- query: '任意代码'
530
- };
531
- }
532
- }
533
-
534
- function setup({ registry }) {
535
- registry.registerSkillProvider('workcard-help', HelpSkillProvider);
536
- registry.registerSkillProvider('buildParamForUserData', buildParamForUserDataProvider);
537
- registry.registerSkillProvider('buildParamForSendCard', buildParamForSendCardProvider);
538
- registry.registerSkillProvider('buildParamForModifyCard', buildParamForModifyCardProvider);
539
- registry.registerSkillProvider('buildParamForCallbackRequest', buildParamForCallbackRequestProvider);
540
- registry.registerSkillProvider('MsgCipherUtil', MsgCipherUtilProvider);
541
- registry.registerSkillProvider('buildAuthMethod', buildAuthMethodProvider);
542
- registry.registerSkillProvider('buildSendCardDemo', buildSendCardDemoProvider);
543
- registry.registerSkillProvider('buildBubbleCardDemo', buildBubbleCardDemoProvider);
544
- registry.registerSkillProvider('buildCardCallBackDemo', buildCardCallBackDemoProvider);
545
- }
546
-
547
- export { setup };