@comate/zulu 0.2.1-beta.2 → 0.3.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.
Files changed (167) hide show
  1. package/README.md +64 -13
  2. package/comate-engine/bin/comate.js +9 -0
  3. package/comate-engine/node_modules/@comate/plugin-engine/dist/index.js +8 -8
  4. package/comate-engine/node_modules/@comate/plugin-host/dist/index.js +1 -1
  5. package/comate-engine/node_modules/@comate/plugin-host/dist/main.js +1 -1
  6. package/comate-engine/node_modules/@comate/plugin-host/dist/user-DQgjkMe9.js +44 -0
  7. package/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.d.ts +24 -6
  8. package/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.js +8 -8
  9. package/comate-engine/node_modules/@comate/preview-proxy/dist/index.js +59 -72
  10. package/comate-engine/node_modules/@comate/preview-proxy/static/comate-preview-injector.css +1 -1
  11. package/comate-engine/node_modules/@comate/preview-proxy/static/comate-preview-injector.js +1 -1
  12. package/comate-engine/node_modules/better-sqlite3/node_modules/.bin/prebuild-install +2 -2
  13. package/comate-engine/plugins/demo-feature/dist/index.js +337 -30
  14. package/comate-engine/server.js +11 -11
  15. package/dist/bundle/index.js +8 -8
  16. package/package.json +1 -1
  17. package/comate-engine/node_modules/@comate/plugin-host/dist/user-Buhpnssj.js +0 -44
  18. package/comate-engine/plugins/aiscan/assets/icon.svg +0 -12
  19. package/comate-engine/plugins/aiscan/dist/index.js +0 -53861
  20. package/comate-engine/plugins/aiscan/package.json +0 -67
  21. package/comate-engine/plugins/appdev/assets/icon.png +0 -0
  22. package/comate-engine/plugins/appdev/dist/help.md +0 -12
  23. package/comate-engine/plugins/appdev/dist/index.d.ts +0 -2
  24. package/comate-engine/plugins/appdev/dist/index.js +0 -194
  25. package/comate-engine/plugins/appdev/dist/providers/err.d.ts +0 -8
  26. package/comate-engine/plugins/appdev/dist/providers/err.js +0 -37
  27. package/comate-engine/plugins/appdev/dist/providers/fallback.d.ts +0 -5
  28. package/comate-engine/plugins/appdev/dist/providers/fallback.js +0 -28
  29. package/comate-engine/plugins/appdev/dist/providers/help.d.ts +0 -8
  30. package/comate-engine/plugins/appdev/dist/providers/help.js +0 -19
  31. package/comate-engine/plugins/appdev/dist/providers/medusa.d.ts +0 -8
  32. package/comate-engine/plugins/appdev/dist/providers/medusa.js +0 -39
  33. package/comate-engine/plugins/appdev/dist/providers/qa.d.ts +0 -8
  34. package/comate-engine/plugins/appdev/dist/providers/qa.js +0 -33
  35. package/comate-engine/plugins/appdev/package.json +0 -67
  36. package/comate-engine/plugins/bfc/assets/bfc-icon.png +0 -0
  37. package/comate-engine/plugins/bfc/dist/config/config.d.ts +0 -4
  38. package/comate-engine/plugins/bfc/dist/config/config.js +0 -4
  39. package/comate-engine/plugins/bfc/dist/help.md +0 -11
  40. package/comate-engine/plugins/bfc/dist/index.d.ts +0 -2
  41. package/comate-engine/plugins/bfc/dist/index.js +0 -452
  42. package/comate-engine/plugins/bfc/dist/providers/bfcInstructMode.d.ts +0 -8
  43. package/comate-engine/plugins/bfc/dist/providers/bfcInstructMode.js +0 -77
  44. package/comate-engine/plugins/bfc/dist/providers/genAbnormalCode.d.ts +0 -8
  45. package/comate-engine/plugins/bfc/dist/providers/genAbnormalCode.js +0 -71
  46. package/comate-engine/plugins/bfc/dist/providers/genBfcCode.d.ts +0 -8
  47. package/comate-engine/plugins/bfc/dist/providers/genBfcCode.js +0 -74
  48. package/comate-engine/plugins/bfc/dist/providers/getBatchCases.d.ts +0 -10
  49. package/comate-engine/plugins/bfc/dist/providers/getBatchCases.js +0 -71
  50. package/comate-engine/plugins/bfc/dist/providers/help.d.ts +0 -8
  51. package/comate-engine/plugins/bfc/dist/providers/help.js +0 -19
  52. package/comate-engine/plugins/bfc/dist/service/generateService.d.ts +0 -14
  53. package/comate-engine/plugins/bfc/dist/service/generateService.js +0 -27
  54. package/comate-engine/plugins/bfc/package.json +0 -85
  55. package/comate-engine/plugins/bpm/assets/bpm.png +0 -0
  56. package/comate-engine/plugins/bpm/dist/index.js +0 -313
  57. package/comate-engine/plugins/bpm/package.json +0 -65
  58. package/comate-engine/plugins/casebuilder/assets/icon.svg +0 -1
  59. package/comate-engine/plugins/casebuilder/dist/help.md +0 -33
  60. package/comate-engine/plugins/casebuilder/dist/index.js +0 -837
  61. package/comate-engine/plugins/casebuilder/package.json +0 -80
  62. package/comate-engine/plugins/centrino/assets/icon.png +0 -0
  63. package/comate-engine/plugins/centrino/dist/help.md +0 -30
  64. package/comate-engine/plugins/centrino/dist/index.js +0 -1046
  65. package/comate-engine/plugins/centrino/package.json +0 -68
  66. package/comate-engine/plugins/cnap/assets/cnap.png +0 -0
  67. package/comate-engine/plugins/cnap/dist/help.md +0 -11
  68. package/comate-engine/plugins/cnap/dist/index.js +0 -171
  69. package/comate-engine/plugins/cnap/package.json +0 -65
  70. package/comate-engine/plugins/demo-timer/assets/icon.svg +0 -2
  71. package/comate-engine/plugins/demo-timer/dist/index.js +0 -463
  72. package/comate-engine/plugins/demo-timer/package.json +0 -73
  73. package/comate-engine/plugins/dev-tools/assets/icon.png +0 -0
  74. package/comate-engine/plugins/dev-tools/dist/help.md +0 -18
  75. package/comate-engine/plugins/dev-tools/dist/index.js +0 -166160
  76. package/comate-engine/plugins/dev-tools/package.json +0 -95
  77. package/comate-engine/plugins/devaux/assets/icon.svg +0 -1
  78. package/comate-engine/plugins/devaux/dist/help.md +0 -41
  79. package/comate-engine/plugins/devaux/dist/index.js +0 -74138
  80. package/comate-engine/plugins/devaux/dist/static/tree-sitter-cpp.wasm +0 -0
  81. package/comate-engine/plugins/devaux/dist/static/tree-sitter-go.wasm +0 -0
  82. package/comate-engine/plugins/devaux/dist/static/tree-sitter.wasm +0 -0
  83. package/comate-engine/plugins/devaux/dist/tree-sitter.wasm +0 -0
  84. package/comate-engine/plugins/devaux/package.json +0 -83
  85. package/comate-engine/plugins/f2c/assets/icon.svg +0 -11
  86. package/comate-engine/plugins/f2c/dist/help.md +0 -13
  87. package/comate-engine/plugins/f2c/dist/index.js +0 -81787
  88. package/comate-engine/plugins/f2c/package.json +0 -56
  89. package/comate-engine/plugins/fcnap/assets/icon.png +0 -0
  90. package/comate-engine/plugins/fcnap/dist/help.md +0 -9
  91. package/comate-engine/plugins/fcnap/dist/index.js +0 -105
  92. package/comate-engine/plugins/fcnap/package.json +0 -50
  93. package/comate-engine/plugins/front-end-skills/assets/icon.svg +0 -1
  94. package/comate-engine/plugins/front-end-skills/dist/help.md +0 -17
  95. package/comate-engine/plugins/front-end-skills/dist/index.js +0 -8172
  96. package/comate-engine/plugins/front-end-skills/package.json +0 -79
  97. package/comate-engine/plugins/gdp/assets/icon.png +0 -0
  98. package/comate-engine/plugins/gdp/dist/help.md +0 -11
  99. package/comate-engine/plugins/gdp/dist/index.js +0 -53065
  100. package/comate-engine/plugins/gdp/package.json +0 -79
  101. package/comate-engine/plugins/git/assets/git.svg +0 -1
  102. package/comate-engine/plugins/git/assets/icon.svg +0 -1
  103. package/comate-engine/plugins/git/dist/help.md +0 -7
  104. package/comate-engine/plugins/git/dist/index.js +0 -32675
  105. package/comate-engine/plugins/git/package.json +0 -91
  106. package/comate-engine/plugins/harmonyos/assets/harmonyos.png +0 -0
  107. package/comate-engine/plugins/harmonyos/dist/index.js +0 -78
  108. package/comate-engine/plugins/harmonyos/package.json +0 -37
  109. package/comate-engine/plugins/iapi/assets/icon.png +0 -0
  110. package/comate-engine/plugins/iapi/dist/help.md +0 -13
  111. package/comate-engine/plugins/iapi/dist/index.js +0 -458
  112. package/comate-engine/plugins/iapi/dist/static/lang/tree-sitter-go.wasm +0 -0
  113. package/comate-engine/plugins/iapi/dist/static/lang/tree-sitter-java.wasm +0 -0
  114. package/comate-engine/plugins/iapi/dist/static/tree-sitter-go.wasm +0 -0
  115. package/comate-engine/plugins/iapi/dist/static/tree-sitter-java.wasm +0 -0
  116. package/comate-engine/plugins/iapi/dist/tree-sitter.wasm +0 -0
  117. package/comate-engine/plugins/iapi/package.json +0 -102
  118. package/comate-engine/plugins/icafe/assets/icafe.svg +0 -1
  119. package/comate-engine/plugins/icafe/dist/help.md +0 -5
  120. package/comate-engine/plugins/icafe/dist/index.js +0 -885
  121. package/comate-engine/plugins/icafe/package.json +0 -74
  122. package/comate-engine/plugins/ievalue/assets/iEValue.svg +0 -10
  123. package/comate-engine/plugins/ievalue/dist/index.js +0 -2920
  124. package/comate-engine/plugins/ievalue/package.json +0 -88
  125. package/comate-engine/plugins/ipipe/assets/iPipePlugin.png +0 -0
  126. package/comate-engine/plugins/ipipe/dist/help.md +0 -15
  127. package/comate-engine/plugins/ipipe/dist/index.js +0 -7264
  128. package/comate-engine/plugins/ipipe/package.json +0 -62
  129. package/comate-engine/plugins/jarvis/assets/icon.svg +0 -1
  130. package/comate-engine/plugins/jarvis/dist/help.md +0 -17
  131. package/comate-engine/plugins/jarvis/dist/index.js +0 -140416
  132. package/comate-engine/plugins/jarvis/package.json +0 -93
  133. package/comate-engine/plugins/mapsearch/assets/mapsearchicon.png +0 -0
  134. package/comate-engine/plugins/mapsearch/dist/help.md +0 -4
  135. package/comate-engine/plugins/mapsearch/dist/index.js +0 -145
  136. package/comate-engine/plugins/mapsearch/package.json +0 -53
  137. package/comate-engine/plugins/paddle/assets/icon.png +0 -0
  138. package/comate-engine/plugins/paddle/assets/paconvert-3.0.1-py3-none-any.whl +0 -0
  139. package/comate-engine/plugins/paddle/dist/help.md +0 -31
  140. package/comate-engine/plugins/paddle/dist/index.js +0 -1011
  141. package/comate-engine/plugins/paddle/package.json +0 -129
  142. package/comate-engine/plugins/robot/assets/Robot.png +0 -0
  143. package/comate-engine/plugins/robot/dist/index.js +0 -288
  144. package/comate-engine/plugins/robot/package.json +0 -67
  145. package/comate-engine/plugins/security/assets/comate.png +0 -0
  146. package/comate-engine/plugins/security/dist/index.js +0 -18393
  147. package/comate-engine/plugins/security/package.json +0 -82
  148. package/comate-engine/plugins/smartapp/assets/icon.png +0 -0
  149. package/comate-engine/plugins/smartapp/dist/help.md +0 -4
  150. package/comate-engine/plugins/smartapp/dist/index.js +0 -113
  151. package/comate-engine/plugins/smartapp/package.json +0 -54
  152. package/comate-engine/plugins/testmate/assets/icon.svg +0 -1
  153. package/comate-engine/plugins/testmate/dist/help.md +0 -62
  154. package/comate-engine/plugins/testmate/dist/index.js +0 -21483
  155. package/comate-engine/plugins/testmate/package.json +0 -85
  156. package/comate-engine/plugins/tor/assets/TorPlugin.png +0 -0
  157. package/comate-engine/plugins/tor/dist/help.md +0 -22
  158. package/comate-engine/plugins/tor/dist/index.js +0 -807
  159. package/comate-engine/plugins/tor/package.json +0 -99
  160. package/comate-engine/plugins/weiyun/assets/icon.png +0 -0
  161. package/comate-engine/plugins/weiyun/dist/help.md +0 -11
  162. package/comate-engine/plugins/weiyun/dist/index.js +0 -100491
  163. package/comate-engine/plugins/weiyun/package.json +0 -55
  164. package/comate-engine/plugins/workcard/assets/favicon.png +0 -0
  165. package/comate-engine/plugins/workcard/dist/help.md +0 -30
  166. package/comate-engine/plugins/workcard/dist/index.js +0 -490
  167. package/comate-engine/plugins/workcard/package.json +0 -95
