@lovrabet/lovrabet-cli 2.1.8-beta.1 → 2.1.8-beta.3

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_0x5f2252=a30_0x3991;function a30_0x3991(_0xd06284,_0x5634f3){_0xd06284=_0xd06284-0x125;const _0x3008a5=a30_0x3008();let _0x399160=_0x3008a5[_0xd06284];return _0x399160;}(function(_0x5a55a8,_0x3affc){const _0x22e19c=a30_0x3991,_0x22ae0b=_0x5a55a8();while(!![]){try{const _0x27c72a=parseInt(_0x22e19c(0x13e))/0x1*(parseInt(_0x22e19c(0x13c))/0x2)+parseInt(_0x22e19c(0x13a))/0x3*(-parseInt(_0x22e19c(0x131))/0x4)+parseInt(_0x22e19c(0x130))/0x5+-parseInt(_0x22e19c(0x12e))/0x6*(parseInt(_0x22e19c(0x149))/0x7)+-parseInt(_0x22e19c(0x132))/0x8*(parseInt(_0x22e19c(0x12b))/0x9)+parseInt(_0x22e19c(0x139))/0xa*(-parseInt(_0x22e19c(0x135))/0xb)+parseInt(_0x22e19c(0x128))/0xc;if(_0x27c72a===_0x3affc)break;else _0x22ae0b['push'](_0x22ae0b['shift']());}catch(_0x589ee4){_0x22ae0b['push'](_0x22ae0b['shift']());}}}(a30_0x3008,0xad73f));function a30_0x3008(){const _0x3c78e8=['36944NmTPSy','str','71NYjMcb','write','POST','bool','filePath','path','\x20to\x20runtime\x20app\x20','string','trim','validation','Uploaded\x20file:\x20','553IOoSXo','boolean','body','File','27191736MbXYfy','filepath','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','8943327tAuDBj','build','upload','90042sRNPPC','query-url','2569960xucsYh','75892SUaJwR','8imyEhF','/client/uploadFile','appCode','71698OEZdHm','filePath\x20is\x20required.','description','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported','1640qlVTSw','21koCeny','file'];a30_0x3008=function(){return _0x3c78e8;};return a30_0x3008();}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_0x5f2252(0x13b),'type':a30_0x5f2252(0x145),'required':!![],'description':'Path\x20to\x20the\x20local\x20file\x20to\x20upload'},FILEPATH_FLAG={'name':a30_0x5f2252(0x129),'type':a30_0x5f2252(0x145),'required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload'},DOWNLOAD_FLAG={'name':'download','type':a30_0x5f2252(0x125),'description':a30_0x5f2252(0x138)};function requireFilePath(_0x4c1fcd){const _0x10b60b=a30_0x5f2252,_0xd925f2=_0x4c1fcd[_0x10b60b(0x146)]();if(!_0xd925f2)throw CliErrors[_0x10b60b(0x147)](_0x10b60b(0x136));return _0xd925f2;}const fileUpload={'service':a30_0x5f2252(0x13b),'command':a30_0x5f2252(0x12d),'description':'Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','risk':a30_0x5f2252(0x13f),'flags':[FILE_FLAG],async 'dryRun'(_0x128ee7){const _0x167abe=a30_0x5f2252,_0x197ee4=requireRuntimeUploadFile(_0x128ee7[_0x167abe(0x13d)]('file'),'File');return dryRun(_0x167abe(0x140),_0x167abe(0x133))[_0x167abe(0x126)]({'appCode':_0x128ee7[_0x167abe(0x134)],'multipart':{'file':_0x197ee4}})[_0x167abe(0x137)]('Preview:\x20upload\x20'+_0x197ee4[_0x167abe(0x143)]+_0x167abe(0x144)+_0x128ee7[_0x167abe(0x134)])[_0x167abe(0x12c)]();},async 'execute'(_0x16b4e6){const _0xfd1005=a30_0x5f2252,_0xa2896f=requireRuntimeUploadFile(_0x16b4e6['str'](_0xfd1005(0x13b)),_0xfd1005(0x127)),_0x5ad0e0=await uploadRuntimeFile(_0x16b4e6[_0xfd1005(0x134)],_0xa2896f['path']);return{'ok':!![],'data':_0x5ad0e0,'message':_0x5ad0e0[_0xfd1005(0x142)]?_0xfd1005(0x148)+_0x5ad0e0[_0xfd1005(0x142)]:'Uploaded\x20file.'};}},fileQueryUrl={'service':'file','command':a30_0x5f2252(0x12f),'description':a30_0x5f2252(0x12a),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x15b622){const _0x266ae4=a30_0x5f2252,_0x5c3c5f=requireFilePath(_0x15b622[_0x266ae4(0x13d)]('filepath')),_0x70fe03=await queryRuntimeFileUrl(_0x5c3c5f,{'download':_0x15b622[_0x266ae4(0x141)]('download')});return{'ok':!![],'data':_0x70fe03};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
1
+ const a30_0x2639da=a30_0x328a;(function(_0x330468,_0xcadbe2){const _0x45df02=a30_0x328a,_0x324d25=_0x330468();while(!![]){try{const _0x4edc0b=-parseInt(_0x45df02(0x102))/0x1*(-parseInt(_0x45df02(0x110))/0x2)+-parseInt(_0x45df02(0xf2))/0x3+parseInt(_0x45df02(0x105))/0x4*(-parseInt(_0x45df02(0x10f))/0x5)+-parseInt(_0x45df02(0x107))/0x6*(parseInt(_0x45df02(0xfb))/0x7)+parseInt(_0x45df02(0xf5))/0x8*(-parseInt(_0x45df02(0xef))/0x9)+-parseInt(_0x45df02(0x10c))/0xa+parseInt(_0x45df02(0xf0))/0xb;if(_0x4edc0b===_0xcadbe2)break;else _0x324d25['push'](_0x324d25['shift']());}catch(_0x4db4fe){_0x324d25['push'](_0x324d25['shift']());}}}(a30_0x2d57,0x7001e));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a30_0x328a(_0x27ec60,_0x314cc9){_0x27ec60=_0x27ec60-0xef;const _0x2d5734=a30_0x2d57();let _0x328a9e=_0x2d5734[_0x27ec60];return _0x328a9e;}import{dryRun}from'../../framework/dryrun.js';function a30_0x2d57(){const _0x4430d7=['\x20to\x20runtime\x20app\x20','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported','appCode','8330730udHgVT','File','upload','313055NaRFAX','8YRuHud','Preview:\x20upload\x20','bool','boolean','Path\x20to\x20the\x20local\x20file\x20to\x20upload','9KiXNuW','29232412rDRUQC','Uploaded\x20file.','254199OsYWai','query-url','str','3832328bNfSvy','filePath\x20is\x20required.','download','Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','path','Runtime\x20filePath\x20returned\x20by\x20file\x20upload','7014HctVdv','/client/uploadFile','filePath','file','string','description','POST','50636zfueOA','validation','build','28urBRgg','trim','3390wdKErl','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file'];a30_0x2d57=function(){return _0x4430d7;};return a30_0x2d57();}const FILE_FLAG={'name':a30_0x2639da(0xfe),'type':a30_0x2639da(0xff),'required':!![],'description':a30_0x2639da(0x114)},FILEPATH_FLAG={'name':'filepath','type':'string','required':!![],'description':a30_0x2639da(0xfa)},DOWNLOAD_FLAG={'name':'download','type':a30_0x2639da(0x113),'description':a30_0x2639da(0x10a)};function requireFilePath(_0x5c585a){const _0x4eb14b=a30_0x2639da,_0x572bb4=_0x5c585a[_0x4eb14b(0x106)]();if(!_0x572bb4)throw CliErrors[_0x4eb14b(0x103)](_0x4eb14b(0xf6));return _0x572bb4;}const fileUpload={'service':a30_0x2639da(0xfe),'command':a30_0x2639da(0x10e),'description':a30_0x2639da(0xf8),'risk':'write','flags':[FILE_FLAG],async 'dryRun'(_0x730e47){const _0x5367f6=a30_0x2639da,_0x18bbce=requireRuntimeUploadFile(_0x730e47[_0x5367f6(0xf4)](_0x5367f6(0xfe)),'File');return dryRun(_0x5367f6(0x101),_0x5367f6(0xfc))['body']({'appCode':_0x730e47[_0x5367f6(0x10b)],'multipart':{'file':_0x18bbce}})[_0x5367f6(0x100)](_0x5367f6(0x111)+_0x18bbce['path']+_0x5367f6(0x109)+_0x730e47[_0x5367f6(0x10b)])[_0x5367f6(0x104)]();},async 'execute'(_0x42aa78){const _0x39ae21=a30_0x2639da,_0x3eaf5e=requireRuntimeUploadFile(_0x42aa78[_0x39ae21(0xf4)]('file'),_0x39ae21(0x10d)),_0x5ee1b1=await uploadRuntimeFile(_0x42aa78[_0x39ae21(0x10b)],_0x3eaf5e[_0x39ae21(0xf9)]);return{'ok':!![],'data':_0x5ee1b1,'message':_0x5ee1b1[_0x39ae21(0xfd)]?'Uploaded\x20file:\x20'+_0x5ee1b1['filePath']:_0x39ae21(0xf1)};}},fileQueryUrl={'service':a30_0x2639da(0xfe),'command':a30_0x2639da(0xf3),'description':a30_0x2639da(0x108),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x68f09d){const _0x2970f4=a30_0x2639da,_0x21b91d=requireFilePath(_0x68f09d['str']('filepath')),_0x1d09f0=await queryRuntimeFileUrl(_0x21b91d,{'download':_0x68f09d[_0x2970f4(0x112)](_0x2970f4(0xf7))});return{'ok':!![],'data':_0x1d09f0};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
1
- function a31_0x27b7(){const _0x2a8713=['string','\x20\x20env:\x20\x20\x20\x20\x20','Usage:\x20','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','message','question','Initialized\x20','[y/N]','riskLevel','4JyWjZG','yes','validation','615339yXKpjW','[Y/n]','log','appcode','1043441dDLrLb','\x20init\x20—\x20Create\x20','SIGINT','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','1501089QdRBCK','global','stdin','App\x20code\x20cannot\x20be\x20empty.','117XvDXLS','):\x20','apiDir','removeListener','Skip\x20confirmation\x20when\x20overwriting','5254689uUmJET','App\x20code','app','209320OhUIaC','791712DRzkbX','\x20already\x20exists.\x20Overwrite?','Override\x20imported\x20default\x20appcode','newConfigFileName','defaultApp','4kNmKxc','16lstNiE','Write\x20to\x20global\x20(~/','\x20\x20appcode:\x20','User\x20aborted\x20prompt','apps','\x20\x20config:\x20\x20','App\x20code\x20for\x20the\x20project','\x20\x20default:\x20','\x22.\x20Allowed:\x20','entries','1881708xWgaJD','File\x20','close','50vfofHH','boolean',')\x20instead\x20of\x20project','race','Aborted.','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','AbortPrompt','Source\x20file\x20not\x20found:\x20','trim','parse','utf8','Invalid\x20env\x20\x22','once','Failed\x20to\x20parse\x20source\x20file:\x20','\x0aInitialized\x20','join','env','Target\x20environment\x20(default\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','5cCkpJN'];a31_0x27b7=function(){return _0x2a8713;};return a31_0x27b7();}const a31_0x1e6d44=a31_0x3d9c;(function(_0x19e672,_0x6bd5e5){const _0x5d5aa4=a31_0x3d9c,_0x40a37e=_0x19e672();while(!![]){try{const _0x28e3fd=-parseInt(_0x5d5aa4(0x10e))/0x1*(-parseInt(_0x5d5aa4(0xf7))/0x2)+parseInt(_0x5d5aa4(0x102))/0x3*(-parseInt(_0x5d5aa4(0x114))/0x4)+parseInt(_0x5d5aa4(0xed))/0x5*(parseInt(_0x5d5aa4(0x11f))/0x6)+-parseInt(_0x5d5aa4(0xfe))/0x7*(parseInt(_0x5d5aa4(0x115))/0x8)+parseInt(_0x5d5aa4(0xfa))/0x9*(parseInt(_0x5d5aa4(0x122))/0xa)+-parseInt(_0x5d5aa4(0x10b))/0xb+parseInt(_0x5d5aa4(0x10f))/0xc*(parseInt(_0x5d5aa4(0x106))/0xd);if(_0x28e3fd===_0x6bd5e5)break;else _0x40a37e['push'](_0x40a37e['shift']());}catch(_0x2d5090){_0x40a37e['push'](_0x40a37e['shift']());}}}(a31_0x27b7,0x5fa1d));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_0x1e6d44(0xfd),'type':a31_0x1e6d44(0xee),'description':a31_0x1e6d44(0x11b)},{'name':a31_0x1e6d44(0xea),'type':'string','description':a31_0x1e6d44(0xeb)+DEFAULT_CONFIG_VALUES[a31_0x1e6d44(0xea)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1e6d44(0x103),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x1e6d44(0x112)]+a31_0x1e6d44(0x124),'default':![]},{'name':a31_0x1e6d44(0xf8),'type':a31_0x1e6d44(0x123),'description':a31_0x1e6d44(0x10a),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a31_0x1e6d44(0xee),'description':a31_0x1e6d44(0xec),'required':!![]},{'name':'appcode','type':a31_0x1e6d44(0xee),'description':a31_0x1e6d44(0x111)},{'name':'env','type':a31_0x1e6d44(0xee),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1e6d44(0x103),'type':a31_0x1e6d44(0x123),'description':a31_0x1e6d44(0x116)+PRODUCT_CONFIG[a31_0x1e6d44(0x112)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x1e6d44(0xf8),'type':a31_0x1e6d44(0x123),'description':a31_0x1e6d44(0x10a),'default':![]}];export async function runInit(_0x23d762){const _0x44ce18=a31_0x1e6d44,_0x13805b=isNonInteractiveMode(_0x23d762),_0x2cf825=_0x23d762[_0x44ce18(0x103)]?_0x44ce18(0x103):'project',_0x4315ac=resolveWriteConfigPath(_0x2cf825);try{_0x13805b?await runNonInteractive(_0x23d762,_0x4315ac):await runInteractive(_0x23d762,_0x4315ac);}catch(_0x5bc710){if(_0x5bc710 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x5bc710;}}export async function runInitImport(_0xb285b5){const _0x3cb60f=a31_0x1e6d44,_0x3680eb=_0xb285b5[_0x3cb60f(0x103)]?_0x3cb60f(0x103):'project',_0x373c1c=resolveWriteConfigPath(_0x3680eb);await runFromImport(_0xb285b5,_0x373c1c);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x1e6d44(0x108)]);async function runFromImport(_0x47cf29,_0x537023){const _0x308d68=a31_0x1e6d44,_0x331ded=resolveFilePath(_0x47cf29['file']);if(!existsSync(_0x331ded))throw CliErrors[_0x308d68(0xf9)](_0x308d68(0xe1)+_0x331ded);const _0x372e87=readSourceFile(_0x331ded),_0x365957=convertToRuntimeConfig(_0x372e87);_0x47cf29[_0x308d68(0xfd)]&&(_0x365957[_0x308d68(0xfd)]=String(_0x47cf29[_0x308d68(0xfd)]));_0x47cf29[_0x308d68(0xea)]&&(_0x365957[_0x308d68(0xea)]=resolveInitEnv(_0x47cf29));if(!_0x365957[_0x308d68(0xfd)])throw CliErrors['validation']('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x308d68(0xf1));await writeInitConfig(_0x537023,_0x365957,_0x47cf29),console[_0x308d68(0xfc)]('Imported\x20from\x20'+_0x331ded),console['log'](_0x308d68(0x11a)+_0x537023),console[_0x308d68(0xfc)](_0x308d68(0x117)+_0x365957['appcode']);if(_0x365957[_0x308d68(0x113)])console['log'](_0x308d68(0x11c)+_0x365957['defaultApp']);}function convertToRuntimeConfig(_0x10fe1a){const _0x59ceaf=a31_0x1e6d44;if(_0x10fe1a[_0x59ceaf(0x119)]&&typeof _0x10fe1a[_0x59ceaf(0x119)]==='object')throw CliErrors[_0x59ceaf(0xf9)](_0x59ceaf(0x127),_0x59ceaf(0x128));const _0x34e9d5={};for(const _0x5f7b52 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x10fe1a[_0x5f7b52]!==undefined&&(_0x34e9d5[_0x5f7b52]=_0x10fe1a[_0x5f7b52]);}return!_0x34e9d5['riskLevel']&&(_0x34e9d5[_0x59ceaf(0xf6)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x34e9d5;}async function runNonInteractive(_0x19fdbb,_0x1f4eec){const _0x131899=a31_0x1e6d44,_0x4b8022=_0x19fdbb['appcode'];if(!_0x4b8022)throw CliErrors['flagMissing'](_0x131899(0xfd),_0x131899(0xf0)+CLI_BIN_NAME+_0x131899(0x101));const _0x433dc8=resolveInitEnv(_0x19fdbb);await writeInitConfig(_0x1f4eec,{'appcode':_0x4b8022,'env':_0x433dc8},_0x19fdbb),console[_0x131899(0xfc)](_0x131899(0xf4)+_0x1f4eec),console[_0x131899(0xfc)]('\x20\x20appcode:\x20'+_0x4b8022),console['log'](_0x131899(0xef)+_0x433dc8);}function a31_0x3d9c(_0x3d49ce,_0x2b9e43){_0x3d49ce=_0x3d49ce-0xe0;const _0x27b7d2=a31_0x27b7();let _0x3d9c02=_0x27b7d2[_0x3d49ce];return _0x3d9c02;}async function runInteractive(_0x584c43,_0x56d49f){const _0x539ee4=a31_0x1e6d44,_0x53d688=loadExisting(_0x56d49f),_0x3b7a9c=typeof _0x53d688?.[_0x539ee4(0xfd)]==='string'?_0x53d688[_0x539ee4(0xfd)]:'',_0x18d203=resolveInitEnv(_0x584c43);console[_0x539ee4(0xfc)](CLI_BIN_NAME+_0x539ee4(0xff)+PRODUCT_CONFIG[_0x539ee4(0x112)]+'\x0a');if(existsSync(_0x56d49f)&&!_0x584c43['yes']){const _0x3586d5=await promptYesNo(_0x539ee4(0x120)+_0x56d49f+_0x539ee4(0x110),![]);if(!_0x3586d5){console[_0x539ee4(0xfc)](_0x539ee4(0x126));return;}}const _0x49b4fe=typeof _0x584c43['appcode']==='string'?_0x584c43[_0x539ee4(0xfd)]['trim']():'';let _0x10f2e8=_0x49b4fe;!_0x10f2e8&&(_0x10f2e8=await promptInput(_0x539ee4(0x10c),_0x3b7a9c));if(!_0x10f2e8['trim']())throw CliErrors[_0x539ee4(0xf9)](_0x539ee4(0x105));await writeInitConfig(_0x56d49f,{'appcode':_0x10f2e8[_0x539ee4(0xe2)](),'env':_0x18d203},_0x584c43),console[_0x539ee4(0xfc)](_0x539ee4(0xe8)+_0x56d49f),console[_0x539ee4(0xfc)](_0x539ee4(0x117)+_0x10f2e8[_0x539ee4(0xe2)]()),console[_0x539ee4(0xfc)](_0x539ee4(0xef)+_0x18d203);}async function writeInitConfig(_0x5320ef,_0x46992b,_0x295164){const _0x23f647=a31_0x1e6d44;let _0x5dbdee={};existsSync(_0x5320ef)&&!_0x295164['yes']&&(_0x5dbdee=readConfigFile(_0x5320ef));for(const [_0x3d96a2,_0x2b97eb]of Object[_0x23f647(0x11e)](_0x46992b)){_0x2b97eb!==undefined&&(_0x5dbdee[_0x3d96a2]=_0x2b97eb);}if(_0x5dbdee[_0x23f647(0x10d)])delete _0x5dbdee['app'];writeConfigFile(_0x5320ef,_0x5dbdee);}class AbortPrompt extends Error{constructor(){const _0x1adc18=a31_0x1e6d44;super(_0x1adc18(0x118)),this['name']=_0x1adc18(0xe0);}}function createSafeRl(){const _0x3d58bc=a31_0x1e6d44,_0x30b36=createInterface({'input':process[_0x3d58bc(0x104)],'output':process['stdout']});let _0x160bf1;const _0x513b35=new Promise((_0x2e285c,_0x5214d9)=>{const _0x5e37a0=_0x3d58bc;_0x160bf1=()=>{const _0x53a712=a31_0x3d9c;_0x160bf1&&(_0x30b36[_0x53a712(0x109)]('SIGINT',_0x160bf1),_0x160bf1=undefined);try{_0x30b36['close']();}catch{}_0x5214d9(new AbortPrompt());},_0x30b36[_0x5e37a0(0xe6)](_0x5e37a0(0x100),_0x160bf1);}),_0x30479d=()=>{const _0x23e802=_0x3d58bc;_0x160bf1&&(_0x30b36[_0x23e802(0x109)](_0x23e802(0x100),_0x160bf1),_0x160bf1=undefined);try{_0x30b36[_0x23e802(0x121)]();}catch{}};return{'rl':_0x30b36,'abortPromise':_0x513b35,'disposeSuccess':_0x30479d};}async function promptInput(_0x1c3822,_0x4c96e6){const {rl:_0x364e84,abortPromise:_0x51bce9,disposeSuccess:_0x286e9a}=createSafeRl(),_0x48f6ed=new Promise(_0x594069=>{const _0x1cfe13=a31_0x3d9c,_0x2b8320=_0x4c96e6?'\x20\x20'+_0x1c3822+'\x20('+_0x4c96e6+_0x1cfe13(0x107):'\x20\x20'+_0x1c3822+':\x20';_0x364e84[_0x1cfe13(0xf3)](_0x2b8320,_0x39eae1=>{const _0x9d58a=_0x1cfe13;_0x286e9a(),_0x594069(_0x39eae1[_0x9d58a(0xe2)]()||_0x4c96e6);});});return Promise['race']([_0x48f6ed,_0x51bce9]);}async function promptYesNo(_0x3f600d,_0x381695){const _0x2243d4=a31_0x1e6d44,{rl:_0xb8bb88,abortPromise:_0x13f6fc,disposeSuccess:_0x4d7d33}=createSafeRl(),_0x4a4757=new Promise(_0xc5a8eb=>{const _0x499828=a31_0x3d9c,_0x54d932=_0x381695?_0x499828(0xfb):_0x499828(0xf5);_0xb8bb88[_0x499828(0xf3)]('\x20\x20'+_0x3f600d+'\x20'+_0x54d932+':\x20',_0x238cb1=>{const _0x7bcf3b=_0x499828;_0x4d7d33();const _0x553d30=_0x238cb1[_0x7bcf3b(0xe2)]()['toLowerCase']();if(_0x553d30==='y'||_0x553d30===_0x7bcf3b(0xf8))_0xc5a8eb(!![]);else{if(_0x553d30==='n'||_0x553d30==='no')_0xc5a8eb(![]);else _0xc5a8eb(_0x381695);}});});return Promise[_0x2243d4(0x125)]([_0x4a4757,_0x13f6fc]);}function loadExisting(_0x437c2b){if(!existsSync(_0x437c2b))return null;return readConfigFile(_0x437c2b);}function resolveFilePath(_0x47383c){return isAbsolute(_0x47383c)?_0x47383c:resolve(process['cwd'](),_0x47383c);}function readSourceFile(_0x38d5a4){const _0x208582=a31_0x1e6d44;try{const _0x378ada=readFileSync(_0x38d5a4,{'encoding':_0x208582(0xe4)});return JSON[_0x208582(0xe3)](_0x378ada);}catch(_0x396361){throw CliErrors[_0x208582(0xf9)](_0x208582(0xe7)+_0x396361[_0x208582(0xf2)]);}}function resolveInitEnv(_0x41b7e5){const _0x46e4d5=a31_0x1e6d44,_0x59730c=_0x41b7e5[_0x46e4d5(0xea)];if(_0x59730c===undefined||_0x59730c==='')return DEFAULT_CONFIG_VALUES[_0x46e4d5(0xea)];if(!RUNTIME_ENV_VALUES['includes'](_0x59730c))throw CliErrors['validation'](_0x46e4d5(0xe5)+_0x59730c+_0x46e4d5(0x11d)+RUNTIME_ENV_VALUES[_0x46e4d5(0xe9)](',\x20'));return _0x59730c;}
1
+ const a31_0x1cff7d=a31_0x42ac;(function(_0x1df5f8,_0x525912){const _0x1af7d4=a31_0x42ac,_0x30fc86=_0x1df5f8();while(!![]){try{const _0x2736eb=-parseInt(_0x1af7d4(0x8a))/0x1*(-parseInt(_0x1af7d4(0xab))/0x2)+-parseInt(_0x1af7d4(0x91))/0x3*(parseInt(_0x1af7d4(0xa2))/0x4)+-parseInt(_0x1af7d4(0x83))/0x5*(-parseInt(_0x1af7d4(0x99))/0x6)+-parseInt(_0x1af7d4(0xb7))/0x7*(parseInt(_0x1af7d4(0xc4))/0x8)+-parseInt(_0x1af7d4(0xbe))/0x9+parseInt(_0x1af7d4(0x90))/0xa+parseInt(_0x1af7d4(0xb4))/0xb*(parseInt(_0x1af7d4(0x8c))/0xc);if(_0x2736eb===_0x525912)break;else _0x30fc86['push'](_0x30fc86['shift']());}catch(_0x4d478c){_0x30fc86['push'](_0x30fc86['shift']());}}}(a31_0x4080,0xd7390));import{existsSync,readFileSync}from'node:fs';function a31_0x4080(){const _0x48f01a=['\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','77668qJYCXG','Target\x20environment\x20(default\x20','Failed\x20to\x20parse\x20source\x20file:\x20','Usage:\x20','app','boolean','File\x20','\x20already\x20exists.\x20Overwrite?','once','44UcavfB','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','utf8','602679zkZLlT','newConfigFileName','string','cwd','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','global','name','7252731XBeIQZ','\x22.\x20Allowed:\x20','\x0aInitialized\x20','\x20\x20env:\x20\x20\x20\x20\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','trim','104qXjlhi','Override\x20imported\x20default\x20env','message','App\x20code\x20cannot\x20be\x20empty.','log',')\x20instead\x20of\x20project','project','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`.','Override\x20imported\x20default\x20appcode','Initialized\x20','appcode','\x20init\x20—\x20Create\x20','2871865EYoLRi','[y/N]','AbortPrompt','Imported\x20from\x20','removeListener','User\x20aborted\x20prompt','file','17LivGPU','apps','653316FKaXGD','Write\x20to\x20global\x20(~/','validation','question','16140620PRmRtG','3WAWbjn','App\x20code','\x20\x20config:\x20\x20','stdout','riskLevel','\x20\x20default:\x20','App\x20code\x20for\x20the\x20project','object','6ZLMVTq','yes','SIGINT','\x20\x20appcode:\x20','defaultApp','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','apiDir','[Y/n]','Skip\x20confirmation\x20when\x20overwriting','1038852mRtfBB','):\x20','race','join','close','toLowerCase','env','stdin'];a31_0x4080=function(){return _0x48f01a;};return a31_0x4080();}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':'appcode','type':'string','description':a31_0x1cff7d(0x97)},{'name':a31_0x1cff7d(0xa8),'type':a31_0x1cff7d(0xb9),'description':a31_0x1cff7d(0xac)+DEFAULT_CONFIG_VALUES[a31_0x1cff7d(0xa8)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0x8d)+PRODUCT_CONFIG[a31_0x1cff7d(0xb8)]+a31_0x1cff7d(0xc9),'default':![]},{'name':a31_0x1cff7d(0x9a),'type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0xa1),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x1cff7d(0x89),'type':'string','description':a31_0x1cff7d(0x9e),'required':!![]},{'name':a31_0x1cff7d(0x81),'type':a31_0x1cff7d(0xb9),'description':a31_0x1cff7d(0x7f)},{'name':'env','type':'string','description':a31_0x1cff7d(0xc5),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1cff7d(0xbc),'type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0x8d)+PRODUCT_CONFIG[a31_0x1cff7d(0xb8)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0xa1),'default':![]}];export async function runInit(_0x2df9d2){const _0x972ecb=a31_0x1cff7d,_0x3c8b44=isNonInteractiveMode(_0x2df9d2),_0x13284c=_0x2df9d2[_0x972ecb(0xbc)]?'global':_0x972ecb(0x7d),_0x2bc30d=resolveWriteConfigPath(_0x13284c);try{_0x3c8b44?await runNonInteractive(_0x2df9d2,_0x2bc30d):await runInteractive(_0x2df9d2,_0x2bc30d);}catch(_0x5f0ff4){if(_0x5f0ff4 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x5f0ff4;}}export async function runInitImport(_0x886ce){const _0x8ca5ab=a31_0x1cff7d,_0x3f3c71=_0x886ce['global']?_0x8ca5ab(0xbc):_0x8ca5ab(0x7d),_0x261278=resolveWriteConfigPath(_0x3f3c71);await runFromImport(_0x886ce,_0x261278);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x1cff7d(0x9f)]);async function runFromImport(_0x24e1a4,_0x29d885){const _0x5d111f=a31_0x1cff7d,_0x20cdfa=resolveFilePath(_0x24e1a4[_0x5d111f(0x89)]);if(!existsSync(_0x20cdfa))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x20cdfa);const _0x1af61b=readSourceFile(_0x20cdfa),_0xcebad4=convertToRuntimeConfig(_0x1af61b);_0x24e1a4[_0x5d111f(0x81)]&&(_0xcebad4[_0x5d111f(0x81)]=String(_0x24e1a4[_0x5d111f(0x81)]));_0x24e1a4[_0x5d111f(0xa8)]&&(_0xcebad4[_0x5d111f(0xa8)]=resolveInitEnv(_0x24e1a4));if(!_0xcebad4[_0x5d111f(0x81)])throw CliErrors[_0x5d111f(0x8e)](_0x5d111f(0xc2),_0x5d111f(0x7e));await writeInitConfig(_0x29d885,_0xcebad4,_0x24e1a4),console[_0x5d111f(0xc8)](_0x5d111f(0x86)+_0x20cdfa),console[_0x5d111f(0xc8)](_0x5d111f(0x93)+_0x29d885),console['log']('\x20\x20appcode:\x20'+_0xcebad4[_0x5d111f(0x81)]);if(_0xcebad4[_0x5d111f(0x9d)])console['log'](_0x5d111f(0x96)+_0xcebad4[_0x5d111f(0x9d)]);}function convertToRuntimeConfig(_0x5ebeee){const _0x550c95=a31_0x1cff7d;if(_0x5ebeee[_0x550c95(0x8b)]&&typeof _0x5ebeee['apps']===_0x550c95(0x98))throw CliErrors['validation'](_0x550c95(0xbb),_0x550c95(0xb5));const _0x1de773={};for(const _0x38bd01 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5ebeee[_0x38bd01]!==undefined&&(_0x1de773[_0x38bd01]=_0x5ebeee[_0x38bd01]);}return!_0x1de773[_0x550c95(0x95)]&&(_0x1de773['riskLevel']=DEFAULT_CONFIG_VALUES[_0x550c95(0x95)]),_0x1de773;}async function runNonInteractive(_0x828c2e,_0x3a8390){const _0x35455f=a31_0x1cff7d,_0x2d8c2f=_0x828c2e[_0x35455f(0x81)];if(!_0x2d8c2f)throw CliErrors['flagMissing'](_0x35455f(0x81),_0x35455f(0xae)+CLI_BIN_NAME+_0x35455f(0xaa));const _0x42c3bb=resolveInitEnv(_0x828c2e);await writeInitConfig(_0x3a8390,{'appcode':_0x2d8c2f,'env':_0x42c3bb},_0x828c2e),console[_0x35455f(0xc8)](_0x35455f(0x80)+_0x3a8390),console['log'](_0x35455f(0x9c)+_0x2d8c2f),console[_0x35455f(0xc8)](_0x35455f(0xc1)+_0x42c3bb);}async function runInteractive(_0x2592d1,_0x34cd62){const _0x5ae2a4=a31_0x1cff7d,_0x587e45=loadExisting(_0x34cd62),_0x288e36=typeof _0x587e45?.[_0x5ae2a4(0x81)]==='string'?_0x587e45[_0x5ae2a4(0x81)]:'',_0x4e15de=resolveInitEnv(_0x2592d1);console['log'](CLI_BIN_NAME+_0x5ae2a4(0x82)+PRODUCT_CONFIG[_0x5ae2a4(0xb8)]+'\x0a');if(existsSync(_0x34cd62)&&!_0x2592d1[_0x5ae2a4(0x9a)]){const _0x3a5dd2=await promptYesNo(_0x5ae2a4(0xb1)+_0x34cd62+_0x5ae2a4(0xb2),![]);if(!_0x3a5dd2){console[_0x5ae2a4(0xc8)]('Aborted.');return;}}const _0x2e8b97=typeof _0x2592d1[_0x5ae2a4(0x81)]==='string'?_0x2592d1[_0x5ae2a4(0x81)][_0x5ae2a4(0xc3)]():'';let _0x12519e=_0x2e8b97;!_0x12519e&&(_0x12519e=await promptInput(_0x5ae2a4(0x92),_0x288e36));if(!_0x12519e[_0x5ae2a4(0xc3)]())throw CliErrors[_0x5ae2a4(0x8e)](_0x5ae2a4(0xc7));await writeInitConfig(_0x34cd62,{'appcode':_0x12519e['trim'](),'env':_0x4e15de},_0x2592d1),console[_0x5ae2a4(0xc8)](_0x5ae2a4(0xc0)+_0x34cd62),console[_0x5ae2a4(0xc8)]('\x20\x20appcode:\x20'+_0x12519e[_0x5ae2a4(0xc3)]()),console[_0x5ae2a4(0xc8)](_0x5ae2a4(0xc1)+_0x4e15de);}async function writeInitConfig(_0x28b93b,_0x3115ca,_0x325f5f){const _0x73c48c=a31_0x1cff7d;let _0x3d1b7a={};existsSync(_0x28b93b)&&!_0x325f5f[_0x73c48c(0x9a)]&&(_0x3d1b7a=readConfigFile(_0x28b93b));for(const [_0x562664,_0x4f7c1b]of Object['entries'](_0x3115ca)){_0x4f7c1b!==undefined&&(_0x3d1b7a[_0x562664]=_0x4f7c1b);}if(_0x3d1b7a[_0x73c48c(0xaf)])delete _0x3d1b7a['app'];writeConfigFile(_0x28b93b,_0x3d1b7a);}class AbortPrompt extends Error{constructor(){const _0x2fdafa=a31_0x1cff7d;super(_0x2fdafa(0x88)),this[_0x2fdafa(0xbd)]=_0x2fdafa(0x85);}}function createSafeRl(){const _0x55843f=a31_0x1cff7d,_0x569bcd=createInterface({'input':process[_0x55843f(0xa9)],'output':process[_0x55843f(0x94)]});let _0x352e15;const _0x5fc081=new Promise((_0x427627,_0x1518ae)=>{const _0xe2f3ac=_0x55843f;_0x352e15=()=>{const _0x9e1144=a31_0x42ac;_0x352e15&&(_0x569bcd[_0x9e1144(0x87)](_0x9e1144(0x9b),_0x352e15),_0x352e15=undefined);try{_0x569bcd['close']();}catch{}_0x1518ae(new AbortPrompt());},_0x569bcd[_0xe2f3ac(0xb3)]('SIGINT',_0x352e15);}),_0x21218e=()=>{const _0x52c492=_0x55843f;_0x352e15&&(_0x569bcd['removeListener'](_0x52c492(0x9b),_0x352e15),_0x352e15=undefined);try{_0x569bcd[_0x52c492(0xa6)]();}catch{}};return{'rl':_0x569bcd,'abortPromise':_0x5fc081,'disposeSuccess':_0x21218e};}async function promptInput(_0x4f3cab,_0x1eb537){const _0x2a9c0b=a31_0x1cff7d,{rl:_0x1162ad,abortPromise:_0x4159d2,disposeSuccess:_0x417522}=createSafeRl(),_0x466237=new Promise(_0x2b38db=>{const _0x16143f=a31_0x42ac,_0x75bf6a=_0x1eb537?'\x20\x20'+_0x4f3cab+'\x20('+_0x1eb537+_0x16143f(0xa3):'\x20\x20'+_0x4f3cab+':\x20';_0x1162ad['question'](_0x75bf6a,_0x4fc205=>{const _0x26a0c5=_0x16143f;_0x417522(),_0x2b38db(_0x4fc205[_0x26a0c5(0xc3)]()||_0x1eb537);});});return Promise[_0x2a9c0b(0xa4)]([_0x466237,_0x4159d2]);}async function promptYesNo(_0x5d4068,_0x34503e){const _0x5d1f35=a31_0x1cff7d,{rl:_0x32be7d,abortPromise:_0x581e4b,disposeSuccess:_0x36e7d4}=createSafeRl(),_0x4b0da8=new Promise(_0x151652=>{const _0x46f80f=a31_0x42ac,_0x55fdce=_0x34503e?_0x46f80f(0xa0):_0x46f80f(0x84);_0x32be7d[_0x46f80f(0x8f)]('\x20\x20'+_0x5d4068+'\x20'+_0x55fdce+':\x20',_0x3c4a8d=>{const _0x5b3ca1=_0x46f80f;_0x36e7d4();const _0x8e0752=_0x3c4a8d[_0x5b3ca1(0xc3)]()[_0x5b3ca1(0xa7)]();if(_0x8e0752==='y'||_0x8e0752==='yes')_0x151652(!![]);else{if(_0x8e0752==='n'||_0x8e0752==='no')_0x151652(![]);else _0x151652(_0x34503e);}});});return Promise[_0x5d1f35(0xa4)]([_0x4b0da8,_0x581e4b]);}function a31_0x42ac(_0x2b2814,_0x3e5373){_0x2b2814=_0x2b2814-0x7d;const _0x4080e1=a31_0x4080();let _0x42accf=_0x4080e1[_0x2b2814];return _0x42accf;}function loadExisting(_0x31337d){if(!existsSync(_0x31337d))return null;return readConfigFile(_0x31337d);}function resolveFilePath(_0x95c088){const _0x4b1715=a31_0x1cff7d;return isAbsolute(_0x95c088)?_0x95c088:resolve(process[_0x4b1715(0xba)](),_0x95c088);}function readSourceFile(_0x3d3246){const _0x148d3b=a31_0x1cff7d;try{const _0x1d6e8e=readFileSync(_0x3d3246,{'encoding':_0x148d3b(0xb6)});return JSON['parse'](_0x1d6e8e);}catch(_0x19db0f){throw CliErrors[_0x148d3b(0x8e)](_0x148d3b(0xad)+_0x19db0f[_0x148d3b(0xc6)]);}}function resolveInitEnv(_0x312295){const _0x4be3ce=a31_0x1cff7d,_0x1ad3ec=_0x312295[_0x4be3ce(0xa8)];if(_0x1ad3ec===undefined||_0x1ad3ec==='')return DEFAULT_CONFIG_VALUES[_0x4be3ce(0xa8)];if(!RUNTIME_ENV_VALUES['includes'](_0x1ad3ec))throw CliErrors[_0x4be3ce(0x8e)]('Invalid\x20env\x20\x22'+_0x1ad3ec+_0x4be3ce(0xbf)+RUNTIME_ENV_VALUES[_0x4be3ce(0xa5)](',\x20'));return _0x1ad3ec;}
@@ -1 +1 @@
1
- const a32_0x1bbf3d=a32_0xc8e9;(function(_0x28ced9,_0x2b90a2){const _0x16e1d7=a32_0xc8e9,_0x14d644=_0x28ced9();while(!![]){try{const _0x24ca65=-parseInt(_0x16e1d7(0x18a))/0x1+-parseInt(_0x16e1d7(0x183))/0x2+-parseInt(_0x16e1d7(0x1ae))/0x3+parseInt(_0x16e1d7(0x1a7))/0x4+parseInt(_0x16e1d7(0x180))/0x5*(-parseInt(_0x16e1d7(0x192))/0x6)+parseInt(_0x16e1d7(0x1b6))/0x7+parseInt(_0x16e1d7(0x1a9))/0x8;if(_0x24ca65===_0x2b90a2)break;else _0x14d644['push'](_0x14d644['shift']());}catch(_0x46bd17){_0x14d644['push'](_0x14d644['shift']());}}}(a32_0x2bc8,0x7d77e));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x1bbf3d(0x17e),'type':a32_0x1bbf3d(0x185),'required':!![],'description':a32_0x1bbf3d(0x1a6)},FILE_FLAG={'name':a32_0x1bbf3d(0x1b1),'type':a32_0x1bbf3d(0x185),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':'query','type':a32_0x1bbf3d(0x185),'required':!![],'description':a32_0x1bbf3d(0x1ad)},TOPK_FLAG={'name':a32_0x1bbf3d(0x191),'type':'number','description':a32_0x1bbf3d(0x1a5)};function a32_0xc8e9(_0x42846b,_0x38c874){_0x42846b=_0x42846b-0x17d;const _0x2bc8d2=a32_0x2bc8();let _0xc8e993=_0x2bc8d2[_0x42846b];return _0xc8e993;}function readKnowledgeFile(_0x51dab1){const _0x1f26b6=a32_0x1bbf3d;if(!_0x51dab1)throw CliErrors[_0x1f26b6(0x1a8)](_0x1f26b6(0x1a4));if(!existsSync(_0x51dab1))throw CliErrors[_0x1f26b6(0x1a8)](_0x1f26b6(0x1b2)+_0x51dab1);if(!statSync(_0x51dab1)[_0x1f26b6(0x1ac)]())throw CliErrors[_0x1f26b6(0x1a8)](_0x1f26b6(0x196)+_0x51dab1);return readFileSync(_0x51dab1,'utf8');}function summarizePersonalItem(_0x151835){const _0x23e17b=a32_0x1bbf3d;return{'id':_0x151835['id'],'title':_0x151835[_0x23e17b(0x17e)],'version':_0x151835[_0x23e17b(0x198)],'ragStatus':_0x151835[_0x23e17b(0x1aa)],'ragErrorMessage':_0x151835[_0x23e17b(0x189)],'updateTime':_0x151835[_0x23e17b(0x199)]};}function detailPersonalItem(_0x2e4226){const _0x3e89a0=a32_0x1bbf3d;return{'id':_0x2e4226['id'],'appCode':_0x2e4226['appCode'],'scope':_0x2e4226[_0x3e89a0(0x1b5)],'userId':_0x2e4226[_0x3e89a0(0x19d)],'title':_0x2e4226['title'],'content':_0x2e4226[_0x3e89a0(0x18b)]??'','version':_0x2e4226['version'],'ragStatus':_0x2e4226[_0x3e89a0(0x1aa)],'ragErrorMessage':_0x2e4226['ragErrorMessage'],'createTime':_0x2e4226[_0x3e89a0(0x1af)],'updateTime':_0x2e4226[_0x3e89a0(0x199)]};}function summarizeSearchHit(_0x407ddd){const _0x54ceed=a32_0x1bbf3d;return{'scope':_0x407ddd[_0x54ceed(0x1b5)],'docId':_0x407ddd[_0x54ceed(0x197)],'score':_0x407ddd[_0x54ceed(0x1ab)],'weightedScore':_0x407ddd[_0x54ceed(0x1ba)],'content':_0x407ddd[_0x54ceed(0x18b)],'metadata':_0x407ddd[_0x54ceed(0x17d)]};}function readTopK(_0x4a2743){const _0x202677=a32_0x1bbf3d,_0x560a06=_0x4a2743['flag'](_0x202677(0x191));if(_0x560a06===undefined||_0x560a06===null||_0x560a06==='')return undefined;const _0x5abc52=_0x4a2743['num'](_0x202677(0x191));if(!Number['isFinite'](_0x5abc52)||_0x5abc52<0x1)throw CliErrors[_0x202677(0x1a8)](_0x202677(0x184));return _0x5abc52;}function a32_0x2bc8(){const _0x102b6d=['title','search','15LmFARD','/client/knowledge-base/personal/','list','897162dYKbgA','--topk\x20must\x20be\x20a\x20positive\x20number.','string','appCode','build','Created\x20KB\x20entry\x20','ragErrorMessage','695750NfopPc','content','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','description','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','POST','topk','818874EmtfLP','length','str','write','File\x20is\x20not\x20a\x20regular\x20file:\x20','docId','version','updateTime','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','bool','create','userId','body','Personal\x20knowledge-base\x20entry\x20ID','read','verbose','/client/knowledge-base/personal/create','map','File\x20path\x20is\x20required.','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','Personal\x20knowledge-base\x20entry\x20title','2200956mMGMbL','validation','17618512hUdaRh','ragStatus','score','isFile','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','2141304nRMzCv','createTime','Override\x20the\x20existing\x20entry\x20title','file','File\x20not\x20found:\x20','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','update','scope','202307PWelGt','/update','query','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','weightedScore','num','trim','metadata'];a32_0x2bc8=function(){return _0x102b6d;};return a32_0x2bc8();}const kbList={'service':'kb','command':a32_0x1bbf3d(0x182),'description':a32_0x1bbf3d(0x19a),'risk':a32_0x1bbf3d(0x1a0),'flags':[VERBOSE_FLAG],async 'execute'(_0x2e29a2){const _0x3e0b9e=a32_0x1bbf3d,_0x2b4503=await listPersonalKnowledgeBaseItems(_0x2e29a2['appCode']);if(_0x2e29a2[_0x3e0b9e(0x19b)](_0x3e0b9e(0x1a1)))return{'ok':!![],'data':{'total':_0x2b4503[_0x3e0b9e(0x193)],'items':_0x2b4503}};return{'ok':!![],'data':{'total':_0x2b4503[_0x3e0b9e(0x193)],'items':_0x2b4503[_0x3e0b9e(0x1a3)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a32_0x1bbf3d(0x1b3),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x1bbf3d(0x19f)}],async 'execute'(_0xfe6eec){const _0x1273d0=a32_0x1bbf3d,_0x27f16c=await getPersonalKnowledgeBaseItem(_0xfe6eec[_0x1273d0(0x1bb)]('id'),_0xfe6eec['appCode']);return{'ok':!![],'data':detailPersonalItem(_0x27f16c)};}},kbCreate={'service':'kb','command':a32_0x1bbf3d(0x19c),'description':a32_0x1bbf3d(0x18d),'risk':a32_0x1bbf3d(0x195),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x58dd0d){const _0x280fb9=a32_0x1bbf3d,_0x429d3f=_0x58dd0d[_0x280fb9(0x194)](_0x280fb9(0x17e)),_0x4ddc0f=readKnowledgeFile(_0x58dd0d['str']('file')),_0x2621ad=await createPersonalKnowledgeBaseItem(_0x58dd0d[_0x280fb9(0x186)],{'title':_0x429d3f,'content':_0x4ddc0f});return{'ok':!![],'data':summarizePersonalItem(_0x2621ad),'message':_0x280fb9(0x188)+_0x2621ad['id']+'\x20('+_0x2621ad[_0x280fb9(0x17e)]+')'};},async 'dryRun'(_0x21ab72){const _0x3433e9=a32_0x1bbf3d,_0x1e45e3=_0x21ab72[_0x3433e9(0x194)](_0x3433e9(0x17e)),_0xaa5c23=readKnowledgeFile(_0x21ab72[_0x3433e9(0x194)]('file'));return dryRun(_0x3433e9(0x190),_0x3433e9(0x1a2))[_0x3433e9(0x19e)]({'appCode':_0x21ab72['appCode'],'title':_0x1e45e3,'content':_0xaa5c23})[_0x3433e9(0x18e)](_0x3433e9(0x18f)+_0x1e45e3+'\x22')['build']();}},kbUpdate={'service':'kb','command':a32_0x1bbf3d(0x1b4),'description':a32_0x1bbf3d(0x18c),'risk':'write','flags':[{...ID_FLAG,'description':a32_0x1bbf3d(0x19f)},{...TITLE_FLAG,'required':![],'description':a32_0x1bbf3d(0x1b0)},FILE_FLAG],async 'execute'(_0x4c2295){const _0x20a319=a32_0x1bbf3d,_0x3a44d8=_0x4c2295[_0x20a319(0x1bb)]('id'),_0x177dc1=readKnowledgeFile(_0x4c2295[_0x20a319(0x194)](_0x20a319(0x1b1))),_0x28c00f=_0x4c2295[_0x20a319(0x194)](_0x20a319(0x17e))||(await getPersonalKnowledgeBaseItem(_0x3a44d8,_0x4c2295[_0x20a319(0x186)]))[_0x20a319(0x17e)],_0x1a9361=await updatePersonalKnowledgeBaseItem(_0x3a44d8,_0x4c2295[_0x20a319(0x186)],{'title':_0x28c00f,'content':_0x177dc1});return{'ok':!![],'data':summarizePersonalItem(_0x1a9361),'message':'Updated\x20KB\x20entry\x20'+_0x1a9361['id']+'\x20('+_0x1a9361[_0x20a319(0x17e)]+')'};},async 'dryRun'(_0x3b3c4b){const _0x59e8f8=a32_0x1bbf3d,_0xbe60a5=_0x3b3c4b[_0x59e8f8(0x1bb)]('id'),_0x2212de=readKnowledgeFile(_0x3b3c4b[_0x59e8f8(0x194)](_0x59e8f8(0x1b1))),_0x18cf68=_0x3b3c4b[_0x59e8f8(0x194)](_0x59e8f8(0x17e))||(await getPersonalKnowledgeBaseItem(_0xbe60a5,_0x3b3c4b[_0x59e8f8(0x186)]))[_0x59e8f8(0x17e)];return dryRun(_0x59e8f8(0x190),_0x59e8f8(0x181)+_0xbe60a5+_0x59e8f8(0x1b7))[_0x59e8f8(0x19e)]({'appCode':_0x3b3c4b['appCode'],'title':_0x18cf68,'content':_0x2212de})[_0x59e8f8(0x18e)](_0x59e8f8(0x1b9)+_0xbe60a5)[_0x59e8f8(0x187)]();}},kbSearch={'service':'kb','command':a32_0x1bbf3d(0x17f),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x39a4d9){const _0x30b6de=a32_0x1bbf3d;if(!_0x39a4d9['str']('query')[_0x30b6de(0x1bc)]())throw CliErrors[_0x30b6de(0x1a8)]('Search\x20query\x20is\x20required.');readTopK(_0x39a4d9);},async 'execute'(_0x8303ad){const _0x1cab67=a32_0x1bbf3d,_0x3ca177=_0x8303ad['str'](_0x1cab67(0x1b8))[_0x1cab67(0x1bc)](),_0x2402ab=readTopK(_0x8303ad),_0x16e820=await searchKnowledgeBase(_0x8303ad[_0x1cab67(0x186)],{'query':_0x3ca177,'topK':_0x2402ab});return{'ok':!![],'data':{'total':_0x16e820[_0x1cab67(0x193)],'hits':_0x16e820['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a32_0x3a2c72=a32_0x2743;(function(_0x3826ab,_0x547c24){const _0x313420=a32_0x2743,_0x26fdd9=_0x3826ab();while(!![]){try{const _0x371142=parseInt(_0x313420(0x18b))/0x1+-parseInt(_0x313420(0x17a))/0x2*(parseInt(_0x313420(0x16e))/0x3)+-parseInt(_0x313420(0x18c))/0x4*(-parseInt(_0x313420(0x183))/0x5)+-parseInt(_0x313420(0x17b))/0x6+parseInt(_0x313420(0x160))/0x7*(parseInt(_0x313420(0x195))/0x8)+-parseInt(_0x313420(0x186))/0x9*(parseInt(_0x313420(0x16c))/0xa)+-parseInt(_0x313420(0x16f))/0xb;if(_0x371142===_0x547c24)break;else _0x26fdd9['push'](_0x26fdd9['shift']());}catch(_0x43f624){_0x26fdd9['push'](_0x26fdd9['shift']());}}}(a32_0x4e68,0xd2b2e));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a32_0x2743(_0x5388a2,_0x5a83a8){_0x5388a2=_0x5388a2-0x159;const _0x4e68f2=a32_0x4e68();let _0x274363=_0x4e68f2[_0x5388a2];return _0x274363;}const TITLE_FLAG={'name':a32_0x3a2c72(0x16b),'type':a32_0x3a2c72(0x15f),'required':!![],'description':a32_0x3a2c72(0x192)},FILE_FLAG={'name':'file','type':a32_0x3a2c72(0x15f),'required':!![],'description':a32_0x3a2c72(0x17c)},QUERY_FLAG={'name':'query','type':a32_0x3a2c72(0x15f),'required':!![],'description':a32_0x3a2c72(0x193)},TOPK_FLAG={'name':a32_0x3a2c72(0x187),'type':a32_0x3a2c72(0x170),'description':a32_0x3a2c72(0x15b)};function a32_0x4e68(){const _0x15d3ab=['userId','--topk\x20must\x20be\x20a\x20positive\x20number.','988753QxRbzF','6768332pYPDLO','list','update','Search\x20query\x20is\x20required.','createTime','Personal\x20knowledge-base\x20entry\x20ID','Personal\x20knowledge-base\x20entry\x20title','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','search','9528CSbbui','/update','body','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','content','File\x20is\x20not\x20a\x20regular\x20file:\x20','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','string','364WGLoWS','scope','isFinite','trim','verbose','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','str','Override\x20the\x20existing\x20entry\x20title','validation','isFile','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','title','6779660dcFynP','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','2726013QVPrcl','1464419gaUKfa','number','updateTime','appCode','Created\x20KB\x20entry\x20','read','metadata','description','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','detail','/client/knowledge-base/personal/','2GuaFgz','959880VGAgpf','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','docId','query','POST','length','ragStatus','map','5LNlqtr','num','flag','9alvFJl','topk','file'];a32_0x4e68=function(){return _0x15d3ab;};return a32_0x4e68();}function readKnowledgeFile(_0x427738){const _0x4cddd8=a32_0x3a2c72;if(!_0x427738)throw CliErrors[_0x4cddd8(0x168)]('File\x20path\x20is\x20required.');if(!existsSync(_0x427738))throw CliErrors[_0x4cddd8(0x168)]('File\x20not\x20found:\x20'+_0x427738);if(!statSync(_0x427738)[_0x4cddd8(0x169)]())throw CliErrors[_0x4cddd8(0x168)](_0x4cddd8(0x15d)+_0x427738);return readFileSync(_0x427738,'utf8');}function summarizePersonalItem(_0x313ffe){const _0x3e382a=a32_0x3a2c72;return{'id':_0x313ffe['id'],'title':_0x313ffe['title'],'version':_0x313ffe['version'],'ragStatus':_0x313ffe[_0x3e382a(0x181)],'ragErrorMessage':_0x313ffe['ragErrorMessage'],'updateTime':_0x313ffe[_0x3e382a(0x171)]};}function detailPersonalItem(_0x36e3a5){const _0x450b1d=a32_0x3a2c72;return{'id':_0x36e3a5['id'],'appCode':_0x36e3a5[_0x450b1d(0x172)],'scope':_0x36e3a5['scope'],'userId':_0x36e3a5[_0x450b1d(0x189)],'title':_0x36e3a5['title'],'content':_0x36e3a5[_0x450b1d(0x15c)]??'','version':_0x36e3a5['version'],'ragStatus':_0x36e3a5[_0x450b1d(0x181)],'ragErrorMessage':_0x36e3a5['ragErrorMessage'],'createTime':_0x36e3a5[_0x450b1d(0x190)],'updateTime':_0x36e3a5[_0x450b1d(0x171)]};}function summarizeSearchHit(_0x437e0d){const _0x203d89=a32_0x3a2c72;return{'scope':_0x437e0d[_0x203d89(0x161)],'docId':_0x437e0d[_0x203d89(0x17d)],'score':_0x437e0d['score'],'weightedScore':_0x437e0d['weightedScore'],'content':_0x437e0d['content'],'metadata':_0x437e0d[_0x203d89(0x175)]};}function readTopK(_0x234ada){const _0x254340=a32_0x3a2c72,_0xffad9c=_0x234ada[_0x254340(0x185)](_0x254340(0x187));if(_0xffad9c===undefined||_0xffad9c===null||_0xffad9c==='')return undefined;const _0x2aa299=_0x234ada['num'](_0x254340(0x187));if(!Number[_0x254340(0x162)](_0x2aa299)||_0x2aa299<0x1)throw CliErrors[_0x254340(0x168)](_0x254340(0x18a));return _0x2aa299;}const kbList={'service':'kb','command':a32_0x3a2c72(0x18d),'description':a32_0x3a2c72(0x16d),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x4a68e5){const _0x5397d8=a32_0x3a2c72,_0x129b57=await listPersonalKnowledgeBaseItems(_0x4a68e5['appCode']);if(_0x4a68e5['bool'](_0x5397d8(0x164)))return{'ok':!![],'data':{'total':_0x129b57['length'],'items':_0x129b57}};return{'ok':!![],'data':{'total':_0x129b57[_0x5397d8(0x180)],'items':_0x129b57['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x3a2c72(0x178),'description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':a32_0x3a2c72(0x174),'flags':[{...ID_FLAG,'description':a32_0x3a2c72(0x191)}],async 'execute'(_0x3442af){const _0x3bcc08=a32_0x3a2c72,_0x32707b=await getPersonalKnowledgeBaseItem(_0x3442af['num']('id'),_0x3442af[_0x3bcc08(0x172)]);return{'ok':!![],'data':detailPersonalItem(_0x32707b)};}},kbCreate={'service':'kb','command':'create','description':a32_0x3a2c72(0x165),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x2d10d3){const _0x42eb7b=a32_0x3a2c72,_0x233940=_0x2d10d3['str'](_0x42eb7b(0x16b)),_0x5911de=readKnowledgeFile(_0x2d10d3[_0x42eb7b(0x166)]('file')),_0x2fb0cb=await createPersonalKnowledgeBaseItem(_0x2d10d3[_0x42eb7b(0x172)],{'title':_0x233940,'content':_0x5911de});return{'ok':!![],'data':summarizePersonalItem(_0x2fb0cb),'message':_0x42eb7b(0x173)+_0x2fb0cb['id']+'\x20('+_0x2fb0cb['title']+')'};},async 'dryRun'(_0x5a8759){const _0x4db0a6=a32_0x3a2c72,_0x5ca821=_0x5a8759[_0x4db0a6(0x166)]('title'),_0x218dfa=readKnowledgeFile(_0x5a8759['str']('file'));return dryRun(_0x4db0a6(0x17f),'/client/knowledge-base/personal/create')[_0x4db0a6(0x15a)]({'appCode':_0x5a8759[_0x4db0a6(0x172)],'title':_0x5ca821,'content':_0x218dfa})['description'](_0x4db0a6(0x177)+_0x5ca821+'\x22')['build']();}},kbUpdate={'service':'kb','command':a32_0x3a2c72(0x18e),'description':a32_0x3a2c72(0x16a),'risk':'write','flags':[{...ID_FLAG,'description':a32_0x3a2c72(0x191)},{...TITLE_FLAG,'required':![],'description':a32_0x3a2c72(0x167)},FILE_FLAG],async 'execute'(_0x444f4f){const _0x183e72=a32_0x3a2c72,_0x44ea93=_0x444f4f[_0x183e72(0x184)]('id'),_0xbe4b67=readKnowledgeFile(_0x444f4f['str'](_0x183e72(0x188))),_0x20f52f=_0x444f4f[_0x183e72(0x166)]('title')||(await getPersonalKnowledgeBaseItem(_0x44ea93,_0x444f4f[_0x183e72(0x172)]))[_0x183e72(0x16b)],_0x2d8aa2=await updatePersonalKnowledgeBaseItem(_0x44ea93,_0x444f4f[_0x183e72(0x172)],{'title':_0x20f52f,'content':_0xbe4b67});return{'ok':!![],'data':summarizePersonalItem(_0x2d8aa2),'message':'Updated\x20KB\x20entry\x20'+_0x2d8aa2['id']+'\x20('+_0x2d8aa2[_0x183e72(0x16b)]+')'};},async 'dryRun'(_0x5e3368){const _0x160892=a32_0x3a2c72,_0x1e8c9c=_0x5e3368[_0x160892(0x184)]('id'),_0x3c5ce3=readKnowledgeFile(_0x5e3368[_0x160892(0x166)]('file')),_0x43055f=_0x5e3368[_0x160892(0x166)](_0x160892(0x16b))||(await getPersonalKnowledgeBaseItem(_0x1e8c9c,_0x5e3368[_0x160892(0x172)]))[_0x160892(0x16b)];return dryRun(_0x160892(0x17f),_0x160892(0x179)+_0x1e8c9c+_0x160892(0x159))[_0x160892(0x15a)]({'appCode':_0x5e3368[_0x160892(0x172)],'title':_0x43055f,'content':_0x3c5ce3})[_0x160892(0x176)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x1e8c9c)['build']();}},kbSearch={'service':'kb','command':a32_0x3a2c72(0x194),'description':a32_0x3a2c72(0x15e),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x33a1ce){const _0x14aaf1=a32_0x3a2c72;if(!_0x33a1ce[_0x14aaf1(0x166)]('query')[_0x14aaf1(0x163)]())throw CliErrors[_0x14aaf1(0x168)](_0x14aaf1(0x18f));readTopK(_0x33a1ce);},async 'execute'(_0x39fc5f){const _0x559809=a32_0x3a2c72,_0x1cc798=_0x39fc5f[_0x559809(0x166)](_0x559809(0x17e))[_0x559809(0x163)](),_0x43b02f=readTopK(_0x39fc5f),_0x523fd0=await searchKnowledgeBase(_0x39fc5f['appCode'],{'query':_0x1cc798,'topK':_0x43b02f});return{'ok':!![],'data':{'total':_0x523fd0[_0x559809(0x180)],'hits':_0x523fd0[_0x559809(0x182)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- const a33_0x59129b=a33_0x3ccc;(function(_0x513a00,_0x8688cb){const _0x2d57c9=a33_0x3ccc,_0x4c0b0c=_0x513a00();while(!![]){try{const _0x3c8145=-parseInt(_0x2d57c9(0xb2))/0x1+parseInt(_0x2d57c9(0x9f))/0x2+-parseInt(_0x2d57c9(0xa6))/0x3*(-parseInt(_0x2d57c9(0xa0))/0x4)+parseInt(_0x2d57c9(0xbb))/0x5+parseInt(_0x2d57c9(0xbe))/0x6+parseInt(_0x2d57c9(0xa7))/0x7*(parseInt(_0x2d57c9(0xb7))/0x8)+parseInt(_0x2d57c9(0xbf))/0x9*(-parseInt(_0x2d57c9(0xad))/0xa);if(_0x3c8145===_0x8688cb)break;else _0x4c0b0c['push'](_0x4c0b0c['shift']());}catch(_0x45f3ef){_0x4c0b0c['push'](_0x4c0b0c['shift']());}}}(a33_0x5b1e,0x85a9b));function a33_0x3ccc(_0xbba8a4,_0x4e1a10){_0xbba8a4=_0xbba8a4-0x9d;const _0x5b1e4b=a33_0x5b1e();let _0x3ccc2d=_0x5b1e4b[_0xbba8a4];return _0x3ccc2d;}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x5b1e(){const _0xbb3cf9=['warn','\x20logs:\x0a','616446ahXJiF','\x20\x20\x20Time:\x20','clearLogs','error','en-US','3462008phvJux','toLocaleString','length','Clear\x20command\x20history\x20logs','1392525JhruPh','details','command','4885566zEsFAV','10521UjILJA','clear','read','443166DWeZIH','88ThOUax','stringify','\x20\x20\x20Details:\x20','message','level','show','52308XpLryU','7InAuhs','*\x20Logs\x20cleared','*\x20No\x20logs\x20found','success','View\x20command\x20history\x20logs','log','8270MMLiMp','logs','duration'];a33_0x5b1e=function(){return _0xbb3cf9;};return a33_0x5b1e();}function printLogs(_0x581212){const _0x3bab61=a33_0x3ccc;if(_0x581212[_0x3bab61(0xb9)]===0x0){console[_0x3bab61(0xac)](_0x3bab61(0xa9));return;}console[_0x3bab61(0xac)]('*\x20'+CLI_DISPLAY_NAME+_0x3bab61(0xb1)),_0x581212['forEach']((_0x140d5e,_0x3b7a14)=>{const _0x557fb6=_0x3bab61,_0x195b6f=new Date(_0x140d5e['timestamp'])[_0x557fb6(0xb8)](_0x557fb6(0xb6)),_0x4341c1=_0x140d5e[_0x557fb6(0xa4)]===_0x557fb6(0xaa)?'√':_0x140d5e[_0x557fb6(0xa4)]===_0x557fb6(0xb5)?'×':_0x140d5e[_0x557fb6(0xa4)]===_0x557fb6(0xb0)?'!':'i';console[_0x557fb6(0xac)](_0x3b7a14+0x1+'.\x20'+_0x4341c1+'\x20['+_0x140d5e[_0x557fb6(0xbd)]+']\x20'+_0x140d5e[_0x557fb6(0xa3)]),console[_0x557fb6(0xac)](_0x557fb6(0xb3)+_0x195b6f),_0x140d5e[_0x557fb6(0xaf)]&&console[_0x557fb6(0xac)]('\x20\x20\x20Duration:\x20'+_0x140d5e['duration']+'ms'),_0x140d5e[_0x557fb6(0xbc)]&&Object['keys'](_0x140d5e[_0x557fb6(0xbc)])[_0x557fb6(0xb9)]>0x0&&console[_0x557fb6(0xac)](_0x557fb6(0xa2)+JSON[_0x557fb6(0xa1)](_0x140d5e[_0x557fb6(0xbc)],null,0x2)),console[_0x557fb6(0xac)]('');});}export const logsDefinitions=[{'service':'logs','command':a33_0x59129b(0xa5),'description':a33_0x59129b(0xab),'risk':a33_0x59129b(0x9e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4d4284){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':a33_0x59129b(0xae),'command':a33_0x59129b(0x9d),'description':a33_0x59129b(0xba),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x46f21f){const _0x509134=a33_0x59129b;return logger[_0x509134(0xb4)](),console[_0x509134(0xac)](_0x509134(0xa8)),{'ok':!![]};}}];
1
+ const a33_0x3d321b=a33_0x4e8a;(function(_0x2331a7,_0x5cdbc6){const _0x533160=a33_0x4e8a,_0x5523c0=_0x2331a7();while(!![]){try{const _0x54b926=parseInt(_0x533160(0x144))/0x1*(parseInt(_0x533160(0x137))/0x2)+parseInt(_0x533160(0x13f))/0x3*(-parseInt(_0x533160(0x124))/0x4)+parseInt(_0x533160(0x142))/0x5*(parseInt(_0x533160(0x12f))/0x6)+parseInt(_0x533160(0x13a))/0x7+-parseInt(_0x533160(0x129))/0x8*(parseInt(_0x533160(0x13e))/0x9)+-parseInt(_0x533160(0x143))/0xa+parseInt(_0x533160(0x128))/0xb*(parseInt(_0x533160(0x12b))/0xc);if(_0x54b926===_0x5cdbc6)break;else _0x5523c0['push'](_0x5523c0['shift']());}catch(_0x1b439b){_0x5523c0['push'](_0x5523c0['shift']());}}}(a33_0x2d88,0xec00e));function a33_0x2d88(){const _0x488629=['9XZhSBo','1302834hvrLWS','timestamp','write','630CqptMG','8801300OMGVTp','30521OREalW','Clear\x20command\x20history\x20logs','forEach','*\x20No\x20logs\x20found','read','duration','4IJOtPh','success','clearLogs','level','48433FcoHql','3168776GFPKhO','*\x20Logs\x20cleared','3228cwGYND','length','logs','\x20\x20\x20Details:\x20','50532BDMIgj','en-US','readLogs','message','\x20\x20\x20Duration:\x20','show','View\x20command\x20history\x20logs','details','18rsipeG','error','log','1098349dJXiXn','\x20logs:\x0a','clear','keys'];a33_0x2d88=function(){return _0x488629;};return a33_0x2d88();}function a33_0x4e8a(_0x510665,_0x451d12){_0x510665=_0x510665-0x124;const _0x2d8802=a33_0x2d88();let _0x4e8aee=_0x2d8802[_0x510665];return _0x4e8aee;}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x4300ef){const _0x77a831=a33_0x4e8a;if(_0x4300ef[_0x77a831(0x12c)]===0x0){console['log'](_0x77a831(0x147));return;}console[_0x77a831(0x139)]('*\x20'+CLI_DISPLAY_NAME+_0x77a831(0x13b)),_0x4300ef[_0x77a831(0x146)]((_0x1e438a,_0x493ea7)=>{const _0x1b9a09=_0x77a831,_0x19afd7=new Date(_0x1e438a[_0x1b9a09(0x140)])['toLocaleString'](_0x1b9a09(0x130)),_0x1de88e=_0x1e438a[_0x1b9a09(0x127)]===_0x1b9a09(0x125)?'√':_0x1e438a[_0x1b9a09(0x127)]===_0x1b9a09(0x138)?'×':_0x1e438a[_0x1b9a09(0x127)]==='warn'?'!':'i';console[_0x1b9a09(0x139)](_0x493ea7+0x1+'.\x20'+_0x1de88e+'\x20['+_0x1e438a['command']+']\x20'+_0x1e438a[_0x1b9a09(0x132)]),console[_0x1b9a09(0x139)]('\x20\x20\x20Time:\x20'+_0x19afd7),_0x1e438a[_0x1b9a09(0x149)]&&console['log'](_0x1b9a09(0x133)+_0x1e438a[_0x1b9a09(0x149)]+'ms'),_0x1e438a[_0x1b9a09(0x136)]&&Object[_0x1b9a09(0x13d)](_0x1e438a[_0x1b9a09(0x136)])[_0x1b9a09(0x12c)]>0x0&&console['log'](_0x1b9a09(0x12e)+JSON['stringify'](_0x1e438a['details'],null,0x2)),console[_0x1b9a09(0x139)]('');});}export const logsDefinitions=[{'service':a33_0x3d321b(0x12d),'command':a33_0x3d321b(0x134),'description':a33_0x3d321b(0x135),'risk':a33_0x3d321b(0x148),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xc56984){const _0x5db7e1=a33_0x3d321b;return printLogs(logger[_0x5db7e1(0x131)]()),{'ok':!![]};}},{'service':a33_0x3d321b(0x12d),'command':a33_0x3d321b(0x13c),'description':a33_0x3d321b(0x145),'risk':a33_0x3d321b(0x141),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x22267d){const _0x50c37a=a33_0x3d321b;return logger[_0x50c37a(0x126)](),console[_0x50c37a(0x139)](_0x50c37a(0x12a)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a34_0x1ad4bc=a34_0x421d;(function(_0xc0cba8,_0x382d04){const _0x18d3a1=a34_0x421d,_0x3e6bda=_0xc0cba8();while(!![]){try{const _0x664134=-parseInt(_0x18d3a1(0x194))/0x1*(parseInt(_0x18d3a1(0x198))/0x2)+-parseInt(_0x18d3a1(0x197))/0x3+-parseInt(_0x18d3a1(0x193))/0x4+parseInt(_0x18d3a1(0x188))/0x5+parseInt(_0x18d3a1(0x19f))/0x6*(parseInt(_0x18d3a1(0x1a0))/0x7)+-parseInt(_0x18d3a1(0x196))/0x8+-parseInt(_0x18d3a1(0x1a9))/0x9*(-parseInt(_0x18d3a1(0x19e))/0xa);if(_0x664134===_0x382d04)break;else _0x3e6bda['push'](_0x3e6bda['shift']());}catch(_0x2afc39){_0x3e6bda['push'](_0x3e6bda['shift']());}}}(a34_0xe80c,0x535be));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_0x1ad4bc(0x19c),a34_0x1ad4bc(0x1aa),'form','idCard'],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x1ad4bc(0x1ac),'general':a34_0x1ad4bc(0x1b4),'form':a34_0x1ad4bc(0x1a2),'idCard':a34_0x1ad4bc(0x18b)},SCENE_FLAG={'name':'scene','type':a34_0x1ad4bc(0x187),'required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':'image-file','type':a34_0x1ad4bc(0x187),'description':a34_0x1ad4bc(0x19b)},IMAGE_URL_FLAG={'name':a34_0x1ad4bc(0x18a),'type':a34_0x1ad4bc(0x187),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x1e271f){const _0x258b7d=a34_0x1ad4bc,_0x4ac4a3=_0x1e271f[_0x258b7d(0x1a4)]()[_0x258b7d(0x18c)]();if(_0x4ac4a3===_0x258b7d(0x1a5))return _0x258b7d(0x182);if(_0x4ac4a3===_0x258b7d(0x19c)||_0x4ac4a3===_0x258b7d(0x1aa)||_0x4ac4a3===_0x258b7d(0x1b0))return _0x4ac4a3;throw CliErrors[_0x258b7d(0x1b3)](_0x258b7d(0x1b6)+_0x1e271f+_0x258b7d(0x181)+SUPPORTED_SCENES['join'](',\x20'));}function a34_0x421d(_0x952d3e,_0xca6714){_0x952d3e=_0x952d3e-0x181;const _0xe80cbf=a34_0xe80c();let _0x421db2=_0xe80cbf[_0x952d3e];return _0x421db2;}function a34_0xe80c(){const _0x38184e=['image-file','/client/uploadFile','POST','form','filePath','imageUrl','validation','General','ocr','Unsupported\x20OCR\x20scene:\x20','.\x20Supported\x20scenes:\x20','idCard','fileName','path','body','\x20OCR','string','1429750GxEKMB','length','image-url','IdCard','toLowerCase','/client/queryFileUrl','File\x20URL\x20response\x20missing\x20fileUrl.','write','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','description','imageFile','56176NtfvvT','7qxNVNQ','fileUrl','1859072ycXtov','1217142ckAOTD','166002NGnGoh','apiError','appCode','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','invoice','scene','130MvNZDr','60LXakMy','155127jgetRF','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','Table','count','trim','idcard','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','str','\x20OCR\x20from\x20URL','738711JcxqtS','general','recognize','Invoice'];a34_0xe80c=function(){return _0x38184e;};return a34_0xe80c();}function selectedInputs(_0x5caf14){const _0x1622b3=a34_0x1ad4bc,_0x94f1ef=_0x5caf14['str'](_0x1622b3(0x1ad))[_0x1622b3(0x1a4)](),_0x4ee9ee=_0x5caf14[_0x1622b3(0x1a7)]('image-url')[_0x1622b3(0x1a4)]();return{'imageFile':_0x94f1ef,'imageUrl':_0x4ee9ee,'count':[_0x94f1ef,_0x4ee9ee]['filter'](Boolean)[_0x1622b3(0x189)]};}function validateInputSelection(_0x4388da){const _0x8f8ea8=a34_0x1ad4bc,_0xec45ea=selectedInputs(_0x4388da);if(_0xec45ea[_0x8f8ea8(0x1a3)]!==0x1)throw CliErrors['validation'](_0x8f8ea8(0x190));return _0xec45ea;}function withScene(_0x227557,_0x3410c3,_0x1b14f0){const _0x14596c=a34_0x1ad4bc;return{..._0x227557,'scene':_0x3410c3,..._0x1b14f0?{'sourceFile':{'fileName':_0x1b14f0[_0x14596c(0x183)],'filePath':_0x1b14f0[_0x14596c(0x1b1)]}}:{}};}const ocrRecognize={'service':a34_0x1ad4bc(0x1b5),'command':a34_0x1ad4bc(0x1ab),'description':a34_0x1ad4bc(0x1a6),'risk':a34_0x1ad4bc(0x18f),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x4a7413){const _0x3508dc=a34_0x1ad4bc,_0x4731a1=normalizeScene(_0x4a7413[_0x3508dc(0x1a7)](_0x3508dc(0x19d))),_0x4a1ecf=SCENE_TO_LEGACY_TYPE[_0x4731a1],_0x1ca9e0=validateInputSelection(_0x4a7413);if(_0x1ca9e0[_0x3508dc(0x1b2)])return dryRun(_0x3508dc(0x1af),'/client/ocr')['body']({'appCode':_0x4a7413['appCode'],'url':_0x1ca9e0[_0x3508dc(0x1b2)],'type':_0x4a1ecf})[_0x3508dc(0x191)]('Preview:\x20recognize\x20'+_0x4731a1+_0x3508dc(0x1a8))['build']();const _0x4cb1e1=requireRuntimeUploadFile(_0x1ca9e0[_0x3508dc(0x192)],_0x3508dc(0x1ad));return dryRun(_0x3508dc(0x1af),_0x3508dc(0x1ae))[_0x3508dc(0x185)]({'steps':[{'method':'POST','url':_0x3508dc(0x1ae),'body':{'appCode':_0x4a7413[_0x3508dc(0x19a)],'multipart':{'file':_0x4cb1e1}}},{'method':_0x3508dc(0x1af),'url':_0x3508dc(0x18d),'body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':'POST','url':'/client/ocr','body':{'appCode':_0x4a7413['appCode'],'url':_0x3508dc(0x1a1),'type':_0x4a1ecf}}]})[_0x3508dc(0x191)]('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x4731a1+_0x3508dc(0x186))['build']();},async 'execute'(_0x24a626){const _0x1d3276=a34_0x1ad4bc,_0x206aea=normalizeScene(_0x24a626['str'](_0x1d3276(0x19d))),_0x14a056=SCENE_TO_LEGACY_TYPE[_0x206aea],_0x2d392d=validateInputSelection(_0x24a626);if(_0x2d392d[_0x1d3276(0x1b2)]){const _0x486e3e=await recognizeRuntimeOcr(_0x24a626[_0x1d3276(0x19a)],{'url':_0x2d392d[_0x1d3276(0x1b2)],'type':_0x14a056});return{'ok':!![],'data':withScene(_0x486e3e,_0x206aea)};}const _0x2a782e=requireRuntimeUploadFile(_0x2d392d[_0x1d3276(0x192)],'image-file'),_0xccb8e4=await uploadRuntimeFile(_0x24a626[_0x1d3276(0x19a)],_0x2a782e[_0x1d3276(0x184)]);if(!_0xccb8e4[_0x1d3276(0x1b1)])throw CliErrors[_0x1d3276(0x199)]('File\x20upload\x20response\x20missing\x20filePath.');const _0x4bec6d=await queryRuntimeFileUrl(_0xccb8e4[_0x1d3276(0x1b1)],{'download':![]});if(!_0x4bec6d[_0x1d3276(0x195)])throw CliErrors[_0x1d3276(0x199)](_0x1d3276(0x18e));const _0xbf12de=await recognizeRuntimeOcr(_0x24a626[_0x1d3276(0x19a)],{'url':_0x4bec6d[_0x1d3276(0x195)],'type':_0x14a056});return{'ok':!![],'data':withScene(_0xbf12de,_0x206aea,_0xccb8e4)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a34_0x1cdfdf=a34_0x5899;(function(_0xf6546,_0x4e34d7){const _0x200906=a34_0x5899,_0x2a67c8=_0xf6546();while(!![]){try{const _0x2ed00b=parseInt(_0x200906(0x173))/0x1*(parseInt(_0x200906(0x153))/0x2)+parseInt(_0x200906(0x154))/0x3*(parseInt(_0x200906(0x177))/0x4)+-parseInt(_0x200906(0x14b))/0x5+parseInt(_0x200906(0x150))/0x6*(parseInt(_0x200906(0x16e))/0x7)+parseInt(_0x200906(0x17e))/0x8*(-parseInt(_0x200906(0x162))/0x9)+-parseInt(_0x200906(0x188))/0xa*(parseInt(_0x200906(0x187))/0xb)+-parseInt(_0x200906(0x17f))/0xc*(-parseInt(_0x200906(0x15f))/0xd);if(_0x2ed00b===_0x4e34d7)break;else _0x2a67c8['push'](_0x2a67c8['shift']());}catch(_0x4a7ff8){_0x2a67c8['push'](_0x2a67c8['shift']());}}}(a34_0x5853,0x2c505));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_0x1cdfdf(0x182),a34_0x1cdfdf(0x17b),a34_0x1cdfdf(0x169),a34_0x1cdfdf(0x15b)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x1cdfdf(0x184),'general':a34_0x1cdfdf(0x163),'form':'Table','idCard':a34_0x1cdfdf(0x168)},SCENE_FLAG={'name':a34_0x1cdfdf(0x160),'type':a34_0x1cdfdf(0x175),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x1cdfdf(0x15c)},IMAGE_FILE_FLAG={'name':'image-file','type':a34_0x1cdfdf(0x175),'description':a34_0x1cdfdf(0x166)},IMAGE_URL_FLAG={'name':a34_0x1cdfdf(0x16f),'type':a34_0x1cdfdf(0x175),'description':a34_0x1cdfdf(0x17c)};function normalizeScene(_0x54ba03){const _0x55341e=a34_0x1cdfdf,_0x276443=_0x54ba03[_0x55341e(0x14f)]()[_0x55341e(0x16d)]();if(_0x276443===_0x55341e(0x186))return _0x55341e(0x15b);if(_0x276443==='invoice'||_0x276443===_0x55341e(0x17b)||_0x276443===_0x55341e(0x169))return _0x276443;throw CliErrors[_0x55341e(0x181)](_0x55341e(0x14e)+_0x54ba03+_0x55341e(0x14c)+SUPPORTED_SCENES[_0x55341e(0x16c)](',\x20'));}function selectedInputs(_0x594365){const _0x35ce33=a34_0x1cdfdf,_0x285d48=_0x594365[_0x35ce33(0x155)](_0x35ce33(0x183))[_0x35ce33(0x14f)](),_0x1dc693=_0x594365[_0x35ce33(0x155)](_0x35ce33(0x16f))['trim']();return{'imageFile':_0x285d48,'imageUrl':_0x1dc693,'count':[_0x285d48,_0x1dc693]['filter'](Boolean)[_0x35ce33(0x172)]};}function validateInputSelection(_0x16ead6){const _0x12a54e=a34_0x1cdfdf,_0x2300ad=selectedInputs(_0x16ead6);if(_0x2300ad[_0x12a54e(0x15d)]!==0x1)throw CliErrors['validation'](_0x12a54e(0x176));return _0x2300ad;}function a34_0x5899(_0x55da63,_0x9ca409){_0x55da63=_0x55da63-0x14b;const _0x58538d=a34_0x5853();let _0x58993b=_0x58538d[_0x55da63];return _0x58993b;}function a34_0x5853(){const _0x216f75=['invoice','image-file','Invoice','filePath','idcard','242QXtQcl','870IIHKmi','902990KwCJzz','.\x20Supported\x20scenes:\x20','\x20OCR','Unsupported\x20OCR\x20scene:\x20','trim','405150swWtPE','/client/uploadFile','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','2180ttcThn','196206XnTBNT','str','apiError','description','File\x20upload\x20response\x20missing\x20filePath.','appCode','path','idCard','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','count','body','13tNaJze','scene','File\x20URL\x20response\x20missing\x20fileUrl.','141093CmMpji','General','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','\x20OCR\x20from\x20URL','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','build','IdCard','form','imageUrl','write','join','toLowerCase','14NQDCCC','image-url','POST','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','length','10ynNipi','/client/ocr','string','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','4QkUaJG','recognize','fileUrl','imageFile','general','Publicly\x20accessible\x20image\x20or\x20file\x20URL','Preview:\x20recognize\x20','104EvpNWe','4277640FVWmKZ','fileName','validation'];a34_0x5853=function(){return _0x216f75;};return a34_0x5853();}function withScene(_0x5059bc,_0x3ef89c,_0x54b76b){const _0x279979=a34_0x1cdfdf;return{..._0x5059bc,'scene':_0x3ef89c,..._0x54b76b?{'sourceFile':{'fileName':_0x54b76b[_0x279979(0x180)],'filePath':_0x54b76b[_0x279979(0x185)]}}:{}};}const ocrRecognize={'service':'ocr','command':a34_0x1cdfdf(0x178),'description':a34_0x1cdfdf(0x152),'risk':a34_0x1cdfdf(0x16b),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x443d63){const _0xa9b3fd=a34_0x1cdfdf,_0x578043=normalizeScene(_0x443d63[_0xa9b3fd(0x155)](_0xa9b3fd(0x160))),_0x32db6d=SCENE_TO_LEGACY_TYPE[_0x578043],_0x329af4=validateInputSelection(_0x443d63);if(_0x329af4[_0xa9b3fd(0x16a)])return dryRun(_0xa9b3fd(0x170),_0xa9b3fd(0x174))[_0xa9b3fd(0x15e)]({'appCode':_0x443d63[_0xa9b3fd(0x159)],'url':_0x329af4[_0xa9b3fd(0x16a)],'type':_0x32db6d})['description'](_0xa9b3fd(0x17d)+_0x578043+_0xa9b3fd(0x165))[_0xa9b3fd(0x167)]();const _0x1cdcf3=requireRuntimeUploadFile(_0x329af4[_0xa9b3fd(0x17a)],'image-file');return dryRun('POST',_0xa9b3fd(0x151))[_0xa9b3fd(0x15e)]({'steps':[{'method':_0xa9b3fd(0x170),'url':_0xa9b3fd(0x151),'body':{'appCode':_0x443d63['appCode'],'multipart':{'file':_0x1cdcf3}}},{'method':_0xa9b3fd(0x170),'url':'/client/queryFileUrl','body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':'POST','url':_0xa9b3fd(0x174),'body':{'appCode':_0x443d63[_0xa9b3fd(0x159)],'url':_0xa9b3fd(0x164),'type':_0x32db6d}}]})[_0xa9b3fd(0x157)](_0xa9b3fd(0x171)+_0x578043+_0xa9b3fd(0x14d))['build']();},async 'execute'(_0x5797ab){const _0xdb445e=a34_0x1cdfdf,_0x43c774=normalizeScene(_0x5797ab[_0xdb445e(0x155)](_0xdb445e(0x160))),_0x5cde0b=SCENE_TO_LEGACY_TYPE[_0x43c774],_0x56ca9e=validateInputSelection(_0x5797ab);if(_0x56ca9e[_0xdb445e(0x16a)]){const _0x983300=await recognizeRuntimeOcr(_0x5797ab[_0xdb445e(0x159)],{'url':_0x56ca9e[_0xdb445e(0x16a)],'type':_0x5cde0b});return{'ok':!![],'data':withScene(_0x983300,_0x43c774)};}const _0x462d2b=requireRuntimeUploadFile(_0x56ca9e[_0xdb445e(0x17a)],'image-file'),_0x43ea31=await uploadRuntimeFile(_0x5797ab[_0xdb445e(0x159)],_0x462d2b[_0xdb445e(0x15a)]);if(!_0x43ea31[_0xdb445e(0x185)])throw CliErrors[_0xdb445e(0x156)](_0xdb445e(0x158));const _0xd4d831=await queryRuntimeFileUrl(_0x43ea31[_0xdb445e(0x185)],{'download':![]});if(!_0xd4d831[_0xdb445e(0x179)])throw CliErrors[_0xdb445e(0x156)](_0xdb445e(0x161));const _0x1e3641=await recognizeRuntimeOcr(_0x5797ab[_0xdb445e(0x159)],{'url':_0xd4d831[_0xdb445e(0x179)],'type':_0x5cde0b});return{'ok':!![],'data':withScene(_0x1e3641,_0x43c774,_0x43ea31)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
1
- const a35_0xb2d8a8=a35_0x1795;(function(_0x5865f2,_0x29d690){const _0x38c61c=a35_0x1795,_0x4908e6=_0x5865f2();while(!![]){try{const _0x29613a=parseInt(_0x38c61c(0xe8))/0x1+-parseInt(_0x38c61c(0xf6))/0x2+parseInt(_0x38c61c(0x12a))/0x3+-parseInt(_0x38c61c(0xff))/0x4*(parseInt(_0x38c61c(0xed))/0x5)+-parseInt(_0x38c61c(0xf5))/0x6+parseInt(_0x38c61c(0x125))/0x7*(-parseInt(_0x38c61c(0x112))/0x8)+-parseInt(_0x38c61c(0x11e))/0x9;if(_0x29613a===_0x29d690)break;else _0x4908e6['push'](_0x4908e6['shift']());}catch(_0x59dd0f){_0x4908e6['push'](_0x4908e6['shift']());}}}(a35_0x4ee7,0x4a5f0));import{existsSync,readFileSync,statSync}from'node:fs';function a35_0x1795(_0x12b814,_0x549d74){_0x12b814=_0x12b814-0xe5;const _0x4ee7a4=a35_0x4ee7();let _0x17956f=_0x4ee7a4[_0x12b814];return _0x17956f;}import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x4ee7(){const _0x521732=['scriptType','isFile','read','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','str','detail','file','592542MUfTwu','Created\x20personal\x20BFF\x20','File\x20is\x20not\x20a\x20regular\x20file:\x20','File\x20not\x20found:\x20','Update\x20a\x20personal\x20BFF\x20by\x20id','sourceSessionId','name','44898BXyMoi','Updated\x20personal\x20BFF\x20','POST','verbose','/client/runtime-bff/personal/create','1820520XYfjeY','length','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','functionName','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','577765wEkRmJ','test','map','Optional\x20source\x20RuntimeAgent\x20session\x20id','keys','5yVJvME','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','gmtCreate','trim','File\x20path\x20is\x20required.','Personal\x20BFF\x20description','Executed\x20personal\x20BFF\x20','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','1715796nPCrCR','212482OXKOyn','source-session-id','update','/update','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','Personal\x20BFF\x20script\x20ID','string','personal-bff','config','1636432QtOHCV','write','createUserId','isArray','utf8','num','create','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','params','body','appCode','version','scriptContent','high-risk-write','validation','Preview:\x20create\x20personal\x20BFF\x20','--params\x20must\x20be\x20a\x20JSON\x20object.','build','createTime','16gTtHWw','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','exec','gmtModified','description'];a35_0x4ee7=function(){return _0x521732;};return a35_0x4ee7();}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_0xb2d8a8(0x11d),'type':a35_0xb2d8a8(0xfc),'description':a35_0xb2d8a8(0xfa)},FUNCTION_NAME_FLAG={'name':a35_0xb2d8a8(0x124),'type':a35_0xb2d8a8(0xfc),'required':!![],'description':a35_0xb2d8a8(0x11a)},DESCRIPTION_FLAG={'name':a35_0xb2d8a8(0x116),'type':a35_0xb2d8a8(0xfc),'description':a35_0xb2d8a8(0xf2)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':'string','description':a35_0xb2d8a8(0xeb)};function normalizeFunctionName(_0x136612){const _0x5c563b=a35_0xb2d8a8,_0x5a43d8=String(_0x136612||'')[_0x5c563b(0xf0)]();if(!_0x5a43d8||!FUNCTION_NAME_PATTERN[_0x5c563b(0xe9)](_0x5a43d8))throw CliErrors['validation'](_0x5c563b(0x106));return _0x5a43d8;}function readScriptFile(_0x3c919a){const _0x4b68b2=a35_0xb2d8a8;if(!_0x3c919a)throw CliErrors['validation'](_0x4b68b2(0xf1));if(!existsSync(_0x3c919a))throw CliErrors[_0x4b68b2(0x10d)](_0x4b68b2(0x121)+_0x3c919a);if(!statSync(_0x3c919a)[_0x4b68b2(0x118)]())throw CliErrors[_0x4b68b2(0x10d)](_0x4b68b2(0x120)+_0x3c919a);const _0x10f9dc=readFileSync(_0x3c919a,_0x4b68b2(0x103));if(!_0x10f9dc[_0x4b68b2(0xf0)]())throw CliErrors['validation']('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x10f9dc;}function optionalTrimmed(_0x46ea46){const _0x5b6a20=a35_0xb2d8a8,_0x56e886=String(_0x46ea46||'')[_0x5b6a20(0xf0)]();return _0x56e886||undefined;}function summarizeBff(_0x15d158){const _0x4806a7=a35_0xb2d8a8;return{'id':_0x15d158['id'],'appCode':_0x15d158[_0x4806a7(0x109)],'functionName':_0x15d158[_0x4806a7(0xe6)],'description':_0x15d158['description'],'scriptType':_0x15d158[_0x4806a7(0x117)],'version':_0x15d158[_0x4806a7(0x10a)],'gmtModified':_0x15d158[_0x4806a7(0x115)],'updateTime':_0x15d158['updateTime']};}function detailBff(_0x102fa3){const _0x1ff552=a35_0xb2d8a8;return{'id':_0x102fa3['id'],'appCode':_0x102fa3[_0x1ff552(0x109)],'functionName':_0x102fa3[_0x1ff552(0xe6)],'description':_0x102fa3[_0x1ff552(0x116)],'scriptType':_0x102fa3['scriptType'],'scriptContent':_0x102fa3[_0x1ff552(0x10b)]??'','config':_0x102fa3[_0x1ff552(0xfe)],'version':_0x102fa3[_0x1ff552(0x10a)],'createUserId':_0x102fa3[_0x1ff552(0x101)],'gmtCreate':_0x102fa3[_0x1ff552(0xef)],'gmtModified':_0x102fa3[_0x1ff552(0x115)],'createTime':_0x102fa3[_0x1ff552(0x111)],'updateTime':_0x102fa3['updateTime']};}function buildCreateInput(_0x522ff7){const _0x3609e1=a35_0xb2d8a8;return{'functionName':normalizeFunctionName(_0x522ff7[_0x3609e1(0x11b)](_0x3609e1(0x124))),...optionalTrimmed(_0x522ff7[_0x3609e1(0x11b)]('description'))?{'description':optionalTrimmed(_0x522ff7[_0x3609e1(0x11b)]('description'))}:{},'scriptContent':readScriptFile(_0x522ff7[_0x3609e1(0x11b)](_0x3609e1(0x11d))),...optionalTrimmed(_0x522ff7['str'](_0x3609e1(0xf7)))?{'sourceSessionId':optionalTrimmed(_0x522ff7[_0x3609e1(0x11b)](_0x3609e1(0xf7)))}:{}};}function buildUpdateInput(_0x2463c0){const _0x34da03=a35_0xb2d8a8,_0x345294={};optionalTrimmed(_0x2463c0[_0x34da03(0x11b)](_0x34da03(0x124)))&&(_0x345294[_0x34da03(0xe6)]=normalizeFunctionName(_0x2463c0[_0x34da03(0x11b)](_0x34da03(0x124))));_0x2463c0['flag'](_0x34da03(0x116))!==undefined&&(_0x345294[_0x34da03(0x116)]=_0x2463c0['str'](_0x34da03(0x116)));optionalTrimmed(_0x2463c0[_0x34da03(0x11b)](_0x34da03(0x11d)))&&(_0x345294['scriptContent']=readScriptFile(_0x2463c0[_0x34da03(0x11b)](_0x34da03(0x11d))));_0x2463c0['flag'](_0x34da03(0xf7))!==undefined&&(_0x345294[_0x34da03(0x123)]=_0x2463c0[_0x34da03(0x11b)]('source-session-id'));if(Object[_0x34da03(0xec)](_0x345294)[_0x34da03(0x12b)]===0x0)throw CliErrors[_0x34da03(0x10d)](_0x34da03(0x113));return _0x345294;}function parseExecParams(_0x574612){const _0x14cfc4=a35_0xb2d8a8,_0xa3759c=parseJsonParams(_0x574612)??{};if(Array[_0x14cfc4(0x102)](_0xa3759c))throw CliErrors[_0x14cfc4(0x10d)](_0x14cfc4(0x10f));return _0xa3759c;}const personalBffList={'service':a35_0xb2d8a8(0xfd),'command':'list','description':a35_0xb2d8a8(0xf4),'risk':a35_0xb2d8a8(0x119),'flags':[VERBOSE_FLAG],async 'execute'(_0x4dd88c){const _0x422019=a35_0xb2d8a8,_0x5c6b29=await listPersonalBffs(_0x4dd88c[_0x422019(0x109)]);return{'ok':!![],'data':{'total':_0x5c6b29[_0x422019(0x12b)],'items':_0x4dd88c['bool'](_0x422019(0x128))?_0x5c6b29:_0x5c6b29[_0x422019(0xea)](summarizeBff)}};}},personalBffDetail={'service':a35_0xb2d8a8(0xfd),'command':a35_0xb2d8a8(0x11c),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':'read','flags':[{...ID_FLAG,'description':a35_0xb2d8a8(0xfb)}],async 'execute'(_0x52c02e){const _0x1b4bec=a35_0xb2d8a8,_0x2c8696=await getPersonalBff(_0x52c02e[_0x1b4bec(0x104)]('id'),_0x52c02e[_0x1b4bec(0x109)]);return{'ok':!![],'data':detailBff(_0x2c8696)};}},personalBffCreate={'service':'personal-bff','command':a35_0xb2d8a8(0x105),'description':a35_0xb2d8a8(0xe5),'risk':a35_0xb2d8a8(0x100),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x23c45c){const _0x4cd822=a35_0xb2d8a8,_0x323a15=buildCreateInput(_0x23c45c),_0x2fa97e=await createPersonalBff(_0x23c45c[_0x4cd822(0x109)],_0x323a15);return{'ok':!![],'data':detailBff(_0x2fa97e),'message':_0x4cd822(0x11f)+_0x2fa97e['id']+(_0x2fa97e['functionName']?'\x20('+_0x2fa97e[_0x4cd822(0xe6)]+')':'')};},async 'dryRun'(_0xfaa9e7){const _0x955e29=a35_0xb2d8a8,_0x14530e=buildCreateInput(_0xfaa9e7);return dryRun(_0x955e29(0x127),_0x955e29(0x129))['body']({'appCode':_0xfaa9e7['appCode'],..._0x14530e})[_0x955e29(0x116)](_0x955e29(0x10e)+_0x14530e[_0x955e29(0xe6)])[_0x955e29(0x110)]();}},personalBffUpdate={'service':a35_0xb2d8a8(0xfd),'command':a35_0xb2d8a8(0xf8),'description':a35_0xb2d8a8(0x122),'risk':a35_0xb2d8a8(0x100),'flags':[{...ID_FLAG,'description':a35_0xb2d8a8(0xfb)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x58a59d){const _0x5c59ba=a35_0xb2d8a8,_0x392bff=_0x58a59d[_0x5c59ba(0x104)]('id'),_0x460e95=buildUpdateInput(_0x58a59d),_0x3f64c0=await updatePersonalBff(_0x392bff,_0x58a59d[_0x5c59ba(0x109)],_0x460e95);return{'ok':!![],'data':detailBff(_0x3f64c0),'message':_0x5c59ba(0x126)+_0x3f64c0['id']+(_0x3f64c0[_0x5c59ba(0xe6)]?'\x20('+_0x3f64c0[_0x5c59ba(0xe6)]+')':'')};},async 'dryRun'(_0x1755b4){const _0x45e4f9=a35_0xb2d8a8,_0x3f26c5=_0x1755b4['num']('id'),_0x182e36=buildUpdateInput(_0x1755b4);return dryRun(_0x45e4f9(0x127),'/client/runtime-bff/personal/'+_0x3f26c5+_0x45e4f9(0xf9))[_0x45e4f9(0x108)]({'appCode':_0x1755b4[_0x45e4f9(0x109)],..._0x182e36})[_0x45e4f9(0x116)]('Preview:\x20update\x20personal\x20BFF\x20'+_0x3f26c5)[_0x45e4f9(0x110)]();}},personalBffExec={'service':a35_0xb2d8a8(0xfd),'command':a35_0xb2d8a8(0x114),'description':a35_0xb2d8a8(0xee),'risk':a35_0xb2d8a8(0x10c),'flags':[{...ID_FLAG,'description':a35_0xb2d8a8(0xfb)},{...PARAMS_FLAG,'description':a35_0xb2d8a8(0xe7)}],async 'validate'(_0x461a19){const _0x4a5586=a35_0xb2d8a8;parseExecParams(_0x461a19[_0x4a5586(0x11b)](_0x4a5586(0x107)));},async 'execute'(_0x2e26bc){const _0x4e132b=a35_0xb2d8a8,_0x59388b=_0x2e26bc[_0x4e132b(0x104)]('id'),_0xc734f1=parseExecParams(_0x2e26bc['str'](_0x4e132b(0x107))),_0x4687eb=await executePersonalBff(_0x59388b,_0x2e26bc[_0x4e132b(0x109)],_0xc734f1);return{'ok':!![],'data':{'result':_0x4687eb},'message':_0x4e132b(0xf3)+_0x59388b};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a35_0xe987ff=a35_0x1436;(function(_0x2f9822,_0x2af292){const _0x1af91f=a35_0x1436,_0x1accba=_0x2f9822();while(!![]){try{const _0x430aaf=parseInt(_0x1af91f(0x17c))/0x1*(-parseInt(_0x1af91f(0x150))/0x2)+-parseInt(_0x1af91f(0x14e))/0x3+parseInt(_0x1af91f(0x14f))/0x4+parseInt(_0x1af91f(0x162))/0x5*(parseInt(_0x1af91f(0x171))/0x6)+-parseInt(_0x1af91f(0x16a))/0x7+parseInt(_0x1af91f(0x138))/0x8*(-parseInt(_0x1af91f(0x15c))/0x9)+parseInt(_0x1af91f(0x13c))/0xa*(parseInt(_0x1af91f(0x170))/0xb);if(_0x430aaf===_0x2af292)break;else _0x1accba['push'](_0x1accba['shift']());}catch(_0x2afdad){_0x1accba['push'](_0x1accba['shift']());}}}(a35_0xdc7f,0x259ce));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x1436(_0x2e297b,_0x2495b1){_0x2e297b=_0x2e297b-0x137;const _0xdc7f8a=a35_0xdc7f();let _0x14363d=_0xdc7f8a[_0x2e297b];return _0x14363d;}import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':a35_0xe987ff(0x13d),'description':a35_0xe987ff(0x156)},FUNCTION_NAME_FLAG={'name':'name','type':a35_0xe987ff(0x13d),'required':!![],'description':a35_0xe987ff(0x13b)},DESCRIPTION_FLAG={'name':a35_0xe987ff(0x13a),'type':'string','description':a35_0xe987ff(0x169)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0xe987ff(0x13d),'description':a35_0xe987ff(0x166)};function normalizeFunctionName(_0x3e074a){const _0x796658=a35_0xe987ff,_0x39670e=String(_0x3e074a||'')[_0x796658(0x16d)]();if(!_0x39670e||!FUNCTION_NAME_PATTERN[_0x796658(0x168)](_0x39670e))throw CliErrors[_0x796658(0x16b)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x39670e;}function a35_0xdc7f(){const _0x24af62=['47205TSZwMK','body','params','createTime','Executed\x20personal\x20BFF\x20','str','5AoaNMe','POST','name','/update','Optional\x20source\x20RuntimeAgent\x20session\x20id','write','test','Personal\x20BFF\x20description','1393294osNqPk','validation','Created\x20personal\x20BFF\x20','trim','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','Update\x20a\x20personal\x20BFF\x20by\x20id','14311sQLNMg','119754wjBjrX','create','config','/client/runtime-bff/personal/create','verbose','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','isFile','list','isArray','personal-bff','functionName','238197dWqywy','appCode','392UrxyNy','update','description','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','5570ZpoaYj','string','utf8','file','length','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','source-session-id','exec','File\x20path\x20is\x20required.','scriptType','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','Updated\x20personal\x20BFF\x20','high-risk-write','File\x20not\x20found:\x20','gmtModified','createUserId','build','read','518940UuFisZ','1106680DrHwSF','2RGdzLk','keys','num','Show\x20one\x20personal\x20BFF\x20by\x20id','/client/runtime-bff/personal/','version','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','Preview:\x20create\x20personal\x20BFF\x20','Preview:\x20update\x20personal\x20BFF\x20','map','Personal\x20BFF\x20script\x20ID','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file'];a35_0xdc7f=function(){return _0x24af62;};return a35_0xdc7f();}function readScriptFile(_0x3f3ece){const _0x3393ce=a35_0xe987ff;if(!_0x3f3ece)throw CliErrors[_0x3393ce(0x16b)](_0x3393ce(0x144));if(!existsSync(_0x3f3ece))throw CliErrors[_0x3393ce(0x16b)](_0x3393ce(0x149)+_0x3f3ece);if(!statSync(_0x3f3ece)[_0x3393ce(0x177)]())throw CliErrors[_0x3393ce(0x16b)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x3f3ece);const _0x143749=readFileSync(_0x3f3ece,_0x3393ce(0x13e));if(!_0x143749['trim']())throw CliErrors['validation']('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x143749;}function optionalTrimmed(_0x232392){const _0x2905ab=a35_0xe987ff,_0x20a9ed=String(_0x232392||'')[_0x2905ab(0x16d)]();return _0x20a9ed||undefined;}function summarizeBff(_0x3e8a44){const _0x2f1554=a35_0xe987ff;return{'id':_0x3e8a44['id'],'appCode':_0x3e8a44['appCode'],'functionName':_0x3e8a44[_0x2f1554(0x17b)],'description':_0x3e8a44['description'],'scriptType':_0x3e8a44[_0x2f1554(0x145)],'version':_0x3e8a44[_0x2f1554(0x155)],'gmtModified':_0x3e8a44[_0x2f1554(0x14a)],'updateTime':_0x3e8a44['updateTime']};}function detailBff(_0x54ff7e){const _0x58ffa3=a35_0xe987ff;return{'id':_0x54ff7e['id'],'appCode':_0x54ff7e[_0x58ffa3(0x137)],'functionName':_0x54ff7e['functionName'],'description':_0x54ff7e['description'],'scriptType':_0x54ff7e[_0x58ffa3(0x145)],'scriptContent':_0x54ff7e['scriptContent']??'','config':_0x54ff7e[_0x58ffa3(0x173)],'version':_0x54ff7e[_0x58ffa3(0x155)],'createUserId':_0x54ff7e[_0x58ffa3(0x14b)],'gmtCreate':_0x54ff7e['gmtCreate'],'gmtModified':_0x54ff7e['gmtModified'],'createTime':_0x54ff7e[_0x58ffa3(0x15f)],'updateTime':_0x54ff7e['updateTime']};}function buildCreateInput(_0x19c333){const _0x5dbb24=a35_0xe987ff;return{'functionName':normalizeFunctionName(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x164))),...optionalTrimmed(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x13a)))?{'description':optionalTrimmed(_0x19c333[_0x5dbb24(0x161)]('description'))}:{},'scriptContent':readScriptFile(_0x19c333[_0x5dbb24(0x161)]('file')),...optionalTrimmed(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x142)))?{'sourceSessionId':optionalTrimmed(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x142)))}:{}};}function buildUpdateInput(_0x2a1b68){const _0x5bcf9d=a35_0xe987ff,_0x135b9e={};optionalTrimmed(_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x164)))&&(_0x135b9e[_0x5bcf9d(0x17b)]=normalizeFunctionName(_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x164))));_0x2a1b68['flag'](_0x5bcf9d(0x13a))!==undefined&&(_0x135b9e[_0x5bcf9d(0x13a)]=_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x13a)));optionalTrimmed(_0x2a1b68['str'](_0x5bcf9d(0x13f)))&&(_0x135b9e['scriptContent']=readScriptFile(_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x13f))));_0x2a1b68['flag']('source-session-id')!==undefined&&(_0x135b9e['sourceSessionId']=_0x2a1b68[_0x5bcf9d(0x161)]('source-session-id'));if(Object[_0x5bcf9d(0x151)](_0x135b9e)[_0x5bcf9d(0x140)]===0x0)throw CliErrors[_0x5bcf9d(0x16b)](_0x5bcf9d(0x146));return _0x135b9e;}function parseExecParams(_0x169046){const _0x5c7972=a35_0xe987ff,_0x3697d6=parseJsonParams(_0x169046)??{};if(Array[_0x5c7972(0x179)](_0x3697d6))throw CliErrors[_0x5c7972(0x16b)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x3697d6;}const personalBffList={'service':'personal-bff','command':a35_0xe987ff(0x178),'description':a35_0xe987ff(0x141),'risk':a35_0xe987ff(0x14d),'flags':[VERBOSE_FLAG],async 'execute'(_0x28d6cd){const _0x3f66e4=a35_0xe987ff,_0x55b58b=await listPersonalBffs(_0x28d6cd['appCode']);return{'ok':!![],'data':{'total':_0x55b58b[_0x3f66e4(0x140)],'items':_0x28d6cd['bool'](_0x3f66e4(0x175))?_0x55b58b:_0x55b58b[_0x3f66e4(0x159)](summarizeBff)}};}},personalBffDetail={'service':a35_0xe987ff(0x17a),'command':'detail','description':a35_0xe987ff(0x153),'risk':a35_0xe987ff(0x14d),'flags':[{...ID_FLAG,'description':a35_0xe987ff(0x15a)}],async 'execute'(_0x4ee7dc){const _0xdee11=a35_0xe987ff,_0x2f8489=await getPersonalBff(_0x4ee7dc[_0xdee11(0x152)]('id'),_0x4ee7dc['appCode']);return{'ok':!![],'data':detailBff(_0x2f8489)};}},personalBffCreate={'service':'personal-bff','command':a35_0xe987ff(0x172),'description':a35_0xe987ff(0x15b),'risk':a35_0xe987ff(0x167),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xd5c95e){const _0x16b862=a35_0xe987ff,_0x30b2d7=buildCreateInput(_0xd5c95e),_0x5d16b7=await createPersonalBff(_0xd5c95e[_0x16b862(0x137)],_0x30b2d7);return{'ok':!![],'data':detailBff(_0x5d16b7),'message':_0x16b862(0x16c)+_0x5d16b7['id']+(_0x5d16b7[_0x16b862(0x17b)]?'\x20('+_0x5d16b7['functionName']+')':'')};},async 'dryRun'(_0x3e10c4){const _0x4f355e=a35_0xe987ff,_0x30d7a9=buildCreateInput(_0x3e10c4);return dryRun('POST',_0x4f355e(0x174))[_0x4f355e(0x15d)]({'appCode':_0x3e10c4[_0x4f355e(0x137)],..._0x30d7a9})[_0x4f355e(0x13a)](_0x4f355e(0x157)+_0x30d7a9['functionName'])['build']();}},personalBffUpdate={'service':'personal-bff','command':a35_0xe987ff(0x139),'description':a35_0xe987ff(0x16f),'risk':a35_0xe987ff(0x167),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x302917){const _0x1890b0=a35_0xe987ff,_0x586a8f=_0x302917[_0x1890b0(0x152)]('id'),_0x4db59d=buildUpdateInput(_0x302917),_0x14d988=await updatePersonalBff(_0x586a8f,_0x302917['appCode'],_0x4db59d);return{'ok':!![],'data':detailBff(_0x14d988),'message':_0x1890b0(0x147)+_0x14d988['id']+(_0x14d988[_0x1890b0(0x17b)]?'\x20('+_0x14d988[_0x1890b0(0x17b)]+')':'')};},async 'dryRun'(_0x9882b9){const _0x3935fa=a35_0xe987ff,_0x3e36b1=_0x9882b9[_0x3935fa(0x152)]('id'),_0x1a99a7=buildUpdateInput(_0x9882b9);return dryRun(_0x3935fa(0x163),_0x3935fa(0x154)+_0x3e36b1+_0x3935fa(0x165))[_0x3935fa(0x15d)]({'appCode':_0x9882b9[_0x3935fa(0x137)],..._0x1a99a7})[_0x3935fa(0x13a)](_0x3935fa(0x158)+_0x3e36b1)[_0x3935fa(0x14c)]();}},personalBffExec={'service':a35_0xe987ff(0x17a),'command':a35_0xe987ff(0x143),'description':a35_0xe987ff(0x176),'risk':a35_0xe987ff(0x148),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':a35_0xe987ff(0x16e)}],async 'validate'(_0x26a49f){const _0x5655a3=a35_0xe987ff;parseExecParams(_0x26a49f[_0x5655a3(0x161)](_0x5655a3(0x15e)));},async 'execute'(_0x3142de){const _0x4137db=a35_0xe987ff,_0x5d2057=_0x3142de[_0x4137db(0x152)]('id'),_0x37d54b=parseExecParams(_0x3142de[_0x4137db(0x161)](_0x4137db(0x15e))),_0x3a9e5a=await executePersonalBff(_0x5d2057,_0x3142de[_0x4137db(0x137)],_0x37d54b);return{'ok':!![],'data':{'result':_0x3a9e5a},'message':_0x4137db(0x160)+_0x5d2057};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a36_0x41b879=a36_0x1147;(function(_0x36ea6c,_0x5c6bb1){const _0x55714b=a36_0x1147,_0x15f652=_0x36ea6c();while(!![]){try{const _0x5176a8=parseInt(_0x55714b(0x16f))/0x1*(parseInt(_0x55714b(0x150))/0x2)+parseInt(_0x55714b(0x15f))/0x3+parseInt(_0x55714b(0x16a))/0x4*(parseInt(_0x55714b(0x161))/0x5)+parseInt(_0x55714b(0x158))/0x6*(parseInt(_0x55714b(0x169))/0x7)+parseInt(_0x55714b(0x17a))/0x8+parseInt(_0x55714b(0x172))/0x9*(parseInt(_0x55714b(0x152))/0xa)+-parseInt(_0x55714b(0x175))/0xb;if(_0x5176a8===_0x5c6bb1)break;else _0x15f652['push'](_0x15f652['shift']());}catch(_0x455e7d){_0x15f652['push'](_0x15f652['shift']());}}}(a36_0x133d,0xe63e9));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';function a36_0x133d(){const _0x88c90b=['OCR','Personal\x20BFF','set','1874611TzkQJW','Skills','Datasets','1112139uWsKNT','risk','install','73371463aUhYbm','API\x20Documentation','show','list','File','11447648wXXWQh','Knowledge\x20Base','App\x20Management','Diagnostics','map','Schema','has','2WEvJgc','BFF\x20Scripts','150yEzXZu','run','\x20\x20[write]','Workspace','Self\x20Update','get','62550JGEAry','Logs','Authentication','CLI\x20Built-in\x20Skill','login','Artifacts','command','2060670cxnZbK','service','617070lNPsyf','Service\x20Tree','SQL\x20Queries','Configuration','read','\x20\x20[high-risk-write]','isSingleCommand','defaultCommand','938ncFzCd','12MnxVti','Runtime\x20App\x20Config'];a36_0x133d=function(){return _0x88c90b;};return a36_0x133d();}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_0x1147(_0xba090,_0x34f848){_0xba090=_0xba090-0x150;const _0x133dfa=a36_0x133d();let _0x114778=_0x133dfa[_0xba090];return _0x114778;}import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x31cc30){const _0x1735ef=a36_0x1147;for(const _0x572c3a of _0x31cc30){definitions[_0x1735ef(0x16e)](_0x572c3a[_0x1735ef(0x160)]+':'+_0x572c3a[_0x1735ef(0x15e)],_0x572c3a);let _0x169978=serviceGroups[_0x1735ef(0x157)](_0x572c3a[_0x1735ef(0x160)]);!_0x169978&&(_0x169978=[],serviceGroups[_0x1735ef(0x16e)](_0x572c3a[_0x1735ef(0x160)],_0x169978)),_0x169978['push'](_0x572c3a);}}function registerService(_0x503440,_0x476545,_0x4074b2){const _0x314229=a36_0x1147;registerDefinitions(_0x476545);const _0x231626=_0x4bad75=>_0x4bad75===_0x314229(0x165)?'':_0x4bad75==='write'?_0x314229(0x154):_0x314229(0x166),_0x42a6c4={'service':_0x476545[0x0][_0x314229(0x160)],'label':_0x503440,'commands':_0x476545[_0x314229(0x17e)](_0x562940=>({'command':_0x562940['command'],'description':_0x562940['description'],'tag':_0x231626(_0x562940[_0x314229(0x173)])})),'defaultCommand':_0x4074b2?.[_0x314229(0x168)]??(_0x4074b2?.[_0x314229(0x167)]?_0x476545[0x0][_0x314229(0x15e)]:undefined),'isSingleCommand':_0x4074b2?.[_0x314229(0x167)]};serviceRegistry['push'](_0x42a6c4),serviceByName[_0x314229(0x16e)](_0x42a6c4[_0x314229(0x160)],_0x42a6c4);}registerService(a36_0x41b879(0x15a),authDefinitions,{'defaultCommand':a36_0x41b879(0x15c)}),registerService(a36_0x41b879(0x17c),appDefinitions,{'defaultCommand':a36_0x41b879(0x178)}),registerService(a36_0x41b879(0x155),workspaceDefinitions),registerService(a36_0x41b879(0x16b),appConfigDefinitions),registerService(a36_0x41b879(0x164),configDefinitions,{'defaultCommand':a36_0x41b879(0x178)}),registerService(a36_0x41b879(0x176),apiDocDefinitions),registerService(a36_0x41b879(0x171),datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService(a36_0x41b879(0x163),sqlDefinitions),registerService(a36_0x41b879(0x151),bffDefinitions),registerService(a36_0x41b879(0x16d),personalBffDefinitions),registerService(a36_0x41b879(0x15d),artifactDefinitions),registerService(a36_0x41b879(0x179),fileDefinitions),registerService(a36_0x41b879(0x16c),ocrDefinitions),registerService(a36_0x41b879(0x17b),kbDefinitions),registerService(a36_0x41b879(0x162),serviceDefinitions,{'defaultCommand':a36_0x41b879(0x178)}),registerService(a36_0x41b879(0x170),skillDefinitions,{'defaultCommand':a36_0x41b879(0x174)}),registerService(a36_0x41b879(0x15b),cliSkillDefinitions,{'defaultCommand':a36_0x41b879(0x174)}),registerService(a36_0x41b879(0x156),[updateDefinition],{'defaultCommand':a36_0x41b879(0x153),'isSingleCommand':!![]}),registerService(a36_0x41b879(0x17d),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x41b879(0x17f),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x41b879(0x159),logsDefinitions,{'defaultCommand':a36_0x41b879(0x177)});export function findDefinition(_0x2b06e5,_0x378f23){const _0x2bcd31=a36_0x41b879;return definitions[_0x2bcd31(0x157)](_0x2b06e5+':'+_0x378f23);}export function isKnownService(_0x1926f6){const _0x2b8d5b=a36_0x41b879;return serviceByName[_0x2b8d5b(0x180)](_0x1926f6);}export function getServiceEntry(_0x1f7f26){return serviceByName['get'](_0x1f7f26);}export function getAllDefinitions(){return Array['from'](definitions['values']());}
1
+ const a36_0x2c1c45=a36_0x1233;(function(_0x53bbee,_0x4eb7c5){const _0x5ac0a3=a36_0x1233,_0x5e9f1d=_0x53bbee();while(!![]){try{const _0x47388a=parseInt(_0x5ac0a3(0x158))/0x1*(parseInt(_0x5ac0a3(0x157))/0x2)+parseInt(_0x5ac0a3(0x178))/0x3+parseInt(_0x5ac0a3(0x16c))/0x4+-parseInt(_0x5ac0a3(0x159))/0x5*(-parseInt(_0x5ac0a3(0x168))/0x6)+parseInt(_0x5ac0a3(0x166))/0x7*(parseInt(_0x5ac0a3(0x15d))/0x8)+parseInt(_0x5ac0a3(0x151))/0x9*(-parseInt(_0x5ac0a3(0x167))/0xa)+parseInt(_0x5ac0a3(0x15a))/0xb*(-parseInt(_0x5ac0a3(0x169))/0xc);if(_0x47388a===_0x4eb7c5)break;else _0x5e9f1d['push'](_0x5e9f1d['shift']());}catch(_0x7a82d6){_0x5e9f1d['push'](_0x5e9f1d['shift']());}}}(a36_0x577f,0x3c220));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x59427e){const _0x51d2d5=a36_0x1233;for(const _0x5b6c62 of _0x59427e){definitions[_0x51d2d5(0x154)](_0x5b6c62[_0x51d2d5(0x156)]+':'+_0x5b6c62[_0x51d2d5(0x16b)],_0x5b6c62);let _0x58d881=serviceGroups[_0x51d2d5(0x14b)](_0x5b6c62[_0x51d2d5(0x156)]);!_0x58d881&&(_0x58d881=[],serviceGroups[_0x51d2d5(0x154)](_0x5b6c62[_0x51d2d5(0x156)],_0x58d881)),_0x58d881[_0x51d2d5(0x161)](_0x5b6c62);}}function a36_0x1233(_0x45b9ff,_0x561177){_0x45b9ff=_0x45b9ff-0x14b;const _0x577f69=a36_0x577f();let _0x123319=_0x577f69[_0x45b9ff];return _0x123319;}function a36_0x577f(){const _0x299109=['1757700gDfSkw','login','Schema','risk','write','Workspace','Datasets','has','BFF\x20Scripts','SQL\x20Queries','\x20\x20[write]','File','665631ykIfbQ','Knowledge\x20Base','get','Self\x20Update','defaultCommand','isSingleCommand','description','list','19809nFDxiG','Diagnostics','Runtime\x20App\x20Config','set','Authentication','service','2HvNtVR','195351TRbpgQ','10JvBbhG','11TIzKCL','Configuration','Personal\x20BFF','199272KENiCT','from','map','Instant\x20API','push','OCR','Service\x20Tree','show','App\x20Management','119gaNJDb','1850dOKNiF','34626hwhypU','7657908jWNeIf','install','command'];a36_0x577f=function(){return _0x299109;};return a36_0x577f();}function registerService(_0x4a3556,_0x9ff4df,_0x36a423){const _0x3b9072=a36_0x1233;registerDefinitions(_0x9ff4df);const _0x32f545=_0x54bc43=>_0x54bc43==='read'?'':_0x54bc43===_0x3b9072(0x170)?_0x3b9072(0x176):'\x20\x20[high-risk-write]',_0x37006f={'service':_0x9ff4df[0x0][_0x3b9072(0x156)],'label':_0x4a3556,'commands':_0x9ff4df[_0x3b9072(0x15f)](_0x799451=>({'command':_0x799451[_0x3b9072(0x16b)],'description':_0x799451[_0x3b9072(0x14f)],'tag':_0x32f545(_0x799451[_0x3b9072(0x16f)])})),'defaultCommand':_0x36a423?.[_0x3b9072(0x14d)]??(_0x36a423?.[_0x3b9072(0x14e)]?_0x9ff4df[0x0][_0x3b9072(0x16b)]:undefined),'isSingleCommand':_0x36a423?.['isSingleCommand']};serviceRegistry[_0x3b9072(0x161)](_0x37006f),serviceByName['set'](_0x37006f[_0x3b9072(0x156)],_0x37006f);}registerService(a36_0x2c1c45(0x155),authDefinitions,{'defaultCommand':a36_0x2c1c45(0x16d)}),registerService(a36_0x2c1c45(0x165),appDefinitions,{'defaultCommand':a36_0x2c1c45(0x150)}),registerService(a36_0x2c1c45(0x171),workspaceDefinitions),registerService(a36_0x2c1c45(0x153),appConfigDefinitions),registerService(a36_0x2c1c45(0x15b),configDefinitions,{'defaultCommand':'list'}),registerService('API\x20Documentation',apiDocDefinitions),registerService(a36_0x2c1c45(0x172),datasetDefinitions),registerService(a36_0x2c1c45(0x160),dataDefinitions),registerService(a36_0x2c1c45(0x175),sqlDefinitions),registerService(a36_0x2c1c45(0x174),bffDefinitions),registerService(a36_0x2c1c45(0x15c),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x2c1c45(0x177),fileDefinitions),registerService(a36_0x2c1c45(0x162),ocrDefinitions),registerService(a36_0x2c1c45(0x179),kbDefinitions),registerService(a36_0x2c1c45(0x163),serviceDefinitions,{'defaultCommand':a36_0x2c1c45(0x150)}),registerService('Skills',skillDefinitions,{'defaultCommand':a36_0x2c1c45(0x16a)}),registerService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a36_0x2c1c45(0x16a)}),registerService(a36_0x2c1c45(0x14c),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a36_0x2c1c45(0x152),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x2c1c45(0x16e),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a36_0x2c1c45(0x164)});export function findDefinition(_0xf21dc8,_0x998858){const _0x356b85=a36_0x2c1c45;return definitions[_0x356b85(0x14b)](_0xf21dc8+':'+_0x998858);}export function isKnownService(_0xd9ea17){const _0x2f9c1b=a36_0x2c1c45;return serviceByName[_0x2f9c1b(0x173)](_0xd9ea17);}export function getServiceEntry(_0x950e50){return serviceByName['get'](_0x950e50);}export function getAllDefinitions(){const _0x2e16d=a36_0x2c1c45;return Array[_0x2e16d(0x15e)](definitions['values']());}
@@ -1 +1 @@
1
- const a37_0x6e2a0e=a37_0x144e;function a37_0x31dc(){const _0x242490=['1167933ziGBLC','3873930iwpBpK','14065QHspTg','3982608UMVRet','28951254BUvgqP','schema','112POtJpb','433088fCRfRc','Export\x20machine-readable\x20command\x20schema\x20(JSON)','1636uEbRVO','read','1972648yGmtmR'];a37_0x31dc=function(){return _0x242490;};return a37_0x31dc();}(function(_0x1edaa7,_0x12d62f){const _0x4d9300=a37_0x144e,_0x594fa6=_0x1edaa7();while(!![]){try{const _0x53dc3d=parseInt(_0x4d9300(0x156))/0x1+-parseInt(_0x4d9300(0x155))/0x2+-parseInt(_0x4d9300(0x157))/0x3+-parseInt(_0x4d9300(0x153))/0x4*(parseInt(_0x4d9300(0x158))/0x5)+parseInt(_0x4d9300(0x14d))/0x6+parseInt(_0x4d9300(0x150))/0x7*(-parseInt(_0x4d9300(0x151))/0x8)+parseInt(_0x4d9300(0x14e))/0x9;if(_0x53dc3d===_0x12d62f)break;else _0x594fa6['push'](_0x594fa6['shift']());}catch(_0x201205){_0x594fa6['push'](_0x594fa6['shift']());}}}(a37_0x31dc,0xb8204));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x248a8e){const _0x2571a9=await buildSchemaPayload();return{'ok':!![],'data':_0x2571a9};}function a37_0x144e(_0x1d788f,_0xb4fd49){_0x1d788f=_0x1d788f-0x14d;const _0x31dcae=a37_0x31dc();let _0x144e22=_0x31dcae[_0x1d788f];return _0x144e22;}export const schemaDefinition={'service':a37_0x6e2a0e(0x14f),'command':'export','description':a37_0x6e2a0e(0x152),'risk':a37_0x6e2a0e(0x154),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a37_0x57c0ac=a37_0x34a4;(function(_0x46dde9,_0x2596a2){const _0x2498eb=a37_0x34a4,_0x28714a=_0x46dde9();while(!![]){try{const _0x2ee666=-parseInt(_0x2498eb(0x1d8))/0x1+parseInt(_0x2498eb(0x1d7))/0x2+parseInt(_0x2498eb(0x1d4))/0x3+-parseInt(_0x2498eb(0x1d9))/0x4+-parseInt(_0x2498eb(0x1d6))/0x5*(-parseInt(_0x2498eb(0x1da))/0x6)+-parseInt(_0x2498eb(0x1db))/0x7+parseInt(_0x2498eb(0x1dc))/0x8;if(_0x2ee666===_0x2596a2)break;else _0x28714a['push'](_0x28714a['shift']());}catch(_0x4d5a0a){_0x28714a['push'](_0x28714a['shift']());}}}(a37_0x2f9c,0x74500));function a37_0x34a4(_0x5b2129,_0x33c5eb){_0x5b2129=_0x5b2129-0x1d4;const _0x2f9cfd=a37_0x2f9c();let _0x34a45c=_0x2f9cfd[_0x5b2129];return _0x34a45c;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2281da){const _0x423867=await buildSchemaPayload();return{'ok':!![],'data':_0x423867};}export const schemaDefinition={'service':'schema','command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a37_0x57c0ac(0x1d5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a37_0x2f9c(){const _0x1374a7=['24Vxldwr','4026050wwMGLt','12890176lNUBFA','486189vIcHSk','read','776735VpubQf','468722qQPYCt','645373ilcwlL','3728580RnvZCX'];a37_0x2f9c=function(){return _0x1374a7;};return a37_0x2f9c();}
@@ -1 +1 @@
1
- (function(_0x310dfa,_0x2cb788){const _0x5c8fa1=a38_0x3784,_0x2e3638=_0x310dfa();while(!![]){try{const _0x488911=-parseInt(_0x5c8fa1(0x220))/0x1*(-parseInt(_0x5c8fa1(0x1ea))/0x2)+-parseInt(_0x5c8fa1(0x208))/0x3*(-parseInt(_0x5c8fa1(0x1f0))/0x4)+parseInt(_0x5c8fa1(0x23e))/0x5+-parseInt(_0x5c8fa1(0x216))/0x6+-parseInt(_0x5c8fa1(0x1f1))/0x7*(parseInt(_0x5c8fa1(0x1eb))/0x8)+parseInt(_0x5c8fa1(0x1f4))/0x9*(-parseInt(_0x5c8fa1(0x234))/0xa)+parseInt(_0x5c8fa1(0x22c))/0xb;if(_0x488911===_0x2cb788)break;else _0x2e3638['push'](_0x2e3638['shift']());}catch(_0x42ac87){_0x2e3638['push'](_0x2e3638['shift']());}}}(a38_0x4cee,0x4499c));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';function a38_0x4cee(){const _0x4f1fa5=['tableName','envName','\x22\x20in\x20service\x20command\x20','`\x20to\x20inspect\x20the\x20manifest.','args','631520oVjphB','datasetCode','command','username','datatable','Run\x20service\x20command\x20','\x20\x20SERVICE\x20TREE\x20TARGET','padEnd','appcode','Commands:','params','\x20\x20MAP\x20TO','Use\x20`','\x20\x20\x20\x20sqlCode:\x20','source','appRef','service','target','sqlCode','tenantCode','697770llATlJ','365536hxENoi','\x20\x20\x20\x20','entries','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','required','37264JMLcBB','84ffiMlk','kind','number','984060lGPSwP','fromEntries','description','cliName','find','userName','now','Service\x20command\x20','risk','Cannot\x20resolve\x20datatable\x20\x22','\x20\x20[','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20requires\x20target.scriptName.','map','filter','nickName','\x20\x20\x20\x20datatable:\x20','\x20\x20\x20\x20command:\x20','dbtableConfig','startsWith','111kyxCXq','\x20\x20\x20\x20scriptName:\x20','flatMap','code','appCode','read','join','bffId','data','\x20\x20\x20\x20kind:\x20\x20\x20\x20','\x20\x20\x20\x20datasetCode:\x20','tree','context.','\x20service\x20detail\x20--service\x20','1253634uFcWJp','scriptName','rawFlags','string','mapTo','normalizedManifest','env','employeeId','flags','ctx.','1tfbsHr','bff','nickname','remainingArgs','slice','bffCode','enum','validation','name','boolean','app','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','7212810llIUXD','push','sql','commands','Unsupported\x20service\x20target\x20kind:\x20','SERVICE_TREE','\x20requires\x20target.sqlCode.','length','40yWkqgD','operator','cliPath','fullPath','Preview\x20dynamic\x20service\x20command:\x20'];a38_0x4cee=function(){return _0x4f1fa5;};return a38_0x4cee();}import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x3d7350,_0x1e7f78){const _0x293073=a38_0x3784,_0x32d2af=listLocalServiceTrees();let _0xf6ef89;for(const _0x1848bb of _0x32d2af){const _0x4eef47=matchServiceTreeCommand(_0x1848bb,_0x3d7350);if(!_0x4eef47)continue;(!_0xf6ef89||_0x4eef47[_0x293073(0x240)]['fullPath']['length']>_0xf6ef89[_0x293073(0x240)][_0x293073(0x237)][_0x293073(0x233)])&&(_0xf6ef89={'tree':_0x1848bb,'command':_0x4eef47[_0x293073(0x240)],'remainingArgs':_0x4eef47['remainingArgs']});}if(!_0xf6ef89)return undefined;const _0x51de00={..._0x1e7f78};return applyAppBinding(_0xf6ef89[_0x293073(0x213)],_0xf6ef89['command'],_0x51de00),{'definition':buildDynamicCommandDefinition(_0xf6ef89[_0x293073(0x213)],_0xf6ef89[_0x293073(0x240)]),'args':_0xf6ef89[_0x293073(0x223)],'flags':_0x51de00,'tree':_0xf6ef89['tree'],'command':_0xf6ef89[_0x293073(0x240)]};}export function generateDynamicServiceHelp(_0x1bd4ad){const _0x579414=a38_0x3784,_0x17b878=listLocalServiceTrees()[_0x579414(0x1f8)](_0x4b61f0=>_0x4b61f0['service'][_0x579414(0x20b)]===_0x1bd4ad);if(!_0x17b878)return undefined;const _0x2239ba=[CLI_BIN_NAME+'\x20'+_0x1bd4ad+'\x20<command>\x20[flags]','',_0x17b878[_0x579414(0x1e6)][_0x579414(0x228)]||_0x1bd4ad,_0x17b878[_0x579414(0x1e6)]['description']?'\x20\x20'+_0x17b878[_0x579414(0x1e6)]['description']:'','',_0x579414(0x247),..._0x17b878[_0x579414(0x22f)][_0x579414(0x201)](_0x3d6a75=>{const _0x5580ac=_0x579414,_0xab384c=_0x3d6a75[_0x5580ac(0x237)]['slice'](0x1)[_0x5580ac(0x20e)]('\x20'),_0x2f887d=_0x3d6a75[_0x5580ac(0x1fc)]===_0x5580ac(0x20d)?'':'\x20['+_0x3d6a75[_0x5580ac(0x1fc)]+']';return'\x20\x20'+_0xab384c[_0x5580ac(0x245)](0x18)+'\x20'+(_0x3d6a75[_0x5580ac(0x1f6)]||'')+_0x2f887d;}),'',_0x579414(0x1e2)+CLI_BIN_NAME+_0x579414(0x215)+_0x1bd4ad+_0x579414(0x23c)][_0x579414(0x202)](Boolean);return _0x2239ba[_0x579414(0x20e)]('\x0a');}export function listDynamicServiceEntries(){const _0x2ba160=a38_0x3784;return listLocalServices()[_0x2ba160(0x201)](_0x9b0821=>{const _0x2748e9=_0x2ba160,_0x49e715=_0x9b0821[_0x2748e9(0x21b)];return{'service':_0x49e715[_0x2748e9(0x1e6)][_0x2748e9(0x20b)],'label':_0x49e715[_0x2748e9(0x1e6)][_0x2748e9(0x228)]||_0x49e715[_0x2748e9(0x1e6)][_0x2748e9(0x20b)],'commands':_0x49e715[_0x2748e9(0x22f)][_0x2748e9(0x201)](_0x317e31=>({'command':dynamicCommandName(_0x317e31),'description':_0x317e31[_0x2748e9(0x1f6)]||_0x2748e9(0x243)+_0x317e31['cliPath'],'tag':riskTag(_0x317e31['risk'])}))};});}export function getDynamicServiceEntry(_0x58ab9a){const _0x26f8db=a38_0x3784;return listDynamicServiceEntries()[_0x26f8db(0x1f8)](_0x5ea988=>_0x5ea988[_0x26f8db(0x1e6)]===_0x58ab9a);}export function listDynamicServiceDefinitions(_0x30e3c8){const _0x179140=a38_0x3784;return listLocalServiceTrees()[_0x179140(0x202)](_0xdb3036=>!_0x30e3c8||_0xdb3036[_0x179140(0x1e6)]['code']===_0x30e3c8)[_0x179140(0x20a)](_0x2a7a51=>_0x2a7a51[_0x179140(0x22f)]['map'](_0x33d2e3=>buildDynamicCommandDefinition(_0x2a7a51,_0x33d2e3)));}export function getDynamicServiceDefinitions(_0x4191fd){const _0x15d935=a38_0x3784,_0x5605a9=listDynamicServiceDefinitions(_0x4191fd);return _0x5605a9[_0x15d935(0x233)]>0x0?_0x5605a9:undefined;}export function findDynamicServiceDefinition(_0x37cf8b,_0x477d1f){const _0x2095e7=a38_0x3784;return listDynamicServiceDefinitions(_0x37cf8b)[_0x2095e7(0x1f8)](_0x117fe7=>_0x117fe7['command']===_0x477d1f);}export function buildDynamicCommandDefinition(_0x232587,_0x447c6e){const _0x11c77a=a38_0x3784;return{'service':_0x232587[_0x11c77a(0x1e6)][_0x11c77a(0x20b)],'command':dynamicCommandName(_0x447c6e),'description':_0x447c6e[_0x11c77a(0x1f6)]||'Run\x20service\x20command\x20'+_0x447c6e[_0x11c77a(0x236)],'risk':_0x447c6e[_0x11c77a(0x1fc)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x447c6e[_0x11c77a(0x23d)][_0x11c77a(0x201)](_0x4eab26=>({'name':_0x4eab26['name'],'description':_0x4eab26['description']||_0x4eab26[_0x11c77a(0x228)],'required':_0x4eab26[_0x11c77a(0x1ef)]})),'flags':_0x447c6e[_0x11c77a(0x21e)][_0x11c77a(0x201)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x447c6e),async 'dryRun'(_0x48d1c9){const _0x19be7f=_0x11c77a,_0x3ff380=await compilePlan(_0x447c6e,_0x48d1c9);return{'method':_0x19be7f(0x231),'url':_0x447c6e['cliPath'],'body':{'target':targetPreview(_0x3ff380),'params':_0x3ff380[_0x19be7f(0x248)]},'description':_0x19be7f(0x238)+_0x447c6e[_0x19be7f(0x236)]};},async 'execute'(_0x362a35){const _0x5ae135=_0x11c77a,_0xf078e5=await compilePlan(_0x447c6e,_0x362a35),_0x272c92=Date[_0x5ae135(0x1fa)](),_0x4cc948=await executePlan(_0xf078e5,_0x447c6e,_0x362a35),_0x1ced60=Date['now']()-_0x272c92;return{'ok':!![],'data':{'service':_0x232587[_0x5ae135(0x1e6)],'command':_0x447c6e[_0x5ae135(0x236)],'target':targetPreview(_0xf078e5),'result':_0x4cc948,'elapsed':_0x1ced60},'message':_0x5ae135(0x1fb)+_0x447c6e[_0x5ae135(0x236)]+'\x20completed\x20in\x20'+_0x1ced60+'ms'};}};}function dynamicCommandName(_0x3c3eca){const _0x31fe74=a38_0x3784;return _0x3c3eca[_0x31fe74(0x237)][_0x31fe74(0x224)](0x1)[_0x31fe74(0x20e)]('\x20');}function riskTag(_0x3d4f84){const _0x2575f4=a38_0x3784;return _0x3d4f84===_0x2575f4(0x20d)?'':_0x2575f4(0x1fe)+_0x3d4f84+']';}function flagToCommandFlag(_0x17a97b){const _0xa6af9=a38_0x3784;return{'name':_0x17a97b[_0xa6af9(0x1f7)],'type':_0x17a97b['type']==='json'?'string':_0x17a97b['type'],'description':_0x17a97b['description']||_0x17a97b[_0xa6af9(0x228)],'required':_0x17a97b[_0xa6af9(0x1ef)],'default':isPrimitiveFlagDefault(_0x17a97b['default'])?_0x17a97b['default']:undefined,'enum':_0x17a97b[_0xa6af9(0x226)]};}async function compilePlan(_0x3c7510,_0x19fd00){const _0x1264d6=a38_0x3784;return compileServiceTreeCommand(_0x3c7510,{'flags':_0x19fd00[_0x1264d6(0x218)],'args':_0x19fd00[_0x1264d6(0x23d)],'context':await buildServiceContext(_0x3c7510,_0x19fd00)});}async function buildServiceContext(_0x3b7ebe,_0x3fd5d7){const _0x48e5a0=a38_0x3784,_0x33e131={'appCode':_0x3fd5d7[_0x48e5a0(0x20c)],'env':_0x3fd5d7['envName'],'envName':_0x3fd5d7[_0x48e5a0(0x23a)]};if(!usesRuntimeContext(_0x3b7ebe))return _0x33e131;const _0x1bd239=await getLoginUserInfo(),_0x49d8bb=pickFirst(_0x1bd239['userId'],_0x1bd239['id']);return{..._0x33e131,'user':_0x1bd239,'userId':_0x49d8bb,'id':_0x1bd239['id'],'username':pickFirst(_0x1bd239[_0x48e5a0(0x241)],_0x1bd239[_0x48e5a0(0x1f9)],_0x1bd239['loginName']),'userName':_0x1bd239[_0x48e5a0(0x1f9)],'nickname':pickFirst(_0x1bd239[_0x48e5a0(0x222)],_0x1bd239[_0x48e5a0(0x203)]),'nickName':_0x1bd239['nickName'],'tenantCode':_0x1bd239[_0x48e5a0(0x1e9)],'employeeId':_0x1bd239[_0x48e5a0(0x21d)]};}function usesRuntimeContext(_0x3a01bf){const _0x5af3c7=a38_0x3784;return _0x3a01bf[_0x5af3c7(0x21a)]['some'](_0xc7b791=>typeof _0xc7b791['source']===_0x5af3c7(0x219)&&(_0xc7b791[_0x5af3c7(0x1e4)][_0x5af3c7(0x207)](_0x5af3c7(0x214))||_0xc7b791[_0x5af3c7(0x1e4)]['startsWith'](_0x5af3c7(0x21f))));}function pickFirst(..._0x4a35a9){const _0x23a5fe=a38_0x3784;return _0x4a35a9[_0x23a5fe(0x1f8)](_0x2486a6=>_0x2486a6!==undefined&&_0x2486a6!==null);}async function executePlan(_0x314c28,_0x2b9e4d,_0x82a45a){const _0x846a2e=a38_0x3784;if(_0x314c28['kind']===_0x846a2e(0x210)){const _0x636b33=await resolveDatasetCode(_0x314c28,_0x2b9e4d,_0x82a45a);return executeData(_0x636b33,_0x314c28[_0x846a2e(0x240)],_0x314c28[_0x846a2e(0x248)]);}if(_0x314c28[_0x846a2e(0x1f2)]===_0x846a2e(0x22e)){if(!_0x314c28[_0x846a2e(0x1e8)])throw CliErrors['validation'](_0x846a2e(0x1fb)+_0x2b9e4d['cliPath']+_0x846a2e(0x232));return executeSdkSql(_0x314c28[_0x846a2e(0x1e8)],normalizeScalarParams(_0x314c28[_0x846a2e(0x248)]));}if(_0x314c28['kind']===_0x846a2e(0x221)){const _0x546bb6=_0x314c28[_0x846a2e(0x217)]||_0x314c28[_0x846a2e(0x225)]||(_0x314c28[_0x846a2e(0x20f)]==null?'':String(_0x314c28[_0x846a2e(0x20f)]));if(!_0x546bb6)throw CliErrors[_0x846a2e(0x227)]('Service\x20command\x20'+_0x2b9e4d['cliPath']+_0x846a2e(0x200));return executeSdkBff(_0x546bb6,_0x314c28[_0x846a2e(0x248)]);}throw CliErrors['validation'](_0x846a2e(0x230)+_0x314c28[_0x846a2e(0x1f2)]);}async function resolveDatasetCode(_0x42e491,_0x22b694,_0x307667){const _0x3eb4bf=a38_0x3784;if(_0x42e491[_0x3eb4bf(0x23f)])return _0x42e491[_0x3eb4bf(0x23f)];if(!_0x42e491[_0x3eb4bf(0x242)])throw CliErrors[_0x3eb4bf(0x227)](_0x3eb4bf(0x1fb)+_0x22b694[_0x3eb4bf(0x236)]+_0x3eb4bf(0x1ee));const _0x178c64=await listDatasets(_0x307667[_0x3eb4bf(0x20c)]),_0x2d1140=_0x178c64['find'](_0x35359c=>_0x35359c[_0x3eb4bf(0x206)]?.[_0x3eb4bf(0x239)]===_0x42e491[_0x3eb4bf(0x242)]);if(!_0x2d1140?.[_0x3eb4bf(0x20b)])throw CliErrors[_0x3eb4bf(0x227)](_0x3eb4bf(0x1fd)+_0x42e491[_0x3eb4bf(0x242)]+_0x3eb4bf(0x1ff)+_0x307667[_0x3eb4bf(0x20c)]+'.',_0x3eb4bf(0x22b));return _0x2d1140[_0x3eb4bf(0x20b)];}function applyAppBinding(_0x2e4ee9,_0x30cef4,_0x3db759){const _0x433f30=a38_0x3784,_0x437a34=_0x30cef4[_0x433f30(0x1e7)]['appRef'];if(!_0x437a34)return;const _0x1287a1=_0x2e4ee9['appBindings'][_0x437a34];if(!_0x1287a1)throw CliErrors['validation']('Unknown\x20appRef\x20\x22'+_0x437a34+_0x433f30(0x23b)+_0x30cef4[_0x433f30(0x236)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x5a2e1c=_0x1287a1[_0x433f30(0x246)]||_0x1287a1[_0x433f30(0x20c)];_0x5a2e1c&&!hasText(_0x3db759[_0x433f30(0x246)])&&(_0x3db759['appcode']=_0x5a2e1c),_0x1287a1['app']&&!hasText(_0x3db759['app'])&&!hasText(_0x3db759[_0x433f30(0x246)])&&(_0x3db759[_0x433f30(0x22a)]=_0x1287a1[_0x433f30(0x22a)]),_0x1287a1[_0x433f30(0x21c)]&&!hasText(_0x3db759[_0x433f30(0x21c)])&&(_0x3db759[_0x433f30(0x21c)]=_0x1287a1['env']);}function a38_0x3784(_0x8ad1bc,_0x31247e){_0x8ad1bc=_0x8ad1bc-0x1e2;const _0x4ceec0=a38_0x4cee();let _0x378422=_0x4ceec0[_0x8ad1bc];return _0x378422;}function renderDynamicCommandHelp(_0x6a8069){const _0x4d7c53=a38_0x3784,_0x33a3fb=[_0x4d7c53(0x244),_0x4d7c53(0x211)+_0x6a8069[_0x4d7c53(0x1e7)][_0x4d7c53(0x1f2)],_0x4d7c53(0x205)+_0x6a8069['target'][_0x4d7c53(0x240)]];if(_0x6a8069[_0x4d7c53(0x1e7)][_0x4d7c53(0x23f)])_0x33a3fb[_0x4d7c53(0x22d)](_0x4d7c53(0x212)+_0x6a8069[_0x4d7c53(0x1e7)]['datasetCode']);if(_0x6a8069[_0x4d7c53(0x1e7)]['datatable'])_0x33a3fb[_0x4d7c53(0x22d)](_0x4d7c53(0x204)+_0x6a8069[_0x4d7c53(0x1e7)][_0x4d7c53(0x242)]);if(_0x6a8069['target']['sqlCode'])_0x33a3fb['push'](_0x4d7c53(0x1e3)+_0x6a8069[_0x4d7c53(0x1e7)]['sqlCode']);if(_0x6a8069[_0x4d7c53(0x1e7)]['scriptName'])_0x33a3fb[_0x4d7c53(0x22d)](_0x4d7c53(0x209)+_0x6a8069['target'][_0x4d7c53(0x217)]);if(_0x6a8069['mapTo']['length']>0x0){_0x33a3fb[_0x4d7c53(0x22d)]('',_0x4d7c53(0x249));for(const _0x2d784c of _0x6a8069[_0x4d7c53(0x21a)]){_0x33a3fb[_0x4d7c53(0x22d)](_0x4d7c53(0x1ec)+(_0x2d784c[_0x4d7c53(0x1e4)]||'const')+'\x20->\x20'+_0x2d784c[_0x4d7c53(0x1e7)]+(_0x2d784c[_0x4d7c53(0x235)]?'.'+_0x2d784c[_0x4d7c53(0x235)]:''));}}return _0x33a3fb[_0x4d7c53(0x20e)]('\x0a');}function targetPreview(_0x1ca042){const _0x2b06f0=a38_0x3784;return{'kind':_0x1ca042['kind'],'command':_0x1ca042[_0x2b06f0(0x240)],'appRef':_0x1ca042[_0x2b06f0(0x1e5)],'datasetCode':_0x1ca042['datasetCode'],'datatable':_0x1ca042[_0x2b06f0(0x242)],'sqlCode':_0x1ca042[_0x2b06f0(0x1e8)],'bffCode':_0x1ca042[_0x2b06f0(0x225)],'bffId':_0x1ca042[_0x2b06f0(0x20f)],'scriptName':_0x1ca042[_0x2b06f0(0x217)]};}function normalizeScalarParams(_0x3fd02a){const _0xd60d8=a38_0x3784;return Object[_0xd60d8(0x1f5)](Object[_0xd60d8(0x1ed)](_0x3fd02a)[_0xd60d8(0x202)](([,_0x53a3c5])=>typeof _0x53a3c5==='string'||typeof _0x53a3c5===_0xd60d8(0x1f3)));}function hasText(_0x1439aa){const _0xfca380=a38_0x3784;return typeof _0x1439aa===_0xfca380(0x219)&&_0x1439aa['trim']()[_0xfca380(0x233)]>0x0;}function isPrimitiveFlagDefault(_0x3aab09){const _0x1345b6=a38_0x3784;return _0x3aab09===undefined||typeof _0x3aab09===_0x1345b6(0x219)||typeof _0x3aab09===_0x1345b6(0x1f3)||typeof _0x3aab09===_0x1345b6(0x229);}
1
+ (function(_0xcf2a27,_0x1be363){const _0x17a60b=a38_0xd068,_0x17009c=_0xcf2a27();while(!![]){try{const _0x27f4ca=-parseInt(_0x17a60b(0x130))/0x1+parseInt(_0x17a60b(0x149))/0x2*(parseInt(_0x17a60b(0x151))/0x3)+parseInt(_0x17a60b(0x176))/0x4+-parseInt(_0x17a60b(0x150))/0x5*(-parseInt(_0x17a60b(0x17b))/0x6)+-parseInt(_0x17a60b(0x170))/0x7+-parseInt(_0x17a60b(0x135))/0x8+parseInt(_0x17a60b(0x12f))/0x9;if(_0x27f4ca===_0x1be363)break;else _0x17009c['push'](_0x17009c['shift']());}catch(_0x21d5b9){_0x17009c['push'](_0x17009c['shift']());}}}(a38_0x58e8,0x7fd58));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';function a38_0xd068(_0x43e997,_0x5047fe){_0x43e997=_0x43e997-0x11a;const _0x58e864=a38_0x58e8();let _0xd068d4=_0x58e864[_0x43e997];return _0xd068d4;}import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x11e05c,_0x1dd20c){const _0xa3f930=a38_0xd068,_0x391576=listLocalServiceTrees();let _0x4c4c6e;for(const _0x41b514 of _0x391576){const _0xb43d22=matchServiceTreeCommand(_0x41b514,_0x11e05c);if(!_0xb43d22)continue;(!_0x4c4c6e||_0xb43d22[_0xa3f930(0x174)][_0xa3f930(0x159)]['length']>_0x4c4c6e[_0xa3f930(0x174)]['fullPath'][_0xa3f930(0x145)])&&(_0x4c4c6e={'tree':_0x41b514,'command':_0xb43d22[_0xa3f930(0x174)],'remainingArgs':_0xb43d22[_0xa3f930(0x13e)]});}if(!_0x4c4c6e)return undefined;const _0x1811ee={..._0x1dd20c};return applyAppBinding(_0x4c4c6e['tree'],_0x4c4c6e[_0xa3f930(0x174)],_0x1811ee),{'definition':buildDynamicCommandDefinition(_0x4c4c6e[_0xa3f930(0x120)],_0x4c4c6e['command']),'args':_0x4c4c6e[_0xa3f930(0x13e)],'flags':_0x1811ee,'tree':_0x4c4c6e['tree'],'command':_0x4c4c6e['command']};}export function generateDynamicServiceHelp(_0x24d451){const _0x170ebf=a38_0xd068,_0x1b219d=listLocalServiceTrees()['find'](_0x579889=>_0x579889[_0x170ebf(0x167)][_0x170ebf(0x137)]===_0x24d451);if(!_0x1b219d)return undefined;const _0x308cd3=[CLI_BIN_NAME+'\x20'+_0x24d451+_0x170ebf(0x169),'',_0x1b219d[_0x170ebf(0x167)][_0x170ebf(0x156)]||_0x24d451,_0x1b219d[_0x170ebf(0x167)][_0x170ebf(0x141)]?'\x20\x20'+_0x1b219d[_0x170ebf(0x167)][_0x170ebf(0x141)]:'','',_0x170ebf(0x15a),..._0x1b219d['commands'][_0x170ebf(0x11e)](_0x9297ad=>{const _0x31e3d4=_0x170ebf,_0x32a77e=_0x9297ad[_0x31e3d4(0x159)][_0x31e3d4(0x124)](0x1)[_0x31e3d4(0x165)]('\x20'),_0x387782=_0x9297ad[_0x31e3d4(0x13c)]===_0x31e3d4(0x12a)?'':'\x20['+_0x9297ad['risk']+']';return'\x20\x20'+_0x32a77e['padEnd'](0x18)+'\x20'+(_0x9297ad[_0x31e3d4(0x141)]||'')+_0x387782;}),'','Use\x20`'+CLI_BIN_NAME+_0x170ebf(0x123)+_0x24d451+'`\x20to\x20inspect\x20the\x20manifest.'][_0x170ebf(0x133)](Boolean);return _0x308cd3[_0x170ebf(0x165)]('\x0a');}export function listDynamicServiceEntries(){const _0x2827da=a38_0xd068;return listLocalServices()[_0x2827da(0x11e)](_0x49a736=>{const _0xe0a92a=_0x2827da,_0x52faa9=_0x49a736[_0xe0a92a(0x11a)];return{'service':_0x52faa9['service']['code'],'label':_0x52faa9['service']['name']||_0x52faa9[_0xe0a92a(0x167)][_0xe0a92a(0x137)],'commands':_0x52faa9[_0xe0a92a(0x11f)]['map'](_0x36e22a=>({'command':dynamicCommandName(_0x36e22a),'description':_0x36e22a[_0xe0a92a(0x141)]||_0xe0a92a(0x16e)+_0x36e22a[_0xe0a92a(0x178)],'tag':riskTag(_0x36e22a['risk'])}))};});}export function getDynamicServiceEntry(_0x2f7555){const _0x38ed3a=a38_0xd068;return listDynamicServiceEntries()['find'](_0x14188a=>_0x14188a[_0x38ed3a(0x167)]===_0x2f7555);}export function listDynamicServiceDefinitions(_0x1c7d43){const _0x492e38=a38_0xd068;return listLocalServiceTrees()[_0x492e38(0x133)](_0x5b0ae3=>!_0x1c7d43||_0x5b0ae3[_0x492e38(0x167)]['code']===_0x1c7d43)[_0x492e38(0x14b)](_0x3f24a7=>_0x3f24a7[_0x492e38(0x11f)][_0x492e38(0x11e)](_0x5c99a3=>buildDynamicCommandDefinition(_0x3f24a7,_0x5c99a3)));}export function getDynamicServiceDefinitions(_0x3570f9){const _0x3dbe76=listDynamicServiceDefinitions(_0x3570f9);return _0x3dbe76['length']>0x0?_0x3dbe76:undefined;}export function findDynamicServiceDefinition(_0x452785,_0x4d1bab){const _0xc17b92=a38_0xd068;return listDynamicServiceDefinitions(_0x452785)[_0xc17b92(0x138)](_0x5c2d95=>_0x5c2d95[_0xc17b92(0x174)]===_0x4d1bab);}export function buildDynamicCommandDefinition(_0x41e88b,_0x3a4a9f){const _0x23bd5c=a38_0xd068;return{'service':_0x41e88b[_0x23bd5c(0x167)][_0x23bd5c(0x137)],'command':dynamicCommandName(_0x3a4a9f),'description':_0x3a4a9f[_0x23bd5c(0x141)]||_0x23bd5c(0x16e)+_0x3a4a9f[_0x23bd5c(0x178)],'risk':_0x3a4a9f[_0x23bd5c(0x13c)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3a4a9f['args']['map'](_0x5cafd8=>({'name':_0x5cafd8[_0x23bd5c(0x156)],'description':_0x5cafd8[_0x23bd5c(0x141)]||_0x5cafd8[_0x23bd5c(0x156)],'required':_0x5cafd8[_0x23bd5c(0x142)]})),'flags':_0x3a4a9f[_0x23bd5c(0x13d)][_0x23bd5c(0x11e)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3a4a9f),async 'dryRun'(_0x54f568){const _0x268949=_0x23bd5c,_0x4e9953=await compilePlan(_0x3a4a9f,_0x54f568);return{'method':_0x268949(0x136),'url':_0x3a4a9f['cliPath'],'body':{'target':targetPreview(_0x4e9953),'params':_0x4e9953['params']},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x3a4a9f['cliPath']};},async 'execute'(_0x5aeee2){const _0x31ef3f=_0x23bd5c,_0x5a5cbe=await compilePlan(_0x3a4a9f,_0x5aeee2),_0x2323ca=Date[_0x31ef3f(0x166)](),_0x442398=await executePlan(_0x5a5cbe,_0x3a4a9f,_0x5aeee2),_0x2ace76=Date[_0x31ef3f(0x166)]()-_0x2323ca;return{'ok':!![],'data':{'service':_0x41e88b['service'],'command':_0x3a4a9f['cliPath'],'target':targetPreview(_0x5a5cbe),'result':_0x442398,'elapsed':_0x2ace76},'message':_0x31ef3f(0x15b)+_0x3a4a9f[_0x31ef3f(0x178)]+'\x20completed\x20in\x20'+_0x2ace76+'ms'};}};}function dynamicCommandName(_0x16ffbc){const _0x3f7876=a38_0xd068;return _0x16ffbc[_0x3f7876(0x159)][_0x3f7876(0x124)](0x1)[_0x3f7876(0x165)]('\x20');}function riskTag(_0x39d6cc){return _0x39d6cc==='read'?'':'\x20\x20['+_0x39d6cc+']';}function flagToCommandFlag(_0x1996f8){const _0x2542e7=a38_0xd068;return{'name':_0x1996f8[_0x2542e7(0x121)],'type':_0x1996f8[_0x2542e7(0x143)]===_0x2542e7(0x144)?_0x2542e7(0x11d):_0x1996f8[_0x2542e7(0x143)],'description':_0x1996f8[_0x2542e7(0x141)]||_0x1996f8['name'],'required':_0x1996f8[_0x2542e7(0x142)],'default':isPrimitiveFlagDefault(_0x1996f8[_0x2542e7(0x14e)])?_0x1996f8[_0x2542e7(0x14e)]:undefined,'enum':_0x1996f8[_0x2542e7(0x171)]};}async function compilePlan(_0x560f0c,_0x234d5d){return compileServiceTreeCommand(_0x560f0c,{'flags':_0x234d5d['rawFlags'],'args':_0x234d5d['args'],'context':await buildServiceContext(_0x560f0c,_0x234d5d)});}async function buildServiceContext(_0x5e7a5a,_0x116b81){const _0x29bc0b=a38_0xd068,_0x2c96ce={'appCode':_0x116b81[_0x29bc0b(0x16d)],'env':_0x116b81[_0x29bc0b(0x153)],'envName':_0x116b81[_0x29bc0b(0x153)]};if(!usesRuntimeContext(_0x5e7a5a))return _0x2c96ce;const _0x3d7a62=await getLoginUserInfo(),_0x119f36=pickFirst(_0x3d7a62[_0x29bc0b(0x162)],_0x3d7a62['id']);return{..._0x2c96ce,'user':_0x3d7a62,'userId':_0x119f36,'id':_0x3d7a62['id'],'username':pickFirst(_0x3d7a62[_0x29bc0b(0x152)],_0x3d7a62[_0x29bc0b(0x131)],_0x3d7a62[_0x29bc0b(0x14d)]),'userName':_0x3d7a62['userName'],'nickname':pickFirst(_0x3d7a62[_0x29bc0b(0x12d)],_0x3d7a62[_0x29bc0b(0x140)]),'nickName':_0x3d7a62[_0x29bc0b(0x140)],'tenantCode':_0x3d7a62[_0x29bc0b(0x15c)],'employeeId':_0x3d7a62[_0x29bc0b(0x163)]};}function usesRuntimeContext(_0x58fe99){const _0x85bdfd=a38_0xd068;return _0x58fe99[_0x85bdfd(0x164)][_0x85bdfd(0x128)](_0x38e783=>typeof _0x38e783[_0x85bdfd(0x158)]===_0x85bdfd(0x11d)&&(_0x38e783[_0x85bdfd(0x158)][_0x85bdfd(0x15d)](_0x85bdfd(0x14c))||_0x38e783[_0x85bdfd(0x158)][_0x85bdfd(0x15d)](_0x85bdfd(0x14f))));}function pickFirst(..._0x27b75f){const _0x18703f=a38_0xd068;return _0x27b75f[_0x18703f(0x138)](_0x148557=>_0x148557!==undefined&&_0x148557!==null);}async function executePlan(_0x53737f,_0x2e1cba,_0x518f30){const _0x558827=a38_0xd068;if(_0x53737f['kind']===_0x558827(0x177)){const _0x24e447=await resolveDatasetCode(_0x53737f,_0x2e1cba,_0x518f30);return executeData(_0x24e447,_0x53737f['command'],_0x53737f[_0x558827(0x11c)]);}if(_0x53737f['kind']===_0x558827(0x155)){if(!_0x53737f[_0x558827(0x179)])throw CliErrors[_0x558827(0x134)]('Service\x20command\x20'+_0x2e1cba[_0x558827(0x178)]+_0x558827(0x15e));return executeSdkSql(_0x53737f['sqlCode'],normalizeScalarParams(_0x53737f[_0x558827(0x11c)]));}if(_0x53737f['kind']===_0x558827(0x12b)){const _0x2528b0=_0x53737f[_0x558827(0x168)]||_0x53737f[_0x558827(0x126)]||(_0x53737f[_0x558827(0x16b)]==null?'':String(_0x53737f[_0x558827(0x16b)]));if(!_0x2528b0)throw CliErrors[_0x558827(0x134)](_0x558827(0x15b)+_0x2e1cba[_0x558827(0x178)]+_0x558827(0x172));return executeSdkBff(_0x2528b0,_0x53737f['params']);}throw CliErrors[_0x558827(0x134)](_0x558827(0x154)+_0x53737f[_0x558827(0x16a)]);}function a38_0x58e8(){const _0xa3e8f7=['default','ctx.','312105BdOLSY','166857irBLTx','username','envName','Unsupported\x20service\x20target\x20kind:\x20','sql','name','\x20\x20\x20\x20datatable:\x20','source','fullPath','Commands:','Service\x20command\x20','tenantCode','startsWith','\x20requires\x20target.sqlCode.','app','\x20\x20\x20\x20command:\x20','datatable','userId','employeeId','mapTo','join','now','service','scriptName','\x20<command>\x20[flags]','kind','bffId','\x20->\x20','appCode','Run\x20service\x20command\x20','datasetCode','6636224rSVmFt','enum','\x20requires\x20target.scriptName.','dbtableConfig','command','trim','416388KhbqBP','data','cliPath','sqlCode','appRef','30vfudPG','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','normalizedManifest','env','params','string','map','commands','tree','cliName','number','\x20service\x20detail\x20--service\x20','slice','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','bffCode','Cannot\x20resolve\x20datatable\x20\x22','some','target','read','bff','\x20\x20SERVICE\x20TREE\x20TARGET','nickname','appBindings','11723247QOEqNp','306089cUoLlc','userName','push','filter','validation','863304IPWnvE','SERVICE_TREE','code','find','\x20\x20\x20\x20scriptName:\x20','Unknown\x20appRef\x20\x22','\x20\x20\x20\x20kind:\x20\x20\x20\x20','risk','flags','remainingArgs','appcode','nickName','description','required','type','json','length','operator','entries','\x20\x20\x20\x20sqlCode:\x20','6pRMvHh','\x20\x20\x20\x20datasetCode:\x20','flatMap','context.','loginName'];a38_0x58e8=function(){return _0xa3e8f7;};return a38_0x58e8();}async function resolveDatasetCode(_0x7bcf29,_0x2f8ba0,_0x4a1085){const _0x54fbc7=a38_0xd068;if(_0x7bcf29[_0x54fbc7(0x16f)])return _0x7bcf29[_0x54fbc7(0x16f)];if(!_0x7bcf29[_0x54fbc7(0x161)])throw CliErrors[_0x54fbc7(0x134)]('Service\x20command\x20'+_0x2f8ba0[_0x54fbc7(0x178)]+_0x54fbc7(0x17c));const _0x4bda95=await listDatasets(_0x4a1085[_0x54fbc7(0x16d)]),_0x5140f2=_0x4bda95[_0x54fbc7(0x138)](_0x1f457d=>_0x1f457d[_0x54fbc7(0x173)]?.['tableName']===_0x7bcf29[_0x54fbc7(0x161)]);if(!_0x5140f2?.[_0x54fbc7(0x137)])throw CliErrors[_0x54fbc7(0x134)](_0x54fbc7(0x127)+_0x7bcf29['datatable']+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x4a1085[_0x54fbc7(0x16d)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x5140f2[_0x54fbc7(0x137)];}function applyAppBinding(_0x396c9a,_0x418395,_0x1bdc73){const _0x401efc=a38_0xd068,_0x35cf35=_0x418395[_0x401efc(0x129)][_0x401efc(0x17a)];if(!_0x35cf35)return;const _0x52c134=_0x396c9a[_0x401efc(0x12e)][_0x35cf35];if(!_0x52c134)throw CliErrors['validation'](_0x401efc(0x13a)+_0x35cf35+'\x22\x20in\x20service\x20command\x20'+_0x418395[_0x401efc(0x178)]+'.',_0x401efc(0x125));const _0xddaa30=_0x52c134['appcode']||_0x52c134[_0x401efc(0x16d)];_0xddaa30&&!hasText(_0x1bdc73[_0x401efc(0x13f)])&&(_0x1bdc73[_0x401efc(0x13f)]=_0xddaa30),_0x52c134['app']&&!hasText(_0x1bdc73['app'])&&!hasText(_0x1bdc73[_0x401efc(0x13f)])&&(_0x1bdc73[_0x401efc(0x15f)]=_0x52c134[_0x401efc(0x15f)]),_0x52c134[_0x401efc(0x11b)]&&!hasText(_0x1bdc73[_0x401efc(0x11b)])&&(_0x1bdc73[_0x401efc(0x11b)]=_0x52c134[_0x401efc(0x11b)]);}function renderDynamicCommandHelp(_0xc37e63){const _0x4af61e=a38_0xd068,_0x1c28b2=[_0x4af61e(0x12c),_0x4af61e(0x13b)+_0xc37e63['target'][_0x4af61e(0x16a)],_0x4af61e(0x160)+_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x174)]];if(_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x16f)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x14a)+_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x16f)]);if(_0xc37e63['target'][_0x4af61e(0x161)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x157)+_0xc37e63['target'][_0x4af61e(0x161)]);if(_0xc37e63['target'][_0x4af61e(0x179)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x148)+_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x179)]);if(_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x168)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x139)+_0xc37e63['target'][_0x4af61e(0x168)]);if(_0xc37e63[_0x4af61e(0x164)][_0x4af61e(0x145)]>0x0){_0x1c28b2[_0x4af61e(0x132)]('','\x20\x20MAP\x20TO');for(const _0x3419ea of _0xc37e63[_0x4af61e(0x164)]){_0x1c28b2['push']('\x20\x20\x20\x20'+(_0x3419ea[_0x4af61e(0x158)]||'const')+_0x4af61e(0x16c)+_0x3419ea[_0x4af61e(0x129)]+(_0x3419ea[_0x4af61e(0x146)]?'.'+_0x3419ea[_0x4af61e(0x146)]:''));}}return _0x1c28b2[_0x4af61e(0x165)]('\x0a');}function targetPreview(_0x313576){const _0x59cceb=a38_0xd068;return{'kind':_0x313576[_0x59cceb(0x16a)],'command':_0x313576['command'],'appRef':_0x313576['appRef'],'datasetCode':_0x313576[_0x59cceb(0x16f)],'datatable':_0x313576[_0x59cceb(0x161)],'sqlCode':_0x313576[_0x59cceb(0x179)],'bffCode':_0x313576[_0x59cceb(0x126)],'bffId':_0x313576[_0x59cceb(0x16b)],'scriptName':_0x313576['scriptName']};}function normalizeScalarParams(_0xc612ec){const _0x2f26cd=a38_0xd068;return Object['fromEntries'](Object[_0x2f26cd(0x147)](_0xc612ec)['filter'](([,_0x3b3ac2])=>typeof _0x3b3ac2==='string'||typeof _0x3b3ac2===_0x2f26cd(0x122)));}function hasText(_0x185573){const _0x3835ce=a38_0xd068;return typeof _0x185573==='string'&&_0x185573[_0x3835ce(0x175)]()[_0x3835ce(0x145)]>0x0;}function isPrimitiveFlagDefault(_0x35bdfa){const _0x1c8c86=a38_0xd068;return _0x35bdfa===undefined||typeof _0x35bdfa===_0x1c8c86(0x11d)||typeof _0x35bdfa===_0x1c8c86(0x122)||typeof _0x35bdfa==='boolean';}
@@ -1 +1 @@
1
- const a39_0x1f7ebe=a39_0x44b3;function a39_0x44b3(_0xf07269,_0x4cf949){_0xf07269=_0xf07269-0x157;const _0x1b3b0d=a39_0x1b3b();let _0x44b3aa=_0x1b3b0d[_0xf07269];return _0x44b3aa;}(function(_0x146a50,_0x42207c){const _0x2237d2=a39_0x44b3,_0x57c2de=_0x146a50();while(!![]){try{const _0x49e60b=parseInt(_0x2237d2(0x19d))/0x1*(parseInt(_0x2237d2(0x19c))/0x2)+parseInt(_0x2237d2(0x17a))/0x3*(parseInt(_0x2237d2(0x18c))/0x4)+parseInt(_0x2237d2(0x172))/0x5+parseInt(_0x2237d2(0x171))/0x6+parseInt(_0x2237d2(0x168))/0x7+parseInt(_0x2237d2(0x165))/0x8*(-parseInt(_0x2237d2(0x181))/0x9)+parseInt(_0x2237d2(0x163))/0xa*(-parseInt(_0x2237d2(0x166))/0xb);if(_0x49e60b===_0x42207c)break;else _0x57c2de['push'](_0x57c2de['shift']());}catch(_0x39ffcf){_0x57c2de['push'](_0x57c2de['shift']());}}}(a39_0x1b3b,0xcfc0e));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x1f7ebe(0x182),'type':a39_0x1f7ebe(0x16c),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a39_0x1f7ebe(0x194),'type':a39_0x1f7ebe(0x16c),'required':!![],'description':a39_0x1f7ebe(0x173),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x1f7ebe(0x19b)}};function summarizeService(_0x3337cf){const _0x1a4981=a39_0x1f7ebe;return{'serviceCode':_0x3337cf['serviceCode'],'name':_0x3337cf[_0x1a4981(0x16d)][_0x1a4981(0x194)]['name'],'version':_0x3337cf[_0x1a4981(0x18b)],'importedAt':_0x3337cf[_0x1a4981(0x1a2)],'source':_0x3337cf['source'],'commandCount':_0x3337cf['normalizedManifest']['commands'][_0x1a4981(0x167)],'commands':_0x3337cf[_0x1a4981(0x16d)][_0x1a4981(0x195)][_0x1a4981(0x158)](_0x5204e3=>({'path':_0x5204e3['cliPath'],'description':_0x5204e3[_0x1a4981(0x17e)],'risk':_0x5204e3['risk'],'target':_0x5204e3[_0x1a4981(0x159)],'flags':_0x5204e3[_0x1a4981(0x185)][_0x1a4981(0x158)](_0x432343=>({'name':_0x432343[_0x1a4981(0x183)],'cliName':_0x432343[_0x1a4981(0x16b)],'type':_0x432343[_0x1a4981(0x17d)],'required':_0x432343[_0x1a4981(0x1a3)]===!![]}))}))};}function a39_0x1b3b(){const _0x3d4f57=['Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','Removed\x20service\x20','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','lower\x20kebab-case\x20service\x20code','271274AzFgDO','6HIAxgo','replaced','manifests','source','registryServiceCode','importedAt','required','registryPath','map','target','Imported\x20','reduce','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Service\x20registry\x20validation\x20passed.','warnings','manifest','kind','risk','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','20UCMedN','Local\x20service\x20not\x20found:\x20','26840DzBlYX','20959048IlOcOT','length','8452192SSojLn','\x20service\x20','str','cliName','string','normalizedManifest','read','registry','write','5803032WnRBBS','419860NvDxAs','Local\x20service\x20code,\x20for\x20example\x20crm','Updated','entries','serviceCount','\x20service(s),\x20updated\x20','remove','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','48537yjgJlS','serviceCode','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','type','description','list','detail','207vBjRpw','file','name','report','flags','import','cliPath','entry','validate','filePath','version','412ipJvLD','hash','updated','Service\x20manifest\x20validation\x20passed.','export','Imported','WRITE','errors','service','commands','Exported\x20service\x20','imported'];a39_0x1b3b=function(){return _0x3d4f57;};return a39_0x1b3b();}function summarizeLoadedManifest(_0x439573){const _0x4fb459=a39_0x1f7ebe;return{'service':_0x439573[_0x4fb459(0x16d)]?.[_0x4fb459(0x194)],'version':_0x439573[_0x4fb459(0x16d)]?.[_0x4fb459(0x18b)],'commandCount':_0x439573[_0x4fb459(0x16d)]?.[_0x4fb459(0x195)][_0x4fb459(0x167)]??0x0,'commands':_0x439573[_0x4fb459(0x16d)]?.[_0x4fb459(0x195)][_0x4fb459(0x158)](_0x3878d5=>({'path':_0x3878d5[_0x4fb459(0x187)],'risk':_0x3878d5[_0x4fb459(0x161)],'target':_0x3878d5[_0x4fb459(0x159)]}))??[],'registryIndex':_0x439573['registryIndex'],'registryServiceCode':_0x439573[_0x4fb459(0x1a1)],'errors':_0x439573[_0x4fb459(0x184)][_0x4fb459(0x193)],'warnings':_0x439573['report'][_0x4fb459(0x15e)]};}export const serviceDefinitions=[{'service':a39_0x1f7ebe(0x194),'command':a39_0x1f7ebe(0x189),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a39_0x1f7ebe(0x16e),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0xed199e){const _0x1f2dfa=a39_0x1f7ebe,_0x36ecf8=loadServiceManifestFromFile(_0xed199e[_0x1f2dfa(0x16a)]('file'));if(!_0x36ecf8['report']['ok'])return{'ok':![],'data':{'file':_0x36ecf8[_0x1f2dfa(0x18a)],'hash':_0x36ecf8[_0x1f2dfa(0x18d)],'kind':_0x36ecf8['kind'],'serviceCount':_0x36ecf8[_0x1f2dfa(0x19f)][_0x1f2dfa(0x167)],'services':_0x36ecf8['manifests'][_0x1f2dfa(0x158)](summarizeLoadedManifest),'errors':_0x36ecf8['report'][_0x1f2dfa(0x193)],'warnings':_0x36ecf8[_0x1f2dfa(0x184)][_0x1f2dfa(0x15e)]},'message':formatValidationFailure(_0x36ecf8[_0x1f2dfa(0x184)])};if(_0x36ecf8['kind']===_0x1f2dfa(0x16f)||_0x36ecf8[_0x1f2dfa(0x19f)][_0x1f2dfa(0x167)]!==0x1)return{'ok':!![],'data':{'file':_0x36ecf8[_0x1f2dfa(0x18a)],'hash':_0x36ecf8[_0x1f2dfa(0x18d)],'kind':_0x36ecf8['kind'],'serviceCount':_0x36ecf8[_0x1f2dfa(0x19f)]['length'],'commandCount':_0x36ecf8[_0x1f2dfa(0x19f)][_0x1f2dfa(0x15b)]((_0x1bc656,_0x5dd32f)=>_0x1bc656+(_0x5dd32f[_0x1f2dfa(0x16d)]?.['commands']['length']??0x0),0x0),'services':_0x36ecf8[_0x1f2dfa(0x19f)][_0x1f2dfa(0x158)](summarizeLoadedManifest),'warnings':_0x36ecf8['report'][_0x1f2dfa(0x15e)]},'message':_0x1f2dfa(0x15d)};return{'ok':!![],'data':{'file':_0x36ecf8['filePath'],'hash':_0x36ecf8['hash'],'kind':_0x36ecf8[_0x1f2dfa(0x160)],'service':_0x36ecf8['normalizedManifest']?.[_0x1f2dfa(0x194)],'version':_0x36ecf8[_0x1f2dfa(0x16d)]?.[_0x1f2dfa(0x18b)],'commandCount':_0x36ecf8[_0x1f2dfa(0x16d)]?.[_0x1f2dfa(0x195)][_0x1f2dfa(0x167)]??0x0,'commands':_0x36ecf8[_0x1f2dfa(0x16d)]?.[_0x1f2dfa(0x195)][_0x1f2dfa(0x158)](_0x2bbcef=>({'path':_0x2bbcef[_0x1f2dfa(0x187)],'risk':_0x2bbcef['risk'],'target':_0x2bbcef['target']})),'warnings':_0x36ecf8[_0x1f2dfa(0x184)][_0x1f2dfa(0x15e)]},'message':_0x1f2dfa(0x18f)};}},{'service':'service','command':a39_0x1f7ebe(0x186),'description':a39_0x1f7ebe(0x198),'risk':a39_0x1f7ebe(0x170),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x1d31f4){const _0xb81047=a39_0x1f7ebe,_0x37d5df=loadServiceManifestFromFile(_0x1d31f4['str']('file'));return{'method':_0xb81047(0x192),'url':getServiceRegistryPath(),'body':{'file':_0x37d5df['filePath'],'hash':_0x37d5df[_0xb81047(0x18d)],'kind':_0x37d5df[_0xb81047(0x160)],'ok':_0x37d5df[_0xb81047(0x184)]['ok'],'service':_0x37d5df[_0xb81047(0x16d)]?.[_0xb81047(0x194)],'version':_0x37d5df[_0xb81047(0x16d)]?.[_0xb81047(0x18b)],'serviceCount':_0x37d5df[_0xb81047(0x19f)][_0xb81047(0x167)],'services':_0x37d5df['manifests']['map'](_0x251020=>({'service':_0x251020[_0xb81047(0x16d)]?.[_0xb81047(0x194)],'version':_0x251020[_0xb81047(0x16d)]?.[_0xb81047(0x18b)],'commandCount':_0x251020[_0xb81047(0x16d)]?.[_0xb81047(0x195)][_0xb81047(0x167)]??0x0,'errors':_0x251020['report'][_0xb81047(0x193)]})),'errors':_0x37d5df[_0xb81047(0x184)][_0xb81047(0x193)],'commandCount':_0x37d5df[_0xb81047(0x16d)]?.[_0xb81047(0x195)][_0xb81047(0x167)]??0x0},'description':_0xb81047(0x17c)};},async 'execute'(_0x18d5b4){const _0x124181=a39_0x1f7ebe,_0x4584fd=importServiceManifest(_0x18d5b4[_0x124181(0x16a)](_0x124181(0x182)));if(_0x4584fd[_0x124181(0x175)][_0x124181(0x167)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x4584fd['registryPath'],'imported':_0x4584fd['imported'],'updated':_0x4584fd[_0x124181(0x18e)],'serviceCount':_0x4584fd['serviceCount'],'services':_0x4584fd[_0x124181(0x175)][_0x124181(0x158)](summarizeService)},'message':_0x124181(0x15a)+_0x4584fd['imported']+_0x124181(0x177)+_0x4584fd['updated']+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x4584fd[_0x124181(0x157)],'replaced':_0x4584fd[_0x124181(0x19e)],'imported':_0x4584fd[_0x124181(0x197)],'updated':_0x4584fd[_0x124181(0x18e)],'serviceCount':_0x4584fd[_0x124181(0x176)],'service':summarizeService(_0x4584fd[_0x124181(0x188)])},'message':(_0x4584fd[_0x124181(0x19e)]?_0x124181(0x174):_0x124181(0x191))+_0x124181(0x169)+_0x4584fd[_0x124181(0x188)][_0x124181(0x17b)]+'.'};}},{'service':'service','command':a39_0x1f7ebe(0x190),'description':a39_0x1f7ebe(0x179),'risk':a39_0x1f7ebe(0x170),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x3226f1){const _0x35b4d0=a39_0x1f7ebe,_0x1ee81f=getLocalServiceEntry(_0x3226f1[_0x35b4d0(0x16a)](_0x35b4d0(0x194)));return{'method':_0x35b4d0(0x192),'url':_0x3226f1[_0x35b4d0(0x16a)]('file'),'body':{'service':_0x3226f1[_0x35b4d0(0x16a)](_0x35b4d0(0x194)),'found':Boolean(_0x1ee81f),'version':_0x1ee81f?.[_0x35b4d0(0x18b)],'source':_0x1ee81f?.[_0x35b4d0(0x1a0)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x3fd3b3){const _0x5795cd=a39_0x1f7ebe,_0x3f55eb=exportServiceManifest(_0x3fd3b3[_0x5795cd(0x16a)](_0x5795cd(0x194)),_0x3fd3b3[_0x5795cd(0x16a)](_0x5795cd(0x182)));return{'ok':!![],'data':{'registryPath':_0x3f55eb[_0x5795cd(0x157)],'file':_0x3f55eb[_0x5795cd(0x18a)],'service':summarizeService(_0x3f55eb[_0x5795cd(0x188)])},'message':_0x5795cd(0x196)+_0x3f55eb[_0x5795cd(0x188)][_0x5795cd(0x17b)]+'.'};}},{'service':a39_0x1f7ebe(0x194),'command':a39_0x1f7ebe(0x17f),'description':a39_0x1f7ebe(0x162),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x4ef303=a39_0x1f7ebe,_0x3e2e3f=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x3e2e3f[_0x4ef303(0x167)],'services':_0x3e2e3f['map'](summarizeService)}};}},{'service':'service','command':a39_0x1f7ebe(0x178),'description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0x1f7ebe(0x170),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0xed5b5a){const _0x308c37=a39_0x1f7ebe,_0x251adc=getLocalServiceEntry(_0xed5b5a[_0x308c37(0x16a)](_0x308c37(0x194)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0xed5b5a[_0x308c37(0x16a)](_0x308c37(0x194)),'found':Boolean(_0x251adc),'version':_0x251adc?.[_0x308c37(0x18b)],'source':_0x251adc?.['source']},'description':_0x308c37(0x19a)};},async 'execute'(_0x22131f){const _0x2cc98e=a39_0x1f7ebe,_0x2b1957=removeServiceManifest(_0x22131f[_0x2cc98e(0x16a)](_0x2cc98e(0x194)));return{'ok':!![],'data':{'registryPath':_0x2b1957[_0x2cc98e(0x157)],'serviceCount':_0x2b1957[_0x2cc98e(0x176)],'service':summarizeService(_0x2b1957[_0x2cc98e(0x188)])},'message':_0x2cc98e(0x199)+_0x2b1957[_0x2cc98e(0x188)]['serviceCode']+'.'};}},{'service':a39_0x1f7ebe(0x194),'command':a39_0x1f7ebe(0x180),'description':a39_0x1f7ebe(0x15c),'risk':a39_0x1f7ebe(0x16e),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x3f710c){const _0x4bedab=a39_0x1f7ebe,_0x3db08a=getLocalServiceEntry(_0x3f710c['str'](_0x4bedab(0x194)));if(!_0x3db08a)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x3f710c['str']('service')},'message':_0x4bedab(0x164)+_0x3f710c[_0x4bedab(0x16a)](_0x4bedab(0x194))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x3db08a),'manifest':_0x3db08a[_0x4bedab(0x15f)],'normalizedManifest':_0x3db08a['normalizedManifest']}};}}];
1
+ const a39_0x1ffdfd=a39_0x3f62;(function(_0xdb86ee,_0x54cacf){const _0x40dcec=a39_0x3f62,_0x10b2b0=_0xdb86ee();while(!![]){try{const _0x583122=-parseInt(_0x40dcec(0xd2))/0x1*(parseInt(_0x40dcec(0xc2))/0x2)+-parseInt(_0x40dcec(0xb3))/0x3*(-parseInt(_0x40dcec(0xc9))/0x4)+parseInt(_0x40dcec(0xac))/0x5*(parseInt(_0x40dcec(0xa8))/0x6)+parseInt(_0x40dcec(0xe0))/0x7+parseInt(_0x40dcec(0xb2))/0x8+parseInt(_0x40dcec(0xc1))/0x9+-parseInt(_0x40dcec(0xc4))/0xa;if(_0x583122===_0x54cacf)break;else _0x10b2b0['push'](_0x10b2b0['shift']());}catch(_0x4043f9){_0x10b2b0['push'](_0x10b2b0['shift']());}}}(a39_0x1b43,0x3ec34));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x1ffdfd(0xab),'type':a39_0x1ffdfd(0xa4),'required':!![],'description':a39_0x1ffdfd(0xdb)},SERVICE_FLAG={'name':a39_0x1ffdfd(0xae),'type':a39_0x1ffdfd(0xa4),'required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x1ffdfd(0xc3)}};function summarizeService(_0xb921de){const _0x5b2eca=a39_0x1ffdfd;return{'serviceCode':_0xb921de['serviceCode'],'name':_0xb921de[_0x5b2eca(0xa2)][_0x5b2eca(0xae)][_0x5b2eca(0xb6)],'version':_0xb921de[_0x5b2eca(0xc8)],'importedAt':_0xb921de[_0x5b2eca(0xe4)],'source':_0xb921de[_0x5b2eca(0xb4)],'commandCount':_0xb921de[_0x5b2eca(0xa2)][_0x5b2eca(0xd9)][_0x5b2eca(0xcd)],'commands':_0xb921de[_0x5b2eca(0xa2)][_0x5b2eca(0xd9)]['map'](_0x15a71e=>({'path':_0x15a71e[_0x5b2eca(0xb9)],'description':_0x15a71e[_0x5b2eca(0xdd)],'risk':_0x15a71e[_0x5b2eca(0xc7)],'target':_0x15a71e[_0x5b2eca(0xce)],'flags':_0x15a71e['flags'][_0x5b2eca(0xb7)](_0x140fe6=>({'name':_0x140fe6['name'],'cliName':_0x140fe6['cliName'],'type':_0x140fe6[_0x5b2eca(0xda)],'required':_0x140fe6[_0x5b2eca(0xd3)]===!![]}))}))};}function a39_0x1b43(){const _0x2a074e=['6LqysBC','Imported\x20','Service\x20manifest\x20validation\x20passed.','file','1383240YEWGkM','Updated','service','write','imported','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','3789096fZHTXp','415137oIwoFb','source','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','name','map','serviceCount','cliPath','\x20service(s).','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','validate','registryServiceCode','list','errors','remove','3083274XaGPky','107412RADRgg','lower\x20kebab-case\x20service\x20code','13859680Hadzhq','filePath','manifests','risk','version','8LnFPAK','serviceCode','kind','\x20service(s),\x20updated\x20','length','target','read','reduce','export','2MkfYrD','required','hash','updated','str','registry','import','commands','type','Service\x20Tree\x20manifest\x20file\x20path','registryPath','description','entry','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','2665789fPJJEV','\x20service\x20','replaced','warnings','importedAt','Removed\x20service\x20','normalizedManifest','entries','string','report','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Imported'];a39_0x1b43=function(){return _0x2a074e;};return a39_0x1b43();}function summarizeLoadedManifest(_0x4cda39){const _0x249cf4=a39_0x1ffdfd;return{'service':_0x4cda39[_0x249cf4(0xa2)]?.['service'],'version':_0x4cda39['normalizedManifest']?.['version'],'commandCount':_0x4cda39[_0x249cf4(0xa2)]?.['commands']['length']??0x0,'commands':_0x4cda39[_0x249cf4(0xa2)]?.['commands'][_0x249cf4(0xb7)](_0x4a47f4=>({'path':_0x4a47f4[_0x249cf4(0xb9)],'risk':_0x4a47f4[_0x249cf4(0xc7)],'target':_0x4a47f4[_0x249cf4(0xce)]}))??[],'registryIndex':_0x4cda39['registryIndex'],'registryServiceCode':_0x4cda39[_0x249cf4(0xbd)],'errors':_0x4cda39[_0x249cf4(0xa5)][_0x249cf4(0xbf)],'warnings':_0x4cda39['report'][_0x249cf4(0xe3)]};}function a39_0x3f62(_0x43d994,_0x35e545){_0x43d994=_0x43d994-0xa2;const _0x1b4309=a39_0x1b43();let _0x3f62c2=_0x1b4309[_0x43d994];return _0x3f62c2;}export const serviceDefinitions=[{'service':'service','command':a39_0x1ffdfd(0xbc),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x48e5db){const _0x13f246=a39_0x1ffdfd,_0x21e635=loadServiceManifestFromFile(_0x48e5db[_0x13f246(0xd6)](_0x13f246(0xab)));if(!_0x21e635[_0x13f246(0xa5)]['ok'])return{'ok':![],'data':{'file':_0x21e635[_0x13f246(0xc5)],'hash':_0x21e635[_0x13f246(0xd4)],'kind':_0x21e635[_0x13f246(0xcb)],'serviceCount':_0x21e635[_0x13f246(0xc6)]['length'],'services':_0x21e635['manifests']['map'](summarizeLoadedManifest),'errors':_0x21e635[_0x13f246(0xa5)]['errors'],'warnings':_0x21e635[_0x13f246(0xa5)]['warnings']},'message':formatValidationFailure(_0x21e635[_0x13f246(0xa5)])};if(_0x21e635[_0x13f246(0xcb)]===_0x13f246(0xd7)||_0x21e635[_0x13f246(0xc6)][_0x13f246(0xcd)]!==0x1)return{'ok':!![],'data':{'file':_0x21e635[_0x13f246(0xc5)],'hash':_0x21e635[_0x13f246(0xd4)],'kind':_0x21e635['kind'],'serviceCount':_0x21e635['manifests']['length'],'commandCount':_0x21e635[_0x13f246(0xc6)][_0x13f246(0xd0)]((_0x44a702,_0x171efd)=>_0x44a702+(_0x171efd['normalizedManifest']?.['commands'][_0x13f246(0xcd)]??0x0),0x0),'services':_0x21e635['manifests'][_0x13f246(0xb7)](summarizeLoadedManifest),'warnings':_0x21e635['report']['warnings']},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x21e635['filePath'],'hash':_0x21e635[_0x13f246(0xd4)],'kind':_0x21e635[_0x13f246(0xcb)],'service':_0x21e635[_0x13f246(0xa2)]?.['service'],'version':_0x21e635['normalizedManifest']?.[_0x13f246(0xc8)],'commandCount':_0x21e635[_0x13f246(0xa2)]?.[_0x13f246(0xd9)][_0x13f246(0xcd)]??0x0,'commands':_0x21e635[_0x13f246(0xa2)]?.[_0x13f246(0xd9)]['map'](_0x560f9c=>({'path':_0x560f9c[_0x13f246(0xb9)],'risk':_0x560f9c[_0x13f246(0xc7)],'target':_0x560f9c[_0x13f246(0xce)]})),'warnings':_0x21e635[_0x13f246(0xa5)][_0x13f246(0xe3)]},'message':_0x13f246(0xaa)};}},{'service':a39_0x1ffdfd(0xae),'command':a39_0x1ffdfd(0xd8),'description':a39_0x1ffdfd(0xb5),'risk':a39_0x1ffdfd(0xaf),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x42a20e){const _0xca710c=a39_0x1ffdfd,_0x11cd3d=loadServiceManifestFromFile(_0x42a20e[_0xca710c(0xd6)]('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x11cd3d[_0xca710c(0xc5)],'hash':_0x11cd3d[_0xca710c(0xd4)],'kind':_0x11cd3d[_0xca710c(0xcb)],'ok':_0x11cd3d[_0xca710c(0xa5)]['ok'],'service':_0x11cd3d[_0xca710c(0xa2)]?.[_0xca710c(0xae)],'version':_0x11cd3d[_0xca710c(0xa2)]?.[_0xca710c(0xc8)],'serviceCount':_0x11cd3d[_0xca710c(0xc6)][_0xca710c(0xcd)],'services':_0x11cd3d[_0xca710c(0xc6)][_0xca710c(0xb7)](_0x323eff=>({'service':_0x323eff[_0xca710c(0xa2)]?.[_0xca710c(0xae)],'version':_0x323eff['normalizedManifest']?.[_0xca710c(0xc8)],'commandCount':_0x323eff[_0xca710c(0xa2)]?.[_0xca710c(0xd9)][_0xca710c(0xcd)]??0x0,'errors':_0x323eff[_0xca710c(0xa5)][_0xca710c(0xbf)]})),'errors':_0x11cd3d[_0xca710c(0xa5)][_0xca710c(0xbf)],'commandCount':_0x11cd3d[_0xca710c(0xa2)]?.[_0xca710c(0xd9)][_0xca710c(0xcd)]??0x0},'description':_0xca710c(0xa6)};},async 'execute'(_0x3acdad){const _0x389883=a39_0x1ffdfd,_0x7c10c7=importServiceManifest(_0x3acdad['str']('file'));if(_0x7c10c7[_0x389883(0xa3)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x7c10c7[_0x389883(0xdc)],'imported':_0x7c10c7[_0x389883(0xb0)],'updated':_0x7c10c7['updated'],'serviceCount':_0x7c10c7[_0x389883(0xb8)],'services':_0x7c10c7[_0x389883(0xa3)][_0x389883(0xb7)](summarizeService)},'message':_0x389883(0xa9)+_0x7c10c7[_0x389883(0xb0)]+_0x389883(0xcc)+_0x7c10c7['updated']+_0x389883(0xba)};return{'ok':!![],'data':{'registryPath':_0x7c10c7['registryPath'],'replaced':_0x7c10c7[_0x389883(0xe2)],'imported':_0x7c10c7[_0x389883(0xb0)],'updated':_0x7c10c7[_0x389883(0xd5)],'serviceCount':_0x7c10c7[_0x389883(0xb8)],'service':summarizeService(_0x7c10c7[_0x389883(0xde)])},'message':(_0x7c10c7[_0x389883(0xe2)]?_0x389883(0xad):_0x389883(0xa7))+_0x389883(0xe1)+_0x7c10c7[_0x389883(0xde)][_0x389883(0xca)]+'.'};}},{'service':a39_0x1ffdfd(0xae),'command':a39_0x1ffdfd(0xd1),'description':a39_0x1ffdfd(0xb1),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0xb844dd){const _0x2a0f86=a39_0x1ffdfd,_0x30217b=getLocalServiceEntry(_0xb844dd[_0x2a0f86(0xd6)](_0x2a0f86(0xae)));return{'method':'WRITE','url':_0xb844dd['str'](_0x2a0f86(0xab)),'body':{'service':_0xb844dd[_0x2a0f86(0xd6)](_0x2a0f86(0xae)),'found':Boolean(_0x30217b),'version':_0x30217b?.['version'],'source':_0x30217b?.[_0x2a0f86(0xb4)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x15e341){const _0x10d6d4=a39_0x1ffdfd,_0x190a77=exportServiceManifest(_0x15e341[_0x10d6d4(0xd6)](_0x10d6d4(0xae)),_0x15e341[_0x10d6d4(0xd6)](_0x10d6d4(0xab)));return{'ok':!![],'data':{'registryPath':_0x190a77['registryPath'],'file':_0x190a77[_0x10d6d4(0xc5)],'service':summarizeService(_0x190a77[_0x10d6d4(0xde)])},'message':'Exported\x20service\x20'+_0x190a77[_0x10d6d4(0xde)][_0x10d6d4(0xca)]+'.'};}},{'service':a39_0x1ffdfd(0xae),'command':a39_0x1ffdfd(0xbe),'description':a39_0x1ffdfd(0xbb),'risk':a39_0x1ffdfd(0xcf),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x3f84c9=a39_0x1ffdfd,_0x1cfa37=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x1cfa37['length'],'services':_0x1cfa37[_0x3f84c9(0xb7)](summarizeService)}};}},{'service':'service','command':a39_0x1ffdfd(0xc0),'description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0x1ffdfd(0xaf),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x37ae53){const _0x6e3cf2=a39_0x1ffdfd,_0x319dee=getLocalServiceEntry(_0x37ae53[_0x6e3cf2(0xd6)]('service'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x37ae53['str'](_0x6e3cf2(0xae)),'found':Boolean(_0x319dee),'version':_0x319dee?.[_0x6e3cf2(0xc8)],'source':_0x319dee?.[_0x6e3cf2(0xb4)]},'description':_0x6e3cf2(0xdf)};},async 'execute'(_0x5c91e7){const _0x49f678=a39_0x1ffdfd,_0x5844be=removeServiceManifest(_0x5c91e7[_0x49f678(0xd6)](_0x49f678(0xae)));return{'ok':!![],'data':{'registryPath':_0x5844be['registryPath'],'serviceCount':_0x5844be[_0x49f678(0xb8)],'service':summarizeService(_0x5844be[_0x49f678(0xde)])},'message':_0x49f678(0xe5)+_0x5844be[_0x49f678(0xde)][_0x49f678(0xca)]+'.'};}},{'service':'service','command':'detail','description':'Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','risk':a39_0x1ffdfd(0xcf),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x5bcf97){const _0xe6dcb1=a39_0x1ffdfd,_0x5d22fe=getLocalServiceEntry(_0x5bcf97[_0xe6dcb1(0xd6)](_0xe6dcb1(0xae)));if(!_0x5d22fe)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x5bcf97[_0xe6dcb1(0xd6)](_0xe6dcb1(0xae))},'message':'Local\x20service\x20not\x20found:\x20'+_0x5bcf97['str'](_0xe6dcb1(0xae))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x5d22fe),'manifest':_0x5d22fe['manifest'],'normalizedManifest':_0x5d22fe[_0xe6dcb1(0xa2)]}};}}];