@lovrabet/lovrabet-cli 2.1.15 → 2.1.16-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) 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/artifact/index.js +1 -1
  12. package/lib/commands/auth/device.js +1 -0
  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/function-name-adapter.js +1 -1
  41. package/lib/commands/service/index.js +1 -1
  42. package/lib/commands/service/registry.js +1 -1
  43. package/lib/commands/skill/commands/create.js +1 -1
  44. package/lib/commands/skill/commands/install.js +1 -1
  45. package/lib/commands/skill/commands/list.js +1 -1
  46. package/lib/commands/skill/commands/push.js +1 -1
  47. package/lib/commands/skill/commands/validate.js +1 -1
  48. package/lib/commands/skill/flags.js +1 -1
  49. package/lib/commands/skill/index.js +1 -1
  50. package/lib/commands/skill/manifest-helpers.js +1 -1
  51. package/lib/commands/skill/push-execute.js +1 -1
  52. package/lib/commands/skill/push-flow-helpers.js +1 -1
  53. package/lib/commands/skill/push-retarget.js +1 -1
  54. package/lib/commands/skill/scopes.js +1 -1
  55. package/lib/commands/skill/summary.js +1 -1
  56. package/lib/commands/skill/templates.js +1 -1
  57. package/lib/commands/skill/validate.js +1 -1
  58. package/lib/commands/sql/detail.js +1 -1
  59. package/lib/commands/sql/exec.js +1 -1
  60. package/lib/commands/sql/index.js +1 -1
  61. package/lib/commands/update.js +1 -1
  62. package/lib/commands/workspace/index.js +1 -1
  63. package/lib/config/schema.js +1 -1
  64. package/lib/constant/app.js +1 -1
  65. package/lib/constant/auth-mode.js +1 -1
  66. package/lib/constant/cli.js +1 -1
  67. package/lib/constant/defaults.js +1 -1
  68. package/lib/constant/distribution.js +1 -1
  69. package/lib/constant/domain.js +1 -1
  70. package/lib/constant/env.js +1 -1
  71. package/lib/constant/output.js +1 -1
  72. package/lib/constant/product.js +1 -1
  73. package/lib/constant/risk.js +1 -1
  74. package/lib/constant/url.js +1 -1
  75. package/lib/context.js +1 -1
  76. package/lib/core/api-client.js +1 -1
  77. package/lib/core/db-resolver.js +1 -1
  78. package/lib/core/sdk-client.js +1 -1
  79. package/lib/errors.js +1 -1
  80. package/lib/framework/build-all-flags.js +1 -1
  81. package/lib/framework/dryrun.js +1 -1
  82. package/lib/framework/flags.js +1 -1
  83. package/lib/framework/help.js +1 -1
  84. package/lib/framework/index.js +1 -1
  85. package/lib/framework/output.js +1 -1
  86. package/lib/framework/preparse.js +1 -1
  87. package/lib/framework/rate-limit.js +1 -1
  88. package/lib/framework/response.js +1 -1
  89. package/lib/framework/runner-confirmation.js +1 -1
  90. package/lib/framework/runner-error.js +1 -1
  91. package/lib/framework/runner.js +1 -1
  92. package/lib/framework/schema-export.js +1 -1
  93. package/lib/framework/service-order.js +1 -1
  94. package/lib/framework/types.js +1 -1
  95. package/lib/generated/build-info.js +1 -1
  96. package/lib/help.js +1 -1
  97. package/lib/skills/npx-skills-add.js +1 -1
  98. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  99. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  100. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  101. package/lib/skills/runtime-skill-sync/links.js +1 -1
  102. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  103. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  104. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  105. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  106. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  107. package/lib/skills/runtime-skill-sync/push.js +1 -1
  108. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  109. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  110. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  111. package/lib/skills/runtime-skill-sync.js +1 -1
  112. package/lib/utils/apply-jq-filter.js +1 -1
  113. package/lib/utils/logger.js +1 -1
  114. package/lib/utils/lossless-json.js +1 -1
  115. package/lib/utils/params.js +1 -1
  116. package/lib/utils/platform.js +1 -1
  117. package/lib/utils/update-notice.js +1 -1
  118. package/lib/utils/version.js +1 -1
  119. package/lib/utils/write-cli-side-channel.js +1 -1
  120. package/package.json +1 -1
