@comate/zulu 0.0.9 → 0.0.11

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 (285) hide show
  1. package/comate-engine/bin/comate.js +10 -0
  2. package/comate-engine/fallbackServer.js +1 -0
  3. package/comate-engine/node_modules/@comate/plugin-engine/dist/index.d.ts +188 -0
  4. package/comate-engine/node_modules/@comate/plugin-engine/dist/index.js +36 -0
  5. package/comate-engine/node_modules/@comate/plugin-engine/package.json +49 -0
  6. package/comate-engine/node_modules/@comate/plugin-host/bin.js +44 -0
  7. package/comate-engine/node_modules/@comate/plugin-host/dist/index.js +1 -0
  8. package/comate-engine/node_modules/@comate/plugin-host/dist/main.d.ts +14 -0
  9. package/comate-engine/node_modules/@comate/plugin-host/dist/main.js +9 -0
  10. package/comate-engine/node_modules/@comate/plugin-host/dist/user-Btg63hPI.js +36 -0
  11. package/comate-engine/node_modules/@comate/plugin-host/package.json +47 -0
  12. package/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.d.ts +2849 -0
  13. package/comate-engine/node_modules/@comate/plugin-shared-internals/dist/index.js +36 -0
  14. package/comate-engine/node_modules/@comate/plugin-shared-internals/package.json +72 -0
  15. package/comate-engine/node_modules/@comate/preview-proxy/bin/preview.js +13 -0
  16. package/comate-engine/node_modules/@comate/preview-proxy/dist/index.js +350 -0
  17. package/comate-engine/node_modules/@comate/preview-proxy/package.json +83 -0
  18. package/comate-engine/node_modules/@comate/preview-proxy/static/comate-preview-injector.css +1 -0
  19. package/comate-engine/node_modules/@comate/preview-proxy/static/comate-preview-injector.js +2 -0
  20. package/comate-engine/node_modules/@comate/preview-proxy/static/comate-preview-injector.js.LICENSE.txt +58 -0
  21. package/comate-engine/node_modules/compare-versions/LICENSE +21 -0
  22. package/comate-engine/node_modules/compare-versions/README.md +133 -0
  23. package/comate-engine/node_modules/compare-versions/lib/esm/compare.d.ts +19 -0
  24. package/comate-engine/node_modules/compare-versions/lib/esm/compare.js +44 -0
  25. package/comate-engine/node_modules/compare-versions/lib/esm/compare.js.map +1 -0
  26. package/comate-engine/node_modules/compare-versions/lib/esm/compareVersions.d.ts +8 -0
  27. package/comate-engine/node_modules/compare-versions/lib/esm/compareVersions.js +29 -0
  28. package/comate-engine/node_modules/compare-versions/lib/esm/compareVersions.js.map +1 -0
  29. package/comate-engine/node_modules/compare-versions/lib/esm/index.d.ts +5 -0
  30. package/comate-engine/node_modules/compare-versions/lib/esm/index.js +5 -0
  31. package/comate-engine/node_modules/compare-versions/lib/esm/index.js.map +1 -0
  32. package/comate-engine/node_modules/compare-versions/lib/esm/satisfies.d.ts +14 -0
  33. package/comate-engine/node_modules/compare-versions/lib/esm/satisfies.js +66 -0
  34. package/comate-engine/node_modules/compare-versions/lib/esm/satisfies.js.map +1 -0
  35. package/comate-engine/node_modules/compare-versions/lib/esm/utils.d.ts +7 -0
  36. package/comate-engine/node_modules/compare-versions/lib/esm/utils.js +37 -0
  37. package/comate-engine/node_modules/compare-versions/lib/esm/utils.js.map +1 -0
  38. package/comate-engine/node_modules/compare-versions/lib/esm/validate.d.ts +28 -0
  39. package/comate-engine/node_modules/compare-versions/lib/esm/validate.js +31 -0
  40. package/comate-engine/node_modules/compare-versions/lib/esm/validate.js.map +1 -0
  41. package/comate-engine/node_modules/compare-versions/lib/umd/index.js +216 -0
  42. package/comate-engine/node_modules/compare-versions/lib/umd/index.js.map +1 -0
  43. package/comate-engine/node_modules/compare-versions/package.json +45 -0
  44. package/comate-engine/node_modules/compare-versions/src/compare.ts +54 -0
  45. package/comate-engine/node_modules/compare-versions/src/compareVersions.ts +31 -0
  46. package/comate-engine/node_modules/compare-versions/src/index.ts +5 -0
  47. package/comate-engine/node_modules/compare-versions/src/satisfies.ts +69 -0
  48. package/comate-engine/node_modules/compare-versions/src/utils.ts +50 -0
  49. package/comate-engine/node_modules/compare-versions/src/validate.ts +36 -0
  50. package/comate-engine/node_modules/pkce-challenge/LICENSE +21 -0
  51. package/comate-engine/node_modules/pkce-challenge/README.md +55 -0
  52. package/comate-engine/node_modules/pkce-challenge/dist/index.browser.d.ts +19 -0
  53. package/comate-engine/node_modules/pkce-challenge/dist/index.browser.js +72 -0
  54. package/comate-engine/node_modules/pkce-challenge/dist/index.node.cjs +80 -0
  55. package/comate-engine/node_modules/pkce-challenge/dist/index.node.d.cts +19 -0
  56. package/comate-engine/node_modules/pkce-challenge/dist/index.node.d.ts +19 -0
  57. package/comate-engine/node_modules/pkce-challenge/dist/index.node.js +75 -0
  58. package/comate-engine/node_modules/pkce-challenge/package.json +58 -0
  59. package/comate-engine/node_modules/web-streams-polyfill/LICENSE +22 -0
  60. package/comate-engine/node_modules/web-streams-polyfill/README.md +119 -0
  61. package/comate-engine/node_modules/web-streams-polyfill/dist/polyfill.es5.js +8 -0
  62. package/comate-engine/node_modules/web-streams-polyfill/dist/polyfill.js +8 -0
  63. package/comate-engine/node_modules/web-streams-polyfill/dist/ponyfill.es5.js +8 -0
  64. package/comate-engine/node_modules/web-streams-polyfill/dist/ponyfill.es5.mjs +8 -0
  65. package/comate-engine/node_modules/web-streams-polyfill/dist/ponyfill.js +8 -0
  66. package/comate-engine/node_modules/web-streams-polyfill/dist/ponyfill.mjs +8 -0
  67. package/comate-engine/node_modules/web-streams-polyfill/package.json +98 -0
  68. package/comate-engine/node_modules/web-streams-polyfill/types/polyfill.d.ts +28 -0
  69. package/comate-engine/node_modules/web-streams-polyfill/types/ponyfill.d.ts +809 -0
  70. package/comate-engine/node_modules/web-streams-polyfill/types/tsdoc-metadata.json +11 -0
  71. package/comate-engine/package.json +91 -0
  72. package/comate-engine/plugins/aiscan/assets/icon.svg +12 -0
  73. package/comate-engine/plugins/aiscan/dist/index.js +53861 -0
  74. package/comate-engine/plugins/aiscan/package.json +67 -0
  75. package/comate-engine/plugins/appdev/assets/icon.png +0 -0
  76. package/comate-engine/plugins/appdev/dist/help.md +12 -0
  77. package/comate-engine/plugins/appdev/dist/index.d.ts +2 -0
  78. package/comate-engine/plugins/appdev/dist/index.js +194 -0
  79. package/comate-engine/plugins/appdev/dist/providers/err.d.ts +8 -0
  80. package/comate-engine/plugins/appdev/dist/providers/err.js +37 -0
  81. package/comate-engine/plugins/appdev/dist/providers/fallback.d.ts +5 -0
  82. package/comate-engine/plugins/appdev/dist/providers/fallback.js +28 -0
  83. package/comate-engine/plugins/appdev/dist/providers/help.d.ts +8 -0
  84. package/comate-engine/plugins/appdev/dist/providers/help.js +19 -0
  85. package/comate-engine/plugins/appdev/dist/providers/medusa.d.ts +8 -0
  86. package/comate-engine/plugins/appdev/dist/providers/medusa.js +39 -0
  87. package/comate-engine/plugins/appdev/dist/providers/qa.d.ts +8 -0
  88. package/comate-engine/plugins/appdev/dist/providers/qa.js +33 -0
  89. package/comate-engine/plugins/appdev/package.json +67 -0
  90. package/comate-engine/plugins/bfc/assets/bfc-icon.png +0 -0
  91. package/comate-engine/plugins/bfc/dist/config/config.d.ts +4 -0
  92. package/comate-engine/plugins/bfc/dist/config/config.js +4 -0
  93. package/comate-engine/plugins/bfc/dist/help.md +11 -0
  94. package/comate-engine/plugins/bfc/dist/index.d.ts +2 -0
  95. package/comate-engine/plugins/bfc/dist/index.js +452 -0
  96. package/comate-engine/plugins/bfc/dist/providers/bfcInstructMode.d.ts +8 -0
  97. package/comate-engine/plugins/bfc/dist/providers/bfcInstructMode.js +77 -0
  98. package/comate-engine/plugins/bfc/dist/providers/genAbnormalCode.d.ts +8 -0
  99. package/comate-engine/plugins/bfc/dist/providers/genAbnormalCode.js +71 -0
  100. package/comate-engine/plugins/bfc/dist/providers/genBfcCode.d.ts +8 -0
  101. package/comate-engine/plugins/bfc/dist/providers/genBfcCode.js +74 -0
  102. package/comate-engine/plugins/bfc/dist/providers/getBatchCases.d.ts +10 -0
  103. package/comate-engine/plugins/bfc/dist/providers/getBatchCases.js +71 -0
  104. package/comate-engine/plugins/bfc/dist/providers/help.d.ts +8 -0
  105. package/comate-engine/plugins/bfc/dist/providers/help.js +19 -0
  106. package/comate-engine/plugins/bfc/dist/service/generateService.d.ts +14 -0
  107. package/comate-engine/plugins/bfc/dist/service/generateService.js +27 -0
  108. package/comate-engine/plugins/bfc/package.json +85 -0
  109. package/comate-engine/plugins/bpm/assets/bpm.png +0 -0
  110. package/comate-engine/plugins/bpm/dist/index.js +313 -0
  111. package/comate-engine/plugins/bpm/package.json +65 -0
  112. package/comate-engine/plugins/casebuilder/assets/icon.svg +1 -0
  113. package/comate-engine/plugins/casebuilder/dist/help.md +33 -0
  114. package/comate-engine/plugins/casebuilder/dist/index.js +837 -0
  115. package/comate-engine/plugins/casebuilder/package.json +80 -0
  116. package/comate-engine/plugins/centrino/assets/icon.png +0 -0
  117. package/comate-engine/plugins/centrino/dist/help.md +30 -0
  118. package/comate-engine/plugins/centrino/dist/index.js +1046 -0
  119. package/comate-engine/plugins/centrino/package.json +68 -0
  120. package/comate-engine/plugins/cnap/assets/cnap.png +0 -0
  121. package/comate-engine/plugins/cnap/dist/help.md +11 -0
  122. package/comate-engine/plugins/cnap/dist/index.js +171 -0
  123. package/comate-engine/plugins/cnap/package.json +65 -0
  124. package/comate-engine/plugins/demo-feature/assets/icon.svg +1 -0
  125. package/comate-engine/plugins/demo-feature/dist/help.md +1 -0
  126. package/comate-engine/plugins/demo-feature/dist/index.d.ts +2 -0
  127. package/comate-engine/plugins/demo-feature/dist/index.js +36008 -0
  128. package/comate-engine/plugins/demo-feature/dist/providers/codeQuery.d.ts +12 -0
  129. package/comate-engine/plugins/demo-feature/dist/providers/codeQuery.js +23 -0
  130. package/comate-engine/plugins/demo-feature/dist/providers/codeSearch.d.ts +8 -0
  131. package/comate-engine/plugins/demo-feature/dist/providers/codeSearch.js +26 -0
  132. package/comate-engine/plugins/demo-feature/dist/providers/config.d.ts +13 -0
  133. package/comate-engine/plugins/demo-feature/dist/providers/config.js +25 -0
  134. package/comate-engine/plugins/demo-feature/dist/providers/context.d.ts +10 -0
  135. package/comate-engine/plugins/demo-feature/dist/providers/context.js +49 -0
  136. package/comate-engine/plugins/demo-feature/dist/providers/debugAgent.d.ts +8 -0
  137. package/comate-engine/plugins/demo-feature/dist/providers/debugAgent.js +65 -0
  138. package/comate-engine/plugins/demo-feature/dist/providers/explainCode.d.ts +9 -0
  139. package/comate-engine/plugins/demo-feature/dist/providers/explainCode.js +24 -0
  140. package/comate-engine/plugins/demo-feature/dist/providers/fallback.d.ts +5 -0
  141. package/comate-engine/plugins/demo-feature/dist/providers/fallback.js +23 -0
  142. package/comate-engine/plugins/demo-feature/dist/providers/file.d.ts +13 -0
  143. package/comate-engine/plugins/demo-feature/dist/providers/file.js +36 -0
  144. package/comate-engine/plugins/demo-feature/dist/providers/help.d.ts +8 -0
  145. package/comate-engine/plugins/demo-feature/dist/providers/help.js +19 -0
  146. package/comate-engine/plugins/demo-feature/dist/providers/information.d.ts +13 -0
  147. package/comate-engine/plugins/demo-feature/dist/providers/information.js +23 -0
  148. package/comate-engine/plugins/demo-feature/dist/providers/knowledge.d.ts +15 -0
  149. package/comate-engine/plugins/demo-feature/dist/providers/knowledge.js +71 -0
  150. package/comate-engine/plugins/demo-feature/dist/providers/log.d.ts +12 -0
  151. package/comate-engine/plugins/demo-feature/dist/providers/log.js +21 -0
  152. package/comate-engine/plugins/demo-feature/dist/providers/onlyCode.d.ts +8 -0
  153. package/comate-engine/plugins/demo-feature/dist/providers/onlyCode.js +23 -0
  154. package/comate-engine/plugins/demo-feature/dist/providers/pluginConfig.d.ts +8 -0
  155. package/comate-engine/plugins/demo-feature/dist/providers/pluginConfig.js +47 -0
  156. package/comate-engine/plugins/demo-feature/dist/providers/prompt.d.ts +7 -0
  157. package/comate-engine/plugins/demo-feature/dist/providers/prompt.js +7 -0
  158. package/comate-engine/plugins/demo-feature/dist/providers/ragProvider.d.ts +8 -0
  159. package/comate-engine/plugins/demo-feature/dist/providers/ragProvider.js +17 -0
  160. package/comate-engine/plugins/demo-feature/dist/providers/render.d.ts +8 -0
  161. package/comate-engine/plugins/demo-feature/dist/providers/render.js +75 -0
  162. package/comate-engine/plugins/demo-feature/dist/providers/renderJsx.d.ts +10 -0
  163. package/comate-engine/plugins/demo-feature/dist/providers/renderJsx.js +173 -0
  164. package/comate-engine/plugins/demo-feature/dist/providers/section.d.ts +8 -0
  165. package/comate-engine/plugins/demo-feature/dist/providers/section.js +136 -0
  166. package/comate-engine/plugins/demo-feature/dist/providers/selectedKnowledge.d.ts +12 -0
  167. package/comate-engine/plugins/demo-feature/dist/providers/selectedKnowledge.js +17 -0
  168. package/comate-engine/plugins/demo-feature/dist/providers/streaming.d.ts +8 -0
  169. package/comate-engine/plugins/demo-feature/dist/providers/streaming.js +29 -0
  170. package/comate-engine/plugins/demo-feature/dist/providers/userDetail.d.ts +8 -0
  171. package/comate-engine/plugins/demo-feature/dist/providers/userDetail.js +28 -0
  172. package/comate-engine/plugins/demo-feature/package.json +214 -0
  173. package/comate-engine/plugins/demo-timer/assets/icon.svg +2 -0
  174. package/comate-engine/plugins/demo-timer/dist/index.js +463 -0
  175. package/comate-engine/plugins/demo-timer/package.json +73 -0
  176. package/comate-engine/plugins/dev-tools/assets/icon.png +0 -0
  177. package/comate-engine/plugins/dev-tools/dist/help.md +18 -0
  178. package/comate-engine/plugins/dev-tools/dist/index.js +166160 -0
  179. package/comate-engine/plugins/dev-tools/package.json +95 -0
  180. package/comate-engine/plugins/devaux/assets/icon.svg +1 -0
  181. package/comate-engine/plugins/devaux/dist/help.md +41 -0
  182. package/comate-engine/plugins/devaux/dist/index.js +73829 -0
  183. package/comate-engine/plugins/devaux/dist/static/tree-sitter-cpp.wasm +0 -0
  184. package/comate-engine/plugins/devaux/dist/static/tree-sitter-go.wasm +0 -0
  185. package/comate-engine/plugins/devaux/dist/static/tree-sitter.wasm +0 -0
  186. package/comate-engine/plugins/devaux/dist/tree-sitter.wasm +0 -0
  187. package/comate-engine/plugins/devaux/package.json +83 -0
  188. package/comate-engine/plugins/f2c/assets/icon.svg +11 -0
  189. package/comate-engine/plugins/f2c/dist/help.md +13 -0
  190. package/comate-engine/plugins/f2c/dist/index.js +64551 -0
  191. package/comate-engine/plugins/f2c/package.json +56 -0
  192. package/comate-engine/plugins/fcnap/assets/icon.png +0 -0
  193. package/comate-engine/plugins/fcnap/dist/help.md +9 -0
  194. package/comate-engine/plugins/fcnap/dist/index.js +105 -0
  195. package/comate-engine/plugins/fcnap/package.json +50 -0
  196. package/comate-engine/plugins/front-end-skills/assets/icon.svg +1 -0
  197. package/comate-engine/plugins/front-end-skills/dist/help.md +17 -0
  198. package/comate-engine/plugins/front-end-skills/dist/index.js +8172 -0
  199. package/comate-engine/plugins/front-end-skills/package.json +79 -0
  200. package/comate-engine/plugins/gdp/assets/icon.png +0 -0
  201. package/comate-engine/plugins/gdp/dist/help.md +11 -0
  202. package/comate-engine/plugins/gdp/dist/index.js +53065 -0
  203. package/comate-engine/plugins/gdp/package.json +79 -0
  204. package/comate-engine/plugins/git/assets/git.svg +1 -0
  205. package/comate-engine/plugins/git/assets/icon.svg +1 -0
  206. package/comate-engine/plugins/git/dist/help.md +7 -0
  207. package/comate-engine/plugins/git/dist/index.js +32675 -0
  208. package/comate-engine/plugins/git/package.json +91 -0
  209. package/comate-engine/plugins/harmonyos/assets/harmonyos.png +0 -0
  210. package/comate-engine/plugins/harmonyos/dist/index.js +78 -0
  211. package/comate-engine/plugins/harmonyos/package.json +37 -0
  212. package/comate-engine/plugins/iapi/assets/icon.png +0 -0
  213. package/comate-engine/plugins/iapi/dist/help.md +13 -0
  214. package/comate-engine/plugins/iapi/dist/index.js +458 -0
  215. package/comate-engine/plugins/iapi/dist/static/lang/tree-sitter-go.wasm +0 -0
  216. package/comate-engine/plugins/iapi/dist/static/lang/tree-sitter-java.wasm +0 -0
  217. package/comate-engine/plugins/iapi/dist/static/tree-sitter-go.wasm +0 -0
  218. package/comate-engine/plugins/iapi/dist/static/tree-sitter-java.wasm +0 -0
  219. package/comate-engine/plugins/iapi/dist/tree-sitter.wasm +0 -0
  220. package/comate-engine/plugins/iapi/package.json +102 -0
  221. package/comate-engine/plugins/icafe/assets/icafe.svg +1 -0
  222. package/comate-engine/plugins/icafe/dist/help.md +5 -0
  223. package/comate-engine/plugins/icafe/dist/index.js +885 -0
  224. package/comate-engine/plugins/icafe/package.json +74 -0
  225. package/comate-engine/plugins/ievalue/assets/iEValue.svg +10 -0
  226. package/comate-engine/plugins/ievalue/dist/index.js +2920 -0
  227. package/comate-engine/plugins/ievalue/package.json +88 -0
  228. package/comate-engine/plugins/ipipe/assets/iPipePlugin.png +0 -0
  229. package/comate-engine/plugins/ipipe/dist/help.md +15 -0
  230. package/comate-engine/plugins/ipipe/dist/index.js +7264 -0
  231. package/comate-engine/plugins/ipipe/package.json +62 -0
  232. package/comate-engine/plugins/jarvis/assets/icon.svg +1 -0
  233. package/comate-engine/plugins/jarvis/dist/help.md +17 -0
  234. package/comate-engine/plugins/jarvis/dist/index.js +140416 -0
  235. package/comate-engine/plugins/jarvis/package.json +93 -0
  236. package/comate-engine/plugins/mapsearch/assets/mapsearchicon.png +0 -0
  237. package/comate-engine/plugins/mapsearch/dist/help.md +4 -0
  238. package/comate-engine/plugins/mapsearch/dist/index.js +145 -0
  239. package/comate-engine/plugins/mapsearch/package.json +53 -0
  240. package/comate-engine/plugins/paddle/assets/icon.png +0 -0
  241. package/comate-engine/plugins/paddle/assets/paconvert-3.0.1-py3-none-any.whl +0 -0
  242. package/comate-engine/plugins/paddle/dist/help.md +31 -0
  243. package/comate-engine/plugins/paddle/dist/index.js +1011 -0
  244. package/comate-engine/plugins/paddle/package.json +129 -0
  245. package/comate-engine/plugins/robot/assets/Robot.png +0 -0
  246. package/comate-engine/plugins/robot/dist/index.js +288 -0
  247. package/comate-engine/plugins/robot/package.json +67 -0
  248. package/comate-engine/plugins/security/assets/comate.png +0 -0
  249. package/comate-engine/plugins/security/dist/index.js +18393 -0
  250. package/comate-engine/plugins/security/package.json +82 -0
  251. package/comate-engine/plugins/smartapp/assets/icon.png +0 -0
  252. package/comate-engine/plugins/smartapp/dist/help.md +4 -0
  253. package/comate-engine/plugins/smartapp/dist/index.js +113 -0
  254. package/comate-engine/plugins/smartapp/package.json +54 -0
  255. package/comate-engine/plugins/springer/assets/icon.png +0 -0
  256. package/comate-engine/plugins/springer/dist/help.md +4 -0
  257. package/comate-engine/plugins/springer/dist/index.js +94525 -0
  258. package/comate-engine/plugins/springer/package.json +71 -0
  259. package/comate-engine/plugins/testmate/assets/icon.svg +1 -0
  260. package/comate-engine/plugins/testmate/dist/help.md +62 -0
  261. package/comate-engine/plugins/testmate/dist/index.js +21483 -0
  262. package/comate-engine/plugins/testmate/package.json +85 -0
  263. package/comate-engine/plugins/tor/assets/TorPlugin.png +0 -0
  264. package/comate-engine/plugins/tor/dist/help.md +22 -0
  265. package/comate-engine/plugins/tor/dist/index.js +807 -0
  266. package/comate-engine/plugins/tor/package.json +99 -0
  267. package/comate-engine/plugins/weiyun/assets/icon.png +0 -0
  268. package/comate-engine/plugins/weiyun/dist/help.md +11 -0
  269. package/comate-engine/plugins/weiyun/dist/index.js +100491 -0
  270. package/comate-engine/plugins/weiyun/package.json +55 -0
  271. package/comate-engine/plugins/wenku/assets/icon.svg +1 -0
  272. package/comate-engine/plugins/wenku/dist/index.js +249 -0
  273. package/comate-engine/plugins/wenku/package.json +55 -0
  274. package/comate-engine/plugins/workcard/assets/favicon.png +0 -0
  275. package/comate-engine/plugins/workcard/dist/help.md +30 -0
  276. package/comate-engine/plugins/workcard/dist/index.js +490 -0
  277. package/comate-engine/plugins/workcard/package.json +95 -0
  278. package/comate-engine/plugins/xiaomi-aiot/assets/icon.png +0 -0
  279. package/comate-engine/plugins/xiaomi-aiot/dist/help.md +6 -0
  280. package/comate-engine/plugins/xiaomi-aiot/dist/index.js +37466 -0
  281. package/comate-engine/plugins/xiaomi-aiot/package.json +63 -0
  282. package/comate-engine/server.d.ts +3 -0
  283. package/comate-engine/server.js +474 -0
  284. package/dist/bundle/index.js +29 -58174
  285. package/package.json +2 -1
