@lovrabet/lovrabet-cli 2.1.11 → 2.1.12-beta.1

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 (119) 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/rate-limit.js +1 -1
  87. package/lib/framework/response.js +1 -1
  88. package/lib/framework/runner-confirmation.js +1 -1
  89. package/lib/framework/runner-error.js +1 -1
  90. package/lib/framework/runner.js +1 -1
  91. package/lib/framework/schema-export.js +1 -1
  92. package/lib/framework/service-order.js +1 -1
  93. package/lib/framework/types.js +1 -1
  94. package/lib/generated/build-info.js +1 -1
  95. package/lib/help.js +1 -1
  96. package/lib/skills/npx-skills-add.js +1 -1
  97. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  98. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  99. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  100. package/lib/skills/runtime-skill-sync/links.js +1 -1
  101. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  102. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  103. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  104. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  105. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  106. package/lib/skills/runtime-skill-sync/push.js +1 -1
  107. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  108. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  109. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  110. package/lib/skills/runtime-skill-sync.js +1 -1
  111. package/lib/utils/apply-jq-filter.js +1 -1
  112. package/lib/utils/logger.js +1 -1
  113. package/lib/utils/lossless-json.js +1 -1
  114. package/lib/utils/params.js +1 -1
  115. package/lib/utils/platform.js +1 -1
  116. package/lib/utils/update-notice.js +1 -1
  117. package/lib/utils/version.js +1 -1
  118. package/lib/utils/write-cli-side-channel.js +1 -1
  119. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x83b06f=a30_0x3810;(function(_0x1caf4b,_0x4793c3){const _0x55f756=a30_0x3810,_0x4e57ab=_0x1caf4b();while(!![]){try{const _0x4550a5=-parseInt(_0x55f756(0x6c))/0x1+parseInt(_0x55f756(0x89))/0x2+parseInt(_0x55f756(0x72))/0x3*(-parseInt(_0x55f756(0x88))/0x4)+parseInt(_0x55f756(0x7a))/0x5+-parseInt(_0x55f756(0x7e))/0x6*(-parseInt(_0x55f756(0x7f))/0x7)+parseInt(_0x55f756(0x78))/0x8+-parseInt(_0x55f756(0x7c))/0x9;if(_0x4550a5===_0x4793c3)break;else _0x4e57ab['push'](_0x4e57ab['shift']());}catch(_0x5e8fa0){_0x4e57ab['push'](_0x4e57ab['shift']());}}}(a30_0x3fe9,0x294f9));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';function a30_0x3810(_0x130286,_0x6dd189){_0x130286=_0x130286-0x6b;const _0x3fe9cf=a30_0x3fe9();let _0x38107e=_0x3fe9cf[_0x130286];return _0x38107e;}function a30_0x3fe9(){const _0x26d711=['Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','appCode','filePath','Uploaded\x20file:\x20','file','validation','POST','229968BFdItt','403028BNjKaQ','string','download','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','225849zGWEGo','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','Path\x20to\x20the\x20local\x20file\x20to\x20upload','File','\x20to\x20runtime\x20app\x20','path','9MulUPp','str','bool','long-term','read','description','899864bYUTFO','write','1149035WmNxfJ','Preview:\x20upload\x20','1575855TBhznA','boolean','30PMBSLO','278355IYxvbX','filepath'];a30_0x3fe9=function(){return _0x26d711;};return a30_0x3fe9();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x83b06f(0x85),'type':a30_0x83b06f(0x8a),'required':!![],'description':a30_0x83b06f(0x6e)},FILEPATH_FLAG={'name':a30_0x83b06f(0x80),'type':a30_0x83b06f(0x8a),'required':!![],'description':a30_0x83b06f(0x81)},DOWNLOAD_FLAG={'name':'download','type':a30_0x83b06f(0x7d),'description':'Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL'},LONG_TERM_FLAG={'name':a30_0x83b06f(0x75),'type':a30_0x83b06f(0x7d),'description':a30_0x83b06f(0x8c)};function requireFilePath(_0xbfb8f3){const _0x29a6cd=a30_0x83b06f,_0x85e6a4=_0xbfb8f3['trim']();if(!_0x85e6a4)throw CliErrors[_0x29a6cd(0x86)]('filePath\x20is\x20required.');return _0x85e6a4;}const fileUpload={'service':a30_0x83b06f(0x85),'command':'upload','description':'Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','risk':a30_0x83b06f(0x79),'flags':[FILE_FLAG],async 'dryRun'(_0x523b76){const _0xf8dd0=a30_0x83b06f,_0x25e97b=requireRuntimeUploadFile(_0x523b76[_0xf8dd0(0x73)](_0xf8dd0(0x85)),'File');return dryRun(_0xf8dd0(0x87),'/client/uploadFile')['body']({'appCode':_0x523b76['appCode'],'multipart':{'file':_0x25e97b}})[_0xf8dd0(0x77)](_0xf8dd0(0x7b)+_0x25e97b['path']+_0xf8dd0(0x70)+_0x523b76[_0xf8dd0(0x82)])['build']();},async 'execute'(_0x452e38){const _0x40754e=a30_0x83b06f,_0x244cbf=requireRuntimeUploadFile(_0x452e38[_0x40754e(0x73)](_0x40754e(0x85)),_0x40754e(0x6f)),_0x50b047=await uploadRuntimeFile(_0x452e38[_0x40754e(0x82)],_0x244cbf[_0x40754e(0x71)]);return{'ok':!![],'data':_0x50b047,'message':_0x50b047[_0x40754e(0x83)]?_0x40754e(0x84)+_0x50b047[_0x40754e(0x83)]+_0x40754e(0x6d):_0x40754e(0x6b)};}},fileQueryUrl={'service':'file','command':'query-url','description':'Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','risk':a30_0x83b06f(0x76),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x1d2c5f){const _0x2d33b7=a30_0x83b06f,_0x4cafdd=requireFilePath(_0x1d2c5f['str'](_0x2d33b7(0x80))),_0xf92593=await queryRuntimeFileUrl(_0x4cafdd,{'download':_0x1d2c5f[_0x2d33b7(0x74)](_0x2d33b7(0x8b)),'longTerm':_0x1d2c5f[_0x2d33b7(0x74)](_0x2d33b7(0x75))});return{'ok':!![],'data':_0xf92593};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
