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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/app-config/shared.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/ocr/index.js +1 -1
  36. package/lib/commands/personal-bff/index.js +1 -1
  37. package/lib/commands/registry.js +1 -1
  38. package/lib/commands/schema.js +1 -1
  39. package/lib/commands/service/dynamic.js +1 -1
  40. package/lib/commands/service/index.js +1 -1
  41. package/lib/commands/service/registry.js +1 -1
  42. package/lib/commands/skill/commands/create.js +1 -1
  43. package/lib/commands/skill/commands/install.js +1 -1
  44. package/lib/commands/skill/commands/list.js +1 -1
  45. package/lib/commands/skill/commands/push.js +1 -1
  46. package/lib/commands/skill/commands/validate.js +1 -1
  47. package/lib/commands/skill/flags.js +1 -1
  48. package/lib/commands/skill/index.js +1 -1
  49. package/lib/commands/skill/manifest-helpers.js +1 -1
  50. package/lib/commands/skill/push-execute.js +1 -1
  51. package/lib/commands/skill/push-flow-helpers.js +1 -1
  52. package/lib/commands/skill/push-retarget.js +1 -1
  53. package/lib/commands/skill/scopes.js +1 -1
  54. package/lib/commands/skill/summary.js +1 -1
  55. package/lib/commands/skill/templates.js +1 -1
  56. package/lib/commands/skill/validate.js +1 -1
  57. package/lib/commands/sql/detail.js +1 -1
  58. package/lib/commands/sql/exec.js +1 -1
  59. package/lib/commands/sql/index.js +1 -1
  60. package/lib/commands/update.js +1 -1
  61. package/lib/commands/workspace/index.js +1 -1
  62. package/lib/config/schema.js +1 -1
  63. package/lib/constant/app.js +1 -1
  64. package/lib/constant/auth-mode.js +1 -1
  65. package/lib/constant/cli.js +1 -1
  66. package/lib/constant/defaults.js +1 -1
  67. package/lib/constant/distribution.js +1 -1
  68. package/lib/constant/domain.js +1 -1
  69. package/lib/constant/env.js +1 -1
  70. package/lib/constant/output.js +1 -1
  71. package/lib/constant/product.js +1 -1
  72. package/lib/constant/risk.js +1 -1
  73. package/lib/constant/url.js +1 -1
  74. package/lib/context.js +1 -1
  75. package/lib/core/api-client.js +1 -1
  76. package/lib/core/db-resolver.js +1 -1
  77. package/lib/core/sdk-client.js +1 -1
  78. package/lib/errors.js +1 -1
  79. package/lib/framework/build-all-flags.js +1 -1
  80. package/lib/framework/dryrun.js +1 -1
  81. package/lib/framework/flags.js +1 -1
  82. package/lib/framework/help.js +1 -1
  83. package/lib/framework/index.js +1 -1
  84. package/lib/framework/output.js +1 -1
  85. package/lib/framework/preparse.js +1 -1
  86. package/lib/framework/response.js +1 -1
  87. package/lib/framework/runner-confirmation.js +1 -1
  88. package/lib/framework/runner-error.js +1 -1
  89. package/lib/framework/runner.js +1 -1
  90. package/lib/framework/schema-export.js +1 -1
  91. package/lib/framework/service-order.js +1 -1
  92. package/lib/framework/types.js +1 -1
  93. package/lib/generated/build-info.js +1 -1
  94. package/lib/help.js +1 -1
  95. package/lib/skills/npx-skills-add.js +1 -1
  96. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  97. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  98. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  99. package/lib/skills/runtime-skill-sync/links.js +1 -1
  100. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  101. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  102. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  103. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  104. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  105. package/lib/skills/runtime-skill-sync/push.js +1 -1
  106. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  107. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  108. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  109. package/lib/skills/runtime-skill-sync.js +1 -1
  110. package/lib/utils/apply-jq-filter.js +1 -1
  111. package/lib/utils/logger.js +1 -1
  112. package/lib/utils/params.js +1 -1
  113. package/lib/utils/platform.js +1 -1
  114. package/lib/utils/update-notice.js +1 -1
  115. package/lib/utils/version.js +1 -1
  116. package/lib/utils/write-cli-side-channel.js +1 -1
  117. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x32fca7=a30_0x2eb6;(function(_0x29c144,_0xe6f8a1){const _0x351531=a30_0x2eb6,_0x557568=_0x29c144();while(!![]){try{const _0x36f179=parseInt(_0x351531(0x1d0))/0x1*(-parseInt(_0x351531(0x1dc))/0x2)+parseInt(_0x351531(0x1ce))/0x3*(-parseInt(_0x351531(0x1cd))/0x4)+-parseInt(_0x351531(0x1cb))/0x5*(-parseInt(_0x351531(0x1f2))/0x6)+-parseInt(_0x351531(0x1dd))/0x7*(parseInt(_0x351531(0x1ef))/0x8)+parseInt(_0x351531(0x1cc))/0x9*(-parseInt(_0x351531(0x1df))/0xa)+parseInt(_0x351531(0x1d2))/0xb*(-parseInt(_0x351531(0x1f3))/0xc)+-parseInt(_0x351531(0x1ec))/0xd*(-parseInt(_0x351531(0x1f6))/0xe);if(_0x36f179===_0xe6f8a1)break;else _0x557568['push'](_0x557568['shift']());}catch(_0x1758e2){_0x557568['push'](_0x557568['shift']());}}}(a30_0x12b6,0xe00ba));function a30_0x12b6(){const _0x2d03c6=['File','Runtime\x20filePath\x20returned\x20by\x20file\x20upload','filePath','str','trim','55133IJRMOV','appCode','filePath\x20is\x20required.','8cMFLqP','read','build','651342FQQMNi','8964xtXwPX','Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','description','13454zjRfrJ','validation','35gBqwEq','543069ohOdKf','19220WuzxwP','3nzpqyE','path','1109fLRBZP','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported','2805WoFxZz','boolean','string','Preview:\x20upload\x20','Uploaded\x20file:\x20','write','Uploaded\x20file.','bool','\x20to\x20runtime\x20app\x20','query-url','840IKdbVD','10547957JrZvRU','/client/uploadFile','290ITXFQB','file','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','upload','body','POST','download','Path\x20to\x20the\x20local\x20file\x20to\x20upload'];a30_0x12b6=function(){return _0x2d03c6;};return a30_0x12b6();}import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':'file','type':'string','required':!![],'description':a30_0x32fca7(0x1e6)},FILEPATH_FLAG={'name':'filepath','type':a30_0x32fca7(0x1d4),'required':!![],'description':a30_0x32fca7(0x1e8)},DOWNLOAD_FLAG={'name':a30_0x32fca7(0x1e5),'type':a30_0x32fca7(0x1d3),'description':a30_0x32fca7(0x1d1)};function a30_0x2eb6(_0x58b262,_0x1a23ac){_0x58b262=_0x58b262-0x1cb;const _0x12b61f=a30_0x12b6();let _0x2eb681=_0x12b61f[_0x58b262];return _0x2eb681;}function requireFilePath(_0x114eee){const _0x47b84f=a30_0x32fca7,_0xfdc80c=_0x114eee[_0x47b84f(0x1eb)]();if(!_0xfdc80c)throw CliErrors[_0x47b84f(0x1f7)](_0x47b84f(0x1ee));return _0xfdc80c;}const fileUpload={'service':'file','command':a30_0x32fca7(0x1e2),'description':a30_0x32fca7(0x1f4),'risk':a30_0x32fca7(0x1d7),'flags':[FILE_FLAG],async 'dryRun'(_0x35c831){const _0xdad04=a30_0x32fca7,_0x195535=requireRuntimeUploadFile(_0x35c831[_0xdad04(0x1ea)]('file'),_0xdad04(0x1e7));return dryRun(_0xdad04(0x1e4),_0xdad04(0x1de))[_0xdad04(0x1e3)]({'appCode':_0x35c831[_0xdad04(0x1ed)],'multipart':{'file':_0x195535}})[_0xdad04(0x1f5)](_0xdad04(0x1d5)+_0x195535[_0xdad04(0x1cf)]+_0xdad04(0x1da)+_0x35c831[_0xdad04(0x1ed)])[_0xdad04(0x1f1)]();},async 'execute'(_0x156cb8){const _0x3382d0=a30_0x32fca7,_0x4479f5=requireRuntimeUploadFile(_0x156cb8[_0x3382d0(0x1ea)](_0x3382d0(0x1e0)),'File'),_0x4d8db2=await uploadRuntimeFile(_0x156cb8['appCode'],_0x4479f5['path']);return{'ok':!![],'data':_0x4d8db2,'message':_0x4d8db2['filePath']?_0x3382d0(0x1d6)+_0x4d8db2[_0x3382d0(0x1e9)]:_0x3382d0(0x1d8)};}},fileQueryUrl={'service':'file','command':a30_0x32fca7(0x1db),'description':a30_0x32fca7(0x1e1),'risk':a30_0x32fca7(0x1f0),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x56ec2b){const _0x101be3=a30_0x32fca7,_0x3d3f29=requireFilePath(_0x56ec2b[_0x101be3(0x1ea)]('filepath')),_0xeb4d0b=await queryRuntimeFileUrl(_0x3d3f29,{'download':_0x56ec2b[_0x101be3(0x1d9)]('download')});return{'ok':!![],'data':_0xeb4d0b};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
