@lovrabet/lovrabet-cli 2.1.8 → 2.1.9-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 (117) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/app-config/shared.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/ocr/index.js +1 -1
  36. package/lib/commands/personal-bff/index.js +1 -1
  37. package/lib/commands/registry.js +1 -1
  38. package/lib/commands/schema.js +1 -1
  39. package/lib/commands/service/dynamic.js +1 -1
  40. package/lib/commands/service/index.js +1 -1
  41. package/lib/commands/service/registry.js +1 -1
  42. package/lib/commands/skill/commands/create.js +1 -1
  43. package/lib/commands/skill/commands/install.js +1 -1
  44. package/lib/commands/skill/commands/list.js +1 -1
  45. package/lib/commands/skill/commands/push.js +1 -1
  46. package/lib/commands/skill/commands/validate.js +1 -1
  47. package/lib/commands/skill/flags.js +1 -1
  48. package/lib/commands/skill/index.js +1 -1
  49. package/lib/commands/skill/manifest-helpers.js +1 -1
  50. package/lib/commands/skill/push-execute.js +1 -1
  51. package/lib/commands/skill/push-flow-helpers.js +1 -1
  52. package/lib/commands/skill/push-retarget.js +1 -1
  53. package/lib/commands/skill/scopes.js +1 -1
  54. package/lib/commands/skill/summary.js +1 -1
  55. package/lib/commands/skill/templates.js +1 -1
  56. package/lib/commands/skill/validate.js +1 -1
  57. package/lib/commands/sql/detail.js +1 -1
  58. package/lib/commands/sql/exec.js +1 -1
  59. package/lib/commands/sql/index.js +1 -1
  60. package/lib/commands/update.js +1 -1
  61. package/lib/commands/workspace/index.js +1 -1
  62. package/lib/config/schema.js +1 -1
  63. package/lib/constant/app.js +1 -1
  64. package/lib/constant/auth-mode.js +1 -1
  65. package/lib/constant/cli.js +1 -1
  66. package/lib/constant/defaults.js +1 -1
  67. package/lib/constant/distribution.js +1 -1
  68. package/lib/constant/domain.js +1 -1
  69. package/lib/constant/env.js +1 -1
  70. package/lib/constant/output.js +1 -1
  71. package/lib/constant/product.js +1 -1
  72. package/lib/constant/risk.js +1 -1
  73. package/lib/constant/url.js +1 -1
  74. package/lib/context.js +1 -1
  75. package/lib/core/api-client.js +1 -1
  76. package/lib/core/db-resolver.js +1 -1
  77. package/lib/core/sdk-client.js +1 -1
  78. package/lib/errors.js +1 -1
  79. package/lib/framework/build-all-flags.js +1 -1
  80. package/lib/framework/dryrun.js +1 -1
  81. package/lib/framework/flags.js +1 -1
  82. package/lib/framework/help.js +1 -1
  83. package/lib/framework/index.js +1 -1
  84. package/lib/framework/output.js +1 -1
  85. package/lib/framework/preparse.js +1 -1
  86. package/lib/framework/response.js +1 -1
  87. package/lib/framework/runner-confirmation.js +1 -1
  88. package/lib/framework/runner-error.js +1 -1
  89. package/lib/framework/runner.js +1 -1
  90. package/lib/framework/schema-export.js +1 -1
  91. package/lib/framework/service-order.js +1 -1
  92. package/lib/framework/types.js +1 -1
  93. package/lib/generated/build-info.js +1 -1
  94. package/lib/help.js +1 -1
  95. package/lib/skills/npx-skills-add.js +1 -1
  96. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  97. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  98. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  99. package/lib/skills/runtime-skill-sync/links.js +1 -1
  100. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  101. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  102. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  103. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  104. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  105. package/lib/skills/runtime-skill-sync/push.js +1 -1
  106. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  107. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  108. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  109. package/lib/skills/runtime-skill-sync.js +1 -1
  110. package/lib/utils/apply-jq-filter.js +1 -1
  111. package/lib/utils/logger.js +1 -1
  112. package/lib/utils/params.js +1 -1
  113. package/lib/utils/platform.js +1 -1
  114. package/lib/utils/update-notice.js +1 -1
  115. package/lib/utils/version.js +1 -1
  116. package/lib/utils/write-cli-side-channel.js +1 -1
  117. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x1a1b71=a30_0x2712;(function(_0x27d54d,_0x10abd6){const _0x2b9f71=a30_0x2712,_0x13bc13=_0x27d54d();while(!![]){try{const _0xd6e657=-parseInt(_0x2b9f71(0x88))/0x1*(-parseInt(_0x2b9f71(0x80))/0x2)+-parseInt(_0x2b9f71(0x90))/0x3*(parseInt(_0x2b9f71(0x85))/0x4)+-parseInt(_0x2b9f71(0x96))/0x5*(parseInt(_0x2b9f71(0x8e))/0x6)+parseInt(_0x2b9f71(0x78))/0x7+-parseInt(_0x2b9f71(0x8f))/0x8+-parseInt(_0x2b9f71(0x86))/0x9+parseInt(_0x2b9f71(0x77))/0xa*(parseInt(_0x2b9f71(0x8a))/0xb);if(_0xd6e657===_0x10abd6)break;else _0x13bc13['push'](_0x13bc13['shift']());}catch(_0x55f878){_0x13bc13['push'](_0x13bc13['shift']());}}}(a30_0x327d,0x6ef81));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x1a1b71(0x82),'type':'string','required':!![],'description':a30_0x1a1b71(0x7d)},FILEPATH_FLAG={'name':a30_0x1a1b71(0x92),'type':a30_0x1a1b71(0x7f),'required':!![],'description':a30_0x1a1b71(0x81)},DOWNLOAD_FLAG={'name':'download','type':a30_0x1a1b71(0x76),'description':a30_0x1a1b71(0x8b)};function requireFilePath(_0xe66ec7){const _0xc13f54=a30_0x1a1b71,_0x59fe54=_0xe66ec7[_0xc13f54(0x93)]();if(!_0x59fe54)throw CliErrors[_0xc13f54(0x84)](_0xc13f54(0x87));return _0x59fe54;}function a30_0x2712(_0x14efd7,_0x2f5c13){_0x14efd7=_0x14efd7-0x74;const _0x327d14=a30_0x327d();let _0x27123f=_0x327d14[_0x14efd7];return _0x27123f;}const fileUpload={'service':a30_0x1a1b71(0x82),'command':a30_0x1a1b71(0x83),'description':'Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','risk':a30_0x1a1b71(0x74),'flags':[FILE_FLAG],async 'dryRun'(_0x31480d){const _0x573d5a=a30_0x1a1b71,_0xac6e=requireRuntimeUploadFile(_0x31480d['str'](_0x573d5a(0x82)),_0x573d5a(0x89));return dryRun(_0x573d5a(0x94),_0x573d5a(0x79))['body']({'appCode':_0x31480d['appCode'],'multipart':{'file':_0xac6e}})[_0x573d5a(0x8c)]('Preview:\x20upload\x20'+_0xac6e[_0x573d5a(0x91)]+_0x573d5a(0x98)+_0x31480d['appCode'])['build']();},async 'execute'(_0x1ebd9c){const _0x6a98df=a30_0x1a1b71,_0x11e622=requireRuntimeUploadFile(_0x1ebd9c[_0x6a98df(0x95)](_0x6a98df(0x82)),'File'),_0x11ec90=await uploadRuntimeFile(_0x1ebd9c[_0x6a98df(0x75)],_0x11e622[_0x6a98df(0x91)]);return{'ok':!![],'data':_0x11ec90,'message':_0x11ec90[_0x6a98df(0x97)]?_0x6a98df(0x7b)+_0x11ec90['filePath']:'Uploaded\x20file.'};}},fileQueryUrl={'service':a30_0x1a1b71(0x82),'command':a30_0x1a1b71(0x7e),'description':a30_0x1a1b71(0x7c),'risk':a30_0x1a1b71(0x7a),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x4227de){const _0x1196b1=a30_0x1a1b71,_0x3cc23b=requireFilePath(_0x4227de[_0x1196b1(0x95)](_0x1196b1(0x92))),_0x5a5748=await queryRuntimeFileUrl(_0x3cc23b,{'download':_0x4227de[_0x1196b1(0x8d)]('download')});return{'ok':!![],'data':_0x5a5748};}};function a30_0x327d(){const _0x4223b8=['query-url','string','14ajtsMT','Runtime\x20filePath\x20returned\x20by\x20file\x20upload','file','upload','validation','12OfnQvJ','739053YKFMzp','filePath\x20is\x20required.','43285MtORkA','File','34045ktCcZi','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported','description','bool','6hpqzjA','5594640zmLnGC','760278FdNmXA','path','filepath','trim','POST','str','457220WxNIez','filePath','\x20to\x20runtime\x20app\x20','write','appCode','boolean','4290NPiMPZ','3198636KjLuVb','/client/uploadFile','read','Uploaded\x20file:\x20','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','Path\x20to\x20the\x20local\x20file\x20to\x20upload'];a30_0x327d=function(){return _0x4223b8;};return a30_0x327d();}export const fileDefinitions=[fileUpload,fileQueryUrl];
