@lovrabet/lovrabet-cli 2.1.9 → 2.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/lib/cli.js +1 -1
  2. package/lib/commands/api-doc/index.js +1 -1
  3. package/lib/commands/app/cache.js +1 -1
  4. package/lib/commands/app/definitions.js +1 -1
  5. package/lib/commands/app/eligibility.js +1 -1
  6. package/lib/commands/app/mock-loader.js +1 -1
  7. package/lib/commands/app/remote-source.js +1 -1
  8. package/lib/commands/app/shared.js +1 -1
  9. package/lib/commands/app-config/get.js +1 -1
  10. package/lib/commands/app-config/index.js +1 -1
  11. package/lib/commands/app-config/shared.js +1 -1
  12. package/lib/commands/artifact/index.js +1 -1
  13. package/lib/commands/auth/index.js +1 -1
  14. package/lib/commands/auth/prompt.js +1 -1
  15. package/lib/commands/bff/detail.js +1 -1
  16. package/lib/commands/bff/exec.js +1 -1
  17. package/lib/commands/bff/index.js +1 -1
  18. package/lib/commands/cli-skill/index.js +1 -1
  19. package/lib/commands/common/config-policy.js +1 -1
  20. package/lib/commands/common/constraints.js +1 -1
  21. package/lib/commands/common/flags.js +1 -1
  22. package/lib/commands/common/local-file.js +1 -1
  23. package/lib/commands/config/definitions.js +1 -1
  24. package/lib/commands/config/shared.js +1 -1
  25. package/lib/commands/data/index.js +1 -1
  26. package/lib/commands/dataset/detail.js +1 -1
  27. package/lib/commands/dataset/index.js +1 -1
  28. package/lib/commands/dataset/list.js +1 -1
  29. package/lib/commands/dataset/sdk-doc.js +1 -1
  30. package/lib/commands/doctor.js +1 -1
  31. package/lib/commands/file/index.js +1 -1
  32. package/lib/commands/init.js +1 -1
  33. package/lib/commands/kb/index.js +1 -1
  34. package/lib/commands/logs/index.js +1 -1
  35. package/lib/commands/ocr/index.js +1 -1
  36. package/lib/commands/personal-bff/index.js +1 -1
  37. package/lib/commands/registry.js +1 -1
  38. package/lib/commands/schema.js +1 -1
  39. package/lib/commands/service/dynamic.js +1 -1
  40. package/lib/commands/service/index.js +1 -1
  41. package/lib/commands/service/registry.js +1 -1
  42. package/lib/commands/skill/commands/create.js +1 -1
  43. package/lib/commands/skill/commands/install.js +1 -1
  44. package/lib/commands/skill/commands/list.js +1 -1
  45. package/lib/commands/skill/commands/push.js +1 -1
  46. package/lib/commands/skill/commands/validate.js +1 -1
  47. package/lib/commands/skill/flags.js +1 -1
  48. package/lib/commands/skill/index.js +1 -1
  49. package/lib/commands/skill/manifest-helpers.js +1 -1
  50. package/lib/commands/skill/push-execute.js +1 -1
  51. package/lib/commands/skill/push-flow-helpers.js +1 -1
  52. package/lib/commands/skill/push-retarget.js +1 -1
  53. package/lib/commands/skill/scopes.js +1 -1
  54. package/lib/commands/skill/summary.js +1 -1
  55. package/lib/commands/skill/templates.js +1 -1
  56. package/lib/commands/skill/validate.js +1 -1
  57. package/lib/commands/sql/detail.js +1 -1
  58. package/lib/commands/sql/exec.js +1 -1
  59. package/lib/commands/sql/index.js +1 -1
  60. package/lib/commands/update.js +1 -1
  61. package/lib/commands/workspace/index.js +1 -1
  62. package/lib/config/schema.js +1 -1
  63. package/lib/constant/app.js +1 -1
  64. package/lib/constant/auth-mode.js +1 -1
  65. package/lib/constant/cli.js +1 -1
  66. package/lib/constant/defaults.js +1 -1
  67. package/lib/constant/distribution.js +1 -1
  68. package/lib/constant/domain.js +1 -1
  69. package/lib/constant/env.js +1 -1
  70. package/lib/constant/output.js +1 -1
  71. package/lib/constant/product.js +1 -1
  72. package/lib/constant/risk.js +1 -1
  73. package/lib/constant/url.js +1 -1
  74. package/lib/context.js +1 -1
  75. package/lib/core/api-client.js +1 -1
  76. package/lib/core/db-resolver.js +1 -1
  77. package/lib/core/sdk-client.js +1 -1
  78. package/lib/errors.js +1 -1
  79. package/lib/framework/build-all-flags.js +1 -1
  80. package/lib/framework/dryrun.js +1 -1
  81. package/lib/framework/flags.js +1 -1
  82. package/lib/framework/help.js +1 -1
  83. package/lib/framework/index.js +1 -1
  84. package/lib/framework/output.js +1 -1
  85. package/lib/framework/preparse.js +1 -1
  86. package/lib/framework/response.js +1 -1
  87. package/lib/framework/runner-confirmation.js +1 -1
  88. package/lib/framework/runner-error.js +1 -1
  89. package/lib/framework/runner.js +1 -1
  90. package/lib/framework/schema-export.js +1 -1
  91. package/lib/framework/service-order.js +1 -1
  92. package/lib/framework/types.js +1 -1
  93. package/lib/generated/build-info.js +1 -1
  94. package/lib/help.js +1 -1
  95. package/lib/skills/npx-skills-add.js +1 -1
  96. package/lib/skills/runtime-skill-sync/constants.js +1 -1
  97. package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
  98. package/lib/skills/runtime-skill-sync/hashing.js +1 -1
  99. package/lib/skills/runtime-skill-sync/links.js +1 -1
  100. package/lib/skills/runtime-skill-sync/list-local.js +1 -1
  101. package/lib/skills/runtime-skill-sync/local-files.js +1 -1
  102. package/lib/skills/runtime-skill-sync/materialize.js +1 -1
  103. package/lib/skills/runtime-skill-sync/metadata.js +1 -1
  104. package/lib/skills/runtime-skill-sync/paths.js +1 -1
  105. package/lib/skills/runtime-skill-sync/push.js +1 -1
  106. package/lib/skills/runtime-skill-sync/scopes.js +1 -1
  107. package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
  108. package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
  109. package/lib/skills/runtime-skill-sync.js +1 -1
  110. package/lib/utils/apply-jq-filter.js +1 -1
  111. package/lib/utils/logger.js +1 -1
  112. package/lib/utils/params.js +1 -1
  113. package/lib/utils/platform.js +1 -1
  114. package/lib/utils/update-notice.js +1 -1
  115. package/lib/utils/version.js +1 -1
  116. package/lib/utils/write-cli-side-channel.js +1 -1
  117. package/package.json +1 -1