1
+ const a30_0x25081c=a30_0x2891;(function(_0x3762fc,_0x140c15){const _0x1c4c60=a30_0x2891,_0x391cd0=_0x3762fc();while(!![]){try{const _0x206f67=parseInt(_0x1c4c60(0x10d))/0x1*(-parseInt(_0x1c4c60(0xf7))/0x2)+-parseInt(_0x1c4c60(0xef))/0x3*(-parseInt(_0x1c4c60(0xff))/0x4)+parseInt(_0x1c4c60(0xea))/0x5+-parseInt(_0x1c4c60(0xfd))/0x6+parseInt(_0x1c4c60(0x100))/0x7*(parseInt(_0x1c4c60(0xf1))/0x8)+parseInt(_0x1c4c60(0xf2))/0x9*(parseInt(_0x1c4c60(0x102))/0xa)+-parseInt(_0x1c4c60(0xed))/0xb;if(_0x206f67===_0x140c15)break;else _0x391cd0['push'](_0x391cd0['shift']());}catch(_0x200578){_0x391cd0['push'](_0x391cd0['shift']());}}}(a30_0x5477,0x65cda));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';function a30_0x2891(_0x1a1260,_0x284e52){_0x1a1260=_0x1a1260-0xe8;const _0x547759=a30_0x5477();let _0x28910c=_0x547759[_0x1a1260];return _0x28910c;}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x25081c(0xeb),'type':a30_0x25081c(0xfc),'required':!![],'description':a30_0x25081c(0xfa)},FILEPATH_FLAG={'name':a30_0x25081c(0x101),'type':a30_0x25081c(0xfc),'required':!![],'description':a30_0x25081c(0xf8)},DOWNLOAD_FLAG={'name':'download','type':'boolean','description':a30_0x25081c(0x105)},LONG_TERM_FLAG={'name':a30_0x25081c(0x107),'type':'boolean','description':a30_0x25081c(0xf6)};function requireFilePath(_0x3004cb){const _0xe00205=a30_0x25081c,_0x5852d4=_0x3004cb['trim']();if(!_0x5852d4)throw CliErrors[_0xe00205(0x10a)](_0xe00205(0x10c));return _0x5852d4;}function a30_0x5477(){const _0x1eec3f=['3170453kFtTyL','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','15927sDQeIw','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','8tddWmp','6191082qPjTKt','bool','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','\x20to\x20runtime\x20app\x20','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','2aeWHwp','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','build','Path\x20to\x20the\x20local\x20file\x20to\x20upload','str','string','4559706dmtitz','path','284crQwPI','5131903MzAYEh','filepath','10dvVTVk','POST','filePath','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','download','long-term','read','Uploaded\x20file:\x20','validation','appCode','filePath\x20is\x20required.','603249wMnfCt','/client/uploadFile','upload','1352215Viwzaf','file','File'];a30_0x5477=function(){return _0x1eec3f;};return a30_0x5477();}const fileUpload={'service':'file','command':a30_0x25081c(0xe9),'description':'Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','risk':'write','flags':[FILE_FLAG],async 'dryRun'(_0x1beef0){const _0x18a1c4=a30_0x25081c,_0x5cf2c2=requireRuntimeUploadFile(_0x1beef0[_0x18a1c4(0xfb)]('file'),_0x18a1c4(0xec));return dryRun(_0x18a1c4(0x103),_0x18a1c4(0xe8))['body']({'appCode':_0x1beef0[_0x18a1c4(0x10b)],'multipart':{'file':_0x5cf2c2}})['description']('Preview:\x20upload\x20'+_0x5cf2c2['path']+_0x18a1c4(0xf5)+_0x1beef0[_0x18a1c4(0x10b)])[_0x18a1c4(0xf9)]();},async 'execute'(_0x4e5324){const _0x4ddc1a=a30_0x25081c,_0x2bd804=requireRuntimeUploadFile(_0x4e5324['str']('file'),'File'),_0x535f29=await uploadRuntimeFile(_0x4e5324[_0x4ddc1a(0x10b)],_0x2bd804[_0x4ddc1a(0xfe)]);return{'ok':!![],'data':_0x535f29,'message':_0x535f29[_0x4ddc1a(0x104)]?_0x4ddc1a(0x109)+_0x535f29[_0x4ddc1a(0x104)]+_0x4ddc1a(0xee):_0x4ddc1a(0xf0)};}},fileQueryUrl={'service':a30_0x25081c(0xeb),'command':'query-url','description':a30_0x25081c(0xf4),'risk':a30_0x25081c(0x108),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x4e2787){const _0x195d11=a30_0x25081c,_0x3673b4=requireFilePath(_0x4e2787['str'](_0x195d11(0x101))),_0x3c3d9f=await queryRuntimeFileUrl(_0x3673b4,{'download':_0x4e2787[_0x195d11(0xf3)](_0x195d11(0x106)),'longTerm':_0x4e2787[_0x195d11(0xf3)](_0x195d11(0x107))});return{'ok':!![],'data':_0x3c3d9f};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
1
- const a31_0x1f0da8=a31_0xb451;(function(_0x1c0705,_0x577d5c){const _0xbd8632=a31_0xb451,_0x1541ef=_0x1c0705();while(!![]){try{const _0x54a1ce=-parseInt(_0xbd8632(0x1f7))/0x1*(parseInt(_0xbd8632(0x1fc))/0x2)+parseInt(_0xbd8632(0x1ec))/0x3+parseInt(_0xbd8632(0x200))/0x4+parseInt(_0xbd8632(0x1f4))/0x5+-parseInt(_0xbd8632(0x20f))/0x6+parseInt(_0xbd8632(0x226))/0x7*(-parseInt(_0xbd8632(0x217))/0x8)+-parseInt(_0xbd8632(0x215))/0x9*(-parseInt(_0xbd8632(0x202))/0xa);if(_0x54a1ce===_0x577d5c)break;else _0x1541ef['push'](_0x1541ef['shift']());}catch(_0x3e71fd){_0x1541ef['push'](_0x1541ef['shift']());}}}(a31_0x1877,0x56565));function a31_0x1877(){const _0x515030=['2920UJYSzG','global','File\x20','newConfigFileName','appcode','\x20\x20config:\x20\x20','Override\x20imported\x20default\x20appcode','parse','[Y/n]','utf8','Aborted.','app','\x20\x20default:\x20','1420404tTbDqw','close','Write\x20to\x20global\x20(~/','Target\x20environment\x20(default\x20','cwd','\x22.\x20Allowed:\x20','18144HEVlnH','string','191304Bkunce','name','trim','env','Imported\x20from\x20','Skip\x20confirmation\x20when\x20overwriting','once','stdin','\x0aInitialized\x20','AbortPrompt','Failed\x20to\x20parse\x20source\x20file:\x20','riskLevel','yes','Invalid\x20env\x20\x22','validation','154JvzKDi','cancelled','race','entries','apiDir','question','[y/N]','Usage:\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','defaultApp','removeListener','881397GeYYwa','SIGINT','stdout','App\x20code\x20for\x20the\x20project','\x20\x20appcode:\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Source\x20file\x20not\x20found:\x20','message','418015dHHEjh','join','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','913HwkPIO','boolean','object','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','Initialized\x20','1174YMnLcl','log','App\x20code','apps','2745256FFAhYh','file'];a31_0x1877=function(){return _0x515030;};return a31_0x1877();}import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';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';function a31_0xb451(_0x528b16,_0x38ba61){_0x528b16=_0x528b16-0x1e7;const _0x1877af=a31_0x1877();let _0xb45191=_0x1877af[_0x528b16];return _0xb45191;}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_0x1f0da8(0x206),'type':a31_0x1f0da8(0x216),'description':a31_0x1f0da8(0x1ef)},{'name':'env','type':a31_0x1f0da8(0x216),'description':a31_0x1f0da8(0x212)+DEFAULT_CONFIG_VALUES[a31_0x1f0da8(0x21a)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x1f0da8(0x1f8),'description':a31_0x1f0da8(0x211)+PRODUCT_CONFIG[a31_0x1f0da8(0x205)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a31_0x1f0da8(0x1f8),'description':a31_0x1f0da8(0x21c),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x1f0da8(0x201),'type':a31_0x1f0da8(0x216),'description':a31_0x1f0da8(0x1e9),'required':!![]},{'name':a31_0x1f0da8(0x206),'type':'string','description':a31_0x1f0da8(0x208)},{'name':'env','type':a31_0x1f0da8(0x216),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1f0da8(0x203),'type':a31_0x1f0da8(0x1f8),'description':a31_0x1f0da8(0x211)+PRODUCT_CONFIG[a31_0x1f0da8(0x205)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x1f0da8(0x223),'type':'boolean','description':a31_0x1f0da8(0x21c),'default':![]}];export async function runInit(_0x18276d){const _0x3b9bcb=a31_0x1f0da8,_0x3e6c7a=isNonInteractiveMode(_0x18276d),_0x41e637=_0x18276d[_0x3b9bcb(0x203)]?_0x3b9bcb(0x203):'project',_0x403416=resolveWriteConfigPath(_0x41e637);try{_0x3e6c7a?await runNonInteractive(_0x18276d,_0x403416):await runInteractive(_0x18276d,_0x403416);}catch(_0x3b3ca9){if(_0x3b3ca9 instanceof AbortPrompt)throw CliErrors[_0x3b9bcb(0x227)]();throw _0x3b3ca9;}}export async function runInitImport(_0xc5e608){const _0x5f9db6=a31_0x1f0da8,_0x2cd037=_0xc5e608[_0x5f9db6(0x203)]?_0x5f9db6(0x203):'project',_0x5498db=resolveWriteConfigPath(_0x2cd037);await runFromImport(_0xc5e608,_0x5498db);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x1f0da8(0x22a)]);async function runFromImport(_0x445937,_0x482d5e){const _0x1122df=a31_0x1f0da8,_0x5dd35a=resolveFilePath(_0x445937[_0x1122df(0x201)]);if(!existsSync(_0x5dd35a))throw CliErrors[_0x1122df(0x225)](_0x1122df(0x1f2)+_0x5dd35a);const _0x25492f=readSourceFile(_0x5dd35a),_0x2863ed=convertToRuntimeConfig(_0x25492f);_0x445937[_0x1122df(0x206)]&&(_0x2863ed[_0x1122df(0x206)]=String(_0x445937['appcode']));_0x445937[_0x1122df(0x21a)]&&(_0x2863ed[_0x1122df(0x21a)]=resolveInitEnv(_0x445937));if(!_0x2863ed[_0x1122df(0x206)])throw CliErrors[_0x1122df(0x225)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','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`.');await writeInitConfig(_0x482d5e,_0x2863ed,_0x445937),console['log'](_0x1122df(0x21b)+_0x5dd35a),console[_0x1122df(0x1fd)](_0x1122df(0x207)+_0x482d5e),console[_0x1122df(0x1fd)](_0x1122df(0x1f0)+_0x2863ed['appcode']);if(_0x2863ed[_0x1122df(0x1ea)])console[_0x1122df(0x1fd)](_0x1122df(0x20e)+_0x2863ed[_0x1122df(0x1ea)]);}function convertToRuntimeConfig(_0x50203f){const _0x43c06b=a31_0x1f0da8;if(_0x50203f['apps']&&typeof _0x50203f[_0x43c06b(0x1ff)]===_0x43c06b(0x1f9))throw CliErrors[_0x43c06b(0x225)](_0x43c06b(0x1f1),_0x43c06b(0x1fa));const _0x1ed044={};for(const _0x89179e of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x50203f[_0x89179e]!==undefined&&(_0x1ed044[_0x89179e]=_0x50203f[_0x89179e]);}return!_0x1ed044[_0x43c06b(0x222)]&&(_0x1ed044[_0x43c06b(0x222)]=DEFAULT_CONFIG_VALUES[_0x43c06b(0x222)]),_0x1ed044;}async function runNonInteractive(_0x19123c,_0x21d5ea){const _0x5105ce=a31_0x1f0da8,_0x340bf2=_0x19123c[_0x5105ce(0x206)];if(!_0x340bf2)throw CliErrors['flagMissing'](_0x5105ce(0x206),_0x5105ce(0x1e8)+CLI_BIN_NAME+_0x5105ce(0x1f6));const _0x3b157b=resolveInitEnv(_0x19123c);await writeInitConfig(_0x21d5ea,{'appcode':_0x340bf2,'env':_0x3b157b},_0x19123c),console['log'](_0x5105ce(0x1fb)+_0x21d5ea),console[_0x5105ce(0x1fd)](_0x5105ce(0x1f0)+_0x340bf2),console[_0x5105ce(0x1fd)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x3b157b);}async function runInteractive(_0x1e74c8,_0x1c3bd4){const _0x2269fc=a31_0x1f0da8,_0xbfa3bd=loadExisting(_0x1c3bd4),_0x42c419=typeof _0xbfa3bd?.[_0x2269fc(0x206)]===_0x2269fc(0x216)?_0xbfa3bd['appcode']:'',_0x35d8f6=resolveInitEnv(_0x1e74c8);console['log'](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x2269fc(0x205)]+'\x0a');if(existsSync(_0x1c3bd4)&&!_0x1e74c8[_0x2269fc(0x223)]){const _0x2e505e=await promptYesNo(_0x2269fc(0x204)+_0x1c3bd4+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x2e505e){console[_0x2269fc(0x1fd)](_0x2269fc(0x20c));return;}}const _0x39d18e=typeof _0x1e74c8[_0x2269fc(0x206)]===_0x2269fc(0x216)?_0x1e74c8[_0x2269fc(0x206)][_0x2269fc(0x219)]():'';let _0x2759b6=_0x39d18e;!_0x2759b6&&(_0x2759b6=await promptInput(_0x2269fc(0x1fe),_0x42c419));if(!_0x2759b6[_0x2269fc(0x219)]())throw CliErrors[_0x2269fc(0x225)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x1c3bd4,{'appcode':_0x2759b6['trim'](),'env':_0x35d8f6},_0x1e74c8),console[_0x2269fc(0x1fd)](_0x2269fc(0x21f)+_0x1c3bd4),console[_0x2269fc(0x1fd)](_0x2269fc(0x1f0)+_0x2759b6[_0x2269fc(0x219)]()),console[_0x2269fc(0x1fd)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x35d8f6);}async function writeInitConfig(_0x188527,_0x41812e,_0x1181d6){const _0x19a6ea=a31_0x1f0da8;let _0x8e410c={};existsSync(_0x188527)&&!_0x1181d6[_0x19a6ea(0x223)]&&(_0x8e410c=readConfigFile(_0x188527));for(const [_0x80144b,_0x14f155]of Object[_0x19a6ea(0x229)](_0x41812e)){_0x14f155!==undefined&&(_0x8e410c[_0x80144b]=_0x14f155);}if(_0x8e410c[_0x19a6ea(0x20d)])delete _0x8e410c[_0x19a6ea(0x20d)];writeConfigFile(_0x188527,_0x8e410c);}class AbortPrompt extends Error{constructor(){const _0x1aa070=a31_0x1f0da8;super('User\x20aborted\x20prompt'),this[_0x1aa070(0x218)]=_0x1aa070(0x220);}}function createSafeRl(){const _0x5e2a19=a31_0x1f0da8,_0x5caf86=createInterface({'input':process[_0x5e2a19(0x21e)],'output':process[_0x5e2a19(0x1ee)]});let _0x4e7c3a;const _0x11cdd7=new Promise((_0xd49eb5,_0x32d952)=>{const _0x3d57df=_0x5e2a19;_0x4e7c3a=()=>{const _0x1bfe16=a31_0xb451;_0x4e7c3a&&(_0x5caf86[_0x1bfe16(0x1eb)](_0x1bfe16(0x1ed),_0x4e7c3a),_0x4e7c3a=undefined);try{_0x5caf86[_0x1bfe16(0x210)]();}catch{}_0x32d952(new AbortPrompt());},_0x5caf86[_0x3d57df(0x21d)](_0x3d57df(0x1ed),_0x4e7c3a);}),_0x388cd6=()=>{const _0x211c9e=_0x5e2a19;_0x4e7c3a&&(_0x5caf86['removeListener'](_0x211c9e(0x1ed),_0x4e7c3a),_0x4e7c3a=undefined);try{_0x5caf86['close']();}catch{}};return{'rl':_0x5caf86,'abortPromise':_0x11cdd7,'disposeSuccess':_0x388cd6};}async function promptInput(_0x5cbb45,_0x6042a7){const {rl:_0x521657,abortPromise:_0x24f8c2,disposeSuccess:_0x107d3d}=createSafeRl(),_0x20606e=new Promise(_0x52fee1=>{const _0x40a454=a31_0xb451,_0x3bdacd=_0x6042a7?'\x20\x20'+_0x5cbb45+'\x20('+_0x6042a7+'):\x20':'\x20\x20'+_0x5cbb45+':\x20';_0x521657[_0x40a454(0x22b)](_0x3bdacd,_0x48d3e4=>{const _0x18dbe6=_0x40a454;_0x107d3d(),_0x52fee1(_0x48d3e4[_0x18dbe6(0x219)]()||_0x6042a7);});});return Promise['race']([_0x20606e,_0x24f8c2]);}async function promptYesNo(_0x59ccb5,_0x731dad){const _0x2c395d=a31_0x1f0da8,{rl:_0x23dab0,abortPromise:_0x465183,disposeSuccess:_0xf581f4}=createSafeRl(),_0x20d944=new Promise(_0x3147db=>{const _0x27cf1e=a31_0xb451,_0x2fdf45=_0x731dad?_0x27cf1e(0x20a):_0x27cf1e(0x1e7);_0x23dab0[_0x27cf1e(0x22b)]('\x20\x20'+_0x59ccb5+'\x20'+_0x2fdf45+':\x20',_0x28d0bb=>{const _0x392966=_0x27cf1e;_0xf581f4();const _0x4419d4=_0x28d0bb[_0x392966(0x219)]()['toLowerCase']();if(_0x4419d4==='y'||_0x4419d4===_0x392966(0x223))_0x3147db(!![]);else{if(_0x4419d4==='n'||_0x4419d4==='no')_0x3147db(![]);else _0x3147db(_0x731dad);}});});return Promise[_0x2c395d(0x228)]([_0x20d944,_0x465183]);}function loadExisting(_0x4be514){if(!existsSync(_0x4be514))return null;return readConfigFile(_0x4be514);}function resolveFilePath(_0x4534fa){const _0x118312=a31_0x1f0da8;return isAbsolute(_0x4534fa)?_0x4534fa:resolve(process[_0x118312(0x213)](),_0x4534fa);}function readSourceFile(_0x35110b){const _0x440a8f=a31_0x1f0da8;try{const _0xa2084e=readFileSync(_0x35110b,{'encoding':_0x440a8f(0x20b)});return JSON[_0x440a8f(0x209)](_0xa2084e);}catch(_0x1c0707){throw CliErrors[_0x440a8f(0x225)](_0x440a8f(0x221)+_0x1c0707[_0x440a8f(0x1f3)]);}}function resolveInitEnv(_0x3c7e84){const _0x17d130=a31_0x1f0da8,_0x5e4a06=_0x3c7e84[_0x17d130(0x21a)];if(_0x5e4a06===undefined||_0x5e4a06==='')return DEFAULT_CONFIG_VALUES[_0x17d130(0x21a)];if(!RUNTIME_ENV_VALUES['includes'](_0x5e4a06))throw CliErrors[_0x17d130(0x225)](_0x17d130(0x224)+_0x5e4a06+_0x17d130(0x214)+RUNTIME_ENV_VALUES[_0x17d130(0x1f5)](',\x20'));return _0x5e4a06;}
1
+ const a31_0x29c04a=a31_0x1d03;(function(_0x3b3007,_0x1a9e05){const _0x190299=a31_0x1d03,_0x14f725=_0x3b3007();while(!![]){try{const _0x29785a=parseInt(_0x190299(0x18e))/0x1*(parseInt(_0x190299(0x15b))/0x2)+parseInt(_0x190299(0x18a))/0x3*(-parseInt(_0x190299(0x17d))/0x4)+parseInt(_0x190299(0x187))/0x5*(parseInt(_0x190299(0x16d))/0x6)+parseInt(_0x190299(0x154))/0x7+-parseInt(_0x190299(0x153))/0x8+parseInt(_0x190299(0x16e))/0x9+-parseInt(_0x190299(0x15d))/0xa*(parseInt(_0x190299(0x16a))/0xb);if(_0x29785a===_0x1a9e05)break;else _0x14f725['push'](_0x14f725['shift']());}catch(_0x9364f3){_0x14f725['push'](_0x14f725['shift']());}}}(a31_0x1733,0x2f024));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';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_0x29c04a(0x171),'type':a31_0x29c04a(0x14e),'description':a31_0x29c04a(0x165)},{'name':a31_0x29c04a(0x17f),'type':a31_0x29c04a(0x14e),'description':a31_0x29c04a(0x14f)+DEFAULT_CONFIG_VALUES[a31_0x29c04a(0x17f)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x29c04a(0x18c),'type':a31_0x29c04a(0x161),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x29c04a(0x166)]+a31_0x29c04a(0x17b),'default':![]},{'name':a31_0x29c04a(0x188),'type':a31_0x29c04a(0x161),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a31_0x29c04a(0x14e),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x29c04a(0x171),'type':a31_0x29c04a(0x14e),'description':a31_0x29c04a(0x162)},{'name':a31_0x29c04a(0x17f),'type':a31_0x29c04a(0x14e),'description':a31_0x29c04a(0x14a),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x29c04a(0x18c),'type':'boolean','description':a31_0x29c04a(0x18d)+PRODUCT_CONFIG[a31_0x29c04a(0x166)]+a31_0x29c04a(0x17b),'default':![]},{'name':a31_0x29c04a(0x188),'type':a31_0x29c04a(0x161),'description':a31_0x29c04a(0x155),'default':![]}];export async function runInit(_0x5c588e){const _0x177fab=a31_0x29c04a,_0x46c992=isNonInteractiveMode(_0x5c588e),_0x3ba46a=_0x5c588e[_0x177fab(0x18c)]?_0x177fab(0x18c):_0x177fab(0x163),_0x3c999d=resolveWriteConfigPath(_0x3ba46a);try{_0x46c992?await runNonInteractive(_0x5c588e,_0x3c999d):await runInteractive(_0x5c588e,_0x3c999d);}catch(_0x421932){if(_0x421932 instanceof AbortPrompt)throw CliErrors[_0x177fab(0x152)]();throw _0x421932;}}export async function runInitImport(_0xa5b9cd){const _0x1f9dae=a31_0x29c04a,_0x99deed=_0xa5b9cd[_0x1f9dae(0x18c)]?_0x1f9dae(0x18c):_0x1f9dae(0x163),_0x56494f=resolveWriteConfigPath(_0x99deed);await runFromImport(_0xa5b9cd,_0x56494f);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x29c04a(0x15f)]);async function runFromImport(_0x26c6e3,_0x58acc2){const _0xd4ee2c=a31_0x29c04a,_0x49207f=resolveFilePath(_0x26c6e3[_0xd4ee2c(0x164)]);if(!existsSync(_0x49207f))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x49207f);const _0xef7e75=readSourceFile(_0x49207f),_0x3c3cee=convertToRuntimeConfig(_0xef7e75);_0x26c6e3[_0xd4ee2c(0x171)]&&(_0x3c3cee[_0xd4ee2c(0x171)]=String(_0x26c6e3[_0xd4ee2c(0x171)]));_0x26c6e3['env']&&(_0x3c3cee[_0xd4ee2c(0x17f)]=resolveInitEnv(_0x26c6e3));if(!_0x3c3cee[_0xd4ee2c(0x171)])throw CliErrors[_0xd4ee2c(0x175)](_0xd4ee2c(0x189),_0xd4ee2c(0x179));await writeInitConfig(_0x58acc2,_0x3c3cee,_0x26c6e3),console['log'](_0xd4ee2c(0x16b)+_0x49207f),console[_0xd4ee2c(0x170)](_0xd4ee2c(0x178)+_0x58acc2),console[_0xd4ee2c(0x170)](_0xd4ee2c(0x180)+_0x3c3cee[_0xd4ee2c(0x171)]);if(_0x3c3cee[_0xd4ee2c(0x17e)])console[_0xd4ee2c(0x170)](_0xd4ee2c(0x176)+_0x3c3cee[_0xd4ee2c(0x17e)]);}function convertToRuntimeConfig(_0x4df318){const _0x316029=a31_0x29c04a;if(_0x4df318[_0x316029(0x15e)]&&typeof _0x4df318['apps']==='object')throw CliErrors[_0x316029(0x175)](_0x316029(0x151),_0x316029(0x168));const _0x5ef939={};for(const _0x2ffa41 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x4df318[_0x2ffa41]!==undefined&&(_0x5ef939[_0x2ffa41]=_0x4df318[_0x2ffa41]);}return!_0x5ef939[_0x316029(0x15c)]&&(_0x5ef939[_0x316029(0x15c)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x5ef939;}async function runNonInteractive(_0x1014be,_0x5c93a){const _0x21d188=a31_0x29c04a,_0x313b73=_0x1014be['appcode'];if(!_0x313b73)throw CliErrors[_0x21d188(0x172)](_0x21d188(0x171),'Usage:\x20'+CLI_BIN_NAME+_0x21d188(0x17c));const _0x31a276=resolveInitEnv(_0x1014be);await writeInitConfig(_0x5c93a,{'appcode':_0x313b73,'env':_0x31a276},_0x1014be),console[_0x21d188(0x170)](_0x21d188(0x16f)+_0x5c93a),console[_0x21d188(0x170)]('\x20\x20appcode:\x20'+_0x313b73),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x31a276);}async function runInteractive(_0x2a162f,_0x62a151){const _0x101c78=a31_0x29c04a,_0x2558ad=loadExisting(_0x62a151),_0x4aceab=typeof _0x2558ad?.['appcode']===_0x101c78(0x14e)?_0x2558ad[_0x101c78(0x171)]:'',_0x7944f1=resolveInitEnv(_0x2a162f);console['log'](CLI_BIN_NAME+_0x101c78(0x183)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x62a151)&&!_0x2a162f['yes']){const _0x29355d=await promptYesNo('File\x20'+_0x62a151+_0x101c78(0x18b),![]);if(!_0x29355d){console['log'](_0x101c78(0x184));return;}}const _0x32215b=typeof _0x2a162f['appcode']===_0x101c78(0x14e)?_0x2a162f[_0x101c78(0x171)][_0x101c78(0x16c)]():'';let _0x5ad1b5=_0x32215b;!_0x5ad1b5&&(_0x5ad1b5=await promptInput(_0x101c78(0x157),_0x4aceab));if(!_0x5ad1b5[_0x101c78(0x16c)]())throw CliErrors[_0x101c78(0x175)](_0x101c78(0x160));await writeInitConfig(_0x62a151,{'appcode':_0x5ad1b5[_0x101c78(0x16c)](),'env':_0x7944f1},_0x2a162f),console['log'](_0x101c78(0x173)+_0x62a151),console[_0x101c78(0x170)](_0x101c78(0x180)+_0x5ad1b5[_0x101c78(0x16c)]()),console['log'](_0x101c78(0x150)+_0x7944f1);}async function writeInitConfig(_0x551131,_0x1e17fa,_0x2e632d){const _0x3dc4ba=a31_0x29c04a;let _0x541d23={};existsSync(_0x551131)&&!_0x2e632d['yes']&&(_0x541d23=readConfigFile(_0x551131));for(const [_0x4d95f9,_0x542193]of Object[_0x3dc4ba(0x185)](_0x1e17fa)){_0x542193!==undefined&&(_0x541d23[_0x4d95f9]=_0x542193);}if(_0x541d23[_0x3dc4ba(0x167)])delete _0x541d23[_0x3dc4ba(0x167)];writeConfigFile(_0x551131,_0x541d23);}class AbortPrompt extends Error{constructor(){const _0x14ea61=a31_0x29c04a;super('User\x20aborted\x20prompt'),this['name']=_0x14ea61(0x17a);}}function createSafeRl(){const _0x2cce52=a31_0x29c04a,_0x362e06=createInterface({'input':process[_0x2cce52(0x174)],'output':process[_0x2cce52(0x15a)]});let _0x570bf3;const _0x5f0c11=new Promise((_0x5832f4,_0x162c02)=>{const _0x505e79=_0x2cce52;_0x570bf3=()=>{const _0x217a24=a31_0x1d03;_0x570bf3&&(_0x362e06['removeListener'](_0x217a24(0x149),_0x570bf3),_0x570bf3=undefined);try{_0x362e06[_0x217a24(0x14b)]();}catch{}_0x162c02(new AbortPrompt());},_0x362e06[_0x505e79(0x190)](_0x505e79(0x149),_0x570bf3);}),_0x39a62d=()=>{const _0x46e8c8=_0x2cce52;_0x570bf3&&(_0x362e06[_0x46e8c8(0x186)](_0x46e8c8(0x149),_0x570bf3),_0x570bf3=undefined);try{_0x362e06[_0x46e8c8(0x14b)]();}catch{}};return{'rl':_0x362e06,'abortPromise':_0x5f0c11,'disposeSuccess':_0x39a62d};}async function promptInput(_0x27f37b,_0x1467f2){const _0x9d1821=a31_0x29c04a,{rl:_0x23edf9,abortPromise:_0x3cc2d1,disposeSuccess:_0x5f2ab8}=createSafeRl(),_0x2e1e19=new Promise(_0x16c3db=>{const _0xbcd5a4=a31_0x1d03,_0x3efc46=_0x1467f2?'\x20\x20'+_0x27f37b+'\x20('+_0x1467f2+_0xbcd5a4(0x148):'\x20\x20'+_0x27f37b+':\x20';_0x23edf9[_0xbcd5a4(0x14d)](_0x3efc46,_0x4feebc=>{const _0x6f0a96=_0xbcd5a4;_0x5f2ab8(),_0x16c3db(_0x4feebc[_0x6f0a96(0x16c)]()||_0x1467f2);});});return Promise[_0x9d1821(0x18f)]([_0x2e1e19,_0x3cc2d1]);}async function promptYesNo(_0x51d85,_0xcc9ad4){const _0x498325=a31_0x29c04a,{rl:_0x40aab9,abortPromise:_0x40eeb6,disposeSuccess:_0x35a810}=createSafeRl(),_0x3b8850=new Promise(_0x4c85d1=>{const _0x135637=a31_0x1d03,_0x4f8095=_0xcc9ad4?'[Y/n]':_0x135637(0x156);_0x40aab9[_0x135637(0x14d)]('\x20\x20'+_0x51d85+'\x20'+_0x4f8095+':\x20',_0x535942=>{const _0x56d4bc=_0x135637;_0x35a810();const _0x314b4c=_0x535942[_0x56d4bc(0x16c)]()[_0x56d4bc(0x169)]();if(_0x314b4c==='y'||_0x314b4c===_0x56d4bc(0x188))_0x4c85d1(!![]);else{if(_0x314b4c==='n'||_0x314b4c==='no')_0x4c85d1(![]);else _0x4c85d1(_0xcc9ad4);}});});return Promise[_0x498325(0x18f)]([_0x3b8850,_0x40eeb6]);}function loadExisting(_0x7161d0){if(!existsSync(_0x7161d0))return null;return readConfigFile(_0x7161d0);}function resolveFilePath(_0x8a8ed9){const _0x2acc1d=a31_0x29c04a;return isAbsolute(_0x8a8ed9)?_0x8a8ed9:resolve(process[_0x2acc1d(0x14c)](),_0x8a8ed9);}function a31_0x1d03(_0x3ce0c3,_0x2701f7){_0x3ce0c3=_0x3ce0c3-0x148;const _0x1733b7=a31_0x1733();let _0x1d03d5=_0x1733b7[_0x3ce0c3];return _0x1d03d5;}function readSourceFile(_0x1db353){const _0x136358=a31_0x29c04a;try{const _0x431f47=readFileSync(_0x1db353,{'encoding':'utf8'});return JSON[_0x136358(0x158)](_0x431f47);}catch(_0x2b5626){throw CliErrors[_0x136358(0x175)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x2b5626[_0x136358(0x182)]);}}function resolveInitEnv(_0x5d240b){const _0x32bbf4=a31_0x29c04a,_0x39e255=_0x5d240b['env'];if(_0x39e255===undefined||_0x39e255==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x32bbf4(0x159)](_0x39e255))throw CliErrors[_0x32bbf4(0x175)](_0x32bbf4(0x177)+_0x39e255+_0x32bbf4(0x181)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x39e255;}function a31_0x1733(){const _0x51959a=['boolean','Override\x20imported\x20default\x20appcode','project','file','App\x20code\x20for\x20the\x20project','newConfigFileName','app','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','toLowerCase','11ekQPrv','Imported\x20from\x20','trim','12mwMLhm','3245364vEJRIL','Initialized\x20','log','appcode','flagMissing','\x0aInitialized\x20','stdin','validation','\x20\x20default:\x20','Invalid\x20env\x20\x22','\x20\x20config:\x20\x20','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`.','AbortPrompt',')\x20instead\x20of\x20project','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','4zMJLHe','defaultApp','env','\x20\x20appcode:\x20','\x22.\x20Allowed:\x20','message','\x20init\x20—\x20Create\x20','Aborted.','entries','removeListener','165805RpNHJS','yes','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','802911rOMRdV','\x20already\x20exists.\x20Overwrite?','global','Write\x20to\x20global\x20(~/','1XdgOLw','race','once','):\x20','SIGINT','Override\x20imported\x20default\x20env','close','cwd','question','string','Target\x20environment\x20(default\x20','\x20\x20env:\x20\x20\x20\x20\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','cancelled','2354584eGIWKw','934157PoheUS','Skip\x20confirmation\x20when\x20overwriting','[y/N]','App\x20code','parse','includes','stdout','404232vRXKCD','riskLevel','79770XwVAgZ','apps','apiDir','App\x20code\x20cannot\x20be\x20empty.'];a31_0x1733=function(){return _0x51959a;};return a31_0x1733();}
@@ -1 +1 @@
1
- const a32_0x50180a=a32_0x170f;(function(_0x5a8e8b,_0x706ca){const _0x27964c=a32_0x170f,_0x13c0a3=_0x5a8e8b();while(!![]){try{const _0x5ad027=-parseInt(_0x27964c(0xd6))/0x1*(parseInt(_0x27964c(0xd0))/0x2)+-parseInt(_0x27964c(0xd2))/0x3+parseInt(_0x27964c(0xc4))/0x4+parseInt(_0x27964c(0xcb))/0x5*(parseInt(_0x27964c(0xe9))/0x6)+parseInt(_0x27964c(0xf4))/0x7*(-parseInt(_0x27964c(0xd4))/0x8)+parseInt(_0x27964c(0xe7))/0x9+parseInt(_0x27964c(0xbc))/0xa;if(_0x5ad027===_0x706ca)break;else _0x13c0a3['push'](_0x13c0a3['shift']());}catch(_0x38a16e){_0x13c0a3['push'](_0x13c0a3['shift']());}}}(a32_0x20d7,0x2d7e9));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_0x50180a(0xc7),'required':!![],'description':a32_0x50180a(0xd5)},FILE_FLAG={'name':a32_0x50180a(0xef),'type':a32_0x50180a(0xc7),'required':!![],'description':a32_0x50180a(0xf0)},QUERY_FLAG={'name':a32_0x50180a(0xb6),'type':a32_0x50180a(0xc7),'required':!![],'description':a32_0x50180a(0xe5)},TOPK_FLAG={'name':a32_0x50180a(0xe1),'type':a32_0x50180a(0xea),'description':a32_0x50180a(0xde)};function readKnowledgeFile(_0x7513fd){const _0x580970=a32_0x50180a;if(!_0x7513fd)throw CliErrors[_0x580970(0xcd)](_0x580970(0xb8));if(!existsSync(_0x7513fd))throw CliErrors[_0x580970(0xcd)]('File\x20not\x20found:\x20'+_0x7513fd);if(!statSync(_0x7513fd)[_0x580970(0xce)]())throw CliErrors['validation'](_0x580970(0xd7)+_0x7513fd);return readFileSync(_0x7513fd,_0x580970(0xf1));}function a32_0x170f(_0x422fd9,_0x9594ae){_0x422fd9=_0x422fd9-0xb6;const _0x20d736=a32_0x20d7();let _0x170ff6=_0x20d736[_0x422fd9];return _0x170ff6;}function summarizePersonalItem(_0x373fce){const _0x47aa14=a32_0x50180a;return{'id':_0x373fce['id'],'title':_0x373fce[_0x47aa14(0xe8)],'version':_0x373fce['version'],'ragStatus':_0x373fce[_0x47aa14(0xdb)],'ragErrorMessage':_0x373fce[_0x47aa14(0xd8)],'updateTime':_0x373fce[_0x47aa14(0xc6)]};}function detailPersonalItem(_0x5539db){const _0x2b2412=a32_0x50180a;return{'id':_0x5539db['id'],'appCode':_0x5539db['appCode'],'scope':_0x5539db[_0x2b2412(0xcf)],'userId':_0x5539db[_0x2b2412(0xd3)],'title':_0x5539db[_0x2b2412(0xe8)],'content':_0x5539db['content']??'','version':_0x5539db[_0x2b2412(0xcc)],'ragStatus':_0x5539db['ragStatus'],'ragErrorMessage':_0x5539db[_0x2b2412(0xd8)],'createTime':_0x5539db['createTime'],'updateTime':_0x5539db[_0x2b2412(0xc6)]};}function summarizeSearchHit(_0x257de9){const _0x3ce588=a32_0x50180a;return{'scope':_0x257de9[_0x3ce588(0xcf)],'docId':_0x257de9[_0x3ce588(0xc2)],'score':_0x257de9['score'],'weightedScore':_0x257de9[_0x3ce588(0xf3)],'content':_0x257de9[_0x3ce588(0xf2)],'metadata':_0x257de9[_0x3ce588(0xbe)]};}function readTopK(_0x508b2b){const _0x48583e=a32_0x50180a,_0x411f04=_0x508b2b[_0x48583e(0xc3)]('topk');if(_0x411f04===undefined||_0x411f04===null||_0x411f04==='')return undefined;const _0x18b19e=_0x508b2b[_0x48583e(0xec)](_0x48583e(0xe1));if(!Number[_0x48583e(0xca)](_0x18b19e)||_0x18b19e<0x1)throw CliErrors[_0x48583e(0xcd)](_0x48583e(0xc9));return _0x18b19e;}const kbList={'service':'kb','command':'list','description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a32_0x50180a(0xdc),'flags':[VERBOSE_FLAG],async 'execute'(_0x16ce8b){const _0x3f4a97=a32_0x50180a,_0x572a3b=await listPersonalKnowledgeBaseItems(_0x16ce8b[_0x3f4a97(0xe6)]);if(_0x16ce8b[_0x3f4a97(0xd1)]('verbose'))return{'ok':!![],'data':{'total':_0x572a3b[_0x3f4a97(0xb7)],'items':_0x572a3b}};return{'ok':!![],'data':{'total':_0x572a3b[_0x3f4a97(0xb7)],'items':_0x572a3b[_0x3f4a97(0xe0)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x50180a(0xbd),'description':a32_0x50180a(0xc8),'risk':a32_0x50180a(0xdc),'flags':[{...ID_FLAG,'description':a32_0x50180a(0xda)}],async 'execute'(_0x5d5aa8){const _0x3d485b=a32_0x50180a,_0x1477f9=await getPersonalKnowledgeBaseItem(_0x5d5aa8[_0x3d485b(0xec)]('id'),_0x5d5aa8[_0x3d485b(0xe6)]);return{'ok':!![],'data':detailPersonalItem(_0x1477f9)};}},kbCreate={'service':'kb','command':a32_0x50180a(0xee),'description':a32_0x50180a(0xf5),'risk':a32_0x50180a(0xba),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x3be625){const _0x1f7548=a32_0x50180a,_0x414c01=_0x3be625[_0x1f7548(0xe2)]('title'),_0x3f4c35=readKnowledgeFile(_0x3be625[_0x1f7548(0xe2)]('file')),_0x1ce6db=await createPersonalKnowledgeBaseItem(_0x3be625[_0x1f7548(0xe6)],{'title':_0x414c01,'content':_0x3f4c35});return{'ok':!![],'data':summarizePersonalItem(_0x1ce6db),'message':'Created\x20KB\x20entry\x20'+_0x1ce6db['id']+'\x20('+_0x1ce6db[_0x1f7548(0xe8)]+')'};},async 'dryRun'(_0x4fea1b){const _0x204363=a32_0x50180a,_0xc0a9ae=_0x4fea1b['str'](_0x204363(0xe8)),_0x1e43d1=readKnowledgeFile(_0x4fea1b[_0x204363(0xe2)](_0x204363(0xef)));return dryRun(_0x204363(0xbb),'/client/knowledge-base/personal/create')[_0x204363(0xdf)]({'appCode':_0x4fea1b['appCode'],'title':_0xc0a9ae,'content':_0x1e43d1})[_0x204363(0xc0)]('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0xc0a9ae+'\x22')[_0x204363(0xc1)]();}},kbUpdate={'service':'kb','command':a32_0x50180a(0xbf),'description':a32_0x50180a(0xeb),'risk':a32_0x50180a(0xba),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a32_0x50180a(0xb9)},FILE_FLAG],async 'execute'(_0x4ea1e3){const _0x4392ed=a32_0x50180a,_0x3a7b18=_0x4ea1e3[_0x4392ed(0xec)]('id'),_0x473928=readKnowledgeFile(_0x4ea1e3[_0x4392ed(0xe2)](_0x4392ed(0xef))),_0x3fef6c=_0x4ea1e3[_0x4392ed(0xe2)](_0x4392ed(0xe8))||(await getPersonalKnowledgeBaseItem(_0x3a7b18,_0x4ea1e3['appCode']))['title'],_0x2605cd=await updatePersonalKnowledgeBaseItem(_0x3a7b18,_0x4ea1e3[_0x4392ed(0xe6)],{'title':_0x3fef6c,'content':_0x473928});return{'ok':!![],'data':summarizePersonalItem(_0x2605cd),'message':_0x4392ed(0xe3)+_0x2605cd['id']+'\x20('+_0x2605cd[_0x4392ed(0xe8)]+')'};},async 'dryRun'(_0x3a0580){const _0x3e796c=a32_0x50180a,_0xf21394=_0x3a0580[_0x3e796c(0xec)]('id'),_0x2a1164=readKnowledgeFile(_0x3a0580[_0x3e796c(0xe2)](_0x3e796c(0xef))),_0x9224ca=_0x3a0580[_0x3e796c(0xe2)](_0x3e796c(0xe8))||(await getPersonalKnowledgeBaseItem(_0xf21394,_0x3a0580[_0x3e796c(0xe6)]))[_0x3e796c(0xe8)];return dryRun('POST','/client/knowledge-base/personal/'+_0xf21394+'/update')[_0x3e796c(0xdf)]({'appCode':_0x3a0580[_0x3e796c(0xe6)],'title':_0x9224ca,'content':_0x2a1164})[_0x3e796c(0xc0)](_0x3e796c(0xe4)+_0xf21394)[_0x3e796c(0xc1)]();}},kbSearch={'service':'kb','command':a32_0x50180a(0xd9),'description':a32_0x50180a(0xc5),'risk':a32_0x50180a(0xdc),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x5e6986){const _0x2691af=a32_0x50180a;if(!_0x5e6986['str']('query')[_0x2691af(0xdd)]())throw CliErrors[_0x2691af(0xcd)](_0x2691af(0xed));readTopK(_0x5e6986);},async 'execute'(_0x17c958){const _0x33fe2e=a32_0x50180a,_0xbe6efc=_0x17c958['str'](_0x33fe2e(0xb6))['trim'](),_0x5b8d98=readTopK(_0x17c958),_0x20e9a0=await searchKnowledgeBase(_0x17c958[_0x33fe2e(0xe6)],{'query':_0xbe6efc,'topK':_0x5b8d98});return{'ok':!![],'data':{'total':_0x20e9a0[_0x33fe2e(0xb7)],'hits':_0x20e9a0[_0x33fe2e(0xe0)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];function a32_0x20d7(){const _0x31bb2a=['docId','flag','449864CRWIJZ','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','updateTime','string','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','--topk\x20must\x20be\x20a\x20positive\x20number.','isFinite','1394205qEcwll','version','validation','isFile','scope','2JorefH','bool','913149PcOTRZ','userId','110392WxHDkD','Personal\x20knowledge-base\x20entry\x20title','200665zjazrR','File\x20is\x20not\x20a\x20regular\x20file:\x20','ragErrorMessage','search','Personal\x20knowledge-base\x20entry\x20ID','ragStatus','read','trim','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','body','map','topk','str','Updated\x20KB\x20entry\x20','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','appCode','979398MmGlPC','title','6NxEXCc','number','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','num','Search\x20query\x20is\x20required.','create','file','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','utf8','content','weightedScore','126ywcOBf','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','query','length','File\x20path\x20is\x20required.','Override\x20the\x20existing\x20entry\x20title','write','POST','4396460ZTWCCD','detail','metadata','update','description','build'];a32_0x20d7=function(){return _0x31bb2a;};return a32_0x20d7();}
1
+ const a32_0x270d24=a32_0x2894;(function(_0x14c72a,_0xcc2011){const _0x423eaf=a32_0x2894,_0x4e0f04=_0x14c72a();while(!![]){try{const _0x525dc8=-parseInt(_0x423eaf(0x160))/0x1+-parseInt(_0x423eaf(0x170))/0x2*(-parseInt(_0x423eaf(0x17b))/0x3)+parseInt(_0x423eaf(0x16d))/0x4+parseInt(_0x423eaf(0x150))/0x5+parseInt(_0x423eaf(0x15a))/0x6*(parseInt(_0x423eaf(0x15b))/0x7)+parseInt(_0x423eaf(0x172))/0x8*(-parseInt(_0x423eaf(0x166))/0x9)+-parseInt(_0x423eaf(0x148))/0xa;if(_0x525dc8===_0xcc2011)break;else _0x4e0f04['push'](_0x4e0f04['shift']());}catch(_0x18cace){_0x4e0f04['push'](_0x4e0f04['shift']());}}}(a32_0x2db2,0x8a3a5));function a32_0x2894(_0x1b4c2b,_0x548918){_0x1b4c2b=_0x1b4c2b-0x142;const _0x2db2b2=a32_0x2db2();let _0x2894cb=_0x2db2b2[_0x1b4c2b];return _0x2894cb;}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';function a32_0x2db2(){const _0xd15a7c=['write','Personal\x20knowledge-base\x20entry\x20ID','file','3402040LwQDdR','body','utf8','ragErrorMessage','--topk\x20must\x20be\x20a\x20positive\x20number.','description','ragStatus','verbose','1366860UOhXix','title','appCode','string','validation','detail','Personal\x20knowledge-base\x20entry\x20title','query','Override\x20the\x20existing\x20entry\x20title','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','6eatehL','4824428RvHgDu','topk','File\x20path\x20is\x20required.','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','num','252341jCOnoh','userId','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','score','build','create','171XWxDUN','scope','length','bool','number','str','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','647660fGOIym','map','createTime','680954CcQDyZ','/client/knowledge-base/personal/','128944cOIOit','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','flag','Search\x20query\x20is\x20required.','search','weightedScore','/client/knowledge-base/personal/create','3kGYhzY','trim','content','read','Created\x20KB\x20entry\x20','version','Updated\x20KB\x20entry\x20','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','updateTime','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','POST','File\x20is\x20not\x20a\x20regular\x20file:\x20','docId'];a32_0x2db2=function(){return _0xd15a7c;};return a32_0x2db2();}import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x270d24(0x151),'type':a32_0x270d24(0x153),'required':!![],'description':a32_0x270d24(0x156)},FILE_FLAG={'name':a32_0x270d24(0x147),'type':a32_0x270d24(0x153),'required':!![],'description':a32_0x270d24(0x175)},QUERY_FLAG={'name':a32_0x270d24(0x157),'type':a32_0x270d24(0x153),'required':!![],'description':a32_0x270d24(0x162)},TOPK_FLAG={'name':'topk','type':a32_0x270d24(0x16a),'description':a32_0x270d24(0x159)};function readKnowledgeFile(_0x81c730){const _0x550b97=a32_0x270d24;if(!_0x81c730)throw CliErrors[_0x550b97(0x154)](_0x550b97(0x15d));if(!existsSync(_0x81c730))throw CliErrors[_0x550b97(0x154)]('File\x20not\x20found:\x20'+_0x81c730);if(!statSync(_0x81c730)['isFile']())throw CliErrors[_0x550b97(0x154)](_0x550b97(0x143)+_0x81c730);return readFileSync(_0x81c730,_0x550b97(0x14a));}function summarizePersonalItem(_0x54b52a){const _0x1f1b18=a32_0x270d24;return{'id':_0x54b52a['id'],'title':_0x54b52a[_0x1f1b18(0x151)],'version':_0x54b52a[_0x1f1b18(0x180)],'ragStatus':_0x54b52a[_0x1f1b18(0x14e)],'ragErrorMessage':_0x54b52a[_0x1f1b18(0x14b)],'updateTime':_0x54b52a[_0x1f1b18(0x183)]};}function detailPersonalItem(_0x564f38){const _0x35b6da=a32_0x270d24;return{'id':_0x564f38['id'],'appCode':_0x564f38['appCode'],'scope':_0x564f38[_0x35b6da(0x167)],'userId':_0x564f38[_0x35b6da(0x161)],'title':_0x564f38[_0x35b6da(0x151)],'content':_0x564f38[_0x35b6da(0x17d)]??'','version':_0x564f38[_0x35b6da(0x180)],'ragStatus':_0x564f38['ragStatus'],'ragErrorMessage':_0x564f38[_0x35b6da(0x14b)],'createTime':_0x564f38[_0x35b6da(0x16f)],'updateTime':_0x564f38[_0x35b6da(0x183)]};}function summarizeSearchHit(_0x1a98fc){const _0x123c6d=a32_0x270d24;return{'scope':_0x1a98fc[_0x123c6d(0x167)],'title':_0x1a98fc[_0x123c6d(0x151)],'docId':_0x1a98fc[_0x123c6d(0x144)],'score':_0x1a98fc[_0x123c6d(0x163)],'weightedScore':_0x1a98fc[_0x123c6d(0x179)],'content':_0x1a98fc[_0x123c6d(0x17d)],'metadata':_0x1a98fc['metadata']};}function readTopK(_0x463852){const _0x1455ea=a32_0x270d24,_0x40b293=_0x463852[_0x1455ea(0x176)](_0x1455ea(0x15c));if(_0x40b293===undefined||_0x40b293===null||_0x40b293==='')return undefined;const _0x5b35aa=_0x463852['num'](_0x1455ea(0x15c));if(!Number['isFinite'](_0x5b35aa)||_0x5b35aa<0x1)throw CliErrors[_0x1455ea(0x154)](_0x1455ea(0x14c));return _0x5b35aa;}const kbList={'service':'kb','command':'list','description':a32_0x270d24(0x182),'risk':a32_0x270d24(0x17e),'flags':[VERBOSE_FLAG],async 'execute'(_0x2cb703){const _0x56319e=a32_0x270d24,_0x2719e9=await listPersonalKnowledgeBaseItems(_0x2cb703[_0x56319e(0x152)]);if(_0x2cb703[_0x56319e(0x169)](_0x56319e(0x14f)))return{'ok':!![],'data':{'total':_0x2719e9['length'],'items':_0x2719e9}};return{'ok':!![],'data':{'total':_0x2719e9[_0x56319e(0x168)],'items':_0x2719e9['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x270d24(0x155),'description':a32_0x270d24(0x184),'risk':'read','flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'}],async 'execute'(_0x57c528){const _0x14e9e5=a32_0x270d24,_0x1660b7=await getPersonalKnowledgeBaseItem(_0x57c528[_0x14e9e5(0x15f)]('id'),_0x57c528[_0x14e9e5(0x152)]);return{'ok':!![],'data':detailPersonalItem(_0x1660b7)};}},kbCreate={'service':'kb','command':a32_0x270d24(0x165),'description':a32_0x270d24(0x173),'risk':a32_0x270d24(0x145),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x4d9501){const _0x44bc5c=a32_0x270d24,_0x4c9b49=_0x4d9501[_0x44bc5c(0x16b)]('title'),_0x5edd1c=readKnowledgeFile(_0x4d9501[_0x44bc5c(0x16b)]('file')),_0x414188=await createPersonalKnowledgeBaseItem(_0x4d9501[_0x44bc5c(0x152)],{'title':_0x4c9b49,'content':_0x5edd1c});return{'ok':!![],'data':summarizePersonalItem(_0x414188),'message':_0x44bc5c(0x17f)+_0x414188['id']+'\x20('+_0x414188[_0x44bc5c(0x151)]+')'};},async 'dryRun'(_0x323938){const _0x5dada9=a32_0x270d24,_0x42993d=_0x323938[_0x5dada9(0x16b)](_0x5dada9(0x151)),_0x38d184=readKnowledgeFile(_0x323938['str'](_0x5dada9(0x147)));return dryRun(_0x5dada9(0x142),_0x5dada9(0x17a))[_0x5dada9(0x149)]({'appCode':_0x323938[_0x5dada9(0x152)],'title':_0x42993d,'content':_0x38d184})[_0x5dada9(0x14d)](_0x5dada9(0x16c)+_0x42993d+'\x22')[_0x5dada9(0x164)]();}},kbUpdate={'service':'kb','command':'update','description':a32_0x270d24(0x15e),'risk':a32_0x270d24(0x145),'flags':[{...ID_FLAG,'description':a32_0x270d24(0x146)},{...TITLE_FLAG,'required':![],'description':a32_0x270d24(0x158)},FILE_FLAG],async 'execute'(_0x337b8b){const _0x32bf21=a32_0x270d24,_0x5541e6=_0x337b8b[_0x32bf21(0x15f)]('id'),_0x279bae=readKnowledgeFile(_0x337b8b['str'](_0x32bf21(0x147))),_0x424d43=_0x337b8b[_0x32bf21(0x16b)](_0x32bf21(0x151))||(await getPersonalKnowledgeBaseItem(_0x5541e6,_0x337b8b[_0x32bf21(0x152)]))[_0x32bf21(0x151)],_0x48b524=await updatePersonalKnowledgeBaseItem(_0x5541e6,_0x337b8b[_0x32bf21(0x152)],{'title':_0x424d43,'content':_0x279bae});return{'ok':!![],'data':summarizePersonalItem(_0x48b524),'message':_0x32bf21(0x181)+_0x48b524['id']+'\x20('+_0x48b524[_0x32bf21(0x151)]+')'};},async 'dryRun'(_0xa25e6b){const _0x3e3e77=a32_0x270d24,_0x10b91e=_0xa25e6b[_0x3e3e77(0x15f)]('id'),_0x5bc5ad=readKnowledgeFile(_0xa25e6b['str'](_0x3e3e77(0x147))),_0x4576e2=_0xa25e6b[_0x3e3e77(0x16b)]('title')||(await getPersonalKnowledgeBaseItem(_0x10b91e,_0xa25e6b[_0x3e3e77(0x152)]))['title'];return dryRun(_0x3e3e77(0x142),_0x3e3e77(0x171)+_0x10b91e+'/update')[_0x3e3e77(0x149)]({'appCode':_0xa25e6b[_0x3e3e77(0x152)],'title':_0x4576e2,'content':_0x5bc5ad})[_0x3e3e77(0x14d)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x10b91e)[_0x3e3e77(0x164)]();}},kbSearch={'service':'kb','command':a32_0x270d24(0x178),'description':a32_0x270d24(0x174),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x90a583){const _0x16189a=a32_0x270d24;if(!_0x90a583[_0x16189a(0x16b)]('query')[_0x16189a(0x17c)]())throw CliErrors[_0x16189a(0x154)](_0x16189a(0x177));readTopK(_0x90a583);},async 'execute'(_0x155076){const _0x560b29=a32_0x270d24,_0x97cafa=_0x155076['str'](_0x560b29(0x157))[_0x560b29(0x17c)](),_0x2ea3a4=readTopK(_0x155076),_0x2f577f=await searchKnowledgeBase(_0x155076[_0x560b29(0x152)],{'query':_0x97cafa,'topK':_0x2ea3a4});return{'ok':!![],'data':{'total':_0x2f577f[_0x560b29(0x168)],'hits':_0x2f577f[_0x560b29(0x16e)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- const a33_0xffecae=a33_0x68cd;(function(_0x291eb3,_0x453441){const _0x8f0ad9=a33_0x68cd,_0x43b035=_0x291eb3();while(!![]){try{const _0x18b41f=-parseInt(_0x8f0ad9(0x176))/0x1+-parseInt(_0x8f0ad9(0x171))/0x2*(parseInt(_0x8f0ad9(0x179))/0x3)+-parseInt(_0x8f0ad9(0x188))/0x4+parseInt(_0x8f0ad9(0x17d))/0x5*(-parseInt(_0x8f0ad9(0x18b))/0x6)+parseInt(_0x8f0ad9(0x189))/0x7+parseInt(_0x8f0ad9(0x17e))/0x8*(parseInt(_0x8f0ad9(0x186))/0x9)+-parseInt(_0x8f0ad9(0x182))/0xa*(-parseInt(_0x8f0ad9(0x184))/0xb);if(_0x18b41f===_0x453441)break;else _0x43b035['push'](_0x43b035['shift']());}catch(_0x4497c6){_0x43b035['push'](_0x43b035['shift']());}}}(a33_0xf191,0x71711));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0xf191(){const _0x59c8ca=['success','duration','566533oacTiP','timestamp','toLocaleString','6bnxvbr','details','show','\x20\x20\x20Details:\x20','19020zaoZTz','307848mgPIDK','logs','clearLogs','write','10ARByfI','warn','16889158zJwHaY','View\x20command\x20history\x20logs','207ocyfzA','readLogs','2595280OiWpfm','934171OVfVRl','error','300DTHfil','length','clear','keys','read','log','level','*\x20Logs\x20cleared','stringify','683684dBHyZg','forEach','\x20\x20\x20Time:\x20'];a33_0xf191=function(){return _0x59c8ca;};return a33_0xf191();}function a33_0x68cd(_0x2b1c14,_0x337239){_0x2b1c14=_0x2b1c14-0x16c;const _0xf19114=a33_0xf191();let _0x68cda6=_0xf19114[_0x2b1c14];return _0x68cda6;}function printLogs(_0x40e460){const _0x304a1d=a33_0x68cd;if(_0x40e460[_0x304a1d(0x18c)]===0x0){console['log']('*\x20No\x20logs\x20found');return;}console[_0x304a1d(0x16d)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x40e460[_0x304a1d(0x172)]((_0x43ff28,_0x73b5b0)=>{const _0x336fd7=_0x304a1d,_0xdd6e9f=new Date(_0x43ff28[_0x336fd7(0x177)])[_0x336fd7(0x178)]('en-US'),_0x29a4dd=_0x43ff28[_0x336fd7(0x16e)]===_0x336fd7(0x174)?'√':_0x43ff28['level']===_0x336fd7(0x18a)?'×':_0x43ff28[_0x336fd7(0x16e)]===_0x336fd7(0x183)?'!':'i';console['log'](_0x73b5b0+0x1+'.\x20'+_0x29a4dd+'\x20['+_0x43ff28['command']+']\x20'+_0x43ff28['message']),console['log'](_0x336fd7(0x173)+_0xdd6e9f),_0x43ff28[_0x336fd7(0x175)]&&console[_0x336fd7(0x16d)]('\x20\x20\x20Duration:\x20'+_0x43ff28[_0x336fd7(0x175)]+'ms'),_0x43ff28[_0x336fd7(0x17a)]&&Object[_0x336fd7(0x18e)](_0x43ff28['details'])['length']>0x0&&console[_0x336fd7(0x16d)](_0x336fd7(0x17c)+JSON[_0x336fd7(0x170)](_0x43ff28[_0x336fd7(0x17a)],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':a33_0xffecae(0x17f),'command':a33_0xffecae(0x17b),'description':a33_0xffecae(0x185),'risk':a33_0xffecae(0x16c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x444eb6){const _0x1b0ec9=a33_0xffecae;return printLogs(logger[_0x1b0ec9(0x187)]()),{'ok':!![]};}},{'service':a33_0xffecae(0x17f),'command':a33_0xffecae(0x18d),'description':'Clear\x20command\x20history\x20logs','risk':a33_0xffecae(0x181),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x29796c){const _0x37ca88=a33_0xffecae;return logger[_0x37ca88(0x180)](),console[_0x37ca88(0x16d)](_0x37ca88(0x16f)),{'ok':!![]};}}];
1
+ function a33_0x4cf9(_0x10427a,_0x47ee6f){_0x10427a=_0x10427a-0x172;const _0x67f7ee=a33_0x67f7();let _0x4cf9f7=_0x67f7ee[_0x10427a];return _0x4cf9f7;}const a33_0x58b8a6=a33_0x4cf9;(function(_0x46cf39,_0x88bed1){const _0x439a3c=a33_0x4cf9,_0x452f90=_0x46cf39();while(!![]){try{const _0x45b9d2=-parseInt(_0x439a3c(0x187))/0x1+parseInt(_0x439a3c(0x18a))/0x2+parseInt(_0x439a3c(0x18b))/0x3+parseInt(_0x439a3c(0x17a))/0x4*(parseInt(_0x439a3c(0x18c))/0x5)+-parseInt(_0x439a3c(0x175))/0x6+parseInt(_0x439a3c(0x188))/0x7+parseInt(_0x439a3c(0x18d))/0x8*(parseInt(_0x439a3c(0x17f))/0x9);if(_0x45b9d2===_0x88bed1)break;else _0x452f90['push'](_0x452f90['shift']());}catch(_0x33ed94){_0x452f90['push'](_0x452f90['shift']());}}}(a33_0x67f7,0xa9d88));function a33_0x67f7(){const _0x1a9cf4=['995784PdAVmi','2506443yGkNmb','41380uaCvwg','196696eJtsnz','toLocaleString','message','*\x20Logs\x20cleared','keys','stringify','*\x20No\x20logs\x20found','write','duration','clear','4386714pmQjgE','log','readLogs','warn','\x20\x20\x20Duration:\x20','152fcEFnJ','success','level','command','timestamp','135eeCUiB','clearLogs','\x20\x20\x20Time:\x20','Clear\x20command\x20history\x20logs','read','length','details','logs','951051matZwP','2528344LJhyiT','\x20\x20\x20Details:\x20'];a33_0x67f7=function(){return _0x1a9cf4;};return a33_0x67f7();}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x311617){const _0x2e5ae8=a33_0x4cf9;if(_0x311617[_0x2e5ae8(0x184)]===0x0){console[_0x2e5ae8(0x176)](_0x2e5ae8(0x193));return;}console[_0x2e5ae8(0x176)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x311617['forEach']((_0x1a22cd,_0x556a3b)=>{const _0x1f617e=_0x2e5ae8,_0x4f99d4=new Date(_0x1a22cd[_0x1f617e(0x17e)])[_0x1f617e(0x18e)]('en-US'),_0x142750=_0x1a22cd[_0x1f617e(0x17c)]===_0x1f617e(0x17b)?'√':_0x1a22cd[_0x1f617e(0x17c)]==='error'?'×':_0x1a22cd[_0x1f617e(0x17c)]===_0x1f617e(0x178)?'!':'i';console[_0x1f617e(0x176)](_0x556a3b+0x1+'.\x20'+_0x142750+'\x20['+_0x1a22cd[_0x1f617e(0x17d)]+']\x20'+_0x1a22cd[_0x1f617e(0x18f)]),console['log'](_0x1f617e(0x181)+_0x4f99d4),_0x1a22cd[_0x1f617e(0x173)]&&console[_0x1f617e(0x176)](_0x1f617e(0x179)+_0x1a22cd[_0x1f617e(0x173)]+'ms'),_0x1a22cd[_0x1f617e(0x185)]&&Object[_0x1f617e(0x191)](_0x1a22cd['details'])[_0x1f617e(0x184)]>0x0&&console['log'](_0x1f617e(0x189)+JSON[_0x1f617e(0x192)](_0x1a22cd[_0x1f617e(0x185)],null,0x2)),console[_0x1f617e(0x176)]('');});}export const logsDefinitions=[{'service':'logs','command':'show','description':'View\x20command\x20history\x20logs','risk':a33_0x58b8a6(0x183),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x38166a){const _0x946f91=a33_0x58b8a6;return printLogs(logger[_0x946f91(0x177)]()),{'ok':!![]};}},{'service':a33_0x58b8a6(0x186),'command':a33_0x58b8a6(0x174),'description':a33_0x58b8a6(0x182),'risk':a33_0x58b8a6(0x172),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x212700){const _0xfa640d=a33_0x58b8a6;return logger[_0xfa640d(0x180)](),console[_0xfa640d(0x176)](_0xfa640d(0x190)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a34_0x353f0e=a34_0x20bc;(function(_0x36c482,_0x2c3e54){const _0x55fa4b=a34_0x20bc,_0x24fc98=_0x36c482();while(!![]){try{const _0x71ece0=-parseInt(_0x55fa4b(0xb5))/0x1+-parseInt(_0x55fa4b(0xd3))/0x2+parseInt(_0x55fa4b(0xe6))/0x3+-parseInt(_0x55fa4b(0xca))/0x4*(-parseInt(_0x55fa4b(0xcf))/0x5)+parseInt(_0x55fa4b(0xd0))/0x6*(parseInt(_0x55fa4b(0xe5))/0x7)+-parseInt(_0x55fa4b(0xb3))/0x8+parseInt(_0x55fa4b(0xe1))/0x9;if(_0x71ece0===_0x2c3e54)break;else _0x24fc98['push'](_0x24fc98['shift']());}catch(_0x25faca){_0x24fc98['push'](_0x24fc98['shift']());}}}(a34_0x1d9c,0xbc6e7));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a34_0x20bc(_0xe84a5e,_0x2f36b3){_0xe84a5e=_0xe84a5e-0xb3;const _0x1d9ca9=a34_0x1d9c();let _0x20bc73=_0x1d9ca9[_0xe84a5e];return _0x20bc73;}const SUPPORTED_SCENES=[a34_0x353f0e(0xda),a34_0x353f0e(0xc7),a34_0x353f0e(0xe0),'idCard'],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x353f0e(0xb4),'general':a34_0x353f0e(0xd8),'form':'Table','idCard':'IdCard'},SCENE_FLAG={'name':a34_0x353f0e(0xbc),'type':a34_0x353f0e(0xbd),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x353f0e(0xba)},IMAGE_FILE_FLAG={'name':a34_0x353f0e(0xc6),'type':a34_0x353f0e(0xbd),'description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':'image-url','type':a34_0x353f0e(0xbd),'description':a34_0x353f0e(0xde)};function normalizeScene(_0x34ef94){const _0x517a61=a34_0x353f0e,_0x470ee9=_0x34ef94[_0x517a61(0xcc)]()['toLowerCase']();if(_0x470ee9===_0x517a61(0xdd))return _0x517a61(0xcd);if(_0x470ee9===_0x517a61(0xda)||_0x470ee9===_0x517a61(0xc7)||_0x470ee9===_0x517a61(0xe0))return _0x470ee9;throw CliErrors[_0x517a61(0xc0)]('Unsupported\x20OCR\x20scene:\x20'+_0x34ef94+_0x517a61(0xdb)+SUPPORTED_SCENES['join'](',\x20'));}function a34_0x1d9c(){const _0x1ad7e3=['scene','string','imageFile','/client/uploadFile','validation','\x20OCR','ocr','count','fileName','imageUrl','image-file','general','image-url','apiError','87668KCgIcD','fileUrl','trim','idCard','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','185hZpMbM','1122774FXNPfW','appCode','body','2896970emiele','/client/ocr','filePath','str','File\x20upload\x20response\x20missing\x20filePath.','General','filter','invoice','.\x20Supported\x20scenes:\x20','write','idcard','Publicly\x20accessible\x20image\x20or\x20file\x20URL','Preview:\x20recognize\x20','form','13315851oMRVAk','build','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','<filePath\x20returned\x20by\x20/client/uploadFile>','42hKxhto','4569150DkiFdT','9702472BRWacA','Invoice','1503183JZSPXE','File\x20URL\x20response\x20missing\x20fileUrl.','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','path','/client/queryFileUrl','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','POST'];a34_0x1d9c=function(){return _0x1ad7e3;};return a34_0x1d9c();}function selectedInputs(_0x58dbb0){const _0x47ffd4=a34_0x353f0e,_0x43d0ba=_0x58dbb0[_0x47ffd4(0xd6)](_0x47ffd4(0xc6))[_0x47ffd4(0xcc)](),_0x105be3=_0x58dbb0[_0x47ffd4(0xd6)](_0x47ffd4(0xc8))[_0x47ffd4(0xcc)]();return{'imageFile':_0x43d0ba,'imageUrl':_0x105be3,'count':[_0x43d0ba,_0x105be3][_0x47ffd4(0xd9)](Boolean)['length']};}function validateInputSelection(_0x2dec04){const _0x577fbb=a34_0x353f0e,_0x5edbca=selectedInputs(_0x2dec04);if(_0x5edbca[_0x577fbb(0xc3)]!==0x1)throw CliErrors[_0x577fbb(0xc0)](_0x577fbb(0xb7));return _0x5edbca;}function withScene(_0x512173,_0x372386,_0x466087){const _0x3a6aa4=a34_0x353f0e;return{..._0x512173,'scene':_0x372386,..._0x466087?{'sourceFile':{'fileName':_0x466087[_0x3a6aa4(0xc4)],'filePath':_0x466087[_0x3a6aa4(0xd5)]}}:{}};}const ocrRecognize={'service':a34_0x353f0e(0xc2),'command':'recognize','description':a34_0x353f0e(0xce),'risk':a34_0x353f0e(0xdc),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x1e32dc){const _0x3fcb5b=a34_0x353f0e,_0xed162c=normalizeScene(_0x1e32dc['str'](_0x3fcb5b(0xbc))),_0x5b55f0=SCENE_TO_LEGACY_TYPE[_0xed162c],_0xe5541a=validateInputSelection(_0x1e32dc);if(_0xe5541a[_0x3fcb5b(0xc5)])return dryRun(_0x3fcb5b(0xbb),_0x3fcb5b(0xd4))['body']({'appCode':_0x1e32dc[_0x3fcb5b(0xd1)],'url':_0xe5541a[_0x3fcb5b(0xc5)],'type':_0x5b55f0})['description'](_0x3fcb5b(0xdf)+_0xed162c+'\x20OCR\x20from\x20URL')[_0x3fcb5b(0xe2)]();const _0x63eaea=requireRuntimeUploadFile(_0xe5541a[_0x3fcb5b(0xbe)],_0x3fcb5b(0xc6));return dryRun(_0x3fcb5b(0xbb),_0x3fcb5b(0xbf))[_0x3fcb5b(0xd2)]({'steps':[{'method':_0x3fcb5b(0xbb),'url':'/client/uploadFile','body':{'appCode':_0x1e32dc[_0x3fcb5b(0xd1)],'multipart':{'file':_0x63eaea}}},{'method':_0x3fcb5b(0xbb),'url':_0x3fcb5b(0xb9),'body':{'filePath':_0x3fcb5b(0xe4),'downloadFlag':![]}},{'method':'POST','url':_0x3fcb5b(0xd4),'body':{'appCode':_0x1e32dc[_0x3fcb5b(0xd1)],'url':_0x3fcb5b(0xe3),'type':_0x5b55f0}}]})['description']('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0xed162c+_0x3fcb5b(0xc1))['build']();},async 'execute'(_0x4a2799){const _0x25d2e1=a34_0x353f0e,_0x50e709=normalizeScene(_0x4a2799[_0x25d2e1(0xd6)](_0x25d2e1(0xbc))),_0x58ec77=SCENE_TO_LEGACY_TYPE[_0x50e709],_0x4fea07=validateInputSelection(_0x4a2799);if(_0x4fea07[_0x25d2e1(0xc5)]){const _0x5159fe=await recognizeRuntimeOcr(_0x4a2799[_0x25d2e1(0xd1)],{'url':_0x4fea07['imageUrl'],'type':_0x58ec77});return{'ok':!![],'data':withScene(_0x5159fe,_0x50e709)};}const _0x1260ec=requireRuntimeUploadFile(_0x4fea07[_0x25d2e1(0xbe)],'image-file'),_0x4dbe47=await uploadRuntimeFile(_0x4a2799[_0x25d2e1(0xd1)],_0x1260ec[_0x25d2e1(0xb8)]);if(!_0x4dbe47[_0x25d2e1(0xd5)])throw CliErrors[_0x25d2e1(0xc9)](_0x25d2e1(0xd7));const _0x4fbf9a=await queryRuntimeFileUrl(_0x4dbe47[_0x25d2e1(0xd5)],{'download':![]});if(!_0x4fbf9a[_0x25d2e1(0xcb)])throw CliErrors[_0x25d2e1(0xc9)](_0x25d2e1(0xb6));const _0xdcd57f=await recognizeRuntimeOcr(_0x4a2799[_0x25d2e1(0xd1)],{'url':_0x4fbf9a[_0x25d2e1(0xcb)],'type':_0x58ec77});return{'ok':!![],'data':withScene(_0xdcd57f,_0x50e709,_0x4dbe47)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a34_0x5a8c1c=a34_0x24ee;(function(_0x33f88a,_0x2b5d43){const _0x3501e8=a34_0x24ee,_0x27a74f=_0x33f88a();while(!![]){try{const _0x1e7d5d=parseInt(_0x3501e8(0xd1))/0x1+-parseInt(_0x3501e8(0xd2))/0x2+-parseInt(_0x3501e8(0xc2))/0x3*(parseInt(_0x3501e8(0xbe))/0x4)+-parseInt(_0x3501e8(0xcd))/0x5+-parseInt(_0x3501e8(0xd4))/0x6+parseInt(_0x3501e8(0xc1))/0x7*(parseInt(_0x3501e8(0xcc))/0x8)+parseInt(_0x3501e8(0xdf))/0x9;if(_0x1e7d5d===_0x2b5d43)break;else _0x27a74f['push'](_0x27a74f['shift']());}catch(_0x3c6a8e){_0x27a74f['push'](_0x27a74f['shift']());}}}(a34_0x27ec,0xc4652));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_0x5a8c1c(0xeb),'general',a34_0x5a8c1c(0xde),a34_0x5a8c1c(0xed)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x5a8c1c(0xdd),'general':'General','form':'Table','idCard':a34_0x5a8c1c(0xc7)},SCENE_FLAG={'name':'scene','type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x5a8c1c(0xe6)},IMAGE_FILE_FLAG={'name':'image-file','type':a34_0x5a8c1c(0xea),'description':a34_0x5a8c1c(0xbc)},IMAGE_URL_FLAG={'name':'image-url','type':'string','description':a34_0x5a8c1c(0xc5)};function normalizeScene(_0x18ecb3){const _0x57bae3=a34_0x5a8c1c,_0x600dfb=_0x18ecb3[_0x57bae3(0xe7)]()['toLowerCase']();if(_0x600dfb==='idcard')return'idCard';if(_0x600dfb===_0x57bae3(0xeb)||_0x600dfb===_0x57bae3(0xe9)||_0x600dfb===_0x57bae3(0xde))return _0x600dfb;throw CliErrors['validation'](_0x57bae3(0xdb)+_0x18ecb3+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES[_0x57bae3(0xe5)](',\x20'));}function a34_0x27ec(){const _0x3c0f2c=['Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','fileUrl','20QVjEZO','File\x20upload\x20response\x20missing\x20filePath.','filePath','8337YGvldj','98085GVWNHa','str','image-url','Publicly\x20accessible\x20image\x20or\x20file\x20URL','count','IdCard','build','length','image-file','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','10408evhsrJ','4149560MnwWNM','imageFile','appCode','imageUrl','1538035CzTWMo','2533160ILjOxS','apiError','1021272myqrVi','body','\x20OCR\x20from\x20URL','fileName','/client/queryFileUrl','\x20OCR','validation','Unsupported\x20OCR\x20scene:\x20','<filePath\x20returned\x20by\x20/client/uploadFile>','Invoice','form','1323783fCasAn','POST','filter','File\x20URL\x20response\x20missing\x20fileUrl.','description','scene','join','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','trim','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','general','string','invoice','path','idCard','recognize','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.'];a34_0x27ec=function(){return _0x3c0f2c;};return a34_0x27ec();}function selectedInputs(_0x5ecf06){const _0x25fd8d=a34_0x5a8c1c,_0x36f901=_0x5ecf06[_0x25fd8d(0xc3)](_0x25fd8d(0xca))[_0x25fd8d(0xe7)](),_0x528a71=_0x5ecf06['str'](_0x25fd8d(0xc4))['trim']();return{'imageFile':_0x36f901,'imageUrl':_0x528a71,'count':[_0x36f901,_0x528a71][_0x25fd8d(0xe1)](Boolean)[_0x25fd8d(0xc9)]};}function validateInputSelection(_0x29818e){const _0x498c86=a34_0x5a8c1c,_0x3c4ab5=selectedInputs(_0x29818e);if(_0x3c4ab5[_0x498c86(0xc6)]!==0x1)throw CliErrors[_0x498c86(0xda)](_0x498c86(0xbb));return _0x3c4ab5;}function a34_0x24ee(_0x3dcd27,_0x4af28f){_0x3dcd27=_0x3dcd27-0xbb;const _0x27ec08=a34_0x27ec();let _0x24ee0c=_0x27ec08[_0x3dcd27];return _0x24ee0c;}function withScene(_0x34e121,_0x7b53e9,_0x5e05f9){const _0x5e94de=a34_0x5a8c1c;return{..._0x34e121,'scene':_0x7b53e9,..._0x5e05f9?{'sourceFile':{'fileName':_0x5e05f9[_0x5e94de(0xd7)],'filePath':_0x5e05f9[_0x5e94de(0xc0)]}}:{}};}const ocrRecognize={'service':'ocr','command':a34_0x5a8c1c(0xee),'description':'Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','risk':'write','flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0xc70bbe){const _0x42409a=a34_0x5a8c1c,_0x2ed3b7=normalizeScene(_0xc70bbe[_0x42409a(0xc3)](_0x42409a(0xe4))),_0x39405c=SCENE_TO_LEGACY_TYPE[_0x2ed3b7],_0x1464de=validateInputSelection(_0xc70bbe);if(_0x1464de[_0x42409a(0xd0)])return dryRun(_0x42409a(0xe0),'/client/ocr')[_0x42409a(0xd5)]({'appCode':_0xc70bbe[_0x42409a(0xcf)],'url':_0x1464de[_0x42409a(0xd0)],'type':_0x39405c})['description']('Preview:\x20recognize\x20'+_0x2ed3b7+_0x42409a(0xd6))['build']();const _0x1e5766=requireRuntimeUploadFile(_0x1464de[_0x42409a(0xce)],_0x42409a(0xca));return dryRun(_0x42409a(0xe0),'/client/uploadFile')['body']({'steps':[{'method':_0x42409a(0xe0),'url':'/client/uploadFile','body':{'appCode':_0xc70bbe['appCode'],'multipart':{'file':_0x1e5766}}},{'method':_0x42409a(0xe0),'url':_0x42409a(0xd8),'body':{'filePath':_0x42409a(0xdc),'downloadFlag':![]}},{'method':_0x42409a(0xe0),'url':'/client/ocr','body':{'appCode':_0xc70bbe[_0x42409a(0xcf)],'url':_0x42409a(0xcb),'type':_0x39405c}}]})[_0x42409a(0xe3)](_0x42409a(0xe8)+_0x2ed3b7+_0x42409a(0xd9))[_0x42409a(0xc8)]();},async 'execute'(_0x5cdabf){const _0x3c99e1=a34_0x5a8c1c,_0x4c91b9=normalizeScene(_0x5cdabf[_0x3c99e1(0xc3)](_0x3c99e1(0xe4))),_0x5d3be1=SCENE_TO_LEGACY_TYPE[_0x4c91b9],_0x1e94f9=validateInputSelection(_0x5cdabf);if(_0x1e94f9[_0x3c99e1(0xd0)]){const _0x2c30ff=await recognizeRuntimeOcr(_0x5cdabf[_0x3c99e1(0xcf)],{'url':_0x1e94f9['imageUrl'],'type':_0x5d3be1});return{'ok':!![],'data':withScene(_0x2c30ff,_0x4c91b9)};}const _0x108343=requireRuntimeUploadFile(_0x1e94f9[_0x3c99e1(0xce)],_0x3c99e1(0xca)),_0x40cafd=await uploadRuntimeFile(_0x5cdabf['appCode'],_0x108343[_0x3c99e1(0xec)]);if(!_0x40cafd[_0x3c99e1(0xc0)])throw CliErrors[_0x3c99e1(0xd3)](_0x3c99e1(0xbf));const _0x42a544=await queryRuntimeFileUrl(_0x40cafd[_0x3c99e1(0xc0)],{'download':![]});if(!_0x42a544[_0x3c99e1(0xbd)])throw CliErrors[_0x3c99e1(0xd3)](_0x3c99e1(0xe2));const _0x28f20b=await recognizeRuntimeOcr(_0x5cdabf[_0x3c99e1(0xcf)],{'url':_0x42a544['fileUrl'],'type':_0x5d3be1});return{'ok':!![],'data':withScene(_0x28f20b,_0x4c91b9,_0x40cafd)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
1
- const a35_0x477128=a35_0x3073;(function(_0x5a80f5,_0x553afd){const _0x12960c=a35_0x3073,_0x3bbcdb=_0x5a80f5();while(!![]){try{const _0x4fd052=-parseInt(_0x12960c(0x1e7))/0x1+parseInt(_0x12960c(0x1d8))/0x2*(-parseInt(_0x12960c(0x1c8))/0x3)+parseInt(_0x12960c(0x1ba))/0x4+-parseInt(_0x12960c(0x1d2))/0x5+parseInt(_0x12960c(0x1d0))/0x6*(-parseInt(_0x12960c(0x1cc))/0x7)+-parseInt(_0x12960c(0x1c4))/0x8+parseInt(_0x12960c(0x1e9))/0x9*(parseInt(_0x12960c(0x1cd))/0xa);if(_0x4fd052===_0x553afd)break;else _0x3bbcdb['push'](_0x3bbcdb['shift']());}catch(_0x49b7a4){_0x3bbcdb['push'](_0x3bbcdb['shift']());}}}(a35_0x2042,0x446b5));import{existsSync,readFileSync,statSync}from'node:fs';function a35_0x2042(){const _0x45b451=['19926SxFVkU','file','1998165ofptBm','createUserId','config','utf8','body','length','22qkbuyl','source-session-id','personal-bff','--params\x20must\x20be\x20a\x20JSON\x20object.','build','createTime','/client/runtime-bff/personal/','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','gmtCreate','create','high-risk-write','Personal\x20BFF\x20script\x20file\x20is\x20blank.','isArray','sourceSessionId','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','482649mLmvCv','Show\x20one\x20personal\x20BFF\x20by\x20id','9gxlbcU','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','/client/runtime-bff/personal/create','File\x20is\x20not\x20a\x20regular\x20file:\x20','write','/update','Updated\x20personal\x20BFF\x20','POST','File\x20not\x20found:\x20','detail','list','flag','Personal\x20BFF\x20script\x20ID','functionName','validation','num','Optional\x20source\x20RuntimeAgent\x20session\x20id','name','params','updateTime','File\x20path\x20is\x20required.','1844468hQgzCp','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','verbose','str','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','scriptType','Preview:\x20create\x20personal\x20BFF\x20','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','string','appCode','3397400PMBEBT','update','version','read','32223FBiITs','Created\x20personal\x20BFF\x20','description','trim','749PcSnhV','15995830KupOrw','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','Preview:\x20update\x20personal\x20BFF\x20'];a35_0x2042=function(){return _0x45b451;};return a35_0x2042();}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_0x477128(0x1d1),'type':a35_0x477128(0x1c2),'description':a35_0x477128(0x1c1)},FUNCTION_NAME_FLAG={'name':a35_0x477128(0x1fb),'type':a35_0x477128(0x1c2),'required':!![],'description':a35_0x477128(0x1ce)},DESCRIPTION_FLAG={'name':'description','type':a35_0x477128(0x1c2),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x477128(0x1d9),'type':a35_0x477128(0x1c2),'description':a35_0x477128(0x1fa)};function normalizeFunctionName(_0x5cf02b){const _0xcec6a2=a35_0x477128,_0x502f1a=String(_0x5cf02b||'')[_0xcec6a2(0x1cb)]();if(!_0x502f1a||!FUNCTION_NAME_PATTERN['test'](_0x502f1a))throw CliErrors['validation'](_0xcec6a2(0x1bb));return _0x502f1a;}function readScriptFile(_0x4e2055){const _0x1432f4=a35_0x477128;if(!_0x4e2055)throw CliErrors[_0x1432f4(0x1f8)](_0x1432f4(0x1fe));if(!existsSync(_0x4e2055))throw CliErrors[_0x1432f4(0x1f8)](_0x1432f4(0x1f2)+_0x4e2055);if(!statSync(_0x4e2055)['isFile']())throw CliErrors['validation'](_0x1432f4(0x1ed)+_0x4e2055);const _0x201c3a=readFileSync(_0x4e2055,_0x1432f4(0x1d5));if(!_0x201c3a['trim']())throw CliErrors[_0x1432f4(0x1f8)](_0x1432f4(0x1e3));return _0x201c3a;}function optionalTrimmed(_0x39e08f){const _0x58607d=a35_0x477128,_0x3b4dd9=String(_0x39e08f||'')[_0x58607d(0x1cb)]();return _0x3b4dd9||undefined;}function summarizeBff(_0x34d71b){const _0x4c6581=a35_0x477128;return{'id':_0x34d71b['id'],'appCode':_0x34d71b[_0x4c6581(0x1c3)],'functionName':_0x34d71b[_0x4c6581(0x1f7)],'description':_0x34d71b[_0x4c6581(0x1ca)],'scriptType':_0x34d71b[_0x4c6581(0x1bf)],'version':_0x34d71b['version'],'gmtModified':_0x34d71b['gmtModified'],'updateTime':_0x34d71b[_0x4c6581(0x1fd)]};}function detailBff(_0x7dc4e4){const _0x44f452=a35_0x477128;return{'id':_0x7dc4e4['id'],'appCode':_0x7dc4e4['appCode'],'functionName':_0x7dc4e4[_0x44f452(0x1f7)],'description':_0x7dc4e4[_0x44f452(0x1ca)],'scriptType':_0x7dc4e4[_0x44f452(0x1bf)],'scriptContent':_0x7dc4e4['scriptContent']??'','config':_0x7dc4e4[_0x44f452(0x1d4)],'version':_0x7dc4e4[_0x44f452(0x1c6)],'createUserId':_0x7dc4e4[_0x44f452(0x1d3)],'gmtCreate':_0x7dc4e4[_0x44f452(0x1e0)],'gmtModified':_0x7dc4e4['gmtModified'],'createTime':_0x7dc4e4[_0x44f452(0x1dd)],'updateTime':_0x7dc4e4['updateTime']};}function buildCreateInput(_0x543376){const _0x30f04e=a35_0x477128;return{'functionName':normalizeFunctionName(_0x543376[_0x30f04e(0x1bd)](_0x30f04e(0x1fb))),...optionalTrimmed(_0x543376[_0x30f04e(0x1bd)](_0x30f04e(0x1ca)))?{'description':optionalTrimmed(_0x543376[_0x30f04e(0x1bd)]('description'))}:{},'scriptContent':readScriptFile(_0x543376['str'](_0x30f04e(0x1d1))),...optionalTrimmed(_0x543376['str'](_0x30f04e(0x1d9)))?{'sourceSessionId':optionalTrimmed(_0x543376[_0x30f04e(0x1bd)]('source-session-id'))}:{}};}function buildUpdateInput(_0xf928da){const _0x2bdc72=a35_0x477128,_0x3916bb={};optionalTrimmed(_0xf928da['str']('name'))&&(_0x3916bb[_0x2bdc72(0x1f7)]=normalizeFunctionName(_0xf928da[_0x2bdc72(0x1bd)]('name')));_0xf928da[_0x2bdc72(0x1f5)](_0x2bdc72(0x1ca))!==undefined&&(_0x3916bb[_0x2bdc72(0x1ca)]=_0xf928da[_0x2bdc72(0x1bd)](_0x2bdc72(0x1ca)));optionalTrimmed(_0xf928da[_0x2bdc72(0x1bd)](_0x2bdc72(0x1d1)))&&(_0x3916bb['scriptContent']=readScriptFile(_0xf928da[_0x2bdc72(0x1bd)](_0x2bdc72(0x1d1))));_0xf928da[_0x2bdc72(0x1f5)](_0x2bdc72(0x1d9))!==undefined&&(_0x3916bb[_0x2bdc72(0x1e5)]=_0xf928da[_0x2bdc72(0x1bd)](_0x2bdc72(0x1d9)));if(Object['keys'](_0x3916bb)['length']===0x0)throw CliErrors[_0x2bdc72(0x1f8)](_0x2bdc72(0x1ea));return _0x3916bb;}function a35_0x3073(_0x426972,_0x2004b0){_0x426972=_0x426972-0x1ba;const _0x204257=a35_0x2042();let _0x307339=_0x204257[_0x426972];return _0x307339;}function parseExecParams(_0x44f0a6){const _0x428c63=a35_0x477128,_0xa0e4ce=parseJsonParams(_0x44f0a6)??{};if(Array[_0x428c63(0x1e4)](_0xa0e4ce))throw CliErrors['validation'](_0x428c63(0x1db));return _0xa0e4ce;}const personalBffList={'service':a35_0x477128(0x1da),'command':a35_0x477128(0x1f4),'description':a35_0x477128(0x1be),'risk':a35_0x477128(0x1c7),'flags':[VERBOSE_FLAG],async 'execute'(_0x293b4e){const _0xfbbefd=a35_0x477128,_0x46f105=await listPersonalBffs(_0x293b4e['appCode']);return{'ok':!![],'data':{'total':_0x46f105[_0xfbbefd(0x1d7)],'items':_0x293b4e['bool'](_0xfbbefd(0x1bc))?_0x46f105:_0x46f105['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x477128(0x1da),'command':a35_0x477128(0x1f3),'description':a35_0x477128(0x1e8),'risk':a35_0x477128(0x1c7),'flags':[{...ID_FLAG,'description':a35_0x477128(0x1f6)}],async 'execute'(_0xc15c2f){const _0x511d9a=a35_0x477128,_0x59e3a5=await getPersonalBff(_0xc15c2f['num']('id'),_0xc15c2f[_0x511d9a(0x1c3)]);return{'ok':!![],'data':detailBff(_0x59e3a5)};}},personalBffCreate={'service':a35_0x477128(0x1da),'command':a35_0x477128(0x1e1),'description':a35_0x477128(0x1e6),'risk':'write','flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x4586e3){const _0x4f1f3f=a35_0x477128,_0x1589c6=buildCreateInput(_0x4586e3),_0x4fa999=await createPersonalBff(_0x4586e3[_0x4f1f3f(0x1c3)],_0x1589c6);return{'ok':!![],'data':detailBff(_0x4fa999),'message':_0x4f1f3f(0x1c9)+_0x4fa999['id']+(_0x4fa999[_0x4f1f3f(0x1f7)]?'\x20('+_0x4fa999[_0x4f1f3f(0x1f7)]+')':'')};},async 'dryRun'(_0x2ad33e){const _0x9f3cf9=a35_0x477128,_0xef65ba=buildCreateInput(_0x2ad33e);return dryRun(_0x9f3cf9(0x1f1),_0x9f3cf9(0x1ec))[_0x9f3cf9(0x1d6)]({'appCode':_0x2ad33e[_0x9f3cf9(0x1c3)],..._0xef65ba})[_0x9f3cf9(0x1ca)](_0x9f3cf9(0x1c0)+_0xef65ba['functionName'])[_0x9f3cf9(0x1dc)]();}},personalBffUpdate={'service':'personal-bff','command':a35_0x477128(0x1c5),'description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':a35_0x477128(0x1ee),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5cd01a){const _0x1120ef=a35_0x477128,_0x5778da=_0x5cd01a[_0x1120ef(0x1f9)]('id'),_0x4fd52e=buildUpdateInput(_0x5cd01a),_0xcc8f05=await updatePersonalBff(_0x5778da,_0x5cd01a[_0x1120ef(0x1c3)],_0x4fd52e);return{'ok':!![],'data':detailBff(_0xcc8f05),'message':_0x1120ef(0x1f0)+_0xcc8f05['id']+(_0xcc8f05[_0x1120ef(0x1f7)]?'\x20('+_0xcc8f05[_0x1120ef(0x1f7)]+')':'')};},async 'dryRun'(_0x1c11a3){const _0x5be3ae=a35_0x477128,_0x59945e=_0x1c11a3['num']('id'),_0x1593a1=buildUpdateInput(_0x1c11a3);return dryRun('POST',_0x5be3ae(0x1de)+_0x59945e+_0x5be3ae(0x1ef))[_0x5be3ae(0x1d6)]({'appCode':_0x1c11a3[_0x5be3ae(0x1c3)],..._0x1593a1})['description'](_0x5be3ae(0x1cf)+_0x59945e)[_0x5be3ae(0x1dc)]();}},personalBffExec={'service':a35_0x477128(0x1da),'command':'exec','description':a35_0x477128(0x1eb),'risk':a35_0x477128(0x1e2),'flags':[{...ID_FLAG,'description':a35_0x477128(0x1f6)},{...PARAMS_FLAG,'description':a35_0x477128(0x1df)}],async 'validate'(_0x2c29af){const _0x4b2b72=a35_0x477128;parseExecParams(_0x2c29af['str'](_0x4b2b72(0x1fc)));},async 'execute'(_0x596edb){const _0x1cbb30=a35_0x477128,_0x58180b=_0x596edb[_0x1cbb30(0x1f9)]('id'),_0x5b2730=parseExecParams(_0x596edb[_0x1cbb30(0x1bd)]('params')),_0x3872b4=await executePersonalBff(_0x58180b,_0x596edb[_0x1cbb30(0x1c3)],_0x5b2730);return{'ok':!![],'data':{'result':_0x3872b4},'message':'Executed\x20personal\x20BFF\x20'+_0x58180b};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a35_0x41d73=a35_0x2c73;(function(_0x2827b8,_0x2f7da7){const _0x2ec4d6=a35_0x2c73,_0x27e65e=_0x2827b8();while(!![]){try{const _0x3ab9f0=-parseInt(_0x2ec4d6(0x13c))/0x1*(-parseInt(_0x2ec4d6(0x12d))/0x2)+parseInt(_0x2ec4d6(0x11d))/0x3*(-parseInt(_0x2ec4d6(0xff))/0x4)+-parseInt(_0x2ec4d6(0x119))/0x5*(parseInt(_0x2ec4d6(0x13e))/0x6)+-parseInt(_0x2ec4d6(0x139))/0x7+-parseInt(_0x2ec4d6(0x11f))/0x8+-parseInt(_0x2ec4d6(0x130))/0x9*(parseInt(_0x2ec4d6(0x129))/0xa)+parseInt(_0x2ec4d6(0x111))/0xb*(parseInt(_0x2ec4d6(0x131))/0xc);if(_0x3ab9f0===_0x2f7da7)break;else _0x27e65e['push'](_0x27e65e['shift']());}catch(_0x43997b){_0x27e65e['push'](_0x27e65e['shift']());}}}(a35_0x341c,0xf3705));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x341c(){const _0x4d079d=['name','map','description','2cqMLov','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','gmtModified','6250527uhIYbS','47565396SPcJXw','detail','keys','File\x20is\x20not\x20a\x20regular\x20file:\x20','read','Updated\x20personal\x20BFF\x20','trim','exec','5267150wsHGGz','Created\x20personal\x20BFF\x20','flag','1926762paqrpB','createUserId','11034alXDxW','update','write','Preview:\x20update\x20personal\x20BFF\x20','/client/runtime-bff/personal/create','416XVskFP','config','source-session-id','appCode','bool','params','build','body','personal-bff','isFile','version','scriptType','functionName','Executed\x20personal\x20BFF\x20','Personal\x20BFF\x20script\x20ID','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','validation','POST','11DLtqfH','list','scriptContent','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','Update\x20a\x20personal\x20BFF\x20by\x20id','Show\x20one\x20personal\x20BFF\x20by\x20id','/client/runtime-bff/personal/','file','1235eOOZqe','num','/update','sourceSessionId','38208XatZlZ','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','13341520WLRCrY','str','Optional\x20source\x20RuntimeAgent\x20session\x20id','isArray','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','Personal\x20BFF\x20script\x20file\x20is\x20blank.','string','length','updateTime','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','10yVQCUY'];a35_0x341c=function(){return _0x4d079d;};return a35_0x341c();}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_0x41d73(0x118),'type':a35_0x41d73(0x125),'description':a35_0x41d73(0x12e)},FUNCTION_NAME_FLAG={'name':a35_0x41d73(0x12a),'type':a35_0x41d73(0x125),'required':!![],'description':'Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders'},DESCRIPTION_FLAG={'name':a35_0x41d73(0x12c),'type':a35_0x41d73(0x125),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0x41d73(0x125),'description':a35_0x41d73(0x121)};function normalizeFunctionName(_0x3529bf){const _0x496d67=a35_0x41d73,_0xb90a34=String(_0x3529bf||'')['trim']();if(!_0xb90a34||!FUNCTION_NAME_PATTERN['test'](_0xb90a34))throw CliErrors[_0x496d67(0x10f)](_0x496d67(0x123));return _0xb90a34;}function readScriptFile(_0x11f904){const _0x541cef=a35_0x41d73;if(!_0x11f904)throw CliErrors[_0x541cef(0x10f)]('File\x20path\x20is\x20required.');if(!existsSync(_0x11f904))throw CliErrors[_0x541cef(0x10f)]('File\x20not\x20found:\x20'+_0x11f904);if(!statSync(_0x11f904)[_0x541cef(0x108)]())throw CliErrors[_0x541cef(0x10f)](_0x541cef(0x134)+_0x11f904);const _0x319ef5=readFileSync(_0x11f904,'utf8');if(!_0x319ef5[_0x541cef(0x137)]())throw CliErrors['validation'](_0x541cef(0x124));return _0x319ef5;}function a35_0x2c73(_0x179b69,_0x1b61d6){_0x179b69=_0x179b69-0xff;const _0x341c90=a35_0x341c();let _0x2c7329=_0x341c90[_0x179b69];return _0x2c7329;}function optionalTrimmed(_0x2ded22){const _0x30c0d1=String(_0x2ded22||'')['trim']();return _0x30c0d1||undefined;}function summarizeBff(_0x51c09c){const _0x357052=a35_0x41d73;return{'id':_0x51c09c['id'],'appCode':_0x51c09c[_0x357052(0x102)],'functionName':_0x51c09c['functionName'],'description':_0x51c09c['description'],'scriptType':_0x51c09c[_0x357052(0x10a)],'version':_0x51c09c[_0x357052(0x109)],'gmtModified':_0x51c09c[_0x357052(0x12f)],'updateTime':_0x51c09c[_0x357052(0x127)]};}function detailBff(_0x47458f){const _0x2c3ead=a35_0x41d73;return{'id':_0x47458f['id'],'appCode':_0x47458f[_0x2c3ead(0x102)],'functionName':_0x47458f[_0x2c3ead(0x10b)],'description':_0x47458f['description'],'scriptType':_0x47458f[_0x2c3ead(0x10a)],'scriptContent':_0x47458f[_0x2c3ead(0x113)]??'','config':_0x47458f[_0x2c3ead(0x100)],'version':_0x47458f[_0x2c3ead(0x109)],'createUserId':_0x47458f[_0x2c3ead(0x13d)],'gmtCreate':_0x47458f['gmtCreate'],'gmtModified':_0x47458f[_0x2c3ead(0x12f)],'createTime':_0x47458f['createTime'],'updateTime':_0x47458f['updateTime']};}function buildCreateInput(_0x11ab00){const _0x504116=a35_0x41d73;return{'functionName':normalizeFunctionName(_0x11ab00[_0x504116(0x120)](_0x504116(0x12a))),...optionalTrimmed(_0x11ab00[_0x504116(0x120)](_0x504116(0x12c)))?{'description':optionalTrimmed(_0x11ab00[_0x504116(0x120)]('description'))}:{},'scriptContent':readScriptFile(_0x11ab00[_0x504116(0x120)]('file')),...optionalTrimmed(_0x11ab00[_0x504116(0x120)](_0x504116(0x101)))?{'sourceSessionId':optionalTrimmed(_0x11ab00[_0x504116(0x120)](_0x504116(0x101)))}:{}};}function buildUpdateInput(_0x4405fb){const _0x16495e=a35_0x41d73,_0x58b80b={};optionalTrimmed(_0x4405fb['str']('name'))&&(_0x58b80b[_0x16495e(0x10b)]=normalizeFunctionName(_0x4405fb[_0x16495e(0x120)](_0x16495e(0x12a))));_0x4405fb[_0x16495e(0x13b)]('description')!==undefined&&(_0x58b80b[_0x16495e(0x12c)]=_0x4405fb[_0x16495e(0x120)]('description'));optionalTrimmed(_0x4405fb[_0x16495e(0x120)](_0x16495e(0x118)))&&(_0x58b80b[_0x16495e(0x113)]=readScriptFile(_0x4405fb[_0x16495e(0x120)](_0x16495e(0x118))));_0x4405fb['flag'](_0x16495e(0x101))!==undefined&&(_0x58b80b[_0x16495e(0x11c)]=_0x4405fb['str'](_0x16495e(0x101)));if(Object[_0x16495e(0x133)](_0x58b80b)['length']===0x0)throw CliErrors[_0x16495e(0x10f)]('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x58b80b;}function parseExecParams(_0x4ec122){const _0x1a3a3e=a35_0x41d73,_0x3a3ad9=parseJsonParams(_0x4ec122)??{};if(Array[_0x1a3a3e(0x122)](_0x3a3ad9))throw CliErrors['validation']('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x3a3ad9;}const personalBffList={'service':a35_0x41d73(0x107),'command':a35_0x41d73(0x112),'description':a35_0x41d73(0x10e),'risk':a35_0x41d73(0x135),'flags':[VERBOSE_FLAG],async 'execute'(_0x459ea5){const _0x36a084=a35_0x41d73,_0x5308fd=await listPersonalBffs(_0x459ea5[_0x36a084(0x102)]);return{'ok':!![],'data':{'total':_0x5308fd[_0x36a084(0x126)],'items':_0x459ea5[_0x36a084(0x103)]('verbose')?_0x5308fd:_0x5308fd[_0x36a084(0x12b)](summarizeBff)}};}},personalBffDetail={'service':a35_0x41d73(0x107),'command':a35_0x41d73(0x132),'description':a35_0x41d73(0x116),'risk':a35_0x41d73(0x135),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'}],async 'execute'(_0x490800){const _0x31fbd0=a35_0x41d73,_0x519eec=await getPersonalBff(_0x490800[_0x31fbd0(0x11a)]('id'),_0x490800[_0x31fbd0(0x102)]);return{'ok':!![],'data':detailBff(_0x519eec)};}},personalBffCreate={'service':a35_0x41d73(0x107),'command':'create','description':a35_0x41d73(0x114),'risk':a35_0x41d73(0x140),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x1fc365){const _0x90288c=a35_0x41d73,_0x278931=buildCreateInput(_0x1fc365),_0x393d8d=await createPersonalBff(_0x1fc365['appCode'],_0x278931);return{'ok':!![],'data':detailBff(_0x393d8d),'message':_0x90288c(0x13a)+_0x393d8d['id']+(_0x393d8d['functionName']?'\x20('+_0x393d8d['functionName']+')':'')};},async 'dryRun'(_0x43a285){const _0x1c6e2b=a35_0x41d73,_0x548041=buildCreateInput(_0x43a285);return dryRun(_0x1c6e2b(0x110),_0x1c6e2b(0x142))[_0x1c6e2b(0x106)]({'appCode':_0x43a285[_0x1c6e2b(0x102)],..._0x548041})[_0x1c6e2b(0x12c)]('Preview:\x20create\x20personal\x20BFF\x20'+_0x548041[_0x1c6e2b(0x10b)])['build']();}},personalBffUpdate={'service':a35_0x41d73(0x107),'command':a35_0x41d73(0x13f),'description':a35_0x41d73(0x115),'risk':a35_0x41d73(0x140),'flags':[{...ID_FLAG,'description':a35_0x41d73(0x10d)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3ca5e6){const _0x267a64=a35_0x41d73,_0x23d970=_0x3ca5e6[_0x267a64(0x11a)]('id'),_0x4e7b2c=buildUpdateInput(_0x3ca5e6),_0x896840=await updatePersonalBff(_0x23d970,_0x3ca5e6[_0x267a64(0x102)],_0x4e7b2c);return{'ok':!![],'data':detailBff(_0x896840),'message':_0x267a64(0x136)+_0x896840['id']+(_0x896840[_0x267a64(0x10b)]?'\x20('+_0x896840['functionName']+')':'')};},async 'dryRun'(_0x27d09f){const _0x563d0f=a35_0x41d73,_0x22633a=_0x27d09f[_0x563d0f(0x11a)]('id'),_0x5636d3=buildUpdateInput(_0x27d09f);return dryRun('POST',_0x563d0f(0x117)+_0x22633a+_0x563d0f(0x11b))[_0x563d0f(0x106)]({'appCode':_0x27d09f['appCode'],..._0x5636d3})['description'](_0x563d0f(0x141)+_0x22633a)[_0x563d0f(0x105)]();}},personalBffExec={'service':a35_0x41d73(0x107),'command':a35_0x41d73(0x138),'description':a35_0x41d73(0x11e),'risk':'high-risk-write','flags':[{...ID_FLAG,'description':a35_0x41d73(0x10d)},{...PARAMS_FLAG,'description':a35_0x41d73(0x128)}],async 'validate'(_0x127602){const _0x5e33e0=a35_0x41d73;parseExecParams(_0x127602[_0x5e33e0(0x120)](_0x5e33e0(0x104)));},async 'execute'(_0x146a29){const _0x26454a=a35_0x41d73,_0x2197ca=_0x146a29['num']('id'),_0x4e33a1=parseExecParams(_0x146a29[_0x26454a(0x120)](_0x26454a(0x104))),_0x327d39=await executePersonalBff(_0x2197ca,_0x146a29[_0x26454a(0x102)],_0x4e33a1);return{'ok':!![],'data':{'result':_0x327d39},'message':_0x26454a(0x10c)+_0x2197ca};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a36_0x160942=a36_0x2138;(function(_0x109c93,_0x5dcb44){const _0x365565=a36_0x2138,_0xe5d422=_0x109c93();while(!![]){try{const _0x188aa7=parseInt(_0x365565(0xb2))/0x1+parseInt(_0x365565(0xc3))/0x2+parseInt(_0x365565(0xc1))/0x3*(-parseInt(_0x365565(0xc6))/0x4)+-parseInt(_0x365565(0xaa))/0x5*(-parseInt(_0x365565(0xa5))/0x6)+parseInt(_0x365565(0xb6))/0x7+parseInt(_0x365565(0xa6))/0x8+-parseInt(_0x365565(0xba))/0x9;if(_0x188aa7===_0x5dcb44)break;else _0xe5d422['push'](_0xe5d422['shift']());}catch(_0x58eaaf){_0xe5d422['push'](_0xe5d422['shift']());}}}(a36_0x10ff,0xda54c));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';function a36_0x2138(_0x154054,_0x18ddae){_0x154054=_0x154054-0xa2;const _0x10ff29=a36_0x10ff();let _0x2138ed=_0x10ff29[_0x154054];return _0x2138ed;}import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x6dbab2){const _0x51c33a=a36_0x2138;for(const _0x4ccb71 of _0x6dbab2){definitions[_0x51c33a(0xb1)](_0x4ccb71[_0x51c33a(0xc9)]+':'+_0x4ccb71[_0x51c33a(0xa3)],_0x4ccb71);let _0x4b3578=serviceGroups[_0x51c33a(0xc4)](_0x4ccb71[_0x51c33a(0xc9)]);!_0x4b3578&&(_0x4b3578=[],serviceGroups[_0x51c33a(0xb1)](_0x4ccb71[_0x51c33a(0xc9)],_0x4b3578)),_0x4b3578[_0x51c33a(0xbe)](_0x4ccb71);}}function registerService(_0x2e0089,_0x53476e,_0xae0b17){const _0x3a9a73=a36_0x2138;registerDefinitions(_0x53476e);const _0x5d8b0c=_0x3f38e9=>_0x3f38e9===_0x3a9a73(0xaf)?'':_0x3f38e9===_0x3a9a73(0xb0)?_0x3a9a73(0xa2):'\x20\x20[high-risk-write]',_0x482340={'service':_0x53476e[0x0][_0x3a9a73(0xc9)],'label':_0x2e0089,'commands':_0x53476e['map'](_0x496719=>({'command':_0x496719[_0x3a9a73(0xa3)],'description':_0x496719[_0x3a9a73(0xc0)],'tag':_0x5d8b0c(_0x496719[_0x3a9a73(0xc5)])})),'defaultCommand':_0xae0b17?.[_0x3a9a73(0xad)]??(_0xae0b17?.[_0x3a9a73(0xb3)]?_0x53476e[0x0]['command']:undefined),'isSingleCommand':_0xae0b17?.[_0x3a9a73(0xb3)]};serviceRegistry[_0x3a9a73(0xbe)](_0x482340),serviceByName['set'](_0x482340[_0x3a9a73(0xc9)],_0x482340);}registerService('Authentication',authDefinitions,{'defaultCommand':'login'}),registerService(a36_0x160942(0xb9),appDefinitions,{'defaultCommand':a36_0x160942(0xcc)}),registerService(a36_0x160942(0xab),workspaceDefinitions),registerService(a36_0x160942(0xbf),appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a36_0x160942(0xcc)}),registerService('API\x20Documentation',apiDocDefinitions),registerService(a36_0x160942(0xa8),datasetDefinitions),registerService(a36_0x160942(0xca),dataDefinitions),registerService(a36_0x160942(0xc8),sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService(a36_0x160942(0xae),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x160942(0xc2),fileDefinitions),registerService(a36_0x160942(0xcb),ocrDefinitions),registerService(a36_0x160942(0xbd),kbDefinitions),registerService(a36_0x160942(0xa4),serviceDefinitions,{'defaultCommand':a36_0x160942(0xcc)}),registerService(a36_0x160942(0xbc),skillDefinitions,{'defaultCommand':a36_0x160942(0xb5)}),registerService(a36_0x160942(0xbb),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x160942(0xb7),[updateDefinition],{'defaultCommand':a36_0x160942(0xb8),'isSingleCommand':!![]}),registerService(a36_0x160942(0xac),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x160942(0xa9),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x160942(0xc7),logsDefinitions,{'defaultCommand':a36_0x160942(0xa7)});export function findDefinition(_0x5ac63c,_0x45841c){return definitions['get'](_0x5ac63c+':'+_0x45841c);}export function isKnownService(_0x5bd5b1){const _0x55a84d=a36_0x160942;return serviceByName[_0x55a84d(0xb4)](_0x5bd5b1);}export function getServiceEntry(_0x40a40c){const _0x565c93=a36_0x160942;return serviceByName[_0x565c93(0xc4)](_0x40a40c);}function a36_0x10ff(){const _0x41c17f=['38957553jJrqPF','CLI\x20Built-in\x20Skill','Skills','Knowledge\x20Base','push','Runtime\x20App\x20Config','description','12blyMWC','File','2155128nSzrRG','get','risk','925032RyjRIb','Logs','SQL\x20Queries','service','Instant\x20API','OCR','list','\x20\x20[write]','command','Service\x20Tree','10649202iCbJsy','4727776nJqhXF','show','Datasets','Schema','5tOxUpN','Workspace','Diagnostics','defaultCommand','Personal\x20BFF','read','write','set','1645913SOAdOl','isSingleCommand','has','install','7410319PsDdgG','Self\x20Update','run','App\x20Management'];a36_0x10ff=function(){return _0x41c17f;};return a36_0x10ff();}export function getAllDefinitions(){return Array['from'](definitions['values']());}
1
+ const a36_0x27cb1d=a36_0x4c86;(function(_0x27b8f7,_0x1aa53e){const _0xc94421=a36_0x4c86,_0x3383d3=_0x27b8f7();while(!![]){try{const _0x344f8c=parseInt(_0xc94421(0x12e))/0x1*(-parseInt(_0xc94421(0x143))/0x2)+-parseInt(_0xc94421(0x13a))/0x3+-parseInt(_0xc94421(0x131))/0x4+-parseInt(_0xc94421(0x152))/0x5*(parseInt(_0xc94421(0x13d))/0x6)+parseInt(_0xc94421(0x147))/0x7+-parseInt(_0xc94421(0x133))/0x8*(parseInt(_0xc94421(0x130))/0x9)+-parseInt(_0xc94421(0x154))/0xa*(-parseInt(_0xc94421(0x144))/0xb);if(_0x344f8c===_0x1aa53e)break;else _0x3383d3['push'](_0x3383d3['shift']());}catch(_0x1fe264){_0x3383d3['push'](_0x3383d3['shift']());}}}(a36_0x2390,0xb340e));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';function a36_0x2390(){const _0x4b2551=['Logs','API\x20Documentation','map','command','OCR','497002PvRWts','SQL\x20Queries','522999zGlbep','5177840QXKKlI','has','16CIEUBm','\x20\x20[high-risk-write]','Service\x20Tree','Datasets','list','install','App\x20Management','3162867vLyUEv','Personal\x20BFF','from','24aQUsCb','get','Configuration','show','BFF\x20Scripts','isSingleCommand','4uerdwB','14291607Nztxcd','Authentication','Knowledge\x20Base','730527UzzbUF','login','service','Runtime\x20App\x20Config','Diagnostics','defaultCommand','Schema','Self\x20Update','Artifacts','push','set','1385140ZdPNkp','CLI\x20Built-in\x20Skill','40pxUUhd'];a36_0x2390=function(){return _0x4b2551;};return a36_0x2390();}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';function a36_0x4c86(_0x270c31,_0x2edc34){_0x270c31=_0x270c31-0x129;const _0x239048=a36_0x2390();let _0x4c866b=_0x239048[_0x270c31];return _0x4c866b;}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(_0x8d6734){const _0x33b70b=a36_0x4c86;for(const _0x1da23f of _0x8d6734){definitions[_0x33b70b(0x151)](_0x1da23f[_0x33b70b(0x149)]+':'+_0x1da23f[_0x33b70b(0x12c)],_0x1da23f);let _0x2a8444=serviceGroups[_0x33b70b(0x13e)](_0x1da23f[_0x33b70b(0x149)]);!_0x2a8444&&(_0x2a8444=[],serviceGroups[_0x33b70b(0x151)](_0x1da23f['service'],_0x2a8444)),_0x2a8444['push'](_0x1da23f);}}function registerService(_0xb27f55,_0x2a68ec,_0x47495b){const _0x48cbdf=a36_0x4c86;registerDefinitions(_0x2a68ec);const _0x18062d=_0x46f83b=>_0x46f83b==='read'?'':_0x46f83b==='write'?'\x20\x20[write]':_0x48cbdf(0x134),_0x409556={'service':_0x2a68ec[0x0][_0x48cbdf(0x149)],'label':_0xb27f55,'commands':_0x2a68ec[_0x48cbdf(0x12b)](_0x4225f9=>({'command':_0x4225f9[_0x48cbdf(0x12c)],'description':_0x4225f9['description'],'tag':_0x18062d(_0x4225f9['risk'])})),'defaultCommand':_0x47495b?.[_0x48cbdf(0x14c)]??(_0x47495b?.[_0x48cbdf(0x142)]?_0x2a68ec[0x0][_0x48cbdf(0x12c)]:undefined),'isSingleCommand':_0x47495b?.['isSingleCommand']};serviceRegistry[_0x48cbdf(0x150)](_0x409556),serviceByName[_0x48cbdf(0x151)](_0x409556[_0x48cbdf(0x149)],_0x409556);}registerService(a36_0x27cb1d(0x145),authDefinitions,{'defaultCommand':a36_0x27cb1d(0x148)}),registerService(a36_0x27cb1d(0x139),appDefinitions,{'defaultCommand':'list'}),registerService('Workspace',workspaceDefinitions),registerService(a36_0x27cb1d(0x14a),appConfigDefinitions),registerService(a36_0x27cb1d(0x13f),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x27cb1d(0x12a),apiDocDefinitions),registerService(a36_0x27cb1d(0x136),datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService(a36_0x27cb1d(0x12f),sqlDefinitions),registerService(a36_0x27cb1d(0x141),bffDefinitions),registerService(a36_0x27cb1d(0x13b),personalBffDefinitions),registerService(a36_0x27cb1d(0x14f),artifactDefinitions),registerService('File',fileDefinitions),registerService(a36_0x27cb1d(0x12d),ocrDefinitions),registerService(a36_0x27cb1d(0x146),kbDefinitions),registerService(a36_0x27cb1d(0x135),serviceDefinitions,{'defaultCommand':a36_0x27cb1d(0x137)}),registerService('Skills',skillDefinitions,{'defaultCommand':a36_0x27cb1d(0x138)}),registerService(a36_0x27cb1d(0x153),cliSkillDefinitions,{'defaultCommand':a36_0x27cb1d(0x138)}),registerService(a36_0x27cb1d(0x14e),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a36_0x27cb1d(0x14b),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x27cb1d(0x14d),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x27cb1d(0x129),logsDefinitions,{'defaultCommand':a36_0x27cb1d(0x140)});export function findDefinition(_0x579be4,_0x22af48){const _0x41617e=a36_0x27cb1d;return definitions[_0x41617e(0x13e)](_0x579be4+':'+_0x22af48);}export function isKnownService(_0x1ce8a4){const _0x36c735=a36_0x27cb1d;return serviceByName[_0x36c735(0x132)](_0x1ce8a4);}export function getServiceEntry(_0x3f4f96){const _0x1c7d80=a36_0x27cb1d;return serviceByName[_0x1c7d80(0x13e)](_0x3f4f96);}export function getAllDefinitions(){const _0x738de6=a36_0x27cb1d;return Array[_0x738de6(0x13c)](definitions['values']());}
@@ -1 +1 @@
1
- const a37_0x13d0b6=a37_0x7148;function a37_0x7148(_0xac95a3,_0x139e97){_0xac95a3=_0xac95a3-0xb0;const _0x4dc5a4=a37_0x4dc5();let _0x714830=_0x4dc5a4[_0xac95a3];return _0x714830;}function a37_0x4dc5(){const _0x1005d6=['909128uDJSxj','12zRaiua','871312XJLjmZ','1711962PiWRyC','2555IrmfyW','753632gqvgdk','1650777UzeSsu','1533300sdmTjt','schema','export','Export\x20machine-readable\x20command\x20schema\x20(JSON)','84iQqtKX','3516uxzaJT'];a37_0x4dc5=function(){return _0x1005d6;};return a37_0x4dc5();}(function(_0x326d8a,_0x1a52d4){const _0x4e0729=a37_0x7148,_0x5154dd=_0x326d8a();while(!![]){try{const _0x3ad1ee=parseInt(_0x4e0729(0xb1))/0x1+-parseInt(_0x4e0729(0xba))/0x2+-parseInt(_0x4e0729(0xb9))/0x3*(-parseInt(_0x4e0729(0xb0))/0x4)+parseInt(_0x4e0729(0xbc))/0x5*(parseInt(_0x4e0729(0xb7))/0x6)+-parseInt(_0x4e0729(0xb6))/0x7*(parseInt(_0x4e0729(0xb8))/0x8)+-parseInt(_0x4e0729(0xbb))/0x9+parseInt(_0x4e0729(0xb2))/0xa;if(_0x3ad1ee===_0x1a52d4)break;else _0x5154dd['push'](_0x5154dd['shift']());}catch(_0x4119ae){_0x5154dd['push'](_0x5154dd['shift']());}}}(a37_0x4dc5,0xd3d23));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x3937b3){const _0x9713bc=await buildSchemaPayload();return{'ok':!![],'data':_0x9713bc};}export const schemaDefinition={'service':a37_0x13d0b6(0xb3),'command':a37_0x13d0b6(0xb4),'description':a37_0x13d0b6(0xb5),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a37_0x3a3b2f=a37_0x1ebd;function a37_0x1ebd(_0x2eceed,_0x385714){_0x2eceed=_0x2eceed-0x140;const _0x234f61=a37_0x234f();let _0x1ebd98=_0x234f61[_0x2eceed];return _0x1ebd98;}(function(_0x4e0ab5,_0x4c9b23){const _0x360f1f=a37_0x1ebd,_0x3c25e2=_0x4e0ab5();while(!![]){try{const _0x33e6df=-parseInt(_0x360f1f(0x149))/0x1+-parseInt(_0x360f1f(0x147))/0x2*(-parseInt(_0x360f1f(0x148))/0x3)+-parseInt(_0x360f1f(0x145))/0x4+parseInt(_0x360f1f(0x144))/0x5+-parseInt(_0x360f1f(0x14b))/0x6+parseInt(_0x360f1f(0x140))/0x7*(parseInt(_0x360f1f(0x14a))/0x8)+-parseInt(_0x360f1f(0x142))/0x9*(parseInt(_0x360f1f(0x143))/0xa);if(_0x33e6df===_0x4c9b23)break;else _0x3c25e2['push'](_0x3c25e2['shift']());}catch(_0x3c2f5e){_0x3c25e2['push'](_0x3c25e2['shift']());}}}(a37_0x234f,0xb3ef3));function a37_0x234f(){const _0x346769=['135732qyUyUc','28091JWRRSI','3336NhuInC','4288914qMFZpy','9317HariwN','export','2367ChzrBF','17740VcRPjz','5571005sUKOaj','338788uLCAws','read','16uTDhKa'];a37_0x234f=function(){return _0x346769;};return a37_0x234f();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5a1158){const _0x2752b5=await buildSchemaPayload();return{'ok':!![],'data':_0x2752b5};}export const schemaDefinition={'service':'schema','command':a37_0x3a3b2f(0x141),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a37_0x3a3b2f(0x146),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- (function(_0x302bcb,_0x4c3ef1){const _0x5714e0=a38_0x168b,_0x55f19d=_0x302bcb();while(!![]){try{const _0xe2840d=parseInt(_0x5714e0(0x110))/0x1+-parseInt(_0x5714e0(0xf9))/0x2*(parseInt(_0x5714e0(0x11b))/0x3)+-parseInt(_0x5714e0(0xe5))/0x4+-parseInt(_0x5714e0(0x10c))/0x5+-parseInt(_0x5714e0(0xed))/0x6+parseInt(_0x5714e0(0xd6))/0x7*(-parseInt(_0x5714e0(0x12d))/0x8)+parseInt(_0x5714e0(0xea))/0x9;if(_0xe2840d===_0x4c3ef1)break;else _0x55f19d['push'](_0x55f19d['shift']());}catch(_0xa72cb){_0x55f19d['push'](_0x55f19d['shift']());}}}(a38_0x2942,0xbc3f0));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(_0x426c29,_0x557853){const _0x1ad5f7=a38_0x168b,_0x57bd52=listLocalServiceTrees();let _0x973a10;for(const _0x1dd4f7 of _0x57bd52){const _0x48bc11=matchServiceTreeCommand(_0x1dd4f7,_0x426c29);if(!_0x48bc11)continue;(!_0x973a10||_0x48bc11[_0x1ad5f7(0x109)]['fullPath'][_0x1ad5f7(0x116)]>_0x973a10[_0x1ad5f7(0x109)][_0x1ad5f7(0x102)][_0x1ad5f7(0x116)])&&(_0x973a10={'tree':_0x1dd4f7,'command':_0x48bc11[_0x1ad5f7(0x109)],'remainingArgs':_0x48bc11['remainingArgs']});}if(!_0x973a10)return undefined;const _0x3cc807={..._0x557853};return applyAppBinding(_0x973a10['tree'],_0x973a10[_0x1ad5f7(0x109)],_0x3cc807),{'definition':buildDynamicCommandDefinition(_0x973a10['tree'],_0x973a10['command']),'args':_0x973a10['remainingArgs'],'flags':_0x3cc807,'tree':_0x973a10['tree'],'command':_0x973a10[_0x1ad5f7(0x109)]};}export function generateDynamicServiceHelp(_0x1dc76a){const _0x349023=a38_0x168b,_0x2c6ef3=listLocalServiceTrees()[_0x349023(0x105)](_0x3c3440=>_0x3c3440[_0x349023(0x115)]['code']===_0x1dc76a);if(!_0x2c6ef3)return undefined;const _0x4d42e1=[CLI_BIN_NAME+'\x20'+_0x1dc76a+'\x20<command>\x20[flags]','',_0x2c6ef3[_0x349023(0x115)][_0x349023(0x104)]||_0x1dc76a,_0x2c6ef3[_0x349023(0x115)][_0x349023(0x126)]?'\x20\x20'+_0x2c6ef3[_0x349023(0x115)][_0x349023(0x126)]:'','',_0x349023(0x128),..._0x2c6ef3[_0x349023(0x118)][_0x349023(0x129)](_0x30a7fb=>{const _0x4d5e35=_0x349023,_0x438486=_0x30a7fb[_0x4d5e35(0x102)][_0x4d5e35(0x119)](0x1)[_0x4d5e35(0x11e)]('\x20'),_0x5d5e7a=_0x30a7fb[_0x4d5e35(0x130)]===_0x4d5e35(0x12b)?'':'\x20['+_0x30a7fb[_0x4d5e35(0x130)]+']';return'\x20\x20'+_0x438486[_0x4d5e35(0xd3)](0x18)+'\x20'+(_0x30a7fb[_0x4d5e35(0x126)]||'')+_0x5d5e7a;}),'',_0x349023(0x12c)+CLI_BIN_NAME+_0x349023(0xd8)+_0x1dc76a+_0x349023(0xe6)][_0x349023(0xdd)](Boolean);return _0x4d42e1['join']('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x46c450=>{const _0x34a9b4=a38_0x168b,_0x270e8d=_0x46c450['normalizedManifest'];return{'service':_0x270e8d[_0x34a9b4(0x115)]['code'],'label':_0x270e8d[_0x34a9b4(0x115)][_0x34a9b4(0x104)]||_0x270e8d['service'][_0x34a9b4(0x12e)],'commands':_0x270e8d[_0x34a9b4(0x118)][_0x34a9b4(0x129)](_0x1a821a=>({'command':dynamicCommandName(_0x1a821a),'description':_0x1a821a[_0x34a9b4(0x126)]||_0x34a9b4(0x117)+_0x1a821a[_0x34a9b4(0xeb)],'tag':riskTag(_0x1a821a[_0x34a9b4(0x130)])}))};});}export function getDynamicServiceEntry(_0x26193c){const _0x455291=a38_0x168b;return listDynamicServiceEntries()[_0x455291(0x105)](_0x121d17=>_0x121d17['service']===_0x26193c);}export function listDynamicServiceDefinitions(_0x26fc10){const _0x1e9dbb=a38_0x168b;return listLocalServiceTrees()[_0x1e9dbb(0xdd)](_0x3d1e8b=>!_0x26fc10||_0x3d1e8b[_0x1e9dbb(0x115)]['code']===_0x26fc10)[_0x1e9dbb(0x11f)](_0x36daa9=>_0x36daa9['commands'][_0x1e9dbb(0x129)](_0xa0ba72=>buildDynamicCommandDefinition(_0x36daa9,_0xa0ba72)));}export function getDynamicServiceDefinitions(_0x3d5395){const _0x2f678=listDynamicServiceDefinitions(_0x3d5395);return _0x2f678['length']>0x0?_0x2f678:undefined;}export function findDynamicServiceDefinition(_0x1c6e9a,_0x53726b){const _0x5e7c8e=a38_0x168b;return listDynamicServiceDefinitions(_0x1c6e9a)[_0x5e7c8e(0x105)](_0x5b414a=>_0x5b414a[_0x5e7c8e(0x109)]===_0x53726b);}export function buildDynamicCommandDefinition(_0x367035,_0x58157f){const _0x92318e=a38_0x168b;return{'service':_0x367035[_0x92318e(0x115)][_0x92318e(0x12e)],'command':dynamicCommandName(_0x58157f),'description':_0x58157f[_0x92318e(0x126)]||'Run\x20service\x20command\x20'+_0x58157f[_0x92318e(0xeb)],'risk':_0x58157f[_0x92318e(0x130)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x58157f[_0x92318e(0x10b)][_0x92318e(0x129)](_0x22b300=>({'name':_0x22b300[_0x92318e(0x104)],'description':_0x22b300[_0x92318e(0x126)]||_0x22b300[_0x92318e(0x104)],'required':_0x22b300[_0x92318e(0x124)]})),'flags':_0x58157f[_0x92318e(0x125)][_0x92318e(0x129)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x58157f),async 'dryRun'(_0x8d483){const _0x27204b=_0x92318e,_0x36dd11=await compilePlan(_0x58157f,_0x8d483);return{'method':_0x27204b(0x11d),'url':_0x58157f['cliPath'],'body':{'target':targetPreview(_0x36dd11),'params':_0x36dd11[_0x27204b(0xee)]},'description':_0x27204b(0xe2)+_0x58157f['cliPath']};},async 'execute'(_0x2c41fa){const _0x4c75af=_0x92318e,_0x407513=await compilePlan(_0x58157f,_0x2c41fa),_0xae7900=Date[_0x4c75af(0x112)](),_0x192b03=await executePlan(_0x407513,_0x58157f,_0x2c41fa),_0x30c004=Date[_0x4c75af(0x112)]()-_0xae7900;return{'ok':!![],'data':{'service':_0x367035['service'],'command':_0x58157f['cliPath'],'target':targetPreview(_0x407513),'result':_0x192b03,'elapsed':_0x30c004},'message':_0x4c75af(0x114)+_0x58157f[_0x4c75af(0xeb)]+'\x20completed\x20in\x20'+_0x30c004+'ms'};}};}function a38_0x2942(){const _0x1000a8=['mapTo','\x20\x20MAP\x20TO','1480036hLjOUx','bffId','now','rawFlags','Service\x20command\x20','service','length','Run\x20service\x20command\x20','commands','slice','Cannot\x20resolve\x20datatable\x20\x22','33SftHdQ','bffCode','SERVICE_TREE','join','flatMap','Unsupported\x20service\x20target\x20kind:\x20','boolean','\x20->\x20','nickName','required','flags','description','userId','Commands:','map','startsWith','read','Use\x20`','72OFLbKQ','code','validation','risk','scriptName','some','padEnd','trim','userName','816515UrLHIZ','envName','\x20service\x20detail\x20--service\x20','\x20\x20\x20\x20datatable:\x20','operator','sqlCode','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','filter','json','\x20\x20SERVICE\x20TREE\x20TARGET','appCode','\x20requires\x20target.scriptName.','Preview\x20dynamic\x20service\x20command:\x20','username','string','2288568kUiJiy','`\x20to\x20inspect\x20the\x20manifest.','employeeId','\x20\x20\x20\x20','default','23070276TGGzPQ','cliPath','fromEntries','1105698kUgnoM','params','loginName','target','datasetCode','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','data','appRef','appcode','datatable','app','push','153638ocDyiJ','bff','Unknown\x20appRef\x20\x22','kind','\x22\x20in\x20service\x20command\x20','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','\x20\x20\x20\x20command:\x20','env','type','fullPath','context.','name','find','source','tableName','nickname','command','tenantCode','args','3105525jHiiQt','enum'];a38_0x2942=function(){return _0x1000a8;};return a38_0x2942();}function dynamicCommandName(_0x4f67e7){const _0x55bfd0=a38_0x168b;return _0x4f67e7[_0x55bfd0(0x102)][_0x55bfd0(0x119)](0x1)['join']('\x20');}function riskTag(_0x2caf4f){const _0x590ac4=a38_0x168b;return _0x2caf4f===_0x590ac4(0x12b)?'':'\x20\x20['+_0x2caf4f+']';}function flagToCommandFlag(_0x54cad7){const _0xe90e4e=a38_0x168b;return{'name':_0x54cad7['cliName'],'type':_0x54cad7[_0xe90e4e(0x101)]===_0xe90e4e(0xde)?_0xe90e4e(0xe4):_0x54cad7[_0xe90e4e(0x101)],'description':_0x54cad7['description']||_0x54cad7['name'],'required':_0x54cad7[_0xe90e4e(0x124)],'default':isPrimitiveFlagDefault(_0x54cad7[_0xe90e4e(0xe9)])?_0x54cad7[_0xe90e4e(0xe9)]:undefined,'enum':_0x54cad7[_0xe90e4e(0x10d)]};}async function compilePlan(_0x231282,_0x5852b2){const _0x4e87e6=a38_0x168b;return compileServiceTreeCommand(_0x231282,{'flags':_0x5852b2[_0x4e87e6(0x113)],'args':_0x5852b2['args'],'context':await buildServiceContext(_0x231282,_0x5852b2)});}async function buildServiceContext(_0x2167e2,_0x4ee594){const _0x2a517e=a38_0x168b,_0xc06c67={'appCode':_0x4ee594['appCode'],'env':_0x4ee594[_0x2a517e(0xd7)],'envName':_0x4ee594['envName']};if(!usesRuntimeContext(_0x2167e2))return _0xc06c67;const _0x275bc5=await getLoginUserInfo(),_0x4ad6a7=pickFirst(_0x275bc5[_0x2a517e(0x127)],_0x275bc5['id']);return{..._0xc06c67,'user':_0x275bc5,'userId':_0x4ad6a7,'id':_0x275bc5['id'],'username':pickFirst(_0x275bc5[_0x2a517e(0xe3)],_0x275bc5[_0x2a517e(0xd5)],_0x275bc5[_0x2a517e(0xef)]),'userName':_0x275bc5[_0x2a517e(0xd5)],'nickname':pickFirst(_0x275bc5[_0x2a517e(0x108)],_0x275bc5[_0x2a517e(0x123)]),'nickName':_0x275bc5['nickName'],'tenantCode':_0x275bc5[_0x2a517e(0x10a)],'employeeId':_0x275bc5[_0x2a517e(0xe7)]};}function usesRuntimeContext(_0x479eed){const _0x50e697=a38_0x168b;return _0x479eed[_0x50e697(0x10e)][_0x50e697(0xd2)](_0x3faa81=>typeof _0x3faa81['source']===_0x50e697(0xe4)&&(_0x3faa81[_0x50e697(0x106)][_0x50e697(0x12a)](_0x50e697(0x103))||_0x3faa81[_0x50e697(0x106)]['startsWith']('ctx.')));}function pickFirst(..._0x1b5c17){const _0x1ea69b=a38_0x168b;return _0x1b5c17[_0x1ea69b(0x105)](_0x594bb0=>_0x594bb0!==undefined&&_0x594bb0!==null);}async function executePlan(_0x26532a,_0x4a21ee,_0x1c6eb2){const _0x1bc1e7=a38_0x168b;if(_0x26532a[_0x1bc1e7(0xfc)]===_0x1bc1e7(0xf3)){const _0x497f79=await resolveDatasetCode(_0x26532a,_0x4a21ee,_0x1c6eb2);return executeData(_0x497f79,_0x26532a[_0x1bc1e7(0x109)],_0x26532a[_0x1bc1e7(0xee)]);}if(_0x26532a['kind']==='sql'){if(!_0x26532a[_0x1bc1e7(0xdb)])throw CliErrors[_0x1bc1e7(0x12f)](_0x1bc1e7(0x114)+_0x4a21ee[_0x1bc1e7(0xeb)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x26532a[_0x1bc1e7(0xdb)],normalizeScalarParams(_0x26532a[_0x1bc1e7(0xee)]));}if(_0x26532a[_0x1bc1e7(0xfc)]===_0x1bc1e7(0xfa)){const _0x558657=_0x26532a[_0x1bc1e7(0x131)]||_0x26532a[_0x1bc1e7(0x11c)]||(_0x26532a[_0x1bc1e7(0x111)]==null?'':String(_0x26532a['bffId']));if(!_0x558657)throw CliErrors[_0x1bc1e7(0x12f)](_0x1bc1e7(0x114)+_0x4a21ee[_0x1bc1e7(0xeb)]+_0x1bc1e7(0xe1));return executeSdkBff(_0x558657,_0x26532a['params']);}throw CliErrors[_0x1bc1e7(0x12f)](_0x1bc1e7(0x120)+_0x26532a[_0x1bc1e7(0xfc)]);}async function resolveDatasetCode(_0x8a8061,_0x5a0424,_0x1a2f26){const _0x31ee4f=a38_0x168b;if(_0x8a8061[_0x31ee4f(0xf1)])return _0x8a8061[_0x31ee4f(0xf1)];if(!_0x8a8061[_0x31ee4f(0xf6)])throw CliErrors[_0x31ee4f(0x12f)](_0x31ee4f(0x114)+_0x5a0424[_0x31ee4f(0xeb)]+_0x31ee4f(0xdc));const _0x47e76d=await listDatasets(_0x1a2f26[_0x31ee4f(0xe0)]),_0x3593a3=_0x47e76d['find'](_0xf5665d=>_0xf5665d['dbtableConfig']?.[_0x31ee4f(0x107)]===_0x8a8061['datatable']);if(!_0x3593a3?.['code'])throw CliErrors[_0x31ee4f(0x12f)](_0x31ee4f(0x11a)+_0x8a8061[_0x31ee4f(0xf6)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x1a2f26[_0x31ee4f(0xe0)]+'.',_0x31ee4f(0xf2));return _0x3593a3[_0x31ee4f(0x12e)];}function applyAppBinding(_0x472494,_0xbc9c87,_0x4e1ccf){const _0x463589=a38_0x168b,_0x43b0e9=_0xbc9c87[_0x463589(0xf0)][_0x463589(0xf4)];if(!_0x43b0e9)return;const _0x52b1cc=_0x472494['appBindings'][_0x43b0e9];if(!_0x52b1cc)throw CliErrors[_0x463589(0x12f)](_0x463589(0xfb)+_0x43b0e9+_0x463589(0xfd)+_0xbc9c87['cliPath']+'.',_0x463589(0xfe));const _0x27381c=_0x52b1cc[_0x463589(0xf5)]||_0x52b1cc[_0x463589(0xe0)];_0x27381c&&!hasText(_0x4e1ccf['appcode'])&&(_0x4e1ccf['appcode']=_0x27381c),_0x52b1cc[_0x463589(0xf7)]&&!hasText(_0x4e1ccf[_0x463589(0xf7)])&&!hasText(_0x4e1ccf['appcode'])&&(_0x4e1ccf[_0x463589(0xf7)]=_0x52b1cc['app']),_0x52b1cc['env']&&!hasText(_0x4e1ccf['env'])&&(_0x4e1ccf[_0x463589(0x100)]=_0x52b1cc[_0x463589(0x100)]);}function a38_0x168b(_0x2267b3,_0x5ac179){_0x2267b3=_0x2267b3-0xd2;const _0x2942af=a38_0x2942();let _0x168b36=_0x2942af[_0x2267b3];return _0x168b36;}function renderDynamicCommandHelp(_0x4b855f){const _0x1214aa=a38_0x168b,_0x35cdb8=[_0x1214aa(0xdf),'\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x4b855f[_0x1214aa(0xf0)][_0x1214aa(0xfc)],_0x1214aa(0xff)+_0x4b855f[_0x1214aa(0xf0)][_0x1214aa(0x109)]];if(_0x4b855f[_0x1214aa(0xf0)]['datasetCode'])_0x35cdb8[_0x1214aa(0xf8)]('\x20\x20\x20\x20datasetCode:\x20'+_0x4b855f[_0x1214aa(0xf0)]['datasetCode']);if(_0x4b855f[_0x1214aa(0xf0)][_0x1214aa(0xf6)])_0x35cdb8['push'](_0x1214aa(0xd9)+_0x4b855f[_0x1214aa(0xf0)][_0x1214aa(0xf6)]);if(_0x4b855f['target'][_0x1214aa(0xdb)])_0x35cdb8['push']('\x20\x20\x20\x20sqlCode:\x20'+_0x4b855f[_0x1214aa(0xf0)][_0x1214aa(0xdb)]);if(_0x4b855f['target']['scriptName'])_0x35cdb8[_0x1214aa(0xf8)]('\x20\x20\x20\x20scriptName:\x20'+_0x4b855f['target'][_0x1214aa(0x131)]);if(_0x4b855f[_0x1214aa(0x10e)][_0x1214aa(0x116)]>0x0){_0x35cdb8[_0x1214aa(0xf8)]('',_0x1214aa(0x10f));for(const _0x398e25 of _0x4b855f['mapTo']){_0x35cdb8['push'](_0x1214aa(0xe8)+(_0x398e25['source']||'const')+_0x1214aa(0x122)+_0x398e25[_0x1214aa(0xf0)]+(_0x398e25[_0x1214aa(0xda)]?'.'+_0x398e25['operator']:''));}}return _0x35cdb8['join']('\x0a');}function targetPreview(_0x423db7){const _0x229919=a38_0x168b;return{'kind':_0x423db7['kind'],'command':_0x423db7[_0x229919(0x109)],'appRef':_0x423db7['appRef'],'datasetCode':_0x423db7[_0x229919(0xf1)],'datatable':_0x423db7['datatable'],'sqlCode':_0x423db7[_0x229919(0xdb)],'bffCode':_0x423db7[_0x229919(0x11c)],'bffId':_0x423db7[_0x229919(0x111)],'scriptName':_0x423db7[_0x229919(0x131)]};}function normalizeScalarParams(_0x3b5e44){const _0x1c37f8=a38_0x168b;return Object[_0x1c37f8(0xec)](Object['entries'](_0x3b5e44)[_0x1c37f8(0xdd)](([,_0xb45216])=>typeof _0xb45216==='string'||typeof _0xb45216==='number'));}function hasText(_0x2cf5d8){const _0x3eeb24=a38_0x168b;return typeof _0x2cf5d8===_0x3eeb24(0xe4)&&_0x2cf5d8[_0x3eeb24(0xd4)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x4b8226){const _0x299ec1=a38_0x168b;return _0x4b8226===undefined||typeof _0x4b8226==='string'||typeof _0x4b8226==='number'||typeof _0x4b8226===_0x299ec1(0x121);}
1
+ (function(_0x3be3f5,_0x368de5){const _0x167879=a38_0x3326,_0x24a22e=_0x3be3f5();while(!![]){try{const _0x232ba5=-parseInt(_0x167879(0x186))/0x1*(-parseInt(_0x167879(0x195))/0x2)+parseInt(_0x167879(0x189))/0x3*(parseInt(_0x167879(0x15c))/0x4)+parseInt(_0x167879(0x173))/0x5+parseInt(_0x167879(0x16a))/0x6*(parseInt(_0x167879(0x16c))/0x7)+parseInt(_0x167879(0x176))/0x8*(parseInt(_0x167879(0x178))/0x9)+-parseInt(_0x167879(0x19e))/0xa+-parseInt(_0x167879(0x19d))/0xb;if(_0x232ba5===_0x368de5)break;else _0x24a22e['push'](_0x24a22e['shift']());}catch(_0x469a56){_0x24a22e['push'](_0x24a22e['shift']());}}}(a38_0x1192,0x2effd));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(_0x1bee77,_0x13bac1){const _0x5bf7d5=a38_0x3326,_0x4b1a11=listLocalServiceTrees();let _0x54388b;for(const _0x15f170 of _0x4b1a11){const _0x5f0742=matchServiceTreeCommand(_0x15f170,_0x1bee77);if(!_0x5f0742)continue;(!_0x54388b||_0x5f0742[_0x5bf7d5(0x14e)][_0x5bf7d5(0x158)][_0x5bf7d5(0x141)]>_0x54388b[_0x5bf7d5(0x14e)]['fullPath'][_0x5bf7d5(0x141)])&&(_0x54388b={'tree':_0x15f170,'command':_0x5f0742[_0x5bf7d5(0x14e)],'remainingArgs':_0x5f0742['remainingArgs']});}if(!_0x54388b)return undefined;const _0x386625={..._0x13bac1};return applyAppBinding(_0x54388b[_0x5bf7d5(0x157)],_0x54388b['command'],_0x386625),{'definition':buildDynamicCommandDefinition(_0x54388b[_0x5bf7d5(0x157)],_0x54388b[_0x5bf7d5(0x14e)]),'args':_0x54388b[_0x5bf7d5(0x1a1)],'flags':_0x386625,'tree':_0x54388b[_0x5bf7d5(0x157)],'command':_0x54388b['command']};}export function generateDynamicServiceHelp(_0x5d4e75){const _0x146332=a38_0x3326,_0x2bfee1=listLocalServiceTrees()[_0x146332(0x199)](_0x36bc98=>_0x36bc98[_0x146332(0x194)][_0x146332(0x181)]===_0x5d4e75);if(!_0x2bfee1)return undefined;const _0x5b3578=[CLI_BIN_NAME+'\x20'+_0x5d4e75+'\x20<command>\x20[flags]','',_0x2bfee1[_0x146332(0x194)][_0x146332(0x162)]||_0x5d4e75,_0x2bfee1[_0x146332(0x194)][_0x146332(0x14c)]?'\x20\x20'+_0x2bfee1[_0x146332(0x194)][_0x146332(0x14c)]:'','',_0x146332(0x14f),..._0x2bfee1[_0x146332(0x187)][_0x146332(0x191)](_0x9652be=>{const _0x12004c=_0x146332,_0x5580ff=_0x9652be[_0x12004c(0x158)][_0x12004c(0x1a2)](0x1)[_0x12004c(0x185)]('\x20'),_0x5ac2e8=_0x9652be[_0x12004c(0x13e)]==='read'?'':'\x20['+_0x9652be['risk']+']';return'\x20\x20'+_0x5580ff[_0x12004c(0x18e)](0x18)+'\x20'+(_0x9652be[_0x12004c(0x14c)]||'')+_0x5ac2e8;}),'','Use\x20`'+CLI_BIN_NAME+_0x146332(0x160)+_0x5d4e75+_0x146332(0x1a0)][_0x146332(0x172)](Boolean);return _0x5b3578[_0x146332(0x185)]('\x0a');}export function listDynamicServiceEntries(){const _0x59c8f8=a38_0x3326;return listLocalServices()[_0x59c8f8(0x191)](_0x510fc5=>{const _0x4dbfcb=_0x59c8f8,_0x4593c8=_0x510fc5[_0x4dbfcb(0x140)];return{'service':_0x4593c8[_0x4dbfcb(0x194)][_0x4dbfcb(0x181)],'label':_0x4593c8['service'][_0x4dbfcb(0x162)]||_0x4593c8[_0x4dbfcb(0x194)][_0x4dbfcb(0x181)],'commands':_0x4593c8[_0x4dbfcb(0x187)][_0x4dbfcb(0x191)](_0x56db41=>({'command':dynamicCommandName(_0x56db41),'description':_0x56db41['description']||_0x4dbfcb(0x169)+_0x56db41['cliPath'],'tag':riskTag(_0x56db41[_0x4dbfcb(0x13e)])}))};});}export function getDynamicServiceEntry(_0x2d19c5){const _0xbc3486=a38_0x3326;return listDynamicServiceEntries()['find'](_0x3267e0=>_0x3267e0[_0xbc3486(0x194)]===_0x2d19c5);}export function listDynamicServiceDefinitions(_0x5d3039){const _0x2639e2=a38_0x3326;return listLocalServiceTrees()['filter'](_0x1efb2a=>!_0x5d3039||_0x1efb2a[_0x2639e2(0x194)][_0x2639e2(0x181)]===_0x5d3039)[_0x2639e2(0x15d)](_0x20d5f3=>_0x20d5f3['commands']['map'](_0x3ba0e4=>buildDynamicCommandDefinition(_0x20d5f3,_0x3ba0e4)));}export function getDynamicServiceDefinitions(_0x29dd0e){const _0x1b39ec=listDynamicServiceDefinitions(_0x29dd0e);return _0x1b39ec['length']>0x0?_0x1b39ec:undefined;}export function findDynamicServiceDefinition(_0x7c36ad,_0x5b4a07){const _0x2b7c59=a38_0x3326;return listDynamicServiceDefinitions(_0x7c36ad)[_0x2b7c59(0x199)](_0x363fe6=>_0x363fe6[_0x2b7c59(0x14e)]===_0x5b4a07);}export function buildDynamicCommandDefinition(_0x547c37,_0x7f4843){const _0x2d2c58=a38_0x3326;return{'service':_0x547c37[_0x2d2c58(0x194)][_0x2d2c58(0x181)],'command':dynamicCommandName(_0x7f4843),'description':_0x7f4843['description']||_0x2d2c58(0x169)+_0x7f4843[_0x2d2c58(0x18a)],'risk':_0x7f4843['risk'],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x7f4843[_0x2d2c58(0x18b)][_0x2d2c58(0x191)](_0x3bf5e6=>({'name':_0x3bf5e6['name'],'description':_0x3bf5e6[_0x2d2c58(0x14c)]||_0x3bf5e6[_0x2d2c58(0x162)],'required':_0x3bf5e6[_0x2d2c58(0x19c)]})),'flags':_0x7f4843[_0x2d2c58(0x14a)][_0x2d2c58(0x191)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x7f4843),async 'dryRun'(_0xa3cccd){const _0x180a82=_0x2d2c58,_0x1d209e=await compilePlan(_0x7f4843,_0xa3cccd);return{'method':_0x180a82(0x16b),'url':_0x7f4843['cliPath'],'body':{'target':targetPreview(_0x1d209e),'params':_0x1d209e[_0x180a82(0x152)]},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x7f4843['cliPath']};},async 'execute'(_0x570784){const _0x32b8b3=_0x2d2c58,_0x37c43f=await compilePlan(_0x7f4843,_0x570784),_0x2491ce=Date['now'](),_0x2f5fbe=await executePlan(_0x37c43f,_0x7f4843,_0x570784),_0x3bb972=Date[_0x32b8b3(0x164)]()-_0x2491ce;return{'ok':!![],'data':{'service':_0x547c37['service'],'command':_0x7f4843[_0x32b8b3(0x18a)],'target':targetPreview(_0x37c43f),'result':_0x2f5fbe,'elapsed':_0x3bb972},'message':_0x32b8b3(0x1a3)+_0x7f4843[_0x32b8b3(0x18a)]+'\x20completed\x20in\x20'+_0x3bb972+'ms'};}};}function a38_0x3326(_0x4dfe38,_0x58c89e){_0x4dfe38=_0x4dfe38-0x13e;const _0x11922e=a38_0x1192();let _0x33264d=_0x11922e[_0x4dfe38];return _0x33264d;}function dynamicCommandName(_0x2b827e){const _0x140e94=a38_0x3326;return _0x2b827e[_0x140e94(0x158)][_0x140e94(0x1a2)](0x1)[_0x140e94(0x185)]('\x20');}function riskTag(_0x58e591){const _0x10aa4f=a38_0x3326;return _0x58e591==='read'?'':_0x10aa4f(0x196)+_0x58e591+']';}function flagToCommandFlag(_0x1b6230){const _0x1fefa4=a38_0x3326;return{'name':_0x1b6230[_0x1fefa4(0x177)],'type':_0x1b6230[_0x1fefa4(0x19f)]==='json'?_0x1fefa4(0x18d):_0x1b6230[_0x1fefa4(0x19f)],'description':_0x1b6230[_0x1fefa4(0x14c)]||_0x1b6230['name'],'required':_0x1b6230['required'],'default':isPrimitiveFlagDefault(_0x1b6230['default'])?_0x1b6230[_0x1fefa4(0x13f)]:undefined,'enum':_0x1b6230[_0x1fefa4(0x17c)]};}async function compilePlan(_0x3ba97c,_0x27db3b){const _0x432e50=a38_0x3326;return compileServiceTreeCommand(_0x3ba97c,{'flags':_0x27db3b['rawFlags'],'args':_0x27db3b[_0x432e50(0x18b)],'context':await buildServiceContext(_0x3ba97c,_0x27db3b)});}async function buildServiceContext(_0x26cfe0,_0x27bf69){const _0x5ea3a1=a38_0x3326,_0x353ce3={'appCode':_0x27bf69[_0x5ea3a1(0x198)],'env':_0x27bf69[_0x5ea3a1(0x146)],'envName':_0x27bf69[_0x5ea3a1(0x146)]};if(!usesRuntimeContext(_0x26cfe0))return _0x353ce3;const _0x5b22e6=await getLoginUserInfo(),_0x416a96=pickFirst(_0x5b22e6[_0x5ea3a1(0x17f)],_0x5b22e6['id']);return{..._0x353ce3,'user':_0x5b22e6,'userId':_0x416a96,'id':_0x5b22e6['id'],'username':pickFirst(_0x5b22e6[_0x5ea3a1(0x182)],_0x5b22e6[_0x5ea3a1(0x190)],_0x5b22e6[_0x5ea3a1(0x183)]),'userName':_0x5b22e6['userName'],'nickname':pickFirst(_0x5b22e6[_0x5ea3a1(0x155)],_0x5b22e6[_0x5ea3a1(0x15e)]),'nickName':_0x5b22e6[_0x5ea3a1(0x15e)],'tenantCode':_0x5b22e6['tenantCode'],'employeeId':_0x5b22e6[_0x5ea3a1(0x156)]};}function usesRuntimeContext(_0x24d3eb){const _0x1ca7d2=a38_0x3326;return _0x24d3eb[_0x1ca7d2(0x154)][_0x1ca7d2(0x15f)](_0x855dde=>typeof _0x855dde[_0x1ca7d2(0x15b)]===_0x1ca7d2(0x18d)&&(_0x855dde['source'][_0x1ca7d2(0x192)]('context.')||_0x855dde['source']['startsWith'](_0x1ca7d2(0x145))));}function pickFirst(..._0x4f2765){return _0x4f2765['find'](_0x2b3099=>_0x2b3099!==undefined&&_0x2b3099!==null);}async function executePlan(_0x604a7b,_0x3a0d11,_0x12d14d){const _0x248529=a38_0x3326;if(_0x604a7b[_0x248529(0x193)]===_0x248529(0x17b)){const _0xadd4a2=await resolveDatasetCode(_0x604a7b,_0x3a0d11,_0x12d14d);return executeData(_0xadd4a2,_0x604a7b['command'],_0x604a7b['params']);}if(_0x604a7b[_0x248529(0x193)]===_0x248529(0x19a)){if(!_0x604a7b[_0x248529(0x18f)])throw CliErrors['validation'](_0x248529(0x1a3)+_0x3a0d11['cliPath']+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x604a7b[_0x248529(0x18f)],normalizeScalarParams(_0x604a7b[_0x248529(0x152)]));}if(_0x604a7b[_0x248529(0x193)]===_0x248529(0x184)){const _0xa46286=_0x604a7b[_0x248529(0x18c)]||_0x604a7b['bffCode']||(_0x604a7b[_0x248529(0x163)]==null?'':String(_0x604a7b[_0x248529(0x163)]));if(!_0xa46286)throw CliErrors[_0x248529(0x149)]('Service\x20command\x20'+_0x3a0d11[_0x248529(0x18a)]+_0x248529(0x168));return executeSdkBff(_0xa46286,_0x604a7b[_0x248529(0x152)]);}throw CliErrors['validation'](_0x248529(0x167)+_0x604a7b['kind']);}function a38_0x1192(){const _0x2a8df2=['number','validation','flags','\x20->\x20','description','tableName','command','Commands:','env','appRef','params','push','mapTo','nickname','employeeId','tree','fullPath','const','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','source','115168suospj','flatMap','nickName','some','\x20service\x20detail\x20--service\x20','datasetCode','name','bffId','now','entries','Cannot\x20resolve\x20datatable\x20\x22','Unsupported\x20service\x20target\x20kind:\x20','\x20requires\x20target.scriptName.','Run\x20service\x20command\x20','132XqqAga','SERVICE_TREE','49525jJovZI','appcode','\x20\x20MAP\x20TO','\x20\x20\x20\x20sqlCode:\x20','\x22\x20in\x20service\x20command\x20','operator','filter','1151835lGOUhD','\x20\x20\x20\x20','\x20\x20\x20\x20datasetCode:\x20','176TvMXGk','cliName','41031WOgKrU','datatable','boolean','data','enum','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','app','userId','target','code','username','loginName','bff','join','697rspKgX','commands','trim','15DgbVfq','cliPath','args','scriptName','string','padEnd','sqlCode','userName','map','startsWith','kind','service','382HCVMak','\x20\x20[','\x20\x20\x20\x20datatable:\x20','appCode','find','sql','\x20\x20\x20\x20command:\x20','required','5856730FRczBd','384630hiPttg','type','`\x20to\x20inspect\x20the\x20manifest.','remainingArgs','slice','Service\x20command\x20','risk','default','normalizedManifest','length','\x20\x20SERVICE\x20TREE\x20TARGET','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','ctx.','envName','Unknown\x20appRef\x20\x22'];a38_0x1192=function(){return _0x2a8df2;};return a38_0x1192();}async function resolveDatasetCode(_0x14e94a,_0x1bdc10,_0xddef15){const _0x3e6ea7=a38_0x3326;if(_0x14e94a['datasetCode'])return _0x14e94a[_0x3e6ea7(0x161)];if(!_0x14e94a[_0x3e6ea7(0x179)])throw CliErrors[_0x3e6ea7(0x149)]('Service\x20command\x20'+_0x1bdc10['cliPath']+_0x3e6ea7(0x143));const _0x1014bc=await listDatasets(_0xddef15[_0x3e6ea7(0x198)]),_0x4f539d=_0x1014bc[_0x3e6ea7(0x199)](_0x3b0590=>_0x3b0590['dbtableConfig']?.[_0x3e6ea7(0x14d)]===_0x14e94a[_0x3e6ea7(0x179)]);if(!_0x4f539d?.['code'])throw CliErrors[_0x3e6ea7(0x149)](_0x3e6ea7(0x166)+_0x14e94a[_0x3e6ea7(0x179)]+_0x3e6ea7(0x17d)+_0xddef15[_0x3e6ea7(0x198)]+'.',_0x3e6ea7(0x144));return _0x4f539d[_0x3e6ea7(0x181)];}function applyAppBinding(_0x4303e1,_0x39c956,_0x345d46){const _0x281faa=a38_0x3326,_0x13596a=_0x39c956[_0x281faa(0x180)][_0x281faa(0x151)];if(!_0x13596a)return;const _0x53b05d=_0x4303e1['appBindings'][_0x13596a];if(!_0x53b05d)throw CliErrors[_0x281faa(0x149)](_0x281faa(0x147)+_0x13596a+_0x281faa(0x170)+_0x39c956[_0x281faa(0x18a)]+'.',_0x281faa(0x15a));const _0x2cceb8=_0x53b05d[_0x281faa(0x16d)]||_0x53b05d['appCode'];_0x2cceb8&&!hasText(_0x345d46[_0x281faa(0x16d)])&&(_0x345d46[_0x281faa(0x16d)]=_0x2cceb8),_0x53b05d['app']&&!hasText(_0x345d46[_0x281faa(0x17e)])&&!hasText(_0x345d46[_0x281faa(0x16d)])&&(_0x345d46[_0x281faa(0x17e)]=_0x53b05d[_0x281faa(0x17e)]),_0x53b05d[_0x281faa(0x150)]&&!hasText(_0x345d46[_0x281faa(0x150)])&&(_0x345d46['env']=_0x53b05d['env']);}function renderDynamicCommandHelp(_0x26afcc){const _0x1b8ff7=a38_0x3326,_0x4c2284=[_0x1b8ff7(0x142),'\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x26afcc['target'][_0x1b8ff7(0x193)],_0x1b8ff7(0x19b)+_0x26afcc[_0x1b8ff7(0x180)][_0x1b8ff7(0x14e)]];if(_0x26afcc[_0x1b8ff7(0x180)][_0x1b8ff7(0x161)])_0x4c2284[_0x1b8ff7(0x153)](_0x1b8ff7(0x175)+_0x26afcc[_0x1b8ff7(0x180)][_0x1b8ff7(0x161)]);if(_0x26afcc[_0x1b8ff7(0x180)][_0x1b8ff7(0x179)])_0x4c2284['push'](_0x1b8ff7(0x197)+_0x26afcc[_0x1b8ff7(0x180)][_0x1b8ff7(0x179)]);if(_0x26afcc[_0x1b8ff7(0x180)]['sqlCode'])_0x4c2284[_0x1b8ff7(0x153)](_0x1b8ff7(0x16f)+_0x26afcc[_0x1b8ff7(0x180)][_0x1b8ff7(0x18f)]);if(_0x26afcc[_0x1b8ff7(0x180)][_0x1b8ff7(0x18c)])_0x4c2284[_0x1b8ff7(0x153)]('\x20\x20\x20\x20scriptName:\x20'+_0x26afcc[_0x1b8ff7(0x180)][_0x1b8ff7(0x18c)]);if(_0x26afcc['mapTo'][_0x1b8ff7(0x141)]>0x0){_0x4c2284[_0x1b8ff7(0x153)]('',_0x1b8ff7(0x16e));for(const _0x105b6d of _0x26afcc['mapTo']){_0x4c2284[_0x1b8ff7(0x153)](_0x1b8ff7(0x174)+(_0x105b6d['source']||_0x1b8ff7(0x159))+_0x1b8ff7(0x14b)+_0x105b6d[_0x1b8ff7(0x180)]+(_0x105b6d[_0x1b8ff7(0x171)]?'.'+_0x105b6d[_0x1b8ff7(0x171)]:''));}}return _0x4c2284[_0x1b8ff7(0x185)]('\x0a');}function targetPreview(_0x3248a5){const _0x1f2f26=a38_0x3326;return{'kind':_0x3248a5[_0x1f2f26(0x193)],'command':_0x3248a5[_0x1f2f26(0x14e)],'appRef':_0x3248a5['appRef'],'datasetCode':_0x3248a5[_0x1f2f26(0x161)],'datatable':_0x3248a5['datatable'],'sqlCode':_0x3248a5[_0x1f2f26(0x18f)],'bffCode':_0x3248a5['bffCode'],'bffId':_0x3248a5[_0x1f2f26(0x163)],'scriptName':_0x3248a5[_0x1f2f26(0x18c)]};}function normalizeScalarParams(_0x2bd190){const _0x18010e=a38_0x3326;return Object['fromEntries'](Object[_0x18010e(0x165)](_0x2bd190)[_0x18010e(0x172)](([,_0x234b71])=>typeof _0x234b71==='string'||typeof _0x234b71===_0x18010e(0x148)));}function hasText(_0x3e5405){const _0x3890af=a38_0x3326;return typeof _0x3e5405===_0x3890af(0x18d)&&_0x3e5405[_0x3890af(0x188)]()[_0x3890af(0x141)]>0x0;}function isPrimitiveFlagDefault(_0x39c28f){const _0x311d7e=a38_0x3326;return _0x39c28f===undefined||typeof _0x39c28f==='string'||typeof _0x39c28f===_0x311d7e(0x148)||typeof _0x39c28f===_0x311d7e(0x17a);}
@@ -1 +1 @@
1
- const a39_0x18b36d=a39_0x4ede;function a39_0x4ede(_0x11a9b7,_0x4fa6cd){_0x11a9b7=_0x11a9b7-0x1b0;const _0x5c982d=a39_0x5c98();let _0x4ede04=_0x5c982d[_0x11a9b7];return _0x4ede04;}(function(_0x29d82d,_0x295a6f){const _0x366eed=a39_0x4ede,_0x8ba112=_0x29d82d();while(!![]){try{const _0x250382=parseInt(_0x366eed(0x1c4))/0x1+parseInt(_0x366eed(0x1eb))/0x2+-parseInt(_0x366eed(0x1c7))/0x3+-parseInt(_0x366eed(0x1dc))/0x4+-parseInt(_0x366eed(0x1b2))/0x5*(parseInt(_0x366eed(0x1e7))/0x6)+parseInt(_0x366eed(0x1ca))/0x7*(parseInt(_0x366eed(0x1c9))/0x8)+-parseInt(_0x366eed(0x1c1))/0x9*(-parseInt(_0x366eed(0x1ed))/0xa);if(_0x250382===_0x295a6f)break;else _0x8ba112['push'](_0x8ba112['shift']());}catch(_0x3c6ff5){_0x8ba112['push'](_0x8ba112['shift']());}}}(a39_0x5c98,0x8ed58));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a39_0x5c98(){const _0x305fa7=['type','\x20service\x20','Imported','target','Service\x20registry\x20validation\x20passed.','registry','Updated','registryPath','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','registryServiceCode','2972164FsJHWn','manifests','Local\x20service\x20code,\x20for\x20example\x20crm','hash','entry','file','write','string','service','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','report','42yjAvUF','remove','errors','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','1665230kGInpF','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','550sWTCTn','cliName','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','warnings','kind','str','cliPath','WRITE','serviceCount','Imported\x20','read','length','replaced','imported','source','650605jwxjSJ','version','registryIndex','risk','Service\x20manifest\x20validation\x20passed.','required','description','\x20service(s).','filePath','Exported\x20service\x20','import','\x20service(s),\x20updated\x20','normalizedManifest','validate','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','65718MVgmcT','commands','lower\x20kebab-case\x20service\x20code','1005972NPOAcN','export','flags','2466483EQgBRf','list','1641800LpacOw','28WpRVdv','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','serviceCode','updated','entries','Service\x20Tree\x20manifest\x20file\x20path','map','manifest'];a39_0x5c98=function(){return _0x305fa7;};return a39_0x5c98();}const FILE_FLAG={'name':a39_0x18b36d(0x1e1),'type':a39_0x18b36d(0x1e3),'required':!![],'description':a39_0x18b36d(0x1cf)},SERVICE_FLAG={'name':a39_0x18b36d(0x1e4),'type':a39_0x18b36d(0x1e3),'required':!![],'description':a39_0x18b36d(0x1de),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x18b36d(0x1c3)}};function summarizeService(_0x3f38f1){const _0x12eac7=a39_0x18b36d;return{'serviceCode':_0x3f38f1['serviceCode'],'name':_0x3f38f1['normalizedManifest'][_0x12eac7(0x1e4)]['name'],'version':_0x3f38f1['version'],'importedAt':_0x3f38f1['importedAt'],'source':_0x3f38f1[_0x12eac7(0x1b1)],'commandCount':_0x3f38f1[_0x12eac7(0x1be)][_0x12eac7(0x1c2)][_0x12eac7(0x1f8)],'commands':_0x3f38f1[_0x12eac7(0x1be)]['commands'][_0x12eac7(0x1d0)](_0xfeae48=>({'path':_0xfeae48[_0x12eac7(0x1f3)],'description':_0xfeae48[_0x12eac7(0x1b8)],'risk':_0xfeae48['risk'],'target':_0xfeae48[_0x12eac7(0x1d5)],'flags':_0xfeae48[_0x12eac7(0x1c6)][_0x12eac7(0x1d0)](_0xbbe015=>({'name':_0xbbe015['name'],'cliName':_0xbbe015[_0x12eac7(0x1ee)],'type':_0xbbe015[_0x12eac7(0x1d2)],'required':_0xbbe015[_0x12eac7(0x1b7)]===!![]}))}))};}function summarizeLoadedManifest(_0x426d71){const _0x4b7490=a39_0x18b36d;return{'service':_0x426d71[_0x4b7490(0x1be)]?.[_0x4b7490(0x1e4)],'version':_0x426d71[_0x4b7490(0x1be)]?.[_0x4b7490(0x1b3)],'commandCount':_0x426d71[_0x4b7490(0x1be)]?.['commands'][_0x4b7490(0x1f8)]??0x0,'commands':_0x426d71['normalizedManifest']?.[_0x4b7490(0x1c2)][_0x4b7490(0x1d0)](_0x11d05a=>({'path':_0x11d05a['cliPath'],'risk':_0x11d05a[_0x4b7490(0x1b5)],'target':_0x11d05a['target']}))??[],'registryIndex':_0x426d71[_0x4b7490(0x1b4)],'registryServiceCode':_0x426d71[_0x4b7490(0x1db)],'errors':_0x426d71[_0x4b7490(0x1e6)][_0x4b7490(0x1e9)],'warnings':_0x426d71['report']['warnings']};}export const serviceDefinitions=[{'service':a39_0x18b36d(0x1e4),'command':a39_0x18b36d(0x1bf),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a39_0x18b36d(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x5588ef){const _0x32a067=a39_0x18b36d,_0x1b492e=loadServiceManifestFromFile(_0x5588ef['str']('file'));if(!_0x1b492e['report']['ok'])return{'ok':![],'data':{'file':_0x1b492e[_0x32a067(0x1ba)],'hash':_0x1b492e[_0x32a067(0x1df)],'kind':_0x1b492e['kind'],'serviceCount':_0x1b492e['manifests']['length'],'services':_0x1b492e[_0x32a067(0x1dd)][_0x32a067(0x1d0)](summarizeLoadedManifest),'errors':_0x1b492e[_0x32a067(0x1e6)][_0x32a067(0x1e9)],'warnings':_0x1b492e[_0x32a067(0x1e6)][_0x32a067(0x1f0)]},'message':formatValidationFailure(_0x1b492e[_0x32a067(0x1e6)])};if(_0x1b492e[_0x32a067(0x1f1)]===_0x32a067(0x1d7)||_0x1b492e[_0x32a067(0x1dd)][_0x32a067(0x1f8)]!==0x1)return{'ok':!![],'data':{'file':_0x1b492e['filePath'],'hash':_0x1b492e[_0x32a067(0x1df)],'kind':_0x1b492e['kind'],'serviceCount':_0x1b492e['manifests'][_0x32a067(0x1f8)],'commandCount':_0x1b492e['manifests']['reduce']((_0x458459,_0x1c46e6)=>_0x458459+(_0x1c46e6[_0x32a067(0x1be)]?.[_0x32a067(0x1c2)][_0x32a067(0x1f8)]??0x0),0x0),'services':_0x1b492e[_0x32a067(0x1dd)][_0x32a067(0x1d0)](summarizeLoadedManifest),'warnings':_0x1b492e[_0x32a067(0x1e6)][_0x32a067(0x1f0)]},'message':_0x32a067(0x1d6)};return{'ok':!![],'data':{'file':_0x1b492e[_0x32a067(0x1ba)],'hash':_0x1b492e[_0x32a067(0x1df)],'kind':_0x1b492e[_0x32a067(0x1f1)],'service':_0x1b492e[_0x32a067(0x1be)]?.[_0x32a067(0x1e4)],'version':_0x1b492e['normalizedManifest']?.[_0x32a067(0x1b3)],'commandCount':_0x1b492e[_0x32a067(0x1be)]?.[_0x32a067(0x1c2)][_0x32a067(0x1f8)]??0x0,'commands':_0x1b492e[_0x32a067(0x1be)]?.[_0x32a067(0x1c2)][_0x32a067(0x1d0)](_0xe63950=>({'path':_0xe63950['cliPath'],'risk':_0xe63950[_0x32a067(0x1b5)],'target':_0xe63950['target']})),'warnings':_0x1b492e[_0x32a067(0x1e6)][_0x32a067(0x1f0)]},'message':_0x32a067(0x1b6)};}},{'service':a39_0x18b36d(0x1e4),'command':a39_0x18b36d(0x1bc),'description':a39_0x18b36d(0x1da),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x20d00f){const _0x3bae9c=a39_0x18b36d,_0x355d8e=loadServiceManifestFromFile(_0x20d00f[_0x3bae9c(0x1f2)](_0x3bae9c(0x1e1)));return{'method':_0x3bae9c(0x1f4),'url':getServiceRegistryPath(),'body':{'file':_0x355d8e[_0x3bae9c(0x1ba)],'hash':_0x355d8e[_0x3bae9c(0x1df)],'kind':_0x355d8e[_0x3bae9c(0x1f1)],'ok':_0x355d8e[_0x3bae9c(0x1e6)]['ok'],'service':_0x355d8e[_0x3bae9c(0x1be)]?.[_0x3bae9c(0x1e4)],'version':_0x355d8e[_0x3bae9c(0x1be)]?.['version'],'serviceCount':_0x355d8e[_0x3bae9c(0x1dd)][_0x3bae9c(0x1f8)],'services':_0x355d8e[_0x3bae9c(0x1dd)][_0x3bae9c(0x1d0)](_0x3fe340=>({'service':_0x3fe340[_0x3bae9c(0x1be)]?.[_0x3bae9c(0x1e4)],'version':_0x3fe340[_0x3bae9c(0x1be)]?.[_0x3bae9c(0x1b3)],'commandCount':_0x3fe340['normalizedManifest']?.['commands'][_0x3bae9c(0x1f8)]??0x0,'errors':_0x3fe340[_0x3bae9c(0x1e6)]['errors']})),'errors':_0x355d8e[_0x3bae9c(0x1e6)][_0x3bae9c(0x1e9)],'commandCount':_0x355d8e[_0x3bae9c(0x1be)]?.[_0x3bae9c(0x1c2)][_0x3bae9c(0x1f8)]??0x0},'description':_0x3bae9c(0x1c0)};},async 'execute'(_0x478b7b){const _0x493380=a39_0x18b36d,_0x2351a1=importServiceManifest(_0x478b7b['str']('file'));if(_0x2351a1['entries']['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x2351a1['registryPath'],'imported':_0x2351a1[_0x493380(0x1b0)],'updated':_0x2351a1[_0x493380(0x1cd)],'serviceCount':_0x2351a1[_0x493380(0x1f5)],'services':_0x2351a1[_0x493380(0x1ce)][_0x493380(0x1d0)](summarizeService)},'message':_0x493380(0x1f6)+_0x2351a1[_0x493380(0x1b0)]+_0x493380(0x1bd)+_0x2351a1[_0x493380(0x1cd)]+_0x493380(0x1b9)};return{'ok':!![],'data':{'registryPath':_0x2351a1[_0x493380(0x1d9)],'replaced':_0x2351a1[_0x493380(0x1f9)],'imported':_0x2351a1[_0x493380(0x1b0)],'updated':_0x2351a1[_0x493380(0x1cd)],'serviceCount':_0x2351a1[_0x493380(0x1f5)],'service':summarizeService(_0x2351a1[_0x493380(0x1e0)])},'message':(_0x2351a1[_0x493380(0x1f9)]?_0x493380(0x1d8):_0x493380(0x1d4))+_0x493380(0x1d3)+_0x2351a1[_0x493380(0x1e0)][_0x493380(0x1cc)]+'.'};}},{'service':a39_0x18b36d(0x1e4),'command':a39_0x18b36d(0x1c5),'description':a39_0x18b36d(0x1ea),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x54cf7d){const _0xa24e14=a39_0x18b36d,_0x37006a=getLocalServiceEntry(_0x54cf7d[_0xa24e14(0x1f2)]('service'));return{'method':'WRITE','url':_0x54cf7d[_0xa24e14(0x1f2)]('file'),'body':{'service':_0x54cf7d['str'](_0xa24e14(0x1e4)),'found':Boolean(_0x37006a),'version':_0x37006a?.['version'],'source':_0x37006a?.['source']},'description':_0xa24e14(0x1cb)};},async 'execute'(_0x36cc85){const _0x3ad32f=a39_0x18b36d,_0x2c60d6=exportServiceManifest(_0x36cc85[_0x3ad32f(0x1f2)](_0x3ad32f(0x1e4)),_0x36cc85[_0x3ad32f(0x1f2)]('file'));return{'ok':!![],'data':{'registryPath':_0x2c60d6[_0x3ad32f(0x1d9)],'file':_0x2c60d6[_0x3ad32f(0x1ba)],'service':summarizeService(_0x2c60d6['entry'])},'message':_0x3ad32f(0x1bb)+_0x2c60d6[_0x3ad32f(0x1e0)][_0x3ad32f(0x1cc)]+'.'};}},{'service':'service','command':a39_0x18b36d(0x1c8),'description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a39_0x18b36d(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x4528fa=a39_0x18b36d,_0xc5a308=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0xc5a308[_0x4528fa(0x1f8)],'services':_0xc5a308[_0x4528fa(0x1d0)](summarizeService)}};}},{'service':a39_0x18b36d(0x1e4),'command':a39_0x18b36d(0x1e8),'description':a39_0x18b36d(0x1ec),'risk':a39_0x18b36d(0x1e2),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x3642d9){const _0x466cb5=a39_0x18b36d,_0x5cb749=getLocalServiceEntry(_0x3642d9[_0x466cb5(0x1f2)](_0x466cb5(0x1e4)));return{'method':_0x466cb5(0x1f4),'url':getServiceRegistryPath(),'body':{'service':_0x3642d9[_0x466cb5(0x1f2)]('service'),'found':Boolean(_0x5cb749),'version':_0x5cb749?.['version'],'source':_0x5cb749?.[_0x466cb5(0x1b1)]},'description':_0x466cb5(0x1e5)};},async 'execute'(_0x554c95){const _0x6e347f=a39_0x18b36d,_0x509654=removeServiceManifest(_0x554c95['str'](_0x6e347f(0x1e4)));return{'ok':!![],'data':{'registryPath':_0x509654[_0x6e347f(0x1d9)],'serviceCount':_0x509654[_0x6e347f(0x1f5)],'service':summarizeService(_0x509654[_0x6e347f(0x1e0)])},'message':'Removed\x20service\x20'+_0x509654['entry']['serviceCode']+'.'};}},{'service':a39_0x18b36d(0x1e4),'command':'detail','description':a39_0x18b36d(0x1ef),'risk':a39_0x18b36d(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1bb32f){const _0x49bfe1=a39_0x18b36d,_0x2e06bd=getLocalServiceEntry(_0x1bb32f[_0x49bfe1(0x1f2)](_0x49bfe1(0x1e4)));if(!_0x2e06bd)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1bb32f[_0x49bfe1(0x1f2)](_0x49bfe1(0x1e4))},'message':'Local\x20service\x20not\x20found:\x20'+_0x1bb32f[_0x49bfe1(0x1f2)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2e06bd),'manifest':_0x2e06bd[_0x49bfe1(0x1d1)],'normalizedManifest':_0x2e06bd['normalizedManifest']}};}}];
1
+ const a39_0x3e027e=a39_0x1bfc;(function(_0x195fe1,_0x40e024){const _0x15dee9=a39_0x1bfc,_0x1a5ef6=_0x195fe1();while(!![]){try{const _0x484fdd=-parseInt(_0x15dee9(0x1e8))/0x1*(-parseInt(_0x15dee9(0x1d5))/0x2)+-parseInt(_0x15dee9(0x1cc))/0x3+parseInt(_0x15dee9(0x1c9))/0x4*(parseInt(_0x15dee9(0x1e7))/0x5)+-parseInt(_0x15dee9(0x1db))/0x6+parseInt(_0x15dee9(0x1dc))/0x7+parseInt(_0x15dee9(0x1d3))/0x8+parseInt(_0x15dee9(0x1ed))/0x9;if(_0x484fdd===_0x40e024)break;else _0x1a5ef6['push'](_0x1a5ef6['shift']());}catch(_0x5823e8){_0x1a5ef6['push'](_0x1a5ef6['shift']());}}}(a39_0x266e,0x227e9));function a39_0x1bfc(_0x3a7557,_0x1311c8){_0x3a7557=_0x3a7557-0x1ae;const _0x266ed7=a39_0x266e();let _0x1bfccd=_0x266ed7[_0x3a7557];return _0x1bfccd;}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x3e027e(0x1ba),'type':a39_0x3e027e(0x1f2),'required':!![],'description':a39_0x3e027e(0x1da)},SERVICE_FLAG={'name':a39_0x3e027e(0x1e1),'type':a39_0x3e027e(0x1f2),'required':!![],'description':a39_0x3e027e(0x1d2),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x3e027e(0x1f0)}};function summarizeService(_0x2289fb){const _0x2e7c64=a39_0x3e027e;return{'serviceCode':_0x2289fb['serviceCode'],'name':_0x2289fb[_0x2e7c64(0x1ce)][_0x2e7c64(0x1e1)][_0x2e7c64(0x1c0)],'version':_0x2289fb[_0x2e7c64(0x1d4)],'importedAt':_0x2289fb[_0x2e7c64(0x1ec)],'source':_0x2289fb['source'],'commandCount':_0x2289fb[_0x2e7c64(0x1ce)]['commands'][_0x2e7c64(0x1e6)],'commands':_0x2289fb[_0x2e7c64(0x1ce)][_0x2e7c64(0x1d1)]['map'](_0x1923aa=>({'path':_0x1923aa[_0x2e7c64(0x1ae)],'description':_0x1923aa['description'],'risk':_0x1923aa[_0x2e7c64(0x1c8)],'target':_0x1923aa['target'],'flags':_0x1923aa[_0x2e7c64(0x1bc)][_0x2e7c64(0x1e3)](_0x1a45c8=>({'name':_0x1a45c8[_0x2e7c64(0x1c0)],'cliName':_0x1a45c8[_0x2e7c64(0x1cb)],'type':_0x1a45c8[_0x2e7c64(0x1ee)],'required':_0x1a45c8[_0x2e7c64(0x1af)]===!![]}))}))};}function a39_0x266e(){const _0x118ac7=['Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Service\x20registry\x20validation\x20passed.','target','imported','entry','risk','4368XsCDXD','registryPath','cliName','434319URpqSI','export','normalizedManifest','warnings','WRITE','commands','Local\x20service\x20code,\x20for\x20example\x20crm','107064vKLhlY','version','10768TPePbH','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','kind','Exported\x20service\x20','report','Service\x20Tree\x20manifest\x20file\x20path','1176588tBReDp','537964bFMBfx','replaced','list','\x20service(s).','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','service','source','map','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Removed\x20service\x20','length','1160scibDP','6PQLadV','manifests','errors','updated','importedAt','956493mvZCJg','type','\x20service\x20','lower\x20kebab-case\x20service\x20code','manifest','string','cliPath','required','hash','validate','filePath','registryServiceCode','read','entries','registryIndex','reduce','str','serviceCount','file','serviceCode','flags','\x20service(s),\x20updated\x20','Imported','write','name','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','Imported\x20'];a39_0x266e=function(){return _0x118ac7;};return a39_0x266e();}function summarizeLoadedManifest(_0x33a152){const _0x37903a=a39_0x3e027e;return{'service':_0x33a152[_0x37903a(0x1ce)]?.[_0x37903a(0x1e1)],'version':_0x33a152['normalizedManifest']?.[_0x37903a(0x1d4)],'commandCount':_0x33a152['normalizedManifest']?.[_0x37903a(0x1d1)][_0x37903a(0x1e6)]??0x0,'commands':_0x33a152[_0x37903a(0x1ce)]?.[_0x37903a(0x1d1)][_0x37903a(0x1e3)](_0x151183=>({'path':_0x151183[_0x37903a(0x1ae)],'risk':_0x151183[_0x37903a(0x1c8)],'target':_0x151183[_0x37903a(0x1c5)]}))??[],'registryIndex':_0x33a152[_0x37903a(0x1b6)],'registryServiceCode':_0x33a152[_0x37903a(0x1b3)],'errors':_0x33a152['report']['errors'],'warnings':_0x33a152[_0x37903a(0x1d9)][_0x37903a(0x1cf)]};}export const serviceDefinitions=[{'service':a39_0x3e027e(0x1e1),'command':a39_0x3e027e(0x1b1),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a39_0x3e027e(0x1b4),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4a80a9){const _0x53973c=a39_0x3e027e,_0xf2ca28=loadServiceManifestFromFile(_0x4a80a9[_0x53973c(0x1b8)](_0x53973c(0x1ba)));if(!_0xf2ca28[_0x53973c(0x1d9)]['ok'])return{'ok':![],'data':{'file':_0xf2ca28['filePath'],'hash':_0xf2ca28[_0x53973c(0x1b0)],'kind':_0xf2ca28['kind'],'serviceCount':_0xf2ca28['manifests'][_0x53973c(0x1e6)],'services':_0xf2ca28[_0x53973c(0x1e9)][_0x53973c(0x1e3)](summarizeLoadedManifest),'errors':_0xf2ca28['report']['errors'],'warnings':_0xf2ca28['report'][_0x53973c(0x1cf)]},'message':formatValidationFailure(_0xf2ca28[_0x53973c(0x1d9)])};if(_0xf2ca28[_0x53973c(0x1d7)]==='registry'||_0xf2ca28[_0x53973c(0x1e9)]['length']!==0x1)return{'ok':!![],'data':{'file':_0xf2ca28[_0x53973c(0x1b2)],'hash':_0xf2ca28['hash'],'kind':_0xf2ca28[_0x53973c(0x1d7)],'serviceCount':_0xf2ca28[_0x53973c(0x1e9)][_0x53973c(0x1e6)],'commandCount':_0xf2ca28[_0x53973c(0x1e9)][_0x53973c(0x1b7)]((_0x4a77cf,_0xb863cd)=>_0x4a77cf+(_0xb863cd[_0x53973c(0x1ce)]?.[_0x53973c(0x1d1)]['length']??0x0),0x0),'services':_0xf2ca28[_0x53973c(0x1e9)]['map'](summarizeLoadedManifest),'warnings':_0xf2ca28[_0x53973c(0x1d9)][_0x53973c(0x1cf)]},'message':_0x53973c(0x1c4)};return{'ok':!![],'data':{'file':_0xf2ca28[_0x53973c(0x1b2)],'hash':_0xf2ca28['hash'],'kind':_0xf2ca28[_0x53973c(0x1d7)],'service':_0xf2ca28[_0x53973c(0x1ce)]?.[_0x53973c(0x1e1)],'version':_0xf2ca28[_0x53973c(0x1ce)]?.[_0x53973c(0x1d4)],'commandCount':_0xf2ca28['normalizedManifest']?.['commands']['length']??0x0,'commands':_0xf2ca28['normalizedManifest']?.[_0x53973c(0x1d1)][_0x53973c(0x1e3)](_0x140a03=>({'path':_0x140a03['cliPath'],'risk':_0x140a03[_0x53973c(0x1c8)],'target':_0x140a03[_0x53973c(0x1c5)]})),'warnings':_0xf2ca28['report'][_0x53973c(0x1cf)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a39_0x3e027e(0x1e1),'command':'import','description':a39_0x3e027e(0x1e0),'risk':a39_0x3e027e(0x1bf),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x1433be){const _0x1dd1ae=a39_0x3e027e,_0x54ed61=loadServiceManifestFromFile(_0x1433be[_0x1dd1ae(0x1b8)](_0x1dd1ae(0x1ba)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x54ed61['filePath'],'hash':_0x54ed61[_0x1dd1ae(0x1b0)],'kind':_0x54ed61['kind'],'ok':_0x54ed61[_0x1dd1ae(0x1d9)]['ok'],'service':_0x54ed61[_0x1dd1ae(0x1ce)]?.[_0x1dd1ae(0x1e1)],'version':_0x54ed61['normalizedManifest']?.['version'],'serviceCount':_0x54ed61[_0x1dd1ae(0x1e9)]['length'],'services':_0x54ed61[_0x1dd1ae(0x1e9)][_0x1dd1ae(0x1e3)](_0x4cfc47=>({'service':_0x4cfc47[_0x1dd1ae(0x1ce)]?.[_0x1dd1ae(0x1e1)],'version':_0x4cfc47[_0x1dd1ae(0x1ce)]?.['version'],'commandCount':_0x4cfc47[_0x1dd1ae(0x1ce)]?.[_0x1dd1ae(0x1d1)][_0x1dd1ae(0x1e6)]??0x0,'errors':_0x4cfc47[_0x1dd1ae(0x1d9)][_0x1dd1ae(0x1ea)]})),'errors':_0x54ed61['report']['errors'],'commandCount':_0x54ed61[_0x1dd1ae(0x1ce)]?.[_0x1dd1ae(0x1d1)][_0x1dd1ae(0x1e6)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x2abce6){const _0x46a142=a39_0x3e027e,_0x1d65fe=importServiceManifest(_0x2abce6['str']('file'));if(_0x1d65fe[_0x46a142(0x1b5)][_0x46a142(0x1e6)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x1d65fe[_0x46a142(0x1ca)],'imported':_0x1d65fe[_0x46a142(0x1c6)],'updated':_0x1d65fe[_0x46a142(0x1eb)],'serviceCount':_0x1d65fe[_0x46a142(0x1b9)],'services':_0x1d65fe[_0x46a142(0x1b5)]['map'](summarizeService)},'message':_0x46a142(0x1c2)+_0x1d65fe['imported']+_0x46a142(0x1bd)+_0x1d65fe[_0x46a142(0x1eb)]+_0x46a142(0x1df)};return{'ok':!![],'data':{'registryPath':_0x1d65fe['registryPath'],'replaced':_0x1d65fe['replaced'],'imported':_0x1d65fe[_0x46a142(0x1c6)],'updated':_0x1d65fe[_0x46a142(0x1eb)],'serviceCount':_0x1d65fe[_0x46a142(0x1b9)],'service':summarizeService(_0x1d65fe[_0x46a142(0x1c7)])},'message':(_0x1d65fe[_0x46a142(0x1dd)]?'Updated':_0x46a142(0x1be))+_0x46a142(0x1ef)+_0x1d65fe[_0x46a142(0x1c7)]['serviceCode']+'.'};}},{'service':a39_0x3e027e(0x1e1),'command':a39_0x3e027e(0x1cd),'description':a39_0x3e027e(0x1d6),'risk':a39_0x3e027e(0x1bf),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x4f0281){const _0x2d0ff7=a39_0x3e027e,_0x2a9b8f=getLocalServiceEntry(_0x4f0281[_0x2d0ff7(0x1b8)](_0x2d0ff7(0x1e1)));return{'method':_0x2d0ff7(0x1d0),'url':_0x4f0281[_0x2d0ff7(0x1b8)]('file'),'body':{'service':_0x4f0281['str'](_0x2d0ff7(0x1e1)),'found':Boolean(_0x2a9b8f),'version':_0x2a9b8f?.[_0x2d0ff7(0x1d4)],'source':_0x2a9b8f?.[_0x2d0ff7(0x1e2)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x35f4cd){const _0x5646d4=a39_0x3e027e,_0x4ee5a4=exportServiceManifest(_0x35f4cd['str'](_0x5646d4(0x1e1)),_0x35f4cd[_0x5646d4(0x1b8)](_0x5646d4(0x1ba)));return{'ok':!![],'data':{'registryPath':_0x4ee5a4[_0x5646d4(0x1ca)],'file':_0x4ee5a4[_0x5646d4(0x1b2)],'service':summarizeService(_0x4ee5a4[_0x5646d4(0x1c7)])},'message':_0x5646d4(0x1d8)+_0x4ee5a4[_0x5646d4(0x1c7)]['serviceCode']+'.'};}},{'service':'service','command':a39_0x3e027e(0x1de),'description':a39_0x3e027e(0x1e4),'risk':a39_0x3e027e(0x1b4),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x56fda9=a39_0x3e027e,_0x118dd4=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x118dd4[_0x56fda9(0x1e6)],'services':_0x118dd4['map'](summarizeService)}};}},{'service':a39_0x3e027e(0x1e1),'command':'remove','description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0x3e027e(0x1bf),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x14597d){const _0x2a80b3=a39_0x3e027e,_0x5f3170=getLocalServiceEntry(_0x14597d[_0x2a80b3(0x1b8)](_0x2a80b3(0x1e1)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x14597d['str'](_0x2a80b3(0x1e1)),'found':Boolean(_0x5f3170),'version':_0x5f3170?.[_0x2a80b3(0x1d4)],'source':_0x5f3170?.['source']},'description':_0x2a80b3(0x1c1)};},async 'execute'(_0x3dd546){const _0x5e1475=a39_0x3e027e,_0x2878aa=removeServiceManifest(_0x3dd546[_0x5e1475(0x1b8)](_0x5e1475(0x1e1)));return{'ok':!![],'data':{'registryPath':_0x2878aa[_0x5e1475(0x1ca)],'serviceCount':_0x2878aa[_0x5e1475(0x1b9)],'service':summarizeService(_0x2878aa['entry'])},'message':_0x5e1475(0x1e5)+_0x2878aa['entry'][_0x5e1475(0x1bb)]+'.'};}},{'service':a39_0x3e027e(0x1e1),'command':'detail','description':a39_0x3e027e(0x1c3),'risk':a39_0x3e027e(0x1b4),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x5607d8){const _0x25c854=a39_0x3e027e,_0x24ac3c=getLocalServiceEntry(_0x5607d8['str'](_0x25c854(0x1e1)));if(!_0x24ac3c)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x5607d8['str'](_0x25c854(0x1e1))},'message':'Local\x20service\x20not\x20found:\x20'+_0x5607d8[_0x25c854(0x1b8)](_0x25c854(0x1e1))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x24ac3c),'manifest':_0x24ac3c[_0x25c854(0x1f1)],'normalizedManifest':_0x24ac3c['normalizedManifest']}};}}];