@lovrabet/lovrabet-cli 2.1.17 → 2.1.18-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/lib/cli.d.ts +21 -0
  2. package/lib/cli.js +1 -1
  3. package/lib/commands/api-doc/index.d.ts +38 -0
  4. package/lib/commands/api-doc/index.js +1 -1
  5. package/lib/commands/app/cache.d.ts +61 -0
  6. package/lib/commands/app/cache.js +1 -1
  7. package/lib/commands/app/definitions.d.ts +26 -0
  8. package/lib/commands/app/definitions.js +1 -1
  9. package/lib/commands/app/eligibility.d.ts +16 -0
  10. package/lib/commands/app/eligibility.js +1 -1
  11. package/lib/commands/app/mock-loader.d.ts +41 -0
  12. package/lib/commands/app/mock-loader.js +1 -1
  13. package/lib/commands/app/remote-source.d.ts +66 -0
  14. package/lib/commands/app/remote-source.js +1 -1
  15. package/lib/commands/app/shared.d.ts +38 -0
  16. package/lib/commands/app/shared.js +1 -1
  17. package/lib/commands/app-config/get.d.ts +2 -0
  18. package/lib/commands/app-config/get.js +1 -1
  19. package/lib/commands/app-config/index.d.ts +2 -0
  20. package/lib/commands/app-config/index.js +1 -1
  21. package/lib/commands/artifact/index.d.ts +9 -0
  22. package/lib/commands/artifact/index.js +1 -1
  23. package/lib/commands/auth/device.d.ts +31 -0
  24. package/lib/commands/auth/device.js +1 -1
  25. package/lib/commands/auth/index.d.ts +23 -0
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/auth/prompt.d.ts +33 -0
  28. package/lib/commands/auth/prompt.js +1 -1
  29. package/lib/commands/bff/detail.d.ts +8 -0
  30. package/lib/commands/bff/detail.js +1 -1
  31. package/lib/commands/bff/exec.d.ts +19 -0
  32. package/lib/commands/bff/exec.js +1 -1
  33. package/lib/commands/bff/index.d.ts +15 -0
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/cli-skill/index.d.ts +9 -0
  36. package/lib/commands/cli-skill/index.js +1 -1
  37. package/lib/commands/common/config-policy.d.ts +80 -0
  38. package/lib/commands/common/config-policy.js +1 -1
  39. package/lib/commands/common/constraints.d.ts +67 -0
  40. package/lib/commands/common/constraints.js +1 -1
  41. package/lib/commands/common/flags.d.ts +41 -0
  42. package/lib/commands/common/flags.js +1 -1
  43. package/lib/commands/common/local-file.d.ts +6 -0
  44. package/lib/commands/common/local-file.js +1 -1
  45. package/lib/commands/config/definitions.d.ts +21 -0
  46. package/lib/commands/config/definitions.js +1 -1
  47. package/lib/commands/config/shared.d.ts +17 -0
  48. package/lib/commands/config/shared.js +1 -1
  49. package/lib/commands/data/index.d.ts +27 -0
  50. package/lib/commands/data/index.js +1 -1
  51. package/lib/commands/dataset/detail.d.ts +26 -0
  52. package/lib/commands/dataset/detail.js +1 -1
  53. package/lib/commands/dataset/index.d.ts +10 -0
  54. package/lib/commands/dataset/index.js +1 -1
  55. package/lib/commands/dataset/list.d.ts +18 -0
  56. package/lib/commands/dataset/list.js +1 -1
  57. package/lib/commands/dataset/sdk-doc.d.ts +6 -0
  58. package/lib/commands/dataset/sdk-doc.js +1 -1
  59. package/lib/commands/doctor.d.ts +23 -0
  60. package/lib/commands/doctor.js +1 -1
  61. package/lib/commands/file/index.d.ts +2 -0
  62. package/lib/commands/file/index.js +1 -1
  63. package/lib/commands/init.d.ts +32 -0
  64. package/lib/commands/init.js +1 -1
  65. package/lib/commands/kb/index.d.ts +8 -0
  66. package/lib/commands/kb/index.js +1 -1
  67. package/lib/commands/logs/index.d.ts +20 -0
  68. package/lib/commands/logs/index.js +1 -1
  69. package/lib/commands/ocr/index.d.ts +2 -0
  70. package/lib/commands/ocr/index.js +1 -1
  71. package/lib/commands/personal-bff/index.d.ts +5 -0
  72. package/lib/commands/personal-bff/index.js +1 -1
  73. package/lib/commands/registry.d.ts +56 -0
  74. package/lib/commands/registry.js +1 -1
  75. package/lib/commands/schedule/index.d.ts +2 -0
  76. package/lib/commands/schedule/index.js +1 -0
  77. package/lib/commands/schema.d.ts +18 -0
  78. package/lib/commands/schema.js +1 -1
  79. package/lib/commands/service/dynamic.d.ts +18 -0
  80. package/lib/commands/service/dynamic.js +1 -1
  81. package/lib/commands/service/function-name-adapter.d.ts +13 -0
  82. package/lib/commands/service/function-name-adapter.js +1 -1
  83. package/lib/commands/service/index.d.ts +2 -0
  84. package/lib/commands/service/index.js +1 -1
  85. package/lib/commands/service/registry.d.ts +102 -0
  86. package/lib/commands/service/registry.js +1 -1
  87. package/lib/commands/skill/commands/create.d.ts +2 -0
  88. package/lib/commands/skill/commands/create.js +1 -1
  89. package/lib/commands/skill/commands/install.d.ts +2 -0
  90. package/lib/commands/skill/commands/install.js +1 -1
  91. package/lib/commands/skill/commands/list.d.ts +2 -0
  92. package/lib/commands/skill/commands/list.js +1 -1
  93. package/lib/commands/skill/commands/push.d.ts +2 -0
  94. package/lib/commands/skill/commands/push.js +1 -1
  95. package/lib/commands/skill/commands/validate.d.ts +2 -0
  96. package/lib/commands/skill/commands/validate.js +1 -1
  97. package/lib/commands/skill/flags.d.ts +13 -0
  98. package/lib/commands/skill/flags.js +1 -1
  99. package/lib/commands/skill/index.d.ts +9 -0
  100. package/lib/commands/skill/index.js +1 -1
  101. package/lib/commands/skill/manifest-helpers.d.ts +5 -0
  102. package/lib/commands/skill/manifest-helpers.js +1 -1
  103. package/lib/commands/skill/push-execute.d.ts +49 -0
  104. package/lib/commands/skill/push-execute.js +1 -1
  105. package/lib/commands/skill/push-flow-helpers.d.ts +80 -0
  106. package/lib/commands/skill/push-flow-helpers.js +1 -1
  107. package/lib/commands/skill/push-retarget.d.ts +9 -0
  108. package/lib/commands/skill/push-retarget.js +1 -1
  109. package/lib/commands/skill/scopes.d.ts +13 -0
  110. package/lib/commands/skill/scopes.js +1 -1
  111. package/lib/commands/skill/summary.d.ts +6 -0
  112. package/lib/commands/skill/summary.js +1 -1
  113. package/lib/commands/skill/templates.d.ts +23 -0
  114. package/lib/commands/skill/templates.js +1 -1
  115. package/lib/commands/skill/validate.d.ts +20 -0
  116. package/lib/commands/skill/validate.js +1 -1
  117. package/lib/commands/sql/detail.d.ts +13 -0
  118. package/lib/commands/sql/detail.js +1 -1
  119. package/lib/commands/sql/exec.d.ts +21 -0
  120. package/lib/commands/sql/exec.js +1 -1
  121. package/lib/commands/sql/index.d.ts +9 -0
  122. package/lib/commands/sql/index.js +1 -1
  123. package/lib/commands/update.d.ts +10 -0
  124. package/lib/commands/update.js +1 -1
  125. package/lib/commands/workspace/index.d.ts +10 -0
  126. package/lib/commands/workspace/index.js +1 -1
  127. package/lib/config/schema.d.ts +108 -0
  128. package/lib/config/schema.js +1 -1
  129. package/lib/constant/app.d.ts +13 -0
  130. package/lib/constant/app.js +1 -1
  131. package/lib/constant/auth-mode.d.ts +28 -0
  132. package/lib/constant/auth-mode.js +1 -1
  133. package/lib/constant/cli.d.ts +86 -0
  134. package/lib/constant/cli.js +1 -1
  135. package/lib/constant/defaults.d.ts +45 -0
  136. package/lib/constant/defaults.js +1 -1
  137. package/lib/constant/distribution.d.ts +12 -0
  138. package/lib/constant/distribution.js +1 -1
  139. package/lib/constant/domain.d.ts +57 -0
  140. package/lib/constant/domain.js +1 -1
  141. package/lib/constant/env.d.ts +56 -0
  142. package/lib/constant/env.js +1 -1
  143. package/lib/constant/output.d.ts +13 -0
  144. package/lib/constant/output.js +1 -1
  145. package/lib/constant/product.d.ts +79 -0
  146. package/lib/constant/product.js +1 -1
  147. package/lib/constant/risk.d.ts +14 -0
  148. package/lib/constant/risk.js +1 -1
  149. package/lib/constant/url.d.ts +14 -0
  150. package/lib/constant/url.js +1 -1
  151. package/lib/context.d.ts +287 -0
  152. package/lib/context.js +1 -1
  153. package/lib/core/api-client.d.ts +451 -0
  154. package/lib/core/api-client.js +1 -1
  155. package/lib/core/db-resolver.d.ts +39 -0
  156. package/lib/core/db-resolver.js +1 -1
  157. package/lib/core/sdk-client.d.ts +62 -0
  158. package/lib/core/sdk-client.js +1 -1
  159. package/lib/errors.d.ts +25 -0
  160. package/lib/errors.js +1 -1
  161. package/lib/framework/build-all-flags.d.ts +24 -0
  162. package/lib/framework/build-all-flags.js +1 -1
  163. package/lib/framework/dryrun.d.ts +64 -0
  164. package/lib/framework/dryrun.js +1 -1
  165. package/lib/framework/flags.d.ts +19 -0
  166. package/lib/framework/flags.js +1 -1
  167. package/lib/framework/help.d.ts +21 -0
  168. package/lib/framework/help.js +1 -1
  169. package/lib/framework/index.d.ts +10 -0
  170. package/lib/framework/index.js +1 -1
  171. package/lib/framework/output.d.ts +10 -0
  172. package/lib/framework/output.js +1 -1
  173. package/lib/framework/preparse.d.ts +64 -0
  174. package/lib/framework/preparse.js +1 -1
  175. package/lib/framework/rate-limit.d.ts +10 -0
  176. package/lib/framework/rate-limit.js +1 -1
  177. package/lib/framework/response.d.ts +10 -0
  178. package/lib/framework/response.js +1 -1
  179. package/lib/framework/runner-confirmation.d.ts +46 -0
  180. package/lib/framework/runner-confirmation.js +1 -1
  181. package/lib/framework/runner-error.d.ts +28 -0
  182. package/lib/framework/runner-error.js +1 -1
  183. package/lib/framework/runner.d.ts +102 -0
  184. package/lib/framework/runner.js +1 -1
  185. package/lib/framework/schema-export.d.ts +29 -0
  186. package/lib/framework/schema-export.js +1 -1
  187. package/lib/framework/service-order.d.ts +4 -0
  188. package/lib/framework/service-order.js +1 -1
  189. package/lib/framework/types.d.ts +108 -0
  190. package/lib/framework/types.js +1 -1
  191. package/lib/generated/build-info.d.ts +4 -0
  192. package/lib/generated/build-info.js +1 -1
  193. package/lib/help.d.ts +25 -0
  194. package/lib/help.js +1 -1
  195. package/lib/runtime/event.d.ts +16 -0
  196. package/lib/runtime/event.js +1 -0
  197. package/lib/runtime/index.d.ts +13 -0
  198. package/lib/runtime/index.js +1 -0
  199. package/lib/runtime/queue.d.ts +6 -0
  200. package/lib/runtime/queue.js +1 -0
  201. package/lib/runtime/resolve.d.ts +14 -0
  202. package/lib/runtime/resolve.js +1 -0
  203. package/lib/runtime/types.d.ts +59 -0
  204. package/lib/runtime/types.js +1 -0
  205. package/lib/skills/npx-skills-add.d.ts +42 -0
  206. package/lib/skills/npx-skills-add.js +1 -1
  207. package/lib/skills/runtime-skill-sync/constants.d.ts +4 -0
  208. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  209. package/lib/skills/runtime-skill-sync/fs-utils.d.ts +21 -0
  210. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  211. package/lib/skills/runtime-skill-sync/hashing.d.ts +9 -0
  212. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  213. package/lib/skills/runtime-skill-sync/links.d.ts +18 -0
  214. package/lib/skills/runtime-skill-sync/links.js +1 -1
  215. package/lib/skills/runtime-skill-sync/list-local.d.ts +3 -0
  216. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  217. package/lib/skills/runtime-skill-sync/local-files.d.ts +25 -0
  218. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  219. package/lib/skills/runtime-skill-sync/materialize.d.ts +11 -0
  220. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  221. package/lib/skills/runtime-skill-sync/metadata.d.ts +7 -0
  222. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  223. package/lib/skills/runtime-skill-sync/paths.d.ts +11 -0
  224. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  225. package/lib/skills/runtime-skill-sync/push.d.ts +33 -0
  226. package/lib/skills/runtime-skill-sync/push.js +1 -1
  227. package/lib/skills/runtime-skill-sync/scopes.d.ts +5 -0
  228. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  229. package/lib/skills/runtime-skill-sync/types.d.ts +105 -0
  230. package/lib/skills/runtime-skill-sync/zip-codec.d.ts +9 -0
  231. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  232. package/lib/skills/runtime-skill-sync/zip-package.d.ts +15 -0
  233. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  234. package/lib/skills/runtime-skill-sync.d.ts +15 -0
  235. package/lib/skills/runtime-skill-sync.js +1 -1
  236. package/lib/utils/apply-jq-filter.d.ts +25 -0
  237. package/lib/utils/apply-jq-filter.js +1 -1
  238. package/lib/utils/logger.d.ts +73 -0
  239. package/lib/utils/logger.js +1 -1
  240. package/lib/utils/lossless-json.d.ts +21 -0
  241. package/lib/utils/lossless-json.js +1 -1
  242. package/lib/utils/params.d.ts +65 -0
  243. package/lib/utils/params.js +1 -1
  244. package/lib/utils/platform.d.ts +17 -0
  245. package/lib/utils/platform.js +1 -1
  246. package/lib/utils/update-notice.d.ts +10 -0
  247. package/lib/utils/update-notice.js +1 -1
  248. package/lib/utils/version.d.ts +18 -0
  249. package/lib/utils/version.js +1 -1
  250. package/lib/utils/write-cli-side-channel.d.ts +6 -0
  251. package/lib/utils/write-cli-side-channel.js +1 -1
  252. package/package.json +9 -1