1
+ const a30_0x2b6546=a30_0x3f76;(function(_0x518dfd,_0x84bc84){const _0x5c74fe=a30_0x3f76,_0x639bb9=_0x518dfd();while(!![]){try{const _0x5a88a2=-parseInt(_0x5c74fe(0x12f))/0x1+-parseInt(_0x5c74fe(0x12c))/0x2+parseInt(_0x5c74fe(0x125))/0x3+-parseInt(_0x5c74fe(0x139))/0x4*(parseInt(_0x5c74fe(0x12a))/0x5)+parseInt(_0x5c74fe(0x130))/0x6*(-parseInt(_0x5c74fe(0x143))/0x7)+-parseInt(_0x5c74fe(0x13f))/0x8+parseInt(_0x5c74fe(0x134))/0x9*(parseInt(_0x5c74fe(0x136))/0xa);if(_0x5a88a2===_0x84bc84)break;else _0x639bb9['push'](_0x639bb9['shift']());}catch(_0x13a0b7){_0x639bb9['push'](_0x639bb9['shift']());}}}(a30_0x4bf2,0x54c3f));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':'file','type':a30_0x2b6546(0x13e),'required':!![],'description':a30_0x2b6546(0x137)},FILEPATH_FLAG={'name':'filepath','type':a30_0x2b6546(0x13e),'required':!![],'description':a30_0x2b6546(0x138)},DOWNLOAD_FLAG={'name':a30_0x2b6546(0x140),'type':a30_0x2b6546(0x123),'description':a30_0x2b6546(0x122)};function a30_0x3f76(_0x9d7903,_0x4127b5){_0x9d7903=_0x9d7903-0x11d;const _0x4bf229=a30_0x4bf2();let _0x3f76a1=_0x4bf229[_0x9d7903];return _0x3f76a1;}function a30_0x4bf2(){const _0x397f16=['534136rMMxrj','File','body','upload','Preview:\x20upload\x20','string','4458560ARWliC','download','validation','appCode','3473582cbeGyc','bool','POST','description','filePath','path','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported','boolean','filepath','230361KVBOsA','\x20to\x20runtime\x20app\x20','file','query-url','read','10nQkzdv','str','243620TgAjJf','build','Uploaded\x20file:\x20','34597TgFZaI','6kFwEaB','trim','Uploaded\x20file.','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','15726897NvFEcg','write','10bqjmIr','Path\x20to\x20the\x20local\x20file\x20to\x20upload','Runtime\x20filePath\x20returned\x20by\x20file\x20upload'];a30_0x4bf2=function(){return _0x397f16;};return a30_0x4bf2();}function requireFilePath(_0x1321e3){const _0x4473d1=a30_0x2b6546,_0x19b324=_0x1321e3[_0x4473d1(0x131)]();if(!_0x19b324)throw CliErrors[_0x4473d1(0x141)]('filePath\x20is\x20required.');return _0x19b324;}const fileUpload={'service':a30_0x2b6546(0x127),'command':a30_0x2b6546(0x13c),'description':'Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','risk':a30_0x2b6546(0x135),'flags':[FILE_FLAG],async 'dryRun'(_0x4598ce){const _0x873e44=a30_0x2b6546,_0x3490d5=requireRuntimeUploadFile(_0x4598ce['str'](_0x873e44(0x127)),_0x873e44(0x13a));return dryRun(_0x873e44(0x11e),'/client/uploadFile')[_0x873e44(0x13b)]({'appCode':_0x4598ce['appCode'],'multipart':{'file':_0x3490d5}})[_0x873e44(0x11f)](_0x873e44(0x13d)+_0x3490d5[_0x873e44(0x121)]+_0x873e44(0x126)+_0x4598ce[_0x873e44(0x142)])[_0x873e44(0x12d)]();},async 'execute'(_0x2b160b){const _0x2cf130=a30_0x2b6546,_0x2dae16=requireRuntimeUploadFile(_0x2b160b['str']('file'),_0x2cf130(0x13a)),_0x15248c=await uploadRuntimeFile(_0x2b160b[_0x2cf130(0x142)],_0x2dae16[_0x2cf130(0x121)]);return{'ok':!![],'data':_0x15248c,'message':_0x15248c[_0x2cf130(0x120)]?_0x2cf130(0x12e)+_0x15248c[_0x2cf130(0x120)]:_0x2cf130(0x132)};}},fileQueryUrl={'service':a30_0x2b6546(0x127),'command':a30_0x2b6546(0x128),'description':a30_0x2b6546(0x133),'risk':a30_0x2b6546(0x129),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0xebbd2d){const _0x362cd7=a30_0x2b6546,_0x4889a9=requireFilePath(_0xebbd2d[_0x362cd7(0x12b)](_0x362cd7(0x124))),_0x2280bc=await queryRuntimeFileUrl(_0x4889a9,{'download':_0xebbd2d[_0x362cd7(0x11d)](_0x362cd7(0x140))});return{'ok':!![],'data':_0x2280bc};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
1
- const a31_0x4c8aaa=a31_0x5ad5;(function(_0xd29538,_0x506ce8){const _0x5f0871=a31_0x5ad5,_0x362dde=_0xd29538();while(!![]){try{const _0x3e43db=-parseInt(_0x5f0871(0x1e1))/0x1*(parseInt(_0x5f0871(0x1d8))/0x2)+parseInt(_0x5f0871(0x1fb))/0x3*(parseInt(_0x5f0871(0x1c6))/0x4)+-parseInt(_0x5f0871(0x1d1))/0x5+-parseInt(_0x5f0871(0x1b7))/0x6+parseInt(_0x5f0871(0x1e4))/0x7+-parseInt(_0x5f0871(0x1f1))/0x8*(parseInt(_0x5f0871(0x1fd))/0x9)+-parseInt(_0x5f0871(0x1d7))/0xa*(-parseInt(_0x5f0871(0x1f7))/0xb);if(_0x3e43db===_0x506ce8)break;else _0x362dde['push'](_0x362dde['shift']());}catch(_0x3e5971){_0x362dde['push'](_0x362dde['shift']());}}}(a31_0x52f6,0x9bddf));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';function a31_0x5ad5(_0x278056,_0x10c027){_0x278056=_0x278056-0x1b6;const _0x52f697=a31_0x52f6();let _0x5ad5f9=_0x52f697[_0x278056];return _0x5ad5f9;}import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x4c8aaa(0x1e6),'type':'string','description':'App\x20code\x20for\x20the\x20project'},{'name':a31_0x4c8aaa(0x1c8),'type':'string','description':a31_0x4c8aaa(0x1f5)+DEFAULT_CONFIG_VALUES[a31_0x4c8aaa(0x1c8)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4c8aaa(0x1f0),'type':a31_0x4c8aaa(0x1eb),'description':a31_0x4c8aaa(0x1e3)+PRODUCT_CONFIG[a31_0x4c8aaa(0x1dc)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':'boolean','description':a31_0x4c8aaa(0x1e5),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a31_0x4c8aaa(0x1f2),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x4c8aaa(0x1e6),'type':a31_0x4c8aaa(0x1f2),'description':a31_0x4c8aaa(0x1da)},{'name':a31_0x4c8aaa(0x1c8),'type':a31_0x4c8aaa(0x1f2),'description':a31_0x4c8aaa(0x1c2),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4c8aaa(0x1f0),'type':a31_0x4c8aaa(0x1eb),'description':a31_0x4c8aaa(0x1e3)+PRODUCT_CONFIG[a31_0x4c8aaa(0x1dc)]+a31_0x4c8aaa(0x1f4),'default':![]},{'name':a31_0x4c8aaa(0x1bd),'type':a31_0x4c8aaa(0x1eb),'description':a31_0x4c8aaa(0x1e5),'default':![]}];export async function runInit(_0x42653e){const _0x477b3a=a31_0x4c8aaa,_0x300a03=isNonInteractiveMode(_0x42653e),_0x44b1ba=_0x42653e['global']?_0x477b3a(0x1f0):_0x477b3a(0x1d2),_0x5bbc66=resolveWriteConfigPath(_0x44b1ba);try{_0x300a03?await runNonInteractive(_0x42653e,_0x5bbc66):await runInteractive(_0x42653e,_0x5bbc66);}catch(_0x3e3dc9){if(_0x3e3dc9 instanceof AbortPrompt)throw CliErrors[_0x477b3a(0x1e9)]();throw _0x3e3dc9;}}export async function runInitImport(_0xe21081){const _0x4b1019=a31_0x4c8aaa,_0x551f01=_0xe21081[_0x4b1019(0x1f0)]?'global':_0x4b1019(0x1d2),_0x336797=resolveWriteConfigPath(_0x551f01);await runFromImport(_0xe21081,_0x336797);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x4c8aaa(0x1c9)]);async function runFromImport(_0x425357,_0x412986){const _0x3f06ee=a31_0x4c8aaa,_0x4ef830=resolveFilePath(_0x425357[_0x3f06ee(0x1ce)]);if(!existsSync(_0x4ef830))throw CliErrors['validation'](_0x3f06ee(0x1d9)+_0x4ef830);const _0x14d83f=readSourceFile(_0x4ef830),_0x592c22=convertToRuntimeConfig(_0x14d83f);_0x425357[_0x3f06ee(0x1e6)]&&(_0x592c22['appcode']=String(_0x425357['appcode']));_0x425357[_0x3f06ee(0x1c8)]&&(_0x592c22[_0x3f06ee(0x1c8)]=resolveInitEnv(_0x425357));if(!_0x592c22[_0x3f06ee(0x1e6)])throw CliErrors['validation'](_0x3f06ee(0x1bb),_0x3f06ee(0x1f8));await writeInitConfig(_0x412986,_0x592c22,_0x425357),console[_0x3f06ee(0x1d4)]('Imported\x20from\x20'+_0x4ef830),console[_0x3f06ee(0x1d4)]('\x20\x20config:\x20\x20'+_0x412986),console['log'](_0x3f06ee(0x1e8)+_0x592c22[_0x3f06ee(0x1e6)]);if(_0x592c22['defaultApp'])console['log'](_0x3f06ee(0x1bf)+_0x592c22[_0x3f06ee(0x1de)]);}function convertToRuntimeConfig(_0x319024){const _0x32339f=a31_0x4c8aaa;if(_0x319024[_0x32339f(0x1dd)]&&typeof _0x319024['apps']===_0x32339f(0x1ee))throw CliErrors[_0x32339f(0x1ef)](_0x32339f(0x1c3),_0x32339f(0x1cf));const _0x22b6ac={};for(const _0x314036 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x319024[_0x314036]!==undefined&&(_0x22b6ac[_0x314036]=_0x319024[_0x314036]);}return!_0x22b6ac['riskLevel']&&(_0x22b6ac[_0x32339f(0x1ca)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x22b6ac;}async function runNonInteractive(_0x5b25e0,_0x405f4c){const _0x6c0e8d=a31_0x4c8aaa,_0x31fa6d=_0x5b25e0[_0x6c0e8d(0x1e6)];if(!_0x31fa6d)throw CliErrors[_0x6c0e8d(0x1f6)]('appcode','Usage:\x20'+CLI_BIN_NAME+_0x6c0e8d(0x1d0));const _0x124179=resolveInitEnv(_0x5b25e0);await writeInitConfig(_0x405f4c,{'appcode':_0x31fa6d,'env':_0x124179},_0x5b25e0),console[_0x6c0e8d(0x1d4)](_0x6c0e8d(0x1e2)+_0x405f4c),console['log']('\x20\x20appcode:\x20'+_0x31fa6d),console['log'](_0x6c0e8d(0x1d5)+_0x124179);}async function runInteractive(_0x595615,_0x3e5290){const _0x1dfef9=a31_0x4c8aaa,_0x1a2800=loadExisting(_0x3e5290),_0x34ba1f=typeof _0x1a2800?.[_0x1dfef9(0x1e6)]===_0x1dfef9(0x1f2)?_0x1a2800[_0x1dfef9(0x1e6)]:'',_0x4546b1=resolveInitEnv(_0x595615);console[_0x1dfef9(0x1d4)](CLI_BIN_NAME+_0x1dfef9(0x1cc)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x3e5290)&&!_0x595615[_0x1dfef9(0x1bd)]){const _0x309f22=await promptYesNo(_0x1dfef9(0x1b6)+_0x3e5290+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x309f22){console[_0x1dfef9(0x1d4)]('Aborted.');return;}}const _0x18901e=typeof _0x595615[_0x1dfef9(0x1e6)]==='string'?_0x595615[_0x1dfef9(0x1e6)][_0x1dfef9(0x1e7)]():'';let _0x2f6a26=_0x18901e;!_0x2f6a26&&(_0x2f6a26=await promptInput('App\x20code',_0x34ba1f));if(!_0x2f6a26[_0x1dfef9(0x1e7)]())throw CliErrors[_0x1dfef9(0x1ef)](_0x1dfef9(0x1c5));await writeInitConfig(_0x3e5290,{'appcode':_0x2f6a26[_0x1dfef9(0x1e7)](),'env':_0x4546b1},_0x595615),console['log'](_0x1dfef9(0x1df)+_0x3e5290),console['log'](_0x1dfef9(0x1e8)+_0x2f6a26[_0x1dfef9(0x1e7)]()),console[_0x1dfef9(0x1d4)](_0x1dfef9(0x1d5)+_0x4546b1);}async function writeInitConfig(_0x3159e6,_0x5d7d25,_0xfb7c4e){const _0xd50e5a=a31_0x4c8aaa;let _0x5f2e2b={};existsSync(_0x3159e6)&&!_0xfb7c4e[_0xd50e5a(0x1bd)]&&(_0x5f2e2b=readConfigFile(_0x3159e6));for(const [_0x9fe059,_0x2600ec]of Object[_0xd50e5a(0x1b8)](_0x5d7d25)){_0x2600ec!==undefined&&(_0x5f2e2b[_0x9fe059]=_0x2600ec);}if(_0x5f2e2b['app'])delete _0x5f2e2b[_0xd50e5a(0x1ec)];writeConfigFile(_0x3159e6,_0x5f2e2b);}class AbortPrompt extends Error{constructor(){const _0xdf4e08=a31_0x4c8aaa;super(_0xdf4e08(0x1ed)),this['name']=_0xdf4e08(0x1d3);}}function createSafeRl(){const _0x22a227=a31_0x4c8aaa,_0x1fa3b6=createInterface({'input':process[_0x22a227(0x1be)],'output':process[_0x22a227(0x1fa)]});let _0x1c45f2;const _0x16cb6b=new Promise((_0x6647c1,_0xb6b985)=>{const _0x7e1245=_0x22a227;_0x1c45f2=()=>{const _0x183550=a31_0x5ad5;_0x1c45f2&&(_0x1fa3b6['removeListener'](_0x183550(0x1c0),_0x1c45f2),_0x1c45f2=undefined);try{_0x1fa3b6[_0x183550(0x1cd)]();}catch{}_0xb6b985(new AbortPrompt());},_0x1fa3b6[_0x7e1245(0x1d6)](_0x7e1245(0x1c0),_0x1c45f2);}),_0x318c55=()=>{const _0x471d19=_0x22a227;_0x1c45f2&&(_0x1fa3b6[_0x471d19(0x1e0)](_0x471d19(0x1c0),_0x1c45f2),_0x1c45f2=undefined);try{_0x1fa3b6[_0x471d19(0x1cd)]();}catch{}};return{'rl':_0x1fa3b6,'abortPromise':_0x16cb6b,'disposeSuccess':_0x318c55};}function a31_0x52f6(){const _0x2f6731=['validation','global','2047200UimJNA','string','Invalid\x20env\x20\x22',')\x20instead\x20of\x20project','Target\x20environment\x20(default\x20','flagMissing','297WnIVNX','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','toLowerCase','stdout','2071713NWxAJB','question','9NEifuk','File\x20','4330128nFZPbI','entries','):\x20','cwd','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','race','yes','stdin','\x20\x20default:\x20','SIGINT','utf8','Override\x20imported\x20default\x20env','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','[y/N]','App\x20code\x20cannot\x20be\x20empty.','4FUwDtF','join','env','apiDir','riskLevel','includes','\x20init\x20—\x20Create\x20','close','file','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','3287940RfGpDd','project','AbortPrompt','log','\x20\x20env:\x20\x20\x20\x20\x20','once','325110VcNRme','4quskMR','Source\x20file\x20not\x20found:\x20','Override\x20imported\x20default\x20appcode','Failed\x20to\x20parse\x20source\x20file:\x20','newConfigFileName','apps','defaultApp','\x0aInitialized\x20','removeListener','232429pZADLA','Initialized\x20','Write\x20to\x20global\x20(~/','8190679JZLZjF','Skip\x20confirmation\x20when\x20overwriting','appcode','trim','\x20\x20appcode:\x20','cancelled','[Y/n]','boolean','app','User\x20aborted\x20prompt','object'];a31_0x52f6=function(){return _0x2f6731;};return a31_0x52f6();}async function promptInput(_0x3bd7f6,_0x1760da){const _0x584fb3=a31_0x4c8aaa,{rl:_0x351d24,abortPromise:_0x4374ac,disposeSuccess:_0x112024}=createSafeRl(),_0x4a6610=new Promise(_0x461406=>{const _0x1289be=a31_0x5ad5,_0x247d6f=_0x1760da?'\x20\x20'+_0x3bd7f6+'\x20('+_0x1760da+_0x1289be(0x1b9):'\x20\x20'+_0x3bd7f6+':\x20';_0x351d24[_0x1289be(0x1fc)](_0x247d6f,_0x498f44=>{_0x112024(),_0x461406(_0x498f44['trim']()||_0x1760da);});});return Promise[_0x584fb3(0x1bc)]([_0x4a6610,_0x4374ac]);}async function promptYesNo(_0x7d5617,_0x383460){const _0x13dc5c=a31_0x4c8aaa,{rl:_0x3b50dd,abortPromise:_0x2f4083,disposeSuccess:_0x10df9a}=createSafeRl(),_0x4ae7ba=new Promise(_0x308733=>{const _0x770547=a31_0x5ad5,_0x5b7d98=_0x383460?_0x770547(0x1ea):_0x770547(0x1c4);_0x3b50dd[_0x770547(0x1fc)]('\x20\x20'+_0x7d5617+'\x20'+_0x5b7d98+':\x20',_0x1fa664=>{const _0x56a30c=_0x770547;_0x10df9a();const _0x1e265f=_0x1fa664['trim']()[_0x56a30c(0x1f9)]();if(_0x1e265f==='y'||_0x1e265f===_0x56a30c(0x1bd))_0x308733(!![]);else{if(_0x1e265f==='n'||_0x1e265f==='no')_0x308733(![]);else _0x308733(_0x383460);}});});return Promise[_0x13dc5c(0x1bc)]([_0x4ae7ba,_0x2f4083]);}function loadExisting(_0x2d52b2){if(!existsSync(_0x2d52b2))return null;return readConfigFile(_0x2d52b2);}function resolveFilePath(_0x4f7034){const _0x4f4cb6=a31_0x4c8aaa;return isAbsolute(_0x4f7034)?_0x4f7034:resolve(process[_0x4f4cb6(0x1ba)](),_0x4f7034);}function readSourceFile(_0x3b42a3){const _0x9d3798=a31_0x4c8aaa;try{const _0x1cefe2=readFileSync(_0x3b42a3,{'encoding':_0x9d3798(0x1c1)});return JSON['parse'](_0x1cefe2);}catch(_0x27e077){throw CliErrors['validation'](_0x9d3798(0x1db)+_0x27e077['message']);}}function resolveInitEnv(_0x4e3e7f){const _0x54e210=a31_0x4c8aaa,_0x42036e=_0x4e3e7f['env'];if(_0x42036e===undefined||_0x42036e==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x54e210(0x1cb)](_0x42036e))throw CliErrors[_0x54e210(0x1ef)](_0x54e210(0x1f3)+_0x42036e+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x54e210(0x1c7)](',\x20'));return _0x42036e;}
1
+ const a31_0x2014d5=a31_0x56d6;(function(_0x5009aa,_0x5f0794){const _0x1e5023=a31_0x56d6,_0x4e8209=_0x5009aa();while(!![]){try{const _0x2e1084=-parseInt(_0x1e5023(0x13f))/0x1*(parseInt(_0x1e5023(0x115))/0x2)+-parseInt(_0x1e5023(0x132))/0x3+parseInt(_0x1e5023(0x134))/0x4*(parseInt(_0x1e5023(0x136))/0x5)+-parseInt(_0x1e5023(0x106))/0x6+-parseInt(_0x1e5023(0x125))/0x7*(-parseInt(_0x1e5023(0x10d))/0x8)+-parseInt(_0x1e5023(0x114))/0x9*(parseInt(_0x1e5023(0x127))/0xa)+parseInt(_0x1e5023(0x141))/0xb;if(_0x2e1084===_0x5f0794)break;else _0x4e8209['push'](_0x4e8209['shift']());}catch(_0x445025){_0x4e8209['push'](_0x4e8209['shift']());}}}(a31_0x22a8,0x6d5eb));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';function a31_0x22a8(){const _0x91d382=['toLowerCase','File\x20','Source\x20file\x20not\x20found:\x20','Override\x20imported\x20default\x20appcode','[y/N]','\x20\x20config:\x20\x20','riskLevel','\x20\x20default:\x20','newConfigFileName','file','Override\x20imported\x20default\x20env','join','Imported\x20from\x20','\x22.\x20Allowed:\x20','397224TStOPy','trim','removeListener','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','cwd','yes','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','16WOoUHq','env','once','cancelled','User\x20aborted\x20prompt','):\x20','appcode','2069109QpORFg','526UfRKmn','AbortPrompt','Initialized\x20','apiDir','log','parse','close','string','\x20\x20env:\x20\x20\x20\x20\x20','Invalid\x20env\x20\x22','[Y/n]','object','question','defaultApp','stdout','validation','158921CcwaGU','\x20init\x20—\x20Create\x20','10BCsJrB','race','app','apps','\x0aInitialized\x20','App\x20code\x20for\x20the\x20project','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','project',')\x20instead\x20of\x20project','Usage:\x20','Skip\x20confirmation\x20when\x20overwriting','1753641Bscevr','SIGINT','24964JnaBHl','entries','490FnfUYL','Failed\x20to\x20parse\x20source\x20file:\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','message','boolean','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','Aborted.','\x20\x20appcode:\x20','stdin','491uOkwoI','global','8808140WByiEn','name','flagMissing'];a31_0x22a8=function(){return _0x91d382;};return a31_0x22a8();}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a31_0x2014d5(0x11c),'description':a31_0x2014d5(0x12c)},{'name':a31_0x2014d5(0x10e),'type':a31_0x2014d5(0x11c),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2014d5(0x140),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x2014d5(0x14c)]+a31_0x2014d5(0x12f),'default':![]},{'name':'yes','type':'boolean','description':a31_0x2014d5(0x131),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':'string','description':a31_0x2014d5(0x138),'required':!![]},{'name':a31_0x2014d5(0x113),'type':a31_0x2014d5(0x11c),'description':a31_0x2014d5(0x147)},{'name':a31_0x2014d5(0x10e),'type':a31_0x2014d5(0x11c),'description':a31_0x2014d5(0x14e),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2014d5(0x140),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x2014d5(0x10b),'type':a31_0x2014d5(0x13a),'description':a31_0x2014d5(0x131),'default':![]}];export async function runInit(_0x50ffdb){const _0x2beab7=a31_0x2014d5,_0x237513=isNonInteractiveMode(_0x50ffdb),_0x3c5f5c=_0x50ffdb[_0x2beab7(0x140)]?_0x2beab7(0x140):_0x2beab7(0x12e),_0x5c3303=resolveWriteConfigPath(_0x3c5f5c);try{_0x237513?await runNonInteractive(_0x50ffdb,_0x5c3303):await runInteractive(_0x50ffdb,_0x5c3303);}catch(_0x243426){if(_0x243426 instanceof AbortPrompt)throw CliErrors[_0x2beab7(0x110)]();throw _0x243426;}}export async function runInitImport(_0x1031a9){const _0x53487c=a31_0x2014d5,_0x17ecd9=_0x1031a9[_0x53487c(0x140)]?_0x53487c(0x140):_0x53487c(0x12e),_0x394f4e=resolveWriteConfigPath(_0x17ecd9);await runFromImport(_0x1031a9,_0x394f4e);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x2014d5(0x118)]);async function runFromImport(_0x20a80c,_0x1f39cd){const _0x17bf8=a31_0x2014d5,_0x2361ce=resolveFilePath(_0x20a80c[_0x17bf8(0x14d)]);if(!existsSync(_0x2361ce))throw CliErrors[_0x17bf8(0x124)](_0x17bf8(0x146)+_0x2361ce);const _0x178a82=readSourceFile(_0x2361ce),_0x2c9ca2=convertToRuntimeConfig(_0x178a82);_0x20a80c[_0x17bf8(0x113)]&&(_0x2c9ca2[_0x17bf8(0x113)]=String(_0x20a80c['appcode']));_0x20a80c[_0x17bf8(0x10e)]&&(_0x2c9ca2[_0x17bf8(0x10e)]=resolveInitEnv(_0x20a80c));if(!_0x2c9ca2[_0x17bf8(0x113)])throw CliErrors['validation']('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x17bf8(0x109));await writeInitConfig(_0x1f39cd,_0x2c9ca2,_0x20a80c),console[_0x17bf8(0x119)](_0x17bf8(0x104)+_0x2361ce),console[_0x17bf8(0x119)](_0x17bf8(0x149)+_0x1f39cd),console['log'](_0x17bf8(0x13d)+_0x2c9ca2[_0x17bf8(0x113)]);if(_0x2c9ca2[_0x17bf8(0x122)])console['log'](_0x17bf8(0x14b)+_0x2c9ca2[_0x17bf8(0x122)]);}function convertToRuntimeConfig(_0x344fe8){const _0x43d633=a31_0x2014d5;if(_0x344fe8[_0x43d633(0x12a)]&&typeof _0x344fe8['apps']===_0x43d633(0x120))throw CliErrors[_0x43d633(0x124)](_0x43d633(0x12d),_0x43d633(0x13b));const _0x3a5da9={};for(const _0xdd9095 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x344fe8[_0xdd9095]!==undefined&&(_0x3a5da9[_0xdd9095]=_0x344fe8[_0xdd9095]);}return!_0x3a5da9[_0x43d633(0x14a)]&&(_0x3a5da9[_0x43d633(0x14a)]=DEFAULT_CONFIG_VALUES[_0x43d633(0x14a)]),_0x3a5da9;}async function runNonInteractive(_0x3c1363,_0x49d808){const _0x5357b9=a31_0x2014d5,_0x1480f3=_0x3c1363['appcode'];if(!_0x1480f3)throw CliErrors[_0x5357b9(0x143)](_0x5357b9(0x113),_0x5357b9(0x130)+CLI_BIN_NAME+_0x5357b9(0x10c));const _0x3acb4c=resolveInitEnv(_0x3c1363);await writeInitConfig(_0x49d808,{'appcode':_0x1480f3,'env':_0x3acb4c},_0x3c1363),console['log'](_0x5357b9(0x117)+_0x49d808),console[_0x5357b9(0x119)](_0x5357b9(0x13d)+_0x1480f3),console['log'](_0x5357b9(0x11d)+_0x3acb4c);}async function runInteractive(_0x21efd8,_0x3a9343){const _0x1c957d=a31_0x2014d5,_0xbd3605=loadExisting(_0x3a9343),_0x3eb9a3=typeof _0xbd3605?.['appcode']==='string'?_0xbd3605[_0x1c957d(0x113)]:'',_0xf10c70=resolveInitEnv(_0x21efd8);console['log'](CLI_BIN_NAME+_0x1c957d(0x126)+PRODUCT_CONFIG[_0x1c957d(0x14c)]+'\x0a');if(existsSync(_0x3a9343)&&!_0x21efd8[_0x1c957d(0x10b)]){const _0x19ade0=await promptYesNo(_0x1c957d(0x145)+_0x3a9343+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x19ade0){console[_0x1c957d(0x119)](_0x1c957d(0x13c));return;}}const _0x5bf381=typeof _0x21efd8[_0x1c957d(0x113)]==='string'?_0x21efd8[_0x1c957d(0x113)][_0x1c957d(0x107)]():'';let _0x269a15=_0x5bf381;!_0x269a15&&(_0x269a15=await promptInput('App\x20code',_0x3eb9a3));if(!_0x269a15[_0x1c957d(0x107)]())throw CliErrors[_0x1c957d(0x124)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x3a9343,{'appcode':_0x269a15['trim'](),'env':_0xf10c70},_0x21efd8),console[_0x1c957d(0x119)](_0x1c957d(0x12b)+_0x3a9343),console[_0x1c957d(0x119)](_0x1c957d(0x13d)+_0x269a15[_0x1c957d(0x107)]()),console[_0x1c957d(0x119)](_0x1c957d(0x11d)+_0xf10c70);}async function writeInitConfig(_0x10e7d4,_0x512475,_0x1b4faf){const _0x5d3765=a31_0x2014d5;let _0x5dd7ac={};existsSync(_0x10e7d4)&&!_0x1b4faf['yes']&&(_0x5dd7ac=readConfigFile(_0x10e7d4));for(const [_0x362ee6,_0x142bb3]of Object[_0x5d3765(0x135)](_0x512475)){_0x142bb3!==undefined&&(_0x5dd7ac[_0x362ee6]=_0x142bb3);}if(_0x5dd7ac[_0x5d3765(0x129)])delete _0x5dd7ac[_0x5d3765(0x129)];writeConfigFile(_0x10e7d4,_0x5dd7ac);}class AbortPrompt extends Error{constructor(){const _0x20b2c9=a31_0x2014d5;super(_0x20b2c9(0x111)),this[_0x20b2c9(0x142)]=_0x20b2c9(0x116);}}function createSafeRl(){const _0x384ec4=a31_0x2014d5,_0x28e64d=createInterface({'input':process[_0x384ec4(0x13e)],'output':process[_0x384ec4(0x123)]});let _0x3cc819;const _0x1bc2fa=new Promise((_0x425791,_0x2a0a85)=>{const _0x54d24c=_0x384ec4;_0x3cc819=()=>{const _0x198f13=a31_0x56d6;_0x3cc819&&(_0x28e64d[_0x198f13(0x108)](_0x198f13(0x133),_0x3cc819),_0x3cc819=undefined);try{_0x28e64d[_0x198f13(0x11b)]();}catch{}_0x2a0a85(new AbortPrompt());},_0x28e64d[_0x54d24c(0x10f)](_0x54d24c(0x133),_0x3cc819);}),_0x1c21f7=()=>{const _0x1e48e0=_0x384ec4;_0x3cc819&&(_0x28e64d[_0x1e48e0(0x108)](_0x1e48e0(0x133),_0x3cc819),_0x3cc819=undefined);try{_0x28e64d[_0x1e48e0(0x11b)]();}catch{}};return{'rl':_0x28e64d,'abortPromise':_0x1bc2fa,'disposeSuccess':_0x1c21f7};}async function promptInput(_0xb96c0f,_0x181e3b){const {rl:_0xbdc190,abortPromise:_0x32694e,disposeSuccess:_0x59d59b}=createSafeRl(),_0x4a2324=new Promise(_0x351153=>{const _0x3d1864=a31_0x56d6,_0x194f6b=_0x181e3b?'\x20\x20'+_0xb96c0f+'\x20('+_0x181e3b+_0x3d1864(0x112):'\x20\x20'+_0xb96c0f+':\x20';_0xbdc190[_0x3d1864(0x121)](_0x194f6b,_0x314b3e=>{_0x59d59b(),_0x351153(_0x314b3e['trim']()||_0x181e3b);});});return Promise['race']([_0x4a2324,_0x32694e]);}async function promptYesNo(_0x10e416,_0x5383e1){const _0x446702=a31_0x2014d5,{rl:_0x12884f,abortPromise:_0x527e97,disposeSuccess:_0x127972}=createSafeRl(),_0x4c8dcf=new Promise(_0x31e01c=>{const _0x158984=a31_0x56d6,_0x14dfe0=_0x5383e1?_0x158984(0x11f):_0x158984(0x148);_0x12884f[_0x158984(0x121)]('\x20\x20'+_0x10e416+'\x20'+_0x14dfe0+':\x20',_0x23c72f=>{const _0x3ffeb8=_0x158984;_0x127972();const _0x3b072f=_0x23c72f[_0x3ffeb8(0x107)]()[_0x3ffeb8(0x144)]();if(_0x3b072f==='y'||_0x3b072f===_0x3ffeb8(0x10b))_0x31e01c(!![]);else{if(_0x3b072f==='n'||_0x3b072f==='no')_0x31e01c(![]);else _0x31e01c(_0x5383e1);}});});return Promise[_0x446702(0x128)]([_0x4c8dcf,_0x527e97]);}function loadExisting(_0x3c5cd1){if(!existsSync(_0x3c5cd1))return null;return readConfigFile(_0x3c5cd1);}function a31_0x56d6(_0x2e6549,_0x275fb2){_0x2e6549=_0x2e6549-0x103;const _0x22a887=a31_0x22a8();let _0x56d6df=_0x22a887[_0x2e6549];return _0x56d6df;}function resolveFilePath(_0x8a4ff9){const _0xa61152=a31_0x2014d5;return isAbsolute(_0x8a4ff9)?_0x8a4ff9:resolve(process[_0xa61152(0x10a)](),_0x8a4ff9);}function readSourceFile(_0x101b90){const _0x1c6b36=a31_0x2014d5;try{const _0x3ef04e=readFileSync(_0x101b90,{'encoding':'utf8'});return JSON[_0x1c6b36(0x11a)](_0x3ef04e);}catch(_0x46f433){throw CliErrors[_0x1c6b36(0x124)](_0x1c6b36(0x137)+_0x46f433[_0x1c6b36(0x139)]);}}function resolveInitEnv(_0x17832){const _0x467fda=a31_0x2014d5,_0x4bccba=_0x17832['env'];if(_0x4bccba===undefined||_0x4bccba==='')return DEFAULT_CONFIG_VALUES[_0x467fda(0x10e)];if(!RUNTIME_ENV_VALUES['includes'](_0x4bccba))throw CliErrors[_0x467fda(0x124)](_0x467fda(0x11e)+_0x4bccba+_0x467fda(0x105)+RUNTIME_ENV_VALUES[_0x467fda(0x103)](',\x20'));return _0x4bccba;}
@@ -1 +1 @@
1
- const a32_0x111545=a32_0x19f0;(function(_0x35fc3c,_0x345b21){const _0x459c88=a32_0x19f0,_0x4b9744=_0x35fc3c();while(!![]){try{const _0x300ad0=-parseInt(_0x459c88(0x179))/0x1+parseInt(_0x459c88(0x181))/0x2+parseInt(_0x459c88(0x164))/0x3*(-parseInt(_0x459c88(0x168))/0x4)+-parseInt(_0x459c88(0x169))/0x5+parseInt(_0x459c88(0x17a))/0x6+parseInt(_0x459c88(0x170))/0x7*(-parseInt(_0x459c88(0x16e))/0x8)+parseInt(_0x459c88(0x18a))/0x9;if(_0x300ad0===_0x345b21)break;else _0x4b9744['push'](_0x4b9744['shift']());}catch(_0x18ad82){_0x4b9744['push'](_0x4b9744['shift']());}}}(a32_0x4399,0x20813));function a32_0x19f0(_0x4a3aae,_0x5ddfec){_0x4a3aae=_0x4a3aae-0x152;const _0x4399fe=a32_0x4399();let _0x19f046=_0x4399fe[_0x4a3aae];return _0x19f046;}import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':'title','type':a32_0x111545(0x182),'required':!![],'description':a32_0x111545(0x15b)},FILE_FLAG={'name':'file','type':a32_0x111545(0x182),'required':!![],'description':a32_0x111545(0x153)},QUERY_FLAG={'name':a32_0x111545(0x16c),'type':a32_0x111545(0x182),'required':!![],'description':a32_0x111545(0x18c)},TOPK_FLAG={'name':a32_0x111545(0x15c),'type':'number','description':a32_0x111545(0x171)};function readKnowledgeFile(_0x23d7ac){const _0xb3f51d=a32_0x111545;if(!_0x23d7ac)throw CliErrors[_0xb3f51d(0x176)](_0xb3f51d(0x155));if(!existsSync(_0x23d7ac))throw CliErrors[_0xb3f51d(0x176)]('File\x20not\x20found:\x20'+_0x23d7ac);if(!statSync(_0x23d7ac)['isFile']())throw CliErrors['validation'](_0xb3f51d(0x160)+_0x23d7ac);return readFileSync(_0x23d7ac,'utf8');}function summarizePersonalItem(_0x7845a2){const _0xdb4782=a32_0x111545;return{'id':_0x7845a2['id'],'title':_0x7845a2[_0xdb4782(0x17b)],'version':_0x7845a2[_0xdb4782(0x178)],'ragStatus':_0x7845a2['ragStatus'],'ragErrorMessage':_0x7845a2[_0xdb4782(0x172)],'updateTime':_0x7845a2['updateTime']};}function detailPersonalItem(_0x47c0a2){const _0x2b7b94=a32_0x111545;return{'id':_0x47c0a2['id'],'appCode':_0x47c0a2[_0x2b7b94(0x17c)],'scope':_0x47c0a2['scope'],'userId':_0x47c0a2['userId'],'title':_0x47c0a2[_0x2b7b94(0x17b)],'content':_0x47c0a2[_0x2b7b94(0x161)]??'','version':_0x47c0a2[_0x2b7b94(0x178)],'ragStatus':_0x47c0a2[_0x2b7b94(0x152)],'ragErrorMessage':_0x47c0a2[_0x2b7b94(0x172)],'createTime':_0x47c0a2[_0x2b7b94(0x154)],'updateTime':_0x47c0a2['updateTime']};}function summarizeSearchHit(_0x465361){const _0x5d1b45=a32_0x111545;return{'scope':_0x465361['scope'],'docId':_0x465361[_0x5d1b45(0x187)],'score':_0x465361[_0x5d1b45(0x159)],'weightedScore':_0x465361[_0x5d1b45(0x186)],'content':_0x465361[_0x5d1b45(0x161)],'metadata':_0x465361[_0x5d1b45(0x17e)]};}function a32_0x4399(){const _0x43ca9a=['ragErrorMessage','build','write','read','validation','/update','version','261829AAWBkn','49110eycMMw','title','appCode','map','metadata','POST','verbose','44072cTqkXt','string','description','file','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','weightedScore','docId','body','flag','6470343gMibWN','Created\x20KB\x20entry\x20','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','length','ragStatus','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','createTime','File\x20path\x20is\x20required.','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','--topk\x20must\x20be\x20a\x20positive\x20number.','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','score','Override\x20the\x20existing\x20entry\x20title','Personal\x20knowledge-base\x20entry\x20title','topk','Search\x20query\x20is\x20required.','search','num','File\x20is\x20not\x20a\x20regular\x20file:\x20','content','bool','Personal\x20knowledge-base\x20entry\x20ID','460377DhjrZZ','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','detail','4vLXLcz','438775AXDVqu','update','str','query','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','903728xuZsgI','trim','7NqlrOs','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return'];a32_0x4399=function(){return _0x43ca9a;};return a32_0x4399();}function readTopK(_0x290fc4){const _0x4f768d=a32_0x111545,_0x38a810=_0x290fc4[_0x4f768d(0x189)](_0x4f768d(0x15c));if(_0x38a810===undefined||_0x38a810===null||_0x38a810==='')return undefined;const _0x2bbab1=_0x290fc4[_0x4f768d(0x15f)](_0x4f768d(0x15c));if(!Number['isFinite'](_0x2bbab1)||_0x2bbab1<0x1)throw CliErrors['validation'](_0x4f768d(0x157));return _0x2bbab1;}const kbList={'service':'kb','command':'list','description':a32_0x111545(0x165),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x20de32){const _0x1d5ba5=a32_0x111545,_0x506cc5=await listPersonalKnowledgeBaseItems(_0x20de32['appCode']);if(_0x20de32[_0x1d5ba5(0x162)](_0x1d5ba5(0x180)))return{'ok':!![],'data':{'total':_0x506cc5['length'],'items':_0x506cc5}};return{'ok':!![],'data':{'total':_0x506cc5[_0x1d5ba5(0x18d)],'items':_0x506cc5[_0x1d5ba5(0x17d)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x111545(0x167),'description':a32_0x111545(0x166),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x111545(0x163)}],async 'execute'(_0x84d711){const _0x179b75=a32_0x111545,_0x279414=await getPersonalKnowledgeBaseItem(_0x84d711[_0x179b75(0x15f)]('id'),_0x84d711[_0x179b75(0x17c)]);return{'ok':!![],'data':detailPersonalItem(_0x279414)};}},kbCreate={'service':'kb','command':'create','description':a32_0x111545(0x16d),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x1d508c){const _0x52386a=a32_0x111545,_0x5718d5=_0x1d508c[_0x52386a(0x16b)](_0x52386a(0x17b)),_0x46657f=readKnowledgeFile(_0x1d508c['str'](_0x52386a(0x184))),_0x254f7e=await createPersonalKnowledgeBaseItem(_0x1d508c[_0x52386a(0x17c)],{'title':_0x5718d5,'content':_0x46657f});return{'ok':!![],'data':summarizePersonalItem(_0x254f7e),'message':_0x52386a(0x18b)+_0x254f7e['id']+'\x20('+_0x254f7e['title']+')'};},async 'dryRun'(_0x356635){const _0x373209=a32_0x111545,_0x1bfd8a=_0x356635['str'](_0x373209(0x17b)),_0xf68e46=readKnowledgeFile(_0x356635['str'](_0x373209(0x184)));return dryRun(_0x373209(0x17f),'/client/knowledge-base/personal/create')[_0x373209(0x188)]({'appCode':_0x356635[_0x373209(0x17c)],'title':_0x1bfd8a,'content':_0xf68e46})[_0x373209(0x183)](_0x373209(0x185)+_0x1bfd8a+'\x22')[_0x373209(0x173)]();}},kbUpdate={'service':'kb','command':a32_0x111545(0x16a),'description':a32_0x111545(0x156),'risk':a32_0x111545(0x174),'flags':[{...ID_FLAG,'description':a32_0x111545(0x163)},{...TITLE_FLAG,'required':![],'description':a32_0x111545(0x15a)},FILE_FLAG],async 'execute'(_0x55d6e7){const _0x5123e7=a32_0x111545,_0x3d9c16=_0x55d6e7[_0x5123e7(0x15f)]('id'),_0x6b5253=readKnowledgeFile(_0x55d6e7[_0x5123e7(0x16b)](_0x5123e7(0x184))),_0x1de9af=_0x55d6e7[_0x5123e7(0x16b)](_0x5123e7(0x17b))||(await getPersonalKnowledgeBaseItem(_0x3d9c16,_0x55d6e7[_0x5123e7(0x17c)]))[_0x5123e7(0x17b)],_0x34edc2=await updatePersonalKnowledgeBaseItem(_0x3d9c16,_0x55d6e7[_0x5123e7(0x17c)],{'title':_0x1de9af,'content':_0x6b5253});return{'ok':!![],'data':summarizePersonalItem(_0x34edc2),'message':'Updated\x20KB\x20entry\x20'+_0x34edc2['id']+'\x20('+_0x34edc2['title']+')'};},async 'dryRun'(_0x42ca1a){const _0x24ad0a=a32_0x111545,_0x3ac549=_0x42ca1a[_0x24ad0a(0x15f)]('id'),_0x591b5f=readKnowledgeFile(_0x42ca1a['str']('file')),_0x2e91a2=_0x42ca1a['str']('title')||(await getPersonalKnowledgeBaseItem(_0x3ac549,_0x42ca1a['appCode']))[_0x24ad0a(0x17b)];return dryRun(_0x24ad0a(0x17f),'/client/knowledge-base/personal/'+_0x3ac549+_0x24ad0a(0x177))[_0x24ad0a(0x188)]({'appCode':_0x42ca1a[_0x24ad0a(0x17c)],'title':_0x2e91a2,'content':_0x591b5f})[_0x24ad0a(0x183)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x3ac549)['build']();}},kbSearch={'service':'kb','command':a32_0x111545(0x15e),'description':a32_0x111545(0x158),'risk':a32_0x111545(0x175),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x2b798f){const _0x4172e9=a32_0x111545;if(!_0x2b798f[_0x4172e9(0x16b)](_0x4172e9(0x16c))[_0x4172e9(0x16f)]())throw CliErrors[_0x4172e9(0x176)](_0x4172e9(0x15d));readTopK(_0x2b798f);},async 'execute'(_0x2d00e6){const _0x3c0310=a32_0x111545,_0x6a4cea=_0x2d00e6[_0x3c0310(0x16b)](_0x3c0310(0x16c))[_0x3c0310(0x16f)](),_0xd36515=readTopK(_0x2d00e6),_0x3e39d6=await searchKnowledgeBase(_0x2d00e6['appCode'],{'query':_0x6a4cea,'topK':_0xd36515});return{'ok':!![],'data':{'total':_0x3e39d6[_0x3c0310(0x18d)],'hits':_0x3e39d6[_0x3c0310(0x17d)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a32_0x564acd=a32_0x316d;(function(_0x402efc,_0x41370e){const _0xa079ad=a32_0x316d,_0x5140d7=_0x402efc();while(!![]){try{const _0x4b8e91=parseInt(_0xa079ad(0x1f1))/0x1+parseInt(_0xa079ad(0x1e2))/0x2*(parseInt(_0xa079ad(0x208))/0x3)+parseInt(_0xa079ad(0x1db))/0x4*(parseInt(_0xa079ad(0x1d1))/0x5)+parseInt(_0xa079ad(0x205))/0x6+parseInt(_0xa079ad(0x1f9))/0x7+-parseInt(_0xa079ad(0x207))/0x8*(-parseInt(_0xa079ad(0x1fd))/0x9)+-parseInt(_0xa079ad(0x1cc))/0xa*(parseInt(_0xa079ad(0x1da))/0xb);if(_0x4b8e91===_0x41370e)break;else _0x5140d7['push'](_0x5140d7['shift']());}catch(_0x254b8c){_0x5140d7['push'](_0x5140d7['shift']());}}}(a32_0x1cd9,0xd8bdd));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x564acd(0x1ec),'type':a32_0x564acd(0x1d5),'required':!![],'description':a32_0x564acd(0x206)},FILE_FLAG={'name':a32_0x564acd(0x209),'type':'string','required':!![],'description':a32_0x564acd(0x1cd)},QUERY_FLAG={'name':a32_0x564acd(0x1cf),'type':'string','required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':a32_0x564acd(0x1ea),'type':'number','description':a32_0x564acd(0x203)};function readKnowledgeFile(_0x418fba){const _0x45aa90=a32_0x564acd;if(!_0x418fba)throw CliErrors[_0x45aa90(0x1cb)]('File\x20path\x20is\x20required.');if(!existsSync(_0x418fba))throw CliErrors[_0x45aa90(0x1cb)](_0x45aa90(0x1d0)+_0x418fba);if(!statSync(_0x418fba)[_0x45aa90(0x1e8)]())throw CliErrors[_0x45aa90(0x1cb)](_0x45aa90(0x1e0)+_0x418fba);return readFileSync(_0x418fba,_0x45aa90(0x1dc));}function a32_0x316d(_0x2acfd4,_0x90ceaa){_0x2acfd4=_0x2acfd4-0x1ca;const _0x1cd957=a32_0x1cd9();let _0x316d71=_0x1cd957[_0x2acfd4];return _0x316d71;}function summarizePersonalItem(_0x350bc9){const _0x4805f5=a32_0x564acd;return{'id':_0x350bc9['id'],'title':_0x350bc9[_0x4805f5(0x1ec)],'version':_0x350bc9[_0x4805f5(0x1e7)],'ragStatus':_0x350bc9[_0x4805f5(0x1eb)],'ragErrorMessage':_0x350bc9[_0x4805f5(0x1d6)],'updateTime':_0x350bc9['updateTime']};}function detailPersonalItem(_0x339a07){const _0x4dcdcb=a32_0x564acd;return{'id':_0x339a07['id'],'appCode':_0x339a07[_0x4dcdcb(0x1dd)],'scope':_0x339a07[_0x4dcdcb(0x1f8)],'userId':_0x339a07[_0x4dcdcb(0x1f6)],'title':_0x339a07[_0x4dcdcb(0x1ec)],'content':_0x339a07[_0x4dcdcb(0x1d2)]??'','version':_0x339a07[_0x4dcdcb(0x1e7)],'ragStatus':_0x339a07[_0x4dcdcb(0x1eb)],'ragErrorMessage':_0x339a07[_0x4dcdcb(0x1d6)],'createTime':_0x339a07[_0x4dcdcb(0x1df)],'updateTime':_0x339a07[_0x4dcdcb(0x1e1)]};}function a32_0x1cd9(){const _0x1e63ba=['ragErrorMessage','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Created\x20KB\x20entry\x20','/client/knowledge-base/personal/','3179mIYgDm','1579252AYhZiw','utf8','appCode','build','createTime','File\x20is\x20not\x20a\x20regular\x20file:\x20','updateTime','156HahiYz','trim','score','search','num','version','isFile','Override\x20the\x20existing\x20entry\x20title','topk','ragStatus','title','verbose','body','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','length','673946zScouG','metadata','read','str','docId','userId','isFinite','scope','6958959BRBqFj','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','create','/client/knowledge-base/personal/create','27aQLSRw','Updated\x20KB\x20entry\x20','Personal\x20knowledge-base\x20entry\x20ID','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','bool','POST','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','list','8840742oREDdn','Personal\x20knowledge-base\x20entry\x20title','4234344DDwaQP','14958DeQixG','file','map','validation','187370uBNMEw','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','/update','query','File\x20not\x20found:\x20','15KzUNOF','content','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','detail','string'];a32_0x1cd9=function(){return _0x1e63ba;};return a32_0x1cd9();}function summarizeSearchHit(_0x388d49){const _0x51f4a2=a32_0x564acd;return{'scope':_0x388d49[_0x51f4a2(0x1f8)],'docId':_0x388d49[_0x51f4a2(0x1f5)],'score':_0x388d49[_0x51f4a2(0x1e4)],'weightedScore':_0x388d49['weightedScore'],'content':_0x388d49[_0x51f4a2(0x1d2)],'metadata':_0x388d49[_0x51f4a2(0x1f2)]};}function readTopK(_0x4e9f81){const _0x32335a=a32_0x564acd,_0x4a1fe1=_0x4e9f81['flag']('topk');if(_0x4a1fe1===undefined||_0x4a1fe1===null||_0x4a1fe1==='')return undefined;const _0x2af16e=_0x4e9f81[_0x32335a(0x1e6)](_0x32335a(0x1ea));if(!Number[_0x32335a(0x1f7)](_0x2af16e)||_0x2af16e<0x1)throw CliErrors[_0x32335a(0x1cb)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x2af16e;}const kbList={'service':'kb','command':a32_0x564acd(0x204),'description':a32_0x564acd(0x200),'risk':a32_0x564acd(0x1f3),'flags':[VERBOSE_FLAG],async 'execute'(_0x251410){const _0x2a143f=a32_0x564acd,_0x5000f8=await listPersonalKnowledgeBaseItems(_0x251410['appCode']);if(_0x251410[_0x2a143f(0x201)](_0x2a143f(0x1ed)))return{'ok':!![],'data':{'total':_0x5000f8[_0x2a143f(0x1f0)],'items':_0x5000f8}};return{'ok':!![],'data':{'total':_0x5000f8['length'],'items':_0x5000f8['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x564acd(0x1d4),'description':a32_0x564acd(0x1d3),'risk':a32_0x564acd(0x1f3),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'}],async 'execute'(_0x26ef0c){const _0x517d25=a32_0x564acd,_0x44a44d=await getPersonalKnowledgeBaseItem(_0x26ef0c['num']('id'),_0x26ef0c[_0x517d25(0x1dd)]);return{'ok':!![],'data':detailPersonalItem(_0x44a44d)};}},kbCreate={'service':'kb','command':a32_0x564acd(0x1fb),'description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x3ea688){const _0x13df59=a32_0x564acd,_0x2e0441=_0x3ea688[_0x13df59(0x1f4)](_0x13df59(0x1ec)),_0x193136=readKnowledgeFile(_0x3ea688[_0x13df59(0x1f4)](_0x13df59(0x209))),_0x528a1a=await createPersonalKnowledgeBaseItem(_0x3ea688[_0x13df59(0x1dd)],{'title':_0x2e0441,'content':_0x193136});return{'ok':!![],'data':summarizePersonalItem(_0x528a1a),'message':_0x13df59(0x1d8)+_0x528a1a['id']+'\x20('+_0x528a1a[_0x13df59(0x1ec)]+')'};},async 'dryRun'(_0x545336){const _0x1eec89=a32_0x564acd,_0x2c276a=_0x545336['str'](_0x1eec89(0x1ec)),_0x44e315=readKnowledgeFile(_0x545336[_0x1eec89(0x1f4)](_0x1eec89(0x209)));return dryRun(_0x1eec89(0x202),_0x1eec89(0x1fc))[_0x1eec89(0x1ee)]({'appCode':_0x545336[_0x1eec89(0x1dd)],'title':_0x2c276a,'content':_0x44e315})['description'](_0x1eec89(0x1ef)+_0x2c276a+'\x22')['build']();}},kbUpdate={'service':'kb','command':'update','description':a32_0x564acd(0x1d7),'risk':'write','flags':[{...ID_FLAG,'description':a32_0x564acd(0x1ff)},{...TITLE_FLAG,'required':![],'description':a32_0x564acd(0x1e9)},FILE_FLAG],async 'execute'(_0x2b79ae){const _0x520db8=a32_0x564acd,_0x3d644b=_0x2b79ae['num']('id'),_0x3be158=readKnowledgeFile(_0x2b79ae['str']('file')),_0x2b83cc=_0x2b79ae[_0x520db8(0x1f4)](_0x520db8(0x1ec))||(await getPersonalKnowledgeBaseItem(_0x3d644b,_0x2b79ae[_0x520db8(0x1dd)]))[_0x520db8(0x1ec)],_0x328881=await updatePersonalKnowledgeBaseItem(_0x3d644b,_0x2b79ae[_0x520db8(0x1dd)],{'title':_0x2b83cc,'content':_0x3be158});return{'ok':!![],'data':summarizePersonalItem(_0x328881),'message':_0x520db8(0x1fe)+_0x328881['id']+'\x20('+_0x328881[_0x520db8(0x1ec)]+')'};},async 'dryRun'(_0x25fd2e){const _0x6f7e6d=a32_0x564acd,_0x248cac=_0x25fd2e[_0x6f7e6d(0x1e6)]('id'),_0x336d07=readKnowledgeFile(_0x25fd2e['str']('file')),_0x21aa8f=_0x25fd2e[_0x6f7e6d(0x1f4)](_0x6f7e6d(0x1ec))||(await getPersonalKnowledgeBaseItem(_0x248cac,_0x25fd2e[_0x6f7e6d(0x1dd)]))[_0x6f7e6d(0x1ec)];return dryRun(_0x6f7e6d(0x202),_0x6f7e6d(0x1d9)+_0x248cac+_0x6f7e6d(0x1ce))['body']({'appCode':_0x25fd2e[_0x6f7e6d(0x1dd)],'title':_0x21aa8f,'content':_0x336d07})['description']('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x248cac)[_0x6f7e6d(0x1de)]();}},kbSearch={'service':'kb','command':a32_0x564acd(0x1e5),'description':a32_0x564acd(0x1fa),'risk':a32_0x564acd(0x1f3),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x2c2dff){const _0x1fcc05=a32_0x564acd;if(!_0x2c2dff['str'](_0x1fcc05(0x1cf))[_0x1fcc05(0x1e3)]())throw CliErrors[_0x1fcc05(0x1cb)]('Search\x20query\x20is\x20required.');readTopK(_0x2c2dff);},async 'execute'(_0x284526){const _0x365a44=a32_0x564acd,_0x45ca25=_0x284526[_0x365a44(0x1f4)](_0x365a44(0x1cf))[_0x365a44(0x1e3)](),_0x4bf356=readTopK(_0x284526),_0x54cb1b=await searchKnowledgeBase(_0x284526[_0x365a44(0x1dd)],{'query':_0x45ca25,'topK':_0x4bf356});return{'ok':!![],'data':{'total':_0x54cb1b[_0x365a44(0x1f0)],'hits':_0x54cb1b[_0x365a44(0x1ca)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- function a33_0x337f(_0xd20375,_0x236666){_0xd20375=_0xd20375-0x12c;const _0x3f8718=a33_0x3f87();let _0x337fce=_0x3f8718[_0xd20375];return _0x337fce;}function a33_0x3f87(){const _0x12f43c=['\x20\x20\x20Time:\x20','readLogs','*\x20Logs\x20cleared','forEach','show','length','\x20logs:\x0a','12106408wRmDpa','write','read','1335442UMCrXt','22272480cBnwRi','35106krhofl','Clear\x20command\x20history\x20logs','\x20\x20\x20Duration:\x20','2qLZpJI','error','logs','328UYZRUA','message','en-US','*\x20No\x20logs\x20found','7646295qETnOr','log','level','1861174SGAboQ','toLocaleString','keys','clear','View\x20command\x20history\x20logs','stringify','10283292smcjtA','details','clearLogs','timestamp','command'];a33_0x3f87=function(){return _0x12f43c;};return a33_0x3f87();}const a33_0x7d6737=a33_0x337f;(function(_0x3ffb39,_0x76bbdb){const _0x416bd7=a33_0x337f,_0x37433d=_0x3ffb39();while(!![]){try{const _0x3bc4a2=parseInt(_0x416bd7(0x13b))/0x1*(parseInt(_0x416bd7(0x140))/0x2)+-parseInt(_0x416bd7(0x13d))/0x3*(parseInt(_0x416bd7(0x143))/0x4)+parseInt(_0x416bd7(0x147))/0x5+-parseInt(_0x416bd7(0x12c))/0x6+-parseInt(_0x416bd7(0x14a))/0x7+-parseInt(_0x416bd7(0x138))/0x8+parseInt(_0x416bd7(0x13c))/0x9;if(_0x3bc4a2===_0x76bbdb)break;else _0x37433d['push'](_0x37433d['shift']());}catch(_0x5c3a93){_0x37433d['push'](_0x37433d['shift']());}}}(a33_0x3f87,0xd8808));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0xbea31a){const _0x23384d=a33_0x337f;if(_0xbea31a['length']===0x0){console[_0x23384d(0x148)](_0x23384d(0x146));return;}console[_0x23384d(0x148)]('*\x20'+CLI_DISPLAY_NAME+_0x23384d(0x137)),_0xbea31a[_0x23384d(0x134)]((_0x3c71e6,_0x561da6)=>{const _0x46f14a=_0x23384d,_0x1491aa=new Date(_0x3c71e6[_0x46f14a(0x12f)])[_0x46f14a(0x14b)](_0x46f14a(0x145)),_0x495322=_0x3c71e6[_0x46f14a(0x149)]==='success'?'√':_0x3c71e6[_0x46f14a(0x149)]===_0x46f14a(0x141)?'×':_0x3c71e6[_0x46f14a(0x149)]==='warn'?'!':'i';console[_0x46f14a(0x148)](_0x561da6+0x1+'.\x20'+_0x495322+'\x20['+_0x3c71e6[_0x46f14a(0x130)]+']\x20'+_0x3c71e6[_0x46f14a(0x144)]),console[_0x46f14a(0x148)](_0x46f14a(0x131)+_0x1491aa),_0x3c71e6['duration']&&console['log'](_0x46f14a(0x13f)+_0x3c71e6['duration']+'ms'),_0x3c71e6['details']&&Object[_0x46f14a(0x14c)](_0x3c71e6[_0x46f14a(0x12d)])[_0x46f14a(0x136)]>0x0&&console[_0x46f14a(0x148)]('\x20\x20\x20Details:\x20'+JSON[_0x46f14a(0x14f)](_0x3c71e6['details'],null,0x2)),console[_0x46f14a(0x148)]('');});}export const logsDefinitions=[{'service':a33_0x7d6737(0x142),'command':a33_0x7d6737(0x135),'description':a33_0x7d6737(0x14e),'risk':a33_0x7d6737(0x13a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1b9227){const _0x203fca=a33_0x7d6737;return printLogs(logger[_0x203fca(0x132)]()),{'ok':!![]};}},{'service':a33_0x7d6737(0x142),'command':a33_0x7d6737(0x14d),'description':a33_0x7d6737(0x13e),'risk':a33_0x7d6737(0x139),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x318365){const _0x4664a5=a33_0x7d6737;return logger[_0x4664a5(0x12e)](),console[_0x4664a5(0x148)](_0x4664a5(0x133)),{'ok':!![]};}}];
1
+ const a33_0x470aec=a33_0x2d9f;(function(_0x28b6dc,_0xc0dc5c){const _0x2db959=a33_0x2d9f,_0x228b1d=_0x28b6dc();while(!![]){try{const _0xa2452d=parseInt(_0x2db959(0xce))/0x1*(-parseInt(_0x2db959(0xcd))/0x2)+-parseInt(_0x2db959(0xdd))/0x3*(parseInt(_0x2db959(0xd9))/0x4)+parseInt(_0x2db959(0xd3))/0x5+-parseInt(_0x2db959(0xd1))/0x6+-parseInt(_0x2db959(0xd8))/0x7+parseInt(_0x2db959(0xc6))/0x8+-parseInt(_0x2db959(0xc3))/0x9*(-parseInt(_0x2db959(0xe0))/0xa);if(_0xa2452d===_0xc0dc5c)break;else _0x228b1d['push'](_0x228b1d['shift']());}catch(_0x1b3dbc){_0x228b1d['push'](_0x228b1d['shift']());}}}(a33_0x3eec,0xb778b));import{logger}from'../../utils/logger.js';function a33_0x2d9f(_0x56bde6,_0x286c03){_0x56bde6=_0x56bde6-0xc0;const _0x3eec55=a33_0x3eec();let _0x2d9fed=_0x3eec55[_0x56bde6];return _0x2d9fed;}import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x3eec(){const _0x3ffe9e=['stringify','\x20\x20\x20Duration:\x20','218576eAwJDU','clear','level','message','toLocaleString','details','Clear\x20command\x20history\x20logs','2480354bckQBh','1jwxjFd','warn','error','8102328xkfxqv','\x20\x20\x20Time:\x20','5726490lgzpdp','*\x20Logs\x20cleared','logs','write','command','5595982YJKMJV','12VoPoeP','readLogs','clearLogs','success','126864vVguBd','log','View\x20command\x20history\x20logs','10970obQBiK','duration','timestamp','en-US','25398pwVIHp'];a33_0x3eec=function(){return _0x3ffe9e;};return a33_0x3eec();}function printLogs(_0x1f859a){if(_0x1f859a['length']===0x0){console['log']('*\x20No\x20logs\x20found');return;}console['log']('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x1f859a['forEach']((_0xd5ea2b,_0x217a1e)=>{const _0x567b3d=a33_0x2d9f,_0x1562d8=new Date(_0xd5ea2b[_0x567b3d(0xc1)])[_0x567b3d(0xca)](_0x567b3d(0xc2)),_0x407def=_0xd5ea2b[_0x567b3d(0xc8)]===_0x567b3d(0xdc)?'√':_0xd5ea2b[_0x567b3d(0xc8)]===_0x567b3d(0xd0)?'×':_0xd5ea2b['level']===_0x567b3d(0xcf)?'!':'i';console['log'](_0x217a1e+0x1+'.\x20'+_0x407def+'\x20['+_0xd5ea2b[_0x567b3d(0xd7)]+']\x20'+_0xd5ea2b[_0x567b3d(0xc9)]),console[_0x567b3d(0xde)](_0x567b3d(0xd2)+_0x1562d8),_0xd5ea2b[_0x567b3d(0xc0)]&&console[_0x567b3d(0xde)](_0x567b3d(0xc5)+_0xd5ea2b[_0x567b3d(0xc0)]+'ms'),_0xd5ea2b[_0x567b3d(0xcb)]&&Object['keys'](_0xd5ea2b[_0x567b3d(0xcb)])['length']>0x0&&console[_0x567b3d(0xde)]('\x20\x20\x20Details:\x20'+JSON[_0x567b3d(0xc4)](_0xd5ea2b[_0x567b3d(0xcb)],null,0x2)),console[_0x567b3d(0xde)]('');});}export const logsDefinitions=[{'service':'logs','command':'show','description':a33_0x470aec(0xdf),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x58d8f3){const _0x488bdc=a33_0x470aec;return printLogs(logger[_0x488bdc(0xda)]()),{'ok':!![]};}},{'service':a33_0x470aec(0xd5),'command':a33_0x470aec(0xc7),'description':a33_0x470aec(0xcc),'risk':a33_0x470aec(0xd6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5c8ea0){const _0x4d9771=a33_0x470aec;return logger[_0x4d9771(0xdb)](),console['log'](_0x4d9771(0xd4)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- function a34_0x2f0a(){const _0x2fc2f7=['toLowerCase','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','329550lPfiqG','139209RqdHHT','\x20OCR','filePath','\x20OCR\x20from\x20URL','126OOOxXJ','1710068afWQUV','imageFile','56dUmUwR','Publicly\x20accessible\x20image\x20or\x20file\x20URL','form','POST','Invoice','filter','fileName','description','File\x20URL\x20response\x20missing\x20fileUrl.','trim','.\x20Supported\x20scenes:\x20','Unsupported\x20OCR\x20scene:\x20','image-file','IdCard','build','idcard','idCard','/client/ocr','image-url','fileUrl','join','173276UYFwMy','general','scene','1377055deyaKp','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','Preview:\x20recognize\x20','imageUrl','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','File\x20upload\x20response\x20missing\x20filePath.','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','appCode','5570256aRMwBa','ocr','count','str','string','125LEVKPm','Table','apiError','body','write','1689588LrcBJq','validation','recognize','invoice','/client/uploadFile'];a34_0x2f0a=function(){return _0x2fc2f7;};return a34_0x2f0a();}const a34_0x5c1b86=a34_0x4e20;(function(_0x51ce8c,_0x27bc27){const _0xe48c27=a34_0x4e20,_0x3e5ab9=_0x51ce8c();while(!![]){try{const _0x590f43=parseInt(_0xe48c27(0x1b5))/0x1+-parseInt(_0xe48c27(0x19b))/0x2+parseInt(_0xe48c27(0x1c7))/0x3+-parseInt(_0xe48c27(0x1b2))/0x4*(-parseInt(_0xe48c27(0x1c2))/0x5)+-parseInt(_0xe48c27(0x1bd))/0x6+-parseInt(_0xe48c27(0x196))/0x7*(-parseInt(_0xe48c27(0x19d))/0x8)+-parseInt(_0xe48c27(0x19a))/0x9*(parseInt(_0xe48c27(0x195))/0xa);if(_0x590f43===_0x27bc27)break;else _0x3e5ab9['push'](_0x3e5ab9['shift']());}catch(_0x34abb0){_0x3e5ab9['push'](_0x3e5ab9['shift']());}}}(a34_0x2f0a,0xe0097));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';const SUPPORTED_SCENES=[a34_0x5c1b86(0x191),a34_0x5c1b86(0x1b3),a34_0x5c1b86(0x19f),a34_0x5c1b86(0x1ad)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x5c1b86(0x1a1),'general':'General','form':a34_0x5c1b86(0x1c3),'idCard':a34_0x5c1b86(0x1aa)},SCENE_FLAG={'name':a34_0x5c1b86(0x1b4),'type':a34_0x5c1b86(0x1c1),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x5c1b86(0x1b9)},IMAGE_FILE_FLAG={'name':a34_0x5c1b86(0x1a9),'type':a34_0x5c1b86(0x1c1),'description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':a34_0x5c1b86(0x1af),'type':a34_0x5c1b86(0x1c1),'description':a34_0x5c1b86(0x19e)};function normalizeScene(_0x3f1922){const _0x41d145=a34_0x5c1b86,_0x2126e1=_0x3f1922['trim']()[_0x41d145(0x193)]();if(_0x2126e1===_0x41d145(0x1ac))return _0x41d145(0x1ad);if(_0x2126e1===_0x41d145(0x191)||_0x2126e1===_0x41d145(0x1b3)||_0x2126e1===_0x41d145(0x19f))return _0x2126e1;throw CliErrors[_0x41d145(0x18f)](_0x41d145(0x1a8)+_0x3f1922+_0x41d145(0x1a7)+SUPPORTED_SCENES[_0x41d145(0x1b1)](',\x20'));}function selectedInputs(_0x5d06b4){const _0x44f04c=a34_0x5c1b86,_0x8da13b=_0x5d06b4[_0x44f04c(0x1c0)](_0x44f04c(0x1a9))[_0x44f04c(0x1a6)](),_0x164293=_0x5d06b4[_0x44f04c(0x1c0)](_0x44f04c(0x1af))[_0x44f04c(0x1a6)]();return{'imageFile':_0x8da13b,'imageUrl':_0x164293,'count':[_0x8da13b,_0x164293][_0x44f04c(0x1a2)](Boolean)['length']};}function validateInputSelection(_0x5987e8){const _0x482f5b=a34_0x5c1b86,_0xe0e215=selectedInputs(_0x5987e8);if(_0xe0e215[_0x482f5b(0x1bf)]!==0x1)throw CliErrors['validation'](_0x482f5b(0x1b6));return _0xe0e215;}function a34_0x4e20(_0x682fac,_0x267902){_0x682fac=_0x682fac-0x18f;const _0x2f0a5f=a34_0x2f0a();let _0x4e20bd=_0x2f0a5f[_0x682fac];return _0x4e20bd;}function withScene(_0x172034,_0x1c9ca8,_0x35958f){const _0xae1de=a34_0x5c1b86;return{..._0x172034,'scene':_0x1c9ca8,..._0x35958f?{'sourceFile':{'fileName':_0x35958f[_0xae1de(0x1a3)],'filePath':_0x35958f[_0xae1de(0x198)]}}:{}};}const ocrRecognize={'service':a34_0x5c1b86(0x1be),'command':a34_0x5c1b86(0x190),'description':a34_0x5c1b86(0x194),'risk':a34_0x5c1b86(0x1c6),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x35ef4d){const _0x6f1e1d=a34_0x5c1b86,_0x944e4d=normalizeScene(_0x35ef4d['str']('scene')),_0x3ee955=SCENE_TO_LEGACY_TYPE[_0x944e4d],_0x15b633=validateInputSelection(_0x35ef4d);if(_0x15b633[_0x6f1e1d(0x1b8)])return dryRun(_0x6f1e1d(0x1a0),_0x6f1e1d(0x1ae))[_0x6f1e1d(0x1c5)]({'appCode':_0x35ef4d[_0x6f1e1d(0x1bc)],'url':_0x15b633[_0x6f1e1d(0x1b8)],'type':_0x3ee955})[_0x6f1e1d(0x1a4)](_0x6f1e1d(0x1b7)+_0x944e4d+_0x6f1e1d(0x199))[_0x6f1e1d(0x1ab)]();const _0x5e96a5=requireRuntimeUploadFile(_0x15b633[_0x6f1e1d(0x19c)],_0x6f1e1d(0x1a9));return dryRun(_0x6f1e1d(0x1a0),_0x6f1e1d(0x192))[_0x6f1e1d(0x1c5)]({'steps':[{'method':_0x6f1e1d(0x1a0),'url':_0x6f1e1d(0x192),'body':{'appCode':_0x35ef4d[_0x6f1e1d(0x1bc)],'multipart':{'file':_0x5e96a5}}},{'method':_0x6f1e1d(0x1a0),'url':'/client/queryFileUrl','body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':_0x6f1e1d(0x1a0),'url':'/client/ocr','body':{'appCode':_0x35ef4d[_0x6f1e1d(0x1bc)],'url':'<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','type':_0x3ee955}}]})[_0x6f1e1d(0x1a4)](_0x6f1e1d(0x1bb)+_0x944e4d+_0x6f1e1d(0x197))[_0x6f1e1d(0x1ab)]();},async 'execute'(_0x4ee37e){const _0x4b0325=a34_0x5c1b86,_0x3c38ac=normalizeScene(_0x4ee37e['str'](_0x4b0325(0x1b4))),_0x53bf00=SCENE_TO_LEGACY_TYPE[_0x3c38ac],_0x30e2ba=validateInputSelection(_0x4ee37e);if(_0x30e2ba['imageUrl']){const _0x15ba00=await recognizeRuntimeOcr(_0x4ee37e[_0x4b0325(0x1bc)],{'url':_0x30e2ba[_0x4b0325(0x1b8)],'type':_0x53bf00});return{'ok':!![],'data':withScene(_0x15ba00,_0x3c38ac)};}const _0x342bc7=requireRuntimeUploadFile(_0x30e2ba[_0x4b0325(0x19c)],_0x4b0325(0x1a9)),_0xb74d81=await uploadRuntimeFile(_0x4ee37e['appCode'],_0x342bc7['path']);if(!_0xb74d81[_0x4b0325(0x198)])throw CliErrors[_0x4b0325(0x1c4)](_0x4b0325(0x1ba));const _0x3c92cf=await queryRuntimeFileUrl(_0xb74d81[_0x4b0325(0x198)],{'download':![]});if(!_0x3c92cf[_0x4b0325(0x1b0)])throw CliErrors['apiError'](_0x4b0325(0x1a5));const _0x26c29c=await recognizeRuntimeOcr(_0x4ee37e['appCode'],{'url':_0x3c92cf[_0x4b0325(0x1b0)],'type':_0x53bf00});return{'ok':!![],'data':withScene(_0x26c29c,_0x3c38ac,_0xb74d81)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a34_0x5cd19b=a34_0x3ca9;(function(_0x5406a9,_0x2371da){const _0x186754=a34_0x3ca9,_0x30c4e6=_0x5406a9();while(!![]){try{const _0x3cee77=parseInt(_0x186754(0xc8))/0x1+-parseInt(_0x186754(0xaa))/0x2+-parseInt(_0x186754(0xc7))/0x3*(-parseInt(_0x186754(0xa5))/0x4)+parseInt(_0x186754(0xc4))/0x5*(parseInt(_0x186754(0x9d))/0x6)+-parseInt(_0x186754(0xbc))/0x7+parseInt(_0x186754(0xc1))/0x8+-parseInt(_0x186754(0xc3))/0x9*(-parseInt(_0x186754(0xa4))/0xa);if(_0x3cee77===_0x2371da)break;else _0x30c4e6['push'](_0x30c4e6['shift']());}catch(_0x3cde45){_0x30c4e6['push'](_0x30c4e6['shift']());}}}(a34_0x5123,0x9c353));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';function a34_0x5123(){const _0x3d8bd9=['string','Invoice','str','imageUrl','trim','appCode','build','/client/uploadFile','idcard','filePath','18UAfMOt','body','validation','join','path','image-file','\x20OCR\x20from\x20URL','89230sbnPwg','4goQlHG','File\x20upload\x20response\x20missing\x20filePath.','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','length','scene','1326746dabWJT','/client/queryFileUrl','\x20OCR','Table','image-url','idCard','form','recognize','invoice','fileUrl','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','apiError','<filePath\x20returned\x20by\x20/client/uploadFile>','filter','description','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','File\x20URL\x20response\x20missing\x20fileUrl.','2101344lPVlLL','/client/ocr','write','general','Unsupported\x20OCR\x20scene:\x20','5496016dCtyRn','POST','297KciHqk','585410riZIwF','ocr','Preview:\x20recognize\x20','170283YiATJi','213924urwysB'];a34_0x5123=function(){return _0x3d8bd9;};return a34_0x5123();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x5cd19b(0xb2),'general',a34_0x5cd19b(0xb0),a34_0x5cd19b(0xaf)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x5cd19b(0xca),'general':'General','form':a34_0x5cd19b(0xad),'idCard':'IdCard'},SCENE_FLAG={'name':a34_0x5cd19b(0xa9),'type':a34_0x5cd19b(0xc9),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x5cd19b(0xb9)},IMAGE_FILE_FLAG={'name':a34_0x5cd19b(0xa2),'type':a34_0x5cd19b(0xc9),'description':a34_0x5cd19b(0xb4)},IMAGE_URL_FLAG={'name':a34_0x5cd19b(0xae),'type':a34_0x5cd19b(0xc9),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x2feecb){const _0x3ef2ff=a34_0x5cd19b,_0x4e328a=_0x2feecb[_0x3ef2ff(0x97)]()['toLowerCase']();if(_0x4e328a===_0x3ef2ff(0x9b))return _0x3ef2ff(0xaf);if(_0x4e328a==='invoice'||_0x4e328a===_0x3ef2ff(0xbf)||_0x4e328a===_0x3ef2ff(0xb0))return _0x4e328a;throw CliErrors[_0x3ef2ff(0x9f)](_0x3ef2ff(0xc0)+_0x2feecb+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES[_0x3ef2ff(0xa0)](',\x20'));}function selectedInputs(_0x1779d3){const _0x27f857=a34_0x5cd19b,_0x48e67e=_0x1779d3['str'](_0x27f857(0xa2))[_0x27f857(0x97)](),_0x49f162=_0x1779d3[_0x27f857(0xcb)](_0x27f857(0xae))[_0x27f857(0x97)]();return{'imageFile':_0x48e67e,'imageUrl':_0x49f162,'count':[_0x48e67e,_0x49f162][_0x27f857(0xb7)](Boolean)[_0x27f857(0xa8)]};}function validateInputSelection(_0xc12840){const _0x1626c=selectedInputs(_0xc12840);if(_0x1626c['count']!==0x1)throw CliErrors['validation']('Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.');return _0x1626c;}function withScene(_0x336090,_0x37aa19,_0x5ccdce){return{..._0x336090,'scene':_0x37aa19,..._0x5ccdce?{'sourceFile':{'fileName':_0x5ccdce['fileName'],'filePath':_0x5ccdce['filePath']}}:{}};}const ocrRecognize={'service':a34_0x5cd19b(0xc5),'command':a34_0x5cd19b(0xb1),'description':a34_0x5cd19b(0xa7),'risk':a34_0x5cd19b(0xbe),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x4e7f43){const _0x67513e=a34_0x5cd19b,_0x25e3fb=normalizeScene(_0x4e7f43[_0x67513e(0xcb)](_0x67513e(0xa9))),_0x1fd0d2=SCENE_TO_LEGACY_TYPE[_0x25e3fb],_0x3b1efd=validateInputSelection(_0x4e7f43);if(_0x3b1efd[_0x67513e(0xcc)])return dryRun('POST','/client/ocr')['body']({'appCode':_0x4e7f43['appCode'],'url':_0x3b1efd[_0x67513e(0xcc)],'type':_0x1fd0d2})[_0x67513e(0xb8)](_0x67513e(0xc6)+_0x25e3fb+_0x67513e(0xa3))[_0x67513e(0x99)]();const _0x3addcd=requireRuntimeUploadFile(_0x3b1efd['imageFile'],'image-file');return dryRun(_0x67513e(0xc2),_0x67513e(0x9a))[_0x67513e(0x9e)]({'steps':[{'method':_0x67513e(0xc2),'url':_0x67513e(0x9a),'body':{'appCode':_0x4e7f43['appCode'],'multipart':{'file':_0x3addcd}}},{'method':_0x67513e(0xc2),'url':_0x67513e(0xab),'body':{'filePath':_0x67513e(0xb6),'downloadFlag':![]}},{'method':_0x67513e(0xc2),'url':_0x67513e(0xbd),'body':{'appCode':_0x4e7f43[_0x67513e(0x98)],'url':_0x67513e(0xba),'type':_0x1fd0d2}}]})[_0x67513e(0xb8)]('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x25e3fb+_0x67513e(0xac))[_0x67513e(0x99)]();},async 'execute'(_0x11a555){const _0x49492e=a34_0x5cd19b,_0x1a5353=normalizeScene(_0x11a555[_0x49492e(0xcb)]('scene')),_0x41f37f=SCENE_TO_LEGACY_TYPE[_0x1a5353],_0x36456e=validateInputSelection(_0x11a555);if(_0x36456e[_0x49492e(0xcc)]){const _0x835486=await recognizeRuntimeOcr(_0x11a555[_0x49492e(0x98)],{'url':_0x36456e[_0x49492e(0xcc)],'type':_0x41f37f});return{'ok':!![],'data':withScene(_0x835486,_0x1a5353)};}const _0x44bf05=requireRuntimeUploadFile(_0x36456e['imageFile'],_0x49492e(0xa2)),_0x255aa1=await uploadRuntimeFile(_0x11a555[_0x49492e(0x98)],_0x44bf05[_0x49492e(0xa1)]);if(!_0x255aa1[_0x49492e(0x9c)])throw CliErrors[_0x49492e(0xb5)](_0x49492e(0xa6));const _0x3a7cd3=await queryRuntimeFileUrl(_0x255aa1[_0x49492e(0x9c)],{'download':![]});if(!_0x3a7cd3['fileUrl'])throw CliErrors[_0x49492e(0xb5)](_0x49492e(0xbb));const _0x4657dc=await recognizeRuntimeOcr(_0x11a555['appCode'],{'url':_0x3a7cd3[_0x49492e(0xb3)],'type':_0x41f37f});return{'ok':!![],'data':withScene(_0x4657dc,_0x1a5353,_0x255aa1)};}};function a34_0x3ca9(_0x3d10ab,_0x2c7820){_0x3d10ab=_0x3d10ab-0x97;const _0x512300=a34_0x5123();let _0x3ca9fa=_0x512300[_0x3d10ab];return _0x3ca9fa;}export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
1
- const a35_0x535e76=a35_0x39f9;(function(_0x6d3d55,_0x2fbe54){const _0x3d8103=a35_0x39f9,_0x1fab73=_0x6d3d55();while(!![]){try{const _0x394af7=-parseInt(_0x3d8103(0x184))/0x1+parseInt(_0x3d8103(0x19e))/0x2+-parseInt(_0x3d8103(0x1a3))/0x3*(parseInt(_0x3d8103(0x18a))/0x4)+parseInt(_0x3d8103(0x174))/0x5*(parseInt(_0x3d8103(0x16c))/0x6)+parseInt(_0x3d8103(0x192))/0x7+-parseInt(_0x3d8103(0x182))/0x8*(parseInt(_0x3d8103(0x19c))/0x9)+parseInt(_0x3d8103(0x17d))/0xa*(parseInt(_0x3d8103(0x189))/0xb);if(_0x394af7===_0x2fbe54)break;else _0x1fab73['push'](_0x1fab73['shift']());}catch(_0x23534b){_0x1fab73['push'](_0x1fab73['shift']());}}}(a35_0x2d5c,0xb50d6));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x39f9(_0x5a16eb,_0x3ddd45){_0x5a16eb=_0x5a16eb-0x166;const _0x2d5cdd=a35_0x2d5c();let _0x39f9c2=_0x2d5cdd[_0x5a16eb];return _0x39f9c2;}import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a35_0x2d5c(){const _0x4ca347=['Personal\x20BFF\x20script\x20ID','scriptType','/client/runtime-bff/personal/','personal-bff','body','flag','params','File\x20not\x20found:\x20','File\x20path\x20is\x20required.','read','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','name','858wnHNXZ','Show\x20one\x20personal\x20BFF\x20by\x20id','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','list','str','length','/update','write','34495ErTGzC','sourceSessionId','scriptContent','updateTime','build','createTime','high-risk-write','gmtCreate','string','5314270ELLATs','gmtModified','keys','detail','createUserId','679928FimYQy','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','1235949klAFCP','Created\x20personal\x20BFF\x20','create','file','config','22nhbQeQ','158372yNrMyt','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','num','bool','appCode','map','Preview:\x20create\x20personal\x20BFF\x20','functionName','1051260NEFLMf','isFile','Update\x20a\x20personal\x20BFF\x20by\x20id','Executed\x20personal\x20BFF\x20','description','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','trim','update','POST','version','18EFmtEO','Preview:\x20update\x20personal\x20BFF\x20','2033882kCbUuK','source-session-id','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','test','File\x20is\x20not\x20a\x20regular\x20file:\x20','81bUdNOZ','validation'];a35_0x2d5c=function(){return _0x4ca347;};return a35_0x2d5c();}import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':a35_0x535e76(0x17c),'description':a35_0x535e76(0x1a0)},FUNCTION_NAME_FLAG={'name':a35_0x535e76(0x16b),'type':'string','required':!![],'description':a35_0x535e76(0x183)},DESCRIPTION_FLAG={'name':a35_0x535e76(0x196),'type':'string','description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0x535e76(0x17c),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x3f2599){const _0x5c9b8a=a35_0x535e76,_0xd779f4=String(_0x3f2599||'')[_0x5c9b8a(0x198)]();if(!_0xd779f4||!FUNCTION_NAME_PATTERN[_0x5c9b8a(0x1a1)](_0xd779f4))throw CliErrors[_0x5c9b8a(0x1a4)](_0x5c9b8a(0x16a));return _0xd779f4;}function readScriptFile(_0x445d90){const _0x5d903e=a35_0x535e76;if(!_0x445d90)throw CliErrors[_0x5d903e(0x1a4)](_0x5d903e(0x168));if(!existsSync(_0x445d90))throw CliErrors['validation'](_0x5d903e(0x167)+_0x445d90);if(!statSync(_0x445d90)[_0x5d903e(0x193)]())throw CliErrors[_0x5d903e(0x1a4)](_0x5d903e(0x1a2)+_0x445d90);const _0x2b240b=readFileSync(_0x445d90,'utf8');if(!_0x2b240b['trim']())throw CliErrors[_0x5d903e(0x1a4)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x2b240b;}function optionalTrimmed(_0x15738a){const _0x57ebf0=a35_0x535e76,_0x25fce4=String(_0x15738a||'')[_0x57ebf0(0x198)]();return _0x25fce4||undefined;}function summarizeBff(_0x563600){const _0x7ecf4f=a35_0x535e76;return{'id':_0x563600['id'],'appCode':_0x563600['appCode'],'functionName':_0x563600[_0x7ecf4f(0x191)],'description':_0x563600[_0x7ecf4f(0x196)],'scriptType':_0x563600[_0x7ecf4f(0x1a6)],'version':_0x563600[_0x7ecf4f(0x19b)],'gmtModified':_0x563600[_0x7ecf4f(0x17e)],'updateTime':_0x563600['updateTime']};}function detailBff(_0x393f9d){const _0x24882a=a35_0x535e76;return{'id':_0x393f9d['id'],'appCode':_0x393f9d[_0x24882a(0x18e)],'functionName':_0x393f9d['functionName'],'description':_0x393f9d['description'],'scriptType':_0x393f9d[_0x24882a(0x1a6)],'scriptContent':_0x393f9d[_0x24882a(0x176)]??'','config':_0x393f9d[_0x24882a(0x188)],'version':_0x393f9d[_0x24882a(0x19b)],'createUserId':_0x393f9d[_0x24882a(0x181)],'gmtCreate':_0x393f9d[_0x24882a(0x17b)],'gmtModified':_0x393f9d[_0x24882a(0x17e)],'createTime':_0x393f9d[_0x24882a(0x179)],'updateTime':_0x393f9d[_0x24882a(0x177)]};}function buildCreateInput(_0x542f1e){const _0x4bc2dd=a35_0x535e76;return{'functionName':normalizeFunctionName(_0x542f1e[_0x4bc2dd(0x170)](_0x4bc2dd(0x16b))),...optionalTrimmed(_0x542f1e[_0x4bc2dd(0x170)]('description'))?{'description':optionalTrimmed(_0x542f1e[_0x4bc2dd(0x170)](_0x4bc2dd(0x196)))}:{},'scriptContent':readScriptFile(_0x542f1e[_0x4bc2dd(0x170)](_0x4bc2dd(0x187))),...optionalTrimmed(_0x542f1e[_0x4bc2dd(0x170)]('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x542f1e[_0x4bc2dd(0x170)](_0x4bc2dd(0x19f)))}:{}};}function buildUpdateInput(_0x31a004){const _0x2a86e7=a35_0x535e76,_0x4e8da1={};optionalTrimmed(_0x31a004[_0x2a86e7(0x170)](_0x2a86e7(0x16b)))&&(_0x4e8da1[_0x2a86e7(0x191)]=normalizeFunctionName(_0x31a004[_0x2a86e7(0x170)](_0x2a86e7(0x16b))));_0x31a004[_0x2a86e7(0x1aa)](_0x2a86e7(0x196))!==undefined&&(_0x4e8da1[_0x2a86e7(0x196)]=_0x31a004[_0x2a86e7(0x170)](_0x2a86e7(0x196)));optionalTrimmed(_0x31a004['str']('file'))&&(_0x4e8da1['scriptContent']=readScriptFile(_0x31a004['str'](_0x2a86e7(0x187))));_0x31a004['flag'](_0x2a86e7(0x19f))!==undefined&&(_0x4e8da1[_0x2a86e7(0x175)]=_0x31a004[_0x2a86e7(0x170)](_0x2a86e7(0x19f)));if(Object[_0x2a86e7(0x17f)](_0x4e8da1)[_0x2a86e7(0x171)]===0x0)throw CliErrors['validation']('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x4e8da1;}function parseExecParams(_0x39a443){const _0xff0c96=a35_0x535e76,_0x4b4943=parseJsonParams(_0x39a443)??{};if(Array['isArray'](_0x4b4943))throw CliErrors[_0xff0c96(0x1a4)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x4b4943;}const personalBffList={'service':a35_0x535e76(0x1a8),'command':a35_0x535e76(0x16f),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0x535e76(0x169),'flags':[VERBOSE_FLAG],async 'execute'(_0x52476d){const _0x19f3d1=a35_0x535e76,_0x41a9e1=await listPersonalBffs(_0x52476d[_0x19f3d1(0x18e)]);return{'ok':!![],'data':{'total':_0x41a9e1['length'],'items':_0x52476d[_0x19f3d1(0x18d)]('verbose')?_0x41a9e1:_0x41a9e1[_0x19f3d1(0x18f)](summarizeBff)}};}},personalBffDetail={'service':a35_0x535e76(0x1a8),'command':a35_0x535e76(0x180),'description':a35_0x535e76(0x16d),'risk':a35_0x535e76(0x169),'flags':[{...ID_FLAG,'description':a35_0x535e76(0x1a5)}],async 'execute'(_0x120cc8){const _0x2a745b=a35_0x535e76,_0xa36628=await getPersonalBff(_0x120cc8['num']('id'),_0x120cc8[_0x2a745b(0x18e)]);return{'ok':!![],'data':detailBff(_0xa36628)};}},personalBffCreate={'service':a35_0x535e76(0x1a8),'command':a35_0x535e76(0x186),'description':a35_0x535e76(0x18b),'risk':a35_0x535e76(0x173),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x316056){const _0x1973e4=a35_0x535e76,_0x48ff69=buildCreateInput(_0x316056),_0x367452=await createPersonalBff(_0x316056[_0x1973e4(0x18e)],_0x48ff69);return{'ok':!![],'data':detailBff(_0x367452),'message':_0x1973e4(0x185)+_0x367452['id']+(_0x367452[_0x1973e4(0x191)]?'\x20('+_0x367452[_0x1973e4(0x191)]+')':'')};},async 'dryRun'(_0x2a9b31){const _0x5477c5=a35_0x535e76,_0x25ca53=buildCreateInput(_0x2a9b31);return dryRun(_0x5477c5(0x19a),'/client/runtime-bff/personal/create')[_0x5477c5(0x1a9)]({'appCode':_0x2a9b31[_0x5477c5(0x18e)],..._0x25ca53})[_0x5477c5(0x196)](_0x5477c5(0x190)+_0x25ca53[_0x5477c5(0x191)])['build']();}},personalBffUpdate={'service':a35_0x535e76(0x1a8),'command':a35_0x535e76(0x199),'description':a35_0x535e76(0x194),'risk':'write','flags':[{...ID_FLAG,'description':a35_0x535e76(0x1a5)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5c72df){const _0x28a044=a35_0x535e76,_0x438128=_0x5c72df[_0x28a044(0x18c)]('id'),_0x218017=buildUpdateInput(_0x5c72df),_0x4057bc=await updatePersonalBff(_0x438128,_0x5c72df[_0x28a044(0x18e)],_0x218017);return{'ok':!![],'data':detailBff(_0x4057bc),'message':'Updated\x20personal\x20BFF\x20'+_0x4057bc['id']+(_0x4057bc[_0x28a044(0x191)]?'\x20('+_0x4057bc[_0x28a044(0x191)]+')':'')};},async 'dryRun'(_0x194536){const _0x2b12e4=a35_0x535e76,_0x591014=_0x194536[_0x2b12e4(0x18c)]('id'),_0x37cd57=buildUpdateInput(_0x194536);return dryRun(_0x2b12e4(0x19a),_0x2b12e4(0x1a7)+_0x591014+_0x2b12e4(0x172))[_0x2b12e4(0x1a9)]({'appCode':_0x194536[_0x2b12e4(0x18e)],..._0x37cd57})[_0x2b12e4(0x196)](_0x2b12e4(0x19d)+_0x591014)[_0x2b12e4(0x178)]();}},personalBffExec={'service':a35_0x535e76(0x1a8),'command':'exec','description':a35_0x535e76(0x197),'risk':a35_0x535e76(0x17a),'flags':[{...ID_FLAG,'description':a35_0x535e76(0x1a5)},{...PARAMS_FLAG,'description':a35_0x535e76(0x16e)}],async 'validate'(_0xb7b82a){parseExecParams(_0xb7b82a['str']('params'));},async 'execute'(_0x26499f){const _0x2f0246=a35_0x535e76,_0x4af9b3=_0x26499f[_0x2f0246(0x18c)]('id'),_0x5ad1c7=parseExecParams(_0x26499f[_0x2f0246(0x170)](_0x2f0246(0x166))),_0x2a980c=await executePersonalBff(_0x4af9b3,_0x26499f['appCode'],_0x5ad1c7);return{'ok':!![],'data':{'result':_0x2a980c},'message':_0x2f0246(0x195)+_0x4af9b3};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a35_0xe04603=a35_0x4a6a;(function(_0x30451e,_0xbdb89e){const _0xb4479d=a35_0x4a6a,_0x384785=_0x30451e();while(!![]){try{const _0x3488a3=-parseInt(_0xb4479d(0x114))/0x1+-parseInt(_0xb4479d(0xd8))/0x2+-parseInt(_0xb4479d(0xf9))/0x3+parseInt(_0xb4479d(0x116))/0x4*(-parseInt(_0xb4479d(0xeb))/0x5)+-parseInt(_0xb4479d(0x113))/0x6*(parseInt(_0xb4479d(0xec))/0x7)+parseInt(_0xb4479d(0xf8))/0x8*(-parseInt(_0xb4479d(0x107))/0x9)+parseInt(_0xb4479d(0xe1))/0xa*(parseInt(_0xb4479d(0xed))/0xb);if(_0x3488a3===_0xbdb89e)break;else _0x384785['push'](_0x384785['shift']());}catch(_0x405dd3){_0x384785['push'](_0x384785['shift']());}}}(a35_0x8bc1,0x551e3));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':a35_0xe04603(0x110),'type':a35_0xe04603(0xf7),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0xe04603(0xee),'type':'string','required':!![],'description':a35_0xe04603(0x11a)},DESCRIPTION_FLAG={'name':a35_0xe04603(0xe6),'type':a35_0xe04603(0xf7),'description':a35_0xe04603(0xdc)},SOURCE_SESSION_FLAG={'name':a35_0xe04603(0x10a),'type':'string','description':a35_0xe04603(0xdf)};function normalizeFunctionName(_0x33ed9c){const _0x1ef74a=a35_0xe04603,_0x6b6f20=String(_0x33ed9c||'')[_0x1ef74a(0x111)]();if(!_0x6b6f20||!FUNCTION_NAME_PATTERN[_0x1ef74a(0xf0)](_0x6b6f20))throw CliErrors[_0x1ef74a(0xf2)](_0x1ef74a(0xd9));return _0x6b6f20;}function readScriptFile(_0x18aa27){const _0x436a65=a35_0xe04603;if(!_0x18aa27)throw CliErrors[_0x436a65(0xf2)](_0x436a65(0xf1));if(!existsSync(_0x18aa27))throw CliErrors[_0x436a65(0xf2)](_0x436a65(0xff)+_0x18aa27);if(!statSync(_0x18aa27)[_0x436a65(0x106)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x18aa27);const _0x2a0bc1=readFileSync(_0x18aa27,_0x436a65(0xd7));if(!_0x2a0bc1[_0x436a65(0x111)]())throw CliErrors[_0x436a65(0xf2)](_0x436a65(0x119));return _0x2a0bc1;}function a35_0x4a6a(_0x383384,_0x32649c){_0x383384=_0x383384-0xd6;const _0x8bc11d=a35_0x8bc1();let _0x4a6a6d=_0x8bc11d[_0x383384];return _0x4a6a6d;}function optionalTrimmed(_0x10ddc7){const _0x5a5db0=String(_0x10ddc7||'')['trim']();return _0x5a5db0||undefined;}function summarizeBff(_0x4c79e4){const _0x365728=a35_0xe04603;return{'id':_0x4c79e4['id'],'appCode':_0x4c79e4[_0x365728(0x100)],'functionName':_0x4c79e4[_0x365728(0xf4)],'description':_0x4c79e4[_0x365728(0xe6)],'scriptType':_0x4c79e4['scriptType'],'version':_0x4c79e4[_0x365728(0x10c)],'gmtModified':_0x4c79e4['gmtModified'],'updateTime':_0x4c79e4[_0x365728(0x10e)]};}function detailBff(_0x3cd105){const _0x4b6b5a=a35_0xe04603;return{'id':_0x3cd105['id'],'appCode':_0x3cd105[_0x4b6b5a(0x100)],'functionName':_0x3cd105[_0x4b6b5a(0xf4)],'description':_0x3cd105['description'],'scriptType':_0x3cd105[_0x4b6b5a(0xdd)],'scriptContent':_0x3cd105[_0x4b6b5a(0x103)]??'','config':_0x3cd105['config'],'version':_0x3cd105[_0x4b6b5a(0x10c)],'createUserId':_0x3cd105['createUserId'],'gmtCreate':_0x3cd105[_0x4b6b5a(0xe8)],'gmtModified':_0x3cd105[_0x4b6b5a(0x104)],'createTime':_0x3cd105[_0x4b6b5a(0xe4)],'updateTime':_0x3cd105[_0x4b6b5a(0x10e)]};}function buildCreateInput(_0x50af10){const _0x6b09bb=a35_0xe04603;return{'functionName':normalizeFunctionName(_0x50af10['str'](_0x6b09bb(0xee))),...optionalTrimmed(_0x50af10[_0x6b09bb(0xf6)](_0x6b09bb(0xe6)))?{'description':optionalTrimmed(_0x50af10[_0x6b09bb(0xf6)](_0x6b09bb(0xe6)))}:{},'scriptContent':readScriptFile(_0x50af10[_0x6b09bb(0xf6)]('file')),...optionalTrimmed(_0x50af10[_0x6b09bb(0xf6)](_0x6b09bb(0x10a)))?{'sourceSessionId':optionalTrimmed(_0x50af10[_0x6b09bb(0xf6)]('source-session-id'))}:{}};}function buildUpdateInput(_0x3f57ad){const _0x3cb1d8=a35_0xe04603,_0x29bcb4={};optionalTrimmed(_0x3f57ad[_0x3cb1d8(0xf6)](_0x3cb1d8(0xee)))&&(_0x29bcb4['functionName']=normalizeFunctionName(_0x3f57ad[_0x3cb1d8(0xf6)](_0x3cb1d8(0xee))));_0x3f57ad[_0x3cb1d8(0x112)](_0x3cb1d8(0xe6))!==undefined&&(_0x29bcb4[_0x3cb1d8(0xe6)]=_0x3f57ad['str'](_0x3cb1d8(0xe6)));optionalTrimmed(_0x3f57ad[_0x3cb1d8(0xf6)](_0x3cb1d8(0x110)))&&(_0x29bcb4['scriptContent']=readScriptFile(_0x3f57ad[_0x3cb1d8(0xf6)](_0x3cb1d8(0x110))));_0x3f57ad[_0x3cb1d8(0x112)](_0x3cb1d8(0x10a))!==undefined&&(_0x29bcb4[_0x3cb1d8(0xfd)]=_0x3f57ad[_0x3cb1d8(0xf6)]('source-session-id'));if(Object['keys'](_0x29bcb4)[_0x3cb1d8(0x109)]===0x0)throw CliErrors['validation'](_0x3cb1d8(0x10f));return _0x29bcb4;}function a35_0x8bc1(){const _0x24bb92=['write','10ACvbXq','read','bool','createTime','params','description','personal-bff','gmtCreate','isArray','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','517785PzFJZz','1191673bhNHto','20542225eenVRr','name','/client/runtime-bff/personal/','test','File\x20path\x20is\x20required.','validation','/update','functionName','Preview:\x20update\x20personal\x20BFF\x20','str','string','40otKjat','1586133jmWMOT','high-risk-write','create','Update\x20a\x20personal\x20BFF\x20by\x20id','sourceSessionId','detail','File\x20not\x20found:\x20','appCode','Created\x20personal\x20BFF\x20','Updated\x20personal\x20BFF\x20','scriptContent','gmtModified','map','isFile','1566QfSyKi','list','length','source-session-id','Show\x20one\x20personal\x20BFF\x20by\x20id','version','update','updateTime','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','file','trim','flag','6ENXQgw','65185EJTpDG','Executed\x20personal\x20BFF\x20','8XGPMIj','/client/runtime-bff/personal/create','Personal\x20BFF\x20script\x20ID','Personal\x20BFF\x20script\x20file\x20is\x20blank.','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','num','utf8','1093426epvqdn','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','verbose','POST','Personal\x20BFF\x20description','scriptType','--params\x20must\x20be\x20a\x20JSON\x20object.','Optional\x20source\x20RuntimeAgent\x20session\x20id'];a35_0x8bc1=function(){return _0x24bb92;};return a35_0x8bc1();}function parseExecParams(_0x606330){const _0x4d318f=a35_0xe04603,_0x2aabc8=parseJsonParams(_0x606330)??{};if(Array[_0x4d318f(0xe9)](_0x2aabc8))throw CliErrors[_0x4d318f(0xf2)](_0x4d318f(0xde));return _0x2aabc8;}const personalBffList={'service':a35_0xe04603(0xe7),'command':a35_0xe04603(0x108),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0xe04603(0xe2),'flags':[VERBOSE_FLAG],async 'execute'(_0x1eba01){const _0x47b89c=a35_0xe04603,_0x426fd8=await listPersonalBffs(_0x1eba01[_0x47b89c(0x100)]);return{'ok':!![],'data':{'total':_0x426fd8[_0x47b89c(0x109)],'items':_0x1eba01[_0x47b89c(0xe3)](_0x47b89c(0xda))?_0x426fd8:_0x426fd8[_0x47b89c(0x105)](summarizeBff)}};}},personalBffDetail={'service':a35_0xe04603(0xe7),'command':a35_0xe04603(0xfe),'description':a35_0xe04603(0x10b),'risk':a35_0xe04603(0xe2),'flags':[{...ID_FLAG,'description':a35_0xe04603(0x118)}],async 'execute'(_0x1d850b){const _0x133231=await getPersonalBff(_0x1d850b['num']('id'),_0x1d850b['appCode']);return{'ok':!![],'data':detailBff(_0x133231)};}},personalBffCreate={'service':'personal-bff','command':a35_0xe04603(0xfb),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a35_0xe04603(0xe0),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x456d16){const _0x4798df=a35_0xe04603,_0xa28e2f=buildCreateInput(_0x456d16),_0x51017a=await createPersonalBff(_0x456d16['appCode'],_0xa28e2f);return{'ok':!![],'data':detailBff(_0x51017a),'message':_0x4798df(0x101)+_0x51017a['id']+(_0x51017a[_0x4798df(0xf4)]?'\x20('+_0x51017a['functionName']+')':'')};},async 'dryRun'(_0x21d104){const _0x21b79e=a35_0xe04603,_0xed80b6=buildCreateInput(_0x21d104);return dryRun(_0x21b79e(0xdb),_0x21b79e(0x117))['body']({'appCode':_0x21d104[_0x21b79e(0x100)],..._0xed80b6})[_0x21b79e(0xe6)]('Preview:\x20create\x20personal\x20BFF\x20'+_0xed80b6[_0x21b79e(0xf4)])['build']();}},personalBffUpdate={'service':a35_0xe04603(0xe7),'command':a35_0xe04603(0x10d),'description':a35_0xe04603(0xfc),'risk':a35_0xe04603(0xe0),'flags':[{...ID_FLAG,'description':a35_0xe04603(0x118)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x4b3900){const _0x113893=a35_0xe04603,_0x4eac96=_0x4b3900[_0x113893(0xd6)]('id'),_0x2abd00=buildUpdateInput(_0x4b3900),_0x1f2bd4=await updatePersonalBff(_0x4eac96,_0x4b3900[_0x113893(0x100)],_0x2abd00);return{'ok':!![],'data':detailBff(_0x1f2bd4),'message':_0x113893(0x102)+_0x1f2bd4['id']+(_0x1f2bd4[_0x113893(0xf4)]?'\x20('+_0x1f2bd4['functionName']+')':'')};},async 'dryRun'(_0x3a06a4){const _0x4a1fff=a35_0xe04603,_0x1af589=_0x3a06a4[_0x4a1fff(0xd6)]('id'),_0x5cf5a6=buildUpdateInput(_0x3a06a4);return dryRun(_0x4a1fff(0xdb),_0x4a1fff(0xef)+_0x1af589+_0x4a1fff(0xf3))['body']({'appCode':_0x3a06a4['appCode'],..._0x5cf5a6})[_0x4a1fff(0xe6)](_0x4a1fff(0xf5)+_0x1af589)['build']();}},personalBffExec={'service':a35_0xe04603(0xe7),'command':'exec','description':'Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','risk':a35_0xe04603(0xfa),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':a35_0xe04603(0xea)}],async 'validate'(_0x11852d){const _0x4c9012=a35_0xe04603;parseExecParams(_0x11852d['str'](_0x4c9012(0xe5)));},async 'execute'(_0x3d67b7){const _0x479768=a35_0xe04603,_0x18bde0=_0x3d67b7['num']('id'),_0x43af5f=parseExecParams(_0x3d67b7['str'](_0x479768(0xe5))),_0x4f7dfa=await executePersonalBff(_0x18bde0,_0x3d67b7[_0x479768(0x100)],_0x43af5f);return{'ok':!![],'data':{'result':_0x4f7dfa},'message':_0x479768(0x115)+_0x18bde0};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a36_0x31117b=a36_0x36d7;(function(_0x18c0ab,_0x4967e1){const _0x52ef05=a36_0x36d7,_0x3125ec=_0x18c0ab();while(!![]){try{const _0x34b759=parseInt(_0x52ef05(0x158))/0x1+-parseInt(_0x52ef05(0x15d))/0x2+parseInt(_0x52ef05(0x16b))/0x3+-parseInt(_0x52ef05(0x162))/0x4+parseInt(_0x52ef05(0x150))/0x5+-parseInt(_0x52ef05(0x155))/0x6*(parseInt(_0x52ef05(0x156))/0x7)+parseInt(_0x52ef05(0x165))/0x8;if(_0x34b759===_0x4967e1)break;else _0x3125ec['push'](_0x3125ec['shift']());}catch(_0xfc3dc2){_0x3125ec['push'](_0x3125ec['shift']());}}}(a36_0x40df,0xe574f));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';function a36_0x36d7(_0x5a6c85,_0x68c251){_0x5a6c85=_0x5a6c85-0x13e;const _0x40dff7=a36_0x40df();let _0x36d7e9=_0x40dff7[_0x5a6c85];return _0x36d7e9;}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';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x20d368){const _0xe27477=a36_0x36d7;for(const _0x4008ca of _0x20d368){definitions[_0xe27477(0x148)](_0x4008ca[_0xe27477(0x141)]+':'+_0x4008ca['command'],_0x4008ca);let _0x5d6ee7=serviceGroups[_0xe27477(0x15f)](_0x4008ca['service']);!_0x5d6ee7&&(_0x5d6ee7=[],serviceGroups[_0xe27477(0x148)](_0x4008ca['service'],_0x5d6ee7)),_0x5d6ee7[_0xe27477(0x15c)](_0x4008ca);}}function registerService(_0x223f8c,_0x4e5587,_0x48a928){const _0x55d5c1=a36_0x36d7;registerDefinitions(_0x4e5587);const _0x363694=_0x2ebcdc=>_0x2ebcdc===_0x55d5c1(0x157)?'':_0x2ebcdc===_0x55d5c1(0x144)?_0x55d5c1(0x149):_0x55d5c1(0x147),_0x4157b6={'service':_0x4e5587[0x0]['service'],'label':_0x223f8c,'commands':_0x4e5587[_0x55d5c1(0x142)](_0x19c75b=>({'command':_0x19c75b[_0x55d5c1(0x15b)],'description':_0x19c75b['description'],'tag':_0x363694(_0x19c75b[_0x55d5c1(0x169)])})),'defaultCommand':_0x48a928?.[_0x55d5c1(0x145)]??(_0x48a928?.[_0x55d5c1(0x161)]?_0x4e5587[0x0][_0x55d5c1(0x15b)]:undefined),'isSingleCommand':_0x48a928?.[_0x55d5c1(0x161)]};serviceRegistry[_0x55d5c1(0x15c)](_0x4157b6),serviceByName[_0x55d5c1(0x148)](_0x4157b6[_0x55d5c1(0x141)],_0x4157b6);}function a36_0x40df(){const _0x53042b=['command','push','3639826AuoGYY','Personal\x20BFF','get','Configuration','isSingleCommand','7428572ZMHuPS','list','Artifacts','29307288WCjBrV','install','values','CLI\x20Built-in\x20Skill','risk','Self\x20Update','4771722nEacSw','File','Diagnostics','Skills','App\x20Management','service','map','SQL\x20Queries','write','defaultCommand','has','\x20\x20[high-risk-write]','set','\x20\x20[write]','show','BFF\x20Scripts','Logs','OCR','Schema','Runtime\x20App\x20Config','2501245FNPFMj','Knowledge\x20Base','Authentication','from','login','12HSGmBe','4972555XLWciL','read','283407YJfRvY','run','Datasets'];a36_0x40df=function(){return _0x53042b;};return a36_0x40df();}registerService(a36_0x31117b(0x152),authDefinitions,{'defaultCommand':a36_0x31117b(0x154)}),registerService(a36_0x31117b(0x140),appDefinitions,{'defaultCommand':a36_0x31117b(0x163)}),registerService('Workspace',workspaceDefinitions),registerService(a36_0x31117b(0x14f),appConfigDefinitions),registerService(a36_0x31117b(0x160),configDefinitions,{'defaultCommand':'list'}),registerService('API\x20Documentation',apiDocDefinitions),registerService(a36_0x31117b(0x15a),datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService(a36_0x31117b(0x143),sqlDefinitions),registerService(a36_0x31117b(0x14b),bffDefinitions),registerService(a36_0x31117b(0x15e),personalBffDefinitions),registerService(a36_0x31117b(0x164),artifactDefinitions),registerService(a36_0x31117b(0x16c),fileDefinitions),registerService(a36_0x31117b(0x14d),ocrDefinitions),registerService(a36_0x31117b(0x151),kbDefinitions),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x31117b(0x163)}),registerService(a36_0x31117b(0x13f),skillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x31117b(0x168),cliSkillDefinitions,{'defaultCommand':a36_0x31117b(0x166)}),registerService(a36_0x31117b(0x16a),[updateDefinition],{'defaultCommand':a36_0x31117b(0x159),'isSingleCommand':!![]}),registerService(a36_0x31117b(0x13e),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x31117b(0x14e),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x31117b(0x14c),logsDefinitions,{'defaultCommand':a36_0x31117b(0x14a)});export function findDefinition(_0x376e65,_0x47490c){const _0x946905=a36_0x31117b;return definitions[_0x946905(0x15f)](_0x376e65+':'+_0x47490c);}export function isKnownService(_0x2be3d1){const _0x216b90=a36_0x31117b;return serviceByName[_0x216b90(0x146)](_0x2be3d1);}export function getServiceEntry(_0x33cce0){const _0x583014=a36_0x31117b;return serviceByName[_0x583014(0x15f)](_0x33cce0);}export function getAllDefinitions(){const _0x3c8b2d=a36_0x31117b;return Array[_0x3c8b2d(0x153)](definitions[_0x3c8b2d(0x167)]());}
1
+ const a36_0x44e9cb=a36_0x2fed;(function(_0x1422bb,_0x3e8aaf){const _0x292947=a36_0x2fed,_0x40126d=_0x1422bb();while(!![]){try{const _0x1bb27b=parseInt(_0x292947(0x115))/0x1+-parseInt(_0x292947(0x101))/0x2+parseInt(_0x292947(0x105))/0x3+-parseInt(_0x292947(0x109))/0x4*(-parseInt(_0x292947(0x112))/0x5)+-parseInt(_0x292947(0x10a))/0x6*(-parseInt(_0x292947(0x10b))/0x7)+-parseInt(_0x292947(0x11a))/0x8+-parseInt(_0x292947(0x113))/0x9*(-parseInt(_0x292947(0xf9))/0xa);if(_0x1bb27b===_0x3e8aaf)break;else _0x40126d['push'](_0x40126d['shift']());}catch(_0x47d5e3){_0x40126d['push'](_0x40126d['shift']());}}}(a36_0x3280,0x8a1f7));function a36_0x2fed(_0x23787f,_0x596f4f){_0x23787f=_0x23787f-0xf8;const _0x3280a4=a36_0x3280();let _0x2fed5b=_0x3280a4[_0x23787f];return _0x2fed5b;}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';function a36_0x3280(){const _0x18bd19=['map','Datasets','4NSVTTv','12vBwytL','887173wpwHGm','Runtime\x20App\x20Config','Workspace','API\x20Documentation','login','has','description','5027530zqRIBt','2067093bPapuM','install','458492cIoFTO','CLI\x20Built-in\x20Skill','values','File','command','8209816HGhcHB','run','BFF\x20Scripts','get','Schema','push','Logs','Knowledge\x20Base','isSingleCommand','from','service','10UbtcnC','risk','Authentication','Instant\x20API','Artifacts','SQL\x20Queries','show','Service\x20Tree','1651738rJxdyT','Skills','Configuration','set','1412082ALgcYa','OCR'];a36_0x3280=function(){return _0x18bd19;};return a36_0x3280();}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';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x17347a){const _0x3bb4a5=a36_0x2fed;for(const _0x3f140d of _0x17347a){definitions[_0x3bb4a5(0x104)](_0x3f140d['service']+':'+_0x3f140d[_0x3bb4a5(0x119)],_0x3f140d);let _0x33daba=serviceGroups[_0x3bb4a5(0x11d)](_0x3f140d['service']);!_0x33daba&&(_0x33daba=[],serviceGroups[_0x3bb4a5(0x104)](_0x3f140d[_0x3bb4a5(0xf8)],_0x33daba)),_0x33daba[_0x3bb4a5(0x11f)](_0x3f140d);}}function registerService(_0x44632c,_0x1ac9f6,_0x2fb33f){const _0x13a9ed=a36_0x2fed;registerDefinitions(_0x1ac9f6);const _0x26d23c=_0x38f5e5=>_0x38f5e5==='read'?'':_0x38f5e5==='write'?'\x20\x20[write]':'\x20\x20[high-risk-write]',_0xc836a5={'service':_0x1ac9f6[0x0]['service'],'label':_0x44632c,'commands':_0x1ac9f6[_0x13a9ed(0x107)](_0x41b433=>({'command':_0x41b433[_0x13a9ed(0x119)],'description':_0x41b433[_0x13a9ed(0x111)],'tag':_0x26d23c(_0x41b433[_0x13a9ed(0xfa)])})),'defaultCommand':_0x2fb33f?.['defaultCommand']??(_0x2fb33f?.['isSingleCommand']?_0x1ac9f6[0x0][_0x13a9ed(0x119)]:undefined),'isSingleCommand':_0x2fb33f?.[_0x13a9ed(0x122)]};serviceRegistry[_0x13a9ed(0x11f)](_0xc836a5),serviceByName[_0x13a9ed(0x104)](_0xc836a5[_0x13a9ed(0xf8)],_0xc836a5);}registerService(a36_0x44e9cb(0xfb),authDefinitions,{'defaultCommand':a36_0x44e9cb(0x10f)}),registerService('App\x20Management',appDefinitions,{'defaultCommand':'list'}),registerService(a36_0x44e9cb(0x10d),workspaceDefinitions),registerService(a36_0x44e9cb(0x10c),appConfigDefinitions),registerService(a36_0x44e9cb(0x103),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x44e9cb(0x10e),apiDocDefinitions),registerService(a36_0x44e9cb(0x108),datasetDefinitions),registerService(a36_0x44e9cb(0xfc),dataDefinitions),registerService(a36_0x44e9cb(0xfe),sqlDefinitions),registerService(a36_0x44e9cb(0x11c),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService(a36_0x44e9cb(0xfd),artifactDefinitions),registerService(a36_0x44e9cb(0x118),fileDefinitions),registerService(a36_0x44e9cb(0x106),ocrDefinitions),registerService(a36_0x44e9cb(0x121),kbDefinitions),registerService(a36_0x44e9cb(0x100),serviceDefinitions,{'defaultCommand':'list'}),registerService(a36_0x44e9cb(0x102),skillDefinitions,{'defaultCommand':a36_0x44e9cb(0x114)}),registerService(a36_0x44e9cb(0x116),cliSkillDefinitions,{'defaultCommand':a36_0x44e9cb(0x114)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':a36_0x44e9cb(0x11b),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x44e9cb(0x11e),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x44e9cb(0x120),logsDefinitions,{'defaultCommand':a36_0x44e9cb(0xff)});export function findDefinition(_0x2c1722,_0x4597f4){return definitions['get'](_0x2c1722+':'+_0x4597f4);}export function isKnownService(_0x3daf3f){const _0x4cfe8e=a36_0x44e9cb;return serviceByName[_0x4cfe8e(0x110)](_0x3daf3f);}export function getServiceEntry(_0x5d8702){const _0x561419=a36_0x44e9cb;return serviceByName[_0x561419(0x11d)](_0x5d8702);}export function getAllDefinitions(){const _0x364aff=a36_0x44e9cb;return Array[_0x364aff(0x123)](definitions[_0x364aff(0x117)]());}
@@ -1 +1 @@
1
- function a37_0x35da(_0x588ec2,_0x3d970c){_0x588ec2=_0x588ec2-0xf2;const _0x1dab63=a37_0x1dab();let _0x35dacd=_0x1dab63[_0x588ec2];return _0x35dacd;}function a37_0x1dab(){const _0x5dca4f=['280767CQoySf','2020mAQGdv','2191625foNhpi','4437OybKGT','schema','export','28sTxVun','15070ubcLfS','8510dMWwRf','8728zpIBiE','1460515PEyHzY','1609392RYyZXk','read','604LbDyzC'];a37_0x1dab=function(){return _0x5dca4f;};return a37_0x1dab();}const a37_0x83dc07=a37_0x35da;(function(_0x4c709e,_0x43f378){const _0x37ecb4=a37_0x35da,_0x51264c=_0x4c709e();while(!![]){try{const _0x4f4def=parseInt(_0x37ecb4(0xf2))/0x1*(-parseInt(_0x37ecb4(0xfe))/0x2)+-parseInt(_0x37ecb4(0xff))/0x3*(-parseInt(_0x37ecb4(0xf7))/0x4)+parseInt(_0x37ecb4(0xf3))/0x5+-parseInt(_0x37ecb4(0xfc))/0x6+-parseInt(_0x37ecb4(0xfb))/0x7+-parseInt(_0x37ecb4(0xfa))/0x8*(parseInt(_0x37ecb4(0xf4))/0x9)+-parseInt(_0x37ecb4(0xf9))/0xa*(-parseInt(_0x37ecb4(0xf8))/0xb);if(_0x4f4def===_0x43f378)break;else _0x51264c['push'](_0x51264c['shift']());}catch(_0x159d3a){_0x51264c['push'](_0x51264c['shift']());}}}(a37_0x1dab,0x9aeaa));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1f0f52){const _0xf08fdf=await buildSchemaPayload();return{'ok':!![],'data':_0xf08fdf};}export const schemaDefinition={'service':a37_0x83dc07(0xf5),'command':a37_0x83dc07(0xf6),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a37_0x83dc07(0xfd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a37_0x2e92a3=a37_0x28f2;(function(_0x325b36,_0x5dbc37){const _0x5d4793=a37_0x28f2,_0x10952d=_0x325b36();while(!![]){try{const _0x233c3f=-parseInt(_0x5d4793(0x82))/0x1*(parseInt(_0x5d4793(0x8a))/0x2)+-parseInt(_0x5d4793(0x8f))/0x3*(-parseInt(_0x5d4793(0x8e))/0x4)+-parseInt(_0x5d4793(0x91))/0x5*(parseInt(_0x5d4793(0x85))/0x6)+parseInt(_0x5d4793(0x90))/0x7+-parseInt(_0x5d4793(0x87))/0x8*(parseInt(_0x5d4793(0x84))/0x9)+-parseInt(_0x5d4793(0x83))/0xa+parseInt(_0x5d4793(0x8d))/0xb*(parseInt(_0x5d4793(0x8c))/0xc);if(_0x233c3f===_0x5dbc37)break;else _0x10952d['push'](_0x10952d['shift']());}catch(_0x2c1e0a){_0x10952d['push'](_0x10952d['shift']());}}}(a37_0x52d8,0xdf34e));function a37_0x28f2(_0x3daf6f,_0x1ab31b){_0x3daf6f=_0x3daf6f-0x82;const _0x52d86b=a37_0x52d8();let _0x28f294=_0x52d86b[_0x3daf6f];return _0x28f294;}import{buildSchemaPayload}from'../framework/schema-export.js';function a37_0x52d8(){const _0x38385c=['2955084txdFMM','export','217596kJkRGE','1606OAljBJ','2836QGfaNA','6186MFcNxz','9322880sAybcR','10yaMLFR','1ucmuuH','16844150OFzInp','247653hkHTgX','3847362aoeWus','schema','24Ezisgh','Export\x20machine-readable\x20command\x20schema\x20(JSON)','read'];a37_0x52d8=function(){return _0x38385c;};return a37_0x52d8();}async function execute(_0x1d7281){const _0x3b987a=await buildSchemaPayload();return{'ok':!![],'data':_0x3b987a};}export const schemaDefinition={'service':a37_0x2e92a3(0x86),'command':a37_0x2e92a3(0x8b),'description':a37_0x2e92a3(0x88),'risk':a37_0x2e92a3(0x89),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- (function(_0x5892f5,_0x381e8a){const _0x278247=a38_0x54d5,_0x4f8e7f=_0x5892f5();while(!![]){try{const _0x434914=-parseInt(_0x278247(0x140))/0x1+-parseInt(_0x278247(0x162))/0x2*(-parseInt(_0x278247(0x12d))/0x3)+parseInt(_0x278247(0x160))/0x4+-parseInt(_0x278247(0x136))/0x5*(-parseInt(_0x278247(0x16a))/0x6)+parseInt(_0x278247(0x14b))/0x7+-parseInt(_0x278247(0x126))/0x8+-parseInt(_0x278247(0x105))/0x9;if(_0x434914===_0x381e8a)break;else _0x4f8e7f['push'](_0x4f8e7f['shift']());}catch(_0x4860b4){_0x4f8e7f['push'](_0x4f8e7f['shift']());}}}(a38_0x18df,0xc57f0));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(_0x5ed988,_0x4b6b30){const _0x3cc9be=a38_0x54d5,_0x4a7578=listLocalServiceTrees();let _0x52f08d;for(const _0x4638f5 of _0x4a7578){const _0x2302ea=matchServiceTreeCommand(_0x4638f5,_0x5ed988);if(!_0x2302ea)continue;(!_0x52f08d||_0x2302ea['command']['fullPath'][_0x3cc9be(0x138)]>_0x52f08d[_0x3cc9be(0x10f)]['fullPath'][_0x3cc9be(0x138)])&&(_0x52f08d={'tree':_0x4638f5,'command':_0x2302ea['command'],'remainingArgs':_0x2302ea[_0x3cc9be(0x15a)]});}if(!_0x52f08d)return undefined;const _0x443d0e={..._0x4b6b30};return applyAppBinding(_0x52f08d[_0x3cc9be(0x13c)],_0x52f08d[_0x3cc9be(0x10f)],_0x443d0e),{'definition':buildDynamicCommandDefinition(_0x52f08d[_0x3cc9be(0x13c)],_0x52f08d[_0x3cc9be(0x10f)]),'args':_0x52f08d[_0x3cc9be(0x15a)],'flags':_0x443d0e,'tree':_0x52f08d[_0x3cc9be(0x13c)],'command':_0x52f08d['command']};}export function generateDynamicServiceHelp(_0x4022d3){const _0x18503e=a38_0x54d5,_0x285dcc=listLocalServiceTrees()[_0x18503e(0x10a)](_0x13e85e=>_0x13e85e[_0x18503e(0x135)][_0x18503e(0x14f)]===_0x4022d3);if(!_0x285dcc)return undefined;const _0x3676c3=[CLI_BIN_NAME+'\x20'+_0x4022d3+_0x18503e(0x146),'',_0x285dcc['service'][_0x18503e(0x115)]||_0x4022d3,_0x285dcc['service'][_0x18503e(0x111)]?'\x20\x20'+_0x285dcc[_0x18503e(0x135)][_0x18503e(0x111)]:'','',_0x18503e(0x116),..._0x285dcc[_0x18503e(0x142)]['map'](_0x1b2f70=>{const _0xc835f7=_0x18503e,_0x384483=_0x1b2f70['fullPath'][_0xc835f7(0x144)](0x1)[_0xc835f7(0x11b)]('\x20'),_0x4a751e=_0x1b2f70[_0xc835f7(0x158)]===_0xc835f7(0x129)?'':'\x20['+_0x1b2f70['risk']+']';return'\x20\x20'+_0x384483[_0xc835f7(0x132)](0x18)+'\x20'+(_0x1b2f70[_0xc835f7(0x111)]||'')+_0x4a751e;}),'',_0x18503e(0x108)+CLI_BIN_NAME+_0x18503e(0x151)+_0x4022d3+'`\x20to\x20inspect\x20the\x20manifest.']['filter'](Boolean);return _0x3676c3['join']('\x0a');}export function listDynamicServiceEntries(){const _0x1fcbfe=a38_0x54d5;return listLocalServices()[_0x1fcbfe(0x10b)](_0x2f08a3=>{const _0x192c2f=_0x1fcbfe,_0x5e9df7=_0x2f08a3[_0x192c2f(0x110)];return{'service':_0x5e9df7[_0x192c2f(0x135)][_0x192c2f(0x14f)],'label':_0x5e9df7[_0x192c2f(0x135)][_0x192c2f(0x115)]||_0x5e9df7[_0x192c2f(0x135)][_0x192c2f(0x14f)],'commands':_0x5e9df7[_0x192c2f(0x142)][_0x192c2f(0x10b)](_0x3761b8=>({'command':dynamicCommandName(_0x3761b8),'description':_0x3761b8['description']||_0x192c2f(0x109)+_0x3761b8[_0x192c2f(0x125)],'tag':riskTag(_0x3761b8['risk'])}))};});}export function getDynamicServiceEntry(_0x140c36){const _0x147393=a38_0x54d5;return listDynamicServiceEntries()[_0x147393(0x10a)](_0x41d915=>_0x41d915[_0x147393(0x135)]===_0x140c36);}export function listDynamicServiceDefinitions(_0x2aa775){const _0x4fc263=a38_0x54d5;return listLocalServiceTrees()[_0x4fc263(0x133)](_0x5d5c17=>!_0x2aa775||_0x5d5c17[_0x4fc263(0x135)][_0x4fc263(0x14f)]===_0x2aa775)[_0x4fc263(0x11f)](_0x453d13=>_0x453d13['commands'][_0x4fc263(0x10b)](_0x840235=>buildDynamicCommandDefinition(_0x453d13,_0x840235)));}export function getDynamicServiceDefinitions(_0x4de172){const _0x1f551d=a38_0x54d5,_0x1c7801=listDynamicServiceDefinitions(_0x4de172);return _0x1c7801[_0x1f551d(0x138)]>0x0?_0x1c7801:undefined;}export function findDynamicServiceDefinition(_0x25ce7f,_0x3c3179){const _0x587acb=a38_0x54d5;return listDynamicServiceDefinitions(_0x25ce7f)['find'](_0x1f3a81=>_0x1f3a81[_0x587acb(0x10f)]===_0x3c3179);}export function buildDynamicCommandDefinition(_0x2ac700,_0x40b063){const _0x16dd5f=a38_0x54d5;return{'service':_0x2ac700[_0x16dd5f(0x135)]['code'],'command':dynamicCommandName(_0x40b063),'description':_0x40b063[_0x16dd5f(0x111)]||_0x16dd5f(0x109)+_0x40b063['cliPath'],'risk':_0x40b063[_0x16dd5f(0x158)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x40b063[_0x16dd5f(0x14c)][_0x16dd5f(0x10b)](_0x20eb9c=>({'name':_0x20eb9c[_0x16dd5f(0x115)],'description':_0x20eb9c['description']||_0x20eb9c['name'],'required':_0x20eb9c[_0x16dd5f(0x141)]})),'flags':_0x40b063[_0x16dd5f(0x10d)][_0x16dd5f(0x10b)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x40b063),async 'dryRun'(_0x31e5ff){const _0x475c05=_0x16dd5f,_0x1e87b0=await compilePlan(_0x40b063,_0x31e5ff);return{'method':'SERVICE_TREE','url':_0x40b063[_0x475c05(0x125)],'body':{'target':targetPreview(_0x1e87b0),'params':_0x1e87b0[_0x475c05(0x137)]},'description':_0x475c05(0x131)+_0x40b063[_0x475c05(0x125)]};},async 'execute'(_0x372893){const _0x3dd261=_0x16dd5f,_0x4de7a2=await compilePlan(_0x40b063,_0x372893),_0x37f5ef=Date[_0x3dd261(0x164)](),_0x3d352b=await executePlan(_0x4de7a2,_0x40b063,_0x372893),_0x175c03=Date['now']()-_0x37f5ef;return{'ok':!![],'data':{'service':_0x2ac700[_0x3dd261(0x135)],'command':_0x40b063[_0x3dd261(0x125)],'target':targetPreview(_0x4de7a2),'result':_0x3d352b,'elapsed':_0x175c03},'message':_0x3dd261(0x148)+_0x40b063[_0x3dd261(0x125)]+_0x3dd261(0x159)+_0x175c03+'ms'};}};}function dynamicCommandName(_0x4dc1bd){const _0x359bc1=a38_0x54d5;return _0x4dc1bd[_0x359bc1(0x12c)][_0x359bc1(0x144)](0x1)[_0x359bc1(0x11b)]('\x20');}function riskTag(_0x1eacbd){const _0x34615d=a38_0x54d5;return _0x1eacbd===_0x34615d(0x129)?'':'\x20\x20['+_0x1eacbd+']';}function flagToCommandFlag(_0x4b2057){const _0x4eb672=a38_0x54d5;return{'name':_0x4b2057['cliName'],'type':_0x4b2057[_0x4eb672(0x119)]===_0x4eb672(0x112)?_0x4eb672(0x14a):_0x4b2057[_0x4eb672(0x119)],'description':_0x4b2057[_0x4eb672(0x111)]||_0x4b2057[_0x4eb672(0x115)],'required':_0x4b2057[_0x4eb672(0x141)],'default':isPrimitiveFlagDefault(_0x4b2057[_0x4eb672(0x155)])?_0x4b2057['default']:undefined,'enum':_0x4b2057[_0x4eb672(0x139)]};}async function compilePlan(_0x57898f,_0x150c37){const _0x10e4e9=a38_0x54d5;return compileServiceTreeCommand(_0x57898f,{'flags':_0x150c37['rawFlags'],'args':_0x150c37[_0x10e4e9(0x14c)],'context':await buildServiceContext(_0x57898f,_0x150c37)});}async function buildServiceContext(_0x40c775,_0x414df8){const _0x3ddf78=a38_0x54d5,_0x141df9={'appCode':_0x414df8['appCode'],'env':_0x414df8['envName'],'envName':_0x414df8[_0x3ddf78(0x169)]};if(!usesRuntimeContext(_0x40c775))return _0x141df9;const _0x37dcdf=await getLoginUserInfo(),_0x5666a5=pickFirst(_0x37dcdf[_0x3ddf78(0x11d)],_0x37dcdf['id']);return{..._0x141df9,'user':_0x37dcdf,'userId':_0x5666a5,'id':_0x37dcdf['id'],'username':pickFirst(_0x37dcdf[_0x3ddf78(0x166)],_0x37dcdf['userName'],_0x37dcdf['loginName']),'userName':_0x37dcdf[_0x3ddf78(0x106)],'nickname':pickFirst(_0x37dcdf[_0x3ddf78(0x153)],_0x37dcdf[_0x3ddf78(0x11e)]),'nickName':_0x37dcdf[_0x3ddf78(0x11e)],'tenantCode':_0x37dcdf[_0x3ddf78(0x121)],'employeeId':_0x37dcdf['employeeId']};}function usesRuntimeContext(_0x11eab4){const _0x10f386=a38_0x54d5;return _0x11eab4[_0x10f386(0x13e)][_0x10f386(0x11a)](_0x21000b=>typeof _0x21000b[_0x10f386(0x163)]===_0x10f386(0x14a)&&(_0x21000b[_0x10f386(0x163)][_0x10f386(0x123)](_0x10f386(0x14d))||_0x21000b[_0x10f386(0x163)]['startsWith'](_0x10f386(0x130))));}function pickFirst(..._0x420c05){const _0x2076bf=a38_0x54d5;return _0x420c05[_0x2076bf(0x10a)](_0x4aec48=>_0x4aec48!==undefined&&_0x4aec48!==null);}async function executePlan(_0x49af86,_0x2b0144,_0x3910a8){const _0xe6d8c=a38_0x54d5;if(_0x49af86[_0xe6d8c(0x15e)]==='data'){const _0x1c6ecd=await resolveDatasetCode(_0x49af86,_0x2b0144,_0x3910a8);return executeData(_0x1c6ecd,_0x49af86[_0xe6d8c(0x10f)],_0x49af86[_0xe6d8c(0x137)]);}if(_0x49af86[_0xe6d8c(0x15e)]==='sql'){if(!_0x49af86['sqlCode'])throw CliErrors[_0xe6d8c(0x147)]('Service\x20command\x20'+_0x2b0144['cliPath']+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x49af86[_0xe6d8c(0x118)],normalizeScalarParams(_0x49af86['params']));}if(_0x49af86[_0xe6d8c(0x15e)]===_0xe6d8c(0x15c)){const _0xf0908e=_0x49af86['scriptName']||_0x49af86[_0xe6d8c(0x157)]||(_0x49af86[_0xe6d8c(0x127)]==null?'':String(_0x49af86[_0xe6d8c(0x127)]));if(!_0xf0908e)throw CliErrors[_0xe6d8c(0x147)]('Service\x20command\x20'+_0x2b0144[_0xe6d8c(0x125)]+_0xe6d8c(0x156));return executeSdkBff(_0xf0908e,_0x49af86['params']);}throw CliErrors[_0xe6d8c(0x147)](_0xe6d8c(0x152)+_0x49af86['kind']);}async function resolveDatasetCode(_0x16c542,_0x443c62,_0x43c2b0){const _0x5da2c2=a38_0x54d5;if(_0x16c542[_0x5da2c2(0x15f)])return _0x16c542[_0x5da2c2(0x15f)];if(!_0x16c542[_0x5da2c2(0x120)])throw CliErrors[_0x5da2c2(0x147)](_0x5da2c2(0x148)+_0x443c62['cliPath']+_0x5da2c2(0x15b));const _0x506164=await listDatasets(_0x43c2b0[_0x5da2c2(0x167)]),_0x7148f6=_0x506164[_0x5da2c2(0x10a)](_0x2d04a7=>_0x2d04a7[_0x5da2c2(0x12b)]?.[_0x5da2c2(0x13b)]===_0x16c542[_0x5da2c2(0x120)]);if(!_0x7148f6?.[_0x5da2c2(0x14f)])throw CliErrors['validation']('Cannot\x20resolve\x20datatable\x20\x22'+_0x16c542[_0x5da2c2(0x120)]+_0x5da2c2(0x12f)+_0x43c2b0[_0x5da2c2(0x167)]+'.',_0x5da2c2(0x13a));return _0x7148f6[_0x5da2c2(0x14f)];}function applyAppBinding(_0x42fa35,_0x1c675b,_0x56cd72){const _0x4013ae=a38_0x54d5,_0x3002f0=_0x1c675b[_0x4013ae(0x113)][_0x4013ae(0x10c)];if(!_0x3002f0)return;const _0x121057=_0x42fa35[_0x4013ae(0x114)][_0x3002f0];if(!_0x121057)throw CliErrors[_0x4013ae(0x147)](_0x4013ae(0x11c)+_0x3002f0+_0x4013ae(0x149)+_0x1c675b['cliPath']+'.',_0x4013ae(0x154));const _0x595331=_0x121057[_0x4013ae(0x12e)]||_0x121057[_0x4013ae(0x167)];_0x595331&&!hasText(_0x56cd72[_0x4013ae(0x12e)])&&(_0x56cd72['appcode']=_0x595331),_0x121057['app']&&!hasText(_0x56cd72[_0x4013ae(0x122)])&&!hasText(_0x56cd72[_0x4013ae(0x12e)])&&(_0x56cd72['app']=_0x121057['app']),_0x121057[_0x4013ae(0x15d)]&&!hasText(_0x56cd72[_0x4013ae(0x15d)])&&(_0x56cd72[_0x4013ae(0x15d)]=_0x121057[_0x4013ae(0x15d)]);}function renderDynamicCommandHelp(_0x135291){const _0x1d2633=a38_0x54d5,_0x41a426=[_0x1d2633(0x145),_0x1d2633(0x165)+_0x135291[_0x1d2633(0x113)][_0x1d2633(0x15e)],_0x1d2633(0x168)+_0x135291[_0x1d2633(0x113)][_0x1d2633(0x10f)]];if(_0x135291[_0x1d2633(0x113)][_0x1d2633(0x15f)])_0x41a426['push'](_0x1d2633(0x143)+_0x135291[_0x1d2633(0x113)][_0x1d2633(0x15f)]);if(_0x135291[_0x1d2633(0x113)][_0x1d2633(0x120)])_0x41a426[_0x1d2633(0x13f)](_0x1d2633(0x150)+_0x135291['target']['datatable']);if(_0x135291[_0x1d2633(0x113)][_0x1d2633(0x118)])_0x41a426[_0x1d2633(0x13f)]('\x20\x20\x20\x20sqlCode:\x20'+_0x135291[_0x1d2633(0x113)]['sqlCode']);if(_0x135291[_0x1d2633(0x113)][_0x1d2633(0x124)])_0x41a426[_0x1d2633(0x13f)]('\x20\x20\x20\x20scriptName:\x20'+_0x135291['target'][_0x1d2633(0x124)]);if(_0x135291[_0x1d2633(0x13e)][_0x1d2633(0x138)]>0x0){_0x41a426[_0x1d2633(0x13f)]('',_0x1d2633(0x12a));for(const _0x5bd2cb of _0x135291['mapTo']){_0x41a426[_0x1d2633(0x13f)](_0x1d2633(0x107)+(_0x5bd2cb[_0x1d2633(0x163)]||_0x1d2633(0x14e))+_0x1d2633(0x117)+_0x5bd2cb[_0x1d2633(0x113)]+(_0x5bd2cb[_0x1d2633(0x161)]?'.'+_0x5bd2cb[_0x1d2633(0x161)]:''));}}return _0x41a426[_0x1d2633(0x11b)]('\x0a');}function targetPreview(_0x95ec94){const _0x11c357=a38_0x54d5;return{'kind':_0x95ec94[_0x11c357(0x15e)],'command':_0x95ec94[_0x11c357(0x10f)],'appRef':_0x95ec94[_0x11c357(0x10c)],'datasetCode':_0x95ec94[_0x11c357(0x15f)],'datatable':_0x95ec94[_0x11c357(0x120)],'sqlCode':_0x95ec94[_0x11c357(0x118)],'bffCode':_0x95ec94[_0x11c357(0x157)],'bffId':_0x95ec94['bffId'],'scriptName':_0x95ec94[_0x11c357(0x124)]};}function normalizeScalarParams(_0x252e02){const _0x33d9e4=a38_0x54d5;return Object['fromEntries'](Object[_0x33d9e4(0x128)](_0x252e02)['filter'](([,_0x206975])=>typeof _0x206975==='string'||typeof _0x206975===_0x33d9e4(0x10e)));}function hasText(_0x780333){const _0x36eeda=a38_0x54d5;return typeof _0x780333==='string'&&_0x780333[_0x36eeda(0x13d)]()[_0x36eeda(0x138)]>0x0;}function a38_0x54d5(_0x3c1574,_0x574771){_0x3c1574=_0x3c1574-0x105;const _0x18dfb5=a38_0x18df();let _0x54d50f=_0x18dfb5[_0x3c1574];return _0x54d50f;}function isPrimitiveFlagDefault(_0x411927){const _0x4f1201=a38_0x54d5;return _0x411927===undefined||typeof _0x411927===_0x4f1201(0x14a)||typeof _0x411927===_0x4f1201(0x10e)||typeof _0x411927===_0x4f1201(0x134);}function a38_0x18df(){const _0x158c7e=['\x20requires\x20target.scriptName.','bffCode','risk','\x20completed\x20in\x20','remainingArgs','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','bff','env','kind','datasetCode','1725244osWtvM','operator','1454974KDHJur','source','now','\x20\x20\x20\x20kind:\x20\x20\x20\x20','username','appCode','\x20\x20\x20\x20command:\x20','envName','4218006GIsjAo','7028271GywGfW','userName','\x20\x20\x20\x20','Use\x20`','Run\x20service\x20command\x20','find','map','appRef','flags','number','command','normalizedManifest','description','json','target','appBindings','name','Commands:','\x20->\x20','sqlCode','type','some','join','Unknown\x20appRef\x20\x22','userId','nickName','flatMap','datatable','tenantCode','app','startsWith','scriptName','cliPath','351560MKTHkY','bffId','entries','read','\x20\x20MAP\x20TO','dbtableConfig','fullPath','3WRAUQx','appcode','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','ctx.','Preview\x20dynamic\x20service\x20command:\x20','padEnd','filter','boolean','service','5OvmpIV','params','length','enum','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','tableName','tree','trim','mapTo','push','753429rypOwB','required','commands','\x20\x20\x20\x20datasetCode:\x20','slice','\x20\x20SERVICE\x20TREE\x20TARGET','\x20<command>\x20[flags]','validation','Service\x20command\x20','\x22\x20in\x20service\x20command\x20','string','3678066pokGjX','args','context.','const','code','\x20\x20\x20\x20datatable:\x20','\x20service\x20detail\x20--service\x20','Unsupported\x20service\x20target\x20kind:\x20','nickname','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','default'];a38_0x18df=function(){return _0x158c7e;};return a38_0x18df();}
1
+ (function(_0x219e05,_0x57361a){const _0x102199=a38_0x27e2,_0x52845f=_0x219e05();while(!![]){try{const _0x1e423a=-parseInt(_0x102199(0x126))/0x1+parseInt(_0x102199(0x16f))/0x2+parseInt(_0x102199(0x14b))/0x3+-parseInt(_0x102199(0x11b))/0x4+parseInt(_0x102199(0x133))/0x5+parseInt(_0x102199(0x118))/0x6*(-parseInt(_0x102199(0x134))/0x7)+parseInt(_0x102199(0x142))/0x8*(parseInt(_0x102199(0x147))/0x9);if(_0x1e423a===_0x57361a)break;else _0x52845f['push'](_0x52845f['shift']());}catch(_0x347612){_0x52845f['push'](_0x52845f['shift']());}}}(a38_0x1445,0xb5503));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(_0x48b01f,_0x4cfede){const _0x1fa76b=a38_0x27e2,_0x5ddd36=listLocalServiceTrees();let _0x4c7aca;for(const _0xc1ec5d of _0x5ddd36){const _0x2e8093=matchServiceTreeCommand(_0xc1ec5d,_0x48b01f);if(!_0x2e8093)continue;(!_0x4c7aca||_0x2e8093[_0x1fa76b(0x11d)][_0x1fa76b(0x14c)][_0x1fa76b(0x16a)]>_0x4c7aca[_0x1fa76b(0x11d)][_0x1fa76b(0x14c)][_0x1fa76b(0x16a)])&&(_0x4c7aca={'tree':_0xc1ec5d,'command':_0x2e8093[_0x1fa76b(0x11d)],'remainingArgs':_0x2e8093['remainingArgs']});}if(!_0x4c7aca)return undefined;const _0x294474={..._0x4cfede};return applyAppBinding(_0x4c7aca['tree'],_0x4c7aca[_0x1fa76b(0x11d)],_0x294474),{'definition':buildDynamicCommandDefinition(_0x4c7aca[_0x1fa76b(0x143)],_0x4c7aca[_0x1fa76b(0x11d)]),'args':_0x4c7aca[_0x1fa76b(0x15f)],'flags':_0x294474,'tree':_0x4c7aca[_0x1fa76b(0x143)],'command':_0x4c7aca['command']};}function a38_0x1445(){const _0x37aef8=['nickName','trim','6162584ktOSIw','tree','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','find','bff','18uWhIGf','app','read','Run\x20service\x20command\x20','2008530QAophN','fullPath','Preview\x20dynamic\x20service\x20command:\x20','service','\x20\x20\x20\x20sqlCode:\x20','operator','\x22\x20in\x20service\x20command\x20','bffCode','args','kind','\x20\x20\x20\x20kind:\x20\x20\x20\x20','appcode','ctx.','tenantCode','description','required','\x20\x20\x20\x20scriptName:\x20','userName','SERVICE_TREE','userId','remainingArgs','name','push','source','bffId','normalizedManifest','nickname','string','Unknown\x20appRef\x20\x22','\x20\x20[','envName','length','join','mapTo','boolean','type','1069402EXQBRE','\x20\x20\x20\x20datasetCode:\x20','appCode','json','now','sqlCode','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','scriptName','code','map','96042eDmTzt','filter','env','1653884EiepBK','Cannot\x20resolve\x20datatable\x20\x22','command','\x20\x20\x20\x20datatable:\x20','dbtableConfig','cliPath','data','risk','validation','rawFlags','`\x20to\x20inspect\x20the\x20manifest.','1397326hAGNZl','appRef','commands','enum','number','slice','\x20\x20MAP\x20TO','some','context.','\x20<command>\x20[flags]','params','Service\x20command\x20','datasetCode','2564535xGlpag','308tBVXFK','appBindings','datatable','flags','\x20\x20SERVICE\x20TREE\x20TARGET','cliName','target','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','\x20->\x20','Use\x20`','\x20requires\x20target.scriptName.','sql'];a38_0x1445=function(){return _0x37aef8;};return a38_0x1445();}export function generateDynamicServiceHelp(_0x49b820){const _0x3f8063=a38_0x27e2,_0x1af058=listLocalServiceTrees()[_0x3f8063(0x145)](_0x54ec3c=>_0x54ec3c[_0x3f8063(0x14e)][_0x3f8063(0x116)]===_0x49b820);if(!_0x1af058)return undefined;const _0x406c39=[CLI_BIN_NAME+'\x20'+_0x49b820+_0x3f8063(0x12f),'',_0x1af058[_0x3f8063(0x14e)]['name']||_0x49b820,_0x1af058[_0x3f8063(0x14e)][_0x3f8063(0x159)]?'\x20\x20'+_0x1af058[_0x3f8063(0x14e)][_0x3f8063(0x159)]:'','','Commands:',..._0x1af058[_0x3f8063(0x128)][_0x3f8063(0x117)](_0x1565ce=>{const _0x4001f6=_0x3f8063,_0x44730a=_0x1565ce['fullPath'][_0x4001f6(0x12b)](0x1)[_0x4001f6(0x16b)]('\x20'),_0x376a72=_0x1565ce[_0x4001f6(0x122)]===_0x4001f6(0x149)?'':'\x20['+_0x1565ce[_0x4001f6(0x122)]+']';return'\x20\x20'+_0x44730a['padEnd'](0x18)+'\x20'+(_0x1565ce[_0x4001f6(0x159)]||'')+_0x376a72;}),'',_0x3f8063(0x13d)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x49b820+_0x3f8063(0x125)][_0x3f8063(0x119)](Boolean);return _0x406c39['join']('\x0a');}export function listDynamicServiceEntries(){const _0x2a855a=a38_0x27e2;return listLocalServices()[_0x2a855a(0x117)](_0x2c4ab3=>{const _0x29349c=_0x2a855a,_0x3a17ab=_0x2c4ab3[_0x29349c(0x164)];return{'service':_0x3a17ab[_0x29349c(0x14e)][_0x29349c(0x116)],'label':_0x3a17ab[_0x29349c(0x14e)][_0x29349c(0x160)]||_0x3a17ab[_0x29349c(0x14e)][_0x29349c(0x116)],'commands':_0x3a17ab[_0x29349c(0x128)][_0x29349c(0x117)](_0x15fc49=>({'command':dynamicCommandName(_0x15fc49),'description':_0x15fc49[_0x29349c(0x159)]||_0x29349c(0x14a)+_0x15fc49[_0x29349c(0x120)],'tag':riskTag(_0x15fc49['risk'])}))};});}export function getDynamicServiceEntry(_0x46eaed){const _0x16d2e7=a38_0x27e2;return listDynamicServiceEntries()[_0x16d2e7(0x145)](_0x1df146=>_0x1df146[_0x16d2e7(0x14e)]===_0x46eaed);}export function listDynamicServiceDefinitions(_0x417097){const _0x637252=a38_0x27e2;return listLocalServiceTrees()[_0x637252(0x119)](_0x45b69a=>!_0x417097||_0x45b69a[_0x637252(0x14e)][_0x637252(0x116)]===_0x417097)['flatMap'](_0x53e5df=>_0x53e5df[_0x637252(0x128)][_0x637252(0x117)](_0x58983e=>buildDynamicCommandDefinition(_0x53e5df,_0x58983e)));}export function getDynamicServiceDefinitions(_0xca1471){const _0x2403cf=a38_0x27e2,_0x4f8041=listDynamicServiceDefinitions(_0xca1471);return _0x4f8041[_0x2403cf(0x16a)]>0x0?_0x4f8041:undefined;}export function findDynamicServiceDefinition(_0x2b022f,_0x1c0659){const _0x454533=a38_0x27e2;return listDynamicServiceDefinitions(_0x2b022f)['find'](_0x199438=>_0x199438[_0x454533(0x11d)]===_0x1c0659);}export function buildDynamicCommandDefinition(_0x1db319,_0x35dd2a){const _0x5c3a09=a38_0x27e2;return{'service':_0x1db319['service'][_0x5c3a09(0x116)],'command':dynamicCommandName(_0x35dd2a),'description':_0x35dd2a[_0x5c3a09(0x159)]||_0x5c3a09(0x14a)+_0x35dd2a['cliPath'],'risk':_0x35dd2a[_0x5c3a09(0x122)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x35dd2a[_0x5c3a09(0x153)][_0x5c3a09(0x117)](_0x5da729=>({'name':_0x5da729[_0x5c3a09(0x160)],'description':_0x5da729[_0x5c3a09(0x159)]||_0x5da729['name'],'required':_0x5da729['required']})),'flags':_0x35dd2a[_0x5c3a09(0x137)][_0x5c3a09(0x117)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x35dd2a),async 'dryRun'(_0x11b9fc){const _0x5b8b56=_0x5c3a09,_0x42e657=await compilePlan(_0x35dd2a,_0x11b9fc);return{'method':_0x5b8b56(0x15d),'url':_0x35dd2a['cliPath'],'body':{'target':targetPreview(_0x42e657),'params':_0x42e657['params']},'description':_0x5b8b56(0x14d)+_0x35dd2a[_0x5b8b56(0x120)]};},async 'execute'(_0x400aae){const _0x526d57=_0x5c3a09,_0x268018=await compilePlan(_0x35dd2a,_0x400aae),_0x2c7ae6=Date[_0x526d57(0x112)](),_0x44a5dc=await executePlan(_0x268018,_0x35dd2a,_0x400aae),_0x483593=Date[_0x526d57(0x112)]()-_0x2c7ae6;return{'ok':!![],'data':{'service':_0x1db319[_0x526d57(0x14e)],'command':_0x35dd2a[_0x526d57(0x120)],'target':targetPreview(_0x268018),'result':_0x44a5dc,'elapsed':_0x483593},'message':'Service\x20command\x20'+_0x35dd2a[_0x526d57(0x120)]+'\x20completed\x20in\x20'+_0x483593+'ms'};}};}function dynamicCommandName(_0x175b97){const _0x288a45=a38_0x27e2;return _0x175b97[_0x288a45(0x14c)][_0x288a45(0x12b)](0x1)[_0x288a45(0x16b)]('\x20');}function riskTag(_0x3c1184){const _0x1c42a6=a38_0x27e2;return _0x3c1184===_0x1c42a6(0x149)?'':_0x1c42a6(0x168)+_0x3c1184+']';}function flagToCommandFlag(_0x43f435){const _0x52a561=a38_0x27e2;return{'name':_0x43f435[_0x52a561(0x139)],'type':_0x43f435['type']===_0x52a561(0x111)?_0x52a561(0x166):_0x43f435[_0x52a561(0x16e)],'description':_0x43f435[_0x52a561(0x159)]||_0x43f435[_0x52a561(0x160)],'required':_0x43f435[_0x52a561(0x15a)],'default':isPrimitiveFlagDefault(_0x43f435['default'])?_0x43f435['default']:undefined,'enum':_0x43f435[_0x52a561(0x129)]};}async function compilePlan(_0x3562bb,_0x433a94){const _0x12c104=a38_0x27e2;return compileServiceTreeCommand(_0x3562bb,{'flags':_0x433a94[_0x12c104(0x124)],'args':_0x433a94[_0x12c104(0x153)],'context':await buildServiceContext(_0x3562bb,_0x433a94)});}async function buildServiceContext(_0x48b3b4,_0x1f2488){const _0x458c8e=a38_0x27e2,_0x44f843={'appCode':_0x1f2488[_0x458c8e(0x110)],'env':_0x1f2488[_0x458c8e(0x169)],'envName':_0x1f2488[_0x458c8e(0x169)]};if(!usesRuntimeContext(_0x48b3b4))return _0x44f843;const _0x27f12b=await getLoginUserInfo(),_0x25eee0=pickFirst(_0x27f12b[_0x458c8e(0x15e)],_0x27f12b['id']);return{..._0x44f843,'user':_0x27f12b,'userId':_0x25eee0,'id':_0x27f12b['id'],'username':pickFirst(_0x27f12b['username'],_0x27f12b[_0x458c8e(0x15c)],_0x27f12b['loginName']),'userName':_0x27f12b[_0x458c8e(0x15c)],'nickname':pickFirst(_0x27f12b[_0x458c8e(0x165)],_0x27f12b[_0x458c8e(0x140)]),'nickName':_0x27f12b['nickName'],'tenantCode':_0x27f12b[_0x458c8e(0x158)],'employeeId':_0x27f12b['employeeId']};}function usesRuntimeContext(_0x820926){const _0x4883ae=a38_0x27e2;return _0x820926[_0x4883ae(0x16c)][_0x4883ae(0x12d)](_0x1974dd=>typeof _0x1974dd[_0x4883ae(0x162)]==='string'&&(_0x1974dd['source']['startsWith'](_0x4883ae(0x12e))||_0x1974dd[_0x4883ae(0x162)]['startsWith'](_0x4883ae(0x157))));}function pickFirst(..._0x2cb268){return _0x2cb268['find'](_0x56f1c9=>_0x56f1c9!==undefined&&_0x56f1c9!==null);}async function executePlan(_0x5e298a,_0x3bdf5b,_0x4f8795){const _0x10580f=a38_0x27e2;if(_0x5e298a[_0x10580f(0x154)]===_0x10580f(0x121)){const _0x3f8459=await resolveDatasetCode(_0x5e298a,_0x3bdf5b,_0x4f8795);return executeData(_0x3f8459,_0x5e298a[_0x10580f(0x11d)],_0x5e298a[_0x10580f(0x130)]);}if(_0x5e298a[_0x10580f(0x154)]===_0x10580f(0x13f)){if(!_0x5e298a[_0x10580f(0x113)])throw CliErrors['validation']('Service\x20command\x20'+_0x3bdf5b[_0x10580f(0x120)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x5e298a[_0x10580f(0x113)],normalizeScalarParams(_0x5e298a[_0x10580f(0x130)]));}if(_0x5e298a[_0x10580f(0x154)]===_0x10580f(0x146)){const _0x132a81=_0x5e298a['scriptName']||_0x5e298a[_0x10580f(0x152)]||(_0x5e298a[_0x10580f(0x163)]==null?'':String(_0x5e298a[_0x10580f(0x163)]));if(!_0x132a81)throw CliErrors[_0x10580f(0x123)](_0x10580f(0x131)+_0x3bdf5b['cliPath']+_0x10580f(0x13e));return executeSdkBff(_0x132a81,_0x5e298a[_0x10580f(0x130)]);}throw CliErrors[_0x10580f(0x123)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x5e298a[_0x10580f(0x154)]);}async function resolveDatasetCode(_0x3fac6a,_0x193187,_0x1203f0){const _0x3957f4=a38_0x27e2;if(_0x3fac6a['datasetCode'])return _0x3fac6a['datasetCode'];if(!_0x3fac6a[_0x3957f4(0x136)])throw CliErrors[_0x3957f4(0x123)](_0x3957f4(0x131)+_0x193187[_0x3957f4(0x120)]+_0x3957f4(0x13b));const _0x538fd3=await listDatasets(_0x1203f0[_0x3957f4(0x110)]),_0x16af15=_0x538fd3[_0x3957f4(0x145)](_0x3737e6=>_0x3737e6[_0x3957f4(0x11f)]?.['tableName']===_0x3fac6a[_0x3957f4(0x136)]);if(!_0x16af15?.[_0x3957f4(0x116)])throw CliErrors['validation'](_0x3957f4(0x11c)+_0x3fac6a[_0x3957f4(0x136)]+_0x3957f4(0x144)+_0x1203f0[_0x3957f4(0x110)]+'.',_0x3957f4(0x114));return _0x16af15[_0x3957f4(0x116)];}function applyAppBinding(_0x39ac3e,_0xd6789c,_0x2c6e7d){const _0x397aca=a38_0x27e2,_0x57e3f3=_0xd6789c[_0x397aca(0x13a)][_0x397aca(0x127)];if(!_0x57e3f3)return;const _0x5465a7=_0x39ac3e[_0x397aca(0x135)][_0x57e3f3];if(!_0x5465a7)throw CliErrors[_0x397aca(0x123)](_0x397aca(0x167)+_0x57e3f3+_0x397aca(0x151)+_0xd6789c[_0x397aca(0x120)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x28ffb6=_0x5465a7[_0x397aca(0x156)]||_0x5465a7['appCode'];_0x28ffb6&&!hasText(_0x2c6e7d[_0x397aca(0x156)])&&(_0x2c6e7d[_0x397aca(0x156)]=_0x28ffb6),_0x5465a7[_0x397aca(0x148)]&&!hasText(_0x2c6e7d[_0x397aca(0x148)])&&!hasText(_0x2c6e7d[_0x397aca(0x156)])&&(_0x2c6e7d[_0x397aca(0x148)]=_0x5465a7['app']),_0x5465a7[_0x397aca(0x11a)]&&!hasText(_0x2c6e7d[_0x397aca(0x11a)])&&(_0x2c6e7d[_0x397aca(0x11a)]=_0x5465a7[_0x397aca(0x11a)]);}function renderDynamicCommandHelp(_0x4fb158){const _0x5cb80c=a38_0x27e2,_0x109804=[_0x5cb80c(0x138),_0x5cb80c(0x155)+_0x4fb158['target'][_0x5cb80c(0x154)],'\x20\x20\x20\x20command:\x20'+_0x4fb158[_0x5cb80c(0x13a)][_0x5cb80c(0x11d)]];if(_0x4fb158[_0x5cb80c(0x13a)][_0x5cb80c(0x132)])_0x109804[_0x5cb80c(0x161)](_0x5cb80c(0x10f)+_0x4fb158[_0x5cb80c(0x13a)]['datasetCode']);if(_0x4fb158[_0x5cb80c(0x13a)]['datatable'])_0x109804[_0x5cb80c(0x161)](_0x5cb80c(0x11e)+_0x4fb158['target'][_0x5cb80c(0x136)]);if(_0x4fb158[_0x5cb80c(0x13a)][_0x5cb80c(0x113)])_0x109804['push'](_0x5cb80c(0x14f)+_0x4fb158[_0x5cb80c(0x13a)]['sqlCode']);if(_0x4fb158['target'][_0x5cb80c(0x115)])_0x109804[_0x5cb80c(0x161)](_0x5cb80c(0x15b)+_0x4fb158[_0x5cb80c(0x13a)]['scriptName']);if(_0x4fb158['mapTo'][_0x5cb80c(0x16a)]>0x0){_0x109804[_0x5cb80c(0x161)]('',_0x5cb80c(0x12c));for(const _0x1b457a of _0x4fb158[_0x5cb80c(0x16c)]){_0x109804['push']('\x20\x20\x20\x20'+(_0x1b457a[_0x5cb80c(0x162)]||'const')+_0x5cb80c(0x13c)+_0x1b457a[_0x5cb80c(0x13a)]+(_0x1b457a[_0x5cb80c(0x150)]?'.'+_0x1b457a[_0x5cb80c(0x150)]:''));}}return _0x109804['join']('\x0a');}function targetPreview(_0x581edc){const _0xe1df1c=a38_0x27e2;return{'kind':_0x581edc[_0xe1df1c(0x154)],'command':_0x581edc[_0xe1df1c(0x11d)],'appRef':_0x581edc[_0xe1df1c(0x127)],'datasetCode':_0x581edc[_0xe1df1c(0x132)],'datatable':_0x581edc['datatable'],'sqlCode':_0x581edc[_0xe1df1c(0x113)],'bffCode':_0x581edc[_0xe1df1c(0x152)],'bffId':_0x581edc[_0xe1df1c(0x163)],'scriptName':_0x581edc[_0xe1df1c(0x115)]};}function a38_0x27e2(_0x5f3946,_0x2ce238){_0x5f3946=_0x5f3946-0x10f;const _0x144543=a38_0x1445();let _0x27e231=_0x144543[_0x5f3946];return _0x27e231;}function normalizeScalarParams(_0x6a6ed4){const _0x44a1a1=a38_0x27e2;return Object['fromEntries'](Object['entries'](_0x6a6ed4)[_0x44a1a1(0x119)](([,_0x44f7b5])=>typeof _0x44f7b5==='string'||typeof _0x44f7b5===_0x44a1a1(0x12a)));}function hasText(_0x31e538){const _0x47c7d5=a38_0x27e2;return typeof _0x31e538===_0x47c7d5(0x166)&&_0x31e538[_0x47c7d5(0x141)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x122bd6){const _0x5426eb=a38_0x27e2;return _0x122bd6===undefined||typeof _0x122bd6===_0x5426eb(0x166)||typeof _0x122bd6==='number'||typeof _0x122bd6===_0x5426eb(0x16d);}
@@ -1 +1 @@
1
- const a39_0x4298ba=a39_0x5b40;(function(_0x1ce098,_0x458a22){const _0x660e60=a39_0x5b40,_0x25aaff=_0x1ce098();while(!![]){try{const _0x3bb90e=parseInt(_0x660e60(0x16d))/0x1*(parseInt(_0x660e60(0x160))/0x2)+parseInt(_0x660e60(0x167))/0x3+-parseInt(_0x660e60(0x175))/0x4+parseInt(_0x660e60(0x15d))/0x5+-parseInt(_0x660e60(0x198))/0x6*(-parseInt(_0x660e60(0x16f))/0x7)+parseInt(_0x660e60(0x168))/0x8*(parseInt(_0x660e60(0x15a))/0x9)+-parseInt(_0x660e60(0x19b))/0xa;if(_0x3bb90e===_0x458a22)break;else _0x25aaff['push'](_0x25aaff['shift']());}catch(_0x13c7ab){_0x25aaff['push'](_0x25aaff['shift']());}}}(a39_0x55d6,0x3e106));function a39_0x55d6(){const _0x4284fb=['errors','hash','registryIndex','commands','manifest','Updated','Service\x20registry\x20validation\x20passed.','filePath','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','import','map','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','detail','WRITE','manifests','entry','entries','cliPath','registryPath','description','normalizedManifest','5322scszBN','reduce','Exported\x20service\x20','15251140KhUBkJ','report','Removed\x20service\x20','string','length','name','validate','remove','9HwQPPz','target','cliName','2307455EOBSnI','risk','Local\x20service\x20code,\x20for\x20example\x20crm','424882lzsIBk','Local\x20service\x20not\x20found:\x20','lower\x20kebab-case\x20service\x20code','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','flags','type','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','1338600qCGzAF','3645304BbFQxQ','\x20service\x20','file','source','\x20service(s),\x20updated\x20','2pfraXx','service','742SgSXuy','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','list','\x20service(s).','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','registryServiceCode','411720VcOIrG','kind','imported','serviceCode','write','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','serviceCount','str','version','updated','export','warnings','replaced','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file'];a39_0x55d6=function(){return _0x4284fb;};return a39_0x55d6();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':'file','type':a39_0x4298ba(0x19e),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':'service','type':'string','required':!![],'description':a39_0x4298ba(0x15f),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x4298ba(0x162)}};function summarizeService(_0x49f5cf){const _0x186536=a39_0x4298ba;return{'serviceCode':_0x49f5cf['serviceCode'],'name':_0x49f5cf['normalizedManifest']['service'][_0x186536(0x1a0)],'version':_0x49f5cf[_0x186536(0x17d)],'importedAt':_0x49f5cf['importedAt'],'source':_0x49f5cf['source'],'commandCount':_0x49f5cf[_0x186536(0x197)][_0x186536(0x186)][_0x186536(0x19f)],'commands':_0x49f5cf[_0x186536(0x197)][_0x186536(0x186)]['map'](_0x1c91ce=>({'path':_0x1c91ce[_0x186536(0x194)],'description':_0x1c91ce[_0x186536(0x196)],'risk':_0x1c91ce['risk'],'target':_0x1c91ce[_0x186536(0x15b)],'flags':_0x1c91ce[_0x186536(0x164)][_0x186536(0x18d)](_0x2d1dac=>({'name':_0x2d1dac[_0x186536(0x1a0)],'cliName':_0x2d1dac[_0x186536(0x15c)],'type':_0x2d1dac[_0x186536(0x165)],'required':_0x2d1dac['required']===!![]}))}))};}function summarizeLoadedManifest(_0x311292){const _0x4cae2d=a39_0x4298ba;return{'service':_0x311292[_0x4cae2d(0x197)]?.[_0x4cae2d(0x16e)],'version':_0x311292['normalizedManifest']?.[_0x4cae2d(0x17d)],'commandCount':_0x311292[_0x4cae2d(0x197)]?.[_0x4cae2d(0x186)][_0x4cae2d(0x19f)]??0x0,'commands':_0x311292['normalizedManifest']?.[_0x4cae2d(0x186)]['map'](_0x1d1d81=>({'path':_0x1d1d81['cliPath'],'risk':_0x1d1d81[_0x4cae2d(0x15e)],'target':_0x1d1d81['target']}))??[],'registryIndex':_0x311292[_0x4cae2d(0x185)],'registryServiceCode':_0x311292[_0x4cae2d(0x174)],'errors':_0x311292[_0x4cae2d(0x19c)]['errors'],'warnings':_0x311292[_0x4cae2d(0x19c)][_0x4cae2d(0x180)]};}function a39_0x5b40(_0x374f91,_0x10cc7f){_0x374f91=_0x374f91-0x159;const _0x55d623=a39_0x55d6();let _0x5b4047=_0x55d623[_0x374f91];return _0x5b4047;}export const serviceDefinitions=[{'service':a39_0x4298ba(0x16e),'command':a39_0x4298ba(0x1a1),'description':a39_0x4298ba(0x17a),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x307994){const _0xbf8d5b=a39_0x4298ba,_0x3bb743=loadServiceManifestFromFile(_0x307994[_0xbf8d5b(0x17c)](_0xbf8d5b(0x16a)));if(!_0x3bb743[_0xbf8d5b(0x19c)]['ok'])return{'ok':![],'data':{'file':_0x3bb743[_0xbf8d5b(0x18a)],'hash':_0x3bb743['hash'],'kind':_0x3bb743[_0xbf8d5b(0x176)],'serviceCount':_0x3bb743[_0xbf8d5b(0x191)][_0xbf8d5b(0x19f)],'services':_0x3bb743[_0xbf8d5b(0x191)][_0xbf8d5b(0x18d)](summarizeLoadedManifest),'errors':_0x3bb743[_0xbf8d5b(0x19c)][_0xbf8d5b(0x183)],'warnings':_0x3bb743['report'][_0xbf8d5b(0x180)]},'message':formatValidationFailure(_0x3bb743[_0xbf8d5b(0x19c)])};if(_0x3bb743[_0xbf8d5b(0x176)]==='registry'||_0x3bb743[_0xbf8d5b(0x191)][_0xbf8d5b(0x19f)]!==0x1)return{'ok':!![],'data':{'file':_0x3bb743[_0xbf8d5b(0x18a)],'hash':_0x3bb743[_0xbf8d5b(0x184)],'kind':_0x3bb743[_0xbf8d5b(0x176)],'serviceCount':_0x3bb743['manifests'][_0xbf8d5b(0x19f)],'commandCount':_0x3bb743['manifests'][_0xbf8d5b(0x199)]((_0x3ab943,_0x33b9ec)=>_0x3ab943+(_0x33b9ec[_0xbf8d5b(0x197)]?.['commands'][_0xbf8d5b(0x19f)]??0x0),0x0),'services':_0x3bb743[_0xbf8d5b(0x191)][_0xbf8d5b(0x18d)](summarizeLoadedManifest),'warnings':_0x3bb743[_0xbf8d5b(0x19c)][_0xbf8d5b(0x180)]},'message':_0xbf8d5b(0x189)};return{'ok':!![],'data':{'file':_0x3bb743['filePath'],'hash':_0x3bb743[_0xbf8d5b(0x184)],'kind':_0x3bb743['kind'],'service':_0x3bb743['normalizedManifest']?.[_0xbf8d5b(0x16e)],'version':_0x3bb743[_0xbf8d5b(0x197)]?.[_0xbf8d5b(0x17d)],'commandCount':_0x3bb743[_0xbf8d5b(0x197)]?.[_0xbf8d5b(0x186)][_0xbf8d5b(0x19f)]??0x0,'commands':_0x3bb743[_0xbf8d5b(0x197)]?.[_0xbf8d5b(0x186)][_0xbf8d5b(0x18d)](_0x3cabc7=>({'path':_0x3cabc7[_0xbf8d5b(0x194)],'risk':_0x3cabc7[_0xbf8d5b(0x15e)],'target':_0x3cabc7[_0xbf8d5b(0x15b)]})),'warnings':_0x3bb743['report']['warnings']},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a39_0x4298ba(0x16e),'command':a39_0x4298ba(0x18c),'description':a39_0x4298ba(0x18b),'risk':a39_0x4298ba(0x179),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x188906){const _0xd09e8c=a39_0x4298ba,_0x580b79=loadServiceManifestFromFile(_0x188906[_0xd09e8c(0x17c)](_0xd09e8c(0x16a)));return{'method':_0xd09e8c(0x190),'url':getServiceRegistryPath(),'body':{'file':_0x580b79[_0xd09e8c(0x18a)],'hash':_0x580b79[_0xd09e8c(0x184)],'kind':_0x580b79[_0xd09e8c(0x176)],'ok':_0x580b79['report']['ok'],'service':_0x580b79[_0xd09e8c(0x197)]?.['service'],'version':_0x580b79[_0xd09e8c(0x197)]?.['version'],'serviceCount':_0x580b79[_0xd09e8c(0x191)]['length'],'services':_0x580b79[_0xd09e8c(0x191)][_0xd09e8c(0x18d)](_0x1032f7=>({'service':_0x1032f7['normalizedManifest']?.[_0xd09e8c(0x16e)],'version':_0x1032f7[_0xd09e8c(0x197)]?.[_0xd09e8c(0x17d)],'commandCount':_0x1032f7[_0xd09e8c(0x197)]?.[_0xd09e8c(0x186)][_0xd09e8c(0x19f)]??0x0,'errors':_0x1032f7[_0xd09e8c(0x19c)][_0xd09e8c(0x183)]})),'errors':_0x580b79[_0xd09e8c(0x19c)][_0xd09e8c(0x183)],'commandCount':_0x580b79[_0xd09e8c(0x197)]?.[_0xd09e8c(0x186)][_0xd09e8c(0x19f)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x3bc0f3){const _0x4f23f8=a39_0x4298ba,_0x22b5e6=importServiceManifest(_0x3bc0f3[_0x4f23f8(0x17c)](_0x4f23f8(0x16a)));if(_0x22b5e6[_0x4f23f8(0x193)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x22b5e6[_0x4f23f8(0x195)],'imported':_0x22b5e6[_0x4f23f8(0x177)],'updated':_0x22b5e6[_0x4f23f8(0x17e)],'serviceCount':_0x22b5e6[_0x4f23f8(0x17b)],'services':_0x22b5e6[_0x4f23f8(0x193)][_0x4f23f8(0x18d)](summarizeService)},'message':'Imported\x20'+_0x22b5e6[_0x4f23f8(0x177)]+_0x4f23f8(0x16c)+_0x22b5e6[_0x4f23f8(0x17e)]+_0x4f23f8(0x172)};return{'ok':!![],'data':{'registryPath':_0x22b5e6['registryPath'],'replaced':_0x22b5e6['replaced'],'imported':_0x22b5e6[_0x4f23f8(0x177)],'updated':_0x22b5e6[_0x4f23f8(0x17e)],'serviceCount':_0x22b5e6['serviceCount'],'service':summarizeService(_0x22b5e6[_0x4f23f8(0x192)])},'message':(_0x22b5e6[_0x4f23f8(0x181)]?_0x4f23f8(0x188):'Imported')+_0x4f23f8(0x169)+_0x22b5e6['entry'][_0x4f23f8(0x178)]+'.'};}},{'service':a39_0x4298ba(0x16e),'command':a39_0x4298ba(0x17f),'description':a39_0x4298ba(0x182),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x235a94){const _0x52be32=a39_0x4298ba,_0x4403c5=getLocalServiceEntry(_0x235a94[_0x52be32(0x17c)](_0x52be32(0x16e)));return{'method':'WRITE','url':_0x235a94['str'](_0x52be32(0x16a)),'body':{'service':_0x235a94['str'](_0x52be32(0x16e)),'found':Boolean(_0x4403c5),'version':_0x4403c5?.[_0x52be32(0x17d)],'source':_0x4403c5?.[_0x52be32(0x16b)]},'description':_0x52be32(0x166)};},async 'execute'(_0x451b3e){const _0xf5cb1c=a39_0x4298ba,_0x38b860=exportServiceManifest(_0x451b3e[_0xf5cb1c(0x17c)](_0xf5cb1c(0x16e)),_0x451b3e[_0xf5cb1c(0x17c)]('file'));return{'ok':!![],'data':{'registryPath':_0x38b860[_0xf5cb1c(0x195)],'file':_0x38b860['filePath'],'service':summarizeService(_0x38b860['entry'])},'message':_0xf5cb1c(0x19a)+_0x38b860[_0xf5cb1c(0x192)][_0xf5cb1c(0x178)]+'.'};}},{'service':a39_0x4298ba(0x16e),'command':a39_0x4298ba(0x171),'description':a39_0x4298ba(0x173),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x58243f=a39_0x4298ba,_0x33e700=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x33e700['length'],'services':_0x33e700[_0x58243f(0x18d)](summarizeService)}};}},{'service':a39_0x4298ba(0x16e),'command':a39_0x4298ba(0x159),'description':a39_0x4298ba(0x18e),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x191baa){const _0x145316=a39_0x4298ba,_0x32c793=getLocalServiceEntry(_0x191baa[_0x145316(0x17c)](_0x145316(0x16e)));return{'method':_0x145316(0x190),'url':getServiceRegistryPath(),'body':{'service':_0x191baa[_0x145316(0x17c)]('service'),'found':Boolean(_0x32c793),'version':_0x32c793?.['version'],'source':_0x32c793?.[_0x145316(0x16b)]},'description':_0x145316(0x170)};},async 'execute'(_0x17a72d){const _0x4f53da=a39_0x4298ba,_0x3e74c4=removeServiceManifest(_0x17a72d['str'](_0x4f53da(0x16e)));return{'ok':!![],'data':{'registryPath':_0x3e74c4[_0x4f53da(0x195)],'serviceCount':_0x3e74c4[_0x4f53da(0x17b)],'service':summarizeService(_0x3e74c4['entry'])},'message':_0x4f53da(0x19d)+_0x3e74c4[_0x4f53da(0x192)][_0x4f53da(0x178)]+'.'};}},{'service':'service','command':a39_0x4298ba(0x18f),'description':a39_0x4298ba(0x163),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x365b45){const _0x282926=a39_0x4298ba,_0x60940d=getLocalServiceEntry(_0x365b45[_0x282926(0x17c)]('service'));if(!_0x60940d)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x365b45['str']('service')},'message':_0x282926(0x161)+_0x365b45[_0x282926(0x17c)](_0x282926(0x16e))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x60940d),'manifest':_0x60940d[_0x282926(0x187)],'normalizedManifest':_0x60940d[_0x282926(0x197)]}};}}];
1
+ const a39_0xad46d8=a39_0x16c7;function a39_0x16c7(_0xe96e22,_0xe881e3){_0xe96e22=_0xe96e22-0x1d7;const _0x273264=a39_0x2732();let _0x16c73c=_0x273264[_0xe96e22];return _0x16c73c;}(function(_0x206b1c,_0x136a73){const _0x6787ac=a39_0x16c7,_0x44d54d=_0x206b1c();while(!![]){try{const _0x3478ed=parseInt(_0x6787ac(0x217))/0x1+-parseInt(_0x6787ac(0x203))/0x2*(parseInt(_0x6787ac(0x1dc))/0x3)+parseInt(_0x6787ac(0x208))/0x4+parseInt(_0x6787ac(0x1ef))/0x5*(parseInt(_0x6787ac(0x213))/0x6)+-parseInt(_0x6787ac(0x1e4))/0x7+parseInt(_0x6787ac(0x20a))/0x8+-parseInt(_0x6787ac(0x1db))/0x9*(parseInt(_0x6787ac(0x211))/0xa);if(_0x3478ed===_0x136a73)break;else _0x44d54d['push'](_0x44d54d['shift']());}catch(_0x4a9fc1){_0x44d54d['push'](_0x44d54d['shift']());}}}(a39_0x2732,0xdce6f));function a39_0x2732(){const _0x35d5cb=['remove','\x20service\x20','\x20service(s).','read','filePath','errors','flags','Local\x20service\x20code,\x20for\x20example\x20crm','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','kind','risk','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','map','file','normalizedManifest','17912YuvQje','Imported\x20','warnings','serviceCode','registry','3050944rqyyFG','description','10690840iJkcaR','cliName','imported','str','service','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','target','180batUay','serviceCount','1997658gbEVQK','registryServiceCode','entry','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','1367482PJXsqI','commands','lower\x20kebab-case\x20service\x20code','type','Imported','registryPath','required','source','report','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','write','770841YsCVmd','342JiOonc','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','detail','list','manifests','entries','version','updated','11646649MkgpCb','string','WRITE','Service\x20registry\x20validation\x20passed.','cliPath','importedAt','hash','\x20service(s),\x20updated\x20','replaced','length','Service\x20manifest\x20validation\x20passed.','25vZtuBo','validate','Exported\x20service\x20','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest'];a39_0x2732=function(){return _0x35d5cb;};return a39_0x2732();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0xad46d8(0x201),'type':a39_0xad46d8(0x1e5),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a39_0xad46d8(0x20e),'type':'string','required':!![],'description':a39_0xad46d8(0x1fb),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0xad46d8(0x219)}};function summarizeService(_0x3f6b76){const _0x372784=a39_0xad46d8;return{'serviceCode':_0x3f6b76[_0x372784(0x206)],'name':_0x3f6b76['normalizedManifest'][_0x372784(0x20e)]['name'],'version':_0x3f6b76[_0x372784(0x1e2)],'importedAt':_0x3f6b76[_0x372784(0x1e9)],'source':_0x3f6b76[_0x372784(0x1d7)],'commandCount':_0x3f6b76['normalizedManifest'][_0x372784(0x218)][_0x372784(0x1ed)],'commands':_0x3f6b76[_0x372784(0x202)][_0x372784(0x218)][_0x372784(0x200)](_0x97ff72=>({'path':_0x97ff72[_0x372784(0x1e8)],'description':_0x97ff72[_0x372784(0x209)],'risk':_0x97ff72[_0x372784(0x1fe)],'target':_0x97ff72[_0x372784(0x210)],'flags':_0x97ff72[_0x372784(0x1fa)][_0x372784(0x200)](_0x289a79=>({'name':_0x289a79['name'],'cliName':_0x289a79[_0x372784(0x20b)],'type':_0x289a79[_0x372784(0x21a)],'required':_0x289a79[_0x372784(0x21d)]===!![]}))}))};}function summarizeLoadedManifest(_0x2e8b33){const _0x30d2d2=a39_0xad46d8;return{'service':_0x2e8b33[_0x30d2d2(0x202)]?.['service'],'version':_0x2e8b33[_0x30d2d2(0x202)]?.['version'],'commandCount':_0x2e8b33[_0x30d2d2(0x202)]?.[_0x30d2d2(0x218)][_0x30d2d2(0x1ed)]??0x0,'commands':_0x2e8b33['normalizedManifest']?.['commands'][_0x30d2d2(0x200)](_0x4580c1=>({'path':_0x4580c1[_0x30d2d2(0x1e8)],'risk':_0x4580c1[_0x30d2d2(0x1fe)],'target':_0x4580c1['target']}))??[],'registryIndex':_0x2e8b33['registryIndex'],'registryServiceCode':_0x2e8b33[_0x30d2d2(0x214)],'errors':_0x2e8b33[_0x30d2d2(0x1d8)][_0x30d2d2(0x1f9)],'warnings':_0x2e8b33[_0x30d2d2(0x1d8)][_0x30d2d2(0x205)]};}export const serviceDefinitions=[{'service':a39_0xad46d8(0x20e),'command':a39_0xad46d8(0x1f0),'description':a39_0xad46d8(0x1f3),'risk':a39_0xad46d8(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x510de1){const _0x4131b1=a39_0xad46d8,_0xe573e=loadServiceManifestFromFile(_0x510de1[_0x4131b1(0x20d)](_0x4131b1(0x201)));if(!_0xe573e[_0x4131b1(0x1d8)]['ok'])return{'ok':![],'data':{'file':_0xe573e['filePath'],'hash':_0xe573e['hash'],'kind':_0xe573e[_0x4131b1(0x1fd)],'serviceCount':_0xe573e[_0x4131b1(0x1e0)][_0x4131b1(0x1ed)],'services':_0xe573e[_0x4131b1(0x1e0)][_0x4131b1(0x200)](summarizeLoadedManifest),'errors':_0xe573e[_0x4131b1(0x1d8)][_0x4131b1(0x1f9)],'warnings':_0xe573e['report'][_0x4131b1(0x205)]},'message':formatValidationFailure(_0xe573e[_0x4131b1(0x1d8)])};if(_0xe573e[_0x4131b1(0x1fd)]===_0x4131b1(0x207)||_0xe573e['manifests'][_0x4131b1(0x1ed)]!==0x1)return{'ok':!![],'data':{'file':_0xe573e['filePath'],'hash':_0xe573e[_0x4131b1(0x1ea)],'kind':_0xe573e[_0x4131b1(0x1fd)],'serviceCount':_0xe573e[_0x4131b1(0x1e0)]['length'],'commandCount':_0xe573e[_0x4131b1(0x1e0)]['reduce']((_0x929786,_0x5a5c52)=>_0x929786+(_0x5a5c52['normalizedManifest']?.[_0x4131b1(0x218)][_0x4131b1(0x1ed)]??0x0),0x0),'services':_0xe573e[_0x4131b1(0x1e0)]['map'](summarizeLoadedManifest),'warnings':_0xe573e['report'][_0x4131b1(0x205)]},'message':_0x4131b1(0x1e7)};return{'ok':!![],'data':{'file':_0xe573e[_0x4131b1(0x1f8)],'hash':_0xe573e[_0x4131b1(0x1ea)],'kind':_0xe573e[_0x4131b1(0x1fd)],'service':_0xe573e[_0x4131b1(0x202)]?.[_0x4131b1(0x20e)],'version':_0xe573e[_0x4131b1(0x202)]?.[_0x4131b1(0x1e2)],'commandCount':_0xe573e['normalizedManifest']?.['commands']['length']??0x0,'commands':_0xe573e[_0x4131b1(0x202)]?.['commands'][_0x4131b1(0x200)](_0x24e2fe=>({'path':_0x24e2fe[_0x4131b1(0x1e8)],'risk':_0x24e2fe[_0x4131b1(0x1fe)],'target':_0x24e2fe[_0x4131b1(0x210)]})),'warnings':_0xe573e['report'][_0x4131b1(0x205)]},'message':_0x4131b1(0x1ee)};}},{'service':a39_0xad46d8(0x20e),'command':'import','description':a39_0xad46d8(0x20f),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x1300e4){const _0x361b11=a39_0xad46d8,_0x3f0afb=loadServiceManifestFromFile(_0x1300e4[_0x361b11(0x20d)](_0x361b11(0x201)));return{'method':_0x361b11(0x1e6),'url':getServiceRegistryPath(),'body':{'file':_0x3f0afb[_0x361b11(0x1f8)],'hash':_0x3f0afb[_0x361b11(0x1ea)],'kind':_0x3f0afb['kind'],'ok':_0x3f0afb[_0x361b11(0x1d8)]['ok'],'service':_0x3f0afb[_0x361b11(0x202)]?.[_0x361b11(0x20e)],'version':_0x3f0afb['normalizedManifest']?.[_0x361b11(0x1e2)],'serviceCount':_0x3f0afb[_0x361b11(0x1e0)][_0x361b11(0x1ed)],'services':_0x3f0afb['manifests'][_0x361b11(0x200)](_0x223ff5=>({'service':_0x223ff5[_0x361b11(0x202)]?.[_0x361b11(0x20e)],'version':_0x223ff5['normalizedManifest']?.[_0x361b11(0x1e2)],'commandCount':_0x223ff5[_0x361b11(0x202)]?.[_0x361b11(0x218)][_0x361b11(0x1ed)]??0x0,'errors':_0x223ff5[_0x361b11(0x1d8)][_0x361b11(0x1f9)]})),'errors':_0x3f0afb[_0x361b11(0x1d8)][_0x361b11(0x1f9)],'commandCount':_0x3f0afb[_0x361b11(0x202)]?.[_0x361b11(0x218)]['length']??0x0},'description':_0x361b11(0x216)};},async 'execute'(_0x330fde){const _0x259171=a39_0xad46d8,_0x1ea04f=importServiceManifest(_0x330fde[_0x259171(0x20d)]('file'));if(_0x1ea04f[_0x259171(0x1e1)][_0x259171(0x1ed)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x1ea04f[_0x259171(0x21c)],'imported':_0x1ea04f['imported'],'updated':_0x1ea04f[_0x259171(0x1e3)],'serviceCount':_0x1ea04f[_0x259171(0x212)],'services':_0x1ea04f['entries'][_0x259171(0x200)](summarizeService)},'message':_0x259171(0x204)+_0x1ea04f[_0x259171(0x20c)]+_0x259171(0x1eb)+_0x1ea04f[_0x259171(0x1e3)]+_0x259171(0x1f6)};return{'ok':!![],'data':{'registryPath':_0x1ea04f['registryPath'],'replaced':_0x1ea04f[_0x259171(0x1ec)],'imported':_0x1ea04f['imported'],'updated':_0x1ea04f[_0x259171(0x1e3)],'serviceCount':_0x1ea04f['serviceCount'],'service':summarizeService(_0x1ea04f[_0x259171(0x215)])},'message':(_0x1ea04f[_0x259171(0x1ec)]?'Updated':_0x259171(0x21b))+_0x259171(0x1f5)+_0x1ea04f[_0x259171(0x215)][_0x259171(0x206)]+'.'};}},{'service':a39_0xad46d8(0x20e),'command':'export','description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a39_0xad46d8(0x1da),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x303ed8){const _0x3b43af=a39_0xad46d8,_0x566947=getLocalServiceEntry(_0x303ed8[_0x3b43af(0x20d)](_0x3b43af(0x20e)));return{'method':_0x3b43af(0x1e6),'url':_0x303ed8[_0x3b43af(0x20d)](_0x3b43af(0x201)),'body':{'service':_0x303ed8[_0x3b43af(0x20d)]('service'),'found':Boolean(_0x566947),'version':_0x566947?.[_0x3b43af(0x1e2)],'source':_0x566947?.[_0x3b43af(0x1d7)]},'description':_0x3b43af(0x1dd)};},async 'execute'(_0x49cf52){const _0x3787fa=a39_0xad46d8,_0x3fc48b=exportServiceManifest(_0x49cf52['str']('service'),_0x49cf52[_0x3787fa(0x20d)](_0x3787fa(0x201)));return{'ok':!![],'data':{'registryPath':_0x3fc48b[_0x3787fa(0x21c)],'file':_0x3fc48b[_0x3787fa(0x1f8)],'service':summarizeService(_0x3fc48b[_0x3787fa(0x215)])},'message':_0x3787fa(0x1f1)+_0x3fc48b[_0x3787fa(0x215)][_0x3787fa(0x206)]+'.'};}},{'service':a39_0xad46d8(0x20e),'command':a39_0xad46d8(0x1df),'description':a39_0xad46d8(0x1d9),'risk':a39_0xad46d8(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x2e19fd=a39_0xad46d8,_0x59b05e=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x59b05e[_0x2e19fd(0x1ed)],'services':_0x59b05e[_0x2e19fd(0x200)](summarizeService)}};}},{'service':a39_0xad46d8(0x20e),'command':a39_0xad46d8(0x1f4),'description':a39_0xad46d8(0x1f2),'risk':a39_0xad46d8(0x1da),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x29f6cb){const _0x447a4a=a39_0xad46d8,_0x7b4a63=getLocalServiceEntry(_0x29f6cb[_0x447a4a(0x20d)]('service'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x29f6cb['str'](_0x447a4a(0x20e)),'found':Boolean(_0x7b4a63),'version':_0x7b4a63?.[_0x447a4a(0x1e2)],'source':_0x7b4a63?.[_0x447a4a(0x1d7)]},'description':_0x447a4a(0x1fc)};},async 'execute'(_0x4bf4a9){const _0x3c0abb=a39_0xad46d8,_0x4b3835=removeServiceManifest(_0x4bf4a9[_0x3c0abb(0x20d)](_0x3c0abb(0x20e)));return{'ok':!![],'data':{'registryPath':_0x4b3835[_0x3c0abb(0x21c)],'serviceCount':_0x4b3835[_0x3c0abb(0x212)],'service':summarizeService(_0x4b3835[_0x3c0abb(0x215)])},'message':'Removed\x20service\x20'+_0x4b3835[_0x3c0abb(0x215)][_0x3c0abb(0x206)]+'.'};}},{'service':a39_0xad46d8(0x20e),'command':a39_0xad46d8(0x1de),'description':a39_0xad46d8(0x1ff),'risk':a39_0xad46d8(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x35db8c){const _0x22d311=a39_0xad46d8,_0x2ae042=getLocalServiceEntry(_0x35db8c[_0x22d311(0x20d)](_0x22d311(0x20e)));if(!_0x2ae042)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x35db8c[_0x22d311(0x20d)](_0x22d311(0x20e))},'message':'Local\x20service\x20not\x20found:\x20'+_0x35db8c[_0x22d311(0x20d)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2ae042),'manifest':_0x2ae042['manifest'],'normalizedManifest':_0x2ae042[_0x22d311(0x202)]}};}}];