@@ -0,0 +1,452 @@
1
+ import { SkillProvider, StringChunkStream, ElementChunkStream } 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 = 'bfc-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 AI_SERVER_HOST = 'http://10.11.87.193:8710';
28
+ const abGitcaseId = '13882351';
29
+ const caseGitcaseId = '13794791';
30
+ const instructModeId = '13793177';
31
+
32
+ var ResponseCode = /*#__PURE__*/ function(ResponseCode) {
33
+ ResponseCode[ResponseCode["SUCCESS"] = 200] = "SUCCESS";
34
+ ResponseCode[ResponseCode["FAILURE"] = 300] = "FAILURE";
35
+ return ResponseCode;
36
+ }({});
37
+ async function generateService(_this, params) {
38
+ try {
39
+ const response = await fetch(`${AI_SERVER_HOST}/mockAPICaseGenerator`, {
40
+ method: 'POST',
41
+ headers: {
42
+ 'Content-Type': 'application/json'
43
+ },
44
+ body: JSON.stringify({
45
+ ...params
46
+ }),
47
+ signal: AbortSignal.timeout(300000)
48
+ });
49
+ return await response.json();
50
+ } catch (ex) {
51
+ if (ex.name === 'TimeoutError') {
52
+ return {
53
+ code: 300,
54
+ message: '网络请求超时。'
55
+ };
56
+ }
57
+ return {
58
+ code: 300,
59
+ message: `执行失败 ${ex instanceof Error ? `: ${ex.message}` : ''}`
60
+ };
61
+ }
62
+ }
63
+
64
+ class GenNewCaseSkillProvider extends SkillProvider {
65
+ static{
66
+ this.skillName = 'generateBfcCode';
67
+ }
68
+ static{
69
+ this.displayName = 'bfc用例生成';
70
+ }
71
+ static{
72
+ this.description = 'bfc用例生成';
73
+ }
74
+ static{
75
+ this.parameters = {
76
+ type: 'object',
77
+ properties: {}
78
+ };
79
+ }
80
+ async *execute() {
81
+ const stream = new StringChunkStream();
82
+ try {
83
+ const userDetail = await this.currentUser.requestDetail();
84
+ if (!userDetail) {
85
+ yield stream.flushReplaceLast('请先完成授权');
86
+ return;
87
+ }
88
+ const { query, activeFilePath: filePath, activeFileContent: codeContent } = this.currentContext;
89
+ if (!query) {
90
+ yield stream.flushReplaceLast('请输入需求描述。');
91
+ return;
92
+ }
93
+ const case_full_name = filePath.split('/').pop() || '';
94
+ if (!filePath.endsWith('.py') || !case_full_name.startsWith('test_')) {
95
+ yield stream.flushReplaceLast('请确认打开的文件为用例文件。');
96
+ return;
97
+ }
98
+ const userName = userDetail.name;
99
+ const realQuery = `修改点:${query}`;
100
+ yield stream.flush('开始生成服务代码...\n\n');
101
+ yield stream.flush('\n\n正在生成服务代码...\n\n');
102
+ const retServerCode = await generateService(this, {
103
+ function_name: 'gen_case_by_demo',
104
+ user_demand: realQuery,
105
+ username: userName,
106
+ gitcase_ids: [
107
+ caseGitcaseId
108
+ ],
109
+ case_path: filePath,
110
+ case_demo: codeContent
111
+ });
112
+ const { code, message: msg, data } = retServerCode;
113
+ if (code !== ResponseCode.SUCCESS || !data) {
114
+ yield stream.flush(`生成服务代码出错:${msg},错误码:${code}\n\n`);
115
+ return;
116
+ }
117
+ if (Array.isArray(data[caseGitcaseId]) && data[caseGitcaseId].length > 0) {
118
+ const case_data = data[caseGitcaseId];
119
+ const lens = case_data.length;
120
+ for(let i = 0; i < lens; i++){
121
+ const content = case_data[i].content;
122
+ if (case_data[i].filename && case_data[i].filename !== '') {
123
+ yield stream.flush(`- 参考文件名:${case_data[i].filename}\n\n`);
124
+ }
125
+ yield stream.flush([
126
+ '```python',
127
+ content,
128
+ '```',
129
+ '\n\n'
130
+ ].join('\n'));
131
+ }
132
+ } else {
133
+ yield stream.flush(`未生成服务代码,请联系负责人或稍后再试。${data}\n\n`);
134
+ }
135
+ } catch (error) {
136
+ this.logger.error(`Error: ${error}`);
137
+ yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
138
+ }
139
+ }
140
+ }
141
+
142
+ class GenAbnormalCaseSkillProvider extends SkillProvider {
143
+ static{
144
+ this.skillName = 'generateAbnormalCode';
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
+ const stream = new StringChunkStream();
160
+ try {
161
+ const userDetail = await this.currentUser.requestDetail();
162
+ if (!userDetail) {
163
+ yield stream.flushReplaceLast('请先完成授权');
164
+ return;
165
+ }
166
+ const { query, activeFilePath: filePath, activeFileContent: codeContent } = this.currentContext;
167
+ if (!query) {
168
+ yield stream.flushReplaceLast('请输入需求描述。');
169
+ return;
170
+ }
171
+ const case_full_name = filePath.split('/').pop() || '';
172
+ if (!filePath.endsWith('.py') || !case_full_name.startsWith('test_')) {
173
+ yield stream.flushReplaceLast('请确认打开的文件为用例文件。');
174
+ return;
175
+ }
176
+ const userName = userDetail.name;
177
+ yield stream.flush('异常用例生成请求已发送...\n\n');
178
+ yield stream.flush('异常用例正在生成中...\n\n');
179
+ const retServerCode = await generateService(this, {
180
+ function_name: 'gen_abnormal_case',
181
+ user_demand: query,
182
+ username: userName,
183
+ gitcase_ids: [
184
+ abGitcaseId
185
+ ],
186
+ case_path: filePath,
187
+ case_demo: codeContent
188
+ });
189
+ const { code, message: msg, data } = retServerCode;
190
+ if (code !== ResponseCode.SUCCESS || !data) {
191
+ yield stream.flush(`生成服务代码出错:${msg},错误码:${code}\n\n`);
192
+ return;
193
+ }
194
+ if (Array.isArray(data[abGitcaseId]) && data[abGitcaseId].length > 0) {
195
+ const case_data = data[abGitcaseId];
196
+ const lens = case_data.length;
197
+ for(let i = 0; i < lens; i++){
198
+ const content = case_data[i].content;
199
+ yield stream.flush(`- 异常用例文件名:${case_data[i].filename}\n\n`);
200
+ yield stream.flush([
201
+ '```python',
202
+ content,
203
+ '```',
204
+ '\n\n'
205
+ ].join('\n'));
206
+ }
207
+ } else {
208
+ yield stream.flush(`未生成服务代码,请联系负责人或稍后再试。${data}\n\n`);
209
+ }
210
+ } catch (error) {
211
+ this.logger.error(`Error: ${error}`);
212
+ yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
213
+ }
214
+ }
215
+ }
216
+
217
+ class InstructModeSkillProvider extends SkillProvider {
218
+ static{
219
+ this.skillName = 'bfcInstructMode';
220
+ }
221
+ static{
222
+ this.displayName = 'bfc用例指令';
223
+ }
224
+ static{
225
+ this.description = 'bfc用例指令';
226
+ }
227
+ static{
228
+ this.parameters = {
229
+ type: 'object',
230
+ properties: {}
231
+ };
232
+ }
233
+ async *execute() {
234
+ const stream = new StringChunkStream();
235
+ try {
236
+ const userDetail = await this.currentUser.requestDetail();
237
+ if (!userDetail) {
238
+ yield stream.flushReplaceLast('请先完成授权');
239
+ return;
240
+ }
241
+ const { query, activeFilePath: filePath, activeFileContent: codeContent } = this.currentContext;
242
+ if (!query) {
243
+ yield stream.flushReplaceLast('请输入需求描述。');
244
+ return;
245
+ }
246
+ if (!query.includes(':')) {
247
+ yield stream.flushReplaceLast('请使用中文冒号分割业务线和指令内容,eg: 打车:续写协议一致性。');
248
+ return;
249
+ }
250
+ const case_full_name = filePath.split('/').pop() || '';
251
+ if (!filePath.endsWith('.py') || !case_full_name.startsWith('test_')) {
252
+ yield stream.flushReplaceLast('请确认打开的文件为用例文件。');
253
+ return;
254
+ }
255
+ const userName = userDetail.name;
256
+ yield stream.flush('开始生成服务代码...\n\n');
257
+ yield stream.flush('\n\n正在生成服务代码...\n\n');
258
+ const retServerCode = await generateService(this, {
259
+ function_name: 'gen_case_by_instruct',
260
+ user_demand: query,
261
+ username: userName,
262
+ gitcase_ids: [
263
+ instructModeId
264
+ ],
265
+ case_path: filePath,
266
+ case_demo: codeContent
267
+ });
268
+ const { code, message: msg, data } = retServerCode;
269
+ if (code !== ResponseCode.SUCCESS || !data) {
270
+ yield stream.flush(`生成服务代码出错:${msg},错误码:${code}\n\n`);
271
+ return;
272
+ }
273
+ if (Array.isArray(data[instructModeId]) && data[instructModeId].length > 0) {
274
+ const case_data = data[instructModeId];
275
+ const lens = case_data.length;
276
+ for(let i = 0; i < lens; i++){
277
+ const content = case_data[i].content;
278
+ if (case_data[i].filename && case_data[i].filename !== '') {
279
+ yield stream.flush(`- 参考文件名:${case_data[i].filename}\n\n`);
280
+ }
281
+ yield stream.flush([
282
+ '```python',
283
+ content,
284
+ '```',
285
+ '\n\n'
286
+ ].join('\n'));
287
+ }
288
+ } else {
289
+ yield stream.flush(`未生成服务代码,请联系负责人或稍后再试。${data}\n\n`);
290
+ }
291
+ } catch (error) {
292
+ this.logger.error(`Error: ${error}`);
293
+ yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
294
+ }
295
+ }
296
+ }
297
+
298
+ function jsx(type, props) {
299
+ // 按照React的逻辑,`boolean`、`null`、`undefined`是不会显示出来的
300
+ const children = Array.isArray(props.children) ? props.children.filter((v)=>v != null && typeof v !== 'boolean') : props.children;
301
+ return {
302
+ type,
303
+ ...props,
304
+ children
305
+ };
306
+ }
307
+
308
+ class GetBatchCases extends SkillProvider {
309
+ static{
310
+ this.skillName = 'getBatchCases';
311
+ }
312
+ static{
313
+ this.displayName = '获取自动化用例列表';
314
+ }
315
+ static{
316
+ this.description = '获取自动化用例列表';
317
+ }
318
+ constructor(init){
319
+ super(init);
320
+ this.cwd = init.cwd;
321
+ }
322
+ static{
323
+ this.parameters = {
324
+ type: 'object',
325
+ properties: {},
326
+ required: []
327
+ };
328
+ }
329
+ async *execute() {
330
+ const stream = new ElementChunkStream();
331
+ const strStream = new StringChunkStream();
332
+ try {
333
+ const userDetail = await this.currentUser.requestDetail();
334
+ if (!userDetail) {
335
+ yield strStream.flushReplaceLast('请先完成授权');
336
+ return;
337
+ }
338
+ const { query, activeFilePath: filePath, activeFileContent: codeContent } = this.currentContext;
339
+ if (!query) {
340
+ yield strStream.flushReplaceLast('请输入 gitcase 项目名称。');
341
+ return;
342
+ }
343
+ const case_full_name = filePath.split('/').pop() || '';
344
+ if (!filePath.endsWith('.py') || !case_full_name.startsWith('test_')) {
345
+ yield strStream.flushReplaceLast('请确认当前打开的文件为自动化用例文件,采纳文件将与该文件保存至同一目录下。');
346
+ return;
347
+ }
348
+ const userName = userDetail.name;
349
+ const retServerCode = await generateService(this, {
350
+ function_name: 'get_batch_cases',
351
+ user_demand: query,
352
+ username: userName,
353
+ gitcase_ids: [
354
+ "0"
355
+ ],
356
+ case_path: this.cwd + '/' + filePath,
357
+ case_demo: ""
358
+ });
359
+ const { code, message: msg, data } = retServerCode;
360
+ if (code !== ResponseCode.SUCCESS || !data) {
361
+ yield stream.flush(/*#__PURE__*/ jsx("p", {
362
+ children: [
363
+ "查询生成用例失败,错误信息:",
364
+ msg
365
+ ]
366
+ }));
367
+ return;
368
+ }
369
+ yield stream.flush(/*#__PURE__*/ jsx("table", {
370
+ children: [
371
+ /*#__PURE__*/ jsx("thead", {
372
+ children: /*#__PURE__*/ jsx("tr", {
373
+ children: [
374
+ /*#__PURE__*/ jsx("th", {
375
+ children: "GitCase ID"
376
+ }),
377
+ /*#__PURE__*/ jsx("th", {
378
+ children: "描述"
379
+ }),
380
+ /*#__PURE__*/ jsx("th", {
381
+ children: "用例文件名"
382
+ }),
383
+ /*#__PURE__*/ jsx("th", {
384
+ children: /*#__PURE__*/ jsx("flex", {
385
+ horizontalCentered: true,
386
+ children: "操作"
387
+ })
388
+ })
389
+ ]
390
+ })
391
+ }),
392
+ /*#__PURE__*/ jsx("tbody", {
393
+ children: (()=>{
394
+ const rows = [];
395
+ for(let i = 0; i < data.length; i++){
396
+ const item = data[i];
397
+ rows.push(/*#__PURE__*/ jsx("tr", {
398
+ children: [
399
+ /*#__PURE__*/ jsx("td", {
400
+ children: item.gitcase_id
401
+ }),
402
+ /*#__PURE__*/ jsx("td", {
403
+ children: item.case_desc
404
+ }),
405
+ /*#__PURE__*/ jsx("td", {
406
+ children: item.case_name
407
+ }),
408
+ /*#__PURE__*/ jsx("td", {
409
+ children: /*#__PURE__*/ jsx("flex", {
410
+ horizontalCentered: true,
411
+ children: /*#__PURE__*/ jsx("command-button", {
412
+ commandName: "commitMessage:confirmIssue",
413
+ data: "yes",
414
+ replyText: "单独Button replyText",
415
+ // variant="text"
416
+ action: "insertToFile",
417
+ actionData: {
418
+ filePath: item.case_path,
419
+ position: {
420
+ line: 1,
421
+ character: 0
422
+ },
423
+ newText: item.case_content
424
+ },
425
+ children: "采纳"
426
+ })
427
+ })
428
+ })
429
+ ]
430
+ }));
431
+ }
432
+ return rows;
433
+ })()
434
+ })
435
+ ]
436
+ }));
437
+ } catch (error) {
438
+ this.logger.error(`Error: ${error}`);
439
+ yield strStream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
440
+ }
441
+ }
442
+ }
443
+
444
+ function setup({ registry }) {
445
+ registry.registerSkillProvider('bfc-help', HelpSkillProvider);
446
+ registry.registerSkillProvider('genBfcCode', GenNewCaseSkillProvider);
447
+ registry.registerSkillProvider('genAbnormalCode', GenAbnormalCaseSkillProvider);
448
+ registry.registerSkillProvider('bfcInstructMode', InstructModeSkillProvider);
449
+ registry.registerSkillProvider('getBatchCases', GetBatchCases);
450
+ }
451
+
452
+ export { setup };
@@ -0,0 +1,8 @@
1
+ import { SkillProvider, FunctionParameterDefinition, TaskProgressChunk } from '@comate/plugin-host';
2
+ export declare class InstructModeSkillProvider extends SkillProvider {
3
+ static skillName: string;
4
+ static displayName: string;
5
+ static description: string;
6
+ static parameters: FunctionParameterDefinition;
7
+ execute(): AsyncIterableIterator<TaskProgressChunk>;
8
+ }
@@ -0,0 +1,77 @@
1
+ /* eslint-disable camelcase, complexity, max-depth */
2
+ import { SkillProvider, StringChunkStream, } from '@comate/plugin-host';
3
+ import { generateService, ResponseCode } from '../service/generateService.js';
4
+ import { instructModeId } from '../config/config.js';
5
+ export class InstructModeSkillProvider extends SkillProvider {
6
+ static skillName = 'bfcInstructMode';
7
+ static displayName = 'bfc用例指令';
8
+ static description = 'bfc用例指令';
9
+ static parameters = {
10
+ type: 'object',
11
+ properties: {},
12
+ };
13
+ async *execute() {
14
+ const stream = new StringChunkStream();
15
+ try {
16
+ const userDetail = await this.currentUser.requestDetail();
17
+ if (!userDetail) {
18
+ yield stream.flushReplaceLast('请先完成授权');
19
+ return;
20
+ }
21
+ const { query, activeFilePath: filePath, activeFileContent: codeContent } = this.currentContext;
22
+ if (!query) {
23
+ yield stream.flushReplaceLast('请输入需求描述。');
24
+ return;
25
+ }
26
+ if (!query.includes(':')) {
27
+ yield stream.flushReplaceLast('请使用中文冒号分割业务线和指令内容,eg: 打车:续写协议一致性。');
28
+ return;
29
+ }
30
+ const case_full_name = filePath.split('/').pop() || '';
31
+ if (!filePath.endsWith('.py') || !case_full_name.startsWith('test_')) {
32
+ yield stream.flushReplaceLast('请确认打开的文件为用例文件。');
33
+ return;
34
+ }
35
+ const userName = userDetail.name;
36
+ yield stream.flush('开始生成服务代码...\n\n');
37
+ yield stream.flush('\n\n正在生成服务代码...\n\n');
38
+ const retServerCode = await generateService(this, {
39
+ function_name: 'gen_case_by_instruct',
40
+ user_demand: query,
41
+ username: userName,
42
+ gitcase_ids: [instructModeId],
43
+ case_path: filePath,
44
+ case_demo: codeContent,
45
+ });
46
+ const { code, message: msg, data } = retServerCode;
47
+ if (code !== ResponseCode.SUCCESS || !data) {
48
+ yield stream.flush(`生成服务代码出错:${msg},错误码:${code}\n\n`);
49
+ return;
50
+ }
51
+ if (Array.isArray(data[instructModeId]) && data[instructModeId].length > 0) {
52
+ const case_data = data[instructModeId];
53
+ const lens = case_data.length;
54
+ for (let i = 0; i < lens; i++) {
55
+ const content = case_data[i].content;
56
+ if (case_data[i].filename && case_data[i].filename !== '') {
57
+ yield stream.flush(`- 参考文件名:${case_data[i].filename}\n\n`);
58
+ }
59
+ yield stream.flush([
60
+ '```python',
61
+ content,
62
+ '```',
63
+ '\n\n',
64
+ ]
65
+ .join('\n'));
66
+ }
67
+ }
68
+ else {
69
+ yield stream.flush(`未生成服务代码,请联系负责人或稍后再试。${data}\n\n`);
70
+ }
71
+ }
72
+ catch (error) {
73
+ this.logger.error(`Error: ${error}`);
74
+ yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,8 @@
1
+ import { SkillProvider, FunctionParameterDefinition, TaskProgressChunk } from '@comate/plugin-host';
2
+ export declare class GenAbnormalCaseSkillProvider extends SkillProvider {
3
+ static skillName: string;
4
+ static displayName: string;
5
+ static description: string;
6
+ static parameters: FunctionParameterDefinition;
7
+ execute(): AsyncIterableIterator<TaskProgressChunk>;
8
+ }
@@ -0,0 +1,71 @@
1
+ /* eslint-disable camelcase, complexity */
2
+ import { SkillProvider, StringChunkStream, } from '@comate/plugin-host';
3
+ import { generateService, ResponseCode } from '../service/generateService.js';
4
+ import { abGitcaseId } from '../config/config.js';
5
+ export class GenAbnormalCaseSkillProvider extends SkillProvider {
6
+ static skillName = 'generateAbnormalCode';
7
+ static displayName = '异常用例生成';
8
+ static description = '异常用例生成';
9
+ static parameters = {
10
+ type: 'object',
11
+ properties: {},
12
+ };
13
+ async *execute() {
14
+ const stream = new StringChunkStream();
15
+ try {
16
+ const userDetail = await this.currentUser.requestDetail();
17
+ if (!userDetail) {
18
+ yield stream.flushReplaceLast('请先完成授权');
19
+ return;
20
+ }
21
+ const { query, activeFilePath: filePath, activeFileContent: codeContent } = this.currentContext;
22
+ if (!query) {
23
+ yield stream.flushReplaceLast('请输入需求描述。');
24
+ return;
25
+ }
26
+ const case_full_name = filePath.split('/').pop() || '';
27
+ if (!filePath.endsWith('.py') || !case_full_name.startsWith('test_')) {
28
+ yield stream.flushReplaceLast('请确认打开的文件为用例文件。');
29
+ return;
30
+ }
31
+ const userName = userDetail.name;
32
+ yield stream.flush('异常用例生成请求已发送...\n\n');
33
+ yield stream.flush('异常用例正在生成中...\n\n');
34
+ const retServerCode = await generateService(this, {
35
+ function_name: 'gen_abnormal_case',
36
+ user_demand: query,
37
+ username: userName,
38
+ gitcase_ids: [abGitcaseId],
39
+ case_path: filePath,
40
+ case_demo: codeContent,
41
+ });
42
+ const { code, message: msg, data } = retServerCode;
43
+ if (code !== ResponseCode.SUCCESS || !data) {
44
+ yield stream.flush(`生成服务代码出错:${msg},错误码:${code}\n\n`);
45
+ return;
46
+ }
47
+ if (Array.isArray(data[abGitcaseId]) && data[abGitcaseId].length > 0) {
48
+ const case_data = data[abGitcaseId];
49
+ const lens = case_data.length;
50
+ for (let i = 0; i < lens; i++) {
51
+ const content = case_data[i].content;
52
+ yield stream.flush(`- 异常用例文件名:${case_data[i].filename}\n\n`);
53
+ yield stream.flush([
54
+ '```python',
55
+ content,
56
+ '```',
57
+ '\n\n',
58
+ ]
59
+ .join('\n'));
60
+ }
61
+ }
62
+ else {
63
+ yield stream.flush(`未生成服务代码,请联系负责人或稍后再试。${data}\n\n`);
64
+ }
65
+ }
66
+ catch (error) {
67
+ this.logger.error(`Error: ${error}`);
68
+ yield stream.flushReplaceLast(`请求出错,请联系负责人或稍后再试。${error}`);
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,8 @@
1
+ import { SkillProvider, FunctionParameterDefinition, TaskProgressChunk } from '@comate/plugin-host';
2
+ export declare class GenNewCaseSkillProvider extends SkillProvider {
3
+ static skillName: string;
4
+ static displayName: string;
5
+ static description: string;
6
+ static parameters: FunctionParameterDefinition;
7
+ execute(): AsyncIterableIterator<TaskProgressChunk>;
8
+ }