@@ -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,490 +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.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
- function setup({ registry }) {
479
- registry.registerSkillProvider('workcard-help', HelpSkillProvider);
480
- registry.registerSkillProvider('buildParamForUserData', buildParamForUserDataProvider);
481
- registry.registerSkillProvider('buildParamForSendCard', buildParamForSendCardProvider);
482
- registry.registerSkillProvider('buildParamForModifyCard', buildParamForModifyCardProvider);
483
- registry.registerSkillProvider('buildParamForCallbackRequest', buildParamForCallbackRequestProvider);
484
- registry.registerSkillProvider('MsgCipherUtil', MsgCipherUtilProvider);
485
- registry.registerSkillProvider('buildAuthMethod', buildAuthMethodProvider);
486
- registry.registerSkillProvider('buildSendCardDemo', buildSendCardDemoProvider);
487
- registry.registerSkillProvider('buildBubbleCardDemo', buildBubbleCardDemoProvider);
488
- }
489
-
490
- export { setup };
@@ -1,95 +0,0 @@
1
- {
2
- "private": true,
3
- "name": "@comate-plugin/workcard",
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
- "devDependencies": {
13
- "@comate/plugin-cli": "^0.9.2",
14
- "@comate/plugin-host": "^0.9.2",
15
- "typescript": "^5.3.2"
16
- },
17
- "comate": {
18
- "name": "workcard",
19
- "version": "1.0.0",
20
- "icon": "./assets/favicon.png",
21
- "entry": "./dist/index.js",
22
- "displayName": "智能工作卡",
23
- "description": "支持自动生成接入智能工作卡代码,包括发卡,回调,更新接口对象构建,加解密等方法",
24
- "keyword": [],
25
- "capabilities": [
26
- {
27
- "type": "Skill",
28
- "name": "workcard-help",
29
- "displayName": "插件介绍",
30
- "description": "确认插件成功运行并介绍开发方式",
31
- "placeholder": "无需输入内容,回车获得插件介绍"
32
- },
33
- {
34
- "type": "Skill",
35
- "name": "buildSendCardDemo",
36
- "displayName": "发卡-生成可调试发卡框架(推荐)",
37
- "description": "生成可调试发卡框架",
38
- "placeholder": "请输入卡片模板ID"
39
- },
40
- {
41
- "type": "Skill",
42
- "name": "buildBubbleCardDemo",
43
- "displayName": "气泡卡-生成可调试气泡卡发卡框架",
44
- "description": "生成可调试气泡卡发卡框架",
45
- "placeholder": "请输入卡片模板ID"
46
- },
47
- {
48
- "type": "Skill",
49
- "name": "buildAuthMethod",
50
- "displayName": "发卡-生成获取appToken方法",
51
- "description": "生成获取appToken方法",
52
- "placeholder": "无需输入内容,回车生成方法"
53
- },
54
- {
55
- "type": "Skill",
56
- "name": "buildParamForUserData",
57
- "displayName": "发卡-生成UserData对象",
58
- "description": "构建卡片发送对象",
59
- "placeholder": "请输入卡片模板ID"
60
- },
61
- {
62
- "type": "Skill",
63
- "name": "buildParamForSendCard",
64
- "displayName": "发卡-生成发卡请求入参&返回值对象",
65
- "description": "生成发卡请求入参&返回值对象",
66
- "placeholder": "请输入卡片模板ID"
67
- },
68
- {
69
- "type": "Skill",
70
- "name": "buildParamForCallbackRequest",
71
- "displayName": "回调-生成回调请求入参&返回值对象",
72
- "description": "生成回调请求入参&返回值对象",
73
- "placeholder": "请输入卡片模板ID"
74
- },
75
- {
76
- "type": "Skill",
77
- "name": "MsgCipherUtil",
78
- "displayName": "回调-生成回调加解密方法",
79
- "description": "生成回调加解密方法",
80
- "placeholder": "请输入卡片模板ID"
81
- },
82
- {
83
- "type": "Skill",
84
- "name": "buildParamForModifyCard",
85
- "displayName": "修改-生成卡片修改请求对象",
86
- "description": "生成卡片修改请求对象",
87
- "placeholder": "请输入卡片模板ID"
88
- }
89
-
90
- ],
91
- "configSchema": {
92
- "sections": []
93
- }
94
- }
95
- }