1
+ const a30_0x2639da=a30_0x328a;(function(_0x330468,_0xcadbe2){const _0x45df02=a30_0x328a,_0x324d25=_0x330468();while(!![]){try{const _0x4edc0b=-parseInt(_0x45df02(0x102))/0x1*(-parseInt(_0x45df02(0x110))/0x2)+-parseInt(_0x45df02(0xf2))/0x3+parseInt(_0x45df02(0x105))/0x4*(-parseInt(_0x45df02(0x10f))/0x5)+-parseInt(_0x45df02(0x107))/0x6*(parseInt(_0x45df02(0xfb))/0x7)+parseInt(_0x45df02(0xf5))/0x8*(-parseInt(_0x45df02(0xef))/0x9)+-parseInt(_0x45df02(0x10c))/0xa+parseInt(_0x45df02(0xf0))/0xb;if(_0x4edc0b===_0xcadbe2)break;else _0x324d25['push'](_0x324d25['shift']());}catch(_0x4db4fe){_0x324d25['push'](_0x324d25['shift']());}}}(a30_0x2d57,0x7001e));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a30_0x328a(_0x27ec60,_0x314cc9){_0x27ec60=_0x27ec60-0xef;const _0x2d5734=a30_0x2d57();let _0x328a9e=_0x2d5734[_0x27ec60];return _0x328a9e;}import{dryRun}from'../../framework/dryrun.js';function a30_0x2d57(){const _0x4430d7=['\x20to\x20runtime\x20app\x20','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported','appCode','8330730udHgVT','File','upload','313055NaRFAX','8YRuHud','Preview:\x20upload\x20','bool','boolean','Path\x20to\x20the\x20local\x20file\x20to\x20upload','9KiXNuW','29232412rDRUQC','Uploaded\x20file.','254199OsYWai','query-url','str','3832328bNfSvy','filePath\x20is\x20required.','download','Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','path','Runtime\x20filePath\x20returned\x20by\x20file\x20upload','7014HctVdv','/client/uploadFile','filePath','file','string','description','POST','50636zfueOA','validation','build','28urBRgg','trim','3390wdKErl','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file'];a30_0x2d57=function(){return _0x4430d7;};return a30_0x2d57();}const FILE_FLAG={'name':a30_0x2639da(0xfe),'type':a30_0x2639da(0xff),'required':!![],'description':a30_0x2639da(0x114)},FILEPATH_FLAG={'name':'filepath','type':'string','required':!![],'description':a30_0x2639da(0xfa)},DOWNLOAD_FLAG={'name':'download','type':a30_0x2639da(0x113),'description':a30_0x2639da(0x10a)};function requireFilePath(_0x5c585a){const _0x4eb14b=a30_0x2639da,_0x572bb4=_0x5c585a[_0x4eb14b(0x106)]();if(!_0x572bb4)throw CliErrors[_0x4eb14b(0x103)](_0x4eb14b(0xf6));return _0x572bb4;}const fileUpload={'service':a30_0x2639da(0xfe),'command':a30_0x2639da(0x10e),'description':a30_0x2639da(0xf8),'risk':'write','flags':[FILE_FLAG],async 'dryRun'(_0x730e47){const _0x5367f6=a30_0x2639da,_0x18bbce=requireRuntimeUploadFile(_0x730e47[_0x5367f6(0xf4)](_0x5367f6(0xfe)),'File');return dryRun(_0x5367f6(0x101),_0x5367f6(0xfc))['body']({'appCode':_0x730e47[_0x5367f6(0x10b)],'multipart':{'file':_0x18bbce}})[_0x5367f6(0x100)](_0x5367f6(0x111)+_0x18bbce['path']+_0x5367f6(0x109)+_0x730e47[_0x5367f6(0x10b)])[_0x5367f6(0x104)]();},async 'execute'(_0x42aa78){const _0x39ae21=a30_0x2639da,_0x3eaf5e=requireRuntimeUploadFile(_0x42aa78[_0x39ae21(0xf4)]('file'),_0x39ae21(0x10d)),_0x5ee1b1=await uploadRuntimeFile(_0x42aa78[_0x39ae21(0x10b)],_0x3eaf5e[_0x39ae21(0xf9)]);return{'ok':!![],'data':_0x5ee1b1,'message':_0x5ee1b1[_0x39ae21(0xfd)]?'Uploaded\x20file:\x20'+_0x5ee1b1['filePath']:_0x39ae21(0xf1)};}},fileQueryUrl={'service':a30_0x2639da(0xfe),'command':a30_0x2639da(0xf3),'description':a30_0x2639da(0x108),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x68f09d){const _0x2970f4=a30_0x2639da,_0x21b91d=requireFilePath(_0x68f09d['str']('filepath')),_0x1d09f0=await queryRuntimeFileUrl(_0x21b91d,{'download':_0x68f09d[_0x2970f4(0x112)](_0x2970f4(0xf7))});return{'ok':!![],'data':_0x1d09f0};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
@@ -1 +1 @@
1
- const a31_0x1142f5=a31_0x3cfe;(function(_0x533623,_0x2201c1){const _0xe3b47c=a31_0x3cfe,_0x27843e=_0x533623();while(!![]){try{const _0x2e48b1=-parseInt(_0xe3b47c(0x1d1))/0x1+-parseInt(_0xe3b47c(0x19e))/0x2*(-parseInt(_0xe3b47c(0x195))/0x3)+parseInt(_0xe3b47c(0x1bc))/0x4*(parseInt(_0xe3b47c(0x18b))/0x5)+parseInt(_0xe3b47c(0x1b3))/0x6+parseInt(_0xe3b47c(0x1c0))/0x7*(-parseInt(_0xe3b47c(0x1c9))/0x8)+-parseInt(_0xe3b47c(0x1cc))/0x9*(-parseInt(_0xe3b47c(0x1c3))/0xa)+-parseInt(_0xe3b47c(0x1a3))/0xb*(-parseInt(_0xe3b47c(0x1a6))/0xc);if(_0x2e48b1===_0x2201c1)break;else _0x27843e['push'](_0x27843e['shift']());}catch(_0x35aba3){_0x27843e['push'](_0x27843e['shift']());}}}(a31_0x5394,0xda0ba));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_0x1142f5(0x1b2),'type':a31_0x1142f5(0x1b5),'description':a31_0x1142f5(0x197)},{'name':a31_0x1142f5(0x1a5),'type':a31_0x1142f5(0x1b5),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a31_0x1142f5(0x1a5)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1142f5(0x1d2),'type':'boolean','description':a31_0x1142f5(0x1bf)+PRODUCT_CONFIG['newConfigFileName']+a31_0x1142f5(0x1c4),'default':![]},{'name':a31_0x1142f5(0x1cb),'type':a31_0x1142f5(0x1b0),'description':a31_0x1142f5(0x1bd),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a31_0x1142f5(0x1b5),'description':a31_0x1142f5(0x19d),'required':!![]},{'name':'appcode','type':a31_0x1142f5(0x1b5),'description':a31_0x1142f5(0x191)},{'name':a31_0x1142f5(0x1a5),'type':a31_0x1142f5(0x1b5),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1142f5(0x1d2),'type':'boolean','description':a31_0x1142f5(0x1bf)+PRODUCT_CONFIG[a31_0x1142f5(0x1b7)]+a31_0x1142f5(0x1c4),'default':![]},{'name':a31_0x1142f5(0x1cb),'type':'boolean','description':a31_0x1142f5(0x1bd),'default':![]}];export async function runInit(_0x370fbd){const _0x231dd6=a31_0x1142f5,_0xfc50ed=isNonInteractiveMode(_0x370fbd),_0x438f41=_0x370fbd[_0x231dd6(0x1d2)]?_0x231dd6(0x1d2):_0x231dd6(0x1a9),_0x1a4972=resolveWriteConfigPath(_0x438f41);try{_0xfc50ed?await runNonInteractive(_0x370fbd,_0x1a4972):await runInteractive(_0x370fbd,_0x1a4972);}catch(_0xd68c){if(_0xd68c instanceof AbortPrompt)throw CliErrors[_0x231dd6(0x1ae)]();throw _0xd68c;}}function a31_0x3cfe(_0x3681b6,_0x2c916c){_0x3681b6=_0x3681b6-0x18b;const _0x539426=a31_0x5394();let _0x3cfe77=_0x539426[_0x3681b6];return _0x3cfe77;}export async function runInitImport(_0x4da698){const _0xbc8f09=a31_0x1142f5,_0x5d4892=_0x4da698[_0xbc8f09(0x1d2)]?_0xbc8f09(0x1d2):_0xbc8f09(0x1a9),_0x492fef=resolveWriteConfigPath(_0x5d4892);await runFromImport(_0x4da698,_0x492fef);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x57f07b,_0x2b8f74){const _0x5ca36a=a31_0x1142f5,_0x11195b=resolveFilePath(_0x57f07b['file']);if(!existsSync(_0x11195b))throw CliErrors[_0x5ca36a(0x193)]('Source\x20file\x20not\x20found:\x20'+_0x11195b);const _0x17eaad=readSourceFile(_0x11195b),_0x5112f1=convertToRuntimeConfig(_0x17eaad);_0x57f07b[_0x5ca36a(0x1b2)]&&(_0x5112f1[_0x5ca36a(0x1b2)]=String(_0x57f07b[_0x5ca36a(0x1b2)]));_0x57f07b[_0x5ca36a(0x1a5)]&&(_0x5112f1[_0x5ca36a(0x1a5)]=resolveInitEnv(_0x57f07b));if(!_0x5112f1[_0x5ca36a(0x1b2)])throw CliErrors[_0x5ca36a(0x193)](_0x5ca36a(0x1aa),_0x5ca36a(0x192));await writeInitConfig(_0x2b8f74,_0x5112f1,_0x57f07b),console['log'](_0x5ca36a(0x1af)+_0x11195b),console[_0x5ca36a(0x1c1)](_0x5ca36a(0x18c)+_0x2b8f74),console[_0x5ca36a(0x1c1)](_0x5ca36a(0x19f)+_0x5112f1['appcode']);if(_0x5112f1[_0x5ca36a(0x1b4)])console[_0x5ca36a(0x1c1)](_0x5ca36a(0x1ba)+_0x5112f1[_0x5ca36a(0x1b4)]);}function a31_0x5394(){const _0x270919=['stdout','[y/N]','project','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','cwd','toLowerCase','message','cancelled','Imported\x20from\x20','boolean','App\x20code\x20cannot\x20be\x20empty.','appcode','9843054Qvsixb','defaultApp','string','\x20init\x20—\x20Create\x20','newConfigFileName','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Invalid\x20env\x20\x22','\x20\x20default:\x20','[Y/n]','1666292SmDcqo','Skip\x20confirmation\x20when\x20overwriting','AbortPrompt','Write\x20to\x20global\x20(~/','1911JoIWqm','log','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','240EeYzlf',')\x20instead\x20of\x20project','utf8','Failed\x20to\x20parse\x20source\x20file:\x20','entries','once','13960hiqSUo','removeListener','yes','23337Jkgqbj','riskLevel','close','stdin','\x20\x20env:\x20\x20\x20\x20\x20','1459024cEEUXj','global','10xcjewE','\x20\x20config:\x20\x20','\x0aInitialized\x20','race','Aborted.','trim','Override\x20imported\x20default\x20appcode','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','validation','app','237bosxTM','includes','App\x20code\x20for\x20the\x20project','question','apps','object','Initialized\x20','SIGINT','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','822WGMqaI','\x20\x20appcode:\x20','):\x20','name','User\x20aborted\x20prompt','11odKTWu','App\x20code','env','3122004EnsMzP'];a31_0x5394=function(){return _0x270919;};return a31_0x5394();}function convertToRuntimeConfig(_0x55039b){const _0x3a8b1c=a31_0x1142f5;if(_0x55039b[_0x3a8b1c(0x199)]&&typeof _0x55039b['apps']===_0x3a8b1c(0x19a))throw CliErrors[_0x3a8b1c(0x193)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x3a8b1c(0x1c2));const _0x5256c8={};for(const _0x4e616c of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x55039b[_0x4e616c]!==undefined&&(_0x5256c8[_0x4e616c]=_0x55039b[_0x4e616c]);}return!_0x5256c8['riskLevel']&&(_0x5256c8[_0x3a8b1c(0x1cd)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x5256c8;}async function runNonInteractive(_0x4d3387,_0x1a4287){const _0x2e65a1=a31_0x1142f5,_0x1d549f=_0x4d3387[_0x2e65a1(0x1b2)];if(!_0x1d549f)throw CliErrors['flagMissing'](_0x2e65a1(0x1b2),'Usage:\x20'+CLI_BIN_NAME+_0x2e65a1(0x1b8));const _0x2755a6=resolveInitEnv(_0x4d3387);await writeInitConfig(_0x1a4287,{'appcode':_0x1d549f,'env':_0x2755a6},_0x4d3387),console[_0x2e65a1(0x1c1)](_0x2e65a1(0x19b)+_0x1a4287),console['log']('\x20\x20appcode:\x20'+_0x1d549f),console[_0x2e65a1(0x1c1)](_0x2e65a1(0x1d0)+_0x2755a6);}async function runInteractive(_0x257983,_0x5c9846){const _0x3f96bf=a31_0x1142f5,_0x1b525d=loadExisting(_0x5c9846),_0x26f57e=typeof _0x1b525d?.[_0x3f96bf(0x1b2)]===_0x3f96bf(0x1b5)?_0x1b525d['appcode']:'',_0x36f797=resolveInitEnv(_0x257983);console[_0x3f96bf(0x1c1)](CLI_BIN_NAME+_0x3f96bf(0x1b6)+PRODUCT_CONFIG[_0x3f96bf(0x1b7)]+'\x0a');if(existsSync(_0x5c9846)&&!_0x257983['yes']){const _0x1276e7=await promptYesNo('File\x20'+_0x5c9846+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x1276e7){console['log'](_0x3f96bf(0x18f));return;}}const _0x104251=typeof _0x257983[_0x3f96bf(0x1b2)]===_0x3f96bf(0x1b5)?_0x257983[_0x3f96bf(0x1b2)][_0x3f96bf(0x190)]():'';let _0x30cc24=_0x104251;!_0x30cc24&&(_0x30cc24=await promptInput(_0x3f96bf(0x1a4),_0x26f57e));if(!_0x30cc24[_0x3f96bf(0x190)]())throw CliErrors[_0x3f96bf(0x193)](_0x3f96bf(0x1b1));await writeInitConfig(_0x5c9846,{'appcode':_0x30cc24[_0x3f96bf(0x190)](),'env':_0x36f797},_0x257983),console[_0x3f96bf(0x1c1)](_0x3f96bf(0x18d)+_0x5c9846),console[_0x3f96bf(0x1c1)]('\x20\x20appcode:\x20'+_0x30cc24['trim']()),console[_0x3f96bf(0x1c1)](_0x3f96bf(0x1d0)+_0x36f797);}async function writeInitConfig(_0x5a9c61,_0x3d8b8d,_0x3714aa){const _0x51fb9e=a31_0x1142f5;let _0xbad8df={};existsSync(_0x5a9c61)&&!_0x3714aa['yes']&&(_0xbad8df=readConfigFile(_0x5a9c61));for(const [_0x266c77,_0x22643f]of Object[_0x51fb9e(0x1c7)](_0x3d8b8d)){_0x22643f!==undefined&&(_0xbad8df[_0x266c77]=_0x22643f);}if(_0xbad8df[_0x51fb9e(0x194)])delete _0xbad8df[_0x51fb9e(0x194)];writeConfigFile(_0x5a9c61,_0xbad8df);}class AbortPrompt extends Error{constructor(){const _0xfbb5b6=a31_0x1142f5;super(_0xfbb5b6(0x1a2)),this[_0xfbb5b6(0x1a1)]=_0xfbb5b6(0x1be);}}function createSafeRl(){const _0x223cec=a31_0x1142f5,_0x28dcf5=createInterface({'input':process[_0x223cec(0x1cf)],'output':process[_0x223cec(0x1a7)]});let _0xed93c9;const _0x4eaab6=new Promise((_0x21230e,_0x5ef0db)=>{const _0x3e08d1=_0x223cec;_0xed93c9=()=>{const _0x283b4f=a31_0x3cfe;_0xed93c9&&(_0x28dcf5[_0x283b4f(0x1ca)](_0x283b4f(0x19c),_0xed93c9),_0xed93c9=undefined);try{_0x28dcf5['close']();}catch{}_0x5ef0db(new AbortPrompt());},_0x28dcf5[_0x3e08d1(0x1c8)]('SIGINT',_0xed93c9);}),_0x255486=()=>{const _0x30abce=_0x223cec;_0xed93c9&&(_0x28dcf5[_0x30abce(0x1ca)](_0x30abce(0x19c),_0xed93c9),_0xed93c9=undefined);try{_0x28dcf5[_0x30abce(0x1ce)]();}catch{}};return{'rl':_0x28dcf5,'abortPromise':_0x4eaab6,'disposeSuccess':_0x255486};}async function promptInput(_0x256be3,_0x1d0b39){const {rl:_0x36218c,abortPromise:_0x41f220,disposeSuccess:_0x5b16ba}=createSafeRl(),_0xa29be4=new Promise(_0x1af367=>{const _0x52edc1=a31_0x3cfe,_0x2e64ee=_0x1d0b39?'\x20\x20'+_0x256be3+'\x20('+_0x1d0b39+_0x52edc1(0x1a0):'\x20\x20'+_0x256be3+':\x20';_0x36218c[_0x52edc1(0x198)](_0x2e64ee,_0x1610b6=>{const _0x22b422=_0x52edc1;_0x5b16ba(),_0x1af367(_0x1610b6[_0x22b422(0x190)]()||_0x1d0b39);});});return Promise['race']([_0xa29be4,_0x41f220]);}async function promptYesNo(_0x1f59bb,_0x29c948){const _0x4aec73=a31_0x1142f5,{rl:_0x51c4b3,abortPromise:_0x1584f9,disposeSuccess:_0x145c90}=createSafeRl(),_0x59cf86=new Promise(_0x59ebab=>{const _0x2622db=a31_0x3cfe,_0x40a9b8=_0x29c948?_0x2622db(0x1bb):_0x2622db(0x1a8);_0x51c4b3[_0x2622db(0x198)]('\x20\x20'+_0x1f59bb+'\x20'+_0x40a9b8+':\x20',_0x33f46d=>{const _0x1a1124=_0x2622db;_0x145c90();const _0x36b301=_0x33f46d[_0x1a1124(0x190)]()[_0x1a1124(0x1ac)]();if(_0x36b301==='y'||_0x36b301===_0x1a1124(0x1cb))_0x59ebab(!![]);else{if(_0x36b301==='n'||_0x36b301==='no')_0x59ebab(![]);else _0x59ebab(_0x29c948);}});});return Promise[_0x4aec73(0x18e)]([_0x59cf86,_0x1584f9]);}function loadExisting(_0x1ada15){if(!existsSync(_0x1ada15))return null;return readConfigFile(_0x1ada15);}function resolveFilePath(_0x333174){const _0x4b7604=a31_0x1142f5;return isAbsolute(_0x333174)?_0x333174:resolve(process[_0x4b7604(0x1ab)](),_0x333174);}function readSourceFile(_0x3a39b5){const _0x222b90=a31_0x1142f5;try{const _0x538553=readFileSync(_0x3a39b5,{'encoding':_0x222b90(0x1c5)});return JSON['parse'](_0x538553);}catch(_0x1ee26b){throw CliErrors['validation'](_0x222b90(0x1c6)+_0x1ee26b[_0x222b90(0x1ad)]);}}function resolveInitEnv(_0x5a8465){const _0x809807=a31_0x1142f5,_0x503e85=_0x5a8465[_0x809807(0x1a5)];if(_0x503e85===undefined||_0x503e85==='')return DEFAULT_CONFIG_VALUES[_0x809807(0x1a5)];if(!RUNTIME_ENV_VALUES[_0x809807(0x196)](_0x503e85))throw CliErrors[_0x809807(0x193)](_0x809807(0x1b9)+_0x503e85+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x503e85;}
1
+ const a31_0x1cff7d=a31_0x42ac;(function(_0x1df5f8,_0x525912){const _0x1af7d4=a31_0x42ac,_0x30fc86=_0x1df5f8();while(!![]){try{const _0x2736eb=-parseInt(_0x1af7d4(0x8a))/0x1*(-parseInt(_0x1af7d4(0xab))/0x2)+-parseInt(_0x1af7d4(0x91))/0x3*(parseInt(_0x1af7d4(0xa2))/0x4)+-parseInt(_0x1af7d4(0x83))/0x5*(-parseInt(_0x1af7d4(0x99))/0x6)+-parseInt(_0x1af7d4(0xb7))/0x7*(parseInt(_0x1af7d4(0xc4))/0x8)+-parseInt(_0x1af7d4(0xbe))/0x9+parseInt(_0x1af7d4(0x90))/0xa+parseInt(_0x1af7d4(0xb4))/0xb*(parseInt(_0x1af7d4(0x8c))/0xc);if(_0x2736eb===_0x525912)break;else _0x30fc86['push'](_0x30fc86['shift']());}catch(_0x4d478c){_0x30fc86['push'](_0x30fc86['shift']());}}}(a31_0x4080,0xd7390));import{existsSync,readFileSync}from'node:fs';function a31_0x4080(){const _0x48f01a=['\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','77668qJYCXG','Target\x20environment\x20(default\x20','Failed\x20to\x20parse\x20source\x20file:\x20','Usage:\x20','app','boolean','File\x20','\x20already\x20exists.\x20Overwrite?','once','44UcavfB','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','utf8','602679zkZLlT','newConfigFileName','string','cwd','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','global','name','7252731XBeIQZ','\x22.\x20Allowed:\x20','\x0aInitialized\x20','\x20\x20env:\x20\x20\x20\x20\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','trim','104qXjlhi','Override\x20imported\x20default\x20env','message','App\x20code\x20cannot\x20be\x20empty.','log',')\x20instead\x20of\x20project','project','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','Override\x20imported\x20default\x20appcode','Initialized\x20','appcode','\x20init\x20—\x20Create\x20','2871865EYoLRi','[y/N]','AbortPrompt','Imported\x20from\x20','removeListener','User\x20aborted\x20prompt','file','17LivGPU','apps','653316FKaXGD','Write\x20to\x20global\x20(~/','validation','question','16140620PRmRtG','3WAWbjn','App\x20code','\x20\x20config:\x20\x20','stdout','riskLevel','\x20\x20default:\x20','App\x20code\x20for\x20the\x20project','object','6ZLMVTq','yes','SIGINT','\x20\x20appcode:\x20','defaultApp','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','apiDir','[Y/n]','Skip\x20confirmation\x20when\x20overwriting','1038852mRtfBB','):\x20','race','join','close','toLowerCase','env','stdin'];a31_0x4080=function(){return _0x48f01a;};return a31_0x4080();}import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':'string','description':a31_0x1cff7d(0x97)},{'name':a31_0x1cff7d(0xa8),'type':a31_0x1cff7d(0xb9),'description':a31_0x1cff7d(0xac)+DEFAULT_CONFIG_VALUES[a31_0x1cff7d(0xa8)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0x8d)+PRODUCT_CONFIG[a31_0x1cff7d(0xb8)]+a31_0x1cff7d(0xc9),'default':![]},{'name':a31_0x1cff7d(0x9a),'type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0xa1),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x1cff7d(0x89),'type':'string','description':a31_0x1cff7d(0x9e),'required':!![]},{'name':a31_0x1cff7d(0x81),'type':a31_0x1cff7d(0xb9),'description':a31_0x1cff7d(0x7f)},{'name':'env','type':'string','description':a31_0x1cff7d(0xc5),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1cff7d(0xbc),'type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0x8d)+PRODUCT_CONFIG[a31_0x1cff7d(0xb8)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0xa1),'default':![]}];export async function runInit(_0x2df9d2){const _0x972ecb=a31_0x1cff7d,_0x3c8b44=isNonInteractiveMode(_0x2df9d2),_0x13284c=_0x2df9d2[_0x972ecb(0xbc)]?'global':_0x972ecb(0x7d),_0x2bc30d=resolveWriteConfigPath(_0x13284c);try{_0x3c8b44?await runNonInteractive(_0x2df9d2,_0x2bc30d):await runInteractive(_0x2df9d2,_0x2bc30d);}catch(_0x5f0ff4){if(_0x5f0ff4 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x5f0ff4;}}export async function runInitImport(_0x886ce){const _0x8ca5ab=a31_0x1cff7d,_0x3f3c71=_0x886ce['global']?_0x8ca5ab(0xbc):_0x8ca5ab(0x7d),_0x261278=resolveWriteConfigPath(_0x3f3c71);await runFromImport(_0x886ce,_0x261278);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x1cff7d(0x9f)]);async function runFromImport(_0x24e1a4,_0x29d885){const _0x5d111f=a31_0x1cff7d,_0x20cdfa=resolveFilePath(_0x24e1a4[_0x5d111f(0x89)]);if(!existsSync(_0x20cdfa))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x20cdfa);const _0x1af61b=readSourceFile(_0x20cdfa),_0xcebad4=convertToRuntimeConfig(_0x1af61b);_0x24e1a4[_0x5d111f(0x81)]&&(_0xcebad4[_0x5d111f(0x81)]=String(_0x24e1a4[_0x5d111f(0x81)]));_0x24e1a4[_0x5d111f(0xa8)]&&(_0xcebad4[_0x5d111f(0xa8)]=resolveInitEnv(_0x24e1a4));if(!_0xcebad4[_0x5d111f(0x81)])throw CliErrors[_0x5d111f(0x8e)](_0x5d111f(0xc2),_0x5d111f(0x7e));await writeInitConfig(_0x29d885,_0xcebad4,_0x24e1a4),console[_0x5d111f(0xc8)](_0x5d111f(0x86)+_0x20cdfa),console[_0x5d111f(0xc8)](_0x5d111f(0x93)+_0x29d885),console['log']('\x20\x20appcode:\x20'+_0xcebad4[_0x5d111f(0x81)]);if(_0xcebad4[_0x5d111f(0x9d)])console['log'](_0x5d111f(0x96)+_0xcebad4[_0x5d111f(0x9d)]);}function convertToRuntimeConfig(_0x5ebeee){const _0x550c95=a31_0x1cff7d;if(_0x5ebeee[_0x550c95(0x8b)]&&typeof _0x5ebeee['apps']===_0x550c95(0x98))throw CliErrors['validation'](_0x550c95(0xbb),_0x550c95(0xb5));const _0x1de773={};for(const _0x38bd01 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5ebeee[_0x38bd01]!==undefined&&(_0x1de773[_0x38bd01]=_0x5ebeee[_0x38bd01]);}return!_0x1de773[_0x550c95(0x95)]&&(_0x1de773['riskLevel']=DEFAULT_CONFIG_VALUES[_0x550c95(0x95)]),_0x1de773;}async function runNonInteractive(_0x828c2e,_0x3a8390){const _0x35455f=a31_0x1cff7d,_0x2d8c2f=_0x828c2e[_0x35455f(0x81)];if(!_0x2d8c2f)throw CliErrors['flagMissing'](_0x35455f(0x81),_0x35455f(0xae)+CLI_BIN_NAME+_0x35455f(0xaa));const _0x42c3bb=resolveInitEnv(_0x828c2e);await writeInitConfig(_0x3a8390,{'appcode':_0x2d8c2f,'env':_0x42c3bb},_0x828c2e),console[_0x35455f(0xc8)](_0x35455f(0x80)+_0x3a8390),console['log'](_0x35455f(0x9c)+_0x2d8c2f),console[_0x35455f(0xc8)](_0x35455f(0xc1)+_0x42c3bb);}async function runInteractive(_0x2592d1,_0x34cd62){const _0x5ae2a4=a31_0x1cff7d,_0x587e45=loadExisting(_0x34cd62),_0x288e36=typeof _0x587e45?.[_0x5ae2a4(0x81)]==='string'?_0x587e45[_0x5ae2a4(0x81)]:'',_0x4e15de=resolveInitEnv(_0x2592d1);console['log'](CLI_BIN_NAME+_0x5ae2a4(0x82)+PRODUCT_CONFIG[_0x5ae2a4(0xb8)]+'\x0a');if(existsSync(_0x34cd62)&&!_0x2592d1[_0x5ae2a4(0x9a)]){const _0x3a5dd2=await promptYesNo(_0x5ae2a4(0xb1)+_0x34cd62+_0x5ae2a4(0xb2),![]);if(!_0x3a5dd2){console[_0x5ae2a4(0xc8)]('Aborted.');return;}}const _0x2e8b97=typeof _0x2592d1[_0x5ae2a4(0x81)]==='string'?_0x2592d1[_0x5ae2a4(0x81)][_0x5ae2a4(0xc3)]():'';let _0x12519e=_0x2e8b97;!_0x12519e&&(_0x12519e=await promptInput(_0x5ae2a4(0x92),_0x288e36));if(!_0x12519e[_0x5ae2a4(0xc3)]())throw CliErrors[_0x5ae2a4(0x8e)](_0x5ae2a4(0xc7));await writeInitConfig(_0x34cd62,{'appcode':_0x12519e['trim'](),'env':_0x4e15de},_0x2592d1),console[_0x5ae2a4(0xc8)](_0x5ae2a4(0xc0)+_0x34cd62),console[_0x5ae2a4(0xc8)]('\x20\x20appcode:\x20'+_0x12519e[_0x5ae2a4(0xc3)]()),console[_0x5ae2a4(0xc8)](_0x5ae2a4(0xc1)+_0x4e15de);}async function writeInitConfig(_0x28b93b,_0x3115ca,_0x325f5f){const _0x73c48c=a31_0x1cff7d;let _0x3d1b7a={};existsSync(_0x28b93b)&&!_0x325f5f[_0x73c48c(0x9a)]&&(_0x3d1b7a=readConfigFile(_0x28b93b));for(const [_0x562664,_0x4f7c1b]of Object['entries'](_0x3115ca)){_0x4f7c1b!==undefined&&(_0x3d1b7a[_0x562664]=_0x4f7c1b);}if(_0x3d1b7a[_0x73c48c(0xaf)])delete _0x3d1b7a['app'];writeConfigFile(_0x28b93b,_0x3d1b7a);}class AbortPrompt extends Error{constructor(){const _0x2fdafa=a31_0x1cff7d;super(_0x2fdafa(0x88)),this[_0x2fdafa(0xbd)]=_0x2fdafa(0x85);}}function createSafeRl(){const _0x55843f=a31_0x1cff7d,_0x569bcd=createInterface({'input':process[_0x55843f(0xa9)],'output':process[_0x55843f(0x94)]});let _0x352e15;const _0x5fc081=new Promise((_0x427627,_0x1518ae)=>{const _0xe2f3ac=_0x55843f;_0x352e15=()=>{const _0x9e1144=a31_0x42ac;_0x352e15&&(_0x569bcd[_0x9e1144(0x87)](_0x9e1144(0x9b),_0x352e15),_0x352e15=undefined);try{_0x569bcd['close']();}catch{}_0x1518ae(new AbortPrompt());},_0x569bcd[_0xe2f3ac(0xb3)]('SIGINT',_0x352e15);}),_0x21218e=()=>{const _0x52c492=_0x55843f;_0x352e15&&(_0x569bcd['removeListener'](_0x52c492(0x9b),_0x352e15),_0x352e15=undefined);try{_0x569bcd[_0x52c492(0xa6)]();}catch{}};return{'rl':_0x569bcd,'abortPromise':_0x5fc081,'disposeSuccess':_0x21218e};}async function promptInput(_0x4f3cab,_0x1eb537){const _0x2a9c0b=a31_0x1cff7d,{rl:_0x1162ad,abortPromise:_0x4159d2,disposeSuccess:_0x417522}=createSafeRl(),_0x466237=new Promise(_0x2b38db=>{const _0x16143f=a31_0x42ac,_0x75bf6a=_0x1eb537?'\x20\x20'+_0x4f3cab+'\x20('+_0x1eb537+_0x16143f(0xa3):'\x20\x20'+_0x4f3cab+':\x20';_0x1162ad['question'](_0x75bf6a,_0x4fc205=>{const _0x26a0c5=_0x16143f;_0x417522(),_0x2b38db(_0x4fc205[_0x26a0c5(0xc3)]()||_0x1eb537);});});return Promise[_0x2a9c0b(0xa4)]([_0x466237,_0x4159d2]);}async function promptYesNo(_0x5d4068,_0x34503e){const _0x5d1f35=a31_0x1cff7d,{rl:_0x32be7d,abortPromise:_0x581e4b,disposeSuccess:_0x36e7d4}=createSafeRl(),_0x4b0da8=new Promise(_0x151652=>{const _0x46f80f=a31_0x42ac,_0x55fdce=_0x34503e?_0x46f80f(0xa0):_0x46f80f(0x84);_0x32be7d[_0x46f80f(0x8f)]('\x20\x20'+_0x5d4068+'\x20'+_0x55fdce+':\x20',_0x3c4a8d=>{const _0x5b3ca1=_0x46f80f;_0x36e7d4();const _0x8e0752=_0x3c4a8d[_0x5b3ca1(0xc3)]()[_0x5b3ca1(0xa7)]();if(_0x8e0752==='y'||_0x8e0752==='yes')_0x151652(!![]);else{if(_0x8e0752==='n'||_0x8e0752==='no')_0x151652(![]);else _0x151652(_0x34503e);}});});return Promise[_0x5d1f35(0xa4)]([_0x4b0da8,_0x581e4b]);}function a31_0x42ac(_0x2b2814,_0x3e5373){_0x2b2814=_0x2b2814-0x7d;const _0x4080e1=a31_0x4080();let _0x42accf=_0x4080e1[_0x2b2814];return _0x42accf;}function loadExisting(_0x31337d){if(!existsSync(_0x31337d))return null;return readConfigFile(_0x31337d);}function resolveFilePath(_0x95c088){const _0x4b1715=a31_0x1cff7d;return isAbsolute(_0x95c088)?_0x95c088:resolve(process[_0x4b1715(0xba)](),_0x95c088);}function readSourceFile(_0x3d3246){const _0x148d3b=a31_0x1cff7d;try{const _0x1d6e8e=readFileSync(_0x3d3246,{'encoding':_0x148d3b(0xb6)});return JSON['parse'](_0x1d6e8e);}catch(_0x19db0f){throw CliErrors[_0x148d3b(0x8e)](_0x148d3b(0xad)+_0x19db0f[_0x148d3b(0xc6)]);}}function resolveInitEnv(_0x312295){const _0x4be3ce=a31_0x1cff7d,_0x1ad3ec=_0x312295[_0x4be3ce(0xa8)];if(_0x1ad3ec===undefined||_0x1ad3ec==='')return DEFAULT_CONFIG_VALUES[_0x4be3ce(0xa8)];if(!RUNTIME_ENV_VALUES['includes'](_0x1ad3ec))throw CliErrors[_0x4be3ce(0x8e)]('Invalid\x20env\x20\x22'+_0x1ad3ec+_0x4be3ce(0xbf)+RUNTIME_ENV_VALUES[_0x4be3ce(0xa5)](',\x20'));return _0x1ad3ec;}
@@ -1 +1 @@
1
- const a32_0x503b1c=a32_0x3eb7;function a32_0x3eb7(_0x2fc870,_0x4f6f49){_0x2fc870=_0x2fc870-0x1b7;const _0x7e671f=a32_0x7e67();let _0x3eb773=_0x7e671f[_0x2fc870];return _0x3eb773;}(function(_0x2f16bf,_0x626c43){const _0x60e687=a32_0x3eb7,_0x42acb9=_0x2f16bf();while(!![]){try{const _0x2d7d0d=parseInt(_0x60e687(0x1d0))/0x1*(-parseInt(_0x60e687(0x1e4))/0x2)+parseInt(_0x60e687(0x1e7))/0x3+parseInt(_0x60e687(0x1de))/0x4+-parseInt(_0x60e687(0x1cc))/0x5*(parseInt(_0x60e687(0x1dd))/0x6)+parseInt(_0x60e687(0x1cb))/0x7*(-parseInt(_0x60e687(0x1e3))/0x8)+parseInt(_0x60e687(0x1c2))/0x9+parseInt(_0x60e687(0x1f5))/0xa*(-parseInt(_0x60e687(0x1ca))/0xb);if(_0x2d7d0d===_0x626c43)break;else _0x42acb9['push'](_0x42acb9['shift']());}catch(_0x36476a){_0x42acb9['push'](_0x42acb9['shift']());}}}(a32_0x7e67,0x6623e));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';function a32_0x7e67(){const _0x219137=['topk','trim','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','ragErrorMessage','score','90XbowVO','number','create','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','read','flag','write','/update','query','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','description','file','map','POST','bool','6703875zoECIE','title','isFinite','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','length','utf8','updateTime','Personal\x20knowledge-base\x20entry\x20title','352561FMMIWd','77854McuEJr','266810bAsOrK','Personal\x20knowledge-base\x20entry\x20ID','appCode','metadata','19xNnaQc','scope','body','detail','update','--topk\x20must\x20be\x20a\x20positive\x20number.','Updated\x20KB\x20entry\x20','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','str','userId','num','Created\x20KB\x20entry\x20','Override\x20the\x20existing\x20entry\x20title','66pHBrlG','3255412sMSfXt','verbose','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','ragStatus','content','448tzAKnP','31090wDKYGc','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','list','1959798eTIMMq','validation','version','createTime','weightedScore','build','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','/client/knowledge-base/personal/','string'];a32_0x7e67=function(){return _0x219137;};return a32_0x7e67();}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':'title','type':a32_0x503b1c(0x1ef),'required':!![],'description':a32_0x503b1c(0x1c9)},FILE_FLAG={'name':a32_0x503b1c(0x1be),'type':'string','required':!![],'description':a32_0x503b1c(0x1f8)},QUERY_FLAG={'name':'query','type':a32_0x503b1c(0x1ef),'required':!![],'description':a32_0x503b1c(0x1e0)},TOPK_FLAG={'name':a32_0x503b1c(0x1f0),'type':a32_0x503b1c(0x1f6),'description':a32_0x503b1c(0x1bc)};function readKnowledgeFile(_0x17ec87){const _0x4b0dfb=a32_0x503b1c;if(!_0x17ec87)throw CliErrors[_0x4b0dfb(0x1e8)]('File\x20path\x20is\x20required.');if(!existsSync(_0x17ec87))throw CliErrors[_0x4b0dfb(0x1e8)]('File\x20not\x20found:\x20'+_0x17ec87);if(!statSync(_0x17ec87)['isFile']())throw CliErrors[_0x4b0dfb(0x1e8)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x17ec87);return readFileSync(_0x17ec87,_0x4b0dfb(0x1c7));}function summarizePersonalItem(_0x227d0a){const _0x1b614b=a32_0x503b1c;return{'id':_0x227d0a['id'],'title':_0x227d0a['title'],'version':_0x227d0a[_0x1b614b(0x1e9)],'ragStatus':_0x227d0a[_0x1b614b(0x1e1)],'ragErrorMessage':_0x227d0a[_0x1b614b(0x1f3)],'updateTime':_0x227d0a[_0x1b614b(0x1c8)]};}function detailPersonalItem(_0x1daf41){const _0x284ba9=a32_0x503b1c;return{'id':_0x1daf41['id'],'appCode':_0x1daf41[_0x284ba9(0x1ce)],'scope':_0x1daf41[_0x284ba9(0x1d1)],'userId':_0x1daf41[_0x284ba9(0x1d9)],'title':_0x1daf41[_0x284ba9(0x1c3)],'content':_0x1daf41[_0x284ba9(0x1e2)]??'','version':_0x1daf41[_0x284ba9(0x1e9)],'ragStatus':_0x1daf41[_0x284ba9(0x1e1)],'ragErrorMessage':_0x1daf41[_0x284ba9(0x1f3)],'createTime':_0x1daf41[_0x284ba9(0x1ea)],'updateTime':_0x1daf41['updateTime']};}function summarizeSearchHit(_0x3c21df){const _0x282e9c=a32_0x503b1c;return{'scope':_0x3c21df[_0x282e9c(0x1d1)],'docId':_0x3c21df['docId'],'score':_0x3c21df[_0x282e9c(0x1f4)],'weightedScore':_0x3c21df[_0x282e9c(0x1eb)],'content':_0x3c21df['content'],'metadata':_0x3c21df[_0x282e9c(0x1cf)]};}function readTopK(_0x2a4ef7){const _0x34601d=a32_0x503b1c,_0x34d17f=_0x2a4ef7[_0x34601d(0x1b7)]('topk');if(_0x34d17f===undefined||_0x34d17f===null||_0x34d17f==='')return undefined;const _0x415054=_0x2a4ef7[_0x34601d(0x1da)](_0x34601d(0x1f0));if(!Number[_0x34601d(0x1c4)](_0x415054)||_0x415054<0x1)throw CliErrors[_0x34601d(0x1e8)](_0x34601d(0x1d5));return _0x415054;}const kbList={'service':'kb','command':a32_0x503b1c(0x1e6),'description':a32_0x503b1c(0x1ed),'risk':a32_0x503b1c(0x1f9),'flags':[VERBOSE_FLAG],async 'execute'(_0x5b0aa5){const _0xbf9917=a32_0x503b1c,_0x411df1=await listPersonalKnowledgeBaseItems(_0x5b0aa5[_0xbf9917(0x1ce)]);if(_0x5b0aa5[_0xbf9917(0x1c1)](_0xbf9917(0x1df)))return{'ok':!![],'data':{'total':_0x411df1['length'],'items':_0x411df1}};return{'ok':!![],'data':{'total':_0x411df1[_0xbf9917(0x1c6)],'items':_0x411df1[_0xbf9917(0x1bf)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x503b1c(0x1d3),'description':a32_0x503b1c(0x1f2),'risk':a32_0x503b1c(0x1f9),'flags':[{...ID_FLAG,'description':a32_0x503b1c(0x1cd)}],async 'execute'(_0x30ad83){const _0x5b2ff7=a32_0x503b1c,_0x1e99a7=await getPersonalKnowledgeBaseItem(_0x30ad83[_0x5b2ff7(0x1da)]('id'),_0x30ad83[_0x5b2ff7(0x1ce)]);return{'ok':!![],'data':detailPersonalItem(_0x1e99a7)};}},kbCreate={'service':'kb','command':a32_0x503b1c(0x1f7),'description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a32_0x503b1c(0x1b8),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x498ef6){const _0x36ce20=a32_0x503b1c,_0x40dcaf=_0x498ef6[_0x36ce20(0x1d8)](_0x36ce20(0x1c3)),_0x15df66=readKnowledgeFile(_0x498ef6['str'](_0x36ce20(0x1be))),_0x1aa9a9=await createPersonalKnowledgeBaseItem(_0x498ef6[_0x36ce20(0x1ce)],{'title':_0x40dcaf,'content':_0x15df66});return{'ok':!![],'data':summarizePersonalItem(_0x1aa9a9),'message':_0x36ce20(0x1db)+_0x1aa9a9['id']+'\x20('+_0x1aa9a9[_0x36ce20(0x1c3)]+')'};},async 'dryRun'(_0x265b2e){const _0x3477b2=a32_0x503b1c,_0x55e188=_0x265b2e[_0x3477b2(0x1d8)](_0x3477b2(0x1c3)),_0x5b29a0=readKnowledgeFile(_0x265b2e[_0x3477b2(0x1d8)](_0x3477b2(0x1be)));return dryRun('POST','/client/knowledge-base/personal/create')['body']({'appCode':_0x265b2e[_0x3477b2(0x1ce)],'title':_0x55e188,'content':_0x5b29a0})['description'](_0x3477b2(0x1e5)+_0x55e188+'\x22')[_0x3477b2(0x1ec)]();}},kbUpdate={'service':'kb','command':a32_0x503b1c(0x1d4),'description':a32_0x503b1c(0x1bb),'risk':a32_0x503b1c(0x1b8),'flags':[{...ID_FLAG,'description':a32_0x503b1c(0x1cd)},{...TITLE_FLAG,'required':![],'description':a32_0x503b1c(0x1dc)},FILE_FLAG],async 'execute'(_0x106dfa){const _0x4f0402=a32_0x503b1c,_0x5f3cdc=_0x106dfa[_0x4f0402(0x1da)]('id'),_0x1b9efb=readKnowledgeFile(_0x106dfa[_0x4f0402(0x1d8)](_0x4f0402(0x1be))),_0x43f8ab=_0x106dfa[_0x4f0402(0x1d8)](_0x4f0402(0x1c3))||(await getPersonalKnowledgeBaseItem(_0x5f3cdc,_0x106dfa[_0x4f0402(0x1ce)]))[_0x4f0402(0x1c3)],_0x2121da=await updatePersonalKnowledgeBaseItem(_0x5f3cdc,_0x106dfa[_0x4f0402(0x1ce)],{'title':_0x43f8ab,'content':_0x1b9efb});return{'ok':!![],'data':summarizePersonalItem(_0x2121da),'message':_0x4f0402(0x1d6)+_0x2121da['id']+'\x20('+_0x2121da[_0x4f0402(0x1c3)]+')'};},async 'dryRun'(_0x426160){const _0x48d1bd=a32_0x503b1c,_0x5a0de0=_0x426160['num']('id'),_0x2be223=readKnowledgeFile(_0x426160[_0x48d1bd(0x1d8)](_0x48d1bd(0x1be))),_0xbf925a=_0x426160['str'](_0x48d1bd(0x1c3))||(await getPersonalKnowledgeBaseItem(_0x5a0de0,_0x426160[_0x48d1bd(0x1ce)]))[_0x48d1bd(0x1c3)];return dryRun(_0x48d1bd(0x1c0),_0x48d1bd(0x1ee)+_0x5a0de0+_0x48d1bd(0x1b9))[_0x48d1bd(0x1d2)]({'appCode':_0x426160['appCode'],'title':_0xbf925a,'content':_0x2be223})[_0x48d1bd(0x1bd)](_0x48d1bd(0x1d7)+_0x5a0de0)[_0x48d1bd(0x1ec)]();}},kbSearch={'service':'kb','command':'search','description':a32_0x503b1c(0x1c5),'risk':a32_0x503b1c(0x1f9),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x3f0509){const _0x3bd39a=a32_0x503b1c;if(!_0x3f0509[_0x3bd39a(0x1d8)](_0x3bd39a(0x1ba))['trim']())throw CliErrors[_0x3bd39a(0x1e8)]('Search\x20query\x20is\x20required.');readTopK(_0x3f0509);},async 'execute'(_0x538bce){const _0x1a44fb=a32_0x503b1c,_0x1853cf=_0x538bce[_0x1a44fb(0x1d8)](_0x1a44fb(0x1ba))[_0x1a44fb(0x1f1)](),_0x541270=readTopK(_0x538bce),_0x1cac34=await searchKnowledgeBase(_0x538bce[_0x1a44fb(0x1ce)],{'query':_0x1853cf,'topK':_0x541270});return{'ok':!![],'data':{'total':_0x1cac34[_0x1a44fb(0x1c6)],'hits':_0x1cac34[_0x1a44fb(0x1bf)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a32_0x3a2c72=a32_0x2743;(function(_0x3826ab,_0x547c24){const _0x313420=a32_0x2743,_0x26fdd9=_0x3826ab();while(!![]){try{const _0x371142=parseInt(_0x313420(0x18b))/0x1+-parseInt(_0x313420(0x17a))/0x2*(parseInt(_0x313420(0x16e))/0x3)+-parseInt(_0x313420(0x18c))/0x4*(-parseInt(_0x313420(0x183))/0x5)+-parseInt(_0x313420(0x17b))/0x6+parseInt(_0x313420(0x160))/0x7*(parseInt(_0x313420(0x195))/0x8)+-parseInt(_0x313420(0x186))/0x9*(parseInt(_0x313420(0x16c))/0xa)+-parseInt(_0x313420(0x16f))/0xb;if(_0x371142===_0x547c24)break;else _0x26fdd9['push'](_0x26fdd9['shift']());}catch(_0x43f624){_0x26fdd9['push'](_0x26fdd9['shift']());}}}(a32_0x4e68,0xd2b2e));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a32_0x2743(_0x5388a2,_0x5a83a8){_0x5388a2=_0x5388a2-0x159;const _0x4e68f2=a32_0x4e68();let _0x274363=_0x4e68f2[_0x5388a2];return _0x274363;}const TITLE_FLAG={'name':a32_0x3a2c72(0x16b),'type':a32_0x3a2c72(0x15f),'required':!![],'description':a32_0x3a2c72(0x192)},FILE_FLAG={'name':'file','type':a32_0x3a2c72(0x15f),'required':!![],'description':a32_0x3a2c72(0x17c)},QUERY_FLAG={'name':'query','type':a32_0x3a2c72(0x15f),'required':!![],'description':a32_0x3a2c72(0x193)},TOPK_FLAG={'name':a32_0x3a2c72(0x187),'type':a32_0x3a2c72(0x170),'description':a32_0x3a2c72(0x15b)};function a32_0x4e68(){const _0x15d3ab=['userId','--topk\x20must\x20be\x20a\x20positive\x20number.','988753QxRbzF','6768332pYPDLO','list','update','Search\x20query\x20is\x20required.','createTime','Personal\x20knowledge-base\x20entry\x20ID','Personal\x20knowledge-base\x20entry\x20title','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','search','9528CSbbui','/update','body','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','content','File\x20is\x20not\x20a\x20regular\x20file:\x20','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','string','364WGLoWS','scope','isFinite','trim','verbose','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','str','Override\x20the\x20existing\x20entry\x20title','validation','isFile','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','title','6779660dcFynP','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','2726013QVPrcl','1464419gaUKfa','number','updateTime','appCode','Created\x20KB\x20entry\x20','read','metadata','description','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','detail','/client/knowledge-base/personal/','2GuaFgz','959880VGAgpf','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','docId','query','POST','length','ragStatus','map','5LNlqtr','num','flag','9alvFJl','topk','file'];a32_0x4e68=function(){return _0x15d3ab;};return a32_0x4e68();}function readKnowledgeFile(_0x427738){const _0x4cddd8=a32_0x3a2c72;if(!_0x427738)throw CliErrors[_0x4cddd8(0x168)]('File\x20path\x20is\x20required.');if(!existsSync(_0x427738))throw CliErrors[_0x4cddd8(0x168)]('File\x20not\x20found:\x20'+_0x427738);if(!statSync(_0x427738)[_0x4cddd8(0x169)]())throw CliErrors[_0x4cddd8(0x168)](_0x4cddd8(0x15d)+_0x427738);return readFileSync(_0x427738,'utf8');}function summarizePersonalItem(_0x313ffe){const _0x3e382a=a32_0x3a2c72;return{'id':_0x313ffe['id'],'title':_0x313ffe['title'],'version':_0x313ffe['version'],'ragStatus':_0x313ffe[_0x3e382a(0x181)],'ragErrorMessage':_0x313ffe['ragErrorMessage'],'updateTime':_0x313ffe[_0x3e382a(0x171)]};}function detailPersonalItem(_0x36e3a5){const _0x450b1d=a32_0x3a2c72;return{'id':_0x36e3a5['id'],'appCode':_0x36e3a5[_0x450b1d(0x172)],'scope':_0x36e3a5['scope'],'userId':_0x36e3a5[_0x450b1d(0x189)],'title':_0x36e3a5['title'],'content':_0x36e3a5[_0x450b1d(0x15c)]??'','version':_0x36e3a5['version'],'ragStatus':_0x36e3a5[_0x450b1d(0x181)],'ragErrorMessage':_0x36e3a5['ragErrorMessage'],'createTime':_0x36e3a5[_0x450b1d(0x190)],'updateTime':_0x36e3a5[_0x450b1d(0x171)]};}function summarizeSearchHit(_0x437e0d){const _0x203d89=a32_0x3a2c72;return{'scope':_0x437e0d[_0x203d89(0x161)],'docId':_0x437e0d[_0x203d89(0x17d)],'score':_0x437e0d['score'],'weightedScore':_0x437e0d['weightedScore'],'content':_0x437e0d['content'],'metadata':_0x437e0d[_0x203d89(0x175)]};}function readTopK(_0x234ada){const _0x254340=a32_0x3a2c72,_0xffad9c=_0x234ada[_0x254340(0x185)](_0x254340(0x187));if(_0xffad9c===undefined||_0xffad9c===null||_0xffad9c==='')return undefined;const _0x2aa299=_0x234ada['num'](_0x254340(0x187));if(!Number[_0x254340(0x162)](_0x2aa299)||_0x2aa299<0x1)throw CliErrors[_0x254340(0x168)](_0x254340(0x18a));return _0x2aa299;}const kbList={'service':'kb','command':a32_0x3a2c72(0x18d),'description':a32_0x3a2c72(0x16d),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x4a68e5){const _0x5397d8=a32_0x3a2c72,_0x129b57=await listPersonalKnowledgeBaseItems(_0x4a68e5['appCode']);if(_0x4a68e5['bool'](_0x5397d8(0x164)))return{'ok':!![],'data':{'total':_0x129b57['length'],'items':_0x129b57}};return{'ok':!![],'data':{'total':_0x129b57[_0x5397d8(0x180)],'items':_0x129b57['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x3a2c72(0x178),'description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':a32_0x3a2c72(0x174),'flags':[{...ID_FLAG,'description':a32_0x3a2c72(0x191)}],async 'execute'(_0x3442af){const _0x3bcc08=a32_0x3a2c72,_0x32707b=await getPersonalKnowledgeBaseItem(_0x3442af['num']('id'),_0x3442af[_0x3bcc08(0x172)]);return{'ok':!![],'data':detailPersonalItem(_0x32707b)};}},kbCreate={'service':'kb','command':'create','description':a32_0x3a2c72(0x165),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x2d10d3){const _0x42eb7b=a32_0x3a2c72,_0x233940=_0x2d10d3['str'](_0x42eb7b(0x16b)),_0x5911de=readKnowledgeFile(_0x2d10d3[_0x42eb7b(0x166)]('file')),_0x2fb0cb=await createPersonalKnowledgeBaseItem(_0x2d10d3[_0x42eb7b(0x172)],{'title':_0x233940,'content':_0x5911de});return{'ok':!![],'data':summarizePersonalItem(_0x2fb0cb),'message':_0x42eb7b(0x173)+_0x2fb0cb['id']+'\x20('+_0x2fb0cb['title']+')'};},async 'dryRun'(_0x5a8759){const _0x4db0a6=a32_0x3a2c72,_0x5ca821=_0x5a8759[_0x4db0a6(0x166)]('title'),_0x218dfa=readKnowledgeFile(_0x5a8759['str']('file'));return dryRun(_0x4db0a6(0x17f),'/client/knowledge-base/personal/create')[_0x4db0a6(0x15a)]({'appCode':_0x5a8759[_0x4db0a6(0x172)],'title':_0x5ca821,'content':_0x218dfa})['description'](_0x4db0a6(0x177)+_0x5ca821+'\x22')['build']();}},kbUpdate={'service':'kb','command':a32_0x3a2c72(0x18e),'description':a32_0x3a2c72(0x16a),'risk':'write','flags':[{...ID_FLAG,'description':a32_0x3a2c72(0x191)},{...TITLE_FLAG,'required':![],'description':a32_0x3a2c72(0x167)},FILE_FLAG],async 'execute'(_0x444f4f){const _0x183e72=a32_0x3a2c72,_0x44ea93=_0x444f4f[_0x183e72(0x184)]('id'),_0xbe4b67=readKnowledgeFile(_0x444f4f['str'](_0x183e72(0x188))),_0x20f52f=_0x444f4f[_0x183e72(0x166)]('title')||(await getPersonalKnowledgeBaseItem(_0x44ea93,_0x444f4f[_0x183e72(0x172)]))[_0x183e72(0x16b)],_0x2d8aa2=await updatePersonalKnowledgeBaseItem(_0x44ea93,_0x444f4f[_0x183e72(0x172)],{'title':_0x20f52f,'content':_0xbe4b67});return{'ok':!![],'data':summarizePersonalItem(_0x2d8aa2),'message':'Updated\x20KB\x20entry\x20'+_0x2d8aa2['id']+'\x20('+_0x2d8aa2[_0x183e72(0x16b)]+')'};},async 'dryRun'(_0x5e3368){const _0x160892=a32_0x3a2c72,_0x1e8c9c=_0x5e3368[_0x160892(0x184)]('id'),_0x3c5ce3=readKnowledgeFile(_0x5e3368[_0x160892(0x166)]('file')),_0x43055f=_0x5e3368[_0x160892(0x166)](_0x160892(0x16b))||(await getPersonalKnowledgeBaseItem(_0x1e8c9c,_0x5e3368[_0x160892(0x172)]))[_0x160892(0x16b)];return dryRun(_0x160892(0x17f),_0x160892(0x179)+_0x1e8c9c+_0x160892(0x159))[_0x160892(0x15a)]({'appCode':_0x5e3368[_0x160892(0x172)],'title':_0x43055f,'content':_0x3c5ce3})[_0x160892(0x176)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x1e8c9c)['build']();}},kbSearch={'service':'kb','command':a32_0x3a2c72(0x194),'description':a32_0x3a2c72(0x15e),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x33a1ce){const _0x14aaf1=a32_0x3a2c72;if(!_0x33a1ce[_0x14aaf1(0x166)]('query')[_0x14aaf1(0x163)]())throw CliErrors[_0x14aaf1(0x168)](_0x14aaf1(0x18f));readTopK(_0x33a1ce);},async 'execute'(_0x39fc5f){const _0x559809=a32_0x3a2c72,_0x1cc798=_0x39fc5f[_0x559809(0x166)](_0x559809(0x17e))[_0x559809(0x163)](),_0x43b02f=readTopK(_0x39fc5f),_0x523fd0=await searchKnowledgeBase(_0x39fc5f['appCode'],{'query':_0x1cc798,'topK':_0x43b02f});return{'ok':!![],'data':{'total':_0x523fd0[_0x559809(0x180)],'hits':_0x523fd0[_0x559809(0x182)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- const a33_0x2774a4=a33_0x6e60;(function(_0xb70f3,_0x18758b){const _0x5bb055=a33_0x6e60,_0x5bddea=_0xb70f3();while(!![]){try{const _0x13cd0e=-parseInt(_0x5bb055(0xfa))/0x1+parseInt(_0x5bb055(0xe7))/0x2*(parseInt(_0x5bb055(0xf7))/0x3)+parseInt(_0x5bb055(0xe2))/0x4+-parseInt(_0x5bb055(0xf1))/0x5+parseInt(_0x5bb055(0x101))/0x6+-parseInt(_0x5bb055(0xfd))/0x7+-parseInt(_0x5bb055(0xe1))/0x8*(-parseInt(_0x5bb055(0xe0))/0x9);if(_0x13cd0e===_0x18758b)break;else _0x5bddea['push'](_0x5bddea['shift']());}catch(_0x4b39f4){_0x5bddea['push'](_0x5bddea['shift']());}}}(a33_0x562a,0xa1773));import{logger}from'../../utils/logger.js';function a33_0x562a(){const _0x47fe9a=['timestamp','write','warn','log','duration','12cMgjqt','message','*\x20Logs\x20cleared','880848TtKePm','View\x20command\x20history\x20logs','clearLogs','5280289gzjWtP','stringify','forEach','clear','2468874pGYihY','9YILzXl','10806304CGaeWX','2998600CnOLgD','length','Clear\x20command\x20history\x20logs','en-US','command','457972lHajse','toLocaleString','details','success','level','\x20\x20\x20Details:\x20','\x20\x20\x20Time:\x20','logs','read','show','5656615mnoADG'];a33_0x562a=function(){return _0x47fe9a;};return a33_0x562a();}import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x6e60(_0x462ce4,_0x2a753a){_0x462ce4=_0x462ce4-0xe0;const _0x562ab8=a33_0x562a();let _0x6e6084=_0x562ab8[_0x462ce4];return _0x6e6084;}function printLogs(_0x470f65){const _0x183bcd=a33_0x6e60;if(_0x470f65['length']===0x0){console[_0x183bcd(0xf5)]('*\x20No\x20logs\x20found');return;}console[_0x183bcd(0xf5)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x470f65[_0x183bcd(0xff)]((_0x3215b7,_0x235bdd)=>{const _0x2c0438=_0x183bcd,_0x5d9602=new Date(_0x3215b7[_0x2c0438(0xf2)])[_0x2c0438(0xe8)](_0x2c0438(0xe5)),_0x297dcf=_0x3215b7[_0x2c0438(0xeb)]===_0x2c0438(0xea)?'√':_0x3215b7[_0x2c0438(0xeb)]==='error'?'×':_0x3215b7[_0x2c0438(0xeb)]===_0x2c0438(0xf4)?'!':'i';console[_0x2c0438(0xf5)](_0x235bdd+0x1+'.\x20'+_0x297dcf+'\x20['+_0x3215b7[_0x2c0438(0xe6)]+']\x20'+_0x3215b7[_0x2c0438(0xf8)]),console[_0x2c0438(0xf5)](_0x2c0438(0xed)+_0x5d9602),_0x3215b7['duration']&&console[_0x2c0438(0xf5)]('\x20\x20\x20Duration:\x20'+_0x3215b7[_0x2c0438(0xf6)]+'ms'),_0x3215b7[_0x2c0438(0xe9)]&&Object['keys'](_0x3215b7['details'])[_0x2c0438(0xe3)]>0x0&&console[_0x2c0438(0xf5)](_0x2c0438(0xec)+JSON[_0x2c0438(0xfe)](_0x3215b7[_0x2c0438(0xe9)],null,0x2)),console[_0x2c0438(0xf5)]('');});}export const logsDefinitions=[{'service':a33_0x2774a4(0xee),'command':a33_0x2774a4(0xf0),'description':a33_0x2774a4(0xfb),'risk':a33_0x2774a4(0xef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x16de71){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':a33_0x2774a4(0xee),'command':a33_0x2774a4(0x100),'description':a33_0x2774a4(0xe4),'risk':a33_0x2774a4(0xf3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x476602){const _0xebbe09=a33_0x2774a4;return logger[_0xebbe09(0xfc)](),console[_0xebbe09(0xf5)](_0xebbe09(0xf9)),{'ok':!![]};}}];
1
+ const a33_0x3d321b=a33_0x4e8a;(function(_0x2331a7,_0x5cdbc6){const _0x533160=a33_0x4e8a,_0x5523c0=_0x2331a7();while(!![]){try{const _0x54b926=parseInt(_0x533160(0x144))/0x1*(parseInt(_0x533160(0x137))/0x2)+parseInt(_0x533160(0x13f))/0x3*(-parseInt(_0x533160(0x124))/0x4)+parseInt(_0x533160(0x142))/0x5*(parseInt(_0x533160(0x12f))/0x6)+parseInt(_0x533160(0x13a))/0x7+-parseInt(_0x533160(0x129))/0x8*(parseInt(_0x533160(0x13e))/0x9)+-parseInt(_0x533160(0x143))/0xa+parseInt(_0x533160(0x128))/0xb*(parseInt(_0x533160(0x12b))/0xc);if(_0x54b926===_0x5cdbc6)break;else _0x5523c0['push'](_0x5523c0['shift']());}catch(_0x1b439b){_0x5523c0['push'](_0x5523c0['shift']());}}}(a33_0x2d88,0xec00e));function a33_0x2d88(){const _0x488629=['9XZhSBo','1302834hvrLWS','timestamp','write','630CqptMG','8801300OMGVTp','30521OREalW','Clear\x20command\x20history\x20logs','forEach','*\x20No\x20logs\x20found','read','duration','4IJOtPh','success','clearLogs','level','48433FcoHql','3168776GFPKhO','*\x20Logs\x20cleared','3228cwGYND','length','logs','\x20\x20\x20Details:\x20','50532BDMIgj','en-US','readLogs','message','\x20\x20\x20Duration:\x20','show','View\x20command\x20history\x20logs','details','18rsipeG','error','log','1098349dJXiXn','\x20logs:\x0a','clear','keys'];a33_0x2d88=function(){return _0x488629;};return a33_0x2d88();}function a33_0x4e8a(_0x510665,_0x451d12){_0x510665=_0x510665-0x124;const _0x2d8802=a33_0x2d88();let _0x4e8aee=_0x2d8802[_0x510665];return _0x4e8aee;}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x4300ef){const _0x77a831=a33_0x4e8a;if(_0x4300ef[_0x77a831(0x12c)]===0x0){console['log'](_0x77a831(0x147));return;}console[_0x77a831(0x139)]('*\x20'+CLI_DISPLAY_NAME+_0x77a831(0x13b)),_0x4300ef[_0x77a831(0x146)]((_0x1e438a,_0x493ea7)=>{const _0x1b9a09=_0x77a831,_0x19afd7=new Date(_0x1e438a[_0x1b9a09(0x140)])['toLocaleString'](_0x1b9a09(0x130)),_0x1de88e=_0x1e438a[_0x1b9a09(0x127)]===_0x1b9a09(0x125)?'√':_0x1e438a[_0x1b9a09(0x127)]===_0x1b9a09(0x138)?'×':_0x1e438a[_0x1b9a09(0x127)]==='warn'?'!':'i';console[_0x1b9a09(0x139)](_0x493ea7+0x1+'.\x20'+_0x1de88e+'\x20['+_0x1e438a['command']+']\x20'+_0x1e438a[_0x1b9a09(0x132)]),console[_0x1b9a09(0x139)]('\x20\x20\x20Time:\x20'+_0x19afd7),_0x1e438a[_0x1b9a09(0x149)]&&console['log'](_0x1b9a09(0x133)+_0x1e438a[_0x1b9a09(0x149)]+'ms'),_0x1e438a[_0x1b9a09(0x136)]&&Object[_0x1b9a09(0x13d)](_0x1e438a[_0x1b9a09(0x136)])[_0x1b9a09(0x12c)]>0x0&&console['log'](_0x1b9a09(0x12e)+JSON['stringify'](_0x1e438a['details'],null,0x2)),console[_0x1b9a09(0x139)]('');});}export const logsDefinitions=[{'service':a33_0x3d321b(0x12d),'command':a33_0x3d321b(0x134),'description':a33_0x3d321b(0x135),'risk':a33_0x3d321b(0x148),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xc56984){const _0x5db7e1=a33_0x3d321b;return printLogs(logger[_0x5db7e1(0x131)]()),{'ok':!![]};}},{'service':a33_0x3d321b(0x12d),'command':a33_0x3d321b(0x13c),'description':a33_0x3d321b(0x145),'risk':a33_0x3d321b(0x141),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x22267d){const _0x50c37a=a33_0x3d321b;return logger[_0x50c37a(0x126)](),console[_0x50c37a(0x139)](_0x50c37a(0x12a)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a34_0x2af6ed=a34_0x1a56;(function(_0x5c3ef7,_0x10f216){const _0x215b84=a34_0x1a56,_0xd565e2=_0x5c3ef7();while(!![]){try{const _0x10b083=parseInt(_0x215b84(0x136))/0x1*(parseInt(_0x215b84(0x13d))/0x2)+-parseInt(_0x215b84(0x11f))/0x3*(parseInt(_0x215b84(0x123))/0x4)+-parseInt(_0x215b84(0x127))/0x5+-parseInt(_0x215b84(0x11d))/0x6*(parseInt(_0x215b84(0x13f))/0x7)+-parseInt(_0x215b84(0x128))/0x8+parseInt(_0x215b84(0x11a))/0x9*(parseInt(_0x215b84(0x13c))/0xa)+parseInt(_0x215b84(0x137))/0xb;if(_0x10b083===_0x10f216)break;else _0xd565e2['push'](_0xd565e2['shift']());}catch(_0x29b932){_0xd565e2['push'](_0xd565e2['shift']());}}}(a34_0x97cf,0x5a97e));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x97cf(){const _0x27e3ac=['image-url','imageUrl','171LTTHKr','File\x20URL\x20response\x20missing\x20fileUrl.','File\x20upload\x20response\x20missing\x20filePath.','1398uvWCph','idcard','20892BzEiRe','/client/queryFileUrl','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','description','124oGPgTu','build','/client/ocr','str','773955xvHpWC','1437568CAGWgb','\x20OCR\x20from\x20URL','body','length','scene','Unsupported\x20OCR\x20scene:\x20','filePath','path','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','IdCard','POST','imageFile','fileName','fileUrl','1Dfqhch','8620953SPzZJn','appCode','count','idCard','string','72190HNBvCM','459658IhVJgd','recognize','6888uNWxLW','join','image-file','\x20OCR','write','general','apiError','Publicly\x20accessible\x20image\x20or\x20file\x20URL','Table','trim','/client/uploadFile','validation','invoice','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','Invoice'];a34_0x97cf=function(){return _0x27e3ac;};return a34_0x97cf();}import{dryRun}from'../../framework/dryrun.js';function a34_0x1a56(_0xad4e97,_0x503723){_0xad4e97=_0xad4e97-0x10e;const _0x97cff0=a34_0x97cf();let _0x1a568d=_0x97cff0[_0xad4e97];return _0x1a568d;}const SUPPORTED_SCENES=[a34_0x2af6ed(0x114),'general','form',a34_0x2af6ed(0x13a)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x2af6ed(0x117),'general':'General','form':a34_0x2af6ed(0x110),'idCard':a34_0x2af6ed(0x131)},SCENE_FLAG={'name':a34_0x2af6ed(0x12c),'type':a34_0x2af6ed(0x13b),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x2af6ed(0x121)},IMAGE_FILE_FLAG={'name':a34_0x2af6ed(0x141),'type':a34_0x2af6ed(0x13b),'description':a34_0x2af6ed(0x115)},IMAGE_URL_FLAG={'name':a34_0x2af6ed(0x118),'type':a34_0x2af6ed(0x13b),'description':a34_0x2af6ed(0x10f)};function normalizeScene(_0x5d889a){const _0x12ea81=a34_0x2af6ed,_0x4890bf=_0x5d889a[_0x12ea81(0x111)]()['toLowerCase']();if(_0x4890bf===_0x12ea81(0x11e))return _0x12ea81(0x13a);if(_0x4890bf==='invoice'||_0x4890bf===_0x12ea81(0x144)||_0x4890bf==='form')return _0x4890bf;throw CliErrors[_0x12ea81(0x113)](_0x12ea81(0x12d)+_0x5d889a+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES[_0x12ea81(0x140)](',\x20'));}function selectedInputs(_0x110882){const _0x12eda4=a34_0x2af6ed,_0x108e7f=_0x110882[_0x12eda4(0x126)](_0x12eda4(0x141))[_0x12eda4(0x111)](),_0x1c09da=_0x110882['str'](_0x12eda4(0x118))[_0x12eda4(0x111)]();return{'imageFile':_0x108e7f,'imageUrl':_0x1c09da,'count':[_0x108e7f,_0x1c09da]['filter'](Boolean)[_0x12eda4(0x12b)]};}function validateInputSelection(_0x1a7c01){const _0x1f0119=a34_0x2af6ed,_0x1af2b0=selectedInputs(_0x1a7c01);if(_0x1af2b0[_0x1f0119(0x139)]!==0x1)throw CliErrors['validation'](_0x1f0119(0x116));return _0x1af2b0;}function withScene(_0x5834cc,_0x4fd017,_0x5bf459){const _0x188f44=a34_0x2af6ed;return{..._0x5834cc,'scene':_0x4fd017,..._0x5bf459?{'sourceFile':{'fileName':_0x5bf459[_0x188f44(0x134)],'filePath':_0x5bf459[_0x188f44(0x12e)]}}:{}};}const ocrRecognize={'service':'ocr','command':a34_0x2af6ed(0x13e),'description':'Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','risk':a34_0x2af6ed(0x143),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x40075c){const _0x5352ad=a34_0x2af6ed,_0x36a395=normalizeScene(_0x40075c[_0x5352ad(0x126)]('scene')),_0x482072=SCENE_TO_LEGACY_TYPE[_0x36a395],_0x35c0fd=validateInputSelection(_0x40075c);if(_0x35c0fd['imageUrl'])return dryRun('POST',_0x5352ad(0x125))[_0x5352ad(0x12a)]({'appCode':_0x40075c[_0x5352ad(0x138)],'url':_0x35c0fd[_0x5352ad(0x119)],'type':_0x482072})[_0x5352ad(0x122)]('Preview:\x20recognize\x20'+_0x36a395+_0x5352ad(0x129))[_0x5352ad(0x124)]();const _0x4a0f68=requireRuntimeUploadFile(_0x35c0fd[_0x5352ad(0x133)],_0x5352ad(0x141));return dryRun('POST',_0x5352ad(0x112))[_0x5352ad(0x12a)]({'steps':[{'method':_0x5352ad(0x132),'url':_0x5352ad(0x112),'body':{'appCode':_0x40075c[_0x5352ad(0x138)],'multipart':{'file':_0x4a0f68}}},{'method':_0x5352ad(0x132),'url':_0x5352ad(0x120),'body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':_0x5352ad(0x132),'url':_0x5352ad(0x125),'body':{'appCode':_0x40075c['appCode'],'url':_0x5352ad(0x130),'type':_0x482072}}]})[_0x5352ad(0x122)]('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x36a395+_0x5352ad(0x142))[_0x5352ad(0x124)]();},async 'execute'(_0x3d08d3){const _0x228e76=a34_0x2af6ed,_0x4e245e=normalizeScene(_0x3d08d3[_0x228e76(0x126)](_0x228e76(0x12c))),_0x5ee5b1=SCENE_TO_LEGACY_TYPE[_0x4e245e],_0x436bf3=validateInputSelection(_0x3d08d3);if(_0x436bf3[_0x228e76(0x119)]){const _0x47428b=await recognizeRuntimeOcr(_0x3d08d3[_0x228e76(0x138)],{'url':_0x436bf3[_0x228e76(0x119)],'type':_0x5ee5b1});return{'ok':!![],'data':withScene(_0x47428b,_0x4e245e)};}const _0x44a619=requireRuntimeUploadFile(_0x436bf3['imageFile'],_0x228e76(0x141)),_0x176635=await uploadRuntimeFile(_0x3d08d3[_0x228e76(0x138)],_0x44a619[_0x228e76(0x12f)]);if(!_0x176635['filePath'])throw CliErrors[_0x228e76(0x10e)](_0x228e76(0x11c));const _0x41be3e=await queryRuntimeFileUrl(_0x176635[_0x228e76(0x12e)],{'download':![]});if(!_0x41be3e[_0x228e76(0x135)])throw CliErrors[_0x228e76(0x10e)](_0x228e76(0x11b));const _0x5cca7a=await recognizeRuntimeOcr(_0x3d08d3[_0x228e76(0x138)],{'url':_0x41be3e[_0x228e76(0x135)],'type':_0x5ee5b1});return{'ok':!![],'data':withScene(_0x5cca7a,_0x4e245e,_0x176635)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a34_0x1cdfdf=a34_0x5899;(function(_0xf6546,_0x4e34d7){const _0x200906=a34_0x5899,_0x2a67c8=_0xf6546();while(!![]){try{const _0x2ed00b=parseInt(_0x200906(0x173))/0x1*(parseInt(_0x200906(0x153))/0x2)+parseInt(_0x200906(0x154))/0x3*(parseInt(_0x200906(0x177))/0x4)+-parseInt(_0x200906(0x14b))/0x5+parseInt(_0x200906(0x150))/0x6*(parseInt(_0x200906(0x16e))/0x7)+parseInt(_0x200906(0x17e))/0x8*(-parseInt(_0x200906(0x162))/0x9)+-parseInt(_0x200906(0x188))/0xa*(parseInt(_0x200906(0x187))/0xb)+-parseInt(_0x200906(0x17f))/0xc*(-parseInt(_0x200906(0x15f))/0xd);if(_0x2ed00b===_0x4e34d7)break;else _0x2a67c8['push'](_0x2a67c8['shift']());}catch(_0x4a7ff8){_0x2a67c8['push'](_0x2a67c8['shift']());}}}(a34_0x5853,0x2c505));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x1cdfdf(0x182),a34_0x1cdfdf(0x17b),a34_0x1cdfdf(0x169),a34_0x1cdfdf(0x15b)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x1cdfdf(0x184),'general':a34_0x1cdfdf(0x163),'form':'Table','idCard':a34_0x1cdfdf(0x168)},SCENE_FLAG={'name':a34_0x1cdfdf(0x160),'type':a34_0x1cdfdf(0x175),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x1cdfdf(0x15c)},IMAGE_FILE_FLAG={'name':'image-file','type':a34_0x1cdfdf(0x175),'description':a34_0x1cdfdf(0x166)},IMAGE_URL_FLAG={'name':a34_0x1cdfdf(0x16f),'type':a34_0x1cdfdf(0x175),'description':a34_0x1cdfdf(0x17c)};function normalizeScene(_0x54ba03){const _0x55341e=a34_0x1cdfdf,_0x276443=_0x54ba03[_0x55341e(0x14f)]()[_0x55341e(0x16d)]();if(_0x276443===_0x55341e(0x186))return _0x55341e(0x15b);if(_0x276443==='invoice'||_0x276443===_0x55341e(0x17b)||_0x276443===_0x55341e(0x169))return _0x276443;throw CliErrors[_0x55341e(0x181)](_0x55341e(0x14e)+_0x54ba03+_0x55341e(0x14c)+SUPPORTED_SCENES[_0x55341e(0x16c)](',\x20'));}function selectedInputs(_0x594365){const _0x35ce33=a34_0x1cdfdf,_0x285d48=_0x594365[_0x35ce33(0x155)](_0x35ce33(0x183))[_0x35ce33(0x14f)](),_0x1dc693=_0x594365[_0x35ce33(0x155)](_0x35ce33(0x16f))['trim']();return{'imageFile':_0x285d48,'imageUrl':_0x1dc693,'count':[_0x285d48,_0x1dc693]['filter'](Boolean)[_0x35ce33(0x172)]};}function validateInputSelection(_0x16ead6){const _0x12a54e=a34_0x1cdfdf,_0x2300ad=selectedInputs(_0x16ead6);if(_0x2300ad[_0x12a54e(0x15d)]!==0x1)throw CliErrors['validation'](_0x12a54e(0x176));return _0x2300ad;}function a34_0x5899(_0x55da63,_0x9ca409){_0x55da63=_0x55da63-0x14b;const _0x58538d=a34_0x5853();let _0x58993b=_0x58538d[_0x55da63];return _0x58993b;}function a34_0x5853(){const _0x216f75=['invoice','image-file','Invoice','filePath','idcard','242QXtQcl','870IIHKmi','902990KwCJzz','.\x20Supported\x20scenes:\x20','\x20OCR','Unsupported\x20OCR\x20scene:\x20','trim','405150swWtPE','/client/uploadFile','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','2180ttcThn','196206XnTBNT','str','apiError','description','File\x20upload\x20response\x20missing\x20filePath.','appCode','path','idCard','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','count','body','13tNaJze','scene','File\x20URL\x20response\x20missing\x20fileUrl.','141093CmMpji','General','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','\x20OCR\x20from\x20URL','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','build','IdCard','form','imageUrl','write','join','toLowerCase','14NQDCCC','image-url','POST','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','length','10ynNipi','/client/ocr','string','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','4QkUaJG','recognize','fileUrl','imageFile','general','Publicly\x20accessible\x20image\x20or\x20file\x20URL','Preview:\x20recognize\x20','104EvpNWe','4277640FVWmKZ','fileName','validation'];a34_0x5853=function(){return _0x216f75;};return a34_0x5853();}function withScene(_0x5059bc,_0x3ef89c,_0x54b76b){const _0x279979=a34_0x1cdfdf;return{..._0x5059bc,'scene':_0x3ef89c,..._0x54b76b?{'sourceFile':{'fileName':_0x54b76b[_0x279979(0x180)],'filePath':_0x54b76b[_0x279979(0x185)]}}:{}};}const ocrRecognize={'service':'ocr','command':a34_0x1cdfdf(0x178),'description':a34_0x1cdfdf(0x152),'risk':a34_0x1cdfdf(0x16b),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x443d63){const _0xa9b3fd=a34_0x1cdfdf,_0x578043=normalizeScene(_0x443d63[_0xa9b3fd(0x155)](_0xa9b3fd(0x160))),_0x32db6d=SCENE_TO_LEGACY_TYPE[_0x578043],_0x329af4=validateInputSelection(_0x443d63);if(_0x329af4[_0xa9b3fd(0x16a)])return dryRun(_0xa9b3fd(0x170),_0xa9b3fd(0x174))[_0xa9b3fd(0x15e)]({'appCode':_0x443d63[_0xa9b3fd(0x159)],'url':_0x329af4[_0xa9b3fd(0x16a)],'type':_0x32db6d})['description'](_0xa9b3fd(0x17d)+_0x578043+_0xa9b3fd(0x165))[_0xa9b3fd(0x167)]();const _0x1cdcf3=requireRuntimeUploadFile(_0x329af4[_0xa9b3fd(0x17a)],'image-file');return dryRun('POST',_0xa9b3fd(0x151))[_0xa9b3fd(0x15e)]({'steps':[{'method':_0xa9b3fd(0x170),'url':_0xa9b3fd(0x151),'body':{'appCode':_0x443d63['appCode'],'multipart':{'file':_0x1cdcf3}}},{'method':_0xa9b3fd(0x170),'url':'/client/queryFileUrl','body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':'POST','url':_0xa9b3fd(0x174),'body':{'appCode':_0x443d63[_0xa9b3fd(0x159)],'url':_0xa9b3fd(0x164),'type':_0x32db6d}}]})[_0xa9b3fd(0x157)](_0xa9b3fd(0x171)+_0x578043+_0xa9b3fd(0x14d))['build']();},async 'execute'(_0x5797ab){const _0xdb445e=a34_0x1cdfdf,_0x43c774=normalizeScene(_0x5797ab[_0xdb445e(0x155)](_0xdb445e(0x160))),_0x5cde0b=SCENE_TO_LEGACY_TYPE[_0x43c774],_0x56ca9e=validateInputSelection(_0x5797ab);if(_0x56ca9e[_0xdb445e(0x16a)]){const _0x983300=await recognizeRuntimeOcr(_0x5797ab[_0xdb445e(0x159)],{'url':_0x56ca9e[_0xdb445e(0x16a)],'type':_0x5cde0b});return{'ok':!![],'data':withScene(_0x983300,_0x43c774)};}const _0x462d2b=requireRuntimeUploadFile(_0x56ca9e[_0xdb445e(0x17a)],'image-file'),_0x43ea31=await uploadRuntimeFile(_0x5797ab[_0xdb445e(0x159)],_0x462d2b[_0xdb445e(0x15a)]);if(!_0x43ea31[_0xdb445e(0x185)])throw CliErrors[_0xdb445e(0x156)](_0xdb445e(0x158));const _0xd4d831=await queryRuntimeFileUrl(_0x43ea31[_0xdb445e(0x185)],{'download':![]});if(!_0xd4d831[_0xdb445e(0x179)])throw CliErrors[_0xdb445e(0x156)](_0xdb445e(0x161));const _0x1e3641=await recognizeRuntimeOcr(_0x5797ab[_0xdb445e(0x159)],{'url':_0xd4d831[_0xdb445e(0x179)],'type':_0x5cde0b});return{'ok':!![],'data':withScene(_0x1e3641,_0x43c774,_0x43ea31)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
1
- const a35_0x38df6b=a35_0x3507;(function(_0x1351e1,_0x205342){const _0x455fa4=a35_0x3507,_0x5000b1=_0x1351e1();while(!![]){try{const _0x4881fd=-parseInt(_0x455fa4(0x1aa))/0x1+parseInt(_0x455fa4(0x1a5))/0x2+-parseInt(_0x455fa4(0x19c))/0x3+-parseInt(_0x455fa4(0x18e))/0x4*(-parseInt(_0x455fa4(0x190))/0x5)+parseInt(_0x455fa4(0x1b7))/0x6+-parseInt(_0x455fa4(0x1b6))/0x7+parseInt(_0x455fa4(0x199))/0x8;if(_0x4881fd===_0x205342)break;else _0x5000b1['push'](_0x5000b1['shift']());}catch(_0x4cfaba){_0x5000b1['push'](_0x5000b1['shift']());}}}(a35_0x24b0,0x775ad));import{existsSync,readFileSync,statSync}from'node:fs';function a35_0x24b0(){const _0x623e81=['File\x20not\x20found:\x20','validation','POST','isFile','Personal\x20BFF\x20script\x20ID','write','length','isArray','File\x20is\x20not\x20a\x20regular\x20file:\x20','6516363zXbISk','5156364wrGVLT','Preview:\x20update\x20personal\x20BFF\x20','description','Personal\x20BFF\x20script\x20file\x20is\x20blank.','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','Updated\x20personal\x20BFF\x20','Personal\x20BFF\x20description','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','functionName','test','scriptType','create','body','build','appCode','createTime','sourceSessionId','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','file','num','bool','config','/update','scriptContent','196524OpBaRs','flag','40KWkjJt','createUserId','keys','Show\x20one\x20personal\x20BFF\x20by\x20id','version','read','update','personal-bff','params','6853832xpHVFq','string','map','1052298xebLMW','utf8','source-session-id','name','gmtModified','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','updateTime','Executed\x20personal\x20BFF\x20','Update\x20a\x20personal\x20BFF\x20by\x20id','219108fYzyyI','--params\x20must\x20be\x20a\x20JSON\x20object.','str','trim','Preview:\x20create\x20personal\x20BFF\x20','448173bMSKoI','File\x20path\x20is\x20required.','Optional\x20source\x20RuntimeAgent\x20session\x20id'];a35_0x24b0=function(){return _0x623e81;};return a35_0x24b0();}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_0x38df6b(0x1c9),'type':a35_0x38df6b(0x19a),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0x38df6b(0x19f),'type':'string','required':!![],'description':a35_0x38df6b(0x1bb)},DESCRIPTION_FLAG={'name':a35_0x38df6b(0x1b9),'type':a35_0x38df6b(0x19a),'description':a35_0x38df6b(0x1bd)},SOURCE_SESSION_FLAG={'name':a35_0x38df6b(0x19e),'type':'string','description':a35_0x38df6b(0x1ac)};function normalizeFunctionName(_0x4e4873){const _0x4be84c=a35_0x38df6b,_0x55a50b=String(_0x4e4873||'')['trim']();if(!_0x55a50b||!FUNCTION_NAME_PATTERN[_0x4be84c(0x1c0)](_0x55a50b))throw CliErrors['validation'](_0x4be84c(0x1a1));return _0x55a50b;}function readScriptFile(_0x3de2ff){const _0x5a4399=a35_0x38df6b;if(!_0x3de2ff)throw CliErrors[_0x5a4399(0x1ae)](_0x5a4399(0x1ab));if(!existsSync(_0x3de2ff))throw CliErrors[_0x5a4399(0x1ae)](_0x5a4399(0x1ad)+_0x3de2ff);if(!statSync(_0x3de2ff)[_0x5a4399(0x1b0)]())throw CliErrors['validation'](_0x5a4399(0x1b5)+_0x3de2ff);const _0x16fc2f=readFileSync(_0x3de2ff,_0x5a4399(0x19d));if(!_0x16fc2f['trim']())throw CliErrors[_0x5a4399(0x1ae)](_0x5a4399(0x1ba));return _0x16fc2f;}function optionalTrimmed(_0xe38b07){const _0x9ecf3=a35_0x38df6b,_0x2a7bf3=String(_0xe38b07||'')[_0x9ecf3(0x1a8)]();return _0x2a7bf3||undefined;}function summarizeBff(_0x26f031){const _0x43ce88=a35_0x38df6b;return{'id':_0x26f031['id'],'appCode':_0x26f031[_0x43ce88(0x1c5)],'functionName':_0x26f031[_0x43ce88(0x1bf)],'description':_0x26f031[_0x43ce88(0x1b9)],'scriptType':_0x26f031[_0x43ce88(0x1c1)],'version':_0x26f031[_0x43ce88(0x194)],'gmtModified':_0x26f031[_0x43ce88(0x1a0)],'updateTime':_0x26f031['updateTime']};}function detailBff(_0x4ab51d){const _0x58de7d=a35_0x38df6b;return{'id':_0x4ab51d['id'],'appCode':_0x4ab51d[_0x58de7d(0x1c5)],'functionName':_0x4ab51d[_0x58de7d(0x1bf)],'description':_0x4ab51d['description'],'scriptType':_0x4ab51d['scriptType'],'scriptContent':_0x4ab51d[_0x58de7d(0x1ce)]??'','config':_0x4ab51d[_0x58de7d(0x1cc)],'version':_0x4ab51d[_0x58de7d(0x194)],'createUserId':_0x4ab51d[_0x58de7d(0x191)],'gmtCreate':_0x4ab51d['gmtCreate'],'gmtModified':_0x4ab51d[_0x58de7d(0x1a0)],'createTime':_0x4ab51d[_0x58de7d(0x1c6)],'updateTime':_0x4ab51d[_0x58de7d(0x1a2)]};}function buildCreateInput(_0x4bd7b4){const _0x42a953=a35_0x38df6b;return{'functionName':normalizeFunctionName(_0x4bd7b4[_0x42a953(0x1a7)]('name')),...optionalTrimmed(_0x4bd7b4[_0x42a953(0x1a7)]('description'))?{'description':optionalTrimmed(_0x4bd7b4[_0x42a953(0x1a7)]('description'))}:{},'scriptContent':readScriptFile(_0x4bd7b4[_0x42a953(0x1a7)]('file')),...optionalTrimmed(_0x4bd7b4[_0x42a953(0x1a7)](_0x42a953(0x19e)))?{'sourceSessionId':optionalTrimmed(_0x4bd7b4[_0x42a953(0x1a7)](_0x42a953(0x19e)))}:{}};}function buildUpdateInput(_0x245c41){const _0x202b00=a35_0x38df6b,_0x20ac3f={};optionalTrimmed(_0x245c41[_0x202b00(0x1a7)](_0x202b00(0x19f)))&&(_0x20ac3f[_0x202b00(0x1bf)]=normalizeFunctionName(_0x245c41[_0x202b00(0x1a7)](_0x202b00(0x19f))));_0x245c41[_0x202b00(0x18f)](_0x202b00(0x1b9))!==undefined&&(_0x20ac3f['description']=_0x245c41[_0x202b00(0x1a7)](_0x202b00(0x1b9)));optionalTrimmed(_0x245c41[_0x202b00(0x1a7)]('file'))&&(_0x20ac3f[_0x202b00(0x1ce)]=readScriptFile(_0x245c41[_0x202b00(0x1a7)](_0x202b00(0x1c9))));_0x245c41[_0x202b00(0x18f)](_0x202b00(0x19e))!==undefined&&(_0x20ac3f[_0x202b00(0x1c7)]=_0x245c41[_0x202b00(0x1a7)](_0x202b00(0x19e)));if(Object[_0x202b00(0x192)](_0x20ac3f)[_0x202b00(0x1b3)]===0x0)throw CliErrors['validation']('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x20ac3f;}function a35_0x3507(_0x53aacb,_0x46ebaa){_0x53aacb=_0x53aacb-0x18e;const _0x24b08c=a35_0x24b0();let _0x35079f=_0x24b08c[_0x53aacb];return _0x35079f;}function parseExecParams(_0x568876){const _0x1c489c=a35_0x38df6b,_0x274f61=parseJsonParams(_0x568876)??{};if(Array[_0x1c489c(0x1b4)](_0x274f61))throw CliErrors[_0x1c489c(0x1ae)](_0x1c489c(0x1a6));return _0x274f61;}const personalBffList={'service':a35_0x38df6b(0x197),'command':'list','description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0x38df6b(0x195),'flags':[VERBOSE_FLAG],async 'execute'(_0x45b9f9){const _0x59500c=a35_0x38df6b,_0x5b0537=await listPersonalBffs(_0x45b9f9['appCode']);return{'ok':!![],'data':{'total':_0x5b0537[_0x59500c(0x1b3)],'items':_0x45b9f9[_0x59500c(0x1cb)]('verbose')?_0x5b0537:_0x5b0537[_0x59500c(0x19b)](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':'detail','description':a35_0x38df6b(0x193),'risk':a35_0x38df6b(0x195),'flags':[{...ID_FLAG,'description':a35_0x38df6b(0x1b1)}],async 'execute'(_0x3fda54){const _0x3eaa6f=a35_0x38df6b,_0x3155d2=await getPersonalBff(_0x3fda54['num']('id'),_0x3fda54[_0x3eaa6f(0x1c5)]);return{'ok':!![],'data':detailBff(_0x3155d2)};}},personalBffCreate={'service':a35_0x38df6b(0x197),'command':a35_0x38df6b(0x1c2),'description':a35_0x38df6b(0x1be),'risk':a35_0x38df6b(0x1b2),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x2d1733){const _0x1faea7=a35_0x38df6b,_0x3a68e6=buildCreateInput(_0x2d1733),_0x4fc83c=await createPersonalBff(_0x2d1733[_0x1faea7(0x1c5)],_0x3a68e6);return{'ok':!![],'data':detailBff(_0x4fc83c),'message':'Created\x20personal\x20BFF\x20'+_0x4fc83c['id']+(_0x4fc83c[_0x1faea7(0x1bf)]?'\x20('+_0x4fc83c[_0x1faea7(0x1bf)]+')':'')};},async 'dryRun'(_0x3fd280){const _0x20621f=a35_0x38df6b,_0x45407d=buildCreateInput(_0x3fd280);return dryRun(_0x20621f(0x1af),'/client/runtime-bff/personal/create')[_0x20621f(0x1c3)]({'appCode':_0x3fd280[_0x20621f(0x1c5)],..._0x45407d})[_0x20621f(0x1b9)](_0x20621f(0x1a9)+_0x45407d[_0x20621f(0x1bf)])['build']();}},personalBffUpdate={'service':a35_0x38df6b(0x197),'command':a35_0x38df6b(0x196),'description':a35_0x38df6b(0x1a4),'risk':a35_0x38df6b(0x1b2),'flags':[{...ID_FLAG,'description':a35_0x38df6b(0x1b1)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x46dc90){const _0x41a7a0=a35_0x38df6b,_0x2e282c=_0x46dc90[_0x41a7a0(0x1ca)]('id'),_0x1d7d54=buildUpdateInput(_0x46dc90),_0x3f39d2=await updatePersonalBff(_0x2e282c,_0x46dc90[_0x41a7a0(0x1c5)],_0x1d7d54);return{'ok':!![],'data':detailBff(_0x3f39d2),'message':_0x41a7a0(0x1bc)+_0x3f39d2['id']+(_0x3f39d2[_0x41a7a0(0x1bf)]?'\x20('+_0x3f39d2[_0x41a7a0(0x1bf)]+')':'')};},async 'dryRun'(_0x2b7a2b){const _0x881fdf=a35_0x38df6b,_0x1012ed=_0x2b7a2b[_0x881fdf(0x1ca)]('id'),_0x3006c4=buildUpdateInput(_0x2b7a2b);return dryRun(_0x881fdf(0x1af),'/client/runtime-bff/personal/'+_0x1012ed+_0x881fdf(0x1cd))[_0x881fdf(0x1c3)]({'appCode':_0x2b7a2b['appCode'],..._0x3006c4})[_0x881fdf(0x1b9)](_0x881fdf(0x1b8)+_0x1012ed)[_0x881fdf(0x1c4)]();}},personalBffExec={'service':'personal-bff','command':'exec','description':'Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','risk':'high-risk-write','flags':[{...ID_FLAG,'description':a35_0x38df6b(0x1b1)},{...PARAMS_FLAG,'description':a35_0x38df6b(0x1c8)}],async 'validate'(_0x31c02a){const _0xe65015=a35_0x38df6b;parseExecParams(_0x31c02a[_0xe65015(0x1a7)](_0xe65015(0x198)));},async 'execute'(_0x102e8a){const _0x21175e=a35_0x38df6b,_0x2cdbb4=_0x102e8a[_0x21175e(0x1ca)]('id'),_0x5cb4d2=parseExecParams(_0x102e8a['str'](_0x21175e(0x198))),_0xed5f4e=await executePersonalBff(_0x2cdbb4,_0x102e8a[_0x21175e(0x1c5)],_0x5cb4d2);return{'ok':!![],'data':{'result':_0xed5f4e},'message':_0x21175e(0x1a3)+_0x2cdbb4};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a35_0xe987ff=a35_0x1436;(function(_0x2f9822,_0x2af292){const _0x1af91f=a35_0x1436,_0x1accba=_0x2f9822();while(!![]){try{const _0x430aaf=parseInt(_0x1af91f(0x17c))/0x1*(-parseInt(_0x1af91f(0x150))/0x2)+-parseInt(_0x1af91f(0x14e))/0x3+parseInt(_0x1af91f(0x14f))/0x4+parseInt(_0x1af91f(0x162))/0x5*(parseInt(_0x1af91f(0x171))/0x6)+-parseInt(_0x1af91f(0x16a))/0x7+parseInt(_0x1af91f(0x138))/0x8*(-parseInt(_0x1af91f(0x15c))/0x9)+parseInt(_0x1af91f(0x13c))/0xa*(parseInt(_0x1af91f(0x170))/0xb);if(_0x430aaf===_0x2af292)break;else _0x1accba['push'](_0x1accba['shift']());}catch(_0x2afdad){_0x1accba['push'](_0x1accba['shift']());}}}(a35_0xdc7f,0x259ce));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x1436(_0x2e297b,_0x2495b1){_0x2e297b=_0x2e297b-0x137;const _0xdc7f8a=a35_0xdc7f();let _0x14363d=_0xdc7f8a[_0x2e297b];return _0x14363d;}import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':a35_0xe987ff(0x13d),'description':a35_0xe987ff(0x156)},FUNCTION_NAME_FLAG={'name':'name','type':a35_0xe987ff(0x13d),'required':!![],'description':a35_0xe987ff(0x13b)},DESCRIPTION_FLAG={'name':a35_0xe987ff(0x13a),'type':'string','description':a35_0xe987ff(0x169)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0xe987ff(0x13d),'description':a35_0xe987ff(0x166)};function normalizeFunctionName(_0x3e074a){const _0x796658=a35_0xe987ff,_0x39670e=String(_0x3e074a||'')[_0x796658(0x16d)]();if(!_0x39670e||!FUNCTION_NAME_PATTERN[_0x796658(0x168)](_0x39670e))throw CliErrors[_0x796658(0x16b)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x39670e;}function a35_0xdc7f(){const _0x24af62=['47205TSZwMK','body','params','createTime','Executed\x20personal\x20BFF\x20','str','5AoaNMe','POST','name','/update','Optional\x20source\x20RuntimeAgent\x20session\x20id','write','test','Personal\x20BFF\x20description','1393294osNqPk','validation','Created\x20personal\x20BFF\x20','trim','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','Update\x20a\x20personal\x20BFF\x20by\x20id','14311sQLNMg','119754wjBjrX','create','config','/client/runtime-bff/personal/create','verbose','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','isFile','list','isArray','personal-bff','functionName','238197dWqywy','appCode','392UrxyNy','update','description','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','5570ZpoaYj','string','utf8','file','length','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','source-session-id','exec','File\x20path\x20is\x20required.','scriptType','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','Updated\x20personal\x20BFF\x20','high-risk-write','File\x20not\x20found:\x20','gmtModified','createUserId','build','read','518940UuFisZ','1106680DrHwSF','2RGdzLk','keys','num','Show\x20one\x20personal\x20BFF\x20by\x20id','/client/runtime-bff/personal/','version','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','Preview:\x20create\x20personal\x20BFF\x20','Preview:\x20update\x20personal\x20BFF\x20','map','Personal\x20BFF\x20script\x20ID','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file'];a35_0xdc7f=function(){return _0x24af62;};return a35_0xdc7f();}function readScriptFile(_0x3f3ece){const _0x3393ce=a35_0xe987ff;if(!_0x3f3ece)throw CliErrors[_0x3393ce(0x16b)](_0x3393ce(0x144));if(!existsSync(_0x3f3ece))throw CliErrors[_0x3393ce(0x16b)](_0x3393ce(0x149)+_0x3f3ece);if(!statSync(_0x3f3ece)[_0x3393ce(0x177)]())throw CliErrors[_0x3393ce(0x16b)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x3f3ece);const _0x143749=readFileSync(_0x3f3ece,_0x3393ce(0x13e));if(!_0x143749['trim']())throw CliErrors['validation']('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x143749;}function optionalTrimmed(_0x232392){const _0x2905ab=a35_0xe987ff,_0x20a9ed=String(_0x232392||'')[_0x2905ab(0x16d)]();return _0x20a9ed||undefined;}function summarizeBff(_0x3e8a44){const _0x2f1554=a35_0xe987ff;return{'id':_0x3e8a44['id'],'appCode':_0x3e8a44['appCode'],'functionName':_0x3e8a44[_0x2f1554(0x17b)],'description':_0x3e8a44['description'],'scriptType':_0x3e8a44[_0x2f1554(0x145)],'version':_0x3e8a44[_0x2f1554(0x155)],'gmtModified':_0x3e8a44[_0x2f1554(0x14a)],'updateTime':_0x3e8a44['updateTime']};}function detailBff(_0x54ff7e){const _0x58ffa3=a35_0xe987ff;return{'id':_0x54ff7e['id'],'appCode':_0x54ff7e[_0x58ffa3(0x137)],'functionName':_0x54ff7e['functionName'],'description':_0x54ff7e['description'],'scriptType':_0x54ff7e[_0x58ffa3(0x145)],'scriptContent':_0x54ff7e['scriptContent']??'','config':_0x54ff7e[_0x58ffa3(0x173)],'version':_0x54ff7e[_0x58ffa3(0x155)],'createUserId':_0x54ff7e[_0x58ffa3(0x14b)],'gmtCreate':_0x54ff7e['gmtCreate'],'gmtModified':_0x54ff7e['gmtModified'],'createTime':_0x54ff7e[_0x58ffa3(0x15f)],'updateTime':_0x54ff7e['updateTime']};}function buildCreateInput(_0x19c333){const _0x5dbb24=a35_0xe987ff;return{'functionName':normalizeFunctionName(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x164))),...optionalTrimmed(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x13a)))?{'description':optionalTrimmed(_0x19c333[_0x5dbb24(0x161)]('description'))}:{},'scriptContent':readScriptFile(_0x19c333[_0x5dbb24(0x161)]('file')),...optionalTrimmed(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x142)))?{'sourceSessionId':optionalTrimmed(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x142)))}:{}};}function buildUpdateInput(_0x2a1b68){const _0x5bcf9d=a35_0xe987ff,_0x135b9e={};optionalTrimmed(_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x164)))&&(_0x135b9e[_0x5bcf9d(0x17b)]=normalizeFunctionName(_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x164))));_0x2a1b68['flag'](_0x5bcf9d(0x13a))!==undefined&&(_0x135b9e[_0x5bcf9d(0x13a)]=_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x13a)));optionalTrimmed(_0x2a1b68['str'](_0x5bcf9d(0x13f)))&&(_0x135b9e['scriptContent']=readScriptFile(_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x13f))));_0x2a1b68['flag']('source-session-id')!==undefined&&(_0x135b9e['sourceSessionId']=_0x2a1b68[_0x5bcf9d(0x161)]('source-session-id'));if(Object[_0x5bcf9d(0x151)](_0x135b9e)[_0x5bcf9d(0x140)]===0x0)throw CliErrors[_0x5bcf9d(0x16b)](_0x5bcf9d(0x146));return _0x135b9e;}function parseExecParams(_0x169046){const _0x5c7972=a35_0xe987ff,_0x3697d6=parseJsonParams(_0x169046)??{};if(Array[_0x5c7972(0x179)](_0x3697d6))throw CliErrors[_0x5c7972(0x16b)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x3697d6;}const personalBffList={'service':'personal-bff','command':a35_0xe987ff(0x178),'description':a35_0xe987ff(0x141),'risk':a35_0xe987ff(0x14d),'flags':[VERBOSE_FLAG],async 'execute'(_0x28d6cd){const _0x3f66e4=a35_0xe987ff,_0x55b58b=await listPersonalBffs(_0x28d6cd['appCode']);return{'ok':!![],'data':{'total':_0x55b58b[_0x3f66e4(0x140)],'items':_0x28d6cd['bool'](_0x3f66e4(0x175))?_0x55b58b:_0x55b58b[_0x3f66e4(0x159)](summarizeBff)}};}},personalBffDetail={'service':a35_0xe987ff(0x17a),'command':'detail','description':a35_0xe987ff(0x153),'risk':a35_0xe987ff(0x14d),'flags':[{...ID_FLAG,'description':a35_0xe987ff(0x15a)}],async 'execute'(_0x4ee7dc){const _0xdee11=a35_0xe987ff,_0x2f8489=await getPersonalBff(_0x4ee7dc[_0xdee11(0x152)]('id'),_0x4ee7dc['appCode']);return{'ok':!![],'data':detailBff(_0x2f8489)};}},personalBffCreate={'service':'personal-bff','command':a35_0xe987ff(0x172),'description':a35_0xe987ff(0x15b),'risk':a35_0xe987ff(0x167),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xd5c95e){const _0x16b862=a35_0xe987ff,_0x30b2d7=buildCreateInput(_0xd5c95e),_0x5d16b7=await createPersonalBff(_0xd5c95e[_0x16b862(0x137)],_0x30b2d7);return{'ok':!![],'data':detailBff(_0x5d16b7),'message':_0x16b862(0x16c)+_0x5d16b7['id']+(_0x5d16b7[_0x16b862(0x17b)]?'\x20('+_0x5d16b7['functionName']+')':'')};},async 'dryRun'(_0x3e10c4){const _0x4f355e=a35_0xe987ff,_0x30d7a9=buildCreateInput(_0x3e10c4);return dryRun('POST',_0x4f355e(0x174))[_0x4f355e(0x15d)]({'appCode':_0x3e10c4[_0x4f355e(0x137)],..._0x30d7a9})[_0x4f355e(0x13a)](_0x4f355e(0x157)+_0x30d7a9['functionName'])['build']();}},personalBffUpdate={'service':'personal-bff','command':a35_0xe987ff(0x139),'description':a35_0xe987ff(0x16f),'risk':a35_0xe987ff(0x167),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x302917){const _0x1890b0=a35_0xe987ff,_0x586a8f=_0x302917[_0x1890b0(0x152)]('id'),_0x4db59d=buildUpdateInput(_0x302917),_0x14d988=await updatePersonalBff(_0x586a8f,_0x302917['appCode'],_0x4db59d);return{'ok':!![],'data':detailBff(_0x14d988),'message':_0x1890b0(0x147)+_0x14d988['id']+(_0x14d988[_0x1890b0(0x17b)]?'\x20('+_0x14d988[_0x1890b0(0x17b)]+')':'')};},async 'dryRun'(_0x9882b9){const _0x3935fa=a35_0xe987ff,_0x3e36b1=_0x9882b9[_0x3935fa(0x152)]('id'),_0x1a99a7=buildUpdateInput(_0x9882b9);return dryRun(_0x3935fa(0x163),_0x3935fa(0x154)+_0x3e36b1+_0x3935fa(0x165))[_0x3935fa(0x15d)]({'appCode':_0x9882b9[_0x3935fa(0x137)],..._0x1a99a7})[_0x3935fa(0x13a)](_0x3935fa(0x158)+_0x3e36b1)[_0x3935fa(0x14c)]();}},personalBffExec={'service':a35_0xe987ff(0x17a),'command':a35_0xe987ff(0x143),'description':a35_0xe987ff(0x176),'risk':a35_0xe987ff(0x148),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':a35_0xe987ff(0x16e)}],async 'validate'(_0x26a49f){const _0x5655a3=a35_0xe987ff;parseExecParams(_0x26a49f[_0x5655a3(0x161)](_0x5655a3(0x15e)));},async 'execute'(_0x3142de){const _0x4137db=a35_0xe987ff,_0x5d2057=_0x3142de[_0x4137db(0x152)]('id'),_0x37d54b=parseExecParams(_0x3142de[_0x4137db(0x161)](_0x4137db(0x15e))),_0x3a9e5a=await executePersonalBff(_0x5d2057,_0x3142de[_0x4137db(0x137)],_0x37d54b);return{'ok':!![],'data':{'result':_0x3a9e5a},'message':_0x4137db(0x160)+_0x5d2057};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a36_0x45f9fb=a36_0x131b;(function(_0x442c3f,_0x1a79c5){const _0x55b0d8=a36_0x131b,_0x4fc012=_0x442c3f();while(!![]){try{const _0x14dc3c=parseInt(_0x55b0d8(0xc6))/0x1*(parseInt(_0x55b0d8(0xc9))/0x2)+parseInt(_0x55b0d8(0xb2))/0x3+parseInt(_0x55b0d8(0xc7))/0x4*(parseInt(_0x55b0d8(0xcc))/0x5)+-parseInt(_0x55b0d8(0xb0))/0x6+parseInt(_0x55b0d8(0xcd))/0x7*(-parseInt(_0x55b0d8(0xb7))/0x8)+-parseInt(_0x55b0d8(0xc2))/0x9+parseInt(_0x55b0d8(0xbf))/0xa;if(_0x14dc3c===_0x1a79c5)break;else _0x4fc012['push'](_0x4fc012['shift']());}catch(_0x2239c4){_0x4fc012['push'](_0x4fc012['shift']());}}}(a36_0xb3f0,0x76adc));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';function a36_0x131b(_0x4b0f65,_0x4b5bb5){_0x4b0f65=_0x4b0f65-0xab;const _0xb3f05f=a36_0xb3f0();let _0x131b54=_0xb3f05f[_0x4b0f65];return _0x131b54;}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(_0x216b33){const _0x422e11=a36_0x131b;for(const _0x4bb716 of _0x216b33){definitions[_0x422e11(0xc8)](_0x4bb716[_0x422e11(0xc4)]+':'+_0x4bb716['command'],_0x4bb716);let _0x1efc5c=serviceGroups[_0x422e11(0xbd)](_0x4bb716[_0x422e11(0xc4)]);!_0x1efc5c&&(_0x1efc5c=[],serviceGroups[_0x422e11(0xc8)](_0x4bb716[_0x422e11(0xc4)],_0x1efc5c)),_0x1efc5c[_0x422e11(0xb6)](_0x4bb716);}}function registerService(_0xc2fb3,_0x37931c,_0x38d4f8){const _0x2f03e0=a36_0x131b;registerDefinitions(_0x37931c);const _0x17747e=_0x418c46=>_0x418c46===_0x2f03e0(0xd4)?'':_0x418c46==='write'?_0x2f03e0(0xd5):'\x20\x20[high-risk-write]',_0x40b6ec={'service':_0x37931c[0x0]['service'],'label':_0xc2fb3,'commands':_0x37931c[_0x2f03e0(0xc1)](_0x55c6c2=>({'command':_0x55c6c2[_0x2f03e0(0xce)],'description':_0x55c6c2['description'],'tag':_0x17747e(_0x55c6c2[_0x2f03e0(0xc0)])})),'defaultCommand':_0x38d4f8?.['defaultCommand']??(_0x38d4f8?.[_0x2f03e0(0xbb)]?_0x37931c[0x0][_0x2f03e0(0xce)]:undefined),'isSingleCommand':_0x38d4f8?.[_0x2f03e0(0xbb)]};serviceRegistry['push'](_0x40b6ec),serviceByName['set'](_0x40b6ec[_0x2f03e0(0xc4)],_0x40b6ec);}registerService(a36_0x45f9fb(0xad),authDefinitions,{'defaultCommand':a36_0x45f9fb(0xae)}),registerService('App\x20Management',appDefinitions,{'defaultCommand':'list'}),registerService(a36_0x45f9fb(0xb3),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a36_0x45f9fb(0xb4)}),registerService('API\x20Documentation',apiDocDefinitions),registerService(a36_0x45f9fb(0xca),datasetDefinitions),registerService(a36_0x45f9fb(0xc5),dataDefinitions),registerService(a36_0x45f9fb(0xd1),sqlDefinitions),registerService(a36_0x45f9fb(0xba),bffDefinitions),registerService(a36_0x45f9fb(0xd3),personalBffDefinitions),registerService(a36_0x45f9fb(0xb5),artifactDefinitions),registerService(a36_0x45f9fb(0xb8),fileDefinitions),registerService(a36_0x45f9fb(0xbe),ocrDefinitions),registerService(a36_0x45f9fb(0xc3),kbDefinitions),registerService(a36_0x45f9fb(0xbc),serviceDefinitions,{'defaultCommand':a36_0x45f9fb(0xb4)}),registerService(a36_0x45f9fb(0xaf),skillDefinitions,{'defaultCommand':a36_0x45f9fb(0xab)}),registerService(a36_0x45f9fb(0xb9),cliSkillDefinitions,{'defaultCommand':'install'}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':a36_0x45f9fb(0xb1),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x45f9fb(0xac),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a36_0x45f9fb(0xcb)});function a36_0xb3f0(){const _0x4841bb=['login','Skills','4832466GQNdkk','run','2300916ZshQbl','Workspace','list','Artifacts','push','8cyfACw','File','CLI\x20Built-in\x20Skill','BFF\x20Scripts','isSingleCommand','Service\x20Tree','get','OCR','1161950JdQMtB','risk','map','292464eplztp','Knowledge\x20Base','service','Instant\x20API','1GQwAQZ','854300KcIghX','set','1172040jjdNEh','Datasets','show','5ZrOzpu','2511229gDbRov','command','values','from','SQL\x20Queries','has','Personal\x20BFF','read','\x20\x20[write]','install','Schema','Authentication'];a36_0xb3f0=function(){return _0x4841bb;};return a36_0xb3f0();}export function findDefinition(_0x4e32bb,_0x446826){return definitions['get'](_0x4e32bb+':'+_0x446826);}export function isKnownService(_0x2083e7){const _0x182092=a36_0x45f9fb;return serviceByName[_0x182092(0xd2)](_0x2083e7);}export function getServiceEntry(_0x279f1d){const _0x5b3ce9=a36_0x45f9fb;return serviceByName[_0x5b3ce9(0xbd)](_0x279f1d);}export function getAllDefinitions(){const _0x500870=a36_0x45f9fb;return Array[_0x500870(0xd0)](definitions[_0x500870(0xcf)]());}
1
+ const a36_0x2c1c45=a36_0x1233;(function(_0x53bbee,_0x4eb7c5){const _0x5ac0a3=a36_0x1233,_0x5e9f1d=_0x53bbee();while(!![]){try{const _0x47388a=parseInt(_0x5ac0a3(0x158))/0x1*(parseInt(_0x5ac0a3(0x157))/0x2)+parseInt(_0x5ac0a3(0x178))/0x3+parseInt(_0x5ac0a3(0x16c))/0x4+-parseInt(_0x5ac0a3(0x159))/0x5*(-parseInt(_0x5ac0a3(0x168))/0x6)+parseInt(_0x5ac0a3(0x166))/0x7*(parseInt(_0x5ac0a3(0x15d))/0x8)+parseInt(_0x5ac0a3(0x151))/0x9*(-parseInt(_0x5ac0a3(0x167))/0xa)+parseInt(_0x5ac0a3(0x15a))/0xb*(-parseInt(_0x5ac0a3(0x169))/0xc);if(_0x47388a===_0x4eb7c5)break;else _0x5e9f1d['push'](_0x5e9f1d['shift']());}catch(_0x7a82d6){_0x5e9f1d['push'](_0x5e9f1d['shift']());}}}(a36_0x577f,0x3c220));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x59427e){const _0x51d2d5=a36_0x1233;for(const _0x5b6c62 of _0x59427e){definitions[_0x51d2d5(0x154)](_0x5b6c62[_0x51d2d5(0x156)]+':'+_0x5b6c62[_0x51d2d5(0x16b)],_0x5b6c62);let _0x58d881=serviceGroups[_0x51d2d5(0x14b)](_0x5b6c62[_0x51d2d5(0x156)]);!_0x58d881&&(_0x58d881=[],serviceGroups[_0x51d2d5(0x154)](_0x5b6c62[_0x51d2d5(0x156)],_0x58d881)),_0x58d881[_0x51d2d5(0x161)](_0x5b6c62);}}function a36_0x1233(_0x45b9ff,_0x561177){_0x45b9ff=_0x45b9ff-0x14b;const _0x577f69=a36_0x577f();let _0x123319=_0x577f69[_0x45b9ff];return _0x123319;}function a36_0x577f(){const _0x299109=['1757700gDfSkw','login','Schema','risk','write','Workspace','Datasets','has','BFF\x20Scripts','SQL\x20Queries','\x20\x20[write]','File','665631ykIfbQ','Knowledge\x20Base','get','Self\x20Update','defaultCommand','isSingleCommand','description','list','19809nFDxiG','Diagnostics','Runtime\x20App\x20Config','set','Authentication','service','2HvNtVR','195351TRbpgQ','10JvBbhG','11TIzKCL','Configuration','Personal\x20BFF','199272KENiCT','from','map','Instant\x20API','push','OCR','Service\x20Tree','show','App\x20Management','119gaNJDb','1850dOKNiF','34626hwhypU','7657908jWNeIf','install','command'];a36_0x577f=function(){return _0x299109;};return a36_0x577f();}function registerService(_0x4a3556,_0x9ff4df,_0x36a423){const _0x3b9072=a36_0x1233;registerDefinitions(_0x9ff4df);const _0x32f545=_0x54bc43=>_0x54bc43==='read'?'':_0x54bc43===_0x3b9072(0x170)?_0x3b9072(0x176):'\x20\x20[high-risk-write]',_0x37006f={'service':_0x9ff4df[0x0][_0x3b9072(0x156)],'label':_0x4a3556,'commands':_0x9ff4df[_0x3b9072(0x15f)](_0x799451=>({'command':_0x799451[_0x3b9072(0x16b)],'description':_0x799451[_0x3b9072(0x14f)],'tag':_0x32f545(_0x799451[_0x3b9072(0x16f)])})),'defaultCommand':_0x36a423?.[_0x3b9072(0x14d)]??(_0x36a423?.[_0x3b9072(0x14e)]?_0x9ff4df[0x0][_0x3b9072(0x16b)]:undefined),'isSingleCommand':_0x36a423?.['isSingleCommand']};serviceRegistry[_0x3b9072(0x161)](_0x37006f),serviceByName['set'](_0x37006f[_0x3b9072(0x156)],_0x37006f);}registerService(a36_0x2c1c45(0x155),authDefinitions,{'defaultCommand':a36_0x2c1c45(0x16d)}),registerService(a36_0x2c1c45(0x165),appDefinitions,{'defaultCommand':a36_0x2c1c45(0x150)}),registerService(a36_0x2c1c45(0x171),workspaceDefinitions),registerService(a36_0x2c1c45(0x153),appConfigDefinitions),registerService(a36_0x2c1c45(0x15b),configDefinitions,{'defaultCommand':'list'}),registerService('API\x20Documentation',apiDocDefinitions),registerService(a36_0x2c1c45(0x172),datasetDefinitions),registerService(a36_0x2c1c45(0x160),dataDefinitions),registerService(a36_0x2c1c45(0x175),sqlDefinitions),registerService(a36_0x2c1c45(0x174),bffDefinitions),registerService(a36_0x2c1c45(0x15c),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x2c1c45(0x177),fileDefinitions),registerService(a36_0x2c1c45(0x162),ocrDefinitions),registerService(a36_0x2c1c45(0x179),kbDefinitions),registerService(a36_0x2c1c45(0x163),serviceDefinitions,{'defaultCommand':a36_0x2c1c45(0x150)}),registerService('Skills',skillDefinitions,{'defaultCommand':a36_0x2c1c45(0x16a)}),registerService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a36_0x2c1c45(0x16a)}),registerService(a36_0x2c1c45(0x14c),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a36_0x2c1c45(0x152),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x2c1c45(0x16e),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a36_0x2c1c45(0x164)});export function findDefinition(_0xf21dc8,_0x998858){const _0x356b85=a36_0x2c1c45;return definitions[_0x356b85(0x14b)](_0xf21dc8+':'+_0x998858);}export function isKnownService(_0xd9ea17){const _0x2f9c1b=a36_0x2c1c45;return serviceByName[_0x2f9c1b(0x173)](_0xd9ea17);}export function getServiceEntry(_0x950e50){return serviceByName['get'](_0x950e50);}export function getAllDefinitions(){const _0x2e16d=a36_0x2c1c45;return Array[_0x2e16d(0x15e)](definitions['values']());}
@@ -1 +1 @@
1
- const a37_0x5437c0=a37_0x43c3;(function(_0x1c68dc,_0x377232){const _0x551de8=a37_0x43c3,_0xba6de6=_0x1c68dc();while(!![]){try{const _0x1f7af0=parseInt(_0x551de8(0x1cc))/0x1*(-parseInt(_0x551de8(0x1ce))/0x2)+parseInt(_0x551de8(0x1cb))/0x3+parseInt(_0x551de8(0x1d1))/0x4+parseInt(_0x551de8(0x1cf))/0x5*(parseInt(_0x551de8(0x1c9))/0x6)+parseInt(_0x551de8(0x1ca))/0x7+-parseInt(_0x551de8(0x1c7))/0x8+-parseInt(_0x551de8(0x1cd))/0x9*(parseInt(_0x551de8(0x1d0))/0xa);if(_0x1f7af0===_0x377232)break;else _0xba6de6['push'](_0xba6de6['shift']());}catch(_0x1fe55f){_0xba6de6['push'](_0xba6de6['shift']());}}}(a37_0x20c1,0x2cbc3));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x513e5f){const _0x40fe30=await buildSchemaPayload();return{'ok':!![],'data':_0x40fe30};}export const schemaDefinition={'service':'schema','command':'export','description':a37_0x5437c0(0x1c6),'risk':a37_0x5437c0(0x1c8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a37_0x43c3(_0x1be1ec,_0x2466fd){_0x1be1ec=_0x1be1ec-0x1c6;const _0x20c135=a37_0x20c1();let _0x43c343=_0x20c135[_0x1be1ec];return _0x43c343;}function a37_0x20c1(){const _0x2bfe15=['2subqcB','108099VeYeGL','118858MdoXpS','50ErzcAQ','570eTeCNQ','1296456mUPvuO','Export\x20machine-readable\x20command\x20schema\x20(JSON)','224392JaMEfs','read','39156hqjmun','1955828HujyYf','1037973ySGYrn'];a37_0x20c1=function(){return _0x2bfe15;};return a37_0x20c1();}
1
+ const a37_0x57c0ac=a37_0x34a4;(function(_0x46dde9,_0x2596a2){const _0x2498eb=a37_0x34a4,_0x28714a=_0x46dde9();while(!![]){try{const _0x2ee666=-parseInt(_0x2498eb(0x1d8))/0x1+parseInt(_0x2498eb(0x1d7))/0x2+parseInt(_0x2498eb(0x1d4))/0x3+-parseInt(_0x2498eb(0x1d9))/0x4+-parseInt(_0x2498eb(0x1d6))/0x5*(-parseInt(_0x2498eb(0x1da))/0x6)+-parseInt(_0x2498eb(0x1db))/0x7+parseInt(_0x2498eb(0x1dc))/0x8;if(_0x2ee666===_0x2596a2)break;else _0x28714a['push'](_0x28714a['shift']());}catch(_0x4d5a0a){_0x28714a['push'](_0x28714a['shift']());}}}(a37_0x2f9c,0x74500));function a37_0x34a4(_0x5b2129,_0x33c5eb){_0x5b2129=_0x5b2129-0x1d4;const _0x2f9cfd=a37_0x2f9c();let _0x34a45c=_0x2f9cfd[_0x5b2129];return _0x34a45c;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2281da){const _0x423867=await buildSchemaPayload();return{'ok':!![],'data':_0x423867};}export const schemaDefinition={'service':'schema','command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a37_0x57c0ac(0x1d5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a37_0x2f9c(){const _0x1374a7=['24Vxldwr','4026050wwMGLt','12890176lNUBFA','486189vIcHSk','read','776735VpubQf','468722qQPYCt','645373ilcwlL','3728580RnvZCX'];a37_0x2f9c=function(){return _0x1374a7;};return a37_0x2f9c();}
@@ -1 +1 @@
1
- (function(_0x4708ae,_0x3a4362){const _0x191034=a38_0x3cba,_0x48eaf7=_0x4708ae();while(!![]){try{const _0x1a279f=parseInt(_0x191034(0x1a9))/0x1+-parseInt(_0x191034(0x199))/0x2*(parseInt(_0x191034(0x177))/0x3)+-parseInt(_0x191034(0x189))/0x4*(-parseInt(_0x191034(0x18c))/0x5)+-parseInt(_0x191034(0x195))/0x6+parseInt(_0x191034(0x182))/0x7*(parseInt(_0x191034(0x1bc))/0x8)+parseInt(_0x191034(0x1a1))/0x9*(parseInt(_0x191034(0x1b7))/0xa)+-parseInt(_0x191034(0x1bf))/0xb*(parseInt(_0x191034(0x19d))/0xc);if(_0x1a279f===_0x3a4362)break;else _0x48eaf7['push'](_0x48eaf7['shift']());}catch(_0x785409){_0x48eaf7['push'](_0x48eaf7['shift']());}}}(a38_0x52be,0xb6a85));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(_0x51e521,_0x579907){const _0x590648=a38_0x3cba,_0x2c4bd5=listLocalServiceTrees();let _0x2de00b;for(const _0x459372 of _0x2c4bd5){const _0x28a47b=matchServiceTreeCommand(_0x459372,_0x51e521);if(!_0x28a47b)continue;(!_0x2de00b||_0x28a47b[_0x590648(0x1c8)]['fullPath'][_0x590648(0x17e)]>_0x2de00b['command'][_0x590648(0x1cc)][_0x590648(0x17e)])&&(_0x2de00b={'tree':_0x459372,'command':_0x28a47b[_0x590648(0x1c8)],'remainingArgs':_0x28a47b[_0x590648(0x1a3)]});}if(!_0x2de00b)return undefined;const _0x24be13={..._0x579907};return applyAppBinding(_0x2de00b['tree'],_0x2de00b[_0x590648(0x1c8)],_0x24be13),{'definition':buildDynamicCommandDefinition(_0x2de00b[_0x590648(0x1ae)],_0x2de00b[_0x590648(0x1c8)]),'args':_0x2de00b[_0x590648(0x1a3)],'flags':_0x24be13,'tree':_0x2de00b[_0x590648(0x1ae)],'command':_0x2de00b['command']};}export function generateDynamicServiceHelp(_0x121cbb){const _0x137dca=a38_0x3cba,_0x11d0ec=listLocalServiceTrees()[_0x137dca(0x18d)](_0x2b40b4=>_0x2b40b4[_0x137dca(0x1dd)][_0x137dca(0x179)]===_0x121cbb);if(!_0x11d0ec)return undefined;const _0x34175b=[CLI_BIN_NAME+'\x20'+_0x121cbb+_0x137dca(0x19a),'',_0x11d0ec[_0x137dca(0x1dd)][_0x137dca(0x1b1)]||_0x121cbb,_0x11d0ec[_0x137dca(0x1dd)]['description']?'\x20\x20'+_0x11d0ec[_0x137dca(0x1dd)][_0x137dca(0x1ad)]:'','',_0x137dca(0x1ba),..._0x11d0ec[_0x137dca(0x19e)][_0x137dca(0x197)](_0x167825=>{const _0x39d0b6=_0x137dca,_0x13577a=_0x167825[_0x39d0b6(0x1cc)]['slice'](0x1)[_0x39d0b6(0x1cf)]('\x20'),_0x5bbb14=_0x167825[_0x39d0b6(0x19b)]===_0x39d0b6(0x17b)?'':'\x20['+_0x167825[_0x39d0b6(0x19b)]+']';return'\x20\x20'+_0x13577a[_0x39d0b6(0x1c3)](0x18)+'\x20'+(_0x167825[_0x39d0b6(0x1ad)]||'')+_0x5bbb14;}),'',_0x137dca(0x1d7)+CLI_BIN_NAME+_0x137dca(0x1a5)+_0x121cbb+_0x137dca(0x1c7)][_0x137dca(0x1d9)](Boolean);return _0x34175b['join']('\x0a');}function a38_0x52be(){const _0x5a7580=['userName','8110nokKph','\x20\x20\x20\x20','nickname','Commands:','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','24cevENb','tableName','\x20\x20\x20\x20sqlCode:\x20','23815PlwBrj','envName','bffId','\x20\x20\x20\x20datasetCode:\x20','padEnd','bff','trim','\x20completed\x20in\x20','`\x20to\x20inspect\x20the\x20manifest.','command','context.','loginName','tenantCode','fullPath','username','\x20\x20\x20\x20command:\x20','join','bffCode','\x20->\x20','args','normalizedManifest','push','entries','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','Use\x20`','cliPath','filter','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','target','datatable','service','6972KEKzJf','number','code','Service\x20command\x20','read','now','flatMap','length','Run\x20service\x20command\x20','app','validation','3068667YSduks','SERVICE_TREE','ctx.','mapTo','employeeId','slice','appcode','2472608LUplZQ','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','operator','5NFZbgX','find','Cannot\x20resolve\x20datatable\x20\x22','source','type','appBindings','\x20\x20SERVICE\x20TREE\x20TARGET','Unsupported\x20service\x20target\x20kind:\x20','startsWith','5937702ThMWaJ','params','map','nickName','166eCwLwb','\x20<command>\x20[flags]','risk','boolean','5136EwSPPQ','commands','\x20requires\x20target.scriptName.','kind','7803RqLPpn','datasetCode','remainingArgs','appCode','\x20service\x20detail\x20--service\x20','\x20\x20MAP\x20TO','data','string','220862MlGjev','dbtableConfig','enum','env','description','tree','Preview\x20dynamic\x20service\x20command:\x20','sqlCode','name','scriptName','some','\x20requires\x20target.sqlCode.','userId'];a38_0x52be=function(){return _0x5a7580;};return a38_0x52be();}export function listDynamicServiceEntries(){const _0xf64055=a38_0x3cba;return listLocalServices()[_0xf64055(0x197)](_0x58fc90=>{const _0xbc5000=_0xf64055,_0x40253d=_0x58fc90[_0xbc5000(0x1d3)];return{'service':_0x40253d['service']['code'],'label':_0x40253d[_0xbc5000(0x1dd)][_0xbc5000(0x1b1)]||_0x40253d['service'][_0xbc5000(0x179)],'commands':_0x40253d[_0xbc5000(0x19e)][_0xbc5000(0x197)](_0xecb7d8=>({'command':dynamicCommandName(_0xecb7d8),'description':_0xecb7d8['description']||_0xbc5000(0x17f)+_0xecb7d8[_0xbc5000(0x1d8)],'tag':riskTag(_0xecb7d8[_0xbc5000(0x19b)])}))};});}export function getDynamicServiceEntry(_0x12852f){const _0x211674=a38_0x3cba;return listDynamicServiceEntries()[_0x211674(0x18d)](_0x511703=>_0x511703[_0x211674(0x1dd)]===_0x12852f);}export function listDynamicServiceDefinitions(_0x3402cc){const _0x964198=a38_0x3cba;return listLocalServiceTrees()['filter'](_0x24f771=>!_0x3402cc||_0x24f771[_0x964198(0x1dd)][_0x964198(0x179)]===_0x3402cc)[_0x964198(0x17d)](_0x3f2864=>_0x3f2864['commands'][_0x964198(0x197)](_0x3f543c=>buildDynamicCommandDefinition(_0x3f2864,_0x3f543c)));}export function getDynamicServiceDefinitions(_0x5b0123){const _0x311b36=a38_0x3cba,_0xab8d90=listDynamicServiceDefinitions(_0x5b0123);return _0xab8d90[_0x311b36(0x17e)]>0x0?_0xab8d90:undefined;}export function findDynamicServiceDefinition(_0x2a9604,_0x305beb){const _0x5ba9ed=a38_0x3cba;return listDynamicServiceDefinitions(_0x2a9604)[_0x5ba9ed(0x18d)](_0x4adcea=>_0x4adcea[_0x5ba9ed(0x1c8)]===_0x305beb);}export function buildDynamicCommandDefinition(_0x35474d,_0x4d6dba){const _0xa28773=a38_0x3cba;return{'service':_0x35474d['service'][_0xa28773(0x179)],'command':dynamicCommandName(_0x4d6dba),'description':_0x4d6dba[_0xa28773(0x1ad)]||_0xa28773(0x17f)+_0x4d6dba[_0xa28773(0x1d8)],'risk':_0x4d6dba[_0xa28773(0x19b)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x4d6dba[_0xa28773(0x1d2)][_0xa28773(0x197)](_0xaebafc=>({'name':_0xaebafc[_0xa28773(0x1b1)],'description':_0xaebafc['description']||_0xaebafc[_0xa28773(0x1b1)],'required':_0xaebafc['required']})),'flags':_0x4d6dba['flags'][_0xa28773(0x197)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x4d6dba),async 'dryRun'(_0x4e8baa){const _0x3f88df=_0xa28773,_0x1be72e=await compilePlan(_0x4d6dba,_0x4e8baa);return{'method':_0x3f88df(0x183),'url':_0x4d6dba['cliPath'],'body':{'target':targetPreview(_0x1be72e),'params':_0x1be72e['params']},'description':_0x3f88df(0x1af)+_0x4d6dba[_0x3f88df(0x1d8)]};},async 'execute'(_0x2877fe){const _0x3e2f86=_0xa28773,_0x5f376e=await compilePlan(_0x4d6dba,_0x2877fe),_0x275877=Date[_0x3e2f86(0x17c)](),_0x3c1a60=await executePlan(_0x5f376e,_0x4d6dba,_0x2877fe),_0x3820fe=Date[_0x3e2f86(0x17c)]()-_0x275877;return{'ok':!![],'data':{'service':_0x35474d[_0x3e2f86(0x1dd)],'command':_0x4d6dba[_0x3e2f86(0x1d8)],'target':targetPreview(_0x5f376e),'result':_0x3c1a60,'elapsed':_0x3820fe},'message':_0x3e2f86(0x17a)+_0x4d6dba[_0x3e2f86(0x1d8)]+_0x3e2f86(0x1c6)+_0x3820fe+'ms'};}};}function dynamicCommandName(_0x33fdac){const _0x335c91=a38_0x3cba;return _0x33fdac['fullPath'][_0x335c91(0x187)](0x1)[_0x335c91(0x1cf)]('\x20');}function riskTag(_0x3de8b7){return _0x3de8b7==='read'?'':'\x20\x20['+_0x3de8b7+']';}function flagToCommandFlag(_0x569ce4){const _0x2ab584=a38_0x3cba;return{'name':_0x569ce4['cliName'],'type':_0x569ce4[_0x2ab584(0x190)]==='json'?_0x2ab584(0x1a8):_0x569ce4[_0x2ab584(0x190)],'description':_0x569ce4[_0x2ab584(0x1ad)]||_0x569ce4['name'],'required':_0x569ce4['required'],'default':isPrimitiveFlagDefault(_0x569ce4['default'])?_0x569ce4['default']:undefined,'enum':_0x569ce4[_0x2ab584(0x1ab)]};}async function compilePlan(_0x5ca48e,_0x291b16){const _0x1b7579=a38_0x3cba;return compileServiceTreeCommand(_0x5ca48e,{'flags':_0x291b16['rawFlags'],'args':_0x291b16[_0x1b7579(0x1d2)],'context':await buildServiceContext(_0x5ca48e,_0x291b16)});}async function buildServiceContext(_0x3e764b,_0xe9abd8){const _0x4a379b=a38_0x3cba,_0xbd20b3={'appCode':_0xe9abd8[_0x4a379b(0x1a4)],'env':_0xe9abd8['envName'],'envName':_0xe9abd8[_0x4a379b(0x1c0)]};if(!usesRuntimeContext(_0x3e764b))return _0xbd20b3;const _0x805d42=await getLoginUserInfo(),_0x3fa279=pickFirst(_0x805d42[_0x4a379b(0x1b5)],_0x805d42['id']);return{..._0xbd20b3,'user':_0x805d42,'userId':_0x3fa279,'id':_0x805d42['id'],'username':pickFirst(_0x805d42[_0x4a379b(0x1cd)],_0x805d42[_0x4a379b(0x1b6)],_0x805d42[_0x4a379b(0x1ca)]),'userName':_0x805d42[_0x4a379b(0x1b6)],'nickname':pickFirst(_0x805d42[_0x4a379b(0x1b9)],_0x805d42[_0x4a379b(0x198)]),'nickName':_0x805d42[_0x4a379b(0x198)],'tenantCode':_0x805d42[_0x4a379b(0x1cb)],'employeeId':_0x805d42[_0x4a379b(0x186)]};}function usesRuntimeContext(_0x55f6e9){const _0x4d8007=a38_0x3cba;return _0x55f6e9['mapTo'][_0x4d8007(0x1b3)](_0xdf6a4d=>typeof _0xdf6a4d[_0x4d8007(0x18f)]===_0x4d8007(0x1a8)&&(_0xdf6a4d[_0x4d8007(0x18f)]['startsWith'](_0x4d8007(0x1c9))||_0xdf6a4d['source'][_0x4d8007(0x194)](_0x4d8007(0x184))));}function pickFirst(..._0x3447d5){return _0x3447d5['find'](_0x189033=>_0x189033!==undefined&&_0x189033!==null);}async function executePlan(_0x45a4db,_0x428e9b,_0x3ae45c){const _0x20359f=a38_0x3cba;if(_0x45a4db[_0x20359f(0x1a0)]===_0x20359f(0x1a7)){const _0x2d90da=await resolveDatasetCode(_0x45a4db,_0x428e9b,_0x3ae45c);return executeData(_0x2d90da,_0x45a4db[_0x20359f(0x1c8)],_0x45a4db['params']);}if(_0x45a4db[_0x20359f(0x1a0)]==='sql'){if(!_0x45a4db['sqlCode'])throw CliErrors[_0x20359f(0x181)]('Service\x20command\x20'+_0x428e9b[_0x20359f(0x1d8)]+_0x20359f(0x1b4));return executeSdkSql(_0x45a4db['sqlCode'],normalizeScalarParams(_0x45a4db[_0x20359f(0x196)]));}if(_0x45a4db[_0x20359f(0x1a0)]===_0x20359f(0x1c4)){const _0x28a895=_0x45a4db[_0x20359f(0x1b2)]||_0x45a4db['bffCode']||(_0x45a4db[_0x20359f(0x1c1)]==null?'':String(_0x45a4db['bffId']));if(!_0x28a895)throw CliErrors[_0x20359f(0x181)](_0x20359f(0x17a)+_0x428e9b[_0x20359f(0x1d8)]+_0x20359f(0x19f));return executeSdkBff(_0x28a895,_0x45a4db[_0x20359f(0x196)]);}throw CliErrors[_0x20359f(0x181)](_0x20359f(0x193)+_0x45a4db[_0x20359f(0x1a0)]);}async function resolveDatasetCode(_0x395540,_0x32e1d9,_0x53ea76){const _0x2a637f=a38_0x3cba;if(_0x395540[_0x2a637f(0x1a2)])return _0x395540[_0x2a637f(0x1a2)];if(!_0x395540[_0x2a637f(0x1dc)])throw CliErrors[_0x2a637f(0x181)](_0x2a637f(0x17a)+_0x32e1d9[_0x2a637f(0x1d8)]+_0x2a637f(0x1d6));const _0x2d0371=await listDatasets(_0x53ea76['appCode']),_0x433b24=_0x2d0371[_0x2a637f(0x18d)](_0x1c76d2=>_0x1c76d2[_0x2a637f(0x1aa)]?.[_0x2a637f(0x1bd)]===_0x395540[_0x2a637f(0x1dc)]);if(!_0x433b24?.['code'])throw CliErrors[_0x2a637f(0x181)](_0x2a637f(0x18e)+_0x395540['datatable']+_0x2a637f(0x18a)+_0x53ea76[_0x2a637f(0x1a4)]+'.',_0x2a637f(0x1da));return _0x433b24['code'];}function a38_0x3cba(_0x24300a,_0x14c0bf){_0x24300a=_0x24300a-0x177;const _0x52be6d=a38_0x52be();let _0x3cba45=_0x52be6d[_0x24300a];return _0x3cba45;}function applyAppBinding(_0xa837b7,_0x5dd15e,_0x129767){const _0x3b6cca=a38_0x3cba,_0x5a51df=_0x5dd15e[_0x3b6cca(0x1db)]['appRef'];if(!_0x5a51df)return;const _0x51b564=_0xa837b7[_0x3b6cca(0x191)][_0x5a51df];if(!_0x51b564)throw CliErrors[_0x3b6cca(0x181)]('Unknown\x20appRef\x20\x22'+_0x5a51df+'\x22\x20in\x20service\x20command\x20'+_0x5dd15e[_0x3b6cca(0x1d8)]+'.',_0x3b6cca(0x1bb));const _0x10d69c=_0x51b564[_0x3b6cca(0x188)]||_0x51b564[_0x3b6cca(0x1a4)];_0x10d69c&&!hasText(_0x129767[_0x3b6cca(0x188)])&&(_0x129767[_0x3b6cca(0x188)]=_0x10d69c),_0x51b564[_0x3b6cca(0x180)]&&!hasText(_0x129767[_0x3b6cca(0x180)])&&!hasText(_0x129767[_0x3b6cca(0x188)])&&(_0x129767['app']=_0x51b564['app']),_0x51b564[_0x3b6cca(0x1ac)]&&!hasText(_0x129767[_0x3b6cca(0x1ac)])&&(_0x129767[_0x3b6cca(0x1ac)]=_0x51b564[_0x3b6cca(0x1ac)]);}function renderDynamicCommandHelp(_0x41e7ab){const _0xa0607f=a38_0x3cba,_0x11e2c7=[_0xa0607f(0x192),'\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x41e7ab[_0xa0607f(0x1db)][_0xa0607f(0x1a0)],_0xa0607f(0x1ce)+_0x41e7ab[_0xa0607f(0x1db)][_0xa0607f(0x1c8)]];if(_0x41e7ab[_0xa0607f(0x1db)][_0xa0607f(0x1a2)])_0x11e2c7[_0xa0607f(0x1d4)](_0xa0607f(0x1c2)+_0x41e7ab[_0xa0607f(0x1db)][_0xa0607f(0x1a2)]);if(_0x41e7ab[_0xa0607f(0x1db)][_0xa0607f(0x1dc)])_0x11e2c7['push']('\x20\x20\x20\x20datatable:\x20'+_0x41e7ab[_0xa0607f(0x1db)][_0xa0607f(0x1dc)]);if(_0x41e7ab[_0xa0607f(0x1db)][_0xa0607f(0x1b0)])_0x11e2c7[_0xa0607f(0x1d4)](_0xa0607f(0x1be)+_0x41e7ab[_0xa0607f(0x1db)][_0xa0607f(0x1b0)]);if(_0x41e7ab[_0xa0607f(0x1db)]['scriptName'])_0x11e2c7[_0xa0607f(0x1d4)]('\x20\x20\x20\x20scriptName:\x20'+_0x41e7ab[_0xa0607f(0x1db)][_0xa0607f(0x1b2)]);if(_0x41e7ab[_0xa0607f(0x185)][_0xa0607f(0x17e)]>0x0){_0x11e2c7[_0xa0607f(0x1d4)]('',_0xa0607f(0x1a6));for(const _0x3a2fc2 of _0x41e7ab[_0xa0607f(0x185)]){_0x11e2c7[_0xa0607f(0x1d4)](_0xa0607f(0x1b8)+(_0x3a2fc2[_0xa0607f(0x18f)]||'const')+_0xa0607f(0x1d1)+_0x3a2fc2[_0xa0607f(0x1db)]+(_0x3a2fc2[_0xa0607f(0x18b)]?'.'+_0x3a2fc2[_0xa0607f(0x18b)]:''));}}return _0x11e2c7['join']('\x0a');}function targetPreview(_0x20184e){const _0x340389=a38_0x3cba;return{'kind':_0x20184e['kind'],'command':_0x20184e[_0x340389(0x1c8)],'appRef':_0x20184e['appRef'],'datasetCode':_0x20184e['datasetCode'],'datatable':_0x20184e['datatable'],'sqlCode':_0x20184e['sqlCode'],'bffCode':_0x20184e[_0x340389(0x1d0)],'bffId':_0x20184e[_0x340389(0x1c1)],'scriptName':_0x20184e['scriptName']};}function normalizeScalarParams(_0x277739){const _0x1428bc=a38_0x3cba;return Object['fromEntries'](Object[_0x1428bc(0x1d5)](_0x277739)[_0x1428bc(0x1d9)](([,_0xb14bd2])=>typeof _0xb14bd2===_0x1428bc(0x1a8)||typeof _0xb14bd2===_0x1428bc(0x178)));}function hasText(_0x3cdf1b){const _0x366559=a38_0x3cba;return typeof _0x3cdf1b===_0x366559(0x1a8)&&_0x3cdf1b[_0x366559(0x1c5)]()[_0x366559(0x17e)]>0x0;}function isPrimitiveFlagDefault(_0xdc8a6f){const _0x2e5bd8=a38_0x3cba;return _0xdc8a6f===undefined||typeof _0xdc8a6f===_0x2e5bd8(0x1a8)||typeof _0xdc8a6f==='number'||typeof _0xdc8a6f===_0x2e5bd8(0x19c);}
1
+ (function(_0xcf2a27,_0x1be363){const _0x17a60b=a38_0xd068,_0x17009c=_0xcf2a27();while(!![]){try{const _0x27f4ca=-parseInt(_0x17a60b(0x130))/0x1+parseInt(_0x17a60b(0x149))/0x2*(parseInt(_0x17a60b(0x151))/0x3)+parseInt(_0x17a60b(0x176))/0x4+-parseInt(_0x17a60b(0x150))/0x5*(-parseInt(_0x17a60b(0x17b))/0x6)+-parseInt(_0x17a60b(0x170))/0x7+-parseInt(_0x17a60b(0x135))/0x8+parseInt(_0x17a60b(0x12f))/0x9;if(_0x27f4ca===_0x1be363)break;else _0x17009c['push'](_0x17009c['shift']());}catch(_0x21d5b9){_0x17009c['push'](_0x17009c['shift']());}}}(a38_0x58e8,0x7fd58));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';function a38_0xd068(_0x43e997,_0x5047fe){_0x43e997=_0x43e997-0x11a;const _0x58e864=a38_0x58e8();let _0xd068d4=_0x58e864[_0x43e997];return _0xd068d4;}import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x11e05c,_0x1dd20c){const _0xa3f930=a38_0xd068,_0x391576=listLocalServiceTrees();let _0x4c4c6e;for(const _0x41b514 of _0x391576){const _0xb43d22=matchServiceTreeCommand(_0x41b514,_0x11e05c);if(!_0xb43d22)continue;(!_0x4c4c6e||_0xb43d22[_0xa3f930(0x174)][_0xa3f930(0x159)]['length']>_0x4c4c6e[_0xa3f930(0x174)]['fullPath'][_0xa3f930(0x145)])&&(_0x4c4c6e={'tree':_0x41b514,'command':_0xb43d22[_0xa3f930(0x174)],'remainingArgs':_0xb43d22[_0xa3f930(0x13e)]});}if(!_0x4c4c6e)return undefined;const _0x1811ee={..._0x1dd20c};return applyAppBinding(_0x4c4c6e['tree'],_0x4c4c6e[_0xa3f930(0x174)],_0x1811ee),{'definition':buildDynamicCommandDefinition(_0x4c4c6e[_0xa3f930(0x120)],_0x4c4c6e['command']),'args':_0x4c4c6e[_0xa3f930(0x13e)],'flags':_0x1811ee,'tree':_0x4c4c6e['tree'],'command':_0x4c4c6e['command']};}export function generateDynamicServiceHelp(_0x24d451){const _0x170ebf=a38_0xd068,_0x1b219d=listLocalServiceTrees()['find'](_0x579889=>_0x579889[_0x170ebf(0x167)][_0x170ebf(0x137)]===_0x24d451);if(!_0x1b219d)return undefined;const _0x308cd3=[CLI_BIN_NAME+'\x20'+_0x24d451+_0x170ebf(0x169),'',_0x1b219d[_0x170ebf(0x167)][_0x170ebf(0x156)]||_0x24d451,_0x1b219d[_0x170ebf(0x167)][_0x170ebf(0x141)]?'\x20\x20'+_0x1b219d[_0x170ebf(0x167)][_0x170ebf(0x141)]:'','',_0x170ebf(0x15a),..._0x1b219d['commands'][_0x170ebf(0x11e)](_0x9297ad=>{const _0x31e3d4=_0x170ebf,_0x32a77e=_0x9297ad[_0x31e3d4(0x159)][_0x31e3d4(0x124)](0x1)[_0x31e3d4(0x165)]('\x20'),_0x387782=_0x9297ad[_0x31e3d4(0x13c)]===_0x31e3d4(0x12a)?'':'\x20['+_0x9297ad['risk']+']';return'\x20\x20'+_0x32a77e['padEnd'](0x18)+'\x20'+(_0x9297ad[_0x31e3d4(0x141)]||'')+_0x387782;}),'','Use\x20`'+CLI_BIN_NAME+_0x170ebf(0x123)+_0x24d451+'`\x20to\x20inspect\x20the\x20manifest.'][_0x170ebf(0x133)](Boolean);return _0x308cd3[_0x170ebf(0x165)]('\x0a');}export function listDynamicServiceEntries(){const _0x2827da=a38_0xd068;return listLocalServices()[_0x2827da(0x11e)](_0x49a736=>{const _0xe0a92a=_0x2827da,_0x52faa9=_0x49a736[_0xe0a92a(0x11a)];return{'service':_0x52faa9['service']['code'],'label':_0x52faa9['service']['name']||_0x52faa9[_0xe0a92a(0x167)][_0xe0a92a(0x137)],'commands':_0x52faa9[_0xe0a92a(0x11f)]['map'](_0x36e22a=>({'command':dynamicCommandName(_0x36e22a),'description':_0x36e22a[_0xe0a92a(0x141)]||_0xe0a92a(0x16e)+_0x36e22a[_0xe0a92a(0x178)],'tag':riskTag(_0x36e22a['risk'])}))};});}export function getDynamicServiceEntry(_0x2f7555){const _0x38ed3a=a38_0xd068;return listDynamicServiceEntries()['find'](_0x14188a=>_0x14188a[_0x38ed3a(0x167)]===_0x2f7555);}export function listDynamicServiceDefinitions(_0x1c7d43){const _0x492e38=a38_0xd068;return listLocalServiceTrees()[_0x492e38(0x133)](_0x5b0ae3=>!_0x1c7d43||_0x5b0ae3[_0x492e38(0x167)]['code']===_0x1c7d43)[_0x492e38(0x14b)](_0x3f24a7=>_0x3f24a7[_0x492e38(0x11f)][_0x492e38(0x11e)](_0x5c99a3=>buildDynamicCommandDefinition(_0x3f24a7,_0x5c99a3)));}export function getDynamicServiceDefinitions(_0x3570f9){const _0x3dbe76=listDynamicServiceDefinitions(_0x3570f9);return _0x3dbe76['length']>0x0?_0x3dbe76:undefined;}export function findDynamicServiceDefinition(_0x452785,_0x4d1bab){const _0xc17b92=a38_0xd068;return listDynamicServiceDefinitions(_0x452785)[_0xc17b92(0x138)](_0x5c2d95=>_0x5c2d95[_0xc17b92(0x174)]===_0x4d1bab);}export function buildDynamicCommandDefinition(_0x41e88b,_0x3a4a9f){const _0x23bd5c=a38_0xd068;return{'service':_0x41e88b[_0x23bd5c(0x167)][_0x23bd5c(0x137)],'command':dynamicCommandName(_0x3a4a9f),'description':_0x3a4a9f[_0x23bd5c(0x141)]||_0x23bd5c(0x16e)+_0x3a4a9f[_0x23bd5c(0x178)],'risk':_0x3a4a9f[_0x23bd5c(0x13c)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3a4a9f['args']['map'](_0x5cafd8=>({'name':_0x5cafd8[_0x23bd5c(0x156)],'description':_0x5cafd8[_0x23bd5c(0x141)]||_0x5cafd8[_0x23bd5c(0x156)],'required':_0x5cafd8[_0x23bd5c(0x142)]})),'flags':_0x3a4a9f[_0x23bd5c(0x13d)][_0x23bd5c(0x11e)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3a4a9f),async 'dryRun'(_0x54f568){const _0x268949=_0x23bd5c,_0x4e9953=await compilePlan(_0x3a4a9f,_0x54f568);return{'method':_0x268949(0x136),'url':_0x3a4a9f['cliPath'],'body':{'target':targetPreview(_0x4e9953),'params':_0x4e9953['params']},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x3a4a9f['cliPath']};},async 'execute'(_0x5aeee2){const _0x31ef3f=_0x23bd5c,_0x5a5cbe=await compilePlan(_0x3a4a9f,_0x5aeee2),_0x2323ca=Date[_0x31ef3f(0x166)](),_0x442398=await executePlan(_0x5a5cbe,_0x3a4a9f,_0x5aeee2),_0x2ace76=Date[_0x31ef3f(0x166)]()-_0x2323ca;return{'ok':!![],'data':{'service':_0x41e88b['service'],'command':_0x3a4a9f['cliPath'],'target':targetPreview(_0x5a5cbe),'result':_0x442398,'elapsed':_0x2ace76},'message':_0x31ef3f(0x15b)+_0x3a4a9f[_0x31ef3f(0x178)]+'\x20completed\x20in\x20'+_0x2ace76+'ms'};}};}function dynamicCommandName(_0x16ffbc){const _0x3f7876=a38_0xd068;return _0x16ffbc[_0x3f7876(0x159)][_0x3f7876(0x124)](0x1)[_0x3f7876(0x165)]('\x20');}function riskTag(_0x39d6cc){return _0x39d6cc==='read'?'':'\x20\x20['+_0x39d6cc+']';}function flagToCommandFlag(_0x1996f8){const _0x2542e7=a38_0xd068;return{'name':_0x1996f8[_0x2542e7(0x121)],'type':_0x1996f8[_0x2542e7(0x143)]===_0x2542e7(0x144)?_0x2542e7(0x11d):_0x1996f8[_0x2542e7(0x143)],'description':_0x1996f8[_0x2542e7(0x141)]||_0x1996f8['name'],'required':_0x1996f8[_0x2542e7(0x142)],'default':isPrimitiveFlagDefault(_0x1996f8[_0x2542e7(0x14e)])?_0x1996f8[_0x2542e7(0x14e)]:undefined,'enum':_0x1996f8[_0x2542e7(0x171)]};}async function compilePlan(_0x560f0c,_0x234d5d){return compileServiceTreeCommand(_0x560f0c,{'flags':_0x234d5d['rawFlags'],'args':_0x234d5d['args'],'context':await buildServiceContext(_0x560f0c,_0x234d5d)});}async function buildServiceContext(_0x5e7a5a,_0x116b81){const _0x29bc0b=a38_0xd068,_0x2c96ce={'appCode':_0x116b81[_0x29bc0b(0x16d)],'env':_0x116b81[_0x29bc0b(0x153)],'envName':_0x116b81[_0x29bc0b(0x153)]};if(!usesRuntimeContext(_0x5e7a5a))return _0x2c96ce;const _0x3d7a62=await getLoginUserInfo(),_0x119f36=pickFirst(_0x3d7a62[_0x29bc0b(0x162)],_0x3d7a62['id']);return{..._0x2c96ce,'user':_0x3d7a62,'userId':_0x119f36,'id':_0x3d7a62['id'],'username':pickFirst(_0x3d7a62[_0x29bc0b(0x152)],_0x3d7a62[_0x29bc0b(0x131)],_0x3d7a62[_0x29bc0b(0x14d)]),'userName':_0x3d7a62['userName'],'nickname':pickFirst(_0x3d7a62[_0x29bc0b(0x12d)],_0x3d7a62[_0x29bc0b(0x140)]),'nickName':_0x3d7a62[_0x29bc0b(0x140)],'tenantCode':_0x3d7a62[_0x29bc0b(0x15c)],'employeeId':_0x3d7a62[_0x29bc0b(0x163)]};}function usesRuntimeContext(_0x58fe99){const _0x85bdfd=a38_0xd068;return _0x58fe99[_0x85bdfd(0x164)][_0x85bdfd(0x128)](_0x38e783=>typeof _0x38e783[_0x85bdfd(0x158)]===_0x85bdfd(0x11d)&&(_0x38e783[_0x85bdfd(0x158)][_0x85bdfd(0x15d)](_0x85bdfd(0x14c))||_0x38e783[_0x85bdfd(0x158)][_0x85bdfd(0x15d)](_0x85bdfd(0x14f))));}function pickFirst(..._0x27b75f){const _0x18703f=a38_0xd068;return _0x27b75f[_0x18703f(0x138)](_0x148557=>_0x148557!==undefined&&_0x148557!==null);}async function executePlan(_0x53737f,_0x2e1cba,_0x518f30){const _0x558827=a38_0xd068;if(_0x53737f['kind']===_0x558827(0x177)){const _0x24e447=await resolveDatasetCode(_0x53737f,_0x2e1cba,_0x518f30);return executeData(_0x24e447,_0x53737f['command'],_0x53737f[_0x558827(0x11c)]);}if(_0x53737f['kind']===_0x558827(0x155)){if(!_0x53737f[_0x558827(0x179)])throw CliErrors[_0x558827(0x134)]('Service\x20command\x20'+_0x2e1cba[_0x558827(0x178)]+_0x558827(0x15e));return executeSdkSql(_0x53737f['sqlCode'],normalizeScalarParams(_0x53737f[_0x558827(0x11c)]));}if(_0x53737f['kind']===_0x558827(0x12b)){const _0x2528b0=_0x53737f[_0x558827(0x168)]||_0x53737f[_0x558827(0x126)]||(_0x53737f[_0x558827(0x16b)]==null?'':String(_0x53737f[_0x558827(0x16b)]));if(!_0x2528b0)throw CliErrors[_0x558827(0x134)](_0x558827(0x15b)+_0x2e1cba[_0x558827(0x178)]+_0x558827(0x172));return executeSdkBff(_0x2528b0,_0x53737f['params']);}throw CliErrors[_0x558827(0x134)](_0x558827(0x154)+_0x53737f[_0x558827(0x16a)]);}function a38_0x58e8(){const _0xa3e8f7=['default','ctx.','312105BdOLSY','166857irBLTx','username','envName','Unsupported\x20service\x20target\x20kind:\x20','sql','name','\x20\x20\x20\x20datatable:\x20','source','fullPath','Commands:','Service\x20command\x20','tenantCode','startsWith','\x20requires\x20target.sqlCode.','app','\x20\x20\x20\x20command:\x20','datatable','userId','employeeId','mapTo','join','now','service','scriptName','\x20<command>\x20[flags]','kind','bffId','\x20->\x20','appCode','Run\x20service\x20command\x20','datasetCode','6636224rSVmFt','enum','\x20requires\x20target.scriptName.','dbtableConfig','command','trim','416388KhbqBP','data','cliPath','sqlCode','appRef','30vfudPG','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','normalizedManifest','env','params','string','map','commands','tree','cliName','number','\x20service\x20detail\x20--service\x20','slice','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','bffCode','Cannot\x20resolve\x20datatable\x20\x22','some','target','read','bff','\x20\x20SERVICE\x20TREE\x20TARGET','nickname','appBindings','11723247QOEqNp','306089cUoLlc','userName','push','filter','validation','863304IPWnvE','SERVICE_TREE','code','find','\x20\x20\x20\x20scriptName:\x20','Unknown\x20appRef\x20\x22','\x20\x20\x20\x20kind:\x20\x20\x20\x20','risk','flags','remainingArgs','appcode','nickName','description','required','type','json','length','operator','entries','\x20\x20\x20\x20sqlCode:\x20','6pRMvHh','\x20\x20\x20\x20datasetCode:\x20','flatMap','context.','loginName'];a38_0x58e8=function(){return _0xa3e8f7;};return a38_0x58e8();}async function resolveDatasetCode(_0x7bcf29,_0x2f8ba0,_0x4a1085){const _0x54fbc7=a38_0xd068;if(_0x7bcf29[_0x54fbc7(0x16f)])return _0x7bcf29[_0x54fbc7(0x16f)];if(!_0x7bcf29[_0x54fbc7(0x161)])throw CliErrors[_0x54fbc7(0x134)]('Service\x20command\x20'+_0x2f8ba0[_0x54fbc7(0x178)]+_0x54fbc7(0x17c));const _0x4bda95=await listDatasets(_0x4a1085[_0x54fbc7(0x16d)]),_0x5140f2=_0x4bda95[_0x54fbc7(0x138)](_0x1f457d=>_0x1f457d[_0x54fbc7(0x173)]?.['tableName']===_0x7bcf29[_0x54fbc7(0x161)]);if(!_0x5140f2?.[_0x54fbc7(0x137)])throw CliErrors[_0x54fbc7(0x134)](_0x54fbc7(0x127)+_0x7bcf29['datatable']+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x4a1085[_0x54fbc7(0x16d)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x5140f2[_0x54fbc7(0x137)];}function applyAppBinding(_0x396c9a,_0x418395,_0x1bdc73){const _0x401efc=a38_0xd068,_0x35cf35=_0x418395[_0x401efc(0x129)][_0x401efc(0x17a)];if(!_0x35cf35)return;const _0x52c134=_0x396c9a[_0x401efc(0x12e)][_0x35cf35];if(!_0x52c134)throw CliErrors['validation'](_0x401efc(0x13a)+_0x35cf35+'\x22\x20in\x20service\x20command\x20'+_0x418395[_0x401efc(0x178)]+'.',_0x401efc(0x125));const _0xddaa30=_0x52c134['appcode']||_0x52c134[_0x401efc(0x16d)];_0xddaa30&&!hasText(_0x1bdc73[_0x401efc(0x13f)])&&(_0x1bdc73[_0x401efc(0x13f)]=_0xddaa30),_0x52c134['app']&&!hasText(_0x1bdc73['app'])&&!hasText(_0x1bdc73[_0x401efc(0x13f)])&&(_0x1bdc73[_0x401efc(0x15f)]=_0x52c134[_0x401efc(0x15f)]),_0x52c134[_0x401efc(0x11b)]&&!hasText(_0x1bdc73[_0x401efc(0x11b)])&&(_0x1bdc73[_0x401efc(0x11b)]=_0x52c134[_0x401efc(0x11b)]);}function renderDynamicCommandHelp(_0xc37e63){const _0x4af61e=a38_0xd068,_0x1c28b2=[_0x4af61e(0x12c),_0x4af61e(0x13b)+_0xc37e63['target'][_0x4af61e(0x16a)],_0x4af61e(0x160)+_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x174)]];if(_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x16f)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x14a)+_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x16f)]);if(_0xc37e63['target'][_0x4af61e(0x161)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x157)+_0xc37e63['target'][_0x4af61e(0x161)]);if(_0xc37e63['target'][_0x4af61e(0x179)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x148)+_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x179)]);if(_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x168)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x139)+_0xc37e63['target'][_0x4af61e(0x168)]);if(_0xc37e63[_0x4af61e(0x164)][_0x4af61e(0x145)]>0x0){_0x1c28b2[_0x4af61e(0x132)]('','\x20\x20MAP\x20TO');for(const _0x3419ea of _0xc37e63[_0x4af61e(0x164)]){_0x1c28b2['push']('\x20\x20\x20\x20'+(_0x3419ea[_0x4af61e(0x158)]||'const')+_0x4af61e(0x16c)+_0x3419ea[_0x4af61e(0x129)]+(_0x3419ea[_0x4af61e(0x146)]?'.'+_0x3419ea[_0x4af61e(0x146)]:''));}}return _0x1c28b2[_0x4af61e(0x165)]('\x0a');}function targetPreview(_0x313576){const _0x59cceb=a38_0xd068;return{'kind':_0x313576[_0x59cceb(0x16a)],'command':_0x313576['command'],'appRef':_0x313576['appRef'],'datasetCode':_0x313576[_0x59cceb(0x16f)],'datatable':_0x313576[_0x59cceb(0x161)],'sqlCode':_0x313576[_0x59cceb(0x179)],'bffCode':_0x313576[_0x59cceb(0x126)],'bffId':_0x313576[_0x59cceb(0x16b)],'scriptName':_0x313576['scriptName']};}function normalizeScalarParams(_0xc612ec){const _0x2f26cd=a38_0xd068;return Object['fromEntries'](Object[_0x2f26cd(0x147)](_0xc612ec)['filter'](([,_0x3b3ac2])=>typeof _0x3b3ac2==='string'||typeof _0x3b3ac2===_0x2f26cd(0x122)));}function hasText(_0x185573){const _0x3835ce=a38_0xd068;return typeof _0x185573==='string'&&_0x185573[_0x3835ce(0x175)]()[_0x3835ce(0x145)]>0x0;}function isPrimitiveFlagDefault(_0x35bdfa){const _0x1c8c86=a38_0xd068;return _0x35bdfa===undefined||typeof _0x35bdfa===_0x1c8c86(0x11d)||typeof _0x35bdfa===_0x1c8c86(0x122)||typeof _0x35bdfa==='boolean';}
@@ -1 +1 @@
1
- const a39_0x12b746=a39_0x1127;(function(_0x58f4ad,_0x2357e7){const _0x13f675=a39_0x1127,_0x987e54=_0x58f4ad();while(!![]){try{const _0x541d78=parseInt(_0x13f675(0x186))/0x1+-parseInt(_0x13f675(0x196))/0x2*(-parseInt(_0x13f675(0x177))/0x3)+-parseInt(_0x13f675(0x15f))/0x4+-parseInt(_0x13f675(0x192))/0x5+parseInt(_0x13f675(0x172))/0x6*(-parseInt(_0x13f675(0x18e))/0x7)+-parseInt(_0x13f675(0x159))/0x8*(-parseInt(_0x13f675(0x16e))/0x9)+-parseInt(_0x13f675(0x156))/0xa*(-parseInt(_0x13f675(0x187))/0xb);if(_0x541d78===_0x2357e7)break;else _0x987e54['push'](_0x987e54['shift']());}catch(_0x353968){_0x987e54['push'](_0x987e54['shift']());}}}(a39_0x5370,0x2fded));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a39_0x1127(_0x1b38d5,_0x584f29){_0x1b38d5=_0x1b38d5-0x155;const _0x5370eb=a39_0x5370();let _0x1127ad=_0x5370eb[_0x1b38d5];return _0x1127ad;}function a39_0x5370(){const _0xb1053b=['6jdqXJb','source','updated','hash','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','3uSjVNa','serviceCount','kind','Imported','cliPath','errors','entry','description','service','entries','filePath','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','normalizedManifest','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','23185sqelJF','209TsbCHX','version','import','Imported\x20','\x20service\x20','lower\x20kebab-case\x20service\x20code','WRITE','2159591gMBkbV','write','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','name','448260ZeSUcj','remove','imported','serviceCode','366398fhOaYu','warnings','str','file','Service\x20manifest\x20validation\x20passed.','Removed\x20service\x20','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','218630PPARiE','commands','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','912twcMSZ','type','risk','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','target','importedAt','1451708KaKkvZ','report','reduce','manifest','registryPath','\x20service(s).','registryIndex','Local\x20service\x20not\x20found:\x20','list','\x20service(s),\x20updated\x20','flags','map','read','Local\x20service\x20code,\x20for\x20example\x20crm','length','26478rUTvhl','manifests','replaced','string'];a39_0x5370=function(){return _0xb1053b;};return a39_0x5370();}const FILE_FLAG={'name':a39_0x12b746(0x199),'type':a39_0x12b746(0x171),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a39_0x12b746(0x17f),'type':'string','required':!![],'description':a39_0x12b746(0x16c),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x12b746(0x18c)}};function summarizeService(_0x213e4b){const _0x5cc68a=a39_0x12b746;return{'serviceCode':_0x213e4b[_0x5cc68a(0x195)],'name':_0x213e4b[_0x5cc68a(0x184)][_0x5cc68a(0x17f)][_0x5cc68a(0x191)],'version':_0x213e4b[_0x5cc68a(0x188)],'importedAt':_0x213e4b[_0x5cc68a(0x15e)],'source':_0x213e4b[_0x5cc68a(0x173)],'commandCount':_0x213e4b[_0x5cc68a(0x184)][_0x5cc68a(0x157)][_0x5cc68a(0x16d)],'commands':_0x213e4b[_0x5cc68a(0x184)][_0x5cc68a(0x157)][_0x5cc68a(0x16a)](_0x179768=>({'path':_0x179768['cliPath'],'description':_0x179768[_0x5cc68a(0x17e)],'risk':_0x179768[_0x5cc68a(0x15b)],'target':_0x179768[_0x5cc68a(0x15d)],'flags':_0x179768[_0x5cc68a(0x169)][_0x5cc68a(0x16a)](_0x183a71=>({'name':_0x183a71[_0x5cc68a(0x191)],'cliName':_0x183a71['cliName'],'type':_0x183a71[_0x5cc68a(0x15a)],'required':_0x183a71['required']===!![]}))}))};}function summarizeLoadedManifest(_0x1f4bd6){const _0x615b34=a39_0x12b746;return{'service':_0x1f4bd6['normalizedManifest']?.[_0x615b34(0x17f)],'version':_0x1f4bd6[_0x615b34(0x184)]?.['version'],'commandCount':_0x1f4bd6[_0x615b34(0x184)]?.[_0x615b34(0x157)][_0x615b34(0x16d)]??0x0,'commands':_0x1f4bd6[_0x615b34(0x184)]?.[_0x615b34(0x157)]['map'](_0x5116b0=>({'path':_0x5116b0[_0x615b34(0x17b)],'risk':_0x5116b0[_0x615b34(0x15b)],'target':_0x5116b0[_0x615b34(0x15d)]}))??[],'registryIndex':_0x1f4bd6[_0x615b34(0x165)],'registryServiceCode':_0x1f4bd6['registryServiceCode'],'errors':_0x1f4bd6['report']['errors'],'warnings':_0x1f4bd6[_0x615b34(0x160)][_0x615b34(0x197)]};}export const serviceDefinitions=[{'service':'service','command':'validate','description':a39_0x12b746(0x182),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x2dec83){const _0x39e129=a39_0x12b746,_0x30ab87=loadServiceManifestFromFile(_0x2dec83[_0x39e129(0x198)](_0x39e129(0x199)));if(!_0x30ab87[_0x39e129(0x160)]['ok'])return{'ok':![],'data':{'file':_0x30ab87[_0x39e129(0x181)],'hash':_0x30ab87[_0x39e129(0x175)],'kind':_0x30ab87['kind'],'serviceCount':_0x30ab87[_0x39e129(0x16f)][_0x39e129(0x16d)],'services':_0x30ab87[_0x39e129(0x16f)][_0x39e129(0x16a)](summarizeLoadedManifest),'errors':_0x30ab87[_0x39e129(0x160)][_0x39e129(0x17c)],'warnings':_0x30ab87[_0x39e129(0x160)][_0x39e129(0x197)]},'message':formatValidationFailure(_0x30ab87[_0x39e129(0x160)])};if(_0x30ab87[_0x39e129(0x179)]==='registry'||_0x30ab87[_0x39e129(0x16f)][_0x39e129(0x16d)]!==0x1)return{'ok':!![],'data':{'file':_0x30ab87[_0x39e129(0x181)],'hash':_0x30ab87[_0x39e129(0x175)],'kind':_0x30ab87[_0x39e129(0x179)],'serviceCount':_0x30ab87[_0x39e129(0x16f)][_0x39e129(0x16d)],'commandCount':_0x30ab87['manifests'][_0x39e129(0x161)]((_0x2b49cf,_0x2d8139)=>_0x2b49cf+(_0x2d8139[_0x39e129(0x184)]?.[_0x39e129(0x157)]['length']??0x0),0x0),'services':_0x30ab87['manifests']['map'](summarizeLoadedManifest),'warnings':_0x30ab87['report'][_0x39e129(0x197)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x30ab87[_0x39e129(0x181)],'hash':_0x30ab87['hash'],'kind':_0x30ab87['kind'],'service':_0x30ab87[_0x39e129(0x184)]?.[_0x39e129(0x17f)],'version':_0x30ab87[_0x39e129(0x184)]?.[_0x39e129(0x188)],'commandCount':_0x30ab87[_0x39e129(0x184)]?.[_0x39e129(0x157)][_0x39e129(0x16d)]??0x0,'commands':_0x30ab87[_0x39e129(0x184)]?.['commands'][_0x39e129(0x16a)](_0x387a20=>({'path':_0x387a20['cliPath'],'risk':_0x387a20[_0x39e129(0x15b)],'target':_0x387a20[_0x39e129(0x15d)]})),'warnings':_0x30ab87[_0x39e129(0x160)][_0x39e129(0x197)]},'message':_0x39e129(0x19a)};}},{'service':a39_0x12b746(0x17f),'command':a39_0x12b746(0x189),'description':a39_0x12b746(0x183),'risk':a39_0x12b746(0x18f),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x41968a){const _0x1f4bdf=a39_0x12b746,_0x8ffd7f=loadServiceManifestFromFile(_0x41968a[_0x1f4bdf(0x198)](_0x1f4bdf(0x199)));return{'method':_0x1f4bdf(0x18d),'url':getServiceRegistryPath(),'body':{'file':_0x8ffd7f[_0x1f4bdf(0x181)],'hash':_0x8ffd7f[_0x1f4bdf(0x175)],'kind':_0x8ffd7f['kind'],'ok':_0x8ffd7f[_0x1f4bdf(0x160)]['ok'],'service':_0x8ffd7f[_0x1f4bdf(0x184)]?.['service'],'version':_0x8ffd7f[_0x1f4bdf(0x184)]?.[_0x1f4bdf(0x188)],'serviceCount':_0x8ffd7f[_0x1f4bdf(0x16f)]['length'],'services':_0x8ffd7f[_0x1f4bdf(0x16f)][_0x1f4bdf(0x16a)](_0x8dd377=>({'service':_0x8dd377['normalizedManifest']?.['service'],'version':_0x8dd377['normalizedManifest']?.[_0x1f4bdf(0x188)],'commandCount':_0x8dd377['normalizedManifest']?.[_0x1f4bdf(0x157)][_0x1f4bdf(0x16d)]??0x0,'errors':_0x8dd377[_0x1f4bdf(0x160)]['errors']})),'errors':_0x8ffd7f[_0x1f4bdf(0x160)][_0x1f4bdf(0x17c)],'commandCount':_0x8ffd7f[_0x1f4bdf(0x184)]?.[_0x1f4bdf(0x157)][_0x1f4bdf(0x16d)]??0x0},'description':_0x1f4bdf(0x190)};},async 'execute'(_0x5b25fa){const _0x108dd2=a39_0x12b746,_0x4305a1=importServiceManifest(_0x5b25fa[_0x108dd2(0x198)]('file'));if(_0x4305a1['entries'][_0x108dd2(0x16d)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x4305a1[_0x108dd2(0x163)],'imported':_0x4305a1[_0x108dd2(0x194)],'updated':_0x4305a1[_0x108dd2(0x174)],'serviceCount':_0x4305a1[_0x108dd2(0x178)],'services':_0x4305a1[_0x108dd2(0x180)][_0x108dd2(0x16a)](summarizeService)},'message':_0x108dd2(0x18a)+_0x4305a1['imported']+_0x108dd2(0x168)+_0x4305a1[_0x108dd2(0x174)]+_0x108dd2(0x164)};return{'ok':!![],'data':{'registryPath':_0x4305a1[_0x108dd2(0x163)],'replaced':_0x4305a1[_0x108dd2(0x170)],'imported':_0x4305a1[_0x108dd2(0x194)],'updated':_0x4305a1[_0x108dd2(0x174)],'serviceCount':_0x4305a1[_0x108dd2(0x178)],'service':summarizeService(_0x4305a1[_0x108dd2(0x17d)])},'message':(_0x4305a1[_0x108dd2(0x170)]?'Updated':_0x108dd2(0x17a))+_0x108dd2(0x18b)+_0x4305a1[_0x108dd2(0x17d)]['serviceCode']+'.'};}},{'service':a39_0x12b746(0x17f),'command':'export','description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a39_0x12b746(0x18f),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0xd6baec){const _0x551262=a39_0x12b746,_0x35a5a2=getLocalServiceEntry(_0xd6baec[_0x551262(0x198)](_0x551262(0x17f)));return{'method':_0x551262(0x18d),'url':_0xd6baec[_0x551262(0x198)](_0x551262(0x199)),'body':{'service':_0xd6baec[_0x551262(0x198)](_0x551262(0x17f)),'found':Boolean(_0x35a5a2),'version':_0x35a5a2?.[_0x551262(0x188)],'source':_0x35a5a2?.[_0x551262(0x173)]},'description':_0x551262(0x185)};},async 'execute'(_0x9031ce){const _0x4b3abe=a39_0x12b746,_0x1a21a6=exportServiceManifest(_0x9031ce[_0x4b3abe(0x198)]('service'),_0x9031ce['str'](_0x4b3abe(0x199)));return{'ok':!![],'data':{'registryPath':_0x1a21a6['registryPath'],'file':_0x1a21a6[_0x4b3abe(0x181)],'service':summarizeService(_0x1a21a6[_0x4b3abe(0x17d)])},'message':'Exported\x20service\x20'+_0x1a21a6[_0x4b3abe(0x17d)][_0x4b3abe(0x195)]+'.'};}},{'service':a39_0x12b746(0x17f),'command':a39_0x12b746(0x167),'description':a39_0x12b746(0x176),'risk':a39_0x12b746(0x16b),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x3fc62a=a39_0x12b746,_0x25a956=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x25a956[_0x3fc62a(0x16d)],'services':_0x25a956[_0x3fc62a(0x16a)](summarizeService)}};}},{'service':a39_0x12b746(0x17f),'command':a39_0x12b746(0x193),'description':a39_0x12b746(0x155),'risk':a39_0x12b746(0x18f),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x1418fe){const _0x422187=a39_0x12b746,_0x4f889d=getLocalServiceEntry(_0x1418fe['str'](_0x422187(0x17f)));return{'method':_0x422187(0x18d),'url':getServiceRegistryPath(),'body':{'service':_0x1418fe['str'](_0x422187(0x17f)),'found':Boolean(_0x4f889d),'version':_0x4f889d?.[_0x422187(0x188)],'source':_0x4f889d?.[_0x422187(0x173)]},'description':_0x422187(0x158)};},async 'execute'(_0x2d6218){const _0x475eb6=a39_0x12b746,_0x50b281=removeServiceManifest(_0x2d6218[_0x475eb6(0x198)](_0x475eb6(0x17f)));return{'ok':!![],'data':{'registryPath':_0x50b281[_0x475eb6(0x163)],'serviceCount':_0x50b281['serviceCount'],'service':summarizeService(_0x50b281[_0x475eb6(0x17d)])},'message':_0x475eb6(0x19b)+_0x50b281[_0x475eb6(0x17d)]['serviceCode']+'.'};}},{'service':a39_0x12b746(0x17f),'command':'detail','description':a39_0x12b746(0x15c),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x54ccc3){const _0x26ad33=a39_0x12b746,_0x282b2b=getLocalServiceEntry(_0x54ccc3[_0x26ad33(0x198)](_0x26ad33(0x17f)));if(!_0x282b2b)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x54ccc3[_0x26ad33(0x198)]('service')},'message':_0x26ad33(0x166)+_0x54ccc3[_0x26ad33(0x198)](_0x26ad33(0x17f))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x282b2b),'manifest':_0x282b2b[_0x26ad33(0x162)],'normalizedManifest':_0x282b2b[_0x26ad33(0x184)]}};}}];
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)]}};}}];