@lovrabet/lovrabet-cli 2.1.11 → 2.1.12

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_0x1304ff=a30_0x11b3;function a30_0x11b3(_0x483ae4,_0x31e512){_0x483ae4=_0x483ae4-0x162;const _0x2b0248=a30_0x2b02();let _0x11b363=_0x2b0248[_0x483ae4];return _0x11b363;}(function(_0x5f30d9,_0x3f05c6){const _0x229c10=a30_0x11b3,_0x5bae0a=_0x5f30d9();while(!![]){try{const _0x1a769e=parseInt(_0x229c10(0x167))/0x1+-parseInt(_0x229c10(0x164))/0x2*(parseInt(_0x229c10(0x16e))/0x3)+parseInt(_0x229c10(0x168))/0x4+parseInt(_0x229c10(0x172))/0x5+parseInt(_0x229c10(0x17f))/0x6*(-parseInt(_0x229c10(0x17a))/0x7)+parseInt(_0x229c10(0x185))/0x8+parseInt(_0x229c10(0x16c))/0x9;if(_0x1a769e===_0x3f05c6)break;else _0x5bae0a['push'](_0x5bae0a['shift']());}catch(_0x36bc6f){_0x5bae0a['push'](_0x5bae0a['shift']());}}}(a30_0x2b02,0x634c0));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x1304ff(0x176),'type':a30_0x1304ff(0x170),'required':!![],'description':a30_0x1304ff(0x171)},FILEPATH_FLAG={'name':a30_0x1304ff(0x17e),'type':a30_0x1304ff(0x170),'required':!![],'description':a30_0x1304ff(0x16a)},DOWNLOAD_FLAG={'name':a30_0x1304ff(0x188),'type':a30_0x1304ff(0x162),'description':a30_0x1304ff(0x179)},LONG_TERM_FLAG={'name':'long-term','type':a30_0x1304ff(0x162),'description':'Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML'};function requireFilePath(_0x3a131a){const _0x428f79=a30_0x1304ff,_0x2dcd54=_0x3a131a[_0x428f79(0x183)]();if(!_0x2dcd54)throw CliErrors[_0x428f79(0x182)](_0x428f79(0x16d));return _0x2dcd54;}const fileUpload={'service':a30_0x1304ff(0x176),'command':'upload','description':a30_0x1304ff(0x184),'risk':a30_0x1304ff(0x181),'flags':[FILE_FLAG],async 'dryRun'(_0x1cfab7){const _0x5a47a6=a30_0x1304ff,_0xf7e24c=requireRuntimeUploadFile(_0x1cfab7[_0x5a47a6(0x17b)](_0x5a47a6(0x176)),_0x5a47a6(0x175));return dryRun(_0x5a47a6(0x163),_0x5a47a6(0x177))[_0x5a47a6(0x16b)]({'appCode':_0x1cfab7[_0x5a47a6(0x186)],'multipart':{'file':_0xf7e24c}})['description'](_0x5a47a6(0x166)+_0xf7e24c[_0x5a47a6(0x17d)]+_0x5a47a6(0x178)+_0x1cfab7[_0x5a47a6(0x186)])['build']();},async 'execute'(_0x2a2ba8){const _0x1351e1=a30_0x1304ff,_0x521b26=requireRuntimeUploadFile(_0x2a2ba8[_0x1351e1(0x17b)](_0x1351e1(0x176)),_0x1351e1(0x175)),_0x2176a4=await uploadRuntimeFile(_0x2a2ba8[_0x1351e1(0x186)],_0x521b26[_0x1351e1(0x17d)]);return{'ok':!![],'data':_0x2176a4,'message':_0x2176a4[_0x1351e1(0x169)]?_0x1351e1(0x187)+_0x2176a4[_0x1351e1(0x169)]+_0x1351e1(0x16f):_0x1351e1(0x173)};}},fileQueryUrl={'service':a30_0x1304ff(0x176),'command':a30_0x1304ff(0x17c),'description':a30_0x1304ff(0x174),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x456d50){const _0x3c0623=a30_0x1304ff,_0x5e4dff=requireFilePath(_0x456d50[_0x3c0623(0x17b)](_0x3c0623(0x17e))),_0xd1e05=await queryRuntimeFileUrl(_0x5e4dff,{'download':_0x456d50[_0x3c0623(0x180)](_0x3c0623(0x188)),'longTerm':_0x456d50[_0x3c0623(0x180)](_0x3c0623(0x165))});return{'ok':!![],'data':_0xd1e05};}};function a30_0x2b02(){const _0x44f56c=['path','filepath','6kKRIzy','bool','write','validation','trim','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','368824LuObEX','appCode','Uploaded\x20file:\x20','download','boolean','POST','724fDOYsG','long-term','Preview:\x20upload\x20','248201zyMIZh','762036pnmdmm','filePath','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','body','328113KIOnSu','filePath\x20is\x20required.','4863IEpLUx','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','string','Path\x20to\x20the\x20local\x20file\x20to\x20upload','3327180xLqzwX','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','File','file','/client/uploadFile','\x20to\x20runtime\x20app\x20','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','1352288bUDANJ','str','query-url'];a30_0x2b02=function(){return _0x44f56c;};return a30_0x2b02();}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_0x391488=a31_0x52fc;(function(_0x260b78,_0x5237dc){const _0x23a9b8=a31_0x52fc,_0xea5a2a=_0x260b78();while(!![]){try{const _0x40b1ce=parseInt(_0x23a9b8(0x17a))/0x1+parseInt(_0x23a9b8(0x15f))/0x2*(-parseInt(_0x23a9b8(0x19c))/0x3)+-parseInt(_0x23a9b8(0x17e))/0x4*(parseInt(_0x23a9b8(0x17d))/0x5)+parseInt(_0x23a9b8(0x198))/0x6+parseInt(_0x23a9b8(0x192))/0x7+-parseInt(_0x23a9b8(0x193))/0x8*(parseInt(_0x23a9b8(0x19e))/0x9)+-parseInt(_0x23a9b8(0x176))/0xa;if(_0x40b1ce===_0x5237dc)break;else _0xea5a2a['push'](_0xea5a2a['shift']());}catch(_0x354ef){_0xea5a2a['push'](_0xea5a2a['shift']());}}}(a31_0x36c0,0x3c766));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';function a31_0x36c0(){const _0xcb039d=['1800234ADGbIP','app','file','parse','470919voKNEX',')\x20instead\x20of\x20project','24741xAepAr','project','App\x20code\x20cannot\x20be\x20empty.','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','boolean','Usage:\x20','\x20already\x20exists.\x20Overwrite?','User\x20aborted\x20prompt','4izWoUt','App\x20code','removeListener','newConfigFileName','question','\x20\x20env:\x20\x20\x20\x20\x20','cancelled','SIGINT','close','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','appcode','\x20init\x20—\x20Create\x20','global','Override\x20imported\x20default\x20env','\x20\x20appcode:\x20','Source\x20file\x20not\x20found:\x20','apiDir','Aborted.','object','name','trim','includes','string','4910320njoLrd','riskLevel','validation','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`.','435915koSaxV','Imported\x20from\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','15QAEZsW','71052THIIFM','Skip\x20confirmation\x20when\x20overwriting','yes','entries','\x22.\x20Allowed:\x20','stdin','Write\x20to\x20global\x20(~/','env','\x0aInitialized\x20','log','defaultApp','[Y/n]','join','Initialized\x20','stdout','\x20\x20default:\x20','\x20\x20config:\x20\x20','[y/N]','apps','message','2936143IfXeUz','144UiFyxd','race','toLowerCase','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','App\x20code\x20for\x20the\x20project'];a31_0x36c0=function(){return _0xcb039d;};return a31_0x36c0();}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':'appcode','type':a31_0x391488(0x175),'description':a31_0x391488(0x197)},{'name':a31_0x391488(0x185),'type':a31_0x391488(0x175),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a31_0x391488(0x185)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x391488(0x15b),'description':a31_0x391488(0x184)+PRODUCT_CONFIG['newConfigFileName']+a31_0x391488(0x19d),'default':![]},{'name':a31_0x391488(0x180),'type':a31_0x391488(0x15b),'description':a31_0x391488(0x17f),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x391488(0x19a),'type':'string','description':a31_0x391488(0x1a1),'required':!![]},{'name':a31_0x391488(0x169),'type':a31_0x391488(0x175),'description':'Override\x20imported\x20default\x20appcode'},{'name':'env','type':'string','description':a31_0x391488(0x16c),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x391488(0x16b),'type':a31_0x391488(0x15b),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x391488(0x162)]+a31_0x391488(0x19d),'default':![]},{'name':a31_0x391488(0x180),'type':a31_0x391488(0x15b),'description':a31_0x391488(0x17f),'default':![]}];export async function runInit(_0x5886b7){const _0x4556a9=a31_0x391488,_0x9a3fc8=isNonInteractiveMode(_0x5886b7),_0x4e022c=_0x5886b7['global']?_0x4556a9(0x16b):_0x4556a9(0x19f),_0x3b2b5f=resolveWriteConfigPath(_0x4e022c);try{_0x9a3fc8?await runNonInteractive(_0x5886b7,_0x3b2b5f):await runInteractive(_0x5886b7,_0x3b2b5f);}catch(_0x465c94){if(_0x465c94 instanceof AbortPrompt)throw CliErrors[_0x4556a9(0x165)]();throw _0x465c94;}}export async function runInitImport(_0x44e603){const _0x4b89c5=a31_0x391488,_0x52ef66=_0x44e603[_0x4b89c5(0x16b)]?_0x4b89c5(0x16b):'project',_0x40b3ee=resolveWriteConfigPath(_0x52ef66);await runFromImport(_0x44e603,_0x40b3ee);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x391488(0x16f)]);async function runFromImport(_0x18b4f1,_0x4fa9ef){const _0x35641b=a31_0x391488,_0x18cef1=resolveFilePath(_0x18b4f1[_0x35641b(0x19a)]);if(!existsSync(_0x18cef1))throw CliErrors[_0x35641b(0x178)](_0x35641b(0x16e)+_0x18cef1);const _0x5693ce=readSourceFile(_0x18cef1),_0x1314ee=convertToRuntimeConfig(_0x5693ce);_0x18b4f1[_0x35641b(0x169)]&&(_0x1314ee[_0x35641b(0x169)]=String(_0x18b4f1[_0x35641b(0x169)]));_0x18b4f1[_0x35641b(0x185)]&&(_0x1314ee['env']=resolveInitEnv(_0x18b4f1));if(!_0x1314ee['appcode'])throw CliErrors[_0x35641b(0x178)](_0x35641b(0x17c),_0x35641b(0x179));await writeInitConfig(_0x4fa9ef,_0x1314ee,_0x18b4f1),console['log'](_0x35641b(0x17b)+_0x18cef1),console[_0x35641b(0x187)](_0x35641b(0x18e)+_0x4fa9ef),console['log'](_0x35641b(0x16d)+_0x1314ee['appcode']);if(_0x1314ee[_0x35641b(0x188)])console[_0x35641b(0x187)](_0x35641b(0x18d)+_0x1314ee['defaultApp']);}function convertToRuntimeConfig(_0x186718){const _0x3946a6=a31_0x391488;if(_0x186718[_0x3946a6(0x190)]&&typeof _0x186718[_0x3946a6(0x190)]===_0x3946a6(0x171))throw CliErrors[_0x3946a6(0x178)](_0x3946a6(0x196),_0x3946a6(0x168));const _0x3b7fc4={};for(const _0x24fe44 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x186718[_0x24fe44]!==undefined&&(_0x3b7fc4[_0x24fe44]=_0x186718[_0x24fe44]);}return!_0x3b7fc4[_0x3946a6(0x177)]&&(_0x3b7fc4['riskLevel']=DEFAULT_CONFIG_VALUES[_0x3946a6(0x177)]),_0x3b7fc4;}async function runNonInteractive(_0x1de130,_0x4dc6c4){const _0x4561fe=a31_0x391488,_0x41e582=_0x1de130[_0x4561fe(0x169)];if(!_0x41e582)throw CliErrors['flagMissing']('appcode',_0x4561fe(0x15c)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x194539=resolveInitEnv(_0x1de130);await writeInitConfig(_0x4dc6c4,{'appcode':_0x41e582,'env':_0x194539},_0x1de130),console[_0x4561fe(0x187)](_0x4561fe(0x18b)+_0x4dc6c4),console[_0x4561fe(0x187)](_0x4561fe(0x16d)+_0x41e582),console['log'](_0x4561fe(0x164)+_0x194539);}async function runInteractive(_0x10f0c9,_0x554dc9){const _0x326a6f=a31_0x391488,_0xda54fa=loadExisting(_0x554dc9),_0x18bc06=typeof _0xda54fa?.[_0x326a6f(0x169)]===_0x326a6f(0x175)?_0xda54fa[_0x326a6f(0x169)]:'',_0x14fcd1=resolveInitEnv(_0x10f0c9);console[_0x326a6f(0x187)](CLI_BIN_NAME+_0x326a6f(0x16a)+PRODUCT_CONFIG[_0x326a6f(0x162)]+'\x0a');if(existsSync(_0x554dc9)&&!_0x10f0c9[_0x326a6f(0x180)]){const _0x567a7c=await promptYesNo('File\x20'+_0x554dc9+_0x326a6f(0x15d),![]);if(!_0x567a7c){console['log'](_0x326a6f(0x170));return;}}const _0x21d84b=typeof _0x10f0c9['appcode']==='string'?_0x10f0c9['appcode'][_0x326a6f(0x173)]():'';let _0x124015=_0x21d84b;!_0x124015&&(_0x124015=await promptInput(_0x326a6f(0x160),_0x18bc06));if(!_0x124015[_0x326a6f(0x173)]())throw CliErrors['validation'](_0x326a6f(0x1a0));await writeInitConfig(_0x554dc9,{'appcode':_0x124015[_0x326a6f(0x173)](),'env':_0x14fcd1},_0x10f0c9),console[_0x326a6f(0x187)](_0x326a6f(0x186)+_0x554dc9),console['log'](_0x326a6f(0x16d)+_0x124015[_0x326a6f(0x173)]()),console['log'](_0x326a6f(0x164)+_0x14fcd1);}async function writeInitConfig(_0x27e4e,_0x5bdf88,_0xa951c6){const _0x70ed8f=a31_0x391488;let _0x50670e={};existsSync(_0x27e4e)&&!_0xa951c6[_0x70ed8f(0x180)]&&(_0x50670e=readConfigFile(_0x27e4e));for(const [_0x1229a1,_0x579fe9]of Object[_0x70ed8f(0x181)](_0x5bdf88)){_0x579fe9!==undefined&&(_0x50670e[_0x1229a1]=_0x579fe9);}if(_0x50670e[_0x70ed8f(0x199)])delete _0x50670e[_0x70ed8f(0x199)];writeConfigFile(_0x27e4e,_0x50670e);}class AbortPrompt extends Error{constructor(){const _0x38a0f0=a31_0x391488;super(_0x38a0f0(0x15e)),this[_0x38a0f0(0x172)]='AbortPrompt';}}function createSafeRl(){const _0x5c9359=a31_0x391488,_0x8c9c6d=createInterface({'input':process[_0x5c9359(0x183)],'output':process[_0x5c9359(0x18c)]});let _0x1cc132;const _0x339a2b=new Promise((_0x24fd08,_0x2dff36)=>{_0x1cc132=()=>{const _0x3f12fd=a31_0x52fc;_0x1cc132&&(_0x8c9c6d['removeListener'](_0x3f12fd(0x166),_0x1cc132),_0x1cc132=undefined);try{_0x8c9c6d[_0x3f12fd(0x167)]();}catch{}_0x2dff36(new AbortPrompt());},_0x8c9c6d['once']('SIGINT',_0x1cc132);}),_0x4c2836=()=>{const _0x184d85=_0x5c9359;_0x1cc132&&(_0x8c9c6d[_0x184d85(0x161)]('SIGINT',_0x1cc132),_0x1cc132=undefined);try{_0x8c9c6d['close']();}catch{}};return{'rl':_0x8c9c6d,'abortPromise':_0x339a2b,'disposeSuccess':_0x4c2836};}async function promptInput(_0xb8c426,_0x388098){const _0x394449=a31_0x391488,{rl:_0x123638,abortPromise:_0x5f16ee,disposeSuccess:_0x79e484}=createSafeRl(),_0x1baf2e=new Promise(_0x59b313=>{const _0x4d56af=_0x388098?'\x20\x20'+_0xb8c426+'\x20('+_0x388098+'):\x20':'\x20\x20'+_0xb8c426+':\x20';_0x123638['question'](_0x4d56af,_0x61adc3=>{const _0x2ad006=a31_0x52fc;_0x79e484(),_0x59b313(_0x61adc3[_0x2ad006(0x173)]()||_0x388098);});});return Promise[_0x394449(0x194)]([_0x1baf2e,_0x5f16ee]);}async function promptYesNo(_0x48dc3b,_0x2c56cf){const {rl:_0x1b8166,abortPromise:_0x4d0499,disposeSuccess:_0xb2cc14}=createSafeRl(),_0x4b98fd=new Promise(_0x32253c=>{const _0xabf01f=a31_0x52fc,_0x577460=_0x2c56cf?_0xabf01f(0x189):_0xabf01f(0x18f);_0x1b8166[_0xabf01f(0x163)]('\x20\x20'+_0x48dc3b+'\x20'+_0x577460+':\x20',_0x2f70de=>{const _0x2f5367=_0xabf01f;_0xb2cc14();const _0x20c1ad=_0x2f70de[_0x2f5367(0x173)]()[_0x2f5367(0x195)]();if(_0x20c1ad==='y'||_0x20c1ad===_0x2f5367(0x180))_0x32253c(!![]);else{if(_0x20c1ad==='n'||_0x20c1ad==='no')_0x32253c(![]);else _0x32253c(_0x2c56cf);}});});return Promise['race']([_0x4b98fd,_0x4d0499]);}function loadExisting(_0x24ac32){if(!existsSync(_0x24ac32))return null;return readConfigFile(_0x24ac32);}function resolveFilePath(_0x361c1d){return isAbsolute(_0x361c1d)?_0x361c1d:resolve(process['cwd'](),_0x361c1d);}function a31_0x52fc(_0x3f289f,_0x2fc7f4){_0x3f289f=_0x3f289f-0x15b;const _0x36c040=a31_0x36c0();let _0x52fc38=_0x36c040[_0x3f289f];return _0x52fc38;}function readSourceFile(_0x2e9a81){const _0x56f4ae=a31_0x391488;try{const _0x85ee7=readFileSync(_0x2e9a81,{'encoding':'utf8'});return JSON[_0x56f4ae(0x19b)](_0x85ee7);}catch(_0x3d3b78){throw CliErrors['validation']('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x3d3b78[_0x56f4ae(0x191)]);}}function resolveInitEnv(_0x542a68){const _0x3c16d5=a31_0x391488,_0x3c46f3=_0x542a68[_0x3c16d5(0x185)];if(_0x3c46f3===undefined||_0x3c46f3==='')return DEFAULT_CONFIG_VALUES[_0x3c16d5(0x185)];if(!RUNTIME_ENV_VALUES[_0x3c16d5(0x174)](_0x3c46f3))throw CliErrors[_0x3c16d5(0x178)]('Invalid\x20env\x20\x22'+_0x3c46f3+_0x3c16d5(0x182)+RUNTIME_ENV_VALUES[_0x3c16d5(0x18a)](',\x20'));return _0x3c46f3;}
@@ -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_0x3e3fc6=a32_0x5c35;(function(_0x2e720a,_0x22fa55){const _0x4ebe28=a32_0x5c35,_0x1c1ef2=_0x2e720a();while(!![]){try{const _0x3fc508=parseInt(_0x4ebe28(0x142))/0x1*(-parseInt(_0x4ebe28(0x117))/0x2)+parseInt(_0x4ebe28(0x107))/0x3*(-parseInt(_0x4ebe28(0x10d))/0x4)+-parseInt(_0x4ebe28(0x128))/0x5+parseInt(_0x4ebe28(0x13f))/0x6*(parseInt(_0x4ebe28(0x11c))/0x7)+-parseInt(_0x4ebe28(0x126))/0x8*(-parseInt(_0x4ebe28(0x13c))/0x9)+-parseInt(_0x4ebe28(0x12b))/0xa*(-parseInt(_0x4ebe28(0x134))/0xb)+parseInt(_0x4ebe28(0x119))/0xc;if(_0x3fc508===_0x22fa55)break;else _0x1c1ef2['push'](_0x1c1ef2['shift']());}catch(_0x45efa9){_0x1c1ef2['push'](_0x1c1ef2['shift']());}}}(a32_0x35a4,0x4cf66));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_0x5c35(_0x3f59d4,_0xb7abce){_0x3f59d4=_0x3f59d4-0x101;const _0x35a41f=a32_0x35a4();let _0x5c359b=_0x35a41f[_0x3f59d4];return _0x5c359b;}function a32_0x35a4(){const _0xc2c95a=['build','ragErrorMessage','read','str','topk','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','content','/client/knowledge-base/personal/','trim','8QiYDmK','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','2439225uIMOvp','createTime','file','50TYCHhK','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','flag','title','appCode','isFile','Updated\x20KB\x20entry\x20','--topk\x20must\x20be\x20a\x20positive\x20number.','235477oRebtZ','updateTime','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','weightedScore','scope','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Search\x20query\x20is\x20required.','length','3391371EzhCHN','query','detail','30vveDKP','num','verbose','1tgrAsS','Personal\x20knowledge-base\x20entry\x20title','create','number','Created\x20KB\x20entry\x20','File\x20path\x20is\x20required.','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','metadata','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','61917fFsSlh','version','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','POST','userId','write','120vZhVXf','utf8','map','validation','Personal\x20knowledge-base\x20entry\x20ID','isFinite','bool','score','File\x20is\x20not\x20a\x20regular\x20file:\x20','string','606014GVdlnd','ragStatus','7927752PGgRIN','update','/update','813064ovjVfD'];a32_0x35a4=function(){return _0xc2c95a;};return a32_0x35a4();}import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':'title','type':a32_0x3e3fc6(0x116),'required':!![],'description':a32_0x3e3fc6(0x143)},FILE_FLAG={'name':a32_0x3e3fc6(0x12a),'type':a32_0x3e3fc6(0x116),'required':!![],'description':a32_0x3e3fc6(0x104)},QUERY_FLAG={'name':a32_0x3e3fc6(0x13d),'type':a32_0x3e3fc6(0x116),'required':!![],'description':a32_0x3e3fc6(0x12c)},TOPK_FLAG={'name':a32_0x3e3fc6(0x121),'type':a32_0x3e3fc6(0x101),'description':a32_0x3e3fc6(0x127)};function readKnowledgeFile(_0x4d81af){const _0xa04e21=a32_0x3e3fc6;if(!_0x4d81af)throw CliErrors[_0xa04e21(0x110)](_0xa04e21(0x103));if(!existsSync(_0x4d81af))throw CliErrors[_0xa04e21(0x110)]('File\x20not\x20found:\x20'+_0x4d81af);if(!statSync(_0x4d81af)[_0xa04e21(0x131)]())throw CliErrors[_0xa04e21(0x110)](_0xa04e21(0x115)+_0x4d81af);return readFileSync(_0x4d81af,_0xa04e21(0x10e));}function summarizePersonalItem(_0x4758dc){const _0x34b6b7=a32_0x3e3fc6;return{'id':_0x4758dc['id'],'title':_0x4758dc[_0x34b6b7(0x12f)],'version':_0x4758dc[_0x34b6b7(0x108)],'ragStatus':_0x4758dc[_0x34b6b7(0x118)],'ragErrorMessage':_0x4758dc['ragErrorMessage'],'updateTime':_0x4758dc[_0x34b6b7(0x135)]};}function detailPersonalItem(_0x52cf43){const _0x296caa=a32_0x3e3fc6;return{'id':_0x52cf43['id'],'appCode':_0x52cf43['appCode'],'scope':_0x52cf43[_0x296caa(0x138)],'userId':_0x52cf43[_0x296caa(0x10b)],'title':_0x52cf43[_0x296caa(0x12f)],'content':_0x52cf43['content']??'','version':_0x52cf43['version'],'ragStatus':_0x52cf43['ragStatus'],'ragErrorMessage':_0x52cf43[_0x296caa(0x11e)],'createTime':_0x52cf43[_0x296caa(0x129)],'updateTime':_0x52cf43['updateTime']};}function summarizeSearchHit(_0x201a36){const _0x2fef23=a32_0x3e3fc6;return{'scope':_0x201a36['scope'],'title':_0x201a36[_0x2fef23(0x12f)],'docId':_0x201a36['docId'],'score':_0x201a36[_0x2fef23(0x114)],'weightedScore':_0x201a36[_0x2fef23(0x137)],'content':_0x201a36[_0x2fef23(0x123)],'metadata':_0x201a36[_0x2fef23(0x105)]};}function readTopK(_0x5828d2){const _0x2d5b15=a32_0x3e3fc6,_0x1e14f9=_0x5828d2[_0x2d5b15(0x12e)]('topk');if(_0x1e14f9===undefined||_0x1e14f9===null||_0x1e14f9==='')return undefined;const _0x3d4bf8=_0x5828d2['num']('topk');if(!Number[_0x2d5b15(0x112)](_0x3d4bf8)||_0x3d4bf8<0x1)throw CliErrors[_0x2d5b15(0x110)](_0x2d5b15(0x133));return _0x3d4bf8;}const kbList={'service':'kb','command':'list','description':a32_0x3e3fc6(0x136),'risk':a32_0x3e3fc6(0x11f),'flags':[VERBOSE_FLAG],async 'execute'(_0x3d8538){const _0x41a602=a32_0x3e3fc6,_0x17de68=await listPersonalKnowledgeBaseItems(_0x3d8538[_0x41a602(0x130)]);if(_0x3d8538[_0x41a602(0x113)](_0x41a602(0x141)))return{'ok':!![],'data':{'total':_0x17de68['length'],'items':_0x17de68}};return{'ok':!![],'data':{'total':_0x17de68[_0x41a602(0x13b)],'items':_0x17de68['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x3e3fc6(0x13e),'description':a32_0x3e3fc6(0x122),'risk':a32_0x3e3fc6(0x11f),'flags':[{...ID_FLAG,'description':a32_0x3e3fc6(0x111)}],async 'execute'(_0x1c64f0){const _0xfa5067=a32_0x3e3fc6,_0xb38854=await getPersonalKnowledgeBaseItem(_0x1c64f0[_0xfa5067(0x140)]('id'),_0x1c64f0[_0xfa5067(0x130)]);return{'ok':!![],'data':detailPersonalItem(_0xb38854)};}},kbCreate={'service':'kb','command':a32_0x3e3fc6(0x144),'description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a32_0x3e3fc6(0x10c),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x4ab19d){const _0x1ad3b3=a32_0x3e3fc6,_0x5e48cc=_0x4ab19d['str'](_0x1ad3b3(0x12f)),_0x2cb5cf=readKnowledgeFile(_0x4ab19d[_0x1ad3b3(0x120)](_0x1ad3b3(0x12a))),_0x1b9298=await createPersonalKnowledgeBaseItem(_0x4ab19d[_0x1ad3b3(0x130)],{'title':_0x5e48cc,'content':_0x2cb5cf});return{'ok':!![],'data':summarizePersonalItem(_0x1b9298),'message':_0x1ad3b3(0x102)+_0x1b9298['id']+'\x20('+_0x1b9298[_0x1ad3b3(0x12f)]+')'};},async 'dryRun'(_0x4f6a90){const _0x1f0c75=a32_0x3e3fc6,_0x293409=_0x4f6a90[_0x1f0c75(0x120)]('title'),_0x5ac51f=readKnowledgeFile(_0x4f6a90[_0x1f0c75(0x120)](_0x1f0c75(0x12a)));return dryRun('POST','/client/knowledge-base/personal/create')['body']({'appCode':_0x4f6a90[_0x1f0c75(0x130)],'title':_0x293409,'content':_0x5ac51f})['description'](_0x1f0c75(0x106)+_0x293409+'\x22')[_0x1f0c75(0x11d)]();}},kbUpdate={'service':'kb','command':a32_0x3e3fc6(0x11a),'description':a32_0x3e3fc6(0x139),'risk':a32_0x3e3fc6(0x10c),'flags':[{...ID_FLAG,'description':a32_0x3e3fc6(0x111)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x1b3e18){const _0x14d4cb=a32_0x3e3fc6,_0x49c362=_0x1b3e18[_0x14d4cb(0x140)]('id'),_0x4d25e7=readKnowledgeFile(_0x1b3e18[_0x14d4cb(0x120)](_0x14d4cb(0x12a))),_0x36a84f=_0x1b3e18['str']('title')||(await getPersonalKnowledgeBaseItem(_0x49c362,_0x1b3e18[_0x14d4cb(0x130)]))['title'],_0x160b0e=await updatePersonalKnowledgeBaseItem(_0x49c362,_0x1b3e18[_0x14d4cb(0x130)],{'title':_0x36a84f,'content':_0x4d25e7});return{'ok':!![],'data':summarizePersonalItem(_0x160b0e),'message':_0x14d4cb(0x132)+_0x160b0e['id']+'\x20('+_0x160b0e[_0x14d4cb(0x12f)]+')'};},async 'dryRun'(_0x5e1c8f){const _0x54a851=a32_0x3e3fc6,_0x18bfee=_0x5e1c8f[_0x54a851(0x140)]('id'),_0x6331c5=readKnowledgeFile(_0x5e1c8f[_0x54a851(0x120)](_0x54a851(0x12a))),_0x2f4710=_0x5e1c8f[_0x54a851(0x120)](_0x54a851(0x12f))||(await getPersonalKnowledgeBaseItem(_0x18bfee,_0x5e1c8f[_0x54a851(0x130)]))['title'];return dryRun(_0x54a851(0x10a),_0x54a851(0x124)+_0x18bfee+_0x54a851(0x11b))['body']({'appCode':_0x5e1c8f['appCode'],'title':_0x2f4710,'content':_0x6331c5})['description'](_0x54a851(0x12d)+_0x18bfee)['build']();}},kbSearch={'service':'kb','command':'search','description':a32_0x3e3fc6(0x109),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x2904b5){const _0x2b95f3=a32_0x3e3fc6;if(!_0x2904b5[_0x2b95f3(0x120)](_0x2b95f3(0x13d))['trim']())throw CliErrors[_0x2b95f3(0x110)](_0x2b95f3(0x13a));readTopK(_0x2904b5);},async 'execute'(_0xe42587){const _0x1fdac6=a32_0x3e3fc6,_0xe301ae=_0xe42587[_0x1fdac6(0x120)](_0x1fdac6(0x13d))[_0x1fdac6(0x125)](),_0x4aba7c=readTopK(_0xe42587),_0x1174d2=await searchKnowledgeBase(_0xe42587[_0x1fdac6(0x130)],{'query':_0xe301ae,'topK':_0x4aba7c});return{'ok':!![],'data':{'total':_0x1174d2['length'],'hits':_0x1174d2[_0x1fdac6(0x10f)](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
+ const a33_0x206bb9=a33_0x9d8a;(function(_0xa5dff0,_0x2bcaec){const _0x225ae8=a33_0x9d8a,_0x35fdd2=_0xa5dff0();while(!![]){try{const _0x3a5425=parseInt(_0x225ae8(0xd1))/0x1*(parseInt(_0x225ae8(0xcd))/0x2)+parseInt(_0x225ae8(0xcb))/0x3*(parseInt(_0x225ae8(0xd9))/0x4)+-parseInt(_0x225ae8(0xb9))/0x5*(parseInt(_0x225ae8(0xc5))/0x6)+parseInt(_0x225ae8(0xba))/0x7+parseInt(_0x225ae8(0xd8))/0x8+parseInt(_0x225ae8(0xca))/0x9+parseInt(_0x225ae8(0xc3))/0xa*(-parseInt(_0x225ae8(0xc6))/0xb);if(_0x3a5425===_0x2bcaec)break;else _0x35fdd2['push'](_0x35fdd2['shift']());}catch(_0xcdafa5){_0x35fdd2['push'](_0x35fdd2['shift']());}}}(a33_0x37ba,0x93cf7));function a33_0x9d8a(_0x5753b9,_0x3928e){_0x5753b9=_0x5753b9-0xb3;const _0x37ba5a=a33_0x37ba();let _0x9d8ada=_0x37ba5a[_0x5753b9];return _0x9d8ada;}function a33_0x37ba(){const _0x2adf8b=['show','\x20\x20\x20Time:\x20','en-US','message','duration','1405510qMDrOW','796663UXkdoA','logs','\x20\x20\x20Details:\x20','read','timestamp','Clear\x20command\x20history\x20logs','command','length','keys','18250Fmsukz','View\x20command\x20history\x20logs','18XATmVd','341zOOfDO','error','log','*\x20No\x20logs\x20found','1890873FOOpRT','58818ZLAUHA','\x20\x20\x20Duration:\x20','186142YyXuru','forEach','success','stringify','4RDnidC','clear','write','details','toLocaleString','clearLogs','\x20logs:\x0a','6159280hJASjC','8QQZmYc','level','*\x20Logs\x20cleared','warn'];a33_0x37ba=function(){return _0x2adf8b;};return a33_0x37ba();}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x31a815){const _0x547862=a33_0x9d8a;if(_0x31a815[_0x547862(0xc1)]===0x0){console[_0x547862(0xc8)](_0x547862(0xc9));return;}console[_0x547862(0xc8)]('*\x20'+CLI_DISPLAY_NAME+_0x547862(0xd7)),_0x31a815[_0x547862(0xce)]((_0x208bc2,_0x5e6c5f)=>{const _0x7fd2c5=_0x547862,_0x35a97d=new Date(_0x208bc2[_0x7fd2c5(0xbe)])[_0x7fd2c5(0xd5)](_0x7fd2c5(0xb6)),_0x21e0c8=_0x208bc2[_0x7fd2c5(0xda)]===_0x7fd2c5(0xcf)?'√':_0x208bc2[_0x7fd2c5(0xda)]===_0x7fd2c5(0xc7)?'×':_0x208bc2[_0x7fd2c5(0xda)]===_0x7fd2c5(0xb3)?'!':'i';console['log'](_0x5e6c5f+0x1+'.\x20'+_0x21e0c8+'\x20['+_0x208bc2[_0x7fd2c5(0xc0)]+']\x20'+_0x208bc2[_0x7fd2c5(0xb7)]),console[_0x7fd2c5(0xc8)](_0x7fd2c5(0xb5)+_0x35a97d),_0x208bc2[_0x7fd2c5(0xb8)]&&console[_0x7fd2c5(0xc8)](_0x7fd2c5(0xcc)+_0x208bc2[_0x7fd2c5(0xb8)]+'ms'),_0x208bc2[_0x7fd2c5(0xd4)]&&Object[_0x7fd2c5(0xc2)](_0x208bc2[_0x7fd2c5(0xd4)])['length']>0x0&&console[_0x7fd2c5(0xc8)](_0x7fd2c5(0xbc)+JSON[_0x7fd2c5(0xd0)](_0x208bc2['details'],null,0x2)),console[_0x7fd2c5(0xc8)]('');});}export const logsDefinitions=[{'service':'logs','command':a33_0x206bb9(0xb4),'description':a33_0x206bb9(0xc4),'risk':a33_0x206bb9(0xbd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x39ccd3){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':a33_0x206bb9(0xbb),'command':a33_0x206bb9(0xd2),'description':a33_0x206bb9(0xbf),'risk':a33_0x206bb9(0xd3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x30c1e5){const _0x27d7de=a33_0x206bb9;return logger[_0x27d7de(0xd6)](),console[_0x27d7de(0xc8)](_0x27d7de(0xdb)),{'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_0x4b07d7=a34_0x2457;(function(_0x16e7a0,_0x1ba639){const _0x5c7f55=a34_0x2457,_0x537644=_0x16e7a0();while(!![]){try{const _0x1481b0=-parseInt(_0x5c7f55(0x18d))/0x1*(parseInt(_0x5c7f55(0x166))/0x2)+-parseInt(_0x5c7f55(0x15a))/0x3+-parseInt(_0x5c7f55(0x182))/0x4+parseInt(_0x5c7f55(0x179))/0x5*(parseInt(_0x5c7f55(0x18a))/0x6)+parseInt(_0x5c7f55(0x157))/0x7*(-parseInt(_0x5c7f55(0x16c))/0x8)+parseInt(_0x5c7f55(0x171))/0x9*(-parseInt(_0x5c7f55(0x17d))/0xa)+parseInt(_0x5c7f55(0x17f))/0xb;if(_0x1481b0===_0x1ba639)break;else _0x537644['push'](_0x537644['shift']());}catch(_0x25c699){_0x537644['push'](_0x537644['shift']());}}}(a34_0x4d1c,0x61939));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_0x2457(_0x18e403,_0x1c9acb){_0x18e403=_0x18e403-0x157;const _0x4d1cb6=a34_0x4d1c();let _0x245716=_0x4d1cb6[_0x18e403];return _0x245716;}const SUPPORTED_SCENES=['invoice',a34_0x4b07d7(0x175),a34_0x4b07d7(0x15f),a34_0x4b07d7(0x17c)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x4b07d7(0x18e),'general':a34_0x4b07d7(0x16a),'form':a34_0x4b07d7(0x183),'idCard':a34_0x4b07d7(0x16d)},SCENE_FLAG={'name':a34_0x4b07d7(0x15b),'type':a34_0x4b07d7(0x17b),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x4b07d7(0x17e)},IMAGE_FILE_FLAG={'name':a34_0x4b07d7(0x174),'type':a34_0x4b07d7(0x17b),'description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':a34_0x4b07d7(0x167),'type':'string','description':a34_0x4b07d7(0x15c)};function normalizeScene(_0x5e7a6d){const _0x6aa346=a34_0x4b07d7,_0x2dc982=_0x5e7a6d[_0x6aa346(0x15d)]()['toLowerCase']();if(_0x2dc982===_0x6aa346(0x184))return _0x6aa346(0x17c);if(_0x2dc982===_0x6aa346(0x187)||_0x2dc982===_0x6aa346(0x175)||_0x2dc982===_0x6aa346(0x15f))return _0x2dc982;throw CliErrors[_0x6aa346(0x164)]('Unsupported\x20OCR\x20scene:\x20'+_0x5e7a6d+_0x6aa346(0x185)+SUPPORTED_SCENES[_0x6aa346(0x168)](',\x20'));}function selectedInputs(_0x55692d){const _0x24e316=a34_0x4b07d7,_0x1be43e=_0x55692d['str'](_0x24e316(0x174))['trim'](),_0x1b206c=_0x55692d['str'](_0x24e316(0x167))[_0x24e316(0x15d)]();return{'imageFile':_0x1be43e,'imageUrl':_0x1b206c,'count':[_0x1be43e,_0x1b206c]['filter'](Boolean)[_0x24e316(0x181)]};}function validateInputSelection(_0x6ad29f){const _0x4c7e54=a34_0x4b07d7,_0x4ee1b7=selectedInputs(_0x6ad29f);if(_0x4ee1b7[_0x4c7e54(0x17a)]!==0x1)throw CliErrors[_0x4c7e54(0x164)](_0x4c7e54(0x162));return _0x4ee1b7;}function a34_0x4d1c(){const _0x3ed2f8=['scene','Publicly\x20accessible\x20image\x20or\x20file\x20URL','trim','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','form','/client/ocr','str','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','/client/uploadFile','validation','fileName','746666xbuoQn','image-url','join','\x20OCR\x20from\x20URL','General','\x20OCR','834856XAhoRR','IdCard','write','fileUrl','description','10242vVUgwy','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','path','image-file','general','POST','appCode','recognize','1458215bRaOpM','count','string','idCard','3580tyxVWX','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','15943950GILHvp','apiError','length','1056800oRHIwm','Table','idcard','.\x20Supported\x20scenes:\x20','File\x20URL\x20response\x20missing\x20fileUrl.','invoice','ocr','build','12YFYGZd','File\x20upload\x20response\x20missing\x20filePath.','imageFile','1UOgwOs','Invoice','body','7zJeZxI','imageUrl','Preview:\x20recognize\x20','1451307lIxLeS'];a34_0x4d1c=function(){return _0x3ed2f8;};return a34_0x4d1c();}function withScene(_0x39042d,_0x2a6829,_0x195220){const _0x3ce36c=a34_0x4b07d7;return{..._0x39042d,'scene':_0x2a6829,..._0x195220?{'sourceFile':{'fileName':_0x195220[_0x3ce36c(0x165)],'filePath':_0x195220['filePath']}}:{}};}const ocrRecognize={'service':a34_0x4b07d7(0x188),'command':a34_0x4b07d7(0x178),'description':a34_0x4b07d7(0x15e),'risk':a34_0x4b07d7(0x16e),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x30d79e){const _0x639395=a34_0x4b07d7,_0x140456=normalizeScene(_0x30d79e['str'](_0x639395(0x15b))),_0x58117a=SCENE_TO_LEGACY_TYPE[_0x140456],_0x1ae4a3=validateInputSelection(_0x30d79e);if(_0x1ae4a3[_0x639395(0x158)])return dryRun(_0x639395(0x176),'/client/ocr')[_0x639395(0x18f)]({'appCode':_0x30d79e[_0x639395(0x177)],'url':_0x1ae4a3[_0x639395(0x158)],'type':_0x58117a})['description'](_0x639395(0x159)+_0x140456+_0x639395(0x169))['build']();const _0x2bfcf7=requireRuntimeUploadFile(_0x1ae4a3['imageFile'],_0x639395(0x174));return dryRun('POST',_0x639395(0x163))['body']({'steps':[{'method':_0x639395(0x176),'url':_0x639395(0x163),'body':{'appCode':_0x30d79e['appCode'],'multipart':{'file':_0x2bfcf7}}},{'method':_0x639395(0x176),'url':'/client/queryFileUrl','body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':_0x639395(0x176),'url':_0x639395(0x160),'body':{'appCode':_0x30d79e[_0x639395(0x177)],'url':_0x639395(0x172),'type':_0x58117a}}]})[_0x639395(0x170)]('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x140456+_0x639395(0x16b))[_0x639395(0x189)]();},async 'execute'(_0xdbf1b0){const _0x1ea18a=a34_0x4b07d7,_0x2b70a4=normalizeScene(_0xdbf1b0[_0x1ea18a(0x161)](_0x1ea18a(0x15b))),_0xb549ac=SCENE_TO_LEGACY_TYPE[_0x2b70a4],_0x3de191=validateInputSelection(_0xdbf1b0);if(_0x3de191[_0x1ea18a(0x158)]){const _0x1cab64=await recognizeRuntimeOcr(_0xdbf1b0[_0x1ea18a(0x177)],{'url':_0x3de191[_0x1ea18a(0x158)],'type':_0xb549ac});return{'ok':!![],'data':withScene(_0x1cab64,_0x2b70a4)};}const _0xa15e13=requireRuntimeUploadFile(_0x3de191[_0x1ea18a(0x18c)],'image-file'),_0x2d140b=await uploadRuntimeFile(_0xdbf1b0[_0x1ea18a(0x177)],_0xa15e13[_0x1ea18a(0x173)]);if(!_0x2d140b['filePath'])throw CliErrors[_0x1ea18a(0x180)](_0x1ea18a(0x18b));const _0x44ba69=await queryRuntimeFileUrl(_0x2d140b['filePath'],{'download':![]});if(!_0x44ba69[_0x1ea18a(0x16f)])throw CliErrors[_0x1ea18a(0x180)](_0x1ea18a(0x186));const _0x195abb=await recognizeRuntimeOcr(_0xdbf1b0[_0x1ea18a(0x177)],{'url':_0x44ba69[_0x1ea18a(0x16f)],'type':_0xb549ac});return{'ok':!![],'data':withScene(_0x195abb,_0x2b70a4,_0x2d140b)};}};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_0x291b32=a35_0x17e6;function a35_0x17e6(_0x22cf05,_0x1ab673){_0x22cf05=_0x22cf05-0xb0;const _0x12100c=a35_0x1210();let _0x17e66f=_0x12100c[_0x22cf05];return _0x17e66f;}(function(_0x407bd1,_0x1cc99f){const _0x52f388=a35_0x17e6,_0x1ec497=_0x407bd1();while(!![]){try{const _0x522276=parseInt(_0x52f388(0xb8))/0x1+parseInt(_0x52f388(0xf4))/0x2+parseInt(_0x52f388(0xbc))/0x3+parseInt(_0x52f388(0xed))/0x4*(parseInt(_0x52f388(0xd6))/0x5)+-parseInt(_0x52f388(0xdf))/0x6*(-parseInt(_0x52f388(0xd4))/0x7)+parseInt(_0x52f388(0xe8))/0x8+-parseInt(_0x52f388(0xc5))/0x9;if(_0x522276===_0x1cc99f)break;else _0x1ec497['push'](_0x1ec497['shift']());}catch(_0x2e1da3){_0x1ec497['push'](_0x1ec497['shift']());}}}(a35_0x1210,0x2fa16));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';function a35_0x1210(){const _0x1b1f39=['sourceSessionId','updateTime','read','1962695VCYfUb','Executed\x20personal\x20BFF\x20','5RtApwO','Personal\x20BFF\x20script\x20ID','update','version','bool','map','params','isFile','string','6zXELDs','/client/runtime-bff/personal/','POST','/update','write','File\x20path\x20is\x20required.','source-session-id','Personal\x20BFF\x20description','verbose','1592584EoCyMl','high-risk-write','file','description','scriptContent','137504NJhcJT','body','config','functionName','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','validation','Preview:\x20update\x20personal\x20BFF\x20','578174CWLIfK','--params\x20must\x20be\x20a\x20JSON\x20object.','Optional\x20source\x20RuntimeAgent\x20session\x20id','length','appCode','name','detail','Preview:\x20create\x20personal\x20BFF\x20','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','349255oBfShC','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','scriptType','trim','985233qmbvQZ','createUserId','Created\x20personal\x20BFF\x20','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','Personal\x20BFF\x20script\x20file\x20is\x20blank.','Update\x20a\x20personal\x20BFF\x20by\x20id','keys','Show\x20one\x20personal\x20BFF\x20by\x20id','11569437EjlxeQ','build','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','create','gmtModified','num','str','test','gmtCreate','personal-bff','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','createTime'];a35_0x1210=function(){return _0x1b1f39;};return a35_0x1210();}const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x291b32(0xea),'type':a35_0x291b32(0xde),'description':a35_0x291b32(0xcf)},FUNCTION_NAME_FLAG={'name':a35_0x291b32(0xb4),'type':'string','required':!![],'description':a35_0x291b32(0xf1)},DESCRIPTION_FLAG={'name':a35_0x291b32(0xeb),'type':'string','description':a35_0x291b32(0xe6)},SOURCE_SESSION_FLAG={'name':a35_0x291b32(0xe5),'type':a35_0x291b32(0xde),'description':a35_0x291b32(0xb1)};function normalizeFunctionName(_0x4f6484){const _0x533ffb=a35_0x291b32,_0x588d04=String(_0x4f6484||'')[_0x533ffb(0xbb)]();if(!_0x588d04||!FUNCTION_NAME_PATTERN[_0x533ffb(0xcc)](_0x588d04))throw CliErrors['validation'](_0x533ffb(0xb7));return _0x588d04;}function readScriptFile(_0x54e9cd){const _0x55d67b=a35_0x291b32;if(!_0x54e9cd)throw CliErrors['validation'](_0x55d67b(0xe4));if(!existsSync(_0x54e9cd))throw CliErrors[_0x55d67b(0xf2)]('File\x20not\x20found:\x20'+_0x54e9cd);if(!statSync(_0x54e9cd)[_0x55d67b(0xdd)]())throw CliErrors[_0x55d67b(0xf2)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x54e9cd);const _0x31c860=readFileSync(_0x54e9cd,'utf8');if(!_0x31c860[_0x55d67b(0xbb)]())throw CliErrors[_0x55d67b(0xf2)](_0x55d67b(0xc1));return _0x31c860;}function optionalTrimmed(_0x12228d){const _0x350de7=a35_0x291b32,_0x1503c3=String(_0x12228d||'')[_0x350de7(0xbb)]();return _0x1503c3||undefined;}function summarizeBff(_0xd4103d){const _0x46cf8f=a35_0x291b32;return{'id':_0xd4103d['id'],'appCode':_0xd4103d[_0x46cf8f(0xb3)],'functionName':_0xd4103d['functionName'],'description':_0xd4103d[_0x46cf8f(0xeb)],'scriptType':_0xd4103d[_0x46cf8f(0xba)],'version':_0xd4103d[_0x46cf8f(0xd9)],'gmtModified':_0xd4103d[_0x46cf8f(0xc9)],'updateTime':_0xd4103d[_0x46cf8f(0xd2)]};}function detailBff(_0x4d0f73){const _0x54e371=a35_0x291b32;return{'id':_0x4d0f73['id'],'appCode':_0x4d0f73['appCode'],'functionName':_0x4d0f73[_0x54e371(0xf0)],'description':_0x4d0f73['description'],'scriptType':_0x4d0f73[_0x54e371(0xba)],'scriptContent':_0x4d0f73[_0x54e371(0xec)]??'','config':_0x4d0f73[_0x54e371(0xef)],'version':_0x4d0f73[_0x54e371(0xd9)],'createUserId':_0x4d0f73[_0x54e371(0xbd)],'gmtCreate':_0x4d0f73[_0x54e371(0xcd)],'gmtModified':_0x4d0f73[_0x54e371(0xc9)],'createTime':_0x4d0f73[_0x54e371(0xd0)],'updateTime':_0x4d0f73[_0x54e371(0xd2)]};}function buildCreateInput(_0x13d804){const _0x380f7e=a35_0x291b32;return{'functionName':normalizeFunctionName(_0x13d804['str'](_0x380f7e(0xb4))),...optionalTrimmed(_0x13d804[_0x380f7e(0xcb)](_0x380f7e(0xeb)))?{'description':optionalTrimmed(_0x13d804['str']('description'))}:{},'scriptContent':readScriptFile(_0x13d804[_0x380f7e(0xcb)](_0x380f7e(0xea))),...optionalTrimmed(_0x13d804[_0x380f7e(0xcb)](_0x380f7e(0xe5)))?{'sourceSessionId':optionalTrimmed(_0x13d804[_0x380f7e(0xcb)](_0x380f7e(0xe5)))}:{}};}function buildUpdateInput(_0x2467fc){const _0x265484=a35_0x291b32,_0x3cc15b={};optionalTrimmed(_0x2467fc['str'](_0x265484(0xb4)))&&(_0x3cc15b[_0x265484(0xf0)]=normalizeFunctionName(_0x2467fc['str'](_0x265484(0xb4))));_0x2467fc['flag'](_0x265484(0xeb))!==undefined&&(_0x3cc15b[_0x265484(0xeb)]=_0x2467fc[_0x265484(0xcb)](_0x265484(0xeb)));optionalTrimmed(_0x2467fc['str'](_0x265484(0xea)))&&(_0x3cc15b['scriptContent']=readScriptFile(_0x2467fc['str'](_0x265484(0xea))));_0x2467fc['flag'](_0x265484(0xe5))!==undefined&&(_0x3cc15b[_0x265484(0xd1)]=_0x2467fc[_0x265484(0xcb)]('source-session-id'));if(Object[_0x265484(0xc3)](_0x3cc15b)[_0x265484(0xb2)]===0x0)throw CliErrors[_0x265484(0xf2)](_0x265484(0xbf));return _0x3cc15b;}function parseExecParams(_0x52fc22){const _0x11a3dc=a35_0x291b32,_0x2c063c=parseJsonParams(_0x52fc22)??{};if(Array['isArray'](_0x2c063c))throw CliErrors[_0x11a3dc(0xf2)](_0x11a3dc(0xb0));return _0x2c063c;}const personalBffList={'service':'personal-bff','command':'list','description':a35_0x291b32(0xb9),'risk':a35_0x291b32(0xd3),'flags':[VERBOSE_FLAG],async 'execute'(_0x20d743){const _0x2583bc=a35_0x291b32,_0x2f8f9b=await listPersonalBffs(_0x20d743[_0x2583bc(0xb3)]);return{'ok':!![],'data':{'total':_0x2f8f9b[_0x2583bc(0xb2)],'items':_0x20d743[_0x2583bc(0xda)](_0x2583bc(0xe7))?_0x2f8f9b:_0x2f8f9b[_0x2583bc(0xdb)](summarizeBff)}};}},personalBffDetail={'service':a35_0x291b32(0xce),'command':a35_0x291b32(0xb5),'description':a35_0x291b32(0xc4),'risk':a35_0x291b32(0xd3),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'}],async 'execute'(_0x4aa6b2){const _0x49c517=a35_0x291b32,_0x3ee1cb=await getPersonalBff(_0x4aa6b2[_0x49c517(0xca)]('id'),_0x4aa6b2[_0x49c517(0xb3)]);return{'ok':!![],'data':detailBff(_0x3ee1cb)};}},personalBffCreate={'service':a35_0x291b32(0xce),'command':a35_0x291b32(0xc8),'description':a35_0x291b32(0xc7),'risk':a35_0x291b32(0xe3),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3bd5b5){const _0xcd4083=a35_0x291b32,_0x2380d9=buildCreateInput(_0x3bd5b5),_0x109e0e=await createPersonalBff(_0x3bd5b5[_0xcd4083(0xb3)],_0x2380d9);return{'ok':!![],'data':detailBff(_0x109e0e),'message':_0xcd4083(0xbe)+_0x109e0e['id']+(_0x109e0e[_0xcd4083(0xf0)]?'\x20('+_0x109e0e[_0xcd4083(0xf0)]+')':'')};},async 'dryRun'(_0x519f9d){const _0x378fbb=a35_0x291b32,_0x4869bc=buildCreateInput(_0x519f9d);return dryRun(_0x378fbb(0xe1),'/client/runtime-bff/personal/create')[_0x378fbb(0xee)]({'appCode':_0x519f9d[_0x378fbb(0xb3)],..._0x4869bc})[_0x378fbb(0xeb)](_0x378fbb(0xb6)+_0x4869bc['functionName'])[_0x378fbb(0xc6)]();}},personalBffUpdate={'service':a35_0x291b32(0xce),'command':a35_0x291b32(0xd8),'description':a35_0x291b32(0xc2),'risk':a35_0x291b32(0xe3),'flags':[{...ID_FLAG,'description':a35_0x291b32(0xd7)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x55407a){const _0x128860=a35_0x291b32,_0x9c3aa6=_0x55407a[_0x128860(0xca)]('id'),_0x3c99ba=buildUpdateInput(_0x55407a),_0x5bba58=await updatePersonalBff(_0x9c3aa6,_0x55407a[_0x128860(0xb3)],_0x3c99ba);return{'ok':!![],'data':detailBff(_0x5bba58),'message':'Updated\x20personal\x20BFF\x20'+_0x5bba58['id']+(_0x5bba58['functionName']?'\x20('+_0x5bba58[_0x128860(0xf0)]+')':'')};},async 'dryRun'(_0x2c6d89){const _0x96340f=a35_0x291b32,_0x224b06=_0x2c6d89[_0x96340f(0xca)]('id'),_0x1adc67=buildUpdateInput(_0x2c6d89);return dryRun(_0x96340f(0xe1),_0x96340f(0xe0)+_0x224b06+_0x96340f(0xe2))[_0x96340f(0xee)]({'appCode':_0x2c6d89[_0x96340f(0xb3)],..._0x1adc67})[_0x96340f(0xeb)](_0x96340f(0xf3)+_0x224b06)['build']();}},personalBffExec={'service':a35_0x291b32(0xce),'command':'exec','description':a35_0x291b32(0xc0),'risk':a35_0x291b32(0xe9),'flags':[{...ID_FLAG,'description':a35_0x291b32(0xd7)},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x47f2a0){const _0x330531=a35_0x291b32;parseExecParams(_0x47f2a0[_0x330531(0xcb)](_0x330531(0xdc)));},async 'execute'(_0x5b4616){const _0x3baa5e=a35_0x291b32,_0x596dcf=_0x5b4616['num']('id'),_0x5088fb=parseExecParams(_0x5b4616[_0x3baa5e(0xcb)]('params')),_0x4d6fce=await executePersonalBff(_0x596dcf,_0x5b4616[_0x3baa5e(0xb3)],_0x5088fb);return{'ok':!![],'data':{'result':_0x4d6fce},'message':_0x3baa5e(0xd5)+_0x596dcf};}};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_0x179092=a36_0x3e99;(function(_0x4e022f,_0x24a582){const _0x323fae=a36_0x3e99,_0xb40fe6=_0x4e022f();while(!![]){try{const _0x321543=parseInt(_0x323fae(0x1f0))/0x1+-parseInt(_0x323fae(0x201))/0x2*(parseInt(_0x323fae(0x209))/0x3)+-parseInt(_0x323fae(0x1e7))/0x4*(parseInt(_0x323fae(0x20c))/0x5)+-parseInt(_0x323fae(0x206))/0x6*(parseInt(_0x323fae(0x203))/0x7)+parseInt(_0x323fae(0x1f7))/0x8+-parseInt(_0x323fae(0x1e9))/0x9*(parseInt(_0x323fae(0x1ea))/0xa)+-parseInt(_0x323fae(0x20f))/0xb*(-parseInt(_0x323fae(0x205))/0xc);if(_0x321543===_0x24a582)break;else _0xb40fe6['push'](_0xb40fe6['shift']());}catch(_0x7f3a70){_0xb40fe6['push'](_0xb40fe6['shift']());}}}(a36_0x5472,0x7caa1));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';function a36_0x5472(){const _0x52bfe8=['read','Service\x20Tree','SQL\x20Queries','2847292paMSrm','set','9WPTqQu','6183290vLewzm','Skills','push','BFF\x20Scripts','show','Instant\x20API','898527mVojYu','Configuration','risk','get','service','command','has','6142736qZTsFZ','from','Logs','OCR','write','Diagnostics','defaultCommand','Knowledge\x20Base','CLI\x20Built-in\x20Skill','Schema','40jdHHzc','values','7CPSdcN','Self\x20Update','1284KcmLPr','5157174ApCxnN','File','App\x20Management','70749JbZPYf','list','map','5PuuqiW','install','Datasets','154781qvRegZ','Workspace'];a36_0x5472=function(){return _0x52bfe8;};return a36_0x5472();}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';function a36_0x3e99(_0x4be4f2,_0xd30c26){_0x4be4f2=_0x4be4f2-0x1e4;const _0x5472ae=a36_0x5472();let _0x3e990d=_0x5472ae[_0x4be4f2];return _0x3e990d;}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(_0x2bcfc4){const _0x1cabc6=a36_0x3e99;for(const _0x4b7f07 of _0x2bcfc4){definitions[_0x1cabc6(0x1e8)](_0x4b7f07[_0x1cabc6(0x1f4)]+':'+_0x4b7f07[_0x1cabc6(0x1f5)],_0x4b7f07);let _0x1ec80f=serviceGroups[_0x1cabc6(0x1f3)](_0x4b7f07['service']);!_0x1ec80f&&(_0x1ec80f=[],serviceGroups[_0x1cabc6(0x1e8)](_0x4b7f07[_0x1cabc6(0x1f4)],_0x1ec80f)),_0x1ec80f['push'](_0x4b7f07);}}function registerService(_0x49bf31,_0x1d3a7e,_0xb1f264){const _0x1f88cc=a36_0x3e99;registerDefinitions(_0x1d3a7e);const _0x1c1927=_0x367e8f=>_0x367e8f===_0x1f88cc(0x1e4)?'':_0x367e8f===_0x1f88cc(0x1fb)?'\x20\x20[write]':'\x20\x20[high-risk-write]',_0x40f856={'service':_0x1d3a7e[0x0][_0x1f88cc(0x1f4)],'label':_0x49bf31,'commands':_0x1d3a7e[_0x1f88cc(0x20b)](_0x33244e=>({'command':_0x33244e[_0x1f88cc(0x1f5)],'description':_0x33244e['description'],'tag':_0x1c1927(_0x33244e[_0x1f88cc(0x1f2)])})),'defaultCommand':_0xb1f264?.[_0x1f88cc(0x1fd)]??(_0xb1f264?.['isSingleCommand']?_0x1d3a7e[0x0][_0x1f88cc(0x1f5)]:undefined),'isSingleCommand':_0xb1f264?.['isSingleCommand']};serviceRegistry[_0x1f88cc(0x1ec)](_0x40f856),serviceByName['set'](_0x40f856['service'],_0x40f856);}registerService('Authentication',authDefinitions,{'defaultCommand':'login'}),registerService(a36_0x179092(0x208),appDefinitions,{'defaultCommand':'list'}),registerService(a36_0x179092(0x210),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a36_0x179092(0x1f1),configDefinitions,{'defaultCommand':a36_0x179092(0x20a)}),registerService('API\x20Documentation',apiDocDefinitions),registerService(a36_0x179092(0x20e),datasetDefinitions),registerService(a36_0x179092(0x1ef),dataDefinitions),registerService(a36_0x179092(0x1e6),sqlDefinitions),registerService(a36_0x179092(0x1ed),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x179092(0x207),fileDefinitions),registerService(a36_0x179092(0x1fa),ocrDefinitions),registerService(a36_0x179092(0x1fe),kbDefinitions),registerService(a36_0x179092(0x1e5),serviceDefinitions,{'defaultCommand':a36_0x179092(0x20a)}),registerService(a36_0x179092(0x1eb),skillDefinitions,{'defaultCommand':a36_0x179092(0x20d)}),registerService(a36_0x179092(0x1ff),cliSkillDefinitions,{'defaultCommand':a36_0x179092(0x20d)}),registerService(a36_0x179092(0x204),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a36_0x179092(0x1fc),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x179092(0x200),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x179092(0x1f9),logsDefinitions,{'defaultCommand':a36_0x179092(0x1ee)});export function findDefinition(_0x3d1149,_0x2ac81c){const _0x56813f=a36_0x179092;return definitions[_0x56813f(0x1f3)](_0x3d1149+':'+_0x2ac81c);}export function isKnownService(_0x474dfb){const _0x58ee0d=a36_0x179092;return serviceByName[_0x58ee0d(0x1f6)](_0x474dfb);}export function getServiceEntry(_0x2c1d4d){const _0x1a66c9=a36_0x179092;return serviceByName[_0x1a66c9(0x1f3)](_0x2c1d4d);}export function getAllDefinitions(){const _0x2a0747=a36_0x179092;return Array[_0x2a0747(0x1f8)](definitions[_0x2a0747(0x202)]());}
@@ -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_0x8d71ae=a37_0x2593;function a37_0x2593(_0x5c4453,_0x3728dd){_0x5c4453=_0x5c4453-0x136;const _0x4bd44b=a37_0x4bd4();let _0x2593c4=_0x4bd44b[_0x5c4453];return _0x2593c4;}(function(_0x3723c3,_0x70ca9c){const _0x2ec35c=a37_0x2593,_0xc4d795=_0x3723c3();while(!![]){try{const _0x4d5dc5=parseInt(_0x2ec35c(0x13f))/0x1*(parseInt(_0x2ec35c(0x142))/0x2)+parseInt(_0x2ec35c(0x13e))/0x3+-parseInt(_0x2ec35c(0x138))/0x4+parseInt(_0x2ec35c(0x136))/0x5+-parseInt(_0x2ec35c(0x13a))/0x6+-parseInt(_0x2ec35c(0x13d))/0x7*(-parseInt(_0x2ec35c(0x13b))/0x8)+-parseInt(_0x2ec35c(0x137))/0x9;if(_0x4d5dc5===_0x70ca9c)break;else _0xc4d795['push'](_0xc4d795['shift']());}catch(_0x39c359){_0xc4d795['push'](_0xc4d795['shift']());}}}(a37_0x4bd4,0x34588));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x58de37){const _0x557713=await buildSchemaPayload();return{'ok':!![],'data':_0x557713};}function a37_0x4bd4(){const _0xea65bf=['219145kyStQo','Export\x20machine-readable\x20command\x20schema\x20(JSON)','schema','2iWPoCr','814145XDwaJb','2947050IgyeHN','1156060GZOuED','export','515604pYeRqh','1836552MsBJlg','read','7dsXoCs','915792BXadfp'];a37_0x4bd4=function(){return _0xea65bf;};return a37_0x4bd4();}export const schemaDefinition={'service':a37_0x8d71ae(0x141),'command':a37_0x8d71ae(0x139),'description':a37_0x8d71ae(0x140),'risk':a37_0x8d71ae(0x13c),'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(_0xf4708f,_0x25f9bc){const _0x51c5e6=a38_0x1e7b,_0x2c24bf=_0xf4708f();while(!![]){try{const _0x1d1d36=parseInt(_0x51c5e6(0x17e))/0x1+-parseInt(_0x51c5e6(0x182))/0x2+-parseInt(_0x51c5e6(0x1ab))/0x3+-parseInt(_0x51c5e6(0x18b))/0x4*(-parseInt(_0x51c5e6(0x1ad))/0x5)+parseInt(_0x51c5e6(0x174))/0x6+-parseInt(_0x51c5e6(0x18d))/0x7*(-parseInt(_0x51c5e6(0x16b))/0x8)+-parseInt(_0x51c5e6(0x194))/0x9*(parseInt(_0x51c5e6(0x17b))/0xa);if(_0x1d1d36===_0x25f9bc)break;else _0x2c24bf['push'](_0x2c24bf['shift']());}catch(_0x2e5ef0){_0x2c24bf['push'](_0x2c24bf['shift']());}}}(a38_0x11ad,0xd042f));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';function a38_0x1e7b(_0x4e0354,_0x82b5d){_0x4e0354=_0x4e0354-0x16b;const _0x11add7=a38_0x11ad();let _0x1e7b1a=_0x11add7[_0x4e0354];return _0x1e7b1a;}export function resolveDynamicServiceCommand(_0x9630c,_0x27624b){const _0xeb4552=a38_0x1e7b,_0x264b12=listLocalServiceTrees();let _0x1f78f2;for(const _0x51c035 of _0x264b12){const _0x1b50ed=matchServiceTreeCommand(_0x51c035,_0x9630c);if(!_0x1b50ed)continue;(!_0x1f78f2||_0x1b50ed[_0xeb4552(0x192)][_0xeb4552(0x1c6)][_0xeb4552(0x184)]>_0x1f78f2[_0xeb4552(0x192)][_0xeb4552(0x1c6)][_0xeb4552(0x184)])&&(_0x1f78f2={'tree':_0x51c035,'command':_0x1b50ed['command'],'remainingArgs':_0x1b50ed[_0xeb4552(0x170)]});}if(!_0x1f78f2)return undefined;const _0x253a98={..._0x27624b};return applyAppBinding(_0x1f78f2[_0xeb4552(0x191)],_0x1f78f2[_0xeb4552(0x192)],_0x253a98),{'definition':buildDynamicCommandDefinition(_0x1f78f2[_0xeb4552(0x191)],_0x1f78f2[_0xeb4552(0x192)]),'args':_0x1f78f2[_0xeb4552(0x170)],'flags':_0x253a98,'tree':_0x1f78f2[_0xeb4552(0x191)],'command':_0x1f78f2['command']};}export function generateDynamicServiceHelp(_0x2de450){const _0xe350a7=a38_0x1e7b,_0x4c3e94=listLocalServiceTrees()[_0xe350a7(0x1b6)](_0x379fd5=>_0x379fd5[_0xe350a7(0x180)][_0xe350a7(0x195)]===_0x2de450);if(!_0x4c3e94)return undefined;const _0x21acb5=[CLI_BIN_NAME+'\x20'+_0x2de450+'\x20<command>\x20[flags]','',_0x4c3e94[_0xe350a7(0x180)]['name']||_0x2de450,_0x4c3e94[_0xe350a7(0x180)][_0xe350a7(0x1c8)]?'\x20\x20'+_0x4c3e94[_0xe350a7(0x180)]['description']:'','',_0xe350a7(0x1cd),..._0x4c3e94['commands']['map'](_0x1bbf3e=>{const _0x1f9b0c=_0xe350a7,_0x3e81df=_0x1bbf3e[_0x1f9b0c(0x1c6)][_0x1f9b0c(0x17f)](0x1)[_0x1f9b0c(0x1af)]('\x20'),_0x14c9ef=_0x1bbf3e[_0x1f9b0c(0x19c)]==='read'?'':'\x20['+_0x1bbf3e[_0x1f9b0c(0x19c)]+']';return'\x20\x20'+_0x3e81df[_0x1f9b0c(0x181)](0x18)+'\x20'+(_0x1bbf3e[_0x1f9b0c(0x1c8)]||'')+_0x14c9ef;}),'',_0xe350a7(0x1b1)+CLI_BIN_NAME+_0xe350a7(0x1a8)+_0x2de450+_0xe350a7(0x19f)][_0xe350a7(0x1ce)](Boolean);return _0x21acb5['join']('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0xc13b38=>{const _0x2b138e=a38_0x1e7b,_0x55a1e2=_0xc13b38[_0x2b138e(0x185)];return{'service':_0x55a1e2['service'][_0x2b138e(0x195)],'label':_0x55a1e2['service'][_0x2b138e(0x176)]||_0x55a1e2[_0x2b138e(0x180)][_0x2b138e(0x195)],'commands':_0x55a1e2['commands'][_0x2b138e(0x18a)](_0x9d2891=>({'command':dynamicCommandName(_0x9d2891),'description':_0x9d2891[_0x2b138e(0x1c8)]||_0x2b138e(0x1b2)+_0x9d2891['cliPath'],'tag':riskTag(_0x9d2891[_0x2b138e(0x19c)])}))};});}export function getDynamicServiceEntry(_0x51b2b0){const _0x123027=a38_0x1e7b;return listDynamicServiceEntries()[_0x123027(0x1b6)](_0x4f6c59=>_0x4f6c59[_0x123027(0x180)]===_0x51b2b0);}export function listDynamicServiceDefinitions(_0x12c732){const _0x45a865=a38_0x1e7b;return listLocalServiceTrees()[_0x45a865(0x1ce)](_0x17c142=>!_0x12c732||_0x17c142[_0x45a865(0x180)][_0x45a865(0x195)]===_0x12c732)[_0x45a865(0x197)](_0x248f10=>_0x248f10[_0x45a865(0x1c7)][_0x45a865(0x18a)](_0x17ee2e=>buildDynamicCommandDefinition(_0x248f10,_0x17ee2e)));}export function getDynamicServiceDefinitions(_0x4f543b){const _0x17a03e=a38_0x1e7b,_0x55349d=listDynamicServiceDefinitions(_0x4f543b);return _0x55349d[_0x17a03e(0x184)]>0x0?_0x55349d:undefined;}export function findDynamicServiceDefinition(_0x144221,_0x1a0e17){const _0x1df75e=a38_0x1e7b;return listDynamicServiceDefinitions(_0x144221)[_0x1df75e(0x1b6)](_0x3877d4=>_0x3877d4[_0x1df75e(0x192)]===_0x1a0e17);}export function buildDynamicCommandDefinition(_0x217edf,_0x1a300c){const _0x30d4b8=a38_0x1e7b;return{'service':_0x217edf[_0x30d4b8(0x180)][_0x30d4b8(0x195)],'command':dynamicCommandName(_0x1a300c),'description':_0x1a300c[_0x30d4b8(0x1c8)]||'Run\x20service\x20command\x20'+_0x1a300c[_0x30d4b8(0x196)],'risk':_0x1a300c['risk'],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x1a300c[_0x30d4b8(0x1a9)][_0x30d4b8(0x18a)](_0x18a216=>({'name':_0x18a216[_0x30d4b8(0x176)],'description':_0x18a216[_0x30d4b8(0x1c8)]||_0x18a216['name'],'required':_0x18a216[_0x30d4b8(0x188)]})),'flags':_0x1a300c[_0x30d4b8(0x18e)][_0x30d4b8(0x18a)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x1a300c),async 'dryRun'(_0x3936ad){const _0x2abe21=_0x30d4b8,_0x5768d3=await compilePlan(_0x1a300c,_0x3936ad);return{'method':_0x2abe21(0x17c),'url':_0x1a300c['cliPath'],'body':{'target':targetPreview(_0x5768d3),'params':_0x5768d3[_0x2abe21(0x1a2)]},'description':_0x2abe21(0x1a4)+_0x1a300c[_0x2abe21(0x196)]};},async 'execute'(_0x1334bf){const _0x48972e=_0x30d4b8,_0x4d5ec7=await compilePlan(_0x1a300c,_0x1334bf),_0x4258fb=Date[_0x48972e(0x179)](),_0x4f07d3=await executePlan(_0x4d5ec7,_0x1a300c,_0x1334bf),_0x567161=Date[_0x48972e(0x179)]()-_0x4258fb;return{'ok':!![],'data':{'service':_0x217edf[_0x48972e(0x180)],'command':_0x1a300c[_0x48972e(0x196)],'target':targetPreview(_0x4d5ec7),'result':_0x4f07d3,'elapsed':_0x567161},'message':'Service\x20command\x20'+_0x1a300c['cliPath']+_0x48972e(0x1a6)+_0x567161+'ms'};}};}function dynamicCommandName(_0x3fc202){return _0x3fc202['fullPath']['slice'](0x1)['join']('\x20');}function a38_0x11ad(){const _0x42bf72=['json','risk','default','\x20requires\x20target.scriptName.','`\x20to\x20inspect\x20the\x20manifest.','tableName','kind','params','read','Preview\x20dynamic\x20service\x20command:\x20','appBindings','\x20completed\x20in\x20','rawFlags','\x20service\x20detail\x20--service\x20','args','nickname','4030152lBSJsO','\x20\x20\x20\x20sqlCode:\x20','660995nvLnbL','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','join','app','Use\x20`','Run\x20service\x20command\x20','validation','sql','entries','find','some','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','env','bffCode','\x20\x20\x20\x20command:\x20','context.','\x20\x20\x20\x20scriptName:\x20','\x20\x20[','\x20\x20SERVICE\x20TREE\x20TARGET','startsWith','trim','source','userId','scriptName','string','fullPath','commands','description','push','dbtableConfig','\x20\x20\x20\x20kind:\x20\x20\x20\x20','nickName','Commands:','filter','datasetCode','67016vCahTH','datatable','fromEntries','\x20->\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','remainingArgs','appcode','cliName','Cannot\x20resolve\x20datatable\x20\x22','3705234pjvGJZ','bffId','name','sqlCode','\x20\x20\x20\x20datatable:\x20','now','appRef','70NFaHkN','SERVICE_TREE','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','1031778oSWfjM','slice','service','padEnd','1415964zjWmBR','target','length','normalizedManifest','userName','type','required','Service\x20command\x20','map','32psWvfP','\x20requires\x20target.sqlCode.','301PiaPAl','flags','const','operator','tree','command','loginName','209205KvHbiq','code','cliPath','flatMap','mapTo','appCode','\x20\x20\x20\x20'];a38_0x11ad=function(){return _0x42bf72;};return a38_0x11ad();}function riskTag(_0x5f1e59){const _0x35c413=a38_0x1e7b;return _0x5f1e59===_0x35c413(0x1a3)?'':_0x35c413(0x1be)+_0x5f1e59+']';}function flagToCommandFlag(_0x3bc9e3){const _0x16a906=a38_0x1e7b;return{'name':_0x3bc9e3[_0x16a906(0x172)],'type':_0x3bc9e3[_0x16a906(0x187)]===_0x16a906(0x19b)?_0x16a906(0x1c5):_0x3bc9e3['type'],'description':_0x3bc9e3[_0x16a906(0x1c8)]||_0x3bc9e3['name'],'required':_0x3bc9e3[_0x16a906(0x188)],'default':isPrimitiveFlagDefault(_0x3bc9e3[_0x16a906(0x19d)])?_0x3bc9e3[_0x16a906(0x19d)]:undefined,'enum':_0x3bc9e3['enum']};}async function compilePlan(_0x26656b,_0x266fed){const _0x41bdfa=a38_0x1e7b;return compileServiceTreeCommand(_0x26656b,{'flags':_0x266fed[_0x41bdfa(0x1a7)],'args':_0x266fed[_0x41bdfa(0x1a9)],'context':await buildServiceContext(_0x26656b,_0x266fed)});}async function buildServiceContext(_0x1bd825,_0x545688){const _0xc97f4f=a38_0x1e7b,_0x3a97ea={'appCode':_0x545688[_0xc97f4f(0x199)],'env':_0x545688['envName'],'envName':_0x545688['envName']};if(!usesRuntimeContext(_0x1bd825))return _0x3a97ea;const _0x3ff392=await getLoginUserInfo(),_0x3d8c06=pickFirst(_0x3ff392[_0xc97f4f(0x1c3)],_0x3ff392['id']);return{..._0x3a97ea,'user':_0x3ff392,'userId':_0x3d8c06,'id':_0x3ff392['id'],'username':pickFirst(_0x3ff392['username'],_0x3ff392[_0xc97f4f(0x186)],_0x3ff392[_0xc97f4f(0x193)]),'userName':_0x3ff392['userName'],'nickname':pickFirst(_0x3ff392[_0xc97f4f(0x1aa)],_0x3ff392[_0xc97f4f(0x1cc)]),'nickName':_0x3ff392['nickName'],'tenantCode':_0x3ff392['tenantCode'],'employeeId':_0x3ff392['employeeId']};}function usesRuntimeContext(_0xd34a18){const _0x488027=a38_0x1e7b;return _0xd34a18[_0x488027(0x198)][_0x488027(0x1b7)](_0x2d1481=>typeof _0x2d1481[_0x488027(0x1c2)]===_0x488027(0x1c5)&&(_0x2d1481[_0x488027(0x1c2)][_0x488027(0x1c0)](_0x488027(0x1bc))||_0x2d1481[_0x488027(0x1c2)][_0x488027(0x1c0)]('ctx.')));}function pickFirst(..._0x528ca5){const _0x4381d4=a38_0x1e7b;return _0x528ca5[_0x4381d4(0x1b6)](_0x5ad09c=>_0x5ad09c!==undefined&&_0x5ad09c!==null);}async function executePlan(_0x19548e,_0xe30733,_0x4a713d){const _0x46d7b6=a38_0x1e7b;if(_0x19548e['kind']==='data'){const _0x522c30=await resolveDatasetCode(_0x19548e,_0xe30733,_0x4a713d);return executeData(_0x522c30,_0x19548e['command'],_0x19548e['params']);}if(_0x19548e[_0x46d7b6(0x1a1)]===_0x46d7b6(0x1b4)){if(!_0x19548e['sqlCode'])throw CliErrors[_0x46d7b6(0x1b3)](_0x46d7b6(0x189)+_0xe30733[_0x46d7b6(0x196)]+_0x46d7b6(0x18c));return executeSdkSql(_0x19548e[_0x46d7b6(0x177)],normalizeScalarParams(_0x19548e[_0x46d7b6(0x1a2)]));}if(_0x19548e[_0x46d7b6(0x1a1)]==='bff'){const _0x15468a=_0x19548e['scriptName']||_0x19548e[_0x46d7b6(0x1ba)]||(_0x19548e[_0x46d7b6(0x175)]==null?'':String(_0x19548e[_0x46d7b6(0x175)]));if(!_0x15468a)throw CliErrors[_0x46d7b6(0x1b3)](_0x46d7b6(0x189)+_0xe30733[_0x46d7b6(0x196)]+_0x46d7b6(0x19e));return executeSdkBff(_0x15468a,_0x19548e[_0x46d7b6(0x1a2)]);}throw CliErrors[_0x46d7b6(0x1b3)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x19548e[_0x46d7b6(0x1a1)]);}async function resolveDatasetCode(_0x234c0c,_0x3a2073,_0x19e880){const _0x454e0b=a38_0x1e7b;if(_0x234c0c[_0x454e0b(0x1cf)])return _0x234c0c[_0x454e0b(0x1cf)];if(!_0x234c0c[_0x454e0b(0x16c)])throw CliErrors[_0x454e0b(0x1b3)](_0x454e0b(0x189)+_0x3a2073[_0x454e0b(0x196)]+_0x454e0b(0x1b8));const _0x2e5407=await listDatasets(_0x19e880[_0x454e0b(0x199)]),_0x2a8a61=_0x2e5407[_0x454e0b(0x1b6)](_0x109a07=>_0x109a07[_0x454e0b(0x1ca)]?.[_0x454e0b(0x1a0)]===_0x234c0c[_0x454e0b(0x16c)]);if(!_0x2a8a61?.['code'])throw CliErrors[_0x454e0b(0x1b3)](_0x454e0b(0x173)+_0x234c0c[_0x454e0b(0x16c)]+_0x454e0b(0x16f)+_0x19e880[_0x454e0b(0x199)]+'.',_0x454e0b(0x1ae));return _0x2a8a61[_0x454e0b(0x195)];}function applyAppBinding(_0x4cde79,_0xc3f79c,_0x3aea07){const _0x5a13fa=a38_0x1e7b,_0x488bc0=_0xc3f79c[_0x5a13fa(0x183)][_0x5a13fa(0x17a)];if(!_0x488bc0)return;const _0x5080ce=_0x4cde79[_0x5a13fa(0x1a5)][_0x488bc0];if(!_0x5080ce)throw CliErrors['validation']('Unknown\x20appRef\x20\x22'+_0x488bc0+'\x22\x20in\x20service\x20command\x20'+_0xc3f79c[_0x5a13fa(0x196)]+'.',_0x5a13fa(0x17d));const _0x3bc6fe=_0x5080ce[_0x5a13fa(0x171)]||_0x5080ce[_0x5a13fa(0x199)];_0x3bc6fe&&!hasText(_0x3aea07[_0x5a13fa(0x171)])&&(_0x3aea07[_0x5a13fa(0x171)]=_0x3bc6fe),_0x5080ce[_0x5a13fa(0x1b0)]&&!hasText(_0x3aea07[_0x5a13fa(0x1b0)])&&!hasText(_0x3aea07[_0x5a13fa(0x171)])&&(_0x3aea07[_0x5a13fa(0x1b0)]=_0x5080ce[_0x5a13fa(0x1b0)]),_0x5080ce[_0x5a13fa(0x1b9)]&&!hasText(_0x3aea07[_0x5a13fa(0x1b9)])&&(_0x3aea07[_0x5a13fa(0x1b9)]=_0x5080ce['env']);}function renderDynamicCommandHelp(_0x312ccd){const _0x514692=a38_0x1e7b,_0x32b0a4=[_0x514692(0x1bf),_0x514692(0x1cb)+_0x312ccd[_0x514692(0x183)]['kind'],_0x514692(0x1bb)+_0x312ccd['target']['command']];if(_0x312ccd['target'][_0x514692(0x1cf)])_0x32b0a4[_0x514692(0x1c9)]('\x20\x20\x20\x20datasetCode:\x20'+_0x312ccd[_0x514692(0x183)][_0x514692(0x1cf)]);if(_0x312ccd[_0x514692(0x183)][_0x514692(0x16c)])_0x32b0a4[_0x514692(0x1c9)](_0x514692(0x178)+_0x312ccd[_0x514692(0x183)][_0x514692(0x16c)]);if(_0x312ccd[_0x514692(0x183)][_0x514692(0x177)])_0x32b0a4[_0x514692(0x1c9)](_0x514692(0x1ac)+_0x312ccd[_0x514692(0x183)][_0x514692(0x177)]);if(_0x312ccd[_0x514692(0x183)][_0x514692(0x1c4)])_0x32b0a4['push'](_0x514692(0x1bd)+_0x312ccd[_0x514692(0x183)][_0x514692(0x1c4)]);if(_0x312ccd['mapTo'][_0x514692(0x184)]>0x0){_0x32b0a4['push']('','\x20\x20MAP\x20TO');for(const _0x10620e of _0x312ccd[_0x514692(0x198)]){_0x32b0a4['push'](_0x514692(0x19a)+(_0x10620e[_0x514692(0x1c2)]||_0x514692(0x18f))+_0x514692(0x16e)+_0x10620e['target']+(_0x10620e[_0x514692(0x190)]?'.'+_0x10620e[_0x514692(0x190)]:''));}}return _0x32b0a4[_0x514692(0x1af)]('\x0a');}function targetPreview(_0xddf632){const _0x51e5e7=a38_0x1e7b;return{'kind':_0xddf632[_0x51e5e7(0x1a1)],'command':_0xddf632[_0x51e5e7(0x192)],'appRef':_0xddf632[_0x51e5e7(0x17a)],'datasetCode':_0xddf632[_0x51e5e7(0x1cf)],'datatable':_0xddf632[_0x51e5e7(0x16c)],'sqlCode':_0xddf632[_0x51e5e7(0x177)],'bffCode':_0xddf632[_0x51e5e7(0x1ba)],'bffId':_0xddf632[_0x51e5e7(0x175)],'scriptName':_0xddf632[_0x51e5e7(0x1c4)]};}function normalizeScalarParams(_0x333df0){const _0x2db991=a38_0x1e7b;return Object[_0x2db991(0x16d)](Object[_0x2db991(0x1b5)](_0x333df0)[_0x2db991(0x1ce)](([,_0x39e6bc])=>typeof _0x39e6bc===_0x2db991(0x1c5)||typeof _0x39e6bc==='number'));}function hasText(_0x47f0f8){const _0x59985a=a38_0x1e7b;return typeof _0x47f0f8===_0x59985a(0x1c5)&&_0x47f0f8[_0x59985a(0x1c1)]()[_0x59985a(0x184)]>0x0;}function isPrimitiveFlagDefault(_0x239e75){const _0x48d05a=a38_0x1e7b;return _0x239e75===undefined||typeof _0x239e75===_0x48d05a(0x1c5)||typeof _0x239e75==='number'||typeof _0x239e75==='boolean';}
@@ -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
+ function a39_0x1308(){const _0x4a6909=['validate','report','Service\x20Tree\x20manifest\x20file\x20path','type','warnings','7qbYemt','imported','entries','3241800CJHCTZ','map','entry','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','4046277tfETxi','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Service\x20registry\x20validation\x20passed.','kind','registryServiceCode','lower\x20kebab-case\x20service\x20code','registryPath','remove','errors','required','description','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','version','replaced','risk','flags','commands','serviceCount','cliPath','service','737915TGpcin','\x20service(s).','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','importedAt','list','569190qKxYHt','931568FRPiJX','1083096vgzkGD','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','read','\x20service\x20','normalizedManifest','source','export','str','WRITE','Removed\x20service\x20','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','registry','serviceCode','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','length','manifests','write','21625040uaSScd','updated','Imported\x20','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','Local\x20service\x20code,\x20for\x20example\x20crm','\x20service(s),\x20updated\x20','filePath','file','hash','target','Imported','name'];a39_0x1308=function(){return _0x4a6909;};return a39_0x1308();}const a39_0x5894e8=a39_0x2858;function a39_0x2858(_0x2959e3,_0x58eb70){_0x2959e3=_0x2959e3-0x10d;const _0x130892=a39_0x1308();let _0x28585e=_0x130892[_0x2959e3];return _0x28585e;}(function(_0xb84ee0,_0x5928ee){const _0x4c2687=a39_0x2858,_0x27da8f=_0xb84ee0();while(!![]){try{const _0x3cadb7=parseInt(_0x4c2687(0x127))/0x1+parseInt(_0x4c2687(0x12e))/0x2+parseInt(_0x4c2687(0x113))/0x3+parseInt(_0x4c2687(0x12d))/0x4+parseInt(_0x4c2687(0x10f))/0x5+-parseInt(_0x4c2687(0x12c))/0x6*(parseInt(_0x4c2687(0x150))/0x7)+-parseInt(_0x4c2687(0x13f))/0x8;if(_0x3cadb7===_0x5928ee)break;else _0x27da8f['push'](_0x27da8f['shift']());}catch(_0x2fd672){_0x27da8f['push'](_0x27da8f['shift']());}}}(a39_0x1308,0xadb37));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x5894e8(0x146),'type':'string','required':!![],'description':a39_0x5894e8(0x14d)},SERVICE_FLAG={'name':a39_0x5894e8(0x126),'type':'string','required':!![],'description':a39_0x5894e8(0x143),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x5894e8(0x118)}};function summarizeService(_0x29ea0f){const _0x40a73c=a39_0x5894e8;return{'serviceCode':_0x29ea0f[_0x40a73c(0x13a)],'name':_0x29ea0f['normalizedManifest']['service'][_0x40a73c(0x14a)],'version':_0x29ea0f[_0x40a73c(0x11f)],'importedAt':_0x29ea0f[_0x40a73c(0x12a)],'source':_0x29ea0f[_0x40a73c(0x133)],'commandCount':_0x29ea0f['normalizedManifest'][_0x40a73c(0x123)][_0x40a73c(0x13c)],'commands':_0x29ea0f['normalizedManifest'][_0x40a73c(0x123)][_0x40a73c(0x110)](_0x554916=>({'path':_0x554916[_0x40a73c(0x125)],'description':_0x554916[_0x40a73c(0x11d)],'risk':_0x554916[_0x40a73c(0x121)],'target':_0x554916[_0x40a73c(0x148)],'flags':_0x554916[_0x40a73c(0x122)][_0x40a73c(0x110)](_0x3455e5=>({'name':_0x3455e5[_0x40a73c(0x14a)],'cliName':_0x3455e5['cliName'],'type':_0x3455e5[_0x40a73c(0x14e)],'required':_0x3455e5[_0x40a73c(0x11c)]===!![]}))}))};}function summarizeLoadedManifest(_0x151416){const _0xfba25b=a39_0x5894e8;return{'service':_0x151416['normalizedManifest']?.[_0xfba25b(0x126)],'version':_0x151416[_0xfba25b(0x132)]?.[_0xfba25b(0x11f)],'commandCount':_0x151416[_0xfba25b(0x132)]?.[_0xfba25b(0x123)][_0xfba25b(0x13c)]??0x0,'commands':_0x151416['normalizedManifest']?.[_0xfba25b(0x123)]['map'](_0x392a48=>({'path':_0x392a48[_0xfba25b(0x125)],'risk':_0x392a48[_0xfba25b(0x121)],'target':_0x392a48['target']}))??[],'registryIndex':_0x151416['registryIndex'],'registryServiceCode':_0x151416[_0xfba25b(0x117)],'errors':_0x151416[_0xfba25b(0x14c)]['errors'],'warnings':_0x151416[_0xfba25b(0x14c)]['warnings']};}export const serviceDefinitions=[{'service':a39_0x5894e8(0x126),'command':a39_0x5894e8(0x14b),'description':a39_0x5894e8(0x13b),'risk':a39_0x5894e8(0x130),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x527c31){const _0x39a319=a39_0x5894e8,_0xeb00e8=loadServiceManifestFromFile(_0x527c31[_0x39a319(0x135)]('file'));if(!_0xeb00e8[_0x39a319(0x14c)]['ok'])return{'ok':![],'data':{'file':_0xeb00e8[_0x39a319(0x145)],'hash':_0xeb00e8[_0x39a319(0x147)],'kind':_0xeb00e8['kind'],'serviceCount':_0xeb00e8[_0x39a319(0x13d)][_0x39a319(0x13c)],'services':_0xeb00e8['manifests']['map'](summarizeLoadedManifest),'errors':_0xeb00e8[_0x39a319(0x14c)][_0x39a319(0x11b)],'warnings':_0xeb00e8[_0x39a319(0x14c)][_0x39a319(0x14f)]},'message':formatValidationFailure(_0xeb00e8['report'])};if(_0xeb00e8[_0x39a319(0x116)]===_0x39a319(0x139)||_0xeb00e8['manifests'][_0x39a319(0x13c)]!==0x1)return{'ok':!![],'data':{'file':_0xeb00e8[_0x39a319(0x145)],'hash':_0xeb00e8[_0x39a319(0x147)],'kind':_0xeb00e8[_0x39a319(0x116)],'serviceCount':_0xeb00e8[_0x39a319(0x13d)][_0x39a319(0x13c)],'commandCount':_0xeb00e8[_0x39a319(0x13d)]['reduce']((_0x5212d3,_0x295b35)=>_0x5212d3+(_0x295b35[_0x39a319(0x132)]?.[_0x39a319(0x123)]['length']??0x0),0x0),'services':_0xeb00e8[_0x39a319(0x13d)][_0x39a319(0x110)](summarizeLoadedManifest),'warnings':_0xeb00e8[_0x39a319(0x14c)]['warnings']},'message':_0x39a319(0x115)};return{'ok':!![],'data':{'file':_0xeb00e8[_0x39a319(0x145)],'hash':_0xeb00e8[_0x39a319(0x147)],'kind':_0xeb00e8['kind'],'service':_0xeb00e8[_0x39a319(0x132)]?.[_0x39a319(0x126)],'version':_0xeb00e8[_0x39a319(0x132)]?.[_0x39a319(0x11f)],'commandCount':_0xeb00e8['normalizedManifest']?.[_0x39a319(0x123)]['length']??0x0,'commands':_0xeb00e8[_0x39a319(0x132)]?.[_0x39a319(0x123)][_0x39a319(0x110)](_0x3ae2f3=>({'path':_0x3ae2f3[_0x39a319(0x125)],'risk':_0x3ae2f3[_0x39a319(0x121)],'target':_0x3ae2f3['target']})),'warnings':_0xeb00e8['report'][_0x39a319(0x14f)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a39_0x5894e8(0x126),'command':'import','description':a39_0x5894e8(0x129),'risk':a39_0x5894e8(0x13e),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x10215d){const _0x430b2d=a39_0x5894e8,_0x336de3=loadServiceManifestFromFile(_0x10215d['str']('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x336de3[_0x430b2d(0x145)],'hash':_0x336de3[_0x430b2d(0x147)],'kind':_0x336de3['kind'],'ok':_0x336de3[_0x430b2d(0x14c)]['ok'],'service':_0x336de3[_0x430b2d(0x132)]?.['service'],'version':_0x336de3[_0x430b2d(0x132)]?.[_0x430b2d(0x11f)],'serviceCount':_0x336de3['manifests'][_0x430b2d(0x13c)],'services':_0x336de3[_0x430b2d(0x13d)][_0x430b2d(0x110)](_0x17bef5=>({'service':_0x17bef5['normalizedManifest']?.[_0x430b2d(0x126)],'version':_0x17bef5[_0x430b2d(0x132)]?.[_0x430b2d(0x11f)],'commandCount':_0x17bef5[_0x430b2d(0x132)]?.['commands'][_0x430b2d(0x13c)]??0x0,'errors':_0x17bef5[_0x430b2d(0x14c)][_0x430b2d(0x11b)]})),'errors':_0x336de3['report']['errors'],'commandCount':_0x336de3[_0x430b2d(0x132)]?.[_0x430b2d(0x123)][_0x430b2d(0x13c)]??0x0},'description':_0x430b2d(0x114)};},async 'execute'(_0x10a3c){const _0x50b337=a39_0x5894e8,_0x380403=importServiceManifest(_0x10a3c[_0x50b337(0x135)](_0x50b337(0x146)));if(_0x380403[_0x50b337(0x10e)][_0x50b337(0x13c)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x380403[_0x50b337(0x119)],'imported':_0x380403[_0x50b337(0x10d)],'updated':_0x380403['updated'],'serviceCount':_0x380403['serviceCount'],'services':_0x380403[_0x50b337(0x10e)][_0x50b337(0x110)](summarizeService)},'message':_0x50b337(0x141)+_0x380403['imported']+_0x50b337(0x144)+_0x380403['updated']+_0x50b337(0x128)};return{'ok':!![],'data':{'registryPath':_0x380403[_0x50b337(0x119)],'replaced':_0x380403[_0x50b337(0x120)],'imported':_0x380403[_0x50b337(0x10d)],'updated':_0x380403[_0x50b337(0x140)],'serviceCount':_0x380403['serviceCount'],'service':summarizeService(_0x380403['entry'])},'message':(_0x380403[_0x50b337(0x120)]?'Updated':_0x50b337(0x149))+_0x50b337(0x131)+_0x380403[_0x50b337(0x111)][_0x50b337(0x13a)]+'.'};}},{'service':a39_0x5894e8(0x126),'command':a39_0x5894e8(0x134),'description':a39_0x5894e8(0x12f),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x323634){const _0x256ff9=a39_0x5894e8,_0x340bb5=getLocalServiceEntry(_0x323634[_0x256ff9(0x135)](_0x256ff9(0x126)));return{'method':_0x256ff9(0x136),'url':_0x323634['str'](_0x256ff9(0x146)),'body':{'service':_0x323634[_0x256ff9(0x135)]('service'),'found':Boolean(_0x340bb5),'version':_0x340bb5?.[_0x256ff9(0x11f)],'source':_0x340bb5?.[_0x256ff9(0x133)]},'description':_0x256ff9(0x142)};},async 'execute'(_0x537067){const _0x2abaa9=a39_0x5894e8,_0x48f8f8=exportServiceManifest(_0x537067[_0x2abaa9(0x135)](_0x2abaa9(0x126)),_0x537067[_0x2abaa9(0x135)](_0x2abaa9(0x146)));return{'ok':!![],'data':{'registryPath':_0x48f8f8['registryPath'],'file':_0x48f8f8['filePath'],'service':summarizeService(_0x48f8f8['entry'])},'message':'Exported\x20service\x20'+_0x48f8f8['entry'][_0x2abaa9(0x13a)]+'.'};}},{'service':'service','command':a39_0x5894e8(0x12b),'description':a39_0x5894e8(0x138),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x3939f4=a39_0x5894e8,_0x5718ec=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x5718ec['length'],'services':_0x5718ec[_0x3939f4(0x110)](summarizeService)}};}},{'service':a39_0x5894e8(0x126),'command':a39_0x5894e8(0x11a),'description':a39_0x5894e8(0x112),'risk':a39_0x5894e8(0x13e),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x2aa2f6){const _0x2284ac=a39_0x5894e8,_0x432423=getLocalServiceEntry(_0x2aa2f6[_0x2284ac(0x135)](_0x2284ac(0x126)));return{'method':_0x2284ac(0x136),'url':getServiceRegistryPath(),'body':{'service':_0x2aa2f6[_0x2284ac(0x135)]('service'),'found':Boolean(_0x432423),'version':_0x432423?.[_0x2284ac(0x11f)],'source':_0x432423?.['source']},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x54a591){const _0x580395=a39_0x5894e8,_0x3eff14=removeServiceManifest(_0x54a591[_0x580395(0x135)](_0x580395(0x126)));return{'ok':!![],'data':{'registryPath':_0x3eff14[_0x580395(0x119)],'serviceCount':_0x3eff14[_0x580395(0x124)],'service':summarizeService(_0x3eff14[_0x580395(0x111)])},'message':_0x580395(0x137)+_0x3eff14[_0x580395(0x111)][_0x580395(0x13a)]+'.'};}},{'service':a39_0x5894e8(0x126),'command':'detail','description':a39_0x5894e8(0x11e),'risk':a39_0x5894e8(0x130),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x4cf131){const _0x136068=a39_0x5894e8,_0x54dc8b=getLocalServiceEntry(_0x4cf131[_0x136068(0x135)](_0x136068(0x126)));if(!_0x54dc8b)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x4cf131[_0x136068(0x135)](_0x136068(0x126))},'message':'Local\x20service\x20not\x20found:\x20'+_0x4cf131[_0x136068(0x135)](_0x136068(0x126))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x54dc8b),'manifest':_0x54dc8b['manifest'],'normalizedManifest':_0x54dc8b[_0x136068(0x132)]}};}}];