@@ -1 +1 @@
1
- const a34_0x894200=a34_0x3d8b;(function(_0x526eda,_0x325a48){const _0x4e33b3=a34_0x3d8b,_0x68a578=_0x526eda();while(!![]){try{const _0x377f8f=parseInt(_0x4e33b3(0x19d))/0x1*(-parseInt(_0x4e33b3(0x1b4))/0x2)+-parseInt(_0x4e33b3(0x186))/0x3+parseInt(_0x4e33b3(0x189))/0x4*(-parseInt(_0x4e33b3(0x18c))/0x5)+parseInt(_0x4e33b3(0x1b3))/0x6*(-parseInt(_0x4e33b3(0x196))/0x7)+parseInt(_0x4e33b3(0x18e))/0x8*(-parseInt(_0x4e33b3(0x1ac))/0x9)+-parseInt(_0x4e33b3(0x183))/0xa+parseInt(_0x4e33b3(0x1a7))/0xb;if(_0x377f8f===_0x325a48)break;else _0x68a578['push'](_0x68a578['shift']());}catch(_0x3ad788){_0x68a578['push'](_0x68a578['shift']());}}}(a34_0x339c,0x56dc5));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';function a34_0x3d8b(_0x258726,_0x1a0f14){_0x258726=_0x258726-0x183;const _0x339c77=a34_0x339c();let _0x3d8b36=_0x339c77[_0x258726];return _0x3d8b36;}import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x894200(0x1aa),a34_0x894200(0x1b1),'form',a34_0x894200(0x1b7)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x894200(0x1b6),'general':a34_0x894200(0x19f),'form':a34_0x894200(0x188),'idCard':'IdCard'},SCENE_FLAG={'name':a34_0x894200(0x194),'type':a34_0x894200(0x1ae),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x894200(0x1a5)},IMAGE_FILE_FLAG={'name':a34_0x894200(0x193),'type':a34_0x894200(0x1ae),'description':a34_0x894200(0x190)},IMAGE_URL_FLAG={'name':a34_0x894200(0x18b),'type':a34_0x894200(0x1ae),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x5d5a7d){const _0x39e199=a34_0x894200,_0x2bbc32=_0x5d5a7d['trim']()[_0x39e199(0x19a)]();if(_0x2bbc32==='idcard')return _0x39e199(0x1b7);if(_0x2bbc32===_0x39e199(0x1aa)||_0x2bbc32===_0x39e199(0x1b1)||_0x2bbc32===_0x39e199(0x1b5))return _0x2bbc32;throw CliErrors['validation'](_0x39e199(0x191)+_0x5d5a7d+_0x39e199(0x18a)+SUPPORTED_SCENES[_0x39e199(0x1a2)](',\x20'));}function selectedInputs(_0x408f02){const _0x64b563=a34_0x894200,_0x40c4cc=_0x408f02[_0x64b563(0x1ab)](_0x64b563(0x193))[_0x64b563(0x192)](),_0x2c00d4=_0x408f02[_0x64b563(0x1ab)](_0x64b563(0x18b))[_0x64b563(0x192)]();return{'imageFile':_0x40c4cc,'imageUrl':_0x2c00d4,'count':[_0x40c4cc,_0x2c00d4]['filter'](Boolean)['length']};}function validateInputSelection(_0x18846b){const _0xe2f3f=a34_0x894200,_0x2ee28c=selectedInputs(_0x18846b);if(_0x2ee28c[_0xe2f3f(0x19b)]!==0x1)throw CliErrors['validation'](_0xe2f3f(0x1a6));return _0x2ee28c;}function a34_0x339c(){const _0x32148a=['Invoice','idCard','2002010lSDvbt','imageUrl','/client/queryFileUrl','1003623WXXOJi','/client/uploadFile','Table','124NDptYJ','.\x20Supported\x20scenes:\x20','image-url','16865ZInOhJ','imageFile','4737576DfpMpL','fileUrl','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','Unsupported\x20OCR\x20scene:\x20','trim','image-file','scene','File\x20URL\x20response\x20missing\x20fileUrl.','1352701lpLUBg','path','appCode','<filePath\x20returned\x20by\x20/client/uploadFile>','toLowerCase','count','body','4453GwQGzw','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','General','recognize','\x20OCR','join','POST','write','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','26100525NmTIdV','description','fileName','invoice','str','9JMghOX','apiError','string','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','build','general','filePath','6yBNZVZ','266kzEwlQ','form'];a34_0x339c=function(){return _0x32148a;};return a34_0x339c();}function withScene(_0x4908fb,_0x793963,_0x3b24c6){const _0x1900fd=a34_0x894200;return{..._0x4908fb,'scene':_0x793963,..._0x3b24c6?{'sourceFile':{'fileName':_0x3b24c6[_0x1900fd(0x1a9)],'filePath':_0x3b24c6[_0x1900fd(0x1b2)]}}:{}};}const ocrRecognize={'service':'ocr','command':a34_0x894200(0x1a0),'description':a34_0x894200(0x19e),'risk':a34_0x894200(0x1a4),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x402124){const _0x4f22b1=a34_0x894200,_0x2b9c7d=normalizeScene(_0x402124['str'](_0x4f22b1(0x194))),_0x598f54=SCENE_TO_LEGACY_TYPE[_0x2b9c7d],_0x17964b=validateInputSelection(_0x402124);if(_0x17964b[_0x4f22b1(0x184)])return dryRun(_0x4f22b1(0x1a3),'/client/ocr')['body']({'appCode':_0x402124[_0x4f22b1(0x198)],'url':_0x17964b[_0x4f22b1(0x184)],'type':_0x598f54})[_0x4f22b1(0x1a8)]('Preview:\x20recognize\x20'+_0x2b9c7d+'\x20OCR\x20from\x20URL')[_0x4f22b1(0x1b0)]();const _0x30d675=requireRuntimeUploadFile(_0x17964b[_0x4f22b1(0x18d)],'image-file');return dryRun(_0x4f22b1(0x1a3),_0x4f22b1(0x187))[_0x4f22b1(0x19c)]({'steps':[{'method':'POST','url':_0x4f22b1(0x187),'body':{'appCode':_0x402124[_0x4f22b1(0x198)],'multipart':{'file':_0x30d675}}},{'method':'POST','url':_0x4f22b1(0x185),'body':{'filePath':_0x4f22b1(0x199),'downloadFlag':![]}},{'method':_0x4f22b1(0x1a3),'url':'/client/ocr','body':{'appCode':_0x402124[_0x4f22b1(0x198)],'url':'<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','type':_0x598f54}}]})[_0x4f22b1(0x1a8)](_0x4f22b1(0x1af)+_0x2b9c7d+_0x4f22b1(0x1a1))[_0x4f22b1(0x1b0)]();},async 'execute'(_0x173f3c){const _0x4ef558=a34_0x894200,_0x434361=normalizeScene(_0x173f3c[_0x4ef558(0x1ab)]('scene')),_0x5eae69=SCENE_TO_LEGACY_TYPE[_0x434361],_0x4505a6=validateInputSelection(_0x173f3c);if(_0x4505a6[_0x4ef558(0x184)]){const _0x504226=await recognizeRuntimeOcr(_0x173f3c[_0x4ef558(0x198)],{'url':_0x4505a6[_0x4ef558(0x184)],'type':_0x5eae69});return{'ok':!![],'data':withScene(_0x504226,_0x434361)};}const _0x2ebde8=requireRuntimeUploadFile(_0x4505a6[_0x4ef558(0x18d)],_0x4ef558(0x193)),_0x384ca3=await uploadRuntimeFile(_0x173f3c['appCode'],_0x2ebde8[_0x4ef558(0x197)]);if(!_0x384ca3[_0x4ef558(0x1b2)])throw CliErrors['apiError']('File\x20upload\x20response\x20missing\x20filePath.');const _0x56003a=await queryRuntimeFileUrl(_0x384ca3[_0x4ef558(0x1b2)],{'download':![]});if(!_0x56003a[_0x4ef558(0x18f)])throw CliErrors[_0x4ef558(0x1ad)](_0x4ef558(0x195));const _0x53f5db=await recognizeRuntimeOcr(_0x173f3c['appCode'],{'url':_0x56003a[_0x4ef558(0x18f)],'type':_0x5eae69});return{'ok':!![],'data':withScene(_0x53f5db,_0x434361,_0x384ca3)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a34_0x3d7779=a34_0xac72;(function(_0x180d72,_0x5d74d9){const _0x5b20a2=a34_0xac72,_0x5c9cc9=_0x180d72();while(!![]){try{const _0x3a85c1=parseInt(_0x5b20a2(0xb9))/0x1+parseInt(_0x5b20a2(0xb0))/0x2+-parseInt(_0x5b20a2(0xc6))/0x3*(-parseInt(_0x5b20a2(0xc8))/0x4)+parseInt(_0x5b20a2(0xb3))/0x5*(parseInt(_0x5b20a2(0xbf))/0x6)+-parseInt(_0x5b20a2(0xd1))/0x7+parseInt(_0x5b20a2(0xc2))/0x8*(parseInt(_0x5b20a2(0xa0))/0x9)+-parseInt(_0x5b20a2(0xcf))/0xa;if(_0x3a85c1===_0x5d74d9)break;else _0x5c9cc9['push'](_0x5c9cc9['shift']());}catch(_0x60edb){_0x5c9cc9['push'](_0x5c9cc9['shift']());}}}(a34_0x5af6,0x56768));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a34_0x5af6(){const _0x3d62ce=['image-file','\x20OCR\x20from\x20URL','general','9417200HIfxRO','string','1227716CXukuy','trim','File\x20upload\x20response\x20missing\x20filePath.','idCard','path','<filePath\x20returned\x20by\x20/client/uploadFile>','idcard','18xOdVgr','toLowerCase','/client/queryFileUrl','fileName','General','/client/uploadFile','form','Table','fileUrl','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','ocr','Preview:\x20recognize\x20','scene','imageUrl','write','730106kRDlbO','body','Publicly\x20accessible\x20image\x20or\x20file\x20URL','541505yEBSQI','File\x20URL\x20response\x20missing\x20fileUrl.','imageFile','/client/ocr','description','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','478545yqZqWa','str','apiError','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','POST','count','6EZnArf','appCode','Invoice','631136nItIoP','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','filter','\x20OCR','1084731rWHjVp','image-url','4ZdKLEV','validation','filePath','build'];a34_0x5af6=function(){return _0x3d62ce;};return a34_0x5af6();}const SUPPORTED_SCENES=['invoice',a34_0x3d7779(0xce),a34_0x3d7779(0xa6),a34_0x3d7779(0xd4)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x3d7779(0xc1),'general':a34_0x3d7779(0xa4),'form':a34_0x3d7779(0xa7),'idCard':'IdCard'},SCENE_FLAG={'name':'scene','type':a34_0x3d7779(0xd0),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x3d7779(0xc3)},IMAGE_FILE_FLAG={'name':'image-file','type':a34_0x3d7779(0xd0),'description':a34_0x3d7779(0xaa)},IMAGE_URL_FLAG={'name':a34_0x3d7779(0xc7),'type':a34_0x3d7779(0xd0),'description':a34_0x3d7779(0xb2)};function normalizeScene(_0x4fb34c){const _0xf1c762=a34_0x3d7779,_0x181fe3=_0x4fb34c[_0xf1c762(0xd2)]()[_0xf1c762(0xa1)]();if(_0x181fe3===_0xf1c762(0x9f))return _0xf1c762(0xd4);if(_0x181fe3==='invoice'||_0x181fe3===_0xf1c762(0xce)||_0x181fe3===_0xf1c762(0xa6))return _0x181fe3;throw CliErrors[_0xf1c762(0xc9)]('Unsupported\x20OCR\x20scene:\x20'+_0x4fb34c+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES['join'](',\x20'));}function a34_0xac72(_0x285006,_0x506e02){_0x285006=_0x285006-0x9e;const _0x5af690=a34_0x5af6();let _0xac72b8=_0x5af690[_0x285006];return _0xac72b8;}function selectedInputs(_0x5b3b4d){const _0x1bb9cd=a34_0x3d7779,_0x3cec50=_0x5b3b4d['str'](_0x1bb9cd(0xcc))[_0x1bb9cd(0xd2)](),_0x310f3e=_0x5b3b4d['str'](_0x1bb9cd(0xc7))[_0x1bb9cd(0xd2)]();return{'imageFile':_0x3cec50,'imageUrl':_0x310f3e,'count':[_0x3cec50,_0x310f3e][_0x1bb9cd(0xc4)](Boolean)['length']};}function validateInputSelection(_0x22b49f){const _0xeedb2b=a34_0x3d7779,_0x39f1e3=selectedInputs(_0x22b49f);if(_0x39f1e3[_0xeedb2b(0xbe)]!==0x1)throw CliErrors[_0xeedb2b(0xc9)](_0xeedb2b(0xa9));return _0x39f1e3;}function withScene(_0x4b336a,_0x3ab9ae,_0x2787d3){const _0x5cd639=a34_0x3d7779;return{..._0x4b336a,'scene':_0x3ab9ae,..._0x2787d3?{'sourceFile':{'fileName':_0x2787d3[_0x5cd639(0xa3)],'filePath':_0x2787d3[_0x5cd639(0xca)]}}:{}};}const ocrRecognize={'service':a34_0x3d7779(0xab),'command':'recognize','description':a34_0x3d7779(0xbc),'risk':a34_0x3d7779(0xaf),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x3b8b19){const _0x471f2c=a34_0x3d7779,_0x4fa4bf=normalizeScene(_0x3b8b19[_0x471f2c(0xba)]('scene')),_0x278c66=SCENE_TO_LEGACY_TYPE[_0x4fa4bf],_0x516e65=validateInputSelection(_0x3b8b19);if(_0x516e65[_0x471f2c(0xae)])return dryRun(_0x471f2c(0xbd),_0x471f2c(0xb6))[_0x471f2c(0xb1)]({'appCode':_0x3b8b19[_0x471f2c(0xc0)],'url':_0x516e65['imageUrl'],'type':_0x278c66})[_0x471f2c(0xb7)](_0x471f2c(0xac)+_0x4fa4bf+_0x471f2c(0xcd))[_0x471f2c(0xcb)]();const _0x2d29e6=requireRuntimeUploadFile(_0x516e65[_0x471f2c(0xb5)],_0x471f2c(0xcc));return dryRun(_0x471f2c(0xbd),'/client/uploadFile')[_0x471f2c(0xb1)]({'steps':[{'method':_0x471f2c(0xbd),'url':_0x471f2c(0xa5),'body':{'appCode':_0x3b8b19['appCode'],'multipart':{'file':_0x2d29e6}}},{'method':_0x471f2c(0xbd),'url':_0x471f2c(0xa2),'body':{'filePath':_0x471f2c(0x9e),'downloadFlag':![]}},{'method':_0x471f2c(0xbd),'url':'/client/ocr','body':{'appCode':_0x3b8b19[_0x471f2c(0xc0)],'url':'<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','type':_0x278c66}}]})['description'](_0x471f2c(0xb8)+_0x4fa4bf+_0x471f2c(0xc5))['build']();},async 'execute'(_0x35c577){const _0x29f260=a34_0x3d7779,_0x5b3598=normalizeScene(_0x35c577[_0x29f260(0xba)](_0x29f260(0xad))),_0x47cbeb=SCENE_TO_LEGACY_TYPE[_0x5b3598],_0x51e18c=validateInputSelection(_0x35c577);if(_0x51e18c[_0x29f260(0xae)]){const _0x597b72=await recognizeRuntimeOcr(_0x35c577[_0x29f260(0xc0)],{'url':_0x51e18c[_0x29f260(0xae)],'type':_0x47cbeb});return{'ok':!![],'data':withScene(_0x597b72,_0x5b3598)};}const _0x5a47d2=requireRuntimeUploadFile(_0x51e18c[_0x29f260(0xb5)],_0x29f260(0xcc)),_0x147d45=await uploadRuntimeFile(_0x35c577['appCode'],_0x5a47d2[_0x29f260(0xd5)]);if(!_0x147d45[_0x29f260(0xca)])throw CliErrors[_0x29f260(0xbb)](_0x29f260(0xd3));const _0x5c1558=await queryRuntimeFileUrl(_0x147d45[_0x29f260(0xca)],{'download':![]});if(!_0x5c1558[_0x29f260(0xa8)])throw CliErrors[_0x29f260(0xbb)](_0x29f260(0xb4));const _0x245880=await recognizeRuntimeOcr(_0x35c577['appCode'],{'url':_0x5c1558[_0x29f260(0xa8)],'type':_0x47cbeb});return{'ok':!![],'data':withScene(_0x245880,_0x5b3598,_0x147d45)};}};export const ocrDefinitions=[ocrRecognize];
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @fileoverview `personal-bff` command group — user-owned endpoint scripts.
3
+ */
4
+ import type { CommandDefinition } from "../../framework/types.js";
5
+ export declare const personalBffDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- const a35_0x4c5318=a35_0x41f0;(function(_0x436c9c,_0x3a818b){const _0x585338=a35_0x41f0,_0x1709ec=_0x436c9c();while(!![]){try{const _0x537764=-parseInt(_0x585338(0x12e))/0x1+parseInt(_0x585338(0x122))/0x2+parseInt(_0x585338(0x12f))/0x3+-parseInt(_0x585338(0x15a))/0x4*(-parseInt(_0x585338(0x138))/0x5)+-parseInt(_0x585338(0x14c))/0x6+-parseInt(_0x585338(0x159))/0x7*(-parseInt(_0x585338(0x126))/0x8)+parseInt(_0x585338(0x128))/0x9;if(_0x537764===_0x3a818b)break;else _0x1709ec['push'](_0x1709ec['shift']());}catch(_0x77053f){_0x1709ec['push'](_0x1709ec['shift']());}}}(a35_0x5e4d,0x3b4d4));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':'string','description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0x4c5318(0x14e),'type':a35_0x4c5318(0x130),'required':!![],'description':a35_0x4c5318(0x129)},DESCRIPTION_FLAG={'name':a35_0x4c5318(0x12b),'type':'string','description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x4c5318(0x13e),'type':a35_0x4c5318(0x130),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x181b3b){const _0x278410=a35_0x4c5318,_0x545c2e=String(_0x181b3b||'')['trim']();if(!_0x545c2e||!FUNCTION_NAME_PATTERN['test'](_0x545c2e))throw CliErrors[_0x278410(0x124)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x545c2e;}function a35_0x5e4d(){const _0x3f8259=['JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','body','247328ujfXux','562662KzryuR','string','/client/runtime-bff/personal/create','file','update','gmtCreate','Created\x20personal\x20BFF\x20','Show\x20one\x20personal\x20BFF\x20by\x20id','Personal\x20BFF\x20script\x20ID','44330oqtrzd','high-risk-write','flag','trim','sourceSessionId','updateTime','source-session-id','config','Personal\x20BFF\x20script\x20file\x20is\x20blank.','isFile','Update\x20a\x20personal\x20BFF\x20by\x20id','params','num','Preview:\x20create\x20personal\x20BFF\x20','/update','scriptContent','File\x20is\x20not\x20a\x20regular\x20file:\x20','str','list','scriptType','1974030KPwDVU','utf8','name','appCode','version','isArray','bool','gmtModified','personal-bff','createTime','build','functionName','--params\x20must\x20be\x20a\x20JSON\x20object.','434vVOeHa','160MxIxKT','verbose','exec','length','read','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','/client/runtime-bff/personal/','File\x20path\x20is\x20required.','write','201054QMMkKW','createUserId','validation','Executed\x20personal\x20BFF\x20','21160zWSaPJ','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','112698yEEevk','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','keys','description'];a35_0x5e4d=function(){return _0x3f8259;};return a35_0x5e4d();}function readScriptFile(_0x35feca){const _0x3ce3c8=a35_0x4c5318;if(!_0x35feca)throw CliErrors[_0x3ce3c8(0x124)](_0x3ce3c8(0x161));if(!existsSync(_0x35feca))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x35feca);if(!statSync(_0x35feca)[_0x3ce3c8(0x141)]())throw CliErrors['validation'](_0x3ce3c8(0x148)+_0x35feca);const _0x254c55=readFileSync(_0x35feca,_0x3ce3c8(0x14d));if(!_0x254c55[_0x3ce3c8(0x13b)]())throw CliErrors[_0x3ce3c8(0x124)](_0x3ce3c8(0x140));return _0x254c55;}function optionalTrimmed(_0x41c2fb){const _0x347f2c=a35_0x4c5318,_0x8c76d0=String(_0x41c2fb||'')[_0x347f2c(0x13b)]();return _0x8c76d0||undefined;}function summarizeBff(_0x22b9c2){const _0x3aef0b=a35_0x4c5318;return{'id':_0x22b9c2['id'],'appCode':_0x22b9c2[_0x3aef0b(0x14f)],'functionName':_0x22b9c2['functionName'],'description':_0x22b9c2[_0x3aef0b(0x12b)],'scriptType':_0x22b9c2[_0x3aef0b(0x14b)],'version':_0x22b9c2[_0x3aef0b(0x150)],'gmtModified':_0x22b9c2[_0x3aef0b(0x153)],'updateTime':_0x22b9c2['updateTime']};}function a35_0x41f0(_0x92b905,_0x5bd6ec){_0x92b905=_0x92b905-0x122;const _0x5e4dd6=a35_0x5e4d();let _0x41f090=_0x5e4dd6[_0x92b905];return _0x41f090;}function detailBff(_0x3c42fa){const _0x180d54=a35_0x4c5318;return{'id':_0x3c42fa['id'],'appCode':_0x3c42fa[_0x180d54(0x14f)],'functionName':_0x3c42fa['functionName'],'description':_0x3c42fa[_0x180d54(0x12b)],'scriptType':_0x3c42fa[_0x180d54(0x14b)],'scriptContent':_0x3c42fa[_0x180d54(0x147)]??'','config':_0x3c42fa[_0x180d54(0x13f)],'version':_0x3c42fa[_0x180d54(0x150)],'createUserId':_0x3c42fa[_0x180d54(0x123)],'gmtCreate':_0x3c42fa[_0x180d54(0x134)],'gmtModified':_0x3c42fa['gmtModified'],'createTime':_0x3c42fa[_0x180d54(0x155)],'updateTime':_0x3c42fa[_0x180d54(0x13d)]};}function buildCreateInput(_0x4fd685){const _0x2e9179=a35_0x4c5318;return{'functionName':normalizeFunctionName(_0x4fd685[_0x2e9179(0x149)](_0x2e9179(0x14e))),...optionalTrimmed(_0x4fd685['str'](_0x2e9179(0x12b)))?{'description':optionalTrimmed(_0x4fd685[_0x2e9179(0x149)]('description'))}:{},'scriptContent':readScriptFile(_0x4fd685[_0x2e9179(0x149)](_0x2e9179(0x132))),...optionalTrimmed(_0x4fd685[_0x2e9179(0x149)](_0x2e9179(0x13e)))?{'sourceSessionId':optionalTrimmed(_0x4fd685[_0x2e9179(0x149)]('source-session-id'))}:{}};}function buildUpdateInput(_0x2c2cb0){const _0x50722c=a35_0x4c5318,_0x338058={};optionalTrimmed(_0x2c2cb0[_0x50722c(0x149)](_0x50722c(0x14e)))&&(_0x338058[_0x50722c(0x157)]=normalizeFunctionName(_0x2c2cb0[_0x50722c(0x149)](_0x50722c(0x14e))));_0x2c2cb0[_0x50722c(0x13a)](_0x50722c(0x12b))!==undefined&&(_0x338058[_0x50722c(0x12b)]=_0x2c2cb0[_0x50722c(0x149)]('description'));optionalTrimmed(_0x2c2cb0['str']('file'))&&(_0x338058[_0x50722c(0x147)]=readScriptFile(_0x2c2cb0[_0x50722c(0x149)](_0x50722c(0x132))));_0x2c2cb0[_0x50722c(0x13a)](_0x50722c(0x13e))!==undefined&&(_0x338058[_0x50722c(0x13c)]=_0x2c2cb0['str'](_0x50722c(0x13e)));if(Object[_0x50722c(0x12a)](_0x338058)['length']===0x0)throw CliErrors[_0x50722c(0x124)]('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x338058;}function parseExecParams(_0xd9a15b){const _0x32ff1d=a35_0x4c5318,_0x39dc85=parseJsonParams(_0xd9a15b)??{};if(Array[_0x32ff1d(0x151)](_0x39dc85))throw CliErrors[_0x32ff1d(0x124)](_0x32ff1d(0x158));return _0x39dc85;}const personalBffList={'service':a35_0x4c5318(0x154),'command':a35_0x4c5318(0x14a),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0x4c5318(0x15e),'flags':[VERBOSE_FLAG],async 'execute'(_0x29650c){const _0x222ee8=a35_0x4c5318,_0x3c20ad=await listPersonalBffs(_0x29650c['appCode']);return{'ok':!![],'data':{'total':_0x3c20ad[_0x222ee8(0x15d)],'items':_0x29650c[_0x222ee8(0x152)](_0x222ee8(0x15b))?_0x3c20ad:_0x3c20ad['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x4c5318(0x154),'command':'detail','description':a35_0x4c5318(0x136),'risk':'read','flags':[{...ID_FLAG,'description':a35_0x4c5318(0x137)}],async 'execute'(_0x18f544){const _0x305141=a35_0x4c5318,_0xb77ff4=await getPersonalBff(_0x18f544[_0x305141(0x144)]('id'),_0x18f544[_0x305141(0x14f)]);return{'ok':!![],'data':detailBff(_0xb77ff4)};}},personalBffCreate={'service':a35_0x4c5318(0x154),'command':'create','description':a35_0x4c5318(0x127),'risk':a35_0x4c5318(0x162),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xb019b5){const _0x7b2471=a35_0x4c5318,_0x50aff1=buildCreateInput(_0xb019b5),_0x2fdaa2=await createPersonalBff(_0xb019b5['appCode'],_0x50aff1);return{'ok':!![],'data':detailBff(_0x2fdaa2),'message':_0x7b2471(0x135)+_0x2fdaa2['id']+(_0x2fdaa2['functionName']?'\x20('+_0x2fdaa2['functionName']+')':'')};},async 'dryRun'(_0x5150c4){const _0x5d5b6f=a35_0x4c5318,_0x17b48f=buildCreateInput(_0x5150c4);return dryRun('POST',_0x5d5b6f(0x131))[_0x5d5b6f(0x12d)]({'appCode':_0x5150c4['appCode'],..._0x17b48f})['description'](_0x5d5b6f(0x145)+_0x17b48f['functionName'])[_0x5d5b6f(0x156)]();}},personalBffUpdate={'service':a35_0x4c5318(0x154),'command':a35_0x4c5318(0x133),'description':a35_0x4c5318(0x142),'risk':a35_0x4c5318(0x162),'flags':[{...ID_FLAG,'description':a35_0x4c5318(0x137)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x41b072){const _0x5e3d42=a35_0x4c5318,_0x2e45a2=_0x41b072[_0x5e3d42(0x144)]('id'),_0x14c2b1=buildUpdateInput(_0x41b072),_0x1803fa=await updatePersonalBff(_0x2e45a2,_0x41b072[_0x5e3d42(0x14f)],_0x14c2b1);return{'ok':!![],'data':detailBff(_0x1803fa),'message':'Updated\x20personal\x20BFF\x20'+_0x1803fa['id']+(_0x1803fa[_0x5e3d42(0x157)]?'\x20('+_0x1803fa[_0x5e3d42(0x157)]+')':'')};},async 'dryRun'(_0x530f60){const _0x31bd5b=a35_0x4c5318,_0x23f9ad=_0x530f60[_0x31bd5b(0x144)]('id'),_0x4184fe=buildUpdateInput(_0x530f60);return dryRun('POST',_0x31bd5b(0x160)+_0x23f9ad+_0x31bd5b(0x146))[_0x31bd5b(0x12d)]({'appCode':_0x530f60[_0x31bd5b(0x14f)],..._0x4184fe})['description']('Preview:\x20update\x20personal\x20BFF\x20'+_0x23f9ad)['build']();}},personalBffExec={'service':a35_0x4c5318(0x154),'command':a35_0x4c5318(0x15c),'description':a35_0x4c5318(0x15f),'risk':a35_0x4c5318(0x139),'flags':[{...ID_FLAG,'description':a35_0x4c5318(0x137)},{...PARAMS_FLAG,'description':a35_0x4c5318(0x12c)}],async 'validate'(_0x107cca){const _0x47a863=a35_0x4c5318;parseExecParams(_0x107cca[_0x47a863(0x149)]('params'));},async 'execute'(_0x2cef77){const _0x3630c7=a35_0x4c5318,_0x5f50ad=_0x2cef77[_0x3630c7(0x144)]('id'),_0x109638=parseExecParams(_0x2cef77[_0x3630c7(0x149)](_0x3630c7(0x143))),_0x2df16a=await executePersonalBff(_0x5f50ad,_0x2cef77[_0x3630c7(0x14f)],_0x109638);return{'ok':!![],'data':{'result':_0x2df16a},'message':_0x3630c7(0x125)+_0x5f50ad};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ function a35_0x4959(_0x24dcb2,_0x35beda){_0x24dcb2=_0x24dcb2-0x91;const _0x4c57ae=a35_0x4c57();let _0x495956=_0x4c57ae[_0x24dcb2];return _0x495956;}const a35_0x20f073=a35_0x4959;(function(_0x47fd75,_0x5b45e9){const _0x3308f0=a35_0x4959,_0x1ac475=_0x47fd75();while(!![]){try{const _0x5bceea=-parseInt(_0x3308f0(0xbc))/0x1+-parseInt(_0x3308f0(0xb5))/0x2*(parseInt(_0x3308f0(0xa5))/0x3)+parseInt(_0x3308f0(0xcb))/0x4+-parseInt(_0x3308f0(0x96))/0x5*(-parseInt(_0x3308f0(0x9b))/0x6)+parseInt(_0x3308f0(0xb1))/0x7+parseInt(_0x3308f0(0x92))/0x8+-parseInt(_0x3308f0(0x97))/0x9*(parseInt(_0x3308f0(0xb6))/0xa);if(_0x5bceea===_0x5b45e9)break;else _0x1ac475['push'](_0x1ac475['shift']());}catch(_0x3b5f52){_0x1ac475['push'](_0x1ac475['shift']());}}}(a35_0x4c57,0x26cc7));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':'string','description':a35_0x20f073(0xc9)},FUNCTION_NAME_FLAG={'name':a35_0x20f073(0xb3),'type':a35_0x20f073(0xce),'required':!![],'description':a35_0x20f073(0x99)},DESCRIPTION_FLAG={'name':a35_0x20f073(0xb0),'type':a35_0x20f073(0xce),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x20f073(0x9c),'type':'string','description':a35_0x20f073(0x91)};function normalizeFunctionName(_0x19767f){const _0x31a784=a35_0x20f073,_0x5614c6=String(_0x19767f||'')['trim']();if(!_0x5614c6||!FUNCTION_NAME_PATTERN[_0x31a784(0x9f)](_0x5614c6))throw CliErrors['validation'](_0x31a784(0xc5));return _0x5614c6;}function readScriptFile(_0x80b7c7){const _0x2fc8b1=a35_0x20f073;if(!_0x80b7c7)throw CliErrors[_0x2fc8b1(0xa6)](_0x2fc8b1(0x9e));if(!existsSync(_0x80b7c7))throw CliErrors[_0x2fc8b1(0xa6)](_0x2fc8b1(0xca)+_0x80b7c7);if(!statSync(_0x80b7c7)['isFile']())throw CliErrors[_0x2fc8b1(0xa6)](_0x2fc8b1(0xc7)+_0x80b7c7);const _0x116753=readFileSync(_0x80b7c7,_0x2fc8b1(0xa0));if(!_0x116753['trim']())throw CliErrors[_0x2fc8b1(0xa6)](_0x2fc8b1(0xc8));return _0x116753;}function optionalTrimmed(_0x2f2b74){const _0x10360a=String(_0x2f2b74||'')['trim']();return _0x10360a||undefined;}function summarizeBff(_0x37924e){const _0x513497=a35_0x20f073;return{'id':_0x37924e['id'],'appCode':_0x37924e['appCode'],'functionName':_0x37924e[_0x513497(0xaf)],'description':_0x37924e[_0x513497(0xb0)],'scriptType':_0x37924e['scriptType'],'version':_0x37924e['version'],'gmtModified':_0x37924e[_0x513497(0xa9)],'updateTime':_0x37924e[_0x513497(0xd3)]};}function detailBff(_0x492f43){const _0x1d91aa=a35_0x20f073;return{'id':_0x492f43['id'],'appCode':_0x492f43[_0x1d91aa(0xb4)],'functionName':_0x492f43[_0x1d91aa(0xaf)],'description':_0x492f43[_0x1d91aa(0xb0)],'scriptType':_0x492f43[_0x1d91aa(0xa1)],'scriptContent':_0x492f43[_0x1d91aa(0xad)]??'','config':_0x492f43[_0x1d91aa(0x98)],'version':_0x492f43[_0x1d91aa(0xab)],'createUserId':_0x492f43[_0x1d91aa(0xb8)],'gmtCreate':_0x492f43[_0x1d91aa(0xbf)],'gmtModified':_0x492f43[_0x1d91aa(0xa9)],'createTime':_0x492f43[_0x1d91aa(0x9a)],'updateTime':_0x492f43[_0x1d91aa(0xd3)]};}function buildCreateInput(_0x2ad4bc){const _0x36c4ef=a35_0x20f073;return{'functionName':normalizeFunctionName(_0x2ad4bc[_0x36c4ef(0xa2)](_0x36c4ef(0xb3))),...optionalTrimmed(_0x2ad4bc[_0x36c4ef(0xa2)]('description'))?{'description':optionalTrimmed(_0x2ad4bc[_0x36c4ef(0xa2)](_0x36c4ef(0xb0)))}:{},'scriptContent':readScriptFile(_0x2ad4bc['str'](_0x36c4ef(0xb9))),...optionalTrimmed(_0x2ad4bc[_0x36c4ef(0xa2)]('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x2ad4bc[_0x36c4ef(0xa2)](_0x36c4ef(0x9c)))}:{}};}function buildUpdateInput(_0x3a3fca){const _0x2df8e2=a35_0x20f073,_0x28566f={};optionalTrimmed(_0x3a3fca['str']('name'))&&(_0x28566f['functionName']=normalizeFunctionName(_0x3a3fca[_0x2df8e2(0xa2)](_0x2df8e2(0xb3))));_0x3a3fca['flag']('description')!==undefined&&(_0x28566f['description']=_0x3a3fca[_0x2df8e2(0xa2)]('description'));optionalTrimmed(_0x3a3fca['str'](_0x2df8e2(0xb9)))&&(_0x28566f[_0x2df8e2(0xad)]=readScriptFile(_0x3a3fca[_0x2df8e2(0xa2)](_0x2df8e2(0xb9))));_0x3a3fca[_0x2df8e2(0x95)](_0x2df8e2(0x9c))!==undefined&&(_0x28566f['sourceSessionId']=_0x3a3fca[_0x2df8e2(0xa2)](_0x2df8e2(0x9c)));if(Object[_0x2df8e2(0xac)](_0x28566f)['length']===0x0)throw CliErrors[_0x2df8e2(0xa6)](_0x2df8e2(0xbd));return _0x28566f;}function a35_0x4c57(){const _0x311d10=['133929LgTBQz','config','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','createTime','10362dycFXY','source-session-id','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','File\x20path\x20is\x20required.','test','utf8','scriptType','str','read','params','655833xCSiAM','validation','/update','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','gmtModified','body','version','keys','scriptContent','POST','functionName','description','2201059JzOvOS','Executed\x20personal\x20BFF\x20','name','appCode','2rIuxvA','20aOyhFD','write','createUserId','file','build','list','64717wgZPeH','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','isArray','gmtCreate','Show\x20one\x20personal\x20BFF\x20by\x20id','map','/client/runtime-bff/personal/create','num','length','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','Preview:\x20create\x20personal\x20BFF\x20','File\x20is\x20not\x20a\x20regular\x20file:\x20','Personal\x20BFF\x20script\x20file\x20is\x20blank.','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','File\x20not\x20found:\x20','433584NHVqvE','create','bool','string','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','Preview:\x20update\x20personal\x20BFF\x20','exec','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','updateTime','Optional\x20source\x20RuntimeAgent\x20session\x20id','255248GtcyyU','personal-bff','Personal\x20BFF\x20script\x20ID','flag','50CsNvXI'];a35_0x4c57=function(){return _0x311d10;};return a35_0x4c57();}function parseExecParams(_0x21e873){const _0x1e09b2=a35_0x20f073,_0xcd25d7=parseJsonParams(_0x21e873)??{};if(Array[_0x1e09b2(0xbe)](_0xcd25d7))throw CliErrors[_0x1e09b2(0xa6)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0xcd25d7;}const personalBffList={'service':a35_0x20f073(0x93),'command':a35_0x20f073(0xbb),'description':a35_0x20f073(0xd2),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x54211d){const _0x541145=a35_0x20f073,_0x2a221f=await listPersonalBffs(_0x54211d[_0x541145(0xb4)]);return{'ok':!![],'data':{'total':_0x2a221f[_0x541145(0xc4)],'items':_0x54211d[_0x541145(0xcd)]('verbose')?_0x2a221f:_0x2a221f[_0x541145(0xc1)](summarizeBff)}};}},personalBffDetail={'service':a35_0x20f073(0x93),'command':'detail','description':a35_0x20f073(0xc0),'risk':a35_0x20f073(0xa3),'flags':[{...ID_FLAG,'description':a35_0x20f073(0x94)}],async 'execute'(_0x5db8cb){const _0x371e81=a35_0x20f073,_0x5c716e=await getPersonalBff(_0x5db8cb[_0x371e81(0xc3)]('id'),_0x5db8cb[_0x371e81(0xb4)]);return{'ok':!![],'data':detailBff(_0x5c716e)};}},personalBffCreate={'service':a35_0x20f073(0x93),'command':a35_0x20f073(0xcc),'description':a35_0x20f073(0xcf),'risk':a35_0x20f073(0xb7),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5ea992){const _0x155e15=a35_0x20f073,_0x261ef3=buildCreateInput(_0x5ea992),_0x50fca5=await createPersonalBff(_0x5ea992[_0x155e15(0xb4)],_0x261ef3);return{'ok':!![],'data':detailBff(_0x50fca5),'message':'Created\x20personal\x20BFF\x20'+_0x50fca5['id']+(_0x50fca5[_0x155e15(0xaf)]?'\x20('+_0x50fca5[_0x155e15(0xaf)]+')':'')};},async 'dryRun'(_0x1d11aa){const _0x1c2528=a35_0x20f073,_0x4781ef=buildCreateInput(_0x1d11aa);return dryRun(_0x1c2528(0xae),_0x1c2528(0xc2))[_0x1c2528(0xaa)]({'appCode':_0x1d11aa[_0x1c2528(0xb4)],..._0x4781ef})[_0x1c2528(0xb0)](_0x1c2528(0xc6)+_0x4781ef['functionName'])[_0x1c2528(0xba)]();}},personalBffUpdate={'service':'personal-bff','command':'update','description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':a35_0x20f073(0xb7),'flags':[{...ID_FLAG,'description':a35_0x20f073(0x94)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x13ad35){const _0x1ed015=a35_0x20f073,_0x3b9ecc=_0x13ad35[_0x1ed015(0xc3)]('id'),_0x4e4fd3=buildUpdateInput(_0x13ad35),_0x5cc05a=await updatePersonalBff(_0x3b9ecc,_0x13ad35[_0x1ed015(0xb4)],_0x4e4fd3);return{'ok':!![],'data':detailBff(_0x5cc05a),'message':'Updated\x20personal\x20BFF\x20'+_0x5cc05a['id']+(_0x5cc05a[_0x1ed015(0xaf)]?'\x20('+_0x5cc05a[_0x1ed015(0xaf)]+')':'')};},async 'dryRun'(_0x357993){const _0x5a48a1=a35_0x20f073,_0x4ea87b=_0x357993['num']('id'),_0x3d2060=buildUpdateInput(_0x357993);return dryRun(_0x5a48a1(0xae),'/client/runtime-bff/personal/'+_0x4ea87b+_0x5a48a1(0xa7))['body']({'appCode':_0x357993['appCode'],..._0x3d2060})[_0x5a48a1(0xb0)](_0x5a48a1(0xd0)+_0x4ea87b)[_0x5a48a1(0xba)]();}},personalBffExec={'service':'personal-bff','command':a35_0x20f073(0xd1),'description':a35_0x20f073(0x9d),'risk':'high-risk-write','flags':[{...ID_FLAG,'description':a35_0x20f073(0x94)},{...PARAMS_FLAG,'description':a35_0x20f073(0xa8)}],async 'validate'(_0x256eca){const _0x194e9c=a35_0x20f073;parseExecParams(_0x256eca[_0x194e9c(0xa2)]('params'));},async 'execute'(_0x301ab9){const _0x4d267d=a35_0x20f073,_0x77fc7c=_0x301ab9[_0x4d267d(0xc3)]('id'),_0x50ece9=parseExecParams(_0x301ab9[_0x4d267d(0xa2)](_0x4d267d(0xa4))),_0x2654b1=await executePersonalBff(_0x77fc7c,_0x301ab9['appCode'],_0x50ece9);return{'ok':!![],'data':{'result':_0x2654b1},'message':_0x4d267d(0xb2)+_0x77fc7c};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @fileoverview Declarative command registry — the central registration hub.
3
+ *
4
+ * All commands in Lovrabet Runtime CLI are declared as `CommandDefinition` objects
5
+ * and registered in this file. The registry is consumed by:
6
+ * - The framework runner (`runCommand`) to dispatch commands
7
+ * - The help generator to list available commands
8
+ * - The schema exporter to build the machine-readable command index
9
+ *
10
+ * Why a declarative approach: compared to the legacy switch-based approach
11
+ * (one big `switch (command)` in a single handler file), declarative registration:
12
+ * - Enables `buildSchemaPayload()` — the schema exporter iterates the registry
13
+ * - Makes `--help` for a service easy to generate (enumerate all defs in the group)
14
+ * - Makes testing simpler — each command definition is independently importable
15
+ * - Reduces merge conflicts in the registry file
16
+ *
17
+ * Design decision: services are registered in a specific order. The order in
18
+ * `serviceRegistry` determines the order of services in `--help` output.
19
+ * `registerService()` is called at module load time (top-level), so the registry
20
+ * is populated before any command runs.
21
+ */
22
+ import type { CommandDefinition } from "../framework/types.js";
23
+ /**
24
+ * A service entry used for help generation and schema export.
25
+ *
26
+ * `isSingleCommand` is `true` when a service has only one command and the
27
+ * service name IS the command name (e.g. `lovrabet doctor`). In this case,
28
+ * `lovrabet doctor --help` shows the command help directly rather than the
29
+ * service listing with subcommands.
30
+ */
31
+ export interface ServiceEntry {
32
+ service: string;
33
+ label: string;
34
+ commands: {
35
+ command: string;
36
+ description: string;
37
+ tag?: string;
38
+ }[];
39
+ defaultCommand?: string;
40
+ /** `true` when the service has no subcommands and `service === command`. */
41
+ isSingleCommand?: boolean;
42
+ }
43
+ /** The ordered list of service entries — drives `--help` output order. */
44
+ export declare const serviceRegistry: ServiceEntry[];
45
+ /** Map of `"service:command"` → `CommandDefinition`. */
46
+ export declare const definitions: Map<string, CommandDefinition>;
47
+ /** Map of `service` → array of `CommandDefinition` for that service. */
48
+ export declare const serviceGroups: Map<string, CommandDefinition[]>;
49
+ /** Looks up a command definition by service and command name. */
50
+ export declare function findDefinition(service: string, command: string): CommandDefinition | undefined;
51
+ /** Returns `true` if `name` is a known service name. */
52
+ export declare function isKnownService(name: string): boolean;
53
+ /** Returns the service entry for a service name, or undefined. */
54
+ export declare function getServiceEntry(name: string): ServiceEntry | undefined;
55
+ /** Returns all registered command definitions. */
56
+ export declare function getAllDefinitions(): CommandDefinition[];
@@ -1 +1 @@
1
- const a36_0x5f2459=a36_0x310d;(function(_0x24bcc5,_0x1b4a23){const _0xb5bc31=a36_0x310d,_0x47643d=_0x24bcc5();while(!![]){try{const _0x40f74f=-parseInt(_0xb5bc31(0x73))/0x1*(-parseInt(_0xb5bc31(0x8f))/0x2)+parseInt(_0xb5bc31(0x71))/0x3+-parseInt(_0xb5bc31(0x7c))/0x4+-parseInt(_0xb5bc31(0x91))/0x5+-parseInt(_0xb5bc31(0x72))/0x6+-parseInt(_0xb5bc31(0x8a))/0x7+parseInt(_0xb5bc31(0x74))/0x8;if(_0x40f74f===_0x1b4a23)break;else _0x47643d['push'](_0x47643d['shift']());}catch(_0x41204d){_0x47643d['push'](_0x47643d['shift']());}}}(a36_0x5c79,0x41c83));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';function a36_0x310d(_0x37d124,_0x27a32f){_0x37d124=_0x37d124-0x6b;const _0x5c79c4=a36_0x5c79();let _0x310d19=_0x5c79c4[_0x37d124];return _0x310d19;}import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';function a36_0x5c79(){const _0x528793=['run','2251893qLYeLV','File','Diagnostics','Workspace','Schema','20QXTvUW','Skills','1209700bopiAJ','description','Artifacts','Service\x20Tree','push','SQL\x20Queries','Datasets','763722GMoVKx','304812QpRAYq','18211KCdbfh','5315952ZkLlVF','Configuration','write','install','Personal\x20BFF','values','OCR','risk','869176prdmRv','defaultCommand','Logs','read','Self\x20Update','API\x20Documentation','set','show','service','isSingleCommand','get','list','App\x20Management'];a36_0x5c79=function(){return _0x528793;};return a36_0x5c79();}import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x23f515){const _0x55604f=a36_0x310d;for(const _0x2d2839 of _0x23f515){definitions['set'](_0x2d2839[_0x55604f(0x84)]+':'+_0x2d2839['command'],_0x2d2839);let _0x4e725a=serviceGroups[_0x55604f(0x86)](_0x2d2839[_0x55604f(0x84)]);!_0x4e725a&&(_0x4e725a=[],serviceGroups[_0x55604f(0x82)](_0x2d2839[_0x55604f(0x84)],_0x4e725a)),_0x4e725a['push'](_0x2d2839);}}function registerService(_0x569501,_0x1ecfee,_0x2a6bf7){const _0x1bebcf=a36_0x310d;registerDefinitions(_0x1ecfee);const _0x4efc81=_0x3e86f1=>_0x3e86f1===_0x1bebcf(0x7f)?'':_0x3e86f1===_0x1bebcf(0x76)?'\x20\x20[write]':'\x20\x20[high-risk-write]',_0x2bfaba={'service':_0x1ecfee[0x0][_0x1bebcf(0x84)],'label':_0x569501,'commands':_0x1ecfee['map'](_0x8b6340=>({'command':_0x8b6340['command'],'description':_0x8b6340[_0x1bebcf(0x6b)],'tag':_0x4efc81(_0x8b6340[_0x1bebcf(0x7b)])})),'defaultCommand':_0x2a6bf7?.[_0x1bebcf(0x7d)]??(_0x2a6bf7?.[_0x1bebcf(0x85)]?_0x1ecfee[0x0]['command']:undefined),'isSingleCommand':_0x2a6bf7?.[_0x1bebcf(0x85)]};serviceRegistry[_0x1bebcf(0x6e)](_0x2bfaba),serviceByName[_0x1bebcf(0x82)](_0x2bfaba[_0x1bebcf(0x84)],_0x2bfaba);}registerService('Authentication',authDefinitions,{'defaultCommand':'login'}),registerService(a36_0x5f2459(0x88),appDefinitions,{'defaultCommand':a36_0x5f2459(0x87)}),registerService(a36_0x5f2459(0x8d),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a36_0x5f2459(0x75),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x5f2459(0x81),apiDocDefinitions),registerService(a36_0x5f2459(0x70),datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService(a36_0x5f2459(0x6f),sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService(a36_0x5f2459(0x78),personalBffDefinitions),registerService(a36_0x5f2459(0x6c),artifactDefinitions),registerService(a36_0x5f2459(0x8b),fileDefinitions),registerService(a36_0x5f2459(0x7a),ocrDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService(a36_0x5f2459(0x6d),serviceDefinitions,{'defaultCommand':a36_0x5f2459(0x87)}),registerService(a36_0x5f2459(0x90),skillDefinitions,{'defaultCommand':'install'}),registerService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a36_0x5f2459(0x77)}),registerService(a36_0x5f2459(0x80),[updateDefinition],{'defaultCommand':a36_0x5f2459(0x89),'isSingleCommand':!![]}),registerService(a36_0x5f2459(0x8c),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x5f2459(0x8e),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x5f2459(0x7e),logsDefinitions,{'defaultCommand':a36_0x5f2459(0x83)});export function findDefinition(_0x138483,_0x27b099){const _0x41e5af=a36_0x5f2459;return definitions[_0x41e5af(0x86)](_0x138483+':'+_0x27b099);}export function isKnownService(_0x1f7112){return serviceByName['has'](_0x1f7112);}export function getServiceEntry(_0x4de5b5){const _0x1c104a=a36_0x5f2459;return serviceByName[_0x1c104a(0x86)](_0x4de5b5);}export function getAllDefinitions(){const _0xecc08d=a36_0x5f2459;return Array['from'](definitions[_0xecc08d(0x79)]());}
1
+ const a36_0x33f59f=a36_0x1dad;(function(_0x1be17e,_0x37b893){const _0x1fb630=a36_0x1dad,_0x13377f=_0x1be17e();while(!![]){try{const _0x59a23a=parseInt(_0x1fb630(0x10f))/0x1+parseInt(_0x1fb630(0x105))/0x2+parseInt(_0x1fb630(0x121))/0x3*(-parseInt(_0x1fb630(0x128))/0x4)+parseInt(_0x1fb630(0x123))/0x5*(-parseInt(_0x1fb630(0x11b))/0x6)+parseInt(_0x1fb630(0x112))/0x7+-parseInt(_0x1fb630(0x11e))/0x8+-parseInt(_0x1fb630(0xfe))/0x9*(-parseInt(_0x1fb630(0x11f))/0xa);if(_0x59a23a===_0x37b893)break;else _0x13377f['push'](_0x13377f['shift']());}catch(_0x2836ec){_0x13377f['push'](_0x13377f['shift']());}}}(a36_0x1b42,0x567aa));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x3f97d1){const _0x1edc28=a36_0x1dad;for(const _0x106349 of _0x3f97d1){definitions['set'](_0x106349[_0x1edc28(0x118)]+':'+_0x106349[_0x1edc28(0x124)],_0x106349);let _0x4c5e7b=serviceGroups['get'](_0x106349[_0x1edc28(0x118)]);!_0x4c5e7b&&(_0x4c5e7b=[],serviceGroups['set'](_0x106349[_0x1edc28(0x118)],_0x4c5e7b)),_0x4c5e7b['push'](_0x106349);}}function a36_0x1b42(){const _0x3403e4=['push','BFF\x20Scripts','File','list','API\x20Documentation','get','498970BPhpiF','Workspace','has','2417681iGpmLo','description','set','\x20\x20[high-risk-write]','Instant\x20API','show','service','Datasets','map','10572ljLkvR','read','risk','895768tdJDpt','57130gCySXL','Runtime\x20App\x20Config','9wtZkEd','install','1860dYAmaV','command','Service\x20Tree','write','isSingleCommand','675764TSIfsE','Agent\x20Schedules','288gmcXvD','Artifacts','SQL\x20Queries','Logs','from','defaultCommand','App\x20Management','1202614mOWkri','Personal\x20BFF','Schema','login'];a36_0x1b42=function(){return _0x3403e4;};return a36_0x1b42();}function registerService(_0x2aec66,_0x2ea6a9,_0xebb504){const _0x176101=a36_0x1dad;registerDefinitions(_0x2ea6a9);const _0x77c40c=_0x4b8b01=>_0x4b8b01===_0x176101(0x11c)?'':_0x4b8b01===_0x176101(0x126)?'\x20\x20[write]':_0x176101(0x115),_0x5e3212={'service':_0x2ea6a9[0x0][_0x176101(0x118)],'label':_0x2aec66,'commands':_0x2ea6a9[_0x176101(0x11a)](_0x535ca6=>({'command':_0x535ca6['command'],'description':_0x535ca6[_0x176101(0x113)],'tag':_0x77c40c(_0x535ca6[_0x176101(0x11d)])})),'defaultCommand':_0xebb504?.[_0x176101(0x103)]??(_0xebb504?.[_0x176101(0x127)]?_0x2ea6a9[0x0]['command']:undefined),'isSingleCommand':_0xebb504?.[_0x176101(0x127)]};serviceRegistry[_0x176101(0x109)](_0x5e3212),serviceByName[_0x176101(0x114)](_0x5e3212[_0x176101(0x118)],_0x5e3212);}registerService('Authentication',authDefinitions,{'defaultCommand':a36_0x33f59f(0x108)}),registerService(a36_0x33f59f(0x104),appDefinitions,{'defaultCommand':a36_0x33f59f(0x10c)}),registerService(a36_0x33f59f(0x110),workspaceDefinitions),registerService(a36_0x33f59f(0x120),appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a36_0x33f59f(0x10c)}),registerService(a36_0x33f59f(0x10d),apiDocDefinitions),registerService(a36_0x33f59f(0x119),datasetDefinitions),registerService(a36_0x33f59f(0x116),dataDefinitions),registerService(a36_0x33f59f(0x100),sqlDefinitions),registerService(a36_0x33f59f(0x10a),bffDefinitions),registerService(a36_0x33f59f(0x106),personalBffDefinitions),registerService(a36_0x33f59f(0xff),artifactDefinitions),registerService(a36_0x33f59f(0x10b),fileDefinitions),registerService('OCR',ocrDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService(a36_0x33f59f(0x129),scheduleDefinitions,{'defaultCommand':a36_0x33f59f(0x10c)}),registerService(a36_0x33f59f(0x125),serviceDefinitions,{'defaultCommand':'list'}),registerService('Skills',skillDefinitions,{'defaultCommand':a36_0x33f59f(0x122)}),registerService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a36_0x33f59f(0x122)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x33f59f(0x107),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x33f59f(0x101),logsDefinitions,{'defaultCommand':a36_0x33f59f(0x117)});export function findDefinition(_0xe3cb5b,_0x48d01a){return definitions['get'](_0xe3cb5b+':'+_0x48d01a);}export function isKnownService(_0x17e9a7){const _0x10581e=a36_0x33f59f;return serviceByName[_0x10581e(0x111)](_0x17e9a7);}export function getServiceEntry(_0x1433d2){const _0x176ebc=a36_0x33f59f;return serviceByName[_0x176ebc(0x10e)](_0x1433d2);}function a36_0x1dad(_0x3a69b8,_0x42ab7c){_0x3a69b8=_0x3a69b8-0xfe;const _0x1b4235=a36_0x1b42();let _0x1dad75=_0x1b4235[_0x3a69b8];return _0x1dad75;}export function getAllDefinitions(){const _0x1f0c45=a36_0x33f59f;return Array[_0x1f0c45(0x102)](definitions['values']());}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const scheduleDefinitions: CommandDefinition[];
@@ -0,0 +1 @@
1
+ const a37_0x45bbf7=a37_0x1527;(function(_0x1bb751,_0xd2684a){const _0x11e8f5=a37_0x1527,_0xad86f5=_0x1bb751();while(!![]){try{const _0x27cf16=parseInt(_0x11e8f5(0x12d))/0x1*(parseInt(_0x11e8f5(0x12c))/0x2)+parseInt(_0x11e8f5(0x130))/0x3*(-parseInt(_0x11e8f5(0x12e))/0x4)+-parseInt(_0x11e8f5(0x11b))/0x5*(-parseInt(_0x11e8f5(0xea))/0x6)+parseInt(_0x11e8f5(0x125))/0x7+parseInt(_0x11e8f5(0xf4))/0x8+parseInt(_0x11e8f5(0x108))/0x9*(-parseInt(_0x11e8f5(0x131))/0xa)+-parseInt(_0x11e8f5(0x10a))/0xb*(parseInt(_0x11e8f5(0xec))/0xc);if(_0x27cf16===_0xd2684a)break;else _0xad86f5['push'](_0xad86f5['shift']());}catch(_0x3775b9){_0xad86f5['push'](_0xad86f5['shift']());}}}(a37_0x5e95,0x54564));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':a37_0x45bbf7(0x133),'type':a37_0x45bbf7(0x123),'required':!![],'enum':[a37_0x45bbf7(0x111),'ONCE'],'description':a37_0x45bbf7(0x127)},CRON_FLAG={'name':a37_0x45bbf7(0x100),'type':a37_0x45bbf7(0x123),'description':a37_0x45bbf7(0x109)},SCHEDULED_AT_FLAG={'name':a37_0x45bbf7(0x129),'type':'string','description':a37_0x45bbf7(0x106)},TITLE_FLAG={'name':a37_0x45bbf7(0x120),'type':a37_0x45bbf7(0x123),'required':!![],'description':a37_0x45bbf7(0xfd)},PROMPT_FLAG={'name':a37_0x45bbf7(0xed),'type':a37_0x45bbf7(0x123),'required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},CHANNEL_FLAG={'name':a37_0x45bbf7(0xf8),'type':a37_0x45bbf7(0x123),'enum':[a37_0x45bbf7(0x116),a37_0x45bbf7(0x113)],'default':a37_0x45bbf7(0x116),'description':a37_0x45bbf7(0x114)},SCHEDULE_ID_FLAG={'name':a37_0x45bbf7(0x11d),'type':a37_0x45bbf7(0x123),'required':!![],'description':a37_0x45bbf7(0x11f),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x45bbf7(0x122)}},LIMIT_FLAG={'name':'limit','type':a37_0x45bbf7(0x12f),'default':0x14,'description':a37_0x45bbf7(0x132)},CURSOR_FLAG={'name':'cursor','type':a37_0x45bbf7(0x123),'description':a37_0x45bbf7(0xf2)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x2b6942){const _0x36f48f=a37_0x45bbf7,_0x2f77d1=_0x2b6942[_0x36f48f(0xeb)]('kind'),_0x206def=_0x2b6942[_0x36f48f(0xeb)](_0x36f48f(0x120))[_0x36f48f(0x119)](),_0x12a3a9=_0x2b6942[_0x36f48f(0xeb)](_0x36f48f(0xed))[_0x36f48f(0x119)](),_0x59f916=_0x2b6942[_0x36f48f(0xeb)](_0x36f48f(0xf8)),_0x437293=_0x2b6942[_0x36f48f(0xeb)]('cron'),_0x1c1f49=_0x2b6942['str'](_0x36f48f(0x129));if(!_0x206def)throw CliErrors[_0x36f48f(0x112)](_0x36f48f(0xfb));if(!_0x12a3a9)throw CliErrors[_0x36f48f(0x112)](_0x36f48f(0x115));if(_0x2f77d1===_0x36f48f(0x111)){if(!_0x437293||_0x1c1f49)throw CliErrors[_0x36f48f(0x112)](_0x36f48f(0xf7));return{'kind':_0x2f77d1,'timezone':_0x36f48f(0x124),'cron':_0x437293,'title':_0x206def,'prompt':_0x12a3a9,'channel':_0x59f916};}if(_0x2f77d1==='ONCE'){if(!_0x1c1f49||_0x437293)throw CliErrors[_0x36f48f(0x112)](_0x36f48f(0x128));return{'kind':_0x2f77d1,'timezone':'UTC','scheduledAt':_0x1c1f49,'title':_0x206def,'prompt':_0x12a3a9,'channel':_0x59f916};}throw CliErrors[_0x36f48f(0x112)](_0x36f48f(0x103));}function a37_0x1527(_0x55ed3f,_0x18f92a){_0x55ed3f=_0x55ed3f-0xe6;const _0x5e95fb=a37_0x5e95();let _0x1527bb=_0x5e95fb[_0x55ed3f];return _0x1527bb;}function scheduleCollectionPath(_0x108bde){const _0x5677e9=a37_0x45bbf7;return _0x5677e9(0xff)+encodeURIComponent(_0x108bde)+_0x5677e9(0x12a);}function scheduleItemPath(_0x12448c,_0x35b63a){return scheduleCollectionPath(_0x12448c)+'/'+encodeURIComponent(_0x35b63a);}const scheduleValidate={'service':a37_0x45bbf7(0xe9),'command':'validate','description':a37_0x45bbf7(0xe6),'risk':'read','flags':INPUT_FLAGS,async 'validate'(_0x53ea3e){readScheduleInput(_0x53ea3e);},async 'execute'(_0x154604){const _0x463121=a37_0x45bbf7,_0x472cdf=readScheduleInput(_0x154604),_0x56687c=await validateRuntimeSchedule(_0x154604[_0x463121(0x105)],_0x472cdf);return{'ok':!![],'data':_0x56687c,'message':_0x463121(0xe8)};}},scheduleCreate={'service':a37_0x45bbf7(0xe9),'command':a37_0x45bbf7(0xe7),'description':a37_0x45bbf7(0x11a),'risk':'high-risk-write','flags':INPUT_FLAGS,async 'validate'(_0x353752){readScheduleInput(_0x353752);},async 'execute'(_0x3aa4d5){const _0x2dac69=a37_0x45bbf7,_0x6271c8=readScheduleInput(_0x3aa4d5),_0x1494c6=await validateRuntimeSchedule(_0x3aa4d5[_0x2dac69(0x105)],_0x6271c8),_0x51bd69=await createRuntimeSchedule(_0x3aa4d5[_0x2dac69(0x105)],_0x1494c6);return{'ok':!![],'data':_0x51bd69,'message':_0x2dac69(0x134)+_0x51bd69[_0x2dac69(0x133)]+_0x2dac69(0x117)+_0x51bd69[_0x2dac69(0xf1)]};},async 'dryRun'(_0x44ea26){const _0x59b1f0=a37_0x45bbf7,_0x3c010b=readScheduleInput(_0x44ea26);return dryRun(_0x59b1f0(0x118),scheduleCollectionPath(_0x44ea26[_0x59b1f0(0x105)]))[_0x59b1f0(0xf9)](_0x3c010b)[_0x59b1f0(0x101)](_0x59b1f0(0xfc))[_0x59b1f0(0xfa)]();}},scheduleList={'service':a37_0x45bbf7(0xe9),'command':a37_0x45bbf7(0xf3),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':'read','flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x961700){const _0xeeb482=a37_0x45bbf7,_0x557790=_0x961700[_0xeeb482(0x10e)](_0xeeb482(0x102));if(!Number[_0xeeb482(0xf0)](_0x557790)||_0x557790<0x1||_0x557790>0x64)throw CliErrors['validation']('--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.');const _0x3f425e=_0x961700[_0xeeb482(0xeb)](_0xeeb482(0x107));if(_0x3f425e&&(_0x3f425e[_0xeeb482(0x10f)]>0x400||_0x3f425e['trim']()!==_0x3f425e))throw CliErrors[_0xeeb482(0x112)](_0xeeb482(0x10b));},async 'execute'(_0x4fbfee){const _0x236ed5=a37_0x45bbf7,_0x4cda2=_0x4fbfee[_0x236ed5(0xeb)](_0x236ed5(0x107)),_0x33daaa=await listRuntimeSchedules(_0x4fbfee[_0x236ed5(0x105)],{'limit':_0x4fbfee[_0x236ed5(0x10e)](_0x236ed5(0x102)),..._0x4cda2?{'cursor':_0x4cda2}:{}});return{'ok':!![],'data':_0x33daaa};}},scheduleDetail={'service':a37_0x45bbf7(0xe9),'command':a37_0x45bbf7(0xef),'description':'Show\x20one\x20schedule\x20by\x20schedule\x20ID','risk':a37_0x45bbf7(0x10d),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x78fa56){const _0x3b8359=a37_0x45bbf7,_0x5e51d9=await getRuntimeSchedule(_0x78fa56[_0x3b8359(0x105)],_0x78fa56['str'](_0x3b8359(0x11d)));return{'ok':!![],'data':_0x5e51d9};}},scheduleRun={'service':a37_0x45bbf7(0xe9),'command':a37_0x45bbf7(0xf5),'description':'Run\x20one\x20schedule\x20immediately\x20and\x20create\x20a\x20Task','risk':a37_0x45bbf7(0x11e),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x8f786e){const _0x2b7c9d=a37_0x45bbf7,_0x4718f9=_0x8f786e[_0x2b7c9d(0xeb)](_0x2b7c9d(0x11d)),_0x331696=await runRuntimeSchedule(_0x8f786e[_0x2b7c9d(0x105)],_0x4718f9);return{'ok':!![],'data':_0x331696,'message':_0x2b7c9d(0x121)+_0x331696[_0x2b7c9d(0xee)]+_0x2b7c9d(0x10c)+_0x4718f9};},async 'dryRun'(_0x2b09c8){const _0x224754=a37_0x45bbf7,_0x34a7dc=_0x2b09c8[_0x224754(0xeb)]('schedule-id');return dryRun(_0x224754(0x118),scheduleItemPath(_0x2b09c8[_0x224754(0x105)],_0x34a7dc)+_0x224754(0x104))[_0x224754(0x101)](_0x224754(0x11c)+_0x34a7dc+_0x224754(0x126))['build']();}},scheduleDelete={'service':a37_0x45bbf7(0xe9),'command':a37_0x45bbf7(0xfe),'description':'Delete\x20a\x20schedule\x20and\x20stop\x20its\x20future\x20triggers','risk':a37_0x45bbf7(0x11e),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x29d23a){const _0x29a20d=a37_0x45bbf7,_0x54b293=_0x29d23a['str'](_0x29a20d(0x11d)),_0x5e59bd=await deleteRuntimeSchedule(_0x29d23a[_0x29a20d(0x105)],_0x54b293);return{'ok':!![],'data':_0x5e59bd,'message':_0x29a20d(0x12b)+_0x54b293};},async 'dryRun'(_0x4dab6f){const _0x13ff32=a37_0x45bbf7,_0x4f9379=_0x4dab6f[_0x13ff32(0xeb)]('schedule-id');return dryRun(_0x13ff32(0xf6),scheduleItemPath(_0x4dab6f[_0x13ff32(0x105)],_0x4f9379))['description'](_0x13ff32(0x110)+_0x4f9379)[_0x13ff32(0xfa)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];function a37_0x5e95(){const _0x147448=['channel','body','build','--title\x20must\x20not\x20be\x20blank.','Preview:\x20create\x20an\x20Agent\x20schedule','Schedule\x20title','delete','/api/harness/apps/','cron','description','limit','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','/run','appCode','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','cursor','9fjTsss','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','392304xwARJy','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','\x20from\x20schedule\x20','read','num','length','Preview:\x20delete\x20schedule\x20','CRON','validation','premium','Task\x20channel:\x20auto\x20or\x20premium','--prompt\x20must\x20not\x20be\x20blank.','auto','\x20schedule\x20','POST','trim','Create\x20a\x20recurring\x20or\x20one-time\x20Agent\x20schedule','357055LhjfvC','Preview:\x20run\x20schedule\x20','schedule-id','high-risk-write','Schedule\x20UUID','title','Queued\x20Task\x20','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','string','UTC','1387974JADtdM','\x20immediately','Schedule\x20kind:\x20CRON\x20or\x20ONCE','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','scheduled-at','/schedules','Deleted\x20schedule\x20','2xrBTgj','175789vFJfud','527588QesDal','number','3fWOAjZ','3318010WvRcQF','Page\x20size\x20from\x201\x20to\x20100','kind','Created\x20','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','create','Schedule\x20input\x20is\x20valid','schedule','12kfrkcl','str','36oJMkYa','prompt','taskId','detail','isSafeInteger','scheduleId','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','list','3193928RlWnRF','run','DELETE','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.'];a37_0x5e95=function(){return _0x147448;};return a37_0x5e95();}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @fileoverview `schema export` command — generates a machine-readable command index.
3
+ *
4
+ * Why this command exists: external tools (IDEs, documentation generators,
5
+ * AI agents) need a structured, stable representation of every command's
6
+ * flags, arguments, risk level, and description. `schema export` produces
7
+ * this as a JSON payload built from the runtime registry.
8
+ *
9
+ * Why it delegates to `buildSchemaPayload`: the actual schema-building logic
10
+ * lives in the framework (`@lovrabet/cli-framework`). This command is the
11
+ * runtime CLI's integration point — it passes the registry to the framework
12
+ * and wraps the result in a `CommandResult`.
13
+ *
14
+ * Why `hasFormat: true`: the schema output can be formatted (e.g. `--format pretty`
15
+ * for human inspection, `--format json` for machine consumption).
16
+ */
17
+ import type { CommandDefinition } from "../framework/types.js";
18
+ export declare const schemaDefinition: CommandDefinition;
@@ -1 +1 @@
1
- const a37_0x62692c=a37_0x5464;function a37_0x5464(_0x5b424a,_0x30d072){_0x5b424a=_0x5b424a-0x1be;const _0x1f740e=a37_0x1f74();let _0x546424=_0x1f740e[_0x5b424a];return _0x546424;}(function(_0x3b4377,_0x2bcc38){const _0x117e10=a37_0x5464,_0x3c2d88=_0x3b4377();while(!![]){try{const _0x102085=parseInt(_0x117e10(0x1c4))/0x1+parseInt(_0x117e10(0x1cb))/0x2*(parseInt(_0x117e10(0x1be))/0x3)+-parseInt(_0x117e10(0x1c7))/0x4*(parseInt(_0x117e10(0x1c0))/0x5)+parseInt(_0x117e10(0x1c2))/0x6*(-parseInt(_0x117e10(0x1ca))/0x7)+-parseInt(_0x117e10(0x1c3))/0x8+-parseInt(_0x117e10(0x1c6))/0x9*(parseInt(_0x117e10(0x1c9))/0xa)+parseInt(_0x117e10(0x1c5))/0xb;if(_0x102085===_0x2bcc38)break;else _0x3c2d88['push'](_0x3c2d88['shift']());}catch(_0x2a7985){_0x3c2d88['push'](_0x3c2d88['shift']());}}}(a37_0x1f74,0xb1fc4));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1fa827){const _0x10d61e=await buildSchemaPayload();return{'ok':!![],'data':_0x10d61e};}function a37_0x1f74(){const _0x16353a=['1131kqbfDw','Export\x20machine-readable\x20command\x20schema\x20(JSON)','197605IINZOI','read','9102txyzDG','10078632cRoCHw','1216327iBzNLW','16423077kqHPaQ','6054507pcpCyW','60OeMDkE','export','10UssLZM','2702urDJWY','5998sMjlmX'];a37_0x1f74=function(){return _0x16353a;};return a37_0x1f74();}export const schemaDefinition={'service':'schema','command':a37_0x62692c(0x1c8),'description':a37_0x62692c(0x1bf),'risk':a37_0x62692c(0x1c1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a38_0x475a5e=a38_0x4529;(function(_0x163fc7,_0x353caa){const _0x226b53=a38_0x4529,_0x46270e=_0x163fc7();while(!![]){try{const _0x39bc67=parseInt(_0x226b53(0x170))/0x1+-parseInt(_0x226b53(0x168))/0x2*(parseInt(_0x226b53(0x167))/0x3)+-parseInt(_0x226b53(0x169))/0x4*(-parseInt(_0x226b53(0x16d))/0x5)+-parseInt(_0x226b53(0x16b))/0x6*(-parseInt(_0x226b53(0x16c))/0x7)+-parseInt(_0x226b53(0x165))/0x8*(parseInt(_0x226b53(0x164))/0x9)+-parseInt(_0x226b53(0x16f))/0xa*(-parseInt(_0x226b53(0x166))/0xb)+-parseInt(_0x226b53(0x16a))/0xc;if(_0x39bc67===_0x353caa)break;else _0x46270e['push'](_0x46270e['shift']());}catch(_0x41a962){_0x46270e['push'](_0x46270e['shift']());}}}(a38_0x45ff,0x34a37));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x482cf0){const _0xdc1a7f=await buildSchemaPayload();return{'ok':!![],'data':_0xdc1a7f};}function a38_0x4529(_0x53ea66,_0x70ff5e){_0x53ea66=_0x53ea66-0x164;const _0x45ff23=a38_0x45ff();let _0x45291f=_0x45ff23[_0x53ea66];return _0x45291f;}export const schemaDefinition={'service':a38_0x475a5e(0x16e),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a38_0x45ff(){const _0x471d0e=['171JHQSbn','39464XEYgNX','11zUsiKV','120kXguwO','17236zunWVo','8ZbEcim','363492jmcAnm','10554GUgGpy','7QoogYh','551615zZuZHH','schema','2648750wtuGoF','197065RJSANM'];a38_0x45ff=function(){return _0x471d0e;};return a38_0x45ff();}
@@ -0,0 +1,18 @@
1
+ import { type NormalizedServiceTree, type NormalizedServiceTreeCommand } from "@lovrabet/cli-framework";
2
+ import type { CommandDefinition } from "../../framework/types.js";
3
+ import type { ServiceEntry } from "../../commands/registry.js";
4
+ export interface DynamicServiceResolution {
5
+ definition: CommandDefinition;
6
+ args: string[];
7
+ flags: Record<string, any>;
8
+ tree: NormalizedServiceTree;
9
+ command: NormalizedServiceTreeCommand;
10
+ }
11
+ export declare function resolveDynamicServiceCommand(input: string[], flags: Record<string, any>): DynamicServiceResolution | undefined;
12
+ export declare function generateDynamicServiceHelp(serviceCode: string): string | undefined;
13
+ export declare function listDynamicServiceEntries(): ServiceEntry[];
14
+ export declare function getDynamicServiceEntry(serviceCode: string): ServiceEntry | undefined;
15
+ export declare function listDynamicServiceDefinitions(serviceCode?: string): CommandDefinition[];
16
+ export declare function getDynamicServiceDefinitions(serviceCode: string): CommandDefinition[] | undefined;
17
+ export declare function findDynamicServiceDefinition(serviceCode: string, commandName: string): CommandDefinition | undefined;
18
+ export declare function buildDynamicCommandDefinition(tree: NormalizedServiceTree, command: NormalizedServiceTreeCommand): CommandDefinition;
@@ -1 +1 @@
1
- (function(_0x215a7c,_0x443030){const _0x16f382=a38_0x597a,_0x2906df=_0x215a7c();while(!![]){try{const _0x505f4c=parseInt(_0x16f382(0xae))/0x1*(-parseInt(_0x16f382(0xd9))/0x2)+-parseInt(_0x16f382(0xad))/0x3+-parseInt(_0x16f382(0xac))/0x4+parseInt(_0x16f382(0xe7))/0x5+parseInt(_0x16f382(0xa7))/0x6+-parseInt(_0x16f382(0xd2))/0x7+parseInt(_0x16f382(0xb9))/0x8;if(_0x505f4c===_0x443030)break;else _0x2906df['push'](_0x2906df['shift']());}catch(_0x4c6c84){_0x2906df['push'](_0x2906df['shift']());}}}(a38_0x2c16,0x97674));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';function a38_0x2c16(){const _0x1ec899=['\x20\x20\x20\x20datasetCode:\x20','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','tenantCode','657152MjjMOB','1547109oMigtF','4SwRwgL','number','mapTo','Unsupported\x20service\x20target\x20kind:\x20','now','\x20\x20\x20\x20command:\x20','appCode','length','cliName','Run\x20service\x20command\x20','validation','11791400IXZMln','json','sql','Unknown\x20appRef\x20\x22','nickname','Commands:','sqlCode','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','appcode','padEnd','cliPath','command','default','const','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','fromEntries','nickName','description','code','bffId','username','map','Cannot\x20resolve\x20datatable\x20\x22','boolean','Preview\x20dynamic\x20service\x20command:\x20','5458159MNlcnN','read','\x20\x20SERVICE\x20TREE\x20TARGET','params','\x20\x20[','context.','string','238454HJLkrs','target','commands','tree','name','employeeId','\x20->\x20','\x20requires\x20target.functionName.','rawFlags','push','\x20\x20\x20\x20datatable:\x20','startsWith','risk','app','853085qXrJRo','find','\x20\x20\x20\x20','required','flags','operator','\x20<command>\x20[flags]','datasetCode','envName','slice','datatable','ctx.','\x20requires\x20target.sqlCode.','dbtableConfig','fullPath','entries','scriptName','appRef','env','Use\x20`','source','userId','bffCode','tableName','join','kind','Service\x20command\x20','some','service','args','remainingArgs','5473452vBaYPJ','\x20\x20\x20\x20kind:\x20\x20\x20\x20'];a38_0x2c16=function(){return _0x1ec899;};return a38_0x2c16();}import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';function a38_0x597a(_0x12598d,_0x374860){_0x12598d=_0x12598d-0x93;const _0x2c1635=a38_0x2c16();let _0x597a8e=_0x2c1635[_0x12598d];return _0x597a8e;}import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x262889,_0x397b59){const _0xfd5be=a38_0x597a,_0x55318b=listLocalServiceTrees();let _0x434b63;for(const _0x4a151c of _0x55318b){const _0xc1aaee=matchServiceTreeCommand(_0x4a151c,_0x262889);if(!_0xc1aaee)continue;(!_0x434b63||_0xc1aaee[_0xfd5be(0xc4)][_0xfd5be(0x96)][_0xfd5be(0xb5)]>_0x434b63[_0xfd5be(0xc4)][_0xfd5be(0x96)][_0xfd5be(0xb5)])&&(_0x434b63={'tree':_0x4a151c,'command':_0xc1aaee[_0xfd5be(0xc4)],'remainingArgs':_0xc1aaee[_0xfd5be(0xa6)]});}if(!_0x434b63)return undefined;const _0x1d0e31={..._0x397b59};return applyAppBinding(_0x434b63['tree'],_0x434b63[_0xfd5be(0xc4)],_0x1d0e31),{'definition':buildDynamicCommandDefinition(_0x434b63[_0xfd5be(0xdc)],_0x434b63[_0xfd5be(0xc4)]),'args':_0x434b63[_0xfd5be(0xa6)],'flags':_0x1d0e31,'tree':_0x434b63[_0xfd5be(0xdc)],'command':_0x434b63[_0xfd5be(0xc4)]};}export function generateDynamicServiceHelp(_0x52c3be){const _0x2acfa0=a38_0x597a,_0x21e638=listLocalServiceTrees()['find'](_0x284c05=>_0x284c05['service'][_0x2acfa0(0xcb)]===_0x52c3be);if(!_0x21e638)return undefined;const _0x32aa60=[CLI_BIN_NAME+'\x20'+_0x52c3be+_0x2acfa0(0xed),'',_0x21e638[_0x2acfa0(0xa4)]['name']||_0x52c3be,_0x21e638[_0x2acfa0(0xa4)]['description']?'\x20\x20'+_0x21e638[_0x2acfa0(0xa4)][_0x2acfa0(0xca)]:'','',_0x2acfa0(0xbe),..._0x21e638[_0x2acfa0(0xdb)][_0x2acfa0(0xce)](_0x4f51b8=>{const _0x46356e=_0x2acfa0,_0x4d7e5c=_0x4f51b8['fullPath'][_0x46356e(0xf0)](0x1)[_0x46356e(0xa0)]('\x20'),_0x1b3c91=_0x4f51b8[_0x46356e(0xe5)]===_0x46356e(0xd3)?'':'\x20['+_0x4f51b8[_0x46356e(0xe5)]+']';return'\x20\x20'+_0x4d7e5c[_0x46356e(0xc2)](0x18)+'\x20'+(_0x4f51b8['description']||'')+_0x1b3c91;}),'',_0x2acfa0(0x9b)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x52c3be+'`\x20to\x20inspect\x20the\x20manifest.']['filter'](Boolean);return _0x32aa60['join']('\x0a');}export function listDynamicServiceEntries(){const _0x365b12=a38_0x597a;return listLocalServices()[_0x365b12(0xce)](_0x211eea=>{const _0x1fa7f2=_0x365b12,_0x53b88a=_0x211eea['normalizedManifest'];return{'service':_0x53b88a[_0x1fa7f2(0xa4)]['code'],'label':_0x53b88a['service'][_0x1fa7f2(0xdd)]||_0x53b88a[_0x1fa7f2(0xa4)][_0x1fa7f2(0xcb)],'commands':_0x53b88a[_0x1fa7f2(0xdb)][_0x1fa7f2(0xce)](_0x28e91e=>({'command':dynamicCommandName(_0x28e91e),'description':_0x28e91e[_0x1fa7f2(0xca)]||'Run\x20service\x20command\x20'+_0x28e91e['cliPath'],'tag':riskTag(_0x28e91e[_0x1fa7f2(0xe5)])}))};});}export function getDynamicServiceEntry(_0x303c46){const _0x194041=a38_0x597a;return listDynamicServiceEntries()[_0x194041(0xe8)](_0x3bce8d=>_0x3bce8d[_0x194041(0xa4)]===_0x303c46);}export function listDynamicServiceDefinitions(_0x12e332){const _0x37aa00=a38_0x597a;return listLocalServiceTrees()['filter'](_0x478a68=>!_0x12e332||_0x478a68[_0x37aa00(0xa4)][_0x37aa00(0xcb)]===_0x12e332)['flatMap'](_0x1cc46f=>_0x1cc46f[_0x37aa00(0xdb)][_0x37aa00(0xce)](_0x1f6f1e=>buildDynamicCommandDefinition(_0x1cc46f,_0x1f6f1e)));}export function getDynamicServiceDefinitions(_0x2e174e){const _0x414c2e=listDynamicServiceDefinitions(_0x2e174e);return _0x414c2e['length']>0x0?_0x414c2e:undefined;}export function findDynamicServiceDefinition(_0x33477a,_0x2c8d3b){const _0x21ff0b=a38_0x597a;return listDynamicServiceDefinitions(_0x33477a)[_0x21ff0b(0xe8)](_0x36d5ed=>_0x36d5ed[_0x21ff0b(0xc4)]===_0x2c8d3b);}export function buildDynamicCommandDefinition(_0x2dc78d,_0xcaac7c){const _0x36d63d=a38_0x597a;return{'service':_0x2dc78d[_0x36d63d(0xa4)]['code'],'command':dynamicCommandName(_0xcaac7c),'description':_0xcaac7c[_0x36d63d(0xca)]||_0x36d63d(0xb7)+_0xcaac7c['cliPath'],'risk':_0xcaac7c['risk'],'requiresAuth':!![],'requiresAppCode':!![],'args':_0xcaac7c['args'][_0x36d63d(0xce)](_0x56154b=>({'name':_0x56154b[_0x36d63d(0xdd)],'description':_0x56154b[_0x36d63d(0xca)]||_0x56154b['name'],'required':_0x56154b[_0x36d63d(0xea)]})),'flags':_0xcaac7c[_0x36d63d(0xeb)][_0x36d63d(0xce)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0xcaac7c),async 'dryRun'(_0x38138a){const _0x34caa8=_0x36d63d,_0x1c3e41=await compilePlan(_0xcaac7c,_0x38138a);return{'method':'SERVICE_TREE','url':_0xcaac7c[_0x34caa8(0xc3)],'body':{'target':targetPreview(_0x1c3e41),'params':_0x1c3e41['params']},'description':_0x34caa8(0xd1)+_0xcaac7c['cliPath']};},async 'execute'(_0x3054c7){const _0x39f8a4=_0x36d63d,_0x572f88=await compilePlan(_0xcaac7c,_0x3054c7),_0x26477f=Date[_0x39f8a4(0xb2)](),_0x4a0838=await executePlan(_0x572f88,_0xcaac7c,_0x3054c7),_0xb50eab=Date[_0x39f8a4(0xb2)]()-_0x26477f;return{'ok':!![],'data':{'service':_0x2dc78d[_0x39f8a4(0xa4)],'command':_0xcaac7c[_0x39f8a4(0xc3)],'target':targetPreview(_0x572f88),'result':_0x4a0838,'elapsed':_0xb50eab},'message':'Service\x20command\x20'+_0xcaac7c['cliPath']+'\x20completed\x20in\x20'+_0xb50eab+'ms'};}};}function dynamicCommandName(_0x3a5f08){const _0x27ca52=a38_0x597a;return _0x3a5f08['fullPath'][_0x27ca52(0xf0)](0x1)[_0x27ca52(0xa0)]('\x20');}function riskTag(_0x49743c){const _0x1c32a5=a38_0x597a;return _0x49743c===_0x1c32a5(0xd3)?'':_0x1c32a5(0xd6)+_0x49743c+']';}function flagToCommandFlag(_0x32154c){const _0x222bf6=a38_0x597a;return{'name':_0x32154c[_0x222bf6(0xb6)],'type':_0x32154c['type']===_0x222bf6(0xba)?'string':_0x32154c['type'],'description':_0x32154c[_0x222bf6(0xca)]||_0x32154c['name'],'required':_0x32154c[_0x222bf6(0xea)],'default':isPrimitiveFlagDefault(_0x32154c[_0x222bf6(0xc5)])?_0x32154c['default']:undefined,'enum':_0x32154c['enum']};}async function compilePlan(_0x1da530,_0x2b2892){const _0x4adab9=a38_0x597a;return compileServiceTreeCommand(_0x1da530,{'flags':_0x2b2892[_0x4adab9(0xe1)],'args':_0x2b2892[_0x4adab9(0xa5)],'context':await buildServiceContext(_0x1da530,_0x2b2892)});}async function buildServiceContext(_0x2f0bef,_0x1729a9){const _0x4597af=a38_0x597a,_0x3aa1c7={'appCode':_0x1729a9[_0x4597af(0xb4)],'env':_0x1729a9[_0x4597af(0xef)],'envName':_0x1729a9[_0x4597af(0xef)]};if(!usesRuntimeContext(_0x2f0bef))return _0x3aa1c7;const _0x3c7242=await getLoginUserInfo(),_0x1cfb14=pickFirst(_0x3c7242[_0x4597af(0x9d)],_0x3c7242['id']);return{..._0x3aa1c7,'user':_0x3c7242,'userId':_0x1cfb14,'id':_0x3c7242['id'],'username':pickFirst(_0x3c7242[_0x4597af(0xcd)],_0x3c7242['userName'],_0x3c7242['loginName']),'userName':_0x3c7242['userName'],'nickname':pickFirst(_0x3c7242[_0x4597af(0xbd)],_0x3c7242[_0x4597af(0xc9)]),'nickName':_0x3c7242[_0x4597af(0xc9)],'tenantCode':_0x3c7242[_0x4597af(0xab)],'employeeId':_0x3c7242[_0x4597af(0xde)]};}function usesRuntimeContext(_0x54f214){const _0x207408=a38_0x597a;return _0x54f214[_0x207408(0xb0)][_0x207408(0xa3)](_0x55c694=>typeof _0x55c694['source']===_0x207408(0xd8)&&(_0x55c694[_0x207408(0x9c)]['startsWith'](_0x207408(0xd7))||_0x55c694['source'][_0x207408(0xe4)](_0x207408(0x93))));}function pickFirst(..._0x576994){const _0x4262b0=a38_0x597a;return _0x576994[_0x4262b0(0xe8)](_0x5d979f=>_0x5d979f!==undefined&&_0x5d979f!==null);}async function executePlan(_0x30ab97,_0x187c21,_0x581272){const _0x3cab5=a38_0x597a;if(_0x30ab97[_0x3cab5(0xa1)]==='data'){const _0x4dc3e7=await resolveDatasetCode(_0x30ab97,_0x187c21,_0x581272);return executeData(_0x4dc3e7,_0x30ab97[_0x3cab5(0xc4)],_0x30ab97[_0x3cab5(0xd5)]);}if(_0x30ab97[_0x3cab5(0xa1)]===_0x3cab5(0xbb)){if(!_0x30ab97[_0x3cab5(0xbf)])throw CliErrors[_0x3cab5(0xb8)](_0x3cab5(0xa2)+_0x187c21['cliPath']+_0x3cab5(0x94));return executeSdkSql(_0x30ab97['sqlCode'],normalizeScalarParams(_0x30ab97[_0x3cab5(0xd5)]));}if(_0x30ab97[_0x3cab5(0xa1)]==='bff'){const _0xf37b56=_0x30ab97[_0x3cab5(0x98)]||_0x30ab97[_0x3cab5(0x9e)]||(_0x30ab97[_0x3cab5(0xcc)]==null?'':String(_0x30ab97[_0x3cab5(0xcc)]));if(!_0xf37b56)throw CliErrors[_0x3cab5(0xb8)](_0x3cab5(0xa2)+_0x187c21[_0x3cab5(0xc3)]+_0x3cab5(0xe0));return executeSdkBff(_0xf37b56,_0x30ab97[_0x3cab5(0xd5)]);}throw CliErrors[_0x3cab5(0xb8)](_0x3cab5(0xb1)+_0x30ab97[_0x3cab5(0xa1)]);}async function resolveDatasetCode(_0x9bff8e,_0x38ba2c,_0x2abbb3){const _0x4961a1=a38_0x597a;if(_0x9bff8e[_0x4961a1(0xee)])return _0x9bff8e[_0x4961a1(0xee)];if(!_0x9bff8e[_0x4961a1(0xf1)])throw CliErrors[_0x4961a1(0xb8)]('Service\x20command\x20'+_0x38ba2c[_0x4961a1(0xc3)]+_0x4961a1(0xaa));const _0x58170c=await listDatasets(_0x2abbb3[_0x4961a1(0xb4)]),_0x51ca20=_0x58170c['find'](_0x31e83d=>_0x31e83d[_0x4961a1(0x95)]?.[_0x4961a1(0x9f)]===_0x9bff8e[_0x4961a1(0xf1)]);if(!_0x51ca20?.[_0x4961a1(0xcb)])throw CliErrors[_0x4961a1(0xb8)](_0x4961a1(0xcf)+_0x9bff8e[_0x4961a1(0xf1)]+_0x4961a1(0xc7)+_0x2abbb3[_0x4961a1(0xb4)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x51ca20[_0x4961a1(0xcb)];}function applyAppBinding(_0x4ff47e,_0x4fb1df,_0xc81413){const _0x3c75c4=a38_0x597a,_0x47152f=_0x4fb1df[_0x3c75c4(0xda)]['appRef'];if(!_0x47152f)return;const _0x1800a3=_0x4ff47e['appBindings'][_0x47152f];if(!_0x1800a3)throw CliErrors[_0x3c75c4(0xb8)](_0x3c75c4(0xbc)+_0x47152f+'\x22\x20in\x20service\x20command\x20'+_0x4fb1df[_0x3c75c4(0xc3)]+'.',_0x3c75c4(0xc0));const _0x14e5cb=_0x1800a3[_0x3c75c4(0xc1)]||_0x1800a3['appCode'];_0x14e5cb&&!hasText(_0xc81413[_0x3c75c4(0xc1)])&&(_0xc81413[_0x3c75c4(0xc1)]=_0x14e5cb),_0x1800a3[_0x3c75c4(0xe6)]&&!hasText(_0xc81413[_0x3c75c4(0xe6)])&&!hasText(_0xc81413[_0x3c75c4(0xc1)])&&(_0xc81413[_0x3c75c4(0xe6)]=_0x1800a3[_0x3c75c4(0xe6)]),_0x1800a3['env']&&!hasText(_0xc81413[_0x3c75c4(0x9a)])&&(_0xc81413[_0x3c75c4(0x9a)]=_0x1800a3['env']);}function renderDynamicCommandHelp(_0x46e2de){const _0x49b9ce=a38_0x597a,_0x154337=[_0x49b9ce(0xd4),_0x49b9ce(0xa8)+_0x46e2de['target'][_0x49b9ce(0xa1)],_0x49b9ce(0xb3)+_0x46e2de[_0x49b9ce(0xda)]['command']];if(_0x46e2de[_0x49b9ce(0xda)][_0x49b9ce(0xee)])_0x154337[_0x49b9ce(0xe2)](_0x49b9ce(0xa9)+_0x46e2de[_0x49b9ce(0xda)][_0x49b9ce(0xee)]);if(_0x46e2de[_0x49b9ce(0xda)][_0x49b9ce(0xf1)])_0x154337[_0x49b9ce(0xe2)](_0x49b9ce(0xe3)+_0x46e2de['target']['datatable']);if(_0x46e2de[_0x49b9ce(0xda)]['sqlCode'])_0x154337['push']('\x20\x20\x20\x20sqlCode:\x20'+_0x46e2de['target']['sqlCode']);if(_0x46e2de[_0x49b9ce(0xda)][_0x49b9ce(0x98)])_0x154337['push']('\x20\x20\x20\x20functionName:\x20'+_0x46e2de[_0x49b9ce(0xda)][_0x49b9ce(0x98)]);if(_0x46e2de[_0x49b9ce(0xb0)][_0x49b9ce(0xb5)]>0x0){_0x154337[_0x49b9ce(0xe2)]('','\x20\x20MAP\x20TO');for(const _0x46143f of _0x46e2de[_0x49b9ce(0xb0)]){_0x154337[_0x49b9ce(0xe2)](_0x49b9ce(0xe9)+(_0x46143f[_0x49b9ce(0x9c)]||_0x49b9ce(0xc6))+_0x49b9ce(0xdf)+_0x46143f[_0x49b9ce(0xda)]+(_0x46143f[_0x49b9ce(0xec)]?'.'+_0x46143f[_0x49b9ce(0xec)]:''));}}return _0x154337['join']('\x0a');}function targetPreview(_0xd030f8){const _0x33712f=a38_0x597a;return{'kind':_0xd030f8[_0x33712f(0xa1)],'command':_0xd030f8[_0x33712f(0xc4)],'appRef':_0xd030f8[_0x33712f(0x99)],'datasetCode':_0xd030f8[_0x33712f(0xee)],'datatable':_0xd030f8[_0x33712f(0xf1)],'sqlCode':_0xd030f8[_0x33712f(0xbf)],'bffCode':_0xd030f8[_0x33712f(0x9e)],'bffId':_0xd030f8[_0x33712f(0xcc)],'functionName':_0xd030f8[_0x33712f(0x98)]};}function normalizeScalarParams(_0x5a6916){const _0x28416d=a38_0x597a;return Object[_0x28416d(0xc8)](Object[_0x28416d(0x97)](_0x5a6916)['filter'](([,_0x2d54bf])=>typeof _0x2d54bf===_0x28416d(0xd8)||typeof _0x2d54bf===_0x28416d(0xaf)));}function hasText(_0x38a865){const _0x489583=a38_0x597a;return typeof _0x38a865===_0x489583(0xd8)&&_0x38a865['trim']()['length']>0x0;}function isPrimitiveFlagDefault(_0x35115a){const _0x5cb2e8=a38_0x597a;return _0x35115a===undefined||typeof _0x35115a===_0x5cb2e8(0xd8)||typeof _0x35115a===_0x5cb2e8(0xaf)||typeof _0x35115a===_0x5cb2e8(0xd0);}
1
+ (function(_0x226a34,_0x4ae622){const _0x2c993b=a39_0x394c,_0x40baef=_0x226a34();while(!![]){try{const _0x4dc8c3=-parseInt(_0x2c993b(0x201))/0x1*(-parseInt(_0x2c993b(0x1ef))/0x2)+parseInt(_0x2c993b(0x1de))/0x3*(-parseInt(_0x2c993b(0x20a))/0x4)+parseInt(_0x2c993b(0x220))/0x5+parseInt(_0x2c993b(0x222))/0x6+parseInt(_0x2c993b(0x21c))/0x7+-parseInt(_0x2c993b(0x22c))/0x8+parseInt(_0x2c993b(0x1fd))/0x9*(-parseInt(_0x2c993b(0x1d1))/0xa);if(_0x4dc8c3===_0x4ae622)break;else _0x40baef['push'](_0x40baef['shift']());}catch(_0xee2dfe){_0x40baef['push'](_0x40baef['shift']());}}}(a39_0x2e63,0x5ac81));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x31f3f7,_0x58ac6a){const _0x28cae9=a39_0x394c,_0xba398b=listLocalServiceTrees();let _0x57cca7;for(const _0x32f2c5 of _0xba398b){const _0x34c76d=matchServiceTreeCommand(_0x32f2c5,_0x31f3f7);if(!_0x34c76d)continue;(!_0x57cca7||_0x34c76d[_0x28cae9(0x215)][_0x28cae9(0x1fc)][_0x28cae9(0x21d)]>_0x57cca7[_0x28cae9(0x215)][_0x28cae9(0x1fc)][_0x28cae9(0x21d)])&&(_0x57cca7={'tree':_0x32f2c5,'command':_0x34c76d[_0x28cae9(0x215)],'remainingArgs':_0x34c76d[_0x28cae9(0x1e9)]});}if(!_0x57cca7)return undefined;const _0x382aa8={..._0x58ac6a};return applyAppBinding(_0x57cca7['tree'],_0x57cca7[_0x28cae9(0x215)],_0x382aa8),{'definition':buildDynamicCommandDefinition(_0x57cca7[_0x28cae9(0x1dc)],_0x57cca7[_0x28cae9(0x215)]),'args':_0x57cca7['remainingArgs'],'flags':_0x382aa8,'tree':_0x57cca7[_0x28cae9(0x1dc)],'command':_0x57cca7[_0x28cae9(0x215)]};}export function generateDynamicServiceHelp(_0x3aa24b){const _0x3bbe84=a39_0x394c,_0x1093bd=listLocalServiceTrees()[_0x3bbe84(0x1c4)](_0x1f3da8=>_0x1f3da8[_0x3bbe84(0x228)][_0x3bbe84(0x1f8)]===_0x3aa24b);if(!_0x1093bd)return undefined;const _0x5a141f=[CLI_BIN_NAME+'\x20'+_0x3aa24b+_0x3bbe84(0x1d4),'',_0x1093bd[_0x3bbe84(0x228)][_0x3bbe84(0x1fa)]||_0x3aa24b,_0x1093bd[_0x3bbe84(0x228)][_0x3bbe84(0x1ce)]?'\x20\x20'+_0x1093bd[_0x3bbe84(0x228)][_0x3bbe84(0x1ce)]:'','',_0x3bbe84(0x205),..._0x1093bd[_0x3bbe84(0x1e2)]['map'](_0x4e7fa0=>{const _0x25d8cc=_0x3bbe84,_0x4fa579=_0x4e7fa0[_0x25d8cc(0x1fc)][_0x25d8cc(0x1c3)](0x1)[_0x25d8cc(0x1e5)]('\x20'),_0x423d5e=_0x4e7fa0['risk']===_0x25d8cc(0x22d)?'':'\x20['+_0x4e7fa0[_0x25d8cc(0x1f7)]+']';return'\x20\x20'+_0x4fa579[_0x25d8cc(0x1fb)](0x18)+'\x20'+(_0x4e7fa0[_0x25d8cc(0x1ce)]||'')+_0x423d5e;}),'',_0x3bbe84(0x1e6)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x3aa24b+_0x3bbe84(0x1ec)]['filter'](Boolean);return _0x5a141f[_0x3bbe84(0x1e5)]('\x0a');}export function listDynamicServiceEntries(){const _0x1104b9=a39_0x394c;return listLocalServices()[_0x1104b9(0x1d6)](_0x575919=>{const _0x109fb5=_0x1104b9,_0x7c717f=_0x575919[_0x109fb5(0x221)];return{'service':_0x7c717f[_0x109fb5(0x228)][_0x109fb5(0x1f8)],'label':_0x7c717f['service'][_0x109fb5(0x1fa)]||_0x7c717f[_0x109fb5(0x228)][_0x109fb5(0x1f8)],'commands':_0x7c717f[_0x109fb5(0x1e2)][_0x109fb5(0x1d6)](_0x535a5e=>({'command':dynamicCommandName(_0x535a5e),'description':_0x535a5e[_0x109fb5(0x1ce)]||_0x109fb5(0x21f)+_0x535a5e[_0x109fb5(0x20b)],'tag':riskTag(_0x535a5e[_0x109fb5(0x1f7)])}))};});}export function getDynamicServiceEntry(_0x248157){const _0x2c93e8=a39_0x394c;return listDynamicServiceEntries()[_0x2c93e8(0x1c4)](_0x2000a2=>_0x2000a2['service']===_0x248157);}export function listDynamicServiceDefinitions(_0x15bae0){const _0x158fdd=a39_0x394c;return listLocalServiceTrees()['filter'](_0x2ece64=>!_0x15bae0||_0x2ece64[_0x158fdd(0x228)][_0x158fdd(0x1f8)]===_0x15bae0)[_0x158fdd(0x1f0)](_0x677afd=>_0x677afd[_0x158fdd(0x1e2)][_0x158fdd(0x1d6)](_0x222f17=>buildDynamicCommandDefinition(_0x677afd,_0x222f17)));}export function getDynamicServiceDefinitions(_0x16215f){const _0x1b1665=listDynamicServiceDefinitions(_0x16215f);return _0x1b1665['length']>0x0?_0x1b1665:undefined;}export function findDynamicServiceDefinition(_0x9448b6,_0x2ed4da){const _0x20b49f=a39_0x394c;return listDynamicServiceDefinitions(_0x9448b6)[_0x20b49f(0x1c4)](_0x202017=>_0x202017['command']===_0x2ed4da);}export function buildDynamicCommandDefinition(_0x5e535c,_0x8658f3){const _0x4b5a6f=a39_0x394c;return{'service':_0x5e535c[_0x4b5a6f(0x228)][_0x4b5a6f(0x1f8)],'command':dynamicCommandName(_0x8658f3),'description':_0x8658f3['description']||_0x4b5a6f(0x21f)+_0x8658f3[_0x4b5a6f(0x20b)],'risk':_0x8658f3[_0x4b5a6f(0x1f7)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x8658f3[_0x4b5a6f(0x1d0)][_0x4b5a6f(0x1d6)](_0x14f85c=>({'name':_0x14f85c[_0x4b5a6f(0x1fa)],'description':_0x14f85c['description']||_0x14f85c[_0x4b5a6f(0x1fa)],'required':_0x14f85c[_0x4b5a6f(0x212)]})),'flags':_0x8658f3['flags'][_0x4b5a6f(0x1d6)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x8658f3),async 'dryRun'(_0xf742a1){const _0x34981b=_0x4b5a6f,_0x3fdf77=await compilePlan(_0x8658f3,_0xf742a1);return{'method':_0x34981b(0x1ca),'url':_0x8658f3[_0x34981b(0x20b)],'body':{'target':targetPreview(_0x3fdf77),'params':_0x3fdf77[_0x34981b(0x1c9)]},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x8658f3[_0x34981b(0x20b)]};},async 'execute'(_0x85c409){const _0x39309c=_0x4b5a6f,_0x34627d=await compilePlan(_0x8658f3,_0x85c409),_0x13a50e=Date[_0x39309c(0x208)](),_0x1ee543=await executePlan(_0x34627d,_0x8658f3,_0x85c409),_0x2a8002=Date[_0x39309c(0x208)]()-_0x13a50e;return{'ok':!![],'data':{'service':_0x5e535c['service'],'command':_0x8658f3['cliPath'],'target':targetPreview(_0x34627d),'result':_0x1ee543,'elapsed':_0x2a8002},'message':_0x39309c(0x1cc)+_0x8658f3['cliPath']+_0x39309c(0x216)+_0x2a8002+'ms'};}};}function dynamicCommandName(_0x567e06){const _0x1e4543=a39_0x394c;return _0x567e06[_0x1e4543(0x1fc)][_0x1e4543(0x1c3)](0x1)[_0x1e4543(0x1e5)]('\x20');}function riskTag(_0x1ca161){const _0x13d682=a39_0x394c;return _0x1ca161===_0x13d682(0x22d)?'':_0x13d682(0x1c8)+_0x1ca161+']';}function flagToCommandFlag(_0x2430ed){const _0x276f99=a39_0x394c;return{'name':_0x2430ed[_0x276f99(0x219)],'type':_0x2430ed[_0x276f99(0x20c)]===_0x276f99(0x1fe)?_0x276f99(0x209):_0x2430ed[_0x276f99(0x20c)],'description':_0x2430ed[_0x276f99(0x1ce)]||_0x2430ed['name'],'required':_0x2430ed[_0x276f99(0x212)],'default':isPrimitiveFlagDefault(_0x2430ed['default'])?_0x2430ed[_0x276f99(0x21b)]:undefined,'enum':_0x2430ed[_0x276f99(0x211)]};}async function compilePlan(_0x1d6295,_0x3cc89a){const _0x38dbc1=a39_0x394c;return compileServiceTreeCommand(_0x1d6295,{'flags':_0x3cc89a[_0x38dbc1(0x229)],'args':_0x3cc89a[_0x38dbc1(0x1d0)],'context':await buildServiceContext(_0x1d6295,_0x3cc89a)});}async function buildServiceContext(_0x44b65d,_0x2f2027){const _0x30a2f9=a39_0x394c,_0x124393={'appCode':_0x2f2027['appCode'],'env':_0x2f2027[_0x30a2f9(0x1f2)],'envName':_0x2f2027['envName']};if(!usesRuntimeContext(_0x44b65d))return _0x124393;const _0xf34707=await getLoginUserInfo(),_0x352f2e=pickFirst(_0xf34707[_0x30a2f9(0x1d7)],_0xf34707['id']);return{..._0x124393,'user':_0xf34707,'userId':_0x352f2e,'id':_0xf34707['id'],'username':pickFirst(_0xf34707[_0x30a2f9(0x204)],_0xf34707[_0x30a2f9(0x1df)],_0xf34707['loginName']),'userName':_0xf34707[_0x30a2f9(0x1df)],'nickname':pickFirst(_0xf34707['nickname'],_0xf34707[_0x30a2f9(0x206)]),'nickName':_0xf34707[_0x30a2f9(0x206)],'tenantCode':_0xf34707[_0x30a2f9(0x1ff)],'employeeId':_0xf34707[_0x30a2f9(0x22a)]};}function usesRuntimeContext(_0x1ca1ae){const _0x2e3e27=a39_0x394c;return _0x1ca1ae[_0x2e3e27(0x1d2)][_0x2e3e27(0x1e7)](_0x231019=>typeof _0x231019[_0x2e3e27(0x1f3)]==='string'&&(_0x231019[_0x2e3e27(0x1f3)][_0x2e3e27(0x1eb)](_0x2e3e27(0x224))||_0x231019[_0x2e3e27(0x1f3)][_0x2e3e27(0x1eb)](_0x2e3e27(0x20e))));}function pickFirst(..._0x1dc730){const _0x444db7=a39_0x394c;return _0x1dc730[_0x444db7(0x1c4)](_0x415ad5=>_0x415ad5!==undefined&&_0x415ad5!==null);}function a39_0x2e63(){const _0x455c3e=['fromEntries','tree','appcode','3MPMPVD','userName','push','validation','commands','\x20\x20\x20\x20functionName:\x20','Unsupported\x20service\x20target\x20kind:\x20','join','Use\x20`','some','env','remainingArgs','dbtableConfig','startsWith','`\x20to\x20inspect\x20the\x20manifest.','appRef','\x20->\x20','251046pWBSOG','flatMap','target','envName','source','kind','sqlCode','appBindings','risk','code','Cannot\x20resolve\x20datatable\x20\x22','name','padEnd','fullPath','135fJtMPJ','json','tenantCode','\x20\x20SERVICE\x20TREE\x20TARGET','3LRYdiV','bffCode','boolean','username','Commands:','nickName','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','now','string','2448092hmAsbC','cliPath','type','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','ctx.','\x20\x20\x20\x20datatable:\x20','\x22\x20in\x20service\x20command\x20','enum','required','filter','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','command','\x20completed\x20in\x20','number','scriptName','cliName','operator','default','2784040xEzZEL','length','datatable','Run\x20service\x20command\x20','3479120sKEtPH','normalizedManifest','4255146zsjEfs','trim','context.','\x20\x20\x20\x20','appCode','datasetCode','service','rawFlags','employeeId','tableName','4174440jBFMUV','read','slice','find','const','app','entries','\x20\x20[','params','SERVICE_TREE','\x20\x20\x20\x20command:\x20','Service\x20command\x20','data','description','\x20\x20\x20\x20datasetCode:\x20','args','449090QslveL','mapTo','\x20\x20\x20\x20kind:\x20\x20\x20\x20','\x20<command>\x20[flags]','bffId','map','userId','\x20requires\x20target.functionName.','\x20\x20\x20\x20sqlCode:\x20','\x20requires\x20target.sqlCode.'];a39_0x2e63=function(){return _0x455c3e;};return a39_0x2e63();}function a39_0x394c(_0x232ffe,_0x506a9b){_0x232ffe=_0x232ffe-0x1c3;const _0x2e635b=a39_0x2e63();let _0x394c13=_0x2e635b[_0x232ffe];return _0x394c13;}async function executePlan(_0x4b25c0,_0x543d44,_0x3dfcd8){const _0x67b482=a39_0x394c;if(_0x4b25c0[_0x67b482(0x1f4)]===_0x67b482(0x1cd)){const _0x4c4ebd=await resolveDatasetCode(_0x4b25c0,_0x543d44,_0x3dfcd8);return executeData(_0x4c4ebd,_0x4b25c0[_0x67b482(0x215)],_0x4b25c0[_0x67b482(0x1c9)]);}if(_0x4b25c0[_0x67b482(0x1f4)]==='sql'){if(!_0x4b25c0[_0x67b482(0x1f5)])throw CliErrors['validation'](_0x67b482(0x1cc)+_0x543d44['cliPath']+_0x67b482(0x1da));return executeSdkSql(_0x4b25c0['sqlCode'],normalizeScalarParams(_0x4b25c0['params']));}if(_0x4b25c0[_0x67b482(0x1f4)]==='bff'){const _0x93964b=_0x4b25c0[_0x67b482(0x218)]||_0x4b25c0[_0x67b482(0x202)]||(_0x4b25c0['bffId']==null?'':String(_0x4b25c0[_0x67b482(0x1d5)]));if(!_0x93964b)throw CliErrors[_0x67b482(0x1e1)]('Service\x20command\x20'+_0x543d44[_0x67b482(0x20b)]+_0x67b482(0x1d8));return executeSdkBff(_0x93964b,_0x4b25c0[_0x67b482(0x1c9)]);}throw CliErrors[_0x67b482(0x1e1)](_0x67b482(0x1e4)+_0x4b25c0[_0x67b482(0x1f4)]);}async function resolveDatasetCode(_0x5804b4,_0x1e8baf,_0xbd66e0){const _0x3574da=a39_0x394c;if(_0x5804b4[_0x3574da(0x227)])return _0x5804b4[_0x3574da(0x227)];if(!_0x5804b4['datatable'])throw CliErrors[_0x3574da(0x1e1)](_0x3574da(0x1cc)+_0x1e8baf['cliPath']+_0x3574da(0x20d));const _0x4690eb=await listDatasets(_0xbd66e0['appCode']),_0x30a07f=_0x4690eb[_0x3574da(0x1c4)](_0x31982a=>_0x31982a[_0x3574da(0x1ea)]?.[_0x3574da(0x22b)]===_0x5804b4['datatable']);if(!_0x30a07f?.[_0x3574da(0x1f8)])throw CliErrors[_0x3574da(0x1e1)](_0x3574da(0x1f9)+_0x5804b4[_0x3574da(0x21e)]+_0x3574da(0x214)+_0xbd66e0[_0x3574da(0x226)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x30a07f[_0x3574da(0x1f8)];}function applyAppBinding(_0x12a220,_0x336270,_0x33ade2){const _0x17b9ed=a39_0x394c,_0x165dd1=_0x336270['target'][_0x17b9ed(0x1ed)];if(!_0x165dd1)return;const _0x1bb899=_0x12a220[_0x17b9ed(0x1f6)][_0x165dd1];if(!_0x1bb899)throw CliErrors[_0x17b9ed(0x1e1)]('Unknown\x20appRef\x20\x22'+_0x165dd1+_0x17b9ed(0x210)+_0x336270[_0x17b9ed(0x20b)]+'.',_0x17b9ed(0x207));const _0x1699af=_0x1bb899['appcode']||_0x1bb899[_0x17b9ed(0x226)];_0x1699af&&!hasText(_0x33ade2[_0x17b9ed(0x1dd)])&&(_0x33ade2[_0x17b9ed(0x1dd)]=_0x1699af),_0x1bb899['app']&&!hasText(_0x33ade2[_0x17b9ed(0x1c6)])&&!hasText(_0x33ade2[_0x17b9ed(0x1dd)])&&(_0x33ade2[_0x17b9ed(0x1c6)]=_0x1bb899[_0x17b9ed(0x1c6)]),_0x1bb899[_0x17b9ed(0x1e8)]&&!hasText(_0x33ade2[_0x17b9ed(0x1e8)])&&(_0x33ade2['env']=_0x1bb899['env']);}function renderDynamicCommandHelp(_0xb622c9){const _0x5607dc=a39_0x394c,_0x1eeabe=[_0x5607dc(0x200),_0x5607dc(0x1d3)+_0xb622c9[_0x5607dc(0x1f1)][_0x5607dc(0x1f4)],_0x5607dc(0x1cb)+_0xb622c9[_0x5607dc(0x1f1)][_0x5607dc(0x215)]];if(_0xb622c9[_0x5607dc(0x1f1)][_0x5607dc(0x227)])_0x1eeabe[_0x5607dc(0x1e0)](_0x5607dc(0x1cf)+_0xb622c9[_0x5607dc(0x1f1)][_0x5607dc(0x227)]);if(_0xb622c9[_0x5607dc(0x1f1)][_0x5607dc(0x21e)])_0x1eeabe[_0x5607dc(0x1e0)](_0x5607dc(0x20f)+_0xb622c9[_0x5607dc(0x1f1)][_0x5607dc(0x21e)]);if(_0xb622c9[_0x5607dc(0x1f1)]['sqlCode'])_0x1eeabe[_0x5607dc(0x1e0)](_0x5607dc(0x1d9)+_0xb622c9[_0x5607dc(0x1f1)][_0x5607dc(0x1f5)]);if(_0xb622c9[_0x5607dc(0x1f1)][_0x5607dc(0x218)])_0x1eeabe[_0x5607dc(0x1e0)](_0x5607dc(0x1e3)+_0xb622c9[_0x5607dc(0x1f1)]['scriptName']);if(_0xb622c9[_0x5607dc(0x1d2)][_0x5607dc(0x21d)]>0x0){_0x1eeabe[_0x5607dc(0x1e0)]('','\x20\x20MAP\x20TO');for(const _0x4463b1 of _0xb622c9[_0x5607dc(0x1d2)]){_0x1eeabe[_0x5607dc(0x1e0)](_0x5607dc(0x225)+(_0x4463b1['source']||_0x5607dc(0x1c5))+_0x5607dc(0x1ee)+_0x4463b1[_0x5607dc(0x1f1)]+(_0x4463b1[_0x5607dc(0x21a)]?'.'+_0x4463b1[_0x5607dc(0x21a)]:''));}}return _0x1eeabe[_0x5607dc(0x1e5)]('\x0a');}function targetPreview(_0x567932){const _0x5436e8=a39_0x394c;return{'kind':_0x567932[_0x5436e8(0x1f4)],'command':_0x567932[_0x5436e8(0x215)],'appRef':_0x567932[_0x5436e8(0x1ed)],'datasetCode':_0x567932['datasetCode'],'datatable':_0x567932[_0x5436e8(0x21e)],'sqlCode':_0x567932[_0x5436e8(0x1f5)],'bffCode':_0x567932[_0x5436e8(0x202)],'bffId':_0x567932[_0x5436e8(0x1d5)],'functionName':_0x567932[_0x5436e8(0x218)]};}function normalizeScalarParams(_0x2b352c){const _0x5ce3df=a39_0x394c;return Object[_0x5ce3df(0x1db)](Object[_0x5ce3df(0x1c7)](_0x2b352c)[_0x5ce3df(0x213)](([,_0x18c04b])=>typeof _0x18c04b===_0x5ce3df(0x209)||typeof _0x18c04b===_0x5ce3df(0x217)));}function hasText(_0x4f8f31){const _0xa137c7=a39_0x394c;return typeof _0x4f8f31===_0xa137c7(0x209)&&_0x4f8f31[_0xa137c7(0x223)]()[_0xa137c7(0x21d)]>0x0;}function isPrimitiveFlagDefault(_0x53a435){const _0x40c144=a39_0x394c;return _0x53a435===undefined||typeof _0x53a435===_0x40c144(0x209)||typeof _0x53a435==='number'||typeof _0x53a435===_0x40c144(0x203);}
@@ -0,0 +1,13 @@
1
+ import type { NormalizedServiceTree, ServiceTreeManifest, ServiceTreeValidationIssue } from "@lovrabet/cli-framework";
2
+ interface LegacyFrameworkAdaptation {
3
+ manifest: ServiceTreeManifest;
4
+ errors: ServiceTreeValidationIssue[];
5
+ }
6
+ /**
7
+ * Keeps functionName as the runtime CLI contract while adapting to the current
8
+ * cli-framework release, whose Service Tree model still calls this field scriptName.
9
+ */
10
+ export declare function adaptServiceTreeManifestForLegacyFramework(input: unknown): LegacyFrameworkAdaptation;
11
+ export declare function toPublicServiceTreeTarget(target: Record<string, unknown>): Record<string, unknown>;
12
+ export declare function toPublicNormalizedServiceTree(tree: NormalizedServiceTree): Record<string, unknown>;
13
+ export {};
@@ -1 +1 @@
1
- (function(_0x46ce0f,_0x572b99){const _0xcf765e=a39_0x46aa,_0x59139f=_0x46ce0f();while(!![]){try{const _0x5d3821=-parseInt(_0xcf765e(0xb5))/0x1*(-parseInt(_0xcf765e(0xab))/0x2)+parseInt(_0xcf765e(0xc1))/0x3*(parseInt(_0xcf765e(0xb4))/0x4)+-parseInt(_0xcf765e(0xa9))/0x5*(-parseInt(_0xcf765e(0xb3))/0x6)+-parseInt(_0xcf765e(0xbe))/0x7*(parseInt(_0xcf765e(0xaa))/0x8)+parseInt(_0xcf765e(0xcc))/0x9+-parseInt(_0xcf765e(0xb8))/0xa*(parseInt(_0xcf765e(0xc4))/0xb)+parseInt(_0xcf765e(0xc6))/0xc;if(_0x5d3821===_0x572b99)break;else _0x59139f['push'](_0x59139f['shift']());}catch(_0x3fec65){_0x59139f['push'](_0x59139f['shift']());}}}(a39_0x66f7,0xe10c6));export function adaptServiceTreeManifestForLegacyFramework(_0x4c2786){const _0x2a3022=a39_0x46aa,_0x579e62=cloneJsonValue(_0x4c2786),_0x234801=[];if(!isObjectRecord(_0x579e62))return{'manifest':_0x579e62,'errors':_0x234801};return Array['isArray'](_0x579e62[_0x2a3022(0xcd)])&&_0x579e62['commands'][_0x2a3022(0xc0)]((_0x152903,_0x4d0ab8)=>{const _0x52011c=_0x2a3022;if(!isObjectRecord(_0x152903))return;adaptBffTarget(_0x152903[_0x52011c(0xca)],'$.commands['+_0x4d0ab8+_0x52011c(0xc2),_0x234801);}),adaptResources(_0x579e62[_0x2a3022(0xc8)],_0x2a3022(0xbb),_0x234801),{'manifest':_0x579e62,'errors':_0x234801};}export function toPublicServiceTreeTarget(_0x1f54d3){const _0x5aab61=a39_0x46aa,{scriptName:_0x1b3df4,..._0x35efb9}=_0x1f54d3;return typeof _0x1b3df4===_0x5aab61(0xc5)&&_0x1b3df4[_0x5aab61(0xcb)]()&&(_0x35efb9[_0x5aab61(0xc7)]=_0x1b3df4),_0x35efb9;}export function toPublicNormalizedServiceTree(_0x3707b4){const _0x6be4e9=a39_0x46aa;return{..._0x3707b4,'commands':_0x3707b4[_0x6be4e9(0xcd)]['map'](_0x474da6=>({..._0x474da6,'target':toPublicServiceTreeTarget(_0x474da6['target'])}))};}function adaptResources(_0x2148f0,_0x4f44e9,_0x1bf36e){const _0x1d022b=a39_0x46aa;if(!isObjectRecord(_0x2148f0))return;for(const [_0x375935,_0x56e2bd]of Object[_0x1d022b(0xad)](_0x2148f0)){if(!isObjectRecord(_0x56e2bd))continue;const _0x4c5b18=_0x4f44e9+'.'+_0x375935;if(isObjectRecord(_0x56e2bd['actions']))for(const [_0x2b2e90,_0x5d5c27]of Object['entries'](_0x56e2bd[_0x1d022b(0xc9)])){if(!isObjectRecord(_0x5d5c27))continue;const _0x288222=_0x4c5b18+_0x1d022b(0xbf)+_0x2b2e90,_0x187a1c=isObjectRecord(_0x5d5c27[_0x1d022b(0xca)])&&_0x5d5c27[_0x1d022b(0xca)][_0x1d022b(0xb0)]===_0x1d022b(0xb2);adaptBffTarget(_0x5d5c27['target'],_0x288222+'.target',_0x1bf36e),(_0x187a1c||isBffAction(_0x5d5c27))&&adaptFunctionNameField(_0x5d5c27,_0x288222,_0x1bf36e);}adaptResources(_0x56e2bd[_0x1d022b(0xc8)],_0x4c5b18+'.resources',_0x1bf36e);}}function adaptBffTarget(_0x165924,_0x4bee60,_0x585da5){const _0x2c30ab=a39_0x46aa;if(!isObjectRecord(_0x165924)||_0x165924['kind']!==_0x2c30ab(0xb2))return;adaptFunctionNameField(_0x165924,_0x4bee60,_0x585da5);}function adaptFunctionNameField(_0x1399e5,_0x1241f6,_0x5f3f1a){const _0x59cb96=a39_0x46aa;Object[_0x59cb96(0xbc)][_0x59cb96(0xc3)]['call'](_0x1399e5,_0x59cb96(0xb6))&&_0x5f3f1a['push']({'level':_0x59cb96(0xaf),'path':_0x1241f6+'.scriptName','message':'Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.'});if(Object[_0x59cb96(0xbc)]['hasOwnProperty'][_0x59cb96(0xb9)](_0x1399e5,_0x59cb96(0xc7))){if(typeof _0x1399e5[_0x59cb96(0xc7)]!==_0x59cb96(0xc5)||!_0x1399e5[_0x59cb96(0xc7)][_0x59cb96(0xcb)]()){_0x5f3f1a[_0x59cb96(0xb7)]({'level':_0x59cb96(0xaf),'path':_0x1241f6+_0x59cb96(0xba),'message':_0x59cb96(0xb1)}),delete _0x1399e5[_0x59cb96(0xc7)];return;}_0x1399e5['scriptName']=_0x1399e5['functionName'],delete _0x1399e5['functionName'];}}function a39_0x46aa(_0x1f228a,_0x18cd58){_0x1f228a=_0x1f228a-0xa9;const _0x66f72e=a39_0x66f7();let _0x46aa03=_0x66f72e[_0x1f228a];return _0x46aa03;}function isBffAction(_0x5bd89c){const _0x959b6b=a39_0x46aa;return _0x5bd89c[_0x959b6b(0xb0)]==='bff'||_0x5bd89c[_0x959b6b(0xac)]===_0x959b6b(0xce)||_0x5bd89c[_0x959b6b(0xca)]===_0x959b6b(0xce);}function cloneJsonValue(_0x5221ab){const _0x33ea56=a39_0x46aa;if(Array[_0x33ea56(0xcf)](_0x5221ab))return _0x5221ab[_0x33ea56(0xbd)](_0x249f23=>cloneJsonValue(_0x249f23));if(isObjectRecord(_0x5221ab))return Object[_0x33ea56(0xae)](Object['entries'](_0x5221ab)[_0x33ea56(0xbd)](([_0x143d64,_0x817f0f])=>[_0x143d64,cloneJsonValue(_0x817f0f)]));return _0x5221ab;}function a39_0x66f7(){const _0x5b9d4e=['push','1821610lUNYXL','call','.functionName','$.resources','prototype','map','1806VAsEcD','.actions.','forEach','21492PXsDCU','].target','hasOwnProperty','88rygQVy','string','8282784chHWHg','functionName','resources','actions','target','trim','1877139YwsoQZ','commands','bff.exec','isArray','284830ocdDBb','45624PfanCa','97178usqfqD','action','entries','fromEntries','error','kind','functionName\x20must\x20be\x20a\x20non-empty\x20string.','bff','30qWhova','648KutHDT','31GQsJfW','scriptName'];a39_0x66f7=function(){return _0x5b9d4e;};return a39_0x66f7();}function isObjectRecord(_0x4367cd){const _0x562b80=a39_0x46aa;return Boolean(_0x4367cd)&&typeof _0x4367cd==='object'&&!Array[_0x562b80(0xcf)](_0x4367cd);}
1
+ (function(_0x553d97,_0x36bfff){const _0x39378e=a40_0xbbfd,_0x3723f8=_0x553d97();while(!![]){try{const _0xa40f5e=-parseInt(_0x39378e(0xc5))/0x1*(-parseInt(_0x39378e(0xc2))/0x2)+parseInt(_0x39378e(0xb4))/0x3*(parseInt(_0x39378e(0xb5))/0x4)+-parseInt(_0x39378e(0xbc))/0x5+parseInt(_0x39378e(0xa6))/0x6+-parseInt(_0x39378e(0xc3))/0x7+-parseInt(_0x39378e(0xc6))/0x8+parseInt(_0x39378e(0xc7))/0x9;if(_0xa40f5e===_0x36bfff)break;else _0x3723f8['push'](_0x3723f8['shift']());}catch(_0x5a051a){_0x3723f8['push'](_0x3723f8['shift']());}}}(a40_0x6a7a,0x5edd6));export function adaptServiceTreeManifestForLegacyFramework(_0x4677ab){const _0x1392ef=a40_0xbbfd,_0x55a330=cloneJsonValue(_0x4677ab),_0x21eb93=[];if(!isObjectRecord(_0x55a330))return{'manifest':_0x55a330,'errors':_0x21eb93};return Array['isArray'](_0x55a330[_0x1392ef(0xbb)])&&_0x55a330[_0x1392ef(0xbb)][_0x1392ef(0xae)]((_0xc69568,_0x583da1)=>{const _0x5804d1=_0x1392ef;if(!isObjectRecord(_0xc69568))return;adaptBffTarget(_0xc69568[_0x5804d1(0xbd)],'$.commands['+_0x583da1+_0x5804d1(0xa9),_0x21eb93);}),adaptResources(_0x55a330[_0x1392ef(0xaa)],_0x1392ef(0xb0),_0x21eb93),{'manifest':_0x55a330,'errors':_0x21eb93};}export function toPublicServiceTreeTarget(_0x4b712a){const _0x533724=a40_0xbbfd,{scriptName:_0x5a7fd0,..._0x1cb813}=_0x4b712a;return typeof _0x5a7fd0===_0x533724(0xa8)&&_0x5a7fd0[_0x533724(0xa7)]()&&(_0x1cb813['functionName']=_0x5a7fd0),_0x1cb813;}export function toPublicNormalizedServiceTree(_0xf8a853){const _0x258b64=a40_0xbbfd;return{..._0xf8a853,'commands':_0xf8a853[_0x258b64(0xbb)][_0x258b64(0xb1)](_0x58f283=>({..._0x58f283,'target':toPublicServiceTreeTarget(_0x58f283[_0x258b64(0xbd)])}))};}function adaptResources(_0x596ced,_0x5e8214,_0x3223b9){const _0x25de8c=a40_0xbbfd;if(!isObjectRecord(_0x596ced))return;for(const [_0x1987c1,_0x8a3a8e]of Object[_0x25de8c(0xbf)](_0x596ced)){if(!isObjectRecord(_0x8a3a8e))continue;const _0x12e11b=_0x5e8214+'.'+_0x1987c1;if(isObjectRecord(_0x8a3a8e[_0x25de8c(0xb7)]))for(const [_0x286da5,_0x1c822a]of Object['entries'](_0x8a3a8e['actions'])){if(!isObjectRecord(_0x1c822a))continue;const _0x4433a0=_0x12e11b+'.actions.'+_0x286da5,_0x234f04=isObjectRecord(_0x1c822a['target'])&&_0x1c822a['target'][_0x25de8c(0xac)]==='bff';adaptBffTarget(_0x1c822a[_0x25de8c(0xbd)],_0x4433a0+'.target',_0x3223b9),(_0x234f04||isBffAction(_0x1c822a))&&adaptFunctionNameField(_0x1c822a,_0x4433a0,_0x3223b9);}adaptResources(_0x8a3a8e[_0x25de8c(0xaa)],_0x12e11b+_0x25de8c(0xb9),_0x3223b9);}}function adaptBffTarget(_0x368123,_0x59183b,_0x50af1f){const _0x5c549d=a40_0xbbfd;if(!isObjectRecord(_0x368123)||_0x368123[_0x5c549d(0xac)]!==_0x5c549d(0xba))return;adaptFunctionNameField(_0x368123,_0x59183b,_0x50af1f);}function adaptFunctionNameField(_0x2d5c0a,_0x17d7b8,_0x4a0215){const _0x636249=a40_0xbbfd;Object[_0x636249(0xa4)][_0x636249(0xb6)][_0x636249(0xab)](_0x2d5c0a,'scriptName')&&_0x4a0215['push']({'level':'error','path':_0x17d7b8+'.scriptName','message':_0x636249(0xad)});if(Object[_0x636249(0xa4)]['hasOwnProperty'][_0x636249(0xab)](_0x2d5c0a,'functionName')){if(typeof _0x2d5c0a[_0x636249(0xc1)]!==_0x636249(0xa8)||!_0x2d5c0a[_0x636249(0xc1)]['trim']()){_0x4a0215[_0x636249(0xbe)]({'level':_0x636249(0xa5),'path':_0x17d7b8+'.functionName','message':_0x636249(0xc0)}),delete _0x2d5c0a[_0x636249(0xc1)];return;}_0x2d5c0a[_0x636249(0xc4)]=_0x2d5c0a[_0x636249(0xc1)],delete _0x2d5c0a[_0x636249(0xc1)];}}function isBffAction(_0x57bf06){const _0xc4ec58=a40_0xbbfd;return _0x57bf06[_0xc4ec58(0xac)]==='bff'||_0x57bf06[_0xc4ec58(0xb8)]===_0xc4ec58(0xb2)||_0x57bf06[_0xc4ec58(0xbd)]==='bff.exec';}function cloneJsonValue(_0x33e793){const _0x306ca2=a40_0xbbfd;if(Array[_0x306ca2(0xaf)](_0x33e793))return _0x33e793[_0x306ca2(0xb1)](_0x5475d8=>cloneJsonValue(_0x5475d8));if(isObjectRecord(_0x33e793))return Object[_0x306ca2(0xb3)](Object[_0x306ca2(0xbf)](_0x33e793)[_0x306ca2(0xb1)](([_0x4464a7,_0x3a950e])=>[_0x4464a7,cloneJsonValue(_0x3a950e)]));return _0x33e793;}function a40_0xbbfd(_0x185084,_0x435a2d){_0x185084=_0x185084-0xa4;const _0x6a7af2=a40_0x6a7a();let _0xbbfd12=_0x6a7af2[_0x185084];return _0xbbfd12;}function a40_0x6a7a(){const _0x23d38c=['575032eGksZx','6027444BFaWvR','prototype','error','2318850jCvQTI','trim','string','].target','resources','call','kind','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','forEach','isArray','$.resources','map','bff.exec','fromEntries','123zqTFoW','6768hXBBiN','hasOwnProperty','actions','action','.resources','bff','commands','491600iiKMBs','target','push','entries','functionName\x20must\x20be\x20a\x20non-empty\x20string.','functionName','322646HMlOVD','5096847WjcKjn','scriptName','1mbUclk'];a40_0x6a7a=function(){return _0x23d38c;};return a40_0x6a7a();}function isObjectRecord(_0x3be07f){return Boolean(_0x3be07f)&&typeof _0x3be07f==='object'&&!Array['isArray'](_0x3be07f);}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const serviceDefinitions: CommandDefinition[];
@@ -1 +1 @@
1
- const a40_0x257e54=a40_0x22ea;(function(_0x5c82d6,_0x1234c9){const _0x5da70d=a40_0x22ea,_0x7540ea=_0x5c82d6();while(!![]){try{const _0x11dc69=parseInt(_0x5da70d(0x187))/0x1*(-parseInt(_0x5da70d(0x1b3))/0x2)+parseInt(_0x5da70d(0x1cb))/0x3*(parseInt(_0x5da70d(0x1a4))/0x4)+parseInt(_0x5da70d(0x1bd))/0x5*(-parseInt(_0x5da70d(0x197))/0x6)+parseInt(_0x5da70d(0x1a5))/0x7+parseInt(_0x5da70d(0x19a))/0x8+-parseInt(_0x5da70d(0x1b1))/0x9*(parseInt(_0x5da70d(0x1bf))/0xa)+parseInt(_0x5da70d(0x1cd))/0xb*(parseInt(_0x5da70d(0x190))/0xc);if(_0x11dc69===_0x1234c9)break;else _0x7540ea['push'](_0x7540ea['shift']());}catch(_0x53b196){_0x7540ea['push'](_0x7540ea['shift']());}}}(a40_0xa7b4,0xc9e2d));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';function a40_0x22ea(_0x2e52d2,_0x26c549){_0x2e52d2=_0x2e52d2-0x187;const _0xa7b481=a40_0xa7b4();let _0x22ea88=_0xa7b481[_0x2e52d2];return _0x22ea88;}function a40_0xa7b4(){const _0x2f1d0f=['required','remove','Service\x20Tree\x20manifest\x20file\x20path','entries','WRITE','report','map','length','2628NNGSDD','2021362KLlUFj','warnings','hash','name','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','errors','str','Imported\x20','commands','target','registryServiceCode','registryPath','27lWmbqM','list','148388OoTCxN','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','manifests','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','entry','serviceCount','Local\x20service\x20not\x20found:\x20','service','replaced','Imported','5ptQgcF','file','5224250dAGUUo','flags','normalizedManifest','validate','type','reduce','\x20service(s),\x20updated\x20','source','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','kind','serviceCode','lower\x20kebab-case\x20service\x20code','7482NzOodb','read','1474opDrZS','filePath','Service\x20manifest\x20validation\x20passed.','description','20dZvBav','\x20service(s).','write','export','version','detail','registryIndex','Exported\x20service\x20','Updated','92160wvoirL','string','imported','updated','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','manifest','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','627528HKGcMA','risk','cliName','8209792UeJwgs','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest'];a40_0xa7b4=function(){return _0x2f1d0f;};return a40_0xa7b4();}const FILE_FLAG={'name':'file','type':a40_0x257e54(0x191),'required':!![],'description':a40_0x257e54(0x19e)},SERVICE_FLAG={'name':a40_0x257e54(0x1ba),'type':'string','required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a40_0x257e54(0x1ca)}};function summarizeService(_0x477dfd){const _0x18e128=a40_0x257e54;return{'serviceCode':_0x477dfd['serviceCode'],'name':_0x477dfd[_0x18e128(0x1c1)]['service'][_0x18e128(0x1a8)],'version':_0x477dfd[_0x18e128(0x18b)],'importedAt':_0x477dfd['importedAt'],'source':_0x477dfd[_0x18e128(0x1c6)],'commandCount':_0x477dfd[_0x18e128(0x1c1)]['commands'][_0x18e128(0x1a3)],'commands':_0x477dfd[_0x18e128(0x1c1)][_0x18e128(0x1ad)][_0x18e128(0x1a2)](_0x2b1f96=>({'path':_0x2b1f96['cliPath'],'description':_0x2b1f96[_0x18e128(0x1d0)],'risk':_0x2b1f96[_0x18e128(0x198)],'target':toPublicServiceTreeTarget(_0x2b1f96[_0x18e128(0x1ae)]),'flags':_0x2b1f96[_0x18e128(0x1c0)][_0x18e128(0x1a2)](_0x4d6f96=>({'name':_0x4d6f96[_0x18e128(0x1a8)],'cliName':_0x4d6f96[_0x18e128(0x199)],'type':_0x4d6f96[_0x18e128(0x1c3)],'required':_0x4d6f96[_0x18e128(0x19c)]===!![]}))}))};}function summarizeLoadedManifest(_0x18cde4){const _0x71249d=a40_0x257e54;return{'service':_0x18cde4['normalizedManifest']?.[_0x71249d(0x1ba)],'version':_0x18cde4[_0x71249d(0x1c1)]?.['version'],'commandCount':_0x18cde4[_0x71249d(0x1c1)]?.[_0x71249d(0x1ad)]['length']??0x0,'commands':_0x18cde4['normalizedManifest']?.['commands'][_0x71249d(0x1a2)](_0x5b1f5e=>({'path':_0x5b1f5e['cliPath'],'risk':_0x5b1f5e[_0x71249d(0x198)],'target':toPublicServiceTreeTarget(_0x5b1f5e[_0x71249d(0x1ae)])}))??[],'registryIndex':_0x18cde4[_0x71249d(0x18d)],'registryServiceCode':_0x18cde4[_0x71249d(0x1af)],'errors':_0x18cde4[_0x71249d(0x1a1)]['errors'],'warnings':_0x18cde4['report'][_0x71249d(0x1a6)]};}export const serviceDefinitions=[{'service':'service','command':a40_0x257e54(0x1c2),'description':a40_0x257e54(0x19b),'risk':a40_0x257e54(0x1cc),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x2fe474){const _0xc282bc=a40_0x257e54,_0x4d3fcc=loadServiceManifestFromFile(_0x2fe474[_0xc282bc(0x1ab)](_0xc282bc(0x1be)));if(!_0x4d3fcc['report']['ok'])return{'ok':![],'data':{'file':_0x4d3fcc[_0xc282bc(0x1ce)],'hash':_0x4d3fcc[_0xc282bc(0x1a7)],'kind':_0x4d3fcc[_0xc282bc(0x1c8)],'serviceCount':_0x4d3fcc[_0xc282bc(0x1b5)][_0xc282bc(0x1a3)],'services':_0x4d3fcc[_0xc282bc(0x1b5)][_0xc282bc(0x1a2)](summarizeLoadedManifest),'errors':_0x4d3fcc[_0xc282bc(0x1a1)]['errors'],'warnings':_0x4d3fcc[_0xc282bc(0x1a1)][_0xc282bc(0x1a6)]},'message':formatValidationFailure(_0x4d3fcc[_0xc282bc(0x1a1)])};if(_0x4d3fcc[_0xc282bc(0x1c8)]==='registry'||_0x4d3fcc['manifests'][_0xc282bc(0x1a3)]!==0x1)return{'ok':!![],'data':{'file':_0x4d3fcc[_0xc282bc(0x1ce)],'hash':_0x4d3fcc[_0xc282bc(0x1a7)],'kind':_0x4d3fcc[_0xc282bc(0x1c8)],'serviceCount':_0x4d3fcc['manifests'][_0xc282bc(0x1a3)],'commandCount':_0x4d3fcc['manifests'][_0xc282bc(0x1c4)]((_0x1be7e0,_0x5bb72a)=>_0x1be7e0+(_0x5bb72a['normalizedManifest']?.['commands'][_0xc282bc(0x1a3)]??0x0),0x0),'services':_0x4d3fcc['manifests'][_0xc282bc(0x1a2)](summarizeLoadedManifest),'warnings':_0x4d3fcc[_0xc282bc(0x1a1)][_0xc282bc(0x1a6)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x4d3fcc[_0xc282bc(0x1ce)],'hash':_0x4d3fcc[_0xc282bc(0x1a7)],'kind':_0x4d3fcc[_0xc282bc(0x1c8)],'service':_0x4d3fcc['normalizedManifest']?.[_0xc282bc(0x1ba)],'version':_0x4d3fcc[_0xc282bc(0x1c1)]?.['version'],'commandCount':_0x4d3fcc[_0xc282bc(0x1c1)]?.[_0xc282bc(0x1ad)][_0xc282bc(0x1a3)]??0x0,'commands':_0x4d3fcc['normalizedManifest']?.[_0xc282bc(0x1ad)]['map'](_0x32f2f7=>({'path':_0x32f2f7['cliPath'],'risk':_0x32f2f7[_0xc282bc(0x198)],'target':toPublicServiceTreeTarget(_0x32f2f7['target'])})),'warnings':_0x4d3fcc[_0xc282bc(0x1a1)][_0xc282bc(0x1a6)]},'message':_0xc282bc(0x1cf)};}},{'service':a40_0x257e54(0x1ba),'command':'import','description':a40_0x257e54(0x1a9),'risk':a40_0x257e54(0x189),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x2dd9e7){const _0x1e51b1=a40_0x257e54,_0x4ef148=loadServiceManifestFromFile(_0x2dd9e7['str'](_0x1e51b1(0x1be)));return{'method':_0x1e51b1(0x1a0),'url':getServiceRegistryPath(),'body':{'file':_0x4ef148[_0x1e51b1(0x1ce)],'hash':_0x4ef148[_0x1e51b1(0x1a7)],'kind':_0x4ef148[_0x1e51b1(0x1c8)],'ok':_0x4ef148['report']['ok'],'service':_0x4ef148[_0x1e51b1(0x1c1)]?.[_0x1e51b1(0x1ba)],'version':_0x4ef148['normalizedManifest']?.['version'],'serviceCount':_0x4ef148[_0x1e51b1(0x1b5)]['length'],'services':_0x4ef148['manifests'][_0x1e51b1(0x1a2)](_0x5e9699=>({'service':_0x5e9699[_0x1e51b1(0x1c1)]?.['service'],'version':_0x5e9699[_0x1e51b1(0x1c1)]?.[_0x1e51b1(0x18b)],'commandCount':_0x5e9699[_0x1e51b1(0x1c1)]?.['commands']['length']??0x0,'errors':_0x5e9699[_0x1e51b1(0x1a1)][_0x1e51b1(0x1aa)]})),'errors':_0x4ef148[_0x1e51b1(0x1a1)][_0x1e51b1(0x1aa)],'commandCount':_0x4ef148[_0x1e51b1(0x1c1)]?.[_0x1e51b1(0x1ad)]['length']??0x0},'description':_0x1e51b1(0x196)};},async 'execute'(_0x6a459){const _0x547695=a40_0x257e54,_0x511557=importServiceManifest(_0x6a459[_0x547695(0x1ab)]('file'));if(_0x511557[_0x547695(0x19f)][_0x547695(0x1a3)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x511557[_0x547695(0x1b0)],'imported':_0x511557[_0x547695(0x192)],'updated':_0x511557[_0x547695(0x193)],'serviceCount':_0x511557[_0x547695(0x1b8)],'services':_0x511557[_0x547695(0x19f)][_0x547695(0x1a2)](summarizeService)},'message':_0x547695(0x1ac)+_0x511557[_0x547695(0x192)]+_0x547695(0x1c5)+_0x511557[_0x547695(0x193)]+_0x547695(0x188)};return{'ok':!![],'data':{'registryPath':_0x511557[_0x547695(0x1b0)],'replaced':_0x511557[_0x547695(0x1bb)],'imported':_0x511557[_0x547695(0x192)],'updated':_0x511557[_0x547695(0x193)],'serviceCount':_0x511557[_0x547695(0x1b8)],'service':summarizeService(_0x511557[_0x547695(0x1b7)])},'message':(_0x511557['replaced']?_0x547695(0x18f):_0x547695(0x1bc))+'\x20service\x20'+_0x511557[_0x547695(0x1b7)][_0x547695(0x1c9)]+'.'};}},{'service':'service','command':a40_0x257e54(0x18a),'description':a40_0x257e54(0x1b4),'risk':a40_0x257e54(0x189),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x387731){const _0x3be064=a40_0x257e54,_0x1a3e0d=getLocalServiceEntry(_0x387731[_0x3be064(0x1ab)](_0x3be064(0x1ba)));return{'method':_0x3be064(0x1a0),'url':_0x387731[_0x3be064(0x1ab)](_0x3be064(0x1be)),'body':{'service':_0x387731[_0x3be064(0x1ab)](_0x3be064(0x1ba)),'found':Boolean(_0x1a3e0d),'version':_0x1a3e0d?.[_0x3be064(0x18b)],'source':_0x1a3e0d?.[_0x3be064(0x1c6)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x166050){const _0x8d0967=a40_0x257e54,_0x55e951=exportServiceManifest(_0x166050['str'](_0x8d0967(0x1ba)),_0x166050[_0x8d0967(0x1ab)]('file'));return{'ok':!![],'data':{'registryPath':_0x55e951[_0x8d0967(0x1b0)],'file':_0x55e951[_0x8d0967(0x1ce)],'service':summarizeService(_0x55e951[_0x8d0967(0x1b7)])},'message':_0x8d0967(0x18e)+_0x55e951['entry'][_0x8d0967(0x1c9)]+'.'};}},{'service':a40_0x257e54(0x1ba),'command':a40_0x257e54(0x1b2),'description':a40_0x257e54(0x194),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x594ac1=a40_0x257e54,_0xe33d04=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0xe33d04[_0x594ac1(0x1a3)],'services':_0xe33d04[_0x594ac1(0x1a2)](summarizeService)}};}},{'service':'service','command':a40_0x257e54(0x19d),'description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a40_0x257e54(0x189),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0xd37a4){const _0x5e61e7=a40_0x257e54,_0x2e1e25=getLocalServiceEntry(_0xd37a4[_0x5e61e7(0x1ab)]('service'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0xd37a4[_0x5e61e7(0x1ab)](_0x5e61e7(0x1ba)),'found':Boolean(_0x2e1e25),'version':_0x2e1e25?.[_0x5e61e7(0x18b)],'source':_0x2e1e25?.['source']},'description':_0x5e61e7(0x1c7)};},async 'execute'(_0x246347){const _0x18c6e0=a40_0x257e54,_0x3d4645=removeServiceManifest(_0x246347['str']('service'));return{'ok':!![],'data':{'registryPath':_0x3d4645[_0x18c6e0(0x1b0)],'serviceCount':_0x3d4645[_0x18c6e0(0x1b8)],'service':summarizeService(_0x3d4645['entry'])},'message':'Removed\x20service\x20'+_0x3d4645[_0x18c6e0(0x1b7)][_0x18c6e0(0x1c9)]+'.'};}},{'service':'service','command':a40_0x257e54(0x18c),'description':a40_0x257e54(0x1b6),'risk':a40_0x257e54(0x1cc),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x2983b8){const _0x13f38c=a40_0x257e54,_0x28ceda=getLocalServiceEntry(_0x2983b8[_0x13f38c(0x1ab)](_0x13f38c(0x1ba)));if(!_0x28ceda)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x2983b8[_0x13f38c(0x1ab)]('service')},'message':_0x13f38c(0x1b9)+_0x2983b8[_0x13f38c(0x1ab)](_0x13f38c(0x1ba))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x28ceda),'manifest':_0x28ceda[_0x13f38c(0x195)],'normalizedManifest':toPublicNormalizedServiceTree(_0x28ceda[_0x13f38c(0x1c1)])}};}}];
1
+ const a41_0x340f95=a41_0x89ed;(function(_0x4297ef,_0x1573ae){const _0x39ec4e=a41_0x89ed,_0x223bac=_0x4297ef();while(!![]){try{const _0x3f6aaa=-parseInt(_0x39ec4e(0x1c7))/0x1+parseInt(_0x39ec4e(0x1c4))/0x2+parseInt(_0x39ec4e(0x1e2))/0x3*(-parseInt(_0x39ec4e(0x1d9))/0x4)+parseInt(_0x39ec4e(0x1be))/0x5+parseInt(_0x39ec4e(0x1a9))/0x6*(-parseInt(_0x39ec4e(0x1e1))/0x7)+parseInt(_0x39ec4e(0x1d5))/0x8*(-parseInt(_0x39ec4e(0x1df))/0x9)+parseInt(_0x39ec4e(0x1b4))/0xa;if(_0x3f6aaa===_0x1573ae)break;else _0x223bac['push'](_0x223bac['shift']());}catch(_0x3b6d17){_0x223bac['push'](_0x223bac['shift']());}}}(a41_0x1f7a,0x780d3));function a41_0x1f7a(){const _0x4b6f8e=['Local\x20service\x20not\x20found:\x20','Service\x20Tree\x20manifest\x20file\x20path','length','manifests','import','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','detail','required','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','5014792LGpIex','reduce','normalizedManifest','flags','188264CKnZRa','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','list','entry','Local\x20service\x20code,\x20for\x20example\x20crm','\x20service\x20','9evgnOT','hash','1347773DXlzYy','9hjRPXm','file','manifest','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','write','WRITE','report','registryPath','Removed\x20service\x20','string','commands','risk','entries','registryServiceCode','6TBeXcs','cliPath','errors','name','str','Imported\x20','imported','serviceCode','source','registryIndex','service','3361590yHURGb','Service\x20manifest\x20validation\x20passed.','warnings','map','version','validate','serviceCount','read','type','Service\x20registry\x20validation\x20passed.','2689365EybWHc','target','export','\x20service(s),\x20updated\x20','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','filePath','1157642bIRkZy','replaced','updated','536mrgURL','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','kind','\x20service(s).','cliName'];a41_0x1f7a=function(){return _0x4b6f8e;};return a41_0x1f7a();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x340f95(0x1e3),'type':a41_0x340f95(0x1a4),'required':!![],'description':a41_0x340f95(0x1cd)},SERVICE_FLAG={'name':a41_0x340f95(0x1b3),'type':a41_0x340f95(0x1a4),'required':!![],'description':a41_0x340f95(0x1dd),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function a41_0x89ed(_0x472df1,_0x514fac){_0x472df1=_0x472df1-0x1a3;const _0x1f7a3f=a41_0x1f7a();let _0x89ed18=_0x1f7a3f[_0x472df1];return _0x89ed18;}function summarizeService(_0x47f5c3){const _0x50c9f8=a41_0x340f95;return{'serviceCode':_0x47f5c3[_0x50c9f8(0x1b0)],'name':_0x47f5c3[_0x50c9f8(0x1d7)][_0x50c9f8(0x1b3)][_0x50c9f8(0x1ac)],'version':_0x47f5c3[_0x50c9f8(0x1b8)],'importedAt':_0x47f5c3['importedAt'],'source':_0x47f5c3['source'],'commandCount':_0x47f5c3[_0x50c9f8(0x1d7)][_0x50c9f8(0x1a5)]['length'],'commands':_0x47f5c3[_0x50c9f8(0x1d7)][_0x50c9f8(0x1a5)]['map'](_0x4e5230=>({'path':_0x4e5230[_0x50c9f8(0x1aa)],'description':_0x4e5230['description'],'risk':_0x4e5230[_0x50c9f8(0x1a6)],'target':toPublicServiceTreeTarget(_0x4e5230[_0x50c9f8(0x1bf)]),'flags':_0x4e5230[_0x50c9f8(0x1d8)][_0x50c9f8(0x1b7)](_0x59c04e=>({'name':_0x59c04e['name'],'cliName':_0x59c04e[_0x50c9f8(0x1cb)],'type':_0x59c04e[_0x50c9f8(0x1bc)],'required':_0x59c04e[_0x50c9f8(0x1d3)]===!![]}))}))};}function summarizeLoadedManifest(_0x1eed6e){const _0x48e76f=a41_0x340f95;return{'service':_0x1eed6e['normalizedManifest']?.['service'],'version':_0x1eed6e[_0x48e76f(0x1d7)]?.[_0x48e76f(0x1b8)],'commandCount':_0x1eed6e[_0x48e76f(0x1d7)]?.[_0x48e76f(0x1a5)][_0x48e76f(0x1ce)]??0x0,'commands':_0x1eed6e[_0x48e76f(0x1d7)]?.[_0x48e76f(0x1a5)][_0x48e76f(0x1b7)](_0x39b921=>({'path':_0x39b921[_0x48e76f(0x1aa)],'risk':_0x39b921[_0x48e76f(0x1a6)],'target':toPublicServiceTreeTarget(_0x39b921[_0x48e76f(0x1bf)])}))??[],'registryIndex':_0x1eed6e[_0x48e76f(0x1b2)],'registryServiceCode':_0x1eed6e[_0x48e76f(0x1a8)],'errors':_0x1eed6e[_0x48e76f(0x1e8)][_0x48e76f(0x1ab)],'warnings':_0x1eed6e[_0x48e76f(0x1e8)][_0x48e76f(0x1b6)]};}export const serviceDefinitions=[{'service':'service','command':a41_0x340f95(0x1b9),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a41_0x340f95(0x1bb),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x3460ab){const _0x8c65e4=a41_0x340f95,_0x4903f1=loadServiceManifestFromFile(_0x3460ab[_0x8c65e4(0x1ad)](_0x8c65e4(0x1e3)));if(!_0x4903f1['report']['ok'])return{'ok':![],'data':{'file':_0x4903f1['filePath'],'hash':_0x4903f1[_0x8c65e4(0x1e0)],'kind':_0x4903f1['kind'],'serviceCount':_0x4903f1[_0x8c65e4(0x1cf)]['length'],'services':_0x4903f1['manifests']['map'](summarizeLoadedManifest),'errors':_0x4903f1[_0x8c65e4(0x1e8)]['errors'],'warnings':_0x4903f1[_0x8c65e4(0x1e8)][_0x8c65e4(0x1b6)]},'message':formatValidationFailure(_0x4903f1['report'])};if(_0x4903f1['kind']==='registry'||_0x4903f1[_0x8c65e4(0x1cf)][_0x8c65e4(0x1ce)]!==0x1)return{'ok':!![],'data':{'file':_0x4903f1['filePath'],'hash':_0x4903f1[_0x8c65e4(0x1e0)],'kind':_0x4903f1[_0x8c65e4(0x1c9)],'serviceCount':_0x4903f1['manifests'][_0x8c65e4(0x1ce)],'commandCount':_0x4903f1['manifests'][_0x8c65e4(0x1d6)]((_0x57cadf,_0x25fcbe)=>_0x57cadf+(_0x25fcbe[_0x8c65e4(0x1d7)]?.[_0x8c65e4(0x1a5)][_0x8c65e4(0x1ce)]??0x0),0x0),'services':_0x4903f1[_0x8c65e4(0x1cf)][_0x8c65e4(0x1b7)](summarizeLoadedManifest),'warnings':_0x4903f1[_0x8c65e4(0x1e8)]['warnings']},'message':_0x8c65e4(0x1bd)};return{'ok':!![],'data':{'file':_0x4903f1[_0x8c65e4(0x1c3)],'hash':_0x4903f1[_0x8c65e4(0x1e0)],'kind':_0x4903f1[_0x8c65e4(0x1c9)],'service':_0x4903f1[_0x8c65e4(0x1d7)]?.['service'],'version':_0x4903f1['normalizedManifest']?.['version'],'commandCount':_0x4903f1[_0x8c65e4(0x1d7)]?.[_0x8c65e4(0x1a5)][_0x8c65e4(0x1ce)]??0x0,'commands':_0x4903f1[_0x8c65e4(0x1d7)]?.[_0x8c65e4(0x1a5)]['map'](_0x5a38d1=>({'path':_0x5a38d1[_0x8c65e4(0x1aa)],'risk':_0x5a38d1[_0x8c65e4(0x1a6)],'target':toPublicServiceTreeTarget(_0x5a38d1[_0x8c65e4(0x1bf)])})),'warnings':_0x4903f1[_0x8c65e4(0x1e8)][_0x8c65e4(0x1b6)]},'message':_0x8c65e4(0x1b5)};}},{'service':a41_0x340f95(0x1b3),'command':a41_0x340f95(0x1d0),'description':a41_0x340f95(0x1da),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x3d7bcb){const _0x48fef8=a41_0x340f95,_0x4448e9=loadServiceManifestFromFile(_0x3d7bcb[_0x48fef8(0x1ad)](_0x48fef8(0x1e3)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x4448e9[_0x48fef8(0x1c3)],'hash':_0x4448e9[_0x48fef8(0x1e0)],'kind':_0x4448e9[_0x48fef8(0x1c9)],'ok':_0x4448e9[_0x48fef8(0x1e8)]['ok'],'service':_0x4448e9[_0x48fef8(0x1d7)]?.[_0x48fef8(0x1b3)],'version':_0x4448e9['normalizedManifest']?.['version'],'serviceCount':_0x4448e9[_0x48fef8(0x1cf)]['length'],'services':_0x4448e9[_0x48fef8(0x1cf)][_0x48fef8(0x1b7)](_0x169baf=>({'service':_0x169baf[_0x48fef8(0x1d7)]?.['service'],'version':_0x169baf[_0x48fef8(0x1d7)]?.[_0x48fef8(0x1b8)],'commandCount':_0x169baf[_0x48fef8(0x1d7)]?.[_0x48fef8(0x1a5)][_0x48fef8(0x1ce)]??0x0,'errors':_0x169baf[_0x48fef8(0x1e8)][_0x48fef8(0x1ab)]})),'errors':_0x4448e9[_0x48fef8(0x1e8)]['errors'],'commandCount':_0x4448e9['normalizedManifest']?.['commands'][_0x48fef8(0x1ce)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x1e6175){const _0x43a6d9=a41_0x340f95,_0x66fa95=importServiceManifest(_0x1e6175[_0x43a6d9(0x1ad)](_0x43a6d9(0x1e3)));if(_0x66fa95[_0x43a6d9(0x1a7)][_0x43a6d9(0x1ce)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x66fa95[_0x43a6d9(0x1e9)],'imported':_0x66fa95[_0x43a6d9(0x1af)],'updated':_0x66fa95[_0x43a6d9(0x1c6)],'serviceCount':_0x66fa95['serviceCount'],'services':_0x66fa95['entries'][_0x43a6d9(0x1b7)](summarizeService)},'message':_0x43a6d9(0x1ae)+_0x66fa95[_0x43a6d9(0x1af)]+_0x43a6d9(0x1c1)+_0x66fa95[_0x43a6d9(0x1c6)]+_0x43a6d9(0x1ca)};return{'ok':!![],'data':{'registryPath':_0x66fa95[_0x43a6d9(0x1e9)],'replaced':_0x66fa95[_0x43a6d9(0x1c5)],'imported':_0x66fa95[_0x43a6d9(0x1af)],'updated':_0x66fa95[_0x43a6d9(0x1c6)],'serviceCount':_0x66fa95[_0x43a6d9(0x1ba)],'service':summarizeService(_0x66fa95[_0x43a6d9(0x1dc)])},'message':(_0x66fa95['replaced']?'Updated':'Imported')+_0x43a6d9(0x1de)+_0x66fa95[_0x43a6d9(0x1dc)][_0x43a6d9(0x1b0)]+'.'};}},{'service':a41_0x340f95(0x1b3),'command':a41_0x340f95(0x1c0),'description':a41_0x340f95(0x1e5),'risk':a41_0x340f95(0x1e6),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x21638c){const _0xac7fcd=a41_0x340f95,_0x3587fc=getLocalServiceEntry(_0x21638c[_0xac7fcd(0x1ad)](_0xac7fcd(0x1b3)));return{'method':_0xac7fcd(0x1e7),'url':_0x21638c['str'](_0xac7fcd(0x1e3)),'body':{'service':_0x21638c[_0xac7fcd(0x1ad)]('service'),'found':Boolean(_0x3587fc),'version':_0x3587fc?.[_0xac7fcd(0x1b8)],'source':_0x3587fc?.[_0xac7fcd(0x1b1)]},'description':_0xac7fcd(0x1d4)};},async 'execute'(_0x1cc301){const _0x2a773a=a41_0x340f95,_0x44a8eb=exportServiceManifest(_0x1cc301['str'](_0x2a773a(0x1b3)),_0x1cc301[_0x2a773a(0x1ad)]('file'));return{'ok':!![],'data':{'registryPath':_0x44a8eb[_0x2a773a(0x1e9)],'file':_0x44a8eb['filePath'],'service':summarizeService(_0x44a8eb[_0x2a773a(0x1dc)])},'message':'Exported\x20service\x20'+_0x44a8eb['entry'][_0x2a773a(0x1b0)]+'.'};}},{'service':'service','command':a41_0x340f95(0x1db),'description':a41_0x340f95(0x1d1),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0xd58511=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0xd58511['length'],'services':_0xd58511['map'](summarizeService)}};}},{'service':a41_0x340f95(0x1b3),'command':'remove','description':a41_0x340f95(0x1c2),'risk':a41_0x340f95(0x1e6),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x430504){const _0x137143=a41_0x340f95,_0x1eb68f=getLocalServiceEntry(_0x430504[_0x137143(0x1ad)](_0x137143(0x1b3)));return{'method':_0x137143(0x1e7),'url':getServiceRegistryPath(),'body':{'service':_0x430504['str'](_0x137143(0x1b3)),'found':Boolean(_0x1eb68f),'version':_0x1eb68f?.[_0x137143(0x1b8)],'source':_0x1eb68f?.['source']},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x350130){const _0x2d02dc=a41_0x340f95,_0x5a6b3f=removeServiceManifest(_0x350130['str'](_0x2d02dc(0x1b3)));return{'ok':!![],'data':{'registryPath':_0x5a6b3f[_0x2d02dc(0x1e9)],'serviceCount':_0x5a6b3f[_0x2d02dc(0x1ba)],'service':summarizeService(_0x5a6b3f[_0x2d02dc(0x1dc)])},'message':_0x2d02dc(0x1a3)+_0x5a6b3f[_0x2d02dc(0x1dc)][_0x2d02dc(0x1b0)]+'.'};}},{'service':a41_0x340f95(0x1b3),'command':a41_0x340f95(0x1d2),'description':a41_0x340f95(0x1c8),'risk':a41_0x340f95(0x1bb),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x205944){const _0x28b595=a41_0x340f95,_0x32706c=getLocalServiceEntry(_0x205944[_0x28b595(0x1ad)]('service'));if(!_0x32706c)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x205944[_0x28b595(0x1ad)](_0x28b595(0x1b3))},'message':_0x28b595(0x1cc)+_0x205944[_0x28b595(0x1ad)](_0x28b595(0x1b3))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x32706c),'manifest':_0x32706c[_0x28b595(0x1e4)],'normalizedManifest':toPublicNormalizedServiceTree(_0x32706c['normalizedManifest'])}};}}];