cloudcc-cli 2.2.3 → 2.2.5

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 (192) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/README.md +42 -0
  3. package/bin/cc.js +11 -36
  4. package/bin/index.js +33 -0
  5. package/bin/mcp-svc.js +13 -0
  6. package/java/com/cloudcc/core/TriggerInvoker.java +17 -1
  7. package/package.json +3 -2
  8. package/pom.xml +1 -0
  9. package/prompt/DevelopmentEnvironmentConstruction.ts +133 -0
  10. package/prompt/ccdk.ts +1190 -0
  11. package/prompt/ccprompt.ts +8 -0
  12. package/prompt/cloudccdev.ts +109 -0
  13. package/prompt/index.ts +52 -0
  14. package/prompt/objectInfo.ts +94 -0
  15. package/prompt/objectList.ts +25 -0
  16. package/prompt/openapi.ts +310 -0
  17. package/prompt/system.ts +14 -0
  18. package/prompt/vscodeExtension.ts +27 -0
  19. package/src/approval/approve.js +105 -0
  20. package/src/approval/get.js +245 -0
  21. package/src/approval/index.js +11 -0
  22. package/src/approval/reject.js +105 -0
  23. package/src/brief/get.js +51 -0
  24. package/src/brief/index.js +7 -0
  25. package/src/classes/create.js +7 -7
  26. package/src/classes/detail.js +78 -0
  27. package/src/classes/get.js +5 -3
  28. package/src/classes/index.js +1 -0
  29. package/src/classes/publish.js +7 -7
  30. package/src/classes/pull.js +8 -8
  31. package/src/classes/pullList.js +5 -3
  32. package/src/config/get.js +1 -1
  33. package/src/fields/create.js +204 -0
  34. package/src/fields/fields/A.js +23 -0
  35. package/src/fields/fields/AD.js +25 -0
  36. package/src/fields/fields/B.js +28 -0
  37. package/src/fields/fields/C.js +28 -0
  38. package/src/fields/fields/D.js +27 -0
  39. package/src/fields/fields/E.js +28 -0
  40. package/src/fields/fields/ENC.js +28 -0
  41. package/src/fields/fields/ENCD.js +28 -0
  42. package/src/fields/fields/F.js +27 -0
  43. package/src/fields/fields/FL.js +25 -0
  44. package/src/fields/fields/H.js +27 -0
  45. package/src/fields/fields/IMG.js +27 -0
  46. package/src/fields/fields/J.js +26 -0
  47. package/src/fields/fields/L.js +32 -0
  48. package/src/fields/fields/LT.js +28 -0
  49. package/src/fields/fields/M.js +29 -0
  50. package/src/fields/fields/MR.js +24 -0
  51. package/src/fields/fields/N.js +30 -0
  52. package/src/fields/fields/P.js +28 -0
  53. package/src/fields/fields/Q.js +35 -0
  54. package/src/fields/fields/S.js +30 -0
  55. package/src/fields/fields/SCORE.js +24 -0
  56. package/src/fields/fields/T.js +27 -0
  57. package/src/fields/fields/U.js +28 -0
  58. package/src/fields/fields/X.js +28 -0
  59. package/src/fields/fields/Y.js +33 -0
  60. package/src/fields/get.js +36 -0
  61. package/src/fields/index.js +9 -0
  62. package/src/mcp/MCP/345/234/272/346/231/257/346/250/241/346/213/237.md +8 -0
  63. package/src/mcp/index-sse-svc.js +126 -0
  64. package/src/mcp/index-streamable-svc.js +180 -0
  65. package/src/mcp/index.js +519 -115
  66. package/src/mcp/readme.md +75 -70
  67. package/src/mcp/tools/Approval/handler.js +349 -0
  68. package/src/mcp/tools/Class Creator/handler.js +37 -0
  69. package/src/mcp/tools/Class Detail Retriever/handler.js +33 -0
  70. package/src/mcp/tools/Class Detail Retriever/prompt.js +37 -0
  71. package/src/mcp/tools/Class Editor Guide/handler.js +72 -0
  72. package/src/mcp/tools/Class Editor Guide/prompt.js +468 -0
  73. package/src/mcp/tools/Class List Retriever/handler.js +36 -0
  74. package/src/mcp/tools/Class Publisher/handler.js +29 -0
  75. package/src/mcp/tools/Class Publisher/prompt.js +40 -0
  76. package/src/mcp/tools/Class Puller/handler.js +86 -0
  77. package/src/mcp/tools/Class Puller/prompt.js +49 -0
  78. package/src/mcp/tools/Client Script Creator/handler.js +179 -0
  79. package/src/mcp/tools/Client Script Detail Retriever/handler.js +53 -0
  80. package/src/mcp/tools/Client Script Editor Guide/handler.js +633 -0
  81. package/src/mcp/tools/Client Script List Retriever/handler.js +68 -0
  82. package/src/mcp/tools/Client Script Publisher/handler.js +54 -0
  83. package/src/mcp/tools/Client Script Puller/handler.js +73 -0
  84. package/src/mcp/tools/CloudCC Development Overview/handler.js +48 -0
  85. package/src/mcp/tools/CloudCC Development Overview/prompt.js +870 -0
  86. package/src/mcp/tools/Component Creator/handler.js +44 -0
  87. package/src/mcp/tools/Component Detail Retriever/handler.js +38 -0
  88. package/src/mcp/tools/Component Editor Guide/handler.js +76 -0
  89. package/src/mcp/tools/Component Editor Guide/prompt.js +519 -0
  90. package/src/mcp/tools/Component List Retriever/handler.js +43 -0
  91. package/src/mcp/tools/Component Publisher/handler.js +18 -0
  92. package/src/mcp/tools/Component Puller/handler.js +63 -0
  93. package/src/mcp/tools/{dev-env/fetcher.js → Dev Environment Creator/fetcher.js } +8 -8
  94. package/src/mcp/tools/{dev-env/prompt.js → Dev Environment Creator/prompt.js } +19 -2
  95. package/src/mcp/tools/Dev Environment Validator/handler.js +88 -0
  96. package/src/mcp/tools/Dev Environment Validator/prompt.js +193 -0
  97. package/src/mcp/tools/{key-guide/fetcher.js → Developer Key Setup Guide/fetcher.js } +7 -7
  98. package/src/mcp/tools/{key-guide/prompt.js → Developer Key Setup Guide/prompt.js } +3 -3
  99. package/src/mcp/tools/Object Creator/handler.js +34 -0
  100. package/src/mcp/tools/Object Fields Creator/handler.js +64 -0
  101. package/src/mcp/tools/Object Fields Retriever/handler.js +37 -0
  102. package/src/mcp/tools/Object Fields Retriever/prompt.js +10 -0
  103. package/src/mcp/tools/Object List Retriever/handler.js +43 -0
  104. package/src/mcp/tools/Object List Retriever/prompt.js +10 -0
  105. package/src/mcp/tools/Scheduled Class Creator/handler.js +37 -0
  106. package/src/mcp/tools/Scheduled Class Detail Retriever/handler.js +34 -0
  107. package/src/mcp/tools/Scheduled Class List Retriever/handler.js +52 -0
  108. package/src/mcp/tools/Scheduled Class Publisher/handler.js +30 -0
  109. package/src/mcp/tools/Scheduled Class Puller/handler.js +92 -0
  110. package/src/mcp/tools/Trigger Creator/handler.js +53 -0
  111. package/src/mcp/tools/Trigger Detail Retriever/handler.js +33 -0
  112. package/src/mcp/tools/Trigger Editor Guide/handler.js +58 -0
  113. package/src/mcp/tools/Trigger List Retriever/handler.js +49 -0
  114. package/src/mcp/tools/Trigger Publisher/handler.js +34 -0
  115. package/src/mcp/tools/Trigger Puller/handler.js +40 -0
  116. package/src/mcp/tools/ccdk/fetcher.js +3 -3
  117. package/src/mcp/tools/ccdk/prompt.js +2 -2
  118. package/src/mcp/tools/index.js +23 -0
  119. package/src/object/create.js +105 -0
  120. package/src/object/get.js +43 -4
  121. package/src/object/index.js +2 -1
  122. package/src/plugin/create1.js +8 -7
  123. package/src/plugin/detail.js +91 -0
  124. package/src/plugin/get.js +79 -0
  125. package/src/plugin/index.js +4 -1
  126. package/src/plugin/publish.js +13 -13
  127. package/src/plugin/publish1.js +30 -22
  128. package/src/plugin/pull.js +173 -0
  129. package/src/project/create.js +9 -9
  130. package/src/project/create1.js +31 -17
  131. package/src/recordType/get.js +4 -2
  132. package/src/script/create.js +7 -7
  133. package/src/script/detail.js +95 -0
  134. package/src/script/get.js +4 -2
  135. package/src/script/index.js +1 -0
  136. package/src/script/publish.js +14 -14
  137. package/src/script/pull.js +12 -12
  138. package/src/script/pullList.js +5 -3
  139. package/src/timer/create.js +7 -7
  140. package/src/timer/detail.js +84 -0
  141. package/src/timer/get.js +6 -3
  142. package/src/timer/publish.js +7 -7
  143. package/src/timer/pull.js +8 -8
  144. package/src/timer/pullList.js +5 -3
  145. package/src/token/get.js +1 -1
  146. package/src/triggers/create.js +7 -7
  147. package/src/triggers/detail.js +90 -0
  148. package/src/triggers/get.js +4 -2
  149. package/src/triggers/index.js +1 -0
  150. package/src/triggers/publish.js +7 -7
  151. package/src/triggers/pull.js +8 -8
  152. package/src/triggers/pullList.js +5 -3
  153. package/src/version/get.js +3 -3
  154. package/target/ccopenapi-0.0.3-classes.jar +0 -0
  155. package/target/ccopenapi-0.0.3.jar +0 -0
  156. package/target/classes/com/cloudcc/core/CCObject.class +0 -0
  157. package/target/classes/com/cloudcc/core/CCSchedule.class +0 -0
  158. package/target/classes/com/cloudcc/core/CCService.class +0 -0
  159. package/target/classes/com/cloudcc/core/CCTrigger.class +0 -0
  160. package/target/classes/com/cloudcc/core/CCTriggerHandler.class +0 -0
  161. package/target/classes/com/cloudcc/core/DevLogger.class +0 -0
  162. package/target/classes/com/cloudcc/core/OperatationEnum.class +0 -0
  163. package/target/classes/com/cloudcc/core/PeakInterf.class +0 -0
  164. package/target/classes/com/cloudcc/core/SendEmail.class +0 -0
  165. package/target/classes/com/cloudcc/core/ServiceResult.class +0 -0
  166. package/target/classes/com/cloudcc/core/TimeUtil.class +0 -0
  167. package/target/classes/com/cloudcc/core/Tool$1.class +0 -0
  168. package/target/classes/com/cloudcc/core/Tool.class +0 -0
  169. package/target/classes/com/cloudcc/core/TriggerInvoker.class +0 -0
  170. package/target/classes/com/cloudcc/core/TriggerMethod.class +0 -0
  171. package/target/classes/com/cloudcc/core/TriggerTimeEnum.class +0 -0
  172. package/target/classes/com/cloudcc/core/UserInfo.class +0 -0
  173. package/target/maven-archiver/pom.properties +3 -0
  174. package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +18 -0
  175. package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +19 -0
  176. package/template/Appvue +2 -2
  177. package/template/index.js +30 -19
  178. package/tool/branch/index.js +1 -1
  179. package/tool/checkLange/checkLang.js +6 -6
  180. package/tool/checkLange/clearLang.js +1 -1
  181. package/utils/accessClass.js +23 -0
  182. package/utils/checkVersion.js +22 -20
  183. package/utils/config.js +18 -3
  184. package/utils/http.js +10 -10
  185. package/utils/utils.js +97 -32
  186. package/java/com/cloudcc/core/CCTriggerDemo.java +0 -25
  187. package/src/mcp/tools/classes/handler.js +0 -358
  188. package/src/mcp/tools/classes/prompt.js +0 -1261
  189. package/src/mcp/tools/plugin/handler.js +0 -92
  190. /package/src/mcp/tools/{plugin → Component Publisher}/prompt.js +0 -0
  191. /package/src/mcp/tools/{dev-env → Dev Environment Creator}/handler.js +0 -0
  192. /package/src/mcp/tools/{key-guide → Developer Key Setup Guide}/handler.js +0 -0
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 文本区(长)字段(J)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "remark": "",
12
+ "helps": "",
13
+ "schemefieldLength": "10000",
14
+ "defaultValue": "",
15
+ "placeholder": ""
16
+ },
17
+ "dtype": "J:文本区(长)",
18
+ "fdtype": "J",
19
+ "defaultValue": "",
20
+ "profileFieldJson": profileList.map(profile => ({
21
+ "profileId": profile.id,
22
+ "visible": "true",
23
+ "readonly": "false"
24
+ })),
25
+ }
26
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * 选项列表(单选)字段(L)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, ptext, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "schemefieldLength": "255",
12
+ "remark": "",
13
+ "helps": "",
14
+ "edittype": "select"
15
+ },
16
+ "dtype": "L:选项列表",
17
+ "fdtype": "L",
18
+ "ischecked": "false",
19
+ "iscover": "",
20
+ "formulaText": "",
21
+ "useGlobalSelect": "0",
22
+ "globalSelectId": "province",
23
+ "ptext": ptext,
24
+ "isPicklistSorted": "0",
25
+ "defPl": "0",
26
+ "profileFieldJson": profileList.map(profile => ({
27
+ "profileId": profile.id,
28
+ "visible": "true",
29
+ "readonly": "false"
30
+ })),
31
+ }
32
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 地理定位字段(LT)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "remark": "",
12
+ "helps": "",
13
+ "schemefieldLength": "10",
14
+ "decimalPlaces": "10"
15
+ },
16
+ "dtype": "LT:地理定位",
17
+ "fdtype": "LT",
18
+ "ischecked": "false",
19
+ "iscover": "",
20
+ "formulaText": "",
21
+ "displayType": "1",
22
+ "profileFieldJson": profileList.map(profile => ({
23
+ "profileId": profile.id,
24
+ "visible": "true",
25
+ "readonly": "false"
26
+ })),
27
+ }
28
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * 主详信息关系字段(M)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, lookupObj, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "schemefieldLength": "255",
12
+ "remark": "",
13
+ "helps": "",
14
+ "lookupObj": lookupObj,
15
+ "childrelationName": nameLabel
16
+ },
17
+ "dtype": "M:主详信息关系",
18
+ "fdtype": "M",
19
+ "ischecked": "false",
20
+ "iscover": "",
21
+ "formulaText": "",
22
+ "mainlayoutIds": "",
23
+ "profileFieldJson": profileList.map(profile => ({
24
+ "profileId": profile.id,
25
+ "visible": "true",
26
+ "readonly": "false"
27
+ })),
28
+ }
29
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 查找多选字段(MR)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, lookupObj, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "schemefieldLength": "255",
12
+ "remark": "",
13
+ "helps": "",
14
+ "lookupObj": lookupObj
15
+ },
16
+ "dtype": "MR:查找多选",
17
+ "fdtype": "MR",
18
+ "profileFieldJson": profileList.map(profile => ({
19
+ "profileId": profile.id,
20
+ "visible": "true",
21
+ "readonly": "false"
22
+ })),
23
+ }
24
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 数字字段(N)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "remark": "",
12
+ "helps": "",
13
+ "defaultValue": "",
14
+ "schemefieldLength": "10",
15
+ "decimalPlaces": "0",
16
+ "isrepeat": "true",
17
+ "displayThousands": "0"
18
+ },
19
+ "dtype": "N:数字",
20
+ "fdtype": "N",
21
+ "ischecked": "false",
22
+ "iscover": "",
23
+ "formulaText": "",
24
+ "profileFieldJson": profileList.map(profile => ({
25
+ "profileId": profile.id,
26
+ "visible": "true",
27
+ "readonly": "false"
28
+ })),
29
+ }
30
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 百分比字段(P)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "remark": "",
12
+ "helps": "",
13
+ "defaultValue": "",
14
+ "schemefieldLength": "10",
15
+ "decimalPlaces": "2"
16
+ },
17
+ "dtype": "P:百分比",
18
+ "fdtype": "P",
19
+ "ischecked": "false",
20
+ "iscover": "",
21
+ "formulaText": "",
22
+ "profileFieldJson": profileList.map(profile => ({
23
+ "profileId": profile.id,
24
+ "visible": "true",
25
+ "readonly": "false"
26
+ })),
27
+ }
28
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * 选项列表(多选)字段(Q)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, ptext, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "schemefieldLength": "255",
12
+ "edittype": "select",
13
+ "visibleLines": "4",
14
+ "showalloptions": "0",
15
+ "renderstyle": "1",
16
+ "remark": "",
17
+ "helps": ""
18
+ },
19
+ "dtype": "Q:选项列表(多选)",
20
+ "fdtype": "Q",
21
+ "ischecked": "false",
22
+ "useGlobalSelect": "0",
23
+ "globalSelectId": "province",
24
+ "ptext": ptext,
25
+ "isPicklistSorted": "0",
26
+ "defPl": "1",
27
+ "iscover": "",
28
+ "formulaText": "",
29
+ "profileFieldJson": profileList.map(profile => ({
30
+ "profileId": profile.id,
31
+ "visible": "true",
32
+ "readonly": "false"
33
+ })),
34
+ }
35
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * 文本字段(S)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "remark": "",
12
+ "helps": "",
13
+ "schemefieldLength": "255",
14
+ "isrepeat": "true",
15
+ "casesensitive": "",
16
+ "placeholder": "",
17
+ "defaultValue": ""
18
+ },
19
+ "dtype": "S:文本",
20
+ "fdtype": "S",
21
+ "ischecked": "false",
22
+ "iscover": "",
23
+ "formulaText": "",
24
+ "profileFieldJson": profileList.map(profile => ({
25
+ "profileId": profile.id,
26
+ "visible": "true",
27
+ "readonly": "false"
28
+ })),
29
+ }
30
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 评分字段(SCORE)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "remark": "",
12
+ "helps": "",
13
+ "schemefieldLength": "10",
14
+ "defaultValue": ""
15
+ },
16
+ "dtype": "SCORE:评分",
17
+ "fdtype": "SCORE",
18
+ "profileFieldJson": profileList.map(profile => ({
19
+ "profileId": profile.id,
20
+ "visible": "true",
21
+ "readonly": "false"
22
+ })),
23
+ }
24
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * 时间字段(T)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "schemefieldLength": "255",
12
+ "remark": "",
13
+ "helps": "",
14
+ "defaultValue": ""
15
+ },
16
+ "dtype": "T:时间",
17
+ "fdtype": "T",
18
+ "ischecked": "false",
19
+ "iscover": "",
20
+ "formulaText": "",
21
+ "profileFieldJson": profileList.map(profile => ({
22
+ "profileId": profile.id,
23
+ "visible": "true",
24
+ "readonly": "false"
25
+ })),
26
+ }
27
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * URL字段(U)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "remark": "",
12
+ "helps": "",
13
+ "edittype": "_blank",
14
+ "schemefieldLength": "255",
15
+ "defaultValue": ""
16
+ },
17
+ "dtype": "U:URL",
18
+ "fdtype": "U",
19
+ "ischecked": "false",
20
+ "iscover": "",
21
+ "formulaText": "",
22
+ "profileFieldJson": profileList.map(profile => ({
23
+ "profileId": profile.id,
24
+ "visible": "true",
25
+ "readonly": "false"
26
+ })),
27
+ }
28
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 文本区字段(X)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "remark": "",
12
+ "helps": "",
13
+ "defaultValue": "",
14
+ "schemefieldLength": "255",
15
+ "placeholder": ""
16
+ },
17
+ "dtype": "X",
18
+ "fdtype": "X",
19
+ "ischecked": "false",
20
+ "iscover": "",
21
+ "formulaText": "",
22
+ "profileFieldJson": profileList.map(profile => ({
23
+ "profileId": profile.id,
24
+ "visible": "true",
25
+ "readonly": "false"
26
+ })),
27
+ }
28
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * 查找关系字段(Y)配置模板
3
+ */
4
+ module.exports = function (objid, nameLabel, apiname, lookupObj, profileList) {
5
+ return {
6
+ "objid": objid,
7
+ "obj": {
8
+ "id": "",
9
+ "nameLabel": nameLabel,
10
+ "apiname": apiname,
11
+ "schemefieldLength": "255",
12
+ "remark": "",
13
+ "helps": "",
14
+ "lookupObj": lookupObj,
15
+ "defaultValue": "",
16
+ "childrelationName": nameLabel,
17
+ "lookupObjDefaultField": ""
18
+ },
19
+ "dtype": "Y:查找关系",
20
+ "fdtype": "Y",
21
+ "ischecked": "false",
22
+ "iscover": "",
23
+ "formulaText": "",
24
+ "lookupObjDefaultValue": "",
25
+ "lookupObjDefaultValueMod": "0",
26
+ "lookupObjDefaultValuePrefix": "",
27
+ "profileFieldJson": profileList.map(profile => ({
28
+ "profileId": profile.id,
29
+ "visible": "true",
30
+ "readonly": "false"
31
+ })),
32
+ }
33
+ }
@@ -0,0 +1,36 @@
1
+ const { postClass } = require("../../utils/http")
2
+ const { getPackageJson } = require("../../utils/config");
3
+
4
+ async function get(argvs, isMcp = false) {
5
+ const path = argvs[2];
6
+ const objArg = argvs[3];
7
+ const config = await getPackageJson(path);
8
+ const fieldsResults = await postClass(config.setupSvc + "/api/fieldSetup/queryField", { prefix: objArg }, config.accessToken);
9
+
10
+ let res = {
11
+ obj: fieldsResults.data.obj,
12
+ stdFields: fieldsResults.data.stdFields.map((field) => {
13
+ return {
14
+ fieldname: field.labelName,
15
+ apiname: field.schemefieldName,
16
+ schemefieldType: field.schemefieldType,
17
+ id: field.id
18
+ }
19
+ }),
20
+ cusFields: fieldsResults.data.cusFields.map((field) => {
21
+ return {
22
+ fieldname: field.labelName,
23
+ apiname: field.schemefieldName,
24
+ schemefieldType: field.schemefieldType,
25
+ id: field.id
26
+ }
27
+ })
28
+ }
29
+
30
+ if (!isMcp) {
31
+ console.log(JSON.stringify(res));
32
+ }
33
+ return res;
34
+ }
35
+
36
+ module.exports = get;
@@ -0,0 +1,9 @@
1
+ const cc = {}
2
+ cc.get = require("./get")
3
+ cc.create = require("./create")
4
+
5
+ function main(action, argvs) {
6
+ cc[action](argvs)
7
+ }
8
+
9
+ module.exports = main;
@@ -0,0 +1,8 @@
1
+ ## 审批
2
+ *
3
+ * 登录公司系统——》打开小云——〉点击语音输入
4
+ * 1:帮我查看今天需要我审批的记录
5
+ * 2:帮我预算类型的审批记录全部审批通过
6
+ * 3:R017的报备记录文档位置不对,审批拒绝,添加交互确认
7
+ * 4:帮我查看001预算的拆分情况
8
+
@@ -0,0 +1,126 @@
1
+ /**
2
+ * SSE 版本的 MCP 服务器实现
3
+ * 基于 MCP 协议版本 2024-11-05 (已弃用,主要用于向后兼容测试)
4
+ *
5
+ * 服务器暴露两个端点:
6
+ * - GET /mcp: 用于建立 SSE 流
7
+ * - POST /messages: 用于接收客户端消息
8
+ */
9
+
10
+ const { McpServer } = require("@modelcontextprotocol/sdk/server/mcp.js");
11
+ const { SSEServerTransport } = require("@modelcontextprotocol/sdk/server/sse.js");
12
+ const { createMcpExpressApp } = require("@modelcontextprotocol/sdk/server/express.js");
13
+ const { registerAllTools } = require('./tools/index.js');
14
+ const MCP_PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 8018;
15
+
16
+ // 获取服务器实例(单例模式)
17
+ let mcpServerInstance = null;
18
+ function getServer() {
19
+ if (!mcpServerInstance) {
20
+ mcpServerInstance = new McpServer({
21
+ name: 'cctool',
22
+ version: '1.0.0'
23
+ });
24
+
25
+ // 注册所有工具
26
+ registerAllTools(mcpServerInstance);
27
+ }
28
+ return mcpServerInstance;
29
+ }
30
+
31
+ const app = createMcpExpressApp();
32
+
33
+ // 按 session ID 存储 transports
34
+ const transports = {};
35
+
36
+ // SSE 端点:用于建立 SSE 流
37
+ app.get('/mcp', async (req, res) => {
38
+ console.log('Received GET request to /mcp (establishing SSE stream)');
39
+
40
+ try {
41
+ // 为客户端创建新的 SSE transport
42
+ // POST 消息的端点是 '/messages'
43
+ const transport = new SSEServerTransport('/messages', res);
44
+
45
+ // 按 session ID 存储 transport
46
+ const sessionId = transport.sessionId;
47
+ transports[sessionId] = transport;
48
+
49
+ // 设置 onclose 处理器,在关闭时清理 transport
50
+ transport.onclose = () => {
51
+ console.log(`SSE transport closed for session ${sessionId}`);
52
+ delete transports[sessionId];
53
+ };
54
+
55
+ // 将 transport 连接到 MCP 服务器
56
+ const server = getServer();
57
+ await server.connect(transport);
58
+
59
+ console.log(`Established SSE stream with session ID: ${sessionId}`);
60
+ } catch (error) {
61
+ console.error('Error establishing SSE stream:', error);
62
+ if (!res.headersSent) {
63
+ res.status(500).send('Error establishing SSE stream');
64
+ }
65
+ }
66
+ });
67
+
68
+ // 消息端点:用于接收客户端 JSON-RPC 请求
69
+ app.post('/messages', async (req, res) => {
70
+ console.log('Received POST request to /messages');
71
+
72
+ // 从 URL query 参数中提取 session ID
73
+ // 在 SSE 协议中,这是客户端根据端点事件添加的
74
+ const sessionId = req.query.sessionId;
75
+
76
+ if (!sessionId) {
77
+ console.error('No session ID provided in request URL');
78
+ res.status(400).send('Missing sessionId parameter');
79
+ return;
80
+ }
81
+
82
+ const transport = transports[sessionId];
83
+ if (!transport) {
84
+ console.error(`No active transport found for session ID: ${sessionId}`);
85
+ res.status(404).send('Session not found');
86
+ return;
87
+ }
88
+
89
+ try {
90
+ // 使用 transport 处理 POST 消息
91
+ await transport.handlePostMessage(req, res, req.body);
92
+ } catch (error) {
93
+ console.error('Error handling request:', error);
94
+ if (!res.headersSent) {
95
+ res.status(500).send('Error handling request');
96
+ }
97
+ }
98
+ });
99
+
100
+ // 启动服务器
101
+ app.listen(MCP_PORT, error => {
102
+ if (error) {
103
+ console.error('Failed to start server:', error);
104
+ process.exit(1);
105
+ }
106
+ console.log(`Simple SSE Server (deprecated protocol version 2024-11-05) listening on port ${MCP_PORT}`);
107
+ });
108
+
109
+ // Handle server shutdown
110
+ process.on('SIGINT', async () => {
111
+ console.log('Shutting down server...');
112
+
113
+ // Close all active transports to properly clean up resources
114
+ for (const sessionId in transports) {
115
+ try {
116
+ console.log(`Closing transport for session ${sessionId}`);
117
+ await transports[sessionId].close();
118
+ delete transports[sessionId];
119
+ } catch (error) {
120
+ console.error(`Error closing transport for session ${sessionId}:`, error);
121
+ }
122
+ }
123
+ console.log('Server shutdown complete');
124
+ process.exit(0);
125
+ });
126
+