@@ -1 +1 @@
1
- const a31_0x480359=a31_0xf9fb;(function(_0x144a05,_0x4e4d5b){const _0x1ee5b1=a31_0xf9fb,_0x30cf2c=_0x144a05();while(!![]){try{const _0x5b2547=parseInt(_0x1ee5b1(0x81))/0x1+-parseInt(_0x1ee5b1(0x84))/0x2+parseInt(_0x1ee5b1(0x97))/0x3+parseInt(_0x1ee5b1(0xa2))/0x4+-parseInt(_0x1ee5b1(0xa9))/0x5*(-parseInt(_0x1ee5b1(0xa1))/0x6)+parseInt(_0x1ee5b1(0xa7))/0x7+-parseInt(_0x1ee5b1(0xbb))/0x8;if(_0x5b2547===_0x4e4d5b)break;else _0x30cf2c['push'](_0x30cf2c['shift']());}catch(_0x2aabc6){_0x30cf2c['push'](_0x30cf2c['shift']());}}}(a31_0x3ca3,0x31a14));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x480359(0x85),'type':a31_0x480359(0x92),'description':a31_0x480359(0xb3)},{'name':a31_0x480359(0x7c),'type':a31_0x480359(0x92),'description':a31_0x480359(0x90)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x480359(0xb2),'description':a31_0x480359(0x7e)+PRODUCT_CONFIG[a31_0x480359(0x88)]+a31_0x480359(0xa4),'default':![]},{'name':'yes','type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a31_0x480359(0x7d),'type':'string','description':a31_0x480359(0x8a),'required':!![]},{'name':a31_0x480359(0x85),'type':a31_0x480359(0x92),'description':a31_0x480359(0x7b)},{'name':'env','type':a31_0x480359(0x92),'description':a31_0x480359(0x93),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x480359(0x95),'type':a31_0x480359(0xb2),'description':a31_0x480359(0x7e)+PRODUCT_CONFIG[a31_0x480359(0x88)]+a31_0x480359(0xa4),'default':![]},{'name':'yes','type':a31_0x480359(0xb2),'description':a31_0x480359(0x86),'default':![]}];export async function runInit(_0x17e9e2){const _0x15c8a6=a31_0x480359,_0xd968e9=isNonInteractiveMode(_0x17e9e2),_0x29afa1=_0x17e9e2[_0x15c8a6(0x95)]?_0x15c8a6(0x95):'project',_0x11a525=resolveWriteConfigPath(_0x29afa1);try{_0xd968e9?await runNonInteractive(_0x17e9e2,_0x11a525):await runInteractive(_0x17e9e2,_0x11a525);}catch(_0x3aa32f){if(_0x3aa32f instanceof AbortPrompt)throw CliErrors[_0x15c8a6(0xa3)]();throw _0x3aa32f;}}export async function runInitImport(_0x108019){const _0x11f0a6=a31_0x480359,_0x2d92e6=_0x108019['global']?_0x11f0a6(0x95):'project',_0x3672ff=resolveWriteConfigPath(_0x2d92e6);await runFromImport(_0x108019,_0x3672ff);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x4f9ce1,_0x1e9938){const _0x441c32=a31_0x480359,_0x5cf5cc=resolveFilePath(_0x4f9ce1[_0x441c32(0x7d)]);if(!existsSync(_0x5cf5cc))throw CliErrors[_0x441c32(0xb5)](_0x441c32(0x94)+_0x5cf5cc);const _0x55c21c=readSourceFile(_0x5cf5cc),_0x56ef41=convertToRuntimeConfig(_0x55c21c);_0x4f9ce1[_0x441c32(0x85)]&&(_0x56ef41[_0x441c32(0x85)]=String(_0x4f9ce1[_0x441c32(0x85)]));_0x4f9ce1['env']&&(_0x56ef41[_0x441c32(0x7c)]=resolveInitEnv(_0x4f9ce1));if(!_0x56ef41[_0x441c32(0x85)])throw CliErrors[_0x441c32(0xb5)](_0x441c32(0x8d),'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(_0x1e9938,_0x56ef41,_0x4f9ce1),console[_0x441c32(0x89)]('Imported\x20from\x20'+_0x5cf5cc),console[_0x441c32(0x89)](_0x441c32(0x8b)+_0x1e9938),console[_0x441c32(0x89)](_0x441c32(0xb0)+_0x56ef41[_0x441c32(0x85)]);if(_0x56ef41[_0x441c32(0x98)])console[_0x441c32(0x89)]('\x20\x20default:\x20'+_0x56ef41['defaultApp']);}function convertToRuntimeConfig(_0x544408){const _0x55f969=a31_0x480359;if(_0x544408[_0x55f969(0x7f)]&&typeof _0x544408[_0x55f969(0x7f)]===_0x55f969(0xa0))throw CliErrors[_0x55f969(0xb5)](_0x55f969(0xaa),_0x55f969(0x99));const _0x1501d8={};for(const _0x33a59b of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x544408[_0x33a59b]!==undefined&&(_0x1501d8[_0x33a59b]=_0x544408[_0x33a59b]);}return!_0x1501d8[_0x55f969(0xa6)]&&(_0x1501d8[_0x55f969(0xa6)]=DEFAULT_CONFIG_VALUES[_0x55f969(0xa6)]),_0x1501d8;}async function runNonInteractive(_0x3dfd9d,_0x4b23bc){const _0x1efaa8=a31_0x480359,_0x49ddc0=_0x3dfd9d[_0x1efaa8(0x85)];if(!_0x49ddc0)throw CliErrors[_0x1efaa8(0x96)](_0x1efaa8(0x85),_0x1efaa8(0xac)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x56caea=resolveInitEnv(_0x3dfd9d);await writeInitConfig(_0x4b23bc,{'appcode':_0x49ddc0,'env':_0x56caea},_0x3dfd9d),console[_0x1efaa8(0x89)]('Initialized\x20'+_0x4b23bc),console[_0x1efaa8(0x89)](_0x1efaa8(0xb0)+_0x49ddc0),console[_0x1efaa8(0x89)](_0x1efaa8(0xb4)+_0x56caea);}async function runInteractive(_0x27606e,_0x25a1b6){const _0x49a59f=a31_0x480359,_0x43805f=loadExisting(_0x25a1b6),_0x1ef4c9=typeof _0x43805f?.[_0x49a59f(0x85)]==='string'?_0x43805f[_0x49a59f(0x85)]:'',_0x89669a=resolveInitEnv(_0x27606e);console[_0x49a59f(0x89)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x49a59f(0x88)]+'\x0a');if(existsSync(_0x25a1b6)&&!_0x27606e[_0x49a59f(0xa8)]){const _0x4ace6d=await promptYesNo('File\x20'+_0x25a1b6+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x4ace6d){console[_0x49a59f(0x89)](_0x49a59f(0x91));return;}}const _0xf80f80=typeof _0x27606e['appcode']===_0x49a59f(0x92)?_0x27606e[_0x49a59f(0x85)][_0x49a59f(0xab)]():'';let _0x3d552c=_0xf80f80;!_0x3d552c&&(_0x3d552c=await promptInput(_0x49a59f(0xb7),_0x1ef4c9));if(!_0x3d552c[_0x49a59f(0xab)]())throw CliErrors[_0x49a59f(0xb5)](_0x49a59f(0x9f));await writeInitConfig(_0x25a1b6,{'appcode':_0x3d552c[_0x49a59f(0xab)](),'env':_0x89669a},_0x27606e),console[_0x49a59f(0x89)]('\x0aInitialized\x20'+_0x25a1b6),console[_0x49a59f(0x89)](_0x49a59f(0xb0)+_0x3d552c['trim']()),console['log'](_0x49a59f(0xb4)+_0x89669a);}function a31_0xf9fb(_0x5840bb,_0x1d4698){_0x5840bb=_0x5840bb-0x7b;const _0x3ca33b=a31_0x3ca3();let _0xf9fb24=_0x3ca33b[_0x5840bb];return _0xf9fb24;}async function writeInitConfig(_0x2b0013,_0x82aad9,_0x2d8a0e){const _0x32eb81=a31_0x480359;let _0x53cbef={};existsSync(_0x2b0013)&&!_0x2d8a0e['yes']&&(_0x53cbef=readConfigFile(_0x2b0013));for(const [_0x2b5364,_0x2d6489]of Object[_0x32eb81(0x8c)](_0x82aad9)){_0x2d6489!==undefined&&(_0x53cbef[_0x2b5364]=_0x2d6489);}if(_0x53cbef[_0x32eb81(0xb8)])delete _0x53cbef[_0x32eb81(0xb8)];writeConfigFile(_0x2b0013,_0x53cbef);}class AbortPrompt extends Error{constructor(){const _0x41129e=a31_0x480359;super(_0x41129e(0xba)),this[_0x41129e(0x9d)]=_0x41129e(0x87);}}function createSafeRl(){const _0x5d3d83=a31_0x480359,_0x14ba3d=createInterface({'input':process[_0x5d3d83(0xa5)],'output':process[_0x5d3d83(0x9c)]});let _0x273fb3;const _0x459279=new Promise((_0x589358,_0x11be57)=>{const _0x453991=_0x5d3d83;_0x273fb3=()=>{const _0xf87a67=a31_0xf9fb;_0x273fb3&&(_0x14ba3d['removeListener'](_0xf87a67(0x8f),_0x273fb3),_0x273fb3=undefined);try{_0x14ba3d[_0xf87a67(0x80)]();}catch{}_0x11be57(new AbortPrompt());},_0x14ba3d['once'](_0x453991(0x8f),_0x273fb3);}),_0x1a5f96=()=>{const _0x15e181=_0x5d3d83;_0x273fb3&&(_0x14ba3d[_0x15e181(0xaf)](_0x15e181(0x8f),_0x273fb3),_0x273fb3=undefined);try{_0x14ba3d[_0x15e181(0x80)]();}catch{}};return{'rl':_0x14ba3d,'abortPromise':_0x459279,'disposeSuccess':_0x1a5f96};}async function promptInput(_0x21d654,_0x54741e){const _0x376182=a31_0x480359,{rl:_0x17ccbc,abortPromise:_0xe067fa,disposeSuccess:_0x53877f}=createSafeRl(),_0x43b694=new Promise(_0x2fe8bb=>{const _0x5335e3=a31_0xf9fb,_0x38a8c7=_0x54741e?'\x20\x20'+_0x21d654+'\x20('+_0x54741e+_0x5335e3(0x9e):'\x20\x20'+_0x21d654+':\x20';_0x17ccbc[_0x5335e3(0xb6)](_0x38a8c7,_0xe3ba84=>{const _0x17f17f=_0x5335e3;_0x53877f(),_0x2fe8bb(_0xe3ba84[_0x17f17f(0xab)]()||_0x54741e);});});return Promise[_0x376182(0xb1)]([_0x43b694,_0xe067fa]);}function a31_0x3ca3(){const _0x4fe99d=['9051AbZlyl','toLowerCase','\x22.\x20Allowed:\x20','222914jYLZSZ','appcode','Skip\x20confirmation\x20when\x20overwriting','AbortPrompt','newConfigFileName','log','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x20\x20config:\x20\x20','entries','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Failed\x20to\x20parse\x20source\x20file:\x20','SIGINT','Target\x20environment\x20(default\x20','Aborted.','string','Override\x20imported\x20default\x20env','Source\x20file\x20not\x20found:\x20','global','flagMissing','361701ELIhUp','defaultApp','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','join','Invalid\x20env\x20\x22','stdout','name','):\x20','App\x20code\x20cannot\x20be\x20empty.','object','362934SatbHz','1175816SDzRnk','cancelled',')\x20instead\x20of\x20project','stdin','riskLevel','1252965hCmiNu','yes','15sMbKMd','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','trim','Usage:\x20','message','utf8','removeListener','\x20\x20appcode:\x20','race','boolean','App\x20code\x20for\x20the\x20project','\x20\x20env:\x20\x20\x20\x20\x20','validation','question','App\x20code','app','parse','User\x20aborted\x20prompt','3754344JZlGfs','Override\x20imported\x20default\x20appcode','env','file','Write\x20to\x20global\x20(~/','apps','close'];a31_0x3ca3=function(){return _0x4fe99d;};return a31_0x3ca3();}async function promptYesNo(_0xda798,_0x1a8854){const {rl:_0x29a21b,abortPromise:_0x1482bb,disposeSuccess:_0x596c15}=createSafeRl(),_0x648247=new Promise(_0x4d8860=>{const _0x3d50db=a31_0xf9fb,_0x1d6f40=_0x1a8854?'[Y/n]':'[y/N]';_0x29a21b[_0x3d50db(0xb6)]('\x20\x20'+_0xda798+'\x20'+_0x1d6f40+':\x20',_0x1be2da=>{const _0x5739e5=_0x3d50db;_0x596c15();const _0x59d823=_0x1be2da[_0x5739e5(0xab)]()[_0x5739e5(0x82)]();if(_0x59d823==='y'||_0x59d823===_0x5739e5(0xa8))_0x4d8860(!![]);else{if(_0x59d823==='n'||_0x59d823==='no')_0x4d8860(![]);else _0x4d8860(_0x1a8854);}});});return Promise['race']([_0x648247,_0x1482bb]);}function loadExisting(_0x565632){if(!existsSync(_0x565632))return null;return readConfigFile(_0x565632);}function resolveFilePath(_0x1df72b){return isAbsolute(_0x1df72b)?_0x1df72b:resolve(process['cwd'](),_0x1df72b);}function readSourceFile(_0x41afc6){const _0x40001e=a31_0x480359;try{const _0x4c3c74=readFileSync(_0x41afc6,{'encoding':_0x40001e(0xae)});return JSON[_0x40001e(0xb9)](_0x4c3c74);}catch(_0x15f43d){throw CliErrors[_0x40001e(0xb5)](_0x40001e(0x8e)+_0x15f43d[_0x40001e(0xad)]);}}function resolveInitEnv(_0xda5cbe){const _0x20fa7c=a31_0x480359,_0x2178fd=_0xda5cbe[_0x20fa7c(0x7c)];if(_0x2178fd===undefined||_0x2178fd==='')return DEFAULT_CONFIG_VALUES[_0x20fa7c(0x7c)];if(!RUNTIME_ENV_VALUES['includes'](_0x2178fd))throw CliErrors['validation'](_0x20fa7c(0x9b)+_0x2178fd+_0x20fa7c(0x83)+RUNTIME_ENV_VALUES[_0x20fa7c(0x9a)](',\x20'));return _0x2178fd;}
1
+ const a31_0x465e3c=a31_0x15ce;(function(_0x29688a,_0x208655){const _0x1fca02=a31_0x15ce,_0x14da55=_0x29688a();while(!![]){try{const _0x318ef=parseInt(_0x1fca02(0x107))/0x1+-parseInt(_0x1fca02(0xdc))/0x2*(-parseInt(_0x1fca02(0xdf))/0x3)+parseInt(_0x1fca02(0xfe))/0x4*(parseInt(_0x1fca02(0xd8))/0x5)+-parseInt(_0x1fca02(0xf3))/0x6+parseInt(_0x1fca02(0x105))/0x7+parseInt(_0x1fca02(0xc8))/0x8*(parseInt(_0x1fca02(0x108))/0x9)+-parseInt(_0x1fca02(0xdb))/0xa*(parseInt(_0x1fca02(0xfd))/0xb);if(_0x318ef===_0x208655)break;else _0x14da55['push'](_0x14da55['shift']());}catch(_0x284335){_0x14da55['push'](_0x14da55['shift']());}}}(a31_0x4601,0xb83fc));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';function a31_0x15ce(_0x538e7f,_0x5de2cb){_0x538e7f=_0x538e7f-0xc6;const _0x46018c=a31_0x4601();let _0x15ceab=_0x46018c[_0x538e7f];return _0x15ceab;}import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x465e3c(0xe2),'type':a31_0x465e3c(0xc9),'description':a31_0x465e3c(0xd2)},{'name':a31_0x465e3c(0xfa),'type':a31_0x465e3c(0xc9),'description':a31_0x465e3c(0xda)+DEFAULT_CONFIG_VALUES[a31_0x465e3c(0xfa)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x465e3c(0xd5),'type':a31_0x465e3c(0xec),'description':a31_0x465e3c(0x100)+PRODUCT_CONFIG[a31_0x465e3c(0xea)]+a31_0x465e3c(0xf4),'default':![]},{'name':a31_0x465e3c(0xef),'type':a31_0x465e3c(0xec),'description':a31_0x465e3c(0xf6),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x465e3c(0xed),'type':a31_0x465e3c(0xc9),'description':a31_0x465e3c(0x109),'required':!![]},{'name':a31_0x465e3c(0xe2),'type':a31_0x465e3c(0xc9),'description':a31_0x465e3c(0xee)},{'name':a31_0x465e3c(0xfa),'type':a31_0x465e3c(0xc9),'description':a31_0x465e3c(0xe8),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x465e3c(0xd5),'type':a31_0x465e3c(0xec),'description':a31_0x465e3c(0x100)+PRODUCT_CONFIG[a31_0x465e3c(0xea)]+a31_0x465e3c(0xf4),'default':![]},{'name':a31_0x465e3c(0xef),'type':a31_0x465e3c(0xec),'description':a31_0x465e3c(0xf6),'default':![]}];export async function runInit(_0x580e71){const _0x28ee5d=a31_0x465e3c,_0x466706=isNonInteractiveMode(_0x580e71),_0x12d437=_0x580e71[_0x28ee5d(0xd5)]?_0x28ee5d(0xd5):_0x28ee5d(0xce),_0x1424b1=resolveWriteConfigPath(_0x12d437);try{_0x466706?await runNonInteractive(_0x580e71,_0x1424b1):await runInteractive(_0x580e71,_0x1424b1);}catch(_0x13ca01){if(_0x13ca01 instanceof AbortPrompt)throw CliErrors[_0x28ee5d(0xdd)]();throw _0x13ca01;}}export async function runInitImport(_0x501f16){const _0x3861ae=a31_0x465e3c,_0x53957d=_0x501f16['global']?_0x3861ae(0xd5):_0x3861ae(0xce),_0x4572c2=resolveWriteConfigPath(_0x53957d);await runFromImport(_0x501f16,_0x4572c2);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x465e3c(0xd7)]);async function runFromImport(_0x56a16b,_0x20c0a5){const _0x415562=a31_0x465e3c,_0xcda567=resolveFilePath(_0x56a16b[_0x415562(0xed)]);if(!existsSync(_0xcda567))throw CliErrors['validation'](_0x415562(0xe4)+_0xcda567);const _0x22b278=readSourceFile(_0xcda567),_0x536a0f=convertToRuntimeConfig(_0x22b278);_0x56a16b[_0x415562(0xe2)]&&(_0x536a0f[_0x415562(0xe2)]=String(_0x56a16b[_0x415562(0xe2)]));_0x56a16b[_0x415562(0xfa)]&&(_0x536a0f[_0x415562(0xfa)]=resolveInitEnv(_0x56a16b));if(!_0x536a0f[_0x415562(0xe2)])throw CliErrors[_0x415562(0x103)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x415562(0xc7));await writeInitConfig(_0x20c0a5,_0x536a0f,_0x56a16b),console[_0x415562(0x101)]('Imported\x20from\x20'+_0xcda567),console[_0x415562(0x101)](_0x415562(0xf5)+_0x20c0a5),console[_0x415562(0x101)](_0x415562(0xd9)+_0x536a0f['appcode']);if(_0x536a0f[_0x415562(0xf1)])console[_0x415562(0x101)]('\x20\x20default:\x20'+_0x536a0f[_0x415562(0xf1)]);}function convertToRuntimeConfig(_0x2f3b08){const _0x4c3873=a31_0x465e3c;if(_0x2f3b08[_0x4c3873(0xe3)]&&typeof _0x2f3b08[_0x4c3873(0xe3)]===_0x4c3873(0xcc))throw CliErrors[_0x4c3873(0x103)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x4c3873(0xe0));const _0x37f58e={};for(const _0x510659 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x2f3b08[_0x510659]!==undefined&&(_0x37f58e[_0x510659]=_0x2f3b08[_0x510659]);}return!_0x37f58e['riskLevel']&&(_0x37f58e[_0x4c3873(0x102)]=DEFAULT_CONFIG_VALUES[_0x4c3873(0x102)]),_0x37f58e;}async function runNonInteractive(_0x15d558,_0x3021ef){const _0x3bef3e=a31_0x465e3c,_0x2f393f=_0x15d558[_0x3bef3e(0xe2)];if(!_0x2f393f)throw CliErrors['flagMissing'](_0x3bef3e(0xe2),_0x3bef3e(0xd1)+CLI_BIN_NAME+_0x3bef3e(0xd0));const _0xbd84ec=resolveInitEnv(_0x15d558);await writeInitConfig(_0x3021ef,{'appcode':_0x2f393f,'env':_0xbd84ec},_0x15d558),console['log'](_0x3bef3e(0xcf)+_0x3021ef),console[_0x3bef3e(0x101)]('\x20\x20appcode:\x20'+_0x2f393f),console[_0x3bef3e(0x101)](_0x3bef3e(0x104)+_0xbd84ec);}async function runInteractive(_0x14d0b2,_0x38fa74){const _0x525d8e=a31_0x465e3c,_0x581074=loadExisting(_0x38fa74),_0x292438=typeof _0x581074?.[_0x525d8e(0xe2)]==='string'?_0x581074[_0x525d8e(0xe2)]:'',_0x54ca4d=resolveInitEnv(_0x14d0b2);console[_0x525d8e(0x101)](CLI_BIN_NAME+_0x525d8e(0xe6)+PRODUCT_CONFIG[_0x525d8e(0xea)]+'\x0a');if(existsSync(_0x38fa74)&&!_0x14d0b2[_0x525d8e(0xef)]){const _0x2d38e5=await promptYesNo(_0x525d8e(0xe9)+_0x38fa74+_0x525d8e(0xe1),![]);if(!_0x2d38e5){console[_0x525d8e(0x101)]('Aborted.');return;}}const _0x36d139=typeof _0x14d0b2[_0x525d8e(0xe2)]===_0x525d8e(0xc9)?_0x14d0b2[_0x525d8e(0xe2)]['trim']():'';let _0x70d66a=_0x36d139;!_0x70d66a&&(_0x70d66a=await promptInput(_0x525d8e(0xf7),_0x292438));if(!_0x70d66a['trim']())throw CliErrors['validation'](_0x525d8e(0xd3));await writeInitConfig(_0x38fa74,{'appcode':_0x70d66a['trim'](),'env':_0x54ca4d},_0x14d0b2),console[_0x525d8e(0x101)]('\x0aInitialized\x20'+_0x38fa74),console[_0x525d8e(0x101)]('\x20\x20appcode:\x20'+_0x70d66a[_0x525d8e(0x10a)]()),console[_0x525d8e(0x101)](_0x525d8e(0x104)+_0x54ca4d);}async function writeInitConfig(_0x2c2aa6,_0x28f250,_0x4fb240){const _0x4d9ee6=a31_0x465e3c;let _0x23a28d={};existsSync(_0x2c2aa6)&&!_0x4fb240[_0x4d9ee6(0xef)]&&(_0x23a28d=readConfigFile(_0x2c2aa6));for(const [_0x2ce707,_0x4054b3]of Object[_0x4d9ee6(0x10c)](_0x28f250)){_0x4054b3!==undefined&&(_0x23a28d[_0x2ce707]=_0x4054b3);}if(_0x23a28d[_0x4d9ee6(0xf8)])delete _0x23a28d[_0x4d9ee6(0xf8)];writeConfigFile(_0x2c2aa6,_0x23a28d);}class AbortPrompt extends Error{constructor(){const _0x25f771=a31_0x465e3c;super(_0x25f771(0xde)),this['name']='AbortPrompt';}}function a31_0x4601(){const _0x1d2d87=['string','race','SIGINT','object','includes','project','Initialized\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Usage:\x20','App\x20code\x20for\x20the\x20project','App\x20code\x20cannot\x20be\x20empty.','utf8','global','stdin','apiDir','5yrdIxu','\x20\x20appcode:\x20','Target\x20environment\x20(default\x20','3219470qioxxM','814FGGfNg','cancelled','User\x20aborted\x20prompt','2529iyGeJY','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x20already\x20exists.\x20Overwrite?','appcode','apps','Source\x20file\x20not\x20found:\x20','removeListener','\x20init\x20—\x20Create\x20','parse','Override\x20imported\x20default\x20env','File\x20','newConfigFileName','question','boolean','file','Override\x20imported\x20default\x20appcode','yes','close','defaultApp','toLowerCase','6587496RzQUip',')\x20instead\x20of\x20project','\x20\x20config:\x20\x20','Skip\x20confirmation\x20when\x20overwriting','App\x20code','app','Failed\x20to\x20parse\x20source\x20file:\x20','env','[Y/n]','message','88imnHqa','4872844aUvgAa','cwd','Write\x20to\x20global\x20(~/','log','riskLevel','validation','\x20\x20env:\x20\x20\x20\x20\x20','10132017AEqGYj','stdout','1301830WFVydB','657aVJrpM','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','trim','[y/N]','entries','Invalid\x20env\x20\x22','\x22.\x20Allowed:\x20','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','12888tZDPxn'];a31_0x4601=function(){return _0x1d2d87;};return a31_0x4601();}function createSafeRl(){const _0x179e71=a31_0x465e3c,_0x59430c=createInterface({'input':process[_0x179e71(0xd6)],'output':process[_0x179e71(0x106)]});let _0x305da1;const _0x1f9780=new Promise((_0x2736bf,_0x5867a4)=>{const _0xc694ef=_0x179e71;_0x305da1=()=>{const _0x33f153=a31_0x15ce;_0x305da1&&(_0x59430c[_0x33f153(0xe5)](_0x33f153(0xcb),_0x305da1),_0x305da1=undefined);try{_0x59430c[_0x33f153(0xf0)]();}catch{}_0x5867a4(new AbortPrompt());},_0x59430c['once'](_0xc694ef(0xcb),_0x305da1);}),_0x5cf855=()=>{const _0x543fca=_0x179e71;_0x305da1&&(_0x59430c['removeListener'](_0x543fca(0xcb),_0x305da1),_0x305da1=undefined);try{_0x59430c[_0x543fca(0xf0)]();}catch{}};return{'rl':_0x59430c,'abortPromise':_0x1f9780,'disposeSuccess':_0x5cf855};}async function promptInput(_0x4e530d,_0xb2a8ff){const _0x4a5e33=a31_0x465e3c,{rl:_0x4155b1,abortPromise:_0x273bf4,disposeSuccess:_0x3c811e}=createSafeRl(),_0x4b6f52=new Promise(_0x543000=>{const _0x11063c=_0xb2a8ff?'\x20\x20'+_0x4e530d+'\x20('+_0xb2a8ff+'):\x20':'\x20\x20'+_0x4e530d+':\x20';_0x4155b1['question'](_0x11063c,_0xe9e795=>{const _0x3e42f4=a31_0x15ce;_0x3c811e(),_0x543000(_0xe9e795[_0x3e42f4(0x10a)]()||_0xb2a8ff);});});return Promise[_0x4a5e33(0xca)]([_0x4b6f52,_0x273bf4]);}async function promptYesNo(_0x26c219,_0x27f520){const _0x3d1f53=a31_0x465e3c,{rl:_0x518e35,abortPromise:_0xf1307c,disposeSuccess:_0x592b04}=createSafeRl(),_0x4977f0=new Promise(_0x417618=>{const _0x569291=a31_0x15ce,_0x5ad20b=_0x27f520?_0x569291(0xfb):_0x569291(0x10b);_0x518e35[_0x569291(0xeb)]('\x20\x20'+_0x26c219+'\x20'+_0x5ad20b+':\x20',_0x1628eb=>{const _0x46656f=_0x569291;_0x592b04();const _0x18dcc9=_0x1628eb[_0x46656f(0x10a)]()[_0x46656f(0xf2)]();if(_0x18dcc9==='y'||_0x18dcc9===_0x46656f(0xef))_0x417618(!![]);else{if(_0x18dcc9==='n'||_0x18dcc9==='no')_0x417618(![]);else _0x417618(_0x27f520);}});});return Promise[_0x3d1f53(0xca)]([_0x4977f0,_0xf1307c]);}function loadExisting(_0x493eb2){if(!existsSync(_0x493eb2))return null;return readConfigFile(_0x493eb2);}function resolveFilePath(_0x1ac0f5){const _0x8e0128=a31_0x465e3c;return isAbsolute(_0x1ac0f5)?_0x1ac0f5:resolve(process[_0x8e0128(0xff)](),_0x1ac0f5);}function readSourceFile(_0x1c9531){const _0x5ad687=a31_0x465e3c;try{const _0x146bab=readFileSync(_0x1c9531,{'encoding':_0x5ad687(0xd4)});return JSON[_0x5ad687(0xe7)](_0x146bab);}catch(_0x1951b1){throw CliErrors['validation'](_0x5ad687(0xf9)+_0x1951b1[_0x5ad687(0xfc)]);}}function resolveInitEnv(_0x3d8406){const _0x3ac7ba=a31_0x465e3c,_0x3234fd=_0x3d8406['env'];if(_0x3234fd===undefined||_0x3234fd==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x3ac7ba(0xcd)](_0x3234fd))throw CliErrors[_0x3ac7ba(0x103)](_0x3ac7ba(0x10d)+_0x3234fd+_0x3ac7ba(0xc6)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x3234fd;}
@@ -1 +1 @@
1
- const a32_0x47859e=a32_0x289a;(function(_0xcd6e47,_0x3c3976){const _0x33eff9=a32_0x289a,_0x366d6f=_0xcd6e47();while(!![]){try{const _0xe10a6b=-parseInt(_0x33eff9(0x109))/0x1+-parseInt(_0x33eff9(0x100))/0x2*(-parseInt(_0x33eff9(0x137))/0x3)+parseInt(_0x33eff9(0x117))/0x4+parseInt(_0x33eff9(0x138))/0x5+-parseInt(_0x33eff9(0x114))/0x6*(-parseInt(_0x33eff9(0x126))/0x7)+-parseInt(_0x33eff9(0x119))/0x8+-parseInt(_0x33eff9(0x111))/0x9*(parseInt(_0x33eff9(0x12b))/0xa);if(_0xe10a6b===_0x3c3976)break;else _0x366d6f['push'](_0x366d6f['shift']());}catch(_0x34f9e8){_0x366d6f['push'](_0x366d6f['shift']());}}}(a32_0x4e72,0x83d06));import{existsSync,readFileSync,statSync}from'node:fs';function a32_0x289a(_0x562ddb,_0xaab53d){_0x562ddb=_0x562ddb-0xfc;const _0x4e7286=a32_0x4e72();let _0x289a0c=_0x4e7286[_0x562ddb];return _0x289a0c;}import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x47859e(0x124),'type':a32_0x47859e(0x110),'required':!![],'description':a32_0x47859e(0x133)},FILE_FLAG={'name':a32_0x47859e(0x10a),'type':'string','required':!![],'description':a32_0x47859e(0x12d)},QUERY_FLAG={'name':a32_0x47859e(0x104),'type':'string','required':!![],'description':a32_0x47859e(0x134)},TOPK_FLAG={'name':a32_0x47859e(0x113),'type':'number','description':a32_0x47859e(0x11d)};function readKnowledgeFile(_0x5d7e47){const _0x4a7dd4=a32_0x47859e;if(!_0x5d7e47)throw CliErrors[_0x4a7dd4(0x11e)](_0x4a7dd4(0x10e));if(!existsSync(_0x5d7e47))throw CliErrors[_0x4a7dd4(0x11e)](_0x4a7dd4(0x135)+_0x5d7e47);if(!statSync(_0x5d7e47)[_0x4a7dd4(0x12f)]())throw CliErrors[_0x4a7dd4(0x11e)](_0x4a7dd4(0x128)+_0x5d7e47);return readFileSync(_0x5d7e47,'utf8');}function summarizePersonalItem(_0x563c87){const _0x3cd977=a32_0x47859e;return{'id':_0x563c87['id'],'title':_0x563c87['title'],'version':_0x563c87[_0x3cd977(0x127)],'ragStatus':_0x563c87[_0x3cd977(0x10f)],'ragErrorMessage':_0x563c87['ragErrorMessage'],'updateTime':_0x563c87[_0x3cd977(0x107)]};}function detailPersonalItem(_0x5ac154){const _0x1df154=a32_0x47859e;return{'id':_0x5ac154['id'],'appCode':_0x5ac154[_0x1df154(0x130)],'scope':_0x5ac154[_0x1df154(0x11a)],'userId':_0x5ac154[_0x1df154(0x108)],'title':_0x5ac154['title'],'content':_0x5ac154[_0x1df154(0x101)]??'','version':_0x5ac154[_0x1df154(0x127)],'ragStatus':_0x5ac154[_0x1df154(0x10f)],'ragErrorMessage':_0x5ac154[_0x1df154(0xff)],'createTime':_0x5ac154[_0x1df154(0x10c)],'updateTime':_0x5ac154[_0x1df154(0x107)]};}function summarizeSearchHit(_0x13b6d2){const _0x29cd55=a32_0x47859e;return{'scope':_0x13b6d2[_0x29cd55(0x11a)],'docId':_0x13b6d2[_0x29cd55(0x11f)],'score':_0x13b6d2['score'],'weightedScore':_0x13b6d2['weightedScore'],'content':_0x13b6d2[_0x29cd55(0x101)],'metadata':_0x13b6d2['metadata']};}function readTopK(_0x167af7){const _0x2ba077=a32_0x47859e,_0x31ab03=_0x167af7['flag'](_0x2ba077(0x113));if(_0x31ab03===undefined||_0x31ab03===null||_0x31ab03==='')return undefined;const _0x424e10=_0x167af7[_0x2ba077(0x11b)](_0x2ba077(0x113));if(!Number['isFinite'](_0x424e10)||_0x424e10<0x1)throw CliErrors[_0x2ba077(0x11e)](_0x2ba077(0x122));return _0x424e10;}function a32_0x4e72(){const _0xc14358=['write','3542208FhuFBt','scope','num','body','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','validation','docId','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','list','--topk\x20must\x20be\x20a\x20positive\x20number.','verbose','title','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','62993xVwYag','version','File\x20is\x20not\x20a\x20regular\x20file:\x20','str','trim','20SLfHKh','Override\x20the\x20existing\x20entry\x20title','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','/update','isFile','appCode','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','POST','Personal\x20knowledge-base\x20entry\x20title','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','File\x20not\x20found:\x20','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','63dWjAdZ','585760PJtjVM','Search\x20query\x20is\x20required.','Created\x20KB\x20entry\x20','search','ragErrorMessage','28754eOLTWL','content','build','map','query','read','description','updateTime','userId','119212eQLXDo','file','Personal\x20knowledge-base\x20entry\x20ID','createTime','detail','File\x20path\x20is\x20required.','ragStatus','string','4377213QSmFUQ','length','topk','654PiyyZI','Updated\x20KB\x20entry\x20','bool','2698608AWGzNo'];a32_0x4e72=function(){return _0xc14358;};return a32_0x4e72();}const kbList={'service':'kb','command':a32_0x47859e(0x121),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a32_0x47859e(0x105),'flags':[VERBOSE_FLAG],async 'execute'(_0x2f0c22){const _0x20942c=a32_0x47859e,_0x183bd7=await listPersonalKnowledgeBaseItems(_0x2f0c22[_0x20942c(0x130)]);if(_0x2f0c22[_0x20942c(0x116)](_0x20942c(0x123)))return{'ok':!![],'data':{'total':_0x183bd7[_0x20942c(0x112)],'items':_0x183bd7}};return{'ok':!![],'data':{'total':_0x183bd7[_0x20942c(0x112)],'items':_0x183bd7[_0x20942c(0x103)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x47859e(0x10d),'description':a32_0x47859e(0x125),'risk':a32_0x47859e(0x105),'flags':[{...ID_FLAG,'description':a32_0x47859e(0x10b)}],async 'execute'(_0x273e4d){const _0x263cb8=a32_0x47859e,_0x1b6f8b=await getPersonalKnowledgeBaseItem(_0x273e4d[_0x263cb8(0x11b)]('id'),_0x273e4d['appCode']);return{'ok':!![],'data':detailPersonalItem(_0x1b6f8b)};}},kbCreate={'service':'kb','command':'create','description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a32_0x47859e(0x118),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x3c01cd){const _0x5edd1c=a32_0x47859e,_0x55d2dc=_0x3c01cd[_0x5edd1c(0x129)](_0x5edd1c(0x124)),_0x39ae85=readKnowledgeFile(_0x3c01cd[_0x5edd1c(0x129)]('file')),_0x13c97d=await createPersonalKnowledgeBaseItem(_0x3c01cd[_0x5edd1c(0x130)],{'title':_0x55d2dc,'content':_0x39ae85});return{'ok':!![],'data':summarizePersonalItem(_0x13c97d),'message':_0x5edd1c(0xfd)+_0x13c97d['id']+'\x20('+_0x13c97d['title']+')'};},async 'dryRun'(_0x26099d){const _0x50c571=a32_0x47859e,_0x3283a9=_0x26099d[_0x50c571(0x129)](_0x50c571(0x124)),_0x5750cb=readKnowledgeFile(_0x26099d[_0x50c571(0x129)]('file'));return dryRun(_0x50c571(0x132),'/client/knowledge-base/personal/create')['body']({'appCode':_0x26099d['appCode'],'title':_0x3283a9,'content':_0x5750cb})[_0x50c571(0x106)]('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0x3283a9+'\x22')[_0x50c571(0x102)]();}},kbUpdate={'service':'kb','command':'update','description':a32_0x47859e(0x120),'risk':a32_0x47859e(0x118),'flags':[{...ID_FLAG,'description':a32_0x47859e(0x10b)},{...TITLE_FLAG,'required':![],'description':a32_0x47859e(0x12c)},FILE_FLAG],async 'execute'(_0x1fcc57){const _0x5464cb=a32_0x47859e,_0x4b9700=_0x1fcc57['num']('id'),_0x2bf7af=readKnowledgeFile(_0x1fcc57[_0x5464cb(0x129)](_0x5464cb(0x10a))),_0xc6b92d=_0x1fcc57[_0x5464cb(0x129)](_0x5464cb(0x124))||(await getPersonalKnowledgeBaseItem(_0x4b9700,_0x1fcc57[_0x5464cb(0x130)]))[_0x5464cb(0x124)],_0x26e427=await updatePersonalKnowledgeBaseItem(_0x4b9700,_0x1fcc57[_0x5464cb(0x130)],{'title':_0xc6b92d,'content':_0x2bf7af});return{'ok':!![],'data':summarizePersonalItem(_0x26e427),'message':_0x5464cb(0x115)+_0x26e427['id']+'\x20('+_0x26e427[_0x5464cb(0x124)]+')'};},async 'dryRun'(_0x2dede2){const _0x2f0db8=a32_0x47859e,_0x2f29a7=_0x2dede2[_0x2f0db8(0x11b)]('id'),_0x28d694=readKnowledgeFile(_0x2dede2['str']('file')),_0x15d4f9=_0x2dede2[_0x2f0db8(0x129)](_0x2f0db8(0x124))||(await getPersonalKnowledgeBaseItem(_0x2f29a7,_0x2dede2[_0x2f0db8(0x130)]))[_0x2f0db8(0x124)];return dryRun('POST','/client/knowledge-base/personal/'+_0x2f29a7+_0x2f0db8(0x12e))[_0x2f0db8(0x11c)]({'appCode':_0x2dede2[_0x2f0db8(0x130)],'title':_0x15d4f9,'content':_0x28d694})[_0x2f0db8(0x106)](_0x2f0db8(0x131)+_0x2f29a7)[_0x2f0db8(0x102)]();}},kbSearch={'service':'kb','command':a32_0x47859e(0xfe),'description':a32_0x47859e(0x136),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x149caa){const _0x1f606c=a32_0x47859e;if(!_0x149caa['str']('query')['trim']())throw CliErrors[_0x1f606c(0x11e)](_0x1f606c(0xfc));readTopK(_0x149caa);},async 'execute'(_0x52c3b6){const _0x24cc32=a32_0x47859e,_0x1f695c=_0x52c3b6[_0x24cc32(0x129)](_0x24cc32(0x104))[_0x24cc32(0x12a)](),_0x138472=readTopK(_0x52c3b6),_0x9c677e=await searchKnowledgeBase(_0x52c3b6[_0x24cc32(0x130)],{'query':_0x1f695c,'topK':_0x138472});return{'ok':!![],'data':{'total':_0x9c677e[_0x24cc32(0x112)],'hits':_0x9c677e[_0x24cc32(0x103)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
1
+ const a32_0x53347c=a32_0xa5f0;(function(_0x4ad0b2,_0x1b90bc){const _0x49df67=a32_0xa5f0,_0x5a8eff=_0x4ad0b2();while(!![]){try{const _0x5dfe1f=parseInt(_0x49df67(0x1b6))/0x1*(parseInt(_0x49df67(0x1db))/0x2)+-parseInt(_0x49df67(0x1af))/0x3*(-parseInt(_0x49df67(0x1c2))/0x4)+parseInt(_0x49df67(0x1c7))/0x5+parseInt(_0x49df67(0x1bf))/0x6*(-parseInt(_0x49df67(0x1c0))/0x7)+-parseInt(_0x49df67(0x1ca))/0x8*(-parseInt(_0x49df67(0x1bc))/0x9)+-parseInt(_0x49df67(0x1df))/0xa*(-parseInt(_0x49df67(0x1d5))/0xb)+-parseInt(_0x49df67(0x1d8))/0xc*(parseInt(_0x49df67(0x1d4))/0xd);if(_0x5dfe1f===_0x1b90bc)break;else _0x5a8eff['push'](_0x5a8eff['shift']());}catch(_0x2078ce){_0x5a8eff['push'](_0x5a8eff['shift']());}}}(a32_0x5a25,0xf298b));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';function a32_0xa5f0(_0x5a5e22,_0x325496){_0x5a5e22=_0x5a5e22-0x1a1;const _0x5a25f7=a32_0x5a25();let _0xa5f07=_0x5a25f7[_0x5a5e22];return _0xa5f07;}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_0x53347c(0x1a9),'type':a32_0x53347c(0x1b9),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a32_0x53347c(0x1b8),'type':a32_0x53347c(0x1b9),'required':!![],'description':a32_0x53347c(0x1d9)},QUERY_FLAG={'name':a32_0x53347c(0x1b2),'type':a32_0x53347c(0x1b9),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':a32_0x53347c(0x1a8),'type':a32_0x53347c(0x1c4),'description':a32_0x53347c(0x1a4)};function a32_0x5a25(){const _0x36f988=['description','isFinite','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','updateTime','33783zOBulz','File\x20not\x20found:\x20','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','query','metadata','trim','Personal\x20knowledge-base\x20entry\x20ID','29546EEhDoQ','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','file','string','flag','/client/knowledge-base/personal/create','1609191PpkQzU','str','bool','2580nehuWG','12103AXjhnV','read','44TAtSkL','detail','number','ragErrorMessage','Override\x20the\x20existing\x20entry\x20title','660720IiMhQz','isFile','--topk\x20must\x20be\x20a\x20positive\x20number.','24jxLhoW','search','scope','list','Search\x20query\x20is\x20required.','build','File\x20path\x20is\x20required.','length','/update','createTime','13qaMjsl','22lHKnEA','Updated\x20KB\x20entry\x20','appCode','15126012mpUxOo','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','map','36MUuzlY','version','userId','POST','8367030PBliQH','ragStatus','utf8','body','score','validation','content','Created\x20KB\x20entry\x20','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','num','/client/knowledge-base/personal/','verbose','topk','title','docId'];a32_0x5a25=function(){return _0x36f988;};return a32_0x5a25();}function readKnowledgeFile(_0x45f479){const _0x51765e=a32_0x53347c;if(!_0x45f479)throw CliErrors['validation'](_0x51765e(0x1d0));if(!existsSync(_0x45f479))throw CliErrors[_0x51765e(0x1a1)](_0x51765e(0x1b0)+_0x45f479);if(!statSync(_0x45f479)[_0x51765e(0x1c8)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x45f479);return readFileSync(_0x45f479,_0x51765e(0x1e1));}function summarizePersonalItem(_0x1acf53){const _0x4f66e5=a32_0x53347c;return{'id':_0x1acf53['id'],'title':_0x1acf53[_0x4f66e5(0x1a9)],'version':_0x1acf53[_0x4f66e5(0x1dc)],'ragStatus':_0x1acf53[_0x4f66e5(0x1e0)],'ragErrorMessage':_0x1acf53['ragErrorMessage'],'updateTime':_0x1acf53[_0x4f66e5(0x1ae)]};}function detailPersonalItem(_0x21a396){const _0x2de335=a32_0x53347c;return{'id':_0x21a396['id'],'appCode':_0x21a396[_0x2de335(0x1d7)],'scope':_0x21a396[_0x2de335(0x1cc)],'userId':_0x21a396[_0x2de335(0x1dd)],'title':_0x21a396[_0x2de335(0x1a9)],'content':_0x21a396[_0x2de335(0x1a2)]??'','version':_0x21a396[_0x2de335(0x1dc)],'ragStatus':_0x21a396[_0x2de335(0x1e0)],'ragErrorMessage':_0x21a396[_0x2de335(0x1c5)],'createTime':_0x21a396[_0x2de335(0x1d3)],'updateTime':_0x21a396[_0x2de335(0x1ae)]};}function summarizeSearchHit(_0x5c6bd0){const _0x2bad1f=a32_0x53347c;return{'scope':_0x5c6bd0['scope'],'docId':_0x5c6bd0[_0x2bad1f(0x1aa)],'score':_0x5c6bd0[_0x2bad1f(0x1e3)],'weightedScore':_0x5c6bd0['weightedScore'],'content':_0x5c6bd0[_0x2bad1f(0x1a2)],'metadata':_0x5c6bd0[_0x2bad1f(0x1b3)]};}function readTopK(_0x435dc5){const _0x1daebe=a32_0x53347c,_0x760a0e=_0x435dc5[_0x1daebe(0x1ba)](_0x1daebe(0x1a8));if(_0x760a0e===undefined||_0x760a0e===null||_0x760a0e==='')return undefined;const _0x2c9586=_0x435dc5['num'](_0x1daebe(0x1a8));if(!Number[_0x1daebe(0x1ac)](_0x2c9586)||_0x2c9586<0x1)throw CliErrors['validation'](_0x1daebe(0x1c9));return _0x2c9586;}const kbList={'service':'kb','command':a32_0x53347c(0x1cd),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a32_0x53347c(0x1c1),'flags':[VERBOSE_FLAG],async 'execute'(_0x52191c){const _0x1b96bd=a32_0x53347c,_0x155983=await listPersonalKnowledgeBaseItems(_0x52191c[_0x1b96bd(0x1d7)]);if(_0x52191c[_0x1b96bd(0x1be)](_0x1b96bd(0x1a7)))return{'ok':!![],'data':{'total':_0x155983['length'],'items':_0x155983}};return{'ok':!![],'data':{'total':_0x155983[_0x1b96bd(0x1d1)],'items':_0x155983[_0x1b96bd(0x1da)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x53347c(0x1c3),'description':a32_0x53347c(0x1ad),'risk':a32_0x53347c(0x1c1),'flags':[{...ID_FLAG,'description':a32_0x53347c(0x1b5)}],async 'execute'(_0x4041e9){const _0x5a5d81=a32_0x53347c,_0x4a5a3f=await getPersonalKnowledgeBaseItem(_0x4041e9[_0x5a5d81(0x1a5)]('id'),_0x4041e9['appCode']);return{'ok':!![],'data':detailPersonalItem(_0x4a5a3f)};}},kbCreate={'service':'kb','command':'create','description':a32_0x53347c(0x1b1),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x948d36){const _0x334d20=a32_0x53347c,_0x443a98=_0x948d36['str'](_0x334d20(0x1a9)),_0x417d0b=readKnowledgeFile(_0x948d36[_0x334d20(0x1bd)](_0x334d20(0x1b8))),_0x5298ed=await createPersonalKnowledgeBaseItem(_0x948d36[_0x334d20(0x1d7)],{'title':_0x443a98,'content':_0x417d0b});return{'ok':!![],'data':summarizePersonalItem(_0x5298ed),'message':_0x334d20(0x1a3)+_0x5298ed['id']+'\x20('+_0x5298ed[_0x334d20(0x1a9)]+')'};},async 'dryRun'(_0x5d65bc){const _0x44ad02=a32_0x53347c,_0x3410a9=_0x5d65bc[_0x44ad02(0x1bd)](_0x44ad02(0x1a9)),_0x354800=readKnowledgeFile(_0x5d65bc[_0x44ad02(0x1bd)](_0x44ad02(0x1b8)));return dryRun(_0x44ad02(0x1de),_0x44ad02(0x1bb))[_0x44ad02(0x1e2)]({'appCode':_0x5d65bc[_0x44ad02(0x1d7)],'title':_0x3410a9,'content':_0x354800})[_0x44ad02(0x1ab)](_0x44ad02(0x1b7)+_0x3410a9+'\x22')[_0x44ad02(0x1cf)]();}},kbUpdate={'service':'kb','command':'update','description':'Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':'write','flags':[{...ID_FLAG,'description':a32_0x53347c(0x1b5)},{...TITLE_FLAG,'required':![],'description':a32_0x53347c(0x1c6)},FILE_FLAG],async 'execute'(_0x570f6b){const _0x11cf96=a32_0x53347c,_0x373ace=_0x570f6b[_0x11cf96(0x1a5)]('id'),_0x1fedc9=readKnowledgeFile(_0x570f6b[_0x11cf96(0x1bd)](_0x11cf96(0x1b8))),_0xa73d74=_0x570f6b[_0x11cf96(0x1bd)]('title')||(await getPersonalKnowledgeBaseItem(_0x373ace,_0x570f6b[_0x11cf96(0x1d7)]))[_0x11cf96(0x1a9)],_0x4a7e06=await updatePersonalKnowledgeBaseItem(_0x373ace,_0x570f6b[_0x11cf96(0x1d7)],{'title':_0xa73d74,'content':_0x1fedc9});return{'ok':!![],'data':summarizePersonalItem(_0x4a7e06),'message':_0x11cf96(0x1d6)+_0x4a7e06['id']+'\x20('+_0x4a7e06[_0x11cf96(0x1a9)]+')'};},async 'dryRun'(_0x481afe){const _0xa2ad09=a32_0x53347c,_0x4388b0=_0x481afe[_0xa2ad09(0x1a5)]('id'),_0x1fb7f7=readKnowledgeFile(_0x481afe[_0xa2ad09(0x1bd)](_0xa2ad09(0x1b8))),_0x281494=_0x481afe['str'](_0xa2ad09(0x1a9))||(await getPersonalKnowledgeBaseItem(_0x4388b0,_0x481afe[_0xa2ad09(0x1d7)]))['title'];return dryRun('POST',_0xa2ad09(0x1a6)+_0x4388b0+_0xa2ad09(0x1d2))['body']({'appCode':_0x481afe[_0xa2ad09(0x1d7)],'title':_0x281494,'content':_0x1fb7f7})[_0xa2ad09(0x1ab)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x4388b0)[_0xa2ad09(0x1cf)]();}},kbSearch={'service':'kb','command':a32_0x53347c(0x1cb),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a32_0x53347c(0x1c1),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x3ee842){const _0x2e027f=a32_0x53347c;if(!_0x3ee842['str'](_0x2e027f(0x1b2))[_0x2e027f(0x1b4)]())throw CliErrors[_0x2e027f(0x1a1)](_0x2e027f(0x1ce));readTopK(_0x3ee842);},async 'execute'(_0x4060b1){const _0x1e9809=a32_0x53347c,_0x539635=_0x4060b1[_0x1e9809(0x1bd)](_0x1e9809(0x1b2))[_0x1e9809(0x1b4)](),_0x4399ee=readTopK(_0x4060b1),_0x3da92c=await searchKnowledgeBase(_0x4060b1['appCode'],{'query':_0x539635,'topK':_0x4399ee});return{'ok':!![],'data':{'total':_0x3da92c[_0x1e9809(0x1d1)],'hits':_0x3da92c[_0x1e9809(0x1da)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
@@ -1 +1 @@
1
- const a33_0x36111f=a33_0x2037;(function(_0x5a9f61,_0x203a5d){const _0xcd8f84=a33_0x2037,_0x5d1f28=_0x5a9f61();while(!![]){try{const _0xcef0f9=parseInt(_0xcd8f84(0xc9))/0x1*(-parseInt(_0xcd8f84(0xd0))/0x2)+-parseInt(_0xcd8f84(0xde))/0x3*(-parseInt(_0xcd8f84(0xd9))/0x4)+parseInt(_0xcd8f84(0xcc))/0x5*(parseInt(_0xcd8f84(0xd5))/0x6)+parseInt(_0xcd8f84(0xe4))/0x7*(-parseInt(_0xcd8f84(0xe8))/0x8)+parseInt(_0xcd8f84(0xe0))/0x9*(-parseInt(_0xcd8f84(0xe9))/0xa)+parseInt(_0xcd8f84(0xca))/0xb+-parseInt(_0xcd8f84(0xdb))/0xc*(-parseInt(_0xcd8f84(0xeb))/0xd);if(_0xcef0f9===_0x203a5d)break;else _0x5d1f28['push'](_0x5d1f28['shift']());}catch(_0xfc8fd4){_0x5d1f28['push'](_0x5d1f28['shift']());}}}(a33_0x2a06,0x1cfb0));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0x2037(_0x329fc2,_0xafd1e7){_0x329fc2=_0x329fc2-0xc8;const _0x2a06c6=a33_0x2a06();let _0x203720=_0x2a06c6[_0x329fc2];return _0x203720;}function printLogs(_0x1760c6){const _0xaf95c2=a33_0x2037;if(_0x1760c6[_0xaf95c2(0xd2)]===0x0){console['log'](_0xaf95c2(0xd3));return;}console[_0xaf95c2(0xd4)]('*\x20'+CLI_DISPLAY_NAME+_0xaf95c2(0xdc)),_0x1760c6[_0xaf95c2(0xcb)]((_0x2189e9,_0x442fff)=>{const _0x4905d4=_0xaf95c2,_0x4ef07a=new Date(_0x2189e9['timestamp'])[_0x4905d4(0xcd)](_0x4905d4(0xdf)),_0x358e1b=_0x2189e9[_0x4905d4(0xe2)]===_0x4905d4(0xce)?'√':_0x2189e9[_0x4905d4(0xe2)]===_0x4905d4(0xd1)?'×':_0x2189e9[_0x4905d4(0xe2)]===_0x4905d4(0xed)?'!':'i';console[_0x4905d4(0xd4)](_0x442fff+0x1+'.\x20'+_0x358e1b+'\x20['+_0x2189e9[_0x4905d4(0xe1)]+']\x20'+_0x2189e9['message']),console[_0x4905d4(0xd4)](_0x4905d4(0xe5)+_0x4ef07a),_0x2189e9[_0x4905d4(0xe3)]&&console[_0x4905d4(0xd4)]('\x20\x20\x20Duration:\x20'+_0x2189e9[_0x4905d4(0xe3)]+'ms'),_0x2189e9[_0x4905d4(0xdd)]&&Object[_0x4905d4(0xe6)](_0x2189e9[_0x4905d4(0xdd)])[_0x4905d4(0xd2)]>0x0&&console[_0x4905d4(0xd4)]('\x20\x20\x20Details:\x20'+JSON[_0x4905d4(0xd6)](_0x2189e9[_0x4905d4(0xdd)],null,0x2)),console[_0x4905d4(0xd4)]('');});}function a33_0x2a06(){const _0x2e4801=['duration','1402471KoYtlH','\x20\x20\x20Time:\x20','keys','View\x20command\x20history\x20logs','8CKNNYi','550jgaokF','read','13pNXoAM','readLogs','warn','logs','1478sVzESY','1705209oHBtUL','forEach','177865UJRhml','toLocaleString','success','clear','26VODbJO','error','length','*\x20No\x20logs\x20found','log','6WjLohO','stringify','*\x20Logs\x20cleared','Clear\x20command\x20history\x20logs','6740uXtbXw','write','1499928nUkfuo','\x20logs:\x0a','details','417LJcvZX','en-US','34614YbPeZK','command','level'];a33_0x2a06=function(){return _0x2e4801;};return a33_0x2a06();}export const logsDefinitions=[{'service':'logs','command':'show','description':a33_0x36111f(0xe7),'risk':a33_0x36111f(0xea),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2b6ff5){const _0xc0ef6=a33_0x36111f;return printLogs(logger[_0xc0ef6(0xec)]()),{'ok':!![]};}},{'service':a33_0x36111f(0xc8),'command':a33_0x36111f(0xcf),'description':a33_0x36111f(0xd8),'risk':a33_0x36111f(0xda),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x31d1be){const _0x3bbd92=a33_0x36111f;return logger['clearLogs'](),console[_0x3bbd92(0xd4)](_0x3bbd92(0xd7)),{'ok':!![]};}}];
1
+ function a33_0x1f56(_0x2da9fb,_0x40b4d1){_0x2da9fb=_0x2da9fb-0x1c8;const _0x1426c0=a33_0x1426();let _0x1f565a=_0x1426c0[_0x2da9fb];return _0x1f565a;}const a33_0x544069=a33_0x1f56;function a33_0x1426(){const _0x4efecf=['56782cJmmWg','128096OoDkFh','warn','View\x20command\x20history\x20logs','details','error','stringify','timestamp','Clear\x20command\x20history\x20logs','write','\x20logs:\x0a','774487qCjwYu','command','success','784587tLJWUU','log','en-US','1899GBjcwY','length','\x20\x20\x20Duration:\x20','*\x20Logs\x20cleared','540dOfFcL','toLocaleString','read','clear','2960zsaFjO','7982cgIguN','logs','\x20\x20\x20Details:\x20','536488dDJwkr','message','level','keys','show','5316SpIsIF','1GsqqgT','5anVCXj','forEach','6qjToek'];a33_0x1426=function(){return _0x4efecf;};return a33_0x1426();}(function(_0x43d653,_0x13b9d3){const _0x29be3a=a33_0x1f56,_0x36b51a=_0x43d653();while(!![]){try{const _0x242d42=parseInt(_0x29be3a(0x1ce))/0x1*(-parseInt(_0x29be3a(0x1d3))/0x2)+parseInt(_0x29be3a(0x1e0))/0x3+-parseInt(_0x29be3a(0x1c8))/0x4*(-parseInt(_0x29be3a(0x1cf))/0x5)+-parseInt(_0x29be3a(0x1d1))/0x6*(parseInt(_0x29be3a(0x1dd))/0x7)+parseInt(_0x29be3a(0x1eb))/0x8*(-parseInt(_0x29be3a(0x1e3))/0x9)+parseInt(_0x29be3a(0x1e7))/0xa*(parseInt(_0x29be3a(0x1d2))/0xb)+-parseInt(_0x29be3a(0x1cd))/0xc*(parseInt(_0x29be3a(0x1ec))/0xd);if(_0x242d42===_0x13b9d3)break;else _0x36b51a['push'](_0x36b51a['shift']());}catch(_0x3370a7){_0x36b51a['push'](_0x36b51a['shift']());}}}(a33_0x1426,0x24886));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x4fa6a5){const _0x43a45d=a33_0x1f56;if(_0x4fa6a5[_0x43a45d(0x1e4)]===0x0){console[_0x43a45d(0x1e1)]('*\x20No\x20logs\x20found');return;}console[_0x43a45d(0x1e1)]('*\x20'+CLI_DISPLAY_NAME+_0x43a45d(0x1dc)),_0x4fa6a5[_0x43a45d(0x1d0)]((_0x3a5e1a,_0x1c6a14)=>{const _0x744a25=_0x43a45d,_0xbed14f=new Date(_0x3a5e1a[_0x744a25(0x1d9)])[_0x744a25(0x1e8)](_0x744a25(0x1e2)),_0x1c99ab=_0x3a5e1a['level']===_0x744a25(0x1df)?'√':_0x3a5e1a[_0x744a25(0x1ca)]===_0x744a25(0x1d7)?'×':_0x3a5e1a[_0x744a25(0x1ca)]===_0x744a25(0x1d4)?'!':'i';console[_0x744a25(0x1e1)](_0x1c6a14+0x1+'.\x20'+_0x1c99ab+'\x20['+_0x3a5e1a[_0x744a25(0x1de)]+']\x20'+_0x3a5e1a[_0x744a25(0x1c9)]),console['log']('\x20\x20\x20Time:\x20'+_0xbed14f),_0x3a5e1a['duration']&&console[_0x744a25(0x1e1)](_0x744a25(0x1e5)+_0x3a5e1a['duration']+'ms'),_0x3a5e1a[_0x744a25(0x1d6)]&&Object[_0x744a25(0x1cb)](_0x3a5e1a[_0x744a25(0x1d6)])[_0x744a25(0x1e4)]>0x0&&console[_0x744a25(0x1e1)](_0x744a25(0x1ee)+JSON[_0x744a25(0x1d8)](_0x3a5e1a[_0x744a25(0x1d6)],null,0x2)),console[_0x744a25(0x1e1)]('');});}export const logsDefinitions=[{'service':a33_0x544069(0x1ed),'command':a33_0x544069(0x1cc),'description':a33_0x544069(0x1d5),'risk':a33_0x544069(0x1e9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2b3dd){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':a33_0x544069(0x1ed),'command':a33_0x544069(0x1ea),'description':a33_0x544069(0x1da),'risk':a33_0x544069(0x1db),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x7d5ee3){const _0x589148=a33_0x544069;return logger['clearLogs'](),console[_0x589148(0x1e1)](_0x589148(0x1e6)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a34_0x4a6bb2=a34_0x3211;(function(_0x4feb00,_0x59caf1){const _0x179f54=a34_0x3211,_0x305d8b=_0x4feb00();while(!![]){try{const _0xd810a7=-parseInt(_0x179f54(0x17f))/0x1*(parseInt(_0x179f54(0x180))/0x2)+-parseInt(_0x179f54(0x174))/0x3+-parseInt(_0x179f54(0x173))/0x4*(-parseInt(_0x179f54(0x171))/0x5)+-parseInt(_0x179f54(0x185))/0x6*(parseInt(_0x179f54(0x187))/0x7)+parseInt(_0x179f54(0x169))/0x8*(parseInt(_0x179f54(0x188))/0x9)+parseInt(_0x179f54(0x15b))/0xa+parseInt(_0x179f54(0x170))/0xb*(-parseInt(_0x179f54(0x172))/0xc);if(_0xd810a7===_0x59caf1)break;else _0x305d8b['push'](_0x305d8b['shift']());}catch(_0x45a079){_0x305d8b['push'](_0x305d8b['shift']());}}}(a34_0x5a4a,0xcb07d));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';function a34_0x5a4a(){const _0x490af0=['36RWUpON','description','Invoice','Preview:\x20recognize\x20','trim','count','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','File\x20upload\x20response\x20missing\x20filePath.','image-file','string','filePath','12588570DIeUWk','build','idCard','form','POST','body','\x20OCR','Table','apiError','appCode','\x20OCR\x20from\x20URL','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','length','toLowerCase','2335864TdzlkF','Publicly\x20accessible\x20image\x20or\x20file\x20URL','general','image-url','validation','fileUrl','imageUrl','4961BeWMxS','4166660BhFIex','27504qoKGYe','4tpaPLb','831117jbXlYN','invoice','/client/queryFileUrl','path','scene','File\x20URL\x20response\x20missing\x20fileUrl.','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','fileName','General','/client/ocr','/client/uploadFile','434402GMTPvJ','2PWJMzK','str','ocr','Unsupported\x20OCR\x20scene:\x20','<filePath\x20returned\x20by\x20/client/uploadFile>','2310uVMzom','imageFile','12425gjEbpp'];a34_0x5a4a=function(){return _0x490af0;};return a34_0x5a4a();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a34_0x3211(_0x12e412,_0x3369ba){_0x12e412=_0x12e412-0x15a;const _0x5a4af4=a34_0x5a4a();let _0x3211e0=_0x5a4af4[_0x12e412];return _0x3211e0;}const SUPPORTED_SCENES=[a34_0x4a6bb2(0x175),a34_0x4a6bb2(0x16b),a34_0x4a6bb2(0x15e),a34_0x4a6bb2(0x15d)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x4a6bb2(0x18a),'general':a34_0x4a6bb2(0x17c),'form':a34_0x4a6bb2(0x162),'idCard':'IdCard'},SCENE_FLAG={'name':a34_0x4a6bb2(0x178),'type':a34_0x4a6bb2(0x191),'required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':a34_0x4a6bb2(0x190),'type':a34_0x4a6bb2(0x191),'description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':a34_0x4a6bb2(0x16c),'type':a34_0x4a6bb2(0x191),'description':a34_0x4a6bb2(0x16a)};function normalizeScene(_0x56c8b3){const _0xf4511e=a34_0x4a6bb2,_0x3c88a5=_0x56c8b3[_0xf4511e(0x18c)]()[_0xf4511e(0x168)]();if(_0x3c88a5==='idcard')return _0xf4511e(0x15d);if(_0x3c88a5==='invoice'||_0x3c88a5===_0xf4511e(0x16b)||_0x3c88a5===_0xf4511e(0x15e))return _0x3c88a5;throw CliErrors[_0xf4511e(0x16d)](_0xf4511e(0x183)+_0x56c8b3+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x207bd1){const _0x4bf6a1=a34_0x4a6bb2,_0x4e27e5=_0x207bd1['str'](_0x4bf6a1(0x190))[_0x4bf6a1(0x18c)](),_0x1258c8=_0x207bd1[_0x4bf6a1(0x181)]('image-url')[_0x4bf6a1(0x18c)]();return{'imageFile':_0x4e27e5,'imageUrl':_0x1258c8,'count':[_0x4e27e5,_0x1258c8]['filter'](Boolean)[_0x4bf6a1(0x167)]};}function validateInputSelection(_0x365427){const _0x3b7ba8=a34_0x4a6bb2,_0x12a6d8=selectedInputs(_0x365427);if(_0x12a6d8[_0x3b7ba8(0x18d)]!==0x1)throw CliErrors[_0x3b7ba8(0x16d)](_0x3b7ba8(0x166));return _0x12a6d8;}function withScene(_0x31422b,_0x7e6c39,_0x356586){const _0x5e6c0e=a34_0x4a6bb2;return{..._0x31422b,'scene':_0x7e6c39,..._0x356586?{'sourceFile':{'fileName':_0x356586[_0x5e6c0e(0x17b)],'filePath':_0x356586[_0x5e6c0e(0x15a)]}}:{}};}const ocrRecognize={'service':a34_0x4a6bb2(0x182),'command':'recognize','description':'Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','risk':'write','flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x15ca63){const _0xf3672d=a34_0x4a6bb2,_0x1f38de=normalizeScene(_0x15ca63[_0xf3672d(0x181)]('scene')),_0x921c2=SCENE_TO_LEGACY_TYPE[_0x1f38de],_0xb78c68=validateInputSelection(_0x15ca63);if(_0xb78c68[_0xf3672d(0x16f)])return dryRun(_0xf3672d(0x15f),_0xf3672d(0x17d))[_0xf3672d(0x160)]({'appCode':_0x15ca63[_0xf3672d(0x164)],'url':_0xb78c68[_0xf3672d(0x16f)],'type':_0x921c2})[_0xf3672d(0x189)](_0xf3672d(0x18b)+_0x1f38de+_0xf3672d(0x165))[_0xf3672d(0x15c)]();const _0x12ab14=requireRuntimeUploadFile(_0xb78c68[_0xf3672d(0x186)],_0xf3672d(0x190));return dryRun(_0xf3672d(0x15f),_0xf3672d(0x17e))[_0xf3672d(0x160)]({'steps':[{'method':'POST','url':_0xf3672d(0x17e),'body':{'appCode':_0x15ca63[_0xf3672d(0x164)],'multipart':{'file':_0x12ab14}}},{'method':_0xf3672d(0x15f),'url':_0xf3672d(0x176),'body':{'filePath':_0xf3672d(0x184),'downloadFlag':![]}},{'method':_0xf3672d(0x15f),'url':'/client/ocr','body':{'appCode':_0x15ca63[_0xf3672d(0x164)],'url':_0xf3672d(0x17a),'type':_0x921c2}}]})[_0xf3672d(0x189)](_0xf3672d(0x18e)+_0x1f38de+_0xf3672d(0x161))[_0xf3672d(0x15c)]();},async 'execute'(_0x55353f){const _0x313e07=a34_0x4a6bb2,_0x32f26b=normalizeScene(_0x55353f['str'](_0x313e07(0x178))),_0x550c58=SCENE_TO_LEGACY_TYPE[_0x32f26b],_0xc6bf05=validateInputSelection(_0x55353f);if(_0xc6bf05[_0x313e07(0x16f)]){const _0x4c6f1f=await recognizeRuntimeOcr(_0x55353f[_0x313e07(0x164)],{'url':_0xc6bf05['imageUrl'],'type':_0x550c58});return{'ok':!![],'data':withScene(_0x4c6f1f,_0x32f26b)};}const _0x3a7059=requireRuntimeUploadFile(_0xc6bf05[_0x313e07(0x186)],_0x313e07(0x190)),_0x122970=await uploadRuntimeFile(_0x55353f[_0x313e07(0x164)],_0x3a7059[_0x313e07(0x177)]);if(!_0x122970[_0x313e07(0x15a)])throw CliErrors['apiError'](_0x313e07(0x18f));const _0x3fd25b=await queryRuntimeFileUrl(_0x122970[_0x313e07(0x15a)],{'download':![]});if(!_0x3fd25b[_0x313e07(0x16e)])throw CliErrors[_0x313e07(0x163)](_0x313e07(0x179));const _0x45dd4d=await recognizeRuntimeOcr(_0x55353f['appCode'],{'url':_0x3fd25b['fileUrl'],'type':_0x550c58});return{'ok':!![],'data':withScene(_0x45dd4d,_0x32f26b,_0x122970)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a34_0x139e0d=a34_0x29a8;function a34_0xb370(){const _0x16aa26=['1125quhHMq','Invoice','general','idCard','form','Preview:\x20recognize\x20','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','/client/queryFileUrl','ocr','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','File\x20upload\x20response\x20missing\x20filePath.','612452UiqCKd','image-file','Table','scene','description','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','/client/ocr','build','21QNXfVK','2AGeOPq','count','General','trim','<filePath\x20returned\x20by\x20/client/uploadFile>','imageUrl','5345qonJYd','invoice','image-url','File\x20URL\x20response\x20missing\x20fileUrl.','/client/uploadFile','1073568YhVOsR','POST','body','\x20OCR','12469368NCIldY','Unsupported\x20OCR\x20scene:\x20','fileName','filter','apiError','297820hIWbyM','validation','2372tyhpBg','imageFile','path','IdCard','appCode','string','str','3282eDQgyq','recognize','toLowerCase','1870473efDwbo','write','Publicly\x20accessible\x20image\x20or\x20file\x20URL','\x20OCR\x20from\x20URL','90bwtTBL','filePath','fileUrl','.\x20Supported\x20scenes:\x20'];a34_0xb370=function(){return _0x16aa26;};return a34_0xb370();}(function(_0x3e7bf4,_0x4d8170){const _0xba229b=a34_0x29a8,_0x473a33=_0x3e7bf4();while(!![]){try{const _0x5d0721=parseInt(_0xba229b(0x15b))/0x1*(parseInt(_0xba229b(0x164))/0x2)+-parseInt(_0xba229b(0x150))/0x3*(parseInt(_0xba229b(0x17a))/0x4)+-parseInt(_0xba229b(0x16a))/0x5*(parseInt(_0xba229b(0x145))/0x6)+-parseInt(_0xba229b(0x163))/0x7*(parseInt(_0xba229b(0x16f))/0x8)+-parseInt(_0xba229b(0x14c))/0x9*(parseInt(_0xba229b(0x178))/0xa)+parseInt(_0xba229b(0x148))/0xb+parseInt(_0xba229b(0x173))/0xc;if(_0x5d0721===_0x4d8170)break;else _0x473a33['push'](_0x473a33['shift']());}catch(_0x1694c6){_0x473a33['push'](_0x473a33['shift']());}}}(a34_0xb370,0x4cae3));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 a34_0x29a8(_0x596806,_0x4c90a5){_0x596806=_0x596806-0x143;const _0xb370d0=a34_0xb370();let _0x29a813=_0xb370d0[_0x596806];return _0x29a813;}const SUPPORTED_SCENES=[a34_0x139e0d(0x16b),'general',a34_0x139e0d(0x154),a34_0x139e0d(0x153)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x139e0d(0x151),'general':a34_0x139e0d(0x166),'form':a34_0x139e0d(0x15d),'idCard':a34_0x139e0d(0x17d)},SCENE_FLAG={'name':a34_0x139e0d(0x15e),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':a34_0x139e0d(0x15c),'type':a34_0x139e0d(0x143),'description':a34_0x139e0d(0x156)},IMAGE_URL_FLAG={'name':a34_0x139e0d(0x16c),'type':a34_0x139e0d(0x143),'description':a34_0x139e0d(0x14a)};function normalizeScene(_0x310873){const _0x20e68c=a34_0x139e0d,_0x5e8838=_0x310873[_0x20e68c(0x167)]()[_0x20e68c(0x147)]();if(_0x5e8838==='idcard')return _0x20e68c(0x153);if(_0x5e8838===_0x20e68c(0x16b)||_0x5e8838===_0x20e68c(0x152)||_0x5e8838===_0x20e68c(0x154))return _0x5e8838;throw CliErrors[_0x20e68c(0x179)](_0x20e68c(0x174)+_0x310873+_0x20e68c(0x14f)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x3d2646){const _0x20d311=a34_0x139e0d,_0x59394f=_0x3d2646[_0x20d311(0x144)](_0x20d311(0x15c))[_0x20d311(0x167)](),_0x40ce09=_0x3d2646['str'](_0x20d311(0x16c))[_0x20d311(0x167)]();return{'imageFile':_0x59394f,'imageUrl':_0x40ce09,'count':[_0x59394f,_0x40ce09][_0x20d311(0x176)](Boolean)['length']};}function validateInputSelection(_0x2cf7db){const _0x1dbce2=a34_0x139e0d,_0x4c081e=selectedInputs(_0x2cf7db);if(_0x4c081e[_0x1dbce2(0x165)]!==0x1)throw CliErrors[_0x1dbce2(0x179)](_0x1dbce2(0x159));return _0x4c081e;}function withScene(_0x13c515,_0x3acbf8,_0xe96c64){const _0x5e68dd=a34_0x139e0d;return{..._0x13c515,'scene':_0x3acbf8,..._0xe96c64?{'sourceFile':{'fileName':_0xe96c64[_0x5e68dd(0x175)],'filePath':_0xe96c64[_0x5e68dd(0x14d)]}}:{}};}const ocrRecognize={'service':a34_0x139e0d(0x158),'command':a34_0x139e0d(0x146),'description':'Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','risk':a34_0x139e0d(0x149),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x9fa4d1){const _0x41d9a3=a34_0x139e0d,_0x2d4b46=normalizeScene(_0x9fa4d1[_0x41d9a3(0x144)](_0x41d9a3(0x15e))),_0x3ed60e=SCENE_TO_LEGACY_TYPE[_0x2d4b46],_0x129025=validateInputSelection(_0x9fa4d1);if(_0x129025[_0x41d9a3(0x169)])return dryRun('POST',_0x41d9a3(0x161))[_0x41d9a3(0x171)]({'appCode':_0x9fa4d1[_0x41d9a3(0x17e)],'url':_0x129025[_0x41d9a3(0x169)],'type':_0x3ed60e})[_0x41d9a3(0x15f)](_0x41d9a3(0x155)+_0x2d4b46+_0x41d9a3(0x14b))[_0x41d9a3(0x162)]();const _0x4b30cf=requireRuntimeUploadFile(_0x129025['imageFile'],'image-file');return dryRun(_0x41d9a3(0x170),'/client/uploadFile')[_0x41d9a3(0x171)]({'steps':[{'method':_0x41d9a3(0x170),'url':_0x41d9a3(0x16e),'body':{'appCode':_0x9fa4d1[_0x41d9a3(0x17e)],'multipart':{'file':_0x4b30cf}}},{'method':'POST','url':_0x41d9a3(0x157),'body':{'filePath':_0x41d9a3(0x168),'downloadFlag':![]}},{'method':_0x41d9a3(0x170),'url':_0x41d9a3(0x161),'body':{'appCode':_0x9fa4d1[_0x41d9a3(0x17e)],'url':'<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','type':_0x3ed60e}}]})['description'](_0x41d9a3(0x160)+_0x2d4b46+_0x41d9a3(0x172))[_0x41d9a3(0x162)]();},async 'execute'(_0x2f2c11){const _0x29fa1a=a34_0x139e0d,_0x4b845e=normalizeScene(_0x2f2c11['str'](_0x29fa1a(0x15e))),_0x16fa2b=SCENE_TO_LEGACY_TYPE[_0x4b845e],_0x1070a2=validateInputSelection(_0x2f2c11);if(_0x1070a2[_0x29fa1a(0x169)]){const _0x350ead=await recognizeRuntimeOcr(_0x2f2c11[_0x29fa1a(0x17e)],{'url':_0x1070a2[_0x29fa1a(0x169)],'type':_0x16fa2b});return{'ok':!![],'data':withScene(_0x350ead,_0x4b845e)};}const _0x188fa7=requireRuntimeUploadFile(_0x1070a2[_0x29fa1a(0x17b)],_0x29fa1a(0x15c)),_0x5470af=await uploadRuntimeFile(_0x2f2c11[_0x29fa1a(0x17e)],_0x188fa7[_0x29fa1a(0x17c)]);if(!_0x5470af['filePath'])throw CliErrors[_0x29fa1a(0x177)](_0x29fa1a(0x15a));const _0x17161d=await queryRuntimeFileUrl(_0x5470af[_0x29fa1a(0x14d)],{'download':![]});if(!_0x17161d['fileUrl'])throw CliErrors['apiError'](_0x29fa1a(0x16d));const _0x56dc5f=await recognizeRuntimeOcr(_0x2f2c11['appCode'],{'url':_0x17161d[_0x29fa1a(0x14e)],'type':_0x16fa2b});return{'ok':!![],'data':withScene(_0x56dc5f,_0x4b845e,_0x5470af)};}};export const ocrDefinitions=[ocrRecognize];
@@ -1 +1 @@
1
- const a35_0x106e1c=a35_0x2bb9;(function(_0x2e94f5,_0x27bfa7){const _0x2a2627=a35_0x2bb9,_0x278d81=_0x2e94f5();while(!![]){try{const _0x49fcfb=parseInt(_0x2a2627(0x12e))/0x1+-parseInt(_0x2a2627(0x121))/0x2*(parseInt(_0x2a2627(0x130))/0x3)+-parseInt(_0x2a2627(0x14a))/0x4+parseInt(_0x2a2627(0x115))/0x5+-parseInt(_0x2a2627(0x114))/0x6*(parseInt(_0x2a2627(0x119))/0x7)+parseInt(_0x2a2627(0x123))/0x8*(parseInt(_0x2a2627(0x14d))/0x9)+parseInt(_0x2a2627(0x132))/0xa;if(_0x49fcfb===_0x27bfa7)break;else _0x278d81['push'](_0x278d81['shift']());}catch(_0x319255){_0x278d81['push'](_0x278d81['shift']());}}}(a35_0x3015,0xb2732));import{existsSync,readFileSync,statSync}from'node:fs';function a35_0x2bb9(_0x348704,_0x7c0d6){_0x348704=_0x348704-0x114;const _0x30152d=a35_0x3015();let _0x2bb997=_0x30152d[_0x348704];return _0x2bb997;}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_0x106e1c(0x147),'type':a35_0x106e1c(0x13d),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':'name','type':'string','required':!![],'description':a35_0x106e1c(0x120)},DESCRIPTION_FLAG={'name':'description','type':'string','description':a35_0x106e1c(0x13f)},SOURCE_SESSION_FLAG={'name':a35_0x106e1c(0x11c),'type':a35_0x106e1c(0x13d),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function a35_0x3015(){const _0x522fcb=['updateTime','Created\x20personal\x20BFF\x20','2803213sYXiPp','validation','write','source-session-id','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','read','/client/runtime-bff/personal/create','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','2695192aZFrpo','update','8xUMGhy','functionName','gmtModified','Updated\x20personal\x20BFF\x20','bool','body','build','createTime','verbose','Executed\x20personal\x20BFF\x20','sourceSessionId','60815wPNHxc','high-risk-write','3AAvRNv','scriptContent','30585750EOFOTn','/update','list','File\x20path\x20is\x20required.','Personal\x20BFF\x20script\x20file\x20is\x20blank.','test','File\x20not\x20found:\x20','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','personal-bff','Show\x20one\x20personal\x20BFF\x20by\x20id','string','description','Personal\x20BFF\x20description','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','Preview:\x20update\x20personal\x20BFF\x20','params','config','scriptType','str','/client/runtime-bff/personal/','file','appCode','flag','2966012tvlWwI','length','isFile','6801534juaRgx','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','utf8','POST','version','Personal\x20BFF\x20script\x20ID','--params\x20must\x20be\x20a\x20JSON\x20object.','exec','trim','18hnNjNg','731450prbNCQ','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params'];a35_0x3015=function(){return _0x522fcb;};return a35_0x3015();}function normalizeFunctionName(_0x5d8972){const _0x27328b=a35_0x106e1c,_0x470e5b=String(_0x5d8972||'')['trim']();if(!_0x470e5b||!FUNCTION_NAME_PATTERN[_0x27328b(0x137)](_0x470e5b))throw CliErrors[_0x27328b(0x11a)](_0x27328b(0x13a));return _0x470e5b;}function readScriptFile(_0x2a9040){const _0x3f549d=a35_0x106e1c;if(!_0x2a9040)throw CliErrors[_0x3f549d(0x11a)](_0x3f549d(0x135));if(!existsSync(_0x2a9040))throw CliErrors[_0x3f549d(0x11a)](_0x3f549d(0x138)+_0x2a9040);if(!statSync(_0x2a9040)[_0x3f549d(0x14c)]())throw CliErrors[_0x3f549d(0x11a)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x2a9040);const _0xbcf701=readFileSync(_0x2a9040,_0x3f549d(0x14f));if(!_0xbcf701[_0x3f549d(0x155)]())throw CliErrors[_0x3f549d(0x11a)](_0x3f549d(0x136));return _0xbcf701;}function optionalTrimmed(_0x52369b){const _0x28d361=String(_0x52369b||'')['trim']();return _0x28d361||undefined;}function summarizeBff(_0x29f658){const _0x40a725=a35_0x106e1c;return{'id':_0x29f658['id'],'appCode':_0x29f658[_0x40a725(0x148)],'functionName':_0x29f658[_0x40a725(0x124)],'description':_0x29f658[_0x40a725(0x13e)],'scriptType':_0x29f658[_0x40a725(0x144)],'version':_0x29f658[_0x40a725(0x151)],'gmtModified':_0x29f658['gmtModified'],'updateTime':_0x29f658[_0x40a725(0x117)]};}function detailBff(_0x5b2789){const _0x28c523=a35_0x106e1c;return{'id':_0x5b2789['id'],'appCode':_0x5b2789['appCode'],'functionName':_0x5b2789[_0x28c523(0x124)],'description':_0x5b2789[_0x28c523(0x13e)],'scriptType':_0x5b2789['scriptType'],'scriptContent':_0x5b2789[_0x28c523(0x131)]??'','config':_0x5b2789[_0x28c523(0x143)],'version':_0x5b2789['version'],'createUserId':_0x5b2789['createUserId'],'gmtCreate':_0x5b2789['gmtCreate'],'gmtModified':_0x5b2789[_0x28c523(0x125)],'createTime':_0x5b2789[_0x28c523(0x12a)],'updateTime':_0x5b2789[_0x28c523(0x117)]};}function buildCreateInput(_0x34aa07){const _0x58318b=a35_0x106e1c;return{'functionName':normalizeFunctionName(_0x34aa07['str']('name')),...optionalTrimmed(_0x34aa07['str'](_0x58318b(0x13e)))?{'description':optionalTrimmed(_0x34aa07[_0x58318b(0x145)](_0x58318b(0x13e)))}:{},'scriptContent':readScriptFile(_0x34aa07[_0x58318b(0x145)]('file')),...optionalTrimmed(_0x34aa07[_0x58318b(0x145)](_0x58318b(0x11c)))?{'sourceSessionId':optionalTrimmed(_0x34aa07[_0x58318b(0x145)](_0x58318b(0x11c)))}:{}};}function buildUpdateInput(_0x42c3bc){const _0x1c97d1=a35_0x106e1c,_0xa4820d={};optionalTrimmed(_0x42c3bc[_0x1c97d1(0x145)]('name'))&&(_0xa4820d[_0x1c97d1(0x124)]=normalizeFunctionName(_0x42c3bc[_0x1c97d1(0x145)]('name')));_0x42c3bc['flag'](_0x1c97d1(0x13e))!==undefined&&(_0xa4820d[_0x1c97d1(0x13e)]=_0x42c3bc[_0x1c97d1(0x145)](_0x1c97d1(0x13e)));optionalTrimmed(_0x42c3bc[_0x1c97d1(0x145)]('file'))&&(_0xa4820d['scriptContent']=readScriptFile(_0x42c3bc['str'](_0x1c97d1(0x147))));_0x42c3bc[_0x1c97d1(0x149)](_0x1c97d1(0x11c))!==undefined&&(_0xa4820d[_0x1c97d1(0x12d)]=_0x42c3bc[_0x1c97d1(0x145)]('source-session-id'));if(Object['keys'](_0xa4820d)[_0x1c97d1(0x14b)]===0x0)throw CliErrors['validation'](_0x1c97d1(0x140));return _0xa4820d;}function parseExecParams(_0x2f00f3){const _0x575bb2=a35_0x106e1c,_0x7c4232=parseJsonParams(_0x2f00f3)??{};if(Array['isArray'](_0x7c4232))throw CliErrors[_0x575bb2(0x11a)](_0x575bb2(0x153));return _0x7c4232;}const personalBffList={'service':'personal-bff','command':a35_0x106e1c(0x134),'description':a35_0x106e1c(0x14e),'risk':a35_0x106e1c(0x11e),'flags':[VERBOSE_FLAG],async 'execute'(_0x144c2f){const _0x3ffeaa=a35_0x106e1c,_0x317c7c=await listPersonalBffs(_0x144c2f[_0x3ffeaa(0x148)]);return{'ok':!![],'data':{'total':_0x317c7c[_0x3ffeaa(0x14b)],'items':_0x144c2f[_0x3ffeaa(0x127)](_0x3ffeaa(0x12b))?_0x317c7c:_0x317c7c['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x106e1c(0x13b),'command':'detail','description':a35_0x106e1c(0x13c),'risk':a35_0x106e1c(0x11e),'flags':[{...ID_FLAG,'description':a35_0x106e1c(0x152)}],async 'execute'(_0x3a3ff1){const _0x54c943=await getPersonalBff(_0x3a3ff1['num']('id'),_0x3a3ff1['appCode']);return{'ok':!![],'data':detailBff(_0x54c943)};}},personalBffCreate={'service':a35_0x106e1c(0x13b),'command':'create','description':a35_0x106e1c(0x11d),'risk':'write','flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x34ad67){const _0x49edd1=a35_0x106e1c,_0x2d9a62=buildCreateInput(_0x34ad67),_0x464a9f=await createPersonalBff(_0x34ad67['appCode'],_0x2d9a62);return{'ok':!![],'data':detailBff(_0x464a9f),'message':_0x49edd1(0x118)+_0x464a9f['id']+(_0x464a9f['functionName']?'\x20('+_0x464a9f[_0x49edd1(0x124)]+')':'')};},async 'dryRun'(_0x35ad94){const _0x288ad0=a35_0x106e1c,_0x38ea57=buildCreateInput(_0x35ad94);return dryRun(_0x288ad0(0x150),_0x288ad0(0x11f))[_0x288ad0(0x128)]({'appCode':_0x35ad94[_0x288ad0(0x148)],..._0x38ea57})['description']('Preview:\x20create\x20personal\x20BFF\x20'+_0x38ea57[_0x288ad0(0x124)])[_0x288ad0(0x129)]();}},personalBffUpdate={'service':a35_0x106e1c(0x13b),'command':a35_0x106e1c(0x122),'description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':a35_0x106e1c(0x11b),'flags':[{...ID_FLAG,'description':a35_0x106e1c(0x152)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xf5a795){const _0xa0bbb9=a35_0x106e1c,_0x5bfc2a=_0xf5a795['num']('id'),_0x86f9ca=buildUpdateInput(_0xf5a795),_0xe95de0=await updatePersonalBff(_0x5bfc2a,_0xf5a795[_0xa0bbb9(0x148)],_0x86f9ca);return{'ok':!![],'data':detailBff(_0xe95de0),'message':_0xa0bbb9(0x126)+_0xe95de0['id']+(_0xe95de0[_0xa0bbb9(0x124)]?'\x20('+_0xe95de0[_0xa0bbb9(0x124)]+')':'')};},async 'dryRun'(_0x3708ce){const _0x4b7cd5=a35_0x106e1c,_0x26a85e=_0x3708ce['num']('id'),_0x592c79=buildUpdateInput(_0x3708ce);return dryRun(_0x4b7cd5(0x150),_0x4b7cd5(0x146)+_0x26a85e+_0x4b7cd5(0x133))[_0x4b7cd5(0x128)]({'appCode':_0x3708ce[_0x4b7cd5(0x148)],..._0x592c79})[_0x4b7cd5(0x13e)](_0x4b7cd5(0x141)+_0x26a85e)[_0x4b7cd5(0x129)]();}},personalBffExec={'service':a35_0x106e1c(0x13b),'command':a35_0x106e1c(0x154),'description':a35_0x106e1c(0x116),'risk':a35_0x106e1c(0x12f),'flags':[{...ID_FLAG,'description':a35_0x106e1c(0x152)},{...PARAMS_FLAG,'description':a35_0x106e1c(0x139)}],async 'validate'(_0x14c4e0){const _0x445140=a35_0x106e1c;parseExecParams(_0x14c4e0[_0x445140(0x145)]('params'));},async 'execute'(_0x5ac394){const _0x48936e=a35_0x106e1c,_0x210a42=_0x5ac394['num']('id'),_0x18a3b6=parseExecParams(_0x5ac394[_0x48936e(0x145)](_0x48936e(0x142))),_0x3f9441=await executePersonalBff(_0x210a42,_0x5ac394[_0x48936e(0x148)],_0x18a3b6);return{'ok':!![],'data':{'result':_0x3f9441},'message':_0x48936e(0x12c)+_0x210a42};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
1
+ const a35_0x3e8ed3=a35_0x4761;(function(_0x4e4fed,_0x317629){const _0xc1f36d=a35_0x4761,_0x150cc5=_0x4e4fed();while(!![]){try{const _0x1efbcb=parseInt(_0xc1f36d(0xf0))/0x1*(-parseInt(_0xc1f36d(0x121))/0x2)+parseInt(_0xc1f36d(0x114))/0x3*(-parseInt(_0xc1f36d(0xee))/0x4)+-parseInt(_0xc1f36d(0xf5))/0x5*(parseInt(_0xc1f36d(0x102))/0x6)+-parseInt(_0xc1f36d(0xea))/0x7*(parseInt(_0xc1f36d(0xf3))/0x8)+-parseInt(_0xc1f36d(0x11f))/0x9*(parseInt(_0xc1f36d(0x103))/0xa)+-parseInt(_0xc1f36d(0xde))/0xb*(-parseInt(_0xc1f36d(0xff))/0xc)+-parseInt(_0xc1f36d(0x106))/0xd*(-parseInt(_0xc1f36d(0xfd))/0xe);if(_0x1efbcb===_0x317629)break;else _0x150cc5['push'](_0x150cc5['shift']());}catch(_0x59f635){_0x150cc5['push'](_0x150cc5['shift']());}}}(a35_0x23c6,0xe795b));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x23c6(){const _0x1ceaf7=['test','File\x20is\x20not\x20a\x20regular\x20file:\x20','read','Created\x20personal\x20BFF\x20','write','appCode','description','5297262tLzxSt','scriptType','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','trim','update','/update','body','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','bool','string','config','726183mBMODo','str','770KHkjvt','Personal\x20BFF\x20description','POST','Updated\x20personal\x20BFF\x20','43175xlNYze','name','Update\x20a\x20personal\x20BFF\x20by\x20id','flag','keys','isArray','scriptContent','Personal\x20BFF\x20script\x20ID','File\x20path\x20is\x20required.','source-session-id','Preview:\x20create\x20personal\x20BFF\x20','File\x20not\x20found:\x20','168NBCzmO','build','Preview:\x20update\x20personal\x20BFF\x20','high-risk-write','4wdFtDT','createTime','273EzNWnu','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','detail','109368izDSMa','num','195PBZDMW','Executed\x20personal\x20BFF\x20','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','Optional\x20source\x20RuntimeAgent\x20session\x20id','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','file','version','sourceSessionId','1582jUPwxZ','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','2004JLpfQq','updateTime','verbose','77340hYozon','140HxFoMw','create','validation','474487kdVdUQ','personal-bff','functionName','utf8','length','params','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params'];a35_0x23c6=function(){return _0x1ceaf7;};return a35_0x23c6();}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_0x3e8ed3(0xfa),'type':a35_0x3e8ed3(0x11d),'description':a35_0x3e8ed3(0x116)},FUNCTION_NAME_FLAG={'name':a35_0x3e8ed3(0xdf),'type':a35_0x3e8ed3(0x11d),'required':!![],'description':a35_0x3e8ed3(0xf1)},DESCRIPTION_FLAG={'name':a35_0x3e8ed3(0x113),'type':a35_0x3e8ed3(0x11d),'description':a35_0x3e8ed3(0xdb)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0x3e8ed3(0x11d),'description':a35_0x3e8ed3(0xf8)};function normalizeFunctionName(_0xb75366){const _0x12182d=a35_0x3e8ed3,_0x289ebf=String(_0xb75366||'')[_0x12182d(0x117)]();if(!_0x289ebf||!FUNCTION_NAME_PATTERN[_0x12182d(0x10d)](_0x289ebf))throw CliErrors['validation'](_0x12182d(0xf9));return _0x289ebf;}function readScriptFile(_0x78d15){const _0x1f8754=a35_0x3e8ed3;if(!_0x78d15)throw CliErrors['validation'](_0x1f8754(0xe6));if(!existsSync(_0x78d15))throw CliErrors[_0x1f8754(0x105)](_0x1f8754(0xe9)+_0x78d15);if(!statSync(_0x78d15)['isFile']())throw CliErrors[_0x1f8754(0x105)](_0x1f8754(0x10e)+_0x78d15);const _0x35bafa=readFileSync(_0x78d15,_0x1f8754(0x109));if(!_0x35bafa[_0x1f8754(0x117)]())throw CliErrors[_0x1f8754(0x105)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x35bafa;}function optionalTrimmed(_0x137ace){const _0x63f560=String(_0x137ace||'')['trim']();return _0x63f560||undefined;}function summarizeBff(_0x2c4a40){const _0x1e4aa5=a35_0x3e8ed3;return{'id':_0x2c4a40['id'],'appCode':_0x2c4a40['appCode'],'functionName':_0x2c4a40[_0x1e4aa5(0x108)],'description':_0x2c4a40[_0x1e4aa5(0x113)],'scriptType':_0x2c4a40['scriptType'],'version':_0x2c4a40[_0x1e4aa5(0xfb)],'gmtModified':_0x2c4a40['gmtModified'],'updateTime':_0x2c4a40[_0x1e4aa5(0x100)]};}function detailBff(_0x55c8c9){const _0x3274a5=a35_0x3e8ed3;return{'id':_0x55c8c9['id'],'appCode':_0x55c8c9[_0x3274a5(0x112)],'functionName':_0x55c8c9['functionName'],'description':_0x55c8c9[_0x3274a5(0x113)],'scriptType':_0x55c8c9[_0x3274a5(0x115)],'scriptContent':_0x55c8c9[_0x3274a5(0xe4)]??'','config':_0x55c8c9[_0x3274a5(0x11e)],'version':_0x55c8c9[_0x3274a5(0xfb)],'createUserId':_0x55c8c9['createUserId'],'gmtCreate':_0x55c8c9['gmtCreate'],'gmtModified':_0x55c8c9['gmtModified'],'createTime':_0x55c8c9[_0x3274a5(0xef)],'updateTime':_0x55c8c9[_0x3274a5(0x100)]};}function a35_0x4761(_0x556335,_0x27ad80){_0x556335=_0x556335-0xdb;const _0x23c66a=a35_0x23c6();let _0x476122=_0x23c66a[_0x556335];return _0x476122;}function buildCreateInput(_0x53ac45){const _0x8c3445=a35_0x3e8ed3;return{'functionName':normalizeFunctionName(_0x53ac45[_0x8c3445(0x120)](_0x8c3445(0xdf))),...optionalTrimmed(_0x53ac45[_0x8c3445(0x120)]('description'))?{'description':optionalTrimmed(_0x53ac45['str'](_0x8c3445(0x113)))}:{},'scriptContent':readScriptFile(_0x53ac45[_0x8c3445(0x120)](_0x8c3445(0xfa))),...optionalTrimmed(_0x53ac45[_0x8c3445(0x120)](_0x8c3445(0xe7)))?{'sourceSessionId':optionalTrimmed(_0x53ac45[_0x8c3445(0x120)](_0x8c3445(0xe7)))}:{}};}function buildUpdateInput(_0x26e015){const _0x161e49=a35_0x3e8ed3,_0x326cd7={};optionalTrimmed(_0x26e015[_0x161e49(0x120)](_0x161e49(0xdf)))&&(_0x326cd7[_0x161e49(0x108)]=normalizeFunctionName(_0x26e015['str'](_0x161e49(0xdf))));_0x26e015[_0x161e49(0xe1)]('description')!==undefined&&(_0x326cd7[_0x161e49(0x113)]=_0x26e015[_0x161e49(0x120)]('description'));optionalTrimmed(_0x26e015['str']('file'))&&(_0x326cd7[_0x161e49(0xe4)]=readScriptFile(_0x26e015[_0x161e49(0x120)]('file')));_0x26e015[_0x161e49(0xe1)](_0x161e49(0xe7))!==undefined&&(_0x326cd7[_0x161e49(0xfc)]=_0x26e015['str']('source-session-id'));if(Object[_0x161e49(0xe2)](_0x326cd7)[_0x161e49(0x10a)]===0x0)throw CliErrors[_0x161e49(0x105)](_0x161e49(0x11b));return _0x326cd7;}function parseExecParams(_0x13a797){const _0x1f60b9=a35_0x3e8ed3,_0xb76740=parseJsonParams(_0x13a797)??{};if(Array[_0x1f60b9(0xe3)](_0xb76740))throw CliErrors[_0x1f60b9(0x105)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0xb76740;}const personalBffList={'service':'personal-bff','command':'list','description':a35_0x3e8ed3(0xf7),'risk':a35_0x3e8ed3(0x10f),'flags':[VERBOSE_FLAG],async 'execute'(_0x4b573d){const _0x1fa63f=a35_0x3e8ed3,_0x2b0b66=await listPersonalBffs(_0x4b573d[_0x1fa63f(0x112)]);return{'ok':!![],'data':{'total':_0x2b0b66[_0x1fa63f(0x10a)],'items':_0x4b573d[_0x1fa63f(0x11c)](_0x1fa63f(0x101))?_0x2b0b66:_0x2b0b66['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x3e8ed3(0x107),'command':a35_0x3e8ed3(0xf2),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':a35_0x3e8ed3(0x10f),'flags':[{...ID_FLAG,'description':a35_0x3e8ed3(0xe5)}],async 'execute'(_0x563548){const _0xbbda51=a35_0x3e8ed3,_0x28e0ae=await getPersonalBff(_0x563548[_0xbbda51(0xf4)]('id'),_0x563548[_0xbbda51(0x112)]);return{'ok':!![],'data':detailBff(_0x28e0ae)};}},personalBffCreate={'service':a35_0x3e8ed3(0x107),'command':a35_0x3e8ed3(0x104),'description':a35_0x3e8ed3(0xfe),'risk':a35_0x3e8ed3(0x111),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x29d8a4){const _0x1375af=a35_0x3e8ed3,_0x2677cb=buildCreateInput(_0x29d8a4),_0xd247f4=await createPersonalBff(_0x29d8a4[_0x1375af(0x112)],_0x2677cb);return{'ok':!![],'data':detailBff(_0xd247f4),'message':_0x1375af(0x110)+_0xd247f4['id']+(_0xd247f4[_0x1375af(0x108)]?'\x20('+_0xd247f4[_0x1375af(0x108)]+')':'')};},async 'dryRun'(_0x7dab0f){const _0x41dfc9=a35_0x3e8ed3,_0x21211b=buildCreateInput(_0x7dab0f);return dryRun(_0x41dfc9(0xdc),'/client/runtime-bff/personal/create')[_0x41dfc9(0x11a)]({'appCode':_0x7dab0f['appCode'],..._0x21211b})[_0x41dfc9(0x113)](_0x41dfc9(0xe8)+_0x21211b[_0x41dfc9(0x108)])['build']();}},personalBffUpdate={'service':a35_0x3e8ed3(0x107),'command':a35_0x3e8ed3(0x118),'description':a35_0x3e8ed3(0xe0),'risk':a35_0x3e8ed3(0x111),'flags':[{...ID_FLAG,'description':a35_0x3e8ed3(0xe5)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x4cb73c){const _0x127998=a35_0x3e8ed3,_0x2e5e65=_0x4cb73c[_0x127998(0xf4)]('id'),_0x10e2d2=buildUpdateInput(_0x4cb73c),_0x4b102a=await updatePersonalBff(_0x2e5e65,_0x4cb73c['appCode'],_0x10e2d2);return{'ok':!![],'data':detailBff(_0x4b102a),'message':_0x127998(0xdd)+_0x4b102a['id']+(_0x4b102a['functionName']?'\x20('+_0x4b102a[_0x127998(0x108)]+')':'')};},async 'dryRun'(_0x328202){const _0x1b76d2=a35_0x3e8ed3,_0xeba996=_0x328202[_0x1b76d2(0xf4)]('id'),_0x1b2850=buildUpdateInput(_0x328202);return dryRun(_0x1b76d2(0xdc),'/client/runtime-bff/personal/'+_0xeba996+_0x1b76d2(0x119))[_0x1b76d2(0x11a)]({'appCode':_0x328202['appCode'],..._0x1b2850})['description'](_0x1b76d2(0xec)+_0xeba996)[_0x1b76d2(0xeb)]();}},personalBffExec={'service':a35_0x3e8ed3(0x107),'command':'exec','description':a35_0x3e8ed3(0x10c),'risk':a35_0x3e8ed3(0xed),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x2dcdeb){const _0x5b688e=a35_0x3e8ed3;parseExecParams(_0x2dcdeb[_0x5b688e(0x120)](_0x5b688e(0x10b)));},async 'execute'(_0x515851){const _0x14f539=a35_0x3e8ed3,_0x13a1f7=_0x515851[_0x14f539(0xf4)]('id'),_0x513a76=parseExecParams(_0x515851[_0x14f539(0x120)](_0x14f539(0x10b))),_0x55a4de=await executePersonalBff(_0x13a1f7,_0x515851[_0x14f539(0x112)],_0x513a76);return{'ok':!![],'data':{'result':_0x55a4de},'message':_0x14f539(0xf6)+_0x13a1f7};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
@@ -1 +1 @@
1
- const a36_0x1bf5fb=a36_0x22e7;(function(_0x3dd677,_0x594606){const _0x46e304=a36_0x22e7,_0x232ef5=_0x3dd677();while(!![]){try{const _0x253ecb=parseInt(_0x46e304(0x8b))/0x1+parseInt(_0x46e304(0x9e))/0x2*(parseInt(_0x46e304(0x9c))/0x3)+parseInt(_0x46e304(0x7c))/0x4*(-parseInt(_0x46e304(0x79))/0x5)+-parseInt(_0x46e304(0x78))/0x6*(parseInt(_0x46e304(0x76))/0x7)+parseInt(_0x46e304(0x8e))/0x8+-parseInt(_0x46e304(0x9a))/0x9+-parseInt(_0x46e304(0x75))/0xa*(-parseInt(_0x46e304(0x92))/0xb);if(_0x253ecb===_0x594606)break;else _0x232ef5['push'](_0x232ef5['shift']());}catch(_0xf113bf){_0x232ef5['push'](_0x232ef5['shift']());}}}(a36_0xc3c9,0x3afc8));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];function a36_0x22e7(_0x3b98d7,_0x4bb6b8){_0x3b98d7=_0x3b98d7-0x74;const _0xc3c999=a36_0xc3c9();let _0x22e7bf=_0xc3c999[_0x3b98d7];return _0x22e7bf;}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x4403f5){const _0x10e65a=a36_0x22e7;for(const _0x5408ae of _0x4403f5){definitions['set'](_0x5408ae[_0x10e65a(0x83)]+':'+_0x5408ae[_0x10e65a(0x98)],_0x5408ae);let _0x2d0fbf=serviceGroups[_0x10e65a(0x7d)](_0x5408ae[_0x10e65a(0x83)]);!_0x2d0fbf&&(_0x2d0fbf=[],serviceGroups[_0x10e65a(0x95)](_0x5408ae[_0x10e65a(0x83)],_0x2d0fbf)),_0x2d0fbf[_0x10e65a(0x94)](_0x5408ae);}}function registerService(_0x3dba15,_0x8f862f,_0x56b633){const _0x3438ba=a36_0x22e7;registerDefinitions(_0x8f862f);const _0x4423a8=_0x2efb95=>_0x2efb95===_0x3438ba(0x8f)?'':_0x2efb95===_0x3438ba(0x85)?_0x3438ba(0x7b):_0x3438ba(0x7f),_0x2ae650={'service':_0x8f862f[0x0]['service'],'label':_0x3dba15,'commands':_0x8f862f[_0x3438ba(0x9f)](_0x529bc4=>({'command':_0x529bc4[_0x3438ba(0x98)],'description':_0x529bc4['description'],'tag':_0x4423a8(_0x529bc4['risk'])})),'defaultCommand':_0x56b633?.[_0x3438ba(0x90)]??(_0x56b633?.['isSingleCommand']?_0x8f862f[0x0]['command']:undefined),'isSingleCommand':_0x56b633?.[_0x3438ba(0xa0)]};serviceRegistry['push'](_0x2ae650),serviceByName[_0x3438ba(0x95)](_0x2ae650[_0x3438ba(0x83)],_0x2ae650);}function a36_0xc3c9(){const _0x2a6914=['map','isSingleCommand','Self\x20Update','Configuration','Schema','55730usgGmY','112kPTrXb','Service\x20Tree','125694YqDgjL','5DAkFbv','Workspace','\x20\x20[write]','971744nHNrHf','get','SQL\x20Queries','\x20\x20[high-risk-write]','Runtime\x20App\x20Config','BFF\x20Scripts','API\x20Documentation','service','Knowledge\x20Base','write','has','CLI\x20Built-in\x20Skill','values','Datasets','Instant\x20API','474271aLCTey','show','File','2606544rxFvoQ','read','defaultCommand','from','803ZkymBv','login','push','set','App\x20Management','Skills','command','list','4324068lmppOZ','run','633WvmSPf','Authentication','884aWZvFN'];a36_0xc3c9=function(){return _0x2a6914;};return a36_0xc3c9();}registerService(a36_0x1bf5fb(0x9d),authDefinitions,{'defaultCommand':a36_0x1bf5fb(0x93)}),registerService(a36_0x1bf5fb(0x96),appDefinitions,{'defaultCommand':'list'}),registerService(a36_0x1bf5fb(0x7a),workspaceDefinitions),registerService(a36_0x1bf5fb(0x80),appConfigDefinitions),registerService(a36_0x1bf5fb(0xa2),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x1bf5fb(0x82),apiDocDefinitions),registerService(a36_0x1bf5fb(0x89),datasetDefinitions),registerService(a36_0x1bf5fb(0x8a),dataDefinitions),registerService(a36_0x1bf5fb(0x7e),sqlDefinitions),registerService(a36_0x1bf5fb(0x81),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x1bf5fb(0x8d),fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a36_0x1bf5fb(0x84),kbDefinitions),registerService(a36_0x1bf5fb(0x77),serviceDefinitions,{'defaultCommand':a36_0x1bf5fb(0x99)}),registerService(a36_0x1bf5fb(0x97),skillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x1bf5fb(0x87),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x1bf5fb(0xa1),[updateDefinition],{'defaultCommand':a36_0x1bf5fb(0x9b),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x1bf5fb(0x74),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a36_0x1bf5fb(0x8c)});export function findDefinition(_0x517af1,_0x33d1b1){return definitions['get'](_0x517af1+':'+_0x33d1b1);}export function isKnownService(_0x4133d0){const _0x4b4a80=a36_0x1bf5fb;return serviceByName[_0x4b4a80(0x86)](_0x4133d0);}export function getServiceEntry(_0x15cb6a){const _0x1eb4fb=a36_0x1bf5fb;return serviceByName[_0x1eb4fb(0x7d)](_0x15cb6a);}export function getAllDefinitions(){const _0x3a87dc=a36_0x1bf5fb;return Array[_0x3a87dc(0x91)](definitions[_0x3a87dc(0x88)]());}
1
+ const a36_0x487e42=a36_0x5ce6;(function(_0x47fc3b,_0xb7c590){const _0x18f855=a36_0x5ce6,_0x162aa7=_0x47fc3b();while(!![]){try{const _0x3dc0d2=parseInt(_0x18f855(0xa8))/0x1+parseInt(_0x18f855(0xae))/0x2+parseInt(_0x18f855(0xce))/0x3+-parseInt(_0x18f855(0xaa))/0x4+parseInt(_0x18f855(0xcd))/0x5+parseInt(_0x18f855(0xb7))/0x6*(parseInt(_0x18f855(0xc8))/0x7)+-parseInt(_0x18f855(0xc5))/0x8*(parseInt(_0x18f855(0xc4))/0x9);if(_0x3dc0d2===_0xb7c590)break;else _0x162aa7['push'](_0x162aa7['shift']());}catch(_0x2c507f){_0x162aa7['push'](_0x162aa7['shift']());}}}(a36_0x3c0d,0x6e8c2));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';function a36_0x5ce6(_0x318018,_0x1e5156){_0x318018=_0x318018-0xa7;const _0x3c0d5=a36_0x3c0d();let _0x5ce6f7=_0x3c0d5[_0x318018];return _0x5ce6f7;}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';function a36_0x3c0d(){const _0x59e831=['Schema','57366WVeNSm','1552mTptkG','App\x20Management','API\x20Documentation','1057sgqSsK','Skills','write','Personal\x20BFF','isSingleCommand','3540530hukyyr','2080338EkJBfY','Self\x20Update','set','Service\x20Tree','values','show','Diagnostics','command','550433qqCxVR','\x20\x20[high-risk-write]','3609196qmBpcn','risk','Instant\x20API','\x20\x20[write]','113624GfFCeD','description','BFF\x20Scripts','Artifacts','install','Configuration','run','Workspace','service','23160CiPGEt','list','Logs','login','map','CLI\x20Built-in\x20Skill','Knowledge\x20Base','Datasets','defaultCommand','get','has','push'];a36_0x3c0d=function(){return _0x59e831;};return a36_0x3c0d();}import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0xe33243){const _0x39b395=a36_0x5ce6;for(const _0x77b1af of _0xe33243){definitions['set'](_0x77b1af['service']+':'+_0x77b1af['command'],_0x77b1af);let _0x58fcf2=serviceGroups['get'](_0x77b1af[_0x39b395(0xb6)]);!_0x58fcf2&&(_0x58fcf2=[],serviceGroups[_0x39b395(0xd0)](_0x77b1af['service'],_0x58fcf2)),_0x58fcf2['push'](_0x77b1af);}}function registerService(_0xd397be,_0x6bf89d,_0x2b750e){const _0x1aebdf=a36_0x5ce6;registerDefinitions(_0x6bf89d);const _0x523b73=_0x5d409c=>_0x5d409c==='read'?'':_0x5d409c===_0x1aebdf(0xca)?_0x1aebdf(0xad):_0x1aebdf(0xa9),_0x2f1957={'service':_0x6bf89d[0x0][_0x1aebdf(0xb6)],'label':_0xd397be,'commands':_0x6bf89d[_0x1aebdf(0xbb)](_0x584a3a=>({'command':_0x584a3a[_0x1aebdf(0xa7)],'description':_0x584a3a[_0x1aebdf(0xaf)],'tag':_0x523b73(_0x584a3a[_0x1aebdf(0xab)])})),'defaultCommand':_0x2b750e?.[_0x1aebdf(0xbf)]??(_0x2b750e?.[_0x1aebdf(0xcc)]?_0x6bf89d[0x0][_0x1aebdf(0xa7)]:undefined),'isSingleCommand':_0x2b750e?.['isSingleCommand']};serviceRegistry[_0x1aebdf(0xc2)](_0x2f1957),serviceByName[_0x1aebdf(0xd0)](_0x2f1957[_0x1aebdf(0xb6)],_0x2f1957);}registerService('Authentication',authDefinitions,{'defaultCommand':a36_0x487e42(0xba)}),registerService(a36_0x487e42(0xc6),appDefinitions,{'defaultCommand':a36_0x487e42(0xb8)}),registerService(a36_0x487e42(0xb5),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a36_0x487e42(0xb3),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x487e42(0xc7),apiDocDefinitions),registerService(a36_0x487e42(0xbe),datasetDefinitions),registerService(a36_0x487e42(0xac),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService(a36_0x487e42(0xb0),bffDefinitions),registerService(a36_0x487e42(0xcb),personalBffDefinitions),registerService(a36_0x487e42(0xb1),artifactDefinitions),registerService('File',fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a36_0x487e42(0xbd),kbDefinitions),registerService(a36_0x487e42(0xd1),serviceDefinitions,{'defaultCommand':a36_0x487e42(0xb8)}),registerService(a36_0x487e42(0xc9),skillDefinitions,{'defaultCommand':a36_0x487e42(0xb2)}),registerService(a36_0x487e42(0xbc),cliSkillDefinitions,{'defaultCommand':a36_0x487e42(0xb2)}),registerService(a36_0x487e42(0xcf),[updateDefinition],{'defaultCommand':a36_0x487e42(0xb4),'isSingleCommand':!![]}),registerService(a36_0x487e42(0xd4),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x487e42(0xc3),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x487e42(0xb9),logsDefinitions,{'defaultCommand':a36_0x487e42(0xd3)});export function findDefinition(_0x1219f8,_0x12bf2f){const _0x18ff9b=a36_0x487e42;return definitions[_0x18ff9b(0xc0)](_0x1219f8+':'+_0x12bf2f);}export function isKnownService(_0x1470a8){const _0x4deacf=a36_0x487e42;return serviceByName[_0x4deacf(0xc1)](_0x1470a8);}export function getServiceEntry(_0x3b6b4a){return serviceByName['get'](_0x3b6b4a);}export function getAllDefinitions(){const _0x51fa74=a36_0x487e42;return Array['from'](definitions[_0x51fa74(0xd2)]());}
@@ -1 +1 @@
1
- const a37_0x112d1f=a37_0x4d89;function a37_0x3f51(){const _0x334d9d=['691122rvwjGx','3510CbcFgH','56hQXaeK','2060490EaRUOx','20yxZoBe','read','1147476JbnPew','670826TMpCUM','3fqvvaE','234070SzwiKL','export','9968LvGfbi','590000BrdxMC','schema'];a37_0x3f51=function(){return _0x334d9d;};return a37_0x3f51();}(function(_0x15374e,_0x425676){const _0x258ab0=a37_0x4d89,_0x55efbb=_0x15374e();while(!![]){try{const _0x55d42d=-parseInt(_0x258ab0(0xe0))/0x1+-parseInt(_0x258ab0(0xe2))/0x2+-parseInt(_0x258ab0(0xe1))/0x3*(-parseInt(_0x258ab0(0xe5))/0x4)+-parseInt(_0x258ab0(0xdc))/0x5+parseInt(_0x258ab0(0xe7))/0x6*(parseInt(_0x258ab0(0xdb))/0x7)+-parseInt(_0x258ab0(0xe4))/0x8*(-parseInt(_0x258ab0(0xda))/0x9)+parseInt(_0x258ab0(0xdd))/0xa*(parseInt(_0x258ab0(0xdf))/0xb);if(_0x55d42d===_0x425676)break;else _0x55efbb['push'](_0x55efbb['shift']());}catch(_0x231265){_0x55efbb['push'](_0x55efbb['shift']());}}}(a37_0x3f51,0x89999));function a37_0x4d89(_0x1e1d6a,_0x25be01){_0x1e1d6a=_0x1e1d6a-0xda;const _0x3f5113=a37_0x3f51();let _0x4d89a9=_0x3f5113[_0x1e1d6a];return _0x4d89a9;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x3165ca){const _0x2e26fb=await buildSchemaPayload();return{'ok':!![],'data':_0x2e26fb};}export const schemaDefinition={'service':a37_0x112d1f(0xe6),'command':a37_0x112d1f(0xe3),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a37_0x112d1f(0xde),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
1
+ const a37_0x8477db=a37_0x462a;(function(_0x231160,_0x388b66){const _0x14aea7=a37_0x462a,_0x267291=_0x231160();while(!![]){try{const _0x37574b=-parseInt(_0x14aea7(0x1f0))/0x1*(parseInt(_0x14aea7(0x1eb))/0x2)+parseInt(_0x14aea7(0x1f3))/0x3*(parseInt(_0x14aea7(0x1ee))/0x4)+-parseInt(_0x14aea7(0x1f2))/0x5*(parseInt(_0x14aea7(0x1f5))/0x6)+-parseInt(_0x14aea7(0x1f8))/0x7+-parseInt(_0x14aea7(0x1f6))/0x8+parseInt(_0x14aea7(0x1f4))/0x9+parseInt(_0x14aea7(0x1f7))/0xa;if(_0x37574b===_0x388b66)break;else _0x267291['push'](_0x267291['shift']());}catch(_0x3897d1){_0x267291['push'](_0x267291['shift']());}}}(a37_0x274b,0x38788));function a37_0x274b(){const _0x24fad7=['103868aNSeGj','schema','7RZlRyL','Export\x20machine-readable\x20command\x20schema\x20(JSON)','5kxVXBh','42AdKXks','1563687LlXvKs','2405946AXeVqA','931712ixAiWG','6891250UFJneb','500206WYWKgz','116054pxkdaN','export','read'];a37_0x274b=function(){return _0x24fad7;};return a37_0x274b();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x49d589){const _0x11bfbc=await buildSchemaPayload();return{'ok':!![],'data':_0x11bfbc};}function a37_0x462a(_0x1fbcab,_0x22cca1){_0x1fbcab=_0x1fbcab-0x1eb;const _0x274b83=a37_0x274b();let _0x462a4e=_0x274b83[_0x1fbcab];return _0x462a4e;}export const schemaDefinition={'service':a37_0x8477db(0x1ef),'command':a37_0x8477db(0x1ec),'description':a37_0x8477db(0x1f1),'risk':a37_0x8477db(0x1ed),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- (function(_0x4571ec,_0x2b9a4e){const _0xa8ce06=a38_0xde78,_0x2eb1be=_0x4571ec();while(!![]){try{const _0xdfbfa5=parseInt(_0xa8ce06(0x93))/0x1+-parseInt(_0xa8ce06(0x67))/0x2+parseInt(_0xa8ce06(0xad))/0x3*(-parseInt(_0xa8ce06(0x6f))/0x4)+parseInt(_0xa8ce06(0x8d))/0x5*(-parseInt(_0xa8ce06(0x73))/0x6)+-parseInt(_0xa8ce06(0x99))/0x7+-parseInt(_0xa8ce06(0xc8))/0x8*(-parseInt(_0xa8ce06(0xb7))/0x9)+parseInt(_0xa8ce06(0xb6))/0xa;if(_0xdfbfa5===_0x2b9a4e)break;else _0x2eb1be['push'](_0x2eb1be['shift']());}catch(_0x31e85f){_0x2eb1be['push'](_0x2eb1be['shift']());}}}(a38_0x4421,0x87b5e));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';function a38_0xde78(_0x150ef9,_0x238037){_0x150ef9=_0x150ef9-0x67;const _0x44215f=a38_0x4421();let _0xde78e5=_0x44215f[_0x150ef9];return _0xde78e5;}export function resolveDynamicServiceCommand(_0x530e1c,_0x2eb76a){const _0x4363d7=a38_0xde78,_0x4049fd=listLocalServiceTrees();let _0x59580f;for(const _0xa9f5c1 of _0x4049fd){const _0x1d5151=matchServiceTreeCommand(_0xa9f5c1,_0x530e1c);if(!_0x1d5151)continue;(!_0x59580f||_0x1d5151[_0x4363d7(0xa4)][_0x4363d7(0xbf)][_0x4363d7(0xa7)]>_0x59580f[_0x4363d7(0xa4)][_0x4363d7(0xbf)][_0x4363d7(0xa7)])&&(_0x59580f={'tree':_0xa9f5c1,'command':_0x1d5151[_0x4363d7(0xa4)],'remainingArgs':_0x1d5151[_0x4363d7(0x77)]});}if(!_0x59580f)return undefined;const _0x401c18={..._0x2eb76a};return applyAppBinding(_0x59580f[_0x4363d7(0x8c)],_0x59580f[_0x4363d7(0xa4)],_0x401c18),{'definition':buildDynamicCommandDefinition(_0x59580f[_0x4363d7(0x8c)],_0x59580f['command']),'args':_0x59580f[_0x4363d7(0x77)],'flags':_0x401c18,'tree':_0x59580f[_0x4363d7(0x8c)],'command':_0x59580f['command']};}export function generateDynamicServiceHelp(_0x55251d){const _0x49028d=a38_0xde78,_0x4be0d5=listLocalServiceTrees()['find'](_0x2c1fe0=>_0x2c1fe0['service']['code']===_0x55251d);if(!_0x4be0d5)return undefined;const _0x55f013=[CLI_BIN_NAME+'\x20'+_0x55251d+_0x49028d(0xc4),'',_0x4be0d5[_0x49028d(0xbb)]['name']||_0x55251d,_0x4be0d5[_0x49028d(0xbb)][_0x49028d(0x90)]?'\x20\x20'+_0x4be0d5['service'][_0x49028d(0x90)]:'','',_0x49028d(0x6c),..._0x4be0d5['commands'][_0x49028d(0x7d)](_0x6776f8=>{const _0x535f99=_0x49028d,_0x2e4b75=_0x6776f8['fullPath'][_0x535f99(0x88)](0x1)[_0x535f99(0x6e)]('\x20'),_0x2b3638=_0x6776f8['risk']===_0x535f99(0xa1)?'':'\x20['+_0x6776f8[_0x535f99(0x78)]+']';return'\x20\x20'+_0x2e4b75['padEnd'](0x18)+'\x20'+(_0x6776f8[_0x535f99(0x90)]||'')+_0x2b3638;}),'',_0x49028d(0xb9)+CLI_BIN_NAME+_0x49028d(0x84)+_0x55251d+_0x49028d(0xa6)][_0x49028d(0x97)](Boolean);return _0x55f013[_0x49028d(0x6e)]('\x0a');}export function listDynamicServiceEntries(){const _0xd9f6f9=a38_0xde78;return listLocalServices()[_0xd9f6f9(0x7d)](_0x165118=>{const _0x1aec13=_0xd9f6f9,_0x5451b6=_0x165118[_0x1aec13(0xa5)];return{'service':_0x5451b6['service'][_0x1aec13(0x71)],'label':_0x5451b6['service'][_0x1aec13(0x91)]||_0x5451b6[_0x1aec13(0xbb)]['code'],'commands':_0x5451b6[_0x1aec13(0x9f)][_0x1aec13(0x7d)](_0x16c2aa=>({'command':dynamicCommandName(_0x16c2aa),'description':_0x16c2aa[_0x1aec13(0x90)]||_0x1aec13(0xca)+_0x16c2aa[_0x1aec13(0xc0)],'tag':riskTag(_0x16c2aa[_0x1aec13(0x78)])}))};});}export function getDynamicServiceEntry(_0x32a3c1){const _0x3d29c9=a38_0xde78;return listDynamicServiceEntries()[_0x3d29c9(0xb1)](_0x4244d4=>_0x4244d4[_0x3d29c9(0xbb)]===_0x32a3c1);}export function listDynamicServiceDefinitions(_0x4d19da){const _0x5c5985=a38_0xde78;return listLocalServiceTrees()[_0x5c5985(0x97)](_0x3f6906=>!_0x4d19da||_0x3f6906[_0x5c5985(0xbb)]['code']===_0x4d19da)['flatMap'](_0x1a42cc=>_0x1a42cc[_0x5c5985(0x9f)][_0x5c5985(0x7d)](_0x1919e8=>buildDynamicCommandDefinition(_0x1a42cc,_0x1919e8)));}export function getDynamicServiceDefinitions(_0x4ba2d4){const _0x34f9c2=listDynamicServiceDefinitions(_0x4ba2d4);return _0x34f9c2['length']>0x0?_0x34f9c2:undefined;}export function findDynamicServiceDefinition(_0x39782f,_0x21495c){const _0x41b3ac=a38_0xde78;return listDynamicServiceDefinitions(_0x39782f)[_0x41b3ac(0xb1)](_0x200b29=>_0x200b29['command']===_0x21495c);}export function buildDynamicCommandDefinition(_0x1afa35,_0x38546a){const _0x2c320f=a38_0xde78;return{'service':_0x1afa35[_0x2c320f(0xbb)][_0x2c320f(0x71)],'command':dynamicCommandName(_0x38546a),'description':_0x38546a[_0x2c320f(0x90)]||_0x2c320f(0xca)+_0x38546a['cliPath'],'risk':_0x38546a[_0x2c320f(0x78)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x38546a['args'][_0x2c320f(0x7d)](_0x119788=>({'name':_0x119788[_0x2c320f(0x91)],'description':_0x119788[_0x2c320f(0x90)]||_0x119788[_0x2c320f(0x91)],'required':_0x119788[_0x2c320f(0xc1)]})),'flags':_0x38546a[_0x2c320f(0x9d)][_0x2c320f(0x7d)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x38546a),async 'dryRun'(_0x4bff6d){const _0x44cb0b=_0x2c320f,_0x135a56=await compilePlan(_0x38546a,_0x4bff6d);return{'method':_0x44cb0b(0x7b),'url':_0x38546a[_0x44cb0b(0xc0)],'body':{'target':targetPreview(_0x135a56),'params':_0x135a56[_0x44cb0b(0x6b)]},'description':_0x44cb0b(0xba)+_0x38546a[_0x44cb0b(0xc0)]};},async 'execute'(_0x9c568a){const _0x53888f=_0x2c320f,_0x34705b=await compilePlan(_0x38546a,_0x9c568a),_0x220fb5=Date[_0x53888f(0xbe)](),_0x460593=await executePlan(_0x34705b,_0x38546a,_0x9c568a),_0xee6dcb=Date[_0x53888f(0xbe)]()-_0x220fb5;return{'ok':!![],'data':{'service':_0x1afa35[_0x53888f(0xbb)],'command':_0x38546a[_0x53888f(0xc0)],'target':targetPreview(_0x34705b),'result':_0x460593,'elapsed':_0xee6dcb},'message':_0x53888f(0x80)+_0x38546a[_0x53888f(0xc0)]+'\x20completed\x20in\x20'+_0xee6dcb+'ms'};}};}function dynamicCommandName(_0xc9a12f){const _0x93a30f=a38_0xde78;return _0xc9a12f[_0x93a30f(0xbf)]['slice'](0x1)['join']('\x20');}function riskTag(_0x4ecf2e){const _0x460b3b=a38_0xde78;return _0x4ecf2e===_0x460b3b(0xa1)?'':_0x460b3b(0x94)+_0x4ecf2e+']';}function flagToCommandFlag(_0x18a4bc){const _0x23f3a0=a38_0xde78;return{'name':_0x18a4bc['cliName'],'type':_0x18a4bc[_0x23f3a0(0xa0)]==='json'?_0x23f3a0(0x96):_0x18a4bc[_0x23f3a0(0xa0)],'description':_0x18a4bc[_0x23f3a0(0x90)]||_0x18a4bc[_0x23f3a0(0x91)],'required':_0x18a4bc[_0x23f3a0(0xc1)],'default':isPrimitiveFlagDefault(_0x18a4bc[_0x23f3a0(0x7f)])?_0x18a4bc[_0x23f3a0(0x7f)]:undefined,'enum':_0x18a4bc['enum']};}function a38_0x4421(){const _0x518761=['kind','source','flags','boolean','commands','type','read','\x20\x20SERVICE\x20TREE\x20TARGET','\x20\x20\x20\x20sqlCode:\x20','command','normalizedManifest','`\x20to\x20inspect\x20the\x20manifest.','length','\x20\x20\x20\x20datatable:\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','loginName','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','entries','6873hOyYWT','validation','startsWith','fromEntries','find','\x20requires\x20target.scriptName.','Unsupported\x20service\x20target\x20kind:\x20','appCode','number','6300340BJzGsC','649863gqjNtH','ctx.','Use\x20`','Preview\x20dynamic\x20service\x20command:\x20','service','push','appcode','now','fullPath','cliPath','required','bffCode','trim','\x20<command>\x20[flags]','some','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20\x20MAP\x20TO','72uzUaLO','bff','Run\x20service\x20command\x20','rawFlags','696684glGEgJ','bffId','datasetCode','userName','params','Commands:','sql','join','412WuCOfJ','\x20requires\x20target.sqlCode.','code','scriptName','6JqekWm','const','mapTo','employeeId','remainingArgs','risk','nickname','env','SERVICE_TREE','context.','map','sqlCode','default','Service\x20command\x20','\x20\x20\x20\x20datasetCode:\x20','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','envName','\x20service\x20detail\x20--service\x20','app','dbtableConfig','username','slice','Cannot\x20resolve\x20datatable\x20\x22','tableName','data','tree','2510605YVVgLv','nickName','operator','description','name','datatable','557816OKKxMC','\x20\x20[','appRef','string','filter','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','1367849cGzgLy','target'];a38_0x4421=function(){return _0x518761;};return a38_0x4421();}async function compilePlan(_0x4ff8aa,_0x2e53f8){const _0xbf9221=a38_0xde78;return compileServiceTreeCommand(_0x4ff8aa,{'flags':_0x2e53f8[_0xbf9221(0xcb)],'args':_0x2e53f8['args'],'context':await buildServiceContext(_0x4ff8aa,_0x2e53f8)});}async function buildServiceContext(_0x460315,_0x42a802){const _0x2c4069=a38_0xde78,_0xe1cff3={'appCode':_0x42a802[_0x2c4069(0xb4)],'env':_0x42a802[_0x2c4069(0x83)],'envName':_0x42a802[_0x2c4069(0x83)]};if(!usesRuntimeContext(_0x460315))return _0xe1cff3;const _0x49aa16=await getLoginUserInfo(),_0x2df194=pickFirst(_0x49aa16['userId'],_0x49aa16['id']);return{..._0xe1cff3,'user':_0x49aa16,'userId':_0x2df194,'id':_0x49aa16['id'],'username':pickFirst(_0x49aa16[_0x2c4069(0x87)],_0x49aa16[_0x2c4069(0x6a)],_0x49aa16[_0x2c4069(0xaa)]),'userName':_0x49aa16[_0x2c4069(0x6a)],'nickname':pickFirst(_0x49aa16[_0x2c4069(0x79)],_0x49aa16['nickName']),'nickName':_0x49aa16[_0x2c4069(0x8e)],'tenantCode':_0x49aa16['tenantCode'],'employeeId':_0x49aa16[_0x2c4069(0x76)]};}function usesRuntimeContext(_0x4adb91){const _0x38698e=a38_0xde78;return _0x4adb91[_0x38698e(0x75)][_0x38698e(0xc5)](_0x3c8920=>typeof _0x3c8920[_0x38698e(0x9c)]===_0x38698e(0x96)&&(_0x3c8920[_0x38698e(0x9c)][_0x38698e(0xaf)](_0x38698e(0x7c))||_0x3c8920[_0x38698e(0x9c)][_0x38698e(0xaf)](_0x38698e(0xb8))));}function pickFirst(..._0x589179){const _0x46de43=a38_0xde78;return _0x589179[_0x46de43(0xb1)](_0x51900f=>_0x51900f!==undefined&&_0x51900f!==null);}async function executePlan(_0x4d0863,_0x11e535,_0x121e5f){const _0x4fed4d=a38_0xde78;if(_0x4d0863[_0x4fed4d(0x9b)]===_0x4fed4d(0x8b)){const _0x2f1154=await resolveDatasetCode(_0x4d0863,_0x11e535,_0x121e5f);return executeData(_0x2f1154,_0x4d0863[_0x4fed4d(0xa4)],_0x4d0863[_0x4fed4d(0x6b)]);}if(_0x4d0863[_0x4fed4d(0x9b)]===_0x4fed4d(0x6d)){if(!_0x4d0863[_0x4fed4d(0x7e)])throw CliErrors[_0x4fed4d(0xae)](_0x4fed4d(0x80)+_0x11e535[_0x4fed4d(0xc0)]+_0x4fed4d(0x70));return executeSdkSql(_0x4d0863['sqlCode'],normalizeScalarParams(_0x4d0863[_0x4fed4d(0x6b)]));}if(_0x4d0863[_0x4fed4d(0x9b)]===_0x4fed4d(0xc9)){const _0x405f72=_0x4d0863[_0x4fed4d(0x72)]||_0x4d0863['bffCode']||(_0x4d0863[_0x4fed4d(0x68)]==null?'':String(_0x4d0863[_0x4fed4d(0x68)]));if(!_0x405f72)throw CliErrors[_0x4fed4d(0xae)](_0x4fed4d(0x80)+_0x11e535['cliPath']+_0x4fed4d(0xb2));return executeSdkBff(_0x405f72,_0x4d0863[_0x4fed4d(0x6b)]);}throw CliErrors[_0x4fed4d(0xae)](_0x4fed4d(0xb3)+_0x4d0863[_0x4fed4d(0x9b)]);}async function resolveDatasetCode(_0x3a79fd,_0x322eb9,_0xb4dea6){const _0x212ce7=a38_0xde78;if(_0x3a79fd[_0x212ce7(0x69)])return _0x3a79fd[_0x212ce7(0x69)];if(!_0x3a79fd[_0x212ce7(0x92)])throw CliErrors[_0x212ce7(0xae)](_0x212ce7(0x80)+_0x322eb9[_0x212ce7(0xc0)]+_0x212ce7(0x98));const _0x4857e9=await listDatasets(_0xb4dea6['appCode']),_0x393721=_0x4857e9[_0x212ce7(0xb1)](_0x117616=>_0x117616[_0x212ce7(0x86)]?.[_0x212ce7(0x8a)]===_0x3a79fd[_0x212ce7(0x92)]);if(!_0x393721?.[_0x212ce7(0x71)])throw CliErrors[_0x212ce7(0xae)](_0x212ce7(0x89)+_0x3a79fd['datatable']+_0x212ce7(0xc6)+_0xb4dea6[_0x212ce7(0xb4)]+'.',_0x212ce7(0x82));return _0x393721[_0x212ce7(0x71)];}function applyAppBinding(_0x111c40,_0x2738dc,_0x5db4f3){const _0x5e8d42=a38_0xde78,_0x35fedf=_0x2738dc['target'][_0x5e8d42(0x95)];if(!_0x35fedf)return;const _0xaf7597=_0x111c40['appBindings'][_0x35fedf];if(!_0xaf7597)throw CliErrors[_0x5e8d42(0xae)]('Unknown\x20appRef\x20\x22'+_0x35fedf+'\x22\x20in\x20service\x20command\x20'+_0x2738dc[_0x5e8d42(0xc0)]+'.',_0x5e8d42(0xab));const _0x30005f=_0xaf7597[_0x5e8d42(0xbd)]||_0xaf7597[_0x5e8d42(0xb4)];_0x30005f&&!hasText(_0x5db4f3[_0x5e8d42(0xbd)])&&(_0x5db4f3['appcode']=_0x30005f),_0xaf7597[_0x5e8d42(0x85)]&&!hasText(_0x5db4f3['app'])&&!hasText(_0x5db4f3[_0x5e8d42(0xbd)])&&(_0x5db4f3[_0x5e8d42(0x85)]=_0xaf7597[_0x5e8d42(0x85)]),_0xaf7597[_0x5e8d42(0x7a)]&&!hasText(_0x5db4f3[_0x5e8d42(0x7a)])&&(_0x5db4f3[_0x5e8d42(0x7a)]=_0xaf7597[_0x5e8d42(0x7a)]);}function renderDynamicCommandHelp(_0x454abf){const _0x56c9f4=a38_0xde78,_0xcf12de=[_0x56c9f4(0xa2),_0x56c9f4(0xa9)+_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x9b)],'\x20\x20\x20\x20command:\x20'+_0x454abf['target'][_0x56c9f4(0xa4)]];if(_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x69)])_0xcf12de[_0x56c9f4(0xbc)](_0x56c9f4(0x81)+_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x69)]);if(_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x92)])_0xcf12de['push'](_0x56c9f4(0xa8)+_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x92)]);if(_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x7e)])_0xcf12de[_0x56c9f4(0xbc)](_0x56c9f4(0xa3)+_0x454abf['target'][_0x56c9f4(0x7e)]);if(_0x454abf['target'][_0x56c9f4(0x72)])_0xcf12de[_0x56c9f4(0xbc)]('\x20\x20\x20\x20scriptName:\x20'+_0x454abf[_0x56c9f4(0x9a)][_0x56c9f4(0x72)]);if(_0x454abf[_0x56c9f4(0x75)][_0x56c9f4(0xa7)]>0x0){_0xcf12de['push']('',_0x56c9f4(0xc7));for(const _0x191a1a of _0x454abf['mapTo']){_0xcf12de['push']('\x20\x20\x20\x20'+(_0x191a1a['source']||_0x56c9f4(0x74))+'\x20->\x20'+_0x191a1a[_0x56c9f4(0x9a)]+(_0x191a1a[_0x56c9f4(0x8f)]?'.'+_0x191a1a['operator']:''));}}return _0xcf12de[_0x56c9f4(0x6e)]('\x0a');}function targetPreview(_0x3ef3aa){const _0x969cf=a38_0xde78;return{'kind':_0x3ef3aa[_0x969cf(0x9b)],'command':_0x3ef3aa[_0x969cf(0xa4)],'appRef':_0x3ef3aa[_0x969cf(0x95)],'datasetCode':_0x3ef3aa[_0x969cf(0x69)],'datatable':_0x3ef3aa[_0x969cf(0x92)],'sqlCode':_0x3ef3aa[_0x969cf(0x7e)],'bffCode':_0x3ef3aa[_0x969cf(0xc2)],'bffId':_0x3ef3aa[_0x969cf(0x68)],'scriptName':_0x3ef3aa['scriptName']};}function normalizeScalarParams(_0x5816a7){const _0x491142=a38_0xde78;return Object[_0x491142(0xb0)](Object[_0x491142(0xac)](_0x5816a7)[_0x491142(0x97)](([,_0x244790])=>typeof _0x244790===_0x491142(0x96)||typeof _0x244790===_0x491142(0xb5)));}function hasText(_0x34c957){const _0x52b091=a38_0xde78;return typeof _0x34c957===_0x52b091(0x96)&&_0x34c957[_0x52b091(0xc3)]()[_0x52b091(0xa7)]>0x0;}function isPrimitiveFlagDefault(_0x150fdb){const _0xdbd20d=a38_0xde78;return _0x150fdb===undefined||typeof _0x150fdb===_0xdbd20d(0x96)||typeof _0x150fdb===_0xdbd20d(0xb5)||typeof _0x150fdb===_0xdbd20d(0x9e);}
1
+ (function(_0x365bf2,_0x539427){const _0x333a00=a38_0x97eb,_0x181002=_0x365bf2();while(!![]){try{const _0x3eecdc=-parseInt(_0x333a00(0x18f))/0x1*(-parseInt(_0x333a00(0x1a0))/0x2)+-parseInt(_0x333a00(0x1c7))/0x3+-parseInt(_0x333a00(0x1b8))/0x4+parseInt(_0x333a00(0x1e2))/0x5*(parseInt(_0x333a00(0x1b7))/0x6)+parseInt(_0x333a00(0x1d0))/0x7*(parseInt(_0x333a00(0x1a4))/0x8)+parseInt(_0x333a00(0x1d9))/0x9+-parseInt(_0x333a00(0x1af))/0xa;if(_0x3eecdc===_0x539427)break;else _0x181002['push'](_0x181002['shift']());}catch(_0x5f502b){_0x181002['push'](_0x181002['shift']());}}}(a38_0x568c,0x3f84f));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(_0x3ba6ef,_0x362dcf){const _0x27c730=a38_0x97eb,_0x58438f=listLocalServiceTrees();let _0x28ba34;for(const _0x5efc3d of _0x58438f){const _0x42aea7=matchServiceTreeCommand(_0x5efc3d,_0x3ba6ef);if(!_0x42aea7)continue;(!_0x28ba34||_0x42aea7[_0x27c730(0x1b6)][_0x27c730(0x1dc)]['length']>_0x28ba34[_0x27c730(0x1b6)][_0x27c730(0x1dc)][_0x27c730(0x1a2)])&&(_0x28ba34={'tree':_0x5efc3d,'command':_0x42aea7['command'],'remainingArgs':_0x42aea7[_0x27c730(0x199)]});}if(!_0x28ba34)return undefined;const _0xb88df2={..._0x362dcf};return applyAppBinding(_0x28ba34[_0x27c730(0x198)],_0x28ba34[_0x27c730(0x1b6)],_0xb88df2),{'definition':buildDynamicCommandDefinition(_0x28ba34[_0x27c730(0x198)],_0x28ba34[_0x27c730(0x1b6)]),'args':_0x28ba34[_0x27c730(0x199)],'flags':_0xb88df2,'tree':_0x28ba34[_0x27c730(0x198)],'command':_0x28ba34[_0x27c730(0x1b6)]};}export function generateDynamicServiceHelp(_0x2d4431){const _0x20eb04=a38_0x97eb,_0x5933a6=listLocalServiceTrees()[_0x20eb04(0x19e)](_0x5082d6=>_0x5082d6[_0x20eb04(0x1eb)][_0x20eb04(0x1b5)]===_0x2d4431);if(!_0x5933a6)return undefined;const _0x46a802=[CLI_BIN_NAME+'\x20'+_0x2d4431+_0x20eb04(0x191),'',_0x5933a6[_0x20eb04(0x1eb)][_0x20eb04(0x1c3)]||_0x2d4431,_0x5933a6[_0x20eb04(0x1eb)][_0x20eb04(0x1c1)]?'\x20\x20'+_0x5933a6[_0x20eb04(0x1eb)][_0x20eb04(0x1c1)]:'','','Commands:',..._0x5933a6[_0x20eb04(0x19d)][_0x20eb04(0x195)](_0x3fe814=>{const _0x5b010c=_0x20eb04,_0x36bc01=_0x3fe814['fullPath']['slice'](0x1)[_0x5b010c(0x1b0)]('\x20'),_0x5265ef=_0x3fe814['risk']===_0x5b010c(0x1ce)?'':'\x20['+_0x3fe814[_0x5b010c(0x1df)]+']';return'\x20\x20'+_0x36bc01[_0x5b010c(0x1ec)](0x18)+'\x20'+(_0x3fe814[_0x5b010c(0x1c1)]||'')+_0x5265ef;}),'','Use\x20`'+CLI_BIN_NAME+_0x20eb04(0x1c2)+_0x2d4431+_0x20eb04(0x1f1)][_0x20eb04(0x1bb)](Boolean);return _0x46a802[_0x20eb04(0x1b0)]('\x0a');}export function listDynamicServiceEntries(){const _0x52233d=a38_0x97eb;return listLocalServices()[_0x52233d(0x195)](_0x44ac4d=>{const _0x50e46e=_0x52233d,_0x401b9b=_0x44ac4d[_0x50e46e(0x1e0)];return{'service':_0x401b9b[_0x50e46e(0x1eb)]['code'],'label':_0x401b9b[_0x50e46e(0x1eb)][_0x50e46e(0x1c3)]||_0x401b9b[_0x50e46e(0x1eb)][_0x50e46e(0x1b5)],'commands':_0x401b9b['commands'][_0x50e46e(0x195)](_0x4257a2=>({'command':dynamicCommandName(_0x4257a2),'description':_0x4257a2[_0x50e46e(0x1c1)]||_0x50e46e(0x1cd)+_0x4257a2[_0x50e46e(0x1a9)],'tag':riskTag(_0x4257a2[_0x50e46e(0x1df)])}))};});}export function getDynamicServiceEntry(_0x3c67e2){const _0x26f49d=a38_0x97eb;return listDynamicServiceEntries()[_0x26f49d(0x19e)](_0x1bc95d=>_0x1bc95d[_0x26f49d(0x1eb)]===_0x3c67e2);}export function listDynamicServiceDefinitions(_0x4a6d2c){const _0x215534=a38_0x97eb;return listLocalServiceTrees()[_0x215534(0x1bb)](_0x36d7cc=>!_0x4a6d2c||_0x36d7cc[_0x215534(0x1eb)][_0x215534(0x1b5)]===_0x4a6d2c)['flatMap'](_0x5f24be=>_0x5f24be[_0x215534(0x19d)][_0x215534(0x195)](_0x14e972=>buildDynamicCommandDefinition(_0x5f24be,_0x14e972)));}export function getDynamicServiceDefinitions(_0x470f36){const _0x5675a9=a38_0x97eb,_0x49498d=listDynamicServiceDefinitions(_0x470f36);return _0x49498d[_0x5675a9(0x1a2)]>0x0?_0x49498d:undefined;}function a38_0x97eb(_0x4f462d,_0x5a483f){_0x4f462d=_0x4f462d-0x18f;const _0x568c54=a38_0x568c();let _0x97ebfe=_0x568c54[_0x4f462d];return _0x97ebfe;}export function findDynamicServiceDefinition(_0x4c205d,_0x2f3d17){const _0x426f25=a38_0x97eb;return listDynamicServiceDefinitions(_0x4c205d)['find'](_0x12562f=>_0x12562f[_0x426f25(0x1b6)]===_0x2f3d17);}export function buildDynamicCommandDefinition(_0x1ba7d8,_0x142a0a){const _0x5a1e9b=a38_0x97eb;return{'service':_0x1ba7d8['service']['code'],'command':dynamicCommandName(_0x142a0a),'description':_0x142a0a['description']||'Run\x20service\x20command\x20'+_0x142a0a[_0x5a1e9b(0x1a9)],'risk':_0x142a0a['risk'],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x142a0a[_0x5a1e9b(0x1e6)][_0x5a1e9b(0x195)](_0x45f0d3=>({'name':_0x45f0d3[_0x5a1e9b(0x1c3)],'description':_0x45f0d3[_0x5a1e9b(0x1c1)]||_0x45f0d3[_0x5a1e9b(0x1c3)],'required':_0x45f0d3['required']})),'flags':_0x142a0a['flags'][_0x5a1e9b(0x195)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x142a0a),async 'dryRun'(_0x446e09){const _0x4e0a6b=_0x5a1e9b,_0x22d721=await compilePlan(_0x142a0a,_0x446e09);return{'method':_0x4e0a6b(0x194),'url':_0x142a0a[_0x4e0a6b(0x1a9)],'body':{'target':targetPreview(_0x22d721),'params':_0x22d721['params']},'description':_0x4e0a6b(0x1b1)+_0x142a0a[_0x4e0a6b(0x1a9)]};},async 'execute'(_0x5d1e0f){const _0x401276=_0x5a1e9b,_0x33cd13=await compilePlan(_0x142a0a,_0x5d1e0f),_0x261e99=Date['now'](),_0x4859f7=await executePlan(_0x33cd13,_0x142a0a,_0x5d1e0f),_0xffb80e=Date[_0x401276(0x192)]()-_0x261e99;return{'ok':!![],'data':{'service':_0x1ba7d8[_0x401276(0x1eb)],'command':_0x142a0a[_0x401276(0x1a9)],'target':targetPreview(_0x33cd13),'result':_0x4859f7,'elapsed':_0xffb80e},'message':_0x401276(0x1ad)+_0x142a0a['cliPath']+'\x20completed\x20in\x20'+_0xffb80e+'ms'};}};}function dynamicCommandName(_0x36fb3a){const _0x49e450=a38_0x97eb;return _0x36fb3a['fullPath'][_0x49e450(0x1b2)](0x1)[_0x49e450(0x1b0)]('\x20');}function riskTag(_0x2a24f2){const _0x122044=a38_0x97eb;return _0x2a24f2==='read'?'':_0x122044(0x1ae)+_0x2a24f2+']';}function flagToCommandFlag(_0x24c54c){const _0xc75676=a38_0x97eb;return{'name':_0x24c54c[_0xc75676(0x1a5)],'type':_0x24c54c[_0xc75676(0x1be)]===_0xc75676(0x1ed)?_0xc75676(0x19c):_0x24c54c[_0xc75676(0x1be)],'description':_0x24c54c[_0xc75676(0x1c1)]||_0x24c54c['name'],'required':_0x24c54c['required'],'default':isPrimitiveFlagDefault(_0x24c54c['default'])?_0x24c54c['default']:undefined,'enum':_0x24c54c['enum']};}async function compilePlan(_0x291153,_0xb4b7d){const _0x408d31=a38_0x97eb;return compileServiceTreeCommand(_0x291153,{'flags':_0xb4b7d[_0x408d31(0x1bf)],'args':_0xb4b7d[_0x408d31(0x1e6)],'context':await buildServiceContext(_0x291153,_0xb4b7d)});}async function buildServiceContext(_0x494bce,_0x479e37){const _0x3a4ad3=a38_0x97eb,_0x1b4d34={'appCode':_0x479e37['appCode'],'env':_0x479e37[_0x3a4ad3(0x1a8)],'envName':_0x479e37[_0x3a4ad3(0x1a8)]};if(!usesRuntimeContext(_0x494bce))return _0x1b4d34;const _0x31dd99=await getLoginUserInfo(),_0x1fe460=pickFirst(_0x31dd99[_0x3a4ad3(0x1ee)],_0x31dd99['id']);return{..._0x1b4d34,'user':_0x31dd99,'userId':_0x1fe460,'id':_0x31dd99['id'],'username':pickFirst(_0x31dd99[_0x3a4ad3(0x1e4)],_0x31dd99['userName'],_0x31dd99[_0x3a4ad3(0x1e5)]),'userName':_0x31dd99[_0x3a4ad3(0x1ab)],'nickname':pickFirst(_0x31dd99[_0x3a4ad3(0x1d5)],_0x31dd99[_0x3a4ad3(0x1a7)]),'nickName':_0x31dd99['nickName'],'tenantCode':_0x31dd99[_0x3a4ad3(0x1c8)],'employeeId':_0x31dd99[_0x3a4ad3(0x1e3)]};}function usesRuntimeContext(_0x489996){const _0x2891ed=a38_0x97eb;return _0x489996[_0x2891ed(0x1db)][_0x2891ed(0x193)](_0x1043c3=>typeof _0x1043c3['source']==='string'&&(_0x1043c3[_0x2891ed(0x19b)]['startsWith'](_0x2891ed(0x1ca))||_0x1043c3[_0x2891ed(0x19b)][_0x2891ed(0x1a3)](_0x2891ed(0x1de))));}function pickFirst(..._0x4644c9){const _0x54ba62=a38_0x97eb;return _0x4644c9[_0x54ba62(0x19e)](_0x477a62=>_0x477a62!==undefined&&_0x477a62!==null);}async function executePlan(_0x4e7337,_0x52b931,_0x47e065){const _0x32f8fe=a38_0x97eb;if(_0x4e7337[_0x32f8fe(0x1c4)]===_0x32f8fe(0x1d4)){const _0x216d89=await resolveDatasetCode(_0x4e7337,_0x52b931,_0x47e065);return executeData(_0x216d89,_0x4e7337['command'],_0x4e7337[_0x32f8fe(0x1c5)]);}if(_0x4e7337[_0x32f8fe(0x1c4)]===_0x32f8fe(0x1aa)){if(!_0x4e7337[_0x32f8fe(0x190)])throw CliErrors[_0x32f8fe(0x1b4)]('Service\x20command\x20'+_0x52b931[_0x32f8fe(0x1a9)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x4e7337[_0x32f8fe(0x190)],normalizeScalarParams(_0x4e7337[_0x32f8fe(0x1c5)]));}if(_0x4e7337[_0x32f8fe(0x1c4)]===_0x32f8fe(0x196)){const _0x2fa75d=_0x4e7337['scriptName']||_0x4e7337[_0x32f8fe(0x1f0)]||(_0x4e7337[_0x32f8fe(0x1e1)]==null?'':String(_0x4e7337[_0x32f8fe(0x1e1)]));if(!_0x2fa75d)throw CliErrors[_0x32f8fe(0x1b4)](_0x32f8fe(0x1ad)+_0x52b931['cliPath']+_0x32f8fe(0x1d6));return executeSdkBff(_0x2fa75d,_0x4e7337[_0x32f8fe(0x1c5)]);}throw CliErrors[_0x32f8fe(0x1b4)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x4e7337[_0x32f8fe(0x1c4)]);}function a38_0x568c(){const _0x31acc6=['mapTo','fullPath','Cannot\x20resolve\x20datatable\x20\x22','ctx.','risk','normalizedManifest','bffId','200MrsMnp','employeeId','username','loginName','args','appcode','\x20\x20\x20\x20scriptName:\x20','entries','\x20\x20\x20\x20kind:\x20\x20\x20\x20','service','padEnd','json','userId','target','bffCode','`\x20to\x20inspect\x20the\x20manifest.','datasetCode','operator','1685dOaXfT','sqlCode','\x20<command>\x20[flags]','now','some','SERVICE_TREE','map','bff','appCode','tree','remainingArgs','app','source','string','commands','find','\x22\x20in\x20service\x20command\x20','130MzgcHb','const','length','startsWith','424uEdAme','cliName','tableName','nickName','envName','cliPath','sql','userName','\x20\x20\x20\x20datasetCode:\x20','Service\x20command\x20','\x20\x20[','5333500yBPPQE','join','Preview\x20dynamic\x20service\x20command:\x20','slice','appRef','validation','code','command','64254RqUsOT','826020ntSgMs','boolean','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','filter','datatable','dbtableConfig','type','rawFlags','\x20->\x20','description','\x20service\x20detail\x20--service\x20','name','kind','params','number','331266dUHYtP','tenantCode','scriptName','context.','push','\x20\x20\x20\x20sqlCode:\x20','Run\x20service\x20command\x20','read','\x20\x20\x20\x20command:\x20','61649iGsVkR','\x20\x20\x20\x20datatable:\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20\x20\x20\x20','data','nickname','\x20requires\x20target.scriptName.','fromEntries','env','952164jPovrA','Unknown\x20appRef\x20\x22'];a38_0x568c=function(){return _0x31acc6;};return a38_0x568c();}async function resolveDatasetCode(_0x5569ca,_0x130de2,_0x3904ef){const _0xe63af0=a38_0x97eb;if(_0x5569ca[_0xe63af0(0x1f2)])return _0x5569ca[_0xe63af0(0x1f2)];if(!_0x5569ca[_0xe63af0(0x1bc)])throw CliErrors[_0xe63af0(0x1b4)](_0xe63af0(0x1ad)+_0x130de2[_0xe63af0(0x1a9)]+_0xe63af0(0x1ba));const _0x2e4c0d=await listDatasets(_0x3904ef[_0xe63af0(0x197)]),_0x38100d=_0x2e4c0d[_0xe63af0(0x19e)](_0x5e4ebc=>_0x5e4ebc[_0xe63af0(0x1bd)]?.[_0xe63af0(0x1a6)]===_0x5569ca['datatable']);if(!_0x38100d?.[_0xe63af0(0x1b5)])throw CliErrors[_0xe63af0(0x1b4)](_0xe63af0(0x1dd)+_0x5569ca[_0xe63af0(0x1bc)]+_0xe63af0(0x1d2)+_0x3904ef[_0xe63af0(0x197)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x38100d[_0xe63af0(0x1b5)];}function applyAppBinding(_0x2d8a41,_0x34a5b3,_0x159f38){const _0x5e111b=a38_0x97eb,_0x177094=_0x34a5b3[_0x5e111b(0x1ef)]['appRef'];if(!_0x177094)return;const _0x3df37c=_0x2d8a41['appBindings'][_0x177094];if(!_0x3df37c)throw CliErrors['validation'](_0x5e111b(0x1da)+_0x177094+_0x5e111b(0x19f)+_0x34a5b3[_0x5e111b(0x1a9)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x87f045=_0x3df37c[_0x5e111b(0x1e7)]||_0x3df37c[_0x5e111b(0x197)];_0x87f045&&!hasText(_0x159f38['appcode'])&&(_0x159f38[_0x5e111b(0x1e7)]=_0x87f045),_0x3df37c[_0x5e111b(0x19a)]&&!hasText(_0x159f38[_0x5e111b(0x19a)])&&!hasText(_0x159f38['appcode'])&&(_0x159f38[_0x5e111b(0x19a)]=_0x3df37c['app']),_0x3df37c[_0x5e111b(0x1d8)]&&!hasText(_0x159f38[_0x5e111b(0x1d8)])&&(_0x159f38[_0x5e111b(0x1d8)]=_0x3df37c[_0x5e111b(0x1d8)]);}function renderDynamicCommandHelp(_0x523031){const _0x632fb8=a38_0x97eb,_0x5f0174=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x632fb8(0x1ea)+_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x1c4)],_0x632fb8(0x1cf)+_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x1b6)]];if(_0x523031['target'][_0x632fb8(0x1f2)])_0x5f0174['push'](_0x632fb8(0x1ac)+_0x523031[_0x632fb8(0x1ef)]['datasetCode']);if(_0x523031[_0x632fb8(0x1ef)]['datatable'])_0x5f0174['push'](_0x632fb8(0x1d1)+_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x1bc)]);if(_0x523031[_0x632fb8(0x1ef)]['sqlCode'])_0x5f0174[_0x632fb8(0x1cb)](_0x632fb8(0x1cc)+_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x190)]);if(_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x1c9)])_0x5f0174[_0x632fb8(0x1cb)](_0x632fb8(0x1e8)+_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x1c9)]);if(_0x523031[_0x632fb8(0x1db)]['length']>0x0){_0x5f0174[_0x632fb8(0x1cb)]('','\x20\x20MAP\x20TO');for(const _0x177bfa of _0x523031['mapTo']){_0x5f0174[_0x632fb8(0x1cb)](_0x632fb8(0x1d3)+(_0x177bfa['source']||_0x632fb8(0x1a1))+_0x632fb8(0x1c0)+_0x177bfa[_0x632fb8(0x1ef)]+(_0x177bfa[_0x632fb8(0x1f3)]?'.'+_0x177bfa[_0x632fb8(0x1f3)]:''));}}return _0x5f0174['join']('\x0a');}function targetPreview(_0x1a722c){const _0x1e8a39=a38_0x97eb;return{'kind':_0x1a722c['kind'],'command':_0x1a722c['command'],'appRef':_0x1a722c[_0x1e8a39(0x1b3)],'datasetCode':_0x1a722c[_0x1e8a39(0x1f2)],'datatable':_0x1a722c[_0x1e8a39(0x1bc)],'sqlCode':_0x1a722c[_0x1e8a39(0x190)],'bffCode':_0x1a722c[_0x1e8a39(0x1f0)],'bffId':_0x1a722c[_0x1e8a39(0x1e1)],'scriptName':_0x1a722c['scriptName']};}function normalizeScalarParams(_0x1ee55f){const _0x9109e6=a38_0x97eb;return Object[_0x9109e6(0x1d7)](Object[_0x9109e6(0x1e9)](_0x1ee55f)[_0x9109e6(0x1bb)](([,_0x21afe9])=>typeof _0x21afe9==='string'||typeof _0x21afe9===_0x9109e6(0x1c6)));}function hasText(_0x2a8e6a){const _0x3adf5e=a38_0x97eb;return typeof _0x2a8e6a===_0x3adf5e(0x19c)&&_0x2a8e6a['trim']()[_0x3adf5e(0x1a2)]>0x0;}function isPrimitiveFlagDefault(_0x407232){const _0x17f21c=a38_0x97eb;return _0x407232===undefined||typeof _0x407232===_0x17f21c(0x19c)||typeof _0x407232===_0x17f21c(0x1c6)||typeof _0x407232===_0x17f21c(0x1b9);}
@@ -1 +1 @@
1
- const a39_0x14c7ef=a39_0x274c;(function(_0x20933f,_0x8fdddd){const _0x329c5f=a39_0x274c,_0x390824=_0x20933f();while(!![]){try{const _0x4191d9=-parseInt(_0x329c5f(0x159))/0x1+parseInt(_0x329c5f(0x15d))/0x2*(parseInt(_0x329c5f(0x163))/0x3)+parseInt(_0x329c5f(0x179))/0x4*(-parseInt(_0x329c5f(0x18f))/0x5)+-parseInt(_0x329c5f(0x185))/0x6+parseInt(_0x329c5f(0x18c))/0x7+-parseInt(_0x329c5f(0x17a))/0x8*(parseInt(_0x329c5f(0x169))/0x9)+parseInt(_0x329c5f(0x170))/0xa;if(_0x4191d9===_0x8fdddd)break;else _0x390824['push'](_0x390824['shift']());}catch(_0x478d83){_0x390824['push'](_0x390824['shift']());}}}(a39_0x1425,0x81c5e));function a39_0x1425(){const _0x26518c=['Removed\x20service\x20','Local\x20service\x20not\x20found:\x20','\x20service(s),\x20updated\x20','file','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','normalizedManifest','registryIndex','risk','import','cliPath','errors','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','export','warnings','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','1061165VSbxwU','manifest','registryPath','string','1687558sGqTIU','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','serviceCode','cliName','Updated','WRITE','3mjGSDZ','length','entries','importedAt','updated','type','603gunlEd','write','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','replaced','map','Exported\x20service\x20','12221280feMOgy','Service\x20Tree\x20manifest\x20file\x20path','remove','version','description','registry','Imported','read','service','280DBbeUG','119024yLcKFd','\x20service\x20','imported','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Service\x20manifest\x20validation\x20passed.','str','commands','source','flags','hash','report','870918LwhYXw','entry','Local\x20service\x20code,\x20for\x20example\x20crm','filePath','Service\x20registry\x20validation\x20passed.','serviceCount','kind','4919159PyPUQo','validate','manifests','2425IPzFGL'];a39_0x1425=function(){return _0x26518c;};return a39_0x1425();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a39_0x274c(_0x27c41e,_0x1b0f5a){_0x27c41e=_0x27c41e-0x157;const _0x14258a=a39_0x1425();let _0x274c32=_0x14258a[_0x27c41e];return _0x274c32;}const FILE_FLAG={'name':'file','type':a39_0x14c7ef(0x15c),'required':!![],'description':a39_0x14c7ef(0x171)},SERVICE_FLAG={'name':'service','type':'string','required':!![],'description':a39_0x14c7ef(0x187),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0x22a6d6){const _0xa96a83=a39_0x14c7ef;return{'serviceCode':_0x22a6d6[_0xa96a83(0x15f)],'name':_0x22a6d6[_0xa96a83(0x195)]['service']['name'],'version':_0x22a6d6['version'],'importedAt':_0x22a6d6[_0xa96a83(0x166)],'source':_0x22a6d6['source'],'commandCount':_0x22a6d6[_0xa96a83(0x195)][_0xa96a83(0x180)][_0xa96a83(0x164)],'commands':_0x22a6d6['normalizedManifest'][_0xa96a83(0x180)][_0xa96a83(0x16e)](_0xf31415=>({'path':_0xf31415[_0xa96a83(0x199)],'description':_0xf31415[_0xa96a83(0x174)],'risk':_0xf31415[_0xa96a83(0x197)],'target':_0xf31415['target'],'flags':_0xf31415[_0xa96a83(0x182)][_0xa96a83(0x16e)](_0x24bd41=>({'name':_0x24bd41['name'],'cliName':_0x24bd41[_0xa96a83(0x160)],'type':_0x24bd41[_0xa96a83(0x168)],'required':_0x24bd41['required']===!![]}))}))};}function summarizeLoadedManifest(_0x5da625){const _0xce1b90=a39_0x14c7ef;return{'service':_0x5da625[_0xce1b90(0x195)]?.[_0xce1b90(0x178)],'version':_0x5da625[_0xce1b90(0x195)]?.[_0xce1b90(0x173)],'commandCount':_0x5da625['normalizedManifest']?.[_0xce1b90(0x180)]['length']??0x0,'commands':_0x5da625[_0xce1b90(0x195)]?.['commands'][_0xce1b90(0x16e)](_0x35e17f=>({'path':_0x35e17f['cliPath'],'risk':_0x35e17f['risk'],'target':_0x35e17f['target']}))??[],'registryIndex':_0x5da625[_0xce1b90(0x196)],'registryServiceCode':_0x5da625['registryServiceCode'],'errors':_0x5da625[_0xce1b90(0x184)]['errors'],'warnings':_0x5da625[_0xce1b90(0x184)][_0xce1b90(0x157)]};}export const serviceDefinitions=[{'service':a39_0x14c7ef(0x178),'command':a39_0x14c7ef(0x18d),'description':a39_0x14c7ef(0x16c),'risk':a39_0x14c7ef(0x177),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x353c62){const _0x477f78=a39_0x14c7ef,_0x232110=loadServiceManifestFromFile(_0x353c62[_0x477f78(0x17f)](_0x477f78(0x193)));if(!_0x232110[_0x477f78(0x184)]['ok'])return{'ok':![],'data':{'file':_0x232110['filePath'],'hash':_0x232110[_0x477f78(0x183)],'kind':_0x232110[_0x477f78(0x18b)],'serviceCount':_0x232110[_0x477f78(0x18e)][_0x477f78(0x164)],'services':_0x232110[_0x477f78(0x18e)][_0x477f78(0x16e)](summarizeLoadedManifest),'errors':_0x232110[_0x477f78(0x184)][_0x477f78(0x19a)],'warnings':_0x232110['report']['warnings']},'message':formatValidationFailure(_0x232110[_0x477f78(0x184)])};if(_0x232110['kind']===_0x477f78(0x175)||_0x232110[_0x477f78(0x18e)][_0x477f78(0x164)]!==0x1)return{'ok':!![],'data':{'file':_0x232110[_0x477f78(0x188)],'hash':_0x232110[_0x477f78(0x183)],'kind':_0x232110['kind'],'serviceCount':_0x232110[_0x477f78(0x18e)]['length'],'commandCount':_0x232110['manifests']['reduce']((_0x3b22f9,_0x2baff2)=>_0x3b22f9+(_0x2baff2[_0x477f78(0x195)]?.['commands'][_0x477f78(0x164)]??0x0),0x0),'services':_0x232110[_0x477f78(0x18e)][_0x477f78(0x16e)](summarizeLoadedManifest),'warnings':_0x232110['report']['warnings']},'message':_0x477f78(0x189)};return{'ok':!![],'data':{'file':_0x232110[_0x477f78(0x188)],'hash':_0x232110[_0x477f78(0x183)],'kind':_0x232110[_0x477f78(0x18b)],'service':_0x232110['normalizedManifest']?.[_0x477f78(0x178)],'version':_0x232110[_0x477f78(0x195)]?.[_0x477f78(0x173)],'commandCount':_0x232110[_0x477f78(0x195)]?.[_0x477f78(0x180)][_0x477f78(0x164)]??0x0,'commands':_0x232110['normalizedManifest']?.[_0x477f78(0x180)][_0x477f78(0x16e)](_0x5e5961=>({'path':_0x5e5961[_0x477f78(0x199)],'risk':_0x5e5961[_0x477f78(0x197)],'target':_0x5e5961['target']})),'warnings':_0x232110[_0x477f78(0x184)][_0x477f78(0x157)]},'message':_0x477f78(0x17e)};}},{'service':a39_0x14c7ef(0x178),'command':a39_0x14c7ef(0x198),'description':a39_0x14c7ef(0x194),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x36abdc){const _0x535b74=a39_0x14c7ef,_0x3c0eee=loadServiceManifestFromFile(_0x36abdc[_0x535b74(0x17f)]('file'));return{'method':_0x535b74(0x162),'url':getServiceRegistryPath(),'body':{'file':_0x3c0eee[_0x535b74(0x188)],'hash':_0x3c0eee[_0x535b74(0x183)],'kind':_0x3c0eee[_0x535b74(0x18b)],'ok':_0x3c0eee['report']['ok'],'service':_0x3c0eee['normalizedManifest']?.[_0x535b74(0x178)],'version':_0x3c0eee['normalizedManifest']?.[_0x535b74(0x173)],'serviceCount':_0x3c0eee[_0x535b74(0x18e)][_0x535b74(0x164)],'services':_0x3c0eee[_0x535b74(0x18e)][_0x535b74(0x16e)](_0x5dc0f7=>({'service':_0x5dc0f7[_0x535b74(0x195)]?.[_0x535b74(0x178)],'version':_0x5dc0f7[_0x535b74(0x195)]?.[_0x535b74(0x173)],'commandCount':_0x5dc0f7[_0x535b74(0x195)]?.[_0x535b74(0x180)][_0x535b74(0x164)]??0x0,'errors':_0x5dc0f7[_0x535b74(0x184)][_0x535b74(0x19a)]})),'errors':_0x3c0eee['report']['errors'],'commandCount':_0x3c0eee[_0x535b74(0x195)]?.['commands'][_0x535b74(0x164)]??0x0},'description':_0x535b74(0x15e)};},async 'execute'(_0x38cb09){const _0x3918da=a39_0x14c7ef,_0x39c9d4=importServiceManifest(_0x38cb09['str'](_0x3918da(0x193)));if(_0x39c9d4[_0x3918da(0x165)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x39c9d4[_0x3918da(0x15b)],'imported':_0x39c9d4[_0x3918da(0x17c)],'updated':_0x39c9d4[_0x3918da(0x167)],'serviceCount':_0x39c9d4[_0x3918da(0x18a)],'services':_0x39c9d4[_0x3918da(0x165)]['map'](summarizeService)},'message':'Imported\x20'+_0x39c9d4[_0x3918da(0x17c)]+_0x3918da(0x192)+_0x39c9d4[_0x3918da(0x167)]+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x39c9d4[_0x3918da(0x15b)],'replaced':_0x39c9d4[_0x3918da(0x16d)],'imported':_0x39c9d4[_0x3918da(0x17c)],'updated':_0x39c9d4[_0x3918da(0x167)],'serviceCount':_0x39c9d4[_0x3918da(0x18a)],'service':summarizeService(_0x39c9d4['entry'])},'message':(_0x39c9d4[_0x3918da(0x16d)]?_0x3918da(0x161):_0x3918da(0x176))+_0x3918da(0x17b)+_0x39c9d4[_0x3918da(0x186)][_0x3918da(0x15f)]+'.'};}},{'service':'service','command':a39_0x14c7ef(0x19d),'description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a39_0x14c7ef(0x16a),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x55b2bd){const _0x13cf55=a39_0x14c7ef,_0x5acbd5=getLocalServiceEntry(_0x55b2bd[_0x13cf55(0x17f)](_0x13cf55(0x178)));return{'method':'WRITE','url':_0x55b2bd[_0x13cf55(0x17f)](_0x13cf55(0x193)),'body':{'service':_0x55b2bd[_0x13cf55(0x17f)](_0x13cf55(0x178)),'found':Boolean(_0x5acbd5),'version':_0x5acbd5?.[_0x13cf55(0x173)],'source':_0x5acbd5?.[_0x13cf55(0x181)]},'description':_0x13cf55(0x19c)};},async 'execute'(_0x582b65){const _0x4c6c0e=a39_0x14c7ef,_0x2e7555=exportServiceManifest(_0x582b65[_0x4c6c0e(0x17f)](_0x4c6c0e(0x178)),_0x582b65[_0x4c6c0e(0x17f)](_0x4c6c0e(0x193)));return{'ok':!![],'data':{'registryPath':_0x2e7555['registryPath'],'file':_0x2e7555[_0x4c6c0e(0x188)],'service':summarizeService(_0x2e7555[_0x4c6c0e(0x186)])},'message':_0x4c6c0e(0x16f)+_0x2e7555['entry'][_0x4c6c0e(0x15f)]+'.'};}},{'service':a39_0x14c7ef(0x178),'command':'list','description':a39_0x14c7ef(0x158),'risk':a39_0x14c7ef(0x177),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5a721f=a39_0x14c7ef,_0x90a193=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x90a193[_0x5a721f(0x164)],'services':_0x90a193[_0x5a721f(0x16e)](summarizeService)}};}},{'service':a39_0x14c7ef(0x178),'command':a39_0x14c7ef(0x172),'description':a39_0x14c7ef(0x19b),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x77d550){const _0x1d83bc=a39_0x14c7ef,_0x48d8f7=getLocalServiceEntry(_0x77d550[_0x1d83bc(0x17f)](_0x1d83bc(0x178)));return{'method':_0x1d83bc(0x162),'url':getServiceRegistryPath(),'body':{'service':_0x77d550[_0x1d83bc(0x17f)](_0x1d83bc(0x178)),'found':Boolean(_0x48d8f7),'version':_0x48d8f7?.[_0x1d83bc(0x173)],'source':_0x48d8f7?.[_0x1d83bc(0x181)]},'description':_0x1d83bc(0x16b)};},async 'execute'(_0x463c59){const _0x4258fe=a39_0x14c7ef,_0x48fb94=removeServiceManifest(_0x463c59['str'](_0x4258fe(0x178)));return{'ok':!![],'data':{'registryPath':_0x48fb94[_0x4258fe(0x15b)],'serviceCount':_0x48fb94[_0x4258fe(0x18a)],'service':summarizeService(_0x48fb94[_0x4258fe(0x186)])},'message':_0x4258fe(0x190)+_0x48fb94[_0x4258fe(0x186)][_0x4258fe(0x15f)]+'.'};}},{'service':'service','command':'detail','description':a39_0x14c7ef(0x17d),'risk':a39_0x14c7ef(0x177),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1136ea){const _0x3af788=a39_0x14c7ef,_0x36f21e=getLocalServiceEntry(_0x1136ea[_0x3af788(0x17f)]('service'));if(!_0x36f21e)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1136ea[_0x3af788(0x17f)](_0x3af788(0x178))},'message':_0x3af788(0x191)+_0x1136ea[_0x3af788(0x17f)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x36f21e),'manifest':_0x36f21e[_0x3af788(0x15a)],'normalizedManifest':_0x36f21e['normalizedManifest']}};}}];
1
+ const a39_0x1b976b=a39_0x5c55;(function(_0x445ef4,_0x3972ef){const _0x5296a2=a39_0x5c55,_0x11bace=_0x445ef4();while(!![]){try{const _0x25335d=parseInt(_0x5296a2(0x215))/0x1*(-parseInt(_0x5296a2(0x1f0))/0x2)+-parseInt(_0x5296a2(0x219))/0x3*(-parseInt(_0x5296a2(0x20e))/0x4)+-parseInt(_0x5296a2(0x1ef))/0x5*(-parseInt(_0x5296a2(0x21b))/0x6)+-parseInt(_0x5296a2(0x1fc))/0x7*(parseInt(_0x5296a2(0x21e))/0x8)+parseInt(_0x5296a2(0x20f))/0x9*(parseInt(_0x5296a2(0x20b))/0xa)+parseInt(_0x5296a2(0x1fd))/0xb+parseInt(_0x5296a2(0x202))/0xc;if(_0x25335d===_0x3972ef)break;else _0x11bace['push'](_0x11bace['shift']());}catch(_0x5d4dda){_0x11bace['push'](_0x11bace['shift']());}}}(a39_0x1484,0x2593e));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x1b976b(0x201),'type':a39_0x1b976b(0x22d),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a39_0x1b976b(0x1e7),'type':a39_0x1b976b(0x22d),'required':!![],'description':a39_0x1b976b(0x1f2),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x1b976b(0x1f9)}};function a39_0x1484(){const _0x58e6de=['name','serviceCount','registryPath','str','cliName','export','description','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','11190uAljmJ','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','detail','4912wGbwlH','927Uhuzlc','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','Imported\x20','kind','manifest','map','153239nNyNTv','Service\x20registry\x20validation\x20passed.','\x20service\x20','\x20service(s).','282UAKCvt','version','267510crPkqj','type','risk','24qetfdJ','write','normalizedManifest','updated','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','warnings','commands','import','filePath','errors','imported','Removed\x20service\x20','manifests','remove','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','string','registryServiceCode','replaced','Exported\x20service\x20','source','required','service','reduce','length','Updated','flags','cliPath','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','target','5iyRaJV','2FkgyEo','serviceCode','Local\x20service\x20code,\x20for\x20example\x20crm','hash','entries','WRITE','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','Service\x20manifest\x20validation\x20passed.','lower\x20kebab-case\x20service\x20code','\x20service(s),\x20updated\x20','report','632737ssFAjc','1538438BtnRKa','entry','registry','read','file','1958376wquSmq'];a39_0x1484=function(){return _0x58e6de;};return a39_0x1484();}function summarizeService(_0x1b4636){const _0x10655d=a39_0x1b976b;return{'serviceCode':_0x1b4636[_0x10655d(0x1f1)],'name':_0x1b4636[_0x10655d(0x220)][_0x10655d(0x1e7)][_0x10655d(0x203)],'version':_0x1b4636[_0x10655d(0x21a)],'importedAt':_0x1b4636['importedAt'],'source':_0x1b4636[_0x10655d(0x231)],'commandCount':_0x1b4636[_0x10655d(0x220)][_0x10655d(0x224)]['length'],'commands':_0x1b4636['normalizedManifest'][_0x10655d(0x224)]['map'](_0x556686=>({'path':_0x556686[_0x10655d(0x1ec)],'description':_0x556686[_0x10655d(0x209)],'risk':_0x556686[_0x10655d(0x21d)],'target':_0x556686[_0x10655d(0x1ee)],'flags':_0x556686[_0x10655d(0x1eb)]['map'](_0x212ec5=>({'name':_0x212ec5[_0x10655d(0x203)],'cliName':_0x212ec5[_0x10655d(0x207)],'type':_0x212ec5[_0x10655d(0x21c)],'required':_0x212ec5[_0x10655d(0x1e6)]===!![]}))}))};}function summarizeLoadedManifest(_0x471540){const _0x21535c=a39_0x1b976b;return{'service':_0x471540[_0x21535c(0x220)]?.[_0x21535c(0x1e7)],'version':_0x471540['normalizedManifest']?.['version'],'commandCount':_0x471540[_0x21535c(0x220)]?.[_0x21535c(0x224)][_0x21535c(0x1e9)]??0x0,'commands':_0x471540[_0x21535c(0x220)]?.[_0x21535c(0x224)][_0x21535c(0x214)](_0x380e3b=>({'path':_0x380e3b[_0x21535c(0x1ec)],'risk':_0x380e3b[_0x21535c(0x21d)],'target':_0x380e3b[_0x21535c(0x1ee)]}))??[],'registryIndex':_0x471540['registryIndex'],'registryServiceCode':_0x471540[_0x21535c(0x22e)],'errors':_0x471540[_0x21535c(0x1fb)][_0x21535c(0x227)],'warnings':_0x471540[_0x21535c(0x1fb)][_0x21535c(0x223)]};}function a39_0x5c55(_0x3e3e4b,_0x1abf78){_0x3e3e4b=_0x3e3e4b-0x1e6;const _0x148456=a39_0x1484();let _0x5c5539=_0x148456[_0x3e3e4b];return _0x5c5539;}export const serviceDefinitions=[{'service':'service','command':'validate','description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a39_0x1b976b(0x200),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x6b9365){const _0x275b5e=a39_0x1b976b,_0xba4629=loadServiceManifestFromFile(_0x6b9365[_0x275b5e(0x206)](_0x275b5e(0x201)));if(!_0xba4629[_0x275b5e(0x1fb)]['ok'])return{'ok':![],'data':{'file':_0xba4629[_0x275b5e(0x226)],'hash':_0xba4629[_0x275b5e(0x1f3)],'kind':_0xba4629[_0x275b5e(0x212)],'serviceCount':_0xba4629['manifests']['length'],'services':_0xba4629[_0x275b5e(0x22a)][_0x275b5e(0x214)](summarizeLoadedManifest),'errors':_0xba4629[_0x275b5e(0x1fb)][_0x275b5e(0x227)],'warnings':_0xba4629[_0x275b5e(0x1fb)]['warnings']},'message':formatValidationFailure(_0xba4629['report'])};if(_0xba4629[_0x275b5e(0x212)]===_0x275b5e(0x1ff)||_0xba4629[_0x275b5e(0x22a)][_0x275b5e(0x1e9)]!==0x1)return{'ok':!![],'data':{'file':_0xba4629[_0x275b5e(0x226)],'hash':_0xba4629['hash'],'kind':_0xba4629[_0x275b5e(0x212)],'serviceCount':_0xba4629[_0x275b5e(0x22a)][_0x275b5e(0x1e9)],'commandCount':_0xba4629[_0x275b5e(0x22a)][_0x275b5e(0x1e8)]((_0x310822,_0x5b1acd)=>_0x310822+(_0x5b1acd[_0x275b5e(0x220)]?.[_0x275b5e(0x224)][_0x275b5e(0x1e9)]??0x0),0x0),'services':_0xba4629['manifests']['map'](summarizeLoadedManifest),'warnings':_0xba4629['report'][_0x275b5e(0x223)]},'message':_0x275b5e(0x216)};return{'ok':!![],'data':{'file':_0xba4629[_0x275b5e(0x226)],'hash':_0xba4629[_0x275b5e(0x1f3)],'kind':_0xba4629['kind'],'service':_0xba4629[_0x275b5e(0x220)]?.['service'],'version':_0xba4629[_0x275b5e(0x220)]?.[_0x275b5e(0x21a)],'commandCount':_0xba4629[_0x275b5e(0x220)]?.[_0x275b5e(0x224)][_0x275b5e(0x1e9)]??0x0,'commands':_0xba4629[_0x275b5e(0x220)]?.['commands'][_0x275b5e(0x214)](_0x52687a=>({'path':_0x52687a['cliPath'],'risk':_0x52687a['risk'],'target':_0x52687a['target']})),'warnings':_0xba4629[_0x275b5e(0x1fb)][_0x275b5e(0x223)]},'message':_0x275b5e(0x1f8)};}},{'service':'service','command':a39_0x1b976b(0x225),'description':a39_0x1b976b(0x1f7),'risk':a39_0x1b976b(0x21f),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x5e8834){const _0x1ae462=a39_0x1b976b,_0x4b2438=loadServiceManifestFromFile(_0x5e8834['str'](_0x1ae462(0x201)));return{'method':_0x1ae462(0x1f5),'url':getServiceRegistryPath(),'body':{'file':_0x4b2438[_0x1ae462(0x226)],'hash':_0x4b2438[_0x1ae462(0x1f3)],'kind':_0x4b2438[_0x1ae462(0x212)],'ok':_0x4b2438[_0x1ae462(0x1fb)]['ok'],'service':_0x4b2438[_0x1ae462(0x220)]?.['service'],'version':_0x4b2438[_0x1ae462(0x220)]?.[_0x1ae462(0x21a)],'serviceCount':_0x4b2438[_0x1ae462(0x22a)][_0x1ae462(0x1e9)],'services':_0x4b2438[_0x1ae462(0x22a)][_0x1ae462(0x214)](_0x4c8561=>({'service':_0x4c8561['normalizedManifest']?.[_0x1ae462(0x1e7)],'version':_0x4c8561[_0x1ae462(0x220)]?.[_0x1ae462(0x21a)],'commandCount':_0x4c8561[_0x1ae462(0x220)]?.[_0x1ae462(0x224)]['length']??0x0,'errors':_0x4c8561[_0x1ae462(0x1fb)]['errors']})),'errors':_0x4b2438[_0x1ae462(0x1fb)][_0x1ae462(0x227)],'commandCount':_0x4b2438['normalizedManifest']?.['commands'][_0x1ae462(0x1e9)]??0x0},'description':_0x1ae462(0x1f6)};},async 'execute'(_0x2573a1){const _0x33e6c0=a39_0x1b976b,_0x53affd=importServiceManifest(_0x2573a1[_0x33e6c0(0x206)]('file'));if(_0x53affd[_0x33e6c0(0x1f4)][_0x33e6c0(0x1e9)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x53affd[_0x33e6c0(0x205)],'imported':_0x53affd[_0x33e6c0(0x228)],'updated':_0x53affd['updated'],'serviceCount':_0x53affd[_0x33e6c0(0x204)],'services':_0x53affd['entries']['map'](summarizeService)},'message':_0x33e6c0(0x211)+_0x53affd['imported']+_0x33e6c0(0x1fa)+_0x53affd[_0x33e6c0(0x221)]+_0x33e6c0(0x218)};return{'ok':!![],'data':{'registryPath':_0x53affd['registryPath'],'replaced':_0x53affd[_0x33e6c0(0x22f)],'imported':_0x53affd[_0x33e6c0(0x228)],'updated':_0x53affd[_0x33e6c0(0x221)],'serviceCount':_0x53affd[_0x33e6c0(0x204)],'service':summarizeService(_0x53affd[_0x33e6c0(0x1fe)])},'message':(_0x53affd[_0x33e6c0(0x22f)]?_0x33e6c0(0x1ea):'Imported')+_0x33e6c0(0x217)+_0x53affd[_0x33e6c0(0x1fe)][_0x33e6c0(0x1f1)]+'.'};}},{'service':'service','command':a39_0x1b976b(0x208),'description':a39_0x1b976b(0x22c),'risk':a39_0x1b976b(0x21f),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x4539a4){const _0x425465=a39_0x1b976b,_0x10595=getLocalServiceEntry(_0x4539a4[_0x425465(0x206)]('service'));return{'method':'WRITE','url':_0x4539a4['str']('file'),'body':{'service':_0x4539a4[_0x425465(0x206)](_0x425465(0x1e7)),'found':Boolean(_0x10595),'version':_0x10595?.[_0x425465(0x21a)],'source':_0x10595?.['source']},'description':_0x425465(0x210)};},async 'execute'(_0x12e47f){const _0x59693b=a39_0x1b976b,_0x30d389=exportServiceManifest(_0x12e47f[_0x59693b(0x206)](_0x59693b(0x1e7)),_0x12e47f[_0x59693b(0x206)]('file'));return{'ok':!![],'data':{'registryPath':_0x30d389[_0x59693b(0x205)],'file':_0x30d389[_0x59693b(0x226)],'service':summarizeService(_0x30d389[_0x59693b(0x1fe)])},'message':_0x59693b(0x230)+_0x30d389[_0x59693b(0x1fe)][_0x59693b(0x1f1)]+'.'};}},{'service':a39_0x1b976b(0x1e7),'command':'list','description':a39_0x1b976b(0x20c),'risk':a39_0x1b976b(0x200),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x558092=a39_0x1b976b,_0x37d371=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x37d371['length'],'services':_0x37d371[_0x558092(0x214)](summarizeService)}};}},{'service':'service','command':a39_0x1b976b(0x22b),'description':a39_0x1b976b(0x20a),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x7878d6){const _0x2a98cc=a39_0x1b976b,_0x2acc8d=getLocalServiceEntry(_0x7878d6[_0x2a98cc(0x206)]('service'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x7878d6[_0x2a98cc(0x206)]('service'),'found':Boolean(_0x2acc8d),'version':_0x2acc8d?.['version'],'source':_0x2acc8d?.[_0x2a98cc(0x231)]},'description':_0x2a98cc(0x222)};},async 'execute'(_0x3d0c24){const _0x46fa20=a39_0x1b976b,_0x7b7bd0=removeServiceManifest(_0x3d0c24[_0x46fa20(0x206)](_0x46fa20(0x1e7)));return{'ok':!![],'data':{'registryPath':_0x7b7bd0[_0x46fa20(0x205)],'serviceCount':_0x7b7bd0[_0x46fa20(0x204)],'service':summarizeService(_0x7b7bd0[_0x46fa20(0x1fe)])},'message':_0x46fa20(0x229)+_0x7b7bd0[_0x46fa20(0x1fe)][_0x46fa20(0x1f1)]+'.'};}},{'service':'service','command':a39_0x1b976b(0x20d),'description':a39_0x1b976b(0x1ed),'risk':a39_0x1b976b(0x200),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x18e1aa){const _0x14a04d=a39_0x1b976b,_0xdf4de3=getLocalServiceEntry(_0x18e1aa[_0x14a04d(0x206)](_0x14a04d(0x1e7)));if(!_0xdf4de3)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x18e1aa[_0x14a04d(0x206)](_0x14a04d(0x1e7))},'message':'Local\x20service\x20not\x20found:\x20'+_0x18e1aa['str'](_0x14a04d(0x1e7))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0xdf4de3),'manifest':_0xdf4de3[_0x14a04d(0x213)],'normalizedManifest':_0xdf4de3[_0x14a04d(0x220)]}};}}];