@@ -1 +1 @@
1
- const a29_0x5395ff=a29_0x21f3;(function(_0x5192b2,_0x5760d7){const _0x4cda92=a29_0x21f3,_0x2991b0=_0x5192b2();while(!![]){try{const _0x345b02=-parseInt(_0x4cda92(0x1f5))/0x1+parseInt(_0x4cda92(0x1f1))/0x2*(parseInt(_0x4cda92(0x201))/0x3)+-parseInt(_0x4cda92(0x20d))/0x4*(-parseInt(_0x4cda92(0x1ff))/0x5)+-parseInt(_0x4cda92(0x200))/0x6*(parseInt(_0x4cda92(0x20a))/0x7)+parseInt(_0x4cda92(0x1f7))/0x8*(parseInt(_0x4cda92(0x1fe))/0x9)+parseInt(_0x4cda92(0x1f6))/0xa+parseInt(_0x4cda92(0x209))/0xb*(parseInt(_0x4cda92(0x1fa))/0xc);if(_0x345b02===_0x5760d7)break;else _0x2991b0['push'](_0x2991b0['shift']());}catch(_0x18477e){_0x2991b0['push'](_0x2991b0['shift']());}}}(a29_0x170d,0x601a7));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':a29_0x5395ff(0x20e),'type':a29_0x5395ff(0x1f0),'required':!![],'description':a29_0x5395ff(0x1ef)},FILEPATH_FLAG={'name':a29_0x5395ff(0x207),'type':a29_0x5395ff(0x1f0),'required':!![],'description':a29_0x5395ff(0x1f9)},DOWNLOAD_FLAG={'name':'download','type':a29_0x5395ff(0x1f8),'description':a29_0x5395ff(0x205)},LONG_TERM_FLAG={'name':a29_0x5395ff(0x1fc),'type':a29_0x5395ff(0x1f8),'description':a29_0x5395ff(0x1fd)};function requireFilePath(_0x5a8a55){const _0x19b159=a29_0x5395ff,_0x3c1a08=_0x5a8a55[_0x19b159(0x203)]();if(!_0x3c1a08)throw CliErrors[_0x19b159(0x208)]('filePath\x20is\x20required.');return _0x3c1a08;}function a29_0x170d(){const _0x3ff148=['str','description','Uploaded\x20file:\x20','497985OdrywF','1953810JyFfrG','257096mOyvrS','boolean','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','36nsBrDM','appCode','long-term','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','27CBXybN','136615qRXyBR','6iJfTei','3fcSgHY','read','trim','download','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','File','filepath','validation','1368466ayUhEL','4493713hcznXG','\x20to\x20runtime\x20app\x20','/client/uploadFile','64vmjiAC','file','path','Preview:\x20upload\x20','write','bool','filePath','Path\x20to\x20the\x20local\x20file\x20to\x20upload','string','862810jhNryi'];a29_0x170d=function(){return _0x3ff148;};return a29_0x170d();}const fileUpload={'service':a29_0x5395ff(0x20e),'command':'upload','description':'Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','risk':a29_0x5395ff(0x1ec),'flags':[FILE_FLAG],async 'dryRun'(_0x2c0d45){const _0x531eb0=a29_0x5395ff,_0x314ca0=requireRuntimeUploadFile(_0x2c0d45['str']('file'),_0x531eb0(0x206));return dryRun('POST',_0x531eb0(0x20c))['body']({'appCode':_0x2c0d45[_0x531eb0(0x1fb)],'multipart':{'file':_0x314ca0}})[_0x531eb0(0x1f3)](_0x531eb0(0x1eb)+_0x314ca0['path']+_0x531eb0(0x20b)+_0x2c0d45['appCode'])['build']();},async 'execute'(_0x32f4b6){const _0x50aceb=a29_0x5395ff,_0x4f6171=requireRuntimeUploadFile(_0x32f4b6[_0x50aceb(0x1f2)](_0x50aceb(0x20e)),'File'),_0x1d5724=await uploadRuntimeFile(_0x32f4b6[_0x50aceb(0x1fb)],_0x4f6171[_0x50aceb(0x1ea)]);return{'ok':!![],'data':_0x1d5724,'message':_0x1d5724[_0x50aceb(0x1ee)]?_0x50aceb(0x1f4)+_0x1d5724[_0x50aceb(0x1ee)]+'.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.':'Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.'};}},fileQueryUrl={'service':'file','command':'query-url','description':'Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','risk':a29_0x5395ff(0x202),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x17e1ce){const _0x158b6d=a29_0x5395ff,_0xaccec=requireFilePath(_0x17e1ce['str'](_0x158b6d(0x207))),_0x2e64cb=await queryRuntimeFileUrl(_0xaccec,{'download':_0x17e1ce[_0x158b6d(0x1ed)](_0x158b6d(0x204)),'longTerm':_0x17e1ce['bool'](_0x158b6d(0x1fc))});return{'ok':!![],'data':_0x2e64cb};}};function a29_0x21f3(_0x39e7ce,_0xaa5aee){_0x39e7ce=_0x39e7ce-0x1ea;const _0x170db3=a29_0x170d();let _0x21f3c9=_0x170db3[_0x39e7ce];return _0x21f3c9;}export const fileDefinitions=[fileUpload,fileQueryUrl];
1
+ const a30_0x1b62ab=a30_0x5f14;(function(_0x2e396d,_0x4911e6){const _0xfa71c=a30_0x5f14,_0x28b9cf=_0x2e396d();while(!![]){try{const _0x3709fb=-parseInt(_0xfa71c(0x1ee))/0x1*(parseInt(_0xfa71c(0x1f7))/0x2)+-parseInt(_0xfa71c(0x1ff))/0x3+-parseInt(_0xfa71c(0x1ef))/0x4+-parseInt(_0xfa71c(0x1f8))/0x5*(parseInt(_0xfa71c(0x1f0))/0x6)+parseInt(_0xfa71c(0x1f4))/0x7+-parseInt(_0xfa71c(0x208))/0x8*(parseInt(_0xfa71c(0x1f5))/0x9)+parseInt(_0xfa71c(0x20e))/0xa;if(_0x3709fb===_0x4911e6)break;else _0x28b9cf['push'](_0x28b9cf['shift']());}catch(_0x437378){_0x28b9cf['push'](_0x28b9cf['shift']());}}}(a30_0x55e2,0xcaece));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';function a30_0x5f14(_0x8800bf,_0x57ffa5){_0x8800bf=_0x8800bf-0x1e7;const _0x55e2c0=a30_0x55e2();let _0x5f1465=_0x55e2c0[_0x8800bf];return _0x5f1465;}const FILE_FLAG={'name':a30_0x1b62ab(0x20d),'type':a30_0x1b62ab(0x1fe),'required':!![],'description':a30_0x1b62ab(0x1e7)},FILEPATH_FLAG={'name':a30_0x1b62ab(0x200),'type':a30_0x1b62ab(0x1fe),'required':!![],'description':a30_0x1b62ab(0x1ed)},DOWNLOAD_FLAG={'name':a30_0x1b62ab(0x1f9),'type':'boolean','description':a30_0x1b62ab(0x203)},LONG_TERM_FLAG={'name':a30_0x1b62ab(0x20b),'type':a30_0x1b62ab(0x1eb),'description':a30_0x1b62ab(0x205)};function requireFilePath(_0x5a74fd){const _0x4b70cb=a30_0x1b62ab,_0x3f02e5=_0x5a74fd[_0x4b70cb(0x201)]();if(!_0x3f02e5)throw CliErrors[_0x4b70cb(0x20f)](_0x4b70cb(0x20c));return _0x3f02e5;}const fileUpload={'service':a30_0x1b62ab(0x20d),'command':a30_0x1b62ab(0x206),'description':a30_0x1b62ab(0x209),'risk':'write','flags':[FILE_FLAG],async 'dryRun'(_0xdf9042){const _0x6d782e=a30_0x1b62ab,_0x340e49=requireRuntimeUploadFile(_0xdf9042[_0x6d782e(0x1f6)](_0x6d782e(0x20d)),_0x6d782e(0x1fa));return dryRun(_0x6d782e(0x20a),_0x6d782e(0x1f1))['body']({'appCode':_0xdf9042[_0x6d782e(0x1fc)],'multipart':{'file':_0x340e49}})['description']('Preview:\x20upload\x20'+_0x340e49[_0x6d782e(0x1f2)]+_0x6d782e(0x1e8)+_0xdf9042[_0x6d782e(0x1fc)])[_0x6d782e(0x204)]();},async 'execute'(_0x3540b8){const _0x2e49a4=a30_0x1b62ab,_0x4cb29e=requireRuntimeUploadFile(_0x3540b8[_0x2e49a4(0x1f6)](_0x2e49a4(0x20d)),_0x2e49a4(0x1fa)),_0x592899=await uploadRuntimeFile(_0x3540b8[_0x2e49a4(0x1fc)],_0x4cb29e[_0x2e49a4(0x1f2)]);return{'ok':!![],'data':_0x592899,'message':_0x592899[_0x2e49a4(0x202)]?_0x2e49a4(0x1e9)+_0x592899[_0x2e49a4(0x202)]+_0x2e49a4(0x1ea):_0x2e49a4(0x1fb)};}},fileQueryUrl={'service':a30_0x1b62ab(0x20d),'command':a30_0x1b62ab(0x1fd),'description':a30_0x1b62ab(0x207),'risk':a30_0x1b62ab(0x1ec),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x3d3da1){const _0x1bb996=a30_0x1b62ab,_0x1b23ca=requireFilePath(_0x3d3da1[_0x1bb996(0x1f6)](_0x1bb996(0x200))),_0x139e6b=await queryRuntimeFileUrl(_0x1b23ca,{'download':_0x3d3da1['bool'](_0x1bb996(0x1f9)),'longTerm':_0x3d3da1[_0x1bb996(0x1f3)](_0x1bb996(0x20b))});return{'ok':!![],'data':_0x139e6b};}};export const fileDefinitions=[fileUpload,fileQueryUrl];function a30_0x55e2(){const _0x4f4a08=['validation','Path\x20to\x20the\x20local\x20file\x20to\x20upload','\x20to\x20runtime\x20app\x20','Uploaded\x20file:\x20','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','boolean','read','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','277801rqBxID','2933152QXCugz','2598WlxXAH','/client/uploadFile','path','bool','11234041LIGcFv','6722289EeQdAm','str','2opFGdy','11215qBzJjW','download','File','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','appCode','query-url','string','4375173Iliump','filepath','trim','filePath','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','build','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','upload','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','16gkWWUv','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','POST','long-term','filePath\x20is\x20required.','file','41608600zHivYf'];a30_0x55e2=function(){return _0x4f4a08;};return a30_0x55e2();}
@@ -1 +1 @@
1
- const a30_0x56286a=a30_0x3556;function a30_0x5636(){const _0x567a2e=[')\x20instead\x20of\x20project','App\x20code','\x20\x20appcode:\x20','Invalid\x20env\x20\x22','entries','\x20already\x20exists.\x20Overwrite?','join','[Y/n]','defaultApp','31aNrvAb','apiDir','project','yes','stdin','validation','Failed\x20to\x20parse\x20source\x20file:\x20','File\x20','Usage:\x20','parse','appcode','log','\x20\x20config:\x20\x20','object','3511638qnjsEl','[y/N]','\x20\x20env:\x20\x20\x20\x20\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','trim','stdout','Skip\x20confirmation\x20when\x20overwriting','75015BBQUxj','newConfigFileName','app','riskLevel','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Write\x20to\x20global\x20(~/','file','347650HApyar','once','Imported\x20from\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','App\x20code\x20for\x20the\x20project','17678SRUNfp','1565496SCwBXi','includes','toLowerCase','message','Override\x20imported\x20default\x20env','close','424800RCQiYi','name','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','string','boolean','env','App\x20code\x20cannot\x20be\x20empty.','SIGINT','79233ksErVt','removeListener','8pImfrx','global','apps','\x0aInitialized\x20','race','utf8'];a30_0x5636=function(){return _0x567a2e;};return a30_0x5636();}function a30_0x3556(_0x30dfec,_0x1d4791){_0x30dfec=_0x30dfec-0x191;const _0x563643=a30_0x5636();let _0x355680=_0x563643[_0x30dfec];return _0x355680;}(function(_0x339e66,_0x54513e){const _0x2a8655=a30_0x3556,_0x13c289=_0x339e66();while(!![]){try{const _0x351ad7=parseInt(_0x2a8655(0x1bb))/0x1*(-parseInt(_0x2a8655(0x19b))/0x2)+-parseInt(_0x2a8655(0x1d0))/0x3+parseInt(_0x2a8655(0x1ac))/0x4*(-parseInt(_0x2a8655(0x196))/0x5)+parseInt(_0x2a8655(0x19c))/0x6+-parseInt(_0x2a8655(0x1aa))/0x7+-parseInt(_0x2a8655(0x1a2))/0x8+parseInt(_0x2a8655(0x1c9))/0x9;if(_0x351ad7===_0x54513e)break;else _0x13c289['push'](_0x13c289['shift']());}catch(_0x34036a){_0x13c289['push'](_0x13c289['shift']());}}}(a30_0x5636,0x2447d));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':a30_0x56286a(0x1c5),'type':a30_0x56286a(0x1a5),'description':a30_0x56286a(0x19a)},{'name':a30_0x56286a(0x1a7),'type':a30_0x56286a(0x1a5),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a30_0x56286a(0x1a7)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a30_0x56286a(0x1ad),'type':a30_0x56286a(0x1a6),'description':a30_0x56286a(0x194)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a30_0x56286a(0x1be),'type':a30_0x56286a(0x1a6),'description':a30_0x56286a(0x1cf),'default':![]}];export const initImportFlagDefs=[{'name':a30_0x56286a(0x195),'type':a30_0x56286a(0x1a5),'description':a30_0x56286a(0x193),'required':!![]},{'name':a30_0x56286a(0x1c5),'type':a30_0x56286a(0x1a5),'description':'Override\x20imported\x20default\x20appcode'},{'name':a30_0x56286a(0x1a7),'type':a30_0x56286a(0x1a5),'description':a30_0x56286a(0x1a0),'enum':[...RUNTIME_ENV_VALUES]},{'name':a30_0x56286a(0x1ad),'type':a30_0x56286a(0x1a6),'description':a30_0x56286a(0x194)+PRODUCT_CONFIG[a30_0x56286a(0x1d1)]+a30_0x56286a(0x1b2),'default':![]},{'name':a30_0x56286a(0x1be),'type':a30_0x56286a(0x1a6),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x12a252){const _0xaa066=a30_0x56286a,_0xf1ff49=isNonInteractiveMode(_0x12a252),_0x547833=_0x12a252[_0xaa066(0x1ad)]?_0xaa066(0x1ad):_0xaa066(0x1bd),_0x52b544=resolveWriteConfigPath(_0x547833);try{_0xf1ff49?await runNonInteractive(_0x12a252,_0x52b544):await runInteractive(_0x12a252,_0x52b544);}catch(_0x50370a){if(_0x50370a instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x50370a;}}export async function runInitImport(_0x3bc186){const _0x37c782=a30_0x56286a,_0x43c0ef=_0x3bc186[_0x37c782(0x1ad)]?_0x37c782(0x1ad):_0x37c782(0x1bd),_0x2a116b=resolveWriteConfigPath(_0x43c0ef);await runFromImport(_0x3bc186,_0x2a116b);}const RUNTIME_IRRELEVANT_KEYS=new Set([a30_0x56286a(0x1bc)]);async function runFromImport(_0x38248e,_0x1484dc){const _0x5d5105=a30_0x56286a,_0x1b61f4=resolveFilePath(_0x38248e[_0x5d5105(0x195)]);if(!existsSync(_0x1b61f4))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x1b61f4);const _0x58c69f=readSourceFile(_0x1b61f4),_0x141f26=convertToRuntimeConfig(_0x58c69f);_0x38248e[_0x5d5105(0x1c5)]&&(_0x141f26[_0x5d5105(0x1c5)]=String(_0x38248e[_0x5d5105(0x1c5)]));_0x38248e[_0x5d5105(0x1a7)]&&(_0x141f26[_0x5d5105(0x1a7)]=resolveInitEnv(_0x38248e));if(!_0x141f26[_0x5d5105(0x1c5)])throw CliErrors['validation'](_0x5d5105(0x1a4),'Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x1484dc,_0x141f26,_0x38248e),console[_0x5d5105(0x1c6)](_0x5d5105(0x198)+_0x1b61f4),console[_0x5d5105(0x1c6)](_0x5d5105(0x1c7)+_0x1484dc),console['log'](_0x5d5105(0x1b4)+_0x141f26[_0x5d5105(0x1c5)]);if(_0x141f26['defaultApp'])console[_0x5d5105(0x1c6)]('\x20\x20default:\x20'+_0x141f26[_0x5d5105(0x1ba)]);}function convertToRuntimeConfig(_0x638e42){const _0xaa3705=a30_0x56286a;if(_0x638e42[_0xaa3705(0x1ae)]&&typeof _0x638e42['apps']===_0xaa3705(0x1c8))throw CliErrors[_0xaa3705(0x1c0)](_0xaa3705(0x1cc),_0xaa3705(0x199));const _0x5f46b4={};for(const _0x2ad00d of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x638e42[_0x2ad00d]!==undefined&&(_0x5f46b4[_0x2ad00d]=_0x638e42[_0x2ad00d]);}return!_0x5f46b4[_0xaa3705(0x192)]&&(_0x5f46b4[_0xaa3705(0x192)]=DEFAULT_CONFIG_VALUES[_0xaa3705(0x192)]),_0x5f46b4;}async function runNonInteractive(_0x2e7383,_0x30f467){const _0x53b4e2=a30_0x56286a,_0x53af79=_0x2e7383[_0x53b4e2(0x1c5)];if(!_0x53af79)throw CliErrors['flagMissing']('appcode',_0x53b4e2(0x1c3)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x2bf9e6=resolveInitEnv(_0x2e7383);await writeInitConfig(_0x30f467,{'appcode':_0x53af79,'env':_0x2bf9e6},_0x2e7383),console[_0x53b4e2(0x1c6)]('Initialized\x20'+_0x30f467),console[_0x53b4e2(0x1c6)](_0x53b4e2(0x1b4)+_0x53af79),console[_0x53b4e2(0x1c6)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x2bf9e6);}async function runInteractive(_0x15e5ba,_0x487469){const _0x261401=a30_0x56286a,_0x4a3bac=loadExisting(_0x487469),_0x231790=typeof _0x4a3bac?.[_0x261401(0x1c5)]===_0x261401(0x1a5)?_0x4a3bac[_0x261401(0x1c5)]:'',_0x436f0e=resolveInitEnv(_0x15e5ba);console['log'](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x261401(0x1d1)]+'\x0a');if(existsSync(_0x487469)&&!_0x15e5ba['yes']){const _0xbafb30=await promptYesNo(_0x261401(0x1c2)+_0x487469+_0x261401(0x1b7),![]);if(!_0xbafb30){console[_0x261401(0x1c6)]('Aborted.');return;}}const _0xad0158=typeof _0x15e5ba[_0x261401(0x1c5)]===_0x261401(0x1a5)?_0x15e5ba['appcode'][_0x261401(0x1cd)]():'';let _0x5c3216=_0xad0158;!_0x5c3216&&(_0x5c3216=await promptInput(_0x261401(0x1b3),_0x231790));if(!_0x5c3216[_0x261401(0x1cd)]())throw CliErrors['validation'](_0x261401(0x1a8));await writeInitConfig(_0x487469,{'appcode':_0x5c3216[_0x261401(0x1cd)](),'env':_0x436f0e},_0x15e5ba),console['log'](_0x261401(0x1af)+_0x487469),console[_0x261401(0x1c6)](_0x261401(0x1b4)+_0x5c3216['trim']()),console[_0x261401(0x1c6)](_0x261401(0x1cb)+_0x436f0e);}async function writeInitConfig(_0x38baf6,_0x3bf2e3,_0x22d3b8){const _0x3d1048=a30_0x56286a;let _0x3e85ed={};existsSync(_0x38baf6)&&!_0x22d3b8[_0x3d1048(0x1be)]&&(_0x3e85ed=readConfigFile(_0x38baf6));for(const [_0x10734e,_0x325a98]of Object[_0x3d1048(0x1b6)](_0x3bf2e3)){_0x325a98!==undefined&&(_0x3e85ed[_0x10734e]=_0x325a98);}if(_0x3e85ed[_0x3d1048(0x191)])delete _0x3e85ed['app'];writeConfigFile(_0x38baf6,_0x3e85ed);}class AbortPrompt extends Error{constructor(){const _0x1ee854=a30_0x56286a;super('User\x20aborted\x20prompt'),this[_0x1ee854(0x1a3)]='AbortPrompt';}}function createSafeRl(){const _0x1b3a55=a30_0x56286a,_0x411060=createInterface({'input':process[_0x1b3a55(0x1bf)],'output':process[_0x1b3a55(0x1ce)]});let _0x2b80c7;const _0x4bfa28=new Promise((_0x10a1e1,_0x407107)=>{const _0x47a191=_0x1b3a55;_0x2b80c7=()=>{const _0x54f319=a30_0x3556;_0x2b80c7&&(_0x411060[_0x54f319(0x1ab)](_0x54f319(0x1a9),_0x2b80c7),_0x2b80c7=undefined);try{_0x411060[_0x54f319(0x1a1)]();}catch{}_0x407107(new AbortPrompt());},_0x411060[_0x47a191(0x197)](_0x47a191(0x1a9),_0x2b80c7);}),_0x59a135=()=>{const _0x593de8=_0x1b3a55;_0x2b80c7&&(_0x411060[_0x593de8(0x1ab)](_0x593de8(0x1a9),_0x2b80c7),_0x2b80c7=undefined);try{_0x411060[_0x593de8(0x1a1)]();}catch{}};return{'rl':_0x411060,'abortPromise':_0x4bfa28,'disposeSuccess':_0x59a135};}async function promptInput(_0x2f3a29,_0x36548d){const {rl:_0x6756d5,abortPromise:_0x1fa7d0,disposeSuccess:_0x2133b0}=createSafeRl(),_0x1c856b=new Promise(_0x4a6ce6=>{const _0x52d7ef=_0x36548d?'\x20\x20'+_0x2f3a29+'\x20('+_0x36548d+'):\x20':'\x20\x20'+_0x2f3a29+':\x20';_0x6756d5['question'](_0x52d7ef,_0x38439d=>{_0x2133b0(),_0x4a6ce6(_0x38439d['trim']()||_0x36548d);});});return Promise['race']([_0x1c856b,_0x1fa7d0]);}async function promptYesNo(_0x3e48bb,_0x22897e){const _0x235daa=a30_0x56286a,{rl:_0x34da9e,abortPromise:_0x3cc7ad,disposeSuccess:_0x2a9ed1}=createSafeRl(),_0x5b71fd=new Promise(_0x125260=>{const _0x179eb1=a30_0x3556,_0x53c615=_0x22897e?_0x179eb1(0x1b9):_0x179eb1(0x1ca);_0x34da9e['question']('\x20\x20'+_0x3e48bb+'\x20'+_0x53c615+':\x20',_0x1e3c05=>{const _0x4bd7c3=_0x179eb1;_0x2a9ed1();const _0xef6014=_0x1e3c05[_0x4bd7c3(0x1cd)]()[_0x4bd7c3(0x19e)]();if(_0xef6014==='y'||_0xef6014==='yes')_0x125260(!![]);else{if(_0xef6014==='n'||_0xef6014==='no')_0x125260(![]);else _0x125260(_0x22897e);}});});return Promise[_0x235daa(0x1b0)]([_0x5b71fd,_0x3cc7ad]);}function loadExisting(_0x3e4ea8){if(!existsSync(_0x3e4ea8))return null;return readConfigFile(_0x3e4ea8);}function resolveFilePath(_0x206c22){return isAbsolute(_0x206c22)?_0x206c22:resolve(process['cwd'](),_0x206c22);}function readSourceFile(_0x58eddb){const _0x25e55a=a30_0x56286a;try{const _0x56e98f=readFileSync(_0x58eddb,{'encoding':_0x25e55a(0x1b1)});return JSON[_0x25e55a(0x1c4)](_0x56e98f);}catch(_0x334a88){throw CliErrors['validation'](_0x25e55a(0x1c1)+_0x334a88[_0x25e55a(0x19f)]);}}function resolveInitEnv(_0x47de72){const _0x38b485=a30_0x56286a,_0x10fa7b=_0x47de72[_0x38b485(0x1a7)];if(_0x10fa7b===undefined||_0x10fa7b==='')return DEFAULT_CONFIG_VALUES[_0x38b485(0x1a7)];if(!RUNTIME_ENV_VALUES[_0x38b485(0x19d)](_0x10fa7b))throw CliErrors[_0x38b485(0x1c0)](_0x38b485(0x1b5)+_0x10fa7b+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x38b485(0x1b8)](',\x20'));return _0x10fa7b;}
1
+ const a31_0xaf4860=a31_0x2b47;(function(_0x4c8a2e,_0x196865){const _0xba87c1=a31_0x2b47,_0x169852=_0x4c8a2e();while(!![]){try{const _0x4705e9=parseInt(_0xba87c1(0x14a))/0x1+-parseInt(_0xba87c1(0x184))/0x2*(-parseInt(_0xba87c1(0x16f))/0x3)+-parseInt(_0xba87c1(0x17a))/0x4+-parseInt(_0xba87c1(0x15d))/0x5+parseInt(_0xba87c1(0x14c))/0x6+-parseInt(_0xba87c1(0x159))/0x7+parseInt(_0xba87c1(0x154))/0x8;if(_0x4705e9===_0x196865)break;else _0x169852['push'](_0x169852['shift']());}catch(_0x5cd8ab){_0x169852['push'](_0x169852['shift']());}}}(a31_0x156b,0x52599));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';function a31_0x2b47(_0x466e22,_0x21f60b){_0x466e22=_0x466e22-0x146;const _0x156bc0=a31_0x156b();let _0x2b47ce=_0x156bc0[_0x466e22];return _0x2b47ce;}export const initCreateFlagDefs=[{'name':a31_0xaf4860(0x157),'type':'string','description':a31_0xaf4860(0x163)},{'name':a31_0xaf4860(0x14b),'type':a31_0xaf4860(0x181),'description':a31_0xaf4860(0x169)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0xaf4860(0x15e),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0xaf4860(0x177)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0xaf4860(0x164),'type':a31_0xaf4860(0x149),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a31_0xaf4860(0x17f),'type':a31_0xaf4860(0x181),'description':a31_0xaf4860(0x18b),'required':!![]},{'name':a31_0xaf4860(0x157),'type':a31_0xaf4860(0x181),'description':a31_0xaf4860(0x178)},{'name':'env','type':a31_0xaf4860(0x181),'description':a31_0xaf4860(0x176),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0xaf4860(0x15e),'type':a31_0xaf4860(0x149),'description':a31_0xaf4860(0x16a)+PRODUCT_CONFIG[a31_0xaf4860(0x177)]+a31_0xaf4860(0x14e),'default':![]},{'name':a31_0xaf4860(0x164),'type':a31_0xaf4860(0x149),'description':a31_0xaf4860(0x148),'default':![]}];export async function runInit(_0x202e8f){const _0x152b0a=a31_0xaf4860,_0x3b857d=isNonInteractiveMode(_0x202e8f),_0xf99e56=_0x202e8f[_0x152b0a(0x15e)]?_0x152b0a(0x15e):_0x152b0a(0x158),_0x5b6704=resolveWriteConfigPath(_0xf99e56);try{_0x3b857d?await runNonInteractive(_0x202e8f,_0x5b6704):await runInteractive(_0x202e8f,_0x5b6704);}catch(_0x5489c){if(_0x5489c instanceof AbortPrompt)throw CliErrors[_0x152b0a(0x14f)]();throw _0x5489c;}}export async function runInitImport(_0x583833){const _0x4cf8fc=a31_0xaf4860,_0x271372=_0x583833[_0x4cf8fc(0x15e)]?'global':_0x4cf8fc(0x158),_0x43958d=resolveWriteConfigPath(_0x271372);await runFromImport(_0x583833,_0x43958d);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0xaf4860(0x190)]);async function runFromImport(_0x19ca96,_0x5c79c8){const _0x512dd1=a31_0xaf4860,_0x26099d=resolveFilePath(_0x19ca96[_0x512dd1(0x17f)]);if(!existsSync(_0x26099d))throw CliErrors[_0x512dd1(0x16b)](_0x512dd1(0x153)+_0x26099d);const _0x20a03b=readSourceFile(_0x26099d),_0x54971a=convertToRuntimeConfig(_0x20a03b);_0x19ca96[_0x512dd1(0x157)]&&(_0x54971a[_0x512dd1(0x157)]=String(_0x19ca96['appcode']));_0x19ca96['env']&&(_0x54971a['env']=resolveInitEnv(_0x19ca96));if(!_0x54971a['appcode'])throw CliErrors['validation'](_0x512dd1(0x156),_0x512dd1(0x186));await writeInitConfig(_0x5c79c8,_0x54971a,_0x19ca96),console[_0x512dd1(0x17c)](_0x512dd1(0x187)+_0x26099d),console[_0x512dd1(0x17c)](_0x512dd1(0x146)+_0x5c79c8),console['log'](_0x512dd1(0x175)+_0x54971a['appcode']);if(_0x54971a['defaultApp'])console[_0x512dd1(0x17c)](_0x512dd1(0x17d)+_0x54971a[_0x512dd1(0x15b)]);}function convertToRuntimeConfig(_0x229d1c){const _0x10f735=a31_0xaf4860;if(_0x229d1c[_0x10f735(0x152)]&&typeof _0x229d1c[_0x10f735(0x152)]===_0x10f735(0x180))throw CliErrors[_0x10f735(0x16b)](_0x10f735(0x18e),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x4f4623={};for(const _0x57906b of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x229d1c[_0x57906b]!==undefined&&(_0x4f4623[_0x57906b]=_0x229d1c[_0x57906b]);}return!_0x4f4623['riskLevel']&&(_0x4f4623[_0x10f735(0x166)]=DEFAULT_CONFIG_VALUES[_0x10f735(0x166)]),_0x4f4623;}async function runNonInteractive(_0x4400d5,_0xa8c3eb){const _0x20d76f=a31_0xaf4860,_0x318056=_0x4400d5[_0x20d76f(0x157)];if(!_0x318056)throw CliErrors[_0x20d76f(0x172)](_0x20d76f(0x157),_0x20d76f(0x167)+CLI_BIN_NAME+_0x20d76f(0x14d));const _0x540938=resolveInitEnv(_0x4400d5);await writeInitConfig(_0xa8c3eb,{'appcode':_0x318056,'env':_0x540938},_0x4400d5),console['log'](_0x20d76f(0x179)+_0xa8c3eb),console[_0x20d76f(0x17c)](_0x20d76f(0x175)+_0x318056),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x540938);}async function runInteractive(_0x2bcf07,_0x2a56b3){const _0x3a4a13=a31_0xaf4860,_0x596ece=loadExisting(_0x2a56b3),_0xf9074b=typeof _0x596ece?.[_0x3a4a13(0x157)]==='string'?_0x596ece[_0x3a4a13(0x157)]:'',_0x5e2851=resolveInitEnv(_0x2bcf07);console['log'](CLI_BIN_NAME+_0x3a4a13(0x15c)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x2a56b3)&&!_0x2bcf07[_0x3a4a13(0x164)]){const _0x20f4c1=await promptYesNo(_0x3a4a13(0x16d)+_0x2a56b3+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x20f4c1){console[_0x3a4a13(0x17c)](_0x3a4a13(0x17e));return;}}const _0x2cfd2d=typeof _0x2bcf07[_0x3a4a13(0x157)]===_0x3a4a13(0x181)?_0x2bcf07[_0x3a4a13(0x157)][_0x3a4a13(0x18a)]():'';let _0x3f3181=_0x2cfd2d;!_0x3f3181&&(_0x3f3181=await promptInput(_0x3a4a13(0x170),_0xf9074b));if(!_0x3f3181[_0x3a4a13(0x18a)]())throw CliErrors[_0x3a4a13(0x16b)](_0x3a4a13(0x147));await writeInitConfig(_0x2a56b3,{'appcode':_0x3f3181['trim'](),'env':_0x5e2851},_0x2bcf07),console['log'](_0x3a4a13(0x15f)+_0x2a56b3),console[_0x3a4a13(0x17c)](_0x3a4a13(0x175)+_0x3f3181[_0x3a4a13(0x18a)]()),console['log'](_0x3a4a13(0x150)+_0x5e2851);}async function writeInitConfig(_0x134264,_0x54d211,_0x3d51c5){const _0x30d429=a31_0xaf4860;let _0x3604d0={};existsSync(_0x134264)&&!_0x3d51c5[_0x30d429(0x164)]&&(_0x3604d0=readConfigFile(_0x134264));for(const [_0x3a4548,_0xf6930c]of Object[_0x30d429(0x16c)](_0x54d211)){_0xf6930c!==undefined&&(_0x3604d0[_0x3a4548]=_0xf6930c);}if(_0x3604d0[_0x30d429(0x165)])delete _0x3604d0['app'];writeConfigFile(_0x134264,_0x3604d0);}class AbortPrompt extends Error{constructor(){const _0xc8acda=a31_0xaf4860;super('User\x20aborted\x20prompt'),this[_0xc8acda(0x18c)]=_0xc8acda(0x188);}}function createSafeRl(){const _0x3ec8a1=a31_0xaf4860,_0x42aeed=createInterface({'input':process[_0x3ec8a1(0x162)],'output':process[_0x3ec8a1(0x16e)]});let _0x2753eb;const _0x2c5380=new Promise((_0x58036d,_0x14d7f6)=>{const _0x3f55ae=_0x3ec8a1;_0x2753eb=()=>{const _0x22ad3b=a31_0x2b47;_0x2753eb&&(_0x42aeed[_0x22ad3b(0x171)](_0x22ad3b(0x185),_0x2753eb),_0x2753eb=undefined);try{_0x42aeed[_0x22ad3b(0x189)]();}catch{}_0x14d7f6(new AbortPrompt());},_0x42aeed[_0x3f55ae(0x173)](_0x3f55ae(0x185),_0x2753eb);}),_0x1f74bf=()=>{const _0x31300e=_0x3ec8a1;_0x2753eb&&(_0x42aeed[_0x31300e(0x171)]('SIGINT',_0x2753eb),_0x2753eb=undefined);try{_0x42aeed[_0x31300e(0x189)]();}catch{}};return{'rl':_0x42aeed,'abortPromise':_0x2c5380,'disposeSuccess':_0x1f74bf};}async function promptInput(_0x175f09,_0x3241e7){const _0xd70e23=a31_0xaf4860,{rl:_0x434a78,abortPromise:_0x37bb72,disposeSuccess:_0x4812ce}=createSafeRl(),_0x37c19d=new Promise(_0x45c677=>{const _0x577a82=a31_0x2b47,_0x303ee1=_0x3241e7?'\x20\x20'+_0x175f09+'\x20('+_0x3241e7+'):\x20':'\x20\x20'+_0x175f09+':\x20';_0x434a78[_0x577a82(0x17b)](_0x303ee1,_0x41f9f5=>{_0x4812ce(),_0x45c677(_0x41f9f5['trim']()||_0x3241e7);});});return Promise[_0xd70e23(0x18f)]([_0x37c19d,_0x37bb72]);}async function promptYesNo(_0x20b286,_0x48fcb8){const {rl:_0x465444,abortPromise:_0x2ae005,disposeSuccess:_0x516d5e}=createSafeRl(),_0x3c6b66=new Promise(_0x7ef5f3=>{const _0x310591=a31_0x2b47,_0x52d499=_0x48fcb8?_0x310591(0x155):_0x310591(0x168);_0x465444[_0x310591(0x17b)]('\x20\x20'+_0x20b286+'\x20'+_0x52d499+':\x20',_0x4c691b=>{_0x516d5e();const _0x2bc3fb=_0x4c691b['trim']()['toLowerCase']();if(_0x2bc3fb==='y'||_0x2bc3fb==='yes')_0x7ef5f3(!![]);else{if(_0x2bc3fb==='n'||_0x2bc3fb==='no')_0x7ef5f3(![]);else _0x7ef5f3(_0x48fcb8);}});});return Promise['race']([_0x3c6b66,_0x2ae005]);}function loadExisting(_0x11eeaf){if(!existsSync(_0x11eeaf))return null;return readConfigFile(_0x11eeaf);}function resolveFilePath(_0x571293){const _0x68870f=a31_0xaf4860;return isAbsolute(_0x571293)?_0x571293:resolve(process[_0x68870f(0x151)](),_0x571293);}function readSourceFile(_0x5134a5){const _0x3792a1=a31_0xaf4860;try{const _0x32375e=readFileSync(_0x5134a5,{'encoding':_0x3792a1(0x183)});return JSON[_0x3792a1(0x161)](_0x32375e);}catch(_0x36f9bb){throw CliErrors[_0x3792a1(0x16b)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x36f9bb[_0x3792a1(0x174)]);}}function a31_0x156b(){const _0x4da3c3=['name','\x22.\x20Allowed:\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','race','apiDir','\x20\x20config:\x20\x20','App\x20code\x20cannot\x20be\x20empty.','Skip\x20confirmation\x20when\x20overwriting','boolean','268300hTwqGZ','env','1518432wTauvH','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]',')\x20instead\x20of\x20project','cancelled','\x20\x20env:\x20\x20\x20\x20\x20','cwd','apps','Source\x20file\x20not\x20found:\x20','10111648jYvknM','[Y/n]','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','appcode','project','3590657FRJcmM','includes','defaultApp','\x20init\x20—\x20Create\x20','2429575iQWbFe','global','\x0aInitialized\x20','Invalid\x20env\x20\x22','parse','stdin','App\x20code\x20for\x20the\x20project','yes','app','riskLevel','Usage:\x20','[y/N]','Target\x20environment\x20(default\x20','Write\x20to\x20global\x20(~/','validation','entries','File\x20','stdout','3ryFjey','App\x20code','removeListener','flagMissing','once','message','\x20\x20appcode:\x20','Override\x20imported\x20default\x20env','newConfigFileName','Override\x20imported\x20default\x20appcode','Initialized\x20','2178376LuTZps','question','log','\x20\x20default:\x20','Aborted.','file','object','string','join','utf8','190874rJewxK','SIGINT','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`.','Imported\x20from\x20','AbortPrompt','close','trim','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path'];a31_0x156b=function(){return _0x4da3c3;};return a31_0x156b();}function resolveInitEnv(_0x517a32){const _0x69fa83=a31_0xaf4860,_0x41f9f2=_0x517a32[_0x69fa83(0x14b)];if(_0x41f9f2===undefined||_0x41f9f2==='')return DEFAULT_CONFIG_VALUES[_0x69fa83(0x14b)];if(!RUNTIME_ENV_VALUES[_0x69fa83(0x15a)](_0x41f9f2))throw CliErrors['validation'](_0x69fa83(0x160)+_0x41f9f2+_0x69fa83(0x18d)+RUNTIME_ENV_VALUES[_0x69fa83(0x182)](',\x20'));return _0x41f9f2;}
@@ -1 +1 @@
1
- function a31_0x3c4d(){const _0x599685=['Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','--topk\x20must\x20be\x20a\x20positive\x20number.','read','scope','/update','description','3109992sDAkYp','bool','query','build','trim','length','1762956IzmMxC','score','132eDlBTB','isFile','map','/client/knowledge-base/personal/create','25782ghuLhD','updateTime','createTime','update','num','POST','flag','str','string','799857vYcEMI','isFinite','2032915pUIMdf','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','verbose','Personal\x20knowledge-base\x20entry\x20title','version','number','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','ragErrorMessage','write','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','body','/client/knowledge-base/personal/','10EbvFES','content','file','Updated\x20KB\x20entry\x20','Personal\x20knowledge-base\x20entry\x20ID','File\x20not\x20found:\x20','validation','ragStatus','userId','metadata','Search\x20query\x20is\x20required.','topk','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','title','appCode','list','detail','6555868fzBxAR','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','7giiDhT','weightedScore','Override\x20the\x20existing\x20entry\x20title','19KPKtHQ','25611UYvIVk'];a31_0x3c4d=function(){return _0x599685;};return a31_0x3c4d();}const a31_0x45418e=a31_0x9e5c;(function(_0x572617,_0xabda37){const _0x17e0ad=a31_0x9e5c,_0x25a943=_0x572617();while(!![]){try{const _0x3c6491=parseInt(_0x17e0ad(0x9b))/0x1*(-parseInt(_0x17e0ad(0xaf))/0x2)+-parseInt(_0x17e0ad(0x9c))/0x3*(-parseInt(_0x17e0ad(0xab))/0x4)+-parseInt(_0x17e0ad(0xba))/0x5+parseInt(_0x17e0ad(0xa9))/0x6+-parseInt(_0x17e0ad(0x98))/0x7*(parseInt(_0x17e0ad(0xa3))/0x8)+parseInt(_0x17e0ad(0xb8))/0x9*(parseInt(_0x17e0ad(0x85))/0xa)+parseInt(_0x17e0ad(0x96))/0xb;if(_0x3c6491===_0xabda37)break;else _0x25a943['push'](_0x25a943['shift']());}catch(_0x299255){_0x25a943['push'](_0x25a943['shift']());}}}(a31_0x3c4d,0x35bf3));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 a31_0x9e5c(_0x421e0f,_0x2b675a){_0x421e0f=_0x421e0f-0x85;const _0x3c4d5a=a31_0x3c4d();let _0x9e5c88=_0x3c4d5a[_0x421e0f];return _0x9e5c88;}const TITLE_FLAG={'name':a31_0x45418e(0x92),'type':'string','required':!![],'description':a31_0x45418e(0xbd)},FILE_FLAG={'name':a31_0x45418e(0x87),'type':a31_0x45418e(0xb7),'required':!![],'description':a31_0x45418e(0xc3)},QUERY_FLAG={'name':a31_0x45418e(0xa5),'type':a31_0x45418e(0xb7),'required':!![],'description':a31_0x45418e(0xbb)},TOPK_FLAG={'name':a31_0x45418e(0x90),'type':a31_0x45418e(0xbf),'description':'Maximum\x20number\x20of\x20search\x20hits\x20to\x20return'};function readKnowledgeFile(_0x2fa550){const _0x8fc3ae=a31_0x45418e;if(!_0x2fa550)throw CliErrors[_0x8fc3ae(0x8b)]('File\x20path\x20is\x20required.');if(!existsSync(_0x2fa550))throw CliErrors['validation'](_0x8fc3ae(0x8a)+_0x2fa550);if(!statSync(_0x2fa550)[_0x8fc3ae(0xac)]())throw CliErrors[_0x8fc3ae(0x8b)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x2fa550);return readFileSync(_0x2fa550,'utf8');}function summarizePersonalItem(_0x3a5181){const _0x2c3894=a31_0x45418e;return{'id':_0x3a5181['id'],'title':_0x3a5181[_0x2c3894(0x92)],'version':_0x3a5181['version'],'ragStatus':_0x3a5181[_0x2c3894(0x8c)],'ragErrorMessage':_0x3a5181[_0x2c3894(0xc1)],'updateTime':_0x3a5181[_0x2c3894(0xb0)]};}function detailPersonalItem(_0x3e6212){const _0x126bce=a31_0x45418e;return{'id':_0x3e6212['id'],'appCode':_0x3e6212[_0x126bce(0x93)],'scope':_0x3e6212[_0x126bce(0xa0)],'userId':_0x3e6212[_0x126bce(0x8d)],'title':_0x3e6212[_0x126bce(0x92)],'content':_0x3e6212[_0x126bce(0x86)]??'','version':_0x3e6212[_0x126bce(0xbe)],'ragStatus':_0x3e6212[_0x126bce(0x8c)],'ragErrorMessage':_0x3e6212[_0x126bce(0xc1)],'createTime':_0x3e6212[_0x126bce(0xb1)],'updateTime':_0x3e6212[_0x126bce(0xb0)]};}function summarizeSearchHit(_0x4b9509){const _0x51d03c=a31_0x45418e;return{'scope':_0x4b9509['scope'],'title':_0x4b9509['title'],'docId':_0x4b9509['docId'],'score':_0x4b9509[_0x51d03c(0xaa)],'weightedScore':_0x4b9509[_0x51d03c(0x99)],'content':_0x4b9509[_0x51d03c(0x86)],'metadata':_0x4b9509[_0x51d03c(0x8e)]};}function readTopK(_0x1cbc0d){const _0x34dd4c=a31_0x45418e,_0x3f06a5=_0x1cbc0d[_0x34dd4c(0xb5)](_0x34dd4c(0x90));if(_0x3f06a5===undefined||_0x3f06a5===null||_0x3f06a5==='')return undefined;const _0x5b0c29=_0x1cbc0d[_0x34dd4c(0xb3)](_0x34dd4c(0x90));if(!Number[_0x34dd4c(0xb9)](_0x5b0c29)||_0x5b0c29<0x1)throw CliErrors[_0x34dd4c(0x8b)](_0x34dd4c(0x9e));return _0x5b0c29;}const kbList={'service':'kb','command':a31_0x45418e(0x94),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x423022){const _0x36e6c9=a31_0x45418e,_0x30cc07=await listPersonalKnowledgeBaseItems(_0x423022[_0x36e6c9(0x93)]);if(_0x423022[_0x36e6c9(0xa4)](_0x36e6c9(0xbc)))return{'ok':!![],'data':{'total':_0x30cc07[_0x36e6c9(0xa8)],'items':_0x30cc07}};return{'ok':!![],'data':{'total':_0x30cc07['length'],'items':_0x30cc07[_0x36e6c9(0xad)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a31_0x45418e(0x95),'description':a31_0x45418e(0x91),'risk':a31_0x45418e(0x9f),'flags':[{...ID_FLAG,'description':a31_0x45418e(0x89)}],async 'execute'(_0x705af7){const _0x501e7e=a31_0x45418e,_0x576408=await getPersonalKnowledgeBaseItem(_0x705af7['num']('id'),_0x705af7[_0x501e7e(0x93)]);return{'ok':!![],'data':detailPersonalItem(_0x576408)};}},kbCreate={'service':'kb','command':'create','description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a31_0x45418e(0xc2),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x15713f){const _0x13dce7=a31_0x45418e,_0x247c76=_0x15713f[_0x13dce7(0xb6)](_0x13dce7(0x92)),_0x3b4d94=readKnowledgeFile(_0x15713f[_0x13dce7(0xb6)](_0x13dce7(0x87))),_0x34dab4=await createPersonalKnowledgeBaseItem(_0x15713f[_0x13dce7(0x93)],{'title':_0x247c76,'content':_0x3b4d94});return{'ok':!![],'data':summarizePersonalItem(_0x34dab4),'message':'Created\x20KB\x20entry\x20'+_0x34dab4['id']+'\x20('+_0x34dab4[_0x13dce7(0x92)]+')'};},async 'dryRun'(_0x3e66b8){const _0x4a0ee9=a31_0x45418e,_0x56139a=_0x3e66b8[_0x4a0ee9(0xb6)]('title'),_0x5d7738=readKnowledgeFile(_0x3e66b8['str'](_0x4a0ee9(0x87)));return dryRun('POST',_0x4a0ee9(0xae))['body']({'appCode':_0x3e66b8['appCode'],'title':_0x56139a,'content':_0x5d7738})[_0x4a0ee9(0xa2)](_0x4a0ee9(0x9d)+_0x56139a+'\x22')[_0x4a0ee9(0xa6)]();}},kbUpdate={'service':'kb','command':a31_0x45418e(0xb2),'description':a31_0x45418e(0x97),'risk':'write','flags':[{...ID_FLAG,'description':a31_0x45418e(0x89)},{...TITLE_FLAG,'required':![],'description':a31_0x45418e(0x9a)},FILE_FLAG],async 'execute'(_0x1e2b2a){const _0x2f54dd=a31_0x45418e,_0x909b3a=_0x1e2b2a[_0x2f54dd(0xb3)]('id'),_0x41b7fe=readKnowledgeFile(_0x1e2b2a[_0x2f54dd(0xb6)]('file')),_0x2e80f8=_0x1e2b2a[_0x2f54dd(0xb6)]('title')||(await getPersonalKnowledgeBaseItem(_0x909b3a,_0x1e2b2a[_0x2f54dd(0x93)]))[_0x2f54dd(0x92)],_0x191471=await updatePersonalKnowledgeBaseItem(_0x909b3a,_0x1e2b2a[_0x2f54dd(0x93)],{'title':_0x2e80f8,'content':_0x41b7fe});return{'ok':!![],'data':summarizePersonalItem(_0x191471),'message':_0x2f54dd(0x88)+_0x191471['id']+'\x20('+_0x191471['title']+')'};},async 'dryRun'(_0xfc57c6){const _0x5af3b2=a31_0x45418e,_0x2204e2=_0xfc57c6[_0x5af3b2(0xb3)]('id'),_0x5ad480=readKnowledgeFile(_0xfc57c6[_0x5af3b2(0xb6)](_0x5af3b2(0x87))),_0x1e2f87=_0xfc57c6[_0x5af3b2(0xb6)]('title')||(await getPersonalKnowledgeBaseItem(_0x2204e2,_0xfc57c6[_0x5af3b2(0x93)]))[_0x5af3b2(0x92)];return dryRun(_0x5af3b2(0xb4),_0x5af3b2(0xc5)+_0x2204e2+_0x5af3b2(0xa1))[_0x5af3b2(0xc4)]({'appCode':_0xfc57c6[_0x5af3b2(0x93)],'title':_0x1e2f87,'content':_0x5ad480})[_0x5af3b2(0xa2)](_0x5af3b2(0xc0)+_0x2204e2)['build']();}},kbSearch={'service':'kb','command':'search','description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a31_0x45418e(0x9f),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x107dd3){const _0x47a25c=a31_0x45418e;if(!_0x107dd3[_0x47a25c(0xb6)](_0x47a25c(0xa5))[_0x47a25c(0xa7)]())throw CliErrors['validation'](_0x47a25c(0x8f));readTopK(_0x107dd3);},async 'execute'(_0x46e3f5){const _0x3f819e=a31_0x45418e,_0x316074=_0x46e3f5['str'](_0x3f819e(0xa5))[_0x3f819e(0xa7)](),_0x4c30d2=readTopK(_0x46e3f5),_0x40e87d=await searchKnowledgeBase(_0x46e3f5['appCode'],{'query':_0x316074,'topK':_0x4c30d2});return{'ok':!![],'data':{'total':_0x40e87d[_0x3f819e(0xa8)],'hits':_0x40e87d[_0x3f819e(0xad)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a32_0x1a4d95=a32_0x5928;(function(_0x3b6ce5,_0x4455e9){const _0x36a0da=a32_0x5928,_0x4e980e=_0x3b6ce5();while(!![]){try{const _0x5c9c80=parseInt(_0x36a0da(0x1d9))/0x1+-parseInt(_0x36a0da(0x1f8))/0x2+parseInt(_0x36a0da(0x1e1))/0x3*(parseInt(_0x36a0da(0x1f9))/0x4)+parseInt(_0x36a0da(0x203))/0x5+parseInt(_0x36a0da(0x1f3))/0x6+-parseInt(_0x36a0da(0x1ed))/0x7+-parseInt(_0x36a0da(0x1e9))/0x8*(parseInt(_0x36a0da(0x201))/0x9);if(_0x5c9c80===_0x4455e9)break;else _0x4e980e['push'](_0x4e980e['shift']());}catch(_0x3f0b2c){_0x4e980e['push'](_0x4e980e['shift']());}}}(a32_0x3fdd,0x94bb7));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';function a32_0x5928(_0x352712,_0x477c7e){_0x352712=_0x352712-0x1cc;const _0x3fdd15=a32_0x3fdd();let _0x5928f8=_0x3fdd15[_0x352712];return _0x5928f8;}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x1a4d95(0x1d7),'type':a32_0x1a4d95(0x1d8),'required':!![],'description':a32_0x1a4d95(0x1dc)},FILE_FLAG={'name':'file','type':a32_0x1a4d95(0x1d8),'required':!![],'description':a32_0x1a4d95(0x1d4)},QUERY_FLAG={'name':a32_0x1a4d95(0x1e8),'type':a32_0x1a4d95(0x1d8),'required':!![],'description':a32_0x1a4d95(0x1d3)},TOPK_FLAG={'name':a32_0x1a4d95(0x1fd),'type':'number','description':'Maximum\x20number\x20of\x20search\x20hits\x20to\x20return'};function readKnowledgeFile(_0x36ae5a){const _0x4afc92=a32_0x1a4d95;if(!_0x36ae5a)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x36ae5a))throw CliErrors['validation'](_0x4afc92(0x1e5)+_0x36ae5a);if(!statSync(_0x36ae5a)[_0x4afc92(0x1f4)]())throw CliErrors['validation'](_0x4afc92(0x1dd)+_0x36ae5a);return readFileSync(_0x36ae5a,_0x4afc92(0x1d1));}function summarizePersonalItem(_0x4aed66){const _0x338450=a32_0x1a4d95;return{'id':_0x4aed66['id'],'title':_0x4aed66[_0x338450(0x1d7)],'version':_0x4aed66[_0x338450(0x204)],'ragStatus':_0x4aed66[_0x338450(0x1ef)],'ragErrorMessage':_0x4aed66[_0x338450(0x208)],'updateTime':_0x4aed66[_0x338450(0x1de)]};}function a32_0x3fdd(){const _0x459cbb=['1630715jGLGSx','version','Override\x20the\x20existing\x20entry\x20title','flag','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','ragErrorMessage','num','map','body','/update','read','str','file','utf8','Personal\x20knowledge-base\x20entry\x20ID','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','createTime','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','title','string','128454PbFQvN','docId','write','Personal\x20knowledge-base\x20entry\x20title','File\x20is\x20not\x20a\x20regular\x20file:\x20','updateTime','search','POST','6QAgsXv','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','/client/knowledge-base/personal/create','content','File\x20not\x20found:\x20','create','/client/knowledge-base/personal/','query','38328AcLLNl','Search\x20query\x20is\x20required.','--topk\x20must\x20be\x20a\x20positive\x20number.','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','6380864AHtiln','length','ragStatus','build','Updated\x20KB\x20entry\x20','score','6018504eLEKPk','isFile','trim','appCode','description','1028742pAHJXi','1202808xbiUNO','metadata','validation','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','topk','bool','list','scope','45hzvCXK','isFinite'];a32_0x3fdd=function(){return _0x459cbb;};return a32_0x3fdd();}function detailPersonalItem(_0x47ee19){const _0xe72f5f=a32_0x1a4d95;return{'id':_0x47ee19['id'],'appCode':_0x47ee19[_0xe72f5f(0x1f6)],'scope':_0x47ee19[_0xe72f5f(0x200)],'userId':_0x47ee19['userId'],'title':_0x47ee19[_0xe72f5f(0x1d7)],'content':_0x47ee19[_0xe72f5f(0x1e4)]??'','version':_0x47ee19[_0xe72f5f(0x204)],'ragStatus':_0x47ee19[_0xe72f5f(0x1ef)],'ragErrorMessage':_0x47ee19[_0xe72f5f(0x208)],'createTime':_0x47ee19[_0xe72f5f(0x1d5)],'updateTime':_0x47ee19[_0xe72f5f(0x1de)]};}function summarizeSearchHit(_0x482974){const _0x10ea0d=a32_0x1a4d95;return{'scope':_0x482974['scope'],'title':_0x482974[_0x10ea0d(0x1d7)],'docId':_0x482974[_0x10ea0d(0x1da)],'score':_0x482974[_0x10ea0d(0x1f2)],'weightedScore':_0x482974['weightedScore'],'content':_0x482974[_0x10ea0d(0x1e4)],'metadata':_0x482974[_0x10ea0d(0x1fa)]};}function readTopK(_0x3ead03){const _0x570e1f=a32_0x1a4d95,_0x2d3f0f=_0x3ead03[_0x570e1f(0x206)](_0x570e1f(0x1fd));if(_0x2d3f0f===undefined||_0x2d3f0f===null||_0x2d3f0f==='')return undefined;const _0x199357=_0x3ead03[_0x570e1f(0x209)](_0x570e1f(0x1fd));if(!Number[_0x570e1f(0x202)](_0x199357)||_0x199357<0x1)throw CliErrors['validation'](_0x570e1f(0x1eb));return _0x199357;}const kbList={'service':'kb','command':a32_0x1a4d95(0x1ff),'description':a32_0x1a4d95(0x1d6),'risk':a32_0x1a4d95(0x1ce),'flags':[VERBOSE_FLAG],async 'execute'(_0x32c2c1){const _0x3da41e=a32_0x1a4d95,_0x5e1f93=await listPersonalKnowledgeBaseItems(_0x32c2c1[_0x3da41e(0x1f6)]);if(_0x32c2c1[_0x3da41e(0x1fe)]('verbose'))return{'ok':!![],'data':{'total':_0x5e1f93['length'],'items':_0x5e1f93}};return{'ok':!![],'data':{'total':_0x5e1f93[_0x3da41e(0x1ee)],'items':_0x5e1f93[_0x3da41e(0x20a)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':a32_0x1a4d95(0x1ce),'flags':[{...ID_FLAG,'description':a32_0x1a4d95(0x1d2)}],async 'execute'(_0x433172){const _0x25f2c6=a32_0x1a4d95,_0x2e8b99=await getPersonalKnowledgeBaseItem(_0x433172[_0x25f2c6(0x209)]('id'),_0x433172[_0x25f2c6(0x1f6)]);return{'ok':!![],'data':detailPersonalItem(_0x2e8b99)};}},kbCreate={'service':'kb','command':a32_0x1a4d95(0x1e6),'description':a32_0x1a4d95(0x1e2),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0xd91a5b){const _0x57b48f=a32_0x1a4d95,_0x635997=_0xd91a5b[_0x57b48f(0x1cf)](_0x57b48f(0x1d7)),_0x4c7013=readKnowledgeFile(_0xd91a5b[_0x57b48f(0x1cf)]('file')),_0x4d2961=await createPersonalKnowledgeBaseItem(_0xd91a5b['appCode'],{'title':_0x635997,'content':_0x4c7013});return{'ok':!![],'data':summarizePersonalItem(_0x4d2961),'message':'Created\x20KB\x20entry\x20'+_0x4d2961['id']+'\x20('+_0x4d2961['title']+')'};},async 'dryRun'(_0x1e6430){const _0x297ae1=a32_0x1a4d95,_0x22d604=_0x1e6430['str']('title'),_0xc59725=readKnowledgeFile(_0x1e6430['str'](_0x297ae1(0x1d0)));return dryRun('POST',_0x297ae1(0x1e3))[_0x297ae1(0x1cc)]({'appCode':_0x1e6430[_0x297ae1(0x1f6)],'title':_0x22d604,'content':_0xc59725})[_0x297ae1(0x1f7)](_0x297ae1(0x207)+_0x22d604+'\x22')[_0x297ae1(0x1f0)]();}},kbUpdate={'service':'kb','command':'update','description':a32_0x1a4d95(0x1ec),'risk':a32_0x1a4d95(0x1db),'flags':[{...ID_FLAG,'description':a32_0x1a4d95(0x1d2)},{...TITLE_FLAG,'required':![],'description':a32_0x1a4d95(0x205)},FILE_FLAG],async 'execute'(_0x480cce){const _0x22efa9=a32_0x1a4d95,_0x4ba1ee=_0x480cce['num']('id'),_0x4447e9=readKnowledgeFile(_0x480cce[_0x22efa9(0x1cf)](_0x22efa9(0x1d0))),_0x4d506a=_0x480cce['str'](_0x22efa9(0x1d7))||(await getPersonalKnowledgeBaseItem(_0x4ba1ee,_0x480cce['appCode']))[_0x22efa9(0x1d7)],_0x2ccb84=await updatePersonalKnowledgeBaseItem(_0x4ba1ee,_0x480cce['appCode'],{'title':_0x4d506a,'content':_0x4447e9});return{'ok':!![],'data':summarizePersonalItem(_0x2ccb84),'message':_0x22efa9(0x1f1)+_0x2ccb84['id']+'\x20('+_0x2ccb84['title']+')'};},async 'dryRun'(_0x22ba2e){const _0x599c26=a32_0x1a4d95,_0x19f5c1=_0x22ba2e[_0x599c26(0x209)]('id'),_0x29a6ca=readKnowledgeFile(_0x22ba2e[_0x599c26(0x1cf)](_0x599c26(0x1d0))),_0xa82c8b=_0x22ba2e[_0x599c26(0x1cf)](_0x599c26(0x1d7))||(await getPersonalKnowledgeBaseItem(_0x19f5c1,_0x22ba2e[_0x599c26(0x1f6)]))['title'];return dryRun(_0x599c26(0x1e0),_0x599c26(0x1e7)+_0x19f5c1+_0x599c26(0x1cd))[_0x599c26(0x1cc)]({'appCode':_0x22ba2e[_0x599c26(0x1f6)],'title':_0xa82c8b,'content':_0x29a6ca})[_0x599c26(0x1f7)](_0x599c26(0x1fc)+_0x19f5c1)['build']();}},kbSearch={'service':'kb','command':a32_0x1a4d95(0x1df),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a32_0x1a4d95(0x1ce),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x4cff8c){const _0x4a4f78=a32_0x1a4d95;if(!_0x4cff8c[_0x4a4f78(0x1cf)](_0x4a4f78(0x1e8))[_0x4a4f78(0x1f5)]())throw CliErrors[_0x4a4f78(0x1fb)](_0x4a4f78(0x1ea));readTopK(_0x4cff8c);},async 'execute'(_0x17529b){const _0x22db5a=a32_0x1a4d95,_0x502c62=_0x17529b['str']('query')[_0x22db5a(0x1f5)](),_0x5f2389=readTopK(_0x17529b),_0x5408d1=await searchKnowledgeBase(_0x17529b['appCode'],{'query':_0x502c62,'topK':_0x5f2389});return{'ok':!![],'data':{'total':_0x5408d1['length'],'hits':_0x5408d1['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- function a32_0x30ca(_0x5dcaf2,_0x14a1ba){_0x5dcaf2=_0x5dcaf2-0x1e2;const _0x207dc2=a32_0x207d();let _0x30ca1a=_0x207dc2[_0x5dcaf2];return _0x30ca1a;}const a32_0x4234c2=a32_0x30ca;(function(_0x2db155,_0x2b1f7c){const _0x22e538=a32_0x30ca,_0x52d977=_0x2db155();while(!![]){try{const _0x2c5134=parseInt(_0x22e538(0x207))/0x1*(-parseInt(_0x22e538(0x1f8))/0x2)+-parseInt(_0x22e538(0x1fa))/0x3*(-parseInt(_0x22e538(0x1fb))/0x4)+-parseInt(_0x22e538(0x205))/0x5+-parseInt(_0x22e538(0x1e8))/0x6+parseInt(_0x22e538(0x1ff))/0x7+-parseInt(_0x22e538(0x1fe))/0x8*(parseInt(_0x22e538(0x200))/0x9)+parseInt(_0x22e538(0x1e9))/0xa;if(_0x2c5134===_0x2b1f7c)break;else _0x52d977['push'](_0x52d977['shift']());}catch(_0xa638bd){_0x52d977['push'](_0x52d977['shift']());}}}(a32_0x207d,0x6e52a));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x2cf22f){const _0xd9d122=a32_0x30ca;if(_0x2cf22f['length']===0x0){console[_0xd9d122(0x204)]('*\x20No\x20logs\x20found');return;}console[_0xd9d122(0x204)]('*\x20'+CLI_DISPLAY_NAME+_0xd9d122(0x1f5)),_0x2cf22f[_0xd9d122(0x1f6)]((_0x33db4e,_0x6bd377)=>{const _0x5a1887=_0xd9d122,_0xbb291c=new Date(_0x33db4e[_0x5a1887(0x1ea)])[_0x5a1887(0x1fc)](_0x5a1887(0x1ee)),_0x3fb82b=_0x33db4e['level']===_0x5a1887(0x1ef)?'√':_0x33db4e['level']===_0x5a1887(0x202)?'×':_0x33db4e[_0x5a1887(0x1e5)]===_0x5a1887(0x1e6)?'!':'i';console[_0x5a1887(0x204)](_0x6bd377+0x1+'.\x20'+_0x3fb82b+'\x20['+_0x33db4e[_0x5a1887(0x1e4)]+']\x20'+_0x33db4e[_0x5a1887(0x1f1)]),console[_0x5a1887(0x204)]('\x20\x20\x20Time:\x20'+_0xbb291c),_0x33db4e['duration']&&console['log'](_0x5a1887(0x1f7)+_0x33db4e[_0x5a1887(0x1ed)]+'ms'),_0x33db4e['details']&&Object[_0x5a1887(0x203)](_0x33db4e['details'])[_0x5a1887(0x1f2)]>0x0&&console[_0x5a1887(0x204)](_0x5a1887(0x1e7)+JSON['stringify'](_0x33db4e[_0x5a1887(0x201)],null,0x2)),console['log']('');});}function a32_0x207d(){const _0x489abc=['\x20\x20\x20Details:\x20','1132842gSVxou','13497430sTkQNi','timestamp','readLogs','show','duration','en-US','success','Clear\x20command\x20history\x20logs','message','length','read','clear','\x20logs:\x0a','forEach','\x20\x20\x20Duration:\x20','138098hgARvf','write','677199ARReGt','4UuooKS','toLocaleString','clearLogs','8GzJgcJ','716177uugDok','6643413PbuBst','details','error','keys','log','804215mYojVX','logs','2FLIgNq','*\x20Logs\x20cleared','View\x20command\x20history\x20logs','command','level','warn'];a32_0x207d=function(){return _0x489abc;};return a32_0x207d();}export const logsDefinitions=[{'service':a32_0x4234c2(0x206),'command':a32_0x4234c2(0x1ec),'description':a32_0x4234c2(0x1e3),'risk':a32_0x4234c2(0x1f3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x375fd5){const _0x222977=a32_0x4234c2;return printLogs(logger[_0x222977(0x1eb)]()),{'ok':!![]};}},{'service':a32_0x4234c2(0x206),'command':a32_0x4234c2(0x1f4),'description':a32_0x4234c2(0x1f0),'risk':a32_0x4234c2(0x1f9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5aaff6){const _0x32023c=a32_0x4234c2;return logger[_0x32023c(0x1fd)](),console[_0x32023c(0x204)](_0x32023c(0x1e2)),{'ok':!![]};}}];
1
+ const a33_0x312b1f=a33_0x49d4;function a33_0x3963(){const _0x22007b=['clearLogs','timestamp','3063550cYfiyG','level','length','\x20logs:\x0a','6088XqgDoi','log','read','3447SwkFNi','success','78MwQRxn','27pSTKYi','*\x20No\x20logs\x20found','readLogs','en-US','\x20\x20\x20Details:\x20','keys','1022013BSTSkI','forEach','\x20\x20\x20Time:\x20','error','show','logs','details','5664650ySJrNa','duration','2AOYIJc','*\x20Logs\x20cleared','305548RobAyP','18155071oBcXfm','clear','\x20\x20\x20Duration:\x20','280255VwHYEE','message','stringify','View\x20command\x20history\x20logs','12TdxcZy','command','write'];a33_0x3963=function(){return _0x22007b;};return a33_0x3963();}(function(_0x16792e,_0x377782){const _0x36aaff=a33_0x49d4,_0x1fc8d5=_0x16792e();while(!![]){try{const _0x32cbbd=parseInt(_0x36aaff(0x1c8))/0x1*(parseInt(_0x36aaff(0x1d1))/0x2)+parseInt(_0x36aaff(0x1ea))/0x3*(-parseInt(_0x36aaff(0x1d3))/0x4)+-parseInt(_0x36aaff(0x1d7))/0x5*(parseInt(_0x36aaff(0x1e9))/0x6)+-parseInt(_0x36aaff(0x1e0))/0x7+parseInt(_0x36aaff(0x1e4))/0x8*(parseInt(_0x36aaff(0x1e7))/0x9)+-parseInt(_0x36aaff(0x1cf))/0xa+parseInt(_0x36aaff(0x1d4))/0xb*(parseInt(_0x36aaff(0x1db))/0xc);if(_0x32cbbd===_0x377782)break;else _0x1fc8d5['push'](_0x1fc8d5['shift']());}catch(_0x2a3ac8){_0x1fc8d5['push'](_0x1fc8d5['shift']());}}}(a33_0x3963,0x84bbc));import{logger}from'../../utils/logger.js';function a33_0x49d4(_0x551bbc,_0x5d9925){_0x551bbc=_0x551bbc-0x1c8;const _0x39637e=a33_0x3963();let _0x49d45b=_0x39637e[_0x551bbc];return _0x49d45b;}import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0xe8b2bd){const _0x5a081a=a33_0x49d4;if(_0xe8b2bd['length']===0x0){console[_0x5a081a(0x1e5)](_0x5a081a(0x1eb));return;}console[_0x5a081a(0x1e5)]('*\x20'+CLI_DISPLAY_NAME+_0x5a081a(0x1e3)),_0xe8b2bd[_0x5a081a(0x1c9)]((_0x3ae28b,_0x4ca0af)=>{const _0x29d4f9=_0x5a081a,_0x46ebca=new Date(_0x3ae28b[_0x29d4f9(0x1df)])['toLocaleString'](_0x29d4f9(0x1ed)),_0x42c922=_0x3ae28b['level']===_0x29d4f9(0x1e8)?'√':_0x3ae28b['level']===_0x29d4f9(0x1cb)?'×':_0x3ae28b[_0x29d4f9(0x1e1)]==='warn'?'!':'i';console[_0x29d4f9(0x1e5)](_0x4ca0af+0x1+'.\x20'+_0x42c922+'\x20['+_0x3ae28b[_0x29d4f9(0x1dc)]+']\x20'+_0x3ae28b[_0x29d4f9(0x1d8)]),console[_0x29d4f9(0x1e5)](_0x29d4f9(0x1ca)+_0x46ebca),_0x3ae28b[_0x29d4f9(0x1d0)]&&console['log'](_0x29d4f9(0x1d6)+_0x3ae28b[_0x29d4f9(0x1d0)]+'ms'),_0x3ae28b['details']&&Object[_0x29d4f9(0x1ef)](_0x3ae28b[_0x29d4f9(0x1ce)])[_0x29d4f9(0x1e2)]>0x0&&console[_0x29d4f9(0x1e5)](_0x29d4f9(0x1ee)+JSON[_0x29d4f9(0x1d9)](_0x3ae28b['details'],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':a33_0x312b1f(0x1cd),'command':a33_0x312b1f(0x1cc),'description':a33_0x312b1f(0x1da),'risk':a33_0x312b1f(0x1e6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1eff5d){const _0x285d4d=a33_0x312b1f;return printLogs(logger[_0x285d4d(0x1ec)]()),{'ok':!![]};}},{'service':a33_0x312b1f(0x1cd),'command':a33_0x312b1f(0x1d5),'description':'Clear\x20command\x20history\x20logs','risk':a33_0x312b1f(0x1dd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x231b55){const _0x2b4c8f=a33_0x312b1f;return logger[_0x2b4c8f(0x1de)](),console[_0x2b4c8f(0x1e5)](_0x2b4c8f(0x1d2)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a33_0x2467d8=a33_0x4b58;(function(_0x3a6423,_0x1bc964){const _0x5bd3b5=a33_0x4b58,_0x179342=_0x3a6423();while(!![]){try{const _0x5721f2=parseInt(_0x5bd3b5(0x146))/0x1+-parseInt(_0x5bd3b5(0x155))/0x2+-parseInt(_0x5bd3b5(0x148))/0x3+-parseInt(_0x5bd3b5(0x14a))/0x4*(-parseInt(_0x5bd3b5(0x15e))/0x5)+parseInt(_0x5bd3b5(0x14c))/0x6+-parseInt(_0x5bd3b5(0x142))/0x7+parseInt(_0x5bd3b5(0x149))/0x8;if(_0x5721f2===_0x1bc964)break;else _0x179342['push'](_0x179342['shift']());}catch(_0x4d91b4){_0x179342['push'](_0x179342['shift']());}}}(a33_0x23e1,0x91223));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a33_0x4b58(_0x3ec4fa,_0x3fbeb1){_0x3ec4fa=_0x3ec4fa-0x13a;const _0x23e17e=a33_0x23e1();let _0x4b58b9=_0x23e17e[_0x3ec4fa];return _0x4b58b9;}const SUPPORTED_SCENES=[a33_0x2467d8(0x13a),a33_0x2467d8(0x144),a33_0x2467d8(0x154),a33_0x2467d8(0x13f)],SCENE_TO_LEGACY_TYPE={'invoice':a33_0x2467d8(0x14f),'general':'General','form':a33_0x2467d8(0x161),'idCard':a33_0x2467d8(0x162)},SCENE_FLAG={'name':'scene','type':a33_0x2467d8(0x166),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a33_0x2467d8(0x15d)},IMAGE_FILE_FLAG={'name':a33_0x2467d8(0x15a),'type':a33_0x2467d8(0x166),'description':a33_0x2467d8(0x165)},IMAGE_URL_FLAG={'name':a33_0x2467d8(0x145),'type':a33_0x2467d8(0x166),'description':a33_0x2467d8(0x14b)};function normalizeScene(_0x31017c){const _0x166239=a33_0x2467d8,_0x224c59=_0x31017c['trim']()[_0x166239(0x15c)]();if(_0x224c59===_0x166239(0x13b))return'idCard';if(_0x224c59==='invoice'||_0x224c59==='general'||_0x224c59===_0x166239(0x154))return _0x224c59;throw CliErrors['validation'](_0x166239(0x163)+_0x31017c+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x4be909){const _0x1f188a=a33_0x2467d8,_0x5d4423=_0x4be909[_0x1f188a(0x164)](_0x1f188a(0x15a))[_0x1f188a(0x16a)](),_0x57c43e=_0x4be909[_0x1f188a(0x164)]('image-url')['trim']();return{'imageFile':_0x5d4423,'imageUrl':_0x57c43e,'count':[_0x5d4423,_0x57c43e][_0x1f188a(0x16b)](Boolean)['length']};}function validateInputSelection(_0x34dc1d){const _0x2f2b20=a33_0x2467d8,_0x34b015=selectedInputs(_0x34dc1d);if(_0x34b015[_0x2f2b20(0x16e)]!==0x1)throw CliErrors['validation']('Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.');return _0x34b015;}function withScene(_0x486903,_0x484d76,_0x325850){const _0x47f684=a33_0x2467d8;return{..._0x486903,'scene':_0x484d76,..._0x325850?{'sourceFile':{'fileName':_0x325850[_0x47f684(0x143)],'filePath':_0x325850[_0x47f684(0x14d)]}}:{}};}const ocrRecognize={'service':a33_0x2467d8(0x169),'command':a33_0x2467d8(0x156),'description':a33_0x2467d8(0x141),'risk':a33_0x2467d8(0x14e),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x318790){const _0x57f5c6=a33_0x2467d8,_0x33b786=normalizeScene(_0x318790[_0x57f5c6(0x164)]('scene')),_0x33994a=SCENE_TO_LEGACY_TYPE[_0x33b786],_0x446175=validateInputSelection(_0x318790);if(_0x446175['imageUrl'])return dryRun(_0x57f5c6(0x167),'/client/ocr')['body']({'appCode':_0x318790['appCode'],'url':_0x446175['imageUrl'],'type':_0x33994a})[_0x57f5c6(0x168)](_0x57f5c6(0x15f)+_0x33b786+_0x57f5c6(0x151))[_0x57f5c6(0x158)]();const _0x1cf2be=requireRuntimeUploadFile(_0x446175[_0x57f5c6(0x13d)],_0x57f5c6(0x15a));return dryRun(_0x57f5c6(0x167),_0x57f5c6(0x15b))[_0x57f5c6(0x159)]({'steps':[{'method':_0x57f5c6(0x167),'url':_0x57f5c6(0x15b),'body':{'appCode':_0x318790[_0x57f5c6(0x16c)],'multipart':{'file':_0x1cf2be}}},{'method':'POST','url':_0x57f5c6(0x13e),'body':{'filePath':_0x57f5c6(0x16d),'downloadFlag':![]}},{'method':_0x57f5c6(0x167),'url':_0x57f5c6(0x170),'body':{'appCode':_0x318790[_0x57f5c6(0x16c)],'url':_0x57f5c6(0x13c),'type':_0x33994a}}]})[_0x57f5c6(0x168)](_0x57f5c6(0x150)+_0x33b786+'\x20OCR')[_0x57f5c6(0x158)]();},async 'execute'(_0x3ea8ba){const _0x1a1916=a33_0x2467d8,_0x1a2dc0=normalizeScene(_0x3ea8ba[_0x1a1916(0x164)](_0x1a1916(0x160))),_0x29112b=SCENE_TO_LEGACY_TYPE[_0x1a2dc0],_0x1a7df0=validateInputSelection(_0x3ea8ba);if(_0x1a7df0['imageUrl']){const _0x1072a1=await recognizeRuntimeOcr(_0x3ea8ba[_0x1a1916(0x16c)],{'url':_0x1a7df0[_0x1a1916(0x157)],'type':_0x29112b});return{'ok':!![],'data':withScene(_0x1072a1,_0x1a2dc0)};}const _0x532bc0=requireRuntimeUploadFile(_0x1a7df0[_0x1a1916(0x13d)],'image-file'),_0x1d3fc6=await uploadRuntimeFile(_0x3ea8ba['appCode'],_0x532bc0[_0x1a1916(0x140)]);if(!_0x1d3fc6[_0x1a1916(0x14d)])throw CliErrors[_0x1a1916(0x16f)](_0x1a1916(0x153));const _0x17f152=await queryRuntimeFileUrl(_0x1d3fc6[_0x1a1916(0x14d)],{'download':![]});if(!_0x17f152[_0x1a1916(0x152)])throw CliErrors[_0x1a1916(0x16f)](_0x1a1916(0x147));const _0x52b0d4=await recognizeRuntimeOcr(_0x3ea8ba['appCode'],{'url':_0x17f152[_0x1a1916(0x152)],'type':_0x29112b});return{'ok':!![],'data':withScene(_0x52b0d4,_0x1a2dc0,_0x1d3fc6)};}};export const ocrDefinitions=[ocrRecognize];function a33_0x23e1(){const _0x5829ae=['File\x20upload\x20response\x20missing\x20filePath.','form','1193208aaloGX','recognize','imageUrl','build','body','image-file','/client/uploadFile','toLowerCase','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','75kkErhk','Preview:\x20recognize\x20','scene','Table','IdCard','Unsupported\x20OCR\x20scene:\x20','str','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','string','POST','description','ocr','trim','filter','appCode','<filePath\x20returned\x20by\x20/client/uploadFile>','count','apiError','/client/ocr','invoice','idcard','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','imageFile','/client/queryFileUrl','idCard','path','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','7639219dYyWBD','fileName','general','image-url','911367OfSDba','File\x20URL\x20response\x20missing\x20fileUrl.','1583760aylGGY','568504gTbMVs','287288TZHNYK','Publicly\x20accessible\x20image\x20or\x20file\x20URL','4503288KgupUB','filePath','write','Invoice','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','\x20OCR\x20from\x20URL','fileUrl'];a33_0x23e1=function(){return _0x5829ae;};return a33_0x23e1();}
1
+ const a34_0x18cc03=a34_0x241f;function a34_0x25bb(){const _0x264e2e=['form','length','path','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','4uoxcjx','apiError','join','/client/ocr','Publicly\x20accessible\x20image\x20or\x20file\x20URL','File\x20URL\x20response\x20missing\x20fileUrl.','/client/uploadFile','Invoice','File\x20upload\x20response\x20missing\x20filePath.','10198000CJdvlN','428787QskBcm','<filePath\x20returned\x20by\x20/client/uploadFile>','IdCard','imageUrl','str','write','string','validation','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','general','count','1786248ijWtjy','16bQqwwd','85945gMHdfH','toLowerCase','filter','fileName','General','filePath','28sGPecr','Table','idcard','description','fileUrl','image-url','scene','body','28xqLUNi','trim','image-file','recognize','12YJtVuG','504281SGbmUA','build','idCard','/client/queryFileUrl','\x20OCR','imageFile','15812687AZQVyl','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','appCode','invoice','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','1786950qpQEAU','POST','.\x20Supported\x20scenes:\x20'];a34_0x25bb=function(){return _0x264e2e;};return a34_0x25bb();}(function(_0x770875,_0x5f37e9){const _0x88b4e0=a34_0x241f,_0x630c6f=_0x770875();while(!![]){try{const _0x502151=-parseInt(_0x88b4e0(0xe6))/0x1*(-parseInt(_0x88b4e0(0xbc))/0x2)+parseInt(_0x88b4e0(0xc6))/0x3+-parseInt(_0x88b4e0(0xe1))/0x4*(parseInt(_0x88b4e0(0xd3))/0x5)+parseInt(_0x88b4e0(0xb5))/0x6*(-parseInt(_0x88b4e0(0xd9))/0x7)+parseInt(_0x88b4e0(0xd2))/0x8*(parseInt(_0x88b4e0(0xd1))/0x9)+-parseInt(_0x88b4e0(0xc5))/0xa+-parseInt(_0x88b4e0(0xec))/0xb*(-parseInt(_0x88b4e0(0xe5))/0xc);if(_0x502151===_0x5f37e9)break;else _0x630c6f['push'](_0x630c6f['shift']());}catch(_0x5f4e2a){_0x630c6f['push'](_0x630c6f['shift']());}}}(a34_0x25bb,0x9fcc1));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';function a34_0x241f(_0x4833dd,_0x5aa844){_0x4833dd=_0x4833dd-0xb5;const _0x25bb15=a34_0x25bb();let _0x241f25=_0x25bb15[_0x4833dd];return _0x241f25;}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x18cc03(0xef),a34_0x18cc03(0xcf),a34_0x18cc03(0xb8),a34_0x18cc03(0xe8)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x18cc03(0xc3),'general':a34_0x18cc03(0xd7),'form':a34_0x18cc03(0xda),'idCard':a34_0x18cc03(0xc8)},SCENE_FLAG={'name':a34_0x18cc03(0xdf),'type':a34_0x18cc03(0xcc),'required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':a34_0x18cc03(0xe3),'type':a34_0x18cc03(0xcc),'description':a34_0x18cc03(0xce)},IMAGE_URL_FLAG={'name':a34_0x18cc03(0xde),'type':'string','description':a34_0x18cc03(0xc0)};function normalizeScene(_0x16fcb9){const _0x13d6d0=a34_0x18cc03,_0x12cf3d=_0x16fcb9[_0x13d6d0(0xe2)]()[_0x13d6d0(0xd4)]();if(_0x12cf3d===_0x13d6d0(0xdb))return _0x13d6d0(0xe8);if(_0x12cf3d===_0x13d6d0(0xef)||_0x12cf3d===_0x13d6d0(0xcf)||_0x12cf3d===_0x13d6d0(0xb8))return _0x12cf3d;throw CliErrors[_0x13d6d0(0xcd)]('Unsupported\x20OCR\x20scene:\x20'+_0x16fcb9+_0x13d6d0(0xb7)+SUPPORTED_SCENES[_0x13d6d0(0xbe)](',\x20'));}function selectedInputs(_0x170d84){const _0x162083=a34_0x18cc03,_0x59a86d=_0x170d84[_0x162083(0xca)](_0x162083(0xe3))[_0x162083(0xe2)](),_0xaa7c32=_0x170d84['str'](_0x162083(0xde))[_0x162083(0xe2)]();return{'imageFile':_0x59a86d,'imageUrl':_0xaa7c32,'count':[_0x59a86d,_0xaa7c32][_0x162083(0xd5)](Boolean)[_0x162083(0xb9)]};}function validateInputSelection(_0x229ca5){const _0x206e04=a34_0x18cc03,_0x290163=selectedInputs(_0x229ca5);if(_0x290163[_0x206e04(0xd0)]!==0x1)throw CliErrors[_0x206e04(0xcd)](_0x206e04(0xf0));return _0x290163;}function withScene(_0x2d28d6,_0x4d8059,_0x1d3793){const _0x25ef6d=a34_0x18cc03;return{..._0x2d28d6,'scene':_0x4d8059,..._0x1d3793?{'sourceFile':{'fileName':_0x1d3793[_0x25ef6d(0xd6)],'filePath':_0x1d3793[_0x25ef6d(0xd8)]}}:{}};}const ocrRecognize={'service':'ocr','command':a34_0x18cc03(0xe4),'description':'Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','risk':a34_0x18cc03(0xcb),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x346d12){const _0x725375=a34_0x18cc03,_0x255cf6=normalizeScene(_0x346d12[_0x725375(0xca)]('scene')),_0x243a17=SCENE_TO_LEGACY_TYPE[_0x255cf6],_0x5996ce=validateInputSelection(_0x346d12);if(_0x5996ce[_0x725375(0xc9)])return dryRun(_0x725375(0xb6),_0x725375(0xbf))[_0x725375(0xe0)]({'appCode':_0x346d12[_0x725375(0xee)],'url':_0x5996ce[_0x725375(0xc9)],'type':_0x243a17})[_0x725375(0xdc)]('Preview:\x20recognize\x20'+_0x255cf6+'\x20OCR\x20from\x20URL')[_0x725375(0xe7)]();const _0x3d7efa=requireRuntimeUploadFile(_0x5996ce[_0x725375(0xeb)],_0x725375(0xe3));return dryRun('POST','/client/uploadFile')[_0x725375(0xe0)]({'steps':[{'method':_0x725375(0xb6),'url':_0x725375(0xc2),'body':{'appCode':_0x346d12[_0x725375(0xee)],'multipart':{'file':_0x3d7efa}}},{'method':_0x725375(0xb6),'url':_0x725375(0xe9),'body':{'filePath':_0x725375(0xc7),'downloadFlag':![]}},{'method':_0x725375(0xb6),'url':'/client/ocr','body':{'appCode':_0x346d12[_0x725375(0xee)],'url':_0x725375(0xed),'type':_0x243a17}}]})[_0x725375(0xdc)](_0x725375(0xbb)+_0x255cf6+_0x725375(0xea))['build']();},async 'execute'(_0x199872){const _0x767ff9=a34_0x18cc03,_0x1e6f27=normalizeScene(_0x199872[_0x767ff9(0xca)]('scene')),_0x1249ac=SCENE_TO_LEGACY_TYPE[_0x1e6f27],_0x5d2c38=validateInputSelection(_0x199872);if(_0x5d2c38[_0x767ff9(0xc9)]){const _0x4f0fda=await recognizeRuntimeOcr(_0x199872['appCode'],{'url':_0x5d2c38[_0x767ff9(0xc9)],'type':_0x1249ac});return{'ok':!![],'data':withScene(_0x4f0fda,_0x1e6f27)};}const _0x4c7921=requireRuntimeUploadFile(_0x5d2c38[_0x767ff9(0xeb)],_0x767ff9(0xe3)),_0xa74620=await uploadRuntimeFile(_0x199872['appCode'],_0x4c7921[_0x767ff9(0xba)]);if(!_0xa74620[_0x767ff9(0xd8)])throw CliErrors[_0x767ff9(0xbd)](_0x767ff9(0xc4));const _0x239824=await queryRuntimeFileUrl(_0xa74620[_0x767ff9(0xd8)],{'download':![]});if(!_0x239824[_0x767ff9(0xdd)])throw CliErrors['apiError'](_0x767ff9(0xc1));const _0x1acf1a=await recognizeRuntimeOcr(_0x199872['appCode'],{'url':_0x239824[_0x767ff9(0xdd)],'type':_0x1249ac});return{'ok':!![],'data':withScene(_0x1acf1a,_0x1e6f27,_0xa74620)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
1
- const a34_0x4f6574=a34_0x21c0;(function(_0x21e9a5,_0x1b78c9){const _0x101c58=a34_0x21c0,_0x1b5736=_0x21e9a5();while(!![]){try{const _0x33d0b3=-parseInt(_0x101c58(0x1c5))/0x1*(-parseInt(_0x101c58(0x1f6))/0x2)+-parseInt(_0x101c58(0x1dc))/0x3*(parseInt(_0x101c58(0x1ff))/0x4)+parseInt(_0x101c58(0x1fb))/0x5*(-parseInt(_0x101c58(0x1bd))/0x6)+parseInt(_0x101c58(0x1be))/0x7+-parseInt(_0x101c58(0x1e8))/0x8*(parseInt(_0x101c58(0x1fc))/0x9)+-parseInt(_0x101c58(0x1e7))/0xa*(parseInt(_0x101c58(0x1c9))/0xb)+parseInt(_0x101c58(0x1d5))/0xc;if(_0x33d0b3===_0x1b78c9)break;else _0x1b5736['push'](_0x1b5736['shift']());}catch(_0x5cd186){_0x1b5736['push'](_0x1b5736['shift']());}}}(a34_0x7eec,0xc5cca));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a34_0x4f6574(0x1de),'type':'string','description':a34_0x4f6574(0x1e6)},FUNCTION_NAME_FLAG={'name':a34_0x4f6574(0x1d2),'type':a34_0x4f6574(0x1d6),'required':!![],'description':a34_0x4f6574(0x1f2)},DESCRIPTION_FLAG={'name':'description','type':a34_0x4f6574(0x1d6),'description':a34_0x4f6574(0x1d3)},SOURCE_SESSION_FLAG={'name':a34_0x4f6574(0x202),'type':a34_0x4f6574(0x1d6),'description':a34_0x4f6574(0x1eb)};function normalizeFunctionName(_0x30ce0b){const _0x4d718f=a34_0x4f6574,_0x5c437e=String(_0x30ce0b||'')['trim']();if(!_0x5c437e||!FUNCTION_NAME_PATTERN[_0x4d718f(0x1f9)](_0x5c437e))throw CliErrors['validation']('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x5c437e;}function readScriptFile(_0x2ff6fd){const _0x1a55bc=a34_0x4f6574;if(!_0x2ff6fd)throw CliErrors[_0x1a55bc(0x1f3)]('File\x20path\x20is\x20required.');if(!existsSync(_0x2ff6fd))throw CliErrors[_0x1a55bc(0x1f3)](_0x1a55bc(0x1d8)+_0x2ff6fd);if(!statSync(_0x2ff6fd)[_0x1a55bc(0x201)]())throw CliErrors[_0x1a55bc(0x1f3)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x2ff6fd);const _0x4a58c7=readFileSync(_0x2ff6fd,'utf8');if(!_0x4a58c7['trim']())throw CliErrors[_0x1a55bc(0x1f3)](_0x1a55bc(0x1f8));return _0x4a58c7;}function optionalTrimmed(_0x49d6b4){const _0x23509a=a34_0x4f6574,_0x72be00=String(_0x49d6b4||'')[_0x23509a(0x1db)]();return _0x72be00||undefined;}function summarizeBff(_0x4fb1db){const _0x33bddd=a34_0x4f6574;return{'id':_0x4fb1db['id'],'appCode':_0x4fb1db[_0x33bddd(0x1d9)],'functionName':_0x4fb1db['functionName'],'description':_0x4fb1db[_0x33bddd(0x1ec)],'scriptType':_0x4fb1db[_0x33bddd(0x1ca)],'version':_0x4fb1db[_0x33bddd(0x1bb)],'gmtModified':_0x4fb1db[_0x33bddd(0x1ce)],'updateTime':_0x4fb1db[_0x33bddd(0x1da)]};}function detailBff(_0x4409c7){const _0x153122=a34_0x4f6574;return{'id':_0x4409c7['id'],'appCode':_0x4409c7[_0x153122(0x1d9)],'functionName':_0x4409c7['functionName'],'description':_0x4409c7[_0x153122(0x1ec)],'scriptType':_0x4409c7[_0x153122(0x1ca)],'scriptContent':_0x4409c7[_0x153122(0x1cc)]??'','config':_0x4409c7[_0x153122(0x1cb)],'version':_0x4409c7[_0x153122(0x1bb)],'createUserId':_0x4409c7[_0x153122(0x1c6)],'gmtCreate':_0x4409c7[_0x153122(0x1c2)],'gmtModified':_0x4409c7[_0x153122(0x1ce)],'createTime':_0x4409c7[_0x153122(0x1c3)],'updateTime':_0x4409c7[_0x153122(0x1da)]};}function buildCreateInput(_0x121901){const _0x38f203=a34_0x4f6574;return{'functionName':normalizeFunctionName(_0x121901[_0x38f203(0x1c8)](_0x38f203(0x1d2))),...optionalTrimmed(_0x121901['str'](_0x38f203(0x1ec)))?{'description':optionalTrimmed(_0x121901[_0x38f203(0x1c8)]('description'))}:{},'scriptContent':readScriptFile(_0x121901[_0x38f203(0x1c8)](_0x38f203(0x1de))),...optionalTrimmed(_0x121901['str']('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x121901[_0x38f203(0x1c8)](_0x38f203(0x202)))}:{}};}function buildUpdateInput(_0x426db6){const _0x3e1a72=a34_0x4f6574,_0x3aa358={};optionalTrimmed(_0x426db6['str'](_0x3e1a72(0x1d2)))&&(_0x3aa358[_0x3e1a72(0x1ed)]=normalizeFunctionName(_0x426db6[_0x3e1a72(0x1c8)](_0x3e1a72(0x1d2))));_0x426db6[_0x3e1a72(0x1c4)](_0x3e1a72(0x1ec))!==undefined&&(_0x3aa358[_0x3e1a72(0x1ec)]=_0x426db6[_0x3e1a72(0x1c8)](_0x3e1a72(0x1ec)));optionalTrimmed(_0x426db6[_0x3e1a72(0x1c8)](_0x3e1a72(0x1de)))&&(_0x3aa358[_0x3e1a72(0x1cc)]=readScriptFile(_0x426db6[_0x3e1a72(0x1c8)](_0x3e1a72(0x1de))));_0x426db6[_0x3e1a72(0x1c4)](_0x3e1a72(0x202))!==undefined&&(_0x3aa358[_0x3e1a72(0x1e0)]=_0x426db6[_0x3e1a72(0x1c8)](_0x3e1a72(0x202)));if(Object[_0x3e1a72(0x1f7)](_0x3aa358)[_0x3e1a72(0x1d7)]===0x0)throw CliErrors[_0x3e1a72(0x1f3)](_0x3e1a72(0x1f1));return _0x3aa358;}function parseExecParams(_0x4f7277){const _0x324ddb=a34_0x4f6574,_0x5275ce=parseJsonParams(_0x4f7277)??{};if(Array[_0x324ddb(0x1e2)](_0x5275ce))throw CliErrors[_0x324ddb(0x1f3)](_0x324ddb(0x1bc));return _0x5275ce;}const personalBffList={'service':a34_0x4f6574(0x1dd),'command':a34_0x4f6574(0x1e9),'description':a34_0x4f6574(0x1cf),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x2eb92a){const _0x361ab3=a34_0x4f6574,_0x5e2d3b=await listPersonalBffs(_0x2eb92a[_0x361ab3(0x1d9)]);return{'ok':!![],'data':{'total':_0x5e2d3b[_0x361ab3(0x1d7)],'items':_0x2eb92a[_0x361ab3(0x1df)]('verbose')?_0x5e2d3b:_0x5e2d3b[_0x361ab3(0x1d1)](summarizeBff)}};}},personalBffDetail={'service':a34_0x4f6574(0x1dd),'command':a34_0x4f6574(0x200),'description':a34_0x4f6574(0x1e3),'risk':'read','flags':[{...ID_FLAG,'description':a34_0x4f6574(0x1fe)}],async 'execute'(_0x31ae63){const _0x482db0=a34_0x4f6574,_0x43897f=await getPersonalBff(_0x31ae63[_0x482db0(0x1c1)]('id'),_0x31ae63['appCode']);return{'ok':!![],'data':detailBff(_0x43897f)};}},personalBffCreate={'service':a34_0x4f6574(0x1dd),'command':a34_0x4f6574(0x1e1),'description':a34_0x4f6574(0x1cd),'risk':a34_0x4f6574(0x1f5),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x148704){const _0x3df6e7=a34_0x4f6574,_0x4b0768=buildCreateInput(_0x148704),_0x1ef8ff=await createPersonalBff(_0x148704[_0x3df6e7(0x1d9)],_0x4b0768);return{'ok':!![],'data':detailBff(_0x1ef8ff),'message':'Created\x20personal\x20BFF\x20'+_0x1ef8ff['id']+(_0x1ef8ff[_0x3df6e7(0x1ed)]?'\x20('+_0x1ef8ff[_0x3df6e7(0x1ed)]+')':'')};},async 'dryRun'(_0x56b6f8){const _0x18ff9e=a34_0x4f6574,_0xbf59f=buildCreateInput(_0x56b6f8);return dryRun(_0x18ff9e(0x1ee),'/client/runtime-bff/personal/create')[_0x18ff9e(0x1ef)]({'appCode':_0x56b6f8['appCode'],..._0xbf59f})[_0x18ff9e(0x1ec)](_0x18ff9e(0x1fd)+_0xbf59f[_0x18ff9e(0x1ed)])[_0x18ff9e(0x1f4)]();}},personalBffUpdate={'service':a34_0x4f6574(0x1dd),'command':a34_0x4f6574(0x1c7),'description':a34_0x4f6574(0x1f0),'risk':a34_0x4f6574(0x1f5),'flags':[{...ID_FLAG,'description':a34_0x4f6574(0x1fe)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x4ebdf1){const _0x8c767b=a34_0x4f6574,_0x3ced71=_0x4ebdf1['num']('id'),_0x3764ab=buildUpdateInput(_0x4ebdf1),_0x52860f=await updatePersonalBff(_0x3ced71,_0x4ebdf1[_0x8c767b(0x1d9)],_0x3764ab);return{'ok':!![],'data':detailBff(_0x52860f),'message':_0x8c767b(0x1e5)+_0x52860f['id']+(_0x52860f[_0x8c767b(0x1ed)]?'\x20('+_0x52860f[_0x8c767b(0x1ed)]+')':'')};},async 'dryRun'(_0x1b5526){const _0x2798ae=a34_0x4f6574,_0x435a94=_0x1b5526[_0x2798ae(0x1c1)]('id'),_0x19701d=buildUpdateInput(_0x1b5526);return dryRun('POST',_0x2798ae(0x1ea)+_0x435a94+_0x2798ae(0x1d0))[_0x2798ae(0x1ef)]({'appCode':_0x1b5526[_0x2798ae(0x1d9)],..._0x19701d})[_0x2798ae(0x1ec)](_0x2798ae(0x1c0)+_0x435a94)['build']();}},personalBffExec={'service':a34_0x4f6574(0x1dd),'command':'exec','description':a34_0x4f6574(0x1fa),'risk':a34_0x4f6574(0x1bf),'flags':[{...ID_FLAG,'description':a34_0x4f6574(0x1fe)},{...PARAMS_FLAG,'description':a34_0x4f6574(0x203)}],async 'validate'(_0x4f6713){const _0x3661a2=a34_0x4f6574;parseExecParams(_0x4f6713['str'](_0x3661a2(0x1e4)));},async 'execute'(_0x3f7031){const _0x3d49df=a34_0x4f6574,_0x5ae5b1=_0x3f7031['num']('id'),_0x500b41=parseExecParams(_0x3f7031['str']('params')),_0xa091bf=await executePersonalBff(_0x5ae5b1,_0x3f7031[_0x3d49df(0x1d9)],_0x500b41);return{'ok':!![],'data':{'result':_0xa091bf},'message':_0x3d49df(0x1d4)+_0x5ae5b1};}};function a34_0x21c0(_0x132364,_0x76d60d){_0x132364=_0x132364-0x1bb;const _0x7eecb1=a34_0x7eec();let _0x21c0ad=_0x7eecb1[_0x132364];return _0x21c0ad;}export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];function a34_0x7eec(){const _0x135a71=['List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','/update','map','name','Personal\x20BFF\x20description','Executed\x20personal\x20BFF\x20','38619660smxxWh','string','length','File\x20not\x20found:\x20','appCode','updateTime','trim','204BrXggc','personal-bff','file','bool','sourceSessionId','create','isArray','Show\x20one\x20personal\x20BFF\x20by\x20id','params','Updated\x20personal\x20BFF\x20','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','10XxGPBg','32xPIhIK','list','/client/runtime-bff/personal/','Optional\x20source\x20RuntimeAgent\x20session\x20id','description','functionName','POST','body','Update\x20a\x20personal\x20BFF\x20by\x20id','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','validation','build','write','4hPggiy','keys','Personal\x20BFF\x20script\x20file\x20is\x20blank.','test','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','50ZGkmUX','3146301qHQZSq','Preview:\x20create\x20personal\x20BFF\x20','Personal\x20BFF\x20script\x20ID','74248GbdDSt','detail','isFile','source-session-id','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','version','--params\x20must\x20be\x20a\x20JSON\x20object.','571998EecHzt','5417510RnVWqn','high-risk-write','Preview:\x20update\x20personal\x20BFF\x20','num','gmtCreate','createTime','flag','657669pebkHK','createUserId','update','str','9718335SAEBtt','scriptType','config','scriptContent','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','gmtModified'];a34_0x7eec=function(){return _0x135a71;};return a34_0x7eec();}
1
+ const a35_0x3eaaf2=a35_0x5bb0;(function(_0x25224b,_0x13366b){const _0x8702c8=a35_0x5bb0,_0x866221=_0x25224b();while(!![]){try{const _0x49537b=parseInt(_0x8702c8(0x10c))/0x1*(-parseInt(_0x8702c8(0x102))/0x2)+parseInt(_0x8702c8(0xe6))/0x3+-parseInt(_0x8702c8(0xfc))/0x4*(-parseInt(_0x8702c8(0xd8))/0x5)+parseInt(_0x8702c8(0x109))/0x6*(parseInt(_0x8702c8(0x10e))/0x7)+-parseInt(_0x8702c8(0xee))/0x8*(parseInt(_0x8702c8(0xe8))/0x9)+parseInt(_0x8702c8(0xde))/0xa*(-parseInt(_0x8702c8(0xf7))/0xb)+-parseInt(_0x8702c8(0xf4))/0xc;if(_0x49537b===_0x13366b)break;else _0x866221['push'](_0x866221['shift']());}catch(_0x4bf6ce){_0x866221['push'](_0x866221['shift']());}}}(a35_0x54d6,0x4e5ad));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x3eaaf2(0xef),'type':a35_0x3eaaf2(0x108),'description':a35_0x3eaaf2(0x116)},FUNCTION_NAME_FLAG={'name':a35_0x3eaaf2(0xd9),'type':'string','required':!![],'description':a35_0x3eaaf2(0xfe)},DESCRIPTION_FLAG={'name':a35_0x3eaaf2(0xf5),'type':a35_0x3eaaf2(0x108),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0x3eaaf2(0x108),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x497dfd){const _0x3ef716=a35_0x3eaaf2,_0x32d15e=String(_0x497dfd||'')[_0x3ef716(0xe0)]();if(!_0x32d15e||!FUNCTION_NAME_PATTERN[_0x3ef716(0xd7)](_0x32d15e))throw CliErrors[_0x3ef716(0xdb)](_0x3ef716(0xf2));return _0x32d15e;}function readScriptFile(_0x18a038){const _0x474a5f=a35_0x3eaaf2;if(!_0x18a038)throw CliErrors['validation'](_0x474a5f(0xeb));if(!existsSync(_0x18a038))throw CliErrors[_0x474a5f(0xdb)](_0x474a5f(0x10d)+_0x18a038);if(!statSync(_0x18a038)[_0x474a5f(0xdc)]())throw CliErrors[_0x474a5f(0xdb)](_0x474a5f(0xea)+_0x18a038);const _0x164bc9=readFileSync(_0x18a038,_0x474a5f(0x111));if(!_0x164bc9[_0x474a5f(0xe0)]())throw CliErrors['validation'](_0x474a5f(0x103));return _0x164bc9;}function a35_0x5bb0(_0x183771,_0x6e6074){_0x183771=_0x183771-0xd7;const _0x54d6f7=a35_0x54d6();let _0x5bb058=_0x54d6f7[_0x183771];return _0x5bb058;}function optionalTrimmed(_0xcb9ab){const _0x498325=String(_0xcb9ab||'')['trim']();return _0x498325||undefined;}function summarizeBff(_0x15e996){const _0x21fd70=a35_0x3eaaf2;return{'id':_0x15e996['id'],'appCode':_0x15e996[_0x21fd70(0xff)],'functionName':_0x15e996[_0x21fd70(0xf1)],'description':_0x15e996[_0x21fd70(0xf5)],'scriptType':_0x15e996[_0x21fd70(0x107)],'version':_0x15e996['version'],'gmtModified':_0x15e996[_0x21fd70(0x110)],'updateTime':_0x15e996[_0x21fd70(0x118)]};}function detailBff(_0x3ded5b){const _0x407aea=a35_0x3eaaf2;return{'id':_0x3ded5b['id'],'appCode':_0x3ded5b[_0x407aea(0xff)],'functionName':_0x3ded5b[_0x407aea(0xf1)],'description':_0x3ded5b[_0x407aea(0xf5)],'scriptType':_0x3ded5b[_0x407aea(0x107)],'scriptContent':_0x3ded5b[_0x407aea(0xe2)]??'','config':_0x3ded5b[_0x407aea(0x115)],'version':_0x3ded5b[_0x407aea(0x10f)],'createUserId':_0x3ded5b['createUserId'],'gmtCreate':_0x3ded5b['gmtCreate'],'gmtModified':_0x3ded5b['gmtModified'],'createTime':_0x3ded5b['createTime'],'updateTime':_0x3ded5b[_0x407aea(0x118)]};}function buildCreateInput(_0x831c48){const _0x27b802=a35_0x3eaaf2;return{'functionName':normalizeFunctionName(_0x831c48[_0x27b802(0xfb)](_0x27b802(0xd9))),...optionalTrimmed(_0x831c48[_0x27b802(0xfb)](_0x27b802(0xf5)))?{'description':optionalTrimmed(_0x831c48['str'](_0x27b802(0xf5)))}:{},'scriptContent':readScriptFile(_0x831c48[_0x27b802(0xfb)](_0x27b802(0xef))),...optionalTrimmed(_0x831c48[_0x27b802(0xfb)]('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x831c48[_0x27b802(0xfb)](_0x27b802(0xdf)))}:{}};}function buildUpdateInput(_0x4505c6){const _0x4231ae=a35_0x3eaaf2,_0x6a4583={};optionalTrimmed(_0x4505c6['str'](_0x4231ae(0xd9)))&&(_0x6a4583[_0x4231ae(0xf1)]=normalizeFunctionName(_0x4505c6[_0x4231ae(0xfb)](_0x4231ae(0xd9))));_0x4505c6[_0x4231ae(0xe4)](_0x4231ae(0xf5))!==undefined&&(_0x6a4583[_0x4231ae(0xf5)]=_0x4505c6[_0x4231ae(0xfb)](_0x4231ae(0xf5)));optionalTrimmed(_0x4505c6[_0x4231ae(0xfb)]('file'))&&(_0x6a4583['scriptContent']=readScriptFile(_0x4505c6[_0x4231ae(0xfb)]('file')));_0x4505c6[_0x4231ae(0xe4)](_0x4231ae(0xdf))!==undefined&&(_0x6a4583[_0x4231ae(0xe9)]=_0x4505c6[_0x4231ae(0xfb)](_0x4231ae(0xdf)));if(Object[_0x4231ae(0x105)](_0x6a4583)[_0x4231ae(0x113)]===0x0)throw CliErrors[_0x4231ae(0xdb)](_0x4231ae(0x100));return _0x6a4583;}function a35_0x54d6(){const _0x50f23a=['File\x20is\x20not\x20a\x20regular\x20file:\x20','File\x20path\x20is\x20required.','update','Executed\x20personal\x20BFF\x20','102712MnTxrj','file','num','functionName','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','Created\x20personal\x20BFF\x20','2125272QfCPEg','description','body','1034HDQvhS','detail','Update\x20a\x20personal\x20BFF\x20by\x20id','personal-bff','str','2384MtajVy','read','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','appCode','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','write','10lYqLMx','Personal\x20BFF\x20script\x20file\x20is\x20blank.','POST','keys','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','scriptType','string','3451944otJbbg','--params\x20must\x20be\x20a\x20JSON\x20object.','isArray','33829hoscrw','File\x20not\x20found:\x20','7qOJhFR','version','gmtModified','utf8','/update','length','Personal\x20BFF\x20script\x20ID','config','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','params','updateTime','Preview:\x20create\x20personal\x20BFF\x20','test','1630iqjvsY','name','Preview:\x20update\x20personal\x20BFF\x20','validation','isFile','bool','45190siSzyK','source-session-id','trim','build','scriptContent','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','flag','high-risk-write','1121142TpWHpq','verbose','36nSRVgp','sourceSessionId'];a35_0x54d6=function(){return _0x50f23a;};return a35_0x54d6();}function parseExecParams(_0x4cdec8){const _0x1306ea=a35_0x3eaaf2,_0x5013d4=parseJsonParams(_0x4cdec8)??{};if(Array[_0x1306ea(0x10b)](_0x5013d4))throw CliErrors['validation'](_0x1306ea(0x10a));return _0x5013d4;}const personalBffList={'service':'personal-bff','command':'list','description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0x3eaaf2(0xfd),'flags':[VERBOSE_FLAG],async 'execute'(_0x59108c){const _0x5c4ae5=a35_0x3eaaf2,_0x2c0471=await listPersonalBffs(_0x59108c[_0x5c4ae5(0xff)]);return{'ok':!![],'data':{'total':_0x2c0471[_0x5c4ae5(0x113)],'items':_0x59108c[_0x5c4ae5(0xdd)](_0x5c4ae5(0xe7))?_0x2c0471:_0x2c0471['map'](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':a35_0x3eaaf2(0xf8),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':'read','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'}],async 'execute'(_0x140652){const _0x3685ee=a35_0x3eaaf2,_0x38406b=await getPersonalBff(_0x140652[_0x3685ee(0xf0)]('id'),_0x140652[_0x3685ee(0xff)]);return{'ok':!![],'data':detailBff(_0x38406b)};}},personalBffCreate={'service':'personal-bff','command':'create','description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a35_0x3eaaf2(0x101),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x2e0939){const _0x21bcda=a35_0x3eaaf2,_0x5bc201=buildCreateInput(_0x2e0939),_0x57cba9=await createPersonalBff(_0x2e0939[_0x21bcda(0xff)],_0x5bc201);return{'ok':!![],'data':detailBff(_0x57cba9),'message':_0x21bcda(0xf3)+_0x57cba9['id']+(_0x57cba9['functionName']?'\x20('+_0x57cba9[_0x21bcda(0xf1)]+')':'')};},async 'dryRun'(_0x3ec111){const _0x487de0=a35_0x3eaaf2,_0x57c7da=buildCreateInput(_0x3ec111);return dryRun(_0x487de0(0x104),'/client/runtime-bff/personal/create')['body']({'appCode':_0x3ec111[_0x487de0(0xff)],..._0x57c7da})[_0x487de0(0xf5)](_0x487de0(0x119)+_0x57c7da[_0x487de0(0xf1)])[_0x487de0(0xe1)]();}},personalBffUpdate={'service':a35_0x3eaaf2(0xfa),'command':a35_0x3eaaf2(0xec),'description':a35_0x3eaaf2(0xf9),'risk':'write','flags':[{...ID_FLAG,'description':a35_0x3eaaf2(0x114)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x2a750b){const _0x5cf8c8=a35_0x3eaaf2,_0x1e0b24=_0x2a750b[_0x5cf8c8(0xf0)]('id'),_0x4f6621=buildUpdateInput(_0x2a750b),_0x521f56=await updatePersonalBff(_0x1e0b24,_0x2a750b[_0x5cf8c8(0xff)],_0x4f6621);return{'ok':!![],'data':detailBff(_0x521f56),'message':'Updated\x20personal\x20BFF\x20'+_0x521f56['id']+(_0x521f56['functionName']?'\x20('+_0x521f56[_0x5cf8c8(0xf1)]+')':'')};},async 'dryRun'(_0x4700d8){const _0x2cd964=a35_0x3eaaf2,_0x220ace=_0x4700d8[_0x2cd964(0xf0)]('id'),_0x443455=buildUpdateInput(_0x4700d8);return dryRun(_0x2cd964(0x104),'/client/runtime-bff/personal/'+_0x220ace+_0x2cd964(0x112))[_0x2cd964(0xf6)]({'appCode':_0x4700d8['appCode'],..._0x443455})[_0x2cd964(0xf5)](_0x2cd964(0xda)+_0x220ace)[_0x2cd964(0xe1)]();}},personalBffExec={'service':'personal-bff','command':'exec','description':a35_0x3eaaf2(0xe3),'risk':a35_0x3eaaf2(0xe5),'flags':[{...ID_FLAG,'description':a35_0x3eaaf2(0x114)},{...PARAMS_FLAG,'description':a35_0x3eaaf2(0x106)}],async 'validate'(_0x567587){const _0x2f1447=a35_0x3eaaf2;parseExecParams(_0x567587[_0x2f1447(0xfb)](_0x2f1447(0x117)));},async 'execute'(_0x327faa){const _0x42ace9=a35_0x3eaaf2,_0x12b0d1=_0x327faa[_0x42ace9(0xf0)]('id'),_0x2c9d42=parseExecParams(_0x327faa[_0x42ace9(0xfb)]('params')),_0x2f4b0a=await executePersonalBff(_0x12b0d1,_0x327faa[_0x42ace9(0xff)],_0x2c9d42);return{'ok':!![],'data':{'result':_0x2f4b0a},'message':_0x42ace9(0xed)+_0x12b0d1};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a35_0x44ce9c=a35_0x5b72;(function(_0x19f676,_0x29f734){const _0x195f05=a35_0x5b72,_0x6864c7=_0x19f676();while(!![]){try{const _0x282dd7=-parseInt(_0x195f05(0x16f))/0x1+parseInt(_0x195f05(0x169))/0x2*(parseInt(_0x195f05(0x173))/0x3)+-parseInt(_0x195f05(0x176))/0x4+-parseInt(_0x195f05(0x161))/0x5+-parseInt(_0x195f05(0x170))/0x6*(-parseInt(_0x195f05(0x16a))/0x7)+parseInt(_0x195f05(0x15a))/0x8+parseInt(_0x195f05(0x16e))/0x9;if(_0x282dd7===_0x29f734)break;else _0x6864c7['push'](_0x6864c7['shift']());}catch(_0x14416b){_0x6864c7['push'](_0x6864c7['shift']());}}}(a35_0x2834,0xe854f));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';function a35_0x2834(){const _0x5c8ef1=['905746OPnChU','12390YaQYzX','install','map','750135RItUlF','set','Workspace','6403944LlrlCQ','Runtime\x20App\x20Config','list','Service\x20Tree','has','Self\x20Update','defaultCommand','App\x20Management','run','Logs','Datasets','isSingleCommand','push','2968704xxdpHL','\x20\x20[write]','\x20\x20[high-risk-write]','File','Instant\x20API','get','values','8887395cYONYR','BFF\x20Scripts','OCR','Diagnostics','command','Knowledge\x20Base','Authentication','Personal\x20BFF','14wNyTff','6307HJxEjh','service','write','API\x20Documentation','11284866iZthbz'];a35_0x2834=function(){return _0x5c8ef1;};return a35_0x2834();}import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';function a35_0x5b72(_0x9608a5,_0x11d3f6){_0x9608a5=_0x9608a5-0x150;const _0x28345d=a35_0x2834();let _0x5b7286=_0x28345d[_0x9608a5];return _0x5b7286;}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(_0x3196f9){const _0x24d275=a35_0x5b72;for(const _0x362f90 of _0x3196f9){definitions[_0x24d275(0x174)](_0x362f90[_0x24d275(0x16b)]+':'+_0x362f90[_0x24d275(0x165)],_0x362f90);let _0x3f7ea1=serviceGroups[_0x24d275(0x15f)](_0x362f90[_0x24d275(0x16b)]);!_0x3f7ea1&&(_0x3f7ea1=[],serviceGroups[_0x24d275(0x174)](_0x362f90[_0x24d275(0x16b)],_0x3f7ea1)),_0x3f7ea1[_0x24d275(0x159)](_0x362f90);}}function registerService(_0x360a03,_0x1aadd7,_0x49a657){const _0x2d7aae=a35_0x5b72;registerDefinitions(_0x1aadd7);const _0x582f5a=_0x33fd31=>_0x33fd31==='read'?'':_0x33fd31===_0x2d7aae(0x16c)?_0x2d7aae(0x15b):_0x2d7aae(0x15c),_0x4d979b={'service':_0x1aadd7[0x0]['service'],'label':_0x360a03,'commands':_0x1aadd7[_0x2d7aae(0x172)](_0x2abb4e=>({'command':_0x2abb4e['command'],'description':_0x2abb4e['description'],'tag':_0x582f5a(_0x2abb4e['risk'])})),'defaultCommand':_0x49a657?.[_0x2d7aae(0x153)]??(_0x49a657?.['isSingleCommand']?_0x1aadd7[0x0]['command']:undefined),'isSingleCommand':_0x49a657?.[_0x2d7aae(0x158)]};serviceRegistry['push'](_0x4d979b),serviceByName[_0x2d7aae(0x174)](_0x4d979b[_0x2d7aae(0x16b)],_0x4d979b);}registerService(a35_0x44ce9c(0x167),authDefinitions,{'defaultCommand':'login'}),registerService(a35_0x44ce9c(0x154),appDefinitions,{'defaultCommand':'list'}),registerService(a35_0x44ce9c(0x175),workspaceDefinitions),registerService(a35_0x44ce9c(0x177),appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a35_0x44ce9c(0x178)}),registerService(a35_0x44ce9c(0x16d),apiDocDefinitions),registerService(a35_0x44ce9c(0x157),datasetDefinitions),registerService(a35_0x44ce9c(0x15e),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService(a35_0x44ce9c(0x162),bffDefinitions),registerService(a35_0x44ce9c(0x168),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a35_0x44ce9c(0x15d),fileDefinitions),registerService(a35_0x44ce9c(0x163),ocrDefinitions),registerService(a35_0x44ce9c(0x166),kbDefinitions),registerService(a35_0x44ce9c(0x150),serviceDefinitions,{'defaultCommand':a35_0x44ce9c(0x178)}),registerService('Skills',skillDefinitions,{'defaultCommand':'install'}),registerService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a35_0x44ce9c(0x171)}),registerService(a35_0x44ce9c(0x152),[updateDefinition],{'defaultCommand':a35_0x44ce9c(0x155),'isSingleCommand':!![]}),registerService(a35_0x44ce9c(0x164),[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService(a35_0x44ce9c(0x156),logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0x36f778,_0x49d897){return definitions['get'](_0x36f778+':'+_0x49d897);}export function isKnownService(_0xb55105){const _0x2389f7=a35_0x44ce9c;return serviceByName[_0x2389f7(0x151)](_0xb55105);}export function getServiceEntry(_0x52ba4a){const _0x2c4caf=a35_0x44ce9c;return serviceByName[_0x2c4caf(0x15f)](_0x52ba4a);}export function getAllDefinitions(){const _0x3aa1f9=a35_0x44ce9c;return Array['from'](definitions[_0x3aa1f9(0x160)]());}
1
+ const a36_0x599259=a36_0x3efd;(function(_0xb8a02a,_0x3c0e17){const _0x5ac1d8=a36_0x3efd,_0x484cb4=_0xb8a02a();while(!![]){try{const _0x29b081=-parseInt(_0x5ac1d8(0x1c6))/0x1*(-parseInt(_0x5ac1d8(0x1cb))/0x2)+-parseInt(_0x5ac1d8(0x1bf))/0x3*(parseInt(_0x5ac1d8(0x1d1))/0x4)+parseInt(_0x5ac1d8(0x1c1))/0x5+parseInt(_0x5ac1d8(0x1ad))/0x6*(parseInt(_0x5ac1d8(0x1b3))/0x7)+-parseInt(_0x5ac1d8(0x1bb))/0x8+parseInt(_0x5ac1d8(0x1cc))/0x9+-parseInt(_0x5ac1d8(0x1c4))/0xa;if(_0x29b081===_0x3c0e17)break;else _0x484cb4['push'](_0x484cb4['shift']());}catch(_0x39d36f){_0x484cb4['push'](_0x484cb4['shift']());}}}(a36_0x20a9,0xb4287));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';function a36_0x3efd(_0x3154ca,_0x462ed6){_0x3154ca=_0x3154ca-0x1ad;const _0x20a910=a36_0x20a9();let _0x3efd8b=_0x20a910[_0x3154ca];return _0x3efd8b;}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();function a36_0x20a9(){const _0x31f8b4=['Datasets','list','Logs','Service\x20Tree','1810304QDtTWF','Diagnostics','Skills','Configuration','18vXxanm','Artifacts','3883275MStgSr','run','command','13573680wUYSVG','description','523HFUSye','Self\x20Update','from','Personal\x20BFF','\x20\x20[write]','3082pzYaHs','6598395jqmiiZ','show','API\x20Documentation','Authentication','get','226964DaByKX','BFF\x20Scripts','service','Schema','install','148404VxAXlJ','defaultCommand','push','\x20\x20[high-risk-write]','isSingleCommand','Workspace','98LIyIeL','set','map','File'];a36_0x20a9=function(){return _0x31f8b4;};return a36_0x20a9();}export const serviceGroups=new Map();function registerDefinitions(_0x402f10){const _0x24c921=a36_0x3efd;for(const _0x3b9c1d of _0x402f10){definitions[_0x24c921(0x1b4)](_0x3b9c1d[_0x24c921(0x1d3)]+':'+_0x3b9c1d[_0x24c921(0x1c3)],_0x3b9c1d);let _0x4a2179=serviceGroups['get'](_0x3b9c1d[_0x24c921(0x1d3)]);!_0x4a2179&&(_0x4a2179=[],serviceGroups['set'](_0x3b9c1d[_0x24c921(0x1d3)],_0x4a2179)),_0x4a2179[_0x24c921(0x1af)](_0x3b9c1d);}}function registerService(_0x73d802,_0x4aa637,_0x33b4b8){const _0x20ac3b=a36_0x3efd;registerDefinitions(_0x4aa637);const _0x503728=_0xc874fd=>_0xc874fd==='read'?'':_0xc874fd==='write'?_0x20ac3b(0x1ca):_0x20ac3b(0x1b0),_0x5b65da={'service':_0x4aa637[0x0][_0x20ac3b(0x1d3)],'label':_0x73d802,'commands':_0x4aa637[_0x20ac3b(0x1b5)](_0x4a7bf0=>({'command':_0x4a7bf0[_0x20ac3b(0x1c3)],'description':_0x4a7bf0[_0x20ac3b(0x1c5)],'tag':_0x503728(_0x4a7bf0['risk'])})),'defaultCommand':_0x33b4b8?.[_0x20ac3b(0x1ae)]??(_0x33b4b8?.[_0x20ac3b(0x1b1)]?_0x4aa637[0x0]['command']:undefined),'isSingleCommand':_0x33b4b8?.[_0x20ac3b(0x1b1)]};serviceRegistry['push'](_0x5b65da),serviceByName[_0x20ac3b(0x1b4)](_0x5b65da[_0x20ac3b(0x1d3)],_0x5b65da);}registerService(a36_0x599259(0x1cf),authDefinitions,{'defaultCommand':'login'}),registerService('App\x20Management',appDefinitions,{'defaultCommand':a36_0x599259(0x1b8)}),registerService(a36_0x599259(0x1b2),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a36_0x599259(0x1be),configDefinitions,{'defaultCommand':a36_0x599259(0x1b8)}),registerService(a36_0x599259(0x1ce),apiDocDefinitions),registerService(a36_0x599259(0x1b7),datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService(a36_0x599259(0x1d2),bffDefinitions),registerService(a36_0x599259(0x1c9),personalBffDefinitions),registerService(a36_0x599259(0x1c0),artifactDefinitions),registerService(a36_0x599259(0x1b6),fileDefinitions),registerService('OCR',ocrDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService(a36_0x599259(0x1ba),serviceDefinitions,{'defaultCommand':a36_0x599259(0x1b8)}),registerService(a36_0x599259(0x1bd),skillDefinitions,{'defaultCommand':a36_0x599259(0x1d5)}),registerService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a36_0x599259(0x1d5)}),registerService(a36_0x599259(0x1c7),[updateDefinition],{'defaultCommand':a36_0x599259(0x1c2),'isSingleCommand':!![]}),registerService(a36_0x599259(0x1bc),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x599259(0x1d4),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x599259(0x1b9),logsDefinitions,{'defaultCommand':a36_0x599259(0x1cd)});export function findDefinition(_0x4e5976,_0x14a4b8){const _0x5448f4=a36_0x599259;return definitions[_0x5448f4(0x1d0)](_0x4e5976+':'+_0x14a4b8);}export function isKnownService(_0x5043ac){return serviceByName['has'](_0x5043ac);}export function getServiceEntry(_0x37d486){const _0x3cc9c1=a36_0x599259;return serviceByName[_0x3cc9c1(0x1d0)](_0x37d486);}export function getAllDefinitions(){const _0x3f29fa=a36_0x599259;return Array[_0x3f29fa(0x1c8)](definitions['values']());}
@@ -1 +1 @@
1
- function a36_0x94e7(){const _0x158b10=['55DxJgjS','schema','8937giTOFc','2197056UjITEH','10610xEeSNQ','642533lcZHha','22804xhksXl','463022LxVLWX','9561444dkrgup','128vEtAff','3042260AbeZEB'];a36_0x94e7=function(){return _0x158b10;};return a36_0x94e7();}function a36_0x2902(_0x54c054,_0x3dc069){_0x54c054=_0x54c054-0xcb;const _0x94e75=a36_0x94e7();let _0x290248=_0x94e75[_0x54c054];return _0x290248;}const a36_0x889611=a36_0x2902;(function(_0x860db3,_0x522c76){const _0x469e79=a36_0x2902,_0xc6d3f2=_0x860db3();while(!![]){try{const _0xea9d6a=parseInt(_0x469e79(0xcd))/0x1+parseInt(_0x469e79(0xd2))/0x2+-parseInt(_0x469e79(0xcb))/0x3+parseInt(_0x469e79(0xce))/0x4*(-parseInt(_0x469e79(0xd3))/0x5)+parseInt(_0x469e79(0xd0))/0x6+parseInt(_0x469e79(0xcf))/0x7*(-parseInt(_0x469e79(0xd1))/0x8)+parseInt(_0x469e79(0xd5))/0x9*(-parseInt(_0x469e79(0xcc))/0xa);if(_0xea9d6a===_0x522c76)break;else _0xc6d3f2['push'](_0xc6d3f2['shift']());}catch(_0xc2dc1f){_0xc6d3f2['push'](_0xc6d3f2['shift']());}}}(a36_0x94e7,0xcf959));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x40e09b){const _0x5e1809=await buildSchemaPayload();return{'ok':!![],'data':_0x5e1809};}export const schemaDefinition={'service':a36_0x889611(0xd4),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a37_0x24d47b=a37_0x5b2f;function a37_0x5b2f(_0x3fa3b7,_0x12af48){_0x3fa3b7=_0x3fa3b7-0xbf;const _0x515040=a37_0x5150();let _0x5b2f5f=_0x515040[_0x3fa3b7];return _0x5b2f5f;}(function(_0x476aec,_0x386664){const _0x3a6eb8=a37_0x5b2f,_0x26b127=_0x476aec();while(!![]){try{const _0x5434a6=-parseInt(_0x3a6eb8(0xc3))/0x1+parseInt(_0x3a6eb8(0xca))/0x2+parseInt(_0x3a6eb8(0xc6))/0x3*(parseInt(_0x3a6eb8(0xc2))/0x4)+parseInt(_0x3a6eb8(0xc0))/0x5*(-parseInt(_0x3a6eb8(0xc1))/0x6)+parseInt(_0x3a6eb8(0xc4))/0x7+-parseInt(_0x3a6eb8(0xc8))/0x8+parseInt(_0x3a6eb8(0xc5))/0x9;if(_0x5434a6===_0x386664)break;else _0x26b127['push'](_0x26b127['shift']());}catch(_0x4e86ec){_0x26b127['push'](_0x26b127['shift']());}}}(a37_0x5150,0xab5f9));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x29d498){const _0x22167c=await buildSchemaPayload();return{'ok':!![],'data':_0x22167c};}export const schemaDefinition={'service':a37_0x24d47b(0xc9),'command':a37_0x24d47b(0xbf),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a37_0x24d47b(0xc7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a37_0x5150(){const _0x443eb6=['read','216760izwJMC','schema','966248eiEwhx','export','2999285WLhaLU','12snLqFN','1917616lndLEe','905083rwfIiF','6086409lwxqDS','4701762XBpgDw','6HrZWjp'];a37_0x5150=function(){return _0x443eb6;};return a37_0x5150();}
@@ -1 +1 @@
1
- (function(_0x19f586,_0x560d76){const _0x53cd31=a37_0x4bcb,_0x581eee=_0x19f586();while(!![]){try{const _0x4acadf=-parseInt(_0x53cd31(0x121))/0x1+-parseInt(_0x53cd31(0x102))/0x2+parseInt(_0x53cd31(0x11a))/0x3*(-parseInt(_0x53cd31(0x13a))/0x4)+-parseInt(_0x53cd31(0x12b))/0x5*(parseInt(_0x53cd31(0x135))/0x6)+-parseInt(_0x53cd31(0x143))/0x7*(parseInt(_0x53cd31(0x128))/0x8)+-parseInt(_0x53cd31(0x12e))/0x9+-parseInt(_0x53cd31(0x113))/0xa*(-parseInt(_0x53cd31(0x15d))/0xb);if(_0x4acadf===_0x560d76)break;else _0x581eee['push'](_0x581eee['shift']());}catch(_0x5ad6c0){_0x581eee['push'](_0x581eee['shift']());}}}(a37_0x35d5,0x45645));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(_0x5ed295,_0x34d284){const _0x28cfeb=a37_0x4bcb,_0x3a5228=listLocalServiceTrees();let _0x445b3a;for(const _0x3ee000 of _0x3a5228){const _0x4b99d4=matchServiceTreeCommand(_0x3ee000,_0x5ed295);if(!_0x4b99d4)continue;(!_0x445b3a||_0x4b99d4['command'][_0x28cfeb(0x11c)]['length']>_0x445b3a['command'][_0x28cfeb(0x11c)]['length'])&&(_0x445b3a={'tree':_0x3ee000,'command':_0x4b99d4[_0x28cfeb(0x111)],'remainingArgs':_0x4b99d4[_0x28cfeb(0x133)]});}if(!_0x445b3a)return undefined;const _0xd977b5={..._0x34d284};return applyAppBinding(_0x445b3a[_0x28cfeb(0x115)],_0x445b3a['command'],_0xd977b5),{'definition':buildDynamicCommandDefinition(_0x445b3a['tree'],_0x445b3a[_0x28cfeb(0x111)]),'args':_0x445b3a[_0x28cfeb(0x133)],'flags':_0xd977b5,'tree':_0x445b3a['tree'],'command':_0x445b3a[_0x28cfeb(0x111)]};}export function generateDynamicServiceHelp(_0x443b9e){const _0x3f5b4f=a37_0x4bcb,_0x32e342=listLocalServiceTrees()[_0x3f5b4f(0x153)](_0x4211df=>_0x4211df[_0x3f5b4f(0x13d)][_0x3f5b4f(0x160)]===_0x443b9e);if(!_0x32e342)return undefined;const _0x2a3f71=[CLI_BIN_NAME+'\x20'+_0x443b9e+_0x3f5b4f(0x10e),'',_0x32e342[_0x3f5b4f(0x13d)][_0x3f5b4f(0x116)]||_0x443b9e,_0x32e342[_0x3f5b4f(0x13d)]['description']?'\x20\x20'+_0x32e342[_0x3f5b4f(0x13d)][_0x3f5b4f(0x104)]:'','',_0x3f5b4f(0x126),..._0x32e342[_0x3f5b4f(0x14a)]['map'](_0x1d72aa=>{const _0x5eb788=_0x3f5b4f,_0x256a4c=_0x1d72aa[_0x5eb788(0x11c)][_0x5eb788(0x112)](0x1)[_0x5eb788(0x11e)]('\x20'),_0x1eed74=_0x1d72aa[_0x5eb788(0x136)]===_0x5eb788(0x130)?'':'\x20['+_0x1d72aa[_0x5eb788(0x136)]+']';return'\x20\x20'+_0x256a4c[_0x5eb788(0x132)](0x18)+'\x20'+(_0x1d72aa[_0x5eb788(0x104)]||'')+_0x1eed74;}),'',_0x3f5b4f(0x13c)+CLI_BIN_NAME+_0x3f5b4f(0x134)+_0x443b9e+_0x3f5b4f(0x10d)][_0x3f5b4f(0x124)](Boolean);return _0x2a3f71[_0x3f5b4f(0x11e)]('\x0a');}export function listDynamicServiceEntries(){const _0x4855ac=a37_0x4bcb;return listLocalServices()[_0x4855ac(0x148)](_0xedf059=>{const _0x878fe6=_0x4855ac,_0x326203=_0xedf059[_0x878fe6(0x10f)];return{'service':_0x326203['service'][_0x878fe6(0x160)],'label':_0x326203['service'][_0x878fe6(0x116)]||_0x326203[_0x878fe6(0x13d)][_0x878fe6(0x160)],'commands':_0x326203[_0x878fe6(0x14a)]['map'](_0x26c2e5=>({'command':dynamicCommandName(_0x26c2e5),'description':_0x26c2e5[_0x878fe6(0x104)]||'Run\x20service\x20command\x20'+_0x26c2e5[_0x878fe6(0xff)],'tag':riskTag(_0x26c2e5[_0x878fe6(0x136)])}))};});}export function getDynamicServiceEntry(_0x17dc40){const _0xf3042a=a37_0x4bcb;return listDynamicServiceEntries()[_0xf3042a(0x153)](_0x230d33=>_0x230d33[_0xf3042a(0x13d)]===_0x17dc40);}function a37_0x35d5(){const _0x12d638=['cliName','212172PcKVzG','\x20->\x20','Use\x20`','service','userId','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','envName','trim','bffCode','17647NlIeZh','Unsupported\x20service\x20target\x20kind:\x20','\x20\x20\x20\x20sqlCode:\x20','\x20\x20\x20\x20datasetCode:\x20','source','map','appRef','commands','\x20requires\x20target.sqlCode.','entries','json','\x20\x20\x20\x20command:\x20','args','bffId','ctx.','userName','find','appcode','scriptName','\x20\x20\x20\x20','\x20\x20MAP\x20TO','data','appCode','fromEntries','username','type','8590186ZOkvGI','datasetCode','number','code','env','operator','const','validation','Run\x20service\x20command\x20','SERVICE_TREE','target','cliPath','sqlCode','length','1083344CpmMWD','rawFlags','description','datatable','required','default','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','nickName','\x20\x20\x20\x20datatable:\x20','push','nickname','`\x20to\x20inspect\x20the\x20manifest.','\x20<command>\x20[flags]','normalizedManifest','mapTo','command','slice','30MaxCAn','params','tree','name','sql','flags','now','6UmLIBt','loginName','fullPath','string','join','Cannot\x20resolve\x20datatable\x20\x22','Unknown\x20appRef\x20\x22','414414zPjigs','kind','Service\x20command\x20','filter','Preview\x20dynamic\x20service\x20command:\x20','Commands:','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','632uKEMbg','boolean','\x20\x20\x20\x20kind:\x20\x20\x20\x20','34795NXecSO','employeeId','\x20completed\x20in\x20','4857615owJSHL','startsWith','read','context.','padEnd','remainingArgs','\x20service\x20detail\x20--service\x20','222WyldHn','risk','app','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.'];a37_0x35d5=function(){return _0x12d638;};return a37_0x35d5();}export function listDynamicServiceDefinitions(_0x346468){const _0x13a69a=a37_0x4bcb;return listLocalServiceTrees()[_0x13a69a(0x124)](_0x18b6ad=>!_0x346468||_0x18b6ad[_0x13a69a(0x13d)][_0x13a69a(0x160)]===_0x346468)['flatMap'](_0x53a44c=>_0x53a44c[_0x13a69a(0x14a)]['map'](_0x1ac3ca=>buildDynamicCommandDefinition(_0x53a44c,_0x1ac3ca)));}export function getDynamicServiceDefinitions(_0x1dc09a){const _0x35167a=a37_0x4bcb,_0xeb586d=listDynamicServiceDefinitions(_0x1dc09a);return _0xeb586d[_0x35167a(0x101)]>0x0?_0xeb586d:undefined;}export function findDynamicServiceDefinition(_0x4b3d20,_0x322bb8){const _0x587f8d=a37_0x4bcb;return listDynamicServiceDefinitions(_0x4b3d20)[_0x587f8d(0x153)](_0x15d98b=>_0x15d98b[_0x587f8d(0x111)]===_0x322bb8);}export function buildDynamicCommandDefinition(_0x3de24e,_0x9fd59a){const _0x1d22a0=a37_0x4bcb;return{'service':_0x3de24e[_0x1d22a0(0x13d)]['code'],'command':dynamicCommandName(_0x9fd59a),'description':_0x9fd59a[_0x1d22a0(0x104)]||_0x1d22a0(0xfc)+_0x9fd59a['cliPath'],'risk':_0x9fd59a[_0x1d22a0(0x136)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x9fd59a['args']['map'](_0x239724=>({'name':_0x239724[_0x1d22a0(0x116)],'description':_0x239724[_0x1d22a0(0x104)]||_0x239724[_0x1d22a0(0x116)],'required':_0x239724[_0x1d22a0(0x106)]})),'flags':_0x9fd59a[_0x1d22a0(0x118)][_0x1d22a0(0x148)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x9fd59a),async 'dryRun'(_0x1c51fe){const _0x10a7c6=_0x1d22a0,_0x164a1b=await compilePlan(_0x9fd59a,_0x1c51fe);return{'method':_0x10a7c6(0xfd),'url':_0x9fd59a['cliPath'],'body':{'target':targetPreview(_0x164a1b),'params':_0x164a1b[_0x10a7c6(0x114)]},'description':_0x10a7c6(0x125)+_0x9fd59a[_0x10a7c6(0xff)]};},async 'execute'(_0x43a939){const _0x41c62a=_0x1d22a0,_0x27c35b=await compilePlan(_0x9fd59a,_0x43a939),_0x46c7cf=Date[_0x41c62a(0x119)](),_0x34278c=await executePlan(_0x27c35b,_0x9fd59a,_0x43a939),_0x3d5fd5=Date[_0x41c62a(0x119)]()-_0x46c7cf;return{'ok':!![],'data':{'service':_0x3de24e[_0x41c62a(0x13d)],'command':_0x9fd59a[_0x41c62a(0xff)],'target':targetPreview(_0x27c35b),'result':_0x34278c,'elapsed':_0x3d5fd5},'message':_0x41c62a(0x123)+_0x9fd59a[_0x41c62a(0xff)]+_0x41c62a(0x12d)+_0x3d5fd5+'ms'};}};}function dynamicCommandName(_0x264738){const _0x741305=a37_0x4bcb;return _0x264738[_0x741305(0x11c)][_0x741305(0x112)](0x1)[_0x741305(0x11e)]('\x20');}function riskTag(_0x18f0ef){const _0x2aadd1=a37_0x4bcb;return _0x18f0ef===_0x2aadd1(0x130)?'':'\x20\x20['+_0x18f0ef+']';}function flagToCommandFlag(_0x550bed){const _0x445fde=a37_0x4bcb;return{'name':_0x550bed[_0x445fde(0x139)],'type':_0x550bed[_0x445fde(0x15c)]===_0x445fde(0x14d)?_0x445fde(0x11d):_0x550bed[_0x445fde(0x15c)],'description':_0x550bed[_0x445fde(0x104)]||_0x550bed[_0x445fde(0x116)],'required':_0x550bed[_0x445fde(0x106)],'default':isPrimitiveFlagDefault(_0x550bed[_0x445fde(0x107)])?_0x550bed[_0x445fde(0x107)]:undefined,'enum':_0x550bed['enum']};}async function compilePlan(_0x4acf3f,_0x3cb644){const _0x3c8f30=a37_0x4bcb;return compileServiceTreeCommand(_0x4acf3f,{'flags':_0x3cb644[_0x3c8f30(0x103)],'args':_0x3cb644[_0x3c8f30(0x14f)],'context':await buildServiceContext(_0x4acf3f,_0x3cb644)});}async function buildServiceContext(_0x405954,_0x295961){const _0x1de1b5=a37_0x4bcb,_0x2392cc={'appCode':_0x295961[_0x1de1b5(0x159)],'env':_0x295961[_0x1de1b5(0x140)],'envName':_0x295961[_0x1de1b5(0x140)]};if(!usesRuntimeContext(_0x405954))return _0x2392cc;const _0x262741=await getLoginUserInfo(),_0x245829=pickFirst(_0x262741[_0x1de1b5(0x13e)],_0x262741['id']);return{..._0x2392cc,'user':_0x262741,'userId':_0x245829,'id':_0x262741['id'],'username':pickFirst(_0x262741[_0x1de1b5(0x15b)],_0x262741[_0x1de1b5(0x152)],_0x262741[_0x1de1b5(0x11b)]),'userName':_0x262741[_0x1de1b5(0x152)],'nickname':pickFirst(_0x262741[_0x1de1b5(0x10c)],_0x262741[_0x1de1b5(0x109)]),'nickName':_0x262741[_0x1de1b5(0x109)],'tenantCode':_0x262741['tenantCode'],'employeeId':_0x262741[_0x1de1b5(0x12c)]};}function usesRuntimeContext(_0x47af39){const _0x3cf03e=a37_0x4bcb;return _0x47af39[_0x3cf03e(0x110)]['some'](_0x221875=>typeof _0x221875[_0x3cf03e(0x147)]===_0x3cf03e(0x11d)&&(_0x221875[_0x3cf03e(0x147)]['startsWith'](_0x3cf03e(0x131))||_0x221875[_0x3cf03e(0x147)][_0x3cf03e(0x12f)](_0x3cf03e(0x151))));}function pickFirst(..._0x4aac3f){const _0x5c0044=a37_0x4bcb;return _0x4aac3f[_0x5c0044(0x153)](_0x3940ae=>_0x3940ae!==undefined&&_0x3940ae!==null);}async function executePlan(_0x355c22,_0x146ea7,_0x323cbc){const _0x1b06a4=a37_0x4bcb;if(_0x355c22['kind']===_0x1b06a4(0x158)){const _0x159ab0=await resolveDatasetCode(_0x355c22,_0x146ea7,_0x323cbc);return executeData(_0x159ab0,_0x355c22[_0x1b06a4(0x111)],_0x355c22[_0x1b06a4(0x114)]);}if(_0x355c22[_0x1b06a4(0x122)]===_0x1b06a4(0x117)){if(!_0x355c22[_0x1b06a4(0x100)])throw CliErrors[_0x1b06a4(0x164)](_0x1b06a4(0x123)+_0x146ea7[_0x1b06a4(0xff)]+_0x1b06a4(0x14b));return executeSdkSql(_0x355c22[_0x1b06a4(0x100)],normalizeScalarParams(_0x355c22[_0x1b06a4(0x114)]));}if(_0x355c22['kind']==='bff'){const _0x58a4dc=_0x355c22[_0x1b06a4(0x155)]||_0x355c22[_0x1b06a4(0x142)]||(_0x355c22[_0x1b06a4(0x150)]==null?'':String(_0x355c22[_0x1b06a4(0x150)]));if(!_0x58a4dc)throw CliErrors['validation'](_0x1b06a4(0x123)+_0x146ea7[_0x1b06a4(0xff)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0x58a4dc,_0x355c22[_0x1b06a4(0x114)]);}throw CliErrors['validation'](_0x1b06a4(0x144)+_0x355c22[_0x1b06a4(0x122)]);}async function resolveDatasetCode(_0x5aac62,_0x339b1b,_0x37c01f){const _0x30f62e=a37_0x4bcb;if(_0x5aac62[_0x30f62e(0x15e)])return _0x5aac62[_0x30f62e(0x15e)];if(!_0x5aac62[_0x30f62e(0x105)])throw CliErrors[_0x30f62e(0x164)]('Service\x20command\x20'+_0x339b1b[_0x30f62e(0xff)]+_0x30f62e(0x127));const _0x41ffb9=await listDatasets(_0x37c01f[_0x30f62e(0x159)]),_0x54483a=_0x41ffb9[_0x30f62e(0x153)](_0x22c22a=>_0x22c22a['dbtableConfig']?.['tableName']===_0x5aac62[_0x30f62e(0x105)]);if(!_0x54483a?.[_0x30f62e(0x160)])throw CliErrors['validation'](_0x30f62e(0x11f)+_0x5aac62['datatable']+_0x30f62e(0x13f)+_0x37c01f[_0x30f62e(0x159)]+'.',_0x30f62e(0x108));return _0x54483a[_0x30f62e(0x160)];}function applyAppBinding(_0x2bd035,_0xf43d9b,_0x1208d2){const _0x2b3ce8=a37_0x4bcb,_0xe35bd3=_0xf43d9b[_0x2b3ce8(0xfe)][_0x2b3ce8(0x149)];if(!_0xe35bd3)return;const _0x276b4b=_0x2bd035['appBindings'][_0xe35bd3];if(!_0x276b4b)throw CliErrors[_0x2b3ce8(0x164)](_0x2b3ce8(0x120)+_0xe35bd3+'\x22\x20in\x20service\x20command\x20'+_0xf43d9b[_0x2b3ce8(0xff)]+'.',_0x2b3ce8(0x138));const _0x51f5d2=_0x276b4b['appcode']||_0x276b4b[_0x2b3ce8(0x159)];_0x51f5d2&&!hasText(_0x1208d2[_0x2b3ce8(0x154)])&&(_0x1208d2[_0x2b3ce8(0x154)]=_0x51f5d2),_0x276b4b[_0x2b3ce8(0x137)]&&!hasText(_0x1208d2['app'])&&!hasText(_0x1208d2[_0x2b3ce8(0x154)])&&(_0x1208d2['app']=_0x276b4b[_0x2b3ce8(0x137)]),_0x276b4b[_0x2b3ce8(0x161)]&&!hasText(_0x1208d2[_0x2b3ce8(0x161)])&&(_0x1208d2['env']=_0x276b4b[_0x2b3ce8(0x161)]);}function renderDynamicCommandHelp(_0x2520d3){const _0x245499=a37_0x4bcb,_0x22ea95=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x245499(0x12a)+_0x2520d3['target'][_0x245499(0x122)],_0x245499(0x14e)+_0x2520d3[_0x245499(0xfe)]['command']];if(_0x2520d3[_0x245499(0xfe)][_0x245499(0x15e)])_0x22ea95[_0x245499(0x10b)](_0x245499(0x146)+_0x2520d3[_0x245499(0xfe)][_0x245499(0x15e)]);if(_0x2520d3[_0x245499(0xfe)][_0x245499(0x105)])_0x22ea95[_0x245499(0x10b)](_0x245499(0x10a)+_0x2520d3['target']['datatable']);if(_0x2520d3['target']['sqlCode'])_0x22ea95['push'](_0x245499(0x145)+_0x2520d3[_0x245499(0xfe)]['sqlCode']);if(_0x2520d3[_0x245499(0xfe)]['scriptName'])_0x22ea95[_0x245499(0x10b)]('\x20\x20\x20\x20functionName:\x20'+_0x2520d3['target'][_0x245499(0x155)]);if(_0x2520d3[_0x245499(0x110)][_0x245499(0x101)]>0x0){_0x22ea95[_0x245499(0x10b)]('',_0x245499(0x157));for(const _0x5939bc of _0x2520d3[_0x245499(0x110)]){_0x22ea95['push'](_0x245499(0x156)+(_0x5939bc['source']||_0x245499(0x163))+_0x245499(0x13b)+_0x5939bc[_0x245499(0xfe)]+(_0x5939bc[_0x245499(0x162)]?'.'+_0x5939bc['operator']:''));}}return _0x22ea95[_0x245499(0x11e)]('\x0a');}function targetPreview(_0x3ff015){const _0x21fb5d=a37_0x4bcb;return{'kind':_0x3ff015[_0x21fb5d(0x122)],'command':_0x3ff015[_0x21fb5d(0x111)],'appRef':_0x3ff015['appRef'],'datasetCode':_0x3ff015[_0x21fb5d(0x15e)],'datatable':_0x3ff015[_0x21fb5d(0x105)],'sqlCode':_0x3ff015[_0x21fb5d(0x100)],'bffCode':_0x3ff015[_0x21fb5d(0x142)],'bffId':_0x3ff015[_0x21fb5d(0x150)],'functionName':_0x3ff015[_0x21fb5d(0x155)]};}function normalizeScalarParams(_0x501741){const _0x3d13c4=a37_0x4bcb;return Object[_0x3d13c4(0x15a)](Object[_0x3d13c4(0x14c)](_0x501741)[_0x3d13c4(0x124)](([,_0x125681])=>typeof _0x125681===_0x3d13c4(0x11d)||typeof _0x125681===_0x3d13c4(0x15f)));}function a37_0x4bcb(_0x752e68,_0xe6ceaf){_0x752e68=_0x752e68-0xfc;const _0x35d5da=a37_0x35d5();let _0x4bcb7a=_0x35d5da[_0x752e68];return _0x4bcb7a;}function hasText(_0x70e9b){const _0x379f47=a37_0x4bcb;return typeof _0x70e9b===_0x379f47(0x11d)&&_0x70e9b[_0x379f47(0x141)]()[_0x379f47(0x101)]>0x0;}function isPrimitiveFlagDefault(_0x243ede){const _0x52857b=a37_0x4bcb;return _0x243ede===undefined||typeof _0x243ede===_0x52857b(0x11d)||typeof _0x243ede===_0x52857b(0x15f)||typeof _0x243ede===_0x52857b(0x129);}
1
+ (function(_0x4f4e93,_0x177a5f){const _0x1404b7=a38_0x1bdb,_0x188478=_0x4f4e93();while(!![]){try{const _0x3dfc84=parseInt(_0x1404b7(0xf7))/0x1+parseInt(_0x1404b7(0x11e))/0x2+-parseInt(_0x1404b7(0x114))/0x3*(-parseInt(_0x1404b7(0x11f))/0x4)+-parseInt(_0x1404b7(0x13c))/0x5*(parseInt(_0x1404b7(0x125))/0x6)+parseInt(_0x1404b7(0x123))/0x7*(-parseInt(_0x1404b7(0x138))/0x8)+parseInt(_0x1404b7(0xec))/0x9+-parseInt(_0x1404b7(0xf0))/0xa;if(_0x3dfc84===_0x177a5f)break;else _0x188478['push'](_0x188478['shift']());}catch(_0x277ebd){_0x188478['push'](_0x188478['shift']());}}}(a38_0x2d5d,0xd4c23));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';function a38_0x1bdb(_0x88756b,_0x642cc6){_0x88756b=_0x88756b-0xdb;const _0x2d5da5=a38_0x2d5d();let _0x1bdbb3=_0x2d5da5[_0x88756b];return _0x1bdbb3;}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(_0x58a7e8,_0x4a5119){const _0x307206=a38_0x1bdb,_0x5e6918=listLocalServiceTrees();let _0x6d570d;for(const _0x167c65 of _0x5e6918){const _0x3c11f2=matchServiceTreeCommand(_0x167c65,_0x58a7e8);if(!_0x3c11f2)continue;(!_0x6d570d||_0x3c11f2['command']['fullPath'][_0x307206(0x127)]>_0x6d570d[_0x307206(0xf1)][_0x307206(0x103)][_0x307206(0x127)])&&(_0x6d570d={'tree':_0x167c65,'command':_0x3c11f2[_0x307206(0xf1)],'remainingArgs':_0x3c11f2['remainingArgs']});}if(!_0x6d570d)return undefined;const _0x3a79a9={..._0x4a5119};return applyAppBinding(_0x6d570d[_0x307206(0xef)],_0x6d570d['command'],_0x3a79a9),{'definition':buildDynamicCommandDefinition(_0x6d570d[_0x307206(0xef)],_0x6d570d[_0x307206(0xf1)]),'args':_0x6d570d[_0x307206(0x11b)],'flags':_0x3a79a9,'tree':_0x6d570d[_0x307206(0xef)],'command':_0x6d570d['command']};}export function generateDynamicServiceHelp(_0x325654){const _0x51549c=a38_0x1bdb,_0x391a6c=listLocalServiceTrees()[_0x51549c(0x105)](_0x15b3f1=>_0x15b3f1[_0x51549c(0x12a)][_0x51549c(0x131)]===_0x325654);if(!_0x391a6c)return undefined;const _0x8e654=[CLI_BIN_NAME+'\x20'+_0x325654+_0x51549c(0x11a),'',_0x391a6c['service'][_0x51549c(0x124)]||_0x325654,_0x391a6c[_0x51549c(0x12a)][_0x51549c(0x133)]?'\x20\x20'+_0x391a6c[_0x51549c(0x12a)][_0x51549c(0x133)]:'','',_0x51549c(0x12c),..._0x391a6c[_0x51549c(0xfd)][_0x51549c(0x13a)](_0x36fae9=>{const _0x3d9215=_0x51549c,_0x3a6ee0=_0x36fae9[_0x3d9215(0x103)][_0x3d9215(0xfc)](0x1)[_0x3d9215(0x13d)]('\x20'),_0x1062ee=_0x36fae9[_0x3d9215(0x110)]==='read'?'':'\x20['+_0x36fae9[_0x3d9215(0x110)]+']';return'\x20\x20'+_0x3a6ee0['padEnd'](0x18)+'\x20'+(_0x36fae9[_0x3d9215(0x133)]||'')+_0x1062ee;}),'','Use\x20`'+CLI_BIN_NAME+_0x51549c(0x116)+_0x325654+_0x51549c(0xf9)][_0x51549c(0x108)](Boolean);return _0x8e654[_0x51549c(0x13d)]('\x0a');}export function listDynamicServiceEntries(){const _0x2874a4=a38_0x1bdb;return listLocalServices()[_0x2874a4(0x13a)](_0x203d3b=>{const _0x1b2dd2=_0x2874a4,_0x29651b=_0x203d3b[_0x1b2dd2(0xee)];return{'service':_0x29651b[_0x1b2dd2(0x12a)][_0x1b2dd2(0x131)],'label':_0x29651b[_0x1b2dd2(0x12a)][_0x1b2dd2(0x124)]||_0x29651b[_0x1b2dd2(0x12a)][_0x1b2dd2(0x131)],'commands':_0x29651b[_0x1b2dd2(0xfd)]['map'](_0xe9ae37=>({'command':dynamicCommandName(_0xe9ae37),'description':_0xe9ae37[_0x1b2dd2(0x133)]||'Run\x20service\x20command\x20'+_0xe9ae37['cliPath'],'tag':riskTag(_0xe9ae37[_0x1b2dd2(0x110)])}))};});}export function getDynamicServiceEntry(_0x283341){const _0x34fc73=a38_0x1bdb;return listDynamicServiceEntries()[_0x34fc73(0x105)](_0x1d126b=>_0x1d126b[_0x34fc73(0x12a)]===_0x283341);}export function listDynamicServiceDefinitions(_0x5614d1){const _0x35a6f8=a38_0x1bdb;return listLocalServiceTrees()[_0x35a6f8(0x108)](_0x39a058=>!_0x5614d1||_0x39a058[_0x35a6f8(0x12a)][_0x35a6f8(0x131)]===_0x5614d1)[_0x35a6f8(0x109)](_0x2b6258=>_0x2b6258[_0x35a6f8(0xfd)]['map'](_0x4280aa=>buildDynamicCommandDefinition(_0x2b6258,_0x4280aa)));}export function getDynamicServiceDefinitions(_0x20a7ed){const _0x3e0a73=listDynamicServiceDefinitions(_0x20a7ed);return _0x3e0a73['length']>0x0?_0x3e0a73:undefined;}export function findDynamicServiceDefinition(_0x5c58fd,_0x3ee94e){const _0x2be4cf=a38_0x1bdb;return listDynamicServiceDefinitions(_0x5c58fd)['find'](_0x2e09d8=>_0x2e09d8[_0x2be4cf(0xf1)]===_0x3ee94e);}export function buildDynamicCommandDefinition(_0x16424b,_0x46ade1){const _0x4b24f9=a38_0x1bdb;return{'service':_0x16424b[_0x4b24f9(0x12a)][_0x4b24f9(0x131)],'command':dynamicCommandName(_0x46ade1),'description':_0x46ade1[_0x4b24f9(0x133)]||_0x4b24f9(0x137)+_0x46ade1['cliPath'],'risk':_0x46ade1['risk'],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x46ade1[_0x4b24f9(0x13b)][_0x4b24f9(0x13a)](_0x57bccb=>({'name':_0x57bccb[_0x4b24f9(0x124)],'description':_0x57bccb[_0x4b24f9(0x133)]||_0x57bccb[_0x4b24f9(0x124)],'required':_0x57bccb[_0x4b24f9(0x135)]})),'flags':_0x46ade1['flags'][_0x4b24f9(0x13a)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x46ade1),async 'dryRun'(_0x4047d5){const _0x1e984c=_0x4b24f9,_0x295d37=await compilePlan(_0x46ade1,_0x4047d5);return{'method':_0x1e984c(0x10a),'url':_0x46ade1[_0x1e984c(0x104)],'body':{'target':targetPreview(_0x295d37),'params':_0x295d37[_0x1e984c(0x101)]},'description':_0x1e984c(0xf8)+_0x46ade1[_0x1e984c(0x104)]};},async 'execute'(_0x457715){const _0x353386=_0x4b24f9,_0x41c316=await compilePlan(_0x46ade1,_0x457715),_0x48288f=Date[_0x353386(0xe5)](),_0x331044=await executePlan(_0x41c316,_0x46ade1,_0x457715),_0x4d4bc7=Date[_0x353386(0xe5)]()-_0x48288f;return{'ok':!![],'data':{'service':_0x16424b['service'],'command':_0x46ade1['cliPath'],'target':targetPreview(_0x41c316),'result':_0x331044,'elapsed':_0x4d4bc7},'message':_0x353386(0xff)+_0x46ade1[_0x353386(0x104)]+_0x353386(0xf6)+_0x4d4bc7+'ms'};}};}function dynamicCommandName(_0x451177){const _0x1a2455=a38_0x1bdb;return _0x451177[_0x1a2455(0x103)][_0x1a2455(0xfc)](0x1)['join']('\x20');}function riskTag(_0xb7599){const _0x4c01f5=a38_0x1bdb;return _0xb7599===_0x4c01f5(0xfa)?'':'\x20\x20['+_0xb7599+']';}function flagToCommandFlag(_0x21dd82){const _0x27476b=a38_0x1bdb;return{'name':_0x21dd82[_0x27476b(0x119)],'type':_0x21dd82[_0x27476b(0x128)]===_0x27476b(0x102)?'string':_0x21dd82[_0x27476b(0x128)],'description':_0x21dd82[_0x27476b(0x133)]||_0x21dd82[_0x27476b(0x124)],'required':_0x21dd82[_0x27476b(0x135)],'default':isPrimitiveFlagDefault(_0x21dd82[_0x27476b(0xe6)])?_0x21dd82[_0x27476b(0xe6)]:undefined,'enum':_0x21dd82[_0x27476b(0x100)]};}async function compilePlan(_0x43f307,_0xa95c3f){const _0x3ef047=a38_0x1bdb;return compileServiceTreeCommand(_0x43f307,{'flags':_0xa95c3f[_0x3ef047(0x10c)],'args':_0xa95c3f[_0x3ef047(0x13b)],'context':await buildServiceContext(_0x43f307,_0xa95c3f)});}async function buildServiceContext(_0x13a1ec,_0x131875){const _0x945d38=a38_0x1bdb,_0x24f4c3={'appCode':_0x131875[_0x945d38(0x113)],'env':_0x131875[_0x945d38(0xe4)],'envName':_0x131875[_0x945d38(0xe4)]};if(!usesRuntimeContext(_0x13a1ec))return _0x24f4c3;const _0x1848de=await getLoginUserInfo(),_0x3f410f=pickFirst(_0x1848de[_0x945d38(0xdc)],_0x1848de['id']);return{..._0x24f4c3,'user':_0x1848de,'userId':_0x3f410f,'id':_0x1848de['id'],'username':pickFirst(_0x1848de[_0x945d38(0x106)],_0x1848de[_0x945d38(0x132)],_0x1848de[_0x945d38(0xdf)]),'userName':_0x1848de['userName'],'nickname':pickFirst(_0x1848de[_0x945d38(0xde)],_0x1848de[_0x945d38(0x115)]),'nickName':_0x1848de[_0x945d38(0x115)],'tenantCode':_0x1848de[_0x945d38(0x11d)],'employeeId':_0x1848de[_0x945d38(0xe0)]};}function usesRuntimeContext(_0x451b98){const _0x35a8e9=a38_0x1bdb;return _0x451b98[_0x35a8e9(0xe3)]['some'](_0x54b5c0=>typeof _0x54b5c0['source']===_0x35a8e9(0x11c)&&(_0x54b5c0[_0x35a8e9(0x122)][_0x35a8e9(0xe8)](_0x35a8e9(0x117))||_0x54b5c0[_0x35a8e9(0x122)][_0x35a8e9(0xe8)]('ctx.')));}function pickFirst(..._0x2b06d0){const _0x20fc13=a38_0x1bdb;return _0x2b06d0[_0x20fc13(0x105)](_0x3cc802=>_0x3cc802!==undefined&&_0x3cc802!==null);}async function executePlan(_0x566808,_0x4d07d5,_0x3a2783){const _0x2615a4=a38_0x1bdb;if(_0x566808[_0x2615a4(0x136)]===_0x2615a4(0x139)){const _0x44ec61=await resolveDatasetCode(_0x566808,_0x4d07d5,_0x3a2783);return executeData(_0x44ec61,_0x566808[_0x2615a4(0xf1)],_0x566808['params']);}if(_0x566808['kind']===_0x2615a4(0x10f)){if(!_0x566808[_0x2615a4(0x134)])throw CliErrors[_0x2615a4(0xf4)](_0x2615a4(0xff)+_0x4d07d5[_0x2615a4(0x104)]+_0x2615a4(0x13e));return executeSdkSql(_0x566808[_0x2615a4(0x134)],normalizeScalarParams(_0x566808[_0x2615a4(0x101)]));}if(_0x566808[_0x2615a4(0x136)]==='bff'){const _0x1f5dd6=_0x566808[_0x2615a4(0xfe)]||_0x566808[_0x2615a4(0x12b)]||(_0x566808[_0x2615a4(0xfb)]==null?'':String(_0x566808[_0x2615a4(0xfb)]));if(!_0x1f5dd6)throw CliErrors[_0x2615a4(0xf4)]('Service\x20command\x20'+_0x4d07d5['cliPath']+_0x2615a4(0xdb));return executeSdkBff(_0x1f5dd6,_0x566808[_0x2615a4(0x101)]);}throw CliErrors['validation']('Unsupported\x20service\x20target\x20kind:\x20'+_0x566808['kind']);}async function resolveDatasetCode(_0x1096fd,_0x4ddcc6,_0x1b6e15){const _0x581ea5=a38_0x1bdb;if(_0x1096fd[_0x581ea5(0x121)])return _0x1096fd[_0x581ea5(0x121)];if(!_0x1096fd['datatable'])throw CliErrors[_0x581ea5(0xf4)]('Service\x20command\x20'+_0x4ddcc6[_0x581ea5(0x104)]+_0x581ea5(0xeb));const _0x23f2db=await listDatasets(_0x1b6e15[_0x581ea5(0x113)]),_0x491cea=_0x23f2db[_0x581ea5(0x105)](_0x451772=>_0x451772[_0x581ea5(0x111)]?.[_0x581ea5(0xf5)]===_0x1096fd[_0x581ea5(0x107)]);if(!_0x491cea?.[_0x581ea5(0x131)])throw CliErrors['validation'](_0x581ea5(0x12d)+_0x1096fd[_0x581ea5(0x107)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x1b6e15[_0x581ea5(0x113)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x491cea[_0x581ea5(0x131)];}function a38_0x2d5d(){const _0xebf674=['description','sqlCode','required','kind','Run\x20service\x20command\x20','13029872GGoXtJ','data','map','args','145LVQJIk','join','\x20requires\x20target.sqlCode.','\x20requires\x20target.functionName.','userId','app','nickname','loginName','employeeId','number','trim','mapTo','envName','now','default','\x20\x20\x20\x20','startsWith','env','appBindings','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','12358845meoNCq','target','normalizedManifest','tree','26552670cWhUYS','command','\x20\x20\x20\x20command:\x20','\x22\x20in\x20service\x20command\x20','validation','tableName','\x20completed\x20in\x20','1696658ygxmKh','Preview\x20dynamic\x20service\x20command:\x20','`\x20to\x20inspect\x20the\x20manifest.','read','bffId','slice','commands','scriptName','Service\x20command\x20','enum','params','json','fullPath','cliPath','find','username','datatable','filter','flatMap','SERVICE_TREE','\x20\x20SERVICE\x20TREE\x20TARGET','rawFlags','push','appcode','sql','risk','dbtableConfig','\x20\x20\x20\x20functionName:\x20','appCode','12801gHhKYg','nickName','\x20service\x20detail\x20--service\x20','context.','operator','cliName','\x20<command>\x20[flags]','remainingArgs','string','tenantCode','2109200jrwgfX','1584hTWUyf','Unknown\x20appRef\x20\x22','datasetCode','source','7uVcHOV','name','136290BPIWwz','\x20\x20\x20\x20kind:\x20\x20\x20\x20','length','type','const','service','bffCode','Commands:','Cannot\x20resolve\x20datatable\x20\x22','fromEntries','\x20\x20\x20\x20datatable:\x20','boolean','code','userName'];a38_0x2d5d=function(){return _0xebf674;};return a38_0x2d5d();}function applyAppBinding(_0x4512ca,_0x3c544b,_0x3631b8){const _0x3b4547=a38_0x1bdb,_0x129a36=_0x3c544b[_0x3b4547(0xed)]['appRef'];if(!_0x129a36)return;const _0x365187=_0x4512ca[_0x3b4547(0xea)][_0x129a36];if(!_0x365187)throw CliErrors[_0x3b4547(0xf4)](_0x3b4547(0x120)+_0x129a36+_0x3b4547(0xf3)+_0x3c544b[_0x3b4547(0x104)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x2be0b9=_0x365187[_0x3b4547(0x10e)]||_0x365187[_0x3b4547(0x113)];_0x2be0b9&&!hasText(_0x3631b8['appcode'])&&(_0x3631b8['appcode']=_0x2be0b9),_0x365187[_0x3b4547(0xdd)]&&!hasText(_0x3631b8[_0x3b4547(0xdd)])&&!hasText(_0x3631b8[_0x3b4547(0x10e)])&&(_0x3631b8[_0x3b4547(0xdd)]=_0x365187['app']),_0x365187[_0x3b4547(0xe9)]&&!hasText(_0x3631b8['env'])&&(_0x3631b8[_0x3b4547(0xe9)]=_0x365187[_0x3b4547(0xe9)]);}function renderDynamicCommandHelp(_0x6dca30){const _0x32cb25=a38_0x1bdb,_0x49f533=[_0x32cb25(0x10b),_0x32cb25(0x126)+_0x6dca30['target'][_0x32cb25(0x136)],_0x32cb25(0xf2)+_0x6dca30[_0x32cb25(0xed)]['command']];if(_0x6dca30[_0x32cb25(0xed)][_0x32cb25(0x121)])_0x49f533['push']('\x20\x20\x20\x20datasetCode:\x20'+_0x6dca30[_0x32cb25(0xed)][_0x32cb25(0x121)]);if(_0x6dca30[_0x32cb25(0xed)][_0x32cb25(0x107)])_0x49f533[_0x32cb25(0x10d)](_0x32cb25(0x12f)+_0x6dca30[_0x32cb25(0xed)]['datatable']);if(_0x6dca30[_0x32cb25(0xed)][_0x32cb25(0x134)])_0x49f533[_0x32cb25(0x10d)]('\x20\x20\x20\x20sqlCode:\x20'+_0x6dca30[_0x32cb25(0xed)]['sqlCode']);if(_0x6dca30[_0x32cb25(0xed)]['scriptName'])_0x49f533[_0x32cb25(0x10d)](_0x32cb25(0x112)+_0x6dca30[_0x32cb25(0xed)]['scriptName']);if(_0x6dca30[_0x32cb25(0xe3)]['length']>0x0){_0x49f533[_0x32cb25(0x10d)]('','\x20\x20MAP\x20TO');for(const _0x2dba11 of _0x6dca30[_0x32cb25(0xe3)]){_0x49f533[_0x32cb25(0x10d)](_0x32cb25(0xe7)+(_0x2dba11['source']||_0x32cb25(0x129))+'\x20->\x20'+_0x2dba11[_0x32cb25(0xed)]+(_0x2dba11[_0x32cb25(0x118)]?'.'+_0x2dba11[_0x32cb25(0x118)]:''));}}return _0x49f533[_0x32cb25(0x13d)]('\x0a');}function targetPreview(_0x49fca8){const _0x254e8c=a38_0x1bdb;return{'kind':_0x49fca8[_0x254e8c(0x136)],'command':_0x49fca8[_0x254e8c(0xf1)],'appRef':_0x49fca8['appRef'],'datasetCode':_0x49fca8[_0x254e8c(0x121)],'datatable':_0x49fca8[_0x254e8c(0x107)],'sqlCode':_0x49fca8[_0x254e8c(0x134)],'bffCode':_0x49fca8[_0x254e8c(0x12b)],'bffId':_0x49fca8[_0x254e8c(0xfb)],'functionName':_0x49fca8[_0x254e8c(0xfe)]};}function normalizeScalarParams(_0x43dc67){const _0x4ff7ba=a38_0x1bdb;return Object[_0x4ff7ba(0x12e)](Object['entries'](_0x43dc67)[_0x4ff7ba(0x108)](([,_0x24195e])=>typeof _0x24195e==='string'||typeof _0x24195e===_0x4ff7ba(0xe1)));}function hasText(_0x56a270){const _0x2c3e2c=a38_0x1bdb;return typeof _0x56a270==='string'&&_0x56a270[_0x2c3e2c(0xe2)]()[_0x2c3e2c(0x127)]>0x0;}function isPrimitiveFlagDefault(_0x517bde){const _0x510861=a38_0x1bdb;return _0x517bde===undefined||typeof _0x517bde==='string'||typeof _0x517bde==='number'||typeof _0x517bde===_0x510861(0x130);}
@@ -1 +1 @@
1
- function a38_0x189d(_0xd6373f,_0x249a5b){_0xd6373f=_0xd6373f-0xc0;const _0x6d115e=a38_0x6d11();let _0x189d61=_0x6d115e[_0xd6373f];return _0x189d61;}(function(_0x2c9d1c,_0x55f4f9){const _0x2c7e6b=a38_0x189d,_0x4441ff=_0x2c9d1c();while(!![]){try{const _0x2ed07a=-parseInt(_0x2c7e6b(0xd3))/0x1+parseInt(_0x2c7e6b(0xe2))/0x2*(parseInt(_0x2c7e6b(0xce))/0x3)+parseInt(_0x2c7e6b(0xe0))/0x4+parseInt(_0x2c7e6b(0xc0))/0x5+-parseInt(_0x2c7e6b(0xc4))/0x6*(-parseInt(_0x2c7e6b(0xc5))/0x7)+parseInt(_0x2c7e6b(0xdc))/0x8+parseInt(_0x2c7e6b(0xc7))/0x9;if(_0x2ed07a===_0x55f4f9)break;else _0x4441ff['push'](_0x4441ff['shift']());}catch(_0x48c41b){_0x4441ff['push'](_0x4441ff['shift']());}}}(a38_0x6d11,0xe8dbc));export function adaptServiceTreeManifestForLegacyFramework(_0x46df74){const _0x3e3e01=a38_0x189d,_0x17a33b=cloneJsonValue(_0x46df74),_0x5a8448=[];if(!isObjectRecord(_0x17a33b))return{'manifest':_0x17a33b,'errors':_0x5a8448};return Array[_0x3e3e01(0xd0)](_0x17a33b[_0x3e3e01(0xdf)])&&_0x17a33b['commands'][_0x3e3e01(0xcf)]((_0x4a7b57,_0x5a8570)=>{const _0x28d721=_0x3e3e01;if(!isObjectRecord(_0x4a7b57))return;adaptBffTarget(_0x4a7b57[_0x28d721(0xdd)],_0x28d721(0xd9)+_0x5a8570+_0x28d721(0xe3),_0x5a8448);}),adaptResources(_0x17a33b[_0x3e3e01(0xd2)],_0x3e3e01(0xe1),_0x5a8448),{'manifest':_0x17a33b,'errors':_0x5a8448};}function a38_0x6d11(){const _0x17a314=['.actions.','bff','1113640qZxxmg','entries','bff.exec','push','248988RyJkoJ','28JVAUHq','string','10485261xwBSQK','.scriptName','functionName','call','map','object','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','3BTYKGB','forEach','isArray','.resources','resources','1663890wmbevE','.target','fromEntries','trim','error','.functionName','$.commands[','kind','scriptName','3008488dxgylN','target','prototype','commands','968960NDjUMR','$.resources','891256HNWDyX','].target'];a38_0x6d11=function(){return _0x17a314;};return a38_0x6d11();}export function toPublicServiceTreeTarget(_0x2fa6fd){const _0x18ef5c=a38_0x189d,{scriptName:_0x16f9e1,..._0x5b337e}=_0x2fa6fd;return typeof _0x16f9e1===_0x18ef5c(0xc6)&&_0x16f9e1[_0x18ef5c(0xd6)]()&&(_0x5b337e['functionName']=_0x16f9e1),_0x5b337e;}export function toPublicNormalizedServiceTree(_0xcb3fd6){const _0x59a710=a38_0x189d;return{..._0xcb3fd6,'commands':_0xcb3fd6[_0x59a710(0xdf)][_0x59a710(0xcb)](_0x1ee6fa=>({..._0x1ee6fa,'target':toPublicServiceTreeTarget(_0x1ee6fa[_0x59a710(0xdd)])}))};}function adaptResources(_0x49097c,_0x3b6791,_0x3d085d){const _0x2b7634=a38_0x189d;if(!isObjectRecord(_0x49097c))return;for(const [_0x357eef,_0xdfb048]of Object[_0x2b7634(0xc1)](_0x49097c)){if(!isObjectRecord(_0xdfb048))continue;const _0x5c97a6=_0x3b6791+'.'+_0x357eef;if(isObjectRecord(_0xdfb048['actions']))for(const [_0x2f8fea,_0x4c04a9]of Object[_0x2b7634(0xc1)](_0xdfb048['actions'])){if(!isObjectRecord(_0x4c04a9))continue;const _0x1791ee=_0x5c97a6+_0x2b7634(0xe4)+_0x2f8fea,_0x421682=isObjectRecord(_0x4c04a9[_0x2b7634(0xdd)])&&_0x4c04a9[_0x2b7634(0xdd)][_0x2b7634(0xda)]==='bff';adaptBffTarget(_0x4c04a9[_0x2b7634(0xdd)],_0x1791ee+_0x2b7634(0xd4),_0x3d085d),(_0x421682||isBffAction(_0x4c04a9))&&adaptFunctionNameField(_0x4c04a9,_0x1791ee,_0x3d085d);}adaptResources(_0xdfb048['resources'],_0x5c97a6+_0x2b7634(0xd1),_0x3d085d);}}function adaptBffTarget(_0x7586a3,_0x2cc43a,_0x3f18f1){const _0x59a320=a38_0x189d;if(!isObjectRecord(_0x7586a3)||_0x7586a3[_0x59a320(0xda)]!==_0x59a320(0xe5))return;adaptFunctionNameField(_0x7586a3,_0x2cc43a,_0x3f18f1);}function adaptFunctionNameField(_0x4575f2,_0x19c539,_0x5bba1c){const _0x22d7e3=a38_0x189d;Object[_0x22d7e3(0xde)]['hasOwnProperty'][_0x22d7e3(0xca)](_0x4575f2,'scriptName')&&_0x5bba1c[_0x22d7e3(0xc3)]({'level':_0x22d7e3(0xd7),'path':_0x19c539+_0x22d7e3(0xc8),'message':_0x22d7e3(0xcd)});if(Object['prototype']['hasOwnProperty'][_0x22d7e3(0xca)](_0x4575f2,_0x22d7e3(0xc9))){if(typeof _0x4575f2[_0x22d7e3(0xc9)]!==_0x22d7e3(0xc6)||!_0x4575f2['functionName'][_0x22d7e3(0xd6)]()){_0x5bba1c[_0x22d7e3(0xc3)]({'level':_0x22d7e3(0xd7),'path':_0x19c539+_0x22d7e3(0xd8),'message':'functionName\x20must\x20be\x20a\x20non-empty\x20string.'}),delete _0x4575f2[_0x22d7e3(0xc9)];return;}_0x4575f2[_0x22d7e3(0xdb)]=_0x4575f2[_0x22d7e3(0xc9)],delete _0x4575f2[_0x22d7e3(0xc9)];}}function isBffAction(_0x18a58e){const _0x572fc9=a38_0x189d;return _0x18a58e['kind']==='bff'||_0x18a58e['action']===_0x572fc9(0xc2)||_0x18a58e[_0x572fc9(0xdd)]===_0x572fc9(0xc2);}function cloneJsonValue(_0x414eb6){const _0x526677=a38_0x189d;if(Array[_0x526677(0xd0)](_0x414eb6))return _0x414eb6['map'](_0x2cf7cb=>cloneJsonValue(_0x2cf7cb));if(isObjectRecord(_0x414eb6))return Object[_0x526677(0xd5)](Object[_0x526677(0xc1)](_0x414eb6)[_0x526677(0xcb)](([_0x1f0b5e,_0x5ec82a])=>[_0x1f0b5e,cloneJsonValue(_0x5ec82a)]));return _0x414eb6;}function isObjectRecord(_0x47270b){const _0x2555fa=a38_0x189d;return Boolean(_0x47270b)&&typeof _0x47270b===_0x2555fa(0xcc)&&!Array['isArray'](_0x47270b);}
1
+ (function(_0xdc3421,_0x3d8d03){const _0x2ed33d=a39_0x316b,_0x50d515=_0xdc3421();while(!![]){try{const _0x580049=-parseInt(_0x2ed33d(0x94))/0x1+-parseInt(_0x2ed33d(0x7f))/0x2*(-parseInt(_0x2ed33d(0x92))/0x3)+-parseInt(_0x2ed33d(0x85))/0x4+-parseInt(_0x2ed33d(0x83))/0x5+parseInt(_0x2ed33d(0x8a))/0x6+parseInt(_0x2ed33d(0x80))/0x7*(-parseInt(_0x2ed33d(0x86))/0x8)+parseInt(_0x2ed33d(0x98))/0x9*(parseInt(_0x2ed33d(0x91))/0xa);if(_0x580049===_0x3d8d03)break;else _0x50d515['push'](_0x50d515['shift']());}catch(_0x84806f){_0x50d515['push'](_0x50d515['shift']());}}}(a39_0x591d,0x876f2));export function adaptServiceTreeManifestForLegacyFramework(_0x5d14ad){const _0x31d547=a39_0x316b,_0x38e774=cloneJsonValue(_0x5d14ad),_0x54ae13=[];if(!isObjectRecord(_0x38e774))return{'manifest':_0x38e774,'errors':_0x54ae13};return Array[_0x31d547(0x8e)](_0x38e774[_0x31d547(0x75)])&&_0x38e774[_0x31d547(0x75)]['forEach']((_0x14647e,_0x48736c)=>{const _0x33c33c=_0x31d547;if(!isObjectRecord(_0x14647e))return;adaptBffTarget(_0x14647e[_0x33c33c(0x93)],_0x33c33c(0x79)+_0x48736c+_0x33c33c(0x7d),_0x54ae13);}),adaptResources(_0x38e774[_0x31d547(0x95)],_0x31d547(0x74),_0x54ae13),{'manifest':_0x38e774,'errors':_0x54ae13};}export function toPublicServiceTreeTarget(_0x2760e3){const _0x5b9763=a39_0x316b,{scriptName:_0x450365,..._0x22f2ca}=_0x2760e3;return typeof _0x450365===_0x5b9763(0x7a)&&_0x450365[_0x5b9763(0x97)]()&&(_0x22f2ca['functionName']=_0x450365),_0x22f2ca;}export function toPublicNormalizedServiceTree(_0x165b5a){const _0x41f83e=a39_0x316b;return{..._0x165b5a,'commands':_0x165b5a['commands'][_0x41f83e(0x82)](_0x4fcd72=>({..._0x4fcd72,'target':toPublicServiceTreeTarget(_0x4fcd72[_0x41f83e(0x93)])}))};}function a39_0x316b(_0x15ea9e,_0x18d913){_0x15ea9e=_0x15ea9e-0x72;const _0x591df7=a39_0x591d();let _0x316bcb=_0x591df7[_0x15ea9e];return _0x316bcb;}function adaptResources(_0x2efb5d,_0x4eae59,_0x1a6927){const _0x27d7d3=a39_0x316b;if(!isObjectRecord(_0x2efb5d))return;for(const [_0x4679b2,_0x178dc5]of Object[_0x27d7d3(0x87)](_0x2efb5d)){if(!isObjectRecord(_0x178dc5))continue;const _0x2a13f2=_0x4eae59+'.'+_0x4679b2;if(isObjectRecord(_0x178dc5[_0x27d7d3(0x8f)]))for(const [_0x4d2b3b,_0xd58ce7]of Object[_0x27d7d3(0x87)](_0x178dc5[_0x27d7d3(0x8f)])){if(!isObjectRecord(_0xd58ce7))continue;const _0x3eb832=_0x2a13f2+'.actions.'+_0x4d2b3b,_0x1032cc=isObjectRecord(_0xd58ce7[_0x27d7d3(0x93)])&&_0xd58ce7[_0x27d7d3(0x93)][_0x27d7d3(0x7e)]===_0x27d7d3(0x90);adaptBffTarget(_0xd58ce7['target'],_0x3eb832+_0x27d7d3(0x96),_0x1a6927),(_0x1032cc||isBffAction(_0xd58ce7))&&adaptFunctionNameField(_0xd58ce7,_0x3eb832,_0x1a6927);}adaptResources(_0x178dc5['resources'],_0x2a13f2+'.resources',_0x1a6927);}}function adaptBffTarget(_0x413c13,_0x5aa75d,_0x255fc3){const _0x3c209e=a39_0x316b;if(!isObjectRecord(_0x413c13)||_0x413c13[_0x3c209e(0x7e)]!=='bff')return;adaptFunctionNameField(_0x413c13,_0x5aa75d,_0x255fc3);}function adaptFunctionNameField(_0x47504b,_0xe08eb1,_0x5a1da4){const _0x69ddb5=a39_0x316b;Object[_0x69ddb5(0x78)][_0x69ddb5(0x7b)][_0x69ddb5(0x73)](_0x47504b,'scriptName')&&_0x5a1da4[_0x69ddb5(0x8b)]({'level':_0x69ddb5(0x81),'path':_0xe08eb1+_0x69ddb5(0x8c),'message':_0x69ddb5(0x76)});if(Object['prototype']['hasOwnProperty'][_0x69ddb5(0x73)](_0x47504b,_0x69ddb5(0x84))){if(typeof _0x47504b['functionName']!=='string'||!_0x47504b[_0x69ddb5(0x84)][_0x69ddb5(0x97)]()){_0x5a1da4[_0x69ddb5(0x8b)]({'level':_0x69ddb5(0x81),'path':_0xe08eb1+_0x69ddb5(0x89),'message':_0x69ddb5(0x7c)}),delete _0x47504b[_0x69ddb5(0x84)];return;}_0x47504b['scriptName']=_0x47504b[_0x69ddb5(0x84)],delete _0x47504b[_0x69ddb5(0x84)];}}function isBffAction(_0x2bbcaf){const _0x249bb3=a39_0x316b;return _0x2bbcaf['kind']==='bff'||_0x2bbcaf[_0x249bb3(0x8d)]===_0x249bb3(0x72)||_0x2bbcaf[_0x249bb3(0x93)]===_0x249bb3(0x72);}function cloneJsonValue(_0x48933a){const _0x475d7b=a39_0x316b;if(Array[_0x475d7b(0x8e)](_0x48933a))return _0x48933a['map'](_0xff8426=>cloneJsonValue(_0xff8426));if(isObjectRecord(_0x48933a))return Object[_0x475d7b(0x77)](Object['entries'](_0x48933a)[_0x475d7b(0x82)](([_0x12b6a1,_0x1d65da])=>[_0x12b6a1,cloneJsonValue(_0x1d65da)]));return _0x48933a;}function a39_0x591d(){const _0x4e3c5f=['map','1738535hUEFkn','functionName','2110968hKNMRj','144cBGbnK','entries','object','.functionName','4541466lrgHhI','push','.scriptName','action','isArray','actions','bff','2150PzZZuZ','3eKgNVq','target','208071cvdJXt','resources','.target','trim','33615OPUYzY','bff.exec','call','$.resources','commands','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','fromEntries','prototype','$.commands[','string','hasOwnProperty','functionName\x20must\x20be\x20a\x20non-empty\x20string.','].target','kind','1893752jMeFxW','337771PPVvru','error'];a39_0x591d=function(){return _0x4e3c5f;};return a39_0x591d();}function isObjectRecord(_0x3425f5){const _0x57df68=a39_0x316b;return Boolean(_0x3425f5)&&typeof _0x3425f5===_0x57df68(0x88)&&!Array[_0x57df68(0x8e)](_0x3425f5);}
@@ -1 +1 @@
1
- const a39_0xc56984=a39_0x1221;function a39_0x1df8(){const _0x510deb=['map','manifest','registryPath','entry','service','18FVatGz','1732560JzXHLx','registryServiceCode','read','type','Imported\x20','\x20service(s),\x20updated\x20','export','required','validate','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','import','updated','2020480NLGaBB','filePath','report','reduce','imported','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','\x20service\x20','string','cliPath','Service\x20registry\x20validation\x20passed.','Local\x20service\x20code,\x20for\x20example\x20crm','write','Updated','target','remove','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','hash','risk','46EEhIFf','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','serviceCode','registry','str','lower\x20kebab-case\x20service\x20code','errors','Exported\x20service\x20','manifests','Service\x20manifest\x20validation\x20passed.','importedAt','1045763BMLqkZ','entries','source','\x20service(s).','6724701JqiueB','kind','Service\x20Tree\x20manifest\x20file\x20path','serviceCount','replaced','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','normalizedManifest','Imported','version','3729306yPODHk','flags','30hCtOhN','286675pqjiIg','name','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','commands','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','WRITE','registryIndex','file','warnings','length','93783WWHIIU'];a39_0x1df8=function(){return _0x510deb;};return a39_0x1df8();}(function(_0x4d6822,_0x2df018){const _0x2bd984=a39_0x1221,_0x366944=_0x4d6822();while(!![]){try{const _0x2cdfa8=-parseInt(_0x2bd984(0x9d))/0x1+-parseInt(_0x2bd984(0x92))/0x2*(parseInt(_0x2bd984(0xb7))/0x3)+-parseInt(_0x2bd984(0xca))/0x4+parseInt(_0x2bd984(0xad))/0x5*(-parseInt(_0x2bd984(0xbd))/0x6)+parseInt(_0x2bd984(0xaa))/0x7+parseInt(_0x2bd984(0xbe))/0x8+-parseInt(_0x2bd984(0xa1))/0x9*(-parseInt(_0x2bd984(0xac))/0xa);if(_0x2cdfa8===_0x2df018)break;else _0x366944['push'](_0x366944['shift']());}catch(_0xdef2bc){_0x366944['push'](_0x366944['shift']());}}}(a39_0x1df8,0x8608c));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a39_0xc56984(0xb4),'type':a39_0xc56984(0xd1),'required':!![],'description':a39_0xc56984(0xa3)},SERVICE_FLAG={'name':a39_0xc56984(0xbc),'type':a39_0xc56984(0xd1),'required':!![],'description':a39_0xc56984(0x8a),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0xc56984(0x97)}};function a39_0x1221(_0x233526,_0x197680){_0x233526=_0x233526-0x89;const _0x1df8e3=a39_0x1df8();let _0x122182=_0x1df8e3[_0x233526];return _0x122182;}function summarizeService(_0xd2ca10){const _0x80d078=a39_0xc56984;return{'serviceCode':_0xd2ca10[_0x80d078(0x94)],'name':_0xd2ca10['normalizedManifest'][_0x80d078(0xbc)][_0x80d078(0xae)],'version':_0xd2ca10[_0x80d078(0xa9)],'importedAt':_0xd2ca10[_0x80d078(0x9c)],'source':_0xd2ca10[_0x80d078(0x9f)],'commandCount':_0xd2ca10['normalizedManifest'][_0x80d078(0xb0)]['length'],'commands':_0xd2ca10[_0x80d078(0xa7)][_0x80d078(0xb0)][_0x80d078(0xb8)](_0x1cbf95=>({'path':_0x1cbf95[_0x80d078(0xd2)],'description':_0x1cbf95['description'],'risk':_0x1cbf95['risk'],'target':toPublicServiceTreeTarget(_0x1cbf95[_0x80d078(0x8d)]),'flags':_0x1cbf95[_0x80d078(0xab)][_0x80d078(0xb8)](_0x29954f=>({'name':_0x29954f[_0x80d078(0xae)],'cliName':_0x29954f['cliName'],'type':_0x29954f[_0x80d078(0xc1)],'required':_0x29954f[_0x80d078(0xc5)]===!![]}))}))};}function summarizeLoadedManifest(_0x18bb7e){const _0x144dc2=a39_0xc56984;return{'service':_0x18bb7e[_0x144dc2(0xa7)]?.[_0x144dc2(0xbc)],'version':_0x18bb7e['normalizedManifest']?.[_0x144dc2(0xa9)],'commandCount':_0x18bb7e['normalizedManifest']?.[_0x144dc2(0xb0)][_0x144dc2(0xb6)]??0x0,'commands':_0x18bb7e[_0x144dc2(0xa7)]?.[_0x144dc2(0xb0)]['map'](_0x47f0f6=>({'path':_0x47f0f6[_0x144dc2(0xd2)],'risk':_0x47f0f6[_0x144dc2(0x91)],'target':toPublicServiceTreeTarget(_0x47f0f6[_0x144dc2(0x8d)])}))??[],'registryIndex':_0x18bb7e[_0x144dc2(0xb3)],'registryServiceCode':_0x18bb7e[_0x144dc2(0xbf)],'errors':_0x18bb7e[_0x144dc2(0xcc)][_0x144dc2(0x98)],'warnings':_0x18bb7e[_0x144dc2(0xcc)][_0x144dc2(0xb5)]};}export const serviceDefinitions=[{'service':'service','command':a39_0xc56984(0xc6),'description':a39_0xc56984(0xaf),'risk':a39_0xc56984(0xc0),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x543ca2){const _0x207beb=a39_0xc56984,_0x33fa86=loadServiceManifestFromFile(_0x543ca2['str'](_0x207beb(0xb4)));if(!_0x33fa86['report']['ok'])return{'ok':![],'data':{'file':_0x33fa86[_0x207beb(0xcb)],'hash':_0x33fa86[_0x207beb(0x90)],'kind':_0x33fa86[_0x207beb(0xa2)],'serviceCount':_0x33fa86[_0x207beb(0x9a)][_0x207beb(0xb6)],'services':_0x33fa86[_0x207beb(0x9a)][_0x207beb(0xb8)](summarizeLoadedManifest),'errors':_0x33fa86[_0x207beb(0xcc)][_0x207beb(0x98)],'warnings':_0x33fa86[_0x207beb(0xcc)][_0x207beb(0xb5)]},'message':formatValidationFailure(_0x33fa86['report'])};if(_0x33fa86[_0x207beb(0xa2)]===_0x207beb(0x95)||_0x33fa86[_0x207beb(0x9a)][_0x207beb(0xb6)]!==0x1)return{'ok':!![],'data':{'file':_0x33fa86[_0x207beb(0xcb)],'hash':_0x33fa86[_0x207beb(0x90)],'kind':_0x33fa86['kind'],'serviceCount':_0x33fa86[_0x207beb(0x9a)][_0x207beb(0xb6)],'commandCount':_0x33fa86[_0x207beb(0x9a)][_0x207beb(0xcd)]((_0x11ff21,_0x20697a)=>_0x11ff21+(_0x20697a['normalizedManifest']?.[_0x207beb(0xb0)]['length']??0x0),0x0),'services':_0x33fa86[_0x207beb(0x9a)][_0x207beb(0xb8)](summarizeLoadedManifest),'warnings':_0x33fa86[_0x207beb(0xcc)][_0x207beb(0xb5)]},'message':_0x207beb(0x89)};return{'ok':!![],'data':{'file':_0x33fa86['filePath'],'hash':_0x33fa86[_0x207beb(0x90)],'kind':_0x33fa86[_0x207beb(0xa2)],'service':_0x33fa86[_0x207beb(0xa7)]?.[_0x207beb(0xbc)],'version':_0x33fa86[_0x207beb(0xa7)]?.[_0x207beb(0xa9)],'commandCount':_0x33fa86[_0x207beb(0xa7)]?.[_0x207beb(0xb0)][_0x207beb(0xb6)]??0x0,'commands':_0x33fa86[_0x207beb(0xa7)]?.[_0x207beb(0xb0)][_0x207beb(0xb8)](_0x19ad7c=>({'path':_0x19ad7c['cliPath'],'risk':_0x19ad7c[_0x207beb(0x91)],'target':toPublicServiceTreeTarget(_0x19ad7c[_0x207beb(0x8d)])})),'warnings':_0x33fa86[_0x207beb(0xcc)][_0x207beb(0xb5)]},'message':_0x207beb(0x9b)};}},{'service':a39_0xc56984(0xbc),'command':a39_0xc56984(0xc8),'description':a39_0xc56984(0xc7),'risk':a39_0xc56984(0x8b),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x4490d5){const _0x4e7384=a39_0xc56984,_0x2e16b4=loadServiceManifestFromFile(_0x4490d5[_0x4e7384(0x96)](_0x4e7384(0xb4)));return{'method':_0x4e7384(0xb2),'url':getServiceRegistryPath(),'body':{'file':_0x2e16b4[_0x4e7384(0xcb)],'hash':_0x2e16b4[_0x4e7384(0x90)],'kind':_0x2e16b4[_0x4e7384(0xa2)],'ok':_0x2e16b4[_0x4e7384(0xcc)]['ok'],'service':_0x2e16b4['normalizedManifest']?.[_0x4e7384(0xbc)],'version':_0x2e16b4[_0x4e7384(0xa7)]?.[_0x4e7384(0xa9)],'serviceCount':_0x2e16b4['manifests'][_0x4e7384(0xb6)],'services':_0x2e16b4[_0x4e7384(0x9a)][_0x4e7384(0xb8)](_0x5d7f0c=>({'service':_0x5d7f0c['normalizedManifest']?.[_0x4e7384(0xbc)],'version':_0x5d7f0c[_0x4e7384(0xa7)]?.[_0x4e7384(0xa9)],'commandCount':_0x5d7f0c[_0x4e7384(0xa7)]?.[_0x4e7384(0xb0)][_0x4e7384(0xb6)]??0x0,'errors':_0x5d7f0c[_0x4e7384(0xcc)][_0x4e7384(0x98)]})),'errors':_0x2e16b4[_0x4e7384(0xcc)][_0x4e7384(0x98)],'commandCount':_0x2e16b4[_0x4e7384(0xa7)]?.[_0x4e7384(0xb0)][_0x4e7384(0xb6)]??0x0},'description':_0x4e7384(0x8f)};},async 'execute'(_0x224954){const _0x4bb52a=a39_0xc56984,_0x43a894=importServiceManifest(_0x224954[_0x4bb52a(0x96)](_0x4bb52a(0xb4)));if(_0x43a894[_0x4bb52a(0x9e)][_0x4bb52a(0xb6)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x43a894[_0x4bb52a(0xba)],'imported':_0x43a894[_0x4bb52a(0xce)],'updated':_0x43a894[_0x4bb52a(0xc9)],'serviceCount':_0x43a894[_0x4bb52a(0xa4)],'services':_0x43a894['entries']['map'](summarizeService)},'message':_0x4bb52a(0xc2)+_0x43a894[_0x4bb52a(0xce)]+_0x4bb52a(0xc3)+_0x43a894['updated']+_0x4bb52a(0xa0)};return{'ok':!![],'data':{'registryPath':_0x43a894[_0x4bb52a(0xba)],'replaced':_0x43a894[_0x4bb52a(0xa5)],'imported':_0x43a894['imported'],'updated':_0x43a894['updated'],'serviceCount':_0x43a894[_0x4bb52a(0xa4)],'service':summarizeService(_0x43a894[_0x4bb52a(0xbb)])},'message':(_0x43a894[_0x4bb52a(0xa5)]?_0x4bb52a(0x8c):_0x4bb52a(0xa8))+_0x4bb52a(0xd0)+_0x43a894[_0x4bb52a(0xbb)][_0x4bb52a(0x94)]+'.'};}},{'service':a39_0xc56984(0xbc),'command':a39_0xc56984(0xc4),'description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a39_0xc56984(0x8b),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x16efe8){const _0x4ee835=a39_0xc56984,_0x17248b=getLocalServiceEntry(_0x16efe8[_0x4ee835(0x96)](_0x4ee835(0xbc)));return{'method':_0x4ee835(0xb2),'url':_0x16efe8[_0x4ee835(0x96)]('file'),'body':{'service':_0x16efe8[_0x4ee835(0x96)](_0x4ee835(0xbc)),'found':Boolean(_0x17248b),'version':_0x17248b?.['version'],'source':_0x17248b?.['source']},'description':_0x4ee835(0xa6)};},async 'execute'(_0x937daf){const _0x3556e6=a39_0xc56984,_0x337038=exportServiceManifest(_0x937daf[_0x3556e6(0x96)](_0x3556e6(0xbc)),_0x937daf['str'](_0x3556e6(0xb4)));return{'ok':!![],'data':{'registryPath':_0x337038[_0x3556e6(0xba)],'file':_0x337038[_0x3556e6(0xcb)],'service':summarizeService(_0x337038[_0x3556e6(0xbb)])},'message':_0x3556e6(0x99)+_0x337038['entry']['serviceCode']+'.'};}},{'service':a39_0xc56984(0xbc),'command':'list','description':a39_0xc56984(0x93),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x81fb06=a39_0xc56984,_0x37c74e=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x37c74e[_0x81fb06(0xb6)],'services':_0x37c74e['map'](summarizeService)}};}},{'service':a39_0xc56984(0xbc),'command':a39_0xc56984(0x8e),'description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0xc56984(0x8b),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0xa4b1a1){const _0x2d5e09=a39_0xc56984,_0x2d901a=getLocalServiceEntry(_0xa4b1a1[_0x2d5e09(0x96)]('service'));return{'method':_0x2d5e09(0xb2),'url':getServiceRegistryPath(),'body':{'service':_0xa4b1a1[_0x2d5e09(0x96)](_0x2d5e09(0xbc)),'found':Boolean(_0x2d901a),'version':_0x2d901a?.['version'],'source':_0x2d901a?.[_0x2d5e09(0x9f)]},'description':_0x2d5e09(0xcf)};},async 'execute'(_0x469de8){const _0x5980ba=a39_0xc56984,_0x281b86=removeServiceManifest(_0x469de8[_0x5980ba(0x96)]('service'));return{'ok':!![],'data':{'registryPath':_0x281b86['registryPath'],'serviceCount':_0x281b86[_0x5980ba(0xa4)],'service':summarizeService(_0x281b86[_0x5980ba(0xbb)])},'message':'Removed\x20service\x20'+_0x281b86[_0x5980ba(0xbb)]['serviceCode']+'.'};}},{'service':'service','command':'detail','description':a39_0xc56984(0xb1),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x3e33fa){const _0x4cc67d=a39_0xc56984,_0x5e144c=getLocalServiceEntry(_0x3e33fa[_0x4cc67d(0x96)](_0x4cc67d(0xbc)));if(!_0x5e144c)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x3e33fa[_0x4cc67d(0x96)](_0x4cc67d(0xbc))},'message':'Local\x20service\x20not\x20found:\x20'+_0x3e33fa[_0x4cc67d(0x96)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x5e144c),'manifest':_0x5e144c[_0x4cc67d(0xb9)],'normalizedManifest':toPublicNormalizedServiceTree(_0x5e144c['normalizedManifest'])}};}}];
1
+ const a40_0x21d7fc=a40_0x34f7;(function(_0xca10da,_0x17cd66){const _0xbf6856=a40_0x34f7,_0x4e3e71=_0xca10da();while(!![]){try{const _0x1b085f=parseInt(_0xbf6856(0xb3))/0x1+parseInt(_0xbf6856(0x91))/0x2*(parseInt(_0xbf6856(0xc8))/0x3)+-parseInt(_0xbf6856(0xbc))/0x4*(-parseInt(_0xbf6856(0xb9))/0x5)+parseInt(_0xbf6856(0x9d))/0x6*(-parseInt(_0xbf6856(0x8c))/0x7)+parseInt(_0xbf6856(0xb7))/0x8*(parseInt(_0xbf6856(0xbf))/0x9)+parseInt(_0xbf6856(0x8b))/0xa*(-parseInt(_0xbf6856(0xa7))/0xb)+parseInt(_0xbf6856(0x99))/0xc*(-parseInt(_0xbf6856(0xa8))/0xd);if(_0x1b085f===_0x17cd66)break;else _0x4e3e71['push'](_0x4e3e71['shift']());}catch(_0x7d203a){_0x4e3e71['push'](_0x4e3e71['shift']());}}}(a40_0x1026,0x227e8));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a40_0x21d7fc(0xac),'type':a40_0x21d7fc(0xa4),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a40_0x21d7fc(0x88),'type':a40_0x21d7fc(0xa4),'required':!![],'description':a40_0x21d7fc(0xa2),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a40_0x21d7fc(0xad)}};function summarizeService(_0x1f9199){const _0x5266f7=a40_0x21d7fc;return{'serviceCode':_0x1f9199[_0x5266f7(0x95)],'name':_0x1f9199[_0x5266f7(0x85)][_0x5266f7(0x88)][_0x5266f7(0xaf)],'version':_0x1f9199[_0x5266f7(0xc2)],'importedAt':_0x1f9199[_0x5266f7(0x8a)],'source':_0x1f9199[_0x5266f7(0x9c)],'commandCount':_0x1f9199[_0x5266f7(0x85)][_0x5266f7(0x87)][_0x5266f7(0x9e)],'commands':_0x1f9199[_0x5266f7(0x85)][_0x5266f7(0x87)][_0x5266f7(0xb4)](_0xc667f9=>({'path':_0xc667f9[_0x5266f7(0x90)],'description':_0xc667f9[_0x5266f7(0xa9)],'risk':_0xc667f9[_0x5266f7(0xc1)],'target':toPublicServiceTreeTarget(_0xc667f9[_0x5266f7(0xc3)]),'flags':_0xc667f9[_0x5266f7(0xa5)]['map'](_0x5ae6e2=>({'name':_0x5ae6e2['name'],'cliName':_0x5ae6e2[_0x5266f7(0xcc)],'type':_0x5ae6e2[_0x5266f7(0xb2)],'required':_0x5ae6e2['required']===!![]}))}))};}function a40_0x34f7(_0x1d9e00,_0x822cbc){_0x1d9e00=_0x1d9e00-0x85;const _0x10260a=a40_0x1026();let _0x34f756=_0x10260a[_0x1d9e00];return _0x34f756;}function summarizeLoadedManifest(_0x488b34){const _0x1194f1=a40_0x21d7fc;return{'service':_0x488b34[_0x1194f1(0x85)]?.[_0x1194f1(0x88)],'version':_0x488b34[_0x1194f1(0x85)]?.[_0x1194f1(0xc2)],'commandCount':_0x488b34[_0x1194f1(0x85)]?.[_0x1194f1(0x87)][_0x1194f1(0x9e)]??0x0,'commands':_0x488b34[_0x1194f1(0x85)]?.[_0x1194f1(0x87)][_0x1194f1(0xb4)](_0x5a6413=>({'path':_0x5a6413[_0x1194f1(0x90)],'risk':_0x5a6413[_0x1194f1(0xc1)],'target':toPublicServiceTreeTarget(_0x5a6413[_0x1194f1(0xc3)])}))??[],'registryIndex':_0x488b34[_0x1194f1(0xc5)],'registryServiceCode':_0x488b34[_0x1194f1(0xca)],'errors':_0x488b34[_0x1194f1(0xab)]['errors'],'warnings':_0x488b34[_0x1194f1(0xab)][_0x1194f1(0x89)]};}export const serviceDefinitions=[{'service':'service','command':a40_0x21d7fc(0xcd),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a40_0x21d7fc(0xbe),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x1f459b){const _0x2f562e=a40_0x21d7fc,_0x59afc9=loadServiceManifestFromFile(_0x1f459b['str'](_0x2f562e(0xac)));if(!_0x59afc9[_0x2f562e(0xab)]['ok'])return{'ok':![],'data':{'file':_0x59afc9[_0x2f562e(0xb0)],'hash':_0x59afc9[_0x2f562e(0xc9)],'kind':_0x59afc9['kind'],'serviceCount':_0x59afc9[_0x2f562e(0xa0)]['length'],'services':_0x59afc9[_0x2f562e(0xa0)][_0x2f562e(0xb4)](summarizeLoadedManifest),'errors':_0x59afc9[_0x2f562e(0xab)][_0x2f562e(0x97)],'warnings':_0x59afc9['report'][_0x2f562e(0x89)]},'message':formatValidationFailure(_0x59afc9[_0x2f562e(0xab)])};if(_0x59afc9[_0x2f562e(0xc7)]===_0x2f562e(0x93)||_0x59afc9[_0x2f562e(0xa0)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x59afc9['filePath'],'hash':_0x59afc9[_0x2f562e(0xc9)],'kind':_0x59afc9[_0x2f562e(0xc7)],'serviceCount':_0x59afc9[_0x2f562e(0xa0)][_0x2f562e(0x9e)],'commandCount':_0x59afc9['manifests'][_0x2f562e(0xb6)]((_0x54e7b5,_0x596eb1)=>_0x54e7b5+(_0x596eb1[_0x2f562e(0x85)]?.[_0x2f562e(0x87)][_0x2f562e(0x9e)]??0x0),0x0),'services':_0x59afc9[_0x2f562e(0xa0)]['map'](summarizeLoadedManifest),'warnings':_0x59afc9[_0x2f562e(0xab)][_0x2f562e(0x89)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x59afc9[_0x2f562e(0xb0)],'hash':_0x59afc9[_0x2f562e(0xc9)],'kind':_0x59afc9[_0x2f562e(0xc7)],'service':_0x59afc9['normalizedManifest']?.[_0x2f562e(0x88)],'version':_0x59afc9[_0x2f562e(0x85)]?.[_0x2f562e(0xc2)],'commandCount':_0x59afc9[_0x2f562e(0x85)]?.[_0x2f562e(0x87)][_0x2f562e(0x9e)]??0x0,'commands':_0x59afc9['normalizedManifest']?.[_0x2f562e(0x87)][_0x2f562e(0xb4)](_0x28cb0e=>({'path':_0x28cb0e[_0x2f562e(0x90)],'risk':_0x28cb0e['risk'],'target':toPublicServiceTreeTarget(_0x28cb0e[_0x2f562e(0xc3)])})),'warnings':_0x59afc9['report']['warnings']},'message':_0x2f562e(0xaa)};}},{'service':'service','command':a40_0x21d7fc(0xa1),'description':a40_0x21d7fc(0x9b),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x68f52e){const _0x5c6f92=a40_0x21d7fc,_0x54578c=loadServiceManifestFromFile(_0x68f52e[_0x5c6f92(0xb1)](_0x5c6f92(0xac)));return{'method':_0x5c6f92(0xce),'url':getServiceRegistryPath(),'body':{'file':_0x54578c[_0x5c6f92(0xb0)],'hash':_0x54578c[_0x5c6f92(0xc9)],'kind':_0x54578c['kind'],'ok':_0x54578c[_0x5c6f92(0xab)]['ok'],'service':_0x54578c[_0x5c6f92(0x85)]?.['service'],'version':_0x54578c['normalizedManifest']?.[_0x5c6f92(0xc2)],'serviceCount':_0x54578c[_0x5c6f92(0xa0)][_0x5c6f92(0x9e)],'services':_0x54578c[_0x5c6f92(0xa0)][_0x5c6f92(0xb4)](_0x35c0cd=>({'service':_0x35c0cd[_0x5c6f92(0x85)]?.[_0x5c6f92(0x88)],'version':_0x35c0cd[_0x5c6f92(0x85)]?.[_0x5c6f92(0xc2)],'commandCount':_0x35c0cd[_0x5c6f92(0x85)]?.['commands'][_0x5c6f92(0x9e)]??0x0,'errors':_0x35c0cd[_0x5c6f92(0xab)]['errors']})),'errors':_0x54578c[_0x5c6f92(0xab)][_0x5c6f92(0x97)],'commandCount':_0x54578c['normalizedManifest']?.[_0x5c6f92(0x87)]['length']??0x0},'description':_0x5c6f92(0x92)};},async 'execute'(_0x44f359){const _0x5dd9d2=a40_0x21d7fc,_0x39ad98=importServiceManifest(_0x44f359[_0x5dd9d2(0xb1)](_0x5dd9d2(0xac)));if(_0x39ad98['entries']['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x39ad98[_0x5dd9d2(0x98)],'imported':_0x39ad98[_0x5dd9d2(0xb5)],'updated':_0x39ad98[_0x5dd9d2(0xc6)],'serviceCount':_0x39ad98[_0x5dd9d2(0x9a)],'services':_0x39ad98['entries']['map'](summarizeService)},'message':_0x5dd9d2(0xb8)+_0x39ad98['imported']+'\x20service(s),\x20updated\x20'+_0x39ad98['updated']+_0x5dd9d2(0xc0)};return{'ok':!![],'data':{'registryPath':_0x39ad98[_0x5dd9d2(0x98)],'replaced':_0x39ad98[_0x5dd9d2(0x8f)],'imported':_0x39ad98[_0x5dd9d2(0xb5)],'updated':_0x39ad98[_0x5dd9d2(0xc6)],'serviceCount':_0x39ad98[_0x5dd9d2(0x9a)],'service':summarizeService(_0x39ad98['entry'])},'message':(_0x39ad98[_0x5dd9d2(0x8f)]?_0x5dd9d2(0xcb):_0x5dd9d2(0x8e))+_0x5dd9d2(0x9f)+_0x39ad98[_0x5dd9d2(0xc4)][_0x5dd9d2(0x95)]+'.'};}},{'service':a40_0x21d7fc(0x88),'command':'export','description':a40_0x21d7fc(0xba),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x18bc15){const _0x1a02a1=a40_0x21d7fc,_0x5617f8=getLocalServiceEntry(_0x18bc15[_0x1a02a1(0xb1)]('service'));return{'method':'WRITE','url':_0x18bc15['str'](_0x1a02a1(0xac)),'body':{'service':_0x18bc15[_0x1a02a1(0xb1)](_0x1a02a1(0x88)),'found':Boolean(_0x5617f8),'version':_0x5617f8?.[_0x1a02a1(0xc2)],'source':_0x5617f8?.[_0x1a02a1(0x9c)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x2a0419){const _0x4b4cb9=a40_0x21d7fc,_0x1c8a6c=exportServiceManifest(_0x2a0419[_0x4b4cb9(0xb1)](_0x4b4cb9(0x88)),_0x2a0419[_0x4b4cb9(0xb1)](_0x4b4cb9(0xac)));return{'ok':!![],'data':{'registryPath':_0x1c8a6c[_0x4b4cb9(0x98)],'file':_0x1c8a6c[_0x4b4cb9(0xb0)],'service':summarizeService(_0x1c8a6c['entry'])},'message':'Exported\x20service\x20'+_0x1c8a6c[_0x4b4cb9(0xc4)][_0x4b4cb9(0x95)]+'.'};}},{'service':a40_0x21d7fc(0x88),'command':'list','description':a40_0x21d7fc(0xbd),'risk':a40_0x21d7fc(0xbe),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x2599f4=a40_0x21d7fc,_0x56e829=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x56e829[_0x2599f4(0x9e)],'services':_0x56e829['map'](summarizeService)}};}},{'service':a40_0x21d7fc(0x88),'command':a40_0x21d7fc(0xae),'description':a40_0x21d7fc(0x96),'risk':a40_0x21d7fc(0x94),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0xe6983f){const _0x30fdd7=a40_0x21d7fc,_0x4db4ad=getLocalServiceEntry(_0xe6983f[_0x30fdd7(0xb1)](_0x30fdd7(0x88)));return{'method':_0x30fdd7(0xce),'url':getServiceRegistryPath(),'body':{'service':_0xe6983f[_0x30fdd7(0xb1)]('service'),'found':Boolean(_0x4db4ad),'version':_0x4db4ad?.[_0x30fdd7(0xc2)],'source':_0x4db4ad?.[_0x30fdd7(0x9c)]},'description':_0x30fdd7(0xa6)};},async 'execute'(_0x5c79d2){const _0x370993=a40_0x21d7fc,_0x17fad3=removeServiceManifest(_0x5c79d2['str'](_0x370993(0x88)));return{'ok':!![],'data':{'registryPath':_0x17fad3[_0x370993(0x98)],'serviceCount':_0x17fad3[_0x370993(0x9a)],'service':summarizeService(_0x17fad3[_0x370993(0xc4)])},'message':_0x370993(0x8d)+_0x17fad3['entry'][_0x370993(0x95)]+'.'};}},{'service':a40_0x21d7fc(0x88),'command':'detail','description':a40_0x21d7fc(0xbb),'risk':a40_0x21d7fc(0xbe),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x391f4b){const _0x142ab7=a40_0x21d7fc,_0x17815e=getLocalServiceEntry(_0x391f4b['str'](_0x142ab7(0x88)));if(!_0x17815e)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x391f4b['str'](_0x142ab7(0x88))},'message':_0x142ab7(0xa3)+_0x391f4b['str']('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x17815e),'manifest':_0x17815e[_0x142ab7(0x86)],'normalizedManifest':toPublicNormalizedServiceTree(_0x17815e[_0x142ab7(0x85)])}};}}];function a40_0x1026(){const _0x3957c0=['name','filePath','str','type','235058aKSyFX','map','imported','reduce','252544nDUwaa','Imported\x20','45qvXbqB','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','36164IJriPu','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','read','63fVRtLQ','\x20service(s).','risk','version','target','entry','registryIndex','updated','kind','183ninPzG','hash','registryServiceCode','Updated','cliName','validate','WRITE','normalizedManifest','manifest','commands','service','warnings','importedAt','130rKtoBx','992453JNZVOe','Removed\x20service\x20','Imported','replaced','cliPath','5030uToyWZ','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','registry','write','serviceCode','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','errors','registryPath','472776zxbpOx','serviceCount','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','source','6sVoPZT','length','\x20service\x20','manifests','import','Local\x20service\x20code,\x20for\x20example\x20crm','Local\x20service\x20not\x20found:\x20','string','flags','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','211673hBzhPy','52ogOGCS','description','Service\x20manifest\x20validation\x20passed.','report','file','lower\x20kebab-case\x20service\x20code','remove'];a40_0x1026=function(){return _0x3957c0;};return a40_0x1026();}