@lovrabet/lovrabet-cli 2.1.9-beta.3 → 2.1.9-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/app-config/shared.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/ocr/index.js +1 -1
  36. package/lib/commands/personal-bff/index.js +1 -1
  37. package/lib/commands/registry.js +1 -1
  38. package/lib/commands/schema.js +1 -1
  39. package/lib/commands/service/dynamic.js +1 -1
  40. package/lib/commands/service/index.js +1 -1
  41. package/lib/commands/service/registry.js +1 -1
  42. package/lib/commands/skill/commands/create.js +1 -1
  43. package/lib/commands/skill/commands/install.js +1 -1
  44. package/lib/commands/skill/commands/list.js +1 -1
  45. package/lib/commands/skill/commands/push.js +1 -1
  46. package/lib/commands/skill/commands/validate.js +1 -1
  47. package/lib/commands/skill/flags.js +1 -1
  48. package/lib/commands/skill/index.js +1 -1
  49. package/lib/commands/skill/manifest-helpers.js +1 -1
  50. package/lib/commands/skill/push-execute.js +1 -1
  51. package/lib/commands/skill/push-flow-helpers.js +1 -1
  52. package/lib/commands/skill/push-retarget.js +1 -1
  53. package/lib/commands/skill/scopes.js +1 -1
  54. package/lib/commands/skill/summary.js +1 -1
  55. package/lib/commands/skill/templates.js +1 -1
  56. package/lib/commands/skill/validate.js +1 -1
  57. package/lib/commands/sql/detail.js +1 -1
  58. package/lib/commands/sql/exec.js +1 -1
  59. package/lib/commands/sql/index.js +1 -1
  60. package/lib/commands/update.js +1 -1
  61. package/lib/commands/workspace/index.js +1 -1
  62. package/lib/config/schema.js +1 -1
  63. package/lib/constant/app.js +1 -1
  64. package/lib/constant/auth-mode.js +1 -1
  65. package/lib/constant/cli.js +1 -1
  66. package/lib/constant/defaults.js +1 -1
  67. package/lib/constant/distribution.js +1 -1
  68. package/lib/constant/domain.js +1 -1
  69. package/lib/constant/env.js +1 -1
  70. package/lib/constant/output.js +1 -1
  71. package/lib/constant/product.js +1 -1
  72. package/lib/constant/risk.js +1 -1
  73. package/lib/constant/url.js +1 -1
  74. package/lib/context.js +1 -1
  75. package/lib/core/api-client.js +1 -1
  76. package/lib/core/db-resolver.js +1 -1
  77. package/lib/core/sdk-client.js +1 -1
  78. package/lib/errors.js +1 -1
  79. package/lib/framework/build-all-flags.js +1 -1
  80. package/lib/framework/dryrun.js +1 -1
  81. package/lib/framework/flags.js +1 -1
  82. package/lib/framework/help.js +1 -1
  83. package/lib/framework/index.js +1 -1
  84. package/lib/framework/output.js +1 -1
  85. package/lib/framework/preparse.js +1 -1
  86. package/lib/framework/response.js +1 -1
  87. package/lib/framework/runner-confirmation.js +1 -1
  88. package/lib/framework/runner-error.js +1 -1
  89. package/lib/framework/runner.js +1 -1
  90. package/lib/framework/schema-export.js +1 -1
  91. package/lib/framework/service-order.js +1 -1
  92. package/lib/framework/types.js +1 -1
  93. package/lib/generated/build-info.js +1 -1
  94. package/lib/help.js +1 -1
  95. package/lib/skills/npx-skills-add.js +1 -1
  96. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  97. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  98. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  99. package/lib/skills/runtime-skill-sync/links.js +1 -1
  100. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  101. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  102. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  103. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  104. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  105. package/lib/skills/runtime-skill-sync/push.js +1 -1
  106. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  107. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  108. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  109. package/lib/skills/runtime-skill-sync.js +1 -1
  110. package/lib/utils/apply-jq-filter.js +1 -1
  111. package/lib/utils/logger.js +1 -1
  112. package/lib/utils/params.js +1 -1
  113. package/lib/utils/platform.js +1 -1
  114. package/lib/utils/update-notice.js +1 -1
  115. package/lib/utils/version.js +1 -1
  116. package/lib/utils/write-cli-side-channel.js +1 -1
  117. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x50a4a1=a30_0x4b42;function a30_0x4b42(_0x53d9c1,_0x143eb5){_0x53d9c1=_0x53d9c1-0x6a;const _0x2df086=a30_0x2df0();let _0x4b4258=_0x2df086[_0x53d9c1];return _0x4b4258;}(function(_0x3b420e,_0x57b063){const _0x143724=a30_0x4b42,_0x4e81dd=_0x3b420e();while(!![]){try{const _0x4fb0b5=-parseInt(_0x143724(0x70))/0x1+parseInt(_0x143724(0x76))/0x2*(parseInt(_0x143724(0x71))/0x3)+-parseInt(_0x143724(0x82))/0x4*(parseInt(_0x143724(0x89))/0x5)+-parseInt(_0x143724(0x74))/0x6+parseInt(_0x143724(0x7e))/0x7+parseInt(_0x143724(0x85))/0x8*(parseInt(_0x143724(0x79))/0x9)+parseInt(_0x143724(0x88))/0xa*(-parseInt(_0x143724(0x75))/0xb);if(_0x4fb0b5===_0x57b063)break;else _0x4e81dd['push'](_0x4e81dd['shift']());}catch(_0x4f7801){_0x4e81dd['push'](_0x4e81dd['shift']());}}}(a30_0x2df0,0x79a2d));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_0x50a4a1(0x7a),'type':a30_0x50a4a1(0x8b),'required':!![],'description':a30_0x50a4a1(0x8c)},FILEPATH_FLAG={'name':'filepath','type':a30_0x50a4a1(0x8b),'required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload'},DOWNLOAD_FLAG={'name':a30_0x50a4a1(0x8d),'type':'boolean','description':a30_0x50a4a1(0x80)};function a30_0x2df0(){const _0x1dc9c6=['appCode','4vkJEcr','filepath','File','8hEfNQL','Preview:\x20upload\x20','path','30RWETha','1854790TDZtJX','POST','string','Path\x20to\x20the\x20local\x20file\x20to\x20upload','download','Uploaded\x20file.','query-url','str','read','upload','write','\x20to\x20runtime\x20app\x20','765416TNTEDp','251070yPiQnF','trim','body','1006176upbpio','1059938PTTBWK','22ohQZEB','bool','build','6050394BZIjHr','file','Uploaded\x20file:\x20','description','validation','3489563QsTkeR','filePath','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported'];a30_0x2df0=function(){return _0x1dc9c6;};return a30_0x2df0();}function requireFilePath(_0x295cc2){const _0x26b335=a30_0x50a4a1,_0xebcb7=_0x295cc2[_0x26b335(0x72)]();if(!_0xebcb7)throw CliErrors[_0x26b335(0x7d)]('filePath\x20is\x20required.');return _0xebcb7;}const fileUpload={'service':a30_0x50a4a1(0x7a),'command':a30_0x50a4a1(0x6d),'description':'Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','risk':a30_0x50a4a1(0x6e),'flags':[FILE_FLAG],async 'dryRun'(_0x27dcca){const _0x126662=a30_0x50a4a1,_0x496279=requireRuntimeUploadFile(_0x27dcca[_0x126662(0x6b)](_0x126662(0x7a)),_0x126662(0x84));return dryRun(_0x126662(0x8a),'/client/uploadFile')[_0x126662(0x73)]({'appCode':_0x27dcca['appCode'],'multipart':{'file':_0x496279}})[_0x126662(0x7c)](_0x126662(0x86)+_0x496279[_0x126662(0x87)]+_0x126662(0x6f)+_0x27dcca[_0x126662(0x81)])[_0x126662(0x78)]();},async 'execute'(_0x43f8a0){const _0x473769=a30_0x50a4a1,_0x54b2f0=requireRuntimeUploadFile(_0x43f8a0[_0x473769(0x6b)](_0x473769(0x7a)),_0x473769(0x84)),_0x554f31=await uploadRuntimeFile(_0x43f8a0[_0x473769(0x81)],_0x54b2f0['path']);return{'ok':!![],'data':_0x554f31,'message':_0x554f31['filePath']?_0x473769(0x7b)+_0x554f31[_0x473769(0x7f)]:_0x473769(0x8e)};}},fileQueryUrl={'service':a30_0x50a4a1(0x7a),'command':a30_0x50a4a1(0x6a),'description':'Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','risk':a30_0x50a4a1(0x6c),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x37dd33){const _0x429e0f=a30_0x50a4a1,_0x5f11b7=requireFilePath(_0x37dd33['str'](_0x429e0f(0x83))),_0x60ccf7=await queryRuntimeFileUrl(_0x5f11b7,{'download':_0x37dd33[_0x429e0f(0x77)]('download')});return{'ok':!![],'data':_0x60ccf7};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
1
+ const a30_0x2de666=a30_0x20e6;(function(_0x1f4b27,_0x54a7bb){const _0x451005=a30_0x20e6,_0x3f6e5e=_0x1f4b27();while(!![]){try{const _0x4ddf81=-parseInt(_0x451005(0x187))/0x1*(parseInt(_0x451005(0x190))/0x2)+parseInt(_0x451005(0x188))/0x3+parseInt(_0x451005(0x174))/0x4*(-parseInt(_0x451005(0x179))/0x5)+parseInt(_0x451005(0x193))/0x6*(parseInt(_0x451005(0x18f))/0x7)+-parseInt(_0x451005(0x18a))/0x8*(parseInt(_0x451005(0x183))/0x9)+parseInt(_0x451005(0x177))/0xa+parseInt(_0x451005(0x17c))/0xb*(-parseInt(_0x451005(0x195))/0xc);if(_0x4ddf81===_0x54a7bb)break;else _0x3f6e5e['push'](_0x3f6e5e['shift']());}catch(_0x30f632){_0x3f6e5e['push'](_0x3f6e5e['shift']());}}}(a30_0x2eb2,0x751bf));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';function a30_0x2eb2(){const _0x2135f0=['9NCoVNp','download','trim','Preview:\x20upload\x20','1PwrTno','1524855MSgcwT','build','158776TcDyLK','validation','query-url','read','write','105moBUVU','1101160NbYcWN','path','upload','236658jXYmbR','string','36ZDPpxf','str','filepath','\x20to\x20runtime\x20app\x20','12BbLsWb','Path\x20to\x20the\x20local\x20file\x20to\x20upload','file','4113150DjpwdJ','File','15585IcVNYT','Uploaded\x20file.','Uploaded\x20file:\x20','1656556ruAFOk','bool','description','appCode','filePath','filePath\x20is\x20required.','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported'];a30_0x2eb2=function(){return _0x2135f0;};return a30_0x2eb2();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x2de666(0x176),'type':a30_0x2de666(0x194),'required':!![],'description':a30_0x2de666(0x175)},FILEPATH_FLAG={'name':a30_0x2de666(0x172),'type':a30_0x2de666(0x194),'required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload'},DOWNLOAD_FLAG={'name':a30_0x2de666(0x184),'type':'boolean','description':a30_0x2de666(0x182)};function requireFilePath(_0xc42047){const _0x48b373=a30_0x2de666,_0x32d593=_0xc42047[_0x48b373(0x185)]();if(!_0x32d593)throw CliErrors[_0x48b373(0x18b)](_0x48b373(0x181));return _0x32d593;}const fileUpload={'service':a30_0x2de666(0x176),'command':a30_0x2de666(0x192),'description':'Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','risk':a30_0x2de666(0x18e),'flags':[FILE_FLAG],async 'dryRun'(_0x489f8c){const _0x546f5f=a30_0x2de666,_0x221554=requireRuntimeUploadFile(_0x489f8c[_0x546f5f(0x196)](_0x546f5f(0x176)),_0x546f5f(0x178));return dryRun('POST','/client/uploadFile')['body']({'appCode':_0x489f8c[_0x546f5f(0x17f)],'multipart':{'file':_0x221554}})[_0x546f5f(0x17e)](_0x546f5f(0x186)+_0x221554[_0x546f5f(0x191)]+_0x546f5f(0x173)+_0x489f8c[_0x546f5f(0x17f)])[_0x546f5f(0x189)]();},async 'execute'(_0x571c32){const _0x428039=a30_0x2de666,_0x59e94a=requireRuntimeUploadFile(_0x571c32[_0x428039(0x196)](_0x428039(0x176)),_0x428039(0x178)),_0x2b7dbb=await uploadRuntimeFile(_0x571c32[_0x428039(0x17f)],_0x59e94a['path']);return{'ok':!![],'data':_0x2b7dbb,'message':_0x2b7dbb[_0x428039(0x180)]?_0x428039(0x17b)+_0x2b7dbb[_0x428039(0x180)]:_0x428039(0x17a)};}},fileQueryUrl={'service':a30_0x2de666(0x176),'command':a30_0x2de666(0x18c),'description':'Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','risk':a30_0x2de666(0x18d),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x2f2c49){const _0x1431e6=a30_0x2de666,_0x17f7aa=requireFilePath(_0x2f2c49['str'](_0x1431e6(0x172))),_0x40b000=await queryRuntimeFileUrl(_0x17f7aa,{'download':_0x2f2c49[_0x1431e6(0x17d)](_0x1431e6(0x184))});return{'ok':!![],'data':_0x40b000};}};function a30_0x20e6(_0x4d79aa,_0x15154c){_0x4d79aa=_0x4d79aa-0x172;const _0x2eb22f=a30_0x2eb2();let _0x20e670=_0x2eb22f[_0x4d79aa];return _0x20e670;}export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
1
- const a31_0x4ddddd=a31_0x579b;(function(_0x3156a7,_0x1ddc51){const _0x188162=a31_0x579b,_0x573910=_0x3156a7();while(!![]){try{const _0x7587c5=parseInt(_0x188162(0x193))/0x1*(-parseInt(_0x188162(0x1b3))/0x2)+-parseInt(_0x188162(0x185))/0x3+parseInt(_0x188162(0x188))/0x4+-parseInt(_0x188162(0x1b1))/0x5*(parseInt(_0x188162(0x18a))/0x6)+-parseInt(_0x188162(0x197))/0x7*(parseInt(_0x188162(0x1a2))/0x8)+parseInt(_0x188162(0x19f))/0x9+parseInt(_0x188162(0x194))/0xa*(parseInt(_0x188162(0x189))/0xb);if(_0x7587c5===_0x1ddc51)break;else _0x573910['push'](_0x573910['shift']());}catch(_0x9b00b8){_0x573910['push'](_0x573910['shift']());}}}(a31_0x4bc5,0x3396e));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x4ddddd(0x179),'type':a31_0x4ddddd(0x19e),'description':a31_0x4ddddd(0x199)},{'name':a31_0x4ddddd(0x1b7),'type':a31_0x4ddddd(0x19e),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a31_0x4ddddd(0x1b7)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4ddddd(0x17e),'type':a31_0x4ddddd(0x1a5),'description':a31_0x4ddddd(0x18e)+PRODUCT_CONFIG[a31_0x4ddddd(0x190)]+a31_0x4ddddd(0x182),'default':![]},{'name':a31_0x4ddddd(0x18f),'type':'boolean','description':a31_0x4ddddd(0x178),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x4ddddd(0x19c),'type':'string','description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x4ddddd(0x179),'type':a31_0x4ddddd(0x19e),'description':a31_0x4ddddd(0x1a7)},{'name':a31_0x4ddddd(0x1b7),'type':'string','description':a31_0x4ddddd(0x181),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x4ddddd(0x1a5),'description':a31_0x4ddddd(0x18e)+PRODUCT_CONFIG[a31_0x4ddddd(0x190)]+a31_0x4ddddd(0x182),'default':![]},{'name':'yes','type':'boolean','description':a31_0x4ddddd(0x178),'default':![]}];export async function runInit(_0x2aa960){const _0xe99c62=a31_0x4ddddd,_0x564465=isNonInteractiveMode(_0x2aa960),_0x8f63d2=_0x2aa960[_0xe99c62(0x17e)]?_0xe99c62(0x17e):_0xe99c62(0x17c),_0x37ac28=resolveWriteConfigPath(_0x8f63d2);try{_0x564465?await runNonInteractive(_0x2aa960,_0x37ac28):await runInteractive(_0x2aa960,_0x37ac28);}catch(_0x30ebfc){if(_0x30ebfc instanceof AbortPrompt)throw CliErrors[_0xe99c62(0x17f)]();throw _0x30ebfc;}}export async function runInitImport(_0x194540){const _0x25c816=a31_0x4ddddd,_0x52e205=_0x194540[_0x25c816(0x17e)]?'global':_0x25c816(0x17c),_0x4ab9a9=resolveWriteConfigPath(_0x52e205);await runFromImport(_0x194540,_0x4ab9a9);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x24b4b3,_0xb98036){const _0x200f7a=a31_0x4ddddd,_0x22bdd9=resolveFilePath(_0x24b4b3['file']);if(!existsSync(_0x22bdd9))throw CliErrors[_0x200f7a(0x186)](_0x200f7a(0x1b4)+_0x22bdd9);const _0x2678d9=readSourceFile(_0x22bdd9),_0x3d71e8=convertToRuntimeConfig(_0x2678d9);_0x24b4b3[_0x200f7a(0x179)]&&(_0x3d71e8['appcode']=String(_0x24b4b3[_0x200f7a(0x179)]));_0x24b4b3[_0x200f7a(0x1b7)]&&(_0x3d71e8[_0x200f7a(0x1b7)]=resolveInitEnv(_0x24b4b3));if(!_0x3d71e8[_0x200f7a(0x179)])throw CliErrors['validation'](_0x200f7a(0x1a4),_0x200f7a(0x192));await writeInitConfig(_0xb98036,_0x3d71e8,_0x24b4b3),console[_0x200f7a(0x196)](_0x200f7a(0x17d)+_0x22bdd9),console[_0x200f7a(0x196)]('\x20\x20config:\x20\x20'+_0xb98036),console['log'](_0x200f7a(0x195)+_0x3d71e8[_0x200f7a(0x179)]);if(_0x3d71e8[_0x200f7a(0x1ac)])console[_0x200f7a(0x196)]('\x20\x20default:\x20'+_0x3d71e8['defaultApp']);}function convertToRuntimeConfig(_0x24177c){const _0x517c4c=a31_0x4ddddd;if(_0x24177c[_0x517c4c(0x1b0)]&&typeof _0x24177c['apps']===_0x517c4c(0x1a9))throw CliErrors['validation'](_0x517c4c(0x180),_0x517c4c(0x1b2));const _0x285a94={};for(const _0x11bfe8 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x24177c[_0x11bfe8]!==undefined&&(_0x285a94[_0x11bfe8]=_0x24177c[_0x11bfe8]);}return!_0x285a94[_0x517c4c(0x1a3)]&&(_0x285a94[_0x517c4c(0x1a3)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x285a94;}async function runNonInteractive(_0x150b12,_0x4d8fd4){const _0x310097=a31_0x4ddddd,_0xb29c93=_0x150b12[_0x310097(0x179)];if(!_0xb29c93)throw CliErrors[_0x310097(0x183)](_0x310097(0x179),'Usage:\x20'+CLI_BIN_NAME+_0x310097(0x1ad));const _0x5905f4=resolveInitEnv(_0x150b12);await writeInitConfig(_0x4d8fd4,{'appcode':_0xb29c93,'env':_0x5905f4},_0x150b12),console[_0x310097(0x196)](_0x310097(0x1b8)+_0x4d8fd4),console[_0x310097(0x196)](_0x310097(0x195)+_0xb29c93),console[_0x310097(0x196)](_0x310097(0x1ae)+_0x5905f4);}function a31_0x579b(_0x19b575,_0x40d972){_0x19b575=_0x19b575-0x177;const _0x4bc530=a31_0x4bc5();let _0x579b31=_0x4bc530[_0x19b575];return _0x579b31;}async function runInteractive(_0x574443,_0x55bb15){const _0x268003=a31_0x4ddddd,_0x36bbfa=loadExisting(_0x55bb15),_0x2be27a=typeof _0x36bbfa?.[_0x268003(0x179)]===_0x268003(0x19e)?_0x36bbfa['appcode']:'',_0x6cc82d=resolveInitEnv(_0x574443);console['log'](CLI_BIN_NAME+_0x268003(0x18b)+PRODUCT_CONFIG[_0x268003(0x190)]+'\x0a');if(existsSync(_0x55bb15)&&!_0x574443[_0x268003(0x18f)]){const _0x2d0d9f=await promptYesNo(_0x268003(0x1a1)+_0x55bb15+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x2d0d9f){console[_0x268003(0x196)](_0x268003(0x1af));return;}}const _0xa932d7=typeof _0x574443['appcode']==='string'?_0x574443[_0x268003(0x179)][_0x268003(0x1b5)]():'';let _0x5b132f=_0xa932d7;!_0x5b132f&&(_0x5b132f=await promptInput(_0x268003(0x177),_0x2be27a));if(!_0x5b132f[_0x268003(0x1b5)]())throw CliErrors['validation'](_0x268003(0x191));await writeInitConfig(_0x55bb15,{'appcode':_0x5b132f[_0x268003(0x1b5)](),'env':_0x6cc82d},_0x574443),console[_0x268003(0x196)](_0x268003(0x187)+_0x55bb15),console[_0x268003(0x196)]('\x20\x20appcode:\x20'+_0x5b132f[_0x268003(0x1b5)]()),console[_0x268003(0x196)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x6cc82d);}async function writeInitConfig(_0x3249e5,_0x30c1d8,_0x2d6f7a){const _0x434654=a31_0x4ddddd;let _0x456ed8={};existsSync(_0x3249e5)&&!_0x2d6f7a[_0x434654(0x18f)]&&(_0x456ed8=readConfigFile(_0x3249e5));for(const [_0x2e5eac,_0x4c2251]of Object[_0x434654(0x1ab)](_0x30c1d8)){_0x4c2251!==undefined&&(_0x456ed8[_0x2e5eac]=_0x4c2251);}if(_0x456ed8[_0x434654(0x17b)])delete _0x456ed8[_0x434654(0x17b)];writeConfigFile(_0x3249e5,_0x456ed8);}class AbortPrompt extends Error{constructor(){const _0x3cccf3=a31_0x4ddddd;super(_0x3cccf3(0x18d)),this['name']=_0x3cccf3(0x198);}}function createSafeRl(){const _0x53bc7d=a31_0x4ddddd,_0x4caa0e=createInterface({'input':process[_0x53bc7d(0x19a)],'output':process['stdout']});let _0x49d7b8;const _0x4e62c0=new Promise((_0x46449e,_0x200631)=>{const _0x5c89da=_0x53bc7d;_0x49d7b8=()=>{const _0x190352=a31_0x579b;_0x49d7b8&&(_0x4caa0e[_0x190352(0x1b9)]('SIGINT',_0x49d7b8),_0x49d7b8=undefined);try{_0x4caa0e['close']();}catch{}_0x200631(new AbortPrompt());},_0x4caa0e['once'](_0x5c89da(0x1b6),_0x49d7b8);}),_0x33e245=()=>{const _0x1c4eb=_0x53bc7d;_0x49d7b8&&(_0x4caa0e[_0x1c4eb(0x1b9)](_0x1c4eb(0x1b6),_0x49d7b8),_0x49d7b8=undefined);try{_0x4caa0e['close']();}catch{}};return{'rl':_0x4caa0e,'abortPromise':_0x4e62c0,'disposeSuccess':_0x33e245};}async function promptInput(_0x266108,_0x229105){const _0x440cb1=a31_0x4ddddd,{rl:_0x5726ca,abortPromise:_0x4d45ce,disposeSuccess:_0x42d901}=createSafeRl(),_0x2f5287=new Promise(_0x44a5e7=>{const _0xe38b=a31_0x579b,_0x50df91=_0x229105?'\x20\x20'+_0x266108+'\x20('+_0x229105+_0xe38b(0x1ba):'\x20\x20'+_0x266108+':\x20';_0x5726ca[_0xe38b(0x1a8)](_0x50df91,_0x1c0edc=>{const _0x58ee34=_0xe38b;_0x42d901(),_0x44a5e7(_0x1c0edc[_0x58ee34(0x1b5)]()||_0x229105);});});return Promise[_0x440cb1(0x18c)]([_0x2f5287,_0x4d45ce]);}async function promptYesNo(_0x17da4f,_0x55f7e6){const _0x4a2989=a31_0x4ddddd,{rl:_0x399882,abortPromise:_0x180c2a,disposeSuccess:_0x38d39f}=createSafeRl(),_0xac70f5=new Promise(_0x51340a=>{const _0x3b06bd=a31_0x579b,_0x4f6ae5=_0x55f7e6?'[Y/n]':_0x3b06bd(0x19d);_0x399882['question']('\x20\x20'+_0x17da4f+'\x20'+_0x4f6ae5+':\x20',_0x22688c=>{const _0x15c42c=_0x3b06bd;_0x38d39f();const _0x4f6b45=_0x22688c[_0x15c42c(0x1b5)]()[_0x15c42c(0x1a6)]();if(_0x4f6b45==='y'||_0x4f6b45===_0x15c42c(0x18f))_0x51340a(!![]);else{if(_0x4f6b45==='n'||_0x4f6b45==='no')_0x51340a(![]);else _0x51340a(_0x55f7e6);}});});return Promise[_0x4a2989(0x18c)]([_0xac70f5,_0x180c2a]);}function loadExisting(_0x2ed11a){if(!existsSync(_0x2ed11a))return null;return readConfigFile(_0x2ed11a);}function a31_0x4bc5(){const _0x5d515d=['env','Initialized\x20','removeListener','):\x20','App\x20code','Skip\x20confirmation\x20when\x20overwriting','appcode','parse','app','project','Imported\x20from\x20','global','cancelled','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Override\x20imported\x20default\x20env',')\x20instead\x20of\x20project','flagMissing','\x22.\x20Allowed:\x20','415095KvYJXr','validation','\x0aInitialized\x20','160508wsdSzW','584606ilnCIU','771246JDiZCA','\x20init\x20—\x20Create\x20','race','User\x20aborted\x20prompt','Write\x20to\x20global\x20(~/','yes','newConfigFileName','App\x20code\x20cannot\x20be\x20empty.','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`.','141gzuRYM','220yqOrts','\x20\x20appcode:\x20','log','7fwEEWN','AbortPrompt','App\x20code\x20for\x20the\x20project','stdin','cwd','file','[y/N]','string','2119401dNbiIa','Invalid\x20env\x20\x22','File\x20','2520096XzbZQO','riskLevel','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','boolean','toLowerCase','Override\x20imported\x20default\x20appcode','question','object','join','entries','defaultApp','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','\x20\x20env:\x20\x20\x20\x20\x20','Aborted.','apps','15CrwTcx','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','5596fhgOot','Source\x20file\x20not\x20found:\x20','trim','SIGINT'];a31_0x4bc5=function(){return _0x5d515d;};return a31_0x4bc5();}function resolveFilePath(_0x336b21){const _0x1ce3e2=a31_0x4ddddd;return isAbsolute(_0x336b21)?_0x336b21:resolve(process[_0x1ce3e2(0x19b)](),_0x336b21);}function readSourceFile(_0x59195c){const _0x1a5a3c=a31_0x4ddddd;try{const _0x33dad6=readFileSync(_0x59195c,{'encoding':'utf8'});return JSON[_0x1a5a3c(0x17a)](_0x33dad6);}catch(_0x21f50d){throw CliErrors[_0x1a5a3c(0x186)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x21f50d['message']);}}function resolveInitEnv(_0x1a8502){const _0x21628b=a31_0x4ddddd,_0x57af46=_0x1a8502[_0x21628b(0x1b7)];if(_0x57af46===undefined||_0x57af46==='')return DEFAULT_CONFIG_VALUES[_0x21628b(0x1b7)];if(!RUNTIME_ENV_VALUES['includes'](_0x57af46))throw CliErrors[_0x21628b(0x186)](_0x21628b(0x1a0)+_0x57af46+_0x21628b(0x184)+RUNTIME_ENV_VALUES[_0x21628b(0x1aa)](',\x20'));return _0x57af46;}
1
+ const a31_0x4055f9=a31_0x378d;(function(_0x13a963,_0x38f081){const _0x5a2338=a31_0x378d,_0x499d95=_0x13a963();while(!![]){try{const _0x5b5f00=parseInt(_0x5a2338(0x16e))/0x1*(parseInt(_0x5a2338(0x15b))/0x2)+-parseInt(_0x5a2338(0x166))/0x3*(-parseInt(_0x5a2338(0x15a))/0x4)+parseInt(_0x5a2338(0x13a))/0x5*(-parseInt(_0x5a2338(0x165))/0x6)+-parseInt(_0x5a2338(0x16b))/0x7*(-parseInt(_0x5a2338(0x162))/0x8)+parseInt(_0x5a2338(0x16a))/0x9*(-parseInt(_0x5a2338(0x145))/0xa)+parseInt(_0x5a2338(0x148))/0xb+-parseInt(_0x5a2338(0x134))/0xc*(parseInt(_0x5a2338(0x12c))/0xd);if(_0x5b5f00===_0x38f081)break;else _0x499d95['push'](_0x499d95['shift']());}catch(_0x4e3e5d){_0x499d95['push'](_0x499d95['shift']());}}}(a31_0x2566,0xc1748));import{existsSync,readFileSync}from'node:fs';function a31_0x2566(){const _0x314d08=['apiDir','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Failed\x20to\x20parse\x20source\x20file:\x20','):\x20','riskLevel','project','validation','boolean','\x20\x20default:\x20','File\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','defaultApp','once','join','appcode','newConfigFileName','4280ldUZsW','2laVOyR','file','trim','App\x20code\x20cannot\x20be\x20empty.','Skip\x20confirmation\x20when\x20overwriting','App\x20code','object','736zYUWJW',')\x20instead\x20of\x20project','log','19914iACWAj','201UTaAOX','Target\x20environment\x20(default\x20','\x20\x20config:\x20\x20','Write\x20to\x20global\x20(~/','5310eyhHJN','46802uhmGaL','entries','includes','1569787yreYuy','Override\x20imported\x20default\x20appcode','cwd','close','Invalid\x20env\x20\x22','env','SIGINT','Aborted.','Initialized\x20','string','91tqkpPW','yes','stdout','global','\x0aInitialized\x20','removeListener','question','\x20\x20env:\x20\x20\x20\x20\x20','3355644rifGLx','\x20already\x20exists.\x20Overwrite?','apps','[y/N]','App\x20code\x20for\x20the\x20project','race','595qWPNKO','flagMissing','message','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','parse','\x20\x20appcode:\x20','name','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`.','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','[Y/n]','cancelled','3560SsbITu','Usage:\x20','\x22.\x20Allowed:\x20','12080893ckybhi','app'];a31_0x2566=function(){return _0x314d08;};return a31_0x2566();}import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a31_0x378d(_0x16851a,_0x46b8cb){_0x16851a=_0x16851a-0x128;const _0x2566dd=a31_0x2566();let _0x378dfb=_0x2566dd[_0x16851a];return _0x378dfb;}import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x4055f9(0x158),'type':a31_0x4055f9(0x12b),'description':a31_0x4055f9(0x138)},{'name':a31_0x4055f9(0x173),'type':a31_0x4055f9(0x12b),'description':a31_0x4055f9(0x167)+DEFAULT_CONFIG_VALUES[a31_0x4055f9(0x173)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4055f9(0x12f),'type':a31_0x4055f9(0x151),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x4055f9(0x159)]+a31_0x4055f9(0x163),'default':![]},{'name':a31_0x4055f9(0x12d),'type':'boolean','description':a31_0x4055f9(0x15f),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a31_0x4055f9(0x12b),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x4055f9(0x158),'type':'string','description':a31_0x4055f9(0x16f)},{'name':a31_0x4055f9(0x173),'type':a31_0x4055f9(0x12b),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4055f9(0x12f),'type':a31_0x4055f9(0x151),'description':a31_0x4055f9(0x169)+PRODUCT_CONFIG[a31_0x4055f9(0x159)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x4055f9(0x12d),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x34d6ba){const _0x356472=a31_0x4055f9,_0x226ddb=isNonInteractiveMode(_0x34d6ba),_0xab937e=_0x34d6ba[_0x356472(0x12f)]?_0x356472(0x12f):_0x356472(0x14f),_0x197fd8=resolveWriteConfigPath(_0xab937e);try{_0x226ddb?await runNonInteractive(_0x34d6ba,_0x197fd8):await runInteractive(_0x34d6ba,_0x197fd8);}catch(_0x4ef70f){if(_0x4ef70f instanceof AbortPrompt)throw CliErrors[_0x356472(0x144)]();throw _0x4ef70f;}}export async function runInitImport(_0x12995c){const _0x622c60=a31_0x4055f9,_0x1e2798=_0x12995c[_0x622c60(0x12f)]?_0x622c60(0x12f):_0x622c60(0x14f),_0xe089c1=resolveWriteConfigPath(_0x1e2798);await runFromImport(_0x12995c,_0xe089c1);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x4055f9(0x14a)]);async function runFromImport(_0x555e49,_0x4f36b0){const _0x17ac59=a31_0x4055f9,_0x77c513=resolveFilePath(_0x555e49[_0x17ac59(0x15c)]);if(!existsSync(_0x77c513))throw CliErrors[_0x17ac59(0x150)]('Source\x20file\x20not\x20found:\x20'+_0x77c513);const _0x571021=readSourceFile(_0x77c513),_0x496813=convertToRuntimeConfig(_0x571021);_0x555e49['appcode']&&(_0x496813[_0x17ac59(0x158)]=String(_0x555e49[_0x17ac59(0x158)]));_0x555e49['env']&&(_0x496813[_0x17ac59(0x173)]=resolveInitEnv(_0x555e49));if(!_0x496813[_0x17ac59(0x158)])throw CliErrors[_0x17ac59(0x150)](_0x17ac59(0x154),_0x17ac59(0x141));await writeInitConfig(_0x4f36b0,_0x496813,_0x555e49),console[_0x17ac59(0x164)]('Imported\x20from\x20'+_0x77c513),console['log'](_0x17ac59(0x168)+_0x4f36b0),console[_0x17ac59(0x164)]('\x20\x20appcode:\x20'+_0x496813[_0x17ac59(0x158)]);if(_0x496813[_0x17ac59(0x155)])console[_0x17ac59(0x164)](_0x17ac59(0x152)+_0x496813['defaultApp']);}function convertToRuntimeConfig(_0x26ab95){const _0x3948c1=a31_0x4055f9;if(_0x26ab95['apps']&&typeof _0x26ab95[_0x3948c1(0x136)]===_0x3948c1(0x161))throw CliErrors['validation'](_0x3948c1(0x14b),_0x3948c1(0x13d));const _0x5145ce={};for(const _0x90f499 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x26ab95[_0x90f499]!==undefined&&(_0x5145ce[_0x90f499]=_0x26ab95[_0x90f499]);}return!_0x5145ce[_0x3948c1(0x14e)]&&(_0x5145ce['riskLevel']=DEFAULT_CONFIG_VALUES[_0x3948c1(0x14e)]),_0x5145ce;}async function runNonInteractive(_0x449b52,_0x158fff){const _0x532342=a31_0x4055f9,_0xfa0f54=_0x449b52[_0x532342(0x158)];if(!_0xfa0f54)throw CliErrors[_0x532342(0x13b)](_0x532342(0x158),_0x532342(0x146)+CLI_BIN_NAME+_0x532342(0x142));const _0x56ba12=resolveInitEnv(_0x449b52);await writeInitConfig(_0x158fff,{'appcode':_0xfa0f54,'env':_0x56ba12},_0x449b52),console[_0x532342(0x164)](_0x532342(0x12a)+_0x158fff),console[_0x532342(0x164)](_0x532342(0x13f)+_0xfa0f54),console['log'](_0x532342(0x133)+_0x56ba12);}async function runInteractive(_0x47605d,_0x5d7407){const _0x4ab980=a31_0x4055f9,_0x5be7f5=loadExisting(_0x5d7407),_0x371566=typeof _0x5be7f5?.[_0x4ab980(0x158)]===_0x4ab980(0x12b)?_0x5be7f5[_0x4ab980(0x158)]:'',_0x369b38=resolveInitEnv(_0x47605d);console[_0x4ab980(0x164)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x4ab980(0x159)]+'\x0a');if(existsSync(_0x5d7407)&&!_0x47605d['yes']){const _0x2e5b05=await promptYesNo(_0x4ab980(0x153)+_0x5d7407+_0x4ab980(0x135),![]);if(!_0x2e5b05){console[_0x4ab980(0x164)](_0x4ab980(0x129));return;}}const _0x2f796b=typeof _0x47605d[_0x4ab980(0x158)]===_0x4ab980(0x12b)?_0x47605d[_0x4ab980(0x158)][_0x4ab980(0x15d)]():'';let _0x10c619=_0x2f796b;!_0x10c619&&(_0x10c619=await promptInput(_0x4ab980(0x160),_0x371566));if(!_0x10c619[_0x4ab980(0x15d)]())throw CliErrors[_0x4ab980(0x150)](_0x4ab980(0x15e));await writeInitConfig(_0x5d7407,{'appcode':_0x10c619[_0x4ab980(0x15d)](),'env':_0x369b38},_0x47605d),console['log'](_0x4ab980(0x130)+_0x5d7407),console[_0x4ab980(0x164)](_0x4ab980(0x13f)+_0x10c619[_0x4ab980(0x15d)]()),console[_0x4ab980(0x164)](_0x4ab980(0x133)+_0x369b38);}async function writeInitConfig(_0x3f3ed7,_0x30dfa1,_0x2cd672){const _0x3f07aa=a31_0x4055f9;let _0x169961={};existsSync(_0x3f3ed7)&&!_0x2cd672['yes']&&(_0x169961=readConfigFile(_0x3f3ed7));for(const [_0x1fa99c,_0x5e56b9]of Object[_0x3f07aa(0x16c)](_0x30dfa1)){_0x5e56b9!==undefined&&(_0x169961[_0x1fa99c]=_0x5e56b9);}if(_0x169961[_0x3f07aa(0x149)])delete _0x169961['app'];writeConfigFile(_0x3f3ed7,_0x169961);}class AbortPrompt extends Error{constructor(){const _0x4ed101=a31_0x4055f9;super('User\x20aborted\x20prompt'),this[_0x4ed101(0x140)]='AbortPrompt';}}function createSafeRl(){const _0xb83454=a31_0x4055f9,_0x332e98=createInterface({'input':process['stdin'],'output':process[_0xb83454(0x12e)]});let _0x95dc7e;const _0x5a0073=new Promise((_0x3d3d74,_0x3a8b6a)=>{const _0x5d7475=_0xb83454;_0x95dc7e=()=>{const _0x65cb64=a31_0x378d;_0x95dc7e&&(_0x332e98[_0x65cb64(0x131)]('SIGINT',_0x95dc7e),_0x95dc7e=undefined);try{_0x332e98[_0x65cb64(0x171)]();}catch{}_0x3a8b6a(new AbortPrompt());},_0x332e98[_0x5d7475(0x156)](_0x5d7475(0x128),_0x95dc7e);}),_0x29742f=()=>{const _0x1e15f4=_0xb83454;_0x95dc7e&&(_0x332e98['removeListener'](_0x1e15f4(0x128),_0x95dc7e),_0x95dc7e=undefined);try{_0x332e98[_0x1e15f4(0x171)]();}catch{}};return{'rl':_0x332e98,'abortPromise':_0x5a0073,'disposeSuccess':_0x29742f};}async function promptInput(_0x2d27d6,_0x351b39){const _0x49eaae=a31_0x4055f9,{rl:_0x1356c7,abortPromise:_0x501b7e,disposeSuccess:_0x3072fa}=createSafeRl(),_0x20cec9=new Promise(_0x165025=>{const _0x148a05=a31_0x378d,_0x372c2e=_0x351b39?'\x20\x20'+_0x2d27d6+'\x20('+_0x351b39+_0x148a05(0x14d):'\x20\x20'+_0x2d27d6+':\x20';_0x1356c7[_0x148a05(0x132)](_0x372c2e,_0x5059dd=>{const _0x30fbf5=_0x148a05;_0x3072fa(),_0x165025(_0x5059dd[_0x30fbf5(0x15d)]()||_0x351b39);});});return Promise[_0x49eaae(0x139)]([_0x20cec9,_0x501b7e]);}async function promptYesNo(_0x4fb818,_0x1d6c56){const _0x156af6=a31_0x4055f9,{rl:_0x3f0672,abortPromise:_0x347f04,disposeSuccess:_0x1f6085}=createSafeRl(),_0x585d7a=new Promise(_0x34ba01=>{const _0x397220=a31_0x378d,_0x15b848=_0x1d6c56?_0x397220(0x143):_0x397220(0x137);_0x3f0672[_0x397220(0x132)]('\x20\x20'+_0x4fb818+'\x20'+_0x15b848+':\x20',_0x41bcea=>{const _0x4989fe=_0x397220;_0x1f6085();const _0x2001dd=_0x41bcea[_0x4989fe(0x15d)]()['toLowerCase']();if(_0x2001dd==='y'||_0x2001dd==='yes')_0x34ba01(!![]);else{if(_0x2001dd==='n'||_0x2001dd==='no')_0x34ba01(![]);else _0x34ba01(_0x1d6c56);}});});return Promise[_0x156af6(0x139)]([_0x585d7a,_0x347f04]);}function loadExisting(_0x399cdc){if(!existsSync(_0x399cdc))return null;return readConfigFile(_0x399cdc);}function resolveFilePath(_0x4c390c){const _0x33df17=a31_0x4055f9;return isAbsolute(_0x4c390c)?_0x4c390c:resolve(process[_0x33df17(0x170)](),_0x4c390c);}function readSourceFile(_0x117b93){const _0xcd6be2=a31_0x4055f9;try{const _0x2f20f2=readFileSync(_0x117b93,{'encoding':'utf8'});return JSON[_0xcd6be2(0x13e)](_0x2f20f2);}catch(_0x492e61){throw CliErrors[_0xcd6be2(0x150)](_0xcd6be2(0x14c)+_0x492e61[_0xcd6be2(0x13c)]);}}function resolveInitEnv(_0x5ede7e){const _0x1ba5fe=a31_0x4055f9,_0x1abf9d=_0x5ede7e['env'];if(_0x1abf9d===undefined||_0x1abf9d==='')return DEFAULT_CONFIG_VALUES[_0x1ba5fe(0x173)];if(!RUNTIME_ENV_VALUES[_0x1ba5fe(0x16d)](_0x1abf9d))throw CliErrors['validation'](_0x1ba5fe(0x172)+_0x1abf9d+_0x1ba5fe(0x147)+RUNTIME_ENV_VALUES[_0x1ba5fe(0x157)](',\x20'));return _0x1abf9d;}
@@ -1 +1 @@
1
- const a32_0x2eb38e=a32_0x30bd;(function(_0x3fb39b,_0x828fd1){const _0x1ba58e=a32_0x30bd,_0x5f8d13=_0x3fb39b();while(!![]){try{const _0x333ed3=parseInt(_0x1ba58e(0x182))/0x1*(-parseInt(_0x1ba58e(0x189))/0x2)+parseInt(_0x1ba58e(0x18d))/0x3*(parseInt(_0x1ba58e(0x172))/0x4)+parseInt(_0x1ba58e(0x187))/0x5+-parseInt(_0x1ba58e(0x191))/0x6+-parseInt(_0x1ba58e(0x169))/0x7+parseInt(_0x1ba58e(0x18c))/0x8+parseInt(_0x1ba58e(0x185))/0x9*(parseInt(_0x1ba58e(0x15a))/0xa);if(_0x333ed3===_0x828fd1)break;else _0x5f8d13['push'](_0x5f8d13['shift']());}catch(_0x466678){_0x5f8d13['push'](_0x5f8d13['shift']());}}}(a32_0x3d8b,0x603ad));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_0x3d8b(){const _0x110636=['isFile','/client/knowledge-base/personal/','length','topk','list','appCode','File\x20path\x20is\x20required.','description','530OImQwr','detail','Created\x20KB\x20entry\x20','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','read','Updated\x20KB\x20entry\x20','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','string','version','ragStatus','--topk\x20must\x20be\x20a\x20positive\x20number.','bool','createTime','build','userId','4433072LRgpCu','validation','POST','metadata','map','file','title','/update','trim','4mIkYEI','number','search','scope','verbose','update','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','body','docId','create','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','utf8','ragErrorMessage','/client/knowledge-base/personal/create','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','str','321MDUwMV','File\x20not\x20found:\x20','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','171621YEGZPo','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','1045020igwjoa','flag','1744JzBGNo','write','Personal\x20knowledge-base\x20entry\x20ID','969480YwZCJQ','1156179yvxGbA','content','updateTime','query','2513244cbNjBy','num'];a32_0x3d8b=function(){return _0x110636;};return a32_0x3d8b();}import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x2eb38e(0x16f),'type':a32_0x2eb38e(0x161),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a32_0x2eb38e(0x16e),'type':a32_0x2eb38e(0x161),'required':!![],'description':a32_0x2eb38e(0x160)},QUERY_FLAG={'name':a32_0x2eb38e(0x190),'type':a32_0x2eb38e(0x161),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':a32_0x2eb38e(0x196),'type':a32_0x2eb38e(0x173),'description':a32_0x2eb38e(0x180)};function readKnowledgeFile(_0x354425){const _0x2e2bed=a32_0x2eb38e;if(!_0x354425)throw CliErrors[_0x2e2bed(0x16a)](_0x2e2bed(0x158));if(!existsSync(_0x354425))throw CliErrors[_0x2e2bed(0x16a)](_0x2e2bed(0x183)+_0x354425);if(!statSync(_0x354425)[_0x2e2bed(0x193)]())throw CliErrors[_0x2e2bed(0x16a)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x354425);return readFileSync(_0x354425,_0x2e2bed(0x17d));}function a32_0x30bd(_0x3beb5b,_0x2ff78f){_0x3beb5b=_0x3beb5b-0x158;const _0x3d8beb=a32_0x3d8b();let _0x30bd74=_0x3d8beb[_0x3beb5b];return _0x30bd74;}function summarizePersonalItem(_0x263ab9){const _0x472d7e=a32_0x2eb38e;return{'id':_0x263ab9['id'],'title':_0x263ab9['title'],'version':_0x263ab9['version'],'ragStatus':_0x263ab9[_0x472d7e(0x163)],'ragErrorMessage':_0x263ab9[_0x472d7e(0x17e)],'updateTime':_0x263ab9[_0x472d7e(0x18f)]};}function detailPersonalItem(_0x4567c2){const _0x3efeeb=a32_0x2eb38e;return{'id':_0x4567c2['id'],'appCode':_0x4567c2['appCode'],'scope':_0x4567c2[_0x3efeeb(0x175)],'userId':_0x4567c2[_0x3efeeb(0x168)],'title':_0x4567c2[_0x3efeeb(0x16f)],'content':_0x4567c2[_0x3efeeb(0x18e)]??'','version':_0x4567c2[_0x3efeeb(0x162)],'ragStatus':_0x4567c2[_0x3efeeb(0x163)],'ragErrorMessage':_0x4567c2['ragErrorMessage'],'createTime':_0x4567c2[_0x3efeeb(0x166)],'updateTime':_0x4567c2['updateTime']};}function summarizeSearchHit(_0x3119a0){const _0x6a08ab=a32_0x2eb38e;return{'scope':_0x3119a0[_0x6a08ab(0x175)],'docId':_0x3119a0[_0x6a08ab(0x17a)],'score':_0x3119a0['score'],'weightedScore':_0x3119a0['weightedScore'],'content':_0x3119a0['content'],'metadata':_0x3119a0[_0x6a08ab(0x16c)]};}function readTopK(_0x2a2196){const _0x4e6c5b=a32_0x2eb38e,_0x38440c=_0x2a2196[_0x4e6c5b(0x188)](_0x4e6c5b(0x196));if(_0x38440c===undefined||_0x38440c===null||_0x38440c==='')return undefined;const _0x3592a8=_0x2a2196['num'](_0x4e6c5b(0x196));if(!Number['isFinite'](_0x3592a8)||_0x3592a8<0x1)throw CliErrors[_0x4e6c5b(0x16a)](_0x4e6c5b(0x164));return _0x3592a8;}const kbList={'service':'kb','command':a32_0x2eb38e(0x197),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0xe54a3a){const _0x877d3a=a32_0x2eb38e,_0x192900=await listPersonalKnowledgeBaseItems(_0xe54a3a[_0x877d3a(0x198)]);if(_0xe54a3a[_0x877d3a(0x165)](_0x877d3a(0x176)))return{'ok':!![],'data':{'total':_0x192900[_0x877d3a(0x195)],'items':_0x192900}};return{'ok':!![],'data':{'total':_0x192900['length'],'items':_0x192900[_0x877d3a(0x16d)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x2eb38e(0x15b),'description':a32_0x2eb38e(0x186),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x2eb38e(0x18b)}],async 'execute'(_0x3f1923){const _0x175e52=await getPersonalKnowledgeBaseItem(_0x3f1923['num']('id'),_0x3f1923['appCode']);return{'ok':!![],'data':detailPersonalItem(_0x175e52)};}},kbCreate={'service':'kb','command':a32_0x2eb38e(0x17b),'description':a32_0x2eb38e(0x178),'risk':a32_0x2eb38e(0x18a),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x538c1e){const _0x5b1c1b=a32_0x2eb38e,_0x5357b0=_0x538c1e[_0x5b1c1b(0x181)](_0x5b1c1b(0x16f)),_0x151a76=readKnowledgeFile(_0x538c1e[_0x5b1c1b(0x181)](_0x5b1c1b(0x16e))),_0x42786c=await createPersonalKnowledgeBaseItem(_0x538c1e[_0x5b1c1b(0x198)],{'title':_0x5357b0,'content':_0x151a76});return{'ok':!![],'data':summarizePersonalItem(_0x42786c),'message':_0x5b1c1b(0x15c)+_0x42786c['id']+'\x20('+_0x42786c['title']+')'};},async 'dryRun'(_0x1ada76){const _0xcc9a38=a32_0x2eb38e,_0x33a2cc=_0x1ada76['str'](_0xcc9a38(0x16f)),_0x9c6e06=readKnowledgeFile(_0x1ada76['str'](_0xcc9a38(0x16e)));return dryRun(_0xcc9a38(0x16b),_0xcc9a38(0x17f))['body']({'appCode':_0x1ada76['appCode'],'title':_0x33a2cc,'content':_0x9c6e06})[_0xcc9a38(0x159)](_0xcc9a38(0x184)+_0x33a2cc+'\x22')[_0xcc9a38(0x167)]();}},kbUpdate={'service':'kb','command':a32_0x2eb38e(0x177),'description':a32_0x2eb38e(0x15d),'risk':a32_0x2eb38e(0x18a),'flags':[{...ID_FLAG,'description':a32_0x2eb38e(0x18b)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x116e31){const _0x2aa04b=a32_0x2eb38e,_0x3186b3=_0x116e31[_0x2aa04b(0x192)]('id'),_0x5d8b73=readKnowledgeFile(_0x116e31[_0x2aa04b(0x181)](_0x2aa04b(0x16e))),_0x4ea52b=_0x116e31[_0x2aa04b(0x181)](_0x2aa04b(0x16f))||(await getPersonalKnowledgeBaseItem(_0x3186b3,_0x116e31[_0x2aa04b(0x198)]))[_0x2aa04b(0x16f)],_0x1b3767=await updatePersonalKnowledgeBaseItem(_0x3186b3,_0x116e31['appCode'],{'title':_0x4ea52b,'content':_0x5d8b73});return{'ok':!![],'data':summarizePersonalItem(_0x1b3767),'message':_0x2aa04b(0x15f)+_0x1b3767['id']+'\x20('+_0x1b3767[_0x2aa04b(0x16f)]+')'};},async 'dryRun'(_0x29bb86){const _0xa6721a=a32_0x2eb38e,_0x4f418a=_0x29bb86[_0xa6721a(0x192)]('id'),_0x2c85b9=readKnowledgeFile(_0x29bb86['str'](_0xa6721a(0x16e))),_0x1d6243=_0x29bb86[_0xa6721a(0x181)]('title')||(await getPersonalKnowledgeBaseItem(_0x4f418a,_0x29bb86[_0xa6721a(0x198)]))[_0xa6721a(0x16f)];return dryRun(_0xa6721a(0x16b),_0xa6721a(0x194)+_0x4f418a+_0xa6721a(0x170))[_0xa6721a(0x179)]({'appCode':_0x29bb86[_0xa6721a(0x198)],'title':_0x1d6243,'content':_0x2c85b9})[_0xa6721a(0x159)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x4f418a)['build']();}},kbSearch={'service':'kb','command':a32_0x2eb38e(0x174),'description':a32_0x2eb38e(0x17c),'risk':a32_0x2eb38e(0x15e),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x361645){const _0x297a00=a32_0x2eb38e;if(!_0x361645[_0x297a00(0x181)](_0x297a00(0x190))['trim']())throw CliErrors[_0x297a00(0x16a)]('Search\x20query\x20is\x20required.');readTopK(_0x361645);},async 'execute'(_0x2f0f09){const _0x34fea4=a32_0x2eb38e,_0x5e494c=_0x2f0f09['str'](_0x34fea4(0x190))[_0x34fea4(0x171)](),_0x1c668d=readTopK(_0x2f0f09),_0x464d97=await searchKnowledgeBase(_0x2f0f09[_0x34fea4(0x198)],{'query':_0x5e494c,'topK':_0x1c668d});return{'ok':!![],'data':{'total':_0x464d97[_0x34fea4(0x195)],'hits':_0x464d97[_0x34fea4(0x16d)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a32_0x25bc59=a32_0xba77;(function(_0x326b3c,_0x354af6){const _0x13bc24=a32_0xba77,_0x295df8=_0x326b3c();while(!![]){try{const _0xa66976=parseInt(_0x13bc24(0x93))/0x1+-parseInt(_0x13bc24(0xa7))/0x2*(parseInt(_0x13bc24(0xc2))/0x3)+-parseInt(_0x13bc24(0xce))/0x4+-parseInt(_0x13bc24(0xc3))/0x5+-parseInt(_0x13bc24(0x98))/0x6*(-parseInt(_0x13bc24(0xc7))/0x7)+-parseInt(_0x13bc24(0xb5))/0x8*(parseInt(_0x13bc24(0xa9))/0x9)+parseInt(_0x13bc24(0xc6))/0xa*(parseInt(_0x13bc24(0x95))/0xb);if(_0xa66976===_0x354af6)break;else _0x295df8['push'](_0x295df8['shift']());}catch(_0x22af46){_0x295df8['push'](_0x295df8['shift']());}}}(a32_0x7048,0xb3c09));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';function a32_0xba77(_0x49ed04,_0x443a12){_0x49ed04=_0x49ed04-0x91;const _0x70488a=a32_0x7048();let _0xba7709=_0x70488a[_0x49ed04];return _0xba7709;}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a32_0x7048(){const _0x20930b=['title','validation','/update','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','userId','create','update','body','2016GZhUlh','/client/knowledge-base/personal/','ragStatus','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','Personal\x20knowledge-base\x20entry\x20ID','query','version','read','weightedScore','Search\x20query\x20is\x20required.','description','Created\x20KB\x20entry\x20','Updated\x20KB\x20entry\x20','3bysCcd','4650560CdMYQP','File\x20is\x20not\x20a\x20regular\x20file:\x20','trim','24710NajQrW','77dzFBpg','length','POST','str','/client/knowledge-base/personal/create','isFinite','write','3879716JOnfeo','topk','ragErrorMessage','metadata','scope','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','list','573909CwQNDX','file','13970JNbXdN','utf8','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','298086gZvRVc','updateTime','build','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','num','number','appCode','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','File\x20not\x20found:\x20','map','content','score','verbose','681688oAVemw','string','45765BoZtlO','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','detail','createTime'];a32_0x7048=function(){return _0x20930b;};return a32_0x7048();}const TITLE_FLAG={'name':a32_0x25bc59(0xad),'type':'string','required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a32_0x25bc59(0x94),'type':a32_0x25bc59(0xa8),'required':!![],'description':a32_0x25bc59(0xaa)},QUERY_FLAG={'name':a32_0x25bc59(0xba),'type':a32_0x25bc59(0xa8),'required':!![],'description':a32_0x25bc59(0xb0)},TOPK_FLAG={'name':a32_0x25bc59(0xcf),'type':a32_0x25bc59(0x9d),'description':a32_0x25bc59(0x97)};function readKnowledgeFile(_0x5294a9){const _0x4f29c3=a32_0x25bc59;if(!_0x5294a9)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x5294a9))throw CliErrors[_0x4f29c3(0xae)](_0x4f29c3(0xa2)+_0x5294a9);if(!statSync(_0x5294a9)['isFile']())throw CliErrors['validation'](_0x4f29c3(0xc4)+_0x5294a9);return readFileSync(_0x5294a9,_0x4f29c3(0x96));}function summarizePersonalItem(_0x322825){const _0x1b7dac=a32_0x25bc59;return{'id':_0x322825['id'],'title':_0x322825['title'],'version':_0x322825[_0x1b7dac(0xbb)],'ragStatus':_0x322825['ragStatus'],'ragErrorMessage':_0x322825[_0x1b7dac(0xd0)],'updateTime':_0x322825['updateTime']};}function detailPersonalItem(_0x51ca9a){const _0x580996=a32_0x25bc59;return{'id':_0x51ca9a['id'],'appCode':_0x51ca9a[_0x580996(0x9e)],'scope':_0x51ca9a['scope'],'userId':_0x51ca9a[_0x580996(0xb1)],'title':_0x51ca9a[_0x580996(0xad)],'content':_0x51ca9a[_0x580996(0xa4)]??'','version':_0x51ca9a['version'],'ragStatus':_0x51ca9a[_0x580996(0xb7)],'ragErrorMessage':_0x51ca9a[_0x580996(0xd0)],'createTime':_0x51ca9a[_0x580996(0xac)],'updateTime':_0x51ca9a[_0x580996(0x99)]};}function summarizeSearchHit(_0x22c301){const _0x306cdd=a32_0x25bc59;return{'scope':_0x22c301[_0x306cdd(0xd2)],'docId':_0x22c301['docId'],'score':_0x22c301[_0x306cdd(0xa5)],'weightedScore':_0x22c301[_0x306cdd(0xbd)],'content':_0x22c301[_0x306cdd(0xa4)],'metadata':_0x22c301[_0x306cdd(0xd1)]};}function readTopK(_0x298f55){const _0x2a9a9e=a32_0x25bc59,_0x58f9c2=_0x298f55['flag'](_0x2a9a9e(0xcf));if(_0x58f9c2===undefined||_0x58f9c2===null||_0x58f9c2==='')return undefined;const _0x8568ec=_0x298f55[_0x2a9a9e(0x9c)](_0x2a9a9e(0xcf));if(!Number[_0x2a9a9e(0xcc)](_0x8568ec)||_0x8568ec<0x1)throw CliErrors['validation']('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x8568ec;}const kbList={'service':'kb','command':a32_0x25bc59(0x92),'description':a32_0x25bc59(0x9f),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x3b1ac4){const _0x138d98=a32_0x25bc59,_0x5b6dc2=await listPersonalKnowledgeBaseItems(_0x3b1ac4['appCode']);if(_0x3b1ac4['bool'](_0x138d98(0xa6)))return{'ok':!![],'data':{'total':_0x5b6dc2['length'],'items':_0x5b6dc2}};return{'ok':!![],'data':{'total':_0x5b6dc2['length'],'items':_0x5b6dc2[_0x138d98(0xa3)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x25bc59(0xab),'description':a32_0x25bc59(0xa0),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x25bc59(0xb9)}],async 'execute'(_0x145127){const _0x532e63=a32_0x25bc59,_0x154e64=await getPersonalKnowledgeBaseItem(_0x145127['num']('id'),_0x145127[_0x532e63(0x9e)]);return{'ok':!![],'data':detailPersonalItem(_0x154e64)};}},kbCreate={'service':'kb','command':a32_0x25bc59(0xb2),'description':a32_0x25bc59(0x91),'risk':a32_0x25bc59(0xcd),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x1de8d0){const _0x3c886e=a32_0x25bc59,_0x17184d=_0x1de8d0[_0x3c886e(0xca)](_0x3c886e(0xad)),_0x28d618=readKnowledgeFile(_0x1de8d0[_0x3c886e(0xca)]('file')),_0x1a6808=await createPersonalKnowledgeBaseItem(_0x1de8d0[_0x3c886e(0x9e)],{'title':_0x17184d,'content':_0x28d618});return{'ok':!![],'data':summarizePersonalItem(_0x1a6808),'message':_0x3c886e(0xc0)+_0x1a6808['id']+'\x20('+_0x1a6808[_0x3c886e(0xad)]+')'};},async 'dryRun'(_0x51eb75){const _0x1edfdb=a32_0x25bc59,_0xdefd95=_0x51eb75[_0x1edfdb(0xca)]('title'),_0x227ad=readKnowledgeFile(_0x51eb75[_0x1edfdb(0xca)](_0x1edfdb(0x94)));return dryRun(_0x1edfdb(0xc9),_0x1edfdb(0xcb))[_0x1edfdb(0xb4)]({'appCode':_0x51eb75[_0x1edfdb(0x9e)],'title':_0xdefd95,'content':_0x227ad})['description']('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0xdefd95+'\x22')[_0x1edfdb(0x9a)]();}},kbUpdate={'service':'kb','command':a32_0x25bc59(0xb3),'description':a32_0x25bc59(0x9b),'risk':'write','flags':[{...ID_FLAG,'description':a32_0x25bc59(0xb9)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x1fbff0){const _0x35d91e=a32_0x25bc59,_0x5b8fa7=_0x1fbff0['num']('id'),_0x146225=readKnowledgeFile(_0x1fbff0[_0x35d91e(0xca)](_0x35d91e(0x94))),_0x21c1f4=_0x1fbff0[_0x35d91e(0xca)](_0x35d91e(0xad))||(await getPersonalKnowledgeBaseItem(_0x5b8fa7,_0x1fbff0[_0x35d91e(0x9e)]))[_0x35d91e(0xad)],_0x3a009b=await updatePersonalKnowledgeBaseItem(_0x5b8fa7,_0x1fbff0[_0x35d91e(0x9e)],{'title':_0x21c1f4,'content':_0x146225});return{'ok':!![],'data':summarizePersonalItem(_0x3a009b),'message':_0x35d91e(0xc1)+_0x3a009b['id']+'\x20('+_0x3a009b[_0x35d91e(0xad)]+')'};},async 'dryRun'(_0x278434){const _0x378442=a32_0x25bc59,_0x370f8d=_0x278434[_0x378442(0x9c)]('id'),_0x27d85f=readKnowledgeFile(_0x278434[_0x378442(0xca)](_0x378442(0x94))),_0x4490c5=_0x278434[_0x378442(0xca)](_0x378442(0xad))||(await getPersonalKnowledgeBaseItem(_0x370f8d,_0x278434['appCode']))[_0x378442(0xad)];return dryRun('POST',_0x378442(0xb6)+_0x370f8d+_0x378442(0xaf))[_0x378442(0xb4)]({'appCode':_0x278434[_0x378442(0x9e)],'title':_0x4490c5,'content':_0x27d85f})[_0x378442(0xbf)](_0x378442(0xa1)+_0x370f8d)['build']();}},kbSearch={'service':'kb','command':'search','description':a32_0x25bc59(0xb8),'risk':a32_0x25bc59(0xbc),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x214ff3){const _0x6b148c=a32_0x25bc59;if(!_0x214ff3[_0x6b148c(0xca)](_0x6b148c(0xba))[_0x6b148c(0xc5)]())throw CliErrors[_0x6b148c(0xae)](_0x6b148c(0xbe));readTopK(_0x214ff3);},async 'execute'(_0x23a438){const _0x3c8873=a32_0x25bc59,_0xcad4d=_0x23a438[_0x3c8873(0xca)](_0x3c8873(0xba))[_0x3c8873(0xc5)](),_0x263785=readTopK(_0x23a438),_0x50bb36=await searchKnowledgeBase(_0x23a438['appCode'],{'query':_0xcad4d,'topK':_0x263785});return{'ok':!![],'data':{'total':_0x50bb36[_0x3c8873(0xc8)],'hits':_0x50bb36['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- function a33_0x50be(_0x58f3a9,_0x3bd8f0){_0x58f3a9=_0x58f3a9-0x1e4;const _0x345cf3=a33_0x345c();let _0x50be6f=_0x345cf3[_0x58f3a9];return _0x50be6f;}const a33_0x135345=a33_0x50be;(function(_0x18c9c4,_0x28df6f){const _0xc76fd9=a33_0x50be,_0x3bac7e=_0x18c9c4();while(!![]){try{const _0x62107b=-parseInt(_0xc76fd9(0x203))/0x1*(parseInt(_0xc76fd9(0x1fd))/0x2)+parseInt(_0xc76fd9(0x1f4))/0x3*(-parseInt(_0xc76fd9(0x1f9))/0x4)+-parseInt(_0xc76fd9(0x202))/0x5*(parseInt(_0xc76fd9(0x1eb))/0x6)+-parseInt(_0xc76fd9(0x206))/0x7*(parseInt(_0xc76fd9(0x1ee))/0x8)+parseInt(_0xc76fd9(0x1ea))/0x9+parseInt(_0xc76fd9(0x1e8))/0xa*(-parseInt(_0xc76fd9(0x1f1))/0xb)+parseInt(_0xc76fd9(0x207))/0xc;if(_0x62107b===_0x28df6f)break;else _0x3bac7e['push'](_0x3bac7e['shift']());}catch(_0x5e1245){_0x3bac7e['push'](_0x3bac7e['shift']());}}}(a33_0x345c,0xe7678));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x131a6a){const _0x3b2bf6=a33_0x50be;if(_0x131a6a['length']===0x0){console['log'](_0x3b2bf6(0x1f5));return;}console[_0x3b2bf6(0x1ed)]('*\x20'+CLI_DISPLAY_NAME+_0x3b2bf6(0x1e9)),_0x131a6a[_0x3b2bf6(0x1ff)]((_0x49cf5a,_0x2d4dbb)=>{const _0x1d6403=_0x3b2bf6,_0x1f8ca4=new Date(_0x49cf5a[_0x1d6403(0x1fe)])[_0x1d6403(0x1f7)](_0x1d6403(0x1e4)),_0x24b61=_0x49cf5a[_0x1d6403(0x205)]==='success'?'√':_0x49cf5a[_0x1d6403(0x205)]===_0x1d6403(0x1fb)?'×':_0x49cf5a[_0x1d6403(0x205)]===_0x1d6403(0x1ec)?'!':'i';console[_0x1d6403(0x1ed)](_0x2d4dbb+0x1+'.\x20'+_0x24b61+'\x20['+_0x49cf5a['command']+']\x20'+_0x49cf5a[_0x1d6403(0x1f8)]),console[_0x1d6403(0x1ed)]('\x20\x20\x20Time:\x20'+_0x1f8ca4),_0x49cf5a[_0x1d6403(0x1f2)]&&console[_0x1d6403(0x1ed)](_0x1d6403(0x1e6)+_0x49cf5a[_0x1d6403(0x1f2)]+'ms'),_0x49cf5a[_0x1d6403(0x1fc)]&&Object[_0x1d6403(0x1ef)](_0x49cf5a[_0x1d6403(0x1fc)])[_0x1d6403(0x1f6)]>0x0&&console[_0x1d6403(0x1ed)]('\x20\x20\x20Details:\x20'+JSON['stringify'](_0x49cf5a[_0x1d6403(0x1fc)],null,0x2)),console['log']('');});}function a33_0x345c(){const _0x2f842a=['614qplpIX','timestamp','forEach','show','Clear\x20command\x20history\x20logs','5MGxEqW','5567CLeHfb','View\x20command\x20history\x20logs','level','203jFmkJC','55975884gORtMz','*\x20Logs\x20cleared','en-US','read','\x20\x20\x20Duration:\x20','clearLogs','290IZMtHU','\x20logs:\x0a','12157623eQDkgQ','4677348nEPvhV','warn','log','160856HfRjjS','keys','readLogs','502953zIApvL','duration','clear','15KJhPMG','*\x20No\x20logs\x20found','length','toLocaleString','message','535980gFeBzQ','logs','error','details'];a33_0x345c=function(){return _0x2f842a;};return a33_0x345c();}export const logsDefinitions=[{'service':a33_0x135345(0x1fa),'command':a33_0x135345(0x200),'description':a33_0x135345(0x204),'risk':a33_0x135345(0x1e5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x130cd4){const _0x2327c2=a33_0x135345;return printLogs(logger[_0x2327c2(0x1f0)]()),{'ok':!![]};}},{'service':a33_0x135345(0x1fa),'command':a33_0x135345(0x1f3),'description':a33_0x135345(0x201),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x567384){const _0x1682de=a33_0x135345;return logger[_0x1682de(0x1e7)](),console['log'](_0x1682de(0x208)),{'ok':!![]};}}];
1
+ const a33_0x2283fc=a33_0x284a;function a33_0x284a(_0x315d8f,_0x126ddf){_0x315d8f=_0x315d8f-0x1e1;const _0x4c25c8=a33_0x4c25();let _0x284ab5=_0x4c25c8[_0x315d8f];return _0x284ab5;}(function(_0x1d3a3e,_0x2c074f){const _0x1899c3=a33_0x284a,_0x34fe08=_0x1d3a3e();while(!![]){try{const _0x4345ab=parseInt(_0x1899c3(0x1ee))/0x1*(-parseInt(_0x1899c3(0x1e1))/0x2)+parseInt(_0x1899c3(0x1f9))/0x3+-parseInt(_0x1899c3(0x1e6))/0x4*(parseInt(_0x1899c3(0x1ea))/0x5)+-parseInt(_0x1899c3(0x1fd))/0x6+-parseInt(_0x1899c3(0x1f4))/0x7+parseInt(_0x1899c3(0x1e9))/0x8*(parseInt(_0x1899c3(0x1f0))/0x9)+parseInt(_0x1899c3(0x1e8))/0xa*(parseInt(_0x1899c3(0x203))/0xb);if(_0x4345ab===_0x2c074f)break;else _0x34fe08['push'](_0x34fe08['shift']());}catch(_0x58a1b0){_0x34fe08['push'](_0x34fe08['shift']());}}}(a33_0x4c25,0xa64f7));function a33_0x4c25(){const _0x3740c9=['\x20\x20\x20Details:\x20','message','logs','write','109748NsXqZS','\x20\x20\x20Duration:\x20','320VwJsyZ','28808NwCHBt','35KnfTPv','clear','*\x20Logs\x20cleared','length','368497dLoFzD','clearLogs','1071zaOfoX','readLogs','en-US','Clear\x20command\x20history\x20logs','8316595OgFwuU','stringify','level','View\x20command\x20history\x20logs','details','1776090lCiepP','keys','success','warn','2655822GZkeru','duration','timestamp','show','toLocaleString','log','636603vzmxyt','\x20logs:\x0a','2uKMBLN'];a33_0x4c25=function(){return _0x3740c9;};return a33_0x4c25();}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x5b22fe){const _0x4a8a4a=a33_0x284a;if(_0x5b22fe[_0x4a8a4a(0x1ed)]===0x0){console[_0x4a8a4a(0x202)]('*\x20No\x20logs\x20found');return;}console[_0x4a8a4a(0x202)]('*\x20'+CLI_DISPLAY_NAME+_0x4a8a4a(0x204)),_0x5b22fe['forEach']((_0x5cc8e3,_0x2e9a72)=>{const _0x364831=_0x4a8a4a,_0x33146a=new Date(_0x5cc8e3[_0x364831(0x1ff)])[_0x364831(0x201)](_0x364831(0x1f2)),_0x11bc96=_0x5cc8e3[_0x364831(0x1f6)]===_0x364831(0x1fb)?'√':_0x5cc8e3[_0x364831(0x1f6)]==='error'?'×':_0x5cc8e3[_0x364831(0x1f6)]===_0x364831(0x1fc)?'!':'i';console[_0x364831(0x202)](_0x2e9a72+0x1+'.\x20'+_0x11bc96+'\x20['+_0x5cc8e3['command']+']\x20'+_0x5cc8e3[_0x364831(0x1e3)]),console[_0x364831(0x202)]('\x20\x20\x20Time:\x20'+_0x33146a),_0x5cc8e3['duration']&&console[_0x364831(0x202)](_0x364831(0x1e7)+_0x5cc8e3[_0x364831(0x1fe)]+'ms'),_0x5cc8e3[_0x364831(0x1f8)]&&Object[_0x364831(0x1fa)](_0x5cc8e3['details'])[_0x364831(0x1ed)]>0x0&&console[_0x364831(0x202)](_0x364831(0x1e2)+JSON[_0x364831(0x1f5)](_0x5cc8e3['details'],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':'logs','command':a33_0x2283fc(0x200),'description':a33_0x2283fc(0x1f7),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5c6d1a){const _0x4edd16=a33_0x2283fc;return printLogs(logger[_0x4edd16(0x1f1)]()),{'ok':!![]};}},{'service':a33_0x2283fc(0x1e4),'command':a33_0x2283fc(0x1eb),'description':a33_0x2283fc(0x1f3),'risk':a33_0x2283fc(0x1e5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x9f52a9){const _0x180468=a33_0x2283fc;return logger[_0x180468(0x1ef)](),console['log'](_0x180468(0x1ec)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- function a34_0x5c90(_0xa61fc1,_0x3af61c){_0xa61fc1=_0xa61fc1-0x1a3;const _0xa13515=a34_0xa135();let _0x5c909f=_0xa13515[_0xa61fc1];return _0x5c909f;}const a34_0x45ea15=a34_0x5c90;(function(_0x5322d1,_0x2600a1){const _0x43d930=a34_0x5c90,_0x50a4dd=_0x5322d1();while(!![]){try{const _0x744bf6=-parseInt(_0x43d930(0x1a4))/0x1*(-parseInt(_0x43d930(0x1d7))/0x2)+parseInt(_0x43d930(0x1bd))/0x3*(parseInt(_0x43d930(0x1af))/0x4)+-parseInt(_0x43d930(0x1ac))/0x5+parseInt(_0x43d930(0x1b5))/0x6+parseInt(_0x43d930(0x1c7))/0x7*(parseInt(_0x43d930(0x1cd))/0x8)+parseInt(_0x43d930(0x1d9))/0x9*(-parseInt(_0x43d930(0x1c2))/0xa)+-parseInt(_0x43d930(0x1bc))/0xb;if(_0x744bf6===_0x2600a1)break;else _0x50a4dd['push'](_0x50a4dd['shift']());}catch(_0x2a1428){_0x50a4dd['push'](_0x50a4dd['shift']());}}}(a34_0xa135,0x24997));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x45ea15(0x1aa),a34_0x45ea15(0x1cb),'form',a34_0x45ea15(0x1d2)],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':a34_0x45ea15(0x1c5),'form':'Table','idCard':a34_0x45ea15(0x1b8)},SCENE_FLAG={'name':'scene','type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x45ea15(0x1d5)},IMAGE_FILE_FLAG={'name':a34_0x45ea15(0x1ca),'type':a34_0x45ea15(0x1c0),'description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':a34_0x45ea15(0x1a9),'type':'string','description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x5ba5cd){const _0x534660=a34_0x45ea15,_0x126281=_0x5ba5cd['trim']()[_0x534660(0x1b1)]();if(_0x126281==='idcard')return'idCard';if(_0x126281===_0x534660(0x1aa)||_0x126281===_0x534660(0x1cb)||_0x126281==='form')return _0x126281;throw CliErrors[_0x534660(0x1d6)](_0x534660(0x1a3)+_0x5ba5cd+_0x534660(0x1d1)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x389288){const _0x43abdd=a34_0x45ea15,_0x15b675=_0x389288[_0x43abdd(0x1a8)](_0x43abdd(0x1ca))[_0x43abdd(0x1c3)](),_0x4eb70d=_0x389288['str'](_0x43abdd(0x1a9))[_0x43abdd(0x1c3)]();return{'imageFile':_0x15b675,'imageUrl':_0x4eb70d,'count':[_0x15b675,_0x4eb70d][_0x43abdd(0x1be)](Boolean)[_0x43abdd(0x1a7)]};}function a34_0xa135(){const _0x1efcec=['count','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','IdCard','fileName','apiError','appCode','4487637pzUxIe','3NkHbCB','filter','scene','string','POST','10FSSoVi','trim','fileUrl','General','/client/uploadFile','2765QLbYCa','imageUrl','description','image-file','general','write','4008wVgeCv','<filePath\x20returned\x20by\x20/client/uploadFile>','/client/ocr','Preview:\x20recognize\x20','.\x20Supported\x20scenes:\x20','idCard','File\x20URL\x20response\x20missing\x20fileUrl.','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','validation','296QCjbeh','filePath','652689MPNDNi','Unsupported\x20OCR\x20scene:\x20','1282xjFZAr','File\x20upload\x20response\x20missing\x20filePath.','\x20OCR','length','str','image-url','invoice','body','676065AyvmSI','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','imageFile','991712NGQUgi','path','toLowerCase','build','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','/client/queryFileUrl','780318jFEPdn'];a34_0xa135=function(){return _0x1efcec;};return a34_0xa135();}function validateInputSelection(_0x10da91){const _0x12c9b3=a34_0x45ea15,_0x8cd523=selectedInputs(_0x10da91);if(_0x8cd523[_0x12c9b3(0x1b6)]!==0x1)throw CliErrors[_0x12c9b3(0x1d6)](_0x12c9b3(0x1b3));return _0x8cd523;}function withScene(_0xedd107,_0x13ae1c,_0x3f3ec3){const _0xec58e=a34_0x45ea15;return{..._0xedd107,'scene':_0x13ae1c,..._0x3f3ec3?{'sourceFile':{'fileName':_0x3f3ec3[_0xec58e(0x1b9)],'filePath':_0x3f3ec3[_0xec58e(0x1d8)]}}:{}};}const ocrRecognize={'service':'ocr','command':'recognize','description':a34_0x45ea15(0x1b7),'risk':a34_0x45ea15(0x1cc),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x139c1e){const _0x63f8ca=a34_0x45ea15,_0x1d7998=normalizeScene(_0x139c1e[_0x63f8ca(0x1a8)](_0x63f8ca(0x1bf))),_0x1d39f4=SCENE_TO_LEGACY_TYPE[_0x1d7998],_0x59918f=validateInputSelection(_0x139c1e);if(_0x59918f[_0x63f8ca(0x1c8)])return dryRun(_0x63f8ca(0x1c1),_0x63f8ca(0x1cf))[_0x63f8ca(0x1ab)]({'appCode':_0x139c1e[_0x63f8ca(0x1bb)],'url':_0x59918f[_0x63f8ca(0x1c8)],'type':_0x1d39f4})[_0x63f8ca(0x1c9)](_0x63f8ca(0x1d0)+_0x1d7998+'\x20OCR\x20from\x20URL')[_0x63f8ca(0x1b2)]();const _0x2cc992=requireRuntimeUploadFile(_0x59918f['imageFile'],_0x63f8ca(0x1ca));return dryRun(_0x63f8ca(0x1c1),'/client/uploadFile')['body']({'steps':[{'method':'POST','url':_0x63f8ca(0x1c6),'body':{'appCode':_0x139c1e['appCode'],'multipart':{'file':_0x2cc992}}},{'method':_0x63f8ca(0x1c1),'url':_0x63f8ca(0x1b4),'body':{'filePath':_0x63f8ca(0x1ce),'downloadFlag':![]}},{'method':_0x63f8ca(0x1c1),'url':_0x63f8ca(0x1cf),'body':{'appCode':_0x139c1e['appCode'],'url':_0x63f8ca(0x1ad),'type':_0x1d39f4}}]})[_0x63f8ca(0x1c9)](_0x63f8ca(0x1d4)+_0x1d7998+_0x63f8ca(0x1a6))[_0x63f8ca(0x1b2)]();},async 'execute'(_0x365673){const _0x3026aa=a34_0x45ea15,_0x6e217f=normalizeScene(_0x365673[_0x3026aa(0x1a8)](_0x3026aa(0x1bf))),_0x462ac7=SCENE_TO_LEGACY_TYPE[_0x6e217f],_0x2f759a=validateInputSelection(_0x365673);if(_0x2f759a[_0x3026aa(0x1c8)]){const _0x46af96=await recognizeRuntimeOcr(_0x365673[_0x3026aa(0x1bb)],{'url':_0x2f759a[_0x3026aa(0x1c8)],'type':_0x462ac7});return{'ok':!![],'data':withScene(_0x46af96,_0x6e217f)};}const _0x1df7ba=requireRuntimeUploadFile(_0x2f759a[_0x3026aa(0x1ae)],_0x3026aa(0x1ca)),_0x488ee7=await uploadRuntimeFile(_0x365673[_0x3026aa(0x1bb)],_0x1df7ba[_0x3026aa(0x1b0)]);if(!_0x488ee7[_0x3026aa(0x1d8)])throw CliErrors[_0x3026aa(0x1ba)](_0x3026aa(0x1a5));const _0x498249=await queryRuntimeFileUrl(_0x488ee7['filePath'],{'download':![]});if(!_0x498249[_0x3026aa(0x1c4)])throw CliErrors[_0x3026aa(0x1ba)](_0x3026aa(0x1d3));const _0x2d43ec=await recognizeRuntimeOcr(_0x365673[_0x3026aa(0x1bb)],{'url':_0x498249['fileUrl'],'type':_0x462ac7});return{'ok':!![],'data':withScene(_0x2d43ec,_0x6e217f,_0x488ee7)};}};export const ocrDefinitions=[ocrRecognize];
1
+ function a34_0x1e1c(_0x28d006,_0x327957){_0x28d006=_0x28d006-0x15f;const _0x8e24b4=a34_0x8e24();let _0x1e1cac=_0x8e24b4[_0x28d006];return _0x1e1cac;}const a34_0x562b82=a34_0x1e1c;(function(_0x2e048a,_0x230bff){const _0x4c74fc=a34_0x1e1c,_0x204f4a=_0x2e048a();while(!![]){try{const _0x1840f3=parseInt(_0x4c74fc(0x194))/0x1+parseInt(_0x4c74fc(0x15f))/0x2*(parseInt(_0x4c74fc(0x18e))/0x3)+parseInt(_0x4c74fc(0x171))/0x4*(-parseInt(_0x4c74fc(0x175))/0x5)+parseInt(_0x4c74fc(0x179))/0x6+-parseInt(_0x4c74fc(0x16a))/0x7+-parseInt(_0x4c74fc(0x16f))/0x8+parseInt(_0x4c74fc(0x180))/0x9;if(_0x1840f3===_0x230bff)break;else _0x204f4a['push'](_0x204f4a['shift']());}catch(_0x5ada89){_0x204f4a['push'](_0x204f4a['shift']());}}}(a34_0x8e24,0xc6355));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x562b82(0x163),'general','form',a34_0x562b82(0x17a)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x562b82(0x17d),'general':'General','form':a34_0x562b82(0x16b),'idCard':a34_0x562b82(0x177)},SCENE_FLAG={'name':a34_0x562b82(0x166),'type':a34_0x562b82(0x167),'required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':a34_0x562b82(0x16d),'type':a34_0x562b82(0x167),'description':a34_0x562b82(0x193)},IMAGE_URL_FLAG={'name':a34_0x562b82(0x16c),'type':'string','description':a34_0x562b82(0x174)};function normalizeScene(_0x3970b9){const _0x11823f=a34_0x562b82,_0x89fb0c=_0x3970b9[_0x11823f(0x185)]()[_0x11823f(0x188)]();if(_0x89fb0c===_0x11823f(0x164))return _0x11823f(0x17a);if(_0x89fb0c==='invoice'||_0x89fb0c==='general'||_0x89fb0c===_0x11823f(0x17b))return _0x89fb0c;throw CliErrors[_0x11823f(0x168)](_0x11823f(0x173)+_0x3970b9+_0x11823f(0x184)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x9bbf7a){const _0xf9c889=a34_0x562b82,_0x4c5c5d=_0x9bbf7a['str'](_0xf9c889(0x16d))[_0xf9c889(0x185)](),_0x487ed6=_0x9bbf7a[_0xf9c889(0x170)]('image-url')[_0xf9c889(0x185)]();return{'imageFile':_0x4c5c5d,'imageUrl':_0x487ed6,'count':[_0x4c5c5d,_0x487ed6][_0xf9c889(0x17c)](Boolean)['length']};}function validateInputSelection(_0x5c2cba){const _0x145152=a34_0x562b82,_0x4bc18e=selectedInputs(_0x5c2cba);if(_0x4bc18e[_0x145152(0x176)]!==0x1)throw CliErrors['validation'](_0x145152(0x191));return _0x4bc18e;}function withScene(_0x5b2be3,_0x5bf6d7,_0x1a0a8f){const _0x2584aa=a34_0x562b82;return{..._0x5b2be3,'scene':_0x5bf6d7,..._0x1a0a8f?{'sourceFile':{'fileName':_0x1a0a8f[_0x2584aa(0x189)],'filePath':_0x1a0a8f[_0x2584aa(0x18d)]}}:{}};}const ocrRecognize={'service':'ocr','command':'recognize','description':a34_0x562b82(0x16e),'risk':a34_0x562b82(0x17e),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0xe0f12e){const _0x14f4ce=a34_0x562b82,_0x1e6a77=normalizeScene(_0xe0f12e['str'](_0x14f4ce(0x166))),_0x29b3ad=SCENE_TO_LEGACY_TYPE[_0x1e6a77],_0x3e8807=validateInputSelection(_0xe0f12e);if(_0x3e8807[_0x14f4ce(0x17f)])return dryRun(_0x14f4ce(0x161),'/client/ocr')[_0x14f4ce(0x160)]({'appCode':_0xe0f12e[_0x14f4ce(0x192)],'url':_0x3e8807[_0x14f4ce(0x17f)],'type':_0x29b3ad})[_0x14f4ce(0x181)](_0x14f4ce(0x18f)+_0x1e6a77+_0x14f4ce(0x190))[_0x14f4ce(0x195)]();const _0x5945cd=requireRuntimeUploadFile(_0x3e8807[_0x14f4ce(0x183)],_0x14f4ce(0x16d));return dryRun(_0x14f4ce(0x161),_0x14f4ce(0x18b))[_0x14f4ce(0x160)]({'steps':[{'method':_0x14f4ce(0x161),'url':_0x14f4ce(0x18b),'body':{'appCode':_0xe0f12e['appCode'],'multipart':{'file':_0x5945cd}}},{'method':_0x14f4ce(0x161),'url':'/client/queryFileUrl','body':{'filePath':_0x14f4ce(0x169),'downloadFlag':![]}},{'method':'POST','url':_0x14f4ce(0x172),'body':{'appCode':_0xe0f12e['appCode'],'url':_0x14f4ce(0x165),'type':_0x29b3ad}}]})[_0x14f4ce(0x181)](_0x14f4ce(0x162)+_0x1e6a77+_0x14f4ce(0x18a))[_0x14f4ce(0x195)]();},async 'execute'(_0x53c60e){const _0x44fd7b=a34_0x562b82,_0x5dd2b6=normalizeScene(_0x53c60e['str'](_0x44fd7b(0x166))),_0x522e63=SCENE_TO_LEGACY_TYPE[_0x5dd2b6],_0x3d11f3=validateInputSelection(_0x53c60e);if(_0x3d11f3[_0x44fd7b(0x17f)]){const _0x58150d=await recognizeRuntimeOcr(_0x53c60e['appCode'],{'url':_0x3d11f3[_0x44fd7b(0x17f)],'type':_0x522e63});return{'ok':!![],'data':withScene(_0x58150d,_0x5dd2b6)};}const _0x534d6f=requireRuntimeUploadFile(_0x3d11f3['imageFile'],_0x44fd7b(0x16d)),_0x2aa676=await uploadRuntimeFile(_0x53c60e[_0x44fd7b(0x192)],_0x534d6f[_0x44fd7b(0x178)]);if(!_0x2aa676[_0x44fd7b(0x18d)])throw CliErrors[_0x44fd7b(0x18c)](_0x44fd7b(0x186));const _0x5bfb0b=await queryRuntimeFileUrl(_0x2aa676[_0x44fd7b(0x18d)],{'download':![]});if(!_0x5bfb0b[_0x44fd7b(0x187)])throw CliErrors[_0x44fd7b(0x18c)](_0x44fd7b(0x182));const _0x1f8f99=await recognizeRuntimeOcr(_0x53c60e[_0x44fd7b(0x192)],{'url':_0x5bfb0b[_0x44fd7b(0x187)],'type':_0x522e63});return{'ok':!![],'data':withScene(_0x1f8f99,_0x5dd2b6,_0x2aa676)};}};export const ocrDefinitions=[ocrRecognize];function a34_0x8e24(){const _0xf5dddd=['Table','image-url','image-file','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','11190880Ggahgr','str','4LZmnwy','/client/ocr','Unsupported\x20OCR\x20scene:\x20','Publicly\x20accessible\x20image\x20or\x20file\x20URL','1703715GleMzN','count','IdCard','path','772512LRLcQK','idCard','form','filter','Invoice','write','imageUrl','19259748oZKevl','description','File\x20URL\x20response\x20missing\x20fileUrl.','imageFile','.\x20Supported\x20scenes:\x20','trim','File\x20upload\x20response\x20missing\x20filePath.','fileUrl','toLowerCase','fileName','\x20OCR','/client/uploadFile','apiError','filePath','3wbFRVS','Preview:\x20recognize\x20','\x20OCR\x20from\x20URL','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','appCode','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','516308EhrHyy','build','1640598uwHEcU','body','POST','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','invoice','idcard','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','scene','string','validation','<filePath\x20returned\x20by\x20/client/uploadFile>','7377069RyEMRM'];a34_0x8e24=function(){return _0xf5dddd;};return a34_0x8e24();}
@@ -1 +1 @@
1
- const a35_0x177ccc=a35_0x111a;(function(_0x2e50d0,_0x23bf25){const _0x44db0=a35_0x111a,_0x37d751=_0x2e50d0();while(!![]){try{const _0x3c624d=parseInt(_0x44db0(0xb2))/0x1+-parseInt(_0x44db0(0xce))/0x2*(-parseInt(_0x44db0(0xbf))/0x3)+parseInt(_0x44db0(0xd6))/0x4*(parseInt(_0x44db0(0xc8))/0x5)+parseInt(_0x44db0(0xa0))/0x6+parseInt(_0x44db0(0xa6))/0x7+parseInt(_0x44db0(0xdb))/0x8*(parseInt(_0x44db0(0xb6))/0x9)+parseInt(_0x44db0(0xcd))/0xa*(-parseInt(_0x44db0(0xcf))/0xb);if(_0x3c624d===_0x23bf25)break;else _0x37d751['push'](_0x37d751['shift']());}catch(_0x541220){_0x37d751['push'](_0x37d751['shift']());}}}(a35_0x550a,0xbd57c));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x177ccc(0xc3),'type':'string','description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0x177ccc(0xd2),'type':a35_0x177ccc(0xe2),'required':!![],'description':a35_0x177ccc(0xae)},DESCRIPTION_FLAG={'name':'description','type':a35_0x177ccc(0xe2),'description':a35_0x177ccc(0xa9)},SOURCE_SESSION_FLAG={'name':a35_0x177ccc(0xaf),'type':a35_0x177ccc(0xe2),'description':a35_0x177ccc(0xc0)};function normalizeFunctionName(_0x585576){const _0x500b40=a35_0x177ccc,_0x499b3d=String(_0x585576||'')[_0x500b40(0xa3)]();if(!_0x499b3d||!FUNCTION_NAME_PATTERN[_0x500b40(0xaa)](_0x499b3d))throw CliErrors['validation'](_0x500b40(0xc5));return _0x499b3d;}function readScriptFile(_0x3efed4){const _0x33558b=a35_0x177ccc;if(!_0x3efed4)throw CliErrors[_0x33558b(0xc9)]('File\x20path\x20is\x20required.');if(!existsSync(_0x3efed4))throw CliErrors['validation'](_0x33558b(0xba)+_0x3efed4);if(!statSync(_0x3efed4)[_0x33558b(0xd9)]())throw CliErrors[_0x33558b(0xc9)](_0x33558b(0xc2)+_0x3efed4);const _0x597028=readFileSync(_0x3efed4,_0x33558b(0xb3));if(!_0x597028[_0x33558b(0xa3)]())throw CliErrors[_0x33558b(0xc9)](_0x33558b(0xd1));return _0x597028;}function optionalTrimmed(_0x427be8){const _0x3662aa=String(_0x427be8||'')['trim']();return _0x3662aa||undefined;}function summarizeBff(_0x5327bc){const _0x5041aa=a35_0x177ccc;return{'id':_0x5327bc['id'],'appCode':_0x5327bc['appCode'],'functionName':_0x5327bc[_0x5041aa(0xe1)],'description':_0x5327bc[_0x5041aa(0xca)],'scriptType':_0x5327bc[_0x5041aa(0xb5)],'version':_0x5327bc['version'],'gmtModified':_0x5327bc[_0x5041aa(0xc7)],'updateTime':_0x5327bc[_0x5041aa(0xd4)]};}function detailBff(_0x715276){const _0x58beb2=a35_0x177ccc;return{'id':_0x715276['id'],'appCode':_0x715276[_0x58beb2(0xc6)],'functionName':_0x715276[_0x58beb2(0xe1)],'description':_0x715276[_0x58beb2(0xca)],'scriptType':_0x715276[_0x58beb2(0xb5)],'scriptContent':_0x715276['scriptContent']??'','config':_0x715276['config'],'version':_0x715276[_0x58beb2(0xe0)],'createUserId':_0x715276[_0x58beb2(0xc1)],'gmtCreate':_0x715276[_0x58beb2(0xac)],'gmtModified':_0x715276[_0x58beb2(0xc7)],'createTime':_0x715276[_0x58beb2(0xa4)],'updateTime':_0x715276['updateTime']};}function a35_0x550a(){const _0x364510=['personal-bff','Updated\x20personal\x20BFF\x20','Personal\x20BFF\x20description','test','num','gmtCreate','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','source-session-id','Personal\x20BFF\x20script\x20ID','high-risk-write','59832ANbgrt','utf8','Preview:\x20update\x20personal\x20BFF\x20','scriptType','141399gqmInS','write','create','POST','File\x20not\x20found:\x20','length','detail','Executed\x20personal\x20BFF\x20','flag','3rfbNUK','Optional\x20source\x20RuntimeAgent\x20session\x20id','createUserId','File\x20is\x20not\x20a\x20regular\x20file:\x20','file','str','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','appCode','gmtModified','2197355bovUha','validation','description','bool','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','1038290hgRGRY','765868JaDeyc','451FSIQky','sourceSessionId','Personal\x20BFF\x20script\x20file\x20is\x20blank.','name','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','updateTime','Created\x20personal\x20BFF\x20','12iVYfaM','/client/runtime-bff/personal/create','exec','isFile','scriptContent','648APczcT','/client/runtime-bff/personal/','params','list','body','version','functionName','string','read','4987164zuqVUY','/update','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','trim','createTime','build','8173011wlVKeU'];a35_0x550a=function(){return _0x364510;};return a35_0x550a();}function buildCreateInput(_0x1791f5){const _0x52fc74=a35_0x177ccc;return{'functionName':normalizeFunctionName(_0x1791f5[_0x52fc74(0xc4)](_0x52fc74(0xd2))),...optionalTrimmed(_0x1791f5[_0x52fc74(0xc4)]('description'))?{'description':optionalTrimmed(_0x1791f5['str']('description'))}:{},'scriptContent':readScriptFile(_0x1791f5[_0x52fc74(0xc4)](_0x52fc74(0xc3))),...optionalTrimmed(_0x1791f5['str']('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x1791f5[_0x52fc74(0xc4)]('source-session-id'))}:{}};}function buildUpdateInput(_0x249174){const _0x37ae75=a35_0x177ccc,_0x252dfe={};optionalTrimmed(_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xd2)))&&(_0x252dfe['functionName']=normalizeFunctionName(_0x249174['str'](_0x37ae75(0xd2))));_0x249174[_0x37ae75(0xbe)](_0x37ae75(0xca))!==undefined&&(_0x252dfe['description']=_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xca)));optionalTrimmed(_0x249174['str'](_0x37ae75(0xc3)))&&(_0x252dfe[_0x37ae75(0xda)]=readScriptFile(_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xc3))));_0x249174[_0x37ae75(0xbe)](_0x37ae75(0xaf))!==undefined&&(_0x252dfe[_0x37ae75(0xd0)]=_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xaf)));if(Object['keys'](_0x252dfe)[_0x37ae75(0xbb)]===0x0)throw CliErrors['validation'](_0x37ae75(0xcc));return _0x252dfe;}function a35_0x111a(_0xf80546,_0x1bb01a){_0xf80546=_0xf80546-0xa0;const _0x550a00=a35_0x550a();let _0x111acd=_0x550a00[_0xf80546];return _0x111acd;}function parseExecParams(_0x2b1097){const _0x231eb1=a35_0x177ccc,_0x5be810=parseJsonParams(_0x2b1097)??{};if(Array['isArray'](_0x5be810))throw CliErrors[_0x231eb1(0xc9)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x5be810;}const personalBffList={'service':a35_0x177ccc(0xa7),'command':a35_0x177ccc(0xde),'description':a35_0x177ccc(0xa2),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x1a2020){const _0xb536e1=a35_0x177ccc,_0x4acf85=await listPersonalBffs(_0x1a2020[_0xb536e1(0xc6)]);return{'ok':!![],'data':{'total':_0x4acf85[_0xb536e1(0xbb)],'items':_0x1a2020[_0xb536e1(0xcb)]('verbose')?_0x4acf85:_0x4acf85['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x177ccc(0xa7),'command':a35_0x177ccc(0xbc),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':a35_0x177ccc(0xe3),'flags':[{...ID_FLAG,'description':a35_0x177ccc(0xb0)}],async 'execute'(_0x14fed1){const _0x5db39e=a35_0x177ccc,_0xfbaddc=await getPersonalBff(_0x14fed1[_0x5db39e(0xab)]('id'),_0x14fed1['appCode']);return{'ok':!![],'data':detailBff(_0xfbaddc)};}},personalBffCreate={'service':'personal-bff','command':a35_0x177ccc(0xb8),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a35_0x177ccc(0xb7),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3a954c){const _0x704daf=a35_0x177ccc,_0xd941a1=buildCreateInput(_0x3a954c),_0x41a1ba=await createPersonalBff(_0x3a954c['appCode'],_0xd941a1);return{'ok':!![],'data':detailBff(_0x41a1ba),'message':_0x704daf(0xd5)+_0x41a1ba['id']+(_0x41a1ba['functionName']?'\x20('+_0x41a1ba['functionName']+')':'')};},async 'dryRun'(_0x308f39){const _0x399d9e=a35_0x177ccc,_0x311ff4=buildCreateInput(_0x308f39);return dryRun('POST',_0x399d9e(0xd7))[_0x399d9e(0xdf)]({'appCode':_0x308f39[_0x399d9e(0xc6)],..._0x311ff4})[_0x399d9e(0xca)]('Preview:\x20create\x20personal\x20BFF\x20'+_0x311ff4['functionName'])[_0x399d9e(0xa5)]();}},personalBffUpdate={'service':a35_0x177ccc(0xa7),'command':'update','description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':'write','flags':[{...ID_FLAG,'description':a35_0x177ccc(0xb0)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3c5cf4){const _0x435e8b=a35_0x177ccc,_0x1bfef6=_0x3c5cf4[_0x435e8b(0xab)]('id'),_0x1f8f71=buildUpdateInput(_0x3c5cf4),_0x387a50=await updatePersonalBff(_0x1bfef6,_0x3c5cf4[_0x435e8b(0xc6)],_0x1f8f71);return{'ok':!![],'data':detailBff(_0x387a50),'message':_0x435e8b(0xa8)+_0x387a50['id']+(_0x387a50['functionName']?'\x20('+_0x387a50[_0x435e8b(0xe1)]+')':'')};},async 'dryRun'(_0x3b4e75){const _0x119b8d=a35_0x177ccc,_0xb681a4=_0x3b4e75[_0x119b8d(0xab)]('id'),_0x402efe=buildUpdateInput(_0x3b4e75);return dryRun(_0x119b8d(0xb9),_0x119b8d(0xdc)+_0xb681a4+_0x119b8d(0xa1))[_0x119b8d(0xdf)]({'appCode':_0x3b4e75[_0x119b8d(0xc6)],..._0x402efe})['description'](_0x119b8d(0xb4)+_0xb681a4)['build']();}},personalBffExec={'service':a35_0x177ccc(0xa7),'command':a35_0x177ccc(0xd8),'description':a35_0x177ccc(0xd3),'risk':a35_0x177ccc(0xb1),'flags':[{...ID_FLAG,'description':a35_0x177ccc(0xb0)},{...PARAMS_FLAG,'description':a35_0x177ccc(0xad)}],async 'validate'(_0x585089){const _0x290c98=a35_0x177ccc;parseExecParams(_0x585089['str'](_0x290c98(0xdd)));},async 'execute'(_0x4d6984){const _0xf513b7=a35_0x177ccc,_0x1fd392=_0x4d6984['num']('id'),_0x407038=parseExecParams(_0x4d6984[_0xf513b7(0xc4)]('params')),_0x5e24b1=await executePersonalBff(_0x1fd392,_0x4d6984[_0xf513b7(0xc6)],_0x407038);return{'ok':!![],'data':{'result':_0x5e24b1},'message':_0xf513b7(0xbd)+_0x1fd392};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a35_0x1ae6f7=a35_0x572d;(function(_0x1a0d1e,_0x12092f){const _0x4a2d39=a35_0x572d,_0x573dce=_0x1a0d1e();while(!![]){try{const _0x213eeb=parseInt(_0x4a2d39(0x157))/0x1*(parseInt(_0x4a2d39(0x130))/0x2)+-parseInt(_0x4a2d39(0x120))/0x3*(-parseInt(_0x4a2d39(0x15d))/0x4)+parseInt(_0x4a2d39(0x11d))/0x5*(-parseInt(_0x4a2d39(0x135))/0x6)+-parseInt(_0x4a2d39(0x15b))/0x7*(parseInt(_0x4a2d39(0x11c))/0x8)+-parseInt(_0x4a2d39(0x154))/0x9+parseInt(_0x4a2d39(0x147))/0xa+-parseInt(_0x4a2d39(0x153))/0xb*(-parseInt(_0x4a2d39(0x14f))/0xc);if(_0x213eeb===_0x12092f)break;else _0x573dce['push'](_0x573dce['shift']());}catch(_0x3a7c65){_0x573dce['push'](_0x573dce['shift']());}}}(a35_0x3ae4,0x75cf2));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x1ae6f7(0x158),'type':a35_0x1ae6f7(0x121),'description':a35_0x1ae6f7(0x132)},FUNCTION_NAME_FLAG={'name':'name','type':a35_0x1ae6f7(0x121),'required':!![],'description':'Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders'},DESCRIPTION_FLAG={'name':a35_0x1ae6f7(0x152),'type':a35_0x1ae6f7(0x121),'description':a35_0x1ae6f7(0x15c)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':'string','description':a35_0x1ae6f7(0x15e)};function a35_0x3ae4(){const _0x2a1b4e=['high-risk-write','verbose','update','params','keys','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','Show\x20one\x20personal\x20BFF\x20by\x20id','create','Update\x20a\x20personal\x20BFF\x20by\x20id','exec','Preview:\x20create\x20personal\x20BFF\x20','/client/runtime-bff/personal/','write','config','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','8429720WeQRAn','validation','num','appCode','personal-bff','name','test','scriptContent','443604qXPPto','createUserId','updateTime','description','33uuecPa','6651648RxlDXw','body','source-session-id','731447FXFPBw','file','bool','File\x20is\x20not\x20a\x20regular\x20file:\x20','1114680uItJrU','Personal\x20BFF\x20description','435868lhtaLM','Optional\x20source\x20RuntimeAgent\x20session\x20id','isArray','File\x20path\x20is\x20required.','8wWlVrS','18325YIXciW','str','gmtModified','12CfNEMN','string','build','functionName','map','version','Personal\x20BFF\x20script\x20file\x20is\x20blank.','createTime','gmtCreate','--params\x20must\x20be\x20a\x20JSON\x20object.','flag','trim','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','list','Personal\x20BFF\x20script\x20ID','POST','2JlvBib','length','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','read','detail','1212jokrjF','isFile','scriptType'];a35_0x3ae4=function(){return _0x2a1b4e;};return a35_0x3ae4();}function normalizeFunctionName(_0x8efc07){const _0x43e379=a35_0x1ae6f7,_0x434aea=String(_0x8efc07||'')['trim']();if(!_0x434aea||!FUNCTION_NAME_PATTERN[_0x43e379(0x14d)](_0x434aea))throw CliErrors['validation'](_0x43e379(0x146));return _0x434aea;}function readScriptFile(_0xa9de35){const _0x3cb29e=a35_0x1ae6f7;if(!_0xa9de35)throw CliErrors[_0x3cb29e(0x148)](_0x3cb29e(0x11b));if(!existsSync(_0xa9de35))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0xa9de35);if(!statSync(_0xa9de35)[_0x3cb29e(0x136)]())throw CliErrors[_0x3cb29e(0x148)](_0x3cb29e(0x15a)+_0xa9de35);const _0x4394bd=readFileSync(_0xa9de35,'utf8');if(!_0x4394bd[_0x3cb29e(0x12b)]())throw CliErrors[_0x3cb29e(0x148)](_0x3cb29e(0x126));return _0x4394bd;}function optionalTrimmed(_0x2f05bc){const _0x2fff8b=a35_0x1ae6f7,_0x1284eb=String(_0x2f05bc||'')[_0x2fff8b(0x12b)]();return _0x1284eb||undefined;}function summarizeBff(_0x1d4518){const _0x84a336=a35_0x1ae6f7;return{'id':_0x1d4518['id'],'appCode':_0x1d4518[_0x84a336(0x14a)],'functionName':_0x1d4518['functionName'],'description':_0x1d4518['description'],'scriptType':_0x1d4518[_0x84a336(0x137)],'version':_0x1d4518[_0x84a336(0x125)],'gmtModified':_0x1d4518[_0x84a336(0x11f)],'updateTime':_0x1d4518[_0x84a336(0x151)]};}function a35_0x572d(_0x1863a3,_0x2c0562){_0x1863a3=_0x1863a3-0x11b;const _0x3ae4f0=a35_0x3ae4();let _0x572d31=_0x3ae4f0[_0x1863a3];return _0x572d31;}function detailBff(_0x15a68d){const _0x5cf459=a35_0x1ae6f7;return{'id':_0x15a68d['id'],'appCode':_0x15a68d[_0x5cf459(0x14a)],'functionName':_0x15a68d[_0x5cf459(0x123)],'description':_0x15a68d['description'],'scriptType':_0x15a68d[_0x5cf459(0x137)],'scriptContent':_0x15a68d[_0x5cf459(0x14e)]??'','config':_0x15a68d[_0x5cf459(0x145)],'version':_0x15a68d[_0x5cf459(0x125)],'createUserId':_0x15a68d[_0x5cf459(0x150)],'gmtCreate':_0x15a68d[_0x5cf459(0x128)],'gmtModified':_0x15a68d['gmtModified'],'createTime':_0x15a68d[_0x5cf459(0x127)],'updateTime':_0x15a68d[_0x5cf459(0x151)]};}function buildCreateInput(_0x2d29ee){const _0x3f5181=a35_0x1ae6f7;return{'functionName':normalizeFunctionName(_0x2d29ee[_0x3f5181(0x11e)]('name')),...optionalTrimmed(_0x2d29ee['str'](_0x3f5181(0x152)))?{'description':optionalTrimmed(_0x2d29ee[_0x3f5181(0x11e)](_0x3f5181(0x152)))}:{},'scriptContent':readScriptFile(_0x2d29ee['str'](_0x3f5181(0x158))),...optionalTrimmed(_0x2d29ee[_0x3f5181(0x11e)](_0x3f5181(0x156)))?{'sourceSessionId':optionalTrimmed(_0x2d29ee[_0x3f5181(0x11e)](_0x3f5181(0x156)))}:{}};}function buildUpdateInput(_0x4d21dc){const _0x43d65c=a35_0x1ae6f7,_0x186f8f={};optionalTrimmed(_0x4d21dc[_0x43d65c(0x11e)](_0x43d65c(0x14c)))&&(_0x186f8f[_0x43d65c(0x123)]=normalizeFunctionName(_0x4d21dc[_0x43d65c(0x11e)](_0x43d65c(0x14c))));_0x4d21dc['flag'](_0x43d65c(0x152))!==undefined&&(_0x186f8f['description']=_0x4d21dc[_0x43d65c(0x11e)](_0x43d65c(0x152)));optionalTrimmed(_0x4d21dc['str']('file'))&&(_0x186f8f[_0x43d65c(0x14e)]=readScriptFile(_0x4d21dc[_0x43d65c(0x11e)](_0x43d65c(0x158))));_0x4d21dc[_0x43d65c(0x12a)](_0x43d65c(0x156))!==undefined&&(_0x186f8f['sourceSessionId']=_0x4d21dc[_0x43d65c(0x11e)](_0x43d65c(0x156)));if(Object[_0x43d65c(0x13c)](_0x186f8f)['length']===0x0)throw CliErrors[_0x43d65c(0x148)]('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x186f8f;}function parseExecParams(_0x1d5806){const _0x474678=a35_0x1ae6f7,_0x2a6a30=parseJsonParams(_0x1d5806)??{};if(Array[_0x474678(0x15f)](_0x2a6a30))throw CliErrors['validation'](_0x474678(0x129));return _0x2a6a30;}const personalBffList={'service':a35_0x1ae6f7(0x14b),'command':a35_0x1ae6f7(0x12d),'description':a35_0x1ae6f7(0x12c),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x115aed){const _0xbc93e=a35_0x1ae6f7,_0x2dcbba=await listPersonalBffs(_0x115aed['appCode']);return{'ok':!![],'data':{'total':_0x2dcbba[_0xbc93e(0x131)],'items':_0x115aed[_0xbc93e(0x159)](_0xbc93e(0x139))?_0x2dcbba:_0x2dcbba[_0xbc93e(0x124)](summarizeBff)}};}},personalBffDetail={'service':a35_0x1ae6f7(0x14b),'command':a35_0x1ae6f7(0x134),'description':a35_0x1ae6f7(0x13e),'risk':a35_0x1ae6f7(0x133),'flags':[{...ID_FLAG,'description':a35_0x1ae6f7(0x12e)}],async 'execute'(_0x9795a5){const _0x4e6a2f=a35_0x1ae6f7,_0x17b0e7=await getPersonalBff(_0x9795a5[_0x4e6a2f(0x149)]('id'),_0x9795a5[_0x4e6a2f(0x14a)]);return{'ok':!![],'data':detailBff(_0x17b0e7)};}},personalBffCreate={'service':a35_0x1ae6f7(0x14b),'command':a35_0x1ae6f7(0x13f),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a35_0x1ae6f7(0x144),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x104092){const _0x168944=a35_0x1ae6f7,_0x130f21=buildCreateInput(_0x104092),_0xf9d81b=await createPersonalBff(_0x104092[_0x168944(0x14a)],_0x130f21);return{'ok':!![],'data':detailBff(_0xf9d81b),'message':'Created\x20personal\x20BFF\x20'+_0xf9d81b['id']+(_0xf9d81b[_0x168944(0x123)]?'\x20('+_0xf9d81b[_0x168944(0x123)]+')':'')};},async 'dryRun'(_0x175dd1){const _0x542a6c=a35_0x1ae6f7,_0x2df33d=buildCreateInput(_0x175dd1);return dryRun(_0x542a6c(0x12f),'/client/runtime-bff/personal/create')['body']({'appCode':_0x175dd1[_0x542a6c(0x14a)],..._0x2df33d})[_0x542a6c(0x152)](_0x542a6c(0x142)+_0x2df33d[_0x542a6c(0x123)])[_0x542a6c(0x122)]();}},personalBffUpdate={'service':a35_0x1ae6f7(0x14b),'command':a35_0x1ae6f7(0x13a),'description':a35_0x1ae6f7(0x140),'risk':a35_0x1ae6f7(0x144),'flags':[{...ID_FLAG,'description':a35_0x1ae6f7(0x12e)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x16d7cc){const _0x142703=a35_0x1ae6f7,_0xe4fda6=_0x16d7cc[_0x142703(0x149)]('id'),_0x5bf826=buildUpdateInput(_0x16d7cc),_0x32b447=await updatePersonalBff(_0xe4fda6,_0x16d7cc[_0x142703(0x14a)],_0x5bf826);return{'ok':!![],'data':detailBff(_0x32b447),'message':'Updated\x20personal\x20BFF\x20'+_0x32b447['id']+(_0x32b447[_0x142703(0x123)]?'\x20('+_0x32b447[_0x142703(0x123)]+')':'')};},async 'dryRun'(_0x160d95){const _0x36bc52=a35_0x1ae6f7,_0x51f659=_0x160d95[_0x36bc52(0x149)]('id'),_0x295962=buildUpdateInput(_0x160d95);return dryRun(_0x36bc52(0x12f),_0x36bc52(0x143)+_0x51f659+'/update')[_0x36bc52(0x155)]({'appCode':_0x160d95[_0x36bc52(0x14a)],..._0x295962})[_0x36bc52(0x152)]('Preview:\x20update\x20personal\x20BFF\x20'+_0x51f659)['build']();}},personalBffExec={'service':a35_0x1ae6f7(0x14b),'command':a35_0x1ae6f7(0x141),'description':a35_0x1ae6f7(0x13d),'risk':a35_0x1ae6f7(0x138),'flags':[{...ID_FLAG,'description':a35_0x1ae6f7(0x12e)},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x5b2034){const _0x3240a8=a35_0x1ae6f7;parseExecParams(_0x5b2034[_0x3240a8(0x11e)](_0x3240a8(0x13b)));},async 'execute'(_0x1cf894){const _0xb2a64=a35_0x1ae6f7,_0x56f40a=_0x1cf894[_0xb2a64(0x149)]('id'),_0x1a8d73=parseExecParams(_0x1cf894[_0xb2a64(0x11e)]('params')),_0x3a08df=await executePersonalBff(_0x56f40a,_0x1cf894['appCode'],_0x1a8d73);return{'ok':!![],'data':{'result':_0x3a08df},'message':'Executed\x20personal\x20BFF\x20'+_0x56f40a};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a36_0x504c5c=a36_0x22eb;(function(_0x98bbcf,_0x309192){const _0x2f8912=a36_0x22eb,_0x32edeb=_0x98bbcf();while(!![]){try{const _0x136037=-parseInt(_0x2f8912(0x171))/0x1+-parseInt(_0x2f8912(0x16e))/0x2*(-parseInt(_0x2f8912(0x165))/0x3)+-parseInt(_0x2f8912(0x161))/0x4+parseInt(_0x2f8912(0x147))/0x5+-parseInt(_0x2f8912(0x153))/0x6+parseInt(_0x2f8912(0x166))/0x7*(parseInt(_0x2f8912(0x16f))/0x8)+parseInt(_0x2f8912(0x16c))/0x9*(parseInt(_0x2f8912(0x15a))/0xa);if(_0x136037===_0x309192)break;else _0x32edeb['push'](_0x32edeb['shift']());}catch(_0x303c9e){_0x32edeb['push'](_0x32edeb['shift']());}}}(a36_0x72ce,0xdffa4));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';function a36_0x22eb(_0x53b39f,_0x4dbb5e){_0x53b39f=_0x53b39f-0x147;const _0x72ce10=a36_0x72ce();let _0x22eb05=_0x72ce10[_0x53b39f];return _0x22eb05;}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 a36_0x72ce(){const _0x32151e=['API\x20Documentation','5819368LiSGFZ','CLI\x20Built-in\x20Skill','install','login','9HQcgak','1152193OBdBue','Logs','run','from','command','File','7298703cijrzR','Self\x20Update','450302DDpaAj','72FoLsrK','BFF\x20Scripts','1173958rFOlUy','map','2691580rzWkZO','service','has','get','OCR','Knowledge\x20Base','Artifacts','list','risk','Schema','Instant\x20API','\x20\x20[write]','4625292ZniVJq','read','Diagnostics','push','write','description','Personal\x20BFF','20MgXrsA','SQL\x20Queries','set','isSingleCommand','App\x20Management','Skills'];a36_0x72ce=function(){return _0x32151e;};return a36_0x72ce();}function registerDefinitions(_0x559035){const _0x86946b=a36_0x22eb;for(const _0x1ac086 of _0x559035){definitions[_0x86946b(0x15c)](_0x1ac086[_0x86946b(0x148)]+':'+_0x1ac086[_0x86946b(0x16a)],_0x1ac086);let _0x36b398=serviceGroups[_0x86946b(0x14a)](_0x1ac086[_0x86946b(0x148)]);!_0x36b398&&(_0x36b398=[],serviceGroups[_0x86946b(0x15c)](_0x1ac086[_0x86946b(0x148)],_0x36b398)),_0x36b398[_0x86946b(0x156)](_0x1ac086);}}function registerService(_0x5497ba,_0x578bc9,_0x15246c){const _0x4a2f26=a36_0x22eb;registerDefinitions(_0x578bc9);const _0x13a442=_0x32f3d8=>_0x32f3d8===_0x4a2f26(0x154)?'':_0x32f3d8===_0x4a2f26(0x157)?_0x4a2f26(0x152):'\x20\x20[high-risk-write]',_0x506442={'service':_0x578bc9[0x0][_0x4a2f26(0x148)],'label':_0x5497ba,'commands':_0x578bc9[_0x4a2f26(0x172)](_0x286d9e=>({'command':_0x286d9e[_0x4a2f26(0x16a)],'description':_0x286d9e[_0x4a2f26(0x158)],'tag':_0x13a442(_0x286d9e[_0x4a2f26(0x14f)])})),'defaultCommand':_0x15246c?.['defaultCommand']??(_0x15246c?.['isSingleCommand']?_0x578bc9[0x0][_0x4a2f26(0x16a)]:undefined),'isSingleCommand':_0x15246c?.[_0x4a2f26(0x15d)]};serviceRegistry[_0x4a2f26(0x156)](_0x506442),serviceByName['set'](_0x506442[_0x4a2f26(0x148)],_0x506442);}registerService('Authentication',authDefinitions,{'defaultCommand':a36_0x504c5c(0x164)}),registerService(a36_0x504c5c(0x15e),appDefinitions,{'defaultCommand':a36_0x504c5c(0x14e)}),registerService('Workspace',workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a36_0x504c5c(0x14e)}),registerService(a36_0x504c5c(0x160),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a36_0x504c5c(0x151),dataDefinitions),registerService(a36_0x504c5c(0x15b),sqlDefinitions),registerService(a36_0x504c5c(0x170),bffDefinitions),registerService(a36_0x504c5c(0x159),personalBffDefinitions),registerService(a36_0x504c5c(0x14d),artifactDefinitions),registerService(a36_0x504c5c(0x16b),fileDefinitions),registerService(a36_0x504c5c(0x14b),ocrDefinitions),registerService(a36_0x504c5c(0x14c),kbDefinitions),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x504c5c(0x14e)}),registerService(a36_0x504c5c(0x15f),skillDefinitions,{'defaultCommand':a36_0x504c5c(0x163)}),registerService(a36_0x504c5c(0x162),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x504c5c(0x16d),[updateDefinition],{'defaultCommand':a36_0x504c5c(0x168),'isSingleCommand':!![]}),registerService(a36_0x504c5c(0x155),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x504c5c(0x150),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x504c5c(0x167),logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0x2525d7,_0xf122c4){const _0x59c0e5=a36_0x504c5c;return definitions[_0x59c0e5(0x14a)](_0x2525d7+':'+_0xf122c4);}export function isKnownService(_0xbd410f){const _0x5898fd=a36_0x504c5c;return serviceByName[_0x5898fd(0x149)](_0xbd410f);}export function getServiceEntry(_0x12e2ee){const _0x3eb8ac=a36_0x504c5c;return serviceByName[_0x3eb8ac(0x14a)](_0x12e2ee);}export function getAllDefinitions(){const _0x453a2c=a36_0x504c5c;return Array[_0x453a2c(0x169)](definitions['values']());}
1
+ const a36_0x5ec5c1=a36_0x2c42;(function(_0x29fb40,_0x125ef1){const _0x23af4e=a36_0x2c42,_0x4f5b32=_0x29fb40();while(!![]){try{const _0x4ccedb=-parseInt(_0x23af4e(0xab))/0x1+-parseInt(_0x23af4e(0xc9))/0x2*(-parseInt(_0x23af4e(0xac))/0x3)+-parseInt(_0x23af4e(0xb7))/0x4*(-parseInt(_0x23af4e(0xa1))/0x5)+-parseInt(_0x23af4e(0xa5))/0x6+parseInt(_0x23af4e(0xa8))/0x7*(-parseInt(_0x23af4e(0xc4))/0x8)+-parseInt(_0x23af4e(0xa0))/0x9+parseInt(_0x23af4e(0xc0))/0xa;if(_0x4ccedb===_0x125ef1)break;else _0x4f5b32['push'](_0x4f5b32['shift']());}catch(_0xed9850){_0x4f5b32['push'](_0x4f5b32['shift']());}}}(a36_0x7655,0xb3847));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';function a36_0x2c42(_0x4779ce,_0x39c9e9){_0x4779ce=_0x4779ce-0xa0;const _0x76559a=a36_0x7655();let _0x2c42d=_0x76559a[_0x4779ce];return _0x2c42d;}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';function a36_0x7655(){const _0x1aa178=['login','\x20\x20[write]','push','Self\x20Update','from','Datasets','188pevCgK','get','Configuration','write','CLI\x20Built-in\x20Skill','Knowledge\x20Base','install','Instant\x20API','set','21431950zFEbio','command','OCR','risk','6352024dhNZov','File','Skills','Service\x20Tree','Workspace','2968oTrbmc','isSingleCommand','9858321pjHdmr','48015hkGvqi','values','API\x20Documentation','Authentication','3479226XfPswb','SQL\x20Queries','Diagnostics','7xojNJE','Runtime\x20App\x20Config','list','246258uQqAjh','1731HMfROI','Logs','App\x20Management','service','BFF\x20Scripts'];a36_0x7655=function(){return _0x1aa178;};return a36_0x7655();}export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x440ac6){const _0xd52530=a36_0x2c42;for(const _0x44cf34 of _0x440ac6){definitions[_0xd52530(0xbf)](_0x44cf34[_0xd52530(0xaf)]+':'+_0x44cf34[_0xd52530(0xc1)],_0x44cf34);let _0xdb39c=serviceGroups['get'](_0x44cf34[_0xd52530(0xaf)]);!_0xdb39c&&(_0xdb39c=[],serviceGroups[_0xd52530(0xbf)](_0x44cf34['service'],_0xdb39c)),_0xdb39c[_0xd52530(0xb3)](_0x44cf34);}}function registerService(_0x3bb80c,_0x5e6ad1,_0x107a74){const _0x4bae34=a36_0x2c42;registerDefinitions(_0x5e6ad1);const _0x3d3275=_0x4066c6=>_0x4066c6==='read'?'':_0x4066c6===_0x4bae34(0xba)?_0x4bae34(0xb2):'\x20\x20[high-risk-write]',_0x53be44={'service':_0x5e6ad1[0x0][_0x4bae34(0xaf)],'label':_0x3bb80c,'commands':_0x5e6ad1['map'](_0x4cc2ce=>({'command':_0x4cc2ce[_0x4bae34(0xc1)],'description':_0x4cc2ce['description'],'tag':_0x3d3275(_0x4cc2ce[_0x4bae34(0xc3)])})),'defaultCommand':_0x107a74?.['defaultCommand']??(_0x107a74?.['isSingleCommand']?_0x5e6ad1[0x0][_0x4bae34(0xc1)]:undefined),'isSingleCommand':_0x107a74?.[_0x4bae34(0xca)]};serviceRegistry[_0x4bae34(0xb3)](_0x53be44),serviceByName['set'](_0x53be44[_0x4bae34(0xaf)],_0x53be44);}registerService(a36_0x5ec5c1(0xa4),authDefinitions,{'defaultCommand':a36_0x5ec5c1(0xb1)}),registerService(a36_0x5ec5c1(0xae),appDefinitions,{'defaultCommand':'list'}),registerService(a36_0x5ec5c1(0xc8),workspaceDefinitions),registerService(a36_0x5ec5c1(0xa9),appConfigDefinitions),registerService(a36_0x5ec5c1(0xb9),configDefinitions,{'defaultCommand':a36_0x5ec5c1(0xaa)}),registerService(a36_0x5ec5c1(0xa3),apiDocDefinitions),registerService(a36_0x5ec5c1(0xb6),datasetDefinitions),registerService(a36_0x5ec5c1(0xbe),dataDefinitions),registerService(a36_0x5ec5c1(0xa6),sqlDefinitions),registerService(a36_0x5ec5c1(0xb0),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x5ec5c1(0xc5),fileDefinitions),registerService(a36_0x5ec5c1(0xc2),ocrDefinitions),registerService(a36_0x5ec5c1(0xbc),kbDefinitions),registerService(a36_0x5ec5c1(0xc7),serviceDefinitions,{'defaultCommand':'list'}),registerService(a36_0x5ec5c1(0xc6),skillDefinitions,{'defaultCommand':a36_0x5ec5c1(0xbd)}),registerService(a36_0x5ec5c1(0xbb),cliSkillDefinitions,{'defaultCommand':a36_0x5ec5c1(0xbd)}),registerService(a36_0x5ec5c1(0xb4),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a36_0x5ec5c1(0xa7),[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x5ec5c1(0xad),logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0x55021b,_0x5f232e){const _0x3689ef=a36_0x5ec5c1;return definitions[_0x3689ef(0xb8)](_0x55021b+':'+_0x5f232e);}export function isKnownService(_0x29e9c0){return serviceByName['has'](_0x29e9c0);}export function getServiceEntry(_0x47454d){const _0xd583cf=a36_0x5ec5c1;return serviceByName[_0xd583cf(0xb8)](_0x47454d);}export function getAllDefinitions(){const _0x5267cd=a36_0x5ec5c1;return Array[_0x5267cd(0xb5)](definitions[_0x5267cd(0xa2)]());}
@@ -1 +1 @@
1
- function a37_0x3dc1(_0x3abe2e,_0x2d6f73){_0x3abe2e=_0x3abe2e-0x14b;const _0x5a465f=a37_0x5a46();let _0x3dc151=_0x5a465f[_0x3abe2e];return _0x3dc151;}const a37_0x399b43=a37_0x3dc1;function a37_0x5a46(){const _0x55db24=['21388JjDIZN','341260HEEgcH','717438wZUida','2286gldhac','99kHeVmo','148664vlunRw','Export\x20machine-readable\x20command\x20schema\x20(JSON)','201cXGokw','1430244GcxmDm','schema','6129CMocBv','9170UkqSSp','301MdviyX','13170gqaRWn'];a37_0x5a46=function(){return _0x55db24;};return a37_0x5a46();}(function(_0x127586,_0x49de6f){const _0x1be872=a37_0x3dc1,_0x4bf0e3=_0x127586();while(!![]){try{const _0x4fb75f=parseInt(_0x1be872(0x14b))/0x1+-parseInt(_0x1be872(0x14c))/0x2+parseInt(_0x1be872(0x151))/0x3*(parseInt(_0x1be872(0x158))/0x4)+-parseInt(_0x1be872(0x157))/0x5*(parseInt(_0x1be872(0x14d))/0x6)+-parseInt(_0x1be872(0x156))/0x7*(-parseInt(_0x1be872(0x14f))/0x8)+-parseInt(_0x1be872(0x154))/0x9*(parseInt(_0x1be872(0x155))/0xa)+-parseInt(_0x1be872(0x14e))/0xb*(-parseInt(_0x1be872(0x152))/0xc);if(_0x4fb75f===_0x49de6f)break;else _0x4bf0e3['push'](_0x4bf0e3['shift']());}catch(_0x3a31b7){_0x4bf0e3['push'](_0x4bf0e3['shift']());}}}(a37_0x5a46,0x8eb3f));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x13d71c){const _0x448758=await buildSchemaPayload();return{'ok':!![],'data':_0x448758};}export const schemaDefinition={'service':a37_0x399b43(0x153),'command':'export','description':a37_0x399b43(0x150),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a37_0x4bbee8=a37_0x3701;function a37_0x6b80(){const _0x382813=['export','77247omxAyK','390WhXMOM','read','Export\x20machine-readable\x20command\x20schema\x20(JSON)','81iUKeHA','658964qlIAjM','3641322XRSEOB','3312fDOWSC','3146270PKynra','37984ZdWrDK','96653eTYljo','7kKtwZN'];a37_0x6b80=function(){return _0x382813;};return a37_0x6b80();}(function(_0x1b2481,_0x1204f8){const _0x1123b6=a37_0x3701,_0x23f490=_0x1b2481();while(!![]){try{const _0x7e760b=parseInt(_0x1123b6(0x1dd))/0x1+parseInt(_0x1123b6(0x1d8))/0x2+-parseInt(_0x1123b6(0x1d7))/0x3*(-parseInt(_0x1123b6(0x1dc))/0x4)+-parseInt(_0x1123b6(0x1db))/0x5+parseInt(_0x1123b6(0x1d9))/0x6+parseInt(_0x1123b6(0x1de))/0x7*(parseInt(_0x1123b6(0x1da))/0x8)+-parseInt(_0x1123b6(0x1e0))/0x9*(parseInt(_0x1123b6(0x1e1))/0xa);if(_0x7e760b===_0x1204f8)break;else _0x23f490['push'](_0x23f490['shift']());}catch(_0x10b645){_0x23f490['push'](_0x23f490['shift']());}}}(a37_0x6b80,0x4f8cd));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x3003ae){const _0x23a91e=await buildSchemaPayload();return{'ok':!![],'data':_0x23a91e};}function a37_0x3701(_0x43b1ed,_0x4e57df){_0x43b1ed=_0x43b1ed-0x1d6;const _0x6b8080=a37_0x6b80();let _0x370169=_0x6b8080[_0x43b1ed];return _0x370169;}export const schemaDefinition={'service':'schema','command':a37_0x4bbee8(0x1df),'description':a37_0x4bbee8(0x1d6),'risk':a37_0x4bbee8(0x1e2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- function a38_0xf15c(_0x26292b,_0x48d6b0){_0x26292b=_0x26292b-0x1d6;const _0x13b3e1=a38_0x13b3();let _0xf15cc4=_0x13b3e1[_0x26292b];return _0xf15cc4;}(function(_0x85d22f,_0xfb87cc){const _0xe45d7e=a38_0xf15c,_0x13aaea=_0x85d22f();while(!![]){try{const _0x4257a1=parseInt(_0xe45d7e(0x22f))/0x1*(-parseInt(_0xe45d7e(0x209))/0x2)+parseInt(_0xe45d7e(0x1dd))/0x3*(-parseInt(_0xe45d7e(0x1f9))/0x4)+-parseInt(_0xe45d7e(0x1fc))/0x5+parseInt(_0xe45d7e(0x210))/0x6+-parseInt(_0xe45d7e(0x21e))/0x7+parseInt(_0xe45d7e(0x1fa))/0x8*(-parseInt(_0xe45d7e(0x214))/0x9)+parseInt(_0xe45d7e(0x235))/0xa;if(_0x4257a1===_0xfb87cc)break;else _0x13aaea['push'](_0x13aaea['shift']());}catch(_0x406cd9){_0x13aaea['push'](_0x13aaea['shift']());}}}(a38_0x13b3,0xcc595));function a38_0x13b3(){const _0x4b896f=['tenantCode','scriptName','SERVICE_TREE','context.','48749030rrImSe','args','target','cliName','risk','map','\x20\x20\x20\x20kind:\x20\x20\x20\x20','datatable','rawFlags','cliPath','source','mapTo','\x20\x20MAP\x20TO','loginName','3Gaqngw','const','appBindings','nickname','filter','trim','fromEntries','\x20\x20\x20\x20','normalizedManifest','padEnd','bffId','\x20\x20SERVICE\x20TREE\x20TARGET','slice','envName','default','some','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','appCode','find','now','\x20service\x20detail\x20--service\x20','enum','number','startsWith','ctx.','params','command','3164648mqEQxA','5947328SdelwZ','bffCode','605590AlWpiW','\x20->\x20','env','Service\x20command\x20','name','dbtableConfig','service','tree','validation','Unsupported\x20service\x20target\x20kind:\x20','code','tableName','username','3178018qmPTGm','\x20requires\x20target.scriptName.','entries','join','description','string','type','1315494RIpmQk','Run\x20service\x20command\x20','Preview\x20dynamic\x20service\x20command:\x20','flatMap','18DddeFK','datasetCode','operator','push','data','employeeId','appRef','kind','appcode','sqlCode','1883126zFVtdY','commands','\x20\x20\x20\x20sqlCode:\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20\x20[','\x20\x20\x20\x20scriptName:\x20','nickName','fullPath','Use\x20`','length','\x20\x20\x20\x20datatable:\x20','userName','required','app','read','Commands:','boolean','1CAlZcg','userId'];a38_0x13b3=function(){return _0x4b896f;};return a38_0x13b3();}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(_0x2fdd46,_0x5e0339){const _0xe2d5a5=a38_0xf15c,_0x94454a=listLocalServiceTrees();let _0x539b5f;for(const _0x4a424c of _0x94454a){const _0x2e23da=matchServiceTreeCommand(_0x4a424c,_0x2fdd46);if(!_0x2e23da)continue;(!_0x539b5f||_0x2e23da['command'][_0xe2d5a5(0x225)][_0xe2d5a5(0x227)]>_0x539b5f[_0xe2d5a5(0x1f8)][_0xe2d5a5(0x225)][_0xe2d5a5(0x227)])&&(_0x539b5f={'tree':_0x4a424c,'command':_0x2e23da[_0xe2d5a5(0x1f8)],'remainingArgs':_0x2e23da['remainingArgs']});}if(!_0x539b5f)return undefined;const _0x469732={..._0x5e0339};return applyAppBinding(_0x539b5f[_0xe2d5a5(0x203)],_0x539b5f[_0xe2d5a5(0x1f8)],_0x469732),{'definition':buildDynamicCommandDefinition(_0x539b5f['tree'],_0x539b5f[_0xe2d5a5(0x1f8)]),'args':_0x539b5f['remainingArgs'],'flags':_0x469732,'tree':_0x539b5f[_0xe2d5a5(0x203)],'command':_0x539b5f[_0xe2d5a5(0x1f8)]};}export function generateDynamicServiceHelp(_0x1c0e05){const _0x56a859=a38_0xf15c,_0x169768=listLocalServiceTrees()[_0x56a859(0x1f0)](_0x1a3c9b=>_0x1a3c9b['service'][_0x56a859(0x206)]===_0x1c0e05);if(!_0x169768)return undefined;const _0x440f47=[CLI_BIN_NAME+'\x20'+_0x1c0e05+'\x20<command>\x20[flags]','',_0x169768[_0x56a859(0x202)][_0x56a859(0x200)]||_0x1c0e05,_0x169768[_0x56a859(0x202)][_0x56a859(0x20d)]?'\x20\x20'+_0x169768[_0x56a859(0x202)][_0x56a859(0x20d)]:'','',_0x56a859(0x22d),..._0x169768['commands']['map'](_0xb34f1c=>{const _0x29f1f2=_0x56a859,_0x30964f=_0xb34f1c[_0x29f1f2(0x225)][_0x29f1f2(0x1e9)](0x1)[_0x29f1f2(0x20c)]('\x20'),_0x54d7aa=_0xb34f1c[_0x29f1f2(0x239)]==='read'?'':'\x20['+_0xb34f1c[_0x29f1f2(0x239)]+']';return'\x20\x20'+_0x30964f[_0x29f1f2(0x1e6)](0x18)+'\x20'+(_0xb34f1c[_0x29f1f2(0x20d)]||'')+_0x54d7aa;}),'',_0x56a859(0x226)+CLI_BIN_NAME+_0x56a859(0x1f2)+_0x1c0e05+'`\x20to\x20inspect\x20the\x20manifest.'][_0x56a859(0x1e1)](Boolean);return _0x440f47[_0x56a859(0x20c)]('\x0a');}export function listDynamicServiceEntries(){const _0x484f6f=a38_0xf15c;return listLocalServices()[_0x484f6f(0x23a)](_0x160ff5=>{const _0x2ee1f4=_0x484f6f,_0x50c1aa=_0x160ff5[_0x2ee1f4(0x1e5)];return{'service':_0x50c1aa[_0x2ee1f4(0x202)][_0x2ee1f4(0x206)],'label':_0x50c1aa[_0x2ee1f4(0x202)]['name']||_0x50c1aa[_0x2ee1f4(0x202)][_0x2ee1f4(0x206)],'commands':_0x50c1aa[_0x2ee1f4(0x21f)][_0x2ee1f4(0x23a)](_0x5b9fc6=>({'command':dynamicCommandName(_0x5b9fc6),'description':_0x5b9fc6[_0x2ee1f4(0x20d)]||_0x2ee1f4(0x211)+_0x5b9fc6[_0x2ee1f4(0x1d8)],'tag':riskTag(_0x5b9fc6[_0x2ee1f4(0x239)])}))};});}export function getDynamicServiceEntry(_0x47bbb0){const _0x12e614=a38_0xf15c;return listDynamicServiceEntries()[_0x12e614(0x1f0)](_0x5309d4=>_0x5309d4[_0x12e614(0x202)]===_0x47bbb0);}export function listDynamicServiceDefinitions(_0x547682){const _0x34c56f=a38_0xf15c;return listLocalServiceTrees()['filter'](_0x14e539=>!_0x547682||_0x14e539['service']['code']===_0x547682)[_0x34c56f(0x213)](_0x24c857=>_0x24c857[_0x34c56f(0x21f)][_0x34c56f(0x23a)](_0x432530=>buildDynamicCommandDefinition(_0x24c857,_0x432530)));}export function getDynamicServiceDefinitions(_0x7f5098){const _0x4386dc=listDynamicServiceDefinitions(_0x7f5098);return _0x4386dc['length']>0x0?_0x4386dc:undefined;}export function findDynamicServiceDefinition(_0x14390b,_0x4b0e87){const _0x18f28d=a38_0xf15c;return listDynamicServiceDefinitions(_0x14390b)['find'](_0x5e9182=>_0x5e9182[_0x18f28d(0x1f8)]===_0x4b0e87);}export function buildDynamicCommandDefinition(_0x366300,_0x4252ac){const _0x4b3f4e=a38_0xf15c;return{'service':_0x366300[_0x4b3f4e(0x202)][_0x4b3f4e(0x206)],'command':dynamicCommandName(_0x4252ac),'description':_0x4252ac[_0x4b3f4e(0x20d)]||_0x4b3f4e(0x211)+_0x4252ac[_0x4b3f4e(0x1d8)],'risk':_0x4252ac[_0x4b3f4e(0x239)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x4252ac[_0x4b3f4e(0x236)][_0x4b3f4e(0x23a)](_0x4d0f87=>({'name':_0x4d0f87[_0x4b3f4e(0x200)],'description':_0x4d0f87[_0x4b3f4e(0x20d)]||_0x4d0f87[_0x4b3f4e(0x200)],'required':_0x4d0f87[_0x4b3f4e(0x22a)]})),'flags':_0x4252ac['flags'][_0x4b3f4e(0x23a)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x4252ac),async 'dryRun'(_0x5f18ba){const _0x3e72dc=_0x4b3f4e,_0x664b4c=await compilePlan(_0x4252ac,_0x5f18ba);return{'method':_0x3e72dc(0x233),'url':_0x4252ac['cliPath'],'body':{'target':targetPreview(_0x664b4c),'params':_0x664b4c[_0x3e72dc(0x1f7)]},'description':_0x3e72dc(0x212)+_0x4252ac['cliPath']};},async 'execute'(_0x1ead33){const _0x5a4ca4=_0x4b3f4e,_0x3a56a3=await compilePlan(_0x4252ac,_0x1ead33),_0x84daf8=Date[_0x5a4ca4(0x1f1)](),_0x35779b=await executePlan(_0x3a56a3,_0x4252ac,_0x1ead33),_0x528063=Date[_0x5a4ca4(0x1f1)]()-_0x84daf8;return{'ok':!![],'data':{'service':_0x366300[_0x5a4ca4(0x202)],'command':_0x4252ac[_0x5a4ca4(0x1d8)],'target':targetPreview(_0x3a56a3),'result':_0x35779b,'elapsed':_0x528063},'message':_0x5a4ca4(0x1ff)+_0x4252ac[_0x5a4ca4(0x1d8)]+'\x20completed\x20in\x20'+_0x528063+'ms'};}};}function dynamicCommandName(_0x493fde){const _0x2a7bb4=a38_0xf15c;return _0x493fde[_0x2a7bb4(0x225)]['slice'](0x1)[_0x2a7bb4(0x20c)]('\x20');}function riskTag(_0x58a1d6){const _0x2e8fdb=a38_0xf15c;return _0x58a1d6===_0x2e8fdb(0x22c)?'':_0x2e8fdb(0x222)+_0x58a1d6+']';}function flagToCommandFlag(_0xc539d0){const _0x16b162=a38_0xf15c;return{'name':_0xc539d0[_0x16b162(0x238)],'type':_0xc539d0['type']==='json'?_0x16b162(0x20e):_0xc539d0[_0x16b162(0x20f)],'description':_0xc539d0[_0x16b162(0x20d)]||_0xc539d0['name'],'required':_0xc539d0[_0x16b162(0x22a)],'default':isPrimitiveFlagDefault(_0xc539d0[_0x16b162(0x1eb)])?_0xc539d0[_0x16b162(0x1eb)]:undefined,'enum':_0xc539d0[_0x16b162(0x1f3)]};}async function compilePlan(_0x2ea232,_0xa6a0c6){const _0x59d185=a38_0xf15c;return compileServiceTreeCommand(_0x2ea232,{'flags':_0xa6a0c6[_0x59d185(0x1d7)],'args':_0xa6a0c6[_0x59d185(0x236)],'context':await buildServiceContext(_0x2ea232,_0xa6a0c6)});}async function buildServiceContext(_0x370155,_0x1ea597){const _0x2f3df3=a38_0xf15c,_0x339e49={'appCode':_0x1ea597[_0x2f3df3(0x1ef)],'env':_0x1ea597[_0x2f3df3(0x1ea)],'envName':_0x1ea597[_0x2f3df3(0x1ea)]};if(!usesRuntimeContext(_0x370155))return _0x339e49;const _0x5d11d3=await getLoginUserInfo(),_0x4cc62a=pickFirst(_0x5d11d3[_0x2f3df3(0x230)],_0x5d11d3['id']);return{..._0x339e49,'user':_0x5d11d3,'userId':_0x4cc62a,'id':_0x5d11d3['id'],'username':pickFirst(_0x5d11d3[_0x2f3df3(0x208)],_0x5d11d3[_0x2f3df3(0x229)],_0x5d11d3[_0x2f3df3(0x1dc)]),'userName':_0x5d11d3['userName'],'nickname':pickFirst(_0x5d11d3[_0x2f3df3(0x1e0)],_0x5d11d3[_0x2f3df3(0x224)]),'nickName':_0x5d11d3[_0x2f3df3(0x224)],'tenantCode':_0x5d11d3[_0x2f3df3(0x231)],'employeeId':_0x5d11d3[_0x2f3df3(0x219)]};}function usesRuntimeContext(_0x2dec8b){const _0x461aba=a38_0xf15c;return _0x2dec8b[_0x461aba(0x1da)][_0x461aba(0x1ec)](_0x16f27=>typeof _0x16f27[_0x461aba(0x1d9)]===_0x461aba(0x20e)&&(_0x16f27[_0x461aba(0x1d9)]['startsWith'](_0x461aba(0x234))||_0x16f27[_0x461aba(0x1d9)][_0x461aba(0x1f5)](_0x461aba(0x1f6))));}function pickFirst(..._0xa01dcd){return _0xa01dcd['find'](_0xce2566=>_0xce2566!==undefined&&_0xce2566!==null);}async function executePlan(_0x4e835c,_0x2e787e,_0x4b847d){const _0xff7453=a38_0xf15c;if(_0x4e835c['kind']===_0xff7453(0x218)){const _0x1975bb=await resolveDatasetCode(_0x4e835c,_0x2e787e,_0x4b847d);return executeData(_0x1975bb,_0x4e835c[_0xff7453(0x1f8)],_0x4e835c[_0xff7453(0x1f7)]);}if(_0x4e835c['kind']==='sql'){if(!_0x4e835c['sqlCode'])throw CliErrors[_0xff7453(0x204)]('Service\x20command\x20'+_0x2e787e['cliPath']+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x4e835c[_0xff7453(0x21d)],normalizeScalarParams(_0x4e835c[_0xff7453(0x1f7)]));}if(_0x4e835c[_0xff7453(0x21b)]==='bff'){const _0x5766ad=_0x4e835c[_0xff7453(0x232)]||_0x4e835c[_0xff7453(0x1fb)]||(_0x4e835c[_0xff7453(0x1e7)]==null?'':String(_0x4e835c[_0xff7453(0x1e7)]));if(!_0x5766ad)throw CliErrors['validation'](_0xff7453(0x1ff)+_0x2e787e[_0xff7453(0x1d8)]+_0xff7453(0x20a));return executeSdkBff(_0x5766ad,_0x4e835c[_0xff7453(0x1f7)]);}throw CliErrors[_0xff7453(0x204)](_0xff7453(0x205)+_0x4e835c[_0xff7453(0x21b)]);}async function resolveDatasetCode(_0x4eec81,_0x365398,_0x452a69){const _0x59e03a=a38_0xf15c;if(_0x4eec81['datasetCode'])return _0x4eec81[_0x59e03a(0x215)];if(!_0x4eec81['datatable'])throw CliErrors[_0x59e03a(0x204)]('Service\x20command\x20'+_0x365398[_0x59e03a(0x1d8)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x1dce8f=await listDatasets(_0x452a69[_0x59e03a(0x1ef)]),_0x1822bb=_0x1dce8f[_0x59e03a(0x1f0)](_0x1065bb=>_0x1065bb[_0x59e03a(0x201)]?.[_0x59e03a(0x207)]===_0x4eec81[_0x59e03a(0x1d6)]);if(!_0x1822bb?.[_0x59e03a(0x206)])throw CliErrors[_0x59e03a(0x204)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x4eec81[_0x59e03a(0x1d6)]+_0x59e03a(0x221)+_0x452a69['appCode']+'.',_0x59e03a(0x1ee));return _0x1822bb['code'];}function applyAppBinding(_0x2c0af4,_0x218673,_0x161258){const _0x3bb4be=a38_0xf15c,_0x749536=_0x218673[_0x3bb4be(0x237)][_0x3bb4be(0x21a)];if(!_0x749536)return;const _0x428945=_0x2c0af4[_0x3bb4be(0x1df)][_0x749536];if(!_0x428945)throw CliErrors[_0x3bb4be(0x204)]('Unknown\x20appRef\x20\x22'+_0x749536+'\x22\x20in\x20service\x20command\x20'+_0x218673[_0x3bb4be(0x1d8)]+'.',_0x3bb4be(0x1ed));const _0x35dff7=_0x428945[_0x3bb4be(0x21c)]||_0x428945[_0x3bb4be(0x1ef)];_0x35dff7&&!hasText(_0x161258[_0x3bb4be(0x21c)])&&(_0x161258[_0x3bb4be(0x21c)]=_0x35dff7),_0x428945['app']&&!hasText(_0x161258[_0x3bb4be(0x22b)])&&!hasText(_0x161258[_0x3bb4be(0x21c)])&&(_0x161258[_0x3bb4be(0x22b)]=_0x428945['app']),_0x428945['env']&&!hasText(_0x161258['env'])&&(_0x161258[_0x3bb4be(0x1fe)]=_0x428945[_0x3bb4be(0x1fe)]);}function renderDynamicCommandHelp(_0xd6588b){const _0x3da7d7=a38_0xf15c,_0x2c069f=[_0x3da7d7(0x1e8),_0x3da7d7(0x23b)+_0xd6588b[_0x3da7d7(0x237)][_0x3da7d7(0x21b)],'\x20\x20\x20\x20command:\x20'+_0xd6588b[_0x3da7d7(0x237)]['command']];if(_0xd6588b[_0x3da7d7(0x237)]['datasetCode'])_0x2c069f[_0x3da7d7(0x217)]('\x20\x20\x20\x20datasetCode:\x20'+_0xd6588b[_0x3da7d7(0x237)][_0x3da7d7(0x215)]);if(_0xd6588b[_0x3da7d7(0x237)][_0x3da7d7(0x1d6)])_0x2c069f['push'](_0x3da7d7(0x228)+_0xd6588b[_0x3da7d7(0x237)]['datatable']);if(_0xd6588b['target'][_0x3da7d7(0x21d)])_0x2c069f[_0x3da7d7(0x217)](_0x3da7d7(0x220)+_0xd6588b[_0x3da7d7(0x237)]['sqlCode']);if(_0xd6588b[_0x3da7d7(0x237)][_0x3da7d7(0x232)])_0x2c069f[_0x3da7d7(0x217)](_0x3da7d7(0x223)+_0xd6588b[_0x3da7d7(0x237)][_0x3da7d7(0x232)]);if(_0xd6588b[_0x3da7d7(0x1da)][_0x3da7d7(0x227)]>0x0){_0x2c069f[_0x3da7d7(0x217)]('',_0x3da7d7(0x1db));for(const _0x5ccb9f of _0xd6588b['mapTo']){_0x2c069f[_0x3da7d7(0x217)](_0x3da7d7(0x1e4)+(_0x5ccb9f[_0x3da7d7(0x1d9)]||_0x3da7d7(0x1de))+_0x3da7d7(0x1fd)+_0x5ccb9f[_0x3da7d7(0x237)]+(_0x5ccb9f[_0x3da7d7(0x216)]?'.'+_0x5ccb9f[_0x3da7d7(0x216)]:''));}}return _0x2c069f[_0x3da7d7(0x20c)]('\x0a');}function targetPreview(_0x5ed556){const _0xb0859b=a38_0xf15c;return{'kind':_0x5ed556[_0xb0859b(0x21b)],'command':_0x5ed556['command'],'appRef':_0x5ed556[_0xb0859b(0x21a)],'datasetCode':_0x5ed556[_0xb0859b(0x215)],'datatable':_0x5ed556[_0xb0859b(0x1d6)],'sqlCode':_0x5ed556[_0xb0859b(0x21d)],'bffCode':_0x5ed556[_0xb0859b(0x1fb)],'bffId':_0x5ed556[_0xb0859b(0x1e7)],'scriptName':_0x5ed556[_0xb0859b(0x232)]};}function normalizeScalarParams(_0x8543da){const _0x288876=a38_0xf15c;return Object[_0x288876(0x1e3)](Object[_0x288876(0x20b)](_0x8543da)['filter'](([,_0x5af1e0])=>typeof _0x5af1e0===_0x288876(0x20e)||typeof _0x5af1e0===_0x288876(0x1f4)));}function hasText(_0x30fd18){const _0x35573b=a38_0xf15c;return typeof _0x30fd18==='string'&&_0x30fd18[_0x35573b(0x1e2)]()[_0x35573b(0x227)]>0x0;}function isPrimitiveFlagDefault(_0x48854e){const _0x15a6a9=a38_0xf15c;return _0x48854e===undefined||typeof _0x48854e==='string'||typeof _0x48854e==='number'||typeof _0x48854e===_0x15a6a9(0x22e);}
1
+ (function(_0x59e6df,_0x430c9a){const _0x1d4837=a38_0x5eda,_0x4b193b=_0x59e6df();while(!![]){try{const _0xf4a589=parseInt(_0x1d4837(0x1e2))/0x1+-parseInt(_0x1d4837(0x1f6))/0x2+parseInt(_0x1d4837(0x1b7))/0x3+-parseInt(_0x1d4837(0x1d0))/0x4*(-parseInt(_0x1d4837(0x1f4))/0x5)+-parseInt(_0x1d4837(0x1ad))/0x6+-parseInt(_0x1d4837(0x1f0))/0x7+-parseInt(_0x1d4837(0x1e4))/0x8;if(_0xf4a589===_0x430c9a)break;else _0x4b193b['push'](_0x4b193b['shift']());}catch(_0x8ac52a){_0x4b193b['push'](_0x4b193b['shift']());}}}(a38_0x5865,0x5fb3d));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(_0x27bce9,_0x31c679){const _0x3aa492=a38_0x5eda,_0x555c4d=listLocalServiceTrees();let _0x4d06b9;for(const _0x4b16d1 of _0x555c4d){const _0x2aa614=matchServiceTreeCommand(_0x4b16d1,_0x27bce9);if(!_0x2aa614)continue;(!_0x4d06b9||_0x2aa614[_0x3aa492(0x206)][_0x3aa492(0x1e9)][_0x3aa492(0x1c5)]>_0x4d06b9[_0x3aa492(0x206)][_0x3aa492(0x1e9)][_0x3aa492(0x1c5)])&&(_0x4d06b9={'tree':_0x4b16d1,'command':_0x2aa614[_0x3aa492(0x206)],'remainingArgs':_0x2aa614['remainingArgs']});}if(!_0x4d06b9)return undefined;const _0x5bf3af={..._0x31c679};return applyAppBinding(_0x4d06b9[_0x3aa492(0x1df)],_0x4d06b9[_0x3aa492(0x206)],_0x5bf3af),{'definition':buildDynamicCommandDefinition(_0x4d06b9[_0x3aa492(0x1df)],_0x4d06b9[_0x3aa492(0x206)]),'args':_0x4d06b9[_0x3aa492(0x1fd)],'flags':_0x5bf3af,'tree':_0x4d06b9[_0x3aa492(0x1df)],'command':_0x4d06b9[_0x3aa492(0x206)]};}export function generateDynamicServiceHelp(_0x2ce5e1){const _0x15571a=a38_0x5eda,_0xeaa59d=listLocalServiceTrees()[_0x15571a(0x1dd)](_0x47aab9=>_0x47aab9[_0x15571a(0x201)][_0x15571a(0x1c1)]===_0x2ce5e1);if(!_0xeaa59d)return undefined;const _0x13e64a=[CLI_BIN_NAME+'\x20'+_0x2ce5e1+_0x15571a(0x1a6),'',_0xeaa59d['service'][_0x15571a(0x1da)]||_0x2ce5e1,_0xeaa59d['service'][_0x15571a(0x1a5)]?'\x20\x20'+_0xeaa59d['service'][_0x15571a(0x1a5)]:'','',_0x15571a(0x1ef),..._0xeaa59d[_0x15571a(0x1ba)][_0x15571a(0x1fe)](_0x50468f=>{const _0x534e07=_0x15571a,_0x35bad6=_0x50468f[_0x534e07(0x1e9)]['slice'](0x1)[_0x534e07(0x1e1)]('\x20'),_0x442aaa=_0x50468f[_0x534e07(0x1ff)]===_0x534e07(0x1c4)?'':'\x20['+_0x50468f['risk']+']';return'\x20\x20'+_0x35bad6[_0x534e07(0x1fa)](0x18)+'\x20'+(_0x50468f[_0x534e07(0x1a5)]||'')+_0x442aaa;}),'',_0x15571a(0x1ae)+CLI_BIN_NAME+_0x15571a(0x1f1)+_0x2ce5e1+_0x15571a(0x1d8)]['filter'](Boolean);return _0x13e64a[_0x15571a(0x1e1)]('\x0a');}export function listDynamicServiceEntries(){const _0x25d808=a38_0x5eda;return listLocalServices()[_0x25d808(0x1fe)](_0x870a61=>{const _0x11be59=_0x25d808,_0x23011f=_0x870a61[_0x11be59(0x1b0)];return{'service':_0x23011f[_0x11be59(0x201)][_0x11be59(0x1c1)],'label':_0x23011f[_0x11be59(0x201)][_0x11be59(0x1da)]||_0x23011f[_0x11be59(0x201)][_0x11be59(0x1c1)],'commands':_0x23011f[_0x11be59(0x1ba)][_0x11be59(0x1fe)](_0x51b464=>({'command':dynamicCommandName(_0x51b464),'description':_0x51b464[_0x11be59(0x1a5)]||_0x11be59(0x1eb)+_0x51b464[_0x11be59(0x1bf)],'tag':riskTag(_0x51b464['risk'])}))};});}export function getDynamicServiceEntry(_0x3a2dc1){const _0x4ae390=a38_0x5eda;return listDynamicServiceEntries()[_0x4ae390(0x1dd)](_0x2849e7=>_0x2849e7[_0x4ae390(0x201)]===_0x3a2dc1);}export function listDynamicServiceDefinitions(_0x156a67){const _0x2b9f2f=a38_0x5eda;return listLocalServiceTrees()[_0x2b9f2f(0x1d6)](_0xc9f989=>!_0x156a67||_0xc9f989['service'][_0x2b9f2f(0x1c1)]===_0x156a67)['flatMap'](_0x7c0e99=>_0x7c0e99[_0x2b9f2f(0x1ba)][_0x2b9f2f(0x1fe)](_0x551b9d=>buildDynamicCommandDefinition(_0x7c0e99,_0x551b9d)));}export function getDynamicServiceDefinitions(_0x4a61ef){const _0x3b991f=a38_0x5eda,_0x306954=listDynamicServiceDefinitions(_0x4a61ef);return _0x306954[_0x3b991f(0x1c5)]>0x0?_0x306954:undefined;}function a38_0x5eda(_0x220538,_0x3ce482){_0x220538=_0x220538-0x1a5;const _0x58650c=a38_0x5865();let _0x5edae0=_0x58650c[_0x220538];return _0x5edae0;}export function findDynamicServiceDefinition(_0x19737d,_0x3aaef5){const _0x52d5b6=a38_0x5eda;return listDynamicServiceDefinitions(_0x19737d)[_0x52d5b6(0x1dd)](_0x27ae9a=>_0x27ae9a[_0x52d5b6(0x206)]===_0x3aaef5);}export function buildDynamicCommandDefinition(_0x188950,_0x4e92ae){const _0x407d1d=a38_0x5eda;return{'service':_0x188950['service']['code'],'command':dynamicCommandName(_0x4e92ae),'description':_0x4e92ae[_0x407d1d(0x1a5)]||_0x407d1d(0x1eb)+_0x4e92ae[_0x407d1d(0x1bf)],'risk':_0x4e92ae[_0x407d1d(0x1ff)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x4e92ae['args'][_0x407d1d(0x1fe)](_0x4d66f7=>({'name':_0x4d66f7[_0x407d1d(0x1da)],'description':_0x4d66f7[_0x407d1d(0x1a5)]||_0x4d66f7['name'],'required':_0x4d66f7[_0x407d1d(0x1e5)]})),'flags':_0x4e92ae[_0x407d1d(0x1d2)][_0x407d1d(0x1fe)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x4e92ae),async 'dryRun'(_0x317f6c){const _0x421346=_0x407d1d,_0xf1fd0f=await compilePlan(_0x4e92ae,_0x317f6c);return{'method':_0x421346(0x1bd),'url':_0x4e92ae['cliPath'],'body':{'target':targetPreview(_0xf1fd0f),'params':_0xf1fd0f['params']},'description':_0x421346(0x1b2)+_0x4e92ae[_0x421346(0x1bf)]};},async 'execute'(_0x12d3b5){const _0x440f0d=_0x407d1d,_0x2d5826=await compilePlan(_0x4e92ae,_0x12d3b5),_0x489c76=Date[_0x440f0d(0x1a9)](),_0x1e864b=await executePlan(_0x2d5826,_0x4e92ae,_0x12d3b5),_0x46876d=Date[_0x440f0d(0x1a9)]()-_0x489c76;return{'ok':!![],'data':{'service':_0x188950[_0x440f0d(0x201)],'command':_0x4e92ae['cliPath'],'target':targetPreview(_0x2d5826),'result':_0x1e864b,'elapsed':_0x46876d},'message':_0x440f0d(0x1e0)+_0x4e92ae[_0x440f0d(0x1bf)]+'\x20completed\x20in\x20'+_0x46876d+'ms'};}};}function a38_0x5865(){const _0x24a998=['commands','\x20\x20MAP\x20TO','nickname','SERVICE_TREE','validation','cliPath','operator','code','dbtableConfig','datatable','read','length','rawFlags','default','\x20\x20\x20\x20datasetCode:\x20','appcode','\x20\x20\x20\x20','datasetCode','\x20\x20\x20\x20scriptName:\x20','nickName','slice','sql','773180aSjsPi','startsWith','flags','\x20\x20\x20\x20command:\x20','data','\x20\x20\x20\x20datatable:\x20','filter','sqlCode','`\x20to\x20inspect\x20the\x20manifest.','env','name','source','const','find','\x20\x20[','tree','Service\x20command\x20','join','226419jjFGJE','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','7183648TyhwGw','required','userName','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','bffCode','fullPath','tableName','Run\x20service\x20command\x20','string','app','bffId','Commands:','1234597NyJoSI','\x20service\x20detail\x20--service\x20','envName','\x20\x20\x20\x20kind:\x20\x20\x20\x20','20pWddsJ','boolean','275060orpQwg','ctx.','appBindings','appCode','padEnd','Cannot\x20resolve\x20datatable\x20\x22','username','remainingArgs','map','risk','\x20requires\x20target.scriptName.','service','mapTo','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','number','Unknown\x20appRef\x20\x22','command','description','\x20<command>\x20[flags]','appRef','employeeId','now','push','Unsupported\x20service\x20target\x20kind:\x20','\x20\x20SERVICE\x20TREE\x20TARGET','974508wLEcuw','Use\x20`','kind','normalizedManifest','args','Preview\x20dynamic\x20service\x20command:\x20','cliName','params','fromEntries','target','2300019wxiszr','trim','scriptName'];a38_0x5865=function(){return _0x24a998;};return a38_0x5865();}function dynamicCommandName(_0x11448c){const _0x174de7=a38_0x5eda;return _0x11448c[_0x174de7(0x1e9)][_0x174de7(0x1ce)](0x1)['join']('\x20');}function riskTag(_0x4baaba){const _0xd68acc=a38_0x5eda;return _0x4baaba==='read'?'':_0xd68acc(0x1de)+_0x4baaba+']';}function flagToCommandFlag(_0x45844f){const _0x595a18=a38_0x5eda;return{'name':_0x45844f[_0x595a18(0x1b3)],'type':_0x45844f['type']==='json'?_0x595a18(0x1ec):_0x45844f['type'],'description':_0x45844f[_0x595a18(0x1a5)]||_0x45844f[_0x595a18(0x1da)],'required':_0x45844f[_0x595a18(0x1e5)],'default':isPrimitiveFlagDefault(_0x45844f['default'])?_0x45844f[_0x595a18(0x1c7)]:undefined,'enum':_0x45844f['enum']};}async function compilePlan(_0x227f8a,_0x2078fa){const _0x442f28=a38_0x5eda;return compileServiceTreeCommand(_0x227f8a,{'flags':_0x2078fa[_0x442f28(0x1c6)],'args':_0x2078fa[_0x442f28(0x1b1)],'context':await buildServiceContext(_0x227f8a,_0x2078fa)});}async function buildServiceContext(_0x582c80,_0x6e2946){const _0xffd908=a38_0x5eda,_0x3c4f8a={'appCode':_0x6e2946[_0xffd908(0x1f9)],'env':_0x6e2946[_0xffd908(0x1f2)],'envName':_0x6e2946[_0xffd908(0x1f2)]};if(!usesRuntimeContext(_0x582c80))return _0x3c4f8a;const _0x41595a=await getLoginUserInfo(),_0xd957ce=pickFirst(_0x41595a['userId'],_0x41595a['id']);return{..._0x3c4f8a,'user':_0x41595a,'userId':_0xd957ce,'id':_0x41595a['id'],'username':pickFirst(_0x41595a[_0xffd908(0x1fc)],_0x41595a[_0xffd908(0x1e6)],_0x41595a['loginName']),'userName':_0x41595a['userName'],'nickname':pickFirst(_0x41595a[_0xffd908(0x1bc)],_0x41595a[_0xffd908(0x1cd)]),'nickName':_0x41595a['nickName'],'tenantCode':_0x41595a['tenantCode'],'employeeId':_0x41595a[_0xffd908(0x1a8)]};}function usesRuntimeContext(_0x4a13db){const _0x1d9d6a=a38_0x5eda;return _0x4a13db['mapTo']['some'](_0x57045b=>typeof _0x57045b[_0x1d9d6a(0x1db)]===_0x1d9d6a(0x1ec)&&(_0x57045b['source'][_0x1d9d6a(0x1d1)]('context.')||_0x57045b[_0x1d9d6a(0x1db)]['startsWith'](_0x1d9d6a(0x1f7))));}function pickFirst(..._0x4f46ce){const _0x539e87=a38_0x5eda;return _0x4f46ce[_0x539e87(0x1dd)](_0x4af6e1=>_0x4af6e1!==undefined&&_0x4af6e1!==null);}async function executePlan(_0xddd744,_0xe5d436,_0x94411a){const _0x31c7b9=a38_0x5eda;if(_0xddd744[_0x31c7b9(0x1af)]===_0x31c7b9(0x1d4)){const _0x372fc7=await resolveDatasetCode(_0xddd744,_0xe5d436,_0x94411a);return executeData(_0x372fc7,_0xddd744['command'],_0xddd744[_0x31c7b9(0x1b4)]);}if(_0xddd744[_0x31c7b9(0x1af)]===_0x31c7b9(0x1cf)){if(!_0xddd744[_0x31c7b9(0x1d7)])throw CliErrors[_0x31c7b9(0x1be)](_0x31c7b9(0x1e0)+_0xe5d436[_0x31c7b9(0x1bf)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0xddd744[_0x31c7b9(0x1d7)],normalizeScalarParams(_0xddd744['params']));}if(_0xddd744[_0x31c7b9(0x1af)]==='bff'){const _0x17ee5b=_0xddd744[_0x31c7b9(0x1b9)]||_0xddd744[_0x31c7b9(0x1e8)]||(_0xddd744[_0x31c7b9(0x1ee)]==null?'':String(_0xddd744[_0x31c7b9(0x1ee)]));if(!_0x17ee5b)throw CliErrors[_0x31c7b9(0x1be)]('Service\x20command\x20'+_0xe5d436[_0x31c7b9(0x1bf)]+_0x31c7b9(0x200));return executeSdkBff(_0x17ee5b,_0xddd744[_0x31c7b9(0x1b4)]);}throw CliErrors['validation'](_0x31c7b9(0x1ab)+_0xddd744['kind']);}async function resolveDatasetCode(_0x56492a,_0x5172a8,_0x5cde17){const _0x32913c=a38_0x5eda;if(_0x56492a[_0x32913c(0x1cb)])return _0x56492a['datasetCode'];if(!_0x56492a[_0x32913c(0x1c3)])throw CliErrors[_0x32913c(0x1be)](_0x32913c(0x1e0)+_0x5172a8['cliPath']+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x58f6f1=await listDatasets(_0x5cde17[_0x32913c(0x1f9)]),_0x537aa6=_0x58f6f1['find'](_0xbdf19c=>_0xbdf19c[_0x32913c(0x1c2)]?.[_0x32913c(0x1ea)]===_0x56492a[_0x32913c(0x1c3)]);if(!_0x537aa6?.[_0x32913c(0x1c1)])throw CliErrors[_0x32913c(0x1be)](_0x32913c(0x1fb)+_0x56492a[_0x32913c(0x1c3)]+_0x32913c(0x203)+_0x5cde17[_0x32913c(0x1f9)]+'.',_0x32913c(0x1e3));return _0x537aa6[_0x32913c(0x1c1)];}function applyAppBinding(_0x3b88d9,_0x5ee405,_0x4ca703){const _0x14be27=a38_0x5eda,_0xfa81fe=_0x5ee405[_0x14be27(0x1b6)][_0x14be27(0x1a7)];if(!_0xfa81fe)return;const _0x58f241=_0x3b88d9[_0x14be27(0x1f8)][_0xfa81fe];if(!_0x58f241)throw CliErrors['validation'](_0x14be27(0x205)+_0xfa81fe+'\x22\x20in\x20service\x20command\x20'+_0x5ee405[_0x14be27(0x1bf)]+'.',_0x14be27(0x1e7));const _0x415de3=_0x58f241['appcode']||_0x58f241[_0x14be27(0x1f9)];_0x415de3&&!hasText(_0x4ca703[_0x14be27(0x1c9)])&&(_0x4ca703[_0x14be27(0x1c9)]=_0x415de3),_0x58f241[_0x14be27(0x1ed)]&&!hasText(_0x4ca703[_0x14be27(0x1ed)])&&!hasText(_0x4ca703[_0x14be27(0x1c9)])&&(_0x4ca703[_0x14be27(0x1ed)]=_0x58f241['app']),_0x58f241[_0x14be27(0x1d9)]&&!hasText(_0x4ca703['env'])&&(_0x4ca703['env']=_0x58f241['env']);}function renderDynamicCommandHelp(_0x4e5ed5){const _0x184e17=a38_0x5eda,_0x1b9f75=[_0x184e17(0x1ac),_0x184e17(0x1f3)+_0x4e5ed5[_0x184e17(0x1b6)][_0x184e17(0x1af)],_0x184e17(0x1d3)+_0x4e5ed5['target']['command']];if(_0x4e5ed5[_0x184e17(0x1b6)]['datasetCode'])_0x1b9f75['push'](_0x184e17(0x1c8)+_0x4e5ed5[_0x184e17(0x1b6)][_0x184e17(0x1cb)]);if(_0x4e5ed5['target'][_0x184e17(0x1c3)])_0x1b9f75['push'](_0x184e17(0x1d5)+_0x4e5ed5[_0x184e17(0x1b6)][_0x184e17(0x1c3)]);if(_0x4e5ed5['target']['sqlCode'])_0x1b9f75[_0x184e17(0x1aa)]('\x20\x20\x20\x20sqlCode:\x20'+_0x4e5ed5['target'][_0x184e17(0x1d7)]);if(_0x4e5ed5[_0x184e17(0x1b6)][_0x184e17(0x1b9)])_0x1b9f75[_0x184e17(0x1aa)](_0x184e17(0x1cc)+_0x4e5ed5['target'][_0x184e17(0x1b9)]);if(_0x4e5ed5[_0x184e17(0x202)]['length']>0x0){_0x1b9f75[_0x184e17(0x1aa)]('',_0x184e17(0x1bb));for(const _0x13e290 of _0x4e5ed5[_0x184e17(0x202)]){_0x1b9f75['push'](_0x184e17(0x1ca)+(_0x13e290['source']||_0x184e17(0x1dc))+'\x20->\x20'+_0x13e290[_0x184e17(0x1b6)]+(_0x13e290[_0x184e17(0x1c0)]?'.'+_0x13e290[_0x184e17(0x1c0)]:''));}}return _0x1b9f75[_0x184e17(0x1e1)]('\x0a');}function targetPreview(_0x183b12){const _0x5e54eb=a38_0x5eda;return{'kind':_0x183b12[_0x5e54eb(0x1af)],'command':_0x183b12[_0x5e54eb(0x206)],'appRef':_0x183b12['appRef'],'datasetCode':_0x183b12[_0x5e54eb(0x1cb)],'datatable':_0x183b12[_0x5e54eb(0x1c3)],'sqlCode':_0x183b12[_0x5e54eb(0x1d7)],'bffCode':_0x183b12[_0x5e54eb(0x1e8)],'bffId':_0x183b12[_0x5e54eb(0x1ee)],'scriptName':_0x183b12[_0x5e54eb(0x1b9)]};}function normalizeScalarParams(_0x1d29c7){const _0x447cab=a38_0x5eda;return Object[_0x447cab(0x1b5)](Object['entries'](_0x1d29c7)[_0x447cab(0x1d6)](([,_0x13796e])=>typeof _0x13796e===_0x447cab(0x1ec)||typeof _0x13796e===_0x447cab(0x204)));}function hasText(_0xff834d){const _0x520895=a38_0x5eda;return typeof _0xff834d===_0x520895(0x1ec)&&_0xff834d[_0x520895(0x1b8)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x9ddc1){const _0x54df84=a38_0x5eda;return _0x9ddc1===undefined||typeof _0x9ddc1===_0x54df84(0x1ec)||typeof _0x9ddc1===_0x54df84(0x204)||typeof _0x9ddc1===_0x54df84(0x1f5);}
@@ -1 +1 @@
1
- const a39_0xfbde82=a39_0x41ec;function a39_0x41ec(_0x588590,_0x12356d){_0x588590=_0x588590-0x15a;const _0x2df6cf=a39_0x2df6();let _0x41ecd2=_0x2df6cf[_0x588590];return _0x41ecd2;}function a39_0x2df6(){const _0x3ebd5a=['List\x20locally\x20imported\x20Service\x20Tree\x20manifests','report','file','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','errors','Removed\x20service\x20','Local\x20service\x20not\x20found:\x20','filePath','hash','kind','source','commands','imported','list','Service\x20manifest\x20validation\x20passed.','entries','567LxhBdk','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','34446VWcRng','486200ITMiTg','detail','str','Local\x20service\x20code,\x20for\x20example\x20crm','read','manifest','flags','lower\x20kebab-case\x20service\x20code','length','Imported','entry','cliName','remove','map','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','type','serviceCount','description','normalizedManifest','updated','replaced','service','cliPath','target','version','string','\x20service(s).','risk','30906GQstGc','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','registryIndex','registry','Exported\x20service\x20','manifests','Service\x20registry\x20validation\x20passed.','\x20service(s),\x20updated\x20','registryPath','warnings','3208UsJNQo','14PmuLsR','260612ZnyhIY','write','import','serviceCode','required','1352055giEfDC','34922xTYcLP','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','WRITE','validate','6993DNIJRL','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest'];a39_0x2df6=function(){return _0x3ebd5a;};return a39_0x2df6();}(function(_0x4f750d,_0x52fe0b){const _0x2a74c9=a39_0x41ec,_0x5cce96=_0x4f750d();while(!![]){try{const _0x1a9178=-parseInt(_0x2a74c9(0x19f))/0x1*(-parseInt(_0x2a74c9(0x15f))/0x2)+-parseInt(_0x2a74c9(0x194))/0x3+-parseInt(_0x2a74c9(0x1a0))/0x4+parseInt(_0x2a74c9(0x15e))/0x5+parseInt(_0x2a74c9(0x177))/0x6*(-parseInt(_0x2a74c9(0x175))/0x7)+-parseInt(_0x2a74c9(0x19e))/0x8*(-parseInt(_0x2a74c9(0x163))/0x9)+-parseInt(_0x2a74c9(0x178))/0xa;if(_0x1a9178===_0x52fe0b)break;else _0x5cce96['push'](_0x5cce96['shift']());}catch(_0x218be0){_0x5cce96['push'](_0x5cce96['shift']());}}}(a39_0x2df6,0x39f22));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0xfbde82(0x167),'type':a39_0xfbde82(0x191),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a39_0xfbde82(0x18d),'type':a39_0xfbde82(0x191),'required':!![],'description':a39_0xfbde82(0x17b),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0xfbde82(0x17f)}};function summarizeService(_0x512ab6){const _0x5ef7ef=a39_0xfbde82;return{'serviceCode':_0x512ab6[_0x5ef7ef(0x15c)],'name':_0x512ab6[_0x5ef7ef(0x18a)]['service']['name'],'version':_0x512ab6['version'],'importedAt':_0x512ab6['importedAt'],'source':_0x512ab6[_0x5ef7ef(0x16f)],'commandCount':_0x512ab6[_0x5ef7ef(0x18a)][_0x5ef7ef(0x170)][_0x5ef7ef(0x180)],'commands':_0x512ab6['normalizedManifest'][_0x5ef7ef(0x170)][_0x5ef7ef(0x185)](_0x3cb2e7=>({'path':_0x3cb2e7['cliPath'],'description':_0x3cb2e7[_0x5ef7ef(0x189)],'risk':_0x3cb2e7[_0x5ef7ef(0x193)],'target':_0x3cb2e7[_0x5ef7ef(0x18f)],'flags':_0x3cb2e7[_0x5ef7ef(0x17e)][_0x5ef7ef(0x185)](_0x672497=>({'name':_0x672497['name'],'cliName':_0x672497[_0x5ef7ef(0x183)],'type':_0x672497[_0x5ef7ef(0x187)],'required':_0x672497[_0x5ef7ef(0x15d)]===!![]}))}))};}function summarizeLoadedManifest(_0x460138){const _0x3c2bf3=a39_0xfbde82;return{'service':_0x460138[_0x3c2bf3(0x18a)]?.[_0x3c2bf3(0x18d)],'version':_0x460138['normalizedManifest']?.[_0x3c2bf3(0x190)],'commandCount':_0x460138[_0x3c2bf3(0x18a)]?.[_0x3c2bf3(0x170)][_0x3c2bf3(0x180)]??0x0,'commands':_0x460138[_0x3c2bf3(0x18a)]?.[_0x3c2bf3(0x170)][_0x3c2bf3(0x185)](_0x157731=>({'path':_0x157731[_0x3c2bf3(0x18e)],'risk':_0x157731[_0x3c2bf3(0x193)],'target':_0x157731[_0x3c2bf3(0x18f)]}))??[],'registryIndex':_0x460138[_0x3c2bf3(0x196)],'registryServiceCode':_0x460138['registryServiceCode'],'errors':_0x460138[_0x3c2bf3(0x166)][_0x3c2bf3(0x169)],'warnings':_0x460138['report']['warnings']};}export const serviceDefinitions=[{'service':a39_0xfbde82(0x18d),'command':a39_0xfbde82(0x162),'description':a39_0xfbde82(0x168),'risk':a39_0xfbde82(0x17c),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4ae283){const _0x56c36a=a39_0xfbde82,_0x4f2f49=loadServiceManifestFromFile(_0x4ae283[_0x56c36a(0x17a)]('file'));if(!_0x4f2f49[_0x56c36a(0x166)]['ok'])return{'ok':![],'data':{'file':_0x4f2f49[_0x56c36a(0x16c)],'hash':_0x4f2f49[_0x56c36a(0x16d)],'kind':_0x4f2f49[_0x56c36a(0x16e)],'serviceCount':_0x4f2f49['manifests']['length'],'services':_0x4f2f49[_0x56c36a(0x199)][_0x56c36a(0x185)](summarizeLoadedManifest),'errors':_0x4f2f49[_0x56c36a(0x166)][_0x56c36a(0x169)],'warnings':_0x4f2f49[_0x56c36a(0x166)][_0x56c36a(0x19d)]},'message':formatValidationFailure(_0x4f2f49['report'])};if(_0x4f2f49[_0x56c36a(0x16e)]===_0x56c36a(0x197)||_0x4f2f49[_0x56c36a(0x199)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x4f2f49[_0x56c36a(0x16c)],'hash':_0x4f2f49[_0x56c36a(0x16d)],'kind':_0x4f2f49[_0x56c36a(0x16e)],'serviceCount':_0x4f2f49[_0x56c36a(0x199)][_0x56c36a(0x180)],'commandCount':_0x4f2f49[_0x56c36a(0x199)]['reduce']((_0x2fc362,_0x1b95c7)=>_0x2fc362+(_0x1b95c7[_0x56c36a(0x18a)]?.['commands'][_0x56c36a(0x180)]??0x0),0x0),'services':_0x4f2f49[_0x56c36a(0x199)][_0x56c36a(0x185)](summarizeLoadedManifest),'warnings':_0x4f2f49[_0x56c36a(0x166)][_0x56c36a(0x19d)]},'message':_0x56c36a(0x19a)};return{'ok':!![],'data':{'file':_0x4f2f49[_0x56c36a(0x16c)],'hash':_0x4f2f49['hash'],'kind':_0x4f2f49[_0x56c36a(0x16e)],'service':_0x4f2f49[_0x56c36a(0x18a)]?.['service'],'version':_0x4f2f49[_0x56c36a(0x18a)]?.[_0x56c36a(0x190)],'commandCount':_0x4f2f49['normalizedManifest']?.['commands'][_0x56c36a(0x180)]??0x0,'commands':_0x4f2f49[_0x56c36a(0x18a)]?.['commands'][_0x56c36a(0x185)](_0x2b12ad=>({'path':_0x2b12ad[_0x56c36a(0x18e)],'risk':_0x2b12ad[_0x56c36a(0x193)],'target':_0x2b12ad[_0x56c36a(0x18f)]})),'warnings':_0x4f2f49[_0x56c36a(0x166)][_0x56c36a(0x19d)]},'message':_0x56c36a(0x173)};}},{'service':a39_0xfbde82(0x18d),'command':a39_0xfbde82(0x15b),'description':'Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x54dac7){const _0x551d8f=a39_0xfbde82,_0x1dfaf9=loadServiceManifestFromFile(_0x54dac7[_0x551d8f(0x17a)](_0x551d8f(0x167)));return{'method':_0x551d8f(0x161),'url':getServiceRegistryPath(),'body':{'file':_0x1dfaf9[_0x551d8f(0x16c)],'hash':_0x1dfaf9[_0x551d8f(0x16d)],'kind':_0x1dfaf9[_0x551d8f(0x16e)],'ok':_0x1dfaf9[_0x551d8f(0x166)]['ok'],'service':_0x1dfaf9[_0x551d8f(0x18a)]?.['service'],'version':_0x1dfaf9[_0x551d8f(0x18a)]?.['version'],'serviceCount':_0x1dfaf9['manifests'][_0x551d8f(0x180)],'services':_0x1dfaf9['manifests'][_0x551d8f(0x185)](_0x5b0055=>({'service':_0x5b0055['normalizedManifest']?.['service'],'version':_0x5b0055['normalizedManifest']?.[_0x551d8f(0x190)],'commandCount':_0x5b0055[_0x551d8f(0x18a)]?.['commands'][_0x551d8f(0x180)]??0x0,'errors':_0x5b0055[_0x551d8f(0x166)][_0x551d8f(0x169)]})),'errors':_0x1dfaf9[_0x551d8f(0x166)][_0x551d8f(0x169)],'commandCount':_0x1dfaf9[_0x551d8f(0x18a)]?.[_0x551d8f(0x170)]['length']??0x0},'description':_0x551d8f(0x186)};},async 'execute'(_0x527618){const _0xd3b217=a39_0xfbde82,_0x4cba31=importServiceManifest(_0x527618['str'](_0xd3b217(0x167)));if(_0x4cba31[_0xd3b217(0x174)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x4cba31['registryPath'],'imported':_0x4cba31[_0xd3b217(0x171)],'updated':_0x4cba31[_0xd3b217(0x18b)],'serviceCount':_0x4cba31[_0xd3b217(0x188)],'services':_0x4cba31[_0xd3b217(0x174)][_0xd3b217(0x185)](summarizeService)},'message':'Imported\x20'+_0x4cba31['imported']+_0xd3b217(0x19b)+_0x4cba31['updated']+_0xd3b217(0x192)};return{'ok':!![],'data':{'registryPath':_0x4cba31['registryPath'],'replaced':_0x4cba31[_0xd3b217(0x18c)],'imported':_0x4cba31[_0xd3b217(0x171)],'updated':_0x4cba31[_0xd3b217(0x18b)],'serviceCount':_0x4cba31[_0xd3b217(0x188)],'service':summarizeService(_0x4cba31[_0xd3b217(0x182)])},'message':(_0x4cba31['replaced']?'Updated':_0xd3b217(0x181))+'\x20service\x20'+_0x4cba31[_0xd3b217(0x182)]['serviceCode']+'.'};}},{'service':a39_0xfbde82(0x18d),'command':'export','description':a39_0xfbde82(0x176),'risk':a39_0xfbde82(0x15a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x27183e){const _0x36c5a8=a39_0xfbde82,_0x4248e3=getLocalServiceEntry(_0x27183e[_0x36c5a8(0x17a)](_0x36c5a8(0x18d)));return{'method':_0x36c5a8(0x161),'url':_0x27183e[_0x36c5a8(0x17a)](_0x36c5a8(0x167)),'body':{'service':_0x27183e[_0x36c5a8(0x17a)](_0x36c5a8(0x18d)),'found':Boolean(_0x4248e3),'version':_0x4248e3?.[_0x36c5a8(0x190)],'source':_0x4248e3?.[_0x36c5a8(0x16f)]},'description':_0x36c5a8(0x160)};},async 'execute'(_0x5146ec){const _0x105dcc=a39_0xfbde82,_0x1ad72e=exportServiceManifest(_0x5146ec['str'](_0x105dcc(0x18d)),_0x5146ec[_0x105dcc(0x17a)](_0x105dcc(0x167)));return{'ok':!![],'data':{'registryPath':_0x1ad72e[_0x105dcc(0x19c)],'file':_0x1ad72e['filePath'],'service':summarizeService(_0x1ad72e[_0x105dcc(0x182)])},'message':_0x105dcc(0x198)+_0x1ad72e[_0x105dcc(0x182)]['serviceCode']+'.'};}},{'service':a39_0xfbde82(0x18d),'command':a39_0xfbde82(0x172),'description':a39_0xfbde82(0x165),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x2edf93=a39_0xfbde82,_0x2082b7=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x2082b7[_0x2edf93(0x180)],'services':_0x2082b7['map'](summarizeService)}};}},{'service':a39_0xfbde82(0x18d),'command':a39_0xfbde82(0x184),'description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0xfbde82(0x15a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x2a2ddf){const _0x47274e=a39_0xfbde82,_0x50fde6=getLocalServiceEntry(_0x2a2ddf['str']('service'));return{'method':_0x47274e(0x161),'url':getServiceRegistryPath(),'body':{'service':_0x2a2ddf[_0x47274e(0x17a)](_0x47274e(0x18d)),'found':Boolean(_0x50fde6),'version':_0x50fde6?.[_0x47274e(0x190)],'source':_0x50fde6?.[_0x47274e(0x16f)]},'description':_0x47274e(0x195)};},async 'execute'(_0x5337da){const _0xc34bcb=a39_0xfbde82,_0x3180fc=removeServiceManifest(_0x5337da[_0xc34bcb(0x17a)]('service'));return{'ok':!![],'data':{'registryPath':_0x3180fc[_0xc34bcb(0x19c)],'serviceCount':_0x3180fc[_0xc34bcb(0x188)],'service':summarizeService(_0x3180fc[_0xc34bcb(0x182)])},'message':_0xc34bcb(0x16a)+_0x3180fc[_0xc34bcb(0x182)][_0xc34bcb(0x15c)]+'.'};}},{'service':a39_0xfbde82(0x18d),'command':a39_0xfbde82(0x179),'description':a39_0xfbde82(0x164),'risk':a39_0xfbde82(0x17c),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x329458){const _0x47aa33=a39_0xfbde82,_0x2d3b66=getLocalServiceEntry(_0x329458[_0x47aa33(0x17a)](_0x47aa33(0x18d)));if(!_0x2d3b66)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x329458[_0x47aa33(0x17a)](_0x47aa33(0x18d))},'message':_0x47aa33(0x16b)+_0x329458[_0x47aa33(0x17a)](_0x47aa33(0x18d))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2d3b66),'manifest':_0x2d3b66[_0x47aa33(0x17d)],'normalizedManifest':_0x2d3b66[_0x47aa33(0x18a)]}};}}];
1
+ function a39_0x25a9(){const _0x1ea1e3=['registryIndex','target','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','223911MQOCmO','421388OpNcaw','errors','read','4ivMRri','write','registry','152bRFHPj','\x20service(s).','1963731VgHtYZ','cliName','entries','updated','reduce','source','import','Updated','description','Local\x20service\x20not\x20found:\x20','normalizedManifest','serviceCode','Service\x20manifest\x20validation\x20passed.','manifest','1698798ioMDOF','58070bgjEyS','1177284vAsDTg','hash','4367TMmHKn','\x20service(s),\x20updated\x20','WRITE','name','cliPath','manifests','kind','entry','detail','map','remove','Imported\x20','validate','Exported\x20service\x20','lower\x20kebab-case\x20service\x20code','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','version','342780dvRuMh','file','export','required','Service\x20Tree\x20manifest\x20file\x20path','type','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','replaced','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','str','registryPath','imported','length','Imported','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','string','service','report','5mKKRIe','filePath','commands','serviceCount','flags','warnings','risk','Local\x20service\x20code,\x20for\x20example\x20crm'];a39_0x25a9=function(){return _0x1ea1e3;};return a39_0x25a9();}const a39_0x4e6adb=a39_0xa392;(function(_0x33f029,_0x260842){const _0x4f80a2=a39_0xa392,_0x3bb970=_0x33f029();while(!![]){try{const _0xd5f771=-parseInt(_0x4f80a2(0x180))/0x1+-parseInt(_0x4f80a2(0x162))/0x2+-parseInt(_0x4f80a2(0x14f))/0x3*(parseInt(_0x4f80a2(0x183))/0x4)+parseInt(_0x4f80a2(0x174))/0x5*(-parseInt(_0x4f80a2(0x14d))/0x6)+-parseInt(_0x4f80a2(0x188))/0x7+parseInt(_0x4f80a2(0x186))/0x8*(-parseInt(_0x4f80a2(0x17f))/0x9)+-parseInt(_0x4f80a2(0x14e))/0xa*(-parseInt(_0x4f80a2(0x151))/0xb);if(_0xd5f771===_0x260842)break;else _0x3bb970['push'](_0x3bb970['shift']());}catch(_0x188f0e){_0x3bb970['push'](_0x3bb970['shift']());}}}(a39_0x25a9,0x4549e));function a39_0xa392(_0x1f05e9,_0x49319e){_0x1f05e9=_0x1f05e9-0x144;const _0x25a97d=a39_0x25a9();let _0xa39263=_0x25a97d[_0x1f05e9];return _0xa39263;}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x4e6adb(0x163),'type':a39_0x4e6adb(0x171),'required':!![],'description':a39_0x4e6adb(0x166)},SERVICE_FLAG={'name':a39_0x4e6adb(0x172),'type':a39_0x4e6adb(0x171),'required':!![],'description':a39_0x4e6adb(0x17b),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x4e6adb(0x15f)}};function summarizeService(_0x56e653){const _0xcca6e6=a39_0x4e6adb;return{'serviceCode':_0x56e653[_0xcca6e6(0x14a)],'name':_0x56e653[_0xcca6e6(0x149)][_0xcca6e6(0x172)][_0xcca6e6(0x154)],'version':_0x56e653[_0xcca6e6(0x161)],'importedAt':_0x56e653['importedAt'],'source':_0x56e653[_0xcca6e6(0x144)],'commandCount':_0x56e653['normalizedManifest'][_0xcca6e6(0x176)][_0xcca6e6(0x16e)],'commands':_0x56e653[_0xcca6e6(0x149)]['commands'][_0xcca6e6(0x15a)](_0x1bcd0a=>({'path':_0x1bcd0a[_0xcca6e6(0x155)],'description':_0x1bcd0a[_0xcca6e6(0x147)],'risk':_0x1bcd0a[_0xcca6e6(0x17a)],'target':_0x1bcd0a[_0xcca6e6(0x17d)],'flags':_0x1bcd0a[_0xcca6e6(0x178)]['map'](_0x3ea0c5=>({'name':_0x3ea0c5[_0xcca6e6(0x154)],'cliName':_0x3ea0c5[_0xcca6e6(0x189)],'type':_0x3ea0c5[_0xcca6e6(0x167)],'required':_0x3ea0c5[_0xcca6e6(0x165)]===!![]}))}))};}function summarizeLoadedManifest(_0x37701e){const _0x5d653c=a39_0x4e6adb;return{'service':_0x37701e['normalizedManifest']?.[_0x5d653c(0x172)],'version':_0x37701e['normalizedManifest']?.['version'],'commandCount':_0x37701e[_0x5d653c(0x149)]?.[_0x5d653c(0x176)][_0x5d653c(0x16e)]??0x0,'commands':_0x37701e[_0x5d653c(0x149)]?.[_0x5d653c(0x176)][_0x5d653c(0x15a)](_0x2f2312=>({'path':_0x2f2312['cliPath'],'risk':_0x2f2312[_0x5d653c(0x17a)],'target':_0x2f2312[_0x5d653c(0x17d)]}))??[],'registryIndex':_0x37701e[_0x5d653c(0x17c)],'registryServiceCode':_0x37701e['registryServiceCode'],'errors':_0x37701e[_0x5d653c(0x173)][_0x5d653c(0x181)],'warnings':_0x37701e[_0x5d653c(0x173)][_0x5d653c(0x179)]};}export const serviceDefinitions=[{'service':a39_0x4e6adb(0x172),'command':a39_0x4e6adb(0x15d),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a39_0x4e6adb(0x182),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4e4959){const _0x7d6c8c=a39_0x4e6adb,_0x42eb2c=loadServiceManifestFromFile(_0x4e4959[_0x7d6c8c(0x16b)](_0x7d6c8c(0x163)));if(!_0x42eb2c[_0x7d6c8c(0x173)]['ok'])return{'ok':![],'data':{'file':_0x42eb2c[_0x7d6c8c(0x175)],'hash':_0x42eb2c[_0x7d6c8c(0x150)],'kind':_0x42eb2c[_0x7d6c8c(0x157)],'serviceCount':_0x42eb2c[_0x7d6c8c(0x156)][_0x7d6c8c(0x16e)],'services':_0x42eb2c[_0x7d6c8c(0x156)]['map'](summarizeLoadedManifest),'errors':_0x42eb2c[_0x7d6c8c(0x173)][_0x7d6c8c(0x181)],'warnings':_0x42eb2c[_0x7d6c8c(0x173)]['warnings']},'message':formatValidationFailure(_0x42eb2c[_0x7d6c8c(0x173)])};if(_0x42eb2c[_0x7d6c8c(0x157)]===_0x7d6c8c(0x185)||_0x42eb2c['manifests'][_0x7d6c8c(0x16e)]!==0x1)return{'ok':!![],'data':{'file':_0x42eb2c['filePath'],'hash':_0x42eb2c[_0x7d6c8c(0x150)],'kind':_0x42eb2c[_0x7d6c8c(0x157)],'serviceCount':_0x42eb2c['manifests'][_0x7d6c8c(0x16e)],'commandCount':_0x42eb2c[_0x7d6c8c(0x156)][_0x7d6c8c(0x18c)]((_0x76490c,_0x3a4833)=>_0x76490c+(_0x3a4833[_0x7d6c8c(0x149)]?.[_0x7d6c8c(0x176)][_0x7d6c8c(0x16e)]??0x0),0x0),'services':_0x42eb2c[_0x7d6c8c(0x156)][_0x7d6c8c(0x15a)](summarizeLoadedManifest),'warnings':_0x42eb2c['report']['warnings']},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x42eb2c[_0x7d6c8c(0x175)],'hash':_0x42eb2c[_0x7d6c8c(0x150)],'kind':_0x42eb2c[_0x7d6c8c(0x157)],'service':_0x42eb2c[_0x7d6c8c(0x149)]?.[_0x7d6c8c(0x172)],'version':_0x42eb2c['normalizedManifest']?.[_0x7d6c8c(0x161)],'commandCount':_0x42eb2c['normalizedManifest']?.[_0x7d6c8c(0x176)]['length']??0x0,'commands':_0x42eb2c[_0x7d6c8c(0x149)]?.['commands']['map'](_0xd3e86e=>({'path':_0xd3e86e[_0x7d6c8c(0x155)],'risk':_0xd3e86e['risk'],'target':_0xd3e86e[_0x7d6c8c(0x17d)]})),'warnings':_0x42eb2c[_0x7d6c8c(0x173)]['warnings']},'message':_0x7d6c8c(0x14b)};}},{'service':a39_0x4e6adb(0x172),'command':a39_0x4e6adb(0x145),'description':a39_0x4e6adb(0x16a),'risk':a39_0x4e6adb(0x184),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x3a2fd0){const _0x5c6190=a39_0x4e6adb,_0x2a30bc=loadServiceManifestFromFile(_0x3a2fd0[_0x5c6190(0x16b)]('file'));return{'method':_0x5c6190(0x153),'url':getServiceRegistryPath(),'body':{'file':_0x2a30bc[_0x5c6190(0x175)],'hash':_0x2a30bc[_0x5c6190(0x150)],'kind':_0x2a30bc['kind'],'ok':_0x2a30bc[_0x5c6190(0x173)]['ok'],'service':_0x2a30bc[_0x5c6190(0x149)]?.[_0x5c6190(0x172)],'version':_0x2a30bc['normalizedManifest']?.[_0x5c6190(0x161)],'serviceCount':_0x2a30bc['manifests'][_0x5c6190(0x16e)],'services':_0x2a30bc[_0x5c6190(0x156)][_0x5c6190(0x15a)](_0x25c79d=>({'service':_0x25c79d[_0x5c6190(0x149)]?.[_0x5c6190(0x172)],'version':_0x25c79d['normalizedManifest']?.['version'],'commandCount':_0x25c79d[_0x5c6190(0x149)]?.[_0x5c6190(0x176)]['length']??0x0,'errors':_0x25c79d[_0x5c6190(0x173)][_0x5c6190(0x181)]})),'errors':_0x2a30bc[_0x5c6190(0x173)][_0x5c6190(0x181)],'commandCount':_0x2a30bc['normalizedManifest']?.[_0x5c6190(0x176)][_0x5c6190(0x16e)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x3ad533){const _0x2824c8=a39_0x4e6adb,_0x2927ec=importServiceManifest(_0x3ad533['str'](_0x2824c8(0x163)));if(_0x2927ec[_0x2824c8(0x18a)][_0x2824c8(0x16e)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x2927ec[_0x2824c8(0x16c)],'imported':_0x2927ec[_0x2824c8(0x16d)],'updated':_0x2927ec['updated'],'serviceCount':_0x2927ec['serviceCount'],'services':_0x2927ec[_0x2824c8(0x18a)]['map'](summarizeService)},'message':_0x2824c8(0x15c)+_0x2927ec[_0x2824c8(0x16d)]+_0x2824c8(0x152)+_0x2927ec[_0x2824c8(0x18b)]+_0x2824c8(0x187)};return{'ok':!![],'data':{'registryPath':_0x2927ec[_0x2824c8(0x16c)],'replaced':_0x2927ec[_0x2824c8(0x169)],'imported':_0x2927ec['imported'],'updated':_0x2927ec[_0x2824c8(0x18b)],'serviceCount':_0x2927ec[_0x2824c8(0x177)],'service':summarizeService(_0x2927ec['entry'])},'message':(_0x2927ec[_0x2824c8(0x169)]?_0x2824c8(0x146):_0x2824c8(0x16f))+'\x20service\x20'+_0x2927ec['entry'][_0x2824c8(0x14a)]+'.'};}},{'service':a39_0x4e6adb(0x172),'command':a39_0x4e6adb(0x164),'description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a39_0x4e6adb(0x184),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x2e4268){const _0x252626=a39_0x4e6adb,_0x1af9cf=getLocalServiceEntry(_0x2e4268[_0x252626(0x16b)](_0x252626(0x172)));return{'method':_0x252626(0x153),'url':_0x2e4268[_0x252626(0x16b)]('file'),'body':{'service':_0x2e4268['str']('service'),'found':Boolean(_0x1af9cf),'version':_0x1af9cf?.[_0x252626(0x161)],'source':_0x1af9cf?.[_0x252626(0x144)]},'description':_0x252626(0x168)};},async 'execute'(_0x592446){const _0x43d6e3=a39_0x4e6adb,_0x419c8a=exportServiceManifest(_0x592446[_0x43d6e3(0x16b)](_0x43d6e3(0x172)),_0x592446[_0x43d6e3(0x16b)]('file'));return{'ok':!![],'data':{'registryPath':_0x419c8a[_0x43d6e3(0x16c)],'file':_0x419c8a[_0x43d6e3(0x175)],'service':summarizeService(_0x419c8a[_0x43d6e3(0x158)])},'message':_0x43d6e3(0x15e)+_0x419c8a['entry']['serviceCode']+'.'};}},{'service':'service','command':'list','description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a39_0x4e6adb(0x182),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x1614ef=a39_0x4e6adb,_0x9e788b=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x9e788b[_0x1614ef(0x16e)],'services':_0x9e788b[_0x1614ef(0x15a)](summarizeService)}};}},{'service':a39_0x4e6adb(0x172),'command':a39_0x4e6adb(0x15b),'description':a39_0x4e6adb(0x17e),'risk':a39_0x4e6adb(0x184),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x4e2145){const _0x3f3369=a39_0x4e6adb,_0x2775d1=getLocalServiceEntry(_0x4e2145['str'](_0x3f3369(0x172)));return{'method':_0x3f3369(0x153),'url':getServiceRegistryPath(),'body':{'service':_0x4e2145[_0x3f3369(0x16b)]('service'),'found':Boolean(_0x2775d1),'version':_0x2775d1?.[_0x3f3369(0x161)],'source':_0x2775d1?.[_0x3f3369(0x144)]},'description':_0x3f3369(0x160)};},async 'execute'(_0x1915a2){const _0x3fcd3b=a39_0x4e6adb,_0x3f9663=removeServiceManifest(_0x1915a2[_0x3fcd3b(0x16b)](_0x3fcd3b(0x172)));return{'ok':!![],'data':{'registryPath':_0x3f9663[_0x3fcd3b(0x16c)],'serviceCount':_0x3f9663[_0x3fcd3b(0x177)],'service':summarizeService(_0x3f9663['entry'])},'message':'Removed\x20service\x20'+_0x3f9663[_0x3fcd3b(0x158)][_0x3fcd3b(0x14a)]+'.'};}},{'service':a39_0x4e6adb(0x172),'command':a39_0x4e6adb(0x159),'description':a39_0x4e6adb(0x170),'risk':a39_0x4e6adb(0x182),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x557503){const _0x555604=a39_0x4e6adb,_0x11a90a=getLocalServiceEntry(_0x557503['str'](_0x555604(0x172)));if(!_0x11a90a)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x557503[_0x555604(0x16b)](_0x555604(0x172))},'message':_0x555604(0x148)+_0x557503[_0x555604(0x16b)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x11a90a),'manifest':_0x11a90a[_0x555604(0x14c)],'normalizedManifest':_0x11a90a[_0x555604(0x149)]}};}}];