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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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_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
+ const a30_0x5d825d=a30_0x12dc;(function(_0x2011cd,_0xbd4227){const _0x45b355=a30_0x12dc,_0xb716c3=_0x2011cd();while(!![]){try{const _0x139961=parseInt(_0x45b355(0x1d4))/0x1+-parseInt(_0x45b355(0x1e7))/0x2*(parseInt(_0x45b355(0x1e4))/0x3)+parseInt(_0x45b355(0x1d6))/0x4+-parseInt(_0x45b355(0x1eb))/0x5+parseInt(_0x45b355(0x1c8))/0x6*(-parseInt(_0x45b355(0x1ec))/0x7)+parseInt(_0x45b355(0x1cb))/0x8+parseInt(_0x45b355(0x1cf))/0x9*(parseInt(_0x45b355(0x1e5))/0xa);if(_0x139961===_0xbd4227)break;else _0xb716c3['push'](_0xb716c3['shift']());}catch(_0x2ec2f8){_0xb716c3['push'](_0xb716c3['shift']());}}}(a30_0x2bcd,0x2ea17));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';function a30_0x2bcd(){const _0x2fb28d=['Uploaded\x20file:\x20','POST','Runtime\x20filePath\x20returned\x20by\x20file\x20upload','path','Uploaded\x20file.','read','filepath','2505upxiPx','10BxfdDv','string','312XavqOV','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported','boolean','upload','1314370tluWVL','41307CwTNtX','query-url','filePath\x20is\x20required.','222BLOpob','filePath','write','2130176GiAQAd','Path\x20to\x20the\x20local\x20file\x20to\x20upload','/client/uploadFile','File','959967SYbvdR','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','file','bool','str','279219PNljgV','description','601264wiVWux','build','validation','\x20to\x20runtime\x20app\x20','body','appCode','download'];a30_0x2bcd=function(){return _0x2fb28d;};return a30_0x2bcd();}import{CliErrors}from'../../errors.js';function a30_0x12dc(_0x8a2ccb,_0x5ce37f){_0x8a2ccb=_0x8a2ccb-0x1c6;const _0x2bcde6=a30_0x2bcd();let _0x12dcbb=_0x2bcde6[_0x8a2ccb];return _0x12dcbb;}import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x5d825d(0x1d1),'type':a30_0x5d825d(0x1e6),'required':!![],'description':a30_0x5d825d(0x1cc)},FILEPATH_FLAG={'name':a30_0x5d825d(0x1e3),'type':a30_0x5d825d(0x1e6),'required':!![],'description':a30_0x5d825d(0x1df)},DOWNLOAD_FLAG={'name':a30_0x5d825d(0x1dc),'type':a30_0x5d825d(0x1e9),'description':a30_0x5d825d(0x1e8)};function requireFilePath(_0x321a6b){const _0x380f3e=a30_0x5d825d,_0x4d9a6f=_0x321a6b['trim']();if(!_0x4d9a6f)throw CliErrors[_0x380f3e(0x1d8)](_0x380f3e(0x1c7));return _0x4d9a6f;}const fileUpload={'service':'file','command':a30_0x5d825d(0x1ea),'description':'Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','risk':a30_0x5d825d(0x1ca),'flags':[FILE_FLAG],async 'dryRun'(_0x15df22){const _0x45457d=a30_0x5d825d,_0x37781a=requireRuntimeUploadFile(_0x15df22[_0x45457d(0x1d3)](_0x45457d(0x1d1)),'File');return dryRun(_0x45457d(0x1de),_0x45457d(0x1cd))[_0x45457d(0x1da)]({'appCode':_0x15df22[_0x45457d(0x1db)],'multipart':{'file':_0x37781a}})[_0x45457d(0x1d5)]('Preview:\x20upload\x20'+_0x37781a[_0x45457d(0x1e0)]+_0x45457d(0x1d9)+_0x15df22[_0x45457d(0x1db)])[_0x45457d(0x1d7)]();},async 'execute'(_0x460c44){const _0x360805=a30_0x5d825d,_0x7f186a=requireRuntimeUploadFile(_0x460c44[_0x360805(0x1d3)](_0x360805(0x1d1)),_0x360805(0x1ce)),_0x18f16c=await uploadRuntimeFile(_0x460c44[_0x360805(0x1db)],_0x7f186a[_0x360805(0x1e0)]);return{'ok':!![],'data':_0x18f16c,'message':_0x18f16c['filePath']?_0x360805(0x1dd)+_0x18f16c[_0x360805(0x1c9)]:_0x360805(0x1e1)};}},fileQueryUrl={'service':a30_0x5d825d(0x1d1),'command':a30_0x5d825d(0x1c6),'description':a30_0x5d825d(0x1d0),'risk':a30_0x5d825d(0x1e2),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x1ace1a){const _0x506dcd=a30_0x5d825d,_0x2c5bc5=requireFilePath(_0x1ace1a[_0x506dcd(0x1d3)]('filepath')),_0x29b083=await queryRuntimeFileUrl(_0x2c5bc5,{'download':_0x1ace1a[_0x506dcd(0x1d2)](_0x506dcd(0x1dc))});return{'ok':!![],'data':_0x29b083};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
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
+ const a31_0x3199c6=a31_0x3b67;(function(_0x5a8050,_0x39c827){const _0x39420f=a31_0x3b67,_0x178f82=_0x5a8050();while(!![]){try{const _0x12e740=-parseInt(_0x39420f(0x1b5))/0x1+-parseInt(_0x39420f(0x1c8))/0x2+-parseInt(_0x39420f(0x1bd))/0x3*(-parseInt(_0x39420f(0x1d5))/0x4)+-parseInt(_0x39420f(0x1a3))/0x5+-parseInt(_0x39420f(0x1d4))/0x6*(parseInt(_0x39420f(0x1d2))/0x7)+-parseInt(_0x39420f(0x1bf))/0x8+parseInt(_0x39420f(0x1b8))/0x9;if(_0x12e740===_0x39c827)break;else _0x178f82['push'](_0x178f82['shift']());}catch(_0x50d65a){_0x178f82['push'](_0x178f82['shift']());}}}(a31_0x30e4,0x60c09));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_0x3199c6(0x1a4),'type':a31_0x3199c6(0x19e),'description':a31_0x3199c6(0x1cc)},{'name':a31_0x3199c6(0x1ba),'type':'string','description':a31_0x3199c6(0x1ab)+DEFAULT_CONFIG_VALUES[a31_0x3199c6(0x1ba)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x3199c6(0x1c1),'type':'boolean','description':a31_0x3199c6(0x1d3)+PRODUCT_CONFIG[a31_0x3199c6(0x1d0)]+a31_0x3199c6(0x1e0),'default':![]},{'name':a31_0x3199c6(0x1a1),'type':'boolean','description':a31_0x3199c6(0x1b0),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x3199c6(0x1a9),'type':a31_0x3199c6(0x19e),'description':a31_0x3199c6(0x1c6),'required':!![]},{'name':a31_0x3199c6(0x1a4),'type':a31_0x3199c6(0x19e),'description':a31_0x3199c6(0x1c0)},{'name':a31_0x3199c6(0x1ba),'type':'string','description':a31_0x3199c6(0x1c2),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x3199c6(0x1c1),'type':'boolean','description':a31_0x3199c6(0x1d3)+PRODUCT_CONFIG['newConfigFileName']+a31_0x3199c6(0x1e0),'default':![]},{'name':'yes','type':a31_0x3199c6(0x1b7),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x29c785){const _0x238e80=a31_0x3199c6,_0x39640d=isNonInteractiveMode(_0x29c785),_0x3255ac=_0x29c785['global']?_0x238e80(0x1c1):_0x238e80(0x1cf),_0x4604d1=resolveWriteConfigPath(_0x3255ac);try{_0x39640d?await runNonInteractive(_0x29c785,_0x4604d1):await runInteractive(_0x29c785,_0x4604d1);}catch(_0x4379aa){if(_0x4379aa instanceof AbortPrompt)throw CliErrors[_0x238e80(0x1c7)]();throw _0x4379aa;}}export async function runInitImport(_0x27a79e){const _0xfae3e=a31_0x3199c6,_0x5d9b33=_0x27a79e[_0xfae3e(0x1c1)]?_0xfae3e(0x1c1):'project',_0x1f9818=resolveWriteConfigPath(_0x5d9b33);await runFromImport(_0x27a79e,_0x1f9818);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x3199c6(0x1cd)]);function a31_0x3b67(_0x266884,_0x45b3d9){_0x266884=_0x266884-0x199;const _0x30e400=a31_0x30e4();let _0x3b6767=_0x30e400[_0x266884];return _0x3b6767;}async function runFromImport(_0x23b271,_0x26e324){const _0x1dd111=a31_0x3199c6,_0x377e69=resolveFilePath(_0x23b271['file']);if(!existsSync(_0x377e69))throw CliErrors[_0x1dd111(0x19f)](_0x1dd111(0x1ad)+_0x377e69);const _0x2f9cdd=readSourceFile(_0x377e69),_0x51641c=convertToRuntimeConfig(_0x2f9cdd);_0x23b271[_0x1dd111(0x1a4)]&&(_0x51641c[_0x1dd111(0x1a4)]=String(_0x23b271[_0x1dd111(0x1a4)]));_0x23b271[_0x1dd111(0x1ba)]&&(_0x51641c[_0x1dd111(0x1ba)]=resolveInitEnv(_0x23b271));if(!_0x51641c[_0x1dd111(0x1a4)])throw CliErrors[_0x1dd111(0x19f)](_0x1dd111(0x1af),_0x1dd111(0x199));await writeInitConfig(_0x26e324,_0x51641c,_0x23b271),console[_0x1dd111(0x1a6)](_0x1dd111(0x1db)+_0x377e69),console[_0x1dd111(0x1a6)](_0x1dd111(0x19b)+_0x26e324),console[_0x1dd111(0x1a6)](_0x1dd111(0x1a8)+_0x51641c[_0x1dd111(0x1a4)]);if(_0x51641c[_0x1dd111(0x1d7)])console[_0x1dd111(0x1a6)](_0x1dd111(0x1b6)+_0x51641c['defaultApp']);}function convertToRuntimeConfig(_0x43ad69){const _0x15c639=a31_0x3199c6;if(_0x43ad69[_0x15c639(0x1da)]&&typeof _0x43ad69['apps']==='object')throw CliErrors[_0x15c639(0x19f)](_0x15c639(0x1e1),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x476b07={};for(const _0x483024 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x43ad69[_0x483024]!==undefined&&(_0x476b07[_0x483024]=_0x43ad69[_0x483024]);}return!_0x476b07[_0x15c639(0x1ce)]&&(_0x476b07['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x476b07;}async function runNonInteractive(_0x1461f7,_0x5096ce){const _0x4e1402=a31_0x3199c6,_0x3ff8e0=_0x1461f7['appcode'];if(!_0x3ff8e0)throw CliErrors[_0x4e1402(0x1e2)]('appcode','Usage:\x20'+CLI_BIN_NAME+_0x4e1402(0x1bc));const _0x33f1a0=resolveInitEnv(_0x1461f7);await writeInitConfig(_0x5096ce,{'appcode':_0x3ff8e0,'env':_0x33f1a0},_0x1461f7),console[_0x4e1402(0x1a6)](_0x4e1402(0x1dd)+_0x5096ce),console['log']('\x20\x20appcode:\x20'+_0x3ff8e0),console['log'](_0x4e1402(0x1b1)+_0x33f1a0);}async function runInteractive(_0x5a1f30,_0x5cca04){const _0x493e68=a31_0x3199c6,_0xe29e43=loadExisting(_0x5cca04),_0x49b68f=typeof _0xe29e43?.[_0x493e68(0x1a4)]===_0x493e68(0x19e)?_0xe29e43[_0x493e68(0x1a4)]:'',_0x327ea8=resolveInitEnv(_0x5a1f30);console[_0x493e68(0x1a6)](CLI_BIN_NAME+_0x493e68(0x1d6)+PRODUCT_CONFIG[_0x493e68(0x1d0)]+'\x0a');if(existsSync(_0x5cca04)&&!_0x5a1f30[_0x493e68(0x1a1)]){const _0x144c85=await promptYesNo(_0x493e68(0x1cb)+_0x5cca04+_0x493e68(0x1a0),![]);if(!_0x144c85){console[_0x493e68(0x1a6)](_0x493e68(0x1c5));return;}}const _0x151ca7=typeof _0x5a1f30[_0x493e68(0x1a4)]===_0x493e68(0x19e)?_0x5a1f30[_0x493e68(0x1a4)][_0x493e68(0x1b4)]():'';let _0x24f5a6=_0x151ca7;!_0x24f5a6&&(_0x24f5a6=await promptInput(_0x493e68(0x1aa),_0x49b68f));if(!_0x24f5a6['trim']())throw CliErrors['validation'](_0x493e68(0x1dc));await writeInitConfig(_0x5cca04,{'appcode':_0x24f5a6[_0x493e68(0x1b4)](),'env':_0x327ea8},_0x5a1f30),console[_0x493e68(0x1a6)](_0x493e68(0x1d9)+_0x5cca04),console[_0x493e68(0x1a6)](_0x493e68(0x1a8)+_0x24f5a6[_0x493e68(0x1b4)]()),console[_0x493e68(0x1a6)](_0x493e68(0x1b1)+_0x327ea8);}async function writeInitConfig(_0x232024,_0x228b73,_0x20e233){const _0x3bb694=a31_0x3199c6;let _0x1754e0={};existsSync(_0x232024)&&!_0x20e233[_0x3bb694(0x1a1)]&&(_0x1754e0=readConfigFile(_0x232024));for(const [_0xdb3b81,_0x400933]of Object['entries'](_0x228b73)){_0x400933!==undefined&&(_0x1754e0[_0xdb3b81]=_0x400933);}if(_0x1754e0[_0x3bb694(0x1c4)])delete _0x1754e0[_0x3bb694(0x1c4)];writeConfigFile(_0x232024,_0x1754e0);}class AbortPrompt extends Error{constructor(){const _0x299942=a31_0x3199c6;super(_0x299942(0x1ca)),this['name']=_0x299942(0x1bb);}}function a31_0x30e4(){const _0x20e592=['\x20\x20config:\x20\x20','utf8','parse','string','validation','\x20already\x20exists.\x20Overwrite?','yes','race','664925STiCiF','appcode','SIGINT','log','stdout','\x20\x20appcode:\x20','file','App\x20code','Target\x20environment\x20(default\x20','close','Source\x20file\x20not\x20found:\x20','once','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Skip\x20confirmation\x20when\x20overwriting','\x20\x20env:\x20\x20\x20\x20\x20','question','Invalid\x20env\x20\x22','trim','774954HrDGuS','\x20\x20default:\x20','boolean','20212506XwyIRM','[y/N]','env','AbortPrompt','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','390fntokT','includes','2798456BuhPLP','Override\x20imported\x20default\x20appcode','global','Override\x20imported\x20default\x20env','[Y/n]','app','Aborted.','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','cancelled','847794dGpbLK','toLowerCase','User\x20aborted\x20prompt','File\x20','App\x20code\x20for\x20the\x20project','apiDir','riskLevel','project','newConfigFileName','\x22.\x20Allowed:\x20','28gZutfF','Write\x20to\x20global\x20(~/','535566Dahvfe','5820lxUSzz','\x20init\x20—\x20Create\x20','defaultApp','removeListener','\x0aInitialized\x20','apps','Imported\x20from\x20','App\x20code\x20cannot\x20be\x20empty.','Initialized\x20','):\x20','cwd',')\x20instead\x20of\x20project','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','flagMissing','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`.','Failed\x20to\x20parse\x20source\x20file:\x20'];a31_0x30e4=function(){return _0x20e592;};return a31_0x30e4();}function createSafeRl(){const _0x35e50d=a31_0x3199c6,_0x106609=createInterface({'input':process['stdin'],'output':process[_0x35e50d(0x1a7)]});let _0x1dc0be;const _0xf3dca1=new Promise((_0x26c7a1,_0x2c3c03)=>{const _0x186089=_0x35e50d;_0x1dc0be=()=>{const _0xed4553=a31_0x3b67;_0x1dc0be&&(_0x106609[_0xed4553(0x1d8)]('SIGINT',_0x1dc0be),_0x1dc0be=undefined);try{_0x106609[_0xed4553(0x1ac)]();}catch{}_0x2c3c03(new AbortPrompt());},_0x106609[_0x186089(0x1ae)]('SIGINT',_0x1dc0be);}),_0x32aeae=()=>{const _0x596b0f=_0x35e50d;_0x1dc0be&&(_0x106609[_0x596b0f(0x1d8)](_0x596b0f(0x1a5),_0x1dc0be),_0x1dc0be=undefined);try{_0x106609[_0x596b0f(0x1ac)]();}catch{}};return{'rl':_0x106609,'abortPromise':_0xf3dca1,'disposeSuccess':_0x32aeae};}async function promptInput(_0x1c7f41,_0x518d83){const _0x2ff882=a31_0x3199c6,{rl:_0x210f05,abortPromise:_0x93da07,disposeSuccess:_0x30980b}=createSafeRl(),_0x1d0297=new Promise(_0x22a316=>{const _0x523c1a=a31_0x3b67,_0x24b678=_0x518d83?'\x20\x20'+_0x1c7f41+'\x20('+_0x518d83+_0x523c1a(0x1de):'\x20\x20'+_0x1c7f41+':\x20';_0x210f05['question'](_0x24b678,_0x338b38=>{const _0x264302=_0x523c1a;_0x30980b(),_0x22a316(_0x338b38[_0x264302(0x1b4)]()||_0x518d83);});});return Promise[_0x2ff882(0x1a2)]([_0x1d0297,_0x93da07]);}async function promptYesNo(_0x81b651,_0x5ab101){const _0x2f5791=a31_0x3199c6,{rl:_0x1f4256,abortPromise:_0x4299b7,disposeSuccess:_0x53434e}=createSafeRl(),_0x16a0e6=new Promise(_0x4fb17c=>{const _0x3fae27=a31_0x3b67,_0x474efb=_0x5ab101?_0x3fae27(0x1c3):_0x3fae27(0x1b9);_0x1f4256[_0x3fae27(0x1b2)]('\x20\x20'+_0x81b651+'\x20'+_0x474efb+':\x20',_0x34f018=>{const _0x525f3f=_0x3fae27;_0x53434e();const _0x2366da=_0x34f018[_0x525f3f(0x1b4)]()[_0x525f3f(0x1c9)]();if(_0x2366da==='y'||_0x2366da===_0x525f3f(0x1a1))_0x4fb17c(!![]);else{if(_0x2366da==='n'||_0x2366da==='no')_0x4fb17c(![]);else _0x4fb17c(_0x5ab101);}});});return Promise[_0x2f5791(0x1a2)]([_0x16a0e6,_0x4299b7]);}function loadExisting(_0x26b1d2){if(!existsSync(_0x26b1d2))return null;return readConfigFile(_0x26b1d2);}function resolveFilePath(_0x43dfcb){const _0x37eca4=a31_0x3199c6;return isAbsolute(_0x43dfcb)?_0x43dfcb:resolve(process[_0x37eca4(0x1df)](),_0x43dfcb);}function readSourceFile(_0x1beeac){const _0x36f194=a31_0x3199c6;try{const _0x3771ed=readFileSync(_0x1beeac,{'encoding':_0x36f194(0x19c)});return JSON[_0x36f194(0x19d)](_0x3771ed);}catch(_0x5db781){throw CliErrors[_0x36f194(0x19f)](_0x36f194(0x19a)+_0x5db781['message']);}}function resolveInitEnv(_0x221779){const _0x12f511=a31_0x3199c6,_0x53af98=_0x221779[_0x12f511(0x1ba)];if(_0x53af98===undefined||_0x53af98==='')return DEFAULT_CONFIG_VALUES[_0x12f511(0x1ba)];if(!RUNTIME_ENV_VALUES[_0x12f511(0x1be)](_0x53af98))throw CliErrors['validation'](_0x12f511(0x1b3)+_0x53af98+_0x12f511(0x1d1)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x53af98;}
@@ -1 +1 @@
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
+ const a32_0x5d7e3f=a32_0x3563;(function(_0x295d2d,_0x42c9b1){const _0x4e4840=a32_0x3563,_0x26a7f4=_0x295d2d();while(!![]){try{const _0x7f5c19=-parseInt(_0x4e4840(0x11f))/0x1*(-parseInt(_0x4e4840(0x127))/0x2)+parseInt(_0x4e4840(0x12d))/0x3+-parseInt(_0x4e4840(0x112))/0x4+parseInt(_0x4e4840(0x111))/0x5*(-parseInt(_0x4e4840(0x117))/0x6)+parseInt(_0x4e4840(0x12a))/0x7*(-parseInt(_0x4e4840(0x121))/0x8)+parseInt(_0x4e4840(0x131))/0x9+-parseInt(_0x4e4840(0x126))/0xa*(-parseInt(_0x4e4840(0x102))/0xb);if(_0x7f5c19===_0x42c9b1)break;else _0x26a7f4['push'](_0x26a7f4['shift']());}catch(_0x2aa954){_0x26a7f4['push'](_0x26a7f4['shift']());}}}(a32_0x2381,0xc7c45));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_0x5d7e3f(0x129),'type':a32_0x5d7e3f(0x125),'required':!![],'description':a32_0x5d7e3f(0x107)},FILE_FLAG={'name':'file','type':a32_0x5d7e3f(0x125),'required':!![],'description':a32_0x5d7e3f(0x13a)},QUERY_FLAG={'name':a32_0x5d7e3f(0x11a),'type':a32_0x5d7e3f(0x125),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':'topk','type':a32_0x5d7e3f(0x120),'description':a32_0x5d7e3f(0x10f)};function readKnowledgeFile(_0x371e0d){const _0x10a394=a32_0x5d7e3f;if(!_0x371e0d)throw CliErrors[_0x10a394(0x10c)]('File\x20path\x20is\x20required.');if(!existsSync(_0x371e0d))throw CliErrors[_0x10a394(0x10c)]('File\x20not\x20found:\x20'+_0x371e0d);if(!statSync(_0x371e0d)[_0x10a394(0x118)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x371e0d);return readFileSync(_0x371e0d,_0x10a394(0x113));}function summarizePersonalItem(_0x361a2b){const _0x2b75c5=a32_0x5d7e3f;return{'id':_0x361a2b['id'],'title':_0x361a2b['title'],'version':_0x361a2b['version'],'ragStatus':_0x361a2b['ragStatus'],'ragErrorMessage':_0x361a2b[_0x2b75c5(0x136)],'updateTime':_0x361a2b[_0x2b75c5(0x12c)]};}function detailPersonalItem(_0x10687a){const _0x4f9d67=a32_0x5d7e3f;return{'id':_0x10687a['id'],'appCode':_0x10687a[_0x4f9d67(0x119)],'scope':_0x10687a[_0x4f9d67(0x132)],'userId':_0x10687a[_0x4f9d67(0x103)],'title':_0x10687a[_0x4f9d67(0x129)],'content':_0x10687a[_0x4f9d67(0x10b)]??'','version':_0x10687a['version'],'ragStatus':_0x10687a[_0x4f9d67(0x12b)],'ragErrorMessage':_0x10687a['ragErrorMessage'],'createTime':_0x10687a['createTime'],'updateTime':_0x10687a['updateTime']};}function summarizeSearchHit(_0x1db6cc){const _0x531f8e=a32_0x5d7e3f;return{'scope':_0x1db6cc[_0x531f8e(0x132)],'docId':_0x1db6cc[_0x531f8e(0x13e)],'score':_0x1db6cc['score'],'weightedScore':_0x1db6cc['weightedScore'],'content':_0x1db6cc[_0x531f8e(0x10b)],'metadata':_0x1db6cc[_0x531f8e(0x116)]};}function readTopK(_0x4449df){const _0x349854=a32_0x5d7e3f,_0x615551=_0x4449df[_0x349854(0x124)]('topk');if(_0x615551===undefined||_0x615551===null||_0x615551==='')return undefined;const _0xf937fc=_0x4449df[_0x349854(0x10e)]('topk');if(!Number[_0x349854(0x11e)](_0xf937fc)||_0xf937fc<0x1)throw CliErrors[_0x349854(0x10c)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0xf937fc;}const kbList={'service':'kb','command':a32_0x5d7e3f(0x11b),'description':a32_0x5d7e3f(0x12f),'risk':a32_0x5d7e3f(0x109),'flags':[VERBOSE_FLAG],async 'execute'(_0x30f646){const _0xd47778=a32_0x5d7e3f,_0x49d465=await listPersonalKnowledgeBaseItems(_0x30f646['appCode']);if(_0x30f646[_0xd47778(0x11d)](_0xd47778(0x10d)))return{'ok':!![],'data':{'total':_0x49d465[_0xd47778(0x115)],'items':_0x49d465}};return{'ok':!![],'data':{'total':_0x49d465[_0xd47778(0x115)],'items':_0x49d465[_0xd47778(0x134)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x5d7e3f(0x105),'description':a32_0x5d7e3f(0x130),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x5d7e3f(0x128)}],async 'execute'(_0x426916){const _0x3244d7=a32_0x5d7e3f,_0x132223=await getPersonalKnowledgeBaseItem(_0x426916['num']('id'),_0x426916[_0x3244d7(0x119)]);return{'ok':!![],'data':detailPersonalItem(_0x132223)};}},kbCreate={'service':'kb','command':a32_0x5d7e3f(0x12e),'description':a32_0x5d7e3f(0x114),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x29a442){const _0x575a82=a32_0x5d7e3f,_0x380c34=_0x29a442[_0x575a82(0x108)]('title'),_0x38f8ca=readKnowledgeFile(_0x29a442[_0x575a82(0x108)](_0x575a82(0x122))),_0x2de7d4=await createPersonalKnowledgeBaseItem(_0x29a442[_0x575a82(0x119)],{'title':_0x380c34,'content':_0x38f8ca});return{'ok':!![],'data':summarizePersonalItem(_0x2de7d4),'message':'Created\x20KB\x20entry\x20'+_0x2de7d4['id']+'\x20('+_0x2de7d4[_0x575a82(0x129)]+')'};},async 'dryRun'(_0x5eb308){const _0x3d68b9=a32_0x5d7e3f,_0x30125c=_0x5eb308[_0x3d68b9(0x108)](_0x3d68b9(0x129)),_0x3e8a0d=readKnowledgeFile(_0x5eb308[_0x3d68b9(0x108)](_0x3d68b9(0x122)));return dryRun(_0x3d68b9(0x138),_0x3d68b9(0x13c))[_0x3d68b9(0x10a)]({'appCode':_0x5eb308[_0x3d68b9(0x119)],'title':_0x30125c,'content':_0x3e8a0d})[_0x3d68b9(0x101)](_0x3d68b9(0x110)+_0x30125c+'\x22')['build']();}},kbUpdate={'service':'kb','command':'update','description':a32_0x5d7e3f(0x133),'risk':a32_0x5d7e3f(0x123),'flags':[{...ID_FLAG,'description':a32_0x5d7e3f(0x128)},{...TITLE_FLAG,'required':![],'description':a32_0x5d7e3f(0x13d)},FILE_FLAG],async 'execute'(_0x25d43d){const _0x3d27ec=a32_0x5d7e3f,_0x28254f=_0x25d43d['num']('id'),_0x5032c2=readKnowledgeFile(_0x25d43d[_0x3d27ec(0x108)](_0x3d27ec(0x122))),_0xcbca7d=_0x25d43d[_0x3d27ec(0x108)](_0x3d27ec(0x129))||(await getPersonalKnowledgeBaseItem(_0x28254f,_0x25d43d[_0x3d27ec(0x119)]))[_0x3d27ec(0x129)],_0x3b973d=await updatePersonalKnowledgeBaseItem(_0x28254f,_0x25d43d[_0x3d27ec(0x119)],{'title':_0xcbca7d,'content':_0x5032c2});return{'ok':!![],'data':summarizePersonalItem(_0x3b973d),'message':_0x3d27ec(0x106)+_0x3b973d['id']+'\x20('+_0x3b973d[_0x3d27ec(0x129)]+')'};},async 'dryRun'(_0x401a25){const _0x418d6b=a32_0x5d7e3f,_0x2971aa=_0x401a25[_0x418d6b(0x10e)]('id'),_0x558f5e=readKnowledgeFile(_0x401a25['str'](_0x418d6b(0x122))),_0x3851c4=_0x401a25['str']('title')||(await getPersonalKnowledgeBaseItem(_0x2971aa,_0x401a25[_0x418d6b(0x119)]))['title'];return dryRun(_0x418d6b(0x138),_0x418d6b(0x137)+_0x2971aa+'/update')[_0x418d6b(0x10a)]({'appCode':_0x401a25[_0x418d6b(0x119)],'title':_0x3851c4,'content':_0x558f5e})[_0x418d6b(0x101)](_0x418d6b(0x11c)+_0x2971aa)[_0x418d6b(0x135)]();}},kbSearch={'service':'kb','command':a32_0x5d7e3f(0x13b),'description':a32_0x5d7e3f(0x104),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0xb1624a){const _0x15d311=a32_0x5d7e3f;if(!_0xb1624a[_0x15d311(0x108)](_0x15d311(0x11a))[_0x15d311(0x139)]())throw CliErrors[_0x15d311(0x10c)]('Search\x20query\x20is\x20required.');readTopK(_0xb1624a);},async 'execute'(_0x2d9b86){const _0x5e80a7=a32_0x5d7e3f,_0x3428df=_0x2d9b86[_0x5e80a7(0x108)]('query')[_0x5e80a7(0x139)](),_0x2909e1=readTopK(_0x2d9b86),_0x45a391=await searchKnowledgeBase(_0x2d9b86[_0x5e80a7(0x119)],{'query':_0x3428df,'topK':_0x2909e1});return{'ok':!![],'data':{'total':_0x45a391[_0x5e80a7(0x115)],'hits':_0x45a391[_0x5e80a7(0x134)](summarizeSearchHit)}};}};function a32_0x3563(_0x4ec0df,_0x56a8de){_0x4ec0df=_0x4ec0df-0x101;const _0x238136=a32_0x2381();let _0x35631d=_0x238136[_0x4ec0df];return _0x35631d;}export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];function a32_0x2381(){const _0x418660=['detail','Updated\x20KB\x20entry\x20','Personal\x20knowledge-base\x20entry\x20title','str','read','body','content','validation','verbose','num','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','62635GyrXAp','1799144WkoRvQ','utf8','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','length','metadata','354SMOgpt','isFile','appCode','query','list','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','bool','isFinite','391BnGuAz','number','2423392GtahCq','file','write','flag','string','10JJcyNr','1622DORxsb','Personal\x20knowledge-base\x20entry\x20ID','title','14ezAfVv','ragStatus','updateTime','710142JVKEqh','create','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','3683349UAWyZL','scope','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','map','build','ragErrorMessage','/client/knowledge-base/personal/','POST','trim','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','search','/client/knowledge-base/personal/create','Override\x20the\x20existing\x20entry\x20title','docId','description','18148856BTyxJh','userId','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content'];a32_0x2381=function(){return _0x418660;};return a32_0x2381();}
@@ -1 +1 @@
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
+ const a33_0x2ed879=a33_0x1b9d;(function(_0x584040,_0xbe5310){const _0x3ad707=a33_0x1b9d,_0x2d7266=_0x584040();while(!![]){try{const _0x27d06a=-parseInt(_0x3ad707(0x203))/0x1*(-parseInt(_0x3ad707(0x202))/0x2)+parseInt(_0x3ad707(0x201))/0x3+-parseInt(_0x3ad707(0x1e6))/0x4+parseInt(_0x3ad707(0x204))/0x5+-parseInt(_0x3ad707(0x1e5))/0x6*(parseInt(_0x3ad707(0x1f7))/0x7)+parseInt(_0x3ad707(0x207))/0x8*(-parseInt(_0x3ad707(0x1fc))/0x9)+-parseInt(_0x3ad707(0x1e4))/0xa;if(_0x27d06a===_0xbe5310)break;else _0x2d7266['push'](_0x2d7266['shift']());}catch(_0x4f3124){_0x2d7266['push'](_0x2d7266['shift']());}}}(a33_0x1e7e,0x5de2a));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x1b9d(_0xeb3598,_0x579fd2){_0xeb3598=_0xeb3598-0x1e4;const _0x1e7e6a=a33_0x1e7e();let _0x1b9d9a=_0x1e7e6a[_0xeb3598];return _0x1b9d9a;}function printLogs(_0x15f3be){const _0x3f9524=a33_0x1b9d;if(_0x15f3be[_0x3f9524(0x1fd)]===0x0){console[_0x3f9524(0x1f6)](_0x3f9524(0x1e7));return;}console['log']('*\x20'+CLI_DISPLAY_NAME+_0x3f9524(0x1f2)),_0x15f3be[_0x3f9524(0x1ee)]((_0x312c74,_0x359c7b)=>{const _0x545bf9=_0x3f9524,_0x3bc101=new Date(_0x312c74[_0x545bf9(0x1f0)])[_0x545bf9(0x1ec)](_0x545bf9(0x1e8)),_0xa7955f=_0x312c74[_0x545bf9(0x1e9)]===_0x545bf9(0x1ea)?'√':_0x312c74['level']===_0x545bf9(0x1f5)?'×':_0x312c74[_0x545bf9(0x1e9)]===_0x545bf9(0x1f3)?'!':'i';console[_0x545bf9(0x1f6)](_0x359c7b+0x1+'.\x20'+_0xa7955f+'\x20['+_0x312c74['command']+']\x20'+_0x312c74[_0x545bf9(0x1ff)]),console[_0x545bf9(0x1f6)](_0x545bf9(0x1ed)+_0x3bc101),_0x312c74[_0x545bf9(0x1fb)]&&console[_0x545bf9(0x1f6)](_0x545bf9(0x1fe)+_0x312c74[_0x545bf9(0x1fb)]+'ms'),_0x312c74[_0x545bf9(0x1f1)]&&Object['keys'](_0x312c74['details'])['length']>0x0&&console[_0x545bf9(0x1f6)](_0x545bf9(0x206)+JSON['stringify'](_0x312c74[_0x545bf9(0x1f1)],null,0x2)),console['log']('');});}function a33_0x1e7e(){const _0x24022b=['details','\x20logs:\x0a','warn','clearLogs','error','log','652414UYdcXZ','readLogs','*\x20Logs\x20cleared','read','duration','88470FsjkbO','length','\x20\x20\x20Duration:\x20','message','View\x20command\x20history\x20logs','1436256ltwRke','757258SXYzPV','1Cdfaos','3242455vTbVcb','write','\x20\x20\x20Details:\x20','184fYMTmR','366130xVBgOG','48LJPBPH','451996iziVlP','*\x20No\x20logs\x20found','en-US','level','success','logs','toLocaleString','\x20\x20\x20Time:\x20','forEach','clear','timestamp'];a33_0x1e7e=function(){return _0x24022b;};return a33_0x1e7e();}export const logsDefinitions=[{'service':a33_0x2ed879(0x1eb),'command':'show','description':a33_0x2ed879(0x200),'risk':a33_0x2ed879(0x1fa),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xa54850){const _0x15fe82=a33_0x2ed879;return printLogs(logger[_0x15fe82(0x1f8)]()),{'ok':!![]};}},{'service':a33_0x2ed879(0x1eb),'command':a33_0x2ed879(0x1ef),'description':'Clear\x20command\x20history\x20logs','risk':a33_0x2ed879(0x205),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1cfbf9){const _0x517679=a33_0x2ed879;return logger[_0x517679(0x1f4)](),console[_0x517679(0x1f6)](_0x517679(0x1f9)),{'ok':!![]};}}];
@@ -1 +1 @@
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
+ function a34_0xc5dc(){const _0x71a692=['invoice','1333210qpQWFM','imageUrl','body','.\x20Supported\x20scenes:\x20','description','Invoice','image-file','count','path','fileName','POST','filePath','form','205wVFSZD','109689WqlqSK','Preview:\x20recognize\x20','268788DTViyj','Table','write','toLowerCase','/client/ocr','ocr','apiError','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','General','32416ghaDto','IdCard','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','trim','recognize','270cGSbYx','1135771voKBGq','scene','general','build','filter','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','imageFile','appCode','fileUrl','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','/client/queryFileUrl','string','validation','/client/uploadFile','idCard','\x20OCR','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','length','233414NJZjlv','str','8gjhaVZ','22830jIYktg','image-url','<filePath\x20returned\x20by\x20/client/uploadFile>'];a34_0xc5dc=function(){return _0x71a692;};return a34_0xc5dc();}const a34_0x3229c7=a34_0x3a09;(function(_0x371993,_0x5a894c){const _0x2befea=a34_0x3a09,_0x55d3ef=_0x371993();while(!![]){try{const _0x38b765=parseInt(_0x2befea(0xd0))/0x1+-parseInt(_0x2befea(0x9a))/0x2*(-parseInt(_0x2befea(0xad))/0x3)+parseInt(_0x2befea(0xaf))/0x4+parseInt(_0x2befea(0xac))/0x5*(-parseInt(_0x2befea(0x9b))/0x6)+-parseInt(_0x2befea(0xbe))/0x7+-parseInt(_0x2befea(0xb8))/0x8*(-parseInt(_0x2befea(0xbd))/0x9)+-parseInt(_0x2befea(0x9f))/0xa;if(_0x38b765===_0x5a894c)break;else _0x55d3ef['push'](_0x55d3ef['shift']());}catch(_0x3901a3){_0x55d3ef['push'](_0x55d3ef['shift']());}}}(a34_0xc5dc,0x1c86c));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_0x3229c7(0x9e),a34_0x3229c7(0xc0),'form',a34_0x3229c7(0xcc)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x3229c7(0xa4),'general':a34_0x3229c7(0xb7),'form':a34_0x3229c7(0xb0),'idCard':a34_0x3229c7(0xb9)},SCENE_FLAG={'name':a34_0x3229c7(0xbf),'type':a34_0x3229c7(0xc9),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x3229c7(0xb6)},IMAGE_FILE_FLAG={'name':a34_0x3229c7(0xa5),'type':'string','description':a34_0x3229c7(0xba)},IMAGE_URL_FLAG={'name':a34_0x3229c7(0x9c),'type':a34_0x3229c7(0xc9),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x3c1303){const _0x928b88=a34_0x3229c7,_0x47938c=_0x3c1303[_0x928b88(0xbb)]()[_0x928b88(0xb2)]();if(_0x47938c==='idcard')return _0x928b88(0xcc);if(_0x47938c===_0x928b88(0x9e)||_0x47938c==='general'||_0x47938c===_0x928b88(0xab))return _0x47938c;throw CliErrors[_0x928b88(0xca)]('Unsupported\x20OCR\x20scene:\x20'+_0x3c1303+_0x928b88(0xa2)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x364013){const _0x20197b=a34_0x3229c7,_0x18eba0=_0x364013['str'](_0x20197b(0xa5))[_0x20197b(0xbb)](),_0x22aed1=_0x364013['str'](_0x20197b(0x9c))[_0x20197b(0xbb)]();return{'imageFile':_0x18eba0,'imageUrl':_0x22aed1,'count':[_0x18eba0,_0x22aed1][_0x20197b(0xc2)](Boolean)[_0x20197b(0xcf)]};}function validateInputSelection(_0x415e49){const _0x18b875=a34_0x3229c7,_0x4a8ac2=selectedInputs(_0x415e49);if(_0x4a8ac2[_0x18b875(0xa6)]!==0x1)throw CliErrors[_0x18b875(0xca)](_0x18b875(0xc7));return _0x4a8ac2;}function withScene(_0x2e9312,_0x1ef72a,_0xae1c43){const _0x1b022f=a34_0x3229c7;return{..._0x2e9312,'scene':_0x1ef72a,..._0xae1c43?{'sourceFile':{'fileName':_0xae1c43[_0x1b022f(0xa8)],'filePath':_0xae1c43[_0x1b022f(0xaa)]}}:{}};}function a34_0x3a09(_0x5e032a,_0x104093){_0x5e032a=_0x5e032a-0x99;const _0xc5dcf8=a34_0xc5dc();let _0x3a0973=_0xc5dcf8[_0x5e032a];return _0x3a0973;}const ocrRecognize={'service':a34_0x3229c7(0xb4),'command':a34_0x3229c7(0xbc),'description':'Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','risk':a34_0x3229c7(0xb1),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x27f769){const _0x11f991=a34_0x3229c7,_0x386218=normalizeScene(_0x27f769['str'](_0x11f991(0xbf))),_0x383c16=SCENE_TO_LEGACY_TYPE[_0x386218],_0x3da8b1=validateInputSelection(_0x27f769);if(_0x3da8b1['imageUrl'])return dryRun('POST',_0x11f991(0xb3))[_0x11f991(0xa1)]({'appCode':_0x27f769[_0x11f991(0xc5)],'url':_0x3da8b1[_0x11f991(0xa0)],'type':_0x383c16})['description'](_0x11f991(0xae)+_0x386218+'\x20OCR\x20from\x20URL')[_0x11f991(0xc1)]();const _0x47d59f=requireRuntimeUploadFile(_0x3da8b1['imageFile'],_0x11f991(0xa5));return dryRun('POST',_0x11f991(0xcb))[_0x11f991(0xa1)]({'steps':[{'method':_0x11f991(0xa9),'url':_0x11f991(0xcb),'body':{'appCode':_0x27f769['appCode'],'multipart':{'file':_0x47d59f}}},{'method':_0x11f991(0xa9),'url':_0x11f991(0xc8),'body':{'filePath':_0x11f991(0x9d),'downloadFlag':![]}},{'method':'POST','url':_0x11f991(0xb3),'body':{'appCode':_0x27f769[_0x11f991(0xc5)],'url':_0x11f991(0xce),'type':_0x383c16}}]})[_0x11f991(0xa3)](_0x11f991(0xc3)+_0x386218+_0x11f991(0xcd))[_0x11f991(0xc1)]();},async 'execute'(_0x12dada){const _0x30b88a=a34_0x3229c7,_0x4b7e29=normalizeScene(_0x12dada[_0x30b88a(0x99)](_0x30b88a(0xbf))),_0x4a5c40=SCENE_TO_LEGACY_TYPE[_0x4b7e29],_0x5bb75a=validateInputSelection(_0x12dada);if(_0x5bb75a['imageUrl']){const _0x26fd82=await recognizeRuntimeOcr(_0x12dada[_0x30b88a(0xc5)],{'url':_0x5bb75a[_0x30b88a(0xa0)],'type':_0x4a5c40});return{'ok':!![],'data':withScene(_0x26fd82,_0x4b7e29)};}const _0x5b9cee=requireRuntimeUploadFile(_0x5bb75a[_0x30b88a(0xc4)],'image-file'),_0xeee361=await uploadRuntimeFile(_0x12dada[_0x30b88a(0xc5)],_0x5b9cee[_0x30b88a(0xa7)]);if(!_0xeee361[_0x30b88a(0xaa)])throw CliErrors[_0x30b88a(0xb5)]('File\x20upload\x20response\x20missing\x20filePath.');const _0x4ec41d=await queryRuntimeFileUrl(_0xeee361[_0x30b88a(0xaa)],{'download':![]});if(!_0x4ec41d[_0x30b88a(0xc6)])throw CliErrors[_0x30b88a(0xb5)]('File\x20URL\x20response\x20missing\x20fileUrl.');const _0x93260b=await recognizeRuntimeOcr(_0x12dada[_0x30b88a(0xc5)],{'url':_0x4ec41d[_0x30b88a(0xc6)],'type':_0x4a5c40});return{'ok':!![],'data':withScene(_0x93260b,_0x4b7e29,_0xeee361)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
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
+ const a35_0x524e7f=a35_0x4e35;(function(_0x54ce5d,_0x1a9149){const _0x11ccfd=a35_0x4e35,_0x549d9e=_0x54ce5d();while(!![]){try{const _0x331ff2=-parseInt(_0x11ccfd(0xb0))/0x1+parseInt(_0x11ccfd(0xa5))/0x2*(-parseInt(_0x11ccfd(0xd7))/0x3)+parseInt(_0x11ccfd(0xb3))/0x4+-parseInt(_0x11ccfd(0xd1))/0x5*(-parseInt(_0x11ccfd(0xd9))/0x6)+-parseInt(_0x11ccfd(0xd0))/0x7+parseInt(_0x11ccfd(0xd2))/0x8+-parseInt(_0x11ccfd(0xa9))/0x9;if(_0x331ff2===_0x1a9149)break;else _0x549d9e['push'](_0x549d9e['shift']());}catch(_0x2cc8bf){_0x549d9e['push'](_0x549d9e['shift']());}}}(a35_0x4f9e,0x34577));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x524e7f(0xdf),'type':'string','description':a35_0x524e7f(0xad)},FUNCTION_NAME_FLAG={'name':a35_0x524e7f(0xbf),'type':a35_0x524e7f(0xb5),'required':!![],'description':a35_0x524e7f(0xc3)},DESCRIPTION_FLAG={'name':a35_0x524e7f(0xcf),'type':a35_0x524e7f(0xb5),'description':a35_0x524e7f(0xbb)},SOURCE_SESSION_FLAG={'name':a35_0x524e7f(0xc0),'type':a35_0x524e7f(0xb5),'description':a35_0x524e7f(0xce)};function a35_0x4f9e(){const _0x2ce45d=['File\x20is\x20not\x20a\x20regular\x20file:\x20','personal-bff','test','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','/update','376422QprssA','body','read','1047976ltrFVN','POST','string','scriptType','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','map','functionName','params','Personal\x20BFF\x20description','Preview:\x20update\x20personal\x20BFF\x20','verbose','validation','name','source-session-id','scriptContent','num','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','detail','write','trim','update','version','/client/runtime-bff/personal/create','flag','Personal\x20BFF\x20script\x20ID','build','config','Optional\x20source\x20RuntimeAgent\x20session\x20id','description','192773IZzPLi','934635EnmASO','1687248ABtCbn','Preview:\x20create\x20personal\x20BFF\x20','bool','appCode','/client/runtime-bff/personal/','79056SiSfJs','Executed\x20personal\x20BFF\x20','12TNtEtX','gmtCreate','length','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','createTime','File\x20path\x20is\x20required.','file','gmtModified','--params\x20must\x20be\x20a\x20JSON\x20object.','str','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','updateTime','Personal\x20BFF\x20script\x20file\x20is\x20blank.','keys','Show\x20one\x20personal\x20BFF\x20by\x20id','16dDoxSv','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','sourceSessionId','high-risk-write','158274MIgFIW'];a35_0x4f9e=function(){return _0x2ce45d;};return a35_0x4f9e();}function normalizeFunctionName(_0x474f81){const _0x4a853e=a35_0x524e7f,_0x5bb4cf=String(_0x474f81||'')[_0x4a853e(0xc6)]();if(!_0x5bb4cf||!FUNCTION_NAME_PATTERN[_0x4a853e(0xac)](_0x5bb4cf))throw CliErrors['validation'](_0x4a853e(0xdc));return _0x5bb4cf;}function readScriptFile(_0x49ecb3){const _0x56afc2=a35_0x524e7f;if(!_0x49ecb3)throw CliErrors['validation'](_0x56afc2(0xde));if(!existsSync(_0x49ecb3))throw CliErrors[_0x56afc2(0xbe)]('File\x20not\x20found:\x20'+_0x49ecb3);if(!statSync(_0x49ecb3)['isFile']())throw CliErrors[_0x56afc2(0xbe)](_0x56afc2(0xaa)+_0x49ecb3);const _0x1745f4=readFileSync(_0x49ecb3,'utf8');if(!_0x1745f4[_0x56afc2(0xc6)]())throw CliErrors[_0x56afc2(0xbe)](_0x56afc2(0xa2));return _0x1745f4;}function optionalTrimmed(_0x5c13a2){const _0x3e6615=a35_0x524e7f,_0x53a12d=String(_0x5c13a2||'')[_0x3e6615(0xc6)]();return _0x53a12d||undefined;}function a35_0x4e35(_0x5a7a1a,_0x23b432){_0x5a7a1a=_0x5a7a1a-0xa2;const _0x4f9e51=a35_0x4f9e();let _0x4e35cc=_0x4f9e51[_0x5a7a1a];return _0x4e35cc;}function summarizeBff(_0xecfca1){const _0x315724=a35_0x524e7f;return{'id':_0xecfca1['id'],'appCode':_0xecfca1[_0x315724(0xd5)],'functionName':_0xecfca1[_0x315724(0xb9)],'description':_0xecfca1['description'],'scriptType':_0xecfca1[_0x315724(0xb6)],'version':_0xecfca1['version'],'gmtModified':_0xecfca1[_0x315724(0xe0)],'updateTime':_0xecfca1[_0x315724(0xe4)]};}function detailBff(_0x321f18){const _0x3df8a7=a35_0x524e7f;return{'id':_0x321f18['id'],'appCode':_0x321f18['appCode'],'functionName':_0x321f18[_0x3df8a7(0xb9)],'description':_0x321f18[_0x3df8a7(0xcf)],'scriptType':_0x321f18[_0x3df8a7(0xb6)],'scriptContent':_0x321f18[_0x3df8a7(0xc1)]??'','config':_0x321f18[_0x3df8a7(0xcd)],'version':_0x321f18[_0x3df8a7(0xc8)],'createUserId':_0x321f18['createUserId'],'gmtCreate':_0x321f18[_0x3df8a7(0xda)],'gmtModified':_0x321f18[_0x3df8a7(0xe0)],'createTime':_0x321f18[_0x3df8a7(0xdd)],'updateTime':_0x321f18[_0x3df8a7(0xe4)]};}function buildCreateInput(_0x3b50b8){const _0x43737c=a35_0x524e7f;return{'functionName':normalizeFunctionName(_0x3b50b8[_0x43737c(0xe2)]('name')),...optionalTrimmed(_0x3b50b8[_0x43737c(0xe2)](_0x43737c(0xcf)))?{'description':optionalTrimmed(_0x3b50b8['str'](_0x43737c(0xcf)))}:{},'scriptContent':readScriptFile(_0x3b50b8[_0x43737c(0xe2)]('file')),...optionalTrimmed(_0x3b50b8['str'](_0x43737c(0xc0)))?{'sourceSessionId':optionalTrimmed(_0x3b50b8['str'](_0x43737c(0xc0)))}:{}};}function buildUpdateInput(_0x539a23){const _0x5ae7ac=a35_0x524e7f,_0x5c5b4c={};optionalTrimmed(_0x539a23['str'](_0x5ae7ac(0xbf)))&&(_0x5c5b4c[_0x5ae7ac(0xb9)]=normalizeFunctionName(_0x539a23[_0x5ae7ac(0xe2)](_0x5ae7ac(0xbf))));_0x539a23[_0x5ae7ac(0xca)](_0x5ae7ac(0xcf))!==undefined&&(_0x5c5b4c[_0x5ae7ac(0xcf)]=_0x539a23['str'](_0x5ae7ac(0xcf)));optionalTrimmed(_0x539a23['str']('file'))&&(_0x5c5b4c[_0x5ae7ac(0xc1)]=readScriptFile(_0x539a23[_0x5ae7ac(0xe2)](_0x5ae7ac(0xdf))));_0x539a23['flag'](_0x5ae7ac(0xc0))!==undefined&&(_0x5c5b4c[_0x5ae7ac(0xa7)]=_0x539a23[_0x5ae7ac(0xe2)](_0x5ae7ac(0xc0)));if(Object[_0x5ae7ac(0xa3)](_0x5c5b4c)[_0x5ae7ac(0xdb)]===0x0)throw CliErrors[_0x5ae7ac(0xbe)](_0x5ae7ac(0xe3));return _0x5c5b4c;}function parseExecParams(_0x35f0d3){const _0x2b120c=a35_0x524e7f,_0x3e9a53=parseJsonParams(_0x35f0d3)??{};if(Array['isArray'](_0x3e9a53))throw CliErrors['validation'](_0x2b120c(0xe1));return _0x3e9a53;}const personalBffList={'service':a35_0x524e7f(0xab),'command':'list','description':a35_0x524e7f(0xa6),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x1b25d4){const _0x9aa33f=a35_0x524e7f,_0x39fc5a=await listPersonalBffs(_0x1b25d4[_0x9aa33f(0xd5)]);return{'ok':!![],'data':{'total':_0x39fc5a[_0x9aa33f(0xdb)],'items':_0x1b25d4[_0x9aa33f(0xd4)](_0x9aa33f(0xbd))?_0x39fc5a:_0x39fc5a[_0x9aa33f(0xb8)](summarizeBff)}};}},personalBffDetail={'service':a35_0x524e7f(0xab),'command':a35_0x524e7f(0xc4),'description':a35_0x524e7f(0xa4),'risk':a35_0x524e7f(0xb2),'flags':[{...ID_FLAG,'description':a35_0x524e7f(0xcb)}],async 'execute'(_0x452aa6){const _0x1f0f60=a35_0x524e7f,_0xeb833d=await getPersonalBff(_0x452aa6[_0x1f0f60(0xc2)]('id'),_0x452aa6[_0x1f0f60(0xd5)]);return{'ok':!![],'data':detailBff(_0xeb833d)};}},personalBffCreate={'service':a35_0x524e7f(0xab),'command':'create','description':a35_0x524e7f(0xb7),'risk':a35_0x524e7f(0xc5),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x56ff60){const _0x28a77e=a35_0x524e7f,_0x2b71fc=buildCreateInput(_0x56ff60),_0x429b3c=await createPersonalBff(_0x56ff60[_0x28a77e(0xd5)],_0x2b71fc);return{'ok':!![],'data':detailBff(_0x429b3c),'message':'Created\x20personal\x20BFF\x20'+_0x429b3c['id']+(_0x429b3c[_0x28a77e(0xb9)]?'\x20('+_0x429b3c[_0x28a77e(0xb9)]+')':'')};},async 'dryRun'(_0x46b5ee){const _0x152781=a35_0x524e7f,_0x1a45e1=buildCreateInput(_0x46b5ee);return dryRun(_0x152781(0xb4),_0x152781(0xc9))[_0x152781(0xb1)]({'appCode':_0x46b5ee[_0x152781(0xd5)],..._0x1a45e1})['description'](_0x152781(0xd3)+_0x1a45e1[_0x152781(0xb9)])[_0x152781(0xcc)]();}},personalBffUpdate={'service':a35_0x524e7f(0xab),'command':a35_0x524e7f(0xc7),'description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':a35_0x524e7f(0xc5),'flags':[{...ID_FLAG,'description':a35_0x524e7f(0xcb)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x575292){const _0x450789=a35_0x524e7f,_0x731d58=_0x575292[_0x450789(0xc2)]('id'),_0x11fd93=buildUpdateInput(_0x575292),_0x205df9=await updatePersonalBff(_0x731d58,_0x575292[_0x450789(0xd5)],_0x11fd93);return{'ok':!![],'data':detailBff(_0x205df9),'message':'Updated\x20personal\x20BFF\x20'+_0x205df9['id']+(_0x205df9[_0x450789(0xb9)]?'\x20('+_0x205df9['functionName']+')':'')};},async 'dryRun'(_0x2e9582){const _0x5c24ef=a35_0x524e7f,_0x3b3296=_0x2e9582[_0x5c24ef(0xc2)]('id'),_0x19ee5a=buildUpdateInput(_0x2e9582);return dryRun(_0x5c24ef(0xb4),_0x5c24ef(0xd6)+_0x3b3296+_0x5c24ef(0xaf))[_0x5c24ef(0xb1)]({'appCode':_0x2e9582[_0x5c24ef(0xd5)],..._0x19ee5a})[_0x5c24ef(0xcf)](_0x5c24ef(0xbc)+_0x3b3296)['build']();}},personalBffExec={'service':a35_0x524e7f(0xab),'command':'exec','description':'Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','risk':a35_0x524e7f(0xa8),'flags':[{...ID_FLAG,'description':a35_0x524e7f(0xcb)},{...PARAMS_FLAG,'description':a35_0x524e7f(0xae)}],async 'validate'(_0x2e4141){const _0x45ec5f=a35_0x524e7f;parseExecParams(_0x2e4141[_0x45ec5f(0xe2)]('params'));},async 'execute'(_0x41190c){const _0x2341b5=a35_0x524e7f,_0xbea3b3=_0x41190c[_0x2341b5(0xc2)]('id'),_0x46e455=parseExecParams(_0x41190c[_0x2341b5(0xe2)](_0x2341b5(0xba))),_0x4ba14b=await executePersonalBff(_0xbea3b3,_0x41190c['appCode'],_0x46e455);return{'ok':!![],'data':{'result':_0x4ba14b},'message':_0x2341b5(0xd8)+_0xbea3b3};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
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
+ const a36_0x492f2e=a36_0x3db5;(function(_0x1a1407,_0x50c4db){const _0x9b7371=a36_0x3db5,_0x3f2cab=_0x1a1407();while(!![]){try{const _0xb6e4cc=parseInt(_0x9b7371(0x1a4))/0x1*(-parseInt(_0x9b7371(0x19e))/0x2)+-parseInt(_0x9b7371(0x19f))/0x3+parseInt(_0x9b7371(0x1ad))/0x4+-parseInt(_0x9b7371(0x1a1))/0x5+-parseInt(_0x9b7371(0x1b1))/0x6+parseInt(_0x9b7371(0x1c2))/0x7+parseInt(_0x9b7371(0x1ae))/0x8;if(_0xb6e4cc===_0x50c4db)break;else _0x3f2cab['push'](_0x3f2cab['shift']());}catch(_0x5d5e04){_0x3f2cab['push'](_0x3f2cab['shift']());}}}(a36_0x1017,0x4c91e));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';function a36_0x1017(){const _0x3a3316=['API\x20Documentation','Skills','service','map','Artifacts','push','list','values','Authentication','\x20\x20[write]','run','743106QilUQV','BFF\x20Scripts','defaultCommand','SQL\x20Queries','install','get','Workspace','File','OCR','50hnlGuy','1879410YZqRlZ','Instant\x20API','1851625XVKtqf','App\x20Management','set','7597AoqvmL','has','Runtime\x20App\x20Config','Datasets','CLI\x20Built-in\x20Skill','\x20\x20[high-risk-write]','Self\x20Update','command','Diagnostics','374988fWDZnU','14818640PvlDxQ','Schema','description','3311310atiRnu','isSingleCommand','show','Logs','read','from'];a36_0x1017=function(){return _0x3a3316;};return a36_0x1017();}import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';function a36_0x3db5(_0x30b6d4,_0x35b85e){_0x30b6d4=_0x30b6d4-0x19b;const _0x101714=a36_0x1017();let _0x3db587=_0x101714[_0x30b6d4];return _0x3db587;}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(_0x3a001a){const _0x1ceaa9=a36_0x3db5;for(const _0x2039d1 of _0x3a001a){definitions['set'](_0x2039d1[_0x1ceaa9(0x1b9)]+':'+_0x2039d1[_0x1ceaa9(0x1ab)],_0x2039d1);let _0x18ab26=serviceGroups['get'](_0x2039d1[_0x1ceaa9(0x1b9)]);!_0x18ab26&&(_0x18ab26=[],serviceGroups['set'](_0x2039d1[_0x1ceaa9(0x1b9)],_0x18ab26)),_0x18ab26[_0x1ceaa9(0x1bc)](_0x2039d1);}}function registerService(_0x282387,_0xbe62a,_0x2f0591){const _0x33818e=a36_0x3db5;registerDefinitions(_0xbe62a);const _0xafff6e=_0x1608f0=>_0x1608f0===_0x33818e(0x1b5)?'':_0x1608f0==='write'?_0x33818e(0x1c0):_0x33818e(0x1a9),_0x18d2d6={'service':_0xbe62a[0x0][_0x33818e(0x1b9)],'label':_0x282387,'commands':_0xbe62a[_0x33818e(0x1ba)](_0x20c1a1=>({'command':_0x20c1a1[_0x33818e(0x1ab)],'description':_0x20c1a1[_0x33818e(0x1b0)],'tag':_0xafff6e(_0x20c1a1['risk'])})),'defaultCommand':_0x2f0591?.[_0x33818e(0x1c4)]??(_0x2f0591?.[_0x33818e(0x1b2)]?_0xbe62a[0x0][_0x33818e(0x1ab)]:undefined),'isSingleCommand':_0x2f0591?.[_0x33818e(0x1b2)]};serviceRegistry[_0x33818e(0x1bc)](_0x18d2d6),serviceByName[_0x33818e(0x1a3)](_0x18d2d6[_0x33818e(0x1b9)],_0x18d2d6);}registerService(a36_0x492f2e(0x1bf),authDefinitions,{'defaultCommand':'login'}),registerService(a36_0x492f2e(0x1a2),appDefinitions,{'defaultCommand':a36_0x492f2e(0x1bd)}),registerService(a36_0x492f2e(0x19b),workspaceDefinitions),registerService(a36_0x492f2e(0x1a6),appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a36_0x492f2e(0x1bd)}),registerService(a36_0x492f2e(0x1b7),apiDocDefinitions),registerService(a36_0x492f2e(0x1a7),datasetDefinitions),registerService(a36_0x492f2e(0x1a0),dataDefinitions),registerService(a36_0x492f2e(0x1c5),sqlDefinitions),registerService(a36_0x492f2e(0x1c3),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService(a36_0x492f2e(0x1bb),artifactDefinitions),registerService(a36_0x492f2e(0x19c),fileDefinitions),registerService(a36_0x492f2e(0x19d),ocrDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x492f2e(0x1bd)}),registerService(a36_0x492f2e(0x1b8),skillDefinitions,{'defaultCommand':a36_0x492f2e(0x1c6)}),registerService(a36_0x492f2e(0x1a8),cliSkillDefinitions,{'defaultCommand':a36_0x492f2e(0x1c6)}),registerService(a36_0x492f2e(0x1aa),[updateDefinition],{'defaultCommand':a36_0x492f2e(0x1c1),'isSingleCommand':!![]}),registerService(a36_0x492f2e(0x1ac),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x492f2e(0x1af),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x492f2e(0x1b4),logsDefinitions,{'defaultCommand':a36_0x492f2e(0x1b3)});export function findDefinition(_0x71f723,_0x356654){const _0x227d3a=a36_0x492f2e;return definitions[_0x227d3a(0x1c7)](_0x71f723+':'+_0x356654);}export function isKnownService(_0x19d796){const _0x2aaca4=a36_0x492f2e;return serviceByName[_0x2aaca4(0x1a5)](_0x19d796);}export function getServiceEntry(_0xdfc193){const _0x595564=a36_0x492f2e;return serviceByName[_0x595564(0x1c7)](_0xdfc193);}export function getAllDefinitions(){const _0x417ced=a36_0x492f2e;return Array[_0x417ced(0x1b6)](definitions[_0x417ced(0x1be)]());}
@@ -1 +1 @@
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
+ const a37_0x59780a=a37_0x5174;(function(_0x308fd3,_0x2d6ff2){const _0x5776f7=a37_0x5174,_0x3d1690=_0x308fd3();while(!![]){try{const _0x42538f=-parseInt(_0x5776f7(0xe9))/0x1*(-parseInt(_0x5776f7(0xe2))/0x2)+parseInt(_0x5776f7(0xe5))/0x3*(parseInt(_0x5776f7(0xe8))/0x4)+-parseInt(_0x5776f7(0xe3))/0x5+parseInt(_0x5776f7(0xed))/0x6+parseInt(_0x5776f7(0xe1))/0x7+-parseInt(_0x5776f7(0xea))/0x8*(parseInt(_0x5776f7(0xe4))/0x9)+-parseInt(_0x5776f7(0xeb))/0xa*(-parseInt(_0x5776f7(0xe7))/0xb);if(_0x42538f===_0x2d6ff2)break;else _0x3d1690['push'](_0x3d1690['shift']());}catch(_0x43689b){_0x3d1690['push'](_0x3d1690['shift']());}}}(a37_0x2b8f,0xb1f2d));function a37_0x5174(_0x57aa0b,_0x2a325d){_0x57aa0b=_0x57aa0b-0xe1;const _0x2b8f95=a37_0x2b8f();let _0x517400=_0x2b8f95[_0x57aa0b];return _0x517400;}function a37_0x2b8f(){const _0x550504=['177594fpQkiv','6390139ZiTMkU','4UTLiXM','3743420ElqdGt','4149aKBkYA','1566339KyhULf','Export\x20machine-readable\x20command\x20schema\x20(JSON)','133034konsXE','4jQOsdC','144142zXYWuc','10864cOZsDY','290OSaYMk','schema'];a37_0x2b8f=function(){return _0x550504;};return a37_0x2b8f();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x40fc9a){const _0x38e871=await buildSchemaPayload();return{'ok':!![],'data':_0x38e871};}export const schemaDefinition={'service':a37_0x59780a(0xec),'command':'export','description':a37_0x59780a(0xe6),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
@@ -1 +1 @@
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
+ (function(_0x4e3b55,_0x4419a5){const _0x36279c=a38_0x1242,_0x855f23=_0x4e3b55();while(!![]){try{const _0x4d4339=parseInt(_0x36279c(0xa1))/0x1*(parseInt(_0x36279c(0xb8))/0x2)+-parseInt(_0x36279c(0x81))/0x3*(parseInt(_0x36279c(0xb0))/0x4)+-parseInt(_0x36279c(0x9c))/0x5*(parseInt(_0x36279c(0xc6))/0x6)+-parseInt(_0x36279c(0x83))/0x7+-parseInt(_0x36279c(0xcf))/0x8*(parseInt(_0x36279c(0xb9))/0x9)+-parseInt(_0x36279c(0x95))/0xa*(parseInt(_0x36279c(0x8c))/0xb)+-parseInt(_0x36279c(0xc2))/0xc*(-parseInt(_0x36279c(0xa8))/0xd);if(_0x4d4339===_0x4419a5)break;else _0x855f23['push'](_0x855f23['shift']());}catch(_0x7f38b){_0x855f23['push'](_0x855f23['shift']());}}}(a38_0x29e0,0x612d4));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x2fcbdc,_0x2a1948){const _0x353d56=a38_0x1242,_0x412940=listLocalServiceTrees();let _0x514132;for(const _0x1d8da1 of _0x412940){const _0x536808=matchServiceTreeCommand(_0x1d8da1,_0x2fcbdc);if(!_0x536808)continue;(!_0x514132||_0x536808[_0x353d56(0x90)]['fullPath'][_0x353d56(0xcd)]>_0x514132[_0x353d56(0x90)][_0x353d56(0xa5)][_0x353d56(0xcd)])&&(_0x514132={'tree':_0x1d8da1,'command':_0x536808[_0x353d56(0x90)],'remainingArgs':_0x536808[_0x353d56(0xaf)]});}if(!_0x514132)return undefined;const _0x21b19b={..._0x2a1948};return applyAppBinding(_0x514132[_0x353d56(0xae)],_0x514132['command'],_0x21b19b),{'definition':buildDynamicCommandDefinition(_0x514132[_0x353d56(0xae)],_0x514132[_0x353d56(0x90)]),'args':_0x514132[_0x353d56(0xaf)],'flags':_0x21b19b,'tree':_0x514132['tree'],'command':_0x514132[_0x353d56(0x90)]};}export function generateDynamicServiceHelp(_0x4fddc6){const _0x55777f=a38_0x1242,_0x2b802a=listLocalServiceTrees()[_0x55777f(0xa0)](_0x49efc6=>_0x49efc6[_0x55777f(0xbb)][_0x55777f(0xd0)]===_0x4fddc6);if(!_0x2b802a)return undefined;const _0x3ad8c5=[CLI_BIN_NAME+'\x20'+_0x4fddc6+'\x20<command>\x20[flags]','',_0x2b802a[_0x55777f(0xbb)][_0x55777f(0x8b)]||_0x4fddc6,_0x2b802a[_0x55777f(0xbb)][_0x55777f(0xa9)]?'\x20\x20'+_0x2b802a['service'][_0x55777f(0xa9)]:'','',_0x55777f(0xba),..._0x2b802a[_0x55777f(0x7c)][_0x55777f(0x89)](_0x1c4b38=>{const _0x1a3c67=_0x55777f,_0x20c376=_0x1c4b38['fullPath'][_0x1a3c67(0x94)](0x1)[_0x1a3c67(0x9e)]('\x20'),_0xf6fcf8=_0x1c4b38[_0x1a3c67(0x78)]===_0x1a3c67(0xbe)?'':'\x20['+_0x1c4b38['risk']+']';return'\x20\x20'+_0x20c376[_0x1a3c67(0xb6)](0x18)+'\x20'+(_0x1c4b38[_0x1a3c67(0xa9)]||'')+_0xf6fcf8;}),'',_0x55777f(0xc8)+CLI_BIN_NAME+_0x55777f(0x7f)+_0x4fddc6+'`\x20to\x20inspect\x20the\x20manifest.'][_0x55777f(0x82)](Boolean);return _0x3ad8c5[_0x55777f(0x9e)]('\x0a');}export function listDynamicServiceEntries(){const _0x260ba3=a38_0x1242;return listLocalServices()[_0x260ba3(0x89)](_0x280917=>{const _0x5bc750=_0x260ba3,_0x14a6ef=_0x280917['normalizedManifest'];return{'service':_0x14a6ef['service'][_0x5bc750(0xd0)],'label':_0x14a6ef[_0x5bc750(0xbb)]['name']||_0x14a6ef[_0x5bc750(0xbb)][_0x5bc750(0xd0)],'commands':_0x14a6ef[_0x5bc750(0x7c)]['map'](_0x471beb=>({'command':dynamicCommandName(_0x471beb),'description':_0x471beb[_0x5bc750(0xa9)]||_0x5bc750(0xc1)+_0x471beb[_0x5bc750(0xa3)],'tag':riskTag(_0x471beb[_0x5bc750(0x78)])}))};});}export function getDynamicServiceEntry(_0x446842){const _0x9fde29=a38_0x1242;return listDynamicServiceEntries()['find'](_0x7583ac=>_0x7583ac[_0x9fde29(0xbb)]===_0x446842);}export function listDynamicServiceDefinitions(_0x5a60f8){const _0x51b072=a38_0x1242;return listLocalServiceTrees()[_0x51b072(0x82)](_0x149890=>!_0x5a60f8||_0x149890[_0x51b072(0xbb)]['code']===_0x5a60f8)[_0x51b072(0xd3)](_0x4dd3a8=>_0x4dd3a8[_0x51b072(0x7c)][_0x51b072(0x89)](_0x109384=>buildDynamicCommandDefinition(_0x4dd3a8,_0x109384)));}export function getDynamicServiceDefinitions(_0x5cd3ed){const _0x182eca=a38_0x1242,_0x56d5cb=listDynamicServiceDefinitions(_0x5cd3ed);return _0x56d5cb[_0x182eca(0xcd)]>0x0?_0x56d5cb:undefined;}export function findDynamicServiceDefinition(_0x3e8b0e,_0x1c5e12){const _0x2977d=a38_0x1242;return listDynamicServiceDefinitions(_0x3e8b0e)[_0x2977d(0xa0)](_0x7ce8c8=>_0x7ce8c8[_0x2977d(0x90)]===_0x1c5e12);}export function buildDynamicCommandDefinition(_0x203230,_0x4db63d){const _0x3704bf=a38_0x1242;return{'service':_0x203230[_0x3704bf(0xbb)][_0x3704bf(0xd0)],'command':dynamicCommandName(_0x4db63d),'description':_0x4db63d[_0x3704bf(0xa9)]||_0x3704bf(0xc1)+_0x4db63d[_0x3704bf(0xa3)],'risk':_0x4db63d['risk'],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x4db63d[_0x3704bf(0xa7)][_0x3704bf(0x89)](_0x204f10=>({'name':_0x204f10[_0x3704bf(0x8b)],'description':_0x204f10[_0x3704bf(0xa9)]||_0x204f10['name'],'required':_0x204f10[_0x3704bf(0x98)]})),'flags':_0x4db63d[_0x3704bf(0x8f)][_0x3704bf(0x89)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x4db63d),async 'dryRun'(_0x141b0d){const _0xe42b12=_0x3704bf,_0x5c740b=await compilePlan(_0x4db63d,_0x141b0d);return{'method':_0xe42b12(0x75),'url':_0x4db63d[_0xe42b12(0xa3)],'body':{'target':targetPreview(_0x5c740b),'params':_0x5c740b[_0xe42b12(0x8d)]},'description':_0xe42b12(0xd4)+_0x4db63d[_0xe42b12(0xa3)]};},async 'execute'(_0x5af752){const _0x37a6ba=_0x3704bf,_0x3a01b0=await compilePlan(_0x4db63d,_0x5af752),_0x3ae2d3=Date['now'](),_0x40f3b6=await executePlan(_0x3a01b0,_0x4db63d,_0x5af752),_0x150e95=Date['now']()-_0x3ae2d3;return{'ok':!![],'data':{'service':_0x203230[_0x37a6ba(0xbb)],'command':_0x4db63d['cliPath'],'target':targetPreview(_0x3a01b0),'result':_0x40f3b6,'elapsed':_0x150e95},'message':_0x37a6ba(0xd5)+_0x4db63d[_0x37a6ba(0xa3)]+'\x20completed\x20in\x20'+_0x150e95+'ms'};}};}function dynamicCommandName(_0x36f42f){const _0x47ed57=a38_0x1242;return _0x36f42f[_0x47ed57(0xa5)][_0x47ed57(0x94)](0x1)[_0x47ed57(0x9e)]('\x20');}function a38_0x29e0(){const _0x11f8b4=['tableName','slice','40emBUic','employeeId','sql','required','ctx.','Unknown\x20appRef\x20\x22','validation','68770vFndje','context.','join','operator','find','505339iBtmyK','\x20\x20\x20\x20datatable:\x20','cliPath','scriptName','fullPath','enum','args','32188meUkiV','description','number','Cannot\x20resolve\x20datatable\x20\x22','data','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','tree','remainingArgs','3127468ICzFPO','\x20->\x20','type','app','\x20\x20SERVICE\x20TREE\x20TARGET','rawFlags','padEnd','\x20\x20MAP\x20TO','2qmeomA','7947aYUdGo','Commands:','service','push','appCode','read','\x20requires\x20target.sqlCode.','nickname','Run\x20service\x20command\x20','11184cMNtMX','datasetCode','userName','kind','156eymPSf','bffId','Use\x20`','mapTo','\x20\x20\x20\x20datasetCode:\x20','env','\x20\x20\x20\x20kind:\x20\x20\x20\x20','length','target','2248KPzZzn','code','appcode','datatable','flatMap','Preview\x20dynamic\x20service\x20command:\x20','Service\x20command\x20','\x20\x20\x20\x20command:\x20','SERVICE_TREE','startsWith','nickName','risk','json','appRef','default','commands','envName','tenantCode','\x20service\x20detail\x20--service\x20','\x22\x20in\x20service\x20command\x20','3ZZCteY','filter','2792391FcydNH','string','\x20\x20\x20\x20sqlCode:\x20','\x20\x20\x20\x20scriptName:\x20','trim','source','map','Unsupported\x20service\x20target\x20kind:\x20','name','1728177EIHxTU','params','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','flags','command','sqlCode','bffCode'];a38_0x29e0=function(){return _0x11f8b4;};return a38_0x29e0();}function a38_0x1242(_0x13da76,_0x14dae4){_0x13da76=_0x13da76-0x75;const _0x29e006=a38_0x29e0();let _0x12425d=_0x29e006[_0x13da76];return _0x12425d;}function riskTag(_0x2fecd1){return _0x2fecd1==='read'?'':'\x20\x20['+_0x2fecd1+']';}function flagToCommandFlag(_0xa53b0f){const _0x2fea86=a38_0x1242;return{'name':_0xa53b0f['cliName'],'type':_0xa53b0f[_0x2fea86(0xb2)]===_0x2fea86(0x79)?'string':_0xa53b0f[_0x2fea86(0xb2)],'description':_0xa53b0f['description']||_0xa53b0f[_0x2fea86(0x8b)],'required':_0xa53b0f[_0x2fea86(0x98)],'default':isPrimitiveFlagDefault(_0xa53b0f[_0x2fea86(0x7b)])?_0xa53b0f[_0x2fea86(0x7b)]:undefined,'enum':_0xa53b0f[_0x2fea86(0xa6)]};}async function compilePlan(_0x32ce38,_0x266d52){const _0x1a1b67=a38_0x1242;return compileServiceTreeCommand(_0x32ce38,{'flags':_0x266d52[_0x1a1b67(0xb5)],'args':_0x266d52[_0x1a1b67(0xa7)],'context':await buildServiceContext(_0x32ce38,_0x266d52)});}async function buildServiceContext(_0x9d22df,_0x570159){const _0x38c3cf=a38_0x1242,_0x3a3fb2={'appCode':_0x570159[_0x38c3cf(0xbd)],'env':_0x570159['envName'],'envName':_0x570159[_0x38c3cf(0x7d)]};if(!usesRuntimeContext(_0x9d22df))return _0x3a3fb2;const _0x44ee85=await getLoginUserInfo(),_0xd54e1f=pickFirst(_0x44ee85['userId'],_0x44ee85['id']);return{..._0x3a3fb2,'user':_0x44ee85,'userId':_0xd54e1f,'id':_0x44ee85['id'],'username':pickFirst(_0x44ee85['username'],_0x44ee85[_0x38c3cf(0xc4)],_0x44ee85['loginName']),'userName':_0x44ee85['userName'],'nickname':pickFirst(_0x44ee85[_0x38c3cf(0xc0)],_0x44ee85[_0x38c3cf(0x77)]),'nickName':_0x44ee85['nickName'],'tenantCode':_0x44ee85[_0x38c3cf(0x7e)],'employeeId':_0x44ee85[_0x38c3cf(0x96)]};}function usesRuntimeContext(_0xf650ac){const _0x2854dd=a38_0x1242;return _0xf650ac[_0x2854dd(0xc9)]['some'](_0x5b1cc6=>typeof _0x5b1cc6[_0x2854dd(0x88)]===_0x2854dd(0x84)&&(_0x5b1cc6[_0x2854dd(0x88)][_0x2854dd(0x76)](_0x2854dd(0x9d))||_0x5b1cc6['source'][_0x2854dd(0x76)](_0x2854dd(0x99))));}function pickFirst(..._0x29f9e0){const _0x248d7a=a38_0x1242;return _0x29f9e0[_0x248d7a(0xa0)](_0x4fbe21=>_0x4fbe21!==undefined&&_0x4fbe21!==null);}async function executePlan(_0x28db15,_0x539890,_0xe3df9e){const _0x2e02b0=a38_0x1242;if(_0x28db15[_0x2e02b0(0xc5)]===_0x2e02b0(0xac)){const _0xf6ca87=await resolveDatasetCode(_0x28db15,_0x539890,_0xe3df9e);return executeData(_0xf6ca87,_0x28db15[_0x2e02b0(0x90)],_0x28db15['params']);}if(_0x28db15['kind']===_0x2e02b0(0x97)){if(!_0x28db15[_0x2e02b0(0x91)])throw CliErrors[_0x2e02b0(0x9b)]('Service\x20command\x20'+_0x539890[_0x2e02b0(0xa3)]+_0x2e02b0(0xbf));return executeSdkSql(_0x28db15[_0x2e02b0(0x91)],normalizeScalarParams(_0x28db15['params']));}if(_0x28db15[_0x2e02b0(0xc5)]==='bff'){const _0x1b8639=_0x28db15[_0x2e02b0(0xa4)]||_0x28db15['bffCode']||(_0x28db15[_0x2e02b0(0xc7)]==null?'':String(_0x28db15['bffId']));if(!_0x1b8639)throw CliErrors[_0x2e02b0(0x9b)](_0x2e02b0(0xd5)+_0x539890[_0x2e02b0(0xa3)]+'\x20requires\x20target.scriptName.');return executeSdkBff(_0x1b8639,_0x28db15[_0x2e02b0(0x8d)]);}throw CliErrors[_0x2e02b0(0x9b)](_0x2e02b0(0x8a)+_0x28db15[_0x2e02b0(0xc5)]);}async function resolveDatasetCode(_0x53ee56,_0x1dc2f8,_0x35cff9){const _0x226c90=a38_0x1242;if(_0x53ee56[_0x226c90(0xc3)])return _0x53ee56[_0x226c90(0xc3)];if(!_0x53ee56[_0x226c90(0xd2)])throw CliErrors['validation'](_0x226c90(0xd5)+_0x1dc2f8[_0x226c90(0xa3)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x32143c=await listDatasets(_0x35cff9[_0x226c90(0xbd)]),_0x441782=_0x32143c[_0x226c90(0xa0)](_0x3568f6=>_0x3568f6['dbtableConfig']?.[_0x226c90(0x93)]===_0x53ee56['datatable']);if(!_0x441782?.['code'])throw CliErrors[_0x226c90(0x9b)](_0x226c90(0xab)+_0x53ee56[_0x226c90(0xd2)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x35cff9[_0x226c90(0xbd)]+'.',_0x226c90(0x8e));return _0x441782[_0x226c90(0xd0)];}function applyAppBinding(_0x500b97,_0x3c7a16,_0x2e67ed){const _0x3105ef=a38_0x1242,_0x130b12=_0x3c7a16['target'][_0x3105ef(0x7a)];if(!_0x130b12)return;const _0x333350=_0x500b97['appBindings'][_0x130b12];if(!_0x333350)throw CliErrors[_0x3105ef(0x9b)](_0x3105ef(0x9a)+_0x130b12+_0x3105ef(0x80)+_0x3c7a16[_0x3105ef(0xa3)]+'.',_0x3105ef(0xad));const _0x1ed2b2=_0x333350[_0x3105ef(0xd1)]||_0x333350['appCode'];_0x1ed2b2&&!hasText(_0x2e67ed[_0x3105ef(0xd1)])&&(_0x2e67ed[_0x3105ef(0xd1)]=_0x1ed2b2),_0x333350['app']&&!hasText(_0x2e67ed[_0x3105ef(0xb3)])&&!hasText(_0x2e67ed[_0x3105ef(0xd1)])&&(_0x2e67ed[_0x3105ef(0xb3)]=_0x333350[_0x3105ef(0xb3)]),_0x333350[_0x3105ef(0xcb)]&&!hasText(_0x2e67ed['env'])&&(_0x2e67ed['env']=_0x333350[_0x3105ef(0xcb)]);}function renderDynamicCommandHelp(_0x2e08be){const _0x37feb1=a38_0x1242,_0x2e1124=[_0x37feb1(0xb4),_0x37feb1(0xcc)+_0x2e08be[_0x37feb1(0xce)][_0x37feb1(0xc5)],_0x37feb1(0xd6)+_0x2e08be['target'][_0x37feb1(0x90)]];if(_0x2e08be[_0x37feb1(0xce)][_0x37feb1(0xc3)])_0x2e1124['push'](_0x37feb1(0xca)+_0x2e08be[_0x37feb1(0xce)][_0x37feb1(0xc3)]);if(_0x2e08be['target'][_0x37feb1(0xd2)])_0x2e1124[_0x37feb1(0xbc)](_0x37feb1(0xa2)+_0x2e08be[_0x37feb1(0xce)][_0x37feb1(0xd2)]);if(_0x2e08be['target'][_0x37feb1(0x91)])_0x2e1124[_0x37feb1(0xbc)](_0x37feb1(0x85)+_0x2e08be[_0x37feb1(0xce)][_0x37feb1(0x91)]);if(_0x2e08be[_0x37feb1(0xce)]['scriptName'])_0x2e1124[_0x37feb1(0xbc)](_0x37feb1(0x86)+_0x2e08be[_0x37feb1(0xce)][_0x37feb1(0xa4)]);if(_0x2e08be[_0x37feb1(0xc9)][_0x37feb1(0xcd)]>0x0){_0x2e1124[_0x37feb1(0xbc)]('',_0x37feb1(0xb7));for(const _0xc1367a of _0x2e08be[_0x37feb1(0xc9)]){_0x2e1124[_0x37feb1(0xbc)]('\x20\x20\x20\x20'+(_0xc1367a[_0x37feb1(0x88)]||'const')+_0x37feb1(0xb1)+_0xc1367a[_0x37feb1(0xce)]+(_0xc1367a[_0x37feb1(0x9f)]?'.'+_0xc1367a['operator']:''));}}return _0x2e1124[_0x37feb1(0x9e)]('\x0a');}function targetPreview(_0x37a85a){const _0x388d93=a38_0x1242;return{'kind':_0x37a85a[_0x388d93(0xc5)],'command':_0x37a85a[_0x388d93(0x90)],'appRef':_0x37a85a[_0x388d93(0x7a)],'datasetCode':_0x37a85a[_0x388d93(0xc3)],'datatable':_0x37a85a['datatable'],'sqlCode':_0x37a85a[_0x388d93(0x91)],'bffCode':_0x37a85a[_0x388d93(0x92)],'bffId':_0x37a85a[_0x388d93(0xc7)],'scriptName':_0x37a85a[_0x388d93(0xa4)]};}function normalizeScalarParams(_0xb46b47){const _0x17cfb5=a38_0x1242;return Object['fromEntries'](Object['entries'](_0xb46b47)[_0x17cfb5(0x82)](([,_0x3f33d8])=>typeof _0x3f33d8==='string'||typeof _0x3f33d8===_0x17cfb5(0xaa)));}function hasText(_0x1e02f0){const _0x5eb557=a38_0x1242;return typeof _0x1e02f0===_0x5eb557(0x84)&&_0x1e02f0[_0x5eb557(0x87)]()[_0x5eb557(0xcd)]>0x0;}function isPrimitiveFlagDefault(_0x5a0735){const _0x2008ba=a38_0x1242;return _0x5a0735===undefined||typeof _0x5a0735===_0x2008ba(0x84)||typeof _0x5a0735===_0x2008ba(0xaa)||typeof _0x5a0735==='boolean';}
@@ -1 +1 @@
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)]}};}}];
1
+ const a39_0x37ab25=a39_0x2ed0;(function(_0xda617b,_0x2cdfbf){const _0x3f9043=a39_0x2ed0,_0x13c5ff=_0xda617b();while(!![]){try{const _0x553db0=-parseInt(_0x3f9043(0x14d))/0x1*(parseInt(_0x3f9043(0x168))/0x2)+parseInt(_0x3f9043(0x18d))/0x3+-parseInt(_0x3f9043(0x147))/0x4*(-parseInt(_0x3f9043(0x145))/0x5)+-parseInt(_0x3f9043(0x15b))/0x6+parseInt(_0x3f9043(0x182))/0x7*(-parseInt(_0x3f9043(0x16d))/0x8)+-parseInt(_0x3f9043(0x15c))/0x9*(parseInt(_0x3f9043(0x175))/0xa)+-parseInt(_0x3f9043(0x188))/0xb*(-parseInt(_0x3f9043(0x17d))/0xc);if(_0x553db0===_0x2cdfbf)break;else _0x13c5ff['push'](_0x13c5ff['shift']());}catch(_0x331ac4){_0x13c5ff['push'](_0x13c5ff['shift']());}}}(a39_0x4b07,0x5c2f3));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':'file','type':a39_0x37ab25(0x171),'required':!![],'description':a39_0x37ab25(0x155)},SERVICE_FLAG={'name':a39_0x37ab25(0x170),'type':a39_0x37ab25(0x171),'required':!![],'description':a39_0x37ab25(0x14a),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x37ab25(0x16c)}};function summarizeService(_0x26f9c1){const _0xe3d269=a39_0x37ab25;return{'serviceCode':_0x26f9c1['serviceCode'],'name':_0x26f9c1[_0xe3d269(0x183)][_0xe3d269(0x170)][_0xe3d269(0x18e)],'version':_0x26f9c1['version'],'importedAt':_0x26f9c1[_0xe3d269(0x158)],'source':_0x26f9c1[_0xe3d269(0x173)],'commandCount':_0x26f9c1[_0xe3d269(0x183)]['commands'][_0xe3d269(0x179)],'commands':_0x26f9c1[_0xe3d269(0x183)][_0xe3d269(0x16e)][_0xe3d269(0x157)](_0x5be24c=>({'path':_0x5be24c['cliPath'],'description':_0x5be24c[_0xe3d269(0x160)],'risk':_0x5be24c[_0xe3d269(0x17a)],'target':_0x5be24c[_0xe3d269(0x154)],'flags':_0x5be24c['flags'][_0xe3d269(0x157)](_0x557ab1=>({'name':_0x557ab1[_0xe3d269(0x18e)],'cliName':_0x557ab1[_0xe3d269(0x15e)],'type':_0x557ab1[_0xe3d269(0x165)],'required':_0x557ab1[_0xe3d269(0x187)]===!![]}))}))};}function summarizeLoadedManifest(_0x272c1d){const _0x5a24f2=a39_0x37ab25;return{'service':_0x272c1d[_0x5a24f2(0x183)]?.[_0x5a24f2(0x170)],'version':_0x272c1d[_0x5a24f2(0x183)]?.['version'],'commandCount':_0x272c1d[_0x5a24f2(0x183)]?.[_0x5a24f2(0x16e)][_0x5a24f2(0x179)]??0x0,'commands':_0x272c1d[_0x5a24f2(0x183)]?.[_0x5a24f2(0x16e)]['map'](_0x5ce7cc=>({'path':_0x5ce7cc[_0x5a24f2(0x169)],'risk':_0x5ce7cc[_0x5a24f2(0x17a)],'target':_0x5ce7cc[_0x5a24f2(0x154)]}))??[],'registryIndex':_0x272c1d[_0x5a24f2(0x189)],'registryServiceCode':_0x272c1d['registryServiceCode'],'errors':_0x272c1d[_0x5a24f2(0x186)]['errors'],'warnings':_0x272c1d[_0x5a24f2(0x186)][_0x5a24f2(0x172)]};}export const serviceDefinitions=[{'service':a39_0x37ab25(0x170),'command':a39_0x37ab25(0x14c),'description':a39_0x37ab25(0x15a),'risk':a39_0x37ab25(0x18a),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x1e17ed){const _0x1f8bdb=a39_0x37ab25,_0xc362d0=loadServiceManifestFromFile(_0x1e17ed[_0x1f8bdb(0x178)](_0x1f8bdb(0x146)));if(!_0xc362d0[_0x1f8bdb(0x186)]['ok'])return{'ok':![],'data':{'file':_0xc362d0[_0x1f8bdb(0x164)],'hash':_0xc362d0[_0x1f8bdb(0x14f)],'kind':_0xc362d0[_0x1f8bdb(0x17b)],'serviceCount':_0xc362d0[_0x1f8bdb(0x18b)]['length'],'services':_0xc362d0[_0x1f8bdb(0x18b)]['map'](summarizeLoadedManifest),'errors':_0xc362d0[_0x1f8bdb(0x186)][_0x1f8bdb(0x159)],'warnings':_0xc362d0[_0x1f8bdb(0x186)]['warnings']},'message':formatValidationFailure(_0xc362d0['report'])};if(_0xc362d0[_0x1f8bdb(0x17b)]===_0x1f8bdb(0x185)||_0xc362d0[_0x1f8bdb(0x18b)][_0x1f8bdb(0x179)]!==0x1)return{'ok':!![],'data':{'file':_0xc362d0[_0x1f8bdb(0x164)],'hash':_0xc362d0[_0x1f8bdb(0x14f)],'kind':_0xc362d0[_0x1f8bdb(0x17b)],'serviceCount':_0xc362d0['manifests'][_0x1f8bdb(0x179)],'commandCount':_0xc362d0[_0x1f8bdb(0x18b)][_0x1f8bdb(0x16f)]((_0x2e9088,_0x57197c)=>_0x2e9088+(_0x57197c['normalizedManifest']?.[_0x1f8bdb(0x16e)][_0x1f8bdb(0x179)]??0x0),0x0),'services':_0xc362d0[_0x1f8bdb(0x18b)][_0x1f8bdb(0x157)](summarizeLoadedManifest),'warnings':_0xc362d0['report']['warnings']},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0xc362d0[_0x1f8bdb(0x164)],'hash':_0xc362d0[_0x1f8bdb(0x14f)],'kind':_0xc362d0[_0x1f8bdb(0x17b)],'service':_0xc362d0[_0x1f8bdb(0x183)]?.['service'],'version':_0xc362d0[_0x1f8bdb(0x183)]?.[_0x1f8bdb(0x15d)],'commandCount':_0xc362d0[_0x1f8bdb(0x183)]?.['commands']['length']??0x0,'commands':_0xc362d0[_0x1f8bdb(0x183)]?.[_0x1f8bdb(0x16e)][_0x1f8bdb(0x157)](_0xe5109=>({'path':_0xe5109[_0x1f8bdb(0x169)],'risk':_0xe5109[_0x1f8bdb(0x17a)],'target':_0xe5109[_0x1f8bdb(0x154)]})),'warnings':_0xc362d0[_0x1f8bdb(0x186)][_0x1f8bdb(0x172)]},'message':_0x1f8bdb(0x180)};}},{'service':a39_0x37ab25(0x170),'command':'import','description':a39_0x37ab25(0x166),'risk':a39_0x37ab25(0x153),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x32d052){const _0x4e5a10=a39_0x37ab25,_0x3fc9b6=loadServiceManifestFromFile(_0x32d052[_0x4e5a10(0x178)](_0x4e5a10(0x146)));return{'method':_0x4e5a10(0x18f),'url':getServiceRegistryPath(),'body':{'file':_0x3fc9b6[_0x4e5a10(0x164)],'hash':_0x3fc9b6[_0x4e5a10(0x14f)],'kind':_0x3fc9b6[_0x4e5a10(0x17b)],'ok':_0x3fc9b6[_0x4e5a10(0x186)]['ok'],'service':_0x3fc9b6[_0x4e5a10(0x183)]?.['service'],'version':_0x3fc9b6['normalizedManifest']?.[_0x4e5a10(0x15d)],'serviceCount':_0x3fc9b6[_0x4e5a10(0x18b)]['length'],'services':_0x3fc9b6[_0x4e5a10(0x18b)]['map'](_0x285f8c=>({'service':_0x285f8c[_0x4e5a10(0x183)]?.[_0x4e5a10(0x170)],'version':_0x285f8c[_0x4e5a10(0x183)]?.[_0x4e5a10(0x15d)],'commandCount':_0x285f8c[_0x4e5a10(0x183)]?.[_0x4e5a10(0x16e)][_0x4e5a10(0x179)]??0x0,'errors':_0x285f8c[_0x4e5a10(0x186)][_0x4e5a10(0x159)]})),'errors':_0x3fc9b6['report'][_0x4e5a10(0x159)],'commandCount':_0x3fc9b6[_0x4e5a10(0x183)]?.['commands']['length']??0x0},'description':_0x4e5a10(0x14b)};},async 'execute'(_0x2bb7bf){const _0x798640=a39_0x37ab25,_0x5838ad=importServiceManifest(_0x2bb7bf['str']('file'));if(_0x5838ad['entries'][_0x798640(0x179)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x5838ad[_0x798640(0x156)],'imported':_0x5838ad[_0x798640(0x184)],'updated':_0x5838ad['updated'],'serviceCount':_0x5838ad[_0x798640(0x174)],'services':_0x5838ad[_0x798640(0x18c)][_0x798640(0x157)](summarizeService)},'message':_0x798640(0x16a)+_0x5838ad[_0x798640(0x184)]+_0x798640(0x162)+_0x5838ad[_0x798640(0x177)]+_0x798640(0x167)};return{'ok':!![],'data':{'registryPath':_0x5838ad['registryPath'],'replaced':_0x5838ad[_0x798640(0x17e)],'imported':_0x5838ad[_0x798640(0x184)],'updated':_0x5838ad['updated'],'serviceCount':_0x5838ad[_0x798640(0x174)],'service':summarizeService(_0x5838ad[_0x798640(0x14e)])},'message':(_0x5838ad[_0x798640(0x17e)]?'Updated':_0x798640(0x17f))+'\x20service\x20'+_0x5838ad[_0x798640(0x14e)][_0x798640(0x181)]+'.'};}},{'service':a39_0x37ab25(0x170),'command':a39_0x37ab25(0x148),'description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a39_0x37ab25(0x153),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x31565f){const _0x2136df=a39_0x37ab25,_0x37830e=getLocalServiceEntry(_0x31565f[_0x2136df(0x178)](_0x2136df(0x170)));return{'method':_0x2136df(0x18f),'url':_0x31565f[_0x2136df(0x178)](_0x2136df(0x146)),'body':{'service':_0x31565f['str'](_0x2136df(0x170)),'found':Boolean(_0x37830e),'version':_0x37830e?.[_0x2136df(0x15d)],'source':_0x37830e?.[_0x2136df(0x173)]},'description':_0x2136df(0x17c)};},async 'execute'(_0x56070a){const _0x4950f5=a39_0x37ab25,_0x5686c3=exportServiceManifest(_0x56070a[_0x4950f5(0x178)](_0x4950f5(0x170)),_0x56070a[_0x4950f5(0x178)](_0x4950f5(0x146)));return{'ok':!![],'data':{'registryPath':_0x5686c3['registryPath'],'file':_0x5686c3[_0x4950f5(0x164)],'service':summarizeService(_0x5686c3['entry'])},'message':_0x4950f5(0x152)+_0x5686c3['entry'][_0x4950f5(0x181)]+'.'};}},{'service':a39_0x37ab25(0x170),'command':a39_0x37ab25(0x176),'description':a39_0x37ab25(0x163),'risk':a39_0x37ab25(0x18a),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x2be604=a39_0x37ab25,_0x452785=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x452785['length'],'services':_0x452785[_0x2be604(0x157)](summarizeService)}};}},{'service':a39_0x37ab25(0x170),'command':a39_0x37ab25(0x151),'description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0x37ab25(0x153),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x568028){const _0x2a179f=a39_0x37ab25,_0x2ba166=getLocalServiceEntry(_0x568028['str']('service'));return{'method':_0x2a179f(0x18f),'url':getServiceRegistryPath(),'body':{'service':_0x568028[_0x2a179f(0x178)]('service'),'found':Boolean(_0x2ba166),'version':_0x2ba166?.[_0x2a179f(0x15d)],'source':_0x2ba166?.[_0x2a179f(0x173)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x38c3e0){const _0x5c0f1a=a39_0x37ab25,_0x5bd51d=removeServiceManifest(_0x38c3e0[_0x5c0f1a(0x178)](_0x5c0f1a(0x170)));return{'ok':!![],'data':{'registryPath':_0x5bd51d[_0x5c0f1a(0x156)],'serviceCount':_0x5bd51d[_0x5c0f1a(0x174)],'service':summarizeService(_0x5bd51d['entry'])},'message':_0x5c0f1a(0x149)+_0x5bd51d[_0x5c0f1a(0x14e)][_0x5c0f1a(0x181)]+'.'};}},{'service':a39_0x37ab25(0x170),'command':a39_0x37ab25(0x16b),'description':a39_0x37ab25(0x161),'risk':a39_0x37ab25(0x18a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1cf3fc){const _0x453dc5=a39_0x37ab25,_0x490ecf=getLocalServiceEntry(_0x1cf3fc[_0x453dc5(0x178)](_0x453dc5(0x170)));if(!_0x490ecf)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1cf3fc[_0x453dc5(0x178)](_0x453dc5(0x170))},'message':_0x453dc5(0x15f)+_0x1cf3fc[_0x453dc5(0x178)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x490ecf),'manifest':_0x490ecf[_0x453dc5(0x150)],'normalizedManifest':_0x490ecf['normalizedManifest']}};}}];function a39_0x2ed0(_0x5a60d9,_0x485d18){_0x5a60d9=_0x5a60d9-0x145;const _0x4b0794=a39_0x4b07();let _0x2ed073=_0x4b0794[_0x5a60d9];return _0x2ed073;}function a39_0x4b07(){const _0x2630ae=['serviceCount','10mBoveQ','list','updated','str','length','risk','kind','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','9899376mXPxYW','replaced','Imported','Service\x20manifest\x20validation\x20passed.','serviceCode','7GFSqiR','normalizedManifest','imported','registry','report','required','22SNZxPa','registryIndex','read','manifests','entries','1182405kREwKK','name','WRITE','186005nZiAdY','file','28qTWCSU','export','Removed\x20service\x20','Local\x20service\x20code,\x20for\x20example\x20crm','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','validate','59EAvyoy','entry','hash','manifest','remove','Exported\x20service\x20','write','target','Service\x20Tree\x20manifest\x20file\x20path','registryPath','map','importedAt','errors','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','2826900NvetHb','5498622hIFQlm','version','cliName','Local\x20service\x20not\x20found:\x20','description','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','\x20service(s),\x20updated\x20','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','filePath','type','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','\x20service(s).','22486FxudAm','cliPath','Imported\x20','detail','lower\x20kebab-case\x20service\x20code','1451248FoHOIT','commands','reduce','service','string','warnings','source'];a39_0x4b07=function(){return _0x2630ae;};return a39_0x4b07();}